@antv/g2plot 2.4.7 → 2.4.10
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 +52 -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/dual-axes/util/render-sider.js +1 -1
- package/esm/plots/dual-axes/util/render-sider.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/geometries/compare.js +2 -1
- package/esm/plots/funnel/geometries/compare.js.map +1 -1
- package/esm/plots/funnel/geometries/facet.js +2 -1
- package/esm/plots/funnel/geometries/facet.js.map +1 -1
- package/esm/plots/funnel/types.d.ts +45 -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/adaptor.js +31 -2
- package/esm/plots/sankey/adaptor.js.map +1 -1
- package/esm/plots/sankey/types.d.ts +57 -30
- 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/esm/utils/transform/percent.js +2 -2
- package/esm/utils/transform/percent.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/dual-axes/util/render-sider.js +1 -1
- package/lib/plots/dual-axes/util/render-sider.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/geometries/compare.js +2 -1
- package/lib/plots/funnel/geometries/compare.js.map +1 -1
- package/lib/plots/funnel/geometries/facet.js +2 -1
- package/lib/plots/funnel/geometries/facet.js.map +1 -1
- package/lib/plots/funnel/types.d.ts +45 -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/adaptor.js +30 -1
- package/lib/plots/sankey/adaptor.js.map +1 -1
- package/lib/plots/sankey/types.d.ts +57 -30
- 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/lib/utils/transform/percent.js +2 -2
- package/lib/utils/transform/percent.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/dual-axes/util/render-sider.ts +1 -1
- package/src/plots/facet/types.ts +54 -49
- package/src/plots/funnel/geometries/compare.ts +2 -0
- package/src/plots/funnel/geometries/facet.ts +2 -1
- package/src/plots/funnel/types.ts +45 -14
- 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/adaptor.ts +35 -2
- package/src/plots/sankey/types.ts +58 -30
- 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/utils/transform/percent.ts +2 -2
|
@@ -2,96 +2,143 @@ import { Datum, Options, ShapeStyle } from '../../types';
|
|
|
2
2
|
declare type FontWeight = ShapeStyle['fontWeight'];
|
|
3
3
|
/** 一个文本信息,wordCloud 内部 */
|
|
4
4
|
export interface Word {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title 文本内容
|
|
7
|
+
*/
|
|
6
8
|
text: string;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title 该文本所占权重
|
|
11
|
+
*/
|
|
8
12
|
value: number;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 用于指定颜色字段
|
|
15
|
+
*/
|
|
10
16
|
color: string | number;
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 原始数据
|
|
19
|
+
*/
|
|
12
20
|
datum: Datum;
|
|
13
21
|
}
|
|
14
22
|
export declare type Tag = Word & {
|
|
15
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 字体
|
|
25
|
+
*/
|
|
16
26
|
font?: string;
|
|
17
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @title 字体样式
|
|
29
|
+
*/
|
|
18
30
|
style?: ShapeStyle['fontStyle'];
|
|
19
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 文本粗细
|
|
33
|
+
*/
|
|
20
34
|
weight?: FontWeight;
|
|
21
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 旋转角度
|
|
37
|
+
*/
|
|
22
38
|
rotate?: number;
|
|
23
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title 字体大小
|
|
41
|
+
*/
|
|
24
42
|
size?: number;
|
|
25
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 一个单词所占的盒子的内边距
|
|
45
|
+
* @description 值越大单词之间的间隔越大
|
|
46
|
+
*/
|
|
26
47
|
padding?: number;
|
|
27
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @title 是否包含文本
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
28
52
|
hasText?: boolean;
|
|
29
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 单词所占盒子的宽度
|
|
55
|
+
*/
|
|
30
56
|
width?: number;
|
|
31
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* @title 单词所占盒子的高度
|
|
59
|
+
*/
|
|
32
60
|
height?: number;
|
|
33
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* @title x 轴坐标
|
|
63
|
+
*/
|
|
34
64
|
x?: number;
|
|
35
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* @title y 轴坐标
|
|
67
|
+
*/
|
|
36
68
|
y?: number;
|
|
37
69
|
};
|
|
38
70
|
/** 词云字体样式 */
|
|
39
71
|
export interface WordStyle {
|
|
40
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* @title 词云的字体
|
|
74
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
75
|
+
*/
|
|
41
76
|
readonly fontFamily?: string | ((word: Word, index?: number, words?: Word[]) => string);
|
|
42
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* @title 设置字体的粗细
|
|
79
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
80
|
+
*/
|
|
43
81
|
readonly fontWeight?: FontWeight | ((word: Word, index?: number, words?: Word[]) => FontWeight);
|
|
44
82
|
/**
|
|
45
|
-
*
|
|
46
|
-
* 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
83
|
+
* @title 每个单词所占的盒子的内边距
|
|
84
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值 越大单词之间的间隔越大
|
|
85
|
+
* @default 1
|
|
47
86
|
*/
|
|
48
87
|
readonly padding?: number | ((word: Word, index?: number, words?: Word[]) => number);
|
|
49
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* @title 字体的大小范围
|
|
90
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
91
|
+
*/
|
|
50
92
|
readonly fontSize?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);
|
|
51
93
|
/**
|
|
52
|
-
* 旋转的最小角度和最大角度
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* `rotationSteps` 选项将失效。
|
|
94
|
+
* @title 旋转的最小角度和最大角度
|
|
95
|
+
* @description 如果值是 number 或者 function ,则 `rotationSteps` 选项将失效
|
|
96
|
+
* @default "[0, 90]"
|
|
56
97
|
*/
|
|
57
98
|
readonly rotation?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);
|
|
58
99
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* 则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。
|
|
100
|
+
* @title 旋转实际的步数
|
|
101
|
+
* @description 越大可能旋转角度越小,* 例如:如果 `rotation` 的值是 [0, 90],`rotationSteps` 的值是 3,则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。
|
|
102
|
+
* @default 2
|
|
63
103
|
*/
|
|
64
104
|
readonly rotationSteps?: number;
|
|
65
105
|
}
|
|
66
106
|
export interface WordCloudOptions extends Options {
|
|
67
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* @title 词条内容字段
|
|
109
|
+
*/
|
|
68
110
|
readonly wordField: string;
|
|
69
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* @title 词条权重字段
|
|
113
|
+
*/
|
|
70
114
|
readonly weightField: string;
|
|
71
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* @title 根据该字段进行颜色映射
|
|
117
|
+
*/
|
|
72
118
|
readonly colorField?: string;
|
|
73
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* @title 遮罩图片实例
|
|
121
|
+
* @description 可以是图片 URL 或者 base64
|
|
122
|
+
*/
|
|
74
123
|
readonly imageMask?: HTMLImageElement | string;
|
|
75
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* @title 最大执行时间
|
|
126
|
+
*/
|
|
76
127
|
readonly timeInterval?: number;
|
|
77
128
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* 相同数据的词云图时,其对应的每个单词的布局坐标一致。
|
|
81
|
-
*
|
|
82
|
-
* 默认使用的是浏览器内置的 Math.random,也就是每次渲染,单词的位置都不一样。
|
|
129
|
+
* @title 自定义所使用的随机函数
|
|
130
|
+
* @description 其值可以是一个 [0, 1) 区间中的值;也可以是一个返回该值的函数,当该值是一个固定的值时,每次渲染;相同数据的词云图时,其对应的每个单词的布局坐标一致。
|
|
83
131
|
*/
|
|
84
132
|
readonly random?: number | (() => number);
|
|
85
133
|
/**
|
|
86
|
-
*
|
|
87
|
-
* 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。
|
|
88
|
-
*
|
|
134
|
+
* @title 词云图形状
|
|
135
|
+
* @description 1,当设置为 `archimedean` 时,整个词云图接近于`椭圆`的形状。 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。
|
|
136
|
+
* @default "archimedean"
|
|
89
137
|
*/
|
|
90
138
|
readonly spiral?: 'archimedean' | 'rectangular';
|
|
91
139
|
/**
|
|
92
|
-
* 自定义每个词语的坐标。
|
|
93
|
-
* 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle`
|
|
94
|
-
* 选项中设置。
|
|
140
|
+
* @title 自定义每个词语的坐标。
|
|
141
|
+
* @description 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle` 中的选项中设置。
|
|
95
142
|
*/
|
|
96
143
|
readonly placementStrategy?: (word: Word, index?: number, words?: Word[]) => Partial<Tag> & {
|
|
97
144
|
x: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/word-cloud/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Datum, Options, ShapeStyle } from '../../types';\n\ntype FontWeight = ShapeStyle['fontWeight'];\n\n/** 一个文本信息,wordCloud 内部 */\nexport interface Word {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/word-cloud/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Datum, Options, ShapeStyle } from '../../types';\n\ntype FontWeight = ShapeStyle['fontWeight'];\n\n/** 一个文本信息,wordCloud 内部 */\nexport interface Word {\n /**\n * @title 文本内容\n */\n text: string;\n /**\n * @title 该文本所占权重\n */\n value: number;\n /**\n * @title 用于指定颜色字段\n */\n color: string | number;\n /**\n * @title 原始数据\n */\n datum: Datum;\n}\n\nexport type Tag = Word & {\n /**\n * @title 字体\n */\n font?: string;\n /**\n * @title 字体样式\n */\n style?: ShapeStyle['fontStyle'];\n /**\n * @title 文本粗细\n */\n weight?: FontWeight;\n /**\n * @title 旋转角度\n */\n rotate?: number;\n /**\n * @title 字体大小\n */\n size?: number;\n /**\n * @title 一个单词所占的盒子的内边距\n * @description 值越大单词之间的间隔越大\n */\n padding?: number;\n /**\n * @title 是否包含文本\n * @default false\n */\n hasText?: boolean;\n /**\n * @title 单词所占盒子的宽度\n */\n width?: number;\n /**\n * @title 单词所占盒子的高度\n */\n height?: number;\n /**\n * @title x 轴坐标\n */\n x?: number;\n /**\n * @title y 轴坐标\n */\n y?: number;\n};\n\n/** 词云字体样式 */\nexport interface WordStyle {\n /**\n * @title 词云的字体\n * @description 当为函数时,其参数是一个经过处理之后的数据元素的值\n */\n readonly fontFamily?: string | ((word: Word, index?: number, words?: Word[]) => string);\n /**\n * @title 设置字体的粗细\n * @description 当为函数时,其参数是一个经过处理之后的数据元素的值\n */\n readonly fontWeight?: FontWeight | ((word: Word, index?: number, words?: Word[]) => FontWeight);\n /**\n * @title 每个单词所占的盒子的内边距\n * @description 当为函数时,其参数是一个经过处理之后的数据元素的值 越大单词之间的间隔越大\n * @default 1\n */\n readonly padding?: number | ((word: Word, index?: number, words?: Word[]) => number);\n /**\n * @title 字体的大小范围\n * @description 当为函数时,其参数是一个经过处理之后的数据元素的值\n */\n readonly fontSize?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);\n /**\n * @title 旋转的最小角度和最大角度\n * @description 如果值是 number 或者 function ,则 `rotationSteps` 选项将失效\n * @default \"[0, 90]\"\n */\n readonly rotation?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);\n /**\n * @title 旋转实际的步数\n * @description 越大可能旋转角度越小,* 例如:如果 `rotation` 的值是 [0, 90],`rotationSteps` 的值是 3,则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。\n * @default 2\n */\n readonly rotationSteps?: number;\n}\n\nexport interface WordCloudOptions extends Options {\n /**\n * @title 词条内容字段\n */\n readonly wordField: string;\n /**\n * @title 词条权重字段\n */\n readonly weightField: string;\n /**\n * @title 根据该字段进行颜色映射\n */\n readonly colorField?: string;\n /**\n * @title 遮罩图片实例\n * @description 可以是图片 URL 或者 base64\n */\n readonly imageMask?: HTMLImageElement | string;\n /**\n * @title 最大执行时间\n */\n readonly timeInterval?: number;\n /**\n * @title 自定义所使用的随机函数\n * @description 其值可以是一个 [0, 1) 区间中的值;也可以是一个返回该值的函数,当该值是一个固定的值时,每次渲染;相同数据的词云图时,其对应的每个单词的布局坐标一致。\n */\n readonly random?: number | (() => number);\n /**\n * @title 词云图形状\n * @description 1,当设置为 `archimedean` 时,整个词云图接近于`椭圆`的形状。 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。\n * @default \"archimedean\"\n */\n readonly spiral?: 'archimedean' | 'rectangular';\n /**\n * @title 自定义每个词语的坐标。\n * @description 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle` 中的选项中设置。\n */\n readonly placementStrategy?: (word: Word, index?: number, words?: Word[]) => Partial<Tag> & { x: number; y: number };\n readonly wordStyle?: WordStyle;\n}\n"]}
|
package/lib/types/button.d.ts
CHANGED
|
@@ -6,21 +6,25 @@ import { ShapeAttrs } from '@antv/g2';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare type ButtonCfg = {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* @title 间距
|
|
10
|
+
* @description 文本与按钮边缘的间距
|
|
10
11
|
*/
|
|
11
12
|
padding?: number | number[];
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* @title 文本
|
|
15
|
+
* @description 按钮文本
|
|
14
16
|
*/
|
|
15
17
|
text?: string;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* @title 文本样式
|
|
20
|
+
* @title 自定义文本样式
|
|
18
21
|
*/
|
|
19
22
|
textStyle?: {
|
|
20
23
|
default?: ShapeAttrs;
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
26
|
+
* @title 按钮样式
|
|
27
|
+
* @description 自定义按钮样式
|
|
24
28
|
*/
|
|
25
29
|
buttonStyle?: {
|
|
26
30
|
default?: ShapeAttrs;
|
package/lib/types/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\n\n/**\n * @description 一些按钮的类型定义,比如 brush filter 中的 Button\n *\n * 和 GUI Button 尽量保持一致\n */\nexport type ButtonCfg = {\n /**\n * 文本与按钮边缘的间距\n */\n padding?: number | number[];\n /**\n * 按钮文本\n */\n text?: string;\n /**\n * 自定义文本样式\n */\n textStyle?: {\n default?: ShapeAttrs;\n };\n /**\n * 自定义按钮样式\n */\n buttonStyle?: {\n default?: ShapeAttrs;\n active?: ShapeAttrs;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\n\n/**\n * @description 一些按钮的类型定义,比如 brush filter 中的 Button\n *\n * 和 GUI Button 尽量保持一致\n */\nexport type ButtonCfg = {\n /**\n * @title 间距\n * @description 文本与按钮边缘的间距\n */\n padding?: number | number[];\n /**\n * @title 文本\n * @description 按钮文本\n */\n text?: string;\n /**\n * @title 文本样式\n * @title 自定义文本样式\n */\n textStyle?: {\n default?: ShapeAttrs;\n };\n /**\n * @title 按钮样式\n * @description 自定义按钮样式\n */\n buttonStyle?: {\n default?: ShapeAttrs;\n active?: ShapeAttrs;\n };\n};\n"]}
|
package/lib/types/common.d.ts
CHANGED
|
@@ -28,9 +28,15 @@ export declare type Point = {
|
|
|
28
28
|
export declare type Position = [number, number];
|
|
29
29
|
/** 一个区域描述 */
|
|
30
30
|
export declare type Region = {
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 开始位置
|
|
33
|
+
* @description the top-left corner of layer-range, range from 0 to 1, relative to parent layer's range
|
|
34
|
+
*/
|
|
32
35
|
readonly start: Point;
|
|
33
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 结束位置
|
|
38
|
+
* @description the bottom-right corner of layer-range, range from 0 to 1, relative to parent layer's range
|
|
39
|
+
*/
|
|
34
40
|
readonly end: Point;
|
|
35
41
|
};
|
|
36
42
|
/** 位置 */
|
|
@@ -42,17 +48,29 @@ export declare type BBox = {
|
|
|
42
48
|
};
|
|
43
49
|
/** 文字 */
|
|
44
50
|
export declare type TextStyle = {
|
|
45
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 文本大小
|
|
53
|
+
*/
|
|
46
54
|
readonly fontSize?: number;
|
|
47
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* @title 字体系列
|
|
57
|
+
*/
|
|
48
58
|
readonly fontFamily?: string;
|
|
49
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* @title 文本粗细
|
|
61
|
+
*/
|
|
50
62
|
readonly fontWeight?: number;
|
|
51
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* @title 文本行高
|
|
65
|
+
*/
|
|
52
66
|
readonly lineHeight?: number;
|
|
53
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* @title 文本对齐方式
|
|
69
|
+
*/
|
|
54
70
|
readonly textAlign?: 'center' | 'left' | 'right';
|
|
55
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* @title 文本基线
|
|
73
|
+
*/
|
|
56
74
|
readonly textBaseline?: 'middle' | 'top' | 'bottom';
|
|
57
75
|
};
|
|
58
76
|
export declare type Size = {
|
|
@@ -61,58 +79,152 @@ export declare type Size = {
|
|
|
61
79
|
};
|
|
62
80
|
/** 基础的 Options 配置 */
|
|
63
81
|
export declare type Options = {
|
|
64
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* @title 画布宽度
|
|
84
|
+
*/
|
|
65
85
|
readonly width?: number;
|
|
66
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* @title 画布高度
|
|
88
|
+
*/
|
|
67
89
|
readonly height?: number;
|
|
68
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* @title 自适应
|
|
92
|
+
* @description 画布是否自动适配容器大小,默认为 true
|
|
93
|
+
*/
|
|
69
94
|
readonly autoFit?: boolean;
|
|
70
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* @title 内填充
|
|
97
|
+
* @description 画布的 padding 值,或者开启 'auto'
|
|
98
|
+
*/
|
|
71
99
|
readonly padding?: number[] | number | 'auto';
|
|
72
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* @title 画布宽度
|
|
102
|
+
* @description 额外怎加的 padding 值
|
|
103
|
+
*/
|
|
73
104
|
readonly appendPadding?: number[] | number;
|
|
74
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* @title 额外填充
|
|
107
|
+
* @description 是否同步子 view 的 padding
|
|
108
|
+
*/
|
|
75
109
|
readonly syncViewPadding?: boolean | Types.SyncViewPaddingFn;
|
|
76
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* @title 国际化
|
|
112
|
+
* @description 语言配置
|
|
113
|
+
*/
|
|
77
114
|
readonly locale?: string;
|
|
78
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* @title 渲染引擎
|
|
117
|
+
* @description 设置渲染引擎,'svg' | 'canvas'
|
|
118
|
+
* @default "canvas"
|
|
119
|
+
*/
|
|
79
120
|
readonly renderer?: 'svg' | 'canvas';
|
|
80
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* @title 屏幕像素比
|
|
123
|
+
* @description 默认为 window.devicePixelRatio
|
|
124
|
+
*/
|
|
81
125
|
readonly pixelRatio?: number;
|
|
82
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* @title 是否启局部渲染
|
|
128
|
+
* @description 是否开启局部渲染,默认为 true
|
|
129
|
+
* @default true
|
|
130
|
+
*/
|
|
83
131
|
readonly localRefresh?: boolean;
|
|
84
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* @title 是否支持 CSS transform
|
|
134
|
+
* @description 开启后图表的交互以及事件将在页面设置了 css transform 属性时生效,默认关闭。
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
85
137
|
readonly supportCSSTransform?: boolean;
|
|
86
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* @title 数据
|
|
140
|
+
* @description 设置画布具体的数据
|
|
141
|
+
*/
|
|
87
142
|
readonly data: Record<string, any>[];
|
|
88
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* @title 数据字段元信息
|
|
145
|
+
* @description 设置数据字段元信息
|
|
146
|
+
*/
|
|
89
147
|
readonly meta?: Record<string, Meta>;
|
|
90
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* @title 主题
|
|
150
|
+
* @description G2 主题,字符串或者 theme object
|
|
151
|
+
* @default "light"
|
|
152
|
+
*/
|
|
91
153
|
readonly theme?: string | object;
|
|
92
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* @title 颜色色板
|
|
156
|
+
* @description 设置颜色色板
|
|
157
|
+
*/
|
|
93
158
|
readonly color?: ColorAttr;
|
|
94
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* @title pattern 配置
|
|
161
|
+
* @description 设置图表 pattern
|
|
162
|
+
*/
|
|
95
163
|
readonly pattern?: PatternAttr;
|
|
96
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* @title 横坐标
|
|
166
|
+
* @description 设置画布横坐标的配置项
|
|
167
|
+
*/
|
|
97
168
|
readonly xAxis?: Axis;
|
|
98
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* @title 纵坐标
|
|
171
|
+
* @description 设置画布纵坐标的配置项
|
|
172
|
+
*/
|
|
99
173
|
readonly yAxis?: Axis;
|
|
100
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* @title 数据标签
|
|
176
|
+
* @description 设置数据标签
|
|
177
|
+
*/
|
|
101
178
|
readonly label?: Label;
|
|
102
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* @title tooltip 提示
|
|
181
|
+
* @description 设置画布 tooltip 的配置项
|
|
182
|
+
*/
|
|
103
183
|
readonly tooltip?: Tooltip;
|
|
104
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* @title 图例
|
|
186
|
+
* @description 设置画布图例 legend 的配置项
|
|
187
|
+
*/
|
|
105
188
|
readonly legend?: Legend;
|
|
106
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* @title 缩略轴
|
|
191
|
+
* @description 设置缩略轴 slider 的配置项
|
|
192
|
+
*/
|
|
107
193
|
readonly slider?: Slider;
|
|
108
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* @title 滚动条
|
|
196
|
+
* @description 设置画布缩略轴 scrollbar 的配置项
|
|
197
|
+
*/
|
|
109
198
|
readonly scrollbar?: Scrollbar;
|
|
199
|
+
/**
|
|
200
|
+
* @title 动画
|
|
201
|
+
* @description 设置图表动画
|
|
202
|
+
*/
|
|
110
203
|
readonly animation?: Animation;
|
|
204
|
+
/**
|
|
205
|
+
* @title 交互
|
|
206
|
+
* @description 设置画布交互行为
|
|
207
|
+
*/
|
|
111
208
|
readonly interactions?: Interaction[];
|
|
209
|
+
/**
|
|
210
|
+
* @title 注解
|
|
211
|
+
* @description 设置画布注解
|
|
212
|
+
*/
|
|
112
213
|
readonly annotations?: Annotation[];
|
|
214
|
+
/**
|
|
215
|
+
* @title 图表状态
|
|
216
|
+
* @description 设置画布配置 active,inactive,selected 三种状态的样式,也可在 Theme 主题中配置
|
|
217
|
+
*/
|
|
113
218
|
readonly state?: State;
|
|
114
|
-
/**
|
|
219
|
+
/**
|
|
220
|
+
* @title 是否裁剪
|
|
221
|
+
* @description 是否对超出坐标系范围的 Geometry 进行剪切
|
|
222
|
+
*/
|
|
115
223
|
readonly limitInPlot?: boolean;
|
|
116
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* @title 内置交互
|
|
226
|
+
* @description 内置注册的交互
|
|
227
|
+
* @deprecated false
|
|
228
|
+
*/
|
|
117
229
|
readonly defaultInteractions?: string[];
|
|
118
230
|
};
|
package/lib/types/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Axis } from './axis';\nimport { Label } from './label';\nimport { Tooltip } from './tooltip';\nimport { Legend } from './legend';\nimport { Interaction } from './interaction';\nimport { Animation } from './animation';\nimport { Annotation } from './annotation';\nimport { State } from './state';\nimport { Slider } from './slider';\nimport { Scrollbar } from './scrollbar';\nimport { ColorAttr, PatternAttr } from './attr';\nimport { Meta } from './meta';\n\n/** annotation position */\nexport type AnnotationPosition = Types.AnnotationPosition;\nexport type RegionPositionBaseOption = Types.RegionPositionBaseOption;\nexport type TextOption = Types.TextOption;\n\n/** 一条数据记录 */\nexport type Datum = Record<string, any>;\n\n/** 一个数据序列 */\nexport type Data = Datum[];\n\n/** 点位置信息 */\nexport type Point = {\n readonly x: number;\n readonly y: number;\n};\n\n/** 描述一个点 x y 位置 */\nexport type Position = [number, number];\n\n/** 一个区域描述 */\nexport type Region = {\n
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Axis } from './axis';\nimport { Label } from './label';\nimport { Tooltip } from './tooltip';\nimport { Legend } from './legend';\nimport { Interaction } from './interaction';\nimport { Animation } from './animation';\nimport { Annotation } from './annotation';\nimport { State } from './state';\nimport { Slider } from './slider';\nimport { Scrollbar } from './scrollbar';\nimport { ColorAttr, PatternAttr } from './attr';\nimport { Meta } from './meta';\n\n/** annotation position */\nexport type AnnotationPosition = Types.AnnotationPosition;\nexport type RegionPositionBaseOption = Types.RegionPositionBaseOption;\nexport type TextOption = Types.TextOption;\n\n/** 一条数据记录 */\nexport type Datum = Record<string, any>;\n\n/** 一个数据序列 */\nexport type Data = Datum[];\n\n/** 点位置信息 */\nexport type Point = {\n readonly x: number;\n readonly y: number;\n};\n\n/** 描述一个点 x y 位置 */\nexport type Position = [number, number];\n\n/** 一个区域描述 */\nexport type Region = {\n /**\n * @title 开始位置\n * @description the top-left corner of layer-range, range from 0 to 1, relative to parent layer's range\n */\n readonly start: Point;\n /**\n * @title 结束位置\n * @description the bottom-right corner of layer-range, range from 0 to 1, relative to parent layer's range\n */\n readonly end: Point;\n};\n\n/** 位置 */\nexport type BBox = {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n};\n\n/** 文字 */\nexport type TextStyle = {\n /**\n * @title 文本大小\n */\n readonly fontSize?: number;\n /**\n * @title 字体系列\n */\n readonly fontFamily?: string;\n /**\n * @title 文本粗细\n */\n readonly fontWeight?: number;\n /**\n * @title 文本行高\n */\n readonly lineHeight?: number;\n /**\n * @title 文本对齐方式\n */\n readonly textAlign?: 'center' | 'left' | 'right';\n /**\n * @title 文本基线\n */\n readonly textBaseline?: 'middle' | 'top' | 'bottom';\n};\n\nexport type Size = {\n readonly width: number;\n readonly height: number;\n};\n\n/** 基础的 Options 配置 */\nexport type Options = {\n /**\n * @title 画布宽度\n */\n readonly width?: number;\n /**\n * @title 画布高度\n */\n readonly height?: number;\n /**\n * @title 自适应\n * @description 画布是否自动适配容器大小,默认为 true\n */\n readonly autoFit?: boolean;\n /**\n * @title 内填充\n * @description 画布的 padding 值,或者开启 'auto'\n */\n readonly padding?: number[] | number | 'auto';\n /**\n * @title 画布宽度\n * @description 额外怎加的 padding 值\n */\n readonly appendPadding?: number[] | number;\n /**\n * @title 额外填充\n * @description 是否同步子 view 的 padding\n */\n readonly syncViewPadding?: boolean | Types.SyncViewPaddingFn;\n\n /**\n * @title 国际化\n * @description 语言配置\n */\n readonly locale?: string;\n\n /**\n * @title 渲染引擎\n * @description 设置渲染引擎,'svg' | 'canvas'\n * @default \"canvas\"\n */\n readonly renderer?: 'svg' | 'canvas';\n /**\n * @title 屏幕像素比\n * @description 默认为 window.devicePixelRatio\n */\n readonly pixelRatio?: number;\n /**\n * @title 是否启局部渲染\n * @description 是否开启局部渲染,默认为 true\n * @default true\n */\n readonly localRefresh?: boolean;\n /**\n * @title 是否支持 CSS transform\n * @description 开启后图表的交互以及事件将在页面设置了 css transform 属性时生效,默认关闭。\n * @default false\n */\n readonly supportCSSTransform?: boolean;\n\n /**\n * @title 数据\n * @description 设置画布具体的数据\n */\n readonly data: Record<string, any>[];\n /**\n * @title 数据字段元信息\n * @description 设置数据字段元信息\n */\n readonly meta?: Record<string, Meta>;\n\n // G2 相关\n /**\n * @title 主题\n * @description G2 主题,字符串或者 theme object\n * @default \"light\"\n */\n readonly theme?: string | object;\n /**\n * @title 颜色色板\n * @description 设置颜色色板\n */\n readonly color?: ColorAttr;\n /**\n * @title pattern 配置\n * @description 设置图表 pattern\n */\n readonly pattern?: PatternAttr;\n /**\n * @title 横坐标\n * @description 设置画布横坐标的配置项\n */\n readonly xAxis?: Axis;\n /**\n * @title 纵坐标\n * @description 设置画布纵坐标的配置项\n */\n readonly yAxis?: Axis;\n /**\n * @title 数据标签\n * @description 设置数据标签\n */\n readonly label?: Label;\n /**\n * @title tooltip 提示\n * @description 设置画布 tooltip 的配置项\n */\n readonly tooltip?: Tooltip;\n /**\n * @title 图例\n * @description 设置画布图例 legend 的配置项\n */\n readonly legend?: Legend;\n /**\n * @title 缩略轴\n * @description 设置缩略轴 slider 的配置项\n */\n readonly slider?: Slider;\n /**\n * @title 滚动条\n * @description 设置画布缩略轴 scrollbar 的配置项\n */\n readonly scrollbar?: Scrollbar;\n /**\n * @title 动画\n * @description 设置图表动画\n */\n readonly animation?: Animation;\n /**\n * @title 交互\n * @description 设置画布交互行为\n */\n readonly interactions?: Interaction[];\n /**\n * @title 注解\n * @description 设置画布注解\n */\n readonly annotations?: Annotation[];\n /**\n * @title 图表状态\n * @description 设置画布配置 active,inactive,selected 三种状态的样式,也可在 Theme 主题中配置\n */\n readonly state?: State;\n /**\n * @title 是否裁剪\n * @description 是否对超出坐标系范围的 Geometry 进行剪切\n */\n readonly limitInPlot?: boolean;\n /**\n * @title 内置交互\n * @description 内置注册的交互\n * @deprecated false\n */\n readonly defaultInteractions?: string[];\n};\n"]}
|
|
@@ -1,18 +1,39 @@
|
|
|
1
1
|
import { ShapeAttrs } from '@antv/g2';
|
|
2
2
|
export declare type DrillDownCfg = {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @title 是否启用
|
|
5
|
+
* @description 是否启用 drillDown interaction
|
|
6
|
+
*/
|
|
4
7
|
enabled?: boolean;
|
|
5
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title 面包屑
|
|
10
|
+
* @description 设置面包屑相关配置
|
|
11
|
+
*/
|
|
6
12
|
breadCrumb?: {
|
|
7
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 位置
|
|
15
|
+
* @description 设置面包屑显示位置
|
|
16
|
+
*/
|
|
8
17
|
position: 'top-left' | 'bottom-left';
|
|
9
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 根文本
|
|
20
|
+
* @description 设置面包屑根文本
|
|
21
|
+
*/
|
|
10
22
|
rootText?: string;
|
|
11
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 分割线文本
|
|
25
|
+
* @description 设置面包屑分割线文本
|
|
26
|
+
*/
|
|
12
27
|
dividerText?: string;
|
|
13
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 字体样式
|
|
30
|
+
* @description 设置面包屑字体样式
|
|
31
|
+
*/
|
|
14
32
|
textStyle?: ShapeAttrs;
|
|
15
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title 激活的字体样式
|
|
35
|
+
* @description 设置面包屑字激活的字体样式
|
|
36
|
+
*/
|
|
16
37
|
activeTextStyle?: ShapeAttrs;
|
|
17
38
|
};
|
|
18
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../src/types/drill-down.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\n\nexport type DrillDownCfg = {\n
|
|
1
|
+
{"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../src/types/drill-down.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\n\nexport type DrillDownCfg = {\n /**\n * @title 是否启用\n * @description 是否启用 drillDown interaction\n */\n enabled?: boolean;\n /**\n * @title 面包屑\n * @description 设置面包屑相关配置\n */\n breadCrumb?: {\n /**\n * @title 位置\n * @description 设置面包屑显示位置\n */\n position: 'top-left' | 'bottom-left';\n /**\n * @title 根文本\n * @description 设置面包屑根文本\n */\n rootText?: string;\n /**\n * @title 分割线文本\n * @description 设置面包屑分割线文本\n */\n dividerText?: string;\n /**\n * @title 字体样式\n * @description 设置面包屑字体样式\n */\n textStyle?: ShapeAttrs;\n /**\n * @title 激活的字体样式\n * @description 设置面包屑字激活的字体样式\n */\n activeTextStyle?: ShapeAttrs;\n };\n};\n"]}
|
|
@@ -8,17 +8,37 @@ export declare type Interaction = {
|
|
|
8
8
|
};
|
|
9
9
|
/** brush 交互 */
|
|
10
10
|
export declare type BrushCfg = {
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @title 是否启用
|
|
13
|
+
* @description 是否启用 brush 交互
|
|
14
|
+
*/
|
|
12
15
|
readonly enabled?: boolean;
|
|
13
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title brush 类型
|
|
18
|
+
* @description '矩形', 'x 方向' 和 'y 方向', 'circle', 'path'(不规则矩形). 默认: 'rect'.
|
|
19
|
+
* @default "rect"
|
|
20
|
+
*/
|
|
14
21
|
readonly type?: 'rect' | 'x-rect' | 'y-rect' | 'circle' | 'path';
|
|
15
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title brush 操作
|
|
24
|
+
* @description '筛选过滤' 和 '高亮强调'. 默认: 'filter'. 目前只在 type 为 'rect' 的情况下生效
|
|
25
|
+
* @default "filter"
|
|
26
|
+
*/
|
|
16
27
|
readonly action?: 'filter' | 'highlight';
|
|
17
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title mask
|
|
30
|
+
* @description brush mask 的配置
|
|
31
|
+
*/
|
|
18
32
|
readonly mask?: {
|
|
19
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title mask 样式
|
|
35
|
+
* @description mask 蒙层样式
|
|
36
|
+
*/
|
|
20
37
|
style?: ShapeAttrs;
|
|
21
38
|
};
|
|
22
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title button 配置
|
|
41
|
+
* @description brush button 的配置, 只在 action: 'filter' 的情况下适用
|
|
42
|
+
*/
|
|
23
43
|
readonly button?: ButtonCfg;
|
|
24
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/types/interaction.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\nimport { ButtonCfg } from './button';\n\nexport type Interaction = {\n readonly type: string;\n readonly cfg?: Record<string, any>;\n /** 是否开启交互, 默认开启 */\n readonly enable?: boolean;\n};\n\n/** brush 交互 */\nexport type BrushCfg = {\n
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/types/interaction.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\nimport { ButtonCfg } from './button';\n\nexport type Interaction = {\n readonly type: string;\n readonly cfg?: Record<string, any>;\n /** 是否开启交互, 默认开启 */\n readonly enable?: boolean;\n};\n\n/** brush 交互 */\nexport type BrushCfg = {\n /**\n * @title 是否启用\n * @description 是否启用 brush 交互\n */\n readonly enabled?: boolean;\n /**\n * @title brush 类型\n * @description '矩形', 'x 方向' 和 'y 方向', 'circle', 'path'(不规则矩形). 默认: 'rect'.\n * @default \"rect\"\n */\n readonly type?: 'rect' | 'x-rect' | 'y-rect' | 'circle' | 'path';\n /**\n * @title brush 操作\n * @description '筛选过滤' 和 '高亮强调'. 默认: 'filter'. 目前只在 type 为 'rect' 的情况下生效\n * @default \"filter\"\n */\n readonly action?: 'filter' | 'highlight';\n /**\n * @title mask\n * @description brush mask 的配置\n */\n readonly mask?: {\n /**\n * @title mask 样式\n * @description mask 蒙层样式\n */\n style?: ShapeAttrs;\n };\n /**\n * @title button 配置\n * @description brush button 的配置, 只在 action: 'filter' 的情况下适用\n */\n readonly button?: ButtonCfg;\n};\n"]}
|
package/lib/types/label.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Types } from '@antv/g2';
|
|
2
2
|
export declare type Label = false | ({
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @title 映射的字段
|
|
5
|
+
*/
|
|
4
6
|
readonly fields?: string[];
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title 回调函数
|
|
9
|
+
* @description 回调函数,返回相关点 value
|
|
10
|
+
*/
|
|
6
11
|
readonly callback?: Types.LabelCallback;
|
|
7
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 格式化
|
|
14
|
+
* @description 功能同 content ,兼容 v1,一般用于自定义。
|
|
15
|
+
*/
|
|
8
16
|
readonly formatter?: Types.GeometryLabelCfg['content'];
|
|
9
17
|
} & Types.GeometryLabelCfg);
|