@antv/g2 5.0.0-beta.3 → 5.0.0-beta.5
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/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 +46 -24
- package/esm/component/axis.js.map +1 -1
- package/esm/component/index.d.ts +4 -0
- package/esm/component/index.js +2 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/legendCategory.js +1 -0
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/slider.d.ts +9 -0
- package/esm/component/slider.js +57 -0
- package/esm/component/slider.js.map +1 -0
- package/esm/component/sliderX.d.ts +7 -0
- package/esm/component/sliderX.js +9 -0
- package/esm/component/sliderX.js.map +1 -0
- package/esm/component/sliderY.d.ts +7 -0
- package/esm/component/sliderY.js +9 -0
- package/esm/component/sliderY.js.map +1 -0
- package/esm/composition/facetRect.js +4 -4
- package/esm/composition/facetRect.js.map +1 -1
- package/esm/composition/mark.js +3 -1
- package/esm/composition/mark.js.map +1 -1
- package/esm/composition/repeatMatrix.js +2 -2
- package/esm/composition/repeatMatrix.js.map +1 -1
- package/esm/data/filter.d.ts +3 -3
- package/esm/data/filter.js.map +1 -1
- package/esm/data/index.d.ts +3 -1
- package/esm/data/index.js +1 -0
- package/esm/data/index.js.map +1 -1
- package/esm/data/sort.d.ts +8 -0
- package/esm/data/sort.js +12 -0
- package/esm/data/sort.js.map +1 -0
- package/esm/interaction/builtin/brushHighlight.d.ts +1 -1
- package/esm/interaction/builtin/tooltip.d.ts +6 -4
- package/esm/interaction/index.d.ts +5 -0
- package/esm/interaction/index.js +5 -0
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushHighlight.d.ts +15 -0
- package/esm/interaction/native/brushHighlight.js +283 -0
- package/esm/interaction/native/brushHighlight.js.map +1 -0
- package/esm/interaction/native/brushXHighlight.d.ts +1 -0
- package/esm/interaction/native/brushXHighlight.js +8 -0
- package/esm/interaction/native/brushXHighlight.js.map +1 -0
- package/esm/interaction/native/brushYHighlight.d.ts +1 -0
- package/esm/interaction/native/brushYHighlight.js +8 -0
- package/esm/interaction/native/brushYHighlight.js.map +1 -0
- package/esm/interaction/native/legendFilter.d.ts +8 -0
- package/esm/interaction/native/legendFilter.js +180 -0
- package/esm/interaction/native/legendFilter.js.map +1 -0
- package/esm/interaction/native/tooltip.d.ts +2 -2
- package/esm/interaction/native/tooltip.js +134 -44
- package/esm/interaction/native/tooltip.js.map +1 -1
- package/esm/interaction/native/utils.d.ts +5 -1
- package/esm/interaction/native/utils.js +25 -2
- 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/line.js +1 -1
- package/esm/mark/line.js.map +1 -1
- package/esm/runtime/component.js +29 -1
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/plot.js +38 -13
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/scale.js +17 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +10 -4
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +1 -0
- package/esm/runtime/types/mark.d.ts +1 -1
- package/esm/runtime/types/options.d.ts +2 -0
- package/esm/runtime/types/theme.d.ts +5 -0
- 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 +20 -0
- package/esm/shape/label/{position.js → position/default.js} +9 -45
- 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 +1 -0
- package/esm/shape/label/position/outside.js +2 -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 +40 -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 +37 -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/spec/composition.d.ts +2 -0
- package/esm/spec/data.d.ts +10 -3
- package/esm/spec/geometry.d.ts +2 -1
- package/esm/spec/interaction.d.ts +28 -5
- package/esm/spec/labelTransform.d.ts +24 -11
- package/esm/spec/theme.d.ts +5 -2
- package/esm/spec/transform.d.ts +7 -2
- package/esm/stdlib/index.js +9 -10
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.d.ts +3 -0
- package/esm/theme/academy.js +402 -0
- package/esm/theme/academy.js.map +1 -0
- package/esm/theme/dark.js +80 -29
- 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 +71 -19
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/filter.d.ts +7 -0
- package/esm/transform/filter.js +42 -0
- package/esm/transform/filter.js.map +1 -0
- package/esm/transform/index.d.ts +2 -0
- package/esm/transform/index.js +1 -0
- package/esm/transform/index.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/esm/utils/selection.d.ts +1 -0
- package/esm/utils/selection.js.map +1 -1
- package/esm/utils/size.js +1 -1
- package/esm/utils/size.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 +46 -24
- package/lib/component/axis.js.map +1 -1
- package/lib/component/index.d.ts +4 -0
- package/lib/component/index.js +5 -1
- package/lib/component/index.js.map +1 -1
- package/lib/component/legendCategory.js +1 -0
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/slider.d.ts +9 -0
- package/lib/component/slider.js +61 -0
- package/lib/component/slider.js.map +1 -0
- package/lib/component/sliderX.d.ts +7 -0
- package/lib/component/sliderX.js +13 -0
- package/lib/component/sliderX.js.map +1 -0
- package/lib/component/sliderY.d.ts +7 -0
- package/lib/component/sliderY.js +13 -0
- package/lib/component/sliderY.js.map +1 -0
- package/lib/composition/facetRect.js +4 -4
- package/lib/composition/facetRect.js.map +1 -1
- package/lib/composition/mark.js +3 -1
- package/lib/composition/mark.js.map +1 -1
- package/lib/composition/repeatMatrix.js +2 -2
- package/lib/composition/repeatMatrix.js.map +1 -1
- package/lib/data/filter.d.ts +3 -3
- package/lib/data/filter.js.map +1 -1
- package/lib/data/index.d.ts +3 -1
- package/lib/data/index.js +3 -1
- package/lib/data/index.js.map +1 -1
- package/lib/data/sort.d.ts +8 -0
- package/lib/data/sort.js +17 -0
- package/lib/data/sort.js.map +1 -0
- package/lib/interaction/builtin/brushHighlight.d.ts +1 -1
- package/lib/interaction/builtin/tooltip.d.ts +6 -4
- package/lib/interaction/index.d.ts +5 -0
- package/lib/interaction/index.js +11 -1
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushHighlight.d.ts +15 -0
- package/lib/interaction/native/brushHighlight.js +289 -0
- package/lib/interaction/native/brushHighlight.js.map +1 -0
- package/lib/interaction/native/brushXHighlight.d.ts +1 -0
- package/lib/interaction/native/brushXHighlight.js +12 -0
- package/lib/interaction/native/brushXHighlight.js.map +1 -0
- package/lib/interaction/native/brushYHighlight.d.ts +1 -0
- package/lib/interaction/native/brushYHighlight.js +12 -0
- package/lib/interaction/native/brushYHighlight.js.map +1 -0
- package/lib/interaction/native/legendFilter.d.ts +8 -0
- package/lib/interaction/native/legendFilter.js +184 -0
- package/lib/interaction/native/legendFilter.js.map +1 -0
- package/lib/interaction/native/tooltip.d.ts +2 -2
- package/lib/interaction/native/tooltip.js +131 -41
- package/lib/interaction/native/tooltip.js.map +1 -1
- package/lib/interaction/native/utils.d.ts +5 -1
- package/lib/interaction/native/utils.js +30 -3
- 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/line.js +1 -1
- package/lib/mark/line.js.map +1 -1
- package/lib/runtime/component.js +29 -1
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/plot.js +38 -13
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/scale.js +16 -4
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +10 -4
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +1 -0
- package/lib/runtime/types/mark.d.ts +1 -1
- package/lib/runtime/types/options.d.ts +2 -0
- package/lib/runtime/types/theme.d.ts +5 -0
- 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 +20 -0
- package/lib/shape/label/{position.js → position/default.js} +10 -43
- 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 +1 -0
- package/lib/shape/label/position/outside.js +6 -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 +44 -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 +41 -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/spec/composition.d.ts +2 -0
- package/lib/spec/data.d.ts +10 -3
- package/lib/spec/geometry.d.ts +2 -1
- package/lib/spec/interaction.d.ts +28 -5
- package/lib/spec/labelTransform.d.ts +24 -11
- package/lib/spec/theme.d.ts +5 -2
- package/lib/spec/transform.d.ts +7 -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 +406 -0
- package/lib/theme/academy.js.map +1 -0
- package/lib/theme/dark.js +80 -29
- 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 +71 -19
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/filter.d.ts +7 -0
- package/lib/transform/filter.js +46 -0
- package/lib/transform/filter.js.map +1 -0
- package/lib/transform/index.d.ts +2 -0
- package/lib/transform/index.js +3 -1
- package/lib/transform/index.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/lib/utils/selection.d.ts +1 -0
- package/lib/utils/selection.js.map +1 -1
- package/lib/utils/size.js +1 -1
- package/lib/utils/size.js.map +1 -1
- package/package.json +4 -3
- package/src/api/mark/mark.ts +1 -2
- package/src/api/mark/types.ts +1 -2
- package/src/component/axis.ts +56 -96
- package/src/component/index.ts +4 -0
- package/src/component/legendCategory.ts +1 -0
- package/src/component/slider.ts +61 -0
- package/src/component/sliderX.ts +16 -0
- package/src/component/sliderY.ts +16 -0
- package/src/composition/facetRect.ts +4 -2
- package/src/composition/mark.ts +4 -0
- package/src/composition/repeatMatrix.ts +8 -1
- package/src/data/filter.ts +3 -3
- package/src/data/index.ts +3 -1
- package/src/data/sort.ts +18 -0
- package/src/interaction/index.ts +6 -0
- package/src/interaction/native/brushHighlight.ts +346 -0
- package/src/interaction/native/brushXHighlight.ts +11 -0
- package/src/interaction/native/brushYHighlight.ts +11 -0
- package/src/interaction/native/legendFilter.ts +195 -0
- package/src/interaction/native/tooltip.ts +173 -45
- package/src/interaction/native/utils.ts +33 -1
- 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/line.ts +1 -1
- package/src/runtime/component.ts +49 -2
- package/src/runtime/plot.ts +46 -11
- package/src/runtime/scale.ts +15 -7
- package/src/runtime/transform.ts +13 -4
- package/src/runtime/types/common.ts +1 -0
- package/src/runtime/types/mark.ts +1 -1
- package/src/runtime/types/options.ts +2 -0
- package/src/runtime/types/theme.ts +5 -0
- 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} +12 -56
- 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 +1 -0
- package/src/shape/label/position/right.ts +1 -0
- package/src/shape/label/position/spider.ts +46 -0
- package/src/shape/label/position/surround.ts +42 -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/spec/composition.ts +2 -0
- package/src/spec/data.ts +12 -2
- package/src/spec/geometry.ts +3 -1
- package/src/spec/interaction.ts +38 -4
- package/src/spec/labelTransform.ts +29 -11
- package/src/spec/theme.ts +6 -2
- package/src/spec/transform.ts +9 -1
- package/src/stdlib/index.ts +31 -9
- package/src/theme/academy.ts +408 -0
- package/src/theme/dark.ts +81 -29
- package/src/theme/index.ts +1 -0
- package/src/theme/light.ts +71 -19
- package/src/transform/filter.ts +48 -0
- package/src/transform/index.ts +2 -0
- 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/src/utils/selection.ts +2 -0
- package/src/utils/size.ts +1 -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.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/label-transform/hideOverlap.ts +0 -62
- package/src/label-transform/spider.ts +0 -37
- package/src/label-transform/surround.ts +0 -37
package/src/spec/data.ts
CHANGED
|
@@ -20,17 +20,19 @@ export type InlineConnector = {
|
|
|
20
20
|
|
|
21
21
|
export type DataTransform =
|
|
22
22
|
| SortByTransform
|
|
23
|
+
| SortTransform
|
|
23
24
|
| PickTransform
|
|
24
25
|
| RenameTransform
|
|
25
26
|
| SubsetTransform
|
|
26
27
|
| FoldTransform
|
|
27
28
|
| JoinTransform
|
|
28
|
-
|
|
|
29
|
+
| FilterDataTransform
|
|
29
30
|
| MapTransform
|
|
30
31
|
| CustomTransform;
|
|
31
32
|
|
|
32
33
|
export type DataTransformTypes =
|
|
33
34
|
| 'sortBy'
|
|
35
|
+
| 'sort'
|
|
34
36
|
| 'pick'
|
|
35
37
|
| 'rename'
|
|
36
38
|
| 'subset'
|
|
@@ -64,7 +66,7 @@ export type SubsetTransform = {
|
|
|
64
66
|
fields?: string[];
|
|
65
67
|
};
|
|
66
68
|
|
|
67
|
-
export type
|
|
69
|
+
export type FilterDataTransform = {
|
|
68
70
|
type?: 'filter';
|
|
69
71
|
/**
|
|
70
72
|
* The filter condition, same with [Array.prototype.filter](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
|
|
@@ -72,6 +74,14 @@ export type FilterTransform = {
|
|
|
72
74
|
callback?: (v: any, idx: number, arr: any[]) => boolean;
|
|
73
75
|
};
|
|
74
76
|
|
|
77
|
+
export type SortTransform = {
|
|
78
|
+
type?: 'sort';
|
|
79
|
+
/**
|
|
80
|
+
* The sort comparator, same with [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).
|
|
81
|
+
*/
|
|
82
|
+
callback?: (a: any, b: any) => number;
|
|
83
|
+
};
|
|
84
|
+
|
|
75
85
|
export type FoldTransform = {
|
|
76
86
|
type?: 'fold';
|
|
77
87
|
fields?: string[];
|
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,
|
|
@@ -126,6 +127,7 @@ export type BaseGeometry<
|
|
|
126
127
|
>
|
|
127
128
|
| boolean;
|
|
128
129
|
legend?: Partial<Record<'size' | 'color', Legend | boolean>> | boolean;
|
|
130
|
+
slider?: Partial<Record<'x' | 'y', any>>;
|
|
129
131
|
coordinates?: Coordinate[];
|
|
130
132
|
style?: Record<string, any>;
|
|
131
133
|
interactions?: Interaction[];
|
package/src/spec/interaction.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChannelTypes } from 'spec';
|
|
1
2
|
import { InteractionComponent } from '../runtime';
|
|
2
3
|
import { ActiveRegionAction, PoptipAction, TooltipAction } from './action';
|
|
3
4
|
import { FisheyeCoordinate } from './coordinate';
|
|
@@ -12,7 +13,11 @@ export type Interaction =
|
|
|
12
13
|
| TooltipInteraction
|
|
13
14
|
| FisheyeInteraction
|
|
14
15
|
| ChartIndex
|
|
15
|
-
| CustomInteraction
|
|
16
|
+
| CustomInteraction
|
|
17
|
+
| LegendFilterInteraction
|
|
18
|
+
| BrushHighlightInteraction
|
|
19
|
+
| BrushXHighlightInteraction
|
|
20
|
+
| BrushYHighlightInteraction;
|
|
16
21
|
// | ElementListHighlightInteraction
|
|
17
22
|
// | LegendActiveInteraction
|
|
18
23
|
// | LegendHighlightInteraction
|
|
@@ -34,6 +39,10 @@ export type InteractionTypes =
|
|
|
34
39
|
| 'elementSelectByColor'
|
|
35
40
|
| 'fisheye'
|
|
36
41
|
| 'tooltip'
|
|
42
|
+
| 'legendFilter'
|
|
43
|
+
| 'brushXHighlight'
|
|
44
|
+
| 'brushYHighlight'
|
|
45
|
+
| 'brushHighlight'
|
|
37
46
|
| InteractionComponent;
|
|
38
47
|
// | 'elementListHighlight'
|
|
39
48
|
// | 'legendActive'
|
|
@@ -53,9 +62,27 @@ export type BrushInteraction = {
|
|
|
53
62
|
|
|
54
63
|
export type BrushHighlightInteraction = {
|
|
55
64
|
type?: 'brushHighlight';
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
reverse?: boolean;
|
|
66
|
+
shared?: boolean;
|
|
67
|
+
series?: boolean;
|
|
68
|
+
facet?: boolean;
|
|
69
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
70
|
+
|
|
71
|
+
export type BrushXHighlightInteraction = {
|
|
72
|
+
type?: 'brushXHighlight';
|
|
73
|
+
reverse?: boolean;
|
|
74
|
+
shared?: boolean;
|
|
75
|
+
series?: boolean;
|
|
76
|
+
facet?: boolean;
|
|
77
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
78
|
+
|
|
79
|
+
export type BrushYHighlightInteraction = {
|
|
80
|
+
type?: 'brushYHighlight';
|
|
81
|
+
reverse?: boolean;
|
|
82
|
+
shared?: boolean;
|
|
83
|
+
series?: boolean;
|
|
84
|
+
facet?: boolean;
|
|
85
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
59
86
|
|
|
60
87
|
export type BrushVisibleInteraction = {
|
|
61
88
|
type?: 'brushVisible';
|
|
@@ -94,6 +121,12 @@ export type ElementHighlightByColorInteraction = {
|
|
|
94
121
|
color?: string;
|
|
95
122
|
} & Record<`${'link' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
96
123
|
|
|
124
|
+
export type LegendFilterInteraction = {
|
|
125
|
+
type?: 'legendFilter';
|
|
126
|
+
channel?: ChannelTypes;
|
|
127
|
+
[key: string]: any; // @todo
|
|
128
|
+
} & Record<`${'marker' | 'label'}Unselected${any}`, any>;
|
|
129
|
+
|
|
97
130
|
export type ChartIndex = {
|
|
98
131
|
type?: 'chartIndex';
|
|
99
132
|
wait?: number;
|
|
@@ -117,6 +150,7 @@ export type TooltipInteraction = Omit<TooltipAction, 'type'> & {
|
|
|
117
150
|
type?: 'tooltip';
|
|
118
151
|
shared?: boolean;
|
|
119
152
|
series?: boolean;
|
|
153
|
+
facet?: boolean;
|
|
120
154
|
// @todo
|
|
121
155
|
item?: any;
|
|
122
156
|
};
|
|
@@ -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/spec/transform.ts
CHANGED
|
@@ -24,7 +24,8 @@ export type Transform =
|
|
|
24
24
|
| BinXTransform
|
|
25
25
|
| BinTransform
|
|
26
26
|
| SampleTransform
|
|
27
|
-
| FlexXTransform
|
|
27
|
+
| FlexXTransform
|
|
28
|
+
| FilterTransform;
|
|
28
29
|
|
|
29
30
|
export type TransformTypes =
|
|
30
31
|
| 'dodgeX'
|
|
@@ -48,6 +49,7 @@ export type TransformTypes =
|
|
|
48
49
|
| 'flexX'
|
|
49
50
|
| 'pack'
|
|
50
51
|
| 'sample'
|
|
52
|
+
| 'filter'
|
|
51
53
|
| TransformComponent;
|
|
52
54
|
|
|
53
55
|
export type TransformOrder =
|
|
@@ -255,3 +257,9 @@ export type SampleTransform = {
|
|
|
255
257
|
groupBy?: string | string[];
|
|
256
258
|
thresholds?: number;
|
|
257
259
|
} & { [key in ChannelTypes]?: Reducer };
|
|
260
|
+
|
|
261
|
+
export type FilterTransform = {
|
|
262
|
+
type?: 'filter';
|
|
263
|
+
} & {
|
|
264
|
+
[key in ChannelTypes]?: any[] | ((v: Primitive) => boolean);
|
|
265
|
+
};
|
package/src/stdlib/index.ts
CHANGED
|
@@ -131,13 +131,15 @@ 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,
|
|
138
138
|
LegendCategory,
|
|
139
139
|
LegendContinuous,
|
|
140
140
|
TitleComponent,
|
|
141
|
+
SliderX,
|
|
142
|
+
SliderY,
|
|
141
143
|
} from '../component';
|
|
142
144
|
import {
|
|
143
145
|
ScaleInX,
|
|
@@ -168,6 +170,10 @@ import {
|
|
|
168
170
|
ChartIndex,
|
|
169
171
|
Fisheye as ChartFisheye,
|
|
170
172
|
Tooltip,
|
|
173
|
+
LegendFilter,
|
|
174
|
+
BrushHighlight,
|
|
175
|
+
BrushXHighlight,
|
|
176
|
+
BrushYHighlight,
|
|
171
177
|
// ElementHighlightByX,
|
|
172
178
|
// ElementHighlightByColor,
|
|
173
179
|
// ElementListHighlight,
|
|
@@ -231,11 +237,12 @@ import {
|
|
|
231
237
|
MaybeGradient,
|
|
232
238
|
MaybeTooltip,
|
|
233
239
|
Sample,
|
|
240
|
+
Filter,
|
|
234
241
|
} from '../transform';
|
|
235
242
|
import {
|
|
236
243
|
Fetch,
|
|
237
244
|
SortBy,
|
|
238
|
-
Filter,
|
|
245
|
+
Filter as DataFilter,
|
|
239
246
|
Map,
|
|
240
247
|
Pick,
|
|
241
248
|
Rename,
|
|
@@ -249,8 +256,14 @@ import {
|
|
|
249
256
|
Arc as ArcTransform,
|
|
250
257
|
WordCloud,
|
|
251
258
|
Join,
|
|
259
|
+
Sort,
|
|
252
260
|
} from '../data';
|
|
253
|
-
import {
|
|
261
|
+
import {
|
|
262
|
+
OverlapDodgeY,
|
|
263
|
+
OverflowHide,
|
|
264
|
+
ContrastReverse,
|
|
265
|
+
OverlapHide,
|
|
266
|
+
} from '../label-transform';
|
|
254
267
|
import { geoLibrary } from '../geo';
|
|
255
268
|
|
|
256
269
|
export function createLibrary(): G2Library {
|
|
@@ -258,7 +271,8 @@ export function createLibrary(): G2Library {
|
|
|
258
271
|
'data.fetch': Fetch,
|
|
259
272
|
'data.inline': Inline,
|
|
260
273
|
'data.sortBy': SortBy,
|
|
261
|
-
'data.
|
|
274
|
+
'data.sort': Sort,
|
|
275
|
+
'data.filter': DataFilter,
|
|
262
276
|
'data.pick': Pick,
|
|
263
277
|
'data.rename': Rename,
|
|
264
278
|
'data.subset': Subset,
|
|
@@ -313,6 +327,7 @@ export function createLibrary(): G2Library {
|
|
|
313
327
|
'transform.maybeTooltip': MaybeTooltip,
|
|
314
328
|
'transform.pack': Pack,
|
|
315
329
|
'transform.sample': Sample,
|
|
330
|
+
'transform.filter': Filter,
|
|
316
331
|
'coordinate.cartesian': Cartesian,
|
|
317
332
|
'coordinate.polar': Polar,
|
|
318
333
|
'coordinate.helix': Helix,
|
|
@@ -448,11 +463,14 @@ export function createLibrary(): G2Library {
|
|
|
448
463
|
'shape.path.hollow': HollowPath,
|
|
449
464
|
'theme.light': Light,
|
|
450
465
|
'theme.dark': Dark,
|
|
466
|
+
'theme.academy': Academy,
|
|
451
467
|
'component.axisX': AxisX,
|
|
452
468
|
'component.axisY': AxisY,
|
|
453
469
|
'component.legendCategory': LegendCategory,
|
|
454
470
|
'component.legendContinuous': LegendContinuous,
|
|
455
471
|
'component.title': TitleComponent,
|
|
472
|
+
'component.sliderX': SliderX,
|
|
473
|
+
'component.sliderY': SliderY,
|
|
456
474
|
'animation.scaleInX': ScaleInX,
|
|
457
475
|
'animation.scaleOutX': ScaleOutX,
|
|
458
476
|
'animation.scaleInY': ScaleInY,
|
|
@@ -475,6 +493,10 @@ export function createLibrary(): G2Library {
|
|
|
475
493
|
'interaction.fisheye': ChartFisheye,
|
|
476
494
|
'interaction.chartIndex': ChartIndex,
|
|
477
495
|
'interaction.tooltip': Tooltip,
|
|
496
|
+
'interaction.legendFilter': LegendFilter,
|
|
497
|
+
'interaction.brushHighlight': BrushHighlight,
|
|
498
|
+
'interaction.brushXHighlight': BrushXHighlight,
|
|
499
|
+
'interaction.brushYHighlight': BrushYHighlight,
|
|
478
500
|
// 'interaction.elementSelected': ElementSelected,
|
|
479
501
|
// 'interaction.elementHighlight': ElementHighlight,
|
|
480
502
|
// 'interaction.elementHighlightByX': ElementHighlightByX,
|
|
@@ -485,7 +507,7 @@ export function createLibrary(): G2Library {
|
|
|
485
507
|
// 'interaction.tooltip': Tooltip,
|
|
486
508
|
// 'interaction.fisheye': FisheyeInteraction,
|
|
487
509
|
// 'interaction.brush': Brush,
|
|
488
|
-
|
|
510
|
+
|
|
489
511
|
// 'interaction.brushVisible': BrushVisible,
|
|
490
512
|
// 'interaction.activeRegion': ActiveRegion,
|
|
491
513
|
// 'interaction.ellipsisText': EllipsisText,
|
|
@@ -497,10 +519,10 @@ export function createLibrary(): G2Library {
|
|
|
497
519
|
'composition.repeatMatrix': RepeatMatrix,
|
|
498
520
|
'composition.facetCircle': FacetCircle,
|
|
499
521
|
'composition.timingKeyframe': TimingKeyframe,
|
|
500
|
-
'labelTransform.
|
|
501
|
-
'labelTransform.
|
|
502
|
-
'labelTransform.
|
|
503
|
-
'labelTransform.
|
|
522
|
+
'labelTransform.overlapHide': OverlapHide,
|
|
523
|
+
'labelTransform.overlapDodgeY': OverlapDodgeY,
|
|
524
|
+
'labelTransform.overflowHide': OverflowHide,
|
|
525
|
+
'labelTransform.contrastReverse': ContrastReverse,
|
|
504
526
|
...geoLibrary,
|
|
505
527
|
};
|
|
506
528
|
}
|