@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
|
@@ -1,40 +1,75 @@
|
|
|
1
1
|
import { Options, State, StyleAttr } from '../../types';
|
|
2
2
|
|
|
3
3
|
export interface ViolinOptions extends Options {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title X 轴映射
|
|
6
|
+
*/
|
|
5
7
|
readonly xField: string;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title Y 轴映射
|
|
10
|
+
*/
|
|
7
11
|
readonly yField: string;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 拆分字段映射
|
|
14
|
+
* @default "分组情况,颜色作为视觉通道 "
|
|
15
|
+
*/
|
|
9
16
|
readonly seriesField?: string;
|
|
10
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 内部箱线图配置
|
|
19
|
+
* @description false 为不显示
|
|
20
|
+
*/
|
|
11
21
|
readonly box?:
|
|
12
22
|
| boolean
|
|
13
23
|
| {
|
|
14
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 箱线图
|
|
26
|
+
* @description 状态样式设置
|
|
27
|
+
*/
|
|
15
28
|
state: State;
|
|
16
29
|
};
|
|
17
30
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* hollow: 空心
|
|
22
|
-
* hollow-smooth: 平滑、空心
|
|
31
|
+
* @title 小提琴的形状
|
|
32
|
+
* @description smooth: 平滑,hollow: 空心,hollow-smooth: 平滑、空心.
|
|
33
|
+
* @default "非平滑、实心"
|
|
23
34
|
*/
|
|
24
35
|
readonly shape?: 'smooth' | 'hollow' | 'hollow-smooth';
|
|
25
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 小提琴样式配置
|
|
38
|
+
*/
|
|
26
39
|
readonly violinStyle?: StyleAttr;
|
|
27
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* @title 核函数配置
|
|
42
|
+
* @description 核函数配置,当前只支持三角核
|
|
43
|
+
*/
|
|
28
44
|
readonly kde?: {
|
|
29
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 三角波类型
|
|
47
|
+
* @description 三角波类型'triangular'
|
|
48
|
+
*/
|
|
30
49
|
type: 'triangular';
|
|
31
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @title 最小值
|
|
52
|
+
* @description 默认为数据中的最小值减去一个固定的阈值
|
|
53
|
+
* @default "数据中的最小值减去一个固定的阈值"
|
|
54
|
+
*/
|
|
32
55
|
min?: number;
|
|
33
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* @title 最大值
|
|
58
|
+
* @description 默认为数据中的最大值减去一个固定的阈值
|
|
59
|
+
* @default "数据中的最大值减去一个固定的阈值"
|
|
60
|
+
*/
|
|
34
61
|
max?: number;
|
|
35
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* @title 采样数量
|
|
64
|
+
* @description 越大轮廓线越接近真实概率分布函数
|
|
65
|
+
* @default "32"
|
|
66
|
+
*/
|
|
36
67
|
sampleSize?: number;
|
|
37
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* @title 核函数的带宽
|
|
70
|
+
* @description 带宽越大产生的曲线越平滑(越模糊),带宽越小产生的曲线越陡峭
|
|
71
|
+
* @default "3"
|
|
72
|
+
*/
|
|
38
73
|
width?: number;
|
|
39
74
|
} /* | { type: 'gaussian', } ⬅️ 像这样添加新的核函数支持 */;
|
|
40
75
|
}
|
|
@@ -2,33 +2,65 @@ import { Options, ShapeStyle, StyleAttr } from '../../types';
|
|
|
2
2
|
|
|
3
3
|
/** totalCfg of waterfall */
|
|
4
4
|
type TotalCfg = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title 总计的标签
|
|
7
|
+
*/
|
|
6
8
|
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @title 样式
|
|
11
|
+
*/
|
|
7
12
|
style?: ShapeStyle;
|
|
8
13
|
};
|
|
9
14
|
|
|
10
15
|
/** leaderLineCfg of waterfall */
|
|
11
16
|
type LeaderLineCfg = {
|
|
17
|
+
/**
|
|
18
|
+
* @title 样式
|
|
19
|
+
*/
|
|
12
20
|
style?: ShapeStyle;
|
|
13
21
|
};
|
|
14
22
|
|
|
15
23
|
export interface WaterfallOptions extends Options {
|
|
16
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title x 轴字段
|
|
26
|
+
*/
|
|
17
27
|
readonly xField: string;
|
|
18
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title y 轴字段
|
|
30
|
+
*/
|
|
19
31
|
readonly yField: string;
|
|
20
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* @title label 数据模式
|
|
34
|
+
* @description absolute' | 'difference'
|
|
35
|
+
* @default "difference"
|
|
36
|
+
*/
|
|
21
37
|
readonly labelMode?: 'absolute' | 'difference';
|
|
22
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @title 是否展示 总计
|
|
40
|
+
* @description false | TotalCfg
|
|
41
|
+
*/
|
|
23
42
|
readonly total?: false | TotalCfg;
|
|
24
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 是否展示 柱子间牵引线
|
|
45
|
+
* @description false | LeaderLineCfg
|
|
46
|
+
*/
|
|
25
47
|
readonly leaderLine?: false | LeaderLineCfg;
|
|
26
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @title 上涨色
|
|
50
|
+
*/
|
|
27
51
|
readonly risingFill?: string;
|
|
28
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* @title 下跌色
|
|
54
|
+
*/
|
|
29
55
|
readonly fallingFill?: string;
|
|
30
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* @title 柱子样式配置
|
|
58
|
+
* @description 注意: fill 不再生效,直接使用 risingFill, fallingFill 或 color
|
|
59
|
+
*/
|
|
31
60
|
readonly waterfallStyle?: StyleAttr;
|
|
32
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* @title 柱状图宽度占比
|
|
63
|
+
* @description 范围0-1
|
|
64
|
+
*/
|
|
33
65
|
readonly columnWidthRatio?: number;
|
|
34
66
|
}
|
|
@@ -4,99 +4,146 @@ type FontWeight = ShapeStyle['fontWeight'];
|
|
|
4
4
|
|
|
5
5
|
/** 一个文本信息,wordCloud 内部 */
|
|
6
6
|
export interface Word {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title 文本内容
|
|
9
|
+
*/
|
|
8
10
|
text: string;
|
|
9
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @title 该文本所占权重
|
|
13
|
+
*/
|
|
10
14
|
value: number;
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @title 用于指定颜色字段
|
|
17
|
+
*/
|
|
12
18
|
color: string | number;
|
|
13
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @title 原始数据
|
|
21
|
+
*/
|
|
14
22
|
datum: Datum;
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
export type Tag = Word & {
|
|
18
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 字体
|
|
28
|
+
*/
|
|
19
29
|
font?: string;
|
|
20
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title 字体样式
|
|
32
|
+
*/
|
|
21
33
|
style?: ShapeStyle['fontStyle'];
|
|
22
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title 文本粗细
|
|
36
|
+
*/
|
|
23
37
|
weight?: FontWeight;
|
|
24
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @title 旋转角度
|
|
40
|
+
*/
|
|
25
41
|
rotate?: number;
|
|
26
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* @title 字体大小
|
|
44
|
+
*/
|
|
27
45
|
size?: number;
|
|
28
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* @title 一个单词所占的盒子的内边距
|
|
48
|
+
* @description 值越大单词之间的间隔越大
|
|
49
|
+
*/
|
|
29
50
|
padding?: number;
|
|
30
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 是否包含文本
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
31
55
|
hasText?: boolean;
|
|
32
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* @title 单词所占盒子的宽度
|
|
58
|
+
*/
|
|
33
59
|
width?: number;
|
|
34
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* @title 单词所占盒子的高度
|
|
62
|
+
*/
|
|
35
63
|
height?: number;
|
|
36
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* @title x 轴坐标
|
|
66
|
+
*/
|
|
37
67
|
x?: number;
|
|
38
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* @title y 轴坐标
|
|
70
|
+
*/
|
|
39
71
|
y?: number;
|
|
40
72
|
};
|
|
41
73
|
|
|
42
74
|
/** 词云字体样式 */
|
|
43
75
|
export interface WordStyle {
|
|
44
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* @title 词云的字体
|
|
78
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
79
|
+
*/
|
|
45
80
|
readonly fontFamily?: string | ((word: Word, index?: number, words?: Word[]) => string);
|
|
46
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* @title 设置字体的粗细
|
|
83
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
84
|
+
*/
|
|
47
85
|
readonly fontWeight?: FontWeight | ((word: Word, index?: number, words?: Word[]) => FontWeight);
|
|
48
86
|
/**
|
|
49
|
-
*
|
|
50
|
-
* 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
87
|
+
* @title 每个单词所占的盒子的内边距
|
|
88
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值 越大单词之间的间隔越大
|
|
89
|
+
* @default 1
|
|
51
90
|
*/
|
|
52
91
|
readonly padding?: number | ((word: Word, index?: number, words?: Word[]) => number);
|
|
53
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* @title 字体的大小范围
|
|
94
|
+
* @description 当为函数时,其参数是一个经过处理之后的数据元素的值
|
|
95
|
+
*/
|
|
54
96
|
readonly fontSize?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);
|
|
55
97
|
/**
|
|
56
|
-
* 旋转的最小角度和最大角度
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* `rotationSteps` 选项将失效。
|
|
98
|
+
* @title 旋转的最小角度和最大角度
|
|
99
|
+
* @description 如果值是 number 或者 function ,则 `rotationSteps` 选项将失效
|
|
100
|
+
* @default "[0, 90]"
|
|
60
101
|
*/
|
|
61
102
|
readonly rotation?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);
|
|
62
103
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* 则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。
|
|
104
|
+
* @title 旋转实际的步数
|
|
105
|
+
* @description 越大可能旋转角度越小,* 例如:如果 `rotation` 的值是 [0, 90],`rotationSteps` 的值是 3,则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。
|
|
106
|
+
* @default 2
|
|
67
107
|
*/
|
|
68
108
|
readonly rotationSteps?: number;
|
|
69
109
|
}
|
|
70
110
|
|
|
71
111
|
export interface WordCloudOptions extends Options {
|
|
72
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* @title 词条内容字段
|
|
114
|
+
*/
|
|
73
115
|
readonly wordField: string;
|
|
74
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* @title 词条权重字段
|
|
118
|
+
*/
|
|
75
119
|
readonly weightField: string;
|
|
76
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* @title 根据该字段进行颜色映射
|
|
122
|
+
*/
|
|
77
123
|
readonly colorField?: string;
|
|
78
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* @title 遮罩图片实例
|
|
126
|
+
* @description 可以是图片 URL 或者 base64
|
|
127
|
+
*/
|
|
79
128
|
readonly imageMask?: HTMLImageElement | string;
|
|
80
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* @title 最大执行时间
|
|
131
|
+
*/
|
|
81
132
|
readonly timeInterval?: number;
|
|
82
133
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* 相同数据的词云图时,其对应的每个单词的布局坐标一致。
|
|
86
|
-
*
|
|
87
|
-
* 默认使用的是浏览器内置的 Math.random,也就是每次渲染,单词的位置都不一样。
|
|
134
|
+
* @title 自定义所使用的随机函数
|
|
135
|
+
* @description 其值可以是一个 [0, 1) 区间中的值;也可以是一个返回该值的函数,当该值是一个固定的值时,每次渲染;相同数据的词云图时,其对应的每个单词的布局坐标一致。
|
|
88
136
|
*/
|
|
89
137
|
readonly random?: number | (() => number);
|
|
90
138
|
/**
|
|
91
|
-
*
|
|
92
|
-
* 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。
|
|
93
|
-
*
|
|
139
|
+
* @title 词云图形状
|
|
140
|
+
* @description 1,当设置为 `archimedean` 时,整个词云图接近于`椭圆`的形状。 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。
|
|
141
|
+
* @default "archimedean"
|
|
94
142
|
*/
|
|
95
143
|
readonly spiral?: 'archimedean' | 'rectangular';
|
|
96
144
|
/**
|
|
97
|
-
* 自定义每个词语的坐标。
|
|
98
|
-
* 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle`
|
|
99
|
-
* 选项中设置。
|
|
145
|
+
* @title 自定义每个词语的坐标。
|
|
146
|
+
* @description 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle` 中的选项中设置。
|
|
100
147
|
*/
|
|
101
148
|
readonly placementStrategy?: (word: Word, index?: number, words?: Word[]) => Partial<Tag> & { x: number; y: number };
|
|
102
149
|
readonly wordStyle?: WordStyle;
|
package/src/types/button.ts
CHANGED
|
@@ -7,21 +7,25 @@ import { ShapeAttrs } from '@antv/g2';
|
|
|
7
7
|
*/
|
|
8
8
|
export type ButtonCfg = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* @title 间距
|
|
11
|
+
* @description 文本与按钮边缘的间距
|
|
11
12
|
*/
|
|
12
13
|
padding?: number | number[];
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* @title 文本
|
|
16
|
+
* @description 按钮文本
|
|
15
17
|
*/
|
|
16
18
|
text?: string;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* @title 文本样式
|
|
21
|
+
* @title 自定义文本样式
|
|
19
22
|
*/
|
|
20
23
|
textStyle?: {
|
|
21
24
|
default?: ShapeAttrs;
|
|
22
25
|
};
|
|
23
26
|
/**
|
|
24
|
-
*
|
|
27
|
+
* @title 按钮样式
|
|
28
|
+
* @description 自定义按钮样式
|
|
25
29
|
*/
|
|
26
30
|
buttonStyle?: {
|
|
27
31
|
default?: ShapeAttrs;
|
package/src/types/common.ts
CHANGED
|
@@ -34,9 +34,15 @@ export type Position = [number, number];
|
|
|
34
34
|
|
|
35
35
|
/** 一个区域描述 */
|
|
36
36
|
export type Region = {
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @title 开始位置
|
|
39
|
+
* @description the top-left corner of layer-range, range from 0 to 1, relative to parent layer's range
|
|
40
|
+
*/
|
|
38
41
|
readonly start: Point;
|
|
39
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* @title 结束位置
|
|
44
|
+
* @description the bottom-right corner of layer-range, range from 0 to 1, relative to parent layer's range
|
|
45
|
+
*/
|
|
40
46
|
readonly end: Point;
|
|
41
47
|
};
|
|
42
48
|
|
|
@@ -50,17 +56,29 @@ export type BBox = {
|
|
|
50
56
|
|
|
51
57
|
/** 文字 */
|
|
52
58
|
export type TextStyle = {
|
|
53
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* @title 文本大小
|
|
61
|
+
*/
|
|
54
62
|
readonly fontSize?: number;
|
|
55
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* @title 字体系列
|
|
65
|
+
*/
|
|
56
66
|
readonly fontFamily?: string;
|
|
57
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* @title 文本粗细
|
|
69
|
+
*/
|
|
58
70
|
readonly fontWeight?: number;
|
|
59
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* @title 文本行高
|
|
73
|
+
*/
|
|
60
74
|
readonly lineHeight?: number;
|
|
61
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* @title 文本对齐方式
|
|
77
|
+
*/
|
|
62
78
|
readonly textAlign?: 'center' | 'left' | 'right';
|
|
63
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* @title 文本基线
|
|
81
|
+
*/
|
|
64
82
|
readonly textBaseline?: 'middle' | 'top' | 'bottom';
|
|
65
83
|
};
|
|
66
84
|
|
|
@@ -71,67 +89,157 @@ export type Size = {
|
|
|
71
89
|
|
|
72
90
|
/** 基础的 Options 配置 */
|
|
73
91
|
export type Options = {
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @title 画布宽度
|
|
94
|
+
*/
|
|
76
95
|
readonly width?: number;
|
|
77
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* @title 画布高度
|
|
98
|
+
*/
|
|
78
99
|
readonly height?: number;
|
|
79
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* @title 自适应
|
|
102
|
+
* @description 画布是否自动适配容器大小,默认为 true
|
|
103
|
+
*/
|
|
80
104
|
readonly autoFit?: boolean;
|
|
81
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* @title 内填充
|
|
107
|
+
* @description 画布的 padding 值,或者开启 'auto'
|
|
108
|
+
*/
|
|
82
109
|
readonly padding?: number[] | number | 'auto';
|
|
83
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* @title 画布宽度
|
|
112
|
+
* @description 额外怎加的 padding 值
|
|
113
|
+
*/
|
|
84
114
|
readonly appendPadding?: number[] | number;
|
|
85
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* @title 额外填充
|
|
117
|
+
* @description 是否同步子 view 的 padding
|
|
118
|
+
*/
|
|
86
119
|
readonly syncViewPadding?: boolean | Types.SyncViewPaddingFn;
|
|
87
120
|
|
|
88
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* @title 国际化
|
|
123
|
+
* @description 语言配置
|
|
124
|
+
*/
|
|
89
125
|
readonly locale?: string;
|
|
90
126
|
|
|
91
|
-
|
|
92
|
-
|
|
127
|
+
/**
|
|
128
|
+
* @title 渲染引擎
|
|
129
|
+
* @description 设置渲染引擎,'svg' | 'canvas'
|
|
130
|
+
* @default "canvas"
|
|
131
|
+
*/
|
|
93
132
|
readonly renderer?: 'svg' | 'canvas';
|
|
94
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* @title 屏幕像素比
|
|
135
|
+
* @description 默认为 window.devicePixelRatio
|
|
136
|
+
*/
|
|
95
137
|
readonly pixelRatio?: number;
|
|
96
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* @title 是否启局部渲染
|
|
140
|
+
* @description 是否开启局部渲染,默认为 true
|
|
141
|
+
* @default true
|
|
142
|
+
*/
|
|
97
143
|
readonly localRefresh?: boolean;
|
|
98
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* @title 是否支持 CSS transform
|
|
146
|
+
* @description 开启后图表的交互以及事件将在页面设置了 css transform 属性时生效,默认关闭。
|
|
147
|
+
* @default false
|
|
148
|
+
*/
|
|
99
149
|
readonly supportCSSTransform?: boolean;
|
|
100
150
|
|
|
101
|
-
|
|
102
|
-
|
|
151
|
+
/**
|
|
152
|
+
* @title 数据
|
|
153
|
+
* @description 设置画布具体的数据
|
|
154
|
+
*/
|
|
103
155
|
readonly data: Record<string, any>[];
|
|
104
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* @title 数据字段元信息
|
|
158
|
+
* @description 设置数据字段元信息
|
|
159
|
+
*/
|
|
105
160
|
readonly meta?: Record<string, Meta>;
|
|
106
161
|
|
|
107
162
|
// G2 相关
|
|
108
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* @title 主题
|
|
165
|
+
* @description G2 主题,字符串或者 theme object
|
|
166
|
+
* @default "light"
|
|
167
|
+
*/
|
|
109
168
|
readonly theme?: string | object;
|
|
110
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* @title 颜色色板
|
|
171
|
+
* @description 设置颜色色板
|
|
172
|
+
*/
|
|
111
173
|
readonly color?: ColorAttr;
|
|
112
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* @title pattern 配置
|
|
176
|
+
* @description 设置图表 pattern
|
|
177
|
+
*/
|
|
113
178
|
readonly pattern?: PatternAttr;
|
|
114
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* @title 横坐标
|
|
181
|
+
* @description 设置画布横坐标的配置项
|
|
182
|
+
*/
|
|
115
183
|
readonly xAxis?: Axis;
|
|
116
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* @title 纵坐标
|
|
186
|
+
* @description 设置画布纵坐标的配置项
|
|
187
|
+
*/
|
|
117
188
|
readonly yAxis?: Axis;
|
|
118
|
-
/**
|
|
189
|
+
/**
|
|
190
|
+
* @title 数据标签
|
|
191
|
+
* @description 设置数据标签
|
|
192
|
+
*/
|
|
119
193
|
readonly label?: Label;
|
|
120
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* @title tooltip 提示
|
|
196
|
+
* @description 设置画布 tooltip 的配置项
|
|
197
|
+
*/
|
|
121
198
|
readonly tooltip?: Tooltip;
|
|
122
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* @title 图例
|
|
201
|
+
* @description 设置画布图例 legend 的配置项
|
|
202
|
+
*/
|
|
123
203
|
readonly legend?: Legend;
|
|
124
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* @title 缩略轴
|
|
206
|
+
* @description 设置缩略轴 slider 的配置项
|
|
207
|
+
*/
|
|
125
208
|
readonly slider?: Slider;
|
|
126
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* @title 滚动条
|
|
211
|
+
* @description 设置画布缩略轴 scrollbar 的配置项
|
|
212
|
+
*/
|
|
127
213
|
readonly scrollbar?: Scrollbar;
|
|
214
|
+
/**
|
|
215
|
+
* @title 动画
|
|
216
|
+
* @description 设置图表动画
|
|
217
|
+
*/
|
|
128
218
|
readonly animation?: Animation;
|
|
219
|
+
/**
|
|
220
|
+
* @title 交互
|
|
221
|
+
* @description 设置画布交互行为
|
|
222
|
+
*/
|
|
129
223
|
readonly interactions?: Interaction[];
|
|
224
|
+
/**
|
|
225
|
+
* @title 注解
|
|
226
|
+
* @description 设置画布注解
|
|
227
|
+
*/
|
|
130
228
|
readonly annotations?: Annotation[];
|
|
131
|
-
|
|
229
|
+
/**
|
|
230
|
+
* @title 图表状态
|
|
231
|
+
* @description 设置画布配置 active,inactive,selected 三种状态的样式,也可在 Theme 主题中配置
|
|
232
|
+
*/
|
|
132
233
|
readonly state?: State;
|
|
133
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* @title 是否裁剪
|
|
236
|
+
* @description 是否对超出坐标系范围的 Geometry 进行剪切
|
|
237
|
+
*/
|
|
134
238
|
readonly limitInPlot?: boolean;
|
|
135
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* @title 内置交互
|
|
241
|
+
* @description 内置注册的交互
|
|
242
|
+
* @deprecated false
|
|
243
|
+
*/
|
|
136
244
|
readonly defaultInteractions?: string[];
|
|
137
245
|
};
|
package/src/types/drill-down.ts
CHANGED
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import { ShapeAttrs } from '@antv/g2';
|
|
2
2
|
|
|
3
3
|
export type DrillDownCfg = {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 是否启用
|
|
6
|
+
* @description 是否启用 drillDown interaction
|
|
7
|
+
*/
|
|
5
8
|
enabled?: boolean;
|
|
6
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title 面包屑
|
|
11
|
+
* @description 设置面包屑相关配置
|
|
12
|
+
*/
|
|
7
13
|
breadCrumb?: {
|
|
8
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title 位置
|
|
16
|
+
* @description 设置面包屑显示位置
|
|
17
|
+
*/
|
|
9
18
|
position: 'top-left' | 'bottom-left';
|
|
10
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @title 根文本
|
|
21
|
+
* @description 设置面包屑根文本
|
|
22
|
+
*/
|
|
11
23
|
rootText?: string;
|
|
12
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 分割线文本
|
|
26
|
+
* @description 设置面包屑分割线文本
|
|
27
|
+
*/
|
|
13
28
|
dividerText?: string;
|
|
14
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @title 字体样式
|
|
31
|
+
* @description 设置面包屑字体样式
|
|
32
|
+
*/
|
|
15
33
|
textStyle?: ShapeAttrs;
|
|
16
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @title 激活的字体样式
|
|
36
|
+
* @description 设置面包屑字激活的字体样式
|
|
37
|
+
*/
|
|
17
38
|
activeTextStyle?: ShapeAttrs;
|
|
18
39
|
};
|
|
19
40
|
};
|