@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,386 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.registerFishEye = exports.registerViewRoam = exports.registerViewDrag = exports.registerViewScroll = exports.registerViewZoom = exports.registerCrosshair = exports.registerDimensionTooltip = exports.registerTooltip = exports.registerRollUp = exports.registerDrillDown = exports.registerBrushFilter = exports.registerBrushActive = exports.registerBrushHighlight = exports.registerElementHighlightByName = exports.registerElementHighlightByLegend = exports.registerElementActiveByLegend = exports.registerElementHighlightByGroup = exports.registerElementHighlightByKey = exports.registerElementHighlight = exports.registerElementSelect = exports.registerElementActive = exports.FishEye = exports.ViewDragMixin = exports.ViewZoomMixin = exports.ViewScrollMixin = exports.ViewRoam = exports.ViewDrag = exports.ViewScroll = exports.ViewZoom = exports.FilterMixin = exports.Crosshair = exports.DimensionTooltip = exports.Tooltip = exports.RollUp = exports.DrillDown = exports.BrushActive = exports.BrushHighlight = exports.ElementHighlightByName = exports.ElementHighlightByLegend = exports.ElementActiveByLegend = exports.ElementHighlightByGroup = exports.ElementHighlightByKey = exports.ElementHighlight = exports.ElementSelect = exports.ElementActive = exports.ViewNavigationBase = exports.BrushBase = exports.BaseInteraction = exports.BaseTooltip = void 0;
|
|
6
|
+
|
|
7
|
+
const factory_1 = require("../core/factory"), element_active_1 = require("./element-active");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "ElementActive", {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: function() {
|
|
12
|
+
return element_active_1.ElementActive;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const element_select_1 = require("./element-select");
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, "ElementSelect", {
|
|
19
|
+
enumerable: !0,
|
|
20
|
+
get: function() {
|
|
21
|
+
return element_select_1.ElementSelect;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const element_highlight_1 = require("./element-highlight");
|
|
26
|
+
|
|
27
|
+
Object.defineProperty(exports, "ElementHighlight", {
|
|
28
|
+
enumerable: !0,
|
|
29
|
+
get: function() {
|
|
30
|
+
return element_highlight_1.ElementHighlight;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const element_highlight_by_key_1 = require("./element-highlight-by-key");
|
|
35
|
+
|
|
36
|
+
Object.defineProperty(exports, "ElementHighlightByKey", {
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
get: function() {
|
|
39
|
+
return element_highlight_by_key_1.ElementHighlightByKey;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const element_highlight_by_group_1 = require("./element-highlight-by-group");
|
|
44
|
+
|
|
45
|
+
Object.defineProperty(exports, "ElementHighlightByGroup", {
|
|
46
|
+
enumerable: !0,
|
|
47
|
+
get: function() {
|
|
48
|
+
return element_highlight_by_group_1.ElementHighlightByGroup;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const element_active_by_legend_1 = require("./element-active-by-legend");
|
|
53
|
+
|
|
54
|
+
Object.defineProperty(exports, "ElementActiveByLegend", {
|
|
55
|
+
enumerable: !0,
|
|
56
|
+
get: function() {
|
|
57
|
+
return element_active_by_legend_1.ElementActiveByLegend;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const element_highlight_by_legend_1 = require("./element-highlight-by-legend");
|
|
62
|
+
|
|
63
|
+
Object.defineProperty(exports, "ElementHighlightByLegend", {
|
|
64
|
+
enumerable: !0,
|
|
65
|
+
get: function() {
|
|
66
|
+
return element_highlight_by_legend_1.ElementHighlightByLegend;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const element_highlight_by_name_1 = require("./element-highlight-by-name");
|
|
71
|
+
|
|
72
|
+
Object.defineProperty(exports, "ElementHighlightByName", {
|
|
73
|
+
enumerable: !0,
|
|
74
|
+
get: function() {
|
|
75
|
+
return element_highlight_by_name_1.ElementHighlightByName;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const brush_highlight_1 = require("./brush-highlight");
|
|
80
|
+
|
|
81
|
+
Object.defineProperty(exports, "BrushHighlight", {
|
|
82
|
+
enumerable: !0,
|
|
83
|
+
get: function() {
|
|
84
|
+
return brush_highlight_1.BrushHighlight;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const brush_active_1 = require("./brush-active");
|
|
89
|
+
|
|
90
|
+
Object.defineProperty(exports, "BrushActive", {
|
|
91
|
+
enumerable: !0,
|
|
92
|
+
get: function() {
|
|
93
|
+
return brush_active_1.BrushActive;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const brush_filter_1 = require("./brush-filter"), drill_down_1 = require("./drill-down");
|
|
98
|
+
|
|
99
|
+
Object.defineProperty(exports, "DrillDown", {
|
|
100
|
+
enumerable: !0,
|
|
101
|
+
get: function() {
|
|
102
|
+
return drill_down_1.DrillDown;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const roll_up_1 = require("./roll-up");
|
|
107
|
+
|
|
108
|
+
Object.defineProperty(exports, "RollUp", {
|
|
109
|
+
enumerable: !0,
|
|
110
|
+
get: function() {
|
|
111
|
+
return roll_up_1.RollUp;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const tooltip_1 = require("./tooltip");
|
|
116
|
+
|
|
117
|
+
Object.defineProperty(exports, "Tooltip", {
|
|
118
|
+
enumerable: !0,
|
|
119
|
+
get: function() {
|
|
120
|
+
return tooltip_1.Tooltip;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const dimension_tooltip_1 = require("./dimension-tooltip");
|
|
125
|
+
|
|
126
|
+
Object.defineProperty(exports, "DimensionTooltip", {
|
|
127
|
+
enumerable: !0,
|
|
128
|
+
get: function() {
|
|
129
|
+
return dimension_tooltip_1.DimensionTooltip;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const crosshair_1 = require("./crosshair");
|
|
134
|
+
|
|
135
|
+
Object.defineProperty(exports, "Crosshair", {
|
|
136
|
+
enumerable: !0,
|
|
137
|
+
get: function() {
|
|
138
|
+
return crosshair_1.Crosshair;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const filter_1 = require("./filter");
|
|
143
|
+
|
|
144
|
+
Object.defineProperty(exports, "FilterMixin", {
|
|
145
|
+
enumerable: !0,
|
|
146
|
+
get: function() {
|
|
147
|
+
return filter_1.FilterMixin;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const view_zoom_1 = require("./view-zoom");
|
|
152
|
+
|
|
153
|
+
Object.defineProperty(exports, "ViewZoom", {
|
|
154
|
+
enumerable: !0,
|
|
155
|
+
get: function() {
|
|
156
|
+
return view_zoom_1.ViewZoom;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const view_scroll_1 = require("./view-scroll");
|
|
161
|
+
|
|
162
|
+
Object.defineProperty(exports, "ViewScroll", {
|
|
163
|
+
enumerable: !0,
|
|
164
|
+
get: function() {
|
|
165
|
+
return view_scroll_1.ViewScroll;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const view_drag_1 = require("./view-drag");
|
|
170
|
+
|
|
171
|
+
Object.defineProperty(exports, "ViewDrag", {
|
|
172
|
+
enumerable: !0,
|
|
173
|
+
get: function() {
|
|
174
|
+
return view_drag_1.ViewDrag;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const vutils_1 = require("@visactor/vutils"), view_zoom_mixin_1 = require("./view-zoom-mixin");
|
|
179
|
+
|
|
180
|
+
Object.defineProperty(exports, "ViewZoomMixin", {
|
|
181
|
+
enumerable: !0,
|
|
182
|
+
get: function() {
|
|
183
|
+
return view_zoom_mixin_1.ViewZoomMixin;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const view_scroll_mixin_1 = require("./view-scroll-mixin");
|
|
188
|
+
|
|
189
|
+
Object.defineProperty(exports, "ViewScrollMixin", {
|
|
190
|
+
enumerable: !0,
|
|
191
|
+
get: function() {
|
|
192
|
+
return view_scroll_mixin_1.ViewScrollMixin;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const view_drag_mixin_1 = require("./view-drag-mixin");
|
|
197
|
+
|
|
198
|
+
Object.defineProperty(exports, "ViewDragMixin", {
|
|
199
|
+
enumerable: !0,
|
|
200
|
+
get: function() {
|
|
201
|
+
return view_drag_mixin_1.ViewDragMixin;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const view_roam_1 = require("./view-roam");
|
|
206
|
+
|
|
207
|
+
Object.defineProperty(exports, "ViewRoam", {
|
|
208
|
+
enumerable: !0,
|
|
209
|
+
get: function() {
|
|
210
|
+
return view_roam_1.ViewRoam;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
const fish_eye_1 = require("./fish-eye");
|
|
215
|
+
|
|
216
|
+
Object.defineProperty(exports, "FishEye", {
|
|
217
|
+
enumerable: !0,
|
|
218
|
+
get: function() {
|
|
219
|
+
return fish_eye_1.FishEye;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
var base_tooltip_1 = require("./base-tooltip");
|
|
224
|
+
|
|
225
|
+
Object.defineProperty(exports, "BaseTooltip", {
|
|
226
|
+
enumerable: !0,
|
|
227
|
+
get: function() {
|
|
228
|
+
return base_tooltip_1.BaseTooltip;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
var base_1 = require("./base");
|
|
233
|
+
|
|
234
|
+
Object.defineProperty(exports, "BaseInteraction", {
|
|
235
|
+
enumerable: !0,
|
|
236
|
+
get: function() {
|
|
237
|
+
return base_1.BaseInteraction;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
var brush_base_1 = require("./brush-base");
|
|
242
|
+
|
|
243
|
+
Object.defineProperty(exports, "BrushBase", {
|
|
244
|
+
enumerable: !0,
|
|
245
|
+
get: function() {
|
|
246
|
+
return brush_base_1.BrushBase;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
var view_navigation_base_1 = require("./view-navigation-base");
|
|
251
|
+
|
|
252
|
+
Object.defineProperty(exports, "ViewNavigationBase", {
|
|
253
|
+
enumerable: !0,
|
|
254
|
+
get: function() {
|
|
255
|
+
return view_navigation_base_1.ViewNavigationBase;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
const registerElementActive = () => {
|
|
260
|
+
factory_1.Factory.registerInteraction(element_active_1.ElementActive.type, element_active_1.ElementActive);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
exports.registerElementActive = registerElementActive;
|
|
264
|
+
|
|
265
|
+
const registerElementSelect = () => {
|
|
266
|
+
factory_1.Factory.registerInteraction(element_select_1.ElementSelect.type, element_select_1.ElementSelect);
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
exports.registerElementSelect = registerElementSelect;
|
|
270
|
+
|
|
271
|
+
const registerElementHighlight = () => {
|
|
272
|
+
factory_1.Factory.registerInteraction(element_highlight_1.ElementHighlight.type, element_highlight_1.ElementHighlight);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
exports.registerElementHighlight = registerElementHighlight;
|
|
276
|
+
|
|
277
|
+
const registerElementHighlightByKey = () => {
|
|
278
|
+
factory_1.Factory.registerInteraction(element_highlight_by_key_1.ElementHighlightByKey.type, element_highlight_by_key_1.ElementHighlightByKey);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
exports.registerElementHighlightByKey = registerElementHighlightByKey;
|
|
282
|
+
|
|
283
|
+
const registerElementHighlightByGroup = () => {
|
|
284
|
+
factory_1.Factory.registerInteraction(element_highlight_by_group_1.ElementHighlightByGroup.type, element_highlight_by_group_1.ElementHighlightByGroup);
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
exports.registerElementHighlightByGroup = registerElementHighlightByGroup;
|
|
288
|
+
|
|
289
|
+
const registerElementActiveByLegend = () => {
|
|
290
|
+
factory_1.Factory.registerInteraction(element_active_by_legend_1.ElementActiveByLegend.type, element_active_by_legend_1.ElementActiveByLegend);
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
exports.registerElementActiveByLegend = registerElementActiveByLegend;
|
|
294
|
+
|
|
295
|
+
const registerElementHighlightByLegend = () => {
|
|
296
|
+
factory_1.Factory.registerInteraction(element_highlight_by_legend_1.ElementHighlightByLegend.type, element_highlight_by_legend_1.ElementHighlightByLegend);
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
exports.registerElementHighlightByLegend = registerElementHighlightByLegend;
|
|
300
|
+
|
|
301
|
+
const registerElementHighlightByName = () => {
|
|
302
|
+
factory_1.Factory.registerInteraction(element_highlight_by_name_1.ElementHighlightByName.type, element_highlight_by_name_1.ElementHighlightByName);
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
exports.registerElementHighlightByName = registerElementHighlightByName;
|
|
306
|
+
|
|
307
|
+
const registerBrushHighlight = () => {
|
|
308
|
+
factory_1.Factory.registerInteraction(brush_highlight_1.BrushHighlight.type, brush_highlight_1.BrushHighlight);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
exports.registerBrushHighlight = registerBrushHighlight;
|
|
312
|
+
|
|
313
|
+
const registerBrushActive = () => {
|
|
314
|
+
factory_1.Factory.registerInteraction(brush_active_1.BrushActive.type, brush_active_1.BrushActive);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
exports.registerBrushActive = registerBrushActive;
|
|
318
|
+
|
|
319
|
+
const registerBrushFilter = () => {
|
|
320
|
+
(0, vutils_1.mixin)(brush_filter_1.BrushFilter, filter_1.FilterMixin), factory_1.Factory.registerInteraction(brush_filter_1.BrushFilter.type, brush_filter_1.BrushFilter);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
exports.registerBrushFilter = registerBrushFilter;
|
|
324
|
+
|
|
325
|
+
const registerDrillDown = () => {
|
|
326
|
+
(0, vutils_1.mixin)(drill_down_1.DrillDown, filter_1.FilterMixin), factory_1.Factory.registerInteraction(drill_down_1.DrillDown.type, drill_down_1.DrillDown);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
exports.registerDrillDown = registerDrillDown;
|
|
330
|
+
|
|
331
|
+
const registerRollUp = () => {
|
|
332
|
+
factory_1.Factory.registerInteraction(roll_up_1.RollUp.type, roll_up_1.RollUp);
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
exports.registerRollUp = registerRollUp;
|
|
336
|
+
|
|
337
|
+
const registerTooltip = () => {
|
|
338
|
+
factory_1.Factory.registerInteraction(tooltip_1.Tooltip.type, tooltip_1.Tooltip);
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
exports.registerTooltip = registerTooltip;
|
|
342
|
+
|
|
343
|
+
const registerDimensionTooltip = () => {
|
|
344
|
+
factory_1.Factory.registerInteraction(dimension_tooltip_1.DimensionTooltip.type, dimension_tooltip_1.DimensionTooltip);
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
exports.registerDimensionTooltip = registerDimensionTooltip;
|
|
348
|
+
|
|
349
|
+
const registerCrosshair = () => {
|
|
350
|
+
factory_1.Factory.registerInteraction(crosshair_1.Crosshair.type, crosshair_1.Crosshair);
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
exports.registerCrosshair = registerCrosshair;
|
|
354
|
+
|
|
355
|
+
const registerViewZoom = () => {
|
|
356
|
+
(0, vutils_1.mixin)(view_zoom_1.ViewZoom, view_zoom_mixin_1.ViewZoomMixin), factory_1.Factory.registerInteraction(view_zoom_1.ViewZoom.type, view_zoom_1.ViewZoom);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
exports.registerViewZoom = registerViewZoom;
|
|
360
|
+
|
|
361
|
+
const registerViewScroll = () => {
|
|
362
|
+
(0, vutils_1.mixin)(view_scroll_1.ViewScroll, view_scroll_mixin_1.ViewScrollMixin),
|
|
363
|
+
factory_1.Factory.registerInteraction(view_scroll_1.ViewScroll.type, view_scroll_1.ViewScroll);
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
exports.registerViewScroll = registerViewScroll;
|
|
367
|
+
|
|
368
|
+
const registerViewDrag = () => {
|
|
369
|
+
(0, vutils_1.mixin)(view_drag_1.ViewDrag, view_drag_mixin_1.ViewDragMixin), factory_1.Factory.registerInteraction(view_drag_1.ViewDrag.type, view_drag_1.ViewDrag);
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
exports.registerViewDrag = registerViewDrag;
|
|
373
|
+
|
|
374
|
+
const registerViewRoam = () => {
|
|
375
|
+
(0, vutils_1.mixin)(view_roam_1.ViewRoam, view_zoom_mixin_1.ViewZoomMixin), (0,
|
|
376
|
+
vutils_1.mixin)(view_roam_1.ViewRoam, view_drag_mixin_1.ViewDragMixin), (0, vutils_1.mixin)(view_roam_1.ViewRoam, view_scroll_mixin_1.ViewScrollMixin),
|
|
377
|
+
factory_1.Factory.registerInteraction(view_roam_1.ViewRoam.type, view_roam_1.ViewRoam);
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
exports.registerViewRoam = registerViewRoam;
|
|
381
|
+
|
|
382
|
+
const registerFishEye = () => {
|
|
383
|
+
factory_1.Factory.registerInteraction(fish_eye_1.FishEye.type, fish_eye_1.FishEye);
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
exports.registerFishEye = registerFishEye;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../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AAC,oBAAQ,EAAE,+BAAa,CAAC,CAAC;IAC/B,IAAA,cAAK,EAAC,oBAAQ,EAAE,mCAAe,CAAC,CAAC;IACjC,iBAAO,CAAC,mBAAmB,CAAC,oBAAQ,CAAC,IAAI,EAAE,oBAAQ,CAAC,CAAC;AACvD,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B;AAEK,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,iBAAO,CAAC,mBAAmB,CAAC,kBAAO,CAAC,IAAI,EAAE,kBAAO,CAAC,CAAC;AACrD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","file":"index.js","sourcesContent":["import { Factory } from '../core/factory';\nimport { ElementActive } from './element-active';\nimport { ElementSelect } from './element-select';\nimport { ElementHighlight } from './element-highlight';\nimport { ElementHighlightByKey } from './element-highlight-by-key';\nimport { ElementHighlightByGroup } from './element-highlight-by-group';\nimport { ElementActiveByLegend } from './element-active-by-legend';\nimport { ElementHighlightByLegend } from './element-highlight-by-legend';\nimport { ElementHighlightByName } from './element-highlight-by-name';\nimport { BrushHighlight } from './brush-highlight';\nimport { BrushActive } from './brush-active';\nimport { BrushFilter } from './brush-filter';\nimport { DrillDown } from './drill-down';\nimport { RollUp } from './roll-up';\nimport { Tooltip } from './tooltip';\nimport { DimensionTooltip } from './dimension-tooltip';\nimport { Crosshair } from './crosshair';\nimport { FilterMixin } from './filter';\nimport { ViewZoom } from './view-zoom';\nimport { ViewScroll } from './view-scroll';\nimport { ViewDrag } from './view-drag';\nimport { mixin } from '@visactor/vutils';\nimport { ViewZoomMixin } from './view-zoom-mixin';\nimport { ViewScrollMixin } from './view-scroll-mixin';\nimport { ViewDragMixin } from './view-drag-mixin';\nimport { ViewRoam } from './view-roam';\nimport { FishEye } from './fish-eye';\n\nexport { BaseTooltip } from './base-tooltip';\nexport { BaseInteraction } from './base';\nexport { BrushBase } from './brush-base';\nexport { ViewNavigationBase } from './view-navigation-base';\nexport {\n ElementActive,\n ElementSelect,\n ElementHighlight,\n ElementHighlightByKey,\n ElementHighlightByGroup,\n ElementActiveByLegend,\n ElementHighlightByLegend,\n ElementHighlightByName,\n BrushHighlight,\n BrushActive,\n DrillDown,\n RollUp,\n Tooltip,\n DimensionTooltip,\n Crosshair,\n FilterMixin,\n ViewZoom,\n ViewScroll,\n ViewDrag,\n ViewRoam,\n ViewScrollMixin,\n ViewZoomMixin,\n ViewDragMixin,\n FishEye\n};\n\nexport const registerElementActive = () => {\n Factory.registerInteraction(ElementActive.type, ElementActive);\n};\n\nexport const registerElementSelect = () => {\n Factory.registerInteraction(ElementSelect.type, ElementSelect);\n};\n\nexport const registerElementHighlight = () => {\n Factory.registerInteraction(ElementHighlight.type, ElementHighlight);\n};\n\nexport const registerElementHighlightByKey = () => {\n Factory.registerInteraction(ElementHighlightByKey.type, ElementHighlightByKey);\n};\n\nexport const registerElementHighlightByGroup = () => {\n Factory.registerInteraction(ElementHighlightByGroup.type, ElementHighlightByGroup);\n};\n\nexport const registerElementActiveByLegend = () => {\n Factory.registerInteraction(ElementActiveByLegend.type, ElementActiveByLegend);\n};\n\nexport const registerElementHighlightByLegend = () => {\n Factory.registerInteraction(ElementHighlightByLegend.type, ElementHighlightByLegend);\n};\n\nexport const registerElementHighlightByName = () => {\n Factory.registerInteraction(ElementHighlightByName.type, ElementHighlightByName);\n};\n\nexport const registerBrushHighlight = () => {\n Factory.registerInteraction(BrushHighlight.type, BrushHighlight);\n};\n\nexport const registerBrushActive = () => {\n Factory.registerInteraction(BrushActive.type, BrushActive);\n};\n\nexport const registerBrushFilter = () => {\n mixin(BrushFilter, FilterMixin);\n Factory.registerInteraction(BrushFilter.type, BrushFilter);\n};\n\nexport const registerDrillDown = () => {\n mixin(DrillDown, FilterMixin);\n Factory.registerInteraction(DrillDown.type, DrillDown);\n};\n\nexport const registerRollUp = () => {\n Factory.registerInteraction(RollUp.type, RollUp);\n};\n\nexport const registerTooltip = () => {\n Factory.registerInteraction(Tooltip.type, Tooltip);\n};\n\nexport const registerDimensionTooltip = () => {\n Factory.registerInteraction(DimensionTooltip.type, DimensionTooltip);\n};\n\nexport const registerCrosshair = () => {\n Factory.registerInteraction(Crosshair.type, Crosshair);\n};\nexport const registerViewZoom = () => {\n mixin(ViewZoom, ViewZoomMixin);\n Factory.registerInteraction(ViewZoom.type, ViewZoom);\n};\n\nexport const registerViewScroll = () => {\n mixin(ViewScroll, ViewScrollMixin);\n Factory.registerInteraction(ViewScroll.type, ViewScroll);\n};\n\nexport const registerViewDrag = () => {\n mixin(ViewDrag, ViewDragMixin);\n Factory.registerInteraction(ViewDrag.type, ViewDrag);\n};\n\nexport const registerViewRoam = () => {\n mixin(ViewRoam, ViewZoomMixin);\n mixin(ViewRoam, ViewDragMixin);\n mixin(ViewRoam, ViewScrollMixin);\n Factory.registerInteraction(ViewRoam.type, ViewRoam);\n};\n\nexport const registerFishEye = () => {\n Factory.registerInteraction(FishEye.type, FishEye);\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataFilterOptions, IView, InteractionEvent } from '../types';
|
|
2
|
+
import { Filter } from './filter';
|
|
3
|
+
export declare class LegendFilter 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?: InteractionEvent) => void;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.LegendFilter = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_components_1 = require("@visactor/vrender-components"), graph_1 = require("../graph"), vutils_1 = require("@visactor/vutils"), filter_1 = require("./filter");
|
|
8
|
+
|
|
9
|
+
class LegendFilter extends filter_1.Filter {
|
|
10
|
+
constructor(view, options) {
|
|
11
|
+
super(view, options), this.type = LegendFilter.type, this.options = Object.assign({}, LegendFilter.defaultOptions, options),
|
|
12
|
+
this._marks = view.getMarksBySelector(this.options.source).filter((mark => mark.markType === graph_1.GrammarMarkType.component && "legend" === mark.componentType)),
|
|
13
|
+
this._data = (0, vutils_1.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 legend = this._marks[0];
|
|
18
|
+
if (!this._data || !legend) return [];
|
|
19
|
+
const isContinuous = legend.isContinuousLegend(), filter = this.options.target.filter, transform = this.options.target.transform, dataFilter = (0,
|
|
20
|
+
vutils_1.isString)(filter) ? isContinuous ? (datum, filterValue) => datum[filter] >= filterValue.start && datum[filter] <= filterValue.end : (datum, filterValue) => filterValue.includes(datum[filter]) : filter;
|
|
21
|
+
this._filterData(this._data, legend, graph_1.DataFilterRank.legend, (event => isContinuous ? {
|
|
22
|
+
start: event.detail.value[0],
|
|
23
|
+
end: event.detail.value[1]
|
|
24
|
+
} : event.detail.currentSelected), dataFilter, transform);
|
|
25
|
+
return [ {
|
|
26
|
+
type: isContinuous ? "change" : vrender_components_1.LegendEvent.legendItemClick,
|
|
27
|
+
handler: this.handleFilter
|
|
28
|
+
} ];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.LegendFilter = LegendFilter, LegendFilter.type = "legend-filter", LegendFilter.defaultOptions = {};
|
|
33
|
+
//# sourceMappingURL=legend-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/legend-filter.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE3D,oCAA2D;AAC3D,6CAA4C;AAC5C,qCAAkC;AAElC,MAAa,YAAa,SAAQ,eAAM;IAOtC,YAAY,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,CAAC,KAAuB,EAAE,EAAE,CACjD,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC;QAC7G,MAAM,UAAU,GAAG,IAAA,iBAAQ,EAAC,MAAM,CAAC;YACjC,CAAC,CAAC,YAAY;gBACZ,CAAC,CAAC,CAAC,KAAU,EAAE,WAA2C,EAAE,EAAE,CAC1D,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,GAAG;gBAC1E,CAAC,CAAC,CAAC,KAAU,EAAE,WAAkB,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC3E,CAAC,CAAC,MAAM,CAAC;QAEX,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,sBAAc,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAEnG,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,gCAAW,CAAC,eAAe,CAAC;QACxE,OAAO;YACL;gBACE,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,IAAI,CAAC,YAAY;aAC3B;SACF,CAAC;IACJ,CAAC;;AApDH,oCAqDC;AApDQ,iBAAI,GAAW,eAAe,CAAC;AAG/B,2BAAc,GAAsC,EAAE,CAAC","file":"legend-filter.js","sourcesContent":["import { LegendEvent } from '@visactor/vrender-components';\nimport type { DataFilterOptions, IComponent, ILegend, IView, InteractionEvent } from '../types';\nimport { DataFilterRank, GrammarMarkType } from '../graph';\nimport { isString } from '@visactor/vutils';\nimport { Filter } from './filter';\n\nexport class LegendFilter extends Filter {\n static type: string = 'legend-filter';\n type: string = LegendFilter.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({}, LegendFilter.defaultOptions, options);\n\n this._marks = view\n .getMarksBySelector(this.options.source)\n .filter(mark => mark.markType === GrammarMarkType.component && (mark as IComponent).componentType === 'legend');\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 legend = this._marks[0] as ILegend;\n\n if (!this._data || !legend) {\n return [];\n }\n\n const isContinuous = legend.isContinuousLegend();\n const filter = this.options.target.filter;\n const transform = this.options.target.transform;\n\n const getFilterValue = (event: InteractionEvent) =>\n isContinuous ? { start: event.detail.value[0], end: event.detail.value[1] } : event.detail.currentSelected;\n const dataFilter = isString(filter)\n ? isContinuous\n ? (datum: any, filterValue: { start: number; end: number }) =>\n datum[filter] >= filterValue.start && datum[filter] <= filterValue.end\n : (datum: any, filterValue: any[]) => filterValue.includes(datum[filter])\n : filter;\n\n this._filterData(this._data, legend, DataFilterRank.legend, getFilterValue, dataFilter, transform);\n\n const eventName = isContinuous ? 'change' : LegendEvent.legendItemClick;\n return [\n {\n type: eventName,\n handler: this.handleFilter\n }\n ];\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DataFilterOptions, IView } from '../types';
|
|
2
|
+
import { Filter } from './filter';
|
|
3
|
+
import { PlayerEventEnum } from '@visactor/vrender-components';
|
|
4
|
+
export declare class PlayerFilter extends Filter {
|
|
5
|
+
static type: string;
|
|
6
|
+
type: string;
|
|
7
|
+
static defaultOptions: Omit<DataFilterOptions, 'target'>;
|
|
8
|
+
options: DataFilterOptions;
|
|
9
|
+
constructor(view: IView, options?: DataFilterOptions);
|
|
10
|
+
protected getEvents(): {
|
|
11
|
+
type: PlayerEventEnum;
|
|
12
|
+
handler: (event?: import("../types").InteractionEvent) => void;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.PlayerFilter = void 0;
|
|
6
|
+
|
|
7
|
+
const graph_1 = require("../graph"), vutils_1 = require("@visactor/vutils"), filter_1 = require("./filter"), vrender_components_1 = require("@visactor/vrender-components");
|
|
8
|
+
|
|
9
|
+
class PlayerFilter extends filter_1.Filter {
|
|
10
|
+
constructor(view, options) {
|
|
11
|
+
super(view, options), this.type = PlayerFilter.type, this.options = Object.assign({}, PlayerFilter.defaultOptions, options),
|
|
12
|
+
this._marks = view.getMarksBySelector(this.options.source).filter((mark => mark.markType === graph_1.GrammarMarkType.component && "player" === mark.componentType)),
|
|
13
|
+
this._data = (0, vutils_1.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 player = this._marks[0];
|
|
18
|
+
if (!this._data || !player) return [];
|
|
19
|
+
const transform = this.options.target.transform;
|
|
20
|
+
return this._filterData(this._data, player, graph_1.DataFilterRank.player, (event => ({
|
|
21
|
+
index: event.detail.index,
|
|
22
|
+
value: event.detail.value
|
|
23
|
+
})), void 0, ((data, filterValue) => transform ? transform(data, filterValue) : filterValue.value)),
|
|
24
|
+
[ {
|
|
25
|
+
type: vrender_components_1.PlayerEventEnum.OnChange,
|
|
26
|
+
handler: this.handleFilter
|
|
27
|
+
} ];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
exports.PlayerFilter = PlayerFilter, PlayerFilter.type = "player-filter", PlayerFilter.defaultOptions = {};
|
|
32
|
+
//# sourceMappingURL=player-filter.js.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,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAEhD,MAAM,cAAc,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAClG,MAAM,aAAa,GAAG,CAAC,IAAW,EAAE,WAA8B,EAAE,EAAE;YACpE,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC;QACtE,CAAC,CAAC;QAEF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,sBAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAEtG,OAAO;YACL;gBACE,IAAI,EAAE,oCAAe,CAAC,QAAQ;gBAC9B,OAAO,EAAE,IAAI,CAAC,YAAY;aAC3B;SACF,CAAC;IACJ,CAAC;;AA7CH,oCA8CC;AA7CQ,iBAAI,GAAW,eAAe,CAAC;AAG/B,2BAAc,GAAsC,EAAE,CAAC","file":"player-filter.js","sourcesContent":["import type { DataFilterOptions, IComponent, IPlayer, IView, PlayerFilterValue } from '../types';\nimport { DataFilterRank, GrammarMarkType } from '../graph';\nimport { isString } from '@visactor/vutils';\nimport { Filter } from './filter';\nimport { PlayerEventEnum } from '@visactor/vrender-components';\n\nexport class PlayerFilter extends Filter {\n static type: string = 'player-filter';\n type: string = PlayerFilter.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({}, PlayerFilter.defaultOptions, options);\n\n this._marks = view\n .getMarksBySelector(this.options.source)\n .filter(mark => mark.markType === GrammarMarkType.component && (mark as IComponent).componentType === 'player');\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 player = this._marks[0] as IPlayer;\n\n if (!this._data || !player) {\n return [];\n }\n\n const transform = this.options.target.transform;\n\n const getFilterValue = (event: any) => ({ index: event.detail.index, value: event.detail.value });\n const dataTransform = (data: any[], filterValue: PlayerFilterValue) => {\n return transform ? transform(data, filterValue) : filterValue.value;\n };\n\n this._filterData(this._data, player, DataFilterRank.player, getFilterValue, undefined, dataTransform);\n\n return [\n {\n type: PlayerEventEnum.OnChange,\n handler: this.handleFilter\n }\n ];\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EventType, IView, InteractionEvent, RollUpOptions } from '../types';
|
|
2
|
+
import { Filter } from './filter';
|
|
3
|
+
export declare class RollUp extends Filter {
|
|
4
|
+
static type: string;
|
|
5
|
+
type: string;
|
|
6
|
+
static defaultOptions: Omit<RollUpOptions, 'target'>;
|
|
7
|
+
options: RollUpOptions;
|
|
8
|
+
protected _isToggle: boolean;
|
|
9
|
+
constructor(view: IView, options?: RollUpOptions);
|
|
10
|
+
protected getEvents(): {
|
|
11
|
+
type: EventType;
|
|
12
|
+
handler: (event: InteractionEvent) => void;
|
|
13
|
+
}[];
|
|
14
|
+
protected handleStart: (event: InteractionEvent) => void;
|
|
15
|
+
protected handleReset: (event: InteractionEvent) => void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.RollUp = void 0;
|
|
6
|
+
|
|
7
|
+
const graph_1 = require("../graph"), vutils_1 = require("@visactor/vutils"), filter_1 = require("./filter");
|
|
8
|
+
|
|
9
|
+
class RollUp extends filter_1.Filter {
|
|
10
|
+
constructor(view, options) {
|
|
11
|
+
super(view, options), this.type = RollUp.type, this._isToggle = !1, this.handleStart = event => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const element = event.element;
|
|
14
|
+
if (element && this._marks && this._marks.includes(element.mark)) {
|
|
15
|
+
const filterValue = null === (_b = null === (_a = event.element) || void 0 === _a ? void 0 : _a.getDatum) || void 0 === _b ? void 0 : _b.call(_a);
|
|
16
|
+
filterValue === this._filterData || (0, vutils_1.isArray)(filterValue) && (0, vutils_1.isArray)(this._filterValue) && filterValue.length === this._filterValue.length && filterValue.every((datum => !this._filterValue.includes(datum))) ? this._isToggle && (this._filterValue = null,
|
|
17
|
+
this.handleFilter(event)) : this.handleFilter(event);
|
|
18
|
+
}
|
|
19
|
+
}, this.handleReset = event => {
|
|
20
|
+
this._filterValue && (this._filterValue = null, this.handleFilter(event));
|
|
21
|
+
}, this.options = Object.assign({}, RollUp.defaultOptions, options), this._marks = view.getMarksBySelector(this.options.source),
|
|
22
|
+
this._data = (0, vutils_1.isString)(this.options.target.data) ? view.getDataById(this.options.target.data) : this.options.target.data;
|
|
23
|
+
}
|
|
24
|
+
getEvents() {
|
|
25
|
+
if (!this._marks || 0 === this._marks.length) return [];
|
|
26
|
+
if (!this._data) return [];
|
|
27
|
+
const transform = this.options.target.transform;
|
|
28
|
+
this._filterData(this._data, null, graph_1.DataFilterRank.rollUp, (event => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
return null === (_b = null === (_a = null == event ? void 0 : event.element) || void 0 === _a ? void 0 : _a.getDatum) || void 0 === _b ? void 0 : _b.call(_a);
|
|
31
|
+
}), void 0, ((data, filterValue) => transform(data, filterValue)));
|
|
32
|
+
const events = [ {
|
|
33
|
+
type: this.options.trigger,
|
|
34
|
+
handler: this.handleStart
|
|
35
|
+
} ], eventName = "empty" === this.options.resetTrigger ? this.options.trigger : this.options.resetTrigger.includes("view:") ? this.options.resetTrigger.replace("view:", "") : this.options.resetTrigger;
|
|
36
|
+
return eventName !== this.options.trigger ? (events.push({
|
|
37
|
+
type: eventName,
|
|
38
|
+
handler: this.handleReset
|
|
39
|
+
}), this._isToggle = !1) : this._isToggle = !0, events;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.RollUp = RollUp, RollUp.type = "roll-up", RollUp.defaultOptions = {
|
|
44
|
+
trigger: "click",
|
|
45
|
+
resetTrigger: "empty"
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=roll-up.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/interactions/roll-up.ts"],"names":[],"mappings":";;;AACA,oCAA0C;AAC1C,6CAAqD;AACrD,qCAAkC;AAElC,MAAa,MAAO,SAAQ,eAAM;IAYhC,YAAY,IAAW,EAAE,OAAuB;QAC9C,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAXvB,SAAI,GAAW,MAAM,CAAC,IAAI,CAAC;QAQjB,cAAS,GAAY,KAAK,CAAC;QAyD3B,gBAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;;YAClD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;YAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAChE,MAAM,WAAW,GAAG,MAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,QAAQ,kDAAI,CAAC;gBAEhD,MAAM,kBAAkB,GACtB,WAAW,KAAK,IAAI,CAAC,WAAW;oBAChC,CAAC,IAAA,gBAAO,EAAC,WAAW,CAAC;wBACnB,IAAA,gBAAO,EAAC,IAAI,CAAC,YAAY,CAAC;wBAC1B,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,YAAY,CAAC,MAAM;wBAC/C,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAEpE,IAAI,kBAAkB,EAAE;oBAEtB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O,EAAE,OAAO;IAChB,YAAY,EAAE,OAAO;CACtB,CAAC","file":"roll-up.js","sourcesContent":["import type { EventType, IView, InteractionEvent, RollUpOptions } from '../types';\nimport { DataFilterRank } from '../graph';\nimport { isArray, isString } from '@visactor/vutils';\nimport { Filter } from './filter';\n\nexport class RollUp extends Filter {\n static type: string = 'roll-up';\n type: string = RollUp.type;\n\n static defaultOptions: Omit<RollUpOptions, 'target'> = {\n trigger: 'click',\n resetTrigger: 'empty'\n };\n options: RollUpOptions;\n\n protected _isToggle: boolean = false;\n\n constructor(view: IView, options?: RollUpOptions) {\n super(view, options);\n this.options = Object.assign({}, RollUp.defaultOptions, options);\n\n this._marks = view.getMarksBySelector(this.options.source);\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 if (!this._data) {\n return [];\n }\n\n const transform = this.options.target.transform;\n\n const getFilterValue = (event: InteractionEvent) => event?.element?.getDatum?.();\n const dataTransform = (data: any[], filterValue: any) => {\n return transform(data, filterValue);\n };\n\n this._filterData(this._data, null, DataFilterRank.rollUp, getFilterValue, undefined, dataTransform);\n\n const events = [\n {\n type: this.options.trigger,\n handler: this.handleStart\n }\n ];\n\n const eventName =\n this.options.resetTrigger === 'empty'\n ? this.options.trigger\n : this.options.resetTrigger.includes('view:')\n ? this.options.resetTrigger.replace('view:', '')\n : this.options.resetTrigger;\n\n if (eventName !== this.options.trigger) {\n events.push({\n type: eventName as EventType,\n handler: this.handleReset\n });\n this._isToggle = false;\n } else {\n this._isToggle = true;\n }\n\n return events;\n }\n\n protected handleStart = (event: InteractionEvent) => {\n const element = event.element;\n if (element && this._marks && this._marks.includes(element.mark)) {\n const filterValue = event.element?.getDatum?.();\n\n const isEqualFilterValue =\n filterValue === this._filterData ||\n (isArray(filterValue) &&\n isArray(this._filterValue) &&\n filterValue.length === this._filterValue.length &&\n filterValue.every(datum => !this._filterValue.includes(datum)));\n\n if (isEqualFilterValue) {\n // reset filter value when toggle is enabled\n if (this._isToggle) {\n this._filterValue = null;\n this.handleFilter(event);\n }\n } else {\n this.handleFilter(event);\n }\n }\n };\n\n protected handleReset = (event: InteractionEvent) => {\n if (this._filterValue) {\n this._filterValue = null;\n this.handleFilter(event);\n }\n };\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataFilterOptions, IView } from '../types';
|
|
2
|
+
import { Filter } from './filter';
|
|
3
|
+
export declare class ScrollbarFilter 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
|
+
}
|