@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g6",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.28",
|
|
4
4
|
"description": "A Graph Visualization Framework in JavaScript",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -11,28 +11,6 @@
|
|
|
11
11
|
"lib",
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"dev": "vite",
|
|
16
|
-
"start": "rimraf ./lib && tsc --module commonjs --outDir lib --watch",
|
|
17
|
-
"build:umd": "rimraf ./dist && rollup -c && npm run size",
|
|
18
|
-
"build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib",
|
|
19
|
-
"build:esm": "rimraf ./esm && tsc --module ESNext --outDir esm",
|
|
20
|
-
"build": "run-p build:*",
|
|
21
|
-
"bundle-vis": "cross-env BUNDLE_VIS=1 npm run build:umd",
|
|
22
|
-
"size": "limit-size",
|
|
23
|
-
"prepublishOnly": "npm run ci",
|
|
24
|
-
"doc": "rimraf ../site/docs/_apis && typedoc",
|
|
25
|
-
"lint": "eslint ./src ./tests --quiet && prettier ./src ./tests --check",
|
|
26
|
-
"lint-staged": "lint-staged",
|
|
27
|
-
"fix": "eslint ./src ./tests --fix && prettier ./src ./tests --write ",
|
|
28
|
-
"test": "jest",
|
|
29
|
-
"test:integration": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest tests/integration/ --config jest.node.config.js --coverage -i --logHeapUsage --detectOpenHandles",
|
|
30
|
-
"test:integration_one": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest tests/integration/data-process-parallel-edges.spec.ts --config jest.node.config.js --coverage -i --logHeapUsage --detectOpenHandles",
|
|
31
|
-
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/item-animate-spec.ts",
|
|
32
|
-
"test-behavior": "DEBUG_MODE=1 jest --watch ./tests/unit/item-3d-spec.ts",
|
|
33
|
-
"ci": "run-s lint build",
|
|
34
|
-
"coverage": "jest --coverage"
|
|
35
|
-
},
|
|
36
14
|
"keywords": [
|
|
37
15
|
"antv",
|
|
38
16
|
"g6",
|
|
@@ -42,24 +20,17 @@
|
|
|
42
20
|
"graph visualization",
|
|
43
21
|
"relational data"
|
|
44
22
|
],
|
|
45
|
-
"lint-staged": {
|
|
46
|
-
"*.{ts,tsx}": [
|
|
47
|
-
"eslint --fix",
|
|
48
|
-
"prettier --write",
|
|
49
|
-
"git add"
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
23
|
"dependencies": {
|
|
53
24
|
"@ant-design/colors": "^7.0.0",
|
|
54
25
|
"@antv/algorithm": "^0.1.26",
|
|
55
26
|
"@antv/event-emitter": "latest",
|
|
56
|
-
"@antv/g": "^5.18.
|
|
57
|
-
"@antv/g-canvas": "^1.11.
|
|
58
|
-
"@antv/g-plugin-3d": "^1.9.
|
|
59
|
-
"@antv/g-plugin-control": "^1.9.
|
|
60
|
-
"@antv/g-plugin-dragndrop": "^1.8.
|
|
61
|
-
"@antv/g-svg": "^1.10.
|
|
62
|
-
"@antv/g-webgl": "^1.9.
|
|
27
|
+
"@antv/g": "^5.18.23",
|
|
28
|
+
"@antv/g-canvas": "^1.11.25",
|
|
29
|
+
"@antv/g-plugin-3d": "^1.9.26",
|
|
30
|
+
"@antv/g-plugin-control": "^1.9.17",
|
|
31
|
+
"@antv/g-plugin-dragndrop": "^1.8.17",
|
|
32
|
+
"@antv/g-svg": "^1.10.21",
|
|
33
|
+
"@antv/g-webgl": "^1.9.29",
|
|
63
34
|
"@antv/graphlib": "^2.0.2",
|
|
64
35
|
"@antv/gui": "0.5.1-alpha.1",
|
|
65
36
|
"@antv/hierarchy": "latest",
|
|
@@ -73,33 +44,23 @@
|
|
|
73
44
|
"tslib": "^2.5.0"
|
|
74
45
|
},
|
|
75
46
|
"devDependencies": {
|
|
76
|
-
"@antv/g6-plugin-map-view": "workspace:*",
|
|
77
47
|
"@rollup/plugin-terser": "^0.4.3",
|
|
78
|
-
"@types/gl": "6.0.2",
|
|
79
48
|
"@types/jest": "^29.5.1",
|
|
80
49
|
"@types/jsdom": "^21.1.1",
|
|
81
50
|
"@types/node": "13.11.1",
|
|
82
|
-
"@types/pixelmatch": "^5.2.4",
|
|
83
|
-
"@types/pngjs": "^6.0.1",
|
|
84
51
|
"@types/xmlserializer": "^0.6.3",
|
|
85
52
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
|
86
53
|
"@typescript-eslint/parser": "^6.5.0",
|
|
87
54
|
"@umijs/fabric": "^2.0.0",
|
|
88
55
|
"babel-loader": "^8.0.6",
|
|
89
|
-
"canvas": "2.11.0",
|
|
90
56
|
"cross-env": "^7.0.3",
|
|
91
57
|
"eslint": "^8.48.0",
|
|
92
58
|
"eslint-plugin-import": "^2.28.1",
|
|
93
|
-
"
|
|
94
|
-
"jest": "^
|
|
95
|
-
"jest-environment-jsdom": "",
|
|
96
|
-
"jest-extended": "^0.11.2",
|
|
59
|
+
"jest": "^29.5.1",
|
|
60
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
97
61
|
"jsdom": "^19.0.0",
|
|
98
62
|
"limit-size": "^0.1.4",
|
|
99
|
-
"lint-staged": "^10.5.4",
|
|
100
63
|
"npm-run-all": "^4.1.5",
|
|
101
|
-
"pixelmatch": "5.3.0",
|
|
102
|
-
"pngjs": "^6.0.0",
|
|
103
64
|
"prettier": "^3.0.3",
|
|
104
65
|
"rimraf": "^3.0.0",
|
|
105
66
|
"rollup": "^2.79.1",
|
|
@@ -107,12 +68,14 @@
|
|
|
107
68
|
"rollup-plugin-polyfill-node": "^0.8.0",
|
|
108
69
|
"rollup-plugin-typescript": "^1.0.1",
|
|
109
70
|
"rollup-plugin-visualizer": "^5.6.0",
|
|
110
|
-
"
|
|
71
|
+
"stats.js": "^0.17.0",
|
|
72
|
+
"ts-jest": "^29.1.1",
|
|
111
73
|
"typedoc": "^0.25.0",
|
|
112
74
|
"typedoc-plugin-markdown": "^3.16.0",
|
|
113
75
|
"typescript": "5.1.6",
|
|
114
76
|
"vite": "^4.2.2",
|
|
115
|
-
"xmlserializer": "^0.6.1"
|
|
77
|
+
"xmlserializer": "^0.6.1",
|
|
78
|
+
"@antv/g6-plugin-map-view": "0.0.5"
|
|
116
79
|
},
|
|
117
80
|
"limit-size": [
|
|
118
81
|
{
|
|
@@ -131,5 +94,26 @@
|
|
|
131
94
|
"url": "https://github.com/antvis/g6/issues"
|
|
132
95
|
},
|
|
133
96
|
"repository": "git@github.com/antvis/g6.git",
|
|
134
|
-
"license": "MIT"
|
|
135
|
-
|
|
97
|
+
"license": "MIT",
|
|
98
|
+
"scripts": {
|
|
99
|
+
"dev": "vite",
|
|
100
|
+
"start": "rimraf ./lib && tsc --module commonjs --outDir lib --watch",
|
|
101
|
+
"build:umd": "rimraf ./dist && rollup -c && npm run size",
|
|
102
|
+
"build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib",
|
|
103
|
+
"build:esm": "rimraf ./esm && tsc --module ESNext --outDir esm",
|
|
104
|
+
"build:esm:watch": "rimraf ./esm && tsc --module ESNext --outDir esm --watch",
|
|
105
|
+
"build": "run-p build:*",
|
|
106
|
+
"bundle-vis": "cross-env BUNDLE_VIS=1 npm run build:umd",
|
|
107
|
+
"size": "limit-size",
|
|
108
|
+
"doc": "rimraf ../site/docs/_apis && typedoc",
|
|
109
|
+
"lint": "eslint ./src ./tests --quiet && prettier ./src ./tests --check",
|
|
110
|
+
"fix": "eslint ./src ./tests --fix && prettier ./src ./tests --write ",
|
|
111
|
+
"test": "jest",
|
|
112
|
+
"test:integration": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest tests/integration/ --config jest.node.config.js --coverage --logHeapUsage --detectOpenHandles",
|
|
113
|
+
"test:integration_one": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest tests/integration/behavior --config jest.node.config.js --logHeapUsage --detectOpenHandles",
|
|
114
|
+
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/item-animate-spec.ts",
|
|
115
|
+
"test-behavior": "DEBUG_MODE=1 jest --watch ./tests/unit/item-3d-spec.ts",
|
|
116
|
+
"ci": "run-s lint build test:integration",
|
|
117
|
+
"coverage": "jest --coverage"
|
|
118
|
+
}
|
|
119
|
+
}
|
package/src/index.ts
CHANGED
package/src/item/combo.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComboDisplayModel, ComboModel } from 'types';
|
|
2
1
|
import { Group, Tuple3Number } from '@antv/g';
|
|
3
2
|
import { clone, throttle } from '@antv/util';
|
|
4
|
-
import {
|
|
3
|
+
import { ComboDisplayModel, ComboModel, IGraph } from '../types';
|
|
4
|
+
import { DisplayMapper, LodLevelRanges, State } from '../types/item';
|
|
5
5
|
import { ComboStyleSet } from '../types/theme';
|
|
6
6
|
import { ComboModelData, ComboUserModelData } from '../types/combo';
|
|
7
7
|
import { Point } from '../types/common';
|
|
@@ -14,8 +14,10 @@ import Node from './node';
|
|
|
14
14
|
|
|
15
15
|
interface IProps {
|
|
16
16
|
model: ComboModel;
|
|
17
|
+
graph: IGraph;
|
|
17
18
|
renderExtensions: any;
|
|
18
19
|
containerGroup: Group;
|
|
20
|
+
labelContainerGroup: Group;
|
|
19
21
|
mapper?: DisplayMapper;
|
|
20
22
|
stateMapper?: {
|
|
21
23
|
[stateName: string]: DisplayMapper;
|
|
@@ -23,7 +25,7 @@ interface IProps {
|
|
|
23
25
|
zoom?: number;
|
|
24
26
|
theme: {
|
|
25
27
|
styles: ComboStyleSet;
|
|
26
|
-
|
|
28
|
+
lodLevels: LodLevelRanges;
|
|
27
29
|
};
|
|
28
30
|
device?: any; // for 3d shapes
|
|
29
31
|
onframe?: Function;
|
|
@@ -79,7 +81,7 @@ export default class Combo extends Node {
|
|
|
79
81
|
animate = true,
|
|
80
82
|
onfinish: Function = () => {},
|
|
81
83
|
) {
|
|
82
|
-
if (displayModel.data.collapsed) {
|
|
84
|
+
if (displayModel.data.collapsed && this.themeStyles.collapsed) {
|
|
83
85
|
Object.keys(this.themeStyles.collapsed).forEach((shapeId) => {
|
|
84
86
|
displayModel.data[shapeId] = displayModel.data[shapeId] || {};
|
|
85
87
|
displayModel.data[shapeId] = {
|
|
@@ -103,6 +105,7 @@ export default class Combo extends Node {
|
|
|
103
105
|
*/
|
|
104
106
|
public forceUpdate = throttle(
|
|
105
107
|
() => {
|
|
108
|
+
if (this.destroyed || !this.shapeMap.keyShape) return;
|
|
106
109
|
this.updateModelByBounds(this.displayModel as ComboDisplayModel);
|
|
107
110
|
if (!this.destroyed) this.draw(this.displayModel as ComboDisplayModel);
|
|
108
111
|
},
|
|
@@ -261,6 +264,7 @@ export default class Combo extends Node {
|
|
|
261
264
|
// @ts-ignore
|
|
262
265
|
public clone(
|
|
263
266
|
containerGroup: Group,
|
|
267
|
+
labelContainerGroup: Group,
|
|
264
268
|
shapeIds?: string[],
|
|
265
269
|
disableAnimate?: boolean,
|
|
266
270
|
getCombinedBounds?: () =>
|
|
@@ -291,21 +295,26 @@ export default class Combo extends Node {
|
|
|
291
295
|
clonedModel.data.disableAnimate = disableAnimate;
|
|
292
296
|
const clonedNode = new Combo({
|
|
293
297
|
model: clonedModel,
|
|
298
|
+
graph: this.graph,
|
|
294
299
|
renderExtensions: this.renderExtensions,
|
|
295
300
|
containerGroup,
|
|
301
|
+
labelContainerGroup,
|
|
296
302
|
mapper: this.mapper,
|
|
297
303
|
stateMapper: this.stateMapper,
|
|
298
304
|
zoom: this.zoom,
|
|
299
305
|
theme: {
|
|
300
306
|
styles: this.themeStyles,
|
|
301
|
-
|
|
307
|
+
lodLevels: this.lodLevels,
|
|
302
308
|
},
|
|
303
309
|
getCombinedBounds: getCombinedBounds || this.getCombinedBounds,
|
|
304
310
|
getChildren: getChildren || this.getChildren,
|
|
305
311
|
});
|
|
306
312
|
Object.keys(this.shapeMap).forEach((shapeId) => {
|
|
307
|
-
if (!this.shapeMap[shapeId].isVisible())
|
|
313
|
+
if (!this.shapeMap[shapeId].isVisible()) {
|
|
308
314
|
clonedNode.shapeMap[shapeId].hide();
|
|
315
|
+
} else {
|
|
316
|
+
clonedNode.shapeMap[shapeId]?.show();
|
|
317
|
+
}
|
|
309
318
|
});
|
|
310
319
|
return clonedNode;
|
|
311
320
|
}
|
package/src/item/edge.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Group } from '@antv/g';
|
|
2
2
|
import { clone, throttle } from '@antv/util';
|
|
3
|
-
import { EdgeDisplayModel, EdgeModel, ID, Point } from '../types';
|
|
3
|
+
import { EdgeDisplayModel, EdgeModel, ID, IGraph, Point } from '../types';
|
|
4
4
|
import { EdgeModelData } from '../types/edge';
|
|
5
|
-
import { DisplayMapper, State,
|
|
5
|
+
import { DisplayMapper, State, LodLevelRanges } from '../types/item';
|
|
6
6
|
import { updateShapes } from '../util/shape';
|
|
7
7
|
import { animateShapes } from '../util/animate';
|
|
8
8
|
import { EdgeStyleSet } from '../types/theme';
|
|
9
9
|
import { isSamePoint, getNearestPoint } from '../util/point';
|
|
10
|
+
import { isPolylineWithObstacleAvoidance } from '../util/polyline';
|
|
10
11
|
import Item from './item';
|
|
11
12
|
import Node from './node';
|
|
12
13
|
import Combo from './combo';
|
|
13
14
|
|
|
14
15
|
interface IProps {
|
|
16
|
+
graph: IGraph;
|
|
15
17
|
model: EdgeModel;
|
|
16
18
|
renderExtensions: any; // TODO: type
|
|
17
19
|
containerGroup: Group;
|
|
20
|
+
labelContainerGroup?: Group; // TODO: optional?
|
|
18
21
|
mapper?: DisplayMapper;
|
|
19
22
|
stateMapper?: {
|
|
20
23
|
[stateName: string]: DisplayMapper;
|
|
@@ -24,7 +27,7 @@ interface IProps {
|
|
|
24
27
|
zoom?: number;
|
|
25
28
|
theme: {
|
|
26
29
|
styles: EdgeStyleSet;
|
|
27
|
-
|
|
30
|
+
lodLevels: LodLevelRanges;
|
|
28
31
|
};
|
|
29
32
|
onframe?: Function;
|
|
30
33
|
nodeMap?: Map<ID, Node>;
|
|
@@ -59,13 +62,6 @@ export default class Edge extends Item {
|
|
|
59
62
|
this.sourceItem = sourceItem;
|
|
60
63
|
this.targetItem = targetItem;
|
|
61
64
|
this.nodeMap = nodeMap;
|
|
62
|
-
// todo: combo
|
|
63
|
-
if (sourceItem.getType() === 'node') {
|
|
64
|
-
this.nodeMap.set(sourceItem.getID(), sourceItem as Node);
|
|
65
|
-
}
|
|
66
|
-
if (sourceItem.getType() === 'node') {
|
|
67
|
-
this.nodeMap.set(targetItem.getID(), targetItem as Node);
|
|
68
|
-
}
|
|
69
65
|
if (!props.delayFirstDraw) {
|
|
70
66
|
this.draw(this.displayModel);
|
|
71
67
|
}
|
|
@@ -92,12 +88,20 @@ export default class Edge extends Item {
|
|
|
92
88
|
diffData,
|
|
93
89
|
diffState,
|
|
94
90
|
);
|
|
91
|
+
if (this.shapeMap.labelShape) {
|
|
92
|
+
this.shapeMap.labelShape.attributes.dataIsLabel = true;
|
|
93
|
+
}
|
|
94
|
+
if (this.shapeMap.labelBackgroundShape) {
|
|
95
|
+
this.shapeMap.labelBackgroundShape.attributes.dataIsLabelBackground =
|
|
96
|
+
true;
|
|
97
|
+
}
|
|
95
98
|
|
|
96
99
|
// add shapes to group, and update shapeMap
|
|
97
100
|
this.shapeMap = updateShapes(
|
|
98
101
|
this.shapeMap,
|
|
99
102
|
{ ...shapeMap, ...this.afterDrawShapeMap },
|
|
100
103
|
this.group,
|
|
104
|
+
this.labelGroup,
|
|
101
105
|
);
|
|
102
106
|
|
|
103
107
|
// handle shape's and group's animate
|
|
@@ -122,13 +126,16 @@ export default class Edge extends Item {
|
|
|
122
126
|
const timing = firstRendering ? 'buildIn' : 'update';
|
|
123
127
|
// handle shape's animate
|
|
124
128
|
if (animate && !disableAnimate && usingAnimates[timing]?.length) {
|
|
129
|
+
const { current = [], previous = [] } = diffState || {};
|
|
125
130
|
this.animations = animateShapes(
|
|
126
131
|
usingAnimates,
|
|
127
132
|
targetStyles, // targetStylesMap
|
|
128
133
|
this.shapeMap, // shapeMap
|
|
129
|
-
|
|
134
|
+
undefined,
|
|
135
|
+
[this.group, this.labelGroup],
|
|
130
136
|
firstRendering ? 'buildIn' : 'update',
|
|
131
|
-
|
|
137
|
+
current.concat(previous).map((state) => state.name) ||
|
|
138
|
+
this.changedStates,
|
|
132
139
|
this.animateFrameListener,
|
|
133
140
|
(canceled) => onfinish(displayModel.id, canceled),
|
|
134
141
|
);
|
|
@@ -139,18 +146,26 @@ export default class Edge extends Item {
|
|
|
139
146
|
this.hide(false);
|
|
140
147
|
}
|
|
141
148
|
this.changedStates = [];
|
|
149
|
+
|
|
150
|
+
this.labelGroup.children
|
|
151
|
+
.filter((element) => element.attributes.dataIsLabel)
|
|
152
|
+
.forEach((shape) => (shape.attributes.dataOriginPosition = ''));
|
|
153
|
+
|
|
154
|
+
this.updateLabelPosition(true);
|
|
142
155
|
}
|
|
143
156
|
|
|
144
157
|
/**
|
|
145
158
|
* Sometimes no changes on edge data, but need to re-draw it
|
|
146
159
|
* e.g. source and target nodes' position changed
|
|
160
|
+
* @param force bypass the nodes position change check and force to re-draw
|
|
147
161
|
*/
|
|
148
162
|
public forceUpdate() {
|
|
149
|
-
if (this.destroyed) return;
|
|
163
|
+
if (this.destroyed || !this.shapeMap.keyShape) return;
|
|
164
|
+
const force = isPolylineWithObstacleAvoidance(this.displayModel);
|
|
150
165
|
const { sourcePoint, targetPoint, changed } = this.getEndPoints(
|
|
151
166
|
this.displayModel,
|
|
152
167
|
);
|
|
153
|
-
if (!changed) return;
|
|
168
|
+
if (!force && !changed) return;
|
|
154
169
|
this.renderExt.setSourcePoint(sourcePoint);
|
|
155
170
|
this.renderExt.setTargetPoint(targetPoint);
|
|
156
171
|
const shapeMap = this.renderExt.draw(
|
|
@@ -159,8 +174,23 @@ export default class Edge extends Item {
|
|
|
159
174
|
targetPoint,
|
|
160
175
|
this.shapeMap,
|
|
161
176
|
);
|
|
177
|
+
if (shapeMap.labelShape) {
|
|
178
|
+
shapeMap.labelShape.attributes.dataIsLabel = true;
|
|
179
|
+
}
|
|
180
|
+
if (shapeMap.labelBackgroundShape) {
|
|
181
|
+
shapeMap.labelBackgroundShape.attributes.dataIsLabelBackground = true;
|
|
182
|
+
}
|
|
162
183
|
// add shapes to group, and update shapeMap
|
|
163
|
-
this.shapeMap = updateShapes(
|
|
184
|
+
this.shapeMap = updateShapes(
|
|
185
|
+
this.shapeMap,
|
|
186
|
+
shapeMap,
|
|
187
|
+
this.group,
|
|
188
|
+
this.labelGroup,
|
|
189
|
+
);
|
|
190
|
+
this.labelGroup.children
|
|
191
|
+
.filter((element) => element.attributes.dataIsLabel)
|
|
192
|
+
.forEach((shape) => (shape.attributes.dataOriginPosition = ''));
|
|
193
|
+
this.updateLabelPosition();
|
|
164
194
|
}
|
|
165
195
|
|
|
166
196
|
/**
|
|
@@ -260,12 +290,77 @@ export default class Edge extends Item {
|
|
|
260
290
|
return changed;
|
|
261
291
|
}
|
|
262
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Update label positions on label canvas by getting viewport position from transformed canvas position.
|
|
295
|
+
*/
|
|
296
|
+
public updateLabelPosition(ignoreVisibility?: boolean) {
|
|
297
|
+
const { graph, labelGroup } = this;
|
|
298
|
+
if (!ignoreVisibility && this.labelGroup.style.visibility === 'hidden') {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const zoom = graph.getZoom();
|
|
302
|
+
labelGroup.children.forEach((shape) => {
|
|
303
|
+
if (shape.attributes.dataIsLabelBackground) {
|
|
304
|
+
this.renderExt.drawLabelBackgroundShape(
|
|
305
|
+
this.displayModel,
|
|
306
|
+
this.shapeMap,
|
|
307
|
+
);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (shape.attributes.dataIsLabel) {
|
|
311
|
+
const { maxWidth } = this.renderExt.mergedStyles[shape.id] || {};
|
|
312
|
+
if (maxWidth) {
|
|
313
|
+
if (!shape.attributes.dataOriginWordWrapWidth) {
|
|
314
|
+
shape.attributes.dataOriginWordWrapWidth =
|
|
315
|
+
shape.style.wordWrapWidth;
|
|
316
|
+
}
|
|
317
|
+
shape.style.wordWrapWidth =
|
|
318
|
+
shape.attributes.dataOriginWordWrapWidth * zoom;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (!shape.attributes.dataOriginPosition) {
|
|
322
|
+
shape.attributes.dataOriginPosition = {
|
|
323
|
+
x: shape.style.x,
|
|
324
|
+
y: shape.style.y,
|
|
325
|
+
z: shape.style.z,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
const viewportPosition = graph.getViewportByCanvas(
|
|
329
|
+
shape.attributes.dataOriginPosition,
|
|
330
|
+
);
|
|
331
|
+
shape.style.x = viewportPosition.x;
|
|
332
|
+
shape.style.y = viewportPosition.y;
|
|
333
|
+
shape.style.z = viewportPosition.z;
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
private throttleUpdateWordWidth = throttle(
|
|
338
|
+
(zoom, shape) => {
|
|
339
|
+
const { maxWidth } = this.renderExt.mergedStyles[shape.id] || {};
|
|
340
|
+
if (maxWidth) {
|
|
341
|
+
if (!shape.attributes.dataOriginWordWrapWidth) {
|
|
342
|
+
shape.attributes.dataOriginWordWrapWidth = shape.style.wordWrapWidth;
|
|
343
|
+
}
|
|
344
|
+
shape.style.wordWrapWidth =
|
|
345
|
+
shape.attributes.dataOriginWordWrapWidth * zoom;
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
50,
|
|
349
|
+
{
|
|
350
|
+
leading: false,
|
|
351
|
+
trailing: true,
|
|
352
|
+
},
|
|
353
|
+
);
|
|
354
|
+
|
|
263
355
|
public clone(
|
|
264
356
|
containerGroup: Group,
|
|
357
|
+
labelContainerGroup: Group,
|
|
265
358
|
sourceItem: Node | Combo,
|
|
266
359
|
targetItem: Node | Combo,
|
|
267
360
|
shapeIds?: string[],
|
|
268
361
|
disableAnimate?: boolean,
|
|
362
|
+
visible?: boolean,
|
|
363
|
+
transientItemMap?: Map<ID, Node | Edge | Combo | Group>,
|
|
269
364
|
) {
|
|
270
365
|
if (shapeIds?.length) {
|
|
271
366
|
const group = new Group();
|
|
@@ -282,24 +377,45 @@ export default class Edge extends Item {
|
|
|
282
377
|
}
|
|
283
378
|
const clonedModel = clone(this.model);
|
|
284
379
|
clonedModel.data.disableAnimate = disableAnimate;
|
|
380
|
+
|
|
381
|
+
// `nodeMap` stores real nodes and transient nodes
|
|
382
|
+
if (transientItemMap) {
|
|
383
|
+
this.nodeMap.forEach((node, id) => {
|
|
384
|
+
const transientItem = transientItemMap.get(id) as Node;
|
|
385
|
+
if (
|
|
386
|
+
!transientItem ||
|
|
387
|
+
!transientItem.isVisible() ||
|
|
388
|
+
transientItem.type !== 'node'
|
|
389
|
+
)
|
|
390
|
+
return;
|
|
391
|
+
this.nodeMap.set(id, transientItem);
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
|
|
285
395
|
const clonedEdge = new Edge({
|
|
286
396
|
model: clonedModel,
|
|
397
|
+
graph: this.graph,
|
|
287
398
|
renderExtensions: this.renderExtensions,
|
|
288
399
|
sourceItem,
|
|
289
400
|
targetItem,
|
|
290
401
|
nodeMap: this.nodeMap,
|
|
291
402
|
containerGroup,
|
|
403
|
+
labelContainerGroup,
|
|
292
404
|
mapper: this.mapper,
|
|
293
405
|
stateMapper: this.stateMapper,
|
|
294
406
|
zoom: this.zoom,
|
|
295
407
|
theme: {
|
|
296
408
|
styles: this.themeStyles,
|
|
297
|
-
|
|
409
|
+
lodLevels: this.lodLevels,
|
|
298
410
|
},
|
|
299
411
|
});
|
|
412
|
+
if (visible) return clonedEdge;
|
|
300
413
|
Object.keys(this.shapeMap).forEach((shapeId) => {
|
|
301
|
-
if (!this.shapeMap[shapeId].isVisible())
|
|
302
|
-
clonedEdge.shapeMap[shapeId]
|
|
414
|
+
if (!this.shapeMap[shapeId].isVisible()) {
|
|
415
|
+
clonedEdge.shapeMap[shapeId].hide();
|
|
416
|
+
} else {
|
|
417
|
+
clonedEdge.shapeMap[shapeId].show();
|
|
418
|
+
}
|
|
303
419
|
});
|
|
304
420
|
return clonedEdge;
|
|
305
421
|
}
|