@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistic.js","sourceRoot":"","sources":["../../src/types/statistic.ts"],"names":[],"mappings":"","sourcesContent":["import { View } from '@antv/g2';\nimport { Data, Datum } from './common';\n\ntype CSSStyle = Omit<Partial<CSSStyleDeclaration>, 'opacity' | 'fontWeight' | 'lineHeight'> & {\n opacity?: number;\n fontWeight?: string | number;\n lineHeight?: string | number;\n};\n\n/**\n * 统计文本\n *
|
|
1
|
+
{"version":3,"file":"statistic.js","sourceRoot":"","sources":["../../src/types/statistic.ts"],"names":[],"mappings":"","sourcesContent":["import { View } from '@antv/g2';\nimport { Data, Datum } from './common';\n\ntype CSSStyle = Omit<Partial<CSSStyleDeclaration>, 'opacity' | 'fontWeight' | 'lineHeight'> & {\n /**\n * @title 透明度\n */\n opacity?: number;\n /**\n * @title 字体粗细程度\n */\n fontWeight?: string | number;\n /**\n * @title 行高\n */\n lineHeight?: string | number;\n};\n\n/**\n * @title 统计文本\n * @description 支持三种设置模式(优先级):customHtml > formatter > content\n */\nexport type StatisticText = {\n /**\n * @title 统计文本的样式\n */\n readonly style?: CSSStyle | ((datum: Datum) => CSSStyle);\n /**\n * @title 文本内容\n */\n readonly content?: string;\n /**\n * @title 文本的格式化\n */\n readonly formatter?: (datum?: Datum, data?: Data /** filterData */) => string;\n /**\n * @title 自定义中心文本的 html\n */\n readonly customHtml?: (container: HTMLElement, view: View, datum?: Datum, data?: Data /** filterData */) => string;\n /**\n * @title 旋转弧度\n */\n readonly rotate?: number;\n /**\n * @title 横轴偏移值\n */\n readonly offsetX?: number;\n /**\n * @title 纵轴偏移值\n */\n readonly offsetY?: number;\n};\n\n/**\n * 中心文本的统计信息,统一一个数据结构\n */\nexport type Statistic = {\n /**\n * @title 标题\n */\n readonly title?: false | StatisticText;\n /**\n * @title 内容\n */\n readonly content?: false | StatisticText;\n};\n"]}
|
package/lib/types/tooltip.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Types } from '@antv/g2';
|
|
2
2
|
import { TooltipAttr } from '../types/attr';
|
|
3
3
|
export declare type TooltipMapping = {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 映射字段
|
|
6
|
+
* @description 指定需要显示 tooltip 中的字段,默认是包含 x seriesFields y
|
|
7
|
+
*/
|
|
5
8
|
readonly fields?: string[] | false;
|
|
6
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title value 格式化
|
|
11
|
+
*/
|
|
7
12
|
readonly formatter?: TooltipAttr;
|
|
8
13
|
};
|
|
9
14
|
export declare type TooltipOptions = Types.TooltipCfg & TooltipMapping;
|
package/lib/types/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/types/tooltip.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { TooltipAttr } from '../types/attr';\n\nexport type TooltipMapping = {\n
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/types/tooltip.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { TooltipAttr } from '../types/attr';\n\nexport type TooltipMapping = {\n /**\n * @title 映射字段\n * @description 指定需要显示 tooltip 中的字段,默认是包含 x seriesFields y\n */\n readonly fields?: string[] | false;\n /**\n * @title value 格式化\n */\n readonly formatter?: TooltipAttr;\n};\n\nexport type TooltipOptions = Types.TooltipCfg & TooltipMapping;\n\nexport type Tooltip = false | TooltipOptions;\n"]}
|
package/package.json
CHANGED
package/src/core/plot.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chart, Event, Element } from '@antv/g2';
|
|
1
|
+
import { Chart, Event, Element, View } from '@antv/g2';
|
|
2
2
|
import { each } from '@antv/util';
|
|
3
3
|
import EE from '@antv/event-emitter';
|
|
4
4
|
import { bind } from 'size-sensor';
|
|
@@ -241,9 +241,10 @@ export abstract class Plot<O extends PickOptions> extends EE {
|
|
|
241
241
|
/**
|
|
242
242
|
* 增加图表标注。通过 id 标识,如果匹配到,就做更新
|
|
243
243
|
*/
|
|
244
|
-
public addAnnotations(annotations: Annotation[]): void {
|
|
244
|
+
public addAnnotations(annotations: Annotation[], view?: View): void {
|
|
245
|
+
view = view ? view : this.chart;
|
|
245
246
|
const incoming = [...annotations];
|
|
246
|
-
const controller =
|
|
247
|
+
const controller = view.getController('annotation');
|
|
247
248
|
const current = controller.getComponents().map((co) => co.extra);
|
|
248
249
|
|
|
249
250
|
controller.clear(true);
|
|
@@ -259,7 +260,7 @@ export abstract class Plot<O extends PickOptions> extends EE {
|
|
|
259
260
|
}
|
|
260
261
|
|
|
261
262
|
incoming.forEach((annotation) => controller.annotation(annotation));
|
|
262
|
-
|
|
263
|
+
view.render(true);
|
|
263
264
|
}
|
|
264
265
|
|
|
265
266
|
/**
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const version = '2.4.
|
|
1
|
+
export const version = '2.4.11';
|
|
2
2
|
|
|
3
3
|
// G2 自定义能力透出
|
|
4
4
|
import * as G2 from '@antv/g2';
|
|
@@ -115,7 +115,7 @@ export { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';
|
|
|
115
115
|
export type { FunnelOptions } from './plots/funnel';
|
|
116
116
|
|
|
117
117
|
// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)
|
|
118
|
-
export { Liquid } from './plots/liquid';
|
|
118
|
+
export { Liquid, addWaterWave } from './plots/liquid';
|
|
119
119
|
export type { LiquidOptions } from './plots/liquid';
|
|
120
120
|
|
|
121
121
|
// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
|
package/src/plots/area/types.ts
CHANGED
|
@@ -3,24 +3,49 @@ import { Options, StyleAttr } from '../../types';
|
|
|
3
3
|
|
|
4
4
|
/** 面积图的配置类型定义 */
|
|
5
5
|
export interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title x轴字段
|
|
8
|
+
*/
|
|
7
9
|
readonly xField?: string;
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title y轴字段
|
|
12
|
+
*/
|
|
9
13
|
readonly yField?: string;
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title 分组字段
|
|
16
|
+
*/
|
|
11
17
|
readonly seriesField?: string;
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 是否配置堆积
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
13
22
|
readonly isStack?: boolean;
|
|
14
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 是否配置百分比
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
15
27
|
readonly isPercent?: boolean;
|
|
16
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 是否配置平滑
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
17
32
|
readonly smooth?: boolean;
|
|
18
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* @title 面积图形样式
|
|
35
|
+
*/
|
|
19
36
|
readonly areaStyle?: StyleAttr;
|
|
20
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @title 面积中折线的样式
|
|
39
|
+
*/
|
|
21
40
|
readonly line?: LineGeometryOptions['line'] & Pick<PointGeometryOptions, 'state'>;
|
|
22
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @title 面积图数据点图形样式
|
|
43
|
+
*/
|
|
23
44
|
readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
|
|
24
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 面积图填充
|
|
47
|
+
* @description 面积图是否从 0 基准线开始填充
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
25
50
|
readonly startOnZero?: boolean;
|
|
26
51
|
}
|
package/src/plots/bar/types.ts
CHANGED
|
@@ -3,12 +3,25 @@ import { ColumnOptions } from '../column/types';
|
|
|
3
3
|
// rename column to bar
|
|
4
4
|
export interface BarOptions
|
|
5
5
|
extends Omit<ColumnOptions, 'columnStyle' | 'columnWidthRatio' | 'minColumnWidth' | 'maxColumnWidth'> {
|
|
6
|
+
/**
|
|
7
|
+
* @title 柱状图柱子样式配置
|
|
8
|
+
*/
|
|
6
9
|
readonly barStyle?: ColumnOptions['columnStyle'];
|
|
10
|
+
/**
|
|
11
|
+
* @title 柱状图宽度占比
|
|
12
|
+
* @description 范围[0-1]
|
|
13
|
+
*/
|
|
7
14
|
readonly barWidthRatio?: ColumnOptions['columnWidthRatio'];
|
|
8
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @title 条形图最小宽度(像素)
|
|
17
|
+
*/
|
|
9
18
|
readonly minBarWidth?: ColumnOptions['minColumnWidth'];
|
|
10
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @title 条形图最大宽度(像素)
|
|
21
|
+
*/
|
|
11
22
|
readonly maxBarWidth?: ColumnOptions['maxColumnWidth'];
|
|
12
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 条形图柱子的背景配置
|
|
25
|
+
*/
|
|
13
26
|
readonly barBackground?: ColumnOptions['columnBackground'];
|
|
14
27
|
}
|
|
@@ -2,20 +2,35 @@ import { Axis } from '../../types/axis';
|
|
|
2
2
|
import { Options, StyleAttr } from '../../types';
|
|
3
3
|
|
|
4
4
|
export interface BidirectionalBarOptions extends Omit<Options, 'yAxis' | 'yField'> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title x轴字段
|
|
7
|
+
*/
|
|
6
8
|
readonly xField: string;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title y轴字段
|
|
11
|
+
*/
|
|
8
12
|
readonly yField: [string, string];
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title yAxis
|
|
15
|
+
* @description yAxis 为多个 key 为 yField 里面的 2 个字段
|
|
16
|
+
*/
|
|
10
17
|
readonly yAxis?:
|
|
11
18
|
| false
|
|
12
19
|
| {
|
|
13
20
|
[key: string]: Axis;
|
|
14
21
|
};
|
|
15
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 柱状图宽度占比
|
|
24
|
+
* @description 范围[0-1]
|
|
25
|
+
*/
|
|
16
26
|
readonly widthRatio?: number;
|
|
17
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @title 柱状图柱子样式
|
|
29
|
+
*/
|
|
18
30
|
readonly barStyle?: StyleAttr;
|
|
19
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 布局方向选择
|
|
33
|
+
* @default "horizontal"
|
|
34
|
+
*/
|
|
20
35
|
readonly layout?: 'horizontal' | 'vertical';
|
|
21
36
|
}
|
package/src/plots/box/types.ts
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
|
|
3
3
|
export interface BoxOptions extends Options {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title x轴字段
|
|
6
|
+
*/
|
|
5
7
|
readonly xField: string;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title y轴映射
|
|
10
|
+
* @descriptionbox range [low, q1, median, q3, high] 五个字段 or 一个数组字段
|
|
11
|
+
*/
|
|
7
12
|
readonly yField: string | [string?, string?, string?, string?, string?];
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 箱型样式
|
|
15
|
+
*/
|
|
9
16
|
readonly boxStyle?: StyleAttr;
|
|
10
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 分组拆分字段
|
|
19
|
+
* @default 分组情况,颜色作为视觉通道
|
|
20
|
+
*/
|
|
11
21
|
readonly groupField?: string;
|
|
12
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 异常值字段
|
|
24
|
+
*/
|
|
13
25
|
readonly outliersField?: string;
|
|
14
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 异常值样式
|
|
28
|
+
*/
|
|
15
29
|
readonly outliersStyle?: StyleAttr;
|
|
16
30
|
}
|
|
@@ -9,30 +9,49 @@ type BulletAttr<T> = {
|
|
|
9
9
|
range?: T;
|
|
10
10
|
};
|
|
11
11
|
export interface BulletOptions extends Omit<Options, 'color' | 'label' | 'style'> {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 弹图标题
|
|
14
|
+
* @description 用于区分不同的类型
|
|
15
|
+
*/
|
|
13
16
|
readonly xField?: string;
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @title 测量字段
|
|
19
|
+
* @description 使用数据条的长度,表示实际数值字段,所表示值为 number[]
|
|
20
|
+
*/
|
|
16
21
|
readonly measureField: string;
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @title 范围字段
|
|
24
|
+
* @description 使用背景色条的长度,表示区间范围 [20,50,100], 所表示值为 number[]
|
|
25
|
+
*/
|
|
19
26
|
readonly rangeField: string;
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @title 目标字段
|
|
29
|
+
* @description 使用测量标记的刻度轴位置,表示目标值,所表示值为数值
|
|
30
|
+
*/
|
|
22
31
|
readonly targetField: string;
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @title 标签
|
|
34
|
+
* @description 包含了 measure,target,range
|
|
35
|
+
*/
|
|
25
36
|
readonly label?: BulletAttr<GeometryLabelAttr | false>;
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @title 尺寸
|
|
39
|
+
* @description 包含了 measure,target,range
|
|
40
|
+
*/
|
|
28
41
|
readonly size?: BulletAttr<SizeAttr>;
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
/**
|
|
43
|
+
* @title 颜色
|
|
44
|
+
* @description 包含了 measure,target,range
|
|
45
|
+
*/
|
|
31
46
|
readonly color?: BulletAttr<ColorAttr>;
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @title 项目符号样式
|
|
49
|
+
* @description 包含了 measure,target,range
|
|
50
|
+
*/
|
|
34
51
|
readonly bulletStyle?: BulletAttr<StyleAttr>;
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
/**
|
|
53
|
+
* @title 布局方向选择
|
|
54
|
+
* @default "horizontal"
|
|
55
|
+
*/
|
|
37
56
|
layout?: 'horizontal' | 'vertical';
|
|
38
57
|
}
|
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
|
};
|