@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/esm/geometry/base.js
DELETED
|
@@ -1,1481 +0,0 @@
|
|
|
1
|
-
import { __assign, __extends } from "tslib";
|
|
2
|
-
import { getAdjust as getAdjustClass } from '@antv/adjust';
|
|
3
|
-
import { getAttribute as getAttributeClass } from '@antv/attr';
|
|
4
|
-
import { clone, deepMix, each, flatten, get, isArray, isEmpty, isEqual, isFunction, isNil, isNumber, isObject, isPlainObject, isString, set, } from '@antv/util';
|
|
5
|
-
import { doGroupAppearAnimate, getDefaultAnimateCfg } from '../animate';
|
|
6
|
-
import Base from '../base';
|
|
7
|
-
import { FIELD_ORIGIN, GROUP_ATTRS } from '../constant';
|
|
8
|
-
import { uniq } from '../util/helper';
|
|
9
|
-
import Element from './element';
|
|
10
|
-
import { getGeometryLabel } from './label';
|
|
11
|
-
import { getShapeFactory } from './shape/base';
|
|
12
|
-
import { group } from './util/group-data';
|
|
13
|
-
import { isModelChange } from './util/is-model-change';
|
|
14
|
-
import { parseFields } from './util/parse-fields';
|
|
15
|
-
import { diff } from './util/diff';
|
|
16
|
-
import { getXDimensionLength } from '../util/coordinate';
|
|
17
|
-
// 根据 elementId 查找对应的 label,因为有可能一个 element 对应多个 labels,所以在给 labels 打标识时做了处理
|
|
18
|
-
// 打标规则详见 ./label/base.ts#L263
|
|
19
|
-
function filterLabelsById(id, labelsMap) {
|
|
20
|
-
var labels = [];
|
|
21
|
-
each(labelsMap, function (label, labelId) {
|
|
22
|
-
var elementId = labelId.split(' ')[0];
|
|
23
|
-
if (elementId === id) {
|
|
24
|
-
labels.push(label);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return labels;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Geometry 几何标记基类,主要负责数据到图形属性的映射以及绘制逻辑。
|
|
31
|
-
*/
|
|
32
|
-
var Geometry = /** @class */ (function (_super) {
|
|
33
|
-
__extends(Geometry, _super);
|
|
34
|
-
/**
|
|
35
|
-
* 创建 Geometry 实例。
|
|
36
|
-
* @param cfg
|
|
37
|
-
*/
|
|
38
|
-
function Geometry(cfg) {
|
|
39
|
-
var _this = _super.call(this, cfg) || this;
|
|
40
|
-
/** Geometry 几何标记类型。 */
|
|
41
|
-
_this.type = 'base';
|
|
42
|
-
// 内部产生的属性
|
|
43
|
-
/** Attribute map */
|
|
44
|
-
_this.attributes = {};
|
|
45
|
-
/** Element map */
|
|
46
|
-
_this.elements = [];
|
|
47
|
-
/** 使用 key-value 结构存储 Element,key 为每个 Element 实例对应的唯一 ID */
|
|
48
|
-
_this.elementsMap = {};
|
|
49
|
-
/** animate 配置项 */
|
|
50
|
-
_this.animateOption = true;
|
|
51
|
-
/** 图形属性映射配置 */
|
|
52
|
-
_this.attributeOption = {};
|
|
53
|
-
/** 存储上一次渲染时的 element 映射表,用于更新逻辑 */
|
|
54
|
-
_this.lastElementsMap = {};
|
|
55
|
-
/** 是否生成多个点来绘制图形。 */
|
|
56
|
-
_this.generatePoints = false;
|
|
57
|
-
/** 存储发生图形属性映射前的数据 */
|
|
58
|
-
_this.beforeMappingData = null;
|
|
59
|
-
_this.adjusts = {};
|
|
60
|
-
_this.idFields = [];
|
|
61
|
-
_this.hasSorted = false;
|
|
62
|
-
_this.isCoordinateChanged = false;
|
|
63
|
-
var container = cfg.container, labelsContainer = cfg.labelsContainer, coordinate = cfg.coordinate, data = cfg.data, _a = cfg.sortable, sortable = _a === void 0 ? false : _a, _b = cfg.visible, visible = _b === void 0 ? true : _b, theme = cfg.theme, _c = cfg.scales, scales = _c === void 0 ? {} : _c, _d = cfg.scaleDefs, scaleDefs = _d === void 0 ? {} : _d,
|
|
64
|
-
// 柱状图间隔与宽度相关配置
|
|
65
|
-
intervalPadding = cfg.intervalPadding, dodgePadding = cfg.dodgePadding, maxColumnWidth = cfg.maxColumnWidth, minColumnWidth = cfg.minColumnWidth, columnWidthRatio = cfg.columnWidthRatio, roseWidthRatio = cfg.roseWidthRatio, multiplePieWidthRatio = cfg.multiplePieWidthRatio, zIndexReversed = cfg.zIndexReversed, sortZIndex = cfg.sortZIndex;
|
|
66
|
-
_this.container = container;
|
|
67
|
-
_this.labelsContainer = labelsContainer;
|
|
68
|
-
_this.coordinate = coordinate;
|
|
69
|
-
_this.data = data;
|
|
70
|
-
_this.sortable = sortable;
|
|
71
|
-
_this.visible = visible;
|
|
72
|
-
_this.userTheme = theme;
|
|
73
|
-
_this.scales = scales;
|
|
74
|
-
_this.scaleDefs = scaleDefs;
|
|
75
|
-
// 柱状图间隔与宽度相关配置
|
|
76
|
-
_this.intervalPadding = intervalPadding;
|
|
77
|
-
_this.dodgePadding = dodgePadding;
|
|
78
|
-
_this.maxColumnWidth = maxColumnWidth;
|
|
79
|
-
_this.minColumnWidth = minColumnWidth;
|
|
80
|
-
_this.columnWidthRatio = columnWidthRatio;
|
|
81
|
-
_this.roseWidthRatio = roseWidthRatio;
|
|
82
|
-
_this.multiplePieWidthRatio = multiplePieWidthRatio;
|
|
83
|
-
_this.zIndexReversed = zIndexReversed;
|
|
84
|
-
_this.sortZIndex = sortZIndex;
|
|
85
|
-
return _this;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* 配置 position 通道映射规则。
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```typescript
|
|
92
|
-
* // 数据结构: [{ x: 'A', y: 10, color: 'red' }]
|
|
93
|
-
* geometry.position('x*y');
|
|
94
|
-
* geometry.position([ 'x', 'y' ]);
|
|
95
|
-
* geometry.position({
|
|
96
|
-
* fields: [ 'x', 'y' ],
|
|
97
|
-
* });
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* @param cfg 映射规则
|
|
101
|
-
* @returns
|
|
102
|
-
*/
|
|
103
|
-
Geometry.prototype.position = function (cfg) {
|
|
104
|
-
var positionCfg = cfg;
|
|
105
|
-
if (!isPlainObject(cfg)) {
|
|
106
|
-
// 字符串字段或者数组字段
|
|
107
|
-
positionCfg = {
|
|
108
|
-
fields: parseFields(cfg),
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
var fields = get(positionCfg, 'fields');
|
|
112
|
-
if (fields.length === 1) {
|
|
113
|
-
// 默认填充一维 1*xx
|
|
114
|
-
fields.unshift('1');
|
|
115
|
-
set(positionCfg, 'fields', fields);
|
|
116
|
-
}
|
|
117
|
-
set(this.attributeOption, 'position', positionCfg);
|
|
118
|
-
return this;
|
|
119
|
-
};
|
|
120
|
-
Geometry.prototype.color = function (field, cfg) {
|
|
121
|
-
this.createAttrOption('color', field, cfg);
|
|
122
|
-
return this;
|
|
123
|
-
};
|
|
124
|
-
Geometry.prototype.shape = function (field, cfg) {
|
|
125
|
-
this.createAttrOption('shape', field, cfg);
|
|
126
|
-
return this;
|
|
127
|
-
};
|
|
128
|
-
Geometry.prototype.size = function (field, cfg) {
|
|
129
|
-
this.createAttrOption('size', field, cfg);
|
|
130
|
-
return this;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* 设置数据调整方式。G2 目前内置了四种类型:
|
|
134
|
-
* 1. dodge
|
|
135
|
-
* 2. stack
|
|
136
|
-
* 3. symmetric
|
|
137
|
-
* 4. jitter
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* **Tip**
|
|
141
|
-
* + 对于 'dodge' 类型,可以额外进行如下属性的配置:
|
|
142
|
-
* ```typescript
|
|
143
|
-
* geometry.adjust('dodge', {
|
|
144
|
-
* marginRatio: 0, // 取 0 到 1 范围的值(相对于每个柱子宽度),用于控制一个分组中柱子之间的间距
|
|
145
|
-
* dodgeBy: 'x', // 该属性只对 'dodge' 类型生效,声明以哪个数据字段为分组依据
|
|
146
|
-
* });
|
|
147
|
-
* ```
|
|
148
|
-
*
|
|
149
|
-
* + 对于 'stack' 类型,可以额外进行如下属性的配置:
|
|
150
|
-
* ```typescript
|
|
151
|
-
* geometry.adjust('stack', {
|
|
152
|
-
* reverseOrder: false, // 用于控制是否对数据进行反序操作
|
|
153
|
-
* });
|
|
154
|
-
* ```
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* ```typescript
|
|
158
|
-
* geometry.adjust('stack');
|
|
159
|
-
*
|
|
160
|
-
* geometry.adjust({
|
|
161
|
-
* type: 'stack',
|
|
162
|
-
* reverseOrder: false,
|
|
163
|
-
* });
|
|
164
|
-
*
|
|
165
|
-
* // 组合使用 adjust
|
|
166
|
-
* geometry.adjust([ 'stack', 'dodge' ]);
|
|
167
|
-
*
|
|
168
|
-
* geometry.adjust([
|
|
169
|
-
* { type: 'stack' },
|
|
170
|
-
* { type: 'dodge', dodgeBy: 'x' },
|
|
171
|
-
* ]);
|
|
172
|
-
* ```
|
|
173
|
-
*
|
|
174
|
-
* @param adjustCfg 数据调整配置
|
|
175
|
-
* @returns
|
|
176
|
-
*/
|
|
177
|
-
Geometry.prototype.adjust = function (adjustCfg) {
|
|
178
|
-
var adjusts = adjustCfg;
|
|
179
|
-
if (isString(adjustCfg) || isPlainObject(adjustCfg)) {
|
|
180
|
-
adjusts = [adjustCfg];
|
|
181
|
-
}
|
|
182
|
-
each(adjusts, function (adjust, index) {
|
|
183
|
-
if (!isObject(adjust)) {
|
|
184
|
-
adjusts[index] = { type: adjust };
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
this.adjustOption = adjusts;
|
|
188
|
-
return this;
|
|
189
|
-
};
|
|
190
|
-
Geometry.prototype.style = function (field, styleFunc) {
|
|
191
|
-
if (isString(field)) {
|
|
192
|
-
var fields = parseFields(field);
|
|
193
|
-
this.styleOption = {
|
|
194
|
-
fields: fields,
|
|
195
|
-
callback: styleFunc,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
var _a = field, fields = _a.fields, callback = _a.callback, cfg = _a.cfg;
|
|
200
|
-
if (fields || callback || cfg) {
|
|
201
|
-
this.styleOption = field;
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
this.styleOption = {
|
|
205
|
-
cfg: field,
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return this;
|
|
210
|
-
};
|
|
211
|
-
Geometry.prototype.tooltip = function (field, cfg) {
|
|
212
|
-
if (isString(field)) {
|
|
213
|
-
var fields = parseFields(field);
|
|
214
|
-
this.tooltipOption = {
|
|
215
|
-
fields: fields,
|
|
216
|
-
callback: cfg,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
this.tooltipOption = field;
|
|
221
|
-
}
|
|
222
|
-
return this;
|
|
223
|
-
};
|
|
224
|
-
/**
|
|
225
|
-
* Geometry 动画配置。
|
|
226
|
-
*
|
|
227
|
-
* + `animate(false)` 关闭动画
|
|
228
|
-
* + `animate(true)` 开启动画,默认开启。
|
|
229
|
-
*
|
|
230
|
-
* 我们将动画分为四个场景:
|
|
231
|
-
* 1. appear: 图表第一次加载时的入场动画;
|
|
232
|
-
* 2. enter: 图表绘制完成,发生更新后,产生的新图形的进场动画;
|
|
233
|
-
* 3. update: 图表绘制完成,数据发生变更后,有状态变更的图形的更新动画;
|
|
234
|
-
* 4. leave: 图表绘制完成,数据发生变更后,被销毁图形的销毁动画。
|
|
235
|
-
*
|
|
236
|
-
* @example
|
|
237
|
-
* ```typescript
|
|
238
|
-
* animate({
|
|
239
|
-
* enter: {
|
|
240
|
-
* duration: 1000, // enter 动画执行时间
|
|
241
|
-
* },
|
|
242
|
-
* leave: false, // 关闭 leave 销毁动画
|
|
243
|
-
* });
|
|
244
|
-
* ```
|
|
245
|
-
*
|
|
246
|
-
* @param cfg 动画配置
|
|
247
|
-
* @returns
|
|
248
|
-
*/
|
|
249
|
-
Geometry.prototype.animate = function (cfg) {
|
|
250
|
-
this.animateOption = cfg;
|
|
251
|
-
return this;
|
|
252
|
-
};
|
|
253
|
-
Geometry.prototype.label = function (field, secondParam, thirdParam) {
|
|
254
|
-
if (isString(field)) {
|
|
255
|
-
var labelOption = {};
|
|
256
|
-
var fields = parseFields(field);
|
|
257
|
-
labelOption.fields = fields;
|
|
258
|
-
if (isFunction(secondParam)) {
|
|
259
|
-
labelOption.callback = secondParam;
|
|
260
|
-
}
|
|
261
|
-
else if (isPlainObject(secondParam)) {
|
|
262
|
-
labelOption.cfg = secondParam;
|
|
263
|
-
}
|
|
264
|
-
if (thirdParam) {
|
|
265
|
-
labelOption.cfg = thirdParam;
|
|
266
|
-
}
|
|
267
|
-
this.labelOption = labelOption;
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
this.labelOption = field;
|
|
271
|
-
}
|
|
272
|
-
return this;
|
|
273
|
-
};
|
|
274
|
-
/**
|
|
275
|
-
* 设置状态对应的样式。
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
* ```ts
|
|
279
|
-
* chart.interval().state({
|
|
280
|
-
* selected: {
|
|
281
|
-
* animate: { duration: 100, easing: 'easeLinear' },
|
|
282
|
-
* style: {
|
|
283
|
-
* lineWidth: 2,
|
|
284
|
-
* stroke: '#000',
|
|
285
|
-
* },
|
|
286
|
-
* },
|
|
287
|
-
* });
|
|
288
|
-
* ```
|
|
289
|
-
*
|
|
290
|
-
* 如果图形 shape 是由多个 shape 组成,即为一个 G.Group 对象,那么针对 group 中的每个 shape,我们需要使用下列方式进行状态样式设置:
|
|
291
|
-
* 如果我们为 group 中的每个 shape 设置了 'name' 属性(shape.set('name', 'xx')),则以 'name' 作为 key,否则默认以索引值(即 shape 的 添加顺序)为 key。
|
|
292
|
-
*
|
|
293
|
-
* ```ts
|
|
294
|
-
* chart.interval().shape('groupShape').state({
|
|
295
|
-
* selected: {
|
|
296
|
-
* style: {
|
|
297
|
-
* 0: { lineWidth: 2 },
|
|
298
|
-
* 1: { fillOpacity: 1 },
|
|
299
|
-
* }
|
|
300
|
-
* }
|
|
301
|
-
* });
|
|
302
|
-
* ```
|
|
303
|
-
*
|
|
304
|
-
* @param cfg 状态样式
|
|
305
|
-
*/
|
|
306
|
-
Geometry.prototype.state = function (cfg) {
|
|
307
|
-
this.stateOption = cfg;
|
|
308
|
-
return this;
|
|
309
|
-
};
|
|
310
|
-
/**
|
|
311
|
-
* 用于向 shape 中传入自定义的数据。目前可能仅仅可能用于在自定义 shape 的时候,像自定义 shape 中传入自定义的数据,方便实现自定义 shape 的配置能力。
|
|
312
|
-
*
|
|
313
|
-
* @example
|
|
314
|
-
* ```ts
|
|
315
|
-
* chart.interval().customInfo({ yourData: 'hello, g2!' });
|
|
316
|
-
* ```
|
|
317
|
-
*
|
|
318
|
-
* 然后在自定义 shape 的时候,可以拿到这个信息。
|
|
319
|
-
*
|
|
320
|
-
* ```ts
|
|
321
|
-
* registerShape('interval', 'your-shape', {
|
|
322
|
-
* draw(shapeInfo, container) {
|
|
323
|
-
* const { customInfo } = shapeInfo;
|
|
324
|
-
* console.log(customInfo); // will log { yourData: 'hello, g2!' }.
|
|
325
|
-
* }
|
|
326
|
-
* });
|
|
327
|
-
* ```
|
|
328
|
-
*
|
|
329
|
-
* @param cfg
|
|
330
|
-
*/
|
|
331
|
-
Geometry.prototype.customInfo = function (cfg) {
|
|
332
|
-
this.customOption = cfg;
|
|
333
|
-
return this;
|
|
334
|
-
};
|
|
335
|
-
/**
|
|
336
|
-
* 初始化 Geomtry 实例:
|
|
337
|
-
* 创建 [[Attribute]] and [[Scale]] 实例,进行数据处理,包括分组、数值化以及数据调整。
|
|
338
|
-
*/
|
|
339
|
-
Geometry.prototype.init = function (cfg) {
|
|
340
|
-
if (cfg === void 0) { cfg = {}; }
|
|
341
|
-
this.setCfg(cfg);
|
|
342
|
-
this.initAttributes(); // 创建图形属性
|
|
343
|
-
// 数据加工:分组 -> 数字化 -> adjust
|
|
344
|
-
this.processData(this.data);
|
|
345
|
-
// 调整 scale
|
|
346
|
-
this.adjustScale();
|
|
347
|
-
};
|
|
348
|
-
/**
|
|
349
|
-
* Geometry 更新。
|
|
350
|
-
* @param [cfg] 更新的配置
|
|
351
|
-
*/
|
|
352
|
-
Geometry.prototype.update = function (cfg) {
|
|
353
|
-
if (cfg === void 0) { cfg = {}; }
|
|
354
|
-
var data = cfg.data, isDataChanged = cfg.isDataChanged, isCoordinateChanged = cfg.isCoordinateChanged;
|
|
355
|
-
var _a = this, attributeOption = _a.attributeOption, lastAttributeOption = _a.lastAttributeOption;
|
|
356
|
-
if (!isEqual(attributeOption, lastAttributeOption)) {
|
|
357
|
-
// 映射发生改变,则重新创建图形属性
|
|
358
|
-
this.init(cfg);
|
|
359
|
-
}
|
|
360
|
-
else if (data && (isDataChanged || !isEqual(data, this.data))) {
|
|
361
|
-
// 数据发生变化
|
|
362
|
-
this.setCfg(cfg);
|
|
363
|
-
this.initAttributes(); // 创建图形属性
|
|
364
|
-
this.processData(data); // 数据加工:分组 -> 数字化 -> adjust
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
// 有可能 coordinate 变化
|
|
368
|
-
this.setCfg(cfg);
|
|
369
|
-
}
|
|
370
|
-
// 调整 scale
|
|
371
|
-
this.adjustScale();
|
|
372
|
-
this.isCoordinateChanged = isCoordinateChanged;
|
|
373
|
-
};
|
|
374
|
-
/**
|
|
375
|
-
* 将原始数据映射至图形空间,同时创建图形对象。
|
|
376
|
-
*/
|
|
377
|
-
Geometry.prototype.paint = function (isUpdate) {
|
|
378
|
-
if (isUpdate === void 0) { isUpdate = false; }
|
|
379
|
-
if (this.animateOption) {
|
|
380
|
-
this.animateOption = deepMix({}, getDefaultAnimateCfg(this.type, this.coordinate), this.animateOption);
|
|
381
|
-
}
|
|
382
|
-
this.defaultSize = undefined;
|
|
383
|
-
this.elementsMap = {};
|
|
384
|
-
this.elements = [];
|
|
385
|
-
var offscreenGroup = this.getOffscreenGroup();
|
|
386
|
-
offscreenGroup.clear();
|
|
387
|
-
var beforeMappingData = this.beforeMappingData;
|
|
388
|
-
var dataArray = this.beforeMapping(beforeMappingData);
|
|
389
|
-
this.dataArray = new Array(dataArray.length);
|
|
390
|
-
for (var i = 0; i < dataArray.length; i++) {
|
|
391
|
-
var data = dataArray[i];
|
|
392
|
-
this.dataArray[i] = this.mapping(data);
|
|
393
|
-
}
|
|
394
|
-
this.updateElements(this.dataArray, isUpdate);
|
|
395
|
-
this.lastElementsMap = this.elementsMap;
|
|
396
|
-
if (this.canDoGroupAnimation(isUpdate)) {
|
|
397
|
-
// 如果用户没有配置 appear.animation,就默认走整体动画
|
|
398
|
-
var container = this.container;
|
|
399
|
-
var type = this.type;
|
|
400
|
-
var coordinate = this.coordinate;
|
|
401
|
-
var animateCfg = get(this.animateOption, 'appear');
|
|
402
|
-
var yScale = this.getYScale();
|
|
403
|
-
var yMinPoint = coordinate.convert({
|
|
404
|
-
x: 0,
|
|
405
|
-
y: yScale.scale(this.getYMinValue()),
|
|
406
|
-
});
|
|
407
|
-
doGroupAppearAnimate(container, animateCfg, type, coordinate, yMinPoint);
|
|
408
|
-
}
|
|
409
|
-
// 添加 label
|
|
410
|
-
if (this.labelOption) {
|
|
411
|
-
this.renderLabels(flatten(this.dataArray), isUpdate);
|
|
412
|
-
}
|
|
413
|
-
// 缓存,用于更新
|
|
414
|
-
this.lastAttributeOption = __assign({}, this.attributeOption);
|
|
415
|
-
if (this.visible === false) {
|
|
416
|
-
// 用户在初始化的时候声明 visible: false
|
|
417
|
-
this.changeVisible(false);
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
/**
|
|
421
|
-
* 清空当前 Geometry,配置项仍保留,但是内部创建的对象全部清空。
|
|
422
|
-
* @override
|
|
423
|
-
*/
|
|
424
|
-
Geometry.prototype.clear = function () {
|
|
425
|
-
var _a = this, container = _a.container, geometryLabel = _a.geometryLabel, offscreenGroup = _a.offscreenGroup;
|
|
426
|
-
if (container) {
|
|
427
|
-
container.clear();
|
|
428
|
-
}
|
|
429
|
-
if (geometryLabel) {
|
|
430
|
-
geometryLabel.clear();
|
|
431
|
-
}
|
|
432
|
-
if (offscreenGroup) {
|
|
433
|
-
offscreenGroup.clear();
|
|
434
|
-
}
|
|
435
|
-
// 属性恢复至出厂状态
|
|
436
|
-
this.scaleDefs = undefined;
|
|
437
|
-
this.attributes = {};
|
|
438
|
-
this.scales = {};
|
|
439
|
-
this.elementsMap = {};
|
|
440
|
-
this.lastElementsMap = {};
|
|
441
|
-
this.elements = [];
|
|
442
|
-
this.adjusts = {};
|
|
443
|
-
this.dataArray = null;
|
|
444
|
-
this.beforeMappingData = null;
|
|
445
|
-
this.lastAttributeOption = undefined;
|
|
446
|
-
this.defaultSize = undefined;
|
|
447
|
-
this.idFields = [];
|
|
448
|
-
this.groupScales = undefined;
|
|
449
|
-
this.hasSorted = false;
|
|
450
|
-
this.isCoordinateChanged = false;
|
|
451
|
-
};
|
|
452
|
-
/**
|
|
453
|
-
* 销毁 Geometry 实例。
|
|
454
|
-
*/
|
|
455
|
-
Geometry.prototype.destroy = function () {
|
|
456
|
-
this.clear();
|
|
457
|
-
var container = this.container;
|
|
458
|
-
container.remove(true);
|
|
459
|
-
if (this.offscreenGroup) {
|
|
460
|
-
this.offscreenGroup.remove(true);
|
|
461
|
-
this.offscreenGroup = null;
|
|
462
|
-
}
|
|
463
|
-
if (this.geometryLabel) {
|
|
464
|
-
this.geometryLabel.destroy();
|
|
465
|
-
this.geometryLabel = null;
|
|
466
|
-
}
|
|
467
|
-
this.theme = undefined;
|
|
468
|
-
this.shapeFactory = undefined;
|
|
469
|
-
_super.prototype.destroy.call(this);
|
|
470
|
-
};
|
|
471
|
-
/**
|
|
472
|
-
* 获取决定分组的图形属性对应的 scale 实例。
|
|
473
|
-
* @returns
|
|
474
|
-
*/
|
|
475
|
-
Geometry.prototype.getGroupScales = function () {
|
|
476
|
-
return this.groupScales;
|
|
477
|
-
};
|
|
478
|
-
/**
|
|
479
|
-
* 根据名字获取图形属性实例。
|
|
480
|
-
*/
|
|
481
|
-
Geometry.prototype.getAttribute = function (name) {
|
|
482
|
-
return this.attributes[name];
|
|
483
|
-
};
|
|
484
|
-
/** 获取 x 轴对应的 scale 实例。 */
|
|
485
|
-
Geometry.prototype.getXScale = function () {
|
|
486
|
-
return this.getAttribute('position').scales[0];
|
|
487
|
-
};
|
|
488
|
-
/** 获取 y 轴对应的 scale 实例。 */
|
|
489
|
-
Geometry.prototype.getYScale = function () {
|
|
490
|
-
return this.getAttribute('position').scales[1];
|
|
491
|
-
};
|
|
492
|
-
/**
|
|
493
|
-
* 获取决定分组的图形属性实例。
|
|
494
|
-
*/
|
|
495
|
-
Geometry.prototype.getGroupAttributes = function () {
|
|
496
|
-
var rst = [];
|
|
497
|
-
each(this.attributes, function (attr) {
|
|
498
|
-
if (GROUP_ATTRS.includes(attr.type)) {
|
|
499
|
-
rst.push(attr);
|
|
500
|
-
}
|
|
501
|
-
});
|
|
502
|
-
return rst;
|
|
503
|
-
};
|
|
504
|
-
/** 获取图形属性默认的映射值。 */
|
|
505
|
-
Geometry.prototype.getDefaultValue = function (attrName) {
|
|
506
|
-
var value;
|
|
507
|
-
var attr = this.getAttribute(attrName);
|
|
508
|
-
if (attr && isEmpty(attr.scales)) {
|
|
509
|
-
// 获取映射至常量的值
|
|
510
|
-
value = attr.values[0];
|
|
511
|
-
}
|
|
512
|
-
return value;
|
|
513
|
-
};
|
|
514
|
-
/**
|
|
515
|
-
* 获取该数据发生图形映射后对应的 Attribute 图形空间数据。
|
|
516
|
-
* @param attr Attribute 图形属性实例。
|
|
517
|
-
* @param obj 需要进行映射的原始数据。
|
|
518
|
-
* @returns
|
|
519
|
-
*/
|
|
520
|
-
Geometry.prototype.getAttributeValues = function (attr, obj) {
|
|
521
|
-
var params = [];
|
|
522
|
-
var scales = attr.scales;
|
|
523
|
-
for (var index = 0, length_1 = scales.length; index < length_1; index++) {
|
|
524
|
-
var scale = scales[index];
|
|
525
|
-
var field = scale.field;
|
|
526
|
-
if (scale.isIdentity) {
|
|
527
|
-
params.push(scale.values);
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
params.push(obj[field]);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
return attr.mapping.apply(attr, params);
|
|
534
|
-
};
|
|
535
|
-
/**
|
|
536
|
-
* 获取对应的 adjust 实例
|
|
537
|
-
* @param adjustType
|
|
538
|
-
* @returns
|
|
539
|
-
*/
|
|
540
|
-
Geometry.prototype.getAdjust = function (adjustType) {
|
|
541
|
-
return this.adjusts[adjustType];
|
|
542
|
-
};
|
|
543
|
-
/**
|
|
544
|
-
* 获得 coordinate 实例
|
|
545
|
-
* @returns
|
|
546
|
-
*/
|
|
547
|
-
Geometry.prototype.getCoordinate = function () {
|
|
548
|
-
return this.coordinate;
|
|
549
|
-
};
|
|
550
|
-
Geometry.prototype.getData = function () {
|
|
551
|
-
return this.data;
|
|
552
|
-
};
|
|
553
|
-
/**
|
|
554
|
-
* 获取 shape 对应的 marker 样式。
|
|
555
|
-
* @param shapeName shape 具体名字
|
|
556
|
-
* @param cfg marker 信息
|
|
557
|
-
* @returns
|
|
558
|
-
*/
|
|
559
|
-
Geometry.prototype.getShapeMarker = function (shapeName, cfg) {
|
|
560
|
-
var shapeFactory = this.getShapeFactory();
|
|
561
|
-
return shapeFactory.getMarker(shapeName, cfg);
|
|
562
|
-
};
|
|
563
|
-
/**
|
|
564
|
-
* 根据一定的规则查找 Geometry 的 Elements。
|
|
565
|
-
*
|
|
566
|
-
* ```typescript
|
|
567
|
-
* getElementsBy((element) => {
|
|
568
|
-
* const data = element.getData();
|
|
569
|
-
*
|
|
570
|
-
* return data.a === 'a';
|
|
571
|
-
* });
|
|
572
|
-
* ```
|
|
573
|
-
*
|
|
574
|
-
* @param condition 定义查找规则的回调函数。
|
|
575
|
-
* @returns
|
|
576
|
-
*/
|
|
577
|
-
Geometry.prototype.getElementsBy = function (condition) {
|
|
578
|
-
return this.elements.filter(function (element) { return condition(element); });
|
|
579
|
-
};
|
|
580
|
-
/**
|
|
581
|
-
* 获取 Geometry 的所有 Elements。
|
|
582
|
-
*
|
|
583
|
-
* ```typescript
|
|
584
|
-
* getElements();
|
|
585
|
-
* ```
|
|
586
|
-
*/
|
|
587
|
-
Geometry.prototype.getElements = function () {
|
|
588
|
-
return this.elements;
|
|
589
|
-
};
|
|
590
|
-
/**
|
|
591
|
-
* 获取数据对应的唯一 id。
|
|
592
|
-
* @param data Element 对应的绘制数据
|
|
593
|
-
* @returns
|
|
594
|
-
*/
|
|
595
|
-
Geometry.prototype.getElementId = function (data) {
|
|
596
|
-
data = isArray(data) ? data[0] : data;
|
|
597
|
-
var originData = data[FIELD_ORIGIN];
|
|
598
|
-
// 如果用户声明了使用哪些字段作为 id 值
|
|
599
|
-
if (this.idFields.length) {
|
|
600
|
-
var elementId = originData[this.idFields[0]];
|
|
601
|
-
for (var index = 1; index < this.idFields.length; index++) {
|
|
602
|
-
elementId += '-' + originData[this.idFields[index]];
|
|
603
|
-
}
|
|
604
|
-
return elementId;
|
|
605
|
-
}
|
|
606
|
-
var type = this.type;
|
|
607
|
-
var xScale = this.getXScale();
|
|
608
|
-
var yScale = this.getYScale();
|
|
609
|
-
var xField = xScale.field || 'x';
|
|
610
|
-
var yField = yScale.field || 'y';
|
|
611
|
-
var yVal = originData[yField];
|
|
612
|
-
var xVal;
|
|
613
|
-
if (xScale.type === 'identity') {
|
|
614
|
-
xVal = xScale.values[0];
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
xVal = originData[xField];
|
|
618
|
-
}
|
|
619
|
-
var id;
|
|
620
|
-
if (type === 'interval' || type === 'schema') {
|
|
621
|
-
id = "".concat(xVal);
|
|
622
|
-
}
|
|
623
|
-
else if (type === 'line' || type === 'area' || type === 'path') {
|
|
624
|
-
id = type;
|
|
625
|
-
}
|
|
626
|
-
else {
|
|
627
|
-
id = "".concat(xVal, "-").concat(yVal);
|
|
628
|
-
}
|
|
629
|
-
var groupScales = this.groupScales;
|
|
630
|
-
if (isEmpty(groupScales)) {
|
|
631
|
-
groupScales = get(this.getAttribute('color'), 'scales', []);
|
|
632
|
-
}
|
|
633
|
-
for (var index = 0, length_2 = groupScales.length; index < length_2; index++) {
|
|
634
|
-
var groupScale = groupScales[index];
|
|
635
|
-
var field = groupScale.field;
|
|
636
|
-
id = "".concat(id, "-").concat(originData[field]);
|
|
637
|
-
}
|
|
638
|
-
// 用户在进行 dodge 类型的 adjust 调整的时候设置了 dodgeBy 属性
|
|
639
|
-
var dodgeAdjust = this.getAdjust('dodge');
|
|
640
|
-
if (dodgeAdjust) {
|
|
641
|
-
var dodgeBy = dodgeAdjust.dodgeBy;
|
|
642
|
-
if (dodgeBy) {
|
|
643
|
-
id = "".concat(id, "-").concat(originData[dodgeBy]);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
if (this.getAdjust('jitter')) {
|
|
647
|
-
id = "".concat(id, "-").concat(data.x, "-").concat(data.y);
|
|
648
|
-
}
|
|
649
|
-
return id;
|
|
650
|
-
};
|
|
651
|
-
/**
|
|
652
|
-
* 获取所有需要创建 scale 的字段名称。
|
|
653
|
-
*/
|
|
654
|
-
Geometry.prototype.getScaleFields = function () {
|
|
655
|
-
var fields = [];
|
|
656
|
-
var tmpMap = new Map();
|
|
657
|
-
var _a = this, attributeOption = _a.attributeOption, labelOption = _a.labelOption, tooltipOption = _a.tooltipOption;
|
|
658
|
-
// 获取图形属性上的 fields
|
|
659
|
-
for (var attributeType in attributeOption) {
|
|
660
|
-
if (attributeOption.hasOwnProperty(attributeType)) {
|
|
661
|
-
var eachOpt = attributeOption[attributeType];
|
|
662
|
-
if (eachOpt.fields) {
|
|
663
|
-
uniq(eachOpt.fields, fields, tmpMap);
|
|
664
|
-
}
|
|
665
|
-
else if (eachOpt.values) {
|
|
666
|
-
// 考虑 size(10), shape('circle') 等场景
|
|
667
|
-
uniq(eachOpt.values, fields, tmpMap);
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
// 获取 label 上的字段
|
|
672
|
-
if (labelOption && labelOption.fields) {
|
|
673
|
-
uniq(labelOption.fields, fields, tmpMap);
|
|
674
|
-
}
|
|
675
|
-
// 获取 tooltip 上的字段
|
|
676
|
-
if (isObject(tooltipOption) && tooltipOption.fields) {
|
|
677
|
-
uniq(tooltipOption.fields, fields, tmpMap);
|
|
678
|
-
}
|
|
679
|
-
return fields;
|
|
680
|
-
};
|
|
681
|
-
/**
|
|
682
|
-
* 显示或者隐藏 geometry。
|
|
683
|
-
* @param visible
|
|
684
|
-
*/
|
|
685
|
-
Geometry.prototype.changeVisible = function (visible) {
|
|
686
|
-
_super.prototype.changeVisible.call(this, visible);
|
|
687
|
-
var elements = this.elements;
|
|
688
|
-
for (var index = 0, length_3 = elements.length; index < length_3; index++) {
|
|
689
|
-
var element = elements[index];
|
|
690
|
-
element.changeVisible(visible);
|
|
691
|
-
}
|
|
692
|
-
if (visible) {
|
|
693
|
-
if (this.container) {
|
|
694
|
-
this.container.show();
|
|
695
|
-
}
|
|
696
|
-
if (this.labelsContainer) {
|
|
697
|
-
this.labelsContainer.show();
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
else {
|
|
701
|
-
if (this.container) {
|
|
702
|
-
this.container.hide();
|
|
703
|
-
}
|
|
704
|
-
if (this.labelsContainer) {
|
|
705
|
-
this.labelsContainer.hide();
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
/**
|
|
710
|
-
* 获得所有的字段
|
|
711
|
-
*/
|
|
712
|
-
Geometry.prototype.getFields = function () {
|
|
713
|
-
var uniqMap = new Map();
|
|
714
|
-
var fields = [];
|
|
715
|
-
Object.values(this.attributeOption).forEach(function (cfg) {
|
|
716
|
-
var fs = (cfg === null || cfg === void 0 ? void 0 : cfg.fields) || [];
|
|
717
|
-
fs.forEach(function (f) {
|
|
718
|
-
if (!uniqMap.has(f)) {
|
|
719
|
-
fields.push(f);
|
|
720
|
-
}
|
|
721
|
-
uniqMap.set(f, true);
|
|
722
|
-
});
|
|
723
|
-
}, []);
|
|
724
|
-
return fields;
|
|
725
|
-
};
|
|
726
|
-
/**
|
|
727
|
-
* 获取当前配置中的所有分组 & 分类的字段。
|
|
728
|
-
* @return fields string[]
|
|
729
|
-
*/
|
|
730
|
-
Geometry.prototype.getGroupFields = function () {
|
|
731
|
-
var groupFields = [];
|
|
732
|
-
var tmpMap = new Map(); // 用于去重过滤
|
|
733
|
-
for (var index = 0, length_4 = GROUP_ATTRS.length; index < length_4; index++) {
|
|
734
|
-
var attributeName = GROUP_ATTRS[index];
|
|
735
|
-
var cfg = this.attributeOption[attributeName];
|
|
736
|
-
if (cfg && cfg.fields) {
|
|
737
|
-
uniq(cfg.fields, groupFields, tmpMap);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
return groupFields;
|
|
741
|
-
};
|
|
742
|
-
/**
|
|
743
|
-
* 获得图形的 x y 字段。
|
|
744
|
-
*/
|
|
745
|
-
Geometry.prototype.getXYFields = function () {
|
|
746
|
-
var _a = this.attributeOption.position.fields, x = _a[0], y = _a[1];
|
|
747
|
-
return [x, y];
|
|
748
|
-
};
|
|
749
|
-
/**
|
|
750
|
-
* x 字段
|
|
751
|
-
* @returns
|
|
752
|
-
*/
|
|
753
|
-
Geometry.prototype.getXField = function () {
|
|
754
|
-
return get(this.getXYFields(), [0]);
|
|
755
|
-
};
|
|
756
|
-
/**
|
|
757
|
-
* y 字段
|
|
758
|
-
* @returns
|
|
759
|
-
*/
|
|
760
|
-
Geometry.prototype.getYField = function () {
|
|
761
|
-
return get(this.getXYFields(), [1]);
|
|
762
|
-
};
|
|
763
|
-
/**
|
|
764
|
-
* 获取该 Geometry 下所有生成的 shapes。
|
|
765
|
-
* @returns shapes
|
|
766
|
-
*/
|
|
767
|
-
Geometry.prototype.getShapes = function () {
|
|
768
|
-
return this.elements.map(function (element) { return element.shape; });
|
|
769
|
-
};
|
|
770
|
-
/**
|
|
771
|
-
* 获取虚拟 Group。
|
|
772
|
-
* @returns
|
|
773
|
-
*/
|
|
774
|
-
Geometry.prototype.getOffscreenGroup = function () {
|
|
775
|
-
if (!this.offscreenGroup) {
|
|
776
|
-
var GroupCtor = this.container.getGroupBase(); // 获取分组的构造函数
|
|
777
|
-
this.offscreenGroup = new GroupCtor({});
|
|
778
|
-
}
|
|
779
|
-
return this.offscreenGroup;
|
|
780
|
-
};
|
|
781
|
-
// 对数据进行排序
|
|
782
|
-
Geometry.prototype.sort = function (mappingArray) {
|
|
783
|
-
if (!this.hasSorted) {
|
|
784
|
-
// 未发生过排序
|
|
785
|
-
var xScale_1 = this.getXScale();
|
|
786
|
-
var xField_1 = xScale_1.field;
|
|
787
|
-
for (var index = 0; index < mappingArray.length; index++) {
|
|
788
|
-
var itemArr = mappingArray[index];
|
|
789
|
-
itemArr.sort(function (obj1, obj2) {
|
|
790
|
-
return xScale_1.translate(obj1[FIELD_ORIGIN][xField_1]) - xScale_1.translate(obj2[FIELD_ORIGIN][xField_1]);
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
this.hasSorted = true;
|
|
795
|
-
};
|
|
796
|
-
/**
|
|
797
|
-
* 调整度量范围。主要针对发生层叠以及一些特殊需求的 Geometry,比如 Interval 下的柱状图 Y 轴默认从 0 开始。
|
|
798
|
-
*/
|
|
799
|
-
Geometry.prototype.adjustScale = function () {
|
|
800
|
-
var yScale = this.getYScale();
|
|
801
|
-
// 如果数据发生过 stack adjust,需要调整下 yScale 的数据范围
|
|
802
|
-
if (yScale && this.getAdjust('stack')) {
|
|
803
|
-
this.updateStackRange(yScale, this.beforeMappingData);
|
|
804
|
-
}
|
|
805
|
-
};
|
|
806
|
-
/**
|
|
807
|
-
* 获取当前 Geometry 对应的 Shape 工厂实例。
|
|
808
|
-
*/
|
|
809
|
-
Geometry.prototype.getShapeFactory = function () {
|
|
810
|
-
var shapeType = this.shapeType;
|
|
811
|
-
if (!getShapeFactory(shapeType)) {
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
if (!this.shapeFactory) {
|
|
815
|
-
this.shapeFactory = clone(getShapeFactory(shapeType)); // 防止多个 view 共享一个 shapeFactory 实例,导致 coordinate 被篡改
|
|
816
|
-
}
|
|
817
|
-
// 因为这里缓存了 shapeFactory,但是外部可能会变更 coordinate,导致无法重新设置到 shapeFactory 中
|
|
818
|
-
this.shapeFactory.coordinate = this.coordinate;
|
|
819
|
-
// theme 原因同上
|
|
820
|
-
this.shapeFactory.theme = this.theme.geometries[shapeType] || {};
|
|
821
|
-
return this.shapeFactory;
|
|
822
|
-
};
|
|
823
|
-
/**
|
|
824
|
-
* 获取每个 Shape 对应的关键点数据。
|
|
825
|
-
* @param obj 经过分组 -> 数字化 -> adjust 调整后的数据记录
|
|
826
|
-
* @returns
|
|
827
|
-
*/
|
|
828
|
-
Geometry.prototype.createShapePointsCfg = function (obj) {
|
|
829
|
-
var xScale = this.getXScale();
|
|
830
|
-
var yScale = this.getYScale();
|
|
831
|
-
var x = this.normalizeValues(obj[xScale.field], xScale);
|
|
832
|
-
var y; // 存在没有 y 的情况
|
|
833
|
-
if (yScale) {
|
|
834
|
-
y = this.normalizeValues(obj[yScale.field], yScale);
|
|
835
|
-
}
|
|
836
|
-
else {
|
|
837
|
-
y = obj.y ? obj.y : 0.1;
|
|
838
|
-
}
|
|
839
|
-
return {
|
|
840
|
-
x: x,
|
|
841
|
-
y: y,
|
|
842
|
-
y0: yScale ? yScale.scale(this.getYMinValue()) : undefined,
|
|
843
|
-
};
|
|
844
|
-
};
|
|
845
|
-
/**
|
|
846
|
-
* 创建 Element 实例。
|
|
847
|
-
* @param mappingDatum Element 对应的绘制数据
|
|
848
|
-
* @param [isUpdate] 是否处于更新阶段
|
|
849
|
-
* @returns element 返回创建的 Element 实例
|
|
850
|
-
*/
|
|
851
|
-
Geometry.prototype.createElement = function (mappingDatum, index, isUpdate) {
|
|
852
|
-
if (isUpdate === void 0) { isUpdate = false; }
|
|
853
|
-
var container = this.container;
|
|
854
|
-
var shapeCfg = this.getDrawCfg(mappingDatum); // 获取绘制图形的配置信息
|
|
855
|
-
var shapeFactory = this.getShapeFactory();
|
|
856
|
-
var element = new Element({
|
|
857
|
-
shapeFactory: shapeFactory,
|
|
858
|
-
container: container,
|
|
859
|
-
offscreenGroup: this.getOffscreenGroup(),
|
|
860
|
-
elementIndex: index,
|
|
861
|
-
});
|
|
862
|
-
element.animate = this.animateOption;
|
|
863
|
-
element.geometry = this;
|
|
864
|
-
element.draw(shapeCfg, isUpdate); // 绘制
|
|
865
|
-
return element;
|
|
866
|
-
};
|
|
867
|
-
/**
|
|
868
|
-
* 获取每条数据对应的图形绘制数据。
|
|
869
|
-
* @param mappingDatum 映射后的数据
|
|
870
|
-
* @returns draw cfg
|
|
871
|
-
*/
|
|
872
|
-
Geometry.prototype.getDrawCfg = function (mappingDatum) {
|
|
873
|
-
var originData = mappingDatum[FIELD_ORIGIN]; // 原始数据
|
|
874
|
-
var cfg = {
|
|
875
|
-
mappingData: mappingDatum,
|
|
876
|
-
data: originData,
|
|
877
|
-
x: mappingDatum.x,
|
|
878
|
-
y: mappingDatum.y,
|
|
879
|
-
color: mappingDatum.color,
|
|
880
|
-
size: mappingDatum.size,
|
|
881
|
-
isInCircle: this.coordinate.isPolar,
|
|
882
|
-
customInfo: this.customOption,
|
|
883
|
-
};
|
|
884
|
-
var shapeName = mappingDatum.shape;
|
|
885
|
-
if (!shapeName && this.getShapeFactory()) {
|
|
886
|
-
shapeName = this.getShapeFactory().defaultShapeType;
|
|
887
|
-
}
|
|
888
|
-
cfg.shape = shapeName;
|
|
889
|
-
// 获取默认样式
|
|
890
|
-
var theme = this.theme.geometries[this.shapeType];
|
|
891
|
-
cfg.defaultStyle = get(theme, [shapeName, 'default'], {}).style;
|
|
892
|
-
if (!cfg.defaultStyle && this.getShapeFactory()) {
|
|
893
|
-
cfg.defaultStyle = this.getShapeFactory().getDefaultStyle(theme);
|
|
894
|
-
}
|
|
895
|
-
var styleOption = this.styleOption;
|
|
896
|
-
if (styleOption) {
|
|
897
|
-
cfg.style = this.getStyleCfg(styleOption, originData);
|
|
898
|
-
}
|
|
899
|
-
if (this.generatePoints) {
|
|
900
|
-
cfg.points = mappingDatum.points;
|
|
901
|
-
cfg.nextPoints = mappingDatum.nextPoints;
|
|
902
|
-
}
|
|
903
|
-
return cfg;
|
|
904
|
-
};
|
|
905
|
-
Geometry.prototype.updateElements = function (mappingDataArray, isUpdate) {
|
|
906
|
-
if (isUpdate === void 0) { isUpdate = false; }
|
|
907
|
-
var keyDatum = new Map();
|
|
908
|
-
var keys = [];
|
|
909
|
-
// 用来保持 diff 元素之后 added, updated 的相对顺序
|
|
910
|
-
var keyIndex = new Map();
|
|
911
|
-
var index = 0;
|
|
912
|
-
// 获得更新数据所有的 keys
|
|
913
|
-
// 将更新的数据用 key 索引
|
|
914
|
-
for (var i = 0; i < mappingDataArray.length; i++) {
|
|
915
|
-
var mappingData = mappingDataArray[i];
|
|
916
|
-
for (var j = 0; j < mappingData.length; j++) {
|
|
917
|
-
var mappingDatum = mappingData[j];
|
|
918
|
-
var key = this.getElementId(mappingDatum);
|
|
919
|
-
var finalKey = keyDatum.has(key) ? "".concat(key, "-").concat(i, "-").concat(j) : key;
|
|
920
|
-
keys.push(finalKey);
|
|
921
|
-
keyDatum.set(finalKey, mappingDatum);
|
|
922
|
-
keyIndex.set(finalKey, index);
|
|
923
|
-
index++;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
this.elements = new Array(index);
|
|
927
|
-
var _a = diff(this.lastElementsMap, keys), added = _a.added, updated = _a.updated, removed = _a.removed;
|
|
928
|
-
// 新建 element
|
|
929
|
-
for (var _i = 0, added_1 = added; _i < added_1.length; _i++) {
|
|
930
|
-
var key = added_1[_i];
|
|
931
|
-
var mappingDatum = keyDatum.get(key);
|
|
932
|
-
var i = keyIndex.get(key);
|
|
933
|
-
var element = this.createElement(mappingDatum, i, isUpdate);
|
|
934
|
-
this.elements[i] = element;
|
|
935
|
-
this.elementsMap[key] = element;
|
|
936
|
-
if (element.shape) {
|
|
937
|
-
element.shape.set('zIndex', this.zIndexReversed ? this.elements.length - i : i);
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
// 更新 element
|
|
941
|
-
for (var _b = 0, updated_1 = updated; _b < updated_1.length; _b++) {
|
|
942
|
-
var key = updated_1[_b];
|
|
943
|
-
var element = this.lastElementsMap[key];
|
|
944
|
-
var mappingDatum = keyDatum.get(key);
|
|
945
|
-
var currentShapeCfg = this.getDrawCfg(mappingDatum);
|
|
946
|
-
var preShapeCfg = element.getModel();
|
|
947
|
-
var i = keyIndex.get(key);
|
|
948
|
-
if (this.isCoordinateChanged || isModelChange(currentShapeCfg, preShapeCfg)) {
|
|
949
|
-
element.animate = this.animateOption;
|
|
950
|
-
// 通过绘制数据的变更来判断是否需要更新,因为用户有可能会修改图形属性映射
|
|
951
|
-
element.update(currentShapeCfg); // 更新对应的 element
|
|
952
|
-
}
|
|
953
|
-
this.elements[i] = element;
|
|
954
|
-
this.elementsMap[key] = element;
|
|
955
|
-
if (element.shape) {
|
|
956
|
-
element.shape.set('zIndex', this.zIndexReversed ? this.elements.length - i : i);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
// 全部 setZIndex 之后,再执行 sort
|
|
960
|
-
if (this.container) {
|
|
961
|
-
this.container.sort();
|
|
962
|
-
}
|
|
963
|
-
// 销毁被删除的 elements
|
|
964
|
-
for (var _c = 0, removed_1 = removed; _c < removed_1.length; _c++) {
|
|
965
|
-
var key = removed_1[_c];
|
|
966
|
-
var element = this.lastElementsMap[key];
|
|
967
|
-
// 更新动画配置,用户有可能在更新之前有对动画进行配置操作
|
|
968
|
-
element.animate = this.animateOption;
|
|
969
|
-
element.destroy();
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
/**
|
|
973
|
-
* 获取渲染的 label 类型。
|
|
974
|
-
*/
|
|
975
|
-
Geometry.prototype.getLabelType = function () {
|
|
976
|
-
var _a = this, labelOption = _a.labelOption, coordinate = _a.coordinate, type = _a.type;
|
|
977
|
-
var coordinateType = coordinate.type, isTransposed = coordinate.isTransposed;
|
|
978
|
-
var labelType = get(labelOption, ['cfg', 'type']);
|
|
979
|
-
if (!labelType) {
|
|
980
|
-
// 用户未定义,则进行默认的逻辑
|
|
981
|
-
if (coordinateType === 'polar') {
|
|
982
|
-
// 极坐标下使用通用的极坐标文本,转置则使用饼图
|
|
983
|
-
labelType = isTransposed ? 'pie' : 'polar';
|
|
984
|
-
}
|
|
985
|
-
else if (coordinateType === 'theta') {
|
|
986
|
-
// theta 坐标系下使用饼图文本
|
|
987
|
-
labelType = 'pie';
|
|
988
|
-
}
|
|
989
|
-
else if (type === 'interval' || type === 'polygon') {
|
|
990
|
-
labelType = 'interval';
|
|
991
|
-
}
|
|
992
|
-
else {
|
|
993
|
-
labelType = 'base';
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
return labelType;
|
|
997
|
-
};
|
|
998
|
-
/**
|
|
999
|
-
* 获取 Y 轴上的最小值。
|
|
1000
|
-
*/
|
|
1001
|
-
Geometry.prototype.getYMinValue = function () {
|
|
1002
|
-
var yScale = this.getYScale();
|
|
1003
|
-
var min = yScale.min, max = yScale.max;
|
|
1004
|
-
var value;
|
|
1005
|
-
if (min >= 0) {
|
|
1006
|
-
value = min;
|
|
1007
|
-
}
|
|
1008
|
-
else if (max <= 0) {
|
|
1009
|
-
// 当值全位于负区间时,需要保证 ymin 在区域内,不可为 0
|
|
1010
|
-
value = max;
|
|
1011
|
-
}
|
|
1012
|
-
else {
|
|
1013
|
-
value = 0;
|
|
1014
|
-
}
|
|
1015
|
-
return value;
|
|
1016
|
-
};
|
|
1017
|
-
// 创建图形属性相关的配置项
|
|
1018
|
-
Geometry.prototype.createAttrOption = function (attrName, field, cfg) {
|
|
1019
|
-
if (isNil(field) || isObject(field)) {
|
|
1020
|
-
if (isObject(field) && isEqual(Object.keys(field), ['values'])) {
|
|
1021
|
-
// shape({ values: [ 'funnel' ] })
|
|
1022
|
-
set(this.attributeOption, attrName, {
|
|
1023
|
-
fields: field.values,
|
|
1024
|
-
});
|
|
1025
|
-
}
|
|
1026
|
-
else {
|
|
1027
|
-
set(this.attributeOption, attrName, field);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
else {
|
|
1031
|
-
var attrCfg = {};
|
|
1032
|
-
if (isNumber(field)) {
|
|
1033
|
-
// size(3)
|
|
1034
|
-
attrCfg.values = [field];
|
|
1035
|
-
}
|
|
1036
|
-
else {
|
|
1037
|
-
attrCfg.fields = parseFields(field);
|
|
1038
|
-
}
|
|
1039
|
-
if (cfg) {
|
|
1040
|
-
if (isFunction(cfg)) {
|
|
1041
|
-
attrCfg.callback = cfg;
|
|
1042
|
-
}
|
|
1043
|
-
else {
|
|
1044
|
-
attrCfg.values = cfg;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
set(this.attributeOption, attrName, attrCfg);
|
|
1048
|
-
}
|
|
1049
|
-
};
|
|
1050
|
-
Geometry.prototype.initAttributes = function () {
|
|
1051
|
-
var _this = this;
|
|
1052
|
-
var _a = this, attributes = _a.attributes, attributeOption = _a.attributeOption, theme = _a.theme, shapeType = _a.shapeType;
|
|
1053
|
-
this.groupScales = [];
|
|
1054
|
-
var tmpMap = {};
|
|
1055
|
-
var _loop_1 = function (attrType) {
|
|
1056
|
-
if (attributeOption.hasOwnProperty(attrType)) {
|
|
1057
|
-
var option = attributeOption[attrType];
|
|
1058
|
-
if (!option) {
|
|
1059
|
-
return { value: void 0 };
|
|
1060
|
-
}
|
|
1061
|
-
var attrCfg = __assign({}, option);
|
|
1062
|
-
var callback = attrCfg.callback, values = attrCfg.values, _b = attrCfg.fields, fields = _b === void 0 ? [] : _b;
|
|
1063
|
-
// 获取每一个字段对应的 scale
|
|
1064
|
-
var scales = fields.map(function (field) {
|
|
1065
|
-
var scale = _this.scales[field];
|
|
1066
|
-
if (scale.isCategory && !tmpMap[field] && GROUP_ATTRS.includes(attrType)) {
|
|
1067
|
-
_this.groupScales.push(scale);
|
|
1068
|
-
tmpMap[field] = true;
|
|
1069
|
-
}
|
|
1070
|
-
return scale;
|
|
1071
|
-
});
|
|
1072
|
-
attrCfg.scales = scales;
|
|
1073
|
-
if (attrType !== 'position' && scales.length === 1 && scales[0].type === 'identity') {
|
|
1074
|
-
// 用户在图形通道上声明了常量字段 color('red'), size(5)
|
|
1075
|
-
attrCfg.values = scales[0].values;
|
|
1076
|
-
}
|
|
1077
|
-
else if (!callback && !values) {
|
|
1078
|
-
// 用户没有指定任何规则,则使用默认的映射规则
|
|
1079
|
-
if (attrType === 'size') {
|
|
1080
|
-
attrCfg.values = theme.sizes;
|
|
1081
|
-
}
|
|
1082
|
-
else if (attrType === 'shape') {
|
|
1083
|
-
attrCfg.values = theme.shapes[shapeType] || [];
|
|
1084
|
-
}
|
|
1085
|
-
else if (attrType === 'color') {
|
|
1086
|
-
if (scales.length) {
|
|
1087
|
-
// 根据数值个数使用对应的色板
|
|
1088
|
-
attrCfg.values = scales[0].values.length <= 10 ? theme.colors10 : theme.colors20;
|
|
1089
|
-
}
|
|
1090
|
-
else {
|
|
1091
|
-
attrCfg.values = theme.colors10;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
var AttributeCtor = getAttributeClass(attrType);
|
|
1096
|
-
attributes[attrType] = new AttributeCtor(attrCfg);
|
|
1097
|
-
}
|
|
1098
|
-
};
|
|
1099
|
-
// 遍历每一个 attrOption,各自创建 Attribute 实例
|
|
1100
|
-
for (var attrType in attributeOption) {
|
|
1101
|
-
var state_1 = _loop_1(attrType);
|
|
1102
|
-
if (typeof state_1 === "object")
|
|
1103
|
-
return state_1.value;
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
// 处理数据:分组 -> 数字化 -> adjust 调整
|
|
1107
|
-
Geometry.prototype.processData = function (data) {
|
|
1108
|
-
this.hasSorted = false;
|
|
1109
|
-
var scales = this.getAttribute('position').scales;
|
|
1110
|
-
var categoryScales = scales.filter(function (scale) { return scale.isCategory; });
|
|
1111
|
-
var groupedArray = this.groupData(data); // 数据分组
|
|
1112
|
-
var beforeAdjust = [];
|
|
1113
|
-
for (var i = 0, len = groupedArray.length; i < len; i++) {
|
|
1114
|
-
var subData = groupedArray[i];
|
|
1115
|
-
var arr = [];
|
|
1116
|
-
for (var j = 0, subLen = subData.length; j < subLen; j++) {
|
|
1117
|
-
var originData = subData[j];
|
|
1118
|
-
var item = {};
|
|
1119
|
-
// tslint:disable-next-line: forin
|
|
1120
|
-
for (var k in originData) {
|
|
1121
|
-
item[k] = originData[k];
|
|
1122
|
-
}
|
|
1123
|
-
item[FIELD_ORIGIN] = originData;
|
|
1124
|
-
// 将分类数据翻译成数据, 仅对位置相关的度量进行数字化处理
|
|
1125
|
-
for (var _i = 0, categoryScales_1 = categoryScales; _i < categoryScales_1.length; _i++) {
|
|
1126
|
-
var scale = categoryScales_1[_i];
|
|
1127
|
-
var field = scale.field;
|
|
1128
|
-
item[field] = scale.translate(item[field]);
|
|
1129
|
-
}
|
|
1130
|
-
arr.push(item);
|
|
1131
|
-
}
|
|
1132
|
-
beforeAdjust.push(arr);
|
|
1133
|
-
}
|
|
1134
|
-
var dataArray = this.adjustData(beforeAdjust); // 进行 adjust 数据调整
|
|
1135
|
-
this.beforeMappingData = dataArray;
|
|
1136
|
-
return dataArray;
|
|
1137
|
-
};
|
|
1138
|
-
// 调整数据
|
|
1139
|
-
Geometry.prototype.adjustData = function (dataArray) {
|
|
1140
|
-
var adjustOption = this.adjustOption;
|
|
1141
|
-
var _a = this, intervalPadding = _a.intervalPadding, dodgePadding = _a.dodgePadding, theme = _a.theme;
|
|
1142
|
-
// 兼容theme配置
|
|
1143
|
-
var maxColumnWidth = this.maxColumnWidth || theme.maxColumnWidth;
|
|
1144
|
-
var minColumnWidth = this.minColumnWidth || theme.minColumnWidth;
|
|
1145
|
-
var columnWidthRatio = this.columnWidthRatio || theme.columnWidthRatio;
|
|
1146
|
-
var result = dataArray;
|
|
1147
|
-
if (adjustOption) {
|
|
1148
|
-
var xScale = this.getXScale();
|
|
1149
|
-
var yScale = this.getYScale();
|
|
1150
|
-
var xField = xScale.field;
|
|
1151
|
-
var yField = yScale ? yScale.field : null;
|
|
1152
|
-
var xDimensionLength = getXDimensionLength(this.coordinate);
|
|
1153
|
-
var groupNum = xScale.values.length;
|
|
1154
|
-
// 传入size计算相关参数,默认宽度、最大最小宽度约束
|
|
1155
|
-
var sizeAttr = this.getAttribute('size');
|
|
1156
|
-
var defaultSize = void 0;
|
|
1157
|
-
if (sizeAttr) {
|
|
1158
|
-
defaultSize = sizeAttr.values[0];
|
|
1159
|
-
}
|
|
1160
|
-
for (var i = 0, len = adjustOption.length; i < len; i++) {
|
|
1161
|
-
var adjust = adjustOption[i];
|
|
1162
|
-
var adjustCfg = __assign({ xField: xField, yField: yField, intervalPadding: intervalPadding, dodgePadding: dodgePadding, xDimensionLength: xDimensionLength, groupNum: groupNum, defaultSize: defaultSize, maxColumnWidth: maxColumnWidth, minColumnWidth: minColumnWidth, columnWidthRatio: columnWidthRatio }, adjust);
|
|
1163
|
-
var type = adjust.type;
|
|
1164
|
-
if (type === 'dodge') {
|
|
1165
|
-
var adjustNames = [];
|
|
1166
|
-
if (xScale.isCategory || xScale.type === 'identity') {
|
|
1167
|
-
adjustNames.push('x');
|
|
1168
|
-
}
|
|
1169
|
-
else if (!yScale) {
|
|
1170
|
-
adjustNames.push('y');
|
|
1171
|
-
}
|
|
1172
|
-
else {
|
|
1173
|
-
throw new Error('dodge is not support linear attribute, please use category attribute!');
|
|
1174
|
-
}
|
|
1175
|
-
adjustCfg.adjustNames = adjustNames;
|
|
1176
|
-
// 每个分组内每条柱子的宽度占比,用户不可指定,用户需要通过 columnWidthRatio 指定
|
|
1177
|
-
// 兼容theme配置
|
|
1178
|
-
adjustCfg.dodgeRatio = columnWidthRatio;
|
|
1179
|
-
}
|
|
1180
|
-
else if (type === 'stack') {
|
|
1181
|
-
var coordinate = this.coordinate;
|
|
1182
|
-
if (!yScale) {
|
|
1183
|
-
// 一维的情况下获取高度和默认size
|
|
1184
|
-
adjustCfg.height = coordinate.getHeight();
|
|
1185
|
-
var size = this.getDefaultValue('size') || 3;
|
|
1186
|
-
adjustCfg.size = size;
|
|
1187
|
-
}
|
|
1188
|
-
// 不进行 transpose 时,用户又没有设置这个参数时,默认从上向下
|
|
1189
|
-
if (!coordinate.isTransposed && isNil(adjustCfg.reverseOrder)) {
|
|
1190
|
-
adjustCfg.reverseOrder = true;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
var adjustCtor = getAdjustClass(type);
|
|
1194
|
-
var adjustInstance = new adjustCtor(adjustCfg);
|
|
1195
|
-
result = adjustInstance.process(result);
|
|
1196
|
-
this.adjusts[type] = adjustInstance;
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
return result;
|
|
1200
|
-
};
|
|
1201
|
-
// 对数据进行分组
|
|
1202
|
-
Geometry.prototype.groupData = function (data) {
|
|
1203
|
-
var groupScales = this.getGroupScales();
|
|
1204
|
-
var scaleDefs = this.scaleDefs;
|
|
1205
|
-
var appendConditions = {};
|
|
1206
|
-
var groupFields = [];
|
|
1207
|
-
for (var index = 0; index < groupScales.length; index++) {
|
|
1208
|
-
var scale = groupScales[index];
|
|
1209
|
-
var field = scale.field;
|
|
1210
|
-
groupFields.push(field);
|
|
1211
|
-
if (get(scaleDefs, [field, 'values'])) {
|
|
1212
|
-
// 用户通过 view.scale() 接口指定了 values 属性
|
|
1213
|
-
appendConditions[field] = scaleDefs[field].values;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
return group(data, groupFields, appendConditions);
|
|
1217
|
-
};
|
|
1218
|
-
// 更新发生层叠后的数据对应的度量范围
|
|
1219
|
-
Geometry.prototype.updateStackRange = function (scale, dataArray) {
|
|
1220
|
-
var mergeArray = flatten(dataArray);
|
|
1221
|
-
var field = scale.field;
|
|
1222
|
-
var min = scale.min;
|
|
1223
|
-
var max = scale.max;
|
|
1224
|
-
for (var index = 0; index < mergeArray.length; index++) {
|
|
1225
|
-
var obj = mergeArray[index];
|
|
1226
|
-
var tmpMin = Math.min.apply(null, obj[field]);
|
|
1227
|
-
var tmpMax = Math.max.apply(null, obj[field]);
|
|
1228
|
-
if (tmpMin < min) {
|
|
1229
|
-
min = tmpMin;
|
|
1230
|
-
}
|
|
1231
|
-
if (tmpMax > max) {
|
|
1232
|
-
max = tmpMax;
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
var scaleDefs = this.scaleDefs;
|
|
1236
|
-
var cfg = {};
|
|
1237
|
-
if (min < scale.min && !get(scaleDefs, [field, 'min'])) {
|
|
1238
|
-
// 用户如果在列定义中定义了 min,则以用户定义的为准
|
|
1239
|
-
cfg.min = min;
|
|
1240
|
-
}
|
|
1241
|
-
if (max > scale.max && !get(scaleDefs, [field, 'max'])) {
|
|
1242
|
-
// 用户如果在列定义中定义了 max
|
|
1243
|
-
cfg.max = max;
|
|
1244
|
-
}
|
|
1245
|
-
scale.change(cfg);
|
|
1246
|
-
};
|
|
1247
|
-
// 将数据映射至图形空间前的操作:排序以及关键点的生成
|
|
1248
|
-
Geometry.prototype.beforeMapping = function (beforeMappingData) {
|
|
1249
|
-
// 当初加 clone 是因为 points 的引用关系,导致更新失败,可是现在貌似复现不出来了,所以暂时不进行 clone
|
|
1250
|
-
// const source = clone(beforeMappingData);
|
|
1251
|
-
var source = beforeMappingData;
|
|
1252
|
-
if (this.sortable) {
|
|
1253
|
-
this.sort(source);
|
|
1254
|
-
}
|
|
1255
|
-
if (this.generatePoints) {
|
|
1256
|
-
// 需要生成关键点
|
|
1257
|
-
for (var index = 0, length_5 = source.length; index < length_5; index++) {
|
|
1258
|
-
var currentData = source[index];
|
|
1259
|
-
this.generateShapePoints(currentData);
|
|
1260
|
-
var nextData = source[index + 1];
|
|
1261
|
-
if (nextData) {
|
|
1262
|
-
this.generateShapePoints(nextData);
|
|
1263
|
-
currentData[0].nextPoints = nextData[0].points;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
return source;
|
|
1268
|
-
};
|
|
1269
|
-
// 生成 shape 的关键点
|
|
1270
|
-
Geometry.prototype.generateShapePoints = function (data) {
|
|
1271
|
-
var shapeFactory = this.getShapeFactory();
|
|
1272
|
-
var shapeAttr = this.getAttribute('shape');
|
|
1273
|
-
for (var index = 0; index < data.length; index++) {
|
|
1274
|
-
var obj = data[index];
|
|
1275
|
-
var cfg = this.createShapePointsCfg(obj);
|
|
1276
|
-
var shape = shapeAttr ? this.getAttributeValues(shapeAttr, obj) : null;
|
|
1277
|
-
var points = shapeFactory.getShapePoints(shape, cfg);
|
|
1278
|
-
obj.points = points;
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
// 将数据归一化
|
|
1282
|
-
Geometry.prototype.normalizeValues = function (values, scale) {
|
|
1283
|
-
var rst = [];
|
|
1284
|
-
if (isArray(values)) {
|
|
1285
|
-
for (var index = 0; index < values.length; index++) {
|
|
1286
|
-
var value = values[index];
|
|
1287
|
-
rst.push(scale.scale(value));
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
else {
|
|
1291
|
-
rst = scale.scale(values);
|
|
1292
|
-
}
|
|
1293
|
-
return rst;
|
|
1294
|
-
};
|
|
1295
|
-
// 将数据映射至图形空间
|
|
1296
|
-
Geometry.prototype.mapping = function (data) {
|
|
1297
|
-
var attributes = this.attributes;
|
|
1298
|
-
var mappingData = [];
|
|
1299
|
-
for (var index = 0; index < data.length; index++) {
|
|
1300
|
-
var record = data[index];
|
|
1301
|
-
var newRecord = {
|
|
1302
|
-
_origin: record[FIELD_ORIGIN],
|
|
1303
|
-
points: record.points,
|
|
1304
|
-
nextPoints: record.nextPoints,
|
|
1305
|
-
};
|
|
1306
|
-
for (var k in attributes) {
|
|
1307
|
-
if (attributes.hasOwnProperty(k)) {
|
|
1308
|
-
var attr = attributes[k];
|
|
1309
|
-
var names = attr.names;
|
|
1310
|
-
var values = this.getAttributeValues(attr, record);
|
|
1311
|
-
if (names.length > 1) {
|
|
1312
|
-
// position 之类的生成多个字段的属性
|
|
1313
|
-
for (var j = 0; j < values.length; j += 1) {
|
|
1314
|
-
var val = values[j];
|
|
1315
|
-
var name_1 = names[j];
|
|
1316
|
-
newRecord[name_1] = isArray(val) && val.length === 1 ? val[0] : val; // 只有一个值时返回第一个属性值
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
else {
|
|
1320
|
-
// values.length === 1 的判断是以下情况,获取用户设置的图形属性值
|
|
1321
|
-
// shape('a', ['dot', 'dash']), color('a', ['red', 'yellow'])
|
|
1322
|
-
newRecord[names[0]] = values.length === 1 ? values[0] : values;
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
this.convertPoint(newRecord); // 将 x、y 转换成画布坐标
|
|
1327
|
-
mappingData.push(newRecord);
|
|
1328
|
-
}
|
|
1329
|
-
return mappingData;
|
|
1330
|
-
};
|
|
1331
|
-
// 将归一化的坐标值转换成画布坐标
|
|
1332
|
-
Geometry.prototype.convertPoint = function (mappingRecord) {
|
|
1333
|
-
var x = mappingRecord.x, y = mappingRecord.y;
|
|
1334
|
-
var rstX;
|
|
1335
|
-
var rstY;
|
|
1336
|
-
var obj;
|
|
1337
|
-
var coordinate = this.coordinate;
|
|
1338
|
-
if (isArray(x) && isArray(y)) {
|
|
1339
|
-
rstX = [];
|
|
1340
|
-
rstY = [];
|
|
1341
|
-
for (var i = 0, j = 0, xLen = x.length, yLen = y.length; i < xLen && j < yLen; i += 1, j += 1) {
|
|
1342
|
-
obj = coordinate.convert({
|
|
1343
|
-
x: x[i],
|
|
1344
|
-
y: y[j],
|
|
1345
|
-
});
|
|
1346
|
-
rstX.push(obj.x);
|
|
1347
|
-
rstY.push(obj.y);
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
else if (isArray(y)) {
|
|
1351
|
-
rstY = [];
|
|
1352
|
-
for (var index = 0; index < y.length; index++) {
|
|
1353
|
-
var yVal = y[index];
|
|
1354
|
-
obj = coordinate.convert({
|
|
1355
|
-
x: x,
|
|
1356
|
-
y: yVal,
|
|
1357
|
-
});
|
|
1358
|
-
if (rstX && rstX !== obj.x) {
|
|
1359
|
-
if (!isArray(rstX)) {
|
|
1360
|
-
rstX = [rstX];
|
|
1361
|
-
}
|
|
1362
|
-
rstX.push(obj.x);
|
|
1363
|
-
}
|
|
1364
|
-
else {
|
|
1365
|
-
rstX = obj.x;
|
|
1366
|
-
}
|
|
1367
|
-
rstY.push(obj.y);
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
else if (isArray(x)) {
|
|
1371
|
-
rstX = [];
|
|
1372
|
-
for (var index = 0; index < x.length; index++) {
|
|
1373
|
-
var xVal = x[index];
|
|
1374
|
-
obj = coordinate.convert({
|
|
1375
|
-
x: xVal,
|
|
1376
|
-
y: y,
|
|
1377
|
-
});
|
|
1378
|
-
if (rstY && rstY !== obj.y) {
|
|
1379
|
-
if (!isArray(rstY)) {
|
|
1380
|
-
rstY = [rstY];
|
|
1381
|
-
}
|
|
1382
|
-
rstY.push(obj.y);
|
|
1383
|
-
}
|
|
1384
|
-
else {
|
|
1385
|
-
rstY = obj.y;
|
|
1386
|
-
}
|
|
1387
|
-
rstX.push(obj.x);
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
else {
|
|
1391
|
-
var point = coordinate.convert({
|
|
1392
|
-
x: x,
|
|
1393
|
-
y: y,
|
|
1394
|
-
});
|
|
1395
|
-
rstX = point.x;
|
|
1396
|
-
rstY = point.y;
|
|
1397
|
-
}
|
|
1398
|
-
mappingRecord.x = rstX;
|
|
1399
|
-
mappingRecord.y = rstY;
|
|
1400
|
-
};
|
|
1401
|
-
// 获取 style 配置
|
|
1402
|
-
Geometry.prototype.getStyleCfg = function (styleOption, originData) {
|
|
1403
|
-
var _a = styleOption.fields, fields = _a === void 0 ? [] : _a, callback = styleOption.callback, cfg = styleOption.cfg;
|
|
1404
|
-
if (cfg) {
|
|
1405
|
-
// 用户直接配置样式属性
|
|
1406
|
-
return cfg;
|
|
1407
|
-
}
|
|
1408
|
-
var params = fields.map(function (field) {
|
|
1409
|
-
return originData[field];
|
|
1410
|
-
});
|
|
1411
|
-
return callback.apply(void 0, params);
|
|
1412
|
-
};
|
|
1413
|
-
Geometry.prototype.setCfg = function (cfg) {
|
|
1414
|
-
var _this = this;
|
|
1415
|
-
var coordinate = cfg.coordinate, data = cfg.data, theme = cfg.theme, scaleDefs = cfg.scaleDefs;
|
|
1416
|
-
if (coordinate) {
|
|
1417
|
-
this.coordinate = coordinate;
|
|
1418
|
-
}
|
|
1419
|
-
if (data) {
|
|
1420
|
-
this.data = data;
|
|
1421
|
-
}
|
|
1422
|
-
if (scaleDefs) {
|
|
1423
|
-
this.scaleDefs = scaleDefs;
|
|
1424
|
-
this.idFields = [];
|
|
1425
|
-
each(scaleDefs, function (scaleDef, field) {
|
|
1426
|
-
if (scaleDef && scaleDef.key) {
|
|
1427
|
-
_this.idFields.push(field);
|
|
1428
|
-
}
|
|
1429
|
-
});
|
|
1430
|
-
}
|
|
1431
|
-
if (theme) {
|
|
1432
|
-
this.theme = this.userTheme ? deepMix({}, theme, this.userTheme) : theme; // 支持 geometry 层级的主题设置
|
|
1433
|
-
}
|
|
1434
|
-
};
|
|
1435
|
-
Geometry.prototype.renderLabels = function (mappingArray, isUpdate) {
|
|
1436
|
-
if (isUpdate === void 0) { isUpdate = false; }
|
|
1437
|
-
var geometryLabel = this.geometryLabel;
|
|
1438
|
-
if (!geometryLabel) {
|
|
1439
|
-
// 初次创建
|
|
1440
|
-
var labelType = this.getLabelType();
|
|
1441
|
-
var GeometryLabelsCtor = getGeometryLabel(labelType);
|
|
1442
|
-
geometryLabel = new GeometryLabelsCtor(this);
|
|
1443
|
-
this.geometryLabel = geometryLabel;
|
|
1444
|
-
}
|
|
1445
|
-
geometryLabel.render(mappingArray, isUpdate);
|
|
1446
|
-
// 将 label 同 element 进行关联
|
|
1447
|
-
var labelsMap = geometryLabel.labelsRenderer.shapesMap;
|
|
1448
|
-
each(this.elementsMap, function (element, id) {
|
|
1449
|
-
var labels = filterLabelsById(id, labelsMap); // element 实例同 label 进行绑定
|
|
1450
|
-
if (labels.length) {
|
|
1451
|
-
element.labelShape = labels;
|
|
1452
|
-
for (var i = 0; i < labels.length; i++) {
|
|
1453
|
-
var label = labels[i];
|
|
1454
|
-
var labelChildren = label.getChildren();
|
|
1455
|
-
for (var j = 0; j < labelChildren.length; j++) {
|
|
1456
|
-
var child = labelChildren[j];
|
|
1457
|
-
child.cfg.name = ['element', 'label'];
|
|
1458
|
-
child.cfg.element = element;
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
});
|
|
1463
|
-
};
|
|
1464
|
-
/**
|
|
1465
|
-
* 是否需要进行群组入场动画
|
|
1466
|
-
* 规则:
|
|
1467
|
-
* 1. 如果发生更新,则不进行
|
|
1468
|
-
* 2. 如果用户关闭 geometry 动画,则不进行
|
|
1469
|
-
* 3. 如果用户关闭了 appear 动画,则不进行
|
|
1470
|
-
* 4. 如果用户配置了 appear.animation,则不进行
|
|
1471
|
-
*/
|
|
1472
|
-
Geometry.prototype.canDoGroupAnimation = function (isUpdate) {
|
|
1473
|
-
return (!isUpdate &&
|
|
1474
|
-
this.animateOption &&
|
|
1475
|
-
(get(this.animateOption, 'appear') === undefined ||
|
|
1476
|
-
(get(this.animateOption, 'appear') && get(this.animateOption, ['appear', 'animation']) === undefined)));
|
|
1477
|
-
};
|
|
1478
|
-
return Geometry;
|
|
1479
|
-
}(Base));
|
|
1480
|
-
export default Geometry;
|
|
1481
|
-
//# sourceMappingURL=base.js.map
|