@visactor/vchart 0.0.1-alpha.2 → 0.2.1-alpha.0
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/README.md +82 -1
- package/build/index.js +2680 -2068
- package/build/index.min.js +2 -2
- package/cjs/animation/utils.d.ts +2 -1
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/chart/base-chart.js +2 -2
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/{boxplot/boxPlot.js → box-plot/box-plot.js} +1 -1
- package/cjs/chart/box-plot/box-plot.js.map +1 -0
- package/{esm/chart/boxplot → cjs/chart/box-plot}/index.d.ts +1 -1
- package/cjs/chart/{boxplot → box-plot}/index.js +1 -1
- package/cjs/chart/box-plot/index.js.map +1 -0
- package/cjs/chart/box-plot/interface.js.map +1 -0
- package/cjs/chart/index.d.ts +3 -1
- package/cjs/chart/index.js +2 -1
- package/cjs/chart/index.js.map +1 -1
- package/cjs/chart/treemap/treemap.js.map +1 -1
- package/cjs/compile/compilable-base.js +1 -1
- package/cjs/compile/compiler.d.ts +2 -2
- package/cjs/compile/compiler.js +24 -25
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/grammar-item.js +1 -1
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/compile/util.js +1 -1
- package/cjs/component/axis/base-axis.d.ts +70 -1
- package/cjs/component/axis/base-axis.js +93 -4
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +0 -1
- package/cjs/component/axis/cartesian/axis.js +3 -6
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +0 -1
- package/cjs/component/axis/polar/axis.js +3 -6
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/utils.d.ts +13 -70
- package/cjs/component/axis/utils.js +23 -109
- package/cjs/component/axis/utils.js.map +1 -1
- package/cjs/component/base/base-component.d.ts +0 -5
- package/cjs/component/base/base-component.js +8 -19
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/base/util.d.ts +1 -1
- package/cjs/component/base/util.js +20 -9
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +0 -1
- package/cjs/component/crosshair/base.js +1 -4
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.js +4 -1
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +2 -2
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/index.js +1 -1
- package/cjs/component/interface/index.d.ts +1 -0
- package/cjs/component/interface/index.js +1 -1
- package/cjs/component/interface/index.js.map +1 -1
- package/cjs/component/interface/theme.d.ts +38 -0
- package/cjs/component/interface/theme.js +6 -0
- package/cjs/component/interface/theme.js.map +1 -0
- package/cjs/component/label/label.d.ts +0 -1
- package/cjs/component/label/label.js +12 -6
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/legend/base-legend.js +5 -2
- package/cjs/component/legend/base-legend.js.map +1 -1
- package/cjs/component/legend/continuous/legend.d.ts +1 -1
- package/cjs/component/legend/continuous/legend.js +2 -2
- package/cjs/component/legend/continuous/legend.js.map +1 -1
- package/cjs/component/legend/discrete/legend.d.ts +1 -1
- package/cjs/component/legend/discrete/legend.js +2 -2
- package/cjs/component/legend/discrete/legend.js.map +1 -1
- package/cjs/component/legend/util.d.ts +4 -4
- package/cjs/component/map-label/component.js +2 -2
- package/cjs/component/map-label/component.js.map +1 -1
- package/cjs/component/map-label/interface.d.ts +6 -4
- package/cjs/component/map-label/interface.js.map +1 -1
- package/cjs/component/marker/utils.js +14 -9
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/component/player/interface/theme.d.ts +2 -1
- package/cjs/component/player/interface/theme.js.map +1 -1
- package/cjs/component/player/player.d.ts +0 -1
- package/cjs/component/player/player.js +0 -3
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/player/utils/transform.js.map +1 -1
- package/cjs/component/title/interface/theme.d.ts +4 -2
- package/cjs/component/title/interface/theme.js.map +1 -1
- package/cjs/component/title/title.d.ts +1 -1
- package/cjs/component/title/title.js +4 -6
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +5 -3
- package/cjs/component/tooltip/handler/base.js +9 -8
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +4 -5
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +4 -4
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +2 -4
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -2
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.d.ts +1 -1
- package/cjs/component/tooltip/tooltip.js +1 -1
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/box-plot.js +1 -2
- package/cjs/constant/label.js +2 -1
- package/cjs/core/factory.d.ts +1 -0
- package/cjs/core/factory.js +3 -0
- package/cjs/core/factory.js.map +1 -1
- package/cjs/core/instance-manager.d.ts +9 -0
- package/cjs/core/instance-manager.js +26 -0
- package/cjs/core/instance-manager.js.map +1 -0
- package/cjs/core/interface.js +1 -2
- package/cjs/core/vchart.d.ts +2 -6
- package/cjs/core/vchart.js +10 -23
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/event/event.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/mark/arc.d.ts +1 -1
- package/cjs/mark/arc.js +4 -3
- package/cjs/mark/arc.js.map +1 -1
- package/cjs/mark/area.d.ts +3 -2
- package/cjs/mark/area.js +8 -4
- package/cjs/mark/area.js.map +1 -1
- package/cjs/mark/base/base-mark.js +2 -1
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/base/index.d.ts +1 -2
- package/cjs/mark/base/index.js +1 -10
- package/cjs/mark/base/index.js.map +1 -1
- package/{esm/mark/boxPlot.d.ts → cjs/mark/box-plot.d.ts} +1 -1
- package/cjs/mark/{boxPlot.js → box-plot.js} +3 -3
- package/{esm/mark/boxPlot.js.map → cjs/mark/box-plot.js.map} +1 -1
- package/cjs/mark/component.d.ts +1 -1
- package/cjs/mark/component.js +2 -2
- package/cjs/mark/component.js.map +1 -1
- package/cjs/mark/line.d.ts +1 -1
- package/cjs/mark/line.js +2 -2
- package/cjs/mark/line.js.map +1 -1
- package/cjs/mark/linkPath.d.ts +1 -1
- package/cjs/mark/linkPath.js +4 -3
- package/cjs/mark/linkPath.js.map +1 -1
- package/cjs/mark/mark-set/index.d.ts +6 -5
- package/cjs/mark/mark-set/index.js +15 -12
- package/cjs/mark/mark-set/index.js.map +1 -1
- package/cjs/mark/path.d.ts +1 -1
- package/cjs/mark/path.js +2 -2
- package/cjs/mark/path.js.map +1 -1
- package/cjs/mark/polygon.d.ts +1 -1
- package/cjs/mark/polygon.js +3 -3
- package/cjs/mark/polygon.js.map +1 -1
- package/cjs/mark/progress-arc.js +1 -1
- package/cjs/mark/rect.d.ts +1 -1
- package/cjs/mark/rect.js +6 -5
- package/cjs/mark/rect.js.map +1 -1
- package/cjs/mark/rule.d.ts +1 -1
- package/cjs/mark/rule.js +3 -3
- package/cjs/mark/rule.js.map +1 -1
- package/cjs/mark/symbol.d.ts +1 -1
- package/cjs/mark/symbol.js +5 -4
- package/cjs/mark/symbol.js.map +1 -1
- package/cjs/mark/text.d.ts +1 -1
- package/cjs/mark/text.js +5 -4
- package/cjs/mark/text.js.map +1 -1
- package/cjs/model/base-model.d.ts +12 -5
- package/cjs/model/base-model.js +52 -29
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +8 -2
- package/cjs/model/interface.js.map +1 -1
- package/cjs/model/layout-item.js +20 -18
- package/cjs/model/layout-item.js.map +1 -1
- package/cjs/region/region.d.ts +1 -4
- package/cjs/region/region.js +16 -13
- package/cjs/region/region.js.map +1 -1
- package/cjs/scale/color-ordinal-scale.d.ts +8 -0
- package/cjs/scale/color-ordinal-scale.js +24 -0
- package/cjs/scale/color-ordinal-scale.js.map +1 -0
- package/cjs/scale/global-scale.js +2 -1
- package/cjs/scale/global-scale.js.map +1 -1
- package/cjs/series/area/area.d.ts +2 -0
- package/cjs/series/area/area.js +15 -9
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/area/interface.d.ts +5 -5
- package/cjs/series/area/interface.js.map +1 -1
- package/cjs/series/bar/bar.d.ts +6 -0
- package/cjs/series/bar/bar.js +24 -8
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/bar/interface.d.ts +5 -4
- package/cjs/series/bar/interface.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +10 -11
- package/cjs/series/base/base-series.js +53 -31
- package/cjs/series/base/base-series.js.map +1 -1
- package/{esm/series/box-plot/boxPlot.d.ts → cjs/series/box-plot/box-plot.d.ts} +2 -0
- package/cjs/series/box-plot/{boxPlot.js → box-plot.js} +16 -6
- package/cjs/series/box-plot/box-plot.js.map +1 -0
- package/cjs/series/box-plot/interface.d.ts +3 -2
- package/cjs/series/box-plot/interface.js.map +1 -1
- package/cjs/series/box-plot/tooltip-helper.js.map +1 -1
- package/cjs/series/cartesian/cartesian.d.ts +1 -1
- package/cjs/series/circle-packing/circle-packing.d.ts +2 -0
- package/cjs/series/circle-packing/circle-packing.js +13 -8
- package/cjs/series/circle-packing/circle-packing.js.map +1 -1
- package/cjs/series/circle-packing/interface.d.ts +5 -4
- package/cjs/series/circle-packing/interface.js.map +1 -1
- package/cjs/series/dot/dot.d.ts +6 -8
- package/cjs/series/dot/dot.js +43 -17
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/dot/interface.d.ts +10 -10
- package/cjs/series/dot/interface.js.map +1 -1
- package/cjs/series/funnel/funnel.d.ts +12 -2
- package/cjs/series/funnel/funnel.js +84 -23
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/funnel/interface.d.ts +16 -15
- package/cjs/series/funnel/interface.js.map +1 -1
- package/cjs/series/gauge/gauge-pointer.d.ts +2 -0
- package/cjs/series/gauge/gauge-pointer.js +22 -6
- package/cjs/series/gauge/gauge-pointer.js.map +1 -1
- package/cjs/series/gauge/gauge.d.ts +3 -2
- package/cjs/series/gauge/gauge.js +26 -17
- package/cjs/series/gauge/gauge.js.map +1 -1
- package/cjs/series/gauge/interface.d.ts +12 -11
- package/cjs/series/gauge/interface.js.map +1 -1
- package/cjs/series/heatmap/heatmap.d.ts +3 -1
- package/cjs/series/heatmap/heatmap.js +18 -9
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/heatmap/interface.d.ts +6 -5
- package/cjs/series/heatmap/interface.js.map +1 -1
- package/cjs/series/interface/common.d.ts +56 -1
- package/cjs/series/interface/common.js +24 -1
- package/cjs/series/interface/common.js.map +1 -1
- package/cjs/series/interface/series.d.ts +2 -1
- package/cjs/series/interface/series.js.map +1 -1
- package/cjs/series/line/line.d.ts +2 -0
- package/cjs/series/line/line.js +7 -5
- package/cjs/series/line/line.js.map +1 -1
- package/cjs/series/link/interface.d.ts +4 -4
- package/cjs/series/link/interface.js.map +1 -1
- package/cjs/series/link/link.d.ts +4 -7
- package/cjs/series/link/link.js +20 -14
- package/cjs/series/link/link.js.map +1 -1
- package/cjs/series/map/map.d.ts +2 -0
- package/cjs/series/map/map.js +13 -6
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +4 -3
- package/cjs/series/mixin/line-mixin.js +15 -7
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/interface.d.ts +7 -6
- package/cjs/series/pie/interface.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +8 -3
- package/cjs/series/pie/pie.js +61 -33
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/progress/circular/circular.d.ts +2 -0
- package/cjs/series/progress/circular/circular.js +16 -9
- package/cjs/series/progress/circular/circular.js.map +1 -1
- package/cjs/series/progress/circular/interface.d.ts +5 -4
- package/cjs/series/progress/circular/interface.js.map +1 -1
- package/cjs/series/progress/linear/interface.d.ts +6 -5
- package/cjs/series/progress/linear/interface.js.map +1 -1
- package/cjs/series/progress/linear/linear.d.ts +2 -0
- package/cjs/series/progress/linear/linear.js +31 -21
- package/cjs/series/progress/linear/linear.js.map +1 -1
- package/cjs/series/radar/interface.d.ts +5 -4
- package/cjs/series/radar/interface.js.map +1 -1
- package/cjs/series/radar/radar.d.ts +2 -0
- package/cjs/series/radar/radar.js +9 -4
- package/cjs/series/radar/radar.js.map +1 -1
- package/cjs/series/range-area/range-area.d.ts +2 -0
- package/cjs/series/range-area/range-area.js +4 -3
- package/cjs/series/range-area/range-area.js.map +1 -1
- package/cjs/series/range-column/interface.d.ts +9 -8
- package/cjs/series/range-column/interface.js.map +1 -1
- package/cjs/series/range-column/rangeColumn.d.ts +2 -0
- package/cjs/series/range-column/rangeColumn.js +28 -19
- package/cjs/series/range-column/rangeColumn.js.map +1 -1
- package/cjs/series/rose/interface.d.ts +3 -2
- package/cjs/series/rose/interface.js.map +1 -1
- package/cjs/series/rose/rose.d.ts +2 -0
- package/cjs/series/rose/rose.js +14 -13
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/sankey/animation.js.map +1 -1
- package/cjs/series/sankey/interface.d.ts +7 -6
- package/cjs/series/sankey/interface.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +2 -0
- package/cjs/series/sankey/sankey.js +25 -22
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/interface.d.ts +6 -5
- package/cjs/series/scatter/interface.js.map +1 -1
- package/cjs/series/scatter/scatter.d.ts +2 -0
- package/cjs/series/scatter/scatter.js +15 -10
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/sunburst/interface.d.ts +5 -4
- package/cjs/series/sunburst/interface.js.map +1 -1
- package/cjs/series/sunburst/sunburst.d.ts +3 -1
- package/cjs/series/sunburst/sunburst.js +9 -4
- package/cjs/series/sunburst/sunburst.js.map +1 -1
- package/cjs/series/treemap/interface.d.ts +9 -8
- package/cjs/series/treemap/interface.js.map +1 -1
- package/cjs/series/treemap/treemap.d.ts +2 -0
- package/cjs/series/treemap/treemap.js +19 -6
- package/cjs/series/treemap/treemap.js.map +1 -1
- package/cjs/series/waterfall/interface.d.ts +6 -5
- package/cjs/series/waterfall/interface.js.map +1 -1
- package/cjs/series/waterfall/waterfall.d.ts +2 -0
- package/cjs/series/waterfall/waterfall.js +15 -5
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/cjs/series/word-cloud/interface.d.ts +7 -6
- package/cjs/series/word-cloud/interface.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud.d.ts +4 -3
- package/cjs/series/word-cloud/word-cloud.js +22 -11
- package/cjs/series/word-cloud/word-cloud.js.map +1 -1
- package/cjs/theme/buildin-theme/config.d.ts +1 -4
- package/cjs/theme/buildin-theme/config.js +2 -18
- package/cjs/theme/buildin-theme/config.js.map +1 -1
- package/cjs/theme/buildin-theme/dark.js.map +1 -1
- package/cjs/theme/buildin-theme/light/color-scheme.js +14 -1
- package/cjs/theme/buildin-theme/light/color-scheme.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/axis/band-axis.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/axis/band-axis.js +22 -0
- package/cjs/theme/buildin-theme/light/component/axis/band-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/{cartesian-axis.d.ts → axis/cartesian-axis.d.ts} +1 -1
- package/cjs/theme/buildin-theme/light/component/{cartesian-axis.js → axis/cartesian-axis.js} +7 -9
- package/cjs/theme/buildin-theme/light/component/axis/cartesian-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/axis/common-axis.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/{common-axis.js → axis/common-axis.js} +32 -14
- package/cjs/theme/buildin-theme/light/component/axis/common-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/axis/linear-axis.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/axis/linear-axis.js +22 -0
- package/cjs/theme/buildin-theme/light/component/axis/linear-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/{polar-axis.d.ts → axis/polar-axis.d.ts} +1 -1
- package/cjs/theme/buildin-theme/light/component/axis/polar-axis.js +25 -0
- package/cjs/theme/buildin-theme/light/component/axis/polar-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/crosshair.js +9 -5
- package/cjs/theme/buildin-theme/light/component/crosshair.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/index.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/index.js +32 -0
- package/cjs/theme/buildin-theme/light/component/index.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/legend/color-legend.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/{color-legend.js → legend/color-legend.js} +3 -3
- package/cjs/theme/buildin-theme/light/component/legend/color-legend.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/legend/continuous.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/legend/continuous.js +60 -0
- package/cjs/theme/buildin-theme/light/component/legend/continuous.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/legend/discrete-legend.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/{discrete-legend.js → legend/discrete-legend.js} +17 -6
- package/cjs/theme/buildin-theme/light/component/legend/discrete-legend.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/legend/size-legend.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/{size-legend.js → legend/size-legend.js} +3 -3
- package/cjs/theme/buildin-theme/light/component/legend/size-legend.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/map-label.d.ts +2 -0
- package/cjs/{component/map-label/config.js → theme/buildin-theme/light/component/map-label.js} +8 -8
- package/cjs/theme/buildin-theme/light/component/map-label.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/player.js +20 -11
- package/cjs/theme/buildin-theme/light/component/player.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/title.js +19 -3
- package/cjs/theme/buildin-theme/light/component/title.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/tooltip.js +7 -3
- package/cjs/theme/buildin-theme/light/component/tooltip.js.map +1 -1
- package/cjs/theme/buildin-theme/light/constants.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/constants.js +16 -0
- package/cjs/theme/buildin-theme/light/constants.js.map +1 -0
- package/cjs/theme/buildin-theme/light/index.js +5 -20
- package/cjs/theme/buildin-theme/light/index.js.map +1 -1
- package/cjs/theme/buildin-theme/light/mark.d.ts +3 -0
- package/cjs/theme/buildin-theme/light/mark.js +72 -0
- package/cjs/theme/buildin-theme/light/mark.js.map +1 -0
- package/cjs/theme/buildin-theme/light/series/area.js +2 -12
- package/cjs/theme/buildin-theme/light/series/area.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/bar.js +2 -2
- package/cjs/theme/buildin-theme/light/series/bar.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/bar3d.js +2 -2
- package/cjs/theme/buildin-theme/light/series/bar3d.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/box-plot.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/series/box-plot.js +12 -0
- package/cjs/theme/buildin-theme/light/series/box-plot.js.map +1 -0
- package/cjs/theme/buildin-theme/light/series/circular-progress.js +11 -1
- package/cjs/theme/buildin-theme/light/series/circular-progress.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/funnel.js +8 -5
- package/cjs/theme/buildin-theme/light/series/funnel.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/funnel3d.js +9 -6
- package/cjs/theme/buildin-theme/light/series/funnel3d.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/gauge.js +6 -1
- package/cjs/theme/buildin-theme/light/series/gauge.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/index.js +5 -2
- package/cjs/theme/buildin-theme/light/series/index.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/line.js +2 -7
- package/cjs/theme/buildin-theme/light/series/line.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/linear-progress.js +5 -0
- package/cjs/theme/buildin-theme/light/series/linear-progress.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/map.js +8 -4
- package/cjs/theme/buildin-theme/light/series/map.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/pie.js +9 -2
- package/cjs/theme/buildin-theme/light/series/pie.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/pie3d.js +4 -3
- package/cjs/theme/buildin-theme/light/series/pie3d.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/radar.js +2 -12
- package/cjs/theme/buildin-theme/light/series/radar.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/rangeColumn.js +2 -2
- package/cjs/theme/buildin-theme/light/series/rangeColumn.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/rose.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/series/rose.js +20 -0
- package/cjs/theme/buildin-theme/light/series/rose.js.map +1 -0
- package/cjs/theme/buildin-theme/light/series/sankey.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/series/sankey.js +14 -0
- package/cjs/theme/buildin-theme/light/series/sankey.js.map +1 -0
- package/cjs/theme/buildin-theme/light/series/scatter.js +10 -4
- package/cjs/theme/buildin-theme/light/series/scatter.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/treemap.js +4 -4
- package/cjs/theme/buildin-theme/light/series/treemap.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/waterfall.js +3 -3
- package/cjs/theme/buildin-theme/light/series/waterfall.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/word-cloud3d.js +1 -1
- package/cjs/theme/buildin-theme/light/series/word-cloud3d.js.map +1 -1
- package/cjs/theme/color-scheme/interface.d.ts +16 -8
- package/cjs/theme/color-scheme/interface.js.map +1 -1
- package/cjs/theme/color-scheme/util.d.ts +6 -3
- package/cjs/theme/color-scheme/util.js +39 -10
- package/cjs/theme/color-scheme/util.js.map +1 -1
- package/cjs/theme/interface.d.ts +22 -38
- package/cjs/theme/interface.js.map +1 -1
- package/cjs/theme/theme-manager.d.ts +1 -0
- package/cjs/theme/theme-manager.js +5 -2
- package/cjs/theme/theme-manager.js.map +1 -1
- package/cjs/typings/spec/chart.d.ts +1 -1
- package/cjs/typings/spec/chart.js.map +1 -1
- package/cjs/typings/visual.d.ts +13 -12
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/util/color.d.ts +0 -3
- package/cjs/util/color.js +2 -12
- package/cjs/util/color.js.map +1 -1
- package/cjs/util/scale.d.ts +12 -1
- package/cjs/util/scale.js +4 -2
- package/cjs/util/scale.js.map +1 -1
- package/cjs/vchart-all.js +4 -4
- package/cjs/vchart-all.js.map +1 -1
- package/esm/animation/utils.d.ts +2 -1
- package/esm/animation/utils.js.map +1 -1
- package/esm/chart/base-chart.js +3 -3
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/{boxplot/boxPlot.js → box-plot/box-plot.js} +1 -1
- package/esm/chart/box-plot/box-plot.js.map +1 -0
- package/{cjs/chart/boxplot → esm/chart/box-plot}/index.d.ts +1 -1
- package/esm/chart/{boxplot → box-plot}/index.js +1 -1
- package/esm/chart/box-plot/index.js.map +1 -0
- package/esm/chart/box-plot/interface.js.map +1 -0
- package/esm/chart/index.d.ts +3 -1
- package/esm/chart/index.js +5 -1
- package/esm/chart/index.js.map +1 -1
- package/esm/chart/treemap/treemap.js.map +1 -1
- package/esm/compile/compilable-base.js +1 -1
- package/esm/compile/compiler.d.ts +2 -2
- package/esm/compile/compiler.js +24 -25
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/grammar-item.js +1 -1
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/compile/util.js +1 -1
- package/esm/component/axis/base-axis.d.ts +70 -1
- package/esm/component/axis/base-axis.js +98 -4
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +0 -1
- package/esm/component/axis/cartesian/axis.js +4 -7
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +0 -1
- package/esm/component/axis/polar/axis.js +4 -7
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/utils.d.ts +13 -70
- package/esm/component/axis/utils.js +12 -99
- package/esm/component/axis/utils.js.map +1 -1
- package/esm/component/base/base-component.d.ts +0 -5
- package/esm/component/base/base-component.js +7 -20
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/base/util.d.ts +1 -1
- package/esm/component/base/util.js +18 -9
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +0 -1
- package/esm/component/crosshair/base.js +1 -4
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.js +4 -1
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +2 -2
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/index.js +1 -1
- package/esm/component/interface/index.d.ts +1 -0
- package/esm/component/interface/index.js +2 -0
- package/esm/component/interface/index.js.map +1 -1
- package/esm/component/interface/theme.d.ts +38 -0
- package/esm/component/interface/theme.js +2 -0
- package/esm/component/interface/theme.js.map +1 -0
- package/esm/component/label/label.d.ts +0 -1
- package/esm/component/label/label.js +12 -6
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/legend/base-legend.js +5 -2
- package/esm/component/legend/base-legend.js.map +1 -1
- package/esm/component/legend/continuous/legend.d.ts +1 -1
- package/esm/component/legend/continuous/legend.js +2 -2
- package/esm/component/legend/continuous/legend.js.map +1 -1
- package/esm/component/legend/discrete/legend.d.ts +1 -1
- package/esm/component/legend/discrete/legend.js +2 -2
- package/esm/component/legend/discrete/legend.js.map +1 -1
- package/esm/component/legend/util.d.ts +4 -4
- package/esm/component/map-label/component.js +1 -5
- package/esm/component/map-label/component.js.map +1 -1
- package/esm/component/map-label/interface.d.ts +6 -4
- package/esm/component/map-label/interface.js.map +1 -1
- package/esm/component/marker/utils.js +14 -9
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/component/player/interface/theme.d.ts +2 -1
- package/esm/component/player/interface/theme.js.map +1 -1
- package/esm/component/player/player.d.ts +0 -1
- package/esm/component/player/player.js +0 -3
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/player/utils/transform.js.map +1 -1
- package/esm/component/title/interface/theme.d.ts +4 -2
- package/esm/component/title/interface/theme.js.map +1 -1
- package/esm/component/title/title.d.ts +1 -1
- package/esm/component/title/title.js +3 -6
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +5 -3
- package/esm/component/tooltip/handler/base.js +9 -8
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +4 -5
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +6 -6
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +2 -4
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +2 -3
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/base-tooltip-model.d.ts +1 -1
- package/esm/component/tooltip/tooltip.js +1 -1
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/box-plot.js +1 -2
- package/esm/constant/label.js +2 -1
- package/esm/core/factory.d.ts +1 -0
- package/esm/core/factory.js +3 -0
- package/esm/core/factory.js.map +1 -1
- package/esm/core/instance-manager.d.ts +9 -0
- package/esm/core/instance-manager.js +20 -0
- package/esm/core/instance-manager.js.map +1 -0
- package/esm/core/interface.js +1 -2
- package/esm/core/vchart.d.ts +2 -6
- package/esm/core/vchart.js +10 -22
- package/esm/core/vchart.js.map +1 -1
- package/esm/event/event.js +2 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/mark/arc.d.ts +1 -1
- package/esm/mark/arc.js +3 -2
- package/esm/mark/arc.js.map +1 -1
- package/esm/mark/area.d.ts +3 -2
- package/esm/mark/area.js +7 -3
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/base/base-mark.js +4 -3
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/base/index.d.ts +1 -2
- package/esm/mark/base/index.js +1 -3
- package/esm/mark/base/index.js.map +1 -1
- package/{cjs/mark/boxPlot.d.ts → esm/mark/box-plot.d.ts} +1 -1
- package/esm/mark/{boxPlot.js → box-plot.js} +2 -2
- package/esm/mark/box-plot.js.map +1 -0
- package/esm/mark/component.d.ts +1 -1
- package/esm/mark/component.js +1 -1
- package/esm/mark/component.js.map +1 -1
- package/esm/mark/line.d.ts +1 -1
- package/esm/mark/line.js +1 -1
- package/esm/mark/line.js.map +1 -1
- package/esm/mark/linkPath.d.ts +1 -1
- package/esm/mark/linkPath.js +3 -2
- package/esm/mark/linkPath.js.map +1 -1
- package/esm/mark/mark-set/index.d.ts +6 -5
- package/esm/mark/mark-set/index.js +16 -13
- package/esm/mark/mark-set/index.js.map +1 -1
- package/esm/mark/path.d.ts +1 -1
- package/esm/mark/path.js +1 -1
- package/esm/mark/path.js.map +1 -1
- package/esm/mark/polygon.d.ts +1 -1
- package/esm/mark/polygon.js +2 -2
- package/esm/mark/polygon.js.map +1 -1
- package/esm/mark/progress-arc.js +1 -1
- package/esm/mark/rect.d.ts +1 -1
- package/esm/mark/rect.js +4 -3
- package/esm/mark/rect.js.map +1 -1
- package/esm/mark/rule.d.ts +1 -1
- package/esm/mark/rule.js +2 -2
- package/esm/mark/rule.js.map +1 -1
- package/esm/mark/symbol.d.ts +1 -1
- package/esm/mark/symbol.js +4 -3
- package/esm/mark/symbol.js.map +1 -1
- package/esm/mark/text.d.ts +1 -1
- package/esm/mark/text.js +4 -3
- package/esm/mark/text.js.map +1 -1
- package/esm/model/base-model.d.ts +12 -5
- package/esm/model/base-model.js +50 -29
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +8 -2
- package/esm/model/interface.js.map +1 -1
- package/esm/model/layout-item.js +19 -17
- package/esm/model/layout-item.js.map +1 -1
- package/esm/region/region.d.ts +1 -4
- package/esm/region/region.js +15 -13
- package/esm/region/region.js.map +1 -1
- package/esm/scale/color-ordinal-scale.d.ts +8 -0
- package/esm/scale/color-ordinal-scale.js +18 -0
- package/esm/scale/color-ordinal-scale.js.map +1 -0
- package/esm/scale/global-scale.js +3 -2
- package/esm/scale/global-scale.js.map +1 -1
- package/esm/series/area/area.d.ts +2 -0
- package/esm/series/area/area.js +15 -6
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/area/interface.d.ts +5 -5
- package/esm/series/area/interface.js.map +1 -1
- package/esm/series/bar/bar.d.ts +6 -0
- package/esm/series/bar/bar.js +25 -7
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/bar/interface.d.ts +5 -4
- package/esm/series/bar/interface.js.map +1 -1
- package/esm/series/base/base-series.d.ts +10 -11
- package/esm/series/base/base-series.js +59 -30
- package/esm/series/base/base-series.js.map +1 -1
- package/{cjs/series/box-plot/boxPlot.d.ts → esm/series/box-plot/box-plot.d.ts} +2 -0
- package/esm/series/box-plot/{boxPlot.js → box-plot.js} +17 -6
- package/esm/series/box-plot/box-plot.js.map +1 -0
- package/esm/series/box-plot/interface.d.ts +3 -2
- package/esm/series/box-plot/interface.js.map +1 -1
- package/esm/series/box-plot/tooltip-helper.js.map +1 -1
- package/esm/series/cartesian/cartesian.d.ts +1 -1
- package/esm/series/circle-packing/circle-packing.d.ts +2 -0
- package/esm/series/circle-packing/circle-packing.js +12 -3
- package/esm/series/circle-packing/circle-packing.js.map +1 -1
- package/esm/series/circle-packing/interface.d.ts +5 -4
- package/esm/series/circle-packing/interface.js.map +1 -1
- package/esm/series/dot/dot.d.ts +6 -8
- package/esm/series/dot/dot.js +47 -16
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/dot/interface.d.ts +10 -10
- package/esm/series/dot/interface.js.map +1 -1
- package/esm/series/funnel/funnel.d.ts +12 -2
- package/esm/series/funnel/funnel.js +81 -22
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/funnel/interface.d.ts +16 -15
- package/esm/series/funnel/interface.js.map +1 -1
- package/esm/series/gauge/gauge-pointer.d.ts +2 -0
- package/esm/series/gauge/gauge-pointer.js +23 -6
- package/esm/series/gauge/gauge-pointer.js.map +1 -1
- package/esm/series/gauge/gauge.d.ts +3 -2
- package/esm/series/gauge/gauge.js +32 -18
- package/esm/series/gauge/gauge.js.map +1 -1
- package/esm/series/gauge/interface.d.ts +12 -11
- package/esm/series/gauge/interface.js.map +1 -1
- package/esm/series/heatmap/heatmap.d.ts +3 -1
- package/esm/series/heatmap/heatmap.js +19 -9
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/heatmap/interface.d.ts +6 -5
- package/esm/series/heatmap/interface.js.map +1 -1
- package/esm/series/interface/common.d.ts +56 -1
- package/esm/series/interface/common.js +24 -1
- package/esm/series/interface/common.js.map +1 -1
- package/esm/series/interface/series.d.ts +2 -1
- package/esm/series/interface/series.js.map +1 -1
- package/esm/series/line/line.d.ts +2 -0
- package/esm/series/line/line.js +9 -4
- package/esm/series/line/line.js.map +1 -1
- package/esm/series/link/interface.d.ts +4 -4
- package/esm/series/link/interface.js.map +1 -1
- package/esm/series/link/link.d.ts +4 -7
- package/esm/series/link/link.js +22 -15
- package/esm/series/link/link.js.map +1 -1
- package/esm/series/map/map.d.ts +2 -0
- package/esm/series/map/map.js +13 -6
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +4 -3
- package/esm/series/mixin/line-mixin.js +16 -4
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/interface.d.ts +7 -6
- package/esm/series/pie/interface.js.map +1 -1
- package/esm/series/pie/pie.d.ts +8 -3
- package/esm/series/pie/pie.js +60 -28
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/progress/circular/circular.d.ts +2 -0
- package/esm/series/progress/circular/circular.js +16 -6
- package/esm/series/progress/circular/circular.js.map +1 -1
- package/esm/series/progress/circular/interface.d.ts +5 -4
- package/esm/series/progress/circular/interface.js.map +1 -1
- package/esm/series/progress/linear/interface.d.ts +6 -5
- package/esm/series/progress/linear/interface.js.map +1 -1
- package/esm/series/progress/linear/linear.d.ts +2 -0
- package/esm/series/progress/linear/linear.js +31 -20
- package/esm/series/progress/linear/linear.js.map +1 -1
- package/esm/series/radar/interface.d.ts +5 -4
- package/esm/series/radar/interface.js.map +1 -1
- package/esm/series/radar/radar.d.ts +2 -0
- package/esm/series/radar/radar.js +12 -5
- package/esm/series/radar/radar.js.map +1 -1
- package/esm/series/range-area/range-area.d.ts +2 -0
- package/esm/series/range-area/range-area.js +2 -4
- package/esm/series/range-area/range-area.js.map +1 -1
- package/esm/series/range-column/interface.d.ts +9 -8
- package/esm/series/range-column/interface.js.map +1 -1
- package/esm/series/range-column/rangeColumn.d.ts +2 -0
- package/esm/series/range-column/rangeColumn.js +28 -20
- package/esm/series/range-column/rangeColumn.js.map +1 -1
- package/esm/series/rose/interface.d.ts +3 -2
- package/esm/series/rose/interface.js.map +1 -1
- package/esm/series/rose/rose.d.ts +2 -0
- package/esm/series/rose/rose.js +16 -14
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/sankey/animation.js.map +1 -1
- package/esm/series/sankey/interface.d.ts +7 -6
- package/esm/series/sankey/interface.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +2 -0
- package/esm/series/sankey/sankey.js +26 -23
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/interface.d.ts +6 -5
- package/esm/series/scatter/interface.js.map +1 -1
- package/esm/series/scatter/scatter.d.ts +2 -0
- package/esm/series/scatter/scatter.js +15 -9
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/sunburst/interface.d.ts +5 -4
- package/esm/series/sunburst/interface.js.map +1 -1
- package/esm/series/sunburst/sunburst.d.ts +3 -1
- package/esm/series/sunburst/sunburst.js +11 -4
- package/esm/series/sunburst/sunburst.js.map +1 -1
- package/esm/series/treemap/interface.d.ts +9 -8
- package/esm/series/treemap/interface.js.map +1 -1
- package/esm/series/treemap/treemap.d.ts +2 -0
- package/esm/series/treemap/treemap.js +21 -6
- package/esm/series/treemap/treemap.js.map +1 -1
- package/esm/series/waterfall/interface.d.ts +6 -5
- package/esm/series/waterfall/interface.js.map +1 -1
- package/esm/series/waterfall/waterfall.d.ts +2 -0
- package/esm/series/waterfall/waterfall.js +15 -6
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/esm/series/word-cloud/interface.d.ts +7 -6
- package/esm/series/word-cloud/interface.js.map +1 -1
- package/esm/series/word-cloud/word-cloud.d.ts +4 -3
- package/esm/series/word-cloud/word-cloud.js +24 -11
- package/esm/series/word-cloud/word-cloud.js.map +1 -1
- package/esm/theme/buildin-theme/config.d.ts +1 -4
- package/esm/theme/buildin-theme/config.js +1 -21
- package/esm/theme/buildin-theme/config.js.map +1 -1
- package/esm/theme/buildin-theme/dark.js.map +1 -1
- package/esm/theme/buildin-theme/light/color-scheme.js +14 -1
- package/esm/theme/buildin-theme/light/color-scheme.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/axis/band-axis.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/axis/band-axis.js +18 -0
- package/esm/theme/buildin-theme/light/component/axis/band-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/{cartesian-axis.d.ts → axis/cartesian-axis.d.ts} +1 -1
- package/esm/theme/buildin-theme/light/component/{cartesian-axis.js → axis/cartesian-axis.js} +7 -9
- package/esm/theme/buildin-theme/light/component/axis/cartesian-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/axis/common-axis.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/{common-axis.js → axis/common-axis.js} +32 -14
- package/esm/theme/buildin-theme/light/component/axis/common-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/axis/linear-axis.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/axis/linear-axis.js +18 -0
- package/esm/theme/buildin-theme/light/component/axis/linear-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/{polar-axis.d.ts → axis/polar-axis.d.ts} +1 -1
- package/esm/theme/buildin-theme/light/component/{polar-axis.js → axis/polar-axis.js} +11 -3
- package/esm/theme/buildin-theme/light/component/axis/polar-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/crosshair.js +8 -4
- package/esm/theme/buildin-theme/light/component/crosshair.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/index.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/index.js +62 -0
- package/esm/theme/buildin-theme/light/component/index.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/legend/color-legend.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/{color-legend.js → legend/color-legend.js} +1 -1
- package/esm/theme/buildin-theme/light/component/legend/color-legend.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/legend/continuous.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/legend/continuous.js +54 -0
- package/esm/theme/buildin-theme/light/component/legend/continuous.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/legend/discrete-legend.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/{discrete-legend.js → legend/discrete-legend.js} +14 -5
- package/esm/theme/buildin-theme/light/component/legend/discrete-legend.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/legend/size-legend.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/{size-legend.js → legend/size-legend.js} +1 -1
- package/esm/theme/buildin-theme/light/component/legend/size-legend.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/map-label.d.ts +2 -0
- package/esm/{component/map-label/config.js → theme/buildin-theme/light/component/map-label.js} +5 -3
- package/esm/theme/buildin-theme/light/component/map-label.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/player.js +20 -11
- package/esm/theme/buildin-theme/light/component/player.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/title.js +16 -2
- package/esm/theme/buildin-theme/light/component/title.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/tooltip.js +6 -2
- package/esm/theme/buildin-theme/light/component/tooltip.js.map +1 -1
- package/esm/theme/buildin-theme/light/constants.d.ts +2 -0
- package/esm/theme/buildin-theme/light/constants.js +10 -0
- package/esm/theme/buildin-theme/light/constants.js.map +1 -0
- package/esm/theme/buildin-theme/light/index.js +7 -50
- package/esm/theme/buildin-theme/light/index.js.map +1 -1
- package/esm/theme/buildin-theme/light/mark.d.ts +3 -0
- package/esm/theme/buildin-theme/light/mark.js +68 -0
- package/esm/theme/buildin-theme/light/mark.js.map +1 -0
- package/esm/theme/buildin-theme/light/series/area.js +2 -12
- package/esm/theme/buildin-theme/light/series/area.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/bar.js +2 -2
- package/esm/theme/buildin-theme/light/series/bar.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/bar3d.js +2 -2
- package/esm/theme/buildin-theme/light/series/bar3d.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/box-plot.d.ts +2 -0
- package/esm/theme/buildin-theme/light/series/box-plot.js +8 -0
- package/esm/theme/buildin-theme/light/series/box-plot.js.map +1 -0
- package/esm/theme/buildin-theme/light/series/circular-progress.js +11 -1
- package/esm/theme/buildin-theme/light/series/circular-progress.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/funnel.js +7 -2
- package/esm/theme/buildin-theme/light/series/funnel.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/funnel3d.js +8 -3
- package/esm/theme/buildin-theme/light/series/funnel3d.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/gauge.js +6 -1
- package/esm/theme/buildin-theme/light/series/gauge.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/index.js +10 -1
- package/esm/theme/buildin-theme/light/series/index.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/line.js +2 -7
- package/esm/theme/buildin-theme/light/series/line.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/linear-progress.js +5 -0
- package/esm/theme/buildin-theme/light/series/linear-progress.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/map.js +8 -4
- package/esm/theme/buildin-theme/light/series/map.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/pie.js +9 -2
- package/esm/theme/buildin-theme/light/series/pie.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/pie3d.js +4 -3
- package/esm/theme/buildin-theme/light/series/pie3d.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/radar.js +2 -12
- package/esm/theme/buildin-theme/light/series/radar.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/rangeColumn.js +2 -2
- package/esm/theme/buildin-theme/light/series/rangeColumn.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/rose.d.ts +2 -0
- package/esm/theme/buildin-theme/light/series/rose.js +16 -0
- package/esm/theme/buildin-theme/light/series/rose.js.map +1 -0
- package/esm/theme/buildin-theme/light/series/sankey.d.ts +2 -0
- package/esm/theme/buildin-theme/light/series/sankey.js +10 -0
- package/esm/theme/buildin-theme/light/series/sankey.js.map +1 -0
- package/esm/theme/buildin-theme/light/series/scatter.js +10 -4
- package/esm/theme/buildin-theme/light/series/scatter.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/treemap.js +3 -1
- package/esm/theme/buildin-theme/light/series/treemap.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/waterfall.js +3 -1
- package/esm/theme/buildin-theme/light/series/waterfall.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/word-cloud3d.js +1 -1
- package/esm/theme/buildin-theme/light/series/word-cloud3d.js.map +1 -1
- package/esm/theme/color-scheme/interface.d.ts +16 -8
- package/esm/theme/color-scheme/interface.js.map +1 -1
- package/esm/theme/color-scheme/util.d.ts +6 -3
- package/esm/theme/color-scheme/util.js +31 -7
- package/esm/theme/color-scheme/util.js.map +1 -1
- package/esm/theme/interface.d.ts +22 -38
- package/esm/theme/interface.js.map +1 -1
- package/esm/theme/theme-manager.d.ts +1 -0
- package/esm/theme/theme-manager.js +6 -1
- package/esm/theme/theme-manager.js.map +1 -1
- package/esm/typings/spec/chart.d.ts +1 -1
- package/esm/typings/spec/chart.js.map +1 -1
- package/esm/typings/visual.d.ts +13 -12
- package/esm/typings/visual.js.map +1 -1
- package/esm/util/color.d.ts +0 -3
- package/esm/util/color.js +0 -10
- package/esm/util/color.js.map +1 -1
- package/esm/util/scale.d.ts +12 -1
- package/esm/util/scale.js +6 -2
- package/esm/util/scale.js.map +1 -1
- package/esm/vchart-all.js +5 -5
- package/esm/vchart-all.js.map +1 -1
- package/package.json +1 -1
- package/cjs/chart/boxplot/boxPlot.js.map +0 -1
- package/cjs/chart/boxplot/index.js.map +0 -1
- package/cjs/chart/boxplot/interface.js.map +0 -1
- package/cjs/component/map-label/config.d.ts +0 -2
- package/cjs/component/map-label/config.js.map +0 -1
- package/cjs/mark/boxPlot.js.map +0 -1
- package/cjs/series/box-plot/boxPlot.js.map +0 -1
- package/cjs/theme/buildin-theme/light/component/cartesian-axis.js.map +0 -1
- package/cjs/theme/buildin-theme/light/component/color-legend.d.ts +0 -2
- package/cjs/theme/buildin-theme/light/component/color-legend.js.map +0 -1
- package/cjs/theme/buildin-theme/light/component/common-axis.d.ts +0 -2
- package/cjs/theme/buildin-theme/light/component/common-axis.js.map +0 -1
- package/cjs/theme/buildin-theme/light/component/discrete-legend.d.ts +0 -2
- package/cjs/theme/buildin-theme/light/component/discrete-legend.js.map +0 -1
- package/cjs/theme/buildin-theme/light/component/polar-axis.js +0 -19
- package/cjs/theme/buildin-theme/light/component/polar-axis.js.map +0 -1
- package/cjs/theme/buildin-theme/light/component/size-legend.d.ts +0 -2
- package/cjs/theme/buildin-theme/light/component/size-legend.js.map +0 -1
- package/esm/chart/boxplot/boxPlot.js.map +0 -1
- package/esm/chart/boxplot/index.js.map +0 -1
- package/esm/chart/boxplot/interface.js.map +0 -1
- package/esm/component/map-label/config.d.ts +0 -2
- package/esm/component/map-label/config.js.map +0 -1
- package/esm/series/box-plot/boxPlot.js.map +0 -1
- package/esm/theme/buildin-theme/light/component/cartesian-axis.js.map +0 -1
- package/esm/theme/buildin-theme/light/component/color-legend.d.ts +0 -2
- package/esm/theme/buildin-theme/light/component/color-legend.js.map +0 -1
- package/esm/theme/buildin-theme/light/component/common-axis.d.ts +0 -2
- package/esm/theme/buildin-theme/light/component/common-axis.js.map +0 -1
- package/esm/theme/buildin-theme/light/component/discrete-legend.d.ts +0 -2
- package/esm/theme/buildin-theme/light/component/discrete-legend.js.map +0 -1
- package/esm/theme/buildin-theme/light/component/polar-axis.js.map +0 -1
- package/esm/theme/buildin-theme/light/component/size-legend.d.ts +0 -2
- package/esm/theme/buildin-theme/light/component/size-legend.js.map +0 -1
- /package/cjs/chart/{boxplot/boxPlot.d.ts → box-plot/box-plot.d.ts} +0 -0
- /package/cjs/chart/{boxplot → box-plot}/interface.d.ts +0 -0
- /package/cjs/chart/{boxplot → box-plot}/interface.js +0 -0
- /package/esm/chart/{boxplot/boxPlot.d.ts → box-plot/box-plot.d.ts} +0 -0
- /package/esm/chart/{boxplot → box-plot}/interface.d.ts +0 -0
- /package/esm/chart/{boxplot → box-plot}/interface.js +0 -0
package/cjs/compile/compiler.js
CHANGED
|
@@ -36,7 +36,7 @@ const vgrammar_1 = require("@visactor/vgrammar"), interface_1 = require("./inter
|
|
|
36
36
|
|
|
37
37
|
class Compiler {
|
|
38
38
|
getVGrammarView() {
|
|
39
|
-
return this.
|
|
39
|
+
return this._view;
|
|
40
40
|
}
|
|
41
41
|
getModel() {
|
|
42
42
|
return this._model;
|
|
@@ -51,20 +51,20 @@ class Compiler {
|
|
|
51
51
|
}
|
|
52
52
|
getRenderer() {
|
|
53
53
|
var _a;
|
|
54
|
-
return null === (_a = this.
|
|
54
|
+
return null === (_a = this._view) || void 0 === _a ? void 0 : _a.renderer;
|
|
55
55
|
}
|
|
56
56
|
getCanvas() {
|
|
57
57
|
var _a;
|
|
58
|
-
return null === (_a = this.
|
|
58
|
+
return null === (_a = this._view) || void 0 === _a ? void 0 : _a.renderer.canvas();
|
|
59
59
|
}
|
|
60
60
|
getStage() {
|
|
61
61
|
var _a;
|
|
62
|
-
return null === (_a = this.
|
|
62
|
+
return null === (_a = this._view) || void 0 === _a ? void 0 : _a.renderer.stage();
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
initView() {
|
|
65
65
|
var _a, _b;
|
|
66
|
-
if (this.isInited = !0, this.
|
|
67
|
-
this.
|
|
66
|
+
if (this.isInited = !0, this._view) return;
|
|
67
|
+
this._view = new vgrammar_1.View(Object.assign(Object.assign({
|
|
68
68
|
width: this._width,
|
|
69
69
|
height: this._height,
|
|
70
70
|
hover: !1,
|
|
@@ -82,16 +82,16 @@ class Compiler {
|
|
|
82
82
|
},
|
|
83
83
|
doLayout: () => {
|
|
84
84
|
var _a;
|
|
85
|
-
null === (_a = this._compileChart) || void 0 === _a || _a.onLayout(this.
|
|
85
|
+
null === (_a = this._compileChart) || void 0 === _a || _a.onLayout(this._view);
|
|
86
86
|
}
|
|
87
87
|
})), this._setCanvasStyle();
|
|
88
88
|
!1 !== this._option.interactive && this._viewListeners.forEach((listener => {
|
|
89
89
|
var _a;
|
|
90
|
-
null === (_a = this.
|
|
90
|
+
null === (_a = this._view) || void 0 === _a || _a.addEventListener(listener.type, listener.callback);
|
|
91
91
|
}));
|
|
92
92
|
}
|
|
93
93
|
_setCanvasStyle() {
|
|
94
|
-
if (this.
|
|
94
|
+
if (this._view && this._container.dom && !(0, util_2.isString)(this._container.dom)) {
|
|
95
95
|
this._container.dom.style.display = "block", this._container.dom.style.position = "relative";
|
|
96
96
|
const canvas = this.getCanvas();
|
|
97
97
|
canvas && (canvas.style.display = "block");
|
|
@@ -99,25 +99,24 @@ class Compiler {
|
|
|
99
99
|
}
|
|
100
100
|
compile(ctx, option) {
|
|
101
101
|
const {chart: chart} = ctx;
|
|
102
|
-
this._compileChart = chart, this.
|
|
103
|
-
this.updateDepend());
|
|
102
|
+
this._compileChart = chart, this.initView(), this._view && (chart.compile(), this.updateDepend());
|
|
104
103
|
}
|
|
105
104
|
renderAsync(morphConfig) {
|
|
106
105
|
var _a;
|
|
107
106
|
return __awaiter(this, void 0, void 0, (function*() {
|
|
108
|
-
return this.
|
|
107
|
+
return this.initView(), this._view ? (yield null === (_a = this._view) || void 0 === _a ? void 0 : _a.runNextTick(morphConfig),
|
|
109
108
|
this) : Promise.reject("srView init fail");
|
|
110
109
|
}));
|
|
111
110
|
}
|
|
112
111
|
renderSync(morphConfig) {
|
|
113
112
|
var _a;
|
|
114
|
-
this.
|
|
113
|
+
this.initView(), this._view && (null === (_a = this._view) || void 0 === _a || _a.runSync(morphConfig));
|
|
115
114
|
}
|
|
116
115
|
updateViewBox(viewBox, reRender = !0) {
|
|
117
|
-
this.
|
|
116
|
+
this._view && this._view.renderer.setViewBox(viewBox, reRender);
|
|
118
117
|
}
|
|
119
118
|
resize(width, height) {
|
|
120
|
-
return this.
|
|
119
|
+
return this._view ? (this._view.resize(width, height), this.reRenderAsync({
|
|
121
120
|
morph: !1
|
|
122
121
|
})) : Promise.reject();
|
|
123
122
|
}
|
|
@@ -128,11 +127,11 @@ class Compiler {
|
|
|
128
127
|
}))), Promise.resolve();
|
|
129
128
|
}
|
|
130
129
|
setSize(width, height) {
|
|
131
|
-
this._width = width, this._height = height, this.
|
|
132
|
-
this.
|
|
130
|
+
this._width = width, this._height = height, this._view && (this._view.width(width),
|
|
131
|
+
this._view.height(height));
|
|
133
132
|
}
|
|
134
133
|
setViewBox(viewBox, reRender = !0) {
|
|
135
|
-
this.
|
|
134
|
+
this._view && this._view.renderer.setViewBox(viewBox, reRender);
|
|
136
135
|
}
|
|
137
136
|
addEventListener(source, type, callback) {
|
|
138
137
|
var _a;
|
|
@@ -158,7 +157,7 @@ class Compiler {
|
|
|
158
157
|
this._viewListeners.set(callback, {
|
|
159
158
|
type: type,
|
|
160
159
|
callback: wrappedCallback
|
|
161
|
-
}), null === (_a = this.
|
|
160
|
+
}), null === (_a = this._view) || void 0 === _a || _a.addEventListener(type, wrappedCallback);
|
|
162
161
|
} else if (source === constant_1.Event_Source_Type.window) {
|
|
163
162
|
const wrappedCallback = function(event) {
|
|
164
163
|
const params = {
|
|
@@ -184,7 +183,7 @@ class Compiler {
|
|
|
184
183
|
var _a, _b, _c;
|
|
185
184
|
if (!1 !== this._option.interactive) if (source === constant_1.Event_Source_Type.chart) {
|
|
186
185
|
const wrappedCallback = null === (_a = this._viewListeners.get(callback)) || void 0 === _a ? void 0 : _a.callback;
|
|
187
|
-
wrappedCallback && (null === (_b = this.
|
|
186
|
+
wrappedCallback && (null === (_b = this._view) || void 0 === _b || _b.removeEventListener(type, wrappedCallback)),
|
|
188
187
|
this._viewListeners.delete(callback);
|
|
189
188
|
} else if (source === constant_1.Event_Source_Type.window) {
|
|
190
189
|
const wrappedCallback = null === (_c = this._windowListeners.get(callback)) || void 0 === _c ? void 0 : _c.callback;
|
|
@@ -198,12 +197,12 @@ class Compiler {
|
|
|
198
197
|
release() {
|
|
199
198
|
var _a;
|
|
200
199
|
this.releaseEvent(), this._option = this._container = null, this._releaseModel(),
|
|
201
|
-
null === (_a = this.
|
|
200
|
+
null === (_a = this._view) || void 0 === _a || _a.release(), this._view = null,
|
|
202
201
|
this.isInited = !1, this._rafId = null;
|
|
203
202
|
}
|
|
204
203
|
releaseGrammar() {
|
|
205
204
|
var _a;
|
|
206
|
-
this._releaseModel(), null === (_a = this.
|
|
205
|
+
this._releaseModel(), null === (_a = this._view) || void 0 === _a || _a.removeAllGrammars();
|
|
207
206
|
}
|
|
208
207
|
_releaseModel() {
|
|
209
208
|
Object.keys(this._model).forEach((type => {
|
|
@@ -226,7 +225,7 @@ class Compiler {
|
|
|
226
225
|
if ((0, vutils_1.isNil)(product)) return;
|
|
227
226
|
const id = product.id(), type = grammarItem.grammarType, map = this._model[type][id];
|
|
228
227
|
(0, vutils_1.isValid)(map) && (delete map[grammarItem.id], 0 === Object.keys(map).length && delete this._model[type][id]),
|
|
229
|
-
reserveVGrammarModel || null === (_a = this.
|
|
228
|
+
reserveVGrammarModel || null === (_a = this._view) || void 0 === _a || _a.removeGrammar(product);
|
|
230
229
|
}
|
|
231
230
|
updateDepend(items) {
|
|
232
231
|
return (0, vutils_1.isValid)(items) && items.length > 0 ? items.every((item => item.updateDepend())) : (Object.values(this._model).forEach((productMap => {
|
|
@@ -239,4 +238,4 @@ class Compiler {
|
|
|
239
238
|
}
|
|
240
239
|
|
|
241
240
|
exports.Compiler = Compiler;
|
|
242
|
-
//# sourceMappingURL=compiler.js.map
|
|
241
|
+
//# sourceMappingURL=compiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compile/compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,iDAAmE;AAUnE,2CAA0C;AAC1C,iCAAsC;AACtC,kCAAqD;AAGrD,6CAAkD;AAMlD,+CAA2C;AAE3C,0CAAgD;AAQhD,IAAA,kCAAuB,GAAE,CAAC;AAE1B,MAAa,QAAQ;IAKnB,eAAe;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAiBD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAKD,YAAY,SAA2B,EAAE,MAAqB;QAvBpD,mBAAc,GAAgD,IAAI,GAAG,EAAE,CAAC;QACxE,qBAAgB,GAAgD,IAAI,GAAG,EAAE,CAAC;QAEpF,aAAQ,GAAY,KAAK,CAAC;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AE;YAEtC,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SACjD;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC9C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;gBACjD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAmB,CAAC;gBAErE,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;gBAG7C,MAAM,UAAU,GAAG,YAAY;qBAC5B,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;oBACvB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;qBACxC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC,EAAE,EAAoB,CAAC;qBACvB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;qBACpC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;gBAGhD,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvWD,4BAuWC","file":"compiler.js","sourcesContent":["import type { IElement, IView } from '@visactor/vgrammar';\n// eslint-disable-next-line no-duplicate-imports\nimport { View, registerBasicTransforms } from '@visactor/vgrammar';\nimport type {\n CompilerListenerParameters,\n CompilerModel,\n IGrammarItem,\n IProductMap,\n IRenderContainer,\n IRenderOption\n} from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarType } from './interface';\nimport { toRenderMode } from './util';\nimport { isMobileLikeMode, isString } from '../util';\nimport type { IBoundsLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNil, isValid } from '@visactor/vutils';\nimport type { EventSourceType } from '../event/interface';\nimport type { IChart } from '../chart/interface';\nimport type { VChart } from '../core/vchart';\nimport type { Stage } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport { global } from '@visactor/vrender';\nimport type { IMorphConfig } from '../animation/spec';\nimport { Event_Source_Type } from '../constant';\n\ntype EventListener = {\n type: string;\n callback: (...args: any[]) => void;\n};\n\n// for side effect bundling, do not remove this line.\nregisterBasicTransforms();\n\nexport class Compiler {\n protected _srView: IView;\n /**\n * 获取 VGrammar View 实例\n */\n getVGrammarView() {\n return this._srView;\n }\n protected _viewListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n protected _windowListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n\n isInited: boolean = false;\n\n protected _width: number;\n protected _height: number;\n\n protected _container: IRenderContainer;\n protected _option: IRenderOption;\n\n protected _model: CompilerModel = {\n [GrammarType.signal]: {},\n [GrammarType.data]: {},\n [GrammarType.mark]: {}\n };\n getModel() {\n return this._model;\n }\n\n private _compileChart: IChart = null;\n private _rafId: number;\n\n constructor(container: IRenderContainer, option: IRenderOption) {\n this._container = container;\n this._option = option;\n }\n\n getRenderer() {\n return this._srView?.renderer;\n }\n\n /**\n * 获取 canvas dom\n * @returns HTMLCanvasElement | undefined\n */\n getCanvas(): HTMLCanvasElement | undefined {\n return this._srView?.renderer.canvas();\n }\n\n /**\n * 获取 渲染引擎\n */\n getStage(): Stage | undefined {\n return this._srView?.renderer.stage();\n }\n\n initSrView() {\n this.isInited = true;\n if (this._srView) {\n return;\n }\n\n this._srView = new View({\n width: this._width,\n height: this._height,\n // 禁用默认交互,防止干扰数据流\n hover: false,\n select: false,\n container: this._container.dom ?? null,\n renderCanvas: this._container.canvas ?? null,\n hooks: (this._option as any).performanceHook, // vgrammar 事件改造后,性能回调函数放在了hooks中实现\n cursor: false,\n ...this._option,\n mode: toRenderMode(this._option.mode),\n autoFit: false,\n eventConfig: {\n gesture: isMobileLikeMode(this._option.mode),\n disable: this._option.interactive === false\n },\n doLayout: () => {\n this._compileChart?.onLayout(this._srView);\n }\n });\n this._setCanvasStyle();\n\n const interactive = this._option.interactive;\n if (interactive !== false) {\n // 将 view 实例化之前监听的事件挂载到 view 上\n this._viewListeners.forEach(listener => {\n this._srView?.addEventListener(listener.type, listener.callback);\n });\n }\n }\n\n private _setCanvasStyle() {\n if (!this._srView) {\n return;\n }\n if (this._container.dom && !isString(this._container.dom)) {\n this._container.dom.style.display = 'block';\n this._container.dom.style.position = 'relative';\n const canvas = this.getCanvas();\n if (canvas) {\n canvas.style.display = 'block';\n }\n }\n }\n\n compile(ctx: { chart: IChart; vChart: VChart }, option: any) {\n const { chart } = ctx;\n this._compileChart = chart;\n this.initSrView();\n if (!this._srView) {\n return;\n }\n\n chart.compile();\n this.updateDepend();\n }\n\n async renderAsync(morphConfig?: IMorphConfig): Promise<any> {\n this.initSrView();\n if (!this._srView) {\n return Promise.reject('srView init fail');\n }\n await this._srView?.runNextTick(morphConfig);\n return this;\n }\n\n renderSync(morphConfig?: IMorphConfig): void {\n this.initSrView();\n if (!this._srView) {\n return;\n }\n this._srView?.runSync(morphConfig);\n }\n\n updateViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._srView) {\n return;\n }\n\n this._srView.renderer.setViewBox(viewBox, reRender);\n }\n\n resize(width: number, height: number) {\n if (!this._srView) {\n return Promise.reject();\n }\n this._srView.resize(width, height);\n return this.reRenderAsync({ morph: false });\n }\n\n reRenderAsync(morphConfig?: IMorphConfig) {\n if (this.isInited) {\n // 合并多次 renderSync 调用,另外如果使用 renderAsync 异步渲染的话,在小程序环境会有问题\n if (this._rafId) {\n global.getCancelAnimationFrame()(this._rafId);\n }\n\n this._rafId = global.getRequestAnimationFrame()(() => {\n this.renderSync(morphConfig);\n });\n }\n return Promise.resolve();\n }\n\n setSize(width: number, height: number) {\n this._width = width;\n this._height = height;\n if (!this._srView) {\n return;\n }\n\n this._srView.width(width);\n this._srView.height(height);\n }\n\n setViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._srView) {\n return;\n }\n\n this._srView.renderer.setViewBox(viewBox, reRender);\n }\n\n addEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n // TODO: 需要明确一下 interactive 的作用范围,同时考虑是否存在非交互行为的事件以及是否需要生效\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = function (event: any, element: IElement | null) {\n const context = element?.mark?.context ?? {};\n const modelId = isValid(context.modelId) ? context.modelId : null;\n const markId = isValid(context.markId) ? context.markId : null;\n const modelUserId = isValid(context.modelUserId) ? context.modelUserId : null;\n const markUserId = isValid(context.markUserId) ? context.markUserId : null;\n\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: element,\n datum: element?.getDatum?.() || null,\n markId,\n modelId,\n markUserId,\n modelUserId\n };\n callback.call(null, params);\n }.bind(this);\n this._viewListeners.set(callback, { type, callback: wrappedCallback });\n // 如果 view 已经初始化则立刻挂载监听\n // FIXME: 目前 vgrammar 类型声明没有对齐,事件相关类型声明并没有使用 SceneItem\n this._srView?.addEventListener(type, wrappedCallback as any);\n } else if (source === Event_Source_Type.window) {\n const wrappedCallback = function wrappedCallback(event: any) {\n // TODO: vgrammar 暂未提供基于事件直接筛选相应 mark 的能力,这里无法获取到相应的 item\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: null,\n datum: null,\n markId: null,\n modelId: null,\n markUserId: null,\n modelUserId: null\n };\n callback.call(null, params);\n }.bind(this);\n this._windowListeners.set(callback, { type, callback: wrappedCallback });\n // TODO: 还需处理兼容性。同时目前 vgrammar 提供的 view.events api 并不支持事件的卸载,\n // 因此暂时交由 vchart 层挂载 window 事件。\n window?.addEventListener(type, wrappedCallback);\n }\n }\n\n removeEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = this._viewListeners.get(callback)?.callback;\n wrappedCallback && this._srView?.removeEventListener(type, wrappedCallback);\n this._viewListeners.delete(callback);\n } else if (source === Event_Source_Type.window) {\n const wrappedCallback = this._windowListeners.get(callback)?.callback;\n wrappedCallback && window?.removeEventListener(type, wrappedCallback);\n this._windowListeners.delete(callback);\n }\n }\n\n protected releaseEvent(): void {\n // 相应的事件remove在model中完成\n this._viewListeners.clear();\n this._windowListeners.clear();\n }\n\n release(): void {\n this.releaseEvent();\n this._option = this._container = null as any;\n // vgrammar release\n this._releaseModel();\n this._srView?.release();\n this._srView = null;\n this.isInited = false;\n this._rafId = null;\n }\n\n releaseGrammar() {\n this._releaseModel();\n this._srView?.removeAllGrammars();\n }\n\n protected _releaseModel() {\n // 释放model\n Object.keys(this._model).forEach(type => {\n Object.values(this._model[type] as IProductMap<IGrammarItem>).forEach(grammarItemMap => {\n Object.values(grammarItemMap).forEach((item: IGrammarItem) => {\n item.removeProduct(true); // 保留 vgrammar 语法元素,下面一起清空\n });\n });\n this._model[type] = {};\n });\n }\n\n /** 添加语法元素 */\n addGrammarItem(grammarItem: IGrammarItem) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n if (isNil(this._model[type][id])) {\n this._model[type][id] = {};\n }\n this._model[type][id][grammarItem.id] = grammarItem;\n }\n\n /** 删除语法元素 */\n removeGrammarItem(grammarItem: IGrammarItem, reserveVGrammarModel?: boolean) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n const map = this._model[type][id];\n if (isValid(map)) {\n delete map[grammarItem.id];\n if (Object.keys(map).length === 0) {\n delete this._model[type][id];\n }\n }\n if (!reserveVGrammarModel) {\n this._srView?.removeGrammar(product);\n }\n }\n\n /** 更新语法元素间的依赖关系,返回是否全部成功更新 */\n updateDepend(items?: IGrammarItem[]): boolean {\n if (isValid(items) && items.length > 0) {\n // 局部更新依赖\n return items.every(item => item.updateDepend());\n }\n // 全局更新依赖\n Object.values(this._model).forEach(productMap => {\n Object.values(productMap).forEach(grammarItemMap => {\n const grammarItems = Object.values(grammarItemMap) as IGrammarItem[];\n // 获取编译产物\n const product = grammarItems[0].getProduct();\n\n // 获取编译产物的依赖项\n const dependList = grammarItems\n .reduce((depend, item) => {\n if (item.getDepend().length > 0) {\n return depend.concat(item.getDepend());\n }\n return depend;\n }, [] as IGrammarItem[])\n .filter(grammarItem => !!grammarItem)\n .map(grammarItem => grammarItem.getProduct());\n\n // 更新依赖\n product.depend(dependList);\n });\n });\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/compile/compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,iDAAmE;AAUnE,2CAA0C;AAC1C,iCAAsC;AACtC,kCAAqD;AAGrD,6CAAkD;AAMlD,+CAA2C;AAE3C,0CAAgD;AAQhD,IAAA,kCAAuB,GAAE,CAAC;AAE1B,MAAa,QAAQ;IAKnB,eAAe;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAiBD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAKD,YAAY,SAA2B,EAAE,MAAqB;QAvBpD,mBAAc,GAAgD,IAAI,GAAG,EAAE,CAAC;QACxE,qBAAgB,GAAgD,IAAI,GAAG,EAAE,CAAC;QAEpF,aAAQ,GAAY,KAAK,CAAC;QAQhB,WAAM,GAAkB;YAChC,CAAC,uBAAW,CAAC,MAAM,CAAC,EAAE,EAAE;YACxB,CAAC,uBAAW,CAAC,IAAI,CAAC,EAAE,EAAE;YACtB,CAAC,uBAAW,CAAC,IAAI,CAAC,EAAE,EAAE;SACvB,CA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,CAAC,EAAE;YAC9C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;gBACjD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAmB,CAAC;gBAErE,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;gBAG7C,MAAM,UAAU,GAAG,YAAY;qBAC5B,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;oBACvB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;qBACxC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC,EAAE,EAAoB,CAAC;qBACvB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;qBACpC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;gBAGhD,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvWD,4BAuWC","file":"compiler.js","sourcesContent":["import type { IElement, IView } from '@visactor/vgrammar';\n// eslint-disable-next-line no-duplicate-imports\nimport { View, registerBasicTransforms } from '@visactor/vgrammar';\nimport type {\n CompilerListenerParameters,\n CompilerModel,\n IGrammarItem,\n IProductMap,\n IRenderContainer,\n IRenderOption\n} from './interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { GrammarType } from './interface';\nimport { toRenderMode } from './util';\nimport { isMobileLikeMode, isString } from '../util';\nimport type { IBoundsLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { isNil, isValid } from '@visactor/vutils';\nimport type { EventSourceType } from '../event/interface';\nimport type { IChart } from '../chart/interface';\nimport type { VChart } from '../core/vchart';\nimport type { Stage } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport { global } from '@visactor/vrender';\nimport type { IMorphConfig } from '../animation/spec';\nimport { Event_Source_Type } from '../constant';\n\ntype EventListener = {\n type: string;\n callback: (...args: any[]) => void;\n};\n\n// for side effect bundling, do not remove this line.\nregisterBasicTransforms();\n\nexport class Compiler {\n protected _view: IView;\n /**\n * 获取 VGrammar View 实例\n */\n getVGrammarView() {\n return this._view;\n }\n protected _viewListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n protected _windowListeners: Map<(...args: any[]) => any, EventListener> = new Map();\n\n isInited: boolean = false;\n\n protected _width: number;\n protected _height: number;\n\n protected _container: IRenderContainer;\n protected _option: IRenderOption;\n\n protected _model: CompilerModel = {\n [GrammarType.signal]: {},\n [GrammarType.data]: {},\n [GrammarType.mark]: {}\n };\n getModel() {\n return this._model;\n }\n\n private _compileChart: IChart = null;\n private _rafId: number;\n\n constructor(container: IRenderContainer, option: IRenderOption) {\n this._container = container;\n this._option = option;\n }\n\n getRenderer() {\n return this._view?.renderer;\n }\n\n /**\n * 获取 canvas dom\n * @returns HTMLCanvasElement | undefined\n */\n getCanvas(): HTMLCanvasElement | undefined {\n return this._view?.renderer.canvas();\n }\n\n /**\n * 获取 渲染引擎\n */\n getStage(): Stage | undefined {\n return this._view?.renderer.stage();\n }\n\n initView() {\n this.isInited = true;\n if (this._view) {\n return;\n }\n\n this._view = new View({\n width: this._width,\n height: this._height,\n // 禁用默认交互,防止干扰数据流\n hover: false,\n select: false,\n container: this._container.dom ?? null,\n renderCanvas: this._container.canvas ?? null,\n hooks: (this._option as any).performanceHook, // vgrammar 事件改造后,性能回调函数放在了hooks中实现\n cursor: false,\n ...this._option,\n mode: toRenderMode(this._option.mode),\n autoFit: false,\n eventConfig: {\n gesture: isMobileLikeMode(this._option.mode),\n disable: this._option.interactive === false\n },\n doLayout: () => {\n this._compileChart?.onLayout(this._view);\n }\n });\n this._setCanvasStyle();\n\n const interactive = this._option.interactive;\n if (interactive !== false) {\n // 将 view 实例化之前监听的事件挂载到 view 上\n this._viewListeners.forEach(listener => {\n this._view?.addEventListener(listener.type, listener.callback);\n });\n }\n }\n\n private _setCanvasStyle() {\n if (!this._view) {\n return;\n }\n if (this._container.dom && !isString(this._container.dom)) {\n this._container.dom.style.display = 'block';\n this._container.dom.style.position = 'relative';\n const canvas = this.getCanvas();\n if (canvas) {\n canvas.style.display = 'block';\n }\n }\n }\n\n compile(ctx: { chart: IChart; vChart: VChart }, option: any) {\n const { chart } = ctx;\n this._compileChart = chart;\n this.initView();\n if (!this._view) {\n return;\n }\n\n chart.compile();\n this.updateDepend();\n }\n\n async renderAsync(morphConfig?: IMorphConfig): Promise<any> {\n this.initView();\n if (!this._view) {\n return Promise.reject('srView init fail');\n }\n await this._view?.runNextTick(morphConfig);\n return this;\n }\n\n renderSync(morphConfig?: IMorphConfig): void {\n this.initView();\n if (!this._view) {\n return;\n }\n this._view?.runSync(morphConfig);\n }\n\n updateViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._view) {\n return;\n }\n\n this._view.renderer.setViewBox(viewBox, reRender);\n }\n\n resize(width: number, height: number) {\n if (!this._view) {\n return Promise.reject();\n }\n this._view.resize(width, height);\n return this.reRenderAsync({ morph: false });\n }\n\n reRenderAsync(morphConfig?: IMorphConfig) {\n if (this.isInited) {\n // 合并多次 renderSync 调用,另外如果使用 renderAsync 异步渲染的话,在小程序环境会有问题\n if (this._rafId) {\n global.getCancelAnimationFrame()(this._rafId);\n }\n\n this._rafId = global.getRequestAnimationFrame()(() => {\n this.renderSync(morphConfig);\n });\n }\n return Promise.resolve();\n }\n\n setSize(width: number, height: number) {\n this._width = width;\n this._height = height;\n if (!this._view) {\n return;\n }\n\n this._view.width(width);\n this._view.height(height);\n }\n\n setViewBox(viewBox: IBoundsLike, reRender: boolean = true) {\n if (!this._view) {\n return;\n }\n\n this._view.renderer.setViewBox(viewBox, reRender);\n }\n\n addEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n // TODO: 需要明确一下 interactive 的作用范围,同时考虑是否存在非交互行为的事件以及是否需要生效\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = function (event: any, element: IElement | null) {\n const context = element?.mark?.context ?? {};\n const modelId = isValid(context.modelId) ? context.modelId : null;\n const markId = isValid(context.markId) ? context.markId : null;\n const modelUserId = isValid(context.modelUserId) ? context.modelUserId : null;\n const markUserId = isValid(context.markUserId) ? context.markUserId : null;\n\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: element,\n datum: element?.getDatum?.() || null,\n markId,\n modelId,\n markUserId,\n modelUserId\n };\n callback.call(null, params);\n }.bind(this);\n this._viewListeners.set(callback, { type, callback: wrappedCallback });\n // 如果 view 已经初始化则立刻挂载监听\n // FIXME: 目前 vgrammar 类型声明没有对齐,事件相关类型声明并没有使用 SceneItem\n this._view?.addEventListener(type, wrappedCallback as any);\n } else if (source === Event_Source_Type.window) {\n const wrappedCallback = function wrappedCallback(event: any) {\n // TODO: vgrammar 暂未提供基于事件直接筛选相应 mark 的能力,这里无法获取到相应的 item\n const params: CompilerListenerParameters = {\n event,\n type,\n source,\n item: null,\n datum: null,\n markId: null,\n modelId: null,\n markUserId: null,\n modelUserId: null\n };\n callback.call(null, params);\n }.bind(this);\n this._windowListeners.set(callback, { type, callback: wrappedCallback });\n // TODO: 还需处理兼容性。同时目前 vgrammar 提供的 view.events api 并不支持事件的卸载,\n // 因此暂时交由 vchart 层挂载 window 事件。\n window?.addEventListener(type, wrappedCallback);\n }\n }\n\n removeEventListener(\n source: EventSourceType,\n type: string,\n callback: (params: CompilerListenerParameters) => void\n ): void {\n if (this._option.interactive === false) {\n return;\n }\n if (source === Event_Source_Type.chart) {\n const wrappedCallback = this._viewListeners.get(callback)?.callback;\n wrappedCallback && this._view?.removeEventListener(type, wrappedCallback);\n this._viewListeners.delete(callback);\n } else if (source === Event_Source_Type.window) {\n const wrappedCallback = this._windowListeners.get(callback)?.callback;\n wrappedCallback && window?.removeEventListener(type, wrappedCallback);\n this._windowListeners.delete(callback);\n }\n }\n\n protected releaseEvent(): void {\n // 相应的事件remove在model中完成\n this._viewListeners.clear();\n this._windowListeners.clear();\n }\n\n release(): void {\n this.releaseEvent();\n this._option = this._container = null as any;\n // vgrammar release\n this._releaseModel();\n this._view?.release();\n this._view = null;\n this.isInited = false;\n this._rafId = null;\n }\n\n releaseGrammar() {\n this._releaseModel();\n this._view?.removeAllGrammars();\n }\n\n protected _releaseModel() {\n // 释放model\n Object.keys(this._model).forEach(type => {\n Object.values(this._model[type] as IProductMap<IGrammarItem>).forEach(grammarItemMap => {\n Object.values(grammarItemMap).forEach((item: IGrammarItem) => {\n item.removeProduct(true); // 保留 vgrammar 语法元素,下面一起清空\n });\n });\n this._model[type] = {};\n });\n }\n\n /** 添加语法元素 */\n addGrammarItem(grammarItem: IGrammarItem) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n if (isNil(this._model[type][id])) {\n this._model[type][id] = {};\n }\n this._model[type][id][grammarItem.id] = grammarItem;\n }\n\n /** 删除语法元素 */\n removeGrammarItem(grammarItem: IGrammarItem, reserveVGrammarModel?: boolean) {\n const product = grammarItem.getProduct();\n if (isNil(product)) {\n return;\n }\n const id = product.id();\n const type = grammarItem.grammarType;\n const map = this._model[type][id];\n if (isValid(map)) {\n delete map[grammarItem.id];\n if (Object.keys(map).length === 0) {\n delete this._model[type][id];\n }\n }\n if (!reserveVGrammarModel) {\n this._view?.removeGrammar(product);\n }\n }\n\n /** 更新语法元素间的依赖关系,返回是否全部成功更新 */\n updateDepend(items?: IGrammarItem[]): boolean {\n if (isValid(items) && items.length > 0) {\n // 局部更新依赖\n return items.every(item => item.updateDepend());\n }\n // 全局更新依赖\n Object.values(this._model).forEach(productMap => {\n Object.values(productMap).forEach(grammarItemMap => {\n const grammarItems = Object.values(grammarItemMap) as IGrammarItem[];\n // 获取编译产物\n const product = grammarItems[0].getProduct();\n\n // 获取编译产物的依赖项\n const dependList = grammarItems\n .reduce((depend, item) => {\n if (item.getDepend().length > 0) {\n return depend.concat(item.getDepend());\n }\n return depend;\n }, [] as IGrammarItem[])\n .filter(grammarItem => !!grammarItem)\n .map(grammarItem => grammarItem.getProduct());\n\n // 更新依赖\n product.depend(dependList);\n });\n });\n return true;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compile/mark/interface.ts"],"names":[],"mappings":";;;AAuMA,IAAY,gBAWX;AAXD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IAEvB,yCAAqB,CAAA;IACrB,yDAAqC,CAAA;IAErC,6DAAyC,CAAA;IACzC,6EAAyD,CAAA;IAEzD,+CAA2B,CAAA;IAC3B,+DAA2C,CAAA;AAC7C,CAAC,EAXW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAW3B;AAGD,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iEAAqC,CAAA;IACrC,qFAAyD,CAAA;IACzD,uEAA2C,CAAA;AAC7C,CAAC,EAJW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAInC;AAcD,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,iDAAU,CAAA;IACV,yEAAsB,CAAA;IACtB,2EAAuB,CAAA;IACvB,qDAAY,CAAA;IACZ,mEAAmB,CAAA;IACnB,qEAAoB,CAAA;IACpB,+CAAS,CAAA;AACX,CAAC,EARW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAQtB","file":"interface.js","sourcesContent":["import type { IMarkProgressiveConfig, IMarkStateStyle, MarkType } from '../../mark/interface';\nimport type { IModel } from '../../model/interface';\nimport type { GrammarItemCompileOption, GrammarItemInitOption } from '../interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IGrammarItem } from '../interface';\nimport type { MarkStateManager } from './mark-state-manager';\nimport type { DataView } from '@visactor/vdataset';\nimport type {\n IAnimate,\n IAnimateArranger,\n IElement,\n IGroupMark,\n IMark,\n MarkAnimationSpec,\n Nil,\n TransformSpec\n} from '@visactor/vgrammar';\nimport type { Maybe, Datum, StringOrNumber } from '../../typings';\nimport type { MarkData } from './mark-data';\nimport type { ILabelSpec } from '../../component/label';\n\nexport interface ICompilableMarkOption extends GrammarItemInitOption {\n key?: string | ((datum: Datum) => string);\n /** 分组字段,更多用于 morphing 动画的 element 匹配 */\n groupKey?: string;\n /** 是否在dataflow的过程中,布局前跳过该mark */\n skipBeforeLayouted?: boolean;\n\n /** 这个mark是否支持3d视角 */\n support3d?: boolean;\n /* VGrammar
|
|
1
|
+
{"version":3,"sources":["../src/compile/mark/interface.ts"],"names":[],"mappings":";;;AAuMA,IAAY,gBAWX;AAXD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IAEvB,yCAAqB,CAAA;IACrB,yDAAqC,CAAA;IAErC,6DAAyC,CAAA;IACzC,6EAAyD,CAAA;IAEzD,+CAA2B,CAAA;IAC3B,+DAA2C,CAAA;AAC7C,CAAC,EAXW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAW3B;AAGD,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iEAAqC,CAAA;IACrC,qFAAyD,CAAA;IACzD,uEAA2C,CAAA;AAC7C,CAAC,EAJW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAInC;AAcD,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,iDAAU,CAAA;IACV,yEAAsB,CAAA;IACtB,2EAAuB,CAAA;IACvB,qDAAY,CAAA;IACZ,mEAAmB,CAAA;IACnB,qEAAoB,CAAA;IACpB,+CAAS,CAAA;AACX,CAAC,EARW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAQtB","file":"interface.js","sourcesContent":["import type { IMarkProgressiveConfig, IMarkStateStyle, MarkType } from '../../mark/interface';\nimport type { IModel } from '../../model/interface';\nimport type { GrammarItemCompileOption, GrammarItemInitOption } from '../interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IGrammarItem } from '../interface';\nimport type { MarkStateManager } from './mark-state-manager';\nimport type { DataView } from '@visactor/vdataset';\nimport type {\n IAnimate,\n IAnimateArranger,\n IElement,\n IGroupMark,\n IMark,\n MarkAnimationSpec,\n Nil,\n TransformSpec\n} from '@visactor/vgrammar';\nimport type { Maybe, Datum, StringOrNumber } from '../../typings';\nimport type { MarkData } from './mark-data';\nimport type { ILabelSpec } from '../../component/label';\n\nexport interface ICompilableMarkOption extends GrammarItemInitOption {\n key?: string | ((datum: Datum) => string);\n /** 分组字段,更多用于 morphing 动画的 element 匹配 */\n groupKey?: string;\n /** 是否在dataflow的过程中,布局前跳过该mark */\n skipBeforeLayouted?: boolean;\n\n /** 这个mark是否支持3d视角 */\n support3d?: boolean;\n /* VGrammar的组件是否支持3d */\n mode?: '2d' | '3d';\n}\n\nexport interface ICompilableMark extends IGrammarItem {\n // 类型\n readonly type: MarkType;\n // id\n readonly id: number;\n // name\n readonly name: string;\n // key field\n readonly key?: string | ((datum: Datum) => string);\n // parent model\n readonly model: IModel;\n\n // 数据 可以没有\n getData: () => MarkData | undefined;\n setData: (d: MarkData) => void;\n getDataView: () => DataView | undefined;\n setDataView: (d?: DataView, productId?: string) => void;\n\n // 分片\n getFacet: () => string | undefined;\n setFacet: (facet: string) => void;\n\n // 标签\n getLabelSpec: () => ILabelSpec;\n setLabelSpec: (label: ILabelSpec) => void;\n\n // 状态\n state: MarkStateManager;\n readonly stateStyle: IMarkStateStyle<any>;\n hasState: (state: string) => boolean;\n getState: (state: string) => any;\n updateState: (newState: Record<string, unknown>) => Promise<void>;\n /** 更新encode中的样式 */\n updateLayoutState: (noRender?: boolean, recursion?: boolean) => Promise<void>;\n /** 更新某一个状态 */\n updateMarkState: (key: string) => void;\n\n // transform\n setTransform: (transform: TransformSpec[] | Nil) => void;\n\n // 交互\n getInteractive: () => boolean;\n setInteractive: (interactive: boolean) => void;\n\n // 动画配置\n setAnimationConfig: (config: Partial<MarkAnimationSpec>) => void;\n getAnimationConfig: () => Partial<MarkAnimationSpec>;\n\n // 层级\n getZIndex: () => number;\n setZIndex: (zIndex: number) => void;\n\n // 是否显示\n getVisible: () => boolean;\n setVisible: (visible: boolean) => void;\n\n // 是否开启 morph\n getMorph: () => boolean;\n setMorph: (morph: boolean) => void;\n\n // 是否开启 morph\n getProgressiveConfig: () => IMarkProgressiveConfig;\n setProgressiveConfig: (config: IMarkProgressiveConfig) => void;\n\n // morphKey 配置\n getMorphKey: () => string | undefined;\n setMorphKey: (morphKey: string) => void;\n\n getMorphElementKey: () => string | undefined;\n setMorphElementKey: (morphKey: string) => void;\n\n // groupKey 配置\n getGroupKey: () => string | undefined;\n setGroupKey: (groupKey: string) => void;\n\n // 用户 id\n getUserId: () => StringOrNumber | undefined;\n setUserId: (id: StringOrNumber) => void;\n\n compile: (option?: IMarkCompileOption) => void;\n\n getProduct: () => Maybe<IMark>;\n\n /** 获取子mark */\n getMarks: () => ICompilableMark[];\n\n /** 是否跳过布局阶段 */\n setSkipBeforeLayouted: (skip: boolean) => void;\n getSkipBeforeLayouted: () => boolean;\n\n /** 开始状态动画 */\n runAnimationByState: (animationState?: string) => IAnimateArranger;\n /** 停止状态动画*/\n stopAnimationByState: (animationState?: string) => IAnimate;\n /** 暂停状态动画*/\n pauseAnimationByState: (animationState: string) => IAnimate;\n /** 恢复状态动画*/\n resumeAnimationByState: (animationState: string) => IAnimate;\n}\n\nexport interface IMarkDataInitOption extends ICompilableMarkOption {\n mark: ICompilableMark;\n}\n\nexport interface IMarkCompileOption extends GrammarItemCompileOption {\n group?: string | IGroupMark;\n ignoreChildren?: boolean;\n}\n\nexport interface IStateInfo {\n /** 状态值 */\n stateValue: StateValue;\n // 对应的数据维度 可以是多维度\n // TODO: fields 是否保留\n fields?: any | null | undefined;\n /** 筛选数据 */\n datums?: any[] | null | undefined;\n /** 筛选数据 */\n datumKeys?: string[] | null | undefined;\n /** 筛选 item */\n items?: any[] | null | undefined;\n /** 筛选函数 */\n filter?: ((datum: any, options: Record<string, any>) => boolean) | null | undefined;\n cache?: {\n [key: string]: {\n [key: string]: boolean;\n };\n };\n /** 状态优先级 */\n level?: number | undefined;\n}\n// TODO:目前看这个类型没有必要,确认后彻底删除\nexport interface IStateSpec {\n /** 状态值 */\n stateValue: StateValue;\n /** 筛选数据 */\n datums?: any[] | null | undefined;\n /** 筛选数据对应字段 */\n datumKeys?: string[] | null | undefined;\n /** TODO: 暂时不提供 filter 函数形式 */\n // filter?:\n // | ((datum: any, options: Record<string, any>) => boolean)\n // | null\n // | undefined;\n /** 状态优先级 */\n level?: number | undefined;\n}\n\nexport interface IMarkState {\n readonly id: number;\n // 状态\n getStates: () => IStateInfo[];\n\n // state 相关\n getState: (stateValue: StateValue) => IStateInfo | undefined;\n addState: (stateInfo: IStateInfo) => void;\n changeState: (stateInfo: Partial<IStateInfo>, update?: boolean) => void;\n checkState: (item: any, datum: any) => string[];\n\n clearState: (stateValues: StateValue[], update?: boolean) => void;\n\n // 更新\n update: () => void;\n}\n\nexport enum STATE_VALUE_ENUM {\n STATE_NORMAL = 'normal',\n\n STATE_HOVER = 'hover',\n STATE_HOVER_REVERSE = 'hover_reverse',\n\n STATE_DIMENSION_HOVER = 'dimension_hover',\n STATE_DIMENSION_HOVER_REVERSE = 'dimension_hover_reverse',\n\n STATE_SELECTED = 'selected',\n STATE_SELECTED_REVERSE = 'selected_reverse'\n}\n\n// TODO: 也许有更好的ts写法\nexport enum STATE_VALUE_ENUM_REVERSE {\n STATE_HOVER_REVERSE = 'hover_reverse',\n STATE_DIMENSION_HOVER_REVERSE = 'dimension_hover_reverse',\n STATE_SELECTED_REVERSE = 'selected_reverse'\n}\n\nexport type STATE_NORMAL = typeof STATE_VALUE_ENUM.STATE_NORMAL;\nexport type STATE_HOVER = typeof STATE_VALUE_ENUM.STATE_HOVER;\nexport type STATE_HOVER_REVERSE = typeof STATE_VALUE_ENUM.STATE_HOVER_REVERSE;\nexport type STATE_CUSTOM = string;\n\n// TODO: 待补充\n\nexport type StateValueNot = STATE_HOVER_REVERSE | STATE_CUSTOM;\nexport type StateValue = STATE_NORMAL | STATE_HOVER | STATE_CUSTOM;\nexport type StateValueType = StateValue | StateValueNot;\n\n// TODO: 迁移内容\nexport enum STATE_LEVEL {\n NORMAL = 0,\n DIMENSION_SELECTED = 1,\n RELATIONAL_SELECTED = 2,\n SELECTED = 3,\n DIMENSION_HOVER = 4,\n RELATIONAL_HOVER = 5,\n HOVER = 6\n}\n\nexport interface IAttributeOpt {\n element: IElement;\n mark: IElement['mark'];\n parent: IElement['mark']['group'];\n states: string[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IModelMarkAttributeContext {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ISeriesMarkAttributeContext extends IModelMarkAttributeContext {\n // 通用的默认属性值获取,比如color,如果有散点图有sizeScale,则可以获取 size\n globalScale: (scaleKey: string, value: string | number) => unknown;\n // 传入seriesField值,获取对应的颜色。\n // 如果传入 null ,返回的是当前系列对应的第一个颜色值。\n seriesColor: (seriesValue?: string | number) => string;\n}\n"]}
|
package/cjs/compile/util.js
CHANGED
|
@@ -79,5 +79,74 @@ export declare abstract class AxisComponent extends BaseComponent implements IAx
|
|
|
79
79
|
protected getLabelFormatMethod(): (value: any, datum: any, index: number) => any;
|
|
80
80
|
protected getLabelItems(length: number): any[];
|
|
81
81
|
protected _delegateAxisContainerEvent(component: IGroup): void;
|
|
82
|
-
|
|
82
|
+
protected _getAxisAttributes(): {
|
|
83
|
+
select: any;
|
|
84
|
+
hover: any;
|
|
85
|
+
line: any;
|
|
86
|
+
label: {
|
|
87
|
+
visible: any;
|
|
88
|
+
space: any;
|
|
89
|
+
inside: any;
|
|
90
|
+
style: any;
|
|
91
|
+
formatMethod: (value: any, datum: any, index: number) => any;
|
|
92
|
+
state: any;
|
|
93
|
+
};
|
|
94
|
+
tick: {
|
|
95
|
+
visible: any;
|
|
96
|
+
length: any;
|
|
97
|
+
inside: any;
|
|
98
|
+
alignWithLabel: any;
|
|
99
|
+
style: any;
|
|
100
|
+
state: any;
|
|
101
|
+
};
|
|
102
|
+
subTick: {
|
|
103
|
+
visible: any;
|
|
104
|
+
length: any;
|
|
105
|
+
inside: any;
|
|
106
|
+
count: any;
|
|
107
|
+
style: any;
|
|
108
|
+
state: any;
|
|
109
|
+
};
|
|
110
|
+
grid: {
|
|
111
|
+
type: string;
|
|
112
|
+
visible: any;
|
|
113
|
+
alternateColor: any;
|
|
114
|
+
alignWithLabel: any;
|
|
115
|
+
style: any;
|
|
116
|
+
};
|
|
117
|
+
subGrid: {
|
|
118
|
+
type: string;
|
|
119
|
+
visible: any;
|
|
120
|
+
alternateColor: any;
|
|
121
|
+
style: any;
|
|
122
|
+
};
|
|
123
|
+
title: {
|
|
124
|
+
visible: any;
|
|
125
|
+
position: any;
|
|
126
|
+
space: any;
|
|
127
|
+
autoRotate: boolean;
|
|
128
|
+
angle: number;
|
|
129
|
+
textStyle: any;
|
|
130
|
+
padding: any;
|
|
131
|
+
shape: {
|
|
132
|
+
visible: any;
|
|
133
|
+
space: any;
|
|
134
|
+
style: any;
|
|
135
|
+
};
|
|
136
|
+
background: {
|
|
137
|
+
visible: any;
|
|
138
|
+
style: any;
|
|
139
|
+
};
|
|
140
|
+
state: {
|
|
141
|
+
text: any;
|
|
142
|
+
shape: any;
|
|
143
|
+
background: any;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
panel: {
|
|
147
|
+
visible: any;
|
|
148
|
+
style: any;
|
|
149
|
+
state: any;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
83
152
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.AxisComponent = void 0;
|
|
6
6
|
|
|
7
|
-
const vscale_1 = require("@visactor/vscale"), vrender_components_1 = require("@visactor/vrender-components"), base_1 = require("../base"), util_1 = require("../../util"), constant_1 = require("../../constant"), utils_1 = require("../../animation/utils"), config_1 = require("../../animation/config");
|
|
7
|
+
const vscale_1 = require("@visactor/vscale"), vrender_components_1 = require("@visactor/vrender-components"), base_1 = require("../base"), util_1 = require("../../util"), constant_1 = require("../../constant"), utils_1 = require("../../animation/utils"), config_1 = require("../../animation/config"), vutils_1 = require("@visactor/vutils"), utils_2 = require("./utils"), style_1 = require("../../util/style");
|
|
8
8
|
|
|
9
9
|
class AxisComponent extends base_1.BaseComponent {
|
|
10
10
|
get orient() {
|
|
@@ -49,7 +49,10 @@ class AxisComponent extends base_1.BaseComponent {
|
|
|
49
49
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
50
50
|
if (super.created(), this.setSeriesAndRegionsFromSpec(), this.initEvent(), this.initScales(),
|
|
51
51
|
this.updateSeriesScale(), this._initData(), this._visible) {
|
|
52
|
-
const axisMark = this._createMark(
|
|
52
|
+
const axisMark = this._createMark({
|
|
53
|
+
type: "component",
|
|
54
|
+
name: `axis-${this.orient}`
|
|
55
|
+
}, {
|
|
53
56
|
componentType: "angle" === this.orient ? "circleAxis" : "axis",
|
|
54
57
|
mode: this._spec.mode
|
|
55
58
|
});
|
|
@@ -170,8 +173,94 @@ class AxisComponent extends base_1.BaseComponent {
|
|
|
170
173
|
const axisMainContainer = null == component ? void 0 : component.find((node => node.name === vrender_components_1.AXIS_ELEMENT_NAME.axisContainer), !0);
|
|
171
174
|
axisMainContainer && axisMainContainer.addEventListener("*", ((event, type) => this._delegateEvent(component, event, type)));
|
|
172
175
|
}
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
_getAxisAttributes() {
|
|
177
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
178
|
+
const spec = this._spec;
|
|
179
|
+
let titleTextStyle, titleAngle = spec.title.angle;
|
|
180
|
+
return "left" !== spec.orient && "right" !== spec.orient || (null === (_a = spec.title) || void 0 === _a ? void 0 : _a.autoRotate) && (0,
|
|
181
|
+
util_1.isNil)(spec.title.angle) && (titleAngle = "left" === spec.orient ? -90 : 90,
|
|
182
|
+
titleTextStyle = utils_2.DEFAULT_TITLE_STYLE[spec.orient]), {
|
|
183
|
+
select: spec.select,
|
|
184
|
+
hover: spec.hover,
|
|
185
|
+
line: (0, utils_2.transformAxisLineStyle)(spec.domainLine),
|
|
186
|
+
label: {
|
|
187
|
+
visible: spec.label.visible,
|
|
188
|
+
space: spec.label.space,
|
|
189
|
+
inside: spec.label.inside,
|
|
190
|
+
style: (0, util_1.isFunction)(spec.label.style) ? (datum, index) => {
|
|
191
|
+
var _a;
|
|
192
|
+
const style = this._preprocessSpec(spec.label.style(datum.rawValue, index, datum));
|
|
193
|
+
return (0, style_1.transformToGraphic)(this._preprocessSpec((0, util_1.merge)({}, null === (_a = this._theme.label) || void 0 === _a ? void 0 : _a.style, style)));
|
|
194
|
+
} : (0, style_1.transformToGraphic)(spec.label.style),
|
|
195
|
+
formatMethod: spec.label.formatMethod ? (value, datum, index) => spec.label.formatMethod(datum.rawValue, datum) : null,
|
|
196
|
+
state: (0, style_1.transformStateStyle)(spec.label.state)
|
|
197
|
+
},
|
|
198
|
+
tick: {
|
|
199
|
+
visible: spec.tick.visible,
|
|
200
|
+
length: spec.tick.tickSize,
|
|
201
|
+
inside: spec.tick.inside,
|
|
202
|
+
alignWithLabel: spec.tick.alignWithLabel,
|
|
203
|
+
style: (0, util_1.isFunction)(spec.tick.style) ? (datum, index) => {
|
|
204
|
+
var _a;
|
|
205
|
+
const style = this._preprocessSpec(spec.tick.style(datum.rawValue, index, datum));
|
|
206
|
+
return (0, style_1.transformToGraphic)(this._preprocessSpec((0, util_1.merge)({}, null === (_a = this._theme.tick) || void 0 === _a ? void 0 : _a.style, style)));
|
|
207
|
+
} : (0, style_1.transformToGraphic)(spec.tick.style),
|
|
208
|
+
state: (0, style_1.transformStateStyle)(spec.tick.state)
|
|
209
|
+
},
|
|
210
|
+
subTick: {
|
|
211
|
+
visible: spec.subTick.visible,
|
|
212
|
+
length: spec.subTick.tickSize,
|
|
213
|
+
inside: spec.subTick.inside,
|
|
214
|
+
count: spec.subTick.tickCount,
|
|
215
|
+
style: (0, style_1.transformToGraphic)(spec.subTick.style),
|
|
216
|
+
state: (0, style_1.transformStateStyle)(spec.subTick.state)
|
|
217
|
+
},
|
|
218
|
+
grid: {
|
|
219
|
+
type: "line",
|
|
220
|
+
visible: spec.grid.visible,
|
|
221
|
+
alternateColor: spec.grid.alternateColor,
|
|
222
|
+
alignWithLabel: spec.grid.alignWithLabel,
|
|
223
|
+
style: (0, util_1.isFunction)(spec.grid.style) ? (datum, index) => {
|
|
224
|
+
var _a, _b;
|
|
225
|
+
const style = spec.grid.style(null === (_a = datum.datum) || void 0 === _a ? void 0 : _a.rawValue, index, datum.datum);
|
|
226
|
+
return (0, style_1.transformToGraphic)(this._preprocessSpec((0, util_1.merge)({}, null === (_b = this._theme.grid) || void 0 === _b ? void 0 : _b.style, style)));
|
|
227
|
+
} : (0, style_1.transformToGraphic)(spec.grid.style)
|
|
228
|
+
},
|
|
229
|
+
subGrid: {
|
|
230
|
+
type: "line",
|
|
231
|
+
visible: spec.subGrid.visible,
|
|
232
|
+
alternateColor: spec.subGrid.alternateColor,
|
|
233
|
+
style: (0, style_1.transformToGraphic)(spec.subGrid.style)
|
|
234
|
+
},
|
|
235
|
+
title: {
|
|
236
|
+
visible: spec.title.visible,
|
|
237
|
+
position: spec.title.position,
|
|
238
|
+
space: spec.title.space,
|
|
239
|
+
autoRotate: !1,
|
|
240
|
+
angle: titleAngle ? (0, vutils_1.degreeToRadian)(titleAngle) : null,
|
|
241
|
+
textStyle: (0, util_1.merge)({}, titleTextStyle, (0, style_1.transformToGraphic)(spec.title.style)),
|
|
242
|
+
padding: spec.title.padding,
|
|
243
|
+
shape: {
|
|
244
|
+
visible: null === (_b = spec.title.shape) || void 0 === _b ? void 0 : _b.visible,
|
|
245
|
+
space: null === (_c = spec.title.shape) || void 0 === _c ? void 0 : _c.space,
|
|
246
|
+
style: (0, style_1.transformToGraphic)(null === (_d = spec.title.shape) || void 0 === _d ? void 0 : _d.style)
|
|
247
|
+
},
|
|
248
|
+
background: {
|
|
249
|
+
visible: null === (_e = spec.title.background) || void 0 === _e ? void 0 : _e.visible,
|
|
250
|
+
style: (0, style_1.transformToGraphic)(null === (_f = spec.title.background) || void 0 === _f ? void 0 : _f.style)
|
|
251
|
+
},
|
|
252
|
+
state: {
|
|
253
|
+
text: (0, style_1.transformStateStyle)(spec.title.state),
|
|
254
|
+
shape: (0, style_1.transformStateStyle)(null === (_g = spec.title.shape) || void 0 === _g ? void 0 : _g.state),
|
|
255
|
+
background: (0, style_1.transformStateStyle)(null === (_h = spec.title.background) || void 0 === _h ? void 0 : _h.state)
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
panel: {
|
|
259
|
+
visible: null === (_j = spec.background) || void 0 === _j ? void 0 : _j.visible,
|
|
260
|
+
style: (0, style_1.transformToGraphic)(null === (_k = spec.background) || void 0 === _k ? void 0 : _k.style),
|
|
261
|
+
state: (0, style_1.transformStateStyle)(null === (_l = spec.background) || void 0 === _l ? void 0 : _l.state)
|
|
262
|
+
}
|
|
263
|
+
};
|
|
175
264
|
}
|
|
176
265
|
}
|
|
177
266
|
|