@antv/g6 5.0.0-beta.26 → 5.0.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/g6.min.js +2 -2
- package/esm/constant/shape.d.ts +2 -2
- package/esm/index.d.ts +6 -2
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +6 -4
- package/esm/item/combo.js +13 -4
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +12 -4
- package/esm/item/edge.js +106 -18
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +20 -10
- package/esm/item/item.js +114 -63
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +11 -4
- package/esm/item/node.js +102 -8
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +5 -1
- package/esm/runtime/controller/data.js +53 -11
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/index.d.ts +1 -1
- package/esm/runtime/controller/index.js +1 -1
- package/esm/runtime/controller/index.js.map +1 -1
- package/esm/runtime/controller/interaction.js +4 -3
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +25 -13
- package/esm/runtime/controller/item.js +284 -116
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +3 -0
- package/esm/runtime/controller/layout.js +176 -99
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.d.ts +3 -0
- package/esm/runtime/controller/plugin.js +66 -24
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/controller/viewport.js +9 -2
- package/esm/runtime/controller/viewport.js.map +1 -1
- package/esm/runtime/graph.d.ts +75 -31
- package/esm/runtime/graph.js +320 -161
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/hooks.d.ts +2 -2
- package/esm/runtime/hooks.js +2 -2
- package/esm/stdlib/behavior/click-select.js +9 -3
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/create-edge.d.ts +1 -1
- package/esm/stdlib/behavior/drag-canvas.d.ts +1 -1
- package/esm/stdlib/behavior/drag-canvas.js +6 -3
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.js +8 -8
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +5 -1
- package/esm/stdlib/behavior/drag-node.js +122 -28
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
- package/esm/stdlib/behavior/scroll-canvas.js +8 -8
- package/esm/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +16 -0
- package/esm/stdlib/behavior/zoom-canvas.js +110 -8
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/mapNodeSize.js +2 -2
- package/esm/stdlib/data/mapNodeSize.js.map +1 -1
- package/esm/stdlib/data/transformV4Data.js +12 -6
- package/esm/stdlib/data/transformV4Data.js.map +1 -1
- package/esm/stdlib/data/validateData.js +2 -2
- package/esm/stdlib/data/validateData.js.map +1 -1
- package/esm/stdlib/index.d.ts +8 -4
- package/esm/stdlib/index.js +10 -6
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/circle.js +12 -7
- package/esm/stdlib/item/combo/circle.js.map +1 -1
- package/esm/stdlib/item/combo/rect.js +12 -7
- package/esm/stdlib/item/combo/rect.js.map +1 -1
- package/esm/stdlib/item/edge/base.d.ts +24 -16
- package/esm/stdlib/item/edge/base.js +60 -121
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/edge/cubic.js +11 -6
- package/esm/stdlib/item/edge/cubic.js.map +1 -1
- package/esm/stdlib/item/edge/line.js +12 -7
- package/esm/stdlib/item/edge/line.js.map +1 -1
- package/esm/stdlib/item/edge/loop.js +6 -1
- package/esm/stdlib/item/edge/loop.js.map +1 -1
- package/esm/stdlib/item/edge/polyline.js +11 -6
- package/esm/stdlib/item/edge/polyline.js.map +1 -1
- package/esm/stdlib/item/edge/quadratic.js +11 -6
- package/esm/stdlib/item/edge/quadratic.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +26 -33
- package/esm/stdlib/item/node/base.js +98 -196
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.d.ts +11 -2
- package/esm/stdlib/item/node/base3d.js +14 -3
- package/esm/stdlib/item/node/base3d.js.map +1 -1
- package/esm/stdlib/item/node/circle.js +13 -7
- package/esm/stdlib/item/node/circle.js.map +1 -1
- package/esm/stdlib/item/node/cube.d.ts +0 -2
- package/esm/stdlib/item/node/cube.js +12 -9
- package/esm/stdlib/item/node/cube.js.map +1 -1
- package/esm/stdlib/item/node/diamond.js +20 -11
- package/esm/stdlib/item/node/diamond.js.map +1 -1
- package/esm/stdlib/item/node/donut.js +18 -8
- package/esm/stdlib/item/node/donut.js.map +1 -1
- package/esm/stdlib/item/node/ellipse.js +11 -6
- package/esm/stdlib/item/node/ellipse.js.map +1 -1
- package/esm/stdlib/item/node/hexagon.js +12 -7
- package/esm/stdlib/item/node/hexagon.js.map +1 -1
- package/esm/stdlib/item/node/image.js +13 -3
- package/esm/stdlib/item/node/image.js.map +1 -1
- package/esm/stdlib/item/node/index.d.ts +1 -0
- package/esm/stdlib/item/node/index.js +1 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/item/node/modelRect.d.ts +33 -1
- package/esm/stdlib/item/node/modelRect.js +135 -78
- package/esm/stdlib/item/node/modelRect.js.map +1 -1
- package/esm/stdlib/item/node/plane.d.ts +38 -0
- package/esm/stdlib/item/node/plane.js +62 -0
- package/esm/stdlib/item/node/plane.js.map +1 -0
- package/esm/stdlib/item/node/rect.js +12 -7
- package/esm/stdlib/item/node/rect.js.map +1 -1
- package/esm/stdlib/item/node/sphere.js +12 -7
- package/esm/stdlib/item/node/sphere.js.map +1 -1
- package/esm/stdlib/item/node/star.d.ts +1 -3
- package/esm/stdlib/item/node/star.js +16 -10
- package/esm/stdlib/item/node/star.js.map +1 -1
- package/esm/stdlib/item/node/triangle.js +17 -7
- package/esm/stdlib/item/node/triangle.js.map +1 -1
- package/esm/stdlib/plugin/edgeBundling/index.d.ts +75 -0
- package/esm/stdlib/plugin/edgeBundling/index.js +364 -0
- package/esm/stdlib/plugin/edgeBundling/index.js.map +1 -0
- package/esm/stdlib/plugin/edgeFilterLens/index.js +2 -2
- package/esm/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/esm/stdlib/plugin/fisheye/index.js +3 -2
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -1
- package/esm/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- package/esm/stdlib/plugin/hull/bubbleset.d.ts +1 -1
- package/esm/stdlib/plugin/hull/bubbleset.js +13 -13
- package/esm/stdlib/plugin/hull/bubbleset.js.map +1 -1
- package/esm/stdlib/plugin/hull/index.d.ts +1 -1
- package/esm/stdlib/plugin/hull/index.js +4 -4
- package/esm/stdlib/plugin/hull/util.js +1 -1
- package/esm/stdlib/plugin/hull/util.js.map +1 -1
- package/esm/stdlib/plugin/index.d.ts +2 -0
- package/esm/stdlib/plugin/index.js +2 -0
- package/esm/stdlib/plugin/index.js.map +1 -1
- package/esm/stdlib/plugin/legend/index.d.ts +2 -2
- package/esm/stdlib/plugin/legend/index.js +10 -10
- package/esm/stdlib/plugin/legend/index.js.map +1 -1
- package/esm/stdlib/plugin/lodController/index.d.ts +73 -0
- package/esm/stdlib/plugin/lodController/index.js +558 -0
- package/esm/stdlib/plugin/lodController/index.js.map +1 -0
- package/esm/stdlib/plugin/menu/index.js +1 -1
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/minimap/index.js +12 -14
- package/esm/stdlib/plugin/minimap/index.js.map +1 -1
- package/esm/stdlib/plugin/snapline/index.d.ts +2 -2
- package/esm/stdlib/plugin/snapline/index.js +2 -2
- package/esm/stdlib/plugin/snapline/index.js.map +1 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +2 -2
- package/esm/stdlib/plugin/toolbar/index.js +27 -29
- package/esm/stdlib/plugin/toolbar/index.js.map +1 -1
- package/esm/stdlib/plugin/tooltip/index.d.ts +1 -1
- package/esm/stdlib/plugin/tooltip/index.js +3 -3
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
- package/{lib/stdlib/plugin/watermaker → esm/stdlib/plugin/watermarker}/index.d.ts +1 -1
- package/esm/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
- package/esm/stdlib/plugin/watermarker/index.js.map +1 -0
- package/esm/stdlib/selector/lasso.js +3 -3
- package/esm/stdlib/selector/lasso.js.map +1 -1
- package/esm/stdlib/theme/dark.js +31 -34
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/light.js +29 -29
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/spec.js +5 -5
- package/esm/stdlib/themeSolver/spec.js.map +1 -1
- package/esm/stdlib/themeSolver/subject.d.ts +1 -1
- package/esm/stdlib/themeSolver/subject.js +1 -1
- package/esm/types/animate.d.ts +2 -2
- package/esm/types/combo.d.ts +2 -2
- package/esm/types/data.d.ts +3 -1
- package/esm/types/edge.d.ts +2 -2
- package/esm/types/graph.d.ts +113 -51
- package/esm/types/hook.d.ts +18 -3
- package/esm/types/index.d.ts +2 -1
- package/esm/types/index.js +1 -0
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +17 -25
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +8 -3
- package/esm/types/layout.js.map +1 -1
- package/esm/types/node.d.ts +4 -33
- package/esm/types/plugin.d.ts +2 -1
- package/esm/types/plugin.js +2 -1
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/spec.d.ts +6 -5
- package/esm/types/theme.d.ts +8 -8
- package/esm/types/view.d.ts +1 -1
- package/esm/util/animate.d.ts +7 -2
- package/esm/util/animate.js +38 -24
- package/esm/util/animate.js.map +1 -1
- package/esm/util/bbox.d.ts +7 -1
- package/esm/util/bbox.js +16 -0
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/canvas.d.ts +1 -1
- package/esm/util/canvas.js +7 -1
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +16 -10
- package/esm/util/data.js +27 -14
- package/esm/util/data.js.map +1 -1
- package/esm/util/dom.js +5 -5
- package/esm/util/dom.js.map +1 -1
- package/esm/util/extend.js +1 -1
- package/esm/util/extend.js.map +1 -1
- package/esm/util/item.d.ts +1 -1
- package/esm/util/item.js +9 -9
- package/esm/util/item.js.map +1 -1
- package/esm/util/mapper.js +1 -1
- package/esm/util/mapper.js.map +1 -1
- package/esm/util/math.d.ts +1 -1
- package/esm/util/math.js +1 -1
- package/esm/util/path.d.ts +7 -2
- package/esm/util/path.js +73 -2
- package/esm/util/path.js.map +1 -1
- package/esm/util/polyline.d.ts +12 -2
- package/esm/util/polyline.js +25 -20
- package/esm/util/polyline.js.map +1 -1
- package/esm/util/router.d.ts +1 -1
- package/esm/util/router.js +26 -25
- package/esm/util/router.js.map +1 -1
- package/esm/util/shape.d.ts +26 -14
- package/esm/util/shape.js +56 -32
- package/esm/util/shape.js.map +1 -1
- package/esm/util/shape3d.d.ts +2 -2
- package/esm/util/shape3d.js +9 -12
- package/esm/util/shape3d.js.map +1 -1
- package/esm/util/zoom.d.ts +5 -8
- package/esm/util/zoom.js +15 -20
- package/esm/util/zoom.js.map +1 -1
- package/lib/constant/shape.d.ts +2 -2
- package/lib/index.d.ts +6 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +6 -4
- package/lib/item/combo.js +13 -4
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +12 -4
- package/lib/item/edge.js +105 -17
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +20 -10
- package/lib/item/item.js +112 -61
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +11 -4
- package/lib/item/node.js +102 -8
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +5 -1
- package/lib/runtime/controller/data.js +52 -10
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/index.d.ts +1 -1
- package/lib/runtime/controller/index.js +1 -1
- package/lib/runtime/controller/index.js.map +1 -1
- package/lib/runtime/controller/interaction.js +3 -2
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +25 -13
- package/lib/runtime/controller/item.js +281 -113
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +3 -0
- package/lib/runtime/controller/layout.js +176 -122
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.d.ts +3 -0
- package/lib/runtime/controller/plugin.js +66 -24
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/controller/viewport.js +9 -2
- package/lib/runtime/controller/viewport.js.map +1 -1
- package/lib/runtime/graph.d.ts +75 -31
- package/lib/runtime/graph.js +320 -161
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/hooks.d.ts +2 -2
- package/lib/runtime/hooks.js +2 -2
- package/lib/stdlib/behavior/click-select.js +9 -3
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/create-edge.d.ts +1 -1
- package/lib/stdlib/behavior/drag-canvas.d.ts +1 -1
- package/lib/stdlib/behavior/drag-canvas.js +6 -3
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.js +8 -8
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +5 -1
- package/lib/stdlib/behavior/drag-node.js +122 -28
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +2 -2
- package/lib/stdlib/behavior/scroll-canvas.js +8 -8
- package/lib/stdlib/behavior/scroll-canvas.js.map +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +16 -0
- package/lib/stdlib/behavior/zoom-canvas.js +109 -7
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/mapNodeSize.js +2 -2
- package/lib/stdlib/data/mapNodeSize.js.map +1 -1
- package/lib/stdlib/data/transformV4Data.js +12 -6
- package/lib/stdlib/data/transformV4Data.js.map +1 -1
- package/lib/stdlib/data/validateData.js +2 -2
- package/lib/stdlib/data/validateData.js.map +1 -1
- package/lib/stdlib/index.d.ts +8 -4
- package/lib/stdlib/index.js +12 -8
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/circle.js +12 -7
- package/lib/stdlib/item/combo/circle.js.map +1 -1
- package/lib/stdlib/item/combo/rect.js +12 -7
- package/lib/stdlib/item/combo/rect.js.map +1 -1
- package/lib/stdlib/item/edge/base.d.ts +24 -16
- package/lib/stdlib/item/edge/base.js +60 -121
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/edge/cubic.js +11 -6
- package/lib/stdlib/item/edge/cubic.js.map +1 -1
- package/lib/stdlib/item/edge/line.js +12 -7
- package/lib/stdlib/item/edge/line.js.map +1 -1
- package/lib/stdlib/item/edge/loop.js +6 -1
- package/lib/stdlib/item/edge/loop.js.map +1 -1
- package/lib/stdlib/item/edge/polyline.js +11 -6
- package/lib/stdlib/item/edge/polyline.js.map +1 -1
- package/lib/stdlib/item/edge/quadratic.js +11 -6
- package/lib/stdlib/item/edge/quadratic.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +26 -33
- package/lib/stdlib/item/node/base.js +98 -196
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.d.ts +11 -2
- package/lib/stdlib/item/node/base3d.js +14 -3
- package/lib/stdlib/item/node/base3d.js.map +1 -1
- package/lib/stdlib/item/node/circle.js +13 -7
- package/lib/stdlib/item/node/circle.js.map +1 -1
- package/lib/stdlib/item/node/cube.d.ts +0 -2
- package/lib/stdlib/item/node/cube.js +12 -9
- package/lib/stdlib/item/node/cube.js.map +1 -1
- package/lib/stdlib/item/node/diamond.js +20 -11
- package/lib/stdlib/item/node/diamond.js.map +1 -1
- package/lib/stdlib/item/node/donut.js +18 -8
- package/lib/stdlib/item/node/donut.js.map +1 -1
- package/lib/stdlib/item/node/ellipse.js +11 -6
- package/lib/stdlib/item/node/ellipse.js.map +1 -1
- package/lib/stdlib/item/node/hexagon.js +12 -7
- package/lib/stdlib/item/node/hexagon.js.map +1 -1
- package/lib/stdlib/item/node/image.js +13 -3
- package/lib/stdlib/item/node/image.js.map +1 -1
- package/lib/stdlib/item/node/index.d.ts +1 -0
- package/lib/stdlib/item/node/index.js +1 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/item/node/modelRect.d.ts +33 -1
- package/lib/stdlib/item/node/modelRect.js +135 -78
- package/lib/stdlib/item/node/modelRect.js.map +1 -1
- package/lib/stdlib/item/node/plane.d.ts +38 -0
- package/lib/stdlib/item/node/plane.js +66 -0
- package/lib/stdlib/item/node/plane.js.map +1 -0
- package/lib/stdlib/item/node/rect.js +12 -7
- package/lib/stdlib/item/node/rect.js.map +1 -1
- package/lib/stdlib/item/node/sphere.js +12 -7
- package/lib/stdlib/item/node/sphere.js.map +1 -1
- package/lib/stdlib/item/node/star.d.ts +1 -3
- package/lib/stdlib/item/node/star.js +16 -10
- package/lib/stdlib/item/node/star.js.map +1 -1
- package/lib/stdlib/item/node/triangle.js +17 -7
- package/lib/stdlib/item/node/triangle.js.map +1 -1
- package/lib/stdlib/plugin/edgeBundling/index.d.ts +75 -0
- package/lib/stdlib/plugin/edgeBundling/index.js +368 -0
- package/lib/stdlib/plugin/edgeBundling/index.js.map +1 -0
- package/lib/stdlib/plugin/edgeFilterLens/index.js +2 -2
- package/lib/stdlib/plugin/edgeFilterLens/index.js.map +1 -1
- package/lib/stdlib/plugin/fisheye/index.js +2 -1
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -1
- package/lib/stdlib/plugin/history/visibility-updated-command.js +2 -2
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -1
- package/lib/stdlib/plugin/hull/bubbleset.d.ts +1 -1
- package/lib/stdlib/plugin/hull/bubbleset.js +13 -13
- package/lib/stdlib/plugin/hull/bubbleset.js.map +1 -1
- package/lib/stdlib/plugin/hull/index.d.ts +1 -1
- package/lib/stdlib/plugin/hull/index.js +4 -4
- package/lib/stdlib/plugin/hull/util.js +1 -1
- package/lib/stdlib/plugin/hull/util.js.map +1 -1
- package/lib/stdlib/plugin/index.d.ts +2 -0
- package/lib/stdlib/plugin/index.js +2 -0
- package/lib/stdlib/plugin/index.js.map +1 -1
- package/lib/stdlib/plugin/legend/index.d.ts +2 -2
- package/lib/stdlib/plugin/legend/index.js +10 -10
- package/lib/stdlib/plugin/legend/index.js.map +1 -1
- package/lib/stdlib/plugin/lodController/index.d.ts +73 -0
- package/lib/stdlib/plugin/lodController/index.js +562 -0
- package/lib/stdlib/plugin/lodController/index.js.map +1 -0
- package/lib/stdlib/plugin/menu/index.js +1 -1
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/minimap/index.js +12 -14
- package/lib/stdlib/plugin/minimap/index.js.map +1 -1
- package/lib/stdlib/plugin/snapline/index.d.ts +2 -2
- package/lib/stdlib/plugin/snapline/index.js +2 -2
- package/lib/stdlib/plugin/snapline/index.js.map +1 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +2 -2
- package/lib/stdlib/plugin/toolbar/index.js +27 -29
- package/lib/stdlib/plugin/toolbar/index.js.map +1 -1
- package/lib/stdlib/plugin/tooltip/index.d.ts +1 -1
- package/lib/stdlib/plugin/tooltip/index.js +3 -3
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
- package/{esm/stdlib/plugin/watermaker → lib/stdlib/plugin/watermarker}/index.d.ts +1 -1
- package/lib/stdlib/plugin/{watermaker → watermarker}/index.js +7 -7
- package/lib/stdlib/plugin/watermarker/index.js.map +1 -0
- package/lib/stdlib/selector/lasso.js +3 -3
- package/lib/stdlib/selector/lasso.js.map +1 -1
- package/lib/stdlib/theme/dark.js +31 -34
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/light.js +29 -29
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/spec.js +5 -5
- package/lib/stdlib/themeSolver/spec.js.map +1 -1
- package/lib/stdlib/themeSolver/subject.d.ts +1 -1
- package/lib/stdlib/themeSolver/subject.js +1 -1
- package/lib/types/animate.d.ts +2 -2
- package/lib/types/combo.d.ts +2 -2
- package/lib/types/data.d.ts +3 -1
- package/lib/types/edge.d.ts +2 -2
- package/lib/types/graph.d.ts +113 -51
- package/lib/types/hook.d.ts +18 -3
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.js +3 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +17 -25
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +8 -3
- package/lib/types/layout.js.map +1 -1
- package/lib/types/node.d.ts +4 -33
- package/lib/types/plugin.d.ts +2 -1
- package/lib/types/plugin.js +2 -1
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/spec.d.ts +6 -5
- package/lib/types/theme.d.ts +8 -8
- package/lib/types/view.d.ts +1 -1
- package/lib/util/animate.d.ts +7 -2
- package/lib/util/animate.js +38 -24
- package/lib/util/animate.js.map +1 -1
- package/lib/util/bbox.d.ts +7 -1
- package/lib/util/bbox.js +18 -1
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/canvas.d.ts +1 -1
- package/lib/util/canvas.js +7 -1
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +16 -10
- package/lib/util/data.js +30 -16
- package/lib/util/data.js.map +1 -1
- package/lib/util/dom.js +5 -5
- package/lib/util/dom.js.map +1 -1
- package/lib/util/extend.js +4 -7
- package/lib/util/extend.js.map +1 -1
- package/lib/util/item.d.ts +1 -1
- package/lib/util/item.js +9 -9
- package/lib/util/item.js.map +1 -1
- package/lib/util/mapper.js +1 -1
- package/lib/util/mapper.js.map +1 -1
- package/lib/util/math.d.ts +1 -1
- package/lib/util/math.js +1 -1
- package/lib/util/path.d.ts +7 -2
- package/lib/util/path.js +73 -2
- package/lib/util/path.js.map +1 -1
- package/lib/util/polyline.d.ts +12 -2
- package/lib/util/polyline.js +28 -21
- package/lib/util/polyline.js.map +1 -1
- package/lib/util/router.d.ts +1 -1
- package/lib/util/router.js +26 -25
- package/lib/util/router.js.map +1 -1
- package/lib/util/shape.d.ts +26 -14
- package/lib/util/shape.js +54 -30
- package/lib/util/shape.js.map +1 -1
- package/lib/util/shape3d.d.ts +2 -2
- package/lib/util/shape3d.js +9 -12
- package/lib/util/shape3d.js.map +1 -1
- package/lib/util/zoom.d.ts +5 -8
- package/lib/util/zoom.js +17 -22
- package/lib/util/zoom.js.map +1 -1
- package/package.json +37 -53
- package/src/index.ts +1 -1
- package/src/item/combo.ts +15 -6
- package/src/item/edge.ts +135 -19
- package/src/item/item.ts +139 -66
- package/src/item/node.ts +125 -12
- package/src/runtime/controller/data.ts +80 -17
- package/src/runtime/controller/index.ts +1 -1
- package/src/runtime/controller/interaction.ts +5 -4
- package/src/runtime/controller/item.ts +398 -170
- package/src/runtime/controller/layout.ts +252 -113
- package/src/runtime/controller/plugin.ts +86 -33
- package/src/runtime/controller/viewport.ts +8 -2
- package/src/runtime/graph.ts +494 -212
- package/src/runtime/hooks.ts +2 -2
- package/src/stdlib/behavior/click-select.ts +8 -3
- package/src/stdlib/behavior/create-edge.ts +1 -1
- package/src/stdlib/behavior/drag-canvas.ts +7 -4
- package/src/stdlib/behavior/drag-combo.ts +8 -8
- package/src/stdlib/behavior/drag-node.ts +166 -51
- package/src/stdlib/behavior/hover-activate.ts +1 -1
- package/src/stdlib/behavior/orbit-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/rotate-canvas-3d.ts +2 -2
- package/src/stdlib/behavior/scroll-canvas.ts +8 -8
- package/src/stdlib/behavior/track-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/zoom-canvas-3d.ts +1 -1
- package/src/stdlib/behavior/zoom-canvas.ts +137 -16
- package/src/stdlib/data/mapNodeSize.ts +2 -2
- package/src/stdlib/data/transformV4Data.ts +27 -3
- package/src/stdlib/data/validateData.ts +2 -2
- package/src/stdlib/index.ts +11 -4
- package/src/stdlib/item/combo/circle.ts +26 -11
- package/src/stdlib/item/combo/rect.ts +26 -11
- package/src/stdlib/item/edge/base.ts +60 -163
- package/src/stdlib/item/edge/cubic.ts +26 -4
- package/src/stdlib/item/edge/line.ts +27 -5
- package/src/stdlib/item/edge/loop.ts +6 -1
- package/src/stdlib/item/edge/polyline.ts +26 -4
- package/src/stdlib/item/edge/quadratic.ts +26 -4
- package/src/stdlib/item/node/base.ts +91 -260
- package/src/stdlib/item/node/base3d.ts +19 -3
- package/src/stdlib/item/node/circle.ts +29 -8
- package/src/stdlib/item/node/cube.ts +26 -12
- package/src/stdlib/item/node/diamond.ts +35 -11
- package/src/stdlib/item/node/donut.ts +32 -18
- package/src/stdlib/item/node/ellipse.ts +25 -11
- package/src/stdlib/item/node/hexagon.ts +27 -7
- package/src/stdlib/item/node/image.ts +13 -5
- package/src/stdlib/item/node/index.ts +1 -0
- package/src/stdlib/item/node/modelRect.ts +230 -136
- package/src/stdlib/item/node/plane.ts +121 -0
- package/src/stdlib/item/node/rect.ts +27 -7
- package/src/stdlib/item/node/sphere.ts +26 -10
- package/src/stdlib/item/node/star.ts +32 -11
- package/src/stdlib/item/node/triangle.ts +32 -9
- package/src/stdlib/plugin/edgeBundling/index.ts +529 -0
- package/src/stdlib/plugin/edgeFilterLens/index.ts +2 -2
- package/src/stdlib/plugin/fisheye/index.ts +3 -2
- package/src/stdlib/plugin/history/visibility-updated-command.ts +2 -2
- package/src/stdlib/plugin/hull/bubbleset.ts +14 -14
- package/src/stdlib/plugin/hull/index.ts +4 -4
- package/src/stdlib/plugin/hull/util.ts +1 -1
- package/src/stdlib/plugin/index.ts +2 -0
- package/src/stdlib/plugin/legend/index.ts +11 -12
- package/src/stdlib/plugin/lodController/index.ts +603 -0
- package/src/stdlib/plugin/menu/index.ts +1 -1
- package/src/stdlib/plugin/minimap/index.ts +12 -14
- package/src/stdlib/plugin/snapline/index.ts +3 -3
- package/src/stdlib/plugin/toolbar/index.ts +29 -31
- package/src/stdlib/plugin/tooltip/index.ts +4 -4
- package/src/stdlib/plugin/{watermaker → watermarker}/index.ts +8 -8
- package/src/stdlib/selector/lasso.ts +3 -3
- package/src/stdlib/theme/dark.ts +31 -34
- package/src/stdlib/theme/light.ts +29 -29
- package/src/stdlib/themeSolver/spec.ts +5 -5
- package/src/stdlib/themeSolver/subject.ts +1 -1
- package/src/types/animate.ts +3 -3
- package/src/types/combo.ts +2 -2
- package/src/types/data.ts +5 -1
- package/src/types/edge.ts +2 -2
- package/src/types/graph.ts +144 -61
- package/src/types/hook.ts +37 -3
- package/src/types/index.ts +2 -1
- package/src/types/item.ts +23 -30
- package/src/types/layout.ts +21 -16
- package/src/types/node.ts +4 -33
- package/src/types/plugin.ts +3 -1
- package/src/types/spec.ts +6 -5
- package/src/types/theme.ts +8 -8
- package/src/types/view.ts +1 -1
- package/src/util/animate.ts +105 -79
- package/src/util/bbox.ts +26 -1
- package/src/util/canvas.ts +8 -0
- package/src/util/data.ts +26 -15
- package/src/util/dom.ts +6 -6
- package/src/util/extend.ts +1 -1
- package/src/util/item.ts +16 -2
- package/src/util/mapper.ts +1 -1
- package/src/util/math.ts +1 -1
- package/src/util/path.ts +73 -3
- package/src/util/polyline.ts +33 -26
- package/src/util/router.ts +28 -26
- package/src/util/shape.ts +96 -44
- package/src/util/shape3d.ts +16 -10
- package/src/util/zoom.ts +19 -25
- package/esm/runtime/controller/extension.d.ts +0 -9
- package/esm/runtime/controller/extension.js +0 -11
- package/esm/runtime/controller/extension.js.map +0 -1
- package/esm/stdlib/plugin/watermaker/index.js.map +0 -1
- package/lib/runtime/controller/extension.d.ts +0 -9
- package/lib/runtime/controller/extension.js +0 -15
- package/lib/runtime/controller/extension.js.map +0 -1
- package/lib/stdlib/plugin/watermaker/index.js.map +0 -1
- package/src/runtime/controller/extension.ts +0 -14
package/lib/types/item.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AABB, CircleStyleProps, RectStyleProps, EllipseStyleProps, PolygonStyleProps, LineStyleProps, PathStyleProps, PolylineStyleProps, TextStyleProps, ImageStyleProps, Group, DisplayObject, IAnimation } from '@antv/g';
|
|
1
|
+
import { AABB, CircleStyleProps, DisplayObject, EllipseStyleProps, Group, HTMLStyleProps, IAnimation, ImageStyleProps, LineStyleProps, PathStyleProps, PolygonStyleProps, PolylineStyleProps, RectStyleProps, TextStyleProps } from '@antv/g';
|
|
3
2
|
import { CubeGeometryProps, PlaneGeometryProps, SphereGeometryProps } from '@antv/g-plugin-3d';
|
|
4
|
-
import {
|
|
3
|
+
import { ID } from '@antv/graphlib';
|
|
4
|
+
import { IAnimates } from './animate';
|
|
5
5
|
import { ComboDisplayModel, ComboEncode, ComboModel, ComboModelData, ComboUserModel } from './combo';
|
|
6
6
|
import { EdgeDisplayModel, EdgeEncode, EdgeModel, EdgeModelData, EdgeShapeMap, EdgeUserModel } from './edge';
|
|
7
7
|
import { NodeDisplayModel, NodeEncode, NodeModel, NodeModelData, NodeShapeMap, NodeUserModel } from './node';
|
|
8
8
|
import { ComboStyleSet, EdgeStyleSet, NodeStyleSet } from './theme';
|
|
9
|
-
export type GShapeStyle = CircleStyleProps & RectStyleProps & EllipseStyleProps & PolygonStyleProps & LineStyleProps & PolylineStyleProps & TextStyleProps & ImageStyleProps & PathStyleProps & SphereGeometryProps & CubeGeometryProps & PlaneGeometryProps & {
|
|
9
|
+
export type GShapeStyle = CircleStyleProps & RectStyleProps & EllipseStyleProps & PolygonStyleProps & LineStyleProps & PolylineStyleProps & TextStyleProps & ImageStyleProps & PathStyleProps & SphereGeometryProps & CubeGeometryProps & HTMLStyleProps & PlaneGeometryProps & {
|
|
10
10
|
interactive?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type ClipCfg = {
|
|
@@ -15,7 +15,7 @@ export type ClipCfg = {
|
|
|
15
15
|
} & CircleStyleProps & RectStyleProps & EllipseStyleProps;
|
|
16
16
|
export type ShapeStyle = Partial<GShapeStyle & {
|
|
17
17
|
animates?: IAnimates;
|
|
18
|
-
lod?: number;
|
|
18
|
+
lod?: number | 'auto';
|
|
19
19
|
visible?: boolean;
|
|
20
20
|
} & {
|
|
21
21
|
clipCfg?: ClipCfg;
|
|
@@ -26,7 +26,6 @@ export interface Encode<T> {
|
|
|
26
26
|
}
|
|
27
27
|
export interface ShapeAttrEncode {
|
|
28
28
|
[shapeAttr: string]: unknown | Encode<unknown>;
|
|
29
|
-
animates?: IAnimates | Encode<IAnimates>;
|
|
30
29
|
}
|
|
31
30
|
export interface LabelBackground {
|
|
32
31
|
fill?: string;
|
|
@@ -40,12 +39,11 @@ export interface ShapesEncode {
|
|
|
40
39
|
iconShape?: ShapeAttrEncode | Encode<ShapeStyle>;
|
|
41
40
|
otherShapes?: {
|
|
42
41
|
[shapeId: string]: {
|
|
43
|
-
[
|
|
44
|
-
animates: IAnimates | Encode<IAnimates>;
|
|
42
|
+
[shapeAttr: string]: unknown | Encode<unknown>;
|
|
45
43
|
};
|
|
46
44
|
};
|
|
47
45
|
}
|
|
48
|
-
export type SHAPE_TYPE = 'rect' | 'circle' | 'ellipse' | 'polygon' | 'image' | 'polyline' | 'line' | 'path' | 'text' | 'group';
|
|
46
|
+
export type SHAPE_TYPE = 'rect' | 'circle' | 'ellipse' | 'polygon' | 'image' | 'polyline' | 'line' | 'path' | 'text' | 'group' | 'html';
|
|
49
47
|
export type SHAPE_TYPE_3D = 'sphere' | 'cube' | 'plane';
|
|
50
48
|
export type ITEM_TYPE = 'node' | 'edge' | 'combo';
|
|
51
49
|
export type ItemModelData = NodeModelData | EdgeModelData | ComboModelData;
|
|
@@ -86,18 +84,12 @@ export type ItemShapeStyles = {
|
|
|
86
84
|
};
|
|
87
85
|
animates?: IAnimates;
|
|
88
86
|
};
|
|
89
|
-
export interface
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
primary?: boolean;
|
|
93
|
-
}[];
|
|
94
|
-
animateCfg: AnimateCfg;
|
|
87
|
+
export interface LodLevel {
|
|
88
|
+
zoomRange: [number, number];
|
|
89
|
+
primary?: boolean;
|
|
95
90
|
}
|
|
96
|
-
export interface
|
|
97
|
-
|
|
98
|
-
[levelIdx: number]: [number, number];
|
|
99
|
-
};
|
|
100
|
-
animateCfg: AnimateCfg;
|
|
91
|
+
export interface LodLevelRanges {
|
|
92
|
+
[levelIdx: number]: [number, number];
|
|
101
93
|
}
|
|
102
94
|
/**
|
|
103
95
|
* Base item of node / edge / combo.
|
|
@@ -110,7 +102,7 @@ export interface IItem {
|
|
|
110
102
|
displayModel: ItemDisplayModel;
|
|
111
103
|
/** The style mapper configured at graph with field name 'node' / 'edge' / 'combo'. */
|
|
112
104
|
mapper: DisplayMapper;
|
|
113
|
-
/** The state
|
|
105
|
+
/** The state style mapper configured at graph with field name 'nodeState' / 'edgeState' / 'comboState'. */
|
|
114
106
|
stateMapper: {
|
|
115
107
|
[stateName: string]: DisplayMapper;
|
|
116
108
|
};
|
|
@@ -142,10 +134,10 @@ export interface IItem {
|
|
|
142
134
|
[stateName: string]: ItemShapeStyles;
|
|
143
135
|
};
|
|
144
136
|
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
145
|
-
|
|
137
|
+
lodLevels: LodLevelRanges;
|
|
146
138
|
/** Last zoom ratio. */
|
|
147
139
|
zoom: number;
|
|
148
|
-
/** Cache the
|
|
140
|
+
/** Cache the changing states which are not consumed by draw */
|
|
149
141
|
changedStates: string[];
|
|
150
142
|
/** The listener for the animations frames. */
|
|
151
143
|
onframe: Function;
|
|
@@ -176,7 +168,7 @@ export interface IItem {
|
|
|
176
168
|
current: ItemModelData;
|
|
177
169
|
}, isReplace?: boolean, itemTheme?: {
|
|
178
170
|
styles: NodeStyleSet | EdgeStyleSet | ComboStyleSet;
|
|
179
|
-
|
|
171
|
+
lodLevels: LodLevelRanges;
|
|
180
172
|
}, onlyMove?: boolean, animate?: boolean, onfinish?: Function) => void;
|
|
181
173
|
/**
|
|
182
174
|
* Update the group's position, e.g. node, combo.
|
|
@@ -232,7 +224,7 @@ export interface IItem {
|
|
|
232
224
|
getBBox: () => AABB;
|
|
233
225
|
/** Stop all the animations on the item. */
|
|
234
226
|
stopAnimations: () => void;
|
|
235
|
-
/** Animations' frame
|
|
227
|
+
/** Animations' frame listener. */
|
|
236
228
|
animateFrameListener: Function;
|
|
237
229
|
/** Call render extension's onZoom to response the graph zooming. */
|
|
238
230
|
updateZoom: (zoom: number) => void;
|
package/lib/types/item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"src/","sources":["types/item.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"src/","sources":["types/item.ts"],"names":[],"mappings":";;;AA+IA,IAAY,aAaX;AAbD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,0CAAyB,CAAA;IACzB,8BAAa,CAAA;IACb,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,4BAAW,CAAA;IACX,sCAAqB,CAAA;AACvB,CAAC,EAbW,aAAa,6BAAb,aAAa,QAaxB"}
|
package/lib/types/layout.d.ts
CHANGED
|
@@ -18,21 +18,26 @@ type Workerized = {
|
|
|
18
18
|
*/
|
|
19
19
|
workerEnabled?: boolean;
|
|
20
20
|
/**
|
|
21
|
-
* Iterations for
|
|
21
|
+
* Iterations for iterable layouts such as Force.
|
|
22
22
|
*/
|
|
23
23
|
iterations?: number;
|
|
24
24
|
};
|
|
25
|
+
type PureLayoutOptions = CircularLayout | RandomLayout | ConcentricLayout | GridLayout | MDSLayout | RadialLayout | FruchtermanLayout | D3ForceLayout | ForceLayout | ForceAtlas2 | CustomLayout;
|
|
25
26
|
export type ImmediatelyInvokedLayoutOptions = {
|
|
26
27
|
/**
|
|
27
28
|
* like an IIFE.
|
|
28
29
|
*/
|
|
29
30
|
execute: (graph: GraphCore, options?: any) => Promise<LayoutMapping>;
|
|
30
|
-
} & Animatable
|
|
31
|
+
} & Animatable & {
|
|
32
|
+
presetLayout?: Partial<PureLayoutOptions>;
|
|
33
|
+
};
|
|
31
34
|
type CustomLayout = {
|
|
32
35
|
type: string;
|
|
33
36
|
[option: string]: any;
|
|
34
37
|
};
|
|
35
|
-
export type StandardLayoutOptions =
|
|
38
|
+
export type StandardLayoutOptions = PureLayoutOptions & Animatable & Workerized & {
|
|
39
|
+
presetLayout?: Partial<PureLayoutOptions>;
|
|
40
|
+
};
|
|
36
41
|
export type LayoutOptions = StandardLayoutOptions | ImmediatelyInvokedLayoutOptions;
|
|
37
42
|
export declare function isImmediatelyInvokedLayoutOptions(options: any): options is ImmediatelyInvokedLayoutOptions;
|
|
38
43
|
export declare function isLayoutWorkerized(options: StandardLayoutOptions): boolean;
|
package/lib/types/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"src/","sources":["types/layout.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"src/","sources":["types/layout.ts"],"names":[],"mappings":";;;AA+EA,SAAgB,iCAAiC,CAC/C,OAAY;IAEZ,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AAC3B,CAAC;AAJD,8EAIC;AAED,SAAgB,kBAAkB,CAAC,OAA8B;IAC/D,OAAO,CACL;QACE,UAAU;QACV,QAAQ;QACR,MAAM;QACN,KAAK;QACL,YAAY;QACZ,QAAQ;QACR,aAAa;QACb,gBAAgB;QAChB,SAAS;QACT,OAAO;QACP,QAAQ;QACR,aAAa;KACd,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC7B,CAAC;AACJ,CAAC;AAjBD,gDAiBC"}
|
package/lib/types/node.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Node as GNode, ID, PlainObject } from '@antv/graphlib';
|
|
|
3
3
|
import { BaseNode } from '../stdlib/item/node/base';
|
|
4
4
|
import { BaseNode3D } from '../stdlib/item/node/base3d';
|
|
5
5
|
import { IAnimates } from './animate';
|
|
6
|
-
import { BadgePosition, Encode, IBadgePosition, IItem, ItemShapeStyles,
|
|
6
|
+
import { BadgePosition, Encode, IBadgePosition, IItem, ItemShapeStyles, LodLevel, ShapeAttrEncode, ShapeStyle, ShapesEncode } from './item';
|
|
7
7
|
export type NodeLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'right';
|
|
8
8
|
/** Data in user input model. */
|
|
9
9
|
export interface NodeUserModelData extends PlainObject {
|
|
@@ -138,44 +138,14 @@ export interface NodeShapeStyles extends ItemShapeStyles {
|
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
140
|
anchorShapes?: ShapeStyle & {
|
|
141
|
-
/**
|
|
142
|
-
* Background color of the anchor.
|
|
143
|
-
*/
|
|
144
|
-
color?: string;
|
|
145
|
-
/**
|
|
146
|
-
* Color of the text in anchor.
|
|
147
|
-
*/
|
|
148
|
-
textColor?: string;
|
|
149
|
-
/**
|
|
150
|
-
* Size of the text in anchor.
|
|
151
|
-
*/
|
|
152
|
-
size?: number;
|
|
153
|
-
/**
|
|
154
|
-
* The x-axis offset of the text relative to the current position
|
|
155
|
-
*/
|
|
156
|
-
offsetX?: number;
|
|
157
|
-
/**
|
|
158
|
-
* The y-axis offset of the text relative to the current position
|
|
159
|
-
*/
|
|
160
|
-
offsetY?: number;
|
|
161
|
-
/**
|
|
162
|
-
* The z-axis offset of the text relative to the current position
|
|
163
|
-
*/
|
|
164
|
-
offsetZ?: number;
|
|
165
141
|
[key: number]: ShapeStyle & {
|
|
166
|
-
position?:
|
|
167
|
-
color?: string;
|
|
168
|
-
textColor?: string;
|
|
169
|
-
size?: number;
|
|
170
|
-
offsetX?: number;
|
|
171
|
-
offsetY?: number;
|
|
172
|
-
offsetZ?: number;
|
|
142
|
+
position?: 'top' | 'left' | 'bottom' | 'right' | [number, number];
|
|
173
143
|
};
|
|
174
144
|
};
|
|
175
145
|
}
|
|
176
146
|
/** Data in display model. */
|
|
177
147
|
export type NodeDisplayModelData = NodeModelData & NodeShapeStyles & {
|
|
178
|
-
|
|
148
|
+
lodLevels?: LodLevel[];
|
|
179
149
|
};
|
|
180
150
|
/** User input model. */
|
|
181
151
|
export type NodeUserModel = GNode<NodeUserModelData>;
|
|
@@ -197,6 +167,7 @@ export interface NodeShapesEncode extends ShapesEncode {
|
|
|
197
167
|
}
|
|
198
168
|
export interface NodeEncode extends NodeShapesEncode {
|
|
199
169
|
type?: string | Encode<string>;
|
|
170
|
+
lodLevels?: LodLevel[];
|
|
200
171
|
animates?: IAnimates;
|
|
201
172
|
}
|
|
202
173
|
export interface NodeShapeMap {
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface IPluginBaseConfig {
|
|
|
7
7
|
}
|
|
8
8
|
export declare abstract class Plugin {
|
|
9
9
|
key: string;
|
|
10
|
+
static required: boolean;
|
|
10
11
|
private events;
|
|
11
12
|
options: IPluginBaseConfig;
|
|
12
13
|
destroyed: boolean;
|
|
@@ -22,7 +23,7 @@ export declare abstract class Plugin {
|
|
|
22
23
|
*/
|
|
23
24
|
updateCfgs(options?: IPluginBaseConfig): void;
|
|
24
25
|
/**
|
|
25
|
-
* Get the
|
|
26
|
+
* Get the default options of the plugin.
|
|
26
27
|
*/
|
|
27
28
|
getDefaultCfgs(): {};
|
|
28
29
|
/**
|
package/lib/types/plugin.js
CHANGED
|
@@ -21,7 +21,7 @@ class Plugin {
|
|
|
21
21
|
this.init(this.graph);
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Get the
|
|
24
|
+
* Get the default options of the plugin.
|
|
25
25
|
*/
|
|
26
26
|
getDefaultCfgs() {
|
|
27
27
|
return {};
|
|
@@ -54,4 +54,5 @@ class Plugin {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
exports.Plugin = Plugin;
|
|
57
|
+
Plugin.required = false;
|
|
57
58
|
//# sourceMappingURL=plugin.js.map
|
package/lib/types/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"src/","sources":["types/plugin.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAc3C,MAAsB,MAAM;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"src/","sources":["types/plugin.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAc3C,MAAsB,MAAM;IAa1B;;;OAGG;IACH,YAAY,OAA2B;QACrC,IAAI,CAAC,OAAO,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,OAA2B;QAC3C,IAAI,CAAC,OAAO,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IACD;;OAEG;IACI,OAAO;QACZ,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAA,WAAI,EAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACpB,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QACF,IAAI,CAAC,MAA8B,GAAG,IAAI,CAAC;QAC3C,IAAI,CAAC,OAAoC,GAAG,IAAI,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;;AAjEH,wBAkEC;AA/DQ,eAAQ,GAAY,KAAK,CAAC"}
|
package/lib/types/spec.d.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 { EdgeDisplayModel, EdgeEncode, EdgeModel, EdgeShapesEncode } from './edge';
|
|
6
6
|
import { NodeDisplayModel, NodeEncode, NodeModel, NodeShapesEncode } from './node';
|
|
7
7
|
import { FitViewRules, GraphAlignment } from './view';
|
|
@@ -19,7 +19,9 @@ export interface Specification<B extends BehaviorRegistry, T extends ThemeRegist
|
|
|
19
19
|
container?: string | HTMLElement;
|
|
20
20
|
backgroundCanvas?: Canvas;
|
|
21
21
|
canvas?: Canvas;
|
|
22
|
+
labelCanvas?: Canvas;
|
|
22
23
|
transientCanvas?: Canvas;
|
|
24
|
+
transientLabelCanvas?: Canvas;
|
|
23
25
|
width?: number;
|
|
24
26
|
height?: number;
|
|
25
27
|
renderer?: RendererName | {
|
|
@@ -34,11 +36,11 @@ export interface Specification<B extends BehaviorRegistry, T extends ThemeRegist
|
|
|
34
36
|
tileFirstRender?: boolean | number;
|
|
35
37
|
/** Tile size for first rendering. */
|
|
36
38
|
tileFirstRenderSize?: number;
|
|
37
|
-
/** Whether enable tile hiding / showing for
|
|
39
|
+
/** Whether enable tile hiding / showing for behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
38
40
|
tileBehavior?: boolean | number;
|
|
39
41
|
/** Tile size for shape optimizing by behaviors, e.g. hiding shapes while drag-canvas, zoom-canvas. The enableOptimize in behavior configuration has higher priority. */
|
|
40
42
|
tileBehaviorSize?: number;
|
|
41
|
-
/** Tile size for level of
|
|
43
|
+
/** Tile size for level of detail changing. */
|
|
42
44
|
tileLodSize?: number;
|
|
43
45
|
};
|
|
44
46
|
autoFit?: 'view' | 'center' | {
|
|
@@ -55,12 +57,11 @@ export interface Specification<B extends BehaviorRegistry, T extends ThemeRegist
|
|
|
55
57
|
alignment?: GraphAlignment;
|
|
56
58
|
effectTiming?: CameraAnimationOptions;
|
|
57
59
|
};
|
|
58
|
-
optimizeThreshold?: number;
|
|
59
60
|
/** data */
|
|
60
61
|
data?: DataConfig;
|
|
61
62
|
transforms?: string[] | {
|
|
62
63
|
type: string;
|
|
63
|
-
activeLifecycle:
|
|
64
|
+
activeLifecycle: 'all' | DataLifecycleType | DataLifecycleType[];
|
|
64
65
|
[param: string]: unknown;
|
|
65
66
|
}[] | TransformerFn[];
|
|
66
67
|
/** item */
|
package/lib/types/theme.d.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
|
export interface ThemeOption {
|
|
7
7
|
}
|
|
@@ -14,7 +14,7 @@ export declare abstract class Theme {
|
|
|
14
14
|
updateConfig: (options: any) => void;
|
|
15
15
|
destroy(): void;
|
|
16
16
|
}
|
|
17
|
-
/** Theme
|
|
17
|
+
/** Theme registry table.
|
|
18
18
|
* @example { 'drag-node': DragNodeBehavior, 'my-drag-node': MyDragNodeBehavior }
|
|
19
19
|
*/
|
|
20
20
|
export interface ThemeRegistry {
|
|
@@ -115,7 +115,7 @@ export type ComboStyleSets = ComboStyleSet[] | {
|
|
|
115
115
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
116
116
|
* palette - color palette.
|
|
117
117
|
* styles - style sets to map.
|
|
118
|
-
*
|
|
118
|
+
* lodLevels - level of detail strategy for global setting.
|
|
119
119
|
*/
|
|
120
120
|
export interface NodeThemeSpecifications {
|
|
121
121
|
dataTypeField?: string;
|
|
@@ -123,14 +123,14 @@ export interface NodeThemeSpecifications {
|
|
|
123
123
|
[dataTypeValue: string]: string;
|
|
124
124
|
};
|
|
125
125
|
styles?: NodeStyleSets;
|
|
126
|
-
|
|
126
|
+
lodLevels?: LodLevel[];
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Theme specification for edge.
|
|
130
130
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
131
131
|
* palette - color palette.
|
|
132
132
|
* styles - style sets to map.
|
|
133
|
-
*
|
|
133
|
+
* lodLevels - level of detail strategy for global setting.
|
|
134
134
|
*/
|
|
135
135
|
export interface EdgeThemeSpecifications {
|
|
136
136
|
dataTypeField?: string;
|
|
@@ -138,14 +138,14 @@ export interface EdgeThemeSpecifications {
|
|
|
138
138
|
[dataTypeValue: string]: string;
|
|
139
139
|
};
|
|
140
140
|
styles?: EdgeStyleSets;
|
|
141
|
-
|
|
141
|
+
lodLevels?: LodLevel[];
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Theme specification for combo.
|
|
145
145
|
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
146
146
|
* palette - color palette.
|
|
147
147
|
* styles - style sets to map.
|
|
148
|
-
*
|
|
148
|
+
* lodLevels - level of detail strategy for global setting.
|
|
149
149
|
*/
|
|
150
150
|
export interface ComboThemeSpecifications {
|
|
151
151
|
dataTypeField?: string;
|
|
@@ -153,7 +153,7 @@ export interface ComboThemeSpecifications {
|
|
|
153
153
|
[dataTypeValue: string]: string;
|
|
154
154
|
};
|
|
155
155
|
styles?: ComboStyleSets;
|
|
156
|
-
|
|
156
|
+
lodLevels?: LodLevel[];
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
159
|
* Theme specification with node / edge / combo palette and style mappers. And also canvas DOM CSS settings.
|
package/lib/types/view.d.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/lib/util/animate.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
9
9
|
opacity?: undefined;
|
|
10
10
|
strokeOpacity?: undefined;
|
|
11
11
|
offsetDistance?: undefined;
|
|
12
|
+
fill?: undefined;
|
|
12
13
|
} | {
|
|
13
14
|
opacity: number;
|
|
14
15
|
strokeOpacity: number;
|
|
@@ -16,6 +17,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
16
17
|
offsetDistance: number;
|
|
17
18
|
lineDash: (string | number)[];
|
|
18
19
|
fontSize?: undefined;
|
|
20
|
+
fill?: undefined;
|
|
19
21
|
} | {
|
|
20
22
|
opacity: number;
|
|
21
23
|
strokeOpacity: number;
|
|
@@ -23,6 +25,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
23
25
|
offsetDistance: number;
|
|
24
26
|
r: number;
|
|
25
27
|
fontSize?: undefined;
|
|
28
|
+
fill?: undefined;
|
|
26
29
|
} | {
|
|
27
30
|
opacity: number;
|
|
28
31
|
strokeOpacity: number;
|
|
@@ -31,11 +34,13 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
31
34
|
rx: number;
|
|
32
35
|
ry: number;
|
|
33
36
|
fontSize?: undefined;
|
|
37
|
+
fill?: undefined;
|
|
34
38
|
} | {
|
|
35
39
|
fontSize: number;
|
|
36
40
|
opacity: number;
|
|
37
41
|
strokeOpacity: number;
|
|
38
42
|
offsetDistance: number;
|
|
43
|
+
fill: string;
|
|
39
44
|
} | {
|
|
40
45
|
opacity: number;
|
|
41
46
|
strokeOpacity: number;
|
|
@@ -44,6 +49,7 @@ export declare const getShapeAnimateBeginStyles: (shape: any) => {
|
|
|
44
49
|
width: number;
|
|
45
50
|
height: number;
|
|
46
51
|
fontSize?: undefined;
|
|
52
|
+
fill?: undefined;
|
|
47
53
|
};
|
|
48
54
|
/**
|
|
49
55
|
* Initial(timing = show) group animation start from GROUP_ANIMATE_STYLES[0], and end to GROUP_ANIMATE_STYLES[1].
|
|
@@ -60,7 +66,6 @@ export declare const DEFAULT_ANIMATE_CFG: {
|
|
|
60
66
|
duration: number;
|
|
61
67
|
easing: string;
|
|
62
68
|
iterations: number;
|
|
63
|
-
delay: number;
|
|
64
69
|
fill: string;
|
|
65
70
|
};
|
|
66
71
|
show: {
|
|
@@ -95,7 +100,7 @@ export declare const DEFAULT_ANIMATE_CFG: {
|
|
|
95
100
|
*/
|
|
96
101
|
export declare const animateShapes: (animates: IAnimates, mergedStyles: ItemShapeStyles, shapeMap: {
|
|
97
102
|
[shapeId: string]: DisplayObject<any, any>;
|
|
98
|
-
},
|
|
103
|
+
}, shapeIds: string[], groups: Group[], timing?: AnimateTiming, changedStates?: string[], onAnimatesFrame?: Function, onAnimatesEnd?: Function) => IAnimation[];
|
|
99
104
|
export declare const getAnimatesExcludePosition: (animates: any) => any;
|
|
100
105
|
export declare const fadeIn: (id: any, shape: any, style: any, hiddenShape: any, animateConfig: any) => void;
|
|
101
106
|
export declare const fadeOut: (id: any, shape: any, hiddenShapeMap: any, animateConfig: any) => void;
|
package/lib/util/animate.js
CHANGED
|
@@ -12,8 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.stopAnimate = exports.fadeOut = exports.fadeIn = exports.getAnimatesExcludePosition = exports.animateShapes = exports.DEFAULT_ANIMATE_CFG = exports.GROUP_ANIMATE_STYLES = exports.getShapeAnimateBeginStyles = void 0;
|
|
15
|
-
const array_1 = require("./array");
|
|
16
15
|
const util_1 = require("@antv/util");
|
|
16
|
+
const array_1 = require("./array");
|
|
17
|
+
const data_1 = require("./data");
|
|
17
18
|
/**
|
|
18
19
|
* Initial(timing = show) shape animation start from init shape styles, and end to the shape's style config.
|
|
19
20
|
*/
|
|
@@ -42,6 +43,7 @@ const getShapeAnimateBeginStyles = (shape) => {
|
|
|
42
43
|
opacity: 0,
|
|
43
44
|
strokeOpacity: 0,
|
|
44
45
|
offsetDistance: 0,
|
|
46
|
+
fill: '#000',
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
return Object.assign({ width: 0, height: 0 }, commonStyles);
|
|
@@ -68,7 +70,6 @@ exports.DEFAULT_ANIMATE_CFG = {
|
|
|
68
70
|
duration: 500,
|
|
69
71
|
easing: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)',
|
|
70
72
|
iterations: 1,
|
|
71
|
-
delay: 1000,
|
|
72
73
|
fill: 'both',
|
|
73
74
|
},
|
|
74
75
|
show: {
|
|
@@ -136,20 +137,22 @@ const groupTimingAnimates = (animates, segmentedTiming, changedStates) => {
|
|
|
136
137
|
* @param timing
|
|
137
138
|
* @param onfinish
|
|
138
139
|
*/
|
|
139
|
-
const runAnimateGroupOnShapes = (shapeMap,
|
|
140
|
+
const runAnimateGroupOnShapes = (shapeMap, shapeIds = undefined, groups, timingAnimates, targetStylesMap, timing, onfinish, cancelAnimations, canceled) => {
|
|
140
141
|
let maxDuration = -Infinity;
|
|
141
142
|
let maxDurationIdx = -1;
|
|
142
143
|
let hasCanceled = canceled;
|
|
143
144
|
const isOut = timing === 'buildOut' || timing === 'hide';
|
|
144
|
-
const
|
|
145
|
+
const shapeIdsToAnimate = shapeIds ? shapeIds : Object.keys(shapeMap);
|
|
146
|
+
const animations = timingAnimates
|
|
147
|
+
.map((animateOptions) => {
|
|
145
148
|
var _a;
|
|
146
|
-
const { fields, shapeId, order, states } =
|
|
149
|
+
const { fields, shapeId, order, states } = animateOptions, animateCfg = __rest(animateOptions, ["fields", "shapeId", "order", "states"]);
|
|
147
150
|
const animateConfig = Object.assign(Object.assign({}, exports.DEFAULT_ANIMATE_CFG[timing]), animateCfg);
|
|
148
|
-
const {
|
|
151
|
+
const { iterations } = animateConfig;
|
|
149
152
|
if (iterations === Infinity && animateCfg.fill == undefined) {
|
|
150
153
|
animateConfig.fill = 'auto';
|
|
151
154
|
}
|
|
152
|
-
let
|
|
155
|
+
let animates = [];
|
|
153
156
|
if (!shapeId || shapeId === 'group') {
|
|
154
157
|
// animate on group
|
|
155
158
|
const usingFields = [];
|
|
@@ -165,28 +168,32 @@ const runAnimateGroupOnShapes = (shapeMap, group, timingAnimates, targetStylesMa
|
|
|
165
168
|
const targetStyle = targetStylesMap.group || exports.GROUP_ANIMATE_STYLES[isOut ? 0 : 1];
|
|
166
169
|
if (hasCanceled) {
|
|
167
170
|
Object.keys(targetStyle).forEach((key) => {
|
|
168
|
-
group.style[key] = targetStyle[key];
|
|
171
|
+
groups.forEach((group) => (group.style[key] = targetStyle[key]));
|
|
169
172
|
});
|
|
170
173
|
}
|
|
171
174
|
else {
|
|
172
175
|
if (hasOpacity) {
|
|
173
176
|
// opacity on group, animate on all shapes
|
|
174
|
-
|
|
177
|
+
shapeIdsToAnimate.forEach((sid) => {
|
|
175
178
|
var _a;
|
|
176
|
-
|
|
177
|
-
|
|
179
|
+
if (!shapeMap[sid])
|
|
180
|
+
return;
|
|
181
|
+
const { opacity: targetOpacity = isOut ? 0 : 1 } = targetStylesMap[sid] ||
|
|
182
|
+
((_a = targetStylesMap.otherShapes) === null || _a === void 0 ? void 0 : _a[sid]) ||
|
|
178
183
|
{};
|
|
179
|
-
|
|
184
|
+
animates.push(runAnimateOnShape(shapeMap[sid], ['opacity'], { opacity: targetOpacity }, (0, exports.getShapeAnimateBeginStyles)(shapeMap[sid]), animateConfig));
|
|
180
185
|
});
|
|
181
186
|
}
|
|
182
187
|
if (usingFields.length) {
|
|
183
|
-
|
|
188
|
+
animates = animates.concat(groups.map((group) => runAnimateOnShape(group, usingFields, targetStyle, exports.GROUP_ANIMATE_STYLES[isOut ? 1 : 0], animateConfig)));
|
|
184
189
|
}
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
192
|
else {
|
|
188
193
|
const shape = shapeMap[shapeId];
|
|
189
|
-
if (shape &&
|
|
194
|
+
if (shape &&
|
|
195
|
+
shape.style.display !== 'none' &&
|
|
196
|
+
shape.style.visibility !== 'hidden') {
|
|
190
197
|
const targetStyle = targetStylesMap[shapeId] ||
|
|
191
198
|
((_a = targetStylesMap.otherShapes) === null || _a === void 0 ? void 0 : _a[shapeId]) ||
|
|
192
199
|
{};
|
|
@@ -196,11 +203,17 @@ const runAnimateGroupOnShapes = (shapeMap, group, timingAnimates, targetStylesMa
|
|
|
196
203
|
});
|
|
197
204
|
}
|
|
198
205
|
else {
|
|
199
|
-
|
|
206
|
+
animates.push(runAnimateOnShape(shape, fields, targetStyle, (0, exports.getShapeAnimateBeginStyles)(shape), animateConfig));
|
|
200
207
|
}
|
|
201
208
|
}
|
|
202
209
|
}
|
|
203
|
-
|
|
210
|
+
return animates;
|
|
211
|
+
})
|
|
212
|
+
.flat()
|
|
213
|
+
.filter(Boolean);
|
|
214
|
+
animations.forEach((animation, i) => {
|
|
215
|
+
const { duration } = animation.effect.timing;
|
|
216
|
+
if (maxDuration < duration) {
|
|
204
217
|
maxDuration = duration;
|
|
205
218
|
maxDurationIdx = i;
|
|
206
219
|
}
|
|
@@ -210,7 +223,6 @@ const runAnimateGroupOnShapes = (shapeMap, group, timingAnimates, targetStylesMa
|
|
|
210
223
|
cancelAnimations();
|
|
211
224
|
};
|
|
212
225
|
}
|
|
213
|
-
return animation;
|
|
214
226
|
});
|
|
215
227
|
if (maxDurationIdx > -1) {
|
|
216
228
|
const selfOnfinish = animations[maxDurationIdx].onfinish;
|
|
@@ -241,16 +253,16 @@ const runAnimateOnShape = (shape, fields, targetStyle, beginStyle, animateConfig
|
|
|
241
253
|
fields.forEach((key) => {
|
|
242
254
|
animateArr[0][key] =
|
|
243
255
|
shape.style[key] === undefined
|
|
244
|
-
? (0,
|
|
245
|
-
: (0,
|
|
256
|
+
? (0, data_1.cloneJSON)(beginStyle[key])
|
|
257
|
+
: (0, data_1.cloneJSON)(shape.style[key]);
|
|
246
258
|
if (targetStyle[key] === undefined)
|
|
247
259
|
return;
|
|
248
|
-
animateArr[1][key] = (0,
|
|
260
|
+
animateArr[1][key] = (0, data_1.cloneJSON)(targetStyle[key]);
|
|
249
261
|
if (key === 'lineDash') {
|
|
250
262
|
const beginPercents = (0, util_1.uniq)(animateArr[0][key].filter((val) => (0, util_1.isString)(val) && val.includes('%')));
|
|
251
263
|
const targetPercents = (0, util_1.uniq)(animateArr[1][key].filter((val) => (0, util_1.isString)(val) && val.includes('%')));
|
|
252
264
|
if (beginPercents.length || targetPercents.length) {
|
|
253
|
-
percentLineDash = (0,
|
|
265
|
+
percentLineDash = (0, data_1.cloneJSON)(animateArr[0].lineDash);
|
|
254
266
|
const totalLength = shape.getTotalLength();
|
|
255
267
|
beginPercents.forEach((percent, i) => {
|
|
256
268
|
(0, array_1.replaceElements)(animateArr[0][key], percent, (Number(percent.replace('%', '')) / 100) * totalLength);
|
|
@@ -272,6 +284,8 @@ const runAnimateOnShape = (shape, fields, targetStyle, beginStyle, animateConfig
|
|
|
272
284
|
Object.keys(animateArr[1]).forEach((field) => (shape.style[field] = animateArr[1][field]));
|
|
273
285
|
return;
|
|
274
286
|
}
|
|
287
|
+
if (animateConfig.iterations === -1 || animateConfig.iterations === null)
|
|
288
|
+
animateConfig.iterations = Infinity;
|
|
275
289
|
const animation = shape.animate(animateArr, animateConfig);
|
|
276
290
|
if (percentLineDash) {
|
|
277
291
|
animation.onfinish = () => {
|
|
@@ -318,7 +332,7 @@ const checkFrames = (frames, shape) => {
|
|
|
318
332
|
* @param timing timing to match 'when' in the animate config in style
|
|
319
333
|
* @returns
|
|
320
334
|
*/
|
|
321
|
-
const animateShapes = (animates, mergedStyles, shapeMap,
|
|
335
|
+
const animateShapes = (animates, mergedStyles, shapeMap, shapeIds = undefined, groups, timing = 'buildIn', changedStates = [], onAnimatesFrame = () => { }, onAnimatesEnd = () => { }) => {
|
|
322
336
|
if (!(animates === null || animates === void 0 ? void 0 : animates[timing])) {
|
|
323
337
|
onAnimatesEnd(false);
|
|
324
338
|
return;
|
|
@@ -336,7 +350,7 @@ const animateShapes = (animates, mergedStyles, shapeMap, group, timing = 'buildI
|
|
|
336
350
|
!canceled && onAnimatesEnd(canceled);
|
|
337
351
|
return;
|
|
338
352
|
}
|
|
339
|
-
const groupAnimations = runAnimateGroupOnShapes(shapeMap,
|
|
353
|
+
const groupAnimations = runAnimateGroupOnShapes(shapeMap, shapeIds, groups, timingAnimateGroups[groupKeys[i]], mergedStyles, timing, onfinish, // execute next order group
|
|
340
354
|
() => {
|
|
341
355
|
canceled = true;
|
|
342
356
|
onAnimatesEnd(canceled);
|
|
@@ -389,7 +403,7 @@ const getAnimatesExcludePosition = (animates) => {
|
|
|
389
403
|
};
|
|
390
404
|
exports.getAnimatesExcludePosition = getAnimatesExcludePosition;
|
|
391
405
|
const fadeIn = (id, shape, style, hiddenShape, animateConfig) => {
|
|
392
|
-
// omit
|
|
406
|
+
// omit in-existence shape and the shape which is not hidden by zoom changing
|
|
393
407
|
if (!shape || !hiddenShape[id])
|
|
394
408
|
return;
|
|
395
409
|
if (!(shape === null || shape === void 0 ? void 0 : shape.isVisible())) {
|