@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/types/interaction.ts
CHANGED
|
@@ -10,17 +10,37 @@ export type Interaction = {
|
|
|
10
10
|
|
|
11
11
|
/** brush 交互 */
|
|
12
12
|
export type BrushCfg = {
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 是否启用
|
|
15
|
+
* @description 是否启用 brush 交互
|
|
16
|
+
*/
|
|
14
17
|
readonly enabled?: boolean;
|
|
15
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title brush 类型
|
|
20
|
+
* @description '矩形', 'x 方向' 和 'y 方向', 'circle', 'path'(不规则矩形). 默认: 'rect'.
|
|
21
|
+
* @default "rect"
|
|
22
|
+
*/
|
|
16
23
|
readonly type?: 'rect' | 'x-rect' | 'y-rect' | 'circle' | 'path';
|
|
17
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title brush 操作
|
|
26
|
+
* @description '筛选过滤' 和 '高亮强调'. 默认: 'filter'. 目前只在 type 为 'rect' 的情况下生效
|
|
27
|
+
* @default "filter"
|
|
28
|
+
*/
|
|
18
29
|
readonly action?: 'filter' | 'highlight';
|
|
19
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title mask
|
|
32
|
+
* @description brush mask 的配置
|
|
33
|
+
*/
|
|
20
34
|
readonly mask?: {
|
|
21
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title mask 样式
|
|
37
|
+
* @description mask 蒙层样式
|
|
38
|
+
*/
|
|
22
39
|
style?: ShapeAttrs;
|
|
23
40
|
};
|
|
24
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @title button 配置
|
|
43
|
+
* @description brush button 的配置, 只在 action: 'filter' 的情况下适用
|
|
44
|
+
*/
|
|
25
45
|
readonly button?: ButtonCfg;
|
|
26
46
|
};
|
package/src/types/label.ts
CHANGED
|
@@ -3,10 +3,18 @@ import { Types } from '@antv/g2';
|
|
|
3
3
|
export type Label =
|
|
4
4
|
| false
|
|
5
5
|
| ({
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title 映射的字段
|
|
8
|
+
*/
|
|
7
9
|
readonly fields?: string[];
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 回调函数
|
|
12
|
+
* @description 回调函数,返回相关点 value
|
|
13
|
+
*/
|
|
9
14
|
readonly callback?: Types.LabelCallback;
|
|
10
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @title 格式化
|
|
17
|
+
* @description 功能同 content ,兼容 v1,一般用于自定义。
|
|
18
|
+
*/
|
|
11
19
|
readonly formatter?: Types.GeometryLabelCfg['content'];
|
|
12
20
|
} & Types.GeometryLabelCfg);
|
package/src/types/meta.ts
CHANGED
|
@@ -3,16 +3,13 @@ import { ScaleConfig } from '@antv/g2';
|
|
|
3
3
|
/** scale 元信息,取名为 meta */
|
|
4
4
|
export type Meta = ScaleConfig & {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* 对于连续的,一般是 linear,对于分类一般为 cat
|
|
8
|
-
* 当然也有 log, pow, time 等类型,或者通过 tickMethod 自定义自己的 scale
|
|
6
|
+
* @title mescale 的 type 类型ta
|
|
7
|
+
* @description 对于连续的,一般是 linear,对于分类一般为 cat。当然也有 log, pow, time 等类型,或者通过 tickMethod 自定义自己的 scale
|
|
9
8
|
*/
|
|
10
9
|
readonly type?: string;
|
|
11
10
|
/**
|
|
12
|
-
* 是否进行 scale
|
|
13
|
-
*
|
|
14
|
-
* - 设置为 true 则以 field 为 key 进行同步
|
|
15
|
-
* - 设置为 string,则以这个 string 为 key 进行同步
|
|
11
|
+
* @title 是否进行 scale 的同步
|
|
12
|
+
* @description 设置为 false 则不同步; 设置为 true 则以 field 为 key 进行同步;设置为 string,则以这个 string 为 key 进行同步
|
|
16
13
|
*/
|
|
17
14
|
readonly sync?: boolean | string;
|
|
18
15
|
};
|
package/src/types/pattern.ts
CHANGED
|
@@ -1,50 +1,90 @@
|
|
|
1
1
|
export type PatternCfg = {
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @title 背景色
|
|
4
|
+
* @description pattern background color. Default: inherit (默认: 继承图形元素颜色)
|
|
5
|
+
* @default "inherit"
|
|
6
|
+
*/
|
|
3
7
|
backgroundColor?: string;
|
|
4
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title 贴图图案填充色
|
|
10
|
+
*/
|
|
5
11
|
fill?: string;
|
|
6
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 填充透明度
|
|
14
|
+
*/
|
|
7
15
|
fillOpacity?: number;
|
|
8
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 描边色
|
|
18
|
+
* @description 贴图图案描边色
|
|
19
|
+
*/
|
|
9
20
|
stroke?: string;
|
|
10
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 描边透明度
|
|
23
|
+
*/
|
|
11
24
|
strokeOpacity?: number;
|
|
12
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 描边粗细
|
|
27
|
+
*/
|
|
13
28
|
lineWidth?: number;
|
|
14
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @title 透明度
|
|
31
|
+
* @description 整个pattern 透明度
|
|
32
|
+
*/
|
|
15
33
|
opacity?: number;
|
|
16
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title 旋转角度
|
|
36
|
+
* @description 整个pattern 的旋转角度
|
|
37
|
+
*/
|
|
17
38
|
rotation?: number;
|
|
18
39
|
};
|
|
19
40
|
|
|
20
41
|
/**
|
|
21
|
-
* dot pattern
|
|
42
|
+
* @title dot pattern
|
|
22
43
|
*/
|
|
23
44
|
export type DotPatternCfg = PatternCfg & {
|
|
24
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 点的大小
|
|
47
|
+
* @default 4
|
|
48
|
+
*/
|
|
25
49
|
size?: number;
|
|
26
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @title 点间距
|
|
52
|
+
* @default 4
|
|
53
|
+
*/
|
|
27
54
|
padding?: number;
|
|
28
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* @title 是否交错
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
29
59
|
isStagger?: boolean;
|
|
30
60
|
};
|
|
31
61
|
|
|
32
62
|
/**
|
|
33
|
-
* line pattern
|
|
63
|
+
* @title line pattern
|
|
34
64
|
*/
|
|
35
65
|
export type LinePatternCfg = PatternCfg & {
|
|
36
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* @title 线之间的距离
|
|
68
|
+
*/
|
|
37
69
|
spacing?: number;
|
|
38
70
|
};
|
|
39
71
|
|
|
40
72
|
/**
|
|
41
|
-
* square pattern
|
|
73
|
+
* @title square pattern
|
|
42
74
|
*/
|
|
43
75
|
export type SquarePatternCfg = PatternCfg & {
|
|
44
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* @title 矩形的大小
|
|
78
|
+
*/
|
|
45
79
|
size?: number;
|
|
46
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* @title 矩形之间的间隔
|
|
82
|
+
*/
|
|
47
83
|
padding?: number;
|
|
48
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* @title 是否交错
|
|
86
|
+
* @description 即 staggered squares.
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
49
89
|
isStagger?: boolean;
|
|
50
90
|
};
|
package/src/types/state.ts
CHANGED
|
@@ -3,11 +3,19 @@ import { Datum, Data } from './common';
|
|
|
3
3
|
|
|
4
4
|
export type State = Types.StateOption;
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title 状态名称
|
|
8
|
+
* @description G2 Element 开放 'active' | 'inactive' | 'selected' | 'default' 四种状态
|
|
9
|
+
*/
|
|
7
10
|
export type StateName = 'active' | 'inactive' | 'selected' | 'default';
|
|
8
11
|
|
|
9
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 状态条件
|
|
14
|
+
*/
|
|
10
15
|
export type StateCondition = (data: Datum | Data) => boolean;
|
|
11
16
|
|
|
12
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 状态对象
|
|
19
|
+
* @description 可通过 `plot.getStates()` 获取
|
|
20
|
+
*/
|
|
13
21
|
export type StateObject = { data: Datum | Data; state: string; geometry: Geometry; element: Element };
|
package/src/types/statistic.ts
CHANGED
|
@@ -2,26 +2,52 @@ import { View } from '@antv/g2';
|
|
|
2
2
|
import { Data, Datum } from './common';
|
|
3
3
|
|
|
4
4
|
type CSSStyle = Omit<Partial<CSSStyleDeclaration>, 'opacity' | 'fontWeight' | 'lineHeight'> & {
|
|
5
|
+
/**
|
|
6
|
+
* @title 透明度
|
|
7
|
+
*/
|
|
5
8
|
opacity?: number;
|
|
9
|
+
/**
|
|
10
|
+
* @title 字体粗细程度
|
|
11
|
+
*/
|
|
6
12
|
fontWeight?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* @title 行高
|
|
15
|
+
*/
|
|
7
16
|
lineHeight?: string | number;
|
|
8
17
|
};
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
|
-
* 统计文本
|
|
12
|
-
*
|
|
20
|
+
* @title 统计文本
|
|
21
|
+
* @description 支持三种设置模式(优先级):customHtml > formatter > content
|
|
13
22
|
*/
|
|
14
23
|
export type StatisticText = {
|
|
15
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 统计文本的样式
|
|
26
|
+
*/
|
|
16
27
|
readonly style?: CSSStyle | ((datum: Datum) => CSSStyle);
|
|
17
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 文本内容
|
|
30
|
+
*/
|
|
18
31
|
readonly content?: string;
|
|
19
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* @title 文本的格式化
|
|
34
|
+
*/
|
|
20
35
|
readonly formatter?: (datum?: Datum, data?: Data /** filterData */) => string;
|
|
21
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 自定义中心文本的 html
|
|
38
|
+
*/
|
|
22
39
|
readonly customHtml?: (container: HTMLElement, view: View, datum?: Datum, data?: Data /** filterData */) => string;
|
|
40
|
+
/**
|
|
41
|
+
* @title 旋转弧度
|
|
42
|
+
*/
|
|
23
43
|
readonly rotate?: number;
|
|
44
|
+
/**
|
|
45
|
+
* @title 横轴偏移值
|
|
46
|
+
*/
|
|
24
47
|
readonly offsetX?: number;
|
|
48
|
+
/**
|
|
49
|
+
* @title 纵轴偏移值
|
|
50
|
+
*/
|
|
25
51
|
readonly offsetY?: number;
|
|
26
52
|
};
|
|
27
53
|
|
|
@@ -29,6 +55,12 @@ export type StatisticText = {
|
|
|
29
55
|
* 中心文本的统计信息,统一一个数据结构
|
|
30
56
|
*/
|
|
31
57
|
export type Statistic = {
|
|
58
|
+
/**
|
|
59
|
+
* @title 标题
|
|
60
|
+
*/
|
|
32
61
|
readonly title?: false | StatisticText;
|
|
62
|
+
/**
|
|
63
|
+
* @title 内容
|
|
64
|
+
*/
|
|
33
65
|
readonly content?: false | StatisticText;
|
|
34
66
|
};
|
package/src/types/tooltip.ts
CHANGED
|
@@ -2,9 +2,14 @@ import { Types } from '@antv/g2';
|
|
|
2
2
|
import { TooltipAttr } from '../types/attr';
|
|
3
3
|
|
|
4
4
|
export type TooltipMapping = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title 映射字段
|
|
7
|
+
* @description 指定需要显示 tooltip 中的字段,默认是包含 x seriesFields y
|
|
8
|
+
*/
|
|
6
9
|
readonly fields?: string[] | false;
|
|
7
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title value 格式化
|
|
12
|
+
*/
|
|
8
13
|
readonly formatter?: TooltipAttr;
|
|
9
14
|
};
|
|
10
15
|
|