@visactor/taro-vchart 0.2.0-alpha.2 → 1.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/lib/src/index.js +1 -1
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -83,10 +83,10 @@ import VChart from '@visactor/taro-vchart';
|
|
|
83
83
|
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
84
84
|
| type | String | 配置的环境,目前组件支持的环境有:**字节小程序**('tt'),**飞书小程序**('lark'),**浏览器**('h5', 'web') ,如果没有声明,则会通过 `Taro.getEnv()` 自动获取 |
|
|
85
85
|
| canvasId | String | 图表 id, 必确唯一 |
|
|
86
|
-
| spec | Object | 图表配置项, 请参考[VChart 配置项](
|
|
86
|
+
| spec | Object | 图表配置项, 请参考[VChart 配置项](https://www.visactor.io/vchart/option/) |
|
|
87
87
|
| style | Object | 图表容器样式 |
|
|
88
|
-
| events | Object[] | 事件绑定配置,具体配置为定义[如下](
|
|
89
|
-
| options | Object | 初始化 VChart 实例传入的额外配置项,同 [VChart 实例化配置项](
|
|
88
|
+
| events | Object[] | 事件绑定配置,具体配置为定义[如下](#事件配置) |
|
|
89
|
+
| options | Object | 初始化 VChart 实例传入的额外配置项,同 [VChart 实例化配置项](https://www.visactor.io/vchart/api/API/vchart#options) |
|
|
90
90
|
| onChartInit | Function | 图表初始化完后触发的回调 |
|
|
91
91
|
| onChartReady | Function | 图表渲染完毕后触发的回调 |
|
|
92
92
|
| onChartUpdate | Function | 图表更新完毕后触发的回调 |
|
|
@@ -103,13 +103,16 @@ interface IEvent {
|
|
|
103
103
|
* 事件 API 中的事件筛选配置
|
|
104
104
|
*/
|
|
105
105
|
query?: EventQuery;
|
|
106
|
+
/**
|
|
107
|
+
* 事件监听函数
|
|
108
|
+
*/
|
|
106
109
|
handler: EventCallback<EventParams>;
|
|
107
110
|
}
|
|
108
111
|
```
|
|
109
112
|
|
|
110
|
-
- `type` 代表事件名称,支持的值详见:[事件分类](
|
|
111
|
-
- `query` 事件 API 中的事件筛选配置,使用详见:[事件过滤](
|
|
112
|
-
- `handler` 即事件监听函数,函数的参数类型详见:[事件参数](
|
|
113
|
+
- `type` 代表事件名称,支持的值详见:[事件分类](https://www.visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E5%88%86%E7%B1%BB)
|
|
114
|
+
- `query` 事件 API 中的事件筛选配置,使用详见:[事件过滤](https://www.visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E8%BF%87%E6%BB%A4)
|
|
115
|
+
- `handler` 即事件监听函数,函数的参数类型详见:[事件参数](https://www.visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E5%8F%82%E6%95%B0)
|
|
113
116
|
|
|
114
117
|
## 快速上手
|
|
115
118
|
|
|
@@ -201,7 +204,7 @@ export function Pie() {
|
|
|
201
204
|
- `chartInstance.updateSpec()` 基于 Spec 更新图表
|
|
202
205
|
- `chartInstance.updateData()` 基于数据更新图表
|
|
203
206
|
|
|
204
|
-
详细使用方法请参考:[VChart API](
|
|
207
|
+
详细使用方法请参考:[VChart API](https://www.visactor.io/vchart/api/API/vchart)
|
|
205
208
|
|
|
206
209
|
#### 示例
|
|
207
210
|
|
package/lib/src/index.js
CHANGED
|
@@ -108,7 +108,7 @@ class TTCanvas {
|
|
|
108
108
|
force: true,
|
|
109
109
|
canvasIdLists: [`${domref.id}_draw_canvas`, `${domref.id}_tooltip_canvas`, `${domref.id}_hidden_canvas`],
|
|
110
110
|
tooltipCanvasId: `${domref.id}_tooltip_canvas`,
|
|
111
|
-
freeCanvasIdx:
|
|
111
|
+
freeCanvasIdx: 2 // 自由 canvas 索引
|
|
112
112
|
}, dpr: this.dpr, renderCanvas: `${domref.id}_draw_canvas` }, this.options));
|
|
113
113
|
this.onChartInit && this.onChartInit(this.chartInstance);
|
|
114
114
|
// events
|
package/package.json
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/taro-vchart",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0-beta.10",
|
|
4
4
|
"description": "Taro VChart 图表组件",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "lib/src/index.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"lib"
|
|
9
9
|
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "rm -rf lib && rollup -c --bundleConfigAsCjs",
|
|
12
|
-
"build:tt": "taro build --type tt",
|
|
13
|
-
"build:lark": "taro build --type lark",
|
|
14
|
-
"build:h5": "taro build --type h5",
|
|
15
|
-
"dev:tt": "npm run build:tt -- --watch",
|
|
16
|
-
"dev:lark": "npm run build:lark -- --watch",
|
|
17
|
-
"dev:h5": "npm run build:h5 -- --watch"
|
|
18
|
-
},
|
|
19
10
|
"keywords": [
|
|
20
11
|
"taro",
|
|
21
12
|
"charts",
|
|
@@ -40,12 +31,10 @@
|
|
|
40
31
|
},
|
|
41
32
|
"license": "MIT",
|
|
42
33
|
"dependencies": {
|
|
43
|
-
"@visactor/vchart": "
|
|
34
|
+
"@visactor/vchart": "1.1.0-beta.10"
|
|
44
35
|
},
|
|
45
36
|
"devDependencies": {
|
|
46
|
-
"@internal/eslint-config": "workspace:*",
|
|
47
37
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
48
|
-
"@internal/ts-config": "workspace:*",
|
|
49
38
|
"@vitejs/plugin-react": "3.1.0",
|
|
50
39
|
"eslint": "~8.18.0",
|
|
51
40
|
"vite": "3.2.6",
|
|
@@ -81,10 +70,21 @@
|
|
|
81
70
|
"rollup": "3.20.5",
|
|
82
71
|
"rollup-plugin-import-css": "^3.0.2",
|
|
83
72
|
"stylelint": "9.3.0",
|
|
84
|
-
"tslib": "2.3.1"
|
|
73
|
+
"tslib": "2.3.1",
|
|
74
|
+
"@internal/eslint-config": "0.0.1",
|
|
75
|
+
"@internal/ts-config": "0.0.1"
|
|
85
76
|
},
|
|
86
77
|
"publishConfig": {
|
|
87
78
|
"access": "public",
|
|
88
79
|
"registry": "https://registry.npmjs.org/"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "rm -rf lib && rollup -c --bundleConfigAsCjs",
|
|
83
|
+
"build:tt": "taro build --type tt",
|
|
84
|
+
"build:lark": "taro build --type lark",
|
|
85
|
+
"build:h5": "taro build --type h5",
|
|
86
|
+
"dev:tt": "npm run build:tt -- --watch",
|
|
87
|
+
"dev:lark": "npm run build:lark -- --watch",
|
|
88
|
+
"dev:h5": "npm run build:h5 -- --watch"
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
}
|