@visactor/vchart 1.8.8-alpha.1 → 1.8.10-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 +635 -581
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/config.js +1 -1
- package/cjs/animation/config.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +2 -1
- package/cjs/component/axis/base-axis.js +11 -1
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +9 -2
- package/cjs/component/axis/cartesian/axis.js +23 -8
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/spec.d.ts +19 -3
- package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.d.ts +6 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js +17 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +9 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +18 -5
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +1 -1
- package/cjs/component/axis/polar/axis.js +4 -4
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/brush/brush.js +3 -3
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/base.js +5 -4
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/cartesian.js +20 -17
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +6 -3
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.d.ts +1 -0
- package/cjs/component/geo/geo-coordinate.js +7 -6
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/indicator/indicator.js +2 -2
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/label/label.js +3 -3
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/total-label.js +3 -3
- package/cjs/component/label/total-label.js.map +1 -1
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/map-label/component.js +1 -1
- package/cjs/component/map-label/component.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js +3 -3
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/utils.js +6 -6
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/component/player/player.js +2 -1
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/constant/event.js +2 -1
- package/cjs/constant/scroll-bar.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/env/env.js +1 -1
- package/cjs/env/index.js +1 -1
- package/cjs/event/event-dispatcher.js +4 -6
- package/cjs/event/event-dispatcher.js.map +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/index.js +1 -1
- package/cjs/event/interface.js +1 -1
- package/cjs/interaction/interface.js +2 -1
- package/cjs/interaction/trigger.js +1 -1
- package/cjs/interaction/zoom/zoomable.js +9 -9
- package/cjs/interaction/zoom/zoomable.js.map +1 -1
- package/cjs/layout/base-layout.d.ts +46 -2
- package/cjs/layout/base-layout.js +194 -36
- package/cjs/layout/base-layout.js.map +1 -1
- package/cjs/layout/index.js +1 -1
- package/cjs/layout/interface.d.ts +1 -4
- package/cjs/layout/interface.js +1 -1
- package/cjs/layout/interface.js.map +1 -1
- package/cjs/layout/layout-item.d.ts +1 -5
- package/cjs/layout/layout-item.js +5 -25
- package/cjs/layout/layout-item.js.map +1 -1
- package/cjs/layout/layout3d/index.d.ts +1 -8
- package/cjs/layout/layout3d/index.js +10 -69
- package/cjs/layout/layout3d/index.js.map +1 -1
- package/cjs/layout/util.js +27 -69
- package/cjs/layout/util.js.map +1 -1
- package/cjs/model/base-model-transformer.d.ts +2 -1
- package/cjs/model/base-model-transformer.js +6 -2
- package/cjs/model/base-model-transformer.js.map +1 -1
- package/cjs/model/interface.d.ts +0 -2
- package/cjs/model/interface.js.map +1 -1
- package/cjs/model/layout-model.d.ts +0 -8
- package/cjs/model/layout-model.js +0 -15
- package/cjs/model/layout-model.js.map +1 -1
- package/cjs/series/area/area-transformer.d.ts +2 -0
- package/cjs/series/area/area-transformer.js +18 -1
- package/cjs/series/area/area-transformer.js.map +1 -1
- package/cjs/series/area/area.d.ts +0 -1
- package/cjs/series/area/area.js +1 -17
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/bar/bar.js +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series-transformer.js +1 -2
- package/cjs/series/base/base-series-transformer.js.map +1 -1
- package/cjs/series/base/base-series.js +14 -13
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/cartesian/cartesian.js +4 -3
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/correlation/correlation.js +1 -1
- package/cjs/series/correlation/correlation.js.map +1 -1
- package/cjs/series/mixin/line-mixin.js +1 -1
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/3d/pie-3d.js +1 -1
- package/cjs/series/pie/3d/pie-3d.js.map +1 -1
- package/cjs/series/pie/pie.js +7 -7
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/polar.js +1 -1
- package/cjs/series/polar/polar.js.map +1 -1
- package/cjs/series/radar/animation.js +1 -1
- package/cjs/series/radar/animation.js.map +1 -1
- package/cjs/series/sankey/sankey.js +1 -1
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/sunburst/sunburst.js +2 -2
- package/cjs/series/sunburst/sunburst.js.map +1 -1
- package/cjs/series/word-cloud/base.js +3 -3
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/theme/builtin/index.js +3 -1
- package/cjs/theme/builtin/index.js.map +1 -1
- package/cjs/typings/layout.d.ts +1 -1
- package/cjs/typings/layout.js.map +1 -1
- package/esm/animation/config.js +1 -1
- package/esm/animation/config.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +2 -1
- package/esm/component/axis/base-axis.js +11 -1
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +9 -2
- package/esm/component/axis/cartesian/axis.js +23 -8
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/spec.d.ts +19 -3
- package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.d.ts +6 -1
- package/esm/component/axis/mixin/band-axis-mixin.js +17 -1
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +9 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +19 -5
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +1 -1
- package/esm/component/axis/polar/axis.js +4 -4
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/brush/brush.js +3 -3
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/base.js +5 -4
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/cartesian.js +20 -17
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +6 -4
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/geo/geo-coordinate.d.ts +1 -0
- package/esm/component/geo/geo-coordinate.js +7 -6
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/indicator/indicator.js +2 -2
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/label/label.js +3 -3
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/total-label.js +3 -3
- package/esm/component/label/total-label.js.map +1 -1
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/map-label/component.js +1 -1
- package/esm/component/map-label/component.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js +3 -3
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/utils.js +6 -6
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/component/player/player.js +2 -1
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/constant/event.js +2 -1
- package/esm/constant/scroll-bar.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +1 -1
- package/esm/core/vchart.js.map +1 -1
- package/esm/env/env.js +1 -1
- package/esm/env/index.js +1 -1
- package/esm/event/event-dispatcher.js +4 -6
- package/esm/event/event-dispatcher.js.map +1 -1
- package/esm/event/event.js +1 -1
- package/esm/event/index.js +1 -1
- package/esm/event/interface.js +1 -1
- package/esm/interaction/interface.js +2 -1
- package/esm/interaction/trigger.js +1 -1
- package/esm/interaction/zoom/zoomable.js +8 -9
- package/esm/interaction/zoom/zoomable.js.map +1 -1
- package/esm/layout/base-layout.d.ts +46 -2
- package/esm/layout/base-layout.js +192 -36
- package/esm/layout/base-layout.js.map +1 -1
- package/esm/layout/index.js +1 -1
- package/esm/layout/interface.d.ts +1 -4
- package/esm/layout/interface.js +1 -1
- package/esm/layout/interface.js.map +1 -1
- package/esm/layout/layout-item.d.ts +1 -5
- package/esm/layout/layout-item.js +5 -24
- package/esm/layout/layout-item.js.map +1 -1
- package/esm/layout/layout3d/index.d.ts +1 -8
- package/esm/layout/layout3d/index.js +10 -69
- package/esm/layout/layout3d/index.js.map +1 -1
- package/esm/layout/util.js +27 -69
- package/esm/layout/util.js.map +1 -1
- package/esm/model/base-model-transformer.d.ts +2 -1
- package/esm/model/base-model-transformer.js +6 -2
- package/esm/model/base-model-transformer.js.map +1 -1
- package/esm/model/interface.d.ts +0 -2
- package/esm/model/interface.js.map +1 -1
- package/esm/model/layout-model.d.ts +0 -8
- package/esm/model/layout-model.js +0 -15
- package/esm/model/layout-model.js.map +1 -1
- package/esm/series/area/area-transformer.d.ts +2 -0
- package/esm/series/area/area-transformer.js +19 -0
- package/esm/series/area/area-transformer.js.map +1 -1
- package/esm/series/area/area.d.ts +0 -1
- package/esm/series/area/area.js +1 -18
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/bar/bar.js +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series-transformer.js +1 -2
- package/esm/series/base/base-series-transformer.js.map +1 -1
- package/esm/series/base/base-series.js +13 -12
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/cartesian/cartesian.js +3 -2
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/correlation/correlation.js +1 -1
- package/esm/series/correlation/correlation.js.map +1 -1
- package/esm/series/mixin/line-mixin.js +1 -1
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/3d/pie-3d.js +1 -1
- package/esm/series/pie/3d/pie-3d.js.map +1 -1
- package/esm/series/pie/pie.js +7 -7
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/polar.js +1 -1
- package/esm/series/polar/polar.js.map +1 -1
- package/esm/series/radar/animation.js +1 -1
- package/esm/series/radar/animation.js.map +1 -1
- package/esm/series/sankey/sankey.js +1 -1
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/sunburst/sunburst.js +2 -2
- package/esm/series/sunburst/sunburst.js.map +1 -1
- package/esm/series/word-cloud/base.js +3 -3
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/theme/builtin/index.js +2 -1
- package/esm/theme/builtin/index.js.map +1 -1
- package/esm/typings/layout.d.ts +1 -1
- package/esm/typings/layout.js.map +1 -1
- package/package.json +14 -14
- package/cjs/theme/builtin/common-mobile/component/axis/band-axis.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/axis/band-axis.js +0 -22
- package/cjs/theme/builtin/common-mobile/component/axis/band-axis.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +0 -4
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.js +0 -40
- package/cjs/theme/builtin/common-mobile/component/axis/cartesian-axis.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/axis/common-axis.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/axis/common-axis.js +0 -42
- package/cjs/theme/builtin/common-mobile/component/axis/common-axis.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/axis/linear-axis.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/axis/linear-axis.js +0 -22
- package/cjs/theme/builtin/common-mobile/component/axis/linear-axis.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/axis/polar-axis.d.ts +0 -3
- package/cjs/theme/builtin/common-mobile/component/axis/polar-axis.js +0 -25
- package/cjs/theme/builtin/common-mobile/component/axis/polar-axis.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/crosshair.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/crosshair.js +0 -39
- package/cjs/theme/builtin/common-mobile/component/crosshair.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/data-zoom.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/data-zoom.js +0 -40
- package/cjs/theme/builtin/common-mobile/component/data-zoom.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/index.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/index.js +0 -34
- package/cjs/theme/builtin/common-mobile/component/index.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/indicator.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/indicator.js +0 -23
- package/cjs/theme/builtin/common-mobile/component/indicator.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/legend/color-legend.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/legend/color-legend.js +0 -23
- package/cjs/theme/builtin/common-mobile/component/legend/color-legend.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/legend/continuous.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/legend/continuous.js +0 -44
- package/cjs/theme/builtin/common-mobile/component/legend/continuous.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/legend/discrete-legend.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/legend/discrete-legend.js +0 -39
- package/cjs/theme/builtin/common-mobile/component/legend/discrete-legend.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/legend/size-legend.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/legend/size-legend.js +0 -23
- package/cjs/theme/builtin/common-mobile/component/legend/size-legend.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/map-label.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/map-label.js +0 -39
- package/cjs/theme/builtin/common-mobile/component/map-label.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/mark-area.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/mark-area.js +0 -24
- package/cjs/theme/builtin/common-mobile/component/mark-area.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/mark-line.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/mark-line.js +0 -33
- package/cjs/theme/builtin/common-mobile/component/mark-line.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/mark-point.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/mark-point.js +0 -19
- package/cjs/theme/builtin/common-mobile/component/mark-point.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/player.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/player.js +0 -51
- package/cjs/theme/builtin/common-mobile/component/player.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/poptip.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/poptip.js +0 -25
- package/cjs/theme/builtin/common-mobile/component/poptip.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/title.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/title.js +0 -23
- package/cjs/theme/builtin/common-mobile/component/title.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/tooltip.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/tooltip.js +0 -43
- package/cjs/theme/builtin/common-mobile/component/tooltip.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/component/total-label.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/component/total-label.js +0 -16
- package/cjs/theme/builtin/common-mobile/component/total-label.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/constants.d.ts +0 -2
- package/cjs/theme/builtin/common-mobile/constants.js +0 -23
- package/cjs/theme/builtin/common-mobile/constants.js.map +0 -1
- package/cjs/theme/builtin/common-mobile/mark.d.ts +0 -3
- package/cjs/theme/builtin/common-mobile/mark.js +0 -35
- package/cjs/theme/builtin/common-mobile/mark.js.map +0 -1
- package/cjs/theme/builtin/dark-mobile/index.d.ts +0 -2
- package/cjs/theme/builtin/dark-mobile/index.js +0 -18
- package/cjs/theme/builtin/dark-mobile/index.js.map +0 -1
- package/cjs/theme/builtin/light-mobile/index.d.ts +0 -2
- package/cjs/theme/builtin/light-mobile/index.js +0 -18
- package/cjs/theme/builtin/light-mobile/index.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/axis/band-axis.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/axis/band-axis.js +0 -18
- package/esm/theme/builtin/common-mobile/component/axis/band-axis.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.d.ts +0 -4
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.js +0 -38
- package/esm/theme/builtin/common-mobile/component/axis/cartesian-axis.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/axis/common-axis.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/axis/common-axis.js +0 -36
- package/esm/theme/builtin/common-mobile/component/axis/common-axis.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/axis/linear-axis.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/axis/linear-axis.js +0 -18
- package/esm/theme/builtin/common-mobile/component/axis/linear-axis.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/axis/polar-axis.d.ts +0 -3
- package/esm/theme/builtin/common-mobile/component/axis/polar-axis.js +0 -23
- package/esm/theme/builtin/common-mobile/component/axis/polar-axis.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/crosshair.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/crosshair.js +0 -35
- package/esm/theme/builtin/common-mobile/component/crosshair.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/data-zoom.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/data-zoom.js +0 -34
- package/esm/theme/builtin/common-mobile/component/data-zoom.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/index.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/index.js +0 -66
- package/esm/theme/builtin/common-mobile/component/index.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/indicator.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/indicator.js +0 -17
- package/esm/theme/builtin/common-mobile/component/indicator.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/legend/color-legend.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/legend/color-legend.js +0 -17
- package/esm/theme/builtin/common-mobile/component/legend/color-legend.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/legend/continuous.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/legend/continuous.js +0 -38
- package/esm/theme/builtin/common-mobile/component/legend/continuous.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/legend/discrete-legend.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/legend/discrete-legend.js +0 -33
- package/esm/theme/builtin/common-mobile/component/legend/discrete-legend.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/legend/size-legend.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/legend/size-legend.js +0 -17
- package/esm/theme/builtin/common-mobile/component/legend/size-legend.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/map-label.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/map-label.js +0 -33
- package/esm/theme/builtin/common-mobile/component/map-label.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/mark-area.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/mark-area.js +0 -18
- package/esm/theme/builtin/common-mobile/component/mark-area.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/mark-line.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/mark-line.js +0 -27
- package/esm/theme/builtin/common-mobile/component/mark-line.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/mark-point.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/mark-point.js +0 -15
- package/esm/theme/builtin/common-mobile/component/mark-point.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/player.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/player.js +0 -47
- package/esm/theme/builtin/common-mobile/component/player.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/poptip.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/poptip.js +0 -19
- package/esm/theme/builtin/common-mobile/component/poptip.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/title.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/title.js +0 -17
- package/esm/theme/builtin/common-mobile/component/title.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/tooltip.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/tooltip.js +0 -37
- package/esm/theme/builtin/common-mobile/component/tooltip.js.map +0 -1
- package/esm/theme/builtin/common-mobile/component/total-label.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/component/total-label.js +0 -10
- package/esm/theme/builtin/common-mobile/component/total-label.js.map +0 -1
- package/esm/theme/builtin/common-mobile/constants.d.ts +0 -2
- package/esm/theme/builtin/common-mobile/constants.js +0 -19
- package/esm/theme/builtin/common-mobile/constants.js.map +0 -1
- package/esm/theme/builtin/common-mobile/mark.d.ts +0 -3
- package/esm/theme/builtin/common-mobile/mark.js +0 -31
- package/esm/theme/builtin/common-mobile/mark.js.map +0 -1
- package/esm/theme/builtin/dark-mobile/index.d.ts +0 -2
- package/esm/theme/builtin/dark-mobile/index.js +0 -16
- package/esm/theme/builtin/dark-mobile/index.js.map +0 -1
- package/esm/theme/builtin/light-mobile/index.d.ts +0 -2
- package/esm/theme/builtin/light-mobile/index.js +0 -16
- package/esm/theme/builtin/light-mobile/index.js.map +0 -1
|
@@ -7,25 +7,118 @@ export class Layout {
|
|
|
7
7
|
this.leftCurrent = 0, this.topCurrent = 0, this.rightCurrent = 0, this.bottomCurrent = 0,
|
|
8
8
|
this._onError = null == ctx ? void 0 : ctx.onError;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
_layoutInit(_chart, items, chartLayoutRect, chartViewBox) {
|
|
11
11
|
this._chartLayoutRect = chartLayoutRect, this._chartViewBox = chartViewBox, this.leftCurrent = chartLayoutRect.x,
|
|
12
12
|
this.topCurrent = chartLayoutRect.y, this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width,
|
|
13
|
-
this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y, items.sort(((a, b) => b.layoutLevel - a.layoutLevel))
|
|
13
|
+
this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y, items.sort(((a, b) => b.layoutLevel - a.layoutLevel));
|
|
14
|
+
}
|
|
15
|
+
_layoutNormalItems(items) {
|
|
14
16
|
this.layoutNormalInlineItems(items.filter((x => "normal-inline" === x.layoutType))),
|
|
15
17
|
this.layoutNormalItems(items.filter((x => "normal" === x.layoutType)));
|
|
18
|
+
}
|
|
19
|
+
_groupItems(items) {
|
|
20
|
+
const regionItems = items.filter((x => "region" === x.layoutType)), relativeItems = items.filter((x => "region-relative" === x.layoutType)), relativeOverlapItems = items.filter((x => "region-relative-overlap" === x.layoutType)), allRelatives = relativeItems.concat(relativeOverlapItems), overlapItems = {
|
|
21
|
+
left: {
|
|
22
|
+
items: [],
|
|
23
|
+
rect: {
|
|
24
|
+
width: 0,
|
|
25
|
+
height: 0
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
right: {
|
|
29
|
+
items: [],
|
|
30
|
+
rect: {
|
|
31
|
+
width: 0,
|
|
32
|
+
height: 0
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
top: {
|
|
36
|
+
items: [],
|
|
37
|
+
rect: {
|
|
38
|
+
width: 0,
|
|
39
|
+
height: 0
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
bottom: {
|
|
43
|
+
items: [],
|
|
44
|
+
rect: {
|
|
45
|
+
width: 0,
|
|
46
|
+
height: 0
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
z: {
|
|
50
|
+
items: [],
|
|
51
|
+
rect: {
|
|
52
|
+
width: 0,
|
|
53
|
+
height: 0
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return relativeOverlapItems.forEach((i => {
|
|
58
|
+
overlapItems[i.layoutOrient].items.push(i);
|
|
59
|
+
})), {
|
|
60
|
+
regionItems: regionItems,
|
|
61
|
+
relativeItems: relativeItems,
|
|
62
|
+
relativeOverlapItems: relativeOverlapItems,
|
|
63
|
+
allRelatives: allRelatives,
|
|
64
|
+
overlapItems: overlapItems
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
68
|
+
this._layoutInit(_chart, items, chartLayoutRect, chartViewBox), this._layoutNormalItems(items);
|
|
16
69
|
const layoutTemp = {
|
|
17
70
|
left: this.leftCurrent,
|
|
18
71
|
top: this.topCurrent,
|
|
19
72
|
right: this.rightCurrent,
|
|
20
73
|
bottom: this.bottomCurrent
|
|
21
|
-
}, regionItems
|
|
22
|
-
|
|
23
|
-
|
|
74
|
+
}, {regionItems: regionItems, relativeItems: relativeItems, relativeOverlapItems: relativeOverlapItems, allRelatives: allRelatives, overlapItems: overlapItems} = this._groupItems(items);
|
|
75
|
+
this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems),
|
|
76
|
+
this._processAutoIndent(regionItems, relativeItems, relativeOverlapItems, overlapItems, allRelatives, layoutTemp),
|
|
77
|
+
this.layoutAbsoluteItems(items.filter((x => "absolute" === x.layoutType)));
|
|
78
|
+
}
|
|
79
|
+
_processAutoIndent(regionItems, relativeItems, relativeOverlapItems, overlapItems = {
|
|
80
|
+
left: {
|
|
81
|
+
items: [],
|
|
82
|
+
rect: {
|
|
83
|
+
width: 0,
|
|
84
|
+
height: 0
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
right: {
|
|
88
|
+
items: [],
|
|
89
|
+
rect: {
|
|
90
|
+
width: 0,
|
|
91
|
+
height: 0
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
top: {
|
|
95
|
+
items: [],
|
|
96
|
+
rect: {
|
|
97
|
+
width: 0,
|
|
98
|
+
height: 0
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
bottom: {
|
|
102
|
+
items: [],
|
|
103
|
+
rect: {
|
|
104
|
+
width: 0,
|
|
105
|
+
height: 0
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
z: {
|
|
109
|
+
items: [],
|
|
110
|
+
rect: {
|
|
111
|
+
width: 0,
|
|
112
|
+
height: 0
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, allRelatives, layoutTemp) {
|
|
116
|
+
if (allRelatives.some((i => i.autoIndent))) {
|
|
117
|
+
const {top: top, bottom: bottom, left: left, right: right} = this._checkAutoIndent(allRelatives, layoutTemp);
|
|
24
118
|
(top || bottom || left || right) && (this.topCurrent = layoutTemp.top + top, this.bottomCurrent = layoutTemp.bottom - bottom,
|
|
25
119
|
this.leftCurrent = layoutTemp.left + left, this.rightCurrent = layoutTemp.right - right,
|
|
26
|
-
this.layoutRegionItems(regionItems, relativeItems));
|
|
120
|
+
this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems));
|
|
27
121
|
}
|
|
28
|
-
this.layoutAbsoluteItems(items.filter((x => "absolute" === x.layoutType)));
|
|
29
122
|
}
|
|
30
123
|
layoutNormalItems(normalItems) {
|
|
31
124
|
normalItems.forEach((item => {
|
|
@@ -47,32 +140,44 @@ export class Layout {
|
|
|
47
140
|
}
|
|
48
141
|
layoutNormalInlineItems(normalItems) {
|
|
49
142
|
const leftItems = normalItems.filter((item => "left" === item.layoutOrient)), rightItems = normalItems.filter((item => "right" === item.layoutOrient)), topItems = normalItems.filter((item => "top" === item.layoutOrient)), bottomItems = normalItems.filter((item => "bottom" === item.layoutOrient)), limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x, limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
|
|
50
|
-
layoutLeftInlineItems(leftItems, this, limitHeight), layoutTopInlineItems(topItems, this, limitWidth),
|
|
51
|
-
layoutRightInlineItems(rightItems, this, limitHeight), layoutBottomInlineItems(bottomItems, this, limitWidth);
|
|
143
|
+
leftItems.length && layoutLeftInlineItems(leftItems, this, limitHeight), topItems.length && layoutTopInlineItems(topItems, this, limitWidth),
|
|
144
|
+
rightItems.length && layoutRightInlineItems(rightItems, this, limitHeight), bottomItems.length && layoutBottomInlineItems(bottomItems, this, limitWidth);
|
|
52
145
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
regionRelativeItems.filter((x => "left" === x.layoutOrient || "right" === x.layoutOrient)).forEach((item => {
|
|
146
|
+
_layoutRelativeOverlap(orient, info) {
|
|
147
|
+
info.items.forEach((item => {
|
|
56
148
|
const layoutRect = this.getItemComputeLayoutRect(item), rect = item.computeBoundsInRect(layoutRect);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
149
|
+
info.rect.width = Math.max(rect.width, info.rect.width), info.rect.height = Math.max(rect.height, info.rect.height);
|
|
150
|
+
})), info.items.forEach((item => {
|
|
151
|
+
item.setLayoutRect(info.rect), "left" === orient ? item.setLayoutStartPosition({
|
|
60
152
|
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61
|
-
})
|
|
62
|
-
item.setLayoutStartPosition({
|
|
153
|
+
}) : "right" === orient ? item.setLayoutStartPosition({
|
|
63
154
|
x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
})
|
|
155
|
+
}) : "top" === orient ? item.setLayoutStartPosition({
|
|
156
|
+
x: this.topCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
157
|
+
}) : item.setLayoutStartPosition({
|
|
158
|
+
x: this.bottomCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
159
|
+
});
|
|
160
|
+
})), "left" === orient ? this.leftCurrent += info.rect.width : "right" === orient ? this.rightCurrent -= info.rect.width : "top" === orient ? this.topCurrent += info.rect.height : this.bottomCurrent -= info.rect.height;
|
|
161
|
+
}
|
|
162
|
+
_layoutRelativeItem(item, layoutRect) {
|
|
163
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
164
|
+
"left" === item.layoutOrient || "right" === item.layoutOrient ? item.setLayoutRect({
|
|
165
|
+
width: rect.width
|
|
166
|
+
}) : item.setLayoutRect({
|
|
167
|
+
height: rect.height
|
|
168
|
+
}), "left" === item.layoutOrient ? (item.setLayoutStartPosition({
|
|
169
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
170
|
+
}), this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight) : "right" === item.layoutOrient ? (this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight,
|
|
171
|
+
item.setLayoutStartPosition({
|
|
172
|
+
x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
173
|
+
})) : "top" === item.layoutOrient ? (item.setLayoutStartPosition({
|
|
174
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
175
|
+
}), this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom) : "bottom" === item.layoutOrient && (this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom,
|
|
176
|
+
item.setLayoutStartPosition({
|
|
177
|
+
y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
_layoutRegionItem(regionItems, regionRelativeTotalWidth, regionRelativeTotalHeight) {
|
|
76
181
|
const regionWidth = Math.max(Math.min(regionRelativeTotalWidth, ...regionItems.map((region => {
|
|
77
182
|
var _a;
|
|
78
183
|
return null !== (_a = region.maxWidth) && void 0 !== _a ? _a : Number.MAX_VALUE;
|
|
@@ -80,7 +185,7 @@ export class Layout {
|
|
|
80
185
|
var _a;
|
|
81
186
|
return null !== (_a = region.maxHeight) && void 0 !== _a ? _a : Number.MAX_VALUE;
|
|
82
187
|
}))), 0);
|
|
83
|
-
regionItems.forEach((region => {
|
|
188
|
+
return regionItems.forEach((region => {
|
|
84
189
|
region.setLayoutRect({
|
|
85
190
|
width: regionWidth,
|
|
86
191
|
height: regionHeight
|
|
@@ -88,22 +193,73 @@ export class Layout {
|
|
|
88
193
|
x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
|
|
89
194
|
y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
|
|
90
195
|
});
|
|
91
|
-
})),
|
|
196
|
+
})), {
|
|
197
|
+
regionHeight: regionHeight,
|
|
198
|
+
regionWidth: regionWidth
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
layoutRegionItems(regionItems, regionRelativeItems, regionRelativeOverlapItems, overlapItems = {
|
|
202
|
+
left: {
|
|
203
|
+
items: [],
|
|
204
|
+
rect: {
|
|
205
|
+
width: 0,
|
|
206
|
+
height: 0
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
right: {
|
|
210
|
+
items: [],
|
|
211
|
+
rect: {
|
|
212
|
+
width: 0,
|
|
213
|
+
height: 0
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
top: {
|
|
217
|
+
items: [],
|
|
218
|
+
rect: {
|
|
219
|
+
width: 0,
|
|
220
|
+
height: 0
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
bottom: {
|
|
224
|
+
items: [],
|
|
225
|
+
rect: {
|
|
226
|
+
width: 0,
|
|
227
|
+
height: 0
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
z: {
|
|
231
|
+
items: [],
|
|
232
|
+
rect: {
|
|
233
|
+
width: 0,
|
|
234
|
+
height: 0
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}) {
|
|
238
|
+
let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent, regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
239
|
+
regionRelativeItems.filter((x => "left" === x.layoutOrient || "right" === x.layoutOrient)).forEach((item => {
|
|
240
|
+
this._layoutRelativeItem(item, this.getItemComputeLayoutRect(item));
|
|
241
|
+
})), this._layoutRelativeOverlap("left", overlapItems.left), this._layoutRelativeOverlap("right", overlapItems.right),
|
|
242
|
+
regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent, regionRelativeItems.filter((x => "top" === x.layoutOrient || "bottom" === x.layoutOrient)).forEach((item => {
|
|
243
|
+
this._layoutRelativeItem(item, this.getItemComputeLayoutRect(item));
|
|
244
|
+
})), this._layoutRelativeOverlap("top", overlapItems.top), this._layoutRelativeOverlap("bottom", overlapItems.bottom),
|
|
245
|
+
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
246
|
+
const {regionWidth: regionWidth, regionHeight: regionHeight} = this._layoutRegionItem(regionItems, regionRelativeTotalWidth, regionRelativeTotalHeight);
|
|
247
|
+
regionRelativeItems.concat(regionRelativeOverlapItems).forEach((item => {
|
|
92
248
|
if ([ "left", "right" ].includes(item.layoutOrient)) {
|
|
93
249
|
const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);
|
|
94
250
|
item.setLayoutRect({
|
|
95
|
-
height: relativeRegion.
|
|
251
|
+
height: relativeRegion.getLayoutRect().height
|
|
96
252
|
}), item.setLayoutStartPosition({
|
|
97
|
-
y: relativeRegion.
|
|
253
|
+
y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop
|
|
98
254
|
}), "right" === item.layoutOrient && item.setLayoutStartPosition({
|
|
99
255
|
x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth
|
|
100
256
|
});
|
|
101
257
|
} else if ([ "top", "bottom" ].includes(item.layoutOrient)) {
|
|
102
258
|
const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);
|
|
103
259
|
item.setLayoutRect({
|
|
104
|
-
width: relativeRegion.
|
|
260
|
+
width: relativeRegion.getLayoutRect().width
|
|
105
261
|
}), item.setLayoutStartPosition({
|
|
106
|
-
x: relativeRegion.
|
|
262
|
+
x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft
|
|
107
263
|
}), "bottom" === item.layoutOrient && item.setLayoutStartPosition({
|
|
108
264
|
y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight
|
|
109
265
|
});
|
|
@@ -153,4 +309,4 @@ export class Layout {
|
|
|
153
309
|
}
|
|
154
310
|
|
|
155
311
|
Layout.type = "base";
|
|
156
|
-
//# sourceMappingURL=base-layout.js.map
|
|
312
|
+
//# sourceMappingURL=base-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layout/base-layout.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAStH,MAAM,OAAO,MAAM;IAajB,YAAY,KAAe,EAAE,GAAqB;QAVlD,gBAAW,GAAW,CAAC,CAAC;QACxB,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,CAAC,CAAC;QACzB,kBAAa,GAAW,CAAC,CAAC;QAQxB,IAAI,CAAC,QAAQ,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC;IAC/B,CAAC;IAED,WAAW,CAAC,MAAc,EAAE,KAAoB,EAAE,eAAsB,EAAE,YAAyB;QACjG,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC;QAC9D,IAAI,CAAC,aAAa,GAAG,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC;QAEhE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;QAEpD,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,C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AC;QAE5C,MAAM,MAAM,GAAmB;YAC7B,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YAC1C,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK;YAClD,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YACxC,MAAM,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,MAAM;SACtD,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;;AA7SM,WAAI,GAAG,MAAM,CAAC","file":"base-layout.js","sourcesContent":["import type { utilFunctionCtx } from '../typings/params';\nimport type { IChart } from '../chart/interface/chart';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport type { IBaseLayout, ILayoutItem } from './interface';\nimport type { IPadding, IRect } from '../typings/space';\nimport { error } from '../util/debug';\nimport { layoutBottomInlineItems, layoutLeftInlineItems, layoutRightInlineItems, layoutTopInlineItems } from './util';\n\ntype LayoutSideType = {\n top: number;\n left: number;\n bottom: number;\n right: number;\n};\n\nexport class Layout implements IBaseLayout {\n static type = 'base';\n\n leftCurrent: number = 0;\n topCurrent: number = 0;\n rightCurrent: number = 0;\n bottomCurrent: number = 0;\n\n _chartLayoutRect!: IRect;\n _chartViewBox!: IBoundsLike;\n\n protected _onError: (msg: string) => void;\n\n constructor(_spec?: unknown, ctx?: utilFunctionCtx) {\n this._onError = ctx?.onError;\n }\n\n layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {\n this._chartLayoutRect = chartLayoutRect;\n this._chartViewBox = chartViewBox;\n this.leftCurrent = chartLayoutRect.x;\n this.topCurrent = chartLayoutRect.y;\n this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;\n this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;\n // 越大越先处理,进行排序调整,利用原地排序特性,排序会受 level 和传进来的数组顺序共同影响\n items.sort((a, b) => b.layoutLevel - a.layoutLevel);\n\n this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));\n this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));\n\n const layoutTemp: LayoutSideType = {\n left: this.leftCurrent,\n top: this.topCurrent,\n right: this.rightCurrent,\n bottom: this.bottomCurrent\n };\n const regionItems = items.filter(x => x.layoutType === 'region');\n const relativeItems = items.filter(x => x.layoutType === 'region-relative');\n // 有元素开启了自动缩进\n // TODO:目前只有普通占位布局下的 region-relative 元素支持\n // 主要考虑常规元素超出画布一般为用户个性设置,而且可以设置padding规避裁剪,不需要使用自动缩进\n this.layoutRegionItems(regionItems, relativeItems);\n if (relativeItems.some(i => i.autoIndent)) {\n // check auto indent\n const { top, bottom, left, right } = this._checkAutoIndent(relativeItems, layoutTemp);\n // 如果出现了需要自动缩进的场景 则基于缩进再次布局\n if (top || bottom || left || right) {\n // set outer bounds to padding\n this.topCurrent = layoutTemp.top + top;\n this.bottomCurrent = layoutTemp.bottom - bottom;\n this.leftCurrent = layoutTemp.left + left;\n this.rightCurrent = layoutTemp.right - right;\n // reLayout\n this.layoutRegionItems(regionItems, relativeItems);\n }\n }\n\n this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));\n }\n\n protected layoutNormalItems(normalItems: ILayoutItem[]): void {\n normalItems.forEach(item => {\n const layoutRect = this.getItemComputeLayoutRect(item);\n const rect = item.computeBoundsInRect(layoutRect);\n item.setLayoutRect(rect);\n\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,\n y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom\n });\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n }\n });\n }\n\n protected layoutNormalInlineItems(normalItems: ILayoutItem[]): void {\n const leftItems = normalItems.filter(item => item.layoutOrient === 'left');\n const rightItems = normalItems.filter(item => item.layoutOrient === 'right');\n const topItems = normalItems.filter(item => item.layoutOrient === 'top');\n const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');\n const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;\n const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;\n\n // 同 normal,按照 left、top、right、bottom 的顺序进行布局\n // 各个方向上再按照 position 进行分组布局,顺序为 start middle end\n layoutLeftInlineItems(leftItems, this, limitHeight);\n layoutTopInlineItems(topItems, this, limitWidth);\n layoutRightInlineItems(rightItems, this, limitHeight);\n layoutBottomInlineItems(bottomItems, this, limitWidth);\n }\n\n /**\n *\n * 1. 补全 region-relative rect 和部分 layoutStartPoint\n * 2. 补全 region rect 和 layoutStartPoint\n *\n */\n protected layoutRegionItems(regionItems: ILayoutItem[], regionRelativeItems: ILayoutItem[]): void {\n let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')\n .forEach(item => {\n const layoutRect = this.getItemComputeLayoutRect(item);\n const rect = item.computeBoundsInRect(layoutRect);\n item.setLayoutRect({ width: rect.width });\n // 减少尺寸\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'right') {\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n }\n });\n\n regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')\n .forEach(item => {\n const layoutRect = this.getItemComputeLayoutRect(item);\n const rect = item.computeBoundsInRect(layoutRect);\n item.setLayoutRect({ height: rect.height });\n\n // 减少尺寸\n if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'bottom') {\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n item.setLayoutStartPosition({\n y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n }\n });\n // 此时得到height\n regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n // region 处理\n const regionWidth = Math.max(\n Math.min(regionRelativeTotalWidth, ...regionItems.map(region => region.maxWidth ?? Number.MAX_VALUE)),\n 0\n );\n const regionHeight = Math.max(\n Math.min(regionRelativeTotalHeight, ...regionItems.map(region => region.maxHeight ?? Number.MAX_VALUE)),\n 0\n );\n regionItems.forEach(region => {\n region.setLayoutRect({\n width: regionWidth,\n height: regionHeight\n });\n\n region.setLayoutStartPosition({\n x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,\n y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop\n });\n });\n\n // region-relative 特殊处理\n regionRelativeItems.forEach(item => {\n // 处理特殊元素的宽高\n if (['left', 'right'].includes(item.layoutOrient)) {\n // 用户有配置的话,已经处理过,不需要再次处理\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n height: relativeRegion.layoutExcludeIndent.height\n });\n item.setLayoutStartPosition({\n y: relativeRegion.layoutExcludeIndent.y + item.layoutOffsetY + item.layoutPaddingTop\n });\n\n if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth\n });\n }\n } else if (['top', 'bottom'].includes(item.layoutOrient)) {\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n width: relativeRegion.layoutExcludeIndent.width\n });\n\n item.setLayoutStartPosition({\n x: relativeRegion.layoutExcludeIndent.x + item.layoutOffsetX + item.layoutPaddingLeft\n });\n\n if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight\n });\n }\n }\n });\n }\n\n /**\n * 再找出对 absolute 元素,无需排序,在 compiler 层需要排序放置\n *\n * 重要:absolute 默认依据 region 进行相对依赖\n */\n protected layoutAbsoluteItems(absoluteItems: ILayoutItem[]) {\n absoluteItems.forEach(item => {\n // 设置盒子\n item.absoluteLayoutInRect(this._chartLayoutRect);\n });\n }\n\n // 对普通布局来说,只出一个 region 绑定\n filterRegionsWithID(items: ILayoutItem[], id: number): ILayoutItem {\n const target = items.find(x => x.getModelId() === id);\n if (!target) {\n (this._onError ?? error)('can not find target region item, invalid id');\n }\n return target as ILayoutItem;\n }\n\n /**\n * 工具方法 根据item属性获取给item提供的布局空间\n * @param item\n */\n getItemComputeLayoutRect(item: ILayoutItem) {\n const result = {\n width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,\n height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom\n };\n return result;\n }\n\n protected _checkAutoIndent(\n items: ILayoutItem[],\n layoutTemp: {\n top: number;\n left: number;\n bottom: number;\n right: number;\n }\n ): IPadding {\n const result = {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n };\n items.forEach(i => {\n if (!i.getModelVisible() || !i.autoIndent) {\n return;\n }\n const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';\n const itemOuter = i.getLastComputeOutBounds();\n const outer = this._getOutInLayout(itemOuter, i, layoutTemp);\n if (vOrH) {\n result.top = Math.max(result.top, outer.top);\n result.bottom = Math.max(result.bottom, outer.bottom);\n } else {\n result.left = Math.max(result.left, outer.left);\n result.right = Math.max(result.right, outer.right);\n }\n });\n return result;\n }\n\n private _getOutInLayout(itemOuter: IBoundsLike, i: ILayoutItem, tempBorder: LayoutSideType): LayoutSideType {\n const { x, y } = i.getLayoutStartPoint();\n const { width, height } = i.getLayoutRect();\n\n const result: LayoutSideType = {\n left: tempBorder.left - (x - itemOuter.x1),\n right: x + width + itemOuter.x2 - tempBorder.right,\n top: tempBorder.top - (y - itemOuter.y1),\n bottom: y + height + itemOuter.y2 - tempBorder.bottom\n };\n return result;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/layout/base-layout.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAsBtH,MAAM,OAAO,MAAM;IAajB,YAAY,KAAe,EAAE,GAAqB;QAVlD,gBAAW,GAAW,CAAC,CAAC;QACxB,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,CAAC,CAAC;QACzB,kBAA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;IAEO,eAAe,CAAC,SAAsB,EAAE,CAAc,EAAE,UAA0B;QACxF,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,mBAAmB,EAAE,CAAC;QACzC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAmB;YAC7B,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YAC1C,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK;YAClD,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YACxC,MAAM,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,MAAM;SACtD,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;;AA5bM,WAAI,GAAG,MAAM,CAAC","file":"base-layout.js","sourcesContent":["import type { utilFunctionCtx } from '../typings/params';\nimport type { IChart } from '../chart/interface/chart';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport type { IBaseLayout, ILayoutItem } from './interface';\nimport type { IOrientType, IPadding, IRect } from '../typings/space';\nimport { error } from '../util/debug';\nimport { layoutBottomInlineItems, layoutLeftInlineItems, layoutRightInlineItems, layoutTopInlineItems } from './util';\nimport type { ILayoutRect } from '../typings/layout';\n\nexport type LayoutSideType = {\n top: number;\n left: number;\n bottom: number;\n right: number;\n};\n\nexport interface IOffset {\n offsetLeft: number;\n offsetRight: number;\n offsetTop: number;\n offsetBottom: number;\n}\n\ntype overlapInfo = {\n items: ILayoutItem[];\n rect: ILayoutRect;\n};\n\nexport class Layout implements IBaseLayout {\n static type = 'base';\n\n leftCurrent: number = 0;\n topCurrent: number = 0;\n rightCurrent: number = 0;\n bottomCurrent: number = 0;\n\n _chartLayoutRect!: IRect;\n _chartViewBox!: IBoundsLike;\n\n protected _onError: (msg: string) => void;\n\n constructor(_spec?: unknown, ctx?: utilFunctionCtx) {\n this._onError = ctx?.onError;\n }\n\n protected _layoutInit(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike) {\n this._chartLayoutRect = chartLayoutRect;\n this._chartViewBox = chartViewBox;\n this.leftCurrent = chartLayoutRect.x;\n this.topCurrent = chartLayoutRect.y;\n this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;\n this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;\n\n // 越大越先处理,进行排序调整,利用原地排序特性,排序会受 level 和传进来的数组顺序共同影响\n items.sort((a, b) => b.layoutLevel - a.layoutLevel);\n }\n\n protected _layoutNormalItems(items: ILayoutItem[]) {\n this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));\n this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));\n }\n\n protected _groupItems(items: ILayoutItem[]) {\n const regionItems = items.filter(x => x.layoutType === 'region');\n const relativeItems = items.filter(x => x.layoutType === 'region-relative');\n const relativeOverlapItems = items.filter(x => x.layoutType === 'region-relative-overlap');\n const allRelatives = relativeItems.concat(relativeOverlapItems);\n // 允许重叠元素 ,目前允许重叠元素认为是紧贴region的。最后布局\n const overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n };\n relativeOverlapItems.forEach(i => {\n overlapItems[i.layoutOrient].items.push(i);\n });\n\n return {\n regionItems,\n relativeItems,\n relativeOverlapItems,\n allRelatives,\n overlapItems\n };\n }\n\n layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {\n // 布局初始化\n this._layoutInit(_chart, items, chartLayoutRect, chartViewBox);\n // 先布局 normal 类型的元素\n this._layoutNormalItems(items);\n // 开始布局 region 相关元素\n // 为了锁紧先保存一下当前的布局空间\n const layoutTemp: LayoutSideType = {\n left: this.leftCurrent,\n top: this.topCurrent,\n right: this.rightCurrent,\n bottom: this.bottomCurrent\n };\n const { regionItems, relativeItems, relativeOverlapItems, allRelatives, overlapItems } = this._groupItems(items);\n // 有元素开启了自动缩进\n // TODO:目前只有普通占位布局下的 region-relative 元素支持\n // 主要考虑常规元素超出画布一般为用户个性设置,而且可以设置padding规避裁剪,不需要使用自动缩进\n this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems);\n // 缩进\n this._processAutoIndent(regionItems, relativeItems, relativeOverlapItems, overlapItems, allRelatives, layoutTemp);\n\n this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));\n }\n\n protected _processAutoIndent(\n regionItems: ILayoutItem[],\n relativeItems: ILayoutItem[],\n relativeOverlapItems: ILayoutItem[],\n overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n },\n allRelatives: ILayoutItem[],\n layoutTemp: LayoutSideType\n ): void {\n // 如果有缩进\n if (allRelatives.some(i => i.autoIndent)) {\n // check auto indent\n const { top, bottom, left, right } = this._checkAutoIndent(allRelatives, layoutTemp);\n // 如果出现了需要自动缩进的场景 则基于缩进再次布局\n if (top || bottom || left || right) {\n // set outer bounds to padding\n this.topCurrent = layoutTemp.top + top;\n this.bottomCurrent = layoutTemp.bottom - bottom;\n this.leftCurrent = layoutTemp.left + left;\n this.rightCurrent = layoutTemp.right - right;\n // reLayout\n this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems);\n }\n }\n }\n\n protected layoutNormalItems(normalItems: ILayoutItem[]): void {\n normalItems.forEach(item => {\n const layoutRect = this.getItemComputeLayoutRect(item);\n const rect = item.computeBoundsInRect(layoutRect);\n item.setLayoutRect(rect);\n\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,\n y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom\n });\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n }\n });\n }\n\n protected layoutNormalInlineItems(normalItems: ILayoutItem[]): void {\n const leftItems = normalItems.filter(item => item.layoutOrient === 'left');\n const rightItems = normalItems.filter(item => item.layoutOrient === 'right');\n const topItems = normalItems.filter(item => item.layoutOrient === 'top');\n const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');\n\n const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;\n const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;\n\n // 同 normal,按照 left、top、right、bottom 的顺序进行布局\n // 各个方向上再按照 position 进行分组布局,顺序为 start middle end\n leftItems.length && layoutLeftInlineItems(leftItems, this, limitHeight);\n topItems.length && layoutTopInlineItems(topItems, this, limitWidth);\n rightItems.length && layoutRightInlineItems(rightItems, this, limitHeight);\n bottomItems.length && layoutBottomInlineItems(bottomItems, this, limitWidth);\n }\n\n protected _layoutRelativeOverlap(orient: IOrientType, info: overlapInfo) {\n // 得到 max rect\n info.items.forEach((item: ILayoutItem) => {\n const layoutRect = this.getItemComputeLayoutRect(item);\n const rect = item.computeBoundsInRect(layoutRect);\n info.rect.width = Math.max(rect.width, info.rect.width);\n info.rect.height = Math.max(rect.height, info.rect.height);\n });\n\n // 统一设置rect和pos\n info.items.forEach((item: ILayoutItem) => {\n item.setLayoutRect(info.rect);\n if (orient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n } else if (orient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n } else if (orient === 'top') {\n item.setLayoutStartPosition({\n x: this.topCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n } else {\n item.setLayoutStartPosition({\n x: this.bottomCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n }\n });\n\n if (orient === 'left') {\n this.leftCurrent += info.rect.width;\n } else if (orient === 'right') {\n this.rightCurrent -= info.rect.width;\n } else if (orient === 'top') {\n this.topCurrent += info.rect.height;\n } else {\n this.bottomCurrent -= info.rect.height;\n }\n }\n\n protected _layoutRelativeItem(item: ILayoutItem, layoutRect: ILayoutRect) {\n const rect = item.computeBoundsInRect(layoutRect);\n if (item.layoutOrient === 'left' || item.layoutOrient === 'right') {\n item.setLayoutRect({ width: rect.width });\n } else {\n item.setLayoutRect({ height: rect.height });\n }\n // 减少尺寸\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'right') {\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n } // 减少尺寸\n else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'bottom') {\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n item.setLayoutStartPosition({\n y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n }\n }\n\n protected _layoutRegionItem(\n regionItems: ILayoutItem[],\n regionRelativeTotalWidth: number,\n regionRelativeTotalHeight: number\n ) {\n // region 处理\n const regionWidth = Math.max(\n Math.min(regionRelativeTotalWidth, ...regionItems.map(region => region.maxWidth ?? Number.MAX_VALUE)),\n 0\n );\n const regionHeight = Math.max(\n Math.min(regionRelativeTotalHeight, ...regionItems.map(region => region.maxHeight ?? Number.MAX_VALUE)),\n 0\n );\n regionItems.forEach(region => {\n region.setLayoutRect({\n width: regionWidth,\n height: regionHeight\n });\n\n region.setLayoutStartPosition({\n x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,\n y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop\n });\n });\n\n return {\n regionHeight,\n regionWidth\n };\n }\n\n /**\n *\n * 1. 补全 region-relative rect 和部分 layoutStartPoint\n * 2. 补全 region rect 和 layoutStartPoint\n *\n */\n protected layoutRegionItems(\n regionItems: ILayoutItem[],\n regionRelativeItems: ILayoutItem[],\n regionRelativeOverlapItems: ILayoutItem[],\n overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n }\n ): void {\n let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')\n .forEach(item => {\n this._layoutRelativeItem(item, this.getItemComputeLayoutRect(item));\n });\n\n this._layoutRelativeOverlap('left', overlapItems.left);\n this._layoutRelativeOverlap('right', overlapItems.right);\n\n regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')\n .forEach(item => {\n this._layoutRelativeItem(item, this.getItemComputeLayoutRect(item));\n });\n\n this._layoutRelativeOverlap('top', overlapItems.top);\n this._layoutRelativeOverlap('bottom', overlapItems.bottom);\n\n // 此时得到height\n regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n // region 处理\n const { regionWidth, regionHeight } = this._layoutRegionItem(\n regionItems,\n regionRelativeTotalWidth,\n regionRelativeTotalHeight\n );\n\n // region-relative 特殊处理\n regionRelativeItems.concat(regionRelativeOverlapItems).forEach(item => {\n // 处理特殊元素的宽高\n if (['left', 'right'].includes(item.layoutOrient)) {\n // 用户有配置的话,已经处理过,不需要再次处理\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n height: relativeRegion.getLayoutRect().height\n });\n item.setLayoutStartPosition({\n y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop\n });\n\n if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth\n });\n }\n } else if (['top', 'bottom'].includes(item.layoutOrient)) {\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n width: relativeRegion.getLayoutRect().width\n });\n\n item.setLayoutStartPosition({\n x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft\n });\n\n if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight\n });\n }\n }\n });\n }\n\n /**\n * 再找出对 absolute 元素,无需排序,在 compiler 层需要排序放置\n *\n * 重要:absolute 默认依据 region 进行相对依赖\n */\n protected layoutAbsoluteItems(absoluteItems: ILayoutItem[]) {\n absoluteItems.forEach(item => {\n // 设置盒子\n item.absoluteLayoutInRect(this._chartLayoutRect);\n });\n }\n\n // 对普通布局来说,只出一个 region 绑定\n filterRegionsWithID(items: ILayoutItem[], id: number): ILayoutItem {\n const target = items.find(x => x.getModelId() === id);\n if (!target) {\n (this._onError ?? error)('can not find target region item, invalid id');\n }\n return target as ILayoutItem;\n }\n\n /**\n * 工具方法 根据item属性获取给item提供的布局空间\n * @param item\n */\n getItemComputeLayoutRect(item: ILayoutItem) {\n const result = {\n width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,\n height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom\n };\n return result;\n }\n\n protected _checkAutoIndent(\n items: ILayoutItem[],\n layoutTemp: {\n top: number;\n left: number;\n bottom: number;\n right: number;\n }\n ): IPadding {\n const result = {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n };\n items.forEach(i => {\n if (!i.getModelVisible() || !i.autoIndent) {\n return;\n }\n const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';\n const itemOuter = i.getLastComputeOutBounds();\n const outer = this._getOutInLayout(itemOuter, i, layoutTemp);\n if (vOrH) {\n result.top = Math.max(result.top, outer.top);\n result.bottom = Math.max(result.bottom, outer.bottom);\n } else {\n result.left = Math.max(result.left, outer.left);\n result.right = Math.max(result.right, outer.right);\n }\n });\n return result;\n }\n\n private _getOutInLayout(itemOuter: IBoundsLike, i: ILayoutItem, tempBorder: LayoutSideType): LayoutSideType {\n const { x, y } = i.getLayoutStartPoint();\n const { width, height } = i.getLayoutRect();\n\n const result: LayoutSideType = {\n left: tempBorder.left - (x - itemOuter.x1),\n right: x + width + itemOuter.x2 - tempBorder.right,\n top: tempBorder.top - (y - itemOuter.y1),\n bottom: y + height + itemOuter.y2 - tempBorder.bottom\n };\n return result;\n }\n}\n"]}
|
package/esm/layout/index.js
CHANGED
|
@@ -5,4 +5,4 @@ import { GridLayout, registerGridLayout } from "./grid-layout/grid-layout";
|
|
|
5
5
|
import { Layout3d, registerLayout3d } from "./layout3d";
|
|
6
6
|
|
|
7
7
|
export { Layout, GridLayout, Layout3d, registerGridLayout, registerLayout3d };
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
2
2
|
import type { StringOrNumber } from '../typings/common';
|
|
3
|
-
import type { IOrientType,
|
|
3
|
+
import type { IOrientType, IRect } from '../typings/space';
|
|
4
4
|
import type { IPoint } from '../typings/coordinate';
|
|
5
5
|
import type { ILayoutNumber, ILayoutPaddingSpec, ILayoutPoint, ILayoutRect, ILayoutType } from '../typings/layout';
|
|
6
6
|
import type { ILayoutModel } from '../model/interface';
|
|
@@ -56,8 +56,6 @@ export interface ILayoutItem {
|
|
|
56
56
|
layoutPaddingTop: number;
|
|
57
57
|
layoutPaddingRight: number;
|
|
58
58
|
layoutPaddingBottom: number;
|
|
59
|
-
indent: IPadding;
|
|
60
|
-
layoutExcludeIndent: IRect;
|
|
61
59
|
layoutOffsetX: number;
|
|
62
60
|
layoutOffsetY: number;
|
|
63
61
|
layoutLevel: number;
|
|
@@ -89,7 +87,6 @@ export interface ILayoutItemSpec {
|
|
|
89
87
|
layoutLevel?: number;
|
|
90
88
|
orient?: IOrientType;
|
|
91
89
|
padding?: ILayoutPaddingSpec;
|
|
92
|
-
indent?: ILayoutPaddingSpec;
|
|
93
90
|
noOuterPadding?: boolean;
|
|
94
91
|
width?: ILayoutNumber;
|
|
95
92
|
maxWidth?: ILayoutNumber;
|
package/esm/layout/interface.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=interface.js.map
|
|
2
|
+
//# sourceMappingURL=interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layout/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { StringOrNumber } from '../typings/common';\nimport type { IOrientType,
|
|
1
|
+
{"version":3,"sources":["../src/layout/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { StringOrNumber } from '../typings/common';\nimport type { IOrientType, IRect } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\nimport type { ILayoutNumber, ILayoutPaddingSpec, ILayoutPoint, ILayoutRect, ILayoutType } from '../typings/layout';\nimport type { ILayoutModel } from '../model/interface';\n\nexport interface IBaseLayout {\n /**\n * 对一组布局元素布局\n * 布局策略随意\n * @param item 布局元素数组\n * @param chartLayoutRect 排除图表 padding 后的图表的布局矩形,原点是图表绘制区域左上角。\n * @param chartViewBox 图表在画布中的可用空间,包含图表padding,原点是画布左上角\n * @returns\n */\n layoutItems: LayoutCallBack;\n}\n\nexport type LayoutCallBack = (\n chart: any,\n item: ILayoutItem[],\n chartLayoutRect: IRect,\n chartViewBox: IBoundsLike\n) => void;\n\nexport interface ILayoutSpecBase {\n type: string;\n}\n\nexport type ElementSpec = (\n | {\n modelKey: string; // spec key\n modelIndex: number;\n }\n | {\n modelId: string;\n }\n) & {\n col: number;\n colSpan?: number;\n row: number;\n rowSpan?: number;\n};\n\nexport interface IGridLayoutSpec extends ILayoutSpecBase {\n type: 'grid';\n col: number;\n row: number;\n colWidth?: {\n index: number;\n size: number | ((maxSize: number) => number);\n }[];\n rowHeight?: {\n index: number;\n size: number | ((maxSize: number) => number);\n }[];\n elements: ElementSpec[];\n}\n\nexport interface IBaseLayoutSpec extends ILayoutSpecBase {\n type: 'base';\n}\n\nexport type ILayoutSpec = IBaseLayoutSpec | IGridLayoutSpec;\n\nexport interface ILayoutConstructor {\n type: string;\n // TODO: spec 类型生命\n new (spec: ILayoutSpec | any, ctx?: any): IBaseLayout;\n}\n\n/**\n * 因为这些元素都会继承到各个模块,所以这里统一有前缀避免语意冲突\n */\nexport interface ILayoutItem {\n readonly type: string;\n /**\n * 标记这个布局Item的方向(left->right, right->left, top->bottom, bottom->top)\n */\n directionStr?: 'l2r' | 'r2l' | 't2b' | 'b2t';\n layoutClip: boolean;\n layoutType: ILayoutType;\n layoutBindRegionID: number | number[];\n layoutOrient: IOrientType;\n /** 是否自动缩进 */\n autoIndent: boolean;\n\n layoutPaddingLeft: number;\n layoutPaddingTop: number;\n layoutPaddingRight: number;\n layoutPaddingBottom: number;\n\n layoutOffsetX: number;\n layoutOffsetY: number;\n\n // 越大越先处理\n layoutLevel: number;\n\n chartLayoutRect: ILayoutRect;\n\n readonly layoutRectLevelMap: ILayoutRect;\n minWidth: number;\n maxWidth: number;\n minHeight: number;\n maxHeight: number;\n\n readonly model: ILayoutModel;\n\n getModelId: () => StringOrNumber;\n getModelVisible: () => boolean;\n\n getSpec?: () => any;\n setAttrFromSpec: (spec: ILayoutItemSpec, chartViewRect: ILayoutRect) => void;\n\n setRectInSpec: (rect: ILayoutRect) => ILayoutRect;\n\n getLayoutStartPoint: () => ILayoutPoint;\n getLayoutRect: () => ILayoutRect;\n getLayout: () => IRect;\n getLastComputeOutBounds: () => IBoundsLike;\n\n /** 生命周期 */\n onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect, ctx: any) => void;\n onLayoutEnd: (option: any) => void;\n\n /**\n * 更新元素布局的 layoutRect 大小,用来更新指定布局空间\n */\n setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>) => void;\n /**\n * 基于元素内部逻辑计算占位空间,rect表示可用空间\n */\n computeBoundsInRect: (rect: ILayoutRect) => ILayoutRect;\n /**\n * 更新元素布局的起始点位置\n */\n setLayoutStartPosition: (pos: Partial<IPoint>) => void;\n /**\n * 更新绝对布局元素的位置信息\n */\n absoluteLayoutInRect: (rect: IRect) => void;\n}\n\nexport interface ILayoutItemSpec {\n /** 当前模块的布局类型,配置为 absolute 的话,当前元素会以图表左上角为原点进行绝对布局 */\n layoutType?: ILayoutType;\n /**\n * 布局顺序等级,等级越大的,越优先布局\n * 比如顶部同时有标题和图例的场景,期望标题先放在顶部,然后放置图例。\n */\n layoutLevel?: number;\n\n // 基础的布局配置\n /** 模块布局位置 */\n orient?: IOrientType;\n /** 模块的布局间距 */\n padding?: ILayoutPaddingSpec;\n /** 是否按照 orient 自动修改 padding,隐藏位于外侧的 padding。目前只在组件上生效 */\n noOuterPadding?: boolean;\n /** 模块的布局大小:宽度 */\n width?: ILayoutNumber;\n /** 模块的布局最大宽度 */\n maxWidth?: ILayoutNumber;\n /** 模块的布局最小宽度 */\n minWidth?: ILayoutNumber;\n /** 模块的布局大小:高度 */\n height?: ILayoutNumber;\n /** 模块的布局最大高度 */\n maxHeight?: ILayoutNumber;\n /** 模块的布局最小高度 */\n minHeight?: ILayoutNumber;\n /** 模块的布局位置偏移:X */\n offsetX?: ILayoutNumber;\n /** 模块的布局位置偏移:Y */\n offsetY?: ILayoutNumber;\n\n /** 模块的展示层级,当2个模块重叠时,层级较大的展示在上方 */\n zIndex?: number;\n /** 模块是否裁剪超出布局区域外的绘图内容 */\n clip?: boolean;\n\n // 绝对布局下的对齐设置\n\n /** 模块绝对布局下,与图表左侧的距离。注意仅在 layoutType === 'absolute' 时生效 */\n left?: ILayoutNumber;\n /** 模块绝对布局下,与图表右侧的距离。注意仅在 layoutType === 'absolute' 时生效 */\n right?: ILayoutNumber;\n /** 模块绝对布局下,与图表顶部的距离。注意仅在 layoutType === 'absolute' 时生效 */\n top?: ILayoutNumber;\n /** 模块绝对布局下,与图表底部的距离。注意仅在 layoutType === 'absolute' 时生效 */\n bottom?: ILayoutNumber;\n /** 模块绝对布局下,元素将放置在图表的正中间。注意仅在 layoutType === 'absolute' 时生效,同时将忽略 padding 属性 */\n center?: boolean;\n}\n\nexport interface ILayoutItemInitOption {\n layoutType: ILayoutType;\n layoutLevel: number;\n layoutOrient?: IOrientType;\n transformLayoutRect?: (rect: ILayoutRect) => ILayoutRect;\n transformLayoutPosition?: (pos: Partial<IPoint>) => Partial<IPoint>;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ILayoutModel } from './../model/interface';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IRect, IPoint } from '../typings';
|
|
3
3
|
import type { IBoundsLike } from '@visactor/vutils';
|
|
4
4
|
import type { ILayoutItem, ILayoutItemInitOption, ILayoutItemSpec } from './interface';
|
|
5
5
|
import type { IChartLayoutOption } from '../chart/interface/common';
|
|
@@ -39,10 +39,6 @@ export declare class LayoutItem implements ILayoutItem {
|
|
|
39
39
|
layoutPaddingTop: ILayoutItem['layoutPaddingTop'];
|
|
40
40
|
layoutPaddingRight: ILayoutItem['layoutPaddingRight'];
|
|
41
41
|
layoutPaddingBottom: ILayoutItem['layoutPaddingBottom'];
|
|
42
|
-
protected _indent: IPadding;
|
|
43
|
-
get indent(): IPadding;
|
|
44
|
-
private _layoutExcludeIndent;
|
|
45
|
-
get layoutExcludeIndent(): IRect;
|
|
46
42
|
layoutOffsetX: ILayoutItem['layoutOffsetX'];
|
|
47
43
|
layoutOffsetY: ILayoutItem['layoutOffsetY'];
|
|
48
44
|
layoutLevel: ILayoutItem['layoutLevel'];
|
|
@@ -47,12 +47,6 @@ export class LayoutItem {
|
|
|
47
47
|
set layoutOrient(v) {
|
|
48
48
|
this._layoutOrient = v;
|
|
49
49
|
}
|
|
50
|
-
get indent() {
|
|
51
|
-
return this._indent;
|
|
52
|
-
}
|
|
53
|
-
get layoutExcludeIndent() {
|
|
54
|
-
return this._layoutExcludeIndent;
|
|
55
|
-
}
|
|
56
50
|
get model() {
|
|
57
51
|
return this._model;
|
|
58
52
|
}
|
|
@@ -78,17 +72,7 @@ export class LayoutItem {
|
|
|
78
72
|
y2: 0
|
|
79
73
|
}, this.getLayoutRect = () => this._layoutRect, this.layoutType = "normal", this._layoutOrient = "left",
|
|
80
74
|
this.layoutPaddingLeft = 0, this.layoutPaddingTop = 0, this.layoutPaddingRight = 0,
|
|
81
|
-
this.layoutPaddingBottom = 0, this.
|
|
82
|
-
left: 0,
|
|
83
|
-
top: 0,
|
|
84
|
-
right: 0,
|
|
85
|
-
bottom: 0
|
|
86
|
-
}, this._layoutExcludeIndent = {
|
|
87
|
-
x: 0,
|
|
88
|
-
y: 0,
|
|
89
|
-
width: 0,
|
|
90
|
-
height: 0
|
|
91
|
-
}, this.layoutOffsetX = 0, this.layoutOffsetY = 0, this.layoutLevel = LayoutLevel.Region,
|
|
75
|
+
this.layoutPaddingBottom = 0, this.layoutOffsetX = 0, this.layoutOffsetY = 0, this.layoutLevel = LayoutLevel.Region,
|
|
92
76
|
this._model = model, this._option = option, this.layoutLevel = option.layoutLevel,
|
|
93
77
|
this.layoutType = option.layoutType, option.layoutOrient && (this.layoutOrient = option.layoutOrient),
|
|
94
78
|
this._spec = null === (_a = null == model ? void 0 : model.getSpec) || void 0 === _a ? void 0 : _a.call(model);
|
|
@@ -98,9 +82,8 @@ export class LayoutItem {
|
|
|
98
82
|
if (this._spec && !1 !== this._spec.visible) {
|
|
99
83
|
const padding = normalizeLayoutPaddingSpec(spec.padding), paddingValue = calcPadding(padding, chartViewRect, chartViewRect);
|
|
100
84
|
this.layoutPaddingLeft = paddingValue.left, this.layoutPaddingRight = paddingValue.right,
|
|
101
|
-
this.layoutPaddingTop = paddingValue.top, this.layoutPaddingBottom = paddingValue.bottom
|
|
102
|
-
|
|
103
|
-
this._indent = calcPadding(indent, chartViewRect, chartViewRect), this._minHeight = isNil(spec.minHeight) ? null !== (_a = this._minHeight) && void 0 !== _a ? _a : null : calcLayoutNumber(spec.minHeight, chartViewRect.height, chartViewRect),
|
|
85
|
+
this.layoutPaddingTop = paddingValue.top, this.layoutPaddingBottom = paddingValue.bottom,
|
|
86
|
+
this._minHeight = isNil(spec.minHeight) ? null !== (_a = this._minHeight) && void 0 !== _a ? _a : null : calcLayoutNumber(spec.minHeight, chartViewRect.height, chartViewRect),
|
|
104
87
|
this._maxHeight = isNil(spec.maxHeight) ? null !== (_b = this._maxHeight) && void 0 !== _b ? _b : null : calcLayoutNumber(spec.maxHeight, chartViewRect.height, chartViewRect),
|
|
105
88
|
this._minWidth = isNil(spec.minWidth) ? null !== (_c = this._minWidth) && void 0 !== _c ? _c : null : calcLayoutNumber(spec.minWidth, chartViewRect.width, chartViewRect),
|
|
106
89
|
this._maxWidth = isNil(spec.maxWidth) ? null !== (_d = this._maxWidth) && void 0 !== _d ? _d : null : calcLayoutNumber(spec.maxWidth, chartViewRect.width, chartViewRect),
|
|
@@ -164,7 +147,6 @@ export class LayoutItem {
|
|
|
164
147
|
var _a, _b;
|
|
165
148
|
this._option.transformLayoutPosition && (pos = this._option.transformLayoutPosition(pos)),
|
|
166
149
|
isValidNumber(pos.x) && (this._layoutStartPoint.x = pos.x), isValidNumber(pos.y) && (this._layoutStartPoint.y = pos.y),
|
|
167
|
-
this._layoutExcludeIndent.x = this._layoutStartPoint.x + this._indent.left, this._layoutExcludeIndent.y = this._layoutStartPoint.y + this._indent.top,
|
|
168
150
|
null === (_b = (_a = this._model).afterSetLayoutStartPoint) || void 0 === _b || _b.call(_a, this._layoutStartPoint);
|
|
169
151
|
}
|
|
170
152
|
setLayoutRect({width: width, height: height}, levelMap) {
|
|
@@ -173,8 +155,7 @@ export class LayoutItem {
|
|
|
173
155
|
this._layoutRectLevelMap.width = null !== (_b = null == levelMap ? void 0 : levelMap.width) && void 0 !== _b ? _b : DEFAULT_LAYOUT_RECT_LEVEL),
|
|
174
156
|
isValidNumber(height) && (null !== (_c = null == levelMap ? void 0 : levelMap.height) && void 0 !== _c ? _c : DEFAULT_LAYOUT_RECT_LEVEL) >= this._layoutRectLevelMap.height && (this._layoutRect.height = height,
|
|
175
157
|
this._layoutRectLevelMap.height = null !== (_d = null == levelMap ? void 0 : levelMap.height) && void 0 !== _d ? _d : DEFAULT_LAYOUT_RECT_LEVEL),
|
|
176
|
-
this.setRectInSpec(this._layoutRect)
|
|
177
|
-
this._layoutExcludeIndent.height = Math.max(this._layoutRect.height - this._indent.top - this._indent.bottom, 1);
|
|
158
|
+
this.setRectInSpec(this._layoutRect);
|
|
178
159
|
}
|
|
179
160
|
getLayout() {
|
|
180
161
|
return {
|
|
@@ -230,4 +211,4 @@ export class LayoutItem {
|
|
|
230
211
|
return this._model.getVisible();
|
|
231
212
|
}
|
|
232
213
|
}
|
|
233
|
-
//# sourceMappingURL=layout-item.js.map
|
|
214
|
+
//# sourceMappingURL=layout-item.js.map
|