@visactor/vchart 1.2.3 → 1.3.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +3 -3
- package/build/index.js +23611 -20832
- package/build/index.min.js +15 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/spec.d.ts +1 -1
- package/cjs/animation/spec.js.map +1 -1
- package/cjs/chart/area/area.js +2 -3
- 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 +4 -2
- package/cjs/chart/base-chart.js +33 -34
- 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 +2 -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/interface/chart.d.ts +4 -2
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/line/line.js +2 -3
- 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/progress/circular/circular.js +2 -2
- package/cjs/chart/progress/circular/circular.js.map +1 -1
- package/cjs/chart/progress/linear/linear.js +2 -2
- package/cjs/chart/progress/linear/linear.js.map +1 -1
- package/cjs/chart/radar/radar.js +2 -3
- 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 +2 -2
- 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.d.ts +1 -0
- package/cjs/chart/stack.js +14 -0
- 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.d.ts +8 -0
- package/cjs/chart/util.js +32 -3
- 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 +1 -1
- package/cjs/compile/compiler.js +4 -3
- package/cjs/compile/compiler.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 +2 -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 -12
- package/cjs/component/axis/base-axis.js +7 -17
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +15 -6
- 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 +6 -1
- 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 +15 -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/interface.d.ts +3 -1
- package/cjs/component/axis/interface.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +1 -0
- package/cjs/component/axis/polar/axis.js +5 -2
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/polar/band-axis.d.ts +1 -0
- package/cjs/component/base/base-component.d.ts +3 -2
- package/cjs/component/base/base-component.js +3 -3
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/base/util.js +3 -0
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +11 -1
- package/cjs/component/brush/brush.js +61 -51
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +1 -0
- package/cjs/component/crosshair/cartesian.js +1 -1
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/polar.js +3 -3
- package/cjs/component/crosshair/polar.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +1 -0
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/cjs/component/geo/geo-coordinate.d.ts +7 -2
- package/cjs/component/geo/geo-coordinate.js +54 -14
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/index.d.ts +3 -2
- package/cjs/component/index.js +15 -1
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/interface/theme.d.ts +2 -0
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/interface/type.d.ts +2 -0
- package/cjs/component/interface/type.js +13 -12
- package/cjs/component/interface/type.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +40 -0
- package/cjs/component/label/base-label.js +44 -0
- package/cjs/component/label/base-label.js.map +1 -0
- package/cjs/component/label/interface.d.ts +7 -0
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/label.d.ts +5 -27
- package/cjs/component/label/label.js +31 -38
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/pie.d.ts +5 -0
- package/cjs/component/label/pie.js +21 -0
- package/cjs/component/label/pie.js.map +1 -0
- package/cjs/component/label/totalLabel.d.ts +27 -0
- package/cjs/component/label/totalLabel.js +107 -0
- package/cjs/component/label/totalLabel.js.map +1 -0
- package/cjs/component/label/util.d.ts +3 -1
- package/cjs/component/label/util.js +5 -5
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/legend/base-legend.d.ts +1 -0
- package/cjs/component/marker/base-marker.d.ts +6 -0
- package/cjs/component/marker/base-marker.js +14 -0
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +1 -0
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.js +17 -6
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js +17 -6
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.js +18 -7
- package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
- package/cjs/component/title/title.d.ts +1 -0
- package/cjs/component/title/title.js +2 -1
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/interface.d.ts +9 -12
- package/cjs/component/tooltip/handler/dom/interface.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/content-column-model.d.ts +4 -6
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js +17 -15
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/title-model.js +3 -3
- package/cjs/component/tooltip/handler/dom/model/title-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/util.js +18 -11
- package/cjs/component/tooltip/handler/dom/util.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +25 -24
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/compose.d.ts +2 -2
- package/cjs/component/tooltip/handler/utils/compose.js +13 -10
- package/cjs/component/tooltip/handler/utils/compose.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/get-spec.js +2 -2
- package/cjs/component/tooltip/handler/utils/get-spec.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/style.d.ts +1 -1
- package/cjs/component/tooltip/handler/utils/style.js +15 -10
- package/cjs/component/tooltip/handler/utils/style.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +1 -0
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +1 -1
- package/cjs/component/tooltip/tooltip.js +10 -7
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/index.d.ts +3 -0
- package/cjs/constant/index.js +4 -3
- package/cjs/constant/index.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/interface.d.ts +3 -0
- package/cjs/core/interface.js.map +1 -1
- package/cjs/core/vchart.d.ts +6 -1
- package/cjs/core/vchart.js +51 -11
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +9 -7
- package/cjs/data/initialize.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/invalid-travel.js +1 -2
- package/cjs/data/transforms/invalid-travel.js.map +1 -1
- package/cjs/data/transforms/tick-data/continuous.js +6 -3
- package/cjs/data/transforms/tick-data/continuous.js.map +1 -1
- package/cjs/data/transforms/tick-data/interface.d.ts +3 -0
- package/cjs/data/transforms/tick-data/interface.js.map +1 -1
- package/cjs/event/event-dispatcher.js +4 -2
- package/cjs/event/event-dispatcher.js.map +1 -1
- package/cjs/event/events/dimension/dimension-click.d.ts +1 -3
- package/cjs/event/events/dimension/dimension-click.js +9 -10
- package/cjs/event/events/dimension/dimension-click.js.map +1 -1
- package/cjs/event/events/dimension/dimension-hover.d.ts +2 -3
- package/cjs/event/events/dimension/dimension-hover.js +26 -17
- package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
- package/cjs/event/interface.d.ts +3 -3
- package/cjs/event/interface.js.map +1 -1
- package/cjs/interaction/trigger.js +4 -0
- package/cjs/interaction/trigger.js.map +1 -1
- package/cjs/layout/label/arc-label.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +1 -0
- package/cjs/mark/base/base-mark.js +20 -3
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/symbol.js +1 -1
- package/cjs/mark/symbol.js.map +1 -1
- package/cjs/model/base-model.d.ts +2 -0
- package/cjs/model/base-model.js +2 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +6 -1
- package/cjs/model/interface.js.map +1 -1
- package/cjs/model/layout-item.d.ts +4 -4
- package/cjs/model/layout-item.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/region/region.d.ts +1 -0
- package/cjs/series/area/area.d.ts +6 -3
- package/cjs/series/area/area.js +36 -12
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/area/tooltip-helpter.d.ts +5 -0
- package/cjs/series/area/tooltip-helpter.js +24 -0
- package/cjs/series/area/tooltip-helpter.js.map +1 -0
- package/cjs/series/bar/bar.d.ts +1 -0
- package/cjs/series/bar/bar.js +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +4 -0
- package/cjs/series/base/base-series.js +62 -16
- 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 +7 -3
- package/cjs/series/cartesian/cartesian.js +27 -17
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/dot/dot.d.ts +1 -0
- package/cjs/series/dot/dot.js +3 -0
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/funnel/funnel.d.ts +1 -0
- package/cjs/series/geo/geo.d.ts +2 -0
- package/cjs/series/geo/geo.js +5 -1
- package/cjs/series/geo/geo.js.map +1 -1
- package/cjs/series/heatmap/heatmap.d.ts +1 -0
- package/cjs/series/interface/common.d.ts +1 -0
- package/cjs/series/interface/common.js.map +1 -1
- package/cjs/series/interface/series.d.ts +3 -2
- package/cjs/series/interface/series.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 -2
- 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/interface.d.ts +1 -0
- package/cjs/series/map/interface.js.map +1 -1
- package/cjs/series/map/map.d.ts +1 -2
- package/cjs/series/map/map.js +9 -9
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +4 -1
- package/cjs/series/mixin/line-mixin.js +37 -21
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/interface.d.ts +4 -7
- package/cjs/series/pie/interface.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +2 -0
- package/cjs/series/pie/pie.js +19 -56
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/polar.d.ts +1 -0
- package/cjs/series/polar/polar.js +2 -1
- package/cjs/series/polar/polar.js.map +1 -1
- package/cjs/series/range-area/range-area.d.ts +2 -0
- package/cjs/series/range-area/range-area.js +8 -2
- package/cjs/series/range-area/range-area.js.map +1 -1
- package/cjs/series/range-column/range-column.js +1 -1
- package/cjs/series/range-column/range-column.js.map +1 -1
- package/cjs/series/rose/interface.d.ts +3 -0
- package/cjs/series/rose/interface.js.map +1 -1
- package/cjs/series/rose/rose.d.ts +1 -2
- package/cjs/series/rose/rose.js +17 -36
- 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 +2 -0
- package/cjs/series/sankey/sankey.js +198 -79
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/interface.d.ts +1 -2
- package/cjs/series/scatter/interface.js.map +1 -1
- package/cjs/series/scatter/scatter.d.ts +2 -3
- package/cjs/series/scatter/scatter.js +19 -13
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/word-cloud/base.d.ts +1 -0
- package/cjs/theme/buildin-theme/light/component/axis/symlog-axis.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/axis/symlog-axis.js +22 -0
- package/cjs/theme/buildin-theme/light/component/axis/symlog-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/index.js +3 -2
- package/cjs/theme/buildin-theme/light/component/index.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/total-label.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/total-label.js +24 -0
- package/cjs/theme/buildin-theme/light/component/total-label.js.map +1 -0
- package/cjs/theme/buildin-theme/light/series/rose.js +0 -1
- package/cjs/theme/buildin-theme/light/series/rose.js.map +1 -1
- package/cjs/theme/buildin-theme/light/series/sankey.js +0 -1
- package/cjs/theme/buildin-theme/light/series/sankey.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +10 -4
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/tooltip/label.d.ts +10 -0
- package/cjs/typings/tooltip/label.js +6 -0
- package/cjs/typings/tooltip/label.js.map +1 -0
- package/cjs/typings/tooltip/line.d.ts +3 -2
- package/cjs/typings/tooltip/line.js.map +1 -1
- package/cjs/typings/tooltip/shape.d.ts +2 -0
- package/cjs/typings/tooltip/shape.js.map +1 -1
- package/cjs/typings/visual.d.ts +11 -21
- 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 +0 -2
- package/cjs/util/object.js +2 -13
- 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 -9
- package/cjs/util/space.js +14 -30
- package/cjs/util/space.js.map +1 -1
- package/cjs/util/text.d.ts +1 -2
- package/cjs/util/text.js +1 -11
- 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/spec.d.ts +1 -1
- package/esm/animation/spec.js.map +1 -1
- package/esm/chart/area/area.js +3 -4
- 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 +4 -2
- package/esm/chart/base-chart.js +36 -35
- 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 +2 -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/interface/chart.d.ts +4 -2
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/line/line.js +1 -2
- 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/progress/circular/circular.js +1 -1
- package/esm/chart/progress/circular/circular.js.map +1 -1
- package/esm/chart/progress/linear/linear.js +1 -1
- package/esm/chart/progress/linear/linear.js.map +1 -1
- package/esm/chart/radar/radar.js +2 -3
- 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 +2 -2
- 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.d.ts +1 -0
- package/esm/chart/stack.js +16 -2
- 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.d.ts +8 -0
- package/esm/chart/util.js +33 -1
- 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 +1 -1
- package/esm/compile/compiler.js +5 -4
- package/esm/compile/compiler.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 +2 -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 -12
- package/esm/component/axis/base-axis.js +8 -18
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +15 -6
- 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 +6 -1
- 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 +15 -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/interface.d.ts +3 -1
- package/esm/component/axis/interface.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +1 -0
- package/esm/component/axis/polar/axis.js +5 -2
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/polar/band-axis.d.ts +1 -0
- package/esm/component/base/base-component.d.ts +3 -2
- package/esm/component/base/base-component.js +3 -3
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/base/util.js +3 -0
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/brush/brush.d.ts +11 -1
- package/esm/component/brush/brush.js +60 -51
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +1 -0
- package/esm/component/crosshair/cartesian.js +1 -1
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/polar.js +3 -3
- package/esm/component/crosshair/polar.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +1 -0
- package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/esm/component/geo/geo-coordinate.d.ts +7 -2
- package/esm/component/geo/geo-coordinate.js +56 -14
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/index.d.ts +3 -2
- package/esm/component/index.js +4 -2
- package/esm/component/index.js.map +1 -1
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/interface/theme.d.ts +2 -0
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/interface/type.d.ts +2 -0
- package/esm/component/interface/type.js +13 -12
- package/esm/component/interface/type.js.map +1 -1
- package/esm/component/label/base-label.d.ts +40 -0
- package/esm/component/label/base-label.js +42 -0
- package/esm/component/label/base-label.js.map +1 -0
- package/esm/component/label/interface.d.ts +7 -0
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/label.d.ts +5 -27
- package/esm/component/label/label.js +34 -40
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/pie.d.ts +5 -0
- package/esm/component/label/pie.js +13 -0
- package/esm/component/label/pie.js.map +1 -0
- package/esm/component/label/totalLabel.d.ts +27 -0
- package/esm/component/label/totalLabel.js +110 -0
- package/esm/component/label/totalLabel.js.map +1 -0
- package/esm/component/label/util.d.ts +3 -1
- package/esm/component/label/util.js +6 -4
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/legend/base-legend.d.ts +1 -0
- package/esm/component/marker/base-marker.d.ts +6 -0
- package/esm/component/marker/base-marker.js +14 -0
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/interface.d.ts +1 -0
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.js +17 -6
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js +17 -6
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.js +18 -7
- package/esm/component/marker/mark-point/mark-point.js.map +1 -1
- package/esm/component/title/title.d.ts +1 -0
- package/esm/component/title/title.js +2 -1
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/interface.d.ts +9 -12
- package/esm/component/tooltip/handler/dom/interface.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/content-column-model.d.ts +4 -6
- package/esm/component/tooltip/handler/dom/model/content-column-model.js +16 -14
- package/esm/component/tooltip/handler/dom/model/content-column-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/util.js +18 -11
- package/esm/component/tooltip/handler/dom/util.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +24 -24
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/compose.d.ts +2 -2
- package/esm/component/tooltip/handler/utils/compose.js +11 -10
- package/esm/component/tooltip/handler/utils/compose.js.map +1 -1
- package/esm/component/tooltip/handler/utils/get-spec.js +3 -1
- package/esm/component/tooltip/handler/utils/get-spec.js.map +1 -1
- package/esm/component/tooltip/handler/utils/style.d.ts +1 -1
- package/esm/component/tooltip/handler/utils/style.js +16 -9
- package/esm/component/tooltip/handler/utils/style.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +1 -0
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +1 -1
- package/esm/component/tooltip/tooltip.js +10 -7
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/index.d.ts +3 -0
- package/esm/constant/index.js +6 -0
- package/esm/constant/index.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/interface.d.ts +3 -0
- package/esm/core/interface.js.map +1 -1
- package/esm/core/vchart.d.ts +6 -1
- package/esm/core/vchart.js +54 -11
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +10 -7
- package/esm/data/initialize.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/invalid-travel.js +1 -2
- package/esm/data/transforms/invalid-travel.js.map +1 -1
- package/esm/data/transforms/tick-data/continuous.js +6 -3
- package/esm/data/transforms/tick-data/continuous.js.map +1 -1
- package/esm/data/transforms/tick-data/interface.d.ts +3 -0
- package/esm/data/transforms/tick-data/interface.js.map +1 -1
- package/esm/event/event-dispatcher.js +3 -2
- package/esm/event/event-dispatcher.js.map +1 -1
- package/esm/event/events/dimension/dimension-click.d.ts +1 -3
- package/esm/event/events/dimension/dimension-click.js +9 -10
- package/esm/event/events/dimension/dimension-click.js.map +1 -1
- package/esm/event/events/dimension/dimension-hover.d.ts +2 -3
- package/esm/event/events/dimension/dimension-hover.js +25 -16
- package/esm/event/events/dimension/dimension-hover.js.map +1 -1
- package/esm/event/interface.d.ts +3 -3
- package/esm/event/interface.js.map +1 -1
- package/esm/interaction/trigger.js +4 -0
- package/esm/interaction/trigger.js.map +1 -1
- package/esm/layout/label/arc-label.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +1 -0
- package/esm/mark/base/base-mark.js +20 -3
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/symbol.js +1 -1
- package/esm/mark/symbol.js.map +1 -1
- package/esm/model/base-model.d.ts +2 -0
- package/esm/model/base-model.js +2 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +6 -1
- package/esm/model/interface.js.map +1 -1
- package/esm/model/layout-item.d.ts +4 -4
- package/esm/model/layout-item.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/region/region.d.ts +1 -0
- package/esm/series/area/area.d.ts +6 -3
- package/esm/series/area/area.js +39 -10
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/area/tooltip-helpter.d.ts +5 -0
- package/esm/series/area/tooltip-helpter.js +18 -0
- package/esm/series/area/tooltip-helpter.js.map +1 -0
- package/esm/series/bar/bar.d.ts +1 -0
- package/esm/series/bar/bar.js +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.d.ts +4 -0
- package/esm/series/base/base-series.js +62 -17
- 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 +7 -3
- package/esm/series/cartesian/cartesian.js +26 -17
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/dot/dot.d.ts +1 -0
- package/esm/series/dot/dot.js +3 -0
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/funnel/funnel.d.ts +1 -0
- package/esm/series/geo/geo.d.ts +2 -0
- package/esm/series/geo/geo.js +4 -1
- package/esm/series/geo/geo.js.map +1 -1
- package/esm/series/heatmap/heatmap.d.ts +1 -0
- package/esm/series/interface/common.d.ts +1 -0
- package/esm/series/interface/common.js.map +1 -1
- package/esm/series/interface/series.d.ts +3 -2
- package/esm/series/interface/series.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 -2
- 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/interface.d.ts +1 -0
- package/esm/series/map/interface.js.map +1 -1
- package/esm/series/map/map.d.ts +1 -2
- package/esm/series/map/map.js +10 -8
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +4 -1
- package/esm/series/mixin/line-mixin.js +39 -19
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/interface.d.ts +4 -7
- package/esm/series/pie/interface.js.map +1 -1
- package/esm/series/pie/pie.d.ts +2 -0
- package/esm/series/pie/pie.js +22 -54
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/polar.d.ts +1 -0
- package/esm/series/polar/polar.js +2 -1
- package/esm/series/polar/polar.js.map +1 -1
- package/esm/series/range-area/range-area.d.ts +2 -0
- package/esm/series/range-area/range-area.js +7 -3
- package/esm/series/range-area/range-area.js.map +1 -1
- package/esm/series/range-column/range-column.js +1 -1
- package/esm/series/range-column/range-column.js.map +1 -1
- package/esm/series/rose/interface.d.ts +3 -0
- package/esm/series/rose/interface.js.map +1 -1
- package/esm/series/rose/rose.d.ts +1 -2
- package/esm/series/rose/rose.js +17 -37
- 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 +2 -0
- package/esm/series/sankey/sankey.js +198 -80
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/interface.d.ts +1 -2
- package/esm/series/scatter/interface.js.map +1 -1
- package/esm/series/scatter/scatter.d.ts +2 -3
- package/esm/series/scatter/scatter.js +20 -14
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/word-cloud/base.d.ts +1 -0
- package/esm/theme/buildin-theme/light/component/axis/symlog-axis.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/axis/symlog-axis.js +18 -0
- package/esm/theme/buildin-theme/light/component/axis/symlog-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/index.js +4 -1
- package/esm/theme/buildin-theme/light/component/index.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/total-label.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/total-label.js +20 -0
- package/esm/theme/buildin-theme/light/component/total-label.js.map +1 -0
- package/esm/theme/buildin-theme/light/series/rose.js +0 -1
- package/esm/theme/buildin-theme/light/series/rose.js.map +1 -1
- package/esm/theme/buildin-theme/light/series/sankey.js +0 -1
- package/esm/theme/buildin-theme/light/series/sankey.js.map +1 -1
- package/esm/typings/spec/common.d.ts +10 -4
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/tooltip/label.d.ts +10 -0
- package/esm/typings/tooltip/label.js +2 -0
- package/esm/typings/tooltip/label.js.map +1 -0
- package/esm/typings/tooltip/line.d.ts +3 -2
- package/esm/typings/tooltip/line.js.map +1 -1
- package/esm/typings/tooltip/shape.d.ts +2 -0
- package/esm/typings/tooltip/shape.js.map +1 -1
- package/esm/typings/visual.d.ts +11 -21
- 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 +0 -2
- package/esm/util/object.js +0 -11
- 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 -9
- package/esm/util/space.js +8 -26
- package/esm/util/space.js.map +1 -1
- package/esm/util/text.d.ts +1 -2
- package/esm/util/text.js +1 -9
- 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 +21 -14
- 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/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/cjs/util/scale.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.isSpecValueWithScale = exports.valueInScaleRange = exports.
|
|
5
|
+
}), exports.isSpecValueWithScale = exports.valueInScaleRange = exports.createScaleWithSpec = exports.createScale = void 0;
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), vscale_1 = require("@visactor/vscale"), color_ordinal_scale_1 = require("../scale/color-ordinal-scale"), defaultScaleMap = {
|
|
8
8
|
linear: vscale_1.LinearScale,
|
|
@@ -29,10 +29,6 @@ function initScaleWithSpec(scale, spec) {
|
|
|
29
29
|
spec.specified && scale.specified && scale.specified(spec.specified));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function isValidScaleType(type) {
|
|
33
|
-
return Object.keys(defaultScaleMap).includes(type);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
32
|
function valueInScaleRange(v, s) {
|
|
37
33
|
if (!s) return v;
|
|
38
34
|
const range = s.range(), min = Math.min(range[0], range[range.length - 1]), max = Math.max(range[0], range[range.length - 1]);
|
|
@@ -45,6 +41,5 @@ function isSpecValueWithScale(specValue) {
|
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
exports.createScale = createScale, exports.createScaleWithSpec = createScaleWithSpec,
|
|
48
|
-
exports.initScaleWithSpec = initScaleWithSpec, exports.isValidScaleType = isValidScaleType,
|
|
49
44
|
exports.valueInScaleRange = valueInScaleRange, exports.isSpecValueWithScale = isSpecValueWithScale;
|
|
50
45
|
//# sourceMappingURL=scale.js.map
|
package/cjs/util/scale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/scale.ts"],"names":[],"mappings":";;;AAGA,6CAAqD;AAGrD,
|
|
1
|
+
{"version":3,"sources":["../src/util/scale.ts"],"names":[],"mappings":";;;AAGA,6CAAqD;AAGrD,6CAAqH;AAErH,sEAAiE;AAEjE,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,oBAAW;IACnB,IAAI,EAAE,kBAAS;IACf,KAAK,EAAE,mBAAU;IACjB,OAAO,EAAE,qBAAY;IACrB,SAAS,EAAE,uBAAc;IACzB,YAAY,EAAE,uCAAiB;CAChC,CAAC;AAEF,SAAgB,WAAW,CAAC,IAAkC;IAC5D,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,gBAAgB,EAAE;QACpB,OAAO,IAAI,gBAAgB,EAAE,CAAC;KAC/B;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAPD,kCAOC;AAED,SAAgB,mBAAmB,CACjC,IAAkB,EAClB,OAGC;IAED,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;QACjC,IAAI,IAAA,iBAAQ,EAAC,IAAI,CAAC,KAAK,CAAC,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAA,EAAE;YAChD,OAAO,OAAO,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;SACrF;QACD,OAAO,IAAI,CAAC,KAA8B,CAAC;KAC5C;IACD,MAAM,KAAK,GAAG,WAAW,CAAE,IAAkC,CAAC,IAAI,CAAC,CAAC;IACpE,IAAI,KAAK,EAAE;QACT,iBAAiB,CAAC,KAAK,EAAE,IAAiC,CAAC,CAAC;KAC7D;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAlBD,kDAkBC;AAGD,SAAS,iBAAiB,CAAC,KAAiB,EAAE,IAA+B;IAC3E,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE;QACnB,OAAO;KACR;IAED,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3B;IAED,IAAI,IAAI,CAAC,KAAK,EAAE;QACd,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACzB;IAED,IAAI,IAAI,CAAC,SAAS,IAAmB,KAAM,CAAC,SAAS,EAAE;QACtC,KAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACjD;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,CAAS,EAAE,CAAc;IACzD,IAAI,CAAC,CAAC,EAAE;QACN,OAAO,CAAC,CAAC;KACV;IACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACxB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AARD,8CAQC;AAED,SAAgB,oBAAoB,CAAC,SAAc;IACjD,OAAO,IAAA,gBAAO,EAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC,CAAC;AAChE,CAAC;AAFD,oDAEC","file":"scale.js","sourcesContent":["/**\n * @description Scale 相关的工具函数\n */\nimport { isString, isValid } from '@visactor/vutils';\nimport type { DataView } from '@visactor/vdataset';\nimport type { IGlobalScale } from '../scale/interface';\nimport { type IBaseScale, BandScale, LinearScale, OrdinalScale, PointScale, ThresholdScale } from '@visactor/vscale';\nimport type { IVisual, IVisualSpecBase } from '../typings/visual';\nimport { ColorOrdinalScale } from '../scale/color-ordinal-scale';\n\nconst defaultScaleMap = {\n linear: LinearScale,\n band: BandScale,\n point: PointScale,\n ordinal: OrdinalScale,\n threshold: ThresholdScale,\n colorOrdinal: ColorOrdinalScale\n};\n\nexport function createScale(type: keyof typeof defaultScaleMap): IBaseScale | null {\n const scaleConstructor = defaultScaleMap[type];\n if (scaleConstructor) {\n return new scaleConstructor();\n }\n\n return null;\n}\n\nexport function createScaleWithSpec(\n spec: IVisual<any>,\n context: {\n globalScale: IGlobalScale;\n dataStatistics: DataView;\n }\n): IBaseScale | null {\n if ('scale' in spec && spec.scale) {\n if (isString(spec.scale) && context?.globalScale) {\n return context.globalScale.registerMarkAttributeScale(spec, context.dataStatistics);\n }\n return spec.scale as unknown as IBaseScale;\n }\n const scale = createScale((spec as IVisualSpecBase<any, any>).type);\n if (scale) {\n initScaleWithSpec(scale, spec as IVisualSpecBase<any, any>);\n }\n return scale;\n}\n\n// 需要一个通用的从spec初始化scale的方法,避免在scale属性更新后需要维护多组逻辑\nfunction initScaleWithSpec(scale: IBaseScale, spec: IVisualSpecBase<any, any>) {\n if (!scale || !spec) {\n return;\n }\n\n if (spec.domain) {\n scale.domain(spec.domain);\n }\n\n if (spec.range) {\n scale.range(spec.range);\n }\n\n if (spec.specified && (<OrdinalScale>scale).specified) {\n (<OrdinalScale>scale).specified(spec.specified);\n }\n}\n\nexport function valueInScaleRange(v: number, s?: IBaseScale) {\n if (!s) {\n return v;\n }\n const range = s.range();\n const min = Math.min(range[0], range[range.length - 1]);\n const max = Math.max(range[0], range[range.length - 1]);\n return Math.min(Math.max(min, v), max);\n}\n\nexport function isSpecValueWithScale(specValue: any) {\n return isValid(specValue?.field) && isValid(specValue?.scale);\n}\n"]}
|
package/cjs/util/space.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
import type { ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';
|
|
1
|
+
import { type IBoundsLike } from '@visactor/vutils';
|
|
2
|
+
import type { ILayoutPaddingSpec, IPercentOffset, ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';
|
|
4
3
|
import type { IPadding, IRect } from '../typings/space';
|
|
5
|
-
import { Direction } from '../typings/space';
|
|
6
4
|
import type { IPoint } from '../typings/coordinate';
|
|
7
5
|
export declare function isValidOrient(orient: string): boolean;
|
|
8
|
-
export declare function getSpecPadding(padding: IPadding | number | undefined | null, defaultPadding: IPadding): IPadding;
|
|
9
6
|
export declare function isPointInRect(point: IPoint, rect: IRect): boolean;
|
|
10
7
|
export declare function isPercent(v: any): v is IPercent;
|
|
8
|
+
export declare function isPercentOffset(v: any): v is IPercentOffset;
|
|
11
9
|
export declare function calcLayoutNumber(v: ILayoutNumber | undefined, size: number, callOp?: ILayoutRect): number;
|
|
12
10
|
export declare function calcPadding(paddingSpec: ILayoutOrientPadding, rect: ILayoutRect, callOp: ILayoutRect): IPadding;
|
|
13
11
|
export declare function boundsInRect(bounds: IBoundsLike, rect: ILayoutRect): ILayoutRect;
|
|
14
|
-
export declare function boundsOutViewBox(bounds: IBoundsLike, box: IBoundsLike, direction: Direction): {
|
|
15
|
-
start: number;
|
|
16
|
-
end: number;
|
|
17
|
-
};
|
|
18
12
|
export declare function normalizeLayoutPaddingSpec(spec: ILayoutPaddingSpec): ILayoutOrientPadding;
|
|
19
13
|
export declare function convertPoint(point: IPoint, relativePoint: IPoint, convert: boolean): IPoint;
|
package/cjs/util/space.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.convertPoint = exports.normalizeLayoutPaddingSpec = exports.
|
|
5
|
+
}), exports.convertPoint = exports.normalizeLayoutPaddingSpec = exports.boundsInRect = exports.calcPadding = exports.calcLayoutNumber = exports.isPercentOffset = exports.isPercent = exports.isPointInRect = exports.isValidOrient = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), type_1 = require("./type")
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), type_1 = require("./type");
|
|
8
8
|
|
|
9
9
|
function isValidOrient(orient) {
|
|
10
10
|
switch (orient) {
|
|
@@ -19,15 +19,6 @@ function isValidOrient(orient) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function getSpecPadding(padding, defaultPadding) {
|
|
23
|
-
return (0, type_1.isNil)(padding) ? Object.assign({}, defaultPadding) : "number" == typeof padding ? {
|
|
24
|
-
top: padding,
|
|
25
|
-
bottom: padding,
|
|
26
|
-
left: padding,
|
|
27
|
-
right: padding
|
|
28
|
-
} : Object.assign(Object.assign({}, defaultPadding), padding);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
22
|
function isPointInRect(point, rect) {
|
|
32
23
|
const {x: x, y: y, width: width, height: height} = rect, {x: x0, y: y0} = point;
|
|
33
24
|
return x0 < x + width && y0 < y + height && y0 > y && x0 > x;
|
|
@@ -37,9 +28,14 @@ function isPercent(v) {
|
|
|
37
28
|
return !!(0, type_1.isString)(v) && (!!v.endsWith("%") && (0, type_1.couldBeValidNumber)(v.substring(0, v.length - 1)));
|
|
38
29
|
}
|
|
39
30
|
|
|
31
|
+
function isPercentOffset(v) {
|
|
32
|
+
return !!(0, type_1.isObject)(v) && ("percent" in v || "offset" in v);
|
|
33
|
+
}
|
|
34
|
+
|
|
40
35
|
function calcLayoutNumber(v, size, callOp) {
|
|
36
|
+
var _a, _b;
|
|
41
37
|
return (0, type_1.isNumber)(v) ? v : isPercent(v) ? Number(v.substring(0, v.length - 1)) * size / 100 : (0,
|
|
42
|
-
type_1.isFunction)(v) ? v(callOp) : 0;
|
|
38
|
+
type_1.isFunction)(v) ? v(callOp) : (0, type_1.isObject)(v) ? size * (null !== (_a = v.percent) && void 0 !== _a ? _a : 0) + (null !== (_b = v.offset) && void 0 !== _b ? _b : 0) : 0;
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
function calcPadding(paddingSpec, rect, callOp) {
|
|
@@ -76,25 +72,13 @@ function boundsInRect(bounds, rect) {
|
|
|
76
72
|
};
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
function boundsOutViewBox(bounds, box, direction) {
|
|
80
|
-
if (!bounds || !box) return {
|
|
81
|
-
start: 0,
|
|
82
|
-
end: 0
|
|
83
|
-
};
|
|
84
|
-
const start = -(direction === space_1.Direction.horizontal ? bounds.x1 : bounds.y1), end = direction === space_1.Direction.horizontal ? bounds.x2 - (box.x2 - box.x1) : bounds.y2 - (box.y2 - box.y1);
|
|
85
|
-
return {
|
|
86
|
-
start: start > 0 ? start : 0,
|
|
87
|
-
end: end > 0 ? end : 0
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
75
|
function normalizeLayoutPaddingSpec(spec) {
|
|
92
76
|
let result = {};
|
|
93
77
|
return (0, vutils_1.isArray)(spec) ? ((0, type_1.isNil)(spec[0]) || (result.top = result.left = result.bottom = result.right = spec[0]),
|
|
94
78
|
(0, type_1.isNil)(spec[1]) || (result.left = result.right = spec[1]), (0, type_1.isNil)(spec[2]) || (result.bottom = spec[2]),
|
|
95
79
|
(0, type_1.isNil)(spec[3]) || (result.left = spec[3]), result) : (0, type_1.isNumber)(spec) || isPercent(spec) || (0,
|
|
96
|
-
type_1.isFunction)(spec) ? (result.top = result.left = result.bottom = result.right = spec,
|
|
97
|
-
result) : (
|
|
80
|
+
type_1.isFunction)(spec) || isPercentOffset(spec) ? (result.top = result.left = result.bottom = result.right = spec,
|
|
81
|
+
result) : (0, type_1.isObject)(spec) ? (result = Object.assign({}, spec), result) : result;
|
|
98
82
|
}
|
|
99
83
|
|
|
100
84
|
function convertPoint(point, relativePoint, convert) {
|
|
@@ -104,8 +88,8 @@ function convertPoint(point, relativePoint, convert) {
|
|
|
104
88
|
} : point;
|
|
105
89
|
}
|
|
106
90
|
|
|
107
|
-
exports.isValidOrient = isValidOrient, exports.
|
|
108
|
-
exports.
|
|
109
|
-
exports.calcPadding = calcPadding, exports.boundsInRect = boundsInRect, exports.
|
|
110
|
-
exports.
|
|
91
|
+
exports.isValidOrient = isValidOrient, exports.isPointInRect = isPointInRect, exports.isPercent = isPercent,
|
|
92
|
+
exports.isPercentOffset = isPercentOffset, exports.calcLayoutNumber = calcLayoutNumber,
|
|
93
|
+
exports.calcPadding = calcPadding, exports.boundsInRect = boundsInRect, exports.normalizeLayoutPaddingSpec = normalizeLayoutPaddingSpec,
|
|
94
|
+
exports.convertPoint = convertPoint;
|
|
111
95
|
//# sourceMappingURL=space.js.map
|
package/cjs/util/space.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/space.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/util/space.ts"],"names":[],"mappings":"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","file":"space.js","sourcesContent":["import { isArray, type IBoundsLike } from '@visactor/vutils';\nimport { isNumber, isNil, isString, isFunction, couldBeValidNumber, isObject } from './type';\nimport type {\n ILayoutPaddingSpec,\n IPercentOffset,\n ILayoutNumber,\n IPercent,\n ILayoutOrientPadding,\n ILayoutRect\n} from '../model/interface';\nimport type { IPadding, IRect } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\n\nexport function isValidOrient(orient: string): boolean {\n switch (orient) {\n case 'left':\n case 'right':\n case 'top':\n case 'bottom':\n return true;\n default:\n return false;\n }\n}\n\nexport function isPointInRect(point: IPoint, rect: IRect) {\n const { x, y, width, height } = rect;\n const { x: x0, y: y0 } = point;\n return x0 < x + width && y0 < y + height && y0 > y && x0 > x;\n}\n\nexport function isPercent(v: any): v is IPercent {\n if (!isString(v)) {\n return false;\n }\n if (!v.endsWith('%')) {\n return false;\n }\n return couldBeValidNumber(v.substring(0, v.length - 1));\n}\n\nexport function isPercentOffset(v: any): v is IPercentOffset {\n if (!isObject(v)) {\n return false;\n }\n if ('percent' in v || 'offset' in v) {\n return true;\n }\n return false;\n}\n\nexport function calcLayoutNumber(\n v: ILayoutNumber | undefined,\n size: number,\n callOp?: ILayoutRect //如果是函数类型的话,函数的参数\n) {\n if (isNumber(v)) {\n return v;\n }\n if (isPercent(v)) {\n return (Number(v.substring(0, v.length - 1)) * size) / 100;\n }\n if (isFunction(v)) {\n return v(callOp);\n }\n if (isObject(v)) {\n return size * (v.percent ?? 0) + (v.offset ?? 0);\n }\n return 0;\n}\n\nexport function calcPadding(\n paddingSpec: ILayoutOrientPadding,\n rect: ILayoutRect,\n callOp: ILayoutRect //如果是函数类型的话,函数的参数\n): IPadding {\n const result: IPadding = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n if (Object.values(paddingSpec).every(value => isNumber(value))) {\n result.top = (<IPadding>paddingSpec).top ?? 0;\n result.right = (<IPadding>paddingSpec).right ?? 0;\n result.bottom = (<IPadding>paddingSpec).bottom ?? 0;\n result.left = (<IPadding>paddingSpec).left ?? 0;\n return result;\n }\n const paddings = [\n {\n orients: ['left', 'right'],\n size: rect.width\n },\n {\n orients: ['top', 'bottom'],\n size: rect.height\n }\n ];\n paddings.forEach(p => {\n p.orients.forEach(o => {\n result[o] = calcLayoutNumber(paddingSpec[o], p.size, callOp);\n });\n });\n return result;\n}\n\nexport function boundsInRect(bounds: IBoundsLike, rect: ILayoutRect): ILayoutRect {\n if (!bounds) {\n return { width: 0, height: 0 };\n }\n return {\n width: Math.ceil(Math.min(bounds.x2 - bounds.x1, rect.width)),\n height: Math.ceil(Math.min(bounds.y2 - bounds.y1, rect.height))\n };\n}\n\nexport function normalizeLayoutPaddingSpec(spec: ILayoutPaddingSpec): ILayoutOrientPadding {\n let result: ILayoutOrientPadding = {};\n if (isArray(spec)) {\n if (!isNil(spec[0])) {\n result.top = result.left = result.bottom = result.right = spec[0];\n }\n if (!isNil(spec[1])) {\n result.left = result.right = spec[1];\n }\n if (!isNil(spec[2])) {\n result.bottom = spec[2];\n }\n if (!isNil(spec[3])) {\n result.left = spec[3];\n }\n return result;\n }\n if (isNumber(spec) || isPercent(spec) || isFunction(spec) || isPercentOffset(spec)) {\n result.top = result.left = result.bottom = result.right = spec;\n return result;\n }\n if (isObject(spec)) {\n result = { ...spec };\n return result;\n }\n return result;\n}\n\nexport function convertPoint(point: IPoint, relativePoint: IPoint, convert: boolean) {\n if (convert) {\n return {\n x: point.x + relativePoint.x,\n y: point.y + relativePoint.y\n };\n }\n return point;\n}\n"]}
|
package/cjs/util/text.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ITextMeasureOption } from '@visactor/vutils';
|
|
2
|
-
import { TextMeasure
|
|
2
|
+
import { TextMeasure } from '@visactor/vutils';
|
|
3
3
|
import type { IRichTextAttribute } from '@visactor/vrender';
|
|
4
4
|
import type { ITextMarkSpec } from '../typings';
|
|
5
5
|
export declare const initTextMeasure: (textSpec?: Partial<ITextMarkSpec>, option?: Partial<ITextMeasureOption>, useNaiveCanvas?: boolean) => TextMeasure<ITextMarkSpec>;
|
|
6
|
-
export declare const testTextMeasure: (textSpec?: Partial<ITextMarkSpec>, useVRender?: boolean) => TestTextMeasure<any>;
|
|
7
6
|
type IRichTextBoundsParams = Partial<IRichTextAttribute>;
|
|
8
7
|
export declare function getRichTextBounds(params: IRichTextBoundsParams): import("@visactor/vutils").IBounds;
|
|
9
8
|
export {};
|
package/cjs/util/text.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.getRichTextBounds = exports.
|
|
5
|
+
}), exports.getRichTextBounds = exports.initTextMeasure = void 0;
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), vrender_1 = require("@visactor/vrender"), theme_1 = require("../theme"), initTextMeasure = (textSpec, option, useNaiveCanvas) => new vutils_1.TextMeasure(Object.assign({
|
|
8
8
|
defaultFontParams: {
|
|
@@ -15,16 +15,6 @@ const vutils_1 = require("@visactor/vutils"), vrender_1 = require("@visactor/vre
|
|
|
15
15
|
|
|
16
16
|
exports.initTextMeasure = initTextMeasure;
|
|
17
17
|
|
|
18
|
-
const testTextMeasure = (textSpec, useVRender) => new vutils_1.TestTextMeasure({
|
|
19
|
-
defaultFontParams: {
|
|
20
|
-
fontFamily: theme_1.DEFAULT_TEXT_FONT_FAMILY,
|
|
21
|
-
fontSize: theme_1.DEFAULT_TEXT_FONT_SIZE
|
|
22
|
-
},
|
|
23
|
-
getTextBounds: useVRender ? vrender_1.getTextBounds : void 0
|
|
24
|
-
}, textSpec);
|
|
25
|
-
|
|
26
|
-
exports.testTextMeasure = testTextMeasure;
|
|
27
|
-
|
|
28
18
|
const richText = (0, vrender_1.createRichText)({});
|
|
29
19
|
|
|
30
20
|
function getRichTextBounds(params) {
|
package/cjs/util/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":";;;AAEA,6CAAgE;AAGhE,+CAAkE;AAElE,oCAA4E;AAErE,MAAM,eAAe,GAAG,CAC7B,QAAiC,EACjC,MAAoC,EACpC,cAAwB,EACI,EAAE;IAC9B,OAAO,IAAI,oBAAW,iBAElB,iBAAiB,EAAE;YACjB,UAAU,EAAE,gCAAwB;YACpC,QAAQ,EAAE,8BAAsB;SACjC,EACD,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAa,EACzD,cAAc,EAAE,cAAc,GAAG,oBAAW,CAAC,iBAAiB,GAAG,oBAAW,CAAC,iBAAiB,CAAC,WAAW,EAAE,IACzG,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,GAEnB,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B;
|
|
1
|
+
{"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":";;;AAEA,6CAAgE;AAGhE,+CAAkE;AAElE,oCAA4E;AAErE,MAAM,eAAe,GAAG,CAC7B,QAAiC,EACjC,MAAoC,EACpC,cAAwB,EACI,EAAE;IAC9B,OAAO,IAAI,oBAAW,iBAElB,iBAAiB,EAAE;YACjB,UAAU,EAAE,gCAAwB;YACpC,QAAQ,EAAE,8BAAsB;SACjC,EACD,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAa,EACzD,cAAc,EAAE,cAAc,GAAG,oBAAW,CAAC,iBAAiB,GAAG,oBAAW,CAAC,iBAAiB,CAAC,WAAW,EAAE,IACzG,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,GAEnB,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B;AAKF,MAAM,QAAQ,GAAG,IAAA,wBAAc,EAAC,EAAE,CAAC,CAAC;AACpC,SAAgB,iBAAiB,CAAC,MAA6B;IAC7D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC,UAAU,CAAC;AAC7B,CAAC;AAHD,8CAGC","file":"text.js","sourcesContent":["import type { ITextMeasureOption } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { TextMeasure, TestTextMeasure } from '@visactor/vutils';\nimport type { IRichTextAttribute } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport { createRichText, getTextBounds } from '@visactor/vrender';\nimport type { ITextMarkSpec } from '../typings';\nimport { DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TEXT_FONT_SIZE } from '../theme';\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: DEFAULT_TEXT_FONT_FAMILY,\n fontSize: DEFAULT_TEXT_FONT_SIZE\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\n/** 测量富文本 */\n// FIXME: 等 vrender 支持后删掉\ntype IRichTextBoundsParams = Partial<IRichTextAttribute>;\nconst richText = createRichText({});\nexport function getRichTextBounds(params: IRichTextBoundsParams) {\n richText.setAttributes(params);\n return richText.AABBBounds;\n}\n"]}
|
package/cjs/vchart-all.js
CHANGED
|
@@ -16,6 +16,6 @@ Object.defineProperty(exports, "VChart", {
|
|
|
16
16
|
const chart_1 = require("./chart"), component_1 = require("./component"), layout_1 = require("./layout"), vrender_components_1 = require("@visactor/vrender-components");
|
|
17
17
|
|
|
18
18
|
(0, vrender_components_1.loadPoptip)({}), core_1.VChart.useChart([ chart_1.AreaChart, chart_1.LineChart, chart_1.BarChart, chart_1.Bar3dChart, chart_1.ScatterChart, chart_1.MapChart, chart_1.PieChart, chart_1.Pie3dChart, chart_1.RoseChart, chart_1.RadarChart, chart_1.CommonChart, chart_1.SequenceChart, chart_1.HistogramChart, chart_1.Histogram3dChart, chart_1.CircularProgressChart, chart_1.WordCloudChart, chart_1.WordCloud3dChart, chart_1.FunnelChart, chart_1.Funnel3dChart, chart_1.LinearProgressChart, chart_1.RangeColumnChart, chart_1.RangeColumn3dChart, chart_1.SunburstChart, chart_1.CirclePackingChart, chart_1.TreeMapChart, chart_1.WaterfallChart, chart_1.BoxPlotChart, chart_1.SankeyChart, chart_1.GaugeChart, chart_1.RangeAreaChart, chart_1.HeatmapChart ]),
|
|
19
|
-
core_1.VChart.useComponent([ component_1.CartesianLinearAxis, component_1.CartesianBandAxis, component_1.CartesianTimeAxis, component_1.CartesianLogAxis, component_1.PolarBandAxis, component_1.PolarLinearAxis, component_1.DiscreteLegend, component_1.ContinuousLegend, component_1.Tooltip, component_1.CartesianCrossHair, component_1.PolarCrossHair, component_1.DataZoom, component_1.ScrollBar, component_1.Indicator, component_1.GeoCoordinate, component_1.MarkLine, component_1.Title, component_1.MarkArea, component_1.Player, component_1.Label, component_1.MarkPoint, component_1.Brush, component_1.CustomMark, component_1.MapLabelComponent ]),
|
|
19
|
+
core_1.VChart.useComponent([ component_1.CartesianLinearAxis, component_1.CartesianBandAxis, component_1.CartesianTimeAxis, component_1.CartesianLogAxis, component_1.CartesianSymlogAxis, component_1.PolarBandAxis, component_1.PolarLinearAxis, component_1.DiscreteLegend, component_1.ContinuousLegend, component_1.Tooltip, component_1.CartesianCrossHair, component_1.PolarCrossHair, component_1.DataZoom, component_1.ScrollBar, component_1.Indicator, component_1.GeoCoordinate, component_1.MarkLine, component_1.Title, component_1.MarkArea, component_1.Player, component_1.TotalLabel, component_1.Label, component_1.MarkPoint, component_1.Brush, component_1.CustomMark, component_1.MapLabelComponent ]),
|
|
20
20
|
core_1.Factory.registerLayout("grid", layout_1.GridLayout), core_1.Factory.registerLayout("layout3d", layout_1.Layout3d);
|
|
21
21
|
//# sourceMappingURL=vchart-all.js.map
|
package/cjs/vchart-all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;
|
|
1
|
+
{"version":3,"sources":["../src/vchart-all.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AA0IhC,uFA1IA,aAAM,OA0IA;AAzIf,mCAgCiB;AAEjB,2CA2BqB;AACrB,qCAAgD;AAChD,qEAA0D;AAG1D,IAAA,+BAAU,EAAC,EAAE,CAAC,CAAC;AAGf,aAAM,CAAC,QAAQ,CAAC;IACd,iBAAS;IACT,iBAAS;IACT,gBAAQ;IACR,kBAAU;IACV,oBAAY;IACZ,gBAAQ;IACR,gBAAQ;IACR,kBAAU;IACV,iBAAS;IACT,kBAAU;IACV,mBAAW;IACX,qBAAa;IACb,sBAAc;IACd,wBAAgB;IAChB,6BAAqB;IACrB,sBAAc;IACd,wBAAgB;IAChB,mBAAW;IACX,qBAAa;IACb,2BAAmB;IACnB,wBAAgB;IAChB,0BAAkB;IAClB,qBAAa;IACb,0BAAkB;IAClB,oBAAY;IACZ,sBAAc;IACd,oBAAY;IACZ,mBAAW;IACX,kBAAU;IACV,sBAAc;IACd,oBAAY;CACb,CAAC,CAAC;AAGH,aAAM,CAAC,YAAY,CAAC;IAClB,+BAAmB;IACnB,6BAAiB;IACjB,6BAAiB;IACjB,4BAAgB;IAChB,+BAAmB;IACnB,yBAAa;IACb,2BAAe;IACf,0BAAc;IACd,4BAAgB;IAChB,mBAAO;IACP,8BAAkB;IAClB,0BAAc;IACd,oBAAQ;IACR,qBAAS;IACT,qBAAS;IACT,yBAAa;IACb,oBAAQ;IACR,iBAAK;IACL,oBAAQ;IACR,kBAAM;IACN,sBAAU;IACV,iBAAK;IACL,qBAAS;IACT,iBAAK;IACL,sBAAU;IACV,6BAAiB;CAClB,CAAC,CAAC;AAGH,cAAO,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAiB,CAAC,CAAC;AAClD,cAAO,CAAC,cAAc,CAAC,UAAU,EAAE,iBAAe,CAAC,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/cjs/vchart-simple.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.VChart = void 0;
|
|
6
6
|
|
|
7
|
-
const core_1 = require("./core");
|
|
7
|
+
const label_1 = require("./component/label/label"), cartesian_1 = require("./component/crosshair/cartesian"), tooltip_1 = require("./component/tooltip/tooltip"), legend_1 = require("./component/legend/discrete/legend"), time_axis_1 = require("./component/axis/cartesian/time-axis"), band_axis_1 = require("./component/axis/cartesian/band-axis"), linear_axis_1 = require("./component/axis/cartesian/linear-axis"), core_1 = require("./core");
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "VChart", {
|
|
10
10
|
enumerable: !0,
|
|
@@ -13,8 +13,7 @@ Object.defineProperty(exports, "VChart", {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const line_1 = require("./chart/line"), pie_1 = require("./chart/pie"), bar_1 = require("./chart/bar");
|
|
17
17
|
|
|
18
|
-
core_1.VChart.useChart([
|
|
19
|
-
core_1.VChart.useComponent([ component_1.CartesianLinearAxis, component_1.CartesianBandAxis, component_1.CartesianTimeAxis, component_1.DiscreteLegend, component_1.Tooltip, component_1.CartesianCrossHair, component_1.Label ]);
|
|
18
|
+
core_1.VChart.useChart([ line_1.LineChart, bar_1.BarChart, pie_1.PieChart ]), core_1.VChart.useComponent([ linear_axis_1.CartesianLinearAxis, band_axis_1.CartesianBandAxis, time_axis_1.CartesianTimeAxis, legend_1.DiscreteLegend, tooltip_1.Tooltip, cartesian_1.CartesianCrossHair, label_1.Label ]);
|
|
20
19
|
//# sourceMappingURL=vchart-simple.js.map
|
package/cjs/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,mDAAgD;AAChD,+DAAqE;AACrE,yDAAsD;AACtD,+DAAoE;AACpE,oEAAyE;AACzE,oEAAyE;AACzE,wEAA6E;AAI7E,iCAAgC;AAmBvB,uFAnBA,aAAM,OAmBA;AAlBf,uCAAyC;AACzC,qCAAuC;AACvC,qCAAuC;AAGvC,aAAM,CAAC,QAAQ,CAAC,CAAC,gBAAS,EAAE,cAAQ,EAAE,cAAQ,CAAC,CAAC,CAAC;AAGjD,aAAM,CAAC,YAAY,CAAC;IAClB,iCAAmB;IACnB,6BAAiB;IACjB,6BAAiB;IACjB,uBAAc;IACd,iBAAO;IACP,8BAAkB;IAClB,aAAK;CACN,CAAC,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/esm/animation/spec.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IAnimationConfig } from '@visactor/vgrammar';
|
|
2
2
|
import type { EasingType } from '@visactor/vrender';
|
|
3
|
-
export type { IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';
|
|
3
|
+
export type { IRunningConfig as IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';
|
|
4
4
|
export type IStateAnimateSpec<Preset extends string> = {
|
|
5
5
|
preset?: Preset | false;
|
|
6
6
|
duration?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/animation/spec.ts"],"names":[],"mappings":"","file":"spec.js","sourcesContent":["import type { IAnimationConfig } from '@visactor/vgrammar';\nimport type { EasingType } from '@visactor/vrender';\nexport type { IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';\n\nexport type IStateAnimateSpec<Preset extends string> = {\n /**\n * 预设动画效果\n */\n preset?: Preset | false;\n /**\n * 图表动画时长\n */\n duration?: number;\n /**\n * 动画延迟开始的时长\n */\n delay?: number;\n /**\n * 动画缓动效果\n */\n easing?: EasingType;\n /**\n * 是否轮流执行\n */\n oneByOne?: boolean;\n};\n\nexport type IMarkAnimateSpec<MarkName extends string> = Partial<\n Record<MarkName, false | IAnimationConfig | IAnimationConfig[]>\n>;\n\nexport interface IAnimationSpec<MarkName extends string, Preset extends string> {\n /**\n * 图表入场动画\n * 支持配置图表内置不同动画效果\n */\n animationAppear?: boolean | IStateAnimateSpec<Preset> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 新增数据动画\n */\n animationEnter?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据更新动画\n */\n animationUpdate?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据删除动画\n */\n animationExit?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 图表退场动画\n */\n animationDisappear?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 循环动画\n */\n animationNormal?: IMarkAnimateSpec<MarkName>;\n}\nexport interface IMorphSeriesSpec {\n /**\n * 系列全局动画是否开启\n * @default true\n */\n enable?: boolean;\n /**\n * 图元匹配字段\n * 系列前后根据 morphKey 配置的内容进行关联\n */\n morphKey?: string;\n /**\n * 数据匹配字段\n * 多数据图元可配置\n */\n morphElementKey?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/animation/spec.ts"],"names":[],"mappings":"","file":"spec.js","sourcesContent":["import type { IAnimationConfig } from '@visactor/vgrammar';\nimport type { EasingType } from '@visactor/vrender';\nexport type { IRunningConfig as IMorphConfig, IMorphAnimationConfig } from '@visactor/vgrammar';\n\nexport type IStateAnimateSpec<Preset extends string> = {\n /**\n * 预设动画效果\n */\n preset?: Preset | false;\n /**\n * 图表动画时长\n */\n duration?: number;\n /**\n * 动画延迟开始的时长\n */\n delay?: number;\n /**\n * 动画缓动效果\n */\n easing?: EasingType;\n /**\n * 是否轮流执行\n */\n oneByOne?: boolean;\n};\n\nexport type IMarkAnimateSpec<MarkName extends string> = Partial<\n Record<MarkName, false | IAnimationConfig | IAnimationConfig[]>\n>;\n\nexport interface IAnimationSpec<MarkName extends string, Preset extends string> {\n /**\n * 图表入场动画\n * 支持配置图表内置不同动画效果\n */\n animationAppear?: boolean | IStateAnimateSpec<Preset> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 新增数据动画\n */\n animationEnter?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据更新动画\n */\n animationUpdate?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 数据更新 - 数据删除动画\n */\n animationExit?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 图表退场动画\n */\n animationDisappear?: boolean | Omit<IStateAnimateSpec<Preset>, 'preset'> | IMarkAnimateSpec<MarkName>;\n /**\n * 循环动画\n */\n animationNormal?: IMarkAnimateSpec<MarkName>;\n}\nexport interface IMorphSeriesSpec {\n /**\n * 系列全局动画是否开启\n * @default true\n */\n enable?: boolean;\n /**\n * 图元匹配字段\n * 系列前后根据 morphKey 配置的内容进行关联\n */\n morphKey?: string;\n /**\n * 数据匹配字段\n * 多数据图元可配置\n */\n morphElementKey?: string;\n}\n"]}
|
package/esm/chart/area/area.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { AreaSeries } from "./../../series/area/area";
|
|
2
|
+
|
|
1
3
|
import { SeriesTypeEnum } from "../../series/interface";
|
|
2
4
|
|
|
3
5
|
import { CartesianChart } from "../cartesian/cartesian";
|
|
4
6
|
|
|
5
7
|
import { ChartTypeEnum } from "../interface";
|
|
6
8
|
|
|
7
|
-
import { setDefaultCrosshairForCartesianChart } from "../util";
|
|
8
|
-
|
|
9
9
|
import { VChart } from "../../core/vchart";
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { setDefaultCrosshairForCartesianChart } from "../util";
|
|
12
12
|
|
|
13
13
|
VChart.useSeries([ AreaSeries ]);
|
|
14
14
|
|
|
@@ -19,7 +19,6 @@ export class AreaChart extends CartesianChart {
|
|
|
19
19
|
_getDefaultSeriesSpec(spec) {
|
|
20
20
|
var _a;
|
|
21
21
|
return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), {
|
|
22
|
-
invalidType: spec.invalidType || "break",
|
|
23
22
|
point: spec.point,
|
|
24
23
|
line: spec.line,
|
|
25
24
|
area: spec.area,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chart/area/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/chart/area/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAE/B,MAAM,OAAO,SAAU,SAAQ,cAAc;IAA7C;;QAGW,SAAI,GAAW,aAAa,CAAC,IAAI,CAAC;QAClC,eAAU,GAAW,cAAc,CAAC,IAAI,CAAC;IAiBpD,CAAC;IAfW,qBAAqB,CAAC,IAAoB;;QAClD,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,MAAM,EACrC,WAAW,EAAE,IAAI,CAAC,WAAW,IAC7B;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AAnBe,cAAI,GAAW,aAAa,CAAC,IAAI,CAAC;AAClC,cAAI,GAAW,eAAe,CAAC","file":"area.js","sourcesContent":["import { AreaSeries } from './../../series/area/area';\nimport { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport type { IAreaChartSpec } from './interface';\nimport { VChart } from '../../core/vchart';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nVChart.useSeries([AreaSeries]);\n\nexport class AreaChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.area;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.area;\n readonly seriesType: string = SeriesTypeEnum.area;\n\n protected _getDefaultSeriesSpec(spec: IAreaChartSpec): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n point: spec.point,\n line: spec.line,\n area: spec.area,\n seriesMark: spec.seriesMark ?? 'area',\n activePoint: spec.activePoint\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
|
package/esm/chart/bar/bar-3d.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Bar3dSeries } from "./../../series/bar/bar-3d";
|
|
2
|
+
|
|
1
3
|
import { SeriesTypeEnum } from "../../series/interface";
|
|
2
4
|
|
|
3
5
|
import { CartesianChart } from "../cartesian/cartesian";
|
|
@@ -6,8 +8,6 @@ import { ChartTypeEnum } from "../interface";
|
|
|
6
8
|
|
|
7
9
|
import { VChart } from "../../core/vchart";
|
|
8
10
|
|
|
9
|
-
import { Bar3dSeries } from "../../series";
|
|
10
|
-
|
|
11
11
|
VChart.useSeries([ Bar3dSeries ]);
|
|
12
12
|
|
|
13
13
|
export class Bar3dChart extends CartesianChart {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chart/bar/bar-3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/chart/bar/bar-3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,cAAc;IAA9C;;QAGW,SAAI,GAAW,aAAa,CAAC,KAAK,CAAC;QACnC,eAAU,GAAW,cAAc,CAAC,KAAK,CAAC;IAWrD,CAAC;IATW,qBAAqB,CAAC,IAAS;QACvC,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,QAAQ,EAAoB,IAAK,CAAC,QAAQ,EAC1C,WAAW,EAAoB,IAAK,CAAC,WAAW,EAChD,WAAW,EAAoB,IAAK,CAAC,WAAW,EAChD,aAAa,EAAoB,IAAK,CAAC,aAAa,IACpD;IACJ,CAAC;;AAbe,eAAI,GAAW,aAAa,CAAC,KAAK,CAAC;AACnC,eAAI,GAAW,eAAe,CAAC","file":"bar-3d.js","sourcesContent":["import { Bar3dSeries } from './../../series/bar/bar-3d';\nimport { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { VChart } from '../../core/vchart';\nimport type { IBar3dChartSpec } from './interface';\nVChart.useSeries([Bar3dSeries]);\n\nexport class Bar3dChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar3d;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar3d;\n readonly seriesType: string = SeriesTypeEnum.bar3d;\n\n protected _getDefaultSeriesSpec(spec: any): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n barWidth: (<IBar3dChartSpec>spec).barWidth,\n barMaxWidth: (<IBar3dChartSpec>spec).barMaxWidth,\n barMinWidth: (<IBar3dChartSpec>spec).barMinWidth,\n barGapInGroup: (<IBar3dChartSpec>spec).barGapInGroup\n };\n }\n}\n"]}
|
package/esm/chart/bar/bar.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BarSeries } from "./../../series/bar/bar";
|
|
2
|
+
|
|
1
3
|
import { SeriesTypeEnum } from "../../series/interface";
|
|
2
4
|
|
|
3
5
|
import { CartesianChart } from "../cartesian/cartesian";
|
|
@@ -8,8 +10,6 @@ import { setDefaultCrosshairForCartesianChart } from "../util";
|
|
|
8
10
|
|
|
9
11
|
import { VChart } from "../../core/vchart";
|
|
10
12
|
|
|
11
|
-
import { BarSeries } from "../../series";
|
|
12
|
-
|
|
13
13
|
VChart.useSeries([ BarSeries ]);
|
|
14
14
|
|
|
15
15
|
export class BarChart extends CartesianChart {
|
package/esm/chart/bar/bar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chart/bar/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/chart/bar/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,oCAAoC,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9B,MAAM,OAAO,QAAS,SAAQ,cAAc;IAA5C;;QAGW,SAAI,GAAW,aAAa,CAAC,GAAG,CAAC;QACjC,eAAU,GAAW,cAAc,CAAC,GAAG,CAAC;IAgBnD,CAAC;IAdW,qBAAqB,CAAC,IAAS;QACvC,uCACK,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,KACpC,QAAQ,EAAkB,IAAK,CAAC,QAAQ,EACxC,WAAW,EAAkB,IAAK,CAAC,WAAW,EAC9C,WAAW,EAAkB,IAAK,CAAC,WAAW,EAC9C,aAAa,EAAkB,IAAK,CAAC,aAAa,IAClD;IACJ,CAAC;IAED,aAAa,CAAC,IAAS;QACrB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC1B,oCAAoC,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;;AAlBe,aAAI,GAAW,aAAa,CAAC,GAAG,CAAC;AACjC,aAAI,GAAW,eAAe,CAAC","file":"bar.js","sourcesContent":["import { BarSeries } from './../../series/bar/bar';\nimport { SeriesTypeEnum } from '../../series/interface';\nimport { CartesianChart } from '../cartesian/cartesian';\nimport { ChartTypeEnum } from '../interface';\nimport { setDefaultCrosshairForCartesianChart } from '../util';\nimport { VChart } from '../../core/vchart';\nimport type { IBarChartSpec } from './interface';\nVChart.useSeries([BarSeries]);\n\nexport class BarChart extends CartesianChart {\n static readonly type: string = ChartTypeEnum.bar;\n static readonly view: string = 'singleDefault';\n readonly type: string = ChartTypeEnum.bar;\n readonly seriesType: string = SeriesTypeEnum.bar;\n\n protected _getDefaultSeriesSpec(spec: any): any {\n return {\n ...super._getDefaultSeriesSpec(spec),\n barWidth: (<IBarChartSpec>spec).barWidth,\n barMaxWidth: (<IBarChartSpec>spec).barMaxWidth,\n barMinWidth: (<IBarChartSpec>spec).barMinWidth,\n barGapInGroup: (<IBarChartSpec>spec).barGapInGroup\n };\n }\n\n transformSpec(spec: any): void {\n super.transformSpec(spec);\n setDefaultCrosshairForCartesianChart(spec);\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ISeriesSpec, Datum, IMarkStateSpec, IRegionQuerier, MaybeArray, IPadding, IRect, StringOrNumber, IChartSpec } from '../typings';
|
|
1
|
+
import type { ISeriesSpec, Datum, IMarkStateSpec, IRegionQuerier, MaybeArray, IPadding, IRect, StringOrNumber, IChartSpec, IDataValues } from '../typings';
|
|
2
2
|
import type { LayoutCallBack } from '../layout/interface';
|
|
3
3
|
import type { ILayoutModelState, ILayoutOrientPadding, ILayoutRect, IModel, IModelOption, IUpdateSpecResult } from '../model/interface';
|
|
4
4
|
import type { IChart, IChartLayoutOption, IChartRenderOption, IChartOption, IChartEvaluateOption, ILayoutParams, DimensionIndexOption } from './interface';
|
|
@@ -13,7 +13,7 @@ import { Stack } from './stack';
|
|
|
13
13
|
import type { ITheme } from '../theme/interface';
|
|
14
14
|
import type { IParserOptions } from '@visactor/vdataset/es/parser';
|
|
15
15
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
16
|
-
import type { IMorphConfig, IMark as IVGrammarMark, IView } from '@visactor/vgrammar';
|
|
16
|
+
import type { IRunningConfig as IMorphConfig, IMark as IVGrammarMark, IView } from '@visactor/vgrammar';
|
|
17
17
|
import { CompilableBase } from '../compile/compilable-base';
|
|
18
18
|
import type { IGlobalScale } from '../scale/interface';
|
|
19
19
|
import type { IRectMark } from '../mark/rect';
|
|
@@ -96,7 +96,9 @@ export declare class BaseChart extends CompilableBase implements IChart {
|
|
|
96
96
|
getMarkById(id: number): IMark | undefined;
|
|
97
97
|
updateParseData(id: string, data: Datum[], options?: IParserOptions): void;
|
|
98
98
|
updateData(id: StringOrNumber, data: unknown, updateGlobalScale?: boolean, options?: IParserOptions): void;
|
|
99
|
+
updateFullData(data: IDataValues | IDataValues[], updateGlobalScale?: boolean): void;
|
|
99
100
|
onRender(option: IChartRenderOption): void;
|
|
101
|
+
setCanvasRect(width: number, height: number): void;
|
|
100
102
|
getCanvasRect(): Omit<IRect, 'x' | 'y'>;
|
|
101
103
|
getSeriesData(id: StringOrNumber | undefined, index: number | undefined): DataView | undefined;
|
|
102
104
|
private _transformSpecScale;
|
package/esm/chart/base-chart.js
CHANGED
|
@@ -34,7 +34,7 @@ import { Factory } from "../core/factory";
|
|
|
34
34
|
|
|
35
35
|
import { Event } from "../event/event";
|
|
36
36
|
|
|
37
|
-
import { isArray, isValid, createID, calcPadding, normalizeLayoutPaddingSpec, array,
|
|
37
|
+
import { isArray, isValid, createID, calcPadding, normalizeLayoutPaddingSpec, array, convertBackgroundSpec } from "../util";
|
|
38
38
|
|
|
39
39
|
import { Stack } from "./stack";
|
|
40
40
|
|
|
@@ -46,7 +46,7 @@ import { DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT } from "../constant/base";
|
|
|
46
46
|
|
|
47
47
|
import { dataToDataView } from "../data/initialize";
|
|
48
48
|
|
|
49
|
-
import { has, isFunction, isEmpty
|
|
49
|
+
import { has, isFunction, isEmpty } from "@visactor/vutils";
|
|
50
50
|
|
|
51
51
|
import { getActualColor, getDataScheme } from "../theme/color-scheme/util";
|
|
52
52
|
|
|
@@ -58,6 +58,8 @@ import { ChartEvent, VGRAMMAR_HOOK_EVENT } from "../constant";
|
|
|
58
58
|
|
|
59
59
|
import { DimensionEventEnum } from "../event/events/dimension";
|
|
60
60
|
|
|
61
|
+
import { calculateChartSize } from "./util";
|
|
62
|
+
|
|
61
63
|
export class BaseChart extends CompilableBase {
|
|
62
64
|
getSpec() {
|
|
63
65
|
return this._spec;
|
|
@@ -333,36 +335,28 @@ export class BaseChart extends CompilableBase {
|
|
|
333
335
|
dv && dv.parseNewData(data, options), updateGlobalScale && this.updateGlobalScaleDomain(),
|
|
334
336
|
this.getAllModels().forEach((model => model.onDataUpdate()));
|
|
335
337
|
}
|
|
338
|
+
updateFullData(data, updateGlobalScale = !0) {
|
|
339
|
+
const dvs = [];
|
|
340
|
+
array(data).forEach((d => {
|
|
341
|
+
const dv = this._dataSet.getDataView(d.id);
|
|
342
|
+
dv && (dvs.push({
|
|
343
|
+
d: d,
|
|
344
|
+
dv: dv
|
|
345
|
+
}), dv.markRunning());
|
|
346
|
+
})), dvs.forEach((({d: d, dv: dv}) => {
|
|
347
|
+
dv.setFields(d.fields), dv.parseNewData(d.values, d.parser);
|
|
348
|
+
})), updateGlobalScale && this.updateGlobalScaleDomain(), this.getAllModels().forEach((model => model.onDataUpdate()));
|
|
349
|
+
}
|
|
336
350
|
onRender(option) {}
|
|
351
|
+
setCanvasRect(width, height) {
|
|
352
|
+
this._canvasRect = {
|
|
353
|
+
width: width,
|
|
354
|
+
height: height
|
|
355
|
+
};
|
|
356
|
+
}
|
|
337
357
|
getCanvasRect() {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const {width: userWidth, height: userHeight} = this._spec;
|
|
341
|
-
if (isValid(userWidth) && isValid(userHeight)) this._canvasRect = {
|
|
342
|
-
width: userWidth,
|
|
343
|
-
height: userHeight
|
|
344
|
-
}; else {
|
|
345
|
-
let width = DEFAULT_CHART_WIDTH, height = DEFAULT_CHART_HEIGHT;
|
|
346
|
-
const container = this._option.container, canvas = this._option.canvas;
|
|
347
|
-
if (container) {
|
|
348
|
-
const {width: containerWidth, height: containerHeight} = getContainerSize(this._option.container, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
349
|
-
width = containerWidth, height = containerHeight;
|
|
350
|
-
} else if (canvas && isTrueBrowser(this._option.mode)) {
|
|
351
|
-
let canvasNode;
|
|
352
|
-
canvasNode = isString(canvas) ? null === document || void 0 === document ? void 0 : document.getElementById(canvas) : canvas;
|
|
353
|
-
const {width: containerWidth, height: containerHeight} = getContainerSize(canvasNode, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
354
|
-
width = containerWidth, height = containerHeight;
|
|
355
|
-
} else if (isMiniAppLikeMode(this._option.mode) && (null === (_a = this._option.modeParams) || void 0 === _a ? void 0 : _a.domref)) {
|
|
356
|
-
const domRef = this._option.modeParams.domref;
|
|
357
|
-
width = domRef.width, height = domRef.height;
|
|
358
|
-
}
|
|
359
|
-
width = null != userWidth ? userWidth : width, height = null != userHeight ? userHeight : height,
|
|
360
|
-
this._canvasRect = {
|
|
361
|
-
width: width,
|
|
362
|
-
height: height
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
return this._canvasRect;
|
|
358
|
+
return this._canvasRect || (this._canvasRect = calculateChartSize(this._spec, this._option)),
|
|
359
|
+
this._canvasRect;
|
|
366
360
|
}
|
|
367
361
|
getSeriesData(id, index) {
|
|
368
362
|
if (!this._spec.data) return this._option.onError("no data in spec!"), null;
|
|
@@ -439,9 +433,9 @@ export class BaseChart extends CompilableBase {
|
|
|
439
433
|
result))));
|
|
440
434
|
}
|
|
441
435
|
updateDataSpec(result) {
|
|
442
|
-
this._spec.data && array(this._spec.data).forEach((d => {
|
|
436
|
+
this._spec.data && array(this._spec.data).forEach(((d, i) => {
|
|
443
437
|
const dataView = this._dataSet.getDataView(d.id);
|
|
444
|
-
dataView
|
|
438
|
+
dataView ? d.values ? dataView.updateRawData(d.values) : d.latestData || dataView.updateRawData([]) : result.reMakeData = !0;
|
|
445
439
|
}));
|
|
446
440
|
}
|
|
447
441
|
updateRegionSpec(result) {
|
|
@@ -469,8 +463,14 @@ export class BaseChart extends CompilableBase {
|
|
|
469
463
|
}
|
|
470
464
|
updateSeriesSpec(result) {
|
|
471
465
|
this._spec.series.length === this._series.length ? this._series.forEach((s => {
|
|
472
|
-
|
|
473
|
-
s.
|
|
466
|
+
var _a;
|
|
467
|
+
const spec = this._spec.series[s.getSpecIndex()];
|
|
468
|
+
if (result.reMakeData) {
|
|
469
|
+
let values;
|
|
470
|
+
values = spec.data ? spec.data.values : null === (_a = this.getSeriesData(spec.dataId, spec.dataIndex)) || void 0 === _a ? void 0 : _a.latestData,
|
|
471
|
+
s.updateRawData(values);
|
|
472
|
+
}
|
|
473
|
+
this._mergeUpdateResult(result, s.updateSpec(spec)), s.reInit();
|
|
474
474
|
})) : result.reMake = !0;
|
|
475
475
|
}
|
|
476
476
|
getCanvas() {
|
|
@@ -502,7 +502,8 @@ export class BaseChart extends CompilableBase {
|
|
|
502
502
|
largeThreshold: spec.largeThreshold,
|
|
503
503
|
progressiveStep: spec.progressiveStep,
|
|
504
504
|
progressiveThreshold: spec.progressiveThreshold,
|
|
505
|
-
background: spec.seriesBackground
|
|
505
|
+
background: spec.seriesBackground,
|
|
506
|
+
invalidType: spec.invalidType
|
|
506
507
|
};
|
|
507
508
|
}
|
|
508
509
|
_mergeUpdateResult(resultA, resultB) {
|