@antv/g2 5.0.0-alpha.1 → 5.0.0-alpha.2
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/dist/g2-lite.min.js +10 -0
- package/dist/g2.min.js +3 -3
- package/esm/adjust/index.d.ts +2 -1
- package/esm/adjust/index.js.map +1 -1
- package/esm/animation/index.d.ts +14 -7
- package/esm/animation/index.js.map +1 -1
- package/esm/animation/scaleInX.js +3 -0
- package/esm/animation/scaleInX.js.map +1 -1
- package/esm/animation/scaleInY.js +3 -0
- package/esm/animation/scaleInY.js.map +1 -1
- package/esm/api/chart.d.ts +4 -0
- package/esm/api/chart.js +20 -3
- package/esm/api/chart.js.map +1 -1
- package/esm/api/mark/index.d.ts +3 -3
- package/esm/api/mark/index.js +2 -2
- package/esm/api/mark/index.js.map +1 -1
- package/esm/api/mark/mark.d.ts +4 -4
- package/esm/api/mark/mark.js +6 -5
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/mark/types.d.ts +1 -0
- package/esm/api/node.d.ts +4 -5
- package/esm/api/node.js +5 -7
- package/esm/api/node.js.map +1 -1
- package/esm/api/props.d.ts +1 -0
- package/esm/api/props.js +10 -10
- package/esm/api/props.js.map +1 -1
- package/esm/component/axis.d.ts +1 -1
- package/esm/component/axis.js +11 -4
- package/esm/component/axis.js.map +1 -1
- package/esm/component/index.d.ts +10 -5
- package/esm/component/index.js.map +1 -1
- package/esm/composition/index.d.ts +16 -8
- package/esm/composition/index.js.map +1 -1
- package/esm/composition/rect.js +1 -1
- package/esm/composition/rect.js.map +1 -1
- package/esm/coordinate/index.d.ts +24 -12
- package/esm/coordinate/index.js.map +1 -1
- package/esm/data/arc.d.ts +7 -0
- package/esm/data/arc.js +10 -18
- package/esm/data/arc.js.map +1 -1
- package/esm/data/cluster.d.ts +8 -0
- package/esm/data/cluster.js +36 -46
- package/esm/data/cluster.js.map +1 -1
- package/esm/data/custom.d.ts +7 -0
- package/esm/data/custom.js +10 -0
- package/esm/data/custom.js.map +1 -0
- package/esm/data/fetch.js +7 -6
- package/esm/data/fetch.js.map +1 -1
- package/esm/data/filterBy.js +6 -2
- package/esm/data/filterBy.js.map +1 -1
- package/esm/data/index.d.ts +28 -9
- package/esm/data/index.js +6 -1
- package/esm/data/index.js.map +1 -1
- package/esm/data/map.d.ts +7 -0
- package/esm/data/map.js +10 -0
- package/esm/data/map.js.map +1 -0
- package/esm/data/sankey.d.ts +8 -0
- package/esm/data/sankey.js +76 -95
- package/esm/data/sankey.js.map +1 -1
- package/esm/data/sortBy.js +14 -4
- package/esm/data/sortBy.js.map +1 -1
- package/esm/data/tree.d.ts +4 -0
- package/esm/data/tree.js +6 -9
- package/esm/data/tree.js.map +1 -1
- package/esm/data/utils/arc/index.d.ts +1 -1
- package/esm/data/utils/fields.d.ts +6 -0
- package/esm/data/utils/fields.js +15 -0
- package/esm/data/utils/fields.js.map +1 -0
- package/esm/data/voronoi.d.ts +1 -0
- package/esm/data/voronoi.js +1 -22
- package/esm/data/voronoi.js.map +1 -1
- package/esm/data/wordCloud.d.ts +1 -0
- package/esm/data/wordCloud.js +1 -93
- package/esm/data/wordCloud.js.map +1 -1
- package/esm/encode/index.d.ts +8 -4
- package/esm/encode/index.js.map +1 -1
- package/esm/interaction/action/index.d.ts +42 -21
- package/esm/interaction/action/index.js +8 -8
- package/esm/interaction/action/index.js.map +1 -1
- package/esm/interaction/index.d.ts +1 -1
- package/esm/interaction/index.js +0 -1
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/interactor/index.d.ts +4 -2
- package/esm/interaction/interactor/index.js.map +1 -1
- package/esm/mark/annotation/index.d.ts +14 -7
- package/esm/mark/annotation/index.js +6 -6
- package/esm/mark/annotation/index.js.map +1 -1
- package/esm/mark/geometry/{schema.d.ts → box.d.ts} +4 -4
- package/esm/mark/geometry/{schema.js → box.js} +4 -4
- package/esm/mark/geometry/box.js.map +1 -0
- package/esm/mark/geometry/image.js +5 -4
- package/esm/mark/geometry/image.js.map +1 -1
- package/esm/mark/geometry/index.d.ts +22 -13
- package/esm/mark/geometry/index.js +1 -3
- package/esm/mark/geometry/index.js.map +1 -1
- package/esm/mark/geometry/interval.js +0 -1
- package/esm/mark/geometry/interval.js.map +1 -1
- package/esm/mark/geometry/line.js +5 -1
- package/esm/mark/geometry/line.js.map +1 -1
- package/esm/mark/geometry/link.js +1 -1
- package/esm/mark/geometry/link.js.map +1 -1
- package/esm/mark/geometry/point.js +6 -2
- package/esm/mark/geometry/point.js.map +1 -1
- package/esm/mark/geometry/polygon.js +1 -1
- package/esm/mark/geometry/polygon.js.map +1 -1
- package/esm/palette/index.d.ts +4 -2
- package/esm/palette/index.js.map +1 -1
- package/esm/runtime/component.d.ts +1 -1
- package/esm/runtime/component.js +8 -3
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/mark.js +4 -3
- package/esm/runtime/mark.js.map +1 -1
- package/esm/runtime/plot.js +47 -28
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.js +15 -6
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/scale.js +1 -1
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/types/component.d.ts +4 -6
- package/esm/runtime/types/options.d.ts +1 -0
- package/esm/scale/index.d.ts +22 -11
- package/esm/scale/index.js.map +1 -1
- package/esm/shape/annotation/text.js +16 -4
- package/esm/shape/annotation/text.js.map +1 -1
- package/esm/shape/{schema → box}/box.d.ts +0 -0
- package/esm/shape/{schema → box}/box.js +2 -2
- package/esm/shape/box/box.js.map +1 -0
- package/esm/shape/index.d.ts +86 -48
- package/esm/shape/index.js +9 -12
- package/esm/shape/index.js.map +1 -1
- package/esm/shape/label/label.js +62 -38
- package/esm/shape/label/label.js.map +1 -1
- package/esm/shape/{edge → link}/arc.d.ts +0 -0
- package/esm/shape/{edge → link}/arc.js +0 -0
- package/esm/shape/{edge → link}/arc.js.map +1 -1
- package/esm/shape/{edge → link}/smoothEdge.d.ts +0 -0
- package/esm/shape/{edge → link}/smoothEdge.js +0 -0
- package/esm/shape/{edge → link}/smoothEdge.js.map +1 -1
- package/esm/shape/{edge → link}/vhv.d.ts +0 -0
- package/esm/shape/{edge → link}/vhv.js +0 -0
- package/esm/shape/{edge → link}/vhv.js.map +1 -1
- package/esm/shape/{edge → polygon}/ribbon.d.ts +0 -0
- package/esm/shape/{edge → polygon}/ribbon.js +0 -0
- package/esm/shape/polygon/ribbon.js.map +1 -0
- package/esm/spec/data.d.ts +145 -8
- package/esm/spec/geometry.d.ts +5 -3
- package/esm/spec/transform.d.ts +18 -8
- package/esm/spec/transform.js +0 -133
- package/esm/spec/transform.js.map +1 -1
- package/esm/stdlib/index.js +13 -17
- package/esm/stdlib/index.js.map +1 -1
- package/esm/transform/dodgeX.js +7 -3
- package/esm/transform/dodgeX.js.map +1 -1
- package/esm/transform/flexX.d.ts +7 -0
- package/esm/transform/flexX.js +31 -0
- package/esm/transform/flexX.js.map +1 -0
- package/esm/transform/groupX.js +17 -19
- package/esm/transform/groupX.js.map +1 -1
- package/esm/transform/index.d.ts +46 -21
- package/esm/transform/index.js +3 -1
- package/esm/transform/index.js.map +1 -1
- package/esm/transform/normalizeY.js +1 -2
- package/esm/transform/normalizeY.js.map +1 -1
- package/esm/transform/sortX.d.ts +8 -0
- package/esm/transform/sortX.js +60 -0
- package/esm/transform/sortX.js.map +1 -0
- package/esm/transform/stackY.d.ts +1 -1
- package/esm/transform/stackY.js +26 -9
- package/esm/transform/stackY.js.map +1 -1
- package/esm/utils/coordinate.d.ts +1 -0
- package/esm/utils/coordinate.js +3 -0
- package/esm/utils/coordinate.js.map +1 -1
- package/lib/adjust/index.d.ts +2 -1
- package/lib/adjust/index.js.map +1 -1
- package/lib/animation/index.d.ts +14 -7
- package/lib/animation/index.js.map +1 -1
- package/lib/animation/scaleInX.js +3 -0
- package/lib/animation/scaleInX.js.map +1 -1
- package/lib/animation/scaleInY.js +3 -0
- package/lib/animation/scaleInY.js.map +1 -1
- package/lib/api/chart.d.ts +4 -0
- package/lib/api/chart.js +20 -3
- package/lib/api/chart.js.map +1 -1
- package/lib/api/mark/index.d.ts +3 -3
- package/lib/api/mark/index.js +1 -1
- package/lib/api/mark/index.js.map +1 -1
- package/lib/api/mark/mark.d.ts +4 -4
- package/lib/api/mark/mark.js +7 -6
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/mark/types.d.ts +1 -0
- package/lib/api/node.d.ts +4 -5
- package/lib/api/node.js +5 -7
- package/lib/api/node.js.map +1 -1
- package/lib/api/props.d.ts +1 -0
- package/lib/api/props.js +10 -10
- package/lib/api/props.js.map +1 -1
- package/lib/component/axis.d.ts +1 -1
- package/lib/component/axis.js +11 -4
- package/lib/component/axis.js.map +1 -1
- package/lib/component/index.d.ts +10 -5
- package/lib/component/index.js.map +1 -1
- package/lib/composition/index.d.ts +16 -8
- package/lib/composition/index.js.map +1 -1
- package/lib/composition/rect.js +1 -1
- package/lib/composition/rect.js.map +1 -1
- package/lib/coordinate/index.d.ts +24 -12
- package/lib/coordinate/index.js.map +1 -1
- package/lib/data/arc.d.ts +7 -0
- package/lib/data/arc.js +14 -18
- package/lib/data/arc.js.map +1 -1
- package/lib/data/cluster.d.ts +8 -0
- package/lib/data/cluster.js +41 -46
- package/lib/data/cluster.js.map +1 -1
- package/lib/data/custom.d.ts +7 -0
- package/lib/data/custom.js +14 -0
- package/lib/data/custom.js.map +1 -0
- package/lib/data/fetch.js +6 -5
- package/lib/data/fetch.js.map +1 -1
- package/lib/data/filterBy.js +6 -2
- package/lib/data/filterBy.js.map +1 -1
- package/lib/data/index.d.ts +28 -9
- package/lib/data/index.js +13 -3
- package/lib/data/index.js.map +1 -1
- package/lib/data/map.d.ts +7 -0
- package/lib/data/map.js +14 -0
- package/lib/data/map.js.map +1 -0
- package/lib/data/sankey.d.ts +8 -0
- package/lib/data/sankey.js +80 -95
- package/lib/data/sankey.js.map +1 -1
- package/lib/data/sortBy.js +14 -4
- package/lib/data/sortBy.js.map +1 -1
- package/lib/data/tree.d.ts +4 -0
- package/lib/data/tree.js +10 -9
- package/lib/data/tree.js.map +1 -1
- package/lib/data/utils/arc/index.d.ts +1 -1
- package/lib/data/utils/fields.d.ts +6 -0
- package/lib/data/utils/fields.js +19 -0
- package/lib/data/utils/fields.js.map +1 -0
- package/lib/data/voronoi.d.ts +1 -0
- package/lib/data/voronoi.js +2 -22
- package/lib/data/voronoi.js.map +1 -1
- package/lib/data/wordCloud.d.ts +1 -0
- package/lib/data/wordCloud.js +2 -93
- package/lib/data/wordCloud.js.map +1 -1
- package/lib/encode/index.d.ts +8 -4
- package/lib/encode/index.js.map +1 -1
- package/lib/interaction/action/index.d.ts +42 -21
- package/lib/interaction/action/index.js.map +1 -1
- package/lib/interaction/index.d.ts +1 -1
- package/lib/interaction/index.js +0 -15
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/interactor/index.d.ts +4 -2
- package/lib/interaction/interactor/index.js.map +1 -1
- package/lib/mark/annotation/index.d.ts +14 -7
- package/lib/mark/annotation/index.js.map +1 -1
- package/lib/mark/geometry/{schema.d.ts → box.d.ts} +4 -4
- package/lib/mark/geometry/{schema.js → box.js} +6 -6
- package/lib/mark/geometry/box.js.map +1 -0
- package/lib/mark/geometry/image.js +5 -4
- package/lib/mark/geometry/image.js.map +1 -1
- package/lib/mark/geometry/index.d.ts +22 -13
- package/lib/mark/geometry/index.js +3 -7
- package/lib/mark/geometry/index.js.map +1 -1
- package/lib/mark/geometry/interval.js +0 -1
- package/lib/mark/geometry/interval.js.map +1 -1
- package/lib/mark/geometry/line.js +5 -1
- package/lib/mark/geometry/line.js.map +1 -1
- package/lib/mark/geometry/link.js +1 -1
- package/lib/mark/geometry/link.js.map +1 -1
- package/lib/mark/geometry/point.js +6 -2
- package/lib/mark/geometry/point.js.map +1 -1
- package/lib/mark/geometry/polygon.js +1 -1
- package/lib/mark/geometry/polygon.js.map +1 -1
- package/lib/palette/index.d.ts +4 -2
- package/lib/palette/index.js.map +1 -1
- package/lib/runtime/component.d.ts +1 -1
- package/lib/runtime/component.js +8 -3
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/mark.js +4 -3
- package/lib/runtime/mark.js.map +1 -1
- package/lib/runtime/plot.js +47 -28
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.js +15 -6
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/scale.js +1 -1
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/types/component.d.ts +4 -6
- package/lib/runtime/types/options.d.ts +1 -0
- package/lib/scale/index.d.ts +22 -11
- package/lib/scale/index.js.map +1 -1
- package/lib/shape/annotation/text.js +16 -4
- package/lib/shape/annotation/text.js.map +1 -1
- package/lib/shape/{schema → box}/box.d.ts +0 -0
- package/lib/shape/{schema → box}/box.js +2 -2
- package/lib/shape/box/box.js.map +1 -0
- package/lib/shape/index.d.ts +86 -48
- package/lib/shape/index.js +10 -16
- package/lib/shape/index.js.map +1 -1
- package/lib/shape/label/label.js +61 -37
- package/lib/shape/label/label.js.map +1 -1
- package/lib/shape/{edge → link}/arc.d.ts +0 -0
- package/lib/shape/{edge → link}/arc.js +0 -0
- package/lib/shape/{edge → link}/arc.js.map +1 -1
- package/lib/shape/{edge → link}/smoothEdge.d.ts +0 -0
- package/lib/shape/{edge → link}/smoothEdge.js +0 -0
- package/lib/shape/{edge → link}/smoothEdge.js.map +1 -1
- package/lib/shape/{edge → link}/vhv.d.ts +0 -0
- package/lib/shape/{edge → link}/vhv.js +0 -0
- package/lib/shape/{edge → link}/vhv.js.map +1 -1
- package/lib/shape/{edge → polygon}/ribbon.d.ts +0 -0
- package/lib/shape/{edge → polygon}/ribbon.js +0 -0
- package/lib/shape/polygon/ribbon.js.map +1 -0
- package/lib/spec/data.d.ts +145 -8
- package/lib/spec/geometry.d.ts +5 -3
- package/lib/spec/transform.d.ts +18 -8
- package/lib/spec/transform.js +0 -133
- package/lib/spec/transform.js.map +1 -1
- package/lib/stdlib/index.js +9 -13
- package/lib/stdlib/index.js.map +1 -1
- package/lib/transform/dodgeX.js +7 -3
- package/lib/transform/dodgeX.js.map +1 -1
- package/lib/transform/flexX.d.ts +7 -0
- package/lib/transform/flexX.js +35 -0
- package/lib/transform/flexX.js.map +1 -0
- package/lib/transform/groupX.js +16 -18
- package/lib/transform/groupX.js.map +1 -1
- package/lib/transform/index.d.ts +46 -21
- package/lib/transform/index.js +5 -1
- package/lib/transform/index.js.map +1 -1
- package/lib/transform/normalizeY.js +0 -1
- package/lib/transform/normalizeY.js.map +1 -1
- package/lib/transform/sortX.d.ts +8 -0
- package/lib/transform/sortX.js +64 -0
- package/lib/transform/sortX.js.map +1 -0
- package/lib/transform/stackY.d.ts +1 -1
- package/lib/transform/stackY.js +26 -9
- package/lib/transform/stackY.js.map +1 -1
- package/lib/utils/coordinate.d.ts +1 -0
- package/lib/utils/coordinate.js +5 -1
- package/lib/utils/coordinate.js.map +1 -1
- package/package.json +19 -4
- package/src/.DS_Store +0 -0
- package/src/adjust/index.ts +2 -1
- package/src/animation/index.ts +15 -7
- package/src/animation/morphing.ts +1 -1
- package/src/animation/scaleInX.ts +3 -0
- package/src/animation/scaleInY.ts +3 -0
- package/src/api/chart.ts +40 -3
- package/src/api/mark/index.ts +3 -3
- package/src/api/mark/mark.ts +6 -5
- package/src/api/mark/types.ts +1 -0
- package/src/api/node.ts +5 -6
- package/src/api/props.ts +14 -10
- package/src/component/axis.ts +13 -5
- package/src/component/index.ts +11 -5
- package/src/composition/index.ts +17 -8
- package/src/composition/rect.ts +1 -1
- package/src/coordinate/index.ts +25 -12
- package/src/data/arc.ts +13 -18
- package/src/data/cluster.ts +53 -56
- package/src/data/custom.ts +15 -0
- package/src/data/fetch.ts +12 -7
- package/src/data/filterBy.ts +11 -2
- package/src/data/index.ts +29 -9
- package/src/data/map.ts +15 -0
- package/src/data/sankey.ts +92 -95
- package/src/data/sortBy.ts +18 -8
- package/src/data/tree.ts +9 -9
- package/src/data/utils/arc/index.ts +1 -1
- package/src/data/utils/fields.ts +17 -0
- package/src/data/voronoi.ts +2 -0
- package/src/data/wordCloud.ts +2 -0
- package/src/encode/index.ts +9 -4
- package/src/interaction/action/index.ts +43 -45
- package/src/interaction/index.ts +17 -1
- package/src/interaction/interactor/index.ts +5 -2
- package/src/interaction/types.ts +1 -1
- package/src/mark/annotation/index.ts +15 -25
- package/src/mark/geometry/{schema.ts → box.ts} +5 -5
- package/src/mark/geometry/image.ts +4 -3
- package/src/mark/geometry/index.ts +23 -13
- package/src/mark/geometry/interval.ts +0 -1
- package/src/mark/geometry/line.ts +6 -1
- package/src/mark/geometry/link.ts +1 -1
- package/src/mark/geometry/point.ts +5 -2
- package/src/mark/geometry/polygon.ts +1 -1
- package/src/palette/index.ts +5 -2
- package/src/runtime/component.ts +10 -3
- package/src/runtime/mark.ts +4 -3
- package/src/runtime/plot.ts +66 -41
- package/src/runtime/render.ts +16 -10
- package/src/runtime/scale.ts +1 -1
- package/src/runtime/types/component.ts +1 -10
- package/src/runtime/types/options.ts +1 -0
- package/src/scale/index.ts +23 -11
- package/src/shape/annotation/text.ts +16 -4
- package/src/shape/{schema → box}/box.ts +2 -2
- package/src/shape/index.ts +92 -60
- package/src/shape/label/label.ts +81 -47
- package/src/shape/{edge → link}/arc.ts +0 -0
- package/src/shape/{edge → link}/smoothEdge.ts +0 -0
- package/src/shape/{edge → link}/vhv.ts +0 -0
- package/src/shape/{edge → polygon}/ribbon.ts +0 -0
- package/src/spec/data.ts +157 -8
- package/src/spec/geometry.ts +5 -3
- package/src/spec/transform.ts +37 -154
- package/src/stdlib/index.ts +18 -20
- package/src/transform/dodgeX.ts +5 -4
- package/src/transform/flexX.ts +38 -0
- package/src/transform/groupX.ts +25 -8
- package/src/transform/index.ts +47 -24
- package/src/transform/normalizeY.ts +0 -1
- package/src/transform/sortX.ts +48 -0
- package/src/transform/stackY.ts +34 -9
- package/src/utils/coordinate.ts +4 -0
- package/esm/data/connector.d.ts +0 -7
- package/esm/data/connector.js +0 -9
- package/esm/data/connector.js.map +0 -1
- package/esm/mark/geometry/edge.d.ts +0 -13
- package/esm/mark/geometry/edge.js +0 -31
- package/esm/mark/geometry/edge.js.map +0 -1
- package/esm/mark/geometry/node.d.ts +0 -8
- package/esm/mark/geometry/node.js +0 -27
- package/esm/mark/geometry/node.js.map +0 -1
- package/esm/mark/geometry/schema.js.map +0 -1
- package/esm/renderer/canvas.d.ts +0 -10
- package/esm/renderer/canvas.js +0 -18
- package/esm/renderer/canvas.js.map +0 -1
- package/esm/renderer/index.d.ts +0 -1
- package/esm/renderer/index.js +0 -2
- package/esm/renderer/index.js.map +0 -1
- package/esm/shape/edge/edge.d.ts +0 -6
- package/esm/shape/edge/edge.js +0 -11
- package/esm/shape/edge/edge.js.map +0 -1
- package/esm/shape/edge/ribbon.js.map +0 -1
- package/esm/shape/node/point.d.ts +0 -6
- package/esm/shape/node/point.js +0 -27
- package/esm/shape/node/point.js.map +0 -1
- package/esm/shape/node/polygon.d.ts +0 -3
- package/esm/shape/node/polygon.js +0 -8
- package/esm/shape/node/polygon.js.map +0 -1
- package/esm/shape/schema/box.js.map +0 -1
- package/lib/data/connector.d.ts +0 -7
- package/lib/data/connector.js +0 -13
- package/lib/data/connector.js.map +0 -1
- package/lib/mark/geometry/edge.d.ts +0 -13
- package/lib/mark/geometry/edge.js +0 -35
- package/lib/mark/geometry/edge.js.map +0 -1
- package/lib/mark/geometry/node.d.ts +0 -8
- package/lib/mark/geometry/node.js +0 -31
- package/lib/mark/geometry/node.js.map +0 -1
- package/lib/mark/geometry/schema.js.map +0 -1
- package/lib/renderer/canvas.d.ts +0 -10
- package/lib/renderer/canvas.js +0 -22
- package/lib/renderer/canvas.js.map +0 -1
- package/lib/renderer/index.d.ts +0 -1
- package/lib/renderer/index.js +0 -6
- package/lib/renderer/index.js.map +0 -1
- package/lib/shape/edge/edge.d.ts +0 -6
- package/lib/shape/edge/edge.js +0 -15
- package/lib/shape/edge/edge.js.map +0 -1
- package/lib/shape/edge/ribbon.js.map +0 -1
- package/lib/shape/node/point.d.ts +0 -6
- package/lib/shape/node/point.js +0 -31
- package/lib/shape/node/point.js.map +0 -1
- package/lib/shape/node/polygon.d.ts +0 -3
- package/lib/shape/node/polygon.js +0 -12
- package/lib/shape/node/polygon.js.map +0 -1
- package/lib/shape/schema/box.js.map +0 -1
- package/src/data/connector.ts +0 -14
- package/src/mark/geometry/edge.ts +0 -40
- package/src/mark/geometry/node.ts +0 -36
- package/src/renderer/canvas.ts +0 -27
- package/src/renderer/index.ts +0 -1
- package/src/shape/edge/edge.ts +0 -15
- package/src/shape/node/point.ts +0 -32
- package/src/shape/node/polygon.ts +0 -12
package/lib/spec/data.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { DataComponent } from '../runtime';
|
|
1
|
+
import { DataComponent, Vector2 } from '../runtime';
|
|
2
2
|
export declare type Data = FetchConnector | InlineConnector | any;
|
|
3
3
|
export declare type FetchConnector = {
|
|
4
4
|
type?: 'fetch';
|
|
5
5
|
value?: string;
|
|
6
6
|
format?: 'json' | 'csv';
|
|
7
|
-
callback?: (d: any) => any;
|
|
8
7
|
delimiter?: string;
|
|
8
|
+
/** Automatically infer the data to Javascript type */
|
|
9
|
+
autoType?: boolean;
|
|
9
10
|
transform?: DataTransform[];
|
|
10
11
|
};
|
|
11
12
|
export declare type InlineConnector = {
|
|
@@ -17,8 +18,8 @@ export declare type DataTransform = SortByTransform | PickTransform | RenameTran
|
|
|
17
18
|
export declare type DataTransformTypes = 'sortBy' | 'fetch' | 'filterBy' | 'pick' | 'fold' | 'connector' | DataComponent;
|
|
18
19
|
export declare type SortByTransform = {
|
|
19
20
|
type?: 'sortBy';
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
/** type: [field, order]; order: true => ascend, false => descend */
|
|
22
|
+
fields?: (string | [string, boolean?])[];
|
|
22
23
|
};
|
|
23
24
|
export declare type PickTransform = {
|
|
24
25
|
type?: 'pick';
|
|
@@ -36,19 +37,155 @@ export declare type SubsetTransform = {
|
|
|
36
37
|
};
|
|
37
38
|
export declare type FilterByTransform = {
|
|
38
39
|
type?: 'filterBy';
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* way1: [[field1, callback1], [field2, callback2], ...]
|
|
42
|
+
* way2: [field1, field2, field3, callback] All field filtered by the last callback.
|
|
43
|
+
*/
|
|
44
|
+
fields?: ([string, ((d: any) => boolean)?] | string)[];
|
|
41
45
|
};
|
|
42
46
|
export declare type FoldTransform = {
|
|
43
47
|
type?: 'fold';
|
|
44
48
|
fields?: string[];
|
|
45
49
|
as?: string[];
|
|
46
50
|
};
|
|
47
|
-
export declare type
|
|
48
|
-
type?: '
|
|
51
|
+
export declare type CustomDataTransform = {
|
|
52
|
+
type?: 'custom';
|
|
49
53
|
callback?: (d: any) => any;
|
|
50
54
|
};
|
|
51
55
|
export declare type CustomTransform = {
|
|
52
56
|
type?: DataComponent;
|
|
53
57
|
[key: string]: any;
|
|
54
58
|
};
|
|
59
|
+
export declare type SankeyTransform = {
|
|
60
|
+
type?: 'sankey';
|
|
61
|
+
nodeId?: (node: any) => string;
|
|
62
|
+
nodes?: (graph: any) => any;
|
|
63
|
+
links?: (graph: any) => any;
|
|
64
|
+
/**
|
|
65
|
+
* sankey.nodeSort(undefined) is the default and resorts by ascending breadth during each iteration.
|
|
66
|
+
* sankey.nodeSort(null) specifies the input order of nodes and never sorts.
|
|
67
|
+
* sankey.nodeSort(function) specifies the given order as a comparator function and sorts once on initialization.
|
|
68
|
+
*/
|
|
69
|
+
nodeSort?: null | undefined | ((a: any, b: any) => number);
|
|
70
|
+
/**
|
|
71
|
+
* sankey.linkSort(undefined) is the default, indicating that vertical order of links within each node will be determined automatically by the layout. If
|
|
72
|
+
* sankey.linkSort(null) will resort by the input.
|
|
73
|
+
* sankey.linkSort(function) specifies the given order as a comparator function and sorts once on initialization.
|
|
74
|
+
*/
|
|
75
|
+
linkSort?: null | undefined | ((a: any, b: any) => number);
|
|
76
|
+
nodeAlign?: 'left' | 'center' | 'right' | 'justify' | ((node: any, n: number) => number);
|
|
77
|
+
nodeWidth?: number;
|
|
78
|
+
nodePadding?: number;
|
|
79
|
+
iterations?: number;
|
|
80
|
+
nodeDepth?: (datum: any, maxDepth: number) => number;
|
|
81
|
+
};
|
|
82
|
+
export declare type WordCloudTransform = {
|
|
83
|
+
type?: 'wordCloud';
|
|
84
|
+
/**
|
|
85
|
+
* @description If specified, sets the rectangular [width, height] of the layout
|
|
86
|
+
* @default [1, 1]
|
|
87
|
+
*/
|
|
88
|
+
size?: [number, number];
|
|
89
|
+
font?: string | ((word: any) => string);
|
|
90
|
+
fontStyle?: string | ((word: any) => string);
|
|
91
|
+
fontWeight?: any | ((word: any) => any);
|
|
92
|
+
fontSize?: number | [number, number] | ((word: any) => number);
|
|
93
|
+
padding?: number | ((word: any) => number);
|
|
94
|
+
/**
|
|
95
|
+
* @description sets the text accessor function, which indicates the text for each word
|
|
96
|
+
* @default (d) => d.text
|
|
97
|
+
*/
|
|
98
|
+
text?: (word: any) => number;
|
|
99
|
+
rotate?: number | ((word: any) => number);
|
|
100
|
+
timeInterval?: number;
|
|
101
|
+
random?: number | (() => number);
|
|
102
|
+
/**
|
|
103
|
+
* @description sets the current type of spiral used for positioning words. This can either be one of the two built-in spirals, "archimedean" and "rectangular"
|
|
104
|
+
* @default "archimedean"
|
|
105
|
+
*/
|
|
106
|
+
spiral?: 'archimedean' | 'rectangular' | ((size: [number, number]) => (t: number) => number[]);
|
|
107
|
+
imageMask?: HTMLImageElement | string;
|
|
108
|
+
on?: ((type: 'end', details?: {
|
|
109
|
+
cloud: any;
|
|
110
|
+
words: any;
|
|
111
|
+
bounds: any;
|
|
112
|
+
}) => void) | ((type: 'word', details?: {
|
|
113
|
+
cloud: any;
|
|
114
|
+
word: any;
|
|
115
|
+
}) => void);
|
|
116
|
+
};
|
|
117
|
+
export declare type VoronoiTransform = {
|
|
118
|
+
type?: 'voronoi';
|
|
119
|
+
/**
|
|
120
|
+
* @description Sets the input fields from the data.
|
|
121
|
+
*/
|
|
122
|
+
fields: [string, string];
|
|
123
|
+
/**
|
|
124
|
+
* @description Sets the output fields into data.
|
|
125
|
+
*/
|
|
126
|
+
as: [string, string];
|
|
127
|
+
/**
|
|
128
|
+
* @description Sets region of canvas.
|
|
129
|
+
*/
|
|
130
|
+
extend: Vector2[];
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* For arc diagram(edge with weight) or chord diagram(with weight)
|
|
134
|
+
*/
|
|
135
|
+
export declare type ArcTransform = {
|
|
136
|
+
type?: 'arc';
|
|
137
|
+
/** Layout y position, default: 0 */
|
|
138
|
+
y?: number;
|
|
139
|
+
/** margin between nodes, [0, 1), default: 0.1 */
|
|
140
|
+
marginRatio?: number;
|
|
141
|
+
/** Thickness of node, default: 0.05 */
|
|
142
|
+
thickness?: number;
|
|
143
|
+
/** Whether calculate weight, default: false */
|
|
144
|
+
weight?: boolean;
|
|
145
|
+
/** Key of node, default: node.id */
|
|
146
|
+
id?: (node: any) => any;
|
|
147
|
+
/** Source key of edge, default: edge.source */
|
|
148
|
+
source?: (edge: any) => any;
|
|
149
|
+
/** Target key of edge, default: edge.target */
|
|
150
|
+
target?: (edge: any) => any;
|
|
151
|
+
/** Weight of source, default: edge.value || 1 */
|
|
152
|
+
sourceWeight?: (edge: any) => number;
|
|
153
|
+
/** Weight of target, default: edge.value || 1 */
|
|
154
|
+
targetWeight?: (edge: any) => number;
|
|
155
|
+
/** Sort method, default: null */
|
|
156
|
+
sortBy?: 'id' | 'weight' | 'frequency' | null | ((a: any, b: any) => number);
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Cluster layout options.
|
|
160
|
+
*/
|
|
161
|
+
export declare type ClusterTransform = {
|
|
162
|
+
type?: 'cluster';
|
|
163
|
+
/**
|
|
164
|
+
* Layout field. Default: 'value'.
|
|
165
|
+
*/
|
|
166
|
+
field?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Sets this cluster layout’s node size to the specified two-element array of numbers [width, height] and returns this cluster layout.
|
|
169
|
+
* Default: null.
|
|
170
|
+
*/
|
|
171
|
+
nodeSize?: any;
|
|
172
|
+
/**
|
|
173
|
+
* The separation accessor is used to separate neighboring leaves. Default: (a, b) => a.parent == b.parent ? 1 : 2;
|
|
174
|
+
*/
|
|
175
|
+
separation?: (a: any, b: any) => number;
|
|
176
|
+
/**
|
|
177
|
+
* Sort function by compare 2 nodes.
|
|
178
|
+
*/
|
|
179
|
+
sortBy?: (a: any, b: any) => number;
|
|
180
|
+
/**
|
|
181
|
+
* Layout infomation saved into fields. Default: ['x', 'y'].
|
|
182
|
+
*/
|
|
183
|
+
as?: [string, string];
|
|
184
|
+
};
|
|
185
|
+
export declare type TreeTransform = Omit<ClusterTransform, 'type'> & {
|
|
186
|
+
type?: 'tree';
|
|
187
|
+
};
|
|
188
|
+
export declare type MapTransform = {
|
|
189
|
+
type?: 'map';
|
|
190
|
+
callback?: (d: any) => any;
|
|
191
|
+
};
|
package/lib/spec/geometry.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { Animation } from './animate';
|
|
|
7
7
|
import { Interaction } from './interaction';
|
|
8
8
|
import { Theme } from './theme';
|
|
9
9
|
import { Data } from './data';
|
|
10
|
-
export declare type Geometry = IntervalGeometry | LineGeometry | PointGeometry | TextGeometry | GridGeometry | AreaGeometry | NodeGeometry | EdgeGeometry | ImageGeometry | PolygonGeometry |
|
|
11
|
-
export declare type GeometryTypes = 'interval' | 'line' | 'point' | 'text' | 'grid' | 'area' | 'node' | 'edge' | 'link' | 'image' | 'polygon' | '
|
|
10
|
+
export declare type Geometry = IntervalGeometry | LineGeometry | PointGeometry | TextGeometry | GridGeometry | AreaGeometry | NodeGeometry | EdgeGeometry | ImageGeometry | PolygonGeometry | BoxGeometry | VectorGeometry | AnnotationText | CustomComponent;
|
|
11
|
+
export declare type GeometryTypes = 'interval' | 'line' | 'point' | 'text' | 'grid' | 'area' | 'node' | 'edge' | 'link' | 'image' | 'polygon' | 'box' | 'vector' | 'annotation.text' | 'annotation.lineX' | 'annotation.lineY' | 'annotation.connector' | 'annotation.range' | 'annotation.rangeX' | 'annotation.rangeY' | MarkComponent;
|
|
12
12
|
export declare type ChannelTypes = 'x' | 'y' | 'color' | 'shape' | 'enterType' | 'enterEasing' | 'enterDuration' | 'enterDelay' | 'enter' | 'size' | 'tooltip' | 'title' | 'key' | 'groupKey' | 'label';
|
|
13
13
|
export declare type BaseGeometry<T extends GeometryTypes, C extends string = ChannelTypes> = {
|
|
14
14
|
type?: T | string;
|
|
@@ -29,6 +29,8 @@ export declare type BaseGeometry<T extends GeometryTypes, C extends string = Cha
|
|
|
29
29
|
adjust?: Adjust;
|
|
30
30
|
facet?: boolean;
|
|
31
31
|
frame?: boolean;
|
|
32
|
+
labels?: Record<string, any>[];
|
|
33
|
+
stack?: boolean;
|
|
32
34
|
animate?: {
|
|
33
35
|
enter?: Animation;
|
|
34
36
|
exit?: Animation;
|
|
@@ -56,6 +58,6 @@ export declare type EdgeGeometry = BaseGeometry<'edge', ChannelTypes>;
|
|
|
56
58
|
export declare type LinkGeometry = BaseGeometry<'link', ChannelTypes>;
|
|
57
59
|
export declare type ImageGeometry = BaseGeometry<'image', ChannelTypes | 'src'>;
|
|
58
60
|
export declare type PolygonGeometry = BaseGeometry<'polygon'>;
|
|
59
|
-
export declare type
|
|
61
|
+
export declare type BoxGeometry = BaseGeometry<'box'>;
|
|
60
62
|
export declare type VectorGeometry = BaseGeometry<'vector', ChannelTypes | 'rotate' | 'size'>;
|
|
61
63
|
export declare type CustomComponent = BaseGeometry<MarkComponent>;
|
package/lib/spec/transform.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { TransformComponent, Primitive } from '../runtime';
|
|
2
2
|
import { ChannelTypes } from './geometry';
|
|
3
|
-
export declare type Transform = StackYTransform | DodgeXTransform | NormalizeYTransform | StackEnterTransform | JitterTransform | JitterYTransform | SymmetryYTransform | SelectTransform | SelectXTransform | SelectYTransform | GroupXTransform;
|
|
4
|
-
export declare type
|
|
5
|
-
export declare type
|
|
3
|
+
export declare type Transform = StackYTransform | DodgeXTransform | NormalizeYTransform | StackEnterTransform | JitterTransform | JitterYTransform | SymmetryYTransform | SelectTransform | SelectXTransform | SelectYTransform | GroupXTransform | SortXTransform | FlexXTransform;
|
|
4
|
+
export declare type TransformTypes = 'dodgeX' | 'stackY' | 'normalizeY' | 'stackEnter' | 'jitter' | 'jitterY' | 'symmetryY' | 'select' | 'selectY' | 'selectX' | 'groupX' | 'sortX' | 'flexX' | TransformComponent;
|
|
5
|
+
export declare type TransformOrder = 'value' | 'sum' | 'series' | 'maxIndex' | string[] | null | ((data: Record<string, Primitive>) => Primitive);
|
|
6
6
|
export declare type DodgeXTransform = {
|
|
7
7
|
type?: 'dodgeX';
|
|
8
8
|
groupBy?: string | string[];
|
|
9
9
|
reverse?: boolean;
|
|
10
10
|
orderBy?: TransformOrder;
|
|
11
|
-
paddingInner?: number;
|
|
12
|
-
paddingOuter?: number;
|
|
13
11
|
padding?: number;
|
|
14
12
|
};
|
|
15
13
|
export declare type StackYTransform = {
|
|
@@ -18,12 +16,13 @@ export declare type StackYTransform = {
|
|
|
18
16
|
reverse?: boolean;
|
|
19
17
|
orderBy?: TransformOrder;
|
|
20
18
|
y?: 'y' | 'y1';
|
|
19
|
+
series?: boolean;
|
|
21
20
|
};
|
|
22
21
|
export declare type NormalizeYTransform = {
|
|
23
22
|
type?: 'normalizeY';
|
|
24
23
|
series?: boolean;
|
|
25
24
|
groupBy?: string | string[];
|
|
26
|
-
basis?: 'deviation' | 'first' | 'last' | 'max' | 'mean' | 'median' | 'min' | 'sum'
|
|
25
|
+
basis?: 'deviation' | 'first' | 'last' | 'max' | 'mean' | 'median' | 'min' | 'sum';
|
|
27
26
|
};
|
|
28
27
|
export declare type JitterTransform = {
|
|
29
28
|
type?: 'jitter';
|
|
@@ -59,11 +58,22 @@ export declare type SelectYTransform = {
|
|
|
59
58
|
groupBy?: string | string[];
|
|
60
59
|
selector?: Selector;
|
|
61
60
|
};
|
|
61
|
+
export declare type SortXTransform = {
|
|
62
|
+
type?: 'sortX';
|
|
63
|
+
reverse?: boolean;
|
|
64
|
+
channel?: string;
|
|
65
|
+
slice?: number | [number, number];
|
|
66
|
+
reducer?: 'max' | 'min' | 'sum' | 'first' | 'last' | ((I: number[], V: Primitive[]) => Primitive);
|
|
67
|
+
};
|
|
68
|
+
export declare type FlexXTransform = {
|
|
69
|
+
type?: 'flexX';
|
|
70
|
+
field?: string | ((d: any) => Primitive[]);
|
|
71
|
+
channel?: string;
|
|
72
|
+
reducer?: 'sum' | ((I: number[], V: Primitive[]) => Primitive);
|
|
73
|
+
};
|
|
62
74
|
export declare type Reducer = 'mean' | 'max' | 'count' | 'min' | 'median' | 'sum' | 'first' | 'last' | ((I: number[], V: Primitive[]) => Primitive);
|
|
63
75
|
export declare type GroupXTransform = {
|
|
64
76
|
type?: 'groupX';
|
|
65
|
-
orderBy?: ChannelTypes;
|
|
66
|
-
reverse?: boolean;
|
|
67
77
|
} & {
|
|
68
78
|
[key in ChannelTypes]?: Reducer;
|
|
69
79
|
};
|
package/lib/spec/transform.js
CHANGED
|
@@ -1,136 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// export type SankeyTransform = {
|
|
4
|
-
// type?: 'sankey';
|
|
5
|
-
// nodeId?: (node: any) => string;
|
|
6
|
-
// nodes?: (graph: any) => any;
|
|
7
|
-
// links?: (graph: any) => any;
|
|
8
|
-
// /**
|
|
9
|
-
// * sankey.nodeSort(undefined) is the default and resorts by ascending breadth during each iteration.
|
|
10
|
-
// * sankey.nodeSort(null) specifies the input order of nodes and never sorts.
|
|
11
|
-
// * sankey.nodeSort(function) specifies the given order as a comparator function and sorts once on initialization.
|
|
12
|
-
// */
|
|
13
|
-
// nodeSort?: null | undefined | ((a: any, b: any) => number);
|
|
14
|
-
// /**
|
|
15
|
-
// * sankey.linkSort(undefined) is the default, indicating that vertical order of links within each node will be determined automatically by the layout. If
|
|
16
|
-
// * sankey.linkSort(null) will resort by the input.
|
|
17
|
-
// * sankey.linkSort(function) specifies the given order as a comparator function and sorts once on initialization.
|
|
18
|
-
// */
|
|
19
|
-
// linkSort?: null | undefined | ((a: any, b: any) => number);
|
|
20
|
-
// nodeAlign?:
|
|
21
|
-
// | 'left'
|
|
22
|
-
// | 'center'
|
|
23
|
-
// | 'right'
|
|
24
|
-
// | 'justify'
|
|
25
|
-
// | ((node: any, n: number) => number);
|
|
26
|
-
// nodeWidth?: number;
|
|
27
|
-
// nodePadding?: number;
|
|
28
|
-
// iterations?: number;
|
|
29
|
-
// // support config the depth of node
|
|
30
|
-
// nodeDepth?: (datum: any, maxDepth: number) => number;
|
|
31
|
-
// };
|
|
32
|
-
// export type WordCloudTransform = {
|
|
33
|
-
// type?: 'wordCloud';
|
|
34
|
-
// /**
|
|
35
|
-
// * @description If specified, sets the rectangular [width, height] of the layout
|
|
36
|
-
// * @default [1, 1]
|
|
37
|
-
// */
|
|
38
|
-
// size?: [number, number];
|
|
39
|
-
// font?: string | ((word: any) => string);
|
|
40
|
-
// fontStyle?: string | ((word: any) => string);
|
|
41
|
-
// fontWeight?: any | ((word: any) => any);
|
|
42
|
-
// fontSize?: number | [number, number] | ((word: any) => number);
|
|
43
|
-
// padding?: number | ((word: any) => number);
|
|
44
|
-
// /**
|
|
45
|
-
// * @description sets the text accessor function, which indicates the text for each word
|
|
46
|
-
// * @default (d) => d.text
|
|
47
|
-
// */
|
|
48
|
-
// text?: (word: any) => number;
|
|
49
|
-
// rotate?: number | ((word: any) => number);
|
|
50
|
-
// timeInterval?: number;
|
|
51
|
-
// random?: number | (() => number);
|
|
52
|
-
// /**
|
|
53
|
-
// * @description sets the current type of spiral used for positioning words. This can either be one of the two built-in spirals, "archimedean" and "rectangular"
|
|
54
|
-
// * @default "archimedean"
|
|
55
|
-
// */
|
|
56
|
-
// spiral?:
|
|
57
|
-
// | 'archimedean'
|
|
58
|
-
// | 'rectangular'
|
|
59
|
-
// | ((size: [number, number]) => (t: number) => number[]);
|
|
60
|
-
// imageMask?: HTMLImageElement | string;
|
|
61
|
-
// on?:
|
|
62
|
-
// | ((type: 'end', details?: { cloud; words; bounds }) => void)
|
|
63
|
-
// | ((type: 'word', details?: { cloud; word }) => void);
|
|
64
|
-
// };
|
|
65
|
-
// export type VoronoiTransform = {
|
|
66
|
-
// type?: 'voronoi';
|
|
67
|
-
// /**
|
|
68
|
-
// * @description Sets the input fields from the data.
|
|
69
|
-
// */
|
|
70
|
-
// fields: [string, string];
|
|
71
|
-
// /**
|
|
72
|
-
// * @description Sets the output fields into data.
|
|
73
|
-
// */
|
|
74
|
-
// as: [string, string];
|
|
75
|
-
// /**
|
|
76
|
-
// * @description Sets region of canvas.
|
|
77
|
-
// */
|
|
78
|
-
// extend: Vector2[];
|
|
79
|
-
// };
|
|
80
|
-
// /**
|
|
81
|
-
// * For arc diagram(edge with weight) or chord diagram(with weight)
|
|
82
|
-
// */
|
|
83
|
-
// export type ArcTransform = {
|
|
84
|
-
// type?: 'arc';
|
|
85
|
-
// /** Layout y position, default: 0 */
|
|
86
|
-
// y?: number;
|
|
87
|
-
// /** margin between nodes, [0, 1), default: 0.1 */
|
|
88
|
-
// marginRatio?: number;
|
|
89
|
-
// /** Thickness of node, default: 0.05 */
|
|
90
|
-
// thickness?: number;
|
|
91
|
-
// /** Whether calculate weight, default: false */
|
|
92
|
-
// weight?: boolean;
|
|
93
|
-
// /** Key of node, default: node.id */
|
|
94
|
-
// id?: (node: any) => any;
|
|
95
|
-
// /** Source key of edge, default: edge.source */
|
|
96
|
-
// source?: (edge: any) => any;
|
|
97
|
-
// /** Target key of edge, default: edge.target */
|
|
98
|
-
// target?: (edge: any) => any;
|
|
99
|
-
// /** Weight of source, default: edge.value || 1 */
|
|
100
|
-
// sourceWeight?: (edge: any) => number;
|
|
101
|
-
// /** Weight of target, default: edge.value || 1 */
|
|
102
|
-
// targetWeight?: (edge: any) => number;
|
|
103
|
-
// /** Sort method, default: null */
|
|
104
|
-
// sortBy?: 'id' | 'weight' | 'frequency' | null | ((a: any, b: any) => number);
|
|
105
|
-
// };
|
|
106
|
-
// /**
|
|
107
|
-
// * Cluster layout options.
|
|
108
|
-
// */
|
|
109
|
-
// export type ClusterTransform = {
|
|
110
|
-
// type?: 'cluster';
|
|
111
|
-
// /**
|
|
112
|
-
// * Layout field. Default: 'value'.
|
|
113
|
-
// */
|
|
114
|
-
// field?: string;
|
|
115
|
-
// /**
|
|
116
|
-
// * Sets this cluster layout’s node size to the specified two-element array of numbers [width, height] and returns this cluster layout.
|
|
117
|
-
// * Default: null.
|
|
118
|
-
// */
|
|
119
|
-
// nodeSize?: any;
|
|
120
|
-
// /**
|
|
121
|
-
// * The separation accessor is used to separate neighboring leaves. Default: (a, b) => a.parent == b.parent ? 1 : 2;
|
|
122
|
-
// */
|
|
123
|
-
// separation?: (a, b) => number;
|
|
124
|
-
// /**
|
|
125
|
-
// * Sort function by compare 2 nodes.
|
|
126
|
-
// */
|
|
127
|
-
// sortBy?: (a, b) => number;
|
|
128
|
-
// /**
|
|
129
|
-
// * Layout infomation saved into fields. Default: ['x', 'y'].
|
|
130
|
-
// */
|
|
131
|
-
// as?: [string, string];
|
|
132
|
-
// };
|
|
133
|
-
// export type TreeTransform = Omit<ClusterTransform, 'type'> & {
|
|
134
|
-
// type?: 'tree';
|
|
135
|
-
// };
|
|
136
3
|
//# sourceMappingURL=transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"src/","sources":["spec/transform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"src/","sources":["spec/transform.ts"],"names":[],"mappings":""}
|
package/lib/stdlib/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createLibrary = void 0;
|
|
4
|
-
const renderer_1 = require("../renderer");
|
|
5
4
|
const coordinate_1 = require("../coordinate");
|
|
6
5
|
const encode_1 = require("../encode");
|
|
7
6
|
const geometry_1 = require("../mark/geometry");
|
|
@@ -28,13 +27,14 @@ function createLibrary() {
|
|
|
28
27
|
'data.rename': data_1.Rename,
|
|
29
28
|
'data.subset': data_1.Subset,
|
|
30
29
|
'data.fold': data_1.Fold,
|
|
31
|
-
'data.
|
|
30
|
+
'data.custom': data_1.Custom,
|
|
31
|
+
'data.map': data_1.Map,
|
|
32
|
+
'data.cluster': data_1.Cluster,
|
|
33
|
+
'data.tree': data_1.Tree,
|
|
34
|
+
'data.sankey': data_1.Sankey,
|
|
35
|
+
'data.arc': data_1.Arc,
|
|
32
36
|
// 'transform.wordCloud': WordCloud,
|
|
33
37
|
// 'transform.voronoi': Voronoi,
|
|
34
|
-
// 'transform.sankey': Sankey,
|
|
35
|
-
// 'transform.arc': ArcTransform,
|
|
36
|
-
// 'transform.cluster': ClusterTransform,
|
|
37
|
-
// 'transform.tree': TreeTransform,
|
|
38
38
|
// 'transform.connector': Connector,
|
|
39
39
|
'transform.maybeZeroY1': transform_1.MaybeZeroY1,
|
|
40
40
|
'transform.maybeZeroX': transform_1.MaybeZeroX,
|
|
@@ -57,7 +57,8 @@ function createLibrary() {
|
|
|
57
57
|
'transform.maybeSize': transform_1.MaybeSize,
|
|
58
58
|
'transform.maybeZeroY': transform_1.MaybeZeroY,
|
|
59
59
|
'transform.maybeKey': transform_1.MaybeKey,
|
|
60
|
-
'
|
|
60
|
+
'transform.sortX': transform_1.SortX,
|
|
61
|
+
'transform.flexX': transform_1.FlexX,
|
|
61
62
|
'coordinate.cartesian': coordinate_1.Cartesian,
|
|
62
63
|
'coordinate.polar': coordinate_1.Polar,
|
|
63
64
|
'coordinate.helix': coordinate_1.Helix,
|
|
@@ -81,11 +82,9 @@ function createLibrary() {
|
|
|
81
82
|
'mark.grid': geometry_1.Grid,
|
|
82
83
|
'mark.area': geometry_1.Area,
|
|
83
84
|
'mark.link': geometry_1.Link,
|
|
84
|
-
'mark.node': geometry_1.Node,
|
|
85
|
-
'mark.edge': geometry_1.Edge,
|
|
86
85
|
'mark.image': geometry_1.Image,
|
|
87
86
|
'mark.polygon': geometry_1.Polygon,
|
|
88
|
-
'mark.
|
|
87
|
+
'mark.box': geometry_1.Box,
|
|
89
88
|
'mark.vector': geometry_1.Vector,
|
|
90
89
|
'mark.annotation.text': annotation_1.AnnotationText,
|
|
91
90
|
'mark.annotation.lineX': annotation_1.AnnotationLineX,
|
|
@@ -138,13 +137,10 @@ function createLibrary() {
|
|
|
138
137
|
'shape.text': shape_1.Text,
|
|
139
138
|
'shape.area': shape_1.Area,
|
|
140
139
|
'shape.smoothArea': shape_1.SmoothArea,
|
|
141
|
-
'shape.edge': shape_1.Edge,
|
|
142
140
|
'shape.smoothEdge': shape_1.SmoothEdge,
|
|
143
141
|
'shape.vhvEdge': shape_1.VHVEdge,
|
|
144
142
|
'shape.arc': shape_1.Arc,
|
|
145
143
|
'shape.link': shape_1.Link,
|
|
146
|
-
'shape.pointNode': shape_1.PointNode,
|
|
147
|
-
'shape.polygonNode': shape_1.PolygonNode,
|
|
148
144
|
'shape.image': shape_1.Image,
|
|
149
145
|
'shape.polygon': shape_1.Polygon,
|
|
150
146
|
'shape.ribbon': shape_1.Ribbon,
|
package/lib/stdlib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["stdlib/index.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["stdlib/index.ts"],"names":[],"mappings":";;;AACA,8CAauB;AACvB,sCAA+D;AAC/D,+CAY0B;AAC1B,mDAQ4B;AAC5B,wCAAoD;AACpD,oCAYkB;AAClB,oCA8CkB;AAClB,oCAAiC;AACjC,4CAMsB;AACtB,4CAQsB;AACtB,gDAgBwB;AACxB,gDASwB;AACxB,sCAAiC;AACjC,4CAwBsB;AACtB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EAAE,0BAAc;QACjC,oBAAoB,EAAE,oBAAQ;QAC9B,qBAAqB,EAAE,qBAAS;QAChC,oBAAoB,EAAE,oBAAQ;QAC9B,qBAAqB,EAAE,qBAAS;QAChC,kBAAkB,EAAE,kBAAM;QAC1B,mBAAmB,EAAE,mBAAO;QAC5B,oBAAoB,EAAE,oBAAQ;QAC9B,2BAA2B,EAAE,2BAAa;QAC1C,6BAA6B,EAAE,6BAAe;QAC9C,8BAA8B,EAAE,8BAAgB;QAChD,iCAAiC,EAAE,iCAAmB;QACtD,qCAAqC,EAAE,qCAAuB;QAC9D,kCAAkC,EAAE,kCAAoB;QACxD,0BAA0B,EAAE,0BAAY;QACxC,6BAA6B,EAAE,6BAAe;QAC9C,qBAAqB,EAAE,qBAAO;QAC9B,qBAAqB,EAAE,qBAAkB;QACzC,mBAAmB,EAAE,mBAAK;QAC1B,4BAA4B,EAAE,4BAAc;QAC5C,0BAA0B,EAAE,0BAAY;QACxC,0BAA0B,EAAE,0BAAY;QACxC,0BAA0B,EAAE,0BAAY;QACxC,mBAAmB,EAAE,mBAAK;QAC1B,kBAAkB,EAAE,kBAAI;QACxB,kBAAkB,EAAE,kBAAI;QACxB,kBAAkB,EAAE,kBAAI;QACxB,kBAAkB,EAAE,kBAAI;QACxB,oBAAoB,EAAE,oBAAM;QAC5B,oBAAoB,EAAE,oBAAM;QAC5B,sBAAsB,EAAE,sBAAQ;QAChC,aAAa,EAAE,aAAI;QACnB,yBAAyB,EAAE,yBAAW;KACvC,CAAC;AACJ,CAAC;AA9KD,sCA8KC"}
|
package/lib/transform/dodgeX.js
CHANGED
|
@@ -21,7 +21,7 @@ const order_1 = require("./utils/order");
|
|
|
21
21
|
* say to form horizontal "columns" by specified channels.
|
|
22
22
|
*/
|
|
23
23
|
const DodgeX = (options = {}) => {
|
|
24
|
-
const { groupBy = 'x', reverse = false, orderBy } = options, rest = __rest(options, ["groupBy", "reverse", "orderBy"]);
|
|
24
|
+
const { groupBy = 'x', reverse = false, orderBy, padding } = options, rest = __rest(options, ["groupBy", "reverse", "orderBy", "padding"]);
|
|
25
25
|
return (I, mark) => {
|
|
26
26
|
const { data, encode, scale } = mark;
|
|
27
27
|
const { series: scaleSeries } = scale;
|
|
@@ -43,11 +43,15 @@ const DodgeX = (options = {}) => {
|
|
|
43
43
|
newS[G[i]] = domainSeries[i];
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
// console.log(newS, S);
|
|
47
46
|
return [
|
|
48
47
|
I,
|
|
49
48
|
(0, util_1.deepMix)({}, mark, {
|
|
50
|
-
scale:
|
|
49
|
+
scale: {
|
|
50
|
+
series: {
|
|
51
|
+
domain: domainSeries,
|
|
52
|
+
paddingInner: padding,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
51
55
|
encode: {
|
|
52
56
|
series: (0, helper_1.column)(newS),
|
|
53
57
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dodgeX.js","sourceRoot":"src/","sources":["transform/dodgeX.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAqC;AAGrC,2CAAiE;AACjE,yCAKuB;AAIvB;;;;GAIG;AACI,MAAM,MAAM,GAAsB,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE;IACxD,MAAM,EAAE,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,KAAc,OAAO,EAAhB,IAAI,UAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"dodgeX.js","sourceRoot":"src/","sources":["transform/dodgeX.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAqC;AAGrC,2CAAiE;AACjE,yCAKuB;AAIvB;;;;GAIG;AACI,MAAM,MAAM,GAAsB,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE;IACxD,MAAM,EAAE,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,OAAO,KAAc,OAAO,EAAhB,IAAI,UAAK,OAAO,EAAvE,4CA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ChB,KAAK,EAAE;oBACL,MAAM,EAAE;wBACN,MAAM,EAAE,YAAY;wBACpB,YAAY,EAAE,OAAO;qBACtB;iBACF;gBACD,MAAM,EAAE;oBACN,MAAM,EAAE,IAAA,eAAM,EAAC,IAAI,CAAC;iBACrB;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,MAAM,UAuCjB;AAEF,cAAM,CAAC,KAAK,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TransformComponent as TC } from '../runtime';
|
|
2
|
+
import { FlexXTransform } from '../spec';
|
|
3
|
+
export declare type FlexXOptions = Omit<FlexXTransform, 'type'>;
|
|
4
|
+
/**
|
|
5
|
+
* Produce flex options from data for x scale.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FlexX: TC<FlexXOptions>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlexX = void 0;
|
|
4
|
+
const util_1 = require("@antv/util");
|
|
5
|
+
const d3_array_1 = require("d3-array");
|
|
6
|
+
const helper_1 = require("./utils/helper");
|
|
7
|
+
function valueOf(data, field) {
|
|
8
|
+
if (typeof field === 'string')
|
|
9
|
+
return data.map((d) => d[field]);
|
|
10
|
+
return data.map(field);
|
|
11
|
+
}
|
|
12
|
+
function createReducer(reducer, V) {
|
|
13
|
+
if (typeof reducer === 'function')
|
|
14
|
+
return (GI) => reducer(GI, V);
|
|
15
|
+
if (reducer === 'sum')
|
|
16
|
+
return (GI) => (0, d3_array_1.sum)(GI, (i) => +V[i]);
|
|
17
|
+
throw new Error(`Unknown reducer: ${reducer}`);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Produce flex options from data for x scale.
|
|
21
|
+
*/
|
|
22
|
+
const FlexX = (options = {}) => {
|
|
23
|
+
const { field, channel = 'y', reducer = 'sum' } = options;
|
|
24
|
+
return (I, mark) => {
|
|
25
|
+
const { data, encode } = mark;
|
|
26
|
+
const [x] = (0, helper_1.columnOf)(encode, 'x');
|
|
27
|
+
const V = field ? valueOf(data, field) : (0, helper_1.columnOf)(encode, channel)[0];
|
|
28
|
+
const reducerFunction = createReducer(reducer, V);
|
|
29
|
+
const flex = (0, d3_array_1.rollups)(I, reducerFunction, (i) => x[i]).map((d) => d[1]);
|
|
30
|
+
return [I, (0, util_1.deepMix)({}, mark, { scale: { x: { flex } } })];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
exports.FlexX = FlexX;
|
|
34
|
+
exports.FlexX.props = {};
|
|
35
|
+
//# sourceMappingURL=flexX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flexX.js","sourceRoot":"src/","sources":["transform/flexX.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AACrC,uCAAmD;AAGnD,2CAA0C;AAI1C,SAAS,OAAO,CAAC,IAAS,EAAE,KAA4B;IACtD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,aAAa,CACpB,OAAgC,EAChC,CAAc;IAEd,IAAI,OAAO,OAAO,KAAK,UAAU;QAAE,OAAO,CAAC,EAAY,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3E,IAAI,OAAO,KAAK,KAAK;QAAE,OAAO,CAAC,EAAY,EAAE,EAAE,CAAC,IAAA,cAAG,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;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