@visactor/vchart 1.10.0-alpha.4 → 1.10.0-alpha.5
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 +1 -1
- package/build/index.js +32729 -32038
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/utils.js +5 -5
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/chart/base/base-chart-transformer.js +7 -9
- package/cjs/chart/base/base-chart-transformer.js.map +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -1
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +1 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/progress/circular/circular-progress-transformer.js +2 -0
- package/cjs/chart/progress/circular/circular-progress-transformer.js.map +1 -1
- package/cjs/compile/compiler.d.ts +1 -1
- package/cjs/compile/compiler.js +3 -3
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +9 -6
- package/cjs/component/axis/base-axis.js +37 -6
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +1 -5
- package/cjs/component/axis/cartesian/axis.js +9 -31
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/time-axis.d.ts +1 -1
- package/cjs/component/axis/cartesian/time-axis.js +3 -3
- package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/util/index.d.ts +0 -1
- package/cjs/component/axis/cartesian/util/index.js +1 -1
- package/cjs/component/axis/cartesian/util/index.js.map +1 -1
- package/cjs/component/axis/interface/common.d.ts +2 -1
- package/cjs/component/axis/interface/common.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +2 -0
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +1 -5
- package/cjs/component/axis/polar/axis.js +5 -23
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/base/util.d.ts +5 -0
- package/cjs/component/base/util.js +24 -16
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +4 -1
- package/cjs/component/crosshair/base.js +1 -10
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/cartesian.d.ts +1 -7
- package/cjs/component/crosshair/cartesian.js +17 -208
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/config.js.map +1 -1
- package/cjs/component/crosshair/interface/cartesian.d.ts +46 -0
- package/cjs/component/crosshair/interface/cartesian.js +6 -0
- package/cjs/component/crosshair/interface/cartesian.js.map +1 -0
- package/cjs/component/crosshair/interface/common.d.ts +7 -0
- package/cjs/component/crosshair/interface/common.js +6 -0
- package/cjs/component/crosshair/interface/common.js.map +1 -0
- package/cjs/component/crosshair/interface/index.d.ts +3 -0
- package/cjs/component/crosshair/interface/index.js +3 -1
- package/cjs/component/crosshair/interface/index.js.map +1 -1
- package/cjs/component/crosshair/interface/polar.d.ts +23 -0
- package/cjs/component/crosshair/interface/polar.js +6 -0
- package/cjs/component/crosshair/interface/polar.js.map +1 -0
- package/cjs/component/crosshair/interface/spec.d.ts +1 -0
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/crosshair/polar.d.ts +2 -2
- package/cjs/component/crosshair/polar.js +17 -114
- package/cjs/component/crosshair/polar.js.map +1 -1
- package/cjs/component/crosshair/utils/cartesian.d.ts +32 -0
- package/cjs/component/crosshair/utils/cartesian.js +238 -0
- package/cjs/component/crosshair/utils/cartesian.js.map +1 -0
- package/{esm/component/crosshair/util.d.ts → cjs/component/crosshair/utils/common.d.ts} +3 -3
- package/cjs/component/crosshair/{util.js → utils/common.js} +2 -2
- package/cjs/component/crosshair/utils/common.js.map +1 -0
- package/cjs/component/crosshair/utils/index.d.ts +1 -0
- package/cjs/component/crosshair/utils/index.js +21 -0
- package/cjs/component/crosshair/utils/index.js.map +1 -0
- package/cjs/component/crosshair/utils/polar.d.ts +37 -0
- package/cjs/component/crosshair/utils/polar.js +133 -0
- package/cjs/component/crosshair/utils/polar.js.map +1 -0
- package/cjs/component/custom-mark/custom-mark.js +2 -1
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +1 -0
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +10 -3
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/interface.d.ts +4 -5
- package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/interface.d.ts +2 -4
- package/cjs/component/data-zoom/scroll-bar/interface.js.map +1 -1
- package/cjs/component/data-zoom/util.d.ts +0 -4
- package/cjs/component/data-zoom/util.js +2 -10
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/component/index.d.ts +1 -0
- package/cjs/component/index.js +16 -1
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/interface/theme.d.ts +8 -0
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/label/interface.d.ts +1 -1
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/util.js +4 -4
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/legend/continuous/interface.d.ts +6 -12
- package/cjs/component/legend/continuous/interface.js.map +1 -1
- package/cjs/component/legend/discrete/interface.d.ts +17 -4
- package/cjs/component/legend/discrete/interface.js.map +1 -1
- package/cjs/component/legend/discrete/legend.d.ts +1 -0
- package/cjs/component/legend/discrete/legend.js +11 -2
- package/cjs/component/legend/discrete/legend.js.map +1 -1
- package/cjs/component/legend/discrete/util.js +6 -4
- package/cjs/component/legend/discrete/util.js.map +1 -1
- package/cjs/component/legend/util.d.ts +1 -2
- package/cjs/component/legend/util.js +2 -6
- package/cjs/component/legend/util.js.map +1 -1
- package/cjs/component/player/interface/theme.d.ts +1 -1
- package/cjs/component/player/interface/theme.js.map +1 -1
- package/cjs/component/player/utils/transform.js.map +1 -1
- package/cjs/component/tooltip/interface/common.d.ts +2 -2
- package/cjs/component/tooltip/interface/common.js.map +1 -1
- package/cjs/component/tooltip/interface/event.d.ts +0 -2
- package/cjs/component/tooltip/interface/event.js.map +1 -1
- package/cjs/component/tooltip/interface/index.d.ts +1 -0
- package/cjs/component/tooltip/interface/index.js +1 -1
- package/cjs/component/tooltip/interface/index.js.map +1 -1
- package/cjs/component/tooltip/interface/spec.d.ts +2 -2
- package/cjs/component/tooltip/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/interface/theme.d.ts +3 -3
- package/cjs/component/tooltip/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.js +2 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/cjs/component/tooltip/processor/mark-tooltip.js +2 -1
- package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +3 -3
- package/cjs/component/tooltip/tooltip.js +7 -5
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +3 -0
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/component/util.d.ts +8 -0
- package/cjs/component/util.js +15 -3
- package/cjs/component/util.js.map +1 -1
- package/cjs/core/factory.d.ts +3 -0
- package/cjs/core/factory.js +6 -0
- package/cjs/core/factory.js.map +1 -1
- package/cjs/core/index.d.ts +2 -1
- package/cjs/core/index.js +3 -2
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.d.ts +1 -1
- package/cjs/core/interface.js.map +1 -1
- package/cjs/core/vchart.d.ts +2 -1
- package/cjs/core/vchart.js +2 -2
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js.map +1 -1
- package/cjs/event/events/dimension/interface.d.ts +3 -2
- package/cjs/event/events/dimension/interface.js.map +1 -1
- package/cjs/event/events/dimension/util/cartesian.js +1 -0
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/events/dimension/util/polar.js +2 -0
- package/cjs/event/events/dimension/util/polar.js.map +1 -1
- package/cjs/index-lark.js +2 -2
- package/cjs/index-lark.js.map +1 -1
- package/cjs/index-wx-simple.js +2 -2
- package/cjs/index-wx-simple.js.map +1 -1
- package/cjs/index-wx.js +2 -2
- package/cjs/index-wx.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/mark/arc.js +3 -1
- package/cjs/mark/arc.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +3 -3
- package/cjs/mark/base/base-mark.js +20 -13
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/index.d.ts +2 -3
- package/cjs/mark/index.js +1 -10
- package/cjs/mark/index.js.map +1 -1
- package/cjs/mark/interface/type.d.ts +0 -1
- package/cjs/mark/interface/type.js +2 -3
- package/cjs/mark/interface/type.js.map +1 -1
- package/cjs/plugin/chart/formatter/formatter.d.ts +28 -0
- package/cjs/plugin/chart/formatter/formatter.js +74 -0
- package/cjs/plugin/chart/formatter/formatter.js.map +1 -0
- package/cjs/plugin/chart/formatter/index.d.ts +1 -0
- package/cjs/plugin/chart/formatter/index.js +21 -0
- package/cjs/plugin/chart/formatter/index.js.map +1 -0
- package/cjs/plugin/components/index.d.ts +2 -5
- package/cjs/plugin/components/index.js +16 -7
- package/cjs/plugin/components/index.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/base.d.ts +6 -6
- package/cjs/plugin/components/tooltip-handler/base.js +112 -51
- package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/constants.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/constants.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +8 -4
- package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +31 -9
- package/cjs/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +2 -3
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/interface.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/dom/model/interface.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/attribute.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/utils/attribute.js +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/common.d.ts +3 -3
- package/cjs/plugin/components/tooltip-handler/utils/common.js +9 -3
- package/cjs/plugin/components/tooltip-handler/utils/common.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/compose.d.ts +2 -2
- package/cjs/plugin/components/tooltip-handler/utils/compose.js +9 -8
- package/cjs/plugin/components/tooltip-handler/utils/compose.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/get-spec.js +12 -9
- package/cjs/plugin/components/tooltip-handler/utils/get-spec.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/position.d.ts +18 -3
- package/cjs/plugin/components/tooltip-handler/utils/position.js +49 -8
- package/cjs/plugin/components/tooltip-handler/utils/position.js.map +1 -1
- package/cjs/plugin/index.d.ts +1 -0
- package/cjs/plugin/index.js +1 -1
- package/cjs/plugin/index.js.map +1 -1
- package/cjs/series/base/base-series.js +2 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/base/tooltip-helper.d.ts +3 -3
- package/cjs/series/base/tooltip-helper.js.map +1 -1
- package/cjs/series/dot/tooltip-helper.js +2 -2
- package/cjs/series/dot/tooltip-helper.js.map +1 -1
- package/cjs/series/gauge/constant.js +2 -2
- package/cjs/series/gauge/constant.js.map +1 -1
- package/cjs/series/gauge/gauge.js +2 -2
- package/cjs/series/gauge/gauge.js.map +1 -1
- package/cjs/series/gauge/interface.d.ts +3 -3
- package/cjs/series/gauge/interface.js.map +1 -1
- package/cjs/series/interface/common.d.ts +1 -1
- package/cjs/series/interface/common.js.map +1 -1
- package/cjs/series/link/tooltip-helper.js +2 -2
- package/cjs/series/link/tooltip-helper.js.map +1 -1
- package/cjs/series/polar/progress-like/progress-like.js +24 -26
- package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
- package/cjs/series/progress/circular/circular.js +3 -4
- package/cjs/series/progress/circular/circular.js.map +1 -1
- package/cjs/series/progress/circular/constant.js +2 -2
- package/cjs/series/progress/circular/constant.js.map +1 -1
- package/cjs/series/progress/circular/interface.d.ts +5 -5
- package/cjs/series/progress/circular/interface.js.map +1 -1
- package/cjs/series/range-area/tooltip-helper.js.map +1 -1
- package/cjs/series/sankey/tooltip-helper.js.map +1 -1
- package/cjs/series/sunburst/sunburst.d.ts +1 -1
- package/cjs/series/word-cloud/interface.js.map +1 -1
- package/cjs/theme/builtin/common/mark.js +2 -1
- package/cjs/theme/builtin/common/mark.js.map +1 -1
- package/cjs/theme/builtin/common/series/box-plot.js +5 -0
- package/cjs/theme/builtin/common/series/box-plot.js.map +1 -1
- package/cjs/theme/builtin/common/series/rangeColumn.js +1 -0
- package/cjs/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/cjs/theme/builtin/common/series/waterfall.js +4 -1
- package/cjs/theme/builtin/common/series/waterfall.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +4 -3
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/tooltip/line.d.ts +5 -2
- package/cjs/typings/tooltip/line.js.map +1 -1
- package/cjs/typings/tooltip/position.d.ts +21 -10
- package/cjs/typings/tooltip/position.js.map +1 -1
- package/cjs/typings/tooltip/shape.d.ts +2 -2
- package/cjs/typings/tooltip/shape.js.map +1 -1
- package/cjs/typings/tooltip/tooltip.d.ts +8 -8
- package/cjs/typings/tooltip/tooltip.js.map +1 -1
- package/cjs/typings/visual.d.ts +2 -4
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/util/index.d.ts +1 -2
- package/cjs/util/index.js +2 -2
- package/cjs/util/index.js.map +1 -1
- package/cjs/vchart-all.js +2 -2
- package/cjs/vchart-all.js.map +1 -1
- package/cjs/vchart-simple.js +2 -2
- package/cjs/vchart-simple.js.map +1 -1
- package/esm/animation/utils.js +5 -5
- package/esm/animation/utils.js.map +1 -1
- package/esm/chart/base/base-chart-transformer.js +7 -9
- package/esm/chart/base/base-chart-transformer.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +1 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/progress/circular/circular-progress-transformer.js +2 -0
- package/esm/chart/progress/circular/circular-progress-transformer.js.map +1 -1
- package/esm/compile/compiler.d.ts +1 -1
- package/esm/compile/compiler.js +4 -4
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +9 -6
- package/esm/component/axis/base-axis.js +39 -5
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +1 -5
- package/esm/component/axis/cartesian/axis.js +8 -26
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/time-axis.d.ts +1 -1
- package/esm/component/axis/cartesian/time-axis.js +2 -2
- package/esm/component/axis/cartesian/time-axis.js.map +1 -1
- package/esm/component/axis/cartesian/util/index.d.ts +0 -1
- package/esm/component/axis/cartesian/util/index.js +0 -2
- package/esm/component/axis/cartesian/util/index.js.map +1 -1
- package/esm/component/axis/interface/common.d.ts +2 -1
- package/esm/component/axis/interface/common.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +2 -0
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +1 -5
- package/esm/component/axis/polar/axis.js +5 -23
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/base/util.d.ts +5 -0
- package/esm/component/base/util.js +12 -9
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +4 -1
- package/esm/component/crosshair/base.js +1 -10
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/cartesian.d.ts +1 -7
- package/esm/component/crosshair/cartesian.js +20 -206
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/config.js.map +1 -1
- package/esm/component/crosshair/interface/cartesian.d.ts +46 -0
- package/esm/component/crosshair/interface/cartesian.js +2 -0
- package/esm/component/crosshair/interface/cartesian.js.map +1 -0
- package/esm/component/crosshair/interface/common.d.ts +7 -0
- package/esm/component/crosshair/interface/common.js +2 -0
- package/esm/component/crosshair/interface/common.js.map +1 -0
- package/esm/component/crosshair/interface/index.d.ts +3 -0
- package/esm/component/crosshair/interface/index.js +6 -0
- package/esm/component/crosshair/interface/index.js.map +1 -1
- package/esm/component/crosshair/interface/polar.d.ts +23 -0
- package/esm/component/crosshair/interface/polar.js +2 -0
- package/esm/component/crosshair/interface/polar.js.map +1 -0
- package/esm/component/crosshair/interface/spec.d.ts +1 -0
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/crosshair/polar.d.ts +2 -2
- package/esm/component/crosshair/polar.js +19 -116
- package/esm/component/crosshair/polar.js.map +1 -1
- package/esm/component/crosshair/utils/cartesian.d.ts +32 -0
- package/esm/component/crosshair/utils/cartesian.js +233 -0
- package/esm/component/crosshair/utils/cartesian.js.map +1 -0
- package/{cjs/component/crosshair/util.d.ts → esm/component/crosshair/utils/common.d.ts} +3 -3
- package/esm/component/crosshair/{util.js → utils/common.js} +6 -6
- package/esm/component/crosshair/utils/common.js.map +1 -0
- package/esm/component/crosshair/utils/index.d.ts +1 -0
- package/esm/component/crosshair/utils/index.js +2 -0
- package/esm/component/crosshair/utils/index.js.map +1 -0
- package/esm/component/crosshair/utils/polar.d.ts +37 -0
- package/esm/component/crosshair/utils/polar.js +125 -0
- package/esm/component/crosshair/utils/polar.js.map +1 -0
- package/esm/component/custom-mark/custom-mark.js +2 -1
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +1 -0
- package/esm/component/data-zoom/data-zoom/data-zoom.js +10 -2
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/interface.d.ts +4 -5
- package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/interface.d.ts +2 -4
- package/esm/component/data-zoom/scroll-bar/interface.js.map +1 -1
- package/esm/component/data-zoom/util.d.ts +0 -4
- package/esm/component/data-zoom/util.js +1 -10
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/component/index.d.ts +1 -0
- package/esm/component/index.js +2 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/interface/theme.d.ts +8 -0
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/label/interface.d.ts +1 -1
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/util.js +6 -3
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/legend/continuous/interface.d.ts +6 -12
- package/esm/component/legend/continuous/interface.js.map +1 -1
- package/esm/component/legend/discrete/interface.d.ts +17 -4
- package/esm/component/legend/discrete/interface.js.map +1 -1
- package/esm/component/legend/discrete/legend.d.ts +1 -0
- package/esm/component/legend/discrete/legend.js +11 -1
- package/esm/component/legend/discrete/legend.js.map +1 -1
- package/esm/component/legend/discrete/util.js +3 -2
- package/esm/component/legend/discrete/util.js.map +1 -1
- package/esm/component/legend/util.d.ts +1 -2
- package/esm/component/legend/util.js +0 -4
- package/esm/component/legend/util.js.map +1 -1
- package/esm/component/player/interface/theme.d.ts +1 -1
- package/esm/component/player/interface/theme.js.map +1 -1
- package/esm/component/player/utils/transform.js.map +1 -1
- package/esm/component/tooltip/interface/common.d.ts +2 -2
- package/esm/component/tooltip/interface/common.js.map +1 -1
- package/esm/component/tooltip/interface/event.d.ts +0 -2
- package/esm/component/tooltip/interface/event.js.map +1 -1
- package/esm/component/tooltip/interface/index.d.ts +1 -0
- package/esm/component/tooltip/interface/index.js +2 -0
- package/esm/component/tooltip/interface/index.js.map +1 -1
- package/esm/component/tooltip/interface/spec.d.ts +2 -2
- package/esm/component/tooltip/interface/spec.js.map +1 -1
- package/esm/component/tooltip/interface/theme.d.ts +3 -3
- package/esm/component/tooltip/interface/theme.js.map +1 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js +2 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/esm/component/tooltip/processor/mark-tooltip.js +2 -1
- package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +3 -3
- package/esm/component/tooltip/tooltip.js +8 -6
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +3 -0
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/component/util.d.ts +8 -0
- package/esm/component/util.js +14 -0
- package/esm/component/util.js.map +1 -1
- package/esm/core/factory.d.ts +3 -0
- package/esm/core/factory.js +6 -0
- package/esm/core/factory.js.map +1 -1
- package/esm/core/index.d.ts +2 -1
- package/esm/core/index.js +3 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.d.ts +1 -1
- package/esm/core/interface.js.map +1 -1
- package/esm/core/vchart.d.ts +2 -1
- package/esm/core/vchart.js +3 -1
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js.map +1 -1
- package/esm/event/events/dimension/interface.d.ts +3 -2
- package/esm/event/events/dimension/interface.js.map +1 -1
- package/esm/event/events/dimension/util/cartesian.js +1 -0
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/events/dimension/util/polar.js +2 -0
- package/esm/event/events/dimension/util/polar.js.map +1 -1
- package/esm/index-lark.js +4 -2
- package/esm/index-lark.js.map +1 -1
- package/esm/index-wx-simple.js +4 -2
- package/esm/index-wx-simple.js.map +1 -1
- package/esm/index-wx.js +1 -1
- package/esm/index-wx.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/mark/arc.js +3 -1
- package/esm/mark/arc.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +3 -3
- package/esm/mark/base/base-mark.js +20 -13
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/index.d.ts +2 -3
- package/esm/mark/index.js +1 -3
- package/esm/mark/index.js.map +1 -1
- package/esm/mark/interface/type.d.ts +0 -1
- package/esm/mark/interface/type.js +2 -3
- package/esm/mark/interface/type.js.map +1 -1
- package/esm/plugin/chart/formatter/formatter.d.ts +28 -0
- package/esm/plugin/chart/formatter/formatter.js +71 -0
- package/esm/plugin/chart/formatter/formatter.js.map +1 -0
- package/esm/plugin/chart/formatter/index.d.ts +1 -0
- package/esm/plugin/chart/formatter/index.js +2 -0
- package/esm/plugin/chart/formatter/index.js.map +1 -0
- package/esm/plugin/components/index.d.ts +2 -5
- package/esm/plugin/components/index.js +2 -4
- package/esm/plugin/components/index.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/base.d.ts +6 -6
- package/esm/plugin/components/tooltip-handler/base.js +111 -50
- package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/constants.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/constants.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.d.ts +8 -4
- package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js +31 -8
- package/esm/plugin/components/tooltip-handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/dom/model/base-tooltip-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +2 -3
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/interface.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/dom/model/interface.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/attribute.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/utils/attribute.js +1 -1
- package/esm/plugin/components/tooltip-handler/utils/attribute.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/common.d.ts +3 -3
- package/esm/plugin/components/tooltip-handler/utils/common.js +10 -1
- package/esm/plugin/components/tooltip-handler/utils/common.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/compose.d.ts +2 -2
- package/esm/plugin/components/tooltip-handler/utils/compose.js +5 -7
- package/esm/plugin/components/tooltip-handler/utils/compose.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/get-spec.js +12 -9
- package/esm/plugin/components/tooltip-handler/utils/get-spec.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/position.d.ts +18 -3
- package/esm/plugin/components/tooltip-handler/utils/position.js +39 -7
- package/esm/plugin/components/tooltip-handler/utils/position.js.map +1 -1
- package/esm/plugin/index.d.ts +1 -0
- package/esm/plugin/index.js +2 -0
- package/esm/plugin/index.js.map +1 -1
- package/esm/series/base/base-series.js +2 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/base/tooltip-helper.d.ts +3 -3
- package/esm/series/base/tooltip-helper.js.map +1 -1
- package/esm/series/dot/tooltip-helper.js +1 -3
- package/esm/series/dot/tooltip-helper.js.map +1 -1
- package/esm/series/gauge/constant.js +2 -2
- package/esm/series/gauge/constant.js.map +1 -1
- package/esm/series/gauge/gauge.js +3 -3
- package/esm/series/gauge/gauge.js.map +1 -1
- package/esm/series/gauge/interface.d.ts +3 -3
- package/esm/series/gauge/interface.js.map +1 -1
- package/esm/series/interface/common.d.ts +1 -1
- package/esm/series/interface/common.js.map +1 -1
- package/esm/series/link/tooltip-helper.js +1 -1
- package/esm/series/link/tooltip-helper.js.map +1 -1
- package/esm/series/polar/progress-like/progress-like.js +23 -25
- package/esm/series/polar/progress-like/progress-like.js.map +1 -1
- package/esm/series/progress/circular/circular.js +1 -3
- package/esm/series/progress/circular/circular.js.map +1 -1
- package/esm/series/progress/circular/constant.js +2 -2
- package/esm/series/progress/circular/constant.js.map +1 -1
- package/esm/series/progress/circular/interface.d.ts +5 -5
- package/esm/series/progress/circular/interface.js.map +1 -1
- package/esm/series/range-area/tooltip-helper.js.map +1 -1
- package/esm/series/sankey/tooltip-helper.js.map +1 -1
- package/esm/series/sunburst/sunburst.d.ts +1 -1
- package/esm/series/word-cloud/interface.js.map +1 -1
- package/esm/theme/builtin/common/mark.js +2 -1
- package/esm/theme/builtin/common/mark.js.map +1 -1
- package/esm/theme/builtin/common/series/box-plot.js +5 -0
- package/esm/theme/builtin/common/series/box-plot.js.map +1 -1
- package/esm/theme/builtin/common/series/rangeColumn.js +1 -0
- package/esm/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/esm/theme/builtin/common/series/waterfall.js +4 -1
- package/esm/theme/builtin/common/series/waterfall.js.map +1 -1
- package/esm/typings/spec/common.d.ts +4 -3
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/tooltip/line.d.ts +5 -2
- package/esm/typings/tooltip/line.js.map +1 -1
- package/esm/typings/tooltip/position.d.ts +21 -10
- package/esm/typings/tooltip/position.js.map +1 -1
- package/esm/typings/tooltip/shape.d.ts +2 -2
- package/esm/typings/tooltip/shape.js.map +1 -1
- package/esm/typings/tooltip/tooltip.d.ts +8 -8
- package/esm/typings/tooltip/tooltip.js.map +1 -1
- package/esm/typings/visual.d.ts +2 -4
- package/esm/typings/visual.js.map +1 -1
- package/esm/util/index.d.ts +1 -2
- package/esm/util/index.js +1 -3
- package/esm/util/index.js.map +1 -1
- package/esm/vchart-all.js +4 -2
- package/esm/vchart-all.js.map +1 -1
- package/esm/vchart-simple.js +1 -1
- package/esm/vchart-simple.js.map +1 -1
- package/package.json +17 -17
- package/cjs/component/axis/cartesian/util/time.d.ts +0 -80
- package/cjs/component/axis/cartesian/util/time.js +0 -204
- package/cjs/component/axis/cartesian/util/time.js.map +0 -1
- package/cjs/component/crosshair/util.js.map +0 -1
- package/cjs/mark/progress-arc.d.ts +0 -14
- package/cjs/mark/progress-arc.js +0 -55
- package/cjs/mark/progress-arc.js.map +0 -1
- package/esm/component/axis/cartesian/util/time.d.ts +0 -80
- package/esm/component/axis/cartesian/util/time.js +0 -196
- package/esm/component/axis/cartesian/util/time.js.map +0 -1
- package/esm/component/crosshair/util.js.map +0 -1
- package/esm/mark/progress-arc.d.ts +0 -14
- package/esm/mark/progress-arc.js +0 -47
- package/esm/mark/progress-arc.js.map +0 -1
package/esm/mark/index.d.ts
CHANGED
|
@@ -13,10 +13,9 @@ import { Arc3dMark } from './arc-3d';
|
|
|
13
13
|
import { ComponentMark } from './component';
|
|
14
14
|
import { LinkPathMark } from './link-path';
|
|
15
15
|
import { RippleMark } from './ripple';
|
|
16
|
-
import { ProgressArcMark } from './progress-arc';
|
|
17
16
|
import { CellMark } from './cell';
|
|
18
17
|
import { BaseMark } from './base';
|
|
19
18
|
import { PolygonMark } from './polygon/polygon';
|
|
20
19
|
import { Pyramid3dMark } from './polygon/pyramid-3d';
|
|
21
|
-
export type { IBoxPlotMarkSpec, ILineMarkSpec, ISymbolMarkSpec, IGroupMarkSpec, IRuleMarkSpec, ITextMarkSpec, IAreaMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IPathMarkSpec, IArcMarkSpec, IArc3dMarkSpec, ICommonSpec, IPolygonMarkSpec, IPyramid3dMarkSpec, ILinkPathMarkSpec, IRippleMarkSpec,
|
|
22
|
-
export { BoxPlotMark, LineMark, SymbolMark, GroupMark, RuleMark, TextMark, AreaMark, Rect3dMark, RectMark, PathMark, Arc3dMark, ArcMark, ComponentMark, PolygonMark, Pyramid3dMark, LinkPathMark, RippleMark,
|
|
20
|
+
export type { IBoxPlotMarkSpec, ILineMarkSpec, ISymbolMarkSpec, IGroupMarkSpec, IRuleMarkSpec, ITextMarkSpec, IAreaMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IPathMarkSpec, IArcMarkSpec, IArc3dMarkSpec, ICommonSpec, IPolygonMarkSpec, IPyramid3dMarkSpec, ILinkPathMarkSpec, IRippleMarkSpec, ConvertToMarkStyleSpec, ICellMarkSpec } from '../typings/visual';
|
|
21
|
+
export { BoxPlotMark, LineMark, SymbolMark, GroupMark, RuleMark, TextMark, AreaMark, Rect3dMark, RectMark, PathMark, Arc3dMark, ArcMark, ComponentMark, PolygonMark, Pyramid3dMark, LinkPathMark, RippleMark, CellMark, BaseMark };
|
package/esm/mark/index.js
CHANGED
|
@@ -28,8 +28,6 @@ import { LinkPathMark } from "./link-path";
|
|
|
28
28
|
|
|
29
29
|
import { RippleMark } from "./ripple";
|
|
30
30
|
|
|
31
|
-
import { ProgressArcMark } from "./progress-arc";
|
|
32
|
-
|
|
33
31
|
import { CellMark } from "./cell";
|
|
34
32
|
|
|
35
33
|
import { BaseMark } from "./base";
|
|
@@ -38,5 +36,5 @@ import { PolygonMark } from "./polygon/polygon";
|
|
|
38
36
|
|
|
39
37
|
import { Pyramid3dMark } from "./polygon/pyramid-3d";
|
|
40
38
|
|
|
41
|
-
export { BoxPlotMark, LineMark, SymbolMark, GroupMark, RuleMark, TextMark, AreaMark, Rect3dMark, RectMark, PathMark, Arc3dMark, ArcMark, ComponentMark, PolygonMark, Pyramid3dMark, LinkPathMark, RippleMark,
|
|
39
|
+
export { BoxPlotMark, LineMark, SymbolMark, GroupMark, RuleMark, TextMark, AreaMark, Rect3dMark, RectMark, PathMark, Arc3dMark, ArcMark, ComponentMark, PolygonMark, Pyramid3dMark, LinkPathMark, RippleMark, CellMark, BaseMark };
|
|
42
40
|
//# sourceMappingURL=index.js.map
|
package/esm/mark/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mark/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,
|
|
1
|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.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\n/**\n * @description export all mark modules\n */\nimport { BoxPlotMark } from './box-plot';\nimport { LineMark } from './line';\nimport { SymbolMark } from './symbol';\nimport { GroupMark } from './group';\nimport { RuleMark } from './rule';\nimport { TextMark } from './text';\nimport { AreaMark } from './area';\nimport { RectMark } from './rect';\nimport { Rect3dMark } from './rect-3d';\nimport { PathMark } from './path';\nimport { ArcMark } from './arc';\nimport { Arc3dMark } from './arc-3d';\nimport { ComponentMark } from './component';\nimport { LinkPathMark } from './link-path';\nimport { RippleMark } from './ripple';\nimport { CellMark } from './cell';\nimport { BaseMark } from './base';\nimport { PolygonMark } from './polygon/polygon';\nimport { Pyramid3dMark } from './polygon/pyramid-3d';\n\nexport type {\n IBoxPlotMarkSpec,\n ILineMarkSpec,\n ISymbolMarkSpec,\n IGroupMarkSpec,\n IRuleMarkSpec,\n ITextMarkSpec,\n IAreaMarkSpec,\n IRect3dMarkSpec,\n IRectMarkSpec,\n IPathMarkSpec,\n IArcMarkSpec,\n IArc3dMarkSpec,\n ICommonSpec,\n IPolygonMarkSpec,\n IPyramid3dMarkSpec,\n ILinkPathMarkSpec,\n IRippleMarkSpec,\n ConvertToMarkStyleSpec,\n ICellMarkSpec\n} from '../typings/visual';\n\nexport {\n BoxPlotMark,\n LineMark,\n SymbolMark,\n GroupMark,\n RuleMark,\n TextMark,\n AreaMark,\n Rect3dMark,\n RectMark,\n PathMark,\n Arc3dMark,\n ArcMark,\n ComponentMark,\n PolygonMark,\n Pyramid3dMark,\n LinkPathMark,\n RippleMark,\n CellMark,\n BaseMark\n};\n"]}
|
|
@@ -6,8 +6,7 @@ export var MarkTypeEnum;
|
|
|
6
6
|
MarkTypeEnum.rect3d = "rect3d", MarkTypeEnum.image = "image", MarkTypeEnum.path = "path",
|
|
7
7
|
MarkTypeEnum.area = "area", MarkTypeEnum.arc = "arc", MarkTypeEnum.arc3d = "arc3d",
|
|
8
8
|
MarkTypeEnum.polygon = "polygon", MarkTypeEnum.pyramid3d = "pyramid3d", MarkTypeEnum.boxPlot = "boxPlot",
|
|
9
|
-
MarkTypeEnum.linkPath = "linkPath", MarkTypeEnum.
|
|
10
|
-
MarkTypeEnum.
|
|
11
|
-
MarkTypeEnum.label = "label";
|
|
9
|
+
MarkTypeEnum.linkPath = "linkPath", MarkTypeEnum.cell = "cell", MarkTypeEnum.ripple = "ripple",
|
|
10
|
+
MarkTypeEnum.liquid = "liquid", MarkTypeEnum.component = "component", MarkTypeEnum.label = "label";
|
|
12
11
|
}(MarkTypeEnum || (MarkTypeEnum = {}));
|
|
13
12
|
//# sourceMappingURL=type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mark/interface/type.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAkB,
|
|
1
|
+
{"version":3,"sources":["../src/mark/interface/type.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAkB,YAwBjB;AAxBD,WAAkB,YAAY;IAC5B,+BAAe,CAAA;IAEf,iCAAiB,CAAA;IACjB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,2BAAW,CAAA;IACX,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;IAEjB,uCAAuB,CAAA;IACvB,+BAAe,CAAA;AACjB,CAAC,EAxBiB,YAAY,KAAZ,YAAY,QAwB7B","file":"type.js","sourcesContent":["export type MarkType = keyof typeof MarkTypeEnum | string;\n\nexport const enum MarkTypeEnum {\n group = 'group',\n\n symbol = 'symbol',\n rule = 'rule',\n line = 'line',\n text = 'text',\n rect = 'rect',\n rect3d = 'rect3d',\n image = 'image',\n path = 'path',\n area = 'area',\n arc = 'arc',\n arc3d = 'arc3d',\n polygon = 'polygon',\n pyramid3d = 'pyramid3d',\n boxPlot = 'boxPlot',\n linkPath = 'linkPath',\n cell = 'cell',\n ripple = 'ripple',\n liquid = 'liquid',\n\n component = 'component',\n label = 'label'\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BasePlugin } from '../../base/base-plugin';
|
|
2
|
+
import { IChartPlugin, IChartPluginService } from '../interface';
|
|
3
|
+
export declare class FormatterPlugin extends BasePlugin implements IChartPlugin {
|
|
4
|
+
static readonly pluginType: 'chart';
|
|
5
|
+
static readonly specKey = "formatter";
|
|
6
|
+
static readonly type: string;
|
|
7
|
+
readonly type: string;
|
|
8
|
+
private readonly _timeModeFormat;
|
|
9
|
+
protected _spec: {
|
|
10
|
+
timeMode: 'utc' | 'local';
|
|
11
|
+
customFormatter: (specifier: string, text: string | number | string[] | number[], datum: any) => string | string[];
|
|
12
|
+
numericFormatter: (specifier: string, text: string | number | string[] | number[]) => string;
|
|
13
|
+
timeFormatter: (specifier: string, text: string | number | string[] | number[]) => string;
|
|
14
|
+
};
|
|
15
|
+
protected _formatter: (text: string | number | string[] | number[], datum: any, formatter: string | string[]) => string | number | (string | number)[];
|
|
16
|
+
private _timeFormatter;
|
|
17
|
+
private _numericFormatter;
|
|
18
|
+
private _numericSpecifier;
|
|
19
|
+
private _numericFormatterCache;
|
|
20
|
+
private _isNumericFormatterCache;
|
|
21
|
+
constructor();
|
|
22
|
+
onInit(service: IChartPluginService, chartSpec: any): void;
|
|
23
|
+
protected _format(text: string | number | string[] | number[], datum: any, formatter: string | string[]): string | number | (string | number)[];
|
|
24
|
+
protected _formatSingleLine(text: string | number, datum: any, formatter: string): string | number;
|
|
25
|
+
protected _formatSingleText(text: string | number, formatter: string): string | number;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare const registerFormatPlugin: () => void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { isFunction, isArray, TimeUtil, NumberUtil, numberSpecifierReg } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { BasePlugin } from "../../base/base-plugin";
|
|
4
|
+
|
|
5
|
+
import { Factory, registerChartPlugin } from "../../../core";
|
|
6
|
+
|
|
7
|
+
const bracketReg = /\{([^}]+)\}/, bracketGReg = /\{([^}]+)\}/g, semicolonReg = /:/;
|
|
8
|
+
|
|
9
|
+
export class FormatterPlugin extends BasePlugin {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(FormatterPlugin.type), this.type = "formatterPlugin", this._timeModeFormat = {
|
|
12
|
+
utc: TimeUtil.getInstance().timeUTCFormat,
|
|
13
|
+
local: TimeUtil.getInstance().timeFormat
|
|
14
|
+
}, this._formatter = this._format, this._timeFormatter = this._timeModeFormat.local,
|
|
15
|
+
this._numericFormatter = NumberUtil.getInstance().format, this._numericSpecifier = NumberUtil.getInstance().formatter,
|
|
16
|
+
this._numericFormatterCache = new Map, this._isNumericFormatterCache = new Map;
|
|
17
|
+
}
|
|
18
|
+
onInit(service, chartSpec) {
|
|
19
|
+
var _a;
|
|
20
|
+
const {globalInstance: globalInstance} = service;
|
|
21
|
+
if (!globalInstance) return;
|
|
22
|
+
this._spec = null !== (_a = null == chartSpec ? void 0 : chartSpec[FormatterPlugin.specKey]) && void 0 !== _a ? _a : {};
|
|
23
|
+
const {timeMode: timeMode, customFormatter: customFormatter, numericFormatter: numericFormatter, timeFormatter: timeFormatter} = this._spec;
|
|
24
|
+
isFunction(customFormatter) ? this._formatter = customFormatter : (this._formatter = this._format.bind(this),
|
|
25
|
+
isFunction(timeFormatter) ? this._timeFormatter = timeFormatter : timeMode && this._timeModeFormat[timeMode] && (this._timeFormatter = this._timeModeFormat[timeMode]),
|
|
26
|
+
numericFormatter && (this._numericFormatter = numericFormatter, this._numericSpecifier = null,
|
|
27
|
+
this._numericFormatterCache = null)), Factory.registerFormatter(this._formatter);
|
|
28
|
+
}
|
|
29
|
+
_format(text, datum, formatter) {
|
|
30
|
+
return isArray(text) ? text.map(((t, i) => {
|
|
31
|
+
const f = isArray(formatter) ? formatter[i] : formatter;
|
|
32
|
+
return f ? this._formatSingleLine(t, datum, f) : t;
|
|
33
|
+
})) : isArray(formatter) ? formatter.map((f => this._formatSingleLine(text, datum, f))) : this._formatSingleLine(text, datum, formatter);
|
|
34
|
+
}
|
|
35
|
+
_formatSingleLine(text, datum, formatter) {
|
|
36
|
+
let isTemplate;
|
|
37
|
+
if (this._isNumericFormatterCache && (this._isNumericFormatterCache.get(formatter) ? isTemplate = this._isNumericFormatterCache.get(formatter) : (isTemplate = bracketReg.test(formatter),
|
|
38
|
+
this._isNumericFormatterCache.set(formatter, isTemplate))), isTemplate) {
|
|
39
|
+
return formatter.replace(bracketGReg, ((match, key) => {
|
|
40
|
+
if (semicolonReg.test(key)) {
|
|
41
|
+
const parts = key.split(":"), value = datum[parts.shift()], valueFormatter = parts.join(":");
|
|
42
|
+
return this._formatSingleText(value, valueFormatter);
|
|
43
|
+
}
|
|
44
|
+
{
|
|
45
|
+
const value = datum[key.trim()];
|
|
46
|
+
return void 0 !== value ? value : match;
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
return this._formatSingleText(text, formatter);
|
|
51
|
+
}
|
|
52
|
+
_formatSingleText(text, formatter) {
|
|
53
|
+
if (numberSpecifierReg.test(formatter) && this._numericFormatter) {
|
|
54
|
+
let numericFormat;
|
|
55
|
+
return this._numericFormatterCache && this._numericSpecifier ? (this._numericFormatterCache.get(formatter) ? numericFormat = this._numericFormatterCache.get(formatter) : (numericFormat = this._numericSpecifier(formatter),
|
|
56
|
+
this._numericFormatterCache.set(formatter, numericFormat)), numericFormat(Number(text))) : this._numericFormatter(formatter, Number(text));
|
|
57
|
+
}
|
|
58
|
+
return formatter.includes("%") && this._timeFormatter ? this._timeFormatter(formatter, text) : text;
|
|
59
|
+
}
|
|
60
|
+
dispose() {
|
|
61
|
+
this._format = null, this._timeFormatter = null, this._numericFormatter = null,
|
|
62
|
+
this._numericSpecifier = null, this._numericFormatterCache = null, this._isNumericFormatterCache = null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
FormatterPlugin.pluginType = "chart", FormatterPlugin.specKey = "formatter", FormatterPlugin.type = "formatterPlugin";
|
|
67
|
+
|
|
68
|
+
export const registerFormatPlugin = () => {
|
|
69
|
+
registerChartPlugin(FormatterPlugin);
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/formatter/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEjG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,UAAU,GAAG,aAAa,CAAC;AACjC,MAAM,WAAW,GAAG,cAAc,CAAC;AAEnC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,MAAM,OAAO,eAAgB,SAAQ,UAAU;IA8B7C;QACE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAzBrB,SAAI,GAAW,iBAAiB,CAAC;QAEzB,oBAAe,GAAG;YACjC,GAAG,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,aAAa;YACzC,KAAK,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,UAAU;SACzC,CAAC;QASQ,eAAU,GAAG,IAAI,CAAC,OAAO,CAAC;QAE5B,mBAAc,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;QAC5C,sBAAiB,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC;QAGpD,sBAAiB,GAAG,UAAU,CAAC,WAAW,EAAE,C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,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;aACpC;YACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SACxD;aAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE;YACzD,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;SAC7C;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC;IACvC,CAAC;;AArIe,0BAAU,GAAY,OAAO,CAAC;AAE9B,uBAAO,GAAG,WAAW,CAAC;AAEtB,oBAAI,GAAW,iBAAiB,CAAC;AAoInD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,mBAAmB,CAAC,eAAe,CAAC,CAAC;AACvC,CAAC,CAAC","file":"formatter.js","sourcesContent":["import { isFunction, isArray, TimeUtil, NumberUtil, numberSpecifierReg } from '@visactor/vutils';\n\nimport { BasePlugin } from '../../base/base-plugin';\n\nimport { IChartPlugin, IChartPluginService } from '../interface';\nimport { Factory, registerChartPlugin } from '../../../core';\n\nconst bracketReg = /\\{([^}]+)\\}/;\nconst bracketGReg = /\\{([^}]+)\\}/g;\n\nconst semicolonReg = /:/;\n\nexport class FormatterPlugin extends BasePlugin implements IChartPlugin {\n static readonly pluginType: 'chart' = 'chart';\n\n static readonly specKey = 'formatter';\n\n static readonly type: string = 'formatterPlugin';\n readonly type: string = 'formatterPlugin';\n\n private readonly _timeModeFormat = {\n utc: TimeUtil.getInstance().timeUTCFormat,\n local: TimeUtil.getInstance().timeFormat\n };\n\n protected _spec: {\n timeMode: 'utc' | 'local';\n customFormatter: (specifier: string, text: string | number | string[] | number[], datum: any) => string | string[];\n numericFormatter: (specifier: string, text: string | number | string[] | number[]) => string;\n timeFormatter: (specifier: string, text: string | number | string[] | number[]) => string;\n };\n\n protected _formatter = this._format;\n\n private _timeFormatter = this._timeModeFormat.local;\n private _numericFormatter = NumberUtil.getInstance().format;\n\n // used for optimize performance,avoiding repeatedly parsing same format template string,\n private _numericSpecifier = NumberUtil.getInstance().formatter;\n private _numericFormatterCache = new Map<string, any>();\n private _isNumericFormatterCache = new Map<string, boolean>();\n\n constructor() {\n super(FormatterPlugin.type);\n }\n\n onInit(service: IChartPluginService, chartSpec: any) {\n const { globalInstance } = service;\n if (!globalInstance) {\n return;\n }\n this._spec = chartSpec?.[FormatterPlugin.specKey] ?? {};\n const { timeMode, customFormatter, numericFormatter, timeFormatter } = this._spec;\n\n if (isFunction(customFormatter)) {\n this._formatter = customFormatter;\n } else {\n this._formatter = this._format.bind(this);\n if (isFunction(timeFormatter)) {\n this._timeFormatter = timeFormatter;\n } else if (timeMode && this._timeModeFormat[timeMode]) {\n this._timeFormatter = this._timeModeFormat[timeMode];\n }\n\n if (numericFormatter) {\n this._numericFormatter = numericFormatter;\n this._numericSpecifier = null;\n this._numericFormatterCache = null;\n }\n }\n Factory.registerFormatter(this._formatter);\n }\n\n protected _format(text: string | number | string[] | number[], datum: any, formatter: string | string[]) {\n if (isArray(text)) {\n return text.map((t, i) => {\n const f = isArray(formatter) ? formatter[i] : formatter;\n return f ? this._formatSingleLine(t, datum, f) : t;\n });\n }\n\n if (isArray(formatter)) {\n return formatter.map(f => this._formatSingleLine(text, datum, f));\n } else {\n return this._formatSingleLine(text, datum, formatter);\n }\n }\n\n protected _formatSingleLine(text: string | number, datum: any, formatter: string) {\n let isTemplate;\n if (this._isNumericFormatterCache) {\n if (this._isNumericFormatterCache.get(formatter)) {\n isTemplate = this._isNumericFormatterCache.get(formatter);\n } else {\n isTemplate = bracketReg.test(formatter);\n this._isNumericFormatterCache.set(formatter, isTemplate);\n }\n }\n if (isTemplate) {\n const result = formatter.replace(bracketGReg, (match, key) => {\n const hasFormatter = semicolonReg.test(key);\n if (!hasFormatter) {\n const value = datum[key.trim()];\n return typeof value !== 'undefined' ? value : match;\n } else {\n const parts = key.split(':');\n const value = datum[parts.shift()];\n const valueFormatter = parts.join(':');\n return this._formatSingleText(value, valueFormatter);\n }\n });\n return result;\n } else {\n return this._formatSingleText(text, formatter);\n }\n }\n\n protected _formatSingleText(text: string | number, formatter: string): string | number {\n const isNumeric = numberSpecifierReg.test(formatter);\n if (isNumeric && this._numericFormatter) {\n // 内置的 formatter 逻辑,可以进行缓存性能优化\n let numericFormat;\n if (this._numericFormatterCache && this._numericSpecifier) {\n if (this._numericFormatterCache.get(formatter)) {\n numericFormat = this._numericFormatterCache.get(formatter);\n } else {\n numericFormat = this._numericSpecifier(formatter) as any;\n this._numericFormatterCache.set(formatter, numericFormat);\n }\n return numericFormat(Number(text));\n }\n return this._numericFormatter(formatter, Number(text));\n } else if (formatter.includes('%') && this._timeFormatter) {\n return this._timeFormatter(formatter, text);\n } else {\n return text;\n }\n }\n\n dispose() {\n this._format = null;\n this._timeFormatter = null;\n this._numericFormatter = null;\n this._numericSpecifier = null;\n this._numericFormatterCache = null;\n this._isNumericFormatterCache = null;\n }\n}\n\nexport const registerFormatPlugin = () => {\n registerChartPlugin(FormatterPlugin);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './formatter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/formatter/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["export * from './formatter';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/components/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/plugin/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC","file":"index.js","sourcesContent":["export * from './axis-sync';\nexport * from './tooltip-handler';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Options } from './constants';
|
|
2
2
|
import type { Maybe, ILayoutPoint, RenderMode } from '../../../typings';
|
|
3
|
-
import type { TooltipData,
|
|
3
|
+
import type { TooltipData, ITooltipActual, TooltipActiveType, ITooltipHandler, ITooltipPattern, ITooltipPositionActual } from '../../../typings/tooltip';
|
|
4
4
|
import type { IGroup } from '@visactor/vrender-core';
|
|
5
5
|
import type { Compiler } from '../../../compile/compiler';
|
|
6
6
|
import type { IContainerSize } from '@visactor/vrender-components';
|
|
@@ -26,7 +26,7 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
|
|
|
26
26
|
protected _chartContainer: Maybe<HTMLElement>;
|
|
27
27
|
protected _compiler: Compiler;
|
|
28
28
|
protected _cacheViewSpec: ITooltipSpec | undefined;
|
|
29
|
-
protected _cacheActualTooltip:
|
|
29
|
+
protected _cacheActualTooltip: ITooltipActual | undefined;
|
|
30
30
|
protected _isTooltipPaused: boolean;
|
|
31
31
|
protected _isPointerEscaped: boolean;
|
|
32
32
|
protected _cachePointerTimer: number;
|
|
@@ -46,13 +46,13 @@ export declare abstract class BaseTooltipHandler extends BasePlugin implements I
|
|
|
46
46
|
protected _clearAllCache(): void;
|
|
47
47
|
protected _clearCacheOfContent(): void;
|
|
48
48
|
protected _clearCacheOfPosition(): void;
|
|
49
|
-
protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?:
|
|
49
|
+
protected abstract _updateTooltip(visible: boolean, params: TooltipHandlerParams, domData?: ITooltipActual): void;
|
|
50
50
|
protected abstract _removeTooltip(): void;
|
|
51
51
|
protected _throttle(callback: any): (...args: unknown[]) => unknown;
|
|
52
52
|
protected _getDefaultOption(): Options;
|
|
53
|
-
protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) =>
|
|
54
|
-
protected _getActualTooltipPosition: (actualTooltip:
|
|
55
|
-
protected _getTooltipBoxSize(actualTooltip:
|
|
53
|
+
protected _getActualTooltipContent: (pattern: ITooltipPattern, data: TooltipData, params: TooltipHandlerParams) => ITooltipActual;
|
|
54
|
+
protected _getActualTooltipPosition: (actualTooltip: ITooltipActual, params: TooltipHandlerParams, tooltipBoxSize: IContainerSize | undefined) => ITooltipPositionActual;
|
|
55
|
+
protected _getTooltipBoxSize(actualTooltip: ITooltipActual, changePositionOnly: boolean): IContainerSize | undefined;
|
|
56
56
|
protected _getPointerPositionRelativeToTooltipParent(params: TooltipHandlerParams): {
|
|
57
57
|
x: any;
|
|
58
58
|
y: any;
|
|
@@ -6,18 +6,20 @@ import { isTrueBrowser } from "../../../util/env";
|
|
|
6
6
|
|
|
7
7
|
import { getTooltipPatternValue, getScale } from "./utils/common";
|
|
8
8
|
|
|
9
|
-
import { getActualTooltipPositionValue, getHorizontalPositionType, getVerticalPositionType } from "./utils/position";
|
|
9
|
+
import { getActualTooltipPositionValue, getCartesianCrosshairRect, getHorizontalPositionType, getVerticalPositionType, isFixedTooltipPositionPattern, isGlobalTooltipPositionPattern } from "./utils/position";
|
|
10
10
|
|
|
11
11
|
import { getShowContent } from "./utils/compose";
|
|
12
12
|
|
|
13
13
|
import { getTooltipSpecForShow } from "./utils/get-spec";
|
|
14
14
|
|
|
15
|
-
import { isNumber, isObject, isValidNumber, isValid, throttle, isNil, polygonContainPoint, pointInRect } from "@visactor/vutils";
|
|
15
|
+
import { isNumber, isObject, isValidNumber, isValid, throttle, isNil, polygonContainPoint, pointInRect, isFunction } from "@visactor/vutils";
|
|
16
16
|
|
|
17
17
|
import { getTooltipAttributes } from "./utils/attribute";
|
|
18
18
|
|
|
19
19
|
import { BasePlugin } from "../../base/base-plugin";
|
|
20
20
|
|
|
21
|
+
import { getFirstSeries } from "../../../util";
|
|
22
|
+
|
|
21
23
|
export class BaseTooltipHandler extends BasePlugin {
|
|
22
24
|
constructor() {
|
|
23
25
|
super(...arguments), this._visible = !0, this._attributes = null, this._isReleased = !1,
|
|
@@ -79,13 +81,15 @@ export class BaseTooltipHandler extends BasePlugin {
|
|
|
79
81
|
data: data
|
|
80
82
|
});
|
|
81
83
|
}, this._getActualTooltipPosition = (actualTooltip, params, tooltipBoxSize) => {
|
|
82
|
-
var _a, _b, _c, _d, _e;
|
|
83
|
-
const event = params.event, invalidPosition = {
|
|
84
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
85
|
+
const event = params.event, firstDimensionInfo = null === (_a = params.dimensionInfo) || void 0 === _a ? void 0 : _a[0], invalidPosition = {
|
|
84
86
|
x: 1 / 0,
|
|
85
87
|
y: 1 / 0
|
|
86
|
-
}
|
|
88
|
+
};
|
|
89
|
+
let {offsetX: offsetX, offsetY: offsetY} = this._option;
|
|
90
|
+
const tooltipSpec = this._cacheViewSpec;
|
|
87
91
|
if (!tooltipSpec) return this._cacheTooltipPosition = void 0, invalidPosition;
|
|
88
|
-
const {activeType: activeType, data: data} = actualTooltip, pattern = tooltipSpec[activeType], position = getTooltipPatternValue(pattern.position, data, params), positionMode = getTooltipPatternValue(pattern.positionMode, data, params), tooltipParentElement = this._getParentElement(tooltipSpec), {width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0} = null != tooltipBoxSize ? tooltipBoxSize : {}, isCanvas = "canvas" === tooltipSpec.renderMode, canvasRect = null === (
|
|
92
|
+
const {activeType: activeType, data: data} = actualTooltip, pattern = tooltipSpec[activeType], position = getTooltipPatternValue(pattern.position, data, params), positionMode = null !== (_b = getTooltipPatternValue(pattern.positionMode, data, params)) && void 0 !== _b ? _b : "mark" === activeType ? "mark" : "pointer", tooltipParentElement = this._getParentElement(tooltipSpec), {width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0} = null != tooltipBoxSize ? tooltipBoxSize : {}, isCanvas = "canvas" === tooltipSpec.renderMode, canvasRect = null === (_c = null == params ? void 0 : params.chart) || void 0 === _c ? void 0 : _c.getCanvasRect(), canvasWidth = null !== (_d = null == canvasRect ? void 0 : canvasRect.width) && void 0 !== _d ? _d : DEFAULT_CHART_WIDTH, canvasHeight = null !== (_e = null == canvasRect ? void 0 : canvasRect.height) && void 0 !== _e ? _e : DEFAULT_CHART_HEIGHT;
|
|
89
93
|
let isFixedPosition = !1;
|
|
90
94
|
const containerSize = {
|
|
91
95
|
width: 0,
|
|
@@ -101,8 +105,8 @@ export class BaseTooltipHandler extends BasePlugin {
|
|
|
101
105
|
if (isTrueBrowser(this._env) && !tooltipSpec.confine) {
|
|
102
106
|
if (containerSize.width = window.innerWidth, containerSize.height = window.innerHeight,
|
|
103
107
|
!isCanvas) {
|
|
104
|
-
tooltipParentElementRect = null !== (
|
|
105
|
-
const chartElement = null !== (
|
|
108
|
+
tooltipParentElementRect = null !== (_f = null == tooltipParentElement ? void 0 : tooltipParentElement.getBoundingClientRect()) && void 0 !== _f ? _f : invalidPosition;
|
|
109
|
+
const chartElement = null !== (_g = this._compiler.getCanvas()) && void 0 !== _g ? _g : this._chartContainer, chartElementRect = null == chartElement ? void 0 : chartElement.getBoundingClientRect();
|
|
106
110
|
relativePosOffset = {
|
|
107
111
|
x: chartElementRect.x - tooltipParentElementRect.x,
|
|
108
112
|
y: chartElementRect.y - tooltipParentElementRect.y
|
|
@@ -110,95 +114,150 @@ export class BaseTooltipHandler extends BasePlugin {
|
|
|
110
114
|
}
|
|
111
115
|
} else containerSize.width = canvasWidth, containerSize.height = canvasHeight;
|
|
112
116
|
const tooltipSizeScale = tooltipParentElementScale / chartElementScale;
|
|
113
|
-
let left, top, right, bottom,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
117
|
+
let left, top, right, bottom, pointerFixedPositionX = position, pointerFixedPositionY = position;
|
|
118
|
+
const processCartesianFixedPositionX = ({orient: orient, mode: mode, offset: offset}) => {
|
|
119
|
+
var _a;
|
|
120
|
+
let x1, x2;
|
|
121
|
+
const model = params.model, startPoint = null == model ? void 0 : model.getLayoutStartPoint();
|
|
122
|
+
if (offsetX = null != offset ? offset : offsetX, "mark" === mode) {
|
|
123
|
+
isFixedPosition = !0;
|
|
124
|
+
const element = params.item, bounds = null == element ? void 0 : element.getBounds();
|
|
125
|
+
bounds && startPoint && (x1 = bounds.x1 + startPoint.x, x2 = bounds.x2 + startPoint.x);
|
|
126
|
+
} else if ("crosshair" === mode && "cartesian" === (null === (_a = null == firstDimensionInfo ? void 0 : firstDimensionInfo.axis) || void 0 === _a ? void 0 : _a.getCoordinateType())) {
|
|
127
|
+
isFixedPosition = !0;
|
|
128
|
+
const rect = getCartesianCrosshairRect(params.dimensionInfo, getFirstSeries(this._component.getRegions(), "cartesian"), startPoint);
|
|
129
|
+
rect && (x1 = rect.start.x, x2 = rect.end.x);
|
|
130
|
+
} else pointerFixedPositionX = orient;
|
|
131
|
+
if (isFixedPosition) switch (getHorizontalPositionType(orient)) {
|
|
132
|
+
case "left":
|
|
133
|
+
left = x1 - tooltipBoxWidth * tooltipSizeScale - offsetX;
|
|
134
|
+
break;
|
|
128
135
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
case "right":
|
|
137
|
+
left = x2 + offsetX;
|
|
138
|
+
break;
|
|
132
139
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
switch (getVerticalPositionType(position)) {
|
|
137
|
-
case "top":
|
|
138
|
-
top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;
|
|
139
|
-
break;
|
|
140
|
+
case "center":
|
|
141
|
+
left = (x1 + x2) / 2 - tooltipBoxWidth * tooltipSizeScale / 2;
|
|
142
|
+
break;
|
|
140
143
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
case "centerLeft":
|
|
145
|
+
left = (x1 + x2) / 2 - tooltipBoxWidth * tooltipSizeScale - offsetX;
|
|
146
|
+
break;
|
|
144
147
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
+
case "centerRight":
|
|
149
|
+
left = (x1 + x2) / 2 + offsetX;
|
|
148
150
|
}
|
|
149
|
-
}
|
|
151
|
+
}, processCartesianFixedPositionY = ({orient: orient, mode: mode, offset: offset}) => {
|
|
152
|
+
var _a;
|
|
153
|
+
let y1, y2;
|
|
154
|
+
const model = params.model, startPoint = null == model ? void 0 : model.getLayoutStartPoint();
|
|
155
|
+
if (offsetY = null != offset ? offset : offsetY, "mark" === mode) {
|
|
156
|
+
isFixedPosition = !0;
|
|
157
|
+
const element = params.item, bounds = null == element ? void 0 : element.getBounds();
|
|
158
|
+
bounds && startPoint && (y1 = bounds.y1 + startPoint.y, y2 = bounds.y2 + startPoint.y);
|
|
159
|
+
} else if ("crosshair" === mode && "cartesian" === (null === (_a = null == firstDimensionInfo ? void 0 : firstDimensionInfo.axis) || void 0 === _a ? void 0 : _a.getCoordinateType())) {
|
|
160
|
+
isFixedPosition = !0;
|
|
161
|
+
const rect = getCartesianCrosshairRect(params.dimensionInfo, getFirstSeries(this._component.getRegions(), "cartesian"), startPoint);
|
|
162
|
+
rect && (y1 = rect.start.y, y2 = rect.end.y);
|
|
163
|
+
} else pointerFixedPositionY = orient;
|
|
164
|
+
if (isFixedPosition) switch (getVerticalPositionType(orient)) {
|
|
165
|
+
case "top":
|
|
166
|
+
top = y1 - tooltipBoxHeight * tooltipSizeScale - offsetY;
|
|
167
|
+
break;
|
|
168
|
+
|
|
169
|
+
case "bottom":
|
|
170
|
+
top = y2 + offsetY;
|
|
171
|
+
break;
|
|
172
|
+
|
|
173
|
+
case "center":
|
|
174
|
+
top = (y1 + y2) / 2 - tooltipBoxHeight * tooltipSizeScale / 2;
|
|
175
|
+
break;
|
|
176
|
+
|
|
177
|
+
case "centerTop":
|
|
178
|
+
top = (y1 + y2) / 2 - tooltipBoxHeight * tooltipSizeScale - offsetY;
|
|
179
|
+
break;
|
|
180
|
+
|
|
181
|
+
case "centerBottom":
|
|
182
|
+
top = (y1 + y2) / 2 + offsetY;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
if (isObject(position)) {
|
|
186
|
+
if (isGlobalTooltipPositionPattern(position)) {
|
|
187
|
+
const {left: posLeft, right: posRight, top: posTop, bottom: posBottom} = position;
|
|
188
|
+
left = getActualTooltipPositionValue(posLeft, event), top = getActualTooltipPositionValue(posTop, event),
|
|
189
|
+
right = getActualTooltipPositionValue(posRight, event), bottom = getActualTooltipPositionValue(posBottom, event);
|
|
190
|
+
} else if (isFixedTooltipPositionPattern(position)) {
|
|
191
|
+
const {x: x, y: y} = position;
|
|
192
|
+
isNumber(x) || isFunction(x) ? left = getActualTooltipPositionValue(x, event) : processCartesianFixedPositionX(x),
|
|
193
|
+
isNumber(y) || isFunction(y) ? top = getActualTooltipPositionValue(y, event) : processCartesianFixedPositionY(y);
|
|
194
|
+
}
|
|
195
|
+
} else isValid(position) && (processCartesianFixedPositionX({
|
|
196
|
+
orient: position,
|
|
197
|
+
mode: positionMode
|
|
198
|
+
}), processCartesianFixedPositionY({
|
|
199
|
+
orient: position,
|
|
200
|
+
mode: positionMode
|
|
201
|
+
}));
|
|
202
|
+
let x, y;
|
|
150
203
|
const {canvasX: canvasX, canvasY: canvasY} = event;
|
|
151
204
|
if (isValidNumber(left)) x = left; else if (isValidNumber(right)) x = canvasWidth - tooltipBoxWidth * tooltipSizeScale - right; else {
|
|
152
205
|
const x0 = canvasX;
|
|
153
|
-
switch (getHorizontalPositionType(
|
|
154
|
-
case "
|
|
206
|
+
switch (getHorizontalPositionType(pointerFixedPositionX, "right")) {
|
|
207
|
+
case "center":
|
|
155
208
|
x = x0 - tooltipBoxWidth * tooltipSizeScale / 2;
|
|
156
209
|
break;
|
|
157
210
|
|
|
158
211
|
case "left":
|
|
212
|
+
case "centerLeft":
|
|
159
213
|
x = x0 - tooltipBoxWidth * tooltipSizeScale - offsetX;
|
|
160
214
|
break;
|
|
161
215
|
|
|
162
216
|
case "right":
|
|
217
|
+
case "centerRight":
|
|
163
218
|
x = x0 + offsetX;
|
|
164
219
|
}
|
|
165
220
|
}
|
|
166
221
|
if (isValidNumber(top)) y = top; else if (isValidNumber(bottom)) y = canvasHeight - tooltipBoxHeight * tooltipSizeScale - bottom; else {
|
|
167
222
|
const y0 = canvasY;
|
|
168
|
-
switch (getVerticalPositionType(
|
|
169
|
-
case "
|
|
223
|
+
switch (getVerticalPositionType(pointerFixedPositionY, "bottom")) {
|
|
224
|
+
case "center":
|
|
170
225
|
y = y0 - tooltipBoxHeight * tooltipSizeScale / 2;
|
|
171
226
|
break;
|
|
172
227
|
|
|
173
228
|
case "top":
|
|
229
|
+
case "centerTop":
|
|
174
230
|
y = y0 - tooltipBoxHeight * tooltipSizeScale - offsetY;
|
|
175
231
|
break;
|
|
176
232
|
|
|
177
233
|
case "bottom":
|
|
234
|
+
case "centerBottom":
|
|
178
235
|
y = y0 + offsetY;
|
|
179
236
|
}
|
|
180
237
|
}
|
|
181
238
|
x *= chartElementScale, y *= chartElementScale, isTrueBrowser(this._env) && (x += relativePosOffset.x,
|
|
182
239
|
y += relativePosOffset.y), x /= tooltipParentElementScale, y /= tooltipParentElementScale;
|
|
183
240
|
const {width: containerWidth, height: containerHeight} = containerSize, isLeftOut = () => x * tooltipParentElementScale + tooltipParentElementRect.x < 0, isRightOut = () => (x + tooltipBoxWidth) * tooltipParentElementScale + tooltipParentElementRect.x > containerWidth, isTopOut = () => y * tooltipParentElementScale + tooltipParentElementRect.y < 0, isBottomOut = () => (y + tooltipBoxHeight) * tooltipParentElementScale + tooltipParentElementRect.y > containerHeight, detectLeftFirst = () => {
|
|
184
|
-
isLeftOut() && (isFixedPosition ? x = -tooltipParentElementRect.x / tooltipParentElementScale : "
|
|
241
|
+
isLeftOut() && (isFixedPosition ? x = -tooltipParentElementRect.x / tooltipParentElementScale : "center" === getHorizontalPositionType(position, "right") ? x += offsetX + tooltipBoxWidth / 2 : x += 2 * offsetX + tooltipBoxWidth);
|
|
185
242
|
}, detectLeftLast = () => {
|
|
186
243
|
isLeftOut() && (x = -tooltipParentElementRect.x / tooltipParentElementScale);
|
|
187
244
|
}, detectRightFirst = () => {
|
|
188
|
-
isRightOut() && (isFixedPosition ? x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth : "
|
|
245
|
+
isRightOut() && (isFixedPosition ? x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth : "center" === getHorizontalPositionType(position, "right") ? x -= offsetX + tooltipBoxWidth / 2 : x -= 2 * offsetX + tooltipBoxWidth);
|
|
189
246
|
}, detectRightLast = () => {
|
|
190
247
|
isRightOut() && (x = (containerWidth - tooltipParentElementRect.x) / tooltipParentElementScale - tooltipBoxWidth);
|
|
191
248
|
}, detectTopFirst = () => {
|
|
192
|
-
isTopOut() && (isFixedPosition ? y = -tooltipParentElementRect.y / tooltipParentElementScale : "
|
|
249
|
+
isTopOut() && (isFixedPosition ? y = -tooltipParentElementRect.y / tooltipParentElementScale : "center" === getVerticalPositionType(position, "bottom") ? y += offsetY + tooltipBoxHeight / 2 : y += 2 * offsetY + tooltipBoxHeight);
|
|
193
250
|
}, detectTopLast = () => {
|
|
194
251
|
isTopOut() && (y = 0 - tooltipParentElementRect.y / tooltipParentElementScale);
|
|
195
252
|
}, detectBottomFirst = () => {
|
|
196
|
-
isBottomOut() && (isFixedPosition ? y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight : "
|
|
253
|
+
isBottomOut() && (isFixedPosition ? y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight : "center" === getVerticalPositionType(position, "bottom") ? y -= offsetY + tooltipBoxHeight / 2 : y -= 2 * offsetY + tooltipBoxHeight);
|
|
197
254
|
}, detectBottomLast = () => {
|
|
198
255
|
isBottomOut() && (y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight);
|
|
199
256
|
};
|
|
200
257
|
switch (getHorizontalPositionType(position, "right")) {
|
|
201
|
-
case "
|
|
258
|
+
case "center":
|
|
259
|
+
case "centerLeft":
|
|
260
|
+
case "centerRight":
|
|
202
261
|
isLeftOut() ? (detectLeftFirst(), detectRightLast()) : (detectRightFirst(), detectLeftLast());
|
|
203
262
|
break;
|
|
204
263
|
|
|
@@ -210,7 +269,9 @@ export class BaseTooltipHandler extends BasePlugin {
|
|
|
210
269
|
detectRightFirst(), detectLeftLast();
|
|
211
270
|
}
|
|
212
271
|
switch (getVerticalPositionType(position, "bottom")) {
|
|
213
|
-
case "
|
|
272
|
+
case "center":
|
|
273
|
+
case "centerTop":
|
|
274
|
+
case "centerBottom":
|
|
214
275
|
isTopOut() ? (detectTopFirst(), detectBottomLast()) : (detectBottomFirst(), detectTopLast());
|
|
215
276
|
break;
|
|
216
277
|
|