@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/theme/light.ts
CHANGED
|
@@ -132,7 +132,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
132
132
|
box: {
|
|
133
133
|
box: {
|
|
134
134
|
fillOpacity: 0.95,
|
|
135
|
-
stroke:
|
|
135
|
+
stroke: COLORS.BLACK,
|
|
136
136
|
lineWidth: 1,
|
|
137
137
|
},
|
|
138
138
|
},
|
|
@@ -236,6 +236,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
236
236
|
lineStroke: COLORS.BLACK,
|
|
237
237
|
lineStrokeOpacity: 0.45,
|
|
238
238
|
lineLineWidth: 0.5,
|
|
239
|
+
lineArrow: null,
|
|
239
240
|
// axis tick line
|
|
240
241
|
tickStroke: COLORS.BLACK,
|
|
241
242
|
tickStrokeOpacity: 0.25,
|
|
@@ -247,11 +248,63 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
247
248
|
labelFontSize: 12,
|
|
248
249
|
labelFontWeight: 'lighter',
|
|
249
250
|
labelSpacing: 8, // spacing between label and it's tick
|
|
251
|
+
labelAlign: 'horizontal',
|
|
250
252
|
// axis grid
|
|
251
253
|
gridStroke: COLORS.BLACK,
|
|
252
254
|
gridStrokeOpacity: 0.05,
|
|
253
255
|
gridLineWidth: 0.5,
|
|
254
256
|
gridLineDash: [0, 0],
|
|
257
|
+
titleTransformOrigin: 'center',
|
|
258
|
+
},
|
|
259
|
+
axisTop: {
|
|
260
|
+
titlePosition: 'top',
|
|
261
|
+
titleSpacing: 0,
|
|
262
|
+
titleTextBaseline: 'middle',
|
|
263
|
+
labelSpacing: 8,
|
|
264
|
+
labelDirection: 'negative',
|
|
265
|
+
tickDirection: 'negative',
|
|
266
|
+
gridDirection: 'positive',
|
|
267
|
+
},
|
|
268
|
+
axisBottom: {
|
|
269
|
+
titleSpacing: 10,
|
|
270
|
+
titleTextBaseline: 'bottom',
|
|
271
|
+
labelSpacing: 12,
|
|
272
|
+
labelDirection: 'positive',
|
|
273
|
+
tickDirection: 'positive',
|
|
274
|
+
gridDirection: 'negative',
|
|
275
|
+
},
|
|
276
|
+
axisLeft: {
|
|
277
|
+
titleTextBaseline: 'middle',
|
|
278
|
+
titleSpacing: 10,
|
|
279
|
+
titlePosition: 'left',
|
|
280
|
+
titleTransformOrigin: 'center',
|
|
281
|
+
titleTransform: `translate(50%, 0) rotate(-90)`,
|
|
282
|
+
labelSpacing: 4,
|
|
283
|
+
labelDirection: 'positive',
|
|
284
|
+
labelAutoRotate: false,
|
|
285
|
+
tickDirection: 'positive',
|
|
286
|
+
gridDirection: 'negative',
|
|
287
|
+
},
|
|
288
|
+
axisRight: {
|
|
289
|
+
titleTextBaseline: 'top',
|
|
290
|
+
titleSpacing: 0,
|
|
291
|
+
titlePosition: 'right',
|
|
292
|
+
titleTransformOrigin: 'center',
|
|
293
|
+
titleTransform: `translate(-50%, 0) rotate(-90)`,
|
|
294
|
+
labelSpacing: 4,
|
|
295
|
+
labelDirection: 'negative',
|
|
296
|
+
tickDirection: 'negative',
|
|
297
|
+
gridDirection: 'positive',
|
|
298
|
+
},
|
|
299
|
+
axisArcY: {
|
|
300
|
+
titlePosition: 'top',
|
|
301
|
+
titleSpacing: 0,
|
|
302
|
+
titleTextBaseline: 'bottom',
|
|
303
|
+
gridDirection: 'negative',
|
|
304
|
+
gridConnect: 'arc',
|
|
305
|
+
gridControlAngles: [90, 180, 360],
|
|
306
|
+
gridType: 'surround',
|
|
307
|
+
girdClosed: true,
|
|
255
308
|
},
|
|
256
309
|
legend: {
|
|
257
310
|
padding: 8,
|
|
@@ -277,7 +330,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
277
330
|
itemBackgroundFill: 'transparent',
|
|
278
331
|
// [todo] rename legend navigator
|
|
279
332
|
navButtonFill: COLORS.BLACK,
|
|
280
|
-
navButtonFillOpacity: 0.
|
|
333
|
+
navButtonFillOpacity: 0.65,
|
|
281
334
|
navPageNumFill: COLORS.BLACK,
|
|
282
335
|
navPageNumFillOpacity: 0.45,
|
|
283
336
|
navPageNumFontSize: 12,
|
|
@@ -324,23 +377,22 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
324
377
|
offset: 0,
|
|
325
378
|
},
|
|
326
379
|
slider: {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
textFontWeight: 'normal',
|
|
380
|
+
trackSize: 16,
|
|
381
|
+
backgroundFill: COLORS.STROKE,
|
|
382
|
+
backgroundFillOpacity: 1,
|
|
383
|
+
selectionFill: DEFAULT_COLOR,
|
|
384
|
+
selectionFillOpacity: 0.15,
|
|
385
|
+
handleIconSize: 10,
|
|
386
|
+
handleIconFill: '#f7f7f7',
|
|
387
|
+
handleIconFillOpacity: 1,
|
|
388
|
+
handleIconStroke: COLORS.BLACK,
|
|
389
|
+
handleIconStrokeOpacity: 0.25,
|
|
390
|
+
handleIconLineWidth: 1,
|
|
391
|
+
handleIconRadius: 2,
|
|
392
|
+
handleLabelFill: COLORS.BLACK,
|
|
393
|
+
handleLabelFillOpacity: 0.45,
|
|
394
|
+
handleLabelFontSize: 12,
|
|
395
|
+
handleLabelFontWeight: 'normal',
|
|
344
396
|
},
|
|
345
397
|
scrollbar: {},
|
|
346
398
|
title: {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { deepMix } from '@antv/util';
|
|
2
|
+
import { TransformComponent as TC } from '../runtime';
|
|
3
|
+
import { FilterTransform } from '../spec';
|
|
4
|
+
import { defined } from '../utils/helper';
|
|
5
|
+
import { columnOf } from './utils/helper';
|
|
6
|
+
|
|
7
|
+
export type FilterOptions = Omit<FilterTransform, 'type'>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The Filter transform filter channels.
|
|
11
|
+
*/
|
|
12
|
+
export const Filter: TC<FilterOptions> = (options = {}) => {
|
|
13
|
+
return (I, mark) => {
|
|
14
|
+
const { encode } = mark;
|
|
15
|
+
const filters = Object.entries(options)
|
|
16
|
+
.map(([key, value]) => {
|
|
17
|
+
const [V] = columnOf(encode, key);
|
|
18
|
+
// Skip empty channel.
|
|
19
|
+
if (!V) return null;
|
|
20
|
+
if (typeof value === 'function') return (i) => value(V[i]);
|
|
21
|
+
const expectedValues = Array.isArray(value) ? value : [value];
|
|
22
|
+
// Skip empty expected values.
|
|
23
|
+
if (expectedValues.length === 0) return null;
|
|
24
|
+
return (i) => expectedValues.includes(V[i]);
|
|
25
|
+
})
|
|
26
|
+
.filter(defined);
|
|
27
|
+
|
|
28
|
+
// Skip empty filters.
|
|
29
|
+
if (filters.length === 0) return [I, mark];
|
|
30
|
+
|
|
31
|
+
// Filter index and channels.
|
|
32
|
+
const totalFilter = (i) => filters.every((f) => f(i));
|
|
33
|
+
const FI = I.filter(totalFilter);
|
|
34
|
+
const newIndex = FI.map((_, i) => i);
|
|
35
|
+
const newEncodes = Object.entries(encode).map(([key, encode]) => {
|
|
36
|
+
return [
|
|
37
|
+
key,
|
|
38
|
+
{
|
|
39
|
+
...encode,
|
|
40
|
+
value: newIndex.map((i) => encode.value[FI[i]]),
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
});
|
|
44
|
+
return [I, deepMix({}, mark, { encode: Object.fromEntries(newEncodes) })];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Filter.props = {};
|
package/src/transform/index.ts
CHANGED
|
@@ -39,6 +39,7 @@ export { Pack } from './pack';
|
|
|
39
39
|
export { BinX } from './binX';
|
|
40
40
|
export { Bin } from './bin';
|
|
41
41
|
export { Sample } from './sample';
|
|
42
|
+
export { Filter } from './filter';
|
|
42
43
|
|
|
43
44
|
export type { MaybeZeroY1Options } from './maybeZeroY1';
|
|
44
45
|
export type { MaybeStackYOptions } from './maybeStackY';
|
|
@@ -81,3 +82,4 @@ export type { PackOptions } from './pack';
|
|
|
81
82
|
export type { BinXOptions } from './binX';
|
|
82
83
|
export type { BinOptions } from './bin';
|
|
83
84
|
export type { SampleOptions } from './sample';
|
|
85
|
+
export type { FilterOptions } from './filter';
|
|
@@ -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
|
+
}
|
package/src/utils/coordinate.ts
CHANGED
|
@@ -44,3 +44,15 @@ export function isCircular(coordinate: Coordinate): boolean {
|
|
|
44
44
|
export function isTheta(coordinate: Coordinate): boolean {
|
|
45
45
|
return isPolar(coordinate) && isTranspose(coordinate);
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
export function getRadius(coordinate: Coordinate): number {
|
|
49
|
+
if (isCircular(coordinate)) {
|
|
50
|
+
const [width, height] = coordinate.getSize();
|
|
51
|
+
const polar = coordinate
|
|
52
|
+
.getOptions()
|
|
53
|
+
.transformations.find((t) => t[0] === 'polar');
|
|
54
|
+
// coordinate.size * outerRadius.
|
|
55
|
+
if (polar) return (Math.max(width, height) / 2) * polar[4];
|
|
56
|
+
}
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
package/src/utils/helper.ts
CHANGED
|
@@ -99,3 +99,7 @@ export function maybePercentage(x: number | string, size: number) {
|
|
|
99
99
|
const px = +x.replace('%', '');
|
|
100
100
|
return Number.isNaN(px) ? null : (px / 100) * size;
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
export function isStrictObject(d: any): boolean {
|
|
104
|
+
return typeof d === 'object' && !(d instanceof Date) && d !== null;
|
|
105
|
+
}
|
package/src/utils/selection.ts
CHANGED
|
@@ -27,6 +27,8 @@ export type G2Element = DisplayObject & {
|
|
|
27
27
|
__fromElements__?: DisplayObject[];
|
|
28
28
|
// Whether to update parent if it in update selection.
|
|
29
29
|
__facet__?: boolean;
|
|
30
|
+
// Whether is removed in G2, but also exist in G dom.
|
|
31
|
+
__removed__?: boolean;
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
export function select<T = any>(node: DisplayObject) {
|
package/src/utils/size.ts
CHANGED
|
@@ -23,7 +23,7 @@ export function getContainerSize(container: HTMLElement): Size {
|
|
|
23
23
|
const widthPadding =
|
|
24
24
|
parseInt10(style.paddingLeft) + parseInt10(style.paddingRight);
|
|
25
25
|
const heightPadding =
|
|
26
|
-
parseInt10(style.
|
|
26
|
+
parseInt10(style.paddingTop) + parseInt10(style.paddingBottom);
|
|
27
27
|
|
|
28
28
|
return {
|
|
29
29
|
width: wrapperWidth - widthPadding,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DodgeYLabelTransform } from 'spec';
|
|
2
|
-
import { LabelTransformComponent as LLC } from '../runtime';
|
|
3
|
-
export type DodgeYOptions = Omit<DodgeYLabelTransform, 'type'>;
|
|
4
|
-
/**
|
|
5
|
-
* An iterative dodge method avoids label overlap. (n * log(n))
|
|
6
|
-
*/
|
|
7
|
-
export declare const DodgeY: LLC<DodgeYOptions>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dodgeY.js","sourceRoot":"src/","sources":["label-transform/dodgeY.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,SAAS,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,MAAM;IACb,MAAM,GAAG,GAAG,IAAI,GAAG,EAAQ,CAAC;IAC5B,MAAM,GAAG,GAAG,CAAC,GAAM,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,CAAC,GAAM,EAAE,KAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAU,CAAC;AAC7B,CAAC;AAID,SAAS,yBAAyB,CAAC,KAAoB;IACrD,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACxD,cAAc,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACnD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;IAEf,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuB,CAAC,OAAO,EAAE,EAAE;IACpD,MAAM,EAAE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AG,EAAE,CAAC,KAAK,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { isPolygonsIntersect } from '@antv/path-util';
|
|
2
|
-
import { ascending } from 'd3-array';
|
|
3
|
-
function getPoints(element) {
|
|
4
|
-
const { min, max } = element.getRenderBounds();
|
|
5
|
-
const [x0, y0] = min;
|
|
6
|
-
const [x1, y1] = max;
|
|
7
|
-
return [
|
|
8
|
-
[x0, y0],
|
|
9
|
-
[x0, y1],
|
|
10
|
-
[x1, y1],
|
|
11
|
-
[x1, y0],
|
|
12
|
-
];
|
|
13
|
-
}
|
|
14
|
-
function priority(shape) {
|
|
15
|
-
return shape.style.priority || 0;
|
|
16
|
-
}
|
|
17
|
-
function show(shape) {
|
|
18
|
-
shape.style.visibility = 'visible';
|
|
19
|
-
}
|
|
20
|
-
function hide(shape) {
|
|
21
|
-
shape.style.visibility = 'hidden';
|
|
22
|
-
}
|
|
23
|
-
// @todo Support label shape with priority attribute.
|
|
24
|
-
export const HideOverlap = () => {
|
|
25
|
-
return (labels, coordinate) => {
|
|
26
|
-
const displayLabels = [];
|
|
27
|
-
// Label with lower priority will be hidden when overlapped.
|
|
28
|
-
labels.sort((a, b) => ascending(priority(a), priority(b)));
|
|
29
|
-
for (let i = 0; i < labels.length; i++) {
|
|
30
|
-
const label = labels[i];
|
|
31
|
-
show(label);
|
|
32
|
-
let overlapping = false;
|
|
33
|
-
for (let j = 0; j < displayLabels.length; j++) {
|
|
34
|
-
const existedLabel = displayLabels[j];
|
|
35
|
-
if (isPolygonsIntersect(getPoints(label), getPoints(existedLabel))) {
|
|
36
|
-
hide(label);
|
|
37
|
-
overlapping = true;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (!overlapping) {
|
|
42
|
-
displayLabels.push(label);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return labels;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=hideOverlap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hideOverlap.js","sourceRoot":"src/","sources":["label-transform/hideOverlap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,SAAS,SAAS,CAAC,OAAsB;IACvC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAC/C,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;IACrB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;IACrB,OAAO;QACL,CAAC,EAAE,EAAE,EAAE,CAAC;QACR,CAAC,EAAE,EAAE,EAAE,CAAC;QACR,CAAC,EAAE,EAAE,EAAE,CAAC;QACR,CAAC,EAAE,EAAE,EAAE,CAAC;KACT,CAAC;AACJ,CAAC;AAID,SAAS,QAAQ,CAAC,KAAoB;IACpC,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,IAAI,CAAC,KAAoB;IAChC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;AACrC,CAAC;AAED,SAAS,IAAI,CAAC,KAAoB;IAChC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;AACpC,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,WAAW,GAA4B,GAAG,EAAE;IACvD,OAAO,CAAC,MAAuB,EAAE,UAAU,EAAE,EAAE;QAC7C,MAAM,aAAa,GAAG,EAAE,CAAC;QAEzB,4DAA4D;QAC5D,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,CAAC;YAEZ,IAAI,WAAW,GAAG,KAAK,CAAC;YACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;gBACtC,IAAI,mBAAmB,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE;oBAClE,IAAI,CAAC,KAAK,CAAC,CAAC;oBACZ,WAAW,GAAG,IAAI,CAAC;oBACnB,MAAM;iBACP;aACF;YAED,IAAI,CAAC,WAAW,EAAE;gBAChB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC3B;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SpiderLabelTransform } from '../spec';
|
|
2
|
-
import { LabelTransformComponent as LLC } from '../runtime';
|
|
3
|
-
export type SpiderOptions = Omit<SpiderLabelTransform, 'type'>;
|
|
4
|
-
/**
|
|
5
|
-
* Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Spider: LLC<SpiderOptions>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { isCircular } from '../utils/coordinate';
|
|
2
|
-
import { maybePercentage } from '../utils/helper';
|
|
3
|
-
import { sub } from '../utils/vector';
|
|
4
|
-
/**
|
|
5
|
-
* Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
|
|
6
|
-
*/
|
|
7
|
-
export const Spider = (options) => {
|
|
8
|
-
const { edgeDistance = 0 } = options;
|
|
9
|
-
return (labels, coordinate) => {
|
|
10
|
-
if (!isCircular(coordinate))
|
|
11
|
-
return labels;
|
|
12
|
-
const { x: coordX, width } = coordinate.getOptions();
|
|
13
|
-
const center = coordinate.getCenter();
|
|
14
|
-
const margin = maybePercentage(edgeDistance, width);
|
|
15
|
-
const edgeX = coordX + margin;
|
|
16
|
-
const edgeX1 = coordX + width - margin;
|
|
17
|
-
labels.forEach((label) => {
|
|
18
|
-
const { x: originX, x0, y0 } = label.style;
|
|
19
|
-
const dx = originX <= center[0] ? edgeX - originX : edgeX1 - originX;
|
|
20
|
-
label.style.x += dx;
|
|
21
|
-
const { x, y } = label.style;
|
|
22
|
-
const p0 = sub([x0, y0], center);
|
|
23
|
-
const p1 = sub([0, y], center);
|
|
24
|
-
const p1x = p0[1] ? (p0[0] * p1[1]) / p0[1] + center[0] : x;
|
|
25
|
-
label.style.connectorPoints = [[p1x - x, 0]];
|
|
26
|
-
});
|
|
27
|
-
return labels;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=spider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spider.js","sourceRoot":"src/","sources":["label-transform/spider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAItC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuB,CAAC,OAAO,EAAE,EAAE;IACpD,MAAM,EAAE,YAAY,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,MAAuB,EAAE,UAAU,EAAE,EAAE;QAC7C,IAAI,C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Ae,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SurroundLabelTransform } from '../spec';
|
|
2
|
-
import { LabelTransformComponent as LLC } from '../runtime';
|
|
3
|
-
export type SurroundOptions = Omit<SurroundLabelTransform, 'type'>;
|
|
4
|
-
/**
|
|
5
|
-
* Surround label transform is used to make labels surround circular.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Surround: LLC<SurroundOptions>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { isCircular } from '../utils/coordinate';
|
|
2
|
-
import { dist, angleWithQuadrant } from '../utils/vector';
|
|
3
|
-
/**
|
|
4
|
-
* Surround label transform is used to make labels surround circular.
|
|
5
|
-
*/
|
|
6
|
-
export const Surround = (options) => {
|
|
7
|
-
return (labels, coordinate) => {
|
|
8
|
-
if (!isCircular(coordinate))
|
|
9
|
-
return labels;
|
|
10
|
-
const center = coordinate.getCenter();
|
|
11
|
-
const radius = labels.reduce((r, label) => {
|
|
12
|
-
const { x0, y0, offset = 0 } = label.style;
|
|
13
|
-
return Math.max(r, dist(center, [x0, y0]) + offset);
|
|
14
|
-
}, 0);
|
|
15
|
-
labels.forEach((label) => {
|
|
16
|
-
const { x0, y0, connector, connectorLength2 = 0 } = label.style;
|
|
17
|
-
const labelAngle = angleWithQuadrant([x0 - center[0], y0 - center[1]]);
|
|
18
|
-
const length2 = connector
|
|
19
|
-
? connectorLength2 * (Math.sin(labelAngle) < 0 ? -1 : 1)
|
|
20
|
-
: 0;
|
|
21
|
-
const newX = center[0] + Math.sin(labelAngle) * radius;
|
|
22
|
-
const newY = center[1] - Math.cos(labelAngle) * radius;
|
|
23
|
-
label.style.x = newX + length2;
|
|
24
|
-
label.style.y = newY;
|
|
25
|
-
label.style.connectorPoints = [[-length2, 0]];
|
|
26
|
-
});
|
|
27
|
-
return labels;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=surround.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"surround.js","sourceRoot":"src/","sources":["label-transform/surround.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAI1D;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyB,CAAC,OAAO,EAAE,EAAE;IACxD,OAAO,CAAC,MAAuB,EAAE,UAAU,EAAE,EAAE;QAC7C,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YAAE,OAAO,MAAM,CAAC;QAE3C,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;YACxC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;YAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QACtD,CAAC,EAAE,CAAC,CAAC,CAAC;QACN,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;YAChE,MAAM,UAAU,GAAG,iBAAiB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvE,MAAM,OAAO,GAAG,SAAS;gBACvB,CAAC,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxD,CAAC,CAAC,CAAC,CAAC;YAEN,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;YACvD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;YACvD,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC;YAC/B,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;YACrB,KAAK,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Coordinate } from '@antv/coord';
|
|
2
|
-
import { Vector2 } from '../../runtime';
|
|
3
|
-
export type LabelPosition = 'top' | 'left' | 'right' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'inside' | 'outside' | 'area';
|
|
4
|
-
declare function getDefaultStyle(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate): any;
|
|
5
|
-
export declare const top: typeof getDefaultStyle;
|
|
6
|
-
export declare const bottom: typeof getDefaultStyle;
|
|
7
|
-
export declare const right: typeof getDefaultStyle;
|
|
8
|
-
export declare const left: typeof getDefaultStyle;
|
|
9
|
-
export declare const topLeft: typeof getDefaultStyle;
|
|
10
|
-
export declare const topRight: typeof getDefaultStyle;
|
|
11
|
-
export declare const bottomLeft: typeof getDefaultStyle;
|
|
12
|
-
export declare const bottomRight: typeof getDefaultStyle;
|
|
13
|
-
export declare const inside: typeof getDefaultStyle;
|
|
14
|
-
export declare const outside: typeof getDefaultStyle;
|
|
15
|
-
/**
|
|
16
|
-
* Only for Area label.
|
|
17
|
-
*/
|
|
18
|
-
export declare function area(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate): {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
transform: string;
|
|
22
|
-
textAlign: string;
|
|
23
|
-
textBaseline: string;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"src/","sources":["shape/label/position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAerD,SAAS,qBAAqB,CAC5B,QAAuB,EACvB,MAAiB,EACjB,KAA0B,EAC1B,UAAsB;IAEtB,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC;IACpC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE;QACrB,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAA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CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAExC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAE1B,mCAAmC;IACnC,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IAExD,OAAO;QACL,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACX,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACX,SAAS,EAAE,UAAU,MAAM,MAAM;QACjC,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DodgeYLabelTransform } from 'spec';
|
|
2
|
-
import { LabelTransformComponent as LLC } from '../runtime';
|
|
3
|
-
export type DodgeYOptions = Omit<DodgeYLabelTransform, 'type'>;
|
|
4
|
-
/**
|
|
5
|
-
* An iterative dodge method avoids label overlap. (n * log(n))
|
|
6
|
-
*/
|
|
7
|
-
export declare const DodgeY: LLC<DodgeYOptions>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dodgeY.js","sourceRoot":"src/","sources":["label-trans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perty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HideOverlap = void 0;
|
|
4
|
-
const path_util_1 = require("@antv/path-util");
|
|
5
|
-
const d3_array_1 = require("d3-array");
|
|
6
|
-
function getPoints(element) {
|
|
7
|
-
const { min, max } = element.getRenderBounds();
|
|
8
|
-
const [x0, y0] = min;
|
|
9
|
-
const [x1, y1] = max;
|
|
10
|
-
return [
|
|
11
|
-
[x0, y0],
|
|
12
|
-
[x0, y1],
|
|
13
|
-
[x1, y1],
|
|
14
|
-
[x1, y0],
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
function priority(shape) {
|
|
18
|
-
return shape.style.priority || 0;
|
|
19
|
-
}
|
|
20
|
-
function show(shape) {
|
|
21
|
-
shape.style.visibility = 'visible';
|
|
22
|
-
}
|
|
23
|
-
function hide(shape) {
|
|
24
|
-
shape.style.visibility = 'hidden';
|
|
25
|
-
}
|
|
26
|
-
// @todo Support label shape with priority attribute.
|
|
27
|
-
const HideOverlap = () => {
|
|
28
|
-
return (labels, coordinate) => {
|
|
29
|
-
const displayLabels = [];
|
|
30
|
-
// Label with lower priority will be hidden when overlapped.
|
|
31
|
-
labels.sort((a, b) => (0, d3_array_1.ascending)(priority(a), priority(b)));
|
|
32
|
-
for (let i = 0; i < labels.length; i++) {
|
|
33
|
-
const label = labels[i];
|
|
34
|
-
show(label);
|
|
35
|
-
let overlapping = false;
|
|
36
|
-
for (let j = 0; j < displayLabels.length; j++) {
|
|
37
|
-
const existedLabel = displayLabels[j];
|
|
38
|
-
if ((0, path_util_1.isPolygonsIntersect)(getPoints(label), getPoints(existedLabel))) {
|
|
39
|
-
hide(label);
|
|
40
|
-
overlapping = true;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (!overlapping) {
|
|
45
|
-
displayLabels.push(label);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return labels;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
exports.HideOverlap = HideOverlap;
|
|
52
|
-
//# sourceMappingURL=hideOverlap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hideOverlap.js","sourceRoot":"src/","sources":["label-transform/hideOverlap.ts"],"names":[],"mappings":";;;AACA,+CAAsD;AACtD,uCAAqC;AAIrC,SAAS,SAAS,CAAC,OAAsB;IACvC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAC/C,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;IACrB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC;IACrB,OAAO;QACL,CAAC,EAAE,EAAE,EAAE,CAAC;QACR,CAAC,EAAE,EAAE,EAAE,CAAC;QACR,CAAC,EAAE,EAAE,EAAE,CAAC;QACR,CAAC,EAAE,EAAE,EAAE,CAAC;KACT,CAAC;AACJ,CAAC;AAID,SAAS,QAAQ,CAAC,KAAoB;IACpC,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,IAAI,CAAC,KAAoB;IAChC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;AACrC,CAAC;AAED,SAAS,IAAI,CAAC,KAAoB;IAChC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;AACpC,CAAC;AAED,qDAAqD;AAC9C,MAAM,WAAW,GAA4B,GAAG,EAAE;IACvD,OAAO,CAAC,MAAuB,EAAE,UAAU,EAAE,EAAE;QAC7C,MAAM,aAAa,GAAG,EAAE,CAAC;QAEzB,4DAA4D;QAC5D,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,CAAC;YAEZ,IAAI,WAAW,GAAG,KAAK,CAAC;YACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;gBACtC,IAAI,IAAA,+BAAmB,EAAC,SAAS,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE;oBAClE,IAAI,CAAC,KAAK,CAAC,CAAC;oBACZ,WAAW,GAAG,IAAI,CAAC;oBACnB,MAAM;iBACP;aACF;YAED,IAAI,CAAC,WAAW,EAAE;gBAChB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC3B;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,WAAW,eA4BtB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SpiderLabelTransform } from '../spec';
|
|
2
|
-
import { LabelTransformComponent as LLC } from '../runtime';
|
|
3
|
-
export type SpiderOptions = Omit<SpiderLabelTransform, 'type'>;
|
|
4
|
-
/**
|
|
5
|
-
* Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Spider: LLC<SpiderOptions>;
|