@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,20 @@
|
|
|
1
|
+
import type { DataFilterOptions, IData, IDataFilter, IMark, IView, InteractionEvent } from '../types';
|
|
2
|
+
import { BaseInteraction } from './base';
|
|
3
|
+
export interface FilterMixin {
|
|
4
|
+
view: IView;
|
|
5
|
+
_data?: IData;
|
|
6
|
+
_marks?: IMark[];
|
|
7
|
+
_filterValue: any;
|
|
8
|
+
_dataFilter: IDataFilter;
|
|
9
|
+
handleFilter: (event?: InteractionEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class FilterMixin {
|
|
12
|
+
_filterData(data: IData, source: IMark | null, filterRank: number, getFilterValue: (event: any) => any, filter?: (data: any[], parameters: any) => boolean, transform?: (data: any[], parameters: any) => any[]): this;
|
|
13
|
+
}
|
|
14
|
+
export interface Filter extends Pick<FilterMixin, '_data' | '_marks' | '_filterValue' | '_dataFilter' | 'handleFilter' | '_filterData'>, BaseInteraction<DataFilterOptions> {
|
|
15
|
+
}
|
|
16
|
+
export declare abstract class Filter extends BaseInteraction<DataFilterOptions> {
|
|
17
|
+
static defaultOptions: Omit<DataFilterOptions, 'target'>;
|
|
18
|
+
options: DataFilterOptions;
|
|
19
|
+
constructor(view: IView, options?: DataFilterOptions);
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.Filter = exports.FilterMixin = void 0;
|
|
6
|
+
|
|
7
|
+
const base_1 = require("./base"), vutils_1 = require("@visactor/vutils");
|
|
8
|
+
|
|
9
|
+
class FilterMixin {
|
|
10
|
+
_filterData(data, source, filterRank, getFilterValue, filter, transform) {
|
|
11
|
+
const dataGrammar = (0, vutils_1.isString)(data) ? this.view.getDataById(data) : data;
|
|
12
|
+
return dataGrammar && (this.handleFilter = event => {
|
|
13
|
+
const element = null == event ? void 0 : event.element;
|
|
14
|
+
dataGrammar && (!source || element && element.mark === source) && (getFilterValue && (this._filterValue = getFilterValue(event)),
|
|
15
|
+
dataGrammar.commit(), this.view.runAsync());
|
|
16
|
+
}, this._dataFilter = {
|
|
17
|
+
source: source ? `${source.uid}` : null,
|
|
18
|
+
rank: filterRank,
|
|
19
|
+
filter: data => {
|
|
20
|
+
if (!this._filterValue) return data;
|
|
21
|
+
const filteredData = filter ? data.filter((datum => filter(datum, this._filterValue))) : data;
|
|
22
|
+
return transform ? transform(filteredData, this._filterValue) : filteredData;
|
|
23
|
+
}
|
|
24
|
+
}, dataGrammar.addDataFilter(this._dataFilter)), this;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.FilterMixin = FilterMixin;
|
|
29
|
+
|
|
30
|
+
class Filter extends base_1.BaseInteraction {
|
|
31
|
+
constructor(view, options) {
|
|
32
|
+
super(view, options), options.target && (this._data = (0, vutils_1.isString)(options.target.data) ? view.getDataById(options.target.data) : options.target.data);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.Filter = Filter, Filter.defaultOptions = {};
|
|
37
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/filter.ts"],"names":[],"mappings":";;;AACA,iCAAyC;AACzC,6CAA4C;AAW5C,MAAa,WAAW;IACtB,WAAW,CACT,IAAW,EACX,MAAoB,EACpB,UAAkB,EAClB,cAAmC,EACnC,MAAkD,EAClD,SAAmD;QAEnD,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxE,IAAI,WAAW,EAAE;YACf,IAAI,CAAC,YAAY,GAAG,CAAC,KAAuB,EAAE,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,OAAO,CAAC,CAAC;QACrB,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,KAAK,GAAG,IAAA,iBAAQ,EAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;SAC1G;IACH,CAAC;;AATH,wBAUC;AATQ,qBAAc,GAAsC,EAAE,CAAC","file":"filter.js","sourcesContent":["import type { DataFilterOptions, IData, IDataFilter, IMark, IView, InteractionEvent } from '../types';\nimport { BaseInteraction } from './base';\nimport { isString } from '@visactor/vutils';\n\nexport interface FilterMixin {\n view: IView;\n _data?: IData;\n _marks?: IMark[];\n _filterValue: any;\n _dataFilter: IDataFilter;\n handleFilter: (event?: InteractionEvent) => void;\n}\n\nexport class FilterMixin {\n _filterData(\n data: IData,\n source: IMark | null,\n filterRank: number,\n getFilterValue: (event: any) => any,\n filter?: (data: any[], parameters: any) => boolean,\n transform?: (data: any[], parameters: any) => any[]\n ) {\n const dataGrammar = isString(data) ? this.view.getDataById(data) : data;\n if (dataGrammar) {\n this.handleFilter = (event: InteractionEvent) => {\n const element = event?.element;\n if (!dataGrammar || (source && (!element || element.mark !== source))) {\n return;\n }\n if (getFilterValue) {\n this._filterValue = getFilterValue(event);\n }\n dataGrammar.commit();\n this.view.runAsync();\n };\n\n this._dataFilter = {\n source: source ? `${source.uid}` : null,\n rank: filterRank,\n filter: (data: any[]) => {\n if (!this._filterValue) {\n return data;\n }\n const filteredData = filter ? data.filter(datum => filter(datum, this._filterValue)) : data;\n return transform ? transform(filteredData, this._filterValue) : filteredData;\n }\n };\n dataGrammar.addDataFilter(this._dataFilter);\n }\n return this;\n }\n}\n\nexport interface Filter\n extends Pick<FilterMixin, '_data' | '_marks' | '_filterValue' | '_dataFilter' | 'handleFilter' | '_filterData'>,\n BaseInteraction<DataFilterOptions> {}\n\nexport abstract class Filter extends BaseInteraction<DataFilterOptions> {\n static defaultOptions: Omit<DataFilterOptions, 'target'> = {};\n options: DataFilterOptions;\n\n constructor(view: IView, options?: DataFilterOptions) {\n super(view, options);\n if (options.target) {\n this._data = isString(options.target.data) ? view.getDataById(options.target.data) : options.target.data;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { FishEyeOptions, IMark, IScale, IView, InteractionEvent, ViewNavigationRange } from '../types';
|
|
2
|
+
import { BaseInteraction } from './base';
|
|
3
|
+
export declare class FishEye extends BaseInteraction<FishEyeOptions> {
|
|
4
|
+
static type: string;
|
|
5
|
+
type: string;
|
|
6
|
+
static defaultOptions: FishEyeOptions;
|
|
7
|
+
options: FishEyeOptions;
|
|
8
|
+
protected _inited?: boolean;
|
|
9
|
+
protected _state: Partial<Record<'x' | 'y', {
|
|
10
|
+
scale?: IScale;
|
|
11
|
+
focus?: number;
|
|
12
|
+
distortion?: number;
|
|
13
|
+
radius?: number;
|
|
14
|
+
radiusRatio?: number;
|
|
15
|
+
}>>;
|
|
16
|
+
protected _isActive?: boolean;
|
|
17
|
+
protected _marks?: IMark[];
|
|
18
|
+
protected handleUpdate: (e: InteractionEvent) => void;
|
|
19
|
+
constructor(view: IView, options?: FishEyeOptions);
|
|
20
|
+
protected getEvents(): {
|
|
21
|
+
type: string;
|
|
22
|
+
handler: (e: InteractionEvent) => void;
|
|
23
|
+
}[];
|
|
24
|
+
protected _initStateByDim(dim: 'x' | 'y', distortion: number, scale?: string | IScale, radius?: number, radiusRatio?: number): void;
|
|
25
|
+
protected _initGrammars(): void;
|
|
26
|
+
updateView(focus?: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}, e?: InteractionEvent): void;
|
|
30
|
+
protected dispatchEvent(type: string, viewRange: ViewNavigationRange, e?: InteractionEvent): void;
|
|
31
|
+
shouldHandle(e: InteractionEvent): boolean;
|
|
32
|
+
shouldUpdate(e: InteractionEvent): boolean;
|
|
33
|
+
handleStart: (e: InteractionEvent) => void;
|
|
34
|
+
handleUpdateInner: (e: InteractionEvent) => void;
|
|
35
|
+
handleEnd: (e: InteractionEvent) => void;
|
|
36
|
+
handleReset: (e: InteractionEvent) => void;
|
|
37
|
+
unbind(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.FishEye = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), base_1 = require("./base");
|
|
8
|
+
|
|
9
|
+
class FishEye extends base_1.BaseInteraction {
|
|
10
|
+
constructor(view, options) {
|
|
11
|
+
super(view, options), this.type = FishEye.type, this.handleStart = e => {
|
|
12
|
+
e && (this.options.shouldStart ? this.options.shouldStart(e) : this.shouldHandle(e)) && (this._inited || this._initGrammars(),
|
|
13
|
+
this._isActive || (this._isActive = !0, this.updateView({
|
|
14
|
+
x: e.canvasX,
|
|
15
|
+
y: e.canvasY
|
|
16
|
+
}, e)));
|
|
17
|
+
}, this.handleUpdateInner = e => {
|
|
18
|
+
e && (this.options.shouldUpdate ? this.options.shouldUpdate(e) : this.shouldUpdate(e)) && this._isActive && this.updateView({
|
|
19
|
+
x: e.canvasX,
|
|
20
|
+
y: e.canvasY
|
|
21
|
+
}, e);
|
|
22
|
+
}, this.handleEnd = e => {
|
|
23
|
+
e && (this.options.shouldEnd ? this.options.shouldEnd(e) : this.shouldHandle(e)) && !this.options.resetTrigger && this._isActive && (this._isActive = !1,
|
|
24
|
+
this.updateView(null, e));
|
|
25
|
+
}, this.handleReset = e => {
|
|
26
|
+
e && (this.options.shouldReset ? this.options.shouldReset(e) : this.shouldHandle(e)) && this._isActive && (this.updateView(null, e),
|
|
27
|
+
this._isActive = !1);
|
|
28
|
+
}, this.options = Object.assign({}, FishEye.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.selector),
|
|
29
|
+
this.handleUpdate = (0, vutils_1.throttle)(this.handleUpdateInner, this.options.throttle);
|
|
30
|
+
}
|
|
31
|
+
getEvents() {
|
|
32
|
+
return [ {
|
|
33
|
+
type: this.options.trigger,
|
|
34
|
+
handler: this.handleStart
|
|
35
|
+
}, {
|
|
36
|
+
type: this.options.updateTrigger,
|
|
37
|
+
handler: this.handleUpdate
|
|
38
|
+
}, {
|
|
39
|
+
type: this.options.endTrigger,
|
|
40
|
+
handler: this.handleEnd
|
|
41
|
+
}, {
|
|
42
|
+
type: this.options.resetTrigger,
|
|
43
|
+
handler: this.handleReset
|
|
44
|
+
} ];
|
|
45
|
+
}
|
|
46
|
+
_initStateByDim(dim, distortion, scale, radius, radiusRatio) {
|
|
47
|
+
const scaleGrammar = (0, vutils_1.isNil)(scale) ? null : (0, vutils_1.isString)(scale) ? this.view.getScaleById(scale) : scale;
|
|
48
|
+
this._state[dim] = {
|
|
49
|
+
scale: scaleGrammar,
|
|
50
|
+
distortion: distortion,
|
|
51
|
+
radius: radius,
|
|
52
|
+
radiusRatio: radiusRatio
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
_initGrammars() {
|
|
56
|
+
const {enableX: enableX, enableY: enableY, scaleX: scaleX, scaleY: scaleY, distortionX: distortionX, distortionY: distortionY, radiusRatioX: radiusRatioX, radiusRatioY: radiusRatioY, radiusX: radiusX, radiusY: radiusY} = this.options;
|
|
57
|
+
this._state = {}, !1 !== enableX && this._initStateByDim("x", distortionX, scaleX, radiusX, radiusRatioX),
|
|
58
|
+
!1 !== enableY && this._initStateByDim("y", distortionY, scaleY, radiusY, radiusRatioY),
|
|
59
|
+
this._inited = !0;
|
|
60
|
+
}
|
|
61
|
+
updateView(focus, e) {
|
|
62
|
+
let needUpdate = !1;
|
|
63
|
+
focus ? Object.keys(this._state).forEach((dim => {
|
|
64
|
+
const dimState = this._state[dim];
|
|
65
|
+
dimState.scale && dimState.focus !== focus[dim] && (needUpdate = !0, dimState.focus = focus[dim],
|
|
66
|
+
dimState.scale.setFishEye({
|
|
67
|
+
distortion: dimState.distortion,
|
|
68
|
+
radius: dimState.radius,
|
|
69
|
+
radiusRatio: dimState.radiusRatio,
|
|
70
|
+
focus: focus[dim]
|
|
71
|
+
}), dimState.scale.commit());
|
|
72
|
+
})) : Object.keys(this._state).forEach((dim => {
|
|
73
|
+
const dimState = this._state[dim];
|
|
74
|
+
dimState.scale && !(0, vutils_1.isNil)(dimState.focus) && (needUpdate = !0, dimState.focus = null,
|
|
75
|
+
dimState.scale.setFishEye(null), dimState.scale.commit());
|
|
76
|
+
})), needUpdate && this.view.runSync();
|
|
77
|
+
}
|
|
78
|
+
dispatchEvent(type, viewRange, e) {
|
|
79
|
+
this.view.emit(type, {
|
|
80
|
+
viewRange: viewRange,
|
|
81
|
+
event: e
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
shouldHandle(e) {
|
|
85
|
+
var _a, _b, _c;
|
|
86
|
+
return this._marks ? e.element && this._marks && this._marks.includes(e.element.mark) : e.target === (null === (_c = null === (_b = null === (_a = this.view) || void 0 === _a ? void 0 : _a.renderer) || void 0 === _b ? void 0 : _b.stage) || void 0 === _c ? void 0 : _c.call(_b));
|
|
87
|
+
}
|
|
88
|
+
shouldUpdate(e) {
|
|
89
|
+
if (this._marks) return e.element && this._marks && this._marks.includes(e.element.mark);
|
|
90
|
+
const viewBox = this.view.getViewBox();
|
|
91
|
+
return e.canvasX >= viewBox.x1 && e.canvasX <= viewBox.x2 && e.canvasY >= viewBox.y1 && e.canvasY <= viewBox.y2;
|
|
92
|
+
}
|
|
93
|
+
unbind() {
|
|
94
|
+
super.unbind(), this._state && Object.keys(this._state).forEach((dim => {
|
|
95
|
+
const {scale: scale} = this._state[dim];
|
|
96
|
+
scale && (scale.setRangeFactor(null), scale.commit());
|
|
97
|
+
})), this._state = null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
exports.FishEye = FishEye, FishEye.type = "fish-eye", FishEye.defaultOptions = {
|
|
102
|
+
trigger: "pointerenter",
|
|
103
|
+
updateTrigger: "pointermove",
|
|
104
|
+
endTrigger: "pointerleave",
|
|
105
|
+
distortionX: 2,
|
|
106
|
+
distortionY: 2,
|
|
107
|
+
throttle: 100
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=fish-eye.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/fish-eye.ts"],"names":[],"mappings":";;;AAAA,6CAA6D;AAE7D,iCAAyC;AAEzC,MAAa,OAAQ,SAAQ,sBAA+B;IAuB1D,YAAY,IAAW,EAAE,OAAwB;QAC/C,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAtBvB,SAAI,GAAW,OAAO,CAAC,IAAI,CAAC;QAkI5B,gBAAW,GAAG,CAAC,CAAmB,EAAE,EAAE;YACpC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC1F,OAAO;aACR;YAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACjB,IAAI,CAAC,aAAa,EAAE,CAAC;aACtB;YACD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;gBACtB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;aACpD;QACH,CAAC,CAAC;QAEF,sBAAiB,GAAG,CAAC,CAAmB,EAAE,EAAE;YAC1C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC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,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACzE;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACvC,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;IAClH,CAAC;IA8CD,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACrC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAgB,CAAC,CAAC;gBAEhD,IAAI,KAAK,EAAE;oBACT,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;oBAC3B,KAAK,CAAC,MAAM,EAAE,CAAC;iBAChB;YACH,CAAC,CAAC,CAAC;SACJ;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;;AA/LH,0BAgMC;AA/LQ,YAAI,GAAW,UAAU,CAAC;AAG1B,sBAAc,GAAmB;IACtC,OAAO,EAAE,cAAc;IACvB,aAAa,EAAE,aAAa;IAC5B,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,GAAG;CACd,CAAC","file":"fish-eye.js","sourcesContent":["import { isNil, isString, throttle } from '@visactor/vutils';\nimport type { FishEyeOptions, IMark, IScale, IView, InteractionEvent, ViewNavigationRange } from '../types';\nimport { BaseInteraction } from './base';\n\nexport class FishEye extends BaseInteraction<FishEyeOptions> {\n static type: string = 'fish-eye';\n type: string = FishEye.type;\n\n static defaultOptions: FishEyeOptions = {\n trigger: 'pointerenter',\n updateTrigger: 'pointermove',\n endTrigger: 'pointerleave',\n distortionX: 2,\n distortionY: 2,\n throttle: 100\n };\n\n options: FishEyeOptions;\n protected _inited?: boolean;\n protected _state: Partial<\n Record<'x' | 'y', { scale?: IScale; focus?: number; distortion?: number; radius?: number; radiusRatio?: number }>\n >;\n protected _isActive?: boolean;\n protected _marks?: IMark[];\n\n protected handleUpdate: (e: InteractionEvent) => void;\n\n constructor(view: IView, options?: FishEyeOptions) {\n super(view, options);\n this.options = Object.assign({}, FishEye.defaultOptions, options);\n this._marks = view.getMarksBySelector(this.options.selector);\n\n this.handleUpdate = throttle(this.handleUpdateInner, this.options.throttle);\n }\n\n protected getEvents() {\n return [\n { type: this.options.trigger, handler: this.handleStart },\n { type: this.options.updateTrigger, handler: this.handleUpdate },\n { type: this.options.endTrigger, handler: this.handleEnd },\n { type: this.options.resetTrigger, handler: this.handleReset }\n ];\n }\n\n protected _initStateByDim(\n dim: 'x' | 'y',\n distortion: number,\n scale?: string | IScale,\n radius?: number,\n radiusRatio?: number\n ) {\n const scaleGrammar = !isNil(scale) ? (isString(scale) ? this.view.getScaleById(scale) : scale) : null;\n\n this._state[dim] = { scale: scaleGrammar, distortion, radius, radiusRatio };\n }\n\n protected _initGrammars() {\n const { enableX, enableY, scaleX, scaleY, distortionX, distortionY, radiusRatioX, radiusRatioY, radiusX, radiusY } =\n this.options;\n\n this._state = {};\n\n if (enableX !== false) {\n this._initStateByDim('x', distortionX, scaleX, radiusX, radiusRatioX);\n }\n\n if (enableY !== false) {\n this._initStateByDim('y', distortionY, scaleY, radiusY, radiusRatioY);\n }\n\n this._inited = true;\n }\n\n updateView(focus?: { x: number; y: number }, e?: InteractionEvent) {\n let needUpdate = false;\n\n if (focus) {\n Object.keys(this._state).forEach(dim => {\n const dimState = this._state[dim];\n\n if (dimState.scale && dimState.focus !== focus[dim]) {\n needUpdate = true;\n // 坐标转换问题\n dimState.focus = focus[dim];\n dimState.scale.setFishEye({\n distortion: dimState.distortion,\n radius: dimState.radius,\n radiusRatio: dimState.radiusRatio,\n focus: focus[dim]\n });\n dimState.scale.commit();\n }\n });\n } else {\n Object.keys(this._state).forEach(dim => {\n const dimState = this._state[dim];\n\n if (dimState.scale && !isNil(dimState.focus)) {\n needUpdate = true;\n // 坐标转换问题\n dimState.focus = null;\n dimState.scale.setFishEye(null);\n dimState.scale.commit();\n }\n });\n }\n\n if (needUpdate) {\n this.view.runSync();\n }\n\n // this.dispatchEvent(type, newRange, e);\n }\n\n protected dispatchEvent(type: string, viewRange: ViewNavigationRange, e?: InteractionEvent) {\n this.view.emit(type, {\n viewRange,\n event: e\n });\n }\n\n shouldHandle(e: InteractionEvent) {\n if (this._marks) {\n return e.element && this._marks && this._marks.includes(e.element.mark);\n }\n return (e.target as any) === this.view?.renderer?.stage?.();\n }\n\n shouldUpdate(e: InteractionEvent) {\n if (this._marks) {\n return e.element && this._marks && this._marks.includes(e.element.mark);\n }\n const viewBox = this.view.getViewBox();\n return e.canvasX >= viewBox.x1 && e.canvasX <= viewBox.x2 && e.canvasY >= viewBox.y1 && e.canvasY <= viewBox.y2;\n }\n\n handleStart = (e: InteractionEvent) => {\n if (!e || !(this.options.shouldStart ? this.options.shouldStart(e) : this.shouldHandle(e))) {\n return;\n }\n\n if (!this._inited) {\n this._initGrammars();\n }\n if (!this._isActive) {\n this._isActive = true;\n this.updateView({ x: e.canvasX, y: e.canvasY }, e);\n }\n };\n\n handleUpdateInner = (e: InteractionEvent) => {\n if (!e || !(this.options.shouldUpdate ? this.options.shouldUpdate(e) : this.shouldUpdate(e))) {\n return;\n }\n\n this._isActive && this.updateView({ x: e.canvasX, y: e.canvasY }, e);\n };\n\n handleEnd = (e: InteractionEvent) => {\n if (!e || !(this.options.shouldEnd ? this.options.shouldEnd(e) : this.shouldHandle(e))) {\n return;\n }\n\n if (!this.options.resetTrigger && this._isActive) {\n this._isActive = false;\n this.updateView(null, e);\n }\n };\n\n handleReset = (e: InteractionEvent) => {\n if (!e || !(this.options.shouldReset ? this.options.shouldReset(e) : this.shouldHandle(e))) {\n return;\n }\n\n if (this._isActive) {\n this.updateView(null, e);\n this._isActive = false;\n }\n };\n\n unbind() {\n super.unbind();\n\n if (this._state) {\n Object.keys(this._state).forEach(dim => {\n const { scale } = this._state[dim as 'x' | 'y'];\n\n if (scale) {\n scale.setRangeFactor(null);\n scale.commit();\n }\n });\n }\n\n this._state = null;\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ElementActive } from './element-active';
|
|
2
|
+
import { ElementSelect } from './element-select';
|
|
3
|
+
import { ElementHighlight } from './element-highlight';
|
|
4
|
+
import { ElementHighlightByKey } from './element-highlight-by-key';
|
|
5
|
+
import { ElementHighlightByGroup } from './element-highlight-by-group';
|
|
6
|
+
import { ElementActiveByLegend } from './element-active-by-legend';
|
|
7
|
+
import { ElementHighlightByLegend } from './element-highlight-by-legend';
|
|
8
|
+
import { ElementHighlightByName } from './element-highlight-by-name';
|
|
9
|
+
import { BrushHighlight } from './brush-highlight';
|
|
10
|
+
import { BrushActive } from './brush-active';
|
|
11
|
+
import { DrillDown } from './drill-down';
|
|
12
|
+
import { RollUp } from './roll-up';
|
|
13
|
+
import { Tooltip } from './tooltip';
|
|
14
|
+
import { DimensionTooltip } from './dimension-tooltip';
|
|
15
|
+
import { Crosshair } from './crosshair';
|
|
16
|
+
import { FilterMixin } from './filter';
|
|
17
|
+
import { ViewZoom } from './view-zoom';
|
|
18
|
+
import { ViewScroll } from './view-scroll';
|
|
19
|
+
import { ViewDrag } from './view-drag';
|
|
20
|
+
import { ViewZoomMixin } from './view-zoom-mixin';
|
|
21
|
+
import { ViewScrollMixin } from './view-scroll-mixin';
|
|
22
|
+
import { ViewDragMixin } from './view-drag-mixin';
|
|
23
|
+
import { ViewRoam } from './view-roam';
|
|
24
|
+
import { FishEye } from './fish-eye';
|
|
25
|
+
export { BaseTooltip } from './base-tooltip';
|
|
26
|
+
export { BaseInteraction } from './base';
|
|
27
|
+
export { BrushBase } from './brush-base';
|
|
28
|
+
export { ViewNavigationBase } from './view-navigation-base';
|
|
29
|
+
export { ElementActive, ElementSelect, ElementHighlight, ElementHighlightByKey, ElementHighlightByGroup, ElementActiveByLegend, ElementHighlightByLegend, ElementHighlightByName, BrushHighlight, BrushActive, DrillDown, RollUp, Tooltip, DimensionTooltip, Crosshair, FilterMixin, ViewZoom, ViewScroll, ViewDrag, ViewRoam, ViewScrollMixin, ViewZoomMixin, ViewDragMixin, FishEye };
|
|
30
|
+
export declare const registerElementActive: () => void;
|
|
31
|
+
export declare const registerElementSelect: () => void;
|
|
32
|
+
export declare const registerElementHighlight: () => void;
|
|
33
|
+
export declare const registerElementHighlightByKey: () => void;
|
|
34
|
+
export declare const registerElementHighlightByGroup: () => void;
|
|
35
|
+
export declare const registerElementActiveByLegend: () => void;
|
|
36
|
+
export declare const registerElementHighlightByLegend: () => void;
|
|
37
|
+
export declare const registerElementHighlightByName: () => void;
|
|
38
|
+
export declare const registerBrushHighlight: () => void;
|
|
39
|
+
export declare const registerBrushActive: () => void;
|
|
40
|
+
export declare const registerBrushFilter: () => void;
|
|
41
|
+
export declare const registerDrillDown: () => void;
|
|
42
|
+
export declare const registerRollUp: () => void;
|
|
43
|
+
export declare const registerTooltip: () => void;
|
|
44
|
+
export declare const registerDimensionTooltip: () => void;
|
|
45
|
+
export declare const registerCrosshair: () => void;
|
|
46
|
+
export declare const registerViewZoom: () => void;
|
|
47
|
+
export declare const registerViewScroll: () => void;
|
|
48
|
+
export declare const registerViewDrag: () => void;
|
|
49
|
+
export declare const registerViewRoam: () => void;
|
|
50
|
+
export declare const registerFishEye: () => void;
|