@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
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { ThemeComponent as TC, Theme } from '../runtime';
|
|
2
|
+
|
|
3
|
+
export type AcademyOptions = Theme;
|
|
4
|
+
|
|
5
|
+
const COLORS = {
|
|
6
|
+
BLACK: '#000',
|
|
7
|
+
WHITE: '#fff',
|
|
8
|
+
STROKE: '#888',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const BACKGROUND_COLOR = 'transparent';
|
|
12
|
+
|
|
13
|
+
export const Academy: TC<AcademyOptions> = (options) => {
|
|
14
|
+
const DEFAULT_COLOR = '#4e79a7';
|
|
15
|
+
const defaultOptions: Theme = {
|
|
16
|
+
defaultColor: DEFAULT_COLOR,
|
|
17
|
+
defaultCategory10: 'tableau10',
|
|
18
|
+
defaultCategory20: 'tableau10',
|
|
19
|
+
defaultSize: 1,
|
|
20
|
+
elementActiveStroke: COLORS.BLACK,
|
|
21
|
+
enter: {
|
|
22
|
+
duration: 300,
|
|
23
|
+
fill: 'both',
|
|
24
|
+
delay: 0,
|
|
25
|
+
},
|
|
26
|
+
update: {
|
|
27
|
+
duration: 300,
|
|
28
|
+
fill: 'both',
|
|
29
|
+
delay: 0,
|
|
30
|
+
},
|
|
31
|
+
exit: {
|
|
32
|
+
duration: 300,
|
|
33
|
+
fill: 'both',
|
|
34
|
+
delay: 0,
|
|
35
|
+
},
|
|
36
|
+
// --- Theme of area style
|
|
37
|
+
viewFill: BACKGROUND_COLOR,
|
|
38
|
+
plotFill: 'transparent',
|
|
39
|
+
mainFill: 'transparent',
|
|
40
|
+
contentFill: 'transparent',
|
|
41
|
+
// --- Theme of mark shape
|
|
42
|
+
line: {
|
|
43
|
+
line: {
|
|
44
|
+
fill: '',
|
|
45
|
+
strokeOpacity: 1,
|
|
46
|
+
lineWidth: 1,
|
|
47
|
+
connectStroke: '#aaa',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
point: {
|
|
51
|
+
point: {
|
|
52
|
+
r: 3,
|
|
53
|
+
fillOpacity: 0.95,
|
|
54
|
+
lineWidth: 0,
|
|
55
|
+
},
|
|
56
|
+
hollow: {
|
|
57
|
+
r: 3,
|
|
58
|
+
strokeOpacity: 0.95,
|
|
59
|
+
lineWidth: 1,
|
|
60
|
+
},
|
|
61
|
+
plus: {
|
|
62
|
+
r: 3,
|
|
63
|
+
strokeOpacity: 0.95,
|
|
64
|
+
lineWidth: 3,
|
|
65
|
+
},
|
|
66
|
+
diamond: {
|
|
67
|
+
r: 3,
|
|
68
|
+
strokeOpacity: 0.95,
|
|
69
|
+
lineWidth: 1,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
interval: {
|
|
73
|
+
rect: {
|
|
74
|
+
fillOpacity: 0.95,
|
|
75
|
+
},
|
|
76
|
+
hollow: {
|
|
77
|
+
fill: '',
|
|
78
|
+
strokeOpacity: 1,
|
|
79
|
+
lineWidth: 2,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
area: {
|
|
83
|
+
area: {
|
|
84
|
+
fillOpacity: 0.85,
|
|
85
|
+
lineWidth: 0,
|
|
86
|
+
connectFill: COLORS.BLACK,
|
|
87
|
+
connectFillOpacity: 0.1,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
polygon: {
|
|
91
|
+
polygon: {
|
|
92
|
+
fillOpacity: 0.95,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
cell: {
|
|
96
|
+
cell: {
|
|
97
|
+
fillOpacity: 0.95,
|
|
98
|
+
},
|
|
99
|
+
hollow: {
|
|
100
|
+
fill: '',
|
|
101
|
+
strokeOpacity: 1,
|
|
102
|
+
lineWidth: 2,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
rect: {
|
|
106
|
+
rect: {
|
|
107
|
+
fillOpacity: 0.95,
|
|
108
|
+
},
|
|
109
|
+
hollow: {
|
|
110
|
+
fill: '',
|
|
111
|
+
strokeOpacity: 1,
|
|
112
|
+
lineWidth: 2,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
link: {
|
|
116
|
+
link: {
|
|
117
|
+
fill: '',
|
|
118
|
+
strokeOpacity: 1,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
vector: {
|
|
122
|
+
vector: {
|
|
123
|
+
fillOpacity: 1,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
box: {
|
|
127
|
+
box: {
|
|
128
|
+
fillOpacity: 0.95,
|
|
129
|
+
stroke: '#1D2129',
|
|
130
|
+
lineWidth: 1,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
text: {
|
|
134
|
+
text: {
|
|
135
|
+
fill: '#1D2129',
|
|
136
|
+
fontSize: 10,
|
|
137
|
+
strokeWidth: 0,
|
|
138
|
+
connectorStroke: COLORS.STROKE,
|
|
139
|
+
connectorStrokeOpacity: 0.45,
|
|
140
|
+
connectorLineWidth: 1,
|
|
141
|
+
backgroundFill: COLORS.STROKE,
|
|
142
|
+
backgroundFillOpacity: 0.15,
|
|
143
|
+
backgroundPadding: [2, 4],
|
|
144
|
+
startMarkerSymbol: 'circle',
|
|
145
|
+
startMarkerSize: 4,
|
|
146
|
+
endMarkerSymbol: 'circle',
|
|
147
|
+
endMarkerSize: 4,
|
|
148
|
+
},
|
|
149
|
+
badge: {
|
|
150
|
+
fill: '#1D2129',
|
|
151
|
+
fillOpacity: 0.65,
|
|
152
|
+
strokeWidth: 0,
|
|
153
|
+
fontSize: 10,
|
|
154
|
+
textAlign: 'center',
|
|
155
|
+
textBaseline: 'middle',
|
|
156
|
+
markerFill: COLORS.STROKE,
|
|
157
|
+
markerFillOpacity: 0.25,
|
|
158
|
+
markerStrokeOpacity: 0,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
lineX: {
|
|
162
|
+
line: {
|
|
163
|
+
stroke: COLORS.STROKE,
|
|
164
|
+
strokeOpacity: 0.45,
|
|
165
|
+
lineWidth: 1,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
lineY: {
|
|
169
|
+
line: {
|
|
170
|
+
stroke: COLORS.STROKE,
|
|
171
|
+
strokeOpacity: 0.45,
|
|
172
|
+
lineWidth: 1,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
rangeX: {
|
|
176
|
+
range: {
|
|
177
|
+
fill: COLORS.STROKE,
|
|
178
|
+
fillOpacity: 0.15,
|
|
179
|
+
lineWidth: 0,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
rangeY: {
|
|
183
|
+
range: {
|
|
184
|
+
fill: COLORS.STROKE,
|
|
185
|
+
fillOpacity: 0.15,
|
|
186
|
+
lineWidth: 0,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
connector: {
|
|
190
|
+
connector: {
|
|
191
|
+
stroke: COLORS.STROKE,
|
|
192
|
+
strokeOpacity: 0.45,
|
|
193
|
+
lineWidth: 1,
|
|
194
|
+
connectLength1: 12,
|
|
195
|
+
endMarker: true,
|
|
196
|
+
endMarkerSize: 6,
|
|
197
|
+
endMarkerFill: COLORS.STROKE,
|
|
198
|
+
endMarkerFillOpacity: 0.95,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
interaction: {
|
|
202
|
+
active: {
|
|
203
|
+
line: {
|
|
204
|
+
line: { lineWidth: 3 },
|
|
205
|
+
},
|
|
206
|
+
interval: {
|
|
207
|
+
rect: { stroke: COLORS.BLACK },
|
|
208
|
+
},
|
|
209
|
+
area: {
|
|
210
|
+
area: { fillOpacity: 0.5 },
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
inactive: {
|
|
214
|
+
area: {
|
|
215
|
+
area: { fillOpacity: 0.3 },
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
selected: {},
|
|
219
|
+
disabled: {},
|
|
220
|
+
},
|
|
221
|
+
axis: {
|
|
222
|
+
titleFill: COLORS.BLACK,
|
|
223
|
+
titleFillOpacity: 1,
|
|
224
|
+
titleFontSize: 11,
|
|
225
|
+
titleFontWeight: 'bold',
|
|
226
|
+
titleSpacing: 12,
|
|
227
|
+
line: true,
|
|
228
|
+
lineStroke: '#888',
|
|
229
|
+
lineStrokeOpacity: 1,
|
|
230
|
+
lineLineWidth: 1,
|
|
231
|
+
lineArrow: null,
|
|
232
|
+
tickStroke: COLORS.STROKE,
|
|
233
|
+
tickStrokeOpacity: 1,
|
|
234
|
+
tickLineWidth: 1,
|
|
235
|
+
tickLength: 5,
|
|
236
|
+
labelFill: COLORS.BLACK,
|
|
237
|
+
labelFillOpacity: 1,
|
|
238
|
+
labelFontSize: 10,
|
|
239
|
+
labelAutoRotate: false,
|
|
240
|
+
labelFontWeight: 'normal',
|
|
241
|
+
labelSpacing: 4,
|
|
242
|
+
labelAlign: 'horizontal',
|
|
243
|
+
gridStroke: '#ddd',
|
|
244
|
+
gridStrokeOpacity: 1,
|
|
245
|
+
gridLineWidth: 1,
|
|
246
|
+
gridLineDash: [0, 0],
|
|
247
|
+
titleTransformOrigin: 'center',
|
|
248
|
+
},
|
|
249
|
+
axisTop: {
|
|
250
|
+
titlePosition: 'top',
|
|
251
|
+
titleSpacing: 0,
|
|
252
|
+
titleTextBaseline: 'middle',
|
|
253
|
+
labelDirection: 'negative',
|
|
254
|
+
tickDirection: 'negative',
|
|
255
|
+
gridDirection: 'positive',
|
|
256
|
+
},
|
|
257
|
+
axisBottom: {
|
|
258
|
+
titleSpacing: 4,
|
|
259
|
+
titleTextBaseline: 'bottom',
|
|
260
|
+
labelSpacing: 8,
|
|
261
|
+
labelDirection: 'positive',
|
|
262
|
+
tickDirection: 'positive',
|
|
263
|
+
gridDirection: 'negative',
|
|
264
|
+
},
|
|
265
|
+
axisLeft: {
|
|
266
|
+
titleTextBaseline: 'middle',
|
|
267
|
+
titleSpacing: 4,
|
|
268
|
+
titlePosition: 'left',
|
|
269
|
+
titleTransformOrigin: 'center',
|
|
270
|
+
titleTransform: `translate(50%, 0) rotate(-90) translate(0, -50%)`,
|
|
271
|
+
labelSpacing: 4,
|
|
272
|
+
labelDirection: 'positive',
|
|
273
|
+
tickDirection: 'positive',
|
|
274
|
+
gridDirection: 'negative',
|
|
275
|
+
},
|
|
276
|
+
axisRight: {
|
|
277
|
+
titleTextBaseline: 'top',
|
|
278
|
+
titleSpacing: 0,
|
|
279
|
+
titlePosition: 'right',
|
|
280
|
+
titleTransformOrigin: 'center',
|
|
281
|
+
titleTransform: `translate(-50%, 0) rotate(-90)`,
|
|
282
|
+
labelSpacing: 4,
|
|
283
|
+
labelDirection: 'negative',
|
|
284
|
+
tickDirection: 'negative',
|
|
285
|
+
gridDirection: 'positive',
|
|
286
|
+
},
|
|
287
|
+
axisArcY: {
|
|
288
|
+
titlePosition: 'top',
|
|
289
|
+
titleSpacing: 0,
|
|
290
|
+
titleTextBaseline: 'bottom',
|
|
291
|
+
gridDirection: 'negative',
|
|
292
|
+
gridConnect: 'arc',
|
|
293
|
+
gridControlAngles: [90, 180, 360],
|
|
294
|
+
gridType: 'surround',
|
|
295
|
+
girdClosed: true,
|
|
296
|
+
},
|
|
297
|
+
legend: {
|
|
298
|
+
padding: 8,
|
|
299
|
+
showTitle: false,
|
|
300
|
+
titleFill: COLORS.BLACK,
|
|
301
|
+
titleFillOpacity: 1,
|
|
302
|
+
titleFontSize: 11,
|
|
303
|
+
titleFontWeight: 'bold',
|
|
304
|
+
titleSpacing: 4,
|
|
305
|
+
// legend marker
|
|
306
|
+
itemMarkerFill: DEFAULT_COLOR,
|
|
307
|
+
itemMarkerFillOpacity: 1,
|
|
308
|
+
itemMarkerSize: 8,
|
|
309
|
+
itemSpacing: [5, 4],
|
|
310
|
+
itemLabelFill: COLORS.BLACK,
|
|
311
|
+
itemLabelFillOpacity: 1,
|
|
312
|
+
itemLabelFontSize: 10,
|
|
313
|
+
itemLabelFontWeight: 'normal',
|
|
314
|
+
itemValueFill: COLORS.BLACK,
|
|
315
|
+
itemValueFillOpacity: 1,
|
|
316
|
+
itemValueFontSize: 10,
|
|
317
|
+
itemValueFontWeight: 'normal',
|
|
318
|
+
itemBackgroundFill: 'transparent',
|
|
319
|
+
// [todo] rename legend navigator
|
|
320
|
+
navButtonFill: COLORS.BLACK,
|
|
321
|
+
navButtonFillOpacity: 0.45,
|
|
322
|
+
navButtonSize: 6,
|
|
323
|
+
navPageNumFill: COLORS.BLACK,
|
|
324
|
+
navPageNumFillOpacity: 0.45,
|
|
325
|
+
navPageNumFontSize: 10,
|
|
326
|
+
// others
|
|
327
|
+
backgroundFill: 'transparent',
|
|
328
|
+
},
|
|
329
|
+
continuousLegend: {
|
|
330
|
+
showTitle: false,
|
|
331
|
+
labelFill: COLORS.BLACK,
|
|
332
|
+
labelFillOpacity: 0.45,
|
|
333
|
+
labelFontSize: 10,
|
|
334
|
+
labelFontWeight: 'normal',
|
|
335
|
+
handleWidth: 10,
|
|
336
|
+
handleHeight: 12,
|
|
337
|
+
handleMarkerFill: COLORS.BLACK,
|
|
338
|
+
handleMarkerFillOpacity: 0.6,
|
|
339
|
+
handleMarkerStroke: COLORS.BLACK,
|
|
340
|
+
handleMarkerStrokeOpacity: 0.25,
|
|
341
|
+
handleMarkerLineWidth: 1,
|
|
342
|
+
handleLabelFill: COLORS.BLACK,
|
|
343
|
+
handleLabelFillOpacity: 0.45,
|
|
344
|
+
handleLabelFontSize: 10,
|
|
345
|
+
handleLabelFontWeight: 'normal',
|
|
346
|
+
},
|
|
347
|
+
label: {
|
|
348
|
+
fill: COLORS.BLACK,
|
|
349
|
+
fillOpacity: 0.65,
|
|
350
|
+
fontSize: 10,
|
|
351
|
+
fontWeight: 'normal',
|
|
352
|
+
stroke: null,
|
|
353
|
+
offset: 12,
|
|
354
|
+
connectorStroke: COLORS.BLACK,
|
|
355
|
+
connectorStrokeOpacity: 0.45,
|
|
356
|
+
connectorLineWidth: 1,
|
|
357
|
+
connectorLength: 12,
|
|
358
|
+
connectorLength2: 8,
|
|
359
|
+
connectorDistance: 4,
|
|
360
|
+
},
|
|
361
|
+
innerLabel: {
|
|
362
|
+
fill: COLORS.WHITE,
|
|
363
|
+
fontSize: 10,
|
|
364
|
+
fillOpacity: 0.85,
|
|
365
|
+
fontWeight: 'normal',
|
|
366
|
+
stroke: null,
|
|
367
|
+
offset: 0,
|
|
368
|
+
},
|
|
369
|
+
slider: {
|
|
370
|
+
trackSize: 16,
|
|
371
|
+
backgroundFill: COLORS.STROKE,
|
|
372
|
+
backgroundFillOpacity: 0.05,
|
|
373
|
+
selectionFill: DEFAULT_COLOR,
|
|
374
|
+
selectionFillOpacity: 0.15,
|
|
375
|
+
handleIconSize: 10,
|
|
376
|
+
handleIconFill: '#f7f7f7',
|
|
377
|
+
handleIconFillOpacity: 1,
|
|
378
|
+
handleIconStroke: COLORS.BLACK,
|
|
379
|
+
handleIconStrokeOpacity: 0.25,
|
|
380
|
+
handleIconLineWidth: 1,
|
|
381
|
+
handleIconRadius: 2,
|
|
382
|
+
handleLabelFill: COLORS.BLACK,
|
|
383
|
+
handleLabelFillOpacity: 0.45,
|
|
384
|
+
handleLabelFontSize: 10,
|
|
385
|
+
handleLabelFontWeight: 'normal',
|
|
386
|
+
},
|
|
387
|
+
scrollbar: {},
|
|
388
|
+
title: {
|
|
389
|
+
titleFill: COLORS.BLACK,
|
|
390
|
+
titleFillOpacity: 0.85,
|
|
391
|
+
titleFontSize: 14,
|
|
392
|
+
titleFontWeight: 'bold',
|
|
393
|
+
titleTextBaseline: 'top',
|
|
394
|
+
subtitleFill: COLORS.BLACK,
|
|
395
|
+
subtitleFillOpacity: 0.65,
|
|
396
|
+
subtitleFontSize: 12,
|
|
397
|
+
subtitleFontWeight: 'normal',
|
|
398
|
+
subtitleTextBaseline: 'top',
|
|
399
|
+
},
|
|
400
|
+
};
|
|
401
|
+
return Object.assign({}, defaultOptions, options);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
Academy.props = {};
|
package/src/theme/dark.ts
CHANGED
|
@@ -47,7 +47,6 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
47
47
|
fill: '',
|
|
48
48
|
strokeOpacity: 1,
|
|
49
49
|
lineWidth: 1,
|
|
50
|
-
connectStroke: '#666',
|
|
51
50
|
},
|
|
52
51
|
},
|
|
53
52
|
point: {
|
|
@@ -58,19 +57,16 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
58
57
|
},
|
|
59
58
|
hollow: {
|
|
60
59
|
r: 3,
|
|
61
|
-
fill: '',
|
|
62
60
|
strokeOpacity: 0.95,
|
|
63
61
|
lineWidth: 1,
|
|
64
62
|
},
|
|
65
63
|
plus: {
|
|
66
64
|
r: 3,
|
|
67
|
-
fill: '',
|
|
68
65
|
strokeOpacity: 0.95,
|
|
69
66
|
lineWidth: 3,
|
|
70
67
|
},
|
|
71
68
|
diamond: {
|
|
72
69
|
r: 3,
|
|
73
|
-
fill: '',
|
|
74
70
|
strokeOpacity: 0.95,
|
|
75
71
|
lineWidth: 1,
|
|
76
72
|
},
|
|
@@ -89,8 +85,6 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
89
85
|
area: {
|
|
90
86
|
fillOpacity: 0.85,
|
|
91
87
|
lineWidth: 0,
|
|
92
|
-
connectFill: COLORS.BLACK,
|
|
93
|
-
connectFillOpacity: 0.1,
|
|
94
88
|
},
|
|
95
89
|
},
|
|
96
90
|
polygon: {
|
|
@@ -132,7 +126,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
132
126
|
box: {
|
|
133
127
|
box: {
|
|
134
128
|
fillOpacity: 0.95,
|
|
135
|
-
stroke:
|
|
129
|
+
stroke: COLORS.BLACK,
|
|
136
130
|
lineWidth: 1,
|
|
137
131
|
},
|
|
138
132
|
},
|
|
@@ -281,6 +275,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
281
275
|
titleTransform: `translate(50%, 0) rotate(-90)`,
|
|
282
276
|
labelSpacing: 4,
|
|
283
277
|
labelDirection: 'positive',
|
|
278
|
+
labelAutoRotate: false,
|
|
284
279
|
tickDirection: 'positive',
|
|
285
280
|
gridDirection: 'negative',
|
|
286
281
|
},
|
|
@@ -363,6 +358,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
363
358
|
connectorStroke: COLORS.BLACK,
|
|
364
359
|
connectorStrokeOpacity: 0.45,
|
|
365
360
|
connectorLineWidth: 1,
|
|
361
|
+
connectorLength: 12,
|
|
366
362
|
connectorLength2: 8,
|
|
367
363
|
connectorDistance: 4,
|
|
368
364
|
},
|
|
@@ -375,7 +371,7 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
375
371
|
offset: 0,
|
|
376
372
|
},
|
|
377
373
|
slider: {
|
|
378
|
-
|
|
374
|
+
trackSize: 16,
|
|
379
375
|
backgroundFill: COLORS.STROKE,
|
|
380
376
|
backgroundFillOpacity: 1,
|
|
381
377
|
selectionFill: DEFAULT_COLOR,
|
|
@@ -394,18 +390,16 @@ export const Dark: TC<DarkOptions> = (options) => {
|
|
|
394
390
|
},
|
|
395
391
|
scrollbar: {},
|
|
396
392
|
title: {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
fontWeight: 'normal',
|
|
408
|
-
textBaseline: 'top',
|
|
393
|
+
titleFill: COLORS.BLACK,
|
|
394
|
+
titleFillOpacity: 0.85,
|
|
395
|
+
titleFontSize: 14,
|
|
396
|
+
titleFontWeight: 'bold',
|
|
397
|
+
titleTextBaseline: 'top',
|
|
398
|
+
subtitleFill: COLORS.BLACK,
|
|
399
|
+
subtitleFillOpacity: 0.65,
|
|
400
|
+
subtitleFontSize: 12,
|
|
401
|
+
subtitleFontWeight: 'normal',
|
|
402
|
+
subtitleTextBaseline: 'top',
|
|
409
403
|
},
|
|
410
404
|
};
|
|
411
405
|
return Object.assign({}, defaultOptions, options);
|
package/src/theme/index.ts
CHANGED
package/src/theme/light.ts
CHANGED
|
@@ -47,7 +47,6 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
47
47
|
fill: '',
|
|
48
48
|
strokeOpacity: 1,
|
|
49
49
|
lineWidth: 1,
|
|
50
|
-
connectStroke: '#aaa',
|
|
51
50
|
},
|
|
52
51
|
},
|
|
53
52
|
point: {
|
|
@@ -58,19 +57,16 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
58
57
|
},
|
|
59
58
|
hollow: {
|
|
60
59
|
r: 3,
|
|
61
|
-
fill: '',
|
|
62
60
|
strokeOpacity: 0.95,
|
|
63
61
|
lineWidth: 1,
|
|
64
62
|
},
|
|
65
63
|
plus: {
|
|
66
64
|
r: 3,
|
|
67
|
-
fill: '',
|
|
68
65
|
strokeOpacity: 0.95,
|
|
69
66
|
lineWidth: 3,
|
|
70
67
|
},
|
|
71
68
|
diamond: {
|
|
72
69
|
r: 3,
|
|
73
|
-
fill: '',
|
|
74
70
|
strokeOpacity: 0.95,
|
|
75
71
|
lineWidth: 1,
|
|
76
72
|
},
|
|
@@ -89,8 +85,6 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
89
85
|
area: {
|
|
90
86
|
fillOpacity: 0.85,
|
|
91
87
|
lineWidth: 0,
|
|
92
|
-
connectFill: COLORS.BLACK,
|
|
93
|
-
connectFillOpacity: 0.1,
|
|
94
88
|
},
|
|
95
89
|
},
|
|
96
90
|
polygon: {
|
|
@@ -132,7 +126,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
132
126
|
box: {
|
|
133
127
|
box: {
|
|
134
128
|
fillOpacity: 0.95,
|
|
135
|
-
stroke:
|
|
129
|
+
stroke: COLORS.BLACK,
|
|
136
130
|
lineWidth: 1,
|
|
137
131
|
},
|
|
138
132
|
},
|
|
@@ -281,6 +275,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
281
275
|
titleTransform: `translate(50%, 0) rotate(-90)`,
|
|
282
276
|
labelSpacing: 4,
|
|
283
277
|
labelDirection: 'positive',
|
|
278
|
+
labelAutoRotate: false,
|
|
284
279
|
tickDirection: 'positive',
|
|
285
280
|
gridDirection: 'negative',
|
|
286
281
|
},
|
|
@@ -329,7 +324,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
329
324
|
itemBackgroundFill: 'transparent',
|
|
330
325
|
// [todo] rename legend navigator
|
|
331
326
|
navButtonFill: COLORS.BLACK,
|
|
332
|
-
navButtonFillOpacity: 0.
|
|
327
|
+
navButtonFillOpacity: 0.65,
|
|
333
328
|
navPageNumFill: COLORS.BLACK,
|
|
334
329
|
navPageNumFillOpacity: 0.45,
|
|
335
330
|
navPageNumFontSize: 12,
|
|
@@ -364,6 +359,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
364
359
|
connectorStroke: COLORS.BLACK,
|
|
365
360
|
connectorStrokeOpacity: 0.45,
|
|
366
361
|
connectorLineWidth: 1,
|
|
362
|
+
connectorLength: 12,
|
|
367
363
|
connectorLength2: 8,
|
|
368
364
|
connectorDistance: 4,
|
|
369
365
|
},
|
|
@@ -376,7 +372,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
376
372
|
offset: 0,
|
|
377
373
|
},
|
|
378
374
|
slider: {
|
|
379
|
-
|
|
375
|
+
trackSize: 16,
|
|
380
376
|
backgroundFill: COLORS.STROKE,
|
|
381
377
|
backgroundFillOpacity: 1,
|
|
382
378
|
selectionFill: DEFAULT_COLOR,
|
|
@@ -393,20 +389,31 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
393
389
|
handleLabelFontSize: 12,
|
|
394
390
|
handleLabelFontWeight: 'normal',
|
|
395
391
|
},
|
|
396
|
-
scrollbar: {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
392
|
+
scrollbar: {
|
|
393
|
+
padding: [2, 2, 2, 2],
|
|
394
|
+
trackSize: 10,
|
|
395
|
+
isRound: true,
|
|
396
|
+
slidable: true,
|
|
397
|
+
scrollable: true,
|
|
398
|
+
trackFill: '#e5e5e5',
|
|
399
|
+
trackFillOpacity: 0,
|
|
400
|
+
trackStroke: 'none',
|
|
401
|
+
thumbFill: '#000',
|
|
402
|
+
thumbFillOpacity: 0.15,
|
|
403
|
+
thumbStroke: 'none',
|
|
404
|
+
thumbHighlightedFillOpacity: 0.2,
|
|
403
405
|
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
406
|
+
title: {
|
|
407
|
+
titleFill: COLORS.BLACK,
|
|
408
|
+
titleFillOpacity: 0.85,
|
|
409
|
+
titleFontSize: 14,
|
|
410
|
+
titleFontWeight: 'bold',
|
|
411
|
+
titleTextBaseline: 'top',
|
|
412
|
+
subtitleFill: COLORS.BLACK,
|
|
413
|
+
subtitleFillOpacity: 0.65,
|
|
414
|
+
subtitleFontSize: 12,
|
|
415
|
+
subtitleFontWeight: 'normal',
|
|
416
|
+
subtitleTextBaseline: 'top',
|
|
410
417
|
},
|
|
411
418
|
};
|
|
412
419
|
return Object.assign({}, defaultOptions, options);
|
|
@@ -25,7 +25,9 @@ export const MaybeTooltip: TC<MaybeTooltipOptions> = (options) => {
|
|
|
25
25
|
const E = [[key, column(V)]];
|
|
26
26
|
// Only show channel with field.
|
|
27
27
|
if (V && fv !== null) {
|
|
28
|
-
|
|
28
|
+
const T = V.map((v) => ({ value: v, field: fv }));
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
E.push([`tooltip${index === 0 ? '' : index}`, column(T, fv)]);
|
|
29
31
|
index++;
|
|
30
32
|
}
|
|
31
33
|
return E;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AABB } from '@antv/g';
|
|
2
|
+
import { Vector2 } from './vector';
|
|
3
|
+
|
|
4
|
+
type Min = Vector2;
|
|
5
|
+
type Max = Vector2;
|
|
6
|
+
export type Bounds = [Min, Max];
|
|
7
|
+
|
|
8
|
+
export function parseAABB(min2: AABB): Bounds {
|
|
9
|
+
const { min, max } = min2;
|
|
10
|
+
return [
|
|
11
|
+
[min[0], min[1]],
|
|
12
|
+
[max[0], max[1]],
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Whether the `point` in `bounds`.
|
|
18
|
+
* @param point
|
|
19
|
+
* @param bounds
|
|
20
|
+
*/
|
|
21
|
+
export function isInBounds(point: Vector2, bounds: Bounds): boolean {
|
|
22
|
+
const [x, y] = point;
|
|
23
|
+
const [min, max] = bounds;
|
|
24
|
+
return x >= min[0] && x <= max[0] && y >= min[1] && y <= max[1];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether `b1` is overflow from `b2`.
|
|
29
|
+
* @param b1
|
|
30
|
+
* @param b2
|
|
31
|
+
*/
|
|
32
|
+
export function isOverflow(b1: Bounds, b2: Bounds): boolean {
|
|
33
|
+
const [min, max] = b1;
|
|
34
|
+
return !(isInBounds(min, b2) && isInBounds(max, b2));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Whether `b1` is overlap with `b2`.
|
|
39
|
+
* @param b1
|
|
40
|
+
* @param b2
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export function isOverlap(b1: Bounds, b2: Bounds): boolean {
|
|
44
|
+
const [min1, max1] = b1;
|
|
45
|
+
const [min2, max2] = b2;
|
|
46
|
+
return (
|
|
47
|
+
min1[0] < max2[0] &&
|
|
48
|
+
max1[0] > min2[0] &&
|
|
49
|
+
min1[1] < max2[1] &&
|
|
50
|
+
max1[1] > min2[1]
|
|
51
|
+
);
|
|
52
|
+
}
|