@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
package/src/api/chart.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
ObjectAttribute,
|
|
21
21
|
} from './types';
|
|
22
22
|
import { mark, Mark } from './mark';
|
|
23
|
-
import { composition, Composition } from './composition';
|
|
23
|
+
import { composition, Composition, View } from './composition';
|
|
24
24
|
import { library } from './library';
|
|
25
25
|
|
|
26
26
|
function normalizeContainer(container: string | HTMLElement): HTMLElement {
|
|
@@ -132,6 +132,7 @@ export interface Chart extends Composition, Mark {
|
|
|
132
132
|
key: ValueAttribute<ChartProps['key'], Chart>;
|
|
133
133
|
transform: ArrayAttribute<ChartProps['transform'], Chart>;
|
|
134
134
|
theme: ObjectAttribute<ChartProps['theme'], Chart>;
|
|
135
|
+
title: ObjectAttribute<ChartProps['title'], Chart>;
|
|
135
136
|
on: ObjectAttribute<ChartProps['on'], Chart>;
|
|
136
137
|
scale: ObjectAttribute<ChartOptions['scale'], Chart>;
|
|
137
138
|
axis: ObjectAttribute<ChartOptions['axis'], Chart>;
|
|
@@ -146,7 +147,7 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
146
147
|
{ name: 'coordinate', type: 'array', key: 'coordinates' },
|
|
147
148
|
{ name: 'interaction', type: 'array', key: 'interactions' },
|
|
148
149
|
{ name: 'theme', type: 'object' },
|
|
149
|
-
{ name: 'title', type: '
|
|
150
|
+
{ name: 'title', type: 'value' },
|
|
150
151
|
{ name: 'key', type: 'value' },
|
|
151
152
|
{ name: 'transform', type: 'array' },
|
|
152
153
|
{ name: 'theme', type: 'object' },
|
|
@@ -160,7 +161,7 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
160
161
|
];
|
|
161
162
|
|
|
162
163
|
@defineProps(props)
|
|
163
|
-
export class Chart extends
|
|
164
|
+
export class Chart extends View<ChartOptions> {
|
|
164
165
|
private _container: HTMLElement;
|
|
165
166
|
private _context: G2Context;
|
|
166
167
|
|
|
@@ -169,6 +170,7 @@ export class Chart extends Node<ChartOptions> {
|
|
|
169
170
|
super(rest, 'view');
|
|
170
171
|
this._container = normalizeContainer(container);
|
|
171
172
|
this._context = { library };
|
|
173
|
+
this.bindAutoFit();
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
render(): Chart {
|
|
@@ -199,7 +201,6 @@ export class Chart extends Node<ChartOptions> {
|
|
|
199
201
|
plugins,
|
|
200
202
|
);
|
|
201
203
|
}
|
|
202
|
-
|
|
203
204
|
render(this.options(), this._context);
|
|
204
205
|
|
|
205
206
|
return this;
|
|
@@ -221,6 +222,7 @@ export class Chart extends Node<ChartOptions> {
|
|
|
221
222
|
const options = this.options();
|
|
222
223
|
const { on } = options;
|
|
223
224
|
emitEvent(on, CHART_LIFE_CIRCLE.BEFORE_DESTROY);
|
|
225
|
+
this.unbindAutoFit();
|
|
224
226
|
destroy(options, this._context);
|
|
225
227
|
// Remove the container.
|
|
226
228
|
removeContainer(this._container);
|
|
@@ -236,29 +238,48 @@ export class Chart extends Node<ChartOptions> {
|
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
forceFit() {
|
|
239
|
-
const { width, height } = this.options();
|
|
241
|
+
const { width, height, autoFit } = this.options();
|
|
240
242
|
const { width: adjustedWidth, height: adjustedHeight } = getChartSize(
|
|
241
243
|
this._container,
|
|
242
|
-
|
|
244
|
+
autoFit,
|
|
243
245
|
width,
|
|
244
246
|
height,
|
|
245
247
|
);
|
|
246
|
-
|
|
248
|
+
if (adjustedHeight && adjustedWidth) {
|
|
249
|
+
this.changeSize(adjustedWidth, adjustedHeight);
|
|
250
|
+
}
|
|
247
251
|
}
|
|
248
252
|
|
|
249
253
|
changeSize(adjustedWidth: number, adjustedHeight: number) {
|
|
250
254
|
const { width, height, on } = this.options();
|
|
251
|
-
|
|
252
255
|
if (width === adjustedWidth && height === adjustedHeight) {
|
|
253
256
|
return this;
|
|
254
257
|
}
|
|
255
258
|
|
|
256
259
|
emitEvent(on, CHART_LIFE_CIRCLE.BEFORE_CHANGE_SIZE);
|
|
257
|
-
|
|
258
260
|
this.width(adjustedWidth);
|
|
259
261
|
this.height(adjustedHeight);
|
|
260
262
|
this.render();
|
|
261
|
-
|
|
262
263
|
emitEvent(on, CHART_LIFE_CIRCLE.AFTER_CHANGE_SIZE);
|
|
263
264
|
}
|
|
265
|
+
|
|
266
|
+
private onResize = debounce(() => {
|
|
267
|
+
this.forceFit();
|
|
268
|
+
}, 300);
|
|
269
|
+
|
|
270
|
+
private bindAutoFit() {
|
|
271
|
+
const options = this.options();
|
|
272
|
+
const { autoFit } = options;
|
|
273
|
+
if (autoFit) {
|
|
274
|
+
window.addEventListener('resize', this.onResize);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
private unbindAutoFit() {
|
|
279
|
+
const options = this.options();
|
|
280
|
+
const { autoFit } = options;
|
|
281
|
+
if (autoFit) {
|
|
282
|
+
window.removeEventListener('resize', this.onResize);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
264
285
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineProps } from '../props';
|
|
2
|
+
import { Node } from '../node';
|
|
3
|
+
|
|
4
|
+
@defineProps([{ name: 'on', type: 'event' }])
|
|
5
|
+
export class Base<
|
|
6
|
+
Value extends Record<string, any> = Record<string, any>,
|
|
7
|
+
ParentValue extends Record<string, any> = Record<string, any>,
|
|
8
|
+
ChildValue extends Record<string, any> = Record<string, any>,
|
|
9
|
+
> extends Node<Value, ParentValue, ChildValue> {
|
|
10
|
+
getView() {}
|
|
11
|
+
}
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
ObjectAttribute,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type FacetCircleSpec = Concrete<FacetCircleComposition>;
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ export interface FacetCircle extends Composition, Mark {
|
|
|
30
29
|
{ type: 'object', name: 'axis' },
|
|
31
30
|
...nodeProps(mark),
|
|
32
31
|
])
|
|
33
|
-
export class FacetCircle extends
|
|
32
|
+
export class FacetCircle extends Base<FacetCircleComposition> {
|
|
34
33
|
constructor() {
|
|
35
34
|
super({}, 'facetCircle');
|
|
36
35
|
}
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
ObjectAttribute,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type FacetRectSpec = Concrete<FacetRectComposition>;
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ export interface FacetRect extends Composition, Mark {
|
|
|
30
29
|
{ type: 'object', name: 'axis' },
|
|
31
30
|
...nodeProps(mark),
|
|
32
31
|
])
|
|
33
|
-
export class FacetRect extends
|
|
32
|
+
export class FacetRect extends Base<FacetRectComposition> {
|
|
34
33
|
constructor() {
|
|
35
34
|
super({}, 'facetRect');
|
|
36
35
|
}
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
Concrete,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type GeoPathSpec = Concrete<GeoPathComposition>;
|
|
14
13
|
|
|
@@ -36,7 +35,7 @@ export interface GeoPath extends Mark, Composition {
|
|
|
36
35
|
{ type: 'object', name: 'legend' },
|
|
37
36
|
...nodeProps(mark),
|
|
38
37
|
])
|
|
39
|
-
export class GeoPath extends
|
|
38
|
+
export class GeoPath extends Base<GeoPathComposition> {
|
|
40
39
|
constructor() {
|
|
41
40
|
super({}, 'geoPath');
|
|
42
41
|
}
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
Concrete,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type GeoViewSpec = Concrete<GeoViewComposition>;
|
|
14
13
|
|
|
@@ -35,7 +34,7 @@ export interface GeoView extends Mark, Composition {
|
|
|
35
34
|
{ type: 'object', name: 'legend' },
|
|
36
35
|
...nodeProps(mark),
|
|
37
36
|
])
|
|
38
|
-
export class GeoView extends
|
|
37
|
+
export class GeoView extends Base<GeoViewComposition> {
|
|
39
38
|
constructor() {
|
|
40
39
|
super({}, 'geoView');
|
|
41
40
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineProps, nodeProps } from '../props';
|
|
2
|
+
import { Base } from './base';
|
|
2
3
|
import { View } from './view';
|
|
3
4
|
import { SpaceLayer } from './spaceLayer';
|
|
4
5
|
import { SpaceFlex } from './spaceFlex';
|
|
@@ -34,6 +35,7 @@ export interface Composition {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export {
|
|
38
|
+
Base,
|
|
37
39
|
View,
|
|
38
40
|
SpaceLayer,
|
|
39
41
|
SpaceFlex,
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
ObjectAttribute,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
11
|
-
import { Composition } from './index';
|
|
10
|
+
import { Composition, Base } from './index';
|
|
12
11
|
|
|
13
12
|
type RepeatMatrixSpec = Concrete<RepeatMatrixComposition>;
|
|
14
13
|
|
|
@@ -30,7 +29,7 @@ export interface RepeatMatrix extends Composition, Mark {
|
|
|
30
29
|
{ type: 'object', name: 'legend' },
|
|
31
30
|
...nodeProps(mark),
|
|
32
31
|
])
|
|
33
|
-
export class RepeatMatrix extends
|
|
32
|
+
export class RepeatMatrix extends Base<RepeatMatrixComposition> {
|
|
34
33
|
constructor() {
|
|
35
34
|
super({}, 'repeatMatrix');
|
|
36
35
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SpaceFlexComposition } from '../../spec';
|
|
2
2
|
import { defineProps, nodeProps } from '../props';
|
|
3
3
|
import { ValueAttribute, Concrete } from '../types';
|
|
4
|
-
import { Node } from '../node';
|
|
5
4
|
import { mark, Mark } from '../mark';
|
|
6
|
-
import { Composition } from './index';
|
|
5
|
+
import { Composition, Base } from './index';
|
|
7
6
|
|
|
8
7
|
type SpaceFlexSpec = Concrete<SpaceFlexComposition>;
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ export interface SpaceFlex extends Composition, Mark {
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
@defineProps([{ type: 'value', name: 'data' }, ...nodeProps(mark)])
|
|
15
|
-
export class SpaceFlex extends
|
|
14
|
+
export class SpaceFlex extends Base<SpaceFlexSpec> {
|
|
16
15
|
constructor() {
|
|
17
16
|
super({}, 'spaceFlex');
|
|
18
17
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SpaceLayerComposition } from '../../spec';
|
|
2
2
|
import { defineProps, nodeProps } from '../props';
|
|
3
3
|
import { ValueAttribute, Concrete } from '../types';
|
|
4
|
-
import { Node } from '../node';
|
|
5
4
|
import { mark, Mark } from '../mark';
|
|
6
|
-
import { Composition } from './index';
|
|
5
|
+
import { Composition, Base } from './index';
|
|
7
6
|
|
|
8
7
|
type SpaceLayerSpec = Concrete<SpaceLayerComposition>;
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ export interface SpaceLayer extends Composition, Mark {
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
@defineProps([{ type: 'value', name: 'data' }, ...nodeProps(mark)])
|
|
15
|
-
export class SpaceLayer extends
|
|
14
|
+
export class SpaceLayer extends Base<SpaceLayerComposition> {
|
|
16
15
|
constructor() {
|
|
17
16
|
super({}, 'spaceLayer');
|
|
18
17
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { TimingKeyframeComposition } from '../../spec';
|
|
2
2
|
import { defineProps, nodeProps } from '../props';
|
|
3
3
|
import { Concrete } from '../types';
|
|
4
|
-
import { Node } from '../node';
|
|
5
4
|
import { mark, Mark } from '../mark';
|
|
6
|
-
import { Composition } from './index';
|
|
5
|
+
import { Composition, Base } from './index';
|
|
7
6
|
|
|
8
7
|
type TimingKeyframeSpec = Concrete<TimingKeyframeComposition>;
|
|
9
8
|
|
|
10
9
|
export interface TimingKeyframe extends Composition, Mark {}
|
|
11
10
|
|
|
12
11
|
@defineProps([...nodeProps(mark)])
|
|
13
|
-
export class TimingKeyframe extends
|
|
12
|
+
export class TimingKeyframe extends Base<TimingKeyframeSpec> {
|
|
14
13
|
constructor() {
|
|
15
14
|
super({}, 'timingKeyframe');
|
|
16
15
|
}
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
ArrayAttribute,
|
|
7
7
|
Concrete,
|
|
8
8
|
} from '../types';
|
|
9
|
-
import { Node } from '../node';
|
|
10
9
|
import { mark, Mark } from '../mark';
|
|
10
|
+
import { Base } from './base';
|
|
11
11
|
|
|
12
12
|
type ViewSpec = Concrete<ViewComposition>;
|
|
13
13
|
|
|
@@ -33,8 +33,10 @@ export interface View extends Mark {
|
|
|
33
33
|
{ type: 'object', name: 'legend' },
|
|
34
34
|
...nodeProps(mark),
|
|
35
35
|
])
|
|
36
|
-
export class View
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
export class View<
|
|
37
|
+
ViewProps extends ViewComposition = ViewComposition,
|
|
38
|
+
> extends Base<ViewProps> {
|
|
39
|
+
constructor(options = {}, type = 'view') {
|
|
40
|
+
super(options, type);
|
|
39
41
|
}
|
|
40
42
|
}
|
package/src/api/mark/mark.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IntervalGeometry,
|
|
3
|
+
RectGeometry,
|
|
3
4
|
AreaGeometry,
|
|
4
5
|
PointGeometry,
|
|
5
6
|
CellGeometry,
|
|
@@ -34,7 +35,7 @@ export interface Interval extends API<Concrete<IntervalGeometry>, Interval> {
|
|
|
34
35
|
type: 'interval';
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
export interface Rect extends API<Concrete<
|
|
38
|
+
export interface Rect extends API<Concrete<RectGeometry>, Rect> {
|
|
38
39
|
type: 'rect';
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -144,185 +145,205 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
144
145
|
{ name: 'axis', type: 'object' },
|
|
145
146
|
{ name: 'legend', type: 'object' },
|
|
146
147
|
{ name: 'slider', type: 'object' },
|
|
148
|
+
{ name: 'scrollbar', type: 'object' },
|
|
147
149
|
];
|
|
148
150
|
|
|
151
|
+
export class MarkBase<
|
|
152
|
+
Value extends Record<string, any> = Record<string, any>,
|
|
153
|
+
ParentValue extends Record<string, any> = Record<string, any>,
|
|
154
|
+
ChildValue extends Record<string, any> = Record<string, any>,
|
|
155
|
+
> extends Node<Value, ParentValue, ChildValue> {
|
|
156
|
+
changeData(data) {
|
|
157
|
+
const chart = this.root();
|
|
158
|
+
if (!chart) return;
|
|
159
|
+
this.attr('data', data);
|
|
160
|
+
chart?.render();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
getMark() {}
|
|
164
|
+
|
|
165
|
+
getScale() {}
|
|
166
|
+
|
|
167
|
+
getGroup() {}
|
|
168
|
+
}
|
|
169
|
+
|
|
149
170
|
@defineProps(props)
|
|
150
|
-
export class Interval extends
|
|
171
|
+
export class Interval extends MarkBase<IntervalGeometry> {
|
|
151
172
|
constructor() {
|
|
152
173
|
super({}, 'interval');
|
|
153
174
|
}
|
|
154
175
|
}
|
|
155
176
|
|
|
156
177
|
@defineProps(props)
|
|
157
|
-
export class Rect extends
|
|
178
|
+
export class Rect extends MarkBase<RectGeometry> {
|
|
158
179
|
constructor() {
|
|
159
180
|
super({}, 'rect');
|
|
160
181
|
}
|
|
161
182
|
}
|
|
162
183
|
|
|
163
184
|
@defineProps(props)
|
|
164
|
-
export class Point extends
|
|
185
|
+
export class Point extends MarkBase<PointGeometry> {
|
|
165
186
|
constructor() {
|
|
166
187
|
super({}, 'point');
|
|
167
188
|
}
|
|
168
189
|
}
|
|
169
190
|
|
|
170
191
|
@defineProps(props)
|
|
171
|
-
export class Area extends
|
|
192
|
+
export class Area extends MarkBase<AreaGeometry> {
|
|
172
193
|
constructor() {
|
|
173
194
|
super({}, 'area');
|
|
174
195
|
}
|
|
175
196
|
}
|
|
176
197
|
|
|
177
198
|
@defineProps(props)
|
|
178
|
-
export class Line extends
|
|
199
|
+
export class Line extends MarkBase<LineGeometry> {
|
|
179
200
|
constructor() {
|
|
180
201
|
super({}, 'line');
|
|
181
202
|
}
|
|
182
203
|
}
|
|
183
204
|
|
|
184
205
|
@defineProps(props)
|
|
185
|
-
export class Cell extends
|
|
206
|
+
export class Cell extends MarkBase<CellGeometry> {
|
|
186
207
|
constructor() {
|
|
187
208
|
super({}, 'cell');
|
|
188
209
|
}
|
|
189
210
|
}
|
|
190
211
|
|
|
191
212
|
@defineProps(props)
|
|
192
|
-
export class Vector extends
|
|
213
|
+
export class Vector extends MarkBase<VectorGeometry> {
|
|
193
214
|
constructor() {
|
|
194
215
|
super({}, 'vector');
|
|
195
216
|
}
|
|
196
217
|
}
|
|
197
218
|
|
|
198
219
|
@defineProps(props)
|
|
199
|
-
export class Link extends
|
|
220
|
+
export class Link extends MarkBase<LinkGeometry> {
|
|
200
221
|
constructor() {
|
|
201
222
|
super({}, 'link');
|
|
202
223
|
}
|
|
203
224
|
}
|
|
204
225
|
|
|
205
226
|
@defineProps(props)
|
|
206
|
-
export class Polygon extends
|
|
227
|
+
export class Polygon extends MarkBase<PolygonGeometry> {
|
|
207
228
|
constructor() {
|
|
208
229
|
super({}, 'polygon');
|
|
209
230
|
}
|
|
210
231
|
}
|
|
211
232
|
|
|
212
233
|
@defineProps(props)
|
|
213
|
-
export class Image extends
|
|
234
|
+
export class Image extends MarkBase<ImageGeometry> {
|
|
214
235
|
constructor() {
|
|
215
236
|
super({}, 'image');
|
|
216
237
|
}
|
|
217
238
|
}
|
|
218
239
|
|
|
219
240
|
@defineProps(props)
|
|
220
|
-
export class Text extends
|
|
241
|
+
export class Text extends MarkBase<TextGeometry> {
|
|
221
242
|
constructor() {
|
|
222
243
|
super({}, 'text');
|
|
223
244
|
}
|
|
224
245
|
}
|
|
225
246
|
|
|
226
247
|
@defineProps(props)
|
|
227
|
-
export class Box extends
|
|
248
|
+
export class Box extends MarkBase<BoxGeometry> {
|
|
228
249
|
constructor() {
|
|
229
250
|
super({}, 'box');
|
|
230
251
|
}
|
|
231
252
|
}
|
|
232
253
|
|
|
233
254
|
@defineProps(props)
|
|
234
|
-
export class LineX extends
|
|
255
|
+
export class LineX extends MarkBase<LineXMark> {
|
|
235
256
|
constructor() {
|
|
236
257
|
super({}, 'lineX');
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
260
|
|
|
240
261
|
@defineProps(props)
|
|
241
|
-
export class LineY extends
|
|
262
|
+
export class LineY extends MarkBase<LineYMark> {
|
|
242
263
|
constructor() {
|
|
243
264
|
super({}, 'lineY');
|
|
244
265
|
}
|
|
245
266
|
}
|
|
246
267
|
|
|
247
268
|
@defineProps(props)
|
|
248
|
-
export class Range extends
|
|
269
|
+
export class Range extends MarkBase<RangeMark> {
|
|
249
270
|
constructor() {
|
|
250
271
|
super({}, 'range');
|
|
251
272
|
}
|
|
252
273
|
}
|
|
253
274
|
|
|
254
275
|
@defineProps(props)
|
|
255
|
-
export class RangeX extends
|
|
276
|
+
export class RangeX extends MarkBase<RangeXMark> {
|
|
256
277
|
constructor() {
|
|
257
278
|
super({}, 'rangeX');
|
|
258
279
|
}
|
|
259
280
|
}
|
|
260
281
|
|
|
261
282
|
@defineProps(props)
|
|
262
|
-
export class RangeY extends
|
|
283
|
+
export class RangeY extends MarkBase<RangeYMark> {
|
|
263
284
|
constructor() {
|
|
264
285
|
super({}, 'rangeY');
|
|
265
286
|
}
|
|
266
287
|
}
|
|
267
288
|
|
|
268
289
|
@defineProps(props)
|
|
269
|
-
export class Connector extends
|
|
290
|
+
export class Connector extends MarkBase<ConnectorMark> {
|
|
270
291
|
constructor() {
|
|
271
292
|
super({}, 'connector');
|
|
272
293
|
}
|
|
273
294
|
}
|
|
274
295
|
|
|
275
296
|
@defineProps(props)
|
|
276
|
-
export class Shape extends
|
|
297
|
+
export class Shape extends MarkBase<ShapeMark> {
|
|
277
298
|
constructor() {
|
|
278
299
|
super({}, 'shape');
|
|
279
300
|
}
|
|
280
301
|
}
|
|
281
302
|
|
|
282
303
|
@defineProps([...props, { name: 'layout', type: 'value' }])
|
|
283
|
-
export class Sankey extends
|
|
304
|
+
export class Sankey extends MarkBase<SankeyMark> {
|
|
284
305
|
constructor() {
|
|
285
306
|
super({}, 'sankey');
|
|
286
307
|
}
|
|
287
308
|
}
|
|
288
309
|
|
|
289
310
|
@defineProps([...props, { name: 'layout', type: 'value' }])
|
|
290
|
-
export class Treemap extends
|
|
311
|
+
export class Treemap extends MarkBase<ConnectorMark> {
|
|
291
312
|
constructor() {
|
|
292
313
|
super({}, 'treemap');
|
|
293
314
|
}
|
|
294
315
|
}
|
|
295
316
|
|
|
296
317
|
@defineProps(props)
|
|
297
|
-
export class Boxplot extends
|
|
318
|
+
export class Boxplot extends MarkBase<Boxplot> {
|
|
298
319
|
constructor() {
|
|
299
320
|
super({}, 'boxplot');
|
|
300
321
|
}
|
|
301
322
|
}
|
|
302
323
|
|
|
303
324
|
@defineProps([...props, { name: 'layout', type: 'value' }])
|
|
304
|
-
export class Pack extends
|
|
325
|
+
export class Pack extends MarkBase<Pack> {
|
|
305
326
|
constructor() {
|
|
306
327
|
super({}, 'pack');
|
|
307
328
|
}
|
|
308
329
|
}
|
|
309
330
|
|
|
310
331
|
@defineProps([...props, { name: 'layout', type: 'value' }])
|
|
311
|
-
export class ForceGraph extends
|
|
332
|
+
export class ForceGraph extends MarkBase<ForceGraph> {
|
|
312
333
|
constructor() {
|
|
313
334
|
super({}, 'forceGraph');
|
|
314
335
|
}
|
|
315
336
|
}
|
|
316
337
|
|
|
317
338
|
@defineProps([...props, { name: 'layout', type: 'value' }])
|
|
318
|
-
export class Tree extends
|
|
339
|
+
export class Tree extends MarkBase<Tree> {
|
|
319
340
|
constructor() {
|
|
320
341
|
super({}, 'tree');
|
|
321
342
|
}
|
|
322
343
|
}
|
|
323
344
|
|
|
324
345
|
@defineProps([...props, { name: 'layout', type: 'object' }])
|
|
325
|
-
export class WordCloud extends
|
|
346
|
+
export class WordCloud extends MarkBase<WordCloud> {
|
|
326
347
|
constructor() {
|
|
327
348
|
super({}, 'wordCloud');
|
|
328
349
|
}
|
package/src/api/mark/types.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type API<Props extends Geometry, Mark> = {
|
|
|
11
11
|
style: ObjectAttribute<Props['style'], Mark>;
|
|
12
12
|
axis: ObjectAttribute<Props['axis'], Mark>;
|
|
13
13
|
slider: ObjectAttribute<Props['slider'], Mark>;
|
|
14
|
+
scrollbar: ObjectAttribute<Props['scrollbar'], Mark>;
|
|
14
15
|
legend: ObjectAttribute<Props['legend'], Mark>;
|
|
15
16
|
layout: ValueAttribute<Props['layout'], Mark>;
|
|
16
17
|
};
|
package/src/api/node.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { emitEvent, CHART_LIFE_CIRCLE } from '../utils/event';
|
|
2
1
|
import { Chart } from './chart';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -116,16 +115,6 @@ export class Node<
|
|
|
116
115
|
return nodes;
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
changeData(data: any) {
|
|
120
|
-
// Find the root chart and render.
|
|
121
|
-
let root: Node = this;
|
|
122
|
-
while (root && root.parentNode) {
|
|
123
|
-
root = root.parentNode;
|
|
124
|
-
}
|
|
125
|
-
this.attr('data', data);
|
|
126
|
-
(root as Chart).render();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
118
|
/**
|
|
130
119
|
* Apply specified callback to the node value.
|
|
131
120
|
*/
|
|
@@ -136,4 +125,13 @@ export class Node<
|
|
|
136
125
|
callback(this.map(), ...params);
|
|
137
126
|
return this;
|
|
138
127
|
}
|
|
128
|
+
|
|
129
|
+
root(): Chart {
|
|
130
|
+
// Find the root chart and render.
|
|
131
|
+
let root: Node = this;
|
|
132
|
+
while (root && root.parentNode) {
|
|
133
|
+
root = root.parentNode;
|
|
134
|
+
}
|
|
135
|
+
return root as Chart;
|
|
136
|
+
}
|
|
139
137
|
}
|
package/src/component/axis.ts
CHANGED
|
@@ -261,11 +261,11 @@ function inferOverrideStyle(
|
|
|
261
261
|
startPos: [x, y],
|
|
262
262
|
endPos: [x + width, y],
|
|
263
263
|
};
|
|
264
|
-
} else if (position === 'left' || position === '
|
|
264
|
+
} else if (position === 'left' || position === 'centerVertical') {
|
|
265
265
|
return {
|
|
266
266
|
startPos: [x + width, y],
|
|
267
267
|
endPos: [x + width, y + height],
|
|
268
|
-
showLine: position === '
|
|
268
|
+
showLine: position === 'centerVertical' ? true : undefined,
|
|
269
269
|
};
|
|
270
270
|
} else if (position === 'right') {
|
|
271
271
|
return {
|
|
@@ -283,7 +283,7 @@ function inferOverrideStyle(
|
|
|
283
283
|
return {
|
|
284
284
|
startPos: [x, y + height],
|
|
285
285
|
endPos: [x + width, y + height],
|
|
286
|
-
showLine: position === '
|
|
286
|
+
showLine: position === 'centerHorizontal' ? true : undefined,
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
|
|
@@ -342,7 +342,7 @@ const ArcAxis = (options) => {
|
|
|
342
342
|
};
|
|
343
343
|
|
|
344
344
|
function inferDefaultStyle(scale, theme, position, direction) {
|
|
345
|
-
const p = position === '
|
|
345
|
+
const p = position === 'centerVertical' ? 'left' : position;
|
|
346
346
|
|
|
347
347
|
const themeStyle = Object.assign(
|
|
348
348
|
{},
|
|
@@ -371,6 +371,17 @@ function inferDefaultStyle(scale, theme, position, direction) {
|
|
|
371
371
|
return themeStyle;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
+
function isHorizontal(position): boolean {
|
|
375
|
+
switch (position) {
|
|
376
|
+
case 'top':
|
|
377
|
+
case 'bottom':
|
|
378
|
+
case 'centerHorizontal':
|
|
379
|
+
return true;
|
|
380
|
+
default:
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
374
385
|
const LinearAxis: GCC<AxisOptions> = (options) => {
|
|
375
386
|
const {
|
|
376
387
|
order,
|
|
@@ -436,7 +447,13 @@ const LinearAxis: GCC<AxisOptions> = (options) => {
|
|
|
436
447
|
...overrideStyle,
|
|
437
448
|
};
|
|
438
449
|
|
|
439
|
-
return new AxisComponent({
|
|
450
|
+
return new AxisComponent({
|
|
451
|
+
className: 'axis',
|
|
452
|
+
style: {
|
|
453
|
+
...axisStyle,
|
|
454
|
+
horizontal: isHorizontal(position),
|
|
455
|
+
},
|
|
456
|
+
});
|
|
440
457
|
};
|
|
441
458
|
};
|
|
442
459
|
|