@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/lib/types/graph.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ 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 { ComboModel, ComboUserModel } from './combo';
|
|
8
|
+
import { ComboDisplayModel, ComboModel, ComboShapesEncode, ComboUserModel } from './combo';
|
|
9
9
|
import { Padding, Point } from './common';
|
|
10
10
|
import { GraphData } from './data';
|
|
11
|
-
import { EdgeModel, EdgeUserModel } from './edge';
|
|
11
|
+
import { EdgeDisplayModel, EdgeModel, EdgeShapesEncode, EdgeUserModel } from './edge';
|
|
12
12
|
import type { StackType } from './history';
|
|
13
13
|
import { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from './item';
|
|
14
14
|
import { LayoutOptions } from './layout';
|
|
15
|
-
import { NodeModel, NodeUserModel } from './node';
|
|
15
|
+
import { NodeDisplayModel, NodeModel, NodeShapesEncode, NodeUserModel } from './node';
|
|
16
16
|
import { RendererName } from './render';
|
|
17
17
|
import { ComboMapper, EdgeMapper, NodeMapper, Specification } from './spec';
|
|
18
18
|
import { ThemeOptionsOf, ThemeRegistry } from './theme';
|
|
@@ -21,6 +21,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
21
21
|
[x: string]: any;
|
|
22
22
|
hooks: Hooks;
|
|
23
23
|
canvas: Canvas;
|
|
24
|
+
labelCanvas: Canvas;
|
|
24
25
|
transientCanvas: Canvas;
|
|
25
26
|
destroyed: boolean;
|
|
26
27
|
container: HTMLElement;
|
|
@@ -45,6 +46,19 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
45
46
|
* @param {NodeMapper | EdgeMapper | ComboMapper} mapper - The mapper to be updated.
|
|
46
47
|
* */
|
|
47
48
|
updateMapper: (type: ITEM_TYPE, mapper: NodeMapper | EdgeMapper | ComboMapper) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Updates the state configuration for the specified item type, corresponds to the nodeState, edgeState, or comboState on the graph spec.
|
|
51
|
+
* @param {string} itemType - The type of item (node, edge, or combo).
|
|
52
|
+
* @param {object} stateConfig - The state configuration to update.
|
|
53
|
+
* @param {string} updateType - The type of update ('mergeReplace' or 'replace'). Default is 'mergeReplace'.
|
|
54
|
+
**/
|
|
55
|
+
updateStateConfig: (itemType: ITEM_TYPE, stateConfig: {
|
|
56
|
+
[stateName: string]: ((data: NodeModel) => NodeDisplayModel) | NodeShapesEncode;
|
|
57
|
+
} | {
|
|
58
|
+
[stateName: string]: ((data: EdgeModel) => EdgeDisplayModel) | EdgeShapesEncode;
|
|
59
|
+
} | {
|
|
60
|
+
[stateName: string]: ((data: ComboModel) => ComboDisplayModel) | ComboShapesEncode;
|
|
61
|
+
}, updateType?: 'mergeReplace' | 'replace') => void;
|
|
48
62
|
/**
|
|
49
63
|
* Get the copy of specs(configurations).
|
|
50
64
|
* @returns graph specs
|
|
@@ -102,6 +116,13 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
102
116
|
* @group Data
|
|
103
117
|
*/
|
|
104
118
|
getRelatedEdgesData: (nodeId: ID, direction?: 'in' | 'out' | 'both') => EdgeModel[];
|
|
119
|
+
/**
|
|
120
|
+
* Get nearby edges from a start node using quad-tree collision detection.
|
|
121
|
+
* @param nodeId id of the start node
|
|
122
|
+
* @returns nearby edges' data array
|
|
123
|
+
* @group Data
|
|
124
|
+
*/
|
|
125
|
+
getNearEdgesData: (nodeId: ID, shouldBegin?: (edge: EdgeDisplayModel) => boolean) => EdgeModel[];
|
|
105
126
|
/**
|
|
106
127
|
* Get one-hop node ids from a start node.
|
|
107
128
|
* @param nodeId id of the start node
|
|
@@ -109,12 +130,6 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
109
130
|
* @group Data
|
|
110
131
|
*/
|
|
111
132
|
getNeighborNodesData: (nodeId: ID, direction?: 'in' | 'out' | 'both') => NodeModel[];
|
|
112
|
-
/**
|
|
113
|
-
* Retrieve the nearby edges for a given node using quadtree collision detection.
|
|
114
|
-
* @param nodeId target node's id
|
|
115
|
-
* @returns edges
|
|
116
|
-
*/
|
|
117
|
-
getNearEdgesForNode: (nodeId: ID) => EdgeModel[];
|
|
118
133
|
getComboChildrenData: (comboId: ID) => (ComboModel | NodeModel)[];
|
|
119
134
|
/**
|
|
120
135
|
* Get item type by id.
|
|
@@ -134,13 +149,15 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
134
149
|
* Change graph data.
|
|
135
150
|
* @param data new data
|
|
136
151
|
* @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)
|
|
152
|
+
* @param re-layout whether re-layout the nodes after data changing
|
|
137
153
|
* @returns
|
|
138
154
|
* @group Data
|
|
139
155
|
*/
|
|
140
|
-
changeData: (data: GraphData, type
|
|
156
|
+
changeData: (data: GraphData, type?: 'replace' | 'mergeReplace', relayout?: boolean) => void;
|
|
141
157
|
/**
|
|
142
158
|
* Clear the graph, means remove all the items on the graph.
|
|
143
159
|
* @returns
|
|
160
|
+
* @group Data
|
|
144
161
|
*/
|
|
145
162
|
clear: () => void;
|
|
146
163
|
/**
|
|
@@ -157,57 +174,63 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
157
174
|
* Add one or more node/edge/combo data to the graph.
|
|
158
175
|
* @param itemType item type
|
|
159
176
|
* @param model user data
|
|
160
|
-
* @
|
|
161
|
-
* @returns whehter success
|
|
177
|
+
* @returns whether success
|
|
162
178
|
* @group Data
|
|
163
179
|
*/
|
|
164
|
-
addData: (itemType: ITEM_TYPE, model: NodeUserModel | EdgeUserModel | ComboUserModel | NodeUserModel[] | EdgeUserModel[] | ComboUserModel[]
|
|
180
|
+
addData: (itemType: ITEM_TYPE, model: NodeUserModel | EdgeUserModel | ComboUserModel | NodeUserModel[] | EdgeUserModel[] | ComboUserModel[]) => NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
165
181
|
/**
|
|
166
182
|
* Remove one or more node/edge/combo data from the graph.
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
169
|
-
* @returns
|
|
183
|
+
* @param itemType the type the item(s) to be removed.
|
|
184
|
+
* @param id the id or the ids' array of the items to be removed.
|
|
185
|
+
* @returns whether success
|
|
170
186
|
* @group Data
|
|
171
187
|
*/
|
|
172
|
-
removeData: (itemType: ITEM_TYPE, id: ID | ID[]
|
|
188
|
+
removeData: (itemType: ITEM_TYPE, id: ID | ID[]) => void;
|
|
173
189
|
/**
|
|
174
190
|
* Update one or more node/edge/combo data on the graph.
|
|
175
|
-
* @param
|
|
176
|
-
* @param
|
|
177
|
-
* @param {boolean} stack whether push this operation to stack
|
|
191
|
+
* @param itemType the type the item(s) to be udated.
|
|
192
|
+
* @param models update configs.
|
|
178
193
|
* @group Data
|
|
179
194
|
*/
|
|
180
|
-
updateData: (itemType: ITEM_TYPE, model: Partial<NodeUserModel> | Partial<EdgeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<EdgeUserModel>[] | Partial<ComboUserModel>[]
|
|
195
|
+
updateData: (itemType: ITEM_TYPE, model: Partial<NodeUserModel> | Partial<EdgeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<EdgeUserModel>[] | Partial<ComboUserModel>[]>) => NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
181
196
|
/**
|
|
182
197
|
* Update one or more nodes' positions,
|
|
183
198
|
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
184
|
-
* @param models new configurations with x and y for every node, which has id field to indicate the specific item
|
|
185
|
-
* @param
|
|
199
|
+
* @param models new configurations with x and y for every node, which has id field to indicate the specific item.
|
|
200
|
+
* @param upsertAncestors whether update the ancestors in combo tree.
|
|
201
|
+
* @param disableAnimate whether disable the animation for this call.
|
|
202
|
+
* @param callback callback function after update nodes done.
|
|
186
203
|
* @group Data
|
|
187
204
|
*/
|
|
188
|
-
updateNodePosition: (models: Partial<NodeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void
|
|
205
|
+
updateNodePosition: (models: Partial<NodeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
189
206
|
/**
|
|
190
207
|
* Update one or more combos' positions, it is achieved by move the succeed nodes.
|
|
191
208
|
* Do not update other styles which leads to better performance than updating positions by updateData.
|
|
192
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
193
|
-
* @param
|
|
209
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item.
|
|
210
|
+
* @param upsertAncestors whether update the ancestors in combo tree.
|
|
211
|
+
* @param disableAnimate whether disable the animation for this call.
|
|
212
|
+
* @param callback callback function after update combos done.
|
|
194
213
|
* @group Data
|
|
195
214
|
*/
|
|
196
|
-
updateComboPosition: (models: Partial<ComboUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel) => void
|
|
215
|
+
updateComboPosition: (models: Partial<ComboUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, upsertAncestors?: boolean, disableAnimate?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel) => void) => NodeModel | ComboModel | NodeModel[] | ComboModel[];
|
|
197
216
|
/**
|
|
198
217
|
* Move one or more combos a distance (dx, dy) relatively,
|
|
199
218
|
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
200
219
|
* In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
|
|
201
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
202
|
-
* @param
|
|
203
|
-
* @
|
|
220
|
+
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item.
|
|
221
|
+
* @param dx the distance alone x-axis to move the combo.
|
|
222
|
+
* @param dy the distance alone y-axis to move the combo.
|
|
223
|
+
* @param upsertAncestors whether update the ancestors in the combo tree.
|
|
224
|
+
* @param callback callback function after move combo done.
|
|
225
|
+
* @group Combo
|
|
204
226
|
*/
|
|
205
|
-
moveCombo: (ids: ID[], dx: number, dy: number, upsertAncestors?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void
|
|
227
|
+
moveCombo: (ids: ID[], dx: number, dy: number, upsertAncestors?: boolean, callback?: (model: NodeModel | EdgeModel | ComboModel, canceled?: boolean) => void) => ComboModel[];
|
|
206
228
|
/**
|
|
207
229
|
* Move the graph with a relative vector.
|
|
208
230
|
* @param dx x of the relative vector
|
|
209
231
|
* @param dy y of the relative vector
|
|
210
232
|
* @param effectTiming animation configurations
|
|
233
|
+
* @group View
|
|
211
234
|
*/
|
|
212
235
|
translate: (distance: Partial<{
|
|
213
236
|
dx: number;
|
|
@@ -218,11 +241,13 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
218
241
|
* Move the graph and align to a point.
|
|
219
242
|
* @param point position on the canvas to align
|
|
220
243
|
* @param effectTiming animation configurations
|
|
244
|
+
* @group View
|
|
221
245
|
*/
|
|
222
246
|
translateTo: (point: PointLike, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
223
247
|
/**
|
|
224
248
|
* Return the current zoom level of camera.
|
|
225
249
|
* @returns current zoom
|
|
250
|
+
* @group View
|
|
226
251
|
*/
|
|
227
252
|
getZoom: () => number;
|
|
228
253
|
/**
|
|
@@ -230,6 +255,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
230
255
|
* @param ratio relative ratio to zoom
|
|
231
256
|
* @param center zoom center
|
|
232
257
|
* @param effectTiming animation configurations
|
|
258
|
+
* @group View
|
|
233
259
|
*/
|
|
234
260
|
zoom: (ratio: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
235
261
|
/**
|
|
@@ -237,6 +263,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
237
263
|
* @param toRatio specified ratio
|
|
238
264
|
* @param center zoom center
|
|
239
265
|
* @param effectTiming animation configurations
|
|
266
|
+
* @group View
|
|
240
267
|
*/
|
|
241
268
|
zoomTo: (toRatio: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
242
269
|
/**
|
|
@@ -244,6 +271,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
244
271
|
* @param angle
|
|
245
272
|
* @param center
|
|
246
273
|
* @param effectTiming
|
|
274
|
+
* @group View
|
|
247
275
|
*/
|
|
248
276
|
rotate: (angle: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
249
277
|
/**
|
|
@@ -251,20 +279,24 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
251
279
|
* @param toAngle
|
|
252
280
|
* @param center
|
|
253
281
|
* @param effectTiming
|
|
282
|
+
* @group View
|
|
254
283
|
*/
|
|
255
284
|
rotateTo: (toAngle: number, center?: Point, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
256
285
|
/**
|
|
257
286
|
* Transform the graph with a CSS-Transform-like syntax.
|
|
258
287
|
* @param options
|
|
259
288
|
* @param effectTiming
|
|
289
|
+
* @group View
|
|
260
290
|
*/
|
|
261
291
|
transform: (options: GraphTransformOptions, effectTiming?: CameraAnimationOptions) => Promise<void>;
|
|
262
292
|
/**
|
|
263
293
|
* Stop the current transition of transform immediately.
|
|
294
|
+
* @group View
|
|
264
295
|
*/
|
|
265
296
|
stopTransformTransition: () => void;
|
|
266
297
|
/**
|
|
267
298
|
* Return the center of viewport, e.g. for a 500 * 500 canvas, its center is [250, 250].
|
|
299
|
+
* @group View
|
|
268
300
|
*/
|
|
269
301
|
getViewportCenter: () => PointLike;
|
|
270
302
|
/**
|
|
@@ -339,28 +371,36 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
339
371
|
* @returns
|
|
340
372
|
* @group Data
|
|
341
373
|
*/
|
|
342
|
-
showItem: (ids: ID | ID[],
|
|
374
|
+
showItem: (ids: ID | ID[], options?: {
|
|
375
|
+
disableAnimate?: boolean;
|
|
376
|
+
shapeIds?: string[];
|
|
377
|
+
}) => void;
|
|
343
378
|
/**
|
|
344
379
|
* Hide the item(s).
|
|
345
380
|
* @param ids the item id(s) to be hidden
|
|
346
381
|
* @returns
|
|
347
382
|
* @group Item
|
|
348
383
|
*/
|
|
349
|
-
hideItem: (ids: ID | ID[],
|
|
384
|
+
hideItem: (ids: ID | ID[], options?: {
|
|
385
|
+
disableAnimate?: boolean;
|
|
386
|
+
keepKeyShape?: boolean;
|
|
387
|
+
keepRelated?: boolean;
|
|
388
|
+
shapeIds?: string[];
|
|
389
|
+
}) => void;
|
|
350
390
|
/**
|
|
351
391
|
* Make the item(s) to the front.
|
|
352
392
|
* @param ids the item id(s) to front
|
|
353
393
|
* @returns
|
|
354
394
|
* @group Item
|
|
355
395
|
*/
|
|
356
|
-
frontItem: (ids: ID | ID[]
|
|
396
|
+
frontItem: (ids: ID | ID[]) => void;
|
|
357
397
|
/**
|
|
358
398
|
* Make the item(s) to the back.
|
|
359
399
|
* @param ids the item id(s) to back
|
|
360
400
|
* @returns
|
|
361
401
|
* @group Item
|
|
362
402
|
*/
|
|
363
|
-
backItem: (ids: ID | ID[]
|
|
403
|
+
backItem: (ids: ID | ID[]) => void;
|
|
364
404
|
/**
|
|
365
405
|
* Set state for the item(s).
|
|
366
406
|
* @param ids the id(s) for the item(s) to be set
|
|
@@ -369,7 +409,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
369
409
|
* @returns
|
|
370
410
|
* @group Item
|
|
371
411
|
*/
|
|
372
|
-
setItemState: (ids: ID | ID[], state: string, value: boolean
|
|
412
|
+
setItemState: (ids: ID | ID[], state: string, value: boolean) => void;
|
|
373
413
|
/**
|
|
374
414
|
* Get the state value for an item.
|
|
375
415
|
* @param id the id for the item
|
|
@@ -392,7 +432,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
392
432
|
* @returns
|
|
393
433
|
* @group Item
|
|
394
434
|
*/
|
|
395
|
-
clearItemState: (ids: ID | ID[], states?: string[]
|
|
435
|
+
clearItemState: (ids: ID | ID[], states?: string[]) => void;
|
|
396
436
|
/**
|
|
397
437
|
* Get the rendering bbox for a node / edge / combo, or the graph (when the id is not assigned).
|
|
398
438
|
* @param id the id for the node / edge / combo, undefined for the whole graph
|
|
@@ -402,33 +442,40 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
402
442
|
/**
|
|
403
443
|
* Get the visibility for a node / edge / combo.
|
|
404
444
|
* @param id the id for the node / edge / combo
|
|
405
|
-
* @returns visibility for the item, false for invisible or
|
|
445
|
+
* @returns visibility for the item, false for invisible or un-existence for the item
|
|
406
446
|
*/
|
|
407
447
|
getItemVisible: (id: ID) => boolean;
|
|
448
|
+
/**
|
|
449
|
+
* Get the visible shape ids in a node / edge / combo.
|
|
450
|
+
* @param id the id for the node / edge / combo
|
|
451
|
+
* @returns ids of the visible shapes
|
|
452
|
+
*/
|
|
453
|
+
getItemVisibleShapeIds: (id: ID) => string[];
|
|
408
454
|
/**
|
|
409
455
|
* 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.
|
|
410
|
-
* Different from addData with combo type, this API update the succeeds' combo tree
|
|
411
|
-
* @param model combo user data
|
|
412
|
-
* @param
|
|
456
|
+
* Different from addData with combo type, this API update the succeeds' combo tree structures in the same time.
|
|
457
|
+
* @param model combo user data.
|
|
458
|
+
* @param childrenIds the ids of the children nodes / combos to move into the new combo.
|
|
413
459
|
* @returns whether success
|
|
414
460
|
* @group Combo
|
|
415
461
|
*/
|
|
416
|
-
addCombo: (model: ComboUserModel, childrenIds: ID[]
|
|
462
|
+
addCombo: (model: ComboUserModel, childrenIds: ID[]) => ComboModel;
|
|
417
463
|
/**
|
|
418
464
|
* Collapse a combo.
|
|
419
|
-
* @param comboId combo id or
|
|
465
|
+
* @param comboId combo id or ids' array.
|
|
420
466
|
* @group Combo
|
|
421
467
|
*/
|
|
422
|
-
collapseCombo: (comboIds: ID | ID[]
|
|
468
|
+
collapseCombo: (comboIds: ID | ID[]) => void;
|
|
423
469
|
/**
|
|
424
470
|
* Expand a combo.
|
|
425
471
|
* @group Combo
|
|
426
|
-
* @param
|
|
472
|
+
* @param comboId combo id or ids' array.
|
|
427
473
|
* @group Combo
|
|
428
474
|
*/
|
|
429
|
-
expandCombo: (comboIds: ID | ID[]
|
|
475
|
+
expandCombo: (comboIds: ID | ID[]) => void;
|
|
430
476
|
/**
|
|
431
477
|
* Layout the graph (with current configurations if cfg is not assigned).
|
|
478
|
+
* @group Layout
|
|
432
479
|
*/
|
|
433
480
|
layout: (options?: LayoutOptions, disableAnimate?: boolean) => Promise<void>;
|
|
434
481
|
stopLayout: () => void;
|
|
@@ -455,6 +502,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
455
502
|
* @param behaviors behavior names or configs
|
|
456
503
|
* @param modes mode names
|
|
457
504
|
* @returns
|
|
505
|
+
* @group Interaction
|
|
458
506
|
*/
|
|
459
507
|
addBehaviors: (behaviors: BehaviorOptionsOf<B> | BehaviorOptionsOf<B>[], modes: string | string[]) => void;
|
|
460
508
|
/**
|
|
@@ -476,7 +524,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
476
524
|
/**
|
|
477
525
|
* Draw or update a G shape or group to the transient canvas.
|
|
478
526
|
* @param type shape type or item type
|
|
479
|
-
* @param id new shape id or updated shape id for a
|
|
527
|
+
* @param id new shape id or updated shape id for a interaction shape, node/edge/combo id for item interaction group drawing
|
|
480
528
|
* @returns upserted shape or group
|
|
481
529
|
* @group Interaction
|
|
482
530
|
*/
|
|
@@ -527,68 +575,82 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
527
575
|
}) => void;
|
|
528
576
|
/**
|
|
529
577
|
* Determine if history (redo/undo) is enabled.
|
|
578
|
+
* @group History
|
|
530
579
|
*/
|
|
531
580
|
isHistoryEnabled: () => void;
|
|
532
581
|
/**
|
|
533
582
|
* Push the operation(s) onto the specified stack
|
|
534
583
|
* @param cmd commands to be pushed
|
|
535
584
|
* @param stackType undo/redo stack
|
|
585
|
+
* @group History
|
|
536
586
|
*/
|
|
537
587
|
pushStack: (cmd: Command[], stackType: StackType) => void;
|
|
538
588
|
/**
|
|
539
589
|
* Pause stacking operation.
|
|
590
|
+
* @group History
|
|
540
591
|
*/
|
|
541
592
|
pauseStack: () => void;
|
|
542
593
|
/**
|
|
543
594
|
* Resume stacking operation.
|
|
595
|
+
* @group History
|
|
544
596
|
*/
|
|
545
597
|
resumeStack: () => void;
|
|
546
598
|
/**
|
|
547
599
|
* Execute a callback without allowing any stacking operations.
|
|
548
600
|
* @param callback
|
|
601
|
+
* @group History
|
|
549
602
|
*/
|
|
550
603
|
executeWithNoStack: (callback: () => void) => void;
|
|
551
604
|
/**
|
|
552
605
|
* Retrieve the current redo stack which consists of operations that could be undone
|
|
606
|
+
* @group History
|
|
553
607
|
*/
|
|
554
608
|
getUndoStack: () => void;
|
|
555
609
|
/**
|
|
556
610
|
* Retrieve the current undo stack which consists of operations that were undone
|
|
611
|
+
* @group History
|
|
557
612
|
*/
|
|
558
613
|
getRedoStack: () => void;
|
|
559
614
|
/**
|
|
560
615
|
* Retrieve the complete history stack
|
|
561
616
|
* @returns
|
|
617
|
+
* @group History
|
|
562
618
|
*/
|
|
563
619
|
getStack: () => void;
|
|
564
620
|
/**
|
|
565
621
|
* Revert the last n operation(s) on the graph.
|
|
566
622
|
* @returns
|
|
623
|
+
* @group History
|
|
567
624
|
*/
|
|
568
625
|
undo: () => void;
|
|
569
626
|
/**
|
|
570
627
|
* Restore the operation that was last n reverted on the graph.
|
|
571
628
|
* @returns
|
|
629
|
+
* @group History
|
|
572
630
|
*/
|
|
573
631
|
redo: () => void;
|
|
574
632
|
/**
|
|
575
633
|
* Indicate whether there are any actions available in the undo stack.
|
|
634
|
+
* @group History
|
|
576
635
|
*/
|
|
577
636
|
canUndo: () => void;
|
|
578
637
|
/**
|
|
579
638
|
* Indicate whether there are any actions available in the redo stack.
|
|
639
|
+
* @group History
|
|
580
640
|
*/
|
|
581
641
|
canRedo: () => void;
|
|
582
642
|
/**
|
|
583
643
|
* Begin a historyBatch operation.
|
|
584
644
|
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
585
645
|
* treated as a single operation when undoing or redoing.
|
|
646
|
+
* @group History
|
|
586
647
|
*/
|
|
587
648
|
startHistoryBatch: () => void;
|
|
588
649
|
/**
|
|
589
650
|
* End a historyBatch operation.
|
|
590
651
|
* Any operations performed between `startHistoryBatch` and `stopHistoryBatch` are grouped together.
|
|
591
652
|
* treated as a single operation when undoing or redoing.
|
|
653
|
+
* @group History
|
|
592
654
|
*/
|
|
593
655
|
stopHistoryBatch: () => void;
|
|
594
656
|
/**
|
|
@@ -596,6 +658,7 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
596
658
|
* All operations performed inside callback will be treated as a composite operation
|
|
597
659
|
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
598
660
|
* @param callback The func containing operations to be batched together.
|
|
661
|
+
* @group History
|
|
599
662
|
*/
|
|
600
663
|
historyBatch: (callback: () => void) => void;
|
|
601
664
|
/**
|
|
@@ -603,24 +666,23 @@ export interface IGraph<B extends BehaviorRegistry = BehaviorRegistry, T extends
|
|
|
603
666
|
* All operations performed inside callback will be treated as a composite operation
|
|
604
667
|
* more convenient way without manually invoking `startHistoryBatch` and `stopHistoryBatch`.
|
|
605
668
|
* @param callback The func containing operations to be batched together.
|
|
669
|
+
* @group History
|
|
606
670
|
*/
|
|
607
671
|
cleanHistory: (stackType?: StackType) => void;
|
|
608
672
|
/**
|
|
609
673
|
* Collapse sub tree(s).
|
|
610
674
|
* @param ids Root id(s) of the sub trees.
|
|
611
675
|
* @param disableAnimate Whether disable the animations for this operation.
|
|
612
|
-
* @param stack Whether push this operation to stack.
|
|
613
676
|
* @returns
|
|
614
677
|
* @group Tree
|
|
615
678
|
*/
|
|
616
|
-
collapse: (ids: ID | ID[], disableAnimate?: boolean
|
|
679
|
+
collapse: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
617
680
|
/**
|
|
618
681
|
* Expand sub tree(s).
|
|
619
682
|
* @param ids Root id(s) of the sub trees.
|
|
620
683
|
* @param disableAnimate Whether disable the animations for this operation.
|
|
621
|
-
* @param stack Whether push this operation to stack.
|
|
622
684
|
* @returns
|
|
623
685
|
* @group Tree
|
|
624
686
|
*/
|
|
625
|
-
expand: (ids: ID | ID[], disableAnimate?: boolean
|
|
687
|
+
expand: (ids: ID | ID[], disableAnimate?: boolean) => void;
|
|
626
688
|
}
|
package/lib/types/hook.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ 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 { EdgeModel, EdgeModelData } from './edge';
|
|
6
|
+
import { EdgeDisplayModel, EdgeModel, EdgeModelData, EdgeShapesEncode } from './edge';
|
|
7
7
|
import { ITEM_TYPE, ShapeStyle, SHAPE_TYPE } from './item';
|
|
8
8
|
import { LayoutOptions } from './layout';
|
|
9
|
-
import { NodeModel, NodeModelData } from './node';
|
|
9
|
+
import { NodeDisplayModel, NodeModel, NodeModelData, NodeShapesEncode } from './node';
|
|
10
10
|
import { ThemeSpecification } from './theme';
|
|
11
11
|
import { GraphTransformOptions } from './view';
|
|
12
|
-
import { ComboModel } from './combo';
|
|
12
|
+
import { ComboDisplayModel, ComboModel, ComboShapesEncode } from './combo';
|
|
13
13
|
import { Plugin as PluginBase } from './plugin';
|
|
14
14
|
import { ComboMapper, EdgeMapper, NodeMapper } from './spec';
|
|
15
15
|
export interface IHook<T> {
|
|
@@ -30,7 +30,9 @@ export interface Hooks {
|
|
|
30
30
|
canvases: {
|
|
31
31
|
background: Canvas;
|
|
32
32
|
main: Canvas;
|
|
33
|
+
label: Canvas;
|
|
33
34
|
transient: Canvas;
|
|
35
|
+
transientLabel: Canvas;
|
|
34
36
|
};
|
|
35
37
|
}>;
|
|
36
38
|
datachange: IHook<{
|
|
@@ -51,6 +53,7 @@ export interface Hooks {
|
|
|
51
53
|
graphCore: GraphCore;
|
|
52
54
|
theme: ThemeSpecification;
|
|
53
55
|
transientCanvas: Canvas;
|
|
56
|
+
transientLabelCanvas: Canvas;
|
|
54
57
|
tileOptimize?: {
|
|
55
58
|
tileFirstRender?: boolean | number;
|
|
56
59
|
tileFirstRenderSize?: number;
|
|
@@ -77,6 +80,16 @@ export interface Hooks {
|
|
|
77
80
|
enableStack?: boolean;
|
|
78
81
|
changes?: any;
|
|
79
82
|
}>;
|
|
83
|
+
itemstateconfigchange: IHook<{
|
|
84
|
+
itemType: ITEM_TYPE;
|
|
85
|
+
stateConfig: {
|
|
86
|
+
[stateName: string]: ((data: NodeModel) => NodeDisplayModel) | NodeShapesEncode;
|
|
87
|
+
} | {
|
|
88
|
+
[stateName: string]: ((data: EdgeModel) => EdgeDisplayModel) | EdgeShapesEncode;
|
|
89
|
+
} | {
|
|
90
|
+
[stateName: string]: ((data: ComboModel) => ComboDisplayModel) | ComboShapesEncode;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
80
93
|
itemvisibilitychange: IHook<{
|
|
81
94
|
ids: ID[];
|
|
82
95
|
graphCore?: GraphCore;
|
|
@@ -86,6 +99,8 @@ export interface Hooks {
|
|
|
86
99
|
enableStack?: boolean;
|
|
87
100
|
changes?: any;
|
|
88
101
|
keepKeyShape?: boolean;
|
|
102
|
+
keepRelated?: boolean;
|
|
103
|
+
shapeIds?: string[];
|
|
89
104
|
}>;
|
|
90
105
|
itemzindexchange: IHook<{
|
|
91
106
|
ids: ID[];
|
package/lib/types/index.d.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 { NodeDisplayModel, NodeModel, NodeUserModel, NodeEncode, NodeShapeStyles, NodeLabelPosition, NodeShapesEncode, NodeModelData, } from './node';
|
|
5
6
|
export type { ComboDisplayModel, ComboLabelPosition, ComboModel, ComboModelData, ComboShapeStyles, ComboShapesEncode, ComboUserModel, } from './combo';
|
|
6
7
|
export type { Point } from './common';
|
package/lib/types/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluginBase = exports.isLayoutWorkerized = exports.isImmediatelyInvokedLayoutOptions = void 0;
|
|
3
|
+
exports.PluginBase = exports.isLayoutWorkerized = exports.isImmediatelyInvokedLayoutOptions = exports.Behavior = void 0;
|
|
4
|
+
var behavior_1 = require("./behavior");
|
|
5
|
+
Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return behavior_1.Behavior; } });
|
|
4
6
|
var layout_1 = require("./layout"); // function 不应该放在 types 文件下面
|
|
5
7
|
Object.defineProperty(exports, "isImmediatelyInvokedLayoutOptions", { enumerable: true, get: function () { return layout_1.isImmediatelyInvokedLayoutOptions; } });
|
|
6
8
|
Object.defineProperty(exports, "isLayoutWorkerized", { enumerable: true, get: function () { return layout_1.isLayoutWorkerized; } });
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["types/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["types/index.ts"],"names":[],"mappings":";;;AAEA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AAyCjB,mCAGkB,CAAC,4BAA4B;AAF7C,2HAAA,iCAAiC,OAAA;AACjC,4GAAA,kBAAkB,OAAA;AAQpB,mCAAgD;AAAvC,oGAAA,MAAM,OAAc"}
|