@antv/g2 5.0.0-rc.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.en-US.md +5 -5
- package/README.md +5 -7
- package/dist/g2-lite.min.js +3 -3
- package/dist/g2.min.js +3 -3
- package/esm/api/chart.d.ts +5 -3
- package/esm/api/chart.js +14 -11
- package/esm/api/chart.js.map +1 -1
- package/esm/api/composition/base.d.ts +7 -1
- package/esm/api/composition/base.js +26 -0
- package/esm/api/composition/base.js.map +1 -1
- package/esm/component/axis.js +41 -27
- package/esm/component/axis.js.map +1 -1
- package/esm/component/axisRadar.js +4 -3
- package/esm/component/axisRadar.js.map +1 -1
- package/esm/component/axisX.js.map +1 -1
- package/esm/component/legendCategory.js +61 -36
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.js +8 -6
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/component/legendContinuousBlockSize.js +1 -1
- package/esm/component/legendContinuousBlockSize.js.map +1 -1
- package/esm/component/legendContinuousSize.js +1 -1
- package/esm/component/legendContinuousSize.js.map +1 -1
- package/esm/component/scrollbar.js +1 -1
- package/esm/component/scrollbar.js.map +1 -1
- package/esm/component/slider.js +1 -1
- package/esm/component/slider.js.map +1 -1
- package/esm/component/title.js +13 -2
- package/esm/component/title.js.map +1 -1
- package/esm/component/utils.d.ts +1 -0
- package/esm/component/utils.js +25 -1
- package/esm/component/utils.js.map +1 -1
- package/esm/coordinate/fisheye.js +1 -1
- package/esm/coordinate/fisheye.js.map +1 -1
- package/esm/interaction/brushFilter.js +1 -1
- package/esm/interaction/brushFilter.js.map +1 -1
- package/esm/interaction/fisheye.js +1 -1
- package/esm/interaction/fisheye.js.map +1 -1
- package/esm/interaction/legendFilter.d.ts +1 -1
- package/esm/interaction/legendFilter.js +33 -27
- package/esm/interaction/legendFilter.js.map +1 -1
- package/esm/interaction/sliderFilter.js +2 -2
- package/esm/interaction/sliderFilter.js.map +1 -1
- package/esm/interaction/tooltip.d.ts +1 -1
- package/esm/interaction/tooltip.js +5 -3
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/mark/boxplot.js +2 -2
- package/esm/mark/boxplot.js.map +1 -1
- package/esm/runtime/component.d.ts +3 -3
- package/esm/runtime/component.js +4 -4
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/plot.js +2 -2
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.d.ts +1 -1
- package/esm/runtime/render.js +19 -3
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/types/common.d.ts +12 -9
- package/esm/runtime/types/component.d.ts +13 -4
- package/esm/shape/area/area.js +1 -1
- package/esm/shape/area/area.js.map +1 -1
- package/esm/shape/area/curve.js +2 -1
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/area/hv.js +1 -1
- package/esm/shape/area/hv.js.map +1 -1
- package/esm/shape/area/hvh.js +1 -1
- package/esm/shape/area/hvh.js.map +1 -1
- package/esm/shape/area/smooth.js +1 -1
- package/esm/shape/area/smooth.js.map +1 -1
- package/esm/shape/area/vh.js +1 -1
- package/esm/shape/area/vh.js.map +1 -1
- package/esm/shape/box/box.js +1 -0
- package/esm/shape/box/box.js.map +1 -1
- package/esm/shape/connector/connector.d.ts +2 -2
- package/esm/shape/connector/connector.js +3 -2
- package/esm/shape/connector/connector.js.map +1 -1
- package/esm/shape/interval/funnel.js +1 -1
- package/esm/shape/interval/funnel.js.map +1 -1
- package/esm/shape/interval/hollow.js +1 -1
- package/esm/shape/interval/hollow.js.map +1 -1
- package/esm/shape/interval/pyramid.js +1 -1
- package/esm/shape/interval/pyramid.js.map +1 -1
- package/esm/shape/interval/rect.js +1 -1
- package/esm/shape/interval/rect.js.map +1 -1
- package/esm/shape/label/label.js +3 -1
- package/esm/shape/label/label.js.map +1 -1
- package/esm/shape/line/curve.js +2 -1
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/line/hv.js +1 -1
- package/esm/shape/line/hv.js.map +1 -1
- package/esm/shape/line/hvh.js +1 -1
- package/esm/shape/line/hvh.js.map +1 -1
- package/esm/shape/line/line.js +1 -1
- package/esm/shape/line/line.js.map +1 -1
- package/esm/shape/line/smooth.js +1 -1
- package/esm/shape/line/smooth.js.map +1 -1
- package/esm/shape/line/vh.js +1 -1
- package/esm/shape/line/vh.js.map +1 -1
- package/esm/shape/lineXY/line.js +1 -0
- package/esm/shape/lineXY/line.js.map +1 -1
- package/esm/shape/link/arc.js +1 -0
- package/esm/shape/link/arc.js.map +1 -1
- package/esm/shape/link/link.js +1 -0
- package/esm/shape/link/link.js.map +1 -1
- package/esm/shape/link/smooth.js +1 -0
- package/esm/shape/link/smooth.js.map +1 -1
- package/esm/shape/link/vhv.js +1 -0
- package/esm/shape/link/vhv.js.map +1 -1
- package/esm/shape/path/hollow.js +1 -0
- package/esm/shape/path/hollow.js.map +1 -1
- package/esm/shape/path/path.js +1 -0
- package/esm/shape/path/path.js.map +1 -1
- package/esm/shape/point/bowtie.js +1 -1
- package/esm/shape/point/bowtie.js.map +1 -1
- package/esm/shape/point/color.js +2 -2
- package/esm/shape/point/color.js.map +1 -1
- package/esm/shape/point/cross.js +1 -1
- package/esm/shape/point/cross.js.map +1 -1
- package/esm/shape/point/diamond.js +1 -1
- package/esm/shape/point/diamond.js.map +1 -1
- package/esm/shape/point/hexagon.js +1 -1
- package/esm/shape/point/hexagon.js.map +1 -1
- package/esm/shape/point/hollow.js +1 -1
- package/esm/shape/point/hollow.js.map +1 -1
- package/esm/shape/point/hollowBowtie.js +1 -1
- package/esm/shape/point/hollowBowtie.js.map +1 -1
- package/esm/shape/point/hollowDiamond.js +1 -1
- package/esm/shape/point/hollowDiamond.js.map +1 -1
- package/esm/shape/point/hollowHexagon.js +1 -1
- package/esm/shape/point/hollowHexagon.js.map +1 -1
- package/esm/shape/point/hollowSquare.js +1 -1
- package/esm/shape/point/hollowSquare.js.map +1 -1
- package/esm/shape/point/hollowTriangle.js +1 -1
- package/esm/shape/point/hollowTriangle.js.map +1 -1
- package/esm/shape/point/hollowTriangleDown.js +1 -1
- package/esm/shape/point/hollowTriangleDown.js.map +1 -1
- package/esm/shape/point/hyphen.js +1 -1
- package/esm/shape/point/hyphen.js.map +1 -1
- package/esm/shape/point/line.js +1 -1
- package/esm/shape/point/line.js.map +1 -1
- package/esm/shape/point/plus.js +1 -1
- package/esm/shape/point/plus.js.map +1 -1
- package/esm/shape/point/point.js +1 -1
- package/esm/shape/point/point.js.map +1 -1
- package/esm/shape/point/square.js +1 -1
- package/esm/shape/point/square.js.map +1 -1
- package/esm/shape/point/tick.js +1 -1
- package/esm/shape/point/tick.js.map +1 -1
- package/esm/shape/point/triangle.js +1 -1
- package/esm/shape/point/triangle.js.map +1 -1
- package/esm/shape/point/triangleDown.js +1 -1
- package/esm/shape/point/triangleDown.js.map +1 -1
- package/esm/shape/polygon/polygon.js +1 -0
- package/esm/shape/polygon/polygon.js.map +1 -1
- package/esm/shape/polygon/ribbon.js +1 -0
- package/esm/shape/polygon/ribbon.js.map +1 -1
- package/esm/shape/shape/shape.js +1 -0
- package/esm/shape/shape/shape.js.map +1 -1
- package/esm/shape/text/badge.js +1 -0
- package/esm/shape/text/badge.js.map +1 -1
- package/esm/shape/text/text.js +1 -0
- package/esm/shape/text/text.js.map +1 -1
- package/esm/shape/utils.d.ts +1 -16
- package/esm/shape/utils.js +2 -2
- package/esm/shape/utils.js.map +1 -1
- package/esm/shape/vector/vector.js +1 -0
- package/esm/shape/vector/vector.js.map +1 -1
- package/esm/spec/component.d.ts +10 -9
- package/esm/spec/coordinateTransform.d.ts +1 -1
- package/esm/spec/interaction.d.ts +19 -33
- package/esm/spec/theme.d.ts +8 -2
- package/esm/stdlib/index.js +2 -2
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.js +73 -74
- package/esm/theme/academy.js.map +1 -1
- package/esm/theme/classic.d.ts +6 -0
- package/esm/theme/{light.js → classic.js} +76 -84
- package/esm/theme/classic.js.map +1 -0
- package/esm/theme/classicDark.d.ts +6 -0
- package/esm/theme/{dark.js → classicDark.js} +74 -83
- package/esm/theme/classicDark.js.map +1 -0
- package/esm/theme/index.d.ts +2 -2
- package/esm/theme/index.js +2 -2
- package/esm/theme/index.js.map +1 -1
- package/esm/transform/maybeTitle.js +5 -1
- package/esm/transform/maybeTitle.js.map +1 -1
- package/esm/utils/marker.d.ts +10 -0
- package/esm/utils/marker.js +250 -0
- package/esm/utils/marker.js.map +1 -0
- package/lib/api/chart.d.ts +5 -3
- package/lib/api/chart.js +15 -12
- package/lib/api/chart.js.map +1 -1
- package/lib/api/composition/base.d.ts +7 -1
- package/lib/api/composition/base.js +26 -0
- package/lib/api/composition/base.js.map +1 -1
- package/lib/component/axis.js +40 -26
- package/lib/component/axis.js.map +1 -1
- package/lib/component/axisRadar.js +4 -3
- package/lib/component/axisRadar.js.map +1 -1
- package/lib/component/axisX.js.map +1 -1
- package/lib/component/legendCategory.js +60 -35
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.js +7 -5
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/component/legendContinuousBlockSize.js +1 -1
- package/lib/component/legendContinuousBlockSize.js.map +1 -1
- package/lib/component/legendContinuousSize.js +1 -1
- package/lib/component/legendContinuousSize.js.map +1 -1
- package/lib/component/scrollbar.js +1 -1
- package/lib/component/scrollbar.js.map +1 -1
- package/lib/component/slider.js +1 -1
- package/lib/component/slider.js.map +1 -1
- package/lib/component/title.js +13 -2
- package/lib/component/title.js.map +1 -1
- package/lib/component/utils.d.ts +1 -0
- package/lib/component/utils.js +26 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/coordinate/fisheye.js +1 -1
- package/lib/coordinate/fisheye.js.map +1 -1
- package/lib/interaction/brushFilter.js +1 -1
- package/lib/interaction/brushFilter.js.map +1 -1
- package/lib/interaction/fisheye.js +1 -1
- package/lib/interaction/fisheye.js.map +1 -1
- package/lib/interaction/legendFilter.d.ts +1 -1
- package/lib/interaction/legendFilter.js +33 -27
- package/lib/interaction/legendFilter.js.map +1 -1
- package/lib/interaction/sliderFilter.js +2 -2
- package/lib/interaction/sliderFilter.js.map +1 -1
- package/lib/interaction/tooltip.d.ts +1 -1
- package/lib/interaction/tooltip.js +4 -2
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/mark/boxplot.js +2 -2
- package/lib/mark/boxplot.js.map +1 -1
- package/lib/runtime/component.d.ts +3 -3
- package/lib/runtime/component.js +4 -4
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/plot.js +2 -2
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.d.ts +1 -1
- package/lib/runtime/render.js +19 -3
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/types/common.d.ts +12 -9
- package/lib/runtime/types/component.d.ts +13 -4
- package/lib/shape/area/area.js +1 -1
- package/lib/shape/area/area.js.map +1 -1
- package/lib/shape/area/curve.js +2 -1
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/area/hv.js +1 -1
- package/lib/shape/area/hv.js.map +1 -1
- package/lib/shape/area/hvh.js +1 -1
- package/lib/shape/area/hvh.js.map +1 -1
- package/lib/shape/area/smooth.js +1 -1
- package/lib/shape/area/smooth.js.map +1 -1
- package/lib/shape/area/vh.js +1 -1
- package/lib/shape/area/vh.js.map +1 -1
- package/lib/shape/box/box.js +1 -0
- package/lib/shape/box/box.js.map +1 -1
- package/lib/shape/connector/connector.d.ts +2 -2
- package/lib/shape/connector/connector.js +3 -2
- package/lib/shape/connector/connector.js.map +1 -1
- package/lib/shape/interval/funnel.js +1 -1
- package/lib/shape/interval/funnel.js.map +1 -1
- package/lib/shape/interval/hollow.js +1 -1
- package/lib/shape/interval/hollow.js.map +1 -1
- package/lib/shape/interval/pyramid.js +1 -1
- package/lib/shape/interval/pyramid.js.map +1 -1
- package/lib/shape/interval/rect.js +1 -1
- package/lib/shape/interval/rect.js.map +1 -1
- package/lib/shape/label/label.js +3 -1
- package/lib/shape/label/label.js.map +1 -1
- package/lib/shape/line/curve.js +2 -1
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/line/hv.js +1 -1
- package/lib/shape/line/hv.js.map +1 -1
- package/lib/shape/line/hvh.js +1 -1
- package/lib/shape/line/hvh.js.map +1 -1
- package/lib/shape/line/line.js +1 -1
- package/lib/shape/line/line.js.map +1 -1
- package/lib/shape/line/smooth.js +1 -1
- package/lib/shape/line/smooth.js.map +1 -1
- package/lib/shape/line/vh.js +1 -1
- package/lib/shape/line/vh.js.map +1 -1
- package/lib/shape/lineXY/line.js +1 -0
- package/lib/shape/lineXY/line.js.map +1 -1
- package/lib/shape/link/arc.js +1 -0
- package/lib/shape/link/arc.js.map +1 -1
- package/lib/shape/link/link.js +1 -0
- package/lib/shape/link/link.js.map +1 -1
- package/lib/shape/link/smooth.js +1 -0
- package/lib/shape/link/smooth.js.map +1 -1
- package/lib/shape/link/vhv.js +1 -0
- package/lib/shape/link/vhv.js.map +1 -1
- package/lib/shape/path/hollow.js +1 -0
- package/lib/shape/path/hollow.js.map +1 -1
- package/lib/shape/path/path.js +1 -0
- package/lib/shape/path/path.js.map +1 -1
- package/lib/shape/point/bowtie.js +1 -1
- package/lib/shape/point/bowtie.js.map +1 -1
- package/lib/shape/point/color.js +2 -25
- package/lib/shape/point/color.js.map +1 -1
- package/lib/shape/point/cross.js +1 -1
- package/lib/shape/point/cross.js.map +1 -1
- package/lib/shape/point/diamond.js +1 -1
- package/lib/shape/point/diamond.js.map +1 -1
- package/lib/shape/point/hexagon.js +1 -1
- package/lib/shape/point/hexagon.js.map +1 -1
- package/lib/shape/point/hollow.js +1 -1
- package/lib/shape/point/hollow.js.map +1 -1
- package/lib/shape/point/hollowBowtie.js +1 -1
- package/lib/shape/point/hollowBowtie.js.map +1 -1
- package/lib/shape/point/hollowDiamond.js +1 -1
- package/lib/shape/point/hollowDiamond.js.map +1 -1
- package/lib/shape/point/hollowHexagon.js +1 -1
- package/lib/shape/point/hollowHexagon.js.map +1 -1
- package/lib/shape/point/hollowSquare.js +1 -1
- package/lib/shape/point/hollowSquare.js.map +1 -1
- package/lib/shape/point/hollowTriangle.js +1 -1
- package/lib/shape/point/hollowTriangle.js.map +1 -1
- package/lib/shape/point/hollowTriangleDown.js +1 -1
- package/lib/shape/point/hollowTriangleDown.js.map +1 -1
- package/lib/shape/point/hyphen.js +1 -1
- package/lib/shape/point/hyphen.js.map +1 -1
- package/lib/shape/point/line.js +1 -1
- package/lib/shape/point/line.js.map +1 -1
- package/lib/shape/point/plus.js +1 -1
- package/lib/shape/point/plus.js.map +1 -1
- package/lib/shape/point/point.js +1 -1
- package/lib/shape/point/point.js.map +1 -1
- package/lib/shape/point/square.js +1 -1
- package/lib/shape/point/square.js.map +1 -1
- package/lib/shape/point/tick.js +1 -1
- package/lib/shape/point/tick.js.map +1 -1
- package/lib/shape/point/triangle.js +1 -1
- package/lib/shape/point/triangle.js.map +1 -1
- package/lib/shape/point/triangleDown.js +1 -1
- package/lib/shape/point/triangleDown.js.map +1 -1
- package/lib/shape/polygon/polygon.js +1 -0
- package/lib/shape/polygon/polygon.js.map +1 -1
- package/lib/shape/polygon/ribbon.js +1 -0
- package/lib/shape/polygon/ribbon.js.map +1 -1
- package/lib/shape/shape/shape.js +1 -0
- package/lib/shape/shape/shape.js.map +1 -1
- package/lib/shape/text/badge.js +1 -0
- package/lib/shape/text/badge.js.map +1 -1
- package/lib/shape/text/text.js +1 -0
- package/lib/shape/text/text.js.map +1 -1
- package/lib/shape/utils.d.ts +1 -16
- package/lib/shape/utils.js +2 -2
- package/lib/shape/utils.js.map +1 -1
- package/lib/shape/vector/vector.js +1 -0
- package/lib/shape/vector/vector.js.map +1 -1
- package/lib/spec/component.d.ts +10 -9
- package/lib/spec/coordinateTransform.d.ts +1 -1
- package/lib/spec/interaction.d.ts +19 -33
- package/lib/spec/theme.d.ts +8 -2
- package/lib/stdlib/index.js +1 -1
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.js +73 -74
- package/lib/theme/academy.js.map +1 -1
- package/lib/theme/classic.d.ts +6 -0
- package/lib/theme/{light.js → classic.js} +78 -86
- package/lib/theme/classic.js.map +1 -0
- package/lib/theme/classicDark.d.ts +6 -0
- package/lib/theme/{dark.js → classicDark.js} +76 -85
- package/lib/theme/classicDark.js.map +1 -0
- package/lib/theme/index.d.ts +2 -2
- package/lib/theme/index.js +5 -5
- package/lib/theme/index.js.map +1 -1
- package/lib/transform/maybeTitle.js +5 -1
- package/lib/transform/maybeTitle.js.map +1 -1
- package/lib/utils/marker.d.ts +10 -0
- package/lib/utils/marker.js +256 -0
- package/lib/utils/marker.js.map +1 -0
- package/package.json +25 -22
- package/src/.DS_Store +0 -0
- package/src/api/chart.ts +17 -14
- package/src/api/composition/base.ts +26 -1
- package/src/component/axis.ts +77 -62
- package/src/component/axisRadar.ts +4 -3
- package/src/component/axisX.ts +0 -1
- package/src/component/legendCategory.ts +68 -63
- package/src/component/legendContinuous.ts +29 -21
- package/src/component/legendContinuousBlockSize.ts +1 -1
- package/src/component/legendContinuousSize.ts +1 -1
- package/src/component/scrollbar.ts +1 -1
- package/src/component/slider.ts +1 -1
- package/src/component/title.ts +3 -5
- package/src/component/utils.ts +25 -1
- package/src/coordinate/fisheye.ts +2 -2
- package/src/data/.DS_Store +0 -0
- package/src/interaction/brushFilter.ts +2 -2
- package/src/interaction/fisheye.ts +1 -1
- package/src/interaction/legendFilter.ts +39 -30
- package/src/interaction/sliderFilter.ts +2 -2
- package/src/interaction/tooltip.ts +5 -3
- package/src/mark/boxplot.ts +2 -2
- package/src/runtime/component.ts +7 -4
- package/src/runtime/plot.ts +2 -0
- package/src/runtime/render.ts +22 -2
- package/src/runtime/types/common.ts +13 -10
- package/src/runtime/types/component.ts +16 -8
- package/src/shape/.DS_Store +0 -0
- package/src/shape/area/area.ts +1 -0
- package/src/shape/area/curve.ts +2 -1
- package/src/shape/area/hv.ts +1 -0
- package/src/shape/area/hvh.ts +1 -0
- package/src/shape/area/smooth.ts +1 -0
- package/src/shape/area/vh.ts +1 -0
- package/src/shape/box/box.ts +1 -0
- package/src/shape/connector/connector.ts +6 -4
- package/src/shape/interval/funnel.ts +1 -0
- package/src/shape/interval/hollow.ts +1 -0
- package/src/shape/interval/pyramid.ts +1 -0
- package/src/shape/interval/rect.ts +1 -0
- package/src/shape/label/label.ts +3 -1
- package/src/shape/line/curve.ts +2 -1
- package/src/shape/line/hv.ts +1 -0
- package/src/shape/line/hvh.ts +1 -0
- package/src/shape/line/line.ts +1 -0
- package/src/shape/line/smooth.ts +1 -0
- package/src/shape/line/vh.ts +1 -0
- package/src/shape/lineXY/line.ts +1 -0
- package/src/shape/link/arc.ts +1 -0
- package/src/shape/link/link.ts +1 -0
- package/src/shape/link/smooth.ts +1 -0
- package/src/shape/link/vhv.ts +1 -0
- package/src/shape/path/hollow.ts +1 -0
- package/src/shape/path/path.ts +1 -0
- package/src/shape/point/bowtie.ts +1 -0
- package/src/shape/point/color.ts +4 -4
- package/src/shape/point/cross.ts +1 -0
- package/src/shape/point/diamond.ts +1 -0
- package/src/shape/point/hexagon.ts +1 -0
- package/src/shape/point/hollow.ts +1 -0
- package/src/shape/point/hollowBowtie.ts +1 -0
- package/src/shape/point/hollowDiamond.ts +1 -0
- package/src/shape/point/hollowHexagon.ts +1 -0
- package/src/shape/point/hollowSquare.ts +1 -0
- package/src/shape/point/hollowTriangle.ts +1 -0
- package/src/shape/point/hollowTriangleDown.ts +1 -0
- package/src/shape/point/hyphen.ts +1 -0
- package/src/shape/point/line.ts +1 -0
- package/src/shape/point/plus.ts +1 -0
- package/src/shape/point/point.ts +1 -0
- package/src/shape/point/square.ts +1 -0
- package/src/shape/point/tick.ts +1 -0
- package/src/shape/point/triangle.ts +1 -0
- package/src/shape/point/triangleDown.ts +1 -0
- package/src/shape/polygon/polygon.ts +1 -0
- package/src/shape/polygon/ribbon.ts +1 -0
- package/src/shape/shape/shape.ts +1 -0
- package/src/shape/text/badge.ts +1 -0
- package/src/shape/text/text.ts +1 -0
- package/src/shape/utils.ts +4 -22
- package/src/shape/vector/vector.ts +1 -0
- package/src/spec/component.ts +10 -9
- package/src/spec/coordinateTransform.ts +1 -1
- package/src/spec/interaction.ts +19 -43
- package/src/spec/theme.ts +22 -2
- package/src/stdlib/index.ts +3 -3
- package/src/theme/academy.ts +73 -74
- package/src/theme/{light.ts → classic.ts} +76 -84
- package/src/theme/{dark.ts → classicDark.ts} +74 -84
- package/src/theme/index.ts +2 -2
- package/src/transform/maybeTitle.ts +5 -1
- package/src/utils/marker.ts +293 -0
- package/esm/shape/point/symbol.d.ts +0 -49
- package/esm/shape/point/symbol.js +0 -143
- package/esm/shape/point/symbol.js.map +0 -1
- package/esm/theme/dark.d.ts +0 -6
- package/esm/theme/dark.js.map +0 -1
- package/esm/theme/light.d.ts +0 -6
- package/esm/theme/light.js.map +0 -1
- package/lib/shape/point/symbol.d.ts +0 -49
- package/lib/shape/point/symbol.js +0 -158
- package/lib/shape/point/symbol.js.map +0 -1
- package/lib/theme/dark.d.ts +0 -6
- package/lib/theme/dark.js.map +0 -1
- package/lib/theme/light.d.ts +0 -6
- package/lib/theme/light.js.map +0 -1
- package/src/shape/point/symbol.ts +0 -154
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g2",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "the Grammar of Graphics in Javascript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"ci": "run-s lint test build",
|
|
32
32
|
"prepublishOnly": "npm run ci",
|
|
33
33
|
"prepare": "husky install",
|
|
34
|
-
"upload": "node scripts/uploadSnapshot.js"
|
|
34
|
+
"upload": "node scripts/uploadSnapshot.js",
|
|
35
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [
|
|
37
38
|
"antv",
|
|
@@ -43,11 +44,32 @@
|
|
|
43
44
|
"interaction",
|
|
44
45
|
"animation"
|
|
45
46
|
],
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@antv/coord": "^0.4.1",
|
|
49
|
+
"@antv/event-emitter": "^0.1.3",
|
|
50
|
+
"@antv/g": "^5.7.4",
|
|
51
|
+
"@antv/g-canvas": "^1.7.4",
|
|
52
|
+
"@antv/g-plugin-dragndrop": "^1.6.1",
|
|
53
|
+
"@antv/gui": "^0.5.0-alpha.8",
|
|
54
|
+
"@antv/path-util": "^3.0.1",
|
|
55
|
+
"@antv/scale": "^0.4.7",
|
|
56
|
+
"@antv/util": "^3.3.2",
|
|
57
|
+
"d3-array": "^3.2.2",
|
|
58
|
+
"d3-dsv": "^3.0.1",
|
|
59
|
+
"d3-force": "^3.0.0",
|
|
60
|
+
"d3-format": "^3.1.0",
|
|
61
|
+
"d3-geo": "^3.0.1",
|
|
62
|
+
"d3-hierarchy": "^3.1.2",
|
|
63
|
+
"d3-scale-chromatic": "^3.0.0",
|
|
64
|
+
"d3-shape": "^3.1.0",
|
|
65
|
+
"d3-voronoi": "^1.1.4"
|
|
66
|
+
},
|
|
46
67
|
"devDependencies": {
|
|
47
68
|
"@antv/g-plugin-rough-canvas-renderer": "^1.7.9",
|
|
48
69
|
"@antv/g-plugin-rough-svg-renderer": "^1.7.9",
|
|
49
70
|
"@antv/g-svg": "^1.8.6",
|
|
50
71
|
"@commitlint/cli": "^11.0.0",
|
|
72
|
+
"@commitlint/config-conventional": "^17.4.4",
|
|
51
73
|
"@rollup/plugin-commonjs": "^21.0.2",
|
|
52
74
|
"@types/d3-array": "^3.0.2",
|
|
53
75
|
"@types/d3-shape": "^3.0.2",
|
|
@@ -59,6 +81,7 @@
|
|
|
59
81
|
"ali-oss": "^6.17.1",
|
|
60
82
|
"archiver": "^5.3.1",
|
|
61
83
|
"canvas": "^2.10.2",
|
|
84
|
+
"conventional-changelog-cli": "^2.2.2",
|
|
62
85
|
"cross-env": "^7.0.3",
|
|
63
86
|
"d3-dsv": "^3.0.1",
|
|
64
87
|
"d3-fetch": "^3.0.1",
|
|
@@ -121,25 +144,5 @@
|
|
|
121
144
|
},
|
|
122
145
|
"bugs": {
|
|
123
146
|
"url": "https://github.com/antvis/g2/issues"
|
|
124
|
-
},
|
|
125
|
-
"dependencies": {
|
|
126
|
-
"@antv/coord": "^0.4.1",
|
|
127
|
-
"@antv/event-emitter": "^0.1.3",
|
|
128
|
-
"@antv/g": "^5.7.4",
|
|
129
|
-
"@antv/g-canvas": "^1.7.4",
|
|
130
|
-
"@antv/g-plugin-dragndrop": "^1.6.1",
|
|
131
|
-
"@antv/gui": "^0.5.0-alpha.8",
|
|
132
|
-
"@antv/path-util": "^3.0.1",
|
|
133
|
-
"@antv/scale": "^0.4.7",
|
|
134
|
-
"@antv/util": "^2.0.17",
|
|
135
|
-
"d3-array": "^3.2.2",
|
|
136
|
-
"d3-dsv": "^3.0.1",
|
|
137
|
-
"d3-force": "^3.0.0",
|
|
138
|
-
"d3-format": "^3.1.0",
|
|
139
|
-
"d3-geo": "^3.0.1",
|
|
140
|
-
"d3-hierarchy": "^3.1.2",
|
|
141
|
-
"d3-scale-chromatic": "^3.0.0",
|
|
142
|
-
"d3-shape": "^3.1.0",
|
|
143
|
-
"d3-voronoi": "^1.1.4"
|
|
144
147
|
}
|
|
145
148
|
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
package/src/api/chart.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { composition, Composition, View } from './composition';
|
|
|
26
26
|
import { library } from './library';
|
|
27
27
|
|
|
28
28
|
export const SPEC_EXTERNAL_KEYS = ['container', 'renderer'];
|
|
29
|
+
export const G2_CHART_KEY = 'G2_CHART_KEY';
|
|
29
30
|
|
|
30
31
|
function normalizeContainer(container: string | HTMLElement): HTMLElement {
|
|
31
32
|
if (container === undefined) return document.createElement('div');
|
|
@@ -38,7 +39,6 @@ function normalizeContainer(container: string | HTMLElement): HTMLElement {
|
|
|
38
39
|
|
|
39
40
|
export function removeContainer(container: HTMLElement) {
|
|
40
41
|
const parent = container.parentNode;
|
|
41
|
-
|
|
42
42
|
if (parent) {
|
|
43
43
|
parent.removeChild(container);
|
|
44
44
|
}
|
|
@@ -123,7 +123,7 @@ export type ChartOptions = ViewComposition & {
|
|
|
123
123
|
autoFit?: boolean;
|
|
124
124
|
renderer?: CanvasRenderer;
|
|
125
125
|
plugins?: RendererPlugin[];
|
|
126
|
-
theme
|
|
126
|
+
theme: string;
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
type ChartProps = Concrete<ViewComposition>;
|
|
@@ -144,6 +144,7 @@ export interface Chart extends Composition, Mark {
|
|
|
144
144
|
axis: ObjectAttribute<ChartOptions['axis'], Chart>;
|
|
145
145
|
legend: ObjectAttribute<ChartOptions['legend'], Chart>;
|
|
146
146
|
style: ObjectAttribute<ChartOptions['style'], Chart>;
|
|
147
|
+
labelTransform: ArrayAttribute<ChartOptions['labelTransform'], Chart>;
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
export const props: NodePropertyDescriptor[] = [
|
|
@@ -154,12 +155,12 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
154
155
|
{ name: 'interaction', type: 'object' },
|
|
155
156
|
{ name: 'theme', type: 'object' },
|
|
156
157
|
{ name: 'title', type: 'value' },
|
|
157
|
-
{ name: 'key', type: 'value' },
|
|
158
158
|
{ name: 'transform', type: 'array' },
|
|
159
159
|
{ name: 'scale', type: 'object' },
|
|
160
160
|
{ name: 'axis', type: 'object' },
|
|
161
161
|
{ name: 'legend', type: 'object' },
|
|
162
162
|
{ name: 'style', type: 'object' },
|
|
163
|
+
{ name: 'labelTransform', type: 'array' },
|
|
163
164
|
...nodeProps(mark),
|
|
164
165
|
...containerProps(composition),
|
|
165
166
|
];
|
|
@@ -171,9 +172,10 @@ export class Chart extends View<ChartOptions> {
|
|
|
171
172
|
private _emitter: EventEmitter;
|
|
172
173
|
private _options: G2ViewTree;
|
|
173
174
|
|
|
174
|
-
constructor(options: ChartOptions
|
|
175
|
-
const { container, canvas, ...rest } = options;
|
|
175
|
+
constructor(options: ChartOptions) {
|
|
176
|
+
const { container, canvas, key = G2_CHART_KEY, ...rest } = options || {};
|
|
176
177
|
super(rest, 'view');
|
|
178
|
+
this.attr('key', key);
|
|
177
179
|
this._container = normalizeContainer(container);
|
|
178
180
|
this._emitter = new EventEmitter();
|
|
179
181
|
this._context = { library, emitter: this._emitter, canvas };
|
|
@@ -272,23 +274,24 @@ export class Chart extends View<ChartOptions> {
|
|
|
272
274
|
return this;
|
|
273
275
|
}
|
|
274
276
|
|
|
277
|
+
clear() {
|
|
278
|
+
const options = this.options();
|
|
279
|
+
this.emit(ChartEvent.BEFORE_CLEAR);
|
|
280
|
+
this._options = {};
|
|
281
|
+
destroy(options, this._context, false);
|
|
282
|
+
this.emit(ChartEvent.AFTER_CLEAR);
|
|
283
|
+
}
|
|
284
|
+
|
|
275
285
|
destroy() {
|
|
276
286
|
const options = this.options();
|
|
277
287
|
this.emit(ChartEvent.BEFORE_DESTROY);
|
|
278
288
|
this.unbindAutoFit();
|
|
279
|
-
|
|
280
|
-
|
|
289
|
+
this._options = {};
|
|
290
|
+
destroy(options, this._context, true);
|
|
281
291
|
removeContainer(this._container);
|
|
282
292
|
this.emit(ChartEvent.AFTER_DESTROY);
|
|
283
293
|
}
|
|
284
294
|
|
|
285
|
-
clear() {
|
|
286
|
-
const options = this.options();
|
|
287
|
-
this.emit(ChartEvent.BEFORE_CLEAR);
|
|
288
|
-
destroy(options, this._context);
|
|
289
|
-
this.emit(ChartEvent.AFTER_CLEAR);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
295
|
forceFit() {
|
|
293
296
|
const { width, height, autoFit } = this.options();
|
|
294
297
|
const { width: adjustedWidth, height: adjustedHeight } = getChartSize(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
2
|
import { DisplayObject } from '@antv/g';
|
|
3
|
-
import { G2Theme, G2ViewDescriptor } from '../../runtime';
|
|
3
|
+
import { Scale, G2Theme, G2ViewDescriptor } from '../../runtime';
|
|
4
4
|
import { hide, show } from '../../utils/style';
|
|
5
5
|
import { Node } from '../node';
|
|
6
6
|
|
|
@@ -9,6 +9,21 @@ export class CompositionNode<
|
|
|
9
9
|
ParentValue extends Record<string, any> = Record<string, any>,
|
|
10
10
|
ChildValue extends Record<string, any> = Record<string, any>,
|
|
11
11
|
> extends Node<Value, ParentValue, ChildValue> {
|
|
12
|
+
/**
|
|
13
|
+
* Change current node data and its children data.
|
|
14
|
+
*/
|
|
15
|
+
changeData(data: any) {
|
|
16
|
+
const chart = this.getRoot();
|
|
17
|
+
if (!chart) return;
|
|
18
|
+
this.attr('data', data);
|
|
19
|
+
if (this.children?.length) {
|
|
20
|
+
this.children.forEach((child) => {
|
|
21
|
+
child.attr('data', data);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return chart?.render();
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
/**
|
|
13
28
|
* Get view instance by key.
|
|
14
29
|
*/
|
|
@@ -19,6 +34,16 @@ export class CompositionNode<
|
|
|
19
34
|
return views.find((view) => view.key === this.attr('key'));
|
|
20
35
|
}
|
|
21
36
|
|
|
37
|
+
getScale(): Record<string, Scale> {
|
|
38
|
+
return this.getView()?.scale;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
getScaleByChannel(channel: string): Scale {
|
|
42
|
+
const scale = this.getScale();
|
|
43
|
+
if (scale) return scale[channel];
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
22
47
|
getCoordinate(): Coordinate {
|
|
23
48
|
return this.getView()?.coordinate;
|
|
24
49
|
}
|
package/src/component/axis.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
radiusOf,
|
|
24
24
|
} from '../utils/coordinate';
|
|
25
25
|
import { capitalizeFirst } from '../utils/helper';
|
|
26
|
-
import {
|
|
26
|
+
import { adaptor, isVertical, isHorizontal, titleContent } from './utils';
|
|
27
27
|
|
|
28
28
|
export type AxisOptions = {
|
|
29
29
|
position?: GCP;
|
|
@@ -179,12 +179,36 @@ function inferGridLength(position: GCP, coordinate: Coordinate) {
|
|
|
179
179
|
return width;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
function
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
function inferLabelOverlap(transform = [], style: Record<string, any>) {
|
|
183
|
+
const {
|
|
184
|
+
labelAutoRotate = true,
|
|
185
|
+
labelAutoHide = false,
|
|
186
|
+
labelAutoEllipsis = false,
|
|
187
|
+
} = style;
|
|
188
|
+
|
|
189
|
+
const finalTransforms = [...transform];
|
|
190
|
+
|
|
191
|
+
const mutateLabelOverlap = (overlap, state) => {
|
|
192
|
+
if (state) {
|
|
193
|
+
const index = finalTransforms.findIndex((t) => t.type === overlap.type);
|
|
194
|
+
if (index !== -1) finalTransforms[index] = overlap;
|
|
195
|
+
else finalTransforms.push(overlap);
|
|
196
|
+
} else {
|
|
197
|
+
const index = finalTransforms.findIndex((t) => t.type === overlap.type);
|
|
198
|
+
if (index !== -1) finalTransforms.splice(index, 1);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
mutateLabelOverlap(
|
|
203
|
+
{
|
|
204
|
+
type: 'rotate',
|
|
205
|
+
optionalAngles: [0, 15, 30, 45, 60, 90],
|
|
206
|
+
},
|
|
207
|
+
labelAutoRotate,
|
|
208
|
+
);
|
|
209
|
+
mutateLabelOverlap({ type: 'ellipsis', minLength: 20 }, labelAutoEllipsis);
|
|
210
|
+
mutateLabelOverlap({ type: 'hide' }, labelAutoHide);
|
|
211
|
+
return finalTransforms;
|
|
188
212
|
}
|
|
189
213
|
|
|
190
214
|
function inferArcStyle(
|
|
@@ -209,8 +233,8 @@ function inferArcStyle(
|
|
|
209
233
|
endAngle,
|
|
210
234
|
titleFillOpacity: 0,
|
|
211
235
|
titlePosition: 'inner',
|
|
212
|
-
|
|
213
|
-
|
|
236
|
+
line: false,
|
|
237
|
+
tick: true,
|
|
214
238
|
gridLength: (outerRadius - innerRadius) * r,
|
|
215
239
|
};
|
|
216
240
|
|
|
@@ -252,7 +276,6 @@ function inferAxisLinearOverrideStyle(
|
|
|
252
276
|
): {
|
|
253
277
|
startPos?: [number, number];
|
|
254
278
|
endPos?: [number, number];
|
|
255
|
-
showLine?: boolean;
|
|
256
279
|
[k: string]: any;
|
|
257
280
|
} {
|
|
258
281
|
const { x, y, width, height } = bbox;
|
|
@@ -276,7 +299,6 @@ function inferAxisLinearOverrideStyle(
|
|
|
276
299
|
return {
|
|
277
300
|
startPos: [x + width, y],
|
|
278
301
|
endPos: [x + width, y + height],
|
|
279
|
-
showLine: true,
|
|
280
302
|
};
|
|
281
303
|
}
|
|
282
304
|
// axisX
|
|
@@ -284,7 +306,6 @@ function inferAxisLinearOverrideStyle(
|
|
|
284
306
|
return {
|
|
285
307
|
startPos: [x, y + height],
|
|
286
308
|
endPos: [x + width, y + height],
|
|
287
|
-
showLine: true,
|
|
288
309
|
};
|
|
289
310
|
}
|
|
290
311
|
// axis with rotate
|
|
@@ -336,13 +357,12 @@ const ArcAxisComponent: GCC<AxisOptions> = (options) => {
|
|
|
336
357
|
tickFilter,
|
|
337
358
|
tickCount,
|
|
338
359
|
tickMethod,
|
|
339
|
-
title,
|
|
340
|
-
grid: showGrid = false,
|
|
341
360
|
important = {},
|
|
342
|
-
style,
|
|
361
|
+
style = {},
|
|
343
362
|
...rest
|
|
344
363
|
} = options;
|
|
345
|
-
|
|
364
|
+
const { title, grid = false } = style;
|
|
365
|
+
return ({ scales: [scale], value, coordinate, theme }) => {
|
|
346
366
|
const { bbox } = value;
|
|
347
367
|
const { domain } = scale.getOptions();
|
|
348
368
|
const ticks = getTicks(
|
|
@@ -368,14 +388,16 @@ const ArcAxisComponent: GCC<AxisOptions> = (options) => {
|
|
|
368
388
|
|
|
369
389
|
const { axis: axisTheme } = theme;
|
|
370
390
|
return new AxisComponent({
|
|
371
|
-
style:
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
391
|
+
style: adaptor(
|
|
392
|
+
deepMix({}, axisTheme, defaultStyle, {
|
|
393
|
+
type: 'arc',
|
|
394
|
+
data: ticks,
|
|
395
|
+
titleText: titleContent(title),
|
|
396
|
+
grid,
|
|
397
|
+
...rest,
|
|
398
|
+
...important,
|
|
399
|
+
}),
|
|
400
|
+
),
|
|
379
401
|
});
|
|
380
402
|
};
|
|
381
403
|
};
|
|
@@ -418,7 +440,9 @@ function inferDefaultStyle(
|
|
|
418
440
|
return {
|
|
419
441
|
...themeStyle,
|
|
420
442
|
labelDirection: direction === 'right' ? 'negative' : 'positive',
|
|
421
|
-
|
|
443
|
+
...(direction === 'center'
|
|
444
|
+
? { labelTransform: 'translate(50%,0)' }
|
|
445
|
+
: null),
|
|
422
446
|
tickDirection: direction === 'right' ? 'negative' : 'positive',
|
|
423
447
|
labelSpacing: direction === 'center' ? 0 : 4,
|
|
424
448
|
titleSpacing: isVertical(orientation) ? 10 : 0,
|
|
@@ -437,30 +461,19 @@ const LinearAxisComponent: GCC<AxisOptions> = (options) => {
|
|
|
437
461
|
orientation,
|
|
438
462
|
position,
|
|
439
463
|
size,
|
|
464
|
+
style = {},
|
|
465
|
+
title,
|
|
440
466
|
tickCount,
|
|
441
467
|
tickFilter,
|
|
442
468
|
tickMethod,
|
|
443
|
-
title,
|
|
444
469
|
transform,
|
|
445
|
-
style,
|
|
446
470
|
...userDefinitions
|
|
447
471
|
} = options;
|
|
448
472
|
|
|
449
|
-
return ([scale], value, coordinate, theme) => {
|
|
473
|
+
return ({ scales: [scale], value, coordinate, theme }) => {
|
|
450
474
|
const { bbox } = value;
|
|
451
475
|
const { domain } = scale.getOptions();
|
|
452
476
|
|
|
453
|
-
const ticks = getTicks(
|
|
454
|
-
scale,
|
|
455
|
-
domain,
|
|
456
|
-
tickCount,
|
|
457
|
-
labelFormatter,
|
|
458
|
-
tickFilter,
|
|
459
|
-
tickMethod,
|
|
460
|
-
position,
|
|
461
|
-
coordinate,
|
|
462
|
-
);
|
|
463
|
-
|
|
464
477
|
const defaultStyle = inferDefaultStyle(
|
|
465
478
|
scale,
|
|
466
479
|
coordinate,
|
|
@@ -469,46 +482,48 @@ const LinearAxisComponent: GCC<AxisOptions> = (options) => {
|
|
|
469
482
|
position,
|
|
470
483
|
orientation,
|
|
471
484
|
);
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
} = Object.assign({}, defaultStyle, userDefinitions);
|
|
480
|
-
|
|
481
|
-
const showGrid = inferGrid(grid, coordinate, scale);
|
|
485
|
+
|
|
486
|
+
const internalAxisStyle = {
|
|
487
|
+
...defaultStyle,
|
|
488
|
+
...style,
|
|
489
|
+
...userDefinitions,
|
|
490
|
+
};
|
|
491
|
+
|
|
482
492
|
const gridLength = inferGridLength(position, coordinate);
|
|
483
493
|
|
|
484
|
-
const
|
|
494
|
+
const overrideStyle = inferAxisLinearOverrideStyle(
|
|
485
495
|
position,
|
|
486
496
|
orientation,
|
|
487
497
|
bbox,
|
|
488
498
|
coordinate,
|
|
489
499
|
);
|
|
490
|
-
const
|
|
491
|
-
...
|
|
492
|
-
...style,
|
|
500
|
+
const finalAxisStyle = {
|
|
501
|
+
...internalAxisStyle,
|
|
493
502
|
type: 'linear' as const,
|
|
494
|
-
data:
|
|
503
|
+
data: getTicks(
|
|
504
|
+
scale,
|
|
505
|
+
domain,
|
|
506
|
+
tickCount,
|
|
507
|
+
labelFormatter,
|
|
508
|
+
tickFilter,
|
|
509
|
+
tickMethod,
|
|
510
|
+
position,
|
|
511
|
+
coordinate,
|
|
512
|
+
),
|
|
495
513
|
titleText: titleContent(title),
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
showGrid,
|
|
499
|
-
showTick,
|
|
514
|
+
labelOverlap: inferLabelOverlap(transform, internalAxisStyle),
|
|
515
|
+
grid: inferGrid(internalAxisStyle.grid, coordinate, scale),
|
|
500
516
|
gridLength,
|
|
501
|
-
...userDefinitions,
|
|
502
517
|
// Always showLine, make title could align the end of axis.
|
|
503
|
-
|
|
504
|
-
...(!
|
|
518
|
+
line: true,
|
|
519
|
+
...(!internalAxisStyle.line ? { lineOpacity: 0 } : null),
|
|
505
520
|
...overrideStyle,
|
|
506
521
|
...important,
|
|
507
522
|
};
|
|
508
523
|
|
|
509
524
|
return new AxisComponent({
|
|
510
525
|
className: 'axis',
|
|
511
|
-
style:
|
|
526
|
+
style: adaptor(finalAxisStyle),
|
|
512
527
|
});
|
|
513
528
|
};
|
|
514
529
|
};
|
|
@@ -43,7 +43,7 @@ function inferAxisStyle(
|
|
|
43
43
|
|
|
44
44
|
return {
|
|
45
45
|
...radarTheme,
|
|
46
|
-
|
|
46
|
+
grid: name === 'position',
|
|
47
47
|
gridConnect: 'line',
|
|
48
48
|
gridControlAngles: new Array(radar.count).fill(0).map((_, i) => {
|
|
49
49
|
const angle = (endAngle - startAngle) / radar.count;
|
|
@@ -54,7 +54,8 @@ function inferAxisStyle(
|
|
|
54
54
|
|
|
55
55
|
export const AxisRadar: GCC<AxisRadarOptions> = (options) => {
|
|
56
56
|
const { important = {}, ...restOptions } = options;
|
|
57
|
-
return (
|
|
57
|
+
return (context) => {
|
|
58
|
+
const { theme, coordinate, value } = context;
|
|
58
59
|
return LinearAxis({
|
|
59
60
|
...restOptions,
|
|
60
61
|
...inferTitleTransform(options.orientation),
|
|
@@ -62,7 +63,7 @@ export const AxisRadar: GCC<AxisRadarOptions> = (options) => {
|
|
|
62
63
|
...inferAxisStyle(options, theme, coordinate, value),
|
|
63
64
|
...important,
|
|
64
65
|
},
|
|
65
|
-
})(
|
|
66
|
+
})(context);
|
|
66
67
|
};
|
|
67
68
|
};
|
|
68
69
|
|
package/src/component/axisX.ts
CHANGED