@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/util/data.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
2
|
+
return new (P || (P = Promise))((function(resolve, reject) {
|
|
3
|
+
function fulfilled(value) {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function rejected(value) {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function step(result) {
|
|
18
|
+
var value;
|
|
19
|
+
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
|
|
20
|
+
resolve(value);
|
|
21
|
+
}))).then(fulfilled, rejected);
|
|
22
|
+
}
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
import { DataSet, DataView, csvParser, dsvParser, tsvParser } from "@visactor/vdataset";
|
|
28
|
+
|
|
29
|
+
import { array, isString } from "@visactor/vutils";
|
|
30
|
+
|
|
31
|
+
const jsonParser = (data, options = {}, dataView) => {
|
|
32
|
+
if (!isString(data)) return array(data);
|
|
33
|
+
try {
|
|
34
|
+
return array(JSON.parse(data));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}, parsers = {
|
|
39
|
+
csv: csvParser,
|
|
40
|
+
dsv: dsvParser,
|
|
41
|
+
tsv: tsvParser,
|
|
42
|
+
json: jsonParser
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const parseFormat = (data, format) => {
|
|
46
|
+
if (!format || !parsers[format.type]) return array(data);
|
|
47
|
+
const options = "dsv" === format.type ? {
|
|
48
|
+
delimiter: format.delimiter
|
|
49
|
+
} : {};
|
|
50
|
+
return parsers[format.type](data, options, new DataView(new DataSet));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const load = url => __awaiter(void 0, void 0, void 0, (function*() {
|
|
54
|
+
try {
|
|
55
|
+
return (yield fetch(url)).text();
|
|
56
|
+
} catch (error) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}));
|
|
60
|
+
//# sourceMappingURL=data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/data.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,UAAU,GAAW,CAAC,IAAY,EAAE,UAAe,EAAE,EAAE,QAAkB,EAAE,EAAE;IACjF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACnB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;KACpB;IACD,IAAI;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAS,EAAE,MAAuB,EAAW,EAAE;IACzE,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACpC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;KACpB;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,QAAQ,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,GAAW,EAAE,EAAE;IACxC,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;KACxB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAA,CAAC","file":"data.js","sourcesContent":["import type { Parser } from '@visactor/vdataset';\n// eslint-disable-next-line no-duplicate-imports\nimport { DataSet, DataView, csvParser, dsvParser, tsvParser } from '@visactor/vdataset';\nimport type { DataFormatSpec, Datum } from '../types';\nimport { array, isString } from '@visactor/vutils';\n\nconst jsonParser: Parser = (data: string, options: any = {}, dataView: DataView) => {\n if (!isString(data)) {\n return array(data);\n }\n try {\n return array(JSON.parse(data));\n } catch (e) {\n return [];\n }\n};\n\nconst parsers: Record<string, Parser> = {\n csv: csvParser,\n dsv: dsvParser,\n tsv: tsvParser,\n json: jsonParser\n};\n\nexport const parseFormat = (data: any, format?: DataFormatSpec): Datum[] => {\n if (!format || !parsers[format.type]) {\n return array(data);\n }\n const options = format.type === 'dsv' ? { delimiter: format.delimiter } : {};\n return parsers[format.type](data, options, new DataView(new DataSet()));\n};\n\n// TODO: use ResourceLoader instead\n// resource loader do not support plain text loading for now\nexport const load = async (url: string) => {\n try {\n const response = await fetch(url);\n return response.text();\n } catch (error) {\n return null;\n }\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type CompareFunc = (a: any, b: any) => number;
|
|
2
|
+
export declare class Heap {
|
|
3
|
+
protected compare: CompareFunc;
|
|
4
|
+
protected nodes: any[];
|
|
5
|
+
constructor(compare: CompareFunc);
|
|
6
|
+
size(): number;
|
|
7
|
+
last(): any;
|
|
8
|
+
validate(): boolean;
|
|
9
|
+
push(node: any): any;
|
|
10
|
+
remove(node: any): void;
|
|
11
|
+
pop(): any;
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function moveToHead(array, idx, start, cmp) {
|
|
2
|
+
let parent, pidx;
|
|
3
|
+
const item = array[idx];
|
|
4
|
+
for (;idx > start && (pidx = Math.floor((idx - 1) / 2), parent = array[pidx], cmp(item, parent) < 0); ) array[idx] = parent,
|
|
5
|
+
idx = pidx;
|
|
6
|
+
return array[idx] = item;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function moveToTail(array, idx, end, cmp) {
|
|
10
|
+
const start = idx, endIdx = null != end ? end : array.length, item = array[idx];
|
|
11
|
+
let ridx, cidx = 2 * idx + 1;
|
|
12
|
+
for (;cidx < endIdx; ) ridx = cidx + 1, ridx < endIdx && cmp(array[cidx], array[ridx]) >= 0 && (cidx = ridx),
|
|
13
|
+
array[idx] = array[cidx], cidx = 2 * (idx = cidx) + 1;
|
|
14
|
+
return array[idx] = item, moveToHead(array, idx, start, cmp);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class Heap {
|
|
18
|
+
constructor(compare) {
|
|
19
|
+
this.compare = compare, this.nodes = [];
|
|
20
|
+
}
|
|
21
|
+
size() {
|
|
22
|
+
return this.nodes.length;
|
|
23
|
+
}
|
|
24
|
+
last() {
|
|
25
|
+
return this.nodes[0];
|
|
26
|
+
}
|
|
27
|
+
validate() {
|
|
28
|
+
for (let i = this.nodes.length - 1; i > 0; i -= 1) {
|
|
29
|
+
const parentIndex = Math.floor((i - 1) / 2);
|
|
30
|
+
if (this.compare(this.nodes[parentIndex], this.nodes[i]) > 0) return !1;
|
|
31
|
+
}
|
|
32
|
+
return !0;
|
|
33
|
+
}
|
|
34
|
+
push(node) {
|
|
35
|
+
if (this.nodes.includes(node)) {
|
|
36
|
+
const index = this.nodes.indexOf(node);
|
|
37
|
+
return moveToHead(this.nodes, index, 0, this.compare), moveToTail(this.nodes, index, null, this.compare);
|
|
38
|
+
}
|
|
39
|
+
return this.nodes.push(node), moveToHead(this.nodes, this.nodes.length - 1, 0, this.compare);
|
|
40
|
+
}
|
|
41
|
+
remove(node) {
|
|
42
|
+
if (this.nodes.includes(node)) {
|
|
43
|
+
const index = this.nodes.indexOf(node);
|
|
44
|
+
this.nodes = this.nodes.slice(0, index).concat(this.nodes.slice(index + 1)), moveToHead(this.nodes, index, 0, this.compare),
|
|
45
|
+
moveToTail(this.nodes, index, null, this.compare);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
pop() {
|
|
49
|
+
const last = this.nodes.pop();
|
|
50
|
+
let item;
|
|
51
|
+
return this.nodes.length ? (item = this.nodes[0], this.nodes[0] = last, moveToTail(this.nodes, 0, null, this.compare)) : item = last,
|
|
52
|
+
item;
|
|
53
|
+
}
|
|
54
|
+
clear() {
|
|
55
|
+
this.nodes = [];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=grammar-heap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/grammar-heap.ts"],"names":[],"mappings":"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","file":"grammar-heap.js","sourcesContent":["type CompareFunc = (a: any, b: any) => number;\n\n/**\n * moveToHead - Moves an element down the array until the target element is `smallar` than all the elements in head\n *\n * @param {any[]} array - The array to sift through\n * @param {number} start - The start index of the element\n * @param {number} idx - The index of the element to sift down\n * @param {CompareFunc} cmp - The function used to compare elements in the array\n * @returns {any[]} - The updated array with the sifted element in the correct position\n */\nfunction moveToHead(array: any[], idx: number, start: number, cmp: CompareFunc) {\n let parent;\n let pidx;\n\n const item = array[idx];\n // Move the element down the array\n while (idx > start) {\n pidx = Math.floor((idx - 1) / 2);\n parent = array[pidx];\n if (cmp(item, parent) < 0) {\n array[idx] = parent;\n idx = pidx;\n continue;\n }\n break;\n }\n return (array[idx] = item);\n}\n\n/**\n * moveToTail - Moves an element up the array until the target element is `greater` than all the elements in tail\n *\n * @param {any[]} array - The array to sift through\n * @param {number} idx - The index of the element to sift up\n * @param {CompareFunc} cmp - The function used to compare elements in the array\n * @returns {any[]} - The updated array with the sifted element in the correct position\n */\nfunction moveToTail(array: any[], idx: number, end: number | undefined, cmp: CompareFunc) {\n const start = idx;\n const endIdx = end ?? array.length;\n const item = array[idx];\n let cidx = idx * 2 + 1;\n let ridx;\n\n // Move the element up the array until it is in the correct position\n while (cidx < endIdx) {\n ridx = cidx + 1;\n if (ridx < endIdx && cmp(array[cidx], array[ridx]) >= 0) {\n cidx = ridx;\n }\n array[idx] = array[cidx];\n idx = cidx;\n cidx = idx * 2 + 1;\n }\n array[idx] = item;\n return moveToHead(array, idx, start, cmp);\n}\n\nexport class Heap {\n protected compare: CompareFunc;\n\n protected nodes: any[];\n\n constructor(compare: CompareFunc) {\n this.compare = compare;\n this.nodes = [];\n }\n\n size() {\n return this.nodes.length;\n }\n\n last() {\n return this.nodes[0];\n }\n\n validate() {\n for (let i = this.nodes.length - 1; i > 0; i -= 1) {\n const parentIndex = Math.floor((i - 1) / 2);\n if (this.compare(this.nodes[parentIndex], this.nodes[i]) > 0) {\n return false;\n }\n }\n return true;\n }\n\n push(node: any) {\n if (this.nodes.includes(node)) {\n // node 的排序等级可能变更,需要重新执行 排序\n const index = this.nodes.indexOf(node);\n moveToHead(this.nodes, index, 0, this.compare);\n return moveToTail(this.nodes, index, null, this.compare);\n }\n this.nodes.push(node);\n return moveToHead(this.nodes, this.nodes.length - 1, 0, this.compare);\n }\n\n remove(node: any) {\n if (this.nodes.includes(node)) {\n const index = this.nodes.indexOf(node);\n\n this.nodes = this.nodes.slice(0, index).concat(this.nodes.slice(index + 1));\n\n moveToHead(this.nodes, index, 0, this.compare);\n moveToTail(this.nodes, index, null, this.compare);\n }\n }\n\n pop() {\n const last = this.nodes.pop();\n let item;\n\n if (this.nodes.length) {\n item = this.nodes[0];\n this.nodes[0] = last;\n\n moveToTail(this.nodes, 0, null, this.compare);\n } else {\n item = last;\n }\n return item;\n }\n\n clear() {\n this.nodes = [];\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IRichText, IRichTextCharacter } from '@visactor/vrender';
|
|
2
|
+
export declare function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]): {
|
|
3
|
+
type: string;
|
|
4
|
+
text: IRichTextCharacter[];
|
|
5
|
+
};
|
|
6
|
+
export declare function richJsx(richText: IRichText | {
|
|
7
|
+
attribute: IRichTextCharacter;
|
|
8
|
+
type: string;
|
|
9
|
+
}[] | IRichTextCharacter[]): {
|
|
10
|
+
type: string;
|
|
11
|
+
text: (IRichTextCharacter | {
|
|
12
|
+
attribute: IRichTextCharacter;
|
|
13
|
+
type: string;
|
|
14
|
+
})[];
|
|
15
|
+
};
|
|
16
|
+
export declare function textHtml(strings: TemplateStringsArray, ...insertVars: (string | number)[]): {
|
|
17
|
+
type: string;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
package/es/util/text.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { xul as vRenderXul, RichText } from "@visactor/vrender";
|
|
2
|
+
|
|
3
|
+
import { isArray } from "@visactor/vutils";
|
|
4
|
+
|
|
5
|
+
export function richXul(strings, ...insertVars) {
|
|
6
|
+
return {
|
|
7
|
+
type: "rich",
|
|
8
|
+
text: vRenderXul(strings.reduce(((res, temp, i) => res + temp + (i >= insertVars.length ? "" : insertVars[i])), ""))
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function richJsx(richText) {
|
|
13
|
+
return {
|
|
14
|
+
type: "rich",
|
|
15
|
+
text: richText instanceof RichText ? richText.attribute.textConfig : isArray(richText) ? richText.map((entry => entry.type ? entry.attribute : entry)) : []
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function textHtml(strings, ...insertVars) {
|
|
20
|
+
return {
|
|
21
|
+
type: "html",
|
|
22
|
+
text: strings.reduce(((res, temp, i) => res + temp + (i >= insertVars.length ? "" : insertVars[i])), "")
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,UAAU,OAAO,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACvF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,UAAU,CACd,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YAC9B,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC,CACP;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,QAA8F;IAE9F,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EACF,QAAQ,YAAY,QAAQ;YAC1B,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU;YAC/B,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;gBACnB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACnB,OAAQ,KAAyD,CAAC,IAAI;wBACpE,CAAC,CAAE,KAAyD,CAAC,SAAS;wBACtE,CAAC,CAAC,KAAK,CAAC;gBACZ,CAAC,CAAC;gBACJ,CAAC,CAAC,EAAE;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACxF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YACpC,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC;KACP,CAAC;AACJ,CAAC","file":"text.js","sourcesContent":["import type { IRichText, IRichTextCharacter } from '@visactor/vrender';\nimport { xul as vRenderXul, RichText } from '@visactor/vrender';\nimport { isArray } from '@visactor/vutils';\n\nexport function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'rich',\n text: vRenderXul(\n strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n )\n };\n}\n\nexport function richJsx(\n richText: IRichText | { attribute: IRichTextCharacter; type: string }[] | IRichTextCharacter[]\n) {\n return {\n type: 'rich',\n text:\n richText instanceof RichText\n ? richText.attribute.textConfig\n : isArray(richText)\n ? richText.map(entry => {\n return (entry as { attribute: IRichTextCharacter; type: string }).type\n ? (entry as { attribute: IRichTextCharacter; type: string }).attribute\n : entry;\n })\n : []\n };\n}\n\nexport function textHtml(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'html',\n text: strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class UniqueList<T> {
|
|
2
|
+
private idFunc;
|
|
3
|
+
private list;
|
|
4
|
+
private ids;
|
|
5
|
+
constructor(idFunc: (val: T) => number);
|
|
6
|
+
add(element: T): this;
|
|
7
|
+
remove(element: T): this;
|
|
8
|
+
forEach(callback: (entry: T, index?: number, arr?: T[]) => void, reverse?: boolean): void;
|
|
9
|
+
filter(callback: (entry: T, index?: number, arr?: T[]) => boolean): T[];
|
|
10
|
+
get length(): number;
|
|
11
|
+
getElementByIndex(index: number): T;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { identity } from "@visactor/vgrammar-util";
|
|
2
|
+
|
|
3
|
+
export class UniqueList {
|
|
4
|
+
constructor(idFunc) {
|
|
5
|
+
this.list = [], this.ids = {}, this.idFunc = idFunc || identity;
|
|
6
|
+
}
|
|
7
|
+
add(element) {
|
|
8
|
+
const id = this.idFunc(element);
|
|
9
|
+
return this.ids[id] || (this.ids[id] = 1, this.list.push(element)), this;
|
|
10
|
+
}
|
|
11
|
+
remove(element) {
|
|
12
|
+
const id = this.idFunc(element);
|
|
13
|
+
return this.ids[id] && (this.ids[id] = 0, this.list = this.list.filter((entry => entry !== element))),
|
|
14
|
+
this;
|
|
15
|
+
}
|
|
16
|
+
forEach(callback, reverse) {
|
|
17
|
+
reverse ? this.list.slice().reverse().forEach(callback) : this.list.forEach(callback);
|
|
18
|
+
}
|
|
19
|
+
filter(callback) {
|
|
20
|
+
return this.list.filter(callback);
|
|
21
|
+
}
|
|
22
|
+
get length() {
|
|
23
|
+
return this.list.length;
|
|
24
|
+
}
|
|
25
|
+
getElementByIndex(index) {
|
|
26
|
+
return this.list[index];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=unique-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/unique-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,OAAO,UAAU;IAOrB,YAAY,MAA0B;QAJ9B,SAAI,GAAQ,EAAE,CAAC;QAEf,QAAG,GAA2B,EAAE,CAAC;QAGvC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACnC,CAAC;IAED,GAAG,CAAC,OAAU;QACZ,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YACjB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,OAAU;QACf,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEhC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;YACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,QAAuD,EAAE,OAAiB;QAChF,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC/C;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC7B;IACH,CAAC;IAED,MAAM,CAAC,QAA0D;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF","file":"unique-list.js","sourcesContent":["import { identity } from '@visactor/vgrammar-util';\n\nexport class UniqueList<T> {\n private idFunc: (val: T) => number;\n\n private list: T[] = [];\n\n private ids: Record<string, number> = {};\n\n constructor(idFunc: (val: T) => number) {\n this.idFunc = idFunc || identity;\n }\n\n add(element: T) {\n const id = this.idFunc(element);\n\n if (!this.ids[id]) {\n this.ids[id] = 1;\n this.list.push(element);\n }\n return this;\n }\n\n remove(element: T) {\n const id = this.idFunc(element);\n\n if (this.ids[id]) {\n this.ids[id] = 0;\n this.list = this.list.filter(entry => entry !== element);\n }\n return this;\n }\n\n forEach(callback: (entry: T, index?: number, arr?: T[]) => void, reverse?: boolean) {\n if (reverse) {\n this.list.slice().reverse().forEach(callback);\n } else {\n this.list.forEach(callback);\n }\n }\n\n filter(callback: (entry: T, index?: number, arr?: T[]) => boolean) {\n return this.list.filter(callback);\n }\n\n public get length() {\n return this.list.length;\n }\n\n getElementByIndex(index: number) {\n return this.list[index];\n }\n}\n"]}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { IBounds, ILogger } from '@visactor/vutils';
|
|
2
|
+
import { EventEmitter } from '@visactor/vutils';
|
|
3
|
+
import type { IColor } from '@visactor/vrender';
|
|
4
|
+
import type { CoordinateType } from '@visactor/vgrammar-coordinate';
|
|
5
|
+
import type { IElement } from './../types/element';
|
|
6
|
+
import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, EventSpec, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme, TypeAnimation, IGlyphElement } from '../types/';
|
|
7
|
+
import type { IRenderer } from '../types/renderer';
|
|
8
|
+
import { LayoutState } from '../graph/enums';
|
|
9
|
+
import type { IAxis, ICrosshair, IDatazoom, IDimensionTooltip, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle, ITooltip } from '../types/component';
|
|
10
|
+
export default class View extends EventEmitter implements IView {
|
|
11
|
+
container: HTMLElement;
|
|
12
|
+
renderer: IRenderer;
|
|
13
|
+
animate: IViewAnimate;
|
|
14
|
+
rootMark: IGroupMark;
|
|
15
|
+
hooks: Hooks;
|
|
16
|
+
logger: ILogger;
|
|
17
|
+
grammars: IRecordedGrammars;
|
|
18
|
+
private _spec;
|
|
19
|
+
private _config;
|
|
20
|
+
private _options;
|
|
21
|
+
private _cachedGrammars;
|
|
22
|
+
private _willMorphMarks;
|
|
23
|
+
private _morph;
|
|
24
|
+
private _eventConfig;
|
|
25
|
+
private _globalCursor;
|
|
26
|
+
private _eventListeners;
|
|
27
|
+
private _theme;
|
|
28
|
+
private _dataflow;
|
|
29
|
+
private _currentDataflow?;
|
|
30
|
+
private _running?;
|
|
31
|
+
private _needBuildLayoutTree?;
|
|
32
|
+
private _layoutState?;
|
|
33
|
+
private _layoutMarks?;
|
|
34
|
+
private _background?;
|
|
35
|
+
private _eventCache;
|
|
36
|
+
private _progressiveMarks?;
|
|
37
|
+
private _progressiveRafId?;
|
|
38
|
+
private _cursorValue?;
|
|
39
|
+
private _observer;
|
|
40
|
+
static useRegisters(comps: (() => void)[]): void;
|
|
41
|
+
static useAnimations(comps: (TypeAnimation<IGlyphElement> | TypeAnimation<IElement>)[]): void;
|
|
42
|
+
constructor(options?: IViewOptions, config?: IViewThemeConfig);
|
|
43
|
+
getGrammarById(id: string): IGrammarBase;
|
|
44
|
+
getSignalById<T>(id: string): ISignal<T> | null;
|
|
45
|
+
getDataById(id: string): IData | null;
|
|
46
|
+
getScaleById(id: string): IScale | null;
|
|
47
|
+
getCoordinateById(id: string): ICoordinate;
|
|
48
|
+
getMarkById(id: string): IMark | null;
|
|
49
|
+
getCustomizedById(id: string): IGrammarBase | null;
|
|
50
|
+
getGrammarsByName(name: string): IGrammarBase[];
|
|
51
|
+
getGrammarsByType(grammarType: string): IGrammarBase[];
|
|
52
|
+
getMarksByType(markType: string): IMark[];
|
|
53
|
+
private updateSignal;
|
|
54
|
+
signal<T>(value?: T, update?: SignalFunctionType<T>): ISignal<T>;
|
|
55
|
+
data(values?: any[]): IData;
|
|
56
|
+
scale(type: GrammarScaleType): IScale;
|
|
57
|
+
coordinate(type: CoordinateType): ICoordinate;
|
|
58
|
+
mark(type: MarkType, group?: IGroupMark | string, markOptions?: {
|
|
59
|
+
glyphType?: string;
|
|
60
|
+
componentType?: string;
|
|
61
|
+
mode?: '2d' | '3d';
|
|
62
|
+
}): IMark;
|
|
63
|
+
group(group?: IGroupMark | string): IGroupMark;
|
|
64
|
+
glyph(glyphType: string, group: IGroupMark | string): IGlyphMark;
|
|
65
|
+
component(componentType: string, group: IGroupMark | string, mode?: '2d' | '3d'): IComponent;
|
|
66
|
+
axis(group: IGroupMark | string, mode?: '2d' | '3d'): IAxis;
|
|
67
|
+
grid(group: IGroupMark | string, mode?: '2d' | '3d'): IGrid;
|
|
68
|
+
legend(group: IGroupMark | string): ILegend;
|
|
69
|
+
crosshair(group: IGroupMark | string): ICrosshair;
|
|
70
|
+
slider(group: IGroupMark | string): ISlider;
|
|
71
|
+
label(group: IGroupMark | string): ILabel;
|
|
72
|
+
datazoom(group: IGroupMark | string): IDatazoom;
|
|
73
|
+
player(group: IGroupMark | string): IPlayer;
|
|
74
|
+
tooltip(group: IGroupMark | string): ITooltip;
|
|
75
|
+
dimensionTooltip(group: IGroupMark | string): IDimensionTooltip;
|
|
76
|
+
title(group: IGroupMark | string): ITitle;
|
|
77
|
+
scrollbar(group: IGroupMark | string): IScrollbar;
|
|
78
|
+
customized(type: string, spec: any): IGrammarBase;
|
|
79
|
+
addGrammar(grammar: IGrammarBase): this;
|
|
80
|
+
removeGrammar(grammar: string | IGrammarBase): this;
|
|
81
|
+
removeAllGrammars(): this;
|
|
82
|
+
parseSpec(spec: ViewSpec): this;
|
|
83
|
+
updateSpec(spec: ViewSpec): this;
|
|
84
|
+
private parseBuiltIn;
|
|
85
|
+
private parseMarkSpec;
|
|
86
|
+
theme(theme: ITheme | string): this;
|
|
87
|
+
getCurrentTheme(): ITheme;
|
|
88
|
+
setCurrentTheme(theme: ITheme | string, render?: boolean): Promise<this>;
|
|
89
|
+
background(value?: IColor): IColor;
|
|
90
|
+
width(value?: number): number;
|
|
91
|
+
height(value?: number): number;
|
|
92
|
+
viewWidth(value?: number): number;
|
|
93
|
+
viewHeight(value?: number): number;
|
|
94
|
+
padding(value?: number | {
|
|
95
|
+
top?: number;
|
|
96
|
+
left?: number;
|
|
97
|
+
right?: number;
|
|
98
|
+
bottom?: number;
|
|
99
|
+
}): {
|
|
100
|
+
top: number;
|
|
101
|
+
left: number;
|
|
102
|
+
right: number;
|
|
103
|
+
bottom: number;
|
|
104
|
+
};
|
|
105
|
+
autoFit(value?: boolean): boolean;
|
|
106
|
+
getViewBox(): IBounds;
|
|
107
|
+
updateLayoutTag(): this;
|
|
108
|
+
getLayoutState(): LayoutState;
|
|
109
|
+
private buildLayoutTree;
|
|
110
|
+
private doLayout;
|
|
111
|
+
private handleLayoutEnd;
|
|
112
|
+
private handleRenderEnd;
|
|
113
|
+
commit(grammar: IGrammarBase): this;
|
|
114
|
+
run(runningConfig?: IRunningConfig): this;
|
|
115
|
+
runSync(runningConfig?: IRunningConfig): this;
|
|
116
|
+
isRunning(): Promise<this>;
|
|
117
|
+
runAsync(runningConfig?: IRunningConfig): Promise<this>;
|
|
118
|
+
runNextTick(runningConfig?: IRunningConfig): Promise<this>;
|
|
119
|
+
private doRender;
|
|
120
|
+
private evaluate;
|
|
121
|
+
private evaluateSync;
|
|
122
|
+
private reuseCachedGrammars;
|
|
123
|
+
private detachCachedGrammar;
|
|
124
|
+
private releaseCachedGrammars;
|
|
125
|
+
runAfter(callback: (view: IView) => void): this;
|
|
126
|
+
runBefore(callback: (view: IView) => void): this;
|
|
127
|
+
getImageBuffer(): any;
|
|
128
|
+
traverseMarkTree(apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean): this;
|
|
129
|
+
private _bindResizeEvent;
|
|
130
|
+
private _unBindResizeEvent;
|
|
131
|
+
private _getContainerSize;
|
|
132
|
+
private _onResize;
|
|
133
|
+
resize(width: number, height: number, render?: boolean): Promise<this>;
|
|
134
|
+
private _resizeRenderer;
|
|
135
|
+
private bindEvents;
|
|
136
|
+
event(eventSpec: EventSpec): void;
|
|
137
|
+
private hover;
|
|
138
|
+
cursor(): void;
|
|
139
|
+
private initEvent;
|
|
140
|
+
private delegateEvent;
|
|
141
|
+
addEventListener(type: string, handler: BaseEventHandler, options?: any): this;
|
|
142
|
+
removeEventListener(type: string, handler?: BaseEventHandler): this;
|
|
143
|
+
private setCursor;
|
|
144
|
+
globalCursor(_?: boolean): string | boolean | this;
|
|
145
|
+
private initializeRenderer;
|
|
146
|
+
private initializeBuiltEvents;
|
|
147
|
+
private initialize;
|
|
148
|
+
normalBrowserEnv(): boolean;
|
|
149
|
+
pauseProgressive(): boolean;
|
|
150
|
+
resumeProgressive(): boolean;
|
|
151
|
+
restartProgressive(): boolean;
|
|
152
|
+
private findProgressiveMarks;
|
|
153
|
+
private doPreProgressive;
|
|
154
|
+
private handleProgressiveFrame;
|
|
155
|
+
private clearProgressive;
|
|
156
|
+
release(): void;
|
|
157
|
+
}
|