@antv/g2plot 2.4.5 → 2.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -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/constants.js +1 -0
- package/esm/plots/area/constants.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/constants.js +3 -0
- package/esm/plots/bar/constants.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/constants.js +3 -0
- package/esm/plots/column/constants.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/types.d.ts +40 -11
- package/esm/plots/funnel/types.js.map +1 -1
- package/esm/plots/gauge/adaptor.js +1 -0
- package/esm/plots/gauge/adaptor.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/adaptor.js +2 -2
- package/esm/plots/line/adaptor.js.map +1 -1
- package/esm/plots/line/constants.js +1 -0
- package/esm/plots/line/constants.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/adaptor.js +2 -1
- package/esm/plots/liquid/adaptor.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 +17 -10
- package/esm/plots/liquid/shapes/liquid.js.map +1 -1
- package/esm/plots/liquid/types.d.ts +57 -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/adaptor.js +2 -0
- package/esm/plots/pie/adaptor.js.map +1 -1
- package/esm/plots/pie/contants.js +1 -0
- package/esm/plots/pie/contants.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/adaptor.js +1 -0
- package/esm/plots/progress/adaptor.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/constant.js +1 -0
- package/esm/plots/rose/constant.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/adaptor.d.ts +1 -1
- package/esm/plots/scatter/adaptor.js +2 -2
- package/esm/plots/scatter/adaptor.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/constants.js +1 -0
- package/lib/plots/area/constants.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/constants.js +3 -0
- package/lib/plots/bar/constants.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/constants.js +3 -0
- package/lib/plots/column/constants.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/types.d.ts +40 -11
- package/lib/plots/funnel/types.js.map +1 -1
- package/lib/plots/gauge/adaptor.js +1 -0
- package/lib/plots/gauge/adaptor.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/adaptor.js +1 -1
- package/lib/plots/line/adaptor.js.map +1 -1
- package/lib/plots/line/constants.js +1 -0
- package/lib/plots/line/constants.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/adaptor.js +2 -1
- package/lib/plots/liquid/adaptor.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 +19 -10
- package/lib/plots/liquid/shapes/liquid.js.map +1 -1
- package/lib/plots/liquid/types.d.ts +57 -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/adaptor.js +2 -0
- package/lib/plots/pie/adaptor.js.map +1 -1
- package/lib/plots/pie/contants.js +1 -0
- package/lib/plots/pie/contants.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/adaptor.js +1 -0
- package/lib/plots/progress/adaptor.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/constant.js +1 -0
- package/lib/plots/rose/constant.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/adaptor.d.ts +1 -1
- package/lib/plots/scatter/adaptor.js +1 -1
- package/lib/plots/scatter/adaptor.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 +2 -2
- package/src/core/plot.ts +5 -4
- package/src/index.ts +2 -2
- package/src/plots/area/constants.ts +1 -0
- package/src/plots/area/types.ts +35 -10
- package/src/plots/bar/constants.ts +3 -0
- 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/constants.ts +3 -0
- 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/types.ts +40 -13
- package/src/plots/gauge/adaptor.ts +1 -0
- 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/adaptor.ts +12 -1
- package/src/plots/line/constants.ts +1 -0
- package/src/plots/line/types.ts +42 -14
- package/src/plots/liquid/adaptor.ts +2 -1
- package/src/plots/liquid/index.ts +2 -0
- package/src/plots/liquid/shapes/liquid.ts +22 -11
- package/src/plots/liquid/types.ts +57 -16
- package/src/plots/mix/types.ts +31 -35
- package/src/plots/pie/adaptor.ts +2 -0
- package/src/plots/pie/contants.ts +1 -0
- package/src/plots/pie/types.ts +27 -10
- package/src/plots/progress/adaptor.ts +1 -0
- 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/constant.ts +1 -0
- 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/adaptor.ts +3 -1
- 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/esm/core/plot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chart } from '@antv/g2';
|
|
1
|
+
import { Chart, View } from '@antv/g2';
|
|
2
2
|
import EE from '@antv/event-emitter';
|
|
3
3
|
import { Options, StateName, StateCondition, StateObject, Annotation } from '../types';
|
|
4
4
|
import { Adaptor } from './adaptor';
|
|
@@ -89,7 +89,7 @@ export declare abstract class Plot<O extends PickOptions> extends EE {
|
|
|
89
89
|
/**
|
|
90
90
|
* 增加图表标注。通过 id 标识,如果匹配到,就做更新
|
|
91
91
|
*/
|
|
92
|
-
addAnnotations(annotations: Annotation[]): void;
|
|
92
|
+
addAnnotations(annotations: Annotation[], view?: View): void;
|
|
93
93
|
/**
|
|
94
94
|
* 删除图表标注。通过 id 标识,如果匹配到,就做删除
|
|
95
95
|
*/
|
package/esm/core/plot.js
CHANGED
|
@@ -180,9 +180,10 @@ var Plot = /** @class */ (function (_super) {
|
|
|
180
180
|
/**
|
|
181
181
|
* 增加图表标注。通过 id 标识,如果匹配到,就做更新
|
|
182
182
|
*/
|
|
183
|
-
Plot.prototype.addAnnotations = function (annotations) {
|
|
183
|
+
Plot.prototype.addAnnotations = function (annotations, view) {
|
|
184
|
+
view = view ? view : this.chart;
|
|
184
185
|
var incoming = __spreadArrays(annotations);
|
|
185
|
-
var controller =
|
|
186
|
+
var controller = view.getController('annotation');
|
|
186
187
|
var current = controller.getComponents().map(function (co) { return co.extra; });
|
|
187
188
|
controller.clear(true);
|
|
188
189
|
var _loop_1 = function (i) {
|
|
@@ -198,7 +199,7 @@ var Plot = /** @class */ (function (_super) {
|
|
|
198
199
|
_loop_1(i);
|
|
199
200
|
}
|
|
200
201
|
incoming.forEach(function (annotation) { return controller.annotation(annotation); });
|
|
201
|
-
|
|
202
|
+
view.render(true);
|
|
202
203
|
};
|
|
203
204
|
/**
|
|
204
205
|
* 删除图表标注。通过 id 标识,如果匹配到,就做删除
|
package/esm/core/plot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/core/plot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,IAAI,EAAE,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WAAA,EAAE,MAAM,YAAqC,CAAC;gBAE3D,yBAAyB;gBACzB,IAAI,KAAK,KAAK,KAAI,CAAC,KAAK,CAAC,KAAK,IAAI,MAAM,KAAK,KAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBAC9D,KAAI,CAAC,aAAa,EAAE,CAAC;iBACtB;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED;;OAEG;IACK,+BAAgB,GAAxB;QACE,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;SACzB;IACH,CAAC;IACH,WAAC;AAAD,CAAC,AAxTD,CAA0D,EAAE,GAwT3D","sourcesContent":["import { Chart, Event, Element } from '@antv/g2';\nimport { each } from '@antv/util';\nimport EE from '@antv/event-emitter';\nimport { bind } from 'size-sensor';\nimport { Options, StateName, StateCondition, Size, StateObject, Annotation } from '../types';\nimport { getContainerSize, getAllElementsRecursively, deepAssign, pick } from '../utils';\nimport { Adaptor } from './adaptor';\n\n/** 单独 pick 出来的用于基类的类型定义 */\nexport type PickOptions = Pick<\n Options,\n | 'width'\n | 'height'\n | 'padding'\n | 'appendPadding'\n | 'renderer'\n | 'pixelRatio'\n | 'autoFit'\n | 'syncViewPadding'\n | 'supportCSSTransform'\n | 'limitInPlot'\n | 'locale'\n | 'defaultInteractions'\n>;\n\nconst SOURCE_ATTRIBUTE_NAME = 'data-chart-source-type';\n\n/** plot 图表容器的配置 */\nexport const PLOT_CONTAINER_OPTIONS = [\n 'padding',\n 'appendPadding',\n 'renderer',\n 'pixelRatio',\n 'syncViewPadding',\n 'supportCSSTransform',\n 'limitInPlot',\n];\n\n/**\n * 所有 plot 的基类\n */\nexport abstract class Plot<O extends PickOptions> extends EE {\n /**\n * 获取默认的 options 配置项\n * 每个组件都可以复写\n */\n static getDefaultOptions(): any {\n return {\n renderer: 'canvas',\n xAxis: {\n nice: true,\n label: {\n autoRotate: false,\n autoHide: { type: 'equidistance', cfg: { minGap: 6 } },\n },\n },\n yAxis: {\n nice: true,\n label: {\n autoHide: true,\n autoRotate: false,\n },\n },\n animation: true,\n };\n }\n\n /** plot 类型名称 */\n public abstract readonly type: string;\n /** plot 的 schema 配置 */\n public options: O;\n /** plot 绘制的 dom */\n public readonly container: HTMLElement;\n /** G2 chart 实例 */\n public chart: Chart;\n /** resizer unbind */\n private unbind: () => void;\n\n constructor(container: string | HTMLElement, options: O) {\n super();\n this.container = typeof container === 'string' ? document.getElementById(container) : container;\n\n this.options = deepAssign({}, this.getDefaultOptions(), options);\n\n this.createG2();\n\n this.bindEvents();\n }\n\n /**\n * 创建 G2 实例\n */\n private createG2() {\n const { width, height, defaultInteractions } = this.options;\n\n this.chart = new Chart({\n container: this.container,\n autoFit: false, // G2Plot 使用 size-sensor 进行 autoFit\n ...this.getChartSize(width, height),\n localRefresh: false, // 默认关闭,目前 G 还有一些位置问题,难以排查!\n ...pick(this.options, PLOT_CONTAINER_OPTIONS),\n defaultInteractions,\n });\n\n // 给容器增加标识,知道图表的来源区别于 G2\n this.container.setAttribute(SOURCE_ATTRIBUTE_NAME, 'G2Plot');\n }\n\n /**\n * 计算默认的 chart 大小。逻辑简化:如果存在 width 或 height,则直接使用,否则使用容器大小\n * @param width\n * @param height\n */\n private getChartSize(width: number, height: number): Size {\n const chartSize = getContainerSize(this.container);\n return { width: width || chartSize.width || 400, height: height || chartSize.height || 400 };\n }\n\n /**\n * 绑定代理所有 G2 的事件\n */\n private bindEvents() {\n if (this.chart) {\n this.chart.on('*', (e: Event) => {\n if (e?.type) {\n this.emit(e.type, e);\n }\n });\n }\n }\n\n /**\n * 获取默认的 options 配置项\n * 每个组件都可以复写\n */\n protected getDefaultOptions(): any {\n return Plot.getDefaultOptions();\n }\n\n /**\n * 每个组件有自己的 schema adaptor\n */\n protected abstract getSchemaAdaptor(): Adaptor<O>;\n\n /**\n * 绘制\n */\n public render() {\n // 暴力处理,先清空再渲染,需要 G2 层自行做好更新渲染\n this.chart.clear();\n // 因为子 view 会继承父 view 的 options 配置(包括 legend,所以会导致 legend 重复创建)\n // 所以这里给 chart 实例的 options 配置清空\n // 最好的解法是在 G2 view.clear 方法的时候,重置 options 配置。或者提供方法去 resetOptions\n // #1684 理论上在多 view 图形上,只要存在 custom legend,都存在类似问题(子弹图、双轴图)\n // @ts-ignore\n this.chart.options = {\n data: [],\n animate: true,\n };\n this.chart.views = []; // 删除已有的 views\n // 执行 adaptor\n this.execAdaptor();\n // 渲染\n this.chart.render();\n // 绑定\n this.bindSizeSensor();\n }\n\n /**\n * 更新: 更新配置且重新渲染\n * @param options\n */\n public update(options: Partial<O>) {\n this.updateOption(options);\n this.render();\n }\n\n /**\n * 更新配置\n * @param options\n */\n protected updateOption(options: Partial<O>) {\n this.options = deepAssign({}, this.options, options);\n }\n\n /**\n * 设置状态\n * @param type 状态类型,支持 'active' | 'inactive' | 'selected' 三种\n * @param conditions 条件,支持数组\n * @param status 是否激活,默认 true\n */\n public setState(type: StateName, condition: StateCondition, status: boolean = true) {\n const elements = getAllElementsRecursively(this.chart);\n\n each(elements, (ele: Element) => {\n if (condition(ele.getData())) {\n ele.setState(type, status);\n }\n });\n }\n\n /**\n * 获取状态\n */\n public getStates(): StateObject[] {\n const elements = getAllElementsRecursively(this.chart);\n\n const stateObjects: StateObject[] = [];\n each(elements, (element: Element) => {\n const data = element.getData();\n const states = element.getStates();\n each(states, (state) => {\n stateObjects.push({ data, state, geometry: element.geometry, element });\n });\n });\n\n return stateObjects;\n }\n\n /**\n * 更新数据\n * @override\n * @param options\n */\n public changeData(data: any) {\n // @ts-ignore\n this.update({ data });\n // TODO: 临时方案,最好使用下面的方式去更新数据\n // this.chart.changeData(data);\n }\n\n /**\n * 修改画布大小\n * @param width\n * @param height\n */\n public changeSize(width: number, height: number) {\n this.chart.changeSize(width, height);\n }\n\n /**\n * 增加图表标注。通过 id 标识,如果匹配到,就做更新\n */\n public addAnnotations(annotations: Annotation[]): void {\n const incoming = [...annotations];\n const controller = this.chart.getController('annotation');\n const current = controller.getComponents().map((co) => co.extra);\n\n controller.clear(true);\n for (let i = 0; i < current.length; i++) {\n let annotation = current[i];\n\n const findIndex = incoming.findIndex((item) => item.id && item.id === annotation.id);\n if (findIndex !== -1) {\n annotation = deepAssign({}, annotation, incoming[findIndex]);\n incoming.splice(findIndex, 1);\n }\n controller.annotation(annotation);\n }\n\n incoming.forEach((annotation) => controller.annotation(annotation));\n this.chart.render(true);\n }\n\n /**\n * 删除图表标注。通过 id 标识,如果匹配到,就做删除\n */\n public removeAnnotations(annotations: Array<{ id: string } & Partial<Annotation>>): void {\n const controller = this.chart.getController('annotation');\n const current = controller.getComponents().map((co) => co.extra);\n\n controller.clear(true);\n for (let i = 0; i < current.length; i++) {\n const annotation = current[i];\n\n if (!annotations.find((item) => item.id && item.id === annotation.id)) {\n controller.annotation(annotation);\n }\n }\n\n this.chart.render(true);\n }\n /**\n * 销毁\n */\n public destroy() {\n // 取消 size-sensor 的绑定\n this.unbindSizeSensor();\n // G2 的销毁\n this.chart.destroy();\n // 清空已经绑定的事件\n this.off();\n\n this.container.removeAttribute(SOURCE_ATTRIBUTE_NAME);\n }\n\n /**\n * 执行 adaptor 操作\n */\n protected execAdaptor() {\n const adaptor = this.getSchemaAdaptor();\n\n const { padding, appendPadding } = this.options;\n // 更新 padding\n this.chart.padding = padding;\n // 更新 appendPadding\n this.chart.appendPadding = appendPadding;\n\n // 转化成 G2 API\n adaptor({\n chart: this.chart,\n options: this.options,\n });\n }\n\n /**\n * 当图表容器大小变化的时候,执行的函数\n */\n protected triggerResize() {\n this.chart.forceFit();\n }\n\n /**\n * 绑定 dom 容器大小变化的事件\n */\n private bindSizeSensor() {\n if (this.unbind) {\n return;\n }\n\n const { autoFit = true } = this.options;\n if (autoFit) {\n this.unbind = bind(this.container, () => {\n // 获取最新的宽高信息\n const { width, height } = getContainerSize(this.container);\n\n // 主要是防止绑定的时候触发 resize 回调\n if (width !== this.chart.width || height !== this.chart.height) {\n this.triggerResize();\n }\n });\n }\n }\n\n /**\n * 取消绑定\n */\n private unbindSizeSensor() {\n if (this.unbind) {\n this.unbind();\n this.unbind = undefined;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/core/plot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAwB,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAoBzF,IAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAEvD,mBAAmB;AACnB,MAAM,CAAC,IAAM,sBAAsB,GAAG;IACpC,SAAS;IACT,eAAe;IACf,UAAU;IACV,YAAY;IACZ,iBAAiB;IACjB,qBAAqB;IACrB,aAAa;CACd,CAAC;AAEF;;GAEG;AACH;IAA0D,wBAAE;IAqC1D,cAAY,SAA+B,EAAE,OAAU;QAAvD,YACE,iBAAO,SAQR;QAPC,KAAI,CAAC,SAAS,GAAG,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEhG,KAAI,CAAC,OAAO,GAAG,UAAU,CAAC,EAAE,EAAE,KAAI,CAAC,iBAAiB,EAAE,EAAE,OAAO,CAAC,CAAC;QAEjE,KAAI,CAAC,QAAQ,EAAE,CAAC;QAEhB,KAAI,CAAC,UAAU,EAAE,CAAC;;IACpB,CAAC;IA7CD;;;OAGG;IACI,sBAAiB,GAAxB;QACE,OAAO;YACL,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE;oBACL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E,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACO,4BAAa,GAAvB;QACE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,6BAAc,GAAtB;QAAA,iBAiBC;QAhBC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,OAAO;SACR;QAEO,IAAA,KAAmB,IAAI,CAAC,OAAO,QAAjB,EAAd,OAAO,mBAAG,IAAI,KAAA,CAAkB;QACxC,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACjC,YAAY;gBACN,IAAA,KAAoB,gBAAgB,CAAC,KAAI,CAAC,SAAS,CAAC,EAAlD,KAAK,WAAA,EAAE,MAAM,YAAqC,CAAC;gBAE3D,yBAAyB;gBACzB,IAAI,KAAK,KAAK,KAAI,CAAC,KAAK,CAAC,KAAK,IAAI,MAAM,KAAK,KAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBAC9D,KAAI,CAAC,aAAa,EAAE,CAAC;iBACtB;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED;;OAEG;IACK,+BAAgB,GAAxB;QACE,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;SACzB;IACH,CAAC;IACH,WAAC;AAAD,CAAC,AAzTD,CAA0D,EAAE,GAyT3D","sourcesContent":["import { Chart, Event, Element, View } from '@antv/g2';\nimport { each } from '@antv/util';\nimport EE from '@antv/event-emitter';\nimport { bind } from 'size-sensor';\nimport { Options, StateName, StateCondition, Size, StateObject, Annotation } from '../types';\nimport { getContainerSize, getAllElementsRecursively, deepAssign, pick } from '../utils';\nimport { Adaptor } from './adaptor';\n\n/** 单独 pick 出来的用于基类的类型定义 */\nexport type PickOptions = Pick<\n Options,\n | 'width'\n | 'height'\n | 'padding'\n | 'appendPadding'\n | 'renderer'\n | 'pixelRatio'\n | 'autoFit'\n | 'syncViewPadding'\n | 'supportCSSTransform'\n | 'limitInPlot'\n | 'locale'\n | 'defaultInteractions'\n>;\n\nconst SOURCE_ATTRIBUTE_NAME = 'data-chart-source-type';\n\n/** plot 图表容器的配置 */\nexport const PLOT_CONTAINER_OPTIONS = [\n 'padding',\n 'appendPadding',\n 'renderer',\n 'pixelRatio',\n 'syncViewPadding',\n 'supportCSSTransform',\n 'limitInPlot',\n];\n\n/**\n * 所有 plot 的基类\n */\nexport abstract class Plot<O extends PickOptions> extends EE {\n /**\n * 获取默认的 options 配置项\n * 每个组件都可以复写\n */\n static getDefaultOptions(): any {\n return {\n renderer: 'canvas',\n xAxis: {\n nice: true,\n label: {\n autoRotate: false,\n autoHide: { type: 'equidistance', cfg: { minGap: 6 } },\n },\n },\n yAxis: {\n nice: true,\n label: {\n autoHide: true,\n autoRotate: false,\n },\n },\n animation: true,\n };\n }\n\n /** plot 类型名称 */\n public abstract readonly type: string;\n /** plot 的 schema 配置 */\n public options: O;\n /** plot 绘制的 dom */\n public readonly container: HTMLElement;\n /** G2 chart 实例 */\n public chart: Chart;\n /** resizer unbind */\n private unbind: () => void;\n\n constructor(container: string | HTMLElement, options: O) {\n super();\n this.container = typeof container === 'string' ? document.getElementById(container) : container;\n\n this.options = deepAssign({}, this.getDefaultOptions(), options);\n\n this.createG2();\n\n this.bindEvents();\n }\n\n /**\n * 创建 G2 实例\n */\n private createG2() {\n const { width, height, defaultInteractions } = this.options;\n\n this.chart = new Chart({\n container: this.container,\n autoFit: false, // G2Plot 使用 size-sensor 进行 autoFit\n ...this.getChartSize(width, height),\n localRefresh: false, // 默认关闭,目前 G 还有一些位置问题,难以排查!\n ...pick(this.options, PLOT_CONTAINER_OPTIONS),\n defaultInteractions,\n });\n\n // 给容器增加标识,知道图表的来源区别于 G2\n this.container.setAttribute(SOURCE_ATTRIBUTE_NAME, 'G2Plot');\n }\n\n /**\n * 计算默认的 chart 大小。逻辑简化:如果存在 width 或 height,则直接使用,否则使用容器大小\n * @param width\n * @param height\n */\n private getChartSize(width: number, height: number): Size {\n const chartSize = getContainerSize(this.container);\n return { width: width || chartSize.width || 400, height: height || chartSize.height || 400 };\n }\n\n /**\n * 绑定代理所有 G2 的事件\n */\n private bindEvents() {\n if (this.chart) {\n this.chart.on('*', (e: Event) => {\n if (e?.type) {\n this.emit(e.type, e);\n }\n });\n }\n }\n\n /**\n * 获取默认的 options 配置项\n * 每个组件都可以复写\n */\n protected getDefaultOptions(): any {\n return Plot.getDefaultOptions();\n }\n\n /**\n * 每个组件有自己的 schema adaptor\n */\n protected abstract getSchemaAdaptor(): Adaptor<O>;\n\n /**\n * 绘制\n */\n public render() {\n // 暴力处理,先清空再渲染,需要 G2 层自行做好更新渲染\n this.chart.clear();\n // 因为子 view 会继承父 view 的 options 配置(包括 legend,所以会导致 legend 重复创建)\n // 所以这里给 chart 实例的 options 配置清空\n // 最好的解法是在 G2 view.clear 方法的时候,重置 options 配置。或者提供方法去 resetOptions\n // #1684 理论上在多 view 图形上,只要存在 custom legend,都存在类似问题(子弹图、双轴图)\n // @ts-ignore\n this.chart.options = {\n data: [],\n animate: true,\n };\n this.chart.views = []; // 删除已有的 views\n // 执行 adaptor\n this.execAdaptor();\n // 渲染\n this.chart.render();\n // 绑定\n this.bindSizeSensor();\n }\n\n /**\n * 更新: 更新配置且重新渲染\n * @param options\n */\n public update(options: Partial<O>) {\n this.updateOption(options);\n this.render();\n }\n\n /**\n * 更新配置\n * @param options\n */\n protected updateOption(options: Partial<O>) {\n this.options = deepAssign({}, this.options, options);\n }\n\n /**\n * 设置状态\n * @param type 状态类型,支持 'active' | 'inactive' | 'selected' 三种\n * @param conditions 条件,支持数组\n * @param status 是否激活,默认 true\n */\n public setState(type: StateName, condition: StateCondition, status: boolean = true) {\n const elements = getAllElementsRecursively(this.chart);\n\n each(elements, (ele: Element) => {\n if (condition(ele.getData())) {\n ele.setState(type, status);\n }\n });\n }\n\n /**\n * 获取状态\n */\n public getStates(): StateObject[] {\n const elements = getAllElementsRecursively(this.chart);\n\n const stateObjects: StateObject[] = [];\n each(elements, (element: Element) => {\n const data = element.getData();\n const states = element.getStates();\n each(states, (state) => {\n stateObjects.push({ data, state, geometry: element.geometry, element });\n });\n });\n\n return stateObjects;\n }\n\n /**\n * 更新数据\n * @override\n * @param options\n */\n public changeData(data: any) {\n // @ts-ignore\n this.update({ data });\n // TODO: 临时方案,最好使用下面的方式去更新数据\n // this.chart.changeData(data);\n }\n\n /**\n * 修改画布大小\n * @param width\n * @param height\n */\n public changeSize(width: number, height: number) {\n this.chart.changeSize(width, height);\n }\n\n /**\n * 增加图表标注。通过 id 标识,如果匹配到,就做更新\n */\n public addAnnotations(annotations: Annotation[], view?: View): void {\n view = view ? view : this.chart;\n const incoming = [...annotations];\n const controller = view.getController('annotation');\n const current = controller.getComponents().map((co) => co.extra);\n\n controller.clear(true);\n for (let i = 0; i < current.length; i++) {\n let annotation = current[i];\n\n const findIndex = incoming.findIndex((item) => item.id && item.id === annotation.id);\n if (findIndex !== -1) {\n annotation = deepAssign({}, annotation, incoming[findIndex]);\n incoming.splice(findIndex, 1);\n }\n controller.annotation(annotation);\n }\n\n incoming.forEach((annotation) => controller.annotation(annotation));\n view.render(true);\n }\n\n /**\n * 删除图表标注。通过 id 标识,如果匹配到,就做删除\n */\n public removeAnnotations(annotations: Array<{ id: string } & Partial<Annotation>>): void {\n const controller = this.chart.getController('annotation');\n const current = controller.getComponents().map((co) => co.extra);\n\n controller.clear(true);\n for (let i = 0; i < current.length; i++) {\n const annotation = current[i];\n\n if (!annotations.find((item) => item.id && item.id === annotation.id)) {\n controller.annotation(annotation);\n }\n }\n\n this.chart.render(true);\n }\n /**\n * 销毁\n */\n public destroy() {\n // 取消 size-sensor 的绑定\n this.unbindSizeSensor();\n // G2 的销毁\n this.chart.destroy();\n // 清空已经绑定的事件\n this.off();\n\n this.container.removeAttribute(SOURCE_ATTRIBUTE_NAME);\n }\n\n /**\n * 执行 adaptor 操作\n */\n protected execAdaptor() {\n const adaptor = this.getSchemaAdaptor();\n\n const { padding, appendPadding } = this.options;\n // 更新 padding\n this.chart.padding = padding;\n // 更新 appendPadding\n this.chart.appendPadding = appendPadding;\n\n // 转化成 G2 API\n adaptor({\n chart: this.chart,\n options: this.options,\n });\n }\n\n /**\n * 当图表容器大小变化的时候,执行的函数\n */\n protected triggerResize() {\n this.chart.forceFit();\n }\n\n /**\n * 绑定 dom 容器大小变化的事件\n */\n private bindSizeSensor() {\n if (this.unbind) {\n return;\n }\n\n const { autoFit = true } = this.options;\n if (autoFit) {\n this.unbind = bind(this.container, () => {\n // 获取最新的宽高信息\n const { width, height } = getContainerSize(this.container);\n\n // 主要是防止绑定的时候触发 resize 回调\n if (width !== this.chart.width || height !== this.chart.height) {\n this.triggerResize();\n }\n });\n }\n }\n\n /**\n * 取消绑定\n */\n private unbindSizeSensor() {\n if (this.unbind) {\n this.unbind();\n this.unbind = undefined;\n }\n }\n}\n"]}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const version = "2.4.
|
|
1
|
+
export declare const version = "2.4.9";
|
|
2
2
|
import * as G2 from '@antv/g2';
|
|
3
3
|
export { G2 };
|
|
4
4
|
import { registerLocale } from './core/locale';
|
|
@@ -55,7 +55,7 @@ export { Stock } from './plots/stock';
|
|
|
55
55
|
export type { StockOptions } from './plots/stock';
|
|
56
56
|
export { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';
|
|
57
57
|
export type { FunnelOptions } from './plots/funnel';
|
|
58
|
-
export { Liquid } from './plots/liquid';
|
|
58
|
+
export { Liquid, addWaterWave } from './plots/liquid';
|
|
59
59
|
export type { LiquidOptions } from './plots/liquid';
|
|
60
60
|
export { Bullet } from './plots/bullet';
|
|
61
61
|
export type { BulletOptions } from './plots/bullet';
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export var version = '2.4.
|
|
1
|
+
export var version = '2.4.9';
|
|
2
2
|
// G2 自定义能力透出
|
|
3
3
|
import * as G2 from '@antv/g2';
|
|
4
4
|
export { G2 };
|
|
@@ -62,7 +62,7 @@ export { Stock } from './plots/stock';
|
|
|
62
62
|
// 漏斗图及类型定义
|
|
63
63
|
export { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';
|
|
64
64
|
// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)
|
|
65
|
-
export { Liquid } from './plots/liquid';
|
|
65
|
+
export { Liquid, addWaterWave } from './plots/liquid';
|
|
66
66
|
// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
|
|
67
67
|
export { Bullet } from './plots/bullet';
|
|
68
68
|
// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,e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;AACf,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,oBAAoB;AACpB,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAGzC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.5';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2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,EAAE,MAAM,aAAa,CAAC;AAGzC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.9';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid, addWaterWave } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/area/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE;YACV,IAAI,EAAE,GAAG;SACV;KACF;IACD,OAAO,EAAE,IAAI;IACb,OAAO;IACP,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/area/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE;YACV,IAAI,EAAE,GAAG;SACV;KACF;IACD,OAAO,EAAE,IAAI;IACb,OAAO;IACP,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 面积图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n tooltip: {\n shared: true,\n showMarkers: true,\n showCrosshairs: true,\n crosshairs: {\n type: 'x',\n },\n },\n isStack: true,\n // 默认开启\n line: {},\n legend: {\n position: 'top-left',\n radio: {},\n },\n});\n"]}
|
|
@@ -2,24 +2,49 @@ import { GeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../.
|
|
|
2
2
|
import { Options, StyleAttr } from '../../types';
|
|
3
3
|
/** 面积图的配置类型定义 */
|
|
4
4
|
export interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'> {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @title x轴字段
|
|
7
|
+
*/
|
|
6
8
|
readonly xField?: string;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title y轴字段
|
|
11
|
+
*/
|
|
8
12
|
readonly yField?: string;
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 分组字段
|
|
15
|
+
*/
|
|
10
16
|
readonly seriesField?: string;
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 是否配置堆积
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
12
21
|
readonly isStack?: boolean;
|
|
13
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 是否配置百分比
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
14
26
|
readonly isPercent?: boolean;
|
|
15
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @title 是否配置平滑
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
16
31
|
readonly smooth?: boolean;
|
|
17
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* @title 面积图形样式
|
|
34
|
+
*/
|
|
18
35
|
readonly areaStyle?: StyleAttr;
|
|
19
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 面积中折线的样式
|
|
38
|
+
*/
|
|
20
39
|
readonly line?: LineGeometryOptions['line'] & Pick<PointGeometryOptions, 'state'>;
|
|
21
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* @title 面积图数据点图形样式
|
|
42
|
+
*/
|
|
22
43
|
readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
|
|
23
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* @title 面积图填充
|
|
46
|
+
* @description 面积图是否从 0 基准线开始填充
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
24
49
|
readonly startOnZero?: boolean;
|
|
25
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/area/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../../adaptor/geometries';\nimport { Options, StyleAttr } from '../../types';\n\n/** 面积图的配置类型定义 */\nexport interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/area/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../../adaptor/geometries';\nimport { Options, StyleAttr } from '../../types';\n\n/** 面积图的配置类型定义 */\nexport interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'> {\n /**\n * @title x轴字段\n */\n readonly xField?: string;\n /**\n * @title y轴字段\n */\n readonly yField?: string;\n /**\n * @title 分组字段\n */\n readonly seriesField?: string;\n /**\n * @title 是否配置堆积\n * @default false\n */\n readonly isStack?: boolean;\n /**\n * @title 是否配置百分比\n * @default false\n */\n readonly isPercent?: boolean;\n /**\n * @title 是否配置平滑\n * @default false\n */\n readonly smooth?: boolean;\n /**\n * @title 面积图形样式\n */\n readonly areaStyle?: StyleAttr;\n /**\n * @title 面积中折线的样式\n */\n readonly line?: LineGeometryOptions['line'] & Pick<PointGeometryOptions, 'state'>;\n /**\n * @title 面积图数据点图形样式\n */\n readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;\n /**\n * @title 面积图填充\n * @description 面积图是否从 0 基准线开始填充\n * @default false\n */\n readonly startOnZero?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/bar/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,CAAC,GAAG,EAAE;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 条形图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n barWidthRatio: 0.6,\n marginRatio: 1 / 32,\n tooltip: {\n shared: true,\n showMarkers: false,\n offset: 20,\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/bar/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,CAAC,GAAG,EAAE;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACX;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 条形图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n barWidthRatio: 0.6,\n marginRatio: 1 / 32,\n tooltip: {\n shared: true,\n showMarkers: false,\n offset: 20,\n },\n legend: {\n radio: {},\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
package/esm/plots/bar/types.d.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { ColumnOptions } from '../column/types';
|
|
2
2
|
export interface BarOptions extends Omit<ColumnOptions, 'columnStyle' | 'columnWidthRatio' | 'minColumnWidth' | 'maxColumnWidth'> {
|
|
3
|
+
/**
|
|
4
|
+
* @title 柱状图柱子样式配置
|
|
5
|
+
*/
|
|
3
6
|
readonly barStyle?: ColumnOptions['columnStyle'];
|
|
7
|
+
/**
|
|
8
|
+
* @title 柱状图宽度占比
|
|
9
|
+
* @description 范围[0-1]
|
|
10
|
+
*/
|
|
4
11
|
readonly barWidthRatio?: ColumnOptions['columnWidthRatio'];
|
|
5
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 条形图最小宽度(像素)
|
|
14
|
+
*/
|
|
6
15
|
readonly minBarWidth?: ColumnOptions['minColumnWidth'];
|
|
7
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 条形图最大宽度(像素)
|
|
18
|
+
*/
|
|
8
19
|
readonly maxBarWidth?: ColumnOptions['maxColumnWidth'];
|
|
9
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @title 条形图柱子的背景配置
|
|
22
|
+
*/
|
|
10
23
|
readonly barBackground?: ColumnOptions['columnBackground'];
|
|
11
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColumnOptions } from '../column/types';\n\n// rename column to bar\nexport interface BarOptions\n extends Omit<ColumnOptions, 'columnStyle' | 'columnWidthRatio' | 'minColumnWidth' | 'maxColumnWidth'> {\n readonly barStyle?: ColumnOptions['columnStyle'];\n readonly barWidthRatio?: ColumnOptions['columnWidthRatio'];\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColumnOptions } from '../column/types';\n\n// rename column to bar\nexport interface BarOptions\n extends Omit<ColumnOptions, 'columnStyle' | 'columnWidthRatio' | 'minColumnWidth' | 'maxColumnWidth'> {\n /**\n * @title 柱状图柱子样式配置\n */\n readonly barStyle?: ColumnOptions['columnStyle'];\n /**\n * @title 柱状图宽度占比\n * @description 范围[0-1]\n */\n readonly barWidthRatio?: ColumnOptions['columnWidthRatio'];\n /**\n * @title 条形图最小宽度(像素)\n */\n readonly minBarWidth?: ColumnOptions['minColumnWidth'];\n /**\n * @title 条形图最大宽度(像素)\n */\n readonly maxBarWidth?: ColumnOptions['maxColumnWidth'];\n /**\n * @title 条形图柱子的背景配置\n */\n readonly barBackground?: ColumnOptions['columnBackground'];\n}\n"]}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { Axis } from '../../types/axis';
|
|
2
2
|
import { Options, StyleAttr } from '../../types';
|
|
3
3
|
export interface BidirectionalBarOptions extends Omit<Options, 'yAxis' | 'yField'> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title x轴字段
|
|
6
|
+
*/
|
|
5
7
|
readonly xField: string;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title y轴字段
|
|
10
|
+
*/
|
|
7
11
|
readonly yField: [string, string];
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title yAxis
|
|
14
|
+
* @description yAxis 为多个 key 为 yField 里面的 2 个字段
|
|
15
|
+
*/
|
|
9
16
|
readonly yAxis?: false | {
|
|
10
17
|
[key: string]: Axis;
|
|
11
18
|
};
|
|
12
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* @title 柱状图宽度占比
|
|
21
|
+
* @description 范围[0-1]
|
|
22
|
+
*/
|
|
13
23
|
readonly widthRatio?: number;
|
|
14
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 柱状图柱子样式
|
|
26
|
+
*/
|
|
15
27
|
readonly barStyle?: StyleAttr;
|
|
16
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @title 布局方向选择
|
|
30
|
+
* @default "horizontal"
|
|
31
|
+
*/
|
|
17
32
|
readonly layout?: 'horizontal' | 'vertical';
|
|
18
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/bidirectional-bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Axis } from '../../types/axis';\nimport { Options, StyleAttr } from '../../types';\n\nexport interface BidirectionalBarOptions extends Omit<Options, 'yAxis' | 'yField'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/bidirectional-bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Axis } from '../../types/axis';\nimport { Options, StyleAttr } from '../../types';\n\nexport interface BidirectionalBarOptions extends Omit<Options, 'yAxis' | 'yField'> {\n /**\n * @title x轴字段\n */\n readonly xField: string;\n /**\n * @title y轴字段\n */\n readonly yField: [string, string];\n /**\n * @title yAxis\n * @description yAxis 为多个 key 为 yField 里面的 2 个字段\n */\n readonly yAxis?:\n | false\n | {\n [key: string]: Axis;\n };\n /**\n * @title 柱状图宽度占比\n * @description 范围[0-1]\n */\n readonly widthRatio?: number;\n /**\n * @title 柱状图柱子样式\n */\n readonly barStyle?: StyleAttr;\n /**\n * @title 布局方向选择\n * @default \"horizontal\"\n */\n readonly layout?: 'horizontal' | 'vertical';\n}\n"]}
|
package/esm/plots/box/types.d.ts
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
export interface BoxOptions extends Options {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @title x轴字段
|
|
5
|
+
*/
|
|
4
6
|
readonly xField: string;
|
|
5
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @title y轴映射
|
|
9
|
+
* @descriptionbox range [low, q1, median, q3, high] 五个字段 or 一个数组字段
|
|
10
|
+
*/
|
|
6
11
|
readonly yField: string | [string?, string?, string?, string?, string?];
|
|
7
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 箱型样式
|
|
14
|
+
*/
|
|
8
15
|
readonly boxStyle?: StyleAttr;
|
|
9
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 分组拆分字段
|
|
18
|
+
* @default 分组情况,颜色作为视觉通道
|
|
19
|
+
*/
|
|
10
20
|
readonly groupField?: string;
|
|
11
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 异常值字段
|
|
23
|
+
*/
|
|
12
24
|
readonly outliersField?: string;
|
|
13
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 异常值样式
|
|
27
|
+
*/
|
|
14
28
|
readonly outliersStyle?: StyleAttr;
|
|
15
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/box/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\nexport interface BoxOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/box/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\nexport interface BoxOptions extends Options {\n /**\n * @title x轴字段\n */\n readonly xField: string;\n /**\n * @title y轴映射\n * @descriptionbox range [low, q1, median, q3, high] 五个字段 or 一个数组字段\n */\n readonly yField: string | [string?, string?, string?, string?, string?];\n /**\n * @title 箱型样式\n */\n readonly boxStyle?: StyleAttr;\n /**\n * @title 分组拆分字段\n * @default 分组情况,颜色作为视觉通道\n */\n readonly groupField?: string;\n /**\n * @title 异常值字段\n */\n readonly outliersField?: string;\n /**\n * @title 异常值样式\n */\n readonly outliersStyle?: StyleAttr;\n}\n"]}
|
|
@@ -7,23 +7,50 @@ declare type BulletAttr<T> = {
|
|
|
7
7
|
range?: T;
|
|
8
8
|
};
|
|
9
9
|
export interface BulletOptions extends Omit<Options, 'color' | 'label' | 'style'> {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title 弹图标题
|
|
12
|
+
* @description 用于区分不同的类型
|
|
13
|
+
*/
|
|
11
14
|
readonly xField?: string;
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @title 测量字段
|
|
17
|
+
* @description 使用数据条的长度,表示实际数值字段,所表示值为 number[]
|
|
18
|
+
*/
|
|
13
19
|
readonly measureField: string;
|
|
14
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @title 范围字段
|
|
22
|
+
* @description 使用背景色条的长度,表示区间范围 [20,50,100], 所表示值为 number[]
|
|
23
|
+
*/
|
|
15
24
|
readonly rangeField: string;
|
|
16
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 目标字段
|
|
27
|
+
* @description 使用测量标记的刻度轴位置,表示目标值,所表示值为数值
|
|
28
|
+
*/
|
|
17
29
|
readonly targetField: string;
|
|
18
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title 标签
|
|
32
|
+
* @description 包含了 measure,target,range
|
|
33
|
+
*/
|
|
19
34
|
readonly label?: BulletAttr<GeometryLabelAttr | false>;
|
|
20
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 尺寸
|
|
37
|
+
* @description 包含了 measure,target,range
|
|
38
|
+
*/
|
|
21
39
|
readonly size?: BulletAttr<SizeAttr>;
|
|
22
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* @title 颜色
|
|
42
|
+
* @description 包含了 measure,target,range
|
|
43
|
+
*/
|
|
23
44
|
readonly color?: BulletAttr<ColorAttr>;
|
|
24
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* @title 项目符号样式
|
|
47
|
+
* @description 包含了 measure,target,range
|
|
48
|
+
*/
|
|
25
49
|
readonly bulletStyle?: BulletAttr<StyleAttr>;
|
|
26
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* @title 布局方向选择
|
|
52
|
+
* @default "horizontal"
|
|
53
|
+
*/
|
|
27
54
|
layout?: 'horizontal' | 'vertical';
|
|
28
55
|
}
|
|
29
56
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/bullet/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Options, ColorAttr, SizeAttr, StyleAttr, Datum } from '../../types';\n\ntype GeometryLabelAttr = Types.GeometryLabelCfg | ((datum: Datum) => Types.GeometryLabelCfg);\n\ntype BulletAttr<T> = {\n measure?: T;\n target?: T;\n range?: T;\n};\nexport interface BulletOptions extends Omit<Options, 'color' | 'label' | 'style'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/bullet/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Options, ColorAttr, SizeAttr, StyleAttr, Datum } from '../../types';\n\ntype GeometryLabelAttr = Types.GeometryLabelCfg | ((datum: Datum) => Types.GeometryLabelCfg);\n\ntype BulletAttr<T> = {\n measure?: T;\n target?: T;\n range?: T;\n};\nexport interface BulletOptions extends Omit<Options, 'color' | 'label' | 'style'> {\n /**\n * @title 弹图标题\n * @description 用于区分不同的类型\n */\n readonly xField?: string;\n /**\n * @title 测量字段\n * @description 使用数据条的长度,表示实际数值字段,所表示值为 number[]\n */\n readonly measureField: string;\n /**\n * @title 范围字段\n * @description 使用背景色条的长度,表示区间范围 [20,50,100], 所表示值为 number[]\n */\n readonly rangeField: string;\n /**\n * @title 目标字段\n * @description 使用测量标记的刻度轴位置,表示目标值,所表示值为数值\n */\n readonly targetField: string;\n /**\n * @title 标签\n * @description 包含了 measure,target,range\n */\n readonly label?: BulletAttr<GeometryLabelAttr | false>;\n /**\n * @title 尺寸\n * @description 包含了 measure,target,range\n */\n readonly size?: BulletAttr<SizeAttr>;\n /**\n * @title 颜色\n * @description 包含了 measure,target,range\n */\n readonly color?: BulletAttr<ColorAttr>;\n /**\n * @title 项目符号样式\n * @description 包含了 measure,target,range\n */\n readonly bulletStyle?: BulletAttr<StyleAttr>;\n /**\n * @title 布局方向选择\n * @default \"horizontal\"\n */\n layout?: 'horizontal' | 'vertical';\n}\n"]}
|
|
@@ -2,43 +2,47 @@ import { Data, Datum, Options, StyleAttr } from '../../types';
|
|
|
2
2
|
/** 配置类型定义 */
|
|
3
3
|
export interface ChordOptions extends Omit<Options, 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
|
|
4
4
|
/**
|
|
5
|
-
* 来源字段
|
|
5
|
+
* @title 来源字段
|
|
6
6
|
*/
|
|
7
7
|
readonly sourceField: string;
|
|
8
8
|
/**
|
|
9
|
-
* 去向字段
|
|
9
|
+
* @title 去向字段
|
|
10
10
|
*/
|
|
11
11
|
readonly targetField: string;
|
|
12
12
|
/**
|
|
13
|
-
* 权重字段
|
|
13
|
+
* @title 权重字段
|
|
14
14
|
*/
|
|
15
15
|
readonly weightField: string;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* @title 源字段
|
|
18
18
|
*/
|
|
19
19
|
readonly rawFields?: string[];
|
|
20
20
|
/**
|
|
21
|
-
* 数据
|
|
21
|
+
* @title 数据
|
|
22
22
|
*/
|
|
23
23
|
readonly data: Data;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* @title 节点间距比例
|
|
26
|
+
* @description 参考画布的宽度,取值[0-1]
|
|
27
|
+
* @default 0.1
|
|
26
28
|
*/
|
|
27
29
|
readonly nodePaddingRatio?: number;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* @title 节点的厚度
|
|
32
|
+
* @description 取值[0-1]
|
|
33
|
+
* @default 0.05
|
|
30
34
|
*/
|
|
31
35
|
readonly nodeWidthRatio?: number;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* @title 节点排序方式
|
|
34
38
|
*/
|
|
35
39
|
readonly nodeSort?: (a: Datum, b: Datum) => number;
|
|
36
40
|
/**
|
|
37
|
-
* 节点样式
|
|
41
|
+
* @title 节点样式
|
|
38
42
|
*/
|
|
39
43
|
readonly nodeStyle?: StyleAttr;
|
|
40
44
|
/**
|
|
41
|
-
* 边样式
|
|
45
|
+
* @title 边样式
|
|
42
46
|
*/
|
|
43
47
|
readonly edgeStyle?: StyleAttr;
|
|
44
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/chord/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Data, Datum, Options, StyleAttr } from '../../types';\n\n/** 配置类型定义 */\nexport interface ChordOptions extends Omit<Options, 'xField' | 'yField' | 'xAxis' | 'yAxis'> {\n /**\n * 来源字段\n */\n readonly sourceField: string;\n /**\n * 去向字段\n */\n readonly targetField: string;\n /**\n * 权重字段\n */\n readonly weightField: string;\n /**\n *
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/chord/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Data, Datum, Options, StyleAttr } from '../../types';\n\n/** 配置类型定义 */\nexport interface ChordOptions extends Omit<Options, 'xField' | 'yField' | 'xAxis' | 'yAxis'> {\n /**\n * @title 来源字段\n */\n readonly sourceField: string;\n /**\n * @title 去向字段\n */\n readonly targetField: string;\n /**\n * @title 权重字段\n */\n readonly weightField: string;\n /**\n * @title 源字段\n */\n readonly rawFields?: string[];\n /**\n * @title 数据\n */\n readonly data: Data;\n /**\n * @title 节点间距比例\n * @description 参考画布的宽度,取值[0-1]\n * @default 0.1\n */\n readonly nodePaddingRatio?: number;\n /**\n * @title 节点的厚度\n * @description 取值[0-1]\n * @default 0.05\n */\n readonly nodeWidthRatio?: number;\n /**\n * @title 节点排序方式\n */\n readonly nodeSort?: (a: Datum, b: Datum) => number;\n /**\n * @title 节点样式\n */\n readonly nodeStyle?: StyleAttr;\n /**\n * @title 边样式\n */\n readonly edgeStyle?: StyleAttr;\n}\n"]}
|