@antv/g2 5.0.0-beta.5 → 5.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g2-lite.min.js +4 -4
- package/dist/g2.min.js +4 -4
- package/esm/api/chart.d.ts +6 -2
- package/esm/api/chart.js +28 -7
- package/esm/api/chart.js.map +1 -1
- package/esm/api/composition/base.d.ts +4 -0
- package/esm/api/composition/base.js +16 -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 +2 -3
- package/esm/api/composition/geoPath.js +2 -2
- package/esm/api/composition/geoPath.js.map +1 -1
- package/esm/api/composition/geoView.d.ts +2 -3
- package/esm/api/composition/geoView.js +2 -2
- 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 +3 -3
- package/esm/api/composition/view.js +4 -4
- package/esm/api/composition/view.js.map +1 -1
- package/esm/api/mark/mark.d.ts +34 -28
- package/esm/api/mark/mark.js +39 -26
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/mark/types.d.ts +1 -0
- 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/component/axis.js +18 -5
- package/esm/component/axis.js.map +1 -1
- package/esm/component/index.d.ts +2 -0
- package/esm/component/index.js +2 -0
- package/esm/component/index.js.map +1 -1
- 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.js +3 -13
- package/esm/component/slider.js.map +1 -1
- package/esm/component/title.js +46 -22
- package/esm/component/title.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 +2 -2
- package/esm/data/index.js +1 -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/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 +1 -1
- package/esm/geo/geoView.js.map +1 -1
- package/esm/interaction/index.d.ts +6 -0
- package/esm/interaction/index.js +5 -30
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushAxisHighlight.d.ts +26 -0
- package/esm/interaction/native/brushAxisHighlight.js +159 -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 +30 -5
- package/esm/interaction/native/brushHighlight.js +92 -34
- package/esm/interaction/native/brushHighlight.js.map +1 -1
- 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 -1
- package/esm/interaction/native/brushXHighlight.js +5 -4
- package/esm/interaction/native/brushXHighlight.js.map +1 -1
- 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 -1
- package/esm/interaction/native/brushYHighlight.js +5 -4
- package/esm/interaction/native/brushYHighlight.js.map +1 -1
- package/esm/interaction/native/elementHighlight.js +1 -0
- package/esm/interaction/native/elementHighlight.js.map +1 -1
- package/esm/interaction/native/elementSelect.js +1 -0
- package/esm/interaction/native/elementSelect.js.map +1 -1
- 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.js +16 -4
- package/esm/interaction/native/tooltip.js.map +1 -1
- package/esm/interaction/native/utils.d.ts +5 -1
- package/esm/interaction/native/utils.js +11 -3
- package/esm/interaction/native/utils.js.map +1 -1
- package/esm/label-transform/overlapDodgeY.js +8 -0
- package/esm/label-transform/overlapDodgeY.js.map +1 -1
- package/esm/mark/area.js +1 -1
- 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/runtime/component.d.ts +1 -1
- package/esm/runtime/component.js +38 -41
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/layout.js +7 -7
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plot.d.ts +1 -1
- package/esm/runtime/plot.js +70 -27
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.d.ts +0 -1
- package/esm/runtime/render.js +4 -34
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/scale.d.ts +2 -1
- package/esm/runtime/scale.js +7 -0
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +6 -2
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +26 -9
- package/esm/runtime/types/options.d.ts +2 -5
- package/esm/runtime/types/theme.d.ts +2 -5
- package/esm/shape/area/curve.js +15 -8
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/box/box.js +1 -1
- package/esm/shape/box/box.js.map +1 -1
- package/esm/shape/connector/connector.js +2 -2
- 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/interval/color.js +3 -1
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/label/position/default.d.ts +5 -7
- package/esm/shape/label/position/default.js +14 -40
- package/esm/shape/label/position/default.js.map +1 -1
- package/esm/shape/label/position/outside.d.ts +18 -1
- package/esm/shape/label/position/outside.js +66 -1
- package/esm/shape/label/position/outside.js.map +1 -1
- package/esm/shape/label/position/spider.d.ts +1 -1
- package/esm/shape/label/position/spider.js +12 -18
- package/esm/shape/label/position/spider.js.map +1 -1
- package/esm/shape/label/position/surround.d.ts +1 -1
- package/esm/shape/label/position/surround.js +12 -14
- package/esm/shape/label/position/surround.js.map +1 -1
- package/esm/shape/line/curve.js +1 -1
- package/esm/shape/line/curve.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 +1 -1
- 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 +4 -0
- package/esm/shape/utils.js +6 -1
- 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/data.d.ts +24 -9
- package/esm/spec/geometry.d.ts +2 -0
- package/esm/spec/interaction.d.ts +28 -3
- package/esm/spec/transform.d.ts +2 -2
- package/esm/stdlib/index.js +5 -5
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.js +11 -15
- package/esm/theme/academy.js.map +1 -1
- package/esm/theme/dark.js +11 -18
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/light.js +25 -19
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/select.js +1 -13
- package/esm/transform/select.js.map +1 -1
- package/esm/transform/selectX.js +1 -1
- package/esm/transform/selectX.js.map +1 -1
- package/esm/transform/selectY.js +1 -1
- package/esm/transform/selectY.js.map +1 -1
- package/esm/utils/scale.d.ts +2 -0
- package/esm/utils/scale.js +30 -0
- package/esm/utils/scale.js.map +1 -0
- package/lib/api/chart.d.ts +6 -2
- package/lib/api/chart.js +27 -6
- package/lib/api/chart.js.map +1 -1
- package/lib/api/composition/base.d.ts +4 -0
- package/lib/api/composition/base.js +19 -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 +2 -3
- package/lib/api/composition/geoPath.js +2 -2
- package/lib/api/composition/geoPath.js.map +1 -1
- package/lib/api/composition/geoView.d.ts +2 -3
- package/lib/api/composition/geoView.js +2 -2
- 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 +3 -3
- package/lib/api/composition/view.js +4 -4
- package/lib/api/composition/view.js.map +1 -1
- package/lib/api/mark/mark.d.ts +34 -28
- package/lib/api/mark/mark.js +41 -27
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/mark/types.d.ts +1 -0
- 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/component/axis.js +18 -5
- package/lib/component/axis.js.map +1 -1
- package/lib/component/index.d.ts +2 -0
- package/lib/component/index.js +5 -1
- package/lib/component/index.js.map +1 -1
- 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.js +3 -13
- package/lib/component/slider.js.map +1 -1
- package/lib/component/title.js +46 -22
- package/lib/component/title.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 +2 -2
- package/lib/data/index.js +3 -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/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 +1 -1
- package/lib/geo/geoView.js.map +1 -1
- package/lib/interaction/index.d.ts +6 -0
- package/lib/interaction/index.js +11 -31
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushAxisHighlight.d.ts +26 -0
- package/lib/interaction/native/brushAxisHighlight.js +164 -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 +30 -5
- package/lib/interaction/native/brushHighlight.js +91 -33
- package/lib/interaction/native/brushHighlight.js.map +1 -1
- 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 -1
- package/lib/interaction/native/brushXHighlight.js +7 -5
- package/lib/interaction/native/brushXHighlight.js.map +1 -1
- 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 -1
- package/lib/interaction/native/brushYHighlight.js +7 -5
- package/lib/interaction/native/brushYHighlight.js.map +1 -1
- package/lib/interaction/native/elementHighlight.js +1 -0
- package/lib/interaction/native/elementHighlight.js.map +1 -1
- package/lib/interaction/native/elementSelect.js +1 -0
- package/lib/interaction/native/elementSelect.js.map +1 -1
- 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.js +16 -4
- package/lib/interaction/native/tooltip.js.map +1 -1
- package/lib/interaction/native/utils.d.ts +5 -1
- package/lib/interaction/native/utils.js +14 -5
- package/lib/interaction/native/utils.js.map +1 -1
- package/lib/label-transform/overlapDodgeY.js +8 -0
- package/lib/label-transform/overlapDodgeY.js.map +1 -1
- package/lib/mark/area.js +1 -1
- 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/runtime/component.d.ts +1 -1
- package/lib/runtime/component.js +37 -40
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/layout.js +7 -7
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plot.d.ts +1 -1
- package/lib/runtime/plot.js +67 -24
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.d.ts +0 -1
- package/lib/runtime/render.js +4 -35
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/scale.d.ts +2 -1
- package/lib/runtime/scale.js +9 -1
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +6 -2
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +26 -9
- package/lib/runtime/types/options.d.ts +2 -5
- package/lib/runtime/types/theme.d.ts +2 -5
- package/lib/shape/area/curve.js +14 -7
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/box/box.js +1 -1
- package/lib/shape/box/box.js.map +1 -1
- package/lib/shape/connector/connector.js +2 -2
- 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/interval/color.js +3 -1
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/label/position/default.d.ts +5 -7
- package/lib/shape/label/position/default.js +16 -40
- package/lib/shape/label/position/default.js.map +1 -1
- package/lib/shape/label/position/outside.d.ts +18 -1
- package/lib/shape/label/position/outside.js +72 -3
- package/lib/shape/label/position/outside.js.map +1 -1
- package/lib/shape/label/position/spider.d.ts +1 -1
- package/lib/shape/label/position/spider.js +12 -18
- package/lib/shape/label/position/spider.js.map +1 -1
- package/lib/shape/label/position/surround.d.ts +1 -1
- package/lib/shape/label/position/surround.js +11 -13
- package/lib/shape/label/position/surround.js.map +1 -1
- package/lib/shape/line/curve.js +1 -1
- package/lib/shape/line/curve.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 +1 -1
- 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 +4 -0
- package/lib/shape/utils.js +6 -1
- 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/data.d.ts +24 -9
- package/lib/spec/geometry.d.ts +2 -0
- package/lib/spec/interaction.d.ts +28 -3
- package/lib/spec/transform.d.ts +2 -2
- package/lib/stdlib/index.js +2 -2
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.js +11 -15
- package/lib/theme/academy.js.map +1 -1
- package/lib/theme/dark.js +11 -18
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/light.js +25 -19
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/select.js +1 -13
- package/lib/transform/select.js.map +1 -1
- package/lib/transform/selectX.js +1 -1
- package/lib/transform/selectX.js.map +1 -1
- package/lib/transform/selectY.js +1 -1
- package/lib/transform/selectY.js.map +1 -1
- package/lib/utils/scale.d.ts +2 -0
- package/lib/utils/scale.js +35 -0
- package/lib/utils/scale.js.map +1 -0
- package/package.json +1 -1
- package/src/api/chart.ts +31 -10
- package/src/api/composition/base.ts +11 -0
- package/src/api/composition/facetCircle.ts +2 -3
- package/src/api/composition/facetRect.ts +2 -3
- package/src/api/composition/geoPath.ts +2 -3
- package/src/api/composition/geoView.ts +2 -3
- 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 +6 -4
- package/src/api/mark/mark.ts +48 -27
- package/src/api/mark/types.ts +1 -0
- package/src/api/node.ts +9 -11
- package/src/component/axis.ts +22 -5
- package/src/component/index.ts +2 -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 +3 -12
- package/src/component/title.ts +69 -30
- package/src/data/fold.ts +6 -10
- package/src/data/index.ts +2 -2
- package/src/data/pick.ts +11 -2
- package/src/data/slice.ts +15 -0
- package/src/geo/{d3-projection.ts → d3Projection.ts} +0 -0
- package/src/geo/geoView.ts +1 -1
- package/src/interaction/index.ts +21 -16
- package/src/interaction/native/brushAxisHighlight.ts +194 -0
- package/src/interaction/native/brushFilter.ts +143 -0
- package/src/interaction/native/brushHighlight.ts +104 -31
- package/src/interaction/native/brushXFilter.ts +10 -0
- package/src/interaction/native/brushXHighlight.ts +6 -4
- package/src/interaction/native/brushYFilter.ts +10 -0
- package/src/interaction/native/brushYHighlight.ts +6 -4
- package/src/interaction/native/elementHighlight.ts +1 -0
- package/src/interaction/native/elementSelect.ts +1 -0
- package/src/interaction/native/sliderFilter.ts +112 -0
- package/src/interaction/native/tooltip.ts +18 -4
- package/src/interaction/native/utils.ts +15 -6
- package/src/label-transform/overlapDodgeY.ts +8 -1
- package/src/mark/area.ts +1 -1
- package/src/mark/boxplot.ts +3 -1
- package/src/runtime/component.ts +64 -72
- package/src/runtime/layout.ts +6 -6
- package/src/runtime/plot.ts +126 -73
- package/src/runtime/render.ts +6 -58
- package/src/runtime/scale.ts +14 -0
- package/src/runtime/transform.ts +6 -2
- package/src/runtime/types/common.ts +26 -10
- package/src/runtime/types/options.ts +2 -5
- package/src/runtime/types/theme.ts +2 -5
- package/src/shape/area/curve.ts +15 -8
- package/src/shape/box/box.ts +6 -6
- package/src/shape/connector/connector.ts +2 -3
- package/src/shape/image/image.ts +2 -2
- package/src/shape/interval/color.ts +2 -1
- package/src/shape/label/position/default.ts +15 -55
- package/src/shape/label/position/outside.ts +121 -1
- package/src/shape/label/position/spider.ts +12 -19
- package/src/shape/label/position/surround.ts +13 -15
- package/src/shape/line/curve.ts +1 -1
- 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 +4 -1
- package/src/shape/text/badge.ts +8 -3
- package/src/shape/text/text.ts +1 -1
- package/src/shape/utils.ts +6 -5
- package/src/shape/vector/vector.ts +3 -3
- package/src/spec/action.ts +0 -1
- package/src/spec/data.ts +25 -10
- package/src/spec/geometry.ts +2 -0
- package/src/spec/interaction.ts +41 -2
- package/src/spec/transform.ts +3 -1
- package/src/stdlib/index.ts +16 -2
- package/src/theme/academy.ts +11 -15
- package/src/theme/dark.ts +11 -18
- package/src/theme/light.ts +25 -19
- package/src/transform/select.ts +1 -2
- package/src/transform/selectX.ts +1 -1
- package/src/transform/selectY.ts +1 -1
- package/src/utils/scale.ts +31 -0
- 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/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/src/.DS_Store +0 -0
- package/src/data/.DS_Store +0 -0
- package/src/data/subset.ts +0 -35
- package/src/shape/.DS_Store +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
|
-
import { PolarCoordinate } from 'spec';
|
|
3
2
|
import { Vector2 } from '../../../runtime';
|
|
4
3
|
import { getRadius, isCircular } from '../../../utils/coordinate';
|
|
5
4
|
import { angleWithQuadrant } from '../../../utils/vector';
|
|
6
|
-
import {
|
|
5
|
+
import { LabelPosition, pointOfArc } from './default';
|
|
6
|
+
import { inferOutsideCircularStyle } from './outside';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Surround label transform is used to make labels surround circular.
|
|
@@ -13,30 +13,28 @@ export function surround(
|
|
|
13
13
|
points: Vector2[],
|
|
14
14
|
value: Record<string, any>,
|
|
15
15
|
coordinate: Coordinate,
|
|
16
|
-
options,
|
|
17
16
|
) {
|
|
18
17
|
if (!isCircular(coordinate)) return {};
|
|
18
|
+
const { connectorLength, connectorLength2, connectorDistance } = value;
|
|
19
19
|
|
|
20
|
-
const {
|
|
21
|
-
const { ...style }: any = inferCircularStyle(
|
|
20
|
+
const { ...style }: any = inferOutsideCircularStyle(
|
|
22
21
|
'outside',
|
|
23
22
|
points,
|
|
24
23
|
value,
|
|
25
24
|
coordinate,
|
|
26
25
|
);
|
|
26
|
+
const { x0, y0 } = style;
|
|
27
|
+
|
|
27
28
|
const center = coordinate.getCenter();
|
|
28
|
-
const radius = getRadius(coordinate)
|
|
29
|
+
const radius = getRadius(coordinate);
|
|
30
|
+
const radius1 = radius + connectorLength;
|
|
31
|
+
const angle = angleWithQuadrant([x0 - center[0], y0 - center[1]]);
|
|
32
|
+
const sign = Math.sin(angle) > 0 ? 1 : -1;
|
|
33
|
+
|
|
34
|
+
const [newX, newY] = pointOfArc(center, angle, radius1);
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
const labelAngle = angleWithQuadrant([x0 - center[0], y0 - center[1]]);
|
|
32
|
-
const length2 = connector
|
|
33
|
-
? connectorLength2 * (Math.sin(labelAngle) < 0 ? -1 : 1)
|
|
34
|
-
: 0;
|
|
35
|
-
const newX = center[0] + Math.sin(labelAngle) * radius;
|
|
36
|
-
const newY = center[1] - Math.cos(labelAngle) * radius;
|
|
37
|
-
style.x = newX + length2;
|
|
36
|
+
style.x = newX + (connectorLength2 + connectorDistance) * sign;
|
|
38
37
|
style.y = newY;
|
|
39
|
-
style.connectorPoints = [[-length2, 0]];
|
|
40
38
|
|
|
41
39
|
return style;
|
|
42
40
|
}
|
package/src/shape/line/curve.ts
CHANGED
|
@@ -87,7 +87,7 @@ export const Curve: SC<CurveOptions> = (options) => {
|
|
|
87
87
|
// Compute styles.
|
|
88
88
|
const { mark, shape, defaultShape } = value;
|
|
89
89
|
const {
|
|
90
|
-
|
|
90
|
+
defaultColor,
|
|
91
91
|
lineWidth: defaultSize,
|
|
92
92
|
...defaults
|
|
93
93
|
} = getShapeTheme(theme, mark, shape, defaultShape);
|
package/src/shape/lineXY/line.ts
CHANGED
|
@@ -35,13 +35,13 @@ export const Line: SC<LineOptions> = (options) => {
|
|
|
35
35
|
const { ...style } = options;
|
|
36
36
|
return (points, value, coordinate, theme) => {
|
|
37
37
|
const { mark, shape, defaultShape } = value;
|
|
38
|
-
const {
|
|
38
|
+
const { defaultColor, lineWidth, ...shapeTheme } = getShapeTheme(
|
|
39
39
|
theme,
|
|
40
40
|
mark,
|
|
41
41
|
shape,
|
|
42
42
|
defaultShape,
|
|
43
43
|
);
|
|
44
|
-
const { color =
|
|
44
|
+
const { color = defaultColor, size = lineWidth } = value;
|
|
45
45
|
|
|
46
46
|
const path = getPath(points, coordinate);
|
|
47
47
|
const transform = getTransform(coordinate, value.transform);
|
package/src/shape/link/arc.ts
CHANGED
|
@@ -17,13 +17,13 @@ export const Arc: SC<ArcOptions> = (options) => {
|
|
|
17
17
|
const { ...style } = options;
|
|
18
18
|
return (points, value, coordinate, theme) => {
|
|
19
19
|
const { mark, shape, defaultShape } = value;
|
|
20
|
-
const {
|
|
20
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
21
21
|
theme,
|
|
22
22
|
mark,
|
|
23
23
|
shape,
|
|
24
24
|
defaultShape,
|
|
25
25
|
);
|
|
26
|
-
const { color =
|
|
26
|
+
const { color = defaultColor, transform } = value;
|
|
27
27
|
const [from, to] = points;
|
|
28
28
|
|
|
29
29
|
const path = d3path();
|
package/src/shape/link/link.ts
CHANGED
|
@@ -13,13 +13,13 @@ export const Link: SC<LinkOptions> = (options) => {
|
|
|
13
13
|
const { arrowSize, ...style } = options;
|
|
14
14
|
return (points, value, coordinate, theme) => {
|
|
15
15
|
const { mark, shape, defaultShape } = value;
|
|
16
|
-
const {
|
|
16
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
17
17
|
theme,
|
|
18
18
|
mark,
|
|
19
19
|
shape,
|
|
20
20
|
defaultShape,
|
|
21
21
|
);
|
|
22
|
-
const { color =
|
|
22
|
+
const { color = defaultColor, transform } = value;
|
|
23
23
|
const [from, to] = points;
|
|
24
24
|
|
|
25
25
|
// Draw line
|
package/src/shape/link/smooth.ts
CHANGED
|
@@ -13,13 +13,13 @@ export const Smooth: SC<SmoothOptions> = (options) => {
|
|
|
13
13
|
const { ...style } = options;
|
|
14
14
|
return (points, value, coordinate, theme) => {
|
|
15
15
|
const { mark, shape, defaultShape } = value;
|
|
16
|
-
const {
|
|
16
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
17
17
|
theme,
|
|
18
18
|
mark,
|
|
19
19
|
shape,
|
|
20
20
|
defaultShape,
|
|
21
21
|
);
|
|
22
|
-
const { color =
|
|
22
|
+
const { color = defaultColor, transform } = value;
|
|
23
23
|
const [from, to] = points;
|
|
24
24
|
|
|
25
25
|
const path = d3path();
|
package/src/shape/link/vhv.ts
CHANGED
|
@@ -66,13 +66,13 @@ export const VHV: SC<VHVOptions> = (options) => {
|
|
|
66
66
|
const { cornerRatio = 1 / 3, ...style } = options;
|
|
67
67
|
return (points, value, coordinate, theme) => {
|
|
68
68
|
const { mark, shape, defaultShape } = value;
|
|
69
|
-
const {
|
|
69
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
70
70
|
theme,
|
|
71
71
|
mark,
|
|
72
72
|
shape,
|
|
73
73
|
defaultShape,
|
|
74
74
|
);
|
|
75
|
-
const { color =
|
|
75
|
+
const { color = defaultColor, transform } = value;
|
|
76
76
|
const [from, to] = points;
|
|
77
77
|
|
|
78
78
|
const path = getVHVPath(from, to, coordinate, cornerRatio);
|
package/src/shape/point/color.ts
CHANGED
|
@@ -46,11 +46,12 @@ export const Color: SC<ColorOptions> = (options) => {
|
|
|
46
46
|
const path = Symbols[symbol] || Symbols.point;
|
|
47
47
|
return (points, value, coordinate, theme) => {
|
|
48
48
|
const { mark, shape, defaultShape } = value;
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
const { defaultColor, lineWidth, ...defaults } = getShapeTheme(
|
|
50
|
+
theme,
|
|
51
|
+
mark,
|
|
52
|
+
shape,
|
|
53
|
+
defaultShape,
|
|
54
|
+
);
|
|
54
55
|
const finalLineWidth = style.stroke ? lineWidth || 1 : lineWidth;
|
|
55
56
|
const { color = defaultColor, transform, opacity } = value;
|
|
56
57
|
const [cx, cy] = getOrigin(points);
|
|
@@ -48,7 +48,7 @@ export const Polygon: SC<PolygonOptions> = (options) => {
|
|
|
48
48
|
const { ...style } = options;
|
|
49
49
|
return (points, value, coordinate, theme) => {
|
|
50
50
|
const { mark, shape, defaultShape, color, transform } = value;
|
|
51
|
-
const {
|
|
51
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
52
52
|
theme,
|
|
53
53
|
mark,
|
|
54
54
|
shape,
|
|
@@ -60,8 +60,8 @@ export const Polygon: SC<PolygonOptions> = (options) => {
|
|
|
60
60
|
return select(new GPath())
|
|
61
61
|
.call(applyStyle, shapeTheme)
|
|
62
62
|
.style('d', path.toString())
|
|
63
|
-
.style('stroke', color ||
|
|
64
|
-
.style('fill', color ||
|
|
63
|
+
.style('stroke', color || defaultColor)
|
|
64
|
+
.style('fill', color || defaultColor)
|
|
65
65
|
.style('transform', transform)
|
|
66
66
|
.call(applyStyle, style)
|
|
67
67
|
.node();
|
|
@@ -74,7 +74,7 @@ export const Ribbon: SC<RibbonOptions> = (options) => {
|
|
|
74
74
|
const { ...style } = options;
|
|
75
75
|
return (points, value, coordinate, theme) => {
|
|
76
76
|
const { mark, shape, defaultShape, color, transform } = value;
|
|
77
|
-
const {
|
|
77
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
78
78
|
theme,
|
|
79
79
|
mark,
|
|
80
80
|
shape,
|
|
@@ -86,8 +86,8 @@ export const Ribbon: SC<RibbonOptions> = (options) => {
|
|
|
86
86
|
return select(new GPath())
|
|
87
87
|
.call(applyStyle, shapeTheme)
|
|
88
88
|
.style('d', path.toString())
|
|
89
|
-
.style('fill', color ||
|
|
90
|
-
.style('stroke', color ||
|
|
89
|
+
.style('fill', color || defaultColor)
|
|
90
|
+
.style('stroke', color || defaultColor)
|
|
91
91
|
.style('transform', transform)
|
|
92
92
|
.call(applyStyle, style)
|
|
93
93
|
.node();
|
|
@@ -99,7 +99,10 @@ function inferConnectorPath(
|
|
|
99
99
|
]);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
const P: any = [[x0 - x1, y0 - y1]].concat(
|
|
102
|
+
const P: any = [[x0 - x1, y0 - y1]].concat(
|
|
103
|
+
controlPoints.length ? controlPoints : [0, 0],
|
|
104
|
+
);
|
|
105
|
+
|
|
103
106
|
const p0 = [coordCenter[0] - x1, coordCenter[1] - y1] as Vector2;
|
|
104
107
|
const [p1, p2] = P;
|
|
105
108
|
// If angle is smaller than 90, which will cause connector overlap with element.
|
package/src/shape/text/badge.ts
CHANGED
|
@@ -60,13 +60,18 @@ export const Badge: SC<BadgeOptions> = (options) => {
|
|
|
60
60
|
const { ...style } = options;
|
|
61
61
|
return (points, value, coordinate, theme) => {
|
|
62
62
|
const { mark, shape, defaultShape } = value;
|
|
63
|
-
const shapeTheme = getShapeTheme(
|
|
63
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
64
|
+
theme,
|
|
65
|
+
mark,
|
|
66
|
+
shape,
|
|
67
|
+
defaultShape,
|
|
68
|
+
);
|
|
64
69
|
const { color, text = '' } = value;
|
|
65
70
|
|
|
66
71
|
const textStyle = {
|
|
67
72
|
text: String(text),
|
|
68
|
-
stroke: color,
|
|
69
|
-
fill: color,
|
|
73
|
+
stroke: color || defaultColor,
|
|
74
|
+
fill: color || defaultColor,
|
|
70
75
|
};
|
|
71
76
|
|
|
72
77
|
const [[x0, y0]] = points;
|
package/src/shape/text/text.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const Text: SC<TextOptions> = (options) => {
|
|
|
12
12
|
const { ...style } = options;
|
|
13
13
|
return (points, value, coordinate, theme) => {
|
|
14
14
|
const { mark, shape, defaultShape } = value;
|
|
15
|
-
const shapeTheme = getShapeTheme(theme, mark, shape, defaultShape);
|
|
15
|
+
const { ...shapeTheme } = getShapeTheme(theme, mark, shape, defaultShape);
|
|
16
16
|
const { color, text = '', fontSize, rotate = 0, transform = '' } = value;
|
|
17
17
|
|
|
18
18
|
const textStyle = {
|
package/src/shape/utils.ts
CHANGED
|
@@ -193,6 +193,10 @@ export function getArcObject(
|
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Get the mark.shape's style object.
|
|
198
|
+
* @returns
|
|
199
|
+
*/
|
|
196
200
|
export function getShapeTheme(
|
|
197
201
|
theme: G2Theme,
|
|
198
202
|
mark: string,
|
|
@@ -201,12 +205,9 @@ export function getShapeTheme(
|
|
|
201
205
|
) {
|
|
202
206
|
const { defaultColor } = theme;
|
|
203
207
|
const markTheme = theme[mark] || {};
|
|
208
|
+
const shapeTheme = markTheme[shape] || markTheme[defaultShape];
|
|
204
209
|
|
|
205
|
-
return Object.assign(
|
|
206
|
-
{},
|
|
207
|
-
{ fill: defaultColor, stroke: defaultColor },
|
|
208
|
-
markTheme[shape] || markTheme[defaultShape],
|
|
209
|
-
);
|
|
210
|
+
return Object.assign({ defaultColor }, shapeTheme);
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
/**
|
|
@@ -13,7 +13,7 @@ export const Vector: SC<VectorOptions> = (options) => {
|
|
|
13
13
|
const { arrowSize = '40%', ...style } = options;
|
|
14
14
|
return (points, value, coordinate, theme) => {
|
|
15
15
|
const { mark, shape, defaultShape, color, transform } = value;
|
|
16
|
-
const {
|
|
16
|
+
const { defaultColor, ...shapeTheme } = getShapeTheme(
|
|
17
17
|
theme,
|
|
18
18
|
mark,
|
|
19
19
|
shape,
|
|
@@ -38,8 +38,8 @@ export const Vector: SC<VectorOptions> = (options) => {
|
|
|
38
38
|
return select(new Path())
|
|
39
39
|
.call(applyStyle, shapeTheme)
|
|
40
40
|
.style('d', path.toString())
|
|
41
|
-
.style('stroke', color ||
|
|
42
|
-
.style('fill', color ||
|
|
41
|
+
.style('stroke', color || defaultColor)
|
|
42
|
+
.style('fill', color || defaultColor)
|
|
43
43
|
.style('transform', transform)
|
|
44
44
|
.call(applyStyle, style)
|
|
45
45
|
.node();
|
package/src/spec/action.ts
CHANGED
package/src/spec/data.ts
CHANGED
|
@@ -23,11 +23,11 @@ export type DataTransform =
|
|
|
23
23
|
| SortTransform
|
|
24
24
|
| PickTransform
|
|
25
25
|
| RenameTransform
|
|
26
|
-
| SubsetTransform
|
|
27
26
|
| FoldTransform
|
|
28
27
|
| JoinTransform
|
|
29
28
|
| FilterDataTransform
|
|
30
29
|
| MapTransform
|
|
30
|
+
| SliceTransform
|
|
31
31
|
| CustomTransform;
|
|
32
32
|
|
|
33
33
|
export type DataTransformTypes =
|
|
@@ -35,11 +35,11 @@ export type DataTransformTypes =
|
|
|
35
35
|
| 'sort'
|
|
36
36
|
| 'pick'
|
|
37
37
|
| 'rename'
|
|
38
|
-
| 'subset'
|
|
39
38
|
| 'fold'
|
|
40
39
|
| 'join'
|
|
41
40
|
| 'filter'
|
|
42
41
|
| 'map'
|
|
42
|
+
| 'slice'
|
|
43
43
|
| 'custom'
|
|
44
44
|
| DataComponent;
|
|
45
45
|
|
|
@@ -59,13 +59,6 @@ export type RenameTransform = {
|
|
|
59
59
|
[key: string]: string;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
export type SubsetTransform = {
|
|
63
|
-
type?: 'subset';
|
|
64
|
-
start?: number;
|
|
65
|
-
end?: number;
|
|
66
|
-
fields?: string[];
|
|
67
|
-
};
|
|
68
|
-
|
|
69
62
|
export type FilterDataTransform = {
|
|
70
63
|
type?: 'filter';
|
|
71
64
|
/**
|
|
@@ -74,6 +67,18 @@ export type FilterDataTransform = {
|
|
|
74
67
|
callback?: (v: any, idx: number, arr: any[]) => boolean;
|
|
75
68
|
};
|
|
76
69
|
|
|
70
|
+
export type SliceTransform = {
|
|
71
|
+
type?: 'slice';
|
|
72
|
+
/**
|
|
73
|
+
* The start index for slice. Default is 0.
|
|
74
|
+
*/
|
|
75
|
+
start?: number;
|
|
76
|
+
/**
|
|
77
|
+
* The end index for slice. Default is arr.length - 1
|
|
78
|
+
*/
|
|
79
|
+
end?: number;
|
|
80
|
+
};
|
|
81
|
+
|
|
77
82
|
export type SortTransform = {
|
|
78
83
|
type?: 'sort';
|
|
79
84
|
/**
|
|
@@ -84,8 +89,18 @@ export type SortTransform = {
|
|
|
84
89
|
|
|
85
90
|
export type FoldTransform = {
|
|
86
91
|
type?: 'fold';
|
|
92
|
+
/**
|
|
93
|
+
* Set fields will be folded.
|
|
94
|
+
*/
|
|
87
95
|
fields?: string[];
|
|
88
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Fold key field, default is `key`.
|
|
98
|
+
*/
|
|
99
|
+
key?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Fold value field, default is `value`.
|
|
102
|
+
*/
|
|
103
|
+
value?: string;
|
|
89
104
|
};
|
|
90
105
|
|
|
91
106
|
export type CustomDataTransform = {
|
package/src/spec/geometry.ts
CHANGED
|
@@ -128,6 +128,7 @@ export type BaseGeometry<
|
|
|
128
128
|
| boolean;
|
|
129
129
|
legend?: Partial<Record<'size' | 'color', Legend | boolean>> | boolean;
|
|
130
130
|
slider?: Partial<Record<'x' | 'y', any>>;
|
|
131
|
+
scrollbar?: Partial<Record<'x' | 'y', any>>;
|
|
131
132
|
coordinates?: Coordinate[];
|
|
132
133
|
style?: Record<string, any>;
|
|
133
134
|
interactions?: Interaction[];
|
|
@@ -169,6 +170,7 @@ export type BaseGeometry<
|
|
|
169
170
|
};
|
|
170
171
|
cartesian?: boolean;
|
|
171
172
|
layout?: Record<string, any>;
|
|
173
|
+
zIndex?: number;
|
|
172
174
|
};
|
|
173
175
|
|
|
174
176
|
export type Adjust = { type: 'pack' };
|
package/src/spec/interaction.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChannelTypes } from 'spec';
|
|
2
1
|
import { InteractionComponent } from '../runtime';
|
|
2
|
+
import { ChannelTypes } from './geometry';
|
|
3
3
|
import { ActiveRegionAction, PoptipAction, TooltipAction } from './action';
|
|
4
4
|
import { FisheyeCoordinate } from './coordinate';
|
|
5
5
|
|
|
@@ -17,7 +17,12 @@ export type Interaction =
|
|
|
17
17
|
| LegendFilterInteraction
|
|
18
18
|
| BrushHighlightInteraction
|
|
19
19
|
| BrushXHighlightInteraction
|
|
20
|
-
| BrushYHighlightInteraction
|
|
20
|
+
| BrushYHighlightInteraction
|
|
21
|
+
| BrushAxisHighlightInteraction
|
|
22
|
+
| BrushFilter
|
|
23
|
+
| BrushYFilter
|
|
24
|
+
| BrushXFilter
|
|
25
|
+
| SliderFilter;
|
|
21
26
|
// | ElementListHighlightInteraction
|
|
22
27
|
// | LegendActiveInteraction
|
|
23
28
|
// | LegendHighlightInteraction
|
|
@@ -43,6 +48,10 @@ export type InteractionTypes =
|
|
|
43
48
|
| 'brushXHighlight'
|
|
44
49
|
| 'brushYHighlight'
|
|
45
50
|
| 'brushHighlight'
|
|
51
|
+
| 'brushFilter'
|
|
52
|
+
| 'brushXFilter'
|
|
53
|
+
| 'brushYFilter'
|
|
54
|
+
| 'sliderFilter'
|
|
46
55
|
| InteractionComponent;
|
|
47
56
|
// | 'elementListHighlight'
|
|
48
57
|
// | 'legendActive'
|
|
@@ -62,6 +71,7 @@ export type BrushInteraction = {
|
|
|
62
71
|
|
|
63
72
|
export type BrushHighlightInteraction = {
|
|
64
73
|
type?: 'brushHighlight';
|
|
74
|
+
brushKey?: string;
|
|
65
75
|
reverse?: boolean;
|
|
66
76
|
shared?: boolean;
|
|
67
77
|
series?: boolean;
|
|
@@ -70,6 +80,7 @@ export type BrushHighlightInteraction = {
|
|
|
70
80
|
|
|
71
81
|
export type BrushXHighlightInteraction = {
|
|
72
82
|
type?: 'brushXHighlight';
|
|
83
|
+
brushKey?: string;
|
|
73
84
|
reverse?: boolean;
|
|
74
85
|
shared?: boolean;
|
|
75
86
|
series?: boolean;
|
|
@@ -78,12 +89,33 @@ export type BrushXHighlightInteraction = {
|
|
|
78
89
|
|
|
79
90
|
export type BrushYHighlightInteraction = {
|
|
80
91
|
type?: 'brushYHighlight';
|
|
92
|
+
brushKey?: string;
|
|
81
93
|
reverse?: boolean;
|
|
82
94
|
shared?: boolean;
|
|
83
95
|
series?: boolean;
|
|
84
96
|
facet?: boolean;
|
|
85
97
|
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
86
98
|
|
|
99
|
+
export type BrushAxisHighlightInteraction = {
|
|
100
|
+
type?: 'brushAxisHighlight';
|
|
101
|
+
reverse?: boolean;
|
|
102
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
103
|
+
|
|
104
|
+
export type BrushFilter = {
|
|
105
|
+
type?: 'brushFilter';
|
|
106
|
+
reverse?: boolean;
|
|
107
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
108
|
+
|
|
109
|
+
export type BrushXFilter = {
|
|
110
|
+
type?: 'brushXFilter';
|
|
111
|
+
reverse?: boolean;
|
|
112
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
113
|
+
|
|
114
|
+
export type BrushYFilter = {
|
|
115
|
+
type?: 'brushYFilter';
|
|
116
|
+
reverse?: boolean;
|
|
117
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
118
|
+
|
|
87
119
|
export type BrushVisibleInteraction = {
|
|
88
120
|
type?: 'brushVisible';
|
|
89
121
|
brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
|
|
@@ -134,6 +166,13 @@ export type ChartIndex = {
|
|
|
134
166
|
trailing?: boolean;
|
|
135
167
|
} & Record<`${'rule' | 'label'}${any}`, any>;
|
|
136
168
|
|
|
169
|
+
export type SliderFilter = {
|
|
170
|
+
type?: 'sliderFilter';
|
|
171
|
+
wait?: number;
|
|
172
|
+
leading?: boolean;
|
|
173
|
+
trailing?: boolean;
|
|
174
|
+
};
|
|
175
|
+
|
|
137
176
|
export type ElementListHighlightInteraction = {
|
|
138
177
|
type?: 'elementListHighlight';
|
|
139
178
|
};
|
package/src/spec/transform.ts
CHANGED
|
@@ -140,7 +140,9 @@ export type Selector =
|
|
|
140
140
|
export type SelectTransform = {
|
|
141
141
|
type?: 'select';
|
|
142
142
|
groupBy?: string | string[];
|
|
143
|
-
|
|
143
|
+
channel?: ChannelTypes;
|
|
144
|
+
selector?: Selector;
|
|
145
|
+
};
|
|
144
146
|
|
|
145
147
|
export type SelectXTransform = {
|
|
146
148
|
type?: 'selectX';
|
package/src/stdlib/index.ts
CHANGED
|
@@ -140,6 +140,8 @@ import {
|
|
|
140
140
|
TitleComponent,
|
|
141
141
|
SliderX,
|
|
142
142
|
SliderY,
|
|
143
|
+
ScrollbarX,
|
|
144
|
+
ScrollbarY,
|
|
143
145
|
} from '../component';
|
|
144
146
|
import {
|
|
145
147
|
ScaleInX,
|
|
@@ -174,6 +176,11 @@ import {
|
|
|
174
176
|
BrushHighlight,
|
|
175
177
|
BrushXHighlight,
|
|
176
178
|
BrushYHighlight,
|
|
179
|
+
BrushAxisHighlight,
|
|
180
|
+
BrushFilter,
|
|
181
|
+
BrushXFilter,
|
|
182
|
+
BrushYFilter,
|
|
183
|
+
SliderFilter,
|
|
177
184
|
// ElementHighlightByX,
|
|
178
185
|
// ElementHighlightByColor,
|
|
179
186
|
// ElementListHighlight,
|
|
@@ -246,8 +253,8 @@ import {
|
|
|
246
253
|
Map,
|
|
247
254
|
Pick,
|
|
248
255
|
Rename,
|
|
249
|
-
Subset,
|
|
250
256
|
Fold,
|
|
257
|
+
Slice,
|
|
251
258
|
Inline,
|
|
252
259
|
Custom,
|
|
253
260
|
Cluster,
|
|
@@ -275,8 +282,8 @@ export function createLibrary(): G2Library {
|
|
|
275
282
|
'data.filter': DataFilter,
|
|
276
283
|
'data.pick': Pick,
|
|
277
284
|
'data.rename': Rename,
|
|
278
|
-
'data.subset': Subset,
|
|
279
285
|
'data.fold': Fold,
|
|
286
|
+
'data.slice': Slice,
|
|
280
287
|
'data.custom': Custom,
|
|
281
288
|
'data.map': Map,
|
|
282
289
|
'data.cluster': Cluster,
|
|
@@ -471,6 +478,8 @@ export function createLibrary(): G2Library {
|
|
|
471
478
|
'component.title': TitleComponent,
|
|
472
479
|
'component.sliderX': SliderX,
|
|
473
480
|
'component.sliderY': SliderY,
|
|
481
|
+
'component.scrollbarX': ScrollbarX,
|
|
482
|
+
'component.scrollbarY': ScrollbarY,
|
|
474
483
|
'animation.scaleInX': ScaleInX,
|
|
475
484
|
'animation.scaleOutX': ScaleOutX,
|
|
476
485
|
'animation.scaleInY': ScaleInY,
|
|
@@ -497,6 +506,11 @@ export function createLibrary(): G2Library {
|
|
|
497
506
|
'interaction.brushHighlight': BrushHighlight,
|
|
498
507
|
'interaction.brushXHighlight': BrushXHighlight,
|
|
499
508
|
'interaction.brushYHighlight': BrushYHighlight,
|
|
509
|
+
'interaction.brushAxisHighlight': BrushAxisHighlight,
|
|
510
|
+
'interaction.brushFilter': BrushFilter,
|
|
511
|
+
'interaction.brushXFilter': BrushXFilter,
|
|
512
|
+
'interaction.brushYFilter': BrushYFilter,
|
|
513
|
+
'interaction.sliderFilter': SliderFilter,
|
|
500
514
|
// 'interaction.elementSelected': ElementSelected,
|
|
501
515
|
// 'interaction.elementHighlight': ElementHighlight,
|
|
502
516
|
// 'interaction.elementHighlightByX': ElementHighlightByX,
|
package/src/theme/academy.ts
CHANGED
|
@@ -55,19 +55,16 @@ export const Academy: TC<AcademyOptions> = (options) => {
|
|
|
55
55
|
},
|
|
56
56
|
hollow: {
|
|
57
57
|
r: 3,
|
|
58
|
-
fill: '',
|
|
59
58
|
strokeOpacity: 0.95,
|
|
60
59
|
lineWidth: 1,
|
|
61
60
|
},
|
|
62
61
|
plus: {
|
|
63
62
|
r: 3,
|
|
64
|
-
fill: '',
|
|
65
63
|
strokeOpacity: 0.95,
|
|
66
64
|
lineWidth: 3,
|
|
67
65
|
},
|
|
68
66
|
diamond: {
|
|
69
67
|
r: 3,
|
|
70
|
-
fill: '',
|
|
71
68
|
strokeOpacity: 0.95,
|
|
72
69
|
lineWidth: 1,
|
|
73
70
|
},
|
|
@@ -357,6 +354,7 @@ export const Academy: TC<AcademyOptions> = (options) => {
|
|
|
357
354
|
connectorStroke: COLORS.BLACK,
|
|
358
355
|
connectorStrokeOpacity: 0.45,
|
|
359
356
|
connectorLineWidth: 1,
|
|
357
|
+
connectorLength: 12,
|
|
360
358
|
connectorLength2: 8,
|
|
361
359
|
connectorDistance: 4,
|
|
362
360
|
},
|
|
@@ -388,18 +386,16 @@ export const Academy: TC<AcademyOptions> = (options) => {
|
|
|
388
386
|
},
|
|
389
387
|
scrollbar: {},
|
|
390
388
|
title: {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
fontWeight: 'normal',
|
|
402
|
-
textBaseline: 'top',
|
|
389
|
+
titleFill: COLORS.BLACK,
|
|
390
|
+
titleFillOpacity: 0.85,
|
|
391
|
+
titleFontSize: 14,
|
|
392
|
+
titleFontWeight: 'bold',
|
|
393
|
+
titleTextBaseline: 'top',
|
|
394
|
+
subtitleFill: COLORS.BLACK,
|
|
395
|
+
subtitleFillOpacity: 0.65,
|
|
396
|
+
subtitleFontSize: 12,
|
|
397
|
+
subtitleFontWeight: 'normal',
|
|
398
|
+
subtitleTextBaseline: 'top',
|
|
403
399
|
},
|
|
404
400
|
};
|
|
405
401
|
return Object.assign({}, defaultOptions, options);
|