Skip to content

Commit

Permalink
Merge pull request #2889 from VisActor/fix/type-define
Browse files Browse the repository at this point in the history
Fix/type define
  • Loading branch information
xile611 committed Jul 2, 2024
2 parents 230576e + 6e9a80a commit a4cdf21
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vchart",
"comment": "fix: type define fix",
"type": "none"
}
],
"packageName": "@visactor/vchart"
}
5 changes: 2 additions & 3 deletions docs/assets/option/en/component/mark-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Since the `1.11.0` version, you can configure the geographical location of the a

** Note that this property is used in a geographic coordinate system **

### coordinates(Object)
### coordinate(Object)

Mark target: data element.
Specifies the mark area for the data point. Draw the mark area based on the specified data point.
Expand Down Expand Up @@ -296,7 +296,6 @@ For mark content type 'richText', the richText style.

Supported since version `1.11.1`, prefixed tag.


#### offset

The gap between the marked content and the marked line.
Expand All @@ -318,4 +317,4 @@ The style of targetSymbol.

{{ use: graphic-symbol(
prefix = '####'
) }}
) }}
3 changes: 2 additions & 1 deletion docs/assets/option/en/series/word-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Color mode.

Optional values:

- `'linear'`: Linear coloring (to be opened)
<!-- - `'linear'`: Linear coloring (to be opened) -->

- `'ordinal'`: Ordinal coloring

#${prefix} colorList(Array)
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/option/en/series/word-cloud3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Color mode.

Optional values:

- `'linear'`: Linear coloring (to be opened)
<!-- - `'linear'`: Linear coloring (to be opened) -->

- `'ordinal'`: Ordinal coloring

#${prefix} colorList(Array)
Expand Down
39 changes: 23 additions & 16 deletions docs/assets/option/zh/component/mark-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,30 @@
- 回调函数

### angle(string|number|function)
`1.11.0`版本开始支持, 该参考线在极坐标系的angle轴上, 可以配置标注点在angle轴上的值, 或者聚合计算,或者以回调的形式通过数据自行计算。

`1.11.0`版本开始支持, 该参考线在极坐标系的 angle 轴上, 可以配置标注点在 angle 轴上的值, 或者聚合计算,或者以回调的形式通过数据自行计算。

**注意该属性的使用场景为极坐标系下:**

1. 配合配置 angle,radius 属性,用于标注坐标在(angle, radius)上的数据点

### radius(string|number|function)
`1.11.0`版本开始支持, 可以配置标注点在angle轴上的值, 或者聚合计算,或者以回调的形式通过数据自行计算。

`1.11.0`版本开始支持, 可以配置标注点在 angle 轴上的值, 或者聚合计算,或者以回调的形式通过数据自行计算。

**注意该属性的使用场景为极坐标系下:**

1. 配合配置 angle,radius 属性,用于标注坐标在(angle, radius)上的数据点

### areaName(string|number|function)

`1.11.0`版本开始支持, 可以配置标注点在地图上的地理位置, 以回调的形式通过数据自行计算。

**注意该属性的使用场景为地理坐标系**

{{ use: component-marker-aggregation-type() }}

### coordinates(Object)
### coordinate(Object)

标注目标:数据元素。
指定数据点的标注区域。基于指定数据点进行标注区域的绘制。
Expand Down Expand Up @@ -104,9 +109,7 @@

#### arcRatio(number)

`1.11.1`版本支持, 当type为type-arc时生效, 数值决定圆心到终点连线的偏移量, 绝对值越小, 曲率越大, 符号决定法向, 不能等于0。


`1.11.1`版本支持, 当 type 为 type-arc 时生效, 数值决定圆心到终点连线的偏移量, 绝对值越小, 曲率越大, 符号决定法向, 不能等于 0。

#### decorativeLine(Object)

Expand Down Expand Up @@ -185,32 +188,38 @@

标注内容相对于标注点的 x 方向偏移量。

除了直接配置偏移量数值外,自`1.11.0` 版本起提供了:
1. `'regionRight' | 'regionLeft'`: 用于放置在region最左端或最右端。
除了直接配置偏移量数值外,自`1.11.0` 版本起提供了:

1. `'regionRight' | 'regionLeft'`: 用于放置在 region 最左端或最右端。
2. 回调形式

```ts
(region: IRegion) => number
(region: IRegion) => number;
```

#### offsetY(number)

标注内容相对于标注点的 y 方向偏移量。

除了直接配置偏移量数值外,自`1.11.0` 版本起提供了:
1. `'regionTop' | 'regionBottom'`: 用于放置在region最顶端或最底端。
除了直接配置偏移量数值外,自`1.11.0` 版本起提供了:

1. `'regionTop' | 'regionBottom'`: 用于放置在 region 最顶端或最底端。
2. 回调形式

```ts
(region: IRegion) => number
(region: IRegion) => number;
```

{{ use: component-marker-ref(
prefix = '###'
) }}

#### confine(boolean) = false

自 1.8.7 版本开始, 是否自动调整 item content 使其展示在 marker 可见区域内。

#### symbol(Object)

标注内容类型为 symbol 时, 状态和样式配置。

{{ use: component-marker-state(
Expand All @@ -230,6 +239,7 @@
) }}

#### image(Object)

标注内容类型为 image 时, 状态和样式配置。

{{ use: component-marker-state(
Expand All @@ -256,6 +266,7 @@
) }}

#### richText(Object)

标注内容类型为 richText 时, 状态和样式配置。

{{ use: component-marker-style-callback(
Expand All @@ -281,14 +292,10 @@
animationType = 'callIn | fadeIn'
) }}


### targetSymbol(Object)

`1.11.1`版本支持, 前置标记。




#### offset

被标注内容与标记线间的间隙。
Expand Down
7 changes: 4 additions & 3 deletions docs/assets/option/zh/series/word-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@

可选值:

- `'linear'`: 线性着色(待开放)
<!-- - `'linear'`: 线性着色(待开放) -->

- `'ordinal'`: 序数着色

#${prefix} colorList(Array)
Expand All @@ -67,7 +68,7 @@

当 valueField 存在时,默认值[20,40]; 当 valueField 不存在时,默认值[10, 10]

自 1.8.7 版本支持'auto'配置。即如果配置为'auto', 则fontSizeRange不传入, 字体大小会随画布大小改变而改变。
自 1.8.7 版本支持'auto'配置。即如果配置为'auto', 则 fontSizeRange 不传入, 字体大小会随画布大小改变而改变。

#${prefix} maskShape(string)

Expand All @@ -83,7 +84,7 @@
- `'cardioid'`: 心形
- `'circle'`: 圆形
- `'pentagon'`: 五角形
- `rect`: 矩形(自1.9.3版本支持
- `rect`: 矩形(自 1.9.3 版本支持

#${prefix} random(boolean)

Expand Down
7 changes: 4 additions & 3 deletions docs/assets/option/zh/series/word-cloud3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@

可选值:

- `'linear'`: 线性着色(待开放)
<!-- - `'linear'`: 线性着色(待开放) -->

- `'ordinal'`: 序数着色

#${prefix} colorList(Array)
Expand All @@ -65,7 +66,7 @@

当 valueField 存在时,默认值[20,40]; 当 valueField 不存在时,默认值[10, 10]

自 1.8.7 版本支持'auto'配置。即如果配置为'auto', 则fontSizeRange不传入, 字体大小会随画布大小改变而改变。
自 1.8.7 版本支持'auto'配置。即如果配置为'auto', 则 fontSizeRange 不传入, 字体大小会随画布大小改变而改变。

#${prefix} maskShape(string)

Expand All @@ -81,7 +82,7 @@
- `'cardioid'`: 心形
- `'circle'`: 圆形
- `'pentagon'`: 五角形
- `rect`: 矩形(自1.9.3版本支持
- `rect`: 矩形(自 1.9.3 版本支持

#${prefix} random(boolean)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export type IMarkPointCoordinateSpec = {
/**
* 指定数据点的参考线。基于指定数据点进行参考线的绘制,可以对数据点进行数据处理
*/
coordinates: IDataPointSpec;
coordinate: IDataPointSpec;
/**
* 对每个数据点转化后的画布坐标点进行偏移,该偏移值可以是像素值,也可以是 string 类型,如 '20%' 代表百分比
* 每个元素对应一个坐标点的偏移量
Expand Down
3 changes: 2 additions & 1 deletion packages/vchart/src/series/word-cloud/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ export interface IWordCloudSeriesBaseSpec extends ISeriesSpec, IAnimationSpec<st
colorHexField?: string;
/**
* 颜色模式
* TODO: 'linear' 待支持
*/
colorMode?: 'linear' | 'ordinal';
colorMode?: 'ordinal';
/**
* 颜色列表
*/
Expand Down

0 comments on commit a4cdf21

Please sign in to comment.