@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
package/src/plots/facet/types.ts
CHANGED
|
@@ -9,140 +9,145 @@ import { Interaction } from '../../types/interaction';
|
|
|
9
9
|
import { IPlotTypes } from '../mix/utils';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* geometry 映射信息
|
|
12
|
+
* @title geometry 映射信息
|
|
13
13
|
*/
|
|
14
14
|
export type IGeometry = Geometry & {
|
|
15
15
|
adjust?: Types.AdjustOption;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* 子 view
|
|
20
|
-
* 1. 暂时不开嵌套 view 的情况
|
|
21
|
-
* 2. 暂不开放 分面子 view 的 meta 独立设置
|
|
19
|
+
* @title 子 view 的配置
|
|
20
|
+
* @description 1. 暂时不开嵌套 view 的情况 2. 暂不开放 分面子 view 的 meta 独立设置
|
|
22
21
|
*/
|
|
23
22
|
export type IView = {
|
|
24
23
|
/**
|
|
25
|
-
* 图形
|
|
24
|
+
* @title 图形
|
|
25
|
+
* @description geometry 及映射配置
|
|
26
26
|
*/
|
|
27
27
|
readonly geometries: IGeometry[];
|
|
28
|
-
|
|
29
28
|
/**
|
|
30
|
-
*
|
|
29
|
+
* @title 数据
|
|
30
|
+
* @description optional,view 中的数据
|
|
31
31
|
*/
|
|
32
32
|
readonly data?: Data;
|
|
33
|
-
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
34
|
+
* @title meta
|
|
36
35
|
*/
|
|
37
36
|
readonly meta?: Record<string, Axis>;
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
38
|
+
* @title 坐标系的配置
|
|
39
|
+
* @description 每一个 view 具有相同的坐标系
|
|
41
40
|
*/
|
|
42
41
|
readonly coordinate?: Types.CoordinateOption;
|
|
43
|
-
|
|
44
42
|
/**
|
|
45
|
-
*
|
|
43
|
+
* @title 坐标轴配置
|
|
46
44
|
*/
|
|
47
45
|
readonly axes?: false | Record<string, Axis>;
|
|
48
|
-
|
|
49
46
|
/**
|
|
50
|
-
*
|
|
47
|
+
* @title interactions 配置
|
|
51
48
|
*/
|
|
52
49
|
readonly interactions?: Interaction[];
|
|
53
|
-
|
|
54
50
|
/**
|
|
55
|
-
*
|
|
51
|
+
* @title annotation 配置
|
|
56
52
|
*/
|
|
57
53
|
readonly annotations?: Annotation[];
|
|
58
|
-
|
|
59
54
|
/**
|
|
60
|
-
*
|
|
55
|
+
* @title animation 配置
|
|
61
56
|
*/
|
|
62
57
|
readonly animation?: Animation;
|
|
63
|
-
|
|
64
58
|
/**
|
|
65
|
-
*
|
|
59
|
+
* @title tooltip 配置
|
|
66
60
|
*/
|
|
67
61
|
readonly tooltip?: Tooltip;
|
|
68
62
|
};
|
|
69
63
|
|
|
70
64
|
/**
|
|
71
|
-
* 子 plot 的配置
|
|
65
|
+
* @title 子 plot 的配置
|
|
72
66
|
*/
|
|
73
67
|
export type IPlot = IPlotTypes;
|
|
74
68
|
/**
|
|
75
|
-
* facetData map
|
|
69
|
+
* @title facetData map
|
|
76
70
|
*/
|
|
77
71
|
type FacetDataMap = {
|
|
78
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* @title rect 类型分面配置
|
|
74
|
+
*/
|
|
79
75
|
readonly rect: Types.RectData;
|
|
80
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* @title mirror 类型分面配置
|
|
78
|
+
*/
|
|
81
79
|
readonly mirror: Types.MirrorData;
|
|
82
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* @title list 类型分面配置
|
|
82
|
+
*/
|
|
83
83
|
readonly list: Types.ListData;
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* @title matrix 类型分面配置
|
|
86
|
+
*/
|
|
85
87
|
readonly matrix: Types.MatrixData;
|
|
86
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* @title circle 类型分面配置
|
|
90
|
+
*/
|
|
87
91
|
readonly circle: Types.CircleData;
|
|
88
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* @title tree 类型分面配置
|
|
94
|
+
*/
|
|
89
95
|
readonly tree: Types.TreeData;
|
|
90
96
|
};
|
|
91
97
|
|
|
92
98
|
type FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;
|
|
93
99
|
|
|
94
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* @title 分面图的配置类型定义
|
|
102
|
+
*/
|
|
95
103
|
export interface FacetOptions<T extends keyof Types.FacetCfgMap = keyof Types.FacetCfgMap> extends Options, FacetCfg {
|
|
96
104
|
/**
|
|
97
|
-
*
|
|
105
|
+
* @title 分面类型
|
|
106
|
+
* @description G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix
|
|
98
107
|
*/
|
|
99
108
|
readonly type: T;
|
|
100
109
|
/**
|
|
101
|
-
*
|
|
110
|
+
* @title 数据划分维度
|
|
102
111
|
*/
|
|
103
112
|
readonly fields: string[];
|
|
104
113
|
/**
|
|
105
|
-
* 分面数据
|
|
114
|
+
* @title 分面数据
|
|
106
115
|
*/
|
|
107
116
|
readonly data: Data;
|
|
108
|
-
|
|
109
117
|
/**
|
|
110
|
-
*
|
|
111
|
-
* 回调的方式
|
|
118
|
+
* @title 绘图
|
|
119
|
+
* @description 每个分面 view 中的具体绘图表现 回调的方式
|
|
112
120
|
*/
|
|
113
121
|
readonly eachView: (innerView: View, facet?: FacetDataMap[T]) => IView | IPlot;
|
|
114
122
|
/**
|
|
115
|
-
* 是否展示分面标题
|
|
123
|
+
* @title 是否展示分面标题
|
|
124
|
+
* @default false
|
|
116
125
|
*/
|
|
117
126
|
readonly showTitle?: boolean;
|
|
118
|
-
|
|
119
127
|
/**
|
|
120
|
-
*
|
|
128
|
+
* @title meta 字段
|
|
129
|
+
* @description facet 中对应的 meta 字段配置
|
|
121
130
|
*/
|
|
122
131
|
readonly meta?: Record<string, Meta>;
|
|
123
|
-
|
|
124
132
|
/**
|
|
125
|
-
*
|
|
133
|
+
* @title 坐标系的配置
|
|
134
|
+
* @description 每一个 view 具有相同的坐标系
|
|
126
135
|
*/
|
|
127
136
|
readonly coordinate?: Types.CoordinateOption;
|
|
128
|
-
|
|
129
137
|
/**
|
|
130
|
-
*
|
|
138
|
+
* @title 轴配置
|
|
131
139
|
*/
|
|
132
140
|
readonly axes?: false | Record<string, Axis>;
|
|
133
|
-
|
|
134
141
|
/**
|
|
135
|
-
*
|
|
142
|
+
* @title tooltip 配置
|
|
136
143
|
*/
|
|
137
144
|
readonly tooltip?: Tooltip;
|
|
138
|
-
|
|
139
145
|
/**
|
|
140
|
-
*
|
|
146
|
+
* @title 图例配置
|
|
141
147
|
*/
|
|
142
148
|
readonly legend?: Legend;
|
|
143
|
-
|
|
144
149
|
/**
|
|
145
|
-
*
|
|
150
|
+
* @title 图例配置
|
|
146
151
|
*/
|
|
147
152
|
readonly interactions?: Interaction[];
|
|
148
153
|
}
|
|
@@ -7,31 +7,58 @@ export type ConversionPosition = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export interface FunnelOptions extends Options {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title x轴字段
|
|
12
|
+
*/
|
|
11
13
|
readonly xField?: string;
|
|
12
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title y轴字段
|
|
16
|
+
*/
|
|
13
17
|
readonly yField?: string;
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 分组字段
|
|
20
|
+
* @description 漏斗图将根据此字段转置为分面漏斗图
|
|
21
|
+
*/
|
|
15
22
|
readonly seriesField?: string;
|
|
16
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 对比字段
|
|
25
|
+
* @description 漏斗图将根据此字段转置为对比漏斗图
|
|
26
|
+
*/
|
|
17
27
|
readonly compareField?: string;
|
|
18
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 是否转置
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
19
32
|
readonly isTransposed?: boolean;
|
|
20
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title 是否是动态高度
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
21
37
|
readonly dynamicHeight?: boolean;
|
|
22
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @title 最大宽度
|
|
40
|
+
* @description 范围0-1
|
|
41
|
+
*/
|
|
23
42
|
readonly maxSize?: number;
|
|
24
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 最小宽度
|
|
45
|
+
* @description 范围0-1
|
|
46
|
+
*/
|
|
25
47
|
readonly minSize?: number;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
/**
|
|
49
|
+
* @title shape 形状
|
|
50
|
+
* @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用
|
|
51
|
+
*/
|
|
29
52
|
readonly shape?: string;
|
|
30
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 漏斗图样式
|
|
55
|
+
*/
|
|
31
56
|
readonly funnelStyle?: StyleAttr;
|
|
32
57
|
|
|
33
58
|
// 组件
|
|
34
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* @title 转化率信息
|
|
61
|
+
*/
|
|
35
62
|
readonly conversionTag?:
|
|
36
63
|
| false
|
|
37
64
|
| {
|
package/src/plots/gauge/types.ts
CHANGED
|
@@ -4,29 +4,45 @@ import { PERCENT, RANGE_TYPE, RANGE_VALUE } from './constants';
|
|
|
4
4
|
|
|
5
5
|
/** 指标指标的配置 */
|
|
6
6
|
export type Indicator = {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @title 指针
|
|
9
|
+
* @description 只允许静态的 object
|
|
10
|
+
*/
|
|
8
11
|
readonly pointer?: {
|
|
9
|
-
readonly style?: ShapeStyle;
|
|
12
|
+
readonly style?: ShapeStyle;
|
|
10
13
|
};
|
|
11
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @title 圆环
|
|
16
|
+
* @description 只允许静态的 object
|
|
17
|
+
*/
|
|
12
18
|
readonly pin?: {
|
|
13
|
-
readonly style?: ShapeStyle;
|
|
19
|
+
readonly style?: ShapeStyle;
|
|
14
20
|
};
|
|
15
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @title 自定义指针 shape
|
|
23
|
+
* @default 'gauge-indicator'
|
|
24
|
+
*/
|
|
16
25
|
readonly shape?: string;
|
|
17
26
|
};
|
|
18
27
|
|
|
19
28
|
export type Range = {
|
|
20
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @title 辅助的刻度值
|
|
31
|
+
* @description 0 ~ 1 的数字
|
|
32
|
+
*/
|
|
21
33
|
readonly ticks?: number[];
|
|
22
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title 辅助刻度的颜色配置
|
|
36
|
+
*/
|
|
23
37
|
readonly color?: string | string[];
|
|
24
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @title 仪表盘辅助背景的宽度
|
|
40
|
+
*/
|
|
25
41
|
readonly width?: number;
|
|
26
42
|
};
|
|
27
43
|
|
|
28
44
|
/**
|
|
29
|
-
* 仪表盘辅助生成的 rangeData
|
|
45
|
+
* @title 仪表盘辅助生成的 rangeData
|
|
30
46
|
*/
|
|
31
47
|
export type GaugeRangeData = {
|
|
32
48
|
readonly [RANGE_VALUE]?: number;
|
|
@@ -34,46 +50,89 @@ export type GaugeRangeData = {
|
|
|
34
50
|
readonly [PERCENT]: number;
|
|
35
51
|
}[];
|
|
36
52
|
|
|
37
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 仪表盘配置类型定义
|
|
55
|
+
*/
|
|
38
56
|
export interface GaugeOptions
|
|
39
57
|
extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'xAxis' | 'yAxis' | 'xField' | 'yField' | 'color'> {
|
|
40
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* @title 指标的比例
|
|
60
|
+
* @description 范围0 ~ 1
|
|
61
|
+
*/
|
|
41
62
|
readonly percent: number;
|
|
42
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* @title 外弧度
|
|
65
|
+
* @description 范围0 ~ 1
|
|
66
|
+
*/
|
|
43
67
|
readonly radius?: number;
|
|
44
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* @title 内弧度
|
|
70
|
+
* @description 范围0 ~ 1
|
|
71
|
+
*/
|
|
45
72
|
readonly innerRadius?: number;
|
|
46
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* @title 弧度起始
|
|
75
|
+
*/
|
|
47
76
|
readonly startAngle?: number;
|
|
48
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* @title 弧度结束
|
|
79
|
+
*/
|
|
49
80
|
readonly endAngle?: number;
|
|
50
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* @title 辅助的 range 组件
|
|
83
|
+
*/
|
|
51
84
|
readonly range?: Range;
|
|
52
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* @title 坐标轴配置
|
|
87
|
+
*/
|
|
53
88
|
readonly axis?: Axis;
|
|
54
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* @title 指针的配置
|
|
91
|
+
*/
|
|
55
92
|
readonly indicator?: false | Indicator;
|
|
56
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* @title 统计文本
|
|
95
|
+
*/
|
|
57
96
|
readonly statistic?: Statistic;
|
|
58
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* @title 仪表盘样式
|
|
99
|
+
*/
|
|
59
100
|
readonly gaugeStyle?: StyleAttr;
|
|
60
101
|
|
|
61
|
-
|
|
62
|
-
|
|
102
|
+
/**
|
|
103
|
+
* @title meter gauge 相关配置
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @title 仪表盘类型
|
|
108
|
+
* @description 可选项: 'meter', default 为空
|
|
109
|
+
*/
|
|
63
110
|
readonly type?: string;
|
|
64
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* @title 仪表盘配置
|
|
113
|
+
* @description 当仪表盘类型 = 'meter' 生效
|
|
114
|
+
*/
|
|
65
115
|
readonly meter?: {
|
|
66
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* @title 仪表盘总步数
|
|
118
|
+
* @default "50"
|
|
119
|
+
*/
|
|
67
120
|
readonly steps?: number;
|
|
68
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* @title step 与 gap 的宽度占比
|
|
123
|
+
* @default "0.5"
|
|
124
|
+
*/
|
|
69
125
|
readonly stepRatio?: number;
|
|
70
126
|
};
|
|
71
127
|
}
|
|
72
128
|
|
|
73
129
|
/**
|
|
74
|
-
* 仪表盘
|
|
130
|
+
* @title 仪表盘
|
|
131
|
+
* @description 自定义 shape 使用的 customInfo
|
|
75
132
|
*/
|
|
76
133
|
export type GaugeCustomInfo = {
|
|
77
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* @title 仪表盘 meter 类型的相关配置
|
|
136
|
+
*/
|
|
78
137
|
readonly meter?: GaugeOptions['meter'];
|
|
79
138
|
};
|
|
@@ -2,32 +2,67 @@ import { Types } from '@antv/g2';
|
|
|
2
2
|
import { Options, StyleAttr } from '../../types';
|
|
3
3
|
|
|
4
4
|
export interface HeatmapOptions extends Options {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title 热力图类型
|
|
7
|
+
* @description 'polygon' | 'density'
|
|
8
|
+
*/
|
|
6
9
|
readonly type?: 'polygon' | 'density';
|
|
7
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title x轴字段
|
|
12
|
+
*/
|
|
8
13
|
readonly xField: string;
|
|
9
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title y轴字段
|
|
16
|
+
*/
|
|
10
17
|
readonly yField: string;
|
|
11
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 颜色字段
|
|
20
|
+
*/
|
|
12
21
|
readonly colorField?: string;
|
|
13
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 热力格子中的形状
|
|
24
|
+
*/
|
|
14
25
|
readonly shape?: string;
|
|
15
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 热力格子中图形的尺寸比例
|
|
28
|
+
* @description 只有当 shape 和 sizeField 至少指定一项后才生效
|
|
29
|
+
*/
|
|
16
30
|
readonly sizeRatio?: number;
|
|
17
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 坐标轴映射
|
|
33
|
+
* @description 坐标轴映射 'x' | 'y'
|
|
34
|
+
*/
|
|
18
35
|
readonly reflect?: 'x' | 'y';
|
|
19
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 极坐标属性
|
|
38
|
+
*/
|
|
20
39
|
readonly coordinate?: Types.CoordinateOption;
|
|
21
40
|
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @title 图例相关
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @title 数据字段名
|
|
47
|
+
* @description 点大小映射对应的数据字段名
|
|
48
|
+
*/
|
|
24
49
|
readonly sizeField?: string;
|
|
25
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @title size 对应的图例
|
|
52
|
+
*/
|
|
26
53
|
readonly sizeLegend?: Options['legend'];
|
|
27
54
|
|
|
28
|
-
|
|
29
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @title 样式相关
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @title 热力图形样式
|
|
61
|
+
*/
|
|
30
62
|
readonly heatmapStyle?: StyleAttr;
|
|
31
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* @title 贴图图案
|
|
65
|
+
* @description 在 type="density" 时不支持
|
|
66
|
+
*/
|
|
32
67
|
readonly pattern?: Options['pattern'];
|
|
33
68
|
}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
|
|
3
3
|
export interface HistogramOptions extends Options {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 直方图绘制字段
|
|
6
|
+
* @description 设置直方图绘制 (进行分箱) 的字段
|
|
7
|
+
*/
|
|
5
8
|
readonly binField: string;
|
|
6
9
|
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* @title 设置直方图的分箱宽度
|
|
12
|
+
* @description binWidth 影响直方图分成多少箱,不能与binNumber一起使用
|
|
10
13
|
*/
|
|
11
14
|
readonly binWidth?: number;
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @title 设置直方图的分箱数量
|
|
17
|
+
* @description binNumber 影响直方图分箱后每个柱子的宽度
|
|
18
|
+
*/
|
|
14
19
|
readonly binNumber?: number;
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @title 指定层叠字段
|
|
22
|
+
* @description 通过该字段的值,柱子将会被分割为多个部分,通过颜色进行区分
|
|
23
|
+
*/
|
|
17
24
|
readonly stackField?: string;
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @title 柱子样式配置
|
|
27
|
+
*/
|
|
20
28
|
readonly columnStyle?: StyleAttr;
|
|
21
29
|
}
|
package/src/plots/line/types.ts
CHANGED
|
@@ -7,30 +7,58 @@ import {
|
|
|
7
7
|
import { Options, StyleAttr } from '../../types';
|
|
8
8
|
|
|
9
9
|
export interface LineOptions extends Options, Pick<GeometryOptions, 'customInfo'> {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 阶梯折线图类型
|
|
12
|
+
*/
|
|
11
13
|
readonly stepType?: string;
|
|
12
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title x轴字段
|
|
16
|
+
*/
|
|
13
17
|
readonly xField?: string;
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title y轴字段
|
|
20
|
+
*/
|
|
15
21
|
readonly yField?: string;
|
|
16
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 分组字段
|
|
24
|
+
*/
|
|
17
25
|
readonly seriesField?: string;
|
|
18
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 是否堆积
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
19
30
|
readonly isStack?: boolean;
|
|
20
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 是否平滑
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
21
35
|
readonly smooth?: boolean;
|
|
22
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 是否连接空数据
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
23
40
|
readonly connectNulls?: boolean;
|
|
24
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @title 折线图形样式
|
|
43
|
+
*/
|
|
25
44
|
readonly lineStyle?: StyleAttr;
|
|
26
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 折线 shape 配置
|
|
47
|
+
*/
|
|
27
48
|
readonly lineShape?: Required<LineGeometryOptions>['line']['shape'];
|
|
28
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @title 折线数据点
|
|
51
|
+
* @description 1、图形映射属性 2、状态样式
|
|
52
|
+
*/
|
|
29
53
|
readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
|
|
30
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* @title 折线趋势填充色
|
|
56
|
+
* @description 1、图形映射属性
|
|
57
|
+
*/
|
|
31
58
|
readonly area?: AreaGeometryOptions['area'] & Pick<PointGeometryOptions, 'state'>;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
59
|
+
/**
|
|
60
|
+
* @title 坐标轴反转配置
|
|
61
|
+
* @description 坐标轴反转配置 'x' | 'y' | ['x', 'y']
|
|
62
|
+
*/
|
|
35
63
|
readonly reflect?: 'x' | 'y' | ['x', 'y'];
|
|
36
64
|
}
|