@antv/component 2.1.0 → 2.1.1-alpha.1
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/component.min.js +1 -1
- package/esm/animation/utils.js +31 -37
- package/esm/animation/utils.js.map +1 -1
- package/esm/constant.js +1 -1
- package/esm/constant.js.map +1 -1
- package/esm/core/component.js +30 -43
- package/esm/core/component.js.map +1 -1
- package/esm/shapes/Text.js +13 -21
- package/esm/shapes/Text.js.map +1 -1
- package/esm/ui/axis/axis.js +25 -31
- package/esm/ui/axis/axis.js.map +1 -1
- package/esm/ui/axis/constant.js +11 -13
- package/esm/ui/axis/constant.js.map +1 -1
- package/esm/ui/axis/guides/grid.js +29 -34
- package/esm/ui/axis/guides/grid.js.map +1 -1
- package/esm/ui/axis/guides/labels.js +76 -83
- package/esm/ui/axis/guides/labels.js.map +1 -1
- package/esm/ui/axis/guides/line.js +74 -87
- package/esm/ui/axis/guides/line.js.map +1 -1
- package/esm/ui/axis/guides/ticks.js +31 -39
- package/esm/ui/axis/guides/ticks.js.map +1 -1
- package/esm/ui/axis/guides/title.js +33 -37
- package/esm/ui/axis/guides/title.js.map +1 -1
- package/esm/ui/axis/guides/utils.js +10 -12
- package/esm/ui/axis/guides/utils.js.map +1 -1
- package/esm/ui/axis/overlap/autoEllipsis.js +12 -19
- package/esm/ui/axis/overlap/autoEllipsis.js.map +1 -1
- package/esm/ui/axis/overlap/autoHide.js +20 -24
- package/esm/ui/axis/overlap/autoHide.js.map +1 -1
- package/esm/ui/axis/overlap/autoRotate.js +11 -25
- package/esm/ui/axis/overlap/autoRotate.js.map +1 -1
- package/esm/ui/axis/overlap/autoWrap.js +11 -14
- package/esm/ui/axis/overlap/autoWrap.js.map +1 -1
- package/esm/ui/axis/overlap/index.js +7 -7
- package/esm/ui/axis/overlap/index.js.map +1 -1
- package/esm/ui/axis/utils/bounds.js +48 -75
- package/esm/ui/axis/utils/bounds.js.map +1 -1
- package/esm/ui/axis/utils/contain.js +14 -14
- package/esm/ui/axis/utils/contain.js.map +1 -1
- package/esm/ui/axis/utils/index.js +3 -7
- package/esm/ui/axis/utils/index.js.map +1 -1
- package/esm/ui/axis/utils/intersect.js +21 -33
- package/esm/ui/axis/utils/intersect.js.map +1 -1
- package/esm/ui/axis/utils/test.js +29 -41
- package/esm/ui/axis/utils/test.js.map +1 -1
- package/esm/ui/breadcrumb/index.js +64 -72
- package/esm/ui/breadcrumb/index.js.map +1 -1
- package/esm/ui/button/constant.js +3 -3
- package/esm/ui/button/constant.js.map +1 -1
- package/esm/ui/button/index.js +81 -97
- package/esm/ui/button/index.js.map +1 -1
- package/esm/ui/checkbox/constant.js +4 -4
- package/esm/ui/checkbox/constant.js.map +1 -1
- package/esm/ui/checkbox/index.js +23 -26
- package/esm/ui/checkbox/index.js.map +1 -1
- package/esm/ui/crosshair/base.js +29 -45
- package/esm/ui/crosshair/base.js.map +1 -1
- package/esm/ui/crosshair/circle.js +25 -34
- package/esm/ui/crosshair/circle.js.map +1 -1
- package/esm/ui/crosshair/constant.js +4 -4
- package/esm/ui/crosshair/constant.js.map +1 -1
- package/esm/ui/crosshair/line.js +55 -75
- package/esm/ui/crosshair/line.js.map +1 -1
- package/esm/ui/crosshair/polygon.js +54 -70
- package/esm/ui/crosshair/polygon.js.map +1 -1
- package/esm/ui/grid/index.js +73 -95
- package/esm/ui/grid/index.js.map +1 -1
- package/esm/ui/indicator/constant.js +2 -2
- package/esm/ui/indicator/constant.js.map +1 -1
- package/esm/ui/indicator/indicator.js +58 -63
- package/esm/ui/indicator/indicator.js.map +1 -1
- package/esm/ui/layout/layout.js +52 -66
- package/esm/ui/layout/layout.js.map +1 -1
- package/esm/ui/legend/base.js +12 -13
- package/esm/ui/legend/base.js.map +1 -1
- package/esm/ui/legend/category/item.js +122 -156
- package/esm/ui/legend/category/item.js.map +1 -1
- package/esm/ui/legend/category/items.js +158 -201
- package/esm/ui/legend/category/items.js.map +1 -1
- package/esm/ui/legend/category.js +46 -56
- package/esm/ui/legend/category.js.map +1 -1
- package/esm/ui/legend/constant.js +6 -6
- package/esm/ui/legend/constant.js.map +1 -1
- package/esm/ui/legend/continuous/handle.js +28 -33
- package/esm/ui/legend/continuous/handle.js.map +1 -1
- package/esm/ui/legend/continuous/ribbon.js +34 -38
- package/esm/ui/legend/continuous/ribbon.js.map +1 -1
- package/esm/ui/legend/continuous/utils.js +10 -11
- package/esm/ui/legend/continuous/utils.js.map +1 -1
- package/esm/ui/legend/continuous.js +417 -521
- package/esm/ui/legend/continuous.js.map +1 -1
- package/esm/ui/legend/utils.js +24 -31
- package/esm/ui/legend/utils.js.map +1 -1
- package/esm/ui/marker/index.js +38 -44
- package/esm/ui/marker/index.js.map +1 -1
- package/esm/ui/marker/symbol.js +24 -24
- package/esm/ui/marker/symbol.js.map +1 -1
- package/esm/ui/marker/utils.js +2 -2
- package/esm/ui/marker/utils.js.map +1 -1
- package/esm/ui/navigator/index.js +128 -159
- package/esm/ui/navigator/index.js.map +1 -1
- package/esm/ui/poptip/constant.js +67 -68
- package/esm/ui/poptip/constant.js.map +1 -1
- package/esm/ui/poptip/index.js +95 -111
- package/esm/ui/poptip/index.js.map +1 -1
- package/esm/ui/poptip/utils.js +8 -15
- package/esm/ui/poptip/utils.js.map +1 -1
- package/esm/ui/scrollbar/index.js +102 -132
- package/esm/ui/scrollbar/index.js.map +1 -1
- package/esm/ui/select/option.js +48 -58
- package/esm/ui/select/option.js.map +1 -1
- package/esm/ui/select/select.js +142 -164
- package/esm/ui/select/select.js.map +1 -1
- package/esm/ui/slider/constant.js +4 -4
- package/esm/ui/slider/constant.js.map +1 -1
- package/esm/ui/slider/handle.js +46 -54
- package/esm/ui/slider/handle.js.map +1 -1
- package/esm/ui/slider/index.js +280 -326
- package/esm/ui/slider/index.js.map +1 -1
- package/esm/ui/sparkline/columns.js +25 -34
- package/esm/ui/sparkline/columns.js.map +1 -1
- package/esm/ui/sparkline/index.js +145 -180
- package/esm/ui/sparkline/index.js.map +1 -1
- package/esm/ui/sparkline/lines.js +37 -50
- package/esm/ui/sparkline/lines.js.map +1 -1
- package/esm/ui/sparkline/path.js +36 -40
- package/esm/ui/sparkline/path.js.map +1 -1
- package/esm/ui/sparkline/utils.js +8 -9
- package/esm/ui/sparkline/utils.js.map +1 -1
- package/esm/ui/switch/constant.js +1 -1
- package/esm/ui/switch/constant.js.map +1 -1
- package/esm/ui/switch/index.js +44 -54
- package/esm/ui/switch/index.js.map +1 -1
- package/esm/ui/tag/index.js +29 -32
- package/esm/ui/tag/index.js.map +1 -1
- package/esm/ui/timebar/controller.js +69 -79
- package/esm/ui/timebar/controller.js.map +1 -1
- package/esm/ui/timebar/handle.js +62 -71
- package/esm/ui/timebar/handle.js.map +1 -1
- package/esm/ui/timebar/icons.js +308 -478
- package/esm/ui/timebar/icons.js.map +1 -1
- package/esm/ui/timebar/timebar.js +263 -318
- package/esm/ui/timebar/timebar.js.map +1 -1
- package/esm/ui/timebar/utils.js +7 -7
- package/esm/ui/timebar/utils.js.map +1 -1
- package/esm/ui/timeline/index.js +2 -6
- package/esm/ui/timeline/index.js.map +1 -1
- package/esm/ui/title/index.js +59 -64
- package/esm/ui/title/index.js.map +1 -1
- package/esm/ui/tooltip/constant.js +26 -30
- package/esm/ui/tooltip/constant.js.map +1 -1
- package/esm/ui/tooltip/index.js +109 -126
- package/esm/ui/tooltip/index.js.map +1 -1
- package/esm/util/bbox.js +24 -47
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/callback.js +1 -2
- package/esm/util/callback.js.map +1 -1
- package/esm/util/classnames.js +8 -10
- package/esm/util/classnames.js.map +1 -1
- package/esm/util/deep-assign.js +6 -14
- package/esm/util/deep-assign.js.map +1 -1
- package/esm/util/defined.js +1 -1
- package/esm/util/defined.js.map +1 -1
- package/esm/util/ellipsis.js +1 -2
- package/esm/util/ellipsis.js.map +1 -1
- package/esm/util/event.js +3 -3
- package/esm/util/event.js.map +1 -1
- package/esm/util/geometry/line-length.js +1 -4
- package/esm/util/geometry/line-length.js.map +1 -1
- package/esm/util/geometry/lines-intersection.js +5 -10
- package/esm/util/geometry/lines-intersection.js.map +1 -1
- package/esm/util/group-by.js +1 -1
- package/esm/util/group-by.js.map +1 -1
- package/esm/util/group.js +3 -3
- package/esm/util/group.js.map +1 -1
- package/esm/util/html.js +1 -1
- package/esm/util/html.js.map +1 -1
- package/esm/util/if-show.js +3 -5
- package/esm/util/if-show.js.map +1 -1
- package/esm/util/in-range.js +1 -3
- package/esm/util/in-range.js.map +1 -1
- package/esm/util/interpolate.js +12 -19
- package/esm/util/interpolate.js.map +1 -1
- package/esm/util/keyframe-interpolate.js +6 -7
- package/esm/util/keyframe-interpolate.js.map +1 -1
- package/esm/util/layout/executer.js +4 -4
- package/esm/util/layout/executer.js.map +1 -1
- package/esm/util/layout/flex/index.js +24 -26
- package/esm/util/layout/flex/index.js.map +1 -1
- package/esm/util/layout/grid/index.js +1 -1
- package/esm/util/layout/grid/index.js.map +1 -1
- package/esm/util/layout/utils/helper.js +7 -8
- package/esm/util/layout/utils/helper.js.map +1 -1
- package/esm/util/matrix.js +7 -8
- package/esm/util/matrix.js.map +1 -1
- package/esm/util/number.js +6 -7
- package/esm/util/number.js.map +1 -1
- package/esm/util/offscreen.js +9 -17
- package/esm/util/offscreen.js.map +1 -1
- package/esm/util/omit.js +3 -3
- package/esm/util/omit.js.map +1 -1
- package/esm/util/path.js +36 -41
- package/esm/util/path.js.map +1 -1
- package/esm/util/primitive.js +3 -3
- package/esm/util/primitive.js.map +1 -1
- package/esm/util/replace-children.js +3 -4
- package/esm/util/replace-children.js.map +1 -1
- package/esm/util/sampling.js +3 -3
- package/esm/util/sampling.js.map +1 -1
- package/esm/util/scale-to-pixel.js +4 -5
- package/esm/util/scale-to-pixel.js.map +1 -1
- package/esm/util/selection.js +142 -186
- package/esm/util/selection.js.map +1 -1
- package/esm/util/series.js +1 -1
- package/esm/util/series.js.map +1 -1
- package/esm/util/shape.js +15 -27
- package/esm/util/shape.js.map +1 -1
- package/esm/util/string.js +4 -5
- package/esm/util/string.js.map +1 -1
- package/esm/util/style.js +23 -29
- package/esm/util/style.js.map +1 -1
- package/esm/util/svg2marker.js +13 -16
- package/esm/util/svg2marker.js.map +1 -1
- package/esm/util/text.js +14 -14
- package/esm/util/text.js.map +1 -1
- package/esm/util/throttle.js +7 -13
- package/esm/util/throttle.js.map +1 -1
- package/esm/util/time.js +22 -24
- package/esm/util/time.js.map +1 -1
- package/esm/util/timer.js +5 -9
- package/esm/util/timer.js.map +1 -1
- package/esm/util/transform.js +5 -6
- package/esm/util/transform.js.map +1 -1
- package/esm/util/transpose.js +1 -1
- package/esm/util/transpose.js.map +1 -1
- package/esm/util/traverse.js +1 -1
- package/esm/util/traverse.js.map +1 -1
- package/esm/util/visibility.js +2 -2
- package/esm/util/visibility.js.map +1 -1
- package/esm/util/wrap.js +2 -4
- package/esm/util/wrap.js.map +1 -1
- package/lib/animation/fadeIn.js +1 -1
- package/lib/animation/fadeIn.js.map +1 -1
- package/lib/animation/fadeOut.js +1 -1
- package/lib/animation/fadeOut.js.map +1 -1
- package/lib/animation/index.js +1 -1
- package/lib/animation/utils.js +33 -39
- package/lib/animation/utils.js.map +1 -1
- package/lib/core/component.js +31 -43
- package/lib/core/component.js.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/shapes/Text.js +15 -22
- package/lib/shapes/Text.js.map +1 -1
- package/lib/shapes/index.js +1 -1
- package/lib/types/index.js +1 -1
- package/lib/ui/axis/axis.js +34 -39
- package/lib/ui/axis/axis.js.map +1 -1
- package/lib/ui/axis/constant.js +10 -12
- package/lib/ui/axis/constant.js.map +1 -1
- package/lib/ui/axis/guides/grid.js +35 -40
- package/lib/ui/axis/guides/grid.js.map +1 -1
- package/lib/ui/axis/guides/labels.js +82 -89
- package/lib/ui/axis/guides/labels.js.map +1 -1
- package/lib/ui/axis/guides/line.js +79 -92
- package/lib/ui/axis/guides/line.js.map +1 -1
- package/lib/ui/axis/guides/ticks.js +37 -45
- package/lib/ui/axis/guides/ticks.js.map +1 -1
- package/lib/ui/axis/guides/title.js +37 -41
- package/lib/ui/axis/guides/title.js.map +1 -1
- package/lib/ui/axis/guides/utils.js +12 -14
- package/lib/ui/axis/guides/utils.js.map +1 -1
- package/lib/ui/axis/overlap/autoEllipsis.js +15 -22
- package/lib/ui/axis/overlap/autoEllipsis.js.map +1 -1
- package/lib/ui/axis/overlap/autoHide.js +23 -27
- package/lib/ui/axis/overlap/autoHide.js.map +1 -1
- package/lib/ui/axis/overlap/autoRotate.js +12 -26
- package/lib/ui/axis/overlap/autoRotate.js.map +1 -1
- package/lib/ui/axis/overlap/autoWrap.js +13 -16
- package/lib/ui/axis/overlap/autoWrap.js.map +1 -1
- package/lib/ui/axis/overlap/index.js +12 -12
- package/lib/ui/axis/overlap/index.js.map +1 -1
- package/lib/ui/axis/utils/bounds.js +49 -75
- package/lib/ui/axis/utils/bounds.js.map +1 -1
- package/lib/ui/axis/utils/contain.js +15 -15
- package/lib/ui/axis/utils/contain.js.map +1 -1
- package/lib/ui/axis/utils/index.js +4 -8
- package/lib/ui/axis/utils/index.js.map +1 -1
- package/lib/ui/axis/utils/intersect.js +22 -34
- package/lib/ui/axis/utils/intersect.js.map +1 -1
- package/lib/ui/axis/utils/test.js +35 -47
- package/lib/ui/axis/utils/test.js.map +1 -1
- package/lib/ui/breadcrumb/index.js +70 -77
- package/lib/ui/breadcrumb/index.js.map +1 -1
- package/lib/ui/button/index.js +86 -101
- package/lib/ui/button/index.js.map +1 -1
- package/lib/ui/checkbox/constant.js +2 -2
- package/lib/ui/checkbox/constant.js.map +1 -1
- package/lib/ui/checkbox/index.js +26 -28
- package/lib/ui/checkbox/index.js.map +1 -1
- package/lib/ui/crosshair/base.js +33 -48
- package/lib/ui/crosshair/base.js.map +1 -1
- package/lib/ui/crosshair/circle.js +29 -37
- package/lib/ui/crosshair/circle.js.map +1 -1
- package/lib/ui/crosshair/constant.js +1 -1
- package/lib/ui/crosshair/constant.js.map +1 -1
- package/lib/ui/crosshair/index.js +1 -1
- package/lib/ui/crosshair/line.js +58 -77
- package/lib/ui/crosshair/line.js.map +1 -1
- package/lib/ui/crosshair/polygon.js +57 -72
- package/lib/ui/crosshair/polygon.js.map +1 -1
- package/lib/ui/grid/index.js +76 -97
- package/lib/ui/grid/index.js.map +1 -1
- package/lib/ui/indicator/constant.js +1 -1
- package/lib/ui/indicator/constant.js.map +1 -1
- package/lib/ui/indicator/index.js +1 -1
- package/lib/ui/indicator/indicator.js +63 -67
- package/lib/ui/indicator/indicator.js.map +1 -1
- package/lib/ui/layout/layout.js +57 -70
- package/lib/ui/layout/layout.js.map +1 -1
- package/lib/ui/legend/base.js +14 -15
- package/lib/ui/legend/base.js.map +1 -1
- package/lib/ui/legend/category/item.js +126 -159
- package/lib/ui/legend/category/item.js.map +1 -1
- package/lib/ui/legend/category/items.js +166 -208
- package/lib/ui/legend/category/items.js.map +1 -1
- package/lib/ui/legend/category.js +51 -60
- package/lib/ui/legend/category.js.map +1 -1
- package/lib/ui/legend/constant.js +2 -2
- package/lib/ui/legend/constant.js.map +1 -1
- package/lib/ui/legend/continuous/handle.js +31 -35
- package/lib/ui/legend/continuous/handle.js.map +1 -1
- package/lib/ui/legend/continuous/ribbon.js +40 -43
- package/lib/ui/legend/continuous/ribbon.js.map +1 -1
- package/lib/ui/legend/continuous/utils.js +10 -11
- package/lib/ui/legend/continuous/utils.js.map +1 -1
- package/lib/ui/legend/continuous.js +432 -535
- package/lib/ui/legend/continuous.js.map +1 -1
- package/lib/ui/legend/index.js +2 -2
- package/lib/ui/legend/index.js.map +1 -1
- package/lib/ui/legend/utils.js +25 -32
- package/lib/ui/legend/utils.js.map +1 -1
- package/lib/ui/marker/index.js +43 -48
- package/lib/ui/marker/index.js.map +1 -1
- package/lib/ui/marker/symbol.js +22 -22
- package/lib/ui/marker/symbol.js.map +1 -1
- package/lib/ui/marker/utils.js +3 -3
- package/lib/ui/marker/utils.js.map +1 -1
- package/lib/ui/navigator/index.js +135 -165
- package/lib/ui/navigator/index.js.map +1 -1
- package/lib/ui/poptip/constant.js +65 -66
- package/lib/ui/poptip/constant.js.map +1 -1
- package/lib/ui/poptip/index.js +100 -115
- package/lib/ui/poptip/index.js.map +1 -1
- package/lib/ui/poptip/utils.js +8 -15
- package/lib/ui/poptip/utils.js.map +1 -1
- package/lib/ui/scrollbar/index.js +107 -136
- package/lib/ui/scrollbar/index.js.map +1 -1
- package/lib/ui/select/option.js +52 -61
- package/lib/ui/select/option.js.map +1 -1
- package/lib/ui/select/select.js +148 -169
- package/lib/ui/select/select.js.map +1 -1
- package/lib/ui/slider/constant.js +1 -1
- package/lib/ui/slider/constant.js.map +1 -1
- package/lib/ui/slider/handle.js +49 -56
- package/lib/ui/slider/handle.js.map +1 -1
- package/lib/ui/slider/index.js +289 -334
- package/lib/ui/slider/index.js.map +1 -1
- package/lib/ui/sparkline/columns.js +28 -36
- package/lib/ui/sparkline/columns.js.map +1 -1
- package/lib/ui/sparkline/index.js +153 -187
- package/lib/ui/sparkline/index.js.map +1 -1
- package/lib/ui/sparkline/lines.js +40 -52
- package/lib/ui/sparkline/lines.js.map +1 -1
- package/lib/ui/sparkline/path.js +38 -42
- package/lib/ui/sparkline/path.js.map +1 -1
- package/lib/ui/sparkline/utils.js +9 -10
- package/lib/ui/sparkline/utils.js.map +1 -1
- package/lib/ui/switch/index.js +49 -58
- package/lib/ui/switch/index.js.map +1 -1
- package/lib/ui/tag/index.js +34 -36
- package/lib/ui/tag/index.js.map +1 -1
- package/lib/ui/timebar/controller.js +73 -82
- package/lib/ui/timebar/controller.js.map +1 -1
- package/lib/ui/timebar/handle.js +67 -74
- package/lib/ui/timebar/handle.js.map +1 -1
- package/lib/ui/timebar/icons.js +312 -466
- package/lib/ui/timebar/icons.js.map +1 -1
- package/lib/ui/timebar/timebar.js +272 -326
- package/lib/ui/timebar/timebar.js.map +1 -1
- package/lib/ui/timebar/utils.js +8 -8
- package/lib/ui/timebar/utils.js.map +1 -1
- package/lib/ui/timeline/index.js +2 -5
- package/lib/ui/timeline/index.js.map +1 -1
- package/lib/ui/title/index.js +61 -65
- package/lib/ui/title/index.js.map +1 -1
- package/lib/ui/tooltip/constant.js +26 -30
- package/lib/ui/tooltip/constant.js.map +1 -1
- package/lib/ui/tooltip/index.js +113 -129
- package/lib/ui/tooltip/index.js.map +1 -1
- package/lib/util/bbox.js +24 -46
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/callback.js +2 -3
- package/lib/util/callback.js.map +1 -1
- package/lib/util/classnames.js +8 -10
- package/lib/util/classnames.js.map +1 -1
- package/lib/util/deep-assign.js +7 -15
- package/lib/util/deep-assign.js.map +1 -1
- package/lib/util/defined.js +1 -1
- package/lib/util/defined.js.map +1 -1
- package/lib/util/ellipsis.js +2 -3
- package/lib/util/ellipsis.js.map +1 -1
- package/lib/util/event.js +3 -3
- package/lib/util/event.js.map +1 -1
- package/lib/util/extend-display-object.js +2 -2
- package/lib/util/extend-display-object.js.map +1 -1
- package/lib/util/geometry/index.js +1 -1
- package/lib/util/geometry/line-length.js +1 -4
- package/lib/util/geometry/line-length.js.map +1 -1
- package/lib/util/geometry/lines-intersection.js +5 -10
- package/lib/util/geometry/lines-intersection.js.map +1 -1
- package/lib/util/group-by.js +1 -1
- package/lib/util/group-by.js.map +1 -1
- package/lib/util/group.js +3 -3
- package/lib/util/group.js.map +1 -1
- package/lib/util/html.js +1 -1
- package/lib/util/html.js.map +1 -1
- package/lib/util/if-show.js +3 -5
- package/lib/util/if-show.js.map +1 -1
- package/lib/util/in-range.js +1 -3
- package/lib/util/in-range.js.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/interpolate.js +12 -19
- package/lib/util/interpolate.js.map +1 -1
- package/lib/util/keyframe-interpolate.js +7 -8
- package/lib/util/keyframe-interpolate.js.map +1 -1
- package/lib/util/layout/executer.js +6 -6
- package/lib/util/layout/executer.js.map +1 -1
- package/lib/util/layout/flex/index.js +26 -28
- package/lib/util/layout/flex/index.js.map +1 -1
- package/lib/util/layout/grid/index.js +1 -1
- package/lib/util/layout/grid/index.js.map +1 -1
- package/lib/util/layout/index.js +1 -1
- package/lib/util/layout/utils/helper.js +8 -9
- package/lib/util/layout/utils/helper.js.map +1 -1
- package/lib/util/matrix.js +7 -8
- package/lib/util/matrix.js.map +1 -1
- package/lib/util/number.js +6 -7
- package/lib/util/number.js.map +1 -1
- package/lib/util/offscreen.js +12 -20
- package/lib/util/offscreen.js.map +1 -1
- package/lib/util/omit.js +3 -3
- package/lib/util/omit.js.map +1 -1
- package/lib/util/path.js +37 -42
- package/lib/util/path.js.map +1 -1
- package/lib/util/primitive.js +2 -2
- package/lib/util/primitive.js.map +1 -1
- package/lib/util/replace-children.js +3 -4
- package/lib/util/replace-children.js.map +1 -1
- package/lib/util/sampling.js +3 -3
- package/lib/util/sampling.js.map +1 -1
- package/lib/util/scale-to-pixel.js +4 -5
- package/lib/util/scale-to-pixel.js.map +1 -1
- package/lib/util/selection.js +144 -187
- package/lib/util/selection.js.map +1 -1
- package/lib/util/series.js +2 -2
- package/lib/util/series.js.map +1 -1
- package/lib/util/shape.js +16 -28
- package/lib/util/shape.js.map +1 -1
- package/lib/util/string.js +4 -5
- package/lib/util/string.js.map +1 -1
- package/lib/util/style.js +24 -30
- package/lib/util/style.js.map +1 -1
- package/lib/util/svg2marker.js +15 -17
- package/lib/util/svg2marker.js.map +1 -1
- package/lib/util/text.js +16 -16
- package/lib/util/text.js.map +1 -1
- package/lib/util/throttle.js +7 -13
- package/lib/util/throttle.js.map +1 -1
- package/lib/util/time.js +22 -24
- package/lib/util/time.js.map +1 -1
- package/lib/util/timer.js +5 -9
- package/lib/util/timer.js.map +1 -1
- package/lib/util/transform.js +5 -6
- package/lib/util/transform.js.map +1 -1
- package/lib/util/transpose.js +1 -1
- package/lib/util/transpose.js.map +1 -1
- package/lib/util/traverse.js +1 -1
- package/lib/util/traverse.js.map +1 -1
- package/lib/util/visibility.js +3 -3
- package/lib/util/visibility.js.map +1 -1
- package/lib/util/wrap.js +3 -5
- package/lib/util/wrap.js.map +1 -1
- package/package.json +3 -3
package/esm/ui/checkbox/index.js
CHANGED
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import { __assign, __extends } from "tslib";
|
|
2
1
|
import { Component } from '../../core';
|
|
3
2
|
import { maybeAppend, subStyleProps } from '../../util';
|
|
4
3
|
import { CHECKBOX_RECT_STYLE, CHECKED_SHAPE_STYLE, LABEL_TEXT_STYLE } from './constant';
|
|
5
4
|
function getLablePosition(shape, spacing) {
|
|
6
|
-
|
|
5
|
+
const bounds = shape.getLocalBounds();
|
|
7
6
|
return {
|
|
8
7
|
x: bounds.halfExtents[0] ? bounds.max[0] + (spacing || 0) : shape.style.x,
|
|
9
8
|
y: bounds.halfExtents[1] ? (bounds.min[1] + bounds.max[1]) / 2 : shape.style.y,
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return _super.call(this, options, __assign({ labelText: '', spacing: 4, checked: false }, LABEL_TEXT_STYLE)) || this;
|
|
11
|
+
export class Checkbox extends Component {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super(options, Object.assign({ labelText: '', spacing: 4, checked: false }, LABEL_TEXT_STYLE));
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
render(attributes, container) {
|
|
16
|
+
const { checked, spacing } = attributes;
|
|
19
17
|
this.checked = !!checked;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
const group = maybeAppend(container, '.checkbox-content', 'g').attr('className', 'checkbox-content').node();
|
|
19
|
+
const boxStyle = subStyleProps(attributes, 'box');
|
|
20
|
+
const checkedStyle = subStyleProps(attributes, 'checked');
|
|
21
|
+
const labelStyle = subStyleProps(attributes, 'label');
|
|
22
|
+
const checkboxStyle = Object.assign(Object.assign({}, (this.checked ? CHECKBOX_RECT_STYLE.selected : CHECKBOX_RECT_STYLE.default)), boxStyle);
|
|
23
|
+
const checkboxBoxCheckedStyle = Object.assign(Object.assign({}, CHECKED_SHAPE_STYLE), checkedStyle);
|
|
26
24
|
this.checkboxBoxShape = maybeAppend(group, '.checkbox-box', 'rect')
|
|
27
|
-
.styles(
|
|
25
|
+
.styles(Object.assign({ className: 'checkbox-box', zIndex: (group.style.zIndex || 0) - 1 }, checkboxStyle))
|
|
28
26
|
.node();
|
|
29
|
-
maybeAppend(this.checkboxBoxShape, '.checkbox-checked', 'path').styles(
|
|
30
|
-
|
|
31
|
-
maybeAppend(group, '.checkbox-label', 'text').styles(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export { Checkbox };
|
|
27
|
+
maybeAppend(this.checkboxBoxShape, '.checkbox-checked', 'path').styles(Object.assign({ className: 'checkbox-box-checked', stroke: '#fff' }, checkboxBoxCheckedStyle));
|
|
28
|
+
const { x, y } = getLablePosition(this.checkboxBoxShape, Number(spacing));
|
|
29
|
+
maybeAppend(group, '.checkbox-label', 'text').styles(Object.assign({ className: 'checkbox-label', x,
|
|
30
|
+
y }, labelStyle));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 组件 checkbox
|
|
35
|
+
*/
|
|
36
|
+
Checkbox.tag = 'checkbox';
|
|
40
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/checkbox/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["ui/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gB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,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtD,MAAM,aAAa,mCACd,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAC3E,QAAQ,CACZ,CAAC;QACF,MAAM,uBAAuB,mCAAQ,mBAAmB,GAAK,YAAY,CAAE,CAAC;QAE5E,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC;aAChE,MAAM,iBACL,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,IAClC,aAAa,EAChB;aACD,IAAI,EAAE,CAAC;QAEV,WAAW,CAAC,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC,MAAM,iBACpE,SAAS,EAAE,sBAAsB,EACjC,MAAM,EAAE,MAAM,IACX,uBAAuB,EAC1B,CAAC;QAEH,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAE1E,WAAW,CAAC,KAAK,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC,MAAM,iBAClD,SAAS,EAAE,gBAAgB,EAC3B,CAAC;YACD,CAAC,IACE,UAAU,EACb,CAAC;IACL,CAAC;;AAvDD;;GAEG;AACW,YAAG,GAAG,UAAU,CAAC"}
|
package/esm/ui/crosshair/base.js
CHANGED
|
@@ -1,64 +1,48 @@
|
|
|
1
|
-
import { __assign, __extends, __read } from "tslib";
|
|
2
1
|
import { Component } from '../../core';
|
|
3
2
|
import { select, subStyleProps } from '../../util';
|
|
4
3
|
import { Tag } from '../tag';
|
|
5
4
|
import { CROSSHAIR_BASE_DEFAULT_STYLE } from './constant';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export class CrosshairBase extends Component {
|
|
6
|
+
/**
|
|
7
|
+
* 获得 pointer 的相对坐标
|
|
8
|
+
*/
|
|
9
|
+
get localPointer() {
|
|
10
|
+
const [bx, by] = this.getPosition();
|
|
11
|
+
const [x, y] = this.pointer;
|
|
12
|
+
return [x - bx, y - by];
|
|
13
|
+
}
|
|
14
|
+
get tagStyle() {
|
|
15
|
+
const style = subStyleProps(this.attributes, 'tag');
|
|
16
|
+
return style;
|
|
17
|
+
}
|
|
18
|
+
get crosshairStyle() {
|
|
19
|
+
const style = subStyleProps(this.attributes, 'line');
|
|
20
|
+
return Object.assign(Object.assign({}, style), { d: this.crosshairPath });
|
|
21
|
+
}
|
|
22
|
+
constructor(options) {
|
|
9
23
|
// @ts-ignore
|
|
10
|
-
|
|
24
|
+
super(options, CROSSHAIR_BASE_DEFAULT_STYLE);
|
|
11
25
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* 获得 pointer 的相对坐标
|
|
15
|
-
*/
|
|
16
|
-
get: function () {
|
|
17
|
-
var _a = __read(this.getPosition(), 2), bx = _a[0], by = _a[1];
|
|
18
|
-
var _b = __read(this.pointer, 2), x = _b[0], y = _b[1];
|
|
19
|
-
return [x - bx, y - by];
|
|
20
|
-
},
|
|
21
|
-
enumerable: false,
|
|
22
|
-
configurable: true
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(CrosshairBase.prototype, "tagStyle", {
|
|
25
|
-
get: function () {
|
|
26
|
-
var style = subStyleProps(this.attributes, 'tag');
|
|
27
|
-
return style;
|
|
28
|
-
},
|
|
29
|
-
enumerable: false,
|
|
30
|
-
configurable: true
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(CrosshairBase.prototype, "crosshairStyle", {
|
|
33
|
-
get: function () {
|
|
34
|
-
var style = subStyleProps(this.attributes, 'line');
|
|
35
|
-
return __assign(__assign({}, style), { d: this.crosshairPath });
|
|
36
|
-
},
|
|
37
|
-
enumerable: false,
|
|
38
|
-
configurable: true
|
|
39
|
-
});
|
|
40
|
-
CrosshairBase.prototype.render = function (attributes, container) {
|
|
41
|
-
var group = select(container).maybeAppendByClassName('.crosshair-group', 'g').node();
|
|
26
|
+
render(attributes, container) {
|
|
27
|
+
const group = select(container).maybeAppendByClassName('.crosshair-group', 'g').node();
|
|
42
28
|
this.shapesGroup = group;
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
const tagStyle = this.tagStyle;
|
|
30
|
+
const crosshairStyle = this.crosshairStyle;
|
|
45
31
|
this.tagShape = select(group)
|
|
46
|
-
.maybeAppendByClassName('crosshair-tag',
|
|
32
|
+
.maybeAppendByClassName('crosshair-tag', () => new Tag({ style: tagStyle }))
|
|
47
33
|
.styles(tagStyle)
|
|
48
34
|
.node();
|
|
49
35
|
this.crosshairShape = select(group).maybeAppendByClassName('.crosshair-path', 'path').styles(crosshairStyle).node();
|
|
50
36
|
this.adjustLayout();
|
|
51
|
-
}
|
|
37
|
+
}
|
|
52
38
|
/**
|
|
53
39
|
* 设置当前指针的位置
|
|
54
40
|
* 1. 线条类型 调整位置即可
|
|
55
41
|
* 2. circle 和 polygon 需要重新计算 path
|
|
56
42
|
*/
|
|
57
|
-
|
|
43
|
+
setPointer(pointer) {
|
|
58
44
|
this.pointer = pointer;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}(Component));
|
|
63
|
-
export { CrosshairBase };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
CrosshairBase.tag = 'crosshair-base';
|
|
64
48
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"src/","sources":["ui/crosshair/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"src/","sources":["ui/crosshair/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAA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AE,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;aAC3E,MAAM,CAAC,QAAQ,CAAC;aAChB,IAAI,EAAE,CAAC;QACV,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;QAEpH,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,OAAc;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAnEa,iBAAG,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,43 +1,34 @@
|
|
|
1
|
-
import { __extends, __read } from "tslib";
|
|
2
1
|
import { deepAssign, hide } from '../../util';
|
|
3
2
|
import { circle } from '../marker/symbol';
|
|
4
3
|
import { CrosshairBase } from './base';
|
|
5
4
|
import { CIRCLE_CROSSHAIR_DEFAULT_STYLE } from './constant';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return _super.call(this, deepAssign({}, CircleCrosshair.defaultOptions, options)) || this;
|
|
5
|
+
export class CircleCrosshair extends CrosshairBase {
|
|
6
|
+
get crosshairPath() {
|
|
7
|
+
return this.createCirclePath();
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _b = __read(_a, 2), x = _b[0], y = _b[1];
|
|
23
|
-
_super.prototype.setPointer.call(this, [x, y]);
|
|
24
|
-
var _c = __read(this.localPointer, 2), lx = _c[0], ly = _c[1];
|
|
25
|
-
var _d = __read(this.attributes.center, 2), cx = _d[0], cy = _d[1];
|
|
26
|
-
var path = this.createCirclePath(Math.pow((Math.pow((lx - cx), 2) + Math.pow((ly - cy), 2)), 0.5));
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(deepAssign({}, CircleCrosshair.defaultOptions, options));
|
|
11
|
+
}
|
|
12
|
+
update(cfg) {
|
|
13
|
+
super.update(cfg);
|
|
14
|
+
}
|
|
15
|
+
setPointer([x, y]) {
|
|
16
|
+
super.setPointer([x, y]);
|
|
17
|
+
const [lx, ly] = this.localPointer;
|
|
18
|
+
const { center: [cx, cy], } = this.attributes;
|
|
19
|
+
const path = this.createCirclePath(Math.pow((Math.pow((lx - cx), 2) + Math.pow((ly - cy), 2)), 0.5));
|
|
27
20
|
this.crosshairShape.attr({ d: path });
|
|
28
|
-
}
|
|
29
|
-
|
|
21
|
+
}
|
|
22
|
+
adjustLayout() {
|
|
30
23
|
hide(this.tagShape);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
}
|
|
25
|
+
createCirclePath(radius) {
|
|
26
|
+
const { center: [x, y], defaultRadius, } = this.attributes;
|
|
34
27
|
return circle(x, y, radius || defaultRadius);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}(CrosshairBase));
|
|
42
|
-
export { CircleCrosshair };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
CircleCrosshair.tag = 'circle-crosshair';
|
|
31
|
+
CircleCrosshair.defaultOptions = {
|
|
32
|
+
style: CIRCLE_CROSSHAIR_DEFAULT_STYLE,
|
|
33
|
+
};
|
|
43
34
|
//# sourceMappingURL=circle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle.js","sourceRoot":"src/","sources":["ui/crosshair/circle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"circle.js","sourceRoot":"src/","sources":["ui/crosshair/circle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,YAA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E,CAAC,CAAC,EACd,aAAa,GACd,GAAG,IAAI,CAAC,UAAU,CAAC;QACpB,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI,aAAa,CAAU,CAAC;IACxD,CAAC;;AAvCa,mBAAG,GAAG,kBAAkB,CAAC;AAEtB,8BAAc,GAAG;IAChC,KAAK,EAAE,8BAA8B;CACtC,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { deepAssign } from '../../util';
|
|
2
|
-
export
|
|
2
|
+
export const CROSSHAIR_BASE_DEFAULT_STYLE = {
|
|
3
3
|
tagText: '',
|
|
4
4
|
lineStroke: '#416180',
|
|
5
5
|
lineStrokeOpacity: 0.45,
|
|
6
6
|
lineLineWidth: 1,
|
|
7
7
|
lineLineDash: [5, 5],
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export const LINE_CROSSHAIR_DEFAULT_STYLE = deepAssign({}, CROSSHAIR_BASE_DEFAULT_STYLE, {
|
|
10
10
|
type: 'line',
|
|
11
11
|
tagPosition: 'start',
|
|
12
12
|
tagAlign: 'center',
|
|
13
13
|
tagVerticalAlign: 'bottom',
|
|
14
14
|
});
|
|
15
|
-
export
|
|
15
|
+
export const CIRCLE_CROSSHAIR_DEFAULT_STYLE = deepAssign({}, CROSSHAIR_BASE_DEFAULT_STYLE, {
|
|
16
16
|
type: 'circle',
|
|
17
17
|
defaultRadius: 0,
|
|
18
18
|
});
|
|
19
|
-
export
|
|
19
|
+
export const POLYGON_CROSSHAIR_DEFAULT_STYLE = deepAssign({}, CROSSHAIR_BASE_DEFAULT_STYLE, {
|
|
20
20
|
type: 'polygon',
|
|
21
21
|
defaultRadius: 0,
|
|
22
22
|
startAngle: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"src/","sources":["ui/crosshair/constant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQxC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"src/","sources":["ui/crosshair/constant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQxC,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,OAAO,EAAE,EAAE;IACX,UAAU,EAAE,SAAS;IACrB,iBAAiB,EAAE,IAAI;IACvB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAqC,UAAU,CACtF,EAAE,EACF,4BAA4B,EAC5B;IACE,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,OAAO;IACpB,QAAQ,EAAE,QAAQ;IAClB,gBAAgB,EAAE,QAAQ;CAC3B,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAuC,UAAU,CAC1F,EAAE,EACF,4BAA4B,EAC5B;IACE,IAAI,EAAE,QAAQ;IACd,aAAa,EAAE,CAAC;CACjB,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAwC,UAAU,CAC5F,EAAE,EACF,4BAA4B,EAC5B;IACE,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,CAAC;IAChB,UAAU,EAAE,CAAC;CACd,CACF,CAAC"}
|
package/esm/ui/crosshair/line.js
CHANGED
|
@@ -1,107 +1,87 @@
|
|
|
1
|
-
import { __extends, __read } from "tslib";
|
|
2
1
|
import { deepAssign, getShapeSpace, hide, show } from '../../util';
|
|
3
2
|
import { CrosshairBase } from './base';
|
|
4
3
|
import { LINE_CROSSHAIR_DEFAULT_STYLE } from './constant';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export class LineCrosshair extends CrosshairBase {
|
|
5
|
+
get crosshairPath() {
|
|
6
|
+
const { startPos: [sx, sy], endPos: [ex, ey], } = this.attributes;
|
|
7
|
+
const path = [['M', 0, 0], ['L', ex - sx, ey - sy], ['Z']];
|
|
8
|
+
return path;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 获得 pointer 的相对坐标
|
|
12
|
+
*/
|
|
13
|
+
get localPointer() {
|
|
14
|
+
if (!this.pointer)
|
|
15
|
+
return this.attributes.startPos;
|
|
16
|
+
const [bx, by] = this.getPosition();
|
|
17
|
+
const [x, y] = this.pointer;
|
|
18
|
+
return [x - bx, y - by];
|
|
19
|
+
}
|
|
20
|
+
get isVertical() {
|
|
21
|
+
const { startPos: [x1, y1], endPos: [x2, y2], } = this.attributes;
|
|
22
|
+
return x1 === x2 && y1 !== y2;
|
|
23
|
+
}
|
|
24
|
+
get tagShapeSpace() {
|
|
25
|
+
const { width, height } = getShapeSpace(this.tagShape);
|
|
26
|
+
return { width, height };
|
|
27
|
+
}
|
|
28
|
+
constructor(options) {
|
|
29
|
+
super(deepAssign({}, LineCrosshair.defaultOptions, options));
|
|
30
|
+
}
|
|
31
|
+
update(cfg) {
|
|
32
|
+
super.update(cfg);
|
|
9
33
|
}
|
|
10
|
-
Object.defineProperty(LineCrosshair.prototype, "crosshairPath", {
|
|
11
|
-
get: function () {
|
|
12
|
-
var _a = this.attributes, _b = __read(_a.startPos, 2), sx = _b[0], sy = _b[1], _c = __read(_a.endPos, 2), ex = _c[0], ey = _c[1];
|
|
13
|
-
var path = [['M', 0, 0], ['L', ex - sx, ey - sy], ['Z']];
|
|
14
|
-
return path;
|
|
15
|
-
},
|
|
16
|
-
enumerable: false,
|
|
17
|
-
configurable: true
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(LineCrosshair.prototype, "localPointer", {
|
|
20
|
-
/**
|
|
21
|
-
* 获得 pointer 的相对坐标
|
|
22
|
-
*/
|
|
23
|
-
get: function () {
|
|
24
|
-
if (!this.pointer)
|
|
25
|
-
return this.attributes.startPos;
|
|
26
|
-
var _a = __read(this.getPosition(), 2), bx = _a[0], by = _a[1];
|
|
27
|
-
var _b = __read(this.pointer, 2), x = _b[0], y = _b[1];
|
|
28
|
-
return [x - bx, y - by];
|
|
29
|
-
},
|
|
30
|
-
enumerable: false,
|
|
31
|
-
configurable: true
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(LineCrosshair.prototype, "isVertical", {
|
|
34
|
-
get: function () {
|
|
35
|
-
var _a = this.attributes, _b = __read(_a.startPos, 2), x1 = _b[0], y1 = _b[1], _c = __read(_a.endPos, 2), x2 = _c[0], y2 = _c[1];
|
|
36
|
-
return x1 === x2 && y1 !== y2;
|
|
37
|
-
},
|
|
38
|
-
enumerable: false,
|
|
39
|
-
configurable: true
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(LineCrosshair.prototype, "tagShapeSpace", {
|
|
42
|
-
get: function () {
|
|
43
|
-
var _a = getShapeSpace(this.tagShape), width = _a.width, height = _a.height;
|
|
44
|
-
return { width: width, height: height };
|
|
45
|
-
},
|
|
46
|
-
enumerable: false,
|
|
47
|
-
configurable: true
|
|
48
|
-
});
|
|
49
|
-
LineCrosshair.prototype.update = function (cfg) {
|
|
50
|
-
_super.prototype.update.call(this, cfg);
|
|
51
|
-
};
|
|
52
34
|
/**
|
|
53
35
|
* 将线移动至对应位置
|
|
54
36
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
setPointer(pointer) {
|
|
38
|
+
super.setPointer(pointer);
|
|
57
39
|
this.adjustPosition();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
this.tagShape.update({ text
|
|
40
|
+
}
|
|
41
|
+
setText(text) {
|
|
42
|
+
this.tagShape.update({ text });
|
|
61
43
|
this.adjustTag();
|
|
62
|
-
}
|
|
63
|
-
|
|
44
|
+
}
|
|
45
|
+
adjustLayout() {
|
|
64
46
|
this.adjustPosition();
|
|
65
47
|
this.adjustTag();
|
|
66
|
-
}
|
|
48
|
+
}
|
|
67
49
|
/**
|
|
68
50
|
* 调整this位置
|
|
69
51
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
adjustPosition() {
|
|
53
|
+
const [lx, ly] = this.localPointer;
|
|
54
|
+
const { startPos: [sx, sy], } = this.attributes;
|
|
55
|
+
const targetPos = this.getOrientVal([sx, ly], [lx, sy]);
|
|
74
56
|
this.shapesGroup.setLocalPosition(targetPos);
|
|
75
|
-
}
|
|
57
|
+
}
|
|
76
58
|
/**
|
|
77
59
|
* 调整tag位置
|
|
78
60
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
adjustTag() {
|
|
62
|
+
const { tagText, tagPosition, startPos: [x1, y1], endPos: [x2, y2], } = this.attributes;
|
|
81
63
|
if (!tagText || tagText === '') {
|
|
82
64
|
hide(this.tagShape);
|
|
83
65
|
return;
|
|
84
66
|
}
|
|
85
67
|
show(this.tagShape);
|
|
86
|
-
|
|
68
|
+
const { width, height } = this.tagShapeSpace;
|
|
87
69
|
// 偏移量
|
|
88
|
-
|
|
70
|
+
const [xOffset, yOffset] = this.getOrientVal({
|
|
89
71
|
start: [-width / 2, height / 2],
|
|
90
72
|
end: [x2 - x1 + width / 2, height / 2],
|
|
91
73
|
}, {
|
|
92
74
|
start: [0, 0],
|
|
93
75
|
end: [0, y2 - y1 + height],
|
|
94
|
-
})[tagPosition]
|
|
76
|
+
})[tagPosition];
|
|
95
77
|
this.tagShape.setLocalPosition(xOffset, yOffset);
|
|
96
|
-
}
|
|
97
|
-
|
|
78
|
+
}
|
|
79
|
+
getOrientVal(v1, v2) {
|
|
98
80
|
return this.isVertical ? v2 : v1;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}(CrosshairBase));
|
|
106
|
-
export { LineCrosshair };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
LineCrosshair.tag = 'line-crosshair';
|
|
84
|
+
LineCrosshair.defaultOptions = {
|
|
85
|
+
style: LINE_CROSSHAIR_DEFAULT_STYLE,
|
|
86
|
+
};
|
|
107
87
|
//# sourceMappingURL=line.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"src/","sources":["ui/crosshair/line.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"line.js","sourceRoot":"src/","sources":["ui/crosshair/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAK1D,MAAM,OAAO,aAAc,SAAQ,aAAgD;IAOjF,IAAc,aAAa;QACzB,MAAM,EACJ,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAClB,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GACjB,GAAG,IAAI,CAAC,UAAU,CAAC;QACpB,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAU,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,IAAc,YAAY;QACxB,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QACnD,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,IAAY,UAAU;QACpB,MAAM,EACJ,QAAQ,EAAE,CAAC,EAAE,EA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