@antv/g2 5.0.0-alpha.4 → 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/README.md +29 -27
- 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 +2 -3
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/sankey.js +1 -0
- package/esm/mark/sankey.js.map +1 -1
- package/esm/mark/treemap.js +2 -3
- package/esm/mark/treemap.js.map +1 -1
- package/esm/mark/wordCloud.js +2 -2
- 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/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 +26 -11
- 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 +2 -3
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/sankey.js +1 -0
- package/lib/mark/sankey.js.map +1 -1
- package/lib/mark/treemap.js +2 -3
- package/lib/mark/treemap.js.map +1 -1
- package/lib/mark/wordCloud.js +2 -2
- 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/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 +26 -11
- 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 +1 -1
- package/src/mark/sankey.ts +1 -0
- package/src/mark/treemap.ts +1 -1
- package/src/mark/wordCloud.ts +1 -0
- 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 +31 -15
- 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/component/axis.ts
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { Coordinate
|
|
2
|
-
import {
|
|
1
|
+
import { Coordinate } from '@antv/coord';
|
|
2
|
+
import { Axis as AxisComponent } from '@antv/gui';
|
|
3
3
|
import { Linear as LinearScale } from '@antv/scale';
|
|
4
|
-
import { deepMix
|
|
5
|
-
import { format } from 'd3-format';
|
|
4
|
+
import { deepMix } from '@antv/util';
|
|
6
5
|
import { extent } from 'd3-array';
|
|
7
|
-
import {
|
|
8
|
-
isParallel,
|
|
9
|
-
isPolar,
|
|
10
|
-
isTranspose,
|
|
11
|
-
isTheta,
|
|
12
|
-
isRadial,
|
|
13
|
-
isFisheye,
|
|
14
|
-
} from '../utils/coordinate';
|
|
6
|
+
import { format } from 'd3-format';
|
|
15
7
|
import {
|
|
16
8
|
BBox,
|
|
9
|
+
G2Theme,
|
|
17
10
|
GuideComponentComponent as GCC,
|
|
18
|
-
|
|
11
|
+
GuideComponentOrientation as GCO,
|
|
12
|
+
GuideComponentPosition as GCP,
|
|
19
13
|
Scale,
|
|
20
14
|
} from '../runtime';
|
|
21
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
angleOf,
|
|
17
|
+
isFisheye,
|
|
18
|
+
isParallel,
|
|
19
|
+
isPolar,
|
|
20
|
+
isRadial,
|
|
21
|
+
isTheta,
|
|
22
|
+
isTranspose,
|
|
23
|
+
radiusOf,
|
|
24
|
+
} from '../utils/coordinate';
|
|
25
|
+
import { capitalizeFirst } from '../utils/helper';
|
|
26
|
+
import { titleContent } from './utils';
|
|
22
27
|
|
|
23
28
|
export type AxisOptions = {
|
|
24
|
-
position?:
|
|
29
|
+
position?: GCP;
|
|
25
30
|
zIndex?: number;
|
|
26
31
|
title?: string | string[];
|
|
27
32
|
direction?: 'left' | 'center' | 'right';
|
|
@@ -34,108 +39,11 @@ export type AxisOptions = {
|
|
|
34
39
|
) => number[];
|
|
35
40
|
tickCount?: number;
|
|
36
41
|
grid: any;
|
|
42
|
+
// options won't be overridden
|
|
43
|
+
important: Record<string, any>;
|
|
37
44
|
[key: string]: any;
|
|
38
45
|
};
|
|
39
46
|
|
|
40
|
-
function inferPosition(
|
|
41
|
-
position: GuideComponentPosition,
|
|
42
|
-
direction: string,
|
|
43
|
-
bbox: BBox,
|
|
44
|
-
coordinate: Coordinate,
|
|
45
|
-
): {
|
|
46
|
-
startPos: [number, number];
|
|
47
|
-
endPos: [number, number];
|
|
48
|
-
labelOffset: number;
|
|
49
|
-
titlePosition: 'start' | 'end' | 'center';
|
|
50
|
-
titlePadding: number;
|
|
51
|
-
titleRotate: number;
|
|
52
|
-
verticalFactor: 1 | -1;
|
|
53
|
-
titleOffsetY?: number;
|
|
54
|
-
labelAlign?: 'start' | 'end' | 'center' | 'left' | 'right';
|
|
55
|
-
label?: boolean;
|
|
56
|
-
axisLine?: boolean;
|
|
57
|
-
tickLine?: boolean;
|
|
58
|
-
} {
|
|
59
|
-
const { x, y, width, height } = bbox;
|
|
60
|
-
if (position === 'bottom') {
|
|
61
|
-
return {
|
|
62
|
-
startPos: [x, y],
|
|
63
|
-
endPos: [x + width, y],
|
|
64
|
-
labelOffset: 8,
|
|
65
|
-
titlePosition: 'end',
|
|
66
|
-
titlePadding: 2,
|
|
67
|
-
titleRotate: 0,
|
|
68
|
-
verticalFactor: 1,
|
|
69
|
-
};
|
|
70
|
-
} else if (position === 'left' || position === 'centerHorizontal') {
|
|
71
|
-
return {
|
|
72
|
-
startPos: [x + width, y],
|
|
73
|
-
endPos: [x + width, y + height],
|
|
74
|
-
titlePosition: 'center',
|
|
75
|
-
titlePadding: 6,
|
|
76
|
-
titleRotate: -90,
|
|
77
|
-
labelAlign: 'end',
|
|
78
|
-
labelOffset: 4,
|
|
79
|
-
verticalFactor: -1,
|
|
80
|
-
};
|
|
81
|
-
} else if (position === 'right') {
|
|
82
|
-
return {
|
|
83
|
-
startPos: [x, y],
|
|
84
|
-
endPos: [x, y + height],
|
|
85
|
-
titlePosition: 'center',
|
|
86
|
-
titlePadding: 16,
|
|
87
|
-
titleRotate: -90,
|
|
88
|
-
labelAlign: 'start',
|
|
89
|
-
labelOffset: 4,
|
|
90
|
-
verticalFactor: 1,
|
|
91
|
-
};
|
|
92
|
-
} else if (position === 'arcY') {
|
|
93
|
-
return {
|
|
94
|
-
startPos: [x, y],
|
|
95
|
-
endPos: [x + width, y + height],
|
|
96
|
-
titlePosition: 'start',
|
|
97
|
-
titlePadding: 4,
|
|
98
|
-
titleOffsetY: -5,
|
|
99
|
-
titleRotate: 0,
|
|
100
|
-
labelOffset: direction === 'left' ? 4 : direction === 'right' ? -4 : 0,
|
|
101
|
-
verticalFactor: -1,
|
|
102
|
-
labelAlign:
|
|
103
|
-
direction === 'center'
|
|
104
|
-
? 'center'
|
|
105
|
-
: direction === 'right'
|
|
106
|
-
? 'start'
|
|
107
|
-
: undefined,
|
|
108
|
-
axisLine: false,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
// position === 'centerVertical'
|
|
112
|
-
return {
|
|
113
|
-
startPos: [x, y + height],
|
|
114
|
-
endPos: [x + width, y + height],
|
|
115
|
-
titlePosition: 'end',
|
|
116
|
-
titlePadding: 2,
|
|
117
|
-
titleRotate: 0,
|
|
118
|
-
labelOffset: 4,
|
|
119
|
-
verticalFactor: -1,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function angleOf(coordinate: Coordinate): [number, number] {
|
|
124
|
-
const { transformations } = coordinate.getOptions();
|
|
125
|
-
const [, startAngle, endAngle] = transformations.find(
|
|
126
|
-
(d) => d[0] === 'polar',
|
|
127
|
-
);
|
|
128
|
-
return [(+startAngle * 180) / Math.PI, (+endAngle * 180) / Math.PI];
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function radiusOf(coordinate: Coordinate): [number, number] {
|
|
132
|
-
const { transformations } = coordinate.getOptions();
|
|
133
|
-
const [, , , innerRadius, outerRadius] = transformations.find(
|
|
134
|
-
(d) => d[0] === 'polar',
|
|
135
|
-
);
|
|
136
|
-
return [+innerRadius, +outerRadius];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
47
|
function sizeOf(coordinate: Coordinate): [number, number] {
|
|
140
48
|
// @ts-ignore
|
|
141
49
|
const { innerWidth, innerHeight } = coordinate.getOptions();
|
|
@@ -143,12 +51,9 @@ function sizeOf(coordinate: Coordinate): [number, number] {
|
|
|
143
51
|
}
|
|
144
52
|
|
|
145
53
|
function reverseTicks(ticks) {
|
|
146
|
-
return ticks.map(({ value,
|
|
54
|
+
return ticks.map(({ value, ...rest }) => ({ value: 1 - value, ...rest }));
|
|
147
55
|
}
|
|
148
56
|
|
|
149
|
-
/**
|
|
150
|
-
* @todo More position besides bottom and left.
|
|
151
|
-
*/
|
|
152
57
|
function createFisheye(position, coordinate) {
|
|
153
58
|
const { width, height } = coordinate.getOptions();
|
|
154
59
|
return (tick) => {
|
|
@@ -186,6 +91,14 @@ function ticksOf(
|
|
|
186
91
|
return tickMethod(min, max, tickCount);
|
|
187
92
|
}
|
|
188
93
|
|
|
94
|
+
function isHorizontal(orientation: GCO) {
|
|
95
|
+
return orientation === 'horizontal' || orientation === 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function isVertical(orientation: GCO) {
|
|
99
|
+
return orientation === 'vertical' || orientation === -Math.PI / 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
189
102
|
function prettyNumber(n: number) {
|
|
190
103
|
if (typeof n !== 'number') return n;
|
|
191
104
|
return Math.abs(n) < 1e-15 ? n : parseFloat(n.toFixed(15));
|
|
@@ -215,8 +128,6 @@ function createInset(position, coordinate) {
|
|
|
215
128
|
|
|
216
129
|
/**
|
|
217
130
|
* Calc ticks based on scale and coordinate.
|
|
218
|
-
* @todo Parallel coordinate.
|
|
219
|
-
* @todo More position besides bottom and left.
|
|
220
131
|
*/
|
|
221
132
|
function getTicks(
|
|
222
133
|
scale: Scale,
|
|
@@ -225,7 +136,7 @@ function getTicks(
|
|
|
225
136
|
defaultTickFormatter: AxisOptions['labelFormatter'],
|
|
226
137
|
tickFilter: AxisOptions['tickFilter'],
|
|
227
138
|
tickMethod: AxisOptions['tickMethod'],
|
|
228
|
-
position:
|
|
139
|
+
position: GCP,
|
|
229
140
|
coordinate: Coordinate,
|
|
230
141
|
) {
|
|
231
142
|
if (tickCount !== undefined || tickMethod !== undefined) {
|
|
@@ -247,12 +158,13 @@ function getTicks(
|
|
|
247
158
|
const tick = applyInset(scale.map(d) + offset);
|
|
248
159
|
return {
|
|
249
160
|
value: isTranspose(coordinate) && scale.getTicks?.() ? 1 - tick : tick,
|
|
250
|
-
|
|
161
|
+
label: labelFormatter(d, i, array),
|
|
162
|
+
id: String(i),
|
|
251
163
|
};
|
|
252
164
|
});
|
|
253
165
|
// @todo GUI should consider the overlap problem for the first
|
|
254
166
|
// and label of arc axis.
|
|
255
|
-
return isRadial(coordinate) && position === '
|
|
167
|
+
return isRadial(coordinate) && position === 'center'
|
|
256
168
|
? reverseTicks(axisTicks)
|
|
257
169
|
: axisTicks;
|
|
258
170
|
}
|
|
@@ -262,105 +174,182 @@ function getTicks(
|
|
|
262
174
|
const tick = applyFisheye(applyInset(scale.map(d) + offset));
|
|
263
175
|
return {
|
|
264
176
|
value: tick,
|
|
265
|
-
|
|
177
|
+
label: `${labelFormatter(prettyNumber(d), i, array)}`,
|
|
178
|
+
id: String(i),
|
|
266
179
|
};
|
|
267
180
|
});
|
|
268
181
|
}
|
|
269
182
|
|
|
270
|
-
function
|
|
271
|
-
tick: number,
|
|
272
|
-
position: GuideComponentPosition,
|
|
273
|
-
coordinate: Coordinate,
|
|
274
|
-
startPos: Vector2,
|
|
275
|
-
endPos: Vector2,
|
|
276
|
-
) {
|
|
277
|
-
const [sx, sy] = startPos;
|
|
278
|
-
const [ex, ey] = endPos;
|
|
183
|
+
function inferGridLength(position: GCP, coordinate: Coordinate) {
|
|
279
184
|
const [width, height] = sizeOf(coordinate);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
x1 = x2 = sx + (ex - sx) * tick;
|
|
283
|
-
y1 = sy;
|
|
284
|
-
y2 = position === 'bottom' ? sy - height : sy + height;
|
|
285
|
-
} else {
|
|
286
|
-
y1 = y2 = sy + (ey - sy) * tick;
|
|
287
|
-
x1 = sx;
|
|
288
|
-
x2 = position === 'left' ? sx + width : sx - width;
|
|
289
|
-
}
|
|
290
|
-
return [
|
|
291
|
-
[x1, y1],
|
|
292
|
-
[x2, y2],
|
|
293
|
-
];
|
|
185
|
+
if (position.includes('bottom') || position.includes('top')) return height;
|
|
186
|
+
return width;
|
|
294
187
|
}
|
|
295
188
|
|
|
296
|
-
function
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
189
|
+
function labelTransforms(autoHide?: boolean, autoRotate?: boolean) {
|
|
190
|
+
const transforms = [];
|
|
191
|
+
if (autoHide) transforms.push({ type: 'hide' });
|
|
192
|
+
if (autoRotate)
|
|
193
|
+
transforms.push({ type: 'rotate', optionalAngles: [0, 30, 45, 60, 90] });
|
|
194
|
+
return transforms;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function inferArcStyle(
|
|
198
|
+
position: GCP,
|
|
199
|
+
bbox: BBox,
|
|
301
200
|
innerRadius: number,
|
|
302
201
|
outerRadius: number,
|
|
303
202
|
coordinate: Coordinate,
|
|
304
203
|
) {
|
|
305
|
-
const
|
|
204
|
+
const { x, y, width, height } = bbox;
|
|
205
|
+
const center: [number, number] = [x + width / 2, y + height / 2];
|
|
206
|
+
const radius = Math.min(width, height) / 2;
|
|
207
|
+
const [startAngle, endAngle] = angleOf(coordinate);
|
|
208
|
+
|
|
306
209
|
const [w, h] = sizeOf(coordinate);
|
|
307
210
|
const r = Math.min(w, h) / 2;
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
211
|
+
|
|
212
|
+
const common = {
|
|
213
|
+
center,
|
|
214
|
+
radius,
|
|
215
|
+
angleRange: [startAngle, endAngle],
|
|
216
|
+
titleFillOpacity: 0,
|
|
217
|
+
titlePosition: 'inner',
|
|
218
|
+
showLine: false,
|
|
219
|
+
showTick: true,
|
|
220
|
+
gridLength: (outerRadius - innerRadius) * r,
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
if (position === 'inner') {
|
|
224
|
+
const [w, h] = sizeOf(coordinate);
|
|
225
|
+
const r = Math.min(w, h) / 2;
|
|
314
226
|
return {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
227
|
+
...common,
|
|
228
|
+
labelAlign: 'perpendicular',
|
|
229
|
+
labelDirection: 'positive',
|
|
230
|
+
labelSpacing: 4,
|
|
231
|
+
tickDirection: 'positive',
|
|
232
|
+
gridDirection: 'negative',
|
|
319
233
|
};
|
|
320
|
-
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// arc outer
|
|
237
|
+
return {
|
|
238
|
+
...common,
|
|
239
|
+
labelAlign: 'parallel',
|
|
240
|
+
labelDirection: 'negative',
|
|
241
|
+
labelSpacing: 8,
|
|
242
|
+
tickDirection: 'negative',
|
|
243
|
+
gridDirection: 'positive',
|
|
244
|
+
};
|
|
321
245
|
}
|
|
322
246
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
ticks: any[],
|
|
328
|
-
position: GuideComponentPosition,
|
|
329
|
-
coordinate: any,
|
|
330
|
-
startPos: Vector2,
|
|
331
|
-
endPos: Vector2,
|
|
332
|
-
) {
|
|
333
|
-
if (isTheta(coordinate) || isParallel(coordinate)) return [];
|
|
334
|
-
return ticks.map((tick) => {
|
|
335
|
-
const points = getTickGridItem(
|
|
336
|
-
tick.value,
|
|
337
|
-
position,
|
|
338
|
-
coordinate,
|
|
339
|
-
startPos,
|
|
340
|
-
endPos,
|
|
341
|
-
);
|
|
342
|
-
const finalPoints = isPolar(coordinate) ? [points[0]] : points;
|
|
343
|
-
return { points: finalPoints };
|
|
344
|
-
});
|
|
247
|
+
function inferGrid(value: boolean, coordinate: Coordinate, scale: Scale) {
|
|
248
|
+
if (isTheta(coordinate) || isParallel(coordinate)) return false;
|
|
249
|
+
// Display axis grid for non-discrete values.
|
|
250
|
+
return value === undefined ? !!scale.getTicks : value;
|
|
345
251
|
}
|
|
346
252
|
|
|
347
|
-
function
|
|
348
|
-
|
|
253
|
+
function inferAxisLinearOverrideStyle(
|
|
254
|
+
position: GCP,
|
|
255
|
+
orientation: GCO,
|
|
256
|
+
bbox: BBox,
|
|
257
|
+
coordinate: Coordinate,
|
|
258
|
+
): {
|
|
259
|
+
startPos?: [number, number];
|
|
260
|
+
endPos?: [number, number];
|
|
261
|
+
showLine?: boolean;
|
|
262
|
+
[k: string]: any;
|
|
263
|
+
} {
|
|
264
|
+
const { x, y, width, height } = bbox;
|
|
265
|
+
|
|
266
|
+
if (position === 'bottom') {
|
|
267
|
+
return { startPos: [x, y], endPos: [x + width, y] };
|
|
268
|
+
}
|
|
269
|
+
if (position === 'left') {
|
|
270
|
+
return { startPos: [x + width, y], endPos: [x + width, y + height] };
|
|
271
|
+
}
|
|
272
|
+
if (position === 'right') {
|
|
273
|
+
return { endPos: [x, y + height], startPos: [x, y] };
|
|
274
|
+
}
|
|
275
|
+
if (position === 'top') {
|
|
276
|
+
return { startPos: [x, y + height], endPos: [x + width, y + height] };
|
|
277
|
+
}
|
|
278
|
+
// linear axis, maybe in parallel, polar, radial or radar systems.
|
|
279
|
+
if (position === 'center') {
|
|
280
|
+
// axisY
|
|
281
|
+
if (orientation === 'vertical') {
|
|
282
|
+
return {
|
|
283
|
+
startPos: [x + width, y],
|
|
284
|
+
endPos: [x + width, y + height],
|
|
285
|
+
showLine: true,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
// axisX
|
|
289
|
+
else if (orientation === 'horizontal') {
|
|
290
|
+
return {
|
|
291
|
+
startPos: [x, y + height],
|
|
292
|
+
endPos: [x + width, y + height],
|
|
293
|
+
showLine: true,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
// axis with rotate
|
|
297
|
+
else if (typeof orientation === 'number') {
|
|
298
|
+
const [cx, cy] = coordinate.getCenter();
|
|
299
|
+
const [innerRadius, outerRadius] = radiusOf(coordinate);
|
|
300
|
+
const [startAngle, endAngle] = angleOf(coordinate);
|
|
301
|
+
const r = height / 2;
|
|
302
|
+
|
|
303
|
+
const innerR = innerRadius * r;
|
|
304
|
+
const outerR = outerRadius * r;
|
|
305
|
+
|
|
306
|
+
const [actualCx, actualCy] = [cx + x, cy + y];
|
|
307
|
+
const [cos, sin] = [Math.cos(orientation), Math.sin(orientation)];
|
|
308
|
+
|
|
309
|
+
const startPos: [number, number] = [
|
|
310
|
+
actualCx + outerR * cos,
|
|
311
|
+
actualCy + outerR * sin,
|
|
312
|
+
];
|
|
313
|
+
const endPos: [number, number] = [
|
|
314
|
+
actualCx + innerR * cos,
|
|
315
|
+
actualCy + innerR * sin,
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
return {
|
|
319
|
+
startPos,
|
|
320
|
+
endPos,
|
|
321
|
+
gridClosed: endAngle - startAngle === 360,
|
|
322
|
+
gridCenter: [cx + x, y + cy],
|
|
323
|
+
gridControlAngles: new Array(3)
|
|
324
|
+
.fill(0)
|
|
325
|
+
.map((d, i, arr) => ((endAngle - startAngle) / (arr.length - 1)) * i),
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// position is inner or outer for arc axis won't be here
|
|
331
|
+
|
|
332
|
+
return {};
|
|
349
333
|
}
|
|
350
334
|
|
|
351
|
-
const
|
|
335
|
+
const ArcAxisComponent: GCC<AxisOptions> = (options) => {
|
|
352
336
|
const {
|
|
337
|
+
order,
|
|
338
|
+
size,
|
|
353
339
|
position,
|
|
340
|
+
orientation,
|
|
354
341
|
labelFormatter = (d) => `${d}`,
|
|
355
342
|
tickFilter,
|
|
356
343
|
tickCount,
|
|
357
344
|
tickMethod,
|
|
345
|
+
title,
|
|
346
|
+
grid: showGrid = false,
|
|
347
|
+
important = {},
|
|
358
348
|
...rest
|
|
359
349
|
} = options;
|
|
360
|
-
return (scale, value, coordinate, theme) => {
|
|
361
|
-
const {
|
|
362
|
-
const {
|
|
363
|
-
const center: [number, number] = [x + width / 2, y + height / 2];
|
|
350
|
+
return ([scale], value, coordinate, theme) => {
|
|
351
|
+
const { bbox } = value;
|
|
352
|
+
const { domain } = scale.getOptions();
|
|
364
353
|
const ticks = getTicks(
|
|
365
354
|
scale,
|
|
366
355
|
domain,
|
|
@@ -372,103 +361,107 @@ const ArcAxis = (options) => {
|
|
|
372
361
|
coordinate,
|
|
373
362
|
);
|
|
374
363
|
|
|
375
|
-
const radius = Math.min(width, height) / 2;
|
|
376
|
-
const [startAngle, endAngle] = angleOf(coordinate);
|
|
377
364
|
const [innerRadius, outerRadius] = radiusOf(coordinate);
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
endAngle,
|
|
398
|
-
ticks,
|
|
399
|
-
verticalFactor: position === 'arc' ? 1 : -1,
|
|
400
|
-
axisLine: {
|
|
401
|
-
style: {
|
|
402
|
-
lineWidth: 0,
|
|
403
|
-
strokeOpacity: 0,
|
|
404
|
-
...subObject(rest, 'line'),
|
|
405
|
-
},
|
|
406
|
-
},
|
|
407
|
-
grid: {
|
|
408
|
-
items: gridItems,
|
|
409
|
-
lineStyle: {
|
|
410
|
-
stroke: '#1b1e23',
|
|
411
|
-
strokeOpacity: 0.1,
|
|
412
|
-
lineDash: [0, 0],
|
|
413
|
-
...subObject(rest, 'grid'),
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
tickLine: {
|
|
417
|
-
len: 4,
|
|
418
|
-
style: {
|
|
419
|
-
lineWidth: 1,
|
|
420
|
-
stroke: '#BFBFBF',
|
|
421
|
-
...subObject(rest, 'tick'),
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
label: {
|
|
425
|
-
// @todo fix bug in @antv/gui related to tangential.
|
|
426
|
-
align: position === 'arcInner' ? 'radial' : 'tangential',
|
|
427
|
-
tickPadding: 2,
|
|
428
|
-
style: subObject(rest, 'label'),
|
|
429
|
-
},
|
|
430
|
-
},
|
|
431
|
-
),
|
|
365
|
+
|
|
366
|
+
const defaultStyle = inferArcStyle(
|
|
367
|
+
position,
|
|
368
|
+
bbox,
|
|
369
|
+
innerRadius,
|
|
370
|
+
outerRadius,
|
|
371
|
+
coordinate,
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
const { axis: axisTheme } = theme;
|
|
375
|
+
return new AxisComponent({
|
|
376
|
+
style: deepMix({}, axisTheme, defaultStyle, {
|
|
377
|
+
type: 'arc',
|
|
378
|
+
data: ticks,
|
|
379
|
+
title: titleContent(title),
|
|
380
|
+
showGrid,
|
|
381
|
+
...rest,
|
|
382
|
+
...important,
|
|
383
|
+
}),
|
|
432
384
|
});
|
|
433
385
|
};
|
|
434
386
|
};
|
|
435
387
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
const
|
|
445
|
-
|
|
388
|
+
function inferThemeStyle(
|
|
389
|
+
scale: Scale,
|
|
390
|
+
coordinate: Coordinate,
|
|
391
|
+
theme: G2Theme,
|
|
392
|
+
direction,
|
|
393
|
+
position: GCP,
|
|
394
|
+
orientation: GCO,
|
|
395
|
+
) {
|
|
396
|
+
const baseStyle = theme.axis;
|
|
397
|
+
let furtherStyle = theme.axisLinear;
|
|
398
|
+
|
|
399
|
+
if (['top', 'right', 'bottom', 'left'].includes(position)) {
|
|
400
|
+
furtherStyle = theme[`axis${capitalizeFirst(position)}`];
|
|
401
|
+
}
|
|
402
|
+
return Object.assign({}, baseStyle, furtherStyle);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function inferDefaultStyle(
|
|
406
|
+
scale: Scale,
|
|
407
|
+
coordinate: Coordinate,
|
|
408
|
+
theme: G2Theme,
|
|
409
|
+
direction,
|
|
410
|
+
position: GCP,
|
|
411
|
+
orientation: GCO,
|
|
412
|
+
) {
|
|
413
|
+
const themeStyle = inferThemeStyle(
|
|
414
|
+
scale,
|
|
415
|
+
coordinate,
|
|
416
|
+
theme,
|
|
417
|
+
direction,
|
|
446
418
|
position,
|
|
447
|
-
|
|
448
|
-
|
|
419
|
+
orientation,
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
if (position === 'bottom') {
|
|
423
|
+
return {
|
|
424
|
+
...themeStyle,
|
|
425
|
+
titlePosition: scale.getTicks ? 'right-bottom' : 'bottom',
|
|
426
|
+
titleTransformOrigin: 'center',
|
|
427
|
+
titleTransform: scale.getTicks ? 'translate(-100%, 0)' : undefined,
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
if (position === 'center') {
|
|
431
|
+
return {
|
|
432
|
+
...themeStyle,
|
|
433
|
+
labelDirection: direction === 'right' ? 'negative' : 'positive',
|
|
434
|
+
labelTransform: direction === 'center' ? 'translate(50%, 0)' : '',
|
|
435
|
+
tickDirection: direction === 'right' ? 'negative' : 'positive',
|
|
436
|
+
labelSpacing: direction === 'center' ? 0 : 4,
|
|
437
|
+
titleSpacing: isVertical(orientation) ? 10 : 0,
|
|
438
|
+
tick: direction === 'center' ? false : undefined,
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
return themeStyle;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const LinearAxisComponent: GCC<AxisOptions> = (options) => {
|
|
445
|
+
const {
|
|
449
446
|
direction = 'left',
|
|
447
|
+
important = {},
|
|
448
|
+
labelFormatter = (d) => `${d}`,
|
|
449
|
+
order,
|
|
450
|
+
orientation,
|
|
451
|
+
position,
|
|
452
|
+
size,
|
|
450
453
|
tickCount,
|
|
451
454
|
tickFilter,
|
|
452
455
|
tickMethod,
|
|
453
|
-
|
|
454
|
-
|
|
456
|
+
title,
|
|
457
|
+
transform,
|
|
458
|
+
...userDefinitions
|
|
455
459
|
} = options;
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
labelOffset,
|
|
462
|
-
titlePosition,
|
|
463
|
-
titlePadding,
|
|
464
|
-
titleRotate,
|
|
465
|
-
verticalFactor,
|
|
466
|
-
titleOffsetY,
|
|
467
|
-
labelAlign,
|
|
468
|
-
axisLine,
|
|
469
|
-
label = options.label === undefined ? true : options.label,
|
|
470
|
-
tickLine = options.tickLine === undefined ? true : options.tickLine,
|
|
471
|
-
} = inferPosition(position, direction, bbox, coordinate);
|
|
460
|
+
|
|
461
|
+
return ([scale], value, coordinate, theme) => {
|
|
462
|
+
const { bbox } = value;
|
|
463
|
+
const { domain } = scale.getOptions();
|
|
464
|
+
|
|
472
465
|
const ticks = getTicks(
|
|
473
466
|
scale,
|
|
474
467
|
domain,
|
|
@@ -479,100 +472,82 @@ const LinearAxis: GCC<AxisOptions> = (options) => {
|
|
|
479
472
|
position,
|
|
480
473
|
coordinate,
|
|
481
474
|
);
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
style: {
|
|
531
|
-
lineWidth: 1,
|
|
532
|
-
stroke: '#BFBFBF',
|
|
533
|
-
...subObject(rest, 'tick'),
|
|
534
|
-
},
|
|
535
|
-
}
|
|
536
|
-
: null,
|
|
537
|
-
...(title && {
|
|
538
|
-
title: {
|
|
539
|
-
content: titleContent(title),
|
|
540
|
-
// content: 'a',
|
|
541
|
-
titleAnchor: titleAnchor || anchor,
|
|
542
|
-
style: {
|
|
543
|
-
fontWeight: 'bold',
|
|
544
|
-
fillOpacity: 1,
|
|
545
|
-
dy: titleOffsetY,
|
|
546
|
-
textAnchor: anchor,
|
|
547
|
-
...subObject(rest, 'title'),
|
|
548
|
-
},
|
|
549
|
-
titlePadding,
|
|
550
|
-
rotate: titleRotate,
|
|
551
|
-
},
|
|
552
|
-
}),
|
|
553
|
-
}),
|
|
475
|
+
|
|
476
|
+
const defaultStyle = inferDefaultStyle(
|
|
477
|
+
scale,
|
|
478
|
+
coordinate,
|
|
479
|
+
theme,
|
|
480
|
+
direction,
|
|
481
|
+
position,
|
|
482
|
+
orientation,
|
|
483
|
+
);
|
|
484
|
+
const {
|
|
485
|
+
labelAutoRotate = true,
|
|
486
|
+
labelAutoHide = false,
|
|
487
|
+
label: showLabel = true,
|
|
488
|
+
tick: showTick = true,
|
|
489
|
+
line = false,
|
|
490
|
+
grid,
|
|
491
|
+
} = Object.assign({}, defaultStyle, userDefinitions);
|
|
492
|
+
|
|
493
|
+
const showGrid = inferGrid(grid, coordinate, scale);
|
|
494
|
+
const gridLength = inferGridLength(position, coordinate);
|
|
495
|
+
|
|
496
|
+
const { showLine = line, ...overrideStyle } = inferAxisLinearOverrideStyle(
|
|
497
|
+
position,
|
|
498
|
+
orientation,
|
|
499
|
+
bbox,
|
|
500
|
+
coordinate,
|
|
501
|
+
);
|
|
502
|
+
const axisStyle = {
|
|
503
|
+
...defaultStyle,
|
|
504
|
+
type: 'linear' as const,
|
|
505
|
+
data: ticks,
|
|
506
|
+
title: titleContent(title),
|
|
507
|
+
showLabel,
|
|
508
|
+
labelTransforms: labelTransforms(labelAutoHide, labelAutoRotate),
|
|
509
|
+
showGrid,
|
|
510
|
+
showTick,
|
|
511
|
+
gridLength,
|
|
512
|
+
...userDefinitions,
|
|
513
|
+
// Always showLine, make title could align the end of axis.
|
|
514
|
+
showLine: true,
|
|
515
|
+
...(!showLine ? { lineOpacity: 0 } : null),
|
|
516
|
+
...overrideStyle,
|
|
517
|
+
...important,
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
return new AxisComponent({
|
|
521
|
+
className: 'axis',
|
|
522
|
+
style: axisStyle,
|
|
554
523
|
});
|
|
555
524
|
};
|
|
556
525
|
};
|
|
557
526
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
const normalizedOptions = { ...options, labelFormatter };
|
|
567
|
-
return (scale, value, coordinate, theme) => {
|
|
568
|
-
return position === 'arc' || position === 'arcInner'
|
|
569
|
-
? ArcAxis(normalizedOptions)(scale, value, coordinate, theme)
|
|
570
|
-
: LinearAxis(normalizedOptions)(scale, value, coordinate, theme);
|
|
527
|
+
const axisFactor: (
|
|
528
|
+
axis: typeof ArcAxisComponent | typeof LinearAxisComponent,
|
|
529
|
+
) => GCC<AxisOptions> = (axis) => {
|
|
530
|
+
return (options) => {
|
|
531
|
+
const { labelFormatter: f = (d) => `${d}` } = options;
|
|
532
|
+
const labelFormatter = typeof f === 'string' ? format(f) : f;
|
|
533
|
+
const normalizedOptions = { ...options, labelFormatter };
|
|
534
|
+
return (...args) => axis(normalizedOptions)(...args);
|
|
571
535
|
};
|
|
572
536
|
};
|
|
573
537
|
|
|
574
|
-
|
|
575
|
-
|
|
538
|
+
export const LinearAxis = axisFactor(LinearAxisComponent);
|
|
539
|
+
|
|
540
|
+
export const ArcAxis = axisFactor(ArcAxisComponent);
|
|
541
|
+
|
|
542
|
+
LinearAxis.props = {
|
|
543
|
+
defaultPosition: 'center',
|
|
544
|
+
defaultSize: 45,
|
|
545
|
+
defaultOrder: 0,
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
ArcAxis.props = {
|
|
549
|
+
defaultPosition: 'outer',
|
|
550
|
+
defaultOrientation: 'vertical',
|
|
576
551
|
defaultSize: 45,
|
|
577
552
|
defaultOrder: 0,
|
|
578
553
|
};
|