@visactor/vchart 1.6.2 → 1.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +2505 -1615
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/config.js +1 -0
- package/cjs/animation/config.js.map +1 -1
- package/cjs/animation/utils.d.ts +2 -2
- package/cjs/animation/utils.js +13 -13
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/chart/base-chart.d.ts +4 -4
- package/cjs/chart/base-chart.js +33 -22
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +2 -2
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/stack.js +1 -2
- package/cjs/compile/compilable-base.js +2 -1
- package/cjs/compile/compiler.js +1 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.d.ts +1 -2
- package/cjs/compile/mark/compilable-mark.js +4 -7
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -0
- package/cjs/component/axis/base-axis.js +2 -2
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +12 -9
- package/cjs/component/axis/cartesian/axis.js +46 -55
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/theme.d.ts +1 -1
- package/cjs/component/axis/cartesian/interface/theme.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +3 -4
- package/cjs/component/axis/polar/axis.js +7 -12
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/base/base-component.d.ts +12 -4
- package/cjs/component/base/base-component.js +20 -10
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +3 -4
- package/cjs/component/brush/brush.js +3 -5
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +4 -5
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/cartesian.d.ts +2 -0
- package/cjs/component/crosshair/cartesian.js +6 -8
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/interface/spec.d.ts +1 -1
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/crosshair/polar.d.ts +2 -0
- package/cjs/component/crosshair/polar.js +5 -8
- package/cjs/component/crosshair/polar.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +3 -4
- package/cjs/component/custom-mark/custom-mark.js +1 -2
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +6 -8
- package/cjs/component/data-zoom/data-filter-base-component.js +26 -25
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +12 -15
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/interface.d.ts +1 -0
- package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/interface.d.ts +1 -1
- package/cjs/component/data-zoom/scroll-bar/interface.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +6 -9
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.d.ts +4 -3
- package/cjs/component/geo/geo-coordinate.js +4 -4
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/indicator/indicator.d.ts +2 -4
- package/cjs/component/indicator/indicator.js +3 -4
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/indicator/interface.d.ts +1 -1
- package/cjs/component/indicator/interface.js.map +1 -1
- package/cjs/component/interface/common.d.ts +3 -3
- package/cjs/component/interface/common.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +3 -4
- package/cjs/component/label/base-label.js +1 -2
- package/cjs/component/label/base-label.js.map +1 -1
- package/cjs/component/label/label.d.ts +3 -3
- package/cjs/component/label/label.js +2 -3
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/totalLabel.d.ts +3 -3
- package/cjs/component/label/totalLabel.js +2 -3
- package/cjs/component/label/totalLabel.js.map +1 -1
- package/cjs/component/legend/base-legend.d.ts +6 -9
- package/cjs/component/legend/base-legend.js +3 -9
- package/cjs/component/legend/base-legend.js.map +1 -1
- package/cjs/component/legend/continuous/legend.d.ts +4 -1
- package/cjs/component/legend/continuous/legend.js +7 -7
- package/cjs/component/legend/continuous/legend.js.map +1 -1
- package/cjs/component/legend/discrete/legend.d.ts +4 -1
- package/cjs/component/legend/discrete/legend.js +6 -7
- package/cjs/component/legend/discrete/legend.js.map +1 -1
- package/cjs/component/legend/discrete/util.d.ts +1 -1
- package/cjs/component/legend/discrete/util.js.map +1 -1
- package/cjs/component/legend/util.d.ts +1 -1
- package/cjs/component/map-label/component.d.ts +2 -4
- package/cjs/component/map-label/component.js +1 -2
- package/cjs/component/map-label/component.js.map +1 -1
- package/cjs/component/marker/base-marker.d.ts +2 -3
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +1 -1
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.d.ts +1 -3
- package/cjs/component/marker/mark-area/mark-area.js +6 -10
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.d.ts +1 -3
- package/cjs/component/marker/mark-line/mark-line.js +8 -12
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.d.ts +1 -3
- package/cjs/component/marker/mark-point/mark-point.js +6 -10
- package/cjs/component/marker/mark-point/mark-point.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/player.d.ts +6 -7
- package/cjs/component/player/player.js +4 -7
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/title/interface/theme.d.ts +1 -1
- package/cjs/component/title/interface/theme.js.map +1 -1
- package/cjs/component/title/title.d.ts +6 -9
- package/cjs/component/title/title.js +13 -24
- 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/model/content-column-model.js +12 -10
- package/cjs/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/shape-model.d.ts +1 -0
- package/cjs/component/tooltip/handler/dom/model/shape-model.js +4 -4
- package/cjs/component/tooltip/handler/dom/model/shape-model.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +4 -3
- package/cjs/component/tooltip/tooltip.js +5 -8
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/layout.d.ts +1 -0
- package/cjs/constant/layout.js +2 -2
- package/cjs/constant/layout.js.map +1 -1
- package/cjs/core/factory.d.ts +5 -2
- package/cjs/core/factory.js +6 -3
- package/cjs/core/factory.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +1 -0
- package/cjs/core/vchart.js +11 -8
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/event/events/base.d.ts +16 -0
- package/cjs/event/events/base.js +23 -0
- package/cjs/event/events/base.js.map +1 -0
- package/cjs/event/events/dimension/util/cartesian.d.ts +1 -1
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/events/dimension/util/common.d.ts +1 -2
- package/cjs/event/events/dimension/util/common.js +1 -1
- package/cjs/event/events/dimension/util/common.js.map +1 -1
- package/cjs/event/events/dimension/util/polar.d.ts +1 -1
- package/cjs/event/events/dimension/util/polar.js.map +1 -1
- package/cjs/event/interface.d.ts +1 -1
- package/cjs/event/interface.js.map +1 -1
- package/cjs/interaction/zoom/zoomable.d.ts +1 -0
- package/cjs/interaction/zoom/zoomable.js +6 -5
- package/cjs/interaction/zoom/zoomable.js.map +1 -1
- package/cjs/layout/base-layout.d.ts +3 -5
- package/cjs/layout/base-layout.js +8 -8
- package/cjs/layout/base-layout.js.map +1 -1
- package/cjs/layout/grid-layout/grid-layout.d.ts +1 -2
- package/cjs/layout/grid-layout/grid-layout.js +6 -4
- package/cjs/layout/grid-layout/grid-layout.js.map +1 -1
- package/cjs/layout/interface.d.ts +74 -6
- package/cjs/layout/interface.js.map +1 -1
- package/cjs/{model → layout}/layout-item.d.ts +35 -23
- package/cjs/{model → layout}/layout-item.js +100 -64
- package/cjs/layout/layout-item.js.map +1 -0
- package/cjs/layout/layout3d/index.d.ts +2 -4
- package/cjs/layout/layout3d/index.js +6 -6
- package/cjs/layout/layout3d/index.js.map +1 -1
- package/cjs/layout/util.d.ts +1 -1
- package/cjs/layout/util.js.map +1 -1
- package/cjs/mark/arc.js +2 -2
- 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 +32 -72
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/model/base-model.d.ts +10 -6
- package/cjs/model/base-model.js +23 -21
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +20 -82
- package/cjs/model/interface.js.map +1 -1
- package/cjs/model/layout-model.d.ts +39 -0
- package/cjs/model/layout-model.js +75 -0
- package/cjs/model/layout-model.js.map +1 -0
- package/cjs/region/interface.d.ts +3 -2
- package/cjs/region/interface.js.map +1 -1
- package/cjs/region/region.d.ts +12 -7
- package/cjs/region/region.js +18 -10
- package/cjs/region/region.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +10 -4
- package/cjs/series/base/base-series.js +27 -10
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/cartesian/cartesian.js +6 -3
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/funnel/interface.d.ts +1 -2
- package/cjs/series/funnel/interface.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/mixin/line-mixin.d.ts +2 -1
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +2 -1
- package/cjs/series/sankey/sankey.js +23 -28
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/theme/builtin/common-mobile/component/axis/band-axis.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/axis/band-axis.js +22 -0
- package/cjs/theme/builtin/common-mobile/component/axis/band-axis.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +3 -0
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.js +36 -0
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/axis/common-axis.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/axis/common-axis.js +42 -0
- package/cjs/theme/builtin/common-mobile/component/axis/common-axis.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/axis/linear-axis.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/axis/linear-axis.js +22 -0
- package/cjs/theme/builtin/common-mobile/component/axis/linear-axis.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/axis/polar-axis.d.ts +3 -0
- package/cjs/theme/builtin/common-mobile/component/axis/polar-axis.js +25 -0
- package/cjs/theme/builtin/common-mobile/component/axis/polar-axis.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/crosshair.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/crosshair.js +39 -0
- package/cjs/theme/builtin/common-mobile/component/crosshair.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/data-zoom.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/data-zoom.js +40 -0
- package/cjs/theme/builtin/common-mobile/component/data-zoom.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/index.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/index.js +33 -0
- package/cjs/theme/builtin/common-mobile/component/index.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/indicator.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/indicator.js +23 -0
- package/cjs/theme/builtin/common-mobile/component/indicator.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/legend/color-legend.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/legend/color-legend.js +23 -0
- package/cjs/theme/builtin/common-mobile/component/legend/color-legend.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/legend/continuous.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/legend/continuous.js +44 -0
- package/cjs/theme/builtin/common-mobile/component/legend/continuous.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/legend/discrete-legend.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/legend/discrete-legend.js +39 -0
- package/cjs/theme/builtin/common-mobile/component/legend/discrete-legend.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/legend/size-legend.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/legend/size-legend.js +23 -0
- package/cjs/theme/builtin/common-mobile/component/legend/size-legend.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/map-label.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/map-label.js +39 -0
- package/cjs/theme/builtin/common-mobile/component/map-label.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/mark-area.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/mark-area.js +24 -0
- package/cjs/theme/builtin/common-mobile/component/mark-area.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/mark-line.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/mark-line.js +33 -0
- package/cjs/theme/builtin/common-mobile/component/mark-line.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/mark-point.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/mark-point.js +19 -0
- package/cjs/theme/builtin/common-mobile/component/mark-point.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/player.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/player.js +51 -0
- package/cjs/theme/builtin/common-mobile/component/player.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/poptip.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/poptip.js +25 -0
- package/cjs/theme/builtin/common-mobile/component/poptip.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/title.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/title.js +23 -0
- package/cjs/theme/builtin/common-mobile/component/title.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/tooltip.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/tooltip.js +43 -0
- package/cjs/theme/builtin/common-mobile/component/tooltip.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/component/total-label.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/component/total-label.js +16 -0
- package/cjs/theme/builtin/common-mobile/component/total-label.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/constants.d.ts +2 -0
- package/cjs/theme/builtin/common-mobile/constants.js +23 -0
- package/cjs/theme/builtin/common-mobile/constants.js.map +1 -0
- package/cjs/theme/builtin/common-mobile/mark.d.ts +3 -0
- package/cjs/theme/builtin/common-mobile/mark.js +35 -0
- package/cjs/theme/builtin/common-mobile/mark.js.map +1 -0
- package/cjs/theme/builtin/dark-mobile/index.d.ts +2 -0
- package/cjs/theme/builtin/dark-mobile/index.js +18 -0
- package/cjs/theme/builtin/dark-mobile/index.js.map +1 -0
- package/cjs/theme/builtin/index.js +4 -2
- package/cjs/theme/builtin/index.js.map +1 -1
- package/cjs/theme/builtin/light-mobile/index.d.ts +2 -0
- package/cjs/theme/builtin/light-mobile/index.js +18 -0
- package/cjs/theme/builtin/light-mobile/index.js.map +1 -0
- package/cjs/theme/interface.d.ts +1 -2
- package/cjs/theme/interface.js.map +1 -1
- package/cjs/typings/index.d.ts +1 -0
- package/cjs/typings/index.js +2 -1
- package/cjs/typings/index.js.map +1 -1
- package/cjs/typings/layout.d.ts +23 -0
- package/cjs/typings/layout.js +6 -0
- package/cjs/typings/layout.js.map +1 -0
- package/cjs/typings/spec/common.d.ts +1 -2
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/util/space.d.ts +1 -1
- package/cjs/util/space.js.map +1 -1
- package/cjs/util/type.js +1 -1
- package/cjs/util/type.js.map +1 -1
- package/esm/animation/config.js +1 -0
- package/esm/animation/config.js.map +1 -1
- package/esm/animation/utils.d.ts +2 -2
- package/esm/animation/utils.js +13 -13
- package/esm/animation/utils.js.map +1 -1
- package/esm/chart/base-chart.d.ts +4 -4
- package/esm/chart/base-chart.js +33 -22
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +2 -2
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/stack.js +1 -2
- package/esm/compile/compilable-base.js +2 -1
- package/esm/compile/compiler.js +1 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/mark/compilable-mark.d.ts +1 -2
- package/esm/compile/mark/compilable-mark.js +3 -7
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -0
- package/esm/component/axis/base-axis.js +2 -2
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +12 -9
- package/esm/component/axis/cartesian/axis.js +44 -52
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/theme.d.ts +1 -1
- package/esm/component/axis/cartesian/interface/theme.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.js +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +3 -4
- package/esm/component/axis/polar/axis.js +7 -12
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/base/base-component.d.ts +12 -4
- package/esm/component/base/base-component.js +21 -11
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/brush/brush.d.ts +3 -4
- package/esm/component/brush/brush.js +3 -5
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +4 -5
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/cartesian.d.ts +2 -0
- package/esm/component/crosshair/cartesian.js +5 -8
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/interface/spec.d.ts +1 -1
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/crosshair/polar.d.ts +2 -0
- package/esm/component/crosshair/polar.js +5 -8
- package/esm/component/crosshair/polar.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +3 -4
- package/esm/component/custom-mark/custom-mark.js +1 -2
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +6 -8
- package/esm/component/data-zoom/data-filter-base-component.js +26 -24
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +12 -15
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/interface.d.ts +1 -0
- package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/interface.d.ts +1 -1
- package/esm/component/data-zoom/scroll-bar/interface.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js +6 -9
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/esm/component/geo/geo-coordinate.d.ts +4 -3
- package/esm/component/geo/geo-coordinate.js +3 -1
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/indicator/indicator.d.ts +2 -4
- package/esm/component/indicator/indicator.js +3 -4
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/indicator/interface.d.ts +1 -1
- package/esm/component/indicator/interface.js.map +1 -1
- package/esm/component/interface/common.d.ts +3 -3
- package/esm/component/interface/common.js.map +1 -1
- package/esm/component/label/base-label.d.ts +3 -4
- package/esm/component/label/base-label.js +1 -3
- package/esm/component/label/base-label.js.map +1 -1
- package/esm/component/label/label.d.ts +3 -3
- package/esm/component/label/label.js +2 -3
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/totalLabel.d.ts +3 -3
- package/esm/component/label/totalLabel.js +2 -3
- package/esm/component/label/totalLabel.js.map +1 -1
- package/esm/component/legend/base-legend.d.ts +6 -9
- package/esm/component/legend/base-legend.js +3 -9
- package/esm/component/legend/base-legend.js.map +1 -1
- package/esm/component/legend/continuous/legend.d.ts +4 -1
- package/esm/component/legend/continuous/legend.js +6 -7
- package/esm/component/legend/continuous/legend.js.map +1 -1
- package/esm/component/legend/discrete/legend.d.ts +4 -1
- package/esm/component/legend/discrete/legend.js +6 -7
- package/esm/component/legend/discrete/legend.js.map +1 -1
- package/esm/component/legend/discrete/util.d.ts +1 -1
- package/esm/component/legend/discrete/util.js.map +1 -1
- package/esm/component/legend/util.d.ts +1 -1
- package/esm/component/map-label/component.d.ts +2 -4
- package/esm/component/map-label/component.js +1 -1
- package/esm/component/map-label/component.js.map +1 -1
- package/esm/component/marker/base-marker.d.ts +2 -3
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/interface.d.ts +1 -1
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.d.ts +1 -3
- package/esm/component/marker/mark-area/mark-area.js +6 -9
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.d.ts +1 -3
- package/esm/component/marker/mark-line/mark-line.js +8 -11
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.d.ts +1 -3
- package/esm/component/marker/mark-point/mark-point.js +6 -9
- package/esm/component/marker/mark-point/mark-point.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/player.d.ts +6 -7
- package/esm/component/player/player.js +4 -7
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/title/interface/theme.d.ts +1 -1
- package/esm/component/title/interface/theme.js.map +1 -1
- package/esm/component/title/title.d.ts +6 -9
- package/esm/component/title/title.js +12 -22
- 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/model/content-column-model.js +13 -9
- package/esm/component/tooltip/handler/dom/model/content-column-model.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/shape-model.d.ts +1 -0
- package/esm/component/tooltip/handler/dom/model/shape-model.js +4 -4
- package/esm/component/tooltip/handler/dom/model/shape-model.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +4 -3
- package/esm/component/tooltip/tooltip.js +5 -8
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/layout.d.ts +1 -0
- package/esm/constant/layout.js +2 -0
- package/esm/constant/layout.js.map +1 -1
- package/esm/core/factory.d.ts +5 -2
- package/esm/core/factory.js +6 -3
- package/esm/core/factory.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +1 -0
- package/esm/core/vchart.js +11 -8
- package/esm/core/vchart.js.map +1 -1
- package/esm/event/events/base.d.ts +16 -0
- package/esm/event/events/base.js +15 -0
- package/esm/event/events/base.js.map +1 -0
- package/esm/event/events/dimension/util/cartesian.d.ts +1 -1
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/events/dimension/util/common.d.ts +1 -2
- package/esm/event/events/dimension/util/common.js +1 -1
- package/esm/event/events/dimension/util/common.js.map +1 -1
- package/esm/event/events/dimension/util/polar.d.ts +1 -1
- package/esm/event/events/dimension/util/polar.js.map +1 -1
- package/esm/event/interface.d.ts +1 -1
- package/esm/event/interface.js.map +1 -1
- package/esm/interaction/zoom/zoomable.d.ts +1 -0
- package/esm/interaction/zoom/zoomable.js +6 -5
- package/esm/interaction/zoom/zoomable.js.map +1 -1
- package/esm/layout/base-layout.d.ts +3 -5
- package/esm/layout/base-layout.js +8 -8
- package/esm/layout/base-layout.js.map +1 -1
- package/esm/layout/grid-layout/grid-layout.d.ts +1 -2
- package/esm/layout/grid-layout/grid-layout.js +6 -4
- package/esm/layout/grid-layout/grid-layout.js.map +1 -1
- package/esm/layout/interface.d.ts +74 -6
- package/esm/layout/interface.js.map +1 -1
- package/esm/{model → layout}/layout-item.d.ts +35 -23
- package/esm/{model → layout}/layout-item.js +95 -63
- package/esm/layout/layout-item.js.map +1 -0
- package/esm/layout/layout3d/index.d.ts +2 -4
- package/esm/layout/layout3d/index.js +5 -5
- package/esm/layout/layout3d/index.js.map +1 -1
- package/esm/layout/util.d.ts +1 -1
- package/esm/layout/util.js.map +1 -1
- package/esm/mark/arc.js +2 -2
- 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 +30 -69
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/model/base-model.d.ts +10 -6
- package/esm/model/base-model.js +24 -22
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +20 -82
- package/esm/model/interface.js.map +1 -1
- package/esm/model/layout-model.d.ts +39 -0
- package/esm/model/layout-model.js +71 -0
- package/esm/model/layout-model.js.map +1 -0
- package/esm/region/interface.d.ts +3 -2
- package/esm/region/interface.js.map +1 -1
- package/esm/region/region.d.ts +12 -7
- package/esm/region/region.js +19 -11
- package/esm/region/region.js.map +1 -1
- package/esm/series/base/base-series.d.ts +10 -4
- package/esm/series/base/base-series.js +26 -10
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/cartesian/cartesian.js +4 -1
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/funnel/interface.d.ts +1 -2
- package/esm/series/funnel/interface.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/mixin/line-mixin.d.ts +2 -1
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +2 -1
- package/esm/series/sankey/sankey.js +23 -27
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/theme/builtin/common-mobile/component/axis/band-axis.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/axis/band-axis.js +18 -0
- package/esm/theme/builtin/common-mobile/component/axis/band-axis.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +3 -0
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.js +32 -0
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/axis/common-axis.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/axis/common-axis.js +36 -0
- package/esm/theme/builtin/common-mobile/component/axis/common-axis.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/axis/linear-axis.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/axis/linear-axis.js +18 -0
- package/esm/theme/builtin/common-mobile/component/axis/linear-axis.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/axis/polar-axis.d.ts +3 -0
- package/esm/theme/builtin/common-mobile/component/axis/polar-axis.js +23 -0
- package/esm/theme/builtin/common-mobile/component/axis/polar-axis.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/crosshair.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/crosshair.js +35 -0
- package/esm/theme/builtin/common-mobile/component/crosshair.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/data-zoom.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/data-zoom.js +34 -0
- package/esm/theme/builtin/common-mobile/component/data-zoom.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/index.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/index.js +65 -0
- package/esm/theme/builtin/common-mobile/component/index.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/indicator.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/indicator.js +17 -0
- package/esm/theme/builtin/common-mobile/component/indicator.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/legend/color-legend.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/legend/color-legend.js +17 -0
- package/esm/theme/builtin/common-mobile/component/legend/color-legend.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/legend/continuous.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/legend/continuous.js +38 -0
- package/esm/theme/builtin/common-mobile/component/legend/continuous.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/legend/discrete-legend.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/legend/discrete-legend.js +33 -0
- package/esm/theme/builtin/common-mobile/component/legend/discrete-legend.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/legend/size-legend.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/legend/size-legend.js +17 -0
- package/esm/theme/builtin/common-mobile/component/legend/size-legend.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/map-label.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/map-label.js +33 -0
- package/esm/theme/builtin/common-mobile/component/map-label.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/mark-area.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/mark-area.js +18 -0
- package/esm/theme/builtin/common-mobile/component/mark-area.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/mark-line.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/mark-line.js +27 -0
- package/esm/theme/builtin/common-mobile/component/mark-line.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/mark-point.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/mark-point.js +15 -0
- package/esm/theme/builtin/common-mobile/component/mark-point.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/player.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/player.js +47 -0
- package/esm/theme/builtin/common-mobile/component/player.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/poptip.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/poptip.js +19 -0
- package/esm/theme/builtin/common-mobile/component/poptip.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/title.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/title.js +17 -0
- package/esm/theme/builtin/common-mobile/component/title.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/tooltip.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/tooltip.js +37 -0
- package/esm/theme/builtin/common-mobile/component/tooltip.js.map +1 -0
- package/esm/theme/builtin/common-mobile/component/total-label.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/component/total-label.js +10 -0
- package/esm/theme/builtin/common-mobile/component/total-label.js.map +1 -0
- package/esm/theme/builtin/common-mobile/constants.d.ts +2 -0
- package/esm/theme/builtin/common-mobile/constants.js +19 -0
- package/esm/theme/builtin/common-mobile/constants.js.map +1 -0
- package/esm/theme/builtin/common-mobile/mark.d.ts +3 -0
- package/esm/theme/builtin/common-mobile/mark.js +31 -0
- package/esm/theme/builtin/common-mobile/mark.js.map +1 -0
- package/esm/theme/builtin/dark-mobile/index.d.ts +2 -0
- package/esm/theme/builtin/dark-mobile/index.js +16 -0
- package/esm/theme/builtin/dark-mobile/index.js.map +1 -0
- package/esm/theme/builtin/index.js +7 -1
- package/esm/theme/builtin/index.js.map +1 -1
- package/esm/theme/builtin/light-mobile/index.d.ts +2 -0
- package/esm/theme/builtin/light-mobile/index.js +16 -0
- package/esm/theme/builtin/light-mobile/index.js.map +1 -0
- package/esm/theme/interface.d.ts +1 -2
- package/esm/theme/interface.js.map +1 -1
- package/esm/typings/index.d.ts +1 -0
- package/esm/typings/index.js +2 -0
- package/esm/typings/index.js.map +1 -1
- package/esm/typings/layout.d.ts +23 -0
- package/esm/typings/layout.js +2 -0
- package/esm/typings/layout.js.map +1 -0
- package/esm/typings/spec/common.d.ts +1 -2
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/util/space.d.ts +1 -1
- package/esm/util/space.js.map +1 -1
- package/esm/util/type.js +1 -1
- package/esm/util/type.js.map +1 -1
- package/package.json +19 -19
- package/cjs/model/layout-item.js.map +0 -1
- package/esm/model/layout-item.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { THEME_CONSTANTS } from "../constants";
|
|
2
|
+
|
|
3
|
+
export const tooltip = {
|
|
4
|
+
offset: {
|
|
5
|
+
x: 10,
|
|
6
|
+
y: 10
|
|
7
|
+
},
|
|
8
|
+
panel: {
|
|
9
|
+
padding: {
|
|
10
|
+
top: 10,
|
|
11
|
+
left: 10,
|
|
12
|
+
right: 10,
|
|
13
|
+
bottom: 10
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
spaceRow: 6,
|
|
17
|
+
titleLabel: {
|
|
18
|
+
fontSize: THEME_CONSTANTS.l4FontSize,
|
|
19
|
+
lineHeight: THEME_CONSTANTS.l4LineHeight,
|
|
20
|
+
spacing: 0
|
|
21
|
+
},
|
|
22
|
+
shape: {
|
|
23
|
+
size: 8,
|
|
24
|
+
spacing: 6
|
|
25
|
+
},
|
|
26
|
+
keyLabel: {
|
|
27
|
+
fontSize: THEME_CONSTANTS.l4FontSize,
|
|
28
|
+
lineHeight: THEME_CONSTANTS.l4LineHeight,
|
|
29
|
+
spacing: 26
|
|
30
|
+
},
|
|
31
|
+
valueLabel: {
|
|
32
|
+
fontSize: THEME_CONSTANTS.l4FontSize,
|
|
33
|
+
lineHeight: THEME_CONSTANTS.l4LineHeight,
|
|
34
|
+
spacing: 0
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common-mobile/component/tooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAkB;IACpC,MAAM,EAAE;QACN,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,EAAE;KACN;IACD,KAAK,EAAE;QACL,OAAO,EAAE;YACP,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;KACF;IACD,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE;QACV,QAAQ,EAAE,eAAe,CAAC,UAAU;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY;QACxC,OAAO,EAAE,CAAC;KACX;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,CAAC;KACX;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,eAAe,CAAC,UAAU;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY;QACxC,OAAO,EAAE,EAAE;KACZ;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,eAAe,CAAC,UAAU;QACpC,UAAU,EAAE,eAAe,CAAC,YAAY;QACxC,OAAO,EAAE,CAAC;KACX;CACF,CAAC","file":"tooltip.js","sourcesContent":["import type { ITooltipTheme } from '../../../../component/tooltip/interface';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const tooltip: ITooltipTheme = {\n offset: {\n x: 10,\n y: 10\n },\n panel: {\n padding: {\n top: 10,\n left: 10,\n right: 10,\n bottom: 10\n }\n },\n spaceRow: 6,\n titleLabel: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n spacing: 0\n },\n shape: {\n size: 8,\n spacing: 6\n },\n keyLabel: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n spacing: 26\n },\n valueLabel: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n spacing: 0\n }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common-mobile/component/total-label.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC1C,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,CAAC;IACT,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC,UAAU;KAErC;CACF,CAAC","file":"total-label.js","sourcesContent":["import type { ITotalLabelTheme } from '../../../../component/label';\nimport { THEME_CONSTANTS } from '../constants';\n\nexport const totalLabel: ITotalLabelTheme = {\n visible: false,\n offset: 5,\n style: {\n fontSize: THEME_CONSTANTS.l4FontSize\n // lineHeight: THEME_CONSTANTS.l4LineHeight,\n }\n};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const THEME_CONSTANTS = {
|
|
2
|
+
defaultFontFamily: "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",
|
|
3
|
+
defaultFontSize: 12,
|
|
4
|
+
l1FontSize: 30,
|
|
5
|
+
l1LineHeight: "150%",
|
|
6
|
+
l2FontSize: 18,
|
|
7
|
+
l2LineHeight: "140%",
|
|
8
|
+
l3FontSize: 14,
|
|
9
|
+
l3LineHeight: "150%",
|
|
10
|
+
l4FontSize: 12,
|
|
11
|
+
l4LineHeight: "150%",
|
|
12
|
+
l5FontSize: 10,
|
|
13
|
+
l5LineHeight: "130%",
|
|
14
|
+
l6FontSize: 8,
|
|
15
|
+
l6LineHeight: "120%",
|
|
16
|
+
axisTickSize: 0,
|
|
17
|
+
areaOpacity: .2
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common-mobile/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,iBAAiB,EAEf,gKAAgK;IAClK,eAAe,EAAE,EAAE;IAEnB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,MAAM;IAEpB,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,MAAM;IAEpB,YAAY,EAAE,CAAC;IAEf,WAAW,EAAE,GAAG;CACjB,CAAC","file":"constants.js","sourcesContent":["import type { IThemeConstants } from '../../interface';\n\nexport const THEME_CONSTANTS: IThemeConstants = {\n defaultFontFamily:\n // eslint-disable-next-line max-len\n 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol',\n defaultFontSize: 12,\n\n l1FontSize: 30,\n l1LineHeight: '150%',\n\n l2FontSize: 18,\n l2LineHeight: '140%',\n\n l3FontSize: 14,\n l3LineHeight: '150%',\n\n l4FontSize: 12,\n l4LineHeight: '150%',\n\n l5FontSize: 10,\n l5LineHeight: '130%',\n\n l6FontSize: 8,\n l6LineHeight: '120%',\n\n axisTickSize: 0,\n\n areaOpacity: 0.2\n};\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { THEME_CONSTANTS } from "./constants";
|
|
2
|
+
|
|
3
|
+
export const markByType = {
|
|
4
|
+
text: {
|
|
5
|
+
style: {
|
|
6
|
+
fontSize: THEME_CONSTANTS.l4FontSize,
|
|
7
|
+
lineHeight: THEME_CONSTANTS.l4LineHeight,
|
|
8
|
+
fontWeight: "normal",
|
|
9
|
+
fillOpacity: 1
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const markByName = {
|
|
15
|
+
label: {
|
|
16
|
+
style: {
|
|
17
|
+
fontSize: THEME_CONSTANTS.l4FontSize
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
line: {
|
|
21
|
+
style: {
|
|
22
|
+
lineWidth: 2
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
point: {
|
|
26
|
+
style: {
|
|
27
|
+
size: 8
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/common-mobile/mark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,QAAQ,EAAE,eAAe,CAAC,UAAU;YACpC,UAAU,EAAE,eAAe,CAAC,YAAY;YAExC,UAAU,EAAE,QAAQ;YACpB,WAAW,EAAE,CAAC;SACf;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,QAAQ,EAAE,eAAe,CAAC,UAAU;SAErC;KACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,SAAS,EAAE,CAAC;SACb;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;SACR;KACF;CACF,CAAC","file":"mark.js","sourcesContent":["import type { IGlobalMarkThemeByName, IGlobalMarkThemeByType } from '../../interface';\nimport { THEME_CONSTANTS } from './constants';\n\nexport const markByType: IGlobalMarkThemeByType = {\n text: {\n style: {\n fontSize: THEME_CONSTANTS.l4FontSize,\n lineHeight: THEME_CONSTANTS.l4LineHeight,\n\n fontWeight: 'normal',\n fillOpacity: 1\n }\n }\n};\n\nexport const markByName: IGlobalMarkThemeByName = {\n label: {\n style: {\n fontSize: THEME_CONSTANTS.l4FontSize\n // lineHeight: THEME_CONSTANTS.l4LineHeight,\n }\n },\n line: {\n style: {\n lineWidth: 2\n }\n },\n point: {\n style: {\n size: 8\n }\n }\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { component } from "../common-mobile/component";
|
|
2
|
+
|
|
3
|
+
import { markByName, markByType } from "../common-mobile/mark";
|
|
4
|
+
|
|
5
|
+
import { colorScheme } from "../dark/color-scheme";
|
|
6
|
+
|
|
7
|
+
export const darkMobileTheme = {
|
|
8
|
+
name: "dark-mobile",
|
|
9
|
+
type: "dark",
|
|
10
|
+
padding: 12,
|
|
11
|
+
colorScheme: colorScheme,
|
|
12
|
+
component: component,
|
|
13
|
+
mark: markByType,
|
|
14
|
+
markByName: markByName
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/dark-mobile/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,CAAC,MAAM,eAAe,GAAW;IACrC,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,EAAE;IACX,WAAW;IACX,SAAS;IACT,IAAI,EAAE,UAAU;IAChB,UAAU;CACX,CAAC","file":"index.js","sourcesContent":["/**\n * 主题的命名,不要使用类似 arco,default 等字段,应该要以主题的特征来,颜色/场景特征(light, dark)\n *\n * 1. 对除了 color 外的一些主题设置,应该要有专门的设计,**不要直接复制**\n * 2. 原则上来讲,默认值尽量都放主题中,但是也可根据情况自行判断\n * 3. 目前主题只到系列,不到系列的 mark,对于这个分界没有太清楚,后续根据需求再做开放\n */\nimport type { ITheme } from '../../interface';\nimport { component } from '../common-mobile/component';\nimport { markByName, markByType } from '../common-mobile/mark';\nimport { colorScheme } from '../dark/color-scheme';\n\nexport const darkMobileTheme: ITheme = {\n name: 'dark-mobile',\n type: 'dark',\n padding: 12,\n colorScheme,\n component,\n mark: markByType,\n markByName\n};\n"]}
|
|
@@ -12,9 +12,15 @@ import { darkTheme } from "./dark";
|
|
|
12
12
|
|
|
13
13
|
import { lightTheme } from "./light";
|
|
14
14
|
|
|
15
|
+
import { lightMobileTheme } from "./light-mobile";
|
|
16
|
+
|
|
17
|
+
import { darkMobileTheme } from "./dark-mobile";
|
|
18
|
+
|
|
15
19
|
export const builtinThemes = {
|
|
16
20
|
[lightTheme.name]: lightTheme,
|
|
17
|
-
[darkTheme.name]: darkTheme
|
|
21
|
+
[darkTheme.name]: darkTheme,
|
|
22
|
+
[lightMobileTheme.name]: lightMobileTheme,
|
|
23
|
+
[darkMobileTheme.name]: darkMobileTheme
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
export const getDefaultThemeName = type => "dark" === type ? darkTheme.name : lightTheme.name;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/builtin/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAExB,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,cAA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,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAsB,EAAU,EAAE;IAC/D,MAAM,aAAa,GAAG,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC1C,OAAO,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAqB;IACtD,UAAU,EAAE,cAAc,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,WAAW,CAAC;IACnH,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,UAAU;IACtD,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,WAAW;CACzD,CAAC","file":"index.js","sourcesContent":["export * from './light';\n/** 历史弃用主题 */\nexport * from './common/legacy';\n\nimport { isString } from '@visactor/vutils';\nimport type { IChartLevelTheme } from '../../core/interface';\nimport { mergeTheme } from '../../util/spec/merge-theme';\nimport { getActualColor } from '../color-scheme/util';\nimport type { ITheme } from '../interface';\nimport { darkTheme } from './dark';\nimport { lightTheme } from './light';\nimport { lightMobileTheme } from './light-mobile';\nimport { darkMobileTheme } from './dark-mobile';\n\n/** 声明内置主题 */\nexport const builtinThemes: Record<string, ITheme> = {\n [lightTheme.name]: lightTheme,\n [darkTheme.name]: darkTheme,\n [lightMobileTheme.name]: lightMobileTheme,\n [darkMobileTheme.name]: darkMobileTheme\n};\n\n/** 获取默认主题 */\nexport const getDefaultThemeName = (type?: ITheme['type']) => (type === 'dark' ? darkTheme.name : lightTheme.name);\nexport const defaultThemeName = getDefaultThemeName();\n\n/** 全局主题 map (包含用户新注册的主题) */\nexport const themes: Map<string, ITheme> = new Map(Object.keys(builtinThemes).map(key => [key, builtinThemes[key]]));\n/** 主题 map 中的元素是否 merge 过默认主题 (非默认主题的其他内置主题没有 merge 过默认主题) */\nexport const hasThemeMerged: Map<string, boolean> = new Map(\n Object.keys(builtinThemes).map(key => [key, key === defaultThemeName])\n);\n\n/** 注册主题 */\nexport const registerTheme = (name: string, theme: Partial<ITheme>) => {\n if (!name) {\n return;\n }\n // 所有主题基于默认主题扩展,保证基础值\n themes.set(name, getMergedTheme(theme));\n hasThemeMerged.set(name, true);\n};\n\n/** 获取注册过的主题 */\nexport const getTheme = (name: string) => {\n if (hasThemeMerged.has(name) && !hasThemeMerged.get(name)) {\n // 重新 merge 默认主题\n registerTheme(name, themes.get(name));\n }\n return themes.get(name) || themes.get(defaultThemeName);\n};\n\n/** 删除主题 */\nexport const removeTheme = (name: string): boolean => {\n return themes.delete(name) && hasThemeMerged.delete(name);\n};\n\n/** 主题是否存在 */\nexport const themeExist = (name: any) => {\n if (!isString(name)) {\n return false;\n }\n return themes.has(name);\n};\n\n/** 使新主题基于默认主题扩展,保证基础值 */\nexport const getMergedTheme = (theme: Partial<ITheme>): ITheme => {\n const baseThemeName = getDefaultThemeName(theme.type);\n const baseTheme = getTheme(baseThemeName);\n return mergeTheme({}, baseTheme, theme);\n};\n\nexport const defaultChartLevelTheme: IChartLevelTheme = {\n background: getActualColor(builtinThemes[defaultThemeName].background, builtinThemes[defaultThemeName].colorScheme),\n fontFamily: builtinThemes[defaultThemeName].fontFamily,\n colorScheme: builtinThemes[defaultThemeName].colorScheme\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { component } from "../common-mobile/component";
|
|
2
|
+
|
|
3
|
+
import { markByName, markByType } from "../common-mobile/mark";
|
|
4
|
+
|
|
5
|
+
import { colorScheme } from "../light/color-scheme";
|
|
6
|
+
|
|
7
|
+
export const lightMobileTheme = {
|
|
8
|
+
name: "light-mobile",
|
|
9
|
+
type: "light",
|
|
10
|
+
padding: 12,
|
|
11
|
+
colorScheme: colorScheme,
|
|
12
|
+
component: component,
|
|
13
|
+
mark: markByType,
|
|
14
|
+
markByName: markByName
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme/builtin/light-mobile/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAW;IACtC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,EAAE;IACX,WAAW;IACX,SAAS;IACT,IAAI,EAAE,UAAU;IAChB,UAAU;CACX,CAAC","file":"index.js","sourcesContent":["/**\n * 主题的命名,不要使用类似 arco,default 等字段,应该要以主题的特征来,颜色/场景特征(light, dark)\n *\n * 1. 对除了 color 外的一些主题设置,应该要有专门的设计,**不要直接复制**\n * 2. 原则上来讲,默认值尽量都放主题中,但是也可根据情况自行判断\n * 3. 目前主题只到系列,不到系列的 mark,对于这个分界没有太清楚,后续根据需求再做开放\n */\nimport type { ITheme } from '../../interface';\nimport { component } from '../common-mobile/component';\nimport { markByName, markByType } from '../common-mobile/mark';\nimport { colorScheme } from '../light/color-scheme';\n\nexport const lightMobileTheme: ITheme = {\n name: 'light-mobile',\n type: 'light',\n padding: 12,\n colorScheme,\n component,\n mark: markByType,\n markByName\n};\n"]}
|
package/esm/theme/interface.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ILayoutPaddingSpec } from '../model/interface';
|
|
2
1
|
import type { ISeriesTheme } from '../series/interface';
|
|
3
2
|
import type { IMarkTheme } from '../typings/spec';
|
|
4
|
-
import type { IArcMarkSpec, IAreaMarkSpec, ILineMarkSpec, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, IPathMarkSpec } from '../typings';
|
|
3
|
+
import type { IArcMarkSpec, IAreaMarkSpec, ILineMarkSpec, IRectMarkSpec, ISymbolMarkSpec, ITextMarkSpec, IPathMarkSpec, ILayoutPaddingSpec } from '../typings';
|
|
5
4
|
import type { MarkTypeEnum } from '../mark/interface';
|
|
6
5
|
import type { IColorKey, IThemeColorScheme } from './color-scheme/interface';
|
|
7
6
|
import type { IGradientColor } from '@visactor/vrender-core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../src/theme/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { ISeriesTheme } from '../series/interface';\nimport type { IMarkTheme } from '../typings/spec';\nimport type {\n IArcMarkSpec,\n IAreaMarkSpec,\n ILineMarkSpec,\n IRectMarkSpec,\n ISymbolMarkSpec,\n ITextMarkSpec,\n IPathMarkSpec,\n ILayoutPaddingSpec\n} from '../typings';\nimport type { MarkTypeEnum } from '../mark/interface';\nimport type { IColorKey, IThemeColorScheme } from './color-scheme/interface';\nimport type { IGradientColor } from '@visactor/vrender-core';\nimport type { IComponentTheme } from '../component/interface';\n\nexport interface ITheme {\n /**\n * 第 1 种配置:主题信息\n */\n /** 主题命名 */\n name?: string;\n /** 主题描述 */\n description?: string;\n /**\n * 主题类别:亮色或者暗色\n * 该配置用于指定该主题需要 merge 的是内置的亮色主题还是暗色主题\n */\n type?: 'light' | 'dark';\n\n /**\n * 第 2 种配置:图表层级的样式属性\n */\n /** 图表背景色 */\n background?: string | IGradientColor | IColorKey;\n /** 图表内边距 */\n padding?: ILayoutPaddingSpec;\n /** 图表字体配置 */\n fontFamily?: string;\n\n /**\n * 第 3 种配置:色板\n */\n /** 全局色板 */\n colorScheme?: IThemeColorScheme;\n\n /**\n * 第 4 种配置:全局 mark 属性配置\n */\n /** 全局 mark 样式属性,按 mark 类别索引 */\n mark?: IGlobalMarkThemeByType;\n /** 全局 mark 样式属性,按 mark 名称索引,优先级更高 */\n markByName?: IGlobalMarkThemeByName;\n\n /**\n * 第 5 种配置:系列属性配置\n */\n /** 系列样式属性 */\n series?: ISeriesTheme;\n /**\n * 自动关闭动画的阀值,对应的是单系列data的长度\n */\n animationThreshold?: number;\n\n /**\n * 第 6 种配置:组件属性配置\n */\n /** 组件样式属性 */\n component?: IComponentTheme;\n}\n\nexport interface IGlobalMarkThemeByType {\n [MarkTypeEnum.line]?: Partial<IMarkTheme<ILineMarkSpec>>;\n [MarkTypeEnum.symbol]?: Partial<IMarkTheme<ISymbolMarkSpec>>;\n [MarkTypeEnum.area]?: Partial<IMarkTheme<IAreaMarkSpec>>;\n [MarkTypeEnum.rect]?: Partial<IMarkTheme<IRectMarkSpec>>;\n [MarkTypeEnum.arc]?: Partial<IMarkTheme<IArcMarkSpec>>;\n [MarkTypeEnum.text]?: Partial<IMarkTheme<ITextMarkSpec>>;\n [MarkTypeEnum.path]?: Partial<IMarkTheme<IPathMarkSpec>>;\n}\n\nexport interface IGlobalMarkThemeByName {\n /** used in lineSeries, areaSeries, radarSeries, etc. */\n line?: Partial<IMarkTheme<ILineMarkSpec>>;\n /** used in lineSeries, areaSeries, radarSeries, scatterSeries etc. */\n point?: Partial<IMarkTheme<ISymbolMarkSpec>>;\n /** used in lineSeries, areaSeries, radarSeries, etc. */\n area?: Partial<IMarkTheme<IAreaMarkSpec>>;\n /** used in barSeries, rangeColumnSeries etc. */\n bar?: Partial<IMarkTheme<IRectMarkSpec>>;\n /** used in many series */\n label?: Partial<IMarkTheme<ITextMarkSpec>>;\n\n [markName: string]: Partial<IMarkTheme<any>>;\n}\n\nexport interface IThemeConstants {\n /** 默认字体 */\n defaultFontFamily: string;\n /** 默认字号 */\n defaultFontSize: number;\n\n /** 1级字阶字号,用于:环形图中间数值 / 展示型数值 */\n l1FontSize: number;\n /** 1级字阶行高 */\n l1LineHeight: number | string;\n\n /** 2级字阶字号,用于:展示型文字 / 指标卡数值 */\n l2FontSize: number;\n /** 2级字阶行高 */\n l2LineHeight: number | string;\n\n /** 3级字阶字号,用于:图表标题 */\n l3FontSize: number;\n /** 3级字阶行高 */\n l3LineHeight: number | string;\n\n /** 4级字阶字号,用于:数据标签、tooltip */\n l4FontSize: number;\n /** 4级字阶行高 */\n l4LineHeight: number | string;\n\n /** 5级字阶字号,用于:坐标轴标题、轴标签、图例文字 */\n l5FontSize: number;\n /** 5级字阶行高 */\n l5LineHeight: number | string;\n\n /** 6级字阶字号,用于:地图标签 */\n l6FontSize: number;\n /** 6级字阶行高 */\n l6LineHeight: number | string;\n\n /** 轴 tick 长度 */\n axisTickSize: number;\n\n /** 面积图元透明度 */\n areaOpacity: number;\n}\n"]}
|
package/esm/typings/index.d.ts
CHANGED
package/esm/typings/index.js
CHANGED
package/esm/typings/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typings/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["export * from './cursor';\nexport * from './data';\nexport * from './interpolate';\nexport * from './shape';\nexport * from './scale';\nexport * from './line-stroke';\nexport * from './space';\nexport * from './coordinate';\nexport * from './tooltip';\nexport * from './params';\nexport * from './visual';\nexport * from './common';\nexport * from './spec';\nexport * from './group';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/typings/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["export * from './cursor';\nexport * from './data';\nexport * from './interpolate';\nexport * from './shape';\nexport * from './scale';\nexport * from './line-stroke';\nexport * from './space';\nexport * from './coordinate';\nexport * from './tooltip';\nexport * from './params';\nexport * from './visual';\nexport * from './common';\nexport * from './spec';\nexport * from './group';\nexport * from './layout';\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ILayoutNumber = number | IPercent | ((layoutRect: ILayoutRect) => number) | IPercentOffset;
|
|
2
|
+
export interface ILayoutPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ILayoutRect {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export type IPercent = `${number}%`;
|
|
11
|
+
export type IPercentOffset = {
|
|
12
|
+
percent?: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
};
|
|
15
|
+
export type ILayoutPercent = IPercent | number;
|
|
16
|
+
export type ILayoutType = 'region-relative' | 'region' | 'normal' | 'absolute' | 'normal-inline';
|
|
17
|
+
export type ILayoutOrientPadding = {
|
|
18
|
+
left?: ILayoutNumber;
|
|
19
|
+
right?: ILayoutNumber;
|
|
20
|
+
top?: ILayoutNumber;
|
|
21
|
+
bottom?: ILayoutNumber;
|
|
22
|
+
};
|
|
23
|
+
export type ILayoutPaddingSpec = ILayoutOrientPadding | ILayoutNumber | ILayoutNumber[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/typings/layout.ts"],"names":[],"mappings":"","file":"layout.js","sourcesContent":["export type ILayoutNumber = number | IPercent | ((layoutRect: ILayoutRect) => number) | IPercentOffset;\n\nexport interface ILayoutPoint {\n x: number;\n y: number;\n}\n\nexport interface ILayoutRect {\n width: number;\n height: number;\n}\n\nexport type IPercent = `${number}%`;\n\nexport type IPercentOffset = { percent?: number; offset?: number };\n\nexport type ILayoutPercent = IPercent | number;\n\n/**\n * 相对布局和绝对布局\n * 在相对布局结束后进行二次的绝对布局\n * 绝对布局会只根据 chart 进行相对处理\n */\n\nexport type ILayoutType = 'region-relative' | 'region' | 'normal' | 'absolute' | 'normal-inline';\n\nexport type ILayoutOrientPadding = {\n left?: ILayoutNumber;\n right?: ILayoutNumber;\n top?: ILayoutNumber;\n bottom?: ILayoutNumber;\n};\n\n/** 布局 padding的配置 */\nexport type ILayoutPaddingSpec = ILayoutOrientPadding | ILayoutNumber | ILayoutNumber[];\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { IFillMarkSpec, IImageMarkSpec } from '../visual';
|
|
2
|
-
import type { ILayoutPaddingSpec } from '../../model/interface';
|
|
3
2
|
import type { LayoutCallBack } from '../../layout/interface';
|
|
4
3
|
import type { IElement, srIOption3DType } from '@visactor/vgrammar-core';
|
|
5
4
|
import type { DataSet, DataView, ISimplifyOptions, IFieldsOptions, IFilterOptions, IFoldOptions, IDsvParserOptions } from '@visactor/vdataset';
|
|
@@ -11,7 +10,6 @@ import type { ILayoutSpec } from '../../layout/interface';
|
|
|
11
10
|
import type { ConvertToMarkStyleSpec, IArc3dMarkSpec, IArcMarkSpec, IAreaMarkSpec, IBoxPlotMarkSpec, ICommonSpec, IGroupMarkSpec, ILineMarkSpec, ILinkPathMarkSpec, IPathMarkSpec, IPolygonMarkSpec, IProgressArcMarkSpec, IPyramid3dMarkSpec, IRect3dMarkSpec, IRectMarkSpec, IRuleMarkSpec, ISymbolMarkSpec, IRippleMarkSpec, ITextMarkSpec, IVisualSpecScale } from '../visual';
|
|
12
11
|
import type { StateValue } from '../../compile/mark';
|
|
13
12
|
import type { ISeriesStyle, SeriesType } from '../../series/interface';
|
|
14
|
-
import type { ILayoutOrientPadding } from '../../model/interface';
|
|
15
13
|
import type { Datum, StringOrNumber } from '../common';
|
|
16
14
|
import type { IInvalidType } from '../data';
|
|
17
15
|
import type { IMorphSeriesSpec } from '../../animation/spec';
|
|
@@ -25,6 +23,7 @@ import type { IBrushSpec } from '../../component/brush';
|
|
|
25
23
|
import type { ITotalLabelSpec } from '../../component/label';
|
|
26
24
|
import type { ILegendSpec } from '../../component/legend';
|
|
27
25
|
import type { IColorKey } from '../../theme/color-scheme/interface';
|
|
26
|
+
import type { ILayoutOrientPadding, ILayoutPaddingSpec } from '../layout';
|
|
28
27
|
export type IChartPadding = ILayoutOrientPadding | number;
|
|
29
28
|
export interface IInitOption extends Omit<IRenderOption, 'pluginList'> {
|
|
30
29
|
dom?: string | HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/typings/spec/common.ts"],"names":[],"mappings":"AAmHA,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,qDAAqC,CAAA;IACrC,mDAAmC,CAAA;IACnC,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;IACX,qDAAqC,CAAA;IACrC,+BAAe,CAAA;AACjB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","file":"common.js","sourcesContent":["import type { IFillMarkSpec, IImageMarkSpec } from '../visual';\nimport type { ILayoutPaddingSpec } from '../../model/interface';\nimport type { LayoutCallBack } from '../../layout/interface';\nimport type { IElement, srIOption3DType } from '@visactor/vgrammar-core';\nimport type {\n DataSet,\n DataView,\n ISimplifyOptions,\n IFieldsOptions,\n IFilterOptions,\n IFoldOptions,\n IDsvParserOptions\n} from '@visactor/vdataset';\nimport type { IRegionSpec } from '../../region/interface';\nimport type { IHoverSpec, ISelectSpec, ITriggerSpec } from '../../interaction/interface';\nimport type { IRenderOption } from '../../compile/interface';\nimport type { ITooltipSpec } from '../../component/tooltip/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILayoutSpec } from '../../layout/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type {\n ConvertToMarkStyleSpec,\n IArc3dMarkSpec,\n IArcMarkSpec,\n IAreaMarkSpec,\n IBoxPlotMarkSpec,\n ICommonSpec,\n IGroupMarkSpec,\n ILineMarkSpec,\n ILinkPathMarkSpec,\n IPathMarkSpec,\n IPolygonMarkSpec,\n IProgressArcMarkSpec,\n IPyramid3dMarkSpec,\n IRect3dMarkSpec,\n IRectMarkSpec,\n IRuleMarkSpec,\n ISymbolMarkSpec,\n IRippleMarkSpec,\n ITextMarkSpec,\n IVisualSpecScale\n} from '../visual';\nimport type { StateValue } from '../../compile/mark';\nimport type { ISeriesStyle, SeriesType } from '../../series/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILayoutOrientPadding } from '../../model/interface';\nimport type { Datum, StringOrNumber } from '../common';\nimport type { IInvalidType } from '../data';\nimport type { IMorphSeriesSpec } from '../../animation/spec';\nimport type { IPlayer } from '../../component/player';\nimport type { IMarkProgressiveConfig, MarkTypeEnum } from '../../mark/interface';\nimport type { IDataZoomSpec, IScrollBarSpec } from '../../component/data-zoom';\nimport type { ICrosshairSpec } from '../../component/crosshair/interface';\nimport type { ITheme } from '../../theme';\nimport type { ITitleSpec } from '../../component/title/interface';\nimport type { IBrushSpec } from '../../component/brush';\nimport type { ITotalLabelSpec } from '../../component/label';\nimport type { ILegendSpec } from '../../component/legend';\nimport type { IColorKey } from '../../theme/color-scheme/interface';\n\nexport type IChartPadding = ILayoutOrientPadding | number;\n\n/** chart option */\nexport interface IInitOption extends Omit<IRenderOption, 'pluginList'> {\n /**\n * **仅生效于浏览器环境。**\n * 图表挂载的父容器,可以直接指定容器 id,也可以传入 dom 对象\n */\n dom?: string | HTMLElement;\n /**\n * 除去选择 dom 属性进行挂载父容器,也可以使用 renderCanvas 属性直接传入 canvas 实例/ canvasId\n * 小程序/小组件环境请直接传入 id\n */\n renderCanvas?: string | HTMLCanvasElement;\n /** 数据集 */\n dataSet?: DataSet;\n /** 是否自适应容器大小 */\n autoFit?: boolean;\n /**\n * 性能测试钩子\n */\n performanceHook?: IPerformanceHook;\n /**\n * 是否开启动画\n */\n animation?: boolean;\n /**\n * 3d配置\n */\n options3d?: srIOption3DType;\n\n /**\n * 自定义布局函数\n */\n layout?: LayoutCallBack;\n\n /**\n * 当文本省略时,鼠标 hover 到文本上时是否显示 poptip\n * @default true\n */\n poptip?: boolean;\n\n /**\n * 报错的回调函数\n * @since 1.2.0\n */\n onError?: (...args: any[]) => void;\n\n /**\n * 默认主题(支持完整主题对象或者主题名称,主题名称需要提前在 `ThemeManager` 中注册)\n * @since 1.3.0\n */\n theme?: string | ITheme;\n}\n\nexport enum RenderModeEnum {\n 'desktop-browser' = 'desktop-browser',\n 'mobile-browser' = 'mobile-browser',\n 'node' = 'node',\n 'worker' = 'worker',\n 'miniApp' = 'miniApp',\n 'wx' = 'wx',\n 'desktop-miniApp' = 'desktop-miniApp',\n 'lynx' = 'lynx'\n}\nexport type RenderMode = keyof typeof RenderModeEnum;\n\n/** chart spec */\nexport interface IChartSpec {\n /** 图表类型 */\n type: string;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /**\n * 图表宽高是否自适应容器,浏览器环境下默认为 true。\n * 该配置的优先级高于构造函数中的 autoFit 配置。\n * 如果用户配置了 width,则以用户配置的 width 为准,height 同理。\n */\n autoFit?: boolean;\n /**\n * 图表整体 padding 设置\n */\n padding?: ILayoutPaddingSpec;\n /**\n * 图表色系配置\n */\n color?: string[] | Omit<IVisualSpecScale<unknown, string | IColorKey>, 'id'>;\n /**\n * 系列\n * @description 仅在组合图中使用, 文档中除组合图外均未透出该配置\n */\n series?: ISeriesSpec[];\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /**\n * 自动关闭动画的阀值,对应的是单系列data的长度\n * @since 1.2.0\n */\n animationThreshold?: number;\n\n /** hover 交互 */\n hover?: boolean | IHoverSpec;\n /** select 交互 */\n select?: boolean | ISelectSpec;\n\n /** region配置 */\n region?: IRegionSpec[];\n /** 图表标题配置 */\n title?: ITitleSpec;\n /** 布局配置 */\n layout?: ILayoutSpec;\n /** 图例配置 */\n legends?: ILegendSpec | ILegendSpec[];\n /** 十字辅助线配置 */\n crosshair?: ICrosshairSpec | ICrosshairSpec[];\n /** tooltip配置 */\n tooltip?: ITooltipSpec;\n /** 播放器配置 */\n player?: IPlayer;\n /** 缩略轴配置 */\n dataZoom?: IDataZoomSpec | IDataZoomSpec[];\n /** 滚动条配置 */\n scrollBar?: IScrollBarSpec | IScrollBarSpec[];\n /** 框选配置 */\n brush?: IBrushSpec;\n /** 全局 scale 配置 */\n scales?: IVisualSpecScale<unknown, unknown>[];\n /** 自定义mark */\n customMark?: ICustomMarkSpec<EnableMarkType>[];\n /**\n * 图表上的主题定义。\n * 可以直接配置主题名,前提是该主题名已经注册\n */\n theme?: Omit<ITheme, 'name'> | string;\n /**\n * 图表背景色配置,优先级高于构造函数中的 background 配置\n */\n background?: IBackgroundSpec;\n\n // TODO:后续开放,现在仍有问题\n // poptip?: PopTipAttributes;\n // TODO: 补充动画配置\n\n /**\n * 堆积时是否逆序\n * @default false\n * @since 1.4.0\n */\n stackInverse?: boolean;\n}\n\nexport type IBackgroundStyleSpec = ConvertToMarkStyleSpec<Omit<IFillMarkSpec, 'width' | 'height' | 'background'>> & {\n image?: IRectMarkSpec['background'];\n cornerRadius?: IRectMarkSpec['cornerRadius'];\n};\n\nexport type IBackgroundSpec = string | IBackgroundStyleSpec;\n\n/** data */\nexport type IDataType = IDataValues | DataView;\nexport type IData = IDataType | IDataType[];\nexport type DataKeyType = string | string[] | ((data: Datum, index: number) => string);\nexport type BuildInTransformOptions =\n | {\n /** 地理数据简化 */\n type: 'simplify';\n options: ISimplifyOptions;\n }\n | {\n /** 数据维度处理,包括排序,逆序,数据筛选能力 */\n type: 'fields';\n options: IFieldsOptions;\n }\n | {\n /** 使用回调的自定义筛选 */\n type: 'filter';\n options: IFilterOptions;\n }\n | {\n /** 数据展开 */\n type: 'fold';\n options: IFoldOptions;\n };\n\nexport interface IFieldsMeta {\n /** TODO: 字段通用format, 暂时先不支持 */\n // format?: (datum: Datum, index: number) => unknown;\n /** 字段别名 */\n alias?: string;\n /** 字段取值范围 */\n domain?: StringOrNumber[];\n /** 是否使用 domain 锁定统计信息。默认为 false */\n lockStatisticsByDomain?: boolean;\n /** 连续型 还是 离散型 */\n type?: 'ordinal' | 'linear';\n /** 排序顺序 不设置的话当前维度不进行排序 */\n sortIndex?: number;\n /** 排序时是否反转 默认为 false */\n sortReverse?: boolean;\n}\n\nexport interface SheetParseOptions extends CommonParseOptions {\n type: 'csv' | 'dsv' | 'tsv';\n options?: IDsvParserOptions;\n}\n\nexport interface CommonParseOptions {\n /**\n * 是否需要对数据进行 clone,默认为 true。\n * 如果考虑性能,你可以将其关闭,但是这会带了一些副作用,即我们会对传入的数据进行修改(不会对原有字段及值修改,只会在原有数据基础上添加一些字段)。\n * @default true\n * @since 1.3.0\n */\n clone?: boolean;\n}\n\nexport interface IDataValues {\n /**\n * 数据唯一标识\n */\n id?: StringOrNumber;\n /**\n * 数据\n */\n values: Datum[] | string;\n /**\n * 引用的数据索引\n */\n fromDataIndex?: number;\n /**\n * 引用的数据 id\n */\n fromDataId?: StringOrNumber;\n /**\n * 数据 transform 配置\n */\n transforms?: BuildInTransformOptions[];\n /**\n * 数据字段相关配置\n */\n fields?: Record<\n /** 字段key */\n string,\n IFieldsMeta\n >;\n\n parser?: SheetParseOptions | CommonParseOptions;\n}\n\nexport type IHierarchyNodeData = {\n value?: number;\n children?: IHierarchyNodeData[];\n} & Datum;\n\nexport interface IHierarchyDataValues extends Omit<IDataValues, 'values'> {\n values: IHierarchyNodeData;\n}\n\nexport type IHierarchyData = DataView | IHierarchyDataValues;\n\n/** series */\nexport interface ISeriesSpec extends ITriggerSpec {\n /** 系列类型 */\n type: SeriesType;\n\n /** 系列名称 */\n name?: string;\n\n /** 用户自定义的 series id */\n id?: StringOrNumber;\n /**\n * 系列数据\n * @description 系列可以配置自身的数据,也可以从chart.data中获取数据\n */\n data?: IDataType;\n /**\n * 系列关联的数据索引\n * @default 0\n */\n dataIndex?: number;\n /**\n * 系列关联的数据id\n */\n dataId?: StringOrNumber;\n /**\n * dataKey用于绑定数据与Mark的关系, 该配置在动画中非常重要.\n */\n dataKey?: DataKeyType;\n\n /**\n * 系列关联的region索引\n * @default 0\n */\n regionIndex?: number;\n /** 系列关联的region id */\n regionId?: StringOrNumber;\n /**\n * 分组字段\n */\n seriesField?: string;\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /** 是否对数据进行堆叠处理 */\n stack?: boolean;\n\n /**\n * 堆叠时的分组值\n * stackValue 相等的系列将在一起堆积。没有配置的系列将在一组\n * @since 1.4.0\n */\n stackValue?: StringOrNumber;\n\n /** 堆叠汇总标签\n * @since 1.3.0\n */\n totalLabel?: ITotalLabelSpec;\n\n /** 是否对数据进行百分比处理 */\n percent?: boolean;\n\n /** 是否围绕中心轴偏移轮廓 */\n stackOffsetSilhouette?: boolean;\n\n /**\n * 非合规数据点连接方式\n * @description null,undefined等非法数据点连接方式。\n * @default 'break'\n * 'break'指在该数据点处断开\n * 'link' 指忽略该点保持连续\n * 'zero' 指该点默认数值为0\n * 'ignore' 指不处理\n */\n invalidType?: IInvalidType;\n\n /** 提示信息 */\n tooltip?: ITooltipSpec;\n\n /**\n * 是否开启系列动画\n */\n animation?: boolean;\n /**\n * 自动关闭动画的阀值,对应的是单系列data的长度\n * @since 1.2.0\n */\n animationThreshold?: number;\n\n /**\n * 是否支持3d视角\n */\n support3d?: boolean;\n /**\n * morph 动画配置\n */\n morph?: IMorphSeriesSpec;\n\n /**\n * 扩展mark\n */\n extensionMark?: (IExtensionMarkSpec<Exclude<EnableMarkType, MarkTypeEnum.group>> | IExtensionGroupMarkSpec)[];\n\n /**\n * series background\n * 作用是支持系列的图形对系列背景进行 mask,或者切分等效果。不是作为背景图\n * 暂时不开放api,避免出现break change\n */\n // background?: IBackgroundSpec;\n}\n\nexport type IChartExtendsSeriesSpec<T extends ISeriesSpec> = Omit<T, 'data' | 'morph' | 'stackValue'>;\n\nexport type AdaptiveSpec<T, K extends keyof any> = {\n [key in Exclude<keyof T, K>]: T[key];\n} & { [key in K]: any };\n\n/** markSpec */\nexport type IMarkSpec<T extends ICommonSpec = ICommonSpec> = {\n /**\n * 用户id\n */\n id?: StringOrNumber;\n /**\n * 是否响应交互\n */\n interactive?: boolean;\n // /**\n // * 是否会被region区域裁减\n // * @todo 暂未支持\n // */\n // clip?: boolean;\n /**\n * 与其他mark元素的层级\n */\n zIndex?: number;\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: ConvertToMarkStyleSpec<T>;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, IMarkStateSpec<T> | IMarkStateStyleSpec<T>>;\n\n /* 是否是3d视角的mark */\n support3d?: boolean;\n} & IMarkProgressiveConfig;\n\nexport type IMarkStateFilter =\n | {\n /** 维度筛选 */\n fields: { [key in string]: { type: 'ordinal' | 'linear'; domain: StringOrNumber[] } };\n }\n | {\n /** 筛选数据 */\n datums: Datum[];\n /** 筛选数据 */\n datumKeys: string[];\n }\n | {\n /** 筛选 item */\n items: IElement[];\n }\n /** 筛选函数 */\n | ((datum: Datum, options: Record<string, any>) => boolean);\n\nexport interface IMarkStateSpec<T> {\n /** 筛选器 */\n filter?: IMarkStateFilter;\n /** 状态优先级 */\n level?: number | undefined;\n style: ConvertToMarkStyleSpec<T>;\n}\n\nexport type IMarkStateStyleSpec<T> = ConvertToMarkStyleSpec<T>;\n\nexport type IMarkTheme<T> = {\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: T;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, T>;\n /**\n * 可交互的开关\n */\n interactive?: boolean;\n};\n\nexport interface IPerformanceHook {\n // InitRender\n // ├── InitializeChart\n // ├── CompileToVGrammar\n // ├── ParseView\n // | └── ParseExpression\n // ├── (new View)\n // | ├── CreateRuntime\n // | └── (view.initialize)\n // | └── CreateVRenderStage\n // └── SrViewEvaluateAsync / SrViewRunAsync\n // ├── MarkTransform\n // ├── FacetTransform\n // ├── CreateVRenderMark\n // └── VRenderDraw\n\n // 初始化图表配置\n beforeInitializeChart?: () => void;\n afterInitializeChart?: () => void;\n\n // 编译\n beforeCompileToVGrammar?: () => void;\n afterCompileToVGrammar?: () => void;\n // 各个图表模块编译\n beforeRegionCompile?: () => void;\n afterRegionCompile?: () => void;\n beforeSeriesCompile?: () => void;\n afterSeriesCompile?: () => void;\n beforeComponentCompile?: () => void;\n afterComponentCompile?: () => void;\n\n // resize的时候的钩子\n beforeResizeWithUpdate?: () => void;\n afterResizeWithUpdate?: () => void;\n\n // LayoutWithSceneGraph 二次布局\n beforeLayoutWithSceneGraph?: () => void;\n afterLayoutWithSceneGraph?: () => void;\n\n // VGrammar 解析spec\n beforeParseView?: () => void;\n afterParseView?: () => void;\n\n // 初始化runtime\n beforeCreateRuntime?: () => void;\n afterCreateRuntime?: () => void;\n\n // VGrammar EvaluateAsync 时间\n beforeSrViewEvaluateAsync?: () => void;\n afterSrViewEvaluateAsync?: () => void;\n\n // VGrammar RunAsync 时间\n beforeSrViewRunAsync?: () => void;\n afterSrViewRunAsync?: () => void;\n\n // transform测量\n beforeTransform?: (name: string) => void;\n afterTransform?: (name: string) => void;\n\n // Create VRender Stage 时间\n beforeCreateVRenderStage?: () => void;\n afterCreateVRenderStage?: () => void;\n\n // Create VRender Mark 时间\n beforeCreateVRenderMark?: () => void;\n afterCreateVRenderMark?: () => void;\n\n // VRender Draw 时间\n beforeVRenderDraw?: () => void;\n afterVRenderDraw?: () => void;\n}\n\nexport type IBuildinMarkSpec = {\n [MarkTypeEnum.group]: IGroupMarkSpec;\n\n [MarkTypeEnum.symbol]: ISymbolMarkSpec;\n [MarkTypeEnum.rule]: IRuleMarkSpec;\n [MarkTypeEnum.line]: ILineMarkSpec;\n [MarkTypeEnum.text]: ITextMarkSpec;\n [MarkTypeEnum.rect]: IRectMarkSpec;\n [MarkTypeEnum.rect3d]: IRect3dMarkSpec;\n [MarkTypeEnum.image]: IImageMarkSpec;\n [MarkTypeEnum.path]: IPathMarkSpec;\n [MarkTypeEnum.area]: IAreaMarkSpec;\n [MarkTypeEnum.arc]: IArcMarkSpec;\n [MarkTypeEnum.arc3d]: IArc3dMarkSpec;\n [MarkTypeEnum.polygon]: IPolygonMarkSpec;\n [MarkTypeEnum.pyramid3d]: IPyramid3dMarkSpec;\n [MarkTypeEnum.boxPlot]: IBoxPlotMarkSpec;\n [MarkTypeEnum.linkPath]: ILinkPathMarkSpec;\n [MarkTypeEnum.progressArc]: IProgressArcMarkSpec;\n [MarkTypeEnum.ripple]: IRippleMarkSpec;\n};\nexport type EnableMarkType = keyof IBuildinMarkSpec;\nexport interface ICustomMarkSpec<T extends EnableMarkType> extends IMarkSpec<IBuildinMarkSpec[T]> {\n type: T;\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\nexport interface ICustomMarkGroupSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n\nexport interface IExtensionMarkSpec<T extends Exclude<EnableMarkType, MarkTypeEnum.group>> extends ICustomMarkSpec<T> {\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\n\nexport interface IExtensionGroupMarkSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n /**\n * 支持子节点\n */\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/typings/spec/common.ts"],"names":[],"mappings":"AAiHA,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,qDAAqC,CAAA;IACrC,mDAAmC,CAAA;IACnC,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;IACX,qDAAqC,CAAA;IACrC,+BAAe,CAAA;AACjB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","file":"common.js","sourcesContent":["import type { IFillMarkSpec, IImageMarkSpec } from '../visual';\nimport type { LayoutCallBack } from '../../layout/interface';\nimport type { IElement, srIOption3DType } from '@visactor/vgrammar-core';\nimport type {\n DataSet,\n DataView,\n ISimplifyOptions,\n IFieldsOptions,\n IFilterOptions,\n IFoldOptions,\n IDsvParserOptions\n} from '@visactor/vdataset';\nimport type { IRegionSpec } from '../../region/interface';\nimport type { IHoverSpec, ISelectSpec, ITriggerSpec } from '../../interaction/interface';\nimport type { IRenderOption } from '../../compile/interface';\nimport type { ITooltipSpec } from '../../component/tooltip/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILayoutSpec } from '../../layout/interface';\n// eslint-disable-next-line no-duplicate-imports\nimport type {\n ConvertToMarkStyleSpec,\n IArc3dMarkSpec,\n IArcMarkSpec,\n IAreaMarkSpec,\n IBoxPlotMarkSpec,\n ICommonSpec,\n IGroupMarkSpec,\n ILineMarkSpec,\n ILinkPathMarkSpec,\n IPathMarkSpec,\n IPolygonMarkSpec,\n IProgressArcMarkSpec,\n IPyramid3dMarkSpec,\n IRect3dMarkSpec,\n IRectMarkSpec,\n IRuleMarkSpec,\n ISymbolMarkSpec,\n IRippleMarkSpec,\n ITextMarkSpec,\n IVisualSpecScale\n} from '../visual';\nimport type { StateValue } from '../../compile/mark';\nimport type { ISeriesStyle, SeriesType } from '../../series/interface';\nimport type { Datum, StringOrNumber } from '../common';\nimport type { IInvalidType } from '../data';\nimport type { IMorphSeriesSpec } from '../../animation/spec';\nimport type { IPlayer } from '../../component/player';\nimport type { IMarkProgressiveConfig, MarkTypeEnum } from '../../mark/interface';\nimport type { IDataZoomSpec, IScrollBarSpec } from '../../component/data-zoom';\nimport type { ICrosshairSpec } from '../../component/crosshair/interface';\nimport type { ITheme } from '../../theme';\nimport type { ITitleSpec } from '../../component/title/interface';\nimport type { IBrushSpec } from '../../component/brush';\nimport type { ITotalLabelSpec } from '../../component/label';\nimport type { ILegendSpec } from '../../component/legend';\nimport type { IColorKey } from '../../theme/color-scheme/interface';\nimport type { ILayoutOrientPadding, ILayoutPaddingSpec } from '../layout';\n\nexport type IChartPadding = ILayoutOrientPadding | number;\n\n/** chart option */\nexport interface IInitOption extends Omit<IRenderOption, 'pluginList'> {\n /**\n * **仅生效于浏览器环境。**\n * 图表挂载的父容器,可以直接指定容器 id,也可以传入 dom 对象\n */\n dom?: string | HTMLElement;\n /**\n * 除去选择 dom 属性进行挂载父容器,也可以使用 renderCanvas 属性直接传入 canvas 实例/ canvasId\n * 小程序/小组件环境请直接传入 id\n */\n renderCanvas?: string | HTMLCanvasElement;\n /** 数据集 */\n dataSet?: DataSet;\n /** 是否自适应容器大小 */\n autoFit?: boolean;\n /**\n * 性能测试钩子\n */\n performanceHook?: IPerformanceHook;\n /**\n * 是否开启动画\n */\n animation?: boolean;\n /**\n * 3d配置\n */\n options3d?: srIOption3DType;\n\n /**\n * 自定义布局函数\n */\n layout?: LayoutCallBack;\n\n /**\n * 当文本省略时,鼠标 hover 到文本上时是否显示 poptip\n * @default true\n */\n poptip?: boolean;\n\n /**\n * 报错的回调函数\n * @since 1.2.0\n */\n onError?: (...args: any[]) => void;\n\n /**\n * 默认主题(支持完整主题对象或者主题名称,主题名称需要提前在 `ThemeManager` 中注册)\n * @since 1.3.0\n */\n theme?: string | ITheme;\n}\n\nexport enum RenderModeEnum {\n 'desktop-browser' = 'desktop-browser',\n 'mobile-browser' = 'mobile-browser',\n 'node' = 'node',\n 'worker' = 'worker',\n 'miniApp' = 'miniApp',\n 'wx' = 'wx',\n 'desktop-miniApp' = 'desktop-miniApp',\n 'lynx' = 'lynx'\n}\nexport type RenderMode = keyof typeof RenderModeEnum;\n\n/** chart spec */\nexport interface IChartSpec {\n /** 图表类型 */\n type: string;\n /** 数据 */\n data?: IData;\n /** 画布宽度 */\n width?: number;\n /** 画布高度 */\n height?: number;\n /**\n * 图表宽高是否自适应容器,浏览器环境下默认为 true。\n * 该配置的优先级高于构造函数中的 autoFit 配置。\n * 如果用户配置了 width,则以用户配置的 width 为准,height 同理。\n */\n autoFit?: boolean;\n /**\n * 图表整体 padding 设置\n */\n padding?: ILayoutPaddingSpec;\n /**\n * 图表色系配置\n */\n color?: string[] | Omit<IVisualSpecScale<unknown, string | IColorKey>, 'id'>;\n /**\n * 系列\n * @description 仅在组合图中使用, 文档中除组合图外均未透出该配置\n */\n series?: ISeriesSpec[];\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /**\n * 自动关闭动画的阀值,对应的是单系列data的长度\n * @since 1.2.0\n */\n animationThreshold?: number;\n\n /** hover 交互 */\n hover?: boolean | IHoverSpec;\n /** select 交互 */\n select?: boolean | ISelectSpec;\n\n /** region配置 */\n region?: IRegionSpec[];\n /** 图表标题配置 */\n title?: ITitleSpec;\n /** 布局配置 */\n layout?: ILayoutSpec;\n /** 图例配置 */\n legends?: ILegendSpec | ILegendSpec[];\n /** 十字辅助线配置 */\n crosshair?: ICrosshairSpec | ICrosshairSpec[];\n /** tooltip配置 */\n tooltip?: ITooltipSpec;\n /** 播放器配置 */\n player?: IPlayer;\n /** 缩略轴配置 */\n dataZoom?: IDataZoomSpec | IDataZoomSpec[];\n /** 滚动条配置 */\n scrollBar?: IScrollBarSpec | IScrollBarSpec[];\n /** 框选配置 */\n brush?: IBrushSpec;\n /** 全局 scale 配置 */\n scales?: IVisualSpecScale<unknown, unknown>[];\n /** 自定义mark */\n customMark?: ICustomMarkSpec<EnableMarkType>[];\n /**\n * 图表上的主题定义。\n * 可以直接配置主题名,前提是该主题名已经注册\n */\n theme?: Omit<ITheme, 'name'> | string;\n /**\n * 图表背景色配置,优先级高于构造函数中的 background 配置\n */\n background?: IBackgroundSpec;\n\n // TODO:后续开放,现在仍有问题\n // poptip?: PopTipAttributes;\n // TODO: 补充动画配置\n\n /**\n * 堆积时是否逆序\n * @default false\n * @since 1.4.0\n */\n stackInverse?: boolean;\n}\n\nexport type IBackgroundStyleSpec = ConvertToMarkStyleSpec<Omit<IFillMarkSpec, 'width' | 'height' | 'background'>> & {\n image?: IRectMarkSpec['background'];\n cornerRadius?: IRectMarkSpec['cornerRadius'];\n};\n\nexport type IBackgroundSpec = string | IBackgroundStyleSpec;\n\n/** data */\nexport type IDataType = IDataValues | DataView;\nexport type IData = IDataType | IDataType[];\nexport type DataKeyType = string | string[] | ((data: Datum, index: number) => string);\nexport type BuildInTransformOptions =\n | {\n /** 地理数据简化 */\n type: 'simplify';\n options: ISimplifyOptions;\n }\n | {\n /** 数据维度处理,包括排序,逆序,数据筛选能力 */\n type: 'fields';\n options: IFieldsOptions;\n }\n | {\n /** 使用回调的自定义筛选 */\n type: 'filter';\n options: IFilterOptions;\n }\n | {\n /** 数据展开 */\n type: 'fold';\n options: IFoldOptions;\n };\n\nexport interface IFieldsMeta {\n /** TODO: 字段通用format, 暂时先不支持 */\n // format?: (datum: Datum, index: number) => unknown;\n /** 字段别名 */\n alias?: string;\n /** 字段取值范围 */\n domain?: StringOrNumber[];\n /** 是否使用 domain 锁定统计信息。默认为 false */\n lockStatisticsByDomain?: boolean;\n /** 连续型 还是 离散型 */\n type?: 'ordinal' | 'linear';\n /** 排序顺序 不设置的话当前维度不进行排序 */\n sortIndex?: number;\n /** 排序时是否反转 默认为 false */\n sortReverse?: boolean;\n}\n\nexport interface SheetParseOptions extends CommonParseOptions {\n type: 'csv' | 'dsv' | 'tsv';\n options?: IDsvParserOptions;\n}\n\nexport interface CommonParseOptions {\n /**\n * 是否需要对数据进行 clone,默认为 true。\n * 如果考虑性能,你可以将其关闭,但是这会带了一些副作用,即我们会对传入的数据进行修改(不会对原有字段及值修改,只会在原有数据基础上添加一些字段)。\n * @default true\n * @since 1.3.0\n */\n clone?: boolean;\n}\n\nexport interface IDataValues {\n /**\n * 数据唯一标识\n */\n id?: StringOrNumber;\n /**\n * 数据\n */\n values: Datum[] | string;\n /**\n * 引用的数据索引\n */\n fromDataIndex?: number;\n /**\n * 引用的数据 id\n */\n fromDataId?: StringOrNumber;\n /**\n * 数据 transform 配置\n */\n transforms?: BuildInTransformOptions[];\n /**\n * 数据字段相关配置\n */\n fields?: Record<\n /** 字段key */\n string,\n IFieldsMeta\n >;\n\n parser?: SheetParseOptions | CommonParseOptions;\n}\n\nexport type IHierarchyNodeData = {\n value?: number;\n children?: IHierarchyNodeData[];\n} & Datum;\n\nexport interface IHierarchyDataValues extends Omit<IDataValues, 'values'> {\n values: IHierarchyNodeData;\n}\n\nexport type IHierarchyData = DataView | IHierarchyDataValues;\n\n/** series */\nexport interface ISeriesSpec extends ITriggerSpec {\n /** 系列类型 */\n type: SeriesType;\n\n /** 系列名称 */\n name?: string;\n\n /** 用户自定义的 series id */\n id?: StringOrNumber;\n /**\n * 系列数据\n * @description 系列可以配置自身的数据,也可以从chart.data中获取数据\n */\n data?: IDataType;\n /**\n * 系列关联的数据索引\n * @default 0\n */\n dataIndex?: number;\n /**\n * 系列关联的数据id\n */\n dataId?: StringOrNumber;\n /**\n * dataKey用于绑定数据与Mark的关系, 该配置在动画中非常重要.\n */\n dataKey?: DataKeyType;\n\n /**\n * 系列关联的region索引\n * @default 0\n */\n regionIndex?: number;\n /** 系列关联的region id */\n regionId?: StringOrNumber;\n /**\n * 分组字段\n */\n seriesField?: string;\n /**\n * 系列样式\n * @description 仅在图表配置了seriesField时生效\n */\n seriesStyle?: ISeriesStyle;\n\n /** 是否对数据进行堆叠处理 */\n stack?: boolean;\n\n /**\n * 堆叠时的分组值\n * stackValue 相等的系列将在一起堆积。没有配置的系列将在一组\n * @since 1.4.0\n */\n stackValue?: StringOrNumber;\n\n /** 堆叠汇总标签\n * @since 1.3.0\n */\n totalLabel?: ITotalLabelSpec;\n\n /** 是否对数据进行百分比处理 */\n percent?: boolean;\n\n /** 是否围绕中心轴偏移轮廓 */\n stackOffsetSilhouette?: boolean;\n\n /**\n * 非合规数据点连接方式\n * @description null,undefined等非法数据点连接方式。\n * @default 'break'\n * 'break'指在该数据点处断开\n * 'link' 指忽略该点保持连续\n * 'zero' 指该点默认数值为0\n * 'ignore' 指不处理\n */\n invalidType?: IInvalidType;\n\n /** 提示信息 */\n tooltip?: ITooltipSpec;\n\n /**\n * 是否开启系列动画\n */\n animation?: boolean;\n /**\n * 自动关闭动画的阀值,对应的是单系列data的长度\n * @since 1.2.0\n */\n animationThreshold?: number;\n\n /**\n * 是否支持3d视角\n */\n support3d?: boolean;\n /**\n * morph 动画配置\n */\n morph?: IMorphSeriesSpec;\n\n /**\n * 扩展mark\n */\n extensionMark?: (IExtensionMarkSpec<Exclude<EnableMarkType, MarkTypeEnum.group>> | IExtensionGroupMarkSpec)[];\n\n /**\n * series background\n * 作用是支持系列的图形对系列背景进行 mask,或者切分等效果。不是作为背景图\n * 暂时不开放api,避免出现break change\n */\n // background?: IBackgroundSpec;\n}\n\nexport type IChartExtendsSeriesSpec<T extends ISeriesSpec> = Omit<T, 'data' | 'morph' | 'stackValue'>;\n\nexport type AdaptiveSpec<T, K extends keyof any> = {\n [key in Exclude<keyof T, K>]: T[key];\n} & { [key in K]: any };\n\n/** markSpec */\nexport type IMarkSpec<T extends ICommonSpec = ICommonSpec> = {\n /**\n * 用户id\n */\n id?: StringOrNumber;\n /**\n * 是否响应交互\n */\n interactive?: boolean;\n // /**\n // * 是否会被region区域裁减\n // * @todo 暂未支持\n // */\n // clip?: boolean;\n /**\n * 与其他mark元素的层级\n */\n zIndex?: number;\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: ConvertToMarkStyleSpec<T>;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, IMarkStateSpec<T> | IMarkStateStyleSpec<T>>;\n\n /* 是否是3d视角的mark */\n support3d?: boolean;\n} & IMarkProgressiveConfig;\n\nexport type IMarkStateFilter =\n | {\n /** 维度筛选 */\n fields: { [key in string]: { type: 'ordinal' | 'linear'; domain: StringOrNumber[] } };\n }\n | {\n /** 筛选数据 */\n datums: Datum[];\n /** 筛选数据 */\n datumKeys: string[];\n }\n | {\n /** 筛选 item */\n items: IElement[];\n }\n /** 筛选函数 */\n | ((datum: Datum, options: Record<string, any>) => boolean);\n\nexport interface IMarkStateSpec<T> {\n /** 筛选器 */\n filter?: IMarkStateFilter;\n /** 状态优先级 */\n level?: number | undefined;\n style: ConvertToMarkStyleSpec<T>;\n}\n\nexport type IMarkStateStyleSpec<T> = ConvertToMarkStyleSpec<T>;\n\nexport type IMarkTheme<T> = {\n /**\n * mark 层 是否显示配置\n */\n visible?: boolean;\n /** 默认样式设置 */\n style?: T;\n /** 不同状态下的样式配置 */\n state?: Record<StateValue, T>;\n /**\n * 可交互的开关\n */\n interactive?: boolean;\n};\n\nexport interface IPerformanceHook {\n // InitRender\n // ├── InitializeChart\n // ├── CompileToVGrammar\n // ├── ParseView\n // | └── ParseExpression\n // ├── (new View)\n // | ├── CreateRuntime\n // | └── (view.initialize)\n // | └── CreateVRenderStage\n // └── SrViewEvaluateAsync / SrViewRunAsync\n // ├── MarkTransform\n // ├── FacetTransform\n // ├── CreateVRenderMark\n // └── VRenderDraw\n\n // 初始化图表配置\n beforeInitializeChart?: () => void;\n afterInitializeChart?: () => void;\n\n // 编译\n beforeCompileToVGrammar?: () => void;\n afterCompileToVGrammar?: () => void;\n // 各个图表模块编译\n beforeRegionCompile?: () => void;\n afterRegionCompile?: () => void;\n beforeSeriesCompile?: () => void;\n afterSeriesCompile?: () => void;\n beforeComponentCompile?: () => void;\n afterComponentCompile?: () => void;\n\n // resize的时候的钩子\n beforeResizeWithUpdate?: () => void;\n afterResizeWithUpdate?: () => void;\n\n // LayoutWithSceneGraph 二次布局\n beforeLayoutWithSceneGraph?: () => void;\n afterLayoutWithSceneGraph?: () => void;\n\n // VGrammar 解析spec\n beforeParseView?: () => void;\n afterParseView?: () => void;\n\n // 初始化runtime\n beforeCreateRuntime?: () => void;\n afterCreateRuntime?: () => void;\n\n // VGrammar EvaluateAsync 时间\n beforeSrViewEvaluateAsync?: () => void;\n afterSrViewEvaluateAsync?: () => void;\n\n // VGrammar RunAsync 时间\n beforeSrViewRunAsync?: () => void;\n afterSrViewRunAsync?: () => void;\n\n // transform测量\n beforeTransform?: (name: string) => void;\n afterTransform?: (name: string) => void;\n\n // Create VRender Stage 时间\n beforeCreateVRenderStage?: () => void;\n afterCreateVRenderStage?: () => void;\n\n // Create VRender Mark 时间\n beforeCreateVRenderMark?: () => void;\n afterCreateVRenderMark?: () => void;\n\n // VRender Draw 时间\n beforeVRenderDraw?: () => void;\n afterVRenderDraw?: () => void;\n}\n\nexport type IBuildinMarkSpec = {\n [MarkTypeEnum.group]: IGroupMarkSpec;\n\n [MarkTypeEnum.symbol]: ISymbolMarkSpec;\n [MarkTypeEnum.rule]: IRuleMarkSpec;\n [MarkTypeEnum.line]: ILineMarkSpec;\n [MarkTypeEnum.text]: ITextMarkSpec;\n [MarkTypeEnum.rect]: IRectMarkSpec;\n [MarkTypeEnum.rect3d]: IRect3dMarkSpec;\n [MarkTypeEnum.image]: IImageMarkSpec;\n [MarkTypeEnum.path]: IPathMarkSpec;\n [MarkTypeEnum.area]: IAreaMarkSpec;\n [MarkTypeEnum.arc]: IArcMarkSpec;\n [MarkTypeEnum.arc3d]: IArc3dMarkSpec;\n [MarkTypeEnum.polygon]: IPolygonMarkSpec;\n [MarkTypeEnum.pyramid3d]: IPyramid3dMarkSpec;\n [MarkTypeEnum.boxPlot]: IBoxPlotMarkSpec;\n [MarkTypeEnum.linkPath]: ILinkPathMarkSpec;\n [MarkTypeEnum.progressArc]: IProgressArcMarkSpec;\n [MarkTypeEnum.ripple]: IRippleMarkSpec;\n};\nexport type EnableMarkType = keyof IBuildinMarkSpec;\nexport interface ICustomMarkSpec<T extends EnableMarkType> extends IMarkSpec<IBuildinMarkSpec[T]> {\n type: T;\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\nexport interface ICustomMarkGroupSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n\nexport interface IExtensionMarkSpec<T extends Exclude<EnableMarkType, MarkTypeEnum.group>> extends ICustomMarkSpec<T> {\n /**\n * 关联的数据索引\n * @default 与系列使用同一份数据\n */\n dataIndex?: number;\n /**\n * 关联的数据id\n */\n dataId?: StringOrNumber;\n}\n\nexport interface IExtensionGroupMarkSpec extends ICustomMarkSpec<MarkTypeEnum.group> {\n /**\n * 支持子节点\n */\n children?: ICustomMarkSpec<EnableMarkType>[];\n}\n"]}
|
package/esm/util/space.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IBoundsLike } from '@visactor/vutils';
|
|
2
|
-
import type { ILayoutPaddingSpec, IPercentOffset, ILayoutNumber, IPercent, ILayoutOrientPadding, ILayoutRect } from '../model/interface';
|
|
3
2
|
import type { IPadding, IRect } from '../typings/space';
|
|
4
3
|
import type { IPoint } from '../typings/coordinate';
|
|
4
|
+
import type { ILayoutNumber, ILayoutRect, IPercent, IPercentOffset, ILayoutPaddingSpec, ILayoutOrientPadding } from '../typings/layout';
|
|
5
5
|
export declare function isValidOrient(orient: string): boolean;
|
|
6
6
|
export declare function isPointInRect(point: IPoint, rect: IRect): boolean;
|
|
7
7
|
export declare function isPercent(v: any): v is IPercent;
|
package/esm/util/space.js.map
CHANGED
|
@@ -1 +1 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AI,OAAO,EAAE;QACX,OAAO;YACL,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAC5B,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;SAC7B,CAAC;KACH;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAQD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAA4B,EAAE,KAAa,EAAU,EAAE;IACvF,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC9C,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QAC9E,OAAO,KAAK,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;KACnF;IACD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC","file":"space.js","sourcesContent":["import { isArray, type IBoundsLike } from '@visactor/vutils';\nimport { isNumber, isNil, isString, isFunction, couldBeValidNumber, isObject } from './type';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/util/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAY7F,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,QAAQ,MAAM,EAAE;QACd,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;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,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QAC9E,OAAO,KAAK,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;KACnF;IACD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC","file":"space.js","sourcesContent":["import { isArray, type IBoundsLike } from '@visactor/vutils';\nimport { isNumber, isNil, isString, isFunction, couldBeValidNumber, isObject } from './type';\nimport type { IPadding, IRect } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\nimport type {\n ILayoutNumber,\n ILayoutRect,\n IPercent,\n IPercentOffset,\n ILayoutPaddingSpec,\n ILayoutOrientPadding\n} from '../typings/layout';\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\n/**\n * 将相对数值转换为绝对数值\n * @param originValue 原始值(相对值或绝对值)\n * @param total 总体值\n * @returns 实际绝对数值\n */\nexport const getActualNumValue = (originValue: number | string, total: number): number => {\n const originNumValue = Number(originValue);\n const originStrValue = originValue.toString();\n if (isNaN(originNumValue) && originStrValue[originStrValue.length - 1] === '%') {\n return total * (Number(originStrValue.slice(0, originStrValue.length - 1)) / 100);\n }\n return originNumValue;\n};\n"]}
|
package/esm/util/type.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isObject, isFunction, isArray, isString, isNumber, isRegExp, isBoolean,
|
|
|
3
3
|
export { isObject, isFunction, isArray, isString, isNumber, isRegExp, isBoolean, isDate, isUndefined, isNull, isNil, isValid, isArrayLike, isValidNumber, isPlainObject };
|
|
4
4
|
|
|
5
5
|
export function couldBeValidNumber(v) {
|
|
6
|
-
return
|
|
6
|
+
return null != v && "" !== v && (!!isNumber(v) || +v == +v);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function toValidNumber(v) {
|
package/esm/util/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,aAAa,EACd,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,QAAQ,EACR,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,aAAa,EACd,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,CAAM;IACvC,IAAI,KAAK,
|
|
1
|
+
{"version":3,"sources":["../src/util/type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,OAAO,EAC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OAAO,KAAK,CAAC;KACd;IACD,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;QAC/C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC","file":"type.js","sourcesContent":["import {\n isObject,\n isFunction,\n isArray,\n isString,\n isNumber,\n isRegExp,\n isBoolean,\n isDate,\n isUndefined,\n isNull,\n isNil,\n isValid,\n isArrayLike,\n isValidNumber,\n isPlainObject\n} from '@visactor/vutils';\nimport type { IDataDomainSpec } from '../typings';\n\nexport {\n isObject,\n isFunction,\n isArray,\n isString,\n isNumber,\n isRegExp,\n isBoolean,\n isDate,\n isUndefined,\n isNull,\n isNil,\n isValid,\n isArrayLike,\n isValidNumber,\n isPlainObject\n};\n\nexport function couldBeValidNumber(v: any) {\n if (v === null || v === undefined || v === '') {\n return false;\n }\n if (isNumber(v)) {\n return true;\n }\n // eslint-disable-next-line no-self-compare\n return +v === +v;\n}\n\nexport function toValidNumber(v: any) {\n if (isValidNumber(v)) {\n return v;\n }\n const value = +v;\n return isValidNumber(value) ? value : 0;\n}\n\n/**\n * 检测一段字符串为合法数值\n */\nexport function isNumeric(value: string): boolean {\n if (typeof value !== 'string') {\n return false;\n }\n return !isNaN(Number(value)) && !isNaN(parseFloat(value));\n}\n\nexport function isDataDomainSpec(domain: any): domain is IDataDomainSpec[] {\n if (!domain || domain.length === 0) {\n return false;\n }\n if (isNil(domain[0]) || isNil(domain[0].dataId)) {\n return false;\n }\n return isArray(domain[0].fields);\n}\n"]}
|