@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as bottomLeft } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bottomLeft = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "bottomLeft", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=bottomLeft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomLeft.js","sourceRoot":"src/","sources":["shape/label/position/bottomLeft.ts"],"names":[],"mappings":";;;AAAA,qCAA0D;AAAjD,qGAAA,eAAe,OAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as bottomRight } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bottomRight = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "bottomRight", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=bottomRight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottomRight.js","sourceRoot":"src/","sources":["shape/label/position/bottomRight.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAAlD,sGAAA,eAAe,OAAe"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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' | 'spider' | 'surround';
|
|
4
|
+
export declare function inferNonCircularStyle(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate): any;
|
|
5
|
+
export declare function inferRadialStyle(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate): {
|
|
6
|
+
textAlign: string;
|
|
7
|
+
textBaseline: string;
|
|
8
|
+
rotate: number;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function inferCircularStyle(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate): {
|
|
13
|
+
connector: any;
|
|
14
|
+
connectorPoints: Vector2[];
|
|
15
|
+
dx: number;
|
|
16
|
+
textAlign: string;
|
|
17
|
+
textBaseline: string;
|
|
18
|
+
rotate: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function getDefaultStyle(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate): any;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const vector_1 = require("../../utils/vector");
|
|
3
|
+
exports.getDefaultStyle = exports.inferCircularStyle = exports.inferRadialStyle = exports.inferNonCircularStyle = void 0;
|
|
4
|
+
const utils_1 = require("../../../shape/utils");
|
|
5
|
+
const coordinate_1 = require("../../../utils/coordinate");
|
|
6
|
+
const helper_1 = require("../../../utils/helper");
|
|
7
|
+
const vector_1 = require("../../../utils/vector");
|
|
9
8
|
function inferNonCircularStyle(position, points, value, coordinate) {
|
|
10
9
|
const { bounds } = value;
|
|
11
10
|
const [[x0, y0], [x1, y1]] = bounds;
|
|
@@ -43,6 +42,7 @@ function inferNonCircularStyle(position, points, value, coordinate) {
|
|
|
43
42
|
textBaseline: 'middle',
|
|
44
43
|
});
|
|
45
44
|
}
|
|
45
|
+
exports.inferNonCircularStyle = inferNonCircularStyle;
|
|
46
46
|
function inferRadialStyle(position, points, value, coordinate) {
|
|
47
47
|
const { y, y1, autoRotate, rotateToAlignArc } = value;
|
|
48
48
|
const center = coordinate.getCenter();
|
|
@@ -58,6 +58,7 @@ function inferRadialStyle(position, points, value, coordinate) {
|
|
|
58
58
|
})();
|
|
59
59
|
return Object.assign(Object.assign({}, point), { textAlign: position === 'inside' ? 'center' : 'start', textBaseline: 'middle', rotate });
|
|
60
60
|
}
|
|
61
|
+
exports.inferRadialStyle = inferRadialStyle;
|
|
61
62
|
function arcPoint(center, angle, radius) {
|
|
62
63
|
return [
|
|
63
64
|
center[0] + Math.sin(angle) * radius,
|
|
@@ -110,6 +111,7 @@ function inferCircularStyle(position, points, value, coordinate) {
|
|
|
110
111
|
const toPoint = (v, x = 'x', y = 'y') => ({ [x]: v[0], [y]: v[1] });
|
|
111
112
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, toPoint(p0, 'x0', 'y0')), toPoint(p1)), textStyle(position, sign > 0 || (0, coordinate_1.isRadial)(coordinate))), connectorStyle);
|
|
112
113
|
}
|
|
114
|
+
exports.inferCircularStyle = inferCircularStyle;
|
|
113
115
|
function inferIdentityStyle(position, points, value, coordinate) {
|
|
114
116
|
const { bounds } = value;
|
|
115
117
|
const [p] = bounds;
|
|
@@ -134,40 +136,5 @@ function getDefaultStyle(position, points, value, coordinate) {
|
|
|
134
136
|
: inferNonCircularStyle;
|
|
135
137
|
return inferDefaultStyle(position, points, value, coordinate);
|
|
136
138
|
}
|
|
137
|
-
exports.
|
|
138
|
-
|
|
139
|
-
exports.right = getDefaultStyle;
|
|
140
|
-
exports.left = getDefaultStyle;
|
|
141
|
-
exports.topLeft = getDefaultStyle;
|
|
142
|
-
exports.topRight = getDefaultStyle;
|
|
143
|
-
exports.bottomLeft = getDefaultStyle;
|
|
144
|
-
exports.bottomRight = getDefaultStyle;
|
|
145
|
-
exports.inside = getDefaultStyle;
|
|
146
|
-
exports.outside = getDefaultStyle;
|
|
147
|
-
/**
|
|
148
|
-
* Only for Area label.
|
|
149
|
-
*/
|
|
150
|
-
function area(position, points, value, coordinate) {
|
|
151
|
-
const l = points.length / 2;
|
|
152
|
-
const Y1 = points.slice(0, l);
|
|
153
|
-
const Y0 = points.slice(l);
|
|
154
|
-
// Get the maximal space for label.
|
|
155
|
-
let idx = (0, d3_array_1.maxIndex)(Y1, (p, i) => Math.abs(p[1] - Y0[i][1]));
|
|
156
|
-
// Do not show label at first and last.
|
|
157
|
-
idx = Math.max(Math.min(idx, l - 2), 1);
|
|
158
|
-
const mid = (i) => [Y1[i][0], (Y1[i][1] + Y0[i][1]) / 2];
|
|
159
|
-
const point = mid(idx);
|
|
160
|
-
const prev = mid(idx - 1);
|
|
161
|
-
const next = mid(idx + 1);
|
|
162
|
-
// todo: G rotate only support deg.
|
|
163
|
-
const rotate = ((0, vector_1.angle)((0, vector_1.sub)(next, prev)) / Math.PI) * 180;
|
|
164
|
-
return {
|
|
165
|
-
x: point[0],
|
|
166
|
-
y: point[1],
|
|
167
|
-
transform: `rotate(${rotate}deg)`,
|
|
168
|
-
textAlign: 'center',
|
|
169
|
-
textBaseline: 'middle',
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
exports.area = area;
|
|
173
|
-
//# sourceMappingURL=position.js.map
|
|
139
|
+
exports.getDefaultStyle = getDefaultStyle;
|
|
140
|
+
//# sourceMapp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B;AACJ,CAAC;AApED,gDAoEC;AAED,SAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,OAAO;QACL,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACP,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACR,CAAC;AACJ,CAAC;AAED,SAAgB,eAAe,CAC7B,QAAuB,EACvB,MAAiB,EACjB,KAA0B,EAC1B,UAAsB;IAEtB,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,yBAAyB;IACzB,0CAA0C;IAC1C,sDAAsD;IACtD,wCAAwC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,OAAO,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;KAChE;IAED,MAAM,iBAAiB,GAAG,IAAA,qBAAQ,EAAC,UAAU,CAAC;QAC5C,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,IAAA,uBAAU,EAAC,UAAU,CAAC;YACxB,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,qBAAqB,CAAC;IAE1B,OAAO,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC;AAtBD,0CAsBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { area } from './area';
|
|
2
|
+
export { bottom } from './bottom';
|
|
3
|
+
export { bottomLeft } from './bottomLeft';
|
|
4
|
+
export { bottomRight } from './bottomRight';
|
|
5
|
+
export { inside } from './inside';
|
|
6
|
+
export { left } from './left';
|
|
7
|
+
export { outside } from './outside';
|
|
8
|
+
export { right } from './right';
|
|
9
|
+
export { spider } from './spider';
|
|
10
|
+
export { surround } from './surround';
|
|
11
|
+
export { top } from './top';
|
|
12
|
+
export { topLeft } from './topLeft';
|
|
13
|
+
export { topRight } from './topRight';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.topRight = exports.topLeft = exports.top = exports.surround = exports.spider = exports.right = exports.outside = exports.left = exports.inside = exports.bottomRight = exports.bottomLeft = exports.bottom = exports.area = void 0;
|
|
4
|
+
var area_1 = require("./area");
|
|
5
|
+
Object.defineProperty(exports, "area", { enumerable: true, get: function () { return area_1.area; } });
|
|
6
|
+
var bottom_1 = require("./bottom");
|
|
7
|
+
Object.defineProperty(exports, "bottom", { enumerable: true, get: function () { return bottom_1.bottom; } });
|
|
8
|
+
var bottomLeft_1 = require("./bottomLeft");
|
|
9
|
+
Object.defineProperty(exports, "bottomLeft", { enumerable: true, get: function () { return bottomLeft_1.bottomLeft; } });
|
|
10
|
+
var bottomRight_1 = require("./bottomRight");
|
|
11
|
+
Object.defineProperty(exports, "bottomRight", { enumerable: true, get: function () { return bottomRight_1.bottomRight; } });
|
|
12
|
+
var inside_1 = require("./inside");
|
|
13
|
+
Object.defineProperty(exports, "inside", { enumerable: true, get: function () { return inside_1.inside; } });
|
|
14
|
+
var left_1 = require("./left");
|
|
15
|
+
Object.defineProperty(exports, "left", { enumerable: true, get: function () { return left_1.left; } });
|
|
16
|
+
var outside_1 = require("./outside");
|
|
17
|
+
Object.defineProperty(exports, "outside", { enumerable: true, get: function () { return outside_1.outside; } });
|
|
18
|
+
var right_1 = require("./right");
|
|
19
|
+
Object.defineProperty(exports, "right", { enumerable: true, get: function () { return right_1.right; } });
|
|
20
|
+
var spider_1 = require("./spider");
|
|
21
|
+
Object.defineProperty(exports, "spider", { enumerable: true, get: function () { return spider_1.spider; } });
|
|
22
|
+
var surround_1 = require("./surround");
|
|
23
|
+
Object.defineProperty(exports, "surround", { enumerable: true, get: function () { return surround_1.surround; } });
|
|
24
|
+
var top_1 = require("./top");
|
|
25
|
+
Object.defineProperty(exports, "top", { enumerable: true, get: function () { return top_1.top; } });
|
|
26
|
+
var topLeft_1 = require("./topLeft");
|
|
27
|
+
Object.defineProperty(exports, "topLeft", { enumerable: true, get: function () { return topLeft_1.topLeft; } });
|
|
28
|
+
var topRight_1 = require("./topRight");
|
|
29
|
+
Object.defineProperty(exports, "topRight", { enumerable: true, get: function () { return topRight_1.topRight; } });
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["shape/label/position/index.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as inside } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inside = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "inside", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=inside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inside.js","sourceRoot":"src/","sources":["shape/label/position/inside.ts"],"names":[],"mappings":";;;AAAA,qCAAsD;AAA7C,iGAAA,eAAe,OAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as left } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.left = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "left", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=left.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"left.js","sourceRoot":"src/","sources":["shape/label/position/left.ts"],"names":[],"mappings":";;;AAAA,qCAAoD;AAA3C,+FAAA,eAAe,OAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as outside } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.outside = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "outside", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=outside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outside.js","sourceRoot":"src/","sources":["shape/label/position/outside.ts"],"names":[],"mappings":";;;AAAA,qCAAuD;AAA9C,kGAAA,eAAe,OAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as right } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.right = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "right", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=right.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"right.js","sourceRoot":"src/","sources":["shape/label/position/right.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAA5C,gGAAA,eAAe,OAAS"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Coordinate } from '@antv/coord';
|
|
2
|
+
import { Vector2 } from '../../../runtime';
|
|
3
|
+
import { LabelPosition } from './default';
|
|
4
|
+
/**
|
|
5
|
+
* Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
|
|
6
|
+
*/
|
|
7
|
+
export declare function spider(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate, options: any): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.spider = void 0;
|
|
15
|
+
const vector_1 = require("../../../utils/vector");
|
|
16
|
+
const coordinate_1 = require("../../../utils/coordinate");
|
|
17
|
+
const helper_1 = require("../../../utils/helper");
|
|
18
|
+
const default_1 = require("./default");
|
|
19
|
+
/**
|
|
20
|
+
* Spider label transform only suitable for the labels in polar coordinate, labels should distinguish coordinate type.
|
|
21
|
+
*/
|
|
22
|
+
function spider(position, points, value, coordinate, options) {
|
|
23
|
+
if (!(0, coordinate_1.isCircular)(coordinate))
|
|
24
|
+
return {};
|
|
25
|
+
const { edgeDistance = 0 } = options;
|
|
26
|
+
const style = __rest((0, default_1.inferCircularStyle)('outside', points, value, coordinate), []);
|
|
27
|
+
const { x: coordX, width } = coordinate.getOptions();
|
|
28
|
+
const center = coordinate.getCenter();
|
|
29
|
+
// todo: How to configure spider.
|
|
30
|
+
const margin = (0, helper_1.maybePercentage)(edgeDistance, width);
|
|
31
|
+
const edgeX = coordX + margin;
|
|
32
|
+
const edgeX1 = coordX + width - margin;
|
|
33
|
+
const { x: originX, x0, y0 } = style;
|
|
34
|
+
const dx = originX <= center[0] ? edgeX - originX : edgeX1 - originX;
|
|
35
|
+
style.x += dx;
|
|
36
|
+
const { x, y } = style;
|
|
37
|
+
const p0 = (0, vector_1.sub)([x0, y0], center);
|
|
38
|
+
const p1 = (0, vector_1.sub)([0, y], center);
|
|
39
|
+
const p1x = p0[1] ? (p0[0] * p1[1]) / p0[1] + center[0] : x;
|
|
40
|
+
style.connectorPoints = [[p1x - x, 0]];
|
|
41
|
+
return style;
|
|
42
|
+
}
|
|
43
|
+
exports.spider = spider;
|
|
44
|
+
//# sourceMappingURL=spider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spider.js","sourceRoot":"src/","sources":["shape/label/position/spider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kDAA4C;AAE5C,0DAAuD;AACvD,kDAAwD;AACxD,uCAA8D;AAE9D;;GAEG;AACH,SAAgB,MAAM,CACpB,QAAuB,EACvB,MAAiB,EACjB,KAA0B,EAC1B,UAAsB,EACtB,OAAO;IAEP,IAAI,CAAC,IAAA,uBAAU,EAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,MAAM,EAAE,YAAY,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;IAErC,MAA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AAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,KAAK,CAAC;AACf,CAAC;AAnCD,wBAmCC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Coordinate } from '@antv/coord';
|
|
2
|
+
import { Vector2 } from '../../../runtime';
|
|
3
|
+
import { LabelPosition } from './default';
|
|
4
|
+
/**
|
|
5
|
+
* Surround label transform is used to make labels surround circular.
|
|
6
|
+
*/
|
|
7
|
+
export declare function surround(position: LabelPosition, points: Vector2[], value: Record<string, any>, coordinate: Coordinate, options: any): any;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.surround = void 0;
|
|
15
|
+
const coordinate_1 = require("../../../utils/coordinate");
|
|
16
|
+
const vector_1 = require("../../../utils/vector");
|
|
17
|
+
const default_1 = require("./default");
|
|
18
|
+
/**
|
|
19
|
+
* Surround label transform is used to make labels surround circular.
|
|
20
|
+
*/
|
|
21
|
+
function surround(position, points, value, coordinate, options) {
|
|
22
|
+
if (!(0, coordinate_1.isCircular)(coordinate))
|
|
23
|
+
return {};
|
|
24
|
+
const { offset = 12 } = options;
|
|
25
|
+
const style = __rest((0, default_1.inferCircularStyle)('outside', points, value, coordinate), []);
|
|
26
|
+
const center = coordinate.getCenter();
|
|
27
|
+
const radius = (0, coordinate_1.getRadius)(coordinate) + offset;
|
|
28
|
+
const { x0, y0, connector, connectorLength2 = 0 } = style;
|
|
29
|
+
const labelAngle = (0, vector_1.angleWithQuadrant)([x0 - center[0], y0 - center[1]]);
|
|
30
|
+
const length2 = connector
|
|
31
|
+
? connectorLength2 * (Math.sin(labelAngle) < 0 ? -1 : 1)
|
|
32
|
+
: 0;
|
|
33
|
+
const newX = center[0] + Math.sin(labelAngle) * radius;
|
|
34
|
+
const newY = center[1] - Math.cos(labelAngle) * radius;
|
|
35
|
+
style.x = newX + length2;
|
|
36
|
+
style.y = newY;
|
|
37
|
+
style.connectorPoints = [[-length2, 0]];
|
|
38
|
+
return style;
|
|
39
|
+
}
|
|
40
|
+
exports.surround = surround;
|
|
41
|
+
//# sourceMappingURL=surround.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surround.js","sourceRoot":"src/","sources":["shape/label/position/surround.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,0DAAkE;AAClE,kDAA0D;AAC1D,uCAA8D;AAE9D;;GAEG;AACH,SAAgB,QAAQ,CACtB,QAAuB,EACvB,MAAiB,EACjB,KAA0B,EAC1B,UAAsB,EACtB,OAAO;IAEP,IAAI,CAAC,IAAA,uBAAU,EAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAChC,MAAW,KAAK,UAAU,IAAA,4BAAkB,EAC1C,SAAS,EACT,MAAM,EACN,KAAK,EACL,UAAU,CACX,EALK,EAAY,CAKjB,CAAC;IACF,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,IAAA,sBAAS,EAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IAE9C,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,UAAU,GAAG,IAAA,0BAAiB,EAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,SAAS;QACvB,CAAC,CAAC,gBAAgB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC,CAAC;IACN,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IACvD,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC;IACzB,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;IACf,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAExC,OAAO,KAAK,CAAC;AACf,CAAC;AA/BD,4BA+BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as top } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.top = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "top", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=top.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top.js","sourceRoot":"src/","sources":["shape/label/position/top.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AAA1C,8FAAA,eAAe,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as topLeft } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.topLeft = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "topLeft", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=topLeft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topLeft.js","sourceRoot":"src/","sources":["shape/label/position/topLeft.ts"],"names":[],"mappings":";;;AAAA,qCAAuD;AAA9C,kGAAA,eAAe,OAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDefaultStyle as topRight } from './default';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.topRight = void 0;
|
|
4
|
+
var default_1 = require("./default");
|
|
5
|
+
Object.defineProperty(exports, "topRight", { enumerable: true, get: function () { return default_1.getDefaultStyle; } });
|
|
6
|
+
//# sourceMappingURL=topRight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topRight.js","sourceRoot":"src/","sources":["shape/label/position/topRight.ts"],"names":[],"mappings":";;;AAAA,qCAAwD;AAA/C,mGAAA,eAAe,OAAY"}
|
|
@@ -12,6 +12,7 @@ type EventType = (...args: any[]) => void;
|
|
|
12
12
|
export type Node = MarkComposition | ViewComposition | SpaceLayerComposition | SpaceFlexComposition | RepeatMatrixComposition | FacetRectComposition | FacetCircleComposition | GeoViewComposition | TimingKeyframeComposition;
|
|
13
13
|
export type MarkComposition = Geometry & {
|
|
14
14
|
title?: Title;
|
|
15
|
+
clip?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export type ViewComposition = {
|
|
17
18
|
type?: 'view';
|
|
@@ -47,6 +48,7 @@ export type ViewComposition = {
|
|
|
47
48
|
legend?: Record<string, any>;
|
|
48
49
|
on?: Record<string, EventType | EventType[]>;
|
|
49
50
|
style?: Record<string, any>;
|
|
51
|
+
clip?: boolean;
|
|
50
52
|
};
|
|
51
53
|
export type SpaceLayerComposition = {
|
|
52
54
|
type?: 'spaceLayer';
|
package/lib/spec/data.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export type InlineConnector = {
|
|
|
14
14
|
value?: any;
|
|
15
15
|
transform?: DataTransform[];
|
|
16
16
|
};
|
|
17
|
-
export type DataTransform = SortByTransform | PickTransform | RenameTransform | SubsetTransform | FoldTransform | JoinTransform |
|
|
18
|
-
export type DataTransformTypes = 'sortBy' | 'pick' | 'rename' | 'subset' | 'fold' | 'join' | 'filter' | 'map' | 'custom' | DataComponent;
|
|
17
|
+
export type DataTransform = SortByTransform | SortTransform | PickTransform | RenameTransform | SubsetTransform | FoldTransform | JoinTransform | FilterDataTransform | MapTransform | CustomTransform;
|
|
18
|
+
export type DataTransformTypes = 'sortBy' | 'sort' | 'pick' | 'rename' | 'subset' | 'fold' | 'join' | 'filter' | 'map' | 'custom' | DataComponent;
|
|
19
19
|
export type SortByTransform = {
|
|
20
20
|
type?: 'sortBy';
|
|
21
21
|
/** type: [field, order]; order: true => ascend, false => descend */
|
|
@@ -35,13 +35,20 @@ export type SubsetTransform = {
|
|
|
35
35
|
end?: number;
|
|
36
36
|
fields?: string[];
|
|
37
37
|
};
|
|
38
|
-
export type
|
|
38
|
+
export type FilterDataTransform = {
|
|
39
39
|
type?: 'filter';
|
|
40
40
|
/**
|
|
41
41
|
* The filter condition, same with [Array.prototype.filter](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
|
|
42
42
|
*/
|
|
43
43
|
callback?: (v: any, idx: number, arr: any[]) => boolean;
|
|
44
44
|
};
|
|
45
|
+
export type SortTransform = {
|
|
46
|
+
type?: 'sort';
|
|
47
|
+
/**
|
|
48
|
+
* The sort comparator, same with [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).
|
|
49
|
+
*/
|
|
50
|
+
callback?: (a: any, b: any) => number;
|
|
51
|
+
};
|
|
45
52
|
export type FoldTransform = {
|
|
46
53
|
type?: 'fold';
|
|
47
54
|
fields?: string[];
|
package/lib/spec/geometry.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Theme } from './theme';
|
|
|
9
9
|
import { ClusterTransform, Data } from './data';
|
|
10
10
|
export type Geometry = IntervalGeometry | RectGeometry | LineGeometry | PointGeometry | TextGeometry | CellGeometry | AreaGeometry | NodeGeometry | EdgeGeometry | ImageGeometry | PolygonGeometry | BoxGeometry | VectorGeometry | LineXMark | LineYMark | RangeMark | RangeXMark | RangeYMark | ConnectorMark | SankeyMark | PathMark | TreemapMark | PackMark | BoxPlotMark | ShapeMark | ForceGraphMark | TreeMark | WordCloudMark | CustomComponent;
|
|
11
11
|
export type GeometryTypes = 'interval' | 'rect' | 'line' | 'point' | 'text' | 'cell' | 'area' | 'node' | 'edge' | 'link' | 'image' | 'polygon' | 'box' | 'vector' | 'lineX' | 'lineY' | 'connector' | 'range' | 'rangeX' | 'rangeY' | 'sankey' | 'path' | 'treemap' | 'pack' | 'boxplot' | 'shape' | 'forceGraph' | 'tree' | 'wordCloud' | MarkComponent;
|
|
12
|
-
export type ChannelTypes = 'x' | 'y' | 'x1' | 'y1' | 'series' | 'color' | 'opacity' | 'shape' | 'enterType' | 'enterEasing' | 'enterDuration' | 'enterDelay' | 'enter' | 'size' | 'tooltip' | 'title' | 'key' | 'groupKey' | 'label' | 'position' | 'series'
|
|
12
|
+
export type ChannelTypes = 'x' | 'y' | 'x1' | 'y1' | 'series' | 'color' | 'opacity' | 'shape' | 'enterType' | 'enterEasing' | 'enterDuration' | 'enterDelay' | 'enter' | 'size' | 'tooltip' | 'title' | 'key' | 'groupKey' | 'label' | 'position' | 'series' | `tooltip${number}`;
|
|
13
13
|
export type BaseGeometry<T extends GeometryTypes, C extends string = ChannelTypes> = {
|
|
14
14
|
type?: T | string;
|
|
15
15
|
class?: string;
|
|
@@ -35,6 +35,7 @@ export type BaseGeometry<T extends GeometryTypes, C extends string = ChannelType
|
|
|
35
35
|
scale?: Partial<Record<C, Scale>>;
|
|
36
36
|
axis?: Partial<Record<'x' | 'y' | 'position' | `position${number}`, Axis | boolean>> | boolean;
|
|
37
37
|
legend?: Partial<Record<'size' | 'color', Legend | boolean>> | boolean;
|
|
38
|
+
slider?: Partial<Record<'x' | 'y', any>>;
|
|
38
39
|
coordinates?: Coordinate[];
|
|
39
40
|
style?: Record<string, any>;
|
|
40
41
|
interactions?: Interaction[];
|
|
@@ -1,17 +1,34 @@
|
|
|
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';
|
|
4
|
-
export type Interaction = ElementHighlightInteraction | ElementHighlightByColorInteraction | ElementHighlightByXInteraction | ElementSelectByColorInteraction | ElementSelectByXInteraction | ElementSelectInteraction | TooltipInteraction | FisheyeInteraction | ChartIndex | CustomInteraction;
|
|
5
|
-
export type InteractionTypes = 'elementHighlight' | 'elementHighlightByX' | 'elementHighlightByColor' | 'fisheye' | 'chartIndex' | 'elementSelect' | 'elementSelectByX' | 'elementSelectByColor' | 'fisheye' | 'tooltip' | InteractionComponent;
|
|
5
|
+
export type Interaction = ElementHighlightInteraction | ElementHighlightByColorInteraction | ElementHighlightByXInteraction | ElementSelectByColorInteraction | ElementSelectByXInteraction | ElementSelectInteraction | TooltipInteraction | FisheyeInteraction | ChartIndex | CustomInteraction | LegendFilterInteraction | BrushHighlightInteraction | BrushXHighlightInteraction | BrushYHighlightInteraction;
|
|
6
|
+
export type InteractionTypes = 'elementHighlight' | 'elementHighlightByX' | 'elementHighlightByColor' | 'fisheye' | 'chartIndex' | 'elementSelect' | 'elementSelectByX' | 'elementSelectByColor' | 'fisheye' | 'tooltip' | 'legendFilter' | 'brushXHighlight' | 'brushYHighlight' | 'brushHighlight' | InteractionComponent;
|
|
6
7
|
export type BrushInteraction = {
|
|
7
8
|
type?: 'brush';
|
|
8
9
|
brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
|
|
9
10
|
};
|
|
10
11
|
export type BrushHighlightInteraction = {
|
|
11
12
|
type?: 'brushHighlight';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
reverse?: boolean;
|
|
14
|
+
shared?: boolean;
|
|
15
|
+
series?: boolean;
|
|
16
|
+
facet?: boolean;
|
|
17
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
18
|
+
export type BrushXHighlightInteraction = {
|
|
19
|
+
type?: 'brushXHighlight';
|
|
20
|
+
reverse?: boolean;
|
|
21
|
+
shared?: boolean;
|
|
22
|
+
series?: boolean;
|
|
23
|
+
facet?: boolean;
|
|
24
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
25
|
+
export type BrushYHighlightInteraction = {
|
|
26
|
+
type?: 'brushYHighlight';
|
|
27
|
+
reverse?: boolean;
|
|
28
|
+
shared?: boolean;
|
|
29
|
+
series?: boolean;
|
|
30
|
+
facet?: boolean;
|
|
31
|
+
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
15
32
|
export type BrushVisibleInteraction = {
|
|
16
33
|
type?: 'brushVisible';
|
|
17
34
|
brushType?: 'rect' | 'rectX' | 'rectY' | 'polygon';
|
|
@@ -41,6 +58,11 @@ export type ElementHighlightByColorInteraction = {
|
|
|
41
58
|
type?: 'elementHighlightByColor';
|
|
42
59
|
color?: string;
|
|
43
60
|
} & Record<`${'link' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
61
|
+
export type LegendFilterInteraction = {
|
|
62
|
+
type?: 'legendFilter';
|
|
63
|
+
channel?: ChannelTypes;
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
} & Record<`${'marker' | 'label'}Unselected${any}`, any>;
|
|
44
66
|
export type ChartIndex = {
|
|
45
67
|
type?: 'chartIndex';
|
|
46
68
|
wait?: number;
|
|
@@ -60,6 +82,7 @@ export type TooltipInteraction = Omit<TooltipAction, 'type'> & {
|
|
|
60
82
|
type?: 'tooltip';
|
|
61
83
|
shared?: boolean;
|
|
62
84
|
series?: boolean;
|
|
85
|
+
facet?: boolean;
|
|
63
86
|
item?: any;
|
|
64
87
|
};
|
|
65
88
|
export type FisheyeInteraction = {
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
|
+
export type LabelTransform = OverlapHideTransform | OverlapDodgeYTransform | ContrastReverseTransform | OverflowHideTransform;
|
|
3
|
+
export type OverlapHideTransform = {
|
|
4
|
+
type?: 'overlapHide';
|
|
5
|
+
/**
|
|
6
|
+
* The hide priority, is the comparator for label.sort().
|
|
7
|
+
*/
|
|
8
|
+
priority?: (a: DisplayObject, b: DisplayObject) => number;
|
|
4
9
|
};
|
|
5
|
-
export type
|
|
6
|
-
type?: '
|
|
7
|
-
|
|
10
|
+
export type OverlapDodgeYTransform = {
|
|
11
|
+
type?: 'overlapDodgeY';
|
|
12
|
+
maxIterations?: number;
|
|
8
13
|
maxError?: number;
|
|
9
14
|
padding?: number;
|
|
10
15
|
};
|
|
11
|
-
export type
|
|
12
|
-
type
|
|
13
|
-
|
|
16
|
+
export type ContrastReverseTransform = {
|
|
17
|
+
type: 'contrastReverse';
|
|
18
|
+
/**
|
|
19
|
+
* Transform when the contrast ratio < threshold.
|
|
20
|
+
* Default is `4.5`.
|
|
21
|
+
*/
|
|
22
|
+
threshold?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The optional color palette, default is [#000, #fff].
|
|
25
|
+
*/
|
|
26
|
+
palette?: string[];
|
|
14
27
|
};
|
|
15
|
-
export type
|
|
16
|
-
type
|
|
28
|
+
export type OverflowHideTransform = {
|
|
29
|
+
type: 'overflowHide';
|
|
17
30
|
};
|
package/lib/spec/theme.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Theme as ThemeOptions, ThemeComponent } from '../runtime/types/component';
|
|
2
|
-
export type Theme = LightTheme | DarkTheme | CustomTheme;
|
|
3
|
-
export type ThemeTypes = 'light' | 'dark' | ThemeComponent;
|
|
2
|
+
export type Theme = LightTheme | DarkTheme | AcademyTheme | CustomTheme;
|
|
3
|
+
export type ThemeTypes = 'light' | 'dark' | 'academy' | ThemeComponent;
|
|
4
4
|
export type LightTheme = {
|
|
5
5
|
type?: 'light';
|
|
6
6
|
} & ThemeOptions;
|
|
7
7
|
export type DarkTheme = {
|
|
8
8
|
type?: 'dark';
|
|
9
9
|
} & ThemeOptions;
|
|
10
|
+
export type AcademyTheme = {
|
|
11
|
+
type?: 'academy';
|
|
12
|
+
} & ThemeOptions;
|
|
10
13
|
export type CustomTheme = {
|
|
11
14
|
type?: ThemeComponent;
|
|
12
15
|
} & ThemeOptions;
|