@antv/g2plot 2.4.22 → 2.4.23
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 +414 -413
- package/dist/g2plot.min.js +17 -2
- package/dist/g2plot.min.js.map +1 -1
- package/esm/adaptor/brush.d.ts +1 -1
- package/esm/adaptor/brush.js +2 -2
- package/esm/adaptor/brush.js.map +1 -1
- package/esm/adaptor/common.d.ts +1 -1
- package/esm/adaptor/common.js +1 -1
- package/esm/adaptor/common.js.map +1 -1
- package/esm/adaptor/connected-area.d.ts +1 -1
- package/esm/adaptor/connected-area.js.map +1 -1
- package/esm/adaptor/conversion-tag.js +1 -1
- package/esm/adaptor/conversion-tag.js.map +1 -1
- package/esm/adaptor/geometries/area.js +1 -1
- package/esm/adaptor/geometries/area.js.map +1 -1
- package/esm/adaptor/geometries/base.d.ts +1 -1
- package/esm/adaptor/geometries/base.js +1 -1
- package/esm/adaptor/geometries/base.js.map +1 -1
- package/esm/adaptor/geometries/edge.d.ts +1 -1
- package/esm/adaptor/geometries/edge.js +1 -1
- package/esm/adaptor/geometries/edge.js.map +1 -1
- package/esm/adaptor/geometries/index.d.ts +5 -5
- package/esm/adaptor/geometries/index.js +2 -2
- package/esm/adaptor/geometries/index.js.map +1 -1
- package/esm/adaptor/geometries/interval.js.map +1 -1
- package/esm/adaptor/geometries/line.js +1 -1
- package/esm/adaptor/geometries/line.js.map +1 -1
- package/esm/adaptor/geometries/point.d.ts +1 -1
- package/esm/adaptor/geometries/point.js +1 -1
- package/esm/adaptor/geometries/point.js.map +1 -1
- package/esm/adaptor/geometries/polygon.d.ts +1 -1
- package/esm/adaptor/geometries/polygon.js +1 -1
- package/esm/adaptor/geometries/polygon.js.map +1 -1
- package/esm/adaptor/geometries/schema.d.ts +1 -1
- package/esm/adaptor/geometries/schema.js +1 -1
- package/esm/adaptor/geometries/schema.js.map +1 -1
- package/esm/adaptor/geometries/violin.d.ts +1 -1
- package/esm/adaptor/geometries/violin.js +1 -1
- package/esm/adaptor/geometries/violin.js.map +1 -1
- package/esm/adaptor/pattern.d.ts +1 -1
- package/esm/adaptor/pattern.js +1 -1
- package/esm/adaptor/pattern.js.map +1 -1
- package/esm/core/plot.d.ts +2 -2
- package/esm/core/plot.js +2 -2
- package/esm/core/plot.js.map +1 -1
- package/esm/index.d.ts +68 -71
- package/esm/index.js +69 -71
- package/esm/index.js.map +1 -1
- package/esm/interactions/actions/drill-down.js +1 -1
- package/esm/interactions/actions/drill-down.js.map +1 -1
- package/esm/interactions/drill-down.js +1 -1
- package/esm/interactions/drill-down.js.map +1 -1
- package/esm/plots/_template/adaptor.js +1 -1
- package/esm/plots/_template/adaptor.js.map +1 -1
- package/esm/plots/_template/index.d.ts +1 -1
- package/esm/plots/_template/index.js.map +1 -1
- package/esm/plots/area/adaptor.js +4 -5
- package/esm/plots/area/adaptor.js.map +1 -1
- package/esm/plots/area/index.d.ts +1 -1
- package/esm/plots/area/index.js.map +1 -1
- package/esm/plots/bar/adaptor.d.ts +1 -1
- package/esm/plots/bar/adaptor.js.map +1 -1
- package/esm/plots/bar/index.d.ts +1 -1
- package/esm/plots/bar/index.js.map +1 -1
- package/esm/plots/bidirectional-bar/adaptor.js +2 -2
- package/esm/plots/bidirectional-bar/adaptor.js.map +1 -1
- package/esm/plots/bidirectional-bar/index.d.ts +1 -1
- package/esm/plots/bidirectional-bar/index.js +3 -3
- package/esm/plots/bidirectional-bar/index.js.map +1 -1
- package/esm/plots/bidirectional-bar/types.d.ts +1 -1
- package/esm/plots/bidirectional-bar/types.js.map +1 -1
- package/esm/plots/bidirectional-bar/utils.js.map +1 -1
- package/esm/plots/box/adaptor.js +2 -2
- package/esm/plots/box/adaptor.js.map +1 -1
- package/esm/plots/box/index.d.ts +1 -1
- package/esm/plots/box/index.js +1 -1
- package/esm/plots/box/index.js.map +1 -1
- package/esm/plots/bullet/adaptor.js +2 -2
- package/esm/plots/bullet/adaptor.js.map +1 -1
- package/esm/plots/bullet/index.d.ts +1 -1
- package/esm/plots/bullet/index.js +1 -1
- package/esm/plots/bullet/index.js.map +1 -1
- package/esm/plots/bullet/types.d.ts +1 -1
- package/esm/plots/bullet/types.js.map +1 -1
- package/esm/plots/chord/adaptor.js +4 -5
- package/esm/plots/chord/adaptor.js.map +1 -1
- package/esm/plots/chord/index.d.ts +1 -1
- package/esm/plots/chord/index.js.map +1 -1
- package/esm/plots/circle-packing/adaptor.js +3 -3
- package/esm/plots/circle-packing/adaptor.js.map +1 -1
- package/esm/plots/circle-packing/index.d.ts +2 -2
- package/esm/plots/circle-packing/index.js.map +1 -1
- package/esm/plots/circle-packing/utils.js +2 -2
- package/esm/plots/circle-packing/utils.js.map +1 -1
- package/esm/plots/column/adaptor.js +4 -4
- package/esm/plots/column/adaptor.js.map +1 -1
- package/esm/plots/column/index.d.ts +1 -1
- package/esm/plots/column/index.js.map +1 -1
- package/esm/plots/column/types.d.ts +2 -2
- package/esm/plots/column/types.js.map +1 -1
- package/esm/plots/dual-axes/adaptor.js +7 -7
- package/esm/plots/dual-axes/adaptor.js.map +1 -1
- package/esm/plots/dual-axes/index.d.ts +1 -1
- package/esm/plots/dual-axes/index.js.map +1 -1
- package/esm/plots/dual-axes/types.d.ts +1 -1
- package/esm/plots/dual-axes/types.js.map +1 -1
- package/esm/plots/dual-axes/util/geometry.js +3 -3
- package/esm/plots/dual-axes/util/geometry.js.map +1 -1
- package/esm/plots/dual-axes/util/legend.d.ts +1 -1
- package/esm/plots/dual-axes/util/legend.js +1 -1
- package/esm/plots/dual-axes/util/legend.js.map +1 -1
- package/esm/plots/dual-axes/util/option.d.ts +1 -1
- package/esm/plots/dual-axes/util/option.js +1 -1
- package/esm/plots/dual-axes/util/option.js.map +1 -1
- package/esm/plots/facet/adaptor.js +1 -1
- package/esm/plots/facet/adaptor.js.map +1 -1
- package/esm/plots/facet/index.d.ts +1 -1
- package/esm/plots/facet/index.js.map +1 -1
- package/esm/plots/facet/types.d.ts +4 -4
- package/esm/plots/facet/types.js.map +1 -1
- package/esm/plots/facet/utils.js +1 -1
- package/esm/plots/facet/utils.js.map +1 -1
- package/esm/plots/funnel/adaptor.js +6 -6
- package/esm/plots/funnel/adaptor.js.map +1 -1
- package/esm/plots/funnel/geometries/basic.js +4 -4
- package/esm/plots/funnel/geometries/basic.js.map +1 -1
- package/esm/plots/funnel/geometries/common.d.ts +1 -1
- package/esm/plots/funnel/geometries/common.js +2 -2
- package/esm/plots/funnel/geometries/common.js.map +1 -1
- package/esm/plots/funnel/geometries/compare.js +4 -4
- package/esm/plots/funnel/geometries/compare.js.map +1 -1
- package/esm/plots/funnel/geometries/dynamic-height.js +3 -3
- package/esm/plots/funnel/geometries/dynamic-height.js.map +1 -1
- package/esm/plots/funnel/geometries/facet.js +1 -1
- package/esm/plots/funnel/geometries/facet.js.map +1 -1
- package/esm/plots/funnel/index.d.ts +3 -3
- package/esm/plots/funnel/index.js.map +1 -1
- package/esm/plots/funnel/interactions/funnel-conversion-tag.js +2 -2
- package/esm/plots/funnel/interactions/funnel-conversion-tag.js.map +1 -1
- package/esm/plots/funnel/types.d.ts +1 -1
- package/esm/plots/funnel/types.js.map +1 -1
- package/esm/plots/gauge/adaptor.js +2 -2
- package/esm/plots/gauge/adaptor.js.map +1 -1
- package/esm/plots/gauge/index.d.ts +2 -2
- package/esm/plots/gauge/index.js +3 -3
- package/esm/plots/gauge/index.js.map +1 -1
- package/esm/plots/gauge/utils.js +1 -1
- package/esm/plots/gauge/utils.js.map +1 -1
- package/esm/plots/heatmap/adaptor.js +2 -3
- package/esm/plots/heatmap/adaptor.js.map +1 -1
- package/esm/plots/heatmap/index.d.ts +2 -2
- package/esm/plots/heatmap/index.js.map +1 -1
- package/esm/plots/heatmap/shapes/circle.js.map +1 -1
- package/esm/plots/heatmap/shapes/square.js.map +1 -1
- package/esm/plots/histogram/adaptor.js +3 -4
- package/esm/plots/histogram/adaptor.js.map +1 -1
- package/esm/plots/histogram/index.d.ts +1 -1
- package/esm/plots/histogram/index.js.map +1 -1
- package/esm/plots/line/adaptor.js +3 -4
- package/esm/plots/line/adaptor.js.map +1 -1
- package/esm/plots/line/index.d.ts +2 -2
- package/esm/plots/line/index.js.map +1 -1
- package/esm/plots/line/interactions/marker-active.js +1 -1
- package/esm/plots/line/interactions/marker-active.js.map +1 -1
- package/esm/plots/line/types.d.ts +1 -1
- package/esm/plots/line/types.js.map +1 -1
- package/esm/plots/liquid/adaptor.js +4 -3
- package/esm/plots/liquid/adaptor.js.map +1 -1
- package/esm/plots/liquid/index.d.ts +2 -2
- package/esm/plots/liquid/index.js +2 -2
- package/esm/plots/liquid/index.js.map +1 -1
- package/esm/plots/liquid/shapes/liquid.js +13 -6
- package/esm/plots/liquid/shapes/liquid.js.map +1 -1
- package/esm/plots/liquid/types.d.ts +6 -1
- package/esm/plots/liquid/types.js.map +1 -1
- package/esm/plots/mix/adaptor.js +2 -2
- package/esm/plots/mix/adaptor.js.map +1 -1
- package/esm/plots/mix/index.d.ts +2 -2
- package/esm/plots/mix/index.js.map +1 -1
- package/esm/plots/mix/interactions/association.js +3 -3
- package/esm/plots/mix/interactions/association.js.map +1 -1
- package/esm/plots/mix/interactions/utils.d.ts +1 -1
- package/esm/plots/mix/interactions/utils.js.map +1 -1
- package/esm/plots/mix/types.d.ts +3 -3
- package/esm/plots/mix/types.js.map +1 -1
- package/esm/plots/mix/utils.d.ts +10 -10
- package/esm/plots/mix/utils.js +22 -22
- package/esm/plots/mix/utils.js.map +1 -1
- package/esm/plots/pie/adaptor.js +5 -5
- package/esm/plots/pie/adaptor.js.map +1 -1
- package/esm/plots/pie/index.d.ts +2 -2
- package/esm/plots/pie/index.js +2 -2
- package/esm/plots/pie/index.js.map +1 -1
- package/esm/plots/pie/interactions/actions/legend-active.js +1 -1
- package/esm/plots/pie/interactions/actions/legend-active.js.map +1 -1
- package/esm/plots/pie/interactions/actions/statistic-active.js.map +1 -1
- package/esm/plots/pie/types.d.ts +1 -1
- package/esm/plots/pie/types.js.map +1 -1
- package/esm/plots/progress/adaptor.js +2 -2
- package/esm/plots/progress/adaptor.js.map +1 -1
- package/esm/plots/progress/index.d.ts +1 -1
- package/esm/plots/progress/index.js.map +1 -1
- package/esm/plots/progress/types.d.ts +1 -1
- package/esm/plots/progress/types.js.map +1 -1
- package/esm/plots/radar/adaptor.js +3 -3
- package/esm/plots/radar/adaptor.js.map +1 -1
- package/esm/plots/radar/index.d.ts +2 -2
- package/esm/plots/radar/index.js.map +1 -1
- package/esm/plots/radar/interactions/radar-tooltip-action.d.ts +1 -1
- package/esm/plots/radar/interactions/radar-tooltip-action.js +1 -1
- package/esm/plots/radar/interactions/radar-tooltip-action.js.map +1 -1
- package/esm/plots/radar/types.d.ts +1 -1
- package/esm/plots/radar/types.js.map +1 -1
- package/esm/plots/radial-bar/adaptor.js +2 -3
- package/esm/plots/radial-bar/adaptor.js.map +1 -1
- package/esm/plots/radial-bar/index.d.ts +1 -1
- package/esm/plots/radial-bar/index.js.map +1 -1
- package/esm/plots/ring-progress/adaptor.js +1 -1
- package/esm/plots/ring-progress/adaptor.js.map +1 -1
- package/esm/plots/ring-progress/index.d.ts +1 -1
- package/esm/plots/ring-progress/index.js +1 -1
- package/esm/plots/ring-progress/index.js.map +1 -1
- package/esm/plots/ring-progress/types.d.ts +1 -1
- package/esm/plots/ring-progress/types.js.map +1 -1
- package/esm/plots/rose/adaptor.js +3 -3
- package/esm/plots/rose/adaptor.js.map +1 -1
- package/esm/plots/rose/index.d.ts +1 -1
- package/esm/plots/rose/index.js.map +1 -1
- package/esm/plots/sankey/adaptor.js +2 -2
- package/esm/plots/sankey/adaptor.js.map +1 -1
- package/esm/plots/sankey/helper.js +1 -1
- package/esm/plots/sankey/helper.js.map +1 -1
- package/esm/plots/sankey/index.d.ts +2 -2
- package/esm/plots/sankey/index.js +1 -1
- package/esm/plots/sankey/index.js.map +1 -1
- package/esm/plots/sankey/interactions/node-draggable.js +1 -1
- package/esm/plots/sankey/interactions/node-draggable.js.map +1 -1
- package/esm/plots/sankey/layout.d.ts +1 -1
- package/esm/plots/sankey/layout.js +2 -2
- package/esm/plots/sankey/layout.js.map +1 -1
- package/esm/plots/sankey/sankey/index.d.ts +1 -1
- package/esm/plots/sankey/sankey/index.js +1 -1
- package/esm/plots/sankey/sankey/index.js.map +1 -1
- package/esm/plots/sankey/sankey/sankey.js +1 -1
- package/esm/plots/sankey/sankey/sankey.js.map +1 -1
- package/esm/plots/scatter/adaptor.js +4 -5
- package/esm/plots/scatter/adaptor.js.map +1 -1
- package/esm/plots/scatter/index.d.ts +2 -2
- package/esm/plots/scatter/index.js +1 -1
- package/esm/plots/scatter/index.js.map +1 -1
- package/esm/plots/scatter/types.d.ts +1 -1
- package/esm/plots/scatter/types.js.map +1 -1
- package/esm/plots/scatter/util.js +2 -2
- package/esm/plots/scatter/util.js.map +1 -1
- package/esm/plots/stock/adaptor.js +3 -3
- package/esm/plots/stock/adaptor.js.map +1 -1
- package/esm/plots/stock/index.d.ts +1 -1
- package/esm/plots/stock/index.js +1 -1
- package/esm/plots/stock/index.js.map +1 -1
- package/esm/plots/stock/utils.js +1 -1
- package/esm/plots/stock/utils.js.map +1 -1
- package/esm/plots/sunburst/adaptor.js +3 -3
- package/esm/plots/sunburst/adaptor.js.map +1 -1
- package/esm/plots/sunburst/index.d.ts +2 -2
- package/esm/plots/sunburst/index.js.map +1 -1
- package/esm/plots/tiny-area/adaptor.js +3 -3
- package/esm/plots/tiny-area/adaptor.js.map +1 -1
- package/esm/plots/tiny-area/index.d.ts +1 -1
- package/esm/plots/tiny-area/index.js.map +1 -1
- package/esm/plots/tiny-area/types.d.ts +1 -1
- package/esm/plots/tiny-area/types.js.map +1 -1
- package/esm/plots/tiny-column/adaptor.js +3 -3
- package/esm/plots/tiny-column/adaptor.js.map +1 -1
- package/esm/plots/tiny-line/adaptor.js +3 -3
- package/esm/plots/tiny-line/adaptor.js.map +1 -1
- package/esm/plots/tiny-line/index.d.ts +1 -1
- package/esm/plots/tiny-line/index.js.map +1 -1
- package/esm/plots/tiny-line/types.d.ts +1 -1
- package/esm/plots/tiny-line/types.js.map +1 -1
- package/esm/plots/treemap/adaptor.js +3 -3
- package/esm/plots/treemap/adaptor.js.map +1 -1
- package/esm/plots/treemap/index.d.ts +2 -2
- package/esm/plots/treemap/index.js +1 -1
- package/esm/plots/treemap/index.js.map +1 -1
- package/esm/plots/treemap/utils.js +1 -1
- package/esm/plots/treemap/utils.js.map +1 -1
- package/esm/plots/venn/adaptor.d.ts +3 -3
- package/esm/plots/venn/adaptor.js +6 -7
- package/esm/plots/venn/adaptor.js.map +1 -1
- package/esm/plots/venn/index.d.ts +1 -1
- package/esm/plots/venn/index.js.map +1 -1
- package/esm/plots/venn/interactions/index.js +1 -1
- package/esm/plots/venn/interactions/index.js.map +1 -1
- package/esm/plots/venn/label.js +1 -1
- package/esm/plots/venn/label.js.map +1 -1
- package/esm/plots/venn/layout/diagram.js +1 -1
- package/esm/plots/venn/layout/diagram.js.map +1 -1
- package/esm/plots/venn/layout/layout.js +2 -2
- package/esm/plots/venn/layout/layout.js.map +1 -1
- package/esm/plots/venn/shape.js.map +1 -1
- package/esm/plots/venn/utils.js +3 -3
- package/esm/plots/venn/utils.js.map +1 -1
- package/esm/plots/violin/adaptor.js +5 -5
- package/esm/plots/violin/adaptor.js.map +1 -1
- package/esm/plots/violin/index.d.ts +1 -1
- package/esm/plots/violin/index.js.map +1 -1
- package/esm/plots/violin/utils.js +1 -1
- package/esm/plots/violin/utils.js.map +1 -1
- package/esm/plots/waterfall/adaptor.d.ts +1 -1
- package/esm/plots/waterfall/adaptor.js +4 -4
- package/esm/plots/waterfall/adaptor.js.map +1 -1
- package/esm/plots/waterfall/index.d.ts +1 -1
- package/esm/plots/waterfall/index.js.map +1 -1
- package/esm/plots/waterfall/shape.js.map +1 -1
- package/esm/plots/waterfall/utils.js +1 -1
- package/esm/plots/waterfall/utils.js.map +1 -1
- package/esm/plots/word-cloud/adaptor.js +4 -4
- package/esm/plots/word-cloud/adaptor.js.map +1 -1
- package/esm/plots/word-cloud/index.d.ts +2 -2
- package/esm/plots/word-cloud/index.js +1 -1
- package/esm/plots/word-cloud/index.js.map +1 -1
- package/esm/plots/word-cloud/shapes/word-cloud.js.map +1 -1
- package/esm/plots/word-cloud/utils.js +1 -1
- package/esm/plots/word-cloud/utils.js.map +1 -1
- package/esm/plugin/index.d.ts +1 -1
- package/esm/plugin/index.js +1 -1
- package/esm/plugin/index.js.map +1 -1
- package/esm/types/common.d.ts +8 -8
- package/esm/types/common.js.map +1 -1
- package/esm/types/index.d.ts +7 -7
- package/esm/types/index.js +7 -7
- package/esm/types/index.js.map +1 -1
- package/esm/types/state.d.ts +2 -2
- package/esm/types/state.js.map +1 -1
- package/esm/utils/data.js +1 -1
- package/esm/utils/data.js.map +1 -1
- package/esm/utils/geometry.d.ts +1 -1
- package/esm/utils/geometry.js +1 -1
- package/esm/utils/geometry.js.map +1 -1
- package/esm/utils/hierarchy/pack.js +2 -2
- package/esm/utils/hierarchy/pack.js.map +1 -1
- package/esm/utils/hierarchy/partition.js +2 -2
- package/esm/utils/hierarchy/partition.js.map +1 -1
- package/esm/utils/hierarchy/treemap.js +2 -2
- package/esm/utils/hierarchy/treemap.js.map +1 -1
- package/esm/utils/hierarchy/util.js +1 -1
- package/esm/utils/hierarchy/util.js.map +1 -1
- package/esm/utils/index.d.ts +10 -11
- package/esm/utils/index.js +10 -11
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/padding.js +1 -1
- package/esm/utils/padding.js.map +1 -1
- package/esm/utils/path.d.ts +1 -1
- package/esm/utils/path.js.map +1 -1
- package/esm/utils/pattern/dot.js +1 -1
- package/esm/utils/pattern/dot.js.map +1 -1
- package/esm/utils/pattern/line.js +1 -1
- package/esm/utils/pattern/line.js.map +1 -1
- package/esm/utils/pattern/square.js +1 -1
- package/esm/utils/pattern/square.js.map +1 -1
- package/esm/utils/statistic.js +3 -2
- package/esm/utils/statistic.js.map +1 -1
- package/esm/utils/transform/histogram.js +1 -1
- package/esm/utils/transform/histogram.js.map +1 -1
- package/esm/utils/transform/word-cloud.js +1 -1
- package/esm/utils/transform/word-cloud.js.map +1 -1
- package/esm/utils/view.d.ts +1 -1
- package/esm/utils/view.js.map +1 -1
- package/lib/adaptor/brush.d.ts +1 -1
- package/lib/adaptor/brush.js +2 -2
- package/lib/adaptor/brush.js.map +1 -1
- package/lib/adaptor/common.d.ts +1 -1
- package/lib/adaptor/common.js.map +1 -1
- package/lib/adaptor/connected-area.d.ts +1 -1
- package/lib/adaptor/connected-area.js.map +1 -1
- package/lib/adaptor/conversion-tag.js +1 -1
- package/lib/adaptor/conversion-tag.js.map +1 -1
- package/lib/adaptor/geometries/area.js +1 -1
- package/lib/adaptor/geometries/area.js.map +1 -1
- package/lib/adaptor/geometries/base.d.ts +1 -1
- package/lib/adaptor/geometries/base.js.map +1 -1
- package/lib/adaptor/geometries/edge.d.ts +1 -1
- package/lib/adaptor/geometries/edge.js +1 -1
- package/lib/adaptor/geometries/edge.js.map +1 -1
- package/lib/adaptor/geometries/index.d.ts +5 -5
- package/lib/adaptor/geometries/index.js +4 -4
- package/lib/adaptor/geometries/index.js.map +1 -1
- package/lib/adaptor/geometries/interval.js.map +1 -1
- package/lib/adaptor/geometries/line.js +1 -1
- package/lib/adaptor/geometries/line.js.map +1 -1
- package/lib/adaptor/geometries/point.d.ts +1 -1
- package/lib/adaptor/geometries/point.js +1 -1
- package/lib/adaptor/geometries/point.js.map +1 -1
- package/lib/adaptor/geometries/polygon.d.ts +1 -1
- package/lib/adaptor/geometries/polygon.js +1 -1
- package/lib/adaptor/geometries/polygon.js.map +1 -1
- package/lib/adaptor/geometries/schema.d.ts +1 -1
- package/lib/adaptor/geometries/schema.js +1 -1
- package/lib/adaptor/geometries/schema.js.map +1 -1
- package/lib/adaptor/geometries/violin.d.ts +1 -1
- package/lib/adaptor/geometries/violin.js +1 -1
- package/lib/adaptor/geometries/violin.js.map +1 -1
- package/lib/adaptor/pattern.d.ts +1 -1
- package/lib/adaptor/pattern.js +1 -1
- package/lib/adaptor/pattern.js.map +1 -1
- package/lib/core/plot.d.ts +2 -2
- package/lib/core/plot.js +1 -1
- package/lib/core/plot.js.map +1 -1
- package/lib/index.d.ts +68 -71
- package/lib/index.js +103 -105
- package/lib/index.js.map +1 -1
- package/lib/interactions/actions/drill-down.js.map +1 -1
- package/lib/interactions/drill-down.js.map +1 -1
- package/lib/plots/_template/adaptor.js.map +1 -1
- package/lib/plots/_template/index.d.ts +1 -1
- package/lib/plots/_template/index.js.map +1 -1
- package/lib/plots/area/adaptor.js +6 -7
- package/lib/plots/area/adaptor.js.map +1 -1
- package/lib/plots/area/index.d.ts +1 -1
- package/lib/plots/area/index.js.map +1 -1
- package/lib/plots/bar/adaptor.d.ts +1 -1
- package/lib/plots/bar/adaptor.js.map +1 -1
- package/lib/plots/bar/index.d.ts +1 -1
- package/lib/plots/bar/index.js.map +1 -1
- package/lib/plots/bidirectional-bar/adaptor.js.map +1 -1
- package/lib/plots/bidirectional-bar/index.d.ts +1 -1
- package/lib/plots/bidirectional-bar/index.js +1 -1
- package/lib/plots/bidirectional-bar/index.js.map +1 -1
- package/lib/plots/bidirectional-bar/types.d.ts +1 -1
- package/lib/plots/bidirectional-bar/types.js.map +1 -1
- package/lib/plots/bidirectional-bar/utils.js.map +1 -1
- package/lib/plots/box/adaptor.js +1 -1
- package/lib/plots/box/adaptor.js.map +1 -1
- package/lib/plots/box/index.d.ts +1 -1
- package/lib/plots/box/index.js +1 -1
- package/lib/plots/box/index.js.map +1 -1
- package/lib/plots/bullet/adaptor.js +1 -1
- package/lib/plots/bullet/adaptor.js.map +1 -1
- package/lib/plots/bullet/index.d.ts +1 -1
- package/lib/plots/bullet/index.js +1 -1
- package/lib/plots/bullet/index.js.map +1 -1
- package/lib/plots/bullet/types.d.ts +1 -1
- package/lib/plots/bullet/types.js.map +1 -1
- package/lib/plots/chord/adaptor.js +3 -4
- package/lib/plots/chord/adaptor.js.map +1 -1
- package/lib/plots/chord/index.d.ts +1 -1
- package/lib/plots/chord/index.js.map +1 -1
- package/lib/plots/circle-packing/adaptor.js +2 -2
- package/lib/plots/circle-packing/adaptor.js.map +1 -1
- package/lib/plots/circle-packing/index.d.ts +2 -2
- package/lib/plots/circle-packing/index.js.map +1 -1
- package/lib/plots/circle-packing/utils.js +2 -2
- package/lib/plots/circle-packing/utils.js.map +1 -1
- package/lib/plots/column/adaptor.js +2 -2
- package/lib/plots/column/adaptor.js.map +1 -1
- package/lib/plots/column/index.d.ts +1 -1
- package/lib/plots/column/index.js.map +1 -1
- package/lib/plots/column/types.d.ts +2 -2
- package/lib/plots/column/types.js.map +1 -1
- package/lib/plots/dual-axes/adaptor.js +5 -5
- package/lib/plots/dual-axes/adaptor.js.map +1 -1
- package/lib/plots/dual-axes/index.d.ts +1 -1
- package/lib/plots/dual-axes/index.js.map +1 -1
- package/lib/plots/dual-axes/types.d.ts +1 -1
- package/lib/plots/dual-axes/types.js.map +1 -1
- package/lib/plots/dual-axes/util/geometry.js.map +1 -1
- package/lib/plots/dual-axes/util/legend.d.ts +1 -1
- package/lib/plots/dual-axes/util/legend.js +1 -1
- package/lib/plots/dual-axes/util/legend.js.map +1 -1
- package/lib/plots/dual-axes/util/option.d.ts +1 -1
- package/lib/plots/dual-axes/util/option.js +1 -1
- package/lib/plots/dual-axes/util/option.js.map +1 -1
- package/lib/plots/facet/adaptor.js.map +1 -1
- package/lib/plots/facet/index.d.ts +1 -1
- package/lib/plots/facet/index.js.map +1 -1
- package/lib/plots/facet/types.d.ts +4 -4
- package/lib/plots/facet/types.js.map +1 -1
- package/lib/plots/facet/utils.js.map +1 -1
- package/lib/plots/funnel/adaptor.js +2 -2
- package/lib/plots/funnel/adaptor.js.map +1 -1
- package/lib/plots/funnel/geometries/basic.js +1 -1
- package/lib/plots/funnel/geometries/basic.js.map +1 -1
- package/lib/plots/funnel/geometries/common.d.ts +1 -1
- package/lib/plots/funnel/geometries/common.js.map +1 -1
- package/lib/plots/funnel/geometries/compare.js +1 -1
- package/lib/plots/funnel/geometries/compare.js.map +1 -1
- package/lib/plots/funnel/geometries/dynamic-height.js +2 -2
- package/lib/plots/funnel/geometries/dynamic-height.js.map +1 -1
- package/lib/plots/funnel/geometries/facet.js.map +1 -1
- package/lib/plots/funnel/index.d.ts +3 -3
- package/lib/plots/funnel/index.js.map +1 -1
- package/lib/plots/funnel/interactions/funnel-conversion-tag.js +2 -2
- package/lib/plots/funnel/interactions/funnel-conversion-tag.js.map +1 -1
- package/lib/plots/funnel/types.d.ts +1 -1
- package/lib/plots/funnel/types.js.map +1 -1
- package/lib/plots/gauge/adaptor.js.map +1 -1
- package/lib/plots/gauge/index.d.ts +2 -2
- package/lib/plots/gauge/index.js +1 -1
- package/lib/plots/gauge/index.js.map +1 -1
- package/lib/plots/gauge/utils.js.map +1 -1
- package/lib/plots/heatmap/adaptor.js +4 -5
- package/lib/plots/heatmap/adaptor.js.map +1 -1
- package/lib/plots/heatmap/index.d.ts +2 -2
- package/lib/plots/heatmap/index.js.map +1 -1
- package/lib/plots/heatmap/shapes/circle.js.map +1 -1
- package/lib/plots/heatmap/shapes/square.js.map +1 -1
- package/lib/plots/histogram/adaptor.js +4 -5
- package/lib/plots/histogram/adaptor.js.map +1 -1
- package/lib/plots/histogram/index.d.ts +1 -1
- package/lib/plots/histogram/index.js.map +1 -1
- package/lib/plots/line/adaptor.js +3 -4
- package/lib/plots/line/adaptor.js.map +1 -1
- package/lib/plots/line/index.d.ts +2 -2
- package/lib/plots/line/index.js.map +1 -1
- package/lib/plots/line/interactions/marker-active.js +1 -1
- package/lib/plots/line/interactions/marker-active.js.map +1 -1
- package/lib/plots/line/types.d.ts +1 -1
- package/lib/plots/line/types.js.map +1 -1
- package/lib/plots/liquid/adaptor.js +3 -2
- package/lib/plots/liquid/adaptor.js.map +1 -1
- package/lib/plots/liquid/index.d.ts +2 -2
- package/lib/plots/liquid/index.js +1 -1
- package/lib/plots/liquid/index.js.map +1 -1
- package/lib/plots/liquid/shapes/liquid.js +12 -5
- package/lib/plots/liquid/shapes/liquid.js.map +1 -1
- package/lib/plots/liquid/types.d.ts +6 -1
- package/lib/plots/liquid/types.js.map +1 -1
- package/lib/plots/mix/adaptor.js +2 -2
- package/lib/plots/mix/adaptor.js.map +1 -1
- package/lib/plots/mix/index.d.ts +2 -2
- package/lib/plots/mix/index.js.map +1 -1
- package/lib/plots/mix/interactions/association.js +1 -1
- package/lib/plots/mix/interactions/association.js.map +1 -1
- package/lib/plots/mix/interactions/utils.d.ts +1 -1
- package/lib/plots/mix/interactions/utils.js.map +1 -1
- package/lib/plots/mix/types.d.ts +3 -3
- package/lib/plots/mix/types.js.map +1 -1
- package/lib/plots/mix/utils.d.ts +10 -10
- package/lib/plots/mix/utils.js +37 -37
- package/lib/plots/mix/utils.js.map +1 -1
- package/lib/plots/pie/adaptor.js +2 -2
- package/lib/plots/pie/adaptor.js.map +1 -1
- package/lib/plots/pie/index.d.ts +2 -2
- package/lib/plots/pie/index.js +1 -1
- package/lib/plots/pie/index.js.map +1 -1
- package/lib/plots/pie/interactions/actions/legend-active.js.map +1 -1
- package/lib/plots/pie/interactions/actions/statistic-active.js.map +1 -1
- package/lib/plots/pie/types.d.ts +1 -1
- package/lib/plots/pie/types.js.map +1 -1
- package/lib/plots/progress/adaptor.js +1 -1
- package/lib/plots/progress/adaptor.js.map +1 -1
- package/lib/plots/progress/index.d.ts +1 -1
- package/lib/plots/progress/index.js.map +1 -1
- package/lib/plots/progress/types.d.ts +1 -1
- package/lib/plots/progress/types.js.map +1 -1
- package/lib/plots/radar/adaptor.js.map +1 -1
- package/lib/plots/radar/index.d.ts +2 -2
- package/lib/plots/radar/index.js.map +1 -1
- package/lib/plots/radar/interactions/radar-tooltip-action.d.ts +1 -1
- package/lib/plots/radar/interactions/radar-tooltip-action.js.map +1 -1
- package/lib/plots/radar/types.d.ts +1 -1
- package/lib/plots/radar/types.js.map +1 -1
- package/lib/plots/radial-bar/adaptor.js +6 -7
- package/lib/plots/radial-bar/adaptor.js.map +1 -1
- package/lib/plots/radial-bar/index.d.ts +1 -1
- package/lib/plots/radial-bar/index.js.map +1 -1
- package/lib/plots/ring-progress/adaptor.js +1 -1
- package/lib/plots/ring-progress/adaptor.js.map +1 -1
- package/lib/plots/ring-progress/index.d.ts +1 -1
- package/lib/plots/ring-progress/index.js.map +1 -1
- package/lib/plots/ring-progress/types.d.ts +1 -1
- package/lib/plots/ring-progress/types.js.map +1 -1
- package/lib/plots/rose/adaptor.js +1 -1
- package/lib/plots/rose/adaptor.js.map +1 -1
- package/lib/plots/rose/index.d.ts +1 -1
- package/lib/plots/rose/index.js.map +1 -1
- package/lib/plots/sankey/adaptor.js +2 -2
- package/lib/plots/sankey/adaptor.js.map +1 -1
- package/lib/plots/sankey/helper.js +1 -1
- package/lib/plots/sankey/helper.js.map +1 -1
- package/lib/plots/sankey/index.d.ts +2 -2
- package/lib/plots/sankey/index.js +1 -1
- package/lib/plots/sankey/index.js.map +1 -1
- package/lib/plots/sankey/interactions/node-draggable.js.map +1 -1
- package/lib/plots/sankey/layout.d.ts +1 -1
- package/lib/plots/sankey/layout.js.map +1 -1
- package/lib/plots/sankey/sankey/index.d.ts +1 -1
- package/lib/plots/sankey/sankey/index.js +1 -1
- package/lib/plots/sankey/sankey/index.js.map +1 -1
- package/lib/plots/sankey/sankey/sankey.js.map +1 -1
- package/lib/plots/scatter/adaptor.js +5 -6
- package/lib/plots/scatter/adaptor.js.map +1 -1
- package/lib/plots/scatter/index.d.ts +2 -2
- package/lib/plots/scatter/index.js.map +1 -1
- package/lib/plots/scatter/types.d.ts +1 -1
- package/lib/plots/scatter/types.js.map +1 -1
- package/lib/plots/scatter/util.js +1 -1
- package/lib/plots/scatter/util.js.map +1 -1
- package/lib/plots/stock/adaptor.js +1 -1
- package/lib/plots/stock/adaptor.js.map +1 -1
- package/lib/plots/stock/index.d.ts +1 -1
- package/lib/plots/stock/index.js +1 -1
- package/lib/plots/stock/index.js.map +1 -1
- package/lib/plots/stock/utils.js.map +1 -1
- package/lib/plots/sunburst/adaptor.js +1 -1
- package/lib/plots/sunburst/adaptor.js.map +1 -1
- package/lib/plots/sunburst/index.d.ts +2 -2
- package/lib/plots/sunburst/index.js.map +1 -1
- package/lib/plots/tiny-area/adaptor.js +2 -2
- package/lib/plots/tiny-area/adaptor.js.map +1 -1
- package/lib/plots/tiny-area/index.d.ts +1 -1
- package/lib/plots/tiny-area/index.js.map +1 -1
- package/lib/plots/tiny-area/types.d.ts +1 -1
- package/lib/plots/tiny-area/types.js.map +1 -1
- package/lib/plots/tiny-column/adaptor.js +3 -3
- package/lib/plots/tiny-column/adaptor.js.map +1 -1
- package/lib/plots/tiny-line/adaptor.js +2 -2
- package/lib/plots/tiny-line/adaptor.js.map +1 -1
- package/lib/plots/tiny-line/index.d.ts +1 -1
- package/lib/plots/tiny-line/index.js.map +1 -1
- package/lib/plots/tiny-line/types.d.ts +1 -1
- package/lib/plots/tiny-line/types.js.map +1 -1
- package/lib/plots/treemap/adaptor.js +1 -1
- package/lib/plots/treemap/adaptor.js.map +1 -1
- package/lib/plots/treemap/index.d.ts +2 -2
- package/lib/plots/treemap/index.js +1 -1
- package/lib/plots/treemap/index.js.map +1 -1
- package/lib/plots/treemap/utils.js.map +1 -1
- package/lib/plots/venn/adaptor.d.ts +3 -3
- package/lib/plots/venn/adaptor.js +8 -9
- package/lib/plots/venn/adaptor.js.map +1 -1
- package/lib/plots/venn/index.d.ts +1 -1
- package/lib/plots/venn/index.js.map +1 -1
- package/lib/plots/venn/interactions/index.js.map +1 -1
- package/lib/plots/venn/label.js.map +1 -1
- package/lib/plots/venn/layout/diagram.js.map +1 -1
- package/lib/plots/venn/layout/layout.js.map +1 -1
- package/lib/plots/venn/shape.js.map +1 -1
- package/lib/plots/venn/utils.js +3 -3
- package/lib/plots/venn/utils.js.map +1 -1
- package/lib/plots/violin/adaptor.js +2 -2
- package/lib/plots/violin/adaptor.js.map +1 -1
- package/lib/plots/violin/index.d.ts +1 -1
- package/lib/plots/violin/index.js.map +1 -1
- package/lib/plots/violin/utils.js.map +1 -1
- package/lib/plots/waterfall/adaptor.d.ts +1 -1
- package/lib/plots/waterfall/adaptor.js +1 -1
- package/lib/plots/waterfall/adaptor.js.map +1 -1
- package/lib/plots/waterfall/index.d.ts +1 -1
- package/lib/plots/waterfall/index.js.map +1 -1
- package/lib/plots/waterfall/shape.js.map +1 -1
- package/lib/plots/waterfall/utils.js.map +1 -1
- package/lib/plots/word-cloud/adaptor.js +2 -2
- package/lib/plots/word-cloud/adaptor.js.map +1 -1
- package/lib/plots/word-cloud/index.d.ts +2 -2
- package/lib/plots/word-cloud/index.js +1 -1
- package/lib/plots/word-cloud/index.js.map +1 -1
- package/lib/plots/word-cloud/shapes/word-cloud.js.map +1 -1
- package/lib/plots/word-cloud/utils.js +1 -1
- package/lib/plots/word-cloud/utils.js.map +1 -1
- package/lib/plugin/index.d.ts +1 -1
- package/lib/plugin/index.js +1 -1
- package/lib/plugin/index.js.map +1 -1
- package/lib/types/common.d.ts +8 -8
- package/lib/types/common.js.map +1 -1
- package/lib/types/index.d.ts +7 -7
- package/lib/types/index.js +7 -7
- package/lib/types/index.js.map +1 -1
- package/lib/types/state.d.ts +2 -2
- package/lib/types/state.js.map +1 -1
- package/lib/utils/data.js.map +1 -1
- package/lib/utils/geometry.d.ts +1 -1
- package/lib/utils/geometry.js.map +1 -1
- package/lib/utils/hierarchy/pack.js +1 -1
- package/lib/utils/hierarchy/pack.js.map +1 -1
- package/lib/utils/hierarchy/partition.js +1 -1
- package/lib/utils/hierarchy/partition.js.map +1 -1
- package/lib/utils/hierarchy/treemap.js +1 -1
- package/lib/utils/hierarchy/treemap.js.map +1 -1
- package/lib/utils/hierarchy/util.js.map +1 -1
- package/lib/utils/index.d.ts +10 -11
- package/lib/utils/index.js +23 -24
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/padding.js.map +1 -1
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js.map +1 -1
- package/lib/utils/pattern/dot.js.map +1 -1
- package/lib/utils/pattern/line.js.map +1 -1
- package/lib/utils/pattern/square.js.map +1 -1
- package/lib/utils/statistic.js +8 -7
- package/lib/utils/statistic.js.map +1 -1
- package/lib/utils/transform/histogram.js.map +1 -1
- package/lib/utils/transform/word-cloud.js.map +1 -1
- package/lib/utils/view.d.ts +1 -1
- package/lib/utils/view.js.map +1 -1
- package/package.json +8 -23
- package/src/adaptor/brush.ts +3 -4
- package/src/adaptor/common.ts +4 -4
- package/src/adaptor/connected-area.ts +1 -1
- package/src/adaptor/conversion-tag.ts +3 -3
- package/src/adaptor/geometries/area.ts +2 -2
- package/src/adaptor/geometries/base.ts +2 -2
- package/src/adaptor/geometries/edge.ts +2 -2
- package/src/adaptor/geometries/index.ts +5 -5
- package/src/adaptor/geometries/interval.ts +1 -1
- package/src/adaptor/geometries/line.ts +2 -2
- package/src/adaptor/geometries/point.ts +2 -2
- package/src/adaptor/geometries/polygon.ts +2 -2
- package/src/adaptor/geometries/schema.ts +2 -2
- package/src/adaptor/geometries/violin.ts +2 -2
- package/src/adaptor/pattern.ts +1 -1
- package/src/core/plot.ts +4 -4
- package/src/index.ts +105 -151
- package/src/interactions/actions/drill-down.ts +1 -1
- package/src/interactions/drill-down.ts +1 -1
- package/src/plots/_template/adaptor.ts +1 -1
- package/src/plots/_template/index.ts +2 -2
- package/src/plots/area/adaptor.ts +8 -9
- package/src/plots/area/index.ts +2 -2
- package/src/plots/bar/adaptor.ts +3 -3
- package/src/plots/bar/index.ts +2 -2
- package/src/plots/bidirectional-bar/adaptor.ts +6 -6
- package/src/plots/bidirectional-bar/index.ts +5 -5
- package/src/plots/bidirectional-bar/types.ts +1 -1
- package/src/plots/bidirectional-bar/utils.ts +1 -1
- package/src/plots/box/adaptor.ts +5 -5
- package/src/plots/box/index.ts +3 -3
- package/src/plots/bullet/adaptor.ts +3 -3
- package/src/plots/bullet/index.ts +3 -3
- package/src/plots/bullet/types.ts +1 -1
- package/src/plots/chord/adaptor.ts +4 -5
- package/src/plots/chord/index.ts +1 -1
- package/src/plots/circle-packing/adaptor.ts +10 -10
- package/src/plots/circle-packing/index.ts +2 -2
- package/src/plots/circle-packing/utils.ts +2 -2
- package/src/plots/column/adaptor.ts +10 -10
- package/src/plots/column/index.ts +2 -2
- package/src/plots/column/types.ts +2 -2
- package/src/plots/dual-axes/adaptor.ts +11 -11
- package/src/plots/dual-axes/index.ts +2 -2
- package/src/plots/dual-axes/types.ts +1 -1
- package/src/plots/dual-axes/util/geometry.ts +4 -4
- package/src/plots/dual-axes/util/legend.ts +3 -3
- package/src/plots/dual-axes/util/option.ts +5 -5
- package/src/plots/facet/adaptor.ts +2 -2
- package/src/plots/facet/index.ts +1 -1
- package/src/plots/facet/types.ts +4 -5
- package/src/plots/facet/utils.ts +1 -1
- package/src/plots/funnel/adaptor.ts +7 -7
- package/src/plots/funnel/geometries/basic.ts +6 -6
- package/src/plots/funnel/geometries/common.ts +3 -3
- package/src/plots/funnel/geometries/compare.ts +5 -5
- package/src/plots/funnel/geometries/dynamic-height.ts +5 -5
- package/src/plots/funnel/geometries/facet.ts +1 -1
- package/src/plots/funnel/index.ts +4 -5
- package/src/plots/funnel/interactions/funnel-conversion-tag.ts +2 -2
- package/src/plots/funnel/types.ts +1 -1
- package/src/plots/gauge/adaptor.ts +2 -2
- package/src/plots/gauge/index.ts +5 -6
- package/src/plots/gauge/utils.ts +2 -2
- package/src/plots/heatmap/adaptor.ts +3 -4
- package/src/plots/heatmap/index.ts +2 -2
- package/src/plots/heatmap/shapes/circle.ts +1 -1
- package/src/plots/heatmap/shapes/square.ts +1 -1
- package/src/plots/histogram/adaptor.ts +5 -6
- package/src/plots/histogram/index.ts +2 -2
- package/src/plots/line/adaptor.ts +8 -9
- package/src/plots/line/index.ts +2 -2
- package/src/plots/line/interactions/marker-active.ts +1 -1
- package/src/plots/line/types.ts +1 -1
- package/src/plots/liquid/adaptor.ts +6 -5
- package/src/plots/liquid/index.ts +4 -5
- package/src/plots/liquid/shapes/liquid.ts +20 -9
- package/src/plots/liquid/types.ts +6 -1
- package/src/plots/mix/adaptor.ts +6 -6
- package/src/plots/mix/index.ts +2 -2
- package/src/plots/mix/interactions/association.ts +3 -3
- package/src/plots/mix/interactions/utils.ts +1 -1
- package/src/plots/mix/types.ts +3 -3
- package/src/plots/mix/utils.ts +23 -23
- package/src/plots/pie/adaptor.ts +7 -7
- package/src/plots/pie/index.ts +3 -3
- package/src/plots/pie/interactions/actions/legend-active.ts +1 -1
- package/src/plots/pie/interactions/actions/statistic-active.ts +1 -1
- package/src/plots/pie/types.ts +1 -1
- package/src/plots/progress/adaptor.ts +4 -4
- package/src/plots/progress/index.ts +2 -2
- package/src/plots/progress/types.ts +1 -1
- package/src/plots/radar/adaptor.ts +3 -3
- package/src/plots/radar/index.ts +2 -2
- package/src/plots/radar/interactions/radar-tooltip-action.ts +1 -1
- package/src/plots/radar/types.ts +1 -1
- package/src/plots/radial-bar/adaptor.ts +3 -4
- package/src/plots/radial-bar/index.ts +2 -2
- package/src/plots/ring-progress/adaptor.ts +1 -1
- package/src/plots/ring-progress/index.ts +3 -3
- package/src/plots/ring-progress/types.ts +1 -1
- package/src/plots/rose/adaptor.ts +4 -4
- package/src/plots/rose/index.ts +2 -2
- package/src/plots/sankey/adaptor.ts +2 -2
- package/src/plots/sankey/helper.ts +2 -2
- package/src/plots/sankey/index.ts +3 -3
- package/src/plots/sankey/interactions/node-draggable.ts +1 -1
- package/src/plots/sankey/layout.ts +2 -2
- package/src/plots/sankey/sankey/index.ts +1 -1
- package/src/plots/sankey/sankey/sankey.ts +1 -1
- package/src/plots/scatter/adaptor.ts +5 -6
- package/src/plots/scatter/index.ts +3 -3
- package/src/plots/scatter/types.ts +5 -5
- package/src/plots/scatter/util.ts +3 -3
- package/src/plots/stock/adaptor.ts +4 -5
- package/src/plots/stock/index.ts +3 -3
- package/src/plots/stock/utils.ts +1 -1
- package/src/plots/sunburst/adaptor.ts +10 -10
- package/src/plots/sunburst/index.ts +2 -2
- package/src/plots/tiny-area/adaptor.ts +4 -4
- package/src/plots/tiny-area/index.ts +2 -2
- package/src/plots/tiny-area/types.ts +1 -1
- package/src/plots/tiny-column/adaptor.ts +4 -4
- package/src/plots/tiny-line/adaptor.ts +5 -5
- package/src/plots/tiny-line/index.ts +2 -2
- package/src/plots/tiny-line/types.ts +1 -1
- package/src/plots/treemap/adaptor.ts +4 -4
- package/src/plots/treemap/index.ts +3 -3
- package/src/plots/treemap/utils.ts +1 -1
- package/src/plots/venn/adaptor.ts +12 -11
- package/src/plots/venn/index.ts +2 -2
- package/src/plots/venn/interactions/index.ts +1 -1
- package/src/plots/venn/label.ts +1 -1
- package/src/plots/venn/layout/diagram.ts +1 -1
- package/src/plots/venn/layout/layout.ts +2 -2
- package/src/plots/venn/shape.ts +2 -2
- package/src/plots/venn/utils.ts +3 -3
- package/src/plots/violin/adaptor.ts +7 -7
- package/src/plots/violin/index.ts +2 -2
- package/src/plots/violin/utils.ts +1 -1
- package/src/plots/waterfall/adaptor.ts +6 -6
- package/src/plots/waterfall/index.ts +2 -2
- package/src/plots/waterfall/shape.ts +2 -3
- package/src/plots/waterfall/utils.ts +1 -1
- package/src/plots/word-cloud/adaptor.ts +5 -5
- package/src/plots/word-cloud/index.ts +3 -3
- package/src/plots/word-cloud/shapes/word-cloud.ts +1 -1
- package/src/plots/word-cloud/utils.ts +3 -4
- package/src/plugin/index.ts +2 -2
- package/src/types/common.ts +8 -8
- package/src/types/index.ts +7 -7
- package/src/types/state.ts +2 -2
- package/src/utils/data.ts +1 -1
- package/src/utils/geometry.ts +2 -2
- package/src/utils/hierarchy/pack.ts +2 -2
- package/src/utils/hierarchy/partition.ts +2 -2
- package/src/utils/hierarchy/treemap.ts +2 -2
- package/src/utils/hierarchy/util.ts +1 -1
- package/src/utils/index.ts +10 -11
- package/src/utils/padding.ts +1 -1
- package/src/utils/path.ts +1 -1
- package/src/utils/pattern/dot.ts +3 -3
- package/src/utils/pattern/line.ts +1 -1
- package/src/utils/pattern/square.ts +3 -3
- package/src/utils/statistic.ts +4 -3
- package/src/utils/transform/histogram.ts +1 -1
- package/src/utils/transform/word-cloud.ts +1 -1
- package/src/utils/view.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -2,159 +2,157 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.adaptors = exports.registerLocale = exports.G2 = exports.version = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
exports.version = '2.4.
|
|
5
|
+
exports.version = '2.4.23';
|
|
6
6
|
// G2 自定义能力透出
|
|
7
7
|
var G2 = tslib_1.__importStar(require("@antv/g2"));
|
|
8
8
|
exports.G2 = G2;
|
|
9
|
+
/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */
|
|
10
|
+
var common_1 = require("./adaptor/common");
|
|
9
11
|
// 国际化处理
|
|
10
12
|
var locale_1 = require("./core/locale");
|
|
11
13
|
Object.defineProperty(exports, "registerLocale", { enumerable: true, get: function () { return locale_1.registerLocale; } });
|
|
12
14
|
var en_US_1 = require("./locales/en_US");
|
|
13
15
|
var zh_CN_1 = require("./locales/zh_CN");
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */
|
|
17
|
+
var geometries_1 = require("./adaptor/geometries");
|
|
18
|
+
Object.defineProperty(exports, "area", { enumerable: true, get: function () { return geometries_1.area; } });
|
|
19
|
+
Object.defineProperty(exports, "interval", { enumerable: true, get: function () { return geometries_1.interval; } });
|
|
20
|
+
Object.defineProperty(exports, "line", { enumerable: true, get: function () { return geometries_1.line; } });
|
|
21
|
+
Object.defineProperty(exports, "point", { enumerable: true, get: function () { return geometries_1.point; } });
|
|
22
|
+
Object.defineProperty(exports, "polygon", { enumerable: true, get: function () { return geometries_1.polygon; } });
|
|
23
|
+
Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return geometries_1.schema; } });
|
|
17
24
|
/** 全局变量 */
|
|
18
25
|
var global_1 = require("./core/global");
|
|
19
26
|
Object.defineProperty(exports, "setGlobal", { enumerable: true, get: function () { return global_1.setGlobal; } });
|
|
20
27
|
/** G2Plot 的 Plot 基类 */
|
|
21
28
|
var plot_1 = require("./core/plot");
|
|
22
29
|
Object.defineProperty(exports, "Plot", { enumerable: true, get: function () { return plot_1.Plot; } });
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var line_1 = require("./plots/line");
|
|
27
|
-
Object.defineProperty(exports, "Line", { enumerable: true, get: function () { return line_1.Line; } });
|
|
30
|
+
/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */
|
|
31
|
+
var lab_1 = require("./lab");
|
|
32
|
+
Object.defineProperty(exports, "Lab", { enumerable: true, get: function () { return lab_1.Lab; } });
|
|
28
33
|
// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)
|
|
29
34
|
var area_1 = require("./plots/area");
|
|
30
35
|
Object.defineProperty(exports, "Area", { enumerable: true, get: function () { return area_1.Area; } });
|
|
31
|
-
// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)
|
|
32
|
-
var column_1 = require("./plots/column");
|
|
33
|
-
Object.defineProperty(exports, "Column", { enumerable: true, get: function () { return column_1.Column; } });
|
|
34
36
|
// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)
|
|
35
37
|
var bar_1 = require("./plots/bar");
|
|
36
38
|
Object.defineProperty(exports, "Bar", { enumerable: true, get: function () { return bar_1.Bar; } });
|
|
37
|
-
//
|
|
38
|
-
var
|
|
39
|
-
Object.defineProperty(exports, "
|
|
40
|
-
//
|
|
41
|
-
var
|
|
42
|
-
Object.defineProperty(exports, "
|
|
43
|
-
//
|
|
44
|
-
var
|
|
45
|
-
Object.defineProperty(exports, "
|
|
46
|
-
//
|
|
47
|
-
var
|
|
48
|
-
Object.defineProperty(exports, "
|
|
49
|
-
//
|
|
50
|
-
var
|
|
51
|
-
Object.defineProperty(exports, "
|
|
39
|
+
// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
|
|
40
|
+
var bidirectional_bar_1 = require("./plots/bidirectional-bar");
|
|
41
|
+
Object.defineProperty(exports, "BidirectionalBar", { enumerable: true, get: function () { return bidirectional_bar_1.BidirectionalBar; } });
|
|
42
|
+
// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)
|
|
43
|
+
var box_1 = require("./plots/box");
|
|
44
|
+
Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return box_1.Box; } });
|
|
45
|
+
// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
|
|
46
|
+
var bullet_1 = require("./plots/bullet");
|
|
47
|
+
Object.defineProperty(exports, "Bullet", { enumerable: true, get: function () { return bullet_1.Bullet; } });
|
|
48
|
+
// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)
|
|
49
|
+
var chord_1 = require("./plots/chord");
|
|
50
|
+
Object.defineProperty(exports, "Chord", { enumerable: true, get: function () { return chord_1.Chord; } });
|
|
51
|
+
// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)
|
|
52
|
+
var circle_packing_1 = require("./plots/circle-packing");
|
|
53
|
+
Object.defineProperty(exports, "CirclePacking", { enumerable: true, get: function () { return circle_packing_1.CirclePacking; } });
|
|
54
|
+
// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)
|
|
55
|
+
var column_1 = require("./plots/column");
|
|
56
|
+
Object.defineProperty(exports, "Column", { enumerable: true, get: function () { return column_1.Column; } });
|
|
52
57
|
// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)
|
|
53
58
|
var dual_axes_1 = require("./plots/dual-axes");
|
|
54
59
|
Object.defineProperty(exports, "DualAxes", { enumerable: true, get: function () { return dual_axes_1.DualAxes; } });
|
|
55
|
-
//
|
|
56
|
-
var
|
|
57
|
-
Object.defineProperty(exports, "
|
|
58
|
-
//
|
|
59
|
-
var
|
|
60
|
-
Object.defineProperty(exports, "
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
// 分面图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
61
|
+
var facet_1 = require("./plots/facet");
|
|
62
|
+
Object.defineProperty(exports, "Facet", { enumerable: true, get: function () { return facet_1.Facet; } });
|
|
63
|
+
// 漏斗图及类型定义
|
|
64
|
+
var funnel_1 = require("./plots/funnel");
|
|
65
|
+
Object.defineProperty(exports, "Funnel", { enumerable: true, get: function () { return funnel_1.Funnel; } });
|
|
66
|
+
Object.defineProperty(exports, "FUNNEL_CONVERSATION_FIELD", { enumerable: true, get: function () { return funnel_1.FUNNEL_CONVERSATION_FIELD; } });
|
|
67
|
+
// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)
|
|
68
|
+
var gauge_1 = require("./plots/gauge");
|
|
69
|
+
Object.defineProperty(exports, "Gauge", { enumerable: true, get: function () { return gauge_1.Gauge; } });
|
|
70
|
+
// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)
|
|
71
|
+
var heatmap_1 = require("./plots/heatmap");
|
|
72
|
+
Object.defineProperty(exports, "Heatmap", { enumerable: true, get: function () { return heatmap_1.Heatmap; } });
|
|
64
73
|
// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)
|
|
65
74
|
var histogram_1 = require("./plots/histogram");
|
|
66
75
|
Object.defineProperty(exports, "Histogram", { enumerable: true, get: function () { return histogram_1.Histogram; } });
|
|
76
|
+
// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)
|
|
77
|
+
var line_1 = require("./plots/line");
|
|
78
|
+
Object.defineProperty(exports, "Line", { enumerable: true, get: function () { return line_1.Line; } });
|
|
79
|
+
// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)
|
|
80
|
+
var liquid_1 = require("./plots/liquid");
|
|
81
|
+
Object.defineProperty(exports, "addWaterWave", { enumerable: true, get: function () { return liquid_1.addWaterWave; } });
|
|
82
|
+
Object.defineProperty(exports, "Liquid", { enumerable: true, get: function () { return liquid_1.Liquid; } });
|
|
83
|
+
// 已经废弃,更名为 Mix
|
|
84
|
+
var mix_1 = require("./plots/mix");
|
|
85
|
+
Object.defineProperty(exports, "Mix", { enumerable: true, get: function () { return mix_1.Mix; } });
|
|
86
|
+
Object.defineProperty(exports, "MultiView", { enumerable: true, get: function () { return mix_1.Mix; } });
|
|
87
|
+
// 饼图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
88
|
+
var pie_1 = require("./plots/pie");
|
|
89
|
+
Object.defineProperty(exports, "Pie", { enumerable: true, get: function () { return pie_1.Pie; } });
|
|
67
90
|
// 进度图及类型定义 | author by [connono](https://github.com/connono)
|
|
68
91
|
var progress_1 = require("./plots/progress");
|
|
69
92
|
Object.defineProperty(exports, "Progress", { enumerable: true, get: function () { return progress_1.Progress; } });
|
|
93
|
+
// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
94
|
+
var radar_1 = require("./plots/radar");
|
|
95
|
+
Object.defineProperty(exports, "Radar", { enumerable: true, get: function () { return radar_1.Radar; } });
|
|
96
|
+
// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)
|
|
97
|
+
var radial_bar_1 = require("./plots/radial-bar");
|
|
98
|
+
Object.defineProperty(exports, "RadialBar", { enumerable: true, get: function () { return radial_bar_1.RadialBar; } });
|
|
70
99
|
// 环形进度图及类型定义 | author by [connono](https://github.com/connono)
|
|
71
100
|
var ring_progress_1 = require("./plots/ring-progress");
|
|
72
101
|
Object.defineProperty(exports, "RingProgress", { enumerable: true, get: function () { return ring_progress_1.RingProgress; } });
|
|
73
|
-
//
|
|
74
|
-
var
|
|
75
|
-
Object.defineProperty(exports, "
|
|
76
|
-
//
|
|
77
|
-
var
|
|
78
|
-
Object.defineProperty(exports, "
|
|
79
|
-
//
|
|
80
|
-
var
|
|
81
|
-
Object.defineProperty(exports, "
|
|
82
|
-
// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
83
|
-
var venn_1 = require("./plots/venn");
|
|
84
|
-
Object.defineProperty(exports, "Venn", { enumerable: true, get: function () { return venn_1.Venn; } });
|
|
102
|
+
// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)
|
|
103
|
+
var rose_1 = require("./plots/rose");
|
|
104
|
+
Object.defineProperty(exports, "Rose", { enumerable: true, get: function () { return rose_1.Rose; } });
|
|
105
|
+
// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)
|
|
106
|
+
var sankey_1 = require("./plots/sankey");
|
|
107
|
+
Object.defineProperty(exports, "Sankey", { enumerable: true, get: function () { return sankey_1.Sankey; } });
|
|
108
|
+
// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)
|
|
109
|
+
var scatter_1 = require("./plots/scatter");
|
|
110
|
+
Object.defineProperty(exports, "Scatter", { enumerable: true, get: function () { return scatter_1.Scatter; } });
|
|
85
111
|
// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)
|
|
86
112
|
var stock_1 = require("./plots/stock");
|
|
87
113
|
Object.defineProperty(exports, "Stock", { enumerable: true, get: function () { return stock_1.Stock; } });
|
|
88
|
-
// 漏斗图及类型定义
|
|
89
|
-
var funnel_1 = require("./plots/funnel");
|
|
90
|
-
Object.defineProperty(exports, "Funnel", { enumerable: true, get: function () { return funnel_1.Funnel; } });
|
|
91
|
-
Object.defineProperty(exports, "FUNNEL_CONVERSATION_FIELD", { enumerable: true, get: function () { return funnel_1.FUNNEL_CONVERSATION_FIELD; } });
|
|
92
|
-
// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)
|
|
93
|
-
var liquid_1 = require("./plots/liquid");
|
|
94
|
-
Object.defineProperty(exports, "Liquid", { enumerable: true, get: function () { return liquid_1.Liquid; } });
|
|
95
|
-
Object.defineProperty(exports, "addWaterWave", { enumerable: true, get: function () { return liquid_1.addWaterWave; } });
|
|
96
|
-
// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
|
|
97
|
-
var bullet_1 = require("./plots/bullet");
|
|
98
|
-
Object.defineProperty(exports, "Bullet", { enumerable: true, get: function () { return bullet_1.Bullet; } });
|
|
99
114
|
// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)
|
|
100
115
|
var sunburst_1 = require("./plots/sunburst");
|
|
101
116
|
Object.defineProperty(exports, "Sunburst", { enumerable: true, get: function () { return sunburst_1.Sunburst; } });
|
|
102
|
-
//
|
|
103
|
-
var
|
|
104
|
-
Object.defineProperty(exports, "
|
|
105
|
-
//
|
|
106
|
-
var
|
|
107
|
-
Object.defineProperty(exports, "
|
|
108
|
-
//
|
|
109
|
-
var
|
|
110
|
-
Object.defineProperty(exports, "
|
|
111
|
-
// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
|
|
112
|
-
var bidirectional_bar_1 = require("./plots/bidirectional-bar");
|
|
113
|
-
Object.defineProperty(exports, "BidirectionalBar", { enumerable: true, get: function () { return bidirectional_bar_1.BidirectionalBar; } });
|
|
117
|
+
// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)
|
|
118
|
+
var tiny_area_1 = require("./plots/tiny-area");
|
|
119
|
+
Object.defineProperty(exports, "TinyArea", { enumerable: true, get: function () { return tiny_area_1.TinyArea; } });
|
|
120
|
+
// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)
|
|
121
|
+
var tiny_column_1 = require("./plots/tiny-column");
|
|
122
|
+
Object.defineProperty(exports, "TinyColumn", { enumerable: true, get: function () { return tiny_column_1.TinyColumn; } });
|
|
123
|
+
// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)
|
|
124
|
+
var tiny_line_1 = require("./plots/tiny-line");
|
|
125
|
+
Object.defineProperty(exports, "TinyLine", { enumerable: true, get: function () { return tiny_line_1.TinyLine; } });
|
|
114
126
|
// 矩形树图
|
|
115
127
|
var treemap_1 = require("./plots/treemap");
|
|
116
128
|
Object.defineProperty(exports, "Treemap", { enumerable: true, get: function () { return treemap_1.Treemap; } });
|
|
117
|
-
//
|
|
118
|
-
var
|
|
119
|
-
Object.defineProperty(exports, "
|
|
120
|
-
//
|
|
121
|
-
var
|
|
122
|
-
Object.defineProperty(exports, "
|
|
123
|
-
//
|
|
124
|
-
var
|
|
125
|
-
Object.defineProperty(exports, "
|
|
129
|
+
// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
130
|
+
var venn_1 = require("./plots/venn");
|
|
131
|
+
Object.defineProperty(exports, "Venn", { enumerable: true, get: function () { return venn_1.Venn; } });
|
|
132
|
+
// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)
|
|
133
|
+
var violin_1 = require("./plots/violin");
|
|
134
|
+
Object.defineProperty(exports, "Violin", { enumerable: true, get: function () { return violin_1.Violin; } });
|
|
135
|
+
// 瀑布图 | author by [visiky](https://github.com/visiky)
|
|
136
|
+
var waterfall_1 = require("./plots/waterfall");
|
|
137
|
+
Object.defineProperty(exports, "Waterfall", { enumerable: true, get: function () { return waterfall_1.Waterfall; } });
|
|
138
|
+
// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)
|
|
139
|
+
var word_cloud_1 = require("./plots/word-cloud");
|
|
140
|
+
Object.defineProperty(exports, "WordCloud", { enumerable: true, get: function () { return word_cloud_1.WordCloud; } });
|
|
126
141
|
// 以下开放自定义图表开发的能力(目前仅仅是孵化中)
|
|
127
142
|
/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */
|
|
128
143
|
var plugin_1 = require("./plugin");
|
|
129
144
|
Object.defineProperty(exports, "P", { enumerable: true, get: function () { return plugin_1.P; } });
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
Object.defineProperty(exports, "getCanvasPattern", { enumerable: true, get: function () { return pattern_1.getCanvasPattern; } });
|
|
133
|
-
// 已经废弃,更名为 Mix
|
|
134
|
-
var mix_1 = require("./plots/mix");
|
|
135
|
-
Object.defineProperty(exports, "MultiView", { enumerable: true, get: function () { return mix_1.Mix; } });
|
|
136
|
-
/** 开放多图层图表 (mix) */
|
|
137
|
-
var mix_2 = require("./plots/mix");
|
|
138
|
-
Object.defineProperty(exports, "Mix", { enumerable: true, get: function () { return mix_2.Mix; } });
|
|
139
|
-
// 分面图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
140
|
-
var facet_1 = require("./plots/facet");
|
|
141
|
-
Object.defineProperty(exports, "Facet", { enumerable: true, get: function () { return facet_1.Facet; } });
|
|
145
|
+
// 类型定义导出
|
|
146
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
142
147
|
/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */
|
|
143
148
|
var utils_1 = require("./utils");
|
|
144
149
|
Object.defineProperty(exports, "flow", { enumerable: true, get: function () { return utils_1.flow; } });
|
|
145
150
|
Object.defineProperty(exports, "measureTextWidth", { enumerable: true, get: function () { return utils_1.measureTextWidth; } });
|
|
146
|
-
/**
|
|
147
|
-
var
|
|
148
|
-
Object.defineProperty(exports, "
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
Object.defineProperty(exports, "polygon", { enumerable: true, get: function () { return geometries_1.polygon; } });
|
|
153
|
-
Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return geometries_1.schema; } });
|
|
154
|
-
/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */
|
|
155
|
-
var common_1 = require("./adaptor/common");
|
|
151
|
+
/** 开放 getCanvasPatterng 方法 */
|
|
152
|
+
var pattern_1 = require("./utils/pattern");
|
|
153
|
+
Object.defineProperty(exports, "getCanvasPattern", { enumerable: true, get: function () { return pattern_1.getCanvasPattern; } });
|
|
154
|
+
/** default locale register */
|
|
155
|
+
locale_1.registerLocale('en-US', en_US_1.EN_US_LOCALE);
|
|
156
|
+
locale_1.registerLocale('zh-CN', zh_CN_1.ZH_CN_LOCALE);
|
|
156
157
|
exports.adaptors = { scale: common_1.scale, legend: common_1.legend, tooltip: common_1.tooltip, annotation: common_1.annotation, interaction: common_1.interaction, theme: common_1.theme, animation: common_1.animation };
|
|
157
|
-
/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */
|
|
158
|
-
var lab_1 = require("./lab");
|
|
159
|
-
Object.defineProperty(exports, "Lab", { enumerable: true, get: function () { return lab_1.Lab; } });
|
|
160
158
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,mDAA+B;AACtB,gBAAE;AAEX,QAAQ;AACR,wCAA+C;AAOtC,+FAPA,uBAAc,OAOA;AANvB,yCAA+C;AAC/C,yCAA+C;AAC/C,8BAA8B;AAC9B,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AACtC,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AAItC,WAAW;AACX,wCAA0C;AAAjC,mGAAA,SAAS,OAAA;AAElB,uBAAuB;AACvB,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AAKb,SAAS;AACT,kDAAwB;AAExB,2DAA2D;AAC3D,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAGb,2DAA2D;AAC3D,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAGb,uDAAuD;AACvD,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAGf,yDAAyD;AACzD,mCAAkC;AAAzB,0FAAA,GAAG,OAAA;AAGZ,0DAA0D;AAC1D,mCAAkC;AAAzB,0FAAA,GAAG,OAAA;AAGZ,uEA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2.4.22';\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
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,mDAA+B;AA2ItB,gBAAE;AA1IX,uCAAuC;AACvC,2CAAqG;AACrG,QAAQ;AACR,wCAA+C;AAyItC,+FAzIA,uBAAc,OAyIA;AAxIvB,yCAA+C;AAC/C,yCAA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AA;AACV,SAAS;AACT,kDAAwB;AACxB,uCAAuC;AACvC,iCAAiD;AAAxC,6FAAA,IAAI,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAC/B,8BAA8B;AAC9B,2CAAmD;AAA1C,2GAAA,gBAAgB,OAAA;AAKzB,8BAA8B;AAC9B,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AACtC,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AAEzB,QAAA,QAAQ,GAAG,EAAE,KAAK,gBAAA,EAAE,MAAM,iBAAA,EAAE,OAAO,kBAAA,EAAE,UAAU,qBAAA,EAAE,WAAW,sBAAA,EAAE,KAAK,gBAAA,EAAE,SAAS,oBAAA,EAAE,CAAC","sourcesContent":["export const version = '2.4.23';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\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// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\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// 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// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\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// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\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// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\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// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\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// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../../src/interactions/actions/drill-down.ts"],"names":[],"mappings":";;;;AAAA,+BAAgD;AAChD,mCAAoD;AAGpD,uDAAqD;AAErD,oBAAoB;AACpB,IAAM,OAAO,GAAG,CAAC,CAAC;AAClB,eAAe;AACf,IAAM,YAAY,GAAG,CAAC,CAAC;AACvB,iBAAiB;AACJ,QAAA,WAAW,GAAG,CAAC,CAAC;AAE7B,oCAAoC;AACvB,QAAA,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,UAAU;AACG,QAAA,0BAA0B,GAA+B;IACpE,gBAAgB;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,SAAS;KAClB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,+BAA+B,GAAG,iCAAiC,CAAC;AAwBjF;;;;;GAKG;AACH;IAAqC,2CAAM;IAA3C;QAAA,qEA6OC;QA5OC,kBAAkB;QACX,UAAI,GAAG,YAAY,CAAC;QAE3B,WAAW;QACD,kBAAY,GAAiB,EAAE,CAAC;QAC1C,YAAY;QACJ,qBAAe,GAAW,IAAI,CAAC;QACvC,UAAU;QACF,mBAAa,GAA+B,kCAA0B,CAAC;;IAoOjF,CAAC;IAlOC;;OAEG;IACI,+BAAK,GAAZ;QACE,IAAM,IAAI,GAAG,UAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAC;QAExB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjB,I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AI,SAAI,MAAM,CAAC,IAAI,aAAU;oBAC7C,KAAK,sCACH,IAAI,EAAE,MAAM,CAAC,WAAW,IACrB,MAAM,CAAC,SAAS,KACnB,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,CAAC,GACL;iBACF,CAAC,CAAC;gBAEH,IAAM,UAAU,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC1C,IAAI,IAAI,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;aACpC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,wCAAc,GAAtB;QACE,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;SAC7B;IACH,CAAC;IAED;;;OAGG;IACI,iCAAO,GAAd;QACE,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;SAC/B;QACD,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,sBAAC;AAAD,CAAC,AA7OD,CAAqC,WAAM,GA6O1C;AA7OY,0CAAe","sourcesContent":["import { Action, IGroup, Util } from '@antv/g2';\nimport { get, last, isNil, size } from '@antv/util';\nimport { Data } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { deepAssign } from '../../utils/deep-assign';\n\n// 面包屑文字和分割符'/'之间的距离\nconst PADDING = 4;\n// 面包屑位置距离树图的距离\nconst PADDING_LEFT = 0;\n// 面包屑位置距离树图的顶部距离\nexport const PADDING_TOP = 5;\n\n/** Group name of breadCrumb: 面包屑 */\nexport const BREAD_CRUMB_NAME = 'drilldown-bread-crumb';\n\n// 面包屑默认配置\nexport const DEFAULT_BREAD_CRUMB_CONFIG: DrillDownCfg['breadCrumb'] = {\n /** 位置,默认:左上角 */\n position: 'top-left',\n dividerText: '/',\n textStyle: {\n fontSize: 12,\n fill: 'rgba(0, 0, 0, 0.65)',\n cursor: 'pointer',\n },\n activeTextStyle: {\n fill: '#87B5FF',\n },\n};\n\n/**\n * hierarchy 数据转换的参数\n */\nexport const HIERARCHY_DATA_TRANSFORM_PARAMS = 'hierarchy-data-transform-params';\n\n/**\n * Hierarchy plot 节点的数据\n */\nexport type HierarchyNode<N = any /** 节点 */> = {\n /** 节点的原始数据,树型结构(todo 是否更正 key 为 origin) */\n data: { name: string; value?: any; children: { name: string; value?: any }[] };\n /** 在构建节点数据时候,增加的扩展配置, 用于存储 transformData 的入参配置 */\n [HIERARCHY_DATA_TRANSFORM_PARAMS]: object;\n /** 当前的层级结构,每一次下钻都会更新. 不是 unique */\n depth: number;\n /** 当前所处高度,depth + height = 总的层级 */\n height: number;\n parent: N;\n children: N[];\n};\n\ntype HistoryCache = {\n name: string;\n id: string;\n children: Data;\n}[];\n\n/**\n * @description 下钻交互的 action\n * @author liuzhenying\n *\n * 适用于:hierarchy plot\n */\nexport class DrillDownAction extends Action {\n /** Action name */\n public name = 'drill-down';\n\n // 存储历史下钻数据\n protected historyCache: HistoryCache = [];\n // 面包屑 group\n private breadCrumbGroup: IGroup = null;\n // 面包屑基础配置\n private breadCrumbCfg: DrillDownCfg['breadCrumb'] = DEFAULT_BREAD_CRUMB_CONFIG;\n\n /**\n * 点击事件, 下钻数据,并绘制面包屑\n */\n public click() {\n const data = get(this.context, ['event', 'data', 'data']);\n if (!data) return false;\n\n this.drill(data);\n this.drawBreadCrumb();\n }\n\n /**\n * 重置位置,初始化及触发 chart afterchangesize 回调时使用\n */\n public resetPosition() {\n // 当在第一层级未绘制面包屑,此时 changedata 触发 resetPosition 函数,需判断 this.breadCrumbGroup 是否存在\n if (!this.breadCrumbGroup) return;\n const coordinate = this.context.view.getCoordinate();\n const breadCrumbGroup = this.breadCrumbGroup;\n const bbox = breadCrumbGroup.getBBox();\n\n const { position } = this.getButtonCfg();\n\n // @todo 后续抽取一个函数来处理,以及增加 margin 或者 padding 的设置\n // 非 polar 的,需要使用 coordinate,除却图表组件\n let point = { x: coordinate.start.x, y: coordinate.end.y - (bbox.height + PADDING_TOP * 2) };\n if (coordinate.isPolar) {\n // 默认,左上角直接出发\n point = { x: 0, y: 0 };\n }\n if (position === 'bottom-left') {\n // 涉及到坐标反转的问题\n point = { x: coordinate.start.x, y: coordinate.start.y };\n }\n /** PADDING_LEFT, PADDING_TOP 与画布边缘的距离 */\n const matrix = Util.transform(null, [['t', point.x + PADDING_LEFT, point.y + bbox.height + PADDING_TOP]]);\n breadCrumbGroup.setMatrix(matrix);\n }\n\n /**\n * 返回上一层\n */\n public back(): void {\n if (size(this.historyCache)) {\n this.backTo(this.historyCache.slice(0, -1));\n }\n }\n\n /**\n * 重置\n */\n public reset(): void {\n if (this.historyCache[0]) {\n this.backTo(this.historyCache.slice(0, 1));\n }\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n\n /**\n * 下钻数据并更新 view 显示层\n * @param nodeInfo 下钻数据\n */\n protected drill(nodeInfo: HierarchyNode) {\n const { view } = this.context;\n const transformData = get(view, ['interactions', 'drill-down', 'cfg', 'transformData'], (v) => v);\n\n // 重新 update 数据\n const drillData = transformData({ data: nodeInfo.data, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] });\n view.changeData(drillData);\n\n // 存储历史记录\n const historyCache: HistoryCache = [];\n\n let node = nodeInfo;\n while (node) {\n const nodeData = node.data;\n historyCache.unshift({\n id: `${nodeData.name}_${node.height}_${node.depth}`,\n name: nodeData.name,\n // children 是实际数据\n children: transformData({ data: nodeData, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] }),\n });\n node = node.parent;\n }\n\n this.historyCache = (this.historyCache || []).slice(0, -1).concat(historyCache);\n }\n\n /**\n * 回退事件,点击面包屑时触发\n * @param historyCache 当前要回退到的历史\n */\n protected backTo(historyCache: HistoryCache) {\n if (!historyCache || historyCache.length <= 0) {\n return;\n }\n\n const { view } = this.context;\n const data = last(historyCache).children; // 处理后的数组\n view.changeData(data);\n\n if (historyCache.length > 1) {\n this.historyCache = historyCache;\n this.drawBreadCrumb();\n } else {\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n }\n\n /**\n * 获取 mix 默认的配置和用户配置\n */\n private getButtonCfg() {\n const { view } = this.context;\n const drillDownConfig: DrillDownCfg = get(view, ['interactions', 'drill-down', 'cfg', 'drillDownConfig']);\n\n return deepAssign(this.breadCrumbCfg, drillDownConfig?.breadCrumb, this.cfg);\n }\n\n /**\n * 显示面包屑\n */\n private drawBreadCrumb() {\n this.drawBreadCrumbGroup();\n this.resetPosition();\n this.breadCrumbGroup.show();\n }\n\n /**\n * 绘制 Button 和 文本\n */\n private drawBreadCrumbGroup() {\n const config = this.getButtonCfg();\n const cache = this.historyCache;\n\n // 初始化面包屑 group\n if (!this.breadCrumbGroup) {\n this.breadCrumbGroup = this.context.view.foregroundGroup.addGroup({\n name: BREAD_CRUMB_NAME,\n });\n } else {\n this.breadCrumbGroup.clear();\n }\n\n // 绘制面包屑\n let left = 0;\n cache.forEach((record, index) => {\n // 添加文本\n const textShape = this.breadCrumbGroup.addShape({\n type: 'text',\n id: record.id,\n name: `${BREAD_CRUMB_NAME}_${record.name}_text`,\n attrs: {\n text: index === 0 && !isNil(config.rootText) ? config.rootText : record.name,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const textShapeBox = textShape.getBBox();\n left += textShapeBox.width + PADDING;\n\n // 增加文本事件\n textShape.on('click', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n const newHistoryCache = cache.slice(0, cache.findIndex((d) => d.id === targetId) + 1);\n this.backTo(newHistoryCache);\n }\n });\n // active 效果内置\n textShape.on('mouseenter', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n textShape.attr(config.activeTextStyle);\n } else {\n textShape.attr({ cursor: 'default' });\n }\n });\n textShape.on('mouseleave', () => {\n textShape.attr(config.textStyle);\n });\n\n if (index < cache.length - 1) {\n // 添加反斜杠\n const dividerShape = this.breadCrumbGroup.addShape({\n type: 'text',\n name: `${config.name}_${record.name}_divider`,\n attrs: {\n text: config.dividerText,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const dividerBox = dividerShape.getBBox();\n left += dividerBox.width + PADDING;\n }\n });\n }\n\n /**\n * 隐藏面包屑\n */\n private hideCrumbGroup() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.hide();\n }\n }\n\n /**\n * @override\n * destroy: 销毁资源\n */\n public destroy() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.remove();\n }\n super.destroy();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../../src/interactions/actions/drill-down.ts"],"names":[],"mappings":";;;;AAAA,+BAAgD;AAChD,mCAAoD;AAGpD,uDAAqD;AAErD,oBAAoB;AACpB,IAAM,OAAO,GAAG,CAAC,CAAC;AAClB,eAAe;AACf,IAAM,YAAY,GAAG,CAAC,CAAC;AACvB,iBAAiB;AACJ,QAAA,WAAW,GAAG,CAAC,CAAC;AAE7B,oCAAoC;AACvB,QAAA,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,UAAU;AACG,QAAA,0BAA0B,GAA+B;IACpE,gBAAgB;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,SAAS;KAClB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,+BAA+B,GAAG,iCAAiC,CAAC;AAwBjF;;;;;GAKG;AACH;IAAqC,2CAAM;IAA3C;QAAA,qEA6OC;QA5OC,kBAAkB;QACX,UAAI,GAAG,YAAY,CAAC;QAE3B,WAAW;QACD,kBAAY,GAAiB,EAAE,CAAC;QAC1C,YAAY;QACJ,qBAAe,GAAW,IAAI,CAAC;QACvC,UAAU;QACF,mBAAa,GAA+B,kCAA0B,CAAC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CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YAEH,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC5B,QAAQ;gBACR,IAAM,YAAY,GAAG,KAAI,CAAC,eAAe,CAAC,QAAQ,CAAC;oBACjD,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAK,MAAM,CAAC,IAAI,SAAI,MAAM,CAAC,IAAI,aAAU;oBAC7C,KAAK,sCACH,IAAI,EAAE,MAAM,CAAC,WAAW,IACrB,MAAM,CAAC,SAAS,KACnB,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,CAAC,GACL;iBACF,CAAC,CAAC;gBAEH,IAAM,UAAU,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC1C,IAAI,IAAI,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;aACpC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,wCAAc,GAAtB;QACE,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;SAC7B;IACH,CAAC;IAED;;;OAGG;IACI,iCAAO,GAAd;QACE,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;SAC/B;QACD,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,sBAAC;AAAD,CAAC,AA7OD,CAAqC,WAAM,GA6O1C;AA7OY,0CAAe","sourcesContent":["import { Action, IGroup, Util } from '@antv/g2';\nimport { get, isNil, last, size } from '@antv/util';\nimport { Data } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { deepAssign } from '../../utils/deep-assign';\n\n// 面包屑文字和分割符'/'之间的距离\nconst PADDING = 4;\n// 面包屑位置距离树图的距离\nconst PADDING_LEFT = 0;\n// 面包屑位置距离树图的顶部距离\nexport const PADDING_TOP = 5;\n\n/** Group name of breadCrumb: 面包屑 */\nexport const BREAD_CRUMB_NAME = 'drilldown-bread-crumb';\n\n// 面包屑默认配置\nexport const DEFAULT_BREAD_CRUMB_CONFIG: DrillDownCfg['breadCrumb'] = {\n /** 位置,默认:左上角 */\n position: 'top-left',\n dividerText: '/',\n textStyle: {\n fontSize: 12,\n fill: 'rgba(0, 0, 0, 0.65)',\n cursor: 'pointer',\n },\n activeTextStyle: {\n fill: '#87B5FF',\n },\n};\n\n/**\n * hierarchy 数据转换的参数\n */\nexport const HIERARCHY_DATA_TRANSFORM_PARAMS = 'hierarchy-data-transform-params';\n\n/**\n * Hierarchy plot 节点的数据\n */\nexport type HierarchyNode<N = any /** 节点 */> = {\n /** 节点的原始数据,树型结构(todo 是否更正 key 为 origin) */\n data: { name: string; value?: any; children: { name: string; value?: any }[] };\n /** 在构建节点数据时候,增加的扩展配置, 用于存储 transformData 的入参配置 */\n [HIERARCHY_DATA_TRANSFORM_PARAMS]: object;\n /** 当前的层级结构,每一次下钻都会更新. 不是 unique */\n depth: number;\n /** 当前所处高度,depth + height = 总的层级 */\n height: number;\n parent: N;\n children: N[];\n};\n\ntype HistoryCache = {\n name: string;\n id: string;\n children: Data;\n}[];\n\n/**\n * @description 下钻交互的 action\n * @author liuzhenying\n *\n * 适用于:hierarchy plot\n */\nexport class DrillDownAction extends Action {\n /** Action name */\n public name = 'drill-down';\n\n // 存储历史下钻数据\n protected historyCache: HistoryCache = [];\n // 面包屑 group\n private breadCrumbGroup: IGroup = null;\n // 面包屑基础配置\n private breadCrumbCfg: DrillDownCfg['breadCrumb'] = DEFAULT_BREAD_CRUMB_CONFIG;\n\n /**\n * 点击事件, 下钻数据,并绘制面包屑\n */\n public click() {\n const data = get(this.context, ['event', 'data', 'data']);\n if (!data) return false;\n\n this.drill(data);\n this.drawBreadCrumb();\n }\n\n /**\n * 重置位置,初始化及触发 chart afterchangesize 回调时使用\n */\n public resetPosition() {\n // 当在第一层级未绘制面包屑,此时 changedata 触发 resetPosition 函数,需判断 this.breadCrumbGroup 是否存在\n if (!this.breadCrumbGroup) return;\n const coordinate = this.context.view.getCoordinate();\n const breadCrumbGroup = this.breadCrumbGroup;\n const bbox = breadCrumbGroup.getBBox();\n\n const { position } = this.getButtonCfg();\n\n // @todo 后续抽取一个函数来处理,以及增加 margin 或者 padding 的设置\n // 非 polar 的,需要使用 coordinate,除却图表组件\n let point = { x: coordinate.start.x, y: coordinate.end.y - (bbox.height + PADDING_TOP * 2) };\n if (coordinate.isPolar) {\n // 默认,左上角直接出发\n point = { x: 0, y: 0 };\n }\n if (position === 'bottom-left') {\n // 涉及到坐标反转的问题\n point = { x: coordinate.start.x, y: coordinate.start.y };\n }\n /** PADDING_LEFT, PADDING_TOP 与画布边缘的距离 */\n const matrix = Util.transform(null, [['t', point.x + PADDING_LEFT, point.y + bbox.height + PADDING_TOP]]);\n breadCrumbGroup.setMatrix(matrix);\n }\n\n /**\n * 返回上一层\n */\n public back(): void {\n if (size(this.historyCache)) {\n this.backTo(this.historyCache.slice(0, -1));\n }\n }\n\n /**\n * 重置\n */\n public reset(): void {\n if (this.historyCache[0]) {\n this.backTo(this.historyCache.slice(0, 1));\n }\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n\n /**\n * 下钻数据并更新 view 显示层\n * @param nodeInfo 下钻数据\n */\n protected drill(nodeInfo: HierarchyNode) {\n const { view } = this.context;\n const transformData = get(view, ['interactions', 'drill-down', 'cfg', 'transformData'], (v) => v);\n\n // 重新 update 数据\n const drillData = transformData({ data: nodeInfo.data, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] });\n view.changeData(drillData);\n\n // 存储历史记录\n const historyCache: HistoryCache = [];\n\n let node = nodeInfo;\n while (node) {\n const nodeData = node.data;\n historyCache.unshift({\n id: `${nodeData.name}_${node.height}_${node.depth}`,\n name: nodeData.name,\n // children 是实际数据\n children: transformData({ data: nodeData, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] }),\n });\n node = node.parent;\n }\n\n this.historyCache = (this.historyCache || []).slice(0, -1).concat(historyCache);\n }\n\n /**\n * 回退事件,点击面包屑时触发\n * @param historyCache 当前要回退到的历史\n */\n protected backTo(historyCache: HistoryCache) {\n if (!historyCache || historyCache.length <= 0) {\n return;\n }\n\n const { view } = this.context;\n const data = last(historyCache).children; // 处理后的数组\n view.changeData(data);\n\n if (historyCache.length > 1) {\n this.historyCache = historyCache;\n this.drawBreadCrumb();\n } else {\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n }\n\n /**\n * 获取 mix 默认的配置和用户配置\n */\n private getButtonCfg() {\n const { view } = this.context;\n const drillDownConfig: DrillDownCfg = get(view, ['interactions', 'drill-down', 'cfg', 'drillDownConfig']);\n\n return deepAssign(this.breadCrumbCfg, drillDownConfig?.breadCrumb, this.cfg);\n }\n\n /**\n * 显示面包屑\n */\n private drawBreadCrumb() {\n this.drawBreadCrumbGroup();\n this.resetPosition();\n this.breadCrumbGroup.show();\n }\n\n /**\n * 绘制 Button 和 文本\n */\n private drawBreadCrumbGroup() {\n const config = this.getButtonCfg();\n const cache = this.historyCache;\n\n // 初始化面包屑 group\n if (!this.breadCrumbGroup) {\n this.breadCrumbGroup = this.context.view.foregroundGroup.addGroup({\n name: BREAD_CRUMB_NAME,\n });\n } else {\n this.breadCrumbGroup.clear();\n }\n\n // 绘制面包屑\n let left = 0;\n cache.forEach((record, index) => {\n // 添加文本\n const textShape = this.breadCrumbGroup.addShape({\n type: 'text',\n id: record.id,\n name: `${BREAD_CRUMB_NAME}_${record.name}_text`,\n attrs: {\n text: index === 0 && !isNil(config.rootText) ? config.rootText : record.name,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const textShapeBox = textShape.getBBox();\n left += textShapeBox.width + PADDING;\n\n // 增加文本事件\n textShape.on('click', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n const newHistoryCache = cache.slice(0, cache.findIndex((d) => d.id === targetId) + 1);\n this.backTo(newHistoryCache);\n }\n });\n // active 效果内置\n textShape.on('mouseenter', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n textShape.attr(config.activeTextStyle);\n } else {\n textShape.attr({ cursor: 'default' });\n }\n });\n textShape.on('mouseleave', () => {\n textShape.attr(config.textStyle);\n });\n\n if (index < cache.length - 1) {\n // 添加反斜杠\n const dividerShape = this.breadCrumbGroup.addShape({\n type: 'text',\n name: `${config.name}_${record.name}_divider`,\n attrs: {\n text: config.dividerText,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const dividerBox = dividerShape.getBBox();\n left += dividerBox.width + PADDING;\n }\n });\n }\n\n /**\n * 隐藏面包屑\n */\n private hideCrumbGroup() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.hide();\n }\n }\n\n /**\n * @override\n * destroy: 销毁资源\n */\n public destroy() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.remove();\n }\n super.destroy();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../src/interactions/drill-down.ts"],"names":[],"mappings":";;;AAAA,+BAA+D;AAC/D,mCAA0C;AAC1C,mDAAuD;AAEvD;;GAEG;AACH,SAAgB,YAAY,CAAC,OAAO;IAClC,IAAM,IAAI,GAAG,UAAG,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACzD,OAAO,cAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5D,CAAC;AAHD,oCAGC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,OAAO;IACvB,IAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IACxC,IAAA,WAAW,GAAK,UAAU,YAAf,CAAgB;IACnC,IAAI,WAAW,EAAE;QACT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AAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,gBAAgB,EAAE;QAC3D,kCAAkC;QAClC,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE;KAChF;IACD,KAAK,EAAE;QACL;YACE,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,CAAC,yBAAyB,CAAC;SACpC;QACD;YACE,OAAO,EAAE,iBAAiB;YAC1B,MAAM,EAAE,CAAC,iCAAiC,CAAC;SAC5C;QACD;YACE,aAAa;YACb,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,CAAC,wBAAwB,CAAC;SACnC;KACF;CACF,CAAC,CAAC","sourcesContent":["import { registerAction, registerInteraction } from '@antv/g2';\nimport { get, isArray } from '@antv/util';\nimport { DrillDownAction } from './actions/drill-down';\n\n/**\n * 判断是否为父节点\n */\nexport function isParentNode(context) {\n const data = get(context, ['event', 'data', 'data'], {});\n return isArray(data.children) && data.children.length > 0;\n}\n\n/**\n * 判断是否在中心\n */\nfunction inCenter(context) {\n const coordinate = context.view.getCoordinate();\n const { innerRadius } = coordinate;\n if (innerRadius) {\n const { x, y } = context.event;\n const { x: centerX, y: centerY } = coordinate.center;\n const r = coordinate.getRadius() * innerRadius;\n const distance = Math.sqrt((centerX - x) ** 2 + (centerY - y) ** 2);\n return distance < r;\n }\n return false;\n}\n\nregisterAction('drill-down-action', DrillDownAction);\nregisterInteraction('drill-down', {\n showEnable: [\n { trigger: 'element:mouseenter', action: 'cursor:pointer', isEnable: isParentNode },\n { trigger: 'element:mouseleave', action: 'cursor:default' },\n // 中心处,肯定会触发 element:mouseleave 操作\n { trigger: 'element:mouseleave', action: 'cursor:pointer', isEnable: inCenter },\n ],\n start: [\n {\n trigger: 'element:click',\n isEnable: isParentNode,\n action: ['drill-down-action:click'],\n },\n {\n trigger: 'afterchangesize',\n action: ['drill-down-action:resetPosition'],\n },\n {\n // 点击中心,返回上一层\n trigger: 'click',\n isEnable: inCenter,\n action: ['drill-down-action:back'],\n },\n ],\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/_template/adaptor.ts"],"names":[],"mappings":";;;AAAA,+CAA4E;AAE5E,qCAAmC;AAGnC;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA+B;IACvC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,IAAI,GAAqB,OAAO,KAA5B,EAAE,MAAM,GAAa,OAAO,OAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IAEzC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjB,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAI,MAAM,SAAI,MAAQ,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,MAA+B;;IAC1C,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,KAAK,GAA4B,OAAO,MAAnC,EAAE,KAAK,GAAqB,OAAO,MAA5B,EAAE,MAAM,GAAa,OAAO,OAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IAEjD,OAAO,YAAI,CACT,cAAK;QACH,GAAC,MAAM,IAAG,KAAK;QACf,GAAC,MAAM,IAAG,KAAK;YACf,CACH,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAVD,oBAUC;AACD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA+B;IACrD,0BAA0B;IAC1B,OAAO,YAAI,CACT,cAAK,EACL,QAAQ,EACR,IAAI,EACJ,oBAAW,EACX,kBAAS;IACT,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAVD,0BAUC","sourcesContent":["import { interaction,
|
|
1
|
+
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/_template/adaptor.ts"],"names":[],"mappings":";;;AAAA,+CAA4E;AAE5E,qCAAmC;AAGnC;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA+B;IACvC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,IAAI,GAAqB,OAAO,KAA5B,EAAE,MAAM,GAAa,OAAO,OAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IAEzC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjB,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAI,MAAM,SAAI,MAAQ,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,MAA+B;;IAC1C,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,KAAK,GAA4B,OAAO,MAAnC,EAAE,KAAK,GAAqB,OAAO,MAA5B,EAAE,MAAM,GAAa,OAAO,OAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IAEjD,OAAO,YAAI,CACT,cAAK;QACH,GAAC,MAAM,IAAG,KAAK;QACf,GAAC,MAAM,IAAG,KAAK;YACf,CACH,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAVD,oBAUC;AACD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA+B;IACrD,0BAA0B;IAC1B,OAAO,YAAI,CACT,cAAK,EACL,QAAQ,EACR,IAAI,EACJ,oBAAW,EACX,kBAAS;IACT,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAVD,0BAUC","sourcesContent":["import { animation, interaction, scale, theme } from '../../adaptor/common';\nimport { Params } from '../../core/adaptor';\nimport { flow } from '../../utils';\nimport { TemplateOptions } from './types';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<TemplateOptions>): Params<TemplateOptions> {\n const { chart, options } = params;\n const { data, xField, yField } = options;\n\n chart.data(data);\n\n chart.interval().position(`${xField}*${yField}`);\n\n return params;\n}\n\n/**\n * meta 配置\n * @param params\n */\nexport function meta(params: Params<TemplateOptions>): Params<TemplateOptions> {\n const { options } = params;\n const { xAxis, yAxis, xField, yField } = options;\n\n return flow(\n scale({\n [xField]: xAxis,\n [yField]: yAxis,\n })\n )(params);\n}\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<TemplateOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n theme,\n geometry,\n meta,\n interaction,\n animation\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/_template/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/_template/index.ts"],"names":[],"mappings":";;;;AACA,wCAAuC;AACvC,qCAAoC;AAKpC;;GAEG;AACH;IAA8B,oCAAqB;IAAnD;QAAA,qEAUC;QATC,WAAW;QACJ,UAAI,GAAW,UAAU,CAAC;;IAQnC,CAAC;IANC;;OAEG;IACO,mCAAgB,GAA1B;QACE,OAAO,iBAAO,CAAC;IACjB,CAAC;IACH,eAAC;AAAD,CAAC,AAVD,CAA8B,WAAI,GAUjC;AAVY,4BAAQ","sourcesContent":["import { Adaptor } from '../../core/adaptor';\nimport { Plot } from '../../core/plot';\nimport { adaptor } from './adaptor';\nimport { TemplateOptions } from './types';\n\nexport type { TemplateOptions };\n\n/**\n * 这个是一个图表开发的 模板代码!\n */\nexport class Template extends Plot<TemplateOptions> {\n /** 图表类型 */\n public type: string = 'template';\n\n /**\n * 获取适配器\n */\n protected getSchemaAdaptor(): Adaptor<TemplateOptions> {\n return adaptor;\n }\n}\n"]}
|
|
@@ -4,9 +4,8 @@ exports.adaptor = exports.meta = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var util_1 = require("@antv/util");
|
|
6
6
|
var common_1 = require("../../adaptor/common");
|
|
7
|
-
var utils_1 = require("../../utils");
|
|
8
7
|
var geometries_1 = require("../../adaptor/geometries");
|
|
9
|
-
var
|
|
8
|
+
var utils_1 = require("../../utils");
|
|
10
9
|
var percent_1 = require("../../utils/transform/percent");
|
|
11
10
|
var adaptor_1 = require("../line/adaptor");
|
|
12
11
|
Object.defineProperty(exports, "meta", { enumerable: true, get: function () { return adaptor_1.meta; } });
|
|
@@ -26,7 +25,7 @@ function geometry(params) {
|
|
|
26
25
|
name: datum[seriesField] || datum[xField],
|
|
27
26
|
value: (Number(datum[yField]) * 100).toFixed(2) + '%',
|
|
28
27
|
}); } }, tooltip) : tooltip;
|
|
29
|
-
var primary =
|
|
28
|
+
var primary = utils_1.deepAssign({}, params, {
|
|
30
29
|
options: {
|
|
31
30
|
area: { color: color, style: areaStyle },
|
|
32
31
|
point: pointMapping && tslib_1.__assign({ color: color }, pointMapping),
|
|
@@ -41,7 +40,7 @@ function geometry(params) {
|
|
|
41
40
|
// 线默认 2px (折线不能复用面积图的 state,因为 fill 和 stroke 不匹配)
|
|
42
41
|
var lineParams = {
|
|
43
42
|
chart: chart,
|
|
44
|
-
options:
|
|
43
|
+
options: utils_1.deepAssign({ line: { size: 2 } }, util_1.omit(options, ['state']), {
|
|
45
44
|
// 颜色保持一致,因为如果颜色不一致,会导致 tooltip 中元素重复。
|
|
46
45
|
// 如果存在,才设置,否则为空
|
|
47
46
|
line: lineMapping && tslib_1.__assign({ color: color }, lineMapping),
|
|
@@ -55,7 +54,7 @@ function geometry(params) {
|
|
|
55
54
|
},
|
|
56
55
|
}),
|
|
57
56
|
};
|
|
58
|
-
var pointParams =
|
|
57
|
+
var pointParams = utils_1.deepAssign({}, primary, { options: { tooltip: false, state: pointState } });
|
|
59
58
|
// area geometry 处理
|
|
60
59
|
geometries_1.area(primary);
|
|
61
60
|
geometries_1.line(lineParams);
|
|
@@ -84,7 +83,7 @@ function label(params) {
|
|
|
84
83
|
{ type: 'path-adjust-position' },
|
|
85
84
|
{ type: 'point-adjust-position' },
|
|
86
85
|
{ type: 'limit-in-plot', cfg: { action: 'hide' } },
|
|
87
|
-
] },
|
|
86
|
+
] }, utils_1.transformLabel(cfg)),
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
89
|
return params;
|
|
@@ -110,7 +109,7 @@ function adjust(params) {
|
|
|
110
109
|
*/
|
|
111
110
|
function adaptor(params) {
|
|
112
111
|
// flow 的方式处理所有的配置到 G2 API
|
|
113
|
-
return
|
|
112
|
+
return utils_1.flow(common_1.theme, common_1.pattern('areaStyle'), common_1.transformations('rect'), geometry, adaptor_1.meta, adjust, adaptor_1.axis, adaptor_1.legend, common_1.tooltip, label, common_1.slider, common_1.annotation(), common_1.interaction, common_1.animation, common_1.limitInPlot)(params);
|
|
114
113
|
}
|
|
115
114
|
exports.adaptor = adaptor;
|
|
116
115
|
//# sourceMappingURL=adaptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/area/adaptor.ts"],"names":[],"mappings":";;;;AACA,mCAAwC;AACxC,+CAU8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/area/adaptor.ts"],"names":[],"mappings":";;;;AACA,mCAAwC;AACxC,+CAU8B;AAC9B,uDAA6D;AAG7D,qCAA6E;AAC7E,yDAAyE;AACzE,2CAAqD;AAG5C,qFAHc,cAAI,OAGd;AAEb;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA2B;IACnC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAEhC,IAAA,IAAI,GAWF,OAAO,KAXL,EACJ,SAAS,GAUP,OAAO,UAVA,EACT,KAAK,GASH,OAAO,MATJ,EACE,YAAY,GAQjB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\nimport {\n animation,\n annotation,\n interaction,\n limitInPlot,\n pattern,\n slider,\n theme,\n tooltip,\n transformations,\n} from '../../adaptor/common';\nimport { area, line, point } from '../../adaptor/geometries';\nimport { Params } from '../../core/adaptor';\nimport { Datum } from '../../types';\nimport { deepAssign, findGeometry, flow, transformLabel } from '../../utils';\nimport { getDataWhetherPercentage } from '../../utils/transform/percent';\nimport { axis, legend, meta } from '../line/adaptor';\nimport { AreaOptions } from './types';\n\nexport { meta };\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<AreaOptions>): Params<AreaOptions> {\n const { chart, options } = params;\n const {\n data,\n areaStyle,\n color,\n point: pointMapping,\n line: lineMapping,\n isPercent,\n xField,\n yField,\n tooltip,\n seriesField,\n startOnZero,\n } = options;\n const pointState = pointMapping?.state;\n\n const chartData = getDataWhetherPercentage(data, yField, xField, yField, isPercent);\n chart.data(chartData);\n // 百分比堆积图,默认会给一个 % 格式化逻辑, 用户可自定义\n const tooltipOptions = isPercent\n ? {\n formatter: (datum: Datum) => ({\n name: datum[seriesField] || datum[xField],\n value: (Number(datum[yField]) * 100).toFixed(2) + '%',\n }),\n ...tooltip,\n }\n : tooltip;\n const primary = deepAssign({}, params, {\n options: {\n area: { color, style: areaStyle },\n point: pointMapping && {\n color,\n ...pointMapping,\n },\n tooltip: tooltipOptions,\n // label 不传递给各个 geometry adaptor,由 label adaptor 处理\n label: undefined,\n args: {\n startOnZero,\n },\n },\n });\n // 线默认 2px (折线不能复用面积图的 state,因为 fill 和 stroke 不匹配)\n const lineParams = {\n chart,\n options: deepAssign({ line: { size: 2 } }, omit(options as any, ['state']), {\n // 颜色保持一致,因为如果颜色不一致,会导致 tooltip 中元素重复。\n // 如果存在,才设置,否则为空\n line: lineMapping && {\n color,\n ...lineMapping,\n },\n sizeField: seriesField,\n state: lineMapping?.state,\n tooltip: false,\n // label 不传递给各个 geometry adaptor,由 label adaptor 处理\n label: undefined,\n args: {\n startOnZero,\n },\n }),\n };\n const pointParams = deepAssign({}, primary, { options: { tooltip: false, state: pointState } });\n\n // area geometry 处理\n area(primary);\n line(lineParams);\n point(pointParams);\n\n return params;\n}\n\n/**\n * 数据标签\n * @param params\n */\nfunction label(params: Params<AreaOptions>): Params<AreaOptions> {\n const { chart, options } = params;\n const { label, yField } = options;\n\n const areaGeometry = findGeometry(chart, 'area');\n\n // label 为 false, 空 则不显示 label\n if (!label) {\n areaGeometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n areaGeometry.label({\n fields: [yField],\n callback,\n cfg: {\n layout: [\n { type: 'limit-in-plot' },\n { type: 'path-adjust-position' },\n { type: 'point-adjust-position' },\n { type: 'limit-in-plot', cfg: { action: 'hide' } },\n ],\n ...transformLabel(cfg),\n },\n });\n }\n\n return params;\n}\n\n/**\n * 处理 adjust\n * @param params\n */\nfunction adjust(params: Params<AreaOptions>): Params<AreaOptions> {\n const { chart, options } = params;\n const { isStack, isPercent, seriesField } = options;\n if ((isPercent || isStack) && seriesField) {\n each(chart.geometries, (g: Geometry) => {\n g.adjust('stack');\n });\n }\n\n return params;\n}\n\n/**\n * 折线图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<AreaOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n theme,\n pattern('areaStyle'),\n transformations('rect'),\n geometry,\n meta,\n adjust,\n axis,\n legend,\n tooltip,\n label,\n slider,\n annotation(),\n interaction,\n animation,\n limitInPlot\n )(params);\n}\n"]}
|