@visactor/vchart 1.3.0-beta.8 → 1.3.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/build/es5/index.js +3 -3
- package/build/index.js +17083 -16200
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/utils.js +2 -2
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/chart/area/area.js +2 -2
- package/cjs/chart/area/area.js.map +1 -1
- package/cjs/chart/bar/bar-3d.js +2 -2
- package/cjs/chart/bar/bar-3d.js.map +1 -1
- package/cjs/chart/bar/bar.js +2 -2
- package/cjs/chart/bar/bar.js.map +1 -1
- package/cjs/chart/base-chart.d.ts +1 -0
- package/cjs/chart/base-chart.js +14 -8
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/box-plot/box-plot.js +2 -2
- package/cjs/chart/box-plot/box-plot.js.map +1 -1
- package/cjs/chart/cartesian/cartesian.js +1 -1
- package/cjs/chart/cartesian/cartesian.js.map +1 -1
- package/cjs/chart/circle-packing/circle-packing.js +2 -2
- package/cjs/chart/circle-packing/circle-packing.js.map +1 -1
- package/cjs/chart/funnel/funnel-3d.js +2 -2
- package/cjs/chart/funnel/funnel-3d.js.map +1 -1
- package/cjs/chart/funnel/funnel.js +2 -2
- package/cjs/chart/funnel/funnel.js.map +1 -1
- package/cjs/chart/gauge/gauge.js +2 -2
- package/cjs/chart/gauge/gauge.js.map +1 -1
- package/cjs/chart/heatmap/heatmap.js +2 -2
- package/cjs/chart/heatmap/heatmap.js.map +1 -1
- package/cjs/chart/histogram/histogram-3d.js +2 -2
- package/cjs/chart/histogram/histogram-3d.js.map +1 -1
- package/cjs/chart/histogram/histogram.js +2 -2
- package/cjs/chart/histogram/histogram.js.map +1 -1
- package/cjs/chart/index.d.ts +1 -1
- package/cjs/chart/index.js.map +1 -1
- package/cjs/chart/line/line.js +2 -2
- package/cjs/chart/line/line.js.map +1 -1
- package/cjs/chart/map/map.js +2 -2
- package/cjs/chart/map/map.js.map +1 -1
- package/cjs/chart/pie/pie-3d.js +2 -2
- package/cjs/chart/pie/pie-3d.js.map +1 -1
- package/cjs/chart/pie/pie.js +2 -2
- package/cjs/chart/pie/pie.js.map +1 -1
- package/cjs/chart/polar/progress-like.js +2 -2
- package/cjs/chart/polar/progress-like.js.map +1 -1
- package/cjs/chart/polar/rose-like.js +1 -1
- package/cjs/chart/polar/rose-like.js.map +1 -1
- package/cjs/chart/progress/circular/circular.js +2 -2
- package/cjs/chart/progress/circular/circular.js.map +1 -1
- package/cjs/chart/progress/linear/linear.js +4 -4
- package/cjs/chart/progress/linear/linear.js.map +1 -1
- package/cjs/chart/radar/radar.js +4 -4
- package/cjs/chart/radar/radar.js.map +1 -1
- package/cjs/chart/range-area/range-area.js +2 -2
- package/cjs/chart/range-area/range-area.js.map +1 -1
- package/cjs/chart/range-column/range-column-3d.js +2 -2
- package/cjs/chart/range-column/range-column-3d.js.map +1 -1
- package/cjs/chart/range-column/range-column.js +2 -2
- package/cjs/chart/range-column/range-column.js.map +1 -1
- package/cjs/chart/rose/rose.js +3 -3
- package/cjs/chart/rose/rose.js.map +1 -1
- package/cjs/chart/sankey/sankey.js +2 -2
- package/cjs/chart/sankey/sankey.js.map +1 -1
- package/cjs/chart/scatter/scatter.js +2 -2
- package/cjs/chart/scatter/scatter.js.map +1 -1
- package/cjs/chart/sequence/sequence.js +2 -2
- package/cjs/chart/sequence/sequence.js.map +1 -1
- package/cjs/chart/stack.js.map +1 -1
- package/cjs/chart/sunburst/sunburst.js +2 -2
- package/cjs/chart/sunburst/sunburst.js.map +1 -1
- package/cjs/chart/treemap/treemap.js +2 -2
- package/cjs/chart/treemap/treemap.js.map +1 -1
- package/cjs/chart/util.js +1 -1
- package/cjs/chart/util.js.map +1 -1
- package/cjs/chart/waterfall/waterfall.js +2 -2
- package/cjs/chart/waterfall/waterfall.js.map +1 -1
- package/cjs/chart/word-cloud/word-cloud-3d.js +2 -2
- package/cjs/chart/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/chart/word-cloud/word-cloud.js +2 -2
- package/cjs/chart/word-cloud/word-cloud.js.map +1 -1
- package/cjs/compile/compiler.d.ts +4 -0
- package/cjs/compile/compiler.js +4 -0
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +1 -0
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.js +9 -10
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/compile/mark/interface.d.ts +0 -1
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/compile/mark/util.d.ts +2 -1
- package/cjs/compile/mark/util.js +21 -5
- package/cjs/compile/mark/util.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -14
- package/cjs/component/axis/base-axis.js +18 -29
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +1 -1
- package/cjs/component/axis/cartesian/axis.js +24 -23
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.d.ts +1 -0
- package/cjs/component/axis/cartesian/band-axis.js +1 -0
- package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/index.d.ts +1 -0
- package/cjs/component/axis/cartesian/index.js +2 -1
- package/cjs/component/axis/cartesian/index.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/common.d.ts +2 -0
- package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/spec.d.ts +4 -1
- package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
- package/cjs/component/axis/cartesian/linear-axis.js +4 -3
- package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/symlog-axis.d.ts +16 -0
- package/cjs/component/axis/cartesian/symlog-axis.js +23 -0
- package/cjs/component/axis/cartesian/symlog-axis.js.map +1 -0
- package/cjs/component/axis/cartesian/time-axis.js +2 -2
- package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
- package/cjs/component/axis/interface.d.ts +4 -8
- package/cjs/component/axis/interface.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +3 -3
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +2 -1
- package/cjs/component/axis/polar/axis.js +15 -14
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/polar/band-axis.d.ts +1 -0
- package/cjs/component/axis/polar/interface/common.d.ts +1 -1
- package/cjs/component/axis/polar/interface/common.js.map +1 -1
- package/cjs/component/axis/{utils.d.ts → util.d.ts} +1 -1
- package/cjs/component/axis/{utils.js → util.js} +6 -6
- package/cjs/component/axis/util.js.map +1 -0
- package/cjs/component/base/base-component.d.ts +10 -2
- package/cjs/component/base/base-component.js +10 -5
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/base/interface.d.ts +8 -0
- package/cjs/component/base/interface.js +6 -0
- package/cjs/component/base/interface.js.map +1 -0
- package/cjs/component/base/util.d.ts +2 -1
- package/cjs/component/base/util.js +21 -16
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +12 -2
- package/cjs/component/brush/brush.js +74 -63
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +2 -2
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/cartesian.js +9 -9
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/interface/spec.d.ts +8 -8
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/crosshair/interface/theme.d.ts +3 -1
- package/cjs/component/crosshair/interface/theme.js.map +1 -1
- package/cjs/component/crosshair/polar.js +9 -9
- package/cjs/component/crosshair/polar.js.map +1 -1
- package/cjs/component/crosshair/util.d.ts +5 -0
- package/cjs/component/crosshair/util.js +41 -4
- package/cjs/component/crosshair/util.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +1 -1
- package/cjs/component/custom-mark/custom-mark.js +3 -3
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +0 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +2 -9
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +6 -6
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/interface.d.ts +2 -2
- package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/cjs/component/data-zoom/interface.d.ts +2 -5
- package/cjs/component/data-zoom/interface.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.d.ts +2 -0
- package/cjs/component/geo/geo-coordinate.js +29 -3
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/geo/projection.d.ts +1 -0
- package/cjs/component/geo/projection.js +4 -0
- package/cjs/component/geo/projection.js.map +1 -1
- package/cjs/component/index.d.ts +2 -2
- package/cjs/component/index.js +6 -1
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/indicator/indicator.d.ts +1 -0
- package/cjs/component/indicator/indicator.js +10 -7
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/indicator/interface.d.ts +5 -6
- package/cjs/component/indicator/interface.js.map +1 -1
- package/cjs/component/interface/theme.d.ts +2 -2
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/interface/type.d.ts +1 -0
- package/cjs/component/interface/type.js +12 -11
- package/cjs/component/interface/type.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +0 -1
- package/cjs/component/label/base-label.js +0 -5
- package/cjs/component/label/base-label.js.map +1 -1
- package/cjs/component/label/interface.d.ts +2 -1
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/label.d.ts +0 -1
- package/cjs/component/label/label.js +1 -6
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/totalLabel.js +1 -1
- package/cjs/component/label/totalLabel.js.map +1 -1
- package/cjs/component/legend/base-legend.js +4 -4
- package/cjs/component/legend/base-legend.js.map +1 -1
- package/cjs/component/legend/continuous/util.js +4 -4
- package/cjs/component/legend/continuous/util.js.map +1 -1
- package/cjs/component/legend/discrete/interface.d.ts +3 -1
- package/cjs/component/legend/discrete/interface.js.map +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/discrete/util.js +2 -2
- package/cjs/component/legend/discrete/util.js.map +1 -1
- package/cjs/component/legend/interface.d.ts +2 -6
- package/cjs/component/legend/interface.js.map +1 -1
- package/cjs/component/legend/util.js +2 -2
- package/cjs/component/legend/util.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +2 -2
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/poptip/interface.d.ts +15 -0
- package/cjs/component/poptip/interface.js +6 -0
- package/cjs/component/poptip/interface.js.map +1 -0
- package/cjs/component/title/interface/spec.d.ts +2 -2
- package/cjs/component/title/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js +5 -5
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-model.js +2 -2
- package/cjs/component/tooltip/handler/dom/model/content-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/title-model.js +2 -2
- package/cjs/component/tooltip/handler/dom/model/title-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/tooltip-model.js +2 -2
- package/cjs/component/tooltip/handler/dom/model/tooltip-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.js +3 -3
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +3 -3
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/get-spec.js +1 -1
- package/cjs/component/tooltip/handler/utils/get-spec.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/style.js +2 -2
- package/cjs/component/tooltip/handler/utils/style.js.map +1 -1
- package/cjs/component/tooltip/processor/base.js +1 -1
- package/cjs/component/tooltip/processor/base.js.map +1 -1
- package/cjs/component/tooltip/tooltip.js +3 -2
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +20 -17
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/transforms/dimension-statistics.d.ts +11 -5
- package/cjs/data/transforms/dimension-statistics.js +34 -22
- package/cjs/data/transforms/dimension-statistics.js.map +1 -1
- package/cjs/data/transforms/legend-data/discrete/discrete.js +4 -2
- package/cjs/data/transforms/legend-data/discrete/discrete.js.map +1 -1
- package/cjs/data/transforms/tick-data/discrete/polar-angle.js +2 -2
- package/cjs/data/transforms/tick-data/discrete/polar-angle.js.map +1 -1
- package/cjs/data/transforms/tick-data/util.js +5 -5
- package/cjs/data/transforms/tick-data/util.js.map +1 -1
- package/cjs/event/events/dimension/util/cartesian.js +2 -2
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/events/dimension/util/polar.js +1 -1
- package/cjs/event/events/dimension/util/polar.js.map +1 -1
- package/cjs/interaction/trigger.js +2 -2
- package/cjs/interaction/trigger.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +1 -0
- package/cjs/mark/base/base-mark.js +21 -4
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/mark-set/index.d.ts +1 -0
- package/cjs/mark/mark-set/index.js.map +1 -1
- package/cjs/mark/symbol.js +1 -1
- package/cjs/mark/symbol.js.map +1 -1
- package/cjs/model/base-model.js +2 -2
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +1 -1
- package/cjs/model/interface.js.map +1 -1
- package/cjs/plugin/components/index.d.ts +0 -2
- package/cjs/plugin/components/index.js +1 -2
- package/cjs/plugin/components/index.js.map +1 -1
- package/cjs/series/area/area.d.ts +4 -1
- package/cjs/series/area/area.js +9 -5
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/bar/bar.js +10 -10
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +2 -0
- package/cjs/series/base/base-series.js +71 -15
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/base/tooltip-helper.js +4 -2
- package/cjs/series/base/tooltip-helper.js.map +1 -1
- package/cjs/series/box-plot/box-plot.js +1 -1
- package/cjs/series/box-plot/box-plot.js.map +1 -1
- package/cjs/series/cartesian/cartesian.d.ts +10 -3
- package/cjs/series/cartesian/cartesian.js +39 -27
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/cartesian/interface.d.ts +1 -0
- package/cjs/series/cartesian/interface.js.map +1 -1
- package/cjs/series/dot/dot.js +1 -1
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/funnel/funnel.js +13 -3
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/heatmap/heatmap.js +1 -1
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/line/interface.d.ts +0 -2
- package/cjs/series/line/interface.js.map +1 -1
- package/cjs/series/line/line.d.ts +1 -0
- package/cjs/series/line/line.js +1 -1
- package/cjs/series/line/line.js.map +1 -1
- package/cjs/series/link/link.js +1 -1
- package/cjs/series/link/link.js.map +1 -1
- package/cjs/series/map/geo-source.js +2 -2
- package/cjs/series/map/geo-source.js.map +1 -1
- package/cjs/series/map/interface.d.ts +1 -0
- package/cjs/series/map/interface.js.map +1 -1
- package/cjs/series/map/map.js +8 -4
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +3 -2
- package/cjs/series/mixin/line-mixin.js +30 -13
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/pie.js +1 -1
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/interface.d.ts +1 -0
- package/cjs/series/polar/interface.js.map +1 -1
- package/cjs/series/polar/polar.d.ts +4 -0
- package/cjs/series/polar/polar.js +15 -3
- package/cjs/series/polar/polar.js.map +1 -1
- package/cjs/series/radar/radar.d.ts +1 -0
- package/cjs/series/radar/radar.js +1 -1
- 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 +3 -0
- package/cjs/series/range-area/range-area.js.map +1 -1
- package/cjs/series/range-column/range-column.js +2 -2
- package/cjs/series/range-column/range-column.js.map +1 -1
- package/cjs/series/rose/rose.js +1 -1
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/sankey/interface.d.ts +3 -2
- package/cjs/series/sankey/interface.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +5 -0
- package/cjs/series/sankey/sankey.js +246 -92
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/scatter.d.ts +1 -1
- package/cjs/series/scatter/scatter.js +13 -8
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/util/utils.d.ts +4 -1
- package/cjs/series/util/utils.js +8 -6
- package/cjs/series/util/utils.js.map +1 -1
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.js +4 -4
- package/cjs/theme/builtin/common/component/axis/cartesian-axis.js.map +1 -1
- package/cjs/theme/builtin/common/component/axis/common-axis.js +12 -6
- package/cjs/theme/builtin/common/component/axis/common-axis.js.map +1 -1
- package/cjs/theme/builtin/common/component/axis/polar-axis.js +1 -1
- package/cjs/theme/builtin/common/component/axis/polar-axis.js.map +1 -1
- package/cjs/theme/builtin/common/component/crosshair.js +73 -117
- package/cjs/theme/builtin/common/component/crosshair.js.map +1 -1
- package/cjs/theme/builtin/common/component/data-zoom.js +19 -7
- package/cjs/theme/builtin/common/component/data-zoom.js.map +1 -1
- package/cjs/theme/builtin/common/component/indicator.js +17 -5
- package/cjs/theme/builtin/common/component/indicator.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/color-legend.js +31 -5
- package/cjs/theme/builtin/common/component/legend/color-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/continuous.js +26 -12
- package/cjs/theme/builtin/common/component/legend/continuous.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js +22 -9
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/legend/size-legend.js +54 -15
- package/cjs/theme/builtin/common/component/legend/size-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/map-label.js +5 -5
- package/cjs/theme/builtin/common/component/map-label.js.map +1 -1
- package/cjs/theme/builtin/common/component/mark-area.js +7 -2
- package/cjs/theme/builtin/common/component/mark-area.js.map +1 -1
- package/cjs/theme/builtin/common/component/mark-line.js +7 -2
- package/cjs/theme/builtin/common/component/mark-line.js.map +1 -1
- package/cjs/theme/builtin/common/component/player.js +33 -7
- package/cjs/theme/builtin/common/component/player.js.map +1 -1
- package/cjs/theme/builtin/common/component/poptip.d.ts +2 -2
- package/cjs/theme/builtin/common/component/poptip.js +20 -12
- package/cjs/theme/builtin/common/component/poptip.js.map +1 -1
- package/cjs/theme/builtin/common/component/title.js +9 -5
- package/cjs/theme/builtin/common/component/title.js.map +1 -1
- package/cjs/theme/builtin/common/component/tooltip.js +13 -10
- package/cjs/theme/builtin/common/component/tooltip.js.map +1 -1
- package/cjs/theme/builtin/common/component/total-label.js +4 -4
- package/cjs/theme/builtin/common/component/total-label.js.map +1 -1
- package/cjs/theme/builtin/common/constants.js +17 -10
- package/cjs/theme/builtin/common/constants.js.map +1 -1
- package/cjs/theme/builtin/common/mark.js +8 -4
- package/cjs/theme/builtin/common/mark.js.map +1 -1
- package/cjs/theme/builtin/common/series/area.js +2 -7
- package/cjs/theme/builtin/common/series/area.js.map +1 -1
- package/cjs/theme/builtin/common/series/bar.js +2 -7
- package/cjs/theme/builtin/common/series/bar.js.map +1 -1
- package/cjs/theme/builtin/common/series/bar3d.js +1 -6
- package/cjs/theme/builtin/common/series/bar3d.js.map +1 -1
- package/cjs/theme/builtin/common/series/circle-packing.js +11 -5
- package/cjs/theme/builtin/common/series/circle-packing.js.map +1 -1
- package/cjs/theme/builtin/common/series/dot.js +11 -3
- package/cjs/theme/builtin/common/series/dot.js.map +1 -1
- package/cjs/theme/builtin/common/series/funnel.js +7 -4
- package/cjs/theme/builtin/common/series/funnel.js.map +1 -1
- package/cjs/theme/builtin/common/series/funnel3d.js +7 -4
- package/cjs/theme/builtin/common/series/funnel3d.js.map +1 -1
- package/cjs/theme/builtin/common/series/line.js +2 -7
- package/cjs/theme/builtin/common/series/line.js.map +1 -1
- package/cjs/theme/builtin/common/series/map.js +4 -2
- package/cjs/theme/builtin/common/series/map.js.map +1 -1
- package/cjs/theme/builtin/common/series/pie.js +1 -6
- package/cjs/theme/builtin/common/series/pie.js.map +1 -1
- package/cjs/theme/builtin/common/series/pie3d.js +2 -9
- package/cjs/theme/builtin/common/series/pie3d.js.map +1 -1
- package/cjs/theme/builtin/common/series/radar.js +2 -7
- package/cjs/theme/builtin/common/series/radar.js.map +1 -1
- package/cjs/theme/builtin/common/series/rangeColumn.js +2 -3
- package/cjs/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/cjs/theme/builtin/common/series/rose.js +1 -2
- package/cjs/theme/builtin/common/series/rose.js.map +1 -1
- package/cjs/theme/builtin/common/series/sankey.js +0 -1
- package/cjs/theme/builtin/common/series/sankey.js.map +1 -1
- package/cjs/theme/builtin/common/series/scatter.js +2 -7
- package/cjs/theme/builtin/common/series/scatter.js.map +1 -1
- package/cjs/theme/builtin/common/series/sunburst.js +5 -2
- package/cjs/theme/builtin/common/series/sunburst.js.map +1 -1
- package/cjs/theme/builtin/common/series/treemap.js +9 -5
- package/cjs/theme/builtin/common/series/treemap.js.map +1 -1
- package/cjs/theme/builtin/common/series/waterfall.js +5 -6
- package/cjs/theme/builtin/common/series/waterfall.js.map +1 -1
- package/cjs/theme/builtin/dark/color-scheme.js +5 -3
- package/cjs/theme/builtin/dark/color-scheme.js.map +1 -1
- package/cjs/theme/builtin/index.d.ts +0 -1
- package/cjs/theme/builtin/index.js +1 -2
- package/cjs/theme/builtin/index.js.map +1 -1
- package/cjs/theme/builtin/light/color-scheme.js +4 -2
- package/cjs/theme/builtin/light/color-scheme.js.map +1 -1
- package/cjs/theme/builtin/light/index.js +2 -2
- package/cjs/theme/builtin/light/index.js.map +1 -1
- package/cjs/theme/color-scheme/builtin/interface.d.ts +22 -0
- package/cjs/theme/color-scheme/builtin/interface.js +6 -0
- package/cjs/theme/color-scheme/builtin/interface.js.map +1 -0
- package/cjs/theme/color-scheme/interface.d.ts +3 -2
- package/cjs/theme/color-scheme/interface.js.map +1 -1
- package/cjs/theme/color-scheme/util.js +8 -2
- package/cjs/theme/color-scheme/util.js.map +1 -1
- package/cjs/theme/interface.d.ts +16 -5
- package/cjs/theme/interface.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +2 -1
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/visual.d.ts +10 -20
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/util/data.d.ts +0 -8
- package/cjs/util/data.js +2 -9
- package/cjs/util/data.js.map +1 -1
- package/cjs/util/object.d.ts +2 -4
- package/cjs/util/object.js +2 -18
- package/cjs/util/object.js.map +1 -1
- package/cjs/util/scale.d.ts +2 -6
- package/cjs/util/scale.js +1 -6
- package/cjs/util/scale.js.map +1 -1
- package/cjs/util/space.d.ts +3 -10
- package/cjs/util/space.js +13 -28
- package/cjs/util/space.js.map +1 -1
- package/cjs/util/spec/background.d.ts +4 -0
- package/cjs/util/spec/background.js +27 -0
- package/cjs/util/spec/background.js.map +1 -0
- package/cjs/util/spec/clone-deep.d.ts +1 -0
- package/cjs/util/spec/clone-deep.js +27 -0
- package/cjs/util/spec/clone-deep.js.map +1 -0
- package/cjs/util/spec/common.d.ts +3 -0
- package/cjs/util/spec/common.js +23 -0
- package/cjs/util/spec/common.js.map +1 -0
- package/cjs/util/spec/index.d.ts +7 -0
- package/cjs/util/spec/index.js +24 -0
- package/cjs/util/spec/index.js.map +1 -0
- package/cjs/util/spec/merge-spec.d.ts +1 -0
- package/cjs/util/spec/merge-spec.js +58 -0
- package/cjs/util/spec/merge-spec.js.map +1 -0
- package/cjs/util/spec/merge-theme.d.ts +3 -0
- package/cjs/util/spec/merge-theme.js +37 -0
- package/cjs/util/spec/merge-theme.js.map +1 -0
- package/cjs/util/spec/preprocess.d.ts +3 -0
- package/cjs/util/spec/preprocess.js +24 -0
- package/cjs/util/spec/preprocess.js.map +1 -0
- package/cjs/util/spec/transform.d.ts +3 -0
- package/cjs/util/spec/transform.js +28 -0
- package/cjs/util/spec/transform.js.map +1 -0
- package/cjs/util/text.d.ts +1 -2
- package/cjs/util/text.js +4 -14
- package/cjs/util/text.js.map +1 -1
- package/cjs/vchart-all.js +1 -1
- package/cjs/vchart-all.js.map +1 -1
- package/cjs/vchart-simple.js +3 -4
- package/cjs/vchart-simple.js.map +1 -1
- package/esm/animation/utils.js +3 -3
- package/esm/animation/utils.js.map +1 -1
- package/esm/chart/area/area.js +3 -3
- package/esm/chart/area/area.js.map +1 -1
- package/esm/chart/bar/bar-3d.js +2 -2
- package/esm/chart/bar/bar-3d.js.map +1 -1
- package/esm/chart/bar/bar.js +2 -2
- package/esm/chart/bar/bar.js.map +1 -1
- package/esm/chart/base-chart.d.ts +1 -0
- package/esm/chart/base-chart.js +14 -8
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/box-plot/box-plot.js +1 -1
- package/esm/chart/box-plot/box-plot.js.map +1 -1
- package/esm/chart/cartesian/cartesian.js +1 -1
- package/esm/chart/cartesian/cartesian.js.map +1 -1
- package/esm/chart/circle-packing/circle-packing.js +1 -1
- package/esm/chart/circle-packing/circle-packing.js.map +1 -1
- package/esm/chart/funnel/funnel-3d.js +1 -1
- package/esm/chart/funnel/funnel-3d.js.map +1 -1
- package/esm/chart/funnel/funnel.js +1 -1
- package/esm/chart/funnel/funnel.js.map +1 -1
- package/esm/chart/gauge/gauge.js +2 -2
- package/esm/chart/gauge/gauge.js.map +1 -1
- package/esm/chart/heatmap/heatmap.js +1 -1
- package/esm/chart/heatmap/heatmap.js.map +1 -1
- package/esm/chart/histogram/histogram-3d.js +2 -2
- package/esm/chart/histogram/histogram-3d.js.map +1 -1
- package/esm/chart/histogram/histogram.js +2 -2
- package/esm/chart/histogram/histogram.js.map +1 -1
- package/esm/chart/index.d.ts +1 -1
- package/esm/chart/index.js.map +1 -1
- package/esm/chart/line/line.js +1 -1
- package/esm/chart/line/line.js.map +1 -1
- package/esm/chart/map/map.js +2 -2
- package/esm/chart/map/map.js.map +1 -1
- package/esm/chart/pie/pie-3d.js +2 -2
- package/esm/chart/pie/pie-3d.js.map +1 -1
- package/esm/chart/pie/pie.js +2 -2
- package/esm/chart/pie/pie.js.map +1 -1
- package/esm/chart/polar/progress-like.js +1 -1
- package/esm/chart/polar/progress-like.js.map +1 -1
- package/esm/chart/polar/rose-like.js +1 -1
- package/esm/chart/polar/rose-like.js.map +1 -1
- package/esm/chart/progress/circular/circular.js +1 -1
- package/esm/chart/progress/circular/circular.js.map +1 -1
- package/esm/chart/progress/linear/linear.js +2 -2
- package/esm/chart/progress/linear/linear.js.map +1 -1
- package/esm/chart/radar/radar.js +5 -5
- package/esm/chart/radar/radar.js.map +1 -1
- package/esm/chart/range-area/range-area.js +1 -1
- package/esm/chart/range-area/range-area.js.map +1 -1
- package/esm/chart/range-column/range-column-3d.js +1 -1
- package/esm/chart/range-column/range-column-3d.js.map +1 -1
- package/esm/chart/range-column/range-column.js +1 -1
- package/esm/chart/range-column/range-column.js.map +1 -1
- package/esm/chart/rose/rose.js +4 -4
- package/esm/chart/rose/rose.js.map +1 -1
- package/esm/chart/sankey/sankey.js +1 -1
- package/esm/chart/sankey/sankey.js.map +1 -1
- package/esm/chart/scatter/scatter.js +2 -2
- package/esm/chart/scatter/scatter.js.map +1 -1
- package/esm/chart/sequence/sequence.js +4 -2
- package/esm/chart/sequence/sequence.js.map +1 -1
- package/esm/chart/stack.js.map +1 -1
- package/esm/chart/sunburst/sunburst.js +1 -1
- package/esm/chart/sunburst/sunburst.js.map +1 -1
- package/esm/chart/treemap/treemap.js +1 -1
- package/esm/chart/treemap/treemap.js.map +1 -1
- package/esm/chart/util.js +2 -2
- package/esm/chart/util.js.map +1 -1
- package/esm/chart/waterfall/waterfall.js +1 -1
- package/esm/chart/waterfall/waterfall.js.map +1 -1
- package/esm/chart/word-cloud/word-cloud-3d.js +1 -1
- package/esm/chart/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/chart/word-cloud/word-cloud.js +1 -1
- package/esm/chart/word-cloud/word-cloud.js.map +1 -1
- package/esm/compile/compiler.d.ts +4 -0
- package/esm/compile/compiler.js +4 -0
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compilable-item.d.ts +1 -0
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/compile/mark/compilable-mark.js +9 -11
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/compile/mark/interface.d.ts +0 -1
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/compile/mark/util.d.ts +2 -1
- package/esm/compile/mark/util.js +19 -3
- package/esm/compile/mark/util.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -14
- package/esm/component/axis/base-axis.js +19 -30
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +1 -1
- package/esm/component/axis/cartesian/axis.js +21 -20
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.d.ts +1 -0
- package/esm/component/axis/cartesian/band-axis.js +1 -0
- package/esm/component/axis/cartesian/band-axis.js.map +1 -1
- package/esm/component/axis/cartesian/index.d.ts +1 -0
- package/esm/component/axis/cartesian/index.js +2 -0
- package/esm/component/axis/cartesian/index.js.map +1 -1
- package/esm/component/axis/cartesian/interface/common.d.ts +2 -0
- package/esm/component/axis/cartesian/interface/common.js.map +1 -1
- package/esm/component/axis/cartesian/interface/spec.d.ts +4 -1
- package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
- package/esm/component/axis/cartesian/linear-axis.js +3 -4
- package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
- package/esm/component/axis/cartesian/symlog-axis.d.ts +16 -0
- package/esm/component/axis/cartesian/symlog-axis.js +24 -0
- package/esm/component/axis/cartesian/symlog-axis.js.map +1 -0
- package/esm/component/axis/cartesian/time-axis.js +3 -3
- package/esm/component/axis/cartesian/time-axis.js.map +1 -1
- package/esm/component/axis/interface.d.ts +4 -8
- package/esm/component/axis/interface.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +2 -1
- package/esm/component/axis/polar/axis.js +14 -13
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/polar/band-axis.d.ts +1 -0
- package/esm/component/axis/polar/interface/common.d.ts +1 -1
- package/esm/component/axis/polar/interface/common.js.map +1 -1
- package/esm/component/axis/{utils.d.ts → util.d.ts} +1 -1
- package/esm/component/axis/{utils.js → util.js} +7 -5
- package/esm/component/axis/util.js.map +1 -0
- package/esm/component/base/base-component.d.ts +10 -2
- package/esm/component/base/base-component.js +9 -5
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/base/interface.d.ts +8 -0
- package/esm/component/base/interface.js +2 -0
- package/esm/component/base/interface.js.map +1 -0
- package/esm/component/base/util.d.ts +2 -1
- package/esm/component/base/util.js +14 -7
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/brush/brush.d.ts +12 -2
- package/esm/component/brush/brush.js +74 -62
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +2 -2
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/cartesian.js +7 -7
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/interface/spec.d.ts +8 -8
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/crosshair/interface/theme.d.ts +3 -1
- package/esm/component/crosshair/interface/theme.js.map +1 -1
- package/esm/component/crosshair/polar.js +8 -8
- package/esm/component/crosshair/polar.js.map +1 -1
- package/esm/component/crosshair/util.d.ts +5 -0
- package/esm/component/crosshair/util.js +34 -0
- package/esm/component/crosshair/util.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +1 -1
- package/esm/component/custom-mark/custom-mark.js +4 -4
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +0 -1
- package/esm/component/data-zoom/data-filter-base-component.js +2 -9
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +8 -6
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/interface.d.ts +2 -2
- package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/esm/component/data-zoom/interface.d.ts +2 -5
- package/esm/component/data-zoom/interface.js.map +1 -1
- package/esm/component/geo/geo-coordinate.d.ts +2 -0
- package/esm/component/geo/geo-coordinate.js +30 -4
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/geo/projection.d.ts +1 -0
- package/esm/component/geo/projection.js +4 -0
- package/esm/component/geo/projection.js.map +1 -1
- package/esm/component/index.d.ts +2 -2
- package/esm/component/index.js +2 -2
- package/esm/component/index.js.map +1 -1
- package/esm/component/indicator/indicator.d.ts +1 -0
- package/esm/component/indicator/indicator.js +8 -7
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/indicator/interface.d.ts +5 -6
- package/esm/component/indicator/interface.js.map +1 -1
- package/esm/component/interface/theme.d.ts +2 -2
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/interface/type.d.ts +1 -0
- package/esm/component/interface/type.js +12 -11
- package/esm/component/interface/type.js.map +1 -1
- package/esm/component/label/base-label.d.ts +0 -1
- package/esm/component/label/base-label.js +0 -5
- package/esm/component/label/base-label.js.map +1 -1
- package/esm/component/label/interface.d.ts +2 -1
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/label.d.ts +0 -1
- package/esm/component/label/label.js +2 -7
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/totalLabel.js +2 -2
- package/esm/component/label/totalLabel.js.map +1 -1
- package/esm/component/legend/base-legend.js +5 -5
- package/esm/component/legend/base-legend.js.map +1 -1
- package/esm/component/legend/continuous/util.js +5 -3
- package/esm/component/legend/continuous/util.js.map +1 -1
- package/esm/component/legend/discrete/interface.d.ts +3 -1
- package/esm/component/legend/discrete/interface.js.map +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/discrete/util.js +4 -4
- package/esm/component/legend/discrete/util.js.map +1 -1
- package/esm/component/legend/interface.d.ts +2 -6
- package/esm/component/legend/interface.js.map +1 -1
- package/esm/component/legend/util.js +4 -2
- package/esm/component/legend/util.js.map +1 -1
- package/esm/component/marker/interface.d.ts +2 -2
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/poptip/interface.d.ts +15 -0
- package/esm/component/poptip/interface.js +2 -0
- package/esm/component/poptip/interface.js.map +1 -0
- package/esm/component/title/interface/spec.d.ts +2 -2
- package/esm/component/title/interface/spec.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-column-model.js +7 -5
- package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-model.js +2 -2
- package/esm/component/tooltip/handler/dom/model/content-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/title-model.js +3 -3
- package/esm/component/tooltip/handler/dom/model/title-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/tooltip-model.js +4 -2
- package/esm/component/tooltip/handler/dom/model/tooltip-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/util.js +4 -4
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +5 -5
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/get-spec.js +2 -2
- package/esm/component/tooltip/handler/utils/get-spec.js.map +1 -1
- package/esm/component/tooltip/handler/utils/style.js +2 -2
- package/esm/component/tooltip/handler/utils/style.js.map +1 -1
- package/esm/component/tooltip/processor/base.js +1 -1
- package/esm/component/tooltip/processor/base.js.map +1 -1
- package/esm/component/tooltip/tooltip.js +4 -3
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +22 -19
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/transforms/dimension-statistics.d.ts +11 -5
- package/esm/data/transforms/dimension-statistics.js +33 -22
- package/esm/data/transforms/dimension-statistics.js.map +1 -1
- package/esm/data/transforms/legend-data/discrete/discrete.js +4 -3
- package/esm/data/transforms/legend-data/discrete/discrete.js.map +1 -1
- package/esm/data/transforms/tick-data/discrete/polar-angle.js +1 -1
- package/esm/data/transforms/tick-data/discrete/polar-angle.js.map +1 -1
- package/esm/data/transforms/tick-data/util.js +1 -1
- package/esm/data/transforms/tick-data/util.js.map +1 -1
- package/esm/event/events/dimension/util/cartesian.js +2 -2
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/events/dimension/util/polar.js +1 -1
- package/esm/event/events/dimension/util/polar.js.map +1 -1
- package/esm/interaction/trigger.js +3 -3
- package/esm/interaction/trigger.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +1 -0
- package/esm/mark/base/base-mark.js +22 -5
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/mark-set/index.d.ts +1 -0
- package/esm/mark/mark-set/index.js.map +1 -1
- package/esm/mark/symbol.js +1 -1
- package/esm/mark/symbol.js.map +1 -1
- package/esm/model/base-model.js +4 -4
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +1 -1
- package/esm/model/interface.js.map +1 -1
- package/esm/plugin/components/index.d.ts +0 -2
- package/esm/plugin/components/index.js +0 -3
- package/esm/plugin/components/index.js.map +1 -1
- package/esm/series/area/area.d.ts +4 -1
- package/esm/series/area/area.js +10 -7
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/bar/bar.js +3 -5
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.d.ts +2 -0
- package/esm/series/base/base-series.js +71 -16
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/base/tooltip-helper.js +4 -2
- package/esm/series/base/tooltip-helper.js.map +1 -1
- package/esm/series/box-plot/box-plot.js +1 -1
- package/esm/series/box-plot/box-plot.js.map +1 -1
- package/esm/series/cartesian/cartesian.d.ts +10 -3
- package/esm/series/cartesian/cartesian.js +37 -26
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/cartesian/interface.d.ts +1 -0
- package/esm/series/cartesian/interface.js.map +1 -1
- package/esm/series/dot/dot.js +2 -2
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/funnel/funnel.js +12 -2
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/heatmap/heatmap.js +2 -2
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/line/interface.d.ts +0 -2
- package/esm/series/line/interface.js.map +1 -1
- package/esm/series/line/line.d.ts +1 -0
- package/esm/series/line/line.js +1 -1
- package/esm/series/line/line.js.map +1 -1
- package/esm/series/link/link.js +1 -1
- package/esm/series/link/link.js.map +1 -1
- package/esm/series/map/geo-source.js +3 -1
- package/esm/series/map/geo-source.js.map +1 -1
- package/esm/series/map/interface.d.ts +1 -0
- package/esm/series/map/interface.js.map +1 -1
- package/esm/series/map/map.js +9 -3
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +3 -2
- package/esm/series/mixin/line-mixin.js +32 -13
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/pie.js +2 -2
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/interface.d.ts +1 -0
- package/esm/series/polar/interface.js.map +1 -1
- package/esm/series/polar/polar.d.ts +4 -0
- package/esm/series/polar/polar.js +15 -2
- package/esm/series/polar/polar.js.map +1 -1
- package/esm/series/radar/radar.d.ts +1 -0
- package/esm/series/radar/radar.js +1 -1
- 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 +3 -0
- package/esm/series/range-area/range-area.js.map +1 -1
- package/esm/series/range-column/range-column.js +3 -3
- package/esm/series/range-column/range-column.js.map +1 -1
- package/esm/series/rose/rose.js +2 -2
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/sankey/interface.d.ts +3 -2
- package/esm/series/sankey/interface.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +5 -0
- package/esm/series/sankey/sankey.js +248 -93
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/scatter.d.ts +1 -1
- package/esm/series/scatter/scatter.js +14 -9
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/util/utils.d.ts +4 -1
- package/esm/series/util/utils.js +6 -4
- package/esm/series/util/utils.js.map +1 -1
- package/esm/theme/builtin/common/component/axis/cartesian-axis.js +4 -4
- package/esm/theme/builtin/common/component/axis/cartesian-axis.js.map +1 -1
- package/esm/theme/builtin/common/component/axis/common-axis.js +12 -6
- package/esm/theme/builtin/common/component/axis/common-axis.js.map +1 -1
- package/esm/theme/builtin/common/component/axis/polar-axis.js +1 -1
- package/esm/theme/builtin/common/component/axis/polar-axis.js.map +1 -1
- package/esm/theme/builtin/common/component/crosshair.js +73 -117
- package/esm/theme/builtin/common/component/crosshair.js.map +1 -1
- package/esm/theme/builtin/common/component/data-zoom.js +16 -6
- package/esm/theme/builtin/common/component/data-zoom.js.map +1 -1
- package/esm/theme/builtin/common/component/indicator.js +14 -4
- package/esm/theme/builtin/common/component/indicator.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/color-legend.js +32 -4
- package/esm/theme/builtin/common/component/legend/color-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/continuous.js +26 -12
- package/esm/theme/builtin/common/component/legend/continuous.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/discrete-legend.js +22 -9
- package/esm/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/legend/size-legend.js +55 -14
- package/esm/theme/builtin/common/component/legend/size-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/map-label.js +4 -6
- package/esm/theme/builtin/common/component/map-label.js.map +1 -1
- package/esm/theme/builtin/common/component/mark-area.js +4 -1
- package/esm/theme/builtin/common/component/mark-area.js.map +1 -1
- package/esm/theme/builtin/common/component/mark-line.js +4 -1
- package/esm/theme/builtin/common/component/mark-line.js.map +1 -1
- package/esm/theme/builtin/common/component/player.js +33 -7
- package/esm/theme/builtin/common/component/player.js.map +1 -1
- package/esm/theme/builtin/common/component/poptip.d.ts +2 -2
- package/esm/theme/builtin/common/component/poptip.js +17 -11
- package/esm/theme/builtin/common/component/poptip.js.map +1 -1
- package/esm/theme/builtin/common/component/title.js +9 -5
- package/esm/theme/builtin/common/component/title.js.map +1 -1
- package/esm/theme/builtin/common/component/tooltip.js +12 -11
- package/esm/theme/builtin/common/component/tooltip.js.map +1 -1
- package/esm/theme/builtin/common/component/total-label.js +3 -5
- package/esm/theme/builtin/common/component/total-label.js.map +1 -1
- package/esm/theme/builtin/common/constants.js +16 -7
- package/esm/theme/builtin/common/constants.js.map +1 -1
- package/esm/theme/builtin/common/mark.js +8 -4
- package/esm/theme/builtin/common/mark.js.map +1 -1
- package/esm/theme/builtin/common/series/area.js +1 -4
- package/esm/theme/builtin/common/series/area.js.map +1 -1
- package/esm/theme/builtin/common/series/bar.js +1 -4
- package/esm/theme/builtin/common/series/bar.js.map +1 -1
- package/esm/theme/builtin/common/series/bar3d.js +0 -3
- package/esm/theme/builtin/common/series/bar3d.js.map +1 -1
- package/esm/theme/builtin/common/series/circle-packing.js +8 -4
- package/esm/theme/builtin/common/series/circle-packing.js.map +1 -1
- package/esm/theme/builtin/common/series/dot.js +8 -2
- package/esm/theme/builtin/common/series/dot.js.map +1 -1
- package/esm/theme/builtin/common/series/funnel.js +6 -5
- package/esm/theme/builtin/common/series/funnel.js.map +1 -1
- package/esm/theme/builtin/common/series/funnel3d.js +6 -5
- package/esm/theme/builtin/common/series/funnel3d.js.map +1 -1
- package/esm/theme/builtin/common/series/line.js +1 -4
- package/esm/theme/builtin/common/series/line.js.map +1 -1
- package/esm/theme/builtin/common/series/map.js +4 -2
- package/esm/theme/builtin/common/series/map.js.map +1 -1
- package/esm/theme/builtin/common/series/pie.js +0 -3
- package/esm/theme/builtin/common/series/pie.js.map +1 -1
- package/esm/theme/builtin/common/series/pie3d.js +1 -6
- package/esm/theme/builtin/common/series/pie3d.js.map +1 -1
- package/esm/theme/builtin/common/series/radar.js +1 -4
- package/esm/theme/builtin/common/series/radar.js.map +1 -1
- package/esm/theme/builtin/common/series/rangeColumn.js +1 -4
- package/esm/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/esm/theme/builtin/common/series/rose.js +1 -2
- package/esm/theme/builtin/common/series/rose.js.map +1 -1
- package/esm/theme/builtin/common/series/sankey.js +0 -1
- package/esm/theme/builtin/common/series/sankey.js.map +1 -1
- package/esm/theme/builtin/common/series/scatter.js +1 -4
- package/esm/theme/builtin/common/series/scatter.js.map +1 -1
- package/esm/theme/builtin/common/series/sunburst.js +6 -1
- package/esm/theme/builtin/common/series/sunburst.js.map +1 -1
- package/esm/theme/builtin/common/series/treemap.js +8 -6
- package/esm/theme/builtin/common/series/treemap.js.map +1 -1
- package/esm/theme/builtin/common/series/waterfall.js +4 -7
- package/esm/theme/builtin/common/series/waterfall.js.map +1 -1
- package/esm/theme/builtin/dark/color-scheme.js +5 -3
- package/esm/theme/builtin/dark/color-scheme.js.map +1 -1
- package/esm/theme/builtin/index.d.ts +0 -1
- package/esm/theme/builtin/index.js +0 -2
- package/esm/theme/builtin/index.js.map +1 -1
- package/esm/theme/builtin/light/color-scheme.js +4 -2
- package/esm/theme/builtin/light/color-scheme.js.map +1 -1
- package/esm/theme/builtin/light/index.js +2 -2
- package/esm/theme/builtin/light/index.js.map +1 -1
- package/esm/theme/color-scheme/builtin/interface.d.ts +22 -0
- package/esm/theme/color-scheme/builtin/interface.js +2 -0
- package/esm/theme/color-scheme/builtin/interface.js.map +1 -0
- package/esm/theme/color-scheme/interface.d.ts +3 -2
- package/esm/theme/color-scheme/interface.js.map +1 -1
- package/esm/theme/color-scheme/util.js +8 -3
- package/esm/theme/color-scheme/util.js.map +1 -1
- package/esm/theme/interface.d.ts +16 -5
- package/esm/theme/interface.js.map +1 -1
- package/esm/typings/spec/common.d.ts +2 -1
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/visual.d.ts +10 -20
- package/esm/typings/visual.js.map +1 -1
- package/esm/util/data.d.ts +0 -8
- package/esm/util/data.js +1 -7
- package/esm/util/data.js.map +1 -1
- package/esm/util/object.d.ts +2 -4
- package/esm/util/object.js +2 -13
- package/esm/util/object.js.map +1 -1
- package/esm/util/scale.d.ts +2 -6
- package/esm/util/scale.js +1 -5
- package/esm/util/scale.js.map +1 -1
- package/esm/util/space.d.ts +3 -10
- package/esm/util/space.js +5 -23
- package/esm/util/space.js.map +1 -1
- package/esm/util/spec/background.d.ts +4 -0
- package/esm/util/spec/background.js +21 -0
- package/esm/util/spec/background.js.map +1 -0
- package/esm/util/spec/clone-deep.d.ts +1 -0
- package/esm/util/spec/clone-deep.js +20 -0
- package/esm/util/spec/clone-deep.js.map +1 -0
- package/esm/util/spec/common.d.ts +3 -0
- package/esm/util/spec/common.js +15 -0
- package/esm/util/spec/common.js.map +1 -0
- package/esm/util/spec/index.d.ts +7 -0
- package/esm/util/spec/index.js +14 -0
- package/esm/util/spec/index.js.map +1 -0
- package/esm/util/spec/merge-spec.d.ts +1 -0
- package/esm/util/spec/merge-spec.js +48 -0
- package/esm/util/spec/merge-spec.js.map +1 -0
- package/esm/util/spec/merge-theme.d.ts +3 -0
- package/esm/util/spec/merge-theme.js +34 -0
- package/esm/util/spec/merge-theme.js.map +1 -0
- package/esm/util/spec/preprocess.d.ts +3 -0
- package/esm/util/spec/preprocess.js +20 -0
- package/esm/util/spec/preprocess.js.map +1 -0
- package/esm/util/spec/transform.d.ts +3 -0
- package/esm/util/spec/transform.js +20 -0
- package/esm/util/spec/transform.js.map +1 -0
- package/esm/util/text.d.ts +1 -2
- package/esm/util/text.js +4 -12
- package/esm/util/text.js.map +1 -1
- package/esm/vchart-all.js +2 -2
- package/esm/vchart-all.js.map +1 -1
- package/esm/vchart-simple.js +18 -2
- package/esm/vchart-simple.js.map +1 -1
- package/package.json +20 -13
- package/cjs/component/axis/utils.js.map +0 -1
- package/cjs/plugin/components/axis-label-overlap-plugin.d.ts +0 -10
- package/cjs/plugin/components/axis-label-overlap-plugin.js +0 -75
- package/cjs/plugin/components/axis-label-overlap-plugin.js.map +0 -1
- package/cjs/theme/builtin/common/component/axis/log-axis.d.ts +0 -2
- package/cjs/theme/builtin/common/component/axis/log-axis.js +0 -22
- package/cjs/theme/builtin/common/component/axis/log-axis.js.map +0 -1
- package/cjs/theme/builtin/constant.d.ts +0 -2
- package/cjs/theme/builtin/constant.js +0 -8
- package/cjs/theme/builtin/constant.js.map +0 -1
- package/cjs/util/spec.d.ts +0 -17
- package/cjs/util/spec.js +0 -121
- package/cjs/util/spec.js.map +0 -1
- package/esm/component/axis/utils.js.map +0 -1
- package/esm/plugin/components/axis-label-overlap-plugin.d.ts +0 -10
- package/esm/plugin/components/axis-label-overlap-plugin.js +0 -72
- package/esm/plugin/components/axis-label-overlap-plugin.js.map +0 -1
- package/esm/theme/builtin/common/component/axis/log-axis.d.ts +0 -2
- package/esm/theme/builtin/common/component/axis/log-axis.js +0 -18
- package/esm/theme/builtin/common/component/axis/log-axis.js.map +0 -1
- package/esm/theme/builtin/constant.d.ts +0 -2
- package/esm/theme/builtin/constant.js +0 -4
- package/esm/theme/builtin/constant.js.map +0 -1
- package/esm/util/spec.d.ts +0 -17
- package/esm/util/spec.js +0 -112
- package/esm/util/spec.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { array } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { transformColorSchemeToStandardStruct } from "../../theme/color-scheme/util";
|
|
4
|
+
|
|
5
|
+
import { seriesMarkInfoMap } from "../../series/interface";
|
|
6
|
+
|
|
7
|
+
import { mergeSpec } from "./merge-spec";
|
|
8
|
+
|
|
9
|
+
export function mergeTheme(target, ...sources) {
|
|
10
|
+
return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function transformThemeToMerge(theme) {
|
|
14
|
+
if (!theme) return theme;
|
|
15
|
+
let {colorScheme: colorScheme} = theme;
|
|
16
|
+
colorScheme && (colorScheme = Object.keys(colorScheme).reduce(((scheme, key) => {
|
|
17
|
+
const value = colorScheme[key];
|
|
18
|
+
return scheme[key] = transformColorSchemeToStandardStruct(value), scheme;
|
|
19
|
+
}), {}));
|
|
20
|
+
let {series: series} = theme;
|
|
21
|
+
const {mark: markByType, markByName: markByName} = theme;
|
|
22
|
+
return (markByType || markByName) && (series = Object.keys(seriesMarkInfoMap).reduce(((newSeriesTheme, key) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const value = null !== (_a = null == series ? void 0 : series[key]) && void 0 !== _a ? _a : {}, newValue = {};
|
|
25
|
+
return Object.values(seriesMarkInfoMap[key]).forEach((({type: type, name: name}) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
newValue[name] = mergeSpec({}, null !== (_a = null == markByType ? void 0 : markByType[array(type)[0]]) && void 0 !== _a ? _a : {}, null !== (_b = null == markByName ? void 0 : markByName[name]) && void 0 !== _b ? _b : {}, value[name]);
|
|
28
|
+
})), newSeriesTheme[key] = Object.assign(Object.assign({}, value), newValue), newSeriesTheme;
|
|
29
|
+
}), {})), Object.assign(Object.assign({}, theme), {
|
|
30
|
+
colorScheme: colorScheme,
|
|
31
|
+
series: series
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=merge-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/spec/merge-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AAIrF,OAAO,EAAE,iBAAiB,EAAwB,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,UAAU,UAAU,CAAC,MAAqB,EAAE,GAAG,OAAwB;IAC3E,OAAO,SAAS,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAqB;IAClD,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAGD,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC5B,IAAI,WAAW,EAAE;QACf,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YAC/E,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;YAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,oCAAoC,CAAC,KAAK,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,EAAuB,CAAC,CAAC;KAC7B;IAGD,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC/C,IAAI,UAAU,IAAI,UAAU,EAAE;QAC5B,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,EAAE,GAAG,EAAE,EAAE;;YACrE,MAAM,KAAK,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,GAAG,CAAC,mCAAI,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,CAAkB,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;;gBAChF,QAAQ,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,EAAE,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,IAAI,CAAC,mCAAI,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5G,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,GAAG,CAAC,mCACd,KAAK,GACL,QAAQ,CACZ,CAAC;YACF,OAAO,cAAc,CAAC;QACxB,CAAC,EAAE,EAAkB,CAAC,CAAC;KACxB;IAED,uCACK,KAAK,KACR,WAAW;QACX,MAAM,IACN;AACJ,CAAC","file":"merge-theme.js","sourcesContent":["import { type Maybe, array } from '@visactor/vutils';\nimport type { ITheme } from '../../theme';\nimport { transformColorSchemeToStandardStruct } from '../../theme/color-scheme/util';\nimport type { IThemeColorScheme } from '../../theme/color-scheme/interface';\nimport type { ISeriesTheme } from '../../series/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport { seriesMarkInfoMap, type ISeriesMarkInfo } from '../../series/interface';\nimport { mergeSpec } from './merge-spec';\n\nexport function mergeTheme(target: Maybe<ITheme>, ...sources: Maybe<ITheme>[]): Maybe<ITheme> {\n return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));\n}\n\nfunction transformThemeToMerge(theme?: Maybe<ITheme>): Maybe<ITheme> {\n if (!theme) {\n return theme;\n }\n\n // 将色板转化为标准形式\n let { colorScheme } = theme;\n if (colorScheme) {\n colorScheme = Object.keys(colorScheme).reduce<IThemeColorScheme>((scheme, key) => {\n const value = colorScheme[key];\n scheme[key] = transformColorSchemeToStandardStruct(value);\n return scheme;\n }, {} as IThemeColorScheme);\n }\n\n // 将全局 mark 主题 merge 进系列主题\n let { series } = theme;\n const { mark: markByType, markByName } = theme;\n if (markByType || markByName) {\n series = Object.keys(seriesMarkInfoMap).reduce((newSeriesTheme, key) => {\n const value = series?.[key] ?? {};\n const newValue = {};\n Object.values<ISeriesMarkInfo>(seriesMarkInfoMap[key]).forEach(({ type, name }) => {\n newValue[name] = mergeSpec({}, markByType?.[array(type)[0]] ?? {}, markByName?.[name] ?? {}, value[name]);\n });\n newSeriesTheme[key] = {\n ...value,\n ...newValue\n };\n return newSeriesTheme;\n }, {} as ISeriesTheme);\n }\n\n return {\n ...theme,\n colorScheme,\n series\n };\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isArray, isFunction, isObject } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { isDataView, isHTMLElement } from "./common";
|
|
4
|
+
|
|
5
|
+
import { getActualColor, isColorKey } from "../../theme/color-scheme/util";
|
|
6
|
+
|
|
7
|
+
import { normalizeLayoutPaddingSpec } from "../space";
|
|
8
|
+
|
|
9
|
+
export function preprocessSpecOrTheme(obj, colorScheme, seriesType) {
|
|
10
|
+
if (isArray(obj)) return obj.map((element => isObject(element) && !isFunction(element) ? preprocessSpecOrTheme(element, colorScheme, seriesType) : element));
|
|
11
|
+
const newObj = {};
|
|
12
|
+
return Object.keys(obj).forEach((key => {
|
|
13
|
+
const value = obj[key];
|
|
14
|
+
if (key.includes("data")) newObj[key] = value; else if (isObject(value)) {
|
|
15
|
+
if (isFunction(value) || isDataView(value) || isHTMLElement(value)) return void (newObj[key] = value);
|
|
16
|
+
isColorKey(value) ? newObj[key] = getActualColor(value, colorScheme, seriesType) : newObj[key] = "padding" === key ? normalizeLayoutPaddingSpec(value) : preprocessSpecOrTheme(value, colorScheme, seriesType);
|
|
17
|
+
} else newObj[key] = value;
|
|
18
|
+
})), newObj;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=preprocess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/spec/preprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAGtD,MAAM,UAAU,qBAAqB,CAAC,GAAQ,EAAE,WAA+B,EAAE,UAA2B;IAC1G,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACvB,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC7C,OAAO,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;aAChE;YACD,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QAEvB,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YACxB,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACpB,OAAO;SACR;QACD,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;YAEnB,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE;gBAClE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACpB,OAAO;aACR;YACD,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;gBAErB,MAAM,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;aAC9D;iBAAM,IAAI,GAAG,KAAK,SAAS,EAAE;gBAE5B,MAAM,CAAC,GAAG,CAAC,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;aACrE;SACF;aAAM;YACL,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACrB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","file":"preprocess.js","sourcesContent":["import { isArray, isFunction, isObject } from '@visactor/vutils';\nimport type { SeriesTypeEnum } from '../../series/interface';\nimport type { IThemeColorScheme } from '../../theme/color-scheme/interface';\nimport { isDataView, isHTMLElement } from './common';\nimport { getActualColor, isColorKey } from '../../theme/color-scheme/util';\nimport { normalizeLayoutPaddingSpec } from '../space';\n\n/** 对 spec 或者类 spec 配置(如 theme)进行预处理,如进行语义化颜色的转换等 */\nexport function preprocessSpecOrTheme(obj: any, colorScheme?: IThemeColorScheme, seriesType?: SeriesTypeEnum): any {\n if (isArray(obj)) {\n return obj.map(element => {\n if (isObject(element) && !isFunction(element)) {\n return preprocessSpecOrTheme(element, colorScheme, seriesType);\n }\n return element;\n });\n }\n\n const newObj = {};\n Object.keys(obj).forEach(key => {\n const value = obj[key];\n // 绕过数据\n if (key.includes('data')) {\n newObj[key] = value;\n return;\n }\n if (isObject(value)) {\n // 绕过不可深拷贝的对象\n if (isFunction(value) || isDataView(value) || isHTMLElement(value)) {\n newObj[key] = value;\n return;\n }\n if (isColorKey(value)) {\n // 查询、替换语义化颜色\n newObj[key] = getActualColor(value, colorScheme, seriesType);\n } else if (key === 'padding') {\n // 标准化 padding\n newObj[key] = normalizeLayoutPaddingSpec(value);\n } else {\n newObj[key] = preprocessSpecOrTheme(value, colorScheme, seriesType);\n }\n } else {\n newObj[key] = value;\n }\n });\n\n return newObj;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isArray } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
export function specTransform(spec, special = {
|
|
4
|
+
data: v => v
|
|
5
|
+
}) {
|
|
6
|
+
if (!spec) return spec;
|
|
7
|
+
if (spec.constructor === Object) {
|
|
8
|
+
const result = {};
|
|
9
|
+
for (const key in spec) if (Object.prototype.hasOwnProperty.call(spec, key)) {
|
|
10
|
+
if (special[key]) {
|
|
11
|
+
result[key] = special[key](spec[key]);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
result[key] = specTransform(spec[key], special);
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
return isArray(spec) ? spec.map((s => specTransform(s, special))) : spec;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/spec/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,MAAM,UAAU,aAAa,CAC3B,IAAa,EACb,UAEI;IACF,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACb;IAED,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,IAAI,IAAI,CAAC,WAAW,KAAK,MAAM,EAAE;QAC/B,MAAM,MAAM,GAAQ,EAAE,CAAC;QACvB,KAAK,MAAM,GAAG,IAAI,IAAW,EAAE;YAC7B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;gBAEnD,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;oBAChB,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;oBACtC,SAAS;iBACV;gBACD,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;aACjD;SACF;QACD,OAAO,MAAM,CAAC;KACf;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;KACjD;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"transform.js","sourcesContent":["import { isArray } from '@visactor/vutils';\n\n// todo 以目前的场景来看,并没有递归的需要。\n// 考虑到不确定性,还是递归处理spec对象,时间消耗很少\nexport function specTransform(\n spec: unknown,\n special: {\n [key: string]: (v: unknown) => unknown;\n } = {\n data: v => v\n }\n): unknown {\n if (!spec) {\n return spec;\n }\n // 如果是普通对象\n if (spec.constructor === Object) {\n const result: any = {};\n for (const key in spec as any) {\n if (Object.prototype.hasOwnProperty.call(spec, key)) {\n // todo 特殊处理怎样更合理?\n if (special[key]) {\n result[key] = special[key](spec[key]);\n continue;\n }\n result[key] = specTransform(spec[key], special);\n }\n }\n return result;\n }\n // 如果是数组\n if (isArray(spec)) {\n return spec.map(s => specTransform(s, special));\n }\n return spec;\n}\n"]}
|
package/esm/util/text.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ITextMeasureOption } from '@visactor/vutils';
|
|
2
|
-
import { TextMeasure
|
|
2
|
+
import { TextMeasure } from '@visactor/vutils';
|
|
3
3
|
import type { ITextMarkSpec } from '../typings';
|
|
4
4
|
export declare const initTextMeasure: (textSpec?: Partial<ITextMarkSpec>, option?: Partial<ITextMeasureOption>, useNaiveCanvas?: boolean) => TextMeasure<ITextMarkSpec>;
|
|
5
|
-
export declare const testTextMeasure: (textSpec?: Partial<ITextMarkSpec>, useVRender?: boolean) => TestTextMeasure<any>;
|
package/esm/util/text.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import { TextMeasure
|
|
1
|
+
import { TextMeasure } from "@visactor/vutils";
|
|
2
2
|
|
|
3
3
|
import { getTextBounds } from "@visactor/vrender";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { THEME_CONSTANTS } from "../theme/builtin/common/constants";
|
|
6
6
|
|
|
7
7
|
export const initTextMeasure = (textSpec, option, useNaiveCanvas) => new TextMeasure(Object.assign({
|
|
8
8
|
defaultFontParams: {
|
|
9
|
-
fontFamily:
|
|
10
|
-
fontSize:
|
|
9
|
+
fontFamily: THEME_CONSTANTS.defaultFontFamily,
|
|
10
|
+
fontSize: THEME_CONSTANTS.defaultFontSize
|
|
11
11
|
},
|
|
12
12
|
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
13
13
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
14
14
|
}, null != option ? option : {}), textSpec);
|
|
15
|
-
|
|
16
|
-
export const testTextMeasure = (textSpec, useVRender) => new TestTextMeasure({
|
|
17
|
-
defaultFontParams: {
|
|
18
|
-
fontFamily: DEFAULT_TEXT_FONT_FAMILY,
|
|
19
|
-
fontSize: DEFAULT_TEXT_FONT_SIZE
|
|
20
|
-
},
|
|
21
|
-
getTextBounds: useVRender ? getTextBounds : void 0
|
|
22
|
-
}, textSpec);
|
|
23
15
|
//# sourceMappingURL=text.js.map
|
package/esm/util/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,QAAiC,EACjC,MAAoC,EACpC,cAAwB,EACI,EAAE;IAC9B,OAAO,IAAI,WAAW,iBAElB,iBAAiB,EAAE;YACjB,UAAU,EAAE,eAAe,CAAC,iBAAiB;YAC7C,QAAQ,EAAE,eAAe,CAAC,eAAe;SAC1C,EACD,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,EACzD,cAAc,EAAE,cAAc,GAAG,WAAW,CAAC,iBAAiB,GAAG,WAAW,CAAC,iBAAiB,CAAC,WAAW,EAAE,IACzG,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,GAEnB,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC","file":"text.js","sourcesContent":["import type { ITextMeasureOption } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { TextMeasure } from '@visactor/vutils';\nimport { getTextBounds } from '@visactor/vrender';\nimport type { ITextMarkSpec } from '../typings';\nimport { THEME_CONSTANTS } from '../theme/builtin/common/constants';\n\nexport const initTextMeasure = (\n textSpec?: Partial<ITextMarkSpec>,\n option?: Partial<ITextMeasureOption>,\n useNaiveCanvas?: boolean\n): TextMeasure<ITextMarkSpec> => {\n return new TextMeasure<ITextMarkSpec>(\n {\n defaultFontParams: {\n fontFamily: THEME_CONSTANTS.defaultFontFamily,\n fontSize: THEME_CONSTANTS.defaultFontSize\n },\n getTextBounds: useNaiveCanvas ? undefined : getTextBounds,\n specialCharSet: '-/: .,@%\\'\"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),\n ...(option ?? {})\n },\n textSpec\n );\n};\n"]}
|
package/esm/vchart-all.js
CHANGED
|
@@ -2,14 +2,14 @@ import { VChart, Factory } from "./core";
|
|
|
2
2
|
|
|
3
3
|
import { AreaChart, LineChart, BarChart, Bar3dChart, ScatterChart, MapChart, PieChart, Pie3dChart, RoseChart, RadarChart, CommonChart, SequenceChart, HistogramChart, Histogram3dChart, CircularProgressChart, WordCloudChart, WordCloud3dChart, FunnelChart, Funnel3dChart, LinearProgressChart, RangeColumnChart, RangeColumn3dChart, SunburstChart, CirclePackingChart, TreemapChart, WaterfallChart, BoxPlotChart, SankeyChart, GaugeChart, RangeAreaChart, HeatmapChart } from "./chart";
|
|
4
4
|
|
|
5
|
-
import { CartesianLinearAxis, CartesianBandAxis, CartesianTimeAxis, PolarBandAxis, CartesianLogAxis, PolarLinearAxis, DiscreteLegend, ContinuousLegend, Tooltip, CartesianCrossHair, PolarCrossHair, DataZoom, ScrollBar, Indicator, GeoCoordinate, MarkLine, Title, MarkArea, Player, Label, MarkPoint, Brush, CustomMark, MapLabelComponent, TotalLabel } from "./component";
|
|
5
|
+
import { CartesianLinearAxis, CartesianBandAxis, CartesianTimeAxis, PolarBandAxis, CartesianLogAxis, CartesianSymlogAxis, PolarLinearAxis, DiscreteLegend, ContinuousLegend, Tooltip, CartesianCrossHair, PolarCrossHair, DataZoom, ScrollBar, Indicator, GeoCoordinate, MarkLine, Title, MarkArea, Player, Label, MarkPoint, Brush, CustomMark, MapLabelComponent, TotalLabel } from "./component";
|
|
6
6
|
|
|
7
7
|
import { GridLayout, Layout3d } from "./layout";
|
|
8
8
|
|
|
9
9
|
import { loadPoptip } from "@visactor/vrender-components";
|
|
10
10
|
|
|
11
11
|
loadPoptip({}), VChart.useChart([ AreaChart, LineChart, BarChart, Bar3dChart, ScatterChart, MapChart, PieChart, Pie3dChart, RoseChart, RadarChart, CommonChart, SequenceChart, HistogramChart, Histogram3dChart, CircularProgressChart, WordCloudChart, WordCloud3dChart, FunnelChart, Funnel3dChart, LinearProgressChart, RangeColumnChart, RangeColumn3dChart, SunburstChart, CirclePackingChart, TreemapChart, WaterfallChart, BoxPlotChart, SankeyChart, GaugeChart, RangeAreaChart, HeatmapChart ]),
|
|
12
|
-
VChart.useComponent([ CartesianLinearAxis, CartesianBandAxis, CartesianTimeAxis, CartesianLogAxis, PolarBandAxis, PolarLinearAxis, DiscreteLegend, ContinuousLegend, Tooltip, CartesianCrossHair, PolarCrossHair, DataZoom, ScrollBar, Indicator, GeoCoordinate, MarkLine, Title, MarkArea, Player, TotalLabel, Label, MarkPoint, Brush, CustomMark, MapLabelComponent ]),
|
|
12
|
+
VChart.useComponent([ CartesianLinearAxis, CartesianBandAxis, CartesianTimeAxis, CartesianLogAxis, CartesianSymlogAxis, PolarBandAxis, PolarLinearAxis, DiscreteLegend, ContinuousLegend, Tooltip, CartesianCrossHair, PolarCrossHair, DataZoom, ScrollBar, Indicator, GeoCoordinate, MarkLine, Title, MarkArea, Player, TotalLabel, Label, MarkPoint, Brush, CustomMark, MapLabelComponent ]),
|
|
13
13
|
Factory.registerLayout("grid", GridLayout), Factory.registerLayout("layout3d", Layout3d);
|
|
14
14
|
|
|
15
15
|
export { VChart };
|
package/esm/vchart-all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,UAAU,CAAC,EAAE,CAAC,CAAC;AAGf,MAAM,CAAC,QAAQ,CAAC;IACd,SAAS;IACT,SAAS;IACT,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,qBAAqB;IACrB,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,WAAW;IACX,UAAU;IACV,cAAc;IACd,YAAY;CACb,CAAC,CAAC;AAGH,MAAM,CAAC,YAAY,CAAC;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,kBAAkB;IAClB,cAAc;IACd,QAAQ;IACR,SAAS;IACT,SAAS;IACT,aAAa;IACb,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,MAAM;IACN,UAAU;IACV,KAAK;IACL,SAAS;IACT,KAAK;IACL,UAAU;IACV,iBAAiB;CAClB,CAAC,CAAC;AAGH,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,UAAiB,CAAC,CAAC;AAClD,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,QAAe,CAAC,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,CAAC","file":"vchart-all.js","sourcesContent":["import { VChart, Factory } from './core';\nimport {\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreemapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n} from './chart';\n\nimport {\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n PolarBandAxis,\n CartesianLogAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent,\n TotalLabel\n} from './component';\nimport { GridLayout, Layout3d } from './layout';\nimport { loadPoptip } from '@visactor/vrender-components';\n\n// 装载 poptip\nloadPoptip({});\n\n// charts\nVChart.useChart([\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreemapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n CartesianLogAxis,\n PolarBandAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n TotalLabel,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent\n]);\n\n// layout\nFactory.registerLayout('grid', GridLayout as any);\nFactory.registerLayout('layout3d', Layout3d as any);\n\nexport { VChart };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,UAAU,CAAC,EAAE,CAAC,CAAC;AAGf,MAAM,CAAC,QAAQ,CAAC;IACd,SAAS;IACT,SAAS;IACT,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,qBAAqB;IACrB,cAAc;IACd,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,WAAW;IACX,UAAU;IACV,cAAc;IACd,YAAY;CACb,CAAC,CAAC;AAGH,MAAM,CAAC,YAAY,CAAC;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,aAAa;IACb,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,kBAAkB;IAClB,cAAc;IACd,QAAQ;IACR,SAAS;IACT,SAAS;IACT,aAAa;IACb,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,MAAM;IACN,UAAU;IACV,KAAK;IACL,SAAS;IACT,KAAK;IACL,UAAU;IACV,iBAAiB;CAClB,CAAC,CAAC;AAGH,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,UAAiB,CAAC,CAAC;AAClD,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,QAAe,CAAC,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,CAAC","file":"vchart-all.js","sourcesContent":["import { VChart, Factory } from './core';\nimport {\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreemapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n} from './chart';\n\nimport {\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n PolarBandAxis,\n CartesianLogAxis,\n CartesianSymlogAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent,\n TotalLabel\n} from './component';\nimport { GridLayout, Layout3d } from './layout';\nimport { loadPoptip } from '@visactor/vrender-components';\n\n// 装载 poptip\nloadPoptip({});\n\n// charts\nVChart.useChart([\n AreaChart,\n LineChart,\n BarChart,\n Bar3dChart,\n ScatterChart,\n MapChart,\n PieChart,\n Pie3dChart,\n RoseChart,\n RadarChart,\n CommonChart,\n SequenceChart,\n HistogramChart,\n Histogram3dChart,\n CircularProgressChart,\n WordCloudChart,\n WordCloud3dChart,\n FunnelChart,\n Funnel3dChart,\n LinearProgressChart,\n RangeColumnChart,\n RangeColumn3dChart,\n SunburstChart,\n CirclePackingChart,\n TreemapChart,\n WaterfallChart,\n BoxPlotChart,\n SankeyChart,\n GaugeChart,\n RangeAreaChart,\n HeatmapChart\n]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n CartesianLogAxis,\n CartesianSymlogAxis,\n PolarBandAxis,\n PolarLinearAxis,\n DiscreteLegend,\n ContinuousLegend,\n Tooltip,\n CartesianCrossHair,\n PolarCrossHair,\n DataZoom,\n ScrollBar,\n Indicator,\n GeoCoordinate,\n MarkLine,\n Title,\n MarkArea,\n Player,\n TotalLabel,\n Label,\n MarkPoint,\n Brush,\n CustomMark,\n MapLabelComponent\n]);\n\n// layout\nFactory.registerLayout('grid', GridLayout as any);\nFactory.registerLayout('layout3d', Layout3d as any);\n\nexport { VChart };\n"]}
|
package/esm/vchart-simple.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
+
import { Label } from "./component/label/label";
|
|
2
|
+
|
|
3
|
+
import { CartesianCrossHair } from "./component/crosshair/cartesian";
|
|
4
|
+
|
|
5
|
+
import { Tooltip } from "./component/tooltip/tooltip";
|
|
6
|
+
|
|
7
|
+
import { DiscreteLegend } from "./component/legend/discrete/legend";
|
|
8
|
+
|
|
9
|
+
import { CartesianTimeAxis } from "./component/axis/cartesian/time-axis";
|
|
10
|
+
|
|
11
|
+
import { CartesianBandAxis } from "./component/axis/cartesian/band-axis";
|
|
12
|
+
|
|
13
|
+
import { CartesianLinearAxis } from "./component/axis/cartesian/linear-axis";
|
|
14
|
+
|
|
1
15
|
import { VChart } from "./core";
|
|
2
16
|
|
|
3
|
-
import { LineChart
|
|
17
|
+
import { LineChart } from "./chart/line";
|
|
18
|
+
|
|
19
|
+
import { PieChart } from "./chart/pie";
|
|
4
20
|
|
|
5
|
-
import {
|
|
21
|
+
import { BarChart } from "./chart/bar";
|
|
6
22
|
|
|
7
23
|
VChart.useChart([ LineChart, BarChart, PieChart ]), VChart.useComponent([ CartesianLinearAxis, CartesianBandAxis, CartesianTimeAxis, DiscreteLegend, Tooltip, CartesianCrossHair, Label ]);
|
|
8
24
|
|
package/esm/vchart-simple.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vchart-simple.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/vchart-simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAI7E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGjD,MAAM,CAAC,YAAY,CAAC;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,OAAO;IACP,kBAAkB;IAClB,KAAK;CACN,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC","file":"vchart-simple.js","sourcesContent":["import { Label } from './component/label/label';\nimport { CartesianCrossHair } from './component/crosshair/cartesian';\nimport { Tooltip } from './component/tooltip/tooltip';\nimport { DiscreteLegend } from './component/legend/discrete/legend';\nimport { CartesianTimeAxis } from './component/axis/cartesian/time-axis';\nimport { CartesianBandAxis } from './component/axis/cartesian/band-axis';\nimport { CartesianLinearAxis } from './component/axis/cartesian/linear-axis';\n/**\n * @description 包含基础的折柱饼图,提供坐标轴、离散图例以及 tooltip、crosshair、label 组件\n */\nimport { VChart } from './core';\nimport { LineChart } from './chart/line';\nimport { PieChart } from './chart/pie';\nimport { BarChart } from './chart/bar';\n\n// charts\nVChart.useChart([LineChart, BarChart, PieChart]);\n\n// components\nVChart.useComponent([\n CartesianLinearAxis,\n CartesianBandAxis,\n CartesianTimeAxis,\n DiscreteLegend,\n Tooltip,\n CartesianCrossHair,\n Label\n]);\n\nexport { VChart };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vchart",
|
|
3
|
-
"version": "1.3.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "charts lib based @visactor/VGrammar",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -65,6 +65,10 @@
|
|
|
65
65
|
"@esbuild-plugins/node-globals-polyfill": "0.1.1",
|
|
66
66
|
"@esbuild-plugins/node-modules-polyfill": "0.1.4",
|
|
67
67
|
"rollup-plugin-node-polyfills": "0.2.1",
|
|
68
|
+
"rollup-plugin-visualizer": "5.9.2",
|
|
69
|
+
"rollup-plugin-gzip": "3.1.0",
|
|
70
|
+
"rollup-plugin-bundle-size": "1.0.3",
|
|
71
|
+
"rollup-plugin-sizes": "1.0.5",
|
|
68
72
|
"rollup": "3.20.5",
|
|
69
73
|
"node-fetch": "2.6.7",
|
|
70
74
|
"form-data": "~4.0.0",
|
|
@@ -75,18 +79,18 @@
|
|
|
75
79
|
"@internal/ts-config": "0.0.1"
|
|
76
80
|
},
|
|
77
81
|
"dependencies": {
|
|
78
|
-
"@visactor/vutils": "~0.15.
|
|
79
|
-
"@visactor/vdataset": "~0.15.
|
|
80
|
-
"@visactor/vscale": "~0.15.
|
|
81
|
-
"@visactor/vgrammar": "~0.6.
|
|
82
|
-
"@visactor/vgrammar-projection": "~0.6.
|
|
83
|
-
"@visactor/vgrammar-wordcloud": "~0.6.
|
|
84
|
-
"@visactor/vgrammar-wordcloud-shape": "~0.6.
|
|
85
|
-
"@visactor/vgrammar-hierarchy": "~0.6.
|
|
86
|
-
"@visactor/vgrammar-sankey": "~0.6.
|
|
87
|
-
"@visactor/vgrammar-util": "~0.6.
|
|
88
|
-
"@visactor/vrender": "~0.14.
|
|
89
|
-
"@visactor/vrender-components": "~0.14.
|
|
82
|
+
"@visactor/vutils": "~0.15.9",
|
|
83
|
+
"@visactor/vdataset": "~0.15.9",
|
|
84
|
+
"@visactor/vscale": "~0.15.9",
|
|
85
|
+
"@visactor/vgrammar": "~0.6.5",
|
|
86
|
+
"@visactor/vgrammar-projection": "~0.6.5",
|
|
87
|
+
"@visactor/vgrammar-wordcloud": "~0.6.5",
|
|
88
|
+
"@visactor/vgrammar-wordcloud-shape": "~0.6.5",
|
|
89
|
+
"@visactor/vgrammar-hierarchy": "~0.6.5",
|
|
90
|
+
"@visactor/vgrammar-sankey": "~0.6.5",
|
|
91
|
+
"@visactor/vgrammar-util": "~0.6.5",
|
|
92
|
+
"@visactor/vrender": "~0.14.7",
|
|
93
|
+
"@visactor/vrender-components": "~0.14.7"
|
|
90
94
|
},
|
|
91
95
|
"publishConfig": {
|
|
92
96
|
"access": "public",
|
|
@@ -97,6 +101,9 @@
|
|
|
97
101
|
"build:schema": "schema src/typings/spec/chart.ts ISpec --useTypeOfKeyword --ignoreErrors --required > ../vchart-schema/vchart.json",
|
|
98
102
|
"build": "bundle --clean && npm run build:schema && npm run build:es5",
|
|
99
103
|
"build:ci": "bundle --clean -f umd --minify=false --ignorePostTasks --name ChartSpace",
|
|
104
|
+
"analyze": "npm run analyze-full && npm run analyze-line && npm run analyze-simple",
|
|
105
|
+
"analyze-full": "BUNDLE_ANALYZE='full' bundle -f umd ",
|
|
106
|
+
"analyze-simple": "BUNDLE_ANALYZE='simple' bundle -f umd",
|
|
100
107
|
"dev": "bundle --clean -f es -w",
|
|
101
108
|
"compile": "tsc --noEmit",
|
|
102
109
|
"start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/component/axis/utils.ts"],"names":[],"mappings":"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","file":"utils.js","sourcesContent":["import type { ITheme } from './../../theme/interface';\nimport { merge, get } from '@visactor/vutils';\nimport type { IOrientType, IPolarOrientType } from '../../typings';\nimport type { AxisType, ICommonAxisSpec, ILinearAxisSpec } from './interface';\nimport { transformComponentStyle } from '../../util/style';\nimport { isXAxis } from './cartesian/util';\n\nexport const DEFAULT_TITLE_STYLE = {\n left: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n right: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n radius: {},\n angle: {}\n};\n\nexport function transformAxisLineStyle(lineCfg: any) {\n lineCfg = transformComponentStyle(lineCfg);\n lineCfg.startSymbol = transformComponentStyle(lineCfg.startSymbol);\n lineCfg.endSymbol = transformComponentStyle(lineCfg.endSymbol);\n\n return lineCfg;\n}\n\nexport function getAxisLabelOffset(axisSpec: ICommonAxisSpec) {\n let labelOffset = 0;\n if (get(axisSpec, 'tick.visible')) {\n labelOffset += get(axisSpec, 'tick.tickSize');\n }\n\n if (get(axisSpec, 'label.visible')) {\n labelOffset += get(axisSpec, 'label.space');\n }\n\n return labelOffset;\n}\n\nexport function getLinearAxisSpecDomain(\n axisSpec: ILinearAxisSpec,\n defaultDomain?: {\n min?: number;\n max?: number;\n }\n) {\n // 兼容策略\n return {\n min: axisSpec.min ?? axisSpec.range?.min ?? defaultDomain?.min,\n max: axisSpec.max ?? axisSpec.range?.max ?? defaultDomain?.max\n };\n}\n\nexport function isValidCartesianAxis(spec: any) {\n const orient = spec?.orient;\n return orient === 'top' || orient === 'bottom' || orient === 'left' || orient === 'right' || orient === 'z';\n}\n\nexport function isValidPolarAxis(spec: any) {\n const orient = spec?.orient;\n return orient === 'angle' || orient === 'radius';\n}\n\nexport const getCartesianAxisTheme = (orient: IOrientType, type: AxisType, theme: ITheme) => {\n const { axisBand, axisLinear, axisX, axisY, axis } = theme.component ?? {};\n const axisTypeTheme = (type === 'band' ? axisBand : type === 'linear' ? axisLinear : {}) ?? {};\n const axisTheme = isXAxis(orient) ? axisX : axisY;\n return merge({}, axis, axisTypeTheme, axisTheme);\n};\n\nexport const getPolarAxisTheme = (orient: IPolarOrientType, type: AxisType, theme: ITheme) => {\n const { axisBand, axisLinear, axisAngle, axisRadius, axis } = theme.component ?? {};\n const axisTypeTheme = (type === 'band' ? axisBand : type === 'linear' ? axisLinear : {}) ?? {};\n const axisTheme = orient === 'angle' ? axisAngle : axisRadius;\n return merge({}, axis, axisTypeTheme, axisTheme);\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BasicComponentPlugin } from './basic-plugin';
|
|
2
|
-
import type { IComponentPlugin, IComponentPluginService } from './interface';
|
|
3
|
-
import type { CartesianAxis } from '../../component/axis/cartesian';
|
|
4
|
-
export declare class AxisLabelOverlapPlugin extends BasicComponentPlugin implements IComponentPlugin {
|
|
5
|
-
Name: string;
|
|
6
|
-
constructor();
|
|
7
|
-
onDidLayoutVertical(service: IComponentPluginService, axis: CartesianAxis): void;
|
|
8
|
-
onDidLayoutHorizontal(service: IComponentPluginService, axis: CartesianAxis): void;
|
|
9
|
-
private _doOverlap;
|
|
10
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.AxisLabelOverlapPlugin = void 0;
|
|
6
|
-
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), basic_plugin_1 = require("./basic-plugin"), common_1 = require("../../component/axis/cartesian/util/common"), util_1 = require("../../util");
|
|
8
|
-
|
|
9
|
-
function labelFlush(axisLabels, axis) {
|
|
10
|
-
const {width: width, height: height} = axis.getLayoutRect(), isX = (0, common_1.isXAxis)(axis.layoutOrient), isInverse = !0 === axis.getSpec().inverse, first = axisLabels[0], last = (0,
|
|
11
|
-
util_1.peek)(axisLabels);
|
|
12
|
-
if (isX) if (isInverse) {
|
|
13
|
-
const start = width, end = 0, startBound = first.AABBBounds.x2, endBound = last.AABBBounds.x1;
|
|
14
|
-
startBound > start && first.setAttributes({
|
|
15
|
-
x: start,
|
|
16
|
-
textAlign: "right"
|
|
17
|
-
}), endBound < end && last.setAttributes({
|
|
18
|
-
x: end,
|
|
19
|
-
textAlign: "left"
|
|
20
|
-
});
|
|
21
|
-
} else {
|
|
22
|
-
const start = 0, end = width, startBound = first.AABBBounds.x1, endBound = last.AABBBounds.x2;
|
|
23
|
-
startBound < start && first.setAttributes({
|
|
24
|
-
x: start,
|
|
25
|
-
textAlign: "left"
|
|
26
|
-
}), endBound > end && last.setAttributes({
|
|
27
|
-
x: end,
|
|
28
|
-
textAlign: "right"
|
|
29
|
-
});
|
|
30
|
-
} else if (isInverse) {
|
|
31
|
-
const startBound = first.AABBBounds.y1, endBound = last.AABBBounds.y2, start = 0, end = height;
|
|
32
|
-
startBound < start && first.setAttributes({
|
|
33
|
-
y: start,
|
|
34
|
-
textBaseline: "top"
|
|
35
|
-
}), endBound > end && last.setAttributes({
|
|
36
|
-
y: end,
|
|
37
|
-
textBaseline: "bottom"
|
|
38
|
-
});
|
|
39
|
-
} else {
|
|
40
|
-
const start = height, end = 0, startBound = first.AABBBounds.y2, endBound = last.AABBBounds.y1;
|
|
41
|
-
startBound > start && first.setAttributes({
|
|
42
|
-
y: start,
|
|
43
|
-
textBaseline: "bottom"
|
|
44
|
-
}), endBound < end && last.setAttributes({
|
|
45
|
-
y: end,
|
|
46
|
-
textBaseline: "top"
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function overlap(axisLabels, axis) {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
const spec = null === (_a = axis.getSpec) || void 0 === _a ? void 0 : _a.call(axis);
|
|
54
|
-
(0, vutils_1.isEmpty)(axisLabels) || (null === (_b = null == spec ? void 0 : spec.label) || void 0 === _b ? void 0 : _b.flush) && labelFlush(axisLabels, axis);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
class AxisLabelOverlapPlugin extends basic_plugin_1.BasicComponentPlugin {
|
|
58
|
-
constructor() {
|
|
59
|
-
super(AxisLabelOverlapPlugin.Name), this.Name = "AxisLabelOverlapPlugin";
|
|
60
|
-
}
|
|
61
|
-
onDidLayoutVertical(service, axis) {
|
|
62
|
-
this._doOverlap(service, axis);
|
|
63
|
-
}
|
|
64
|
-
onDidLayoutHorizontal(service, axis) {
|
|
65
|
-
this._doOverlap(service, axis);
|
|
66
|
-
}
|
|
67
|
-
_doOverlap(service, axis) {
|
|
68
|
-
const axisComponent = axis.getSceneNodeMarks()[0].getGroupGraphicItem(), layer0LabelsContainer = axisComponent.find((node => "axis-label-container-layer-0" === node.name), !0), layer1LabelsContainer = axisComponent.find((node => "axis-label-container-layer-1" === node.name), !0);
|
|
69
|
-
overlap(layer0LabelsContainer ? layer0LabelsContainer.getChildren() : [], service.component),
|
|
70
|
-
overlap(layer1LabelsContainer ? layer1LabelsContainer.getChildren() : [], service.component);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
exports.AxisLabelOverlapPlugin = AxisLabelOverlapPlugin;
|
|
75
|
-
//# sourceMappingURL=axis-label-overlap-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/axis-label-overlap-plugin.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAE3C,iDAAsD;AAGtD,uEAAqE;AACrE,qCAAkC;AAGlC,SAAS,UAAU,CAAC,UAAmB,EAAE,IAAgB;IACvD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAG,IAAA,gBAAO,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC;IAClD,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,UAAU,CAAC,CAAC;IAE9B,IAAI,GAAG,EAAE;QACP,IAAI,SAAS,EAAE;YACb,MAAM,KAAK,GAAG,KAAK,CAAC;YACpB,MAAM,GAAG,GAAG,CAAC,CAAC;YACd,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAEpC,IAAI,UAAU,GAAG,KAAK,EAAE;gBACtB,KAAK,CAAC,aAAa,CAAC;oBAClB,CAAC,EAAE,KAAK;oBACR,SAAS,EAAE,OAAO;iBACnB,CAAC,CAAC;aACJ;YAED,IAAI,QAAQ,GAAG,GAAG,EAAE;gBAClB,IAAI,CAAC,aAAa,CAAC;oBACjB,CAAC,EAAE,GAAG;oBACN,SAAS,EAAE,MAAM;iBAClB,CAAC,CAAC;aACJ;SACF;aAAM;YACL,MAAM,KAAK,GAAG,CAAC,CAAC;YAChB,MAAM,GAAG,GAAG,KAAK,CAAC;YAClB,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,IAAI,UAAU,GAAG,KAAK,EAAE;gBACtB,KAAK,CAAC,aAAa,CAAC;oBAClB,CAAC,EAAE,KAAK;oBACR,SAAS,EAAE,MAAM;iBAClB,CAAC,CAAC;aACJ;YAED,IAAI,QAAQ,GAAG,GAAG,EAAE;gBAClB,IAAI,CAAC,aAAa,CAAC;oBACjB,CAAC,EAAE,GAAG;oBACN,SAAS,EAAE,OAAO;iBACnB,CAAC,CAAC;aACJ;SACF;KACF;SAAM;QACL,IAAI,SAAS,EAAE;YACb,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,MAAM,KAAK,GAAG,CAAC,CAAC;YAChB,MAAM,GAAG,GAAG,MAAM,CAAC;YAEnB,IAAI,UAAU,GAAG,KAAK,EAAE;gBACtB,KAAK,CAAC,aAAa,CAAC;oBAClB,CAAC,EAAE,KAAK;oBACR,YAAY,EAAE,KAAK;iBACpB,CAAC,CAAC;aACJ;YAED,IAAI,QAAQ,GAAG,GAAG,EAAE;gBAClB,IAAI,CAAC,aAAa,CAAC;oBACjB,CAAC,EAAE,GAAG;oBACN,YAAY,EAAE,QAAQ;iBACvB,CAAC,CAAC;aACJ;SACF;aAAM;YACL,MAAM,KAAK,GAAG,MAAM,CAAC;YACrB,MAAM,GAAG,GAAG,CAAC,CAAC;YACd,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAEpC,IAAI,UAAU,GAAG,KAAK,EAAE;gBACtB,KAAK,CAAC,aAAa,CAAC;oBAClB,CAAC,EAAE,KAAK;oBACR,YAAY,EAAE,QAAQ;iBACvB,CAAC,CAAC;aACJ;YAED,IAAI,QAAQ,GAAG,GAAG,EAAE;gBAClB,IAAI,CAAC,aAAa,CAAC;oBACjB,CAAC,EAAE,GAAG;oBACN,YAAY,EAAE,KAAK;iBACpB,CAAC,CAAC;aACJ;SACF;KACF;AACH,CAAC;AAED,SAAS,OAAO,CAAC,UAAmB,EAAE,IAAgB;;IACpD,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;IAC9B,IAAI,CAAC,IAAA,gBAAO,EAAC,UAAU,CAAC,EAAE;QAExB,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,KAAK,EAAE;YACtB,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SAC9B;KACF;AACH,CAAC;AAED,MAAa,sBAAuB,SAAQ,mCAAoB;IAG9D;QACE,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAHrC,SAAI,GAAW,wBAAwB,CAAC;IAIxC,CAAC;IAED,mBAAmB,CAAC,OAAgC,EAAE,IAAmB;QACvE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,qBAAqB,CAAC,OAAgC,EAAE,IAAmB;QACzE,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAEO,UAAU,CAAC,OAAgC,EAAE,IAAmB;QACtE,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;QACxE,MAAM,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAC9C,CAAC,IAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,8BAA8B,EAC7D,IAAI,CACK,CAAC;QACZ,MAAM,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAC9C,CAAC,IAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,8BAA8B,EAC7D,IAAI,CACK,CAAC;QACZ,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAE,qBAAqB,CAAC,WAAW,EAAc,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1G,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAE,qBAAqB,CAAC,WAAW,EAAc,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5G,CAAC;CACF;AA3BD,wDA2BC","file":"axis-label-overlap-plugin.js","sourcesContent":["import { isEmpty } from '@visactor/vutils';\nimport type { IText, IGroup, INode } from '@visactor/vrender';\nimport { BasicComponentPlugin } from './basic-plugin';\nimport type { IComponentPlugin, IComponentPluginService } from './interface';\nimport type { IComponent } from '../../component/interface';\nimport { isXAxis } from '../../component/axis/cartesian/util/common';\nimport { peek } from '../../util';\nimport type { CartesianAxis } from '../../component/axis/cartesian';\n\nfunction labelFlush(axisLabels: IText[], axis: IComponent) {\n const { width, height } = axis.getLayoutRect();\n const isX = isXAxis(axis.layoutOrient);\n const isInverse = axis.getSpec().inverse === true;\n const first = axisLabels[0];\n const last = peek(axisLabels);\n\n if (isX) {\n if (isInverse) {\n const start = width;\n const end = 0;\n const startBound = first.AABBBounds.x2;\n const endBound = last.AABBBounds.x1;\n\n if (startBound > start) {\n first.setAttributes({\n x: start,\n textAlign: 'right'\n });\n }\n\n if (endBound < end) {\n last.setAttributes({\n x: end,\n textAlign: 'left'\n });\n }\n } else {\n const start = 0;\n const end = width;\n const startBound = first.AABBBounds.x1;\n const endBound = last.AABBBounds.x2;\n if (startBound < start) {\n first.setAttributes({\n x: start,\n textAlign: 'left'\n });\n }\n\n if (endBound > end) {\n last.setAttributes({\n x: end,\n textAlign: 'right'\n });\n }\n }\n } else {\n if (isInverse) {\n const startBound = first.AABBBounds.y1;\n const endBound = last.AABBBounds.y2;\n const start = 0;\n const end = height;\n\n if (startBound < start) {\n first.setAttributes({\n y: start,\n textBaseline: 'top'\n });\n }\n\n if (endBound > end) {\n last.setAttributes({\n y: end,\n textBaseline: 'bottom'\n });\n }\n } else {\n const start = height;\n const end = 0;\n const startBound = first.AABBBounds.y2;\n const endBound = last.AABBBounds.y1;\n\n if (startBound > start) {\n first.setAttributes({\n y: start,\n textBaseline: 'bottom'\n });\n }\n\n if (endBound < end) {\n last.setAttributes({\n y: end,\n textBaseline: 'top'\n });\n }\n }\n }\n}\n\nfunction overlap(axisLabels: IText[], axis: IComponent) {\n const spec = axis.getSpec?.();\n if (!isEmpty(axisLabels)) {\n // 首尾标签向内偏移\n if (spec?.label?.flush) {\n labelFlush(axisLabels, axis);\n }\n }\n}\n\nexport class AxisLabelOverlapPlugin extends BasicComponentPlugin implements IComponentPlugin {\n Name: string = 'AxisLabelOverlapPlugin';\n\n constructor() {\n super(AxisLabelOverlapPlugin.Name);\n }\n\n onDidLayoutVertical(service: IComponentPluginService, axis: CartesianAxis) {\n this._doOverlap(service, axis);\n }\n onDidLayoutHorizontal(service: IComponentPluginService, axis: CartesianAxis) {\n this._doOverlap(service, axis);\n }\n\n private _doOverlap(service: IComponentPluginService, axis: CartesianAxis) {\n const axisComponent = axis.getSceneNodeMarks()[0].getGroupGraphicItem();\n const layer0LabelsContainer = axisComponent.find(\n (node: INode) => node.name === 'axis-label-container-layer-0',\n true\n ) as IGroup;\n const layer1LabelsContainer = axisComponent.find(\n (node: INode) => node.name === 'axis-label-container-layer-1',\n true\n ) as IGroup;\n overlap(layer0LabelsContainer ? (layer0LabelsContainer.getChildren() as IText[]) : [], service.component);\n overlap(layer1LabelsContainer ? (layer1LabelsContainer.getChildren() as IText[]) : [], service.component);\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.axisLog = void 0, exports.axisLog = {
|
|
6
|
-
domainLine: {
|
|
7
|
-
visible: !1
|
|
8
|
-
},
|
|
9
|
-
grid: {
|
|
10
|
-
visible: !0
|
|
11
|
-
},
|
|
12
|
-
subGrid: {
|
|
13
|
-
visible: !1
|
|
14
|
-
},
|
|
15
|
-
tick: {
|
|
16
|
-
visible: !1
|
|
17
|
-
},
|
|
18
|
-
subTick: {
|
|
19
|
-
visible: !1
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=log-axis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/common/component/axis/log-axis.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAqB;IACvC,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;KACf;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;KACf;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;KACf;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;KACf;CACF,CAAC","file":"log-axis.js","sourcesContent":["import type { IAxisCommonTheme } from '../../../../../component/axis';\n\nexport const axisLog: IAxisCommonTheme = {\n domainLine: {\n visible: false\n },\n grid: {\n visible: true\n },\n subGrid: {\n visible: false\n },\n tick: {\n visible: false\n },\n subTick: {\n visible: false\n }\n};\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.DEFAULT_TEXT_FONT_SIZE = exports.DEFAULT_TEXT_FONT_FAMILY = void 0,
|
|
6
|
-
exports.DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
|
|
7
|
-
exports.DEFAULT_TEXT_FONT_SIZE = 14;
|
|
8
|
-
//# sourceMappingURL=constant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAEnC,kJAAkJ,CAAC;AAExI,QAAA,sBAAsB,GAAG,EAAE,CAAC","file":"constant.js","sourcesContent":["export const DEFAULT_TEXT_FONT_FAMILY =\n // eslint-disable-next-line max-len\n 'PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol';\n\nexport const DEFAULT_TEXT_FONT_SIZE = 14;\n"]}
|
package/cjs/util/spec.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IBackgroundSpec, IBackgroundStyleSpec } from './../typings/spec/common';
|
|
2
|
-
import type { Maybe } from '@visactor/vutils';
|
|
3
|
-
import { DataView } from '@visactor/vdataset';
|
|
4
|
-
import type { IThemeColorScheme } from '../theme/color-scheme/interface';
|
|
5
|
-
import type { SeriesTypeEnum } from '../series/interface';
|
|
6
|
-
import type { ITheme } from '../theme';
|
|
7
|
-
export declare function specTransform(spec: unknown, special?: {
|
|
8
|
-
[key: string]: (v: unknown) => unknown;
|
|
9
|
-
}): unknown;
|
|
10
|
-
export declare function cloneDeepSpec(spec: any): any;
|
|
11
|
-
export declare function isDataView(obj: any): obj is DataView;
|
|
12
|
-
export declare function isHTMLElement(obj: any): obj is Element;
|
|
13
|
-
export declare function convertBackgroundSpec(bg: IBackgroundSpec): Omit<IBackgroundStyleSpec, 'image'> & {
|
|
14
|
-
background?: IBackgroundStyleSpec['image'];
|
|
15
|
-
};
|
|
16
|
-
export declare function preprocessSpecOrTheme(obj: any, colorScheme?: IThemeColorScheme, seriesType?: SeriesTypeEnum): any;
|
|
17
|
-
export declare function mergeTheme(target: Maybe<ITheme>, ...sources: Maybe<ITheme>[]): Maybe<ITheme>;
|
package/cjs/util/spec.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __rest = this && this.__rest || function(s, e) {
|
|
4
|
-
var t = {};
|
|
5
|
-
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
6
|
-
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
7
|
-
var i = 0;
|
|
8
|
-
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: !0
|
|
15
|
-
}), exports.mergeTheme = exports.preprocessSpecOrTheme = exports.convertBackgroundSpec = exports.isHTMLElement = exports.isDataView = exports.cloneDeepSpec = exports.specTransform = void 0;
|
|
16
|
-
|
|
17
|
-
const vutils_1 = require("@visactor/vutils"), vdataset_1 = require("@visactor/vdataset"), util_1 = require("../theme/color-scheme/util"), interface_1 = require("../series/interface");
|
|
18
|
-
|
|
19
|
-
function specTransform(spec, special = {
|
|
20
|
-
data: v => v
|
|
21
|
-
}) {
|
|
22
|
-
if (!spec) return spec;
|
|
23
|
-
if (spec.constructor === Object) {
|
|
24
|
-
const result = {};
|
|
25
|
-
for (const key in spec) if (Object.prototype.hasOwnProperty.call(spec, key)) {
|
|
26
|
-
if (special[key]) {
|
|
27
|
-
result[key] = special[key](spec[key]);
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
result[key] = specTransform(spec[key], special);
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
return (0, vutils_1.isArray)(spec) ? spec.map((s => specTransform(s, special))) : spec;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function cloneDeepSpec(spec) {
|
|
38
|
-
const value = spec;
|
|
39
|
-
let result;
|
|
40
|
-
if (!(0, vutils_1.isValid)(value) || "object" != typeof value) return value;
|
|
41
|
-
if (isDataView(value) || isHTMLElement(value)) return value;
|
|
42
|
-
const isArr = (0, vutils_1.isArray)(value), length = value.length;
|
|
43
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : (0, vutils_1.isBoolean)(value) || (0,
|
|
44
|
-
vutils_1.isNumber)(value) || (0, vutils_1.isString)(value) ? value : (0, vutils_1.isDate)(value) ? new Date(+value) : void 0;
|
|
45
|
-
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
46
|
-
let index = -1;
|
|
47
|
-
if (result) for (;++index < (props || value).length; ) {
|
|
48
|
-
const key = props ? props[index] : index, subValue = value[key];
|
|
49
|
-
result[key] = cloneDeepSpec(subValue);
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function isDataView(obj) {
|
|
55
|
-
return obj instanceof vdataset_1.DataView;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function isHTMLElement(obj) {
|
|
59
|
-
try {
|
|
60
|
-
return obj instanceof Element;
|
|
61
|
-
} catch (_a) {
|
|
62
|
-
const htmlElementKeys = [ "children", "innerHTML", "classList", "setAttribute", "tagName", "getBoundingClientRect" ], keys = Object.keys(obj);
|
|
63
|
-
return htmlElementKeys.every((key => keys.includes(key)));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function convertBackgroundSpec(bg) {
|
|
68
|
-
if (!bg) return null;
|
|
69
|
-
if ("string" == typeof bg) return {
|
|
70
|
-
fill: bg,
|
|
71
|
-
fillOpacity: 1
|
|
72
|
-
};
|
|
73
|
-
if ("object" != typeof bg) return null;
|
|
74
|
-
const {x: x, y: y, width: width, height: height, x1: x1, y1: y1, image: image} = bg, rest = __rest(bg, [ "x", "y", "width", "height", "x1", "y1", "image" ]);
|
|
75
|
-
return rest.background = image, rest;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function preprocessSpecOrTheme(obj, colorScheme, seriesType) {
|
|
79
|
-
if ((0, vutils_1.isArray)(obj)) return obj.map((element => (0, vutils_1.isObject)(element) && !(0,
|
|
80
|
-
vutils_1.isFunction)(element) ? preprocessSpecOrTheme(element, colorScheme, seriesType) : element));
|
|
81
|
-
const newObj = Object.assign({}, obj);
|
|
82
|
-
return Object.keys(newObj).forEach((key => {
|
|
83
|
-
if (key.includes("data")) return;
|
|
84
|
-
const value = obj[key];
|
|
85
|
-
(0, vutils_1.isObject)(value) && (isDataView(value) || isHTMLElement(value)) || (0,
|
|
86
|
-
vutils_1.isObject)(value) && !(0, vutils_1.isFunction)(value) && ((0, util_1.isColorKey)(value) ? newObj[key] = (0,
|
|
87
|
-
util_1.getActualColor)(value, colorScheme, seriesType) : newObj[key] = preprocessSpecOrTheme(value, colorScheme, seriesType));
|
|
88
|
-
})), newObj;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function mergeTheme(target, ...sources) {
|
|
92
|
-
return (0, vutils_1.merge)(preprocessThemeToMerge(target), ...sources.map(preprocessThemeToMerge));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function preprocessThemeToMerge(theme) {
|
|
96
|
-
if (!theme) return theme;
|
|
97
|
-
let {colorScheme: colorScheme} = theme;
|
|
98
|
-
colorScheme && (colorScheme = Object.keys(colorScheme).reduce(((scheme, key) => {
|
|
99
|
-
const value = colorScheme[key];
|
|
100
|
-
return scheme[key] = (0, util_1.transformColorSchemeToStandardStruct)(value), scheme;
|
|
101
|
-
}), {}));
|
|
102
|
-
let {series: series} = theme;
|
|
103
|
-
const {mark: markByType, markByName: markByName} = theme;
|
|
104
|
-
return (markByType || markByName) && (series = Object.keys(interface_1.seriesMarkInfoMap).reduce(((newSeriesTheme, key) => {
|
|
105
|
-
var _a;
|
|
106
|
-
const value = null !== (_a = null == series ? void 0 : series[key]) && void 0 !== _a ? _a : {}, newValue = {};
|
|
107
|
-
return Object.values(interface_1.seriesMarkInfoMap[key]).forEach((({type: type, name: name}) => {
|
|
108
|
-
var _a, _b;
|
|
109
|
-
newValue[name] = (0, vutils_1.merge)({}, null !== (_a = null == markByType ? void 0 : markByType[(0,
|
|
110
|
-
vutils_1.array)(type)[0]]) && void 0 !== _a ? _a : {}, null !== (_b = null == markByName ? void 0 : markByName[name]) && void 0 !== _b ? _b : {}, value[name]);
|
|
111
|
-
})), newSeriesTheme[key] = Object.assign(Object.assign({}, value), newValue), newSeriesTheme;
|
|
112
|
-
}), {})), Object.assign(Object.assign({}, theme), {
|
|
113
|
-
colorScheme: colorScheme,
|
|
114
|
-
series: series
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
exports.specTransform = specTransform, exports.cloneDeepSpec = cloneDeepSpec, exports.isDataView = isDataView,
|
|
119
|
-
exports.isHTMLElement = isHTMLElement, exports.convertBackgroundSpec = convertBackgroundSpec,
|
|
120
|
-
exports.preprocessSpecOrTheme = preprocessSpecOrTheme, exports.mergeTheme = mergeTheme;
|
|
121
|
-
//# sourceMappingURL=spec.js.map
|