@visactor/vgrammar-core 0.7.7 → 0.8.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/cjs/component/axis.js.map +1 -1
- package/cjs/component/datazoom.d.ts +7 -4
- package/cjs/component/datazoom.js +21 -43
- package/cjs/component/datazoom.js.map +1 -1
- package/cjs/component/grid.js.map +1 -1
- package/cjs/component/index.d.ts +0 -2
- package/cjs/component/index.js +1 -19
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/label.js.map +1 -1
- package/cjs/component/legend.d.ts +1 -3
- package/cjs/component/legend.js +5 -26
- package/cjs/component/legend.js.map +1 -1
- package/cjs/component/player.d.ts +1 -2
- package/cjs/component/player.js +15 -31
- package/cjs/component/player.js.map +1 -1
- package/cjs/component/scale.d.ts +1 -0
- package/cjs/component/scale.js +3 -0
- package/cjs/component/scale.js.map +1 -1
- package/cjs/component/scrollbar.d.ts +3 -4
- package/cjs/component/scrollbar.js +12 -54
- package/cjs/component/scrollbar.js.map +1 -1
- package/cjs/component/slider.d.ts +2 -5
- package/cjs/component/slider.js +4 -26
- package/cjs/component/slider.js.map +1 -1
- package/cjs/component/title.js.map +1 -1
- package/cjs/core/factory.d.ts +6 -3
- package/cjs/core/factory.js +9 -2
- package/cjs/core/factory.js.map +1 -1
- package/cjs/env.d.ts +1 -0
- package/cjs/env.js +20 -0
- package/cjs/env.js.map +1 -0
- package/cjs/glyph/index.js +2 -1
- package/cjs/glyph/link-path.js +1 -2
- package/cjs/graph/animation/animate.js +25 -19
- package/cjs/graph/animation/animate.js.map +1 -1
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/cjs/graph/animation/animator.js +4 -4
- package/cjs/graph/animation/animator.js.map +1 -1
- package/cjs/graph/animation/attribute.d.ts +2 -2
- package/cjs/graph/animation/attribute.js +12 -12
- package/cjs/graph/animation/attribute.js.map +1 -1
- package/cjs/graph/animation/morph.js +4 -4
- package/cjs/graph/animation/morph.js.map +1 -1
- package/cjs/graph/attributes/index.js +1 -1
- package/cjs/graph/attributes/index.js.map +1 -1
- package/cjs/graph/canvas-renderer.d.ts +1 -1
- package/cjs/graph/canvas-renderer.js +5 -5
- package/cjs/graph/canvas-renderer.js.map +1 -1
- package/cjs/graph/element.d.ts +1 -1
- package/cjs/graph/element.js +4 -4
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/enums.d.ts +25 -8
- package/cjs/graph/enums.js +23 -14
- package/cjs/graph/enums.js.map +1 -1
- package/cjs/graph/glyph-element.d.ts +1 -1
- package/cjs/graph/glyph-element.js.map +1 -1
- package/cjs/graph/mark/encode.d.ts +0 -3
- package/cjs/graph/mark/encode.js +3 -12
- package/cjs/graph/mark/encode.js.map +1 -1
- package/cjs/graph/mark/large-rects.d.ts +2 -2
- package/cjs/graph/mark/large-rects.js +3 -3
- package/cjs/graph/mark/large-rects.js.map +1 -1
- package/cjs/graph/mark/large-symbols.d.ts +2 -2
- package/cjs/graph/mark/large-symbols.js +3 -3
- package/cjs/graph/mark/large-symbols.js.map +1 -1
- package/cjs/graph/util/env.js +2 -2
- package/cjs/graph/util/env.js.map +1 -1
- package/cjs/graph/util/events-extend.d.ts +1 -1
- package/cjs/graph/util/events-extend.js +1 -1
- package/cjs/graph/util/events-extend.js.map +1 -1
- package/cjs/graph/util/graphic.d.ts +3 -3
- package/cjs/graph/util/graphic.js +21 -21
- package/cjs/graph/util/graphic.js.map +1 -1
- package/cjs/index.d.ts +5 -1
- package/cjs/index.js +13 -3
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/base-tooltip.d.ts +29 -0
- package/cjs/interactions/base-tooltip.js +74 -0
- package/cjs/interactions/base-tooltip.js.map +1 -0
- package/cjs/interactions/base.d.ts +14 -0
- package/cjs/interactions/base.js +41 -0
- package/cjs/interactions/base.js.map +1 -0
- package/cjs/interactions/brush-active.d.ts +17 -0
- package/cjs/interactions/brush-active.js +27 -0
- package/cjs/interactions/brush-active.js.map +1 -0
- package/cjs/interactions/brush-base.d.ts +43 -0
- package/cjs/interactions/brush-base.js +106 -0
- package/cjs/interactions/brush-base.js.map +1 -0
- package/cjs/interactions/brush-filter.d.ts +24 -0
- package/cjs/interactions/brush-filter.js +34 -0
- package/cjs/interactions/brush-filter.js.map +1 -0
- package/cjs/interactions/brush-highlight.d.ts +17 -0
- package/cjs/interactions/brush-highlight.js +34 -0
- package/cjs/interactions/brush-highlight.js.map +1 -0
- package/cjs/interactions/crosshair.d.ts +53 -0
- package/cjs/{component → interactions}/crosshair.js +80 -79
- package/cjs/interactions/crosshair.js.map +1 -0
- package/cjs/interactions/datazoom-filter.d.ts +13 -0
- package/cjs/interactions/datazoom-filter.js +42 -0
- package/cjs/interactions/datazoom-filter.js.map +1 -0
- package/cjs/interactions/dimension-tooltip.d.ts +18 -0
- package/cjs/interactions/dimension-tooltip.js +99 -0
- package/cjs/interactions/dimension-tooltip.js.map +1 -0
- package/cjs/interactions/drill-down.d.ts +25 -0
- package/cjs/interactions/drill-down.js +48 -0
- package/cjs/interactions/drill-down.js.map +1 -0
- package/cjs/interactions/element-active-by-legend.d.ts +17 -0
- package/cjs/interactions/element-active-by-legend.js +44 -0
- package/cjs/interactions/element-active-by-legend.js.map +1 -0
- package/cjs/interactions/element-active.d.ts +16 -0
- package/cjs/interactions/element-active.js +33 -0
- package/cjs/interactions/element-active.js.map +1 -0
- package/cjs/interactions/element-highlight-by-group.d.ts +17 -0
- package/cjs/interactions/element-highlight-by-group.js +53 -0
- package/cjs/interactions/element-highlight-by-group.js.map +1 -0
- package/cjs/interactions/element-highlight-by-key.d.ts +17 -0
- package/cjs/interactions/element-highlight-by-key.js +53 -0
- package/cjs/interactions/element-highlight-by-key.js.map +1 -0
- package/cjs/interactions/element-highlight-by-legend.d.ts +17 -0
- package/cjs/interactions/element-highlight-by-legend.js +47 -0
- package/cjs/interactions/element-highlight-by-legend.js.map +1 -0
- package/cjs/interactions/element-highlight-by-name.d.ts +18 -0
- package/cjs/interactions/element-highlight-by-name.js +59 -0
- package/cjs/interactions/element-highlight-by-name.js.map +1 -0
- package/cjs/interactions/element-highlight.d.ts +17 -0
- package/cjs/interactions/element-highlight.js +48 -0
- package/cjs/interactions/element-highlight.js.map +1 -0
- package/cjs/interactions/element-select.d.ts +18 -0
- package/cjs/interactions/element-select.js +42 -0
- package/cjs/interactions/element-select.js.map +1 -0
- package/cjs/interactions/filter.d.ts +20 -0
- package/cjs/interactions/filter.js +37 -0
- package/cjs/interactions/filter.js.map +1 -0
- package/cjs/interactions/fish-eye.d.ts +38 -0
- package/cjs/interactions/fish-eye.js +109 -0
- package/cjs/interactions/fish-eye.js.map +1 -0
- package/cjs/interactions/index.d.ts +50 -0
- package/cjs/interactions/index.js +386 -0
- package/cjs/interactions/index.js.map +1 -0
- package/cjs/interactions/legend-filter.d.ts +13 -0
- package/cjs/interactions/legend-filter.js +33 -0
- package/cjs/interactions/legend-filter.js.map +1 -0
- package/cjs/interactions/player-filter.d.ts +14 -0
- package/cjs/interactions/player-filter.js +32 -0
- package/cjs/interactions/player-filter.js.map +1 -0
- package/cjs/interactions/roll-up.d.ts +16 -0
- package/cjs/interactions/roll-up.js +47 -0
- package/cjs/interactions/roll-up.js.map +1 -0
- package/cjs/interactions/scrollbar-filter.d.ts +13 -0
- package/cjs/interactions/scrollbar-filter.js +54 -0
- package/cjs/interactions/scrollbar-filter.js.map +1 -0
- package/cjs/interactions/slider-filter.d.ts +13 -0
- package/cjs/interactions/slider-filter.js +32 -0
- package/cjs/interactions/slider-filter.js.map +1 -0
- package/cjs/interactions/tooltip.d.ts +15 -0
- package/cjs/interactions/tooltip.js +62 -0
- package/cjs/interactions/tooltip.js.map +1 -0
- package/cjs/interactions/view-drag-mixin.d.ts +22 -0
- package/cjs/interactions/view-drag-mixin.js +52 -0
- package/cjs/interactions/view-drag-mixin.js.map +1 -0
- package/cjs/interactions/view-drag.d.ts +19 -0
- package/cjs/interactions/view-drag.js +49 -0
- package/cjs/interactions/view-drag.js.map +1 -0
- package/cjs/interactions/view-navigation-base.d.ts +17 -0
- package/cjs/interactions/view-navigation-base.js +81 -0
- package/cjs/interactions/view-navigation-base.js.map +1 -0
- package/cjs/interactions/view-roam.d.ts +30 -0
- package/cjs/interactions/view-roam.js +93 -0
- package/cjs/interactions/view-roam.js.map +1 -0
- package/cjs/interactions/view-scroll-mixin.d.ts +10 -0
- package/cjs/interactions/view-scroll-mixin.js +45 -0
- package/cjs/interactions/view-scroll-mixin.js.map +1 -0
- package/cjs/interactions/view-scroll.d.ts +17 -0
- package/cjs/interactions/view-scroll.js +37 -0
- package/cjs/interactions/view-scroll.js.map +1 -0
- package/cjs/interactions/view-utils.d.ts +14 -0
- package/cjs/interactions/view-utils.js +73 -0
- package/cjs/interactions/view-utils.js.map +1 -0
- package/cjs/interactions/view-zoom-mixin.d.ts +29 -0
- package/cjs/interactions/view-zoom-mixin.js +77 -0
- package/cjs/interactions/view-zoom-mixin.js.map +1 -0
- package/cjs/interactions/view-zoom.d.ts +23 -0
- package/cjs/interactions/view-zoom.js +53 -0
- package/cjs/interactions/view-zoom.js.map +1 -0
- package/cjs/parse/coordinate.js +1 -1
- package/cjs/parse/event.d.ts +2 -0
- package/cjs/parse/event.js +8 -4
- package/cjs/parse/event.js.map +1 -1
- package/cjs/parse/mark.js +1 -1
- package/cjs/parse/option.js +2 -1
- package/cjs/parse/scale.js +1 -1
- package/cjs/parse/transform.js +1 -1
- package/cjs/parse/util.js +1 -1
- package/cjs/parse/view.js +1 -1
- package/cjs/semantic-marks/cell.d.ts +1 -1
- package/cjs/semantic-marks/cell.js +4 -4
- package/cjs/semantic-marks/cell.js.map +1 -1
- package/cjs/semantic-marks/interval.d.ts +1 -1
- package/cjs/semantic-marks/interval.js +1 -1
- package/cjs/semantic-marks/text.js +1 -1
- package/cjs/theme/dark.js +1 -1
- package/cjs/theme/default.js +1 -1
- package/cjs/theme/theme-manager.js +1 -1
- package/cjs/transforms/index.js +1 -1
- package/cjs/transforms/mark/dodge.js +4 -4
- package/cjs/transforms/mark/dodge.js.map +1 -1
- package/cjs/transforms/mark/jitter.js +2 -2
- package/cjs/transforms/mark/jitter.js.map +1 -1
- package/cjs/types/animate.d.ts +1 -1
- package/cjs/types/animate.js +1 -1
- package/cjs/types/animate.js.map +1 -1
- package/cjs/types/base.js +1 -1
- package/cjs/types/component.d.ts +16 -88
- package/cjs/types/component.js +1 -1
- package/cjs/types/component.js.map +1 -1
- package/cjs/types/coordinate.js +1 -1
- package/cjs/types/data.js +2 -1
- package/cjs/types/dataflow.js +1 -1
- package/cjs/types/element.d.ts +1 -1
- package/cjs/types/element.js +1 -1
- package/cjs/types/element.js.map +1 -1
- package/cjs/types/event.d.ts +11 -4
- package/cjs/types/event.js +1 -1
- package/cjs/types/event.js.map +1 -1
- package/cjs/types/glyph.js +1 -1
- package/cjs/types/grammar.d.ts +6 -2
- package/cjs/types/grammar.js +1 -1
- package/cjs/types/grammar.js.map +1 -1
- package/cjs/types/hooks.js +1 -1
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +3 -2
- package/cjs/types/index.js.map +1 -1
- package/cjs/types/interaction.d.ts +353 -0
- package/cjs/types/interaction.js +6 -0
- package/cjs/types/interaction.js.map +1 -0
- package/cjs/types/mark.d.ts +2 -3
- package/cjs/types/mark.js.map +1 -1
- package/cjs/types/morph.d.ts +1 -1
- package/cjs/types/morph.js.map +1 -1
- package/cjs/types/plot.d.ts +1 -1
- package/cjs/types/plot.js.map +1 -1
- package/cjs/types/renderer.d.ts +1 -1
- package/cjs/types/renderer.js.map +1 -1
- package/cjs/types/theme.d.ts +1 -1
- package/cjs/types/theme.js.map +1 -1
- package/cjs/types/view.d.ts +13 -14
- package/cjs/types/view.js.map +1 -1
- package/cjs/util/scale.d.ts +4 -0
- package/cjs/util/scale.js +24 -0
- package/cjs/util/scale.js.map +1 -0
- package/cjs/util/text.d.ts +1 -1
- package/cjs/util/text.js +3 -3
- package/cjs/util/text.js.map +1 -1
- package/cjs/view/View.d.ts +9 -13
- package/cjs/view/View.js +49 -74
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/component.d.ts +2 -6
- package/cjs/view/component.js +1 -19
- package/cjs/view/component.js.map +1 -1
- package/cjs/view/dataflow.js +1 -1
- package/cjs/view/dataflow.js.map +1 -1
- package/cjs/view/events.d.ts +1 -1
- package/cjs/view/mark.d.ts +2 -2
- package/cjs/view/mark.js +12 -10
- package/cjs/view/mark.js.map +1 -1
- package/cjs/view/scale.d.ts +7 -1
- package/cjs/view/scale.js +17 -3
- package/cjs/view/scale.js.map +1 -1
- package/es/component/axis.js.map +1 -1
- package/es/component/datazoom.d.ts +7 -4
- package/es/component/datazoom.js +26 -42
- package/es/component/datazoom.js.map +1 -1
- package/es/component/grid.js.map +1 -1
- package/es/component/index.d.ts +0 -2
- package/es/component/index.js +0 -4
- package/es/component/index.js.map +1 -1
- package/es/component/label.js.map +1 -1
- package/es/component/legend.d.ts +1 -3
- package/es/component/legend.js +11 -26
- package/es/component/legend.js.map +1 -1
- package/es/component/player.d.ts +1 -2
- package/es/component/player.js +17 -30
- package/es/component/player.js.map +1 -1
- package/es/component/scale.d.ts +1 -0
- package/es/component/scale.js +3 -0
- package/es/component/scale.js.map +1 -1
- package/es/component/scrollbar.d.ts +3 -4
- package/es/component/scrollbar.js +17 -53
- package/es/component/scrollbar.js.map +1 -1
- package/es/component/slider.d.ts +2 -5
- package/es/component/slider.js +9 -25
- package/es/component/slider.js.map +1 -1
- package/es/component/title.js.map +1 -1
- package/es/core/factory.d.ts +6 -3
- package/es/core/factory.js +9 -2
- package/es/core/factory.js.map +1 -1
- package/es/env.d.ts +1 -0
- package/es/env.js +1 -0
- package/es/env.js.map +1 -0
- package/es/glyph/index.js +2 -1
- package/es/glyph/link-path.js +1 -2
- package/es/graph/animation/animate.js +24 -19
- package/es/graph/animation/animate.js.map +1 -1
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/es/graph/animation/animator.js +1 -1
- package/es/graph/animation/animator.js.map +1 -1
- package/es/graph/animation/attribute.d.ts +2 -2
- package/es/graph/animation/attribute.js +7 -7
- package/es/graph/animation/attribute.js.map +1 -1
- package/es/graph/animation/morph.js +1 -1
- package/es/graph/animation/morph.js.map +1 -1
- package/es/graph/attributes/index.js +1 -1
- package/es/graph/attributes/index.js.map +1 -1
- package/es/graph/canvas-renderer.d.ts +1 -1
- package/es/graph/canvas-renderer.js +3 -1
- package/es/graph/canvas-renderer.js.map +1 -1
- package/es/graph/element.d.ts +1 -1
- package/es/graph/element.js +3 -3
- package/es/graph/element.js.map +1 -1
- package/es/graph/enums.d.ts +25 -8
- package/es/graph/enums.js +27 -11
- package/es/graph/enums.js.map +1 -1
- package/es/graph/glyph-element.d.ts +1 -1
- package/es/graph/glyph-element.js.map +1 -1
- package/es/graph/mark/encode.d.ts +0 -3
- package/es/graph/mark/encode.js +0 -10
- package/es/graph/mark/encode.js.map +1 -1
- package/es/graph/mark/large-rects.d.ts +2 -2
- package/es/graph/mark/large-rects.js +1 -1
- package/es/graph/mark/large-rects.js.map +1 -1
- package/es/graph/mark/large-symbols.d.ts +2 -2
- package/es/graph/mark/large-symbols.js +1 -1
- package/es/graph/mark/large-symbols.js.map +1 -1
- package/es/graph/util/env.js +1 -1
- package/es/graph/util/env.js.map +1 -1
- package/es/graph/util/events-extend.d.ts +1 -1
- package/es/graph/util/events-extend.js +1 -1
- package/es/graph/util/events-extend.js.map +1 -1
- package/es/graph/util/graphic.d.ts +3 -3
- package/es/graph/util/graphic.js +1 -1
- package/es/graph/util/graphic.js.map +1 -1
- package/es/index.d.ts +5 -1
- package/es/index.js +11 -2
- package/es/index.js.map +1 -1
- package/es/interactions/base-tooltip.d.ts +29 -0
- package/es/interactions/base-tooltip.js +73 -0
- package/es/interactions/base-tooltip.js.map +1 -0
- package/es/interactions/base.d.ts +14 -0
- package/es/interactions/base.js +32 -0
- package/es/interactions/base.js.map +1 -0
- package/es/interactions/brush-active.d.ts +17 -0
- package/es/interactions/brush-active.js +23 -0
- package/es/interactions/brush-active.js.map +1 -0
- package/es/interactions/brush-base.d.ts +43 -0
- package/es/interactions/brush-base.js +103 -0
- package/es/interactions/brush-base.js.map +1 -0
- package/es/interactions/brush-filter.d.ts +24 -0
- package/es/interactions/brush-filter.js +33 -0
- package/es/interactions/brush-filter.js.map +1 -0
- package/es/interactions/brush-highlight.d.ts +17 -0
- package/es/interactions/brush-highlight.js +31 -0
- package/es/interactions/brush-highlight.js.map +1 -0
- package/es/interactions/crosshair.d.ts +53 -0
- package/es/{component → interactions}/crosshair.js +82 -81
- package/es/interactions/crosshair.js.map +1 -0
- package/es/interactions/datazoom-filter.d.ts +13 -0
- package/es/interactions/datazoom-filter.js +40 -0
- package/es/interactions/datazoom-filter.js.map +1 -0
- package/es/interactions/dimension-tooltip.d.ts +18 -0
- package/es/interactions/dimension-tooltip.js +99 -0
- package/es/interactions/dimension-tooltip.js.map +1 -0
- package/es/interactions/drill-down.d.ts +25 -0
- package/es/interactions/drill-down.js +46 -0
- package/es/interactions/drill-down.js.map +1 -0
- package/es/interactions/element-active-by-legend.d.ts +17 -0
- package/es/interactions/element-active-by-legend.js +43 -0
- package/es/interactions/element-active-by-legend.js.map +1 -0
- package/es/interactions/element-active.d.ts +16 -0
- package/es/interactions/element-active.js +29 -0
- package/es/interactions/element-active.js.map +1 -0
- package/es/interactions/element-highlight-by-group.d.ts +17 -0
- package/es/interactions/element-highlight-by-group.js +49 -0
- package/es/interactions/element-highlight-by-group.js.map +1 -0
- package/es/interactions/element-highlight-by-key.d.ts +17 -0
- package/es/interactions/element-highlight-by-key.js +50 -0
- package/es/interactions/element-highlight-by-key.js.map +1 -0
- package/es/interactions/element-highlight-by-legend.d.ts +17 -0
- package/es/interactions/element-highlight-by-legend.js +46 -0
- package/es/interactions/element-highlight-by-legend.js.map +1 -0
- package/es/interactions/element-highlight-by-name.d.ts +18 -0
- package/es/interactions/element-highlight-by-name.js +56 -0
- package/es/interactions/element-highlight-by-name.js.map +1 -0
- package/es/interactions/element-highlight.d.ts +17 -0
- package/es/interactions/element-highlight.js +43 -0
- package/es/interactions/element-highlight.js.map +1 -0
- package/es/interactions/element-select.d.ts +18 -0
- package/es/interactions/element-select.js +38 -0
- package/es/interactions/element-select.js.map +1 -0
- package/es/interactions/filter.d.ts +20 -0
- package/es/interactions/filter.js +31 -0
- package/es/interactions/filter.js.map +1 -0
- package/es/interactions/fish-eye.d.ts +38 -0
- package/es/interactions/fish-eye.js +105 -0
- package/es/interactions/fish-eye.js.map +1 -0
- package/es/interactions/index.d.ts +50 -0
- package/es/interactions/index.js +149 -0
- package/es/interactions/index.js.map +1 -0
- package/es/interactions/legend-filter.d.ts +13 -0
- package/es/interactions/legend-filter.js +32 -0
- package/es/interactions/legend-filter.js.map +1 -0
- package/es/interactions/player-filter.d.ts +14 -0
- package/es/interactions/player-filter.js +32 -0
- package/es/interactions/player-filter.js.map +1 -0
- package/es/interactions/roll-up.d.ts +16 -0
- package/es/interactions/roll-up.js +45 -0
- package/es/interactions/roll-up.js.map +1 -0
- package/es/interactions/scrollbar-filter.d.ts +13 -0
- package/es/interactions/scrollbar-filter.js +50 -0
- package/es/interactions/scrollbar-filter.js.map +1 -0
- package/es/interactions/slider-filter.d.ts +13 -0
- package/es/interactions/slider-filter.js +29 -0
- package/es/interactions/slider-filter.js.map +1 -0
- package/es/interactions/tooltip.d.ts +15 -0
- package/es/interactions/tooltip.js +58 -0
- package/es/interactions/tooltip.js.map +1 -0
- package/es/interactions/view-drag-mixin.d.ts +22 -0
- package/es/interactions/view-drag-mixin.js +46 -0
- package/es/interactions/view-drag-mixin.js.map +1 -0
- package/es/interactions/view-drag.d.ts +19 -0
- package/es/interactions/view-drag.js +47 -0
- package/es/interactions/view-drag.js.map +1 -0
- package/es/interactions/view-navigation-base.d.ts +17 -0
- package/es/interactions/view-navigation-base.js +78 -0
- package/es/interactions/view-navigation-base.js.map +1 -0
- package/es/interactions/view-roam.d.ts +30 -0
- package/es/interactions/view-roam.js +91 -0
- package/es/interactions/view-roam.js.map +1 -0
- package/es/interactions/view-scroll-mixin.d.ts +10 -0
- package/es/interactions/view-scroll-mixin.js +37 -0
- package/es/interactions/view-scroll-mixin.js.map +1 -0
- package/es/interactions/view-scroll.d.ts +17 -0
- package/es/interactions/view-scroll.js +35 -0
- package/es/interactions/view-scroll.js.map +1 -0
- package/es/interactions/view-utils.d.ts +14 -0
- package/es/interactions/view-utils.js +60 -0
- package/es/interactions/view-utils.js.map +1 -0
- package/es/interactions/view-zoom-mixin.d.ts +29 -0
- package/es/interactions/view-zoom-mixin.js +68 -0
- package/es/interactions/view-zoom-mixin.js.map +1 -0
- package/es/interactions/view-zoom.d.ts +23 -0
- package/es/interactions/view-zoom.js +51 -0
- package/es/interactions/view-zoom.js.map +1 -0
- package/es/parse/event.d.ts +2 -0
- package/es/parse/event.js +5 -1
- package/es/parse/event.js.map +1 -1
- package/es/parse/option.js +2 -1
- package/es/parse/scale.js +1 -2
- package/es/semantic-marks/cell.d.ts +1 -1
- package/es/semantic-marks/cell.js +4 -2
- package/es/semantic-marks/cell.js.map +1 -1
- package/es/semantic-marks/interval.d.ts +1 -1
- package/es/semantic-marks/interval.js +1 -1
- package/es/semantic-marks/text.js +1 -1
- package/es/theme/dark.js +1 -1
- package/es/theme/default.js +1 -1
- package/es/theme/theme-manager.js +1 -1
- package/es/transforms/index.js +1 -1
- package/es/transforms/mark/dodge.js +2 -2
- package/es/transforms/mark/dodge.js.map +1 -1
- package/es/transforms/mark/jitter.js +2 -2
- package/es/transforms/mark/jitter.js.map +1 -1
- package/es/types/animate.d.ts +1 -1
- package/es/types/animate.js +1 -1
- package/es/types/animate.js.map +1 -1
- package/es/types/base.js +1 -1
- package/es/types/component.d.ts +16 -88
- package/es/types/component.js +1 -1
- package/es/types/component.js.map +1 -1
- package/es/types/coordinate.js +1 -1
- package/es/types/data.js +2 -1
- package/es/types/dataflow.js +1 -1
- package/es/types/element.d.ts +1 -1
- package/es/types/element.js +1 -1
- package/es/types/element.js.map +1 -1
- package/es/types/event.d.ts +11 -4
- package/es/types/event.js +1 -1
- package/es/types/event.js.map +1 -1
- package/es/types/glyph.js +1 -1
- package/es/types/grammar.d.ts +6 -2
- package/es/types/grammar.js +1 -1
- package/es/types/grammar.js.map +1 -1
- package/es/types/hooks.js +1 -1
- package/es/types/index.d.ts +1 -0
- package/es/types/index.js +3 -1
- package/es/types/index.js.map +1 -1
- package/es/types/interaction.d.ts +353 -0
- package/es/types/interaction.js +2 -0
- package/es/types/interaction.js.map +1 -0
- package/es/types/mark.d.ts +2 -3
- package/es/types/mark.js.map +1 -1
- package/es/types/morph.d.ts +1 -1
- package/es/types/morph.js.map +1 -1
- package/es/types/plot.d.ts +1 -1
- package/es/types/plot.js.map +1 -1
- package/es/types/renderer.d.ts +1 -1
- package/es/types/renderer.js.map +1 -1
- package/es/types/theme.d.ts +1 -1
- package/es/types/theme.js.map +1 -1
- package/es/types/view.d.ts +13 -14
- package/es/types/view.js.map +1 -1
- package/es/util/scale.d.ts +4 -0
- package/es/util/scale.js +15 -0
- package/es/util/scale.js.map +1 -0
- package/es/util/text.d.ts +1 -1
- package/es/util/text.js +1 -1
- package/es/util/text.js.map +1 -1
- package/es/view/View.d.ts +9 -13
- package/es/view/View.js +49 -69
- package/es/view/View.js.map +1 -1
- package/es/view/component.d.ts +2 -6
- package/es/view/component.js +0 -20
- package/es/view/component.js.map +1 -1
- package/es/view/dataflow.js +1 -1
- package/es/view/dataflow.js.map +1 -1
- package/es/view/events.d.ts +1 -1
- package/es/view/mark.d.ts +2 -2
- package/es/view/mark.js +12 -10
- package/es/view/mark.js.map +1 -1
- package/es/view/scale.d.ts +7 -1
- package/es/view/scale.js +17 -2
- package/es/view/scale.js.map +1 -1
- package/package.json +9 -8
- package/cjs/component/crosshair.d.ts +0 -50
- package/cjs/component/crosshair.js.map +0 -1
- package/cjs/component/tooltip.d.ts +0 -62
- package/cjs/component/tooltip.js +0 -305
- package/cjs/component/tooltip.js.map +0 -1
- package/es/component/crosshair.d.ts +0 -50
- package/es/component/crosshair.js.map +0 -1
- package/es/component/tooltip.d.ts +0 -62
- package/es/component/tooltip.js +0 -303
- package/es/component/tooltip.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/brush-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EACL,mBAAmB,EAGnB,uBAAuB,EACvB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,OAAgB,SAAkC,SAAQ,eAAkB;IAKhF,YAAY,IAAW,EAAE,OAAW;QAClC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QA0HvB,oBAAe,GAAG,GAAG,EAAE;;YACrB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACzC,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,KAAK,EAAE;gBAC7B,OAAO;aACR;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YAEvC,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,CAAC;gBAC1B,gBAAgB,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,gBAAgB,mCAAI;oBACjD,IAAI,EAAE,OAAO,CAAC,EAAE;oBAChB,IAAI,EAAE,OAAO,CAAC,EAAE;oBAChB,IAAI,EAAE,OAAO,CAAC,EAAE;oBAChB,IAAI,EAAE,OAAO,CAAC,EAAE;iBACjB;gBACD,MAAM,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAI,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;gBACvD,MAAM,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,mCAAI,C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AAK,EAAE;gBACtB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aAC5B;SACF;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACrC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;gBACxB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aAC9B;SACF;IACH,CAAC;CACF","file":"brush-base.js","sourcesContent":["import { Brush, IOperateType } from '@visactor/vrender-components';\nimport type { BrushOptions, IElement, IGlyphElement, IMark, IView, InteractionEventHandler } from '../types';\nimport { BaseInteraction } from './base';\nimport type { IGraphic, IPolygon, IRectGraphicAttribute } from '@visactor/vrender-core';\nimport {\n polygonContainPoint,\n type IBounds,\n type IPointLike,\n polygonIntersectPolygon,\n isRectIntersect\n} from '@visactor/vutils';\nimport { HOOK_EVENT } from '../graph';\n\nexport abstract class BrushBase<T extends BrushOptions> extends BaseInteraction<T> {\n options: T;\n protected _brushComp?: Brush;\n protected _marks?: IMark[];\n\n constructor(view: IView, options?: T) {\n super(view, options);\n this.options = options;\n this._marks = view.getMarksBySelector(this.options.selector);\n }\n\n protected getEvents(): Array<{ type: string; handler: InteractionEventHandler }> {\n return [\n {\n type: HOOK_EVENT.BEFORE_DO_RENDER,\n handler: this.handleAfterDraw\n }\n ];\n }\n\n protected isPolygonBrushContainGraphicItem(\n brushMask: IPolygon,\n graphicItem: IGraphic,\n offset?: { x: number; y: number }\n ) {\n // 根据变换矩阵得到brushMask的实际坐标\n const points = brushMask.attribute.points;\n const { a, b, c, d, e, f } = brushMask.globalTransMatrix;\n\n const dx = offset?.x ?? 0;\n const dy = offset?.y ?? 0;\n\n const pointsCoord = points.map((p: IPointLike) => {\n return {\n x: a * p.x + c * p.y + e + dx,\n y: b * p.x + d * p.y + f + dy\n };\n });\n\n const globalAABBBoundsOffset = brushMask.globalAABBBounds\n .clone()\n .set(\n brushMask.globalAABBBounds.x1 + dx,\n brushMask.globalAABBBounds.y1 + dy,\n brushMask.globalAABBBounds.x2 + dx,\n brushMask.globalAABBBounds.y2 + dy\n );\n\n // 根据变换矩阵得到item的实际坐标\n const x = graphicItem.globalTransMatrix.e;\n const y = graphicItem.globalTransMatrix.f;\n\n // brush与图表图元进行相交 或 包含判断\n if (graphicItem.type === 'symbol' || graphicItem.type === 'circle') {\n return globalAABBBoundsOffset.contains(x, y) && polygonContainPoint(pointsCoord, x, y);\n } else if (graphicItem.type === 'rect') {\n const { width = 0, height = 0 } = graphicItem?.attribute as IRectGraphicAttribute;\n const pointsRect = [\n {\n x: x,\n y: y\n },\n {\n x: x + width,\n y: y\n },\n {\n x: x + width,\n y: y + height\n },\n {\n x: x,\n y: y + height\n }\n ];\n return polygonIntersectPolygon(pointsCoord, pointsRect);\n }\n return brushMask.globalAABBBounds.intersects(graphicItem.globalAABBBounds);\n }\n\n protected isRectBrushContainGraphicItem(\n brushMask: IPolygon,\n graphicItem: IGraphic,\n offset?: { x: number; y: number }\n ) {\n const dx = offset?.x ?? 0;\n const dy = offset?.y ?? 0;\n\n const globalAABBBoundsOffset = brushMask.globalAABBBounds\n .clone()\n .set(\n brushMask.globalAABBBounds.x1 + dx,\n brushMask.globalAABBBounds.y1 + dy,\n brushMask.globalAABBBounds.x2 + dx,\n brushMask.globalAABBBounds.y2 + dy\n );\n\n // 根据变换矩阵得到item的实际坐标\n const x = graphicItem.globalTransMatrix.e;\n const y = graphicItem.globalTransMatrix.f;\n\n // brush与图表图元进行相交 或 包含判断\n if (graphicItem.type === 'symbol' || graphicItem.type === 'circle') {\n return globalAABBBoundsOffset.contains(x, y);\n } else if (graphicItem.type === 'rect') {\n const { width = 0, height = 0 } = graphicItem?.attribute as IRectGraphicAttribute;\n return isRectIntersect(globalAABBBoundsOffset, { x1: x, y1: y, x2: x + width, y2: y + height }, false);\n }\n return brushMask.globalAABBBounds.intersects(graphicItem.globalAABBBounds);\n }\n\n protected isBrushContainGraphicItem(brushMask: IPolygon, graphicItem: IGraphic, offset?: { x: number; y: number }) {\n if (\n !brushMask?.globalTransMatrix ||\n !brushMask.globalAABBBounds ||\n brushMask.globalAABBBounds.empty() ||\n !graphicItem ||\n !brushMask?.attribute?.points ||\n brushMask.attribute.points.length <= 1\n ) {\n return false;\n }\n\n return this.options.brushType === 'polygon'\n ? this.isPolygonBrushContainGraphicItem(brushMask, graphicItem, offset)\n : this.isRectBrushContainGraphicItem(brushMask, graphicItem, offset);\n }\n\n handleAfterDraw = () => {\n const stage = this.view.renderer.stage();\n if (this._brushComp || !stage) {\n return;\n }\n\n const viewBox = this.view.getViewBox();\n\n this._brushComp = new Brush({\n interactiveRange: this.options.interactiveRange ?? {\n minX: viewBox.x1,\n maxX: viewBox.x2,\n minY: viewBox.y1,\n maxY: viewBox.y2\n },\n xRange: this.options.xRange ?? [viewBox.x1, viewBox.x2],\n yRange: this.options.yRange ?? [viewBox.y1, viewBox.y2],\n brushMode: this.options.brushMode ?? 'single',\n brushType: this.options.brushType,\n brushStyle: this.options.brushStyle,\n brushMoved: this.options.brushMoved,\n removeOnClick: this.options.removeOnClick,\n sizeThreshold: this.options.sizeThreshold,\n delayType: this.options.delayType,\n delayTime: this.options.delayTime\n });\n this._brushComp.setUpdateDragMaskCallback(this.handleBrushUpdate);\n\n (stage.defaultLayer as any).appendChild(this._brushComp);\n };\n\n abstract handleBrushUpdate: (options: {\n operateType: string;\n operateMask: IPolygon;\n operatedMaskAABBBounds: { [name: string]: IBounds };\n }) => void;\n\n unbind(): void {\n super.unbind();\n\n if (this._brushComp) {\n this._brushComp.releaseBrushEvents();\n this._brushComp.release();\n this._brushComp = null;\n }\n }\n\n protected dispatchEvent(\n options: {\n operateType: string;\n operateMask: IPolygon;\n operatedMaskAABBBounds: { [name: string]: IBounds };\n },\n activeElements: (IElement | IGlyphElement)[]\n ) {\n const params = { operateType: options.operateType, operateMask: options.operateMask, activeElements };\n if (options.operateType === IOperateType.drawStart || options.operateType === IOperateType.moveStart) {\n this.view.emit('brushStart', params);\n if (this.options.onStart) {\n this.options.onStart(params);\n }\n } else if (options.operateType === IOperateType.drawing || options.operateType === IOperateType.moving) {\n this.view.emit('brushUpdate', params);\n if (this.options.onUpdate) {\n this.options.onEnd(params);\n }\n } else if (options.operateType === IOperateType.drawEnd || options.operateType === IOperateType.moveEnd) {\n this.view.emit('brushEnd', params);\n if (this.options.onEnd) {\n this.options.onEnd(params);\n }\n } else {\n this.view.emit('brushReset', params);\n if (this.options.onReset) {\n this.options.onReset(params);\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IPolygon } from '@visactor/vrender-core';
|
|
2
|
+
import type { BrushFilterOptions, IView } from '../types';
|
|
3
|
+
import { BrushBase } from './brush-base';
|
|
4
|
+
import { type IBounds } from '@visactor/vutils';
|
|
5
|
+
import type { FilterMixin } from './filter';
|
|
6
|
+
export interface BrushFilter extends Pick<FilterMixin, '_data' | '_filterValue' | '_dataFilter' | 'handleFilter' | '_filterData'>, BrushBase<BrushFilterOptions> {
|
|
7
|
+
}
|
|
8
|
+
export declare class BrushFilter extends BrushBase<BrushFilterOptions> {
|
|
9
|
+
static type: string;
|
|
10
|
+
type: string;
|
|
11
|
+
static defaultOptions: Omit<BrushFilterOptions, 'target'>;
|
|
12
|
+
constructor(view: IView, option?: BrushFilterOptions);
|
|
13
|
+
protected getEvents(): {
|
|
14
|
+
type: string;
|
|
15
|
+
handler: import("../types").InteractionEventHandler;
|
|
16
|
+
}[];
|
|
17
|
+
handleBrushUpdate: (options: {
|
|
18
|
+
operateType: string;
|
|
19
|
+
operateMask: IPolygon;
|
|
20
|
+
operatedMaskAABBBounds: {
|
|
21
|
+
[name: string]: IBounds;
|
|
22
|
+
};
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BrushBase } from "./brush-base";
|
|
2
|
+
|
|
3
|
+
import { isString, array } from "@visactor/vutils";
|
|
4
|
+
|
|
5
|
+
import { DataFilterRank } from "../graph";
|
|
6
|
+
|
|
7
|
+
export class BrushFilter extends BrushBase {
|
|
8
|
+
constructor(view, option) {
|
|
9
|
+
super(view, Object.assign({}, BrushFilter.defaultOptions, option)), this.type = BrushFilter.type,
|
|
10
|
+
this.handleBrushUpdate = options => {
|
|
11
|
+
const elements = [];
|
|
12
|
+
let filterValue = [];
|
|
13
|
+
this._marks.forEach((mark => {
|
|
14
|
+
mark.elements.forEach((el => {
|
|
15
|
+
this.isBrushContainGraphicItem(options.operateMask, el.getGraphicItem()) && (elements.push(el),
|
|
16
|
+
filterValue = filterValue.concat(array(el.getDatum())));
|
|
17
|
+
}));
|
|
18
|
+
})), this._data && (filterValue = Array.from(new Set(filterValue)), this._filterValue && filterValue.length === this._filterValue.length && !filterValue.some((datum => !this._filterValue.includes(datum))) || (this._filterValue = filterValue,
|
|
19
|
+
this.handleFilter())), this.dispatchEvent(options, elements);
|
|
20
|
+
}, this._data = isString(this.options.target.data) ? view.getDataById(this.options.target.data) : this.options.target.data;
|
|
21
|
+
}
|
|
22
|
+
getEvents() {
|
|
23
|
+
if (!this._data) return [];
|
|
24
|
+
const transform = this.options.target.transform;
|
|
25
|
+
return this._filterData(this._data, null, DataFilterRank.brush, null, void 0, ((data, filterValue) => {
|
|
26
|
+
const nextData = filterValue || data;
|
|
27
|
+
return transform ? transform(data, filterValue) : nextData;
|
|
28
|
+
})), super.getEvents();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
BrushFilter.type = "brush-filter", BrushFilter.defaultOptions = {};
|
|
33
|
+
//# sourceMappingURL=brush-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/brush-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAgB,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjE,OA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,WAAW,CAAC;oBAChC,IAAI,CAAC,YAAY,EAAE,CAAC;iBACrB;aACF;YAED,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC;QAzDA,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;YAC7C,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;YAC5C,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAC/B,CAAC;IAES,SAAS;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,EAAE,CAAC;SACX;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAChD,MAAM,aAAa,GAAG,CAAC,IAAW,EAAE,WAAgB,EAAE,EAAE;YACtD,MAAM,QAAQ,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;YACnD,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC7D,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAEzF,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;;AA1BM,gBAAI,GAAW,cAAc,CAAC;AAG9B,0BAAc,GAAuC,EAAE,CAAC","file":"brush-filter.js","sourcesContent":["import type { IPolygon } from '@visactor/vrender-core';\nimport type { BrushFilterOptions, IElement, IGlyphElement, IView } from '../types';\nimport { BrushBase } from './brush-base';\nimport { isString, type IBounds, array } from '@visactor/vutils';\nimport { DataFilterRank } from '../graph';\nimport type { FilterMixin } from './filter';\n\nexport interface BrushFilter\n extends Pick<FilterMixin, '_data' | '_filterValue' | '_dataFilter' | 'handleFilter' | '_filterData'>,\n BrushBase<BrushFilterOptions> {}\n\nexport class BrushFilter extends BrushBase<BrushFilterOptions> {\n static type: string = 'brush-filter';\n type: string = BrushFilter.type;\n\n static defaultOptions: Omit<BrushFilterOptions, 'target'> = {};\n\n constructor(view: IView, option?: BrushFilterOptions) {\n super(view, Object.assign({}, BrushFilter.defaultOptions, option));\n this._data = isString(this.options.target.data)\n ? view.getDataById(this.options.target.data)\n : this.options.target.data;\n }\n\n protected getEvents() {\n if (!this._data) {\n return [];\n }\n\n const transform = this.options.target.transform;\n const dataTransform = (data: any[], filterValue: any) => {\n const nextData = !filterValue ? data : filterValue;\n return transform ? transform(data, filterValue) : nextData;\n };\n\n this._filterData(this._data, null, DataFilterRank.brush, null, undefined, dataTransform);\n\n return super.getEvents();\n }\n\n handleBrushUpdate = (options: {\n operateType: string;\n operateMask: IPolygon;\n operatedMaskAABBBounds: { [name: string]: IBounds };\n }) => {\n const elements: (IElement | IGlyphElement)[] = [];\n\n let filterValue: any[] = [];\n\n this._marks.forEach(mark => {\n mark.elements.forEach(el => {\n const isActive = this.isBrushContainGraphicItem(options.operateMask, el.getGraphicItem());\n\n if (isActive) {\n elements.push(el);\n filterValue = filterValue.concat(array(el.getDatum()));\n }\n });\n });\n\n if (this._data) {\n // remove repeated datum\n filterValue = Array.from(new Set(filterValue));\n\n // shallow compare\n if (\n !this._filterValue ||\n filterValue.length !== this._filterValue.length ||\n filterValue.some(datum => !this._filterValue.includes(datum))\n ) {\n this._filterValue = filterValue;\n this.handleFilter();\n }\n }\n\n this.dispatchEvent(options, elements);\n };\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IPolygon } from '@visactor/vrender-core';
|
|
2
|
+
import type { BrushHighlightOptions, IView } from '../types';
|
|
3
|
+
import { BrushBase } from './brush-base';
|
|
4
|
+
import { type IBounds } from '@visactor/vutils';
|
|
5
|
+
export declare class BrushHighlight extends BrushBase<BrushHighlightOptions> {
|
|
6
|
+
static type: string;
|
|
7
|
+
type: string;
|
|
8
|
+
static defaultOptions: BrushHighlightOptions;
|
|
9
|
+
constructor(view: IView, option?: BrushHighlightOptions);
|
|
10
|
+
handleBrushUpdate: (options: {
|
|
11
|
+
operateType: string;
|
|
12
|
+
operateMask: IPolygon;
|
|
13
|
+
operatedMaskAABBBounds: {
|
|
14
|
+
[name: string]: IBounds;
|
|
15
|
+
};
|
|
16
|
+
}) => void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InteractionStateEnum } from "../graph/enums";
|
|
2
|
+
|
|
3
|
+
import { BrushBase } from "./brush-base";
|
|
4
|
+
|
|
5
|
+
import { IOperateType } from "@visactor/vrender-components";
|
|
6
|
+
|
|
7
|
+
export class BrushHighlight extends BrushBase {
|
|
8
|
+
constructor(view, option) {
|
|
9
|
+
super(view, Object.assign({}, BrushHighlight.defaultOptions, option)), this.type = BrushHighlight.type,
|
|
10
|
+
this.handleBrushUpdate = options => {
|
|
11
|
+
const elements = [];
|
|
12
|
+
options.operateType === IOperateType.brushClear ? this._marks.forEach((mark => {
|
|
13
|
+
mark.elements.forEach((el => {
|
|
14
|
+
el.removeState(this.options.blurState), el.removeState(this.options.highlightState);
|
|
15
|
+
}));
|
|
16
|
+
})) : this._marks.forEach((mark => {
|
|
17
|
+
mark.elements.forEach((el => {
|
|
18
|
+
this.isBrushContainGraphicItem(options.operateMask, el.getGraphicItem()) ? (elements.push(el),
|
|
19
|
+
el.removeState(this.options.blurState), el.addState(this.options.highlightState)) : (el.removeState(this.options.highlightState),
|
|
20
|
+
el.addState(this.options.blurState));
|
|
21
|
+
}));
|
|
22
|
+
})), this.dispatchEvent(options, elements);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
BrushHighlight.type = "brush-highlight", BrushHighlight.defaultOptions = {
|
|
28
|
+
highlightState: InteractionStateEnum.highlight,
|
|
29
|
+
blurState: InteractionStateEnum.blur
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=brush-highlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/brush-highlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,OAAO,cAAe,SAAQ,SAAgC;IASlE,YAAY,IAAW,EAAE,MAA8B;QACrD,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;QARxE,SAAI,GAAW,cAAc,CAAC,IAAI,CAAC;QAWnC,sBAAiB,GAAG,CAAC,OAIpB,EAAE,EAAE;YACH,MAAM,QAAQ,GAAiC,EAAE,CAAC;YAElD,IAAI,OAAO,CAAC,WAAW,KAAK,YAAY,CAAC,UAAU,EAAE;gBACnD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oBACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;wBACzB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;wBACvC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;oBAC9C,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;aACJ;iBAAM;gBACL,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oBACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;wBACzB,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;wBAE7F,IAAI,WAAW,EAAE;4BACf,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;4BAClB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;4BACvC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;yBAC1C;6BAAM;4BACL,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;4BAC5C,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;yBACrC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;aACJ;YAED,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC;IAlCF,CAAC;;AAVM,mBAAI,GAAW,iBAAiB,CAAC;AAGjC,6BAAc,GAA0B;IAC7C,cAAc,EAAE,oBAAoB,CAAC,SAAS;IAC9C,SAAS,EAAE,oBAAoB,CAAC,IAAI;CACrC,CAAC","file":"brush-highlight.js","sourcesContent":["import type { IPolygon } from '@visactor/vrender-core';\nimport { InteractionStateEnum } from '../graph/enums';\nimport type { BrushHighlightOptions, IElement, IGlyphElement, IView } from '../types';\nimport { BrushBase } from './brush-base';\nimport { type IBounds } from '@visactor/vutils';\nimport { IOperateType } from '@visactor/vrender-components';\n\nexport class BrushHighlight extends BrushBase<BrushHighlightOptions> {\n static type: string = 'brush-highlight';\n type: string = BrushHighlight.type;\n\n static defaultOptions: BrushHighlightOptions = {\n highlightState: InteractionStateEnum.highlight,\n blurState: InteractionStateEnum.blur\n };\n\n constructor(view: IView, option?: BrushHighlightOptions) {\n super(view, Object.assign({}, BrushHighlight.defaultOptions, option));\n }\n\n handleBrushUpdate = (options: {\n operateType: string;\n operateMask: IPolygon;\n operatedMaskAABBBounds: { [name: string]: IBounds };\n }) => {\n const elements: (IElement | IGlyphElement)[] = [];\n\n if (options.operateType === IOperateType.brushClear) {\n this._marks.forEach(mark => {\n mark.elements.forEach(el => {\n el.removeState(this.options.blurState);\n el.removeState(this.options.highlightState);\n });\n });\n } else {\n this._marks.forEach(mark => {\n mark.elements.forEach(el => {\n const isHighlight = this.isBrushContainGraphicItem(options.operateMask, el.getGraphicItem());\n\n if (isHighlight) {\n elements.push(el);\n el.removeState(this.options.blurState);\n el.addState(this.options.highlightState);\n } else {\n el.removeState(this.options.highlightState);\n el.addState(this.options.blurState);\n }\n });\n });\n }\n\n this.dispatchEvent(options, elements);\n };\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { IPointLike } from '@visactor/vutils';
|
|
2
|
+
import type { CircleCrosshairAttrs, LineCrosshairAttrs, PolygonCrosshairAttrs, RectCrosshairAttrs, SectorCrosshairAttrs } from '@visactor/vrender-components';
|
|
3
|
+
import { CircleCrosshair, LineCrosshair, PolygonCrosshair, RectCrosshair, SectorCrosshair } from '@visactor/vrender-components';
|
|
4
|
+
import type { CrosshairOptions, CrosshairType, IGroupMark, ITheme, IView, InteractionEvent, RecursivePartial } from '../types';
|
|
5
|
+
import { BaseInteraction } from './base';
|
|
6
|
+
import { CrosshairEnum } from '../graph';
|
|
7
|
+
import type { IBaseScale } from '@visactor/vscale';
|
|
8
|
+
type CrosshairComponent = CircleCrosshair | LineCrosshair | PolygonCrosshair | RectCrosshair | SectorCrosshair;
|
|
9
|
+
export declare const generateLineCrosshairAttributes: (point: IPointLike, scale: IBaseScale, type: CrosshairType, groupSize: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}, config: any, theme?: ITheme, addition?: RecursivePartial<LineCrosshairAttrs> & any) => LineCrosshairAttrs;
|
|
13
|
+
export declare const generateRectCrosshairAttributes: (point: IPointLike, scale: IBaseScale, type: CrosshairType, groupSize: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}, config: any, theme?: ITheme, addition?: RecursivePartial<RectCrosshairAttrs>) => RectCrosshairAttrs;
|
|
17
|
+
export declare const generateRingCrosshairAttributes: (point: IPointLike, scale: IBaseScale, type: CrosshairType, groupSize: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}, config: any, theme?: ITheme, addition?: RecursivePartial<SectorCrosshairAttrs>) => SectorCrosshairAttrs;
|
|
21
|
+
export declare const generateSectorCrosshairAttributes: (point: IPointLike, scale: IBaseScale, type: CrosshairType, groupSize: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
}, config: any, theme?: ITheme, addition?: RecursivePartial<SectorCrosshairAttrs>) => SectorCrosshairAttrs;
|
|
25
|
+
export declare const generateCircleCrosshairAttributes: (point: IPointLike, scale: IBaseScale, type: CrosshairType, groupSize: {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
}, config: any, theme?: ITheme, addition?: RecursivePartial<CircleCrosshairAttrs>) => CircleCrosshairAttrs;
|
|
29
|
+
export declare const generatePolygonCrosshairAttributes: (point: IPointLike, scale: IBaseScale, type: CrosshairType, groupSize: {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
}, config: any, theme?: ITheme, addition?: RecursivePartial<PolygonCrosshairAttrs>) => PolygonCrosshairAttrs;
|
|
33
|
+
export declare class Crosshair extends BaseInteraction<CrosshairOptions> {
|
|
34
|
+
static type: string;
|
|
35
|
+
type: string;
|
|
36
|
+
options: CrosshairOptions;
|
|
37
|
+
static defaultOptions: Omit<CrosshairOptions, 'target'>;
|
|
38
|
+
protected _crosshairComponent?: CrosshairComponent;
|
|
39
|
+
protected _crosshairComponentType?: keyof typeof CrosshairEnum;
|
|
40
|
+
protected _container: IGroupMark;
|
|
41
|
+
constructor(view: IView, options?: CrosshairOptions);
|
|
42
|
+
protected getEvents(): {
|
|
43
|
+
type: import("../types").EventType;
|
|
44
|
+
handler: (event: InteractionEvent) => void;
|
|
45
|
+
}[];
|
|
46
|
+
protected handleCrosshairShow: (event: InteractionEvent) => void;
|
|
47
|
+
protected handleCrosshairHide: () => void;
|
|
48
|
+
protected getCrosshairComponentType(): "lineCrosshair" | "rectCrosshair" | "sectorCrosshair" | "circleCrosshair" | "polygonCrosshair" | "ringCrosshair";
|
|
49
|
+
protected getDefaultCrosshairAttribute(): any;
|
|
50
|
+
bind(): void;
|
|
51
|
+
unbind(): void;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -2,15 +2,13 @@ import { clampRadian, getAngleByPoint, isString, merge } from "@visactor/vutils"
|
|
|
2
2
|
|
|
3
3
|
import { CircleCrosshair, LineCrosshair, PolygonCrosshair, RectCrosshair, SectorCrosshair } from "@visactor/vrender-components";
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { ComponentEnum, CrosshairEnum } from "../graph";
|
|
5
|
+
import { BaseInteraction } from "./base";
|
|
8
6
|
|
|
9
|
-
import {
|
|
7
|
+
import { CrosshairEnum } from "../graph";
|
|
10
8
|
|
|
11
|
-
import {
|
|
9
|
+
import { isContinuous, isDiscrete } from "@visactor/vscale";
|
|
12
10
|
|
|
13
|
-
import {
|
|
11
|
+
import { invokeFunctionType } from "../parse/util";
|
|
14
12
|
|
|
15
13
|
const computeCrosshairStartEnd = (point, scale, type, groupSize, config, offset = 0) => {
|
|
16
14
|
var _a, _b;
|
|
@@ -143,22 +141,29 @@ export const generatePolygonCrosshairAttributes = (point, scale, type, groupSize
|
|
|
143
141
|
}, null != addition ? addition : {});
|
|
144
142
|
};
|
|
145
143
|
|
|
146
|
-
export class Crosshair extends
|
|
147
|
-
constructor(view,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
export class Crosshair extends BaseInteraction {
|
|
145
|
+
constructor(view, options) {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
super(view, options), this.type = Crosshair.type, this.handleCrosshairShow = event => {
|
|
148
|
+
var _a;
|
|
149
|
+
if (!this._crosshairComponent) return;
|
|
150
|
+
const groupGraphicItem = this._container.getGroupGraphicItem(), point = {
|
|
152
151
|
x: 0,
|
|
153
152
|
y: 0
|
|
153
|
+
}, globalTransMatrix = groupGraphicItem.globalTransMatrix, containerPoint = {
|
|
154
|
+
x: globalTransMatrix.e,
|
|
155
|
+
y: globalTransMatrix.f
|
|
154
156
|
};
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
+
if (globalTransMatrix.transformPoint(event.canvas, point), point.x < 0 || point.x > groupGraphicItem.attribute.width || point.y < 0 || point.y > groupGraphicItem.attribute.height) return void this._crosshairComponent.hideAll();
|
|
158
|
+
const crosshairType = null !== (_a = this.options.crosshairType) && void 0 !== _a ? _a : "x", groupSize = {
|
|
157
159
|
width: groupGraphicItem.attribute.width,
|
|
158
160
|
height: groupGraphicItem.attribute.height
|
|
159
|
-
}, scale = (isString(this.
|
|
161
|
+
}, scale = (isString(this.options.scale) ? this.view.getScaleById(this.options.scale) : this.options.scale).getScale(), config = {
|
|
162
|
+
center: this.options.center,
|
|
163
|
+
radius: this.options.radius
|
|
164
|
+
}, theme = this.view.getCurrentTheme(), addition = invokeFunctionType(this.options.attributes, this.parameters(), {}, {});
|
|
160
165
|
let attributes = {};
|
|
161
|
-
switch (this.
|
|
166
|
+
switch (this.getCrosshairComponentType()) {
|
|
162
167
|
case CrosshairEnum.lineCrosshair:
|
|
163
168
|
attributes = generateLineCrosshairAttributes(point, scale, crosshairType, groupSize, config, theme, addition);
|
|
164
169
|
break;
|
|
@@ -182,72 +187,37 @@ export class Crosshair extends ScaleComponent {
|
|
|
182
187
|
case CrosshairEnum.ringCrosshair:
|
|
183
188
|
attributes = generateRingCrosshairAttributes(point, scale, 0, groupSize, config, theme, addition);
|
|
184
189
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
this.
|
|
190
|
-
}
|
|
191
|
-
parseAddition(spec) {
|
|
192
|
-
return super.parseAddition(spec), this.crosshairType(spec.crosshairType), this.crosshairShape(spec.crosshairShape),
|
|
193
|
-
this;
|
|
194
|
-
}
|
|
195
|
-
crosshairType(crosshairType) {
|
|
196
|
-
return this.spec.crosshairType = crosshairType, this._crosshairComponentType = null,
|
|
197
|
-
this._prepareRejoin(), this.commit(), this;
|
|
198
|
-
}
|
|
199
|
-
crosshairShape(crosshairShape) {
|
|
200
|
-
return this.spec.crosshairShape = crosshairShape, this._crosshairComponentType = null,
|
|
201
|
-
this._prepareRejoin(), this.commit(), this;
|
|
202
|
-
}
|
|
203
|
-
addGraphicItem(attrs, groupKey) {
|
|
204
|
-
const initialAttributes = Object.assign(this._getDefaultCrosshairAttribute(), attrs), graphicItem = Factory.createGraphicComponent(this._getCrosshairComponentType(), initialAttributes);
|
|
205
|
-
return super.addGraphicItem(initialAttributes, groupKey, graphicItem);
|
|
206
|
-
}
|
|
207
|
-
release() {
|
|
208
|
-
var _a, _b, _c, _d;
|
|
209
|
-
null === (_b = null === (_a = this._lastGroup) || void 0 === _a ? void 0 : _a.off) || void 0 === _b || _b.call(_a, "pointermove", this._onCrosshairShow),
|
|
210
|
-
null === (_d = null === (_c = this._lastGroup) || void 0 === _c ? void 0 : _c.off) || void 0 === _d || _d.call(_c, "pointerleave", this._onCrosshairHide),
|
|
211
|
-
super.release();
|
|
190
|
+
this.getCrosshairComponentType() !== CrosshairEnum.circleCrosshair && (attributes.x = containerPoint.x,
|
|
191
|
+
attributes.y = containerPoint.y), this._crosshairComponent.showAll(), this._crosshairComponent.setAttributes(attributes);
|
|
192
|
+
}, this.handleCrosshairHide = () => {
|
|
193
|
+
this._crosshairComponent.hideAll();
|
|
194
|
+
}, this.options = Object.assign({}, Crosshair.defaultOptions, options), this._container = null !== (_b = null === (_a = view.getMarksBySelector(this.options.container)) || void 0 === _a ? void 0 : _a[0]) && void 0 !== _b ? _b : view.rootMark;
|
|
212
195
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this._lastGroup = groupGraphicItem;
|
|
196
|
+
getEvents() {
|
|
197
|
+
return [ {
|
|
198
|
+
type: this.options.trigger,
|
|
199
|
+
handler: this.handleCrosshairShow
|
|
200
|
+
}, {
|
|
201
|
+
type: this.options.resetTrigger,
|
|
202
|
+
handler: this.handleCrosshairHide
|
|
203
|
+
} ];
|
|
222
204
|
}
|
|
223
|
-
|
|
224
|
-
const encoders = Object.assign({
|
|
225
|
-
update: {}
|
|
226
|
-
}, this.spec.encode), componentEncoders = Object.keys(encoders).reduce(((res, state) => {
|
|
227
|
-
const encoder = encoders[state];
|
|
228
|
-
return encoder && (res[state] = {
|
|
229
|
-
callback: (datum, element, parameters) => {
|
|
230
|
-
this._additionalEncodeResult = invokeEncoder(encoder, datum, element, parameters);
|
|
231
|
-
}
|
|
232
|
-
}), res;
|
|
233
|
-
}), {});
|
|
234
|
-
this._encoders = componentEncoders;
|
|
235
|
-
}
|
|
236
|
-
_getCrosshairComponentType() {
|
|
205
|
+
getCrosshairComponentType() {
|
|
237
206
|
var _a, _b;
|
|
238
207
|
if (this._crosshairComponentType) return this._crosshairComponentType;
|
|
239
|
-
const shape = null !== (_a = this.
|
|
208
|
+
const shape = null !== (_a = this.options.crosshairShape) && void 0 !== _a ? _a : "line", type = null !== (_b = this.options.crosshairType) && void 0 !== _b ? _b : "x";
|
|
240
209
|
return this._crosshairComponentType = "rect" === shape ? "angle" === type ? CrosshairEnum.sectorCrosshair : "radius" === type ? CrosshairEnum.ringCrosshair : "radius-polygon" === type ? CrosshairEnum.polygonCrosshair : CrosshairEnum.rectCrosshair : "radius" === type ? CrosshairEnum.circleCrosshair : "radius-polygon" === type ? CrosshairEnum.polygonCrosshair : CrosshairEnum.lineCrosshair,
|
|
241
210
|
this._crosshairComponentType;
|
|
242
211
|
}
|
|
243
|
-
|
|
212
|
+
getDefaultCrosshairAttribute() {
|
|
244
213
|
var _a;
|
|
245
|
-
const type = null !== (_a = this.
|
|
214
|
+
const type = null !== (_a = this.options.crosshairType) && void 0 !== _a ? _a : "x";
|
|
246
215
|
return "radius" === type || "radius-polygon" === type ? {
|
|
247
216
|
center: {
|
|
248
217
|
x: 0,
|
|
249
218
|
y: 0
|
|
250
|
-
}
|
|
219
|
+
},
|
|
220
|
+
zIndex: -1
|
|
251
221
|
} : {
|
|
252
222
|
start: {
|
|
253
223
|
x: 0,
|
|
@@ -256,20 +226,51 @@ export class Crosshair extends ScaleComponent {
|
|
|
256
226
|
end: {
|
|
257
227
|
x: 0,
|
|
258
228
|
y: 0
|
|
259
|
-
}
|
|
229
|
+
},
|
|
230
|
+
zIndex: -1
|
|
260
231
|
};
|
|
261
232
|
}
|
|
262
|
-
|
|
233
|
+
bind() {
|
|
234
|
+
super.bind();
|
|
235
|
+
const stage = this.view.renderer.stage();
|
|
236
|
+
if (!this._crosshairComponent && stage) {
|
|
237
|
+
switch (this.getCrosshairComponentType()) {
|
|
238
|
+
case CrosshairEnum.lineCrosshair:
|
|
239
|
+
this._crosshairComponent = new LineCrosshair(this.getDefaultCrosshairAttribute());
|
|
240
|
+
break;
|
|
263
241
|
|
|
264
|
-
|
|
242
|
+
case CrosshairEnum.rectCrosshair:
|
|
243
|
+
this._crosshairComponent = new RectCrosshair(this.getDefaultCrosshairAttribute());
|
|
244
|
+
break;
|
|
245
|
+
|
|
246
|
+
case CrosshairEnum.sectorCrosshair:
|
|
247
|
+
this._crosshairComponent = new SectorCrosshair(this.getDefaultCrosshairAttribute());
|
|
248
|
+
break;
|
|
249
|
+
|
|
250
|
+
case CrosshairEnum.circleCrosshair:
|
|
251
|
+
this._crosshairComponent = new CircleCrosshair(this.getDefaultCrosshairAttribute());
|
|
252
|
+
break;
|
|
253
|
+
|
|
254
|
+
case CrosshairEnum.polygonCrosshair:
|
|
255
|
+
this._crosshairComponent = new PolygonCrosshair(this.getDefaultCrosshairAttribute());
|
|
256
|
+
break;
|
|
257
|
+
|
|
258
|
+
case CrosshairEnum.ringCrosshair:
|
|
259
|
+
this._crosshairComponent = new SectorCrosshair(this.getDefaultCrosshairAttribute());
|
|
260
|
+
}
|
|
261
|
+
stage.defaultLayer.appendChild(this._crosshairComponent);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
unbind() {
|
|
265
|
+
super.unbind(), this._crosshairComponent && (this._crosshairComponent.release(),
|
|
266
|
+
this._crosshairComponent = null);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
265
269
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
Factory.registerGraphicComponent(CrosshairEnum.polygonCrosshair, (attrs => new PolygonCrosshair(attrs))),
|
|
272
|
-
Factory.registerGraphicComponent(CrosshairEnum.ringCrosshair, (attrs => new SectorCrosshair(attrs))),
|
|
273
|
-
Factory.registerComponent(ComponentEnum.crosshair, Crosshair);
|
|
270
|
+
Crosshair.type = "crosshair", Crosshair.defaultOptions = {
|
|
271
|
+
trigger: "pointermove",
|
|
272
|
+
resetTrigger: "pointerleave",
|
|
273
|
+
crosshairType: "x",
|
|
274
|
+
crosshairShape: "line"
|
|
274
275
|
};
|
|
275
276
|
//# sourceMappingURL=crosshair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/crosshair.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAUjF,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,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;SACT;QACA,KAAK,CAAC,YAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACpE,CAAC;IAED,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,IAAI,IAAI,CAAC,mBAAmB,EAAE;YAC5B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;YACnC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;SACjC;IACH,CAAC;;AAnLM,cAAI,GAAW,WAAW,CAAC;AAI3B,wBAAc,GAAqC;IACxD,OAAO,EAAE,aAAa;IACtB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,GAAG;IAClB,cAAc,EAAE,MAAM;CACvB,CAAC","file":"crosshair.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { clampRadian, getAngleByPoint, isString, merge } from '@visactor/vutils';\nimport type { IRectGraphicAttribute } from '@visactor/vrender-core';\nimport type {\n CircleCrosshairAttrs,\n LineCrosshairAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n SectorCrosshairAttrs\n} from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n CircleCrosshair,\n LineCrosshair,\n PolygonCrosshair,\n RectCrosshair,\n SectorCrosshair\n} from '@visactor/vrender-components';\nimport type {\n CrosshairOptions,\n CrosshairType,\n IGroupMark,\n ITheme,\n IView,\n InteractionEvent,\n RecursivePartial\n} from '../types';\nimport { BaseInteraction } from './base';\nimport { CrosshairEnum } from '../graph';\nimport type { IBandLikeScale, IBaseScale } from '@visactor/vscale';\n// eslint-disable-next-line no-duplicate-imports\nimport { isContinuous, isDiscrete } from '@visactor/vscale';\nimport { invokeFunctionType } from '../parse/util';\n\ntype CrosshairComponent = CircleCrosshair | LineCrosshair | PolygonCrosshair | RectCrosshair | SectorCrosshair;\n\nconst computeCrosshairStartEnd = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n offset: number = 0\n) => {\n const start = { x: 0, y: 0 };\n const end = { x: 0, y: 0 };\n const radius = type === 'angle' ? config?.radius ?? Math.min(groupSize.width, groupSize.height) / 2 : null;\n const center = type === 'angle' ? config?.center ?? { x: groupSize.width / 2, y: groupSize.height / 2 } : null;\n\n let current = 0;\n if (isDiscrete(scale.type)) {\n if (type === 'x') {\n current = scale.scale(scale.invert(point.x));\n } else if (type === 'y') {\n current = scale.scale(scale.invert(point.y));\n } else if (type === 'angle') {\n const angle = clampRadian(getAngleByPoint(center, point) + Math.PI * 2);\n current = scale.scale(scale.invert(angle));\n }\n } else if (isContinuous(scale.type)) {\n if (type === 'x') {\n current = point.x;\n } else if (type === 'y') {\n current = point.y;\n } else if (type === 'angle') {\n current = getAngleByPoint(center, point);\n }\n }\n current += offset;\n switch (type) {\n case 'x':\n start.x = current;\n start.y = 0;\n end.x = current;\n end.y = groupSize.height;\n break;\n case 'y':\n start.x = 0;\n start.y = current;\n end.x = groupSize.width;\n end.y = current;\n break;\n case 'angle':\n start.x = center.x;\n start.y = center.y;\n end.x = center.x + radius * Math.cos(current);\n end.y = center.y + radius * Math.sin(current);\n break;\n }\n return { start, end };\n};\n\nconst computeRadiusOfTangential = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n addition?:\n | RecursivePartial<PolygonCrosshairAttrs>\n | RecursivePartial<CircleCrosshairAttrs>\n | RecursivePartial<SectorCrosshairAttrs>\n) => {\n const center = addition?.center ?? config?.center ?? { x: groupSize.width / 2, y: groupSize.height / 2 };\n let currentRadius = 0;\n\n if (isDiscrete(scale.type)) {\n const offset = scale.type === 'band' ? (scale as IBandLikeScale).bandwidth() / 2 : 0;\n const radius = Math.sqrt((point.x - center.x) ** 2 + (point.y - center.y) ** 2);\n currentRadius = scale.scale(scale.invert(radius)) + offset;\n } else if (isContinuous(scale.type)) {\n const maxRadius = config?.radius ?? Math.min(groupSize.width, groupSize.height) / 2;\n currentRadius = Math.min(maxRadius, Math.sqrt((point.x - center.x) ** 2 + (point.y - center.y) ** 2));\n }\n\n return { radius: currentRadius, center };\n};\n\nexport const generateLineCrosshairAttributes = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n theme?: ITheme,\n addition?: RecursivePartial<LineCrosshairAttrs> & any\n): LineCrosshairAttrs => {\n const crosshairTheme = theme?.components?.lineCrosshair;\n const offset = scale.type === 'band' ? (scale as IBandLikeScale).bandwidth() / 2 : 0;\n const points = computeCrosshairStartEnd(\n point,\n scale,\n type,\n groupSize,\n {\n radius: addition?.radius ?? config?.radius,\n center: addition?.center ?? config?.center\n },\n offset\n );\n return merge({}, crosshairTheme, points, addition ?? {});\n};\n\nexport const generateRectCrosshairAttributes = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n theme?: ITheme,\n addition?: RecursivePartial<RectCrosshairAttrs>\n): RectCrosshairAttrs => {\n const crosshairTheme = theme?.components?.rectCrosshair;\n const defaultSize = scale.type === 'band' || scale.type === 'point' ? (scale as IBandLikeScale).step() : undefined;\n const customRectStyle = addition?.rectStyle;\n const size =\n defaultSize ??\n (type === 'y'\n ? customRectStyle?.width ?? crosshairTheme.rectStyle.width\n : customRectStyle?.height ?? crosshairTheme.rectStyle.height);\n const points = computeCrosshairStartEnd(point, scale, type, groupSize, config, scale.type === 'band' ? 0 : -size / 2);\n const rectStyle: Partial<IRectGraphicAttribute> = {};\n if (type === 'x') {\n rectStyle.width = size;\n } else {\n rectStyle.height = size;\n }\n const attribute = merge(\n {},\n crosshairTheme,\n {\n start: points.start,\n end: points.end,\n rectStyle\n },\n addition ?? {}\n );\n if (type === 'x') {\n attribute.rectStyle.height = attribute.end.y - attribute.start.y;\n } else {\n attribute.rectStyle.width = attribute.end.x - attribute.start.x;\n }\n return attribute;\n};\n\nexport const generateRingCrosshairAttributes = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n theme?: ITheme,\n addition?: RecursivePartial<SectorCrosshairAttrs>\n): SectorCrosshairAttrs => {\n const crosshairTheme = theme?.components?.circleCrosshair;\n const { center, radius } = computeRadiusOfTangential(point, scale, type, groupSize, config, addition);\n\n const startAngle = crosshairTheme.startAngle;\n const endAngle = crosshairTheme.endAngle;\n const deltaRadius = scale.type === 'band' || scale.type === 'point' ? (scale as IBandLikeScale).step() : 0;\n\n return merge(\n {},\n crosshairTheme,\n { center, innerRadius: radius - deltaRadius / 2, radius: radius + deltaRadius / 2, startAngle, endAngle },\n addition ?? {}\n );\n};\n\nexport const generateSectorCrosshairAttributes = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n theme?: ITheme,\n addition?: RecursivePartial<SectorCrosshairAttrs>\n): SectorCrosshairAttrs => {\n const crosshairTheme = theme?.components?.sectorCrosshair;\n const radius = addition?.radius ?? config?.radius ?? Math.min(groupSize.width, groupSize.height) / 2;\n const center = (addition?.center ??\n config?.center ?? { x: groupSize.width / 2, y: groupSize.height / 2 }) as IPointLike;\n const defaultAngle = crosshairTheme.endAngle - crosshairTheme.startAngle;\n const angle = scale.type === 'band' || scale.type === 'point' ? (scale as IBandLikeScale).step() : defaultAngle;\n let currentAngle = 0;\n if (isDiscrete(scale.type)) {\n const angle = clampRadian(getAngleByPoint(center, point) + Math.PI * 2);\n currentAngle =\n scale.scale(scale.invert(angle)) + (scale.type === 'band' ? (scale as IBandLikeScale).bandwidth() / 2 : 0);\n } else if (isContinuous(scale.type)) {\n currentAngle = getAngleByPoint(center, point);\n }\n const startAngle = currentAngle - angle / 2;\n const endAngle = currentAngle + angle / 2;\n return merge({}, crosshairTheme, { center, radius, startAngle, endAngle }, addition ?? {});\n};\n\nexport const generateCircleCrosshairAttributes = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n theme?: ITheme,\n addition?: RecursivePartial<CircleCrosshairAttrs>\n): CircleCrosshairAttrs => {\n const crosshairTheme = theme?.components?.circleCrosshair;\n const { center, radius } = computeRadiusOfTangential(point, scale, type, groupSize, config, addition);\n\n const startAngle = crosshairTheme.startAngle;\n const endAngle = crosshairTheme.endAngle;\n\n return merge({}, crosshairTheme, { center, radius: radius, startAngle, endAngle }, addition ?? {});\n};\n\nexport const generatePolygonCrosshairAttributes = (\n point: IPointLike,\n scale: IBaseScale,\n type: CrosshairType,\n groupSize: { width: number; height: number },\n config: any,\n theme?: ITheme,\n addition?: RecursivePartial<PolygonCrosshairAttrs>\n): PolygonCrosshairAttrs => {\n const crosshairTheme = theme?.components?.circleCrosshair;\n const { center, radius } = computeRadiusOfTangential(point, scale, type, groupSize, config, addition);\n\n const startAngle = crosshairTheme.startAngle;\n const endAngle = crosshairTheme.endAngle;\n return merge({}, crosshairTheme, { center, radius: radius, startAngle, endAngle }, addition ?? {});\n};\n\nexport class Crosshair extends BaseInteraction<CrosshairOptions> {\n static type: string = 'crosshair';\n type: string = Crosshair.type;\n options: CrosshairOptions;\n\n static defaultOptions: Omit<CrosshairOptions, 'target'> = {\n trigger: 'pointermove',\n resetTrigger: 'pointerleave',\n crosshairType: 'x',\n crosshairShape: 'line'\n };\n\n protected _crosshairComponent?: CrosshairComponent;\n protected _crosshairComponentType?: keyof typeof CrosshairEnum;\n protected _container: IGroupMark;\n\n constructor(view: IView, options?: CrosshairOptions) {\n super(view, options);\n this.options = Object.assign({}, Crosshair.defaultOptions, options);\n this._container = (view.getMarksBySelector(this.options.container)?.[0] as IGroupMark) ?? view.rootMark;\n }\n\n protected getEvents() {\n return [\n {\n type: this.options.trigger,\n handler: this.handleCrosshairShow\n },\n {\n type: this.options.resetTrigger,\n handler: this.handleCrosshairHide\n }\n ];\n }\n\n protected handleCrosshairShow = (event: InteractionEvent) => {\n if (!this._crosshairComponent) {\n return;\n }\n const groupGraphicItem = this._container.getGroupGraphicItem();\n // FIXME: waiting for vRender to add transformed position to event\n const point = { x: 0, y: 0 };\n const globalTransMatrix = groupGraphicItem.globalTransMatrix;\n const containerPoint = { x: globalTransMatrix.e, y: globalTransMatrix.f };\n globalTransMatrix.transformPoint(event.canvas, point);\n\n if (\n point.x < 0 ||\n point.x > groupGraphicItem.attribute.width ||\n point.y < 0 ||\n point.y > groupGraphicItem.attribute.height\n ) {\n this._crosshairComponent.hideAll();\n return;\n }\n\n const crosshairType = this.options.crosshairType ?? 'x';\n const groupSize = { width: groupGraphicItem.attribute.width, height: groupGraphicItem.attribute.height };\n const scaleGrammar = isString(this.options.scale) ? this.view.getScaleById(this.options.scale) : this.options.scale;\n const scale = scaleGrammar.getScale();\n const config = { center: this.options.center, radius: this.options.radius };\n const theme = this.view.getCurrentTheme();\n const addition = invokeFunctionType(this.options.attributes, this.parameters(), {}, {}) as any;\n\n let attributes: any = {};\n switch (this.getCrosshairComponentType()) {\n case CrosshairEnum.lineCrosshair:\n attributes = generateLineCrosshairAttributes(point, scale, crosshairType, groupSize, config, theme, addition);\n break;\n case CrosshairEnum.rectCrosshair:\n attributes = generateRectCrosshairAttributes(point, scale, crosshairType, groupSize, config, theme, addition);\n break;\n case CrosshairEnum.sectorCrosshair:\n attributes = generateSectorCrosshairAttributes(point, scale, crosshairType, groupSize, config, theme, addition);\n break;\n case CrosshairEnum.circleCrosshair:\n attributes = generateCircleCrosshairAttributes(point, scale, crosshairType, groupSize, config, theme, addition);\n break;\n case CrosshairEnum.polygonCrosshair:\n attributes = generatePolygonCrosshairAttributes(\n point,\n scale,\n crosshairType,\n groupSize,\n config,\n theme,\n addition\n );\n break;\n case CrosshairEnum.ringCrosshair:\n attributes = generateRingCrosshairAttributes(point, scale, crosshairType, groupSize, config, theme, addition);\n break;\n }\n // Hack: waiting for component to fix\n if (this.getCrosshairComponentType() !== CrosshairEnum.circleCrosshair) {\n attributes.x = containerPoint.x;\n attributes.y = containerPoint.y;\n }\n this._crosshairComponent.showAll();\n this._crosshairComponent.setAttributes(attributes);\n };\n\n protected handleCrosshairHide = () => {\n this._crosshairComponent.hideAll();\n };\n\n protected getCrosshairComponentType() {\n if (this._crosshairComponentType) {\n return this._crosshairComponentType;\n }\n const shape = this.options.crosshairShape ?? 'line';\n const type = this.options.crosshairType ?? 'x';\n if (shape === 'rect') {\n if (type === 'angle') {\n this._crosshairComponentType = CrosshairEnum.sectorCrosshair;\n } else if (type === 'radius') {\n this._crosshairComponentType = CrosshairEnum.ringCrosshair;\n } else if (type === 'radius-polygon') {\n this._crosshairComponentType = CrosshairEnum.polygonCrosshair;\n } else {\n this._crosshairComponentType = CrosshairEnum.rectCrosshair;\n }\n } else {\n if (type === 'radius') {\n this._crosshairComponentType = CrosshairEnum.circleCrosshair;\n } else if (type === 'radius-polygon') {\n this._crosshairComponentType = CrosshairEnum.polygonCrosshair;\n } else {\n this._crosshairComponentType = CrosshairEnum.lineCrosshair;\n }\n }\n return this._crosshairComponentType;\n }\n\n protected getDefaultCrosshairAttribute(): any {\n const type = this.options.crosshairType ?? 'x';\n if (type === 'radius' || type === 'radius-polygon') {\n return { center: { x: 0, y: 0 }, zIndex: -1 };\n }\n return { start: { x: 0, y: 0 }, end: { x: 0, y: 0 }, zIndex: -1 };\n }\n\n bind(): void {\n super.bind();\n\n const stage = this.view.renderer.stage();\n if (this._crosshairComponent || !stage) {\n return;\n }\n\n switch (this.getCrosshairComponentType()) {\n case CrosshairEnum.lineCrosshair:\n this._crosshairComponent = new LineCrosshair(this.getDefaultCrosshairAttribute());\n break;\n case CrosshairEnum.rectCrosshair:\n this._crosshairComponent = new RectCrosshair(this.getDefaultCrosshairAttribute());\n break;\n case CrosshairEnum.sectorCrosshair:\n this._crosshairComponent = new SectorCrosshair(this.getDefaultCrosshairAttribute());\n break;\n case CrosshairEnum.circleCrosshair:\n this._crosshairComponent = new CircleCrosshair(this.getDefaultCrosshairAttribute());\n break;\n case CrosshairEnum.polygonCrosshair:\n this._crosshairComponent = new PolygonCrosshair(this.getDefaultCrosshairAttribute());\n break;\n case CrosshairEnum.ringCrosshair:\n this._crosshairComponent = new SectorCrosshair(this.getDefaultCrosshairAttribute());\n break;\n }\n (stage.defaultLayer as any).appendChild(this._crosshairComponent);\n }\n\n unbind(): void {\n super.unbind();\n\n if (this._crosshairComponent) {\n this._crosshairComponent.release();\n this._crosshairComponent = null;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataFilterOptions, IView } from '../types';
|
|
2
|
+
import { Filter } from './filter';
|
|
3
|
+
export declare class DatazoomFilter extends Filter {
|
|
4
|
+
static type: string;
|
|
5
|
+
type: string;
|
|
6
|
+
static defaultOptions: Omit<DataFilterOptions, 'target'>;
|
|
7
|
+
options: DataFilterOptions;
|
|
8
|
+
constructor(view: IView, options?: DataFilterOptions);
|
|
9
|
+
protected getEvents(): {
|
|
10
|
+
type: string;
|
|
11
|
+
handler: (event?: import("../types").InteractionEvent) => void;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DataFilterRank, GrammarMarkType } from "../graph";
|
|
2
|
+
|
|
3
|
+
import { isNil, isString } from "@visactor/vutils";
|
|
4
|
+
|
|
5
|
+
import { Filter } from "./filter";
|
|
6
|
+
|
|
7
|
+
import { getScaleRangeRatio } from "../util/scale";
|
|
8
|
+
|
|
9
|
+
export class DatazoomFilter extends Filter {
|
|
10
|
+
constructor(view, options) {
|
|
11
|
+
super(view, options), this.type = DatazoomFilter.type, this.options = Object.assign({}, DatazoomFilter.defaultOptions, options),
|
|
12
|
+
this._marks = view.getMarksBySelector(this.options.source).filter((mark => mark.markType === GrammarMarkType.component && "datazoom" === mark.componentType)),
|
|
13
|
+
this._data = isString(this.options.target.data) ? view.getDataById(this.options.target.data) : this.options.target.data;
|
|
14
|
+
}
|
|
15
|
+
getEvents() {
|
|
16
|
+
if (!this._marks || 0 === this._marks.length) return [];
|
|
17
|
+
const datazoom = this._marks[0];
|
|
18
|
+
if (!this._data || !datazoom) return [];
|
|
19
|
+
const filter = this.options.target.filter, transform = this.options.target.transform, dataFilter = isString(filter) ? (datum, filterValue) => {
|
|
20
|
+
if (isNil(filterValue.start) || isNil(filterValue.end)) return !0;
|
|
21
|
+
const scale = datazoom.getDatazoomMainScale(), datumRatio = getScaleRangeRatio(scale, datum[filter]);
|
|
22
|
+
return filterValue.startRatio <= datumRatio && filterValue.endRatio >= datumRatio;
|
|
23
|
+
} : filter;
|
|
24
|
+
return this._filterData(this._data, datazoom, DataFilterRank.datazoom, (event => {
|
|
25
|
+
const startRatio = event.detail.start, endRatio = event.detail.end;
|
|
26
|
+
return {
|
|
27
|
+
startRatio: startRatio,
|
|
28
|
+
endRatio: endRatio,
|
|
29
|
+
start: datazoom.invertDatazoomRatio(startRatio),
|
|
30
|
+
end: datazoom.invertDatazoomRatio(endRatio)
|
|
31
|
+
};
|
|
32
|
+
}), dataFilter, transform), [ {
|
|
33
|
+
type: "change",
|
|
34
|
+
handler: this.handleFilter
|
|
35
|
+
} ];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
DatazoomFilter.type = "datazoom-filter", DatazoomFilter.defaultOptions = {};
|
|
40
|
+
//# sourceMappingURL=datazoom-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/datazoom-filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAOxC,YAAY,IAAW,EAAE,OAA2B;QAClD,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QANvB,SAAI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CAAC;YAClC,OAAO;gBACL,UAAU;gBACV,QAAQ;gBACR,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC;gBAC/C,GAAG,EAAE,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC;aAC5C,CAAC;QACJ,CAAC,CAAC;QACF,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjC,CAAC,CAAC,CAAC,KAAU,EAAE,WAAgC,EAAE,EAAE;gBAC/C,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;oBACtD,OAAO,IAAI,CAAC;iBACb;gBACD,MAAM,KAAK,GAAG,QAAQ,CAAC,oBAAoB,EAAE,CAAC;gBAC9C,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;gBAE5D,OAAO,WAAW,CAAC,UAAU,IAAI,UAAU,IAAI,WAAW,CAAC,QAAQ,IAAI,UAAU,CAAC;YACpF,CAAC;YACH,CAAC,CAAC,MAAM,CAAC;QAEX,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAEvG,OAAO;YACL;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,IAAI,CAAC,YAAY;aAC3B;SACF,CAAC;IACJ,CAAC;;AA9DM,mBAAI,GAAW,iBAAiB,CAAC;AAGjC,6BAAc,GAAsC,EAAE,CAAC","file":"datazoom-filter.js","sourcesContent":["import type { DataFilterOptions, DatazoomFilterValue, IComponent, IDatazoom, IView } from '../types';\nimport { DataFilterRank, GrammarMarkType } from '../graph';\nimport { isNil, isString } from '@visactor/vutils';\nimport { Filter } from './filter';\nimport { getScaleRangeRatio } from '../util/scale';\n\nexport class DatazoomFilter extends Filter {\n static type: string = 'datazoom-filter';\n type: string = DatazoomFilter.type;\n\n static defaultOptions: Omit<DataFilterOptions, 'target'> = {};\n options: DataFilterOptions;\n\n constructor(view: IView, options?: DataFilterOptions) {\n super(view, options);\n this.options = Object.assign({}, DatazoomFilter.defaultOptions, options);\n\n this._marks = view\n .getMarksBySelector(this.options.source)\n .filter(mark => mark.markType === GrammarMarkType.component && (mark as IComponent).componentType === 'datazoom');\n this._data = isString(this.options.target.data)\n ? view.getDataById(this.options.target.data)\n : this.options.target.data;\n }\n\n protected getEvents() {\n if (!this._marks || this._marks.length === 0) {\n return [];\n }\n\n const datazoom = this._marks[0] as IDatazoom;\n\n if (!this._data || !datazoom) {\n return [];\n }\n\n const filter = this.options.target.filter;\n const transform = this.options.target.transform;\n\n const getFilterValue = (event: any): DatazoomFilterValue => {\n const startRatio = event.detail.start;\n const endRatio = event.detail.end;\n return {\n startRatio,\n endRatio,\n start: datazoom.invertDatazoomRatio(startRatio),\n end: datazoom.invertDatazoomRatio(endRatio)\n };\n };\n const dataFilter = isString(filter)\n ? (datum: any, filterValue: DatazoomFilterValue) => {\n if (isNil(filterValue.start) || isNil(filterValue.end)) {\n return true;\n }\n const scale = datazoom.getDatazoomMainScale();\n const datumRatio = getScaleRangeRatio(scale, datum[filter]);\n\n return filterValue.startRatio <= datumRatio && filterValue.endRatio >= datumRatio;\n }\n : filter;\n\n this._filterData(this._data, datazoom, DataFilterRank.datazoom, getFilterValue, dataFilter, transform);\n\n return [\n {\n type: 'change',\n handler: this.handleFilter\n }\n ];\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DimensionTooltipOptions, IGroupMark, IMark, IView } from '../types';
|
|
2
|
+
import { BaseTooltip } from './base-tooltip';
|
|
3
|
+
export declare class DimensionTooltip extends BaseTooltip<DimensionTooltipOptions> {
|
|
4
|
+
static type: string;
|
|
5
|
+
type: string;
|
|
6
|
+
static defaultOptions: Omit<DimensionTooltipOptions, 'target'>;
|
|
7
|
+
protected _avoidMarks: IMark[];
|
|
8
|
+
protected _lastDatum: any;
|
|
9
|
+
protected _tooltipDataFilter: ((datum: any, filterValue: any[]) => boolean) | null;
|
|
10
|
+
protected _container: IGroupMark;
|
|
11
|
+
constructor(view: IView, options?: DimensionTooltipOptions);
|
|
12
|
+
protected getEvents(): {
|
|
13
|
+
type: import("../types").EventType;
|
|
14
|
+
handler: (...args: any[]) => void;
|
|
15
|
+
}[];
|
|
16
|
+
protected handleTooltipShow: (...args: any[]) => void;
|
|
17
|
+
protected handleTooltipHide: (event: any) => void;
|
|
18
|
+
}
|