@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
|
@@ -12,28 +12,26 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.SymmetryY = void 0;
|
|
15
|
+
const util_1 = require("@antv/util");
|
|
15
16
|
const d3_array_1 = require("d3-array");
|
|
16
|
-
const helper_1 = require("
|
|
17
|
-
const
|
|
17
|
+
const helper_1 = require("./utils/helper");
|
|
18
|
+
const order_1 = require("./utils/order");
|
|
18
19
|
/**
|
|
19
20
|
* The SymmetryY transform apply offset for y channels, say to transform
|
|
20
21
|
* them to be symmetry.
|
|
21
22
|
*/
|
|
22
23
|
const SymmetryY = (options = {}) => {
|
|
23
24
|
const { groupBy = 'x' } = options;
|
|
24
|
-
return (
|
|
25
|
-
const {
|
|
25
|
+
return (I, mark) => {
|
|
26
|
+
const { encode } = mark;
|
|
26
27
|
const { x } = encode, rest = __rest(encode, ["x"]);
|
|
27
28
|
// Extract and create new channels starts with y, such as y, y1.
|
|
28
29
|
const Yn = Object.entries(rest)
|
|
29
30
|
.filter(([k]) => k.startsWith('y'))
|
|
30
|
-
.map(([k
|
|
31
|
-
const newYn = Yn.map(([k
|
|
32
|
-
const newV = new Array(I.length);
|
|
33
|
-
return [k, (0, helper_1.field)(newV, V)];
|
|
34
|
-
});
|
|
31
|
+
.map(([k]) => [k, (0, helper_1.columnOf)(encode, k)[0]]);
|
|
32
|
+
const newYn = Yn.map(([k]) => [k, new Array(I.length)]);
|
|
35
33
|
// Group marks into series by specified keys.
|
|
36
|
-
const groups = (0,
|
|
34
|
+
const groups = (0, order_1.createGroups)(groupBy, I, mark);
|
|
37
35
|
const MY = new Array(groups.length);
|
|
38
36
|
for (let i = 0; i < groups.length; i++) {
|
|
39
37
|
const I = groups[i];
|
|
@@ -53,13 +51,14 @@ const SymmetryY = (options = {}) => {
|
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
return [
|
|
55
|
+
I,
|
|
56
|
+
(0, util_1.deepMix)({}, mark, {
|
|
57
|
+
encode: Object.fromEntries(newYn.map(([k, v]) => [k, (0, helper_1.column)(v, (0, helper_1.columnOf)(encode, k)[1])])),
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
};
|
|
60
61
|
};
|
|
61
62
|
exports.SymmetryY = SymmetryY;
|
|
62
|
-
exports.SymmetryY.props = {
|
|
63
|
-
category: 'statistic',
|
|
64
|
-
};
|
|
63
|
+
exports.SymmetryY.props = {};
|
|
65
64
|
//# sourceMappingURL=symmetryY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symmetryY.js","sourceRoot":"src/","sources":["transform/symmetryY.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,uCAAkC;AAGlC,2CAAkD;AAClD,yCAA6C;AAI7C;;;GAGG;AACI,MAAM,SAAS,GAAyB,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAClC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;QACjB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACxB,MAAM,EAAE,CAAC,KAAc,MAAM,EAAf,IAAI,UAAK,MAAM,EAAvB,KAAc,CAAS,CAAC;QAE9B,gEAAgE;QAChE,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;aAC5B,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aAClC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAA,iBAAQ,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAU,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE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G,EAAE,CAAC,CAAC,CAAC,CAAC;oBACpB,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;iBAC1B;aACF;SACF;QAED,OAAO;YACL,CAAC;YACD,IAAA,cAAO,EAAC,EAAE,EAAE,IAAI,EAAE;gBAChB,MAAM,EAAE,MAAM,CAAC,WAAW,CACxB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAA,eAAM,EAAC,CAAC,EAAE,IAAA,iBAAQ,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC9D;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,SAAS,aA4CpB;AAEF,iBAAS,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function
|
|
3
|
-
[x: string]: T;
|
|
4
|
-
};
|
|
5
|
-
export declare function merge(transform: (context: TransformContext) => Partial<TransformContext> | Promise<Partial<TransformContext>>): Transform;
|
|
6
|
-
export declare function column(value: ColumnValue): {
|
|
1
|
+
import { Primitive } from '../../runtime';
|
|
2
|
+
export declare function column(value: Primitive[], field?: string): {
|
|
7
3
|
type: string;
|
|
8
|
-
value:
|
|
4
|
+
value: Primitive[];
|
|
5
|
+
field: string;
|
|
9
6
|
};
|
|
10
|
-
export declare function
|
|
7
|
+
export declare function visualColumn(value: Primitive[], field?: string): {
|
|
11
8
|
type: string;
|
|
12
|
-
value: Primitive;
|
|
9
|
+
value: Primitive[];
|
|
10
|
+
field: string;
|
|
11
|
+
visual: boolean;
|
|
13
12
|
};
|
|
14
|
-
export declare function
|
|
13
|
+
export declare function constant(I: number[], value: any): any[];
|
|
14
|
+
export declare function columnOf(encode: any, key: string): [Primitive[], string];
|
|
15
|
+
export declare function maybeColumnOf(encode: any, ...K: (string | Primitive[])[]): [Primitive[], string];
|
|
@@ -1,48 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
function
|
|
14
|
-
var _a;
|
|
15
|
-
const target = Object.assign({}, source);
|
|
16
|
-
for (const [key, value] of Object.entries(defaults)) {
|
|
17
|
-
target[key] = (_a = target[key]) !== null && _a !== void 0 ? _a : value;
|
|
18
|
-
}
|
|
19
|
-
return target;
|
|
20
|
-
}
|
|
21
|
-
exports.applyDefaults = applyDefaults;
|
|
22
|
-
function merge(transform) {
|
|
23
|
-
return (options) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const newOptions = yield transform(options);
|
|
25
|
-
const { encode: newEncode } = newOptions;
|
|
26
|
-
const { encode: oldEncode } = options;
|
|
27
|
-
return Object.assign(Object.assign(Object.assign({}, options), newOptions), (newEncode && { encode: Object.assign(Object.assign({}, oldEncode), newEncode) }));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.merge = merge;
|
|
31
|
-
function column(value) {
|
|
3
|
+
exports.maybeColumnOf = exports.columnOf = exports.constant = exports.visualColumn = exports.column = void 0;
|
|
4
|
+
function column(value, field) {
|
|
32
5
|
if (value === null)
|
|
33
6
|
return undefined;
|
|
34
|
-
return { type: 'column', value };
|
|
7
|
+
return { type: 'column', value, field };
|
|
35
8
|
}
|
|
36
9
|
exports.column = column;
|
|
37
|
-
function
|
|
38
|
-
|
|
10
|
+
function visualColumn(value, field) {
|
|
11
|
+
if (value === null)
|
|
12
|
+
return undefined;
|
|
13
|
+
return { type: 'column', value, field, visual: true };
|
|
14
|
+
}
|
|
15
|
+
exports.visualColumn = visualColumn;
|
|
16
|
+
function constant(I, value) {
|
|
17
|
+
return new Array(I.length).fill(value);
|
|
39
18
|
}
|
|
40
19
|
exports.constant = constant;
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
20
|
+
function columnOf(encode, key) {
|
|
21
|
+
const channel = encode[key];
|
|
22
|
+
if (!channel)
|
|
23
|
+
return [null, null];
|
|
24
|
+
const { value, field = null } = channel;
|
|
25
|
+
return [value, field];
|
|
26
|
+
}
|
|
27
|
+
exports.columnOf = columnOf;
|
|
28
|
+
function maybeColumnOf(encode, ...K) {
|
|
29
|
+
for (const key of K) {
|
|
30
|
+
if (typeof key === 'string') {
|
|
31
|
+
const [KV, fv] = columnOf(encode, key);
|
|
32
|
+
if (KV !== null)
|
|
33
|
+
return [KV, fv];
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return [key, null];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [null, null];
|
|
46
40
|
}
|
|
47
|
-
exports.
|
|
41
|
+
exports.maybeColumnOf = maybeColumnOf;
|
|
48
42
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"src/","sources":["transform/utils/helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"src/","sources":["transform/utils/helper.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AAM;YACL,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;SACpB;KACF;IACD,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtB,CAAC;AAbD,sCAaC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Primitive } from 'd3-array';
|
|
2
|
-
import {
|
|
3
|
-
export declare type IndexComparatorFactory = (data: TabularData, Y:
|
|
2
|
+
import { TabularData, G2Mark } from '../../runtime';
|
|
3
|
+
export declare type IndexComparatorFactory = (data: TabularData, Y: Primitive[], S: Primitive[]) => IndexComparator;
|
|
4
4
|
export declare type IndexComparator = (i: number, j: number) => number;
|
|
5
5
|
export declare type Order = 'value' | 'sum' | 'series' | 'maxIndex' | string[] | ((data: Record<string, Primitive>) => Primitive);
|
|
6
|
-
export declare function createGroups(groupBy: string | string[],
|
|
6
|
+
export declare function createGroups(groupBy: string | string[], I: number[], mark: G2Mark): number[][];
|
|
7
7
|
export declare function normalizeComparator(order: Order): IndexComparatorFactory;
|
|
8
8
|
export declare function applyOrder(groups: number[][], comparator: IndexComparator): void;
|
|
9
|
-
export declare function domainOf(value:
|
|
9
|
+
export declare function domainOf(value: Primitive[], scale: Record<string, any>): any;
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.domainOf = exports.applyOrder = exports.normalizeComparator = exports.createGroups = void 0;
|
|
4
4
|
const d3_array_1 = require("d3-array");
|
|
5
|
+
const helper_1 = require("../../utils/helper");
|
|
5
6
|
const array_1 = require("../../utils/array");
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const helper_2 = require("./helper");
|
|
8
|
+
function createGroups(groupBy, I, mark) {
|
|
9
|
+
const { encode } = mark;
|
|
8
10
|
const G = normalizeGroupBy(groupBy)
|
|
9
|
-
.map((k) => [k, columnOf(
|
|
10
|
-
.filter(([,
|
|
11
|
+
.map((k) => { var _a; return [k, (_a = (0, helper_2.columnOf)(encode, k)) === null || _a === void 0 ? void 0 : _a[0]]; })
|
|
12
|
+
.filter(([, column]) => (0, helper_1.defined)(column));
|
|
11
13
|
const key = (i) => G.map(([, V]) => V[i]).join('-');
|
|
12
14
|
return Array.from((0, d3_array_1.group)(I, key).values());
|
|
13
15
|
}
|
|
@@ -74,4 +76,4 @@ function createMaxIndexOrder(data, Y, S) {
|
|
|
74
76
|
function ascendingComparator(order) {
|
|
75
77
|
return (i, j) => (0, d3_array_1.ascending)(order(i), order(j));
|
|
76
78
|
}
|
|
77
|
-
//# sourceMappingURL=
|
|
79
|
+
//# sourceMappingURL=order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.js","sourceRoot":"src/","sources":["transform/utils/order.ts"],"names":[],"mappings":";;;AAAA,uCAAiE;AACjE,+CAA6C;AAE7C,6CAA4C;AAC5C,qCAAoC;AAkBpC,SAAgB,YAAY,CAC1B,OAA0B,EAC1B,CAAW,EACX,IAAY;IAEZ,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAC,CAAC,EAAE,MAAA,IAAA,iBAAQ,EAAC,MAAM,EAAE,CAAC,CAAC,0CAAG,CAAC,CAAC,CAAU,CAAA,EAAA,CAAC;SAClD,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAA,gBAAK,EAAC,CAAC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 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
2
|
export declare function isTranspose(coordinate: Coordinate): boolean;
|
|
3
3
|
export declare function isPolar(coordinate: Coordinate): boolean;
|
|
4
|
+
export declare function isHelix(coordinate: Coordinate): boolean;
|
|
4
5
|
export declare function isParallel(coordinate: Coordinate): boolean;
|
|
5
6
|
export declare function isFisheye(coordinate: Coordinate): boolean;
|
package/lib/utils/coordinate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFisheye = exports.isParallel = exports.isPolar = exports.isTranspose = void 0;
|
|
3
|
+
exports.isFisheye = exports.isParallel = exports.isHelix = exports.isPolar = exports.isTranspose = void 0;
|
|
4
4
|
function isTranspose(coordinate) {
|
|
5
5
|
const { transformations } = coordinate.getOptions();
|
|
6
6
|
const transposes = transformations
|
|
@@ -14,6 +14,11 @@ function isPolar(coordinate) {
|
|
|
14
14
|
return transformations.some(([type]) => type === 'polar');
|
|
15
15
|
}
|
|
16
16
|
exports.isPolar = isPolar;
|
|
17
|
+
function isHelix(coordinate) {
|
|
18
|
+
const { transformations } = coordinate.getOptions();
|
|
19
|
+
return transformations.some(([type]) => type === 'helix');
|
|
20
|
+
}
|
|
21
|
+
exports.isHelix = isHelix;
|
|
17
22
|
function isParallel(coordinate) {
|
|
18
23
|
const { transformations } = coordinate.getOptions();
|
|
19
24
|
return transformations.some(([type]) => type === 'parallel');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinate.js","sourceRoot":"src/","sources":["utils/coordinate.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CAAC,UAAsB;IAChD,MAAM,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;IACpD,MAAM,UAAU,GAAG,eAAe;SAC/B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,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
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"cross-env": "^7.0.3",
|
|
54
54
|
"eslint": "^7.22.0",
|
|
55
55
|
"eslint-plugin-import": "^2.22.1",
|
|
56
|
-
"genji-notebook": "^0.1.
|
|
56
|
+
"genji-notebook": "^0.1.1",
|
|
57
57
|
"husky": "^7.0.0",
|
|
58
58
|
"jest": "^26.0.1",
|
|
59
59
|
"jest-electron": "^0.1.12",
|
|
@@ -103,10 +103,11 @@
|
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@antv/coord": "^0.4.1",
|
|
106
|
-
"@antv/g": "^5.
|
|
107
|
-
"@antv/g-canvas": "^1.
|
|
108
|
-
"@antv/g-plugin-dragndrop": "^1.
|
|
106
|
+
"@antv/g": "^5.7.4",
|
|
107
|
+
"@antv/g-canvas": "^1.7.4",
|
|
108
|
+
"@antv/g-plugin-dragndrop": "^1.6.1",
|
|
109
109
|
"@antv/gui": "^0.4.3-alpha.5",
|
|
110
|
+
"@antv/path-util": "^3.0.1",
|
|
110
111
|
"@antv/scale": "^0.4.7",
|
|
111
112
|
"@antv/util": "^2.0.17",
|
|
112
113
|
"d3-array": "^3.1.1",
|
package/src/animation/fadeIn.ts
CHANGED
|
@@ -10,16 +10,14 @@ export type FadeInOptions = Animation;
|
|
|
10
10
|
export const FadeIn: AC<FadeInOptions> = (options) => {
|
|
11
11
|
return (from, to, value, coordinate, defaults) => {
|
|
12
12
|
const [shape] = from;
|
|
13
|
-
|
|
14
|
-
// todo: When G's bug fixed, modify to `shape.style`.
|
|
15
|
-
const { fillOpacity, strokeOpacity, opacity } = shape.parsedStyle;
|
|
13
|
+
const { fillOpacity, strokeOpacity, opacity } = shape.style;
|
|
16
14
|
|
|
17
15
|
const keyframes = [
|
|
18
16
|
{ fillOpacity: 0, strokeOpacity: 0, opacity: 0 },
|
|
19
17
|
{
|
|
20
|
-
fillOpacity
|
|
21
|
-
strokeOpacity
|
|
22
|
-
opacity
|
|
18
|
+
fillOpacity,
|
|
19
|
+
strokeOpacity,
|
|
20
|
+
opacity,
|
|
23
21
|
},
|
|
24
22
|
];
|
|
25
23
|
|
package/src/animation/fadeOut.ts
CHANGED
|
@@ -10,12 +10,12 @@ export type FadeOutOptions = Animation;
|
|
|
10
10
|
export const FadeOut: AC<FadeOutOptions> = (options) => {
|
|
11
11
|
return (from, to, value, coordinate, defaults) => {
|
|
12
12
|
const [shape] = from;
|
|
13
|
-
const { fillOpacity, strokeOpacity, opacity } = shape.
|
|
13
|
+
const { fillOpacity, strokeOpacity, opacity } = shape.style;
|
|
14
14
|
const keyframes = [
|
|
15
15
|
{
|
|
16
|
-
fillOpacity
|
|
17
|
-
strokeOpacity
|
|
18
|
-
opacity
|
|
16
|
+
fillOpacity,
|
|
17
|
+
strokeOpacity,
|
|
18
|
+
opacity,
|
|
19
19
|
},
|
|
20
20
|
{ fillOpacity: 0, strokeOpacity: 0, opacity: 0 },
|
|
21
21
|
];
|
|
@@ -158,15 +158,14 @@ function multipleToOne(
|
|
|
158
158
|
split: SplitFunction,
|
|
159
159
|
) {
|
|
160
160
|
const D = split(to, from.length);
|
|
161
|
-
|
|
162
|
-
const { fillOpacity, strokeOpacity, opacity } = to.parsedStyle;
|
|
161
|
+
const { fillOpacity, strokeOpacity, opacity } = to.style;
|
|
163
162
|
const keyframes = [
|
|
164
163
|
{ fillOpacity: 0, strokeOpacity: 0, opacity: 0 },
|
|
165
164
|
{ fillOpacity: 0, strokeOpacity: 0, opacity: 0, offset: 0.99 },
|
|
166
165
|
{
|
|
167
|
-
fillOpacity
|
|
168
|
-
strokeOpacity
|
|
169
|
-
opacity
|
|
166
|
+
fillOpacity,
|
|
167
|
+
strokeOpacity,
|
|
168
|
+
opacity,
|
|
170
169
|
},
|
|
171
170
|
];
|
|
172
171
|
const animation = to.animate(keyframes, timeEffect);
|
|
@@ -16,8 +16,12 @@ export const ScaleInX: AC<ScaleInXOptions> = (options) => {
|
|
|
16
16
|
return (from, to, value, coordinate, defaults) => {
|
|
17
17
|
const [shape] = from;
|
|
18
18
|
const { height } = shape.getBoundingClientRect();
|
|
19
|
-
const {
|
|
20
|
-
|
|
19
|
+
const {
|
|
20
|
+
transform: prefix,
|
|
21
|
+
fillOpacity,
|
|
22
|
+
strokeOpacity,
|
|
23
|
+
opacity,
|
|
24
|
+
} = shape.style;
|
|
21
25
|
const [transformOrigin, transform]: [[number, number], string] =
|
|
22
26
|
isTranspose(coordinate)
|
|
23
27
|
? [[0, height], `scale(1, ${ZERO})`] // left-bottom corner
|
|
@@ -34,9 +38,9 @@ export const ScaleInX: AC<ScaleInXOptions> = (options) => {
|
|
|
34
38
|
},
|
|
35
39
|
{
|
|
36
40
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
37
|
-
fillOpacity
|
|
38
|
-
strokeOpacity
|
|
39
|
-
opacity
|
|
41
|
+
fillOpacity,
|
|
42
|
+
strokeOpacity,
|
|
43
|
+
opacity,
|
|
40
44
|
offset: 0.01,
|
|
41
45
|
},
|
|
42
46
|
{
|
|
@@ -16,8 +16,12 @@ export const ScaleInY: AC<ScaleInYOptions> = (options) => {
|
|
|
16
16
|
return (from, to, value, coordinate, defaults) => {
|
|
17
17
|
const [shape] = from;
|
|
18
18
|
const { height } = shape.getBoundingClientRect();
|
|
19
|
-
const {
|
|
20
|
-
|
|
19
|
+
const {
|
|
20
|
+
transform: prefix,
|
|
21
|
+
fillOpacity,
|
|
22
|
+
strokeOpacity,
|
|
23
|
+
opacity,
|
|
24
|
+
} = shape.style;
|
|
21
25
|
const [transformOrigin, transform]: [[number, number], string] =
|
|
22
26
|
isTranspose(coordinate)
|
|
23
27
|
? [[0, 0], `scale(${ZERO}, 1)`] // left-top corner
|
|
@@ -34,9 +38,9 @@ export const ScaleInY: AC<ScaleInYOptions> = (options) => {
|
|
|
34
38
|
},
|
|
35
39
|
{
|
|
36
40
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
37
|
-
fillOpacity
|
|
38
|
-
strokeOpacity
|
|
39
|
-
opacity
|
|
41
|
+
fillOpacity,
|
|
42
|
+
strokeOpacity,
|
|
43
|
+
opacity,
|
|
40
44
|
offset: 0.01,
|
|
41
45
|
},
|
|
42
46
|
{
|
|
@@ -16,8 +16,12 @@ export const ScaleOutX: AC<ScaleOutXOptions> = (options) => {
|
|
|
16
16
|
return (from, to, value, coordinate, defaults) => {
|
|
17
17
|
const [shape] = from;
|
|
18
18
|
const { height } = shape.getBoundingClientRect();
|
|
19
|
-
const {
|
|
20
|
-
|
|
19
|
+
const {
|
|
20
|
+
transform: prefix,
|
|
21
|
+
fillOpacity,
|
|
22
|
+
strokeOpacity,
|
|
23
|
+
opacity,
|
|
24
|
+
} = shape.style;
|
|
21
25
|
const [transformOrigin, transform]: [[number, number], string] =
|
|
22
26
|
isTranspose(coordinate)
|
|
23
27
|
? [[0, height], `scale(1, ${ZERO})`] // left-bottom corner
|
|
@@ -31,9 +35,9 @@ export const ScaleOutX: AC<ScaleOutXOptions> = (options) => {
|
|
|
31
35
|
},
|
|
32
36
|
{
|
|
33
37
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
34
|
-
fillOpacity
|
|
35
|
-
strokeOpacity
|
|
36
|
-
opacity
|
|
38
|
+
fillOpacity,
|
|
39
|
+
strokeOpacity,
|
|
40
|
+
opacity,
|
|
37
41
|
offset: 0.99,
|
|
38
42
|
},
|
|
39
43
|
{
|
|
@@ -16,8 +16,12 @@ export const ScaleOutY: AC<ScaleOutYOptions> = (options) => {
|
|
|
16
16
|
return (from, to, value, coordinate, defaults) => {
|
|
17
17
|
const [shape] = from;
|
|
18
18
|
const { height } = shape.getBoundingClientRect();
|
|
19
|
-
const {
|
|
20
|
-
|
|
19
|
+
const {
|
|
20
|
+
transform: prefix,
|
|
21
|
+
fillOpacity,
|
|
22
|
+
strokeOpacity,
|
|
23
|
+
opacity,
|
|
24
|
+
} = shape.style;
|
|
21
25
|
const [transformOrigin, transform]: [[number, number], string] =
|
|
22
26
|
isTranspose(coordinate)
|
|
23
27
|
? [[0, 0], `scale(${ZERO}, 1)`] // left-top corner
|
|
@@ -31,9 +35,9 @@ export const ScaleOutY: AC<ScaleOutYOptions> = (options) => {
|
|
|
31
35
|
},
|
|
32
36
|
{
|
|
33
37
|
transform: `${prefix} ${transform}`.trimStart(),
|
|
34
|
-
fillOpacity
|
|
35
|
-
strokeOpacity
|
|
36
|
-
opacity
|
|
38
|
+
fillOpacity,
|
|
39
|
+
strokeOpacity,
|
|
40
|
+
opacity,
|
|
37
41
|
offset: 0.99,
|
|
38
42
|
},
|
|
39
43
|
{
|
package/src/api/chart.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clone } from '@antv/util';
|
|
2
|
-
import { render } from '../runtime';
|
|
2
|
+
import { G2Context, render } from '../runtime';
|
|
3
3
|
import { ViewComposition } from '../spec';
|
|
4
4
|
import { Node } from './node';
|
|
5
5
|
import {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from './types';
|
|
17
17
|
import { mark, Mark } from './mark';
|
|
18
18
|
import { composition, Composition } from './composition';
|
|
19
|
+
import { library } from './library';
|
|
19
20
|
|
|
20
21
|
function normalizeContainer(container: string | HTMLElement): HTMLElement {
|
|
21
22
|
if (container === undefined) return document.createElement('div');
|
|
@@ -100,17 +101,23 @@ export const props: NodePropertyDescriptor[] = [
|
|
|
100
101
|
|
|
101
102
|
@defineProps(props)
|
|
102
103
|
export class Chart extends Node<ChartOptions> {
|
|
103
|
-
private
|
|
104
|
+
private _container: HTMLElement;
|
|
105
|
+
|
|
106
|
+
private _context: G2Context;
|
|
104
107
|
|
|
105
108
|
constructor(options: ChartOptions = {}) {
|
|
106
109
|
const { container, ...rest } = options;
|
|
107
110
|
super(rest, 'view');
|
|
108
|
-
this.
|
|
111
|
+
this._container = normalizeContainer(container);
|
|
112
|
+
this._context = { library };
|
|
109
113
|
}
|
|
110
114
|
|
|
111
|
-
render() {
|
|
112
|
-
const
|
|
113
|
-
this.
|
|
115
|
+
render(): Chart {
|
|
116
|
+
const options = optionsOf(this);
|
|
117
|
+
const node = render(options, this._context);
|
|
118
|
+
if (node.parentNode !== this._container) {
|
|
119
|
+
this._container.append(node);
|
|
120
|
+
}
|
|
114
121
|
return this;
|
|
115
122
|
}
|
|
116
123
|
|
|
@@ -118,7 +125,11 @@ export class Chart extends Node<ChartOptions> {
|
|
|
118
125
|
return optionsOf(this);
|
|
119
126
|
}
|
|
120
127
|
|
|
121
|
-
node() {
|
|
122
|
-
return this.
|
|
128
|
+
node(): HTMLElement {
|
|
129
|
+
return this._container;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
context(): G2Context {
|
|
133
|
+
return this._context;
|
|
123
134
|
}
|
|
124
135
|
}
|
package/src/api/index.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createLibrary } from '../stdlib';
|
|
2
|
+
import { G2ComponentNamespaces, G2Component } from '../runtime';
|
|
3
|
+
|
|
4
|
+
export const library = createLibrary();
|
|
5
|
+
|
|
6
|
+
// @todo Warn if override existing key.
|
|
7
|
+
export function register(
|
|
8
|
+
key: `${G2ComponentNamespaces}.${any}`,
|
|
9
|
+
component: G2Component,
|
|
10
|
+
) {
|
|
11
|
+
Object.assign(library, { [key]: component });
|
|
12
|
+
}
|
|
@@ -85,6 +85,7 @@ export const Circle: CC<CircleComposition> = () => {
|
|
|
85
85
|
.call(setEncode)
|
|
86
86
|
.call(inferColor)
|
|
87
87
|
.call(setCoordinate)
|
|
88
|
+
.call(setData)
|
|
88
89
|
.call(
|
|
89
90
|
setChildren,
|
|
90
91
|
subLayoutCircle,
|
|
@@ -92,7 +93,6 @@ export const Circle: CC<CircleComposition> = () => {
|
|
|
92
93
|
createGuideCircle,
|
|
93
94
|
{ frame: false },
|
|
94
95
|
)
|
|
95
|
-
.call(setData)
|
|
96
96
|
.call(setAnimation)
|
|
97
97
|
.call(setStyle)
|
|
98
98
|
.call(setScale)
|
package/src/composition/flex.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CompositionComponent as CC } from '../runtime';
|
|
2
2
|
import { FlexComposition } from '../spec';
|
|
3
|
+
import { mergeData } from './utils';
|
|
3
4
|
|
|
4
5
|
export type FlexOptions = Omit<FlexComposition, 'type'>;
|
|
5
6
|
|
|
@@ -29,13 +30,14 @@ export const Flex: CC<FlexOptions> = () => {
|
|
|
29
30
|
const newChildren = [];
|
|
30
31
|
let next = options[mainStart] || 0;
|
|
31
32
|
for (let i = 0; i < sizes.length; i += 1) {
|
|
32
|
-
const { data
|
|
33
|
+
const { data, ...rest } = children[i];
|
|
34
|
+
const newData = mergeData(data, flexData);
|
|
33
35
|
newChildren.push({
|
|
34
36
|
[mainStart]: next,
|
|
35
37
|
[mainSize]: sizes[i],
|
|
36
38
|
[crossStart]: options[crossStart] || 0,
|
|
37
39
|
[crossSize]: options[crossSize],
|
|
38
|
-
data,
|
|
40
|
+
data: newData,
|
|
39
41
|
...rest,
|
|
40
42
|
});
|
|
41
43
|
next += sizes[i] + padding;
|
package/src/composition/layer.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CompositionComponent as CC } from '../runtime';
|
|
2
2
|
import { LayerComposition } from '../spec';
|
|
3
|
+
import { mergeData } from './utils';
|
|
3
4
|
|
|
4
5
|
export type LayerOptions = Omit<LayerComposition, 'type'>;
|
|
5
6
|
|
|
@@ -11,9 +12,9 @@ export const Layer: CC<LayerOptions> = () => {
|
|
|
11
12
|
const { children } = options;
|
|
12
13
|
if (!Array.isArray(children)) return [];
|
|
13
14
|
const { x = 0, y = 0, width, height, data: layerData } = options;
|
|
14
|
-
return children.map(({ data
|
|
15
|
+
return children.map(({ data, ...rest }) => ({
|
|
15
16
|
...rest,
|
|
16
|
-
data,
|
|
17
|
+
data: mergeData(data, layerData),
|
|
17
18
|
x,
|
|
18
19
|
y,
|
|
19
20
|
width,
|
package/src/composition/mark.ts
CHANGED
|
@@ -23,8 +23,10 @@ export const Mark: CC<MarkOptions> = () => {
|
|
|
23
23
|
key,
|
|
24
24
|
frame,
|
|
25
25
|
title,
|
|
26
|
+
labelLayout,
|
|
26
27
|
...mark
|
|
27
28
|
} = options;
|
|
29
|
+
|
|
28
30
|
return [
|
|
29
31
|
{
|
|
30
32
|
type: 'standardView',
|
|
@@ -43,6 +45,7 @@ export const Mark: CC<MarkOptions> = () => {
|
|
|
43
45
|
interaction,
|
|
44
46
|
frame,
|
|
45
47
|
title,
|
|
48
|
+
labelLayout,
|
|
46
49
|
marks: [{ ...mark, key: `${key}-0`, data }],
|
|
47
50
|
},
|
|
48
51
|
];
|