Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only add buckets at the end if last bucket not fully included #234

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node 12
- name: Use Node 16
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16

- name: Cache node modules
id: cache-nodemodules
Expand Down
2 changes: 1 addition & 1 deletion mkDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mkdir target
mkdir target/generated-docs

## GENERATE THE DOCUMENTATION ##
docker run -a STDERR --rm -i -v `pwd`:/docs gisaia/typedocgen:0.0.7 generatedoc src
docker run -a STDERR --rm -i -v `pwd`:/docs gisaia/typedocgen:0.0.8 generatedoc src

## MOVE ALL THE DOCUMENTATION TO THE 'generated-docs' FOLDER ##
if [ -z "$(ls -A ./typedoc_docs)" ]; then
Expand Down
10 changes: 6 additions & 4 deletions src/histograms/charts/AbstractChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export abstract class AbstractChart extends AbstractHistogram {
this.initializeDescriptionValues(minMaxBorders[0], minMaxBorders[1], this.histogramParams.bucketRange);
this.initializeChartDimensions();
this.customizeData(data);
const extendData = this.extendData(data);
this.createChartAxes(extendData);
const extendedData = this.extendData(data);
this.createChartAxes(extendedData);
this.drawChartAxes(this.chartAxes, 0);
this.plotChart(data);
this.showTooltips(data);
Expand Down Expand Up @@ -895,8 +895,10 @@ export abstract class AbstractChart extends AbstractHistogram {
}

extendedData = extendedData.concat(data);
if (+data[data.length - 1].key < +this.selectionInterval.endvalue) {
let fakeDataKey = +data[data.length - 1].key;
// We need to add a bucket only if the start of the next bucket
// is not in the data but included in the selection
if (+data[data.length - 1].key + bucketSize < +this.selectionInterval.endvalue) {
let fakeDataKey = +data[data.length - 1].key + bucketSize;
while (fakeDataKey < +this.selectionInterval.endvalue) {
fakeDataKey += +bucketSize;
if (this.histogramParams.dataType === DataType.numeric) {
Expand Down
Loading