Skip to content

Commit

Permalink
Merge pull request #42 from sgratzl/release/v4.2.5
Browse files Browse the repository at this point in the history
Release v4.2.5
  • Loading branch information
sgratzl committed Sep 17, 2023
2 parents 4a5f57b + d8dc791 commit 13f01d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chartjs-chart-pcp",
"description": "Chart.js module for charting parallel coordinate plots",
"version": "4.2.4",
"version": "4.2.5",
"author": {
"name": "Samuel Gratzl",
"email": "sam@sgratzl.com",
Expand Down
8 changes: 5 additions & 3 deletions src/controllers/ParallelCoordinatesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ export class ParallelCoordinatesController extends DatasetController<
const meta = this._cachedMeta as unknown as IExtendedChartMeta;

const firstOpts = this.resolveDataElementOptions(start, mode);
const sharedOptions = this.getSharedOptions(firstOpts) ?? {};
const dummyShared = {};
const sharedOptions = this.getSharedOptions(firstOpts) ?? dummyShared;
const includeOptions = this.includeOptions(mode, sharedOptions);
const getPoint = (metaIndex: number, index: number, defaultValue: { x: number; y: number }) => {
const m = meta._metas[metaIndex];
Expand All @@ -192,7 +193,8 @@ export class ParallelCoordinatesController extends DatasetController<
this.updateSharedOptions(sharedOptions, mode, firstOpts);

for (let i = start; i < start + count; i += 1) {
const options = this.resolveDataElementOptions(i, mode);
const options: typeof firstOpts =
sharedOptions === dummyShared ? this.resolveDataElementOptions(i, mode) : sharedOptions;

const xy = getPoint(meta._metaIndex, i, { x: 0, y: 0 });
const xyPrevious = getPoint(meta._metaIndex - 1, i, xy);
Expand All @@ -218,7 +220,7 @@ export class ParallelCoordinatesController extends DatasetController<
}

if (includeOptions) {
properties.options = (sharedOptions || options) as any;
properties.options = options as any;
}
this.updateElement(rectangles[i], i, properties, mode);
}
Expand Down

0 comments on commit 13f01d9

Please sign in to comment.