@antv/g2plot 2.4.7 → 2.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/README.md +1 -1
- package/dist/g2plot.min.js +4 -4
- package/dist/g2plot.min.js.map +1 -1
- package/esm/core/plot.d.ts +2 -2
- package/esm/core/plot.js +4 -3
- package/esm/core/plot.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/plots/area/types.d.ts +35 -10
- package/esm/plots/area/types.js.map +1 -1
- package/esm/plots/bar/types.d.ts +16 -3
- package/esm/plots/bar/types.js.map +1 -1
- package/esm/plots/bidirectional-bar/types.d.ts +21 -6
- package/esm/plots/bidirectional-bar/types.js.map +1 -1
- package/esm/plots/box/types.d.ts +20 -6
- package/esm/plots/box/types.js.map +1 -1
- package/esm/plots/bullet/types.d.ts +36 -9
- package/esm/plots/bullet/types.js.map +1 -1
- package/esm/plots/chord/types.d.ts +14 -10
- package/esm/plots/chord/types.js.map +1 -1
- package/esm/plots/circle-packing/types.d.ts +25 -8
- package/esm/plots/circle-packing/types.js.map +1 -1
- package/esm/plots/column/types.d.ts +57 -16
- package/esm/plots/column/types.js.map +1 -1
- package/esm/plots/dual-axes/types.d.ts +31 -6
- package/esm/plots/dual-axes/types.js.map +1 -1
- package/esm/plots/dual-axes/util/render-sider.js +1 -1
- package/esm/plots/dual-axes/util/render-sider.js.map +1 -1
- package/esm/plots/facet/types.d.ts +54 -34
- package/esm/plots/facet/types.js.map +1 -1
- package/esm/plots/funnel/geometries/compare.js +2 -1
- package/esm/plots/funnel/geometries/compare.js.map +1 -1
- package/esm/plots/funnel/geometries/facet.js +2 -1
- package/esm/plots/funnel/geometries/facet.js.map +1 -1
- package/esm/plots/funnel/types.d.ts +45 -11
- package/esm/plots/funnel/types.js.map +1 -1
- package/esm/plots/gauge/types.d.ts +83 -21
- package/esm/plots/gauge/types.js.map +1 -1
- package/esm/plots/heatmap/types.d.ts +47 -12
- package/esm/plots/heatmap/types.js.map +1 -1
- package/esm/plots/histogram/types.d.ts +17 -6
- package/esm/plots/histogram/types.js.map +1 -1
- package/esm/plots/line/types.d.ts +42 -12
- package/esm/plots/line/types.js.map +1 -1
- package/esm/plots/liquid/index.d.ts +1 -0
- package/esm/plots/liquid/index.js +1 -0
- package/esm/plots/liquid/index.js.map +1 -1
- package/esm/plots/liquid/shapes/liquid.d.ts +16 -1
- package/esm/plots/liquid/shapes/liquid.js +13 -8
- package/esm/plots/liquid/shapes/liquid.js.map +1 -1
- package/esm/plots/liquid/types.d.ts +56 -16
- package/esm/plots/liquid/types.js.map +1 -1
- package/esm/plots/mix/types.d.ts +31 -22
- package/esm/plots/mix/types.js.map +1 -1
- package/esm/plots/pie/types.d.ts +27 -10
- package/esm/plots/pie/types.js.map +1 -1
- package/esm/plots/progress/types.d.ts +13 -4
- package/esm/plots/progress/types.js.map +1 -1
- package/esm/plots/radar/types.d.ts +39 -12
- package/esm/plots/radar/types.js.map +1 -1
- package/esm/plots/radial-bar/types.d.ts +39 -12
- package/esm/plots/radial-bar/types.js.map +1 -1
- package/esm/plots/ring-progress/types.d.ts +18 -6
- package/esm/plots/ring-progress/types.js.map +1 -1
- package/esm/plots/rose/types.d.ts +32 -12
- package/esm/plots/rose/types.js.map +1 -1
- package/esm/plots/sankey/adaptor.js +31 -2
- package/esm/plots/sankey/adaptor.js.map +1 -1
- package/esm/plots/sankey/types.d.ts +57 -30
- package/esm/plots/sankey/types.js.map +1 -1
- package/esm/plots/scatter/types.d.ts +76 -22
- package/esm/plots/scatter/types.js.map +1 -1
- package/esm/plots/stock/types.d.ts +20 -7
- package/esm/plots/stock/types.js.map +1 -1
- package/esm/plots/sunburst/types.d.ts +40 -12
- package/esm/plots/sunburst/types.js.map +1 -1
- package/esm/plots/tiny-area/types.d.ts +16 -5
- package/esm/plots/tiny-area/types.js.map +1 -1
- package/esm/plots/tiny-column/types.d.ts +10 -3
- package/esm/plots/tiny-column/types.js.map +1 -1
- package/esm/plots/tiny-line/types.d.ts +17 -5
- package/esm/plots/tiny-line/types.js.map +1 -1
- package/esm/plots/treemap/types.d.ts +17 -6
- package/esm/plots/treemap/types.js.map +1 -1
- package/esm/plots/venn/types.d.ts +20 -6
- package/esm/plots/venn/types.js.map +1 -1
- package/esm/plots/violin/types.d.ts +52 -17
- package/esm/plots/violin/types.js.map +1 -1
- package/esm/plots/waterfall/types.d.ts +42 -10
- package/esm/plots/waterfall/types.js.map +1 -1
- package/esm/plots/word-cloud/types.d.ts +91 -44
- package/esm/plots/word-cloud/types.js.map +1 -1
- package/esm/types/button.d.ts +8 -4
- package/esm/types/button.js.map +1 -1
- package/esm/types/common.d.ts +145 -33
- package/esm/types/common.js.map +1 -1
- package/esm/types/drill-down.d.ts +28 -7
- package/esm/types/drill-down.js.map +1 -1
- package/esm/types/interaction.d.ts +26 -6
- package/esm/types/interaction.js.map +1 -1
- package/esm/types/label.d.ts +11 -3
- package/esm/types/label.js.map +1 -1
- package/esm/types/meta.d.ts +4 -7
- package/esm/types/meta.js.map +1 -1
- package/esm/types/pattern.d.ts +58 -18
- package/esm/types/pattern.js.map +1 -1
- package/esm/types/state.d.ts +11 -3
- package/esm/types/state.js.map +1 -1
- package/esm/types/statistic.d.ts +38 -6
- package/esm/types/statistic.js.map +1 -1
- package/esm/types/tooltip.d.ts +7 -2
- package/esm/types/tooltip.js.map +1 -1
- package/esm/utils/transform/percent.js +2 -2
- package/esm/utils/transform/percent.js.map +1 -1
- package/lib/core/plot.d.ts +2 -2
- package/lib/core/plot.js +4 -3
- package/lib/core/plot.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/plots/area/types.d.ts +35 -10
- package/lib/plots/area/types.js.map +1 -1
- package/lib/plots/bar/types.d.ts +16 -3
- package/lib/plots/bar/types.js.map +1 -1
- package/lib/plots/bidirectional-bar/types.d.ts +21 -6
- package/lib/plots/bidirectional-bar/types.js.map +1 -1
- package/lib/plots/box/types.d.ts +20 -6
- package/lib/plots/box/types.js.map +1 -1
- package/lib/plots/bullet/types.d.ts +36 -9
- package/lib/plots/bullet/types.js.map +1 -1
- package/lib/plots/chord/types.d.ts +14 -10
- package/lib/plots/chord/types.js.map +1 -1
- package/lib/plots/circle-packing/types.d.ts +25 -8
- package/lib/plots/circle-packing/types.js.map +1 -1
- package/lib/plots/column/types.d.ts +57 -16
- package/lib/plots/column/types.js.map +1 -1
- package/lib/plots/dual-axes/types.d.ts +31 -6
- package/lib/plots/dual-axes/types.js.map +1 -1
- package/lib/plots/dual-axes/util/render-sider.js +1 -1
- package/lib/plots/dual-axes/util/render-sider.js.map +1 -1
- package/lib/plots/facet/types.d.ts +54 -34
- package/lib/plots/facet/types.js.map +1 -1
- package/lib/plots/funnel/geometries/compare.js +2 -1
- package/lib/plots/funnel/geometries/compare.js.map +1 -1
- package/lib/plots/funnel/geometries/facet.js +2 -1
- package/lib/plots/funnel/geometries/facet.js.map +1 -1
- package/lib/plots/funnel/types.d.ts +45 -11
- package/lib/plots/funnel/types.js.map +1 -1
- package/lib/plots/gauge/types.d.ts +83 -21
- package/lib/plots/gauge/types.js.map +1 -1
- package/lib/plots/heatmap/types.d.ts +47 -12
- package/lib/plots/heatmap/types.js.map +1 -1
- package/lib/plots/histogram/types.d.ts +17 -6
- package/lib/plots/histogram/types.js.map +1 -1
- package/lib/plots/line/types.d.ts +42 -12
- package/lib/plots/line/types.js.map +1 -1
- package/lib/plots/liquid/index.d.ts +1 -0
- package/lib/plots/liquid/index.js +2 -0
- package/lib/plots/liquid/index.js.map +1 -1
- package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
- package/lib/plots/liquid/shapes/liquid.js +14 -7
- package/lib/plots/liquid/shapes/liquid.js.map +1 -1
- package/lib/plots/liquid/types.d.ts +56 -16
- package/lib/plots/liquid/types.js.map +1 -1
- package/lib/plots/mix/types.d.ts +31 -22
- package/lib/plots/mix/types.js.map +1 -1
- package/lib/plots/pie/types.d.ts +27 -10
- package/lib/plots/pie/types.js.map +1 -1
- package/lib/plots/progress/types.d.ts +13 -4
- package/lib/plots/progress/types.js.map +1 -1
- package/lib/plots/radar/types.d.ts +39 -12
- package/lib/plots/radar/types.js.map +1 -1
- package/lib/plots/radial-bar/types.d.ts +39 -12
- package/lib/plots/radial-bar/types.js.map +1 -1
- package/lib/plots/ring-progress/types.d.ts +18 -6
- package/lib/plots/ring-progress/types.js.map +1 -1
- package/lib/plots/rose/types.d.ts +32 -12
- package/lib/plots/rose/types.js.map +1 -1
- package/lib/plots/sankey/adaptor.js +30 -1
- package/lib/plots/sankey/adaptor.js.map +1 -1
- package/lib/plots/sankey/types.d.ts +57 -30
- package/lib/plots/sankey/types.js.map +1 -1
- package/lib/plots/scatter/types.d.ts +76 -22
- package/lib/plots/scatter/types.js.map +1 -1
- package/lib/plots/stock/types.d.ts +20 -7
- package/lib/plots/stock/types.js.map +1 -1
- package/lib/plots/sunburst/types.d.ts +40 -12
- package/lib/plots/sunburst/types.js.map +1 -1
- package/lib/plots/tiny-area/types.d.ts +16 -5
- package/lib/plots/tiny-area/types.js.map +1 -1
- package/lib/plots/tiny-column/types.d.ts +10 -3
- package/lib/plots/tiny-column/types.js.map +1 -1
- package/lib/plots/tiny-line/types.d.ts +17 -5
- package/lib/plots/tiny-line/types.js.map +1 -1
- package/lib/plots/treemap/types.d.ts +17 -6
- package/lib/plots/treemap/types.js.map +1 -1
- package/lib/plots/venn/types.d.ts +20 -6
- package/lib/plots/venn/types.js.map +1 -1
- package/lib/plots/violin/types.d.ts +52 -17
- package/lib/plots/violin/types.js.map +1 -1
- package/lib/plots/waterfall/types.d.ts +42 -10
- package/lib/plots/waterfall/types.js.map +1 -1
- package/lib/plots/word-cloud/types.d.ts +91 -44
- package/lib/plots/word-cloud/types.js.map +1 -1
- package/lib/types/button.d.ts +8 -4
- package/lib/types/button.js.map +1 -1
- package/lib/types/common.d.ts +145 -33
- package/lib/types/common.js.map +1 -1
- package/lib/types/drill-down.d.ts +28 -7
- package/lib/types/drill-down.js.map +1 -1
- package/lib/types/interaction.d.ts +26 -6
- package/lib/types/interaction.js.map +1 -1
- package/lib/types/label.d.ts +11 -3
- package/lib/types/label.js.map +1 -1
- package/lib/types/meta.d.ts +4 -7
- package/lib/types/meta.js.map +1 -1
- package/lib/types/pattern.d.ts +58 -18
- package/lib/types/pattern.js.map +1 -1
- package/lib/types/state.d.ts +11 -3
- package/lib/types/state.js.map +1 -1
- package/lib/types/statistic.d.ts +38 -6
- package/lib/types/statistic.js.map +1 -1
- package/lib/types/tooltip.d.ts +7 -2
- package/lib/types/tooltip.js.map +1 -1
- package/lib/utils/transform/percent.js +2 -2
- package/lib/utils/transform/percent.js.map +1 -1
- package/package.json +1 -1
- package/src/core/plot.ts +5 -4
- package/src/index.ts +2 -2
- package/src/plots/area/types.ts +35 -10
- package/src/plots/bar/types.ts +16 -3
- package/src/plots/bidirectional-bar/types.ts +21 -6
- package/src/plots/box/types.ts +20 -6
- package/src/plots/bullet/types.ts +36 -17
- package/src/plots/chord/types.ts +14 -11
- package/src/plots/circle-packing/types.ts +25 -14
- package/src/plots/column/types.ts +57 -20
- package/src/plots/dual-axes/types.ts +31 -16
- package/src/plots/dual-axes/util/render-sider.ts +1 -1
- package/src/plots/facet/types.ts +54 -49
- package/src/plots/funnel/geometries/compare.ts +2 -0
- package/src/plots/funnel/geometries/facet.ts +2 -1
- package/src/plots/funnel/types.ts +45 -14
- package/src/plots/gauge/types.ts +86 -27
- package/src/plots/heatmap/types.ts +49 -14
- package/src/plots/histogram/types.ts +17 -9
- package/src/plots/line/types.ts +42 -14
- package/src/plots/liquid/index.ts +2 -0
- package/src/plots/liquid/shapes/liquid.ts +16 -8
- package/src/plots/liquid/types.ts +56 -16
- package/src/plots/mix/types.ts +31 -35
- package/src/plots/pie/types.ts +27 -10
- package/src/plots/progress/types.ts +13 -4
- package/src/plots/radar/types.ts +39 -12
- package/src/plots/radial-bar/types.ts +39 -12
- package/src/plots/ring-progress/types.ts +18 -6
- package/src/plots/rose/types.ts +32 -12
- package/src/plots/sankey/adaptor.ts +35 -2
- package/src/plots/sankey/types.ts +58 -30
- package/src/plots/scatter/types.ts +77 -24
- package/src/plots/stock/types.ts +21 -8
- package/src/plots/sunburst/types.ts +42 -12
- package/src/plots/tiny-area/types.ts +16 -5
- package/src/plots/tiny-column/types.ts +10 -3
- package/src/plots/tiny-line/types.ts +17 -5
- package/src/plots/treemap/types.ts +17 -7
- package/src/plots/venn/types.ts +21 -6
- package/src/plots/violin/types.ts +52 -17
- package/src/plots/waterfall/types.ts +42 -10
- package/src/plots/word-cloud/types.ts +91 -44
- package/src/types/button.ts +8 -4
- package/src/types/common.ts +145 -37
- package/src/types/drill-down.ts +28 -7
- package/src/types/interaction.ts +26 -6
- package/src/types/label.ts +11 -3
- package/src/types/meta.ts +4 -7
- package/src/types/pattern.ts +58 -18
- package/src/types/state.ts +11 -3
- package/src/types/statistic.ts +38 -6
- package/src/types/tooltip.ts +7 -2
- package/src/utils/transform/percent.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.js","sourceRoot":"","sources":["../../../../src/plots/funnel/geometries/facet.ts"],"names":[],"mappings":";;;AAAA,wCAAkD;AAGlD,iCAAsC;AAEtC;;;GAGG;AACH,SAAS,KAAK,CAAC,MAA6B;;IAClC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,KAAsB,OAAO,KAApB,EAAT,IAAI,mBAAG,EAAE,KAAA,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IACtC,QAAQ;IACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,KAAK,CAAC,KAAK;QACT,GAAC,MAAM,IAAG;YACR,IAAI,EAAE,IAAI;SACX;YACD,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA6B;IACrC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,WAAW,
|
|
1
|
+
{"version":3,"file":"facet.js","sourceRoot":"","sources":["../../../../src/plots/funnel/geometries/facet.ts"],"names":[],"mappings":";;;AAAA,wCAAkD;AAGlD,iCAAsC;AAEtC;;;GAGG;AACH,SAAS,KAAK,CAAC,MAA6B;;IAClC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,KAAsB,OAAO,KAApB,EAAT,IAAI,mBAAG,EAAE,KAAA,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IACtC,QAAQ;IACR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,KAAK,CAAC,KAAK;QACT,GAAC,MAAM,IAAG;YACR,IAAI,EAAE,IAAI;SACX;YACD,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA6B;IACrC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,WAAW,GAAmC,OAAO,YAA1C,EAAE,YAAY,GAAqB,OAAO,aAA5B,EAAE,cAAc,GAAK,OAAO,eAAZ,CAAa;IAE9D,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE,CAAC,WAAW,CAAC;QACrB,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,SAAS,EAAE,cAAc;QACzB,QAAQ,YAAC,IAAI,EAAE,KAAK;YAClB,mBAAW,CACT,kBAAU,CAAC,EAAE,EAAE,MAAM,EAAE;gBACrB,KAAK,EAAE,IAAI;gBACX,OAAO,EAAE;oBACP,IAAI,EAAE,KAAK,CAAC,IAAI;iBACjB;aACF,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAA6B;IACvD,OAAO,YAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAFD,kCAEC","sourcesContent":["import { flow, deepAssign } from '../../../utils';\nimport { Params } from '../../../core/adaptor';\nimport { FunnelOptions } from '../types';\nimport { basicFunnel } from './basic';\n\n/**\n * 处理字段数据\n * @param params\n */\nfunction field(params: Params<FunnelOptions>): Params<FunnelOptions> {\n const { chart, options } = params;\n const { data = [], yField } = options;\n // 绘制漏斗图\n chart.data(data);\n chart.scale({\n [yField]: {\n sync: true,\n },\n });\n return params;\n}\n\n/**\n * geometry处理\n * @param params\n */\nfunction geometry(params: Params<FunnelOptions>): Params<FunnelOptions> {\n const { chart, options } = params;\n const { seriesField, isTransposed, showFacetTitle } = options;\n\n chart.facet('rect', {\n fields: [seriesField],\n padding: [isTransposed ? 0 : 32, 10, 0, 10],\n showTitle: showFacetTitle,\n eachView(view, facet) {\n basicFunnel(\n deepAssign({}, params, {\n chart: view,\n options: {\n data: facet.data,\n },\n })\n );\n },\n });\n\n return params;\n}\n\n/**\n * 分面漏斗\n * @param chart\n * @param options\n */\nexport function facetFunnel(params: Params<FunnelOptions>) {\n return flow(field, geometry)(params);\n}\n"]}
|
|
@@ -5,27 +5,61 @@ export declare type ConversionPosition = {
|
|
|
5
5
|
end: AnnotationPosition;
|
|
6
6
|
};
|
|
7
7
|
export interface FunnelOptions extends Options {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title x轴字段
|
|
10
|
+
*/
|
|
9
11
|
readonly xField?: string;
|
|
10
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title y轴字段
|
|
14
|
+
*/
|
|
11
15
|
readonly yField?: string;
|
|
12
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 分组字段
|
|
18
|
+
* @description 漏斗图将根据此字段转置为分面漏斗图
|
|
19
|
+
*/
|
|
13
20
|
readonly seriesField?: string;
|
|
14
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 对比字段
|
|
23
|
+
* @description 漏斗图将根据此字段转置为对比漏斗图
|
|
24
|
+
*/
|
|
15
25
|
readonly compareField?: string;
|
|
16
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 是否转置
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
17
30
|
readonly isTransposed?: boolean;
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 是否是动态高度
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
19
35
|
readonly dynamicHeight?: boolean;
|
|
20
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 最大宽度
|
|
38
|
+
* @description 范围0-1
|
|
39
|
+
*/
|
|
21
40
|
readonly maxSize?: number;
|
|
22
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* @title 最小宽度
|
|
43
|
+
* @description 范围0-1
|
|
44
|
+
*/
|
|
23
45
|
readonly minSize?: number;
|
|
24
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* @title shape 形状
|
|
48
|
+
* @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用
|
|
49
|
+
*/
|
|
25
50
|
readonly shape?: string;
|
|
26
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 漏斗图样式
|
|
53
|
+
*/
|
|
27
54
|
readonly funnelStyle?: StyleAttr;
|
|
28
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* @title 漏斗分面标题
|
|
57
|
+
* @description 是否关闭漏斗的标题展示,适用于存在多组漏斗的情形,如:分组漏斗图、对比漏斗图。
|
|
58
|
+
*/
|
|
59
|
+
readonly showFacetTitle?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* @title 转化率信息
|
|
62
|
+
*/
|
|
29
63
|
readonly conversionTag?: false | {
|
|
30
64
|
readonly offsetX?: number;
|
|
31
65
|
readonly offsetY?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/funnel/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StyleAttr } from '../../types/attr';\nimport { TextStyle, Datum, Data, AnnotationPosition, Options } from '../../types/common';\n\nexport type ConversionPosition = {\n start: AnnotationPosition;\n end: AnnotationPosition;\n};\n\nexport interface FunnelOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/funnel/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StyleAttr } from '../../types/attr';\nimport { TextStyle, Datum, Data, AnnotationPosition, Options } from '../../types/common';\n\nexport type ConversionPosition = {\n start: AnnotationPosition;\n end: AnnotationPosition;\n};\n\nexport interface FunnelOptions extends Options {\n /**\n * @title x轴字段\n */\n readonly xField?: string;\n /**\n * @title y轴字段\n */\n readonly yField?: string;\n /**\n * @title 分组字段\n * @description 漏斗图将根据此字段转置为分面漏斗图\n */\n readonly seriesField?: string;\n /**\n * @title 对比字段\n * @description 漏斗图将根据此字段转置为对比漏斗图\n */\n readonly compareField?: string;\n /**\n * @title 是否转置\n * @default false\n */\n readonly isTransposed?: boolean;\n /**\n * @title 是否是动态高度\n * @default false\n */\n readonly dynamicHeight?: boolean;\n /**\n * @title 最大宽度\n * @description 范围0-1\n */\n readonly maxSize?: number;\n /**\n * @title 最小宽度\n * @description 范围0-1\n */\n readonly minSize?: number;\n /**\n * @title shape 形状\n * @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用\n */\n readonly shape?: string;\n /**\n * @title 漏斗图样式\n */\n readonly funnelStyle?: StyleAttr;\n /**\n * @title 漏斗分面标题\n * @description 是否关闭漏斗的标题展示,适用于存在多组漏斗的情形,如:分组漏斗图、对比漏斗图。\n */\n readonly showFacetTitle?: boolean;\n // 组件\n /**\n * @title 转化率信息\n */\n readonly conversionTag?:\n | false\n | {\n readonly offsetX?: number;\n readonly offsetY?: number;\n readonly style?: TextStyle;\n readonly formatter?: string | ((datum?: Datum, data?: Data) => string);\n };\n}\n"]}
|
|
@@ -3,66 +3,128 @@ import { Axis } from '../../types/axis';
|
|
|
3
3
|
import { PERCENT, RANGE_TYPE, RANGE_VALUE } from './constants';
|
|
4
4
|
/** 指标指标的配置 */
|
|
5
5
|
export declare type Indicator = {
|
|
6
|
+
/**
|
|
7
|
+
* @title 指针
|
|
8
|
+
* @description 只允许静态的 object
|
|
9
|
+
*/
|
|
6
10
|
readonly pointer?: {
|
|
7
11
|
readonly style?: ShapeStyle;
|
|
8
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* @title 圆环
|
|
15
|
+
* @description 只允许静态的 object
|
|
16
|
+
*/
|
|
9
17
|
readonly pin?: {
|
|
10
18
|
readonly style?: ShapeStyle;
|
|
11
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* @title 自定义指针 shape
|
|
22
|
+
* @default 'gauge-indicator'
|
|
23
|
+
*/
|
|
12
24
|
readonly shape?: string;
|
|
13
25
|
};
|
|
14
26
|
export declare type Range = {
|
|
15
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @title 辅助的刻度值
|
|
29
|
+
* @description 0 ~ 1 的数字
|
|
30
|
+
*/
|
|
16
31
|
readonly ticks?: number[];
|
|
17
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* @title 辅助刻度的颜色配置
|
|
34
|
+
*/
|
|
18
35
|
readonly color?: string | string[];
|
|
19
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 仪表盘辅助背景的宽度
|
|
38
|
+
*/
|
|
20
39
|
readonly width?: number;
|
|
21
40
|
};
|
|
22
41
|
/**
|
|
23
|
-
* 仪表盘辅助生成的 rangeData
|
|
42
|
+
* @title 仪表盘辅助生成的 rangeData
|
|
24
43
|
*/
|
|
25
44
|
export declare type GaugeRangeData = {
|
|
26
45
|
readonly [RANGE_VALUE]?: number;
|
|
27
46
|
readonly [RANGE_TYPE]: string;
|
|
28
47
|
readonly [PERCENT]: number;
|
|
29
48
|
}[];
|
|
30
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @title 仪表盘配置类型定义
|
|
51
|
+
*/
|
|
31
52
|
export interface GaugeOptions extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'xAxis' | 'yAxis' | 'xField' | 'yField' | 'color'> {
|
|
32
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 指标的比例
|
|
55
|
+
* @description 范围0 ~ 1
|
|
56
|
+
*/
|
|
33
57
|
readonly percent: number;
|
|
34
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* @title 外弧度
|
|
60
|
+
* @description 范围0 ~ 1
|
|
61
|
+
*/
|
|
35
62
|
readonly radius?: number;
|
|
36
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* @title 内弧度
|
|
65
|
+
* @description 范围0 ~ 1
|
|
66
|
+
*/
|
|
37
67
|
readonly innerRadius?: number;
|
|
38
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* @title 弧度起始
|
|
70
|
+
*/
|
|
39
71
|
readonly startAngle?: number;
|
|
40
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* @title 弧度结束
|
|
74
|
+
*/
|
|
41
75
|
readonly endAngle?: number;
|
|
42
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* @title 辅助的 range 组件
|
|
78
|
+
*/
|
|
43
79
|
readonly range?: Range;
|
|
44
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* @title 坐标轴配置
|
|
82
|
+
*/
|
|
45
83
|
readonly axis?: Axis;
|
|
46
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* @title 指针的配置
|
|
86
|
+
*/
|
|
47
87
|
readonly indicator?: false | Indicator;
|
|
48
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* @title 统计文本
|
|
90
|
+
*/
|
|
49
91
|
readonly statistic?: Statistic;
|
|
50
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* @title 仪表盘样式
|
|
94
|
+
*/
|
|
51
95
|
readonly gaugeStyle?: StyleAttr;
|
|
52
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* @title meter gauge 相关配置
|
|
98
|
+
*/
|
|
99
|
+
/**
|
|
100
|
+
* @title 仪表盘类型
|
|
101
|
+
* @description 可选项: 'meter', default 为空
|
|
102
|
+
*/
|
|
53
103
|
readonly type?: string;
|
|
54
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* @title 仪表盘配置
|
|
106
|
+
* @description 当仪表盘类型 = 'meter' 生效
|
|
107
|
+
*/
|
|
55
108
|
readonly meter?: {
|
|
56
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* @title 仪表盘总步数
|
|
111
|
+
* @default "50"
|
|
112
|
+
*/
|
|
57
113
|
readonly steps?: number;
|
|
58
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* @title step 与 gap 的宽度占比
|
|
116
|
+
* @default "0.5"
|
|
117
|
+
*/
|
|
59
118
|
readonly stepRatio?: number;
|
|
60
119
|
};
|
|
61
120
|
}
|
|
62
121
|
/**
|
|
63
|
-
* 仪表盘
|
|
122
|
+
* @title 仪表盘
|
|
123
|
+
* @description 自定义 shape 使用的 customInfo
|
|
64
124
|
*/
|
|
65
125
|
export declare type GaugeCustomInfo = {
|
|
66
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* @title 仪表盘 meter 类型的相关配置
|
|
128
|
+
*/
|
|
67
129
|
readonly meter?: GaugeOptions['meter'];
|
|
68
130
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/gauge/types.ts"],"names":[],"mappings":";;AAEA,yCAA+D","sourcesContent":["import { Options, ShapeStyle, Statistic, StyleAttr } from '../../types';\nimport { Axis } from '../../types/axis';\nimport { PERCENT, RANGE_TYPE, RANGE_VALUE } from './constants';\n\n/** 指标指标的配置 */\nexport type Indicator = {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/gauge/types.ts"],"names":[],"mappings":";;AAEA,yCAA+D","sourcesContent":["import { Options, ShapeStyle, Statistic, StyleAttr } from '../../types';\nimport { Axis } from '../../types/axis';\nimport { PERCENT, RANGE_TYPE, RANGE_VALUE } from './constants';\n\n/** 指标指标的配置 */\nexport type Indicator = {\n /**\n * @title 指针\n * @description 只允许静态的 object\n */\n readonly pointer?: {\n readonly style?: ShapeStyle;\n };\n /**\n * @title 圆环\n * @description 只允许静态的 object\n */\n readonly pin?: {\n readonly style?: ShapeStyle;\n };\n /**\n * @title 自定义指针 shape\n * @default 'gauge-indicator'\n */\n readonly shape?: string;\n};\n\nexport type Range = {\n /**\n * @title 辅助的刻度值\n * @description 0 ~ 1 的数字\n */\n readonly ticks?: number[];\n /**\n * @title 辅助刻度的颜色配置\n */\n readonly color?: string | string[];\n /**\n * @title 仪表盘辅助背景的宽度\n */\n readonly width?: number;\n};\n\n/**\n * @title 仪表盘辅助生成的 rangeData\n */\nexport type GaugeRangeData = {\n readonly [RANGE_VALUE]?: number;\n readonly [RANGE_TYPE]: string;\n readonly [PERCENT]: number;\n}[];\n\n/**\n * @title 仪表盘配置类型定义\n */\nexport interface GaugeOptions\n extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'xAxis' | 'yAxis' | 'xField' | 'yField' | 'color'> {\n /**\n * @title 指标的比例\n * @description 范围0 ~ 1\n */\n readonly percent: number;\n /**\n * @title 外弧度\n * @description 范围0 ~ 1\n */\n readonly radius?: number;\n /**\n * @title 内弧度\n * @description 范围0 ~ 1\n */\n readonly innerRadius?: number;\n /**\n * @title 弧度起始\n */\n readonly startAngle?: number;\n /**\n * @title 弧度结束\n */\n readonly endAngle?: number;\n /**\n * @title 辅助的 range 组件\n */\n readonly range?: Range;\n /**\n * @title 坐标轴配置\n */\n readonly axis?: Axis;\n /**\n * @title 指针的配置\n */\n readonly indicator?: false | Indicator;\n /**\n * @title 统计文本\n */\n readonly statistic?: Statistic;\n /**\n * @title 仪表盘样式\n */\n readonly gaugeStyle?: StyleAttr;\n\n /**\n * @title meter gauge 相关配置\n */\n\n /**\n * @title 仪表盘类型\n * @description 可选项: 'meter', default 为空\n */\n readonly type?: string;\n /**\n * @title 仪表盘配置\n * @description 当仪表盘类型 = 'meter' 生效\n */\n readonly meter?: {\n /**\n * @title 仪表盘总步数\n * @default \"50\"\n */\n readonly steps?: number;\n /**\n * @title step 与 gap 的宽度占比\n * @default \"0.5\"\n */\n readonly stepRatio?: number;\n };\n}\n\n/**\n * @title 仪表盘\n * @description 自定义 shape 使用的 customInfo\n */\nexport type GaugeCustomInfo = {\n /**\n * @title 仪表盘 meter 类型的相关配置\n */\n readonly meter?: GaugeOptions['meter'];\n};\n"]}
|
|
@@ -1,28 +1,63 @@
|
|
|
1
1
|
import { Types } from '@antv/g2';
|
|
2
2
|
import { Options, StyleAttr } from '../../types';
|
|
3
3
|
export interface HeatmapOptions extends Options {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 热力图类型
|
|
6
|
+
* @description 'polygon' | 'density'
|
|
7
|
+
*/
|
|
5
8
|
readonly type?: 'polygon' | 'density';
|
|
6
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @title x轴字段
|
|
11
|
+
*/
|
|
7
12
|
readonly xField: string;
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title y轴字段
|
|
15
|
+
*/
|
|
9
16
|
readonly yField: string;
|
|
10
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 颜色字段
|
|
19
|
+
*/
|
|
11
20
|
readonly colorField?: string;
|
|
12
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 热力格子中的形状
|
|
23
|
+
*/
|
|
13
24
|
readonly shape?: string;
|
|
14
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 热力格子中图形的尺寸比例
|
|
27
|
+
* @description 只有当 shape 和 sizeField 至少指定一项后才生效
|
|
28
|
+
*/
|
|
15
29
|
readonly sizeRatio?: number;
|
|
16
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title 坐标轴映射
|
|
32
|
+
* @description 坐标轴映射 'x' | 'y'
|
|
33
|
+
*/
|
|
17
34
|
readonly reflect?: 'x' | 'y';
|
|
18
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 极坐标属性
|
|
37
|
+
*/
|
|
19
38
|
readonly coordinate?: Types.CoordinateOption;
|
|
20
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title 图例相关
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* @title 数据字段名
|
|
44
|
+
* @description 点大小映射对应的数据字段名
|
|
45
|
+
*/
|
|
21
46
|
readonly sizeField?: string;
|
|
22
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* @title size 对应的图例
|
|
49
|
+
*/
|
|
23
50
|
readonly sizeLegend?: Options['legend'];
|
|
24
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 样式相关
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* @title 热力图形样式
|
|
56
|
+
*/
|
|
25
57
|
readonly heatmapStyle?: StyleAttr;
|
|
26
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* @title 贴图图案
|
|
60
|
+
* @description 在 type="density" 时不支持
|
|
61
|
+
*/
|
|
27
62
|
readonly pattern?: Options['pattern'];
|
|
28
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/heatmap/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Options, StyleAttr } from '../../types';\n\nexport interface HeatmapOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/heatmap/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Options, StyleAttr } from '../../types';\n\nexport interface HeatmapOptions extends Options {\n /**\n * @title 热力图类型\n * @description 'polygon' | 'density'\n */\n readonly type?: 'polygon' | 'density';\n /**\n * @title x轴字段\n */\n readonly xField: string;\n /**\n * @title y轴字段\n */\n readonly yField: string;\n /**\n * @title 颜色字段\n */\n readonly colorField?: string;\n /**\n * @title 热力格子中的形状\n */\n readonly shape?: string;\n /**\n * @title 热力格子中图形的尺寸比例\n * @description 只有当 shape 和 sizeField 至少指定一项后才生效\n */\n readonly sizeRatio?: number;\n /**\n * @title 坐标轴映射\n * @description 坐标轴映射 'x' | 'y'\n */\n readonly reflect?: 'x' | 'y';\n /**\n * @title 极坐标属性\n */\n readonly coordinate?: Types.CoordinateOption;\n\n /**\n * @title 图例相关\n */\n\n /**\n * @title 数据字段名\n * @description 点大小映射对应的数据字段名\n */\n readonly sizeField?: string;\n /**\n * @title size 对应的图例\n */\n readonly sizeLegend?: Options['legend'];\n\n /**\n * @title 样式相关\n */\n\n /**\n * @title 热力图形样式\n */\n readonly heatmapStyle?: StyleAttr;\n /**\n * @title 贴图图案\n * @description 在 type=\"density\" 时不支持\n */\n readonly pattern?: Options['pattern'];\n}\n"]}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
export interface HistogramOptions extends Options {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @title 直方图绘制字段
|
|
5
|
+
* @description 设置直方图绘制 (进行分箱) 的字段
|
|
6
|
+
*/
|
|
4
7
|
readonly binField: string;
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
9
|
+
* @title 设置直方图的分箱宽度
|
|
10
|
+
* @description binWidth 影响直方图分成多少箱,不能与binNumber一起使用
|
|
8
11
|
*/
|
|
9
12
|
readonly binWidth?: number;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 设置直方图的分箱数量
|
|
15
|
+
* @description binNumber 影响直方图分箱后每个柱子的宽度
|
|
16
|
+
*/
|
|
11
17
|
readonly binNumber?: number;
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 指定层叠字段
|
|
20
|
+
* @description 通过该字段的值,柱子将会被分割为多个部分,通过颜色进行区分
|
|
21
|
+
*/
|
|
13
22
|
readonly stackField?: string;
|
|
14
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 柱子样式配置
|
|
25
|
+
*/
|
|
15
26
|
readonly columnStyle?: StyleAttr;
|
|
16
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/histogram/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\nexport interface HistogramOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/histogram/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\nexport interface HistogramOptions extends Options {\n /**\n * @title 直方图绘制字段\n * @description 设置直方图绘制 (进行分箱) 的字段\n */\n readonly binField: string;\n\n /**\n * @title 设置直方图的分箱宽度\n * @description binWidth 影响直方图分成多少箱,不能与binNumber一起使用\n */\n readonly binWidth?: number;\n /**\n * @title 设置直方图的分箱数量\n * @description binNumber 影响直方图分箱后每个柱子的宽度\n */\n readonly binNumber?: number;\n /**\n * @title 指定层叠字段\n * @description 通过该字段的值,柱子将会被分割为多个部分,通过颜色进行区分\n */\n readonly stackField?: string;\n /**\n * @title 柱子样式配置\n */\n readonly columnStyle?: StyleAttr;\n}\n"]}
|
|
@@ -1,28 +1,58 @@
|
|
|
1
1
|
import { GeometryOptions, AreaGeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../../adaptor/geometries';
|
|
2
2
|
import { Options, StyleAttr } from '../../types';
|
|
3
3
|
export interface LineOptions extends Options, Pick<GeometryOptions, 'customInfo'> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 阶梯折线图类型
|
|
6
|
+
*/
|
|
5
7
|
readonly stepType?: string;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title x轴字段
|
|
10
|
+
*/
|
|
7
11
|
readonly xField?: string;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title y轴字段
|
|
14
|
+
*/
|
|
9
15
|
readonly yField?: string;
|
|
10
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 分组字段
|
|
18
|
+
*/
|
|
11
19
|
readonly seriesField?: string;
|
|
12
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @title 是否堆积
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
13
24
|
readonly isStack?: boolean;
|
|
14
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* @title 是否平滑
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
15
29
|
readonly smooth?: boolean;
|
|
16
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title 是否连接空数据
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
17
34
|
readonly connectNulls?: boolean;
|
|
18
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 折线图形样式
|
|
37
|
+
*/
|
|
19
38
|
readonly lineStyle?: StyleAttr;
|
|
20
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title 折线 shape 配置
|
|
41
|
+
*/
|
|
21
42
|
readonly lineShape?: Required<LineGeometryOptions>['line']['shape'];
|
|
22
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 折线数据点
|
|
45
|
+
* @description 1、图形映射属性 2、状态样式
|
|
46
|
+
*/
|
|
23
47
|
readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
|
|
24
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @title 折线趋势填充色
|
|
50
|
+
* @description 1、图形映射属性
|
|
51
|
+
*/
|
|
25
52
|
readonly area?: AreaGeometryOptions['area'] & Pick<PointGeometryOptions, 'state'>;
|
|
26
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* @title 坐标轴反转配置
|
|
55
|
+
* @description 坐标轴反转配置 'x' | 'y' | ['x', 'y']
|
|
56
|
+
*/
|
|
27
57
|
readonly reflect?: 'x' | 'y' | ['x', 'y'];
|
|
28
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/line/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n GeometryOptions,\n AreaGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n} from '../../adaptor/geometries';\nimport { Options, StyleAttr } from '../../types';\n\nexport interface LineOptions extends Options, Pick<GeometryOptions, 'customInfo'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/line/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n GeometryOptions,\n AreaGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n} from '../../adaptor/geometries';\nimport { Options, StyleAttr } from '../../types';\n\nexport interface LineOptions extends Options, Pick<GeometryOptions, 'customInfo'> {\n /**\n * @title 阶梯折线图类型\n */\n readonly stepType?: string;\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 smooth?: boolean;\n /**\n * @title 是否连接空数据\n * @default false\n */\n readonly connectNulls?: boolean;\n /**\n * @title 折线图形样式\n */\n readonly lineStyle?: StyleAttr;\n /**\n * @title 折线 shape 配置\n */\n readonly lineShape?: Required<LineGeometryOptions>['line']['shape'];\n /**\n * @title 折线数据点\n * @description 1、图形映射属性 2、状态样式\n */\n readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;\n /**\n * @title 折线趋势填充色\n * @description 1、图形映射属性\n */\n readonly area?: AreaGeometryOptions['area'] & Pick<PointGeometryOptions, 'state'>;\n /**\n * @title 坐标轴反转配置\n * @description 坐标轴反转配置 'x' | 'y' | ['x', 'y']\n */\n readonly reflect?: 'x' | 'y' | ['x', 'y'];\n}\n"]}
|
|
@@ -9,6 +9,8 @@ var constants_1 = require("./constants");
|
|
|
9
9
|
var utils_1 = require("./utils");
|
|
10
10
|
// register liquid shape
|
|
11
11
|
require("./shapes/liquid");
|
|
12
|
+
var liquid_1 = require("./shapes/liquid");
|
|
13
|
+
Object.defineProperty(exports, "addWaterWave", { enumerable: true, get: function () { return liquid_1.addWaterWave; } });
|
|
12
14
|
/**
|
|
13
15
|
* 传说中的水波图
|
|
14
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/liquid/index.ts"],"names":[],"mappings":";;;;AAAA,+BAAmD;AACnD,wCAAuC;AAGvC,qCAA+C;AAC/C,yCAA8C;AAC9C,iCAAwC;AACxC,wBAAwB;AACxB,2BAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/liquid/index.ts"],"names":[],"mappings":";;;;AAAA,+BAAmD;AACnD,wCAAuC;AAGvC,qCAA+C;AAC/C,yCAA8C;AAC9C,iCAAwC;AACxC,wBAAwB;AACxB,2BAAyB;AAEzB,0CAA+C;AAAtC,sGAAA,YAAY,OAAA;AAIrB;;GAEG;AACH;IAA4B,kCAAmB;IAA/C;QAAA,qEA6CC;QApCC,WAAW;QACJ,UAAI,GAAW,QAAQ,CAAC;;IAmCjC,CAAC;IA5CC;;;OAGG;IACI,wBAAiB,GAAxB;QACE,OAAO,2BAAe,CAAC;IACzB,CAAC;IAKD;;OAEG;IACO,kCAAiB,GAA3B;QACE,OAAO,MAAM,CAAC,iBAAiB,EAAE,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,2BAAU,GAAjB,UAAkB,OAAe;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CACb,qBAAgB,CAAC,kBAAkB,EACnC,UAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,qBAAgB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CACtE,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;QAE/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,mBAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;QAE9D,IAAI,CAAC,KAAK,CAAC,IAAI,CACb,qBAAgB,CAAC,iBAAiB,EAClC,UAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,qBAAgB,CAAC,iBAAiB,EAAE,IAAI,CAAC,CACrE,CAAC;IACJ,CAAC;IAED;;OAEG;IACO,iCAAgB,GAA1B;QACE,OAAO,iBAAO,CAAC;IACjB,CAAC;IACH,aAAC;AAAD,CAAC,AA7CD,CAA4B,WAAI,GA6C/B;AA7CY,wBAAM","sourcesContent":["import { VIEW_LIFE_CIRCLE, Event } from '@antv/g2';\nimport { Plot } from '../../core/plot';\nimport { Adaptor } from '../../core/adaptor';\nimport { LiquidOptions } from './types';\nimport { adaptor, statistic } from './adaptor';\nimport { DEFAULT_OPTIONS } from './constants';\nimport { getLiquidData } from './utils';\n// register liquid shape\nimport './shapes/liquid';\n\nexport { addWaterWave } from './shapes/liquid';\n\nexport type { LiquidOptions };\n\n/**\n * 传说中的水波图\n */\nexport class Liquid extends Plot<LiquidOptions> {\n /**\n * 获取 饼图 默认配置项\n * 供外部使用\n */\n static getDefaultOptions(): Partial<LiquidOptions> {\n return DEFAULT_OPTIONS;\n }\n\n /** 图表类型 */\n public type: string = 'liquid';\n\n /**\n * 获取 水波图 默认配置项, 供 base 获取\n */\n protected getDefaultOptions(): Partial<LiquidOptions> {\n return Liquid.getDefaultOptions();\n }\n\n /**\n * 更新数据\n * @param percent\n */\n public changeData(percent: number) {\n this.chart.emit(\n VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,\n Event.fromData(this.chart, VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, null)\n );\n this.updateOption({ percent });\n\n this.chart.data(getLiquidData(percent));\n statistic({ chart: this.chart, options: this.options }, true);\n\n this.chart.emit(\n VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,\n Event.fromData(this.chart, VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, null)\n );\n }\n\n /**\n * 获取适配器\n */\n protected getSchemaAdaptor(): Adaptor<LiquidOptions> {\n return adaptor;\n }\n}\n"]}
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { IGroup, IShape } from '@antv/g-base';
|
|
2
|
+
import { ShapeStyle } from '../../../types';
|
|
3
|
+
import { LiquidOptions } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* 添加水波
|
|
6
|
+
* @param x 中心x
|
|
7
|
+
* @param y 中心y
|
|
8
|
+
* @param level 水位等级 0~1
|
|
9
|
+
* @param waveCount 水波数
|
|
10
|
+
* @param waveAttrs 色值
|
|
11
|
+
* @param group 图组
|
|
12
|
+
* @param clip 用于剪切的图形
|
|
13
|
+
* @param radius 绘制图形的高度
|
|
14
|
+
* @param waveLength 波的长度
|
|
15
|
+
*/
|
|
16
|
+
export declare function addWaterWave(x: number, y: number, level: number, waveCount: number, waveAttrs: ShapeStyle, group: IGroup, clip: IShape, radius: number, waveLength: number, animation: LiquidOptions['animation']): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addWaterWave = void 0;
|
|
3
4
|
var tslib_1 = require("tslib");
|
|
4
5
|
var g2_1 = require("@antv/g2");
|
|
5
6
|
var util_1 = require("@antv/util");
|
|
@@ -181,15 +182,19 @@ function getWaterWavePath(radius, waterLevel, waveLength, phase, amplitude, cx,
|
|
|
181
182
|
* @param waveLength 波的长度
|
|
182
183
|
*/
|
|
183
184
|
function addWaterWave(x, y, level, waveCount, waveAttrs, group, clip, radius, waveLength, animation) {
|
|
185
|
+
// 盒子属性 颜色 宽高
|
|
184
186
|
var fill = waveAttrs.fill, opacity = waveAttrs.opacity;
|
|
185
187
|
var bbox = clip.getBBox();
|
|
186
188
|
var width = bbox.maxX - bbox.minX;
|
|
187
189
|
var height = bbox.maxY - bbox.minY;
|
|
190
|
+
// 循环 waveCount 个数
|
|
188
191
|
for (var idx = 0; idx < waveCount; idx++) {
|
|
189
192
|
var factor = waveCount <= 1 ? 0 : idx / (waveCount - 1);
|
|
193
|
+
// 画波
|
|
190
194
|
var wave = group.addShape('path', {
|
|
191
195
|
name: "waterwave-path",
|
|
192
196
|
attrs: {
|
|
197
|
+
// 波形路径配置
|
|
193
198
|
path: getWaterWavePath(radius, bbox.minY + height * level, waveLength, 0, width / 32, // 波幅高度
|
|
194
199
|
x, y),
|
|
195
200
|
fill: fill,
|
|
@@ -197,6 +202,7 @@ function addWaterWave(x, y, level, waveCount, waveAttrs, group, clip, radius, wa
|
|
|
197
202
|
},
|
|
198
203
|
});
|
|
199
204
|
try {
|
|
205
|
+
// 默认 underfind 开启动画
|
|
200
206
|
if (animation === false)
|
|
201
207
|
return;
|
|
202
208
|
var matrix = matrix_1.transform([['t', waveLength, 0]]);
|
|
@@ -212,6 +218,7 @@ function addWaterWave(x, y, level, waveCount, waveAttrs, group, clip, radius, wa
|
|
|
212
218
|
}
|
|
213
219
|
}
|
|
214
220
|
}
|
|
221
|
+
exports.addWaterWave = addWaterWave;
|
|
215
222
|
/**
|
|
216
223
|
*
|
|
217
224
|
* @param x 中心 x
|
|
@@ -286,6 +293,13 @@ function rect(x, y, width, height) {
|
|
|
286
293
|
var w = (width / 2) * GOLDEN_SECTION_RATIO;
|
|
287
294
|
return "\n M " + (x - w) + " " + (y - h) + "\n L " + (x + w) + " " + (y - h) + "\n L " + (x + w) + " " + (y + h) + "\n L " + (x - w) + " " + (y + h) + "\n Z\n ";
|
|
288
295
|
}
|
|
296
|
+
var builtInShapeByName = {
|
|
297
|
+
pin: pin,
|
|
298
|
+
circle: circle,
|
|
299
|
+
diamond: diamond,
|
|
300
|
+
triangle: triangle,
|
|
301
|
+
rect: rect,
|
|
302
|
+
};
|
|
289
303
|
g2_1.registerShape('interval', 'liquid-fill-gauge', {
|
|
290
304
|
draw: function (cfg, container) {
|
|
291
305
|
var cx = 0.5;
|
|
@@ -308,13 +322,6 @@ g2_1.registerShape('interval', 'liquid-fill-gauge', {
|
|
|
308
322
|
var waveAttrs = getFillAttrs(cfg);
|
|
309
323
|
var outlineAttrs = getLineAttrs(util_1.mix({}, cfg, outline));
|
|
310
324
|
var innerRadius = radius - border / 2;
|
|
311
|
-
var builtInShapeByName = {
|
|
312
|
-
pin: pin,
|
|
313
|
-
circle: circle,
|
|
314
|
-
diamond: diamond,
|
|
315
|
-
triangle: triangle,
|
|
316
|
-
rect: rect,
|
|
317
|
-
};
|
|
318
325
|
var buildPath = typeof shape === 'function' ? shape : builtInShapeByName[shape] || builtInShapeByName['circle'];
|
|
319
326
|
var shapePath = buildPath(center.x, center.y, innerRadius * 2, innerRadius * 2);
|
|
320
327
|
// 1. 绘制一个波
|