Skip to content

Commit 7a8111c

Browse files
authored
Merge pull request #41 from sgratzl/sgratzl/fix_props
fix: properties shared resolver
2 parents 4a5f57b + 358924a commit 7a8111c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/controllers/ParallelCoordinatesController.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ export class ParallelCoordinatesController extends DatasetController<
170170
const meta = this._cachedMeta as unknown as IExtendedChartMeta;
171171

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

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

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

220222
if (includeOptions) {
221-
properties.options = (sharedOptions || options) as any;
223+
properties.options = options as any;
222224
}
223225
this.updateElement(rectangles[i], i, properties, mode);
224226
}

0 commit comments

Comments
 (0)