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