@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
package/src/plots/chord/types.ts
CHANGED
|
@@ -3,44 +3,47 @@ import { Data, Datum, Options, StyleAttr } from '../../types';
|
|
|
3
3
|
/** 配置类型定义 */
|
|
4
4
|
export interface ChordOptions extends Omit<Options, 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
|
|
5
5
|
/**
|
|
6
|
-
* 来源字段
|
|
6
|
+
* @title 来源字段
|
|
7
7
|
*/
|
|
8
8
|
readonly sourceField: string;
|
|
9
9
|
/**
|
|
10
|
-
* 去向字段
|
|
10
|
+
* @title 去向字段
|
|
11
11
|
*/
|
|
12
12
|
readonly targetField: string;
|
|
13
13
|
/**
|
|
14
|
-
* 权重字段
|
|
14
|
+
* @title 权重字段
|
|
15
15
|
*/
|
|
16
16
|
readonly weightField: string;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* @title 源字段
|
|
19
19
|
*/
|
|
20
20
|
readonly rawFields?: string[];
|
|
21
|
-
|
|
22
21
|
/**
|
|
23
|
-
* 数据
|
|
22
|
+
* @title 数据
|
|
24
23
|
*/
|
|
25
24
|
readonly data: Data;
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
26
|
+
* @title 节点间距比例
|
|
27
|
+
* @description 参考画布的宽度,取值[0-1]
|
|
28
|
+
* @default 0.1
|
|
28
29
|
*/
|
|
29
30
|
readonly nodePaddingRatio?: number;
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* @title 节点的厚度
|
|
33
|
+
* @description 取值[0-1]
|
|
34
|
+
* @default 0.05
|
|
32
35
|
*/
|
|
33
36
|
readonly nodeWidthRatio?: number;
|
|
34
37
|
/**
|
|
35
|
-
*
|
|
38
|
+
* @title 节点排序方式
|
|
36
39
|
*/
|
|
37
40
|
readonly nodeSort?: (a: Datum, b: Datum) => number;
|
|
38
41
|
/**
|
|
39
|
-
* 节点样式
|
|
42
|
+
* @title 节点样式
|
|
40
43
|
*/
|
|
41
44
|
readonly nodeStyle?: StyleAttr;
|
|
42
45
|
/**
|
|
43
|
-
* 边样式
|
|
46
|
+
* @title 边样式
|
|
44
47
|
*/
|
|
45
48
|
readonly edgeStyle?: StyleAttr;
|
|
46
49
|
}
|
|
@@ -3,21 +3,29 @@ import { DrillDownCfg } from '../../types/drill-down';
|
|
|
3
3
|
import { HierarchyOption } from '../../utils/hierarchy/types';
|
|
4
4
|
|
|
5
5
|
export interface CirclePackingOptions extends Omit<Options, 'data'> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title 数据字段
|
|
8
|
+
*/
|
|
7
9
|
readonly data?: Record<string, any>;
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 层级布局配置
|
|
12
|
+
*/
|
|
9
13
|
readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @title 颜色字段
|
|
16
|
+
*/
|
|
12
17
|
readonly colorField?: string;
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @title 颜色
|
|
20
|
+
*/
|
|
15
21
|
readonly color?: ColorAttr;
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @title 大小字段
|
|
24
|
+
*/
|
|
18
25
|
readonly sizeField?: string;
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @title 源字段
|
|
28
|
+
*/
|
|
21
29
|
readonly rawFields?: string[];
|
|
22
30
|
|
|
23
31
|
// 暂不提供自定义 size,内部计算
|
|
@@ -26,10 +34,13 @@ export interface CirclePackingOptions extends Omit<Options, 'data'> {
|
|
|
26
34
|
// 暂不提供 shape 配置,默认:circle.
|
|
27
35
|
// readonly shape?: string;
|
|
28
36
|
|
|
29
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @title 图形样式
|
|
39
|
+
*/
|
|
30
40
|
readonly pointStyle?: StyleAttr;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @title 交互
|
|
43
|
+
* @description 下钻交互
|
|
44
|
+
*/
|
|
34
45
|
readonly drilldown?: DrillDownCfg;
|
|
35
46
|
}
|
|
@@ -11,40 +11,77 @@ export interface ColumnOptions
|
|
|
11
11
|
OptionWithConversionTag,
|
|
12
12
|
OptionWithConnectedArea,
|
|
13
13
|
PartialIntervalGeometryOptions {
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title x轴字段
|
|
16
|
+
*/
|
|
15
17
|
readonly xField: string;
|
|
16
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title y轴字段
|
|
20
|
+
*/
|
|
17
21
|
readonly yField: string;
|
|
18
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 拆分字段
|
|
24
|
+
*/
|
|
19
25
|
readonly seriesField?: string;
|
|
20
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 是否分组柱形图
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
21
30
|
readonly isGroup?: boolean;
|
|
22
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 是否是区间柱状图
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
23
35
|
readonly isRange?: boolean;
|
|
24
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 是否是百分比柱状图
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
25
40
|
readonly isPercent?: boolean;
|
|
26
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @title 是否堆积柱状图
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
27
45
|
readonly isStack?: boolean;
|
|
28
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* @title 柱状图宽度占比
|
|
48
|
+
* @description 范围[0-1]
|
|
49
|
+
*/
|
|
29
50
|
readonly columnWidthRatio?: number;
|
|
30
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 分组中柱子之间的间距
|
|
53
|
+
* @description 范围[0-1],仅对分组柱状图适用
|
|
54
|
+
*/
|
|
31
55
|
readonly marginRatio?: number;
|
|
32
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* @title 柱状图最小宽度(像素)
|
|
58
|
+
*/
|
|
33
59
|
readonly minColumnWidth?: number;
|
|
34
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* @title 柱状图最大宽度(像素)
|
|
62
|
+
*/
|
|
35
63
|
readonly maxColumnWidth?: number;
|
|
36
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* @title 柱状图柱子的背景
|
|
66
|
+
*/
|
|
37
67
|
readonly columnBackground?: { style?: ShapeAttrs };
|
|
38
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* @title 柱子样式
|
|
70
|
+
*/
|
|
39
71
|
readonly columnStyle?: StyleAttr;
|
|
40
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* @title 分组字段
|
|
74
|
+
* @description 优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组
|
|
75
|
+
*/
|
|
41
76
|
readonly groupField?: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
77
|
+
/**
|
|
78
|
+
* @title 自定义柱状图
|
|
79
|
+
* @description interval 图形元素展示形状
|
|
80
|
+
*/
|
|
45
81
|
readonly shape?: string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
82
|
+
/**
|
|
83
|
+
* @title 图表交互
|
|
84
|
+
* @description 开启下钻交互,以及进行下钻交互的配置
|
|
85
|
+
*/
|
|
49
86
|
readonly brush?: BrushCfg;
|
|
50
87
|
}
|
|
@@ -19,17 +19,31 @@ export interface PointConfig {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
type CommonGeometryOption = {
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @title 图形类型
|
|
24
|
+
*/
|
|
23
25
|
readonly geometry?: string;
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @title 数据标签的配置
|
|
28
|
+
*/
|
|
25
29
|
readonly label?: Options['label'];
|
|
26
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @title 图例legend的配置项
|
|
32
|
+
*/
|
|
27
33
|
readonly legend?: Options['legend'];
|
|
28
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @title 颜色色板
|
|
36
|
+
*/
|
|
29
37
|
readonly color?: Options['color'];
|
|
30
|
-
|
|
38
|
+
/**
|
|
39
|
+
* @title 是否分组
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
31
42
|
readonly isGroup?: boolean;
|
|
32
|
-
|
|
43
|
+
/**
|
|
44
|
+
* @title 分组字段
|
|
45
|
+
* @description 优先级高于 seriesField
|
|
46
|
+
*/
|
|
33
47
|
readonly groupField?: string;
|
|
34
48
|
};
|
|
35
49
|
|
|
@@ -59,31 +73,32 @@ export type GeometryOption = GeometryColumnOption | GeometryLineOption;
|
|
|
59
73
|
|
|
60
74
|
export type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {
|
|
61
75
|
/**
|
|
62
|
-
*
|
|
76
|
+
* @title 数据
|
|
77
|
+
* @description 具体的数据,左右两边的数据
|
|
63
78
|
*/
|
|
64
79
|
readonly data: Array<Record<string, any>[]>;
|
|
65
|
-
|
|
66
80
|
/**
|
|
67
|
-
* 双轴图的 x
|
|
81
|
+
* @title 双轴图的 x 字段
|
|
82
|
+
* @description x 字段名称需要保持一致
|
|
68
83
|
*/
|
|
69
84
|
readonly xField: string;
|
|
70
85
|
/**
|
|
71
|
-
* 双轴图左右 y
|
|
86
|
+
* @title 双轴图左右 y 字段
|
|
87
|
+
* @description 需要不一致
|
|
72
88
|
*/
|
|
73
89
|
readonly yField: string[];
|
|
74
|
-
|
|
75
90
|
/**
|
|
76
|
-
* 左右两边的 yAxis
|
|
91
|
+
* @title 左右两边的 yAxis 配置
|
|
92
|
+
* @description 使用 object 的方式,key 为 y 字段名,或者数组分别表示左右
|
|
77
93
|
*/
|
|
78
94
|
readonly yAxis?: Options['yAxis'][] | Record<string, Options['yAxis']>;
|
|
79
|
-
|
|
80
95
|
/**
|
|
81
|
-
* 左右两边的图形配置
|
|
96
|
+
* @title 左右两边的图形配置
|
|
82
97
|
*/
|
|
83
98
|
readonly geometryOptions?: GeometryOption[];
|
|
84
|
-
|
|
85
99
|
/**
|
|
86
|
-
* 左右两边的 annotation
|
|
100
|
+
* @title 左右两边的 annotation 配置
|
|
101
|
+
* @description 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况
|
|
87
102
|
*/
|
|
88
103
|
readonly annotations?: Options['annotations'][] | Record<string, Options['annotations']>;
|
|
89
104
|
};
|
package/src/plots/facet/types.ts
CHANGED
|
@@ -9,140 +9,145 @@ import { Interaction } from '../../types/interaction';
|
|
|
9
9
|
import { IPlotTypes } from '../mix/utils';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* geometry 映射信息
|
|
12
|
+
* @title geometry 映射信息
|
|
13
13
|
*/
|
|
14
14
|
export type IGeometry = Geometry & {
|
|
15
15
|
adjust?: Types.AdjustOption;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* 子 view
|
|
20
|
-
* 1. 暂时不开嵌套 view 的情况
|
|
21
|
-
* 2. 暂不开放 分面子 view 的 meta 独立设置
|
|
19
|
+
* @title 子 view 的配置
|
|
20
|
+
* @description 1. 暂时不开嵌套 view 的情况 2. 暂不开放 分面子 view 的 meta 独立设置
|
|
22
21
|
*/
|
|
23
22
|
export type IView = {
|
|
24
23
|
/**
|
|
25
|
-
* 图形
|
|
24
|
+
* @title 图形
|
|
25
|
+
* @description geometry 及映射配置
|
|
26
26
|
*/
|
|
27
27
|
readonly geometries: IGeometry[];
|
|
28
|
-
|
|
29
28
|
/**
|
|
30
|
-
*
|
|
29
|
+
* @title 数据
|
|
30
|
+
* @description optional,view 中的数据
|
|
31
31
|
*/
|
|
32
32
|
readonly data?: Data;
|
|
33
|
-
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
34
|
+
* @title meta
|
|
36
35
|
*/
|
|
37
36
|
readonly meta?: Record<string, Axis>;
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
38
|
+
* @title 坐标系的配置
|
|
39
|
+
* @description 每一个 view 具有相同的坐标系
|
|
41
40
|
*/
|
|
42
41
|
readonly coordinate?: Types.CoordinateOption;
|
|
43
|
-
|
|
44
42
|
/**
|
|
45
|
-
*
|
|
43
|
+
* @title 坐标轴配置
|
|
46
44
|
*/
|
|
47
45
|
readonly axes?: false | Record<string, Axis>;
|
|
48
|
-
|
|
49
46
|
/**
|
|
50
|
-
*
|
|
47
|
+
* @title interactions 配置
|
|
51
48
|
*/
|
|
52
49
|
readonly interactions?: Interaction[];
|
|
53
|
-
|
|
54
50
|
/**
|
|
55
|
-
*
|
|
51
|
+
* @title annotation 配置
|
|
56
52
|
*/
|
|
57
53
|
readonly annotations?: Annotation[];
|
|
58
|
-
|
|
59
54
|
/**
|
|
60
|
-
*
|
|
55
|
+
* @title animation 配置
|
|
61
56
|
*/
|
|
62
57
|
readonly animation?: Animation;
|
|
63
|
-
|
|
64
58
|
/**
|
|
65
|
-
*
|
|
59
|
+
* @title tooltip 配置
|
|
66
60
|
*/
|
|
67
61
|
readonly tooltip?: Tooltip;
|
|
68
62
|
};
|
|
69
63
|
|
|
70
64
|
/**
|
|
71
|
-
* 子 plot 的配置
|
|
65
|
+
* @title 子 plot 的配置
|
|
72
66
|
*/
|
|
73
67
|
export type IPlot = IPlotTypes;
|
|
74
68
|
/**
|
|
75
|
-
* facetData map
|
|
69
|
+
* @title facetData map
|
|
76
70
|
*/
|
|
77
71
|
type FacetDataMap = {
|
|
78
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* @title rect 类型分面配置
|
|
74
|
+
*/
|
|
79
75
|
readonly rect: Types.RectData;
|
|
80
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* @title mirror 类型分面配置
|
|
78
|
+
*/
|
|
81
79
|
readonly mirror: Types.MirrorData;
|
|
82
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* @title list 类型分面配置
|
|
82
|
+
*/
|
|
83
83
|
readonly list: Types.ListData;
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* @title matrix 类型分面配置
|
|
86
|
+
*/
|
|
85
87
|
readonly matrix: Types.MatrixData;
|
|
86
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* @title circle 类型分面配置
|
|
90
|
+
*/
|
|
87
91
|
readonly circle: Types.CircleData;
|
|
88
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* @title tree 类型分面配置
|
|
94
|
+
*/
|
|
89
95
|
readonly tree: Types.TreeData;
|
|
90
96
|
};
|
|
91
97
|
|
|
92
98
|
type FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;
|
|
93
99
|
|
|
94
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* @title 分面图的配置类型定义
|
|
102
|
+
*/
|
|
95
103
|
export interface FacetOptions<T extends keyof Types.FacetCfgMap = keyof Types.FacetCfgMap> extends Options, FacetCfg {
|
|
96
104
|
/**
|
|
97
|
-
*
|
|
105
|
+
* @title 分面类型
|
|
106
|
+
* @description G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix
|
|
98
107
|
*/
|
|
99
108
|
readonly type: T;
|
|
100
109
|
/**
|
|
101
|
-
*
|
|
110
|
+
* @title 数据划分维度
|
|
102
111
|
*/
|
|
103
112
|
readonly fields: string[];
|
|
104
113
|
/**
|
|
105
|
-
* 分面数据
|
|
114
|
+
* @title 分面数据
|
|
106
115
|
*/
|
|
107
116
|
readonly data: Data;
|
|
108
|
-
|
|
109
117
|
/**
|
|
110
|
-
*
|
|
111
|
-
* 回调的方式
|
|
118
|
+
* @title 绘图
|
|
119
|
+
* @description 每个分面 view 中的具体绘图表现 回调的方式
|
|
112
120
|
*/
|
|
113
121
|
readonly eachView: (innerView: View, facet?: FacetDataMap[T]) => IView | IPlot;
|
|
114
122
|
/**
|
|
115
|
-
* 是否展示分面标题
|
|
123
|
+
* @title 是否展示分面标题
|
|
124
|
+
* @default false
|
|
116
125
|
*/
|
|
117
126
|
readonly showTitle?: boolean;
|
|
118
|
-
|
|
119
127
|
/**
|
|
120
|
-
*
|
|
128
|
+
* @title meta 字段
|
|
129
|
+
* @description facet 中对应的 meta 字段配置
|
|
121
130
|
*/
|
|
122
131
|
readonly meta?: Record<string, Meta>;
|
|
123
|
-
|
|
124
132
|
/**
|
|
125
|
-
*
|
|
133
|
+
* @title 坐标系的配置
|
|
134
|
+
* @description 每一个 view 具有相同的坐标系
|
|
126
135
|
*/
|
|
127
136
|
readonly coordinate?: Types.CoordinateOption;
|
|
128
|
-
|
|
129
137
|
/**
|
|
130
|
-
*
|
|
138
|
+
* @title 轴配置
|
|
131
139
|
*/
|
|
132
140
|
readonly axes?: false | Record<string, Axis>;
|
|
133
|
-
|
|
134
141
|
/**
|
|
135
|
-
*
|
|
142
|
+
* @title tooltip 配置
|
|
136
143
|
*/
|
|
137
144
|
readonly tooltip?: Tooltip;
|
|
138
|
-
|
|
139
145
|
/**
|
|
140
|
-
*
|
|
146
|
+
* @title 图例配置
|
|
141
147
|
*/
|
|
142
148
|
readonly legend?: Legend;
|
|
143
|
-
|
|
144
149
|
/**
|
|
145
|
-
*
|
|
150
|
+
* @title 图例配置
|
|
146
151
|
*/
|
|
147
152
|
readonly interactions?: Interaction[];
|
|
148
153
|
}
|
|
@@ -46,6 +46,7 @@ function geometry(params: Params<FunnelOptions>): Params<FunnelOptions> {
|
|
|
46
46
|
label,
|
|
47
47
|
funnelStyle,
|
|
48
48
|
state,
|
|
49
|
+
showFacetTitle,
|
|
49
50
|
} = options;
|
|
50
51
|
|
|
51
52
|
chart.facet('mirror', {
|
|
@@ -53,6 +54,7 @@ function geometry(params: Params<FunnelOptions>): Params<FunnelOptions> {
|
|
|
53
54
|
// 漏斗图的转置规则与分面相反,默认是垂直布局
|
|
54
55
|
transpose: !isTransposed,
|
|
55
56
|
padding: isTransposed ? 0 : [32, 0, 0, 0],
|
|
57
|
+
showTitle: showFacetTitle,
|
|
56
58
|
eachView(view, facet) {
|
|
57
59
|
const index = isTransposed ? facet.rowIndex : facet.columnIndex;
|
|
58
60
|
|
|
@@ -26,11 +26,12 @@ function field(params: Params<FunnelOptions>): Params<FunnelOptions> {
|
|
|
26
26
|
*/
|
|
27
27
|
function geometry(params: Params<FunnelOptions>): Params<FunnelOptions> {
|
|
28
28
|
const { chart, options } = params;
|
|
29
|
-
const { seriesField, isTransposed } = options;
|
|
29
|
+
const { seriesField, isTransposed, showFacetTitle } = options;
|
|
30
30
|
|
|
31
31
|
chart.facet('rect', {
|
|
32
32
|
fields: [seriesField],
|
|
33
33
|
padding: [isTransposed ? 0 : 32, 10, 0, 10],
|
|
34
|
+
showTitle: showFacetTitle,
|
|
34
35
|
eachView(view, facet) {
|
|
35
36
|
basicFunnel(
|
|
36
37
|
deepAssign({}, params, {
|
|
@@ -7,31 +7,62 @@ export type ConversionPosition = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export interface FunnelOptions extends Options {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title x轴字段
|
|
12
|
+
*/
|
|
11
13
|
readonly xField?: string;
|
|
12
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title y轴字段
|
|
16
|
+
*/
|
|
13
17
|
readonly yField?: string;
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 分组字段
|
|
20
|
+
* @description 漏斗图将根据此字段转置为分面漏斗图
|
|
21
|
+
*/
|
|
15
22
|
readonly seriesField?: string;
|
|
16
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 对比字段
|
|
25
|
+
* @description 漏斗图将根据此字段转置为对比漏斗图
|
|
26
|
+
*/
|
|
17
27
|
readonly compareField?: string;
|
|
18
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 是否转置
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
19
32
|
readonly isTransposed?: boolean;
|
|
20
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title 是否是动态高度
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
21
37
|
readonly dynamicHeight?: boolean;
|
|
22
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* @title 最大宽度
|
|
40
|
+
* @description 范围0-1
|
|
41
|
+
*/
|
|
23
42
|
readonly maxSize?: number;
|
|
24
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 最小宽度
|
|
45
|
+
* @description 范围0-1
|
|
46
|
+
*/
|
|
25
47
|
readonly minSize?: number;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
/**
|
|
49
|
+
* @title shape 形状
|
|
50
|
+
* @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用
|
|
51
|
+
*/
|
|
29
52
|
readonly shape?: string;
|
|
30
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 漏斗图样式
|
|
55
|
+
*/
|
|
31
56
|
readonly funnelStyle?: StyleAttr;
|
|
32
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @title 漏斗分面标题
|
|
59
|
+
* @description 是否关闭漏斗的标题展示,适用于存在多组漏斗的情形,如:分组漏斗图、对比漏斗图。
|
|
60
|
+
*/
|
|
61
|
+
readonly showFacetTitle?: boolean;
|
|
33
62
|
// 组件
|
|
34
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* @title 转化率信息
|
|
65
|
+
*/
|
|
35
66
|
readonly conversionTag?:
|
|
36
67
|
| false
|
|
37
68
|
| {
|