@antv/g2 5.0.0-beta.1 → 5.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g2-lite.min.js +5 -2
- package/dist/g2.min.js +5 -2
- package/esm/animation/morphing.js +32 -10
- package/esm/animation/morphing.js.map +1 -1
- package/esm/animation/waveIn.js +1 -12
- package/esm/animation/waveIn.js.map +1 -1
- package/esm/api/chart.d.ts +16 -7
- package/esm/api/chart.js +66 -29
- package/esm/api/chart.js.map +1 -1
- package/esm/api/composition/base.d.ts +21 -0
- package/esm/api/composition/base.js +59 -0
- package/esm/api/composition/base.js.map +1 -0
- package/esm/api/composition/facetCircle.d.ts +2 -3
- package/esm/api/composition/facetCircle.js +2 -2
- package/esm/api/composition/facetCircle.js.map +1 -1
- package/esm/api/composition/facetRect.d.ts +2 -3
- package/esm/api/composition/facetRect.js +2 -2
- package/esm/api/composition/facetRect.js.map +1 -1
- package/esm/api/composition/geoPath.d.ts +5 -7
- package/esm/api/composition/geoPath.js +4 -5
- package/esm/api/composition/geoPath.js.map +1 -1
- package/esm/api/composition/geoView.d.ts +4 -6
- package/esm/api/composition/geoView.js +4 -5
- package/esm/api/composition/geoView.js.map +1 -1
- package/esm/api/composition/index.d.ts +2 -1
- package/esm/api/composition/index.js +2 -1
- package/esm/api/composition/index.js.map +1 -1
- package/esm/api/composition/repeatMatrix.d.ts +2 -3
- package/esm/api/composition/repeatMatrix.js +2 -2
- package/esm/api/composition/repeatMatrix.js.map +1 -1
- package/esm/api/composition/spaceFlex.d.ts +2 -3
- package/esm/api/composition/spaceFlex.js +2 -2
- package/esm/api/composition/spaceFlex.js.map +1 -1
- package/esm/api/composition/spaceLayer.d.ts +2 -3
- package/esm/api/composition/spaceLayer.js +2 -2
- package/esm/api/composition/spaceLayer.js.map +1 -1
- package/esm/api/composition/timingKeyframe.d.ts +2 -3
- package/esm/api/composition/timingKeyframe.js +2 -2
- package/esm/api/composition/timingKeyframe.js.map +1 -1
- package/esm/api/composition/view.d.ts +5 -5
- package/esm/api/composition/view.js +6 -6
- package/esm/api/composition/view.js.map +1 -1
- package/esm/api/mark/base.d.ts +22 -0
- package/esm/api/mark/base.js +54 -0
- package/esm/api/mark/base.js.map +1 -0
- package/esm/api/mark/mark.d.ts +29 -29
- package/esm/api/mark/mark.js +32 -29
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/mark/types.d.ts +5 -2
- package/esm/api/node.d.ts +2 -1
- package/esm/api/node.js +8 -9
- package/esm/api/node.js.map +1 -1
- package/esm/api/props.js +3 -22
- package/esm/api/props.js.map +1 -1
- package/esm/component/axis.d.ts +5 -8
- package/esm/component/axis.js +182 -234
- package/esm/component/axis.js.map +1 -1
- package/esm/component/axisArc.d.ts +7 -0
- package/esm/component/axisArc.js +9 -0
- package/esm/component/axisArc.js.map +1 -0
- package/esm/component/axisRadar.d.ts +9 -0
- package/esm/component/axisRadar.js +45 -0
- package/esm/component/axisRadar.js.map +1 -0
- package/esm/component/axisX.d.ts +2 -1
- package/esm/component/axisX.js +5 -4
- package/esm/component/axisX.js.map +1 -1
- package/esm/component/axisY.d.ts +1 -1
- package/esm/component/axisY.js +4 -4
- package/esm/component/axisY.js.map +1 -1
- package/esm/component/index.d.ts +14 -0
- package/esm/component/index.js +9 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/legendCategory.d.ts +5 -4
- package/esm/component/legendCategory.js +87 -55
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.d.ts +4 -2
- package/esm/component/legendContinuous.js +87 -25
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/component/legendContinuousBlock.d.ts +4 -0
- package/esm/component/legendContinuousBlock.js +6 -0
- package/esm/component/legendContinuousBlock.js.map +1 -0
- package/esm/component/legendContinuousBlockSize.d.ts +4 -0
- package/esm/component/legendContinuousBlockSize.js +6 -0
- package/esm/component/legendContinuousBlockSize.js.map +1 -0
- package/esm/component/legendContinuousSize.d.ts +4 -0
- package/esm/component/legendContinuousSize.js +10 -0
- package/esm/component/legendContinuousSize.js.map +1 -0
- package/esm/component/scrollbar.d.ts +9 -0
- package/esm/component/scrollbar.js +36 -0
- package/esm/component/scrollbar.js.map +1 -0
- package/esm/component/scrollbarX.d.ts +7 -0
- package/esm/component/scrollbarX.js +9 -0
- package/esm/component/scrollbarX.js.map +1 -0
- package/esm/component/scrollbarY.d.ts +7 -0
- package/esm/component/scrollbarY.js +9 -0
- package/esm/component/scrollbarY.js.map +1 -0
- package/esm/component/slider.d.ts +9 -0
- package/esm/component/slider.js +47 -0
- package/esm/component/slider.js.map +1 -0
- package/esm/component/sliderX.d.ts +7 -0
- package/esm/component/sliderX.js +9 -0
- package/esm/component/sliderX.js.map +1 -0
- package/esm/component/sliderY.d.ts +7 -0
- package/esm/component/sliderY.js +9 -0
- package/esm/component/sliderY.js.map +1 -0
- package/esm/component/title.js +47 -23
- package/esm/component/title.js.map +1 -1
- package/esm/component/utils.d.ts +13 -0
- package/esm/component/utils.js +50 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/composition/facetCircle.js +2 -2
- package/esm/composition/facetCircle.js.map +1 -1
- package/esm/composition/facetRect.js +6 -8
- package/esm/composition/facetRect.js.map +1 -1
- package/esm/composition/mark.js +5 -3
- package/esm/composition/mark.js.map +1 -1
- package/esm/composition/repeatMatrix.js +4 -4
- package/esm/composition/repeatMatrix.js.map +1 -1
- package/esm/composition/view.js +8 -4
- package/esm/composition/view.js.map +1 -1
- package/esm/coordinate/fisheye.js +1 -1
- package/esm/coordinate/fisheye.js.map +1 -1
- package/esm/coordinate/index.d.ts +5 -13
- package/esm/coordinate/index.js +4 -8
- package/esm/coordinate/index.js.map +1 -1
- package/esm/coordinate/polar.d.ts +6 -0
- package/esm/coordinate/polar.js +18 -6
- package/esm/coordinate/polar.js.map +1 -1
- package/esm/coordinate/radar.d.ts +7 -0
- package/esm/coordinate/radar.js +14 -0
- package/esm/coordinate/radar.js.map +1 -0
- package/esm/coordinate/radial.d.ts +6 -0
- package/esm/coordinate/radial.js +19 -6
- package/esm/coordinate/radial.js.map +1 -1
- package/esm/coordinate/theta.d.ts +7 -0
- package/esm/coordinate/theta.js +16 -4
- package/esm/coordinate/theta.js.map +1 -1
- package/esm/coordinate/transpose.js +1 -1
- package/esm/coordinate/transpose.js.map +1 -1
- package/esm/data/filter.d.ts +3 -3
- package/esm/data/filter.js.map +1 -1
- package/esm/data/fold.js +4 -10
- package/esm/data/fold.js.map +1 -1
- package/esm/data/index.d.ts +5 -3
- package/esm/data/index.js +2 -1
- package/esm/data/index.js.map +1 -1
- package/esm/data/pick.js +10 -2
- package/esm/data/pick.js.map +1 -1
- package/esm/data/slice.d.ts +8 -0
- package/esm/data/slice.js +10 -0
- package/esm/data/slice.js.map +1 -0
- package/esm/data/sort.d.ts +8 -0
- package/esm/data/sort.js +12 -0
- package/esm/data/sort.js.map +1 -0
- package/esm/geo/{d3-projection.d.ts → d3Projection.d.ts} +0 -0
- package/esm/geo/{d3-projection.js → d3Projection.js} +1 -1
- package/esm/geo/d3Projection.js.map +1 -0
- package/esm/geo/geoView.js +4 -4
- package/esm/geo/geoView.js.map +1 -1
- package/esm/interaction/action/service/legendItemSelection.js.map +1 -1
- package/esm/interaction/action/transformer/setItemState.js.map +1 -1
- package/esm/interaction/builtin/activeRegion.d.ts +0 -2
- package/esm/interaction/builtin/brush.d.ts +1 -1
- package/esm/interaction/builtin/brushHighlight.d.ts +1 -1
- package/esm/interaction/builtin/brushVisible.d.ts +1 -1
- package/esm/interaction/builtin/elementHighlight.d.ts +2 -0
- package/esm/interaction/builtin/elementHighlightByColor.d.ts +2 -0
- package/esm/interaction/builtin/elementHighlightByX.d.ts +2 -0
- package/esm/interaction/builtin/ellipsisText.d.ts +0 -3
- package/esm/interaction/builtin/fisheye.d.ts +6 -6
- package/esm/interaction/builtin/tooltip.d.ts +4 -8
- package/esm/interaction/index.d.ts +13 -0
- package/esm/interaction/index.js +12 -30
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushAxisHighlight.d.ts +27 -0
- package/esm/interaction/native/brushAxisHighlight.js +167 -0
- package/esm/interaction/native/brushAxisHighlight.js.map +1 -0
- package/esm/interaction/native/brushFilter.d.ts +14 -0
- package/esm/interaction/native/brushFilter.js +122 -0
- package/esm/interaction/native/brushFilter.js.map +1 -0
- package/esm/interaction/native/brushHighlight.d.ts +41 -0
- package/esm/interaction/native/brushHighlight.js +349 -0
- package/esm/interaction/native/brushHighlight.js.map +1 -0
- package/esm/interaction/native/brushXFilter.d.ts +1 -0
- package/esm/interaction/native/brushXFilter.js +6 -0
- package/esm/interaction/native/brushXFilter.js.map +1 -0
- package/esm/interaction/native/brushXHighlight.d.ts +6 -0
- package/esm/interaction/native/brushXHighlight.js +9 -0
- package/esm/interaction/native/brushXHighlight.js.map +1 -0
- package/esm/interaction/native/brushYFilter.d.ts +1 -0
- package/esm/interaction/native/brushYFilter.js +6 -0
- package/esm/interaction/native/brushYFilter.js.map +1 -0
- package/esm/interaction/native/brushYHighlight.d.ts +6 -0
- package/esm/interaction/native/brushYHighlight.js +9 -0
- package/esm/interaction/native/brushYHighlight.js.map +1 -0
- package/esm/interaction/native/elementHighlight.d.ts +10 -2
- package/esm/interaction/native/elementHighlight.js +87 -24
- package/esm/interaction/native/elementHighlight.js.map +1 -1
- package/esm/interaction/native/elementHighlightByColor.d.ts +0 -3
- package/esm/interaction/native/elementHighlightByColor.js +3 -9
- package/esm/interaction/native/elementHighlightByColor.js.map +1 -1
- package/esm/interaction/native/elementHighlightByX.d.ts +1 -8
- package/esm/interaction/native/elementHighlightByX.js +4 -11
- package/esm/interaction/native/elementHighlightByX.js.map +1 -1
- package/esm/interaction/native/elementSelect.d.ts +7 -2
- package/esm/interaction/native/elementSelect.js +59 -27
- package/esm/interaction/native/elementSelect.js.map +1 -1
- package/esm/interaction/native/elementSelectByColor.js +3 -6
- package/esm/interaction/native/elementSelectByColor.js.map +1 -1
- package/esm/interaction/native/elementSelectByX.js +3 -6
- package/esm/interaction/native/elementSelectByX.js.map +1 -1
- package/esm/interaction/native/fisheye.js +6 -4
- package/esm/interaction/native/fisheye.js.map +1 -1
- package/esm/interaction/native/legendFilter.d.ts +14 -0
- package/esm/interaction/native/legendFilter.js +195 -0
- package/esm/interaction/native/legendFilter.js.map +1 -0
- package/esm/interaction/native/legendHighlight.d.ts +1 -0
- package/esm/interaction/native/legendHighlight.js +87 -0
- package/esm/interaction/native/legendHighlight.js.map +1 -0
- package/esm/interaction/native/poptip.d.ts +5 -0
- package/esm/interaction/native/poptip.js +91 -0
- package/esm/interaction/native/poptip.js.map +1 -0
- package/esm/interaction/native/sliderFilter.d.ts +5 -0
- package/esm/interaction/native/sliderFilter.js +87 -0
- package/esm/interaction/native/sliderFilter.js.map +1 -0
- package/esm/interaction/native/tooltip.d.ts +2 -2
- package/esm/interaction/native/tooltip.js +149 -47
- package/esm/interaction/native/tooltip.js.map +1 -1
- package/esm/interaction/native/utils.d.ts +24 -5
- package/esm/interaction/native/utils.js +248 -42
- package/esm/interaction/native/utils.js.map +1 -1
- package/esm/label-transform/contrastReverse.d.ts +9 -0
- package/esm/label-transform/contrastReverse.js +48 -0
- package/esm/label-transform/contrastReverse.js.map +1 -0
- package/esm/label-transform/index.d.ts +8 -8
- package/esm/label-transform/index.js +4 -4
- package/esm/label-transform/index.js.map +1 -1
- package/esm/label-transform/overflowHide.d.ts +7 -0
- package/esm/label-transform/overflowHide.js +18 -0
- package/esm/label-transform/overflowHide.js.map +1 -0
- package/esm/label-transform/overlapDodgeY.d.ts +7 -0
- package/esm/label-transform/{dodgeY.js → overlapDodgeY.js} +4 -4
- package/esm/label-transform/overlapDodgeY.js.map +1 -0
- package/esm/label-transform/overlapHide.d.ts +7 -0
- package/esm/label-transform/overlapHide.js +24 -0
- package/esm/label-transform/overlapHide.js.map +1 -0
- package/esm/mark/area.js +2 -2
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/boxplot.js +5 -18
- package/esm/mark/boxplot.js.map +1 -1
- package/esm/mark/cell.js +1 -1
- package/esm/mark/line.js +1 -1
- package/esm/mark/line.js.map +1 -1
- package/esm/mark/pack.js +0 -1
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/treemap.js +0 -1
- package/esm/mark/treemap.js.map +1 -1
- package/esm/runtime/component.d.ts +4 -1
- package/esm/runtime/component.js +274 -106
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/coordinate.d.ts +12 -0
- package/esm/runtime/coordinate.js +47 -16
- package/esm/runtime/coordinate.js.map +1 -1
- package/esm/runtime/layout.d.ts +1 -1
- package/esm/runtime/layout.js +145 -76
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plot.d.ts +1 -1
- package/esm/runtime/plot.js +155 -69
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.d.ts +0 -1
- package/esm/runtime/render.js +22 -47
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/scale.d.ts +3 -1
- package/esm/runtime/scale.js +59 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +17 -7
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +38 -11
- package/esm/runtime/types/component.d.ts +13 -8
- package/esm/runtime/types/mark.d.ts +1 -1
- package/esm/runtime/types/options.d.ts +14 -12
- package/esm/runtime/types/scale.d.ts +18 -0
- package/esm/runtime/types/scale.js +19 -0
- package/esm/runtime/types/scale.js.map +1 -0
- package/esm/runtime/types/theme.d.ts +8 -5
- package/esm/shape/area/curve.js +17 -17
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/area/hv.d.ts +3 -0
- package/esm/shape/area/hv.js +9 -0
- package/esm/shape/area/hv.js.map +1 -0
- package/esm/shape/area/hvh.d.ts +3 -0
- package/esm/shape/area/{step.js → hvh.js} +3 -3
- package/esm/shape/area/hvh.js.map +1 -0
- package/esm/shape/area/vh.d.ts +3 -0
- package/esm/shape/area/vh.js +9 -0
- package/esm/shape/area/vh.js.map +1 -0
- package/esm/shape/box/box.js +1 -1
- package/esm/shape/box/box.js.map +1 -1
- package/esm/shape/connector/connector.js +3 -3
- package/esm/shape/connector/connector.js.map +1 -1
- package/esm/shape/image/image.js +2 -2
- package/esm/shape/image/image.js.map +1 -1
- package/esm/shape/index.d.ts +6 -2
- package/esm/shape/index.js +3 -1
- package/esm/shape/index.js.map +1 -1
- package/esm/shape/interval/color.d.ts +1 -0
- package/esm/shape/interval/color.js +67 -51
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/label/label.js +3 -3
- package/esm/shape/label/label.js.map +1 -1
- package/esm/shape/label/position/area.d.ts +13 -0
- package/esm/shape/label/position/area.js +28 -0
- package/esm/shape/label/position/area.js.map +1 -0
- package/esm/shape/label/position/bottom.d.ts +1 -0
- package/esm/shape/label/position/bottom.js +2 -0
- package/esm/shape/label/position/bottom.js.map +1 -0
- package/esm/shape/label/position/bottomLeft.d.ts +1 -0
- package/esm/shape/label/position/bottomLeft.js +2 -0
- package/esm/shape/label/position/bottomLeft.js.map +1 -0
- package/esm/shape/label/position/bottomRight.d.ts +1 -0
- package/esm/shape/label/position/bottomRight.js +2 -0
- package/esm/shape/label/position/bottomRight.js.map +1 -0
- package/esm/shape/label/position/default.d.ts +18 -0
- package/esm/shape/label/position/default.js +107 -0
- package/esm/shape/label/position/default.js.map +1 -0
- package/esm/shape/label/position/index.d.ts +13 -0
- package/esm/shape/label/position/index.js +14 -0
- package/esm/shape/label/position/index.js.map +1 -0
- package/esm/shape/label/position/inside.d.ts +1 -0
- package/esm/shape/label/position/inside.js +2 -0
- package/esm/shape/label/position/inside.js.map +1 -0
- package/esm/shape/label/position/left.d.ts +1 -0
- package/esm/shape/label/position/left.js +2 -0
- package/esm/shape/label/position/left.js.map +1 -0
- package/esm/shape/label/position/outside.d.ts +18 -0
- package/esm/shape/label/position/outside.js +67 -0
- package/esm/shape/label/position/outside.js.map +1 -0
- package/esm/shape/label/position/right.d.ts +1 -0
- package/esm/shape/label/position/right.js +2 -0
- package/esm/shape/label/position/right.js.map +1 -0
- package/esm/shape/label/position/spider.d.ts +7 -0
- package/esm/shape/label/position/spider.js +34 -0
- package/esm/shape/label/position/spider.js.map +1 -0
- package/esm/shape/label/position/surround.d.ts +7 -0
- package/esm/shape/label/position/surround.js +35 -0
- package/esm/shape/label/position/surround.js.map +1 -0
- package/esm/shape/label/position/top.d.ts +1 -0
- package/esm/shape/label/position/top.js +2 -0
- package/esm/shape/label/position/top.js.map +1 -0
- package/esm/shape/label/position/topLeft.d.ts +1 -0
- package/esm/shape/label/position/topLeft.js +2 -0
- package/esm/shape/label/position/topLeft.js.map +1 -0
- package/esm/shape/label/position/topRight.d.ts +1 -0
- package/esm/shape/label/position/topRight.js +2 -0
- package/esm/shape/label/position/topRight.js.map +1 -0
- package/esm/shape/line/curve.js +24 -13
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/line/line.js +6 -2
- package/esm/shape/line/line.js.map +1 -1
- package/esm/shape/line/smooth.js +6 -2
- package/esm/shape/line/smooth.js.map +1 -1
- package/esm/shape/lineXY/line.js +2 -2
- package/esm/shape/lineXY/line.js.map +1 -1
- package/esm/shape/link/arc.js +2 -2
- package/esm/shape/link/arc.js.map +1 -1
- package/esm/shape/link/link.js +2 -2
- package/esm/shape/link/link.js.map +1 -1
- package/esm/shape/link/smooth.js +2 -2
- package/esm/shape/link/smooth.js.map +1 -1
- package/esm/shape/link/vhv.js +2 -2
- package/esm/shape/link/vhv.js.map +1 -1
- package/esm/shape/point/color.js +1 -1
- package/esm/shape/point/color.js.map +1 -1
- package/esm/shape/polygon/polygon.js +3 -3
- package/esm/shape/polygon/polygon.js.map +1 -1
- package/esm/shape/polygon/ribbon.js +3 -3
- package/esm/shape/polygon/ribbon.js.map +1 -1
- package/esm/shape/text/advance.js +3 -3
- package/esm/shape/text/advance.js.map +1 -1
- package/esm/shape/text/badge.js +3 -3
- package/esm/shape/text/badge.js.map +1 -1
- package/esm/shape/text/text.js +1 -1
- package/esm/shape/text/text.js.map +1 -1
- package/esm/shape/utils.d.ts +5 -0
- package/esm/shape/utils.js +14 -2
- package/esm/shape/utils.js.map +1 -1
- package/esm/shape/vector/vector.js +3 -3
- package/esm/shape/vector/vector.js.map +1 -1
- package/esm/spec/composition.d.ts +9 -7
- package/esm/spec/coordinate.d.ts +17 -33
- package/esm/spec/data.d.ts +32 -10
- package/esm/spec/geometry.d.ts +24 -9
- package/esm/spec/interaction.d.ts +81 -27
- package/esm/spec/labelTransform.d.ts +24 -11
- package/esm/spec/theme.d.ts +5 -2
- package/esm/spec/transform.d.ts +27 -4
- package/esm/spec/utils.d.ts +7 -0
- package/esm/spec/utils.js +2 -0
- package/esm/spec/utils.js.map +1 -0
- package/esm/stdlib/index.js +11 -17
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.d.ts +3 -0
- package/esm/theme/academy.js +404 -0
- package/esm/theme/academy.js.map +1 -0
- package/esm/theme/dark.js +163 -100
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/theme/index.js.map +1 -1
- package/esm/theme/light.js +177 -101
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/filter.d.ts +7 -0
- package/esm/transform/filter.js +42 -0
- package/esm/transform/filter.js.map +1 -0
- package/esm/transform/groupN.js +2 -0
- package/esm/transform/groupN.js.map +1 -1
- package/esm/transform/index.d.ts +10 -6
- package/esm/transform/index.js +5 -3
- package/esm/transform/index.js.map +1 -1
- package/esm/transform/maybeTooltip.js +3 -1
- package/esm/transform/maybeTooltip.js.map +1 -1
- package/esm/transform/sample.d.ts +8 -0
- package/esm/transform/sample.js +64 -0
- package/esm/transform/sample.js.map +1 -0
- package/esm/transform/{Select.d.ts → select.d.ts} +0 -0
- package/esm/transform/{Select.js → select.js} +2 -14
- package/esm/transform/select.js.map +1 -0
- package/esm/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/esm/transform/{SelectX.js → selectX.js} +3 -3
- package/esm/transform/selectX.js.map +1 -0
- package/esm/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- package/esm/transform/{SelectY.js → selectY.js} +3 -3
- package/esm/transform/selectY.js.map +1 -0
- package/esm/transform/sort.d.ts +1 -1
- package/esm/transform/sort.js +39 -21
- package/esm/transform/sort.js.map +1 -1
- package/esm/transform/utils/lttb.d.ts +5 -0
- package/esm/transform/utils/lttb.js +56 -0
- package/esm/transform/utils/lttb.js.map +1 -0
- package/esm/utils/angle.d.ts +2 -0
- package/esm/utils/angle.js +7 -0
- package/esm/utils/angle.js.map +1 -0
- package/esm/utils/array.d.ts +8 -0
- package/esm/utils/array.js +35 -0
- package/esm/utils/array.js.map +1 -1
- package/esm/utils/bounds.d.ts +26 -0
- package/esm/utils/bounds.js +41 -0
- package/esm/utils/bounds.js.map +1 -0
- package/esm/utils/color.d.ts +6 -0
- package/esm/utils/color.js +7 -0
- package/esm/utils/color.js.map +1 -0
- package/esm/utils/coordinate.d.ts +5 -0
- package/esm/utils/coordinate.js +31 -0
- package/esm/utils/coordinate.js.map +1 -1
- package/esm/utils/event.d.ts +0 -2
- package/esm/utils/event.js +0 -18
- package/esm/utils/event.js.map +1 -1
- package/esm/utils/helper.d.ts +2 -0
- package/esm/utils/helper.js +10 -2
- package/esm/utils/helper.js.map +1 -1
- package/esm/utils/scale.d.ts +3 -0
- package/esm/utils/scale.js +30 -0
- package/esm/utils/scale.js.map +1 -0
- package/esm/utils/selection.d.ts +1 -0
- package/esm/utils/selection.js +5 -2
- package/esm/utils/selection.js.map +1 -1
- package/esm/utils/size.js +1 -1
- package/esm/utils/size.js.map +1 -1
- package/esm/utils/vector.d.ts +1 -1
- package/esm/utils/vector.js +1 -1
- package/lib/animation/morphing.js +32 -10
- package/lib/animation/morphing.js.map +1 -1
- package/lib/animation/waveIn.js +1 -12
- package/lib/animation/waveIn.js.map +1 -1
- package/lib/api/chart.d.ts +16 -7
- package/lib/api/chart.js +67 -27
- package/lib/api/chart.js.map +1 -1
- package/lib/api/composition/base.d.ts +21 -0
- package/lib/api/composition/base.js +62 -0
- package/lib/api/composition/base.js.map +1 -0
- package/lib/api/composition/facetCircle.d.ts +2 -3
- package/lib/api/composition/facetCircle.js +2 -2
- package/lib/api/composition/facetCircle.js.map +1 -1
- package/lib/api/composition/facetRect.d.ts +2 -3
- package/lib/api/composition/facetRect.js +2 -2
- package/lib/api/composition/facetRect.js.map +1 -1
- package/lib/api/composition/geoPath.d.ts +5 -7
- package/lib/api/composition/geoPath.js +4 -5
- package/lib/api/composition/geoPath.js.map +1 -1
- package/lib/api/composition/geoView.d.ts +4 -6
- package/lib/api/composition/geoView.js +4 -5
- package/lib/api/composition/geoView.js.map +1 -1
- package/lib/api/composition/index.d.ts +2 -1
- package/lib/api/composition/index.js +3 -1
- package/lib/api/composition/index.js.map +1 -1
- package/lib/api/composition/repeatMatrix.d.ts +2 -3
- package/lib/api/composition/repeatMatrix.js +2 -2
- package/lib/api/composition/repeatMatrix.js.map +1 -1
- package/lib/api/composition/spaceFlex.d.ts +2 -3
- package/lib/api/composition/spaceFlex.js +2 -2
- package/lib/api/composition/spaceFlex.js.map +1 -1
- package/lib/api/composition/spaceLayer.d.ts +2 -3
- package/lib/api/composition/spaceLayer.js +2 -2
- package/lib/api/composition/spaceLayer.js.map +1 -1
- package/lib/api/composition/timingKeyframe.d.ts +2 -3
- package/lib/api/composition/timingKeyframe.js +2 -2
- package/lib/api/composition/timingKeyframe.js.map +1 -1
- package/lib/api/composition/view.d.ts +5 -5
- package/lib/api/composition/view.js +6 -6
- package/lib/api/composition/view.js.map +1 -1
- package/lib/api/mark/base.d.ts +22 -0
- package/lib/api/mark/base.js +58 -0
- package/lib/api/mark/base.js.map +1 -0
- package/lib/api/mark/mark.d.ts +29 -29
- package/lib/api/mark/mark.js +32 -29
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/mark/types.d.ts +5 -2
- package/lib/api/node.d.ts +2 -1
- package/lib/api/node.js +8 -9
- package/lib/api/node.js.map +1 -1
- package/lib/api/props.js +3 -22
- package/lib/api/props.js.map +1 -1
- package/lib/component/axis.d.ts +5 -8
- package/lib/component/axis.js +181 -234
- package/lib/component/axis.js.map +1 -1
- package/lib/component/axisArc.d.ts +7 -0
- package/lib/component/axisArc.js +13 -0
- package/lib/component/axisArc.js.map +1 -0
- package/lib/component/axisRadar.d.ts +9 -0
- package/lib/component/axisRadar.js +49 -0
- package/lib/component/axisRadar.js.map +1 -0
- package/lib/component/axisX.d.ts +2 -1
- package/lib/component/axisX.js +6 -4
- package/lib/component/axisX.js.map +1 -1
- package/lib/component/axisY.d.ts +1 -1
- package/lib/component/axisY.js +3 -3
- package/lib/component/axisY.js.map +1 -1
- package/lib/component/index.d.ts +14 -0
- package/lib/component/index.js +20 -1
- package/lib/component/index.js.map +1 -1
- package/lib/component/legendCategory.d.ts +5 -4
- package/lib/component/legendCategory.js +87 -55
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.d.ts +4 -2
- package/lib/component/legendContinuous.js +87 -25
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/component/legendContinuousBlock.d.ts +4 -0
- package/lib/component/legendContinuousBlock.js +10 -0
- package/lib/component/legendContinuousBlock.js.map +1 -0
- package/lib/component/legendContinuousBlockSize.d.ts +4 -0
- package/lib/component/legendContinuousBlockSize.js +10 -0
- package/lib/component/legendContinuousBlockSize.js.map +1 -0
- package/lib/component/legendContinuousSize.d.ts +4 -0
- package/lib/component/legendContinuousSize.js +14 -0
- package/lib/component/legendContinuousSize.js.map +1 -0
- package/lib/component/scrollbar.d.ts +9 -0
- package/lib/component/scrollbar.js +40 -0
- package/lib/component/scrollbar.js.map +1 -0
- package/lib/component/scrollbarX.d.ts +7 -0
- package/lib/component/scrollbarX.js +13 -0
- package/lib/component/scrollbarX.js.map +1 -0
- package/lib/component/scrollbarY.d.ts +7 -0
- package/lib/component/scrollbarY.js +13 -0
- package/lib/component/scrollbarY.js.map +1 -0
- package/lib/component/slider.d.ts +9 -0
- package/lib/component/slider.js +51 -0
- package/lib/component/slider.js.map +1 -0
- package/lib/component/sliderX.d.ts +7 -0
- package/lib/component/sliderX.js +13 -0
- package/lib/component/sliderX.js.map +1 -0
- package/lib/component/sliderY.d.ts +7 -0
- package/lib/component/sliderY.js +13 -0
- package/lib/component/sliderY.js.map +1 -0
- package/lib/component/title.js +47 -23
- package/lib/component/title.js.map +1 -1
- package/lib/component/utils.d.ts +13 -0
- package/lib/component/utils.js +55 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/composition/facetCircle.js +2 -2
- package/lib/composition/facetCircle.js.map +1 -1
- package/lib/composition/facetRect.js +6 -8
- package/lib/composition/facetRect.js.map +1 -1
- package/lib/composition/mark.js +5 -3
- package/lib/composition/mark.js.map +1 -1
- package/lib/composition/repeatMatrix.js +4 -4
- package/lib/composition/repeatMatrix.js.map +1 -1
- package/lib/composition/view.js +8 -4
- package/lib/composition/view.js.map +1 -1
- package/lib/coordinate/fisheye.js +1 -1
- package/lib/coordinate/fisheye.js.map +1 -1
- package/lib/coordinate/index.d.ts +5 -13
- package/lib/coordinate/index.js +6 -11
- package/lib/coordinate/index.js.map +1 -1
- package/lib/coordinate/polar.d.ts +6 -0
- package/lib/coordinate/polar.js +20 -7
- package/lib/coordinate/polar.js.map +1 -1
- package/lib/coordinate/radar.d.ts +7 -0
- package/lib/coordinate/radar.js +18 -0
- package/lib/coordinate/radar.js.map +1 -0
- package/lib/coordinate/radial.d.ts +6 -0
- package/lib/coordinate/radial.js +21 -7
- package/lib/coordinate/radial.js.map +1 -1
- package/lib/coordinate/theta.d.ts +7 -0
- package/lib/coordinate/theta.js +18 -5
- package/lib/coordinate/theta.js.map +1 -1
- package/lib/coordinate/transpose.js +1 -1
- package/lib/coordinate/transpose.js.map +1 -1
- package/lib/data/filter.d.ts +3 -3
- package/lib/data/filter.js.map +1 -1
- package/lib/data/fold.js +4 -10
- package/lib/data/fold.js.map +1 -1
- package/lib/data/index.d.ts +5 -3
- package/lib/data/index.js +5 -3
- package/lib/data/index.js.map +1 -1
- package/lib/data/pick.js +10 -2
- package/lib/data/pick.js.map +1 -1
- package/lib/data/slice.d.ts +8 -0
- package/lib/data/slice.js +14 -0
- package/lib/data/slice.js.map +1 -0
- package/lib/data/sort.d.ts +8 -0
- package/lib/data/sort.js +17 -0
- package/lib/data/sort.js.map +1 -0
- package/lib/geo/{d3-projection.d.ts → d3Projection.d.ts} +0 -0
- package/lib/geo/{d3-projection.js → d3Projection.js} +1 -1
- package/lib/geo/d3Projection.js.map +1 -0
- package/lib/geo/geoView.js +4 -4
- package/lib/geo/geoView.js.map +1 -1
- package/lib/interaction/action/service/legendItemSelection.js.map +1 -1
- package/lib/interaction/action/transformer/setItemState.js.map +1 -1
- package/lib/interaction/builtin/activeRegion.d.ts +0 -2
- package/lib/interaction/builtin/brush.d.ts +1 -1
- package/lib/interaction/builtin/brushHighlight.d.ts +1 -1
- package/lib/interaction/builtin/brushVisible.d.ts +1 -1
- package/lib/interaction/builtin/elementHighlight.d.ts +2 -0
- package/lib/interaction/builtin/elementHighlightByColor.d.ts +2 -0
- package/lib/interaction/builtin/elementHighlightByX.d.ts +2 -0
- package/lib/interaction/builtin/ellipsisText.d.ts +0 -3
- package/lib/interaction/builtin/fisheye.d.ts +6 -6
- package/lib/interaction/builtin/tooltip.d.ts +4 -8
- package/lib/interaction/index.d.ts +13 -0
- package/lib/interaction/index.js +25 -31
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushAxisHighlight.d.ts +27 -0
- package/lib/interaction/native/brushAxisHighlight.js +172 -0
- package/lib/interaction/native/brushAxisHighlight.js.map +1 -0
- package/lib/interaction/native/brushFilter.d.ts +14 -0
- package/lib/interaction/native/brushFilter.js +127 -0
- package/lib/interaction/native/brushFilter.js.map +1 -0
- package/lib/interaction/native/brushHighlight.d.ts +41 -0
- package/lib/interaction/native/brushHighlight.js +355 -0
- package/lib/interaction/native/brushHighlight.js.map +1 -0
- package/lib/interaction/native/brushXFilter.d.ts +1 -0
- package/lib/interaction/native/brushXFilter.js +10 -0
- package/lib/interaction/native/brushXFilter.js.map +1 -0
- package/lib/interaction/native/brushXHighlight.d.ts +6 -0
- package/lib/interaction/native/brushXHighlight.js +14 -0
- package/lib/interaction/native/brushXHighlight.js.map +1 -0
- package/lib/interaction/native/brushYFilter.d.ts +1 -0
- package/lib/interaction/native/brushYFilter.js +10 -0
- package/lib/interaction/native/brushYFilter.js.map +1 -0
- package/lib/interaction/native/brushYHighlight.d.ts +6 -0
- package/lib/interaction/native/brushYHighlight.js +14 -0
- package/lib/interaction/native/brushYHighlight.js.map +1 -0
- package/lib/interaction/native/elementHighlight.d.ts +10 -2
- package/lib/interaction/native/elementHighlight.js +86 -23
- package/lib/interaction/native/elementHighlight.js.map +1 -1
- package/lib/interaction/native/elementHighlightByColor.d.ts +0 -3
- package/lib/interaction/native/elementHighlightByColor.js +1 -7
- package/lib/interaction/native/elementHighlightByColor.js.map +1 -1
- package/lib/interaction/native/elementHighlightByX.d.ts +1 -8
- package/lib/interaction/native/elementHighlightByX.js +2 -9
- package/lib/interaction/native/elementHighlightByX.js.map +1 -1
- package/lib/interaction/native/elementSelect.d.ts +7 -2
- package/lib/interaction/native/elementSelect.js +58 -26
- package/lib/interaction/native/elementSelect.js.map +1 -1
- package/lib/interaction/native/elementSelectByColor.js +1 -4
- package/lib/interaction/native/elementSelectByColor.js.map +1 -1
- package/lib/interaction/native/elementSelectByX.js +1 -4
- package/lib/interaction/native/elementSelectByX.js.map +1 -1
- package/lib/interaction/native/fisheye.js +6 -4
- package/lib/interaction/native/fisheye.js.map +1 -1
- package/lib/interaction/native/legendFilter.d.ts +14 -0
- package/lib/interaction/native/legendFilter.js +205 -0
- package/lib/interaction/native/legendFilter.js.map +1 -0
- package/lib/interaction/native/legendHighlight.d.ts +1 -0
- package/lib/interaction/native/legendHighlight.js +91 -0
- package/lib/interaction/native/legendHighlight.js.map +1 -0
- package/lib/interaction/native/poptip.d.ts +5 -0
- package/lib/interaction/native/poptip.js +95 -0
- package/lib/interaction/native/poptip.js.map +1 -0
- package/lib/interaction/native/sliderFilter.d.ts +5 -0
- package/lib/interaction/native/sliderFilter.js +91 -0
- package/lib/interaction/native/sliderFilter.js.map +1 -0
- package/lib/interaction/native/tooltip.d.ts +2 -2
- package/lib/interaction/native/tooltip.js +146 -44
- package/lib/interaction/native/tooltip.js.map +1 -1
- package/lib/interaction/native/utils.d.ts +24 -5
- package/lib/interaction/native/utils.js +258 -44
- package/lib/interaction/native/utils.js.map +1 -1
- package/lib/label-transform/contrastReverse.d.ts +9 -0
- package/lib/label-transform/contrastReverse.js +52 -0
- package/lib/label-transform/contrastReverse.js.map +1 -0
- package/lib/label-transform/index.d.ts +8 -8
- package/lib/label-transform/index.js +9 -9
- package/lib/label-transform/index.js.map +1 -1
- package/lib/label-transform/overflowHide.d.ts +7 -0
- package/lib/label-transform/overflowHide.js +22 -0
- package/lib/label-transform/overflowHide.js.map +1 -0
- package/lib/label-transform/overlapDodgeY.d.ts +7 -0
- package/lib/label-transform/{dodgeY.js → overlapDodgeY.js} +6 -6
- package/lib/label-transform/overlapDodgeY.js.map +1 -0
- package/lib/label-transform/overlapHide.d.ts +7 -0
- package/lib/label-transform/overlapHide.js +28 -0
- package/lib/label-transform/overlapHide.js.map +1 -0
- package/lib/mark/area.js +2 -2
- package/lib/mark/area.js.map +1 -1
- package/lib/mark/boxplot.js +5 -18
- package/lib/mark/boxplot.js.map +1 -1
- package/lib/mark/cell.js +1 -1
- package/lib/mark/line.js +1 -1
- package/lib/mark/line.js.map +1 -1
- package/lib/mark/pack.js +0 -1
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/treemap.js +0 -1
- package/lib/mark/treemap.js.map +1 -1
- package/lib/runtime/component.d.ts +4 -1
- package/lib/runtime/component.js +276 -108
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/coordinate.d.ts +12 -0
- package/lib/runtime/coordinate.js +51 -17
- package/lib/runtime/coordinate.js.map +1 -1
- package/lib/runtime/layout.d.ts +1 -1
- package/lib/runtime/layout.js +146 -77
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plot.d.ts +1 -1
- package/lib/runtime/plot.js +152 -66
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.d.ts +0 -1
- package/lib/runtime/render.js +24 -47
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/scale.d.ts +3 -1
- package/lib/runtime/scale.js +61 -5
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +17 -7
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +38 -11
- package/lib/runtime/types/component.d.ts +13 -8
- package/lib/runtime/types/mark.d.ts +1 -1
- package/lib/runtime/types/options.d.ts +14 -12
- package/lib/runtime/types/scale.d.ts +18 -0
- package/lib/runtime/types/scale.js +22 -0
- package/lib/runtime/types/scale.js.map +1 -0
- package/lib/runtime/types/theme.d.ts +8 -5
- package/lib/shape/area/curve.js +16 -16
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/area/hv.d.ts +3 -0
- package/lib/shape/area/hv.js +13 -0
- package/lib/shape/area/hv.js.map +1 -0
- package/lib/shape/area/hvh.d.ts +3 -0
- package/lib/shape/area/{step.js → hvh.js} +5 -5
- package/lib/shape/area/hvh.js.map +1 -0
- package/lib/shape/area/vh.d.ts +3 -0
- package/lib/shape/area/vh.js +13 -0
- package/lib/shape/area/vh.js.map +1 -0
- package/lib/shape/box/box.js +1 -1
- package/lib/shape/box/box.js.map +1 -1
- package/lib/shape/connector/connector.js +3 -3
- package/lib/shape/connector/connector.js.map +1 -1
- package/lib/shape/image/image.js +2 -2
- package/lib/shape/image/image.js.map +1 -1
- package/lib/shape/index.d.ts +6 -2
- package/lib/shape/index.js +7 -3
- package/lib/shape/index.js.map +1 -1
- package/lib/shape/interval/color.d.ts +1 -0
- package/lib/shape/interval/color.js +69 -52
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/label/label.js +3 -3
- package/lib/shape/label/label.js.map +1 -1
- package/lib/shape/label/position/area.d.ts +13 -0
- package/lib/shape/label/position/area.js +32 -0
- package/lib/shape/label/position/area.js.map +1 -0
- package/lib/shape/label/position/bottom.d.ts +1 -0
- package/lib/shape/label/position/bottom.js +6 -0
- package/lib/shape/label/position/bottom.js.map +1 -0
- package/lib/shape/label/position/bottomLeft.d.ts +1 -0
- package/lib/shape/label/position/bottomLeft.js +6 -0
- package/lib/shape/label/position/bottomLeft.js.map +1 -0
- package/lib/shape/label/position/bottomRight.d.ts +1 -0
- package/lib/shape/label/position/bottomRight.js +6 -0
- package/lib/shape/label/position/bottomRight.js.map +1 -0
- package/lib/shape/label/position/default.d.ts +18 -0
- package/lib/shape/label/{position.js → position/default.js} +24 -81
- package/lib/shape/label/position/default.js.map +1 -0
- package/lib/shape/label/position/index.d.ts +13 -0
- package/lib/shape/label/position/index.js +30 -0
- package/lib/shape/label/position/index.js.map +1 -0
- package/lib/shape/label/position/inside.d.ts +1 -0
- package/lib/shape/label/position/inside.js +6 -0
- package/lib/shape/label/position/inside.js.map +1 -0
- package/lib/shape/label/position/left.d.ts +1 -0
- package/lib/shape/label/position/left.js +6 -0
- package/lib/shape/label/position/left.js.map +1 -0
- package/lib/shape/label/position/outside.d.ts +18 -0
- package/lib/shape/label/position/outside.js +75 -0
- package/lib/shape/label/position/outside.js.map +1 -0
- package/lib/shape/label/position/right.d.ts +1 -0
- package/lib/shape/label/position/right.js +6 -0
- package/lib/shape/label/position/right.js.map +1 -0
- package/lib/shape/label/position/spider.d.ts +7 -0
- package/lib/shape/label/position/spider.js +38 -0
- package/lib/shape/label/position/spider.js.map +1 -0
- package/lib/shape/label/position/surround.d.ts +7 -0
- package/lib/shape/label/position/surround.js +39 -0
- package/lib/shape/label/position/surround.js.map +1 -0
- package/lib/shape/label/position/top.d.ts +1 -0
- package/lib/shape/label/position/top.js +6 -0
- package/lib/shape/label/position/top.js.map +1 -0
- package/lib/shape/label/position/topLeft.d.ts +1 -0
- package/lib/shape/label/position/topLeft.js +6 -0
- package/lib/shape/label/position/topLeft.js.map +1 -0
- package/lib/shape/label/position/topRight.d.ts +1 -0
- package/lib/shape/label/position/topRight.js +6 -0
- package/lib/shape/label/position/topRight.js.map +1 -0
- package/lib/shape/line/curve.js +22 -11
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/line/line.js +5 -1
- package/lib/shape/line/line.js.map +1 -1
- package/lib/shape/line/smooth.js +5 -1
- package/lib/shape/line/smooth.js.map +1 -1
- package/lib/shape/lineXY/line.js +2 -2
- package/lib/shape/lineXY/line.js.map +1 -1
- package/lib/shape/link/arc.js +2 -2
- package/lib/shape/link/arc.js.map +1 -1
- package/lib/shape/link/link.js +2 -2
- package/lib/shape/link/link.js.map +1 -1
- package/lib/shape/link/smooth.js +2 -2
- package/lib/shape/link/smooth.js.map +1 -1
- package/lib/shape/link/vhv.js +2 -2
- package/lib/shape/link/vhv.js.map +1 -1
- package/lib/shape/point/color.js +1 -1
- package/lib/shape/point/color.js.map +1 -1
- package/lib/shape/polygon/polygon.js +3 -3
- package/lib/shape/polygon/polygon.js.map +1 -1
- package/lib/shape/polygon/ribbon.js +3 -3
- package/lib/shape/polygon/ribbon.js.map +1 -1
- package/lib/shape/text/advance.js +3 -3
- package/lib/shape/text/advance.js.map +1 -1
- package/lib/shape/text/badge.js +3 -3
- package/lib/shape/text/badge.js.map +1 -1
- package/lib/shape/text/text.js +1 -1
- package/lib/shape/text/text.js.map +1 -1
- package/lib/shape/utils.d.ts +5 -0
- package/lib/shape/utils.js +15 -2
- package/lib/shape/utils.js.map +1 -1
- package/lib/shape/vector/vector.js +3 -3
- package/lib/shape/vector/vector.js.map +1 -1
- package/lib/spec/composition.d.ts +9 -7
- package/lib/spec/coordinate.d.ts +17 -33
- package/lib/spec/data.d.ts +32 -10
- package/lib/spec/geometry.d.ts +24 -9
- package/lib/spec/interaction.d.ts +81 -27
- package/lib/spec/labelTransform.d.ts +24 -11
- package/lib/spec/theme.d.ts +5 -2
- package/lib/spec/transform.d.ts +27 -4
- package/lib/spec/utils.d.ts +7 -0
- package/lib/spec/utils.js +3 -0
- package/lib/spec/utils.js.map +1 -0
- package/lib/stdlib/index.js +3 -4
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.d.ts +3 -0
- package/lib/theme/academy.js +408 -0
- package/lib/theme/academy.js.map +1 -0
- package/lib/theme/dark.js +163 -100
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +3 -1
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/light.js +177 -101
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/filter.d.ts +7 -0
- package/lib/transform/filter.js +46 -0
- package/lib/transform/filter.js.map +1 -0
- package/lib/transform/groupN.js +2 -0
- package/lib/transform/groupN.js.map +1 -1
- package/lib/transform/index.d.ts +10 -6
- package/lib/transform/index.js +11 -7
- package/lib/transform/index.js.map +1 -1
- package/lib/transform/maybeTooltip.js +3 -1
- package/lib/transform/maybeTooltip.js.map +1 -1
- package/lib/transform/sample.d.ts +8 -0
- package/lib/transform/sample.js +68 -0
- package/lib/transform/sample.js.map +1 -0
- package/lib/transform/{Select.d.ts → select.d.ts} +0 -0
- package/lib/transform/{Select.js → select.js} +2 -14
- package/lib/transform/select.js.map +1 -0
- package/lib/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/lib/transform/{SelectX.js → selectX.js} +3 -3
- package/lib/transform/selectX.js.map +1 -0
- package/lib/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- package/lib/transform/{SelectY.js → selectY.js} +3 -3
- package/lib/transform/selectY.js.map +1 -0
- package/lib/transform/sort.d.ts +1 -1
- package/lib/transform/sort.js +38 -20
- package/lib/transform/sort.js.map +1 -1
- package/lib/transform/utils/lttb.d.ts +5 -0
- package/lib/transform/utils/lttb.js +60 -0
- package/lib/transform/utils/lttb.js.map +1 -0
- package/lib/utils/angle.d.ts +2 -0
- package/lib/utils/angle.js +12 -0
- package/lib/utils/angle.js.map +1 -0
- package/lib/utils/array.d.ts +8 -0
- package/lib/utils/array.js +38 -1
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/bounds.d.ts +26 -0
- package/lib/utils/bounds.js +48 -0
- package/lib/utils/bounds.js.map +1 -0
- package/lib/utils/color.d.ts +6 -0
- package/lib/utils/color.js +11 -0
- package/lib/utils/color.js.map +1 -0
- package/lib/utils/coordinate.d.ts +5 -0
- package/lib/utils/coordinate.js +37 -1
- package/lib/utils/coordinate.js.map +1 -1
- package/lib/utils/event.d.ts +0 -2
- package/lib/utils/event.js +1 -21
- package/lib/utils/event.js.map +1 -1
- package/lib/utils/helper.d.ts +2 -0
- package/lib/utils/helper.js +12 -2
- package/lib/utils/helper.js.map +1 -1
- package/lib/utils/scale.d.ts +3 -0
- package/lib/utils/scale.js +36 -0
- package/lib/utils/scale.js.map +1 -0
- package/lib/utils/selection.d.ts +1 -0
- package/lib/utils/selection.js +5 -2
- package/lib/utils/selection.js.map +1 -1
- package/lib/utils/size.js +1 -1
- package/lib/utils/size.js.map +1 -1
- package/lib/utils/vector.d.ts +1 -1
- package/lib/utils/vector.js +1 -1
- package/package.json +9 -8
- package/src/animation/morphing.ts +35 -10
- package/src/animation/waveIn.ts +0 -1
- package/src/api/chart.ts +78 -37
- package/src/api/composition/base.ts +56 -0
- package/src/api/composition/facetCircle.ts +2 -3
- package/src/api/composition/facetRect.ts +2 -3
- package/src/api/composition/geoPath.ts +6 -9
- package/src/api/composition/geoView.ts +6 -9
- package/src/api/composition/index.ts +2 -0
- package/src/api/composition/repeatMatrix.ts +2 -3
- package/src/api/composition/spaceFlex.ts +2 -3
- package/src/api/composition/spaceLayer.ts +2 -3
- package/src/api/composition/timingKeyframe.ts +2 -3
- package/src/api/composition/view.ts +10 -8
- package/src/api/mark/base.ts +58 -0
- package/src/api/mark/mark.ts +34 -30
- package/src/api/mark/types.ts +5 -2
- package/src/api/node.ts +9 -11
- package/src/api/props.ts +4 -25
- package/src/component/axis.ts +341 -366
- package/src/component/axisArc.ts +16 -0
- package/src/component/axisRadar.ts +72 -0
- package/src/component/axisX.ts +7 -4
- package/src/component/axisY.ts +4 -4
- package/src/component/index.ts +14 -0
- package/src/component/legendCategory.ts +182 -76
- package/src/component/legendContinuous.ts +133 -33
- package/src/component/legendContinuousBlock.ts +17 -0
- package/src/component/legendContinuousBlockSize.ts +22 -0
- package/src/component/legendContinuousSize.ts +27 -0
- package/src/component/scrollbar.ts +41 -0
- package/src/component/scrollbarX.ts +16 -0
- package/src/component/scrollbarY.ts +16 -0
- package/src/component/slider.ts +52 -0
- package/src/component/sliderX.ts +16 -0
- package/src/component/sliderY.ts +16 -0
- package/src/component/title.ts +70 -31
- package/src/component/utils.ts +51 -0
- package/src/composition/facetCircle.ts +2 -2
- package/src/composition/facetRect.ts +6 -6
- package/src/composition/mark.ts +8 -4
- package/src/composition/repeatMatrix.ts +10 -3
- package/src/composition/view.ts +22 -2
- package/src/coordinate/fisheye.ts +1 -1
- package/src/coordinate/index.ts +5 -13
- package/src/coordinate/polar.ts +19 -11
- package/src/coordinate/radar.ts +24 -0
- package/src/coordinate/radial.ts +21 -11
- package/src/coordinate/theta.ts +18 -9
- package/src/coordinate/transpose.ts +1 -1
- package/src/data/filter.ts +3 -3
- package/src/data/fold.ts +6 -10
- package/src/data/index.ts +5 -3
- package/src/data/pick.ts +11 -2
- package/src/data/slice.ts +15 -0
- package/src/data/sort.ts +18 -0
- package/src/geo/{d3-projection.ts → d3Projection.ts} +0 -0
- package/src/geo/geoView.ts +4 -4
- package/src/interaction/action/service/legendItemSelection.ts +1 -2
- package/src/interaction/action/transformer/setItemState.ts +2 -3
- package/src/interaction/index.ts +29 -16
- package/src/interaction/native/brushAxisHighlight.ts +207 -0
- package/src/interaction/native/brushFilter.ts +143 -0
- package/src/interaction/native/brushHighlight.ts +447 -0
- package/src/interaction/native/brushXFilter.ts +10 -0
- package/src/interaction/native/brushXHighlight.ts +13 -0
- package/src/interaction/native/brushYFilter.ts +10 -0
- package/src/interaction/native/brushYHighlight.ts +13 -0
- package/src/interaction/native/elementHighlight.ts +99 -15
- package/src/interaction/native/elementHighlightByColor.ts +3 -20
- package/src/interaction/native/elementHighlightByX.ts +4 -23
- package/src/interaction/native/elementSelect.ts +79 -20
- package/src/interaction/native/elementSelectByColor.ts +3 -16
- package/src/interaction/native/elementSelectByX.ts +3 -16
- package/src/interaction/native/fisheye.ts +6 -4
- package/src/interaction/native/legendFilter.ts +214 -0
- package/src/interaction/native/legendHighlight.ts +100 -0
- package/src/interaction/native/poptip.ts +87 -0
- package/src/interaction/native/sliderFilter.ts +112 -0
- package/src/interaction/native/tooltip.ts +191 -49
- package/src/interaction/native/utils.ts +298 -44
- package/src/label-transform/contrastReverse.ts +56 -0
- package/src/label-transform/index.ts +8 -8
- package/src/label-transform/overflowHide.ts +23 -0
- package/src/label-transform/{dodgeY.ts → overlapDodgeY.ts} +7 -7
- package/src/label-transform/overlapHide.ts +32 -0
- package/src/mark/area.ts +2 -2
- package/src/mark/boxplot.ts +3 -1
- package/src/mark/cell.ts +1 -1
- package/src/mark/line.ts +1 -1
- package/src/mark/pack.ts +0 -1
- package/src/mark/treemap.ts +0 -1
- package/src/runtime/component.ts +393 -143
- package/src/runtime/coordinate.ts +46 -16
- package/src/runtime/layout.ts +206 -97
- package/src/runtime/plot.ts +253 -118
- package/src/runtime/render.ts +33 -72
- package/src/runtime/scale.ts +70 -7
- package/src/runtime/transform.ts +22 -6
- package/src/runtime/types/common.ts +50 -20
- package/src/runtime/types/component.ts +18 -11
- package/src/runtime/types/mark.ts +1 -1
- package/src/runtime/types/options.ts +30 -22
- package/src/runtime/types/scale.ts +20 -0
- package/src/runtime/types/theme.ts +8 -5
- package/src/shape/area/curve.ts +22 -17
- package/src/shape/area/hv.ts +20 -0
- package/src/shape/area/{step.ts → hvh.ts} +3 -3
- package/src/shape/area/vh.ts +20 -0
- package/src/shape/box/box.ts +6 -6
- package/src/shape/connector/connector.ts +3 -4
- package/src/shape/image/image.ts +2 -2
- package/src/shape/index.ts +7 -2
- package/src/shape/interval/color.ts +95 -60
- package/src/shape/label/label.ts +4 -3
- package/src/shape/label/position/area.ts +39 -0
- package/src/shape/label/position/bottom.ts +1 -0
- package/src/shape/label/position/bottomLeft.ts +1 -0
- package/src/shape/label/position/bottomRight.ts +1 -0
- package/src/shape/label/{position.ts → position/default.ts} +26 -110
- package/src/shape/label/position/index.ts +13 -0
- package/src/shape/label/position/inside.ts +1 -0
- package/src/shape/label/position/left.ts +1 -0
- package/src/shape/label/position/outside.ts +121 -0
- package/src/shape/label/position/right.ts +1 -0
- package/src/shape/label/position/spider.ts +39 -0
- package/src/shape/label/position/surround.ts +40 -0
- package/src/shape/label/position/top.ts +1 -0
- package/src/shape/label/position/topLeft.ts +1 -0
- package/src/shape/label/position/topRight.ts +1 -0
- package/src/shape/line/curve.ts +28 -13
- package/src/shape/line/line.ts +6 -2
- package/src/shape/line/smooth.ts +11 -2
- package/src/shape/lineXY/line.ts +2 -2
- package/src/shape/link/arc.ts +2 -2
- package/src/shape/link/link.ts +2 -2
- package/src/shape/link/smooth.ts +2 -2
- package/src/shape/link/vhv.ts +2 -2
- package/src/shape/point/color.ts +6 -5
- package/src/shape/polygon/polygon.ts +3 -3
- package/src/shape/polygon/ribbon.ts +3 -3
- package/src/shape/text/advance.ts +6 -3
- package/src/shape/text/badge.ts +8 -3
- package/src/shape/text/text.ts +1 -1
- package/src/shape/utils.ts +16 -6
- package/src/shape/vector/vector.ts +3 -3
- package/src/spec/action.ts +0 -1
- package/src/spec/composition.ts +8 -8
- package/src/spec/coordinate.ts +25 -51
- package/src/spec/data.ts +36 -11
- package/src/spec/geometry.ts +29 -14
- package/src/spec/interaction.ts +120 -50
- package/src/spec/labelTransform.ts +29 -11
- package/src/spec/theme.ts +6 -2
- package/src/spec/transform.ts +47 -3
- package/src/spec/utils.ts +7 -0
- package/src/stdlib/index.ts +73 -27
- package/src/theme/academy.ts +410 -0
- package/src/theme/dark.ts +164 -101
- package/src/theme/index.ts +1 -0
- package/src/theme/light.ts +177 -102
- package/src/transform/filter.ts +48 -0
- package/src/transform/groupN.ts +2 -0
- package/src/transform/index.ts +10 -6
- package/src/transform/maybeTooltip.ts +3 -1
- package/src/transform/sample.ts +80 -0
- package/src/transform/select.ts +1 -2
- package/src/transform/selectX.ts +2 -2
- package/src/transform/selectY.ts +2 -2
- package/src/transform/sort.ts +53 -21
- package/src/transform/utils/lttb.ts +73 -0
- package/src/utils/angle.ts +7 -0
- package/src/utils/array.ts +39 -0
- package/src/utils/bounds.ts +52 -0
- package/src/utils/color.ts +12 -0
- package/src/utils/coordinate.ts +41 -0
- package/src/utils/event.ts +0 -26
- package/src/utils/helper.ts +17 -2
- package/src/utils/scale.ts +31 -0
- package/src/utils/selection.ts +7 -2
- package/src/utils/size.ts +1 -1
- package/src/utils/vector.ts +1 -1
- package/esm/coordinate/fisheyeX.d.ts +0 -7
- package/esm/coordinate/fisheyeX.js +0 -6
- package/esm/coordinate/fisheyeX.js.map +0 -1
- package/esm/coordinate/fisheyeY.d.ts +0 -7
- package/esm/coordinate/fisheyeY.js +0 -6
- package/esm/coordinate/fisheyeY.js.map +0 -1
- package/esm/coordinate/reflect.d.ts +0 -7
- package/esm/coordinate/reflect.js +0 -10
- package/esm/coordinate/reflect.js.map +0 -1
- package/esm/coordinate/reflectX.d.ts +0 -7
- package/esm/coordinate/reflectX.js +0 -10
- package/esm/coordinate/reflectX.js.map +0 -1
- package/esm/coordinate/reflectY.d.ts +0 -7
- package/esm/coordinate/reflectY.js +0 -10
- package/esm/coordinate/reflectY.js.map +0 -1
- package/esm/data/subset.d.ts +0 -7
- package/esm/data/subset.js +0 -26
- package/esm/data/subset.js.map +0 -1
- package/esm/geo/d3-projection.js.map +0 -1
- package/esm/label-transform/dodgeY.d.ts +0 -7
- package/esm/label-transform/dodgeY.js.map +0 -1
- package/esm/label-transform/hideOverlap.d.ts +0 -4
- package/esm/label-transform/hideOverlap.js +0 -48
- package/esm/label-transform/hideOverlap.js.map +0 -1
- package/esm/label-transform/spider.d.ts +0 -7
- package/esm/label-transform/spider.js +0 -30
- package/esm/label-transform/spider.js.map +0 -1
- package/esm/label-transform/surround.d.ts +0 -7
- package/esm/label-transform/surround.js +0 -30
- package/esm/label-transform/surround.js.map +0 -1
- package/esm/shape/area/step.d.ts +0 -3
- package/esm/shape/area/step.js.map +0 -1
- package/esm/shape/label/position.d.ts +0 -25
- package/esm/shape/label/position.js +0 -169
- package/esm/shape/label/position.js.map +0 -1
- package/esm/transform/Select.js.map +0 -1
- package/esm/transform/SelectX.js.map +0 -1
- package/esm/transform/SelectY.js.map +0 -1
- package/lib/coordinate/fisheyeX.d.ts +0 -7
- package/lib/coordinate/fisheyeX.js +0 -10
- package/lib/coordinate/fisheyeX.js.map +0 -1
- package/lib/coordinate/fisheyeY.d.ts +0 -7
- package/lib/coordinate/fisheyeY.js +0 -10
- package/lib/coordinate/fisheyeY.js.map +0 -1
- package/lib/coordinate/reflect.d.ts +0 -7
- package/lib/coordinate/reflect.js +0 -14
- package/lib/coordinate/reflect.js.map +0 -1
- package/lib/coordinate/reflectX.d.ts +0 -7
- package/lib/coordinate/reflectX.js +0 -14
- package/lib/coordinate/reflectX.js.map +0 -1
- package/lib/coordinate/reflectY.d.ts +0 -7
- package/lib/coordinate/reflectY.js +0 -14
- package/lib/coordinate/reflectY.js.map +0 -1
- package/lib/data/subset.d.ts +0 -7
- package/lib/data/subset.js +0 -30
- package/lib/data/subset.js.map +0 -1
- package/lib/geo/d3-projection.js.map +0 -1
- package/lib/label-transform/dodgeY.d.ts +0 -7
- package/lib/label-transform/dodgeY.js.map +0 -1
- package/lib/label-transform/hideOverlap.d.ts +0 -4
- package/lib/label-transform/hideOverlap.js +0 -52
- package/lib/label-transform/hideOverlap.js.map +0 -1
- package/lib/label-transform/spider.d.ts +0 -7
- package/lib/label-transform/spider.js +0 -34
- package/lib/label-transform/spider.js.map +0 -1
- package/lib/label-transform/surround.d.ts +0 -7
- package/lib/label-transform/surround.js +0 -34
- package/lib/label-transform/surround.js.map +0 -1
- package/lib/shape/area/step.d.ts +0 -3
- package/lib/shape/area/step.js.map +0 -1
- package/lib/shape/label/position.d.ts +0 -25
- package/lib/shape/label/position.js.map +0 -1
- package/lib/transform/Select.js.map +0 -1
- package/lib/transform/SelectX.js.map +0 -1
- package/lib/transform/SelectY.js.map +0 -1
- package/src/coordinate/fisheyeX.ts +0 -15
- package/src/coordinate/fisheyeY.ts +0 -15
- package/src/coordinate/reflect.ts +0 -15
- package/src/coordinate/reflectX.ts +0 -15
- package/src/coordinate/reflectY.ts +0 -15
- package/src/data/subset.ts +0 -35
- package/src/label-transform/hideOverlap.ts +0 -62
- package/src/label-transform/spider.ts +0 -37
- package/src/label-transform/surround.ts +0 -37
package/src/api/chart.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { RendererPlugin, Canvas as GCanvas } from '@antv/g';
|
|
|
2
2
|
import { Renderer as CanvasRenderer } from '@antv/g-canvas';
|
|
3
3
|
import { Plugin as DragAndDropPlugin } from '@antv/g-plugin-dragndrop';
|
|
4
4
|
import { debounce } from '@antv/util';
|
|
5
|
+
import EventEmitter from '@antv/event-emitter';
|
|
5
6
|
import { G2Context, render, destroy } from '../runtime';
|
|
6
7
|
import { ViewComposition } from '../spec';
|
|
7
8
|
import { getChartSize } from '../utils/size';
|
|
8
|
-
import { CHART_LIFE_CIRCLE
|
|
9
|
+
import { CHART_LIFE_CIRCLE } from '../utils/event';
|
|
9
10
|
import { Node } from './node';
|
|
10
11
|
import {
|
|
11
12
|
defineProps,
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
ObjectAttribute,
|
|
21
22
|
} from './types';
|
|
22
23
|
import { mark, Mark } from './mark';
|
|
23
|
-
import { composition, Composition } from './composition';
|
|
24
|
+
import { composition, Composition, View } from './composition';
|
|
24
25
|
import { library } from './library';
|
|
25
26
|
|
|
26
27
|
function normalizeContainer(container: string | HTMLElement): HTMLElement {
|
|
@@ -112,6 +113,7 @@ export function optionsOf(node: Node): Record<string, any> {
|
|
|
112
113
|
|
|
113
114
|
export type ChartOptions = ViewComposition & {
|
|
114
115
|
container?: string | HTMLElement;
|
|
116
|
+
canvas?: GCanvas;
|
|
115
117
|
width?: number;
|
|
116
118
|
height?: number;
|
|
117
119
|
autoFit?: boolean;
|
|
@@ -127,12 +129,12 @@ export interface Chart extends Composition, Mark {
|
|
|
127
129
|
data: ValueAttribute<ChartProps['data'], Chart>;
|
|
128
130
|
width: ValueAttribute<ChartProps['width'], Chart>;
|
|
129
131
|
height: ValueAttribute<ChartProps['height'], Chart>;
|
|
130
|
-
coordinate:
|
|
131
|
-
interaction:
|
|
132
|
+
coordinate: ValueAttribute<ChartProps['coordinate'], Chart>;
|
|
133
|
+
interaction: ObjectAttribute<ChartProps['interaction'], Chart>;
|
|
132
134
|
key: ValueAttribute<ChartProps['key'], Chart>;
|
|
133
135
|
transform: ArrayAttribute<ChartProps['transform'], Chart>;
|
|
134
136
|
theme: ObjectAttribute<ChartProps['theme'], Chart>;
|
|
135
|
-
|
|
137
|
+
title: ObjectAttribute<ChartProps['title'], Chart>;
|
|
136
138
|
scale: ObjectAttribute<ChartOptions['scale'], Chart>;
|
|
137
139
|
axis: ObjectAttribute<ChartOptions['axis'], Chart>;
|
|
138
140
|
legend: ObjectAttribute<ChartOptions['legend'], Chart>;
|
|
@@ -143,14 +145,13 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
143
145
|
{ name: 'data', type: 'value' },
|
|
144
146
|
{ name: 'width', type: 'value' },
|
|
145
147
|
{ name: 'height', type: 'value' },
|
|
146
|
-
{ name: 'coordinate', type: '
|
|
147
|
-
{ name: 'interaction', type: '
|
|
148
|
+
{ name: 'coordinate', type: 'value' },
|
|
149
|
+
{ name: 'interaction', type: 'object' },
|
|
148
150
|
{ name: 'theme', type: 'object' },
|
|
149
|
-
{ name: 'title', type: '
|
|
151
|
+
{ name: 'title', type: 'value' },
|
|
150
152
|
{ name: 'key', type: 'value' },
|
|
151
153
|
{ name: 'transform', type: 'array' },
|
|
152
154
|
{ name: 'theme', type: 'object' },
|
|
153
|
-
{ name: 'on', type: 'event' },
|
|
154
155
|
{ name: 'scale', type: 'object' },
|
|
155
156
|
{ name: 'axis', type: 'object' },
|
|
156
157
|
{ name: 'legend', type: 'object' },
|
|
@@ -160,18 +161,21 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
160
161
|
];
|
|
161
162
|
|
|
162
163
|
@defineProps(props)
|
|
163
|
-
export class Chart extends
|
|
164
|
+
export class Chart extends View<ChartOptions> {
|
|
164
165
|
private _container: HTMLElement;
|
|
165
166
|
private _context: G2Context;
|
|
167
|
+
private _emitter: EventEmitter;
|
|
166
168
|
|
|
167
169
|
constructor(options: ChartOptions = {}) {
|
|
168
|
-
const { container, ...rest } = options;
|
|
170
|
+
const { container, canvas, ...rest } = options;
|
|
169
171
|
super(rest, 'view');
|
|
170
172
|
this._container = normalizeContainer(container);
|
|
171
|
-
this.
|
|
173
|
+
this._emitter = new EventEmitter();
|
|
174
|
+
this._context = { library, emitter: this._emitter, canvas };
|
|
175
|
+
this.bindAutoFit();
|
|
172
176
|
}
|
|
173
177
|
|
|
174
|
-
render(): Chart {
|
|
178
|
+
render(): Promise<Chart> {
|
|
175
179
|
if (!this._context.canvas) {
|
|
176
180
|
// Init width and height.
|
|
177
181
|
const {
|
|
@@ -192,7 +196,7 @@ export class Chart extends Node<ChartOptions> {
|
|
|
192
196
|
|
|
193
197
|
// Create canvas if it does not exist.
|
|
194
198
|
this._context.canvas = Canvas(
|
|
195
|
-
|
|
199
|
+
this._container,
|
|
196
200
|
width,
|
|
197
201
|
height,
|
|
198
202
|
renderer,
|
|
@@ -200,12 +204,9 @@ export class Chart extends Node<ChartOptions> {
|
|
|
200
204
|
);
|
|
201
205
|
}
|
|
202
206
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return this;
|
|
207
|
+
return new Promise((resolve) => {
|
|
208
|
+
render(this.options(), this._context, () => resolve(this));
|
|
209
|
+
});
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
options() {
|
|
@@ -220,48 +221,88 @@ export class Chart extends Node<ChartOptions> {
|
|
|
220
221
|
return this._context;
|
|
221
222
|
}
|
|
222
223
|
|
|
224
|
+
on(event: string, callback: (...args: any[]) => any, once?: boolean): this {
|
|
225
|
+
this._emitter.on(event, callback, once);
|
|
226
|
+
return this;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
once(event: string, callback: (...args: any[]) => any): this {
|
|
230
|
+
this._emitter.once(event, callback);
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
emit(event: string, ...args: any[]): this {
|
|
235
|
+
this._emitter.emit(event, ...args);
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
off(event?: string, callback?: (...args: any[]) => any) {
|
|
240
|
+
this._emitter.off(event, callback);
|
|
241
|
+
return this;
|
|
242
|
+
}
|
|
243
|
+
|
|
223
244
|
destroy() {
|
|
224
245
|
const options = this.options();
|
|
225
|
-
|
|
226
|
-
|
|
246
|
+
this.emit(CHART_LIFE_CIRCLE.BEFORE_DESTROY);
|
|
247
|
+
this.unbindAutoFit();
|
|
227
248
|
destroy(options, this._context);
|
|
228
249
|
// Remove the container.
|
|
229
250
|
removeContainer(this._container);
|
|
230
|
-
|
|
251
|
+
this.emit(CHART_LIFE_CIRCLE.AFTER_DESTROY);
|
|
231
252
|
}
|
|
232
253
|
|
|
233
254
|
clear() {
|
|
234
255
|
const options = this.options();
|
|
235
|
-
|
|
236
|
-
emitEvent(on, CHART_LIFE_CIRCLE.BEFORE_CLEAR);
|
|
256
|
+
this.emit(CHART_LIFE_CIRCLE.BEFORE_CLEAR);
|
|
237
257
|
destroy(options, this._context);
|
|
238
|
-
|
|
258
|
+
this.emit(CHART_LIFE_CIRCLE.AFTER_CLEAR);
|
|
239
259
|
}
|
|
240
260
|
|
|
241
261
|
forceFit() {
|
|
242
|
-
const { width, height } = this.options();
|
|
262
|
+
const { width, height, autoFit } = this.options();
|
|
243
263
|
const { width: adjustedWidth, height: adjustedHeight } = getChartSize(
|
|
244
264
|
this._container,
|
|
245
|
-
|
|
265
|
+
autoFit,
|
|
246
266
|
width,
|
|
247
267
|
height,
|
|
248
268
|
);
|
|
249
|
-
|
|
269
|
+
if (adjustedHeight && adjustedWidth) {
|
|
270
|
+
this.changeSize(adjustedWidth, adjustedHeight);
|
|
271
|
+
}
|
|
250
272
|
}
|
|
251
273
|
|
|
252
|
-
changeSize(adjustedWidth: number, adjustedHeight: number) {
|
|
274
|
+
changeSize(adjustedWidth: number, adjustedHeight: number): Promise<Chart> {
|
|
253
275
|
const { width, height, on } = this.options();
|
|
254
|
-
|
|
255
276
|
if (width === adjustedWidth && height === adjustedHeight) {
|
|
256
|
-
return this;
|
|
277
|
+
return Promise.resolve(this);
|
|
257
278
|
}
|
|
258
|
-
|
|
259
|
-
emitEvent(on, CHART_LIFE_CIRCLE.BEFORE_CHANGE_SIZE);
|
|
260
|
-
|
|
279
|
+
this.emit(CHART_LIFE_CIRCLE.BEFORE_CHANGE_SIZE);
|
|
261
280
|
this.width(adjustedWidth);
|
|
262
281
|
this.height(adjustedHeight);
|
|
263
|
-
this.render();
|
|
282
|
+
const finished = this.render();
|
|
283
|
+
finished.then(() => {
|
|
284
|
+
this.emit(CHART_LIFE_CIRCLE.AFTER_CHANGE_SIZE);
|
|
285
|
+
});
|
|
286
|
+
return finished;
|
|
287
|
+
}
|
|
264
288
|
|
|
265
|
-
|
|
289
|
+
private onResize = debounce(() => {
|
|
290
|
+
this.forceFit();
|
|
291
|
+
}, 300);
|
|
292
|
+
|
|
293
|
+
private bindAutoFit() {
|
|
294
|
+
const options = this.options();
|
|
295
|
+
const { autoFit } = options;
|
|
296
|
+
if (autoFit) {
|
|
297
|
+
window.addEventListener('resize', this.onResize);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
private unbindAutoFit() {
|
|
302
|
+
const options = this.options();
|
|
303
|
+
const { autoFit } = options;
|
|
304
|
+
if (autoFit) {
|
|
305
|
+
window.removeEventListener('resize', this.onResize);
|
|
306
|
+
}
|
|
266
307
|
}
|
|
267
308
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
|
+
import { Coordinate } from '@antv/coord';
|
|
3
|
+
import { defineProps } from '../props';
|
|
4
|
+
import { Node } from '../node';
|
|
5
|
+
import { G2Theme, G2ViewDescriptor } from '../../runtime';
|
|
6
|
+
|
|
7
|
+
@defineProps([{ name: 'on', type: 'event' }])
|
|
8
|
+
export class Base<
|
|
9
|
+
Value extends Record<string, any> = Record<string, any>,
|
|
10
|
+
ParentValue extends Record<string, any> = Record<string, any>,
|
|
11
|
+
ChildValue extends Record<string, any> = Record<string, any>,
|
|
12
|
+
> extends Node<Value, ParentValue, ChildValue> {
|
|
13
|
+
/**
|
|
14
|
+
* Get view instance by key.
|
|
15
|
+
*/
|
|
16
|
+
getView(): G2ViewDescriptor {
|
|
17
|
+
const chart = this.root();
|
|
18
|
+
const { views } = chart.context();
|
|
19
|
+
if (!views?.length) return undefined;
|
|
20
|
+
return views.find((view) => view.key === this.attr('key'));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getCoordinate(): Coordinate {
|
|
24
|
+
return this.getView()?.coordinate;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getTheme(): G2Theme {
|
|
28
|
+
return this.getView()?.theme;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getGroup(): DisplayObject {
|
|
32
|
+
const key = this.attr('key');
|
|
33
|
+
if (!key) return undefined;
|
|
34
|
+
const chart = this.root();
|
|
35
|
+
const chartGroup = chart.context().canvas.getRoot();
|
|
36
|
+
return chartGroup.getElementById(key);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Show the view.
|
|
41
|
+
*/
|
|
42
|
+
show() {
|
|
43
|
+
const group = this.getGroup();
|
|
44
|
+
if (!group) return;
|
|
45
|
+
!group.isVisible() && group.setAttribute('visibility', 'visible');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Hide the view.
|
|
50
|
+
*/
|
|
51
|
+
hide() {
|
|
52
|
+
const group = this.getGroup();
|
|
53
|
+
if (!group) return;
|
|
54
|
+
group.isVisible() && group.setAttribute('visibility', 'hidden');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
ObjectAttribute,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type FacetCircleSpec = Concrete<FacetCircleComposition>;
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ export interface FacetCircle extends Composition, Mark {
|
|
|
30
29
|
{ type: 'object', name: 'axis' },
|
|
31
30
|
...nodeProps(mark),
|
|
32
31
|
])
|
|
33
|
-
export class FacetCircle extends
|
|
32
|
+
export class FacetCircle extends Base<FacetCircleComposition> {
|
|
34
33
|
constructor() {
|
|
35
34
|
super({}, 'facetCircle');
|
|
36
35
|
}
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
ObjectAttribute,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type FacetRectSpec = Concrete<FacetRectComposition>;
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ export interface FacetRect extends Composition, Mark {
|
|
|
30
29
|
{ type: 'object', name: 'axis' },
|
|
31
30
|
...nodeProps(mark),
|
|
32
31
|
])
|
|
33
|
-
export class FacetRect extends
|
|
32
|
+
export class FacetRect extends Base<FacetRectComposition> {
|
|
34
33
|
constructor() {
|
|
35
34
|
super({}, 'facetRect');
|
|
36
35
|
}
|
|
@@ -6,17 +6,15 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
Concrete,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type GeoPathSpec = Concrete<GeoPathComposition>;
|
|
14
13
|
|
|
15
14
|
export interface GeoPath extends Mark, Composition {
|
|
16
|
-
projection: ValueAttribute<GeoPathSpec['projection'], GeoPath>;
|
|
17
15
|
data: ValueAttribute<GeoPathSpec['data'], GeoPath>;
|
|
18
|
-
coordinate:
|
|
19
|
-
interaction:
|
|
16
|
+
coordinate: ValueAttribute<GeoPathSpec['coordinate'], GeoPath>;
|
|
17
|
+
interaction: ObjectAttribute<GeoPathSpec['interaction'], GeoPath>;
|
|
20
18
|
style: ObjectAttribute<GeoPathSpec['style'], GeoPath>;
|
|
21
19
|
theme: ObjectAttribute<GeoPathSpec['theme'], GeoPath>;
|
|
22
20
|
scale: ObjectAttribute<GeoPathSpec['scale'], GeoPath>;
|
|
@@ -26,9 +24,8 @@ export interface GeoPath extends Mark, Composition {
|
|
|
26
24
|
|
|
27
25
|
@defineProps([
|
|
28
26
|
{ type: 'value', name: 'data' },
|
|
29
|
-
{ type: 'value', name: '
|
|
30
|
-
{ type: '
|
|
31
|
-
{ type: 'array', name: 'interaction', key: 'interactions' },
|
|
27
|
+
{ type: 'value', name: 'coordinate' },
|
|
28
|
+
{ type: 'object', name: 'interaction' },
|
|
32
29
|
{ type: 'object', name: 'theme' },
|
|
33
30
|
{ type: 'object', name: 'style' },
|
|
34
31
|
{ type: 'object', name: 'scale' },
|
|
@@ -36,7 +33,7 @@ export interface GeoPath extends Mark, Composition {
|
|
|
36
33
|
{ type: 'object', name: 'legend' },
|
|
37
34
|
...nodeProps(mark),
|
|
38
35
|
])
|
|
39
|
-
export class GeoPath extends
|
|
36
|
+
export class GeoPath extends Base<GeoPathComposition> {
|
|
40
37
|
constructor() {
|
|
41
38
|
super({}, 'geoPath');
|
|
42
39
|
}
|
|
@@ -6,18 +6,16 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
Concrete,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type GeoViewSpec = Concrete<GeoViewComposition>;
|
|
14
13
|
|
|
15
14
|
export interface GeoView extends Mark, Composition {
|
|
16
|
-
projection: ValueAttribute<GeoViewSpec['projection'], GeoView>;
|
|
17
15
|
data: ValueAttribute<GeoViewSpec['data'], GeoView>;
|
|
18
16
|
key: ValueAttribute<GeoViewSpec['key'], GeoView>;
|
|
19
|
-
coordinate: ArrayAttribute<GeoViewSpec['
|
|
20
|
-
interaction:
|
|
17
|
+
coordinate: ArrayAttribute<GeoViewSpec['coordinate'], GeoView>;
|
|
18
|
+
interaction: ObjectAttribute<GeoViewSpec['interaction'], GeoView>;
|
|
21
19
|
style: ObjectAttribute<GeoViewSpec['style'], GeoView>;
|
|
22
20
|
theme: ObjectAttribute<GeoViewSpec['theme'], GeoView>;
|
|
23
21
|
scale: ObjectAttribute<GeoViewSpec['scale'], GeoView>;
|
|
@@ -26,16 +24,15 @@ export interface GeoView extends Mark, Composition {
|
|
|
26
24
|
|
|
27
25
|
@defineProps([
|
|
28
26
|
{ type: 'value', name: 'data' },
|
|
29
|
-
{ type: 'value', name: '
|
|
30
|
-
{ type: '
|
|
31
|
-
{ type: 'array', name: 'interaction', key: 'interactions' },
|
|
27
|
+
{ type: 'value', name: 'coordinate' },
|
|
28
|
+
{ type: 'object', name: 'interaction' },
|
|
32
29
|
{ type: 'object', name: 'theme' },
|
|
33
30
|
{ type: 'object', name: 'style' },
|
|
34
31
|
{ type: 'object', name: 'scale' },
|
|
35
32
|
{ type: 'object', name: 'legend' },
|
|
36
33
|
...nodeProps(mark),
|
|
37
34
|
])
|
|
38
|
-
export class GeoView extends
|
|
35
|
+
export class GeoView extends Base<GeoViewComposition> {
|
|
39
36
|
constructor() {
|
|
40
37
|
super({}, 'geoView');
|
|
41
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineProps, nodeProps } from '../props';
|
|
2
|
+
import { Base } from './base';
|
|
2
3
|
import { View } from './view';
|
|
3
4
|
import { SpaceLayer } from './spaceLayer';
|
|
4
5
|
import { SpaceFlex } from './spaceFlex';
|
|
@@ -34,6 +35,7 @@ export interface Composition {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export {
|
|
38
|
+
Base,
|
|
37
39
|
View,
|
|
38
40
|
SpaceLayer,
|
|
39
41
|
SpaceFlex,
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
ObjectAttribute,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type RepeatMatrixSpec = Concrete<RepeatMatrixComposition>;
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ export interface RepeatMatrix extends Composition, Mark {
|
|
|
30
29
|
{ type: 'object', name: 'legend' },
|
|
31
30
|
...nodeProps(mark),
|
|
32
31
|
])
|
|
33
|
-
export class RepeatMatrix extends
|
|
32
|
+
export class RepeatMatrix extends Base<RepeatMatrixComposition> {
|
|
34
33
|
constructor() {
|
|
35
34
|
super({}, 'repeatMatrix');
|
|
36
35
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SpaceFlexComposition } from '../../spec';
|
|
2
2
|
import { defineProps, nodeProps } from '../props';
|
|
3
3
|
import { ValueAttribute, Concrete } from '../types';
|
|
4
|
-
import { Node } from '../node';
|
|
5
4
|
import { mark, Mark } from '../mark';
|
|
6
|
-
import { Composition } from './index';
|
|
5
|
+
import { Composition, Base } from './index';
|
|
7
6
|
|
|
8
7
|
type SpaceFlexSpec = Concrete<SpaceFlexComposition>;
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ export interface SpaceFlex extends Composition, Mark {
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
@defineProps([{ type: 'value', name: 'data' }, ...nodeProps(mark)])
|
|
15
|
-
export class SpaceFlex extends
|
|
14
|
+
export class SpaceFlex extends Base<SpaceFlexSpec> {
|
|
16
15
|
constructor() {
|
|
17
16
|
super({}, 'spaceFlex');
|
|
18
17
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SpaceLayerComposition } from '../../spec';
|
|
2
2
|
import { defineProps, nodeProps } from '../props';
|
|
3
3
|
import { ValueAttribute, Concrete } from '../types';
|
|
4
|
-
import { Node } from '../node';
|
|
5
4
|
import { mark, Mark } from '../mark';
|
|
6
|
-
import { Composition } from './index';
|
|
5
|
+
import { Composition, Base } from './index';
|
|
7
6
|
|
|
8
7
|
type SpaceLayerSpec = Concrete<SpaceLayerComposition>;
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ export interface SpaceLayer extends Composition, Mark {
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
@defineProps([{ type: 'value', name: 'data' }, ...nodeProps(mark)])
|
|
15
|
-
export class SpaceLayer extends
|
|
14
|
+
export class SpaceLayer extends Base<SpaceLayerComposition> {
|
|
16
15
|
constructor() {
|
|
17
16
|
super({}, 'spaceLayer');
|
|
18
17
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { TimingKeyframeComposition } from '../../spec';
|
|
2
2
|
import { defineProps, nodeProps } from '../props';
|
|
3
3
|
import { Concrete } from '../types';
|
|
4
|
-
import { Node } from '../node';
|
|
5
4
|
import { mark, Mark } from '../mark';
|
|
6
|
-
import { Composition } from './index';
|
|
5
|
+
import { Composition, Base } from './index';
|
|
7
6
|
|
|
8
7
|
type TimingKeyframeSpec = Concrete<TimingKeyframeComposition>;
|
|
9
8
|
|
|
10
9
|
export interface TimingKeyframe extends Composition, Mark {}
|
|
11
10
|
|
|
12
11
|
@defineProps([...nodeProps(mark)])
|
|
13
|
-
export class TimingKeyframe extends
|
|
12
|
+
export class TimingKeyframe extends Base<TimingKeyframeSpec> {
|
|
14
13
|
constructor() {
|
|
15
14
|
super({}, 'timingKeyframe');
|
|
16
15
|
}
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
Concrete,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
10
|
+
import { Base } from './base';
|
|
11
11
|
|
|
12
12
|
type ViewSpec = Concrete<ViewComposition>;
|
|
13
13
|
|
|
14
14
|
export interface View extends Mark {
|
|
15
15
|
data: ValueAttribute<ViewSpec['data'], View>;
|
|
16
|
-
coordinate: ArrayAttribute<ViewSpec['
|
|
17
|
-
interaction:
|
|
16
|
+
coordinate: ArrayAttribute<ViewSpec['coordinate'], View>;
|
|
17
|
+
interaction: ObjectAttribute<ViewSpec['interaction'], View>;
|
|
18
18
|
theme: ObjectAttribute<ViewSpec['theme'], View>;
|
|
19
19
|
style: ObjectAttribute<ViewSpec['style'], View>;
|
|
20
20
|
scale: ObjectAttribute<ViewSpec['scale'], View>;
|
|
@@ -24,8 +24,8 @@ export interface View extends Mark {
|
|
|
24
24
|
|
|
25
25
|
@defineProps([
|
|
26
26
|
{ type: 'value', name: 'data' },
|
|
27
|
-
{ type: '
|
|
28
|
-
{ type: '
|
|
27
|
+
{ type: 'value', name: 'coordinate' },
|
|
28
|
+
{ type: 'object', name: 'interaction' },
|
|
29
29
|
{ type: 'object', name: 'theme' },
|
|
30
30
|
{ type: 'object', name: 'style' },
|
|
31
31
|
{ type: 'object', name: 'scale' },
|
|
@@ -33,8 +33,10 @@ export interface View extends Mark {
|
|
|
33
33
|
{ type: 'object', name: 'legend' },
|
|
34
34
|
...nodeProps(mark),
|
|
35
35
|
])
|
|
36
|
-
export class View
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
export class View<
|
|
37
|
+
ViewProps extends ViewComposition = ViewComposition,
|
|
38
|
+
> extends Base<ViewProps> {
|
|
39
|
+
constructor(options = {}, type = 'view') {
|
|
40
|
+
super(options, type);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
|
+
import { Node } from '../node';
|
|
3
|
+
import { G2MarkState, Scale } from '../../runtime';
|
|
4
|
+
|
|
5
|
+
export class MarkBase<
|
|
6
|
+
Value extends Record<string, any> = Record<string, any>,
|
|
7
|
+
ParentValue extends Record<string, any> = Record<string, any>,
|
|
8
|
+
ChildValue extends Record<string, any> = Record<string, any>,
|
|
9
|
+
> extends Node<Value, ParentValue, ChildValue> {
|
|
10
|
+
changeData(data: any) {
|
|
11
|
+
const chart = this.root();
|
|
12
|
+
if (!chart) return;
|
|
13
|
+
this.attr('data', data);
|
|
14
|
+
return chart?.render();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get mark from chart views.
|
|
19
|
+
*/
|
|
20
|
+
getMark(): G2MarkState {
|
|
21
|
+
const chartView = this.root()?.getView();
|
|
22
|
+
if (!chartView) return undefined;
|
|
23
|
+
const { markState } = chartView;
|
|
24
|
+
const markKey = Array.from(markState.keys()).find(
|
|
25
|
+
(item) => item.key === this.attr('key'),
|
|
26
|
+
);
|
|
27
|
+
return markState.get(markKey);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get all scales instance.
|
|
32
|
+
*/
|
|
33
|
+
getScale(): Record<string, Scale> {
|
|
34
|
+
const chartView = this.root()?.getView();
|
|
35
|
+
if (!chartView) return undefined;
|
|
36
|
+
return chartView?.scale;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the scale instance by channel.
|
|
41
|
+
*/
|
|
42
|
+
getScaleByChannel(channel: string): Scale {
|
|
43
|
+
const chartView = this.root()?.getView();
|
|
44
|
+
if (!chartView) return undefined;
|
|
45
|
+
return chartView?.scale?.[channel];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get canvas group.
|
|
50
|
+
*/
|
|
51
|
+
getGroup(): DisplayObject {
|
|
52
|
+
const key = this.attr('key');
|
|
53
|
+
if (!key) return undefined;
|
|
54
|
+
const chart = this.root();
|
|
55
|
+
const chartGroup = chart.context().canvas.getRoot();
|
|
56
|
+
return chartGroup.getElementById(key);
|
|
57
|
+
}
|
|
58
|
+
}
|