@antv/g2plot 2.4.20 → 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 +1627 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- 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 +2 -11
- 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 +2 -2
- package/esm/adaptor/geometries/base.js +4 -2
- 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 +3 -3
- 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 +5 -17
- package/esm/plots/chord/adaptor.js.map +1 -1
- package/esm/plots/chord/constant.d.ts +4 -4
- package/esm/plots/chord/constant.js +4 -4
- package/esm/plots/chord/constant.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 +7 -5
- 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 +5 -6
- package/esm/plots/facet/types.js.map +1 -1
- package/esm/plots/facet/utils.js +2 -11
- package/esm/plots/facet/utils.js.map +1 -1
- package/esm/plots/funnel/adaptor.d.ts +5 -0
- package/esm/plots/funnel/adaptor.js +34 -5
- package/esm/plots/funnel/adaptor.js.map +1 -1
- package/esm/plots/funnel/geometries/basic.d.ts +5 -0
- package/esm/plots/funnel/geometries/basic.js +11 -7
- package/esm/plots/funnel/geometries/basic.js.map +1 -1
- package/esm/plots/funnel/geometries/common.d.ts +2 -1
- package/esm/plots/funnel/geometries/common.js +7 -4
- package/esm/plots/funnel/geometries/common.js.map +1 -1
- package/esm/plots/funnel/geometries/compare.d.ts +1 -0
- package/esm/plots/funnel/geometries/compare.js +40 -33
- 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 +4 -3
- package/esm/plots/funnel/index.js +1 -0
- package/esm/plots/funnel/index.js.map +1 -1
- package/esm/plots/funnel/interactions/funnel-conversion-tag.d.ts +9 -0
- package/esm/plots/funnel/interactions/funnel-conversion-tag.js +57 -0
- package/esm/plots/funnel/interactions/funnel-conversion-tag.js.map +1 -0
- package/esm/plots/funnel/interactions/index.d.ts +5 -0
- package/esm/plots/funnel/interactions/index.js +10 -0
- package/esm/plots/funnel/interactions/index.js.map +1 -0
- package/esm/plots/funnel/types.d.ts +2 -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 +7 -6
- package/esm/plots/gauge/utils.js.map +1 -1
- package/esm/plots/heatmap/adaptor.js +11 -14
- 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 +6 -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 +8 -6
- 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 +6 -1
- package/esm/plots/pie/types.js.map +1 -1
- package/esm/plots/progress/adaptor.js +3 -4
- 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/progress/utils.d.ts +1 -0
- package/esm/plots/progress/utils.js +4 -1
- package/esm/plots/progress/utils.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 +4 -13
- 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.d.ts +3 -1
- package/esm/plots/stock/utils.js +5 -3
- 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 +6 -14
- 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 +12 -11
- 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/conversion.js +4 -3
- package/esm/utils/conversion.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 -10
- package/esm/utils/index.js +10 -10
- 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 +8 -1
- package/esm/utils/view.js +27 -0
- 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 +1 -10
- 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 +2 -2
- package/lib/adaptor/geometries/base.js +3 -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 +2 -2
- 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 -15
- package/lib/plots/chord/adaptor.js.map +1 -1
- package/lib/plots/chord/constant.d.ts +4 -4
- package/lib/plots/chord/constant.js +4 -4
- package/lib/plots/chord/constant.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 +5 -3
- 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 +5 -6
- package/lib/plots/facet/types.js.map +1 -1
- package/lib/plots/facet/utils.js +1 -10
- package/lib/plots/facet/utils.js.map +1 -1
- package/lib/plots/funnel/adaptor.d.ts +5 -0
- package/lib/plots/funnel/adaptor.js +34 -4
- package/lib/plots/funnel/adaptor.js.map +1 -1
- package/lib/plots/funnel/geometries/basic.d.ts +5 -0
- package/lib/plots/funnel/geometries/basic.js +9 -4
- package/lib/plots/funnel/geometries/basic.js.map +1 -1
- package/lib/plots/funnel/geometries/common.d.ts +2 -1
- package/lib/plots/funnel/geometries/common.js +6 -3
- package/lib/plots/funnel/geometries/common.js.map +1 -1
- package/lib/plots/funnel/geometries/compare.d.ts +1 -0
- package/lib/plots/funnel/geometries/compare.js +39 -31
- 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 +4 -3
- package/lib/plots/funnel/index.js +1 -0
- package/lib/plots/funnel/index.js.map +1 -1
- package/lib/plots/funnel/interactions/funnel-conversion-tag.d.ts +9 -0
- package/lib/plots/funnel/interactions/funnel-conversion-tag.js +60 -0
- package/lib/plots/funnel/interactions/funnel-conversion-tag.js.map +1 -0
- package/lib/plots/funnel/interactions/index.d.ts +5 -0
- package/lib/plots/funnel/interactions/index.js +13 -0
- package/lib/plots/funnel/interactions/index.js.map +1 -0
- package/lib/plots/funnel/types.d.ts +2 -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 +5 -4
- package/lib/plots/gauge/utils.js.map +1 -1
- package/lib/plots/heatmap/adaptor.js +12 -15
- 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 +7 -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 +5 -3
- 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 +6 -1
- package/lib/plots/pie/types.js.map +1 -1
- package/lib/plots/progress/adaptor.js +2 -3
- 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/progress/utils.d.ts +1 -0
- package/lib/plots/progress/utils.js +4 -1
- package/lib/plots/progress/utils.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 +4 -13
- 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.d.ts +3 -1
- package/lib/plots/stock/utils.js +4 -2
- 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 +4 -12
- 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 +12 -11
- 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/conversion.js +4 -3
- package/lib/utils/conversion.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 -10
- package/lib/utils/index.js +23 -22
- 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 +8 -1
- package/lib/utils/view.js +29 -1
- package/lib/utils/view.js.map +1 -1
- package/package.json +9 -22
- package/src/adaptor/brush.ts +3 -4
- package/src/adaptor/common.ts +5 -14
- 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 +6 -4
- 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 +6 -6
- 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 +5 -18
- package/src/plots/chord/constant.ts +4 -4
- 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 +13 -11
- 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 +5 -6
- package/src/plots/facet/utils.ts +4 -12
- package/src/plots/funnel/adaptor.ts +36 -6
- package/src/plots/funnel/geometries/basic.ts +15 -10
- package/src/plots/funnel/geometries/common.ts +9 -6
- package/src/plots/funnel/geometries/compare.ts +54 -45
- 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 +5 -5
- package/src/plots/funnel/interactions/funnel-conversion-tag.ts +57 -0
- package/src/plots/funnel/interactions/index.ts +11 -0
- package/src/plots/funnel/types.ts +2 -1
- package/src/plots/gauge/adaptor.ts +2 -2
- package/src/plots/gauge/index.ts +5 -6
- package/src/plots/gauge/utils.ts +7 -6
- package/src/plots/heatmap/adaptor.ts +13 -15
- 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 +7 -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 +10 -8
- 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 +6 -1
- package/src/plots/progress/adaptor.ts +5 -6
- package/src/plots/progress/index.ts +2 -2
- package/src/plots/progress/types.ts +1 -1
- package/src/plots/progress/utils.ts +4 -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 +4 -13
- 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 +5 -4
- 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 +8 -17
- 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 +13 -11
- package/src/types/index.ts +7 -7
- package/src/types/state.ts +2 -2
- package/src/utils/conversion.ts +6 -3
- 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 -10
- 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 +34 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"word-cloud.js","sourceRoot":"","sources":["../../../src/utils/transform/word-cloud.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AAkBvD,IAAM,eAAe,GAAY;IAC/B,IAAI,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO;IACnB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IAChB,MAAM,EAAE,aAAa;IACrB,6CAA6C;IAC7C,YAAY,EAAE,IAAI;CAEnB,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,OAA0B;IACjE,SAAS;IACT,OAAO,GAAG,aAAM,CAAC,EAAa,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,SAAS,CAAC,KAAK,EAAE,OAAkB,CAAC,CAAC;AAC9C,CAAC;AAJD,8BAIC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,OAAgB;IACvD,OAAO;IACP,IAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,OAAO,CACzG,UAAC,GAAW;QACV,IAAI,CAAC,YAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CA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B,CAAC,CAAC;IAEF,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;QAC5B,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QACxB,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QACxB,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC1B,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC;QACzB,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QACxB,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { isNil, isFunction, assign } from '@antv/util';\r\nimport { Tag, Word } from '../../plots/word-cloud/types';\r\n\r\ntype FontWeight = number | 'normal' | 'bold' | 'bolder' | 'lighter';\r\n\r\nexport interface Options {\r\n size: [number, number];\r\n font?: string | ((row: Word, index?: number, words?: Word[]) => string);\r\n fontSize?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n fontWeight?: FontWeight | ((row: Word, index?: number, words?: Word[]) => FontWeight);\r\n rotate?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n padding?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n spiral?: 'archimedean' | 'rectangular' | ((size: [number, number]) => (t: number) => number[]);\r\n random?: number | (() => number);\r\n timeInterval?: number;\r\n imageMask?: HTMLImageElement;\r\n}\r\n\r\nconst DEFAULT_OPTIONS: Options = {\r\n font: () => 'serif',\r\n padding: 1,\r\n size: [500, 500],\r\n spiral: 'archimedean', // 'archimedean' || 'rectangular' || {function}\r\n // timeInterval: Infinity // max execute time\r\n timeInterval: 3000, // max execute time\r\n // imageMask: '', // instance of Image, must be loaded\r\n};\r\n\r\n/**\r\n * 根据对应的数据对象,计算每个\r\n * 词语在画布中的渲染位置,并返回\r\n * 计算后的数据对象\r\n * @param words\r\n * @param options\r\n */\r\nexport function wordCloud(words: Word[], options?: Partial<Options>): Tag[] {\r\n // 混入默认配置\r\n options = assign({} as Options, DEFAULT_OPTIONS, options);\r\n return transform(words, options as Options);\r\n}\r\n\r\n/**\r\n * 抛出没有混入默认配置的方法,用于测试。\r\n * @param words\r\n * @param options\r\n */\r\nexport function transform(words: Word[], options: Options) {\r\n // 布局对象\r\n const layout = tagCloud();\r\n ['font', 'fontSize', 'fontWeight', 'padding', 'rotate', 'size', 'spiral', 'timeInterval', 'random'].forEach(\r\n (key: string) => {\r\n if (!isNil(options[key])) {\r\n layout[key](options[key]);\r\n }\r\n }\r\n );\r\n\r\n layout.words(words);\r\n if (options.imageMask) {\r\n layout.createMask(options.imageMask);\r\n }\r\n\r\n const result = layout.start();\r\n const tags: any[] = result._tags;\r\n\r\n tags.forEach((tag) => {\r\n tag.x += options.size[0] / 2;\r\n tag.y += options.size[1] / 2;\r\n });\r\n\r\n const [w, h] = options.size;\r\n // 添加两个参照数据,分别表示左上角和右下角。\r\n // 不添加的话不会按照真实的坐标渲染,而是以\r\n // 数据中的边界坐标为边界进行拉伸,以铺满画布。\r\n // 这样的后果会导致词语之间的重叠。\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: 0,\r\n y: 0,\r\n opacity: 0,\r\n });\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: w,\r\n y: h,\r\n opacity: 0,\r\n });\r\n\r\n return tags;\r\n}\r\n\r\n/*\r\n * Synchronous version of d3-cloud\r\n */\r\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\r\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\r\n/* eslint-disable no-return-assign, no-cond-assign */\r\n\r\ninterface Item {\r\n value: number;\r\n text: string;\r\n sprite: boolean;\r\n}\r\n\r\nconst cloudRadians = Math.PI / 180,\r\n cw = (1 << 11) >> 5,\r\n ch = 1 << 11;\r\n\r\nfunction cloudText(d: Item) {\r\n return d.text;\r\n}\r\n\r\nfunction cloudFont() {\r\n return 'serif';\r\n}\r\n\r\nfunction cloudFontNormal() {\r\n return 'normal';\r\n}\r\n\r\nfunction cloudFontSize(d: Item) {\r\n return d.value;\r\n}\r\n\r\nfunction cloudRotate() {\r\n return ~~(Math.random() * 2) * 90;\r\n}\r\n\r\nfunction cloudPadding() {\r\n return 1;\r\n}\r\n\r\n// Fetches a monochrome sprite bitmap for the specified text.\r\n// Load in batches for speed.\r\nfunction cloudSprite(contextAndRatio, d, data, di) {\r\n if (d.sprite) return;\r\n const c = contextAndRatio.context,\r\n ratio = contextAndRatio.ratio;\r\n\r\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\r\n let x = 0,\r\n y = 0,\r\n maxh = 0;\r\n const n = data.length;\r\n --di;\r\n while (++di < n) {\r\n d = data[di];\r\n c.save();\r\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\r\n let w = c.measureText(d.text + 'm').width * ratio,\r\n h = d.size << 1;\r\n if (d.rotate) {\r\n const sr = Math.sin(d.rotate * cloudRadians),\r\n cr = Math.cos(d.rotate * cloudRadians),\r\n wcr = w * cr,\r\n wsr = w * sr,\r\n hcr = h * cr,\r\n hsr = h * sr;\r\n w = ((Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5) << 5;\r\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\r\n } else {\r\n w = ((w + 0x1f) >> 5) << 5;\r\n }\r\n if (h > maxh) maxh = h;\r\n if (x + w >= cw << 5) {\r\n x = 0;\r\n y += maxh;\r\n maxh = 0;\r\n }\r\n if (y + h >= ch) break;\r\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\r\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\r\n c.fillText(d.text, 0, 0);\r\n if (d.padding) {\r\n c.lineWidth = 2 * d.padding;\r\n c.strokeText(d.text, 0, 0);\r\n }\r\n c.restore();\r\n d.width = w;\r\n d.height = h;\r\n d.xoff = x;\r\n d.yoff = y;\r\n d.x1 = w >> 1;\r\n d.y1 = h >> 1;\r\n d.x0 = -d.x1;\r\n d.y0 = -d.y1;\r\n d.hasText = true;\r\n x += w;\r\n }\r\n const pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\r\n sprite = [];\r\n while (--di >= 0) {\r\n d = data[di];\r\n if (!d.hasText) continue;\r\n const w = d.width,\r\n w32 = w >> 5;\r\n let h = d.y1 - d.y0;\r\n // Zero the buffer\r\n for (let i = 0; i < h * w32; i++) sprite[i] = 0;\r\n x = d.xoff;\r\n if (x == null) return;\r\n y = d.yoff;\r\n let seen = 0,\r\n seenRow = -1;\r\n for (let j = 0; j < h; j++) {\r\n for (let i = 0; i < w; i++) {\r\n const k = w32 * j + (i >> 5),\r\n m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\r\n sprite[k] |= m;\r\n seen |= m;\r\n }\r\n if (seen) seenRow = j;\r\n else {\r\n d.y0++;\r\n h--;\r\n j--;\r\n y++;\r\n }\r\n }\r\n d.y1 = d.y0 + seenRow;\r\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\r\n }\r\n}\r\n\r\n// Use mask-based collision detection.\r\nfunction cloudCollide(tag, board, sw) {\r\n sw >>= 5;\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let x = (tag.y + tag.y0) * sw + (lx >> 5),\r\n last;\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\r\n }\r\n x += sw;\r\n }\r\n return false;\r\n}\r\n\r\nfunction cloudBounds(bounds, d) {\r\n const b0 = bounds[0],\r\n b1 = bounds[1];\r\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\r\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\r\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\r\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\r\n}\r\n\r\nfunction collideRects(a, b) {\r\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\r\n}\r\n\r\nfunction archimedeanSpiral(size) {\r\n const e = size[0] / size[1];\r\n return function (t) {\r\n return [e * (t *= 0.1) * Math.cos(t), t * Math.sin(t)];\r\n };\r\n}\r\n\r\nfunction rectangularSpiral(size) {\r\n const dy = 4,\r\n dx = (dy * size[0]) / size[1];\r\n let x = 0,\r\n y = 0;\r\n return function (t) {\r\n const sign = t < 0 ? -1 : 1;\r\n // See triangular numbers: T_n = n * (n + 1) / 2.\r\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\r\n case 0:\r\n x += dx;\r\n break;\r\n case 1:\r\n y += dy;\r\n break;\r\n case 2:\r\n x -= dx;\r\n break;\r\n default:\r\n y -= dy;\r\n break;\r\n }\r\n return [x, y];\r\n };\r\n}\r\n\r\n// TODO reuse arrays?\r\nfunction zeroArray(n) {\r\n const a = [];\r\n let i = -1;\r\n while (++i < n) a[i] = 0;\r\n return a;\r\n}\r\n\r\nfunction cloudCanvas() {\r\n return document.createElement('canvas');\r\n}\r\n\r\nexport function functor(d) {\r\n return isFunction(d)\r\n ? d\r\n : function () {\r\n return d;\r\n };\r\n}\r\n\r\nconst spirals = {\r\n archimedean: archimedeanSpiral,\r\n rectangular: rectangularSpiral,\r\n};\r\n\r\nfunction tagCloud() {\r\n let size = [256, 256],\r\n font = cloudFont,\r\n fontSize = cloudFontSize,\r\n fontWeight = cloudFontNormal,\r\n rotate = cloudRotate,\r\n padding = cloudPadding,\r\n spiral = archimedeanSpiral,\r\n random = Math.random,\r\n words = [],\r\n timeInterval = Infinity;\r\n\r\n const text = cloudText;\r\n const fontStyle = cloudFontNormal;\r\n const canvas = cloudCanvas;\r\n const cloud: any = {};\r\n\r\n cloud.start = function () {\r\n const [width, height] = size;\r\n const contextAndRatio = getContext(canvas()),\r\n board = cloud.board ? cloud.board : zeroArray((size[0] >> 5) * size[1]),\r\n n = words.length,\r\n tags = [],\r\n data = words\r\n .map(function (d, i, data) {\r\n d.text = text.call(this, d, i, data);\r\n d.font = font.call(this, d, i, data);\r\n d.style = fontStyle.call(this, d, i, data);\r\n d.weight = fontWeight.call(this, d, i, data);\r\n d.rotate = rotate.call(this, d, i, data);\r\n d.size = ~~fontSize.call(this, d, i, data);\r\n d.padding = padding.call(this, d, i, data);\r\n return d;\r\n })\r\n .sort(function (a, b) {\r\n return b.size - a.size;\r\n });\r\n let i = -1,\r\n bounds = !cloud.board\r\n ? null\r\n : [\r\n {\r\n x: 0,\r\n y: 0,\r\n },\r\n {\r\n x: width,\r\n y: height,\r\n },\r\n ];\r\n\r\n step();\r\n\r\n function step() {\r\n const start = Date.now();\r\n while (Date.now() - start < timeInterval && ++i < n) {\r\n const d = data[i];\r\n d.x = (width * (random() + 0.5)) >> 1;\r\n d.y = (height * (random() + 0.5)) >> 1;\r\n cloudSprite(contextAndRatio, d, data, i);\r\n if (d.hasText && place(board, d, bounds)) {\r\n tags.push(d);\r\n if (bounds) {\r\n if (!cloud.hasImage) {\r\n // update bounds if image mask not set\r\n cloudBounds(bounds, d);\r\n }\r\n } else {\r\n bounds = [\r\n { x: d.x + d.x0, y: d.y + d.y0 },\r\n { x: d.x + d.x1, y: d.y + d.y1 },\r\n ];\r\n }\r\n // Temporary hack\r\n d.x -= size[0] >> 1;\r\n d.y -= size[1] >> 1;\r\n }\r\n }\r\n cloud._tags = tags;\r\n cloud._bounds = bounds;\r\n }\r\n\r\n return cloud;\r\n };\r\n\r\n function getContext(canvas: HTMLCanvasElement) {\r\n canvas.width = canvas.height = 1;\r\n const ratio = Math.sqrt(canvas.getContext('2d')!.getImageData(0, 0, 1, 1).data.length >> 2);\r\n canvas.width = (cw << 5) / ratio;\r\n canvas.height = ch / ratio;\r\n\r\n const context = canvas.getContext('2d') as CanvasRenderingContext2D;\r\n context.fillStyle = context.strokeStyle = 'red';\r\n context.textAlign = 'center';\r\n return { context, ratio };\r\n }\r\n\r\n function place(board, tag, bounds) {\r\n // const perimeter = [{ x: 0, y: 0 }, { x: size[0], y: size[1] }],\r\n const startX = tag.x,\r\n startY = tag.y,\r\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\r\n s = spiral(size),\r\n dt = random() < 0.5 ? 1 : -1;\r\n let dxdy,\r\n t = -dt,\r\n dx,\r\n dy;\r\n\r\n while ((dxdy = s((t += dt)))) {\r\n dx = ~~dxdy[0];\r\n dy = ~~dxdy[1];\r\n\r\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\r\n\r\n tag.x = startX + dx;\r\n tag.y = startY + dy;\r\n\r\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\r\n // TODO only check for collisions within current bounds.\r\n if (!bounds || !cloudCollide(tag, board, size[0])) {\r\n if (!bounds || collideRects(tag, bounds)) {\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n sw = size[0] >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let last,\r\n x = (tag.y + tag.y0) * sw + (lx >> 5);\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\r\n }\r\n x += sw;\r\n }\r\n delete tag.sprite;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n cloud.createMask = (img: HTMLImageElement) => {\r\n const can: HTMLCanvasElement = document.createElement('canvas');\r\n const [width, height] = size;\r\n\r\n // 当 width 或 height 为 0 时,调用 cxt.getImageData 会报错\r\n if (!width || !height) {\r\n return;\r\n }\r\n const w32 = width >> 5;\r\n const board = zeroArray((width >> 5) * height);\r\n can.width = width;\r\n can.height = height;\r\n const cxt = can.getContext('2d') as CanvasRenderingContext2D;\r\n cxt.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\r\n const imageData = cxt.getImageData(0, 0, width, height).data;\r\n for (let j = 0; j < height; j++) {\r\n for (let i = 0; i < width; i++) {\r\n const k = w32 * j + (i >> 5);\r\n const tmp = (j * width + i) << 2;\r\n const flag = imageData[tmp] >= 250 && imageData[tmp + 1] >= 250 && imageData[tmp + 2] >= 250;\r\n const m = flag ? 1 << (31 - (i % 32)) : 0;\r\n board[k] |= m;\r\n }\r\n }\r\n cloud.board = board;\r\n cloud.hasImage = true;\r\n };\r\n\r\n cloud.timeInterval = function (_) {\r\n timeInterval = _ == null ? Infinity : _;\r\n };\r\n\r\n cloud.words = function (_) {\r\n words = _;\r\n };\r\n\r\n cloud.size = function (_) {\r\n size = [+_[0], +_[1]];\r\n };\r\n\r\n cloud.font = function (_) {\r\n font = functor(_);\r\n };\r\n\r\n cloud.fontWeight = function (_) {\r\n fontWeight = functor(_);\r\n };\r\n\r\n cloud.rotate = function (_) {\r\n rotate = functor(_);\r\n };\r\n\r\n cloud.spiral = function (_) {\r\n spiral = spirals[_] || _;\r\n };\r\n\r\n cloud.fontSize = function (_) {\r\n fontSize = functor(_);\r\n };\r\n\r\n cloud.padding = function (_) {\r\n padding = functor(_);\r\n };\r\n\r\n cloud.random = function (_) {\r\n random = functor(_);\r\n };\r\n\r\n return cloud;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"word-cloud.js","sourceRoot":"","sources":["../../../src/utils/transform/word-cloud.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AAkBvD,IAAM,eAAe,GAAY;IAC/B,IAAI,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO;IACnB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IAChB,MAAM,EAAE,aAAa;IACrB,6CAA6C;IAC7C,YAAY,EAAE,IAAI;CAEnB,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,OAA0B;IACjE,SAAS;IACT,OAAO,GAAG,aAAM,CAAC,EAAa,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,SAAS,CAAC,KAAK,EAAE,OAAkB,CAAC,CAAC;AAC9C,CAAC;AAJD,8BAIC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,OAAgB;IACvD,OAAO;IACP,IAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,OAAO,CACzG,UAAC,GAAW;QACV,IAAI,CAAC,YAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3B;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACtC;IAED,IAAM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AAC,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QACxB,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QAC1B,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC;QACzB,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;QACxB,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { assign, isFunction, isNil } from '@antv/util';\r\nimport { Tag, Word } from '../../plots/word-cloud/types';\r\n\r\ntype FontWeight = number | 'normal' | 'bold' | 'bolder' | 'lighter';\r\n\r\nexport interface Options {\r\n size: [number, number];\r\n font?: string | ((row: Word, index?: number, words?: Word[]) => string);\r\n fontSize?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n fontWeight?: FontWeight | ((row: Word, index?: number, words?: Word[]) => FontWeight);\r\n rotate?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n padding?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n spiral?: 'archimedean' | 'rectangular' | ((size: [number, number]) => (t: number) => number[]);\r\n random?: number | (() => number);\r\n timeInterval?: number;\r\n imageMask?: HTMLImageElement;\r\n}\r\n\r\nconst DEFAULT_OPTIONS: Options = {\r\n font: () => 'serif',\r\n padding: 1,\r\n size: [500, 500],\r\n spiral: 'archimedean', // 'archimedean' || 'rectangular' || {function}\r\n // timeInterval: Infinity // max execute time\r\n timeInterval: 3000, // max execute time\r\n // imageMask: '', // instance of Image, must be loaded\r\n};\r\n\r\n/**\r\n * 根据对应的数据对象,计算每个\r\n * 词语在画布中的渲染位置,并返回\r\n * 计算后的数据对象\r\n * @param words\r\n * @param options\r\n */\r\nexport function wordCloud(words: Word[], options?: Partial<Options>): Tag[] {\r\n // 混入默认配置\r\n options = assign({} as Options, DEFAULT_OPTIONS, options);\r\n return transform(words, options as Options);\r\n}\r\n\r\n/**\r\n * 抛出没有混入默认配置的方法,用于测试。\r\n * @param words\r\n * @param options\r\n */\r\nexport function transform(words: Word[], options: Options) {\r\n // 布局对象\r\n const layout = tagCloud();\r\n ['font', 'fontSize', 'fontWeight', 'padding', 'rotate', 'size', 'spiral', 'timeInterval', 'random'].forEach(\r\n (key: string) => {\r\n if (!isNil(options[key])) {\r\n layout[key](options[key]);\r\n }\r\n }\r\n );\r\n\r\n layout.words(words);\r\n if (options.imageMask) {\r\n layout.createMask(options.imageMask);\r\n }\r\n\r\n const result = layout.start();\r\n const tags: any[] = result._tags;\r\n\r\n tags.forEach((tag) => {\r\n tag.x += options.size[0] / 2;\r\n tag.y += options.size[1] / 2;\r\n });\r\n\r\n const [w, h] = options.size;\r\n // 添加两个参照数据,分别表示左上角和右下角。\r\n // 不添加的话不会按照真实的坐标渲染,而是以\r\n // 数据中的边界坐标为边界进行拉伸,以铺满画布。\r\n // 这样的后果会导致词语之间的重叠。\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: 0,\r\n y: 0,\r\n opacity: 0,\r\n });\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: w,\r\n y: h,\r\n opacity: 0,\r\n });\r\n\r\n return tags;\r\n}\r\n\r\n/*\r\n * Synchronous version of d3-cloud\r\n */\r\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\r\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\r\n/* eslint-disable no-return-assign, no-cond-assign */\r\n\r\ninterface Item {\r\n value: number;\r\n text: string;\r\n sprite: boolean;\r\n}\r\n\r\nconst cloudRadians = Math.PI / 180,\r\n cw = (1 << 11) >> 5,\r\n ch = 1 << 11;\r\n\r\nfunction cloudText(d: Item) {\r\n return d.text;\r\n}\r\n\r\nfunction cloudFont() {\r\n return 'serif';\r\n}\r\n\r\nfunction cloudFontNormal() {\r\n return 'normal';\r\n}\r\n\r\nfunction cloudFontSize(d: Item) {\r\n return d.value;\r\n}\r\n\r\nfunction cloudRotate() {\r\n return ~~(Math.random() * 2) * 90;\r\n}\r\n\r\nfunction cloudPadding() {\r\n return 1;\r\n}\r\n\r\n// Fetches a monochrome sprite bitmap for the specified text.\r\n// Load in batches for speed.\r\nfunction cloudSprite(contextAndRatio, d, data, di) {\r\n if (d.sprite) return;\r\n const c = contextAndRatio.context,\r\n ratio = contextAndRatio.ratio;\r\n\r\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\r\n let x = 0,\r\n y = 0,\r\n maxh = 0;\r\n const n = data.length;\r\n --di;\r\n while (++di < n) {\r\n d = data[di];\r\n c.save();\r\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\r\n let w = c.measureText(d.text + 'm').width * ratio,\r\n h = d.size << 1;\r\n if (d.rotate) {\r\n const sr = Math.sin(d.rotate * cloudRadians),\r\n cr = Math.cos(d.rotate * cloudRadians),\r\n wcr = w * cr,\r\n wsr = w * sr,\r\n hcr = h * cr,\r\n hsr = h * sr;\r\n w = ((Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5) << 5;\r\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\r\n } else {\r\n w = ((w + 0x1f) >> 5) << 5;\r\n }\r\n if (h > maxh) maxh = h;\r\n if (x + w >= cw << 5) {\r\n x = 0;\r\n y += maxh;\r\n maxh = 0;\r\n }\r\n if (y + h >= ch) break;\r\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\r\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\r\n c.fillText(d.text, 0, 0);\r\n if (d.padding) {\r\n c.lineWidth = 2 * d.padding;\r\n c.strokeText(d.text, 0, 0);\r\n }\r\n c.restore();\r\n d.width = w;\r\n d.height = h;\r\n d.xoff = x;\r\n d.yoff = y;\r\n d.x1 = w >> 1;\r\n d.y1 = h >> 1;\r\n d.x0 = -d.x1;\r\n d.y0 = -d.y1;\r\n d.hasText = true;\r\n x += w;\r\n }\r\n const pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\r\n sprite = [];\r\n while (--di >= 0) {\r\n d = data[di];\r\n if (!d.hasText) continue;\r\n const w = d.width,\r\n w32 = w >> 5;\r\n let h = d.y1 - d.y0;\r\n // Zero the buffer\r\n for (let i = 0; i < h * w32; i++) sprite[i] = 0;\r\n x = d.xoff;\r\n if (x == null) return;\r\n y = d.yoff;\r\n let seen = 0,\r\n seenRow = -1;\r\n for (let j = 0; j < h; j++) {\r\n for (let i = 0; i < w; i++) {\r\n const k = w32 * j + (i >> 5),\r\n m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\r\n sprite[k] |= m;\r\n seen |= m;\r\n }\r\n if (seen) seenRow = j;\r\n else {\r\n d.y0++;\r\n h--;\r\n j--;\r\n y++;\r\n }\r\n }\r\n d.y1 = d.y0 + seenRow;\r\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\r\n }\r\n}\r\n\r\n// Use mask-based collision detection.\r\nfunction cloudCollide(tag, board, sw) {\r\n sw >>= 5;\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let x = (tag.y + tag.y0) * sw + (lx >> 5),\r\n last;\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\r\n }\r\n x += sw;\r\n }\r\n return false;\r\n}\r\n\r\nfunction cloudBounds(bounds, d) {\r\n const b0 = bounds[0],\r\n b1 = bounds[1];\r\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\r\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\r\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\r\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\r\n}\r\n\r\nfunction collideRects(a, b) {\r\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\r\n}\r\n\r\nfunction archimedeanSpiral(size) {\r\n const e = size[0] / size[1];\r\n return function (t) {\r\n return [e * (t *= 0.1) * Math.cos(t), t * Math.sin(t)];\r\n };\r\n}\r\n\r\nfunction rectangularSpiral(size) {\r\n const dy = 4,\r\n dx = (dy * size[0]) / size[1];\r\n let x = 0,\r\n y = 0;\r\n return function (t) {\r\n const sign = t < 0 ? -1 : 1;\r\n // See triangular numbers: T_n = n * (n + 1) / 2.\r\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\r\n case 0:\r\n x += dx;\r\n break;\r\n case 1:\r\n y += dy;\r\n break;\r\n case 2:\r\n x -= dx;\r\n break;\r\n default:\r\n y -= dy;\r\n break;\r\n }\r\n return [x, y];\r\n };\r\n}\r\n\r\n// TODO reuse arrays?\r\nfunction zeroArray(n) {\r\n const a = [];\r\n let i = -1;\r\n while (++i < n) a[i] = 0;\r\n return a;\r\n}\r\n\r\nfunction cloudCanvas() {\r\n return document.createElement('canvas');\r\n}\r\n\r\nexport function functor(d) {\r\n return isFunction(d)\r\n ? d\r\n : function () {\r\n return d;\r\n };\r\n}\r\n\r\nconst spirals = {\r\n archimedean: archimedeanSpiral,\r\n rectangular: rectangularSpiral,\r\n};\r\n\r\nfunction tagCloud() {\r\n let size = [256, 256],\r\n font = cloudFont,\r\n fontSize = cloudFontSize,\r\n fontWeight = cloudFontNormal,\r\n rotate = cloudRotate,\r\n padding = cloudPadding,\r\n spiral = archimedeanSpiral,\r\n random = Math.random,\r\n words = [],\r\n timeInterval = Infinity;\r\n\r\n const text = cloudText;\r\n const fontStyle = cloudFontNormal;\r\n const canvas = cloudCanvas;\r\n const cloud: any = {};\r\n\r\n cloud.start = function () {\r\n const [width, height] = size;\r\n const contextAndRatio = getContext(canvas()),\r\n board = cloud.board ? cloud.board : zeroArray((size[0] >> 5) * size[1]),\r\n n = words.length,\r\n tags = [],\r\n data = words\r\n .map(function (d, i, data) {\r\n d.text = text.call(this, d, i, data);\r\n d.font = font.call(this, d, i, data);\r\n d.style = fontStyle.call(this, d, i, data);\r\n d.weight = fontWeight.call(this, d, i, data);\r\n d.rotate = rotate.call(this, d, i, data);\r\n d.size = ~~fontSize.call(this, d, i, data);\r\n d.padding = padding.call(this, d, i, data);\r\n return d;\r\n })\r\n .sort(function (a, b) {\r\n return b.size - a.size;\r\n });\r\n let i = -1,\r\n bounds = !cloud.board\r\n ? null\r\n : [\r\n {\r\n x: 0,\r\n y: 0,\r\n },\r\n {\r\n x: width,\r\n y: height,\r\n },\r\n ];\r\n\r\n step();\r\n\r\n function step() {\r\n const start = Date.now();\r\n while (Date.now() - start < timeInterval && ++i < n) {\r\n const d = data[i];\r\n d.x = (width * (random() + 0.5)) >> 1;\r\n d.y = (height * (random() + 0.5)) >> 1;\r\n cloudSprite(contextAndRatio, d, data, i);\r\n if (d.hasText && place(board, d, bounds)) {\r\n tags.push(d);\r\n if (bounds) {\r\n if (!cloud.hasImage) {\r\n // update bounds if image mask not set\r\n cloudBounds(bounds, d);\r\n }\r\n } else {\r\n bounds = [\r\n { x: d.x + d.x0, y: d.y + d.y0 },\r\n { x: d.x + d.x1, y: d.y + d.y1 },\r\n ];\r\n }\r\n // Temporary hack\r\n d.x -= size[0] >> 1;\r\n d.y -= size[1] >> 1;\r\n }\r\n }\r\n cloud._tags = tags;\r\n cloud._bounds = bounds;\r\n }\r\n\r\n return cloud;\r\n };\r\n\r\n function getContext(canvas: HTMLCanvasElement) {\r\n canvas.width = canvas.height = 1;\r\n const ratio = Math.sqrt(canvas.getContext('2d')!.getImageData(0, 0, 1, 1).data.length >> 2);\r\n canvas.width = (cw << 5) / ratio;\r\n canvas.height = ch / ratio;\r\n\r\n const context = canvas.getContext('2d') as CanvasRenderingContext2D;\r\n context.fillStyle = context.strokeStyle = 'red';\r\n context.textAlign = 'center';\r\n return { context, ratio };\r\n }\r\n\r\n function place(board, tag, bounds) {\r\n // const perimeter = [{ x: 0, y: 0 }, { x: size[0], y: size[1] }],\r\n const startX = tag.x,\r\n startY = tag.y,\r\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\r\n s = spiral(size),\r\n dt = random() < 0.5 ? 1 : -1;\r\n let dxdy,\r\n t = -dt,\r\n dx,\r\n dy;\r\n\r\n while ((dxdy = s((t += dt)))) {\r\n dx = ~~dxdy[0];\r\n dy = ~~dxdy[1];\r\n\r\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\r\n\r\n tag.x = startX + dx;\r\n tag.y = startY + dy;\r\n\r\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\r\n // TODO only check for collisions within current bounds.\r\n if (!bounds || !cloudCollide(tag, board, size[0])) {\r\n if (!bounds || collideRects(tag, bounds)) {\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n sw = size[0] >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let last,\r\n x = (tag.y + tag.y0) * sw + (lx >> 5);\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\r\n }\r\n x += sw;\r\n }\r\n delete tag.sprite;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n cloud.createMask = (img: HTMLImageElement) => {\r\n const can: HTMLCanvasElement = document.createElement('canvas');\r\n const [width, height] = size;\r\n\r\n // 当 width 或 height 为 0 时,调用 cxt.getImageData 会报错\r\n if (!width || !height) {\r\n return;\r\n }\r\n const w32 = width >> 5;\r\n const board = zeroArray((width >> 5) * height);\r\n can.width = width;\r\n can.height = height;\r\n const cxt = can.getContext('2d') as CanvasRenderingContext2D;\r\n cxt.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\r\n const imageData = cxt.getImageData(0, 0, width, height).data;\r\n for (let j = 0; j < height; j++) {\r\n for (let i = 0; i < width; i++) {\r\n const k = w32 * j + (i >> 5);\r\n const tmp = (j * width + i) << 2;\r\n const flag = imageData[tmp] >= 250 && imageData[tmp + 1] >= 250 && imageData[tmp + 2] >= 250;\r\n const m = flag ? 1 << (31 - (i % 32)) : 0;\r\n board[k] |= m;\r\n }\r\n }\r\n cloud.board = board;\r\n cloud.hasImage = true;\r\n };\r\n\r\n cloud.timeInterval = function (_) {\r\n timeInterval = _ == null ? Infinity : _;\r\n };\r\n\r\n cloud.words = function (_) {\r\n words = _;\r\n };\r\n\r\n cloud.size = function (_) {\r\n size = [+_[0], +_[1]];\r\n };\r\n\r\n cloud.font = function (_) {\r\n font = functor(_);\r\n };\r\n\r\n cloud.fontWeight = function (_) {\r\n fontWeight = functor(_);\r\n };\r\n\r\n cloud.rotate = function (_) {\r\n rotate = functor(_);\r\n };\r\n\r\n cloud.spiral = function (_) {\r\n spiral = spirals[_] || _;\r\n };\r\n\r\n cloud.fontSize = function (_) {\r\n fontSize = functor(_);\r\n };\r\n\r\n cloud.padding = function (_) {\r\n padding = functor(_);\r\n };\r\n\r\n cloud.random = function (_) {\r\n random = functor(_);\r\n };\r\n\r\n return cloud;\r\n}\r\n"]}
|
package/lib/utils/view.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { View } from '@antv/g2';
|
|
1
|
+
import { Geometry, Types, View } from '@antv/g2';
|
|
2
|
+
import { Options } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* 在 Chart 中查找特定 id 的子 View
|
|
4
5
|
* @param chart
|
|
@@ -19,3 +20,9 @@ export declare function getViews(view: View): View[];
|
|
|
19
20
|
* @ignore
|
|
20
21
|
*/
|
|
21
22
|
export declare function getSiblingViews(view: View): View[];
|
|
23
|
+
/**
|
|
24
|
+
* 所有的 Geometries 都使用同一动画(各个图形如有区别,自行覆盖)并添加处理动画回调
|
|
25
|
+
* @param view View
|
|
26
|
+
* @param animation 动画配置
|
|
27
|
+
*/
|
|
28
|
+
export declare function addViewAnimation(view: View, animation: Options['animation'], geometries?: Geometry<Types.ShapePoint>[]): void;
|
package/lib/utils/view.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSiblingViews = exports.getViews = exports.findViewById = void 0;
|
|
3
|
+
exports.addViewAnimation = exports.getSiblingViews = exports.getViews = exports.findViewById = void 0;
|
|
4
|
+
var util_1 = require("@antv/util");
|
|
4
5
|
/**
|
|
5
6
|
* 在 Chart 中查找特定 id 的子 View
|
|
6
7
|
* @param chart
|
|
@@ -31,4 +32,31 @@ function getSiblingViews(view) {
|
|
|
31
32
|
return getViews(view).filter(function (sub) { return sub !== view; });
|
|
32
33
|
}
|
|
33
34
|
exports.getSiblingViews = getSiblingViews;
|
|
35
|
+
/**
|
|
36
|
+
* 所有的 Geometries 都使用同一动画(各个图形如有区别,自行覆盖)并添加处理动画回调
|
|
37
|
+
* @param view View
|
|
38
|
+
* @param animation 动画配置
|
|
39
|
+
*/
|
|
40
|
+
function addViewAnimation(view, animation, geometries) {
|
|
41
|
+
if (geometries === void 0) { geometries = view.geometries; }
|
|
42
|
+
// 同时设置整个 view 动画选项
|
|
43
|
+
if (typeof animation === 'boolean') {
|
|
44
|
+
view.animate(animation);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
view.animate(true);
|
|
48
|
+
}
|
|
49
|
+
// 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)
|
|
50
|
+
util_1.each(geometries, function (g) {
|
|
51
|
+
var animationCfg;
|
|
52
|
+
if (util_1.isFunction(animation)) {
|
|
53
|
+
animationCfg = animation(g.type || g.shapeType, g) || true;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
animationCfg = animation;
|
|
57
|
+
}
|
|
58
|
+
g.animate(animationCfg);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.addViewAnimation = addViewAnimation;
|
|
34
62
|
//# sourceMappingURL=view.js.map
|
package/lib/utils/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/utils/view.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/utils/view.ts"],"names":[],"mappings":";;;AACA,mCAA8C;AAI9C;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAW,EAAE,EAAU;IAClD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAC,IAAU,IAAK,OAAA,IAAI,CAAC,EAAE,KAAK,EAAE,EAAd,CAAc,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAU;IACjC,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC;AAHD,4BAGC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,KAAK,IAAI,EAAZ,CAAY,CAAC,CAAC;AACtD,CAAC;AAFD,0CAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,IAAU,EACV,SAA+B,EAC/B,UAA0D;IAA1D,2BAAA,EAAA,aAA2C,IAAI,CAAC,UAAU;IAE1D,mBAAmB;IACnB,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE;QAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACzB;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB;IAED,sCAAsC;IACtC,WAAI,CAAC,UAAU,EAAE,UAAC,CAAW;QAC3B,IAAI,YAAY,CAAC;QACjB,IAAI,iBAAU,CAAC,SAAS,CAAC,EAAE;YACzB,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;SAC5D;aAAM;YACL,YAAY,GAAG,SAAS,CAAC;SAC1B;QAED,CAAC,CAAC,OAAO,CAAC,YAAyB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAvBD,4CAuBC","sourcesContent":["import { Geometry, Types, View } from '@antv/g2';\nimport { each, isFunction } from '@antv/util';\nimport { Options } from '../types';\nimport { Animation } from '../types/animation';\n\n/**\n * 在 Chart 中查找特定 id 的子 View\n * @param chart\n * @param id\n */\nexport function findViewById(chart: View, id: string): View {\n return chart.views.find((view: View) => view.id === id);\n}\n\n/**\n * 获取同 view 同一级的所有 views\n * @param view 当前 view\n * @returns 同一级的 views\n * @ignore\n */\nexport function getViews(view: View): View[] {\n const parent = view.parent;\n return parent ? parent.views : [];\n}\n\n/**\n * 获取同 view 同一级的 views,不包括自身\n * @param view 当前 view\n * @returns 同一级的 views\n * @ignore\n */\nexport function getSiblingViews(view: View): View[] {\n return getViews(view).filter((sub) => sub !== view);\n}\n\n/**\n * 所有的 Geometries 都使用同一动画(各个图形如有区别,自行覆盖)并添加处理动画回调\n * @param view View\n * @param animation 动画配置\n */\nexport function addViewAnimation(\n view: View,\n animation: Options['animation'],\n geometries: Geometry<Types.ShapePoint>[] = view.geometries\n) {\n // 同时设置整个 view 动画选项\n if (typeof animation === 'boolean') {\n view.animate(animation);\n } else {\n view.animate(true);\n }\n\n // 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)\n each(geometries, (g: Geometry) => {\n let animationCfg;\n if (isFunction(animation)) {\n animationCfg = animation(g.type || g.shapeType, g) || true;\n } else {\n animationCfg = animation;\n }\n\n g.animate(animationCfg as Animation);\n });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g2plot",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.23",
|
|
4
4
|
"description": "An interactive and responsive charting library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chart",
|
|
@@ -24,11 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/antvis/G2plot"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"start": "
|
|
28
|
-
"site:develop": "cross-env PORT=8080 gatsby develop --open -H 0.0.0.0",
|
|
29
|
-
"site:build": "NODE_OPTIONS='--max_old_space_size=8192' npm run site:clean && gatsby build --prefix-paths",
|
|
30
|
-
"site:clean": "gatsby clean",
|
|
31
|
-
"site:deploy": "npm run build && npm run site:build && gh-pages -d public",
|
|
27
|
+
"start": "cd site && npm start",
|
|
32
28
|
"fix": "eslint --ext .ts ./src ./__tests__ --fix && prettier --write ./src ./__tests__ && lint-md --fix ./examples ./docs",
|
|
33
29
|
"build": "run-s clean lib dist size",
|
|
34
30
|
"size": "limit-size",
|
|
@@ -45,8 +41,7 @@
|
|
|
45
41
|
"ci": "run-s lint coverage build",
|
|
46
42
|
"changelog": "generate-changelog",
|
|
47
43
|
"prepublishOnly": "run-s lint test build",
|
|
48
|
-
"analyze": "webpack --profile --json > dist/stats.json && webpack-bundle-analyzer ./dist/stats.json"
|
|
49
|
-
"contributors:add": "all-contributors add"
|
|
44
|
+
"analyze": "webpack --profile --json > dist/stats.json && webpack-bundle-analyzer ./dist/stats.json"
|
|
50
45
|
},
|
|
51
46
|
"husky": {
|
|
52
47
|
"hooks": {
|
|
@@ -67,7 +62,6 @@
|
|
|
67
62
|
},
|
|
68
63
|
"devDependencies": {
|
|
69
64
|
"@antv/data-set": "^0.11.5",
|
|
70
|
-
"@antv/gatsby-theme-antv": "^1.1.15",
|
|
71
65
|
"@babel/core": "^7.10.4",
|
|
72
66
|
"@babel/plugin-transform-runtime": "^7.11.5",
|
|
73
67
|
"@babel/preset-env": "^7.10.4",
|
|
@@ -77,20 +71,15 @@
|
|
|
77
71
|
"@types/jest": "^25.2.1",
|
|
78
72
|
"@typescript-eslint/eslint-plugin": "^2.0.0",
|
|
79
73
|
"@typescript-eslint/parser": "^2.0.0",
|
|
80
|
-
"all-contributors-cli": "^6.20.0",
|
|
81
74
|
"antd": "^4.8.4",
|
|
82
75
|
"babel-loader": "^8.1.0",
|
|
83
|
-
"chroma-js": "^2.1.2",
|
|
84
76
|
"conventional-changelog-cli": "^2.0.34",
|
|
85
77
|
"cross-env": "^7.0.2",
|
|
86
78
|
"eslint": "^6.1.0",
|
|
87
79
|
"eslint-config-prettier": "^6.0.0",
|
|
88
80
|
"eslint-plugin-import": "^2.22.0",
|
|
89
81
|
"eslint-plugin-prettier": "^3.1.0",
|
|
90
|
-
"gatsby": "^2.24.63",
|
|
91
|
-
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.27",
|
|
92
82
|
"generate-changelog": "^1.8.0",
|
|
93
|
-
"gh-pages": "^3.1.0",
|
|
94
83
|
"husky": "^4.2.3",
|
|
95
84
|
"jest": "^26.0.1",
|
|
96
85
|
"jest-electron": "^0.1.7",
|
|
@@ -102,7 +91,6 @@
|
|
|
102
91
|
"miz": "^1.0.1",
|
|
103
92
|
"npm-run-all": "^4.1.5",
|
|
104
93
|
"prettier": "^2.0.1",
|
|
105
|
-
"rc-for-plots": "^0.0.1",
|
|
106
94
|
"react": "^16.11.0",
|
|
107
95
|
"react-dom": "^16.11.0",
|
|
108
96
|
"react-i18next": "^11.7.0",
|
|
@@ -155,11 +143,10 @@
|
|
|
155
143
|
"gzip": true
|
|
156
144
|
}
|
|
157
145
|
],
|
|
158
|
-
"license": "MIT",
|
|
159
146
|
"resolutions": {
|
|
160
|
-
"
|
|
161
|
-
"@
|
|
162
|
-
"@
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
147
|
+
"d3-array": "2.12.1",
|
|
148
|
+
"@types/lodash": "4.14.182",
|
|
149
|
+
"@types/babel__traverse": "7.0.6"
|
|
150
|
+
},
|
|
151
|
+
"license": "MIT"
|
|
152
|
+
}
|
package/src/adaptor/brush.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { filter } from '@antv/util';
|
|
2
2
|
import { Params } from '../core/adaptor';
|
|
3
|
-
import { getInteractionCfg } from '../interactions/brush';
|
|
4
|
-
import { deepAssign } from '../utils';
|
|
5
|
-
import { Options as BaseOptions, BrushCfg, Interaction, Writable } from '../types';
|
|
6
|
-
|
|
7
3
|
/** 先引入brush 交互 */
|
|
8
4
|
import '../interactions/brush';
|
|
5
|
+
import { getInteractionCfg } from '../interactions/brush';
|
|
6
|
+
import { BrushCfg, Interaction, Options as BaseOptions, Writable } from '../types';
|
|
7
|
+
import { deepAssign } from '../utils';
|
|
9
8
|
|
|
10
9
|
type Options = Pick<BaseOptions, 'interactions'> & { brush?: BrushCfg };
|
|
11
10
|
|
package/src/adaptor/common.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Geometry, Types } from '@antv/g2';
|
|
2
2
|
import { each, isNil, isObject } from '@antv/util';
|
|
3
|
+
import { AXIS_META_CONFIG_KEYS } from '../constant';
|
|
3
4
|
import { Params } from '../core/adaptor';
|
|
4
5
|
import { Options } from '../types';
|
|
5
|
-
import { Interaction } from '../types/interaction';
|
|
6
|
-
import { Transformations } from '../types/coordinate';
|
|
7
6
|
import { Axis } from '../types/axis';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { Transformations } from '../types/coordinate';
|
|
8
|
+
import { Interaction } from '../types/interaction';
|
|
9
|
+
import { addViewAnimation, deepAssign, pick } from '../utils';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 通用 legend 配置, 适用于带 colorField 或 seriesField 的图表
|
|
@@ -69,17 +69,8 @@ export function animation<O extends Pick<Options, 'animation'>>(params: Params<O
|
|
|
69
69
|
const { chart, options } = params;
|
|
70
70
|
const { animation } = options;
|
|
71
71
|
|
|
72
|
-
// 同时设置整个 view 动画选项
|
|
73
|
-
if (typeof animation === 'boolean') {
|
|
74
|
-
chart.animate(animation);
|
|
75
|
-
} else {
|
|
76
|
-
chart.animate(true);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
72
|
// 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)
|
|
80
|
-
|
|
81
|
-
g.animate(animation);
|
|
82
|
-
});
|
|
73
|
+
addViewAnimation(chart, animation);
|
|
83
74
|
|
|
84
75
|
return params;
|
|
85
76
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Coordinate, Element, Geometry, getTheme, IGroup, ShapeAttrs, View } from '@antv/g2';
|
|
2
|
+
import { each, find, isObject, map } from '@antv/util';
|
|
3
3
|
import { Params } from '../core/adaptor';
|
|
4
|
+
import { Options } from '../types';
|
|
4
5
|
import { deepAssign } from '../utils';
|
|
5
6
|
import { conversionTagFormatter } from '../utils/conversion';
|
|
6
|
-
import { Options } from '../types';
|
|
7
7
|
|
|
8
8
|
/** 转化率组件配置选项 */
|
|
9
9
|
export interface ConversionTagOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params } from '../../core/adaptor';
|
|
2
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
3
2
|
import { deepAssign } from '../../utils';
|
|
4
|
-
import {
|
|
3
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
5
5
|
|
|
6
6
|
export interface AreaGeometryOptions extends GeometryOptions {
|
|
7
7
|
/** x 轴字段 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isEmpty, isFunction, isNumber, isObject, isString, uniq } from '@antv/util';
|
|
2
2
|
import { Params } from '../../core/adaptor';
|
|
3
|
-
import { ColorAttr, ShapeAttr, SizeAttr, StyleAttr, TooltipAttr
|
|
3
|
+
import { ColorAttr, Datum, Options, RawFields, ShapeAttr, SizeAttr, StyleAttr, TooltipAttr } from '../../types';
|
|
4
4
|
import { Label } from '../../types/label';
|
|
5
5
|
import { State } from '../../types/state';
|
|
6
6
|
import { transformLabel } from '../../utils';
|
|
@@ -43,7 +43,7 @@ export type Geometry = {
|
|
|
43
43
|
/** tooltip 的映射字段 */
|
|
44
44
|
readonly tooltipFields?: string[] | false;
|
|
45
45
|
/** 其他原始字段, 用于 mapping 回调参数 */
|
|
46
|
-
readonly rawFields?:
|
|
46
|
+
readonly rawFields?: RawFields;
|
|
47
47
|
/** 图形映射规则 */
|
|
48
48
|
readonly mapping?: MappingOptions;
|
|
49
49
|
/** label 映射通道,因为历史原因导致实现略有区别 */
|
|
@@ -73,9 +73,11 @@ export function getMappingField(
|
|
|
73
73
|
mappingFields: string[];
|
|
74
74
|
tileMappingField: string;
|
|
75
75
|
} {
|
|
76
|
-
const { type, xField, yField, colorField, shapeField, sizeField, styleField
|
|
76
|
+
const { type, xField, yField, colorField, shapeField, sizeField, styleField } = o;
|
|
77
|
+
let { rawFields } = o;
|
|
77
78
|
|
|
78
79
|
let fields = [];
|
|
80
|
+
rawFields = (isFunction(rawFields) ? rawFields(type, field) : rawFields) || [];
|
|
79
81
|
|
|
80
82
|
// 因为 color 会影响到数据分组,以及最后的图形映射。所以导致 bar 图中的 widthRatio 设置不生效
|
|
81
83
|
// 所以对于 color 字段,仅仅保留 colorField 好了! + rawFields
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params } from '../../core/adaptor';
|
|
2
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
3
2
|
import { deepAssign } from '../../utils';
|
|
4
|
-
import {
|
|
3
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
5
5
|
|
|
6
6
|
export interface EdgeGeometryOptions extends GeometryOptions {
|
|
7
7
|
/** x 轴字段 */
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export type { GeometryOptions } from './base';
|
|
2
1
|
export { area } from './area';
|
|
3
2
|
export type { AreaGeometryOptions } from './area';
|
|
3
|
+
export type { GeometryOptions } from './base';
|
|
4
|
+
export { edge } from './edge';
|
|
5
|
+
export type { EdgeGeometryOptions } from './edge';
|
|
6
|
+
export { interval } from './interval';
|
|
7
|
+
export type { IntervalGeometryOptions } from './interval';
|
|
4
8
|
export { line } from './line';
|
|
5
9
|
export type { LineGeometryOptions } from './line';
|
|
6
10
|
export { point } from './point';
|
|
7
11
|
export type { PointGeometryOptions } from './point';
|
|
8
|
-
export { interval } from './interval';
|
|
9
|
-
export type { IntervalGeometryOptions } from './interval';
|
|
10
12
|
export { polygon } from './polygon';
|
|
11
13
|
export type { PolygonGeometryOptions } from './polygon';
|
|
12
|
-
export { edge } from './edge';
|
|
13
|
-
export type { EdgeGeometryOptions } from './edge';
|
|
14
14
|
export { schema } from './schema';
|
|
15
15
|
export type { SchemaGeometryOptions } from './schema';
|
|
16
16
|
export { violin } from './violin';
|
|
@@ -3,7 +3,7 @@ import { isNil, isObject } from '@antv/util';
|
|
|
3
3
|
import { Params } from '../../core/adaptor';
|
|
4
4
|
import { deepAssign } from '../../utils';
|
|
5
5
|
import { getTooltipMapping } from '../../utils/tooltip';
|
|
6
|
-
import { GeometryOptions, MappingOptions
|
|
6
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
7
7
|
|
|
8
8
|
export interface IntervalGeometryOptions extends GeometryOptions {
|
|
9
9
|
/** x 轴字段 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepMix } from '@antv/util';
|
|
2
2
|
import { Params } from '../../core/adaptor';
|
|
3
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
3
|
import { deepAssign } from '../../utils';
|
|
5
|
-
import {
|
|
4
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
5
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
6
6
|
|
|
7
7
|
export interface LineGeometryOptions extends GeometryOptions {
|
|
8
8
|
/** x 轴字段 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params } from '../../core/adaptor';
|
|
2
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
3
2
|
import { deepAssign } from '../../utils';
|
|
4
|
-
import {
|
|
3
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
5
5
|
|
|
6
6
|
export interface PointGeometryOptions extends GeometryOptions {
|
|
7
7
|
/** x 轴字段 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params } from '../../core/adaptor';
|
|
2
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
3
2
|
import { deepAssign } from '../../utils';
|
|
4
|
-
import {
|
|
3
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
5
5
|
|
|
6
6
|
export interface PolygonGeometryOptions extends GeometryOptions {
|
|
7
7
|
/** x 轴字段 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params } from '../../core/adaptor';
|
|
2
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
3
2
|
import { deepAssign } from '../../utils';
|
|
4
|
-
import {
|
|
3
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
5
5
|
|
|
6
6
|
export interface SchemaGeometryOptions extends GeometryOptions {
|
|
7
7
|
/** x 轴字段 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Params } from '../../core/adaptor';
|
|
2
|
-
import { getTooltipMapping } from '../../utils/tooltip';
|
|
3
2
|
import { deepAssign } from '../../utils';
|
|
4
|
-
import {
|
|
3
|
+
import { getTooltipMapping } from '../../utils/tooltip';
|
|
4
|
+
import { geometry, GeometryOptions, MappingOptions } from './base';
|
|
5
5
|
|
|
6
6
|
export interface ViolinGeometryOptions extends GeometryOptions {
|
|
7
7
|
/** x 轴字段 */
|
package/src/adaptor/pattern.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Util } from '@antv/g2';
|
|
2
2
|
import { get } from '@antv/util';
|
|
3
|
-
import { getCanvasPattern } from '../utils/pattern';
|
|
4
3
|
import { Params } from '../core/adaptor';
|
|
5
4
|
import { Datum, Options, StyleAttr } from '../types';
|
|
6
5
|
import { deepAssign } from '../utils';
|
|
6
|
+
import { getCanvasPattern } from '../utils/pattern';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 使用 Pattern 通道的 options,要求有 colorField/seriesField/stackField 作为分类字段(进行颜色映射)
|
package/src/core/plot.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Chart, Event, Element, View } from '@antv/g2';
|
|
2
|
-
import { each } from '@antv/util';
|
|
3
1
|
import EE from '@antv/event-emitter';
|
|
2
|
+
import { Chart, Element, Event, View } from '@antv/g2';
|
|
3
|
+
import { each } from '@antv/util';
|
|
4
4
|
import { bind } from 'size-sensor';
|
|
5
|
-
import { Options,
|
|
6
|
-
import {
|
|
5
|
+
import { Annotation, Options, Size, StateCondition, StateName, StateObject } from '../types';
|
|
6
|
+
import { deepAssign, getAllElementsRecursively, getContainerSize, pick } from '../utils';
|
|
7
7
|
import { Adaptor } from './adaptor';
|
|
8
8
|
|
|
9
9
|
/** 单独 pick 出来的用于基类的类型定义 */
|