From fe307bc4453ba7f1ac851f384759389a83e86072 Mon Sep 17 00:00:00 2001 From: skie1997 Date: Tue, 7 May 2024 17:56:31 +0800 Subject: [PATCH 1/2] fix(marker): markpoint error in map --- docs/assets/examples/en/marker/geo-mark-point.md | 4 ++-- docs/assets/examples/zh/marker/geo-mark-point.md | 4 ++-- docs/assets/option/en/component/mark-point.md | 2 +- docs/assets/option/zh/component/mark-point.md | 2 +- packages/vchart/src/component/map-label/component.ts | 3 ++- .../vchart/src/component/marker/mark-point/interface/spec.ts | 2 +- packages/vchart/src/component/marker/utils.ts | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/assets/examples/en/marker/geo-mark-point.md b/docs/assets/examples/en/marker/geo-mark-point.md index 4ebda09cb9..f829bd4a3f 100644 --- a/docs/assets/examples/en/marker/geo-mark-point.md +++ b/docs/assets/examples/en/marker/geo-mark-point.md @@ -12,7 +12,7 @@ option: mapChart#markPoint ## Key Configuration -- Use the `markPoint.name` attribute to declare the geographical location to be marked +- Use the `markPoint.areaName` attribute to declare the geographical location to be marked ## Demo source @@ -84,7 +84,7 @@ option: mapChart#markPoint ], markPoint: data.map(d => { return { - name: d.name, + areaName: d.name, itemLine: { visible: false, }, diff --git a/docs/assets/examples/zh/marker/geo-mark-point.md b/docs/assets/examples/zh/marker/geo-mark-point.md index 704f390758..7158055058 100644 --- a/docs/assets/examples/zh/marker/geo-mark-point.md +++ b/docs/assets/examples/zh/marker/geo-mark-point.md @@ -12,7 +12,7 @@ option: mapChart#markPoint ## 关键配置 -- 使用 `markPoint.name` 属性声明要标注的地理位置 +- 使用 `markPoint.areaName` 属性声明要标注的地理位置 ## 代码演示 @@ -84,7 +84,7 @@ option: mapChart#markPoint ], markPoint: data.map(d => { return { - name: d.name, + areaName: d.name, itemLine: { visible: false, }, diff --git a/docs/assets/option/en/component/mark-point.md b/docs/assets/option/en/component/mark-point.md index ccb12548ec..019fd73df5 100644 --- a/docs/assets/option/en/component/mark-point.md +++ b/docs/assets/option/en/component/mark-point.md @@ -40,7 +40,7 @@ Since the `1.11.0` version, you can configure the value of the annotation point ** Note that the usage scenario of this property is in the polar coordinate system: ** 1. Configure the angle and radius properties together to label the data points with coordinates on (angle, radius) -### name (string | number | function) +### areaName (string | number | function) Since the `1.11.0` version, you can configure the geographical location of the annotation point on the map, and calculate it yourself through the data in the form of a callback. ** Note that this property is used in a geographic coordinate system ** diff --git a/docs/assets/option/zh/component/mark-point.md b/docs/assets/option/zh/component/mark-point.md index b38e6fb255..e83835f2b3 100644 --- a/docs/assets/option/zh/component/mark-point.md +++ b/docs/assets/option/zh/component/mark-point.md @@ -38,7 +38,7 @@ **注意该属性的使用场景为极坐标系下:** 1. 配合配置 angle,radius 属性,用于标注坐标在(angle, radius)上的数据点 -### name(string|number|function) +### areaName(string|number|function) 自`1.11.0`版本开始支持, 可以配置标注点在地图上的地理位置, 以回调的形式通过数据自行计算。 **注意该属性的使用场景为地理坐标系** diff --git a/packages/vchart/src/component/map-label/component.ts b/packages/vchart/src/component/map-label/component.ts index dc6abeba3d..f47482bff2 100644 --- a/packages/vchart/src/component/map-label/component.ts +++ b/packages/vchart/src/component/map-label/component.ts @@ -203,7 +203,8 @@ export class MapLabelComponent extends BaseComponent { if (!this._markerComponents) { this._markerComponents = this._data?.getLatestData().map((data: Datum, index: number) => { const cmp = new MarkPoint({ - position: undefined + position: undefined, + animation: false // 地图标签使用的是markPoint, 暂不开启动画, 待优化@chensiji }); if (cmp) { cmp.name = `${this.name}_marker_${index}`; diff --git a/packages/vchart/src/component/marker/mark-point/interface/spec.ts b/packages/vchart/src/component/marker/mark-point/interface/spec.ts index be26b4b7e7..080f955b84 100644 --- a/packages/vchart/src/component/marker/mark-point/interface/spec.ts +++ b/packages/vchart/src/component/marker/mark-point/interface/spec.ts @@ -66,7 +66,7 @@ export type IMarkPointGeoNameSpec = { * 地理坐标系下, 地理区域的名称。 * @since 0.11.0 */ - name: string | IDataPosCallback; + areaName: string | IDataPosCallback; }; export type IMarkPointCoordinateSpec = { diff --git a/packages/vchart/src/component/marker/utils.ts b/packages/vchart/src/component/marker/utils.ts index 09ff60806b..b9f855a9b2 100644 --- a/packages/vchart/src/component/marker/utils.ts +++ b/packages/vchart/src/component/marker/utils.ts @@ -584,7 +584,7 @@ export function getMarkAreaProcessInfo(spec: any) { export function getMarkPointProcessInfo(spec: any) { const isXYProcess = isValid(spec.x) && isValid(spec.y); const isPolarProcess = isValid(spec.angle) && isValid(spec.radius); - const isGeoProcess = isValid(spec.name); + const isGeoProcess = isValid(spec.areaName); return { doXYProcess: isXYProcess, doPolarProcess: isPolarProcess, From 29dd7c838126e1ca026a03568aa0c009a747261f Mon Sep 17 00:00:00 2001 From: skie1997 Date: Tue, 7 May 2024 18:13:27 +0800 Subject: [PATCH 2/2] fix(marker): reset spec.name to spec.areaName --- docs/assets/option/en/component/mark-point.md | 4 +-- .../en/component/marker-common/marker-axis.md | 4 +-- docs/assets/option/zh/component/mark-point.md | 4 +-- .../zh/component/marker-common/marker-axis.md | 4 +-- .../src/component/marker/base-marker.ts | 6 ++--- .../vchart/src/component/marker/interface.ts | 4 +-- .../marker/mark-area/interface/spec.ts | 18 ++++++------- .../marker/mark-line/interface/spec.ts | 26 +++++++++---------- .../marker/mark-point/geo-mark-point.ts | 2 +- .../marker/mark-point/interface/spec.ts | 12 ++++----- packages/vchart/src/component/marker/utils.ts | 6 ++--- .../vchart/src/data/transforms/aggregation.ts | 14 +++++----- 12 files changed, 52 insertions(+), 52 deletions(-) diff --git a/docs/assets/option/en/component/mark-point.md b/docs/assets/option/en/component/mark-point.md index 019fd73df5..ff727dd7fc 100644 --- a/docs/assets/option/en/component/mark-point.md +++ b/docs/assets/option/en/component/mark-point.md @@ -177,7 +177,7 @@ layout like this: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/marker-pos The x-direction offset of the mark content relative to the mark point. -In addition to directly configuring offset values, since the `0.11.0` version: +In addition to directly configuring offset values, since the `1.11.0` version: 1. `'regionRight'` | `'regionLeft'`: Used to place at the leftmost or rightmost end of the region. 2. Callback form ```ts @@ -188,7 +188,7 @@ In addition to directly configuring offset values, since the `0.11.0` version: The y-direction offset of the mark content relative to the mark point. -In addition to directly configuring offset values, since the `0.11.0` version: +In addition to directly configuring offset values, since the `1.11.0` version: 1. `'regionTop'` | `'regionBottom'`: Used to place at the topmost or bottommost end of the region. 2. Callback form ```ts diff --git a/docs/assets/option/en/component/marker-common/marker-axis.md b/docs/assets/option/en/component/marker-common/marker-axis.md index 18d8d65f83..b24b539b89 100644 --- a/docs/assets/option/en/component/marker-common/marker-axis.md +++ b/docs/assets/option/en/component/marker-common/marker-axis.md @@ -25,7 +25,7 @@ The series index associated with the marked data (default is using the first val The series ID associated with the marked data (default is using the first valid series in the current region). #${prefix} specifiedDataSeriesIndex(string|number|array) -Since the `0.11.0` version, data processing needs to be associated with series separately. When configured as 'all', it means that all series under the current region are associated. +Since the `1.11.0` version, data processing needs to be associated with series separately. When configured as 'all', it means that all series under the current region are associated. #${prefix} specifiedDataSeriesId(string|number|array) -Since the `0.11.0` version, data processing needs to be associated with series separately. When configured as 'all', it means that all series under the current region are associated. \ No newline at end of file +Since the `1.11.0` version, data processing needs to be associated with series separately. When configured as 'all', it means that all series under the current region are associated. \ No newline at end of file diff --git a/docs/assets/option/zh/component/mark-point.md b/docs/assets/option/zh/component/mark-point.md index e83835f2b3..13d0fa6d8e 100644 --- a/docs/assets/option/zh/component/mark-point.md +++ b/docs/assets/option/zh/component/mark-point.md @@ -177,7 +177,7 @@ 标注内容相对于标注点的 x 方向偏移量。 -除了直接配置偏移量数值外,自`0.11.0` 版本起提供了: +除了直接配置偏移量数值外,自`1.11.0` 版本起提供了: 1. `'regionRight' | 'regionLeft'`: 用于放置在region最左端或最右端。 2. 回调形式 ```ts @@ -188,7 +188,7 @@ 标注内容相对于标注点的 y 方向偏移量。 -除了直接配置偏移量数值外,自`0.11.0` 版本起提供了: +除了直接配置偏移量数值外,自`1.11.0` 版本起提供了: 1. `'regionTop' | 'regionBottom'`: 用于放置在region最顶端或最底端。 2. 回调形式 ```ts diff --git a/docs/assets/option/zh/component/marker-common/marker-axis.md b/docs/assets/option/zh/component/marker-common/marker-axis.md index 157a20310e..9330dd783f 100644 --- a/docs/assets/option/zh/component/marker-common/marker-axis.md +++ b/docs/assets/option/zh/component/marker-common/marker-axis.md @@ -25,7 +25,7 @@ 被标注数据关联的series ID(默认使用当前region第一个有效series)。 #${prefix} specifiedDataSeriesIndex(string|number|array) -自`0.11.0`版本,数据处理需要单独关联系列, 当配置为'all'时代表关联当前region下所有系列。 +自`1.11.0`版本,数据处理需要单独关联系列, 当配置为'all'时代表关联当前region下所有系列。 #${prefix} specifiedDataSeriesId(string|number|array) -自`0.11.0`版本,数据处理需要单独关联系列, 当配置为'all'时代表关联当前region下所有系列。 \ No newline at end of file +自`1.11.0`版本,数据处理需要单独关联系列, 当配置为'all'时代表关联当前region下所有系列。 \ No newline at end of file diff --git a/packages/vchart/src/component/marker/base-marker.ts b/packages/vchart/src/component/marker/base-marker.ts index f590a64676..a02918f3a7 100644 --- a/packages/vchart/src/component/marker/base-marker.ts +++ b/packages/vchart/src/component/marker/base-marker.ts @@ -109,7 +109,7 @@ export abstract class BaseMarker extends BaseComponent } private _getFieldInfoFromSpec( - dim: 'x' | 'y' | 'angle' | 'radius' | 'name', + dim: 'x' | 'y' | 'angle' | 'radius' | 'areaName', spec: IDataPos | IDataPosCallback, relativeSeries: IMarkerSupportSeries ) { @@ -118,7 +118,7 @@ export abstract class BaseMarker extends BaseComponent y: 'yField', radius: 'valueField', angle: 'categoryField', - name: 'nameField' + areaName: 'nameField' }; if (isString(spec) && isAggrSpec(spec)) { @@ -132,7 +132,7 @@ export abstract class BaseMarker extends BaseComponent protected _processSpecByDims( dimSpec: { - dim: 'x' | 'y' | 'angle' | 'radius' | 'name'; + dim: 'x' | 'y' | 'angle' | 'radius' | 'areaName'; specValue: IDataPos | IDataPosCallback; }[] ) { diff --git a/packages/vchart/src/component/marker/interface.ts b/packages/vchart/src/component/marker/interface.ts index 7e90dd9725..24698980db 100644 --- a/packages/vchart/src/component/marker/interface.ts +++ b/packages/vchart/src/component/marker/interface.ts @@ -236,7 +236,7 @@ export interface IMarkerCrossSeriesSpec { endRelativeSeriesId?: string; /** * 数据处理需要单独关联系列, 当配置为'all'时代表关联当前region下所有系列 - * @since 0.11.0 + * @since 1.11.0 */ specifiedDataSeriesIndex?: 'all' | number | number[]; specifiedDataSeriesId?: 'all' | string | string[]; @@ -279,7 +279,7 @@ export type IMarkerSpec = IComponentSpec & { /** * 标注所在的坐标系类型 * @description 一般情况下内部逻辑会根据配置自动推导类型,但如果是coordinates的配置方式,则无法推导,需要用户自行配置 - * @since 0.11.0 + * @since 1.11.0 */ coordinateType?: string; }; diff --git a/packages/vchart/src/component/marker/mark-area/interface/spec.ts b/packages/vchart/src/component/marker/mark-area/interface/spec.ts index 2275dc9724..5d6c2945fd 100644 --- a/packages/vchart/src/component/marker/mark-area/interface/spec.ts +++ b/packages/vchart/src/component/marker/mark-area/interface/spec.ts @@ -38,7 +38,7 @@ export type IMarkAreaSpec = IMarkerSpec & IMarkAreaTheme & /** * 动画配置 - * @since 0.11.0 + * @since 1.11.0 */ BaseMarkerAnimation; // 标注目标:任意位置 @@ -78,12 +78,12 @@ export interface IMarkAreaXYSpec extends IMarkerCrossSeriesSpec { export interface IMarkAreaAngleSpec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, angle 轴上位置,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; /** * 极坐标系下, angle 轴上位置,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle1: IDataPos | IDataPosCallback; } @@ -91,12 +91,12 @@ export interface IMarkAreaAngleSpec extends IMarkerCrossSeriesSpec { export interface IMarkAreaRadiusSpec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, radius 轴上位置, 或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; /** * 极坐标系下, radius 轴上位置, 或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius1: IDataPos | IDataPosCallback; } @@ -104,22 +104,22 @@ export interface IMarkAreaRadiusSpec extends IMarkerCrossSeriesSpec { export interface IMarkAreaAngleRadiusSpec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, angle 轴上位置,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; /** * 极坐标系下, angle 轴上位置,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle1: IDataPos | IDataPosCallback; /** * 极坐标系下, radius 轴上位置, 或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; /** * 极坐标系下, radius 轴上位置, 或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius1: IDataPos | IDataPosCallback; } diff --git a/packages/vchart/src/component/marker/mark-line/interface/spec.ts b/packages/vchart/src/component/marker/mark-line/interface/spec.ts index 17a23a0730..71edea6cbb 100644 --- a/packages/vchart/src/component/marker/mark-line/interface/spec.ts +++ b/packages/vchart/src/component/marker/mark-line/interface/spec.ts @@ -46,7 +46,7 @@ export type IMarkLineSpec = IMarkLineTheme & /** * 动画配置 - * @since 0.11.0 + * @since 1.11.0 */ BaseMarkerAnimation) | (IStepMarkLineSpec & BaseMarkerAnimation); // 标注目标:任意位置 @@ -135,7 +135,7 @@ export interface IMarkLineXYSpec extends IMarkerCrossSeriesSpec { export interface IMarkLineAngleSpec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, 参考线在 angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; } @@ -143,7 +143,7 @@ export interface IMarkLineAngleSpec extends IMarkerCrossSeriesSpec { export interface IMarkLineRadiusSpec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, 参考线在 radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; } @@ -151,17 +151,17 @@ export interface IMarkLineRadiusSpec extends IMarkerCrossSeriesSpec { export interface IMarkLineAngRadRad1Spec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, 参考线在 angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius1: IDataPos | IDataPosCallback; } @@ -169,17 +169,17 @@ export interface IMarkLineAngRadRad1Spec extends IMarkerCrossSeriesSpec { export interface IMarkLineRadAngAng1Spec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, 参考线在 angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle1: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; } @@ -187,22 +187,22 @@ export interface IMarkLineRadAngAng1Spec extends IMarkerCrossSeriesSpec { export interface IMarkLineAngRadSpec extends IMarkerCrossSeriesSpec { /** * 极坐标系下, 参考线在 angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle1: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; /** * 极坐标系下, 参考线在 radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius1: IDataPos | IDataPosCallback; } diff --git a/packages/vchart/src/component/marker/mark-point/geo-mark-point.ts b/packages/vchart/src/component/marker/mark-point/geo-mark-point.ts index 23710c6a9e..9b515f93e5 100644 --- a/packages/vchart/src/component/marker/mark-point/geo-mark-point.ts +++ b/packages/vchart/src/component/marker/mark-point/geo-mark-point.ts @@ -21,7 +21,7 @@ export class GeoMarkPoint extends BaseMarkPoint { protected _computeOptions(): any { const spec = this._spec as any; - const options = [this._processSpecByDims([{ dim: 'name', specValue: spec.name }])]; + const options = [this._processSpecByDims([{ dim: 'areaName', specValue: spec.areaName }])]; return { options }; } } diff --git a/packages/vchart/src/component/marker/mark-point/interface/spec.ts b/packages/vchart/src/component/marker/mark-point/interface/spec.ts index 080f955b84..092085682e 100644 --- a/packages/vchart/src/component/marker/mark-point/interface/spec.ts +++ b/packages/vchart/src/component/marker/mark-point/interface/spec.ts @@ -17,11 +17,11 @@ export type IMarkPointSpec = IMarkerSpec & // 标注目标: 笛卡尔坐标系 (| IMarkPointXYSpec /** 标注目标: 极坐标系 - * @since 0.11.0 + * @since 1.11.0 */ | IMarkPointAngleRadiusSpec /** 标注目标: 地理坐标系 - * @since 0.11.0 + * @since 1.11.0 */ | IMarkPointGeoNameSpec // 标注目标:数据元素 @@ -31,7 +31,7 @@ export type IMarkPointSpec = IMarkerSpec & IMarkPointTheme & /** * 动画配置 - * @since 0.11.0 + * @since 1.11.0 */ BaseMarkerAnimation; @@ -51,12 +51,12 @@ export type IMarkPointXYSpec = { export type IMarkPointAngleRadiusSpec = { /** * 极坐标系下, angle 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ angle: IDataPos | IDataPosCallback; /** * 极坐标系下, radius 轴上位置,可以配置参考线在 angle 轴上的值,或者聚合计算类型,或者以回调的形式通过数据自行计算。 - * @since 0.11.0 + * @since 1.11.0 */ radius: IDataPos | IDataPosCallback; }; @@ -64,7 +64,7 @@ export type IMarkPointAngleRadiusSpec = { export type IMarkPointGeoNameSpec = { /** * 地理坐标系下, 地理区域的名称。 - * @since 0.11.0 + * @since 1.11.0 */ areaName: string | IDataPosCallback; }; diff --git a/packages/vchart/src/component/marker/utils.ts b/packages/vchart/src/component/marker/utils.ts index b9f855a9b2..d4fadc0a06 100644 --- a/packages/vchart/src/component/marker/utils.ts +++ b/packages/vchart/src/component/marker/utils.ts @@ -270,15 +270,15 @@ export function geoLayout(data: DataView, relativeSeries: IMarkerSupportSeries) const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData; dataPoints.forEach((datum: any) => { - const isValidName = isValid(datum.name); + const isValidName = isValid(datum.areaName); if (isValidName) { lines.push([ { x: - (relativeSeries as IGeoSeries).nameValueToPosition(datum.name).x + + (relativeSeries as IGeoSeries).nameValueToPosition(datum.areaName).x + relativeSeries.getRegion().getLayoutStartPoint().x, y: - (relativeSeries as IGeoSeries).nameValueToPosition(datum.name).y + + (relativeSeries as IGeoSeries).nameValueToPosition(datum.areaName).y + relativeSeries.getRegion().getLayoutStartPoint().y } ]); diff --git a/packages/vchart/src/data/transforms/aggregation.ts b/packages/vchart/src/data/transforms/aggregation.ts index f6beb9a6d2..6f0e8f0511 100644 --- a/packages/vchart/src/data/transforms/aggregation.ts +++ b/packages/vchart/src/data/transforms/aggregation.ts @@ -36,7 +36,7 @@ export type IOptionAggr = { y?: IOptionPos | IOptionCallback; angle?: IOptionPos | IOptionCallback; radius?: IOptionPos | IOptionCallback; - name?: string | IOptionCallback; + areaName?: string | IOptionCallback; getRefRelativeSeries?: () => IMarkerSupportSeries; } & IOptionSeries; @@ -86,7 +86,7 @@ export function markerAggregation(_data: Array, options: IOptionAggr[] y: StringOrNumber[] | StringOrNumber | IOptionCallback | null; angle: StringOrNumber[] | StringOrNumber | IOptionCallback | null; radius: StringOrNumber[] | StringOrNumber | IOptionCallback | null; - name: string | IOptionCallback | null; + areaName: string | IOptionCallback | null; }[] = []; options.forEach(option => { const result: { @@ -94,9 +94,9 @@ export function markerAggregation(_data: Array, options: IOptionAggr[] y: StringOrNumber[] | StringOrNumber | null; angle: StringOrNumber[] | StringOrNumber | null; radius: StringOrNumber[] | StringOrNumber | null; - name: string | null; + areaName: string | null; getRefRelativeSeries?: () => IMarkerSupportSeries; - } = { x: null, y: null, angle: null, radius: null, name: null }; + } = { x: null, y: null, angle: null, radius: null, areaName: null }; if (isValid(option.x)) { const x = option.x; @@ -131,9 +131,9 @@ export function markerAggregation(_data: Array, options: IOptionAggr[] result.radius = getFinalValue(radius, _data, option) as StringOrNumber; } } - if (isValid(option.name)) { - const name = option.name; - result.name = getFinalValue(name, _data, option) as string; + if (isValid(option.areaName)) { + const name = option.areaName; + result.areaName = getFinalValue(name, _data, option) as string; } if (option.getRefRelativeSeries) { result.getRefRelativeSeries = option.getRefRelativeSeries;