@visactor/vgrammar-core 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -0
- package/README.zh-CN.md +11 -0
- package/cjs/component/axis.d.ts +26 -0
- package/cjs/component/axis.js +164 -0
- package/cjs/component/axis.js.map +1 -0
- package/cjs/component/crosshair.d.ts +50 -0
- package/cjs/component/crosshair.js +281 -0
- package/cjs/component/crosshair.js.map +1 -0
- package/cjs/component/datazoom.d.ts +19 -0
- package/cjs/component/datazoom.js +166 -0
- package/cjs/component/datazoom.js.map +1 -0
- package/cjs/component/grid.d.ts +27 -0
- package/cjs/component/grid.js +190 -0
- package/cjs/component/grid.js.map +1 -0
- package/cjs/component/index.d.ts +11 -0
- package/cjs/component/index.js +105 -0
- package/cjs/component/index.js.map +1 -0
- package/cjs/component/label.d.ts +19 -0
- package/cjs/component/label.js +121 -0
- package/cjs/component/label.js.map +1 -0
- package/cjs/component/legend.d.ts +26 -0
- package/cjs/component/legend.js +170 -0
- package/cjs/component/legend.js.map +1 -0
- package/cjs/component/player.d.ts +25 -0
- package/cjs/component/player.js +138 -0
- package/cjs/component/player.js.map +1 -0
- package/cjs/component/scale.d.ts +8 -0
- package/cjs/component/scale.js +25 -0
- package/cjs/component/scale.js.map +1 -0
- package/cjs/component/scrollbar.d.ts +23 -0
- package/cjs/component/scrollbar.js +187 -0
- package/cjs/component/scrollbar.js.map +1 -0
- package/cjs/component/slider.d.ts +19 -0
- package/cjs/component/slider.js +86 -0
- package/cjs/component/slider.js.map +1 -0
- package/cjs/component/title.d.ts +15 -0
- package/cjs/component/title.js +56 -0
- package/cjs/component/title.js.map +1 -0
- package/cjs/component/tooltip.d.ts +62 -0
- package/cjs/component/tooltip.js +305 -0
- package/cjs/component/tooltip.js.map +1 -0
- package/cjs/core/factory.d.ts +35 -0
- package/cjs/core/factory.js +73 -0
- package/cjs/core/factory.js.map +1 -0
- package/cjs/glyph/boxplot.d.ts +10 -0
- package/cjs/glyph/boxplot.js +418 -0
- package/cjs/glyph/boxplot.js.map +1 -0
- package/cjs/glyph/index.d.ts +7 -0
- package/cjs/glyph/index.js +64 -0
- package/cjs/glyph/index.js.map +1 -0
- package/cjs/glyph/link-path.d.ts +7 -0
- package/cjs/glyph/link-path.js +138 -0
- package/cjs/glyph/link-path.js.map +1 -0
- package/cjs/glyph/ripple.d.ts +1 -0
- package/cjs/glyph/ripple.js +44 -0
- package/cjs/glyph/ripple.js.map +1 -0
- package/cjs/glyph/tree-path.d.ts +7 -0
- package/cjs/glyph/tree-path.js +152 -0
- package/cjs/glyph/tree-path.js.map +1 -0
- package/cjs/glyph/violin.d.ts +1 -0
- package/cjs/glyph/violin.js +165 -0
- package/cjs/glyph/violin.js.map +1 -0
- package/cjs/glyph/wave.d.ts +1 -0
- package/cjs/glyph/wave.js +67 -0
- package/cjs/glyph/wave.js.map +1 -0
- package/cjs/graph/animation/animate.d.ts +48 -0
- package/cjs/graph/animation/animate.js +250 -0
- package/cjs/graph/animation/animate.js.map +1 -0
- package/cjs/graph/animation/animation/clip.d.ts +4 -0
- package/cjs/graph/animation/animation/clip.js +54 -0
- package/cjs/graph/animation/animation/clip.js.map +1 -0
- package/cjs/graph/animation/animation/fade.d.ts +4 -0
- package/cjs/graph/animation/animation/fade.js +42 -0
- package/cjs/graph/animation/animation/fade.js.map +1 -0
- package/cjs/graph/animation/animation/grow-cartesian.d.ts +7 -0
- package/cjs/graph/animation/animation/grow-cartesian.js +288 -0
- package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -0
- package/cjs/graph/animation/animation/grow-interval.d.ts +3 -0
- package/cjs/graph/animation/animation/grow-interval.js +194 -0
- package/cjs/graph/animation/animation/grow-interval.js.map +1 -0
- package/cjs/graph/animation/animation/grow-points.d.ts +7 -0
- package/cjs/graph/animation/animation/grow-points.js +118 -0
- package/cjs/graph/animation/animation/grow-points.js.map +1 -0
- package/cjs/graph/animation/animation/grow-polar.d.ts +5 -0
- package/cjs/graph/animation/animation/grow-polar.js +164 -0
- package/cjs/graph/animation/animation/grow-polar.js.map +1 -0
- package/cjs/graph/animation/animation/index.d.ts +11 -0
- package/cjs/graph/animation/animation/index.js +191 -0
- package/cjs/graph/animation/animation/index.js.map +1 -0
- package/cjs/graph/animation/animation/move.d.ts +3 -0
- package/cjs/graph/animation/animation/move.js +90 -0
- package/cjs/graph/animation/animation/move.js.map +1 -0
- package/cjs/graph/animation/animation/rotate.d.ts +3 -0
- package/cjs/graph/animation/animation/rotate.js +42 -0
- package/cjs/graph/animation/animation/rotate.js.map +1 -0
- package/cjs/graph/animation/animation/scale.d.ts +3 -0
- package/cjs/graph/animation/animation/scale.js +84 -0
- package/cjs/graph/animation/animation/scale.js.map +1 -0
- package/cjs/graph/animation/animation/update.d.ts +6 -0
- package/cjs/graph/animation/animation/update.js +22 -0
- package/cjs/graph/animation/animation/update.js.map +1 -0
- package/cjs/graph/animation/animator.d.ts +26 -0
- package/cjs/graph/animation/animator.js +88 -0
- package/cjs/graph/animation/animator.js.map +1 -0
- package/cjs/graph/animation/arranger.d.ts +13 -0
- package/cjs/graph/animation/arranger.js +38 -0
- package/cjs/graph/animation/arranger.js.map +1 -0
- package/cjs/graph/animation/attribute.d.ts +27 -0
- package/cjs/graph/animation/attribute.js +124 -0
- package/cjs/graph/animation/attribute.js.map +1 -0
- package/cjs/graph/animation/config.d.ts +5 -0
- package/cjs/graph/animation/config.js +92 -0
- package/cjs/graph/animation/config.js.map +1 -0
- package/cjs/graph/animation/morph.d.ts +12 -0
- package/cjs/graph/animation/morph.js +174 -0
- package/cjs/graph/animation/morph.js.map +1 -0
- package/cjs/graph/attributes/common.d.ts +2 -0
- package/cjs/graph/attributes/common.js +22 -0
- package/cjs/graph/attributes/common.js.map +1 -0
- package/cjs/graph/attributes/helpers.d.ts +17 -0
- package/cjs/graph/attributes/helpers.js +86 -0
- package/cjs/graph/attributes/helpers.js.map +1 -0
- package/cjs/graph/attributes/index.d.ts +10 -0
- package/cjs/graph/attributes/index.js +257 -0
- package/cjs/graph/attributes/index.js.map +1 -0
- package/cjs/graph/canvas-renderer.d.ts +34 -0
- package/cjs/graph/canvas-renderer.js +121 -0
- package/cjs/graph/canvas-renderer.js.map +1 -0
- package/cjs/graph/constants.d.ts +23 -0
- package/cjs/graph/constants.js +21 -0
- package/cjs/graph/constants.js.map +1 -0
- package/cjs/graph/element.d.ts +66 -0
- package/cjs/graph/element.js +297 -0
- package/cjs/graph/element.js.map +1 -0
- package/cjs/graph/enums.d.ts +153 -0
- package/cjs/graph/enums.js +85 -0
- package/cjs/graph/enums.js.map +1 -0
- package/cjs/graph/glyph-element.d.ts +53 -0
- package/cjs/graph/glyph-element.js +202 -0
- package/cjs/graph/glyph-element.js.map +1 -0
- package/cjs/graph/index.d.ts +3 -0
- package/cjs/graph/index.js +44 -0
- package/cjs/graph/index.js.map +1 -0
- package/cjs/graph/layout/grid.d.ts +3 -0
- package/cjs/graph/layout/grid.js +75 -0
- package/cjs/graph/layout/grid.js.map +1 -0
- package/cjs/graph/layout/layout.d.ts +3 -0
- package/cjs/graph/layout/layout.js +33 -0
- package/cjs/graph/layout/layout.js.map +1 -0
- package/cjs/graph/layout/relative.d.ts +3 -0
- package/cjs/graph/layout/relative.js +86 -0
- package/cjs/graph/layout/relative.js.map +1 -0
- package/cjs/graph/mark/differ.d.ts +20 -0
- package/cjs/graph/mark/differ.js +110 -0
- package/cjs/graph/mark/differ.js.map +1 -0
- package/cjs/graph/mark/encode.d.ts +10 -0
- package/cjs/graph/mark/encode.js +95 -0
- package/cjs/graph/mark/encode.js.map +1 -0
- package/cjs/graph/mark/large-rects.d.ts +10 -0
- package/cjs/graph/mark/large-rects.js +31 -0
- package/cjs/graph/mark/large-rects.js.map +1 -0
- package/cjs/graph/mark/large-symbols.d.ts +11 -0
- package/cjs/graph/mark/large-symbols.js +33 -0
- package/cjs/graph/mark/large-symbols.js.map +1 -0
- package/cjs/graph/mark-tree.d.ts +2 -0
- package/cjs/graph/mark-tree.js +21 -0
- package/cjs/graph/mark-tree.js.map +1 -0
- package/cjs/graph/util/element.d.ts +2 -0
- package/cjs/graph/util/element.js +10 -0
- package/cjs/graph/util/element.js.map +1 -0
- package/cjs/graph/util/env.d.ts +2 -0
- package/cjs/graph/util/env.js +14 -0
- package/cjs/graph/util/env.js.map +1 -0
- package/cjs/graph/util/events-extend.d.ts +5 -0
- package/cjs/graph/util/events-extend.js +18 -0
- package/cjs/graph/util/events-extend.js.map +1 -0
- package/cjs/graph/util/graphic.d.ts +9 -0
- package/cjs/graph/util/graphic.js +59 -0
- package/cjs/graph/util/graphic.js.map +1 -0
- package/cjs/graph/util/point.d.ts +1 -0
- package/cjs/graph/util/point.js +75 -0
- package/cjs/graph/util/point.js.map +1 -0
- package/cjs/index.d.ts +14 -0
- package/cjs/index.js +111 -0
- package/cjs/index.js.map +1 -0
- package/cjs/parse/coordinate.d.ts +7 -0
- package/cjs/parse/coordinate.js +70 -0
- package/cjs/parse/coordinate.js.map +1 -0
- package/cjs/parse/event.d.ts +8 -0
- package/cjs/parse/event.js +33 -0
- package/cjs/parse/event.js.map +1 -0
- package/cjs/parse/mark.d.ts +4 -0
- package/cjs/parse/mark.js +25 -0
- package/cjs/parse/mark.js.map +1 -0
- package/cjs/parse/option.d.ts +3 -0
- package/cjs/parse/option.js +19 -0
- package/cjs/parse/option.js.map +1 -0
- package/cjs/parse/scale.d.ts +8 -0
- package/cjs/parse/scale.js +365 -0
- package/cjs/parse/scale.js.map +1 -0
- package/cjs/parse/transform.d.ts +5 -0
- package/cjs/parse/transform.js +103 -0
- package/cjs/parse/transform.js.map +1 -0
- package/cjs/parse/util.d.ts +13 -0
- package/cjs/parse/util.js +82 -0
- package/cjs/parse/util.js.map +1 -0
- package/cjs/parse/view.d.ts +17 -0
- package/cjs/parse/view.js +108 -0
- package/cjs/parse/view.js.map +1 -0
- package/cjs/semantic-marks/cell.d.ts +13 -0
- package/cjs/semantic-marks/cell.js +61 -0
- package/cjs/semantic-marks/cell.js.map +1 -0
- package/cjs/semantic-marks/interval.d.ts +14 -0
- package/cjs/semantic-marks/interval.js +80 -0
- package/cjs/semantic-marks/interval.js.map +1 -0
- package/cjs/semantic-marks/text.d.ts +10 -0
- package/cjs/semantic-marks/text.js +25 -0
- package/cjs/semantic-marks/text.js.map +1 -0
- package/cjs/theme/common/component.d.ts +15 -0
- package/cjs/theme/common/component.js +493 -0
- package/cjs/theme/common/component.js.map +1 -0
- package/cjs/theme/common/constants.d.ts +1 -0
- package/cjs/theme/common/constants.js +6 -0
- package/cjs/theme/common/constants.js.map +1 -0
- package/cjs/theme/common/mark.d.ts +2 -0
- package/cjs/theme/common/mark.js +15 -0
- package/cjs/theme/common/mark.js.map +1 -0
- package/cjs/theme/dark.d.ts +2 -0
- package/cjs/theme/dark.js +94 -0
- package/cjs/theme/dark.js.map +1 -0
- package/cjs/theme/default.d.ts +2 -0
- package/cjs/theme/default.js +18 -0
- package/cjs/theme/default.js.map +1 -0
- package/cjs/theme/theme-manager.d.ts +8 -0
- package/cjs/theme/theme-manager.js +26 -0
- package/cjs/theme/theme-manager.js.map +1 -0
- package/cjs/transforms/data/bin.d.ts +2 -0
- package/cjs/transforms/data/bin.js +21 -0
- package/cjs/transforms/data/bin.js.map +1 -0
- package/cjs/transforms/data/circular-relation.d.ts +2 -0
- package/cjs/transforms/data/circular-relation.js +56 -0
- package/cjs/transforms/data/circular-relation.js.map +1 -0
- package/cjs/transforms/data/contour.d.ts +2 -0
- package/cjs/transforms/data/contour.js +115 -0
- package/cjs/transforms/data/contour.js.map +1 -0
- package/cjs/transforms/data/filter.d.ts +2 -0
- package/cjs/transforms/data/filter.js +10 -0
- package/cjs/transforms/data/filter.js.map +1 -0
- package/cjs/transforms/data/fold.d.ts +2 -0
- package/cjs/transforms/data/fold.js +24 -0
- package/cjs/transforms/data/fold.js.map +1 -0
- package/cjs/transforms/data/funnel.d.ts +2 -0
- package/cjs/transforms/data/funnel.js +25 -0
- package/cjs/transforms/data/funnel.js.map +1 -0
- package/cjs/transforms/data/join.d.ts +2 -0
- package/cjs/transforms/data/join.js +33 -0
- package/cjs/transforms/data/join.js.map +1 -0
- package/cjs/transforms/data/kde.d.ts +2 -0
- package/cjs/transforms/data/kde.js +90 -0
- package/cjs/transforms/data/kde.js.map +1 -0
- package/cjs/transforms/data/map.d.ts +2 -0
- package/cjs/transforms/data/map.js +23 -0
- package/cjs/transforms/data/map.js.map +1 -0
- package/cjs/transforms/data/pick.d.ts +2 -0
- package/cjs/transforms/data/pick.js +20 -0
- package/cjs/transforms/data/pick.js.map +1 -0
- package/cjs/transforms/data/pie.d.ts +2 -0
- package/cjs/transforms/data/pie.js +24 -0
- package/cjs/transforms/data/pie.js.map +1 -0
- package/cjs/transforms/data/range.d.ts +4 -0
- package/cjs/transforms/data/range.js +15 -0
- package/cjs/transforms/data/range.js.map +1 -0
- package/cjs/transforms/data/sort.d.ts +2 -0
- package/cjs/transforms/data/sort.js +17 -0
- package/cjs/transforms/data/sort.js.map +1 -0
- package/cjs/transforms/data/stack.d.ts +2 -0
- package/cjs/transforms/data/stack.js +74 -0
- package/cjs/transforms/data/stack.js.map +1 -0
- package/cjs/transforms/data/unfold.d.ts +2 -0
- package/cjs/transforms/data/unfold.js +49 -0
- package/cjs/transforms/data/unfold.js.map +1 -0
- package/cjs/transforms/index.d.ts +23 -0
- package/cjs/transforms/index.js +213 -0
- package/cjs/transforms/index.js.map +1 -0
- package/cjs/transforms/mark/dodge.d.ts +2 -0
- package/cjs/transforms/mark/dodge.js +81 -0
- package/cjs/transforms/mark/dodge.js.map +1 -0
- package/cjs/transforms/mark/jitter.d.ts +4 -0
- package/cjs/transforms/mark/jitter.js +53 -0
- package/cjs/transforms/mark/jitter.js.map +1 -0
- package/cjs/transforms/mark/lttb-sample.d.ts +2 -0
- package/cjs/transforms/mark/lttb-sample.js +68 -0
- package/cjs/transforms/mark/lttb-sample.js.map +1 -0
- package/cjs/transforms/mark/mark-overlap.d.ts +2 -0
- package/cjs/transforms/mark/mark-overlap.js +79 -0
- package/cjs/transforms/mark/mark-overlap.js.map +1 -0
- package/cjs/transforms/mark/symmetry.d.ts +2 -0
- package/cjs/transforms/mark/symmetry.js +25 -0
- package/cjs/transforms/mark/symmetry.js.map +1 -0
- package/cjs/transforms/util/util.d.ts +5 -0
- package/cjs/transforms/util/util.js +41 -0
- package/cjs/transforms/util/util.js.map +1 -0
- package/cjs/transforms/view/identifier.d.ts +2 -0
- package/cjs/transforms/view/identifier.js +17 -0
- package/cjs/transforms/view/identifier.js.map +1 -0
- package/cjs/types/animate.d.ts +224 -0
- package/cjs/types/animate.js +6 -0
- package/cjs/types/animate.js.map +1 -0
- package/cjs/types/base.d.ts +36 -0
- package/cjs/types/base.js +6 -0
- package/cjs/types/base.js.map +1 -0
- package/cjs/types/component.d.ts +240 -0
- package/cjs/types/component.js +6 -0
- package/cjs/types/component.js.map +1 -0
- package/cjs/types/coordinate.d.ts +15 -0
- package/cjs/types/coordinate.js +6 -0
- package/cjs/types/coordinate.js.map +1 -0
- package/cjs/types/data.d.ts +55 -0
- package/cjs/types/data.js +5 -0
- package/cjs/types/data.js.map +1 -0
- package/cjs/types/dataflow.d.ts +13 -0
- package/cjs/types/dataflow.js +6 -0
- package/cjs/types/dataflow.js.map +1 -0
- package/cjs/types/element.d.ts +117 -0
- package/cjs/types/element.js +6 -0
- package/cjs/types/element.js.map +1 -0
- package/cjs/types/event.d.ts +58 -0
- package/cjs/types/event.js +6 -0
- package/cjs/types/event.js.map +1 -0
- package/cjs/types/glyph.d.ts +29 -0
- package/cjs/types/glyph.js +6 -0
- package/cjs/types/glyph.js.map +1 -0
- package/cjs/types/grammar.d.ts +184 -0
- package/cjs/types/grammar.js +6 -0
- package/cjs/types/grammar.js.map +1 -0
- package/cjs/types/hooks.d.ts +45 -0
- package/cjs/types/hooks.js +6 -0
- package/cjs/types/hooks.js.map +1 -0
- package/cjs/types/index.d.ts +22 -0
- package/cjs/types/index.js +31 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/layout.d.ts +5 -0
- package/cjs/types/layout.js +6 -0
- package/cjs/types/layout.js.map +1 -0
- package/cjs/types/mark.d.ts +344 -0
- package/cjs/types/mark.js +6 -0
- package/cjs/types/mark.js.map +1 -0
- package/cjs/types/morph.d.ts +29 -0
- package/cjs/types/morph.js +6 -0
- package/cjs/types/morph.js.map +1 -0
- package/cjs/types/plot.d.ts +326 -0
- package/cjs/types/plot.js +6 -0
- package/cjs/types/plot.js.map +1 -0
- package/cjs/types/projection.d.ts +61 -0
- package/cjs/types/projection.js +6 -0
- package/cjs/types/projection.js.map +1 -0
- package/cjs/types/renderer.d.ts +19 -0
- package/cjs/types/renderer.js +6 -0
- package/cjs/types/renderer.js.map +1 -0
- package/cjs/types/scale.d.ts +111 -0
- package/cjs/types/scale.js +6 -0
- package/cjs/types/scale.js.map +1 -0
- package/cjs/types/signal.d.ts +20 -0
- package/cjs/types/signal.js +6 -0
- package/cjs/types/signal.js.map +1 -0
- package/cjs/types/theme.d.ts +41 -0
- package/cjs/types/theme.js +6 -0
- package/cjs/types/theme.js.map +1 -0
- package/cjs/types/transform.d.ts +291 -0
- package/cjs/types/transform.js +6 -0
- package/cjs/types/transform.js.map +1 -0
- package/cjs/types/view.d.ts +217 -0
- package/cjs/types/view.js +6 -0
- package/cjs/types/view.js.map +1 -0
- package/cjs/util/data.d.ts +3 -0
- package/cjs/util/data.js +64 -0
- package/cjs/util/data.js.map +1 -0
- package/cjs/util/grammar-heap.d.ts +14 -0
- package/cjs/util/grammar-heap.js +66 -0
- package/cjs/util/grammar-heap.js.map +1 -0
- package/cjs/util/text.d.ts +19 -0
- package/cjs/util/text.js +32 -0
- package/cjs/util/text.js.map +1 -0
- package/cjs/util/unique-list.d.ts +12 -0
- package/cjs/util/unique-list.js +37 -0
- package/cjs/util/unique-list.js.map +1 -0
- package/cjs/view/View.d.ts +157 -0
- package/cjs/view/View.js +800 -0
- package/cjs/view/View.js.map +1 -0
- package/cjs/view/animate.d.ts +20 -0
- package/cjs/view/animate.js +106 -0
- package/cjs/view/animate.js.map +1 -0
- package/cjs/view/component.d.ts +26 -0
- package/cjs/view/component.js +64 -0
- package/cjs/view/component.js.map +1 -0
- package/cjs/view/constants.d.ts +17 -0
- package/cjs/view/constants.js +13 -0
- package/cjs/view/constants.js.map +1 -0
- package/cjs/view/coordinate.d.ts +23 -0
- package/cjs/view/coordinate.js +59 -0
- package/cjs/view/coordinate.js.map +1 -0
- package/cjs/view/data.d.ts +37 -0
- package/cjs/view/data.js +198 -0
- package/cjs/view/data.js.map +1 -0
- package/cjs/view/dataflow.d.ts +32 -0
- package/cjs/view/dataflow.js +146 -0
- package/cjs/view/dataflow.js.map +1 -0
- package/cjs/view/events.d.ts +4 -0
- package/cjs/view/events.js +34 -0
- package/cjs/view/events.js.map +1 -0
- package/cjs/view/glyph-meta.d.ts +29 -0
- package/cjs/view/glyph-meta.js +45 -0
- package/cjs/view/glyph-meta.js.map +1 -0
- package/cjs/view/glyph.d.ts +14 -0
- package/cjs/view/glyph.js +29 -0
- package/cjs/view/glyph.js.map +1 -0
- package/cjs/view/grammar-base.d.ts +46 -0
- package/cjs/view/grammar-base.js +171 -0
- package/cjs/view/grammar-base.js.map +1 -0
- package/cjs/view/grammar-record.d.ts +39 -0
- package/cjs/view/grammar-record.js +180 -0
- package/cjs/view/grammar-record.js.map +1 -0
- package/cjs/view/group.d.ts +13 -0
- package/cjs/view/group.js +39 -0
- package/cjs/view/group.js.map +1 -0
- package/cjs/view/index.d.ts +1 -0
- package/cjs/view/index.js +21 -0
- package/cjs/view/index.js.map +1 -0
- package/cjs/view/mark.d.ts +112 -0
- package/cjs/view/mark.js +600 -0
- package/cjs/view/mark.js.map +1 -0
- package/cjs/view/scale.d.ts +26 -0
- package/cjs/view/scale.js +86 -0
- package/cjs/view/scale.js.map +1 -0
- package/cjs/view/signal.d.ts +18 -0
- package/cjs/view/signal.js +56 -0
- package/cjs/view/signal.js.map +1 -0
- package/es/component/axis.d.ts +26 -0
- package/es/component/axis.js +162 -0
- package/es/component/axis.js.map +1 -0
- package/es/component/crosshair.d.ts +50 -0
- package/es/component/crosshair.js +275 -0
- package/es/component/crosshair.js.map +1 -0
- package/es/component/datazoom.d.ts +19 -0
- package/es/component/datazoom.js +161 -0
- package/es/component/datazoom.js.map +1 -0
- package/es/component/grid.d.ts +27 -0
- package/es/component/grid.js +193 -0
- package/es/component/grid.js.map +1 -0
- package/es/component/index.d.ts +11 -0
- package/es/component/index.js +22 -0
- package/es/component/index.js.map +1 -0
- package/es/component/label.d.ts +19 -0
- package/es/component/label.js +124 -0
- package/es/component/label.js.map +1 -0
- package/es/component/legend.d.ts +26 -0
- package/es/component/legend.js +169 -0
- package/es/component/legend.js.map +1 -0
- package/es/component/player.d.ts +25 -0
- package/es/component/player.js +136 -0
- package/es/component/player.js.map +1 -0
- package/es/component/scale.d.ts +8 -0
- package/es/component/scale.js +19 -0
- package/es/component/scale.js.map +1 -0
- package/es/component/scrollbar.d.ts +23 -0
- package/es/component/scrollbar.js +184 -0
- package/es/component/scrollbar.js.map +1 -0
- package/es/component/slider.d.ts +19 -0
- package/es/component/slider.js +86 -0
- package/es/component/slider.js.map +1 -0
- package/es/component/title.d.ts +15 -0
- package/es/component/title.js +58 -0
- package/es/component/title.js.map +1 -0
- package/es/component/tooltip.d.ts +62 -0
- package/es/component/tooltip.js +303 -0
- package/es/component/tooltip.js.map +1 -0
- package/es/core/factory.d.ts +35 -0
- package/es/core/factory.js +67 -0
- package/es/core/factory.js.map +1 -0
- package/es/glyph/boxplot.d.ts +10 -0
- package/es/glyph/boxplot.js +410 -0
- package/es/glyph/boxplot.js.map +1 -0
- package/es/glyph/index.d.ts +7 -0
- package/es/glyph/index.js +11 -0
- package/es/glyph/index.js.map +1 -0
- package/es/glyph/link-path.d.ts +7 -0
- package/es/glyph/link-path.js +132 -0
- package/es/glyph/link-path.js.map +1 -0
- package/es/glyph/ripple.d.ts +1 -0
- package/es/glyph/ripple.js +38 -0
- package/es/glyph/ripple.js.map +1 -0
- package/es/glyph/tree-path.d.ts +7 -0
- package/es/glyph/tree-path.js +146 -0
- package/es/glyph/tree-path.js.map +1 -0
- package/es/glyph/violin.d.ts +1 -0
- package/es/glyph/violin.js +163 -0
- package/es/glyph/violin.js.map +1 -0
- package/es/glyph/wave.d.ts +1 -0
- package/es/glyph/wave.js +61 -0
- package/es/glyph/wave.js.map +1 -0
- package/es/graph/animation/animate.d.ts +48 -0
- package/es/graph/animation/animate.js +247 -0
- package/es/graph/animation/animate.js.map +1 -0
- package/es/graph/animation/animation/clip.d.ts +4 -0
- package/es/graph/animation/animation/clip.js +44 -0
- package/es/graph/animation/animation/clip.js.map +1 -0
- package/es/graph/animation/animation/fade.d.ts +4 -0
- package/es/graph/animation/animation/fade.js +32 -0
- package/es/graph/animation/animation/fade.js.map +1 -0
- package/es/graph/animation/animation/grow-cartesian.d.ts +7 -0
- package/es/graph/animation/animation/grow-cartesian.js +272 -0
- package/es/graph/animation/animation/grow-cartesian.js.map +1 -0
- package/es/graph/animation/animation/grow-interval.d.ts +3 -0
- package/es/graph/animation/animation/grow-interval.js +184 -0
- package/es/graph/animation/animation/grow-interval.js.map +1 -0
- package/es/graph/animation/animation/grow-points.d.ts +7 -0
- package/es/graph/animation/animation/grow-points.js +107 -0
- package/es/graph/animation/animation/grow-points.js.map +1 -0
- package/es/graph/animation/animation/grow-polar.d.ts +5 -0
- package/es/graph/animation/animation/grow-polar.js +160 -0
- package/es/graph/animation/animation/grow-polar.js.map +1 -0
- package/es/graph/animation/animation/index.d.ts +11 -0
- package/es/graph/animation/animation/index.js +22 -0
- package/es/graph/animation/animation/index.js.map +1 -0
- package/es/graph/animation/animation/move.d.ts +3 -0
- package/es/graph/animation/animation/move.js +78 -0
- package/es/graph/animation/animation/move.js.map +1 -0
- package/es/graph/animation/animation/rotate.d.ts +3 -0
- package/es/graph/animation/animation/rotate.js +32 -0
- package/es/graph/animation/animation/rotate.js.map +1 -0
- package/es/graph/animation/animation/scale.d.ts +3 -0
- package/es/graph/animation/animation/scale.js +74 -0
- package/es/graph/animation/animation/scale.js.map +1 -0
- package/es/graph/animation/animation/update.d.ts +6 -0
- package/es/graph/animation/animation/update.js +20 -0
- package/es/graph/animation/animation/update.js.map +1 -0
- package/es/graph/animation/animator.d.ts +26 -0
- package/es/graph/animation/animator.js +83 -0
- package/es/graph/animation/animator.js.map +1 -0
- package/es/graph/animation/arranger.d.ts +13 -0
- package/es/graph/animation/arranger.js +29 -0
- package/es/graph/animation/arranger.js.map +1 -0
- package/es/graph/animation/attribute.d.ts +27 -0
- package/es/graph/animation/attribute.js +114 -0
- package/es/graph/animation/attribute.js.map +1 -0
- package/es/graph/animation/config.d.ts +5 -0
- package/es/graph/animation/config.js +84 -0
- package/es/graph/animation/config.js.map +1 -0
- package/es/graph/animation/morph.d.ts +12 -0
- package/es/graph/animation/morph.js +171 -0
- package/es/graph/animation/morph.js.map +1 -0
- package/es/graph/attributes/common.d.ts +2 -0
- package/es/graph/attributes/common.js +13 -0
- package/es/graph/attributes/common.js.map +1 -0
- package/es/graph/attributes/helpers.d.ts +17 -0
- package/es/graph/attributes/helpers.js +75 -0
- package/es/graph/attributes/helpers.js.map +1 -0
- package/es/graph/attributes/index.d.ts +10 -0
- package/es/graph/attributes/index.js +231 -0
- package/es/graph/attributes/index.js.map +1 -0
- package/es/graph/canvas-renderer.d.ts +34 -0
- package/es/graph/canvas-renderer.js +115 -0
- package/es/graph/canvas-renderer.js.map +1 -0
- package/es/graph/constants.d.ts +23 -0
- package/es/graph/constants.js +47 -0
- package/es/graph/constants.js.map +1 -0
- package/es/graph/element.d.ts +66 -0
- package/es/graph/element.js +292 -0
- package/es/graph/element.js.map +1 -0
- package/es/graph/enums.d.ts +153 -0
- package/es/graph/enums.js +129 -0
- package/es/graph/enums.js.map +1 -0
- package/es/graph/glyph-element.d.ts +53 -0
- package/es/graph/glyph-element.js +206 -0
- package/es/graph/glyph-element.js.map +1 -0
- package/es/graph/index.d.ts +3 -0
- package/es/graph/index.js +6 -0
- package/es/graph/index.js.map +1 -0
- package/es/graph/layout/grid.d.ts +3 -0
- package/es/graph/layout/grid.js +66 -0
- package/es/graph/layout/grid.js.map +1 -0
- package/es/graph/layout/layout.d.ts +3 -0
- package/es/graph/layout/layout.js +33 -0
- package/es/graph/layout/layout.js.map +1 -0
- package/es/graph/layout/relative.d.ts +3 -0
- package/es/graph/layout/relative.js +85 -0
- package/es/graph/layout/relative.js.map +1 -0
- package/es/graph/mark/differ.d.ts +20 -0
- package/es/graph/mark/differ.js +104 -0
- package/es/graph/mark/differ.js.map +1 -0
- package/es/graph/mark/encode.d.ts +10 -0
- package/es/graph/mark/encode.js +92 -0
- package/es/graph/mark/encode.js.map +1 -0
- package/es/graph/mark/large-rects.d.ts +10 -0
- package/es/graph/mark/large-rects.js +23 -0
- package/es/graph/mark/large-rects.js.map +1 -0
- package/es/graph/mark/large-symbols.d.ts +11 -0
- package/es/graph/mark/large-symbols.js +27 -0
- package/es/graph/mark/large-symbols.js.map +1 -0
- package/es/graph/mark-tree.d.ts +2 -0
- package/es/graph/mark-tree.js +15 -0
- package/es/graph/mark-tree.js.map +1 -0
- package/es/graph/util/element.d.ts +2 -0
- package/es/graph/util/element.js +8 -0
- package/es/graph/util/element.js.map +1 -0
- package/es/graph/util/env.d.ts +2 -0
- package/es/graph/util/env.js +6 -0
- package/es/graph/util/env.js.map +1 -0
- package/es/graph/util/events-extend.d.ts +5 -0
- package/es/graph/util/events-extend.js +12 -0
- package/es/graph/util/events-extend.js.map +1 -0
- package/es/graph/util/graphic.d.ts +9 -0
- package/es/graph/util/graphic.js +59 -0
- package/es/graph/util/graphic.js.map +1 -0
- package/es/graph/util/point.d.ts +1 -0
- package/es/graph/util/point.js +67 -0
- package/es/graph/util/point.js.map +1 -0
- package/es/index.d.ts +14 -0
- package/es/index.js +27 -0
- package/es/index.js.map +1 -0
- package/es/parse/coordinate.d.ts +7 -0
- package/es/parse/coordinate.js +65 -0
- package/es/parse/coordinate.js.map +1 -0
- package/es/parse/event.d.ts +8 -0
- package/es/parse/event.js +23 -0
- package/es/parse/event.js.map +1 -0
- package/es/parse/mark.d.ts +4 -0
- package/es/parse/mark.js +19 -0
- package/es/parse/mark.js.map +1 -0
- package/es/parse/option.d.ts +3 -0
- package/es/parse/option.js +10 -0
- package/es/parse/option.js.map +1 -0
- package/es/parse/scale.d.ts +8 -0
- package/es/parse/scale.js +347 -0
- package/es/parse/scale.js.map +1 -0
- package/es/parse/transform.d.ts +5 -0
- package/es/parse/transform.js +102 -0
- package/es/parse/transform.js.map +1 -0
- package/es/parse/util.d.ts +13 -0
- package/es/parse/util.js +65 -0
- package/es/parse/util.js.map +1 -0
- package/es/parse/view.d.ts +17 -0
- package/es/parse/view.js +98 -0
- package/es/parse/view.js.map +1 -0
- package/es/semantic-marks/cell.d.ts +13 -0
- package/es/semantic-marks/cell.js +57 -0
- package/es/semantic-marks/cell.js.map +1 -0
- package/es/semantic-marks/interval.d.ts +14 -0
- package/es/semantic-marks/interval.js +87 -0
- package/es/semantic-marks/interval.js.map +1 -0
- package/es/semantic-marks/text.d.ts +10 -0
- package/es/semantic-marks/text.js +22 -0
- package/es/semantic-marks/text.js.map +1 -0
- package/es/theme/common/component.d.ts +15 -0
- package/es/theme/common/component.js +510 -0
- package/es/theme/common/component.js.map +1 -0
- package/es/theme/common/constants.d.ts +1 -0
- package/es/theme/common/constants.js +2 -0
- package/es/theme/common/constants.js.map +1 -0
- package/es/theme/common/mark.d.ts +2 -0
- package/es/theme/common/mark.js +11 -0
- package/es/theme/common/mark.js.map +1 -0
- package/es/theme/dark.d.ts +2 -0
- package/es/theme/dark.js +96 -0
- package/es/theme/dark.js.map +1 -0
- package/es/theme/default.d.ts +2 -0
- package/es/theme/default.js +16 -0
- package/es/theme/default.js.map +1 -0
- package/es/theme/theme-manager.d.ts +8 -0
- package/es/theme/theme-manager.js +22 -0
- package/es/theme/theme-manager.js.map +1 -0
- package/es/transforms/data/bin.d.ts +2 -0
- package/es/transforms/data/bin.js +16 -0
- package/es/transforms/data/bin.js.map +1 -0
- package/es/transforms/data/circular-relation.d.ts +2 -0
- package/es/transforms/data/circular-relation.js +44 -0
- package/es/transforms/data/circular-relation.js.map +1 -0
- package/es/transforms/data/contour.d.ts +2 -0
- package/es/transforms/data/contour.js +111 -0
- package/es/transforms/data/contour.js.map +1 -0
- package/es/transforms/data/filter.d.ts +2 -0
- package/es/transforms/data/filter.js +2 -0
- package/es/transforms/data/filter.js.map +1 -0
- package/es/transforms/data/fold.d.ts +2 -0
- package/es/transforms/data/fold.js +16 -0
- package/es/transforms/data/fold.js.map +1 -0
- package/es/transforms/data/funnel.d.ts +2 -0
- package/es/transforms/data/funnel.js +17 -0
- package/es/transforms/data/funnel.js.map +1 -0
- package/es/transforms/data/join.d.ts +2 -0
- package/es/transforms/data/join.js +26 -0
- package/es/transforms/data/join.js.map +1 -0
- package/es/transforms/data/kde.d.ts +2 -0
- package/es/transforms/data/kde.js +80 -0
- package/es/transforms/data/kde.js.map +1 -0
- package/es/transforms/data/map.d.ts +2 -0
- package/es/transforms/data/map.js +16 -0
- package/es/transforms/data/map.js.map +1 -0
- package/es/transforms/data/pick.d.ts +2 -0
- package/es/transforms/data/pick.js +15 -0
- package/es/transforms/data/pick.js.map +1 -0
- package/es/transforms/data/pie.d.ts +2 -0
- package/es/transforms/data/pie.js +18 -0
- package/es/transforms/data/pie.js.map +1 -0
- package/es/transforms/data/range.d.ts +4 -0
- package/es/transforms/data/range.js +9 -0
- package/es/transforms/data/range.js.map +1 -0
- package/es/transforms/data/sort.d.ts +2 -0
- package/es/transforms/data/sort.js +13 -0
- package/es/transforms/data/sort.js.map +1 -0
- package/es/transforms/data/stack.d.ts +2 -0
- package/es/transforms/data/stack.js +72 -0
- package/es/transforms/data/stack.js.map +1 -0
- package/es/transforms/data/unfold.d.ts +2 -0
- package/es/transforms/data/unfold.js +45 -0
- package/es/transforms/data/unfold.js.map +1 -0
- package/es/transforms/index.d.ts +23 -0
- package/es/transforms/index.js +205 -0
- package/es/transforms/index.js.map +1 -0
- package/es/transforms/mark/dodge.d.ts +2 -0
- package/es/transforms/mark/dodge.js +74 -0
- package/es/transforms/mark/dodge.js.map +1 -0
- package/es/transforms/mark/jitter.d.ts +4 -0
- package/es/transforms/mark/jitter.js +48 -0
- package/es/transforms/mark/jitter.js.map +1 -0
- package/es/transforms/mark/lttb-sample.d.ts +2 -0
- package/es/transforms/mark/lttb-sample.js +60 -0
- package/es/transforms/mark/lttb-sample.js.map +1 -0
- package/es/transforms/mark/mark-overlap.d.ts +2 -0
- package/es/transforms/mark/mark-overlap.js +71 -0
- package/es/transforms/mark/mark-overlap.js.map +1 -0
- package/es/transforms/mark/symmetry.d.ts +2 -0
- package/es/transforms/mark/symmetry.js +20 -0
- package/es/transforms/mark/symmetry.js.map +1 -0
- package/es/transforms/util/util.d.ts +5 -0
- package/es/transforms/util/util.js +33 -0
- package/es/transforms/util/util.js.map +1 -0
- package/es/transforms/view/identifier.d.ts +2 -0
- package/es/transforms/view/identifier.js +13 -0
- package/es/transforms/view/identifier.js.map +1 -0
- package/es/types/animate.d.ts +224 -0
- package/es/types/animate.js +2 -0
- package/es/types/animate.js.map +1 -0
- package/es/types/base.d.ts +36 -0
- package/es/types/base.js +2 -0
- package/es/types/base.js.map +1 -0
- package/es/types/component.d.ts +240 -0
- package/es/types/component.js +2 -0
- package/es/types/component.js.map +1 -0
- package/es/types/coordinate.d.ts +15 -0
- package/es/types/coordinate.js +2 -0
- package/es/types/coordinate.js.map +1 -0
- package/es/types/data.d.ts +55 -0
- package/es/types/data.js +1 -0
- package/es/types/data.js.map +1 -0
- package/es/types/dataflow.d.ts +13 -0
- package/es/types/dataflow.js +2 -0
- package/es/types/dataflow.js.map +1 -0
- package/es/types/element.d.ts +117 -0
- package/es/types/element.js +2 -0
- package/es/types/element.js.map +1 -0
- package/es/types/event.d.ts +58 -0
- package/es/types/event.js +2 -0
- package/es/types/event.js.map +1 -0
- package/es/types/glyph.d.ts +29 -0
- package/es/types/glyph.js +2 -0
- package/es/types/glyph.js.map +1 -0
- package/es/types/grammar.d.ts +184 -0
- package/es/types/grammar.js +2 -0
- package/es/types/grammar.js.map +1 -0
- package/es/types/hooks.d.ts +45 -0
- package/es/types/hooks.js +2 -0
- package/es/types/hooks.js.map +1 -0
- package/es/types/index.d.ts +22 -0
- package/es/types/index.js +44 -0
- package/es/types/index.js.map +1 -0
- package/es/types/layout.d.ts +5 -0
- package/es/types/layout.js +2 -0
- package/es/types/layout.js.map +1 -0
- package/es/types/mark.d.ts +344 -0
- package/es/types/mark.js +2 -0
- package/es/types/mark.js.map +1 -0
- package/es/types/morph.d.ts +29 -0
- package/es/types/morph.js +2 -0
- package/es/types/morph.js.map +1 -0
- package/es/types/plot.d.ts +326 -0
- package/es/types/plot.js +2 -0
- package/es/types/plot.js.map +1 -0
- package/es/types/projection.d.ts +61 -0
- package/es/types/projection.js +2 -0
- package/es/types/projection.js.map +1 -0
- package/es/types/renderer.d.ts +19 -0
- package/es/types/renderer.js +2 -0
- package/es/types/renderer.js.map +1 -0
- package/es/types/scale.d.ts +111 -0
- package/es/types/scale.js +2 -0
- package/es/types/scale.js.map +1 -0
- package/es/types/signal.d.ts +20 -0
- package/es/types/signal.js +2 -0
- package/es/types/signal.js.map +1 -0
- package/es/types/theme.d.ts +41 -0
- package/es/types/theme.js +2 -0
- package/es/types/theme.js.map +1 -0
- package/es/types/transform.d.ts +291 -0
- package/es/types/transform.js +2 -0
- package/es/types/transform.js.map +1 -0
- package/es/types/view.d.ts +217 -0
- package/es/types/view.js +2 -0
- package/es/types/view.js.map +1 -0
- package/es/util/data.d.ts +3 -0
- package/es/util/data.js +60 -0
- package/es/util/data.js.map +1 -0
- package/es/util/grammar-heap.d.ts +14 -0
- package/es/util/grammar-heap.js +58 -0
- package/es/util/grammar-heap.js.map +1 -0
- package/es/util/text.d.ts +19 -0
- package/es/util/text.js +25 -0
- package/es/util/text.js.map +1 -0
- package/es/util/unique-list.d.ts +12 -0
- package/es/util/unique-list.js +29 -0
- package/es/util/unique-list.js.map +1 -0
- package/es/view/View.d.ts +157 -0
- package/es/view/View.js +836 -0
- package/es/view/View.js.map +1 -0
- package/es/view/animate.d.ts +20 -0
- package/es/view/animate.js +98 -0
- package/es/view/animate.js.map +1 -0
- package/es/view/component.d.ts +26 -0
- package/es/view/component.js +64 -0
- package/es/view/component.js.map +1 -0
- package/es/view/constants.d.ts +17 -0
- package/es/view/constants.js +32 -0
- package/es/view/constants.js.map +1 -0
- package/es/view/coordinate.d.ts +23 -0
- package/es/view/coordinate.js +52 -0
- package/es/view/coordinate.js.map +1 -0
- package/es/view/data.d.ts +37 -0
- package/es/view/data.js +195 -0
- package/es/view/data.js.map +1 -0
- package/es/view/dataflow.d.ts +32 -0
- package/es/view/dataflow.js +141 -0
- package/es/view/dataflow.js.map +1 -0
- package/es/view/events.d.ts +4 -0
- package/es/view/events.js +26 -0
- package/es/view/events.js.map +1 -0
- package/es/view/glyph-meta.d.ts +29 -0
- package/es/view/glyph-meta.js +37 -0
- package/es/view/glyph-meta.js.map +1 -0
- package/es/view/glyph.d.ts +14 -0
- package/es/view/glyph.js +27 -0
- package/es/view/glyph.js.map +1 -0
- package/es/view/grammar-base.d.ts +46 -0
- package/es/view/grammar-base.js +165 -0
- package/es/view/grammar-base.js.map +1 -0
- package/es/view/grammar-record.d.ts +39 -0
- package/es/view/grammar-record.js +170 -0
- package/es/view/grammar-record.js.map +1 -0
- package/es/view/group.d.ts +13 -0
- package/es/view/group.js +39 -0
- package/es/view/group.js.map +1 -0
- package/es/view/index.d.ts +1 -0
- package/es/view/index.js +2 -0
- package/es/view/index.js.map +1 -0
- package/es/view/mark.d.ts +112 -0
- package/es/view/mark.js +604 -0
- package/es/view/mark.js.map +1 -0
- package/es/view/scale.d.ts +26 -0
- package/es/view/scale.js +82 -0
- package/es/view/scale.js.map +1 -0
- package/es/view/signal.d.ts +18 -0
- package/es/view/signal.js +52 -0
- package/es/view/signal.js.map +1 -0
- package/package.json +67 -0
package/es/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/es/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const version = "0.7.0";
|
|
2
|
+
|
|
3
|
+
export * from "./graph";
|
|
4
|
+
|
|
5
|
+
export { View } from "./view";
|
|
6
|
+
|
|
7
|
+
export { parseFunctionType, invokeFunctionType } from "./parse/util";
|
|
8
|
+
|
|
9
|
+
export { GrammarBase } from "./view/grammar-base";
|
|
10
|
+
|
|
11
|
+
export * from "./util/text";
|
|
12
|
+
|
|
13
|
+
export * from "./types";
|
|
14
|
+
|
|
15
|
+
export { Factory } from "./core/factory";
|
|
16
|
+
|
|
17
|
+
export { SIGNAL_AUTOFIT, SIGNAL_HEIGHT, SIGNAL_PADDING, SIGNAL_VIEW_HEIGHT, SIGNAL_VIEW_WIDTH, SIGNAL_WIDTH, SIGNAL_VIEW_BOX } from "./view/constants";
|
|
18
|
+
|
|
19
|
+
export { ThemeManager } from "./theme/theme-manager";
|
|
20
|
+
|
|
21
|
+
export * from "./glyph";
|
|
22
|
+
|
|
23
|
+
export * from "./component";
|
|
24
|
+
|
|
25
|
+
export * from "./transforms";
|
|
26
|
+
|
|
27
|
+
export * from "./graph/animation/animation";
|
package/es/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC","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,65 @@
|
|
|
1
|
+
import { isNil } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { CartesianCoordinate, PolarCoordinate } from "@visactor/vgrammar-coordinate";
|
|
4
|
+
|
|
5
|
+
import { invokeFunctionType, parseFunctionType } from "./util";
|
|
6
|
+
|
|
7
|
+
export function createCoordinate(type) {
|
|
8
|
+
switch (type) {
|
|
9
|
+
case "cartesian":
|
|
10
|
+
default:
|
|
11
|
+
return new CartesianCoordinate;
|
|
12
|
+
|
|
13
|
+
case "polar":
|
|
14
|
+
return new PolarCoordinate;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function parseCoordinate(spec, view) {
|
|
19
|
+
let dependencies = [];
|
|
20
|
+
return [ "start", "end", "origin", "translate", "rotate", "scale", "transpose" ].forEach((key => {
|
|
21
|
+
dependencies = dependencies.concat(parseFunctionType(spec[key], view));
|
|
22
|
+
})), dependencies;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function configureCoordinate(spec, coordinate, parameters) {
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
27
|
+
!isNil(spec.start) && coordinate.start(null !== (_a = invokeFunctionType(spec.start, parameters)) && void 0 !== _a ? _a : [ 0, 0 ]),
|
|
28
|
+
!isNil(spec.end) && coordinate.end(null !== (_b = invokeFunctionType(spec.end, parameters)) && void 0 !== _b ? _b : [ 0, 0 ]),
|
|
29
|
+
!isNil(spec.origin) && coordinate.origin(null !== (_c = invokeFunctionType(spec.origin, parameters)) && void 0 !== _c ? _c : [ 0, 0 ]);
|
|
30
|
+
const transforms = [];
|
|
31
|
+
if (!isNil(spec.translate)) {
|
|
32
|
+
const translate = invokeFunctionType(spec.translate, parameters);
|
|
33
|
+
transforms.push({
|
|
34
|
+
type: "translate",
|
|
35
|
+
offset: {
|
|
36
|
+
x: null !== (_d = null == translate ? void 0 : translate[0]) && void 0 !== _d ? _d : 0,
|
|
37
|
+
y: null !== (_e = null == translate ? void 0 : translate[1]) && void 0 !== _e ? _e : 0
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (!isNil(spec.rotate)) {
|
|
42
|
+
const rotate = invokeFunctionType(spec.rotate, parameters);
|
|
43
|
+
transforms.push({
|
|
44
|
+
type: "rotate",
|
|
45
|
+
angle: null != rotate ? rotate : 0
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!isNil(spec.scale)) {
|
|
49
|
+
const scale = invokeFunctionType(spec.scale, parameters);
|
|
50
|
+
transforms.push({
|
|
51
|
+
type: "scale",
|
|
52
|
+
scale: {
|
|
53
|
+
x: null !== (_f = null == scale ? void 0 : scale[0]) && void 0 !== _f ? _f : 1,
|
|
54
|
+
y: null !== (_g = null == scale ? void 0 : scale[1]) && void 0 !== _g ? _g : 1
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (!isNil(spec.transpose)) {
|
|
59
|
+
invokeFunctionType(spec.transpose, parameters) && transforms.push({
|
|
60
|
+
type: "transpose"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
coordinate.applyTransforms(transforms);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=coordinate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/coordinate.ts"],"names":[],"mappings":"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","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,23 @@
|
|
|
1
|
+
import { debounce, isNil, throttle } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { isMarkType } from "../graph/util/graphic";
|
|
4
|
+
|
|
5
|
+
import { EVENT_SOURCE_VIEW, EVENT_SOURCE_WINDOW } from "../view/constants";
|
|
6
|
+
|
|
7
|
+
export const generateFilterByMark = evtSpec => isNil(evtSpec.markId) ? el => el && el.mark.id() === evtSpec.markId : isNil(evtSpec.markName) ? el => el && el.mark.name() === evtSpec.markName : isNil(evtSpec.type) ? el => el && el.mark.markType === evtSpec.type : () => !0;
|
|
8
|
+
|
|
9
|
+
export const parseHandler = (callback, config) => (null == config ? void 0 : config.debounce) ? debounce(callback, config.debounce) : (null == config ? void 0 : config.throttle) ? throttle(callback, config.throttle) : callback;
|
|
10
|
+
|
|
11
|
+
const JOIN_SYMBOL = ":", NAME_PREFIX = "@", ID_PREFIX = "#";
|
|
12
|
+
|
|
13
|
+
export const parseEventSelector = (selector, source = EVENT_SOURCE_VIEW) => {
|
|
14
|
+
const spec = {}, splitArr = selector.split(":");
|
|
15
|
+
if (2 === splitArr.length) {
|
|
16
|
+
const [space, eventType] = splitArr;
|
|
17
|
+
"#" === space[0] ? (spec.markId = space.slice(1), spec.source = source) : "@" === space[0] ? (spec.markName = space.slice(1),
|
|
18
|
+
spec.source = source) : isMarkType(space) ? (spec.markType = space, spec.source = source) : spec.source = space === EVENT_SOURCE_WINDOW ? EVENT_SOURCE_WINDOW : source,
|
|
19
|
+
spec.type = eventType;
|
|
20
|
+
} else 1 === splitArr.length && (spec.type = selector, spec.source = source);
|
|
21
|
+
return spec;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/event.ts"],"names":[],"mappings":"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","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[];
|
package/es/parse/mark.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { array } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { isGrammar, parseFunctionType } from "./util";
|
|
4
|
+
|
|
5
|
+
export function isScaleEncode(encode) {
|
|
6
|
+
return !!(null == encode ? void 0 : encode.scale);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function isFieldEncode(encode) {
|
|
10
|
+
return !!(null == encode ? void 0 : encode.field);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function parseEncodeType(encoder, view) {
|
|
14
|
+
if (!encoder) return [];
|
|
15
|
+
let dependencies = [];
|
|
16
|
+
return encoder.scale && (dependencies = isGrammar(encoder.scale) ? [ encoder.scale ] : array(view.getScaleById(encoder.scale))),
|
|
17
|
+
dependencies.concat(parseFunctionType(encoder, view));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/mark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEtD,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAW;IACvC,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,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,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC5B,YAAY,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAChC;aAAM;YACL,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAiB,CAAC,CAAC;SACxE;KACF;IACD,OAAO,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC","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,10 @@
|
|
|
1
|
+
import { isFunction, isObject } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { isGrammar } from "./util";
|
|
4
|
+
|
|
5
|
+
export const parseOptionValue = (value, params) => isGrammar(value) ? value.output() : value && isObject(value) ? isFunction(value.callback) ? datum => value.callback(datum, params) : isFunction(value.value) ? value.value(params) : value : value;
|
|
6
|
+
|
|
7
|
+
export const parseOptions = (options, params) => options ? isObject(options) ? Object.keys(options).reduce(((res, key) => {
|
|
8
|
+
const option = options[key];
|
|
9
|
+
return res[key] = parseOptionValue(option, params), res;
|
|
10
|
+
}), {}) : options.map((option => parseOptionValue(option, params))) : options;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/parse/option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAyB,EAAE,MAAW,EAAE,EAAE;IACzE,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;KACvB;SAAM,IAAI,KAAK,IAAI,QAAQ,CAAM,KAAK,CAAC,EAAE;QACxC,IAAI,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YAC9B,OAAO,CAAC,KAAU,EAAE,EAAE;gBACpB,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YACvC,CAAC,CAAC;SACH;QAED,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC5B;QAED,OAAO,KAAK,CAAC;KACd;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAuE,EAAE,MAAW,EAAE,EAAE;IACnH,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;QACrB,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAE5B,GAAG,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAE5C,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;KACR;IAED,OAAQ,OAAqC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC","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;
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { isArray, isFunction, isNil, isNumber, isString, isValidNumber } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { LinearScale, BandScale, OrdinalScale, PointScale, isContinuous, TimeScale, ThresholdScale, SqrtScale, SymlogScale, QuantizeScale, QuantileScale, PowScale, LogScale, isDiscretizing, IdentityScale } from "@visactor/vscale";
|
|
4
|
+
|
|
5
|
+
import { getGrammarOutput, invokeFunctionType, parseFunctionType } from "./util";
|
|
6
|
+
|
|
7
|
+
import { field as getFieldAccessor } from "@visactor/vgrammar-util";
|
|
8
|
+
|
|
9
|
+
export function createScale(type) {
|
|
10
|
+
switch (type) {
|
|
11
|
+
case "band":
|
|
12
|
+
return new BandScale;
|
|
13
|
+
|
|
14
|
+
case "linear":
|
|
15
|
+
return new LinearScale;
|
|
16
|
+
|
|
17
|
+
case "log":
|
|
18
|
+
return new LogScale;
|
|
19
|
+
|
|
20
|
+
case "ordinal":
|
|
21
|
+
return new OrdinalScale;
|
|
22
|
+
|
|
23
|
+
case "point":
|
|
24
|
+
return new PointScale;
|
|
25
|
+
|
|
26
|
+
case "pow":
|
|
27
|
+
return new PowScale;
|
|
28
|
+
|
|
29
|
+
case "quantile":
|
|
30
|
+
return new QuantileScale;
|
|
31
|
+
|
|
32
|
+
case "quantize":
|
|
33
|
+
return new QuantizeScale;
|
|
34
|
+
|
|
35
|
+
case "sqrt":
|
|
36
|
+
return new SqrtScale;
|
|
37
|
+
|
|
38
|
+
case "symlog":
|
|
39
|
+
return new SymlogScale;
|
|
40
|
+
|
|
41
|
+
case "threshold":
|
|
42
|
+
return new ThresholdScale;
|
|
43
|
+
|
|
44
|
+
case "time":
|
|
45
|
+
return new TimeScale;
|
|
46
|
+
|
|
47
|
+
case "utc":
|
|
48
|
+
return new TimeScale(!0);
|
|
49
|
+
|
|
50
|
+
case "identity":
|
|
51
|
+
return new IdentityScale;
|
|
52
|
+
}
|
|
53
|
+
return new LinearScale;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isScaleDataType(spec) {
|
|
57
|
+
return !isNil(null == spec ? void 0 : spec.data);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function parseScaleDataType(spec, view) {
|
|
61
|
+
var _a;
|
|
62
|
+
if (isString(spec.data)) {
|
|
63
|
+
const data = view.getGrammarById(spec.data);
|
|
64
|
+
return data ? [ data ] : [];
|
|
65
|
+
}
|
|
66
|
+
return "data" === (null === (_a = spec.data) || void 0 === _a ? void 0 : _a.grammarType) ? [ spec.data ] : [];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function isMultiScaleDataType(spec) {
|
|
70
|
+
return !isNil(null == spec ? void 0 : spec.datas);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function parseMultiScaleDataType(spec, view) {
|
|
74
|
+
if ((null == spec ? void 0 : spec.datas) && spec.datas.length) {
|
|
75
|
+
const res = [];
|
|
76
|
+
return spec.datas.forEach((data => {
|
|
77
|
+
const gramarBase = parseScaleDataType(data, view);
|
|
78
|
+
gramarBase.length && res.push(gramarBase[0]);
|
|
79
|
+
})), res;
|
|
80
|
+
}
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isScaleCoordinateType(spec) {
|
|
85
|
+
return !isNil(null == spec ? void 0 : spec.coordinate);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function parseScaleCoordinateType(spec, view) {
|
|
89
|
+
var _a;
|
|
90
|
+
if (isString(spec.coordinate)) {
|
|
91
|
+
const coordinate = view.getCoordinateById(spec.coordinate);
|
|
92
|
+
return coordinate ? [ coordinate ] : [];
|
|
93
|
+
}
|
|
94
|
+
return "coordinate" === (null === (_a = spec.coordinate) || void 0 === _a ? void 0 : _a.grammarType) ? [ spec.coordinate ] : [];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function parseLinearScale(spec, view) {
|
|
98
|
+
let dependencies = [];
|
|
99
|
+
return dependencies = dependencies.concat(parseFunctionType(spec.nice, view)), dependencies = dependencies.concat(parseFunctionType(spec.niceMin, view)),
|
|
100
|
+
dependencies = dependencies.concat(parseFunctionType(spec.niceMax, view)), dependencies = dependencies.concat(parseFunctionType(spec.min, view)),
|
|
101
|
+
dependencies = dependencies.concat(parseFunctionType(spec.max, view)), dependencies = dependencies.concat(parseFunctionType(spec.zero, view)),
|
|
102
|
+
dependencies = dependencies.concat(parseFunctionType(spec.roundRange, view)), dependencies;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function parsePowScale(spec, view) {
|
|
106
|
+
return parseLinearScale(spec, view).concat(parseFunctionType(spec.exponent, view));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function parseSymlogScale(spec, view) {
|
|
110
|
+
return parseLinearScale(spec, view).concat(parseFunctionType(spec.constant, view));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function parseLogScale(spec, view) {
|
|
114
|
+
let dependencies = [];
|
|
115
|
+
return dependencies = dependencies.concat(parseFunctionType(spec.nice, view)), dependencies = dependencies.concat(parseFunctionType(spec.min, view)),
|
|
116
|
+
dependencies = dependencies.concat(parseFunctionType(spec.max, view)), dependencies = dependencies.concat(parseFunctionType(spec.zero, view)),
|
|
117
|
+
dependencies = dependencies.concat(parseFunctionType(spec.roundRange, view)), dependencies;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function parseQuantizeScale(spec, view) {
|
|
121
|
+
let dependencies = [];
|
|
122
|
+
return dependencies = dependencies.concat(parseFunctionType(spec.nice, view)), dependencies = dependencies.concat(parseFunctionType(spec.niceMin, view)),
|
|
123
|
+
dependencies = dependencies.concat(parseFunctionType(spec.niceMax, view)), dependencies = dependencies.concat(parseFunctionType(spec.min, view)),
|
|
124
|
+
dependencies = dependencies.concat(parseFunctionType(spec.max, view)), dependencies = dependencies.concat(parseFunctionType(spec.zero, view)),
|
|
125
|
+
dependencies;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function parseOrdinalScale(spec, view) {
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function parseBaseBandScale(spec, view) {
|
|
133
|
+
let dependencies = [];
|
|
134
|
+
return dependencies = dependencies.concat(parseFunctionType(spec.round, view)),
|
|
135
|
+
dependencies = dependencies.concat(parseFunctionType(spec.padding, view)), dependencies = dependencies.concat(parseFunctionType(spec.paddingInner, view)),
|
|
136
|
+
dependencies = dependencies.concat(parseFunctionType(spec.paddingOuter, view)),
|
|
137
|
+
dependencies = dependencies.concat(parseFunctionType(spec.align, view)), dependencies;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function parseBandScale(spec, view) {
|
|
141
|
+
return parseBaseBandScale(spec, view).concat(parseFunctionType(spec.paddingInner, view));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function parsePointScale(spec, view) {
|
|
145
|
+
return parseBaseBandScale(spec, view);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function parseScaleDomainRange(domain, view) {
|
|
149
|
+
return isScaleDataType(domain) ? parseScaleDataType(domain, view) : isMultiScaleDataType(domain) ? parseMultiScaleDataType(domain, view) : isScaleCoordinateType(domain) ? parseScaleCoordinateType(domain, view) : parseFunctionType(domain, view);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function parseScaleConfig(type, config, view) {
|
|
153
|
+
if (isNil(config)) return [];
|
|
154
|
+
const deps = parseFunctionType(config.unknown, view);
|
|
155
|
+
switch (type) {
|
|
156
|
+
case "linear":
|
|
157
|
+
case "sqrt":
|
|
158
|
+
return deps.concat(parseLinearScale(config, view));
|
|
159
|
+
|
|
160
|
+
case "ordinal":
|
|
161
|
+
return deps.concat(parseOrdinalScale(config, view));
|
|
162
|
+
|
|
163
|
+
case "band":
|
|
164
|
+
return deps.concat(parseBandScale(config, view));
|
|
165
|
+
|
|
166
|
+
case "point":
|
|
167
|
+
return deps.concat(parsePointScale(config, view));
|
|
168
|
+
|
|
169
|
+
case "pow":
|
|
170
|
+
return deps.concat(parsePowScale(config, view));
|
|
171
|
+
|
|
172
|
+
case "log":
|
|
173
|
+
case "time":
|
|
174
|
+
case "utc":
|
|
175
|
+
return deps.concat(parseLogScale(config, view));
|
|
176
|
+
|
|
177
|
+
case "symlog":
|
|
178
|
+
return deps.concat(parseSymlogScale(config, view));
|
|
179
|
+
|
|
180
|
+
case "quantize":
|
|
181
|
+
return deps.concat(parseQuantizeScale(config, view));
|
|
182
|
+
}
|
|
183
|
+
return deps;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function configureScaleNice(spec, scale, parameters) {
|
|
187
|
+
const nice = invokeFunctionType(spec.nice, parameters, scale);
|
|
188
|
+
!0 === nice ? scale.nice() : isValidNumber(nice) && scale.nice(nice);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function configureScaleNiceMinMax(spec, scale, parameters) {
|
|
192
|
+
const niceMax = invokeFunctionType(spec.niceMax, parameters, scale);
|
|
193
|
+
!0 === niceMax ? scale.niceMax() : isValidNumber(niceMax) && scale.niceMax(niceMax);
|
|
194
|
+
const niceMin = invokeFunctionType(spec.niceMin, parameters, scale);
|
|
195
|
+
!0 === niceMin ? scale.niceMin() : isValidNumber(niceMin) && scale.niceMin(niceMin);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function configureScaleDomain(spec, scale, parameters) {
|
|
199
|
+
const min = invokeFunctionType(spec.min, parameters, scale), max = invokeFunctionType(spec.max, parameters, scale), zero = invokeFunctionType(spec.zero, parameters, scale), hasValidMin = isValidNumber(min), hasValidmax = isValidNumber(max), prevDomain = scale.domain();
|
|
200
|
+
if (2 === prevDomain.length && (hasValidMin || hasValidmax || zero)) {
|
|
201
|
+
let newMin = Math.min(prevDomain[0], prevDomain[prevDomain.length - 1]), newMax = Math.max(prevDomain[0], prevDomain[prevDomain.length - 1]);
|
|
202
|
+
zero && newMin > 0 ? newMin = 0 : hasValidMin && (newMin = Math.min(newMin, min)),
|
|
203
|
+
zero && newMax < 0 ? newMax = 0 : hasValidmax && (newMax = Math.max(newMax, max)),
|
|
204
|
+
scale.domain([ newMin, newMax ], !0);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function configureContinuousScale(spec, scale, parameters) {
|
|
209
|
+
invokeFunctionType(spec.roundRange, parameters, scale) && scale.rangeRound(scale.range(), !0);
|
|
210
|
+
const config = invokeFunctionType(spec.config, parameters, scale);
|
|
211
|
+
(null == config ? void 0 : config.interpolate) && scale.interpolate(config.interpolate, !0),
|
|
212
|
+
isNil(null == config ? void 0 : config.clamp) || (isFunction(config.clamp) ? scale.clamp(!0, config.clamp, !0) : scale.clamp(config.clamp, void 0, !0));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function configureLinearScale(spec, scale, parameters) {
|
|
216
|
+
configureScaleNice(spec, scale, parameters), configureScaleNiceMinMax(spec, scale, parameters),
|
|
217
|
+
configureScaleDomain(spec, scale, parameters), configureContinuousScale(spec, scale, parameters);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function configurePowScale(spec, scale, parameters) {
|
|
221
|
+
configureLinearScale(spec, scale, parameters);
|
|
222
|
+
const exponent = invokeFunctionType(spec.exponent, parameters, scale);
|
|
223
|
+
exponent > 0 && scale.exponent(exponent);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function configureLogScale(spec, scale, parameters) {
|
|
227
|
+
configureScaleNice(spec, scale, parameters), configureScaleDomain(spec, scale, parameters),
|
|
228
|
+
configureContinuousScale(spec, scale, parameters);
|
|
229
|
+
const base = invokeFunctionType(spec.base, parameters, scale);
|
|
230
|
+
base > 0 && scale.base(base);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function configureSqrtScale(spec, scale, parameters) {
|
|
234
|
+
configureLinearScale(spec, scale, parameters);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function configureTimeScale(spec, scale, parameters) {
|
|
238
|
+
configureScaleNice(spec, scale, parameters), configureScaleDomain(spec, scale, parameters),
|
|
239
|
+
configureContinuousScale(spec, scale, parameters);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function configureSymlogScale(spec, scale, parameters) {
|
|
243
|
+
configureLinearScale(spec, scale, parameters);
|
|
244
|
+
const constant = invokeFunctionType(spec.constant, parameters, scale);
|
|
245
|
+
isValidNumber(constant) && scale.constant(constant);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function configureQuantizeScale(spec, scale, parameters) {
|
|
249
|
+
configureScaleNice(spec, scale, parameters), configureScaleNiceMinMax(spec, scale, parameters),
|
|
250
|
+
configureScaleDomain(spec, scale, parameters);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function configureBaseBandScale(spec, scale, parameters) {
|
|
254
|
+
spec.round && scale.round(invokeFunctionType(spec.round, parameters, scale), !0),
|
|
255
|
+
spec.padding && scale.padding(invokeFunctionType(spec.padding, parameters, scale), !0),
|
|
256
|
+
spec.paddingInner && scale.paddingInner(invokeFunctionType(spec.paddingInner, parameters, scale), !0),
|
|
257
|
+
spec.paddingOuter && scale.paddingOuter(invokeFunctionType(spec.paddingOuter, parameters, scale), !0),
|
|
258
|
+
spec.align && scale.align(invokeFunctionType(spec.align, parameters, scale), !0);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function configureBandScale(spec, scale, parameters) {
|
|
262
|
+
return configureBaseBandScale(spec, scale, parameters);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function configurePointScale(spec, scale, parameters) {
|
|
266
|
+
return configureBaseBandScale(spec, scale, parameters);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function parseFieldData(spec, parameters) {
|
|
270
|
+
const field = spec.field, refData = getGrammarOutput(spec.data, parameters);
|
|
271
|
+
let fieldData = [];
|
|
272
|
+
if (isArray(field)) field.forEach((entry => {
|
|
273
|
+
const getter = getFieldAccessor(entry);
|
|
274
|
+
refData && refData.forEach((datum => {
|
|
275
|
+
fieldData = fieldData.concat(getter(datum));
|
|
276
|
+
}));
|
|
277
|
+
})); else {
|
|
278
|
+
const getter = getFieldAccessor(field);
|
|
279
|
+
refData && refData.forEach((datum => {
|
|
280
|
+
fieldData = fieldData.concat(getter(datum));
|
|
281
|
+
}));
|
|
282
|
+
}
|
|
283
|
+
return fieldData;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function parseMultiFieldData(spec, parameters) {
|
|
287
|
+
let fieldData = [];
|
|
288
|
+
return spec.datas.forEach((entry => {
|
|
289
|
+
fieldData = fieldData.concat(parseFieldData(entry, parameters));
|
|
290
|
+
})), fieldData;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function parseScaleDataTypeValue(fieldData, scale, sort, filterNumber) {
|
|
294
|
+
return sort && fieldData.sort(sort), isContinuous(scale.type) ? (filterNumber && fieldData.filter((entry => isNumber(entry))),
|
|
295
|
+
[ Math.min.apply(null, fieldData), Math.max.apply(null, fieldData) ]) : fieldData;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function configureScale(spec, scale, parameters) {
|
|
299
|
+
if (isScaleDataType(spec.domain) ? scale.domain(parseScaleDataTypeValue(parseFieldData(spec.domain, parameters), scale, spec.domain.sort, !0), !0) : isMultiScaleDataType(spec.domain) ? scale.domain(parseScaleDataTypeValue(parseMultiFieldData(spec.domain, parameters), scale, spec.domain.sort, !0), !0) : scale.domain(invokeFunctionType(spec.domain, parameters, scale), !0),
|
|
300
|
+
"identity" !== spec.type) if (isScaleDataType(spec.range)) scale.range(parseScaleDataTypeValue(parseFieldData(spec.range, parameters), scale), !0); else if (isMultiScaleDataType(spec.range)) scale.range(parseScaleDataTypeValue(parseMultiFieldData(spec.range, parameters), scale), !0); else if (isScaleCoordinateType(spec.range)) {
|
|
301
|
+
const coord = getGrammarOutput(spec.range.coordinate, parameters);
|
|
302
|
+
!isDiscretizing(scale.type) && coord && scale.range(coord.getRangeByDimension(spec.range.dimension, spec.range.isSubshaft, spec.range.reversed));
|
|
303
|
+
} else scale.range(invokeFunctionType(spec.range, parameters, scale), !0);
|
|
304
|
+
switch (isNil(spec.unknown) || scale.unknown(invokeFunctionType(spec.unknown, parameters, scale)),
|
|
305
|
+
spec.type) {
|
|
306
|
+
case "linear":
|
|
307
|
+
configureLinearScale(spec, scale, parameters), scale.rescale();
|
|
308
|
+
break;
|
|
309
|
+
|
|
310
|
+
case "band":
|
|
311
|
+
configureBandScale(spec, scale, parameters), scale.rescale();
|
|
312
|
+
break;
|
|
313
|
+
|
|
314
|
+
case "point":
|
|
315
|
+
configurePointScale(spec, scale, parameters), scale.rescale();
|
|
316
|
+
break;
|
|
317
|
+
|
|
318
|
+
case "pow":
|
|
319
|
+
configurePowScale(spec, scale, parameters), scale.rescale();
|
|
320
|
+
break;
|
|
321
|
+
|
|
322
|
+
case "log":
|
|
323
|
+
configureLogScale(spec, scale, parameters), scale.rescale();
|
|
324
|
+
break;
|
|
325
|
+
|
|
326
|
+
case "sqrt":
|
|
327
|
+
configureSqrtScale(spec, scale, parameters), scale.rescale();
|
|
328
|
+
break;
|
|
329
|
+
|
|
330
|
+
case "symlog":
|
|
331
|
+
configureSymlogScale(spec, scale, parameters), scale.rescale();
|
|
332
|
+
break;
|
|
333
|
+
|
|
334
|
+
case "time":
|
|
335
|
+
case "utc":
|
|
336
|
+
configureTimeScale(spec, scale, parameters), scale.rescale();
|
|
337
|
+
break;
|
|
338
|
+
|
|
339
|
+
case "quantize":
|
|
340
|
+
configureQuantizeScale(spec, scale, parameters), scale.rescale();
|
|
341
|
+
break;
|
|
342
|
+
|
|
343
|
+
case "quantile":
|
|
344
|
+
scale.rescale();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=scale.js.map
|