@antv/g2 5.0.0-alpha.0 → 5.0.0-alpha.1
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.en-US.md +47 -75
- package/README.md +47 -83
- package/dist/g2.min.js +3 -3
- package/esm/animation/fadeIn.js +4 -6
- package/esm/animation/fadeIn.js.map +1 -1
- package/esm/animation/fadeOut.js +4 -4
- package/esm/animation/fadeOut.js.map +1 -1
- package/esm/animation/morphing.js +4 -5
- package/esm/animation/morphing.js.map +1 -1
- package/esm/animation/scaleInX.js +4 -5
- package/esm/animation/scaleInX.js.map +1 -1
- package/esm/animation/scaleInY.js +4 -5
- package/esm/animation/scaleInY.js.map +1 -1
- package/esm/animation/scaleOutX.js +4 -5
- package/esm/animation/scaleOutX.js.map +1 -1
- package/esm/animation/scaleOutY.js +4 -5
- package/esm/animation/scaleOutY.js.map +1 -1
- package/esm/api/chart.d.ts +4 -1
- package/esm/api/chart.js +12 -4
- package/esm/api/chart.js.map +1 -1
- package/esm/api/composition/circle.js.map +1 -1
- package/esm/api/composition/flex.js.map +1 -1
- package/esm/api/composition/keyframe.js.map +1 -1
- package/esm/api/composition/layer.js.map +1 -1
- package/esm/api/composition/matrix.js.map +1 -1
- package/esm/api/composition/rect.js.map +1 -1
- package/esm/api/composition/view.js.map +1 -1
- package/esm/api/index.d.ts +1 -0
- package/esm/api/index.js +1 -0
- package/esm/api/index.js.map +1 -1
- package/esm/api/library.d.ts +3 -0
- package/esm/api/library.js +7 -0
- package/esm/api/library.js.map +1 -0
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/composition/circle.js +1 -1
- package/esm/composition/circle.js.map +1 -1
- package/esm/composition/flex.js +4 -2
- package/esm/composition/flex.js.map +1 -1
- package/esm/composition/layer.js +3 -3
- package/esm/composition/layer.js.map +1 -1
- package/esm/composition/mark.js +2 -1
- package/esm/composition/mark.js.map +1 -1
- package/esm/composition/rect.js +29 -30
- package/esm/composition/rect.js.map +1 -1
- package/esm/composition/utils.d.ts +6 -0
- package/esm/composition/utils.js +19 -0
- package/esm/composition/utils.js.map +1 -1
- package/esm/composition/view.js +3 -2
- package/esm/composition/view.js.map +1 -1
- package/esm/coordinate/fisheye.d.ts +1 -1
- package/esm/coordinate/fisheye.js +1 -1
- package/esm/coordinate/fisheye.js.map +1 -1
- package/esm/coordinate/fisheyeX.d.ts +7 -0
- package/esm/coordinate/fisheyeX.js +6 -0
- package/esm/coordinate/fisheyeX.js.map +1 -0
- package/esm/coordinate/fisheyeY.d.ts +7 -0
- package/esm/coordinate/fisheyeY.js +6 -0
- package/esm/coordinate/fisheyeY.js.map +1 -0
- package/esm/coordinate/helix.d.ts +7 -0
- package/esm/coordinate/helix.js +11 -0
- package/esm/coordinate/helix.js.map +1 -0
- package/esm/coordinate/index.d.ts +7 -0
- package/esm/coordinate/index.js +7 -0
- package/esm/coordinate/index.js.map +1 -1
- package/esm/coordinate/reflect.d.ts +7 -0
- package/esm/coordinate/reflect.js +10 -0
- package/esm/coordinate/reflect.js.map +1 -0
- package/esm/coordinate/reflectX.d.ts +7 -0
- package/esm/coordinate/reflectX.js +10 -0
- package/esm/coordinate/reflectX.js.map +1 -0
- package/esm/coordinate/reflectY.d.ts +7 -0
- package/esm/coordinate/reflectY.js +10 -0
- package/esm/coordinate/reflectY.js.map +1 -0
- package/esm/coordinate/theta.d.ts +7 -0
- package/esm/coordinate/theta.js +11 -0
- package/esm/coordinate/theta.js.map +1 -0
- package/esm/data/arc.d.ts +0 -0
- package/esm/data/arc.js +19 -0
- package/esm/data/arc.js.map +1 -0
- package/esm/data/cluster.d.ts +0 -0
- package/esm/data/cluster.js +47 -0
- package/esm/data/cluster.js.map +1 -0
- package/esm/data/connector.d.ts +7 -0
- package/esm/data/connector.js +9 -0
- package/esm/data/connector.js.map +1 -0
- package/esm/data/fetch.d.ts +4 -0
- package/esm/{transform/preprocessor → data}/fetch.js +10 -19
- package/esm/data/fetch.js.map +1 -0
- package/esm/{transform/preprocessor → data}/filterBy.d.ts +3 -3
- package/esm/{transform/preprocessor → data}/filterBy.js +2 -7
- package/esm/data/filterBy.js.map +1 -0
- package/esm/data/fold.d.ts +10 -0
- package/esm/data/fold.js +24 -0
- package/esm/data/fold.js.map +1 -0
- package/esm/data/index.d.ts +9 -0
- package/esm/data/index.js +10 -0
- package/esm/data/index.js.map +1 -0
- package/esm/data/inline.d.ts +4 -0
- package/esm/data/inline.js +6 -0
- package/esm/data/inline.js.map +1 -0
- package/esm/data/pick.d.ts +7 -0
- package/esm/{transform/preprocessor → data}/pick.js +1 -3
- package/esm/data/pick.js.map +1 -0
- package/esm/{transform/preprocessor → data}/rename.d.ts +3 -3
- package/esm/{transform/preprocessor → data}/rename.js +4 -7
- package/esm/data/rename.js.map +1 -0
- package/esm/data/sankey.d.ts +0 -0
- package/esm/data/sankey.js +96 -0
- package/esm/data/sankey.js.map +1 -0
- package/esm/data/sortBy.d.ts +7 -0
- package/esm/{transform/preprocessor → data}/sortBy.js +4 -9
- package/esm/data/sortBy.js.map +1 -0
- package/esm/data/subset.d.ts +7 -0
- package/esm/{transform/preprocessor → data}/subset.js +5 -10
- package/esm/data/subset.js.map +1 -0
- package/esm/data/tree.d.ts +0 -0
- package/esm/data/tree.js +10 -0
- package/esm/data/tree.js.map +1 -0
- package/esm/{transform → data}/utils/arc/arc.d.ts +0 -0
- package/esm/{transform → data}/utils/arc/arc.js +0 -0
- package/esm/data/utils/arc/arc.js.map +1 -0
- package/esm/{transform → data}/utils/arc/index.d.ts +0 -0
- package/esm/{transform → data}/utils/arc/index.js +0 -0
- package/esm/data/utils/arc/index.js.map +1 -0
- package/esm/{transform → data}/utils/arc/sort.d.ts +0 -0
- package/esm/{transform → data}/utils/arc/sort.js +0 -0
- package/esm/data/utils/arc/sort.js.map +1 -0
- package/esm/{transform → data}/utils/arc/types.d.ts +0 -0
- package/esm/{transform → data}/utils/arc/types.js +0 -0
- package/esm/data/utils/arc/types.js.map +1 -0
- package/esm/{transform → data}/utils/d3-cloud/index.d.ts +0 -0
- package/esm/{transform → data}/utils/d3-cloud/index.js +0 -0
- package/esm/data/utils/d3-cloud/index.js.map +1 -0
- package/esm/{transform → data}/utils/d3-sankey/align.d.ts +0 -0
- package/esm/{transform → data}/utils/d3-sankey/align.js +0 -0
- package/esm/data/utils/d3-sankey/align.js.map +1 -0
- package/esm/{transform → data}/utils/d3-sankey/constant.d.ts +0 -0
- package/esm/{transform → data}/utils/d3-sankey/constant.js +0 -0
- package/esm/data/utils/d3-sankey/constant.js.map +1 -0
- package/esm/{transform → data}/utils/d3-sankey/index.d.ts +0 -0
- package/esm/{transform → data}/utils/d3-sankey/index.js +0 -0
- package/esm/data/utils/d3-sankey/index.js.map +1 -0
- package/esm/{transform → data}/utils/d3-sankey/sankey.d.ts +0 -0
- package/esm/{transform → data}/utils/d3-sankey/sankey.js +0 -0
- package/esm/data/utils/d3-sankey/sankey.js.map +1 -0
- package/esm/{transform → data}/utils/flow.d.ts +0 -0
- package/esm/{transform → data}/utils/flow.js +0 -0
- package/esm/data/utils/flow.js.map +1 -0
- package/esm/{transform → data}/utils/memo.d.ts +0 -0
- package/esm/{transform → data}/utils/memo.js +0 -0
- package/esm/data/utils/memo.js.map +1 -0
- package/esm/data/voronoi.d.ts +0 -0
- package/esm/data/voronoi.js +27 -0
- package/esm/data/voronoi.js.map +1 -0
- package/esm/data/wordCloud.d.ts +0 -0
- package/esm/data/wordCloud.js +100 -0
- package/esm/data/wordCloud.js.map +1 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/interaction/action/service/fisheyeFocus.js +7 -3
- package/esm/interaction/action/service/fisheyeFocus.js.map +1 -1
- package/esm/interaction/action/transformer/filter.js +9 -3
- package/esm/interaction/action/transformer/filter.js.map +1 -1
- package/esm/interaction/builtin/fisheye.d.ts +2 -0
- package/esm/labelLayout/hideOverlap.d.ts +2 -0
- package/esm/labelLayout/hideOverlap.js +38 -0
- package/esm/labelLayout/hideOverlap.js.map +1 -0
- package/esm/labelLayout/index.d.ts +1 -0
- package/esm/labelLayout/index.js +2 -0
- package/esm/labelLayout/index.js.map +1 -0
- package/esm/mark/utils.d.ts +1 -3
- package/esm/mark/utils.js +1 -1
- package/esm/mark/utils.js.map +1 -1
- package/esm/runtime/component.js +11 -3
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/coordinate.d.ts +4 -0
- package/esm/runtime/coordinate.js +16 -0
- package/esm/runtime/coordinate.js.map +1 -1
- package/esm/runtime/index.d.ts +1 -0
- package/esm/runtime/index.js +1 -0
- package/esm/runtime/index.js.map +1 -1
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/mark.d.ts +3 -3
- package/esm/runtime/mark.js +34 -90
- package/esm/runtime/mark.js.map +1 -1
- package/esm/runtime/plot.js +19 -13
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.js +4 -15
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/scale.js +14 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.d.ts +9 -0
- package/esm/runtime/transform.js +144 -0
- package/esm/runtime/transform.js.map +1 -0
- package/esm/runtime/types/common.d.ts +5 -3
- package/esm/runtime/types/component.d.ts +5 -2
- package/esm/runtime/types/data.d.ts +7 -0
- package/esm/runtime/types/data.js +2 -0
- package/esm/runtime/types/data.js.map +1 -0
- package/esm/runtime/types/encode.d.ts +4 -2
- package/esm/runtime/types/options.d.ts +6 -3
- package/esm/runtime/types/transform.d.ts +6 -12
- package/esm/shape/interval/colorRect.js +4 -22
- package/esm/shape/interval/colorRect.js.map +1 -1
- package/esm/shape/label/label.js +81 -10
- package/esm/shape/label/label.js.map +1 -1
- package/esm/shape/utils.d.ts +7 -0
- package/esm/shape/utils.js +23 -0
- package/esm/shape/utils.js.map +1 -1
- package/esm/spec/composition.d.ts +8 -5
- package/esm/spec/coordinate.d.ts +46 -2
- package/esm/spec/data.d.ts +54 -0
- package/esm/spec/data.js +2 -0
- package/esm/spec/data.js.map +1 -0
- package/esm/spec/geometry.d.ts +2 -1
- package/esm/spec/index.d.ts +2 -1
- package/esm/spec/index.js +2 -1
- package/esm/spec/index.js.map +1 -1
- package/esm/spec/labelLayout.d.ts +4 -0
- package/esm/spec/labelLayout.js +2 -0
- package/esm/spec/labelLayout.js.map +1 -0
- package/esm/spec/transform.d.ts +58 -166
- package/esm/spec/transform.js +133 -0
- package/esm/spec/transform.js.map +1 -1
- package/esm/stdlib/index.js +28 -17
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/light.js +1 -0
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/{statistic/Select.d.ts → Select.d.ts} +2 -2
- package/esm/transform/{statistic/Select.js → Select.js} +9 -14
- package/esm/transform/Select.js.map +1 -0
- package/esm/transform/{statistic/SelectX.d.ts → SelectX.d.ts} +2 -2
- package/esm/transform/{statistic/SelectX.js → SelectX.js} +1 -3
- package/esm/transform/SelectX.js.map +1 -0
- package/esm/transform/{statistic/SelectY.d.ts → SelectY.d.ts} +2 -2
- package/esm/transform/{statistic/SelectY.js → SelectY.js} +1 -3
- package/esm/transform/SelectY.js.map +1 -0
- package/esm/transform/{statistic/dodgeX.d.ts → dodgeX.d.ts} +2 -2
- package/esm/transform/{statistic/dodgeX.js → dodgeX.js} +19 -19
- package/esm/transform/dodgeX.js.map +1 -0
- package/{lib/transform/statistic → esm/transform}/groupX.d.ts +3 -2
- package/esm/transform/{statistic/groupX.js → groupX.js} +23 -19
- package/esm/transform/groupX.js.map +1 -0
- package/esm/transform/index.d.ts +21 -36
- package/esm/transform/index.js +21 -39
- package/esm/transform/index.js.map +1 -1
- package/esm/transform/{statistic/jitter.d.ts → jitter.d.ts} +3 -3
- package/esm/transform/{statistic/jitter.js → jitter.js} +14 -18
- package/esm/transform/jitter.js.map +1 -0
- package/{lib/transform/statistic → esm/transform}/jitterY.d.ts +2 -2
- package/esm/transform/jitterY.js +21 -0
- package/esm/transform/jitterY.js.map +1 -0
- package/esm/transform/maybeKey.d.ts +6 -0
- package/esm/transform/{inference/maybeKey.js → maybeKey.js} +11 -12
- package/esm/transform/maybeKey.js.map +1 -0
- package/esm/transform/maybeSeries.d.ts +6 -0
- package/esm/transform/maybeSeries.js +17 -0
- package/esm/transform/maybeSeries.js.map +1 -0
- package/esm/transform/maybeSize.d.ts +7 -0
- package/esm/transform/maybeSize.js +20 -0
- package/esm/transform/maybeSize.js.map +1 -0
- package/{lib/transform/inference → esm/transform}/maybeStackY.d.ts +1 -1
- package/esm/transform/{inference/maybeStackY.js → maybeStackY.js} +11 -13
- package/esm/transform/maybeStackY.js.map +1 -0
- package/esm/transform/maybeTitleX.d.ts +6 -0
- package/esm/transform/maybeTitleX.js +17 -0
- package/esm/transform/maybeTitleX.js.map +1 -0
- package/esm/transform/maybeTooltip.d.ts +8 -0
- package/esm/transform/maybeTooltip.js +29 -0
- package/esm/transform/maybeTooltip.js.map +1 -0
- package/esm/transform/{inference/maybeTooltipPosition.d.ts → maybeTooltipPosition.d.ts} +3 -3
- package/esm/transform/maybeTooltipPosition.js +10 -0
- package/esm/transform/maybeTooltipPosition.js.map +1 -0
- package/esm/transform/maybeTooltipY.d.ts +6 -0
- package/esm/transform/maybeTooltipY.js +9 -0
- package/esm/transform/maybeTooltipY.js.map +1 -0
- package/{lib/transform/inference → esm/transform}/maybeZeroX.d.ts +1 -1
- package/esm/transform/maybeZeroX.js +22 -0
- package/esm/transform/maybeZeroX.js.map +1 -0
- package/esm/transform/maybeZeroY.d.ts +6 -0
- package/esm/transform/maybeZeroY.js +21 -0
- package/esm/transform/maybeZeroY.js.map +1 -0
- package/esm/transform/maybeZeroY1.d.ts +6 -0
- package/esm/transform/maybeZeroY1.js +21 -0
- package/esm/transform/maybeZeroY1.js.map +1 -0
- package/esm/transform/{statistic/normalizeY.d.ts → normalizeY.d.ts} +2 -2
- package/esm/transform/{statistic/normalizeY.js → normalizeY.js} +16 -17
- package/esm/transform/normalizeY.js.map +1 -0
- package/esm/transform/{statistic/stackEnter.d.ts → stackEnter.d.ts} +2 -2
- package/esm/transform/{statistic/stackEnter.js → stackEnter.js} +22 -19
- package/esm/transform/stackEnter.js.map +1 -0
- package/esm/transform/{statistic/stackY.d.ts → stackY.d.ts} +2 -2
- package/esm/transform/{statistic/stackY.js → stackY.js} +20 -19
- package/esm/transform/stackY.js.map +1 -0
- package/esm/transform/{statistic/symmetryY.d.ts → symmetryY.d.ts} +2 -2
- package/esm/transform/{statistic/symmetryY.js → symmetryY.js} +16 -17
- package/esm/transform/symmetryY.js.map +1 -0
- package/esm/transform/utils/helper.d.ts +11 -10
- package/esm/transform/utils/helper.js +27 -33
- package/esm/transform/utils/helper.js.map +1 -1
- package/esm/transform/{statistic/utils.d.ts → utils/order.d.ts} +4 -4
- package/esm/transform/{statistic/utils.js → utils/order.js} +7 -5
- package/esm/transform/utils/order.js.map +1 -0
- package/esm/utils/coordinate.d.ts +1 -0
- package/esm/utils/coordinate.js +4 -0
- package/esm/utils/coordinate.js.map +1 -1
- package/lib/animation/fadeIn.js +4 -6
- package/lib/animation/fadeIn.js.map +1 -1
- package/lib/animation/fadeOut.js +4 -4
- package/lib/animation/fadeOut.js.map +1 -1
- package/lib/animation/morphing.js +4 -5
- package/lib/animation/morphing.js.map +1 -1
- package/lib/animation/scaleInX.js +4 -5
- package/lib/animation/scaleInX.js.map +1 -1
- package/lib/animation/scaleInY.js +4 -5
- package/lib/animation/scaleInY.js.map +1 -1
- package/lib/animation/scaleOutX.js +4 -5
- package/lib/animation/scaleOutX.js.map +1 -1
- package/lib/animation/scaleOutY.js +4 -5
- package/lib/animation/scaleOutY.js.map +1 -1
- package/lib/api/chart.d.ts +4 -1
- package/lib/api/chart.js +12 -4
- package/lib/api/chart.js.map +1 -1
- package/lib/api/composition/circle.js.map +1 -1
- package/lib/api/composition/flex.js.map +1 -1
- package/lib/api/composition/keyframe.js.map +1 -1
- package/lib/api/composition/layer.js.map +1 -1
- package/lib/api/composition/matrix.js.map +1 -1
- package/lib/api/composition/rect.js.map +1 -1
- package/lib/api/composition/view.js.map +1 -1
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +3 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/library.d.ts +3 -0
- package/lib/api/library.js +11 -0
- package/lib/api/library.js.map +1 -0
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/composition/circle.js +1 -1
- package/lib/composition/circle.js.map +1 -1
- package/lib/composition/flex.js +4 -2
- package/lib/composition/flex.js.map +1 -1
- package/lib/composition/layer.js +3 -3
- package/lib/composition/layer.js.map +1 -1
- package/lib/composition/mark.js +2 -1
- package/lib/composition/mark.js.map +1 -1
- package/lib/composition/rect.js +29 -30
- package/lib/composition/rect.js.map +1 -1
- package/lib/composition/utils.d.ts +6 -0
- package/lib/composition/utils.js +21 -1
- package/lib/composition/utils.js.map +1 -1
- package/lib/composition/view.js +3 -2
- package/lib/composition/view.js.map +1 -1
- package/lib/coordinate/fisheye.d.ts +1 -1
- package/lib/coordinate/fisheye.js +1 -1
- package/lib/coordinate/fisheye.js.map +1 -1
- package/lib/coordinate/fisheyeX.d.ts +7 -0
- package/lib/coordinate/fisheyeX.js +10 -0
- package/lib/coordinate/fisheyeX.js.map +1 -0
- package/lib/coordinate/fisheyeY.d.ts +7 -0
- package/lib/coordinate/fisheyeY.js +10 -0
- package/lib/coordinate/fisheyeY.js.map +1 -0
- package/lib/coordinate/helix.d.ts +7 -0
- package/lib/coordinate/helix.js +15 -0
- package/lib/coordinate/helix.js.map +1 -0
- package/lib/coordinate/index.d.ts +7 -0
- package/lib/coordinate/index.js +15 -1
- package/lib/coordinate/index.js.map +1 -1
- package/lib/coordinate/reflect.d.ts +7 -0
- package/lib/coordinate/reflect.js +14 -0
- package/lib/coordinate/reflect.js.map +1 -0
- package/lib/coordinate/reflectX.d.ts +7 -0
- package/lib/coordinate/reflectX.js +14 -0
- package/lib/coordinate/reflectX.js.map +1 -0
- package/lib/coordinate/reflectY.d.ts +7 -0
- package/lib/coordinate/reflectY.js +14 -0
- package/lib/coordinate/reflectY.js.map +1 -0
- package/lib/coordinate/theta.d.ts +7 -0
- package/lib/coordinate/theta.js +15 -0
- package/lib/coordinate/theta.js.map +1 -0
- package/lib/data/arc.d.ts +0 -0
- package/lib/data/arc.js +19 -0
- package/lib/data/arc.js.map +1 -0
- package/lib/data/cluster.d.ts +0 -0
- package/lib/data/cluster.js +47 -0
- package/lib/data/cluster.js.map +1 -0
- package/lib/data/connector.d.ts +7 -0
- package/lib/data/connector.js +13 -0
- package/lib/data/connector.js.map +1 -0
- package/lib/data/fetch.d.ts +4 -0
- package/lib/{transform/preprocessor → data}/fetch.js +10 -19
- package/lib/data/fetch.js.map +1 -0
- package/lib/{transform/preprocessor → data}/filterBy.d.ts +3 -3
- package/lib/{transform/preprocessor → data}/filterBy.js +2 -7
- package/lib/data/filterBy.js.map +1 -0
- package/lib/data/fold.d.ts +10 -0
- package/lib/data/fold.js +29 -0
- package/lib/data/fold.js.map +1 -0
- package/lib/data/index.d.ts +9 -0
- package/lib/data/index.js +22 -0
- package/lib/data/index.js.map +1 -0
- package/lib/data/inline.d.ts +4 -0
- package/lib/data/inline.js +10 -0
- package/lib/data/inline.js.map +1 -0
- package/lib/data/pick.d.ts +7 -0
- package/lib/{transform/preprocessor → data}/pick.js +1 -3
- package/lib/data/pick.js.map +1 -0
- package/lib/{transform/preprocessor → data}/rename.d.ts +3 -3
- package/lib/{transform/preprocessor → data}/rename.js +4 -7
- package/lib/data/rename.js.map +1 -0
- package/lib/data/sankey.d.ts +0 -0
- package/lib/data/sankey.js +96 -0
- package/lib/data/sankey.js.map +1 -0
- package/lib/data/sortBy.d.ts +7 -0
- package/lib/{transform/preprocessor → data}/sortBy.js +4 -9
- package/lib/data/sortBy.js.map +1 -0
- package/lib/data/subset.d.ts +7 -0
- package/lib/{transform/preprocessor → data}/subset.js +5 -10
- package/lib/data/subset.js.map +1 -0
- package/lib/data/tree.d.ts +0 -0
- package/lib/data/tree.js +10 -0
- package/lib/data/tree.js.map +1 -0
- package/lib/{transform → data}/utils/arc/arc.d.ts +0 -0
- package/lib/{transform → data}/utils/arc/arc.js +0 -0
- package/lib/data/utils/arc/arc.js.map +1 -0
- package/lib/{transform → data}/utils/arc/index.d.ts +0 -0
- package/lib/{transform → data}/utils/arc/index.js +0 -0
- package/lib/data/utils/arc/index.js.map +1 -0
- package/lib/{transform → data}/utils/arc/sort.d.ts +0 -0
- package/lib/{transform → data}/utils/arc/sort.js +0 -0
- package/lib/data/utils/arc/sort.js.map +1 -0
- package/lib/{transform → data}/utils/arc/types.d.ts +0 -0
- package/lib/{transform → data}/utils/arc/types.js +0 -0
- package/lib/data/utils/arc/types.js.map +1 -0
- package/lib/{transform → data}/utils/d3-cloud/index.d.ts +0 -0
- package/lib/{transform → data}/utils/d3-cloud/index.js +0 -0
- package/lib/data/utils/d3-cloud/index.js.map +1 -0
- package/lib/{transform → data}/utils/d3-sankey/align.d.ts +0 -0
- package/lib/{transform → data}/utils/d3-sankey/align.js +0 -0
- package/lib/data/utils/d3-sankey/align.js.map +1 -0
- package/lib/{transform → data}/utils/d3-sankey/constant.d.ts +0 -0
- package/lib/{transform → data}/utils/d3-sankey/constant.js +0 -0
- package/lib/data/utils/d3-sankey/constant.js.map +1 -0
- package/lib/{transform → data}/utils/d3-sankey/index.d.ts +0 -0
- package/lib/{transform → data}/utils/d3-sankey/index.js +0 -0
- package/lib/data/utils/d3-sankey/index.js.map +1 -0
- package/lib/{transform → data}/utils/d3-sankey/sankey.d.ts +0 -0
- package/lib/{transform → data}/utils/d3-sankey/sankey.js +0 -0
- package/lib/data/utils/d3-sankey/sankey.js.map +1 -0
- package/lib/{transform → data}/utils/flow.d.ts +0 -0
- package/lib/{transform → data}/utils/flow.js +0 -0
- package/lib/data/utils/flow.js.map +1 -0
- package/lib/{transform → data}/utils/memo.d.ts +0 -0
- package/lib/{transform → data}/utils/memo.js +0 -0
- package/lib/data/utils/memo.js.map +1 -0
- package/lib/data/voronoi.d.ts +0 -0
- package/lib/data/voronoi.js +27 -0
- package/lib/data/voronoi.js.map +1 -0
- package/lib/data/wordCloud.d.ts +0 -0
- package/lib/data/wordCloud.js +100 -0
- package/lib/data/wordCloud.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/interaction/action/service/fisheyeFocus.js +7 -3
- package/lib/interaction/action/service/fisheyeFocus.js.map +1 -1
- package/lib/interaction/action/transformer/filter.js +9 -3
- package/lib/interaction/action/transformer/filter.js.map +1 -1
- package/lib/interaction/builtin/fisheye.d.ts +2 -0
- package/lib/labelLayout/hideOverlap.d.ts +2 -0
- package/lib/labelLayout/hideOverlap.js +42 -0
- package/lib/labelLayout/hideOverlap.js.map +1 -0
- package/lib/labelLayout/index.d.ts +1 -0
- package/lib/labelLayout/index.js +6 -0
- package/lib/labelLayout/index.js.map +1 -0
- package/lib/mark/utils.d.ts +1 -3
- package/lib/mark/utils.js +1 -1
- package/lib/mark/utils.js.map +1 -1
- package/lib/runtime/component.js +10 -2
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/coordinate.d.ts +4 -0
- package/lib/runtime/coordinate.js +21 -1
- package/lib/runtime/coordinate.js.map +1 -1
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/mark.d.ts +3 -3
- package/lib/runtime/mark.js +34 -90
- package/lib/runtime/mark.js.map +1 -1
- package/lib/runtime/plot.js +17 -11
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.js +4 -15
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/scale.js +13 -4
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.d.ts +9 -0
- package/lib/runtime/transform.js +154 -0
- package/lib/runtime/transform.js.map +1 -0
- package/lib/runtime/types/common.d.ts +5 -3
- package/lib/runtime/types/component.d.ts +5 -2
- package/lib/runtime/types/data.d.ts +7 -0
- package/lib/{spec/statistic.js → runtime/types/data.js} +1 -1
- package/lib/runtime/types/data.js.map +1 -0
- package/lib/runtime/types/encode.d.ts +4 -2
- package/lib/runtime/types/options.d.ts +6 -3
- package/lib/runtime/types/transform.d.ts +6 -12
- package/lib/shape/interval/colorRect.js +2 -20
- package/lib/shape/interval/colorRect.js.map +1 -1
- package/lib/shape/label/label.js +80 -9
- package/lib/shape/label/label.js.map +1 -1
- package/lib/shape/utils.d.ts +7 -0
- package/lib/shape/utils.js +25 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/spec/composition.d.ts +8 -5
- package/lib/spec/coordinate.d.ts +46 -2
- package/lib/spec/data.d.ts +54 -0
- package/lib/spec/data.js +3 -0
- package/lib/spec/data.js.map +1 -0
- package/lib/spec/geometry.d.ts +2 -1
- package/lib/spec/index.d.ts +2 -1
- package/lib/spec/index.js +2 -1
- package/lib/spec/index.js.map +1 -1
- package/lib/spec/labelLayout.d.ts +4 -0
- package/lib/spec/labelLayout.js +3 -0
- package/lib/spec/labelLayout.js.map +1 -0
- package/lib/spec/transform.d.ts +58 -166
- package/lib/spec/transform.js +133 -0
- package/lib/spec/transform.js.map +1 -1
- package/lib/stdlib/index.js +26 -15
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/light.js +1 -0
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/{statistic/Select.d.ts → Select.d.ts} +2 -2
- package/lib/transform/{statistic/Select.js → Select.js} +9 -14
- package/lib/transform/Select.js.map +1 -0
- package/lib/transform/{statistic/SelectX.d.ts → SelectX.d.ts} +2 -2
- package/lib/transform/{statistic/SelectX.js → SelectX.js} +1 -3
- package/lib/transform/SelectX.js.map +1 -0
- package/lib/transform/{statistic/SelectY.d.ts → SelectY.d.ts} +2 -2
- package/lib/transform/{statistic/SelectY.js → SelectY.js} +1 -3
- package/lib/transform/SelectY.js.map +1 -0
- package/lib/transform/{statistic/dodgeX.d.ts → dodgeX.d.ts} +2 -2
- package/lib/transform/{statistic/dodgeX.js → dodgeX.js} +22 -22
- package/lib/transform/dodgeX.js.map +1 -0
- package/{esm/transform/statistic → lib/transform}/groupX.d.ts +3 -2
- package/lib/transform/{statistic/groupX.js → groupX.js} +23 -19
- package/lib/transform/groupX.js.map +1 -0
- package/lib/transform/index.d.ts +21 -36
- package/lib/transform/index.js +22 -55
- package/lib/transform/index.js.map +1 -1
- package/lib/transform/{statistic/jitter.d.ts → jitter.d.ts} +3 -3
- package/lib/transform/{statistic/jitter.js → jitter.js} +16 -20
- package/lib/transform/jitter.js.map +1 -0
- package/{esm/transform/statistic → lib/transform}/jitterY.d.ts +2 -2
- package/lib/transform/{statistic/jitterY.js → jitterY.js} +9 -15
- package/lib/transform/jitterY.js.map +1 -0
- package/lib/transform/maybeKey.d.ts +6 -0
- package/lib/transform/{inference/maybeKey.js → maybeKey.js} +11 -12
- package/lib/transform/maybeKey.js.map +1 -0
- package/lib/transform/maybeSeries.d.ts +6 -0
- package/lib/transform/maybeSeries.js +21 -0
- package/lib/transform/maybeSeries.js.map +1 -0
- package/lib/transform/maybeSize.d.ts +7 -0
- package/lib/transform/maybeSize.js +24 -0
- package/lib/transform/maybeSize.js.map +1 -0
- package/{esm/transform/inference → lib/transform}/maybeStackY.d.ts +1 -1
- package/lib/transform/{inference/maybeStackY.js → maybeStackY.js} +11 -13
- package/lib/transform/maybeStackY.js.map +1 -0
- package/lib/transform/maybeTitleX.d.ts +6 -0
- package/lib/transform/maybeTitleX.js +21 -0
- package/lib/transform/maybeTitleX.js.map +1 -0
- package/lib/transform/maybeTooltip.d.ts +8 -0
- package/lib/transform/{inference/maybeTooltip.js → maybeTooltip.js} +13 -14
- package/lib/transform/maybeTooltip.js.map +1 -0
- package/lib/transform/{inference/maybeTooltipPosition.d.ts → maybeTooltipPosition.d.ts} +3 -3
- package/lib/transform/{inference/maybeTooltipPosition.js → maybeTooltipPosition.js} +3 -5
- package/lib/transform/maybeTooltipPosition.js.map +1 -0
- package/lib/transform/maybeTooltipY.d.ts +6 -0
- package/lib/transform/{inference/maybeTooltipY.js → maybeTooltipY.js} +2 -5
- package/lib/transform/maybeTooltipY.js.map +1 -0
- package/{esm/transform/inference → lib/transform}/maybeZeroX.d.ts +1 -1
- package/lib/transform/maybeZeroX.js +26 -0
- package/lib/transform/maybeZeroX.js.map +1 -0
- package/lib/transform/maybeZeroY.d.ts +6 -0
- package/lib/transform/maybeZeroY.js +25 -0
- package/lib/transform/maybeZeroY.js.map +1 -0
- package/lib/transform/maybeZeroY1.d.ts +6 -0
- package/lib/transform/maybeZeroY1.js +25 -0
- package/lib/transform/maybeZeroY1.js.map +1 -0
- package/lib/transform/{statistic/normalizeY.d.ts → normalizeY.d.ts} +2 -2
- package/lib/transform/{statistic/normalizeY.js → normalizeY.js} +16 -17
- package/lib/transform/normalizeY.js.map +1 -0
- package/lib/transform/{statistic/stackEnter.d.ts → stackEnter.d.ts} +2 -2
- package/lib/transform/{statistic/stackEnter.js → stackEnter.js} +22 -19
- package/lib/transform/stackEnter.js.map +1 -0
- package/lib/transform/{statistic/stackY.d.ts → stackY.d.ts} +2 -2
- package/lib/transform/{statistic/stackY.js → stackY.js} +22 -21
- package/lib/transform/stackY.js.map +1 -0
- package/lib/transform/{statistic/symmetryY.d.ts → symmetryY.d.ts} +2 -2
- package/lib/transform/{statistic/symmetryY.js → symmetryY.js} +16 -17
- package/lib/transform/symmetryY.js.map +1 -0
- package/lib/transform/utils/helper.d.ts +11 -10
- package/lib/transform/utils/helper.js +32 -38
- package/lib/transform/utils/helper.js.map +1 -1
- package/lib/transform/{statistic/utils.d.ts → utils/order.d.ts} +4 -4
- package/lib/transform/{statistic/utils.js → utils/order.js} +7 -5
- package/lib/transform/utils/order.js.map +1 -0
- package/lib/utils/coordinate.d.ts +1 -0
- package/lib/utils/coordinate.js +6 -1
- package/lib/utils/coordinate.js.map +1 -1
- package/package.json +6 -5
- package/src/animation/fadeIn.ts +4 -6
- package/src/animation/fadeOut.ts +4 -4
- package/src/animation/morphing.ts +4 -5
- package/src/animation/scaleInX.ts +9 -5
- package/src/animation/scaleInY.ts +9 -5
- package/src/animation/scaleOutX.ts +9 -5
- package/src/animation/scaleOutY.ts +9 -5
- package/src/api/chart.ts +19 -8
- package/src/api/index.ts +1 -0
- package/src/api/library.ts +12 -0
- package/src/composition/circle.ts +1 -1
- package/src/composition/flex.ts +4 -2
- package/src/composition/layer.ts +3 -2
- package/src/composition/mark.ts +3 -0
- package/src/composition/rect.ts +27 -28
- package/src/composition/utils.ts +10 -0
- package/src/composition/view.ts +3 -2
- package/src/coordinate/fisheye.ts +3 -2
- package/src/coordinate/fisheyeX.ts +15 -0
- package/src/coordinate/fisheyeY.ts +15 -0
- package/src/coordinate/helix.ts +21 -0
- package/src/coordinate/index.ts +7 -0
- package/src/coordinate/reflect.ts +15 -0
- package/src/coordinate/reflectX.ts +15 -0
- package/src/coordinate/reflectY.ts +15 -0
- package/src/coordinate/theta.ts +21 -0
- package/src/data/arc.ts +21 -0
- package/src/data/cluster.ts +56 -0
- package/src/data/connector.ts +14 -0
- package/src/data/fetch.ts +23 -0
- package/src/data/filterBy.ts +19 -0
- package/src/data/fold.ts +29 -0
- package/src/data/index.ts +9 -0
- package/src/data/inline.ts +11 -0
- package/src/{transform/preprocessor → data}/pick.ts +4 -6
- package/src/{transform/preprocessor → data}/rename.ts +7 -10
- package/src/data/sankey.ts +105 -0
- package/src/{transform/preprocessor → data}/sortBy.ts +7 -12
- package/src/{transform/preprocessor → data}/subset.ts +8 -13
- package/src/data/tree.ts +12 -0
- package/src/{transform → data}/utils/arc/arc.ts +0 -0
- package/src/{transform → data}/utils/arc/index.ts +0 -0
- package/src/{transform → data}/utils/arc/sort.ts +0 -0
- package/src/{transform → data}/utils/arc/types.ts +0 -0
- package/src/{transform → data}/utils/d3-cloud/index.ts +0 -0
- package/src/{transform → data}/utils/d3-sankey/align.ts +0 -0
- package/src/{transform → data}/utils/d3-sankey/constant.ts +0 -0
- package/src/{transform → data}/utils/d3-sankey/index.ts +0 -0
- package/src/{transform → data}/utils/d3-sankey/sankey.ts +0 -0
- package/src/{transform → data}/utils/flow.ts +0 -0
- package/src/{transform → data}/utils/memo.ts +1 -0
- package/src/data/voronoi.ts +30 -0
- package/src/data/wordCloud.ts +115 -0
- package/src/index.ts +1 -1
- package/src/interaction/action/service/fisheyeFocus.ts +16 -3
- package/src/interaction/action/transformer/filter.ts +8 -4
- package/src/labelLayout/hideOverlap.ts +47 -0
- package/src/labelLayout/index.ts +1 -0
- package/src/mark/utils.ts +1 -1
- package/src/runtime/component.ts +23 -3
- package/src/runtime/coordinate.ts +20 -0
- package/src/runtime/index.ts +1 -0
- package/src/runtime/layout.ts +1 -1
- package/src/runtime/mark.ts +56 -135
- package/src/runtime/plot.ts +29 -22
- package/src/runtime/render.ts +4 -5
- package/src/runtime/scale.ts +15 -5
- package/src/runtime/transform.ts +159 -0
- package/src/runtime/types/common.ts +5 -2
- package/src/runtime/types/component.ts +13 -3
- package/src/runtime/types/data.ts +10 -0
- package/src/runtime/types/encode.ts +6 -2
- package/src/runtime/types/options.ts +7 -2
- package/src/runtime/types/transform.ts +8 -13
- package/src/shape/interval/colorRect.ts +4 -23
- package/src/shape/label/label.ts +94 -11
- package/src/shape/utils.ts +31 -0
- package/src/spec/composition.ts +8 -5
- package/src/spec/coordinate.ts +67 -3
- package/src/spec/data.ts +81 -0
- package/src/spec/geometry.ts +2 -1
- package/src/spec/index.ts +2 -1
- package/src/spec/labelLayout.ts +5 -0
- package/src/spec/transform.ts +245 -194
- package/src/stdlib/index.ts +50 -31
- package/src/theme/light.ts +1 -0
- package/src/transform/{statistic/dodgeX.ts → dodgeX.ts} +24 -21
- package/src/transform/{statistic/groupX.ts → groupX.ts} +25 -24
- package/src/transform/index.ts +21 -44
- package/src/transform/{statistic/jitter.ts → jitter.ts} +17 -21
- package/src/transform/{statistic/jitterY.ts → jitterY.ts} +11 -17
- package/src/transform/maybeKey.ts +26 -0
- package/src/transform/maybeSeries.ts +20 -0
- package/src/transform/maybeSize.ts +23 -0
- package/src/transform/{inference/maybeStackY.ts → maybeStackY.ts} +12 -13
- package/src/transform/maybeTitleX.ts +20 -0
- package/src/transform/maybeTooltip.ts +34 -0
- package/src/transform/{inference/maybeTooltipPosition.ts → maybeTooltipPosition.ts} +4 -6
- package/src/transform/{inference/maybeTooltipY.ts → maybeTooltipY.ts} +3 -6
- package/src/transform/maybeZeroX.ts +25 -0
- package/src/transform/maybeZeroY.ts +24 -0
- package/src/transform/maybeZeroY1.ts +24 -0
- package/src/transform/{statistic/normalizeY.ts → normalizeY.ts} +20 -19
- package/src/transform/{statistic/select.ts → select.ts} +11 -16
- package/src/transform/{statistic/selectX.ts → selectX.ts} +3 -5
- package/src/transform/{statistic/selectY.ts → selectY.ts} +3 -5
- package/src/transform/{statistic/stackEnter.ts → stackEnter.ts} +29 -21
- package/src/transform/{statistic/stackY.ts → stackY.ts} +22 -21
- package/src/transform/{statistic/symmetryY.ts → symmetryY.ts} +20 -19
- package/src/transform/utils/helper.ts +27 -44
- package/src/transform/{statistic/utils.ts → utils/order.ts} +20 -17
- package/src/utils/coordinate.ts +5 -0
- package/esm/spec/statistic.d.ts +0 -69
- package/esm/spec/statistic.js +0 -2
- package/esm/spec/statistic.js.map +0 -1
- package/esm/transform/inference/maybeArrayField.d.ts +0 -8
- package/esm/transform/inference/maybeArrayField.js +0 -47
- package/esm/transform/inference/maybeArrayField.js.map +0 -1
- package/esm/transform/inference/maybeKey.d.ts +0 -9
- package/esm/transform/inference/maybeKey.js.map +0 -1
- package/esm/transform/inference/maybeSeries.d.ts +0 -7
- package/esm/transform/inference/maybeSeries.js +0 -23
- package/esm/transform/inference/maybeSeries.js.map +0 -1
- package/esm/transform/inference/maybeSize.d.ts +0 -7
- package/esm/transform/inference/maybeSize.js +0 -14
- package/esm/transform/inference/maybeSize.js.map +0 -1
- package/esm/transform/inference/maybeStackY.js.map +0 -1
- package/esm/transform/inference/maybeTitleX.d.ts +0 -7
- package/esm/transform/inference/maybeTitleX.js +0 -23
- package/esm/transform/inference/maybeTitleX.js.map +0 -1
- package/esm/transform/inference/maybeTooltip.d.ts +0 -9
- package/esm/transform/inference/maybeTooltip.js +0 -30
- package/esm/transform/inference/maybeTooltip.js.map +0 -1
- package/esm/transform/inference/maybeTooltipPosition.js +0 -12
- package/esm/transform/inference/maybeTooltipPosition.js.map +0 -1
- package/esm/transform/inference/maybeTooltipY.d.ts +0 -7
- package/esm/transform/inference/maybeTooltipY.js +0 -12
- package/esm/transform/inference/maybeTooltipY.js.map +0 -1
- package/esm/transform/inference/maybeZeroX.js +0 -14
- package/esm/transform/inference/maybeZeroX.js.map +0 -1
- package/esm/transform/inference/maybeZeroY.d.ts +0 -7
- package/esm/transform/inference/maybeZeroY.js +0 -14
- package/esm/transform/inference/maybeZeroY.js.map +0 -1
- package/esm/transform/inference/maybeZeroY1.d.ts +0 -7
- package/esm/transform/inference/maybeZeroY1.js +0 -14
- package/esm/transform/inference/maybeZeroY1.js.map +0 -1
- package/esm/transform/preprocessor/arc.d.ts +0 -7
- package/esm/transform/preprocessor/arc.js +0 -16
- package/esm/transform/preprocessor/arc.js.map +0 -1
- package/esm/transform/preprocessor/cluster.d.ts +0 -5
- package/esm/transform/preprocessor/cluster.js +0 -40
- package/esm/transform/preprocessor/cluster.js.map +0 -1
- package/esm/transform/preprocessor/connector.d.ts +0 -7
- package/esm/transform/preprocessor/connector.js +0 -16
- package/esm/transform/preprocessor/connector.js.map +0 -1
- package/esm/transform/preprocessor/fetch.d.ts +0 -8
- package/esm/transform/preprocessor/fetch.js.map +0 -1
- package/esm/transform/preprocessor/filterBy.js.map +0 -1
- package/esm/transform/preprocessor/fold.d.ts +0 -8
- package/esm/transform/preprocessor/fold.js +0 -27
- package/esm/transform/preprocessor/fold.js.map +0 -1
- package/esm/transform/preprocessor/pick.d.ts +0 -7
- package/esm/transform/preprocessor/pick.js.map +0 -1
- package/esm/transform/preprocessor/rename.js.map +0 -1
- package/esm/transform/preprocessor/sankey.d.ts +0 -8
- package/esm/transform/preprocessor/sankey.js +0 -80
- package/esm/transform/preprocessor/sankey.js.map +0 -1
- package/esm/transform/preprocessor/sortBy.d.ts +0 -7
- package/esm/transform/preprocessor/sortBy.js.map +0 -1
- package/esm/transform/preprocessor/subset.d.ts +0 -7
- package/esm/transform/preprocessor/subset.js.map +0 -1
- package/esm/transform/preprocessor/tree.d.ts +0 -4
- package/esm/transform/preprocessor/tree.js +0 -7
- package/esm/transform/preprocessor/tree.js.map +0 -1
- package/esm/transform/preprocessor/voronoi.d.ts +0 -4
- package/esm/transform/preprocessor/voronoi.js +0 -20
- package/esm/transform/preprocessor/voronoi.js.map +0 -1
- package/esm/transform/preprocessor/wordCloud.d.ts +0 -6
- package/esm/transform/preprocessor/wordCloud.js +0 -106
- package/esm/transform/preprocessor/wordCloud.js.map +0 -1
- package/esm/transform/statistic/Select.js.map +0 -1
- package/esm/transform/statistic/SelectX.js.map +0 -1
- package/esm/transform/statistic/SelectY.js.map +0 -1
- package/esm/transform/statistic/dodgeX.js.map +0 -1
- package/esm/transform/statistic/groupX.js.map +0 -1
- package/esm/transform/statistic/jitter.js.map +0 -1
- package/esm/transform/statistic/jitterY.js +0 -27
- package/esm/transform/statistic/jitterY.js.map +0 -1
- package/esm/transform/statistic/normalizeY.js.map +0 -1
- package/esm/transform/statistic/stackEnter.js.map +0 -1
- package/esm/transform/statistic/stackY.js.map +0 -1
- package/esm/transform/statistic/symmetryY.js.map +0 -1
- package/esm/transform/statistic/utils.js.map +0 -1
- package/esm/transform/utils/arc/arc.js.map +0 -1
- package/esm/transform/utils/arc/index.js.map +0 -1
- package/esm/transform/utils/arc/sort.js.map +0 -1
- package/esm/transform/utils/arc/types.js.map +0 -1
- package/esm/transform/utils/d3-cloud/index.js.map +0 -1
- package/esm/transform/utils/d3-sankey/align.js.map +0 -1
- package/esm/transform/utils/d3-sankey/constant.js.map +0 -1
- package/esm/transform/utils/d3-sankey/index.js.map +0 -1
- package/esm/transform/utils/d3-sankey/sankey.js.map +0 -1
- package/esm/transform/utils/flow.js.map +0 -1
- package/esm/transform/utils/memo.js.map +0 -1
- package/lib/spec/statistic.d.ts +0 -69
- package/lib/spec/statistic.js.map +0 -1
- package/lib/transform/inference/maybeArrayField.d.ts +0 -8
- package/lib/transform/inference/maybeArrayField.js +0 -51
- package/lib/transform/inference/maybeArrayField.js.map +0 -1
- package/lib/transform/inference/maybeKey.d.ts +0 -9
- package/lib/transform/inference/maybeKey.js.map +0 -1
- package/lib/transform/inference/maybeSeries.d.ts +0 -7
- package/lib/transform/inference/maybeSeries.js +0 -27
- package/lib/transform/inference/maybeSeries.js.map +0 -1
- package/lib/transform/inference/maybeSize.d.ts +0 -7
- package/lib/transform/inference/maybeSize.js +0 -18
- package/lib/transform/inference/maybeSize.js.map +0 -1
- package/lib/transform/inference/maybeStackY.js.map +0 -1
- package/lib/transform/inference/maybeTitleX.d.ts +0 -7
- package/lib/transform/inference/maybeTitleX.js +0 -27
- package/lib/transform/inference/maybeTitleX.js.map +0 -1
- package/lib/transform/inference/maybeTooltip.d.ts +0 -9
- package/lib/transform/inference/maybeTooltip.js.map +0 -1
- package/lib/transform/inference/maybeTooltipPosition.js.map +0 -1
- package/lib/transform/inference/maybeTooltipY.d.ts +0 -7
- package/lib/transform/inference/maybeTooltipY.js.map +0 -1
- package/lib/transform/inference/maybeZeroX.js +0 -18
- package/lib/transform/inference/maybeZeroX.js.map +0 -1
- package/lib/transform/inference/maybeZeroY.d.ts +0 -7
- package/lib/transform/inference/maybeZeroY.js +0 -18
- package/lib/transform/inference/maybeZeroY.js.map +0 -1
- package/lib/transform/inference/maybeZeroY1.d.ts +0 -7
- package/lib/transform/inference/maybeZeroY1.js +0 -18
- package/lib/transform/inference/maybeZeroY1.js.map +0 -1
- package/lib/transform/preprocessor/arc.d.ts +0 -7
- package/lib/transform/preprocessor/arc.js +0 -20
- package/lib/transform/preprocessor/arc.js.map +0 -1
- package/lib/transform/preprocessor/cluster.d.ts +0 -5
- package/lib/transform/preprocessor/cluster.js +0 -44
- package/lib/transform/preprocessor/cluster.js.map +0 -1
- package/lib/transform/preprocessor/connector.d.ts +0 -7
- package/lib/transform/preprocessor/connector.js +0 -20
- package/lib/transform/preprocessor/connector.js.map +0 -1
- package/lib/transform/preprocessor/fetch.d.ts +0 -8
- package/lib/transform/preprocessor/fetch.js.map +0 -1
- package/lib/transform/preprocessor/filterBy.js.map +0 -1
- package/lib/transform/preprocessor/fold.d.ts +0 -8
- package/lib/transform/preprocessor/fold.js +0 -32
- package/lib/transform/preprocessor/fold.js.map +0 -1
- package/lib/transform/preprocessor/pick.d.ts +0 -7
- package/lib/transform/preprocessor/pick.js.map +0 -1
- package/lib/transform/preprocessor/rename.js.map +0 -1
- package/lib/transform/preprocessor/sankey.d.ts +0 -8
- package/lib/transform/preprocessor/sankey.js +0 -84
- package/lib/transform/preprocessor/sankey.js.map +0 -1
- package/lib/transform/preprocessor/sortBy.d.ts +0 -7
- package/lib/transform/preprocessor/sortBy.js.map +0 -1
- package/lib/transform/preprocessor/subset.d.ts +0 -7
- package/lib/transform/preprocessor/subset.js.map +0 -1
- package/lib/transform/preprocessor/tree.d.ts +0 -4
- package/lib/transform/preprocessor/tree.js +0 -10
- package/lib/transform/preprocessor/tree.js.map +0 -1
- package/lib/transform/preprocessor/voronoi.d.ts +0 -4
- package/lib/transform/preprocessor/voronoi.js +0 -24
- package/lib/transform/preprocessor/voronoi.js.map +0 -1
- package/lib/transform/preprocessor/wordCloud.d.ts +0 -6
- package/lib/transform/preprocessor/wordCloud.js +0 -112
- package/lib/transform/preprocessor/wordCloud.js.map +0 -1
- package/lib/transform/statistic/Select.js.map +0 -1
- package/lib/transform/statistic/SelectX.js.map +0 -1
- package/lib/transform/statistic/SelectY.js.map +0 -1
- package/lib/transform/statistic/dodgeX.js.map +0 -1
- package/lib/transform/statistic/groupX.js.map +0 -1
- package/lib/transform/statistic/jitter.js.map +0 -1
- package/lib/transform/statistic/jitterY.js.map +0 -1
- package/lib/transform/statistic/normalizeY.js.map +0 -1
- package/lib/transform/statistic/stackEnter.js.map +0 -1
- package/lib/transform/statistic/stackY.js.map +0 -1
- package/lib/transform/statistic/symmetryY.js.map +0 -1
- package/lib/transform/statistic/utils.js.map +0 -1
- package/lib/transform/utils/arc/arc.js.map +0 -1
- package/lib/transform/utils/arc/index.js.map +0 -1
- package/lib/transform/utils/arc/sort.js.map +0 -1
- package/lib/transform/utils/arc/types.js.map +0 -1
- package/lib/transform/utils/d3-cloud/index.js.map +0 -1
- package/lib/transform/utils/d3-sankey/align.js.map +0 -1
- package/lib/transform/utils/d3-sankey/constant.js.map +0 -1
- package/lib/transform/utils/d3-sankey/index.js.map +0 -1
- package/lib/transform/utils/d3-sankey/sankey.js.map +0 -1
- package/lib/transform/utils/flow.js.map +0 -1
- package/lib/transform/utils/memo.js.map +0 -1
- package/src/spec/statistic.ts +0 -135
- package/src/transform/inference/maybeArrayField.ts +0 -55
- package/src/transform/inference/maybeKey.ts +0 -29
- package/src/transform/inference/maybeSeries.ts +0 -26
- package/src/transform/inference/maybeSize.ts +0 -18
- package/src/transform/inference/maybeTitleX.ts +0 -26
- package/src/transform/inference/maybeTooltip.ts +0 -35
- package/src/transform/inference/maybeZeroX.ts +0 -18
- package/src/transform/inference/maybeZeroY.ts +0 -18
- package/src/transform/inference/maybeZeroY1.ts +0 -18
- package/src/transform/preprocessor/arc.ts +0 -21
- package/src/transform/preprocessor/cluster.ts +0 -56
- package/src/transform/preprocessor/connector.ts +0 -22
- package/src/transform/preprocessor/fetch.ts +0 -32
- package/src/transform/preprocessor/filterBy.ts +0 -24
- package/src/transform/preprocessor/fold.ts +0 -32
- package/src/transform/preprocessor/sankey.ts +0 -105
- package/src/transform/preprocessor/tree.ts +0 -12
- package/src/transform/preprocessor/voronoi.ts +0 -30
- package/src/transform/preprocessor/wordCloud.ts +0 -115
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import { indexOf, mapObject } from '../utils/array';
|
|
22
|
+
import { composeAsync, defined } from '../utils/helper';
|
|
23
|
+
import { useLibrary } from './library';
|
|
24
|
+
import { createColumnOf } from './mark';
|
|
25
|
+
import { isPosition } from './scale';
|
|
26
|
+
// @todo Add more defaults.
|
|
27
|
+
export function applyDefaults(I, mark, context) {
|
|
28
|
+
const { scale = {}, transform = [] } = mark, rest = __rest(mark, ["scale", "transform"]);
|
|
29
|
+
return [I, Object.assign(Object.assign({}, rest), { scale, transform })];
|
|
30
|
+
}
|
|
31
|
+
export function applyDataTransform(I, mark, context) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const { library } = context;
|
|
34
|
+
const { data } = mark;
|
|
35
|
+
const [useData] = useLibrary('data', library);
|
|
36
|
+
const descriptor = normalizedDataSource(data);
|
|
37
|
+
const { transform: T = [] } = descriptor, connector = __rest(descriptor, ["transform"]);
|
|
38
|
+
const transform = [connector, ...T];
|
|
39
|
+
const transformFunctions = transform.map(useData);
|
|
40
|
+
const transformedData = yield composeAsync(transformFunctions)(data);
|
|
41
|
+
return [
|
|
42
|
+
Array.isArray(transformedData) ? indexOf(transformedData) : [],
|
|
43
|
+
Object.assign(Object.assign({}, mark), { data: transformedData }),
|
|
44
|
+
];
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function flatEncode(I, mark, context) {
|
|
48
|
+
const { encode } = mark;
|
|
49
|
+
const flattenEncode = {};
|
|
50
|
+
for (const [key, value] of Object.entries(encode)) {
|
|
51
|
+
if (Array.isArray(value)) {
|
|
52
|
+
for (let i = 0; i < value.length; i++) {
|
|
53
|
+
const name = `${key}${i === 0 ? '' : i}`;
|
|
54
|
+
flattenEncode[name] = value[i];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
flattenEncode[key] = value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return [I, Object.assign(Object.assign({}, mark), { encode: flattenEncode })];
|
|
62
|
+
}
|
|
63
|
+
export function inferChannelsType(I, mark, context) {
|
|
64
|
+
const { encode, data } = mark;
|
|
65
|
+
const typedEncode = mapObject(encode, (channel) => {
|
|
66
|
+
if (isTypedChannel(channel))
|
|
67
|
+
return channel;
|
|
68
|
+
const type = inferChannelType(data, channel);
|
|
69
|
+
return { type, value: channel };
|
|
70
|
+
});
|
|
71
|
+
return [I, Object.assign(Object.assign({}, mark), { encode: typedEncode })];
|
|
72
|
+
}
|
|
73
|
+
// @todo Move visual property to style instead of flagging visual.
|
|
74
|
+
export function maybeVisualChannel(I, mark, context) {
|
|
75
|
+
const { encode } = mark;
|
|
76
|
+
const newEncode = mapObject(encode, (channel, name) => {
|
|
77
|
+
const { type } = channel;
|
|
78
|
+
if (type !== 'constant' || isPosition(name))
|
|
79
|
+
return channel;
|
|
80
|
+
return Object.assign(Object.assign({}, channel), { visual: true });
|
|
81
|
+
});
|
|
82
|
+
return [I, Object.assign(Object.assign({}, mark), { encode: newEncode })];
|
|
83
|
+
}
|
|
84
|
+
export function extractColumns(I, mark, context) {
|
|
85
|
+
const { encode, data } = mark;
|
|
86
|
+
const { library } = context;
|
|
87
|
+
const columnOf = createColumnOf(library);
|
|
88
|
+
const valuedEncode = mapObject(encode, (channel) => columnOf(data, channel));
|
|
89
|
+
return [I, Object.assign(Object.assign({}, mark), { encode: valuedEncode })];
|
|
90
|
+
}
|
|
91
|
+
export function maybeArrayField(I, mark, context) {
|
|
92
|
+
const { encode } = mark, rest = __rest(mark, ["encode"]);
|
|
93
|
+
const columns = Object.entries(encode);
|
|
94
|
+
const arrayColumns = columns
|
|
95
|
+
.filter(([, channel]) => {
|
|
96
|
+
const { value: V } = channel;
|
|
97
|
+
return Array.isArray(V[0]);
|
|
98
|
+
})
|
|
99
|
+
.flatMap(([key, V]) => {
|
|
100
|
+
const columns = [[key, new Array(I.length).fill(undefined)]];
|
|
101
|
+
const { value: rows } = V, rest = __rest(V, ["value"]);
|
|
102
|
+
for (let i = 0; i < rows.length; i++) {
|
|
103
|
+
const row = rows[i];
|
|
104
|
+
if (Array.isArray(row)) {
|
|
105
|
+
for (let j = 0; j < row.length; j++) {
|
|
106
|
+
const column = columns[j] || [
|
|
107
|
+
`${key}${j}`,
|
|
108
|
+
new Array(I).fill(undefined),
|
|
109
|
+
];
|
|
110
|
+
column[1][i] = row[j];
|
|
111
|
+
columns[j] = column;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return columns.map(([key, value]) => [
|
|
116
|
+
key,
|
|
117
|
+
Object.assign({ type: 'column', value }, rest),
|
|
118
|
+
]);
|
|
119
|
+
});
|
|
120
|
+
const newEncode = Object.fromEntries([...columns, ...arrayColumns]);
|
|
121
|
+
return [I, Object.assign(Object.assign({}, rest), { encode: newEncode })];
|
|
122
|
+
}
|
|
123
|
+
function isTypedChannel(channel) {
|
|
124
|
+
if (typeof channel !== 'object' || channel instanceof Date)
|
|
125
|
+
return false;
|
|
126
|
+
const { type } = channel;
|
|
127
|
+
return defined(type);
|
|
128
|
+
}
|
|
129
|
+
function inferChannelType(data, channel) {
|
|
130
|
+
var _a;
|
|
131
|
+
if (typeof channel === 'function')
|
|
132
|
+
return 'transform';
|
|
133
|
+
if (typeof channel === 'string' && ((_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a[channel]) !== undefined) {
|
|
134
|
+
return 'field';
|
|
135
|
+
}
|
|
136
|
+
return 'constant';
|
|
137
|
+
}
|
|
138
|
+
function normalizedDataSource(data) {
|
|
139
|
+
if (Array.isArray(data))
|
|
140
|
+
return { type: 'inline', value: data };
|
|
141
|
+
const { type = 'inline' } = data, rest = __rest(data, ["type"]);
|
|
142
|
+
return Object.assign(Object.assign({}, rest), { type });
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"src/","sources":["runtime/transform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,2BAA2B;AAC3B,MAAM,UAAU,aAAa,CAC3B,CAAW,EACX,IAAY,EACZ,OAAyB;IAEzB,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAA9C,sBAAuC,CAAO,CAAC;IACr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AAI;QAAE,OAAO,KAAK,CAAC;IACzE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAiC,EAAE,OAAO;;IAClE,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,OAAO,WAAW,CAAC;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,CAAC,CAAC,0CAAG,OAAO,CAAC,MAAK,SAAS,EAAE;QACrE,OAAO,OAAO,CAAC;KAChB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAI;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAChE,MAAM,EAAE,IAAI,GAAG,QAAQ,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAAnC,QAA4B,CAAO,CAAC;IAC1C,uCAAY,IAAI,KAAE,IAAI,IAAG;AAC3B,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
2
|
import { DisplayObject } from '@antv/g';
|
|
3
3
|
import { G2GuideComponentOptions, G2Mark, G2ViewTree } from './options';
|
|
4
|
-
import { Scale } from './component';
|
|
4
|
+
import { LabelLayout, Scale } from './component';
|
|
5
5
|
import { MarkProps } from './mark';
|
|
6
|
-
import { ColumnValue } from './encode';
|
|
7
6
|
export declare type G2Theme = {
|
|
8
7
|
defaultColor?: string;
|
|
9
8
|
defaultCategory10?: string;
|
|
10
9
|
defaultCategory20?: string;
|
|
11
10
|
defaultSize?: number;
|
|
12
11
|
elementActiveStroke?: string;
|
|
12
|
+
labelFill?: string;
|
|
13
13
|
enter?: {
|
|
14
14
|
duration?: number;
|
|
15
15
|
delay?: number;
|
|
@@ -52,6 +52,7 @@ export declare type G2ViewDescriptor = {
|
|
|
52
52
|
layout: Layout;
|
|
53
53
|
key: string;
|
|
54
54
|
frame: boolean;
|
|
55
|
+
labelLayout?: LabelLayout;
|
|
55
56
|
};
|
|
56
57
|
export declare type G2ViewInstance = {
|
|
57
58
|
view: G2ViewDescriptor;
|
|
@@ -88,10 +89,11 @@ export declare type Channel = {
|
|
|
88
89
|
scale?: string;
|
|
89
90
|
scaleName?: string;
|
|
90
91
|
required?: boolean;
|
|
91
|
-
value?:
|
|
92
|
+
value?: Primitive[];
|
|
92
93
|
type?: string;
|
|
93
94
|
independent?: boolean;
|
|
94
95
|
field?: string | string[];
|
|
96
|
+
visual?: boolean;
|
|
95
97
|
};
|
|
96
98
|
export declare type Vector2 = [number, number];
|
|
97
99
|
export declare type BBox = {
|
|
@@ -5,8 +5,9 @@ import { G2ViewTree } from './options';
|
|
|
5
5
|
import { EncodeComponent, Encode } from './encode';
|
|
6
6
|
import { MarkComponent, Mark } from './mark';
|
|
7
7
|
import { TransformComponent, Transform } from './transform';
|
|
8
|
-
|
|
9
|
-
export declare type
|
|
8
|
+
import { DataComponent } from './data';
|
|
9
|
+
export declare type G2ComponentNamespaces = 'renderer' | 'coordinate' | 'encode' | 'mark' | 'infer' | 'palette' | 'scale' | 'shape' | 'statistic' | 'theme' | 'transform' | 'component' | 'animation' | 'action' | 'interaction' | 'interactor' | 'composition' | 'adjust' | 'data' | 'labelLayout';
|
|
10
|
+
export declare type G2Component = RendererComponent | EncodeComponent | InferComponent | StatisticComponent | ScaleComponent | CoordinateComponent | PaletteComponent | MarkComponent | ShapeComponent | ThemeComponent | GuideComponentComponent | AnimationComponent | InteractionComponent | CompositionComponent | AdjustComponent | TransformComponent | DataComponent | LabelLayoutComponent;
|
|
10
11
|
export declare type G2ComponentValue = Renderer | Transform | Encode | Infer | Statistic | Scale | CoordinateTransform | Palette | Mark | Shape | Theme | GuideComponent | Animation | Interaction | Composition | Adjust;
|
|
11
12
|
export declare type G2BaseComponent<R = any, O = Record<string, unknown> | void, P = Record<string, unknown>> = {
|
|
12
13
|
(options?: O): R;
|
|
@@ -71,3 +72,5 @@ export declare type Composition = (children: G2ViewTree) => G2ViewTree[] | (() =
|
|
|
71
72
|
export declare type CompositionComponent<O = Record<string, unknown>> = G2BaseComponent<Composition, O>;
|
|
72
73
|
export declare type Adjust = (points: Vector2[][], domain: number, layout: Layout) => string[];
|
|
73
74
|
export declare type AdjustComponent<O = Record<string, unknown>> = G2BaseComponent<Adjust, O>;
|
|
75
|
+
export declare type LabelLayout = (labels: DisplayObject[]) => DisplayObject[];
|
|
76
|
+
export declare type LabelLayoutComponent<O = Record<string, unknown>> = G2BaseComponent<LabelLayout, O>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type DataOptions = Record<string, any>;
|
|
2
|
+
export declare type DataProps = Record<string, never>;
|
|
3
|
+
export declare type DataComponent<O extends DataOptions = DataOptions> = {
|
|
4
|
+
(options?: O): Data;
|
|
5
|
+
props: DataProps;
|
|
6
|
+
};
|
|
7
|
+
export declare type Data = (data: any) => any | Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"src/","sources":["runtime/types/data.ts"],"names":[],"mappings":""}
|
|
@@ -7,7 +7,7 @@ export declare type EncodeComponent<O extends EncodeOptions = EncodeOptions> = {
|
|
|
7
7
|
(options?: O): Encode;
|
|
8
8
|
props: EncodeProps;
|
|
9
9
|
};
|
|
10
|
-
export declare type Encode = (data: TabularData) =>
|
|
10
|
+
export declare type Encode = (data: TabularData) => Primitive[];
|
|
11
11
|
export declare type EncodeSpec = NormalizedEncodeSpec | PrimitiveEncodeSpec;
|
|
12
12
|
export declare type NormalizedEncodeSpec = {
|
|
13
13
|
type?: string;
|
|
@@ -16,6 +16,8 @@ export declare type NormalizedEncodeSpec = {
|
|
|
16
16
|
};
|
|
17
17
|
export declare type FunctionEncodeSpec = (value: TabularData[number], index: number, array: TabularData) => Primitive;
|
|
18
18
|
export declare type PrimitiveEncodeSpec = Primitive | FunctionEncodeSpec;
|
|
19
|
-
export declare type ColumnValue =
|
|
19
|
+
export declare type ColumnValue = {
|
|
20
|
+
type: 'column';
|
|
21
|
+
value: Primitive[];
|
|
20
22
|
field?: string;
|
|
21
23
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Canvas } from '@antv/g';
|
|
2
2
|
import { G2Title, GuideComponentPosition, Layout, Primitive } from './common';
|
|
3
|
-
import { G2BaseComponent, StatisticComponent, ThemeComponent, G2ComponentNamespaces, CoordinateComponent, ScaleComponent, InferComponent, ShapeComponent, PaletteComponent, GuideComponentComponent, AnimationComponent, InteractionComponent, CompositionComponent, AdjustComponent, Scale } from './component';
|
|
3
|
+
import { G2BaseComponent, StatisticComponent, ThemeComponent, G2ComponentNamespaces, CoordinateComponent, ScaleComponent, InferComponent, ShapeComponent, PaletteComponent, GuideComponentComponent, AnimationComponent, InteractionComponent, CompositionComponent, AdjustComponent, Scale, LabelLayoutComponent } from './component';
|
|
4
4
|
import { TransformComponent } from './transform';
|
|
5
5
|
import { EncodeComponent } from './encode';
|
|
6
6
|
import { MarkComponent } from './mark';
|
|
7
|
+
import { DataComponent } from './data';
|
|
7
8
|
export declare type G2ViewTree = {
|
|
8
9
|
width?: number;
|
|
9
10
|
height?: number;
|
|
@@ -40,6 +41,7 @@ export declare type G2View = {
|
|
|
40
41
|
type?: string;
|
|
41
42
|
[key: string]: any;
|
|
42
43
|
};
|
|
44
|
+
labelLayout?: G2LabelLayoutOptions[];
|
|
43
45
|
};
|
|
44
46
|
export declare type G2Mark = {
|
|
45
47
|
key?: string;
|
|
@@ -50,7 +52,6 @@ export declare type G2Mark = {
|
|
|
50
52
|
paddingBottom?: number;
|
|
51
53
|
data?: any;
|
|
52
54
|
transform?: G2TransformOptions[];
|
|
53
|
-
statistic?: G2StatisticOptions[];
|
|
54
55
|
scale?: Record<string, G2ScaleOptions>;
|
|
55
56
|
encode?: Record<string, any | G2EncodeOptions>;
|
|
56
57
|
type?: string | MarkComponent;
|
|
@@ -68,7 +69,7 @@ export declare type G2BaseComponentOptions<C = G2BaseComponent, O = {
|
|
|
68
69
|
}> = {
|
|
69
70
|
type?: string | C;
|
|
70
71
|
} & O;
|
|
71
|
-
export declare type G2ComponentOptions = G2TransformOptions | G2StatisticOptions | G2EncodeOptions | G2ThemeOptions | G2MarkOptions | G2CoordinateOptions | G2ScaleOptions | G2InferOptions | G2ShapeOptions | G2PaletteOptions | G2GuideComponentOptions | G2AnimationOptions | G2InteractionOptions | G2CompositionOptions | G2AdjustOptions;
|
|
72
|
+
export declare type G2ComponentOptions = G2TransformOptions | G2StatisticOptions | G2EncodeOptions | G2ThemeOptions | G2MarkOptions | G2CoordinateOptions | G2ScaleOptions | G2InferOptions | G2ShapeOptions | G2PaletteOptions | G2GuideComponentOptions | G2AnimationOptions | G2InteractionOptions | G2CompositionOptions | G2AdjustOptions | G2LabelLayoutOptions;
|
|
72
73
|
export declare type G2TransformOptions = G2BaseComponentOptions<TransformComponent>;
|
|
73
74
|
export declare type G2StatisticOptions = G2BaseComponentOptions<StatisticComponent>;
|
|
74
75
|
export declare type G2EncodeOptions = G2BaseComponentOptions<EncodeComponent>;
|
|
@@ -99,8 +100,10 @@ export declare type G2AnimationOptions = G2BaseComponentOptions<AnimationCompone
|
|
|
99
100
|
export declare type G2InteractionOptions = G2BaseComponentOptions<InteractionComponent>;
|
|
100
101
|
export declare type G2CompositionOptions = G2BaseComponentOptions<CompositionComponent>;
|
|
101
102
|
export declare type G2AdjustOptions = G2BaseComponentOptions<AdjustComponent>;
|
|
103
|
+
export declare type G2LabelLayoutOptions = G2BaseComponentOptions<LabelLayoutComponent>;
|
|
102
104
|
export declare type G2TitleOptions = G2Title & {
|
|
103
105
|
position?: GuideComponentPosition;
|
|
104
106
|
size?: number;
|
|
105
107
|
zIndex?: number;
|
|
106
108
|
};
|
|
109
|
+
export declare type G2DataOptions = G2BaseComponent<DataComponent>;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import { ColumnValue,
|
|
1
|
+
import { ColumnValue, NormalizedEncodeSpec } from './encode';
|
|
2
|
+
import { G2Library, G2Mark } from './options';
|
|
2
3
|
export declare type TransformContext = {
|
|
3
|
-
|
|
4
|
-
I?: number[];
|
|
5
|
-
encode?: Record<string, EncodeSpec>;
|
|
6
|
-
columnOf?: ColumnOf;
|
|
7
|
-
transform?: TransformSpec[];
|
|
8
|
-
scale?: Record<string, any>;
|
|
4
|
+
library: G2Library;
|
|
9
5
|
};
|
|
10
6
|
export declare type TransformOptions = Record<string, any>;
|
|
11
|
-
export declare type TransformProps =
|
|
12
|
-
category: 'inference' | 'preprocessor' | 'statistic';
|
|
13
|
-
};
|
|
7
|
+
export declare type TransformProps = Record<string, never>;
|
|
14
8
|
export declare type TransformComponent<O extends TransformOptions = TransformOptions> = {
|
|
15
9
|
(options: O): Transform;
|
|
16
10
|
props?: TransformProps;
|
|
17
11
|
};
|
|
18
|
-
export declare type Transform = (context: TransformContext) =>
|
|
12
|
+
export declare type Transform = (I: number[], mark: G2Mark, context: TransformContext) => [number[], G2Mark] | Promise<[number[], G2Mark]>;
|
|
19
13
|
export declare type TransformSpec = {
|
|
20
14
|
type?: string | TransformComponent;
|
|
21
15
|
[key: string]: any;
|
|
22
16
|
};
|
|
23
|
-
export declare type ColumnOf = (data: any, encode:
|
|
17
|
+
export declare type ColumnOf = (data: any, encode: NormalizedEncodeSpec) => ColumnValue;
|
|
@@ -12,14 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { Path } from '@antv/g';
|
|
13
13
|
import { arc } from 'd3-shape';
|
|
14
14
|
import { path as d3path } from 'd3-path';
|
|
15
|
-
import {
|
|
16
|
-
import { isTranspose, isPolar } from '../../utils/coordinate';
|
|
15
|
+
import { isPolar, isHelix } from '../../utils/coordinate';
|
|
17
16
|
import { select } from '../../utils/selection';
|
|
18
|
-
import { applyStyle, appendPolygon } from '../utils';
|
|
19
|
-
function reorder(points) {
|
|
20
|
-
const [p0, p1, p2, p3] = points;
|
|
21
|
-
return [p3, p0, p1, p2];
|
|
22
|
-
}
|
|
17
|
+
import { applyStyle, appendPolygon, getArcObject } from '../utils';
|
|
23
18
|
/**
|
|
24
19
|
* Render rect in different coordinate.
|
|
25
20
|
* @todo Replace d3-arc with custom arc path generator.
|
|
@@ -36,9 +31,8 @@ export const ColorRect = (options) => {
|
|
|
36
31
|
const { radius = 0 } = style;
|
|
37
32
|
const { defaultColor } = theme;
|
|
38
33
|
const { color = defaultColor } = value;
|
|
39
|
-
const [p0, p1, p2, p3] = isTranspose(coordinate) ? reorder(points) : points;
|
|
40
34
|
// Render rect in non-polar coordinate.
|
|
41
|
-
if (!isPolar(coordinate)) {
|
|
35
|
+
if (!isPolar(coordinate) && !isHelix(coordinate)) {
|
|
42
36
|
return select(new Path())
|
|
43
37
|
.style('lineWidth', lineWidth)
|
|
44
38
|
.style('d', appendPolygon(d3path(), points).toString())
|
|
@@ -50,19 +44,7 @@ export const ColorRect = (options) => {
|
|
|
50
44
|
// Render path in polar coordinate.
|
|
51
45
|
const { y, y1 } = value;
|
|
52
46
|
const center = coordinate.getCenter();
|
|
53
|
-
const
|
|
54
|
-
const a2 = angle(sub(p1, center));
|
|
55
|
-
// There are two situations that a2 === a1:
|
|
56
|
-
// 1. a1 - a2 = 0
|
|
57
|
-
// 2. |a1 - a2| = Math.PI * 2
|
|
58
|
-
// Distinguish them by y and y1:
|
|
59
|
-
const a3 = a2 === a1 && y !== y1 ? a2 + Math.PI * 2 : a2;
|
|
60
|
-
const arcObject = {
|
|
61
|
-
startAngle: a1,
|
|
62
|
-
endAngle: a3 - a1 >= 0 ? a3 : Math.PI * 2 + a3,
|
|
63
|
-
innerRadius: dist(p3, center),
|
|
64
|
-
outerRadius: dist(p0, center),
|
|
65
|
-
};
|
|
47
|
+
const arcObject = getArcObject(coordinate, points, [y, y1]);
|
|
66
48
|
const path = arc().cornerRadius(radius);
|
|
67
49
|
return select(new Path({}))
|
|
68
50
|
.style('path', path(arcObject))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorRect.js","sourceRoot":"src/","sources":["shape/interval/colorRect.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"colorRect.js","sourceRoot":"src/","sources":["shape/interval/colorRect.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAOnE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAyB,CAAC,OAAO,EAAE,EAAE;IACzD,oDAAoD;IACpD,MAAM,EAAE,cAAc,KAAe,OAAO,EAAjB,KAAK,UAAK,OAAO,EAAtC,kBAA4B,CAAU,CAAC;IAC7C,MAAM,SAAS,GAAG,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtD,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE;QAC1C,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;QAC7B,MAAM,EAAE,Y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AE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,sEAAsE;AACtE,SAAS,CAAC,KAAK,GAAG;IAChB,qBAAqB,EAAE,UAAU;CAClC,CAAC"}
|
package/esm/shape/label/label.js
CHANGED
|
@@ -1,6 +1,77 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { Text } from '@antv/g';
|
|
2
13
|
import { select } from '../../utils/selection';
|
|
3
|
-
import { applyStyle } from '../../shape/utils';
|
|
14
|
+
import { applyStyle, getArcObject } from '../../shape/utils';
|
|
15
|
+
import { isHelix, isPolar } from '../../utils/coordinate';
|
|
16
|
+
/**
|
|
17
|
+
* Avoid getting error bounds caused by element animations.
|
|
18
|
+
* @todo Remove this temporary handle method, if runtime supports correct process: drawElement, do label layout and then do transitions together.
|
|
19
|
+
*/
|
|
20
|
+
function getLocalBounds(element) {
|
|
21
|
+
const cloneElement = element.cloneNode();
|
|
22
|
+
const animations = element.getAnimations();
|
|
23
|
+
cloneElement.style.visibility = 'hidden';
|
|
24
|
+
animations.forEach((animation) => {
|
|
25
|
+
const keyframes = animation.effect.getKeyframes();
|
|
26
|
+
cloneElement.attr(keyframes[keyframes.length - 1]);
|
|
27
|
+
});
|
|
28
|
+
element.parentNode.appendChild(cloneElement);
|
|
29
|
+
const bounds = cloneElement.getLocalBounds();
|
|
30
|
+
cloneElement.destroy();
|
|
31
|
+
return bounds;
|
|
32
|
+
}
|
|
33
|
+
function inferPosition(points, value, coordinate, position) {
|
|
34
|
+
const element = value.element;
|
|
35
|
+
const { min, halfExtents } = getLocalBounds(element);
|
|
36
|
+
const [x0, y0] = min;
|
|
37
|
+
// Infer the label position in non-polar coordinate.
|
|
38
|
+
if (!isPolar(coordinate) && !isHelix(coordinate)) {
|
|
39
|
+
const w = halfExtents[0] * 2;
|
|
40
|
+
const h = halfExtents[1] * 2;
|
|
41
|
+
if (position === 'left')
|
|
42
|
+
return { x: 0, y: h / 2 };
|
|
43
|
+
if (position === 'right')
|
|
44
|
+
return { x: w, y: h / 2 };
|
|
45
|
+
if (position === 'bottom')
|
|
46
|
+
return { x: w / 2, y: h };
|
|
47
|
+
if (position === 'inside')
|
|
48
|
+
return { x: w / 2, y: h / 2 };
|
|
49
|
+
return { x: w / 2, y: 0 };
|
|
50
|
+
}
|
|
51
|
+
// Infer the label position in polar coordinate.
|
|
52
|
+
const { y, y1 } = value;
|
|
53
|
+
const arcObject = getArcObject(coordinate, points, [y, y1]);
|
|
54
|
+
const { startAngle, endAngle, innerRadius, outerRadius } = arcObject;
|
|
55
|
+
const midAngle = (startAngle + endAngle) / 2;
|
|
56
|
+
const center = coordinate.getCenter();
|
|
57
|
+
// @todo Support config by label.offset
|
|
58
|
+
const offset = position === 'inside' ? 0 : 12;
|
|
59
|
+
const radius = (position === 'inside' ? (innerRadius + outerRadius) / 2 : outerRadius) +
|
|
60
|
+
offset;
|
|
61
|
+
return {
|
|
62
|
+
x: center[0] + Math.sin(midAngle) * radius - x0,
|
|
63
|
+
y: center[1] - Math.cos(midAngle) * radius - y0,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function inferDefaultStyle(position) {
|
|
67
|
+
if (position === 'left' ||
|
|
68
|
+
position === 'right' ||
|
|
69
|
+
position === 'inside' ||
|
|
70
|
+
position === 'outside') {
|
|
71
|
+
return { textBaseline: 'middle' };
|
|
72
|
+
}
|
|
73
|
+
return { dy: '-2px' };
|
|
74
|
+
}
|
|
4
75
|
/**
|
|
5
76
|
* Render normal label for each mark.
|
|
6
77
|
* @todo Support position option: middle...
|
|
@@ -8,20 +79,20 @@ import { applyStyle } from '../../shape/utils';
|
|
|
8
79
|
export const Label = (options) => {
|
|
9
80
|
const { label: style = {} } = options;
|
|
10
81
|
return (points, value, coordinate, theme) => {
|
|
11
|
-
const
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
14
|
-
const [x1] = max;
|
|
15
|
-
const w = x1 - x0;
|
|
82
|
+
const { position } = style, restStyle = __rest(style, ["position"]);
|
|
83
|
+
const { labelFill: fill } = theme;
|
|
84
|
+
const { x, y } = inferPosition(points, value, coordinate, position);
|
|
16
85
|
const { label } = value;
|
|
86
|
+
const defaultStyle = inferDefaultStyle(position);
|
|
17
87
|
return select(new Text())
|
|
18
|
-
.style('x',
|
|
19
|
-
.style('y',
|
|
88
|
+
.style('x', x)
|
|
89
|
+
.style('y', y)
|
|
20
90
|
.style('text', `${label}`)
|
|
21
91
|
.style('fontSize', 12)
|
|
22
|
-
.style('dy', '-2px')
|
|
23
92
|
.style('textAlign', 'center')
|
|
24
|
-
.
|
|
93
|
+
.style('fill', fill)
|
|
94
|
+
.call(applyStyle, defaultStyle)
|
|
95
|
+
.call(applyStyle, restStyle)
|
|
25
96
|
.node();
|
|
26
97
|
};
|
|
27
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"src/","sources":["shape/label/label.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"src/","sources":["shape/label/label.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAiB,IAAI,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAA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K,CAAC,UAAU,EAAE,EAAE,CAAC;aACrB,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC;aAC5B,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;aACnB,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC;aAC9B,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC;aAC3B,IAAI,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
package/esm/shape/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Path as D3Path } from 'd3-path';
|
|
2
|
+
import { Coordinate } from '@antv/coord';
|
|
2
3
|
import { Primitive, Vector2 } from '../runtime';
|
|
3
4
|
import { Selection } from '../utils/selection';
|
|
4
5
|
declare type A = ['a' | 'A', number, number, number, number, number, number, number];
|
|
@@ -49,4 +50,10 @@ export declare function arrowPoints(from: Vector2, to: Vector2, options: ArrowOp
|
|
|
49
50
|
*/
|
|
50
51
|
export declare function appendArc(path: D3Path, from: Vector2, to: Vector2, center: Vector2, radius: number): D3Path;
|
|
51
52
|
export declare function computeGradient(C: string[], X: number[]): string;
|
|
53
|
+
export declare function getArcObject(coordinate: Coordinate, points: Vector2[], Y: [number, number]): {
|
|
54
|
+
startAngle: number;
|
|
55
|
+
endAngle: number;
|
|
56
|
+
innerRadius: number;
|
|
57
|
+
outerRadius: number;
|
|
58
|
+
};
|
|
52
59
|
export {};
|
package/esm/shape/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Linear } from '@antv/scale';
|
|
2
|
+
import { isTranspose } from '../utils/coordinate';
|
|
2
3
|
import { angle, dist, sub } from '../utils/vector';
|
|
3
4
|
export function applyStyle(selection, style) {
|
|
4
5
|
for (const [key, value] of Object.entries(style)) {
|
|
@@ -64,4 +65,26 @@ export function computeGradient(C, X) {
|
|
|
64
65
|
const gradient = C.map((c, i) => `${c} ${color.map(X[i])}%`).join(',');
|
|
65
66
|
return `linear-gradient(${gradient})`;
|
|
66
67
|
}
|
|
68
|
+
function reorder(points) {
|
|
69
|
+
const [p0, p1, p2, p3] = points;
|
|
70
|
+
return [p3, p0, p1, p2];
|
|
71
|
+
}
|
|
72
|
+
export function getArcObject(coordinate, points, Y) {
|
|
73
|
+
const [p0, p1, , p3] = isTranspose(coordinate) ? reorder(points) : points;
|
|
74
|
+
const [y, y1] = Y;
|
|
75
|
+
const center = coordinate.getCenter();
|
|
76
|
+
const a1 = angle(sub(p0, center));
|
|
77
|
+
const a2 = angle(sub(p1, center));
|
|
78
|
+
// There are two situations that a2 === a1:
|
|
79
|
+
// 1. a1 - a2 = 0
|
|
80
|
+
// 2. |a1 - a2| = Math.PI * 2
|
|
81
|
+
// Distinguish them by y and y1:
|
|
82
|
+
const a3 = a2 === a1 && y !== y1 ? a2 + Math.PI * 2 : a2;
|
|
83
|
+
return {
|
|
84
|
+
startAngle: a1,
|
|
85
|
+
endAngle: a3 - a1 >= 0 ? a3 : Math.PI * 2 + a3,
|
|
86
|
+
innerRadius: dist(p3, center),
|
|
87
|
+
outerRadius: dist(p0, center),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
67
90
|
//# sourceMappingURL=utils.js.map
|
package/esm/shape/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"src/","sources":["shape/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"src/","sources":["shape/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAkBnD,MAAM,UAAU,UAAU,CACxB,SAAoB,EACpB,KAAgC;IAEhC,KAAK,MAAM,CAAC,GAAG,EAAE,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AC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,OAAO;QACL,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE;QAC9C,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC;QAC7B,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -5,13 +5,15 @@ import { Interaction } from './interaction';
|
|
|
5
5
|
import { Transform } from './transform';
|
|
6
6
|
import { Scale } from './scale';
|
|
7
7
|
import { Title } from './title';
|
|
8
|
+
import { Data } from './data';
|
|
9
|
+
import { LabelLayout } from './labelLayout';
|
|
8
10
|
export declare type Node = MarkComposition | ViewComposition | LayerComposition | FlexComposition | MatrixComposition | RectComposition | CircleComposition | KeyframeComposition;
|
|
9
11
|
export declare type MarkComposition = Geometry & {
|
|
10
12
|
title?: Title;
|
|
11
13
|
};
|
|
12
14
|
export declare type ViewComposition = {
|
|
13
15
|
type?: 'view';
|
|
14
|
-
data?:
|
|
16
|
+
data?: Data;
|
|
15
17
|
key?: string;
|
|
16
18
|
class?: string;
|
|
17
19
|
paddingLeft?: number;
|
|
@@ -25,6 +27,7 @@ export declare type ViewComposition = {
|
|
|
25
27
|
theme?: Theme;
|
|
26
28
|
children?: MarkComposition[];
|
|
27
29
|
adjust?: Adjust;
|
|
30
|
+
labelLayout?: LabelLayout[];
|
|
28
31
|
};
|
|
29
32
|
export declare type LayerComposition = {
|
|
30
33
|
type?: 'layer';
|
|
@@ -35,7 +38,7 @@ export declare type LayerComposition = {
|
|
|
35
38
|
export declare type FlexComposition = {
|
|
36
39
|
type?: 'flex';
|
|
37
40
|
key?: string;
|
|
38
|
-
data?:
|
|
41
|
+
data?: Data;
|
|
39
42
|
direction?: 'col' | 'row';
|
|
40
43
|
ratio?: number[];
|
|
41
44
|
padding?: number;
|
|
@@ -53,7 +56,7 @@ export declare type FacetContext = {
|
|
|
53
56
|
};
|
|
54
57
|
export declare type RectComposition = {
|
|
55
58
|
transform?: Transform;
|
|
56
|
-
data?:
|
|
59
|
+
data?: Data;
|
|
57
60
|
paddingLeft?: number;
|
|
58
61
|
paddingRight?: number;
|
|
59
62
|
paddingTop?: number;
|
|
@@ -81,7 +84,7 @@ export declare type MatrixComposition = {
|
|
|
81
84
|
paddingBottom?: number;
|
|
82
85
|
transform?: Transform;
|
|
83
86
|
title?: Title;
|
|
84
|
-
data?:
|
|
87
|
+
data?: Data;
|
|
85
88
|
key?: string;
|
|
86
89
|
encode?: {
|
|
87
90
|
x?: string[];
|
|
@@ -102,7 +105,7 @@ export declare type CircleComposition = {
|
|
|
102
105
|
paddingBottom?: number;
|
|
103
106
|
transform?: Transform;
|
|
104
107
|
title?: Title;
|
|
105
|
-
data?:
|
|
108
|
+
data?: Data;
|
|
106
109
|
key?: string;
|
|
107
110
|
encode?: {
|
|
108
111
|
position?: string;
|