@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
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.registerTooltip = exports.DimensionTooltip = exports.Tooltip = exports.BaseTooltip = exports.generateTooltipAttributes = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), vrender_components_1 = require("@visactor/vrender-components"), vgrammar_util_1 = require("@visactor/vgrammar-util"), graph_1 = require("../graph"), component_1 = require("../view/component"), encode_1 = require("../graph/mark/encode"), util_1 = require("../parse/util"), mark_1 = require("../parse/mark"), constants_1 = require("../graph/constants"), factory_1 = require("../core/factory"), generateTooltipAttributes = (point, title, content, bounds, theme, addition) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const tooltipTheme = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.tooltip;
|
|
10
|
+
return (0, vutils_1.merge)({}, tooltipTheme, {
|
|
11
|
+
visible: !0,
|
|
12
|
+
pointerX: point.x,
|
|
13
|
+
pointerY: point.y,
|
|
14
|
+
title: title,
|
|
15
|
+
content: content,
|
|
16
|
+
parentBounds: bounds
|
|
17
|
+
}, null != addition ? addition : {});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.generateTooltipAttributes = generateTooltipAttributes;
|
|
21
|
+
|
|
22
|
+
class BaseTooltip extends component_1.Component {
|
|
23
|
+
parseAddition(spec) {
|
|
24
|
+
return super.parseAddition(spec), this.title(spec.title), this.content(spec.content),
|
|
25
|
+
this;
|
|
26
|
+
}
|
|
27
|
+
title(title) {
|
|
28
|
+
return !this.spec.title || (0, vutils_1.isString)(this.spec.title) || (0, vutils_1.isFunction)(this.spec.title) || this.detach(this._parseTooltipRow(this.spec.title)),
|
|
29
|
+
this.spec.title = title, !title || (0, vutils_1.isString)(title) || (0, vutils_1.isFunction)(title) || this.attach(this._parseTooltipRow(title)),
|
|
30
|
+
this.commit(), this;
|
|
31
|
+
}
|
|
32
|
+
content(content) {
|
|
33
|
+
return this.spec.content && !(0, vutils_1.isFunction)(this.spec.content) && this.detach(this._parseTooltipRow(this.spec.content)),
|
|
34
|
+
this.spec.content = content, content && !(0, vutils_1.isFunction)(content) && this.attach(this._parseTooltipRow(content)),
|
|
35
|
+
this.commit(), this;
|
|
36
|
+
}
|
|
37
|
+
configureComponent(config) {
|
|
38
|
+
return super.configureComponent(config), this;
|
|
39
|
+
}
|
|
40
|
+
_updateComponentEncoders() {
|
|
41
|
+
const encoders = Object.assign({
|
|
42
|
+
update: {}
|
|
43
|
+
}, this.spec.encode), componentEncoders = Object.keys(encoders).reduce(((res, state) => {
|
|
44
|
+
const encoder = encoders[state];
|
|
45
|
+
return encoder && (res[state] = {
|
|
46
|
+
callback: (datum, element, parameters) => {
|
|
47
|
+
this._additionalEncodeResult = (0, encode_1.invokeEncoder)(encoder, datum, element, parameters);
|
|
48
|
+
}
|
|
49
|
+
}), res;
|
|
50
|
+
}), {});
|
|
51
|
+
this._encoders = componentEncoders;
|
|
52
|
+
}
|
|
53
|
+
_parseTooltipRow(tooltipRow) {
|
|
54
|
+
return (0, vutils_1.array)(tooltipRow).reduce(((dependencies, row) => (dependencies = dependencies.concat((0,
|
|
55
|
+
util_1.parseFunctionType)(row.visible, this.view)), (0, mark_1.isFieldEncode)(row.key) || (dependencies = dependencies.concat((0,
|
|
56
|
+
util_1.parseFunctionType)(row.key, this.view))), (0, mark_1.isFieldEncode)(row.value) || (dependencies = dependencies.concat((0,
|
|
57
|
+
util_1.parseFunctionType)(row.value, this.view))), (0, mark_1.isFieldEncode)(row.symbol) || (dependencies = dependencies.concat((0,
|
|
58
|
+
util_1.parseFunctionType)(row.symbol, this.view))), dependencies)), []);
|
|
59
|
+
}
|
|
60
|
+
_computeTooltipRow(row, datum, parameters) {
|
|
61
|
+
const element = this.elements[0];
|
|
62
|
+
let key, value, symbol, visible = (0, util_1.invokeFunctionType)(row.visible, parameters, datum, element);
|
|
63
|
+
if (visible = !!(0, vutils_1.isNil)(visible) || !!visible, (0, mark_1.isFieldEncode)(row.key)) {
|
|
64
|
+
key = (0, vgrammar_util_1.field)(row.key.field)(datum);
|
|
65
|
+
} else key = (0, util_1.invokeFunctionType)(row.key, parameters, datum, element);
|
|
66
|
+
if (key = (0, vutils_1.isNil)(key) ? void 0 : (0, vutils_1.isObjectLike)(key) ? key : {
|
|
67
|
+
text: key
|
|
68
|
+
}, (0, mark_1.isFieldEncode)(row.value)) {
|
|
69
|
+
value = (0, vgrammar_util_1.field)(row.value.field)(datum);
|
|
70
|
+
} else value = (0, util_1.invokeFunctionType)(row.value, parameters, datum, element);
|
|
71
|
+
if (value = (0, vutils_1.isNil)(value) ? void 0 : (0, vutils_1.isObjectLike)(value) ? value : {
|
|
72
|
+
text: value
|
|
73
|
+
}, (0, mark_1.isFieldEncode)(row.symbol)) {
|
|
74
|
+
symbol = (0, vgrammar_util_1.field)(row.symbol.field)(datum);
|
|
75
|
+
} else symbol = (0, util_1.invokeFunctionType)(row.symbol, parameters, datum, element);
|
|
76
|
+
return symbol = (0, vutils_1.isNil)(symbol) ? void 0 : (0, vutils_1.isObjectLike)(symbol) ? symbol : {
|
|
77
|
+
symbolType: symbol
|
|
78
|
+
}, {
|
|
79
|
+
visible: visible,
|
|
80
|
+
key: key,
|
|
81
|
+
value: value,
|
|
82
|
+
shape: symbol
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
_computeTitleContent(datum) {
|
|
86
|
+
const tooltip = this.elements[0], parameters = this.parameters(), title = (0, vutils_1.isValid)(this.spec.title) ? (0,
|
|
87
|
+
vutils_1.isFunction)(this.spec.title) ? this.spec.title.call(null, datum, tooltip, parameters) : this._computeTooltipRow((0,
|
|
88
|
+
vutils_1.isString)(this.spec.title) ? {
|
|
89
|
+
value: this.spec.title
|
|
90
|
+
} : this.spec.title, datum, parameters) : void 0, content = (0, vutils_1.isValid)(this.spec.content) ? (0,
|
|
91
|
+
vutils_1.isFunction)(this.spec.content) ? (0, vutils_1.array)(this.spec.content.call(null, datum, tooltip, parameters)) : (0,
|
|
92
|
+
vutils_1.array)(datum).reduce(((content, datumRow) => content.concat((0, vutils_1.array)(this.spec.content).map((row => this._computeTooltipRow(row, datumRow, parameters))))), []) : void 0;
|
|
93
|
+
return {
|
|
94
|
+
title: (0, vutils_1.isArray)(title) ? title[0] : title,
|
|
95
|
+
content: content
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
exports.BaseTooltip = BaseTooltip, BaseTooltip.componentType = graph_1.ComponentEnum.tooltip;
|
|
101
|
+
|
|
102
|
+
class Tooltip extends BaseTooltip {
|
|
103
|
+
constructor(view, group) {
|
|
104
|
+
super(view, graph_1.ComponentEnum.tooltip, group), this._targetMarks = [], this._onTooltipShow = (0,
|
|
105
|
+
vutils_1.throttle)(((event, element) => {
|
|
106
|
+
const tooltip = this.elements[0].getGraphicItem();
|
|
107
|
+
if (!this._targetMarks.includes(null == element ? void 0 : element.mark)) return void tooltip.hideAll();
|
|
108
|
+
tooltip.showAll();
|
|
109
|
+
const groupGraphicItem = this.group.getGroupGraphicItem(), point = {
|
|
110
|
+
x: 0,
|
|
111
|
+
y: 0
|
|
112
|
+
};
|
|
113
|
+
if (groupGraphicItem.globalTransMatrix.transformPoint(event.canvas, point), element === this._lastElement) return void tooltip.setAttributes({
|
|
114
|
+
pointerX: point.x,
|
|
115
|
+
pointerY: point.y
|
|
116
|
+
});
|
|
117
|
+
const boundsStart = {
|
|
118
|
+
x: 0,
|
|
119
|
+
y: 0
|
|
120
|
+
};
|
|
121
|
+
groupGraphicItem.globalTransMatrix.transformPoint({
|
|
122
|
+
x: 0,
|
|
123
|
+
y: 0
|
|
124
|
+
}, boundsStart);
|
|
125
|
+
const boundsEnd = {
|
|
126
|
+
x: 0,
|
|
127
|
+
y: 0
|
|
128
|
+
};
|
|
129
|
+
groupGraphicItem.globalTransMatrix.transformPoint({
|
|
130
|
+
x: this.view.getSignalById("width").getValue(),
|
|
131
|
+
y: this.view.getSignalById("height").getValue()
|
|
132
|
+
}, boundsEnd);
|
|
133
|
+
const bounds = (new vutils_1.AABBBounds).set(boundsStart.x, boundsStart.y, boundsEnd.x, boundsEnd.y), {title: title, content: content} = this._computeTitleContent(element.getDatum()), theme = this.view.getCurrentTheme(), attributes = (0,
|
|
134
|
+
exports.generateTooltipAttributes)(point, title, content, bounds, theme, this._additionalEncodeResult);
|
|
135
|
+
tooltip.setAttributes(attributes);
|
|
136
|
+
}), 10), this._onTooltipHide = event => {
|
|
137
|
+
this.elements[0].getGraphicItem().hideAll();
|
|
138
|
+
}, this.spec.componentType = graph_1.ComponentEnum.tooltip;
|
|
139
|
+
}
|
|
140
|
+
parseAddition(spec) {
|
|
141
|
+
return super.parseAddition(spec), this.target(spec.target), this;
|
|
142
|
+
}
|
|
143
|
+
target(mark) {
|
|
144
|
+
if (this.spec.target) {
|
|
145
|
+
const prevMarks = (0, vutils_1.array)(this.spec.target).map((m => (0, vutils_1.isString)(m) ? this.view.getMarkById(m) : m));
|
|
146
|
+
this.detach(prevMarks);
|
|
147
|
+
}
|
|
148
|
+
this.spec.target = mark;
|
|
149
|
+
const nextMarks = (0, vutils_1.array)(mark).map((m => (0, vutils_1.isString)(m) ? this.view.getMarkById(m) : m));
|
|
150
|
+
return this.attach(nextMarks), this._targetMarks = nextMarks.filter((m => !(0, vutils_1.isNil)(m))),
|
|
151
|
+
this.commit(), this;
|
|
152
|
+
}
|
|
153
|
+
release() {
|
|
154
|
+
this.view.removeEventListener("pointermove", this._onTooltipShow), this.view.removeEventListener("pointerleave", this._onTooltipHide),
|
|
155
|
+
super.release();
|
|
156
|
+
}
|
|
157
|
+
init(stage, parameters) {
|
|
158
|
+
super.init(stage, parameters), this.view.addEventListener("pointermove", this._onTooltipShow),
|
|
159
|
+
this.view.addEventListener("pointerleave", this._onTooltipHide);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
exports.Tooltip = Tooltip;
|
|
164
|
+
|
|
165
|
+
const isEqualTooltipDatum = (current, previous) => {
|
|
166
|
+
const currentDatum = (0, vutils_1.array)(current), previousDatum = (0, vutils_1.array)(previous);
|
|
167
|
+
return currentDatum.length === previousDatum.length && (currentDatum.every((datum => previousDatum.includes(datum))) && previousDatum.every((datum => currentDatum.includes(datum))));
|
|
168
|
+
}, computeTooltipFilterValue = (point, scale, type, groupSize, config) => {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
if ("x" === type) return scale.invert(point.x);
|
|
171
|
+
if ("y" === type) return scale.invert(point.y);
|
|
172
|
+
if ("radius" === type) {
|
|
173
|
+
const center = null !== (_a = null == config ? void 0 : config.center) && void 0 !== _a ? _a : {
|
|
174
|
+
x: groupSize.width / 2,
|
|
175
|
+
y: groupSize.height / 2
|
|
176
|
+
}, radius = Math.sqrt((center.x - point.x) ** 2 + (center.y - point.y) ** 2);
|
|
177
|
+
return scale.invert(radius);
|
|
178
|
+
}
|
|
179
|
+
if ("angle" === type) {
|
|
180
|
+
const center = null !== (_b = null == config ? void 0 : config.center) && void 0 !== _b ? _b : {
|
|
181
|
+
x: groupSize.width / 2,
|
|
182
|
+
y: groupSize.height / 2
|
|
183
|
+
}, angle = (0, vutils_1.getAngleByPoint)(center, point);
|
|
184
|
+
return scale.invert(angle);
|
|
185
|
+
}
|
|
186
|
+
return scale.invert(point.x);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
class DimensionTooltip extends BaseTooltip {
|
|
190
|
+
constructor(view, group) {
|
|
191
|
+
super(view, graph_1.ComponentEnum.dimensionTooltip, group), this._avoidMarks = [],
|
|
192
|
+
this._tooltipDataFilter = null, this._onTooltipShow = (0, vutils_1.throttle)(((event, element) => {
|
|
193
|
+
var _a, _b, _c;
|
|
194
|
+
const tooltip = this.elements[0].getGraphicItem(), scale = ((0, vutils_1.isString)(this.spec.scale) ? this.view.getScaleById(this.spec.scale) : this.spec.scale).getScale(), groupGraphicItem = this.group.getGroupGraphicItem(), point = {
|
|
195
|
+
x: 0,
|
|
196
|
+
y: 0
|
|
197
|
+
};
|
|
198
|
+
groupGraphicItem.globalTransMatrix.transformPoint(event.canvas, point);
|
|
199
|
+
const groupSize = {
|
|
200
|
+
width: groupGraphicItem.attribute.width,
|
|
201
|
+
height: groupGraphicItem.attribute.height
|
|
202
|
+
};
|
|
203
|
+
if (point.x < 0 || point.x > groupGraphicItem.attribute.width || point.y < 0 || point.y > groupGraphicItem.attribute.height) return void tooltip.hideAll();
|
|
204
|
+
const eventTargetMark = null === (_b = null === (_a = event.target) || void 0 === _a ? void 0 : _a[constants_1.BridgeElementKey]) || void 0 === _b ? void 0 : _b.mark;
|
|
205
|
+
if (this._avoidMarks.includes(eventTargetMark)) return void tooltip.hideAll();
|
|
206
|
+
const target = null === (_c = this.spec.target) || void 0 === _c ? void 0 : _c.data, lastDataGrammar = target ? (0,
|
|
207
|
+
vutils_1.isString)(target) ? this.view.getDataById(target) : target : null, data = lastDataGrammar ? lastDataGrammar.getValue() : [], filterValue = computeTooltipFilterValue(point, scale, this.spec.tooltipType, groupSize, this.spec.componentConfig), tooltipDatum = this._tooltipDataFilter ? data.filter((datum => this._tooltipDataFilter(datum, filterValue))) : [];
|
|
208
|
+
if (tooltip.showAll(), isEqualTooltipDatum(tooltipDatum, this._lastDatum)) return void tooltip.setAttributes({
|
|
209
|
+
pointerX: point.x,
|
|
210
|
+
pointerY: point.y
|
|
211
|
+
});
|
|
212
|
+
this._lastDatum = tooltipDatum;
|
|
213
|
+
const boundsStart = {
|
|
214
|
+
x: 0,
|
|
215
|
+
y: 0
|
|
216
|
+
};
|
|
217
|
+
groupGraphicItem.globalTransMatrix.transformPoint({
|
|
218
|
+
x: 0,
|
|
219
|
+
y: 0
|
|
220
|
+
}, boundsStart);
|
|
221
|
+
const boundsEnd = {
|
|
222
|
+
x: 0,
|
|
223
|
+
y: 0
|
|
224
|
+
};
|
|
225
|
+
groupGraphicItem.globalTransMatrix.transformPoint({
|
|
226
|
+
x: this.view.getSignalById("width").getValue(),
|
|
227
|
+
y: this.view.getSignalById("height").getValue()
|
|
228
|
+
}, boundsEnd);
|
|
229
|
+
const bounds = (new vutils_1.AABBBounds).set(boundsStart.x, boundsStart.y, boundsEnd.x, boundsEnd.y), {title: title, content: content} = this._computeTitleContent(tooltipDatum), theme = this.view.getCurrentTheme(), attributes = (0,
|
|
230
|
+
exports.generateTooltipAttributes)(point, title, content, bounds, theme, this._additionalEncodeResult);
|
|
231
|
+
tooltip.setAttributes(attributes);
|
|
232
|
+
}), 10), this._onTooltipHide = event => {
|
|
233
|
+
this.elements[0].getGraphicItem().hideAll();
|
|
234
|
+
}, this.spec.componentType = graph_1.ComponentEnum.dimensionTooltip, this.spec.tooltipType = "x";
|
|
235
|
+
}
|
|
236
|
+
parseAddition(spec) {
|
|
237
|
+
var _a, _b;
|
|
238
|
+
return super.parseAddition(spec), this.scale(spec.scale), this.tooltipType(spec.tooltipType),
|
|
239
|
+
this.target(null === (_a = spec.target) || void 0 === _a ? void 0 : _a.data, null === (_b = spec.target) || void 0 === _b ? void 0 : _b.filter),
|
|
240
|
+
this.avoidMark(spec.avoidMark), this;
|
|
241
|
+
}
|
|
242
|
+
scale(scale) {
|
|
243
|
+
if (this.spec.scale) {
|
|
244
|
+
const lastScaleGrammar = (0, vutils_1.isString)(this.spec.scale) ? this.view.getScaleById(this.spec.scale) : this.spec.scale;
|
|
245
|
+
this.detach(lastScaleGrammar), this.spec.scale = void 0;
|
|
246
|
+
}
|
|
247
|
+
const scaleGrammar = (0, vutils_1.isString)(scale) ? this.view.getScaleById(scale) : scale;
|
|
248
|
+
return this.spec.scale = scaleGrammar, this.attach(scaleGrammar), this.commit(),
|
|
249
|
+
this;
|
|
250
|
+
}
|
|
251
|
+
tooltipType(tooltipType) {
|
|
252
|
+
return this.spec.tooltipType = tooltipType, this.commit(), this;
|
|
253
|
+
}
|
|
254
|
+
target(data, filter) {
|
|
255
|
+
var _a;
|
|
256
|
+
const lastData = null === (_a = this.spec.target) || void 0 === _a ? void 0 : _a.data;
|
|
257
|
+
if (lastData) {
|
|
258
|
+
const lastDataGrammar = (0, vutils_1.isString)(lastData) ? this.view.getDataById(lastData) : lastData;
|
|
259
|
+
this.detach(lastDataGrammar), this.spec.target = void 0;
|
|
260
|
+
}
|
|
261
|
+
const dataGrammar = (0, vutils_1.isString)(data) ? this.view.getDataById(data) : data;
|
|
262
|
+
return this._tooltipDataFilter = (0, vutils_1.isString)(filter) ? (datum, filterValue) => filterValue === datum[filter] : filter,
|
|
263
|
+
dataGrammar && (this.attach(dataGrammar), this.spec.target = {
|
|
264
|
+
data: dataGrammar,
|
|
265
|
+
filter: filter
|
|
266
|
+
}), this.commit(), this;
|
|
267
|
+
}
|
|
268
|
+
avoidMark(mark) {
|
|
269
|
+
if (this.spec.avoidMark) {
|
|
270
|
+
const prevMarks = (0, vutils_1.array)(this.spec.avoidMark).map((m => (0, vutils_1.isString)(m) ? this.view.getMarkById(m) : m));
|
|
271
|
+
this.detach(prevMarks);
|
|
272
|
+
}
|
|
273
|
+
this.spec.avoidMark = mark;
|
|
274
|
+
const nextMarks = (0, vutils_1.array)(mark).map((m => (0, vutils_1.isString)(m) ? this.view.getMarkById(m) : m));
|
|
275
|
+
return this.attach(nextMarks), this._avoidMarks = nextMarks.filter((m => !(0, vutils_1.isNil)(m))),
|
|
276
|
+
this.commit(), this;
|
|
277
|
+
}
|
|
278
|
+
release() {
|
|
279
|
+
var _a, _b, _c, _d;
|
|
280
|
+
null === (_b = null === (_a = this._lastGroup) || void 0 === _a ? void 0 : _a.off) || void 0 === _b || _b.call(_a, "pointermove", this._onTooltipShow),
|
|
281
|
+
null === (_d = null === (_c = this._lastGroup) || void 0 === _c ? void 0 : _c.off) || void 0 === _d || _d.call(_c, "pointerleave", this._onTooltipHide),
|
|
282
|
+
super.release();
|
|
283
|
+
}
|
|
284
|
+
init(stage, parameters) {
|
|
285
|
+
var _a, _b, _c, _d, _e, _f;
|
|
286
|
+
super.init(stage, parameters);
|
|
287
|
+
const groupGraphicItem = this.group ? this.group.getGroupGraphicItem() : stage.defaultLayer;
|
|
288
|
+
this._lastGroup !== groupGraphicItem && (null === (_b = null === (_a = this._lastGroup) || void 0 === _a ? void 0 : _a.off) || void 0 === _b || _b.call(_a, "pointermove", this._onTooltipShow),
|
|
289
|
+
null === (_d = null === (_c = this._lastGroup) || void 0 === _c ? void 0 : _c.off) || void 0 === _d || _d.call(_c, "pointerleave", this._onTooltipHide)),
|
|
290
|
+
null === (_e = null == groupGraphicItem ? void 0 : groupGraphicItem.on) || void 0 === _e || _e.call(groupGraphicItem, "pointermove", this._onTooltipShow),
|
|
291
|
+
null === (_f = null == groupGraphicItem ? void 0 : groupGraphicItem.on) || void 0 === _f || _f.call(groupGraphicItem, "pointerleave", this._onTooltipHide),
|
|
292
|
+
this._lastGroup = groupGraphicItem;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
exports.DimensionTooltip = DimensionTooltip;
|
|
297
|
+
|
|
298
|
+
const registerTooltip = () => {
|
|
299
|
+
factory_1.Factory.registerGraphicComponent(graph_1.ComponentEnum.tooltip, (attrs => new vrender_components_1.Tooltip(attrs))),
|
|
300
|
+
factory_1.Factory.registerGraphicComponent(graph_1.ComponentEnum.dimensionTooltip, (attrs => new vrender_components_1.Tooltip(attrs))),
|
|
301
|
+
factory_1.Factory.registerComponent(graph_1.ComponentEnum.tooltip, Tooltip), factory_1.Factory.registerComponent(graph_1.ComponentEnum.dimensionTooltip, DimensionTooltip);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
exports.registerTooltip = registerTooltip;
|
|
305
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/component/tooltip.ts"],"names":[],"mappings":";;;AAEA,6CAY0B;AAK1B,qEAA2E;AAC3E,2DAAoE;AAepE,oCAAyC;AAWzC,iDAA8C;AAC9C,iDAAqD;AACrD,wCAAsE;AACtE,wCAA8C;AAC9C,kD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AAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YACpE,MAAA,MAAC,IAAI,CAAC,UAAkB,0CAAE,GAAG,mDAAG,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;SACtE;QACD,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,EAAE,iEAAG,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3D,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,EAAE,iEAAG,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC;IACrC,CAAC;CA2EF;AAvKD,4CAuKC;AAEM,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,iBAAO,CAAC,wBAAwB,CAC9B,qBAAa,CAAC,OAAO,EACrB,CAAC,KAAwB,EAAE,EAAE,CAAC,IAAI,4BAAgB,CAAC,KAAK,CAAwB,CACjF,CAAC;IACF,iBAAO,CAAC,wBAAwB,CAC9B,qBAAa,CAAC,gBAAgB,EAC9B,CAAC,KAAwB,EAAE,EAAE,CAAC,IAAI,4BAAgB,CAAC,KAAK,CAAwB,CACjF,CAAC;IAEF,iBAAO,CAAC,iBAAiB,CAAC,qBAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE1D,iBAAO,CAAC,iBAAiB,CAAC,qBAAa,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AAC9E,CAAC,CAAC;AAbW,QAAA,eAAe,mBAa1B","file":"tooltip.js","sourcesContent":["import type { IBounds, IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n AABBBounds,\n isValid,\n isObjectLike,\n throttle,\n array,\n isNil,\n isString,\n merge,\n getAngleByPoint,\n isFunction,\n isArray\n} from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport type { IGraphic, IGroup } from '@visactor/vrender';\nimport type { TooltipAttributes, TooltipRowAttrs } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tooltip as TooltipComponent } from '@visactor/vrender-components';\nimport { field as getFieldAccessor } from '@visactor/vgrammar-util';\nimport type {\n BaseSignleEncodeSpec,\n IData,\n IElement,\n IGrammarBase,\n IGroupMark,\n IMark,\n IScale,\n ITheme,\n IView,\n Nil,\n RecursivePartial,\n StateEncodeSpec\n} from '../types';\nimport { ComponentEnum } from '../graph';\nimport type {\n BaseTooltipSpec,\n CustomTooltipCallback,\n DimensionTooltipSpec,\n IDimensionTooltip,\n ITooltip,\n ITooltipRow,\n TooltipSpec,\n TooltipType\n} from '../types/component';\nimport { Component } from '../view/component';\nimport { invokeEncoder } from '../graph/mark/encode';\nimport { invokeFunctionType, parseFunctionType } from '../parse/util';\nimport { isFieldEncode } from '../parse/mark';\nimport { BridgeElementKey } from '../graph/constants';\nimport type { IBaseScale } from '@visactor/vscale';\nimport { Factory } from '../core/factory';\n\nexport const generateTooltipAttributes = (\n point: IPointLike,\n title: TooltipRowAttrs,\n content: TooltipRowAttrs[],\n bounds: IBounds,\n theme?: ITheme,\n addition?: RecursivePartial<TooltipAttributes>\n): TooltipAttributes => {\n const tooltipTheme = theme?.components?.tooltip;\n\n return merge(\n {},\n tooltipTheme,\n {\n visible: true,\n pointerX: point.x,\n pointerY: point.y,\n title,\n content,\n parentBounds: bounds\n },\n addition ?? {}\n );\n};\n\nexport abstract class BaseTooltip extends Component {\n static readonly componentType: string = ComponentEnum.tooltip;\n protected declare spec: BaseTooltipSpec;\n\n protected _additionalEncodeResult: any;\n\n protected parseAddition(spec: BaseTooltipSpec) {\n super.parseAddition(spec);\n this.title(spec.title);\n this.content(spec.content);\n return this;\n }\n\n title(title: ITooltipRow | string | CustomTooltipCallback | Nil) {\n if (this.spec.title && !isString(this.spec.title) && !isFunction(this.spec.title)) {\n this.detach(this._parseTooltipRow(this.spec.title));\n }\n this.spec.title = title;\n if (title && !isString(title) && !isFunction(title)) {\n this.attach(this._parseTooltipRow(title));\n }\n this.commit();\n return this;\n }\n\n content(content: ITooltipRow | ITooltipRow[] | CustomTooltipCallback | Nil) {\n if (this.spec.content && !isFunction(this.spec.content)) {\n this.detach(this._parseTooltipRow(this.spec.content));\n }\n this.spec.content = content;\n if (content && !isFunction(content)) {\n this.attach(this._parseTooltipRow(content));\n }\n this.commit();\n return this;\n }\n\n configureComponent(config: any) {\n super.configureComponent(config);\n return this;\n }\n\n protected _updateComponentEncoders() {\n const encoders = Object.assign({ update: {} }, this.spec.encode);\n const componentEncoders: StateEncodeSpec = Object.keys(encoders).reduce((res, state) => {\n const encoder = encoders[state];\n if (encoder) {\n res[state] = {\n callback: (datum: any, element: IElement, parameters: any) => {\n this._additionalEncodeResult = invokeEncoder(encoder as BaseSignleEncodeSpec, datum, element, parameters);\n }\n };\n }\n return res;\n }, {});\n this._encoders = componentEncoders;\n }\n\n protected _parseTooltipRow(tooltipRow: ITooltipRow | ITooltipRow[] | Nil) {\n return array(tooltipRow).reduce((dependencies, row) => {\n dependencies = dependencies.concat(parseFunctionType(row.visible, this.view));\n if (!isFieldEncode(row.key)) {\n dependencies = dependencies.concat(parseFunctionType(row.key, this.view));\n }\n if (!isFieldEncode(row.value)) {\n dependencies = dependencies.concat(parseFunctionType(row.value, this.view));\n }\n if (!isFieldEncode(row.symbol)) {\n dependencies = dependencies.concat(parseFunctionType(row.symbol, this.view));\n }\n return dependencies;\n }, [] as IGrammarBase[]);\n }\n\n protected _computeTooltipRow(row: ITooltipRow, datum: any, parameters: any) {\n const element = this.elements[0];\n\n // compute visible\n let visible = invokeFunctionType(row.visible, parameters, datum, element);\n visible = isNil(visible) ? true : !!visible;\n\n // compute key\n let key;\n if (isFieldEncode(row.key)) {\n const fieldAccessor = getFieldAccessor(row.key.field);\n key = fieldAccessor(datum);\n } else {\n key = invokeFunctionType(row.key, parameters, datum, element);\n }\n key = isNil(key) ? undefined : isObjectLike(key) ? key : { text: key };\n\n // compute value\n let value;\n if (isFieldEncode(row.value)) {\n const fieldAccessor = getFieldAccessor(row.value.field);\n value = fieldAccessor(datum);\n } else {\n value = invokeFunctionType(row.value, parameters, datum, element);\n }\n value = isNil(value) ? undefined : isObjectLike(value) ? value : { text: value };\n\n // compute symbol\n let symbol;\n if (isFieldEncode(row.symbol)) {\n const fieldAccessor = getFieldAccessor(row.symbol.field);\n symbol = fieldAccessor(datum);\n } else {\n symbol = invokeFunctionType(row.symbol, parameters, datum, element);\n }\n symbol = isNil(symbol) ? undefined : isObjectLike(symbol) ? symbol : { symbolType: symbol };\n\n return { visible, key, value, shape: symbol };\n }\n\n protected _computeTitleContent(datum: any) {\n const tooltip = this.elements[0];\n const parameters = this.parameters();\n\n const title = isValid(this.spec.title)\n ? isFunction(this.spec.title)\n ? this.spec.title.call(null, datum, tooltip, parameters)\n : this._computeTooltipRow(\n isString(this.spec.title) ? { value: this.spec.title } : this.spec.title,\n datum,\n parameters\n )\n : undefined;\n const content = isValid(this.spec.content)\n ? isFunction(this.spec.content)\n ? array(this.spec.content.call(null, datum, tooltip, parameters))\n : array(datum).reduce((content, datumRow) => {\n return content.concat(\n array(this.spec.content).map(row => this._computeTooltipRow(row as ITooltipRow, datumRow, parameters))\n );\n }, [])\n : undefined;\n\n // only display one single row in title\n return { title: isArray(title) ? title[0] : title, content };\n }\n}\n\nexport class Tooltip extends BaseTooltip implements ITooltip {\n protected declare spec: TooltipSpec;\n\n private _targetMarks: IMark[] = [];\n private _lastElement: IElement;\n\n constructor(view: IView, group?: IGroupMark) {\n super(view, ComponentEnum.tooltip, group);\n this.spec.componentType = ComponentEnum.tooltip;\n }\n\n protected parseAddition(spec: TooltipSpec) {\n super.parseAddition(spec);\n this.target(spec.target);\n return this;\n }\n\n target(mark: IMark | IMark[] | string | string[] | Nil): this {\n if (this.spec.target) {\n const prevMarks = array(this.spec.target).map(m => (isString(m) ? this.view.getMarkById(m) : m));\n this.detach(prevMarks);\n }\n this.spec.target = mark;\n const nextMarks = array(mark).map(m => (isString(m) ? this.view.getMarkById(m) : m));\n this.attach(nextMarks);\n this._targetMarks = nextMarks.filter(m => !isNil(m));\n this.commit();\n return this;\n }\n\n release() {\n this.view.removeEventListener('pointermove', this._onTooltipShow);\n this.view.removeEventListener('pointerleave', this._onTooltipHide);\n super.release();\n }\n\n protected init(stage: any, parameters: any) {\n super.init(stage, parameters);\n this.view.addEventListener('pointermove', this._onTooltipShow);\n this.view.addEventListener('pointerleave', this._onTooltipHide);\n }\n\n protected _onTooltipShow = throttle((event: any, element: IElement) => {\n const tooltip = this.elements[0].getGraphicItem() as IGroup;\n if (!this._targetMarks.includes(element?.mark)) {\n tooltip.hideAll();\n return;\n }\n\n tooltip.showAll();\n\n const groupGraphicItem = this.group.getGroupGraphicItem();\n // FIXME: waiting for vRender to add transformed position to event\n const point = { x: 0, y: 0 };\n groupGraphicItem.globalTransMatrix.transformPoint(event.canvas, point);\n\n if (element === this._lastElement) {\n // only update pointer when element is not changed\n tooltip.setAttributes({ pointerX: point.x, pointerY: point.y } as any);\n return;\n }\n\n const boundsStart = { x: 0, y: 0 };\n groupGraphicItem.globalTransMatrix.transformPoint({ x: 0, y: 0 }, boundsStart);\n const boundsEnd = { x: 0, y: 0 };\n groupGraphicItem.globalTransMatrix.transformPoint(\n {\n x: this.view.getSignalById('width').getValue() as number,\n y: this.view.getSignalById('height').getValue() as number\n },\n boundsEnd\n );\n const bounds = new AABBBounds().set(boundsStart.x, boundsStart.y, boundsEnd.x, boundsEnd.y);\n const { title, content } = this._computeTitleContent(element.getDatum());\n const theme = this.view.getCurrentTheme();\n const attributes = generateTooltipAttributes(point, title, content, bounds, theme, this._additionalEncodeResult);\n tooltip.setAttributes(attributes);\n }, 10);\n\n protected _onTooltipHide = (event: any) => {\n const tooltip = this.elements[0].getGraphicItem() as IGroup;\n tooltip.hideAll();\n };\n}\n\nconst isEqualTooltipDatum = (current: any[], previous: any[]) => {\n const currentDatum = array(current);\n const previousDatum = array(previous);\n if (currentDatum.length !== previousDatum.length) {\n return false;\n }\n return (\n currentDatum.every(datum => previousDatum.includes(datum)) &&\n previousDatum.every(datum => currentDatum.includes(datum))\n );\n};\n\nconst computeTooltipFilterValue = (\n point: IPointLike,\n scale: IBaseScale,\n type: TooltipType,\n groupSize: { width: number; height: number },\n config: DimensionTooltipSpec['componentConfig']\n) => {\n if (type === 'x') {\n return scale.invert(point.x);\n }\n if (type === 'y') {\n return scale.invert(point.y);\n }\n if (type === 'radius') {\n const center = config?.center ?? { x: groupSize.width / 2, y: groupSize.height / 2 };\n const radius = Math.sqrt((center.x - point.x) ** 2 + (center.y - point.y) ** 2);\n return scale.invert(radius);\n }\n if (type === 'angle') {\n const center = config?.center ?? { x: groupSize.width / 2, y: groupSize.height / 2 };\n const angle = getAngleByPoint(center, point);\n return scale.invert(angle);\n }\n return scale.invert(point.x);\n};\n\nexport class DimensionTooltip extends BaseTooltip implements IDimensionTooltip {\n protected declare spec: DimensionTooltipSpec;\n\n private _lastGroup: IGroup;\n private _lastDatum: any;\n private _avoidMarks: IMark[] = [];\n private _tooltipDataFilter: ((datum: any, filterValue: any[]) => boolean) | null = null;\n\n constructor(view: IView, group?: IGroupMark) {\n super(view, ComponentEnum.dimensionTooltip, group);\n this.spec.componentType = ComponentEnum.dimensionTooltip;\n this.spec.tooltipType = 'x';\n }\n\n protected parseAddition(spec: DimensionTooltipSpec) {\n super.parseAddition(spec);\n this.scale(spec.scale);\n this.tooltipType(spec.tooltipType);\n this.target(spec.target?.data, spec.target?.filter);\n this.avoidMark(spec.avoidMark);\n return this;\n }\n\n scale(scale?: IScale | string | Nil) {\n if (this.spec.scale) {\n const lastScaleGrammar = isString(this.spec.scale) ? this.view.getScaleById(this.spec.scale) : this.spec.scale;\n this.detach(lastScaleGrammar);\n this.spec.scale = undefined;\n }\n const scaleGrammar = isString(scale) ? this.view.getScaleById(scale) : scale;\n this.spec.scale = scaleGrammar;\n this.attach(scaleGrammar);\n this.commit();\n return this;\n }\n\n tooltipType(tooltipType: TooltipType | Nil) {\n this.spec.tooltipType = tooltipType;\n this.commit();\n return this;\n }\n\n target(data: IData | string | Nil, filter: string | ((datum: any, tooltipValue: any) => boolean) | Nil) {\n const lastData = this.spec.target?.data;\n if (lastData) {\n const lastDataGrammar = isString(lastData) ? this.view.getDataById(lastData) : lastData;\n this.detach(lastDataGrammar);\n this.spec.target = undefined;\n }\n const dataGrammar = isString(data) ? this.view.getDataById(data) : data;\n this._tooltipDataFilter = isString(filter)\n ? (datum: any, filterValue: any[]) => filterValue === datum[filter]\n : filter;\n if (dataGrammar) {\n this.attach(dataGrammar);\n this.spec.target = { data: dataGrammar, filter };\n }\n this.commit();\n return this;\n }\n\n avoidMark(mark: IMark | IMark[] | string | string[] | Nil) {\n if (this.spec.avoidMark) {\n const prevMarks = array(this.spec.avoidMark).map(m => (isString(m) ? this.view.getMarkById(m) : m));\n this.detach(prevMarks);\n }\n this.spec.avoidMark = mark;\n const nextMarks = array(mark).map(m => (isString(m) ? this.view.getMarkById(m) : m));\n this.attach(nextMarks);\n this._avoidMarks = nextMarks.filter(m => !isNil(m));\n this.commit();\n return this;\n }\n\n release() {\n (this._lastGroup as any)?.off?.('pointermove', this._onTooltipShow);\n (this._lastGroup as any)?.off?.('pointerleave', this._onTooltipHide);\n super.release();\n }\n\n protected init(stage: any, parameters: any) {\n super.init(stage, parameters);\n\n const groupGraphicItem = this.group ? this.group.getGroupGraphicItem() : stage.defaultLayer;\n if (this._lastGroup !== groupGraphicItem) {\n // FIXME: waiting for vRender to fix\n (this._lastGroup as any)?.off?.('pointermove', this._onTooltipShow);\n (this._lastGroup as any)?.off?.('pointerleave', this._onTooltipHide);\n }\n groupGraphicItem?.on?.('pointermove', this._onTooltipShow);\n groupGraphicItem?.on?.('pointerleave', this._onTooltipHide);\n this._lastGroup = groupGraphicItem;\n }\n\n protected _onTooltipShow = throttle((event: any, element: IElement) => {\n const tooltip = this.elements[0].getGraphicItem() as IGroup;\n\n const scaleGrammar = isString(this.spec.scale) ? this.view.getScaleById(this.spec.scale) : this.spec.scale;\n const scale = scaleGrammar.getScale();\n const groupGraphicItem = this.group.getGroupGraphicItem();\n // FIXME: waiting for vRender to add transformed position to event\n const point = { x: 0, y: 0 };\n groupGraphicItem.globalTransMatrix.transformPoint(event.canvas, point);\n const groupSize = { width: groupGraphicItem.attribute.width, height: groupGraphicItem.attribute.height };\n\n // if pointer is not within the area of group, hide tooltip\n if (\n point.x < 0 ||\n point.x > groupGraphicItem.attribute.width ||\n point.y < 0 ||\n point.y > groupGraphicItem.attribute.height\n ) {\n tooltip.hideAll();\n return;\n }\n // if pointer is hovered on the avoided marks, hide tooltip\n const eventTargetMark = event.target?.[BridgeElementKey]?.mark;\n if (this._avoidMarks.includes(eventTargetMark)) {\n tooltip.hideAll();\n return;\n }\n\n const target = this.spec.target?.data;\n const lastDataGrammar = !target ? null : isString(target) ? this.view.getDataById(target) : target;\n const data = lastDataGrammar ? lastDataGrammar.getValue() : [];\n\n const filterValue = computeTooltipFilterValue(\n point,\n scale,\n this.spec.tooltipType,\n groupSize,\n this.spec.componentConfig\n );\n const tooltipDatum = this._tooltipDataFilter\n ? data.filter(datum => this._tooltipDataFilter(datum, filterValue))\n : [];\n\n tooltip.showAll();\n if (isEqualTooltipDatum(tooltipDatum, this._lastDatum)) {\n // only update pointer when element is not changed\n tooltip.setAttributes({ pointerX: point.x, pointerY: point.y } as any);\n return;\n }\n this._lastDatum = tooltipDatum;\n\n // compute tooltip bounds\n const boundsStart = { x: 0, y: 0 };\n groupGraphicItem.globalTransMatrix.transformPoint({ x: 0, y: 0 }, boundsStart);\n const boundsEnd = { x: 0, y: 0 };\n groupGraphicItem.globalTransMatrix.transformPoint(\n {\n x: this.view.getSignalById('width').getValue() as number,\n y: this.view.getSignalById('height').getValue() as number\n },\n boundsEnd\n );\n const bounds = new AABBBounds().set(boundsStart.x, boundsStart.y, boundsEnd.x, boundsEnd.y);\n const { title, content } = this._computeTitleContent(tooltipDatum);\n const theme = this.view.getCurrentTheme();\n const attributes = generateTooltipAttributes(point, title, content, bounds, theme, this._additionalEncodeResult);\n tooltip.setAttributes(attributes);\n }, 10);\n\n protected _onTooltipHide = (event: any) => {\n const tooltip = this.elements[0].getGraphicItem() as IGroup;\n tooltip.hideAll();\n };\n}\n\nexport const registerTooltip = () => {\n Factory.registerGraphicComponent(\n ComponentEnum.tooltip,\n (attrs: TooltipAttributes) => new TooltipComponent(attrs) as unknown as IGraphic\n );\n Factory.registerGraphicComponent(\n ComponentEnum.dimensionTooltip,\n (attrs: TooltipAttributes) => new TooltipComponent(attrs) as unknown as IGraphic\n );\n\n Factory.registerComponent(ComponentEnum.tooltip, Tooltip);\n\n Factory.registerComponent(ComponentEnum.dimensionTooltip, DimensionTooltip);\n};\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IGraphic } from '@visactor/vrender';
|
|
2
|
+
import type { GlyphChannelEncoder, GlyphDefaultEncoder, IComponentConstructor, IElement, IGlyphElement, IGlyphMeta, IGrammarBaseConstructor, IGroupMark, IPlotMarkConstructor, ISemanticMark, ITransform, IView, MarkType, TypeAnimation } from '../types';
|
|
3
|
+
export declare class Factory {
|
|
4
|
+
private static _plotMarks;
|
|
5
|
+
private static _components;
|
|
6
|
+
private static _graphicComponents;
|
|
7
|
+
private static _transforms;
|
|
8
|
+
private static _grammars;
|
|
9
|
+
private static _glyphs;
|
|
10
|
+
private static _animations;
|
|
11
|
+
static registerPlotMarks(key: string, mark: IPlotMarkConstructor): void;
|
|
12
|
+
static createPlotMark(type: string, id?: string): ISemanticMark<any, any> | null;
|
|
13
|
+
static registerComponent(key: string, component: IComponentConstructor): void;
|
|
14
|
+
static createComponent(componentType: string, view: IView, group?: IGroupMark, mode?: '2d' | '3d'): import("../types").IComponent;
|
|
15
|
+
static hasComponent(componentType: string): boolean;
|
|
16
|
+
static registerGraphicComponent(key: string, creator: (attrs: any, mode?: '2d' | '3d') => IGraphic): void;
|
|
17
|
+
static createGraphicComponent(componentType: string, attrs: any, mode?: '2d' | '3d'): IGraphic<Partial<import("@visactor/vrender").IGraphicAttribute>>;
|
|
18
|
+
static registerTransform(type: string, transform: Omit<ITransform, 'type'>, isBuiltIn?: boolean): void;
|
|
19
|
+
static getTransform(type: string): ITransform<any, any, any>;
|
|
20
|
+
static unregisterRuntimeTransforms(): void;
|
|
21
|
+
static registerGrammar(type: string, grammarClass: IGrammarBaseConstructor, specKey?: string): void;
|
|
22
|
+
static createGrammar(type: string, view: IView): import("../types").IGrammarBase;
|
|
23
|
+
static getGrammars(): Record<string, {
|
|
24
|
+
grammarClass: IGrammarBaseConstructor;
|
|
25
|
+
specKey: string;
|
|
26
|
+
}>;
|
|
27
|
+
static registerGlyph: <EncodeValuesType = any, GlyphConfigType = any>(glyphType: string, marks: {
|
|
28
|
+
[markName: string]: string;
|
|
29
|
+
}, encoders?: {
|
|
30
|
+
[markName: string]: GlyphChannelEncoder<any, EncodeValuesType, GlyphConfigType>;
|
|
31
|
+
}, defaultEncoder?: GlyphDefaultEncoder, progressiveChannels?: string | string[]) => IGlyphMeta<EncodeValuesType, GlyphConfigType>;
|
|
32
|
+
static getGlyph(glyphType: string): IGlyphMeta;
|
|
33
|
+
static registerAnimationType: (animationType: string, animation: TypeAnimation<IGlyphElement> | TypeAnimation<IElement>) => void;
|
|
34
|
+
static getAnimationType: (animationType: string) => TypeAnimation<IGlyphElement<any>> | TypeAnimation<IElement>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.Factory = void 0;
|
|
6
|
+
|
|
7
|
+
const glyph_meta_1 = require("../view/glyph-meta");
|
|
8
|
+
|
|
9
|
+
class Factory {
|
|
10
|
+
static registerPlotMarks(key, mark) {
|
|
11
|
+
Factory._plotMarks[key] = mark;
|
|
12
|
+
}
|
|
13
|
+
static createPlotMark(type, id) {
|
|
14
|
+
if (!Factory._plotMarks[type]) return null;
|
|
15
|
+
return new (0, Factory._plotMarks[type])(id);
|
|
16
|
+
}
|
|
17
|
+
static registerComponent(key, component) {
|
|
18
|
+
Factory._components[key] = component;
|
|
19
|
+
}
|
|
20
|
+
static createComponent(componentType, view, group, mode) {
|
|
21
|
+
const Ctor = Factory._components[componentType];
|
|
22
|
+
return Ctor ? new Ctor(view, group, mode) : null;
|
|
23
|
+
}
|
|
24
|
+
static hasComponent(componentType) {
|
|
25
|
+
return !!Factory._components[componentType];
|
|
26
|
+
}
|
|
27
|
+
static registerGraphicComponent(key, creator) {
|
|
28
|
+
Factory._graphicComponents[key] = creator;
|
|
29
|
+
}
|
|
30
|
+
static createGraphicComponent(componentType, attrs, mode) {
|
|
31
|
+
const compCreator = Factory._graphicComponents[componentType];
|
|
32
|
+
return compCreator ? compCreator(attrs, mode) : null;
|
|
33
|
+
}
|
|
34
|
+
static registerTransform(type, transform, isBuiltIn) {
|
|
35
|
+
Factory._transforms[type] = Object.assign(transform, {
|
|
36
|
+
type: type,
|
|
37
|
+
isBuiltIn: !!isBuiltIn
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
static getTransform(type) {
|
|
41
|
+
return Factory._transforms[type];
|
|
42
|
+
}
|
|
43
|
+
static unregisterRuntimeTransforms() {
|
|
44
|
+
Object.keys(Factory._transforms).forEach((type => {
|
|
45
|
+
Factory._transforms[type] && !Factory._transforms[type].isBuiltIn && (Factory._transforms[type] = null);
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
static registerGrammar(type, grammarClass, specKey) {
|
|
49
|
+
Factory._grammars[type] = {
|
|
50
|
+
grammarClass: grammarClass,
|
|
51
|
+
specKey: null != specKey ? specKey : type
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static createGrammar(type, view) {
|
|
55
|
+
var _a;
|
|
56
|
+
const Ctor = null === (_a = Factory._grammars[type]) || void 0 === _a ? void 0 : _a.grammarClass;
|
|
57
|
+
return Ctor ? new Ctor(view) : null;
|
|
58
|
+
}
|
|
59
|
+
static getGrammars() {
|
|
60
|
+
return this._grammars;
|
|
61
|
+
}
|
|
62
|
+
static getGlyph(glyphType) {
|
|
63
|
+
return Factory._glyphs[glyphType];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
exports.Factory = Factory, Factory._plotMarks = {}, Factory._components = {}, Factory._graphicComponents = {},
|
|
68
|
+
Factory._transforms = {}, Factory._grammars = {}, Factory._glyphs = {}, Factory._animations = {},
|
|
69
|
+
Factory.registerGlyph = (glyphType, marks, encoders, defaultEncoder, progressiveChannels) => (Factory._glyphs[glyphType] = new glyph_meta_1.GlyphMeta(marks, encoders, defaultEncoder, progressiveChannels),
|
|
70
|
+
Factory._glyphs[glyphType]), Factory.registerAnimationType = (animationType, animation) => {
|
|
71
|
+
Factory._animations[animationType] = animation;
|
|
72
|
+
}, Factory.getAnimationType = animationType => Factory._animations[animationType];
|
|
73
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/factory.ts"],"names":[],"mappings":";;;AAiBA,mDAA+C;AAE/C,MAAa,OAAO;IASlB,MAAM,CAAC,iBAAiB,CAAC,GAAW,EAAE,IAA0B;QAC9D,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,EAAW;QAC7C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YAC7B,OAAO,IAAI,CAAC;SACb;QACD,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,GAAW,EAAE,SAAgC;QACpE,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACvC,CAAC;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OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,sBAAS,CACxC,KAAK,EACL,QAAQ,EACR,cAAc,EACd,mBAAmB,CACpB,CAAC;IACF,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC,CAAC;AAMK,6BAAqB,GAAG,CAC7B,aAAqB,EACrB,SAAiE,EAC3D,EAAE;IACR,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;AACjD,CAAC,CAAC;AAEK,wBAAgB,GAAG,CAAC,aAAqB,EAAE,EAAE;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;AAC5C,CAAC,CAAC","file":"factory.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender';\nimport type {\n GlyphChannelEncoder,\n GlyphDefaultEncoder,\n IComponentConstructor,\n IElement,\n IGlyphElement,\n IGlyphMeta,\n IGrammarBaseConstructor,\n IGroupMark,\n IPlotMarkConstructor,\n ISemanticMark,\n ITransform,\n IView,\n MarkType,\n TypeAnimation\n} from '../types';\nimport { GlyphMeta } from '../view/glyph-meta';\n\nexport class Factory {\n private static _plotMarks: Record<string, IPlotMarkConstructor> = {};\n private static _components: Record<string, IComponentConstructor> = {};\n private static _graphicComponents: Record<string, (attrs: any, mode?: '2d' | '3d') => IGraphic> = {};\n private static _transforms: Record<string, ITransform> = {};\n private static _grammars: Record<string, { grammarClass: IGrammarBaseConstructor; specKey: string }> = {};\n private static _glyphs: Record<string, IGlyphMeta<any, any>> = {};\n private static _animations: Record<string, TypeAnimation<IGlyphElement> | TypeAnimation<IElement>> = {};\n\n static registerPlotMarks(key: string, mark: IPlotMarkConstructor) {\n Factory._plotMarks[key] = mark;\n }\n\n static createPlotMark(type: string, id?: string): ISemanticMark<any, any> | null {\n if (!Factory._plotMarks[type]) {\n return null;\n }\n const MarkConstructor = Factory._plotMarks[type];\n return new MarkConstructor(id);\n }\n\n static registerComponent(key: string, component: IComponentConstructor) {\n Factory._components[key] = component;\n }\n\n static createComponent(componentType: string, view: IView, group?: IGroupMark, mode?: '2d' | '3d') {\n const Ctor = Factory._components[componentType];\n if (!Ctor) {\n return null;\n }\n\n return new Ctor(view, group, mode);\n }\n\n static hasComponent(componentType: string) {\n return !!Factory._components[componentType];\n }\n\n static registerGraphicComponent(key: string, creator: (attrs: any, mode?: '2d' | '3d') => IGraphic) {\n Factory._graphicComponents[key] = creator;\n }\n\n static createGraphicComponent(componentType: string, attrs: any, mode?: '2d' | '3d') {\n const compCreator = Factory._graphicComponents[componentType];\n\n if (!compCreator) {\n return null;\n }\n\n return compCreator(attrs, mode);\n }\n\n static registerTransform(type: string, transform: Omit<ITransform, 'type'>, isBuiltIn?: boolean) {\n Factory._transforms[type] = Object.assign(transform, { type, isBuiltIn: !!isBuiltIn });\n }\n\n static getTransform(type: string) {\n return Factory._transforms[type];\n }\n\n static unregisterRuntimeTransforms() {\n Object.keys(Factory._transforms).forEach(type => {\n if (Factory._transforms[type] && !Factory._transforms[type].isBuiltIn) {\n Factory._transforms[type] = null;\n }\n });\n }\n\n static registerGrammar(type: string, grammarClass: IGrammarBaseConstructor, specKey?: string) {\n Factory._grammars[type] = {\n grammarClass: grammarClass,\n specKey: specKey ?? type\n };\n }\n\n static createGrammar(type: string, view: IView) {\n const Ctor = Factory._grammars[type]?.grammarClass;\n\n if (!Ctor) {\n return null;\n }\n\n return new Ctor(view);\n }\n\n static getGrammars() {\n return this._grammars;\n }\n\n static registerGlyph = <EncodeValuesType = any, GlyphConfigType = any>(\n glyphType: string,\n marks: { [markName: string]: MarkType },\n encoders?: { [markName: string]: GlyphChannelEncoder<any, EncodeValuesType, GlyphConfigType> },\n defaultEncoder?: GlyphDefaultEncoder,\n progressiveChannels?: string | string[]\n ): IGlyphMeta<EncodeValuesType, GlyphConfigType> => {\n Factory._glyphs[glyphType] = new GlyphMeta<EncodeValuesType, GlyphConfigType>(\n marks,\n encoders,\n defaultEncoder,\n progressiveChannels\n );\n return Factory._glyphs[glyphType];\n };\n\n static getGlyph(glyphType: string): IGlyphMeta {\n return Factory._glyphs[glyphType];\n }\n\n static registerAnimationType = (\n animationType: string,\n animation: TypeAnimation<IGlyphElement> | TypeAnimation<IElement>\n ): void => {\n Factory._animations[animationType] = animation;\n };\n\n static getAnimationType = (animationType: string) => {\n return Factory._animations[animationType];\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IGlyphElement, TypeAnimation } from '../types';
|
|
2
|
+
export interface IBoxplotScaleAnimationOptions {
|
|
3
|
+
center?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const boxplotScaleIn: TypeAnimation<IGlyphElement<any>>;
|
|
6
|
+
export declare const boxplotScaleOut: TypeAnimation<IGlyphElement<any>>;
|
|
7
|
+
export declare function registerBoxplotGlyph(): void;
|
|
8
|
+
export declare const barBoxplotScaleIn: TypeAnimation<IGlyphElement<any>>;
|
|
9
|
+
export declare const barBoxplotScaleOut: TypeAnimation<IGlyphElement<any>>;
|
|
10
|
+
export declare function registerBarBoxplotGlyph(): void;
|