@antv/g2 5.0.0-alpha.4 → 5.0.0-beta.1
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 +29 -27
- package/dist/g2-lite.min.js +2 -2
- package/dist/g2.min.js +2 -2
- package/esm/mark/pack.js +2 -2
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/sankey.js +1 -0
- package/esm/mark/sankey.js.map +1 -1
- package/esm/mark/treemap.js +2 -2
- package/esm/mark/treemap.js.map +1 -1
- package/esm/mark/wordCloud.js +2 -2
- package/esm/mark/wordCloud.js.map +1 -1
- package/esm/spec/geometry.d.ts +2 -2
- package/lib/mark/pack.js +2 -2
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/sankey.js +1 -0
- package/lib/mark/sankey.js.map +1 -1
- package/lib/mark/treemap.js +2 -2
- package/lib/mark/treemap.js.map +1 -1
- package/lib/mark/wordCloud.js +2 -2
- package/lib/mark/wordCloud.js.map +1 -1
- package/lib/spec/geometry.d.ts +2 -2
- package/package.json +3 -3
- package/src/mark/pack.ts +1 -0
- package/src/mark/sankey.ts +1 -0
- package/src/mark/treemap.ts +1 -0
- package/src/mark/wordCloud.ts +1 -0
- package/src/spec/geometry.ts +2 -1
package/README.md
CHANGED
|
@@ -6,7 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
简洁的渐进式可视化语法
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://g2.antv.antgroup.com/manual/introduction">介绍</a> •
|
|
13
|
+
<a href="https://g2.antv.antgroup.com/examples">案例</a> •
|
|
14
|
+
<a href="https://g2.antv.antgroup.com/manual/getting-started">教程</a> •
|
|
15
|
+
<a href="https://g2.antv.antgroup.com/api/overview">API</a>
|
|
16
|
+
</p>
|
|
10
17
|
|
|
11
18
|
[](https://github.com/antvis//actions)
|
|
12
19
|
[](https://coveralls.io/github/antvis/g2?branch=v5)
|
|
@@ -14,49 +21,44 @@ G2 是一个可视化语法,用于报表搭建、数据探索和可视化叙
|
|
|
14
21
|
[](https://www.npmjs.com/package/@antv/g2)
|
|
15
22
|
[](https://www.npmjs.com/package/@antv/g2)
|
|
16
23
|
|
|
17
|
-

|
|
18
25
|
|
|
19
26
|
</div>
|
|
20
27
|
|
|
21
|
-
> G2 5.0
|
|
22
|
-
|
|
23
|
-
G2 的名字来自于 Wilkinson 的《Grammar of Graphics》,并在功能和 API 设计上深受它的启发。这里有一些资源可以帮助你开始使用它:
|
|
28
|
+
> G2 5.0 发布了 Beta 版本,4.x 稳定版在 [master](https://github.com/antvis/G2/tree/master) 分支上。
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
- [案例](http://g2-next.antv.vision/examples):大量可供学习和复制粘贴的案例
|
|
27
|
-
- [教程](http://g2-next.antv.vision/tutorials):交互式案例驱动的教程,帮助你了解核心概念
|
|
28
|
-
- [API](http://g2-next.antv.vision/basic):所有可视化组件的完整文档
|
|
30
|
+
G2 起源于 Wilkinson 的图形语法:《Grammar of Graphics》,但又不止于图形语法。
|
|
29
31
|
|
|
30
32
|
## ✨ 特色
|
|
31
33
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
34
|
+
- **渐进式语法**:结合工业和学术实践,实现图形语法、动画语法和交互语法。
|
|
35
|
+
- **丰富的标记**:内置 10+ 基础标记,8+ 高阶标记。
|
|
36
|
+
- **高可扩展性**:提供统一机制扩展所有可视化组件。
|
|
37
|
+
- **个性化风格**:支持手绘、圆角、纹理等风格。
|
|
38
|
+
- **多环境渲染**:支持 Canvas、SVG 以及 WebGL,和 Node.js 服务端渲染。
|
|
37
39
|
|
|
38
40
|
## 🔨 开始使用
|
|
39
41
|
|
|
40
|
-
可以通过
|
|
42
|
+
可以通过 NPM 或 Yarn 等包管理器来安装。
|
|
41
43
|
|
|
42
44
|
```bash
|
|
43
|
-
$ npm install @antv/g2
|
|
45
|
+
$ npm install @antv/g2@beta
|
|
44
46
|
```
|
|
45
47
|
|
|
46
48
|
```bash
|
|
47
|
-
$ yarn add @antv/g2
|
|
49
|
+
$ yarn add @antv/g2@beta
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
成功安装之后,可以通过 import 导入 Chart 对象。
|
|
51
53
|
|
|
52
54
|
```html
|
|
53
|
-
<div id="
|
|
55
|
+
<div id="container"></div>
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
```js
|
|
57
59
|
import { Chart } from '@antv/g2';
|
|
58
60
|
|
|
59
|
-
//
|
|
61
|
+
// 准备数据
|
|
60
62
|
const data = [
|
|
61
63
|
{ genre: 'Sports', sold: 275 },
|
|
62
64
|
{ genre: 'Strategy', sold: 115 },
|
|
@@ -65,19 +67,19 @@ const data = [
|
|
|
65
67
|
{ genre: 'Other', sold: 150 },
|
|
66
68
|
];
|
|
67
69
|
|
|
68
|
-
//
|
|
70
|
+
// 初始化图表实例
|
|
69
71
|
const chart = new Chart({
|
|
70
|
-
container: '
|
|
72
|
+
container: 'container',
|
|
71
73
|
});
|
|
72
74
|
|
|
73
75
|
// 声明可视化
|
|
74
76
|
chart
|
|
75
|
-
.interval() // 创建一个 Interval
|
|
76
|
-
.data(data) //
|
|
77
|
-
.encode('x', 'genre') //
|
|
78
|
-
.encode('y', 'sold'); //
|
|
77
|
+
.interval() // 创建一个 Interval 标记
|
|
78
|
+
.data(data) // 绑定数据
|
|
79
|
+
.encode('x', 'genre') // 编码 x 通道
|
|
80
|
+
.encode('y', 'sold'); // 编码 y 通道
|
|
79
81
|
|
|
80
|
-
//
|
|
82
|
+
// 渲染可视化
|
|
81
83
|
chart.render();
|
|
82
84
|
```
|
|
83
85
|
|
|
@@ -88,7 +90,7 @@ chart.render();
|
|
|
88
90
|
## 📮 参与贡献
|
|
89
91
|
|
|
90
92
|
- [问题](https://github.com/antvis/g2/issues): 报告 bug 或者提出需求
|
|
91
|
-
- [贡献指南](https://github.com/antvis/g2/blob/v5/CONTRIBUTING.
|
|
93
|
+
- [贡献指南](https://github.com/antvis/g2/blob/v5/CONTRIBUTING.md):参与建设 G2
|
|
92
94
|
- [讨论](https://github.com/antvis/G2/discussions):在 Github 上或者钉钉群里面讨论(30233731, 35686967, 44788198)
|
|
93
95
|
|
|
94
96
|
<img src="https://gw.alipayobjects.com/zos/antfincdn/hTzzaqgHgQ/Antv%252520G2%252520%26%252520G2Plot.png" width="200" height="266" />
|