@antv/g2plot 2.4.8 → 2.4.9
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/README.md +1 -1
- package/dist/g2plot.min.js +4 -4
- package/dist/g2plot.min.js.map +1 -1
- package/esm/core/plot.d.ts +2 -2
- package/esm/core/plot.js +4 -3
- package/esm/core/plot.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/plots/area/types.d.ts +35 -10
- package/esm/plots/area/types.js.map +1 -1
- package/esm/plots/bar/types.d.ts +16 -3
- package/esm/plots/bar/types.js.map +1 -1
- package/esm/plots/bidirectional-bar/types.d.ts +21 -6
- package/esm/plots/bidirectional-bar/types.js.map +1 -1
- package/esm/plots/box/types.d.ts +20 -6
- package/esm/plots/box/types.js.map +1 -1
- package/esm/plots/bullet/types.d.ts +36 -9
- package/esm/plots/bullet/types.js.map +1 -1
- package/esm/plots/chord/types.d.ts +14 -10
- package/esm/plots/chord/types.js.map +1 -1
- package/esm/plots/circle-packing/types.d.ts +25 -8
- package/esm/plots/circle-packing/types.js.map +1 -1
- package/esm/plots/column/types.d.ts +57 -16
- package/esm/plots/column/types.js.map +1 -1
- package/esm/plots/dual-axes/types.d.ts +31 -6
- package/esm/plots/dual-axes/types.js.map +1 -1
- package/esm/plots/facet/types.d.ts +54 -34
- package/esm/plots/facet/types.js.map +1 -1
- package/esm/plots/funnel/types.d.ts +40 -11
- package/esm/plots/funnel/types.js.map +1 -1
- package/esm/plots/gauge/types.d.ts +83 -21
- package/esm/plots/gauge/types.js.map +1 -1
- package/esm/plots/heatmap/types.d.ts +47 -12
- package/esm/plots/heatmap/types.js.map +1 -1
- package/esm/plots/histogram/types.d.ts +17 -6
- package/esm/plots/histogram/types.js.map +1 -1
- package/esm/plots/line/types.d.ts +42 -12
- package/esm/plots/line/types.js.map +1 -1
- package/esm/plots/liquid/index.d.ts +1 -0
- package/esm/plots/liquid/index.js +1 -0
- package/esm/plots/liquid/index.js.map +1 -1
- package/esm/plots/liquid/shapes/liquid.d.ts +16 -1
- package/esm/plots/liquid/shapes/liquid.js +13 -8
- package/esm/plots/liquid/shapes/liquid.js.map +1 -1
- package/esm/plots/liquid/types.d.ts +56 -16
- package/esm/plots/liquid/types.js.map +1 -1
- package/esm/plots/mix/types.d.ts +31 -22
- package/esm/plots/mix/types.js.map +1 -1
- package/esm/plots/pie/types.d.ts +27 -10
- package/esm/plots/pie/types.js.map +1 -1
- package/esm/plots/progress/types.d.ts +13 -4
- package/esm/plots/progress/types.js.map +1 -1
- package/esm/plots/radar/types.d.ts +39 -12
- package/esm/plots/radar/types.js.map +1 -1
- package/esm/plots/radial-bar/types.d.ts +39 -12
- package/esm/plots/radial-bar/types.js.map +1 -1
- package/esm/plots/ring-progress/types.d.ts +18 -6
- package/esm/plots/ring-progress/types.js.map +1 -1
- package/esm/plots/rose/types.d.ts +32 -12
- package/esm/plots/rose/types.js.map +1 -1
- package/esm/plots/sankey/types.d.ts +51 -32
- package/esm/plots/sankey/types.js.map +1 -1
- package/esm/plots/scatter/types.d.ts +76 -22
- package/esm/plots/scatter/types.js.map +1 -1
- package/esm/plots/stock/types.d.ts +20 -7
- package/esm/plots/stock/types.js.map +1 -1
- package/esm/plots/sunburst/types.d.ts +40 -12
- package/esm/plots/sunburst/types.js.map +1 -1
- package/esm/plots/tiny-area/types.d.ts +16 -5
- package/esm/plots/tiny-area/types.js.map +1 -1
- package/esm/plots/tiny-column/types.d.ts +10 -3
- package/esm/plots/tiny-column/types.js.map +1 -1
- package/esm/plots/tiny-line/types.d.ts +17 -5
- package/esm/plots/tiny-line/types.js.map +1 -1
- package/esm/plots/treemap/types.d.ts +17 -6
- package/esm/plots/treemap/types.js.map +1 -1
- package/esm/plots/venn/types.d.ts +20 -6
- package/esm/plots/venn/types.js.map +1 -1
- package/esm/plots/violin/types.d.ts +52 -17
- package/esm/plots/violin/types.js.map +1 -1
- package/esm/plots/waterfall/types.d.ts +42 -10
- package/esm/plots/waterfall/types.js.map +1 -1
- package/esm/plots/word-cloud/types.d.ts +91 -44
- package/esm/plots/word-cloud/types.js.map +1 -1
- package/esm/types/button.d.ts +8 -4
- package/esm/types/button.js.map +1 -1
- package/esm/types/common.d.ts +145 -33
- package/esm/types/common.js.map +1 -1
- package/esm/types/drill-down.d.ts +28 -7
- package/esm/types/drill-down.js.map +1 -1
- package/esm/types/interaction.d.ts +26 -6
- package/esm/types/interaction.js.map +1 -1
- package/esm/types/label.d.ts +11 -3
- package/esm/types/label.js.map +1 -1
- package/esm/types/meta.d.ts +4 -7
- package/esm/types/meta.js.map +1 -1
- package/esm/types/pattern.d.ts +58 -18
- package/esm/types/pattern.js.map +1 -1
- package/esm/types/state.d.ts +11 -3
- package/esm/types/state.js.map +1 -1
- package/esm/types/statistic.d.ts +38 -6
- package/esm/types/statistic.js.map +1 -1
- package/esm/types/tooltip.d.ts +7 -2
- package/esm/types/tooltip.js.map +1 -1
- package/lib/core/plot.d.ts +2 -2
- package/lib/core/plot.js +4 -3
- package/lib/core/plot.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/plots/area/types.d.ts +35 -10
- package/lib/plots/area/types.js.map +1 -1
- package/lib/plots/bar/types.d.ts +16 -3
- package/lib/plots/bar/types.js.map +1 -1
- package/lib/plots/bidirectional-bar/types.d.ts +21 -6
- package/lib/plots/bidirectional-bar/types.js.map +1 -1
- package/lib/plots/box/types.d.ts +20 -6
- package/lib/plots/box/types.js.map +1 -1
- package/lib/plots/bullet/types.d.ts +36 -9
- package/lib/plots/bullet/types.js.map +1 -1
- package/lib/plots/chord/types.d.ts +14 -10
- package/lib/plots/chord/types.js.map +1 -1
- package/lib/plots/circle-packing/types.d.ts +25 -8
- package/lib/plots/circle-packing/types.js.map +1 -1
- package/lib/plots/column/types.d.ts +57 -16
- package/lib/plots/column/types.js.map +1 -1
- package/lib/plots/dual-axes/types.d.ts +31 -6
- package/lib/plots/dual-axes/types.js.map +1 -1
- package/lib/plots/facet/types.d.ts +54 -34
- package/lib/plots/facet/types.js.map +1 -1
- package/lib/plots/funnel/types.d.ts +40 -11
- package/lib/plots/funnel/types.js.map +1 -1
- package/lib/plots/gauge/types.d.ts +83 -21
- package/lib/plots/gauge/types.js.map +1 -1
- package/lib/plots/heatmap/types.d.ts +47 -12
- package/lib/plots/heatmap/types.js.map +1 -1
- package/lib/plots/histogram/types.d.ts +17 -6
- package/lib/plots/histogram/types.js.map +1 -1
- package/lib/plots/line/types.d.ts +42 -12
- package/lib/plots/line/types.js.map +1 -1
- package/lib/plots/liquid/index.d.ts +1 -0
- package/lib/plots/liquid/index.js +2 -0
- package/lib/plots/liquid/index.js.map +1 -1
- package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
- package/lib/plots/liquid/shapes/liquid.js +14 -7
- package/lib/plots/liquid/shapes/liquid.js.map +1 -1
- package/lib/plots/liquid/types.d.ts +56 -16
- package/lib/plots/liquid/types.js.map +1 -1
- package/lib/plots/mix/types.d.ts +31 -22
- package/lib/plots/mix/types.js.map +1 -1
- package/lib/plots/pie/types.d.ts +27 -10
- package/lib/plots/pie/types.js.map +1 -1
- package/lib/plots/progress/types.d.ts +13 -4
- package/lib/plots/progress/types.js.map +1 -1
- package/lib/plots/radar/types.d.ts +39 -12
- package/lib/plots/radar/types.js.map +1 -1
- package/lib/plots/radial-bar/types.d.ts +39 -12
- package/lib/plots/radial-bar/types.js.map +1 -1
- package/lib/plots/ring-progress/types.d.ts +18 -6
- package/lib/plots/ring-progress/types.js.map +1 -1
- package/lib/plots/rose/types.d.ts +32 -12
- package/lib/plots/rose/types.js.map +1 -1
- package/lib/plots/sankey/types.d.ts +51 -32
- package/lib/plots/sankey/types.js.map +1 -1
- package/lib/plots/scatter/types.d.ts +76 -22
- package/lib/plots/scatter/types.js.map +1 -1
- package/lib/plots/stock/types.d.ts +20 -7
- package/lib/plots/stock/types.js.map +1 -1
- package/lib/plots/sunburst/types.d.ts +40 -12
- package/lib/plots/sunburst/types.js.map +1 -1
- package/lib/plots/tiny-area/types.d.ts +16 -5
- package/lib/plots/tiny-area/types.js.map +1 -1
- package/lib/plots/tiny-column/types.d.ts +10 -3
- package/lib/plots/tiny-column/types.js.map +1 -1
- package/lib/plots/tiny-line/types.d.ts +17 -5
- package/lib/plots/tiny-line/types.js.map +1 -1
- package/lib/plots/treemap/types.d.ts +17 -6
- package/lib/plots/treemap/types.js.map +1 -1
- package/lib/plots/venn/types.d.ts +20 -6
- package/lib/plots/venn/types.js.map +1 -1
- package/lib/plots/violin/types.d.ts +52 -17
- package/lib/plots/violin/types.js.map +1 -1
- package/lib/plots/waterfall/types.d.ts +42 -10
- package/lib/plots/waterfall/types.js.map +1 -1
- package/lib/plots/word-cloud/types.d.ts +91 -44
- package/lib/plots/word-cloud/types.js.map +1 -1
- package/lib/types/button.d.ts +8 -4
- package/lib/types/button.js.map +1 -1
- package/lib/types/common.d.ts +145 -33
- package/lib/types/common.js.map +1 -1
- package/lib/types/drill-down.d.ts +28 -7
- package/lib/types/drill-down.js.map +1 -1
- package/lib/types/interaction.d.ts +26 -6
- package/lib/types/interaction.js.map +1 -1
- package/lib/types/label.d.ts +11 -3
- package/lib/types/label.js.map +1 -1
- package/lib/types/meta.d.ts +4 -7
- package/lib/types/meta.js.map +1 -1
- package/lib/types/pattern.d.ts +58 -18
- package/lib/types/pattern.js.map +1 -1
- package/lib/types/state.d.ts +11 -3
- package/lib/types/state.js.map +1 -1
- package/lib/types/statistic.d.ts +38 -6
- package/lib/types/statistic.js.map +1 -1
- package/lib/types/tooltip.d.ts +7 -2
- package/lib/types/tooltip.js.map +1 -1
- package/package.json +1 -1
- package/src/core/plot.ts +5 -4
- package/src/index.ts +2 -2
- package/src/plots/area/types.ts +35 -10
- package/src/plots/bar/types.ts +16 -3
- package/src/plots/bidirectional-bar/types.ts +21 -6
- package/src/plots/box/types.ts +20 -6
- package/src/plots/bullet/types.ts +36 -17
- package/src/plots/chord/types.ts +14 -11
- package/src/plots/circle-packing/types.ts +25 -14
- package/src/plots/column/types.ts +57 -20
- package/src/plots/dual-axes/types.ts +31 -16
- package/src/plots/facet/types.ts +54 -49
- package/src/plots/funnel/types.ts +40 -13
- package/src/plots/gauge/types.ts +86 -27
- package/src/plots/heatmap/types.ts +49 -14
- package/src/plots/histogram/types.ts +17 -9
- package/src/plots/line/types.ts +42 -14
- package/src/plots/liquid/index.ts +2 -0
- package/src/plots/liquid/shapes/liquid.ts +16 -8
- package/src/plots/liquid/types.ts +56 -16
- package/src/plots/mix/types.ts +31 -35
- package/src/plots/pie/types.ts +27 -10
- package/src/plots/progress/types.ts +13 -4
- package/src/plots/radar/types.ts +39 -12
- package/src/plots/radial-bar/types.ts +39 -12
- package/src/plots/ring-progress/types.ts +18 -6
- package/src/plots/rose/types.ts +32 -12
- package/src/plots/sankey/types.ts +52 -32
- package/src/plots/scatter/types.ts +77 -24
- package/src/plots/stock/types.ts +21 -8
- package/src/plots/sunburst/types.ts +42 -12
- package/src/plots/tiny-area/types.ts +16 -5
- package/src/plots/tiny-column/types.ts +10 -3
- package/src/plots/tiny-line/types.ts +17 -5
- package/src/plots/treemap/types.ts +17 -7
- package/src/plots/venn/types.ts +21 -6
- package/src/plots/violin/types.ts +52 -17
- package/src/plots/waterfall/types.ts +42 -10
- package/src/plots/word-cloud/types.ts +91 -44
- package/src/types/button.ts +8 -4
- package/src/types/common.ts +145 -37
- package/src/types/drill-down.ts +28 -7
- package/src/types/interaction.ts +26 -6
- package/src/types/label.ts +11 -3
- package/src/types/meta.ts +4 -7
- package/src/types/pattern.ts +58 -18
- package/src/types/state.ts +11 -3
- package/src/types/statistic.ts +38 -6
- package/src/types/tooltip.ts +7 -2
|
@@ -2,125 +2,145 @@ import { Data, Options, State, StyleAttr } from '../../types';
|
|
|
2
2
|
import { NodeDepth, NodeSort } from './layout';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* node-link 数据类型的结构
|
|
5
|
+
* @title node-link 数据类型的结构
|
|
6
6
|
*/
|
|
7
7
|
export type NodeLinkData = {
|
|
8
8
|
/**
|
|
9
|
-
* 节点数据
|
|
9
|
+
* @title 节点数据
|
|
10
10
|
*/
|
|
11
11
|
readonly nodes: {
|
|
12
12
|
/**
|
|
13
|
-
* id
|
|
13
|
+
* @title id
|
|
14
|
+
* @description 唯一即可,一般可以直接等于 name
|
|
14
15
|
*/
|
|
15
16
|
readonly id: string;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* @title 节点的名称
|
|
19
|
+
* @description 用于 UI 上的现实
|
|
18
20
|
*/
|
|
19
21
|
readonly name: string;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* @title 节点的值
|
|
24
|
+
* @description 不传则节点大小有来源求和决定
|
|
22
25
|
*/
|
|
23
26
|
readonly fixedValue?: number;
|
|
24
27
|
}[];
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
+
|
|
28
29
|
readonly links: {
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* @title 来源节点
|
|
32
|
+
* @description 在 nodes 中的 index
|
|
31
33
|
*/
|
|
32
34
|
readonly source: number;
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* @title 目标节点
|
|
37
|
+
* @description 在 nodes 中的 index
|
|
35
38
|
*/
|
|
36
39
|
readonly target: number;
|
|
37
40
|
/**
|
|
38
|
-
* 边的值
|
|
41
|
+
* @title 边的值
|
|
39
42
|
*/
|
|
40
43
|
readonly value: number;
|
|
41
44
|
}[];
|
|
42
45
|
};
|
|
43
46
|
|
|
44
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* @title 配置类型定义
|
|
49
|
+
*/
|
|
45
50
|
export interface SankeyOptions extends Omit<Options, 'data' | 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
|
|
46
51
|
/**
|
|
47
|
-
*
|
|
52
|
+
* @title 数据集的类型
|
|
53
|
+
* @description 数据集的类型 'node-link' | 'detail'
|
|
54
|
+
* @default "detail"
|
|
48
55
|
*/
|
|
49
56
|
readonly dataType?: 'node-link' | 'detail';
|
|
50
57
|
/**
|
|
51
|
-
*
|
|
58
|
+
* @title 来源字段
|
|
59
|
+
* @description dataType = 'node-link' 的时候,不用传
|
|
52
60
|
*/
|
|
53
61
|
readonly sourceField?: string;
|
|
54
62
|
/**
|
|
55
|
-
*
|
|
63
|
+
* @title 去向字段
|
|
64
|
+
* @description dataType = 'node-link' 的时候,不用传
|
|
56
65
|
*/
|
|
57
66
|
readonly targetField?: string;
|
|
58
67
|
/**
|
|
59
|
-
*
|
|
68
|
+
* @title 权重字段
|
|
69
|
+
* @description dataType = 'node-link' 的时候,不用传
|
|
60
70
|
*/
|
|
61
71
|
readonly weightField?: string;
|
|
62
72
|
/**
|
|
63
|
-
*
|
|
73
|
+
* @title 附加的元字段
|
|
64
74
|
*/
|
|
65
75
|
readonly rawFields?: string[];
|
|
66
76
|
/**
|
|
67
|
-
* 数据
|
|
77
|
+
* @title 数据
|
|
68
78
|
*/
|
|
69
79
|
readonly data: Data | NodeLinkData;
|
|
70
80
|
/**
|
|
71
|
-
*
|
|
81
|
+
* @title 节点宽度
|
|
82
|
+
* @description 参考画布的宽度
|
|
83
|
+
* @default 0.008
|
|
72
84
|
*/
|
|
73
85
|
readonly nodeWidthRatio?: number;
|
|
74
86
|
/**
|
|
75
|
-
*
|
|
87
|
+
* @title 节点宽度的像素设置
|
|
88
|
+
* @description 优先级高于 nodeWidthRatio
|
|
76
89
|
*/
|
|
77
90
|
readonly nodeWidth?: number;
|
|
78
91
|
/**
|
|
79
|
-
*
|
|
92
|
+
* @title 节点之间的间距比例
|
|
93
|
+
* @description 参考画布高度
|
|
94
|
+
* @default 0.03
|
|
80
95
|
*/
|
|
81
96
|
readonly nodePaddingRatio?: number;
|
|
82
97
|
/**
|
|
83
|
-
*
|
|
98
|
+
* @title 节点间距的像素设置
|
|
99
|
+
* @description 优先级高于 nodePaddingRatio
|
|
84
100
|
*/
|
|
85
101
|
readonly nodePadding?: number;
|
|
86
102
|
/**
|
|
87
|
-
*
|
|
103
|
+
* @title 节点对齐的方式
|
|
104
|
+
* @description 节点对齐的方式 'left' | 'right' | 'center' | 'justify'
|
|
105
|
+
* @default "justify"
|
|
88
106
|
*/
|
|
89
107
|
readonly nodeAlign?: 'left' | 'right' | 'center' | 'justify';
|
|
90
108
|
/**
|
|
91
|
-
*
|
|
109
|
+
* @title 节点排序方式
|
|
92
110
|
*/
|
|
93
111
|
readonly nodeSort?: NodeSort;
|
|
94
112
|
/**
|
|
95
|
-
*
|
|
113
|
+
* @title 节点排放分层的顺序
|
|
114
|
+
* @description 从 0 开始,并且返回值需要保证所有的层级都有节点
|
|
96
115
|
*/
|
|
97
116
|
readonly nodeDepth?: NodeDepth;
|
|
98
117
|
/**
|
|
99
|
-
* 节点样式
|
|
118
|
+
* @title 节点样式
|
|
100
119
|
*/
|
|
101
120
|
readonly nodeStyle?: StyleAttr;
|
|
102
121
|
/**
|
|
103
|
-
* 节点状态样式
|
|
122
|
+
* @title 节点状态样式
|
|
104
123
|
*/
|
|
105
124
|
readonly nodeState?: State;
|
|
106
125
|
/**
|
|
107
|
-
* 边样式
|
|
126
|
+
* @title 边样式
|
|
108
127
|
*/
|
|
109
128
|
readonly edgeStyle?: StyleAttr;
|
|
110
129
|
/**
|
|
111
|
-
* 边状态样式
|
|
130
|
+
* @title 边状态样式
|
|
112
131
|
*/
|
|
113
132
|
readonly edgeState?: State;
|
|
114
133
|
/**
|
|
115
|
-
*
|
|
134
|
+
* @title 节点位置是否可以拖拽
|
|
135
|
+
* @default false
|
|
116
136
|
*/
|
|
117
137
|
readonly nodeDraggable?: boolean;
|
|
118
138
|
/**
|
|
119
|
-
* 边交互
|
|
139
|
+
* @title 边交互
|
|
120
140
|
*/
|
|
121
141
|
readonly edgeInteractions?: Options['interactions'];
|
|
122
142
|
/**
|
|
123
|
-
* 节点交互
|
|
143
|
+
* @title 节点交互
|
|
124
144
|
*/
|
|
125
145
|
readonly nodeInteractions?: Options['interactions'];
|
|
126
146
|
}
|
|
@@ -15,59 +15,112 @@ interface Labels extends Omit<TextOption, 'position'> {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
interface QuadrantOptions {
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title x 基准线
|
|
20
|
+
* @description x 方向上的象限分割基准线
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
19
23
|
readonly xBaseline?: number;
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title y 基准线
|
|
26
|
+
* @description y 方向上的象限分割基准线
|
|
27
|
+
* @default 0
|
|
28
|
+
*/
|
|
21
29
|
readonly yBaseline?: number;
|
|
22
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title 配置象限分割线的样式
|
|
32
|
+
*/
|
|
23
33
|
readonly lineStyle?: RegionPositionBaseOption;
|
|
24
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title 象限样式
|
|
36
|
+
*/
|
|
25
37
|
readonly regionStyle?: RegionPositionBaseOption[];
|
|
26
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @title 象限文本
|
|
40
|
+
*/
|
|
27
41
|
readonly labels?: Labels[];
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
export interface RegressionLineOptions {
|
|
31
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 是否顶层显示
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
32
49
|
readonly top?: boolean;
|
|
33
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @title 回归线类型
|
|
52
|
+
*/
|
|
34
53
|
readonly type?: string;
|
|
35
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* @title 配置回归线样式
|
|
56
|
+
*/
|
|
36
57
|
readonly style?: ShapeStyle;
|
|
37
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* @title 自定义算法
|
|
60
|
+
* @description [[0,0],[100,100]]
|
|
61
|
+
*/
|
|
38
62
|
readonly algorithm?: Array<[number, number]> | ((data: any) => Array<[number, number]>);
|
|
39
63
|
}
|
|
40
64
|
|
|
41
65
|
export interface ScatterOptions extends Options {
|
|
42
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* @title x 轴字段
|
|
68
|
+
*/
|
|
43
69
|
readonly xField: string;
|
|
44
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* @title y 轴字段
|
|
72
|
+
*/
|
|
45
73
|
readonly yField: string;
|
|
46
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* @title 数据调整类型
|
|
76
|
+
* @description 数据调整类型 'jitter' | 'stack' | 'symmetric' | 'dodge'
|
|
77
|
+
*/
|
|
47
78
|
readonly type?: 'jitter' | 'stack' | 'symmetric' | 'dodge';
|
|
48
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* @title 点大小映射对应的数据字段名
|
|
81
|
+
*/
|
|
49
82
|
readonly sizeField?: string;
|
|
50
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* @title size 对应的图例
|
|
85
|
+
*/
|
|
51
86
|
readonly sizeLegend?: Options['legend'];
|
|
52
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* @title 散点图大小
|
|
89
|
+
*/
|
|
53
90
|
readonly size?: SizeAttr;
|
|
54
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* @title 点形状映射对应的数据字段名
|
|
93
|
+
*/
|
|
55
94
|
readonly shapeField?: string;
|
|
56
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* @title shape 对应的图例
|
|
97
|
+
*/
|
|
57
98
|
readonly shapeLegend?: Options['legend'];
|
|
58
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* @title 散点图形状
|
|
101
|
+
*/
|
|
59
102
|
readonly shape?: ShapeAttr;
|
|
60
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* @title 散点图样式
|
|
105
|
+
*/
|
|
61
106
|
readonly pointStyle?: StyleAttr;
|
|
62
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* @title 点颜色映射对应的数据字段名
|
|
109
|
+
*/
|
|
63
110
|
readonly colorField?: string;
|
|
64
111
|
|
|
65
112
|
// 图表标注组件
|
|
66
|
-
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @title 四象限组件
|
|
116
|
+
*/
|
|
67
117
|
readonly quadrant?: QuadrantOptions;
|
|
68
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* @title 归曲线
|
|
120
|
+
*/
|
|
69
121
|
readonly regressionLine?: RegressionLineOptions;
|
|
70
|
-
|
|
71
|
-
|
|
122
|
+
/**
|
|
123
|
+
* @title 图表交互
|
|
124
|
+
*/
|
|
72
125
|
readonly brush?: BrushCfg;
|
|
73
126
|
}
|
package/src/plots/stock/types.ts
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
|
|
3
3
|
export interface StockOptions extends Options {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title x 轴字段 日期
|
|
6
|
+
*/
|
|
5
7
|
readonly xField: string;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
+
/**
|
|
9
|
+
* @title y 轴映射
|
|
10
|
+
* @description range 【开盘价/收盘价/最高价/最低价】,设置一个指定 [open, close, high, low]【开盘价/收盘价/最高价/最低价】字段的数组
|
|
11
|
+
*/
|
|
8
12
|
readonly yField: [string, string, string, string];
|
|
9
13
|
|
|
10
|
-
/**
|
|
11
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @title 颜色配置
|
|
16
|
+
* @description 不支持 color 配置
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @title 上涨色
|
|
21
|
+
*/
|
|
12
22
|
readonly risingFill?: string;
|
|
13
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 下跌色
|
|
25
|
+
*/
|
|
14
26
|
readonly fallingFill?: string;
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @title 样式配置
|
|
29
|
+
*/
|
|
17
30
|
readonly stockStyle?: StyleAttr;
|
|
18
31
|
}
|
|
@@ -3,36 +3,66 @@ import { DrillDownCfg } from '../../types/drill-down';
|
|
|
3
3
|
import { HierarchyOption } from '../../utils/hierarchy/types';
|
|
4
4
|
|
|
5
5
|
export interface SunburstOptions extends Omit<Options, 'data' | 'slider' | 'scrollbar' | 'xAxis' | 'yAxis'> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title 旭日图数据
|
|
8
|
+
*/
|
|
7
9
|
readonly data: any;
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 径向类型
|
|
12
|
+
* @description 径向类型'x' | 'y'
|
|
13
|
+
*/
|
|
9
14
|
readonly reflect?: 'x' | 'y';
|
|
10
15
|
|
|
11
16
|
// 样式
|
|
12
|
-
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @title 内径
|
|
20
|
+
*/
|
|
13
21
|
readonly innerRadius?: number;
|
|
14
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 半经
|
|
24
|
+
*/
|
|
15
25
|
readonly radius?: number;
|
|
16
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 颜色映射
|
|
28
|
+
*/
|
|
17
29
|
readonly colorField?: string;
|
|
18
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title 颜色
|
|
32
|
+
*/
|
|
19
33
|
readonly color?: ColorAttr;
|
|
20
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title 旭日图形样式
|
|
36
|
+
*/
|
|
21
37
|
readonly sunburstStyle?: StyleAttr;
|
|
22
38
|
|
|
23
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title 层级布局
|
|
41
|
+
*/
|
|
24
42
|
readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type'> & {
|
|
25
43
|
/** default: 'value', required data to be like: { name: 'xx', [field]: 12, children: [] } */
|
|
26
44
|
readonly field?: string;
|
|
27
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 是否忽略父节点的权重
|
|
47
|
+
* @description 其父节点的权重不由子节点权重总和决定
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
28
50
|
readonly ignoreParentValue?: boolean;
|
|
29
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 展示的层级深度
|
|
53
|
+
* @description 取值 > 0 默认空, 代表全部展示
|
|
54
|
+
*/
|
|
30
55
|
readonly activeDepth?: number;
|
|
31
56
|
};
|
|
32
57
|
|
|
33
58
|
// 其他
|
|
34
|
-
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @title 额外的原始字段
|
|
62
|
+
*/
|
|
35
63
|
readonly rawFields?: string[];
|
|
36
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* @title 下钻交互
|
|
66
|
+
*/
|
|
37
67
|
readonly drilldown?: DrillDownCfg;
|
|
38
68
|
}
|
|
@@ -4,14 +4,25 @@ import { PointGeometryOptions } from '../../adaptor/geometries/point';
|
|
|
4
4
|
|
|
5
5
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
6
6
|
export interface TinyAreaOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title 具体的数据
|
|
9
|
+
*/
|
|
8
10
|
readonly data: number[];
|
|
9
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @title 是否平滑
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
10
15
|
readonly smooth?: boolean;
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 面积折线图形样式
|
|
18
|
+
*/
|
|
12
19
|
readonly areaStyle?: StyleAttr;
|
|
13
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @title 面积折线图形样式
|
|
22
|
+
*/
|
|
14
23
|
readonly line?: MappingOptions;
|
|
15
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 面积点图形样式
|
|
26
|
+
*/
|
|
16
27
|
readonly point?: MappingOptions & Pick<PointGeometryOptions, 'state'>;
|
|
17
28
|
}
|
|
@@ -2,10 +2,17 @@ import { Options, StyleAttr } from '../../types';
|
|
|
2
2
|
|
|
3
3
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
4
4
|
export interface TinyColumnOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title 具体的数据
|
|
7
|
+
*/
|
|
6
8
|
readonly data: number[];
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title 柱状图宽度占比
|
|
11
|
+
* @description 范围[0-1]
|
|
12
|
+
*/
|
|
8
13
|
readonly columnWidthRatio?: number;
|
|
9
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title 迷你柱形图形样式
|
|
16
|
+
*/
|
|
10
17
|
readonly columnStyle?: StyleAttr;
|
|
11
18
|
}
|
|
@@ -4,14 +4,26 @@ import { PointGeometryOptions } from '../../adaptor/geometries/point';
|
|
|
4
4
|
|
|
5
5
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
6
6
|
export interface TinyLineOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title 具体的数据
|
|
9
|
+
*/
|
|
8
10
|
readonly data: number[];
|
|
9
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @title 是否平滑
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
10
15
|
readonly smooth?: boolean;
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 是否连接空数据
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
12
20
|
readonly connectNulls?: boolean;
|
|
13
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 折线图形样式
|
|
23
|
+
*/
|
|
14
24
|
readonly lineStyle?: StyleAttr;
|
|
15
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 折线点图形样式
|
|
27
|
+
*/
|
|
16
28
|
readonly point?: MappingOptions & Pick<PointGeometryOptions, 'state'>;
|
|
17
29
|
}
|
|
@@ -3,19 +3,29 @@ import { DrillDownCfg } from '../../types/drill-down';
|
|
|
3
3
|
import { HierarchyOption } from '../../utils/hierarchy/types';
|
|
4
4
|
|
|
5
5
|
export interface TreemapOptions extends Omit<Options, 'data'> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title 颜色字段
|
|
8
|
+
*/
|
|
7
9
|
readonly colorField?: string;
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 数据字段
|
|
12
|
+
*/
|
|
9
13
|
readonly data?: Record<string, any>;
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title 图形样式
|
|
16
|
+
*/
|
|
11
17
|
readonly rectStyle?: StyleAttr;
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 层级布局
|
|
20
|
+
*/
|
|
13
21
|
readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;
|
|
14
22
|
/**
|
|
15
|
-
*
|
|
23
|
+
* @title 附加的源字段
|
|
16
24
|
*/
|
|
17
25
|
readonly rawFields?: string[];
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @title 矩阵树图
|
|
28
|
+
* @description 内置一些交互 下钻交互相关配置
|
|
29
|
+
*/
|
|
20
30
|
readonly drilldown?: DrillDownCfg;
|
|
21
31
|
}
|
package/src/plots/venn/types.ts
CHANGED
|
@@ -6,19 +6,34 @@ export type VennData = (Types.Datum & { sets: string[]; [PATH_FIELD]: string; [I
|
|
|
6
6
|
|
|
7
7
|
/** 配置类型定义 */
|
|
8
8
|
export interface VennOptions extends Options {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title 韦恩图数据
|
|
11
|
+
*/
|
|
10
12
|
readonly data: Types.Datum[];
|
|
11
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 集合字段
|
|
15
|
+
*/
|
|
12
16
|
readonly setsField: string;
|
|
13
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 大小字段
|
|
19
|
+
*/
|
|
14
20
|
readonly sizeField: string;
|
|
15
21
|
|
|
16
22
|
// 韦恩图 样式
|
|
17
|
-
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title 颜色
|
|
26
|
+
*/
|
|
18
27
|
readonly color?: string | string[] | ((datum: Datum, defaultColor?: string) => string);
|
|
19
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 并集合的颜色混合方式
|
|
30
|
+
* @description 可选项: 参考 https://gka.github.io/chroma.js/#chroma-blend
|
|
31
|
+
* @default "multiply"
|
|
32
|
+
*/
|
|
20
33
|
readonly blendMode?: string;
|
|
21
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title point 样式
|
|
36
|
+
*/
|
|
22
37
|
readonly pointStyle?: StyleAttr;
|
|
23
38
|
}
|
|
24
39
|
|