Skip to content

Commit cc6eb53

Browse files
authored
Merge pull request #3510 from VisActor/release/1.13.0
[Auto release] release 1.13.0
2 parents 2476b1d + c097145 commit cc6eb53

File tree

171 files changed

+8531
-3889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+8531
-3889
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 137 additions & 137 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"definitionName":"lockStepVersion","policyName":"vchartMain","version":"1.12.15","mainProject":"@visactor/vchart","nextBump":"patch"}]
1+
[{"definitionName":"lockStepVersion","policyName":"vchartMain","version":"1.13.0","mainProject":"@visactor/vchart","nextBump":"minor"}]

docs/assets/api/en/API/event.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ vchart.on('pointerdown', { filter: ({model} => model.id === 45) }, () => {});
134134

135135
In addition to the above configurations, `query` also supports the following configurations:
136136

137-
| Configuration | Type | Default | Description |
138-
| ------------- | --------- | ------- | ------------------------------------- |
139-
| consume | `Boolean` | `false` | Whether to stop event propagation |
137+
| Configuration | Type | Default | Description |
138+
| ------------- | --------- | ------- | ------------------------------------------------------------- |
139+
| consume | `Boolean` | `false` | Whether to stop event propagation |
140140
| throttle | `Number` | `null` | Duration of event throttling in ms, defaults to no throttling |
141141
| debounce | `Number` | `null` | Duration of event debouncing in ms, defaults to no debouncing |
142142

143-
#### Listen to **component** events through event filtering
143+
#### Listen to component events through event filtering
144144

145145
Through the following event filtering rules, we can monitor the events of each component on the VChart example
146146

@@ -174,7 +174,7 @@ However, it should be noted that not all components enable event interaction by
174174
| label | No |
175175
| totalLabel | No |
176176

177-
#### Monitor **mark primitive** events through event filtering
177+
#### Monitor mark primitive events through event filtering
178178

179179
If you want to listen to the events of mark primitives, you can do it in two ways:
180180

@@ -249,17 +249,23 @@ VChart supports the following basic events:
249249
- `'dragover'`
250250
- `'drop'`
251251
- Gesture event
252+
252253
- `'pan'`: translation
253254
- `'panstart'`: translation start
254255
- `'panend'`: end of translation
255-
- `'press'`: Long press
256-
- `'pressup'`: Long press to lift
257-
- `'pressend'`: Long press to end
256+
- `'press'`: long press
257+
- `'pressup'`: long press release
258+
- `'pressend'`: long press end
258259
- `'pinch'`: zoom
259260
- `'pinchstart'`: zoom start
260261
- `'pinchend'`: zoom end
261262
- `'swipe'`: quick sweep
262263

264+
Note that gesture events are not enabled by default. There are two ways to enable them:
265+
266+
- Set `mode` in the rendering configuration to one of the following: `'mobile-browser'`, `'miniApp'`, `'lynx'`, `'wx'`, `'harmony'`
267+
- Set `gestureConfig` in the rendering configuration to a non-empty object. For specific supported configurations, refer to [vchart API configuration](/vchart/api/API/vchart)
268+
263269
### combined event
264270

265271
- `dimensionHover`: Dimension hovering event

docs/assets/api/en/API/vchart.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ Chart configuration, including rendering containers, etc., see the following tab
233233
| `enableView3dTransform` | `boolean` | No | Whether to enable the transformation mode of view3d |
234234
| `poptip` | `boolean` | No | Whether to enable poptip for omitting text, used to view the complete text content, enabled by default |
235235
| `resizeDelay` | `number` | No | The interval duration in milliseconds for triggering a resize when automatically responding to container resize events; supported from `1.12.5`. |
236-
| `autoRefreshDpr` | `boolean` | Yes | Whether to automatically refresh the dpr when switching screens and the dpr changes; if the dpr is not explicitly set, this feature is enabled by default; supported since version `1.12.14`. |
236+
| `gestureConfig` | `GestureConfig` | No | Gesture event configuration; when configured as non-empty, gesture-related events are enabled. |
237+
| `autoRefreshDpr` | `boolean` | Yes | Whether to automatically refresh the dpr when switching screens and the dpr changes; if the dpr is not explicitly set, this feature is enabled by default; supported from version `1.12.14`. |
237238

238-
- `srIOption3DType` Types are defined as follows
239+
- The `srIOption3DType` type is defined as follows:
239240

240241
```ts
241242
export interface srIOption3DType extends IOption3D {
@@ -258,7 +259,7 @@ export interface IOption3D {
258259
}
259260
```
260261

261-
- `LayoutCallBack` Types are defined as follows:
262+
The `LayoutCallBack` type is defined as follows:
262263

263264
```ts
264265
export type LayoutCallBack = (
@@ -269,6 +270,44 @@ export type LayoutCallBack = (
269270
) => void;
270271
```
271272

273+
- The `GestureConfig` type is defined as follows:
274+
275+
```ts
276+
export interface GestureConfig {
277+
press?: {
278+
/**
279+
* @default 251
280+
* Minimal press time in ms.
281+
*/
282+
time?: number;
283+
/**
284+
* @default 10
285+
* Maximal movement that is allowed while pressing.
286+
*/
287+
threshold?: number;
288+
};
289+
swipe?: {
290+
/**
291+
* Minimal distance required before recognizing.
292+
* @default 10
293+
*/
294+
threshold?: number;
295+
/**
296+
* Minimal velocity required before recognizing, unit is in px per ms.
297+
* @default 0.3
298+
*/
299+
velocity?: number;
300+
};
301+
tap?: {
302+
/**
303+
* max time between the multi-tap taps
304+
* @default 300
305+
*/
306+
interval?: number;
307+
};
308+
}
309+
```
310+
272311
### example
273312

274313
```ts

docs/assets/api/zh/API/event.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ vchart.on('pointerdown', { filter: ({model} => model.id === 45) }, () => {});
140140
| throttle | `Number` | `null` | 事件节流的时长,单位为 ms,默认不节流 |
141141
| debounce | `Number` | `null` | 事件防抖的时长,单位为 ms,默认不防抖 |
142142

143-
#### 通过事件过滤监听 **组件** 事件
143+
#### 通过事件过滤监听 组件 事件
144144

145145
通过如下事件过滤规则,我们可以监听到 VChart 示例上各个组件的事件
146146

@@ -174,7 +174,7 @@ vchart.on('pointerdown', { level: 'model', type: 'axis' }, e => {
174174
| label ||
175175
| totalLabel ||
176176

177-
#### 通过事件过滤监听 **mark 图元** 事件
177+
#### 通过事件过滤监听 mark 图元 事件
178178

179179
如果想要监听 mark 图元的事件,可以通过两种方式实现:
180180

@@ -249,6 +249,7 @@ VChart 支持如下基础事件:
249249
- `'dragover'`
250250
- `'drop'`
251251
- 手势事件
252+
252253
- `'pan'`: 平移
253254
- `'panstart'`: 平移开始
254255
- `'panend'`: 平移结束
@@ -260,6 +261,11 @@ VChart 支持如下基础事件:
260261
- `'pinchend'`: 缩放结束
261262
- `'swipe'`: 快扫
262263

264+
注意手势事件没有默认开启,有两种开启方式:
265+
266+
- 渲染配置中的`mode`设置为: `'mobile-browser'``'miniApp'``'lynx'``'wx'``'harmony'`中的一种
267+
- 渲染配置中的`gestureConfig` 设置为非空对象,具体支持的配置参考[vchart API 配置](/vchart/api/API/vchart)
268+
263269
### 组合事件
264270

265271
- `dimensionHover`: 维度 hover 事件

docs/assets/api/zh/API/vchart.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ new VChart(spec: ISpec, options: IInitOption);
240240
| `supportsPointerEvents` | `boolean` || 是否支持 pointer 事件,不支持就监听 mouse 事件; 从`1.8.9`版本开始支持 |
241241
| `ReactDOM` | `object` || `react-dom`包导出产物,用于开启 vrender 渲染 react 元素; 从`1.11.0`版本开始支持 |
242242
| `resizeDelay` | `number` || 当自动响应容器 resize 事件时,触发 resize 的间隔时长,单位毫秒;从`1.12.5`开始支持 |
243+
| `gestureConfig` | `GestureConfig` || 手势事件配置;当配置非空,开启手势相关事件 |
243244
| `autoRefreshDpr` | `boolean` || 当切换屏幕的时候,dpr 发发生变更,是否自动刷新 dpr;当没有显示设置 dpr 的时候,默认开启该功能;自`1.12.14`版本开始支持 |
244245

245246
- `srIOption3DType` 类型定义如下
@@ -276,6 +277,44 @@ export type LayoutCallBack = (
276277
) => void;
277278
```
278279

280+
- `GestureConfig` 类型定义如下:
281+
282+
```ts
283+
export interface GestureConfig {
284+
press?: {
285+
/**
286+
* @default 251
287+
* 最小按压时间,单位为毫秒。
288+
*/
289+
time?: number;
290+
/**
291+
* @default 10
292+
* 按压时允许的最大移动距离。
293+
*/
294+
threshold?: number;
295+
};
296+
swipe?: {
297+
/**
298+
* 识别滑动所需的最小距离。
299+
* @default 10
300+
*/
301+
threshold?: number;
302+
/**
303+
* 识别滑动所需的最小速度,单位为每毫秒像素。
304+
* @default 0.3
305+
*/
306+
velocity?: number;
307+
};
308+
tap?: {
309+
/**
310+
* 多次点击之间的最大时间间隔。
311+
* @default 300
312+
*/
313+
interval?: number;
314+
};
315+
}
316+
```
317+
279318
### 示例
280319

281320
```ts

docs/assets/changelog/en/release.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# v1.12.15
2+
3+
2024-12-05
4+
5+
6+
**🆕 New feature**
7+
8+
- **@visactor/vchart**: support `restorePosition` in position/bound label overlap strategy
9+
10+
**🐛 Bug fix**
11+
12+
- **@visactor/vchart**: optimize `shiftY` of label
13+
14+
15+
16+
[more detail about v1.12.15](https://github.com/VisActor/VChart/releases/tag/v1.12.15)
17+
118
# v1.12.14
219

320
2024-12-05

docs/assets/changelog/zh/release.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# v1.12.15
2+
3+
2024-12-05
4+
5+
6+
**🆕 新增功能**
7+
8+
- **@visactor/vchart**: support `restorePosition` in position/bound label overlap strategy
9+
10+
**🐛 功能修复**
11+
12+
- **@visactor/vchart**: optimize `shiftY` of label
13+
14+
15+
16+
[更多详情请查看 v1.12.15](https://github.com/VisActor/VChart/releases/tag/v1.12.15)
17+
118
# v1.12.14
219

320
2024-12-05
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
category: examples
3+
group: pictogram chart
4+
title: SVG Beef Cuts
5+
keywords: pictogramChart, space
6+
order: 26-1
7+
cover: /vchart/preview/pictogram-cow_1.13.0.png
8+
option: pictogramChart
9+
---
10+
11+
# SVG Beef Cuts
12+
13+
> Demo is a replica of the echarts-Beef Cuts example.
14+
15+
## Key Configurations
16+
17+
- In the SVG file, configure the name attribute for the pictogram, then you can specify the pictogram style through the name configuration in the chart settings;
18+
19+
## Code Demo
20+
21+
```javascript livedemo
22+
/** --Add the following code when using in business context-- */
23+
// When using in business context, please additionally import
24+
// import { registerPictogramChart } from '@visactor/vchart';
25+
// registerPictogramChart();
26+
/** --Add the above code when using in business context-- */
27+
VCHART_MODULE.registerPictogramChart();
28+
/** --Delete the above code when using in business context-- */
29+
30+
const response = await fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/pictogram/cow.svg');
31+
const cow = await response.text();
32+
33+
const spec = {
34+
type: 'pictogram',
35+
data: {
36+
id: 'data',
37+
values: [
38+
{ name: 'Queue', value: 15 },
39+
{ name: 'Langue', value: 35 },
40+
{ name: 'Plat de joue', value: 15 },
41+
{ name: 'Gros bout de poitrine', value: 25 },
42+
{ name: 'Jumeau à pot-au-feu', value: 45 },
43+
{ name: 'Onglet', value: 85 },
44+
{ name: 'Plat de tranche', value: 25 },
45+
{ name: 'Araignée', value: 15 },
46+
{ name: 'Gîte à la noix', value: 55 },
47+
{ name: "Bavette d'aloyau", value: 25 },
48+
{ name: 'Tende de tranche', value: 65 },
49+
{ name: 'Rond de gîte', value: 45 },
50+
{ name: 'Bavettede de flanchet', value: 85 },
51+
{ name: 'Flanchet', value: 35 },
52+
{ name: 'Hampe', value: 75 },
53+
{ name: 'Plat de côtes', value: 65 },
54+
{ name: 'Tendron Milieu de poitrine', value: 65 },
55+
{ name: 'Macreuse à pot-au-feu', value: 85 },
56+
{ name: 'Rumsteck', value: 75 },
57+
{ name: 'Faux-filet', value: 65 },
58+
{ name: 'Côtes Entrecôtes', value: 55 },
59+
{ name: 'Basses côtes', value: 45 },
60+
{ name: 'Collier', value: 85 },
61+
{ name: 'Jumeau à biftek', value: 15 },
62+
{ name: 'Paleron', value: 65 },
63+
{ name: 'Macreuse à bifteck', value: 45 },
64+
{ name: 'Gîte', value: 85 },
65+
{ name: 'Aiguillette baronne', value: 65 },
66+
{ name: 'Filet', value: 95 }
67+
]
68+
},
69+
nameField: 'name',
70+
valueField: 'value',
71+
color: {
72+
type: 'linear',
73+
domain: [
74+
{
75+
dataId: 'data',
76+
fields: ['value']
77+
}
78+
],
79+
range: ['#f51633', '#921319']
80+
},
81+
legends: [
82+
{
83+
visible: true,
84+
type: 'color',
85+
field: 'value',
86+
orient: 'top'
87+
}
88+
],
89+
region: [
90+
{
91+
roam: true
92+
}
93+
],
94+
svg: 'cow',
95+
pictogram: {
96+
style: {
97+
fill: {
98+
field: 'value',
99+
scale: 'color'
100+
}
101+
}
102+
},
103+
'Tendron Milieu de poitrine': {
104+
style: {
105+
fill: 'orange'
106+
},
107+
state: {
108+
hover: {
109+
fill: '#FFBF7F'
110+
}
111+
}
112+
}
113+
};
114+
VChart.registerSVG('cow', cow);
115+
116+
const vchart = new VChart(spec, { dom: CONTAINER_ID });
117+
vchart.renderSync();
118+
119+
// Just for the convenience of console debugging, DO NOT COPY!
120+
window['vchart'] = vchart;
121+
```
122+
123+
## Related Tutorials
124+
125+
[PictogramChart](link)

0 commit comments

Comments
 (0)