@antv/g6 5.0.0-beta.26 → 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 +2 -2
- package/esm/index.d.ts +6 -2
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +6 -4
- package/esm/item/combo.js +13 -4
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +12 -4
- package/esm/item/edge.js +106 -18
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +20 -10
- package/esm/item/item.js +114 -63
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +11 -4
- package/esm/item/node.js +102 -8
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +5 -1
- package/esm/runtime/controller/data.js +53 -11
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/index.d.ts +1 -1
- package/esm/runtime/controller/index.js +1 -1
- package/esm/runtime/controller/index.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 +25 -13
- package/esm/runtime/controller/item.js +284 -116
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +3 -0
- package/esm/runtime/controller/layout.js +176 -99
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.d.ts +3 -0
- package/esm/runtime/controller/plugin.js +66 -24
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/controller/viewport.js +9 -2
- package/esm/runtime/controller/viewport.js.map +1 -1
- package/esm/runtime/graph.d.ts +75 -31
- package/esm/runtime/graph.js +320 -161
- 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/click-select.js +9 -3
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- 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-canvas.js +6 -3
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.js +8 -8
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +5 -1
- package/esm/stdlib/behavior/drag-node.js +122 -28
- 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 +8 -8
- 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 +110 -8
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/mapNodeSize.js +2 -2
- package/esm/stdlib/data/mapNodeSize.js.map +1 -1
- package/esm/stdlib/data/transformV4Data.js +12 -6
- package/esm/stdlib/data/transformV4Data.js.map +1 -1
- package/esm/stdlib/data/validateData.js +2 -2
- package/esm/stdlib/data/validateData.js.map +1 -1
- package/esm/stdlib/index.d.ts +8 -4
- package/esm/stdlib/index.js +10 -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 +24 -16
- package/esm/stdlib/item/edge/base.js +60 -121
- 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 +26 -33
- package/esm/stdlib/item/node/base.js +98 -196
- 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/edgeFilterLens/index.js +2 -2
- package/esm/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/esm/stdlib/plugin/fisheye/index.js +3 -2
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -1
- package/esm/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- 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.d.ts +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 +2 -0
- package/esm/stdlib/plugin/index.js +2 -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.d.ts +73 -0
- package/esm/stdlib/plugin/lodController/index.js +558 -0
- package/esm/stdlib/plugin/lodController/index.js.map +1 -0
- package/esm/stdlib/plugin/menu/index.js +1 -1
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/minimap/index.js +12 -14
- package/esm/stdlib/plugin/minimap/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/toolbar/index.d.ts +2 -2
- package/esm/stdlib/plugin/toolbar/index.js +27 -29
- package/esm/stdlib/plugin/toolbar/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/{lib/stdlib/plugin/watermaker → esm/stdlib/plugin/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 +31 -34
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +29 -29
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/spec.js +5 -5
- package/esm/stdlib/themeSolver/spec.js.map +1 -1
- package/esm/stdlib/themeSolver/subject.d.ts +1 -1
- package/esm/stdlib/themeSolver/subject.js +1 -1
- package/esm/types/animate.d.ts +2 -2
- package/esm/types/combo.d.ts +2 -2
- package/esm/types/data.d.ts +3 -1
- package/esm/types/edge.d.ts +2 -2
- package/esm/types/graph.d.ts +113 -51
- package/esm/types/hook.d.ts +18 -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 +17 -25
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +8 -3
- package/esm/types/layout.js.map +1 -1
- package/esm/types/node.d.ts +4 -33
- package/esm/types/plugin.d.ts +2 -1
- package/esm/types/plugin.js +2 -1
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/spec.d.ts +6 -5
- package/esm/types/theme.d.ts +8 -8
- package/esm/types/view.d.ts +1 -1
- package/esm/util/animate.d.ts +7 -2
- package/esm/util/animate.js +38 -24
- package/esm/util/animate.js.map +1 -1
- package/esm/util/bbox.d.ts +7 -1
- package/esm/util/bbox.js +16 -0
- package/esm/util/bbox.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 +16 -10
- package/esm/util/data.js +27 -14
- package/esm/util/data.js.map +1 -1
- package/esm/util/dom.js +5 -5
- package/esm/util/dom.js.map +1 -1
- package/esm/util/extend.js +1 -1
- package/esm/util/extend.js.map +1 -1
- package/esm/util/item.d.ts +1 -1
- package/esm/util/item.js +9 -9
- package/esm/util/item.js.map +1 -1
- package/esm/util/mapper.js +1 -1
- package/esm/util/mapper.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 +7 -2
- package/esm/util/path.js +73 -2
- package/esm/util/path.js.map +1 -1
- package/esm/util/polyline.d.ts +12 -2
- package/esm/util/polyline.js +25 -20
- package/esm/util/polyline.js.map +1 -1
- package/esm/util/router.d.ts +1 -1
- package/esm/util/router.js +26 -25
- package/esm/util/router.js.map +1 -1
- package/esm/util/shape.d.ts +26 -14
- package/esm/util/shape.js +56 -32
- 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/esm/util/zoom.d.ts +5 -8
- package/esm/util/zoom.js +15 -20
- package/esm/util/zoom.js.map +1 -1
- package/lib/constant/shape.d.ts +2 -2
- package/lib/index.d.ts +6 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +6 -4
- package/lib/item/combo.js +13 -4
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +12 -4
- package/lib/item/edge.js +105 -17
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +20 -10
- package/lib/item/item.js +112 -61
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +11 -4
- package/lib/item/node.js +102 -8
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +5 -1
- package/lib/runtime/controller/data.js +52 -10
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/index.d.ts +1 -1
- package/lib/runtime/controller/index.js +1 -1
- package/lib/runtime/controller/index.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 +25 -13
- package/lib/runtime/controller/item.js +281 -113
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +3 -0
- package/lib/runtime/controller/layout.js +176 -122
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.d.ts +3 -0
- package/lib/runtime/controller/plugin.js +66 -24
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/controller/viewport.js +9 -2
- package/lib/runtime/controller/viewport.js.map +1 -1
- package/lib/runtime/graph.d.ts +75 -31
- package/lib/runtime/graph.js +320 -161
- 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/click-select.js +9 -3
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- 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-canvas.js +6 -3
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.js +8 -8
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +5 -1
- package/lib/stdlib/behavior/drag-node.js +122 -28
- 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 +8 -8
- 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 +109 -7
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/mapNodeSize.js +2 -2
- package/lib/stdlib/data/mapNodeSize.js.map +1 -1
- package/lib/stdlib/data/transformV4Data.js +12 -6
- package/lib/stdlib/data/transformV4Data.js.map +1 -1
- package/lib/stdlib/data/validateData.js +2 -2
- package/lib/stdlib/data/validateData.js.map +1 -1
- package/lib/stdlib/index.d.ts +8 -4
- package/lib/stdlib/index.js +12 -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 +24 -16
- package/lib/stdlib/item/edge/base.js +60 -121
- 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 +26 -33
- package/lib/stdlib/item/node/base.js +98 -196
- 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/edgeFilterLens/index.js +2 -2
- package/lib/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/lib/stdlib/plugin/fisheye/index.js +2 -1
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -1
- package/lib/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- 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.d.ts +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 +2 -0
- package/lib/stdlib/plugin/index.js +2 -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.d.ts +73 -0
- package/lib/stdlib/plugin/lodController/index.js +562 -0
- package/lib/stdlib/plugin/lodController/index.js.map +1 -0
- package/lib/stdlib/plugin/menu/index.js +1 -1
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/minimap/index.js +12 -14
- package/lib/stdlib/plugin/minimap/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/toolbar/index.d.ts +2 -2
- package/lib/stdlib/plugin/toolbar/index.js +27 -29
- package/lib/stdlib/plugin/toolbar/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/{esm/stdlib/plugin/watermaker → lib/stdlib/plugin/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 +31 -34
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +29 -29
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/spec.js +5 -5
- package/lib/stdlib/themeSolver/spec.js.map +1 -1
- package/lib/stdlib/themeSolver/subject.d.ts +1 -1
- package/lib/stdlib/themeSolver/subject.js +1 -1
- package/lib/types/animate.d.ts +2 -2
- package/lib/types/combo.d.ts +2 -2
- package/lib/types/data.d.ts +3 -1
- package/lib/types/edge.d.ts +2 -2
- package/lib/types/graph.d.ts +113 -51
- package/lib/types/hook.d.ts +18 -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 +17 -25
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +8 -3
- package/lib/types/layout.js.map +1 -1
- package/lib/types/node.d.ts +4 -33
- package/lib/types/plugin.d.ts +2 -1
- package/lib/types/plugin.js +2 -1
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/spec.d.ts +6 -5
- package/lib/types/theme.d.ts +8 -8
- package/lib/types/view.d.ts +1 -1
- package/lib/util/animate.d.ts +7 -2
- package/lib/util/animate.js +38 -24
- package/lib/util/animate.js.map +1 -1
- package/lib/util/bbox.d.ts +7 -1
- package/lib/util/bbox.js +18 -1
- package/lib/util/bbox.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 +16 -10
- package/lib/util/data.js +30 -16
- package/lib/util/data.js.map +1 -1
- package/lib/util/dom.js +5 -5
- package/lib/util/dom.js.map +1 -1
- package/lib/util/extend.js +4 -7
- package/lib/util/extend.js.map +1 -1
- package/lib/util/item.d.ts +1 -1
- package/lib/util/item.js +9 -9
- package/lib/util/item.js.map +1 -1
- package/lib/util/mapper.js +1 -1
- package/lib/util/mapper.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 +7 -2
- package/lib/util/path.js +73 -2
- package/lib/util/path.js.map +1 -1
- package/lib/util/polyline.d.ts +12 -2
- package/lib/util/polyline.js +28 -21
- package/lib/util/polyline.js.map +1 -1
- package/lib/util/router.d.ts +1 -1
- package/lib/util/router.js +26 -25
- package/lib/util/router.js.map +1 -1
- package/lib/util/shape.d.ts +26 -14
- package/lib/util/shape.js +54 -30
- 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/lib/util/zoom.d.ts +5 -8
- package/lib/util/zoom.js +17 -22
- package/lib/util/zoom.js.map +1 -1
- package/package.json +37 -53
- package/src/index.ts +1 -1
- package/src/item/combo.ts +15 -6
- package/src/item/edge.ts +135 -19
- package/src/item/item.ts +139 -66
- package/src/item/node.ts +125 -12
- package/src/runtime/controller/data.ts +80 -17
- package/src/runtime/controller/index.ts +1 -1
- package/src/runtime/controller/interaction.ts +5 -4
- package/src/runtime/controller/item.ts +398 -170
- package/src/runtime/controller/layout.ts +252 -113
- package/src/runtime/controller/plugin.ts +86 -33
- package/src/runtime/controller/viewport.ts +8 -2
- package/src/runtime/graph.ts +494 -212
- package/src/runtime/hooks.ts +2 -2
- package/src/stdlib/behavior/click-select.ts +8 -3
- package/src/stdlib/behavior/create-edge.ts +1 -1
- package/src/stdlib/behavior/drag-canvas.ts +7 -4
- package/src/stdlib/behavior/drag-combo.ts +8 -8
- package/src/stdlib/behavior/drag-node.ts +166 -51
- 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 +8 -8
- 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 +137 -16
- package/src/stdlib/data/mapNodeSize.ts +2 -2
- package/src/stdlib/data/transformV4Data.ts +27 -3
- package/src/stdlib/data/validateData.ts +2 -2
- package/src/stdlib/index.ts +11 -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 +60 -163
- 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 +91 -260
- 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/edgeFilterLens/index.ts +2 -2
- package/src/stdlib/plugin/fisheye/index.ts +3 -2
- package/src/stdlib/plugin/history/visibility-updated-command.ts +2 -2
- 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 +2 -0
- package/src/stdlib/plugin/legend/index.ts +11 -12
- package/src/stdlib/plugin/lodController/index.ts +603 -0
- package/src/stdlib/plugin/menu/index.ts +1 -1
- package/src/stdlib/plugin/minimap/index.ts +12 -14
- package/src/stdlib/plugin/snapline/index.ts +3 -3
- package/src/stdlib/plugin/toolbar/index.ts +29 -31
- 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 +31 -34
- package/src/stdlib/theme/light.ts +29 -29
- package/src/stdlib/themeSolver/spec.ts +5 -5
- package/src/stdlib/themeSolver/subject.ts +1 -1
- package/src/types/animate.ts +3 -3
- package/src/types/combo.ts +2 -2
- package/src/types/data.ts +5 -1
- package/src/types/edge.ts +2 -2
- package/src/types/graph.ts +144 -61
- package/src/types/hook.ts +37 -3
- package/src/types/index.ts +2 -1
- package/src/types/item.ts +23 -30
- package/src/types/layout.ts +21 -16
- package/src/types/node.ts +4 -33
- package/src/types/plugin.ts +3 -1
- package/src/types/spec.ts +6 -5
- package/src/types/theme.ts +8 -8
- package/src/types/view.ts +1 -1
- package/src/util/animate.ts +105 -79
- package/src/util/bbox.ts +26 -1
- package/src/util/canvas.ts +8 -0
- package/src/util/data.ts +26 -15
- package/src/util/dom.ts +6 -6
- package/src/util/extend.ts +1 -1
- package/src/util/item.ts +16 -2
- package/src/util/mapper.ts +1 -1
- package/src/util/math.ts +1 -1
- package/src/util/path.ts +73 -3
- package/src/util/polyline.ts +33 -26
- package/src/util/router.ts +28 -26
- package/src/util/shape.ts +96 -44
- package/src/util/shape3d.ts +16 -10
- package/src/util/zoom.ts +19 -25
- package/esm/runtime/controller/extension.d.ts +0 -9
- package/esm/runtime/controller/extension.js +0 -11
- package/esm/runtime/controller/extension.js.map +0 -1
- package/esm/stdlib/plugin/watermaker/index.js.map +0 -1
- package/lib/runtime/controller/extension.d.ts +0 -9
- package/lib/runtime/controller/extension.js +0 -15
- package/lib/runtime/controller/extension.js.map +0 -1
- package/lib/stdlib/plugin/watermaker/index.js.map +0 -1
- package/src/runtime/controller/extension.ts +0 -14
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';
|
|
@@ -25,6 +40,7 @@ export interface IGraph<
|
|
|
25
40
|
[x: string]: any;
|
|
26
41
|
hooks: Hooks;
|
|
27
42
|
canvas: Canvas;
|
|
43
|
+
labelCanvas: Canvas;
|
|
28
44
|
transientCanvas: Canvas;
|
|
29
45
|
destroyed: boolean;
|
|
30
46
|
container: HTMLElement;
|
|
@@ -54,6 +70,32 @@ export interface IGraph<
|
|
|
54
70
|
type: ITEM_TYPE,
|
|
55
71
|
mapper: NodeMapper | EdgeMapper | ComboMapper,
|
|
56
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;
|
|
57
99
|
/**
|
|
58
100
|
* Get the copy of specs(configurations).
|
|
59
101
|
* @returns graph specs
|
|
@@ -116,6 +158,16 @@ export interface IGraph<
|
|
|
116
158
|
nodeId: ID,
|
|
117
159
|
direction?: 'in' | 'out' | 'both',
|
|
118
160
|
) => EdgeModel[];
|
|
161
|
+
/**
|
|
162
|
+
* Get nearby edges from a start node using quad-tree collision detection.
|
|
163
|
+
* @param nodeId id of the start node
|
|
164
|
+
* @returns nearby edges' data array
|
|
165
|
+
* @group Data
|
|
166
|
+
*/
|
|
167
|
+
getNearEdgesData: (
|
|
168
|
+
nodeId: ID,
|
|
169
|
+
shouldBegin?: (edge: EdgeDisplayModel) => boolean,
|
|
170
|
+
) => EdgeModel[];
|
|
119
171
|
/**
|
|
120
172
|
* Get one-hop node ids from a start node.
|
|
121
173
|
* @param nodeId id of the start node
|
|
@@ -126,12 +178,6 @@ export interface IGraph<
|
|
|
126
178
|
nodeId: ID,
|
|
127
179
|
direction?: 'in' | 'out' | 'both',
|
|
128
180
|
) => NodeModel[];
|
|
129
|
-
/**
|
|
130
|
-
* Retrieve the nearby edges for a given node using quadtree collision detection.
|
|
131
|
-
* @param nodeId target node's id
|
|
132
|
-
* @returns edges
|
|
133
|
-
*/
|
|
134
|
-
getNearEdgesForNode: (nodeId: ID) => EdgeModel[];
|
|
135
181
|
/*
|
|
136
182
|
* Get the children's data of a combo.
|
|
137
183
|
* @param comboId combo id
|
|
@@ -157,13 +203,19 @@ export interface IGraph<
|
|
|
157
203
|
* Change graph data.
|
|
158
204
|
* @param data new data
|
|
159
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)
|
|
206
|
+
* @param re-layout whether re-layout the nodes after data changing
|
|
160
207
|
* @returns
|
|
161
208
|
* @group Data
|
|
162
209
|
*/
|
|
163
|
-
changeData: (
|
|
210
|
+
changeData: (
|
|
211
|
+
data: GraphData,
|
|
212
|
+
type?: 'replace' | 'mergeReplace',
|
|
213
|
+
relayout?: boolean,
|
|
214
|
+
) => void;
|
|
164
215
|
/**
|
|
165
216
|
* Clear the graph, means remove all the items on the graph.
|
|
166
217
|
* @returns
|
|
218
|
+
* @group Data
|
|
167
219
|
*/
|
|
168
220
|
clear: () => void;
|
|
169
221
|
/**
|
|
@@ -185,8 +237,7 @@ export interface IGraph<
|
|
|
185
237
|
* Add one or more node/edge/combo data to the graph.
|
|
186
238
|
* @param itemType item type
|
|
187
239
|
* @param model user data
|
|
188
|
-
* @
|
|
189
|
-
* @returns whehter success
|
|
240
|
+
* @returns whether success
|
|
190
241
|
* @group Data
|
|
191
242
|
*/
|
|
192
243
|
addData: (
|
|
@@ -198,7 +249,6 @@ export interface IGraph<
|
|
|
198
249
|
| NodeUserModel[]
|
|
199
250
|
| EdgeUserModel[]
|
|
200
251
|
| ComboUserModel[],
|
|
201
|
-
stack?: boolean,
|
|
202
252
|
) =>
|
|
203
253
|
| NodeModel
|
|
204
254
|
| EdgeModel
|
|
@@ -208,17 +258,16 @@ export interface IGraph<
|
|
|
208
258
|
| ComboModel[];
|
|
209
259
|
/**
|
|
210
260
|
* Remove one or more node/edge/combo data from the graph.
|
|
211
|
-
* @param
|
|
212
|
-
* @param
|
|
213
|
-
* @returns
|
|
261
|
+
* @param itemType the type the item(s) to be removed.
|
|
262
|
+
* @param id the id or the ids' array of the items to be removed.
|
|
263
|
+
* @returns whether success
|
|
214
264
|
* @group Data
|
|
215
265
|
*/
|
|
216
|
-
removeData: (itemType: ITEM_TYPE, id: ID | ID[]
|
|
266
|
+
removeData: (itemType: ITEM_TYPE, id: ID | ID[]) => void;
|
|
217
267
|
/**
|
|
218
268
|
* Update one or more node/edge/combo data on the graph.
|
|
219
|
-
* @param
|
|
220
|
-
* @param
|
|
221
|
-
* @param {boolean} stack whether push this operation to stack
|
|
269
|
+
* @param itemType the type the item(s) to be udated.
|
|
270
|
+
* @param models update configs.
|
|
222
271
|
* @group Data
|
|
223
272
|
*/
|
|
224
273
|
updateData: (
|
|
@@ -232,7 +281,6 @@ export interface IGraph<
|
|
|
232
281
|
| Partial<EdgeUserModel>[]
|
|
233
282
|
| Partial<ComboUserModel>[]
|
|
234
283
|
>,
|
|
235
|
-
stack?: boolean,
|
|
236
284
|
) =>
|
|
237
285
|
| NodeModel
|
|
238
286
|
| EdgeModel
|
|
@@ -244,8 +292,10 @@ export interface IGraph<
|
|
|
244
292
|
/**
|
|
245
293
|
* Update one or more nodes' positions,
|
|
246
294
|
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
247
|
-
* @param models new configurations with x and y for every node, which has id field to indicate the specific item
|
|
248
|
-
* @param
|
|
295
|
+
* @param models new configurations with x and y for every node, which has id field to indicate the specific item.
|
|
296
|
+
* @param upsertAncestors whether update the ancestors in combo tree.
|
|
297
|
+
* @param disableAnimate whether disable the animation for this call.
|
|
298
|
+
* @param callback callback function after update nodes done.
|
|
249
299
|
* @group Data
|
|
250
300
|
*/
|
|
251
301
|
updateNodePosition: (
|
|
@@ -260,14 +310,15 @@ export interface IGraph<
|
|
|
260
310
|
model: NodeModel | EdgeModel | ComboModel,
|
|
261
311
|
canceled?: boolean,
|
|
262
312
|
) => void,
|
|
263
|
-
stack?: boolean,
|
|
264
313
|
) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
265
314
|
|
|
266
315
|
/**
|
|
267
316
|
* Update one or more combos' positions, it is achieved by move the succeed nodes.
|
|
268
317
|
* Do not update other styles which leads to better performance than updating positions by updateData.
|
|
269
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
270
|
-
* @param
|
|
318
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item.
|
|
319
|
+
* @param upsertAncestors whether update the ancestors in combo tree.
|
|
320
|
+
* @param disableAnimate whether disable the animation for this call.
|
|
321
|
+
* @param callback callback function after update combos done.
|
|
271
322
|
* @group Data
|
|
272
323
|
*/
|
|
273
324
|
updateComboPosition: (
|
|
@@ -279,16 +330,18 @@ export interface IGraph<
|
|
|
279
330
|
upsertAncestors?: boolean,
|
|
280
331
|
disableAnimate?: boolean,
|
|
281
332
|
callback?: (model: NodeModel | EdgeModel | ComboModel) => void,
|
|
282
|
-
stack?: boolean,
|
|
283
333
|
) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
284
334
|
|
|
285
335
|
/**
|
|
286
336
|
* Move one or more combos a distance (dx, dy) relatively,
|
|
287
337
|
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
288
338
|
* In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
|
|
289
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
290
|
-
* @param
|
|
291
|
-
* @
|
|
339
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item.
|
|
340
|
+
* @param dx the distance alone x-axis to move the combo.
|
|
341
|
+
* @param dy the distance alone y-axis to move the combo.
|
|
342
|
+
* @param upsertAncestors whether update the ancestors in the combo tree.
|
|
343
|
+
* @param callback callback function after move combo done.
|
|
344
|
+
* @group Combo
|
|
292
345
|
*/
|
|
293
346
|
moveCombo: (
|
|
294
347
|
ids: ID[],
|
|
@@ -299,7 +352,6 @@ export interface IGraph<
|
|
|
299
352
|
model: NodeModel | EdgeModel | ComboModel,
|
|
300
353
|
canceled?: boolean,
|
|
301
354
|
) => void,
|
|
302
|
-
stack?: boolean,
|
|
303
355
|
) => ComboModel[];
|
|
304
356
|
|
|
305
357
|
// ===== view operations =====
|
|
@@ -309,6 +361,7 @@ export interface IGraph<
|
|
|
309
361
|
* @param dx x of the relative vector
|
|
310
362
|
* @param dy y of the relative vector
|
|
311
363
|
* @param effectTiming animation configurations
|
|
364
|
+
* @group View
|
|
312
365
|
*/
|
|
313
366
|
translate: (
|
|
314
367
|
distance: Partial<{
|
|
@@ -322,6 +375,7 @@ export interface IGraph<
|
|
|
322
375
|
* Move the graph and align to a point.
|
|
323
376
|
* @param point position on the canvas to align
|
|
324
377
|
* @param effectTiming animation configurations
|
|
378
|
+
* @group View
|
|
325
379
|
*/
|
|
326
380
|
translateTo: (
|
|
327
381
|
point: PointLike,
|
|
@@ -330,6 +384,7 @@ export interface IGraph<
|
|
|
330
384
|
/**
|
|
331
385
|
* Return the current zoom level of camera.
|
|
332
386
|
* @returns current zoom
|
|
387
|
+
* @group View
|
|
333
388
|
*/
|
|
334
389
|
getZoom: () => number;
|
|
335
390
|
/**
|
|
@@ -337,6 +392,7 @@ export interface IGraph<
|
|
|
337
392
|
* @param ratio relative ratio to zoom
|
|
338
393
|
* @param center zoom center
|
|
339
394
|
* @param effectTiming animation configurations
|
|
395
|
+
* @group View
|
|
340
396
|
*/
|
|
341
397
|
zoom: (
|
|
342
398
|
ratio: number,
|
|
@@ -348,6 +404,7 @@ export interface IGraph<
|
|
|
348
404
|
* @param toRatio specified ratio
|
|
349
405
|
* @param center zoom center
|
|
350
406
|
* @param effectTiming animation configurations
|
|
407
|
+
* @group View
|
|
351
408
|
*/
|
|
352
409
|
zoomTo: (
|
|
353
410
|
toRatio: number,
|
|
@@ -359,6 +416,7 @@ export interface IGraph<
|
|
|
359
416
|
* @param angle
|
|
360
417
|
* @param center
|
|
361
418
|
* @param effectTiming
|
|
419
|
+
* @group View
|
|
362
420
|
*/
|
|
363
421
|
rotate: (
|
|
364
422
|
angle: number,
|
|
@@ -370,6 +428,7 @@ export interface IGraph<
|
|
|
370
428
|
* @param toAngle
|
|
371
429
|
* @param center
|
|
372
430
|
* @param effectTiming
|
|
431
|
+
* @group View
|
|
373
432
|
*/
|
|
374
433
|
rotateTo: (
|
|
375
434
|
toAngle: number,
|
|
@@ -381,6 +440,7 @@ export interface IGraph<
|
|
|
381
440
|
* Transform the graph with a CSS-Transform-like syntax.
|
|
382
441
|
* @param options
|
|
383
442
|
* @param effectTiming
|
|
443
|
+
* @group View
|
|
384
444
|
*/
|
|
385
445
|
transform: (
|
|
386
446
|
options: GraphTransformOptions,
|
|
@@ -388,10 +448,12 @@ export interface IGraph<
|
|
|
388
448
|
) => Promise<void>;
|
|
389
449
|
/**
|
|
390
450
|
* Stop the current transition of transform immediately.
|
|
451
|
+
* @group View
|
|
391
452
|
*/
|
|
392
453
|
stopTransformTransition: () => void;
|
|
393
454
|
/**
|
|
394
455
|
* Return the center of viewport, e.g. for a 500 * 500 canvas, its center is [250, 250].
|
|
456
|
+
* @group View
|
|
395
457
|
*/
|
|
396
458
|
getViewportCenter: () => PointLike;
|
|
397
459
|
/**
|
|
@@ -481,7 +543,10 @@ export interface IGraph<
|
|
|
481
543
|
* @returns
|
|
482
544
|
* @group Data
|
|
483
545
|
*/
|
|
484
|
-
showItem: (
|
|
546
|
+
showItem: (
|
|
547
|
+
ids: ID | ID[],
|
|
548
|
+
options?: { disableAnimate?: boolean; shapeIds?: string[] },
|
|
549
|
+
) => void;
|
|
485
550
|
/**
|
|
486
551
|
* Hide the item(s).
|
|
487
552
|
* @param ids the item id(s) to be hidden
|
|
@@ -490,8 +555,12 @@ export interface IGraph<
|
|
|
490
555
|
*/
|
|
491
556
|
hideItem: (
|
|
492
557
|
ids: ID | ID[],
|
|
493
|
-
|
|
494
|
-
|
|
558
|
+
options?: {
|
|
559
|
+
disableAnimate?: boolean;
|
|
560
|
+
keepKeyShape?: boolean;
|
|
561
|
+
keepRelated?: boolean;
|
|
562
|
+
shapeIds?: string[];
|
|
563
|
+
},
|
|
495
564
|
) => void;
|
|
496
565
|
/**
|
|
497
566
|
* Make the item(s) to the front.
|
|
@@ -499,14 +568,14 @@ export interface IGraph<
|
|
|
499
568
|
* @returns
|
|
500
569
|
* @group Item
|
|
501
570
|
*/
|
|
502
|
-
frontItem: (ids: ID | ID[]
|
|
571
|
+
frontItem: (ids: ID | ID[]) => void;
|
|
503
572
|
/**
|
|
504
573
|
* Make the item(s) to the back.
|
|
505
574
|
* @param ids the item id(s) to back
|
|
506
575
|
* @returns
|
|
507
576
|
* @group Item
|
|
508
577
|
*/
|
|
509
|
-
backItem: (ids: ID | ID[]
|
|
578
|
+
backItem: (ids: ID | ID[]) => void;
|
|
510
579
|
/**
|
|
511
580
|
* Set state for the item(s).
|
|
512
581
|
* @param ids the id(s) for the item(s) to be set
|
|
@@ -515,12 +584,7 @@ export interface IGraph<
|
|
|
515
584
|
* @returns
|
|
516
585
|
* @group Item
|
|
517
586
|
*/
|
|
518
|
-
setItemState: (
|
|
519
|
-
ids: ID | ID[],
|
|
520
|
-
state: string,
|
|
521
|
-
value: boolean,
|
|
522
|
-
stack?: boolean,
|
|
523
|
-
) => void;
|
|
587
|
+
setItemState: (ids: ID | ID[], state: string, value: boolean) => void;
|
|
524
588
|
/**
|
|
525
589
|
* Get the state value for an item.
|
|
526
590
|
* @param id the id for the item
|
|
@@ -543,7 +607,7 @@ export interface IGraph<
|
|
|
543
607
|
* @returns
|
|
544
608
|
* @group Item
|
|
545
609
|
*/
|
|
546
|
-
clearItemState: (ids: ID | ID[], states?: string[]
|
|
610
|
+
clearItemState: (ids: ID | ID[], states?: string[]) => void;
|
|
547
611
|
|
|
548
612
|
/**
|
|
549
613
|
* Get the rendering bbox for a node / edge / combo, or the graph (when the id is not assigned).
|
|
@@ -559,42 +623,46 @@ export interface IGraph<
|
|
|
559
623
|
/**
|
|
560
624
|
* Get the visibility for a node / edge / combo.
|
|
561
625
|
* @param id the id for the node / edge / combo
|
|
562
|
-
* @returns visibility for the item, false for invisible or
|
|
626
|
+
* @returns visibility for the item, false for invisible or un-existence for the item
|
|
563
627
|
*/
|
|
564
628
|
getItemVisible: (id: ID) => boolean;
|
|
565
629
|
|
|
630
|
+
/**
|
|
631
|
+
* Get the visible shape ids in a node / edge / combo.
|
|
632
|
+
* @param id the id for the node / edge / combo
|
|
633
|
+
* @returns ids of the visible shapes
|
|
634
|
+
*/
|
|
635
|
+
getItemVisibleShapeIds: (id: ID) => string[];
|
|
636
|
+
|
|
566
637
|
// ===== combo operations =====
|
|
567
638
|
|
|
568
639
|
/**
|
|
569
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.
|
|
570
|
-
* Different from addData with combo type, this API update the succeeds' combo tree
|
|
571
|
-
* @param model combo user data
|
|
572
|
-
* @param
|
|
641
|
+
* Different from addData with combo type, this API update the succeeds' combo tree structures in the same time.
|
|
642
|
+
* @param model combo user data.
|
|
643
|
+
* @param childrenIds the ids of the children nodes / combos to move into the new combo.
|
|
573
644
|
* @returns whether success
|
|
574
645
|
* @group Combo
|
|
575
646
|
*/
|
|
576
|
-
addCombo: (
|
|
577
|
-
model: ComboUserModel,
|
|
578
|
-
childrenIds: ID[],
|
|
579
|
-
stack?: boolean,
|
|
580
|
-
) => ComboModel;
|
|
647
|
+
addCombo: (model: ComboUserModel, childrenIds: ID[]) => ComboModel;
|
|
581
648
|
/**
|
|
582
649
|
* Collapse a combo.
|
|
583
|
-
* @param comboId combo id or
|
|
650
|
+
* @param comboId combo id or ids' array.
|
|
584
651
|
* @group Combo
|
|
585
652
|
*/
|
|
586
|
-
collapseCombo: (comboIds: ID | ID[]
|
|
653
|
+
collapseCombo: (comboIds: ID | ID[]) => void;
|
|
587
654
|
/**
|
|
588
655
|
* Expand a combo.
|
|
589
656
|
* @group Combo
|
|
590
|
-
* @param
|
|
657
|
+
* @param comboId combo id or ids' array.
|
|
591
658
|
* @group Combo
|
|
592
659
|
*/
|
|
593
|
-
expandCombo: (comboIds: ID | ID[]
|
|
660
|
+
expandCombo: (comboIds: ID | ID[]) => void;
|
|
594
661
|
|
|
595
662
|
// ===== layout =====
|
|
596
663
|
/**
|
|
597
664
|
* Layout the graph (with current configurations if cfg is not assigned).
|
|
665
|
+
* @group Layout
|
|
598
666
|
*/
|
|
599
667
|
layout: (options?: LayoutOptions, disableAnimate?: boolean) => Promise<void>;
|
|
600
668
|
stopLayout: () => void;
|
|
@@ -623,6 +691,7 @@ export interface IGraph<
|
|
|
623
691
|
* @param behaviors behavior names or configs
|
|
624
692
|
* @param modes mode names
|
|
625
693
|
* @returns
|
|
694
|
+
* @group Interaction
|
|
626
695
|
*/
|
|
627
696
|
addBehaviors: (
|
|
628
697
|
behaviors: BehaviorOptionsOf<B> | BehaviorOptionsOf<B>[],
|
|
@@ -648,7 +717,7 @@ export interface IGraph<
|
|
|
648
717
|
/**
|
|
649
718
|
* Draw or update a G shape or group to the transient canvas.
|
|
650
719
|
* @param type shape type or item type
|
|
651
|
-
* @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
|
|
652
721
|
* @returns upserted shape or group
|
|
653
722
|
* @group Interaction
|
|
654
723
|
*/
|
|
@@ -712,6 +781,7 @@ export interface IGraph<
|
|
|
712
781
|
|
|
713
782
|
/**
|
|
714
783
|
* Determine if history (redo/undo) is enabled.
|
|
784
|
+
* @group History
|
|
715
785
|
*/
|
|
716
786
|
isHistoryEnabled: () => void;
|
|
717
787
|
|
|
@@ -719,56 +789,67 @@ export interface IGraph<
|
|
|
719
789
|
* Push the operation(s) onto the specified stack
|
|
720
790
|
* @param cmd commands to be pushed
|
|
721
791
|
* @param stackType undo/redo stack
|
|
792
|
+
* @group History
|
|
722
793
|
*/
|
|
723
794
|
pushStack: (cmd: Command[], stackType: StackType) => void;
|
|
724
795
|
/**
|
|
725
796
|
* Pause stacking operation.
|
|
797
|
+
* @group History
|
|
726
798
|
*/
|
|
727
799
|
pauseStack: () => void;
|
|
728
800
|
/**
|
|
729
801
|
* Resume stacking operation.
|
|
802
|
+
* @group History
|
|
730
803
|
*/
|
|
731
804
|
resumeStack: () => void;
|
|
732
805
|
/**
|
|
733
806
|
* Execute a callback without allowing any stacking operations.
|
|
734
807
|
* @param callback
|
|
808
|
+
* @group History
|
|
735
809
|
*/
|
|
736
810
|
executeWithNoStack: (callback: () => void) => void;
|
|
737
811
|
/**
|
|
738
812
|
* Retrieve the current redo stack which consists of operations that could be undone
|
|
813
|
+
* @group History
|
|
739
814
|
*/
|
|
740
815
|
getUndoStack: () => void;
|
|
741
816
|
|
|
742
817
|
/**
|
|
743
818
|
* Retrieve the current undo stack which consists of operations that were undone
|
|
819
|
+
* @group History
|
|
744
820
|
*/
|
|
745
821
|
getRedoStack: () => void;
|
|
746
822
|
|
|
747
823
|
/**
|
|
748
824
|
* Retrieve the complete history stack
|
|
749
825
|
* @returns
|
|
826
|
+
* @group History
|
|
750
827
|
*/
|
|
751
828
|
getStack: () => void;
|
|
752
829
|
|
|
753
830
|
/**
|
|
754
831
|
* Revert the last n operation(s) on the graph.
|
|
755
832
|
* @returns
|
|
833
|
+
* @group History
|
|
756
834
|
*/
|
|
757
835
|
undo: () => void;
|
|
758
836
|
|
|
759
837
|
/**
|
|
760
838
|
* Restore the operation that was last n reverted on the graph.
|
|
761
839
|
* @returns
|
|
840
|
+
* @group History
|
|
762
841
|
*/
|
|
763
842
|
redo: () => void;
|
|
764
843
|
|
|
765
844
|
/**
|
|
766
845
|
* Indicate whether there are any actions available in the undo stack.
|
|
846
|
+
* @group History
|
|
767
847
|
*/
|
|
768
848
|
canUndo: () => void;
|
|
769
849
|
|
|
770
850
|
/**
|
|
771
851
|
* Indicate whether there are any actions available in the redo stack.
|
|
852
|
+
* @group History
|
|
772
853
|
*/
|
|
773
854
|
canRedo: () => void;
|
|
774
855
|
|
|
@@ -776,6 +857,7 @@ export interface IGraph<
|
|
|
776
857
|
* Begin a historyBatch operation.
|
|
777
858
|
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
778
859
|
* treated as a single operation when undoing or redoing.
|
|
860
|
+
* @group History
|
|
779
861
|
*/
|
|
780
862
|
startHistoryBatch: () => void;
|
|
781
863
|
|
|
@@ -783,6 +865,7 @@ export interface IGraph<
|
|
|
783
865
|
* End a historyBatch operation.
|
|
784
866
|
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
785
867
|
* treated as a single operation when undoing or redoing.
|
|
868
|
+
* @group History
|
|
786
869
|
*/
|
|
787
870
|
stopHistoryBatch: () => void;
|
|
788
871
|
|
|
@@ -791,6 +874,7 @@ export interface IGraph<
|
|
|
791
874
|
* All operations performed inside callback will be treated as a composite operation
|
|
792
875
|
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
793
876
|
* @param callback The func containing operations to be batched together.
|
|
877
|
+
* @group History
|
|
794
878
|
*/
|
|
795
879
|
historyBatch: (callback: () => void) => void;
|
|
796
880
|
|
|
@@ -799,6 +883,7 @@ export interface IGraph<
|
|
|
799
883
|
* All operations performed inside callback will be treated as a composite operation
|
|
800
884
|
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
801
885
|
* @param callback The func containing operations to be batched together.
|
|
886
|
+
* @group History
|
|
802
887
|
*/
|
|
803
888
|
cleanHistory: (stackType?: StackType) => void;
|
|
804
889
|
// ===== tree operations =====
|
|
@@ -806,18 +891,16 @@ export interface IGraph<
|
|
|
806
891
|
* Collapse sub tree(s).
|
|
807
892
|
* @param ids Root id(s) of the sub trees.
|
|
808
893
|
* @param disableAnimate Whether disable the animations for this operation.
|
|
809
|
-
* @param stack Whether push this operation to stack.
|
|
810
894
|
* @returns
|
|
811
895
|
* @group Tree
|
|
812
896
|
*/
|
|
813
|
-
collapse: (ids: ID | ID[], disableAnimate?: boolean
|
|
897
|
+
collapse: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
814
898
|
/**
|
|
815
899
|
* Expand sub tree(s).
|
|
816
900
|
* @param ids Root id(s) of the sub trees.
|
|
817
901
|
* @param disableAnimate Whether disable the animations for this operation.
|
|
818
|
-
* @param stack Whether push this operation to stack.
|
|
819
902
|
* @returns
|
|
820
903
|
* @group Tree
|
|
821
904
|
*/
|
|
822
|
-
expand: (ids: ID | ID[], disableAnimate?: boolean
|
|
905
|
+
expand: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
823
906
|
}
|
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
|
|
|
@@ -33,7 +43,9 @@ export interface Hooks {
|
|
|
33
43
|
canvases: {
|
|
34
44
|
background: Canvas;
|
|
35
45
|
main: Canvas;
|
|
46
|
+
label: Canvas;
|
|
36
47
|
transient: Canvas;
|
|
48
|
+
transientLabel: Canvas;
|
|
37
49
|
};
|
|
38
50
|
}>;
|
|
39
51
|
// data
|
|
@@ -55,6 +67,7 @@ export interface Hooks {
|
|
|
55
67
|
graphCore: GraphCore;
|
|
56
68
|
theme: ThemeSpecification;
|
|
57
69
|
transientCanvas: Canvas;
|
|
70
|
+
transientLabelCanvas: Canvas;
|
|
58
71
|
tileOptimize?: {
|
|
59
72
|
tileFirstRender?: boolean | number;
|
|
60
73
|
tileFirstRenderSize?: number;
|
|
@@ -80,6 +93,25 @@ export interface Hooks {
|
|
|
80
93
|
enableStack?: boolean;
|
|
81
94
|
changes?: any;
|
|
82
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
|
+
}>;
|
|
83
115
|
itemvisibilitychange: IHook<{
|
|
84
116
|
ids: ID[];
|
|
85
117
|
graphCore?: GraphCore;
|
|
@@ -89,6 +121,8 @@ export interface Hooks {
|
|
|
89
121
|
enableStack?: boolean;
|
|
90
122
|
changes?: any;
|
|
91
123
|
keepKeyShape?: boolean;
|
|
124
|
+
keepRelated?: boolean;
|
|
125
|
+
shapeIds?: string[];
|
|
92
126
|
}>;
|
|
93
127
|
itemzindexchange: IHook<{
|
|
94
128
|
ids: ID[];
|
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,
|