@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,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.createElement = void 0;
|
|
6
|
+
|
|
7
|
+
const enums_1 = require("../enums"), element_1 = require("../element"), glyph_element_1 = require("../glyph-element"), createElement = mark => mark.markType === enums_1.GrammarMarkType.glyph ? new glyph_element_1.GlyphElement(mark) : new element_1.Element(mark);
|
|
8
|
+
|
|
9
|
+
exports.createElement = createElement;
|
|
10
|
+
//# sourceMappingURL=element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/element.ts"],"names":[],"mappings":";;;AACA,oCAA2C;AAC3C,wCAAqC;AACrC,oDAAgD;AAEzC,MAAM,aAAa,GAAG,CAAC,IAAW,EAAY,EAAE;IACrD,IAAI,IAAI,CAAC,QAAQ,KAAK,uBAAe,CAAC,KAAK,EAAE;QAC3C,OAAO,IAAI,4BAAY,CAAC,IAAkB,CAAC,CAAC;KAC7C;IACD,OAAO,IAAI,iBAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC,CAAC;AALW,QAAA,aAAa,iBAKxB","file":"element.js","sourcesContent":["import type { IElement, IGlyphMark, IMark } from '../../types';\nimport { GrammarMarkType } from '../enums';\nimport { Element } from '../element';\nimport { GlyphElement } from '../glyph-element';\n\nexport const createElement = (mark: IMark): IElement => {\n if (mark.markType === GrammarMarkType.glyph) {\n return new GlyphElement(mark as IGlyphMark);\n }\n return new Element(mark);\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.configureEnvironment = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_1 = require("@visactor/vrender");
|
|
8
|
+
|
|
9
|
+
function configureEnvironment(options) {
|
|
10
|
+
options.mode && vrender_1.vglobal.setEnv(options.mode, options.modeParams || {});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.configureEnvironment = configureEnvironment;
|
|
14
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/env.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAG5C,SAAgB,oBAAoB,CAAC,OAA4B;IAC/D,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,iBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;KACxD;AACH,CAAC;AAJD,oDAIC","file":"env.js","sourcesContent":["import { vglobal } from '@visactor/vrender';\nimport type { IEnvironmentOptions } from '../../types';\n\nexport function configureEnvironment(options: IEnvironmentOptions) {\n if (options.mode) {\n vglobal.setEnv(options.mode, options.modeParams || {});\n }\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FederatedEvent } from '@visactor/vrender';
|
|
2
|
+
import type { IElement } from './../../types/element';
|
|
3
|
+
import type { IView } from './../../types/view';
|
|
4
|
+
import type { EventSourceType } from '../../types';
|
|
5
|
+
export default function getExtendedEvents(view: IView, event: FederatedEvent, item: IElement, type: string, source: EventSourceType): FederatedEvent<Event>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const point_1 = require("./point"), constants_1 = require("../../view/constants");
|
|
8
|
+
|
|
9
|
+
function getExtendedEvents(view, event, item, type, source) {
|
|
10
|
+
if (source === constants_1.EVENT_SOURCE_WINDOW) {
|
|
11
|
+
const e = event.changedTouches ? event.changedTouches[0] : event;
|
|
12
|
+
(0, point_1.point)(e);
|
|
13
|
+
}
|
|
14
|
+
return event.element = item, event.vGrammarType = type, event;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = getExtendedEvents;
|
|
18
|
+
//# sourceMappingURL=events-extend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/events-extend.ts"],"names":[],"mappings":";;AAGA,mCAAgC;AAChC,oDAA2D;AAG3D,SAAwB,iBAAiB,CACvC,IAAW,EACX,KAAqB,EACrB,IAAc,EACd,IAAY,EACZ,MAAuB;IAEvB,IAAI,MAAM,KAAK,+BAAmB,EAAE;QAClC,MAAM,CAAC,GAAI,KAAa,CAAC,cAAc,CAAC,CAAC,CAAE,KAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACnF,IAAA,aAAK,EAAC,CAAC,CAAC,CAAC;KACV;IAEA,KAAa,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,KAAa,CAAC,YAAY,GAAG,IAAI,CAAC;IAEnC,OAAO,KAAK,CAAC;AACf,CAAC;AAhBD,oCAgBC","file":"events-extend.js","sourcesContent":["import type { FederatedEvent } from '@visactor/vrender';\nimport type { IElement } from './../../types/element';\nimport type { IView } from './../../types/view';\nimport { point } from './point';\nimport { EVENT_SOURCE_WINDOW } from '../../view/constants';\nimport type { EventSourceType } from '../../types';\n\nexport default function getExtendedEvents(\n view: IView,\n event: FederatedEvent,\n item: IElement,\n type: string,\n source: EventSourceType\n) {\n if (source === EVENT_SOURCE_WINDOW) {\n const e = (event as any).changedTouches ? (event as any).changedTouches[0] : event;\n point(e);\n }\n\n (event as any).element = item;\n (event as any).vGrammarType = type;\n\n return event;\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IGlyphMeta, IMark } from '../../types';
|
|
2
|
+
import type { IGraphic } from '@visactor/vrender';
|
|
3
|
+
import { LargeRects } from '../mark/large-rects';
|
|
4
|
+
import { LargeSymbols } from '../mark/large-symbols';
|
|
5
|
+
export declare const isMarkType: (type: string) => boolean;
|
|
6
|
+
export declare function createGraphicItem(mark: IMark, markType: string, attrs?: any): IGraphic<Partial<import("@visactor/vrender").IGraphicAttribute>> | LargeRects | LargeSymbols;
|
|
7
|
+
export declare function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs?: any): import("@visactor/vrender").IGlyph<Partial<import("@visactor/vrender").IGraphicAttribute>>;
|
|
8
|
+
export declare const removeGraphicItem: (graphicItem: IGraphic) => void;
|
|
9
|
+
export declare const getMarkTypeOfLarge: (markType: string) => string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.getMarkTypeOfLarge = exports.removeGraphicItem = exports.createGlyphGraphicItem = exports.createGraphicItem = exports.isMarkType = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_1 = require("@visactor/vrender"), enums_1 = require("../enums"), constants_1 = require("../constants"), large_rects_1 = require("../mark/large-rects"), large_symbols_1 = require("../mark/large-symbols"), factory_1 = require("../../core/factory"), itemCreator = {
|
|
8
|
+
circle: vrender_1.createCircle,
|
|
9
|
+
arc: vrender_1.createArc,
|
|
10
|
+
arc3d: vrender_1.createArc3d,
|
|
11
|
+
pyramid3d: vrender_1.createPyramid3d,
|
|
12
|
+
area: vrender_1.createArea,
|
|
13
|
+
group: vrender_1.createGroup,
|
|
14
|
+
image: vrender_1.createImage,
|
|
15
|
+
rect3d: vrender_1.createRect3d,
|
|
16
|
+
line: vrender_1.createLine,
|
|
17
|
+
path: vrender_1.createPath,
|
|
18
|
+
rect: vrender_1.createRect,
|
|
19
|
+
rule: vrender_1.createLine,
|
|
20
|
+
shape: vrender_1.createPath,
|
|
21
|
+
symbol: vrender_1.createSymbol,
|
|
22
|
+
text: vrender_1.createText,
|
|
23
|
+
richtext: vrender_1.createRichText,
|
|
24
|
+
polygon: vrender_1.createPolygon,
|
|
25
|
+
cell: vrender_1.createSymbol,
|
|
26
|
+
interval: vrender_1.createRect
|
|
27
|
+
}, isMarkType = type => !!itemCreator[type];
|
|
28
|
+
|
|
29
|
+
function createGraphicItem(mark, markType, attrs = {}) {
|
|
30
|
+
if (mark.emit(enums_1.HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK), markType === enums_1.GrammarMarkType.largeRects) return new large_rects_1.LargeRects(attrs);
|
|
31
|
+
if (markType === enums_1.GrammarMarkType.largeSymbols) return new large_symbols_1.LargeSymbols(attrs);
|
|
32
|
+
const graphicItem = itemCreator[markType] ? itemCreator[markType](attrs) : factory_1.Factory.createGraphicComponent(markType, attrs);
|
|
33
|
+
return mark.emit(enums_1.HOOK_EVENT.AFTER_CREATE_VRENDER_MARK), graphicItem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function createGlyphGraphicItem(mark, glyphMeta, attrs = {}) {
|
|
37
|
+
mark.emit(enums_1.HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);
|
|
38
|
+
const graphicItem = (0, vrender_1.createGlyph)(attrs), glyphMarks = glyphMeta.getMarks(), subGraphics = Object.keys(glyphMarks).map((name => {
|
|
39
|
+
const graphic = itemCreator[glyphMarks[name]]();
|
|
40
|
+
return graphic.name = name, graphic;
|
|
41
|
+
}));
|
|
42
|
+
return graphicItem.setSubGraphic(subGraphics), mark.emit(enums_1.HOOK_EVENT.AFTER_CREATE_VRENDER_MARK),
|
|
43
|
+
graphicItem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.isMarkType = isMarkType, exports.createGraphicItem = createGraphicItem,
|
|
47
|
+
exports.createGlyphGraphicItem = createGlyphGraphicItem;
|
|
48
|
+
|
|
49
|
+
const removeGraphicItem = graphicItem => {
|
|
50
|
+
graphicItem && (graphicItem[constants_1.BridgeElementKey] = null, graphicItem.release(),
|
|
51
|
+
graphicItem.parent && graphicItem.parent.removeChild(graphicItem));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.removeGraphicItem = removeGraphicItem;
|
|
55
|
+
|
|
56
|
+
const getMarkTypeOfLarge = markType => markType === enums_1.GrammarMarkType.rect ? enums_1.GrammarMarkType.largeRects : markType === enums_1.GrammarMarkType.symbol ? enums_1.GrammarMarkType.largeSymbols : markType;
|
|
57
|
+
|
|
58
|
+
exports.getMarkTypeOfLarge = getMarkTypeOfLarge;
|
|
59
|
+
//# sourceMappingURL=graphic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/graphic.ts"],"names":[],"mappings":";;;AAGA,+CAiB2B;AAC3B,oCAAuD;AACvD,4CAAgD;AAChD,qDAAiD;AACjD,yDAAqD;AACrD,gDAA6C;AAE7C,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,sBAAY;IACpB,GAAG,EAAE,mBAAS;IACd,KAAK,EAAE,qBAAW;IAClB,SAAS,EAAE,yBAAe;IAC1B,IAAI,EAAE,oBAAU;IAChB,KAAK,EAAE,qBAAW;IAClB,KAAK,EAAE,qBAAW;IAClB,MAAM,EAAE,sBAAY;IACpB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,IAAI,EAAE,oBAAU;IAChB,KAAK,EAAE,oBAAU;IACjB,MAAM,EAAE,sBAAY;IACpB,IAAI,EAAE,oBAAU;IAChB,QAAQ,EAAE,wBAAc;IACxB,OAAO,EAAE,uBAAa;IACtB,IAAI,EAAE,sBAAY;IAClB,QAAQ,EAAE,oBAAU;CACrB,CAAC;AAEK,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,OAAO,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEF,SAAgB,iBAAiB,CAAC,IAAW,EAAE,QAAgB,EAAE,QAAa,EAAE;IAC9E,IAAI,CAAC,IAAI,CAAC,kBAAU,CAAC,0BAA0B,CAAC,CAAC;IAEjD,IAAI,QAAQ,KAAK,uBAAe,CA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,WAAW,CAAC,4BAAgB,CAAC,GAAG,IAAI,CAAC;QACrC,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,WAAW,CAAC,MAAM,EAAE;YACtB,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SAC7C;KACF;AACH,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B;AAEK,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACrD,IAAI,QAAQ,KAAK,uBAAe,CAAC,IAAI,EAAE;QACrC,OAAO,uBAAe,CAAC,UAAU,CAAC;KACnC;IAED,IAAI,QAAQ,KAAK,uBAAe,CAAC,MAAM,EAAE;QACvC,OAAO,uBAAe,CAAC,YAAY,CAAC;KACrC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B","file":"graphic.js","sourcesContent":["import type { IGlyphMeta, IMark } from '../../types';\nimport type { IGraphic } from '@visactor/vrender';\n// eslint-disable-next-line no-duplicate-imports\nimport {\n createArc,\n createArea,\n createGroup,\n createImage,\n createRect3d,\n createLine,\n createPath,\n createRect,\n createSymbol,\n createRichText,\n createText,\n createPolygon,\n createGlyph,\n createArc3d,\n createPyramid3d,\n createCircle\n} from '@visactor/vrender';\nimport { HOOK_EVENT, GrammarMarkType } from '../enums';\nimport { BridgeElementKey } from '../constants';\nimport { LargeRects } from '../mark/large-rects';\nimport { LargeSymbols } from '../mark/large-symbols';\nimport { Factory } from '../../core/factory';\n\nconst itemCreator = {\n circle: createCircle,\n arc: createArc,\n arc3d: createArc3d,\n pyramid3d: createPyramid3d,\n area: createArea,\n group: createGroup,\n image: createImage,\n rect3d: createRect3d,\n line: createLine,\n path: createPath,\n rect: createRect,\n rule: createLine,\n shape: createPath,\n symbol: createSymbol,\n text: createText,\n richtext: createRichText,\n polygon: createPolygon,\n cell: createSymbol,\n interval: createRect\n};\n\nexport const isMarkType = (type: string) => {\n return !!itemCreator[type];\n};\n\nexport function createGraphicItem(mark: IMark, markType: string, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n if (markType === GrammarMarkType.largeRects) {\n return new LargeRects(attrs);\n } else if (markType === GrammarMarkType.largeSymbols) {\n return new LargeSymbols(attrs);\n }\n\n const graphicItem: IGraphic = itemCreator[markType]\n ? itemCreator[markType](attrs)\n : Factory.createGraphicComponent(markType, attrs);\n\n mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK);\n return graphicItem;\n}\n\nexport function createGlyphGraphicItem(mark: IMark, glyphMeta: IGlyphMeta, attrs: any = {}) {\n mark.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_MARK);\n\n const graphicItem = createGlyph(attrs);\n const glyphMarks = glyphMeta.getMarks();\n const subGraphics: IGraphic[] = Object.keys(glyphMarks).map(name => {\n const graphic = itemCreator[glyphMarks[name]]();\n graphic.name = name;\n return graphic;\n });\n graphicItem.setSubGraphic(subGraphics);\n\n mark.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_MARK);\n return graphicItem;\n}\n\nexport const removeGraphicItem = (graphicItem: IGraphic) => {\n if (graphicItem) {\n graphicItem[BridgeElementKey] = null;\n graphicItem.release();\n if (graphicItem.parent) {\n graphicItem.parent.removeChild(graphicItem);\n }\n }\n};\n\nexport const getMarkTypeOfLarge = (markType: string) => {\n if (markType === GrammarMarkType.rect) {\n return GrammarMarkType.largeRects;\n }\n\n if (markType === GrammarMarkType.symbol) {\n return GrammarMarkType.largeSymbols;\n }\n\n return markType;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function point(event: Event): number[];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.point = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils");
|
|
8
|
+
|
|
9
|
+
function point(event) {
|
|
10
|
+
[ "touches", "changedTouches", "targetTouches" ].forEach((touchKey => {
|
|
11
|
+
event[touchKey] && event[touchKey].length && Array.from(event[touchKey]).forEach((touch => {
|
|
12
|
+
defineSrPosition(touch, clientToLocal(touch), !1);
|
|
13
|
+
}));
|
|
14
|
+
}));
|
|
15
|
+
const pos = clientToLocal(event);
|
|
16
|
+
return defineSrPosition(event, pos);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function clientToLocal(e) {
|
|
20
|
+
return (0, vutils_1.isNil)(e.offsetX) ? (0, vutils_1.isNil)(e.x) ? e.changedTouches && e.changedTouches.length ? getChangedTouchesPos(e) : {
|
|
21
|
+
canvasX: 0,
|
|
22
|
+
canvasY: 0
|
|
23
|
+
} : getXYPos(e) : getOffsetPos(e);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function getOffsetPos(e) {
|
|
27
|
+
return {
|
|
28
|
+
canvasX: e.offsetX,
|
|
29
|
+
canvasY: e.offsetY
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getBoundingClientRectPos(e, el) {
|
|
34
|
+
const result = {
|
|
35
|
+
canvasX: 0,
|
|
36
|
+
canvasY: 0
|
|
37
|
+
}, rect = el.getBoundingClientRect(), currentWidth = rect.width, widthRatio = currentWidth / (el.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (el.offsetHeight || currentHeight);
|
|
38
|
+
return [ "touchstart", "touchmove", "touchend" ].includes(e.type) && e.changedTouches && e.changedTouches.length ? (result.canvasX = (e.changedTouches[0].clientX - rect.left - (el.clientLeft || 0)) / widthRatio,
|
|
39
|
+
result.canvasY = (e.changedTouches[0].clientY - rect.top - (el.clientTop || 0)) / heightRatio,
|
|
40
|
+
result.clientX = e.changedTouches[0].clientX, result.clientY = e.changedTouches[0].clientY) : (result.canvasX = (e.clientX - rect.left - (el.clientLeft || 0)) / widthRatio,
|
|
41
|
+
result.canvasY = (e.clientY - rect.top - (el.clientTop || 0)) / heightRatio), result;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getXYPos(e) {
|
|
45
|
+
return {
|
|
46
|
+
canvasX: e.x,
|
|
47
|
+
canvasY: e.y
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getChangedTouchesPos(e) {
|
|
52
|
+
return {
|
|
53
|
+
canvasX: e.changedTouches[0].x,
|
|
54
|
+
canvasY: e.changedTouches[0].y
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function defineSrPosition(event, pos, client = !0) {
|
|
59
|
+
return (0, vutils_1.isValidNumber)(pos.canvasX) && Object.defineProperty(event, "canvasX", {
|
|
60
|
+
value: pos.canvasX,
|
|
61
|
+
writable: !0
|
|
62
|
+
}), (0, vutils_1.isValidNumber)(pos.canvasY) && Object.defineProperty(event, "canvasY", {
|
|
63
|
+
value: pos.canvasY,
|
|
64
|
+
writable: !0
|
|
65
|
+
}), client && (0, vutils_1.isValidNumber)(pos.clientX) && Object.defineProperty(event, "clientX", {
|
|
66
|
+
value: pos.clientX,
|
|
67
|
+
writable: !0
|
|
68
|
+
}), client && (0, vutils_1.isValidNumber)(pos.clientY) && Object.defineProperty(event, "clientY", {
|
|
69
|
+
value: pos.clientY,
|
|
70
|
+
writable: !0
|
|
71
|
+
}), [ pos.canvasX, pos.canvasY ];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.point = point;
|
|
75
|
+
//# sourceMappingURL=point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graph/util/point.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AASxD,SAAgB,KAAK,CAAC,KAAY;IAChC,CAAC,SAAS,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAChE,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,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;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","file":"point.js","sourcesContent":["import { isValidNumber, isNil } from '@visactor/vutils';\n\ninterface EventPosition {\n canvasX: number;\n canvasY: number;\n clientX?: number;\n clientY?: number;\n}\n\nexport function point(event: Event) {\n ['touches', 'changedTouches', 'targetTouches'].forEach(touchKey => {\n if (event[touchKey] && event[touchKey].length) {\n Array.from(event[touchKey]).forEach(touch => {\n const touchPosition = clientToLocal(touch as Event);\n defineSrPosition(touch, touchPosition, false);\n });\n }\n });\n\n const pos = clientToLocal(event);\n return defineSrPosition(event, pos);\n}\n\nfunction clientToLocal(e: Event): EventPosition {\n // For IE6+, chrome, safari, opera. (When will ff support offsetX?)\n if (!isNil((e as any).offsetX)) {\n return getOffsetPos(e);\n }\n\n // if (el && el.getBoundingClientRect) {\n // return getBoundingClientRectPos(e, el);\n // }\n\n // for miniApp\n if (!isNil((e as any).x)) {\n return getXYPos(e);\n }\n\n // for miniApp\n if ((e as any).changedTouches && (e as any).changedTouches.length) {\n return getChangedTouchesPos(e);\n }\n\n // For some other device, e.g., IOS safari.\n return {\n canvasX: 0,\n canvasY: 0\n };\n}\n\nfunction getOffsetPos(e: any) {\n return {\n canvasX: e.offsetX,\n canvasY: e.offsetY\n };\n}\n\nfunction getBoundingClientRectPos(e: any, el: HTMLElement) {\n const result: EventPosition = { canvasX: 0, canvasY: 0 };\n const rect = el.getBoundingClientRect();\n const currentWidth = rect.width;\n const originWidth = el.offsetWidth || currentWidth;\n const widthRatio = currentWidth / originWidth;\n const currentHeight = rect.height;\n const originHeight = el.offsetHeight || currentHeight;\n const heightRatio = currentHeight / originHeight;\n if (['touchstart', 'touchmove', 'touchend'].includes(e.type) && e.changedTouches && e.changedTouches.length) {\n result.canvasX = (e.changedTouches[0].clientX - rect.left - (el.clientLeft || 0)) / widthRatio;\n result.canvasY = (e.changedTouches[0].clientY - rect.top - (el.clientTop || 0)) / heightRatio;\n result.clientX = e.changedTouches[0].clientX;\n result.clientY = e.changedTouches[0].clientY;\n } else {\n result.canvasX = (e.clientX - rect.left - (el.clientLeft || 0)) / widthRatio;\n result.canvasY = (e.clientY - rect.top - (el.clientTop || 0)) / heightRatio;\n }\n return result;\n}\n\nfunction getXYPos(e: any) {\n return { canvasX: e.x, canvasY: e.y };\n}\n\nfunction getChangedTouchesPos(e: any) {\n return { canvasX: e.changedTouches[0].x, canvasY: e.changedTouches[0].y };\n}\n\nfunction defineSrPosition(event: any, pos: EventPosition, client = true) {\n isValidNumber(pos.canvasX) &&\n Object.defineProperty(event, 'canvasX', {\n value: pos.canvasX,\n writable: true\n });\n isValidNumber(pos.canvasY) &&\n Object.defineProperty(event, 'canvasY', {\n value: pos.canvasY,\n writable: true\n });\n client &&\n isValidNumber(pos.clientX) &&\n Object.defineProperty(event, 'clientX', {\n value: pos.clientX,\n writable: true\n });\n client &&\n isValidNumber(pos.clientY) &&\n Object.defineProperty(event, 'clientY', {\n value: pos.clientY,\n writable: true\n });\n return [pos.canvasX, pos.canvasY];\n}\n"]}
|
package/cjs/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const version = "0.7.0";
|
|
2
|
+
export * from './graph';
|
|
3
|
+
export { View } from './view';
|
|
4
|
+
export { parseFunctionType, invokeFunctionType } from './parse/util';
|
|
5
|
+
export { GrammarBase } from './view/grammar-base';
|
|
6
|
+
export * from './util/text';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export { Factory } from './core/factory';
|
|
9
|
+
export { SIGNAL_AUTOFIT, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_VIEW_HEIGHT, SIGNAL_VIEW_WIDTH, SIGNAL_WIDTH, SIGNAL_VIEW_BOX } from './view/constants';
|
|
10
|
+
export { ThemeManager } from './theme/theme-manager';
|
|
11
|
+
export * from './glyph';
|
|
12
|
+
export * from './component';
|
|
13
|
+
export * from './transforms';
|
|
14
|
+
export * from './graph/animation/animation';
|
package/cjs/index.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __exportStar = this && this.__exportStar || function(m, exports) {
|
|
15
|
+
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.View = exports.version = void 0,
|
|
21
|
+
exports.version = "0.7.0", __exportStar(require("./graph"), exports);
|
|
22
|
+
|
|
23
|
+
var view_1 = require("./view");
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, "View", {
|
|
26
|
+
enumerable: !0,
|
|
27
|
+
get: function() {
|
|
28
|
+
return view_1.View;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
var util_1 = require("./parse/util");
|
|
33
|
+
|
|
34
|
+
Object.defineProperty(exports, "parseFunctionType", {
|
|
35
|
+
enumerable: !0,
|
|
36
|
+
get: function() {
|
|
37
|
+
return util_1.parseFunctionType;
|
|
38
|
+
}
|
|
39
|
+
}), Object.defineProperty(exports, "invokeFunctionType", {
|
|
40
|
+
enumerable: !0,
|
|
41
|
+
get: function() {
|
|
42
|
+
return util_1.invokeFunctionType;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var grammar_base_1 = require("./view/grammar-base");
|
|
47
|
+
|
|
48
|
+
Object.defineProperty(exports, "GrammarBase", {
|
|
49
|
+
enumerable: !0,
|
|
50
|
+
get: function() {
|
|
51
|
+
return grammar_base_1.GrammarBase;
|
|
52
|
+
}
|
|
53
|
+
}), __exportStar(require("./util/text"), exports), __exportStar(require("./types"), exports);
|
|
54
|
+
|
|
55
|
+
var factory_1 = require("./core/factory");
|
|
56
|
+
|
|
57
|
+
Object.defineProperty(exports, "Factory", {
|
|
58
|
+
enumerable: !0,
|
|
59
|
+
get: function() {
|
|
60
|
+
return factory_1.Factory;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
var constants_1 = require("./view/constants");
|
|
65
|
+
|
|
66
|
+
Object.defineProperty(exports, "SIGNAL_AUTOFIT", {
|
|
67
|
+
enumerable: !0,
|
|
68
|
+
get: function() {
|
|
69
|
+
return constants_1.SIGNAL_AUTOFIT;
|
|
70
|
+
}
|
|
71
|
+
}), Object.defineProperty(exports, "SIGNAL_HEIGHT", {
|
|
72
|
+
enumerable: !0,
|
|
73
|
+
get: function() {
|
|
74
|
+
return constants_1.SIGNAL_HEIGHT;
|
|
75
|
+
}
|
|
76
|
+
}), Object.defineProperty(exports, "SIGNAL_PADDING", {
|
|
77
|
+
enumerable: !0,
|
|
78
|
+
get: function() {
|
|
79
|
+
return constants_1.SIGNAL_PADDING;
|
|
80
|
+
}
|
|
81
|
+
}), Object.defineProperty(exports, "SIGNAL_VIEW_HEIGHT", {
|
|
82
|
+
enumerable: !0,
|
|
83
|
+
get: function() {
|
|
84
|
+
return constants_1.SIGNAL_VIEW_HEIGHT;
|
|
85
|
+
}
|
|
86
|
+
}), Object.defineProperty(exports, "SIGNAL_VIEW_WIDTH", {
|
|
87
|
+
enumerable: !0,
|
|
88
|
+
get: function() {
|
|
89
|
+
return constants_1.SIGNAL_VIEW_WIDTH;
|
|
90
|
+
}
|
|
91
|
+
}), Object.defineProperty(exports, "SIGNAL_WIDTH", {
|
|
92
|
+
enumerable: !0,
|
|
93
|
+
get: function() {
|
|
94
|
+
return constants_1.SIGNAL_WIDTH;
|
|
95
|
+
}
|
|
96
|
+
}), Object.defineProperty(exports, "SIGNAL_VIEW_BOX", {
|
|
97
|
+
enumerable: !0,
|
|
98
|
+
get: function() {
|
|
99
|
+
return constants_1.SIGNAL_VIEW_BOX;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
var theme_manager_1 = require("./theme/theme-manager");
|
|
104
|
+
|
|
105
|
+
Object.defineProperty(exports, "ThemeManager", {
|
|
106
|
+
enumerable: !0,
|
|
107
|
+
get: function() {
|
|
108
|
+
return theme_manager_1.ThemeManager;
|
|
109
|
+
}
|
|
110
|
+
}), __exportStar(require("./glyph"), exports), __exportStar(require("./component"), exports),
|
|
111
|
+
__exportStar(require("./transforms"), exports), __exportStar(require("./graph/animation/animation"), exports);
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B,0CAAwB;AAExB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.7.0\";\n\nexport * from './graph';\n\nexport { View } from './view';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CoordinateType, IPolarCoordinate, ICartesianCoordinate } from '@visactor/vgrammar-coordinate';
|
|
2
|
+
import { CartesianCoordinate, PolarCoordinate } from '@visactor/vgrammar-coordinate';
|
|
3
|
+
import type { IGrammarBase, IView } from '../types';
|
|
4
|
+
import type { CoordinateSpec } from '../types/coordinate';
|
|
5
|
+
export declare function createCoordinate(type: CoordinateType): CartesianCoordinate | PolarCoordinate;
|
|
6
|
+
export declare function parseCoordinate(spec: CoordinateSpec, view: IView): IGrammarBase[];
|
|
7
|
+
export declare function configureCoordinate(spec: CoordinateSpec, coordinate: IPolarCoordinate | ICartesianCoordinate, parameters: any): void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.configureCoordinate = exports.parseCoordinate = exports.createCoordinate = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), vgrammar_coordinate_1 = require("@visactor/vgrammar-coordinate"), util_1 = require("./util");
|
|
8
|
+
|
|
9
|
+
function createCoordinate(type) {
|
|
10
|
+
switch (type) {
|
|
11
|
+
case "cartesian":
|
|
12
|
+
default:
|
|
13
|
+
return new vgrammar_coordinate_1.CartesianCoordinate;
|
|
14
|
+
|
|
15
|
+
case "polar":
|
|
16
|
+
return new vgrammar_coordinate_1.PolarCoordinate;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function parseCoordinate(spec, view) {
|
|
21
|
+
let dependencies = [];
|
|
22
|
+
return [ "start", "end", "origin", "translate", "rotate", "scale", "transpose" ].forEach((key => {
|
|
23
|
+
dependencies = dependencies.concat((0, util_1.parseFunctionType)(spec[key], view));
|
|
24
|
+
})), dependencies;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function configureCoordinate(spec, coordinate, parameters) {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
29
|
+
!(0, vutils_1.isNil)(spec.start) && coordinate.start(null !== (_a = (0, util_1.invokeFunctionType)(spec.start, parameters)) && void 0 !== _a ? _a : [ 0, 0 ]),
|
|
30
|
+
!(0, vutils_1.isNil)(spec.end) && coordinate.end(null !== (_b = (0, util_1.invokeFunctionType)(spec.end, parameters)) && void 0 !== _b ? _b : [ 0, 0 ]),
|
|
31
|
+
!(0, vutils_1.isNil)(spec.origin) && coordinate.origin(null !== (_c = (0, util_1.invokeFunctionType)(spec.origin, parameters)) && void 0 !== _c ? _c : [ 0, 0 ]);
|
|
32
|
+
const transforms = [];
|
|
33
|
+
if (!(0, vutils_1.isNil)(spec.translate)) {
|
|
34
|
+
const translate = (0, util_1.invokeFunctionType)(spec.translate, parameters);
|
|
35
|
+
transforms.push({
|
|
36
|
+
type: "translate",
|
|
37
|
+
offset: {
|
|
38
|
+
x: null !== (_d = null == translate ? void 0 : translate[0]) && void 0 !== _d ? _d : 0,
|
|
39
|
+
y: null !== (_e = null == translate ? void 0 : translate[1]) && void 0 !== _e ? _e : 0
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (!(0, vutils_1.isNil)(spec.rotate)) {
|
|
44
|
+
const rotate = (0, util_1.invokeFunctionType)(spec.rotate, parameters);
|
|
45
|
+
transforms.push({
|
|
46
|
+
type: "rotate",
|
|
47
|
+
angle: null != rotate ? rotate : 0
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (!(0, vutils_1.isNil)(spec.scale)) {
|
|
51
|
+
const scale = (0, util_1.invokeFunctionType)(spec.scale, parameters);
|
|
52
|
+
transforms.push({
|
|
53
|
+
type: "scale",
|
|
54
|
+
scale: {
|
|
55
|
+
x: null !== (_f = null == scale ? void 0 : scale[0]) && void 0 !== _f ? _f : 1,
|
|
56
|
+
y: null !== (_g = null == scale ? void 0 : scale[1]) && void 0 !== _g ? _g : 1
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (!(0, vutils_1.isNil)(spec.transpose)) {
|
|
61
|
+
(0, util_1.invokeFunctionType)(spec.transpose, parameters) && transforms.push({
|
|
62
|
+
type: "transpose"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
coordinate.applyTransforms(transforms);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exports.createCoordinate = createCoordinate, exports.parseCoordinate = parseCoordinate,
|
|
69
|
+
exports.configureCoordinate = configureCoordinate;
|
|
70
|
+
//# sourceMappingURL=coordinate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/coordinate.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAQzC,uEAAqF;AAGrF,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L,KAAK,CAAG,CAAC,CAAC,mCAAI,CAAC,EAAE,EAAE,CAAC,CAAC;KACvF;IACD,IAAI,CAAC,IAAA,cAAK,EAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAC1B,MAAM,SAAS,GAAG,IAAA,yBAAkB,EAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjE,IAAI,SAAS,EAAE;YACb,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;SACxC;KACF;IACD,UAAU,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AA9BD,kDA8BC","file":"coordinate.js","sourcesContent":["import { isNil } from '@visactor/vutils';\nimport type {\n CoordinateType,\n CoordinateTransform,\n IPolarCoordinate,\n ICartesianCoordinate\n} from '@visactor/vgrammar-coordinate';\n// eslint-disable-next-line no-duplicate-imports\nimport { CartesianCoordinate, PolarCoordinate } from '@visactor/vgrammar-coordinate';\nimport type { IGrammarBase, IView } from '../types';\nimport type { CoordinateSpec } from '../types/coordinate';\nimport { invokeFunctionType, parseFunctionType } from './util';\n\nexport function createCoordinate(type: CoordinateType) {\n switch (type) {\n case 'cartesian':\n return new CartesianCoordinate();\n case 'polar':\n return new PolarCoordinate();\n default:\n return new CartesianCoordinate();\n }\n}\n\nexport function parseCoordinate(spec: CoordinateSpec, view: IView) {\n const parsedKeys = ['start', 'end', 'origin', 'translate', 'rotate', 'scale', 'transpose'];\n let dependencies: IGrammarBase[] = [];\n parsedKeys.forEach(key => {\n dependencies = dependencies.concat(parseFunctionType(spec[key], view));\n });\n return dependencies;\n}\n\nexport function configureCoordinate(\n spec: CoordinateSpec,\n coordinate: IPolarCoordinate | ICartesianCoordinate,\n parameters: any\n) {\n !isNil(spec.start) &&\n (coordinate as ICartesianCoordinate).start(invokeFunctionType(spec.start, parameters) ?? [0, 0]);\n !isNil(spec.end) && (coordinate as ICartesianCoordinate).end(invokeFunctionType(spec.end, parameters) ?? [0, 0]);\n !isNil(spec.origin) && (coordinate as IPolarCoordinate).origin(invokeFunctionType(spec.origin, parameters) ?? [0, 0]);\n\n const transforms: CoordinateTransform[] = [];\n if (!isNil(spec.translate)) {\n const translate = invokeFunctionType(spec.translate, parameters);\n transforms.push({ type: 'translate', offset: { x: translate?.[0] ?? 0, y: translate?.[1] ?? 0 } });\n }\n if (!isNil(spec.rotate)) {\n const rotate = invokeFunctionType(spec.rotate, parameters);\n transforms.push({ type: 'rotate', angle: rotate ?? 0 });\n }\n if (!isNil(spec.scale)) {\n const scale = invokeFunctionType(spec.scale, parameters);\n transforms.push({ type: 'scale', scale: { x: scale?.[0] ?? 1, y: scale?.[1] ?? 1 } });\n }\n if (!isNil(spec.transpose)) {\n const transpose = invokeFunctionType(spec.transpose, parameters);\n if (transpose) {\n transforms.push({ type: 'transpose' });\n }\n }\n coordinate.applyTransforms(transforms);\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { debounce, throttle } from '@visactor/vutils';
|
|
2
|
+
import type { EventSourceType, ParsedViewEventSpec, ParsedWindowEventSpec, EventCallback, IElement } from '../types';
|
|
3
|
+
export declare const generateFilterByMark: (evtSpec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec>) => (el: IElement) => boolean;
|
|
4
|
+
export declare const parseHandler: (callback: EventCallback, config: {
|
|
5
|
+
debounce?: number;
|
|
6
|
+
throttle?: number;
|
|
7
|
+
}) => (...args: any[]) => any;
|
|
8
|
+
export declare const parseEventSelector: (selector: string, source?: EventSourceType) => Partial<ParsedViewEventSpec | ParsedWindowEventSpec>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.parseEventSelector = exports.parseHandler = exports.generateFilterByMark = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), graphic_1 = require("../graph/util/graphic"), constants_1 = require("../view/constants"), generateFilterByMark = evtSpec => (0,
|
|
8
|
+
vutils_1.isNil)(evtSpec.markId) ? el => el && el.mark.id() === evtSpec.markId : (0,
|
|
9
|
+
vutils_1.isNil)(evtSpec.markName) ? el => el && el.mark.name() === evtSpec.markName : (0,
|
|
10
|
+
vutils_1.isNil)(evtSpec.type) ? el => el && el.mark.markType === evtSpec.type : () => !0;
|
|
11
|
+
|
|
12
|
+
exports.generateFilterByMark = generateFilterByMark;
|
|
13
|
+
|
|
14
|
+
const parseHandler = (callback, config) => (null == config ? void 0 : config.debounce) ? (0,
|
|
15
|
+
vutils_1.debounce)(callback, config.debounce) : (null == config ? void 0 : config.throttle) ? (0,
|
|
16
|
+
vutils_1.throttle)(callback, config.throttle) : callback;
|
|
17
|
+
|
|
18
|
+
exports.parseHandler = parseHandler;
|
|
19
|
+
|
|
20
|
+
const JOIN_SYMBOL = ":", NAME_PREFIX = "@", ID_PREFIX = "#", parseEventSelector = (selector, source = constants_1.EVENT_SOURCE_VIEW) => {
|
|
21
|
+
const spec = {}, splitArr = selector.split(":");
|
|
22
|
+
if (2 === splitArr.length) {
|
|
23
|
+
const [space, eventType] = splitArr;
|
|
24
|
+
"#" === space[0] ? (spec.markId = space.slice(1), spec.source = source) : "@" === space[0] ? (spec.markName = space.slice(1),
|
|
25
|
+
spec.source = source) : (0, graphic_1.isMarkType)(space) ? (spec.markType = space,
|
|
26
|
+
spec.source = source) : space === constants_1.EVENT_SOURCE_WINDOW ? spec.source = constants_1.EVENT_SOURCE_WINDOW : spec.source = source,
|
|
27
|
+
spec.type = eventType;
|
|
28
|
+
} else 1 === splitArr.length && (spec.type = selector, spec.source = source);
|
|
29
|
+
return spec;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.parseEventSelector = parseEventSelector;
|
|
33
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/event.ts"],"names":[],"mappings":";;;AAAA,6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AO,IAAI,CAAC;AACd,CAAC,CAAC;AAnCW,QAAA,kBAAkB,sBAmC7B","file":"event.js","sourcesContent":["import { debounce, isNil, throttle } from '@visactor/vutils';\nimport type {\n EventSourceType,\n ParsedViewEventSpec,\n ParsedWindowEventSpec,\n EventCallback,\n MarkType,\n IElement\n} from '../types';\nimport { isMarkType } from '../graph/util/graphic';\nimport { EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW } from '../view/constants';\n\nexport const generateFilterByMark = (evtSpec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec>) => {\n if (isNil(evtSpec.markId)) {\n return (el: IElement) => {\n return el && el.mark.id() === evtSpec.markId;\n };\n }\n\n if (isNil(evtSpec.markName)) {\n return (el: IElement) => {\n return el && el.mark.name() === evtSpec.markName;\n };\n }\n\n if (isNil(evtSpec.type)) {\n return (el: IElement) => {\n return el && el.mark.markType === evtSpec.type;\n };\n }\n\n return () => true;\n};\n\nexport const parseHandler = (callback: EventCallback, config: { debounce?: number; throttle?: number }) => {\n if (config?.debounce) {\n return debounce(callback, config.debounce);\n }\n\n if (config?.throttle) {\n return throttle(callback, config.throttle);\n }\n\n return callback;\n};\n\nconst JOIN_SYMBOL = ':';\nconst NAME_PREFIX = '@';\nconst ID_PREFIX = '#';\n\n/**\n * Parse an event selector string.\n * Supported rules:\n * 1. mousedown\n * 2. rect:mousedown\n * 3. window:mousemove\n * 4. @foo:mousedown\n * Returns an event stream definitions.\n */\nexport const parseEventSelector = (\n selector: string,\n source: EventSourceType = EVENT_SOURCE_VIEW\n): Partial<ParsedViewEventSpec | ParsedWindowEventSpec> => {\n const spec: Partial<ParsedViewEventSpec | ParsedWindowEventSpec> = {};\n\n const splitArr = selector.split(JOIN_SYMBOL);\n\n if (splitArr.length === 2) {\n const [space, eventType] = splitArr;\n\n if (space[0] === ID_PREFIX) {\n // events on marks id\n spec.markId = space.slice(1);\n spec.source = source;\n } else if (space[0] === NAME_PREFIX) {\n // events on marks name\n spec.markName = space.slice(1);\n spec.source = source;\n } else if (isMarkType(space)) {\n spec.markType = space as MarkType;\n spec.source = source;\n } else if (space === EVENT_SOURCE_WINDOW) {\n spec.source = EVENT_SOURCE_WINDOW;\n } else {\n spec.source = source;\n }\n\n spec.type = eventType;\n } else if (splitArr.length === 1) {\n spec.type = selector;\n spec.source = source;\n }\n\n return spec;\n};\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IGrammarBase, IView, MarkFunctionType, ScaleEncodeType, FieldEncodeType } from '../types';
|
|
2
|
+
export declare function isScaleEncode(encode: any): encode is ScaleEncodeType;
|
|
3
|
+
export declare function isFieldEncode(encode: any): encode is FieldEncodeType;
|
|
4
|
+
export declare function parseEncodeType(encoder: MarkFunctionType<any> | ScaleEncodeType, view: IView): IGrammarBase[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.parseEncodeType = exports.isFieldEncode = exports.isScaleEncode = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), util_1 = require("./util");
|
|
8
|
+
|
|
9
|
+
function isScaleEncode(encode) {
|
|
10
|
+
return !!(null == encode ? void 0 : encode.scale);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function isFieldEncode(encode) {
|
|
14
|
+
return !!(null == encode ? void 0 : encode.field);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function parseEncodeType(encoder, view) {
|
|
18
|
+
if (!encoder) return [];
|
|
19
|
+
let dependencies = [];
|
|
20
|
+
return encoder.scale && (dependencies = (0, util_1.isGrammar)(encoder.scale) ? [ encoder.scale ] : (0,
|
|
21
|
+
vutils_1.array)(view.getScaleById(encoder.scale))), dependencies.concat((0, util_1.parseFunctionType)(encoder, view));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.isScaleEncode = isScaleEncode, exports.isFieldEncode = isFieldEncode, exports.parseEncodeType = parseEncodeType;
|
|
25
|
+
//# sourceMappingURL=mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/mark.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,iCAAsD;AAEtD,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;AACzB,CAAC;AAFD,sCAEC;AAED,SAAgB,aAAa,CAAC,MAAW;IACvC,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;AACzB,CAAC;AAFD,sCAEC;AAED,SAAgB,eAAe,CAAC,OAAgD,EAAE,IAAW;IAC3F,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,EAAE,CAAC;KACX;IACD,IAAI,YAAY,GAAmB,EAAE,CAAC;IACtC,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,IAAI,IAAA,gBAAS,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC5B,YAAY,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAChC;aAAM;YACL,YAAY,GAAG,IAAA,cAAK,EAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAiB,CAAC,CAAC;SACxE;KACF;IACD,OAAO,YAAY,CAAC,MAAM,CAAC,IAAA,wBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC;AAbD,0CAaC","file":"mark.js","sourcesContent":["import { array } from '@visactor/vutils';\nimport type { IGrammarBase, IView, MarkFunctionType, ScaleEncodeType, FieldEncodeType } from '../types';\nimport { isGrammar, parseFunctionType } from './util';\n\nexport function isScaleEncode(encode: any): encode is ScaleEncodeType {\n return !!encode?.scale;\n}\n\nexport function isFieldEncode(encode: any): encode is FieldEncodeType {\n return !!encode?.field;\n}\n\nexport function parseEncodeType(encoder: MarkFunctionType<any> | ScaleEncodeType, view: IView): IGrammarBase[] {\n if (!encoder) {\n return [];\n }\n let dependencies: IGrammarBase[] = [];\n if (encoder.scale) {\n if (isGrammar(encoder.scale)) {\n dependencies = [encoder.scale];\n } else {\n dependencies = array(view.getScaleById(encoder.scale) as IGrammarBase);\n }\n }\n return dependencies.concat(parseFunctionType(encoder, view));\n}\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IGrammarBase } from '../types';
|
|
2
|
+
export declare const parseOptionValue: (value: IGrammarBase | any, params: any) => any;
|
|
3
|
+
export declare const parseOptions: (options: Record<string, IGrammarBase | any> | Array<IGrammarBase | any>, params: any) => Record<string, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.parseOptions = exports.parseOptionValue = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), util_1 = require("./util"), parseOptionValue = (value, params) => (0,
|
|
8
|
+
util_1.isGrammar)(value) ? value.output() : value && (0, vutils_1.isObject)(value) ? (0,
|
|
9
|
+
vutils_1.isFunction)(value.callback) ? datum => value.callback(datum, params) : (0,
|
|
10
|
+
vutils_1.isFunction)(value.value) ? value.value(params) : value : value;
|
|
11
|
+
|
|
12
|
+
exports.parseOptionValue = parseOptionValue;
|
|
13
|
+
|
|
14
|
+
const parseOptions = (options, params) => options ? (0, vutils_1.isObject)(options) ? Object.keys(options).reduce(((res, key) => {
|
|
15
|
+
const option = options[key];
|
|
16
|
+
return res[key] = (0, exports.parseOptionValue)(option, params), res;
|
|
17
|
+
}), {}) : options.map((option => (0, exports.parseOptionValue)(option, params))) : options;
|
|
18
|
+
|
|
19
|
+
exports.parseOptions = parseOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/option.ts"],"names":[],"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EAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC;AAhBW,QAAA,YAAY,gBAgBvB","file":"option.js","sourcesContent":["import { isFunction, isObject } from '@visactor/vutils';\nimport type { IGrammarBase } from '../types';\nimport { isGrammar } from './util';\n\nexport const parseOptionValue = (value: IGrammarBase | any, params: any) => {\n if (isGrammar(value)) {\n return value.output();\n } else if (value && isObject<any>(value)) {\n if (isFunction(value.callback)) {\n return (datum: any) => {\n return value.callback(datum, params);\n };\n }\n\n if (isFunction(value.value)) {\n return value.value(params);\n }\n\n return value;\n }\n\n return value;\n};\n\nexport const parseOptions = (options: Record<string, IGrammarBase | any> | Array<IGrammarBase | any>, params: any) => {\n if (!options) {\n return options;\n }\n\n if (isObject(options)) {\n return Object.keys(options).reduce((res, key) => {\n const option = options[key];\n\n res[key] = parseOptionValue(option, params);\n\n return res;\n }, {});\n }\n\n return (options as Array<IGrammarBase | any>).map(option => parseOptionValue(option, params));\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IBaseScale } from '@visactor/vscale';
|
|
2
|
+
import type { IView } from '../types/view';
|
|
3
|
+
import type { IGrammarBase } from '../types/grammar';
|
|
4
|
+
import type { ScaleFunctionType, ScaleData, MultiScaleData, ScaleSpec, ScaleConfigureSpec, GrammarScaleType } from '../types/scale';
|
|
5
|
+
export declare function createScale(type: GrammarScaleType): IBaseScale;
|
|
6
|
+
export declare function parseScaleDomainRange(domain: ScaleFunctionType<any> | ScaleData | MultiScaleData, view: IView): IGrammarBase[];
|
|
7
|
+
export declare function parseScaleConfig(type: GrammarScaleType, config: ScaleConfigureSpec, view: IView): IGrammarBase[];
|
|
8
|
+
export declare function configureScale(spec: ScaleSpec, scale: IBaseScale, parameters: any): void;
|