@antv/g2 5.0.0-beta.1 → 5.0.0-beta.11
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 +3 -3
- 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.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 +157 -48
- 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 +3 -2
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/box.js +1 -0
- package/esm/mark/box.js.map +1 -1
- package/esm/mark/boxplot.js +6 -21
- package/esm/mark/boxplot.js.map +1 -1
- package/esm/mark/cell.js +2 -1
- package/esm/mark/cell.js.map +1 -1
- package/esm/mark/connector.js +1 -0
- package/esm/mark/connector.js.map +1 -1
- package/esm/mark/forceGraph.js +1 -1
- package/esm/mark/forceGraph.js.map +1 -1
- package/esm/mark/image.js +1 -0
- package/esm/mark/image.js.map +1 -1
- package/esm/mark/interval.js +1 -0
- package/esm/mark/interval.js.map +1 -1
- package/esm/mark/line.js +2 -1
- package/esm/mark/line.js.map +1 -1
- package/esm/mark/lineX.js +1 -0
- package/esm/mark/lineX.js.map +1 -1
- package/esm/mark/lineY.js +1 -0
- package/esm/mark/lineY.js.map +1 -1
- package/esm/mark/link.js +1 -0
- package/esm/mark/link.js.map +1 -1
- package/esm/mark/pack.js +1 -2
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/path.js +1 -0
- package/esm/mark/path.js.map +1 -1
- package/esm/mark/point.js +1 -0
- package/esm/mark/point.js.map +1 -1
- package/esm/mark/polygon.js +1 -0
- package/esm/mark/polygon.js.map +1 -1
- package/esm/mark/range.js +1 -0
- package/esm/mark/range.js.map +1 -1
- package/esm/mark/rangeX.js +1 -0
- package/esm/mark/rangeX.js.map +1 -1
- package/esm/mark/rangeY.js +1 -0
- package/esm/mark/rangeY.js.map +1 -1
- package/esm/mark/rect.js +1 -0
- package/esm/mark/rect.js.map +1 -1
- package/esm/mark/sankey.js +1 -1
- package/esm/mark/sankey.js.map +1 -1
- package/esm/mark/shape.js +1 -0
- package/esm/mark/shape.js.map +1 -1
- package/esm/mark/text.js +1 -0
- package/esm/mark/text.js.map +1 -1
- package/esm/mark/tree.js +1 -1
- package/esm/mark/tree.js.map +1 -1
- package/esm/mark/treemap.js +1 -2
- package/esm/mark/treemap.js.map +1 -1
- package/esm/mark/vector.js +1 -0
- package/esm/mark/vector.js.map +1 -1
- package/esm/mark/wordCloud.js +1 -1
- package/esm/mark/wordCloud.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/mark.js +7 -4
- package/esm/runtime/mark.js.map +1 -1
- package/esm/runtime/plot.d.ts +1 -1
- package/esm/runtime/plot.js +199 -88
- 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 +61 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +18 -9
- 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 +4 -4
- package/esm/runtime/types/options.d.ts +16 -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/scale/constant.d.ts +4 -0
- package/esm/scale/constant.js +6 -0
- package/esm/scale/constant.js.map +1 -0
- package/esm/scale/index.d.ts +2 -0
- package/esm/scale/index.js +1 -0
- package/esm/scale/index.js.map +1 -1
- 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 +68 -50
- 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/scale.d.ts +4 -3
- 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 +12 -18
- 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.js → select.js} +2 -14
- package/esm/transform/select.js.map +1 -0
- package/esm/transform/{SelectX.js → selectX.js} +3 -3
- package/esm/transform/selectX.js.map +1 -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 +3 -3
- 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.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 +154 -45
- 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 +3 -2
- package/lib/mark/area.js.map +1 -1
- package/lib/mark/box.js +1 -0
- package/lib/mark/box.js.map +1 -1
- package/lib/mark/boxplot.js +6 -21
- package/lib/mark/boxplot.js.map +1 -1
- package/lib/mark/cell.js +2 -1
- package/lib/mark/cell.js.map +1 -1
- package/lib/mark/connector.js +1 -0
- package/lib/mark/connector.js.map +1 -1
- package/lib/mark/forceGraph.js +1 -1
- package/lib/mark/forceGraph.js.map +1 -1
- package/lib/mark/image.js +1 -0
- package/lib/mark/image.js.map +1 -1
- package/lib/mark/interval.js +1 -0
- package/lib/mark/interval.js.map +1 -1
- package/lib/mark/line.js +2 -1
- package/lib/mark/line.js.map +1 -1
- package/lib/mark/lineX.js +1 -0
- package/lib/mark/lineX.js.map +1 -1
- package/lib/mark/lineY.js +1 -0
- package/lib/mark/lineY.js.map +1 -1
- package/lib/mark/link.js +1 -0
- package/lib/mark/link.js.map +1 -1
- package/lib/mark/pack.js +1 -2
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/path.js +1 -0
- package/lib/mark/path.js.map +1 -1
- package/lib/mark/point.js +1 -0
- package/lib/mark/point.js.map +1 -1
- package/lib/mark/polygon.js +1 -0
- package/lib/mark/polygon.js.map +1 -1
- package/lib/mark/range.js +1 -0
- package/lib/mark/range.js.map +1 -1
- package/lib/mark/rangeX.js +1 -0
- package/lib/mark/rangeX.js.map +1 -1
- package/lib/mark/rangeY.js +1 -0
- package/lib/mark/rangeY.js.map +1 -1
- package/lib/mark/rect.js +1 -0
- package/lib/mark/rect.js.map +1 -1
- package/lib/mark/sankey.js +1 -1
- package/lib/mark/sankey.js.map +1 -1
- package/lib/mark/shape.js +1 -0
- package/lib/mark/shape.js.map +1 -1
- package/lib/mark/text.js +1 -0
- package/lib/mark/text.js.map +1 -1
- package/lib/mark/tree.js +1 -1
- package/lib/mark/tree.js.map +1 -1
- package/lib/mark/treemap.js +1 -2
- package/lib/mark/treemap.js.map +1 -1
- package/lib/mark/vector.js +1 -0
- package/lib/mark/vector.js.map +1 -1
- package/lib/mark/wordCloud.js +1 -1
- package/lib/mark/wordCloud.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/mark.js +7 -4
- package/lib/runtime/mark.js.map +1 -1
- package/lib/runtime/plot.d.ts +1 -1
- package/lib/runtime/plot.js +196 -85
- 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 +63 -5
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +18 -9
- 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 +4 -4
- package/lib/runtime/types/options.d.ts +16 -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/scale/constant.d.ts +4 -0
- package/lib/scale/constant.js +10 -0
- package/lib/scale/constant.js.map +1 -0
- package/lib/scale/index.d.ts +2 -0
- package/lib/scale/index.js +3 -1
- package/lib/scale/index.js.map +1 -1
- 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 +70 -51
- 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/scale.d.ts +4 -3
- 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.js → select.js} +2 -14
- package/lib/transform/select.js.map +1 -0
- package/lib/transform/{SelectX.js → selectX.js} +3 -3
- package/lib/transform/selectX.js.map +1 -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 +13 -1
- 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/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 +201 -50
- 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 +3 -2
- package/src/mark/box.ts +1 -0
- package/src/mark/boxplot.ts +4 -4
- package/src/mark/cell.ts +2 -1
- package/src/mark/connector.ts +1 -0
- package/src/mark/forceGraph.ts +1 -1
- package/src/mark/image.ts +1 -0
- package/src/mark/interval.ts +1 -0
- package/src/mark/line.ts +2 -1
- package/src/mark/lineX.ts +1 -0
- package/src/mark/lineY.ts +1 -0
- package/src/mark/link.ts +1 -0
- package/src/mark/pack.ts +1 -2
- package/src/mark/path.ts +1 -0
- package/src/mark/point.ts +1 -0
- package/src/mark/polygon.ts +1 -0
- package/src/mark/range.ts +1 -0
- package/src/mark/rangeX.ts +1 -0
- package/src/mark/rangeY.ts +1 -0
- package/src/mark/rect.ts +1 -0
- package/src/mark/sankey.ts +1 -1
- package/src/mark/shape.ts +1 -0
- package/src/mark/text.ts +1 -0
- package/src/mark/tree.ts +1 -1
- package/src/mark/treemap.ts +1 -2
- package/src/mark/vector.ts +1 -0
- package/src/mark/wordCloud.ts +1 -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/mark.ts +7 -3
- package/src/runtime/plot.ts +318 -142
- package/src/runtime/render.ts +33 -72
- package/src/runtime/scale.ts +72 -7
- package/src/runtime/transform.ts +23 -8
- package/src/runtime/types/common.ts +50 -20
- package/src/runtime/types/component.ts +18 -11
- package/src/runtime/types/mark.ts +4 -4
- package/src/runtime/types/options.ts +32 -22
- package/src/runtime/types/scale.ts +20 -0
- package/src/runtime/types/theme.ts +8 -5
- package/src/scale/constant.ts +11 -0
- package/src/scale/index.ts +2 -0
- 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 +97 -58
- 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/scale.ts +6 -1
- 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 +75 -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/esm/geo/{d3-projection.d.ts → d3Projection.d.ts} +0 -0
- /package/esm/transform/{Select.d.ts → select.d.ts} +0 -0
- /package/esm/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- /package/esm/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- /package/lib/geo/{d3-projection.d.ts → d3Projection.d.ts} +0 -0
- /package/lib/transform/{Select.d.ts → select.d.ts} +0 -0
- /package/lib/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- /package/lib/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- /package/src/geo/{d3-projection.ts → d3Projection.ts} +0 -0
package/src/runtime/plot.ts
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import { DisplayObject, IAnimation as GAnimation } from '@antv/g';
|
|
2
|
-
import { deepMix, upperFirst } from '@antv/util';
|
|
3
|
-
import { format } from 'd3-format';
|
|
4
1
|
import { Vector2 } from '@antv/coord';
|
|
2
|
+
import { DisplayObject, IAnimation as GAnimation, Rect } from '@antv/g';
|
|
3
|
+
import { deepMix, upperFirst } from '@antv/util';
|
|
5
4
|
import { group } from 'd3-array';
|
|
5
|
+
import { format } from 'd3-format';
|
|
6
6
|
import { mapObject } from '../utils/array';
|
|
7
|
+
import { CHART_LIFE_CIRCLE } from '../utils/event';
|
|
7
8
|
import {
|
|
9
|
+
appendTransform,
|
|
8
10
|
copyAttributes,
|
|
9
|
-
error,
|
|
10
11
|
defined,
|
|
11
|
-
|
|
12
|
-
appendTransform,
|
|
13
|
-
compose,
|
|
12
|
+
error,
|
|
14
13
|
maybeSubObject,
|
|
15
14
|
subObject,
|
|
15
|
+
useMemo,
|
|
16
16
|
} from '../utils/helper';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { G2Element, select, Selection } from '../utils/selection';
|
|
18
|
+
import { inferComponent, renderComponent } from './component';
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from './types/options';
|
|
20
|
+
AREA_CLASS_NAME,
|
|
21
|
+
COMPONENT_CLASS_NAME,
|
|
22
|
+
ELEMENT_CLASS_NAME,
|
|
23
|
+
LABEL_CLASS_NAME,
|
|
24
|
+
LABEL_LAYER_CLASS_NAME,
|
|
25
|
+
MAIN_LAYER_CLASS_NAME,
|
|
26
|
+
PLOT_CLASS_NAME,
|
|
27
|
+
VIEW_CLASS_NAME,
|
|
28
|
+
} from './constant';
|
|
29
|
+
import { coordinate2Transform, createCoordinate } from './coordinate';
|
|
30
|
+
import { computeLayout, placeComponents } from './layout';
|
|
31
|
+
import { useLibrary } from './library';
|
|
32
|
+
import { initializeMark } from './mark';
|
|
34
33
|
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
AnimationComponent,
|
|
42
|
-
Animation,
|
|
43
|
-
CompositionComponent,
|
|
44
|
-
Composition,
|
|
45
|
-
InteractionComponent,
|
|
46
|
-
Interaction,
|
|
47
|
-
LabelTransformComponent,
|
|
48
|
-
LabelTransform,
|
|
49
|
-
} from './types/component';
|
|
50
|
-
import { MarkComponent, Mark, CompositeMark, SingleMark } from './types/mark';
|
|
34
|
+
applyScale,
|
|
35
|
+
inferScale,
|
|
36
|
+
syncFacetsScales,
|
|
37
|
+
useRelationScale,
|
|
38
|
+
} from './scale';
|
|
39
|
+
import { applyDataTransform } from './transform';
|
|
51
40
|
import {
|
|
52
|
-
G2ViewDescriptor,
|
|
53
41
|
G2MarkState,
|
|
42
|
+
G2ViewDescriptor,
|
|
54
43
|
G2ViewInstance,
|
|
55
44
|
Primitive,
|
|
56
45
|
} from './types/common';
|
|
57
|
-
import { useLibrary } from './library';
|
|
58
|
-
import { initializeMark } from './mark';
|
|
59
|
-
import { inferComponent, renderComponent } from './component';
|
|
60
|
-
import { computeLayout, placeComponents } from './layout';
|
|
61
|
-
import { createCoordinate } from './coordinate';
|
|
62
|
-
import { applyScale, syncFacetsScales, useRelation, inferScale } from './scale';
|
|
63
|
-
import { applyDataTransform } from './transform';
|
|
64
46
|
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
47
|
+
Animation,
|
|
48
|
+
AnimationComponent,
|
|
49
|
+
Composition,
|
|
50
|
+
CompositionComponent,
|
|
51
|
+
Interaction,
|
|
52
|
+
InteractionComponent,
|
|
53
|
+
LabelTransform,
|
|
54
|
+
LabelTransformComponent,
|
|
55
|
+
Shape,
|
|
56
|
+
ShapeComponent,
|
|
57
|
+
Theme,
|
|
58
|
+
ThemeComponent,
|
|
59
|
+
} from './types/component';
|
|
60
|
+
import { CompositeMark, Mark, MarkComponent, SingleMark } from './types/mark';
|
|
61
|
+
import {
|
|
62
|
+
G2AnimationOptions,
|
|
63
|
+
G2CompositionOptions,
|
|
64
|
+
G2Context,
|
|
65
|
+
G2GuideComponentOptions,
|
|
66
|
+
G2InteractionOptions,
|
|
67
|
+
G2LabelTransformOptions,
|
|
68
|
+
G2Library,
|
|
69
|
+
G2Mark,
|
|
70
|
+
G2MarkOptions,
|
|
71
|
+
G2ShapeOptions,
|
|
72
|
+
G2ThemeOptions,
|
|
73
|
+
G2View,
|
|
74
|
+
G2ViewTree,
|
|
75
|
+
} from './types/options';
|
|
74
76
|
|
|
75
77
|
export async function plot<T extends G2ViewTree>(
|
|
76
78
|
options: T,
|
|
@@ -97,6 +99,12 @@ export async function plot<T extends G2ViewTree>(
|
|
|
97
99
|
);
|
|
98
100
|
const typeOf = (node: G2ViewTree) => {
|
|
99
101
|
const { type } = node;
|
|
102
|
+
if (typeof type === 'function') {
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
const { props = {} } = type;
|
|
105
|
+
const { composite = true } = props;
|
|
106
|
+
if (composite) return 'mark';
|
|
107
|
+
}
|
|
100
108
|
return typeof type === 'string' && marks.has(type) ? 'mark' : type;
|
|
101
109
|
};
|
|
102
110
|
const isMark = (node: G2ViewTree) => typeOf(node) === 'mark';
|
|
@@ -131,7 +139,9 @@ export async function plot<T extends G2ViewTree>(
|
|
|
131
139
|
|
|
132
140
|
// Transform children, they will be transformed into
|
|
133
141
|
// standardView if they are mark or view node.
|
|
134
|
-
const transformedNodes = children
|
|
142
|
+
const transformedNodes = children
|
|
143
|
+
.flatMap(transform)
|
|
144
|
+
.map((d) => coordinate2Transform(d, library));
|
|
135
145
|
discovered.push(...transformedNodes);
|
|
136
146
|
|
|
137
147
|
// Only StandardView can be treated as facet and it
|
|
@@ -160,11 +170,11 @@ export async function plot<T extends G2ViewTree>(
|
|
|
160
170
|
}
|
|
161
171
|
}
|
|
162
172
|
|
|
163
|
-
|
|
164
|
-
emitEvent(on, CHART_LIFE_CIRCLE.BEFORE_PAINT);
|
|
173
|
+
context.emitter.emit(CHART_LIFE_CIRCLE.BEFORE_PAINT);
|
|
165
174
|
|
|
166
175
|
// Plot chart.
|
|
167
|
-
const
|
|
176
|
+
const enterContainer = new Map<G2ViewDescriptor, DisplayObject>();
|
|
177
|
+
const updateContainer = new Map<G2ViewDescriptor, DisplayObject>();
|
|
168
178
|
const transitions: GAnimation[] = [];
|
|
169
179
|
selection
|
|
170
180
|
.selectAll(className(VIEW_CLASS_NAME))
|
|
@@ -178,29 +188,68 @@ export async function plot<T extends G2ViewTree>(
|
|
|
178
188
|
.call(applyTranslate)
|
|
179
189
|
.each(function (view) {
|
|
180
190
|
plotView(view, select(this), transitions, library);
|
|
181
|
-
|
|
191
|
+
enterContainer.set(view, this);
|
|
182
192
|
}),
|
|
183
193
|
(update) =>
|
|
184
194
|
update.call(applyTranslate).each(function (view) {
|
|
185
195
|
plotView(view, select(this), transitions, library);
|
|
196
|
+
updateContainer.set(view, this);
|
|
186
197
|
}),
|
|
187
|
-
(exit) =>
|
|
198
|
+
(exit) =>
|
|
199
|
+
exit
|
|
200
|
+
.each(function () {
|
|
201
|
+
// Remove existed interactions.
|
|
202
|
+
const interactions = this['nameInteraction'].values();
|
|
203
|
+
for (const interaction of interactions) {
|
|
204
|
+
interaction.destroy();
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
.remove(),
|
|
188
208
|
);
|
|
189
209
|
|
|
190
|
-
// Apply
|
|
191
|
-
const
|
|
192
|
-
|
|
210
|
+
// Apply interactions.
|
|
211
|
+
const viewInstanceof = (
|
|
212
|
+
viewContainer: Map<G2ViewDescriptor, DisplayObject>,
|
|
213
|
+
) => {
|
|
214
|
+
return Array.from(viewContainer.entries()).map(([view, container]) => ({
|
|
193
215
|
view,
|
|
194
216
|
container,
|
|
195
217
|
options: viewNode.get(view),
|
|
196
218
|
update: createUpdateView(select(container), library, context),
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
|
|
219
|
+
}));
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// Interactions for enter views.
|
|
223
|
+
const enterViewInstances = viewInstanceof(enterContainer);
|
|
224
|
+
for (const target of enterViewInstances) {
|
|
200
225
|
const { options } = target;
|
|
226
|
+
|
|
227
|
+
// A Map index interaction by interaction name.
|
|
228
|
+
const nameInteraction = new Map();
|
|
229
|
+
target.container['nameInteraction'] = nameInteraction;
|
|
230
|
+
|
|
231
|
+
// Apply interactions.
|
|
201
232
|
for (const option of inferInteraction(options)) {
|
|
202
233
|
const interaction = useInteraction(option);
|
|
203
|
-
interaction(target,
|
|
234
|
+
const destroy = interaction(target, enterViewInstances);
|
|
235
|
+
nameInteraction.set(option.type, { destroy });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Interactions for update views.
|
|
240
|
+
const updateViewInstances = viewInstanceof(updateContainer);
|
|
241
|
+
for (const target of updateViewInstances) {
|
|
242
|
+
const { options, container } = target;
|
|
243
|
+
const nameInteraction = container['nameInteraction'];
|
|
244
|
+
for (const option of inferInteraction(options)) {
|
|
245
|
+
// Remove interaction for existed views.
|
|
246
|
+
const prevInteraction = nameInteraction.get(option.type);
|
|
247
|
+
if (prevInteraction) prevInteraction.destroy();
|
|
248
|
+
|
|
249
|
+
// Apply new interaction.
|
|
250
|
+
const interaction = useInteraction(option);
|
|
251
|
+
const destroy = interaction(target, updateViewInstances);
|
|
252
|
+
nameInteraction.set(options.type, { destroy });
|
|
204
253
|
}
|
|
205
254
|
}
|
|
206
255
|
|
|
@@ -221,9 +270,10 @@ export async function plot<T extends G2ViewTree>(
|
|
|
221
270
|
keyframes.push(keyframe);
|
|
222
271
|
}
|
|
223
272
|
|
|
273
|
+
context.views = views;
|
|
224
274
|
context.animations = transitions;
|
|
225
275
|
|
|
226
|
-
|
|
276
|
+
context.emitter.emit(CHART_LIFE_CIRCLE.AFTER_PAINT);
|
|
227
277
|
|
|
228
278
|
// Note!!!
|
|
229
279
|
// The returned promise will never resolved if one of nodeGenerator
|
|
@@ -266,8 +316,71 @@ async function initializeView(
|
|
|
266
316
|
options: G2View,
|
|
267
317
|
library: G2Library,
|
|
268
318
|
): Promise<[G2ViewDescriptor, G2ViewTree[]]> {
|
|
269
|
-
const
|
|
270
|
-
|
|
319
|
+
const flattenOptions = await transformMarks(options, library);
|
|
320
|
+
const mergedOptions = bubbleOptions(flattenOptions);
|
|
321
|
+
const transformedOptions = coordinate2Transform(mergedOptions, library);
|
|
322
|
+
const state = await initializeMarks(transformedOptions, library);
|
|
323
|
+
return initializeState(state, transformedOptions, library);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function bubbleOptions(options: G2View): G2View {
|
|
327
|
+
const {
|
|
328
|
+
coordinate: viewCoordinate = {},
|
|
329
|
+
interaction: viewInteraction = {},
|
|
330
|
+
marks,
|
|
331
|
+
...rest
|
|
332
|
+
} = options;
|
|
333
|
+
const markCoordinates = marks.map((d) => d.coordinate || {});
|
|
334
|
+
const markInteractions = marks.map((d) => d.interaction || {});
|
|
335
|
+
const newCoordinate = [...markCoordinates, viewCoordinate].reduceRight(
|
|
336
|
+
(prev, cur) => deepMix(prev, cur),
|
|
337
|
+
{},
|
|
338
|
+
);
|
|
339
|
+
const newInteraction = [viewInteraction, ...markInteractions].reduce(
|
|
340
|
+
(prev, cur) => deepMix(prev, cur),
|
|
341
|
+
{},
|
|
342
|
+
);
|
|
343
|
+
return {
|
|
344
|
+
...rest,
|
|
345
|
+
marks,
|
|
346
|
+
coordinate: newCoordinate,
|
|
347
|
+
interaction: newInteraction,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
async function transformMarks(
|
|
352
|
+
options: G2View,
|
|
353
|
+
library: G2Library,
|
|
354
|
+
): Promise<G2View> {
|
|
355
|
+
const [useMark, createMark] = useLibrary<G2MarkOptions, MarkComponent, Mark>(
|
|
356
|
+
'mark',
|
|
357
|
+
library,
|
|
358
|
+
);
|
|
359
|
+
|
|
360
|
+
const { marks } = options;
|
|
361
|
+
const flattenMarks = [];
|
|
362
|
+
const discovered = [...marks];
|
|
363
|
+
|
|
364
|
+
// Pre order traversal.
|
|
365
|
+
while (discovered.length) {
|
|
366
|
+
const [node] = discovered.splice(0, 1);
|
|
367
|
+
// Apply data transform to get data.
|
|
368
|
+
const mark = (await applyTransform(node, library)) as G2Mark;
|
|
369
|
+
const { type = error('G2Mark type is required.'), key } = mark;
|
|
370
|
+
const { props = {} } = createMark(type);
|
|
371
|
+
const { composite = true } = props;
|
|
372
|
+
if (!composite) flattenMarks.push(mark);
|
|
373
|
+
else {
|
|
374
|
+
// Convert composite mark to marks.
|
|
375
|
+
const marks = await (
|
|
376
|
+
useMark as (options: G2MarkOptions) => CompositeMark
|
|
377
|
+
)(mark)(options);
|
|
378
|
+
const M = Array.isArray(marks) ? marks : [marks];
|
|
379
|
+
discovered.unshift(...M.map((d, i) => ({ key: `${key}-${i}`, ...d })));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return { ...options, marks: flattenMarks };
|
|
271
384
|
}
|
|
272
385
|
|
|
273
386
|
async function initializeMarks(
|
|
@@ -278,7 +391,7 @@ async function initializeMarks(
|
|
|
278
391
|
'theme',
|
|
279
392
|
library,
|
|
280
393
|
);
|
|
281
|
-
const [
|
|
394
|
+
const [, createMark] = useLibrary<G2MarkOptions, MarkComponent, Mark>(
|
|
282
395
|
'mark',
|
|
283
396
|
library,
|
|
284
397
|
);
|
|
@@ -291,31 +404,10 @@ async function initializeMarks(
|
|
|
291
404
|
const theme = useTheme(inferTheme(partialTheme));
|
|
292
405
|
const markState = new Map<G2Mark, G2MarkState>();
|
|
293
406
|
|
|
294
|
-
// Apply data transform to get data.
|
|
295
|
-
const dataMarks = [];
|
|
296
|
-
for (const mark of partialMarks) {
|
|
297
|
-
const dataMark = await applyTransform(mark, library);
|
|
298
|
-
dataMarks.push(dataMark);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// Convert composite mark to single mark.
|
|
302
|
-
const flattenMarks = await Promise.all(
|
|
303
|
-
dataMarks.map(async (mark) => {
|
|
304
|
-
const { type = error('G2Mark type is required.'), key } = mark;
|
|
305
|
-
const { props } = createMark(type);
|
|
306
|
-
const { composite = false } = props;
|
|
307
|
-
if (!composite) return mark;
|
|
308
|
-
const marks = await (
|
|
309
|
-
useMark as (options: G2MarkOptions) => CompositeMark
|
|
310
|
-
)(mark)(options);
|
|
311
|
-
return marks.map((d, i) => ({ key: `${key}-${i}`, ...d }));
|
|
312
|
-
}),
|
|
313
|
-
).then((res) => res.flat());
|
|
314
|
-
|
|
315
407
|
// Initialize channels for marks.
|
|
316
|
-
for (const markOptions of
|
|
408
|
+
for (const markOptions of partialMarks) {
|
|
317
409
|
const { type } = markOptions;
|
|
318
|
-
const { props } = createMark(type);
|
|
410
|
+
const { props = {} } = createMark(type);
|
|
319
411
|
const markAndState = await initializeMark(markOptions, props, library);
|
|
320
412
|
if (markAndState) {
|
|
321
413
|
const [initializedMark, state] = markAndState;
|
|
@@ -374,16 +466,25 @@ function initializeState(
|
|
|
374
466
|
'mark',
|
|
375
467
|
library,
|
|
376
468
|
);
|
|
377
|
-
const [useScale] = useLibrary<G2ScaleOptions, ScaleComponent, Scale>(
|
|
378
|
-
'scale',
|
|
379
|
-
library,
|
|
380
|
-
);
|
|
381
469
|
const [useTheme] = useLibrary<G2ThemeOptions, ThemeComponent, Theme>(
|
|
382
470
|
'theme',
|
|
383
471
|
library,
|
|
384
472
|
);
|
|
473
|
+
const [useLabelTransform] = useLibrary<
|
|
474
|
+
G2LabelTransformOptions,
|
|
475
|
+
LabelTransformComponent,
|
|
476
|
+
LabelTransform
|
|
477
|
+
>('labelTransform', library);
|
|
478
|
+
|
|
479
|
+
const {
|
|
480
|
+
key,
|
|
481
|
+
frame = false,
|
|
482
|
+
theme: partialTheme,
|
|
483
|
+
clip,
|
|
484
|
+
style = {},
|
|
485
|
+
labelTransform = [],
|
|
486
|
+
} = options;
|
|
385
487
|
|
|
386
|
-
const { key, frame = false, theme: partialTheme, style = {} } = options;
|
|
387
488
|
const theme = useTheme(inferTheme(partialTheme));
|
|
388
489
|
|
|
389
490
|
// Infer components and compute layout.
|
|
@@ -396,7 +497,7 @@ function initializeState(
|
|
|
396
497
|
const layout = computeLayout(components, options);
|
|
397
498
|
const coordinate = createCoordinate(layout, options, library);
|
|
398
499
|
const framedStyle = frame
|
|
399
|
-
? deepMix({
|
|
500
|
+
? deepMix({ mainLineWidth: 1, mainStroke: '#000' }, style)
|
|
400
501
|
: style;
|
|
401
502
|
|
|
402
503
|
// Place components and mutate their bbox.
|
|
@@ -423,13 +524,9 @@ function initializeState(
|
|
|
423
524
|
const scale = Object.fromEntries(
|
|
424
525
|
channels.map(({ name, scale }) => [name, scale]),
|
|
425
526
|
);
|
|
426
|
-
|
|
427
527
|
// Transform abstract value to visual value by scales.
|
|
428
528
|
const markScaleInstance = mapObject(scale, (options) => {
|
|
429
|
-
|
|
430
|
-
const [conditionalize] = useRelation(relations);
|
|
431
|
-
const scale = useScale(options);
|
|
432
|
-
return conditionalize(scale);
|
|
529
|
+
return useRelationScale(options, library);
|
|
433
530
|
});
|
|
434
531
|
Object.assign(scaleInstance, markScaleInstance);
|
|
435
532
|
const value = applyScale(channels, markScaleInstance);
|
|
@@ -445,7 +542,13 @@ function initializeState(
|
|
|
445
542
|
const count = dataDomain || I.length;
|
|
446
543
|
const T = modifier ? modifier(P, count, layout) : [];
|
|
447
544
|
const visualData: Record<string, any>[] = I.map((d, i) => {
|
|
448
|
-
const datum = {
|
|
545
|
+
const datum = {
|
|
546
|
+
points: P[i],
|
|
547
|
+
transform: T[i],
|
|
548
|
+
index: d,
|
|
549
|
+
markKey,
|
|
550
|
+
viewKey: key,
|
|
551
|
+
};
|
|
449
552
|
for (const [k, V] of Object.entries(value)) {
|
|
450
553
|
datum[k] = V[d];
|
|
451
554
|
if (S) datum[`series${upperFirst(k)}`] = S[i].map((i) => V[i]);
|
|
@@ -473,23 +576,25 @@ function initializeState(
|
|
|
473
576
|
components,
|
|
474
577
|
markState,
|
|
475
578
|
key,
|
|
579
|
+
clip,
|
|
476
580
|
scale: scaleInstance,
|
|
477
581
|
style: framedStyle,
|
|
582
|
+
labelTransform: composeLabelTransform(
|
|
583
|
+
labelTransform.map(useLabelTransform),
|
|
584
|
+
),
|
|
478
585
|
};
|
|
479
586
|
|
|
480
587
|
return [view, children];
|
|
481
588
|
}
|
|
482
589
|
|
|
483
|
-
/**
|
|
484
|
-
* @todo Extract className as constants.
|
|
485
|
-
*/
|
|
486
590
|
async function plotView(
|
|
487
591
|
view: G2ViewDescriptor,
|
|
488
592
|
selection: Selection,
|
|
489
593
|
transitions: GAnimation[],
|
|
490
594
|
library: G2Library,
|
|
491
595
|
): Promise<void> {
|
|
492
|
-
const { components, theme, layout, markState, coordinate, key, style } =
|
|
596
|
+
const { components, theme, layout, markState, coordinate, key, style, clip } =
|
|
597
|
+
view;
|
|
493
598
|
|
|
494
599
|
// Render background for the different areas.
|
|
495
600
|
const { x, y, width, height, ...rest } = layout;
|
|
@@ -545,9 +650,14 @@ async function plotView(
|
|
|
545
650
|
(exit) => exit.remove(),
|
|
546
651
|
);
|
|
547
652
|
|
|
653
|
+
const animationExtent = computeAnimationExtent(markState);
|
|
654
|
+
|
|
655
|
+
const componentAnimateOptions = animationExtent
|
|
656
|
+
? { duration: animationExtent[1] }
|
|
657
|
+
: false;
|
|
548
658
|
// Render components.
|
|
549
659
|
// @todo renderComponent return ctor and options.
|
|
550
|
-
selection
|
|
660
|
+
const componentsTransitions = selection
|
|
551
661
|
.selectAll(className(COMPONENT_CLASS_NAME))
|
|
552
662
|
.data(components, (d, i) => `${d.type}-${i}`)
|
|
553
663
|
.join(
|
|
@@ -557,23 +667,31 @@ async function plotView(
|
|
|
557
667
|
.style('zIndex', ({ zIndex }) => zIndex || -1)
|
|
558
668
|
.attr('className', COMPONENT_CLASS_NAME)
|
|
559
669
|
.append((options) =>
|
|
560
|
-
renderComponent(
|
|
670
|
+
renderComponent(
|
|
671
|
+
deepMix({ animate: componentAnimateOptions }, options),
|
|
672
|
+
coordinate,
|
|
673
|
+
theme,
|
|
674
|
+
library,
|
|
675
|
+
),
|
|
561
676
|
),
|
|
562
677
|
(update) =>
|
|
563
|
-
update.
|
|
678
|
+
update.transition(function (options: G2GuideComponentOptions) {
|
|
679
|
+
const { preserve = false } = options;
|
|
680
|
+
if (preserve) return;
|
|
564
681
|
const newComponent = renderComponent(
|
|
565
|
-
options,
|
|
682
|
+
deepMix({ animate: componentAnimateOptions }, options),
|
|
566
683
|
coordinate,
|
|
567
684
|
theme,
|
|
568
685
|
library,
|
|
569
686
|
);
|
|
570
687
|
const { attributes } = newComponent;
|
|
571
688
|
const [node] = this.childNodes;
|
|
572
|
-
node.update(
|
|
689
|
+
return node.update(attributes);
|
|
573
690
|
}),
|
|
574
|
-
)
|
|
691
|
+
)
|
|
692
|
+
.transitions();
|
|
575
693
|
|
|
576
|
-
|
|
694
|
+
transitions.push(...componentsTransitions.flat().filter(defined));
|
|
577
695
|
|
|
578
696
|
// Main layer is for showing the main visual representation such as marks. There
|
|
579
697
|
// may be multiple main layers for a view, each main layer correspond to one of marks.
|
|
@@ -586,10 +704,12 @@ async function plotView(
|
|
|
586
704
|
enter
|
|
587
705
|
// Make this layer interactive, such as click and mousemove events.
|
|
588
706
|
.append('rect')
|
|
707
|
+
// todo zIndex
|
|
589
708
|
.style('fill', 'transparent')
|
|
590
709
|
.attr('className', PLOT_CLASS_NAME)
|
|
591
710
|
.call(updateBBox)
|
|
592
|
-
.call(updateLayers, Array.from(markState.keys()))
|
|
711
|
+
.call(updateLayers, Array.from(markState.keys()))
|
|
712
|
+
.call(applyClip, clip),
|
|
593
713
|
(update) =>
|
|
594
714
|
update
|
|
595
715
|
.call(updateLayers, Array.from(markState.keys()))
|
|
@@ -597,7 +717,8 @@ async function plotView(
|
|
|
597
717
|
return animationExtent
|
|
598
718
|
? animateBBox(selection, animationExtent)
|
|
599
719
|
: updateBBox(selection);
|
|
600
|
-
})
|
|
720
|
+
})
|
|
721
|
+
.call(applyClip, clip),
|
|
601
722
|
)
|
|
602
723
|
.transitions();
|
|
603
724
|
transitions.push(...T.flat());
|
|
@@ -643,12 +764,16 @@ async function plotView(
|
|
|
643
764
|
return animation;
|
|
644
765
|
});
|
|
645
766
|
}),
|
|
646
|
-
(exit) =>
|
|
647
|
-
exit
|
|
767
|
+
(exit) => {
|
|
768
|
+
return exit
|
|
769
|
+
.each(function () {
|
|
770
|
+
this.__removed__ = true;
|
|
771
|
+
})
|
|
648
772
|
.transition(function (data) {
|
|
649
773
|
return exitFunction(data, [this]);
|
|
650
774
|
})
|
|
651
|
-
.remove()
|
|
775
|
+
.remove();
|
|
776
|
+
},
|
|
652
777
|
(merge) =>
|
|
653
778
|
merge
|
|
654
779
|
// Append elements to be merged.
|
|
@@ -714,7 +839,9 @@ function plotLabel(
|
|
|
714
839
|
const elements = selection
|
|
715
840
|
.select(`#${key}`)
|
|
716
841
|
.selectAll(className(ELEMENT_CLASS_NAME))
|
|
717
|
-
.nodes()
|
|
842
|
+
.nodes()
|
|
843
|
+
// Only select the valid element.
|
|
844
|
+
.filter((n) => !n.__removed__);
|
|
718
845
|
return labelOptions.flatMap((labelOption, i) => {
|
|
719
846
|
const { transform = [], ...options } = labelOption;
|
|
720
847
|
return elements.flatMap((e) => {
|
|
@@ -755,7 +882,9 @@ function plotLabel(
|
|
|
755
882
|
const { coordinate } = view;
|
|
756
883
|
for (const [label, shapes] of labelGroups) {
|
|
757
884
|
const { transform = [] } = label;
|
|
758
|
-
const transformFunction =
|
|
885
|
+
const transformFunction = composeLabelTransform(
|
|
886
|
+
transform.map(useLabelTransform),
|
|
887
|
+
);
|
|
759
888
|
transformFunction(shapes, coordinate);
|
|
760
889
|
}
|
|
761
890
|
|
|
@@ -765,6 +894,15 @@ function plotLabel(
|
|
|
765
894
|
}
|
|
766
895
|
}
|
|
767
896
|
|
|
897
|
+
function composeLabelTransform(transform: LabelTransform[]): LabelTransform {
|
|
898
|
+
return (labels, coordinate) => {
|
|
899
|
+
for (const t of transform) {
|
|
900
|
+
labels = t(labels, coordinate);
|
|
901
|
+
}
|
|
902
|
+
return labels;
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
|
|
768
906
|
function getLabels(
|
|
769
907
|
label: Record<string, any>,
|
|
770
908
|
labelIndex: number,
|
|
@@ -773,7 +911,16 @@ function getLabels(
|
|
|
773
911
|
const { seriesIndex: SI, seriesKey, points, key, index } = element.__data__;
|
|
774
912
|
const bounds = getLocalBounds(element);
|
|
775
913
|
if (!SI) {
|
|
776
|
-
return [
|
|
914
|
+
return [
|
|
915
|
+
{
|
|
916
|
+
...label,
|
|
917
|
+
key: `${key}-${labelIndex}`,
|
|
918
|
+
bounds,
|
|
919
|
+
index,
|
|
920
|
+
points,
|
|
921
|
+
dependentElement: element,
|
|
922
|
+
},
|
|
923
|
+
];
|
|
777
924
|
}
|
|
778
925
|
const selector = normalizeLabelSelector(label);
|
|
779
926
|
const F = SI.map((index: number, i: number) => ({
|
|
@@ -782,6 +929,7 @@ function getLabels(
|
|
|
782
929
|
bounds: [points[i]],
|
|
783
930
|
index,
|
|
784
931
|
points,
|
|
932
|
+
dependentElement: element,
|
|
785
933
|
}));
|
|
786
934
|
return selector ? selector(F) : F;
|
|
787
935
|
}
|
|
@@ -854,9 +1002,15 @@ function createLabelShapeFunction(
|
|
|
854
1002
|
return (options) => {
|
|
855
1003
|
const { index, points } = options;
|
|
856
1004
|
const datum = abstractData[index];
|
|
857
|
-
const {
|
|
858
|
-
|
|
859
|
-
|
|
1005
|
+
const {
|
|
1006
|
+
formatter = (d) => `${d}`,
|
|
1007
|
+
transform,
|
|
1008
|
+
style: abstractStyle,
|
|
1009
|
+
...abstractOptions
|
|
1010
|
+
} = options;
|
|
1011
|
+
const visualOptions = mapObject(
|
|
1012
|
+
{ ...abstractOptions, ...abstractStyle } as Record<string, any>,
|
|
1013
|
+
(d) => valueOf(d, datum, index, abstractData),
|
|
860
1014
|
);
|
|
861
1015
|
const { shape = defaultLabelShape, text, ...style } = visualOptions;
|
|
862
1016
|
const f = typeof formatter === 'string' ? format(formatter) : formatter;
|
|
@@ -1118,16 +1272,14 @@ function inferTheme(theme: G2ThemeOptions = { type: 'light' }): G2ThemeOptions {
|
|
|
1118
1272
|
* @todo Infer builtin tooltips.
|
|
1119
1273
|
*/
|
|
1120
1274
|
function inferInteraction(view: G2View): G2InteractionOptions[] {
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
// }
|
|
1130
|
-
return interactions;
|
|
1275
|
+
const defaults = {};
|
|
1276
|
+
const { interaction = {} } = view;
|
|
1277
|
+
return Object.entries(deepMix(defaults, interaction))
|
|
1278
|
+
.filter((d) => !!d[1])
|
|
1279
|
+
.map(([key, value]) => ({
|
|
1280
|
+
type: key,
|
|
1281
|
+
...(value as Record<string, any>),
|
|
1282
|
+
}));
|
|
1131
1283
|
}
|
|
1132
1284
|
|
|
1133
1285
|
async function applyTransform<T extends G2ViewTree>(
|
|
@@ -1183,6 +1335,11 @@ function shapeName(mark: G2Mark, name: string): string {
|
|
|
1183
1335
|
*/
|
|
1184
1336
|
function updateLayers(selection: Selection, marks: G2Mark[]) {
|
|
1185
1337
|
const facet = (d) => (d.class !== undefined ? `${d.class}` : '');
|
|
1338
|
+
|
|
1339
|
+
// Skip for empty selection, it can't append nodes.
|
|
1340
|
+
const nodes = selection.nodes();
|
|
1341
|
+
if (nodes.length === 0) return;
|
|
1342
|
+
|
|
1186
1343
|
selection
|
|
1187
1344
|
.selectAll(className(MAIN_LAYER_CLASS_NAME))
|
|
1188
1345
|
.data(marks, (d) => d.key)
|
|
@@ -1193,8 +1350,13 @@ function updateLayers(selection: Selection, marks: G2Mark[]) {
|
|
|
1193
1350
|
.attr('className', MAIN_LAYER_CLASS_NAME)
|
|
1194
1351
|
.attr('id', (d) => d.key)
|
|
1195
1352
|
.style('facet', facet)
|
|
1196
|
-
.style('fill', 'transparent')
|
|
1197
|
-
|
|
1353
|
+
.style('fill', 'transparent')
|
|
1354
|
+
.style('zIndex', (d) => d.zIndex ?? 0),
|
|
1355
|
+
(update) =>
|
|
1356
|
+
update
|
|
1357
|
+
.style('facet', facet)
|
|
1358
|
+
.style('fill', 'transparent')
|
|
1359
|
+
.style('zIndex', (d) => d.zIndex ?? 0),
|
|
1198
1360
|
(exit) => exit.remove(),
|
|
1199
1361
|
);
|
|
1200
1362
|
|
|
@@ -1207,6 +1369,20 @@ function className(...names: string[]): string {
|
|
|
1207
1369
|
return names.map((d) => `.${d}`).join('');
|
|
1208
1370
|
}
|
|
1209
1371
|
|
|
1372
|
+
function applyClip(selection, clip?: boolean) {
|
|
1373
|
+
if (!selection.node()) return;
|
|
1374
|
+
selection.style('clipPath', (data) => {
|
|
1375
|
+
if (!clip) return null;
|
|
1376
|
+
const {
|
|
1377
|
+
paddingTop: y,
|
|
1378
|
+
paddingLeft: x,
|
|
1379
|
+
innerWidth: width,
|
|
1380
|
+
innerHeight: height,
|
|
1381
|
+
} = data;
|
|
1382
|
+
return new Rect({ style: { x, y, width, height } });
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1210
1386
|
export function applyStyle(
|
|
1211
1387
|
selection: Selection,
|
|
1212
1388
|
style: Record<string, Primitive>,
|