From 4d852da6dbbdc984b18f960f43caed5b49e158f6 Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Sun, 28 Apr 2024 19:09:48 +0800 Subject: [PATCH 1/2] fix: no need to encode mark to group state in funnel --- packages/vchart/src/series/base/base-series.ts | 6 ++++-- packages/vchart/src/series/funnel/funnel.ts | 12 ++++++++---- packages/vchart/src/series/interface/common.ts | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/vchart/src/series/base/base-series.ts b/packages/vchart/src/series/base/base-series.ts index 439547cee5..86b61aef74 100644 --- a/packages/vchart/src/series/base/base-series.ts +++ b/packages/vchart/src/series/base/base-series.ts @@ -1252,14 +1252,16 @@ export abstract class BaseSeries extends BaseModel imp morph = false, clip, customShape, - stateSort + stateSort, + noSeparateStyle = false } = option; const m = super._createMark(markInfo, { key: key ?? this._getDataIdKey(), support3d, seriesId: this.id, attributeContext: this._markAttributeContext, - componentType: option.componentType + componentType: option.componentType, + noSeparateStyle }); if (isValid(m)) { this._marks.addMark(m, { name: markInfo.name }); diff --git a/packages/vchart/src/series/funnel/funnel.ts b/packages/vchart/src/series/funnel/funnel.ts index 8d1ed15aee..c88de2ed4d 100644 --- a/packages/vchart/src/series/funnel/funnel.ts +++ b/packages/vchart/src/series/funnel/funnel.ts @@ -185,7 +185,8 @@ export class FunnelSeries groupKey: this._seriesField, isSeriesMark: true, customShape: this._spec.funnel?.customShape, - stateSort: this._spec.funnel?.stateSort + stateSort: this._spec.funnel?.stateSort, + noSeparateStyle: true } ) as IPolygonMark; @@ -202,7 +203,8 @@ export class FunnelSeries dataView: this._viewDataTransform.getDataView(), dataProductId: this._viewDataTransform.getProductId(), customShape: this._spec.transform?.customShape, - stateSort: this._spec.transform?.stateSort + stateSort: this._spec.transform?.stateSort, + noSeparateStyle: true } ); } @@ -214,13 +216,15 @@ export class FunnelSeries this._funnelOuterLabelMark.label = this._createMark(FunnelSeries.mark.outerLabel, { themeSpec: this._theme?.outerLabel, markSpec: this._spec.outerLabel, - skipBeforeLayouted: true + skipBeforeLayouted: true, + noSeparateStyle: true }) as ITextMark; this._funnelOuterLabelMark.line = this._createMark(FunnelSeries.mark.outerLabelLine, { themeSpec: lineTheme, markSpec: line, - depend: [this._funnelOuterLabelMark.label] + depend: [this._funnelOuterLabelMark.label], + noSeparateStyle: true }) as IRuleMark; } } diff --git a/packages/vchart/src/series/interface/common.ts b/packages/vchart/src/series/interface/common.ts index 07cb0b510d..ac504ed187 100644 --- a/packages/vchart/src/series/interface/common.ts +++ b/packages/vchart/src/series/interface/common.ts @@ -11,7 +11,7 @@ import type { import type { IRegion } from '../../region/interface'; import type { RenderMode } from '../../typings/spec/common'; import type { ISeries } from './series'; -import type { IMarkProgressiveConfig } from '../../mark/interface'; +import type { IMarkOption, IMarkProgressiveConfig } from '../../mark/interface'; import type { ISeriesSpec, StringOrNumber } from '../../typings'; import type { TransformedLabelSpec } from '../../component/label'; import type { SeriesMarkNameEnum, SeriesTypeEnum } from './type'; @@ -69,7 +69,7 @@ export type ISeriesStyleItem = { }; }; -export interface ISeriesMarkInitOption { +export interface ISeriesMarkInitOption extends Partial { /** theme spec */ themeSpec?: any; From 0a68e08061f9e333da246428616ddb16866ad83b Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Sun, 28 Apr 2024 19:13:24 +0800 Subject: [PATCH 2/2] docs: update change log --- .../fix-funnel-noSeparateStyle_2024-04-28-11-13.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vchart/fix-funnel-noSeparateStyle_2024-04-28-11-13.json diff --git a/common/changes/@visactor/vchart/fix-funnel-noSeparateStyle_2024-04-28-11-13.json b/common/changes/@visactor/vchart/fix-funnel-noSeparateStyle_2024-04-28-11-13.json new file mode 100644 index 0000000000..2480c0c4e0 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-funnel-noSeparateStyle_2024-04-28-11-13.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix: duplicated categoryField data in funnel will result to unexpected rendering result", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file