@visactor/vrender-components 0.0.38-brush.2-alpha.0
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/README.md +9 -0
- package/cjs/axis/animate/group-fade.d.ts +17 -0
- package/cjs/axis/animate/group-fade.js +72 -0
- package/cjs/axis/animate/group-fade.js.map +1 -0
- package/cjs/axis/animate/group-transition.d.ts +10 -0
- package/cjs/axis/animate/group-transition.js +76 -0
- package/cjs/axis/animate/group-transition.js.map +1 -0
- package/cjs/axis/animate/index.d.ts +2 -0
- package/cjs/axis/animate/index.js +21 -0
- package/cjs/axis/animate/index.js.map +1 -0
- package/cjs/axis/base.d.ts +53 -0
- package/cjs/axis/base.js +305 -0
- package/cjs/axis/base.js.map +1 -0
- package/cjs/axis/circle.d.ts +88 -0
- package/cjs/axis/circle.js +182 -0
- package/cjs/axis/circle.js.map +1 -0
- package/cjs/axis/config.d.ts +71 -0
- package/cjs/axis/config.js +76 -0
- package/cjs/axis/config.js.map +1 -0
- package/cjs/axis/constant.d.ts +27 -0
- package/cjs/axis/constant.js +26 -0
- package/cjs/axis/constant.js.map +1 -0
- package/cjs/axis/grid.d.ts +9 -0
- package/cjs/axis/grid.js +106 -0
- package/cjs/axis/grid.js.map +1 -0
- package/cjs/axis/index.d.ts +6 -0
- package/cjs/axis/index.js +23 -0
- package/cjs/axis/index.js.map +1 -0
- package/cjs/axis/line.d.ts +89 -0
- package/cjs/axis/line.js +199 -0
- package/cjs/axis/line.js.map +1 -0
- package/cjs/axis/type.d.ts +177 -0
- package/cjs/axis/type.js +6 -0
- package/cjs/axis/type.js.map +1 -0
- package/cjs/brush/brush.d.ts +65 -0
- package/cjs/brush/brush.js +169 -0
- package/cjs/brush/brush.js.map +1 -0
- package/cjs/brush/config.d.ts +21 -0
- package/cjs/brush/config.js +26 -0
- package/cjs/brush/config.js.map +1 -0
- package/cjs/brush/index.d.ts +2 -0
- package/cjs/brush/index.js +21 -0
- package/cjs/brush/index.js.map +1 -0
- package/cjs/brush/type.d.ts +21 -0
- package/cjs/brush/type.js +6 -0
- package/cjs/brush/type.js.map +1 -0
- package/cjs/constant.d.ts +16 -0
- package/cjs/constant.js +18 -0
- package/cjs/constant.js.map +1 -0
- package/cjs/core/base.d.ts +12 -0
- package/cjs/core/base.js +44 -0
- package/cjs/core/base.js.map +1 -0
- package/cjs/core/type.d.ts +28 -0
- package/cjs/core/type.js +5 -0
- package/cjs/core/type.js.map +1 -0
- package/cjs/crosshair/base.d.ts +10 -0
- package/cjs/crosshair/base.js +19 -0
- package/cjs/crosshair/base.js.map +1 -0
- package/cjs/crosshair/circle.d.ts +17 -0
- package/cjs/crosshair/circle.js +33 -0
- package/cjs/crosshair/circle.js.map +1 -0
- package/cjs/crosshair/index.d.ts +6 -0
- package/cjs/crosshair/index.js +23 -0
- package/cjs/crosshair/index.js.map +1 -0
- package/cjs/crosshair/line.d.ts +17 -0
- package/cjs/crosshair/line.js +36 -0
- package/cjs/crosshair/line.js.map +1 -0
- package/cjs/crosshair/polygon.d.ts +17 -0
- package/cjs/crosshair/polygon.js +39 -0
- package/cjs/crosshair/polygon.js.map +1 -0
- package/cjs/crosshair/rect.d.ts +20 -0
- package/cjs/crosshair/rect.js +37 -0
- package/cjs/crosshair/rect.js.map +1 -0
- package/cjs/crosshair/sector.d.ts +15 -0
- package/cjs/crosshair/sector.js +38 -0
- package/cjs/crosshair/sector.js.map +1 -0
- package/cjs/crosshair/type.d.ts +37 -0
- package/cjs/crosshair/type.js +6 -0
- package/cjs/crosshair/type.js.map +1 -0
- package/cjs/data-zoom/config.d.ts +104 -0
- package/cjs/data-zoom/config.js +109 -0
- package/cjs/data-zoom/config.js.map +1 -0
- package/cjs/data-zoom/data-zoom.d.ts +193 -0
- package/cjs/data-zoom/data-zoom.js +447 -0
- package/cjs/data-zoom/data-zoom.js.map +1 -0
- package/cjs/data-zoom/index.d.ts +2 -0
- package/cjs/data-zoom/index.js +21 -0
- package/cjs/data-zoom/index.js.map +1 -0
- package/cjs/data-zoom/type.d.ts +59 -0
- package/cjs/data-zoom/type.js +6 -0
- package/cjs/data-zoom/type.js.map +1 -0
- package/cjs/index.d.ts +20 -0
- package/cjs/index.js +30 -0
- package/cjs/index.js.map +1 -0
- package/cjs/indicator/config.d.ts +2 -0
- package/cjs/indicator/config.js +31 -0
- package/cjs/indicator/config.js.map +1 -0
- package/cjs/indicator/index.d.ts +2 -0
- package/cjs/indicator/index.js +21 -0
- package/cjs/indicator/index.js.map +1 -0
- package/cjs/indicator/indicator.d.ts +9 -0
- package/cjs/indicator/indicator.js +73 -0
- package/cjs/indicator/indicator.js.map +1 -0
- package/cjs/indicator/type.d.ts +21 -0
- package/cjs/indicator/type.js +5 -0
- package/cjs/indicator/type.js.map +1 -0
- package/cjs/interface.d.ts +6 -0
- package/cjs/interface.js +6 -0
- package/cjs/interface.js.map +1 -0
- package/cjs/label/animate/animate.d.ts +7 -0
- package/cjs/label/animate/animate.js +53 -0
- package/cjs/label/animate/animate.js.map +1 -0
- package/cjs/label/animate/index.d.ts +1 -0
- package/cjs/label/animate/index.js +3 -0
- package/cjs/label/animate/index.js.map +1 -0
- package/cjs/label/base.d.ts +43 -0
- package/cjs/label/base.js +263 -0
- package/cjs/label/base.js.map +1 -0
- package/cjs/label/dataLabel.d.ts +13 -0
- package/cjs/label/dataLabel.js +56 -0
- package/cjs/label/dataLabel.js.map +1 -0
- package/cjs/label/index.d.ts +6 -0
- package/cjs/label/index.js +23 -0
- package/cjs/label/index.js.map +1 -0
- package/cjs/label/line.d.ts +15 -0
- package/cjs/label/line.js +47 -0
- package/cjs/label/line.js.map +1 -0
- package/cjs/label/overlap/bitmap.d.ts +13 -0
- package/cjs/label/overlap/bitmap.js +73 -0
- package/cjs/label/overlap/bitmap.js.map +1 -0
- package/cjs/label/overlap/index.d.ts +3 -0
- package/cjs/label/overlap/index.js +22 -0
- package/cjs/label/overlap/index.js.map +1 -0
- package/cjs/label/overlap/place.d.ts +14 -0
- package/cjs/label/overlap/place.js +61 -0
- package/cjs/label/overlap/place.js.map +1 -0
- package/cjs/label/overlap/scaler.d.ts +27 -0
- package/cjs/label/overlap/scaler.js +26 -0
- package/cjs/label/overlap/scaler.js.map +1 -0
- package/cjs/label/rect.d.ts +10 -0
- package/cjs/label/rect.js +59 -0
- package/cjs/label/rect.js.map +1 -0
- package/cjs/label/symbol.d.ts +10 -0
- package/cjs/label/symbol.js +69 -0
- package/cjs/label/symbol.js.map +1 -0
- package/cjs/label/type.d.ts +90 -0
- package/cjs/label/type.js +6 -0
- package/cjs/label/type.js.map +1 -0
- package/cjs/legend/base.d.ts +14 -0
- package/cjs/legend/base.js +58 -0
- package/cjs/legend/base.js.map +1 -0
- package/cjs/legend/color/color.d.ts +37 -0
- package/cjs/legend/color/color.js +128 -0
- package/cjs/legend/color/color.js.map +1 -0
- package/cjs/legend/color/index.d.ts +2 -0
- package/cjs/legend/color/index.js +21 -0
- package/cjs/legend/color/index.js.map +1 -0
- package/cjs/legend/color/type.d.ts +5 -0
- package/cjs/legend/color/type.js +6 -0
- package/cjs/legend/color/type.js.map +1 -0
- package/cjs/legend/constant.d.ts +29 -0
- package/cjs/legend/constant.js +24 -0
- package/cjs/legend/constant.js.map +1 -0
- package/cjs/legend/discrete/discrete.d.ts +26 -0
- package/cjs/legend/discrete/discrete.js +413 -0
- package/cjs/legend/discrete/discrete.js.map +1 -0
- package/cjs/legend/discrete/index.d.ts +2 -0
- package/cjs/legend/discrete/index.js +21 -0
- package/cjs/legend/discrete/index.js.map +1 -0
- package/cjs/legend/discrete/type.d.ts +65 -0
- package/cjs/legend/discrete/type.js +6 -0
- package/cjs/legend/discrete/type.js.map +1 -0
- package/cjs/legend/index.d.ts +8 -0
- package/cjs/legend/index.js +24 -0
- package/cjs/legend/index.js.map +1 -0
- package/cjs/legend/size/index.d.ts +1 -0
- package/cjs/legend/size/index.js +3 -0
- package/cjs/legend/size/index.js.map +1 -0
- package/cjs/legend/size/size.d.ts +34 -0
- package/cjs/legend/size/size.js +106 -0
- package/cjs/legend/size/size.js.map +1 -0
- package/cjs/legend/size/type.d.ts +6 -0
- package/cjs/legend/size/type.js +6 -0
- package/cjs/legend/size/type.js.map +1 -0
- package/cjs/legend/type.d.ts +27 -0
- package/cjs/legend/type.js +6 -0
- package/cjs/legend/type.js.map +1 -0
- package/cjs/link-path/index.d.ts +2 -0
- package/cjs/link-path/index.js +21 -0
- package/cjs/link-path/index.js.map +1 -0
- package/cjs/link-path/link-path.d.ts +15 -0
- package/cjs/link-path/link-path.js +65 -0
- package/cjs/link-path/link-path.js.map +1 -0
- package/cjs/link-path/type.d.ts +17 -0
- package/cjs/link-path/type.js +6 -0
- package/cjs/link-path/type.js.map +1 -0
- package/cjs/marker/area.d.ts +56 -0
- package/cjs/marker/area.js +64 -0
- package/cjs/marker/area.js.map +1 -0
- package/cjs/marker/base.d.ts +11 -0
- package/cjs/marker/base.js +22 -0
- package/cjs/marker/base.js.map +1 -0
- package/cjs/marker/config.d.ts +154 -0
- package/cjs/marker/config.js +240 -0
- package/cjs/marker/config.js.map +1 -0
- package/cjs/marker/index.d.ts +4 -0
- package/cjs/marker/index.js +22 -0
- package/cjs/marker/index.js.map +1 -0
- package/cjs/marker/line.d.ts +10 -0
- package/cjs/marker/line.js +45 -0
- package/cjs/marker/line.js.map +1 -0
- package/cjs/marker/point.d.ts +80 -0
- package/cjs/marker/point.js +102 -0
- package/cjs/marker/point.js.map +1 -0
- package/cjs/marker/type.d.ts +93 -0
- package/cjs/marker/type.js +26 -0
- package/cjs/marker/type.js.map +1 -0
- package/cjs/pager/index.d.ts +2 -0
- package/cjs/pager/index.js +21 -0
- package/cjs/pager/index.js.map +1 -0
- package/cjs/pager/pager.d.ts +20 -0
- package/cjs/pager/pager.js +132 -0
- package/cjs/pager/pager.js.map +1 -0
- package/cjs/pager/type.d.ts +19 -0
- package/cjs/pager/type.js +6 -0
- package/cjs/pager/type.js.map +1 -0
- package/cjs/player/base-player.d.ts +103 -0
- package/cjs/player/base-player.js +199 -0
- package/cjs/player/base-player.js.map +1 -0
- package/cjs/player/constant.d.ts +12 -0
- package/cjs/player/constant.js +16 -0
- package/cjs/player/constant.js.map +1 -0
- package/cjs/player/continuous-player.d.ts +34 -0
- package/cjs/player/continuous-player.js +107 -0
- package/cjs/player/continuous-player.js.map +1 -0
- package/cjs/player/controller/assets/index.d.ts +6 -0
- package/cjs/player/controller/assets/index.js +12 -0
- package/cjs/player/controller/assets/index.js.map +1 -0
- package/cjs/player/controller/constant.d.ts +12 -0
- package/cjs/player/controller/constant.js +15 -0
- package/cjs/player/controller/constant.js.map +1 -0
- package/cjs/player/controller/controller.d.ts +32 -0
- package/cjs/player/controller/controller.js +93 -0
- package/cjs/player/controller/controller.js.map +1 -0
- package/cjs/player/controller/icon/icon.d.ts +4 -0
- package/cjs/player/controller/icon/icon.js +16 -0
- package/cjs/player/controller/icon/icon.js.map +1 -0
- package/cjs/player/controller/icon/index.d.ts +1 -0
- package/cjs/player/controller/icon/index.js +21 -0
- package/cjs/player/controller/icon/index.js.map +1 -0
- package/cjs/player/controller/icon/type.d.ts +1 -0
- package/cjs/player/controller/icon/type.js +3 -0
- package/cjs/player/controller/icon/type.js.map +1 -0
- package/cjs/player/controller/index.d.ts +2 -0
- package/cjs/player/controller/index.js +21 -0
- package/cjs/player/controller/index.js.map +1 -0
- package/cjs/player/controller/type.d.ts +11 -0
- package/cjs/player/controller/type.js +6 -0
- package/cjs/player/controller/type.js.map +1 -0
- package/cjs/player/discrete-player.d.ts +32 -0
- package/cjs/player/discrete-player.js +85 -0
- package/cjs/player/discrete-player.js.map +1 -0
- package/cjs/player/index.d.ts +4 -0
- package/cjs/player/index.js +22 -0
- package/cjs/player/index.js.map +1 -0
- package/cjs/player/type/base.d.ts +7 -0
- package/cjs/player/type/base.js +6 -0
- package/cjs/player/type/base.js.map +1 -0
- package/cjs/player/type/continuous-player.d.ts +7 -0
- package/cjs/player/type/continuous-player.js +6 -0
- package/cjs/player/type/continuous-player.js.map +1 -0
- package/cjs/player/type/direction.d.ts +5 -0
- package/cjs/player/type/direction.js +10 -0
- package/cjs/player/type/direction.js.map +1 -0
- package/cjs/player/type/discrete-player.d.ts +9 -0
- package/cjs/player/type/discrete-player.js +6 -0
- package/cjs/player/type/discrete-player.js.map +1 -0
- package/cjs/player/type/event.d.ts +8 -0
- package/cjs/player/type/event.js +12 -0
- package/cjs/player/type/event.js.map +1 -0
- package/cjs/player/type/index.d.ts +9 -0
- package/cjs/player/type/index.js +23 -0
- package/cjs/player/type/index.js.map +1 -0
- package/cjs/player/type/layout.d.ts +35 -0
- package/cjs/player/type/layout.js +6 -0
- package/cjs/player/type/layout.js.map +1 -0
- package/cjs/player/utils.d.ts +20 -0
- package/cjs/player/utils.js +74 -0
- package/cjs/player/utils.js.map +1 -0
- package/cjs/scrollbar/index.d.ts +2 -0
- package/cjs/scrollbar/index.js +21 -0
- package/cjs/scrollbar/index.js.map +1 -0
- package/cjs/scrollbar/scrollbar.d.ts +43 -0
- package/cjs/scrollbar/scrollbar.js +161 -0
- package/cjs/scrollbar/scrollbar.js.map +1 -0
- package/cjs/scrollbar/type.d.ts +16 -0
- package/cjs/scrollbar/type.js +6 -0
- package/cjs/scrollbar/type.js.map +1 -0
- package/cjs/segment/index.d.ts +2 -0
- package/cjs/segment/index.js +21 -0
- package/cjs/segment/index.js.map +1 -0
- package/cjs/segment/segment.d.ts +18 -0
- package/cjs/segment/segment.js +105 -0
- package/cjs/segment/segment.js.map +1 -0
- package/cjs/segment/type.d.ts +22 -0
- package/cjs/segment/type.js +6 -0
- package/cjs/segment/type.js.map +1 -0
- package/cjs/slider/constant.d.ts +13 -0
- package/cjs/slider/constant.js +15 -0
- package/cjs/slider/constant.js.map +1 -0
- package/cjs/slider/index.d.ts +3 -0
- package/cjs/slider/index.js +22 -0
- package/cjs/slider/index.js.map +1 -0
- package/cjs/slider/slider.d.ts +96 -0
- package/cjs/slider/slider.js +405 -0
- package/cjs/slider/slider.js.map +1 -0
- package/cjs/slider/type.d.ts +44 -0
- package/cjs/slider/type.js +6 -0
- package/cjs/slider/type.js.map +1 -0
- package/cjs/tag/index.d.ts +2 -0
- package/cjs/tag/index.js +21 -0
- package/cjs/tag/index.js.map +1 -0
- package/cjs/tag/tag.d.ts +8 -0
- package/cjs/tag/tag.js +103 -0
- package/cjs/tag/tag.js.map +1 -0
- package/cjs/tag/type.d.ts +24 -0
- package/cjs/tag/type.js +6 -0
- package/cjs/tag/type.js.map +1 -0
- package/cjs/title/index.d.ts +2 -0
- package/cjs/title/index.js +21 -0
- package/cjs/title/index.js.map +1 -0
- package/cjs/title/title.d.ts +10 -0
- package/cjs/title/title.js +133 -0
- package/cjs/title/title.js.map +1 -0
- package/cjs/title/type.d.ts +41 -0
- package/cjs/title/type.js +6 -0
- package/cjs/title/type.js.map +1 -0
- package/cjs/tooltip/config.d.ts +3 -0
- package/cjs/tooltip/config.js +78 -0
- package/cjs/tooltip/config.js.map +1 -0
- package/cjs/tooltip/index.d.ts +2 -0
- package/cjs/tooltip/index.js +21 -0
- package/cjs/tooltip/index.js.map +1 -0
- package/cjs/tooltip/tooltip.d.ts +18 -0
- package/cjs/tooltip/tooltip.js +160 -0
- package/cjs/tooltip/tooltip.js.map +1 -0
- package/cjs/tooltip/type.d.ts +60 -0
- package/cjs/tooltip/type.js +6 -0
- package/cjs/tooltip/type.js.map +1 -0
- package/cjs/tooltip/util.d.ts +2 -0
- package/cjs/tooltip/util.js +17 -0
- package/cjs/tooltip/util.js.map +1 -0
- package/cjs/util/common.d.ts +3 -0
- package/cjs/util/common.js +21 -0
- package/cjs/util/common.js.map +1 -0
- package/cjs/util/index.d.ts +4 -0
- package/cjs/util/index.js +22 -0
- package/cjs/util/index.js.map +1 -0
- package/cjs/util/labelSmartInvert.d.ts +2 -0
- package/cjs/util/labelSmartInvert.js +45 -0
- package/cjs/util/labelSmartInvert.js.map +1 -0
- package/cjs/util/matrix.d.ts +4 -0
- package/cjs/util/matrix.js +24 -0
- package/cjs/util/matrix.js.map +1 -0
- package/cjs/util/text.d.ts +7 -0
- package/cjs/util/text.js +40 -0
- package/cjs/util/text.js.map +1 -0
- package/dist/vrender-components.js.js +1 -0
- package/dist/vrender-components.js.min.js +1 -0
- package/es/axis/animate/group-fade.d.ts +17 -0
- package/es/axis/animate/group-fade.js +62 -0
- package/es/axis/animate/group-fade.js.map +1 -0
- package/es/axis/animate/group-transition.d.ts +10 -0
- package/es/axis/animate/group-transition.js +72 -0
- package/es/axis/animate/group-transition.js.map +1 -0
- package/es/axis/animate/index.d.ts +2 -0
- package/es/axis/animate/index.js +4 -0
- package/es/axis/animate/index.js.map +1 -0
- package/es/axis/base.d.ts +53 -0
- package/es/axis/base.js +306 -0
- package/es/axis/base.js.map +1 -0
- package/es/axis/circle.d.ts +88 -0
- package/es/axis/circle.js +186 -0
- package/es/axis/circle.js.map +1 -0
- package/es/axis/config.d.ts +71 -0
- package/es/axis/config.js +72 -0
- package/es/axis/config.js.map +1 -0
- package/es/axis/constant.d.ts +27 -0
- package/es/axis/constant.js +26 -0
- package/es/axis/constant.js.map +1 -0
- package/es/axis/grid.d.ts +9 -0
- package/es/axis/grid.js +102 -0
- package/es/axis/grid.js.map +1 -0
- package/es/axis/index.d.ts +6 -0
- package/es/axis/index.js +12 -0
- package/es/axis/index.js.map +1 -0
- package/es/axis/line.d.ts +89 -0
- package/es/axis/line.js +204 -0
- package/es/axis/line.js.map +1 -0
- package/es/axis/type.d.ts +177 -0
- package/es/axis/type.js +2 -0
- package/es/axis/type.js.map +1 -0
- package/es/brush/brush.d.ts +65 -0
- package/es/brush/brush.js +171 -0
- package/es/brush/brush.js.map +1 -0
- package/es/brush/config.d.ts +21 -0
- package/es/brush/config.js +22 -0
- package/es/brush/config.js.map +1 -0
- package/es/brush/index.d.ts +2 -0
- package/es/brush/index.js +4 -0
- package/es/brush/index.js.map +1 -0
- package/es/brush/type.d.ts +21 -0
- package/es/brush/type.js +2 -0
- package/es/brush/type.js.map +1 -0
- package/es/constant.d.ts +16 -0
- package/es/constant.js +21 -0
- package/es/constant.js.map +1 -0
- package/es/core/base.d.ts +12 -0
- package/es/core/base.js +40 -0
- package/es/core/base.js.map +1 -0
- package/es/core/type.d.ts +28 -0
- package/es/core/type.js +1 -0
- package/es/core/type.js.map +1 -0
- package/es/crosshair/base.d.ts +10 -0
- package/es/crosshair/base.js +11 -0
- package/es/crosshair/base.js.map +1 -0
- package/es/crosshair/circle.d.ts +17 -0
- package/es/crosshair/circle.js +29 -0
- package/es/crosshair/circle.js.map +1 -0
- package/es/crosshair/index.d.ts +6 -0
- package/es/crosshair/index.js +12 -0
- package/es/crosshair/index.js.map +1 -0
- package/es/crosshair/line.d.ts +17 -0
- package/es/crosshair/line.js +32 -0
- package/es/crosshair/line.js.map +1 -0
- package/es/crosshair/polygon.d.ts +17 -0
- package/es/crosshair/polygon.js +35 -0
- package/es/crosshair/polygon.js.map +1 -0
- package/es/crosshair/rect.d.ts +20 -0
- package/es/crosshair/rect.js +33 -0
- package/es/crosshair/rect.js.map +1 -0
- package/es/crosshair/sector.d.ts +15 -0
- package/es/crosshair/sector.js +35 -0
- package/es/crosshair/sector.js.map +1 -0
- package/es/crosshair/type.d.ts +37 -0
- package/es/crosshair/type.js +2 -0
- package/es/crosshair/type.js.map +1 -0
- package/es/data-zoom/config.d.ts +104 -0
- package/es/data-zoom/config.js +106 -0
- package/es/data-zoom/config.js.map +1 -0
- package/es/data-zoom/data-zoom.d.ts +193 -0
- package/es/data-zoom/data-zoom.js +444 -0
- package/es/data-zoom/data-zoom.js.map +1 -0
- package/es/data-zoom/index.d.ts +2 -0
- package/es/data-zoom/index.js +4 -0
- package/es/data-zoom/index.js.map +1 -0
- package/es/data-zoom/type.d.ts +59 -0
- package/es/data-zoom/type.js +2 -0
- package/es/data-zoom/type.js.map +1 -0
- package/es/index.d.ts +20 -0
- package/es/index.js +40 -0
- package/es/index.js.map +1 -0
- package/es/indicator/config.d.ts +2 -0
- package/es/indicator/config.js +27 -0
- package/es/indicator/config.js.map +1 -0
- package/es/indicator/index.d.ts +2 -0
- package/es/indicator/index.js +4 -0
- package/es/indicator/index.js.map +1 -0
- package/es/indicator/indicator.d.ts +9 -0
- package/es/indicator/indicator.js +69 -0
- package/es/indicator/indicator.js.map +1 -0
- package/es/indicator/type.d.ts +21 -0
- package/es/indicator/type.js +1 -0
- package/es/indicator/type.js.map +1 -0
- package/es/interface.d.ts +6 -0
- package/es/interface.js +2 -0
- package/es/interface.js.map +1 -0
- package/es/label/animate/animate.d.ts +7 -0
- package/es/label/animate/animate.js +47 -0
- package/es/label/animate/animate.js.map +1 -0
- package/es/label/animate/index.d.ts +1 -0
- package/es/label/animate/index.js +3 -0
- package/es/label/animate/index.js.map +1 -0
- package/es/label/base.d.ts +43 -0
- package/es/label/base.js +263 -0
- package/es/label/base.js.map +1 -0
- package/es/label/dataLabel.d.ts +13 -0
- package/es/label/dataLabel.js +60 -0
- package/es/label/dataLabel.js.map +1 -0
- package/es/label/index.d.ts +6 -0
- package/es/label/index.js +12 -0
- package/es/label/index.js.map +1 -0
- package/es/label/line.d.ts +15 -0
- package/es/label/line.js +43 -0
- package/es/label/line.js.map +1 -0
- package/es/label/overlap/bitmap.d.ts +13 -0
- package/es/label/overlap/bitmap.js +65 -0
- package/es/label/overlap/bitmap.js.map +1 -0
- package/es/label/overlap/index.d.ts +3 -0
- package/es/label/overlap/index.js +6 -0
- package/es/label/overlap/index.js.map +1 -0
- package/es/label/overlap/place.d.ts +14 -0
- package/es/label/overlap/place.js +57 -0
- package/es/label/overlap/place.js.map +1 -0
- package/es/label/overlap/scaler.d.ts +27 -0
- package/es/label/overlap/scaler.js +18 -0
- package/es/label/overlap/scaler.js.map +1 -0
- package/es/label/rect.d.ts +10 -0
- package/es/label/rect.js +55 -0
- package/es/label/rect.js.map +1 -0
- package/es/label/symbol.d.ts +10 -0
- package/es/label/symbol.js +65 -0
- package/es/label/symbol.js.map +1 -0
- package/es/label/type.d.ts +90 -0
- package/es/label/type.js +2 -0
- package/es/label/type.js.map +1 -0
- package/es/legend/base.d.ts +14 -0
- package/es/legend/base.js +56 -0
- package/es/legend/base.js.map +1 -0
- package/es/legend/color/color.d.ts +37 -0
- package/es/legend/color/color.js +128 -0
- package/es/legend/color/color.js.map +1 -0
- package/es/legend/color/index.d.ts +2 -0
- package/es/legend/color/index.js +4 -0
- package/es/legend/color/index.js.map +1 -0
- package/es/legend/color/type.d.ts +5 -0
- package/es/legend/color/type.js +2 -0
- package/es/legend/color/type.js.map +1 -0
- package/es/legend/constant.d.ts +29 -0
- package/es/legend/constant.js +40 -0
- package/es/legend/constant.js.map +1 -0
- package/es/legend/discrete/discrete.d.ts +26 -0
- package/es/legend/discrete/discrete.js +409 -0
- package/es/legend/discrete/discrete.js.map +1 -0
- package/es/legend/discrete/index.d.ts +2 -0
- package/es/legend/discrete/index.js +4 -0
- package/es/legend/discrete/index.js.map +1 -0
- package/es/legend/discrete/type.d.ts +65 -0
- package/es/legend/discrete/type.js +2 -0
- package/es/legend/discrete/type.js.map +1 -0
- package/es/legend/index.d.ts +8 -0
- package/es/legend/index.js +16 -0
- package/es/legend/index.js.map +1 -0
- package/es/legend/size/index.d.ts +1 -0
- package/es/legend/size/index.js +3 -0
- package/es/legend/size/index.js.map +1 -0
- package/es/legend/size/size.d.ts +34 -0
- package/es/legend/size/size.js +105 -0
- package/es/legend/size/size.js.map +1 -0
- package/es/legend/size/type.d.ts +6 -0
- package/es/legend/size/type.js +2 -0
- package/es/legend/size/type.js.map +1 -0
- package/es/legend/type.d.ts +27 -0
- package/es/legend/type.js +2 -0
- package/es/legend/type.js.map +1 -0
- package/es/link-path/index.d.ts +2 -0
- package/es/link-path/index.js +4 -0
- package/es/link-path/index.js.map +1 -0
- package/es/link-path/link-path.d.ts +15 -0
- package/es/link-path/link-path.js +59 -0
- package/es/link-path/link-path.js.map +1 -0
- package/es/link-path/type.d.ts +17 -0
- package/es/link-path/type.js +2 -0
- package/es/link-path/type.js.map +1 -0
- package/es/marker/area.d.ts +56 -0
- package/es/marker/area.js +65 -0
- package/es/marker/area.js.map +1 -0
- package/es/marker/base.d.ts +11 -0
- package/es/marker/base.js +15 -0
- package/es/marker/base.js.map +1 -0
- package/es/marker/config.d.ts +154 -0
- package/es/marker/config.js +244 -0
- package/es/marker/config.js.map +1 -0
- package/es/marker/index.d.ts +4 -0
- package/es/marker/index.js +8 -0
- package/es/marker/index.js.map +1 -0
- package/es/marker/line.d.ts +10 -0
- package/es/marker/line.js +47 -0
- package/es/marker/line.js.map +1 -0
- package/es/marker/point.d.ts +80 -0
- package/es/marker/point.js +106 -0
- package/es/marker/point.js.map +1 -0
- package/es/marker/type.d.ts +93 -0
- package/es/marker/type.js +27 -0
- package/es/marker/type.js.map +1 -0
- package/es/pager/index.d.ts +2 -0
- package/es/pager/index.js +4 -0
- package/es/pager/index.js.map +1 -0
- package/es/pager/pager.d.ts +20 -0
- package/es/pager/pager.js +132 -0
- package/es/pager/pager.js.map +1 -0
- package/es/pager/type.d.ts +19 -0
- package/es/pager/type.js +2 -0
- package/es/pager/type.js.map +1 -0
- package/es/player/base-player.d.ts +103 -0
- package/es/player/base-player.js +200 -0
- package/es/player/base-player.js.map +1 -0
- package/es/player/constant.d.ts +12 -0
- package/es/player/constant.js +14 -0
- package/es/player/constant.js.map +1 -0
- package/es/player/continuous-player.d.ts +34 -0
- package/es/player/continuous-player.js +104 -0
- package/es/player/continuous-player.js.map +1 -0
- package/es/player/controller/assets/index.d.ts +6 -0
- package/es/player/controller/assets/index.js +12 -0
- package/es/player/controller/assets/index.js.map +1 -0
- package/es/player/controller/constant.d.ts +12 -0
- package/es/player/controller/constant.js +14 -0
- package/es/player/controller/constant.js.map +1 -0
- package/es/player/controller/controller.d.ts +32 -0
- package/es/player/controller/controller.js +97 -0
- package/es/player/controller/controller.js.map +1 -0
- package/es/player/controller/icon/icon.d.ts +4 -0
- package/es/player/controller/icon/icon.js +8 -0
- package/es/player/controller/icon/icon.js.map +1 -0
- package/es/player/controller/icon/index.d.ts +1 -0
- package/es/player/controller/icon/index.js +2 -0
- package/es/player/controller/icon/index.js.map +1 -0
- package/es/player/controller/icon/type.d.ts +1 -0
- package/es/player/controller/icon/type.js +3 -0
- package/es/player/controller/icon/type.js.map +1 -0
- package/es/player/controller/index.d.ts +2 -0
- package/es/player/controller/index.js +4 -0
- package/es/player/controller/index.js.map +1 -0
- package/es/player/controller/type.d.ts +11 -0
- package/es/player/controller/type.js +2 -0
- package/es/player/controller/type.js.map +1 -0
- package/es/player/discrete-player.d.ts +32 -0
- package/es/player/discrete-player.js +86 -0
- package/es/player/discrete-player.js.map +1 -0
- package/es/player/index.d.ts +4 -0
- package/es/player/index.js +8 -0
- package/es/player/index.js.map +1 -0
- package/es/player/type/base.d.ts +7 -0
- package/es/player/type/base.js +2 -0
- package/es/player/type/base.js.map +1 -0
- package/es/player/type/continuous-player.d.ts +7 -0
- package/es/player/type/continuous-player.js +2 -0
- package/es/player/type/continuous-player.js.map +1 -0
- package/es/player/type/direction.d.ts +5 -0
- package/es/player/type/direction.js +6 -0
- package/es/player/type/direction.js.map +1 -0
- package/es/player/type/discrete-player.d.ts +9 -0
- package/es/player/type/discrete-player.js +2 -0
- package/es/player/type/discrete-player.js.map +1 -0
- package/es/player/type/event.d.ts +8 -0
- package/es/player/type/event.js +8 -0
- package/es/player/type/event.js.map +1 -0
- package/es/player/type/index.d.ts +9 -0
- package/es/player/type/index.js +12 -0
- package/es/player/type/index.js.map +1 -0
- package/es/player/type/layout.d.ts +35 -0
- package/es/player/type/layout.js +2 -0
- package/es/player/type/layout.js.map +1 -0
- package/es/player/utils.d.ts +20 -0
- package/es/player/utils.js +45 -0
- package/es/player/utils.js.map +1 -0
- package/es/scrollbar/index.d.ts +2 -0
- package/es/scrollbar/index.js +4 -0
- package/es/scrollbar/index.js.map +1 -0
- package/es/scrollbar/scrollbar.d.ts +43 -0
- package/es/scrollbar/scrollbar.js +154 -0
- package/es/scrollbar/scrollbar.js.map +1 -0
- package/es/scrollbar/type.d.ts +16 -0
- package/es/scrollbar/type.js +2 -0
- package/es/scrollbar/type.js.map +1 -0
- package/es/segment/index.d.ts +2 -0
- package/es/segment/index.js +4 -0
- package/es/segment/index.js.map +1 -0
- package/es/segment/segment.d.ts +18 -0
- package/es/segment/segment.js +103 -0
- package/es/segment/segment.js.map +1 -0
- package/es/segment/type.d.ts +22 -0
- package/es/segment/type.js +2 -0
- package/es/segment/type.js.map +1 -0
- package/es/slider/constant.d.ts +13 -0
- package/es/slider/constant.js +11 -0
- package/es/slider/constant.js.map +1 -0
- package/es/slider/index.d.ts +3 -0
- package/es/slider/index.js +6 -0
- package/es/slider/index.js.map +1 -0
- package/es/slider/slider.d.ts +96 -0
- package/es/slider/slider.js +399 -0
- package/es/slider/slider.js.map +1 -0
- package/es/slider/type.d.ts +44 -0
- package/es/slider/type.js +2 -0
- package/es/slider/type.js.map +1 -0
- package/es/tag/index.d.ts +2 -0
- package/es/tag/index.js +4 -0
- package/es/tag/index.js.map +1 -0
- package/es/tag/tag.d.ts +8 -0
- package/es/tag/tag.js +97 -0
- package/es/tag/tag.js.map +1 -0
- package/es/tag/type.d.ts +24 -0
- package/es/tag/type.js +2 -0
- package/es/tag/type.js.map +1 -0
- package/es/title/index.d.ts +2 -0
- package/es/title/index.js +4 -0
- package/es/title/index.js.map +1 -0
- package/es/title/title.d.ts +10 -0
- package/es/title/title.js +125 -0
- package/es/title/title.js.map +1 -0
- package/es/title/type.d.ts +41 -0
- package/es/title/type.js +2 -0
- package/es/title/type.js.map +1 -0
- package/es/tooltip/config.d.ts +3 -0
- package/es/tooltip/config.js +76 -0
- package/es/tooltip/config.js.map +1 -0
- package/es/tooltip/index.d.ts +2 -0
- package/es/tooltip/index.js +4 -0
- package/es/tooltip/index.js.map +1 -0
- package/es/tooltip/tooltip.d.ts +18 -0
- package/es/tooltip/tooltip.js +161 -0
- package/es/tooltip/tooltip.js.map +1 -0
- package/es/tooltip/type.d.ts +60 -0
- package/es/tooltip/type.js +2 -0
- package/es/tooltip/type.js.map +1 -0
- package/es/tooltip/util.d.ts +2 -0
- package/es/tooltip/util.js +11 -0
- package/es/tooltip/util.js.map +1 -0
- package/es/util/common.d.ts +3 -0
- package/es/util/common.js +11 -0
- package/es/util/common.js.map +1 -0
- package/es/util/index.d.ts +4 -0
- package/es/util/index.js +8 -0
- package/es/util/index.js.map +1 -0
- package/es/util/labelSmartInvert.d.ts +2 -0
- package/es/util/labelSmartInvert.js +39 -0
- package/es/util/labelSmartInvert.js.map +1 -0
- package/es/util/matrix.d.ts +4 -0
- package/es/util/matrix.js +13 -0
- package/es/util/matrix.js.map +1 -0
- package/es/util/text.d.ts +7 -0
- package/es/util/text.js +38 -0
- package/es/util/text.js.map +1 -0
- package/package.json +49 -0
package/cjs/constant.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var StateValue;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: !0
|
|
7
|
+
}), exports.DEFAULT_STATES = exports.StateValue = exports.DEFAULT_TEXT_FONT_SIZE = exports.DEFAULT_TEXT_FONT_FAMILY = exports.POLAR_END_ANGLE = exports.POLAR_START_ANGLE = void 0,
|
|
8
|
+
exports.POLAR_START_ANGLE = -.5 * Math.PI, exports.POLAR_END_ANGLE = 1.5 * Math.PI,
|
|
9
|
+
exports.DEFAULT_TEXT_FONT_FAMILY = "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
|
|
10
|
+
exports.DEFAULT_TEXT_FONT_SIZE = 11, function(StateValue) {
|
|
11
|
+
StateValue.selected = "selected", StateValue.selectedReverse = "selected_reverse",
|
|
12
|
+
StateValue.hover = "hover", StateValue.hoverReverse = "hover_reverse";
|
|
13
|
+
}(StateValue = exports.StateValue || (exports.StateValue = {})), exports.DEFAULT_STATES = {
|
|
14
|
+
[StateValue.selectedReverse]: {},
|
|
15
|
+
[StateValue.selected]: {},
|
|
16
|
+
[StateValue.hover]: {},
|
|
17
|
+
[StateValue.hoverReverse]: {}
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;AACnC,QAAA,eAAe,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;AAEhC,QAAA,wBAAwB,GAEnC,kJAAkJ,CAAC;AAExI,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAEzC,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,kDAAoC,CAAA;IACpC,6BAAe,CAAA;IACf,4CAA8B,CAAA;AAChC,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAEY,QAAA,cAAc,GAAG;IAC5B,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,EAAE;IAChC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE;IACzB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE;IACtB,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,EAAE;CAC9B,CAAC","file":"constant.js","sourcesContent":["export const POLAR_START_ANGLE = -0.5 * Math.PI;\nexport const POLAR_END_ANGLE = 1.5 * Math.PI;\n\nexport const DEFAULT_TEXT_FONT_FAMILY =\n // eslint-disable-next-line max-len\n 'PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol';\n\nexport const DEFAULT_TEXT_FONT_SIZE = 11;\n\nexport enum StateValue {\n selected = 'selected',\n selectedReverse = 'selected_reverse',\n hover = 'hover',\n hoverReverse = 'hover_reverse'\n}\n\nexport const DEFAULT_STATES = {\n [StateValue.selectedReverse]: {},\n [StateValue.selected]: {},\n [StateValue.hover]: {},\n [StateValue.hoverReverse]: {}\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Group, IGroupGraphicAttribute } from '@visactor/vrender';
|
|
2
|
+
export declare abstract class AbstractComponent<T extends IGroupGraphicAttribute = IGroupGraphicAttribute> extends Group {
|
|
3
|
+
attribute: Partial<T>;
|
|
4
|
+
protected mode: '2d' | '3d';
|
|
5
|
+
constructor(attributes: T, mode?: '2d' | '3d');
|
|
6
|
+
setAttribute(key: keyof T, value: any, forceUpdateTag?: boolean | undefined): void;
|
|
7
|
+
setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void;
|
|
8
|
+
protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]): void;
|
|
9
|
+
protected bindEvents(): void;
|
|
10
|
+
protected abstract render(): void;
|
|
11
|
+
protected _getNodeId(id: string): string;
|
|
12
|
+
}
|
package/cjs/core/base.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.AbstractComponent = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vutils"), GROUP_ATTRIBUTES = [ "x", "y", "dx", "dy", "scaleX", "scaleY", "angle", "anchor", "postMatrix", "visible", "clip", "pickable", "childrenPickable", "zIndex" ];
|
|
8
|
+
|
|
9
|
+
class AbstractComponent extends vrender_1.Group {
|
|
10
|
+
constructor(attributes, mode = "2d") {
|
|
11
|
+
super(attributes), this.mode = mode, this.setTheme({
|
|
12
|
+
common: {
|
|
13
|
+
strokeBoundsBuffer: 0
|
|
14
|
+
}
|
|
15
|
+
}), this.attribute = attributes, this.onSetStage((() => {
|
|
16
|
+
this.render(), this.bindEvents();
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
setAttribute(key, value, forceUpdateTag) {
|
|
20
|
+
(0, vutils_1.isPlainObject)(this.attribute[key]) ? (0, vutils_1.merge)(this.attribute[key], value) : this.attribute[key] = value,
|
|
21
|
+
GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
|
|
22
|
+
this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
23
|
+
}
|
|
24
|
+
setAttributes(params, forceUpdateTag) {
|
|
25
|
+
const keys = Object.keys(params);
|
|
26
|
+
this._mergeAttributes(params, keys), keys.every((key => GROUP_ATTRIBUTES.includes(key))) || this.render(),
|
|
27
|
+
this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
|
|
28
|
+
this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
29
|
+
}
|
|
30
|
+
_mergeAttributes(params, keys) {
|
|
31
|
+
(0, vutils_1.isNil)(keys) && (keys = Object.keys(params));
|
|
32
|
+
for (let i = 0; i < keys.length; i++) {
|
|
33
|
+
const key = keys[i];
|
|
34
|
+
(0, vutils_1.isPlainObject)(this.attribute[key]) ? (0, vutils_1.merge)(this.attribute[key], params[key]) : this.attribute[key] = params[key];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
bindEvents() {}
|
|
38
|
+
_getNodeId(id) {
|
|
39
|
+
return `${this.id}-${this.name}-${id}`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.AbstractComponent = AbstractComponent;
|
|
44
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/base.ts"],"names":[],"mappings":";;;AAGA,+CAAkE;AAClE,6CAA+D;AAE/D,MAAM,gBAAgB,GAAG;IACvB,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,MAAM;IACN,UAAU;IACV,kBAAkB;IAClB,QAAQ;CACT,CAAC;AAEF,MAAsB,iBAA6E,SAAQ,eAAK;IAK9G,YAAY,UAAa,EAAE,OAAoB,IAAI;QACjD,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,QAAQ,CAAC;YACZ,MAAM,EAAE;gBACN,kBAAkB,EAAE,CAAC;aACtB;SACF,CAAC,CAAC;QACH,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAUD,YAAY,CAAC,GAAY,EAAE,KAAU,EAAE,cAAoC;QACzE,IAAI,IAAA,sBAAa,EAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE;YACtC,IAAA,cAAK,EAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC7B;QAGD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAa,CAAC,EAAE;YAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,aAAa,CAAC,GAAa,CAAC,CAAC,EAAE;YAClG,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;QACD,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAGD,aAAa,CAAC,MAAkB,EAAE,cAAoC;QACpE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAgB,CAAC;QAChD,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAGpC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAa,CAAC,CAAC,EAAE;YAChE,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAE5B,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,IAAgB,CAAC,CAAC,EAAE;YACtG,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;QACD,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAES,gBAAgB,CAAC,MAAkB,EAAE,IAAkB;QAC/D,IAAI,IAAA,cAAK,EAAC,IAAI,CAAC,EAAE;YACf,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAgB,CAAC;SAC3C;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAqB,CAAC;YACxC,IAAI,IAAA,sBAAa,EAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE;gBACtC,IAAA,cAAK,EAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;aACnC;SACF;IACH,CAAC;IAES,UAAU;IAEpB,CAAC;IAKS,UAAU,CAAC,EAAU;QAC7B,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;IACzC,CAAC;CACF;AAjGD,8CAiGC","file":"base.js","sourcesContent":["/**\n * @description 组件基类\n */\nimport { Group, IGroupGraphicAttribute } from '@visactor/vrender';\nimport { merge, isPlainObject, isNil } from '@visactor/vutils';\n\nconst GROUP_ATTRIBUTES = [\n 'x',\n 'y',\n 'dx',\n 'dy',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'postMatrix',\n 'visible',\n 'clip',\n 'pickable',\n 'childrenPickable',\n 'zIndex'\n];\n\nexport abstract class AbstractComponent<T extends IGroupGraphicAttribute = IGroupGraphicAttribute> extends Group {\n declare attribute: Partial<T>;\n\n protected mode: '2d' | '3d';\n\n constructor(attributes: T, mode: '2d' | '3d' = '2d') {\n super(attributes);\n this.mode = mode;\n // 组件需要精准 bounds,所以将这个 strokeBoundsBuffer 设置为 0,否则会影响包围盒的获取\n this.setTheme({\n common: {\n strokeBoundsBuffer: 0\n }\n });\n this.attribute = attributes;\n // 这里调用渲染和事件绑定逻辑\n this.onSetStage(() => {\n this.render();\n this.bindEvents();\n });\n }\n\n /**\n * @override\n * 更新单个属性值\n * @param key\n * @param value\n * @param forceUpdateTag\n */\n // @ts-ignore\n setAttribute(key: keyof T, value: any, forceUpdateTag?: boolean | undefined): void {\n if (isPlainObject(this.attribute[key])) {\n merge(this.attribute[key], value);\n } else {\n this.attribute[key] = value;\n }\n\n // HACK: 待优化\n if (!GROUP_ATTRIBUTES.includes(key as string)) {\n this.render();\n }\n\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key as string))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n // @ts-ignore\n setAttributes(params: Partial<T>, forceUpdateTag?: boolean | undefined): void {\n const keys = Object.keys(params) as (keyof T)[];\n this._mergeAttributes(params, keys);\n\n // HACK: 待优化\n if (!keys.every(key => GROUP_ATTRIBUTES.includes(key as string))) {\n this.render();\n }\n\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys as string[]))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.onAttributeUpdate();\n }\n\n protected _mergeAttributes(params: Partial<T>, keys?: (keyof T)[]) {\n if (isNil(keys)) {\n keys = Object.keys(params) as (keyof T)[];\n }\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i] as keyof Partial<T>;\n if (isPlainObject(this.attribute[key])) {\n merge(this.attribute[key], params[key]);\n } else {\n this.attribute[key] = params[key];\n }\n }\n }\n\n protected bindEvents() {\n // for override\n }\n\n protected abstract render(): void;\n\n // 图形元素 id\n protected _getNodeId(id: string) {\n return `${this.id}-${this.name}-${id}`;\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type Point = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
export interface LocationCfg {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface PointLocationCfg extends LocationCfg {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export interface RegionLocationCfg extends LocationCfg {
|
|
13
|
+
start: Point;
|
|
14
|
+
end: Point;
|
|
15
|
+
}
|
|
16
|
+
export type State<T> = {
|
|
17
|
+
[key: string]: T;
|
|
18
|
+
};
|
|
19
|
+
export type BaseGraphicAttributes<T> = {
|
|
20
|
+
style?: T;
|
|
21
|
+
state?: State<T>;
|
|
22
|
+
};
|
|
23
|
+
export type Padding = number | number[] | {
|
|
24
|
+
top?: number;
|
|
25
|
+
bottom?: number;
|
|
26
|
+
left?: number;
|
|
27
|
+
right?: number;
|
|
28
|
+
};
|
package/cjs/core/type.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["export type Point = {\n x: number;\n y: number;\n};\n\nexport interface LocationCfg {\n [key: string]: any;\n}\n\nexport interface PointLocationCfg extends LocationCfg {\n /**\n * 位置 x\n * @type {number}\n */\n x: number;\n /**\n * 位置 y\n * @type {number}\n */\n y: number;\n}\n\nexport interface RegionLocationCfg extends LocationCfg {\n /**\n * 起始点\n */\n start: Point;\n /**\n * 结束点\n */\n end: Point;\n}\n\nexport type State<T> = {\n [key: string]: T;\n};\n\nexport type BaseGraphicAttributes<T> = {\n /**\n * 基础样式设置\n */\n style?: T;\n /**\n * 状态样式设置\n */\n state?: State<T>;\n};\n\nexport type Padding =\n | number\n | number[]\n | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IGroup } from '@visactor/vrender';
|
|
2
|
+
import { AbstractComponent } from '../core/base';
|
|
3
|
+
import { LocationCfg } from '../core/type';
|
|
4
|
+
import { BaseCrosshairAttrs } from './type';
|
|
5
|
+
export declare abstract class CrosshairBase<T extends BaseCrosshairAttrs> extends AbstractComponent<Required<T>> {
|
|
6
|
+
name: string;
|
|
7
|
+
protected abstract renderCrosshair(container: IGroup): any;
|
|
8
|
+
abstract setLocation(location: LocationCfg): void;
|
|
9
|
+
protected render(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.CrosshairBase = void 0;
|
|
6
|
+
|
|
7
|
+
const base_1 = require("../core/base");
|
|
8
|
+
|
|
9
|
+
class CrosshairBase extends base_1.AbstractComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.name = "crosshair";
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
this.renderCrosshair(this);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.CrosshairBase = CrosshairBase;
|
|
19
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/base.ts"],"names":[],"mappings":";;;AAIA,uCAAiD;AAIjD,MAAsB,aAA4C,SAAQ,wBAA8B;IAAxG;;QACE,SAAI,GAAG,WAAW,CAAC;IAYrB,CAAC;IAHW,MAAM;QACd,IAAI,CAAC,eAAe,CAAC,IAAyB,CAAC,CAAC;IAClD,CAAC;CACF;AAbD,sCAaC","file":"base.js","sourcesContent":["/**\n * @description Crosshair 基类\n */\nimport { IGroup } from '@visactor/vrender';\nimport { AbstractComponent } from '../core/base';\nimport { LocationCfg } from '../core/type';\nimport { BaseCrosshairAttrs } from './type';\n\nexport abstract class CrosshairBase<T extends BaseCrosshairAttrs> extends AbstractComponent<Required<T>> {\n name = 'crosshair';\n\n protected abstract renderCrosshair(container: IGroup): any;\n /**\n * 更新位置\n * @param location 位置信息\n */\n abstract setLocation(location: LocationCfg): void;\n\n protected render() {\n this.renderCrosshair(this as unknown as IGroup);\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IGroup } from '@visactor/vrender';
|
|
2
|
+
import { PointLocationCfg } from '../core/type';
|
|
3
|
+
import { CrosshairBase } from './base';
|
|
4
|
+
import { CircleCrosshairAttrs } from './type';
|
|
5
|
+
export declare class CircleCrosshair extends CrosshairBase<CircleCrosshairAttrs> {
|
|
6
|
+
static defaultAttributes: {
|
|
7
|
+
lineStyle: {
|
|
8
|
+
stroke: boolean[];
|
|
9
|
+
strokeColor: string;
|
|
10
|
+
lineWidth: number;
|
|
11
|
+
lineDash: number[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
constructor(attributes: CircleCrosshairAttrs);
|
|
15
|
+
protected renderCrosshair(container: IGroup): import("@visactor/vrender").INode;
|
|
16
|
+
setLocation(point: PointLocationCfg): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.CircleCrosshair = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), base_1 = require("./base");
|
|
8
|
+
|
|
9
|
+
class CircleCrosshair extends base_1.CrosshairBase {
|
|
10
|
+
constructor(attributes) {
|
|
11
|
+
super((0, vutils_1.merge)({}, CircleCrosshair.defaultAttributes, attributes));
|
|
12
|
+
}
|
|
13
|
+
renderCrosshair(container) {
|
|
14
|
+
const {center: center, radius: radius, lineStyle: lineStyle} = this.attribute;
|
|
15
|
+
return container.createOrUpdateChild("crosshair-circle", Object.assign(Object.assign(Object.assign(Object.assign({}, center), {
|
|
16
|
+
outerRadius: radius
|
|
17
|
+
}), this.attribute), lineStyle), "arc");
|
|
18
|
+
}
|
|
19
|
+
setLocation(point) {
|
|
20
|
+
const {center: center} = this.attribute, radius = vutils_1.PointService.distancePP(point, center);
|
|
21
|
+
this.setAttribute("radius", radius);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.CircleCrosshair = CircleCrosshair, CircleCrosshair.defaultAttributes = {
|
|
26
|
+
lineStyle: {
|
|
27
|
+
stroke: [ !0, !1, !1, !1 ],
|
|
28
|
+
strokeColor: "#b2bacf",
|
|
29
|
+
lineWidth: 1,
|
|
30
|
+
lineDash: [ 2 ]
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=circle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/circle.ts"],"names":[],"mappings":";;;AAIA,6CAAuD;AAEvD,iCAAuC;AAGvC,MAAa,eAAgB,SAAQ,oBAAmC;IAUtE,YAAY,UAAgC;QAC1C,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,eAAe,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAClE,CAAC;IAES,eAAe,CAAC,SAAiB;QACzC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,SAAiC,CAAC;QAE7E,MAAM,MAAM,GAAG,SAAS,CAAC,mBAAmB,CAC1C,kBAAkB,8DAEb,MAAM,KACT,WAAW,EAAE,MAAM,KAChB,IAAI,CAAC,SAAS,GACd,SAAS,GAEd,KAAK,CACN,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,KAAuB;QACjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAAiC,CAAC;QAC1D,MAAM,MAAM,GAAG,qBAAY,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEtD,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;;AAnCH,0CAoCC;AAnCQ,iCAAiB,GAAG;IACzB,SAAS,EAAE;QACT,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;QACnC,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,CAAC;KACd;CACF,CAAC","file":"circle.js","sourcesContent":["/**\n * @description circle 类型 crosshair,用于极坐标系下\n */\nimport { IGroup } from '@visactor/vrender';\nimport { merge, PointService } from '@visactor/vutils';\nimport { PointLocationCfg } from '../core/type';\nimport { CrosshairBase } from './base';\nimport { CircleCrosshairAttrs } from './type';\n\nexport class CircleCrosshair extends CrosshairBase<CircleCrosshairAttrs> {\n static defaultAttributes = {\n lineStyle: {\n stroke: [true, false, false, false],\n strokeColor: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n };\n\n constructor(attributes: CircleCrosshairAttrs) {\n super(merge({}, CircleCrosshair.defaultAttributes, attributes));\n }\n\n protected renderCrosshair(container: IGroup) {\n const { center, radius, lineStyle } = this.attribute as CircleCrosshairAttrs;\n\n const circle = container.createOrUpdateChild(\n 'crosshair-circle',\n {\n ...center,\n outerRadius: radius,\n ...this.attribute,\n ...lineStyle\n },\n 'arc'\n );\n return circle;\n }\n\n setLocation(point: PointLocationCfg) {\n const { center } = this.attribute as CircleCrosshairAttrs;\n const radius = PointService.distancePP(point, center);\n\n this.setAttribute('radius', radius);\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __exportStar = this && this.__exportStar || function(m, exports) {
|
|
15
|
+
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), __exportStar(require("./line"), exports), __exportStar(require("./rect"), exports),
|
|
21
|
+
__exportStar(require("./circle"), exports), __exportStar(require("./sector"), exports),
|
|
22
|
+
__exportStar(require("./polygon"), exports), __exportStar(require("./type"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAQA,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB","file":"index.js","sourcesContent":["/**\n * @description crosshair 组件\n * 1. line 直线\n * 2. rect 矩形\n * 3. sector rect 在极坐标系下的\n * 4. circle 用于极坐标系下弧度轴,smooth === true 时\n * 5. polygon 用于极坐标系下弧度轴,smooth === false 时\n */\nexport * from './line';\nexport * from './rect';\nexport * from './circle';\nexport * from './sector';\nexport * from './polygon';\nexport * from './type';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IGroup } from '@visactor/vrender';
|
|
2
|
+
import { RegionLocationCfg } from '../core/type';
|
|
3
|
+
import { CrosshairBase } from './base';
|
|
4
|
+
import { LineCrosshairAttrs } from './type';
|
|
5
|
+
export declare class LineCrosshair extends CrosshairBase<LineCrosshairAttrs> {
|
|
6
|
+
static defaultAttributes: {
|
|
7
|
+
lineStyle: {
|
|
8
|
+
stroke: boolean;
|
|
9
|
+
strokeColor: string;
|
|
10
|
+
lineWidth: number;
|
|
11
|
+
lineDash: number[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
constructor(attributes: LineCrosshairAttrs);
|
|
15
|
+
protected renderCrosshair(container: IGroup): import("@visactor/vrender").INode;
|
|
16
|
+
setLocation(region: RegionLocationCfg): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.LineCrosshair = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), base_1 = require("./base");
|
|
8
|
+
|
|
9
|
+
class LineCrosshair extends base_1.CrosshairBase {
|
|
10
|
+
constructor(attributes) {
|
|
11
|
+
super((0, vutils_1.merge)({}, LineCrosshair.defaultAttributes, attributes));
|
|
12
|
+
}
|
|
13
|
+
renderCrosshair(container) {
|
|
14
|
+
const {start: start, end: end, lineStyle: lineStyle} = this.attribute;
|
|
15
|
+
return container.createOrUpdateChild("crosshair-line", Object.assign({
|
|
16
|
+
points: [ start, end ]
|
|
17
|
+
}, lineStyle), "line");
|
|
18
|
+
}
|
|
19
|
+
setLocation(region) {
|
|
20
|
+
const {start: start, end: end} = region;
|
|
21
|
+
this.setAttributes({
|
|
22
|
+
start: start,
|
|
23
|
+
end: end
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.LineCrosshair = LineCrosshair, LineCrosshair.defaultAttributes = {
|
|
29
|
+
lineStyle: {
|
|
30
|
+
stroke: !0,
|
|
31
|
+
strokeColor: "#b2bacf",
|
|
32
|
+
lineWidth: 1,
|
|
33
|
+
lineDash: [ 2 ]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/line.ts"],"names":[],"mappings":";;;AAIA,6CAAyC;AAEzC,iCAAuC;AAGvC,MAAa,aAAc,SAAQ,oBAAiC;IAUlE,YAAY,UAA8B;QACxC,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,eAAe,CAAC,SAAiB;QACzC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,SAA+B,CAAC;QAEvE,MAAM,IAAI,GAAG,SAAS,CAAC,mBAAmB,CACxC,gBAAgB,kBAEd,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,IACjB,SAAS,GAEd,MAAM,CACP,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW,CAAC,MAAyB;QACnC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,aAAa,CAAC;YACjB,KAAK;YACL,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;;AAlCH,sCAmCC;AAlCQ,+BAAiB,GAAG;IACzB,SAAS,EAAE;QACT,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,CAAC;KACd;CACF,CAAC","file":"line.js","sourcesContent":["/**\n * @description 直线类型 crosshair\n */\nimport { IGroup } from '@visactor/vrender';\nimport { merge } from '@visactor/vutils';\nimport { RegionLocationCfg } from '../core/type';\nimport { CrosshairBase } from './base';\nimport { LineCrosshairAttrs } from './type';\n\nexport class LineCrosshair extends CrosshairBase<LineCrosshairAttrs> {\n static defaultAttributes = {\n lineStyle: {\n stroke: true,\n strokeColor: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n };\n\n constructor(attributes: LineCrosshairAttrs) {\n super(merge({}, LineCrosshair.defaultAttributes, attributes));\n }\n\n protected renderCrosshair(container: IGroup) {\n const { start, end, lineStyle } = this.attribute as LineCrosshairAttrs;\n\n const line = container.createOrUpdateChild(\n 'crosshair-line',\n {\n points: [start, end],\n ...lineStyle\n },\n 'line'\n );\n return line;\n }\n\n setLocation(region: RegionLocationCfg) {\n const { start, end } = region;\n this.setAttributes({\n start,\n end\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IGroup } from '@visactor/vrender';
|
|
2
|
+
import { PointLocationCfg } from '../core/type';
|
|
3
|
+
import { CrosshairBase } from './base';
|
|
4
|
+
import { PolygonCrosshairAttrs } from './type';
|
|
5
|
+
export declare class PolygonCrosshair extends CrosshairBase<PolygonCrosshairAttrs> {
|
|
6
|
+
static defaultAttributes: {
|
|
7
|
+
lineStyle: {
|
|
8
|
+
stroke: boolean;
|
|
9
|
+
strokeColor: string;
|
|
10
|
+
lineWidth: number;
|
|
11
|
+
lineDash: number[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
constructor(attributes: PolygonCrosshairAttrs);
|
|
15
|
+
protected renderCrosshair(container: IGroup): import("@visactor/vrender").INode;
|
|
16
|
+
setLocation(point: PointLocationCfg): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.PolygonCrosshair = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), base_1 = require("./base");
|
|
8
|
+
|
|
9
|
+
class PolygonCrosshair extends base_1.CrosshairBase {
|
|
10
|
+
constructor(attributes) {
|
|
11
|
+
super((0, vutils_1.merge)({}, PolygonCrosshair.defaultAttributes, attributes));
|
|
12
|
+
}
|
|
13
|
+
renderCrosshair(container) {
|
|
14
|
+
const {center: center, radius: radius, sides: sides = 6, lineStyle: lineStyle} = this.attribute, {startAngle: startAngle, endAngle: endAngle} = this.attribute, isClose = (endAngle - startAngle) % (2 * Math.PI) == 0, eachAngle = (endAngle - startAngle) / sides;
|
|
15
|
+
let path;
|
|
16
|
+
for (let index = 0; index <= sides; index++) {
|
|
17
|
+
const angle = startAngle + eachAngle * index, point = (0, vutils_1.polarToCartesian)(center, radius, angle);
|
|
18
|
+
0 === index ? path = `M${point.x},${point.y}` : path += `L${point.x},${point.y}`,
|
|
19
|
+
index === sides && isClose && (path += "Z");
|
|
20
|
+
}
|
|
21
|
+
return container.createOrUpdateChild("crosshair-polygon", Object.assign({
|
|
22
|
+
path: path
|
|
23
|
+
}, lineStyle), "path");
|
|
24
|
+
}
|
|
25
|
+
setLocation(point) {
|
|
26
|
+
const {center: center} = this.attribute, radius = vutils_1.PointService.distancePP(point, center);
|
|
27
|
+
this.setAttribute("radius", radius);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports.PolygonCrosshair = PolygonCrosshair, PolygonCrosshair.defaultAttributes = {
|
|
32
|
+
lineStyle: {
|
|
33
|
+
stroke: !0,
|
|
34
|
+
strokeColor: "#b2bacf",
|
|
35
|
+
lineWidth: 1,
|
|
36
|
+
lineDash: [ 2 ]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=polygon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/polygon.ts"],"names":[],"mappings":";;;AAIA,6CAAyE;AAEzE,iCAAuC;AAGvC,MAAa,gBAAiB,SAAQ,oBAAoC;IAUxE,YAAY,UAAiC;QAC3C,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,gBAAgB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IACnE,CAAC;IAES,eAAe,CAAC,SAAiB;QACzC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,SAAkC,CAAC;QACzF,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAEhD,MAAM,OAAO,GAAG,CAAC,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,UAAU,CAAC,GAAG,KAAK,CAAC;QAClD,IAAI,IAAI,CAAC;QACT,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,KAAK,EAAE,KAAK,EAAE,EAAE;YAC3C,MAAM,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;YAC7C,MAAM,KAAK,GAAG,IAAA,yBAAgB,EAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YACtD,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,IAAI,GAAG,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC;aACjC;iBAAM;gBACL,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC;aAClC;YACD,IAAI,KAAK,KAAK,KAAK,IAAI,OAAO,EAAE;gBAC9B,IAAI,IAAI,GAAG,CAAC;aACb;SACF;QAED,MAAM,OAAO,GAAG,SAAS,CAAC,mBAAmB,CAC3C,mBAAmB,kBAEjB,IAAI,IACD,SAAS,GAEd,MAAM,CACP,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,WAAW,CAAC,KAAuB;QACjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAAkC,CAAC;QAC3D,MAAM,MAAM,GAAG,qBAAY,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEtD,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;;AAlDH,4CAmDC;AAlDQ,kCAAiB,GAAG;IACzB,SAAS,EAAE;QACT,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,CAAC,CAAC,CAAC;KACd;CACF,CAAC","file":"polygon.js","sourcesContent":["/**\n * @description polygon 类型 crosshair,用于极坐标系下\n */\nimport { IGroup } from '@visactor/vrender';\nimport { merge, polarToCartesian, PointService } from '@visactor/vutils';\nimport { PointLocationCfg } from '../core/type';\nimport { CrosshairBase } from './base';\nimport { PolygonCrosshairAttrs } from './type';\n\nexport class PolygonCrosshair extends CrosshairBase<PolygonCrosshairAttrs> {\n static defaultAttributes = {\n lineStyle: {\n stroke: true,\n strokeColor: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n };\n\n constructor(attributes: PolygonCrosshairAttrs) {\n super(merge({}, PolygonCrosshair.defaultAttributes, attributes));\n }\n\n protected renderCrosshair(container: IGroup) {\n const { center, radius, sides = 6, lineStyle } = this.attribute as PolygonCrosshairAttrs;\n const { startAngle, endAngle } = this.attribute;\n\n const isClose = (endAngle - startAngle) % (Math.PI * 2) === 0;\n const eachAngle = (endAngle - startAngle) / sides;\n let path;\n for (let index = 0; index <= sides; index++) {\n const angle = startAngle + eachAngle * index;\n const point = polarToCartesian(center, radius, angle);\n if (index === 0) {\n path = `M${point.x},${point.y}`;\n } else {\n path += `L${point.x},${point.y}`;\n }\n if (index === sides && isClose) {\n path += 'Z';\n }\n }\n\n const polygon = container.createOrUpdateChild(\n 'crosshair-polygon',\n {\n path,\n ...lineStyle\n },\n 'path'\n );\n return polygon;\n }\n\n setLocation(point: PointLocationCfg) {\n const { center } = this.attribute as PolygonCrosshairAttrs;\n const radius = PointService.distancePP(point, center);\n\n this.setAttribute('radius', radius);\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IGroup } from '@visactor/vrender';
|
|
2
|
+
import { RegionLocationCfg } from '../core/type';
|
|
3
|
+
import { Tag } from '../tag';
|
|
4
|
+
import { CrosshairBase } from './base';
|
|
5
|
+
import { RectCrosshairAttrs } from './type';
|
|
6
|
+
export declare class RectCrosshair extends CrosshairBase<RectCrosshairAttrs> {
|
|
7
|
+
static defaultAttributes: {
|
|
8
|
+
rectStyle: {
|
|
9
|
+
fillColor: string;
|
|
10
|
+
opacity: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
protected topLabelShape?: Tag;
|
|
14
|
+
protected bottomLabelShape?: Tag;
|
|
15
|
+
protected leftLabelShape?: Tag;
|
|
16
|
+
protected rightLabelShape?: Tag;
|
|
17
|
+
constructor(attributes: RectCrosshairAttrs);
|
|
18
|
+
protected renderCrosshair(container: IGroup): import("@visactor/vrender").INode;
|
|
19
|
+
setLocation(region: RegionLocationCfg): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.RectCrosshair = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), base_1 = require("./base");
|
|
8
|
+
|
|
9
|
+
class RectCrosshair extends base_1.CrosshairBase {
|
|
10
|
+
constructor(attributes) {
|
|
11
|
+
super((0, vutils_1.merge)({}, RectCrosshair.defaultAttributes, attributes));
|
|
12
|
+
}
|
|
13
|
+
renderCrosshair(container) {
|
|
14
|
+
const {start: start, end: end, rectStyle: rectStyle} = this.attribute;
|
|
15
|
+
return container.createOrUpdateChild("crosshair-rect", Object.assign({
|
|
16
|
+
x: start.x,
|
|
17
|
+
y: start.y,
|
|
18
|
+
width: end.x - start.x,
|
|
19
|
+
height: end.y - start.y
|
|
20
|
+
}, rectStyle), "rect");
|
|
21
|
+
}
|
|
22
|
+
setLocation(region) {
|
|
23
|
+
const {start: start, end: end} = region;
|
|
24
|
+
this.setAttributes({
|
|
25
|
+
start: start,
|
|
26
|
+
end: end
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports.RectCrosshair = RectCrosshair, RectCrosshair.defaultAttributes = {
|
|
32
|
+
rectStyle: {
|
|
33
|
+
fillColor: "#b2bacf",
|
|
34
|
+
opacity: .2
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=rect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/rect.ts"],"names":[],"mappings":";;;AAIA,6CAAyC;AAGzC,iCAAuC;AAGvC,MAAa,aAAc,SAAQ,oBAAiC;IAalE,YAAY,UAA8B;QACxC,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,eAAe,CAAC,SAAiB;QACzC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,SAA+B,CAAC;QAEvE,MAAM,IAAI,GAAG,SAAS,CAAC,mBAAmB,CACxC,gBAAgB,kBAEd,CAAC,EAAE,KAAK,CAAC,CAAC,EACV,CAAC,EAAE,KAAK,CAAC,CAAC,EACV,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EACtB,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,IACpB,SAAS,GAEd,MAAM,CACP,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW,CAAC,MAAyB;QACnC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,aAAa,CAAC;YACjB,KAAK;YACL,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;;AAxCH,sCAyCC;AAxCQ,+BAAiB,GAAG;IACzB,SAAS,EAAE;QACT,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,GAAG;KACb;CACF,CAAC","file":"rect.js","sourcesContent":["/**\n * @description 矩形类型 crosshair\n */\nimport { IGroup } from '@visactor/vrender';\nimport { merge } from '@visactor/vutils';\nimport { RegionLocationCfg } from '../core/type';\nimport { Tag } from '../tag';\nimport { CrosshairBase } from './base';\nimport { RectCrosshairAttrs } from './type';\n\nexport class RectCrosshair extends CrosshairBase<RectCrosshairAttrs> {\n static defaultAttributes = {\n rectStyle: {\n fillColor: '#b2bacf',\n opacity: 0.2\n }\n };\n\n protected topLabelShape?: Tag;\n protected bottomLabelShape?: Tag;\n protected leftLabelShape?: Tag;\n protected rightLabelShape?: Tag;\n\n constructor(attributes: RectCrosshairAttrs) {\n super(merge({}, RectCrosshair.defaultAttributes, attributes));\n }\n\n protected renderCrosshair(container: IGroup) {\n const { start, end, rectStyle } = this.attribute as RectCrosshairAttrs;\n\n const rect = container.createOrUpdateChild(\n 'crosshair-rect',\n {\n x: start.x,\n y: start.y,\n width: end.x - start.x,\n height: end.y - start.y,\n ...rectStyle\n },\n 'rect'\n );\n return rect;\n }\n\n setLocation(region: RegionLocationCfg) {\n const { start, end } = region;\n this.setAttributes({\n start,\n end\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IGroup } from '@visactor/vrender';
|
|
2
|
+
import { PointLocationCfg } from '../core/type';
|
|
3
|
+
import { CrosshairBase } from './base';
|
|
4
|
+
import { SectorCrosshairAttrs } from './type';
|
|
5
|
+
export declare class SectorCrosshair extends CrosshairBase<SectorCrosshairAttrs> {
|
|
6
|
+
static defaultAttributes: {
|
|
7
|
+
sectorStyle: {
|
|
8
|
+
fillColor: string;
|
|
9
|
+
opacity: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
constructor(attributes: SectorCrosshairAttrs);
|
|
13
|
+
protected renderCrosshair(container: IGroup): import("@visactor/vrender").INode;
|
|
14
|
+
setLocation(point: PointLocationCfg): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.SectorCrosshair = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), constant_1 = require("../constant"), base_1 = require("./base");
|
|
8
|
+
|
|
9
|
+
class SectorCrosshair extends base_1.CrosshairBase {
|
|
10
|
+
constructor(attributes) {
|
|
11
|
+
super((0, vutils_1.merge)({}, SectorCrosshair.defaultAttributes, attributes));
|
|
12
|
+
}
|
|
13
|
+
renderCrosshair(container) {
|
|
14
|
+
const {center: center, radius: radius, innerRadius: innerRadius = 0, sectorStyle: sectorStyle} = this.attribute, {startAngle: startAngle, endAngle: endAngle} = this.attribute;
|
|
15
|
+
return container.createOrUpdateChild("crosshair-sector", Object.assign(Object.assign(Object.assign({}, center), {
|
|
16
|
+
outerRadius: radius,
|
|
17
|
+
innerRadius: innerRadius,
|
|
18
|
+
startAngle: startAngle,
|
|
19
|
+
endAngle: endAngle
|
|
20
|
+
}), sectorStyle), "arc");
|
|
21
|
+
}
|
|
22
|
+
setLocation(point) {
|
|
23
|
+
const {center: center, startAngle: startAngle = constant_1.POLAR_START_ANGLE, endAngle: endAngle = constant_1.POLAR_END_ANGLE} = this.attribute, sectorAngle = endAngle - startAngle, pointAngle = (0,
|
|
24
|
+
vutils_1.radianToDegree)((0, vutils_1.getAngleByPoint)(center, point));
|
|
25
|
+
this.setAttributes({
|
|
26
|
+
startAngle: pointAngle - sectorAngle / 2,
|
|
27
|
+
endAngle: pointAngle + sectorAngle / 2
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.SectorCrosshair = SectorCrosshair, SectorCrosshair.defaultAttributes = {
|
|
33
|
+
sectorStyle: {
|
|
34
|
+
fillColor: "#b2bacf",
|
|
35
|
+
opacity: .2
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=sector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/sector.ts"],"names":[],"mappings":";;;AAIA,6CAA0E;AAE1E,0CAAiE;AACjE,iCAAuC;AAGvC,MAAa,eAAgB,SAAQ,oBAAmC;IAQtE,YAAY,UAAgC;QAC1C,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,eAAe,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAClE,CAAC;IAES,eAAe,CAAC,SAAiB;QACzC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,SAAiC,CAAC;QAChG,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,mBAAmB,CAC1C,kBAAkB,gDAEb,MAAM,KACT,WAAW,EAAE,MAAM,EACnB,WAAW;YACX,UAAU;YACV,QAAQ,KACL,WAAW,GAEhB,KAAK,CACN,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,KAAuB;QACjC,MAAM,EACJ,MAAM,EACN,UAAU,GAAG,4BAAiB,EAC9B,QAAQ,GAAG,0BAAe,EAC3B,GAAG,IAAI,CAAC,SAAiC,CAAC;QAC3C,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;QAC1C,MAAM,UAAU,GAAG,IAAA,uBAAc,EAAC,IAAA,wBAAe,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,aAAa,CAAC;YACjB,UAAU,EAAE,UAAU,GAAG,WAAW,GAAG,CAAC;YACxC,QAAQ,EAAE,UAAU,GAAG,WAAW,GAAG,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;;AA1CH,0CA2CC;AA1CQ,iCAAiB,GAAG;IACzB,WAAW,EAAE;QACX,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,GAAG;KACb;CACF,CAAC","file":"sector.js","sourcesContent":["/**\n * @description sector 类型 crosshair,用于极坐标系下\n */\nimport { IGroup } from '@visactor/vrender';\nimport { merge, getAngleByPoint, radianToDegree } from '@visactor/vutils';\nimport { PointLocationCfg } from '../core/type';\nimport { POLAR_END_ANGLE, POLAR_START_ANGLE } from '../constant';\nimport { CrosshairBase } from './base';\nimport { SectorCrosshairAttrs } from './type';\n\nexport class SectorCrosshair extends CrosshairBase<SectorCrosshairAttrs> {\n static defaultAttributes = {\n sectorStyle: {\n fillColor: '#b2bacf',\n opacity: 0.2\n }\n };\n\n constructor(attributes: SectorCrosshairAttrs) {\n super(merge({}, SectorCrosshair.defaultAttributes, attributes));\n }\n\n protected renderCrosshair(container: IGroup) {\n const { center, radius, innerRadius = 0, sectorStyle } = this.attribute as SectorCrosshairAttrs;\n const { startAngle, endAngle } = this.attribute;\n const circle = container.createOrUpdateChild(\n 'crosshair-sector',\n {\n ...center,\n outerRadius: radius,\n innerRadius,\n startAngle,\n endAngle,\n ...sectorStyle\n },\n 'arc'\n );\n return circle;\n }\n\n setLocation(point: PointLocationCfg) {\n const {\n center,\n startAngle = POLAR_START_ANGLE,\n endAngle = POLAR_END_ANGLE\n } = this.attribute as SectorCrosshairAttrs;\n const sectorAngle = endAngle - startAngle;\n const pointAngle = radianToDegree(getAngleByPoint(center, point));\n this.setAttributes({\n startAngle: pointAngle - sectorAngle / 2,\n endAngle: pointAngle + sectorAngle / 2\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IGroupGraphicAttribute, ILineGraphicAttribute, IRectGraphicAttribute } from '@visactor/vrender';
|
|
2
|
+
import { Point } from '../core/type';
|
|
3
|
+
export interface BaseCrosshairAttrs extends IGroupGraphicAttribute {
|
|
4
|
+
type?: 'line' | 'rect' | 'circle' | 'polygon' | 'sector';
|
|
5
|
+
}
|
|
6
|
+
export interface PolarCrosshairAttrs extends BaseCrosshairAttrs {
|
|
7
|
+
center: Point;
|
|
8
|
+
radius: number;
|
|
9
|
+
startAngle?: number;
|
|
10
|
+
endAngle?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface LineCrosshairAttrs extends BaseCrosshairAttrs {
|
|
13
|
+
type?: 'line';
|
|
14
|
+
start: Point;
|
|
15
|
+
end: Point;
|
|
16
|
+
lineStyle?: Partial<ILineGraphicAttribute>;
|
|
17
|
+
}
|
|
18
|
+
export interface CircleCrosshairAttrs extends PolarCrosshairAttrs {
|
|
19
|
+
type?: 'circle';
|
|
20
|
+
lineStyle?: Partial<ILineGraphicAttribute>;
|
|
21
|
+
}
|
|
22
|
+
export interface RectCrosshairAttrs extends BaseCrosshairAttrs {
|
|
23
|
+
type?: 'rect';
|
|
24
|
+
start: Point;
|
|
25
|
+
end: Point;
|
|
26
|
+
rectStyle?: Partial<IRectGraphicAttribute>;
|
|
27
|
+
}
|
|
28
|
+
export interface SectorCrosshairAttrs extends PolarCrosshairAttrs {
|
|
29
|
+
type?: 'sector';
|
|
30
|
+
innerRadius?: number;
|
|
31
|
+
sectorStyle?: Partial<ILineGraphicAttribute>;
|
|
32
|
+
}
|
|
33
|
+
export interface PolygonCrosshairAttrs extends PolarCrosshairAttrs {
|
|
34
|
+
type?: 'polygon';
|
|
35
|
+
sides: number;
|
|
36
|
+
lineStyle?: Partial<ILineGraphicAttribute>;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import { IGroupGraphicAttribute, ILineGraphicAttribute, IRectGraphicAttribute } from '@visactor/vrender';\nimport { Point } from '../core/type';\n\nexport interface BaseCrosshairAttrs extends IGroupGraphicAttribute {\n type?: 'line' | 'rect' | 'circle' | 'polygon' | 'sector';\n}\n\nexport interface PolarCrosshairAttrs extends BaseCrosshairAttrs {\n /**\n * 圆心\n */\n center: Point;\n /**\n * 半径\n */\n radius: number;\n /**\n * 起始弧度\n */\n startAngle?: number;\n /**\n * 结束弧度\n */\n endAngle?: number;\n}\n\nexport interface LineCrosshairAttrs extends BaseCrosshairAttrs {\n type?: 'line';\n /**\n * 起始点坐标\n */\n start: Point;\n /**\n * 结束点坐标\n */\n end: Point;\n /**\n * 线样式\n */\n lineStyle?: Partial<ILineGraphicAttribute>;\n}\n\nexport interface CircleCrosshairAttrs extends PolarCrosshairAttrs {\n type?: 'circle';\n /**\n * 线样式\n */\n lineStyle?: Partial<ILineGraphicAttribute>;\n}\n\nexport interface RectCrosshairAttrs extends BaseCrosshairAttrs {\n type?: 'rect';\n /**\n * 起始点坐标\n */\n start: Point;\n /**\n * 结束点坐标\n */\n end: Point;\n /**\n * 线样式\n */\n rectStyle?: Partial<IRectGraphicAttribute>;\n}\n\nexport interface SectorCrosshairAttrs extends PolarCrosshairAttrs {\n type?: 'sector';\n /**\n * 内半径\n */\n innerRadius?: number;\n /**\n * 样式配置\n */\n sectorStyle?: Partial<ILineGraphicAttribute>;\n}\n\nexport interface PolygonCrosshairAttrs extends PolarCrosshairAttrs {\n type?: 'polygon';\n /** 多边形边数 */\n sides: number;\n /** 多边形样式 */\n lineStyle?: Partial<ILineGraphicAttribute>;\n}\n"]}
|