@antv/g2 5.0.0-beta.4 → 5.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g2-lite.min.js +5 -2
- package/dist/g2.min.js +5 -2
- package/esm/api/chart.d.ts +4 -0
- package/esm/api/chart.js +26 -4
- package/esm/api/chart.js.map +1 -1
- package/esm/api/mark/mark.js +1 -2
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/mark/types.d.ts +1 -2
- package/esm/component/axis.js +23 -9
- 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 +2 -4
- 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/composition/mark.js +2 -1
- package/esm/composition/mark.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/interaction/builtin/brushHighlight.d.ts +1 -1
- package/esm/interaction/index.d.ts +8 -0
- package/esm/interaction/index.js +7 -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 +12 -0
- package/esm/interaction/native/brushFilter.js +147 -0
- package/esm/interaction/native/brushFilter.js.map +1 -0
- package/esm/interaction/native/brushHighlight.d.ts +40 -0
- package/esm/interaction/native/brushHighlight.js +341 -0
- package/esm/interaction/native/brushHighlight.js.map +1 -0
- package/esm/interaction/native/brushXFilter.d.ts +1 -0
- package/esm/interaction/native/brushXFilter.js +6 -0
- package/esm/interaction/native/brushXFilter.js.map +1 -0
- package/esm/interaction/native/brushXHighlight.d.ts +6 -0
- package/esm/interaction/native/brushXHighlight.js +9 -0
- package/esm/interaction/native/brushXHighlight.js.map +1 -0
- package/esm/interaction/native/brushYFilter.d.ts +1 -0
- package/esm/interaction/native/brushYFilter.js +6 -0
- package/esm/interaction/native/brushYFilter.js.map +1 -0
- package/esm/interaction/native/brushYHighlight.d.ts +6 -0
- package/esm/interaction/native/brushYHighlight.js +9 -0
- package/esm/interaction/native/brushYHighlight.js.map +1 -0
- package/esm/interaction/native/legendFilter.js +3 -12
- package/esm/interaction/native/legendFilter.js.map +1 -1
- package/esm/interaction/native/tooltip.js +101 -32
- package/esm/interaction/native/tooltip.js.map +1 -1
- package/esm/interaction/native/utils.d.ts +8 -0
- package/esm/interaction/native/utils.js +31 -0
- package/esm/interaction/native/utils.js.map +1 -1
- package/esm/label-transform/contrastReverse.d.ts +9 -0
- package/esm/label-transform/contrastReverse.js +48 -0
- package/esm/label-transform/contrastReverse.js.map +1 -0
- package/esm/label-transform/index.d.ts +8 -8
- package/esm/label-transform/index.js +4 -4
- package/esm/label-transform/index.js.map +1 -1
- package/esm/label-transform/overflowHide.d.ts +7 -0
- package/esm/label-transform/overflowHide.js +18 -0
- package/esm/label-transform/overflowHide.js.map +1 -0
- package/esm/label-transform/overlapDodgeY.d.ts +7 -0
- package/esm/label-transform/{dodgeY.js → overlapDodgeY.js} +4 -4
- package/esm/label-transform/overlapDodgeY.js.map +1 -0
- package/esm/label-transform/overlapHide.d.ts +7 -0
- package/esm/label-transform/overlapHide.js +24 -0
- package/esm/label-transform/overlapHide.js.map +1 -0
- package/esm/mark/area.js +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.js +33 -38
- 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.js +28 -6
- 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.js +17 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +16 -6
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +27 -9
- package/esm/runtime/types/options.d.ts +3 -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/label.js +3 -3
- package/esm/shape/label/label.js.map +1 -1
- package/esm/shape/label/position/area.d.ts +13 -0
- package/esm/shape/label/position/area.js +28 -0
- package/esm/shape/label/position/area.js.map +1 -0
- package/esm/shape/label/position/bottom.d.ts +1 -0
- package/esm/shape/label/position/bottom.js +2 -0
- package/esm/shape/label/position/bottom.js.map +1 -0
- package/esm/shape/label/position/bottomLeft.d.ts +1 -0
- package/esm/shape/label/position/bottomLeft.js +2 -0
- package/esm/shape/label/position/bottomLeft.js.map +1 -0
- package/esm/shape/label/position/bottomRight.d.ts +1 -0
- package/esm/shape/label/position/bottomRight.js +2 -0
- package/esm/shape/label/position/bottomRight.js.map +1 -0
- package/esm/shape/label/position/default.d.ts +18 -0
- package/esm/shape/label/position/default.js +107 -0
- package/esm/shape/label/position/default.js.map +1 -0
- package/esm/shape/label/position/index.d.ts +13 -0
- package/esm/shape/label/position/index.js +14 -0
- package/esm/shape/label/position/index.js.map +1 -0
- package/esm/shape/label/position/inside.d.ts +1 -0
- package/esm/shape/label/position/inside.js +2 -0
- package/esm/shape/label/position/inside.js.map +1 -0
- package/esm/shape/label/position/left.d.ts +1 -0
- package/esm/shape/label/position/left.js +2 -0
- package/esm/shape/label/position/left.js.map +1 -0
- package/esm/shape/label/position/outside.d.ts +18 -0
- package/esm/shape/label/position/outside.js +67 -0
- package/esm/shape/label/position/outside.js.map +1 -0
- package/esm/shape/label/position/right.d.ts +1 -0
- package/esm/shape/label/position/right.js +2 -0
- package/esm/shape/label/position/right.js.map +1 -0
- package/esm/shape/label/position/spider.d.ts +7 -0
- package/esm/shape/label/position/spider.js +34 -0
- package/esm/shape/label/position/spider.js.map +1 -0
- package/esm/shape/label/position/surround.d.ts +7 -0
- package/esm/shape/label/position/surround.js +35 -0
- package/esm/shape/label/position/surround.js.map +1 -0
- package/esm/shape/label/position/top.d.ts +1 -0
- package/esm/shape/label/position/top.js +2 -0
- package/esm/shape/label/position/top.js.map +1 -0
- package/esm/shape/label/position/topLeft.d.ts +1 -0
- package/esm/shape/label/position/topLeft.js +2 -0
- package/esm/shape/label/position/topLeft.js.map +1 -0
- package/esm/shape/label/position/topRight.d.ts +1 -0
- package/esm/shape/label/position/topRight.js +2 -0
- package/esm/shape/label/position/topRight.js.map +1 -0
- package/esm/shape/line/curve.js +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/composition.d.ts +2 -0
- package/esm/spec/data.d.ts +24 -9
- package/esm/spec/geometry.d.ts +2 -1
- package/esm/spec/interaction.d.ts +41 -6
- package/esm/spec/labelTransform.d.ts +24 -11
- package/esm/spec/theme.d.ts +5 -2
- package/esm/stdlib/index.js +8 -9
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.d.ts +3 -0
- package/esm/theme/academy.js +398 -0
- package/esm/theme/academy.js.map +1 -0
- package/esm/theme/dark.js +14 -20
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/theme/index.js.map +1 -1
- package/esm/theme/light.js +29 -22
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/maybeTooltip.js +3 -1
- package/esm/transform/maybeTooltip.js.map +1 -1
- package/esm/utils/bounds.d.ts +26 -0
- package/esm/utils/bounds.js +41 -0
- package/esm/utils/bounds.js.map +1 -0
- package/esm/utils/color.d.ts +6 -0
- package/esm/utils/color.js +7 -0
- package/esm/utils/color.js.map +1 -0
- package/esm/utils/coordinate.d.ts +1 -0
- package/esm/utils/coordinate.js +12 -0
- package/esm/utils/coordinate.js.map +1 -1
- package/esm/utils/helper.d.ts +1 -0
- package/esm/utils/helper.js +3 -0
- package/esm/utils/helper.js.map +1 -1
- package/lib/api/chart.d.ts +4 -0
- package/lib/api/chart.js +26 -4
- package/lib/api/chart.js.map +1 -1
- package/lib/api/mark/mark.js +1 -2
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/mark/types.d.ts +1 -2
- package/lib/component/axis.js +23 -9
- 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 +2 -4
- 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/composition/mark.js +2 -1
- package/lib/composition/mark.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/interaction/builtin/brushHighlight.d.ts +1 -1
- package/lib/interaction/index.d.ts +8 -0
- package/lib/interaction/index.js +15 -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 +12 -0
- package/lib/interaction/native/brushFilter.js +152 -0
- package/lib/interaction/native/brushFilter.js.map +1 -0
- package/lib/interaction/native/brushHighlight.d.ts +40 -0
- package/lib/interaction/native/brushHighlight.js +347 -0
- package/lib/interaction/native/brushHighlight.js.map +1 -0
- package/lib/interaction/native/brushXFilter.d.ts +1 -0
- package/lib/interaction/native/brushXFilter.js +10 -0
- package/lib/interaction/native/brushXFilter.js.map +1 -0
- package/lib/interaction/native/brushXHighlight.d.ts +6 -0
- package/lib/interaction/native/brushXHighlight.js +14 -0
- package/lib/interaction/native/brushXHighlight.js.map +1 -0
- package/lib/interaction/native/brushYFilter.d.ts +1 -0
- package/lib/interaction/native/brushYFilter.js +10 -0
- package/lib/interaction/native/brushYFilter.js.map +1 -0
- package/lib/interaction/native/brushYHighlight.d.ts +6 -0
- package/lib/interaction/native/brushYHighlight.js +14 -0
- package/lib/interaction/native/brushYHighlight.js.map +1 -0
- package/lib/interaction/native/legendFilter.js +4 -13
- package/lib/interaction/native/legendFilter.js.map +1 -1
- package/lib/interaction/native/tooltip.js +98 -29
- package/lib/interaction/native/tooltip.js.map +1 -1
- package/lib/interaction/native/utils.d.ts +8 -0
- package/lib/interaction/native/utils.js +37 -1
- package/lib/interaction/native/utils.js.map +1 -1
- package/lib/label-transform/contrastReverse.d.ts +9 -0
- package/lib/label-transform/contrastReverse.js +52 -0
- package/lib/label-transform/contrastReverse.js.map +1 -0
- package/lib/label-transform/index.d.ts +8 -8
- package/lib/label-transform/index.js +9 -9
- package/lib/label-transform/index.js.map +1 -1
- package/lib/label-transform/overflowHide.d.ts +7 -0
- package/lib/label-transform/overflowHide.js +22 -0
- package/lib/label-transform/overflowHide.js.map +1 -0
- package/lib/label-transform/overlapDodgeY.d.ts +7 -0
- package/lib/label-transform/{dodgeY.js → overlapDodgeY.js} +6 -6
- package/lib/label-transform/overlapDodgeY.js.map +1 -0
- package/lib/label-transform/overlapHide.d.ts +7 -0
- package/lib/label-transform/overlapHide.js +28 -0
- package/lib/label-transform/overlapHide.js.map +1 -0
- package/lib/mark/area.js +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.js +33 -38
- 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.js +28 -6
- 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.js +16 -4
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +16 -6
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +27 -9
- package/lib/runtime/types/options.d.ts +3 -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/label.js +3 -3
- package/lib/shape/label/label.js.map +1 -1
- package/lib/shape/label/position/area.d.ts +13 -0
- package/lib/shape/label/position/area.js +32 -0
- package/lib/shape/label/position/area.js.map +1 -0
- package/lib/shape/label/position/bottom.d.ts +1 -0
- package/lib/shape/label/position/bottom.js +6 -0
- package/lib/shape/label/position/bottom.js.map +1 -0
- package/lib/shape/label/position/bottomLeft.d.ts +1 -0
- package/lib/shape/label/position/bottomLeft.js +6 -0
- package/lib/shape/label/position/bottomLeft.js.map +1 -0
- package/lib/shape/label/position/bottomRight.d.ts +1 -0
- package/lib/shape/label/position/bottomRight.js +6 -0
- package/lib/shape/label/position/bottomRight.js.map +1 -0
- package/lib/shape/label/position/default.d.ts +18 -0
- package/lib/shape/label/{position.js → position/default.js} +24 -81
- package/lib/shape/label/position/default.js.map +1 -0
- package/lib/shape/label/position/index.d.ts +13 -0
- package/lib/shape/label/position/index.js +30 -0
- package/lib/shape/label/position/index.js.map +1 -0
- package/lib/shape/label/position/inside.d.ts +1 -0
- package/lib/shape/label/position/inside.js +6 -0
- package/lib/shape/label/position/inside.js.map +1 -0
- package/lib/shape/label/position/left.d.ts +1 -0
- package/lib/shape/label/position/left.js +6 -0
- package/lib/shape/label/position/left.js.map +1 -0
- package/lib/shape/label/position/outside.d.ts +18 -0
- package/lib/shape/label/position/outside.js +75 -0
- package/lib/shape/label/position/outside.js.map +1 -0
- package/lib/shape/label/position/right.d.ts +1 -0
- package/lib/shape/label/position/right.js +6 -0
- package/lib/shape/label/position/right.js.map +1 -0
- package/lib/shape/label/position/spider.d.ts +7 -0
- package/lib/shape/label/position/spider.js +38 -0
- package/lib/shape/label/position/spider.js.map +1 -0
- package/lib/shape/label/position/surround.d.ts +7 -0
- package/lib/shape/label/position/surround.js +39 -0
- package/lib/shape/label/position/surround.js.map +1 -0
- package/lib/shape/label/position/top.d.ts +1 -0
- package/lib/shape/label/position/top.js +6 -0
- package/lib/shape/label/position/top.js.map +1 -0
- package/lib/shape/label/position/topLeft.d.ts +1 -0
- package/lib/shape/label/position/topLeft.js +6 -0
- package/lib/shape/label/position/topLeft.js.map +1 -0
- package/lib/shape/label/position/topRight.d.ts +1 -0
- package/lib/shape/label/position/topRight.js +6 -0
- package/lib/shape/label/position/topRight.js.map +1 -0
- package/lib/shape/line/curve.js +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/composition.d.ts +2 -0
- package/lib/spec/data.d.ts +24 -9
- package/lib/spec/geometry.d.ts +2 -1
- package/lib/spec/interaction.d.ts +41 -6
- package/lib/spec/labelTransform.d.ts +24 -11
- package/lib/spec/theme.d.ts +5 -2
- package/lib/stdlib/index.js +3 -4
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.d.ts +3 -0
- package/lib/theme/academy.js +402 -0
- package/lib/theme/academy.js.map +1 -0
- package/lib/theme/dark.js +14 -20
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +3 -1
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/light.js +29 -22
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/maybeTooltip.js +3 -1
- package/lib/transform/maybeTooltip.js.map +1 -1
- package/lib/utils/bounds.d.ts +26 -0
- package/lib/utils/bounds.js +48 -0
- package/lib/utils/bounds.js.map +1 -0
- package/lib/utils/color.d.ts +6 -0
- package/lib/utils/color.js +11 -0
- package/lib/utils/color.js.map +1 -0
- package/lib/utils/coordinate.d.ts +1 -0
- package/lib/utils/coordinate.js +14 -1
- package/lib/utils/coordinate.js.map +1 -1
- package/lib/utils/helper.d.ts +1 -0
- package/lib/utils/helper.js +5 -1
- package/lib/utils/helper.js.map +1 -1
- package/package.json +2 -2
- package/src/api/chart.ts +29 -8
- package/src/api/mark/mark.ts +1 -2
- package/src/api/mark/types.ts +1 -2
- package/src/component/axis.ts +38 -16
- 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 +1 -3
- package/src/component/title.ts +69 -30
- package/src/composition/mark.ts +2 -0
- 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/interaction/index.ts +23 -16
- package/src/interaction/native/brushAxisHighlight.ts +194 -0
- package/src/interaction/native/brushFilter.ts +163 -0
- package/src/interaction/native/brushHighlight.ts +419 -0
- package/src/interaction/native/brushXFilter.ts +9 -0
- package/src/interaction/native/brushXHighlight.ts +13 -0
- package/src/interaction/native/brushYFilter.ts +9 -0
- package/src/interaction/native/brushYHighlight.ts +13 -0
- package/src/interaction/native/legendFilter.ts +3 -14
- package/src/interaction/native/tooltip.ts +128 -38
- package/src/interaction/native/utils.ts +40 -0
- package/src/label-transform/contrastReverse.ts +56 -0
- package/src/label-transform/index.ts +8 -8
- package/src/label-transform/overflowHide.ts +23 -0
- package/src/label-transform/{dodgeY.ts → overlapDodgeY.ts} +6 -6
- package/src/label-transform/overlapHide.ts +32 -0
- package/src/mark/area.ts +1 -1
- package/src/mark/boxplot.ts +3 -1
- package/src/runtime/component.ts +46 -47
- package/src/runtime/layout.ts +6 -6
- package/src/runtime/plot.ts +40 -6
- package/src/runtime/render.ts +6 -58
- package/src/runtime/scale.ts +15 -7
- package/src/runtime/transform.ts +19 -6
- package/src/runtime/types/common.ts +27 -10
- package/src/runtime/types/options.ts +3 -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/label.ts +4 -3
- package/src/shape/label/position/area.ts +39 -0
- package/src/shape/label/position/bottom.ts +1 -0
- package/src/shape/label/position/bottomLeft.ts +1 -0
- package/src/shape/label/position/bottomRight.ts +1 -0
- package/src/shape/label/{position.ts → position/default.ts} +26 -110
- package/src/shape/label/position/index.ts +13 -0
- package/src/shape/label/position/inside.ts +1 -0
- package/src/shape/label/position/left.ts +1 -0
- package/src/shape/label/position/outside.ts +121 -0
- package/src/shape/label/position/right.ts +1 -0
- package/src/shape/label/position/spider.ts +39 -0
- package/src/shape/label/position/surround.ts +40 -0
- package/src/shape/label/position/top.ts +1 -0
- package/src/shape/label/position/topLeft.ts +1 -0
- package/src/shape/label/position/topRight.ts +1 -0
- package/src/shape/line/curve.ts +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/composition.ts +2 -0
- package/src/spec/data.ts +25 -10
- package/src/spec/geometry.ts +3 -1
- package/src/spec/interaction.ts +59 -5
- package/src/spec/labelTransform.ts +29 -11
- package/src/spec/theme.ts +6 -2
- package/src/stdlib/index.ts +33 -9
- package/src/theme/academy.ts +404 -0
- package/src/theme/dark.ts +14 -20
- package/src/theme/index.ts +1 -0
- package/src/theme/light.ts +29 -22
- package/src/transform/maybeTooltip.ts +3 -1
- package/src/utils/bounds.ts +52 -0
- package/src/utils/color.ts +12 -0
- package/src/utils/coordinate.ts +12 -0
- package/src/utils/helper.ts +4 -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/label-transform/dodgeY.d.ts +0 -7
- package/esm/label-transform/dodgeY.js.map +0 -1
- package/esm/label-transform/hideOverlap.d.ts +0 -4
- package/esm/label-transform/hideOverlap.js +0 -48
- package/esm/label-transform/hideOverlap.js.map +0 -1
- package/esm/label-transform/spider.d.ts +0 -7
- package/esm/label-transform/spider.js +0 -30
- package/esm/label-transform/spider.js.map +0 -1
- package/esm/label-transform/surround.d.ts +0 -7
- package/esm/label-transform/surround.js +0 -30
- package/esm/label-transform/surround.js.map +0 -1
- package/esm/shape/label/position.d.ts +0 -25
- package/esm/shape/label/position.js +0 -169
- package/esm/shape/label/position.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/label-transform/dodgeY.d.ts +0 -7
- package/lib/label-transform/dodgeY.js.map +0 -1
- package/lib/label-transform/hideOverlap.d.ts +0 -4
- package/lib/label-transform/hideOverlap.js +0 -52
- package/lib/label-transform/hideOverlap.js.map +0 -1
- package/lib/label-transform/spider.d.ts +0 -7
- package/lib/label-transform/spider.js +0 -34
- package/lib/label-transform/spider.js.map +0 -1
- package/lib/label-transform/surround.d.ts +0 -7
- package/lib/label-transform/surround.js +0 -34
- package/lib/label-transform/surround.js.map +0 -1
- package/lib/shape/label/position.d.ts +0 -25
- package/lib/shape/label/position.js.map +0 -1
- package/src/data/subset.ts +0 -35
- package/src/label-transform/hideOverlap.ts +0 -62
- package/src/label-transform/spider.ts +0 -37
- package/src/label-transform/surround.ts +0 -37
package/src/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/composition.ts
CHANGED
|
@@ -24,6 +24,7 @@ export type Node =
|
|
|
24
24
|
|
|
25
25
|
export type MarkComposition = Geometry & {
|
|
26
26
|
title?: Title;
|
|
27
|
+
clip?: boolean;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export type ViewComposition = {
|
|
@@ -63,6 +64,7 @@ export type ViewComposition = {
|
|
|
63
64
|
on?: Record<string, EventType | EventType[]>;
|
|
64
65
|
// @todo
|
|
65
66
|
style?: Record<string, any>;
|
|
67
|
+
clip?: boolean;
|
|
66
68
|
};
|
|
67
69
|
|
|
68
70
|
export type SpaceLayerComposition = {
|
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
|
@@ -92,7 +92,8 @@ export type ChannelTypes =
|
|
|
92
92
|
| 'groupKey'
|
|
93
93
|
| 'label'
|
|
94
94
|
| 'position'
|
|
95
|
-
| 'series'
|
|
95
|
+
| 'series'
|
|
96
|
+
| `tooltip${number}`;
|
|
96
97
|
|
|
97
98
|
export type BaseGeometry<
|
|
98
99
|
T extends GeometryTypes,
|
|
@@ -127,6 +128,7 @@ export type BaseGeometry<
|
|
|
127
128
|
| boolean;
|
|
128
129
|
legend?: Partial<Record<'size' | 'color', Legend | boolean>> | boolean;
|
|
129
130
|
slider?: Partial<Record<'x' | 'y', any>>;
|
|
131
|
+
scrollbar?: Partial<Record<'x' | 'y', any>>;
|
|
130
132
|
coordinates?: Coordinate[];
|
|
131
133
|
style?: Record<string, any>;
|
|
132
134
|
interactions?: Interaction[];
|
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
|
|
|
@@ -14,7 +14,14 @@ export type Interaction =
|
|
|
14
14
|
| FisheyeInteraction
|
|
15
15
|
| ChartIndex
|
|
16
16
|
| CustomInteraction
|
|
17
|
-
| LegendFilterInteraction
|
|
17
|
+
| LegendFilterInteraction
|
|
18
|
+
| BrushHighlightInteraction
|
|
19
|
+
| BrushXHighlightInteraction
|
|
20
|
+
| BrushYHighlightInteraction
|
|
21
|
+
| BrushAxisHighlightInteraction
|
|
22
|
+
| BrushFilter
|
|
23
|
+
| BrushYFilter
|
|
24
|
+
| BrushXFilter;
|
|
18
25
|
// | ElementListHighlightInteraction
|
|
19
26
|
// | LegendActiveInteraction
|
|
20
27
|
// | LegendHighlightInteraction
|
|
@@ -37,6 +44,12 @@ export type InteractionTypes =
|
|
|
37
44
|
| 'fisheye'
|
|
38
45
|
| 'tooltip'
|
|
39
46
|
| 'legendFilter'
|
|
47
|
+
| 'brushXHighlight'
|
|
48
|
+
| 'brushYHighlight'
|
|
49
|
+
| 'brushHighlight'
|
|
50
|
+
| 'brushFilter'
|
|
51
|
+
| 'brushXFilter'
|
|
52
|
+
| 'brushYFilter'
|
|
40
53
|
| InteractionComponent;
|
|
41
54
|
// | 'elementListHighlight'
|
|
42
55
|
// | 'legendActive'
|
|
@@ -56,9 +69,50 @@ export type BrushInteraction = {
|
|
|
56
69
|
|
|
57
70
|
export type BrushHighlightInteraction = {
|
|
58
71
|
type?: 'brushHighlight';
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
brushKey?: string;
|
|
73
|
+
reverse?: boolean;
|
|
74
|
+
shared?: boolean;
|
|
75
|
+
series?: boolean;
|
|
76
|
+
facet?: boolean;
|
|
77
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
78
|
+
|
|
79
|
+
export type BrushXHighlightInteraction = {
|
|
80
|
+
type?: 'brushXHighlight';
|
|
81
|
+
brushKey?: string;
|
|
82
|
+
reverse?: boolean;
|
|
83
|
+
shared?: boolean;
|
|
84
|
+
series?: boolean;
|
|
85
|
+
facet?: boolean;
|
|
86
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
87
|
+
|
|
88
|
+
export type BrushYHighlightInteraction = {
|
|
89
|
+
type?: 'brushYHighlight';
|
|
90
|
+
brushKey?: string;
|
|
91
|
+
reverse?: boolean;
|
|
92
|
+
shared?: boolean;
|
|
93
|
+
series?: boolean;
|
|
94
|
+
facet?: boolean;
|
|
95
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
96
|
+
|
|
97
|
+
export type BrushAxisHighlightInteraction = {
|
|
98
|
+
type?: 'brushAxisHighlight';
|
|
99
|
+
reverse?: boolean;
|
|
100
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
101
|
+
|
|
102
|
+
export type BrushFilter = {
|
|
103
|
+
type?: 'brushFilter';
|
|
104
|
+
reverse?: boolean;
|
|
105
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
106
|
+
|
|
107
|
+
export type BrushXFilter = {
|
|
108
|
+
type?: 'brushXFilter';
|
|
109
|
+
reverse?: boolean;
|
|
110
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
111
|
+
|
|
112
|
+
export type BrushYFilter = {
|
|
113
|
+
type?: 'brushYFilter';
|
|
114
|
+
reverse?: boolean;
|
|
115
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
62
116
|
|
|
63
117
|
export type BrushVisibleInteraction = {
|
|
64
118
|
type?: 'brushVisible';
|
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
3
|
+
export type LabelTransform =
|
|
4
|
+
| OverlapHideTransform
|
|
5
|
+
| OverlapDodgeYTransform
|
|
6
|
+
| ContrastReverseTransform
|
|
7
|
+
| OverflowHideTransform;
|
|
8
|
+
|
|
9
|
+
export type OverlapHideTransform = {
|
|
10
|
+
type?: 'overlapHide';
|
|
11
|
+
/**
|
|
12
|
+
* The hide priority, is the comparator for label.sort().
|
|
13
|
+
*/
|
|
14
|
+
priority?: (a: DisplayObject, b: DisplayObject) => number;
|
|
5
15
|
};
|
|
6
16
|
|
|
7
|
-
export type
|
|
8
|
-
type?: '
|
|
9
|
-
|
|
17
|
+
export type OverlapDodgeYTransform = {
|
|
18
|
+
type?: 'overlapDodgeY';
|
|
19
|
+
maxIterations?: number;
|
|
10
20
|
maxError?: number;
|
|
11
21
|
padding?: number;
|
|
12
22
|
};
|
|
13
23
|
|
|
14
|
-
export type
|
|
15
|
-
type
|
|
16
|
-
|
|
24
|
+
export type ContrastReverseTransform = {
|
|
25
|
+
type: 'contrastReverse';
|
|
26
|
+
/**
|
|
27
|
+
* Transform when the contrast ratio < threshold.
|
|
28
|
+
* Default is `4.5`.
|
|
29
|
+
*/
|
|
30
|
+
threshold?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The optional color palette, default is [#000, #fff].
|
|
33
|
+
*/
|
|
34
|
+
palette?: string[];
|
|
17
35
|
};
|
|
18
36
|
|
|
19
|
-
export type
|
|
20
|
-
type
|
|
37
|
+
export type OverflowHideTransform = {
|
|
38
|
+
type: 'overflowHide';
|
|
21
39
|
};
|
package/src/spec/theme.ts
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
ThemeComponent,
|
|
4
4
|
} from '../runtime/types/component';
|
|
5
5
|
|
|
6
|
-
export type Theme = LightTheme | DarkTheme | CustomTheme;
|
|
6
|
+
export type Theme = LightTheme | DarkTheme | AcademyTheme | CustomTheme;
|
|
7
7
|
|
|
8
|
-
export type ThemeTypes = 'light' | 'dark' | ThemeComponent;
|
|
8
|
+
export type ThemeTypes = 'light' | 'dark' | 'academy' | ThemeComponent;
|
|
9
9
|
|
|
10
10
|
export type LightTheme = {
|
|
11
11
|
type?: 'light';
|
|
@@ -15,6 +15,10 @@ export type DarkTheme = {
|
|
|
15
15
|
type?: 'dark';
|
|
16
16
|
} & ThemeOptions;
|
|
17
17
|
|
|
18
|
+
export type AcademyTheme = {
|
|
19
|
+
type?: 'academy';
|
|
20
|
+
} & ThemeOptions;
|
|
21
|
+
|
|
18
22
|
export type CustomTheme = {
|
|
19
23
|
type?: ThemeComponent;
|
|
20
24
|
} & ThemeOptions;
|
package/src/stdlib/index.ts
CHANGED
|
@@ -131,7 +131,7 @@ import {
|
|
|
131
131
|
HollowPath,
|
|
132
132
|
Shape as CustomShape,
|
|
133
133
|
} from '../shape';
|
|
134
|
-
import { Light, Dark } from '../theme';
|
|
134
|
+
import { Light, Dark, Academy } from '../theme';
|
|
135
135
|
import {
|
|
136
136
|
AxisX,
|
|
137
137
|
AxisY,
|
|
@@ -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,
|
|
@@ -171,6 +173,13 @@ import {
|
|
|
171
173
|
Fisheye as ChartFisheye,
|
|
172
174
|
Tooltip,
|
|
173
175
|
LegendFilter,
|
|
176
|
+
BrushHighlight,
|
|
177
|
+
BrushXHighlight,
|
|
178
|
+
BrushYHighlight,
|
|
179
|
+
BrushAxisHighlight,
|
|
180
|
+
BrushFilter,
|
|
181
|
+
BrushXFilter,
|
|
182
|
+
BrushYFilter,
|
|
174
183
|
// ElementHighlightByX,
|
|
175
184
|
// ElementHighlightByColor,
|
|
176
185
|
// ElementListHighlight,
|
|
@@ -243,8 +252,8 @@ import {
|
|
|
243
252
|
Map,
|
|
244
253
|
Pick,
|
|
245
254
|
Rename,
|
|
246
|
-
Subset,
|
|
247
255
|
Fold,
|
|
256
|
+
Slice,
|
|
248
257
|
Inline,
|
|
249
258
|
Custom,
|
|
250
259
|
Cluster,
|
|
@@ -255,7 +264,12 @@ import {
|
|
|
255
264
|
Join,
|
|
256
265
|
Sort,
|
|
257
266
|
} from '../data';
|
|
258
|
-
import {
|
|
267
|
+
import {
|
|
268
|
+
OverlapDodgeY,
|
|
269
|
+
OverflowHide,
|
|
270
|
+
ContrastReverse,
|
|
271
|
+
OverlapHide,
|
|
272
|
+
} from '../label-transform';
|
|
259
273
|
import { geoLibrary } from '../geo';
|
|
260
274
|
|
|
261
275
|
export function createLibrary(): G2Library {
|
|
@@ -267,8 +281,8 @@ export function createLibrary(): G2Library {
|
|
|
267
281
|
'data.filter': DataFilter,
|
|
268
282
|
'data.pick': Pick,
|
|
269
283
|
'data.rename': Rename,
|
|
270
|
-
'data.subset': Subset,
|
|
271
284
|
'data.fold': Fold,
|
|
285
|
+
'data.slice': Slice,
|
|
272
286
|
'data.custom': Custom,
|
|
273
287
|
'data.map': Map,
|
|
274
288
|
'data.cluster': Cluster,
|
|
@@ -455,6 +469,7 @@ export function createLibrary(): G2Library {
|
|
|
455
469
|
'shape.path.hollow': HollowPath,
|
|
456
470
|
'theme.light': Light,
|
|
457
471
|
'theme.dark': Dark,
|
|
472
|
+
'theme.academy': Academy,
|
|
458
473
|
'component.axisX': AxisX,
|
|
459
474
|
'component.axisY': AxisY,
|
|
460
475
|
'component.legendCategory': LegendCategory,
|
|
@@ -462,6 +477,8 @@ export function createLibrary(): G2Library {
|
|
|
462
477
|
'component.title': TitleComponent,
|
|
463
478
|
'component.sliderX': SliderX,
|
|
464
479
|
'component.sliderY': SliderY,
|
|
480
|
+
'component.scrollbarX': ScrollbarX,
|
|
481
|
+
'component.scrollbarY': ScrollbarY,
|
|
465
482
|
'animation.scaleInX': ScaleInX,
|
|
466
483
|
'animation.scaleOutX': ScaleOutX,
|
|
467
484
|
'animation.scaleInY': ScaleInY,
|
|
@@ -485,6 +502,13 @@ export function createLibrary(): G2Library {
|
|
|
485
502
|
'interaction.chartIndex': ChartIndex,
|
|
486
503
|
'interaction.tooltip': Tooltip,
|
|
487
504
|
'interaction.legendFilter': LegendFilter,
|
|
505
|
+
'interaction.brushHighlight': BrushHighlight,
|
|
506
|
+
'interaction.brushXHighlight': BrushXHighlight,
|
|
507
|
+
'interaction.brushYHighlight': BrushYHighlight,
|
|
508
|
+
'interaction.brushAxisHighlight': BrushAxisHighlight,
|
|
509
|
+
'interaction.brushFilter': BrushFilter,
|
|
510
|
+
'interaction.brushXFilter': BrushXFilter,
|
|
511
|
+
'interaction.brushYFilter': BrushYFilter,
|
|
488
512
|
// 'interaction.elementSelected': ElementSelected,
|
|
489
513
|
// 'interaction.elementHighlight': ElementHighlight,
|
|
490
514
|
// 'interaction.elementHighlightByX': ElementHighlightByX,
|
|
@@ -495,7 +519,7 @@ export function createLibrary(): G2Library {
|
|
|
495
519
|
// 'interaction.tooltip': Tooltip,
|
|
496
520
|
// 'interaction.fisheye': FisheyeInteraction,
|
|
497
521
|
// 'interaction.brush': Brush,
|
|
498
|
-
|
|
522
|
+
|
|
499
523
|
// 'interaction.brushVisible': BrushVisible,
|
|
500
524
|
// 'interaction.activeRegion': ActiveRegion,
|
|
501
525
|
// 'interaction.ellipsisText': EllipsisText,
|
|
@@ -507,10 +531,10 @@ export function createLibrary(): G2Library {
|
|
|
507
531
|
'composition.repeatMatrix': RepeatMatrix,
|
|
508
532
|
'composition.facetCircle': FacetCircle,
|
|
509
533
|
'composition.timingKeyframe': TimingKeyframe,
|
|
510
|
-
'labelTransform.
|
|
511
|
-
'labelTransform.
|
|
512
|
-
'labelTransform.
|
|
513
|
-
'labelTransform.
|
|
534
|
+
'labelTransform.overlapHide': OverlapHide,
|
|
535
|
+
'labelTransform.overlapDodgeY': OverlapDodgeY,
|
|
536
|
+
'labelTransform.overflowHide': OverflowHide,
|
|
537
|
+
'labelTransform.contrastReverse': ContrastReverse,
|
|
514
538
|
...geoLibrary,
|
|
515
539
|
};
|
|
516
540
|
}
|