@antv/g2plot 2.4.8 → 2.4.11
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 +32 -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/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/adaptor.js +31 -3
- package/esm/plots/gauge/adaptor.js.map +1 -1
- package/esm/plots/gauge/types.d.ts +84 -22
- 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/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/adaptor.js +30 -2
- package/lib/plots/gauge/adaptor.js.map +1 -1
- package/lib/plots/gauge/types.d.ts +84 -22
- 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/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/adaptor.ts +38 -2
- package/src/plots/gauge/types.ts +87 -28
- 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,10 +1,17 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
3
3
|
export interface TinyColumnOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 具体的数据
|
|
6
|
+
*/
|
|
5
7
|
readonly data: number[];
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title 柱状图宽度占比
|
|
10
|
+
* @description 范围[0-1]
|
|
11
|
+
*/
|
|
7
12
|
readonly columnWidthRatio?: number;
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 迷你柱形图形样式
|
|
15
|
+
*/
|
|
9
16
|
readonly columnStyle?: StyleAttr;
|
|
10
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/tiny-column/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface TinyColumnOptions extends Omit<Options, 'data' | 'legend' | 'label'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/tiny-column/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface TinyColumnOptions extends Omit<Options, 'data' | 'legend' | 'label'> {\n /**\n * @title 具体的数据\n */\n readonly data: number[];\n /**\n * @title 柱状图宽度占比\n * @description 范围[0-1]\n */\n readonly columnWidthRatio?: number;\n /**\n * @title 迷你柱形图形样式\n */\n readonly columnStyle?: StyleAttr;\n}\n"]}
|
|
@@ -3,14 +3,26 @@ import { MappingOptions } from '../../adaptor/geometries/base';
|
|
|
3
3
|
import { PointGeometryOptions } from '../../adaptor/geometries/point';
|
|
4
4
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
5
5
|
export interface TinyLineOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title 具体的数据
|
|
8
|
+
*/
|
|
7
9
|
readonly data: number[];
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 是否平滑
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
9
14
|
readonly smooth?: boolean;
|
|
10
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @title 是否连接空数据
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
11
19
|
readonly connectNulls?: boolean;
|
|
12
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @title 折线图形样式
|
|
22
|
+
*/
|
|
13
23
|
readonly lineStyle?: StyleAttr;
|
|
14
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 折线点图形样式
|
|
26
|
+
*/
|
|
15
27
|
readonly point?: MappingOptions & Pick<PointGeometryOptions, 'state'>;
|
|
16
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/tiny-line/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\nimport { MappingOptions } from '../../adaptor/geometries/base';\nimport { PointGeometryOptions } from '../../adaptor/geometries/point';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface TinyLineOptions extends Omit<Options, 'data' | 'legend' | 'label'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/tiny-line/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\nimport { MappingOptions } from '../../adaptor/geometries/base';\nimport { PointGeometryOptions } from '../../adaptor/geometries/point';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface TinyLineOptions extends Omit<Options, 'data' | 'legend' | 'label'> {\n /**\n * @title 具体的数据\n */\n readonly data: number[];\n /**\n * @title 是否平滑\n * @default false\n */\n readonly smooth?: boolean;\n /**\n * @title 是否连接空数据\n * @default false\n */\n readonly connectNulls?: boolean;\n /**\n * @title 折线图形样式\n */\n readonly lineStyle?: StyleAttr;\n /**\n * @title 折线点图形样式\n */\n readonly point?: MappingOptions & Pick<PointGeometryOptions, 'state'>;\n}\n"]}
|
|
@@ -2,18 +2,29 @@ import { Options, StyleAttr } from '../../types';
|
|
|
2
2
|
import { DrillDownCfg } from '../../types/drill-down';
|
|
3
3
|
import { HierarchyOption } from '../../utils/hierarchy/types';
|
|
4
4
|
export interface TreemapOptions extends Omit<Options, 'data'> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title 颜色字段
|
|
7
|
+
*/
|
|
6
8
|
readonly colorField?: string;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title 数据字段
|
|
11
|
+
*/
|
|
8
12
|
readonly data?: Record<string, any>;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 图形样式
|
|
15
|
+
*/
|
|
10
16
|
readonly rectStyle?: StyleAttr;
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 层级布局
|
|
19
|
+
*/
|
|
12
20
|
readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;
|
|
13
21
|
/**
|
|
14
|
-
*
|
|
22
|
+
* @title 附加的源字段
|
|
15
23
|
*/
|
|
16
24
|
readonly rawFields?: string[];
|
|
17
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 矩阵树图
|
|
27
|
+
* @description 内置一些交互 下钻交互相关配置
|
|
28
|
+
*/
|
|
18
29
|
readonly drilldown?: DrillDownCfg;
|
|
19
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/treemap/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { HierarchyOption } from '../../utils/hierarchy/types';\n\nexport interface TreemapOptions extends Omit<Options, 'data'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/treemap/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { HierarchyOption } from '../../utils/hierarchy/types';\n\nexport interface TreemapOptions extends Omit<Options, 'data'> {\n /**\n * @title 颜色字段\n */\n readonly colorField?: string;\n /**\n * @title 数据字段\n */\n readonly data?: Record<string, any>;\n /**\n * @title 图形样式\n */\n readonly rectStyle?: StyleAttr;\n /**\n * @title 层级布局\n */\n readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;\n /**\n * @title 附加的源字段\n */\n readonly rawFields?: string[];\n /**\n * @title 矩阵树图\n * @description 内置一些交互 下钻交互相关配置\n */\n readonly drilldown?: DrillDownCfg;\n}\n"]}
|
|
@@ -8,17 +8,31 @@ export declare type VennData = (Types.Datum & {
|
|
|
8
8
|
})[];
|
|
9
9
|
/** 配置类型定义 */
|
|
10
10
|
export interface VennOptions extends Options {
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @title 韦恩图数据
|
|
13
|
+
*/
|
|
12
14
|
readonly data: Types.Datum[];
|
|
13
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @title 集合字段
|
|
17
|
+
*/
|
|
14
18
|
readonly setsField: string;
|
|
15
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @title 大小字段
|
|
21
|
+
*/
|
|
16
22
|
readonly sizeField: string;
|
|
17
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 颜色
|
|
25
|
+
*/
|
|
18
26
|
readonly color?: string | string[] | ((datum: Datum, defaultColor?: string) => string);
|
|
19
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @title 并集合的颜色混合方式
|
|
29
|
+
* @description 可选项: 参考 https://gka.github.io/chroma.js/#chroma-blend
|
|
30
|
+
* @default "multiply"
|
|
31
|
+
*/
|
|
20
32
|
readonly blendMode?: string;
|
|
21
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title point 样式
|
|
35
|
+
*/
|
|
22
36
|
readonly pointStyle?: StyleAttr;
|
|
23
37
|
}
|
|
24
38
|
export declare type CustomInfo = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/venn/types.ts"],"names":[],"mappings":";;AAEA,uCAAkD","sourcesContent":["import { Types } from '@antv/g2';\nimport { Datum, Options, StyleAttr } from '../../types';\nimport { ID_FIELD, PATH_FIELD } from './constant';\n\nexport type VennData = (Types.Datum & { sets: string[]; [PATH_FIELD]: string; [ID_FIELD]: string })[];\n\n/** 配置类型定义 */\nexport interface VennOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/venn/types.ts"],"names":[],"mappings":";;AAEA,uCAAkD","sourcesContent":["import { Types } from '@antv/g2';\nimport { Datum, Options, StyleAttr } from '../../types';\nimport { ID_FIELD, PATH_FIELD } from './constant';\n\nexport type VennData = (Types.Datum & { sets: string[]; [PATH_FIELD]: string; [ID_FIELD]: string })[];\n\n/** 配置类型定义 */\nexport interface VennOptions extends Options {\n /**\n * @title 韦恩图数据\n */\n readonly data: Types.Datum[];\n /**\n * @title 集合字段\n */\n readonly setsField: string;\n /**\n * @title 大小字段\n */\n readonly sizeField: string;\n\n // 韦恩图 样式\n\n /**\n * @title 颜色\n */\n readonly color?: string | string[] | ((datum: Datum, defaultColor?: string) => string);\n /**\n * @title 并集合的颜色混合方式\n * @description 可选项: 参考 https://gka.github.io/chroma.js/#chroma-blend\n * @default \"multiply\"\n */\n readonly blendMode?: string;\n /**\n * @title point 样式\n */\n readonly pointStyle?: StyleAttr;\n}\n\nexport type CustomInfo = { offsetY: number; offsetX: number } & Pick<VennOptions, 'label'>;\n"]}
|
|
@@ -1,37 +1,72 @@
|
|
|
1
1
|
import { Options, State, StyleAttr } from '../../types';
|
|
2
2
|
export interface ViolinOptions extends Options {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @title X 轴映射
|
|
5
|
+
*/
|
|
4
6
|
readonly xField: string;
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title Y 轴映射
|
|
9
|
+
*/
|
|
6
10
|
readonly yField: string;
|
|
7
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* @title 拆分字段映射
|
|
13
|
+
* @default "分组情况,颜色作为视觉通道 "
|
|
14
|
+
*/
|
|
8
15
|
readonly seriesField?: string;
|
|
9
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 内部箱线图配置
|
|
18
|
+
* @description false 为不显示
|
|
19
|
+
*/
|
|
10
20
|
readonly box?: boolean | {
|
|
11
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 箱线图
|
|
23
|
+
* @description 状态样式设置
|
|
24
|
+
*/
|
|
12
25
|
state: State;
|
|
13
26
|
};
|
|
14
27
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* hollow: 空心
|
|
19
|
-
* hollow-smooth: 平滑、空心
|
|
28
|
+
* @title 小提琴的形状
|
|
29
|
+
* @description smooth: 平滑,hollow: 空心,hollow-smooth: 平滑、空心.
|
|
30
|
+
* @default "非平滑、实心"
|
|
20
31
|
*/
|
|
21
32
|
readonly shape?: 'smooth' | 'hollow' | 'hollow-smooth';
|
|
22
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title 小提琴样式配置
|
|
35
|
+
*/
|
|
23
36
|
readonly violinStyle?: StyleAttr;
|
|
24
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @title 核函数配置
|
|
39
|
+
* @description 核函数配置,当前只支持三角核
|
|
40
|
+
*/
|
|
25
41
|
readonly kde?: {
|
|
26
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* @title 三角波类型
|
|
44
|
+
* @description 三角波类型'triangular'
|
|
45
|
+
*/
|
|
27
46
|
type: 'triangular';
|
|
28
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* @title 最小值
|
|
49
|
+
* @description 默认为数据中的最小值减去一个固定的阈值
|
|
50
|
+
* @default "数据中的最小值减去一个固定的阈值"
|
|
51
|
+
*/
|
|
29
52
|
min?: number;
|
|
30
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 最大值
|
|
55
|
+
* @description 默认为数据中的最大值减去一个固定的阈值
|
|
56
|
+
* @default "数据中的最大值减去一个固定的阈值"
|
|
57
|
+
*/
|
|
31
58
|
max?: number;
|
|
32
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* @title 采样数量
|
|
61
|
+
* @description 越大轮廓线越接近真实概率分布函数
|
|
62
|
+
* @default "32"
|
|
63
|
+
*/
|
|
33
64
|
sampleSize?: number;
|
|
34
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* @title 核函数的带宽
|
|
67
|
+
* @description 带宽越大产生的曲线越平滑(越模糊),带宽越小产生的曲线越陡峭
|
|
68
|
+
* @default "3"
|
|
69
|
+
*/
|
|
35
70
|
width?: number;
|
|
36
71
|
};
|
|
37
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/violin/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, State, StyleAttr } from '../../types';\n\nexport interface ViolinOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/violin/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, State, StyleAttr } from '../../types';\n\nexport interface ViolinOptions extends Options {\n /**\n * @title X 轴映射\n */\n readonly xField: string;\n /**\n * @title Y 轴映射\n */\n readonly yField: string;\n /**\n * @title 拆分字段映射\n * @default \"分组情况,颜色作为视觉通道 \"\n */\n readonly seriesField?: string;\n /**\n * @title 内部箱线图配置\n * @description false 为不显示\n */\n readonly box?:\n | boolean\n | {\n /**\n * @title 箱线图\n * @description 状态样式设置\n */\n state: State;\n };\n /**\n * @title 小提琴的形状\n * @description smooth: 平滑,hollow: 空心,hollow-smooth: 平滑、空心.\n * @default \"非平滑、实心\"\n */\n readonly shape?: 'smooth' | 'hollow' | 'hollow-smooth';\n /**\n * @title 小提琴样式配置\n */\n readonly violinStyle?: StyleAttr;\n /**\n * @title 核函数配置\n * @description 核函数配置,当前只支持三角核\n */\n readonly kde?: {\n /**\n * @title 三角波类型\n * @description 三角波类型'triangular'\n */\n type: 'triangular';\n /**\n * @title 最小值\n * @description 默认为数据中的最小值减去一个固定的阈值\n * @default \"数据中的最小值减去一个固定的阈值\"\n */\n min?: number;\n /**\n * @title 最大值\n * @description 默认为数据中的最大值减去一个固定的阈值\n * @default \"数据中的最大值减去一个固定的阈值\"\n */\n max?: number;\n /**\n * @title 采样数量\n * @description 越大轮廓线越接近真实概率分布函数\n * @default \"32\"\n */\n sampleSize?: number;\n /**\n * @title 核函数的带宽\n * @description 带宽越大产生的曲线越平滑(越模糊),带宽越小产生的曲线越陡峭\n * @default \"3\"\n */\n width?: number;\n } /* | { type: 'gaussian', } ⬅️ 像这样添加新的核函数支持 */;\n}\n"]}
|
|
@@ -1,32 +1,64 @@
|
|
|
1
1
|
import { Options, ShapeStyle, StyleAttr } from '../../types';
|
|
2
2
|
/** totalCfg of waterfall */
|
|
3
3
|
declare type TotalCfg = {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 总计的标签
|
|
6
|
+
*/
|
|
5
7
|
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @title 样式
|
|
10
|
+
*/
|
|
6
11
|
style?: ShapeStyle;
|
|
7
12
|
};
|
|
8
13
|
/** leaderLineCfg of waterfall */
|
|
9
14
|
declare type LeaderLineCfg = {
|
|
15
|
+
/**
|
|
16
|
+
* @title 样式
|
|
17
|
+
*/
|
|
10
18
|
style?: ShapeStyle;
|
|
11
19
|
};
|
|
12
20
|
export interface WaterfallOptions extends Options {
|
|
13
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title x 轴字段
|
|
23
|
+
*/
|
|
14
24
|
readonly xField: string;
|
|
15
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title y 轴字段
|
|
27
|
+
*/
|
|
16
28
|
readonly yField: string;
|
|
17
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @title label 数据模式
|
|
31
|
+
* @description absolute' | 'difference'
|
|
32
|
+
* @default "difference"
|
|
33
|
+
*/
|
|
18
34
|
readonly labelMode?: 'absolute' | 'difference';
|
|
19
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 是否展示 总计
|
|
37
|
+
* @description false | TotalCfg
|
|
38
|
+
*/
|
|
20
39
|
readonly total?: false | TotalCfg;
|
|
21
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* @title 是否展示 柱子间牵引线
|
|
42
|
+
* @description false | LeaderLineCfg
|
|
43
|
+
*/
|
|
22
44
|
readonly leaderLine?: false | LeaderLineCfg;
|
|
23
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 上涨色
|
|
47
|
+
*/
|
|
24
48
|
readonly risingFill?: string;
|
|
25
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @title 下跌色
|
|
51
|
+
*/
|
|
26
52
|
readonly fallingFill?: string;
|
|
27
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 柱子样式配置
|
|
55
|
+
* @description 注意: fill 不再生效,直接使用 risingFill, fallingFill 或 color
|
|
56
|
+
*/
|
|
28
57
|
readonly waterfallStyle?: StyleAttr;
|
|
29
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* @title 柱状图宽度占比
|
|
60
|
+
* @description 范围0-1
|
|
61
|
+
*/
|
|
30
62
|
readonly columnWidthRatio?: number;
|
|
31
63
|
}
|
|
32
64
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/waterfall/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, ShapeStyle, StyleAttr } from '../../types';\n\n/** totalCfg of waterfall */\ntype TotalCfg = {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/waterfall/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, ShapeStyle, StyleAttr } from '../../types';\n\n/** totalCfg of waterfall */\ntype TotalCfg = {\n /**\n * @title 总计的标签\n */\n label?: string;\n /**\n * @title 样式\n */\n style?: ShapeStyle;\n};\n\n/** leaderLineCfg of waterfall */\ntype LeaderLineCfg = {\n /**\n * @title 样式\n */\n style?: ShapeStyle;\n};\n\nexport interface WaterfallOptions extends Options {\n /**\n * @title x 轴字段\n */\n readonly xField: string;\n /**\n * @title y 轴字段\n */\n readonly yField: string;\n /**\n * @title label 数据模式\n * @description absolute' | 'difference'\n * @default \"difference\"\n */\n readonly labelMode?: 'absolute' | 'difference';\n /**\n * @title 是否展示 总计\n * @description false | TotalCfg\n */\n readonly total?: false | TotalCfg;\n /**\n * @title 是否展示 柱子间牵引线\n * @description false | LeaderLineCfg\n */\n readonly leaderLine?: false | LeaderLineCfg;\n /**\n * @title 上涨色\n */\n readonly risingFill?: string;\n /**\n * @title 下跌色\n */\n readonly fallingFill?: string;\n /**\n * @title 柱子样式配置\n * @description 注意: fill 不再生效,直接使用 risingFill, fallingFill 或 color\n */\n readonly waterfallStyle?: StyleAttr;\n /**\n * @title 柱状图宽度占比\n * @description 范围0-1\n */\n readonly columnWidthRatio?: number;\n}\n"]}
|
|
@@ -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"]}
|