Skip to content

Commit

Permalink
Merge pull request #3510 from VisActor/release/1.13.0
Browse files Browse the repository at this point in the history
[Auto release] release 1.13.0
  • Loading branch information
xile611 authored Dec 6, 2024
2 parents 2476b1d + c097145 commit cc6eb53
Show file tree
Hide file tree
Showing 171 changed files with 8,531 additions and 3,889 deletions.
274 changes: 137 additions & 137 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vchartMain","version":"1.12.15","mainProject":"@visactor/vchart","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vchartMain","version":"1.13.0","mainProject":"@visactor/vchart","nextBump":"minor"}]
22 changes: 14 additions & 8 deletions docs/assets/api/en/API/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ vchart.on('pointerdown', { filter: ({model} => model.id === 45) }, () => {});

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

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

#### Listen to **component** events through event filtering
#### Listen to component events through event filtering

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

Expand Down Expand Up @@ -174,7 +174,7 @@ However, it should be noted that not all components enable event interaction by
| label | No |
| totalLabel | No |

#### Monitor **mark primitive** events through event filtering
#### Monitor mark primitive events through event filtering

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

Expand Down Expand Up @@ -249,17 +249,23 @@ VChart supports the following basic events:
- `'dragover'`
- `'drop'`
- Gesture event

- `'pan'`: translation
- `'panstart'`: translation start
- `'panend'`: end of translation
- `'press'`: Long press
- `'pressup'`: Long press to lift
- `'pressend'`: Long press to end
- `'press'`: long press
- `'pressup'`: long press release
- `'pressend'`: long press end
- `'pinch'`: zoom
- `'pinchstart'`: zoom start
- `'pinchend'`: zoom end
- `'swipe'`: quick sweep

Note that gesture events are not enabled by default. There are two ways to enable them:

- Set `mode` in the rendering configuration to one of the following: `'mobile-browser'`, `'miniApp'`, `'lynx'`, `'wx'`, `'harmony'`
- Set `gestureConfig` in the rendering configuration to a non-empty object. For specific supported configurations, refer to [vchart API configuration](/vchart/api/API/vchart)

### combined event

- `dimensionHover`: Dimension hovering event
Expand Down
45 changes: 42 additions & 3 deletions docs/assets/api/en/API/vchart.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ Chart configuration, including rendering containers, etc., see the following tab
| `enableView3dTransform` | `boolean` | No | Whether to enable the transformation mode of view3d |
| `poptip` | `boolean` | No | Whether to enable poptip for omitting text, used to view the complete text content, enabled by default |
| `resizeDelay` | `number` | No | The interval duration in milliseconds for triggering a resize when automatically responding to container resize events; supported from `1.12.5`. |
| `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`. |
| `gestureConfig` | `GestureConfig` | No | Gesture event configuration; when configured as non-empty, gesture-related events are enabled. |
| `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`. |

- `srIOption3DType` Types are defined as follows
- The `srIOption3DType` type is defined as follows:

```ts
export interface srIOption3DType extends IOption3D {
Expand All @@ -258,7 +259,7 @@ export interface IOption3D {
}
```

- `LayoutCallBack` Types are defined as follows:
The `LayoutCallBack` type is defined as follows:

```ts
export type LayoutCallBack = (
Expand All @@ -269,6 +270,44 @@ export type LayoutCallBack = (
) => void;
```

- The `GestureConfig` type is defined as follows:

```ts
export interface GestureConfig {
press?: {
/**
* @default 251
* Minimal press time in ms.
*/
time?: number;
/**
* @default 10
* Maximal movement that is allowed while pressing.
*/
threshold?: number;
};
swipe?: {
/**
* Minimal distance required before recognizing.
* @default 10
*/
threshold?: number;
/**
* Minimal velocity required before recognizing, unit is in px per ms.
* @default 0.3
*/
velocity?: number;
};
tap?: {
/**
* max time between the multi-tap taps
* @default 300
*/
interval?: number;
};
}
```

### example

```ts
Expand Down
10 changes: 8 additions & 2 deletions docs/assets/api/zh/API/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ vchart.on('pointerdown', { filter: ({model} => model.id === 45) }, () => {});
| throttle | `Number` | `null` | 事件节流的时长,单位为 ms,默认不节流 |
| debounce | `Number` | `null` | 事件防抖的时长,单位为 ms,默认不防抖 |

#### 通过事件过滤监听 **组件** 事件
#### 通过事件过滤监听 组件 事件

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

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

#### 通过事件过滤监听 **mark 图元** 事件
#### 通过事件过滤监听 mark 图元 事件

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

Expand Down Expand Up @@ -249,6 +249,7 @@ VChart 支持如下基础事件:
- `'dragover'`
- `'drop'`
- 手势事件

- `'pan'`: 平移
- `'panstart'`: 平移开始
- `'panend'`: 平移结束
Expand All @@ -260,6 +261,11 @@ VChart 支持如下基础事件:
- `'pinchend'`: 缩放结束
- `'swipe'`: 快扫

注意手势事件没有默认开启,有两种开启方式:

- 渲染配置中的`mode`设置为: `'mobile-browser'``'miniApp'``'lynx'``'wx'``'harmony'`中的一种
- 渲染配置中的`gestureConfig` 设置为非空对象,具体支持的配置参考[vchart API 配置](/vchart/api/API/vchart)

### 组合事件

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

- `srIOption3DType` 类型定义如下
Expand Down Expand Up @@ -276,6 +277,44 @@ export type LayoutCallBack = (
) => void;
```

- `GestureConfig` 类型定义如下:

```ts
export interface GestureConfig {
press?: {
/**
* @default 251
* 最小按压时间,单位为毫秒。
*/
time?: number;
/**
* @default 10
* 按压时允许的最大移动距离。
*/
threshold?: number;
};
swipe?: {
/**
* 识别滑动所需的最小距离。
* @default 10
*/
threshold?: number;
/**
* 识别滑动所需的最小速度,单位为每毫秒像素。
* @default 0.3
*/
velocity?: number;
};
tap?: {
/**
* 多次点击之间的最大时间间隔。
* @default 300
*/
interval?: number;
};
}
```

### 示例

```ts
Expand Down
17 changes: 17 additions & 0 deletions docs/assets/changelog/en/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# v1.12.15

2024-12-05


**🆕 New feature**

- **@visactor/vchart**: support `restorePosition` in position/bound label overlap strategy

**🐛 Bug fix**

- **@visactor/vchart**: optimize `shiftY` of label



[more detail about v1.12.15](https://github.com/VisActor/VChart/releases/tag/v1.12.15)

# v1.12.14

2024-12-05
Expand Down
17 changes: 17 additions & 0 deletions docs/assets/changelog/zh/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# v1.12.15

2024-12-05


**🆕 新增功能**

- **@visactor/vchart**: support `restorePosition` in position/bound label overlap strategy

**🐛 功能修复**

- **@visactor/vchart**: optimize `shiftY` of label



[更多详情请查看 v1.12.15](https://github.com/VisActor/VChart/releases/tag/v1.12.15)

# v1.12.14

2024-12-05
Expand Down
125 changes: 125 additions & 0 deletions docs/assets/examples/en/pictogram-chart/pictogram-cow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
category: examples
group: pictogram chart
title: SVG Beef Cuts
keywords: pictogramChart, space
order: 26-1
cover: /vchart/preview/pictogram-cow_1.13.0.png
option: pictogramChart
---

# SVG Beef Cuts

> Demo is a replica of the echarts-Beef Cuts example.
## Key Configurations

- 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;

## Code Demo

```javascript livedemo
/** --Add the following code when using in business context-- */
// When using in business context, please additionally import
// import { registerPictogramChart } from '@visactor/vchart';
// registerPictogramChart();
/** --Add the above code when using in business context-- */
VCHART_MODULE.registerPictogramChart();
/** --Delete the above code when using in business context-- */

const response = await fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/pictogram/cow.svg');
const cow = await response.text();

const spec = {
type: 'pictogram',
data: {
id: 'data',
values: [
{ name: 'Queue', value: 15 },
{ name: 'Langue', value: 35 },
{ name: 'Plat de joue', value: 15 },
{ name: 'Gros bout de poitrine', value: 25 },
{ name: 'Jumeau à pot-au-feu', value: 45 },
{ name: 'Onglet', value: 85 },
{ name: 'Plat de tranche', value: 25 },
{ name: 'Araignée', value: 15 },
{ name: 'Gîte à la noix', value: 55 },
{ name: "Bavette d'aloyau", value: 25 },
{ name: 'Tende de tranche', value: 65 },
{ name: 'Rond de gîte', value: 45 },
{ name: 'Bavettede de flanchet', value: 85 },
{ name: 'Flanchet', value: 35 },
{ name: 'Hampe', value: 75 },
{ name: 'Plat de côtes', value: 65 },
{ name: 'Tendron Milieu de poitrine', value: 65 },
{ name: 'Macreuse à pot-au-feu', value: 85 },
{ name: 'Rumsteck', value: 75 },
{ name: 'Faux-filet', value: 65 },
{ name: 'Côtes Entrecôtes', value: 55 },
{ name: 'Basses côtes', value: 45 },
{ name: 'Collier', value: 85 },
{ name: 'Jumeau à biftek', value: 15 },
{ name: 'Paleron', value: 65 },
{ name: 'Macreuse à bifteck', value: 45 },
{ name: 'Gîte', value: 85 },
{ name: 'Aiguillette baronne', value: 65 },
{ name: 'Filet', value: 95 }
]
},
nameField: 'name',
valueField: 'value',
color: {
type: 'linear',
domain: [
{
dataId: 'data',
fields: ['value']
}
],
range: ['#f51633', '#921319']
},
legends: [
{
visible: true,
type: 'color',
field: 'value',
orient: 'top'
}
],
region: [
{
roam: true
}
],
svg: 'cow',
pictogram: {
style: {
fill: {
field: 'value',
scale: 'color'
}
}
},
'Tendron Milieu de poitrine': {
style: {
fill: 'orange'
},
state: {
hover: {
fill: '#FFBF7F'
}
}
}
};
VChart.registerSVG('cow', cow);

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
```

## Related Tutorials

[PictogramChart](link)
Loading

0 comments on commit cc6eb53

Please sign in to comment.