@visactor/vgrammar-core 0.13.6 → 0.13.7-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/component/axis.d.ts +2 -0
- package/cjs/component/axis.js +15 -1
- package/cjs/component/axis.js.map +1 -1
- package/cjs/component/grid.d.ts +2 -0
- package/cjs/component/grid.js +15 -1
- package/cjs/component/grid.js.map +1 -1
- package/cjs/component/index.d.ts +2 -2
- package/cjs/component/index.js +21 -1
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/label.js +36 -20
- package/cjs/component/label.js.map +1 -1
- package/cjs/component/player.js.map +1 -1
- package/cjs/core/factory.d.ts +8 -1
- package/cjs/core/factory.js +9 -2
- package/cjs/core/factory.js.map +1 -1
- package/cjs/glyph/boxplot.js +5 -5
- package/cjs/glyph/boxplot.js.map +1 -1
- package/cjs/glyph/link-path.js +2 -2
- package/cjs/glyph/link-path.js.map +1 -1
- package/cjs/glyph/ripple.js +3 -2
- package/cjs/glyph/ripple.js.map +1 -1
- package/cjs/glyph/tree-path.js +2 -2
- package/cjs/glyph/tree-path.js.map +1 -1
- package/cjs/glyph/violin.js +4 -4
- package/cjs/glyph/violin.js.map +1 -1
- package/cjs/glyph/wave.js +3 -2
- package/cjs/glyph/wave.js.map +1 -1
- package/cjs/graph/animation/animate.js +9 -4
- package/cjs/graph/animation/animate.js.map +1 -1
- package/cjs/graph/animation/animation/fade.js +5 -5
- package/cjs/graph/animation/animation/fade.js.map +1 -1
- package/cjs/graph/animation/animation/grow-cartesian.js +14 -14
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/cjs/graph/animation/animation/grow-interval.js +9 -9
- package/cjs/graph/animation/animation/grow-interval.js.map +1 -1
- package/cjs/graph/animation/animation/grow-points.js +9 -9
- package/cjs/graph/animation/animation/grow-points.js.map +1 -1
- package/cjs/graph/animation/animation/grow-polar.js +24 -24
- package/cjs/graph/animation/animation/grow-polar.js.map +1 -1
- package/cjs/graph/animation/animation/move.js +6 -6
- package/cjs/graph/animation/animation/move.js.map +1 -1
- package/cjs/graph/animation/animation/rotate.js +5 -5
- package/cjs/graph/animation/animation/rotate.js.map +1 -1
- package/cjs/graph/animation/animation/scale.js +5 -5
- package/cjs/graph/animation/animation/scale.js.map +1 -1
- package/cjs/graph/animation/animation/update.js +2 -2
- package/cjs/graph/animation/animation/update.js.map +1 -1
- package/cjs/graph/animation/animator.d.ts +1 -1
- package/cjs/graph/animation/animator.js +6 -1
- package/cjs/graph/animation/animator.js.map +1 -1
- package/cjs/graph/animation/morph.d.ts +2 -12
- package/cjs/graph/animation/morph.js +76 -163
- package/cjs/graph/animation/morph.js.map +1 -1
- package/cjs/graph/attributes/line.d.ts +1 -0
- package/cjs/graph/attributes/line.js +17 -5
- package/cjs/graph/attributes/line.js.map +1 -1
- package/cjs/graph/attributes/transform.js +7 -3
- package/cjs/graph/attributes/transform.js.map +1 -1
- package/cjs/graph/canvas-renderer.d.ts +1 -1
- package/cjs/graph/canvas-renderer.js +10 -5
- package/cjs/graph/canvas-renderer.js.map +1 -1
- package/cjs/graph/constants.d.ts +1 -0
- package/cjs/graph/constants.js +2 -2
- package/cjs/graph/constants.js.map +1 -1
- package/cjs/graph/element.d.ts +3 -0
- package/cjs/graph/element.js +40 -19
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/glyph-element.js +11 -9
- package/cjs/graph/glyph-element.js.map +1 -1
- package/cjs/graph/layout/layout.d.ts +1 -0
- package/cjs/graph/layout/layout.js +8 -2
- package/cjs/graph/layout/layout.js.map +1 -1
- package/cjs/graph/mark/graphic.js +14 -8
- package/cjs/graph/mark/graphic.js.map +1 -1
- package/cjs/graph/util/events-extend.d.ts +1 -2
- package/cjs/graph/util/events-extend.js +14 -3
- package/cjs/graph/util/events-extend.js.map +1 -1
- package/cjs/graph/util/point.js +10 -26
- package/cjs/graph/util/point.js.map +1 -1
- package/cjs/graph/view-diff.d.ts +8 -0
- package/cjs/graph/view-diff.js +93 -0
- package/cjs/graph/view-diff.js.map +1 -0
- package/cjs/index.d.ts +8 -1
- package/cjs/index.js +66 -2
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/base.js.map +1 -1
- package/cjs/interactions/brush-base.js +1 -2
- package/cjs/interactions/brush-filter.js +2 -1
- package/cjs/interactions/element-active-by-legend.d.ts +2 -1
- package/cjs/interactions/element-active-by-legend.js +5 -2
- package/cjs/interactions/element-active-by-legend.js.map +1 -1
- package/cjs/interactions/element-active.d.ts +3 -2
- package/cjs/interactions/element-active.js +4 -2
- package/cjs/interactions/element-active.js.map +1 -1
- package/cjs/interactions/element-highlight-by-graphic-name.d.ts +14 -0
- package/cjs/interactions/element-highlight-by-graphic-name.js +55 -0
- package/cjs/interactions/element-highlight-by-graphic-name.js.map +1 -0
- package/cjs/interactions/element-highlight-by-group.d.ts +2 -2
- package/cjs/interactions/element-highlight-by-group.js +4 -3
- package/cjs/interactions/element-highlight-by-group.js.map +1 -1
- package/cjs/interactions/element-highlight-by-key.d.ts +2 -2
- package/cjs/interactions/element-highlight-by-key.js +3 -17
- package/cjs/interactions/element-highlight-by-key.js.map +1 -1
- package/cjs/interactions/element-highlight-by-legend.d.ts +2 -1
- package/cjs/interactions/element-highlight-by-legend.js +6 -3
- package/cjs/interactions/element-highlight-by-legend.js.map +1 -1
- package/cjs/interactions/element-highlight-by-name.d.ts +2 -1
- package/cjs/interactions/element-highlight-by-name.js +5 -2
- package/cjs/interactions/element-highlight-by-name.js.map +1 -1
- package/cjs/interactions/element-highlight.d.ts +1 -1
- package/cjs/interactions/element-highlight.js +9 -6
- package/cjs/interactions/element-highlight.js.map +1 -1
- package/cjs/interactions/element-select-by-graphic-name.d.ts +7 -0
- package/cjs/interactions/element-select-by-graphic-name.js +26 -0
- package/cjs/interactions/element-select-by-graphic-name.js.map +1 -0
- package/cjs/interactions/element-select.d.ts +1 -1
- package/cjs/interactions/element-select.js +9 -10
- package/cjs/interactions/element-select.js.map +1 -1
- package/cjs/interactions/index.d.ts +2 -0
- package/cjs/interactions/index.js +17 -3
- package/cjs/interactions/index.js.map +1 -1
- package/cjs/interactions/slider-filter.js +1 -1
- package/cjs/interactions/toggle-state-mixin.js +9 -7
- package/cjs/interactions/toggle-state-mixin.js.map +1 -1
- package/cjs/interactions/tooltip.js +1 -1
- package/cjs/parse/event.d.ts +0 -2
- package/cjs/parse/event.js +4 -10
- package/cjs/parse/event.js.map +1 -1
- package/cjs/parse/util.js.map +1 -1
- package/cjs/semantic-marks/text.js.map +1 -1
- package/cjs/transforms/data/pie.js +2 -2
- package/cjs/transforms/data/pie.js.map +1 -1
- package/cjs/transforms/mark/mark-overlap.js +6 -6
- package/cjs/transforms/mark/mark-overlap.js.map +1 -1
- package/cjs/transforms/util/util.d.ts +0 -2
- package/cjs/transforms/util/util.js +3 -13
- package/cjs/transforms/util/util.js.map +1 -1
- package/cjs/types/animate.d.ts +3 -1
- package/cjs/types/animate.js.map +1 -1
- package/cjs/types/element.d.ts +5 -1
- package/cjs/types/element.js.map +1 -1
- package/cjs/types/grammar.d.ts +1 -0
- package/cjs/types/grammar.js.map +1 -1
- package/cjs/types/interaction.d.ts +4 -1
- package/cjs/types/interaction.js.map +1 -1
- package/cjs/types/mark.d.ts +2 -0
- package/cjs/types/mark.js.map +1 -1
- package/cjs/types/morph.d.ts +1 -2
- package/cjs/types/morph.js.map +1 -1
- package/cjs/types/renderer.d.ts +6 -1
- package/cjs/types/renderer.js.map +1 -1
- package/cjs/types/transform.d.ts +1 -0
- package/cjs/types/transform.js.map +1 -1
- package/cjs/types/view.d.ts +4 -1
- package/cjs/types/view.js.map +1 -1
- package/cjs/view/View.d.ts +3 -6
- package/cjs/view/View.js +73 -125
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/animate.js +2 -1
- package/cjs/view/animate.js.map +1 -1
- package/cjs/view/constants.d.ts +2 -0
- package/cjs/view/constants.js +3 -2
- package/cjs/view/constants.js.map +1 -1
- package/cjs/view/events.d.ts +0 -1
- package/cjs/view/events.js +3 -17
- package/cjs/view/events.js.map +1 -1
- package/cjs/view/glyph.d.ts +4 -0
- package/cjs/view/glyph.js +12 -3
- package/cjs/view/glyph.js.map +1 -1
- package/cjs/view/grammar-record.js +2 -3
- package/cjs/view/grammar-record.js.map +1 -1
- package/cjs/view/group.js +9 -6
- package/cjs/view/group.js.map +1 -1
- package/cjs/view/mark-animate-mixin.d.ts +1 -0
- package/cjs/view/mark-animate-mixin.js +29 -0
- package/cjs/view/mark-animate-mixin.js.map +1 -0
- package/cjs/view/mark.d.ts +4 -1
- package/cjs/view/mark.js +104 -68
- package/cjs/view/mark.js.map +1 -1
- package/cjs/view/view-animate-mixin.d.ts +1 -0
- package/cjs/view/view-animate-mixin.js +26 -0
- package/cjs/view/view-animate-mixin.js.map +1 -0
- package/cjs/view/view-event-mixin.d.ts +1 -0
- package/cjs/view/view-event-mixin.js +92 -0
- package/cjs/view/view-event-mixin.js.map +1 -0
- package/cjs/view/view-morph-mixin.d.ts +1 -0
- package/cjs/view/view-morph-mixin.js +32 -0
- package/cjs/view/view-morph-mixin.js.map +1 -0
- package/es/component/axis.d.ts +2 -0
- package/es/component/axis.js +10 -0
- package/es/component/axis.js.map +1 -1
- package/es/component/grid.d.ts +2 -0
- package/es/component/grid.js +10 -0
- package/es/component/grid.js.map +1 -1
- package/es/component/index.d.ts +2 -2
- package/es/component/index.js +2 -2
- package/es/component/index.js.map +1 -1
- package/es/component/label.js +35 -19
- package/es/component/label.js.map +1 -1
- package/es/component/player.js.map +1 -1
- package/es/core/factory.d.ts +8 -1
- package/es/core/factory.js +10 -2
- package/es/core/factory.js.map +1 -1
- package/es/glyph/boxplot.js +4 -2
- package/es/glyph/boxplot.js.map +1 -1
- package/es/glyph/link-path.js +4 -2
- package/es/glyph/link-path.js.map +1 -1
- package/es/glyph/ripple.js +3 -1
- package/es/glyph/ripple.js.map +1 -1
- package/es/glyph/tree-path.js +4 -2
- package/es/glyph/tree-path.js.map +1 -1
- package/es/glyph/violin.js +4 -2
- package/es/glyph/violin.js.map +1 -1
- package/es/glyph/wave.js +3 -1
- package/es/glyph/wave.js.map +1 -1
- package/es/graph/animation/animate.js +9 -4
- package/es/graph/animation/animate.js.map +1 -1
- package/es/graph/animation/animation/fade.js +5 -5
- package/es/graph/animation/animation/fade.js.map +1 -1
- package/es/graph/animation/animation/grow-cartesian.js +14 -14
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
- package/es/graph/animation/animation/grow-interval.js +9 -9
- package/es/graph/animation/animation/grow-interval.js.map +1 -1
- package/es/graph/animation/animation/grow-points.js +9 -9
- package/es/graph/animation/animation/grow-points.js.map +1 -1
- package/es/graph/animation/animation/grow-polar.js +24 -24
- package/es/graph/animation/animation/grow-polar.js.map +1 -1
- package/es/graph/animation/animation/move.js +6 -6
- package/es/graph/animation/animation/move.js.map +1 -1
- package/es/graph/animation/animation/rotate.js +4 -4
- package/es/graph/animation/animation/rotate.js.map +1 -1
- package/es/graph/animation/animation/scale.js +5 -5
- package/es/graph/animation/animation/scale.js.map +1 -1
- package/es/graph/animation/animation/update.js +1 -3
- package/es/graph/animation/animation/update.js.map +1 -1
- package/es/graph/animation/animator.d.ts +1 -1
- package/es/graph/animation/animator.js +6 -1
- package/es/graph/animation/animator.js.map +1 -1
- package/es/graph/animation/morph.d.ts +2 -12
- package/es/graph/animation/morph.js +72 -159
- package/es/graph/animation/morph.js.map +1 -1
- package/es/graph/attributes/line.d.ts +1 -0
- package/es/graph/attributes/line.js +14 -3
- package/es/graph/attributes/line.js.map +1 -1
- package/es/graph/attributes/transform.js +7 -3
- package/es/graph/attributes/transform.js.map +1 -1
- package/es/graph/canvas-renderer.d.ts +1 -1
- package/es/graph/canvas-renderer.js +11 -6
- package/es/graph/canvas-renderer.js.map +1 -1
- package/es/graph/constants.d.ts +1 -0
- package/es/graph/constants.js +2 -0
- package/es/graph/constants.js.map +1 -1
- package/es/graph/element.d.ts +3 -0
- package/es/graph/element.js +39 -21
- package/es/graph/element.js.map +1 -1
- package/es/graph/glyph-element.js +10 -11
- package/es/graph/glyph-element.js.map +1 -1
- package/es/graph/layout/layout.d.ts +1 -0
- package/es/graph/layout/layout.js +6 -0
- package/es/graph/layout/layout.js.map +1 -1
- package/es/graph/mark/graphic.js +13 -7
- package/es/graph/mark/graphic.js.map +1 -1
- package/es/graph/util/events-extend.d.ts +1 -2
- package/es/graph/util/events-extend.js +16 -3
- package/es/graph/util/events-extend.js.map +1 -1
- package/es/graph/util/point.js +10 -26
- package/es/graph/util/point.js.map +1 -1
- package/es/graph/view-diff.d.ts +8 -0
- package/es/graph/view-diff.js +89 -0
- package/es/graph/view-diff.js.map +1 -0
- package/es/index.d.ts +8 -1
- package/es/index.js +29 -1
- package/es/index.js.map +1 -1
- package/es/interactions/base.js.map +1 -1
- package/es/interactions/brush-filter.js +2 -1
- package/es/interactions/element-active-by-legend.d.ts +2 -1
- package/es/interactions/element-active-by-legend.js +5 -2
- package/es/interactions/element-active-by-legend.js.map +1 -1
- package/es/interactions/element-active.d.ts +3 -2
- package/es/interactions/element-active.js +5 -4
- package/es/interactions/element-active.js.map +1 -1
- package/es/interactions/element-highlight-by-graphic-name.d.ts +14 -0
- package/es/interactions/element-highlight-by-graphic-name.js +51 -0
- package/es/interactions/element-highlight-by-graphic-name.js.map +1 -0
- package/es/interactions/element-highlight-by-group.d.ts +2 -2
- package/es/interactions/element-highlight-by-group.js +4 -3
- package/es/interactions/element-highlight-by-group.js.map +1 -1
- package/es/interactions/element-highlight-by-key.d.ts +2 -2
- package/es/interactions/element-highlight-by-key.js +3 -17
- package/es/interactions/element-highlight-by-key.js.map +1 -1
- package/es/interactions/element-highlight-by-legend.d.ts +2 -1
- package/es/interactions/element-highlight-by-legend.js +6 -3
- package/es/interactions/element-highlight-by-legend.js.map +1 -1
- package/es/interactions/element-highlight-by-name.d.ts +2 -1
- package/es/interactions/element-highlight-by-name.js +5 -2
- package/es/interactions/element-highlight-by-name.js.map +1 -1
- package/es/interactions/element-highlight.d.ts +1 -1
- package/es/interactions/element-highlight.js +9 -6
- package/es/interactions/element-highlight.js.map +1 -1
- package/es/interactions/element-select-by-graphic-name.d.ts +7 -0
- package/es/interactions/element-select-by-graphic-name.js +20 -0
- package/es/interactions/element-select-by-graphic-name.js.map +1 -0
- package/es/interactions/element-select.d.ts +1 -1
- package/es/interactions/element-select.js +9 -9
- package/es/interactions/element-select.js.map +1 -1
- package/es/interactions/filter.js +1 -1
- package/es/interactions/fish-eye.js +1 -1
- package/es/interactions/index.d.ts +2 -0
- package/es/interactions/index.js +14 -1
- package/es/interactions/index.js.map +1 -1
- package/es/interactions/legend-filter.js +1 -1
- package/es/interactions/player-filter.js +1 -1
- package/es/interactions/roll-up.js +1 -1
- package/es/interactions/scrollbar-filter.js +1 -1
- package/es/interactions/slider-filter.js +1 -1
- package/es/interactions/toggle-state-mixin.js +9 -7
- package/es/interactions/toggle-state-mixin.js.map +1 -1
- package/es/interactions/tooltip.js +1 -1
- package/es/parse/coordinate.js +1 -1
- package/es/parse/event.d.ts +0 -2
- package/es/parse/event.js +4 -8
- package/es/parse/event.js.map +1 -1
- package/es/parse/mark.js +1 -1
- package/es/parse/option.js +1 -2
- package/es/parse/scale.js +1 -1
- package/es/parse/transform.js +1 -1
- package/es/parse/util.js +1 -1
- package/es/parse/util.js.map +1 -1
- package/es/parse/view.js +1 -1
- package/es/semantic-marks/text.js.map +1 -1
- package/es/transforms/data/pie.js +1 -1
- package/es/transforms/data/pie.js.map +1 -1
- package/es/transforms/mark/mark-overlap.js +6 -6
- package/es/transforms/mark/mark-overlap.js.map +1 -1
- package/es/transforms/util/util.d.ts +0 -2
- package/es/transforms/util/util.js +0 -10
- package/es/transforms/util/util.js.map +1 -1
- package/es/types/animate.d.ts +3 -1
- package/es/types/animate.js.map +1 -1
- package/es/types/element.d.ts +5 -1
- package/es/types/element.js.map +1 -1
- package/es/types/grammar.d.ts +1 -0
- package/es/types/grammar.js.map +1 -1
- package/es/types/interaction.d.ts +4 -1
- package/es/types/interaction.js.map +1 -1
- package/es/types/mark.d.ts +2 -0
- package/es/types/mark.js.map +1 -1
- package/es/types/morph.d.ts +1 -2
- package/es/types/morph.js.map +1 -1
- package/es/types/renderer.d.ts +6 -1
- package/es/types/renderer.js.map +1 -1
- package/es/types/transform.d.ts +1 -0
- package/es/types/transform.js.map +1 -1
- package/es/types/view.d.ts +4 -1
- package/es/types/view.js.map +1 -1
- package/es/view/View.d.ts +3 -6
- package/es/view/View.js +63 -124
- package/es/view/View.js.map +1 -1
- package/es/view/animate.js +2 -1
- package/es/view/animate.js.map +1 -1
- package/es/view/constants.d.ts +2 -0
- package/es/view/constants.js +4 -0
- package/es/view/constants.js.map +1 -1
- package/es/view/events.d.ts +0 -1
- package/es/view/events.js +1 -15
- package/es/view/events.js.map +1 -1
- package/es/view/glyph.d.ts +4 -0
- package/es/view/glyph.js +11 -0
- package/es/view/glyph.js.map +1 -1
- package/es/view/grammar-record.js +2 -3
- package/es/view/grammar-record.js.map +1 -1
- package/es/view/group.js +8 -7
- package/es/view/group.js.map +1 -1
- package/es/view/mark-animate-mixin.d.ts +1 -0
- package/es/view/mark-animate-mixin.js +25 -0
- package/es/view/mark-animate-mixin.js.map +1 -0
- package/es/view/mark.d.ts +4 -1
- package/es/view/mark.js +102 -70
- package/es/view/mark.js.map +1 -1
- package/es/view/view-animate-mixin.d.ts +1 -0
- package/es/view/view-animate-mixin.js +16 -0
- package/es/view/view-animate-mixin.js.map +1 -0
- package/es/view/view-event-mixin.d.ts +1 -0
- package/es/view/view-event-mixin.js +90 -0
- package/es/view/view-event-mixin.js.map +1 -0
- package/es/view/view-morph-mixin.d.ts +1 -0
- package/es/view/view-morph-mixin.js +22 -0
- package/es/view/view-morph-mixin.js.map +1 -0
- package/package.json +12 -12
- package/cjs/graph/util/element.d.ts +0 -2
- package/cjs/graph/util/element.js +0 -10
- package/cjs/graph/util/element.js.map +0 -1
- package/es/graph/util/element.d.ts +0 -2
- package/es/graph/util/element.js +0 -8
- package/es/graph/util/element.js.map +0 -1
package/es/types/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { DataSpec } from './data';\nimport type { SignalFunctionType, SignalSpec } from './signal';\nimport type {\n IData,\n ISignal,\n IScale,\n IMark,\n IGrammarBase,\n ICoordinate,\n IGlyphMark,\n IGroupMark,\n IComponent\n} from './grammar';\nimport type { ScaleSpec, GrammarScaleType } from './scale';\nimport type { MarkSpec, MarkType } from './mark';\nimport type { Hooks } from './hooks';\nimport type { ProjectionSpec } from './projection';\nimport type { BaseEventHandler, EventSpec } from './event';\nimport type { CommonPaddingSpec } from './base';\nimport type { IMorphAnimationConfig } from './morph';\nimport type { IBaseAnimate } from './animate';\nimport type { IRenderer } from './renderer';\nimport type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\nimport type { IInteraction, InteractionSpec } from './interaction';\n\nexport interface IViewThemeConfig {\n labelMonospace?: boolean;\n}\n\n/**\n * 获取state相关配置\n */\nexport interface IViewStateOptions {\n signals?: (name?: string, operator?: any) => boolean;\n data?: (name?: string, object?: any) => boolean;\n recurse?: boolean;\n}\n\nexport interface IEnvironmentOptions {\n /** 环境参数 */\n mode?: EnvType;\n /**\n * 环境带的配置\n */\n modeParams?: any;\n}\n\nexport interface IRendererOptions extends Partial<IStageParams> {\n /** 非浏览器环境下,如小程序,需要传入经过包装的伪 canvas 实例 */\n renderCanvas?: string | HTMLCanvasElement;\n /** vRender stage */\n stage?: IStage;\n rendererTitle?: string;\n /** vRender layer */\n layer?: ILayer;\n}\n\nexport interface ILayoutOptions {\n parseMarkBounds?: (bounds: IBounds, mark: IMark) => IBounds;\n doLayout?: (marks: IMark[], options: ILayoutOptions, view: IView) => void;\n}\n\n/** 事件配置 */\nexport interface IViewEventConfig {\n /**\n * preventDefaults相关配置\n */\n defaults?: {\n prevent?: boolean | Record<string, boolean>;\n allow?: boolean | Record<string, boolean>;\n };\n /**\n * whether permit events of view\n */\n view?: boolean | Record<string, boolean>;\n /** disable all the events */\n disable?: boolean;\n /** use gesture events or not */\n gesture?: boolean;\n /** use drag events or not */\n drag?: boolean;\n}\n\nexport interface srIOption3DType extends IOption3D {\n enable?: boolean;\n /* 是否支持3d视角变换 */\n enableView3dTranform?: boolean;\n}\nexport interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILayoutOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n\n options3d?: srIOption3DType;\n /** 外部传入的logger方法 */\n logger?: ILogger;\n /**\n * 0 - None\n * 1 - Error\n * 2 - Warn\n * 3 - Info\n * 4 - Debug\n */\n logLevel?: number;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\n background?: IColor;\n disableTheme?: boolean;\n}\n\nexport interface IRunningConfig {\n /** whether enable reusing of grammar */\n reuse?: boolean;\n /** whether enable morph */\n morph?: boolean;\n /** force all marks to participate in morphing */\n morphAll?: boolean;\n /** morphing animation config */\n animation?: IMorphAnimationConfig;\n /** whether apply exit animations for released marks */\n enableExitAnimation?: boolean;\n}\n\nexport interface IView {\n readonly renderer: IRenderer;\n readonly rootMark: IGroupMark;\n readonly animate: IBaseAnimate;\n readonly grammars: IRecordedGrammars;\n readonly logger: ILogger;\n\n // --- Grammar API ---\n signal: <T>(value?: T, update?: SignalFunctionType<T>) => ISignal<T>;\n data: (values?: any[]) => IData;\n scale: (type: GrammarScaleType) => IScale;\n coordinate: (type: CoordinateType) => ICoordinate;\n mark: (\n type: MarkType,\n group: IGroupMark | string,\n markOptions?: { glyphType?: string; componentType?: string; mode?: '2d' | '3d' }\n ) => IMark;\n group: (group: IGroupMark | string) => IGroupMark;\n glyph: (glyphType: string, group: IGroupMark | string) => IGlyphMark;\n component: (componentType: string, group: IGroupMark | string, mode?: '2d' | '3d') => IComponent;\n axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;\n grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;\n legend: (group: IGroupMark | string) => ILegend;\n slider: (group: IGroupMark | string) => ISlider;\n label: (group: IGroupMark | string) => ILabel;\n datazoom: (group: IGroupMark | string) => IDatazoom;\n player: (group: IGroupMark | string) => IPlayer;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n interaction: (type: string, spec: Partial<InteractionSpec>) => IInteraction;\n removeInteraction: (type: string) => this;\n removeAllInteractions: () => this;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => this;\n removeAllGraphicItems: () => this;\n\n getGrammarById: (id: string) => IGrammarBase | null;\n getCustomizedById: (id: string) => IGrammarBase | null;\n getSignalById: <T>(id: string) => ISignal<T> | null;\n getDataById: (id: string) => IData | null;\n getScaleById: (id: string) => IScale | null;\n getCoordinateById: (id: string) => ICoordinate | null;\n getMarkById: (id: string) => IMark | null;\n getGrammarsByName: (name: string) => IGrammarBase[];\n getGrammarsByType: (grammarType: string) => IGrammarBase[];\n getMarksByType: (markType: string) => IMark[];\n getMarksByName: (name: string) => IMark[] | null;\n getMarksBySelector: (selector: string | string[] | IMark | IMark[]) => IMark[] | null;\n\n commit: (grammar: IGrammarBase) => this;\n\n // --- Spec API ---\n parseSpec: (spec: ViewSpec) => this;\n updateSpec: (spec: ViewSpec) => this;\n\n // --- Evaluate API ---\n run: (runningConfig?: IRunningConfig) => this;\n runBefore: (callback: (view: IView) => void) => this;\n runAfter: (callback: (view: IView) => void) => this;\n\n // --- Theme API ---\n theme: (theme: ITheme | string) => this;\n getCurrentTheme: () => ITheme;\n setCurrentTheme: (theme: ITheme | string, render?: boolean) => this;\n\n // --- Global Config API ---\n background: (value?: IColor) => IColor;\n width: (value?: number) => number;\n height: (value?: number) => number;\n viewWidth: (value?: number) => number;\n viewHeight: (value?: number) => number;\n padding: (p?: number | { left?: number; right?: number; top?: number; bottom?: number }) => {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n getViewBox: () => IBounds;\n\n // --- Event API ---\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // --- Other API ---\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n resize: (width: number, height: number, render?: boolean) => this;\n traverseMarkTree: (apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean) => this;\n\n getLayoutState: () => string;\n updateLayoutTag: () => this;\n\n pauseProgressive: () => boolean;\n resumeProgressive: () => boolean;\n restartProgressive: () => boolean;\n\n release: () => void;\n getImageBuffer: () => Buffer;\n}\n\nexport interface IViewConstructor {\n new (options?: IViewOptions, config?: IViewThemeConfig): IView;\n}\n\nexport interface ViewSpec {\n /** 梳理详细配置 */\n theme?: string;\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number | { left?: number; right?: number; top?: number; bottom?: number };\n signals?: SignalSpec<any>[];\n projections?: ProjectionSpec[];\n data?: DataSpec[];\n scales?: ScaleSpec[];\n coordinates?: CoordinateSpec[];\n marks?: MarkSpec[];\n events?: EventSpec[];\n interactions?: InteractionSpec[];\n animation?: boolean;\n}\n\nexport interface IRecordedGrammars {\n record: (grammar: IGrammarBase) => this;\n unrecord: (grammar: IGrammarBase) => this;\n\n size: () => number;\n\n getSignal: <T>(key: string) => ISignal<T> | null;\n getData: (key: string) => IData | null;\n getScale: (key: string) => IScale | null;\n getCoordinate: (key: string) => ICoordinate | null;\n getMark: (key: string) => IMark | null;\n getCustomized: (key: string) => IGrammarBase | null;\n getGrammar: (key: string) => IGrammarBase | null;\n\n getAllSignals: () => ISignal<any>[];\n getAllData: () => IData[];\n getAllScales: () => IScale[];\n getAllCoordinates: () => ICoordinate[];\n getAllMarks: () => IMark[];\n getAllCustomized: () => IGrammarBase[];\n\n clear: () => void;\n\n traverse: (func: (grammar: IGrammarBase) => boolean | void) => void;\n find: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase | null;\n filter: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase[];\n\n release: () => void;\n}\n\nexport interface IMarkTreeNode {\n mark: IMark;\n parent: IMarkTreeNode;\n children: IMarkTreeNode[];\n}\n\nexport interface IRecordedTreeGrammars extends IRecordedGrammars {\n getAllMarkNodes: () => IMarkTreeNode[];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { DataSpec } from './data';\nimport type { SignalFunctionType, SignalSpec } from './signal';\nimport type {\n IData,\n ISignal,\n IScale,\n IMark,\n IGrammarBase,\n ICoordinate,\n IGlyphMark,\n IGroupMark,\n IComponent\n} from './grammar';\nimport type { ScaleSpec, GrammarScaleType } from './scale';\nimport type { MarkSpec, MarkType } from './mark';\nimport type { Hooks } from './hooks';\nimport type { ProjectionSpec } from './projection';\nimport type { BaseEventHandler, EventSpec } from './event';\nimport type { CommonPaddingSpec } from './base';\nimport type { IMorphAnimationConfig } from './morph';\nimport type { IBaseAnimate } from './animate';\nimport type { IRenderer } from './renderer';\nimport type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\nimport type { IInteraction, InteractionSpec } from './interaction';\nimport type { GestureConfig } from '@visactor/vrender-kits';\n\nexport interface IViewThemeConfig {\n labelMonospace?: boolean;\n}\n\n/**\n * 获取state相关配置\n */\nexport interface IViewStateOptions {\n signals?: (name?: string, operator?: any) => boolean;\n data?: (name?: string, object?: any) => boolean;\n recurse?: boolean;\n}\n\nexport interface IEnvironmentOptions {\n /** 环境参数 */\n mode?: EnvType;\n /**\n * 环境带的配置\n */\n modeParams?: any;\n}\n\nexport interface IRendererOptions extends Partial<IStageParams> {\n /** 非浏览器环境下,如小程序,需要传入经过包装的伪 canvas 实例 */\n renderCanvas?: string | HTMLCanvasElement;\n /** vRender stage */\n stage?: IStage;\n rendererTitle?: string;\n /** vRender layer */\n layer?: ILayer;\n}\n\nexport interface ILayoutOptions {\n parseMarkBounds?: (bounds: IBounds, mark: IMark) => IBounds;\n doLayout?: (marks: IMark[], options: ILayoutOptions, view: IView) => void;\n}\n\n/** 事件配置 */\nexport interface IViewEventConfig {\n /**\n * preventDefaults相关配置\n */\n defaults?: {\n prevent?: boolean | Record<string, boolean>;\n allow?: boolean | Record<string, boolean>;\n };\n /**\n * whether permit events of view\n */\n view?: boolean | Record<string, boolean>;\n /** disable all the events */\n disable?: boolean;\n /** use gesture events or not */\n gesture?: boolean | GestureConfig;\n /** use drag events or not */\n drag?: boolean;\n /**\n * @since 0.15.2\n * @default 200\n * VRender 参数 ,单位 ms\n * 多次点击之间的最大时间,默认为 200 ms,用于判断点击次数\n */\n clickInterval?: number;\n /**\n * @since 0.15.2\n * @default false\n * VRender 参数 是否自动阻止事件\n */\n autoPreventDefault?: boolean;\n}\n\nexport interface srIOption3DType extends IOption3D {\n enable?: boolean;\n /* 是否支持3d视角变换 */\n enableView3dTranform?: boolean;\n}\nexport interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILayoutOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n\n options3d?: srIOption3DType;\n /** 外部传入的logger方法 */\n logger?: ILogger;\n /**\n * 0 - None\n * 1 - Error\n * 2 - Warn\n * 3 - Info\n * 4 - Debug\n */\n logLevel?: number;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\n background?: IColor;\n disableTheme?: boolean;\n}\n\nexport interface IRunningConfig {\n /** whether enable reusing of grammar */\n reuse?: boolean;\n /** whether enable morph */\n morph?: boolean;\n /** force all marks to participate in morphing */\n morphAll?: boolean;\n /** morphing animation config */\n animation?: IMorphAnimationConfig;\n /** whether apply exit animations for released marks */\n enableExitAnimation?: boolean;\n}\n\nexport interface IView {\n readonly renderer: IRenderer;\n readonly rootMark: IGroupMark;\n readonly animate: IBaseAnimate;\n readonly grammars: IRecordedGrammars;\n readonly logger: ILogger;\n\n // --- Grammar API ---\n signal: <T>(value?: T, update?: SignalFunctionType<T>) => ISignal<T>;\n data: (values?: any[]) => IData;\n scale: (type: GrammarScaleType) => IScale;\n coordinate: (type: CoordinateType) => ICoordinate;\n mark: (\n type: MarkType,\n group: IGroupMark | string,\n markOptions?: { glyphType?: string; componentType?: string; mode?: '2d' | '3d' }\n ) => IMark;\n group: (group: IGroupMark | string) => IGroupMark;\n glyph: (glyphType: string, group: IGroupMark | string) => IGlyphMark;\n component: (componentType: string, group: IGroupMark | string, mode?: '2d' | '3d') => IComponent;\n axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;\n grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;\n legend: (group: IGroupMark | string) => ILegend;\n slider: (group: IGroupMark | string) => ISlider;\n label: (group: IGroupMark | string) => ILabel;\n datazoom: (group: IGroupMark | string) => IDatazoom;\n player: (group: IGroupMark | string) => IPlayer;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n interaction: (type: string, spec: Partial<InteractionSpec>) => IInteraction;\n removeInteraction: (type: string) => this;\n removeAllInteractions: () => this;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => this;\n removeAllGraphicItems: () => this;\n\n getGrammarById: (id: string) => IGrammarBase | null;\n getCustomizedById: (id: string) => IGrammarBase | null;\n getSignalById: <T>(id: string) => ISignal<T> | null;\n getDataById: (id: string) => IData | null;\n getScaleById: (id: string) => IScale | null;\n getCoordinateById: (id: string) => ICoordinate | null;\n getMarkById: (id: string) => IMark | null;\n getGrammarsByName: (name: string) => IGrammarBase[];\n getGrammarsByType: (grammarType: string) => IGrammarBase[];\n getMarksByType: (markType: string) => IMark[];\n getMarksByName: (name: string) => IMark[] | null;\n getMarksBySelector: (selector: string | string[] | IMark | IMark[]) => IMark[] | null;\n\n commit: (grammar: IGrammarBase) => this;\n\n // --- Spec API ---\n parseSpec: (spec: ViewSpec) => this;\n updateSpec: (spec: ViewSpec) => this;\n\n // --- Evaluate API ---\n run: (runningConfig?: IRunningConfig) => this;\n runBefore: (callback: (view: IView) => void) => this;\n runAfter: (callback: (view: IView) => void) => this;\n\n // --- Theme API ---\n theme: (theme: ITheme | string) => this;\n getCurrentTheme: () => ITheme;\n setCurrentTheme: (theme: ITheme | string, render?: boolean) => this;\n\n // --- Global Config API ---\n background: (value?: IColor) => IColor;\n width: (value?: number) => number;\n height: (value?: number) => number;\n viewWidth: (value?: number) => number;\n viewHeight: (value?: number) => number;\n padding: (p?: number | { left?: number; right?: number; top?: number; bottom?: number }) => {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n getViewBox: () => IBounds;\n\n // --- Event API ---\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // --- Other API ---\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n resize: (width: number, height: number, render?: boolean) => this;\n traverseMarkTree: (apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean) => this;\n\n getLayoutState: () => string;\n updateLayoutTag: () => this;\n\n pauseProgressive: () => boolean;\n resumeProgressive: () => boolean;\n restartProgressive: () => boolean;\n\n release: () => void;\n getImageBuffer: () => Buffer;\n}\n\nexport interface IViewConstructor {\n new (options?: IViewOptions, config?: IViewThemeConfig): IView;\n}\n\nexport interface ViewSpec {\n /** 梳理详细配置 */\n theme?: string;\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number | { left?: number; right?: number; top?: number; bottom?: number };\n signals?: SignalSpec<any>[];\n projections?: ProjectionSpec[];\n data?: DataSpec[];\n scales?: ScaleSpec[];\n coordinates?: CoordinateSpec[];\n marks?: MarkSpec[];\n events?: EventSpec[];\n interactions?: InteractionSpec[];\n animation?: boolean;\n}\n\nexport interface IRecordedGrammars {\n record: (grammar: IGrammarBase) => this;\n unrecord: (grammar: IGrammarBase) => this;\n\n size: () => number;\n\n getSignal: <T>(key: string) => ISignal<T> | null;\n getData: (key: string) => IData | null;\n getScale: (key: string) => IScale | null;\n getCoordinate: (key: string) => ICoordinate | null;\n getMark: (key: string) => IMark | null;\n getCustomized: (key: string) => IGrammarBase | null;\n getGrammar: (key: string) => IGrammarBase | null;\n\n getAllSignals: () => ISignal<any>[];\n getAllData: () => IData[];\n getAllScales: () => IScale[];\n getAllCoordinates: () => ICoordinate[];\n getAllMarks: () => IMark[];\n getAllCustomized: () => IGrammarBase[];\n\n clear: () => void;\n\n traverse: (func: (grammar: IGrammarBase) => boolean | void) => void;\n find: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase | null;\n filter: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase[];\n\n release: () => void;\n}\n\nexport interface IMarkTreeNode {\n mark: IMark;\n parent: IMarkTreeNode;\n children: IMarkTreeNode[];\n}\n\nexport interface IRecordedTreeGrammars extends IRecordedGrammars {\n getAllMarkNodes: () => IMarkTreeNode[];\n}\n"]}
|
package/es/view/View.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { IBounds, ILogger } from '@visactor/vutils';
|
|
|
2
2
|
import { EventEmitter } from '@visactor/vutils';
|
|
3
3
|
import type { IColor } from '@visactor/vrender-core';
|
|
4
4
|
import type { CoordinateType } from '@visactor/vgrammar-coordinate';
|
|
5
|
-
import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark,
|
|
5
|
+
import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme, InteractionSpec, IInteraction } from '../types/';
|
|
6
6
|
import type { IRenderer } from '../types/renderer';
|
|
7
7
|
import { LayoutState } from '../graph/enums';
|
|
8
8
|
import type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from '../types/component';
|
|
@@ -18,8 +18,7 @@ export default class View extends EventEmitter implements IView {
|
|
|
18
18
|
private _config;
|
|
19
19
|
private _options;
|
|
20
20
|
private _cachedGrammars;
|
|
21
|
-
private
|
|
22
|
-
private _morph;
|
|
21
|
+
private _differ;
|
|
23
22
|
private _eventConfig;
|
|
24
23
|
private _eventListeners;
|
|
25
24
|
private _theme;
|
|
@@ -28,7 +27,6 @@ export default class View extends EventEmitter implements IView {
|
|
|
28
27
|
private _layoutState?;
|
|
29
28
|
private _layoutMarks?;
|
|
30
29
|
private _background?;
|
|
31
|
-
private _eventCache;
|
|
32
30
|
private _progressiveMarks?;
|
|
33
31
|
private _progressiveRafId?;
|
|
34
32
|
private _observer;
|
|
@@ -122,11 +120,10 @@ export default class View extends EventEmitter implements IView {
|
|
|
122
120
|
private _onResize;
|
|
123
121
|
resize(width: number, height: number, render?: boolean): this;
|
|
124
122
|
private _resizeRenderer;
|
|
125
|
-
private bindEvents;
|
|
126
|
-
event(eventSpec: EventSpec): void;
|
|
127
123
|
interaction(type: string, spec: Partial<InteractionSpec>): IInteraction<any>;
|
|
128
124
|
removeInteraction(type: string | IInteraction, id?: string): this;
|
|
129
125
|
removeAllInteractions(): this;
|
|
126
|
+
initializeEventConfig(config: any): any;
|
|
130
127
|
private initEvent;
|
|
131
128
|
private releaseStageEvent;
|
|
132
129
|
private delegateEvent;
|
package/es/view/View.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
import { EventEmitter, debounce,
|
|
1
|
+
import { EventEmitter, debounce, isString, getContainerSize, Logger, array, isNil, isArray } from "@visactor/vutils";
|
|
2
2
|
|
|
3
3
|
import { vglobal } from "@visactor/vrender-core";
|
|
4
4
|
|
|
5
5
|
import { Data } from "./data";
|
|
6
6
|
|
|
7
|
-
import { initializeEventConfig, permit, prevent } from "./events";
|
|
8
|
-
|
|
9
7
|
import Dataflow from "./dataflow";
|
|
10
8
|
|
|
11
9
|
import { traverseMarkTree } from "../graph/mark-tree";
|
|
12
10
|
|
|
13
|
-
import { BridgeElementKey } from "../graph/constants";
|
|
14
|
-
|
|
15
11
|
import CanvasRenderer from "../graph/canvas-renderer";
|
|
16
12
|
|
|
17
13
|
import getExtendedEvents from "../graph/util/events-extend";
|
|
18
14
|
|
|
19
|
-
import { BROWSER,
|
|
15
|
+
import { BROWSER, SIGNAL_WIDTH, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_AUTOFIT, SIGNAL_VIEW_WIDTH, SIGNAL_VIEW_HEIGHT, EVENT_SOURCE_VIEW, SIGNAL_VIEW_BOX, ID_PREFIX, NAME_PREFIX, EVENT_SOURCE_WINDOW } from "./constants";
|
|
20
16
|
|
|
21
17
|
import { Signal } from "./signal";
|
|
22
18
|
|
|
23
19
|
import { BuiltInSignalID, builtInSignals, normalizeMarkTree, normalizeRunningConfig, normalizePadding } from "../parse/view";
|
|
24
20
|
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
import { isGrammar, parseReference } from "../parse/util";
|
|
21
|
+
import { isGrammar } from "../parse/util";
|
|
28
22
|
|
|
29
23
|
import { configureEnvironment } from "../graph/util/env";
|
|
30
24
|
|
|
@@ -32,16 +26,8 @@ import { GroupMark } from "./group";
|
|
|
32
26
|
|
|
33
27
|
import { Mark } from "./mark";
|
|
34
28
|
|
|
35
|
-
import { defaultDoLayout } from "../graph/layout/layout";
|
|
36
|
-
|
|
37
|
-
import { GlyphMark } from "./glyph";
|
|
38
|
-
|
|
39
|
-
import { Morph } from "../graph/animation/morph";
|
|
40
|
-
|
|
41
29
|
import { RecordedGrammars, RecordedTreeGrammars } from "./grammar-record";
|
|
42
30
|
|
|
43
|
-
import { ViewAnimate } from "./animate";
|
|
44
|
-
|
|
45
31
|
import { ComponentEnum, HOOK_EVENT, LayoutState, GrammarMarkType } from "../graph/enums";
|
|
46
32
|
|
|
47
33
|
import { Text } from "../semantic-marks/text";
|
|
@@ -54,6 +40,8 @@ import { Component } from "./component";
|
|
|
54
40
|
|
|
55
41
|
import { isMarkType, removeGraphicItem } from "../graph/util/graphic";
|
|
56
42
|
|
|
43
|
+
import { ViewDiff } from "../graph/view-diff";
|
|
44
|
+
|
|
57
45
|
export default class View extends EventEmitter {
|
|
58
46
|
static useRegisters(comps) {
|
|
59
47
|
comps.forEach((fn => {
|
|
@@ -65,9 +53,8 @@ export default class View extends EventEmitter {
|
|
|
65
53
|
const size = this._getContainerSize();
|
|
66
54
|
size && this.resize(size.width, size.height);
|
|
67
55
|
}), 100), this.delegateEvent = (event, type) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.emit(type, extendedEvt, activeElement);
|
|
56
|
+
const extendedEvt = getExtendedEvents(this, event, type, EVENT_SOURCE_VIEW);
|
|
57
|
+
this.emit(type, extendedEvt, event.element);
|
|
71
58
|
}, this.handleProgressiveFrame = () => {
|
|
72
59
|
this._progressiveMarks.length && this._progressiveMarks.forEach((mark => {
|
|
73
60
|
mark.isDoingProgressive() && mark.evaluateProgressive();
|
|
@@ -154,7 +141,8 @@ export default class View extends EventEmitter {
|
|
|
154
141
|
break;
|
|
155
142
|
|
|
156
143
|
case GrammarMarkType.glyph:
|
|
157
|
-
|
|
144
|
+
const GlyphMark = Factory.getMark(GrammarMarkType.glyph);
|
|
145
|
+
GlyphMark && (mark = new GlyphMark(this, null == markOptions ? void 0 : markOptions.glyphType, groupMark));
|
|
158
146
|
break;
|
|
159
147
|
|
|
160
148
|
case GrammarMarkType.component:
|
|
@@ -260,7 +248,7 @@ export default class View extends EventEmitter {
|
|
|
260
248
|
})), this;
|
|
261
249
|
}
|
|
262
250
|
parseSpec(spec) {
|
|
263
|
-
var _a, _b, _c, _d, _e, _f;
|
|
251
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
264
252
|
if (this.emit(HOOK_EVENT.BEFORE_PARSE_VIEW), this._spec = spec, normalizeMarkTree(spec),
|
|
265
253
|
spec.theme ? this.theme(spec.theme) : this.theme(ThemeManager.getDefaultTheme()),
|
|
266
254
|
spec.width && this.width(spec.width), spec.height && this.height(spec.height), this.padding(null !== (_b = null !== (_a = spec.padding) && void 0 !== _a ? _a : this._options.padding) && void 0 !== _b ? _b : this._theme.padding),
|
|
@@ -288,11 +276,13 @@ export default class View extends EventEmitter {
|
|
|
288
276
|
})), spec.marks && spec.marks.length && spec.marks.forEach((mark => {
|
|
289
277
|
this.parseMarkSpec(mark);
|
|
290
278
|
})), spec.events && spec.events.length && spec.events.forEach((eventConfig => {
|
|
291
|
-
|
|
279
|
+
var _b;
|
|
280
|
+
null === (_b = this.event) || void 0 === _b || _b.call(this, eventConfig);
|
|
292
281
|
})), spec.interactions && spec.interactions.length && spec.interactions.forEach((interaction => {
|
|
293
282
|
this.interaction(interaction.type, interaction);
|
|
294
|
-
})), !1 === spec.animation ? this.animate.disable() : this.animate
|
|
295
|
-
this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
|
|
283
|
+
})), !1 === spec.animation ? null === (_g = this.animate) || void 0 === _g || _g.disable() : null === (_h = this.animate) || void 0 === _h || _h.enable(),
|
|
284
|
+
this.emit(HOOK_EVENT.AFTER_PARSE_VIEW), this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
|
|
285
|
+
this;
|
|
296
286
|
}
|
|
297
287
|
updateSpec(spec) {
|
|
298
288
|
return this.removeAllInteractions(), this.removeAllGrammars(), this.parseSpec(spec);
|
|
@@ -412,7 +402,7 @@ export default class View extends EventEmitter {
|
|
|
412
402
|
}
|
|
413
403
|
doLayout() {
|
|
414
404
|
var _a;
|
|
415
|
-
const doLayout = this._options.doLayout ||
|
|
405
|
+
const doLayout = this._options.doLayout || Factory.getDefaultLayout();
|
|
416
406
|
doLayout && (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && (this.emit(HOOK_EVENT.BEFORE_DO_LAYOUT),
|
|
417
407
|
doLayout(this._layoutMarks, this._options, this), this.emit(HOOK_EVENT.AFTER_DO_LAYOUT));
|
|
418
408
|
}
|
|
@@ -435,11 +425,12 @@ export default class View extends EventEmitter {
|
|
|
435
425
|
return this.evaluate(runningConfig), this;
|
|
436
426
|
}
|
|
437
427
|
doRender(immediately) {
|
|
438
|
-
this.emit(HOOK_EVENT.BEFORE_DO_RENDER), this.renderer && (this._progressiveMarks
|
|
439
|
-
|
|
428
|
+
this.emit(HOOK_EVENT.BEFORE_DO_RENDER), this.renderer && (!this._progressiveMarks && this.animate ? this.animate.animate() : this.traverseMarkTree((mark => {
|
|
429
|
+
mark.cleanExitElements();
|
|
430
|
+
}), null, !0), this.renderer.render(immediately), this.handleRenderEnd()), this.emit(HOOK_EVENT.AFTER_DO_RENDER);
|
|
440
431
|
}
|
|
441
432
|
evaluate(runningConfig) {
|
|
442
|
-
var _a,
|
|
433
|
+
var _a, _c;
|
|
443
434
|
const normalizedRunningConfig = normalizeRunningConfig(runningConfig), grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
444
435
|
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
445
436
|
const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
|
|
@@ -448,28 +439,28 @@ export default class View extends EventEmitter {
|
|
|
448
439
|
this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting,
|
|
449
440
|
this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate,
|
|
450
441
|
this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()),
|
|
451
|
-
this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), null === (
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
this.doRender(!0), this.doPreProgressive(), this) : this;
|
|
442
|
+
this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), null === (_c = this.morph) || void 0 === _c || _c.call(this, normalizedRunningConfig),
|
|
443
|
+
this.releaseCachedGrammars(normalizedRunningConfig), this.doRender(!0), this.doPreProgressive(),
|
|
444
|
+
this) : this;
|
|
455
445
|
}
|
|
456
446
|
reuseCachedGrammars(runningConfig) {
|
|
457
|
-
if (
|
|
447
|
+
if (runningConfig.reuse) {
|
|
458
448
|
const reuseDiffUpdate = diff => {
|
|
459
449
|
diff.next.reuse(diff.prev), diff.prev.detachAll(), diff.prev.clear(), this._cachedGrammars.unrecord(diff.prev);
|
|
460
450
|
};
|
|
461
|
-
this.
|
|
462
|
-
this.
|
|
463
|
-
this.
|
|
464
|
-
this.
|
|
451
|
+
this._differ.diffGrammar(this._cachedGrammars.getAllSignals(), this.grammars.getAllSignals().filter((signal => !BuiltInSignalID.includes(signal.id())))).update.forEach(reuseDiffUpdate);
|
|
452
|
+
this._differ.diffGrammar(this._cachedGrammars.getAllData(), this.grammars.getAllData()).update.forEach(reuseDiffUpdate);
|
|
453
|
+
this._differ.diffGrammar(this._cachedGrammars.getAllScales(), this.grammars.getAllScales()).update.forEach(reuseDiffUpdate);
|
|
454
|
+
this._differ.diffGrammar(this._cachedGrammars.getAllCoordinates(), this.grammars.getAllCoordinates()).update.forEach(reuseDiffUpdate);
|
|
465
455
|
}
|
|
466
|
-
this.
|
|
456
|
+
this._differ.diffMark(this._cachedGrammars.getAllMarks(), this.grammars.getAllMarks().filter((mark => "root" !== mark.id())), runningConfig).update.forEach((diff => {
|
|
457
|
+
var _b;
|
|
467
458
|
const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType, enableMarkMorphConfig = diff.prev.every((mark => mark.getMorphConfig().morph)) && diff.next.every((mark => mark.getMorphConfig().morph));
|
|
468
|
-
|
|
469
|
-
diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0])) : (runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll) && this._willMorphMarks.push({
|
|
459
|
+
this.morph && (runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll) ? null === (_b = this.addMorphMarks) || void 0 === _b || _b.call(this, {
|
|
470
460
|
prev: diff.prev,
|
|
471
461
|
next: diff.next
|
|
472
|
-
})
|
|
462
|
+
}) : matched && runningConfig.reuse && (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(),
|
|
463
|
+
diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0]));
|
|
473
464
|
}));
|
|
474
465
|
}
|
|
475
466
|
detachCachedGrammar() {
|
|
@@ -487,10 +478,11 @@ export default class View extends EventEmitter {
|
|
|
487
478
|
}));
|
|
488
479
|
const markNodes = this._cachedGrammars.getAllMarkNodes();
|
|
489
480
|
markNodes.forEach((node => {
|
|
490
|
-
|
|
481
|
+
var _a;
|
|
482
|
+
null === (_a = node.mark.animate) || void 0 === _a || _a.stop(), runningConfig.enableExitAnimation && this.animate && this.animate.animateAddition(node.mark);
|
|
491
483
|
}));
|
|
492
484
|
const releaseUp = node => {
|
|
493
|
-
if (node.mark.view && 0 === node.mark.animate.getAnimatorCount() && (!node.children || 0 === node.children.length)) {
|
|
485
|
+
if (node.mark.view && (!node.mark.animate || 0 === node.mark.animate.getAnimatorCount()) && (!node.children || 0 === node.children.length)) {
|
|
494
486
|
node.mark.release();
|
|
495
487
|
const parent = node.parent;
|
|
496
488
|
parent && (node.parent.children = node.parent.children.filter((n => n !== node)),
|
|
@@ -499,9 +491,9 @@ export default class View extends EventEmitter {
|
|
|
499
491
|
};
|
|
500
492
|
markNodes.forEach((node => {
|
|
501
493
|
const mark = node.mark;
|
|
502
|
-
0
|
|
503
|
-
0 === mark.animate.getAnimatorCount() && releaseUp(node);
|
|
504
|
-
}));
|
|
494
|
+
mark.animate && 0 !== mark.animate.getAnimatorCount() ? mark.addEventListener("animationEnd", (() => {
|
|
495
|
+
mark.animate && 0 === mark.animate.getAnimatorCount() && releaseUp(node);
|
|
496
|
+
})) : releaseUp(node);
|
|
505
497
|
})), this._cachedGrammars.clear();
|
|
506
498
|
}
|
|
507
499
|
runAfter(callback) {
|
|
@@ -558,7 +550,9 @@ export default class View extends EventEmitter {
|
|
|
558
550
|
let needDataflow = !1;
|
|
559
551
|
return width !== this.width() && (needDataflow = !0, this.updateSignal(SIGNAL_WIDTH, width)),
|
|
560
552
|
height !== this.height() && (needDataflow = !0, this.updateSignal(SIGNAL_HEIGHT, height)),
|
|
561
|
-
needDataflow && (render ? this.evaluate(
|
|
553
|
+
needDataflow && (render ? this.evaluate({
|
|
554
|
+
morph: !1
|
|
555
|
+
}) : this._dataflow.evaluate()), this;
|
|
562
556
|
}
|
|
563
557
|
_resizeRenderer() {
|
|
564
558
|
const width = this.width(), height = this.height();
|
|
@@ -568,73 +562,6 @@ export default class View extends EventEmitter {
|
|
|
568
562
|
height: height
|
|
569
563
|
}), !0);
|
|
570
564
|
}
|
|
571
|
-
bindEvents(eventSpec) {
|
|
572
|
-
if (this._eventConfig.disable) return;
|
|
573
|
-
const {type: evtType, filter: filter, callback: callback, throttle: throttle, debounce: debounce, consume: consume, target: target, dependency: dependency} = eventSpec, eventSelector = parseEventSelector(evtType);
|
|
574
|
-
if (!eventSelector) return;
|
|
575
|
-
const {source: source, type: type} = eventSelector, markFilter = generateFilterByMark(eventSelector), validateSignals = (Array.isArray(target) && target.length ? target.map((entry => ({
|
|
576
|
-
signal: this.getSignalById(entry.target),
|
|
577
|
-
callback: entry.callback
|
|
578
|
-
}))) : [ {
|
|
579
|
-
signal: isString(target) ? this.getSignalById(target) : null,
|
|
580
|
-
callback: callback
|
|
581
|
-
} ]).filter((entry => entry.signal || entry.callback)), refs = parseReference(dependency, this), send = parseHandler(((evt, element) => {
|
|
582
|
-
const needPreventDefault = source === EVENT_SOURCE_VIEW && prevent(this._eventConfig, type) || consume && (void 0 === evt.cancelable || evt.cancelable);
|
|
583
|
-
source === EVENT_SOURCE_WINDOW && (evt = getExtendedEvents(this, evt, element, type, EVENT_SOURCE_WINDOW));
|
|
584
|
-
let hasCommitted = !1;
|
|
585
|
-
if ((!filter || filter(evt)) && (!markFilter || markFilter(element)) && validateSignals.length) {
|
|
586
|
-
const params = refs.reduce(((params, ref) => (params[ref.id()] = ref.output(), params)), {});
|
|
587
|
-
validateSignals.forEach((entry => {
|
|
588
|
-
if (entry.callback && entry.signal) {
|
|
589
|
-
entry.signal.set(entry.callback(evt, params)) && (this.commit(entry.signal), hasCommitted = !0);
|
|
590
|
-
} else entry.callback ? entry.callback(evt, params) : (this.commit(entry.signal),
|
|
591
|
-
hasCommitted = !0);
|
|
592
|
-
}));
|
|
593
|
-
}
|
|
594
|
-
needPreventDefault && evt.preventDefault(), consume && evt.stopPropagation(), hasCommitted && this.run();
|
|
595
|
-
}), {
|
|
596
|
-
throttle: throttle,
|
|
597
|
-
debounce: debounce
|
|
598
|
-
});
|
|
599
|
-
if (source === EVENT_SOURCE_VIEW) {
|
|
600
|
-
if (permit(this._eventConfig, EVENT_SOURCE_VIEW, type)) return this.addEventListener(type, send, NO_TRAP),
|
|
601
|
-
() => {
|
|
602
|
-
this.removeEventListener(type, send);
|
|
603
|
-
};
|
|
604
|
-
} else if (source === EVENT_SOURCE_WINDOW) return vglobal.addEventListener(type, send),
|
|
605
|
-
this._eventListeners.push({
|
|
606
|
-
type: type,
|
|
607
|
-
source: vglobal,
|
|
608
|
-
handler: send
|
|
609
|
-
}), () => {
|
|
610
|
-
vglobal.removeEventListener(type, send);
|
|
611
|
-
const index = this._eventListeners.findIndex((entry => entry.type === type && entry.source === vglobal && entry.handler === send));
|
|
612
|
-
index >= 0 && this._eventListeners.splice(index, 1);
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
event(eventSpec) {
|
|
616
|
-
if ("between" in eventSpec) {
|
|
617
|
-
const [starEvent, endEvent] = eventSpec.between, id = `${starEvent.type}-${eventSpec.type}-${endEvent.type}`;
|
|
618
|
-
let unbindEndEvent;
|
|
619
|
-
this.bindEvents(Object.assign({}, starEvent, {
|
|
620
|
-
callback: () => {
|
|
621
|
-
if (this._eventCache || (this._eventCache = {}), !this._eventCache[id]) {
|
|
622
|
-
const unbindEvent = this.bindEvents(eventSpec);
|
|
623
|
-
this._eventCache[id] = unbindEvent;
|
|
624
|
-
}
|
|
625
|
-
unbindEndEvent || (unbindEndEvent = this.bindEvents(Object.assign({}, endEvent, {
|
|
626
|
-
callback: () => {
|
|
627
|
-
this._eventCache[id] && (this._eventCache[id](), this._eventCache[id] = null);
|
|
628
|
-
}
|
|
629
|
-
})));
|
|
630
|
-
}
|
|
631
|
-
}));
|
|
632
|
-
} else "merge" in eventSpec ? eventSpec.merge.forEach((entry => {
|
|
633
|
-
const singleEvent = Object.assign({}, eventSpec);
|
|
634
|
-
isString(entry) ? singleEvent.type = entry : isObject(entry) && Object.assign(singleEvent, entry),
|
|
635
|
-
singleEvent.debounce = 50, this.bindEvents(singleEvent);
|
|
636
|
-
})) : this.bindEvents(eventSpec);
|
|
637
|
-
}
|
|
638
565
|
interaction(type, spec) {
|
|
639
566
|
const interaction = Factory.createInteraction(type, this, spec);
|
|
640
567
|
return interaction && (interaction.bind(), this._boundInteractions || (this._boundInteractions = []),
|
|
@@ -657,6 +584,17 @@ export default class View extends EventEmitter {
|
|
|
657
584
|
instance.unbind();
|
|
658
585
|
})), this._boundInteractions = null), this;
|
|
659
586
|
}
|
|
587
|
+
initializeEventConfig(config) {
|
|
588
|
+
const eventsConfig = Object.assign({
|
|
589
|
+
defaults: {}
|
|
590
|
+
}, config), unpack = (obj, keys) => {
|
|
591
|
+
keys.forEach((k => {
|
|
592
|
+
isArray(obj[k]) && (obj[k] = obj[k].reduce(((set, key) => (set[key] = !0, set)), {}));
|
|
593
|
+
}));
|
|
594
|
+
};
|
|
595
|
+
return unpack(eventsConfig.defaults, [ "prevent", "allow" ]), unpack(eventsConfig, [ EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW ]),
|
|
596
|
+
eventsConfig;
|
|
597
|
+
}
|
|
660
598
|
initEvent() {
|
|
661
599
|
const stage = this.renderer.stage();
|
|
662
600
|
stage && stage.on("*", this.delegateEvent);
|
|
@@ -679,15 +617,15 @@ export default class View extends EventEmitter {
|
|
|
679
617
|
this.renderer = new CanvasRenderer(this), this.renderer.initialize(width, height, this._options, this._eventConfig).background(this._background);
|
|
680
618
|
}
|
|
681
619
|
initialize() {
|
|
682
|
-
var _a;
|
|
620
|
+
var _a, _c;
|
|
683
621
|
this.grammars = new RecordedGrammars((grammar => grammar.id()), ((key, grammar) => this.logger.warn(`Grammar id '${key}' has been occupied`, grammar))),
|
|
684
622
|
this._cachedGrammars = new RecordedTreeGrammars((grammar => grammar.id())), this._options.logger && Logger.setInstance(this._options.logger),
|
|
685
623
|
this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0),
|
|
686
|
-
this._dataflow = new Dataflow, this.animate =
|
|
687
|
-
this._options.hooks && (Object.keys(this._options.hooks).forEach((key => {
|
|
624
|
+
this._dataflow = new Dataflow, this.animate = null === (_c = this.initAnimate) || void 0 === _c ? void 0 : _c.call(this, this),
|
|
625
|
+
this._differ = new ViewDiff, this._options.hooks && (Object.keys(this._options.hooks).forEach((key => {
|
|
688
626
|
this.on(key, this._options.hooks[key]);
|
|
689
627
|
})), this.hooks = this._options.hooks), this.container = null, this.renderer = null,
|
|
690
|
-
this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig),
|
|
628
|
+
this._eventListeners = [], this._eventConfig = this.initializeEventConfig(this._options.eventConfig),
|
|
691
629
|
this._theme = this._options.disableTheme ? null : ThemeManager.getDefaultTheme(),
|
|
692
630
|
this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(),
|
|
693
631
|
this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(), this._needBuildLayoutTree = !0,
|
|
@@ -714,7 +652,7 @@ export default class View extends EventEmitter {
|
|
|
714
652
|
if (this._progressiveMarks && this._progressiveMarks.some((mark => mark.isDoingProgressive()))) {
|
|
715
653
|
const raf = vglobal.getRequestAnimationFrame();
|
|
716
654
|
this._progressiveRafId = raf(this.handleProgressiveFrame);
|
|
717
|
-
}
|
|
655
|
+
} else this._progressiveMarks && this.animate && this._progressiveMarks.every((mark => mark.canAnimateAfterProgressive())) ? this.animate.animate() : this._progressiveMarks && (this._progressiveMarks = null);
|
|
718
656
|
}
|
|
719
657
|
clearProgressive() {
|
|
720
658
|
if (this._progressiveRafId) {
|
|
@@ -725,13 +663,14 @@ export default class View extends EventEmitter {
|
|
|
725
663
|
})), this._progressiveMarks = null);
|
|
726
664
|
}
|
|
727
665
|
release() {
|
|
728
|
-
var _a, _b, _c;
|
|
666
|
+
var _a, _b, _c, _d;
|
|
729
667
|
this.removeAllInteractions(), this.releaseStageEvent(), this._unBindResizeEvent(),
|
|
730
668
|
this.clearProgressive(), Factory.unregisterRuntimeTransforms(), Logger.setInstance(null),
|
|
731
|
-
|
|
732
|
-
this.
|
|
669
|
+
null === (_a = this.animate) || void 0 === _a || _a.stop(), this.grammars.release(),
|
|
670
|
+
this._cachedGrammars.release(), this._dataflow.release(), this._dataflow = null,
|
|
671
|
+
null === (_c = null === (_b = this.renderer) || void 0 === _b ? void 0 : _b.release) || void 0 === _c || _c.call(_b),
|
|
733
672
|
this.renderer = null, this._boundInteractions = null, this.removeAllListeners(),
|
|
734
|
-
null === (
|
|
673
|
+
null === (_d = this._eventListeners) || void 0 === _d || _d.forEach((listener => {
|
|
735
674
|
listener.source.removeEventListener(listener.type, listener.handler);
|
|
736
675
|
})), this._eventListeners = null;
|
|
737
676
|
}
|