@antv/g6 5.0.0-beta.27 → 5.0.0-beta.28
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/LICENSE +21 -0
- package/dist/g6.min.js +2 -2
- package/esm/constant/shape.d.ts +1 -1
- package/esm/index.d.ts +4 -2
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/item/combo.js +3 -1
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.js +7 -2
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +2 -2
- package/esm/item/item.js +13 -6
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +1 -0
- package/esm/item/node.js +12 -2
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.js +15 -10
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/interaction.js +4 -3
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +3 -2
- package/esm/runtime/controller/item.js +45 -22
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.js +7 -10
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.js +1 -1
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/graph.d.ts +19 -6
- package/esm/runtime/graph.js +62 -27
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/hooks.d.ts +2 -2
- package/esm/runtime/hooks.js +2 -2
- package/esm/stdlib/behavior/create-edge.d.ts +1 -1
- package/esm/stdlib/behavior/drag-canvas.d.ts +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +1 -1
- package/esm/stdlib/behavior/drag-node.js +1 -1
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
- package/esm/stdlib/behavior/scroll-canvas.js +5 -5
- package/esm/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +16 -0
- package/esm/stdlib/behavior/zoom-canvas.js +107 -5
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/transformV4Data.js +12 -6
- package/esm/stdlib/data/transformV4Data.js.map +1 -1
- package/esm/stdlib/index.d.ts +6 -4
- package/esm/stdlib/index.js +8 -6
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/circle.js +12 -7
- package/esm/stdlib/item/combo/circle.js.map +1 -1
- package/esm/stdlib/item/combo/rect.js +12 -7
- package/esm/stdlib/item/combo/rect.js.map +1 -1
- package/esm/stdlib/item/edge/base.d.ts +22 -5
- package/esm/stdlib/item/edge/base.js +48 -16
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/edge/cubic.js +11 -6
- package/esm/stdlib/item/edge/cubic.js.map +1 -1
- package/esm/stdlib/item/edge/line.js +12 -7
- package/esm/stdlib/item/edge/line.js.map +1 -1
- package/esm/stdlib/item/edge/loop.js +6 -1
- package/esm/stdlib/item/edge/loop.js.map +1 -1
- package/esm/stdlib/item/edge/polyline.js +11 -6
- package/esm/stdlib/item/edge/polyline.js.map +1 -1
- package/esm/stdlib/item/edge/quadratic.js +11 -6
- package/esm/stdlib/item/edge/quadratic.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +24 -13
- package/esm/stdlib/item/node/base.js +90 -48
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.d.ts +11 -2
- package/esm/stdlib/item/node/base3d.js +14 -3
- package/esm/stdlib/item/node/base3d.js.map +1 -1
- package/esm/stdlib/item/node/circle.js +13 -7
- package/esm/stdlib/item/node/circle.js.map +1 -1
- package/esm/stdlib/item/node/cube.d.ts +0 -2
- package/esm/stdlib/item/node/cube.js +12 -9
- package/esm/stdlib/item/node/cube.js.map +1 -1
- package/esm/stdlib/item/node/diamond.js +20 -11
- package/esm/stdlib/item/node/diamond.js.map +1 -1
- package/esm/stdlib/item/node/donut.js +18 -8
- package/esm/stdlib/item/node/donut.js.map +1 -1
- package/esm/stdlib/item/node/ellipse.js +11 -6
- package/esm/stdlib/item/node/ellipse.js.map +1 -1
- package/esm/stdlib/item/node/hexagon.js +12 -7
- package/esm/stdlib/item/node/hexagon.js.map +1 -1
- package/esm/stdlib/item/node/image.js +13 -3
- package/esm/stdlib/item/node/image.js.map +1 -1
- package/esm/stdlib/item/node/index.d.ts +1 -0
- package/esm/stdlib/item/node/index.js +1 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/item/node/modelRect.d.ts +33 -1
- package/esm/stdlib/item/node/modelRect.js +135 -78
- package/esm/stdlib/item/node/modelRect.js.map +1 -1
- package/esm/stdlib/item/node/plane.d.ts +38 -0
- package/esm/stdlib/item/node/plane.js +62 -0
- package/esm/stdlib/item/node/plane.js.map +1 -0
- package/esm/stdlib/item/node/rect.js +12 -7
- package/esm/stdlib/item/node/rect.js.map +1 -1
- package/esm/stdlib/item/node/sphere.js +12 -7
- package/esm/stdlib/item/node/sphere.js.map +1 -1
- package/esm/stdlib/item/node/star.d.ts +1 -3
- package/esm/stdlib/item/node/star.js +16 -10
- package/esm/stdlib/item/node/star.js.map +1 -1
- package/esm/stdlib/item/node/triangle.js +17 -7
- package/esm/stdlib/item/node/triangle.js.map +1 -1
- package/esm/stdlib/plugin/edgeBundling/index.d.ts +75 -0
- package/esm/stdlib/plugin/edgeBundling/index.js +364 -0
- package/esm/stdlib/plugin/edgeBundling/index.js.map +1 -0
- package/esm/stdlib/plugin/hull/bubbleset.d.ts +1 -1
- package/esm/stdlib/plugin/hull/bubbleset.js +13 -13
- package/esm/stdlib/plugin/hull/bubbleset.js.map +1 -1
- package/esm/stdlib/plugin/hull/index.js +4 -4
- package/esm/stdlib/plugin/hull/util.js +1 -1
- package/esm/stdlib/plugin/hull/util.js.map +1 -1
- package/esm/stdlib/plugin/index.d.ts +1 -0
- package/esm/stdlib/plugin/index.js +1 -0
- package/esm/stdlib/plugin/index.js.map +1 -1
- package/esm/stdlib/plugin/legend/index.d.ts +2 -2
- package/esm/stdlib/plugin/legend/index.js +10 -10
- package/esm/stdlib/plugin/legend/index.js.map +1 -1
- package/esm/stdlib/plugin/lodController/index.js +10 -8
- package/esm/stdlib/plugin/lodController/index.js.map +1 -1
- package/esm/stdlib/plugin/menu/index.js +1 -1
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/snapline/index.d.ts +2 -2
- package/esm/stdlib/plugin/snapline/index.js +2 -2
- package/esm/stdlib/plugin/snapline/index.js.map +1 -1
- package/esm/stdlib/plugin/tooltip/index.d.ts +1 -1
- package/esm/stdlib/plugin/tooltip/index.js +3 -3
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
- package/esm/stdlib/plugin/{watermaker → watermarker}/index.d.ts +1 -1
- package/esm/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
- package/esm/stdlib/plugin/watermarker/index.js.map +1 -0
- package/esm/stdlib/selector/lasso.js +3 -3
- package/esm/stdlib/selector/lasso.js.map +1 -1
- package/esm/stdlib/theme/dark.js +1 -1
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +4 -1
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/spec.js +3 -3
- package/esm/stdlib/themeSolver/subject.d.ts +1 -1
- package/esm/stdlib/themeSolver/subject.js +1 -1
- package/esm/types/animate.d.ts +1 -1
- package/esm/types/data.d.ts +3 -1
- package/esm/types/graph.d.ts +54 -11
- package/esm/types/hook.d.ts +13 -3
- package/esm/types/index.d.ts +2 -1
- package/esm/types/index.js +1 -0
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +8 -10
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +1 -1
- package/esm/types/node.d.ts +1 -31
- package/esm/types/plugin.d.ts +1 -1
- package/esm/types/plugin.js +1 -1
- package/esm/types/spec.d.ts +5 -5
- package/esm/types/theme.d.ts +1 -1
- package/esm/types/view.d.ts +1 -1
- package/esm/util/animate.js +1 -1
- package/esm/util/animate.js.map +1 -1
- package/esm/util/canvas.d.ts +1 -1
- package/esm/util/canvas.js +7 -1
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +10 -10
- package/esm/util/data.js +10 -9
- package/esm/util/data.js.map +1 -1
- package/esm/util/extend.js +1 -1
- package/esm/util/extend.js.map +1 -1
- package/esm/util/item.js +1 -1
- package/esm/util/item.js.map +1 -1
- package/esm/util/math.d.ts +1 -1
- package/esm/util/math.js +1 -1
- package/esm/util/path.d.ts +1 -1
- package/esm/util/path.js +1 -1
- package/esm/util/polyline.d.ts +2 -2
- package/esm/util/polyline.js +3 -3
- package/esm/util/polyline.js.map +1 -1
- package/esm/util/router.js +7 -7
- package/esm/util/router.js.map +1 -1
- package/esm/util/shape.d.ts +25 -13
- package/esm/util/shape.js +29 -20
- package/esm/util/shape.js.map +1 -1
- package/esm/util/shape3d.d.ts +2 -2
- package/esm/util/shape3d.js +9 -12
- package/esm/util/shape3d.js.map +1 -1
- package/lib/constant/shape.d.ts +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/item/combo.js +3 -1
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.js +7 -2
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +2 -2
- package/lib/item/item.js +13 -6
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +1 -0
- package/lib/item/node.js +12 -2
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.js +14 -9
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/interaction.js +3 -2
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +3 -2
- package/lib/runtime/controller/item.js +44 -21
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.js +7 -33
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.js +1 -1
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/graph.d.ts +19 -6
- package/lib/runtime/graph.js +62 -27
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/hooks.d.ts +2 -2
- package/lib/runtime/hooks.js +2 -2
- package/lib/stdlib/behavior/create-edge.d.ts +1 -1
- package/lib/stdlib/behavior/drag-canvas.d.ts +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +1 -1
- package/lib/stdlib/behavior/drag-node.js +1 -1
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
- package/lib/stdlib/behavior/scroll-canvas.js +5 -5
- package/lib/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +16 -0
- package/lib/stdlib/behavior/zoom-canvas.js +106 -4
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/transformV4Data.js +12 -6
- package/lib/stdlib/data/transformV4Data.js.map +1 -1
- package/lib/stdlib/index.d.ts +6 -4
- package/lib/stdlib/index.js +10 -8
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/circle.js +12 -7
- package/lib/stdlib/item/combo/circle.js.map +1 -1
- package/lib/stdlib/item/combo/rect.js +12 -7
- package/lib/stdlib/item/combo/rect.js.map +1 -1
- package/lib/stdlib/item/edge/base.d.ts +22 -5
- package/lib/stdlib/item/edge/base.js +48 -16
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/edge/cubic.js +11 -6
- package/lib/stdlib/item/edge/cubic.js.map +1 -1
- package/lib/stdlib/item/edge/line.js +12 -7
- package/lib/stdlib/item/edge/line.js.map +1 -1
- package/lib/stdlib/item/edge/loop.js +6 -1
- package/lib/stdlib/item/edge/loop.js.map +1 -1
- package/lib/stdlib/item/edge/polyline.js +11 -6
- package/lib/stdlib/item/edge/polyline.js.map +1 -1
- package/lib/stdlib/item/edge/quadratic.js +11 -6
- package/lib/stdlib/item/edge/quadratic.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +24 -13
- package/lib/stdlib/item/node/base.js +90 -48
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.d.ts +11 -2
- package/lib/stdlib/item/node/base3d.js +14 -3
- package/lib/stdlib/item/node/base3d.js.map +1 -1
- package/lib/stdlib/item/node/circle.js +13 -7
- package/lib/stdlib/item/node/circle.js.map +1 -1
- package/lib/stdlib/item/node/cube.d.ts +0 -2
- package/lib/stdlib/item/node/cube.js +12 -9
- package/lib/stdlib/item/node/cube.js.map +1 -1
- package/lib/stdlib/item/node/diamond.js +20 -11
- package/lib/stdlib/item/node/diamond.js.map +1 -1
- package/lib/stdlib/item/node/donut.js +18 -8
- package/lib/stdlib/item/node/donut.js.map +1 -1
- package/lib/stdlib/item/node/ellipse.js +11 -6
- package/lib/stdlib/item/node/ellipse.js.map +1 -1
- package/lib/stdlib/item/node/hexagon.js +12 -7
- package/lib/stdlib/item/node/hexagon.js.map +1 -1
- package/lib/stdlib/item/node/image.js +13 -3
- package/lib/stdlib/item/node/image.js.map +1 -1
- package/lib/stdlib/item/node/index.d.ts +1 -0
- package/lib/stdlib/item/node/index.js +1 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/item/node/modelRect.d.ts +33 -1
- package/lib/stdlib/item/node/modelRect.js +135 -78
- package/lib/stdlib/item/node/modelRect.js.map +1 -1
- package/lib/stdlib/item/node/plane.d.ts +38 -0
- package/lib/stdlib/item/node/plane.js +66 -0
- package/lib/stdlib/item/node/plane.js.map +1 -0
- package/lib/stdlib/item/node/rect.js +12 -7
- package/lib/stdlib/item/node/rect.js.map +1 -1
- package/lib/stdlib/item/node/sphere.js +12 -7
- package/lib/stdlib/item/node/sphere.js.map +1 -1
- package/lib/stdlib/item/node/star.d.ts +1 -3
- package/lib/stdlib/item/node/star.js +16 -10
- package/lib/stdlib/item/node/star.js.map +1 -1
- package/lib/stdlib/item/node/triangle.js +17 -7
- package/lib/stdlib/item/node/triangle.js.map +1 -1
- package/lib/stdlib/plugin/edgeBundling/index.d.ts +75 -0
- package/lib/stdlib/plugin/edgeBundling/index.js +368 -0
- package/lib/stdlib/plugin/edgeBundling/index.js.map +1 -0
- package/lib/stdlib/plugin/hull/bubbleset.d.ts +1 -1
- package/lib/stdlib/plugin/hull/bubbleset.js +13 -13
- package/lib/stdlib/plugin/hull/bubbleset.js.map +1 -1
- package/lib/stdlib/plugin/hull/index.js +4 -4
- package/lib/stdlib/plugin/hull/util.js +1 -1
- package/lib/stdlib/plugin/hull/util.js.map +1 -1
- package/lib/stdlib/plugin/index.d.ts +1 -0
- package/lib/stdlib/plugin/index.js +1 -0
- package/lib/stdlib/plugin/index.js.map +1 -1
- package/lib/stdlib/plugin/legend/index.d.ts +2 -2
- package/lib/stdlib/plugin/legend/index.js +10 -10
- package/lib/stdlib/plugin/legend/index.js.map +1 -1
- package/lib/stdlib/plugin/lodController/index.js +10 -8
- package/lib/stdlib/plugin/lodController/index.js.map +1 -1
- package/lib/stdlib/plugin/menu/index.js +1 -1
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/snapline/index.d.ts +2 -2
- package/lib/stdlib/plugin/snapline/index.js +2 -2
- package/lib/stdlib/plugin/snapline/index.js.map +1 -1
- package/lib/stdlib/plugin/tooltip/index.d.ts +1 -1
- package/lib/stdlib/plugin/tooltip/index.js +3 -3
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
- package/lib/stdlib/plugin/{watermaker → watermarker}/index.d.ts +1 -1
- package/lib/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
- package/lib/stdlib/plugin/watermarker/index.js.map +1 -0
- package/lib/stdlib/selector/lasso.js +3 -3
- package/lib/stdlib/selector/lasso.js.map +1 -1
- package/lib/stdlib/theme/dark.js +1 -1
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +4 -1
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/spec.js +3 -3
- package/lib/stdlib/themeSolver/subject.d.ts +1 -1
- package/lib/stdlib/themeSolver/subject.js +1 -1
- package/lib/types/animate.d.ts +1 -1
- package/lib/types/data.d.ts +3 -1
- package/lib/types/graph.d.ts +54 -11
- package/lib/types/hook.d.ts +13 -3
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.js +3 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +8 -10
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +1 -1
- package/lib/types/node.d.ts +1 -31
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/plugin.js +1 -1
- package/lib/types/spec.d.ts +5 -5
- package/lib/types/theme.d.ts +1 -1
- package/lib/types/view.d.ts +1 -1
- package/lib/util/animate.js +1 -1
- package/lib/util/animate.js.map +1 -1
- package/lib/util/canvas.d.ts +1 -1
- package/lib/util/canvas.js +7 -1
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +10 -10
- package/lib/util/data.js +12 -11
- package/lib/util/data.js.map +1 -1
- package/lib/util/extend.js +4 -7
- package/lib/util/extend.js.map +1 -1
- package/lib/util/item.js +1 -1
- package/lib/util/item.js.map +1 -1
- package/lib/util/math.d.ts +1 -1
- package/lib/util/math.js +1 -1
- package/lib/util/path.d.ts +1 -1
- package/lib/util/path.js +1 -1
- package/lib/util/polyline.d.ts +2 -2
- package/lib/util/polyline.js +3 -3
- package/lib/util/polyline.js.map +1 -1
- package/lib/util/router.js +7 -7
- package/lib/util/router.js.map +1 -1
- package/lib/util/shape.d.ts +25 -13
- package/lib/util/shape.js +28 -19
- package/lib/util/shape.js.map +1 -1
- package/lib/util/shape3d.d.ts +2 -2
- package/lib/util/shape3d.js +9 -12
- package/lib/util/shape3d.js.map +1 -1
- package/package.json +37 -53
- package/src/index.ts +1 -1
- package/src/item/combo.ts +2 -1
- package/src/item/edge.ts +9 -2
- package/src/item/item.ts +21 -10
- package/src/item/node.ts +22 -6
- package/src/runtime/controller/data.ts +16 -14
- package/src/runtime/controller/interaction.ts +5 -4
- package/src/runtime/controller/item.ts +78 -36
- package/src/runtime/controller/layout.ts +7 -9
- package/src/runtime/controller/plugin.ts +1 -1
- package/src/runtime/graph.ts +128 -71
- package/src/runtime/hooks.ts +2 -2
- package/src/stdlib/behavior/create-edge.ts +1 -1
- package/src/stdlib/behavior/drag-canvas.ts +1 -1
- package/src/stdlib/behavior/drag-node.ts +1 -1
- package/src/stdlib/behavior/hover-activate.ts +1 -1
- package/src/stdlib/behavior/orbit-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/rotate-canvas-3d.ts +2 -2
- package/src/stdlib/behavior/scroll-canvas.ts +5 -5
- package/src/stdlib/behavior/track-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/zoom-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/zoom-canvas.ts +134 -13
- package/src/stdlib/data/transformV4Data.ts +27 -3
- package/src/stdlib/index.ts +8 -4
- package/src/stdlib/item/combo/circle.ts +26 -11
- package/src/stdlib/item/combo/rect.ts +26 -11
- package/src/stdlib/item/edge/base.ts +45 -24
- package/src/stdlib/item/edge/cubic.ts +26 -4
- package/src/stdlib/item/edge/line.ts +27 -5
- package/src/stdlib/item/edge/loop.ts +6 -1
- package/src/stdlib/item/edge/polyline.ts +26 -4
- package/src/stdlib/item/edge/quadratic.ts +26 -4
- package/src/stdlib/item/node/base.ts +74 -48
- package/src/stdlib/item/node/base3d.ts +19 -3
- package/src/stdlib/item/node/circle.ts +29 -8
- package/src/stdlib/item/node/cube.ts +26 -12
- package/src/stdlib/item/node/diamond.ts +35 -11
- package/src/stdlib/item/node/donut.ts +32 -18
- package/src/stdlib/item/node/ellipse.ts +25 -11
- package/src/stdlib/item/node/hexagon.ts +27 -7
- package/src/stdlib/item/node/image.ts +13 -5
- package/src/stdlib/item/node/index.ts +1 -0
- package/src/stdlib/item/node/modelRect.ts +230 -136
- package/src/stdlib/item/node/plane.ts +121 -0
- package/src/stdlib/item/node/rect.ts +27 -7
- package/src/stdlib/item/node/sphere.ts +26 -10
- package/src/stdlib/item/node/star.ts +32 -11
- package/src/stdlib/item/node/triangle.ts +32 -9
- package/src/stdlib/plugin/edgeBundling/index.ts +529 -0
- package/src/stdlib/plugin/hull/bubbleset.ts +14 -14
- package/src/stdlib/plugin/hull/index.ts +4 -4
- package/src/stdlib/plugin/hull/util.ts +1 -1
- package/src/stdlib/plugin/index.ts +1 -0
- package/src/stdlib/plugin/legend/index.ts +11 -12
- package/src/stdlib/plugin/lodController/index.ts +9 -8
- package/src/stdlib/plugin/menu/index.ts +1 -1
- package/src/stdlib/plugin/snapline/index.ts +3 -3
- package/src/stdlib/plugin/tooltip/index.ts +4 -4
- package/src/stdlib/plugin/{watermaker → watermarker}/index.ts +8 -8
- package/src/stdlib/selector/lasso.ts +3 -3
- package/src/stdlib/theme/dark.ts +0 -1
- package/src/stdlib/theme/light.ts +3 -1
- package/src/stdlib/themeSolver/spec.ts +3 -3
- package/src/stdlib/themeSolver/subject.ts +1 -1
- package/src/types/animate.ts +2 -2
- package/src/types/data.ts +5 -1
- package/src/types/graph.ts +82 -11
- package/src/types/hook.ts +32 -3
- package/src/types/index.ts +2 -1
- package/src/types/item.ts +15 -16
- package/src/types/layout.ts +1 -1
- package/src/types/node.ts +1 -31
- package/src/types/plugin.ts +1 -1
- package/src/types/spec.ts +5 -5
- package/src/types/theme.ts +1 -1
- package/src/types/view.ts +1 -1
- package/src/util/animate.ts +1 -1
- package/src/util/canvas.ts +8 -0
- package/src/util/data.ts +12 -10
- package/src/util/extend.ts +1 -1
- package/src/util/item.ts +1 -1
- package/src/util/math.ts +1 -1
- package/src/util/path.ts +1 -1
- package/src/util/polyline.ts +3 -3
- package/src/util/router.ts +7 -7
- package/src/util/shape.ts +70 -33
- package/src/util/shape3d.ts +16 -10
- package/esm/stdlib/plugin/watermaker/index.js.map +0 -1
- package/lib/stdlib/plugin/watermaker/index.js.map +0 -1
package/src/types/graph.ts
CHANGED
|
@@ -5,14 +5,29 @@ import { Command } from '../stdlib/plugin/history/command';
|
|
|
5
5
|
import { Hooks } from '../types/hook';
|
|
6
6
|
import { CameraAnimationOptions } from './animate';
|
|
7
7
|
import { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
ComboDisplayModel,
|
|
10
|
+
ComboModel,
|
|
11
|
+
ComboShapesEncode,
|
|
12
|
+
ComboUserModel,
|
|
13
|
+
} from './combo';
|
|
9
14
|
import { Padding, Point } from './common';
|
|
10
15
|
import { GraphData } from './data';
|
|
11
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
EdgeDisplayModel,
|
|
18
|
+
EdgeModel,
|
|
19
|
+
EdgeShapesEncode,
|
|
20
|
+
EdgeUserModel,
|
|
21
|
+
} from './edge';
|
|
12
22
|
import type { StackType } from './history';
|
|
13
23
|
import { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from './item';
|
|
14
24
|
import { LayoutOptions } from './layout';
|
|
15
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
NodeDisplayModel,
|
|
27
|
+
NodeModel,
|
|
28
|
+
NodeShapesEncode,
|
|
29
|
+
NodeUserModel,
|
|
30
|
+
} from './node';
|
|
16
31
|
import { RendererName } from './render';
|
|
17
32
|
import { ComboMapper, EdgeMapper, NodeMapper, Specification } from './spec';
|
|
18
33
|
import { ThemeOptionsOf, ThemeRegistry } from './theme';
|
|
@@ -55,6 +70,32 @@ export interface IGraph<
|
|
|
55
70
|
type: ITEM_TYPE,
|
|
56
71
|
mapper: NodeMapper | EdgeMapper | ComboMapper,
|
|
57
72
|
) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Updates the state configuration for the specified item type, corresponds to the nodeState, edgeState, or comboState on the graph spec.
|
|
75
|
+
* @param {string} itemType - The type of item (node, edge, or combo).
|
|
76
|
+
* @param {object} stateConfig - The state configuration to update.
|
|
77
|
+
* @param {string} updateType - The type of update ('mergeReplace' or 'replace'). Default is 'mergeReplace'.
|
|
78
|
+
**/
|
|
79
|
+
updateStateConfig: (
|
|
80
|
+
itemType: ITEM_TYPE,
|
|
81
|
+
stateConfig:
|
|
82
|
+
| {
|
|
83
|
+
[stateName: string]:
|
|
84
|
+
| ((data: NodeModel) => NodeDisplayModel)
|
|
85
|
+
| NodeShapesEncode;
|
|
86
|
+
}
|
|
87
|
+
| {
|
|
88
|
+
[stateName: string]:
|
|
89
|
+
| ((data: EdgeModel) => EdgeDisplayModel)
|
|
90
|
+
| EdgeShapesEncode;
|
|
91
|
+
}
|
|
92
|
+
| {
|
|
93
|
+
[stateName: string]:
|
|
94
|
+
| ((data: ComboModel) => ComboDisplayModel)
|
|
95
|
+
| ComboShapesEncode;
|
|
96
|
+
},
|
|
97
|
+
updateType?: 'mergeReplace' | 'replace',
|
|
98
|
+
) => void;
|
|
58
99
|
/**
|
|
59
100
|
* Get the copy of specs(configurations).
|
|
60
101
|
* @returns graph specs
|
|
@@ -118,9 +159,10 @@ export interface IGraph<
|
|
|
118
159
|
direction?: 'in' | 'out' | 'both',
|
|
119
160
|
) => EdgeModel[];
|
|
120
161
|
/**
|
|
121
|
-
* Get nearby edges from a start node using
|
|
162
|
+
* Get nearby edges from a start node using quad-tree collision detection.
|
|
122
163
|
* @param nodeId id of the start node
|
|
123
164
|
* @returns nearby edges' data array
|
|
165
|
+
* @group Data
|
|
124
166
|
*/
|
|
125
167
|
getNearEdgesData: (
|
|
126
168
|
nodeId: ID,
|
|
@@ -161,7 +203,7 @@ export interface IGraph<
|
|
|
161
203
|
* Change graph data.
|
|
162
204
|
* @param data new data
|
|
163
205
|
* @param type the way to change data, 'replace' means discard the old data and use the new one; 'mergeReplace' means merge the common part, remove (old - new), add (new - old)
|
|
164
|
-
* @param
|
|
206
|
+
* @param re-layout whether re-layout the nodes after data changing
|
|
165
207
|
* @returns
|
|
166
208
|
* @group Data
|
|
167
209
|
*/
|
|
@@ -173,6 +215,7 @@ export interface IGraph<
|
|
|
173
215
|
/**
|
|
174
216
|
* Clear the graph, means remove all the items on the graph.
|
|
175
217
|
* @returns
|
|
218
|
+
* @group Data
|
|
176
219
|
*/
|
|
177
220
|
clear: () => void;
|
|
178
221
|
/**
|
|
@@ -194,7 +237,7 @@ export interface IGraph<
|
|
|
194
237
|
* Add one or more node/edge/combo data to the graph.
|
|
195
238
|
* @param itemType item type
|
|
196
239
|
* @param model user data
|
|
197
|
-
* @returns
|
|
240
|
+
* @returns whether success
|
|
198
241
|
* @group Data
|
|
199
242
|
*/
|
|
200
243
|
addData: (
|
|
@@ -217,7 +260,7 @@ export interface IGraph<
|
|
|
217
260
|
* Remove one or more node/edge/combo data from the graph.
|
|
218
261
|
* @param itemType the type the item(s) to be removed.
|
|
219
262
|
* @param id the id or the ids' array of the items to be removed.
|
|
220
|
-
* @returns
|
|
263
|
+
* @returns whether success
|
|
221
264
|
* @group Data
|
|
222
265
|
*/
|
|
223
266
|
removeData: (itemType: ITEM_TYPE, id: ID | ID[]) => void;
|
|
@@ -298,7 +341,7 @@ export interface IGraph<
|
|
|
298
341
|
* @param dy the distance alone y-axis to move the combo.
|
|
299
342
|
* @param upsertAncestors whether update the ancestors in the combo tree.
|
|
300
343
|
* @param callback callback function after move combo done.
|
|
301
|
-
* @group
|
|
344
|
+
* @group Combo
|
|
302
345
|
*/
|
|
303
346
|
moveCombo: (
|
|
304
347
|
ids: ID[],
|
|
@@ -318,6 +361,7 @@ export interface IGraph<
|
|
|
318
361
|
* @param dx x of the relative vector
|
|
319
362
|
* @param dy y of the relative vector
|
|
320
363
|
* @param effectTiming animation configurations
|
|
364
|
+
* @group View
|
|
321
365
|
*/
|
|
322
366
|
translate: (
|
|
323
367
|
distance: Partial<{
|
|
@@ -331,6 +375,7 @@ export interface IGraph<
|
|
|
331
375
|
* Move the graph and align to a point.
|
|
332
376
|
* @param point position on the canvas to align
|
|
333
377
|
* @param effectTiming animation configurations
|
|
378
|
+
* @group View
|
|
334
379
|
*/
|
|
335
380
|
translateTo: (
|
|
336
381
|
point: PointLike,
|
|
@@ -339,6 +384,7 @@ export interface IGraph<
|
|
|
339
384
|
/**
|
|
340
385
|
* Return the current zoom level of camera.
|
|
341
386
|
* @returns current zoom
|
|
387
|
+
* @group View
|
|
342
388
|
*/
|
|
343
389
|
getZoom: () => number;
|
|
344
390
|
/**
|
|
@@ -346,6 +392,7 @@ export interface IGraph<
|
|
|
346
392
|
* @param ratio relative ratio to zoom
|
|
347
393
|
* @param center zoom center
|
|
348
394
|
* @param effectTiming animation configurations
|
|
395
|
+
* @group View
|
|
349
396
|
*/
|
|
350
397
|
zoom: (
|
|
351
398
|
ratio: number,
|
|
@@ -357,6 +404,7 @@ export interface IGraph<
|
|
|
357
404
|
* @param toRatio specified ratio
|
|
358
405
|
* @param center zoom center
|
|
359
406
|
* @param effectTiming animation configurations
|
|
407
|
+
* @group View
|
|
360
408
|
*/
|
|
361
409
|
zoomTo: (
|
|
362
410
|
toRatio: number,
|
|
@@ -368,6 +416,7 @@ export interface IGraph<
|
|
|
368
416
|
* @param angle
|
|
369
417
|
* @param center
|
|
370
418
|
* @param effectTiming
|
|
419
|
+
* @group View
|
|
371
420
|
*/
|
|
372
421
|
rotate: (
|
|
373
422
|
angle: number,
|
|
@@ -379,6 +428,7 @@ export interface IGraph<
|
|
|
379
428
|
* @param toAngle
|
|
380
429
|
* @param center
|
|
381
430
|
* @param effectTiming
|
|
431
|
+
* @group View
|
|
382
432
|
*/
|
|
383
433
|
rotateTo: (
|
|
384
434
|
toAngle: number,
|
|
@@ -390,6 +440,7 @@ export interface IGraph<
|
|
|
390
440
|
* Transform the graph with a CSS-Transform-like syntax.
|
|
391
441
|
* @param options
|
|
392
442
|
* @param effectTiming
|
|
443
|
+
* @group View
|
|
393
444
|
*/
|
|
394
445
|
transform: (
|
|
395
446
|
options: GraphTransformOptions,
|
|
@@ -397,10 +448,12 @@ export interface IGraph<
|
|
|
397
448
|
) => Promise<void>;
|
|
398
449
|
/**
|
|
399
450
|
* Stop the current transition of transform immediately.
|
|
451
|
+
* @group View
|
|
400
452
|
*/
|
|
401
453
|
stopTransformTransition: () => void;
|
|
402
454
|
/**
|
|
403
455
|
* Return the center of viewport, e.g. for a 500 * 500 canvas, its center is [250, 250].
|
|
456
|
+
* @group View
|
|
404
457
|
*/
|
|
405
458
|
getViewportCenter: () => PointLike;
|
|
406
459
|
/**
|
|
@@ -570,7 +623,7 @@ export interface IGraph<
|
|
|
570
623
|
/**
|
|
571
624
|
* Get the visibility for a node / edge / combo.
|
|
572
625
|
* @param id the id for the node / edge / combo
|
|
573
|
-
* @returns visibility for the item, false for invisible or
|
|
626
|
+
* @returns visibility for the item, false for invisible or un-existence for the item
|
|
574
627
|
*/
|
|
575
628
|
getItemVisible: (id: ID) => boolean;
|
|
576
629
|
|
|
@@ -585,7 +638,7 @@ export interface IGraph<
|
|
|
585
638
|
|
|
586
639
|
/**
|
|
587
640
|
* Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo.
|
|
588
|
-
* Different from addData with combo type, this API update the succeeds' combo tree
|
|
641
|
+
* Different from addData with combo type, this API update the succeeds' combo tree structures in the same time.
|
|
589
642
|
* @param model combo user data.
|
|
590
643
|
* @param childrenIds the ids of the children nodes / combos to move into the new combo.
|
|
591
644
|
* @returns whether success
|
|
@@ -609,6 +662,7 @@ export interface IGraph<
|
|
|
609
662
|
// ===== layout =====
|
|
610
663
|
/**
|
|
611
664
|
* Layout the graph (with current configurations if cfg is not assigned).
|
|
665
|
+
* @group Layout
|
|
612
666
|
*/
|
|
613
667
|
layout: (options?: LayoutOptions, disableAnimate?: boolean) => Promise<void>;
|
|
614
668
|
stopLayout: () => void;
|
|
@@ -637,6 +691,7 @@ export interface IGraph<
|
|
|
637
691
|
* @param behaviors behavior names or configs
|
|
638
692
|
* @param modes mode names
|
|
639
693
|
* @returns
|
|
694
|
+
* @group Interaction
|
|
640
695
|
*/
|
|
641
696
|
addBehaviors: (
|
|
642
697
|
behaviors: BehaviorOptionsOf<B> | BehaviorOptionsOf<B>[],
|
|
@@ -662,7 +717,7 @@ export interface IGraph<
|
|
|
662
717
|
/**
|
|
663
718
|
* Draw or update a G shape or group to the transient canvas.
|
|
664
719
|
* @param type shape type or item type
|
|
665
|
-
* @param id new shape id or updated shape id for a
|
|
720
|
+
* @param id new shape id or updated shape id for a interaction shape, node/edge/combo id for item interaction group drawing
|
|
666
721
|
* @returns upserted shape or group
|
|
667
722
|
* @group Interaction
|
|
668
723
|
*/
|
|
@@ -726,6 +781,7 @@ export interface IGraph<
|
|
|
726
781
|
|
|
727
782
|
/**
|
|
728
783
|
* Determine if history (redo/undo) is enabled.
|
|
784
|
+
* @group History
|
|
729
785
|
*/
|
|
730
786
|
isHistoryEnabled: () => void;
|
|
731
787
|
|
|
@@ -733,56 +789,67 @@ export interface IGraph<
|
|
|
733
789
|
* Push the operation(s) onto the specified stack
|
|
734
790
|
* @param cmd commands to be pushed
|
|
735
791
|
* @param stackType undo/redo stack
|
|
792
|
+
* @group History
|
|
736
793
|
*/
|
|
737
794
|
pushStack: (cmd: Command[], stackType: StackType) => void;
|
|
738
795
|
/**
|
|
739
796
|
* Pause stacking operation.
|
|
797
|
+
* @group History
|
|
740
798
|
*/
|
|
741
799
|
pauseStack: () => void;
|
|
742
800
|
/**
|
|
743
801
|
* Resume stacking operation.
|
|
802
|
+
* @group History
|
|
744
803
|
*/
|
|
745
804
|
resumeStack: () => void;
|
|
746
805
|
/**
|
|
747
806
|
* Execute a callback without allowing any stacking operations.
|
|
748
807
|
* @param callback
|
|
808
|
+
* @group History
|
|
749
809
|
*/
|
|
750
810
|
executeWithNoStack: (callback: () => void) => void;
|
|
751
811
|
/**
|
|
752
812
|
* Retrieve the current redo stack which consists of operations that could be undone
|
|
813
|
+
* @group History
|
|
753
814
|
*/
|
|
754
815
|
getUndoStack: () => void;
|
|
755
816
|
|
|
756
817
|
/**
|
|
757
818
|
* Retrieve the current undo stack which consists of operations that were undone
|
|
819
|
+
* @group History
|
|
758
820
|
*/
|
|
759
821
|
getRedoStack: () => void;
|
|
760
822
|
|
|
761
823
|
/**
|
|
762
824
|
* Retrieve the complete history stack
|
|
763
825
|
* @returns
|
|
826
|
+
* @group History
|
|
764
827
|
*/
|
|
765
828
|
getStack: () => void;
|
|
766
829
|
|
|
767
830
|
/**
|
|
768
831
|
* Revert the last n operation(s) on the graph.
|
|
769
832
|
* @returns
|
|
833
|
+
* @group History
|
|
770
834
|
*/
|
|
771
835
|
undo: () => void;
|
|
772
836
|
|
|
773
837
|
/**
|
|
774
838
|
* Restore the operation that was last n reverted on the graph.
|
|
775
839
|
* @returns
|
|
840
|
+
* @group History
|
|
776
841
|
*/
|
|
777
842
|
redo: () => void;
|
|
778
843
|
|
|
779
844
|
/**
|
|
780
845
|
* Indicate whether there are any actions available in the undo stack.
|
|
846
|
+
* @group History
|
|
781
847
|
*/
|
|
782
848
|
canUndo: () => void;
|
|
783
849
|
|
|
784
850
|
/**
|
|
785
851
|
* Indicate whether there are any actions available in the redo stack.
|
|
852
|
+
* @group History
|
|
786
853
|
*/
|
|
787
854
|
canRedo: () => void;
|
|
788
855
|
|
|
@@ -790,6 +857,7 @@ export interface IGraph<
|
|
|
790
857
|
* Begin a historyBatch operation.
|
|
791
858
|
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
792
859
|
* treated as a single operation when undoing or redoing.
|
|
860
|
+
* @group History
|
|
793
861
|
*/
|
|
794
862
|
startHistoryBatch: () => void;
|
|
795
863
|
|
|
@@ -797,6 +865,7 @@ export interface IGraph<
|
|
|
797
865
|
* End a historyBatch operation.
|
|
798
866
|
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
799
867
|
* treated as a single operation when undoing or redoing.
|
|
868
|
+
* @group History
|
|
800
869
|
*/
|
|
801
870
|
stopHistoryBatch: () => void;
|
|
802
871
|
|
|
@@ -805,6 +874,7 @@ export interface IGraph<
|
|
|
805
874
|
* All operations performed inside callback will be treated as a composite operation
|
|
806
875
|
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
807
876
|
* @param callback The func containing operations to be batched together.
|
|
877
|
+
* @group History
|
|
808
878
|
*/
|
|
809
879
|
historyBatch: (callback: () => void) => void;
|
|
810
880
|
|
|
@@ -813,6 +883,7 @@ export interface IGraph<
|
|
|
813
883
|
* All operations performed inside callback will be treated as a composite operation
|
|
814
884
|
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
815
885
|
* @param callback The func containing operations to be batched together.
|
|
886
|
+
* @group History
|
|
816
887
|
*/
|
|
817
888
|
cleanHistory: (stackType?: StackType) => void;
|
|
818
889
|
// ===== tree operations =====
|
package/src/types/hook.ts
CHANGED
|
@@ -3,13 +3,23 @@ import { GraphChange, ID } from '@antv/graphlib';
|
|
|
3
3
|
import { CameraAnimationOptions } from './animate';
|
|
4
4
|
import { BehaviorOptionsOf } from './behavior';
|
|
5
5
|
import { DataChangeType, DataConfig, GraphCore } from './data';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
EdgeDisplayModel,
|
|
8
|
+
EdgeModel,
|
|
9
|
+
EdgeModelData,
|
|
10
|
+
EdgeShapesEncode,
|
|
11
|
+
} from './edge';
|
|
7
12
|
import { ITEM_TYPE, ShapeStyle, SHAPE_TYPE } from './item';
|
|
8
13
|
import { LayoutOptions } from './layout';
|
|
9
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
NodeDisplayModel,
|
|
16
|
+
NodeModel,
|
|
17
|
+
NodeModelData,
|
|
18
|
+
NodeShapesEncode,
|
|
19
|
+
} from './node';
|
|
10
20
|
import { ThemeSpecification } from './theme';
|
|
11
21
|
import { GraphTransformOptions } from './view';
|
|
12
|
-
import { ComboModel } from './combo';
|
|
22
|
+
import { ComboDisplayModel, ComboModel, ComboShapesEncode } from './combo';
|
|
13
23
|
import { Plugin as PluginBase } from './plugin';
|
|
14
24
|
import { ComboMapper, EdgeMapper, NodeMapper } from './spec';
|
|
15
25
|
|
|
@@ -83,6 +93,25 @@ export interface Hooks {
|
|
|
83
93
|
enableStack?: boolean;
|
|
84
94
|
changes?: any;
|
|
85
95
|
}>;
|
|
96
|
+
itemstateconfigchange: IHook<{
|
|
97
|
+
itemType: ITEM_TYPE;
|
|
98
|
+
stateConfig:
|
|
99
|
+
| {
|
|
100
|
+
[stateName: string]:
|
|
101
|
+
| ((data: NodeModel) => NodeDisplayModel)
|
|
102
|
+
| NodeShapesEncode;
|
|
103
|
+
}
|
|
104
|
+
| {
|
|
105
|
+
[stateName: string]:
|
|
106
|
+
| ((data: EdgeModel) => EdgeDisplayModel)
|
|
107
|
+
| EdgeShapesEncode;
|
|
108
|
+
}
|
|
109
|
+
| {
|
|
110
|
+
[stateName: string]:
|
|
111
|
+
| ((data: ComboModel) => ComboDisplayModel)
|
|
112
|
+
| ComboShapesEncode;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
86
115
|
itemvisibilitychange: IHook<{
|
|
87
116
|
ids: ID[];
|
|
88
117
|
graphCore?: GraphCore;
|
package/src/types/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { ID } from '@antv/graphlib';
|
|
2
2
|
export type { IAnimate, IAnimates, AnimateTiming, AnimateCfg } from './animate';
|
|
3
|
-
export
|
|
3
|
+
export { Behavior } from './behavior';
|
|
4
|
+
export type { BehaviorOptionsOf, BehaviorRegistry } from './behavior';
|
|
4
5
|
export type {
|
|
5
6
|
NodeDisplayModel,
|
|
6
7
|
NodeModel,
|
package/src/types/item.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { ID } from '@antv/graphlib';
|
|
2
1
|
import {
|
|
3
2
|
AABB,
|
|
4
3
|
CircleStyleProps,
|
|
5
|
-
|
|
4
|
+
DisplayObject,
|
|
6
5
|
EllipseStyleProps,
|
|
7
|
-
|
|
6
|
+
Group,
|
|
7
|
+
HTMLStyleProps,
|
|
8
|
+
IAnimation,
|
|
9
|
+
ImageStyleProps,
|
|
8
10
|
LineStyleProps,
|
|
9
11
|
PathStyleProps,
|
|
12
|
+
PolygonStyleProps,
|
|
10
13
|
PolylineStyleProps,
|
|
14
|
+
RectStyleProps,
|
|
11
15
|
TextStyleProps,
|
|
12
|
-
ImageStyleProps,
|
|
13
|
-
Group,
|
|
14
|
-
DisplayObject,
|
|
15
|
-
IAnimation,
|
|
16
|
-
Shape,
|
|
17
16
|
} from '@antv/g';
|
|
18
17
|
import {
|
|
19
18
|
CubeGeometryProps,
|
|
20
19
|
PlaneGeometryProps,
|
|
21
20
|
SphereGeometryProps,
|
|
22
|
-
TorusGeometryProps,
|
|
23
21
|
} from '@antv/g-plugin-3d';
|
|
22
|
+
import { ID } from '@antv/graphlib';
|
|
24
23
|
import { AnimateCfg, IAnimates } from './animate';
|
|
25
24
|
import {
|
|
26
25
|
ComboDisplayModel,
|
|
@@ -58,6 +57,7 @@ export type GShapeStyle = CircleStyleProps &
|
|
|
58
57
|
PathStyleProps &
|
|
59
58
|
SphereGeometryProps &
|
|
60
59
|
CubeGeometryProps &
|
|
60
|
+
HTMLStyleProps &
|
|
61
61
|
PlaneGeometryProps & {
|
|
62
62
|
interactive?: boolean;
|
|
63
63
|
};
|
|
@@ -85,7 +85,6 @@ export interface Encode<T> {
|
|
|
85
85
|
|
|
86
86
|
export interface ShapeAttrEncode {
|
|
87
87
|
[shapeAttr: string]: unknown | Encode<unknown>;
|
|
88
|
-
animates?: IAnimates | Encode<IAnimates>;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
export interface LabelBackground {
|
|
@@ -101,8 +100,7 @@ export interface ShapesEncode {
|
|
|
101
100
|
iconShape?: ShapeAttrEncode | Encode<ShapeStyle>;
|
|
102
101
|
otherShapes?: {
|
|
103
102
|
[shapeId: string]: {
|
|
104
|
-
[
|
|
105
|
-
animates: IAnimates | Encode<IAnimates>;
|
|
103
|
+
[shapeAttr: string]: unknown | Encode<unknown>;
|
|
106
104
|
};
|
|
107
105
|
};
|
|
108
106
|
}
|
|
@@ -116,7 +114,8 @@ export type SHAPE_TYPE =
|
|
|
116
114
|
| 'line'
|
|
117
115
|
| 'path'
|
|
118
116
|
| 'text'
|
|
119
|
-
| 'group'
|
|
117
|
+
| 'group'
|
|
118
|
+
| 'html';
|
|
120
119
|
|
|
121
120
|
export type SHAPE_TYPE_3D = 'sphere' | 'cube' | 'plane';
|
|
122
121
|
|
|
@@ -200,7 +199,7 @@ export interface IItem {
|
|
|
200
199
|
displayModel: ItemDisplayModel;
|
|
201
200
|
/** The style mapper configured at graph with field name 'node' / 'edge' / 'combo'. */
|
|
202
201
|
mapper: DisplayMapper;
|
|
203
|
-
/** The state
|
|
202
|
+
/** The state style mapper configured at graph with field name 'nodeState' / 'edgeState' / 'comboState'. */
|
|
204
203
|
stateMapper: {
|
|
205
204
|
[stateName: string]: DisplayMapper;
|
|
206
205
|
};
|
|
@@ -235,7 +234,7 @@ export interface IItem {
|
|
|
235
234
|
lodLevels: LodLevelRanges;
|
|
236
235
|
/** Last zoom ratio. */
|
|
237
236
|
zoom: number;
|
|
238
|
-
/** Cache the
|
|
237
|
+
/** Cache the changing states which are not consumed by draw */
|
|
239
238
|
changedStates: string[];
|
|
240
239
|
/** The listener for the animations frames. */
|
|
241
240
|
onframe: Function;
|
|
@@ -334,7 +333,7 @@ export interface IItem {
|
|
|
334
333
|
getBBox: () => AABB;
|
|
335
334
|
/** Stop all the animations on the item. */
|
|
336
335
|
stopAnimations: () => void;
|
|
337
|
-
/** Animations' frame
|
|
336
|
+
/** Animations' frame listener. */
|
|
338
337
|
animateFrameListener: Function;
|
|
339
338
|
/** Call render extension's onZoom to response the graph zooming. */
|
|
340
339
|
updateZoom: (zoom: number) => void;
|
package/src/types/layout.ts
CHANGED
package/src/types/node.ts
CHANGED
|
@@ -154,39 +154,9 @@ export interface NodeShapeStyles extends ItemShapeStyles {
|
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
156
|
anchorShapes?: ShapeStyle & {
|
|
157
|
-
/**
|
|
158
|
-
* Background color of the anchor.
|
|
159
|
-
*/
|
|
160
|
-
color?: string;
|
|
161
|
-
/**
|
|
162
|
-
* Color of the text in anchor.
|
|
163
|
-
*/
|
|
164
|
-
textColor?: string;
|
|
165
|
-
/**
|
|
166
|
-
* Size of the text in anchor.
|
|
167
|
-
*/
|
|
168
|
-
size?: number;
|
|
169
|
-
/**
|
|
170
|
-
* The x-axis offset of the text relative to the current position
|
|
171
|
-
*/
|
|
172
|
-
offsetX?: number;
|
|
173
|
-
/**
|
|
174
|
-
* The y-axis offset of the text relative to the current position
|
|
175
|
-
*/
|
|
176
|
-
offsetY?: number;
|
|
177
|
-
/**
|
|
178
|
-
* The z-axis offset of the text relative to the current position
|
|
179
|
-
*/
|
|
180
|
-
offsetZ?: number;
|
|
181
157
|
// individual styles and their position
|
|
182
158
|
[key: number]: ShapeStyle & {
|
|
183
|
-
position?:
|
|
184
|
-
color?: string;
|
|
185
|
-
textColor?: string;
|
|
186
|
-
size?: number;
|
|
187
|
-
offsetX?: number;
|
|
188
|
-
offsetY?: number;
|
|
189
|
-
offsetZ?: number;
|
|
159
|
+
position?: 'top' | 'left' | 'bottom' | 'right' | [number, number];
|
|
190
160
|
};
|
|
191
161
|
};
|
|
192
162
|
}
|
package/src/types/plugin.ts
CHANGED
package/src/types/spec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Canvas } from '@antv/g';
|
|
2
2
|
import { AnimateCfg, CameraAnimationOptions } from './animate';
|
|
3
3
|
import { Padding, Point } from './common';
|
|
4
|
-
import { DataConfig, TransformerFn } from './data';
|
|
4
|
+
import { DataConfig, DataLifecycleType, TransformerFn } from './data';
|
|
5
5
|
import {
|
|
6
6
|
EdgeDisplayModel,
|
|
7
7
|
EdgeEncode,
|
|
@@ -42,6 +42,7 @@ export interface Specification<
|
|
|
42
42
|
container?: string | HTMLElement;
|
|
43
43
|
backgroundCanvas?: Canvas;
|
|
44
44
|
canvas?: Canvas;
|
|
45
|
+
labelCanvas?: Canvas;
|
|
45
46
|
transientCanvas?: Canvas;
|
|
46
47
|
transientLabelCanvas?: Canvas;
|
|
47
48
|
width?: number;
|
|
@@ -60,11 +61,11 @@ export interface Specification<
|
|
|
60
61
|
tileFirstRender?: boolean | number;
|
|
61
62
|
/** Tile size for first rendering. */
|
|
62
63
|
tileFirstRenderSize?: number;
|
|
63
|
-
/** Whether enable tile hiding / showing for
|
|
64
|
+
/** Whether enable tile hiding / showing for behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
64
65
|
tileBehavior?: boolean | number;
|
|
65
66
|
/** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
66
67
|
tileBehaviorSize?: number;
|
|
67
|
-
/** Tile size for level of
|
|
68
|
+
/** Tile size for level of detail changing. */
|
|
68
69
|
tileLodSize?: number;
|
|
69
70
|
};
|
|
70
71
|
autoFit?:
|
|
@@ -86,7 +87,6 @@ export interface Specification<
|
|
|
86
87
|
alignment?: GraphAlignment;
|
|
87
88
|
effectTiming?: CameraAnimationOptions;
|
|
88
89
|
};
|
|
89
|
-
optimizeThreshold?: number;
|
|
90
90
|
|
|
91
91
|
/** data */
|
|
92
92
|
data?: DataConfig;
|
|
@@ -94,7 +94,7 @@ export interface Specification<
|
|
|
94
94
|
| string[]
|
|
95
95
|
| {
|
|
96
96
|
type: string;
|
|
97
|
-
activeLifecycle:
|
|
97
|
+
activeLifecycle: 'all' | DataLifecycleType | DataLifecycleType[];
|
|
98
98
|
[param: string]: unknown; // TODO: generate by plugins
|
|
99
99
|
}[]
|
|
100
100
|
| TransformerFn[];
|
package/src/types/theme.ts
CHANGED
package/src/types/view.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface FitViewRules {
|
|
2
|
-
/**
|
|
2
|
+
/** Whether fit it only when the graph is out of the viewport. */
|
|
3
3
|
onlyOutOfViewport?: boolean;
|
|
4
4
|
/** Whether zoom the graph only when the graph is larger than the viewport. */
|
|
5
5
|
onlyZoomAtLargerThanViewport?: boolean;
|
package/src/util/animate.ts
CHANGED
|
@@ -509,7 +509,7 @@ export const getAnimatesExcludePosition = (animates) => {
|
|
|
509
509
|
};
|
|
510
510
|
|
|
511
511
|
export const fadeIn = (id, shape, style, hiddenShape, animateConfig) => {
|
|
512
|
-
// omit
|
|
512
|
+
// omit in-existence shape and the shape which is not hidden by zoom changing
|
|
513
513
|
if (!shape || !hiddenShape[id]) return;
|
|
514
514
|
if (!shape?.isVisible()) {
|
|
515
515
|
shape.style.opacity = 0;
|
package/src/util/canvas.ts
CHANGED
|
@@ -22,6 +22,7 @@ export const createCanvas = (
|
|
|
22
22
|
height: number,
|
|
23
23
|
pixelRatio?: number,
|
|
24
24
|
canvasConfig: Partial<CanvasConfig> = {},
|
|
25
|
+
unregisterPlugins: string[] = [],
|
|
25
26
|
): Canvas => {
|
|
26
27
|
let renderer: any;
|
|
27
28
|
switch (rendererType.toLowerCase()) {
|
|
@@ -46,6 +47,13 @@ export const createCanvas = (
|
|
|
46
47
|
}),
|
|
47
48
|
);
|
|
48
49
|
|
|
50
|
+
if (unregisterPlugins.length) {
|
|
51
|
+
unregisterPlugins.forEach((name) => {
|
|
52
|
+
const plugin = renderer.getPlugin(name);
|
|
53
|
+
renderer.unregisterPlugin(plugin);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
49
57
|
return new Canvas({
|
|
50
58
|
container,
|
|
51
59
|
width,
|