diff --git a/package.json b/package.json index fd60dba..6a76afd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/controllers/ParallelCoordinatesController.ts b/src/controllers/ParallelCoordinatesController.ts index 492f330..567b928 100644 --- a/src/controllers/ParallelCoordinatesController.ts +++ b/src/controllers/ParallelCoordinatesController.ts @@ -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]; @@ -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); @@ -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); }