@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
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
SHAPE_TYPE,
|
|
20
20
|
ShapeStyle,
|
|
21
21
|
State,
|
|
22
|
-
|
|
22
|
+
LodLevelRanges,
|
|
23
|
+
ItemModelData,
|
|
23
24
|
} from '../../../types/item';
|
|
24
25
|
import { formatPadding, mergeStyles, upsertShape } from '../../../util/shape';
|
|
25
26
|
import { DEFAULT_ANIMATE_CFG, fadeIn, fadeOut } from '../../../util/animate';
|
|
26
27
|
import { getWordWrapWidthByEnds } from '../../../util/text';
|
|
27
28
|
import { AnimateCfg } from '../../../types/animate';
|
|
28
|
-
import { getZoomLevel } from '../../../util/zoom';
|
|
29
29
|
import { DEFAULT_ARROW_CONFIG, getArrowPath } from '../../../util/arrow';
|
|
30
30
|
import Node from '../../../item/node';
|
|
31
31
|
|
|
@@ -37,7 +37,7 @@ export abstract class BaseEdge {
|
|
|
37
37
|
sourcePoint: Point;
|
|
38
38
|
targetPoint: Point;
|
|
39
39
|
nodeMap: Map<ID, Node>;
|
|
40
|
-
|
|
40
|
+
lodLevels?: LodLevelRanges;
|
|
41
41
|
labelPosition: {
|
|
42
42
|
x: number;
|
|
43
43
|
y: number;
|
|
@@ -49,46 +49,21 @@ export abstract class BaseEdge {
|
|
|
49
49
|
labelBackgroundShapeTransform?: string;
|
|
50
50
|
};
|
|
51
51
|
// cache the zoom level infomations
|
|
52
|
-
|
|
53
|
-
// the id of shapes which are hidden by zoom changing.
|
|
54
|
-
hiddenShape: { [shapeId: string]: boolean };
|
|
55
|
-
// the ratio to scale the size of shapes whose visual size should be kept, e.g. label and badges.
|
|
56
|
-
balanceRatio: number;
|
|
52
|
+
#zoomCache: {
|
|
57
53
|
// last responsed zoom ratio.
|
|
58
54
|
zoom: number;
|
|
59
|
-
// last responsed zoom level where the zoom ratio at. Zoom ratio 1 at level 0.
|
|
60
|
-
zoomLevel: number;
|
|
61
|
-
// shape ids in different zoom levels.
|
|
62
|
-
levelShapes: {
|
|
63
|
-
[level: string]: string[];
|
|
64
|
-
};
|
|
65
55
|
// wordWrapWidth of labelShape according to the maxWidth
|
|
66
56
|
wordWrapWidth: number;
|
|
67
|
-
// animate configurations for zoom level changing
|
|
68
|
-
animateConfig: AnimateCfg;
|
|
69
|
-
// the tag of first rendering
|
|
70
|
-
firstRender: boolean;
|
|
71
57
|
} = {
|
|
72
|
-
hiddenShape: {},
|
|
73
|
-
balanceRatio: 1,
|
|
74
58
|
zoom: 1,
|
|
75
|
-
zoomLevel: 0,
|
|
76
|
-
levelShapes: {},
|
|
77
59
|
wordWrapWidth: 50,
|
|
78
|
-
animateConfig: DEFAULT_ANIMATE_CFG.zoom,
|
|
79
|
-
firstRender: true,
|
|
80
60
|
};
|
|
81
61
|
constructor(props) {
|
|
82
|
-
const { themeStyles,
|
|
62
|
+
const { themeStyles, lodLevels, zoom } = props;
|
|
83
63
|
if (themeStyles) this.themeStyles = themeStyles;
|
|
84
|
-
this.
|
|
64
|
+
this.lodLevels = lodLevels;
|
|
85
65
|
this.transformCache = {};
|
|
86
|
-
this
|
|
87
|
-
this.zoomCache.balanceRatio = 1 / zoom;
|
|
88
|
-
this.zoomCache.animateConfig = {
|
|
89
|
-
...DEFAULT_ANIMATE_CFG.zoom,
|
|
90
|
-
...lodStrategy?.animateCfg,
|
|
91
|
-
};
|
|
66
|
+
this.#zoomCache.zoom = zoom;
|
|
92
67
|
}
|
|
93
68
|
|
|
94
69
|
/**
|
|
@@ -108,9 +83,9 @@ export abstract class BaseEdge {
|
|
|
108
83
|
const { data } = model;
|
|
109
84
|
const dataStyles = {} as EdgeShapeStyles;
|
|
110
85
|
Object.keys(data).forEach((fieldName) => {
|
|
111
|
-
if (RESERVED_SHAPE_IDS.includes(fieldName))
|
|
86
|
+
if (RESERVED_SHAPE_IDS.includes(fieldName)) {
|
|
112
87
|
dataStyles[fieldName] = data[fieldName] as ShapeStyle;
|
|
113
|
-
else if (fieldName === OTHER_SHAPES_FIELD_NAME) {
|
|
88
|
+
} else if (fieldName === OTHER_SHAPES_FIELD_NAME) {
|
|
114
89
|
Object.keys(data[fieldName]).forEach(
|
|
115
90
|
(otherShapeId) =>
|
|
116
91
|
(dataStyles[otherShapeId] = data[fieldName][otherShapeId]),
|
|
@@ -145,26 +120,16 @@ export abstract class BaseEdge {
|
|
|
145
120
|
}
|
|
146
121
|
});
|
|
147
122
|
|
|
148
|
-
const { zoom } = this
|
|
149
|
-
const levelShapes = {};
|
|
150
|
-
Object.keys(shapeMap).forEach((shapeId) => {
|
|
151
|
-
const { lod } = shapeMap[shapeId].attributes;
|
|
152
|
-
if (lod !== undefined) {
|
|
153
|
-
levelShapes[lod] = levelShapes[lod] || [];
|
|
154
|
-
levelShapes[lod].push(shapeId);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
this.zoomCache.levelShapes = levelShapes;
|
|
123
|
+
const { zoom } = this.#zoomCache;
|
|
158
124
|
|
|
159
125
|
const { maxWidth = '60%' } = this.mergedStyles.labelShape || {};
|
|
160
|
-
this
|
|
126
|
+
this.#zoomCache.wordWrapWidth = getWordWrapWidthByEnds(
|
|
161
127
|
[this.sourcePoint, this.targetPoint],
|
|
162
128
|
maxWidth,
|
|
163
129
|
1,
|
|
164
130
|
);
|
|
165
131
|
|
|
166
|
-
this
|
|
167
|
-
this.zoomCache.zoomLevel = 0;
|
|
132
|
+
this.#zoomCache.zoom = 1;
|
|
168
133
|
if (zoom !== 1) this.onZoom(shapeMap, zoom);
|
|
169
134
|
}
|
|
170
135
|
|
|
@@ -201,7 +166,9 @@ export abstract class BaseEdge {
|
|
|
201
166
|
public afterDraw(
|
|
202
167
|
model: EdgeDisplayModel,
|
|
203
168
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
204
|
-
shapesChanged?: string[],
|
|
169
|
+
// shapesChanged?: string[],
|
|
170
|
+
diffData?: { previous: EdgeModelData; current: EdgeModelData },
|
|
171
|
+
diffState?: { previous: State[]; current: State[] },
|
|
205
172
|
): { [otherShapeId: string]: DisplayObject } {
|
|
206
173
|
return {};
|
|
207
174
|
}
|
|
@@ -311,7 +278,7 @@ export abstract class BaseEdge {
|
|
|
311
278
|
positionStyle = {
|
|
312
279
|
x: projection.x + offsetY * Math.cos(Math.PI - angle),
|
|
313
280
|
y: projection.y + offsetY * Math.sin(Math.PI - angle),
|
|
314
|
-
transform: `rotate(${(angle / Math.PI) * 180})`,
|
|
281
|
+
transform: `rotate(${(angle / Math.PI) * 180}deg)`,
|
|
315
282
|
};
|
|
316
283
|
}
|
|
317
284
|
this.labelPosition = {
|
|
@@ -321,9 +288,9 @@ export abstract class BaseEdge {
|
|
|
321
288
|
const wordWrapWidth = getWordWrapWidthByEnds(
|
|
322
289
|
[this.sourcePoint, this.targetPoint],
|
|
323
290
|
maxWidth,
|
|
324
|
-
this
|
|
291
|
+
this.#zoomCache.zoom,
|
|
325
292
|
);
|
|
326
|
-
this
|
|
293
|
+
this.#zoomCache.wordWrapWidth = wordWrapWidth;
|
|
327
294
|
const style = {
|
|
328
295
|
...this.defaultStyles.labelShape,
|
|
329
296
|
textAlign: positionPreset.textAlign,
|
|
@@ -333,7 +300,12 @@ export abstract class BaseEdge {
|
|
|
333
300
|
...otherStyle,
|
|
334
301
|
};
|
|
335
302
|
this.transformCache.labelShapeTransform = style.transform;
|
|
336
|
-
return this.upsertShape('text', 'labelShape', style,
|
|
303
|
+
return this.upsertShape('text', 'labelShape', style, {
|
|
304
|
+
model,
|
|
305
|
+
shapeMap,
|
|
306
|
+
diffData,
|
|
307
|
+
diffState,
|
|
308
|
+
});
|
|
337
309
|
}
|
|
338
310
|
|
|
339
311
|
/**
|
|
@@ -356,21 +328,20 @@ export abstract class BaseEdge {
|
|
|
356
328
|
const { labelBackgroundShape, labelShape: labelShapeStyle } =
|
|
357
329
|
this.mergedStyles;
|
|
358
330
|
|
|
359
|
-
const
|
|
331
|
+
const textGeoBBox = labelShape.getGeometryBounds();
|
|
360
332
|
const { x, y, transform, isRevert } = this.labelPosition;
|
|
361
333
|
const { padding, ...backgroundStyle } = labelBackgroundShape;
|
|
362
|
-
const
|
|
363
|
-
const
|
|
364
|
-
const textHeight = textBBox.max[1] - textBBox.min[1];
|
|
334
|
+
const textWidth = textGeoBBox.max[0] - textGeoBBox.min[0];
|
|
335
|
+
const textHeight = textGeoBBox.max[1] - textGeoBBox.min[1];
|
|
365
336
|
const bgStyle = {
|
|
366
337
|
fill: '#fff',
|
|
367
338
|
...backgroundStyle,
|
|
368
|
-
x:
|
|
369
|
-
y:
|
|
339
|
+
x: textGeoBBox.min[0] - padding[3] + labelShape.style.x,
|
|
340
|
+
y: textGeoBBox.min[1] - padding[0] + labelShape.style.y,
|
|
370
341
|
width: textWidth + padding[1] + padding[3],
|
|
371
|
-
height: textHeight +
|
|
372
|
-
transform: transform,
|
|
342
|
+
height: textHeight + padding[0] + padding[2],
|
|
373
343
|
};
|
|
344
|
+
if (transform) bgStyle.transform = transform;
|
|
374
345
|
if (labelShapeStyle.position === 'start') {
|
|
375
346
|
if (isRevert) {
|
|
376
347
|
bgStyle.transformOrigin = `${bgStyle.width - padding[1]} ${
|
|
@@ -393,13 +364,12 @@ export abstract class BaseEdge {
|
|
|
393
364
|
}`;
|
|
394
365
|
}
|
|
395
366
|
|
|
396
|
-
return this.upsertShape(
|
|
397
|
-
'rect',
|
|
398
|
-
'labelBackgroundShape',
|
|
399
|
-
bgStyle,
|
|
400
|
-
shapeMap,
|
|
367
|
+
return this.upsertShape('rect', 'labelBackgroundShape', bgStyle, {
|
|
401
368
|
model,
|
|
402
|
-
|
|
369
|
+
shapeMap,
|
|
370
|
+
diffData,
|
|
371
|
+
diffState,
|
|
372
|
+
});
|
|
403
373
|
}
|
|
404
374
|
|
|
405
375
|
/**
|
|
@@ -485,8 +455,12 @@ export abstract class BaseEdge {
|
|
|
485
455
|
iconShapeType,
|
|
486
456
|
'iconShape',
|
|
487
457
|
shapeStyle as GShapeStyle,
|
|
488
|
-
|
|
489
|
-
|
|
458
|
+
{
|
|
459
|
+
model,
|
|
460
|
+
shapeMap,
|
|
461
|
+
diffData,
|
|
462
|
+
diffState,
|
|
463
|
+
},
|
|
490
464
|
);
|
|
491
465
|
}
|
|
492
466
|
|
|
@@ -516,8 +490,12 @@ export abstract class BaseEdge {
|
|
|
516
490
|
stroke: attributes.stroke,
|
|
517
491
|
...haloShapeStyle,
|
|
518
492
|
},
|
|
519
|
-
|
|
520
|
-
|
|
493
|
+
{
|
|
494
|
+
model,
|
|
495
|
+
shapeMap,
|
|
496
|
+
diffData,
|
|
497
|
+
diffState,
|
|
498
|
+
},
|
|
521
499
|
);
|
|
522
500
|
}
|
|
523
501
|
|
|
@@ -532,8 +510,6 @@ export abstract class BaseEdge {
|
|
|
532
510
|
|
|
533
511
|
/**
|
|
534
512
|
* The listener for graph zooming.
|
|
535
|
-
* 1. show / hide some shapes while zoom level changed;
|
|
536
|
-
* 2. change the shapes' sizes to make them have same visual size while zooming, e.g. labelShape, labelBackgroundShape.
|
|
537
513
|
* @param shapeMap The shape map that contains all of the elements to show on the edge.
|
|
538
514
|
* @param zoom The zoom level of the graph.
|
|
539
515
|
*/
|
|
@@ -541,92 +517,7 @@ export abstract class BaseEdge {
|
|
|
541
517
|
shapeMap: EdgeShapeMap,
|
|
542
518
|
zoom: number,
|
|
543
519
|
cacheHiddenShape = {},
|
|
544
|
-
) => {
|
|
545
|
-
// balance the size for label, badges
|
|
546
|
-
this.balanceShapeSize(shapeMap, zoom);
|
|
547
|
-
|
|
548
|
-
// zoomLevel changed
|
|
549
|
-
if (!this.lodStrategy) return;
|
|
550
|
-
const { levels } = this.lodStrategy;
|
|
551
|
-
const {
|
|
552
|
-
levelShapes,
|
|
553
|
-
hiddenShape,
|
|
554
|
-
animateConfig,
|
|
555
|
-
firstRender = true,
|
|
556
|
-
zoomLevel: previousLevel,
|
|
557
|
-
} = this.zoomCache;
|
|
558
|
-
|
|
559
|
-
// last zoom ratio responsed by zoom changing, which might not equal to zoom.previous in props since the function is debounced.
|
|
560
|
-
const currentLevel = getZoomLevel(levels, zoom);
|
|
561
|
-
const levelNums = Object.keys(levelShapes).map(Number);
|
|
562
|
-
const maxLevel = Math.max(...levelNums);
|
|
563
|
-
const minLevel = Math.min(...levelNums);
|
|
564
|
-
if (currentLevel < previousLevel) {
|
|
565
|
-
// zoomLevel changed, from higher to lower, hide something
|
|
566
|
-
if (firstRender) {
|
|
567
|
-
for (let i = currentLevel + 1; i <= maxLevel; i++) {
|
|
568
|
-
levelShapes[String(i)]?.forEach((id) => {
|
|
569
|
-
if (!shapeMap[id] || cacheHiddenShape[id]) return;
|
|
570
|
-
shapeMap[id]?.hide();
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
} else {
|
|
574
|
-
for (let i = currentLevel + 1; i <= maxLevel; i++) {
|
|
575
|
-
levelShapes[String(i)]?.forEach((id) =>
|
|
576
|
-
fadeOut(id, shapeMap[id], hiddenShape, animateConfig),
|
|
577
|
-
);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
} else if (currentLevel > previousLevel) {
|
|
581
|
-
// zoomLevel changed, from lower to higher, show something
|
|
582
|
-
for (let i = currentLevel; i >= minLevel; i--) {
|
|
583
|
-
levelShapes[String(i)]?.forEach((id) => {
|
|
584
|
-
if (hiddenShape[id]) return;
|
|
585
|
-
fadeIn(
|
|
586
|
-
id,
|
|
587
|
-
shapeMap[id],
|
|
588
|
-
this.mergedStyles[id] ||
|
|
589
|
-
this.mergedStyles[id.replace('Background', '')],
|
|
590
|
-
hiddenShape,
|
|
591
|
-
animateConfig,
|
|
592
|
-
);
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
this.zoomCache.zoom = zoom;
|
|
598
|
-
this.zoomCache.zoomLevel = currentLevel;
|
|
599
|
-
this.zoomCache.firstRender = false;
|
|
600
|
-
};
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Update the shapes' sizes e.g. labelShape, labelBackgroundShape, to keep the visual size while zooming.
|
|
604
|
-
* @param shapeMap
|
|
605
|
-
* @param zoom
|
|
606
|
-
* @returns
|
|
607
|
-
*/
|
|
608
|
-
private balanceShapeSize(shapeMap, zoom) {
|
|
609
|
-
const { labelShape, labelBackgroundShape } = shapeMap;
|
|
610
|
-
const balanceRatio = 1 / zoom || 1;
|
|
611
|
-
this.zoomCache.balanceRatio = balanceRatio;
|
|
612
|
-
const { labelShape: labelStyle = {} } = this.mergedStyles;
|
|
613
|
-
const { position = 'bottom' } = labelStyle;
|
|
614
|
-
if (!labelShape) return;
|
|
615
|
-
|
|
616
|
-
if (position === 'bottom') labelShape.style.transformOrigin = '0';
|
|
617
|
-
else labelShape.style.transformOrigin = '';
|
|
618
|
-
|
|
619
|
-
const oriTransform = this.transformCache.labelShapeTransform;
|
|
620
|
-
labelShape.style.transform = `${oriTransform} scale(${balanceRatio}, ${balanceRatio})`;
|
|
621
|
-
|
|
622
|
-
const wordWrapWidth = this.zoomCache.wordWrapWidth * zoom;
|
|
623
|
-
labelShape.style.wordWrapWidth = wordWrapWidth;
|
|
624
|
-
|
|
625
|
-
if (!labelBackgroundShape) return;
|
|
626
|
-
|
|
627
|
-
const oriBgTransform = this.transformCache.labelBackgroundShapeTransform;
|
|
628
|
-
labelBackgroundShape.style.transform = `${oriBgTransform} scale(${balanceRatio}, ${balanceRatio})`;
|
|
629
|
-
}
|
|
520
|
+
) => {};
|
|
630
521
|
|
|
631
522
|
/**
|
|
632
523
|
* Update the source point { x, y } for the edge. Called in item's draw func.
|
|
@@ -695,8 +586,10 @@ export abstract class BaseEdge {
|
|
|
695
586
|
transformOrigin: 'center',
|
|
696
587
|
...others,
|
|
697
588
|
},
|
|
698
|
-
{
|
|
699
|
-
|
|
589
|
+
{
|
|
590
|
+
model,
|
|
591
|
+
shapeMap: {},
|
|
592
|
+
},
|
|
700
593
|
);
|
|
701
594
|
resultStyle[`${markerField}Offset`] = width / 2 + offset;
|
|
702
595
|
}
|
|
@@ -714,9 +607,13 @@ export abstract class BaseEdge {
|
|
|
714
607
|
type: SHAPE_TYPE,
|
|
715
608
|
id: string,
|
|
716
609
|
style: ShapeStyle,
|
|
717
|
-
|
|
718
|
-
|
|
610
|
+
config: {
|
|
611
|
+
model: EdgeDisplayModel;
|
|
612
|
+
shapeMap?: { [k: string]: DisplayObject<any, any> };
|
|
613
|
+
diffData?: { previous: EdgeModelData; current: EdgeModelData };
|
|
614
|
+
diffState?: { previous: State[]; current: State[] };
|
|
615
|
+
},
|
|
719
616
|
): DisplayObject {
|
|
720
|
-
return upsertShape(type, id, style as GShapeStyle,
|
|
617
|
+
return upsertShape(type, id, style as GShapeStyle, config);
|
|
721
618
|
}
|
|
722
619
|
}
|
|
@@ -51,14 +51,25 @@ export class CubicEdge extends BaseEdge {
|
|
|
51
51
|
targetPoint,
|
|
52
52
|
shapeMap,
|
|
53
53
|
diffData,
|
|
54
|
+
diffState,
|
|
54
55
|
);
|
|
55
56
|
|
|
56
57
|
if (data.haloShape) {
|
|
57
|
-
shapes.haloShape = this.drawHaloShape(
|
|
58
|
+
shapes.haloShape = this.drawHaloShape(
|
|
59
|
+
model,
|
|
60
|
+
shapeMap,
|
|
61
|
+
diffData,
|
|
62
|
+
diffState,
|
|
63
|
+
);
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
if (data.labelShape) {
|
|
61
|
-
shapes.labelShape = this.drawLabelShape(
|
|
67
|
+
shapes.labelShape = this.drawLabelShape(
|
|
68
|
+
model,
|
|
69
|
+
shapeMap,
|
|
70
|
+
diffData,
|
|
71
|
+
diffState,
|
|
72
|
+
);
|
|
62
73
|
}
|
|
63
74
|
|
|
64
75
|
// labelBackgroundShape
|
|
@@ -67,11 +78,17 @@ export class CubicEdge extends BaseEdge {
|
|
|
67
78
|
model,
|
|
68
79
|
shapeMap,
|
|
69
80
|
diffData,
|
|
81
|
+
diffState,
|
|
70
82
|
);
|
|
71
83
|
}
|
|
72
84
|
|
|
73
85
|
if (data.iconShape) {
|
|
74
|
-
shapes.iconShape = this.drawIconShape(
|
|
86
|
+
shapes.iconShape = this.drawIconShape(
|
|
87
|
+
model,
|
|
88
|
+
shapeMap,
|
|
89
|
+
diffData,
|
|
90
|
+
diffState,
|
|
91
|
+
);
|
|
75
92
|
}
|
|
76
93
|
|
|
77
94
|
// TODO: other shapes
|
|
@@ -115,7 +132,12 @@ export class CubicEdge extends BaseEdge {
|
|
|
115
132
|
this.upsertArrow('start', startArrow, others, model, lineStyle);
|
|
116
133
|
this.upsertArrow('end', endArrow, others, model, lineStyle);
|
|
117
134
|
|
|
118
|
-
return this.upsertShape('path', 'keyShape', lineStyle,
|
|
135
|
+
return this.upsertShape('path', 'keyShape', lineStyle, {
|
|
136
|
+
model,
|
|
137
|
+
shapeMap,
|
|
138
|
+
diffData,
|
|
139
|
+
diffState,
|
|
140
|
+
});
|
|
119
141
|
}
|
|
120
142
|
|
|
121
143
|
/**
|
|
@@ -43,14 +43,25 @@ export class LineEdge extends BaseEdge {
|
|
|
43
43
|
targetPoint,
|
|
44
44
|
shapeMap,
|
|
45
45
|
diffData,
|
|
46
|
+
diffState,
|
|
46
47
|
);
|
|
47
48
|
|
|
48
49
|
if (data.haloShape) {
|
|
49
|
-
shapes.haloShape = this.drawHaloShape(
|
|
50
|
+
shapes.haloShape = this.drawHaloShape(
|
|
51
|
+
model,
|
|
52
|
+
shapeMap,
|
|
53
|
+
diffData,
|
|
54
|
+
diffState,
|
|
55
|
+
);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
if (data.labelShape) {
|
|
53
|
-
shapes.labelShape = this.drawLabelShape(
|
|
59
|
+
shapes.labelShape = this.drawLabelShape(
|
|
60
|
+
model,
|
|
61
|
+
shapeMap,
|
|
62
|
+
diffData,
|
|
63
|
+
diffState,
|
|
64
|
+
);
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
// labelBackgroundShape
|
|
@@ -59,18 +70,24 @@ export class LineEdge extends BaseEdge {
|
|
|
59
70
|
model,
|
|
60
71
|
shapeMap,
|
|
61
72
|
diffData,
|
|
73
|
+
diffState,
|
|
62
74
|
);
|
|
63
75
|
}
|
|
64
76
|
|
|
65
77
|
if (data.iconShape) {
|
|
66
|
-
shapes.iconShape = this.drawIconShape(
|
|
78
|
+
shapes.iconShape = this.drawIconShape(
|
|
79
|
+
model,
|
|
80
|
+
shapeMap,
|
|
81
|
+
diffData,
|
|
82
|
+
diffState,
|
|
83
|
+
);
|
|
67
84
|
}
|
|
68
85
|
|
|
69
86
|
// otherShapes
|
|
70
87
|
if (data.otherShapes) {
|
|
71
88
|
shapes = {
|
|
72
89
|
...shapes,
|
|
73
|
-
...this.drawOtherShapes(model, shapeMap, diffData),
|
|
90
|
+
...this.drawOtherShapes(model, shapeMap, diffData, diffState),
|
|
74
91
|
};
|
|
75
92
|
}
|
|
76
93
|
|
|
@@ -98,6 +115,11 @@ export class LineEdge extends BaseEdge {
|
|
|
98
115
|
};
|
|
99
116
|
this.upsertArrow('start', startArrow, others, model, lineStyle);
|
|
100
117
|
this.upsertArrow('end', endArrow, others, model, lineStyle);
|
|
101
|
-
return this.upsertShape('line', 'keyShape', lineStyle,
|
|
118
|
+
return this.upsertShape('line', 'keyShape', lineStyle, {
|
|
119
|
+
model,
|
|
120
|
+
shapeMap,
|
|
121
|
+
diffData,
|
|
122
|
+
diffState,
|
|
123
|
+
});
|
|
102
124
|
}
|
|
103
125
|
}
|
|
@@ -75,7 +75,12 @@ export class LoopEdge extends CubicEdge {
|
|
|
75
75
|
|
|
76
76
|
this.upsertArrow('start', startArrow, others, model, lineStyle);
|
|
77
77
|
this.upsertArrow('end', endArrow, others, model, lineStyle);
|
|
78
|
-
return this.upsertShape('path', 'keyShape', lineStyle,
|
|
78
|
+
return this.upsertShape('path', 'keyShape', lineStyle, {
|
|
79
|
+
model,
|
|
80
|
+
shapeMap,
|
|
81
|
+
diffData,
|
|
82
|
+
diffState,
|
|
83
|
+
});
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
private getPathPoints(
|
|
@@ -47,14 +47,25 @@ export class PolylineEdge extends LineEdge {
|
|
|
47
47
|
targetPoint,
|
|
48
48
|
shapeMap,
|
|
49
49
|
diffData,
|
|
50
|
+
diffState,
|
|
50
51
|
);
|
|
51
52
|
|
|
52
53
|
if (data.haloShape) {
|
|
53
|
-
shapes.haloShape = this.drawHaloShape(
|
|
54
|
+
shapes.haloShape = this.drawHaloShape(
|
|
55
|
+
model,
|
|
56
|
+
shapeMap,
|
|
57
|
+
diffData,
|
|
58
|
+
diffState,
|
|
59
|
+
);
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
if (data.labelShape) {
|
|
57
|
-
shapes.labelShape = this.drawLabelShape(
|
|
63
|
+
shapes.labelShape = this.drawLabelShape(
|
|
64
|
+
model,
|
|
65
|
+
shapeMap,
|
|
66
|
+
diffData,
|
|
67
|
+
diffState,
|
|
68
|
+
);
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
// labelBackgroundShape
|
|
@@ -63,11 +74,17 @@ export class PolylineEdge extends LineEdge {
|
|
|
63
74
|
model,
|
|
64
75
|
shapeMap,
|
|
65
76
|
diffData,
|
|
77
|
+
diffState,
|
|
66
78
|
);
|
|
67
79
|
}
|
|
68
80
|
|
|
69
81
|
if (data.iconShape) {
|
|
70
|
-
shapes.iconShape = this.drawIconShape(
|
|
82
|
+
shapes.iconShape = this.drawIconShape(
|
|
83
|
+
model,
|
|
84
|
+
shapeMap,
|
|
85
|
+
diffData,
|
|
86
|
+
diffState,
|
|
87
|
+
);
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
// TODO: other shapes
|
|
@@ -158,6 +175,11 @@ export class PolylineEdge extends LineEdge {
|
|
|
158
175
|
};
|
|
159
176
|
this.upsertArrow('start', startArrow, others, model, lineStyle);
|
|
160
177
|
this.upsertArrow('end', endArrow, others, model, lineStyle);
|
|
161
|
-
return this.upsertShape('path', 'keyShape', lineStyle,
|
|
178
|
+
return this.upsertShape('path', 'keyShape', lineStyle, {
|
|
179
|
+
model,
|
|
180
|
+
shapeMap,
|
|
181
|
+
diffData,
|
|
182
|
+
diffState,
|
|
183
|
+
});
|
|
162
184
|
}
|
|
163
185
|
}
|
|
@@ -41,14 +41,25 @@ export class QuadraticEdge extends BaseEdge {
|
|
|
41
41
|
targetPoint,
|
|
42
42
|
shapeMap,
|
|
43
43
|
diffData,
|
|
44
|
+
diffState,
|
|
44
45
|
);
|
|
45
46
|
|
|
46
47
|
if (data.haloShape) {
|
|
47
|
-
shapes.haloShape = this.drawHaloShape(
|
|
48
|
+
shapes.haloShape = this.drawHaloShape(
|
|
49
|
+
model,
|
|
50
|
+
shapeMap,
|
|
51
|
+
diffData,
|
|
52
|
+
diffState,
|
|
53
|
+
);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
if (data.labelShape) {
|
|
51
|
-
shapes.labelShape = this.drawLabelShape(
|
|
57
|
+
shapes.labelShape = this.drawLabelShape(
|
|
58
|
+
model,
|
|
59
|
+
shapeMap,
|
|
60
|
+
diffData,
|
|
61
|
+
diffState,
|
|
62
|
+
);
|
|
52
63
|
}
|
|
53
64
|
|
|
54
65
|
// labelBackgroundShape
|
|
@@ -57,11 +68,17 @@ export class QuadraticEdge extends BaseEdge {
|
|
|
57
68
|
model,
|
|
58
69
|
shapeMap,
|
|
59
70
|
diffData,
|
|
71
|
+
diffState,
|
|
60
72
|
);
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
if (data.iconShape) {
|
|
64
|
-
shapes.iconShape = this.drawIconShape(
|
|
76
|
+
shapes.iconShape = this.drawIconShape(
|
|
77
|
+
model,
|
|
78
|
+
shapeMap,
|
|
79
|
+
diffData,
|
|
80
|
+
diffState,
|
|
81
|
+
);
|
|
65
82
|
}
|
|
66
83
|
|
|
67
84
|
// TODO: other shapes
|
|
@@ -95,7 +112,12 @@ export class QuadraticEdge extends BaseEdge {
|
|
|
95
112
|
};
|
|
96
113
|
this.upsertArrow('start', startArrow, others, model, lineStyle);
|
|
97
114
|
this.upsertArrow('end', endArrow, others, model, lineStyle);
|
|
98
|
-
return this.upsertShape('path', 'keyShape', lineStyle,
|
|
115
|
+
return this.upsertShape('path', 'keyShape', lineStyle, {
|
|
116
|
+
model,
|
|
117
|
+
shapeMap,
|
|
118
|
+
diffData,
|
|
119
|
+
diffState,
|
|
120
|
+
});
|
|
99
121
|
}
|
|
100
122
|
|
|
101
123
|
/**
|