From 011466a1bbc0e087644c6ef83afe77281d469f38 Mon Sep 17 00:00:00 2001 From: Samuel Gratzl Date: Sat, 16 Sep 2023 20:58:46 -0400 Subject: [PATCH 1/3] fix: properties shared resolver --- src/controllers/ParallelCoordinatesController.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controllers/ParallelCoordinatesController.ts b/src/controllers/ParallelCoordinatesController.ts index 492f330..aa41697 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,7 @@ 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 = 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 +219,7 @@ export class ParallelCoordinatesController extends DatasetController< } if (includeOptions) { - properties.options = (sharedOptions || options) as any; + properties.options = options; } this.updateElement(rectangles[i], i, properties, mode); } From 358924adb5929c98f5f81f4685ffc39156c53d6e Mon Sep 17 00:00:00 2001 From: Samuel Gratzl Date: Sat, 16 Sep 2023 21:01:55 -0400 Subject: [PATCH 2/3] fix: compile error --- src/controllers/ParallelCoordinatesController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/ParallelCoordinatesController.ts b/src/controllers/ParallelCoordinatesController.ts index aa41697..567b928 100644 --- a/src/controllers/ParallelCoordinatesController.ts +++ b/src/controllers/ParallelCoordinatesController.ts @@ -193,7 +193,8 @@ export class ParallelCoordinatesController extends DatasetController< this.updateSharedOptions(sharedOptions, mode, firstOpts); for (let i = start; i < start + count; i += 1) { - const options = sharedOptions === dummyShared ? this.resolveDataElementOptions(i, mode) : sharedOptions; + 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); @@ -219,7 +220,7 @@ export class ParallelCoordinatesController extends DatasetController< } if (includeOptions) { - properties.options = options; + properties.options = options as any; } this.updateElement(rectangles[i], i, properties, mode); } From d8dc79139a55ef51a546ca9860c9e9832482b36c Mon Sep 17 00:00:00 2001 From: sgratzl Date: Sun, 17 Sep 2023 01:10:13 +0000 Subject: [PATCH 3/3] chore: release v4.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",