@antv/g6 5.0.0-beta.26 → 5.0.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/g6.min.js +2 -2
- package/esm/constant/shape.d.ts +2 -2
- package/esm/index.d.ts +6 -2
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +6 -4
- package/esm/item/combo.js +13 -4
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +12 -4
- package/esm/item/edge.js +106 -18
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +20 -10
- package/esm/item/item.js +114 -63
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +11 -4
- package/esm/item/node.js +102 -8
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +5 -1
- package/esm/runtime/controller/data.js +53 -11
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/index.d.ts +1 -1
- package/esm/runtime/controller/index.js +1 -1
- package/esm/runtime/controller/index.js.map +1 -1
- package/esm/runtime/controller/interaction.js +4 -3
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +25 -13
- package/esm/runtime/controller/item.js +284 -116
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +3 -0
- package/esm/runtime/controller/layout.js +176 -99
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.d.ts +3 -0
- package/esm/runtime/controller/plugin.js +66 -24
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/controller/viewport.js +9 -2
- package/esm/runtime/controller/viewport.js.map +1 -1
- package/esm/runtime/graph.d.ts +75 -31
- package/esm/runtime/graph.js +320 -161
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/hooks.d.ts +2 -2
- package/esm/runtime/hooks.js +2 -2
- package/esm/stdlib/behavior/click-select.js +9 -3
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/create-edge.d.ts +1 -1
- package/esm/stdlib/behavior/drag-canvas.d.ts +1 -1
- package/esm/stdlib/behavior/drag-canvas.js +6 -3
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.js +8 -8
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +5 -1
- package/esm/stdlib/behavior/drag-node.js +122 -28
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
- package/esm/stdlib/behavior/scroll-canvas.js +8 -8
- package/esm/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +16 -0
- package/esm/stdlib/behavior/zoom-canvas.js +110 -8
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/mapNodeSize.js +2 -2
- package/esm/stdlib/data/mapNodeSize.js.map +1 -1
- package/esm/stdlib/data/transformV4Data.js +12 -6
- package/esm/stdlib/data/transformV4Data.js.map +1 -1
- package/esm/stdlib/data/validateData.js +2 -2
- package/esm/stdlib/data/validateData.js.map +1 -1
- package/esm/stdlib/index.d.ts +8 -4
- package/esm/stdlib/index.js +10 -6
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/circle.js +12 -7
- package/esm/stdlib/item/combo/circle.js.map +1 -1
- package/esm/stdlib/item/combo/rect.js +12 -7
- package/esm/stdlib/item/combo/rect.js.map +1 -1
- package/esm/stdlib/item/edge/base.d.ts +24 -16
- package/esm/stdlib/item/edge/base.js +60 -121
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/edge/cubic.js +11 -6
- package/esm/stdlib/item/edge/cubic.js.map +1 -1
- package/esm/stdlib/item/edge/line.js +12 -7
- package/esm/stdlib/item/edge/line.js.map +1 -1
- package/esm/stdlib/item/edge/loop.js +6 -1
- package/esm/stdlib/item/edge/loop.js.map +1 -1
- package/esm/stdlib/item/edge/polyline.js +11 -6
- package/esm/stdlib/item/edge/polyline.js.map +1 -1
- package/esm/stdlib/item/edge/quadratic.js +11 -6
- package/esm/stdlib/item/edge/quadratic.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +26 -33
- package/esm/stdlib/item/node/base.js +98 -196
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.d.ts +11 -2
- package/esm/stdlib/item/node/base3d.js +14 -3
- package/esm/stdlib/item/node/base3d.js.map +1 -1
- package/esm/stdlib/item/node/circle.js +13 -7
- package/esm/stdlib/item/node/circle.js.map +1 -1
- package/esm/stdlib/item/node/cube.d.ts +0 -2
- package/esm/stdlib/item/node/cube.js +12 -9
- package/esm/stdlib/item/node/cube.js.map +1 -1
- package/esm/stdlib/item/node/diamond.js +20 -11
- package/esm/stdlib/item/node/diamond.js.map +1 -1
- package/esm/stdlib/item/node/donut.js +18 -8
- package/esm/stdlib/item/node/donut.js.map +1 -1
- package/esm/stdlib/item/node/ellipse.js +11 -6
- package/esm/stdlib/item/node/ellipse.js.map +1 -1
- package/esm/stdlib/item/node/hexagon.js +12 -7
- package/esm/stdlib/item/node/hexagon.js.map +1 -1
- package/esm/stdlib/item/node/image.js +13 -3
- package/esm/stdlib/item/node/image.js.map +1 -1
- package/esm/stdlib/item/node/index.d.ts +1 -0
- package/esm/stdlib/item/node/index.js +1 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/item/node/modelRect.d.ts +33 -1
- package/esm/stdlib/item/node/modelRect.js +135 -78
- package/esm/stdlib/item/node/modelRect.js.map +1 -1
- package/esm/stdlib/item/node/plane.d.ts +38 -0
- package/esm/stdlib/item/node/plane.js +62 -0
- package/esm/stdlib/item/node/plane.js.map +1 -0
- package/esm/stdlib/item/node/rect.js +12 -7
- package/esm/stdlib/item/node/rect.js.map +1 -1
- package/esm/stdlib/item/node/sphere.js +12 -7
- package/esm/stdlib/item/node/sphere.js.map +1 -1
- package/esm/stdlib/item/node/star.d.ts +1 -3
- package/esm/stdlib/item/node/star.js +16 -10
- package/esm/stdlib/item/node/star.js.map +1 -1
- package/esm/stdlib/item/node/triangle.js +17 -7
- package/esm/stdlib/item/node/triangle.js.map +1 -1
- package/esm/stdlib/plugin/edgeBundling/index.d.ts +75 -0
- package/esm/stdlib/plugin/edgeBundling/index.js +364 -0
- package/esm/stdlib/plugin/edgeBundling/index.js.map +1 -0
- package/esm/stdlib/plugin/edgeFilterLens/index.js +2 -2
- package/esm/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/esm/stdlib/plugin/fisheye/index.js +3 -2
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -1
- package/esm/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- package/esm/stdlib/plugin/hull/bubbleset.d.ts +1 -1
- package/esm/stdlib/plugin/hull/bubbleset.js +13 -13
- package/esm/stdlib/plugin/hull/bubbleset.js.map +1 -1
- package/esm/stdlib/plugin/hull/index.d.ts +1 -1
- package/esm/stdlib/plugin/hull/index.js +4 -4
- package/esm/stdlib/plugin/hull/util.js +1 -1
- package/esm/stdlib/plugin/hull/util.js.map +1 -1
- package/esm/stdlib/plugin/index.d.ts +2 -0
- package/esm/stdlib/plugin/index.js +2 -0
- package/esm/stdlib/plugin/index.js.map +1 -1
- package/esm/stdlib/plugin/legend/index.d.ts +2 -2
- package/esm/stdlib/plugin/legend/index.js +10 -10
- package/esm/stdlib/plugin/legend/index.js.map +1 -1
- package/esm/stdlib/plugin/lodController/index.d.ts +73 -0
- package/esm/stdlib/plugin/lodController/index.js +558 -0
- package/esm/stdlib/plugin/lodController/index.js.map +1 -0
- package/esm/stdlib/plugin/menu/index.js +1 -1
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/minimap/index.js +12 -14
- package/esm/stdlib/plugin/minimap/index.js.map +1 -1
- package/esm/stdlib/plugin/snapline/index.d.ts +2 -2
- package/esm/stdlib/plugin/snapline/index.js +2 -2
- package/esm/stdlib/plugin/snapline/index.js.map +1 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +2 -2
- package/esm/stdlib/plugin/toolbar/index.js +27 -29
- package/esm/stdlib/plugin/toolbar/index.js.map +1 -1
- package/esm/stdlib/plugin/tooltip/index.d.ts +1 -1
- package/esm/stdlib/plugin/tooltip/index.js +3 -3
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
- package/{lib/stdlib/plugin/watermaker → esm/stdlib/plugin/watermarker}/index.d.ts +1 -1
- package/esm/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
- package/esm/stdlib/plugin/watermarker/index.js.map +1 -0
- package/esm/stdlib/selector/lasso.js +3 -3
- package/esm/stdlib/selector/lasso.js.map +1 -1
- package/esm/stdlib/theme/dark.js +31 -34
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +29 -29
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/spec.js +5 -5
- package/esm/stdlib/themeSolver/spec.js.map +1 -1
- package/esm/stdlib/themeSolver/subject.d.ts +1 -1
- package/esm/stdlib/themeSolver/subject.js +1 -1
- package/esm/types/animate.d.ts +2 -2
- package/esm/types/combo.d.ts +2 -2
- package/esm/types/data.d.ts +3 -1
- package/esm/types/edge.d.ts +2 -2
- package/esm/types/graph.d.ts +113 -51
- package/esm/types/hook.d.ts +18 -3
- package/esm/types/index.d.ts +2 -1
- package/esm/types/index.js +1 -0
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +17 -25
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +8 -3
- package/esm/types/layout.js.map +1 -1
- package/esm/types/node.d.ts +4 -33
- package/esm/types/plugin.d.ts +2 -1
- package/esm/types/plugin.js +2 -1
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/spec.d.ts +6 -5
- package/esm/types/theme.d.ts +8 -8
- package/esm/types/view.d.ts +1 -1
- package/esm/util/animate.d.ts +7 -2
- package/esm/util/animate.js +38 -24
- package/esm/util/animate.js.map +1 -1
- package/esm/util/bbox.d.ts +7 -1
- package/esm/util/bbox.js +16 -0
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/canvas.d.ts +1 -1
- package/esm/util/canvas.js +7 -1
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +16 -10
- package/esm/util/data.js +27 -14
- package/esm/util/data.js.map +1 -1
- package/esm/util/dom.js +5 -5
- package/esm/util/dom.js.map +1 -1
- package/esm/util/extend.js +1 -1
- package/esm/util/extend.js.map +1 -1
- package/esm/util/item.d.ts +1 -1
- package/esm/util/item.js +9 -9
- package/esm/util/item.js.map +1 -1
- package/esm/util/mapper.js +1 -1
- package/esm/util/mapper.js.map +1 -1
- package/esm/util/math.d.ts +1 -1
- package/esm/util/math.js +1 -1
- package/esm/util/path.d.ts +7 -2
- package/esm/util/path.js +73 -2
- package/esm/util/path.js.map +1 -1
- package/esm/util/polyline.d.ts +12 -2
- package/esm/util/polyline.js +25 -20
- package/esm/util/polyline.js.map +1 -1
- package/esm/util/router.d.ts +1 -1
- package/esm/util/router.js +26 -25
- package/esm/util/router.js.map +1 -1
- package/esm/util/shape.d.ts +26 -14
- package/esm/util/shape.js +56 -32
- package/esm/util/shape.js.map +1 -1
- package/esm/util/shape3d.d.ts +2 -2
- package/esm/util/shape3d.js +9 -12
- package/esm/util/shape3d.js.map +1 -1
- package/esm/util/zoom.d.ts +5 -8
- package/esm/util/zoom.js +15 -20
- package/esm/util/zoom.js.map +1 -1
- package/lib/constant/shape.d.ts +2 -2
- package/lib/index.d.ts +6 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +6 -4
- package/lib/item/combo.js +13 -4
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +12 -4
- package/lib/item/edge.js +105 -17
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +20 -10
- package/lib/item/item.js +112 -61
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +11 -4
- package/lib/item/node.js +102 -8
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +5 -1
- package/lib/runtime/controller/data.js +52 -10
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/index.d.ts +1 -1
- package/lib/runtime/controller/index.js +1 -1
- package/lib/runtime/controller/index.js.map +1 -1
- package/lib/runtime/controller/interaction.js +3 -2
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +25 -13
- package/lib/runtime/controller/item.js +281 -113
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +3 -0
- package/lib/runtime/controller/layout.js +176 -122
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.d.ts +3 -0
- package/lib/runtime/controller/plugin.js +66 -24
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/controller/viewport.js +9 -2
- package/lib/runtime/controller/viewport.js.map +1 -1
- package/lib/runtime/graph.d.ts +75 -31
- package/lib/runtime/graph.js +320 -161
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/hooks.d.ts +2 -2
- package/lib/runtime/hooks.js +2 -2
- package/lib/stdlib/behavior/click-select.js +9 -3
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/create-edge.d.ts +1 -1
- package/lib/stdlib/behavior/drag-canvas.d.ts +1 -1
- package/lib/stdlib/behavior/drag-canvas.js +6 -3
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.js +8 -8
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +5 -1
- package/lib/stdlib/behavior/drag-node.js +122 -28
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
- package/lib/stdlib/behavior/scroll-canvas.js +8 -8
- package/lib/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +16 -0
- package/lib/stdlib/behavior/zoom-canvas.js +109 -7
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/mapNodeSize.js +2 -2
- package/lib/stdlib/data/mapNodeSize.js.map +1 -1
- package/lib/stdlib/data/transformV4Data.js +12 -6
- package/lib/stdlib/data/transformV4Data.js.map +1 -1
- package/lib/stdlib/data/validateData.js +2 -2
- package/lib/stdlib/data/validateData.js.map +1 -1
- package/lib/stdlib/index.d.ts +8 -4
- package/lib/stdlib/index.js +12 -8
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/circle.js +12 -7
- package/lib/stdlib/item/combo/circle.js.map +1 -1
- package/lib/stdlib/item/combo/rect.js +12 -7
- package/lib/stdlib/item/combo/rect.js.map +1 -1
- package/lib/stdlib/item/edge/base.d.ts +24 -16
- package/lib/stdlib/item/edge/base.js +60 -121
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/edge/cubic.js +11 -6
- package/lib/stdlib/item/edge/cubic.js.map +1 -1
- package/lib/stdlib/item/edge/line.js +12 -7
- package/lib/stdlib/item/edge/line.js.map +1 -1
- package/lib/stdlib/item/edge/loop.js +6 -1
- package/lib/stdlib/item/edge/loop.js.map +1 -1
- package/lib/stdlib/item/edge/polyline.js +11 -6
- package/lib/stdlib/item/edge/polyline.js.map +1 -1
- package/lib/stdlib/item/edge/quadratic.js +11 -6
- package/lib/stdlib/item/edge/quadratic.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +26 -33
- package/lib/stdlib/item/node/base.js +98 -196
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.d.ts +11 -2
- package/lib/stdlib/item/node/base3d.js +14 -3
- package/lib/stdlib/item/node/base3d.js.map +1 -1
- package/lib/stdlib/item/node/circle.js +13 -7
- package/lib/stdlib/item/node/circle.js.map +1 -1
- package/lib/stdlib/item/node/cube.d.ts +0 -2
- package/lib/stdlib/item/node/cube.js +12 -9
- package/lib/stdlib/item/node/cube.js.map +1 -1
- package/lib/stdlib/item/node/diamond.js +20 -11
- package/lib/stdlib/item/node/diamond.js.map +1 -1
- package/lib/stdlib/item/node/donut.js +18 -8
- package/lib/stdlib/item/node/donut.js.map +1 -1
- package/lib/stdlib/item/node/ellipse.js +11 -6
- package/lib/stdlib/item/node/ellipse.js.map +1 -1
- package/lib/stdlib/item/node/hexagon.js +12 -7
- package/lib/stdlib/item/node/hexagon.js.map +1 -1
- package/lib/stdlib/item/node/image.js +13 -3
- package/lib/stdlib/item/node/image.js.map +1 -1
- package/lib/stdlib/item/node/index.d.ts +1 -0
- package/lib/stdlib/item/node/index.js +1 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/item/node/modelRect.d.ts +33 -1
- package/lib/stdlib/item/node/modelRect.js +135 -78
- package/lib/stdlib/item/node/modelRect.js.map +1 -1
- package/lib/stdlib/item/node/plane.d.ts +38 -0
- package/lib/stdlib/item/node/plane.js +66 -0
- package/lib/stdlib/item/node/plane.js.map +1 -0
- package/lib/stdlib/item/node/rect.js +12 -7
- package/lib/stdlib/item/node/rect.js.map +1 -1
- package/lib/stdlib/item/node/sphere.js +12 -7
- package/lib/stdlib/item/node/sphere.js.map +1 -1
- package/lib/stdlib/item/node/star.d.ts +1 -3
- package/lib/stdlib/item/node/star.js +16 -10
- package/lib/stdlib/item/node/star.js.map +1 -1
- package/lib/stdlib/item/node/triangle.js +17 -7
- package/lib/stdlib/item/node/triangle.js.map +1 -1
- package/lib/stdlib/plugin/edgeBundling/index.d.ts +75 -0
- package/lib/stdlib/plugin/edgeBundling/index.js +368 -0
- package/lib/stdlib/plugin/edgeBundling/index.js.map +1 -0
- package/lib/stdlib/plugin/edgeFilterLens/index.js +2 -2
- package/lib/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/lib/stdlib/plugin/fisheye/index.js +2 -1
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -1
- package/lib/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- package/lib/stdlib/plugin/hull/bubbleset.d.ts +1 -1
- package/lib/stdlib/plugin/hull/bubbleset.js +13 -13
- package/lib/stdlib/plugin/hull/bubbleset.js.map +1 -1
- package/lib/stdlib/plugin/hull/index.d.ts +1 -1
- package/lib/stdlib/plugin/hull/index.js +4 -4
- package/lib/stdlib/plugin/hull/util.js +1 -1
- package/lib/stdlib/plugin/hull/util.js.map +1 -1
- package/lib/stdlib/plugin/index.d.ts +2 -0
- package/lib/stdlib/plugin/index.js +2 -0
- package/lib/stdlib/plugin/index.js.map +1 -1
- package/lib/stdlib/plugin/legend/index.d.ts +2 -2
- package/lib/stdlib/plugin/legend/index.js +10 -10
- package/lib/stdlib/plugin/legend/index.js.map +1 -1
- package/lib/stdlib/plugin/lodController/index.d.ts +73 -0
- package/lib/stdlib/plugin/lodController/index.js +562 -0
- package/lib/stdlib/plugin/lodController/index.js.map +1 -0
- package/lib/stdlib/plugin/menu/index.js +1 -1
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/minimap/index.js +12 -14
- package/lib/stdlib/plugin/minimap/index.js.map +1 -1
- package/lib/stdlib/plugin/snapline/index.d.ts +2 -2
- package/lib/stdlib/plugin/snapline/index.js +2 -2
- package/lib/stdlib/plugin/snapline/index.js.map +1 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +2 -2
- package/lib/stdlib/plugin/toolbar/index.js +27 -29
- package/lib/stdlib/plugin/toolbar/index.js.map +1 -1
- package/lib/stdlib/plugin/tooltip/index.d.ts +1 -1
- package/lib/stdlib/plugin/tooltip/index.js +3 -3
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
- package/{esm/stdlib/plugin/watermaker → lib/stdlib/plugin/watermarker}/index.d.ts +1 -1
- package/lib/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
- package/lib/stdlib/plugin/watermarker/index.js.map +1 -0
- package/lib/stdlib/selector/lasso.js +3 -3
- package/lib/stdlib/selector/lasso.js.map +1 -1
- package/lib/stdlib/theme/dark.js +31 -34
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +29 -29
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/spec.js +5 -5
- package/lib/stdlib/themeSolver/spec.js.map +1 -1
- package/lib/stdlib/themeSolver/subject.d.ts +1 -1
- package/lib/stdlib/themeSolver/subject.js +1 -1
- package/lib/types/animate.d.ts +2 -2
- package/lib/types/combo.d.ts +2 -2
- package/lib/types/data.d.ts +3 -1
- package/lib/types/edge.d.ts +2 -2
- package/lib/types/graph.d.ts +113 -51
- package/lib/types/hook.d.ts +18 -3
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.js +3 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +17 -25
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +8 -3
- package/lib/types/layout.js.map +1 -1
- package/lib/types/node.d.ts +4 -33
- package/lib/types/plugin.d.ts +2 -1
- package/lib/types/plugin.js +2 -1
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/spec.d.ts +6 -5
- package/lib/types/theme.d.ts +8 -8
- package/lib/types/view.d.ts +1 -1
- package/lib/util/animate.d.ts +7 -2
- package/lib/util/animate.js +38 -24
- package/lib/util/animate.js.map +1 -1
- package/lib/util/bbox.d.ts +7 -1
- package/lib/util/bbox.js +18 -1
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/canvas.d.ts +1 -1
- package/lib/util/canvas.js +7 -1
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +16 -10
- package/lib/util/data.js +30 -16
- package/lib/util/data.js.map +1 -1
- package/lib/util/dom.js +5 -5
- package/lib/util/dom.js.map +1 -1
- package/lib/util/extend.js +4 -7
- package/lib/util/extend.js.map +1 -1
- package/lib/util/item.d.ts +1 -1
- package/lib/util/item.js +9 -9
- package/lib/util/item.js.map +1 -1
- package/lib/util/mapper.js +1 -1
- package/lib/util/mapper.js.map +1 -1
- package/lib/util/math.d.ts +1 -1
- package/lib/util/math.js +1 -1
- package/lib/util/path.d.ts +7 -2
- package/lib/util/path.js +73 -2
- package/lib/util/path.js.map +1 -1
- package/lib/util/polyline.d.ts +12 -2
- package/lib/util/polyline.js +28 -21
- package/lib/util/polyline.js.map +1 -1
- package/lib/util/router.d.ts +1 -1
- package/lib/util/router.js +26 -25
- package/lib/util/router.js.map +1 -1
- package/lib/util/shape.d.ts +26 -14
- package/lib/util/shape.js +54 -30
- package/lib/util/shape.js.map +1 -1
- package/lib/util/shape3d.d.ts +2 -2
- package/lib/util/shape3d.js +9 -12
- package/lib/util/shape3d.js.map +1 -1
- package/lib/util/zoom.d.ts +5 -8
- package/lib/util/zoom.js +17 -22
- package/lib/util/zoom.js.map +1 -1
- package/package.json +37 -53
- package/src/index.ts +1 -1
- package/src/item/combo.ts +15 -6
- package/src/item/edge.ts +135 -19
- package/src/item/item.ts +139 -66
- package/src/item/node.ts +125 -12
- package/src/runtime/controller/data.ts +80 -17
- package/src/runtime/controller/index.ts +1 -1
- package/src/runtime/controller/interaction.ts +5 -4
- package/src/runtime/controller/item.ts +398 -170
- package/src/runtime/controller/layout.ts +252 -113
- package/src/runtime/controller/plugin.ts +86 -33
- package/src/runtime/controller/viewport.ts +8 -2
- package/src/runtime/graph.ts +494 -212
- package/src/runtime/hooks.ts +2 -2
- package/src/stdlib/behavior/click-select.ts +8 -3
- package/src/stdlib/behavior/create-edge.ts +1 -1
- package/src/stdlib/behavior/drag-canvas.ts +7 -4
- package/src/stdlib/behavior/drag-combo.ts +8 -8
- package/src/stdlib/behavior/drag-node.ts +166 -51
- package/src/stdlib/behavior/hover-activate.ts +1 -1
- package/src/stdlib/behavior/orbit-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/rotate-canvas-3d.ts +2 -2
- package/src/stdlib/behavior/scroll-canvas.ts +8 -8
- package/src/stdlib/behavior/track-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/zoom-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/zoom-canvas.ts +137 -16
- package/src/stdlib/data/mapNodeSize.ts +2 -2
- package/src/stdlib/data/transformV4Data.ts +27 -3
- package/src/stdlib/data/validateData.ts +2 -2
- package/src/stdlib/index.ts +11 -4
- package/src/stdlib/item/combo/circle.ts +26 -11
- package/src/stdlib/item/combo/rect.ts +26 -11
- package/src/stdlib/item/edge/base.ts +60 -163
- package/src/stdlib/item/edge/cubic.ts +26 -4
- package/src/stdlib/item/edge/line.ts +27 -5
- package/src/stdlib/item/edge/loop.ts +6 -1
- package/src/stdlib/item/edge/polyline.ts +26 -4
- package/src/stdlib/item/edge/quadratic.ts +26 -4
- package/src/stdlib/item/node/base.ts +91 -260
- package/src/stdlib/item/node/base3d.ts +19 -3
- package/src/stdlib/item/node/circle.ts +29 -8
- package/src/stdlib/item/node/cube.ts +26 -12
- package/src/stdlib/item/node/diamond.ts +35 -11
- package/src/stdlib/item/node/donut.ts +32 -18
- package/src/stdlib/item/node/ellipse.ts +25 -11
- package/src/stdlib/item/node/hexagon.ts +27 -7
- package/src/stdlib/item/node/image.ts +13 -5
- package/src/stdlib/item/node/index.ts +1 -0
- package/src/stdlib/item/node/modelRect.ts +230 -136
- package/src/stdlib/item/node/plane.ts +121 -0
- package/src/stdlib/item/node/rect.ts +27 -7
- package/src/stdlib/item/node/sphere.ts +26 -10
- package/src/stdlib/item/node/star.ts +32 -11
- package/src/stdlib/item/node/triangle.ts +32 -9
- package/src/stdlib/plugin/edgeBundling/index.ts +529 -0
- package/src/stdlib/plugin/edgeFilterLens/index.ts +2 -2
- package/src/stdlib/plugin/fisheye/index.ts +3 -2
- package/src/stdlib/plugin/history/visibility-updated-command.ts +2 -2
- package/src/stdlib/plugin/hull/bubbleset.ts +14 -14
- package/src/stdlib/plugin/hull/index.ts +4 -4
- package/src/stdlib/plugin/hull/util.ts +1 -1
- package/src/stdlib/plugin/index.ts +2 -0
- package/src/stdlib/plugin/legend/index.ts +11 -12
- package/src/stdlib/plugin/lodController/index.ts +603 -0
- package/src/stdlib/plugin/menu/index.ts +1 -1
- package/src/stdlib/plugin/minimap/index.ts +12 -14
- package/src/stdlib/plugin/snapline/index.ts +3 -3
- package/src/stdlib/plugin/toolbar/index.ts +29 -31
- package/src/stdlib/plugin/tooltip/index.ts +4 -4
- package/src/stdlib/plugin/{watermaker → watermarker}/index.ts +8 -8
- package/src/stdlib/selector/lasso.ts +3 -3
- package/src/stdlib/theme/dark.ts +31 -34
- package/src/stdlib/theme/light.ts +29 -29
- package/src/stdlib/themeSolver/spec.ts +5 -5
- package/src/stdlib/themeSolver/subject.ts +1 -1
- package/src/types/animate.ts +3 -3
- package/src/types/combo.ts +2 -2
- package/src/types/data.ts +5 -1
- package/src/types/edge.ts +2 -2
- package/src/types/graph.ts +144 -61
- package/src/types/hook.ts +37 -3
- package/src/types/index.ts +2 -1
- package/src/types/item.ts +23 -30
- package/src/types/layout.ts +21 -16
- package/src/types/node.ts +4 -33
- package/src/types/plugin.ts +3 -1
- package/src/types/spec.ts +6 -5
- package/src/types/theme.ts +8 -8
- package/src/types/view.ts +1 -1
- package/src/util/animate.ts +105 -79
- package/src/util/bbox.ts +26 -1
- package/src/util/canvas.ts +8 -0
- package/src/util/data.ts +26 -15
- package/src/util/dom.ts +6 -6
- package/src/util/extend.ts +1 -1
- package/src/util/item.ts +16 -2
- package/src/util/mapper.ts +1 -1
- package/src/util/math.ts +1 -1
- package/src/util/path.ts +73 -3
- package/src/util/polyline.ts +33 -26
- package/src/util/router.ts +28 -26
- package/src/util/shape.ts +96 -44
- package/src/util/shape3d.ts +16 -10
- package/src/util/zoom.ts +19 -25
- package/esm/runtime/controller/extension.d.ts +0 -9
- package/esm/runtime/controller/extension.js +0 -11
- package/esm/runtime/controller/extension.js.map +0 -1
- package/esm/stdlib/plugin/watermaker/index.js.map +0 -1
- package/lib/runtime/controller/extension.d.ts +0 -9
- package/lib/runtime/controller/extension.js +0 -15
- package/lib/runtime/controller/extension.js.map +0 -1
- package/lib/stdlib/plugin/watermaker/index.js.map +0 -1
- package/src/runtime/controller/extension.ts +0 -14
package/src/types/item.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { ID } from '@antv/graphlib';
|
|
2
1
|
import {
|
|
3
2
|
AABB,
|
|
4
3
|
CircleStyleProps,
|
|
5
|
-
|
|
4
|
+
DisplayObject,
|
|
6
5
|
EllipseStyleProps,
|
|
7
|
-
|
|
6
|
+
Group,
|
|
7
|
+
HTMLStyleProps,
|
|
8
|
+
IAnimation,
|
|
9
|
+
ImageStyleProps,
|
|
8
10
|
LineStyleProps,
|
|
9
11
|
PathStyleProps,
|
|
12
|
+
PolygonStyleProps,
|
|
10
13
|
PolylineStyleProps,
|
|
14
|
+
RectStyleProps,
|
|
11
15
|
TextStyleProps,
|
|
12
|
-
ImageStyleProps,
|
|
13
|
-
Group,
|
|
14
|
-
DisplayObject,
|
|
15
|
-
IAnimation,
|
|
16
|
-
Shape,
|
|
17
16
|
} from '@antv/g';
|
|
18
17
|
import {
|
|
19
18
|
CubeGeometryProps,
|
|
20
19
|
PlaneGeometryProps,
|
|
21
20
|
SphereGeometryProps,
|
|
22
|
-
TorusGeometryProps,
|
|
23
21
|
} from '@antv/g-plugin-3d';
|
|
22
|
+
import { ID } from '@antv/graphlib';
|
|
24
23
|
import { AnimateCfg, IAnimates } from './animate';
|
|
25
24
|
import {
|
|
26
25
|
ComboDisplayModel,
|
|
@@ -58,6 +57,7 @@ export type GShapeStyle = CircleStyleProps &
|
|
|
58
57
|
PathStyleProps &
|
|
59
58
|
SphereGeometryProps &
|
|
60
59
|
CubeGeometryProps &
|
|
60
|
+
HTMLStyleProps &
|
|
61
61
|
PlaneGeometryProps & {
|
|
62
62
|
interactive?: boolean;
|
|
63
63
|
};
|
|
@@ -72,7 +72,7 @@ export type ClipCfg = {
|
|
|
72
72
|
export type ShapeStyle = Partial<
|
|
73
73
|
GShapeStyle & {
|
|
74
74
|
animates?: IAnimates;
|
|
75
|
-
lod?: number;
|
|
75
|
+
lod?: number | 'auto';
|
|
76
76
|
visible?: boolean;
|
|
77
77
|
} & {
|
|
78
78
|
clipCfg?: ClipCfg;
|
|
@@ -85,7 +85,6 @@ export interface Encode<T> {
|
|
|
85
85
|
|
|
86
86
|
export interface ShapeAttrEncode {
|
|
87
87
|
[shapeAttr: string]: unknown | Encode<unknown>;
|
|
88
|
-
animates?: IAnimates | Encode<IAnimates>;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
export interface LabelBackground {
|
|
@@ -101,8 +100,7 @@ export interface ShapesEncode {
|
|
|
101
100
|
iconShape?: ShapeAttrEncode | Encode<ShapeStyle>;
|
|
102
101
|
otherShapes?: {
|
|
103
102
|
[shapeId: string]: {
|
|
104
|
-
[
|
|
105
|
-
animates: IAnimates | Encode<IAnimates>;
|
|
103
|
+
[shapeAttr: string]: unknown | Encode<unknown>;
|
|
106
104
|
};
|
|
107
105
|
};
|
|
108
106
|
}
|
|
@@ -116,7 +114,8 @@ export type SHAPE_TYPE =
|
|
|
116
114
|
| 'line'
|
|
117
115
|
| 'path'
|
|
118
116
|
| 'text'
|
|
119
|
-
| 'group'
|
|
117
|
+
| 'group'
|
|
118
|
+
| 'html';
|
|
120
119
|
|
|
121
120
|
export type SHAPE_TYPE_3D = 'sphere' | 'cube' | 'plane';
|
|
122
121
|
|
|
@@ -180,19 +179,13 @@ export type ItemShapeStyles = {
|
|
|
180
179
|
animates?: IAnimates;
|
|
181
180
|
};
|
|
182
181
|
|
|
183
|
-
export interface
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
primary?: boolean;
|
|
187
|
-
}[];
|
|
188
|
-
animateCfg: AnimateCfg;
|
|
182
|
+
export interface LodLevel {
|
|
183
|
+
zoomRange: [number, number];
|
|
184
|
+
primary?: boolean;
|
|
189
185
|
}
|
|
190
186
|
|
|
191
|
-
export interface
|
|
192
|
-
|
|
193
|
-
[levelIdx: number]: [number, number];
|
|
194
|
-
};
|
|
195
|
-
animateCfg: AnimateCfg;
|
|
187
|
+
export interface LodLevelRanges {
|
|
188
|
+
[levelIdx: number]: [number, number];
|
|
196
189
|
}
|
|
197
190
|
|
|
198
191
|
/**
|
|
@@ -206,7 +199,7 @@ export interface IItem {
|
|
|
206
199
|
displayModel: ItemDisplayModel;
|
|
207
200
|
/** The style mapper configured at graph with field name 'node' / 'edge' / 'combo'. */
|
|
208
201
|
mapper: DisplayMapper;
|
|
209
|
-
/** The state
|
|
202
|
+
/** The state style mapper configured at graph with field name 'nodeState' / 'edgeState' / 'comboState'. */
|
|
210
203
|
stateMapper: {
|
|
211
204
|
[stateName: string]: DisplayMapper;
|
|
212
205
|
};
|
|
@@ -238,10 +231,10 @@ export interface IItem {
|
|
|
238
231
|
[stateName: string]: ItemShapeStyles;
|
|
239
232
|
};
|
|
240
233
|
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
241
|
-
|
|
234
|
+
lodLevels: LodLevelRanges;
|
|
242
235
|
/** Last zoom ratio. */
|
|
243
236
|
zoom: number;
|
|
244
|
-
/** Cache the
|
|
237
|
+
/** Cache the changing states which are not consumed by draw */
|
|
245
238
|
changedStates: string[];
|
|
246
239
|
/** The listener for the animations frames. */
|
|
247
240
|
onframe: Function;
|
|
@@ -275,7 +268,7 @@ export interface IItem {
|
|
|
275
268
|
isReplace?: boolean,
|
|
276
269
|
itemTheme?: {
|
|
277
270
|
styles: NodeStyleSet | EdgeStyleSet | ComboStyleSet;
|
|
278
|
-
|
|
271
|
+
lodLevels: LodLevelRanges;
|
|
279
272
|
},
|
|
280
273
|
onlyMove?: boolean,
|
|
281
274
|
animate?: boolean,
|
|
@@ -340,7 +333,7 @@ export interface IItem {
|
|
|
340
333
|
getBBox: () => AABB;
|
|
341
334
|
/** Stop all the animations on the item. */
|
|
342
335
|
stopAnimations: () => void;
|
|
343
|
-
/** Animations' frame
|
|
336
|
+
/** Animations' frame listener. */
|
|
344
337
|
animateFrameListener: Function;
|
|
345
338
|
/** Call render extension's onZoom to response the graph zooming. */
|
|
346
339
|
updateZoom: (zoom: number) => void;
|
package/src/types/layout.ts
CHANGED
|
@@ -35,38 +35,43 @@ type Workerized = {
|
|
|
35
35
|
workerEnabled?: boolean;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Iterations for
|
|
38
|
+
* Iterations for iterable layouts such as Force.
|
|
39
39
|
*/
|
|
40
40
|
iterations?: number;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type PureLayoutOptions =
|
|
44
|
+
| CircularLayout
|
|
45
|
+
| RandomLayout
|
|
46
|
+
| ConcentricLayout
|
|
47
|
+
| GridLayout
|
|
48
|
+
| MDSLayout
|
|
49
|
+
| RadialLayout
|
|
50
|
+
| FruchtermanLayout
|
|
51
|
+
| D3ForceLayout
|
|
52
|
+
| ForceLayout
|
|
53
|
+
| ForceAtlas2
|
|
54
|
+
| CustomLayout;
|
|
55
|
+
|
|
43
56
|
export type ImmediatelyInvokedLayoutOptions = {
|
|
44
57
|
/**
|
|
45
58
|
* like an IIFE.
|
|
46
59
|
*/
|
|
47
60
|
execute: (graph: GraphCore, options?: any) => Promise<LayoutMapping>;
|
|
48
|
-
} & Animatable
|
|
61
|
+
} & Animatable & {
|
|
62
|
+
presetLayout?: Partial<PureLayoutOptions>;
|
|
63
|
+
};
|
|
49
64
|
|
|
50
65
|
type CustomLayout = {
|
|
51
66
|
type: string;
|
|
52
67
|
[option: string]: any;
|
|
53
68
|
};
|
|
54
69
|
|
|
55
|
-
export type StandardLayoutOptions =
|
|
56
|
-
| CircularLayout
|
|
57
|
-
| RandomLayout
|
|
58
|
-
| ConcentricLayout
|
|
59
|
-
| GridLayout
|
|
60
|
-
| MDSLayout
|
|
61
|
-
| RadialLayout
|
|
62
|
-
| FruchtermanLayout
|
|
63
|
-
| D3ForceLayout
|
|
64
|
-
| ForceLayout
|
|
65
|
-
| ForceAtlas2
|
|
66
|
-
| CustomLayout
|
|
67
|
-
) &
|
|
70
|
+
export type StandardLayoutOptions = PureLayoutOptions &
|
|
68
71
|
Animatable &
|
|
69
|
-
Workerized
|
|
72
|
+
Workerized & {
|
|
73
|
+
presetLayout?: Partial<PureLayoutOptions>;
|
|
74
|
+
};
|
|
70
75
|
|
|
71
76
|
export type LayoutOptions =
|
|
72
77
|
| StandardLayoutOptions
|
package/src/types/node.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
IBadgePosition,
|
|
10
10
|
IItem,
|
|
11
11
|
ItemShapeStyles,
|
|
12
|
-
|
|
12
|
+
LodLevel,
|
|
13
13
|
ShapeAttrEncode,
|
|
14
14
|
ShapeStyle,
|
|
15
15
|
ShapesEncode,
|
|
@@ -154,46 +154,16 @@ export interface NodeShapeStyles extends ItemShapeStyles {
|
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
156
|
anchorShapes?: ShapeStyle & {
|
|
157
|
-
/**
|
|
158
|
-
* Background color of the anchor.
|
|
159
|
-
*/
|
|
160
|
-
color?: string;
|
|
161
|
-
/**
|
|
162
|
-
* Color of the text in anchor.
|
|
163
|
-
*/
|
|
164
|
-
textColor?: string;
|
|
165
|
-
/**
|
|
166
|
-
* Size of the text in anchor.
|
|
167
|
-
*/
|
|
168
|
-
size?: number;
|
|
169
|
-
/**
|
|
170
|
-
* The x-axis offset of the text relative to the current position
|
|
171
|
-
*/
|
|
172
|
-
offsetX?: number;
|
|
173
|
-
/**
|
|
174
|
-
* The y-axis offset of the text relative to the current position
|
|
175
|
-
*/
|
|
176
|
-
offsetY?: number;
|
|
177
|
-
/**
|
|
178
|
-
* The z-axis offset of the text relative to the current position
|
|
179
|
-
*/
|
|
180
|
-
offsetZ?: number;
|
|
181
157
|
// individual styles and their position
|
|
182
158
|
[key: number]: ShapeStyle & {
|
|
183
|
-
position?:
|
|
184
|
-
color?: string;
|
|
185
|
-
textColor?: string;
|
|
186
|
-
size?: number;
|
|
187
|
-
offsetX?: number;
|
|
188
|
-
offsetY?: number;
|
|
189
|
-
offsetZ?: number;
|
|
159
|
+
position?: 'top' | 'left' | 'bottom' | 'right' | [number, number];
|
|
190
160
|
};
|
|
191
161
|
};
|
|
192
162
|
}
|
|
193
163
|
|
|
194
164
|
/** Data in display model. */
|
|
195
165
|
export type NodeDisplayModelData = NodeModelData &
|
|
196
|
-
NodeShapeStyles & {
|
|
166
|
+
NodeShapeStyles & { lodLevels?: LodLevel[] };
|
|
197
167
|
|
|
198
168
|
/** User input model. */
|
|
199
169
|
export type NodeUserModel = GNode<NodeUserModelData>;
|
|
@@ -219,6 +189,7 @@ export interface NodeShapesEncode extends ShapesEncode {
|
|
|
219
189
|
}
|
|
220
190
|
export interface NodeEncode extends NodeShapesEncode {
|
|
221
191
|
type?: string | Encode<string>;
|
|
192
|
+
lodLevels?: LodLevel[];
|
|
222
193
|
animates?: IAnimates;
|
|
223
194
|
}
|
|
224
195
|
|
package/src/types/plugin.ts
CHANGED
|
@@ -15,6 +15,8 @@ interface EventMapType {
|
|
|
15
15
|
export abstract class Plugin {
|
|
16
16
|
public key: string;
|
|
17
17
|
|
|
18
|
+
static required: boolean = false;
|
|
19
|
+
|
|
18
20
|
private events: EventMapType;
|
|
19
21
|
|
|
20
22
|
public options: IPluginBaseConfig;
|
|
@@ -43,7 +45,7 @@ export abstract class Plugin {
|
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
|
-
* Get the
|
|
48
|
+
* Get the default options of the plugin.
|
|
47
49
|
*/
|
|
48
50
|
public getDefaultCfgs() {
|
|
49
51
|
return {};
|
package/src/types/spec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Canvas } from '@antv/g';
|
|
2
2
|
import { AnimateCfg, CameraAnimationOptions } from './animate';
|
|
3
3
|
import { Padding, Point } from './common';
|
|
4
|
-
import { DataConfig, TransformerFn } from './data';
|
|
4
|
+
import { DataConfig, DataLifecycleType, TransformerFn } from './data';
|
|
5
5
|
import {
|
|
6
6
|
EdgeDisplayModel,
|
|
7
7
|
EdgeEncode,
|
|
@@ -42,7 +42,9 @@ export interface Specification<
|
|
|
42
42
|
container?: string | HTMLElement;
|
|
43
43
|
backgroundCanvas?: Canvas;
|
|
44
44
|
canvas?: Canvas;
|
|
45
|
+
labelCanvas?: Canvas;
|
|
45
46
|
transientCanvas?: Canvas;
|
|
47
|
+
transientLabelCanvas?: Canvas;
|
|
46
48
|
width?: number;
|
|
47
49
|
height?: number;
|
|
48
50
|
renderer?:
|
|
@@ -59,11 +61,11 @@ export interface Specification<
|
|
|
59
61
|
tileFirstRender?: boolean | number;
|
|
60
62
|
/** Tile size for first rendering. */
|
|
61
63
|
tileFirstRenderSize?: number;
|
|
62
|
-
/** Whether enable tile hiding / showing for
|
|
64
|
+
/** Whether enable tile hiding / showing for behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
63
65
|
tileBehavior?: boolean | number;
|
|
64
66
|
/** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
65
67
|
tileBehaviorSize?: number;
|
|
66
|
-
/** Tile size for level of
|
|
68
|
+
/** Tile size for level of detail changing. */
|
|
67
69
|
tileLodSize?: number;
|
|
68
70
|
};
|
|
69
71
|
autoFit?:
|
|
@@ -85,7 +87,6 @@ export interface Specification<
|
|
|
85
87
|
alignment?: GraphAlignment;
|
|
86
88
|
effectTiming?: CameraAnimationOptions;
|
|
87
89
|
};
|
|
88
|
-
optimizeThreshold?: number;
|
|
89
90
|
|
|
90
91
|
/** data */
|
|
91
92
|
data?: DataConfig;
|
|
@@ -93,7 +94,7 @@ export interface Specification<
|
|
|
93
94
|
| string[]
|
|
94
95
|
| {
|
|
95
96
|
type: string;
|
|
96
|
-
activeLifecycle:
|
|
97
|
+
activeLifecycle: 'all' | DataLifecycleType | DataLifecycleType[];
|
|
97
98
|
[param: string]: unknown; // TODO: generate by plugins
|
|
98
99
|
}[]
|
|
99
100
|
| TransformerFn[];
|
package/src/types/theme.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseThemeSolver } from '../stdlib/themeSolver/base';
|
|
2
2
|
import { ComboShapeStyles } from './combo';
|
|
3
3
|
import { EdgeShapeStyles } from './edge';
|
|
4
|
-
import {
|
|
4
|
+
import { LodLevel } from './item';
|
|
5
5
|
import { NodeShapeStyles } from './node';
|
|
6
6
|
|
|
7
7
|
export interface ThemeOption {}
|
|
@@ -19,7 +19,7 @@ export abstract class Theme {
|
|
|
19
19
|
destroy() {}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/** Theme
|
|
22
|
+
/** Theme registry table.
|
|
23
23
|
* @example { 'drag-node': DragNodeBehavior, 'my-drag-node': MyDragNodeBehavior }
|
|
24
24
|
*/
|
|
25
25
|
export interface ThemeRegistry {
|
|
@@ -122,13 +122,13 @@ export type ComboStyleSets =
|
|
|
122
122
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
123
123
|
* palette - color palette.
|
|
124
124
|
* styles - style sets to map.
|
|
125
|
-
*
|
|
125
|
+
* lodLevels - level of detail strategy for global setting.
|
|
126
126
|
*/
|
|
127
127
|
export interface NodeThemeSpecifications {
|
|
128
128
|
dataTypeField?: string;
|
|
129
129
|
palette?: string[] | { [dataTypeValue: string]: string };
|
|
130
130
|
styles?: NodeStyleSets;
|
|
131
|
-
|
|
131
|
+
lodLevels?: LodLevel[];
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/**
|
|
@@ -136,13 +136,13 @@ export interface NodeThemeSpecifications {
|
|
|
136
136
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
137
137
|
* palette - color palette.
|
|
138
138
|
* styles - style sets to map.
|
|
139
|
-
*
|
|
139
|
+
* lodLevels - level of detail strategy for global setting.
|
|
140
140
|
*/
|
|
141
141
|
export interface EdgeThemeSpecifications {
|
|
142
142
|
dataTypeField?: string;
|
|
143
143
|
palette?: string[] | { [dataTypeValue: string]: string };
|
|
144
144
|
styles?: EdgeStyleSets;
|
|
145
|
-
|
|
145
|
+
lodLevels?: LodLevel[];
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
@@ -150,13 +150,13 @@ export interface EdgeThemeSpecifications {
|
|
|
150
150
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
151
151
|
* palette - color palette.
|
|
152
152
|
* styles - style sets to map.
|
|
153
|
-
*
|
|
153
|
+
* lodLevels - level of detail strategy for global setting.
|
|
154
154
|
*/
|
|
155
155
|
export interface ComboThemeSpecifications {
|
|
156
156
|
dataTypeField?: string;
|
|
157
157
|
palette?: string[] | { [dataTypeValue: string]: string };
|
|
158
158
|
styles?: ComboStyleSets;
|
|
159
|
-
|
|
159
|
+
lodLevels?: LodLevel[];
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
162
|
* Theme specification with node / edge / combo palette and style mappers. And also canvas DOM CSS settings.
|
package/src/types/view.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface FitViewRules {
|
|
2
|
-
/**
|
|
2
|
+
/** Whether fit it only when the graph is out of the viewport. */
|
|
3
3
|
onlyOutOfViewport?: boolean;
|
|
4
4
|
/** Whether zoom the graph only when the graph is larger than the viewport. */
|
|
5
5
|
onlyZoomAtLargerThanViewport?: boolean;
|
package/src/util/animate.ts
CHANGED
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
Path,
|
|
7
7
|
Polyline,
|
|
8
8
|
} from '@antv/g';
|
|
9
|
+
import { isString, uniq } from '@antv/util';
|
|
9
10
|
import { AnimateTiming, IAnimate, IAnimates } from '../types/animate';
|
|
10
11
|
import { ItemShapeStyles, ShapeStyle } from '../types/item';
|
|
11
12
|
import { isArrayOverlap, replaceElements } from './array';
|
|
12
|
-
import {
|
|
13
|
+
import { cloneJSON } from './data';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Initial(timing = show) shape animation start from init shape styles, and end to the shape's style config.
|
|
@@ -45,6 +46,7 @@ export const getShapeAnimateBeginStyles = (shape) => {
|
|
|
45
46
|
opacity: 0,
|
|
46
47
|
strokeOpacity: 0,
|
|
47
48
|
offsetDistance: 0,
|
|
49
|
+
fill: '#000',
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
return {
|
|
@@ -75,7 +77,6 @@ export const DEFAULT_ANIMATE_CFG = {
|
|
|
75
77
|
duration: 500,
|
|
76
78
|
easing: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
|
77
79
|
iterations: 1,
|
|
78
|
-
delay: 1000,
|
|
79
80
|
fill: 'both',
|
|
80
81
|
},
|
|
81
82
|
show: {
|
|
@@ -151,7 +152,8 @@ const groupTimingAnimates = (
|
|
|
151
152
|
*/
|
|
152
153
|
const runAnimateGroupOnShapes = (
|
|
153
154
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
154
|
-
|
|
155
|
+
shapeIds: string[] = undefined,
|
|
156
|
+
groups: Group[],
|
|
155
157
|
timingAnimates: IAnimate[],
|
|
156
158
|
targetStylesMap: ItemShapeStyles,
|
|
157
159
|
timing: AnimateTiming,
|
|
@@ -163,83 +165,104 @@ const runAnimateGroupOnShapes = (
|
|
|
163
165
|
let maxDurationIdx = -1;
|
|
164
166
|
let hasCanceled = canceled;
|
|
165
167
|
const isOut = timing === 'buildOut' || timing === 'hide';
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
...
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
168
|
+
const shapeIdsToAnimate = shapeIds ? shapeIds : Object.keys(shapeMap);
|
|
169
|
+
const animations = timingAnimates
|
|
170
|
+
.map((animateOptions: any) => {
|
|
171
|
+
const { fields, shapeId, order, states, ...animateCfg } = animateOptions;
|
|
172
|
+
const animateConfig = {
|
|
173
|
+
...DEFAULT_ANIMATE_CFG[timing],
|
|
174
|
+
...animateCfg,
|
|
175
|
+
};
|
|
176
|
+
const { iterations } = animateConfig;
|
|
177
|
+
if (iterations === Infinity && animateCfg.fill == undefined) {
|
|
178
|
+
animateConfig.fill = 'auto';
|
|
179
|
+
}
|
|
176
180
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
});
|
|
187
|
-
const targetStyle =
|
|
188
|
-
targetStylesMap.group || GROUP_ANIMATE_STYLES[isOut ? 0 : 1];
|
|
189
|
-
if (hasCanceled) {
|
|
190
|
-
Object.keys(targetStyle).forEach((key) => {
|
|
191
|
-
group.style[key] = targetStyle[key];
|
|
181
|
+
let animates = [];
|
|
182
|
+
if (!shapeId || shapeId === 'group') {
|
|
183
|
+
// animate on group
|
|
184
|
+
const usingFields = [];
|
|
185
|
+
let hasOpacity = false;
|
|
186
|
+
fields?.forEach((field) => {
|
|
187
|
+
if (field === 'size') usingFields.push('transform');
|
|
188
|
+
else if (field !== 'opacity') usingFields.push(field);
|
|
189
|
+
else hasOpacity = true;
|
|
192
190
|
});
|
|
193
|
-
} else {
|
|
194
|
-
if (hasOpacity) {
|
|
195
|
-
// opacity on group, animate on all shapes
|
|
196
|
-
Object.keys(shapeMap).forEach((shapeId) => {
|
|
197
|
-
const { opacity: targetOpaicty = 1 } =
|
|
198
|
-
targetStylesMap[shapeId] ||
|
|
199
|
-
targetStylesMap.otherShapes?.[shapeId] ||
|
|
200
|
-
{};
|
|
201
|
-
animation = runAnimateOnShape(
|
|
202
|
-
shapeMap[shapeId],
|
|
203
|
-
['opacity'],
|
|
204
|
-
{ opacity: targetOpaicty },
|
|
205
|
-
getShapeAnimateBeginStyles(shapeMap[shapeId]),
|
|
206
|
-
animateConfig,
|
|
207
|
-
);
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
if (usingFields.length) {
|
|
211
|
-
animation = runAnimateOnShape(
|
|
212
|
-
group,
|
|
213
|
-
usingFields,
|
|
214
|
-
targetStyle,
|
|
215
|
-
GROUP_ANIMATE_STYLES[isOut ? 1 : 0],
|
|
216
|
-
animateConfig,
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
const shape = shapeMap[shapeId];
|
|
222
|
-
if (shape && shape.style.display !== 'none') {
|
|
223
191
|
const targetStyle =
|
|
224
|
-
targetStylesMap[
|
|
225
|
-
targetStylesMap.otherShapes?.[shapeId] ||
|
|
226
|
-
{};
|
|
192
|
+
targetStylesMap.group || GROUP_ANIMATE_STYLES[isOut ? 0 : 1];
|
|
227
193
|
if (hasCanceled) {
|
|
228
194
|
Object.keys(targetStyle).forEach((key) => {
|
|
229
|
-
|
|
195
|
+
groups.forEach((group) => (group.style[key] = targetStyle[key]));
|
|
230
196
|
});
|
|
231
197
|
} else {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
198
|
+
if (hasOpacity) {
|
|
199
|
+
// opacity on group, animate on all shapes
|
|
200
|
+
shapeIdsToAnimate.forEach((sid) => {
|
|
201
|
+
if (!shapeMap[sid]) return;
|
|
202
|
+
const { opacity: targetOpacity = isOut ? 0 : 1 } =
|
|
203
|
+
targetStylesMap[sid] ||
|
|
204
|
+
targetStylesMap.otherShapes?.[sid] ||
|
|
205
|
+
{};
|
|
206
|
+
animates.push(
|
|
207
|
+
runAnimateOnShape(
|
|
208
|
+
shapeMap[sid],
|
|
209
|
+
['opacity'],
|
|
210
|
+
{ opacity: targetOpacity },
|
|
211
|
+
getShapeAnimateBeginStyles(shapeMap[sid]),
|
|
212
|
+
animateConfig,
|
|
213
|
+
),
|
|
214
|
+
);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
if (usingFields.length) {
|
|
218
|
+
animates = animates.concat(
|
|
219
|
+
groups.map((group) =>
|
|
220
|
+
runAnimateOnShape(
|
|
221
|
+
group,
|
|
222
|
+
usingFields,
|
|
223
|
+
targetStyle,
|
|
224
|
+
GROUP_ANIMATE_STYLES[isOut ? 1 : 0],
|
|
225
|
+
animateConfig,
|
|
226
|
+
),
|
|
227
|
+
),
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
} else {
|
|
232
|
+
const shape = shapeMap[shapeId];
|
|
233
|
+
if (
|
|
234
|
+
shape &&
|
|
235
|
+
shape.style.display !== 'none' &&
|
|
236
|
+
shape.style.visibility !== 'hidden'
|
|
237
|
+
) {
|
|
238
|
+
const targetStyle =
|
|
239
|
+
targetStylesMap[shapeId] ||
|
|
240
|
+
targetStylesMap.otherShapes?.[shapeId] ||
|
|
241
|
+
{};
|
|
242
|
+
if (hasCanceled) {
|
|
243
|
+
Object.keys(targetStyle).forEach((key) => {
|
|
244
|
+
shape.style[key] = targetStyle[key];
|
|
245
|
+
});
|
|
246
|
+
} else {
|
|
247
|
+
animates.push(
|
|
248
|
+
runAnimateOnShape(
|
|
249
|
+
shape,
|
|
250
|
+
fields,
|
|
251
|
+
targetStyle,
|
|
252
|
+
getShapeAnimateBeginStyles(shape),
|
|
253
|
+
animateConfig,
|
|
254
|
+
),
|
|
255
|
+
);
|
|
256
|
+
}
|
|
239
257
|
}
|
|
240
258
|
}
|
|
241
|
-
|
|
242
|
-
|
|
259
|
+
return animates;
|
|
260
|
+
})
|
|
261
|
+
.flat()
|
|
262
|
+
.filter(Boolean);
|
|
263
|
+
animations.forEach((animation, i) => {
|
|
264
|
+
const { duration } = animation.effect.timing;
|
|
265
|
+
if (maxDuration < duration) {
|
|
243
266
|
maxDuration = duration;
|
|
244
267
|
maxDurationIdx = i;
|
|
245
268
|
}
|
|
@@ -249,7 +272,6 @@ const runAnimateGroupOnShapes = (
|
|
|
249
272
|
cancelAnimations();
|
|
250
273
|
};
|
|
251
274
|
}
|
|
252
|
-
return animation;
|
|
253
275
|
});
|
|
254
276
|
if (maxDurationIdx > -1) {
|
|
255
277
|
const selfOnfinish = animations[maxDurationIdx].onfinish;
|
|
@@ -286,10 +308,10 @@ const runAnimateOnShape = (
|
|
|
286
308
|
fields.forEach((key) => {
|
|
287
309
|
animateArr[0][key] =
|
|
288
310
|
shape.style[key] === undefined
|
|
289
|
-
?
|
|
290
|
-
:
|
|
311
|
+
? cloneJSON(beginStyle[key])
|
|
312
|
+
: cloneJSON(shape.style[key]);
|
|
291
313
|
if (targetStyle[key] === undefined) return;
|
|
292
|
-
animateArr[1][key] =
|
|
314
|
+
animateArr[1][key] = cloneJSON(targetStyle[key]);
|
|
293
315
|
if (key === 'lineDash') {
|
|
294
316
|
const beginPercents = uniq(
|
|
295
317
|
animateArr[0][key].filter(
|
|
@@ -302,7 +324,7 @@ const runAnimateOnShape = (
|
|
|
302
324
|
),
|
|
303
325
|
);
|
|
304
326
|
if (beginPercents.length || targetPercents.length) {
|
|
305
|
-
percentLineDash =
|
|
327
|
+
percentLineDash = cloneJSON(animateArr[0].lineDash);
|
|
306
328
|
const totalLength = (
|
|
307
329
|
shape as Line | Polyline | Path
|
|
308
330
|
).getTotalLength();
|
|
@@ -334,6 +356,8 @@ const runAnimateOnShape = (
|
|
|
334
356
|
);
|
|
335
357
|
return;
|
|
336
358
|
}
|
|
359
|
+
if (animateConfig.iterations === -1 || animateConfig.iterations === null)
|
|
360
|
+
animateConfig.iterations = Infinity;
|
|
337
361
|
const animation = shape.animate(animateArr, animateConfig);
|
|
338
362
|
if (percentLineDash) {
|
|
339
363
|
animation.onfinish = () => {
|
|
@@ -384,7 +408,8 @@ export const animateShapes = (
|
|
|
384
408
|
animates: IAnimates,
|
|
385
409
|
mergedStyles: ItemShapeStyles,
|
|
386
410
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
387
|
-
|
|
411
|
+
shapeIds: string[] = undefined,
|
|
412
|
+
groups: Group[],
|
|
388
413
|
timing: AnimateTiming = 'buildIn',
|
|
389
414
|
changedStates: string[] = [],
|
|
390
415
|
onAnimatesFrame: Function = () => {},
|
|
@@ -413,7 +438,8 @@ export const animateShapes = (
|
|
|
413
438
|
}
|
|
414
439
|
const groupAnimations = runAnimateGroupOnShapes(
|
|
415
440
|
shapeMap,
|
|
416
|
-
|
|
441
|
+
shapeIds,
|
|
442
|
+
groups,
|
|
417
443
|
timingAnimateGroups[groupKeys[i]],
|
|
418
444
|
mergedStyles,
|
|
419
445
|
timing,
|
|
@@ -483,7 +509,7 @@ export const getAnimatesExcludePosition = (animates) => {
|
|
|
483
509
|
};
|
|
484
510
|
|
|
485
511
|
export const fadeIn = (id, shape, style, hiddenShape, animateConfig) => {
|
|
486
|
-
// omit
|
|
512
|
+
// omit in-existence shape and the shape which is not hidden by zoom changing
|
|
487
513
|
if (!shape || !hiddenShape[id]) return;
|
|
488
514
|
if (!shape?.isVisible()) {
|
|
489
515
|
shape.style.opacity = 0;
|