@antv/g2plot 2.3.39 → 2.3.40
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/CHANGELOG.md +16 -0
- package/dist/g2plot.min.js +17 -2
- package/dist/g2plot.min.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/plots/sankey/helper.js +16 -2
- package/esm/plots/sankey/helper.js.map +1 -1
- package/esm/plots/sankey/types.d.ts +51 -8
- package/esm/plots/sankey/types.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/plots/sankey/helper.js +16 -2
- package/lib/plots/sankey/helper.js.map +1 -1
- package/lib/plots/sankey/types.d.ts +51 -8
- package/lib/plots/sankey/types.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/src/plots/sankey/helper.ts +26 -9
- package/src/plots/sankey/types.ts +52 -8
|
@@ -1,20 +1,64 @@
|
|
|
1
1
|
import { Data, Options, State, StyleAttr } from '../../types';
|
|
2
2
|
import { NodeDepth, NodeSort } from './layout';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* node-link 数据类型的结构
|
|
6
|
+
*/
|
|
7
|
+
export type NodeLinkData = {
|
|
8
|
+
/**
|
|
9
|
+
* 节点数据
|
|
10
|
+
*/
|
|
11
|
+
readonly nodes: {
|
|
12
|
+
/**
|
|
13
|
+
* id 唯一即可,一般可以直接等于 name
|
|
14
|
+
*/
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/**
|
|
17
|
+
* 节点的名称,用于 UI 上的现实
|
|
18
|
+
*/
|
|
19
|
+
readonly name: string;
|
|
20
|
+
/**
|
|
21
|
+
* 节点的值,不传则节点大小有来源求和决定
|
|
22
|
+
*/
|
|
23
|
+
readonly fixedValue?: number;
|
|
24
|
+
}[];
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
readonly links: {
|
|
29
|
+
/**
|
|
30
|
+
* 来源节点在 nodes 中的 index
|
|
31
|
+
*/
|
|
32
|
+
readonly source: number;
|
|
33
|
+
/**
|
|
34
|
+
* 目标节点在 nodes 中的 index
|
|
35
|
+
*/
|
|
36
|
+
readonly target: number;
|
|
37
|
+
/**
|
|
38
|
+
* 边的值
|
|
39
|
+
*/
|
|
40
|
+
readonly value: number;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
|
|
4
44
|
/** 配置类型定义 */
|
|
5
|
-
export interface SankeyOptions extends Omit<Options, 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
|
|
45
|
+
export interface SankeyOptions extends Omit<Options, 'data' | 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
|
|
46
|
+
/**
|
|
47
|
+
* 数据集的类型,默认为 detail
|
|
48
|
+
*/
|
|
49
|
+
readonly dataType?: 'node-link' | 'detail';
|
|
6
50
|
/**
|
|
7
|
-
*
|
|
51
|
+
* 来源字段,dataType = 'node-link' 的时候,不用传
|
|
8
52
|
*/
|
|
9
|
-
readonly sourceField
|
|
53
|
+
readonly sourceField?: string;
|
|
10
54
|
/**
|
|
11
|
-
*
|
|
55
|
+
* 去向字段,dataType = 'node-link' 的时候,不用传
|
|
12
56
|
*/
|
|
13
|
-
readonly targetField
|
|
57
|
+
readonly targetField?: string;
|
|
14
58
|
/**
|
|
15
|
-
*
|
|
59
|
+
* 权重字段,dataType = 'node-link' 的时候,不用传
|
|
16
60
|
*/
|
|
17
|
-
readonly weightField
|
|
61
|
+
readonly weightField?: string;
|
|
18
62
|
/**
|
|
19
63
|
* 附加的 元字段
|
|
20
64
|
*/
|
|
@@ -22,7 +66,7 @@ export interface SankeyOptions extends Omit<Options, 'xField' | 'yField' | 'xAxi
|
|
|
22
66
|
/**
|
|
23
67
|
* 数据
|
|
24
68
|
*/
|
|
25
|
-
readonly data: Data;
|
|
69
|
+
readonly data: Data | NodeLinkData;
|
|
26
70
|
/**
|
|
27
71
|
* 节点宽度的比如,参考画布的宽度,默认值为 0.008
|
|
28
72
|
*/
|