@antv/g2 4.1.43 → 4.1.44
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/dist/g2.min.js +44 -0
- package/dist/g2.min.js.map +1 -0
- package/esm/animate/animation/fade.d.ts +21 -0
- package/esm/animate/animation/fade.js +42 -0
- package/esm/animate/animation/fade.js.map +1 -0
- package/esm/animate/animation/grow-in.d.ts +30 -0
- package/esm/animate/animation/grow-in.js +38 -0
- package/esm/animate/animation/grow-in.js.map +1 -0
- package/esm/animate/animation/index.d.ts +16 -0
- package/esm/animate/animation/index.js +17 -0
- package/esm/animate/animation/index.js.map +1 -0
- package/esm/animate/animation/path-in.d.ts +12 -0
- package/esm/animate/animation/path-in.js +21 -0
- package/esm/animate/animation/path-in.js.map +1 -0
- package/esm/animate/animation/position-update.d.ts +11 -0
- package/esm/animate/animation/position-update.js +24 -0
- package/esm/animate/animation/position-update.js.map +1 -0
- package/esm/animate/animation/scale-in.d.ts +19 -0
- package/esm/animate/animation/scale-in.js +60 -0
- package/esm/animate/animation/scale-in.js.map +1 -0
- package/esm/animate/animation/sector-path-update.d.ts +11 -0
- package/esm/animate/animation/sector-path-update.js +131 -0
- package/esm/animate/animation/sector-path-update.js.map +1 -0
- package/esm/animate/animation/util.d.ts +19 -0
- package/esm/animate/animation/util.js +88 -0
- package/esm/animate/animation/util.js.map +1 -0
- package/esm/animate/animation/wave-in.d.ts +13 -0
- package/esm/animate/animation/wave-in.js +26 -0
- package/esm/animate/animation/wave-in.js.map +1 -0
- package/esm/animate/animation/zoom.d.ts +21 -0
- package/esm/animate/animation/zoom.js +66 -0
- package/esm/animate/animation/zoom.js.map +1 -0
- package/esm/animate/index.d.ts +48 -0
- package/esm/animate/index.js +249 -0
- package/esm/animate/index.js.map +1 -0
- package/esm/animate/interface.d.ts +12 -0
- package/esm/animate/interface.js +2 -0
- package/esm/animate/interface.js.map +1 -0
- package/esm/api.d.ts +2 -0
- package/esm/api.js +3 -0
- package/esm/api.js.map +1 -0
- package/esm/base.d.ts +33 -0
- package/esm/base.js +55 -0
- package/esm/base.js.map +1 -0
- package/esm/chart/chart.d.ts +61 -0
- package/esm/chart/chart.js +157 -0
- package/esm/chart/chart.js.map +1 -0
- package/esm/chart/controller/annotation.d.ts +162 -0
- package/esm/chart/controller/annotation.js +581 -0
- package/esm/chart/controller/annotation.js.map +1 -0
- package/esm/chart/controller/axis.d.ts +93 -0
- package/esm/chart/controller/axis.js +578 -0
- package/esm/chart/controller/axis.js.map +1 -0
- package/esm/chart/controller/base.d.ts +64 -0
- package/esm/chart/controller/base.js +62 -0
- package/esm/chart/controller/base.js.map +1 -0
- package/esm/chart/controller/coordinate.d.ts +74 -0
- package/esm/chart/controller/coordinate.js +145 -0
- package/esm/chart/controller/coordinate.js.map +1 -0
- package/esm/chart/controller/gesture.d.ts +37 -0
- package/esm/chart/controller/gesture.js +258 -0
- package/esm/chart/controller/gesture.js.map +1 -0
- package/esm/chart/controller/index.d.ts +25 -0
- package/esm/chart/controller/index.js +34 -0
- package/esm/chart/controller/index.js.map +1 -0
- package/esm/chart/controller/legend.d.ts +106 -0
- package/esm/chart/controller/legend.js +484 -0
- package/esm/chart/controller/legend.js.map +1 -0
- package/esm/chart/controller/scrollbar.d.ts +64 -0
- package/esm/chart/controller/scrollbar.js +316 -0
- package/esm/chart/controller/scrollbar.js.map +1 -0
- package/esm/chart/controller/slider.d.ts +88 -0
- package/esm/chart/controller/slider.js +296 -0
- package/esm/chart/controller/slider.js.map +1 -0
- package/esm/chart/controller/tooltip.d.ts +68 -0
- package/esm/chart/controller/tooltip.js +644 -0
- package/esm/chart/controller/tooltip.js.map +1 -0
- package/esm/chart/event.d.ts +47 -0
- package/esm/chart/event.js +91 -0
- package/esm/chart/event.js.map +1 -0
- package/esm/chart/index.d.ts +4 -0
- package/esm/chart/index.js +5 -0
- package/esm/chart/index.js.map +1 -0
- package/esm/chart/layout/auto.d.ts +8 -0
- package/esm/chart/layout/auto.js +64 -0
- package/esm/chart/layout/auto.js.map +1 -0
- package/esm/chart/layout/constraint/bounds.d.ts +32 -0
- package/esm/chart/layout/constraint/bounds.js +30 -0
- package/esm/chart/layout/constraint/bounds.js.map +1 -0
- package/esm/chart/layout/constraint/constraint.d.ts +31 -0
- package/esm/chart/layout/constraint/constraint.js +81 -0
- package/esm/chart/layout/constraint/constraint.js.map +1 -0
- package/esm/chart/layout/constraint/gauss.d.ts +11 -0
- package/esm/chart/layout/constraint/gauss.js +63 -0
- package/esm/chart/layout/constraint/gauss.js.map +1 -0
- package/esm/chart/layout/constraint/index.d.ts +5 -0
- package/esm/chart/layout/constraint/index.js +30 -0
- package/esm/chart/layout/constraint/index.js.map +1 -0
- package/esm/chart/layout/constraint/solver.d.ts +40 -0
- package/esm/chart/layout/constraint/solver.js +77 -0
- package/esm/chart/layout/constraint/solver.js.map +1 -0
- package/esm/chart/layout/constraint/types.d.ts +21 -0
- package/esm/chart/layout/constraint/types.js +13 -0
- package/esm/chart/layout/constraint/types.js.map +1 -0
- package/esm/chart/layout/constraint/variable.d.ts +24 -0
- package/esm/chart/layout/constraint/variable.js +28 -0
- package/esm/chart/layout/constraint/variable.js.map +1 -0
- package/esm/chart/layout/index.d.ts +15 -0
- package/esm/chart/layout/index.js +26 -0
- package/esm/chart/layout/index.js.map +1 -0
- package/esm/chart/layout/padding-cal.d.ts +53 -0
- package/esm/chart/layout/padding-cal.js +108 -0
- package/esm/chart/layout/padding-cal.js.map +1 -0
- package/esm/chart/util/scale-pool.d.ts +57 -0
- package/esm/chart/util/scale-pool.js +212 -0
- package/esm/chart/util/scale-pool.js.map +1 -0
- package/esm/chart/util/sync-view-padding.d.ts +9 -0
- package/esm/chart/util/sync-view-padding.js +14 -0
- package/esm/chart/util/sync-view-padding.js.map +1 -0
- package/esm/chart/view.d.ts +747 -0
- package/esm/chart/view.js +1633 -0
- package/esm/chart/view.js.map +1 -0
- package/esm/component/labels.d.ts +47 -0
- package/esm/component/labels.js +274 -0
- package/esm/component/labels.js.map +1 -0
- package/esm/component/update-label.d.ts +21 -0
- package/esm/component/update-label.js +57 -0
- package/esm/component/update-label.js.map +1 -0
- package/esm/constant.d.ts +122 -0
- package/esm/constant.js +134 -0
- package/esm/constant.js.map +1 -0
- package/esm/core.d.ts +46 -0
- package/esm/core.js +60 -0
- package/esm/core.js.map +1 -0
- package/esm/dependents.d.ts +21 -0
- package/esm/dependents.js +33 -0
- package/esm/dependents.js.map +1 -0
- package/esm/engine/index.d.ts +13 -0
- package/esm/engine/index.js +22 -0
- package/esm/engine/index.js.map +1 -0
- package/esm/facet/circle.d.ts +36 -0
- package/esm/facet/circle.js +119 -0
- package/esm/facet/circle.js.map +1 -0
- package/esm/facet/facet.d.ts +165 -0
- package/esm/facet/facet.js +291 -0
- package/esm/facet/facet.js.map +1 -0
- package/esm/facet/index.d.ts +13 -0
- package/esm/facet/index.js +22 -0
- package/esm/facet/index.js.map +1 -0
- package/esm/facet/list.d.ts +46 -0
- package/esm/facet/list.js +134 -0
- package/esm/facet/list.js.map +1 -0
- package/esm/facet/matrix.d.ts +34 -0
- package/esm/facet/matrix.js +119 -0
- package/esm/facet/matrix.js.map +1 -0
- package/esm/facet/mirror.d.ts +31 -0
- package/esm/facet/mirror.js +144 -0
- package/esm/facet/mirror.js.map +1 -0
- package/esm/facet/rect.d.ts +35 -0
- package/esm/facet/rect.js +141 -0
- package/esm/facet/rect.js.map +1 -0
- package/esm/facet/tree.d.ts +40 -0
- package/esm/facet/tree.js +288 -0
- package/esm/facet/tree.js.map +1 -0
- package/esm/geometry/area.d.ts +46 -0
- package/esm/geometry/area.js +62 -0
- package/esm/geometry/area.js.map +1 -0
- package/esm/geometry/base.d.ts +793 -0
- package/esm/geometry/base.js +1487 -0
- package/esm/geometry/base.js.map +1 -0
- package/esm/geometry/edge.d.ts +15 -0
- package/esm/geometry/edge.js +24 -0
- package/esm/geometry/edge.js.map +1 -0
- package/esm/geometry/element/index.d.ts +127 -0
- package/esm/geometry/element/index.js +436 -0
- package/esm/geometry/element/index.js.map +1 -0
- package/esm/geometry/heatmap.d.ts +31 -0
- package/esm/geometry/heatmap.js +190 -0
- package/esm/geometry/heatmap.js.map +1 -0
- package/esm/geometry/interval.d.ts +41 -0
- package/esm/geometry/interval.js +98 -0
- package/esm/geometry/interval.js.map +1 -0
- package/esm/geometry/label/base.d.ts +76 -0
- package/esm/geometry/label/base.js +404 -0
- package/esm/geometry/label/base.js.map +1 -0
- package/esm/geometry/label/index.d.ts +38 -0
- package/esm/geometry/label/index.js +35 -0
- package/esm/geometry/label/index.js.map +1 -0
- package/esm/geometry/label/interface.d.ts +50 -0
- package/esm/geometry/label/interface.js +2 -0
- package/esm/geometry/label/interface.js.map +1 -0
- package/esm/geometry/label/interval.d.ts +27 -0
- package/esm/geometry/label/interval.js +146 -0
- package/esm/geometry/label/interval.js.map +1 -0
- package/esm/geometry/label/layout/adjust-color.d.ts +3 -0
- package/esm/geometry/label/layout/adjust-color.js +36 -0
- package/esm/geometry/label/layout/adjust-color.js.map +1 -0
- package/esm/geometry/label/layout/hide-overlap.d.ts +8 -0
- package/esm/geometry/label/layout/hide-overlap.js +29 -0
- package/esm/geometry/label/layout/hide-overlap.js.map +1 -0
- package/esm/geometry/label/layout/interval/adjust-position.d.ts +9 -0
- package/esm/geometry/label/layout/interval/adjust-position.js +61 -0
- package/esm/geometry/label/layout/interval/adjust-position.js.map +1 -0
- package/esm/geometry/label/layout/interval/hide-overlap.d.ts +9 -0
- package/esm/geometry/label/layout/interval/hide-overlap.js +78 -0
- package/esm/geometry/label/layout/interval/hide-overlap.js.map +1 -0
- package/esm/geometry/label/layout/limit-in-canvas.d.ts +9 -0
- package/esm/geometry/label/layout/limit-in-canvas.js +44 -0
- package/esm/geometry/label/layout/limit-in-canvas.js.map +1 -0
- package/esm/geometry/label/layout/limit-in-plot.d.ts +18 -0
- package/esm/geometry/label/layout/limit-in-plot.js +75 -0
- package/esm/geometry/label/layout/limit-in-plot.js.map +1 -0
- package/esm/geometry/label/layout/limit-in-shape.d.ts +7 -0
- package/esm/geometry/label/layout/limit-in-shape.js +18 -0
- package/esm/geometry/label/layout/limit-in-shape.js.map +1 -0
- package/esm/geometry/label/layout/overlap.d.ts +15 -0
- package/esm/geometry/label/layout/overlap.js +223 -0
- package/esm/geometry/label/layout/overlap.js.map +1 -0
- package/esm/geometry/label/layout/path/adjust-position.d.ts +17 -0
- package/esm/geometry/label/layout/path/adjust-position.js +94 -0
- package/esm/geometry/label/layout/path/adjust-position.js.map +1 -0
- package/esm/geometry/label/layout/pie/distribute.d.ts +3 -0
- package/esm/geometry/label/layout/pie/distribute.js +185 -0
- package/esm/geometry/label/layout/pie/distribute.js.map +1 -0
- package/esm/geometry/label/layout/pie/outer.d.ts +6 -0
- package/esm/geometry/label/layout/pie/outer.js +207 -0
- package/esm/geometry/label/layout/pie/outer.js.map +1 -0
- package/esm/geometry/label/layout/pie/spider.d.ts +7 -0
- package/esm/geometry/label/layout/pie/spider.js +181 -0
- package/esm/geometry/label/layout/pie/spider.js.map +1 -0
- package/esm/geometry/label/layout/pie/util.d.ts +10 -0
- package/esm/geometry/label/layout/pie/util.js +73 -0
- package/esm/geometry/label/layout/pie/util.js.map +1 -0
- package/esm/geometry/label/layout/point/adjust-position.d.ts +17 -0
- package/esm/geometry/label/layout/point/adjust-position.js +94 -0
- package/esm/geometry/label/layout/point/adjust-position.js.map +1 -0
- package/esm/geometry/label/pie.d.ts +22 -0
- package/esm/geometry/label/pie.js +95 -0
- package/esm/geometry/label/pie.js.map +1 -0
- package/esm/geometry/label/polar.d.ts +64 -0
- package/esm/geometry/label/polar.js +221 -0
- package/esm/geometry/label/polar.js.map +1 -0
- package/esm/geometry/label/util/index.d.ts +26 -0
- package/esm/geometry/label/util/index.js +61 -0
- package/esm/geometry/label/util/index.js.map +1 -0
- package/esm/geometry/line.d.ts +11 -0
- package/esm/geometry/line.js +21 -0
- package/esm/geometry/line.js.map +1 -0
- package/esm/geometry/path.d.ts +40 -0
- package/esm/geometry/path.js +122 -0
- package/esm/geometry/path.js.map +1 -0
- package/esm/geometry/point.d.ts +19 -0
- package/esm/geometry/point.js +30 -0
- package/esm/geometry/point.js.map +1 -0
- package/esm/geometry/polygon.d.ts +19 -0
- package/esm/geometry/polygon.js +62 -0
- package/esm/geometry/polygon.js.map +1 -0
- package/esm/geometry/schema.d.ts +18 -0
- package/esm/geometry/schema.js +48 -0
- package/esm/geometry/schema.js.map +1 -0
- package/esm/geometry/shape/area/index.d.ts +2 -0
- package/esm/geometry/shape/area/index.js +44 -0
- package/esm/geometry/shape/area/index.js.map +1 -0
- package/esm/geometry/shape/area/line.d.ts +1 -0
- package/esm/geometry/shape/area/line.js +31 -0
- package/esm/geometry/shape/area/line.js.map +1 -0
- package/esm/geometry/shape/area/smooth-line.d.ts +1 -0
- package/esm/geometry/shape/area/smooth-line.js +30 -0
- package/esm/geometry/shape/area/smooth-line.js.map +1 -0
- package/esm/geometry/shape/area/smooth.d.ts +1 -0
- package/esm/geometry/shape/area/smooth.js +31 -0
- package/esm/geometry/shape/area/smooth.js.map +1 -0
- package/esm/geometry/shape/area/util.d.ts +22 -0
- package/esm/geometry/shape/area/util.js +88 -0
- package/esm/geometry/shape/area/util.js.map +1 -0
- package/esm/geometry/shape/base.d.ts +22 -0
- package/esm/geometry/shape/base.js +162 -0
- package/esm/geometry/shape/base.js.map +1 -0
- package/esm/geometry/shape/constant.d.ts +4 -0
- package/esm/geometry/shape/constant.js +5 -0
- package/esm/geometry/shape/constant.js.map +1 -0
- package/esm/geometry/shape/edge/arc.d.ts +1 -0
- package/esm/geometry/shape/edge/arc.js +84 -0
- package/esm/geometry/shape/edge/arc.js.map +1 -0
- package/esm/geometry/shape/edge/index.d.ts +2 -0
- package/esm/geometry/shape/edge/index.js +31 -0
- package/esm/geometry/shape/edge/index.js.map +1 -0
- package/esm/geometry/shape/edge/smooth.d.ts +1 -0
- package/esm/geometry/shape/edge/smooth.js +30 -0
- package/esm/geometry/shape/edge/smooth.js.map +1 -0
- package/esm/geometry/shape/edge/util.d.ts +17 -0
- package/esm/geometry/shape/edge/util.js +32 -0
- package/esm/geometry/shape/edge/util.js.map +1 -0
- package/esm/geometry/shape/edge/vhv.d.ts +1 -0
- package/esm/geometry/shape/edge/vhv.js +42 -0
- package/esm/geometry/shape/edge/vhv.js.map +1 -0
- package/esm/geometry/shape/interval/funnel.d.ts +1 -0
- package/esm/geometry/shape/interval/funnel.js +31 -0
- package/esm/geometry/shape/interval/funnel.js.map +1 -0
- package/esm/geometry/shape/interval/hollow-rect.d.ts +1 -0
- package/esm/geometry/shape/interval/hollow-rect.js +51 -0
- package/esm/geometry/shape/interval/hollow-rect.js.map +1 -0
- package/esm/geometry/shape/interval/index.d.ts +3 -0
- package/esm/geometry/shape/interval/index.js +63 -0
- package/esm/geometry/shape/interval/index.js.map +1 -0
- package/esm/geometry/shape/interval/line.d.ts +1 -0
- package/esm/geometry/shape/interval/line.js +54 -0
- package/esm/geometry/shape/interval/line.js.map +1 -0
- package/esm/geometry/shape/interval/pyramid.d.ts +1 -0
- package/esm/geometry/shape/interval/pyramid.js +31 -0
- package/esm/geometry/shape/interval/pyramid.js.map +1 -0
- package/esm/geometry/shape/interval/tick.d.ts +1 -0
- package/esm/geometry/shape/interval/tick.js +77 -0
- package/esm/geometry/shape/interval/tick.js.map +1 -0
- package/esm/geometry/shape/interval/util.d.ts +55 -0
- package/esm/geometry/shape/interval/util.js +311 -0
- package/esm/geometry/shape/interval/util.js.map +1 -0
- package/esm/geometry/shape/line/index.d.ts +8 -0
- package/esm/geometry/shape/line/index.js +105 -0
- package/esm/geometry/shape/line/index.js.map +1 -0
- package/esm/geometry/shape/line/step.d.ts +1 -0
- package/esm/geometry/shape/line/step.js +84 -0
- package/esm/geometry/shape/line/step.js.map +1 -0
- package/esm/geometry/shape/line/util.d.ts +16 -0
- package/esm/geometry/shape/line/util.js +83 -0
- package/esm/geometry/shape/line/util.js.map +1 -0
- package/esm/geometry/shape/point/hollow.d.ts +1 -0
- package/esm/geometry/shape/point/hollow.js +24 -0
- package/esm/geometry/shape/point/hollow.js.map +1 -0
- package/esm/geometry/shape/point/image.d.ts +1 -0
- package/esm/geometry/shape/point/image.js +48 -0
- package/esm/geometry/shape/point/image.js.map +1 -0
- package/esm/geometry/shape/point/index.d.ts +2 -0
- package/esm/geometry/shape/point/index.js +32 -0
- package/esm/geometry/shape/point/index.js.map +1 -0
- package/esm/geometry/shape/point/solid.d.ts +1 -0
- package/esm/geometry/shape/point/solid.js +23 -0
- package/esm/geometry/shape/point/solid.js.map +1 -0
- package/esm/geometry/shape/point/util.d.ts +15 -0
- package/esm/geometry/shape/point/util.js +39 -0
- package/esm/geometry/shape/point/util.js.map +1 -0
- package/esm/geometry/shape/polygon/index.d.ts +2 -0
- package/esm/geometry/shape/polygon/index.js +65 -0
- package/esm/geometry/shape/polygon/index.js.map +1 -0
- package/esm/geometry/shape/polygon/square.d.ts +1 -0
- package/esm/geometry/shape/polygon/square.js +44 -0
- package/esm/geometry/shape/polygon/square.js.map +1 -0
- package/esm/geometry/shape/schema/box.d.ts +1 -0
- package/esm/geometry/shape/schema/box.js +142 -0
- package/esm/geometry/shape/schema/box.js.map +1 -0
- package/esm/geometry/shape/schema/candle.d.ts +1 -0
- package/esm/geometry/shape/schema/candle.js +80 -0
- package/esm/geometry/shape/schema/candle.js.map +1 -0
- package/esm/geometry/shape/schema/index.d.ts +2 -0
- package/esm/geometry/shape/schema/index.js +6 -0
- package/esm/geometry/shape/schema/index.js.map +1 -0
- package/esm/geometry/shape/util/get-path-points.d.ts +38 -0
- package/esm/geometry/shape/util/get-path-points.js +131 -0
- package/esm/geometry/shape/util/get-path-points.js.map +1 -0
- package/esm/geometry/shape/util/get-style.d.ts +18 -0
- package/esm/geometry/shape/util/get-style.js +47 -0
- package/esm/geometry/shape/util/get-style.js.map +1 -0
- package/esm/geometry/shape/util/path.d.ts +32 -0
- package/esm/geometry/shape/util/path.js +311 -0
- package/esm/geometry/shape/util/path.js.map +1 -0
- package/esm/geometry/shape/util/split-points.d.ts +13 -0
- package/esm/geometry/shape/util/split-points.js +24 -0
- package/esm/geometry/shape/util/split-points.js.map +1 -0
- package/esm/geometry/shape/violin/hollow.d.ts +1 -0
- package/esm/geometry/shape/violin/hollow.js +51 -0
- package/esm/geometry/shape/violin/hollow.js.map +1 -0
- package/esm/geometry/shape/violin/index.d.ts +2 -0
- package/esm/geometry/shape/violin/index.js +60 -0
- package/esm/geometry/shape/violin/index.js.map +1 -0
- package/esm/geometry/shape/violin/smooth.d.ts +1 -0
- package/esm/geometry/shape/violin/smooth.js +28 -0
- package/esm/geometry/shape/violin/smooth.js.map +1 -0
- package/esm/geometry/util/diff.d.ts +11 -0
- package/esm/geometry/util/diff.js +30 -0
- package/esm/geometry/util/diff.js.map +1 -0
- package/esm/geometry/util/get-shape-type.d.ts +8 -0
- package/esm/geometry/util/get-shape-type.js +16 -0
- package/esm/geometry/util/get-shape-type.js.map +1 -0
- package/esm/geometry/util/group-data.d.ts +3 -0
- package/esm/geometry/util/group-data.js +31 -0
- package/esm/geometry/util/group-data.js.map +1 -0
- package/esm/geometry/util/is-model-change.d.ts +9 -0
- package/esm/geometry/util/is-model-change.js +14 -0
- package/esm/geometry/util/is-model-change.js.map +1 -0
- package/esm/geometry/util/parse-fields.d.ts +2 -0
- package/esm/geometry/util/parse-fields.js +9 -0
- package/esm/geometry/util/parse-fields.js.map +1 -0
- package/esm/geometry/util/shape-size.d.ts +2 -0
- package/esm/geometry/util/shape-size.js +124 -0
- package/esm/geometry/util/shape-size.js.map +1 -0
- package/esm/geometry/violin.d.ts +25 -0
- package/esm/geometry/violin.js +67 -0
- package/esm/geometry/violin.js.map +1 -0
- package/esm/index.d.ts +107 -0
- package/esm/index.js +581 -0
- package/esm/index.js.map +1 -0
- package/esm/interaction/action/active-region.d.ts +33 -0
- package/esm/interaction/action/active-region.js +198 -0
- package/esm/interaction/action/active-region.js.map +1 -0
- package/esm/interaction/action/base.d.ts +29 -0
- package/esm/interaction/action/base.js +36 -0
- package/esm/interaction/action/base.js.map +1 -0
- package/esm/interaction/action/callback.d.ts +17 -0
- package/esm/interaction/action/callback.js +27 -0
- package/esm/interaction/action/callback.js.map +1 -0
- package/esm/interaction/action/component/list-active.d.ts +14 -0
- package/esm/interaction/action/component/list-active.js +24 -0
- package/esm/interaction/action/component/list-active.js.map +1 -0
- package/esm/interaction/action/component/list-checked.d.ts +30 -0
- package/esm/interaction/action/component/list-checked.js +82 -0
- package/esm/interaction/action/component/list-checked.js.map +1 -0
- package/esm/interaction/action/component/list-focus.d.ts +5 -0
- package/esm/interaction/action/component/list-focus.js +55 -0
- package/esm/interaction/action/component/list-focus.js.map +1 -0
- package/esm/interaction/action/component/list-highlight-util.d.ts +7 -0
- package/esm/interaction/action/component/list-highlight-util.js +20 -0
- package/esm/interaction/action/component/list-highlight-util.js.map +1 -0
- package/esm/interaction/action/component/list-highlight.d.ts +20 -0
- package/esm/interaction/action/component/list-highlight.js +97 -0
- package/esm/interaction/action/component/list-highlight.js.map +1 -0
- package/esm/interaction/action/component/list-radio.d.ts +24 -0
- package/esm/interaction/action/component/list-radio.js +116 -0
- package/esm/interaction/action/component/list-radio.js.map +1 -0
- package/esm/interaction/action/component/list-selected.d.ts +10 -0
- package/esm/interaction/action/component/list-selected.js +20 -0
- package/esm/interaction/action/component/list-selected.js.map +1 -0
- package/esm/interaction/action/component/list-state.d.ts +46 -0
- package/esm/interaction/action/component/list-state.js +167 -0
- package/esm/interaction/action/component/list-state.js.map +1 -0
- package/esm/interaction/action/component/list-unchecked.d.ts +13 -0
- package/esm/interaction/action/component/list-unchecked.js +23 -0
- package/esm/interaction/action/component/list-unchecked.js.map +1 -0
- package/esm/interaction/action/component/tooltip/ellipsis-text.d.ts +25 -0
- package/esm/interaction/action/component/tooltip/ellipsis-text.js +93 -0
- package/esm/interaction/action/component/tooltip/ellipsis-text.js.map +1 -0
- package/esm/interaction/action/component/tooltip/geometry.d.ts +24 -0
- package/esm/interaction/action/component/tooltip/geometry.js +71 -0
- package/esm/interaction/action/component/tooltip/geometry.js.map +1 -0
- package/esm/interaction/action/component/tooltip/sibling.d.ts +21 -0
- package/esm/interaction/action/component/tooltip/sibling.js +39 -0
- package/esm/interaction/action/component/tooltip/sibling.js.map +1 -0
- package/esm/interaction/action/cursor.d.ts +69 -0
- package/esm/interaction/action/cursor.js +113 -0
- package/esm/interaction/action/cursor.js.map +1 -0
- package/esm/interaction/action/data/filter.d.ts +13 -0
- package/esm/interaction/action/data/filter.js +66 -0
- package/esm/interaction/action/data/filter.js.map +1 -0
- package/esm/interaction/action/data/range-filter.d.ts +56 -0
- package/esm/interaction/action/data/range-filter.js +163 -0
- package/esm/interaction/action/data/range-filter.js.map +1 -0
- package/esm/interaction/action/data/sibling-filter.d.ts +22 -0
- package/esm/interaction/action/data/sibling-filter.js +39 -0
- package/esm/interaction/action/data/sibling-filter.js.map +1 -0
- package/esm/interaction/action/element/active.d.ts +14 -0
- package/esm/interaction/action/element/active.js +24 -0
- package/esm/interaction/action/element/active.js.map +1 -0
- package/esm/interaction/action/element/filter.d.ts +20 -0
- package/esm/interaction/action/element/filter.js +89 -0
- package/esm/interaction/action/element/filter.js.map +1 -0
- package/esm/interaction/action/element/highlight-by-color.d.ts +10 -0
- package/esm/interaction/action/element/highlight-by-color.js +30 -0
- package/esm/interaction/action/element/highlight-by-color.js.map +1 -0
- package/esm/interaction/action/element/highlight-by-x.d.ts +15 -0
- package/esm/interaction/action/element/highlight-by-x.js +51 -0
- package/esm/interaction/action/element/highlight-by-x.js.map +1 -0
- package/esm/interaction/action/element/highlight-util.d.ts +18 -0
- package/esm/interaction/action/element/highlight-util.js +45 -0
- package/esm/interaction/action/element/highlight-util.js.map +1 -0
- package/esm/interaction/action/element/highlight.d.ts +21 -0
- package/esm/interaction/action/element/highlight.js +93 -0
- package/esm/interaction/action/element/highlight.js.map +1 -0
- package/esm/interaction/action/element/link-by-color.d.ts +51 -0
- package/esm/interaction/action/element/link-by-color.js +156 -0
- package/esm/interaction/action/element/link-by-color.js.map +1 -0
- package/esm/interaction/action/element/range-active.d.ts +13 -0
- package/esm/interaction/action/element/range-active.js +23 -0
- package/esm/interaction/action/element/range-active.js.map +1 -0
- package/esm/interaction/action/element/range-highlight.d.ts +27 -0
- package/esm/interaction/action/element/range-highlight.js +54 -0
- package/esm/interaction/action/element/range-highlight.js.map +1 -0
- package/esm/interaction/action/element/range-selected.d.ts +13 -0
- package/esm/interaction/action/element/range-selected.js +23 -0
- package/esm/interaction/action/element/range-selected.js.map +1 -0
- package/esm/interaction/action/element/range-state.d.ts +38 -0
- package/esm/interaction/action/element/range-state.js +164 -0
- package/esm/interaction/action/element/range-state.js.map +1 -0
- package/esm/interaction/action/element/selected.d.ts +14 -0
- package/esm/interaction/action/element/selected.js +24 -0
- package/esm/interaction/action/element/selected.js.map +1 -0
- package/esm/interaction/action/element/sibling-filter.d.ts +19 -0
- package/esm/interaction/action/element/sibling-filter.js +93 -0
- package/esm/interaction/action/element/sibling-filter.js.map +1 -0
- package/esm/interaction/action/element/single-active.d.ts +13 -0
- package/esm/interaction/action/element/single-active.js +23 -0
- package/esm/interaction/action/element/single-active.js.map +1 -0
- package/esm/interaction/action/element/single-highlight.d.ts +16 -0
- package/esm/interaction/action/element/single-highlight.js +35 -0
- package/esm/interaction/action/element/single-highlight.js.map +1 -0
- package/esm/interaction/action/element/single-selected.d.ts +13 -0
- package/esm/interaction/action/element/single-selected.js +23 -0
- package/esm/interaction/action/element/single-selected.js.map +1 -0
- package/esm/interaction/action/element/single-state.d.ts +18 -0
- package/esm/interaction/action/element/single-state.js +53 -0
- package/esm/interaction/action/element/single-state.js.map +1 -0
- package/esm/interaction/action/element/state-base.d.ts +39 -0
- package/esm/interaction/action/element/state-base.js +59 -0
- package/esm/interaction/action/element/state-base.js.map +1 -0
- package/esm/interaction/action/element/state.d.ts +28 -0
- package/esm/interaction/action/element/state.js +99 -0
- package/esm/interaction/action/element/state.js.map +1 -0
- package/esm/interaction/action/index.d.ts +2 -0
- package/esm/interaction/action/index.js +3 -0
- package/esm/interaction/action/index.js.map +1 -0
- package/esm/interaction/action/mask/base.d.ts +62 -0
- package/esm/interaction/action/mask/base.js +169 -0
- package/esm/interaction/action/mask/base.js.map +1 -0
- package/esm/interaction/action/mask/circle.d.ts +14 -0
- package/esm/interaction/action/mask/circle.js +37 -0
- package/esm/interaction/action/mask/circle.js.map +1 -0
- package/esm/interaction/action/mask/dim-rect.d.ts +11 -0
- package/esm/interaction/action/mask/dim-rect.js +62 -0
- package/esm/interaction/action/mask/dim-rect.js.map +1 -0
- package/esm/interaction/action/mask/path.d.ts +16 -0
- package/esm/interaction/action/mask/path.js +44 -0
- package/esm/interaction/action/mask/path.js.map +1 -0
- package/esm/interaction/action/mask/rect.d.ts +17 -0
- package/esm/interaction/action/mask/rect.js +39 -0
- package/esm/interaction/action/mask/rect.js.map +1 -0
- package/esm/interaction/action/mask/smooth-path.d.ts +9 -0
- package/esm/interaction/action/mask/smooth-path.js +21 -0
- package/esm/interaction/action/mask/smooth-path.js.map +1 -0
- package/esm/interaction/action/register.d.ts +36 -0
- package/esm/interaction/action/register.js +60 -0
- package/esm/interaction/action/register.js.map +1 -0
- package/esm/interaction/action/util.d.ts +140 -0
- package/esm/interaction/action/util.js +361 -0
- package/esm/interaction/action/util.js.map +1 -0
- package/esm/interaction/action/view/button.d.ts +25 -0
- package/esm/interaction/action/view/button.js +116 -0
- package/esm/interaction/action/view/button.js.map +1 -0
- package/esm/interaction/action/view/drag.d.ts +24 -0
- package/esm/interaction/action/view/drag.js +73 -0
- package/esm/interaction/action/view/drag.js.map +1 -0
- package/esm/interaction/action/view/mousewheel-scroll.d.ts +5 -0
- package/esm/interaction/action/view/mousewheel-scroll.js +35 -0
- package/esm/interaction/action/view/mousewheel-scroll.js.map +1 -0
- package/esm/interaction/action/view/move.d.ts +28 -0
- package/esm/interaction/action/view/move.js +80 -0
- package/esm/interaction/action/view/move.js.map +1 -0
- package/esm/interaction/action/view/scale-transform.d.ts +18 -0
- package/esm/interaction/action/view/scale-transform.js +51 -0
- package/esm/interaction/action/view/scale-transform.js.map +1 -0
- package/esm/interaction/action/view/scale-translate.d.ts +30 -0
- package/esm/interaction/action/view/scale-translate.js +112 -0
- package/esm/interaction/action/view/scale-translate.js.map +1 -0
- package/esm/interaction/action/view/scale-zoom.d.ts +20 -0
- package/esm/interaction/action/view/scale-zoom.js +83 -0
- package/esm/interaction/action/view/scale-zoom.js.map +1 -0
- package/esm/interaction/context.d.ts +65 -0
- package/esm/interaction/context.js +142 -0
- package/esm/interaction/context.js.map +1 -0
- package/esm/interaction/grammar-interaction.d.ts +158 -0
- package/esm/interaction/grammar-interaction.js +285 -0
- package/esm/interaction/grammar-interaction.js.map +1 -0
- package/esm/interaction/index.d.ts +25 -0
- package/esm/interaction/index.js +43 -0
- package/esm/interaction/index.js.map +1 -0
- package/esm/interaction/interaction.d.ts +29 -0
- package/esm/interaction/interaction.js +32 -0
- package/esm/interaction/interaction.js.map +1 -0
- package/esm/interface.d.ts +2264 -0
- package/esm/interface.js +2 -0
- package/esm/interface.js.map +1 -0
- package/esm/theme/index.d.ts +12 -0
- package/esm/theme/index.js +23 -0
- package/esm/theme/index.js.map +1 -0
- package/esm/theme/style-sheet/dark.d.ts +825 -0
- package/esm/theme/style-sheet/dark.js +496 -0
- package/esm/theme/style-sheet/dark.js.map +1 -0
- package/esm/theme/style-sheet/light.d.ts +817 -0
- package/esm/theme/style-sheet/light.js +492 -0
- package/esm/theme/style-sheet/light.js.map +1 -0
- package/esm/theme/util/create-by-style-sheet.d.ts +6 -0
- package/esm/theme/util/create-by-style-sheet.js +1422 -0
- package/esm/theme/util/create-by-style-sheet.js.map +1 -0
- package/esm/theme/util/create-theme.d.ts +6 -0
- package/esm/theme/util/create-theme.js +12 -0
- package/esm/theme/util/create-theme.js.map +1 -0
- package/esm/theme/util/index.d.ts +1 -0
- package/esm/theme/util/index.js +2 -0
- package/esm/theme/util/index.js.map +1 -0
- package/esm/util/annotation.d.ts +7 -0
- package/esm/util/annotation.js +39 -0
- package/esm/util/annotation.js.map +1 -0
- package/esm/util/attr.d.ts +10 -0
- package/esm/util/attr.js +25 -0
- package/esm/util/attr.js.map +1 -0
- package/esm/util/axis.d.ts +100 -0
- package/esm/util/axis.js +236 -0
- package/esm/util/axis.js.map +1 -0
- package/esm/util/bbox.d.ts +105 -0
- package/esm/util/bbox.js +282 -0
- package/esm/util/bbox.js.map +1 -0
- package/esm/util/collision-detect.d.ts +16 -0
- package/esm/util/collision-detect.js +127 -0
- package/esm/util/collision-detect.js.map +1 -0
- package/esm/util/color.d.ts +1 -0
- package/esm/util/color.js +18 -0
- package/esm/util/color.js.map +1 -0
- package/esm/util/context.d.ts +4 -0
- package/esm/util/context.js +11 -0
- package/esm/util/context.js.map +1 -0
- package/esm/util/coordinate.d.ts +86 -0
- package/esm/util/coordinate.js +147 -0
- package/esm/util/coordinate.js.map +1 -0
- package/esm/util/direction.d.ts +19 -0
- package/esm/util/direction.js +120 -0
- package/esm/util/direction.js.map +1 -0
- package/esm/util/dom.d.ts +19 -0
- package/esm/util/dom.js +61 -0
- package/esm/util/dom.js.map +1 -0
- package/esm/util/event.d.ts +8 -0
- package/esm/util/event.js +14 -0
- package/esm/util/event.js.map +1 -0
- package/esm/util/facet.d.ts +16 -0
- package/esm/util/facet.js +43 -0
- package/esm/util/facet.js.map +1 -0
- package/esm/util/graphics.d.ts +58 -0
- package/esm/util/graphics.js +203 -0
- package/esm/util/graphics.js.map +1 -0
- package/esm/util/grid.d.ts +36 -0
- package/esm/util/grid.js +118 -0
- package/esm/util/grid.js.map +1 -0
- package/esm/util/helper.d.ts +34 -0
- package/esm/util/helper.js +72 -0
- package/esm/util/helper.js.map +1 -0
- package/esm/util/legend.d.ts +45 -0
- package/esm/util/legend.js +145 -0
- package/esm/util/legend.js.map +1 -0
- package/esm/util/marker.d.ts +10 -0
- package/esm/util/marker.js +58 -0
- package/esm/util/marker.js.map +1 -0
- package/esm/util/padding.d.ts +14 -0
- package/esm/util/padding.js +40 -0
- package/esm/util/padding.js.map +1 -0
- package/esm/util/scale.d.ts +42 -0
- package/esm/util/scale.js +128 -0
- package/esm/util/scale.js.map +1 -0
- package/esm/util/stat.d.ts +10 -0
- package/esm/util/stat.js +36 -0
- package/esm/util/stat.js.map +1 -0
- package/esm/util/text.d.ts +23 -0
- package/esm/util/text.js +84 -0
- package/esm/util/text.js.map +1 -0
- package/esm/util/tooltip.d.ts +26 -0
- package/esm/util/tooltip.js +419 -0
- package/esm/util/tooltip.js.map +1 -0
- package/esm/util/transform.d.ts +33 -0
- package/esm/util/transform.js +61 -0
- package/esm/util/transform.js.map +1 -0
- package/esm/util/types.d.ts +6 -0
- package/esm/util/types.js +2 -0
- package/esm/util/types.js.map +1 -0
- package/lib/animate/animation/fade.d.ts +21 -0
- package/lib/animate/animation/fade.js +47 -0
- package/lib/animate/animation/fade.js.map +1 -0
- package/lib/animate/animation/grow-in.d.ts +30 -0
- package/lib/animate/animation/grow-in.js +44 -0
- package/lib/animate/animation/grow-in.js.map +1 -0
- package/lib/animate/animation/index.d.ts +16 -0
- package/lib/animate/animation/index.js +22 -0
- package/lib/animate/animation/index.js.map +1 -0
- package/lib/animate/animation/path-in.d.ts +12 -0
- package/lib/animate/animation/path-in.js +25 -0
- package/lib/animate/animation/path-in.js.map +1 -0
- package/lib/animate/animation/position-update.d.ts +11 -0
- package/lib/animate/animation/position-update.js +28 -0
- package/lib/animate/animation/position-update.js.map +1 -0
- package/lib/animate/animation/scale-in.d.ts +19 -0
- package/lib/animate/animation/scale-in.js +65 -0
- package/lib/animate/animation/scale-in.js.map +1 -0
- package/lib/animate/animation/sector-path-update.d.ts +11 -0
- package/lib/animate/animation/sector-path-update.js +135 -0
- package/lib/animate/animation/sector-path-update.js.map +1 -0
- package/lib/animate/animation/util.d.ts +19 -0
- package/lib/animate/animation/util.js +93 -0
- package/lib/animate/animation/util.js.map +1 -0
- package/lib/animate/animation/wave-in.d.ts +13 -0
- package/lib/animate/animation/wave-in.js +30 -0
- package/lib/animate/animation/wave-in.js.map +1 -0
- package/lib/animate/animation/zoom.d.ts +21 -0
- package/lib/animate/animation/zoom.js +71 -0
- package/lib/animate/animation/zoom.js.map +1 -0
- package/lib/animate/index.d.ts +48 -0
- package/lib/animate/index.js +255 -0
- package/lib/animate/index.js.map +1 -0
- package/lib/animate/interface.d.ts +12 -0
- package/lib/animate/interface.js +3 -0
- package/lib/animate/interface.js.map +1 -0
- package/lib/api.d.ts +2 -0
- package/lib/api.js +7 -0
- package/lib/api.js.map +1 -0
- package/lib/base.d.ts +33 -0
- package/lib/base.js +57 -0
- package/lib/base.js.map +1 -0
- package/lib/chart/chart.d.ts +61 -0
- package/lib/chart/chart.js +159 -0
- package/lib/chart/chart.js.map +1 -0
- package/lib/chart/controller/annotation.d.ts +162 -0
- package/lib/chart/controller/annotation.js +583 -0
- package/lib/chart/controller/annotation.js.map +1 -0
- package/lib/chart/controller/axis.d.ts +93 -0
- package/lib/chart/controller/axis.js +580 -0
- package/lib/chart/controller/axis.js.map +1 -0
- package/lib/chart/controller/base.d.ts +64 -0
- package/lib/chart/controller/base.js +65 -0
- package/lib/chart/controller/base.js.map +1 -0
- package/lib/chart/controller/coordinate.d.ts +74 -0
- package/lib/chart/controller/coordinate.js +147 -0
- package/lib/chart/controller/coordinate.js.map +1 -0
- package/lib/chart/controller/gesture.d.ts +37 -0
- package/lib/chart/controller/gesture.js +260 -0
- package/lib/chart/controller/gesture.js.map +1 -0
- package/lib/chart/controller/index.d.ts +25 -0
- package/lib/chart/controller/index.js +41 -0
- package/lib/chart/controller/index.js.map +1 -0
- package/lib/chart/controller/legend.d.ts +106 -0
- package/lib/chart/controller/legend.js +486 -0
- package/lib/chart/controller/legend.js.map +1 -0
- package/lib/chart/controller/scrollbar.d.ts +64 -0
- package/lib/chart/controller/scrollbar.js +318 -0
- package/lib/chart/controller/scrollbar.js.map +1 -0
- package/lib/chart/controller/slider.d.ts +88 -0
- package/lib/chart/controller/slider.js +298 -0
- package/lib/chart/controller/slider.js.map +1 -0
- package/lib/chart/controller/tooltip.d.ts +68 -0
- package/lib/chart/controller/tooltip.js +646 -0
- package/lib/chart/controller/tooltip.js.map +1 -0
- package/lib/chart/event.d.ts +47 -0
- package/lib/chart/event.js +93 -0
- package/lib/chart/event.js.map +1 -0
- package/lib/chart/index.d.ts +4 -0
- package/lib/chart/index.js +16 -0
- package/lib/chart/index.js.map +1 -0
- package/lib/chart/layout/auto.d.ts +8 -0
- package/lib/chart/layout/auto.js +68 -0
- package/lib/chart/layout/auto.js.map +1 -0
- package/lib/chart/layout/constraint/bounds.d.ts +32 -0
- package/lib/chart/layout/constraint/bounds.js +33 -0
- package/lib/chart/layout/constraint/bounds.js.map +1 -0
- package/lib/chart/layout/constraint/constraint.d.ts +31 -0
- package/lib/chart/layout/constraint/constraint.js +84 -0
- package/lib/chart/layout/constraint/constraint.js.map +1 -0
- package/lib/chart/layout/constraint/gauss.d.ts +11 -0
- package/lib/chart/layout/constraint/gauss.js +68 -0
- package/lib/chart/layout/constraint/gauss.js.map +1 -0
- package/lib/chart/layout/constraint/index.d.ts +5 -0
- package/lib/chart/layout/constraint/index.js +38 -0
- package/lib/chart/layout/constraint/index.js.map +1 -0
- package/lib/chart/layout/constraint/solver.d.ts +40 -0
- package/lib/chart/layout/constraint/solver.js +80 -0
- package/lib/chart/layout/constraint/solver.js.map +1 -0
- package/lib/chart/layout/constraint/types.d.ts +21 -0
- package/lib/chart/layout/constraint/types.js +16 -0
- package/lib/chart/layout/constraint/types.js.map +1 -0
- package/lib/chart/layout/constraint/variable.d.ts +24 -0
- package/lib/chart/layout/constraint/variable.js +31 -0
- package/lib/chart/layout/constraint/variable.js.map +1 -0
- package/lib/chart/layout/index.d.ts +15 -0
- package/lib/chart/layout/index.js +29 -0
- package/lib/chart/layout/index.js.map +1 -0
- package/lib/chart/layout/padding-cal.d.ts +53 -0
- package/lib/chart/layout/padding-cal.js +111 -0
- package/lib/chart/layout/padding-cal.js.map +1 -0
- package/lib/chart/util/scale-pool.d.ts +57 -0
- package/lib/chart/util/scale-pool.js +215 -0
- package/lib/chart/util/scale-pool.js.map +1 -0
- package/lib/chart/util/sync-view-padding.d.ts +9 -0
- package/lib/chart/util/sync-view-padding.js +18 -0
- package/lib/chart/util/sync-view-padding.js.map +1 -0
- package/lib/chart/view.d.ts +747 -0
- package/lib/chart/view.js +1637 -0
- package/lib/chart/view.js.map +1 -0
- package/lib/component/labels.d.ts +47 -0
- package/lib/component/labels.js +276 -0
- package/lib/component/labels.js.map +1 -0
- package/lib/component/update-label.d.ts +21 -0
- package/lib/component/update-label.js +61 -0
- package/lib/component/update-label.js.map +1 -0
- package/lib/constant.d.ts +122 -0
- package/lib/constant.js +137 -0
- package/lib/constant.js.map +1 -0
- package/lib/core.d.ts +46 -0
- package/lib/core.js +101 -0
- package/lib/core.js.map +1 -0
- package/lib/dependents.d.ts +21 -0
- package/lib/dependents.js +55 -0
- package/lib/dependents.js.map +1 -0
- package/lib/engine/index.d.ts +13 -0
- package/lib/engine/index.js +27 -0
- package/lib/engine/index.js.map +1 -0
- package/lib/facet/circle.d.ts +36 -0
- package/lib/facet/circle.js +121 -0
- package/lib/facet/circle.js.map +1 -0
- package/lib/facet/facet.d.ts +165 -0
- package/lib/facet/facet.js +294 -0
- package/lib/facet/facet.js.map +1 -0
- package/lib/facet/index.d.ts +13 -0
- package/lib/facet/index.js +28 -0
- package/lib/facet/index.js.map +1 -0
- package/lib/facet/list.d.ts +46 -0
- package/lib/facet/list.js +136 -0
- package/lib/facet/list.js.map +1 -0
- package/lib/facet/matrix.d.ts +34 -0
- package/lib/facet/matrix.js +121 -0
- package/lib/facet/matrix.js.map +1 -0
- package/lib/facet/mirror.d.ts +31 -0
- package/lib/facet/mirror.js +146 -0
- package/lib/facet/mirror.js.map +1 -0
- package/lib/facet/rect.d.ts +35 -0
- package/lib/facet/rect.js +143 -0
- package/lib/facet/rect.js.map +1 -0
- package/lib/facet/tree.d.ts +40 -0
- package/lib/facet/tree.js +290 -0
- package/lib/facet/tree.js.map +1 -0
- package/lib/geometry/area.d.ts +46 -0
- package/lib/geometry/area.js +64 -0
- package/lib/geometry/area.js.map +1 -0
- package/lib/geometry/base.d.ts +793 -0
- package/lib/geometry/base.js +1489 -0
- package/lib/geometry/base.js.map +1 -0
- package/lib/geometry/edge.d.ts +15 -0
- package/lib/geometry/edge.js +26 -0
- package/lib/geometry/edge.js.map +1 -0
- package/lib/geometry/element/index.d.ts +127 -0
- package/lib/geometry/element/index.js +438 -0
- package/lib/geometry/element/index.js.map +1 -0
- package/lib/geometry/heatmap.d.ts +31 -0
- package/lib/geometry/heatmap.js +192 -0
- package/lib/geometry/heatmap.js.map +1 -0
- package/lib/geometry/interval.d.ts +41 -0
- package/lib/geometry/interval.js +100 -0
- package/lib/geometry/interval.js.map +1 -0
- package/lib/geometry/label/base.d.ts +76 -0
- package/lib/geometry/label/base.js +406 -0
- package/lib/geometry/label/base.js.map +1 -0
- package/lib/geometry/label/index.d.ts +38 -0
- package/lib/geometry/label/index.js +42 -0
- package/lib/geometry/label/index.js.map +1 -0
- package/lib/geometry/label/interface.d.ts +50 -0
- package/lib/geometry/label/interface.js +3 -0
- package/lib/geometry/label/interface.js.map +1 -0
- package/lib/geometry/label/interval.d.ts +27 -0
- package/lib/geometry/label/interval.js +148 -0
- package/lib/geometry/label/interval.js.map +1 -0
- package/lib/geometry/label/layout/adjust-color.d.ts +3 -0
- package/lib/geometry/label/layout/adjust-color.js +40 -0
- package/lib/geometry/label/layout/adjust-color.js.map +1 -0
- package/lib/geometry/label/layout/hide-overlap.d.ts +8 -0
- package/lib/geometry/label/layout/hide-overlap.js +33 -0
- package/lib/geometry/label/layout/hide-overlap.js.map +1 -0
- package/lib/geometry/label/layout/interval/adjust-position.d.ts +9 -0
- package/lib/geometry/label/layout/interval/adjust-position.js +65 -0
- package/lib/geometry/label/layout/interval/adjust-position.js.map +1 -0
- package/lib/geometry/label/layout/interval/hide-overlap.d.ts +9 -0
- package/lib/geometry/label/layout/interval/hide-overlap.js +82 -0
- package/lib/geometry/label/layout/interval/hide-overlap.js.map +1 -0
- package/lib/geometry/label/layout/limit-in-canvas.d.ts +9 -0
- package/lib/geometry/label/layout/limit-in-canvas.js +48 -0
- package/lib/geometry/label/layout/limit-in-canvas.js.map +1 -0
- package/lib/geometry/label/layout/limit-in-plot.d.ts +18 -0
- package/lib/geometry/label/layout/limit-in-plot.js +79 -0
- package/lib/geometry/label/layout/limit-in-plot.js.map +1 -0
- package/lib/geometry/label/layout/limit-in-shape.d.ts +7 -0
- package/lib/geometry/label/layout/limit-in-shape.js +22 -0
- package/lib/geometry/label/layout/limit-in-shape.js.map +1 -0
- package/lib/geometry/label/layout/overlap.d.ts +15 -0
- package/lib/geometry/label/layout/overlap.js +228 -0
- package/lib/geometry/label/layout/overlap.js.map +1 -0
- package/lib/geometry/label/layout/path/adjust-position.d.ts +17 -0
- package/lib/geometry/label/layout/path/adjust-position.js +98 -0
- package/lib/geometry/label/layout/path/adjust-position.js.map +1 -0
- package/lib/geometry/label/layout/pie/distribute.d.ts +3 -0
- package/lib/geometry/label/layout/pie/distribute.js +189 -0
- package/lib/geometry/label/layout/pie/distribute.js.map +1 -0
- package/lib/geometry/label/layout/pie/outer.d.ts +6 -0
- package/lib/geometry/label/layout/pie/outer.js +211 -0
- package/lib/geometry/label/layout/pie/outer.js.map +1 -0
- package/lib/geometry/label/layout/pie/spider.d.ts +7 -0
- package/lib/geometry/label/layout/pie/spider.js +185 -0
- package/lib/geometry/label/layout/pie/spider.js.map +1 -0
- package/lib/geometry/label/layout/pie/util.d.ts +10 -0
- package/lib/geometry/label/layout/pie/util.js +77 -0
- package/lib/geometry/label/layout/pie/util.js.map +1 -0
- package/lib/geometry/label/layout/point/adjust-position.d.ts +17 -0
- package/lib/geometry/label/layout/point/adjust-position.js +98 -0
- package/lib/geometry/label/layout/point/adjust-position.js.map +1 -0
- package/lib/geometry/label/pie.d.ts +22 -0
- package/lib/geometry/label/pie.js +97 -0
- package/lib/geometry/label/pie.js.map +1 -0
- package/lib/geometry/label/polar.d.ts +64 -0
- package/lib/geometry/label/polar.js +223 -0
- package/lib/geometry/label/polar.js.map +1 -0
- package/lib/geometry/label/util/index.d.ts +26 -0
- package/lib/geometry/label/util/index.js +68 -0
- package/lib/geometry/label/util/index.js.map +1 -0
- package/lib/geometry/line.d.ts +11 -0
- package/lib/geometry/line.js +23 -0
- package/lib/geometry/line.js.map +1 -0
- package/lib/geometry/path.d.ts +40 -0
- package/lib/geometry/path.js +124 -0
- package/lib/geometry/path.js.map +1 -0
- package/lib/geometry/point.d.ts +19 -0
- package/lib/geometry/point.js +32 -0
- package/lib/geometry/point.js.map +1 -0
- package/lib/geometry/polygon.d.ts +19 -0
- package/lib/geometry/polygon.js +64 -0
- package/lib/geometry/polygon.js.map +1 -0
- package/lib/geometry/schema.d.ts +18 -0
- package/lib/geometry/schema.js +50 -0
- package/lib/geometry/schema.js.map +1 -0
- package/lib/geometry/shape/area/index.d.ts +2 -0
- package/lib/geometry/shape/area/index.js +46 -0
- package/lib/geometry/shape/area/index.js.map +1 -0
- package/lib/geometry/shape/area/line.d.ts +1 -0
- package/lib/geometry/shape/area/line.js +33 -0
- package/lib/geometry/shape/area/line.js.map +1 -0
- package/lib/geometry/shape/area/smooth-line.d.ts +1 -0
- package/lib/geometry/shape/area/smooth-line.js +32 -0
- package/lib/geometry/shape/area/smooth-line.js.map +1 -0
- package/lib/geometry/shape/area/smooth.d.ts +1 -0
- package/lib/geometry/shape/area/smooth.js +33 -0
- package/lib/geometry/shape/area/smooth.js.map +1 -0
- package/lib/geometry/shape/area/util.d.ts +22 -0
- package/lib/geometry/shape/area/util.js +93 -0
- package/lib/geometry/shape/area/util.js.map +1 -0
- package/lib/geometry/shape/base.d.ts +22 -0
- package/lib/geometry/shape/base.js +168 -0
- package/lib/geometry/shape/base.js.map +1 -0
- package/lib/geometry/shape/constant.d.ts +4 -0
- package/lib/geometry/shape/constant.js +8 -0
- package/lib/geometry/shape/constant.js.map +1 -0
- package/lib/geometry/shape/edge/arc.d.ts +1 -0
- package/lib/geometry/shape/edge/arc.js +86 -0
- package/lib/geometry/shape/edge/arc.js.map +1 -0
- package/lib/geometry/shape/edge/index.d.ts +2 -0
- package/lib/geometry/shape/edge/index.js +33 -0
- package/lib/geometry/shape/edge/index.js.map +1 -0
- package/lib/geometry/shape/edge/smooth.d.ts +1 -0
- package/lib/geometry/shape/edge/smooth.js +32 -0
- package/lib/geometry/shape/edge/smooth.js.map +1 -0
- package/lib/geometry/shape/edge/util.d.ts +17 -0
- package/lib/geometry/shape/edge/util.js +37 -0
- package/lib/geometry/shape/edge/util.js.map +1 -0
- package/lib/geometry/shape/edge/vhv.d.ts +1 -0
- package/lib/geometry/shape/edge/vhv.js +44 -0
- package/lib/geometry/shape/edge/vhv.js.map +1 -0
- package/lib/geometry/shape/interval/funnel.d.ts +1 -0
- package/lib/geometry/shape/interval/funnel.js +33 -0
- package/lib/geometry/shape/interval/funnel.js.map +1 -0
- package/lib/geometry/shape/interval/hollow-rect.d.ts +1 -0
- package/lib/geometry/shape/interval/hollow-rect.js +53 -0
- package/lib/geometry/shape/interval/hollow-rect.js.map +1 -0
- package/lib/geometry/shape/interval/index.d.ts +3 -0
- package/lib/geometry/shape/interval/index.js +65 -0
- package/lib/geometry/shape/interval/index.js.map +1 -0
- package/lib/geometry/shape/interval/line.d.ts +1 -0
- package/lib/geometry/shape/interval/line.js +56 -0
- package/lib/geometry/shape/interval/line.js.map +1 -0
- package/lib/geometry/shape/interval/pyramid.d.ts +1 -0
- package/lib/geometry/shape/interval/pyramid.js +33 -0
- package/lib/geometry/shape/interval/pyramid.js.map +1 -0
- package/lib/geometry/shape/interval/tick.d.ts +1 -0
- package/lib/geometry/shape/interval/tick.js +79 -0
- package/lib/geometry/shape/interval/tick.js.map +1 -0
- package/lib/geometry/shape/interval/util.d.ts +55 -0
- package/lib/geometry/shape/interval/util.js +321 -0
- package/lib/geometry/shape/interval/util.js.map +1 -0
- package/lib/geometry/shape/line/index.d.ts +8 -0
- package/lib/geometry/shape/line/index.js +109 -0
- package/lib/geometry/shape/line/index.js.map +1 -0
- package/lib/geometry/shape/line/step.d.ts +1 -0
- package/lib/geometry/shape/line/step.js +86 -0
- package/lib/geometry/shape/line/step.js.map +1 -0
- package/lib/geometry/shape/line/util.d.ts +16 -0
- package/lib/geometry/shape/line/util.js +87 -0
- package/lib/geometry/shape/line/util.js.map +1 -0
- package/lib/geometry/shape/point/hollow.d.ts +1 -0
- package/lib/geometry/shape/point/hollow.js +26 -0
- package/lib/geometry/shape/point/hollow.js.map +1 -0
- package/lib/geometry/shape/point/image.d.ts +1 -0
- package/lib/geometry/shape/point/image.js +50 -0
- package/lib/geometry/shape/point/image.js.map +1 -0
- package/lib/geometry/shape/point/index.d.ts +2 -0
- package/lib/geometry/shape/point/index.js +34 -0
- package/lib/geometry/shape/point/index.js.map +1 -0
- package/lib/geometry/shape/point/solid.d.ts +1 -0
- package/lib/geometry/shape/point/solid.js +25 -0
- package/lib/geometry/shape/point/solid.js.map +1 -0
- package/lib/geometry/shape/point/util.d.ts +15 -0
- package/lib/geometry/shape/point/util.js +43 -0
- package/lib/geometry/shape/point/util.js.map +1 -0
- package/lib/geometry/shape/polygon/index.d.ts +2 -0
- package/lib/geometry/shape/polygon/index.js +67 -0
- package/lib/geometry/shape/polygon/index.js.map +1 -0
- package/lib/geometry/shape/polygon/square.d.ts +1 -0
- package/lib/geometry/shape/polygon/square.js +46 -0
- package/lib/geometry/shape/polygon/square.js.map +1 -0
- package/lib/geometry/shape/schema/box.d.ts +1 -0
- package/lib/geometry/shape/schema/box.js +144 -0
- package/lib/geometry/shape/schema/box.js.map +1 -0
- package/lib/geometry/shape/schema/candle.d.ts +1 -0
- package/lib/geometry/shape/schema/candle.js +82 -0
- package/lib/geometry/shape/schema/candle.js.map +1 -0
- package/lib/geometry/shape/schema/index.d.ts +2 -0
- package/lib/geometry/shape/schema/index.js +8 -0
- package/lib/geometry/shape/schema/index.js.map +1 -0
- package/lib/geometry/shape/util/get-path-points.d.ts +38 -0
- package/lib/geometry/shape/util/get-path-points.js +137 -0
- package/lib/geometry/shape/util/get-path-points.js.map +1 -0
- package/lib/geometry/shape/util/get-style.d.ts +18 -0
- package/lib/geometry/shape/util/get-style.js +52 -0
- package/lib/geometry/shape/util/get-style.js.map +1 -0
- package/lib/geometry/shape/util/path.d.ts +32 -0
- package/lib/geometry/shape/util/path.js +320 -0
- package/lib/geometry/shape/util/path.js.map +1 -0
- package/lib/geometry/shape/util/split-points.d.ts +13 -0
- package/lib/geometry/shape/util/split-points.js +28 -0
- package/lib/geometry/shape/util/split-points.js.map +1 -0
- package/lib/geometry/shape/violin/hollow.d.ts +1 -0
- package/lib/geometry/shape/violin/hollow.js +53 -0
- package/lib/geometry/shape/violin/hollow.js.map +1 -0
- package/lib/geometry/shape/violin/index.d.ts +2 -0
- package/lib/geometry/shape/violin/index.js +62 -0
- package/lib/geometry/shape/violin/index.js.map +1 -0
- package/lib/geometry/shape/violin/smooth.d.ts +1 -0
- package/lib/geometry/shape/violin/smooth.js +30 -0
- package/lib/geometry/shape/violin/smooth.js.map +1 -0
- package/lib/geometry/util/diff.d.ts +11 -0
- package/lib/geometry/util/diff.js +34 -0
- package/lib/geometry/util/diff.js.map +1 -0
- package/lib/geometry/util/get-shape-type.d.ts +8 -0
- package/lib/geometry/util/get-shape-type.js +20 -0
- package/lib/geometry/util/get-shape-type.js.map +1 -0
- package/lib/geometry/util/group-data.d.ts +3 -0
- package/lib/geometry/util/group-data.js +35 -0
- package/lib/geometry/util/group-data.js.map +1 -0
- package/lib/geometry/util/is-model-change.d.ts +9 -0
- package/lib/geometry/util/is-model-change.js +18 -0
- package/lib/geometry/util/is-model-change.js.map +1 -0
- package/lib/geometry/util/parse-fields.d.ts +2 -0
- package/lib/geometry/util/parse-fields.js +13 -0
- package/lib/geometry/util/parse-fields.js.map +1 -0
- package/lib/geometry/util/shape-size.d.ts +2 -0
- package/lib/geometry/util/shape-size.js +128 -0
- package/lib/geometry/util/shape-size.js.map +1 -0
- package/lib/geometry/violin.d.ts +25 -0
- package/lib/geometry/violin.js +69 -0
- package/lib/geometry/violin.js.map +1 -0
- package/lib/index.d.ts +107 -0
- package/lib/index.js +586 -0
- package/lib/index.js.map +1 -0
- package/lib/interaction/action/active-region.d.ts +33 -0
- package/lib/interaction/action/active-region.js +202 -0
- package/lib/interaction/action/active-region.js.map +1 -0
- package/lib/interaction/action/base.d.ts +29 -0
- package/lib/interaction/action/base.js +38 -0
- package/lib/interaction/action/base.js.map +1 -0
- package/lib/interaction/action/callback.d.ts +17 -0
- package/lib/interaction/action/callback.js +29 -0
- package/lib/interaction/action/callback.js.map +1 -0
- package/lib/interaction/action/component/list-active.d.ts +14 -0
- package/lib/interaction/action/component/list-active.js +26 -0
- package/lib/interaction/action/component/list-active.js.map +1 -0
- package/lib/interaction/action/component/list-checked.d.ts +30 -0
- package/lib/interaction/action/component/list-checked.js +84 -0
- package/lib/interaction/action/component/list-checked.js.map +1 -0
- package/lib/interaction/action/component/list-focus.d.ts +5 -0
- package/lib/interaction/action/component/list-focus.js +57 -0
- package/lib/interaction/action/component/list-focus.js.map +1 -0
- package/lib/interaction/action/component/list-highlight-util.d.ts +7 -0
- package/lib/interaction/action/component/list-highlight-util.js +24 -0
- package/lib/interaction/action/component/list-highlight-util.js.map +1 -0
- package/lib/interaction/action/component/list-highlight.d.ts +20 -0
- package/lib/interaction/action/component/list-highlight.js +99 -0
- package/lib/interaction/action/component/list-highlight.js.map +1 -0
- package/lib/interaction/action/component/list-radio.d.ts +24 -0
- package/lib/interaction/action/component/list-radio.js +118 -0
- package/lib/interaction/action/component/list-radio.js.map +1 -0
- package/lib/interaction/action/component/list-selected.d.ts +10 -0
- package/lib/interaction/action/component/list-selected.js +22 -0
- package/lib/interaction/action/component/list-selected.js.map +1 -0
- package/lib/interaction/action/component/list-state.d.ts +46 -0
- package/lib/interaction/action/component/list-state.js +169 -0
- package/lib/interaction/action/component/list-state.js.map +1 -0
- package/lib/interaction/action/component/list-unchecked.d.ts +13 -0
- package/lib/interaction/action/component/list-unchecked.js +25 -0
- package/lib/interaction/action/component/list-unchecked.js.map +1 -0
- package/lib/interaction/action/component/tooltip/ellipsis-text.d.ts +25 -0
- package/lib/interaction/action/component/tooltip/ellipsis-text.js +95 -0
- package/lib/interaction/action/component/tooltip/ellipsis-text.js.map +1 -0
- package/lib/interaction/action/component/tooltip/geometry.d.ts +24 -0
- package/lib/interaction/action/component/tooltip/geometry.js +73 -0
- package/lib/interaction/action/component/tooltip/geometry.js.map +1 -0
- package/lib/interaction/action/component/tooltip/sibling.d.ts +21 -0
- package/lib/interaction/action/component/tooltip/sibling.js +41 -0
- package/lib/interaction/action/component/tooltip/sibling.js.map +1 -0
- package/lib/interaction/action/cursor.d.ts +69 -0
- package/lib/interaction/action/cursor.js +115 -0
- package/lib/interaction/action/cursor.js.map +1 -0
- package/lib/interaction/action/data/filter.d.ts +13 -0
- package/lib/interaction/action/data/filter.js +68 -0
- package/lib/interaction/action/data/filter.js.map +1 -0
- package/lib/interaction/action/data/range-filter.d.ts +56 -0
- package/lib/interaction/action/data/range-filter.js +166 -0
- package/lib/interaction/action/data/range-filter.js.map +1 -0
- package/lib/interaction/action/data/sibling-filter.d.ts +22 -0
- package/lib/interaction/action/data/sibling-filter.js +41 -0
- package/lib/interaction/action/data/sibling-filter.js.map +1 -0
- package/lib/interaction/action/element/active.d.ts +14 -0
- package/lib/interaction/action/element/active.js +26 -0
- package/lib/interaction/action/element/active.js.map +1 -0
- package/lib/interaction/action/element/filter.d.ts +20 -0
- package/lib/interaction/action/element/filter.js +91 -0
- package/lib/interaction/action/element/filter.js.map +1 -0
- package/lib/interaction/action/element/highlight-by-color.d.ts +10 -0
- package/lib/interaction/action/element/highlight-by-color.js +32 -0
- package/lib/interaction/action/element/highlight-by-color.js.map +1 -0
- package/lib/interaction/action/element/highlight-by-x.d.ts +15 -0
- package/lib/interaction/action/element/highlight-by-x.js +53 -0
- package/lib/interaction/action/element/highlight-by-x.js.map +1 -0
- package/lib/interaction/action/element/highlight-util.d.ts +18 -0
- package/lib/interaction/action/element/highlight-util.js +50 -0
- package/lib/interaction/action/element/highlight-util.js.map +1 -0
- package/lib/interaction/action/element/highlight.d.ts +21 -0
- package/lib/interaction/action/element/highlight.js +96 -0
- package/lib/interaction/action/element/highlight.js.map +1 -0
- package/lib/interaction/action/element/link-by-color.d.ts +51 -0
- package/lib/interaction/action/element/link-by-color.js +158 -0
- package/lib/interaction/action/element/link-by-color.js.map +1 -0
- package/lib/interaction/action/element/range-active.d.ts +13 -0
- package/lib/interaction/action/element/range-active.js +25 -0
- package/lib/interaction/action/element/range-active.js.map +1 -0
- package/lib/interaction/action/element/range-highlight.d.ts +27 -0
- package/lib/interaction/action/element/range-highlight.js +57 -0
- package/lib/interaction/action/element/range-highlight.js.map +1 -0
- package/lib/interaction/action/element/range-selected.d.ts +13 -0
- package/lib/interaction/action/element/range-selected.js +25 -0
- package/lib/interaction/action/element/range-selected.js.map +1 -0
- package/lib/interaction/action/element/range-state.d.ts +38 -0
- package/lib/interaction/action/element/range-state.js +166 -0
- package/lib/interaction/action/element/range-state.js.map +1 -0
- package/lib/interaction/action/element/selected.d.ts +14 -0
- package/lib/interaction/action/element/selected.js +26 -0
- package/lib/interaction/action/element/selected.js.map +1 -0
- package/lib/interaction/action/element/sibling-filter.d.ts +19 -0
- package/lib/interaction/action/element/sibling-filter.js +95 -0
- package/lib/interaction/action/element/sibling-filter.js.map +1 -0
- package/lib/interaction/action/element/single-active.d.ts +13 -0
- package/lib/interaction/action/element/single-active.js +25 -0
- package/lib/interaction/action/element/single-active.js.map +1 -0
- package/lib/interaction/action/element/single-highlight.d.ts +16 -0
- package/lib/interaction/action/element/single-highlight.js +37 -0
- package/lib/interaction/action/element/single-highlight.js.map +1 -0
- package/lib/interaction/action/element/single-selected.d.ts +13 -0
- package/lib/interaction/action/element/single-selected.js +25 -0
- package/lib/interaction/action/element/single-selected.js.map +1 -0
- package/lib/interaction/action/element/single-state.d.ts +18 -0
- package/lib/interaction/action/element/single-state.js +55 -0
- package/lib/interaction/action/element/single-state.js.map +1 -0
- package/lib/interaction/action/element/state-base.d.ts +39 -0
- package/lib/interaction/action/element/state-base.js +61 -0
- package/lib/interaction/action/element/state-base.js.map +1 -0
- package/lib/interaction/action/element/state.d.ts +28 -0
- package/lib/interaction/action/element/state.js +101 -0
- package/lib/interaction/action/element/state.js.map +1 -0
- package/lib/interaction/action/index.d.ts +2 -0
- package/lib/interaction/action/index.js +13 -0
- package/lib/interaction/action/index.js.map +1 -0
- package/lib/interaction/action/mask/base.d.ts +62 -0
- package/lib/interaction/action/mask/base.js +171 -0
- package/lib/interaction/action/mask/base.js.map +1 -0
- package/lib/interaction/action/mask/circle.d.ts +14 -0
- package/lib/interaction/action/mask/circle.js +39 -0
- package/lib/interaction/action/mask/circle.js.map +1 -0
- package/lib/interaction/action/mask/dim-rect.d.ts +11 -0
- package/lib/interaction/action/mask/dim-rect.js +64 -0
- package/lib/interaction/action/mask/dim-rect.js.map +1 -0
- package/lib/interaction/action/mask/path.d.ts +16 -0
- package/lib/interaction/action/mask/path.js +46 -0
- package/lib/interaction/action/mask/path.js.map +1 -0
- package/lib/interaction/action/mask/rect.d.ts +17 -0
- package/lib/interaction/action/mask/rect.js +41 -0
- package/lib/interaction/action/mask/rect.js.map +1 -0
- package/lib/interaction/action/mask/smooth-path.d.ts +9 -0
- package/lib/interaction/action/mask/smooth-path.js +23 -0
- package/lib/interaction/action/mask/smooth-path.js.map +1 -0
- package/lib/interaction/action/register.d.ts +36 -0
- package/lib/interaction/action/register.js +69 -0
- package/lib/interaction/action/register.js.map +1 -0
- package/lib/interaction/action/util.d.ts +140 -0
- package/lib/interaction/action/util.js +387 -0
- package/lib/interaction/action/util.js.map +1 -0
- package/lib/interaction/action/view/button.d.ts +25 -0
- package/lib/interaction/action/view/button.js +118 -0
- package/lib/interaction/action/view/button.js.map +1 -0
- package/lib/interaction/action/view/drag.d.ts +24 -0
- package/lib/interaction/action/view/drag.js +75 -0
- package/lib/interaction/action/view/drag.js.map +1 -0
- package/lib/interaction/action/view/mousewheel-scroll.d.ts +5 -0
- package/lib/interaction/action/view/mousewheel-scroll.js +37 -0
- package/lib/interaction/action/view/mousewheel-scroll.js.map +1 -0
- package/lib/interaction/action/view/move.d.ts +28 -0
- package/lib/interaction/action/view/move.js +82 -0
- package/lib/interaction/action/view/move.js.map +1 -0
- package/lib/interaction/action/view/scale-transform.d.ts +18 -0
- package/lib/interaction/action/view/scale-transform.js +53 -0
- package/lib/interaction/action/view/scale-transform.js.map +1 -0
- package/lib/interaction/action/view/scale-translate.d.ts +30 -0
- package/lib/interaction/action/view/scale-translate.js +114 -0
- package/lib/interaction/action/view/scale-translate.js.map +1 -0
- package/lib/interaction/action/view/scale-zoom.d.ts +20 -0
- package/lib/interaction/action/view/scale-zoom.js +85 -0
- package/lib/interaction/action/view/scale-zoom.js.map +1 -0
- package/lib/interaction/context.d.ts +65 -0
- package/lib/interaction/context.js +144 -0
- package/lib/interaction/context.js.map +1 -0
- package/lib/interaction/grammar-interaction.d.ts +158 -0
- package/lib/interaction/grammar-interaction.js +289 -0
- package/lib/interaction/grammar-interaction.js.map +1 -0
- package/lib/interaction/index.d.ts +25 -0
- package/lib/interaction/index.js +54 -0
- package/lib/interaction/index.js.map +1 -0
- package/lib/interaction/interaction.d.ts +29 -0
- package/lib/interaction/interaction.js +34 -0
- package/lib/interaction/interaction.js.map +1 -0
- package/lib/interface.d.ts +2264 -0
- package/lib/interface.js +3 -0
- package/lib/interface.js.map +1 -0
- package/lib/theme/index.d.ts +12 -0
- package/lib/theme/index.js +28 -0
- package/lib/theme/index.js.map +1 -0
- package/lib/theme/style-sheet/dark.d.ts +825 -0
- package/lib/theme/style-sheet/dark.js +500 -0
- package/lib/theme/style-sheet/dark.js.map +1 -0
- package/lib/theme/style-sheet/light.d.ts +817 -0
- package/lib/theme/style-sheet/light.js +496 -0
- package/lib/theme/style-sheet/light.js.map +1 -0
- package/lib/theme/util/create-by-style-sheet.d.ts +6 -0
- package/lib/theme/util/create-by-style-sheet.js +1426 -0
- package/lib/theme/util/create-by-style-sheet.js.map +1 -0
- package/lib/theme/util/create-theme.d.ts +6 -0
- package/lib/theme/util/create-theme.js +16 -0
- package/lib/theme/util/create-theme.js.map +1 -0
- package/lib/theme/util/index.d.ts +1 -0
- package/lib/theme/util/index.js +6 -0
- package/lib/theme/util/index.js.map +1 -0
- package/lib/util/annotation.d.ts +7 -0
- package/lib/util/annotation.js +43 -0
- package/lib/util/annotation.js.map +1 -0
- package/lib/util/attr.d.ts +10 -0
- package/lib/util/attr.js +29 -0
- package/lib/util/attr.js.map +1 -0
- package/lib/util/axis.d.ts +100 -0
- package/lib/util/axis.js +251 -0
- package/lib/util/axis.js.map +1 -0
- package/lib/util/bbox.d.ts +105 -0
- package/lib/util/bbox.js +287 -0
- package/lib/util/bbox.js.map +1 -0
- package/lib/util/collision-detect.d.ts +16 -0
- package/lib/util/collision-detect.js +132 -0
- package/lib/util/collision-detect.js.map +1 -0
- package/lib/util/color.d.ts +1 -0
- package/lib/util/color.js +23 -0
- package/lib/util/color.js.map +1 -0
- package/lib/util/context.d.ts +4 -0
- package/lib/util/context.js +15 -0
- package/lib/util/context.js.map +1 -0
- package/lib/util/coordinate.d.ts +86 -0
- package/lib/util/coordinate.js +157 -0
- package/lib/util/coordinate.js.map +1 -0
- package/lib/util/direction.d.ts +19 -0
- package/lib/util/direction.js +125 -0
- package/lib/util/direction.js.map +1 -0
- package/lib/util/dom.d.ts +19 -0
- package/lib/util/dom.js +68 -0
- package/lib/util/dom.js.map +1 -0
- package/lib/util/event.d.ts +8 -0
- package/lib/util/event.js +18 -0
- package/lib/util/event.js.map +1 -0
- package/lib/util/facet.d.ts +16 -0
- package/lib/util/facet.js +48 -0
- package/lib/util/facet.js.map +1 -0
- package/lib/util/graphics.d.ts +58 -0
- package/lib/util/graphics.js +212 -0
- package/lib/util/graphics.js.map +1 -0
- package/lib/util/grid.d.ts +36 -0
- package/lib/util/grid.js +125 -0
- package/lib/util/grid.js.map +1 -0
- package/lib/util/helper.d.ts +34 -0
- package/lib/util/helper.js +79 -0
- package/lib/util/helper.js.map +1 -0
- package/lib/util/legend.d.ts +45 -0
- package/lib/util/legend.js +152 -0
- package/lib/util/legend.js.map +1 -0
- package/lib/util/marker.d.ts +10 -0
- package/lib/util/marker.js +61 -0
- package/lib/util/marker.js.map +1 -0
- package/lib/util/padding.d.ts +14 -0
- package/lib/util/padding.js +45 -0
- package/lib/util/padding.js.map +1 -0
- package/lib/util/scale.d.ts +42 -0
- package/lib/util/scale.js +137 -0
- package/lib/util/scale.js.map +1 -0
- package/lib/util/stat.d.ts +10 -0
- package/lib/util/stat.js +41 -0
- package/lib/util/stat.js.map +1 -0
- package/lib/util/text.d.ts +23 -0
- package/lib/util/text.js +88 -0
- package/lib/util/text.js.map +1 -0
- package/lib/util/tooltip.d.ts +26 -0
- package/lib/util/tooltip.js +426 -0
- package/lib/util/tooltip.js.map +1 -0
- package/lib/util/transform.d.ts +33 -0
- package/lib/util/transform.js +69 -0
- package/lib/util/transform.js.map +1 -0
- package/lib/util/types.d.ts +6 -0
- package/lib/util/types.js +3 -0
- package/lib/util/types.js.map +1 -0
- package/package.json +4 -3
- package/src/core.ts +1 -1
|
@@ -0,0 +1,1633 @@
|
|
|
1
|
+
import { __assign, __extends, __rest, __spreadArray } from "tslib";
|
|
2
|
+
import { clone, deepMix, each, filter, find, flatten, get, isBoolean, isFunction, isNil, isObject, isString, isUndefined, mix, remove, set, size, uniqueId, isEqual, isPlainObject, reduce, } from '@antv/util';
|
|
3
|
+
import { GROUP_Z_INDEX, LAYER, PLOT_EVENTS, VIEW_LIFE_CIRCLE } from '../constant';
|
|
4
|
+
import Base from '../base';
|
|
5
|
+
import { getFacet } from '../facet';
|
|
6
|
+
import { createInteraction } from '../interaction';
|
|
7
|
+
import { getTheme } from '../theme';
|
|
8
|
+
import { BBox } from '../util/bbox';
|
|
9
|
+
import { getCoordinateClipCfg, isPointInCoordinate } from '../util/coordinate';
|
|
10
|
+
import { uniq } from '../util/helper';
|
|
11
|
+
import { findDataByPoint } from '../util/tooltip';
|
|
12
|
+
import { parsePadding } from '../util/padding';
|
|
13
|
+
import { getDefaultCategoryScaleRange } from '../util/scale';
|
|
14
|
+
import { createTheme } from '../theme/util';
|
|
15
|
+
import { getComponentController, getComponentControllerNames } from './controller';
|
|
16
|
+
import CoordinateController from './controller/coordinate';
|
|
17
|
+
import Event from './event';
|
|
18
|
+
import defaultLayout from './layout';
|
|
19
|
+
import { ScalePool } from './util/scale-pool';
|
|
20
|
+
import { PaddingCal } from './layout/padding-cal';
|
|
21
|
+
import { calculatePadding } from './layout/auto';
|
|
22
|
+
import { defaultSyncViewPadding } from './util/sync-view-padding';
|
|
23
|
+
/**
|
|
24
|
+
* G2 视图 View 类
|
|
25
|
+
*/
|
|
26
|
+
var View = /** @class */ (function (_super) {
|
|
27
|
+
__extends(View, _super);
|
|
28
|
+
function View(props) {
|
|
29
|
+
var _this = _super.call(this, { visible: props.visible }) || this;
|
|
30
|
+
/** 所有的子 view。 */
|
|
31
|
+
_this.views = [];
|
|
32
|
+
/** 所有的 geometry 实例。 */
|
|
33
|
+
_this.geometries = [];
|
|
34
|
+
/** 所有的组件 controllers。 */
|
|
35
|
+
_this.controllers = [];
|
|
36
|
+
/** 所有的 Interaction 实例。 */
|
|
37
|
+
_this.interactions = {};
|
|
38
|
+
/** 是否对超出坐标系范围的 Geometry 进行剪切 */
|
|
39
|
+
_this.limitInPlot = false;
|
|
40
|
+
// 配置信息存储
|
|
41
|
+
_this.options = {
|
|
42
|
+
data: [],
|
|
43
|
+
animate: true, // 默认开启动画
|
|
44
|
+
}; // 初始化为空
|
|
45
|
+
/** 配置开启的组件插件,默认为全局配置的组件。 */
|
|
46
|
+
_this.usedControllers = getComponentControllerNames();
|
|
47
|
+
/** 所有的 scales */
|
|
48
|
+
_this.scalePool = new ScalePool();
|
|
49
|
+
/** 布局函数 */
|
|
50
|
+
_this.layoutFunc = defaultLayout;
|
|
51
|
+
/** 当前鼠标是否在 plot 内(CoordinateBBox) */
|
|
52
|
+
_this.isPreMouseInPlot = false;
|
|
53
|
+
/** 默认标识位,用于判定数据是否更新 */
|
|
54
|
+
_this.isDataChanged = false;
|
|
55
|
+
/** 用于判断坐标系范围是否发生变化的标志位 */
|
|
56
|
+
_this.isCoordinateChanged = false;
|
|
57
|
+
/** 从当前这个 view 创建的 scale key */
|
|
58
|
+
_this.createdScaleKeys = new Map();
|
|
59
|
+
_this.onCanvasEvent = function (evt) {
|
|
60
|
+
var name = evt.name;
|
|
61
|
+
if (!name.includes(':')) {
|
|
62
|
+
// 非委托事件
|
|
63
|
+
var e = _this.createViewEvent(evt);
|
|
64
|
+
// 处理 plot 事件
|
|
65
|
+
_this.doPlotEvent(e);
|
|
66
|
+
_this.emit(name, e);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* 触发事件之后
|
|
71
|
+
* @param evt
|
|
72
|
+
*/
|
|
73
|
+
_this.onDelegateEvents = function (evt) {
|
|
74
|
+
// 阻止继续冒泡,防止重复事件触发
|
|
75
|
+
// evt.preventDefault();
|
|
76
|
+
var name = evt.name;
|
|
77
|
+
if (!name.includes(':')) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// 事件在 view 嵌套中冒泡(暂不提供阻止冒泡的机制)
|
|
81
|
+
var e = _this.createViewEvent(evt);
|
|
82
|
+
// 包含有基本事件、组合事件
|
|
83
|
+
_this.emit(name, e);
|
|
84
|
+
// const currentTarget = evt.currentTarget as IShape;
|
|
85
|
+
// const inheritNames = currentTarget.get('inheritNames');
|
|
86
|
+
// if (evt.delegateObject || inheritNames) {
|
|
87
|
+
// const events = this.getEvents();
|
|
88
|
+
// each(inheritNames, (subName) => {
|
|
89
|
+
// const eventName = `${subName}:${type}`;
|
|
90
|
+
// if (events[eventName]) {
|
|
91
|
+
// this.emit(eventName, e);
|
|
92
|
+
// }
|
|
93
|
+
// });
|
|
94
|
+
// }
|
|
95
|
+
};
|
|
96
|
+
var _a = props.id, id = _a === void 0 ? uniqueId('view') : _a, parent = props.parent, canvas = props.canvas, backgroundGroup = props.backgroundGroup, middleGroup = props.middleGroup, foregroundGroup = props.foregroundGroup, _b = props.region, region = _b === void 0 ? { start: { x: 0, y: 0 }, end: { x: 1, y: 1 } } : _b, padding = props.padding, appendPadding = props.appendPadding, theme = props.theme, options = props.options, limitInPlot = props.limitInPlot, syncViewPadding = props.syncViewPadding;
|
|
97
|
+
_this.parent = parent;
|
|
98
|
+
_this.canvas = canvas;
|
|
99
|
+
_this.backgroundGroup = backgroundGroup;
|
|
100
|
+
_this.middleGroup = middleGroup;
|
|
101
|
+
_this.foregroundGroup = foregroundGroup;
|
|
102
|
+
_this.region = region;
|
|
103
|
+
_this.padding = padding;
|
|
104
|
+
_this.appendPadding = appendPadding;
|
|
105
|
+
// 接受父 view 传入的参数
|
|
106
|
+
_this.options = __assign(__assign({}, _this.options), options);
|
|
107
|
+
_this.limitInPlot = limitInPlot;
|
|
108
|
+
_this.id = id;
|
|
109
|
+
_this.syncViewPadding = syncViewPadding;
|
|
110
|
+
// 初始化 theme
|
|
111
|
+
_this.themeObject = isObject(theme) ? deepMix({}, getTheme('default'), createTheme(theme)) : getTheme(theme);
|
|
112
|
+
_this.init();
|
|
113
|
+
return _this;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 设置 layout 布局函数
|
|
117
|
+
* @param layout 布局函数
|
|
118
|
+
* @returns void
|
|
119
|
+
*/
|
|
120
|
+
View.prototype.setLayout = function (layout) {
|
|
121
|
+
this.layoutFunc = layout;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* 生命周期:初始化
|
|
125
|
+
* @returns voids
|
|
126
|
+
*/
|
|
127
|
+
View.prototype.init = function () {
|
|
128
|
+
// 计算画布的 viewBBox
|
|
129
|
+
this.calculateViewBBox();
|
|
130
|
+
// 事件委托机制
|
|
131
|
+
this.initEvents();
|
|
132
|
+
// 初始化组件 controller
|
|
133
|
+
this.initComponentController();
|
|
134
|
+
this.initOptions();
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* 生命周期:渲染流程,渲染过程需要处理数据更新的情况。
|
|
138
|
+
* render 函数仅仅会处理 view 和子 view。
|
|
139
|
+
* @param isUpdate 是否触发更新流程。
|
|
140
|
+
* @param params render 事件参数
|
|
141
|
+
*/
|
|
142
|
+
View.prototype.render = function (isUpdate, payload) {
|
|
143
|
+
if (isUpdate === void 0) { isUpdate = false; }
|
|
144
|
+
this.emit(VIEW_LIFE_CIRCLE.BEFORE_RENDER, Event.fromData(this, VIEW_LIFE_CIRCLE.BEFORE_RENDER, payload));
|
|
145
|
+
// 递归渲染
|
|
146
|
+
this.paint(isUpdate);
|
|
147
|
+
this.emit(VIEW_LIFE_CIRCLE.AFTER_RENDER, Event.fromData(this, VIEW_LIFE_CIRCLE.AFTER_RENDER, payload));
|
|
148
|
+
if (this.visible === false) {
|
|
149
|
+
// 用户在初始化的时候声明 visible: false
|
|
150
|
+
this.changeVisible(false);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* 生命周期:清空图表上所有的绘制内容,但是不销毁图表,chart 仍可使用。
|
|
155
|
+
* @returns void
|
|
156
|
+
*/
|
|
157
|
+
View.prototype.clear = function () {
|
|
158
|
+
var _this = this;
|
|
159
|
+
this.emit(VIEW_LIFE_CIRCLE.BEFORE_CLEAR);
|
|
160
|
+
// 1. 清空缓存和计算数据
|
|
161
|
+
this.filteredData = [];
|
|
162
|
+
this.coordinateInstance = undefined;
|
|
163
|
+
this.isDataChanged = false; // 复位
|
|
164
|
+
this.isCoordinateChanged = false; // 复位
|
|
165
|
+
// 2. 清空 geometries
|
|
166
|
+
var geometries = this.geometries;
|
|
167
|
+
for (var i = 0; i < geometries.length; i++) {
|
|
168
|
+
geometries[i].clear();
|
|
169
|
+
// view 中使用 geometry 的时候,还需要清空它的容器,不然下一次 chart.geometry() 的时候,又创建了一个,导致泄露, #2799。
|
|
170
|
+
geometries[i].container.remove(true);
|
|
171
|
+
geometries[i].labelsContainer.remove(true);
|
|
172
|
+
}
|
|
173
|
+
this.geometries = [];
|
|
174
|
+
// 3. 清空 controllers
|
|
175
|
+
var controllers = this.controllers;
|
|
176
|
+
for (var i = 0; i < controllers.length; i++) {
|
|
177
|
+
if (controllers[i].name === 'annotation') {
|
|
178
|
+
// 需要清空配置项
|
|
179
|
+
controllers[i].clear(true);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
controllers[i].clear();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// 4. 删除 scale 缓存
|
|
186
|
+
this.createdScaleKeys.forEach(function (v, k) {
|
|
187
|
+
_this.getRootView().scalePool.deleteScale(k);
|
|
188
|
+
});
|
|
189
|
+
this.createdScaleKeys.clear();
|
|
190
|
+
// 递归处理子 view
|
|
191
|
+
var views = this.views;
|
|
192
|
+
for (var i = 0; i < views.length; i++) {
|
|
193
|
+
views[i].clear();
|
|
194
|
+
}
|
|
195
|
+
this.emit(VIEW_LIFE_CIRCLE.AFTER_CLEAR);
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* 生命周期:销毁,完全无法使用。
|
|
199
|
+
* @returns void
|
|
200
|
+
*/
|
|
201
|
+
View.prototype.destroy = function () {
|
|
202
|
+
// 销毁前事件,销毁之后已经没有意义了,所以不抛出事件
|
|
203
|
+
this.emit(VIEW_LIFE_CIRCLE.BEFORE_DESTROY);
|
|
204
|
+
var interactions = this.interactions;
|
|
205
|
+
// 销毁 interactions
|
|
206
|
+
each(interactions, function (interaction) {
|
|
207
|
+
if (interaction) {
|
|
208
|
+
// 有可能已经销毁,设置了 undefined
|
|
209
|
+
interaction.destroy();
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
this.clear();
|
|
213
|
+
// 销毁 controller 中的组件
|
|
214
|
+
var controllers = this.controllers;
|
|
215
|
+
for (var i = 0, len = controllers.length; i < len; i++) {
|
|
216
|
+
var controller = controllers[i];
|
|
217
|
+
controller.destroy();
|
|
218
|
+
}
|
|
219
|
+
this.backgroundGroup.remove(true);
|
|
220
|
+
this.middleGroup.remove(true);
|
|
221
|
+
this.foregroundGroup.remove(true);
|
|
222
|
+
_super.prototype.destroy.call(this);
|
|
223
|
+
};
|
|
224
|
+
/* end 生命周期函数 */
|
|
225
|
+
/**
|
|
226
|
+
* 显示或者隐藏整个 view。
|
|
227
|
+
* @param visible 是否可见
|
|
228
|
+
* @returns View
|
|
229
|
+
*/
|
|
230
|
+
View.prototype.changeVisible = function (visible) {
|
|
231
|
+
_super.prototype.changeVisible.call(this, visible);
|
|
232
|
+
var geometries = this.geometries;
|
|
233
|
+
for (var i = 0, len = geometries.length; i < len; i++) {
|
|
234
|
+
var geometry = geometries[i];
|
|
235
|
+
geometry.changeVisible(visible);
|
|
236
|
+
}
|
|
237
|
+
var controllers = this.controllers;
|
|
238
|
+
for (var i = 0, len = controllers.length; i < len; i++) {
|
|
239
|
+
var controller = controllers[i];
|
|
240
|
+
controller.changeVisible(visible);
|
|
241
|
+
}
|
|
242
|
+
this.foregroundGroup.set('visible', visible);
|
|
243
|
+
this.middleGroup.set('visible', visible);
|
|
244
|
+
this.backgroundGroup.set('visible', visible);
|
|
245
|
+
// group.set('visible', visible) 不会触发自动刷新
|
|
246
|
+
this.getCanvas().draw();
|
|
247
|
+
return this;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* 装载数据源。
|
|
251
|
+
*
|
|
252
|
+
* ```ts
|
|
253
|
+
* view.data([{ city: '杭州', sale: 100 }, { city: '上海', sale: 110 } ]);
|
|
254
|
+
* ```
|
|
255
|
+
*
|
|
256
|
+
* @param data 数据源,json 数组。
|
|
257
|
+
* @returns View
|
|
258
|
+
*/
|
|
259
|
+
View.prototype.data = function (data) {
|
|
260
|
+
set(this.options, 'data', data);
|
|
261
|
+
this.isDataChanged = true;
|
|
262
|
+
return this;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* @deprecated
|
|
266
|
+
* This method will be removed at G2 V4.1. Replaced by {@link #data(data)}
|
|
267
|
+
*/
|
|
268
|
+
View.prototype.source = function (data) {
|
|
269
|
+
console.warn('This method will be removed at G2 V4.1. Please use chart.data() instead.');
|
|
270
|
+
return this.data(data);
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* 设置数据筛选规则。
|
|
274
|
+
*
|
|
275
|
+
* ```ts
|
|
276
|
+
* view.filter('city', (value: any, datum: Datum) => value !== '杭州');
|
|
277
|
+
*
|
|
278
|
+
* // 删除 'city' 字段对应的筛选规则。
|
|
279
|
+
* view.filter('city', null);
|
|
280
|
+
* ```
|
|
281
|
+
*
|
|
282
|
+
* @param field 数据字段
|
|
283
|
+
* @param condition 筛选规则
|
|
284
|
+
* @returns View
|
|
285
|
+
*/
|
|
286
|
+
View.prototype.filter = function (field, condition) {
|
|
287
|
+
if (isFunction(condition)) {
|
|
288
|
+
set(this.options, ['filters', field], condition);
|
|
289
|
+
return this;
|
|
290
|
+
}
|
|
291
|
+
// condition 为空,则表示删除过滤条件
|
|
292
|
+
if (!condition && get(this.options, ['filters', field])) {
|
|
293
|
+
delete this.options.filters[field];
|
|
294
|
+
}
|
|
295
|
+
return this;
|
|
296
|
+
};
|
|
297
|
+
View.prototype.axis = function (field, axisOption) {
|
|
298
|
+
if (isBoolean(field)) {
|
|
299
|
+
set(this.options, ['axes'], field);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
set(this.options, ['axes', field], axisOption);
|
|
303
|
+
}
|
|
304
|
+
return this;
|
|
305
|
+
};
|
|
306
|
+
View.prototype.legend = function (field, legendOption) {
|
|
307
|
+
if (isBoolean(field)) {
|
|
308
|
+
set(this.options, ['legends'], field);
|
|
309
|
+
}
|
|
310
|
+
else if (isString(field)) {
|
|
311
|
+
set(this.options, ['legends', field], legendOption);
|
|
312
|
+
if (isPlainObject(legendOption) && (legendOption === null || legendOption === void 0 ? void 0 : legendOption.selected)) {
|
|
313
|
+
set(this.options, ['filters', field], function (name) {
|
|
314
|
+
var _a;
|
|
315
|
+
return (_a = legendOption === null || legendOption === void 0 ? void 0 : legendOption.selected[name]) !== null && _a !== void 0 ? _a : true;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
// 设置全局的 legend 配置
|
|
321
|
+
set(this.options, ['legends'], field);
|
|
322
|
+
}
|
|
323
|
+
return this;
|
|
324
|
+
};
|
|
325
|
+
View.prototype.scale = function (field, scaleOption) {
|
|
326
|
+
var _this = this;
|
|
327
|
+
if (isString(field)) {
|
|
328
|
+
set(this.options, ['scales', field], scaleOption);
|
|
329
|
+
}
|
|
330
|
+
else if (isObject(field)) {
|
|
331
|
+
each(field, function (v, k) {
|
|
332
|
+
set(_this.options, ['scales', k], v);
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
return this;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* tooltip 提示信息配置。
|
|
339
|
+
*
|
|
340
|
+
* ```ts
|
|
341
|
+
* view.tooltip(false); // 关闭 tooltip
|
|
342
|
+
*
|
|
343
|
+
* view.tooltip({
|
|
344
|
+
* shared: true
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @param cfg Tooltip 配置,更详细的配置项参考:https://github.com/antvis/component#tooltip
|
|
349
|
+
* @returns View
|
|
350
|
+
*/
|
|
351
|
+
View.prototype.tooltip = function (cfg) {
|
|
352
|
+
set(this.options, 'tooltip', cfg);
|
|
353
|
+
return this;
|
|
354
|
+
};
|
|
355
|
+
/**
|
|
356
|
+
* 辅助标记配置。
|
|
357
|
+
*
|
|
358
|
+
* ```ts
|
|
359
|
+
* view.annotation().line({
|
|
360
|
+
* start: ['min', 85],
|
|
361
|
+
* end: ['max', 85],
|
|
362
|
+
* style: {
|
|
363
|
+
* stroke: '#595959',
|
|
364
|
+
* lineWidth: 1,
|
|
365
|
+
* lineDash: [3, 3],
|
|
366
|
+
* },
|
|
367
|
+
* });
|
|
368
|
+
* ```
|
|
369
|
+
* 更详细的配置项:https://github.com/antvis/component#annotation
|
|
370
|
+
* @returns [[Annotation]]
|
|
371
|
+
*/
|
|
372
|
+
View.prototype.annotation = function () {
|
|
373
|
+
return this.getController('annotation');
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* @deprecated
|
|
377
|
+
* This method will be removed at G2 V4.1. Replaced by {@link #guide()}
|
|
378
|
+
*/
|
|
379
|
+
View.prototype.guide = function () {
|
|
380
|
+
console.warn('This method will be removed at G2 V4.1. Please use chart.annotation() instead.');
|
|
381
|
+
return this.annotation();
|
|
382
|
+
};
|
|
383
|
+
View.prototype.coordinate = function (type, coordinateCfg) {
|
|
384
|
+
// 提供语法糖,使用更简单
|
|
385
|
+
if (isString(type)) {
|
|
386
|
+
set(this.options, 'coordinate', { type: type, cfg: coordinateCfg });
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
set(this.options, 'coordinate', type);
|
|
390
|
+
}
|
|
391
|
+
// 更新 coordinate 配置
|
|
392
|
+
this.coordinateController.update(this.options.coordinate);
|
|
393
|
+
return this.coordinateController;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* @deprecated
|
|
397
|
+
* This method will be removed at G2 V4.1. Replaced by {@link #coordinate()}
|
|
398
|
+
*/
|
|
399
|
+
View.prototype.coord = function (type, coordinateCfg) {
|
|
400
|
+
console.warn('This method will be removed at G2 V4.1. Please use chart.coordinate() instead.');
|
|
401
|
+
// @ts-ignore
|
|
402
|
+
return this.coordinate(type, coordinateCfg);
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* view 分面绘制。
|
|
406
|
+
*
|
|
407
|
+
* ```ts
|
|
408
|
+
* view.facet('rect', {
|
|
409
|
+
* rowField: 'province',
|
|
410
|
+
* columnField: 'category',
|
|
411
|
+
* eachView: (innerView: View, facet?: FacetData) => {
|
|
412
|
+
* innerView.line().position('city*sale');
|
|
413
|
+
* },
|
|
414
|
+
* });
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
417
|
+
* @param type 分面类型
|
|
418
|
+
* @param cfg 分面配置, [[FacetCfgMap]]
|
|
419
|
+
* @returns View
|
|
420
|
+
*/
|
|
421
|
+
View.prototype.facet = function (type, cfg) {
|
|
422
|
+
// 先销毁掉之前的分面
|
|
423
|
+
if (this.facetInstance) {
|
|
424
|
+
this.facetInstance.destroy();
|
|
425
|
+
}
|
|
426
|
+
// 创建新的分面
|
|
427
|
+
var Ctor = getFacet(type);
|
|
428
|
+
if (!Ctor) {
|
|
429
|
+
throw new Error("facet '".concat(type, "' is not exist!"));
|
|
430
|
+
}
|
|
431
|
+
this.facetInstance = new Ctor(this, __assign(__assign({}, cfg), { type: type }));
|
|
432
|
+
return this;
|
|
433
|
+
};
|
|
434
|
+
/*
|
|
435
|
+
* 开启或者关闭动画。
|
|
436
|
+
*
|
|
437
|
+
* ```ts
|
|
438
|
+
* view.animate(false);
|
|
439
|
+
* ```
|
|
440
|
+
*
|
|
441
|
+
* @param status 动画状态,true 表示开始,false 表示关闭
|
|
442
|
+
* @returns View
|
|
443
|
+
*/
|
|
444
|
+
View.prototype.animate = function (status) {
|
|
445
|
+
set(this.options, 'animate', status);
|
|
446
|
+
return this;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* 更新配置项,用于配置项式声明。
|
|
450
|
+
* @param options 配置项
|
|
451
|
+
*/
|
|
452
|
+
View.prototype.updateOptions = function (options) {
|
|
453
|
+
this.clear(); // 清空
|
|
454
|
+
mix(this.options, options);
|
|
455
|
+
// 需要把已存在的 view 销毁,否则会重复创建
|
|
456
|
+
// 目前针对配置项还没有特别好的 view 更新机制,为了不影响主流流程,所以在这里直接销毁
|
|
457
|
+
this.views.forEach(function (view) { return view.destroy(); });
|
|
458
|
+
this.views = [];
|
|
459
|
+
this.initOptions();
|
|
460
|
+
// 初始化坐标系大小,保证 padding 计算正确
|
|
461
|
+
this.coordinateBBox = this.viewBBox;
|
|
462
|
+
return this;
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* 往 `view.options` 属性中存储配置项。
|
|
466
|
+
* @param name 属性名称
|
|
467
|
+
* @param opt 属性值
|
|
468
|
+
* @returns view
|
|
469
|
+
*/
|
|
470
|
+
View.prototype.option = function (name, opt) {
|
|
471
|
+
// 对于内置的 option,避免覆盖。
|
|
472
|
+
// name 在原型上,说明可能是内置 API,存在 option 被覆盖的风险,不处理
|
|
473
|
+
if (View.prototype[name]) {
|
|
474
|
+
throw new Error("Can't use built in variable name \"".concat(name, "\", please change another one."));
|
|
475
|
+
}
|
|
476
|
+
// 存入到 option 中
|
|
477
|
+
set(this.options, name, opt);
|
|
478
|
+
return this;
|
|
479
|
+
};
|
|
480
|
+
/**
|
|
481
|
+
* 设置主题。
|
|
482
|
+
*
|
|
483
|
+
* ```ts
|
|
484
|
+
* view.theme('dark'); // 'dark' 需要事先通过 `registerTheme()` 接口注册完成
|
|
485
|
+
*
|
|
486
|
+
* view.theme({ defaultColor: 'red' });
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* @param theme 主题名或者主题配置
|
|
490
|
+
* @returns View
|
|
491
|
+
*/
|
|
492
|
+
View.prototype.theme = function (theme) {
|
|
493
|
+
this.themeObject = isObject(theme) ? deepMix({}, this.themeObject, createTheme(theme)) : getTheme(theme);
|
|
494
|
+
return this;
|
|
495
|
+
};
|
|
496
|
+
/* end 一系列传入配置的 API */
|
|
497
|
+
/**
|
|
498
|
+
* Call the interaction based on the interaction name
|
|
499
|
+
*
|
|
500
|
+
* ```ts
|
|
501
|
+
* view.interaction('my-interaction', { extra: 'hello world' });
|
|
502
|
+
* ```
|
|
503
|
+
* 详细文档可以参考:https://g2.antv.vision/zh/docs/api/general/interaction
|
|
504
|
+
* @param name interaction name
|
|
505
|
+
* @param cfg interaction config
|
|
506
|
+
* @returns
|
|
507
|
+
*/
|
|
508
|
+
View.prototype.interaction = function (name, cfg) {
|
|
509
|
+
var existInteraction = this.interactions[name];
|
|
510
|
+
// 存在则先销毁已有的
|
|
511
|
+
if (existInteraction) {
|
|
512
|
+
existInteraction.destroy();
|
|
513
|
+
}
|
|
514
|
+
// 新建交互实例
|
|
515
|
+
var interaction = createInteraction(name, this, cfg);
|
|
516
|
+
if (interaction) {
|
|
517
|
+
interaction.init();
|
|
518
|
+
this.interactions[name] = interaction;
|
|
519
|
+
}
|
|
520
|
+
return this;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* 移除当前 View 的 interaction
|
|
524
|
+
* ```ts
|
|
525
|
+
* view.removeInteraction('my-interaction');
|
|
526
|
+
* ```
|
|
527
|
+
* @param name interaction name
|
|
528
|
+
*/
|
|
529
|
+
View.prototype.removeInteraction = function (name) {
|
|
530
|
+
var existInteraction = this.interactions[name];
|
|
531
|
+
// 存在则先销毁已有的
|
|
532
|
+
if (existInteraction) {
|
|
533
|
+
existInteraction.destroy();
|
|
534
|
+
this.interactions[name] = undefined;
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
/**
|
|
538
|
+
* 修改数据,数据更新逻辑,数据更新仅仅影响当前这一层的 view
|
|
539
|
+
*
|
|
540
|
+
* ```ts
|
|
541
|
+
* view.changeData([{ city: '北京', sale: '200' }]);
|
|
542
|
+
* ```
|
|
543
|
+
*
|
|
544
|
+
* @param data
|
|
545
|
+
* @returns void
|
|
546
|
+
*/
|
|
547
|
+
View.prototype.changeData = function (data) {
|
|
548
|
+
this.isDataChanged = true;
|
|
549
|
+
this.emit(VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, Event.fromData(this, VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, null));
|
|
550
|
+
// 1. 保存数据
|
|
551
|
+
this.data(data);
|
|
552
|
+
// 2. 渲染
|
|
553
|
+
this.paint(true);
|
|
554
|
+
// 3. 遍历子 view 进行 change data
|
|
555
|
+
var views = this.views;
|
|
556
|
+
for (var i = 0, len = views.length; i < len; i++) {
|
|
557
|
+
var view = views[i];
|
|
558
|
+
// FIXME 子 view 有自己的数据的情况,该如何处理?
|
|
559
|
+
view.changeData(data);
|
|
560
|
+
}
|
|
561
|
+
this.emit(VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, Event.fromData(this, VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, null));
|
|
562
|
+
};
|
|
563
|
+
/* View 管理相关的 API */
|
|
564
|
+
/**
|
|
565
|
+
* 创建子 view
|
|
566
|
+
*
|
|
567
|
+
* ```ts
|
|
568
|
+
* const innerView = view.createView({
|
|
569
|
+
* start: { x: 0, y: 0 },
|
|
570
|
+
* end: { x: 0.5, y: 0.5 },
|
|
571
|
+
* padding: 8,
|
|
572
|
+
* });
|
|
573
|
+
* ```
|
|
574
|
+
*
|
|
575
|
+
* @param cfg
|
|
576
|
+
* @returns View
|
|
577
|
+
*/
|
|
578
|
+
View.prototype.createView = function (cfg) {
|
|
579
|
+
// 将会在 4.1 版本中移除递归嵌套 view,仅仅只允许 chart - view 两层。
|
|
580
|
+
// 这个 API 理论上用户量不多,所以暂时不发大版本,所以先暂时打一个 warning。
|
|
581
|
+
if (this.parent && this.parent.parent) {
|
|
582
|
+
// 存在 3 层 结构了
|
|
583
|
+
console.warn('The view nesting recursive feature will be removed at G2 V4.1. Please avoid to use it.');
|
|
584
|
+
}
|
|
585
|
+
// 子 view 共享 options 配置数据
|
|
586
|
+
var sharedOptions = {
|
|
587
|
+
data: this.options.data,
|
|
588
|
+
scales: clone(this.options.scales),
|
|
589
|
+
axes: clone(this.options.axes),
|
|
590
|
+
coordinate: clone(this.coordinateController.getOption()),
|
|
591
|
+
tooltip: clone(this.options.tooltip),
|
|
592
|
+
legends: clone(this.options.legends),
|
|
593
|
+
animate: this.options.animate,
|
|
594
|
+
visible: this.visible,
|
|
595
|
+
};
|
|
596
|
+
var v = new View(__assign(__assign({ parent: this, canvas: this.canvas,
|
|
597
|
+
// 子 view 共用三层 group
|
|
598
|
+
backgroundGroup: this.backgroundGroup.addGroup({ zIndex: GROUP_Z_INDEX.BG }), middleGroup: this.middleGroup.addGroup({ zIndex: GROUP_Z_INDEX.MID }), foregroundGroup: this.foregroundGroup.addGroup({ zIndex: GROUP_Z_INDEX.FORE }), theme: this.themeObject, padding: this.padding }, cfg), { options: __assign(__assign({}, sharedOptions), get(cfg, 'options', {})) }));
|
|
599
|
+
this.views.push(v);
|
|
600
|
+
return v;
|
|
601
|
+
};
|
|
602
|
+
/**
|
|
603
|
+
* @deprecated
|
|
604
|
+
* This method will be removed at G2 V4.1. Replaced by {@link #createView()}
|
|
605
|
+
*/
|
|
606
|
+
View.prototype.view = function (cfg) {
|
|
607
|
+
console.warn('This method will be removed at G2 V4.1. Please use chart.createView() instead.');
|
|
608
|
+
return this.createView(cfg);
|
|
609
|
+
};
|
|
610
|
+
/**
|
|
611
|
+
* 删除一个子 view
|
|
612
|
+
* @param view
|
|
613
|
+
* @return removedView
|
|
614
|
+
*/
|
|
615
|
+
View.prototype.removeView = function (view) {
|
|
616
|
+
var removedView = remove(this.views, function (v) { return v === view; })[0];
|
|
617
|
+
if (removedView) {
|
|
618
|
+
removedView.destroy();
|
|
619
|
+
}
|
|
620
|
+
return removedView;
|
|
621
|
+
};
|
|
622
|
+
/* end View 管理相关的 API */
|
|
623
|
+
// 一些 get 方法
|
|
624
|
+
/**
|
|
625
|
+
* 获取当前坐标系实例。
|
|
626
|
+
* @returns [[Coordinate]]
|
|
627
|
+
*/
|
|
628
|
+
View.prototype.getCoordinate = function () {
|
|
629
|
+
return this.coordinateInstance;
|
|
630
|
+
};
|
|
631
|
+
/**
|
|
632
|
+
* 获取当前 view 的主题配置。
|
|
633
|
+
* @returns themeObject
|
|
634
|
+
*/
|
|
635
|
+
View.prototype.getTheme = function () {
|
|
636
|
+
return this.themeObject;
|
|
637
|
+
};
|
|
638
|
+
/**
|
|
639
|
+
* 获得 x 轴字段的 scale 实例。
|
|
640
|
+
* @returns view 中 Geometry 对于的 x scale
|
|
641
|
+
*/
|
|
642
|
+
View.prototype.getXScale = function () {
|
|
643
|
+
// 拿第一个 Geometry 的 X scale
|
|
644
|
+
// 隐藏逻辑:一个 view 中的 Geometry 必须 x 字段一致
|
|
645
|
+
var g = this.geometries[0];
|
|
646
|
+
return g ? g.getXScale() : null;
|
|
647
|
+
};
|
|
648
|
+
/**
|
|
649
|
+
* 获取 y 轴字段的 scales 实例。
|
|
650
|
+
* @returns view 中 Geometry 对于的 y scale 数组
|
|
651
|
+
*/
|
|
652
|
+
View.prototype.getYScales = function () {
|
|
653
|
+
// 拿到所有的 Geometry 的 Y scale,然后去重
|
|
654
|
+
var tmpMap = {};
|
|
655
|
+
var yScales = [];
|
|
656
|
+
this.geometries.forEach(function (g) {
|
|
657
|
+
var yScale = g.getYScale();
|
|
658
|
+
var field = yScale.field;
|
|
659
|
+
if (!tmpMap[field]) {
|
|
660
|
+
tmpMap[field] = true;
|
|
661
|
+
yScales.push(yScale);
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
return yScales;
|
|
665
|
+
};
|
|
666
|
+
/**
|
|
667
|
+
* 获取 x 轴或者 y 轴对应的所有 scale 实例。
|
|
668
|
+
* @param dimType x | y
|
|
669
|
+
* @returns x 轴或者 y 轴对应的所有 scale 实例。
|
|
670
|
+
*/
|
|
671
|
+
View.prototype.getScalesByDim = function (dimType) {
|
|
672
|
+
var geometries = this.geometries;
|
|
673
|
+
var scales = {};
|
|
674
|
+
for (var i = 0, len = geometries.length; i < len; i++) {
|
|
675
|
+
var geometry = geometries[i];
|
|
676
|
+
var scale = dimType === 'x' ? geometry.getXScale() : geometry.getYScale();
|
|
677
|
+
if (scale && !scales[scale.field]) {
|
|
678
|
+
scales[scale.field] = scale;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return scales;
|
|
682
|
+
};
|
|
683
|
+
/**
|
|
684
|
+
* 根据字段名去获取 scale 实例。
|
|
685
|
+
* @param field 数据字段名称
|
|
686
|
+
* @param key id
|
|
687
|
+
*/
|
|
688
|
+
View.prototype.getScale = function (field, key) {
|
|
689
|
+
var defaultKey = key ? key : this.getScaleKey(field);
|
|
690
|
+
// 调用根节点 view 的方法获取
|
|
691
|
+
return this.getRootView().scalePool.getScale(defaultKey);
|
|
692
|
+
};
|
|
693
|
+
/**
|
|
694
|
+
* @deprecated
|
|
695
|
+
* This method will be removed at G2 V4.1. Please use `getScale`.
|
|
696
|
+
*/
|
|
697
|
+
View.prototype.getScaleByField = function (field, key) {
|
|
698
|
+
return this.getScale(field, key);
|
|
699
|
+
};
|
|
700
|
+
/**
|
|
701
|
+
* 返回所有配置信息。
|
|
702
|
+
* @returns 所有的 view API 配置。
|
|
703
|
+
*/
|
|
704
|
+
View.prototype.getOptions = function () {
|
|
705
|
+
return this.options;
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* 获取 view 的数据(过滤后的数据)。
|
|
709
|
+
* @returns 处理过滤器之后的数据。
|
|
710
|
+
*/
|
|
711
|
+
View.prototype.getData = function () {
|
|
712
|
+
return this.filteredData;
|
|
713
|
+
};
|
|
714
|
+
/**
|
|
715
|
+
* 获取原始数据
|
|
716
|
+
* @returns 传入 G2 的原始数据
|
|
717
|
+
*/
|
|
718
|
+
View.prototype.getOriginalData = function () {
|
|
719
|
+
return this.options.data;
|
|
720
|
+
};
|
|
721
|
+
/**
|
|
722
|
+
* 获取布局后的边距 padding
|
|
723
|
+
* @returns
|
|
724
|
+
*/
|
|
725
|
+
View.prototype.getPadding = function () {
|
|
726
|
+
return this.autoPadding.getPadding();
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* 获取当前 view 有的 geometries
|
|
730
|
+
* @returns
|
|
731
|
+
*/
|
|
732
|
+
View.prototype.getGeometries = function () {
|
|
733
|
+
return this.geometries;
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* 获取 view 中的所有 geome
|
|
737
|
+
*/
|
|
738
|
+
View.prototype.getElements = function () {
|
|
739
|
+
return reduce(this.geometries, function (elements, geometry) {
|
|
740
|
+
return elements.concat(geometry.getElements());
|
|
741
|
+
}, []);
|
|
742
|
+
};
|
|
743
|
+
/**
|
|
744
|
+
* 根据一定的规则查找 Geometry 的 Elements。
|
|
745
|
+
*
|
|
746
|
+
* ```typescript
|
|
747
|
+
* getElementsBy((element) => {
|
|
748
|
+
* const data = element.getData();
|
|
749
|
+
*
|
|
750
|
+
* return data.a === 'a';
|
|
751
|
+
* });
|
|
752
|
+
* ```
|
|
753
|
+
*
|
|
754
|
+
* @param condition 定义查找规则的回调函数。
|
|
755
|
+
* @returns
|
|
756
|
+
*/
|
|
757
|
+
View.prototype.getElementsBy = function (condition) {
|
|
758
|
+
return this.getElements().filter(function (el) { return condition(el); });
|
|
759
|
+
};
|
|
760
|
+
/**
|
|
761
|
+
* 获得绘制的层级 group。
|
|
762
|
+
* @param layer 层级名称。
|
|
763
|
+
* @returns 对应层级的 Group。
|
|
764
|
+
*/
|
|
765
|
+
View.prototype.getLayer = function (layer) {
|
|
766
|
+
return layer === LAYER.BG
|
|
767
|
+
? this.backgroundGroup
|
|
768
|
+
: layer === LAYER.MID
|
|
769
|
+
? this.middleGroup
|
|
770
|
+
: layer === LAYER.FORE
|
|
771
|
+
? this.foregroundGroup
|
|
772
|
+
: this.foregroundGroup;
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* 对外暴露方法,判断一个点是否在绘图区域(即坐标系范围)内部。
|
|
776
|
+
* @param point 坐标点
|
|
777
|
+
*/
|
|
778
|
+
View.prototype.isPointInPlot = function (point) {
|
|
779
|
+
return isPointInCoordinate(this.getCoordinate(), point);
|
|
780
|
+
};
|
|
781
|
+
/**
|
|
782
|
+
* 获得所有的 legend 对应的 attribute 实例。
|
|
783
|
+
* @returns 维度字段的 Attribute 数组
|
|
784
|
+
*/
|
|
785
|
+
View.prototype.getLegendAttributes = function () {
|
|
786
|
+
return flatten(this.geometries.map(function (g) { return g.getGroupAttributes(); }));
|
|
787
|
+
};
|
|
788
|
+
/**
|
|
789
|
+
* 获取所有的分组字段的 scale 实例。
|
|
790
|
+
* @returns 获得分组字段的 scale 实例数组。
|
|
791
|
+
*/
|
|
792
|
+
View.prototype.getGroupScales = function () {
|
|
793
|
+
// 拿到所有的 Geometry 的 分组字段 scale,然后打平去重
|
|
794
|
+
var scales = this.geometries.map(function (g) { return g.getGroupScales(); });
|
|
795
|
+
return uniq(flatten(scales));
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* 获取 G.Canvas 实例。
|
|
799
|
+
* @returns G.Canvas 画布实例。
|
|
800
|
+
*/
|
|
801
|
+
View.prototype.getCanvas = function () {
|
|
802
|
+
return this.getRootView().canvas;
|
|
803
|
+
};
|
|
804
|
+
/**
|
|
805
|
+
* 获得根节点 view。
|
|
806
|
+
*/
|
|
807
|
+
View.prototype.getRootView = function () {
|
|
808
|
+
var v = this;
|
|
809
|
+
while (true) {
|
|
810
|
+
if (v.parent) {
|
|
811
|
+
v = v.parent;
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
return v;
|
|
817
|
+
};
|
|
818
|
+
/**
|
|
819
|
+
* 获取该数据在可视化后,对应的画布坐标点。
|
|
820
|
+
* @param data 原始数据记录
|
|
821
|
+
* @returns 对应的画布坐标点
|
|
822
|
+
*/
|
|
823
|
+
View.prototype.getXY = function (data) {
|
|
824
|
+
var coordinate = this.getCoordinate();
|
|
825
|
+
var xScales = this.getScalesByDim('x');
|
|
826
|
+
var yScales = this.getScalesByDim('y');
|
|
827
|
+
var x;
|
|
828
|
+
var y;
|
|
829
|
+
each(data, function (value, key) {
|
|
830
|
+
if (xScales[key]) {
|
|
831
|
+
x = xScales[key].scale(value);
|
|
832
|
+
}
|
|
833
|
+
if (yScales[key]) {
|
|
834
|
+
y = yScales[key].scale(value);
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
if (!isNil(x) && !isNil(y)) {
|
|
838
|
+
return coordinate.convert({ x: x, y: y });
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
/**
|
|
842
|
+
* 获取 name 对应的 controller 实例
|
|
843
|
+
* @param name
|
|
844
|
+
*/
|
|
845
|
+
View.prototype.getController = function (name) {
|
|
846
|
+
return find(this.controllers, function (c) { return c.name === name; });
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* 显示 point 坐标点对应的 tooltip。
|
|
850
|
+
* @param point 画布坐标点
|
|
851
|
+
* @returns View
|
|
852
|
+
*/
|
|
853
|
+
View.prototype.showTooltip = function (point) {
|
|
854
|
+
var tooltip = this.getController('tooltip');
|
|
855
|
+
if (tooltip) {
|
|
856
|
+
tooltip.showTooltip(point);
|
|
857
|
+
}
|
|
858
|
+
return this;
|
|
859
|
+
};
|
|
860
|
+
/**
|
|
861
|
+
* 隐藏 tooltip。
|
|
862
|
+
* @returns View
|
|
863
|
+
*/
|
|
864
|
+
View.prototype.hideTooltip = function () {
|
|
865
|
+
var tooltip = this.getController('tooltip');
|
|
866
|
+
if (tooltip) {
|
|
867
|
+
tooltip.hideTooltip();
|
|
868
|
+
}
|
|
869
|
+
return this;
|
|
870
|
+
};
|
|
871
|
+
/**
|
|
872
|
+
* 将 tooltip 锁定到当前位置不能移动。
|
|
873
|
+
* @returns View
|
|
874
|
+
*/
|
|
875
|
+
View.prototype.lockTooltip = function () {
|
|
876
|
+
var tooltip = this.getController('tooltip');
|
|
877
|
+
if (tooltip) {
|
|
878
|
+
tooltip.lockTooltip();
|
|
879
|
+
}
|
|
880
|
+
return this;
|
|
881
|
+
};
|
|
882
|
+
/**
|
|
883
|
+
* 将 tooltip 锁定解除。
|
|
884
|
+
* @returns View
|
|
885
|
+
*/
|
|
886
|
+
View.prototype.unlockTooltip = function () {
|
|
887
|
+
var tooltip = this.getController('tooltip');
|
|
888
|
+
if (tooltip) {
|
|
889
|
+
tooltip.unlockTooltip();
|
|
890
|
+
}
|
|
891
|
+
return this;
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* 是否锁定 tooltip。
|
|
895
|
+
* @returns 是否锁定
|
|
896
|
+
*/
|
|
897
|
+
View.prototype.isTooltipLocked = function () {
|
|
898
|
+
var tooltip = this.getController('tooltip');
|
|
899
|
+
return tooltip && tooltip.isTooltipLocked();
|
|
900
|
+
};
|
|
901
|
+
/**
|
|
902
|
+
* 获取当前 point 对应的 tooltip 数据项。
|
|
903
|
+
* @param point 坐标点
|
|
904
|
+
* @returns tooltip 数据项
|
|
905
|
+
*/
|
|
906
|
+
View.prototype.getTooltipItems = function (point) {
|
|
907
|
+
var tooltip = this.getController('tooltip');
|
|
908
|
+
return tooltip ? tooltip.getTooltipItems(point) : [];
|
|
909
|
+
};
|
|
910
|
+
/**
|
|
911
|
+
* 获取逼近的点的数据集合
|
|
912
|
+
* @param point 当前坐标点
|
|
913
|
+
* @returns 数据
|
|
914
|
+
*/
|
|
915
|
+
View.prototype.getSnapRecords = function (point) {
|
|
916
|
+
var geometries = this.geometries;
|
|
917
|
+
var rst = [];
|
|
918
|
+
for (var i = 0, len = geometries.length; i < len; i++) {
|
|
919
|
+
var geom = geometries[i];
|
|
920
|
+
var dataArray = geom.dataArray;
|
|
921
|
+
geom.sort(dataArray); // 先进行排序,便于 tooltip 查找
|
|
922
|
+
var record = void 0;
|
|
923
|
+
for (var j = 0, dataLen = dataArray.length; j < dataLen; j++) {
|
|
924
|
+
var data = dataArray[j];
|
|
925
|
+
record = findDataByPoint(point, data, geom);
|
|
926
|
+
if (record) {
|
|
927
|
+
rst.push(record);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
// 同样递归处理子 views
|
|
932
|
+
var views = this.views;
|
|
933
|
+
for (var i = 0, len = views.length; i < len; i++) {
|
|
934
|
+
var view = views[i];
|
|
935
|
+
var snapRecords = view.getSnapRecords(point);
|
|
936
|
+
rst = rst.concat(snapRecords);
|
|
937
|
+
}
|
|
938
|
+
return rst;
|
|
939
|
+
};
|
|
940
|
+
/**
|
|
941
|
+
* 获取所有的 pure component 组件,用于布局。
|
|
942
|
+
*/
|
|
943
|
+
View.prototype.getComponents = function () {
|
|
944
|
+
var components = [];
|
|
945
|
+
var controllers = this.controllers;
|
|
946
|
+
for (var i = 0, len = controllers.length; i < len; i++) {
|
|
947
|
+
var controller = controllers[i];
|
|
948
|
+
components = components.concat(controller.getComponents());
|
|
949
|
+
}
|
|
950
|
+
return components;
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* 将 data 数据进行过滤。
|
|
954
|
+
* @param data
|
|
955
|
+
* @returns 过滤之后的数据
|
|
956
|
+
*/
|
|
957
|
+
View.prototype.filterData = function (data) {
|
|
958
|
+
var filters = this.options.filters;
|
|
959
|
+
// 不存在 filters,则不需要进行数据过滤
|
|
960
|
+
if (size(filters) === 0) {
|
|
961
|
+
return data;
|
|
962
|
+
}
|
|
963
|
+
// 存在过滤器,则逐个执行过滤,过滤器之间是 与 的关系
|
|
964
|
+
return filter(data, function (datum, idx) {
|
|
965
|
+
// 所有的 filter 字段
|
|
966
|
+
var fields = Object.keys(filters);
|
|
967
|
+
// 所有的条件都通过,才算通过
|
|
968
|
+
return fields.every(function (field) {
|
|
969
|
+
var condition = filters[field];
|
|
970
|
+
// condition 返回 true,则保留
|
|
971
|
+
return condition(datum[field], datum, idx);
|
|
972
|
+
});
|
|
973
|
+
});
|
|
974
|
+
};
|
|
975
|
+
/**
|
|
976
|
+
* 对某一个字段进行过滤
|
|
977
|
+
* @param field
|
|
978
|
+
* @param data
|
|
979
|
+
*/
|
|
980
|
+
View.prototype.filterFieldData = function (field, data) {
|
|
981
|
+
var filters = this.options.filters;
|
|
982
|
+
var condition = get(filters, field);
|
|
983
|
+
if (isUndefined(condition)) {
|
|
984
|
+
return data;
|
|
985
|
+
}
|
|
986
|
+
return data.filter(function (datum, idx) { return condition(datum[field], datum, idx); });
|
|
987
|
+
};
|
|
988
|
+
/**
|
|
989
|
+
* 调整 coordinate 的坐标范围。
|
|
990
|
+
*/
|
|
991
|
+
View.prototype.adjustCoordinate = function () {
|
|
992
|
+
var _a = this.getCoordinate(), curStart = _a.start, curEnd = _a.end;
|
|
993
|
+
var start = this.coordinateBBox.bl;
|
|
994
|
+
var end = this.coordinateBBox.tr;
|
|
995
|
+
// 在 defaultLayoutFn 中只会在 coordinateBBox 发生变化的时候会调用 adjustCoordinate(),所以不用担心被置位
|
|
996
|
+
if (isEqual(curStart, start) && isEqual(curEnd, end)) {
|
|
997
|
+
this.isCoordinateChanged = false;
|
|
998
|
+
// 如果大小没有变化则不更新
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
this.isCoordinateChanged = true;
|
|
1002
|
+
this.coordinateInstance = this.coordinateController.adjust(start, end);
|
|
1003
|
+
};
|
|
1004
|
+
View.prototype.paint = function (isUpdate) {
|
|
1005
|
+
this.renderDataRecursive(isUpdate);
|
|
1006
|
+
// 处理 sync scale 的逻辑
|
|
1007
|
+
this.syncScale();
|
|
1008
|
+
this.emit(VIEW_LIFE_CIRCLE.BEFORE_PAINT);
|
|
1009
|
+
// 初始化图形、组件位置,计算 padding
|
|
1010
|
+
this.renderPaddingRecursive(isUpdate);
|
|
1011
|
+
// 布局图形、组件
|
|
1012
|
+
this.renderLayoutRecursive(isUpdate);
|
|
1013
|
+
// 背景色 shape
|
|
1014
|
+
this.renderBackgroundStyleShape();
|
|
1015
|
+
// 最终的绘制 render
|
|
1016
|
+
this.renderPaintRecursive(isUpdate);
|
|
1017
|
+
this.emit(VIEW_LIFE_CIRCLE.AFTER_PAINT);
|
|
1018
|
+
this.isDataChanged = false; // 渲染完毕复位
|
|
1019
|
+
};
|
|
1020
|
+
/**
|
|
1021
|
+
* 渲染背景样式的 shape。
|
|
1022
|
+
* 放到 view 中创建的原因是让使用 view 绘制图形的时候,也能够处理背景色
|
|
1023
|
+
*/
|
|
1024
|
+
View.prototype.renderBackgroundStyleShape = function () {
|
|
1025
|
+
// 只有根节点才处理
|
|
1026
|
+
if (this.parent) {
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
var background = get(this.themeObject, 'background');
|
|
1030
|
+
// 配置了背景色
|
|
1031
|
+
if (background) {
|
|
1032
|
+
// 1. 不存在则创建
|
|
1033
|
+
if (!this.backgroundStyleRectShape) {
|
|
1034
|
+
this.backgroundStyleRectShape = this.backgroundGroup.addShape('rect', {
|
|
1035
|
+
attrs: {},
|
|
1036
|
+
zIndex: -1,
|
|
1037
|
+
// 背景色 shape 不设置事件捕获
|
|
1038
|
+
capture: false,
|
|
1039
|
+
});
|
|
1040
|
+
this.backgroundStyleRectShape.toBack();
|
|
1041
|
+
}
|
|
1042
|
+
// 2. 有了 shape 之后设置背景,位置(更新的时候)
|
|
1043
|
+
var _a = this.viewBBox, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
1044
|
+
this.backgroundStyleRectShape.attr({
|
|
1045
|
+
fill: background,
|
|
1046
|
+
x: x,
|
|
1047
|
+
y: y,
|
|
1048
|
+
width: width,
|
|
1049
|
+
height: height,
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
else {
|
|
1053
|
+
// 没有配置背景色
|
|
1054
|
+
if (this.backgroundStyleRectShape) {
|
|
1055
|
+
this.backgroundStyleRectShape.remove(true);
|
|
1056
|
+
this.backgroundStyleRectShape = undefined;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
/**
|
|
1061
|
+
* 递归计算每个 view 的 padding 值,coordinateBBox 和 coordinateInstance
|
|
1062
|
+
* @param isUpdate
|
|
1063
|
+
*/
|
|
1064
|
+
View.prototype.renderPaddingRecursive = function (isUpdate) {
|
|
1065
|
+
// 1. 子 view 大小相对 coordinateBBox,changeSize 的时候需要重新计算
|
|
1066
|
+
this.calculateViewBBox();
|
|
1067
|
+
// 2. 更新 coordinate
|
|
1068
|
+
this.adjustCoordinate();
|
|
1069
|
+
// 3. 初始化组件 component
|
|
1070
|
+
this.initComponents(isUpdate);
|
|
1071
|
+
// 4. 布局计算每隔 view 的 padding 值
|
|
1072
|
+
// 4.1. 自动加 auto padding -> absolute padding,并且增加 appendPadding
|
|
1073
|
+
this.autoPadding = calculatePadding(this).shrink(parsePadding(this.appendPadding));
|
|
1074
|
+
// 4.2. 计算出新的 coordinateBBox,更新 Coordinate
|
|
1075
|
+
// 这里必须保留,原因是后面子 view 的 viewBBox 或根据 parent 的 coordinateBBox
|
|
1076
|
+
this.coordinateBBox = this.viewBBox.shrink(this.autoPadding.getPadding());
|
|
1077
|
+
this.adjustCoordinate();
|
|
1078
|
+
// 同样递归处理子 views
|
|
1079
|
+
var views = this.views;
|
|
1080
|
+
for (var i = 0, len = views.length; i < len; i++) {
|
|
1081
|
+
var view = views[i];
|
|
1082
|
+
view.renderPaddingRecursive(isUpdate);
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
/**
|
|
1086
|
+
* 递归处理 view 的布局,最终是计算各个 view 的 coordinateBBox 和 coordinateInstance
|
|
1087
|
+
* @param isUpdate
|
|
1088
|
+
*/
|
|
1089
|
+
View.prototype.renderLayoutRecursive = function (isUpdate) {
|
|
1090
|
+
// 1. 同步子 view padding
|
|
1091
|
+
// 根据配置获取 padding
|
|
1092
|
+
var syncViewPaddingFn = this.syncViewPadding === true
|
|
1093
|
+
? defaultSyncViewPadding
|
|
1094
|
+
: isFunction(this.syncViewPadding)
|
|
1095
|
+
? this.syncViewPadding
|
|
1096
|
+
: undefined;
|
|
1097
|
+
if (syncViewPaddingFn) {
|
|
1098
|
+
syncViewPaddingFn(this, this.views, PaddingCal);
|
|
1099
|
+
// 同步 padding 之后,更新 coordinate
|
|
1100
|
+
this.views.forEach(function (v) {
|
|
1101
|
+
v.coordinateBBox = v.viewBBox.shrink(v.autoPadding.getPadding());
|
|
1102
|
+
v.adjustCoordinate();
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
// 3. 将 view 中的组件按照 view padding 移动到对应的位置
|
|
1106
|
+
this.doLayout();
|
|
1107
|
+
// 同样递归处理子 views
|
|
1108
|
+
var views = this.views;
|
|
1109
|
+
for (var i = 0, len = views.length; i < len; i++) {
|
|
1110
|
+
var view = views[i];
|
|
1111
|
+
view.renderLayoutRecursive(isUpdate);
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
/**
|
|
1115
|
+
* 最终递归绘制组件和图形
|
|
1116
|
+
* @param isUpdate
|
|
1117
|
+
*/
|
|
1118
|
+
View.prototype.renderPaintRecursive = function (isUpdate) {
|
|
1119
|
+
var middleGroup = this.middleGroup;
|
|
1120
|
+
if (this.limitInPlot) {
|
|
1121
|
+
var _a = getCoordinateClipCfg(this.coordinateInstance), type = _a.type, attrs = _a.attrs;
|
|
1122
|
+
middleGroup.setClip({
|
|
1123
|
+
type: type,
|
|
1124
|
+
attrs: attrs,
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
else {
|
|
1128
|
+
// 清除已有的 clip
|
|
1129
|
+
middleGroup.setClip(undefined);
|
|
1130
|
+
}
|
|
1131
|
+
// 1. 渲染几何标记
|
|
1132
|
+
this.paintGeometries(isUpdate);
|
|
1133
|
+
// 2. 绘制组件
|
|
1134
|
+
this.renderComponents(isUpdate);
|
|
1135
|
+
// 同样递归处理子 views
|
|
1136
|
+
var views = this.views;
|
|
1137
|
+
for (var i = 0, len = views.length; i < len; i++) {
|
|
1138
|
+
var view = views[i];
|
|
1139
|
+
view.renderPaintRecursive(isUpdate);
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
// end Get 方法
|
|
1143
|
+
/**
|
|
1144
|
+
* 创建 scale,递归到顶层 view 去创建和缓存 scale
|
|
1145
|
+
* @param field
|
|
1146
|
+
* @param data
|
|
1147
|
+
* @param scaleDef
|
|
1148
|
+
* @param key
|
|
1149
|
+
*/
|
|
1150
|
+
View.prototype.createScale = function (field, data, scaleDef, key) {
|
|
1151
|
+
// 1. 合并 field 对应的 scaleDef,合并原则是底层覆盖顶层(就近原则)
|
|
1152
|
+
var currentScaleDef = get(this.options.scales, [field]);
|
|
1153
|
+
var mergedScaleDef = __assign(__assign({}, currentScaleDef), scaleDef);
|
|
1154
|
+
// 2. 是否存在父 view,在则递归,否则创建
|
|
1155
|
+
if (this.parent) {
|
|
1156
|
+
return this.parent.createScale(field, data, mergedScaleDef, key);
|
|
1157
|
+
}
|
|
1158
|
+
// 3. 在根节点 view 通过 scalePool 创建
|
|
1159
|
+
return this.scalePool.createScale(field, data, mergedScaleDef, key);
|
|
1160
|
+
};
|
|
1161
|
+
/**
|
|
1162
|
+
* 递归渲染中的数据处理
|
|
1163
|
+
* @param isUpdate
|
|
1164
|
+
*/
|
|
1165
|
+
View.prototype.renderDataRecursive = function (isUpdate) {
|
|
1166
|
+
// 1. 处理数据
|
|
1167
|
+
this.doFilterData();
|
|
1168
|
+
// 2. 创建实例
|
|
1169
|
+
this.createCoordinate();
|
|
1170
|
+
// 3. 初始化 Geometry
|
|
1171
|
+
this.initGeometries(isUpdate);
|
|
1172
|
+
// 4. 处理分面逻辑,最终都是生成子 view 和 geometry
|
|
1173
|
+
this.renderFacet(isUpdate);
|
|
1174
|
+
// 同样递归处理子 views
|
|
1175
|
+
var views = this.views;
|
|
1176
|
+
for (var i = 0, len = views.length; i < len; i++) {
|
|
1177
|
+
var view = views[i];
|
|
1178
|
+
view.renderDataRecursive(isUpdate);
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
/**
|
|
1182
|
+
* 计算 region,计算实际的像素范围坐标
|
|
1183
|
+
* @private
|
|
1184
|
+
*/
|
|
1185
|
+
View.prototype.calculateViewBBox = function () {
|
|
1186
|
+
var x;
|
|
1187
|
+
var y;
|
|
1188
|
+
var width;
|
|
1189
|
+
var height;
|
|
1190
|
+
if (this.parent) {
|
|
1191
|
+
var bbox = this.parent.coordinateBBox;
|
|
1192
|
+
// 存在 parent, 那么就是通过父容器大小计算
|
|
1193
|
+
x = bbox.x;
|
|
1194
|
+
y = bbox.y;
|
|
1195
|
+
width = bbox.width;
|
|
1196
|
+
height = bbox.height;
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
// 顶层容器,从 canvas 中取值 宽高
|
|
1200
|
+
x = 0;
|
|
1201
|
+
y = 0;
|
|
1202
|
+
width = this.canvas.get('width');
|
|
1203
|
+
height = this.canvas.get('height');
|
|
1204
|
+
}
|
|
1205
|
+
var _a = this.region, start = _a.start, end = _a.end;
|
|
1206
|
+
// 根据 region 计算当前 view 的 bbox 大小。
|
|
1207
|
+
var viewBBox = new BBox(x + width * start.x, y + height * start.y, width * (end.x - start.x), height * (end.y - start.y));
|
|
1208
|
+
if (!this.viewBBox || !this.viewBBox.isEqual(viewBBox)) {
|
|
1209
|
+
// viewBBox 发生变化的时候进行更新
|
|
1210
|
+
this.viewBBox = new BBox(x + width * start.x, y + height * start.y, width * (end.x - start.x), height * (end.y - start.y));
|
|
1211
|
+
}
|
|
1212
|
+
// 初始的 coordinate bbox 大小
|
|
1213
|
+
this.coordinateBBox = this.viewBBox;
|
|
1214
|
+
};
|
|
1215
|
+
/**
|
|
1216
|
+
* 初始化事件机制:G 4.0 底层内置支持 name:event 的机制,那么只要所有组件都有自己的 name 即可。
|
|
1217
|
+
*
|
|
1218
|
+
* G2 的事件只是获取事件委托,然后在 view 嵌套结构中,形成事件冒泡机制。
|
|
1219
|
+
* 当前 view 只委托自己 view 中的 Component 和 Geometry 事件,并向上冒泡
|
|
1220
|
+
* @private
|
|
1221
|
+
*/
|
|
1222
|
+
View.prototype.initEvents = function () {
|
|
1223
|
+
// 三层 group 中的 shape 事件都会通过 G 冒泡上来的
|
|
1224
|
+
this.foregroundGroup.on('*', this.onDelegateEvents);
|
|
1225
|
+
this.middleGroup.on('*', this.onDelegateEvents);
|
|
1226
|
+
this.backgroundGroup.on('*', this.onDelegateEvents);
|
|
1227
|
+
this.canvas.on('*', this.onCanvasEvent);
|
|
1228
|
+
};
|
|
1229
|
+
/**
|
|
1230
|
+
* 初始化插件
|
|
1231
|
+
*/
|
|
1232
|
+
View.prototype.initComponentController = function () {
|
|
1233
|
+
var usedControllers = this.usedControllers;
|
|
1234
|
+
for (var i = 0, len = usedControllers.length; i < len; i++) {
|
|
1235
|
+
var controllerName = usedControllers[i];
|
|
1236
|
+
var Ctor = getComponentController(controllerName);
|
|
1237
|
+
if (Ctor) {
|
|
1238
|
+
this.controllers.push(new Ctor(this));
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1242
|
+
View.prototype.createViewEvent = function (evt) {
|
|
1243
|
+
var shape = evt.shape, name = evt.name;
|
|
1244
|
+
var data = shape ? shape.get('origin') : null;
|
|
1245
|
+
// 事件在 view 嵌套中冒泡(暂不提供阻止冒泡的机制)
|
|
1246
|
+
var e = new Event(this, evt, data);
|
|
1247
|
+
e.type = name;
|
|
1248
|
+
return e;
|
|
1249
|
+
};
|
|
1250
|
+
/**
|
|
1251
|
+
* 处理 PLOT_EVENTS
|
|
1252
|
+
* plot event 需要处理所有的基础事件,并判断是否在画布中,然后再决定是否要 emit。
|
|
1253
|
+
* 对于 mouseenter、mouseleave 比较特殊,需要做一下数学比较。
|
|
1254
|
+
* @param e
|
|
1255
|
+
*/
|
|
1256
|
+
View.prototype.doPlotEvent = function (e) {
|
|
1257
|
+
var type = e.type, x = e.x, y = e.y;
|
|
1258
|
+
var point = { x: x, y: y };
|
|
1259
|
+
var ALL_EVENTS = [
|
|
1260
|
+
'mousedown',
|
|
1261
|
+
'mouseup',
|
|
1262
|
+
'mousemove',
|
|
1263
|
+
'mouseleave',
|
|
1264
|
+
'mousewheel',
|
|
1265
|
+
'touchstart',
|
|
1266
|
+
'touchmove',
|
|
1267
|
+
'touchend',
|
|
1268
|
+
'touchcancel',
|
|
1269
|
+
'click',
|
|
1270
|
+
'dblclick',
|
|
1271
|
+
'contextmenu',
|
|
1272
|
+
];
|
|
1273
|
+
if (ALL_EVENTS.includes(type)) {
|
|
1274
|
+
var currentInPlot = this.isPointInPlot(point);
|
|
1275
|
+
var newEvent = e.clone();
|
|
1276
|
+
if (currentInPlot) {
|
|
1277
|
+
var TYPE = "plot:".concat(type); // 组合 plot 事件
|
|
1278
|
+
newEvent.type = TYPE;
|
|
1279
|
+
this.emit(TYPE, newEvent);
|
|
1280
|
+
if (type === 'mouseleave' || type === 'touchend') {
|
|
1281
|
+
// 在plot 内部却离开画布
|
|
1282
|
+
this.isPreMouseInPlot = false;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
// 对于 mouseenter, mouseleave 的计算处理
|
|
1286
|
+
if (type === 'mousemove' || type === 'touchmove') {
|
|
1287
|
+
if (this.isPreMouseInPlot && !currentInPlot) {
|
|
1288
|
+
if (type === 'mousemove') {
|
|
1289
|
+
newEvent.type = PLOT_EVENTS.MOUSE_LEAVE;
|
|
1290
|
+
this.emit(PLOT_EVENTS.MOUSE_LEAVE, newEvent);
|
|
1291
|
+
}
|
|
1292
|
+
newEvent.type = PLOT_EVENTS.LEAVE;
|
|
1293
|
+
this.emit(PLOT_EVENTS.LEAVE, newEvent);
|
|
1294
|
+
}
|
|
1295
|
+
else if (!this.isPreMouseInPlot && currentInPlot) {
|
|
1296
|
+
if (type === 'mousemove') {
|
|
1297
|
+
newEvent.type = PLOT_EVENTS.MOUSE_ENTER;
|
|
1298
|
+
this.emit(PLOT_EVENTS.MOUSE_ENTER, newEvent);
|
|
1299
|
+
}
|
|
1300
|
+
newEvent.type = PLOT_EVENTS.ENTER;
|
|
1301
|
+
this.emit(PLOT_EVENTS.ENTER, newEvent);
|
|
1302
|
+
}
|
|
1303
|
+
// 赋新的状态值
|
|
1304
|
+
this.isPreMouseInPlot = currentInPlot;
|
|
1305
|
+
}
|
|
1306
|
+
else if (type === 'mouseleave' || type === 'touchend') {
|
|
1307
|
+
// 可能不在 currentInPlot 中
|
|
1308
|
+
if (this.isPreMouseInPlot) {
|
|
1309
|
+
if (type === 'mouseleave') {
|
|
1310
|
+
newEvent.type = PLOT_EVENTS.MOUSE_LEAVE;
|
|
1311
|
+
this.emit(PLOT_EVENTS.MOUSE_LEAVE, newEvent);
|
|
1312
|
+
}
|
|
1313
|
+
newEvent.type = PLOT_EVENTS.LEAVE;
|
|
1314
|
+
this.emit(PLOT_EVENTS.LEAVE, newEvent);
|
|
1315
|
+
this.isPreMouseInPlot = false;
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1320
|
+
// view 生命周期 —— 渲染流程
|
|
1321
|
+
/**
|
|
1322
|
+
* 处理筛选器,筛选数据
|
|
1323
|
+
* @private
|
|
1324
|
+
*/
|
|
1325
|
+
View.prototype.doFilterData = function () {
|
|
1326
|
+
var data = this.options.data;
|
|
1327
|
+
this.filteredData = this.filterData(data);
|
|
1328
|
+
};
|
|
1329
|
+
/**
|
|
1330
|
+
* 初始化 Geometries
|
|
1331
|
+
* @private
|
|
1332
|
+
*/
|
|
1333
|
+
View.prototype.initGeometries = function (isUpdate) {
|
|
1334
|
+
// 初始化图形的之前,先创建 / 更新 scales
|
|
1335
|
+
this.createOrUpdateScales();
|
|
1336
|
+
// 实例化 Geometry,然后 view 将所有的 scale 管理起来
|
|
1337
|
+
var coordinate = this.getCoordinate();
|
|
1338
|
+
var scaleDefs = get(this.options, 'scales', {});
|
|
1339
|
+
var geometries = this.geometries;
|
|
1340
|
+
for (var i = 0, len = geometries.length; i < len; i++) {
|
|
1341
|
+
var geometry = geometries[i];
|
|
1342
|
+
// 保持 scales 引用不要变化
|
|
1343
|
+
geometry.scales = this.getGeometryScales();
|
|
1344
|
+
var cfg = {
|
|
1345
|
+
coordinate: coordinate,
|
|
1346
|
+
scaleDefs: scaleDefs,
|
|
1347
|
+
data: this.filteredData,
|
|
1348
|
+
theme: this.themeObject,
|
|
1349
|
+
isDataChanged: this.isDataChanged,
|
|
1350
|
+
isCoordinateChanged: this.isCoordinateChanged,
|
|
1351
|
+
};
|
|
1352
|
+
if (isUpdate) {
|
|
1353
|
+
// 数据发生更新
|
|
1354
|
+
geometry.update(cfg);
|
|
1355
|
+
}
|
|
1356
|
+
else {
|
|
1357
|
+
geometry.init(cfg);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
// Geometry 初始化之后,生成了 scale,然后进行调整 scale 配置
|
|
1361
|
+
this.adjustScales();
|
|
1362
|
+
};
|
|
1363
|
+
/**
|
|
1364
|
+
* 根据 Geometry 的所有字段创建 scales
|
|
1365
|
+
* 如果存在,则更新,不存在则创建
|
|
1366
|
+
*/
|
|
1367
|
+
View.prototype.createOrUpdateScales = function () {
|
|
1368
|
+
var fields = this.getScaleFields();
|
|
1369
|
+
var groupedFields = this.getGroupedFields();
|
|
1370
|
+
var _a = this.getOptions(), data = _a.data, _b = _a.scales, scales = _b === void 0 ? {} : _b;
|
|
1371
|
+
var filteredData = this.filteredData;
|
|
1372
|
+
for (var i = 0, len = fields.length; i < len; i++) {
|
|
1373
|
+
var field = fields[i];
|
|
1374
|
+
var scaleDef = scales[field];
|
|
1375
|
+
// 调用方法,递归去创建
|
|
1376
|
+
var key = this.getScaleKey(field);
|
|
1377
|
+
this.createScale(field,
|
|
1378
|
+
// 分组字段的 scale 使用未过滤的数据创建
|
|
1379
|
+
groupedFields.includes(field) ? data : filteredData, scaleDef, key);
|
|
1380
|
+
// 缓存从当前 view 创建的 scale key
|
|
1381
|
+
this.createdScaleKeys.set(key, true);
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
/**
|
|
1385
|
+
* 处理 scale 同步逻辑
|
|
1386
|
+
*/
|
|
1387
|
+
View.prototype.syncScale = function () {
|
|
1388
|
+
// 最终调用 root view 的
|
|
1389
|
+
this.getRootView().scalePool.sync(this.getCoordinate(), this.theme);
|
|
1390
|
+
};
|
|
1391
|
+
/**
|
|
1392
|
+
* 获得 Geometry 中的 scale 对象
|
|
1393
|
+
*/
|
|
1394
|
+
View.prototype.getGeometryScales = function () {
|
|
1395
|
+
var fields = this.getScaleFields();
|
|
1396
|
+
var scales = {};
|
|
1397
|
+
for (var i = 0; i < fields.length; i++) {
|
|
1398
|
+
var field = fields[i];
|
|
1399
|
+
scales[field] = this.getScaleByField(field);
|
|
1400
|
+
}
|
|
1401
|
+
return scales;
|
|
1402
|
+
};
|
|
1403
|
+
View.prototype.getScaleFields = function () {
|
|
1404
|
+
var fields = [];
|
|
1405
|
+
var tmpMap = new Map();
|
|
1406
|
+
var geometries = this.geometries;
|
|
1407
|
+
for (var i = 0; i < geometries.length; i++) {
|
|
1408
|
+
var geometry = geometries[i];
|
|
1409
|
+
var geometryScales = geometry.getScaleFields();
|
|
1410
|
+
uniq(geometryScales, fields, tmpMap);
|
|
1411
|
+
}
|
|
1412
|
+
return fields;
|
|
1413
|
+
};
|
|
1414
|
+
View.prototype.getGroupedFields = function () {
|
|
1415
|
+
var fields = [];
|
|
1416
|
+
var tmpMap = new Map();
|
|
1417
|
+
var geometries = this.geometries;
|
|
1418
|
+
for (var i = 0; i < geometries.length; i++) {
|
|
1419
|
+
var geometry = geometries[i];
|
|
1420
|
+
var groupFields = geometry.getGroupFields();
|
|
1421
|
+
uniq(groupFields, fields, tmpMap);
|
|
1422
|
+
}
|
|
1423
|
+
return fields;
|
|
1424
|
+
};
|
|
1425
|
+
/**
|
|
1426
|
+
* 调整 scale 配置
|
|
1427
|
+
* @private
|
|
1428
|
+
*/
|
|
1429
|
+
View.prototype.adjustScales = function () {
|
|
1430
|
+
// 调整目前包括:
|
|
1431
|
+
// 分类 scale,调整 range 范围
|
|
1432
|
+
this.adjustCategoryScaleRange();
|
|
1433
|
+
};
|
|
1434
|
+
/**
|
|
1435
|
+
* 调整分类 scale 的 range,防止超出坐标系外面
|
|
1436
|
+
* @private
|
|
1437
|
+
*/
|
|
1438
|
+
View.prototype.adjustCategoryScaleRange = function () {
|
|
1439
|
+
var _this = this;
|
|
1440
|
+
var xyScales = __spreadArray([this.getXScale()], this.getYScales(), true).filter(function (e) { return !!e; });
|
|
1441
|
+
var coordinate = this.getCoordinate();
|
|
1442
|
+
var scaleOptions = this.options.scales;
|
|
1443
|
+
each(xyScales, function (scale) {
|
|
1444
|
+
var field = scale.field, values = scale.values, isCategory = scale.isCategory, isIdentity = scale.isIdentity;
|
|
1445
|
+
// 分类或者 identity 的 scale 才进行处理
|
|
1446
|
+
if (isCategory || isIdentity) {
|
|
1447
|
+
// 存在 value 值,且用户没有配置 range 配置
|
|
1448
|
+
if (values && !get(scaleOptions, [field, 'range'])) {
|
|
1449
|
+
// 更新 range
|
|
1450
|
+
scale.range = getDefaultCategoryScaleRange(scale, coordinate, _this.theme);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
};
|
|
1455
|
+
/**
|
|
1456
|
+
* 根据 options 配置、Geometry 字段配置,自动生成 components
|
|
1457
|
+
* @param isUpdate 是否是更新
|
|
1458
|
+
* @private
|
|
1459
|
+
*/
|
|
1460
|
+
View.prototype.initComponents = function (isUpdate) {
|
|
1461
|
+
// 先全部清空,然后 render
|
|
1462
|
+
var controllers = this.controllers;
|
|
1463
|
+
for (var i = 0; i < controllers.length; i++) {
|
|
1464
|
+
var controller = controllers[i];
|
|
1465
|
+
// 更新则走更新逻辑;否则清空载重绘
|
|
1466
|
+
if (isUpdate) {
|
|
1467
|
+
controller.update();
|
|
1468
|
+
}
|
|
1469
|
+
else {
|
|
1470
|
+
controller.clear();
|
|
1471
|
+
controller.render();
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
View.prototype.doLayout = function () {
|
|
1476
|
+
this.layoutFunc(this);
|
|
1477
|
+
};
|
|
1478
|
+
/**
|
|
1479
|
+
* 创建坐标系
|
|
1480
|
+
* @private
|
|
1481
|
+
*/
|
|
1482
|
+
View.prototype.createCoordinate = function () {
|
|
1483
|
+
var start = this.coordinateBBox.bl;
|
|
1484
|
+
var end = this.coordinateBBox.tr;
|
|
1485
|
+
this.coordinateInstance = this.coordinateController.create(start, end);
|
|
1486
|
+
};
|
|
1487
|
+
/**
|
|
1488
|
+
* 根据 options 配置自动渲染 geometry
|
|
1489
|
+
* @private
|
|
1490
|
+
*/
|
|
1491
|
+
View.prototype.paintGeometries = function (isUpdate) {
|
|
1492
|
+
var doAnimation = this.options.animate;
|
|
1493
|
+
// geometry 的 paint 阶段
|
|
1494
|
+
var coordinate = this.getCoordinate();
|
|
1495
|
+
var canvasRegion = {
|
|
1496
|
+
x: this.viewBBox.x,
|
|
1497
|
+
y: this.viewBBox.y,
|
|
1498
|
+
minX: this.viewBBox.minX,
|
|
1499
|
+
minY: this.viewBBox.minY,
|
|
1500
|
+
maxX: this.viewBBox.maxX,
|
|
1501
|
+
maxY: this.viewBBox.maxY,
|
|
1502
|
+
width: this.viewBBox.width,
|
|
1503
|
+
height: this.viewBBox.height,
|
|
1504
|
+
};
|
|
1505
|
+
var geometries = this.geometries;
|
|
1506
|
+
for (var i = 0; i < geometries.length; i++) {
|
|
1507
|
+
var geometry = geometries[i];
|
|
1508
|
+
geometry.coordinate = coordinate;
|
|
1509
|
+
geometry.canvasRegion = canvasRegion;
|
|
1510
|
+
if (!doAnimation) {
|
|
1511
|
+
// 如果 view 不执行动画,那么 view 下所有的 geometry 都不执行动画
|
|
1512
|
+
geometry.animate(false);
|
|
1513
|
+
}
|
|
1514
|
+
geometry.paint(isUpdate);
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
/**
|
|
1518
|
+
* 最后的绘制组件
|
|
1519
|
+
* @param isUpdate
|
|
1520
|
+
*/
|
|
1521
|
+
View.prototype.renderComponents = function (isUpdate) {
|
|
1522
|
+
// 先全部清空,然后 render
|
|
1523
|
+
for (var i = 0; i < this.getComponents().length; i++) {
|
|
1524
|
+
var co = this.getComponents()[i];
|
|
1525
|
+
co.component.render();
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
/**
|
|
1529
|
+
* 渲染分面,会在其中进行数据分面,然后进行子 view 创建
|
|
1530
|
+
* @param isUpdate
|
|
1531
|
+
*/
|
|
1532
|
+
View.prototype.renderFacet = function (isUpdate) {
|
|
1533
|
+
if (this.facetInstance) {
|
|
1534
|
+
if (isUpdate) {
|
|
1535
|
+
this.facetInstance.update();
|
|
1536
|
+
}
|
|
1537
|
+
else {
|
|
1538
|
+
this.facetInstance.clear();
|
|
1539
|
+
// 计算分面数据
|
|
1540
|
+
this.facetInstance.init();
|
|
1541
|
+
// 渲染组件和 views
|
|
1542
|
+
this.facetInstance.render();
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
View.prototype.initOptions = function () {
|
|
1547
|
+
var _this = this;
|
|
1548
|
+
var _a = this.options, _b = _a.geometries, geometries = _b === void 0 ? [] : _b, _c = _a.interactions, interactions = _c === void 0 ? [] : _c, _d = _a.views, views = _d === void 0 ? [] : _d, _e = _a.annotations, annotations = _e === void 0 ? [] : _e, coordinate = _a.coordinate, events = _a.events, facets = _a.facets;
|
|
1549
|
+
// 设置坐标系
|
|
1550
|
+
if (this.coordinateController) {
|
|
1551
|
+
// 更新 coordinate controller
|
|
1552
|
+
coordinate && this.coordinateController.update(coordinate);
|
|
1553
|
+
}
|
|
1554
|
+
else {
|
|
1555
|
+
// 创建 coordinate controller
|
|
1556
|
+
this.coordinateController = new CoordinateController(coordinate);
|
|
1557
|
+
}
|
|
1558
|
+
// 创建 geometry 实例
|
|
1559
|
+
for (var i = 0; i < geometries.length; i++) {
|
|
1560
|
+
var geometryOption = geometries[i];
|
|
1561
|
+
this.createGeometry(geometryOption);
|
|
1562
|
+
}
|
|
1563
|
+
// 创建 interactions 实例
|
|
1564
|
+
for (var j = 0; j < interactions.length; j++) {
|
|
1565
|
+
var interactionOption = interactions[j];
|
|
1566
|
+
var type = interactionOption.type, cfg = interactionOption.cfg;
|
|
1567
|
+
this.interaction(type, cfg);
|
|
1568
|
+
}
|
|
1569
|
+
// 创建 view 实例
|
|
1570
|
+
for (var k = 0; k < views.length; k++) {
|
|
1571
|
+
var viewOption = views[k];
|
|
1572
|
+
this.createView(viewOption);
|
|
1573
|
+
}
|
|
1574
|
+
// 设置 annotation
|
|
1575
|
+
var annotationComponent = this.getController('annotation');
|
|
1576
|
+
for (var l = 0; l < annotations.length; l++) {
|
|
1577
|
+
var annotationOption = annotations[l];
|
|
1578
|
+
annotationComponent.annotation(annotationOption);
|
|
1579
|
+
}
|
|
1580
|
+
// 设置 events
|
|
1581
|
+
if (events) {
|
|
1582
|
+
each(events, function (eventCallback, eventName) {
|
|
1583
|
+
_this.on(eventName, eventCallback);
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
if (facets) {
|
|
1587
|
+
each(facets, function (facet) {
|
|
1588
|
+
var type = facet.type, rest = __rest(facet, ["type"]);
|
|
1589
|
+
_this.facet(type, rest);
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
};
|
|
1593
|
+
View.prototype.createGeometry = function (geometryOption) {
|
|
1594
|
+
var type = geometryOption.type, _a = geometryOption.cfg, cfg = _a === void 0 ? {} : _a;
|
|
1595
|
+
if (this[type]) {
|
|
1596
|
+
var geometry_1 = this[type](cfg);
|
|
1597
|
+
each(geometryOption, function (v, k) {
|
|
1598
|
+
if (isFunction(geometry_1[k])) {
|
|
1599
|
+
geometry_1[k](v);
|
|
1600
|
+
}
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
/**
|
|
1605
|
+
* scale key 的创建方式
|
|
1606
|
+
* @param field
|
|
1607
|
+
*/
|
|
1608
|
+
View.prototype.getScaleKey = function (field) {
|
|
1609
|
+
return "".concat(this.id, "-").concat(field);
|
|
1610
|
+
};
|
|
1611
|
+
return View;
|
|
1612
|
+
}(Base));
|
|
1613
|
+
export { View };
|
|
1614
|
+
/**
|
|
1615
|
+
* 注册 geometry 组件
|
|
1616
|
+
* @param name
|
|
1617
|
+
* @param Ctor
|
|
1618
|
+
* @returns Geometry
|
|
1619
|
+
*/
|
|
1620
|
+
export function registerGeometry(name, Ctor) {
|
|
1621
|
+
// 语法糖,在 view API 上增加原型方法
|
|
1622
|
+
View.prototype[name.toLowerCase()] = function (cfg) {
|
|
1623
|
+
if (cfg === void 0) { cfg = {}; }
|
|
1624
|
+
var props = __assign({
|
|
1625
|
+
/** 图形容器 */
|
|
1626
|
+
container: this.middleGroup.addGroup(), labelsContainer: this.foregroundGroup.addGroup() }, cfg);
|
|
1627
|
+
var geometry = new Ctor(props);
|
|
1628
|
+
this.geometries.push(geometry);
|
|
1629
|
+
return geometry;
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
export default View;
|
|
1633
|
+
//# sourceMappingURL=view.js.map
|