@visactor/vgrammar-core 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -0
- package/README.zh-CN.md +11 -0
- package/cjs/component/axis.d.ts +26 -0
- package/cjs/component/axis.js +164 -0
- package/cjs/component/axis.js.map +1 -0
- package/cjs/component/crosshair.d.ts +50 -0
- package/cjs/component/crosshair.js +281 -0
- package/cjs/component/crosshair.js.map +1 -0
- package/cjs/component/datazoom.d.ts +19 -0
- package/cjs/component/datazoom.js +166 -0
- package/cjs/component/datazoom.js.map +1 -0
- package/cjs/component/grid.d.ts +27 -0
- package/cjs/component/grid.js +190 -0
- package/cjs/component/grid.js.map +1 -0
- package/cjs/component/index.d.ts +11 -0
- package/cjs/component/index.js +105 -0
- package/cjs/component/index.js.map +1 -0
- package/cjs/component/label.d.ts +19 -0
- package/cjs/component/label.js +121 -0
- package/cjs/component/label.js.map +1 -0
- package/cjs/component/legend.d.ts +26 -0
- package/cjs/component/legend.js +170 -0
- package/cjs/component/legend.js.map +1 -0
- package/cjs/component/player.d.ts +25 -0
- package/cjs/component/player.js +138 -0
- package/cjs/component/player.js.map +1 -0
- package/cjs/component/scale.d.ts +8 -0
- package/cjs/component/scale.js +25 -0
- package/cjs/component/scale.js.map +1 -0
- package/cjs/component/scrollbar.d.ts +23 -0
- package/cjs/component/scrollbar.js +187 -0
- package/cjs/component/scrollbar.js.map +1 -0
- package/cjs/component/slider.d.ts +19 -0
- package/cjs/component/slider.js +86 -0
- package/cjs/component/slider.js.map +1 -0
- package/cjs/component/title.d.ts +15 -0
- package/cjs/component/title.js +56 -0
- package/cjs/component/title.js.map +1 -0
- package/cjs/component/tooltip.d.ts +62 -0
- package/cjs/component/tooltip.js +305 -0
- package/cjs/component/tooltip.js.map +1 -0
- package/cjs/core/factory.d.ts +35 -0
- package/cjs/core/factory.js +73 -0
- package/cjs/core/factory.js.map +1 -0
- package/cjs/glyph/boxplot.d.ts +10 -0
- package/cjs/glyph/boxplot.js +418 -0
- package/cjs/glyph/boxplot.js.map +1 -0
- package/cjs/glyph/index.d.ts +7 -0
- package/cjs/glyph/index.js +64 -0
- package/cjs/glyph/index.js.map +1 -0
- package/cjs/glyph/link-path.d.ts +7 -0
- package/cjs/glyph/link-path.js +138 -0
- package/cjs/glyph/link-path.js.map +1 -0
- package/cjs/glyph/ripple.d.ts +1 -0
- package/cjs/glyph/ripple.js +44 -0
- package/cjs/glyph/ripple.js.map +1 -0
- package/cjs/glyph/tree-path.d.ts +7 -0
- package/cjs/glyph/tree-path.js +152 -0
- package/cjs/glyph/tree-path.js.map +1 -0
- package/cjs/glyph/violin.d.ts +1 -0
- package/cjs/glyph/violin.js +165 -0
- package/cjs/glyph/violin.js.map +1 -0
- package/cjs/glyph/wave.d.ts +1 -0
- package/cjs/glyph/wave.js +67 -0
- package/cjs/glyph/wave.js.map +1 -0
- package/cjs/graph/animation/animate.d.ts +48 -0
- package/cjs/graph/animation/animate.js +250 -0
- package/cjs/graph/animation/animate.js.map +1 -0
- package/cjs/graph/animation/animation/clip.d.ts +4 -0
- package/cjs/graph/animation/animation/clip.js +54 -0
- package/cjs/graph/animation/animation/clip.js.map +1 -0
- package/cjs/graph/animation/animation/fade.d.ts +4 -0
- package/cjs/graph/animation/animation/fade.js +42 -0
- package/cjs/graph/animation/animation/fade.js.map +1 -0
- package/cjs/graph/animation/animation/grow-cartesian.d.ts +7 -0
- package/cjs/graph/animation/animation/grow-cartesian.js +288 -0
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -0
- package/cjs/graph/animation/animation/grow-interval.d.ts +3 -0
- package/cjs/graph/animation/animation/grow-interval.js +194 -0
- package/cjs/graph/animation/animation/grow-interval.js.map +1 -0
- package/cjs/graph/animation/animation/grow-points.d.ts +7 -0
- package/cjs/graph/animation/animation/grow-points.js +118 -0
- package/cjs/graph/animation/animation/grow-points.js.map +1 -0
- package/cjs/graph/animation/animation/grow-polar.d.ts +5 -0
- package/cjs/graph/animation/animation/grow-polar.js +164 -0
- package/cjs/graph/animation/animation/grow-polar.js.map +1 -0
- package/cjs/graph/animation/animation/index.d.ts +11 -0
- package/cjs/graph/animation/animation/index.js +191 -0
- package/cjs/graph/animation/animation/index.js.map +1 -0
- package/cjs/graph/animation/animation/move.d.ts +3 -0
- package/cjs/graph/animation/animation/move.js +90 -0
- package/cjs/graph/animation/animation/move.js.map +1 -0
- package/cjs/graph/animation/animation/rotate.d.ts +3 -0
- package/cjs/graph/animation/animation/rotate.js +42 -0
- package/cjs/graph/animation/animation/rotate.js.map +1 -0
- package/cjs/graph/animation/animation/scale.d.ts +3 -0
- package/cjs/graph/animation/animation/scale.js +84 -0
- package/cjs/graph/animation/animation/scale.js.map +1 -0
- package/cjs/graph/animation/animation/update.d.ts +6 -0
- package/cjs/graph/animation/animation/update.js +22 -0
- package/cjs/graph/animation/animation/update.js.map +1 -0
- package/cjs/graph/animation/animator.d.ts +26 -0
- package/cjs/graph/animation/animator.js +88 -0
- package/cjs/graph/animation/animator.js.map +1 -0
- package/cjs/graph/animation/arranger.d.ts +13 -0
- package/cjs/graph/animation/arranger.js +38 -0
- package/cjs/graph/animation/arranger.js.map +1 -0
- package/cjs/graph/animation/attribute.d.ts +27 -0
- package/cjs/graph/animation/attribute.js +124 -0
- package/cjs/graph/animation/attribute.js.map +1 -0
- package/cjs/graph/animation/config.d.ts +5 -0
- package/cjs/graph/animation/config.js +92 -0
- package/cjs/graph/animation/config.js.map +1 -0
- package/cjs/graph/animation/morph.d.ts +12 -0
- package/cjs/graph/animation/morph.js +174 -0
- package/cjs/graph/animation/morph.js.map +1 -0
- package/cjs/graph/attributes/common.d.ts +2 -0
- package/cjs/graph/attributes/common.js +22 -0
- package/cjs/graph/attributes/common.js.map +1 -0
- package/cjs/graph/attributes/helpers.d.ts +17 -0
- package/cjs/graph/attributes/helpers.js +86 -0
- package/cjs/graph/attributes/helpers.js.map +1 -0
- package/cjs/graph/attributes/index.d.ts +10 -0
- package/cjs/graph/attributes/index.js +257 -0
- package/cjs/graph/attributes/index.js.map +1 -0
- package/cjs/graph/canvas-renderer.d.ts +34 -0
- package/cjs/graph/canvas-renderer.js +121 -0
- package/cjs/graph/canvas-renderer.js.map +1 -0
- package/cjs/graph/constants.d.ts +23 -0
- package/cjs/graph/constants.js +21 -0
- package/cjs/graph/constants.js.map +1 -0
- package/cjs/graph/element.d.ts +66 -0
- package/cjs/graph/element.js +297 -0
- package/cjs/graph/element.js.map +1 -0
- package/cjs/graph/enums.d.ts +153 -0
- package/cjs/graph/enums.js +85 -0
- package/cjs/graph/enums.js.map +1 -0
- package/cjs/graph/glyph-element.d.ts +53 -0
- package/cjs/graph/glyph-element.js +202 -0
- package/cjs/graph/glyph-element.js.map +1 -0
- package/cjs/graph/index.d.ts +3 -0
- package/cjs/graph/index.js +44 -0
- package/cjs/graph/index.js.map +1 -0
- package/cjs/graph/layout/grid.d.ts +3 -0
- package/cjs/graph/layout/grid.js +75 -0
- package/cjs/graph/layout/grid.js.map +1 -0
- package/cjs/graph/layout/layout.d.ts +3 -0
- package/cjs/graph/layout/layout.js +33 -0
- package/cjs/graph/layout/layout.js.map +1 -0
- package/cjs/graph/layout/relative.d.ts +3 -0
- package/cjs/graph/layout/relative.js +86 -0
- package/cjs/graph/layout/relative.js.map +1 -0
- package/cjs/graph/mark/differ.d.ts +20 -0
- package/cjs/graph/mark/differ.js +110 -0
- package/cjs/graph/mark/differ.js.map +1 -0
- package/cjs/graph/mark/encode.d.ts +10 -0
- package/cjs/graph/mark/encode.js +95 -0
- package/cjs/graph/mark/encode.js.map +1 -0
- package/cjs/graph/mark/large-rects.d.ts +10 -0
- package/cjs/graph/mark/large-rects.js +31 -0
- package/cjs/graph/mark/large-rects.js.map +1 -0
- package/cjs/graph/mark/large-symbols.d.ts +11 -0
- package/cjs/graph/mark/large-symbols.js +33 -0
- package/cjs/graph/mark/large-symbols.js.map +1 -0
- package/cjs/graph/mark-tree.d.ts +2 -0
- package/cjs/graph/mark-tree.js +21 -0
- package/cjs/graph/mark-tree.js.map +1 -0
- package/cjs/graph/util/element.d.ts +2 -0
- package/cjs/graph/util/element.js +10 -0
- package/cjs/graph/util/element.js.map +1 -0
- package/cjs/graph/util/env.d.ts +2 -0
- package/cjs/graph/util/env.js +14 -0
- package/cjs/graph/util/env.js.map +1 -0
- package/cjs/graph/util/events-extend.d.ts +5 -0
- package/cjs/graph/util/events-extend.js +18 -0
- package/cjs/graph/util/events-extend.js.map +1 -0
- package/cjs/graph/util/graphic.d.ts +9 -0
- package/cjs/graph/util/graphic.js +59 -0
- package/cjs/graph/util/graphic.js.map +1 -0
- package/cjs/graph/util/point.d.ts +1 -0
- package/cjs/graph/util/point.js +75 -0
- package/cjs/graph/util/point.js.map +1 -0
- package/cjs/index.d.ts +14 -0
- package/cjs/index.js +111 -0
- package/cjs/index.js.map +1 -0
- package/cjs/parse/coordinate.d.ts +7 -0
- package/cjs/parse/coordinate.js +70 -0
- package/cjs/parse/coordinate.js.map +1 -0
- package/cjs/parse/event.d.ts +8 -0
- package/cjs/parse/event.js +33 -0
- package/cjs/parse/event.js.map +1 -0
- package/cjs/parse/mark.d.ts +4 -0
- package/cjs/parse/mark.js +25 -0
- package/cjs/parse/mark.js.map +1 -0
- package/cjs/parse/option.d.ts +3 -0
- package/cjs/parse/option.js +19 -0
- package/cjs/parse/option.js.map +1 -0
- package/cjs/parse/scale.d.ts +8 -0
- package/cjs/parse/scale.js +365 -0
- package/cjs/parse/scale.js.map +1 -0
- package/cjs/parse/transform.d.ts +5 -0
- package/cjs/parse/transform.js +103 -0
- package/cjs/parse/transform.js.map +1 -0
- package/cjs/parse/util.d.ts +13 -0
- package/cjs/parse/util.js +82 -0
- package/cjs/parse/util.js.map +1 -0
- package/cjs/parse/view.d.ts +17 -0
- package/cjs/parse/view.js +108 -0
- package/cjs/parse/view.js.map +1 -0
- package/cjs/semantic-marks/cell.d.ts +13 -0
- package/cjs/semantic-marks/cell.js +61 -0
- package/cjs/semantic-marks/cell.js.map +1 -0
- package/cjs/semantic-marks/interval.d.ts +14 -0
- package/cjs/semantic-marks/interval.js +80 -0
- package/cjs/semantic-marks/interval.js.map +1 -0
- package/cjs/semantic-marks/text.d.ts +10 -0
- package/cjs/semantic-marks/text.js +25 -0
- package/cjs/semantic-marks/text.js.map +1 -0
- package/cjs/theme/common/component.d.ts +15 -0
- package/cjs/theme/common/component.js +493 -0
- package/cjs/theme/common/component.js.map +1 -0
- package/cjs/theme/common/constants.d.ts +1 -0
- package/cjs/theme/common/constants.js +6 -0
- package/cjs/theme/common/constants.js.map +1 -0
- package/cjs/theme/common/mark.d.ts +2 -0
- package/cjs/theme/common/mark.js +15 -0
- package/cjs/theme/common/mark.js.map +1 -0
- package/cjs/theme/dark.d.ts +2 -0
- package/cjs/theme/dark.js +94 -0
- package/cjs/theme/dark.js.map +1 -0
- package/cjs/theme/default.d.ts +2 -0
- package/cjs/theme/default.js +18 -0
- package/cjs/theme/default.js.map +1 -0
- package/cjs/theme/theme-manager.d.ts +8 -0
- package/cjs/theme/theme-manager.js +26 -0
- package/cjs/theme/theme-manager.js.map +1 -0
- package/cjs/transforms/data/bin.d.ts +2 -0
- package/cjs/transforms/data/bin.js +21 -0
- package/cjs/transforms/data/bin.js.map +1 -0
- package/cjs/transforms/data/circular-relation.d.ts +2 -0
- package/cjs/transforms/data/circular-relation.js +56 -0
- package/cjs/transforms/data/circular-relation.js.map +1 -0
- package/cjs/transforms/data/contour.d.ts +2 -0
- package/cjs/transforms/data/contour.js +115 -0
- package/cjs/transforms/data/contour.js.map +1 -0
- package/cjs/transforms/data/filter.d.ts +2 -0
- package/cjs/transforms/data/filter.js +10 -0
- package/cjs/transforms/data/filter.js.map +1 -0
- package/cjs/transforms/data/fold.d.ts +2 -0
- package/cjs/transforms/data/fold.js +24 -0
- package/cjs/transforms/data/fold.js.map +1 -0
- package/cjs/transforms/data/funnel.d.ts +2 -0
- package/cjs/transforms/data/funnel.js +25 -0
- package/cjs/transforms/data/funnel.js.map +1 -0
- package/cjs/transforms/data/join.d.ts +2 -0
- package/cjs/transforms/data/join.js +33 -0
- package/cjs/transforms/data/join.js.map +1 -0
- package/cjs/transforms/data/kde.d.ts +2 -0
- package/cjs/transforms/data/kde.js +90 -0
- package/cjs/transforms/data/kde.js.map +1 -0
- package/cjs/transforms/data/map.d.ts +2 -0
- package/cjs/transforms/data/map.js +23 -0
- package/cjs/transforms/data/map.js.map +1 -0
- package/cjs/transforms/data/pick.d.ts +2 -0
- package/cjs/transforms/data/pick.js +20 -0
- package/cjs/transforms/data/pick.js.map +1 -0
- package/cjs/transforms/data/pie.d.ts +2 -0
- package/cjs/transforms/data/pie.js +24 -0
- package/cjs/transforms/data/pie.js.map +1 -0
- package/cjs/transforms/data/range.d.ts +4 -0
- package/cjs/transforms/data/range.js +15 -0
- package/cjs/transforms/data/range.js.map +1 -0
- package/cjs/transforms/data/sort.d.ts +2 -0
- package/cjs/transforms/data/sort.js +17 -0
- package/cjs/transforms/data/sort.js.map +1 -0
- package/cjs/transforms/data/stack.d.ts +2 -0
- package/cjs/transforms/data/stack.js +74 -0
- package/cjs/transforms/data/stack.js.map +1 -0
- package/cjs/transforms/data/unfold.d.ts +2 -0
- package/cjs/transforms/data/unfold.js +49 -0
- package/cjs/transforms/data/unfold.js.map +1 -0
- package/cjs/transforms/index.d.ts +23 -0
- package/cjs/transforms/index.js +213 -0
- package/cjs/transforms/index.js.map +1 -0
- package/cjs/transforms/mark/dodge.d.ts +2 -0
- package/cjs/transforms/mark/dodge.js +81 -0
- package/cjs/transforms/mark/dodge.js.map +1 -0
- package/cjs/transforms/mark/jitter.d.ts +4 -0
- package/cjs/transforms/mark/jitter.js +53 -0
- package/cjs/transforms/mark/jitter.js.map +1 -0
- package/cjs/transforms/mark/lttb-sample.d.ts +2 -0
- package/cjs/transforms/mark/lttb-sample.js +68 -0
- package/cjs/transforms/mark/lttb-sample.js.map +1 -0
- package/cjs/transforms/mark/mark-overlap.d.ts +2 -0
- package/cjs/transforms/mark/mark-overlap.js +79 -0
- package/cjs/transforms/mark/mark-overlap.js.map +1 -0
- package/cjs/transforms/mark/symmetry.d.ts +2 -0
- package/cjs/transforms/mark/symmetry.js +25 -0
- package/cjs/transforms/mark/symmetry.js.map +1 -0
- package/cjs/transforms/util/util.d.ts +5 -0
- package/cjs/transforms/util/util.js +41 -0
- package/cjs/transforms/util/util.js.map +1 -0
- package/cjs/transforms/view/identifier.d.ts +2 -0
- package/cjs/transforms/view/identifier.js +17 -0
- package/cjs/transforms/view/identifier.js.map +1 -0
- package/cjs/types/animate.d.ts +224 -0
- package/cjs/types/animate.js +6 -0
- package/cjs/types/animate.js.map +1 -0
- package/cjs/types/base.d.ts +36 -0
- package/cjs/types/base.js +6 -0
- package/cjs/types/base.js.map +1 -0
- package/cjs/types/component.d.ts +240 -0
- package/cjs/types/component.js +6 -0
- package/cjs/types/component.js.map +1 -0
- package/cjs/types/coordinate.d.ts +15 -0
- package/cjs/types/coordinate.js +6 -0
- package/cjs/types/coordinate.js.map +1 -0
- package/cjs/types/data.d.ts +55 -0
- package/cjs/types/data.js +5 -0
- package/cjs/types/data.js.map +1 -0
- package/cjs/types/dataflow.d.ts +13 -0
- package/cjs/types/dataflow.js +6 -0
- package/cjs/types/dataflow.js.map +1 -0
- package/cjs/types/element.d.ts +117 -0
- package/cjs/types/element.js +6 -0
- package/cjs/types/element.js.map +1 -0
- package/cjs/types/event.d.ts +58 -0
- package/cjs/types/event.js +6 -0
- package/cjs/types/event.js.map +1 -0
- package/cjs/types/glyph.d.ts +29 -0
- package/cjs/types/glyph.js +6 -0
- package/cjs/types/glyph.js.map +1 -0
- package/cjs/types/grammar.d.ts +184 -0
- package/cjs/types/grammar.js +6 -0
- package/cjs/types/grammar.js.map +1 -0
- package/cjs/types/hooks.d.ts +45 -0
- package/cjs/types/hooks.js +6 -0
- package/cjs/types/hooks.js.map +1 -0
- package/cjs/types/index.d.ts +22 -0
- package/cjs/types/index.js +31 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/layout.d.ts +5 -0
- package/cjs/types/layout.js +6 -0
- package/cjs/types/layout.js.map +1 -0
- package/cjs/types/mark.d.ts +344 -0
- package/cjs/types/mark.js +6 -0
- package/cjs/types/mark.js.map +1 -0
- package/cjs/types/morph.d.ts +29 -0
- package/cjs/types/morph.js +6 -0
- package/cjs/types/morph.js.map +1 -0
- package/cjs/types/plot.d.ts +326 -0
- package/cjs/types/plot.js +6 -0
- package/cjs/types/plot.js.map +1 -0
- package/cjs/types/projection.d.ts +61 -0
- package/cjs/types/projection.js +6 -0
- package/cjs/types/projection.js.map +1 -0
- package/cjs/types/renderer.d.ts +19 -0
- package/cjs/types/renderer.js +6 -0
- package/cjs/types/renderer.js.map +1 -0
- package/cjs/types/scale.d.ts +111 -0
- package/cjs/types/scale.js +6 -0
- package/cjs/types/scale.js.map +1 -0
- package/cjs/types/signal.d.ts +20 -0
- package/cjs/types/signal.js +6 -0
- package/cjs/types/signal.js.map +1 -0
- package/cjs/types/theme.d.ts +41 -0
- package/cjs/types/theme.js +6 -0
- package/cjs/types/theme.js.map +1 -0
- package/cjs/types/transform.d.ts +291 -0
- package/cjs/types/transform.js +6 -0
- package/cjs/types/transform.js.map +1 -0
- package/cjs/types/view.d.ts +217 -0
- package/cjs/types/view.js +6 -0
- package/cjs/types/view.js.map +1 -0
- package/cjs/util/data.d.ts +3 -0
- package/cjs/util/data.js +64 -0
- package/cjs/util/data.js.map +1 -0
- package/cjs/util/grammar-heap.d.ts +14 -0
- package/cjs/util/grammar-heap.js +66 -0
- package/cjs/util/grammar-heap.js.map +1 -0
- package/cjs/util/text.d.ts +19 -0
- package/cjs/util/text.js +32 -0
- package/cjs/util/text.js.map +1 -0
- package/cjs/util/unique-list.d.ts +12 -0
- package/cjs/util/unique-list.js +37 -0
- package/cjs/util/unique-list.js.map +1 -0
- package/cjs/view/View.d.ts +157 -0
- package/cjs/view/View.js +800 -0
- package/cjs/view/View.js.map +1 -0
- package/cjs/view/animate.d.ts +20 -0
- package/cjs/view/animate.js +106 -0
- package/cjs/view/animate.js.map +1 -0
- package/cjs/view/component.d.ts +26 -0
- package/cjs/view/component.js +64 -0
- package/cjs/view/component.js.map +1 -0
- package/cjs/view/constants.d.ts +17 -0
- package/cjs/view/constants.js +13 -0
- package/cjs/view/constants.js.map +1 -0
- package/cjs/view/coordinate.d.ts +23 -0
- package/cjs/view/coordinate.js +59 -0
- package/cjs/view/coordinate.js.map +1 -0
- package/cjs/view/data.d.ts +37 -0
- package/cjs/view/data.js +198 -0
- package/cjs/view/data.js.map +1 -0
- package/cjs/view/dataflow.d.ts +32 -0
- package/cjs/view/dataflow.js +146 -0
- package/cjs/view/dataflow.js.map +1 -0
- package/cjs/view/events.d.ts +4 -0
- package/cjs/view/events.js +34 -0
- package/cjs/view/events.js.map +1 -0
- package/cjs/view/glyph-meta.d.ts +29 -0
- package/cjs/view/glyph-meta.js +45 -0
- package/cjs/view/glyph-meta.js.map +1 -0
- package/cjs/view/glyph.d.ts +14 -0
- package/cjs/view/glyph.js +29 -0
- package/cjs/view/glyph.js.map +1 -0
- package/cjs/view/grammar-base.d.ts +46 -0
- package/cjs/view/grammar-base.js +171 -0
- package/cjs/view/grammar-base.js.map +1 -0
- package/cjs/view/grammar-record.d.ts +39 -0
- package/cjs/view/grammar-record.js +180 -0
- package/cjs/view/grammar-record.js.map +1 -0
- package/cjs/view/group.d.ts +13 -0
- package/cjs/view/group.js +39 -0
- package/cjs/view/group.js.map +1 -0
- package/cjs/view/index.d.ts +1 -0
- package/cjs/view/index.js +21 -0
- package/cjs/view/index.js.map +1 -0
- package/cjs/view/mark.d.ts +112 -0
- package/cjs/view/mark.js +600 -0
- package/cjs/view/mark.js.map +1 -0
- package/cjs/view/scale.d.ts +26 -0
- package/cjs/view/scale.js +86 -0
- package/cjs/view/scale.js.map +1 -0
- package/cjs/view/signal.d.ts +18 -0
- package/cjs/view/signal.js +56 -0
- package/cjs/view/signal.js.map +1 -0
- package/es/component/axis.d.ts +26 -0
- package/es/component/axis.js +162 -0
- package/es/component/axis.js.map +1 -0
- package/es/component/crosshair.d.ts +50 -0
- package/es/component/crosshair.js +275 -0
- package/es/component/crosshair.js.map +1 -0
- package/es/component/datazoom.d.ts +19 -0
- package/es/component/datazoom.js +161 -0
- package/es/component/datazoom.js.map +1 -0
- package/es/component/grid.d.ts +27 -0
- package/es/component/grid.js +193 -0
- package/es/component/grid.js.map +1 -0
- package/es/component/index.d.ts +11 -0
- package/es/component/index.js +22 -0
- package/es/component/index.js.map +1 -0
- package/es/component/label.d.ts +19 -0
- package/es/component/label.js +124 -0
- package/es/component/label.js.map +1 -0
- package/es/component/legend.d.ts +26 -0
- package/es/component/legend.js +169 -0
- package/es/component/legend.js.map +1 -0
- package/es/component/player.d.ts +25 -0
- package/es/component/player.js +136 -0
- package/es/component/player.js.map +1 -0
- package/es/component/scale.d.ts +8 -0
- package/es/component/scale.js +19 -0
- package/es/component/scale.js.map +1 -0
- package/es/component/scrollbar.d.ts +23 -0
- package/es/component/scrollbar.js +184 -0
- package/es/component/scrollbar.js.map +1 -0
- package/es/component/slider.d.ts +19 -0
- package/es/component/slider.js +86 -0
- package/es/component/slider.js.map +1 -0
- package/es/component/title.d.ts +15 -0
- package/es/component/title.js +58 -0
- package/es/component/title.js.map +1 -0
- package/es/component/tooltip.d.ts +62 -0
- package/es/component/tooltip.js +303 -0
- package/es/component/tooltip.js.map +1 -0
- package/es/core/factory.d.ts +35 -0
- package/es/core/factory.js +67 -0
- package/es/core/factory.js.map +1 -0
- package/es/glyph/boxplot.d.ts +10 -0
- package/es/glyph/boxplot.js +410 -0
- package/es/glyph/boxplot.js.map +1 -0
- package/es/glyph/index.d.ts +7 -0
- package/es/glyph/index.js +11 -0
- package/es/glyph/index.js.map +1 -0
- package/es/glyph/link-path.d.ts +7 -0
- package/es/glyph/link-path.js +132 -0
- package/es/glyph/link-path.js.map +1 -0
- package/es/glyph/ripple.d.ts +1 -0
- package/es/glyph/ripple.js +38 -0
- package/es/glyph/ripple.js.map +1 -0
- package/es/glyph/tree-path.d.ts +7 -0
- package/es/glyph/tree-path.js +146 -0
- package/es/glyph/tree-path.js.map +1 -0
- package/es/glyph/violin.d.ts +1 -0
- package/es/glyph/violin.js +163 -0
- package/es/glyph/violin.js.map +1 -0
- package/es/glyph/wave.d.ts +1 -0
- package/es/glyph/wave.js +61 -0
- package/es/glyph/wave.js.map +1 -0
- package/es/graph/animation/animate.d.ts +48 -0
- package/es/graph/animation/animate.js +247 -0
- package/es/graph/animation/animate.js.map +1 -0
- package/es/graph/animation/animation/clip.d.ts +4 -0
- package/es/graph/animation/animation/clip.js +44 -0
- package/es/graph/animation/animation/clip.js.map +1 -0
- package/es/graph/animation/animation/fade.d.ts +4 -0
- package/es/graph/animation/animation/fade.js +32 -0
- package/es/graph/animation/animation/fade.js.map +1 -0
- package/es/graph/animation/animation/grow-cartesian.d.ts +7 -0
- package/es/graph/animation/animation/grow-cartesian.js +272 -0
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -0
- package/es/graph/animation/animation/grow-interval.d.ts +3 -0
- package/es/graph/animation/animation/grow-interval.js +184 -0
- package/es/graph/animation/animation/grow-interval.js.map +1 -0
- package/es/graph/animation/animation/grow-points.d.ts +7 -0
- package/es/graph/animation/animation/grow-points.js +107 -0
- package/es/graph/animation/animation/grow-points.js.map +1 -0
- package/es/graph/animation/animation/grow-polar.d.ts +5 -0
- package/es/graph/animation/animation/grow-polar.js +160 -0
- package/es/graph/animation/animation/grow-polar.js.map +1 -0
- package/es/graph/animation/animation/index.d.ts +11 -0
- package/es/graph/animation/animation/index.js +22 -0
- package/es/graph/animation/animation/index.js.map +1 -0
- package/es/graph/animation/animation/move.d.ts +3 -0
- package/es/graph/animation/animation/move.js +78 -0
- package/es/graph/animation/animation/move.js.map +1 -0
- package/es/graph/animation/animation/rotate.d.ts +3 -0
- package/es/graph/animation/animation/rotate.js +32 -0
- package/es/graph/animation/animation/rotate.js.map +1 -0
- package/es/graph/animation/animation/scale.d.ts +3 -0
- package/es/graph/animation/animation/scale.js +74 -0
- package/es/graph/animation/animation/scale.js.map +1 -0
- package/es/graph/animation/animation/update.d.ts +6 -0
- package/es/graph/animation/animation/update.js +20 -0
- package/es/graph/animation/animation/update.js.map +1 -0
- package/es/graph/animation/animator.d.ts +26 -0
- package/es/graph/animation/animator.js +83 -0
- package/es/graph/animation/animator.js.map +1 -0
- package/es/graph/animation/arranger.d.ts +13 -0
- package/es/graph/animation/arranger.js +29 -0
- package/es/graph/animation/arranger.js.map +1 -0
- package/es/graph/animation/attribute.d.ts +27 -0
- package/es/graph/animation/attribute.js +114 -0
- package/es/graph/animation/attribute.js.map +1 -0
- package/es/graph/animation/config.d.ts +5 -0
- package/es/graph/animation/config.js +84 -0
- package/es/graph/animation/config.js.map +1 -0
- package/es/graph/animation/morph.d.ts +12 -0
- package/es/graph/animation/morph.js +171 -0
- package/es/graph/animation/morph.js.map +1 -0
- package/es/graph/attributes/common.d.ts +2 -0
- package/es/graph/attributes/common.js +13 -0
- package/es/graph/attributes/common.js.map +1 -0
- package/es/graph/attributes/helpers.d.ts +17 -0
- package/es/graph/attributes/helpers.js +75 -0
- package/es/graph/attributes/helpers.js.map +1 -0
- package/es/graph/attributes/index.d.ts +10 -0
- package/es/graph/attributes/index.js +231 -0
- package/es/graph/attributes/index.js.map +1 -0
- package/es/graph/canvas-renderer.d.ts +34 -0
- package/es/graph/canvas-renderer.js +115 -0
- package/es/graph/canvas-renderer.js.map +1 -0
- package/es/graph/constants.d.ts +23 -0
- package/es/graph/constants.js +47 -0
- package/es/graph/constants.js.map +1 -0
- package/es/graph/element.d.ts +66 -0
- package/es/graph/element.js +292 -0
- package/es/graph/element.js.map +1 -0
- package/es/graph/enums.d.ts +153 -0
- package/es/graph/enums.js +129 -0
- package/es/graph/enums.js.map +1 -0
- package/es/graph/glyph-element.d.ts +53 -0
- package/es/graph/glyph-element.js +206 -0
- package/es/graph/glyph-element.js.map +1 -0
- package/es/graph/index.d.ts +3 -0
- package/es/graph/index.js +6 -0
- package/es/graph/index.js.map +1 -0
- package/es/graph/layout/grid.d.ts +3 -0
- package/es/graph/layout/grid.js +66 -0
- package/es/graph/layout/grid.js.map +1 -0
- package/es/graph/layout/layout.d.ts +3 -0
- package/es/graph/layout/layout.js +33 -0
- package/es/graph/layout/layout.js.map +1 -0
- package/es/graph/layout/relative.d.ts +3 -0
- package/es/graph/layout/relative.js +85 -0
- package/es/graph/layout/relative.js.map +1 -0
- package/es/graph/mark/differ.d.ts +20 -0
- package/es/graph/mark/differ.js +104 -0
- package/es/graph/mark/differ.js.map +1 -0
- package/es/graph/mark/encode.d.ts +10 -0
- package/es/graph/mark/encode.js +92 -0
- package/es/graph/mark/encode.js.map +1 -0
- package/es/graph/mark/large-rects.d.ts +10 -0
- package/es/graph/mark/large-rects.js +23 -0
- package/es/graph/mark/large-rects.js.map +1 -0
- package/es/graph/mark/large-symbols.d.ts +11 -0
- package/es/graph/mark/large-symbols.js +27 -0
- package/es/graph/mark/large-symbols.js.map +1 -0
- package/es/graph/mark-tree.d.ts +2 -0
- package/es/graph/mark-tree.js +15 -0
- package/es/graph/mark-tree.js.map +1 -0
- package/es/graph/util/element.d.ts +2 -0
- package/es/graph/util/element.js +8 -0
- package/es/graph/util/element.js.map +1 -0
- package/es/graph/util/env.d.ts +2 -0
- package/es/graph/util/env.js +6 -0
- package/es/graph/util/env.js.map +1 -0
- package/es/graph/util/events-extend.d.ts +5 -0
- package/es/graph/util/events-extend.js +12 -0
- package/es/graph/util/events-extend.js.map +1 -0
- package/es/graph/util/graphic.d.ts +9 -0
- package/es/graph/util/graphic.js +59 -0
- package/es/graph/util/graphic.js.map +1 -0
- package/es/graph/util/point.d.ts +1 -0
- package/es/graph/util/point.js +67 -0
- package/es/graph/util/point.js.map +1 -0
- package/es/index.d.ts +14 -0
- package/es/index.js +27 -0
- package/es/index.js.map +1 -0
- package/es/parse/coordinate.d.ts +7 -0
- package/es/parse/coordinate.js +65 -0
- package/es/parse/coordinate.js.map +1 -0
- package/es/parse/event.d.ts +8 -0
- package/es/parse/event.js +23 -0
- package/es/parse/event.js.map +1 -0
- package/es/parse/mark.d.ts +4 -0
- package/es/parse/mark.js +19 -0
- package/es/parse/mark.js.map +1 -0
- package/es/parse/option.d.ts +3 -0
- package/es/parse/option.js +10 -0
- package/es/parse/option.js.map +1 -0
- package/es/parse/scale.d.ts +8 -0
- package/es/parse/scale.js +347 -0
- package/es/parse/scale.js.map +1 -0
- package/es/parse/transform.d.ts +5 -0
- package/es/parse/transform.js +102 -0
- package/es/parse/transform.js.map +1 -0
- package/es/parse/util.d.ts +13 -0
- package/es/parse/util.js +65 -0
- package/es/parse/util.js.map +1 -0
- package/es/parse/view.d.ts +17 -0
- package/es/parse/view.js +98 -0
- package/es/parse/view.js.map +1 -0
- package/es/semantic-marks/cell.d.ts +13 -0
- package/es/semantic-marks/cell.js +57 -0
- package/es/semantic-marks/cell.js.map +1 -0
- package/es/semantic-marks/interval.d.ts +14 -0
- package/es/semantic-marks/interval.js +87 -0
- package/es/semantic-marks/interval.js.map +1 -0
- package/es/semantic-marks/text.d.ts +10 -0
- package/es/semantic-marks/text.js +22 -0
- package/es/semantic-marks/text.js.map +1 -0
- package/es/theme/common/component.d.ts +15 -0
- package/es/theme/common/component.js +510 -0
- package/es/theme/common/component.js.map +1 -0
- package/es/theme/common/constants.d.ts +1 -0
- package/es/theme/common/constants.js +2 -0
- package/es/theme/common/constants.js.map +1 -0
- package/es/theme/common/mark.d.ts +2 -0
- package/es/theme/common/mark.js +11 -0
- package/es/theme/common/mark.js.map +1 -0
- package/es/theme/dark.d.ts +2 -0
- package/es/theme/dark.js +96 -0
- package/es/theme/dark.js.map +1 -0
- package/es/theme/default.d.ts +2 -0
- package/es/theme/default.js +16 -0
- package/es/theme/default.js.map +1 -0
- package/es/theme/theme-manager.d.ts +8 -0
- package/es/theme/theme-manager.js +22 -0
- package/es/theme/theme-manager.js.map +1 -0
- package/es/transforms/data/bin.d.ts +2 -0
- package/es/transforms/data/bin.js +16 -0
- package/es/transforms/data/bin.js.map +1 -0
- package/es/transforms/data/circular-relation.d.ts +2 -0
- package/es/transforms/data/circular-relation.js +44 -0
- package/es/transforms/data/circular-relation.js.map +1 -0
- package/es/transforms/data/contour.d.ts +2 -0
- package/es/transforms/data/contour.js +111 -0
- package/es/transforms/data/contour.js.map +1 -0
- package/es/transforms/data/filter.d.ts +2 -0
- package/es/transforms/data/filter.js +2 -0
- package/es/transforms/data/filter.js.map +1 -0
- package/es/transforms/data/fold.d.ts +2 -0
- package/es/transforms/data/fold.js +16 -0
- package/es/transforms/data/fold.js.map +1 -0
- package/es/transforms/data/funnel.d.ts +2 -0
- package/es/transforms/data/funnel.js +17 -0
- package/es/transforms/data/funnel.js.map +1 -0
- package/es/transforms/data/join.d.ts +2 -0
- package/es/transforms/data/join.js +26 -0
- package/es/transforms/data/join.js.map +1 -0
- package/es/transforms/data/kde.d.ts +2 -0
- package/es/transforms/data/kde.js +80 -0
- package/es/transforms/data/kde.js.map +1 -0
- package/es/transforms/data/map.d.ts +2 -0
- package/es/transforms/data/map.js +16 -0
- package/es/transforms/data/map.js.map +1 -0
- package/es/transforms/data/pick.d.ts +2 -0
- package/es/transforms/data/pick.js +15 -0
- package/es/transforms/data/pick.js.map +1 -0
- package/es/transforms/data/pie.d.ts +2 -0
- package/es/transforms/data/pie.js +18 -0
- package/es/transforms/data/pie.js.map +1 -0
- package/es/transforms/data/range.d.ts +4 -0
- package/es/transforms/data/range.js +9 -0
- package/es/transforms/data/range.js.map +1 -0
- package/es/transforms/data/sort.d.ts +2 -0
- package/es/transforms/data/sort.js +13 -0
- package/es/transforms/data/sort.js.map +1 -0
- package/es/transforms/data/stack.d.ts +2 -0
- package/es/transforms/data/stack.js +72 -0
- package/es/transforms/data/stack.js.map +1 -0
- package/es/transforms/data/unfold.d.ts +2 -0
- package/es/transforms/data/unfold.js +45 -0
- package/es/transforms/data/unfold.js.map +1 -0
- package/es/transforms/index.d.ts +23 -0
- package/es/transforms/index.js +205 -0
- package/es/transforms/index.js.map +1 -0
- package/es/transforms/mark/dodge.d.ts +2 -0
- package/es/transforms/mark/dodge.js +74 -0
- package/es/transforms/mark/dodge.js.map +1 -0
- package/es/transforms/mark/jitter.d.ts +4 -0
- package/es/transforms/mark/jitter.js +48 -0
- package/es/transforms/mark/jitter.js.map +1 -0
- package/es/transforms/mark/lttb-sample.d.ts +2 -0
- package/es/transforms/mark/lttb-sample.js +60 -0
- package/es/transforms/mark/lttb-sample.js.map +1 -0
- package/es/transforms/mark/mark-overlap.d.ts +2 -0
- package/es/transforms/mark/mark-overlap.js +71 -0
- package/es/transforms/mark/mark-overlap.js.map +1 -0
- package/es/transforms/mark/symmetry.d.ts +2 -0
- package/es/transforms/mark/symmetry.js +20 -0
- package/es/transforms/mark/symmetry.js.map +1 -0
- package/es/transforms/util/util.d.ts +5 -0
- package/es/transforms/util/util.js +33 -0
- package/es/transforms/util/util.js.map +1 -0
- package/es/transforms/view/identifier.d.ts +2 -0
- package/es/transforms/view/identifier.js +13 -0
- package/es/transforms/view/identifier.js.map +1 -0
- package/es/types/animate.d.ts +224 -0
- package/es/types/animate.js +2 -0
- package/es/types/animate.js.map +1 -0
- package/es/types/base.d.ts +36 -0
- package/es/types/base.js +2 -0
- package/es/types/base.js.map +1 -0
- package/es/types/component.d.ts +240 -0
- package/es/types/component.js +2 -0
- package/es/types/component.js.map +1 -0
- package/es/types/coordinate.d.ts +15 -0
- package/es/types/coordinate.js +2 -0
- package/es/types/coordinate.js.map +1 -0
- package/es/types/data.d.ts +55 -0
- package/es/types/data.js +1 -0
- package/es/types/data.js.map +1 -0
- package/es/types/dataflow.d.ts +13 -0
- package/es/types/dataflow.js +2 -0
- package/es/types/dataflow.js.map +1 -0
- package/es/types/element.d.ts +117 -0
- package/es/types/element.js +2 -0
- package/es/types/element.js.map +1 -0
- package/es/types/event.d.ts +58 -0
- package/es/types/event.js +2 -0
- package/es/types/event.js.map +1 -0
- package/es/types/glyph.d.ts +29 -0
- package/es/types/glyph.js +2 -0
- package/es/types/glyph.js.map +1 -0
- package/es/types/grammar.d.ts +184 -0
- package/es/types/grammar.js +2 -0
- package/es/types/grammar.js.map +1 -0
- package/es/types/hooks.d.ts +45 -0
- package/es/types/hooks.js +2 -0
- package/es/types/hooks.js.map +1 -0
- package/es/types/index.d.ts +22 -0
- package/es/types/index.js +44 -0
- package/es/types/index.js.map +1 -0
- package/es/types/layout.d.ts +5 -0
- package/es/types/layout.js +2 -0
- package/es/types/layout.js.map +1 -0
- package/es/types/mark.d.ts +344 -0
- package/es/types/mark.js +2 -0
- package/es/types/mark.js.map +1 -0
- package/es/types/morph.d.ts +29 -0
- package/es/types/morph.js +2 -0
- package/es/types/morph.js.map +1 -0
- package/es/types/plot.d.ts +326 -0
- package/es/types/plot.js +2 -0
- package/es/types/plot.js.map +1 -0
- package/es/types/projection.d.ts +61 -0
- package/es/types/projection.js +2 -0
- package/es/types/projection.js.map +1 -0
- package/es/types/renderer.d.ts +19 -0
- package/es/types/renderer.js +2 -0
- package/es/types/renderer.js.map +1 -0
- package/es/types/scale.d.ts +111 -0
- package/es/types/scale.js +2 -0
- package/es/types/scale.js.map +1 -0
- package/es/types/signal.d.ts +20 -0
- package/es/types/signal.js +2 -0
- package/es/types/signal.js.map +1 -0
- package/es/types/theme.d.ts +41 -0
- package/es/types/theme.js +2 -0
- package/es/types/theme.js.map +1 -0
- package/es/types/transform.d.ts +291 -0
- package/es/types/transform.js +2 -0
- package/es/types/transform.js.map +1 -0
- package/es/types/view.d.ts +217 -0
- package/es/types/view.js +2 -0
- package/es/types/view.js.map +1 -0
- package/es/util/data.d.ts +3 -0
- package/es/util/data.js +60 -0
- package/es/util/data.js.map +1 -0
- package/es/util/grammar-heap.d.ts +14 -0
- package/es/util/grammar-heap.js +58 -0
- package/es/util/grammar-heap.js.map +1 -0
- package/es/util/text.d.ts +19 -0
- package/es/util/text.js +25 -0
- package/es/util/text.js.map +1 -0
- package/es/util/unique-list.d.ts +12 -0
- package/es/util/unique-list.js +29 -0
- package/es/util/unique-list.js.map +1 -0
- package/es/view/View.d.ts +157 -0
- package/es/view/View.js +836 -0
- package/es/view/View.js.map +1 -0
- package/es/view/animate.d.ts +20 -0
- package/es/view/animate.js +98 -0
- package/es/view/animate.js.map +1 -0
- package/es/view/component.d.ts +26 -0
- package/es/view/component.js +64 -0
- package/es/view/component.js.map +1 -0
- package/es/view/constants.d.ts +17 -0
- package/es/view/constants.js +32 -0
- package/es/view/constants.js.map +1 -0
- package/es/view/coordinate.d.ts +23 -0
- package/es/view/coordinate.js +52 -0
- package/es/view/coordinate.js.map +1 -0
- package/es/view/data.d.ts +37 -0
- package/es/view/data.js +195 -0
- package/es/view/data.js.map +1 -0
- package/es/view/dataflow.d.ts +32 -0
- package/es/view/dataflow.js +141 -0
- package/es/view/dataflow.js.map +1 -0
- package/es/view/events.d.ts +4 -0
- package/es/view/events.js +26 -0
- package/es/view/events.js.map +1 -0
- package/es/view/glyph-meta.d.ts +29 -0
- package/es/view/glyph-meta.js +37 -0
- package/es/view/glyph-meta.js.map +1 -0
- package/es/view/glyph.d.ts +14 -0
- package/es/view/glyph.js +27 -0
- package/es/view/glyph.js.map +1 -0
- package/es/view/grammar-base.d.ts +46 -0
- package/es/view/grammar-base.js +165 -0
- package/es/view/grammar-base.js.map +1 -0
- package/es/view/grammar-record.d.ts +39 -0
- package/es/view/grammar-record.js +170 -0
- package/es/view/grammar-record.js.map +1 -0
- package/es/view/group.d.ts +13 -0
- package/es/view/group.js +39 -0
- package/es/view/group.js.map +1 -0
- package/es/view/index.d.ts +1 -0
- package/es/view/index.js +2 -0
- package/es/view/index.js.map +1 -0
- package/es/view/mark.d.ts +112 -0
- package/es/view/mark.js +604 -0
- package/es/view/mark.js.map +1 -0
- package/es/view/scale.d.ts +26 -0
- package/es/view/scale.js +82 -0
- package/es/view/scale.js.map +1 -0
- package/es/view/signal.d.ts +18 -0
- package/es/view/signal.js +52 -0
- package/es/view/signal.js.map +1 -0
- package/package.json +67 -0
package/es/view/mark.js
ADDED
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
2
|
+
return new (P || (P = Promise))((function(resolve, reject) {
|
|
3
|
+
function fulfilled(value) {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function rejected(value) {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function step(result) {
|
|
18
|
+
var value;
|
|
19
|
+
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
|
|
20
|
+
resolve(value);
|
|
21
|
+
}))).then(fulfilled, rejected);
|
|
22
|
+
}
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
import { isNil, isString } from "@visactor/vutils";
|
|
28
|
+
|
|
29
|
+
import { BridgeElementKey, CollectionMarkType, DefaultKey, DefaultMarkData, Mark3DType } from "../graph/constants";
|
|
30
|
+
|
|
31
|
+
import { DiffState, GrammarMarkType, LayoutState, HOOK_EVENT, GrammarTypeEnum, BuiltInEncodeNames } from "../graph/enums";
|
|
32
|
+
|
|
33
|
+
import { Differ, groupData } from "../graph/mark/differ";
|
|
34
|
+
|
|
35
|
+
import { Animate } from "../graph/animation/animate";
|
|
36
|
+
|
|
37
|
+
import { createGraphicItem, removeGraphicItem } from "../graph/util/graphic";
|
|
38
|
+
|
|
39
|
+
import { GrammarBase } from "./grammar-base";
|
|
40
|
+
|
|
41
|
+
import { isFieldEncode, isScaleEncode, parseEncodeType } from "../parse/mark";
|
|
42
|
+
|
|
43
|
+
import { getGrammarOutput, parseField, isFunctionType } from "../parse/util";
|
|
44
|
+
|
|
45
|
+
import { parseTransformSpec } from "../parse/transform";
|
|
46
|
+
|
|
47
|
+
import { createElement } from "../graph/util/element";
|
|
48
|
+
|
|
49
|
+
import { invokeEncoderToItems, splitEncoderInLarge } from "../graph/mark/encode";
|
|
50
|
+
|
|
51
|
+
import { isPositionOrSizeChannel, transformsByType } from "../graph/attributes";
|
|
52
|
+
|
|
53
|
+
import getExtendedEvents from "../graph/util/events-extend";
|
|
54
|
+
|
|
55
|
+
import { EVENT_SOURCE_VIEW } from "./constants";
|
|
56
|
+
|
|
57
|
+
export class Mark extends GrammarBase {
|
|
58
|
+
constructor(view, markType, group) {
|
|
59
|
+
super(view), this.grammarType = "mark", this.elements = [], this.elementMap = new Map,
|
|
60
|
+
this.isUpdated = !0, this._isReentered = !1, this.animate = new Animate(this, {}),
|
|
61
|
+
this.differ = new Differ([]), this.evaluateSync = (data, parameters) => {
|
|
62
|
+
var _a;
|
|
63
|
+
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || this.evaluateTransformSync(this._getTransformsAfterEncode(), this.elements, parameters),
|
|
64
|
+
this;
|
|
65
|
+
}, this.markType = markType, this.spec.type = markType, this.spec.encode = {
|
|
66
|
+
update: {}
|
|
67
|
+
}, this.spec.group = group, group && (this.group = group, this.attach(group), group.appendChild(this));
|
|
68
|
+
}
|
|
69
|
+
parse(spec) {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
if (super.parse(spec), this.spec.group) {
|
|
72
|
+
const groupMark = isString(this.spec.group) ? this.view.getMarkById(this.spec.group) : this.spec.group;
|
|
73
|
+
this.detach(groupMark);
|
|
74
|
+
}
|
|
75
|
+
const groupMark = isString(spec.group) ? this.view.getMarkById(spec.group) : spec.group;
|
|
76
|
+
return this.attach(groupMark), this.join(null === (_a = spec.from) || void 0 === _a ? void 0 : _a.data, spec.key, spec.sort, spec.groupBy, spec.groupSort),
|
|
77
|
+
this.coordinate(spec.coordinate), this.state(spec.state, this.spec.stateSort), Object.keys(null !== (_b = this.spec.encode) && void 0 !== _b ? _b : {}).forEach((state => {
|
|
78
|
+
this.encodeState(state, {});
|
|
79
|
+
})), Object.keys(null !== (_c = spec.encode) && void 0 !== _c ? _c : {}).forEach((state => {
|
|
80
|
+
this.encodeState(state, spec.encode[state]);
|
|
81
|
+
})), this.animation(spec.animation), this.animationState(spec.animationState), this.morph(spec.morph, spec.morphKey, spec.morphElementKey),
|
|
82
|
+
this.layout(spec.layout), this.configure(spec), this.transform(spec.transform),
|
|
83
|
+
this.parseAddition(spec), this.spec = spec, this.markType = spec.type, this.commit(),
|
|
84
|
+
this;
|
|
85
|
+
}
|
|
86
|
+
parameters() {
|
|
87
|
+
var _a;
|
|
88
|
+
return null !== (_a = this._finalParameters) && void 0 !== _a ? _a : super.parameters();
|
|
89
|
+
}
|
|
90
|
+
parseAddition(spec) {
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
reuse(grammar) {
|
|
94
|
+
if (grammar.grammarType !== this.grammarType) return this;
|
|
95
|
+
const mark = grammar;
|
|
96
|
+
return this.markType = mark.markType, this.coord = mark.coord, this.elementMap = mark.elementMap,
|
|
97
|
+
this.elements = mark.elements, this.elementMap.forEach((element => element.mark = this)),
|
|
98
|
+
this.differ = mark.differ, this.animate = mark.animate, this.animate.mark = this,
|
|
99
|
+
this.context = mark.context, this.graphicItem = mark.graphicItem, this.graphicIndex = mark.graphicIndex,
|
|
100
|
+
this.graphicParent = mark.graphicParent, this.needClear = mark.needClear, this.isUpdated = mark.isUpdated,
|
|
101
|
+
this;
|
|
102
|
+
}
|
|
103
|
+
needLayout() {
|
|
104
|
+
return !isNil(this.spec.layout);
|
|
105
|
+
}
|
|
106
|
+
handleLayoutEnd() {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
(null === (_b = null === (_a = this.spec) || void 0 === _a ? void 0 : _a.layout) || void 0 === _b ? void 0 : _b.skipBeforeLayouted) && this.run();
|
|
109
|
+
}
|
|
110
|
+
handleRenderEnd() {
|
|
111
|
+
this.needClear && (this.cleanExitElements(), this.elementMap.forEach((element => {
|
|
112
|
+
element.diffState === DiffState.exit ? element.clearGraphicAttributes() : element.clearChangedGraphicAttributes();
|
|
113
|
+
})), this.differ.updateToCurrent(), this.needClear = !1);
|
|
114
|
+
}
|
|
115
|
+
evaluateMainTasks(data, parameters) {
|
|
116
|
+
var _a;
|
|
117
|
+
if (this.needSkipBeforeLayout() && this.view.getLayoutState() === LayoutState.before) return this;
|
|
118
|
+
const stage = null === (_a = this.view.renderer) || void 0 === _a ? void 0 : _a.stage();
|
|
119
|
+
this.init(stage, parameters);
|
|
120
|
+
const transformData = this.evaluateTransformSync(this._getTransformsBeforeJoin(), null != data ? data : DefaultMarkData, parameters);
|
|
121
|
+
let inputData = (null == transformData ? void 0 : transformData.progressive) ? data : transformData;
|
|
122
|
+
return this.evaluateGroup(inputData), this.renderContext = this.parseRenderContext(inputData, parameters),
|
|
123
|
+
this.renderContext.progressive ? (this.differ.reset(), this.elementMap.clear(),
|
|
124
|
+
this.evaluateProgressive()) : ((null == transformData ? void 0 : transformData.progressive) && (this.renderContext.parameters = parameters,
|
|
125
|
+
this.renderContext.beforeTransformProgressive = transformData.progressive, inputData = transformData.progressive.output()),
|
|
126
|
+
this.emit(HOOK_EVENT.BEFORE_MARK_JOIN), this.evaluateJoin(inputData), this.emit(HOOK_EVENT.AFTER_MARK_JOIN),
|
|
127
|
+
this.emit(HOOK_EVENT.BEFORE_MARK_STATE), this.evaluateState(this.elements, this.spec.state, parameters),
|
|
128
|
+
this.emit(HOOK_EVENT.AFTER_MARK_STATE), this.emit(HOOK_EVENT.BEFORE_MARK_ENCODE),
|
|
129
|
+
this.evaluateEncode(this.elements, this._getEncoders(), parameters), this.emit(HOOK_EVENT.AFTER_MARK_ENCODE)),
|
|
130
|
+
this.emit(HOOK_EVENT.BEFORE_MARK_UPDATE), this.update(this.spec), this.emit(HOOK_EVENT.AFTER_MARK_UPDATE),
|
|
131
|
+
this;
|
|
132
|
+
}
|
|
133
|
+
evaluateGroup(data) {
|
|
134
|
+
var _a;
|
|
135
|
+
if (this.markType === GrammarMarkType.group) return;
|
|
136
|
+
const currentData = null != data ? data : DefaultMarkData, groupKeyGetter = parseField(null !== (_a = this.spec.groupBy) && void 0 !== _a ? _a : () => DefaultKey), res = groupData(currentData, groupKeyGetter, this.spec.groupSort), groupKeys = res.keys;
|
|
137
|
+
this._groupKeys = groupKeys, this.differ.setCurrentData(res);
|
|
138
|
+
}
|
|
139
|
+
_getTransformsAfterEncodeItems() {
|
|
140
|
+
return this.transforms && this.transforms.filter((entry => "afterEncodeItems" === entry.markPhase));
|
|
141
|
+
}
|
|
142
|
+
_getTransformsAfterEncode() {
|
|
143
|
+
return this.transforms && this.transforms.filter((entry => isNil(entry.markPhase) || "afterEncode" === entry.markPhase));
|
|
144
|
+
}
|
|
145
|
+
_getTransformsBeforeJoin() {
|
|
146
|
+
return this.transforms ? this.transforms.filter((entry => "beforeJoin" === entry.markPhase)) : [];
|
|
147
|
+
}
|
|
148
|
+
evaluate(data, parameters) {
|
|
149
|
+
var _a;
|
|
150
|
+
return __awaiter(this, void 0, void 0, (function*() {
|
|
151
|
+
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || (yield this.evaluateTransform(this._getTransformsAfterEncode(), this.elements, parameters)),
|
|
152
|
+
this;
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
output() {
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
join(data, key, sort, groupBy, groupSort) {
|
|
159
|
+
return this.grammarSource && (this.detach(this.grammarSource), this.grammarSource = null),
|
|
160
|
+
this.spec.from = null, isNil(data) || (isString(data) ? this.grammarSource = this.view.getDataById(data) : this.grammarSource = data,
|
|
161
|
+
this.spec.from = {
|
|
162
|
+
data: data
|
|
163
|
+
}, this.attach(this.grammarSource)), this.spec.key = key, this.spec.sort = sort,
|
|
164
|
+
this.spec.groupBy = groupBy, this.spec.groupSort = groupSort, this.commit(), this;
|
|
165
|
+
}
|
|
166
|
+
coordinate(coordinate) {
|
|
167
|
+
return isString(coordinate) ? this.coord = this.view.getCoordinateById(coordinate) : this.coord = coordinate,
|
|
168
|
+
this.attach(this.coord), this.commit(), this;
|
|
169
|
+
}
|
|
170
|
+
state(state, stateSort) {
|
|
171
|
+
return this.spec.stateSort = stateSort, this.setFunctionSpec(state, "state");
|
|
172
|
+
}
|
|
173
|
+
encode(channel, value) {
|
|
174
|
+
return this.encodeState(DiffState.update, channel, value);
|
|
175
|
+
}
|
|
176
|
+
encodeState(state, channel, value) {
|
|
177
|
+
if (state === DiffState.enter && (this._isReentered = !0), this.spec.encode[state]) {
|
|
178
|
+
const lastEncoder = this.spec.encode[state];
|
|
179
|
+
isFunctionType(lastEncoder) ? this.detach(parseEncodeType(lastEncoder, this.view)) : isString(channel) ? this.detach(parseEncodeType(this.spec.encode[state][channel], this.view)) : Object.keys(channel).forEach((c => {
|
|
180
|
+
this.detach(parseEncodeType(this.spec.encode[state][c], this.view));
|
|
181
|
+
}));
|
|
182
|
+
} else this.spec.encode[state] = {};
|
|
183
|
+
return isString(channel) ? (this.spec.encode[state][channel] = value, this.attach(parseEncodeType(value, this.view))) : isFunctionType(channel) ? (this.spec.encode[state] = channel,
|
|
184
|
+
this.attach(parseEncodeType(channel, this.view))) : (Object.assign(this.spec.encode[state], channel),
|
|
185
|
+
channel && Object.values(channel).forEach((channelEncoder => {
|
|
186
|
+
this.attach(parseEncodeType(channelEncoder, this.view));
|
|
187
|
+
}))), this.commit(), this;
|
|
188
|
+
}
|
|
189
|
+
_getEncoders() {
|
|
190
|
+
var _a;
|
|
191
|
+
return null !== (_a = this.spec.encode) && void 0 !== _a ? _a : {};
|
|
192
|
+
}
|
|
193
|
+
animation(animationConfig) {
|
|
194
|
+
return this.spec.animation = animationConfig, this;
|
|
195
|
+
}
|
|
196
|
+
animationState(animationState) {
|
|
197
|
+
return this.setFunctionSpec(animationState, "animationState");
|
|
198
|
+
}
|
|
199
|
+
layout(layout) {
|
|
200
|
+
return this.spec.layout = layout, this.commit(), this;
|
|
201
|
+
}
|
|
202
|
+
morph(enableMorph, morphKey, morphElementKey) {
|
|
203
|
+
return this.spec.morph = enableMorph, this.spec.morphKey = morphKey, this.spec.morphElementKey = morphElementKey,
|
|
204
|
+
this;
|
|
205
|
+
}
|
|
206
|
+
transform(transforms) {
|
|
207
|
+
const prevTransforms = parseTransformSpec(this.spec.transform, this.view);
|
|
208
|
+
prevTransforms && (this.detach(prevTransforms.refs), this.transforms = []);
|
|
209
|
+
const nextTransforms = parseTransformSpec(transforms, this.view);
|
|
210
|
+
return nextTransforms && (this.attach(nextTransforms.refs), this.transforms = nextTransforms.transforms),
|
|
211
|
+
this.spec.transform = transforms, this.commit(), this;
|
|
212
|
+
}
|
|
213
|
+
configure(config) {
|
|
214
|
+
const keys = [ "clip", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms" ];
|
|
215
|
+
return null === config ? (keys.forEach((key => {
|
|
216
|
+
isNil(this.spec[key]) || (this.spec[key] = void 0);
|
|
217
|
+
})), this) : (keys.forEach((key => {
|
|
218
|
+
isNil(config[key]) || (this.spec[key] = config[key]);
|
|
219
|
+
})), this);
|
|
220
|
+
}
|
|
221
|
+
isCollectionMark() {
|
|
222
|
+
return CollectionMarkType.includes(this.markType);
|
|
223
|
+
}
|
|
224
|
+
needAnimate() {
|
|
225
|
+
var _a;
|
|
226
|
+
return !(null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) && !isNil(this.spec.animation);
|
|
227
|
+
}
|
|
228
|
+
getAllElements() {
|
|
229
|
+
const elements = this.elements.slice();
|
|
230
|
+
return this.elementMap.forEach((element => {
|
|
231
|
+
element.diffState !== DiffState.exit || elements.includes(element) || elements.push(element);
|
|
232
|
+
})), this.spec.sort && elements.sort(((elementA, elementB) => this.spec.sort(elementA.getDatum(), elementB.getDatum()))),
|
|
233
|
+
elements;
|
|
234
|
+
}
|
|
235
|
+
getScales() {
|
|
236
|
+
const scales = {};
|
|
237
|
+
return this.references.forEach(((count, ref) => {
|
|
238
|
+
ref.grammarType === GrammarTypeEnum.scale && (scales[ref.id()] = ref.output());
|
|
239
|
+
})), scales;
|
|
240
|
+
}
|
|
241
|
+
getScalesByChannel() {
|
|
242
|
+
const encoders = this.spec.encode;
|
|
243
|
+
if (!encoders) return {};
|
|
244
|
+
const res = {}, params = this.parameters();
|
|
245
|
+
return Object.keys(encoders).forEach((state => {
|
|
246
|
+
const useEncoders = encoders[state];
|
|
247
|
+
useEncoders && !isFunctionType(useEncoders) && Object.keys(useEncoders).forEach((channel => {
|
|
248
|
+
isScaleEncode(useEncoders[channel]) && (res[channel] = getGrammarOutput(useEncoders[channel].scale, params));
|
|
249
|
+
}));
|
|
250
|
+
})), res;
|
|
251
|
+
}
|
|
252
|
+
getFieldsByChannel() {
|
|
253
|
+
const encoders = this.spec.encode;
|
|
254
|
+
if (!encoders) return {};
|
|
255
|
+
const res = {};
|
|
256
|
+
return Object.keys(encoders).forEach((state => {
|
|
257
|
+
const useEncoders = encoders[state];
|
|
258
|
+
isFunctionType(useEncoders) || Object.keys(useEncoders).forEach((channel => {
|
|
259
|
+
isFieldEncode(useEncoders[channel]) && (res[channel] = useEncoders[channel].field);
|
|
260
|
+
}));
|
|
261
|
+
})), res;
|
|
262
|
+
}
|
|
263
|
+
init(stage, parameters) {
|
|
264
|
+
var _a, _b, _c, _d;
|
|
265
|
+
if (this._delegateEvent || (this._delegateEvent = (event, type) => {
|
|
266
|
+
var _a;
|
|
267
|
+
const activeElement = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey];
|
|
268
|
+
if ((null == activeElement ? void 0 : activeElement.mark) === this) {
|
|
269
|
+
const extendedEvt = getExtendedEvents(this.view, event, activeElement, type, EVENT_SOURCE_VIEW);
|
|
270
|
+
this.emitGrammarEvent(type, extendedEvt, activeElement);
|
|
271
|
+
}
|
|
272
|
+
}, this.initEvent()), this.animate || (this.animate = new Animate(this, this.spec.animation),
|
|
273
|
+
this.needAnimate() && this.animate.updateState(this.spec.animationState)), !this.group) {
|
|
274
|
+
const group = getGrammarOutput(this.spec.group, parameters);
|
|
275
|
+
this.group = group, group && (this.emit(HOOK_EVENT.BEFORE_ADD_VRENDER_MARK), group.appendChild(this),
|
|
276
|
+
this.emit(HOOK_EVENT.AFTER_ADD_VRENDER_MARK));
|
|
277
|
+
}
|
|
278
|
+
const groupGraphicItem = this.group ? this.group.getGroupGraphicItem() : stage.defaultLayer, markIndex = null !== (_c = null === (_b = null === (_a = this.group) || void 0 === _a ? void 0 : _a.children) || void 0 === _b ? void 0 : _b.indexOf(this)) && void 0 !== _c ? _c : 0;
|
|
279
|
+
if (this.markType !== GrammarMarkType.group) {
|
|
280
|
+
if (!this.graphicItem) {
|
|
281
|
+
const graphicItem = createGraphicItem(this, GrammarMarkType.group, {
|
|
282
|
+
pickable: !1,
|
|
283
|
+
zIndex: null !== (_d = this.spec.zIndex) && void 0 !== _d ? _d : 0
|
|
284
|
+
});
|
|
285
|
+
(this.spec.support3d || Mark3DType.includes(this.markType)) && graphicItem.setMode("3d"),
|
|
286
|
+
graphicItem.name = `${this.id() || this.markType}`, this.graphicItem = graphicItem;
|
|
287
|
+
}
|
|
288
|
+
this.graphicParent = this.graphicItem, !groupGraphicItem || this.graphicIndex === markIndex && this.graphicItem.parent === groupGraphicItem || groupGraphicItem.insertIntoKeepIdx(this.graphicItem, markIndex);
|
|
289
|
+
} else this.graphicParent = groupGraphicItem;
|
|
290
|
+
this.graphicIndex = markIndex;
|
|
291
|
+
}
|
|
292
|
+
update(spec) {
|
|
293
|
+
this.context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation),
|
|
294
|
+
this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group ? (isNil(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex),
|
|
295
|
+
isNil(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), this.elementMap.forEach((element => {
|
|
296
|
+
element.updateGraphicItem({
|
|
297
|
+
interactive: spec.interactive
|
|
298
|
+
});
|
|
299
|
+
}))) : this.elementMap.forEach((element => {
|
|
300
|
+
element.updateGraphicItem({
|
|
301
|
+
clip: spec.clip,
|
|
302
|
+
zIndex: spec.zIndex,
|
|
303
|
+
interactive: spec.interactive
|
|
304
|
+
});
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
evaluateJoin(data) {
|
|
308
|
+
var _a, _b, _c, _d;
|
|
309
|
+
this.needClear = !0;
|
|
310
|
+
const keyGetter = parseField(null !== (_c = null !== (_a = this.spec.key) && void 0 !== _a ? _a : null === (_b = this.grammarSource) || void 0 === _b ? void 0 : _b.getDataIDKey()) && void 0 !== _c ? _c : () => DefaultKey), groupKeyGetter = parseField(null !== (_d = this.spec.groupBy) && void 0 !== _d ? _d : () => DefaultKey), sort = this.spec.sort, isCollectionMark = this.isCollectionMark(), enterElements = new Set(this.elements.filter((element => element.diffState === DiffState.enter))), elements = [];
|
|
311
|
+
this.differ.setCallback(((key, data, prevData) => {
|
|
312
|
+
const elementKey = key;
|
|
313
|
+
let element;
|
|
314
|
+
if (isNil(data)) element = this.elementMap.get(elementKey), element && (element.diffState = DiffState.exit); else if (isNil(prevData)) {
|
|
315
|
+
if (element = this.elementMap.has(elementKey) ? this.elementMap.get(elementKey) : createElement(this),
|
|
316
|
+
element.diffState === DiffState.exit) {
|
|
317
|
+
element.diffState = DiffState.enter;
|
|
318
|
+
this.animate.getElementAnimators(element, DiffState.exit).forEach((animator => animator.stop("start")));
|
|
319
|
+
}
|
|
320
|
+
element.diffState = DiffState.enter;
|
|
321
|
+
const groupKey = isCollectionMark ? key : groupKeyGetter(data[0]);
|
|
322
|
+
element.updateData(groupKey, data, keyGetter, this.view), this.elementMap.set(elementKey, element),
|
|
323
|
+
elements.push(element);
|
|
324
|
+
} else if (element = this.elementMap.get(elementKey), element) {
|
|
325
|
+
element.diffState = DiffState.update;
|
|
326
|
+
const groupKey = isCollectionMark ? key : groupKeyGetter(data[0]);
|
|
327
|
+
element.updateData(groupKey, data, keyGetter, this.view), elements.push(element);
|
|
328
|
+
}
|
|
329
|
+
enterElements.delete(element);
|
|
330
|
+
}));
|
|
331
|
+
const currentData = null != data ? data : DefaultMarkData;
|
|
332
|
+
isCollectionMark || this.differ.setCurrentData(groupData(currentData, (datum => `${groupKeyGetter(datum)}-${keyGetter(datum)}`), void 0)),
|
|
333
|
+
this.differ.doDiff(), enterElements.forEach((element => {
|
|
334
|
+
this.elementMap.delete(isCollectionMark ? element.groupKey : `${element.groupKey}-${element.key}`),
|
|
335
|
+
element.remove(), element.release();
|
|
336
|
+
})), this.elements = elements, sort && this.elements.sort(((elementA, elementB) => sort(elementA.getDatum(), elementB.getDatum())));
|
|
337
|
+
}
|
|
338
|
+
evaluateState(elements, stateSpec, parameters) {
|
|
339
|
+
stateSpec && elements.forEach((element => {
|
|
340
|
+
element.state(stateSpec, parameters);
|
|
341
|
+
}));
|
|
342
|
+
}
|
|
343
|
+
evaluateGroupEncode(elements, groupEncode, parameters) {
|
|
344
|
+
var _a;
|
|
345
|
+
if (this.markType === GrammarMarkType.group) {
|
|
346
|
+
const el = this.elements[0], nextAttrs = {}, items = [ Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
|
|
347
|
+
nextAttrs: nextAttrs
|
|
348
|
+
}) ];
|
|
349
|
+
return invokeEncoderToItems(el, items, groupEncode, parameters), nextAttrs;
|
|
350
|
+
}
|
|
351
|
+
if (!this._groupKeys || !groupEncode) return;
|
|
352
|
+
const res = {};
|
|
353
|
+
return this._groupKeys.forEach((key => {
|
|
354
|
+
var _a;
|
|
355
|
+
const el = elements.find((el => el.groupKey === key));
|
|
356
|
+
if (!el) return;
|
|
357
|
+
const nextAttrs = {}, items = [ Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
|
|
358
|
+
nextAttrs: nextAttrs
|
|
359
|
+
}) ];
|
|
360
|
+
invokeEncoderToItems(el, items, groupEncode, parameters), res[key] = nextAttrs;
|
|
361
|
+
})), res;
|
|
362
|
+
}
|
|
363
|
+
evaluateEncode(elements, encoders, parameters) {
|
|
364
|
+
if (encoders) {
|
|
365
|
+
this.emit(HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
|
|
366
|
+
encoders: encoders,
|
|
367
|
+
parameters: parameters
|
|
368
|
+
}, this);
|
|
369
|
+
const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
370
|
+
elements.forEach((element => {
|
|
371
|
+
this.markType === GrammarMarkType.group && groupEncodeAttrs ? element.items.forEach((item => {
|
|
372
|
+
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs);
|
|
373
|
+
})) : (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && !this.isCollectionMark() && element.items.forEach((item => {
|
|
374
|
+
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
|
|
375
|
+
})), element.encodeItems(element.items, encoders, this._isReentered, parameters);
|
|
376
|
+
})), this._isReentered = !1, this.evaluateTransformSync(this._getTransformsAfterEncodeItems(), elements, parameters),
|
|
377
|
+
elements.forEach((element => {
|
|
378
|
+
element.encodeGraphic(this.isCollectionMark() ? null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey] : null);
|
|
379
|
+
})), this.emit(HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
|
|
380
|
+
encoders: encoders,
|
|
381
|
+
parameters: parameters
|
|
382
|
+
}, this);
|
|
383
|
+
} else elements.forEach((element => {
|
|
384
|
+
element.initGraphicItem();
|
|
385
|
+
}));
|
|
386
|
+
}
|
|
387
|
+
addGraphicItem(attrs, groupKey, newGraphicItem) {
|
|
388
|
+
var _a;
|
|
389
|
+
const graphicItem = null != newGraphicItem ? newGraphicItem : createGraphicItem(this, this.markType, attrs);
|
|
390
|
+
if (this.emit(HOOK_EVENT.BEFORE_ADD_VRENDER_MARK), this.markType === GrammarMarkType.group) graphicItem.name = `${this.id() || this.markType}`,
|
|
391
|
+
this.graphicParent.insertIntoKeepIdx(graphicItem, this.graphicIndex); else if (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) {
|
|
392
|
+
let group;
|
|
393
|
+
if (this._groupKeys) {
|
|
394
|
+
const index = this._groupKeys.indexOf(groupKey);
|
|
395
|
+
index >= 0 && (group = this.graphicParent.getChildAt(index));
|
|
396
|
+
} else group = this.graphicParent.at(0);
|
|
397
|
+
this.isCollectionMark() ? (graphicItem.incremental = 1, group.appendChild(graphicItem)) : group.incrementalAppendChild(graphicItem);
|
|
398
|
+
} else this.graphicParent.appendChild(graphicItem);
|
|
399
|
+
return this.emit(HOOK_EVENT.AFTER_ADD_VRENDER_MARK), graphicItem;
|
|
400
|
+
}
|
|
401
|
+
parseRenderContext(data, parameters) {
|
|
402
|
+
const enableProgressive = this.markType !== GrammarMarkType.group && this.spec.progressiveStep > 0 && this.spec.progressiveThreshold > 0 && this.spec.progressiveStep < this.spec.progressiveThreshold, large = this.spec.large && this.spec.largeThreshold > 0 && data.length >= this.spec.largeThreshold;
|
|
403
|
+
if (enableProgressive) {
|
|
404
|
+
const groupedData = this.differ.getCurrentData();
|
|
405
|
+
return groupedData && groupedData.keys && groupedData.keys.some((key => groupedData.data.get(key).length > this.spec.progressiveThreshold)) ? {
|
|
406
|
+
large: large,
|
|
407
|
+
parameters: parameters,
|
|
408
|
+
progressive: {
|
|
409
|
+
data: data,
|
|
410
|
+
step: this.spec.progressiveStep,
|
|
411
|
+
currentIndex: 0,
|
|
412
|
+
totalStep: groupedData.keys.reduce(((total, key) => Math.max(Math.ceil(groupedData.data.get(key).length / this.spec.progressiveStep), total)), 1),
|
|
413
|
+
groupedData: groupedData.data
|
|
414
|
+
}
|
|
415
|
+
} : {
|
|
416
|
+
large: large
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
return {
|
|
420
|
+
large: large
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
isProgressive() {
|
|
424
|
+
return this.renderContext && (!!this.renderContext.progressive || !!this.renderContext.beforeTransformProgressive);
|
|
425
|
+
}
|
|
426
|
+
isDoingProgressive() {
|
|
427
|
+
return this.renderContext && (this.renderContext.progressive && this.renderContext.progressive.currentIndex < this.renderContext.progressive.totalStep || this.renderContext.beforeTransformProgressive && this.renderContext.beforeTransformProgressive.unfinished());
|
|
428
|
+
}
|
|
429
|
+
clearProgressive() {
|
|
430
|
+
var _a, _b;
|
|
431
|
+
(null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) && (this.elements = [],
|
|
432
|
+
this.graphicParent.children.forEach((group => {
|
|
433
|
+
group.incrementalClearChild();
|
|
434
|
+
})), this.graphicParent.removeAllChild()), (null === (_b = this.renderContext) || void 0 === _b ? void 0 : _b.beforeTransformProgressive) && this.renderContext.beforeTransformProgressive.release(),
|
|
435
|
+
this.renderContext = null;
|
|
436
|
+
}
|
|
437
|
+
restartProgressive() {
|
|
438
|
+
var _a;
|
|
439
|
+
(null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) && (this.renderContext.progressive.currentIndex = 0);
|
|
440
|
+
}
|
|
441
|
+
evaluateJoinProgressive() {
|
|
442
|
+
var _a, _b, _c;
|
|
443
|
+
const currentIndex = this.renderContext.progressive.currentIndex, keyGetter = parseField(null !== (_c = null !== (_a = this.spec.key) && void 0 !== _a ? _a : null === (_b = this.grammarSource) || void 0 === _b ? void 0 : _b.getDataIDKey()) && void 0 !== _c ? _c : () => DefaultKey), elements = [];
|
|
444
|
+
if (this.isCollectionMark()) return this._groupKeys.forEach(((key, index) => {
|
|
445
|
+
const data = this.renderContext.progressive.groupedData.get(key), groupStep = this.renderContext.progressive.step, dataSlice = data.slice(currentIndex * groupStep, (currentIndex + 1) * groupStep);
|
|
446
|
+
if (0 === currentIndex) {
|
|
447
|
+
const element = createElement(this);
|
|
448
|
+
element.diffState = DiffState.enter, element.updateData(key, dataSlice, keyGetter, this.view),
|
|
449
|
+
elements.push(element);
|
|
450
|
+
} else {
|
|
451
|
+
const element = this.elements[index];
|
|
452
|
+
element.updateData(key, dataSlice, keyGetter, this.view), elements.push(element);
|
|
453
|
+
}
|
|
454
|
+
})), elements;
|
|
455
|
+
const groupElements = {};
|
|
456
|
+
return this._groupKeys.forEach((key => {
|
|
457
|
+
const data = this.renderContext.progressive.groupedData.get(key), groupStep = this.renderContext.progressive.step, dataSlice = data.slice(currentIndex * groupStep, (currentIndex + 1) * groupStep), group = [];
|
|
458
|
+
dataSlice.forEach((entry => {
|
|
459
|
+
const element = createElement(this);
|
|
460
|
+
element.diffState = DiffState.enter, element.updateData(key, [ entry ], keyGetter, this.view),
|
|
461
|
+
group.push(element), elements.push(element);
|
|
462
|
+
})), groupElements[key] = group;
|
|
463
|
+
})), {
|
|
464
|
+
groupElements: groupElements,
|
|
465
|
+
elements: elements
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
evaluateEncodeProgressive(elements, encoders, parameters) {
|
|
469
|
+
if (!encoders) return void elements.forEach((element => {
|
|
470
|
+
element.initGraphicItem();
|
|
471
|
+
}));
|
|
472
|
+
const positionEncoders = Object.keys(encoders).reduce(((res, state) => (!encoders[state] || state !== BuiltInEncodeNames.enter && state !== BuiltInEncodeNames.exit && state !== BuiltInEncodeNames.update || (res[state] = splitEncoderInLarge(this.markType, encoders[state], this.glyphType).positionEncoder),
|
|
473
|
+
res)), {}), progressiveIndex = this.renderContext.progressive.currentIndex, isCollection = this.isCollectionMark();
|
|
474
|
+
this.emit(HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
|
|
475
|
+
encoders: encoders,
|
|
476
|
+
parameters: parameters
|
|
477
|
+
}, this);
|
|
478
|
+
const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
479
|
+
if (elements.forEach(((element, index) => {
|
|
480
|
+
const onlyPos = progressiveIndex > 0 || !isCollection && index > 0;
|
|
481
|
+
!onlyPos && (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && element.items.forEach((item => {
|
|
482
|
+
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
|
|
483
|
+
})), element.encodeItems(element.items, onlyPos ? positionEncoders : encoders, this._isReentered, parameters);
|
|
484
|
+
})), this._isReentered = !1, this.evaluateTransformSync(this._getTransformsAfterEncodeItems(), elements, parameters),
|
|
485
|
+
elements.forEach((element => {
|
|
486
|
+
element.encodeGraphic();
|
|
487
|
+
})), this.emit(HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
|
|
488
|
+
encoders: encoders,
|
|
489
|
+
parameters: parameters
|
|
490
|
+
}, this), 0 === progressiveIndex && !isCollection) {
|
|
491
|
+
const firstChild = elements[0].getGraphicItem(), group = null == firstChild ? void 0 : firstChild.parent;
|
|
492
|
+
if (group) {
|
|
493
|
+
const attrs = firstChild.attribute, theme = {}, itemAttrs = {};
|
|
494
|
+
Object.keys(attrs).forEach((key => {
|
|
495
|
+
[ "pickable", "zIndex" ].includes(key) || (isPositionOrSizeChannel(this.markType, key) ? itemAttrs[key] = attrs[key] : theme[key] = attrs[key]);
|
|
496
|
+
})), group.setTheme({
|
|
497
|
+
common: theme
|
|
498
|
+
}), firstChild.initAttributes(itemAttrs);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
evaluateProgressive() {
|
|
503
|
+
var _a, _b, _c;
|
|
504
|
+
if (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.beforeTransformProgressive) {
|
|
505
|
+
this.renderContext.beforeTransformProgressive.progressiveRun();
|
|
506
|
+
const output = this.renderContext.beforeTransformProgressive.output();
|
|
507
|
+
return this.emit(HOOK_EVENT.BEFORE_MARK_JOIN), this.evaluateJoin(output), this.emit(HOOK_EVENT.AFTER_MARK_JOIN),
|
|
508
|
+
this.emit(HOOK_EVENT.BEFORE_MARK_STATE), this.evaluateState(this.elements, this.spec.state, this.renderContext.parameters),
|
|
509
|
+
this.emit(HOOK_EVENT.AFTER_MARK_STATE), this.emit(HOOK_EVENT.BEFORE_MARK_ENCODE),
|
|
510
|
+
this.evaluateEncode(this.elements, this._getEncoders(), this.renderContext.parameters),
|
|
511
|
+
void this.emit(HOOK_EVENT.AFTER_MARK_ENCODE);
|
|
512
|
+
}
|
|
513
|
+
if (!(null === (_b = this.renderContext) || void 0 === _b ? void 0 : _b.progressive)) return;
|
|
514
|
+
const parameters = this.renderContext.parameters;
|
|
515
|
+
this.emit(HOOK_EVENT.BEFORE_MARK_JOIN);
|
|
516
|
+
const result = this.evaluateJoinProgressive(), elements = Array.isArray(result) ? result : result.elements;
|
|
517
|
+
if (this.emit(HOOK_EVENT.AFTER_MARK_JOIN), 0 === this.renderContext.progressive.currentIndex ? (this.graphicParent.removeAllChild(),
|
|
518
|
+
this._groupKeys.forEach((key => {
|
|
519
|
+
const graphicItem = createGraphicItem(this, GrammarMarkType.group, {
|
|
520
|
+
pickable: !1,
|
|
521
|
+
zIndex: this.spec.zIndex
|
|
522
|
+
});
|
|
523
|
+
graphicItem.incremental = this.renderContext.progressive.step, this.graphicParent.appendChild(graphicItem);
|
|
524
|
+
})), this.elements = elements) : this.elements = this.elements.concat(elements),
|
|
525
|
+
this.emit(HOOK_EVENT.BEFORE_MARK_STATE), this.evaluateState(elements, this.spec.state, parameters),
|
|
526
|
+
this.emit(HOOK_EVENT.AFTER_MARK_STATE), this.emit(HOOK_EVENT.BEFORE_MARK_ENCODE),
|
|
527
|
+
Array.isArray(result)) this.evaluateEncodeProgressive(elements, this._getEncoders(), parameters); else {
|
|
528
|
+
const groupElements = result.groupElements;
|
|
529
|
+
Object.keys(groupElements).forEach((key => {
|
|
530
|
+
this.evaluateEncodeProgressive(groupElements[key], this._getEncoders(), parameters);
|
|
531
|
+
}));
|
|
532
|
+
}
|
|
533
|
+
this.emit(HOOK_EVENT.AFTER_MARK_ENCODE);
|
|
534
|
+
const progressiveTransforms = null === (_c = this._getTransformsAfterEncode()) || void 0 === _c ? void 0 : _c.filter((entry => !0 === entry.canProgressive));
|
|
535
|
+
(null == progressiveTransforms ? void 0 : progressiveTransforms.length) && this.evaluateTransformSync(progressiveTransforms, this.elements, parameters),
|
|
536
|
+
this.renderContext.progressive.currentIndex += 1;
|
|
537
|
+
}
|
|
538
|
+
isLargeMode() {
|
|
539
|
+
return this.renderContext && this.renderContext.large;
|
|
540
|
+
}
|
|
541
|
+
cleanExitElements() {
|
|
542
|
+
this.elementMap.forEach(((element, key) => {
|
|
543
|
+
element.diffState !== DiffState.exit || element.isReserved || (this.elementMap.delete(key),
|
|
544
|
+
element.remove(), element.release());
|
|
545
|
+
}));
|
|
546
|
+
}
|
|
547
|
+
getGroupGraphicItem() {
|
|
548
|
+
var _a, _b, _c;
|
|
549
|
+
return null === (_c = null === (_b = null === (_a = this.elements) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b.getGraphicItem) || void 0 === _c ? void 0 : _c.call(_b);
|
|
550
|
+
}
|
|
551
|
+
getBounds() {
|
|
552
|
+
var _a, _b, _c, _d;
|
|
553
|
+
return this.graphicItem ? this.graphicItem.AABBBounds : null === (_d = null === (_c = null === (_b = null === (_a = this.elements) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b.getGraphicItem) || void 0 === _c ? void 0 : _c.call(_b)) || void 0 === _d ? void 0 : _d.AABBBounds;
|
|
554
|
+
}
|
|
555
|
+
getMorphConfig() {
|
|
556
|
+
var _a;
|
|
557
|
+
return {
|
|
558
|
+
morph: null !== (_a = this.spec.morph) && void 0 !== _a && _a,
|
|
559
|
+
morphKey: this.spec.morphKey,
|
|
560
|
+
morphElementKey: this.spec.morphElementKey
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
getAttributeTransforms() {
|
|
564
|
+
var _a;
|
|
565
|
+
return null !== (_a = this.spec.attributeTransforms) && void 0 !== _a ? _a : transformsByType[this.markType];
|
|
566
|
+
}
|
|
567
|
+
needSkipBeforeLayout() {
|
|
568
|
+
var _a, _b;
|
|
569
|
+
if (!0 === (null === (_a = this.spec.layout) || void 0 === _a ? void 0 : _a.skipBeforeLayouted)) return !0;
|
|
570
|
+
let group = this.group;
|
|
571
|
+
for (;group; ) {
|
|
572
|
+
if (!0 === (null === (_b = group.getSpec().layout) || void 0 === _b ? void 0 : _b.skipBeforeLayouted)) return !0;
|
|
573
|
+
group = group.group;
|
|
574
|
+
}
|
|
575
|
+
return !1;
|
|
576
|
+
}
|
|
577
|
+
initEvent() {
|
|
578
|
+
if (this._delegateEvent) {
|
|
579
|
+
this.view.renderer.stage().on("*", this._delegateEvent);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
releaseEvent() {
|
|
583
|
+
if (this._delegateEvent) {
|
|
584
|
+
const stage = this.view.renderer.stage();
|
|
585
|
+
stage && stage.off("*", this._delegateEvent);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
clear() {
|
|
589
|
+
var _a;
|
|
590
|
+
super.clear(), this.transforms = null, this.elementMap = null, this.elements = null,
|
|
591
|
+
this.graphicItem = null, this.animate = null, null === (_a = this.group) || void 0 === _a || _a.removeChild(this),
|
|
592
|
+
this.group = null;
|
|
593
|
+
}
|
|
594
|
+
prepareRelease() {
|
|
595
|
+
this.animate.stop(), this.elementMap.forEach((element => element.diffState = DiffState.exit)),
|
|
596
|
+
this._finalParameters = this.parameters();
|
|
597
|
+
}
|
|
598
|
+
release() {
|
|
599
|
+
this.releaseEvent(), this.elements.forEach((element => element.release())), this.elementMap.clear(),
|
|
600
|
+
this._finalParameters = null, this.animate && this.animate.release(), this.graphicItem && removeGraphicItem(this.graphicItem),
|
|
601
|
+
this.detachAll(), super.release();
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
//# sourceMappingURL=mark.js.map
|