@antv/g6 5.0.0-alpha.9 → 5.0.0-beta.0
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/dist/g6.min.js +2 -2
- package/esm/api-doc/behaviors.d.ts +2 -0
- package/esm/api-doc/behaviors.js +2 -0
- package/esm/api-doc/behaviors.js.map +1 -0
- package/esm/api-doc/graph.d.ts +4 -0
- package/esm/api-doc/graph.js +4 -0
- package/esm/api-doc/graph.js.map +1 -0
- package/esm/api-doc/item.d.ts +9 -0
- package/esm/api-doc/item.js +3 -0
- package/esm/api-doc/item.js.map +1 -0
- package/esm/api-doc/layout.d.ts +1 -0
- package/esm/api-doc/layout.js +2 -0
- package/esm/api-doc/layout.js.map +1 -0
- package/esm/api-doc/plugins.d.ts +1 -0
- package/esm/api-doc/plugins.js +2 -0
- package/esm/api-doc/plugins.js.map +1 -0
- package/esm/api-doc/types.d.ts +0 -0
- package/esm/api-doc/types.js +3 -0
- package/esm/api-doc/types.js.map +1 -0
- package/esm/api-doc/util.d.ts +3 -0
- package/esm/api-doc/util.js +4 -0
- package/esm/api-doc/util.js.map +1 -0
- package/esm/constant/shape.d.ts +7 -14
- package/esm/constant/shape.js +1 -0
- package/esm/constant/shape.js.map +1 -1
- package/esm/index.d.ts +213 -113
- package/esm/index.js +11 -4
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +13 -6
- package/esm/item/combo.js +72 -8
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +12 -9
- package/esm/item/edge.js +38 -11
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +8 -6
- package/esm/item/item.js +124 -81
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +14 -9
- package/esm/item/node.js +63 -48
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +17 -1
- package/esm/runtime/controller/data.js +320 -223
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/interaction.d.ts +1 -0
- package/esm/runtime/controller/interaction.js +7 -4
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +37 -4
- package/esm/runtime/controller/item.js +475 -177
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +4 -1
- package/esm/runtime/controller/layout.js +96 -14
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.d.ts +11 -0
- package/esm/runtime/controller/plugin.js +39 -6
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/controller/theme.js +8 -4
- package/esm/runtime/controller/theme.js.map +1 -1
- package/esm/runtime/graph.d.ts +181 -39
- package/esm/runtime/graph.js +561 -72
- package/esm/runtime/graph.js.map +1 -1
- package/esm/stdlib/behavior/activate-relations.d.ts +2 -3
- package/esm/stdlib/behavior/activate-relations.js +13 -9
- package/esm/stdlib/behavior/activate-relations.js.map +1 -1
- package/esm/stdlib/behavior/brush-select.d.ts +3 -4
- package/esm/stdlib/behavior/brush-select.js +2 -2
- package/esm/stdlib/behavior/brush-select.js.map +1 -1
- package/esm/stdlib/behavior/click-select.d.ts +2 -3
- package/esm/stdlib/behavior/click-select.js +8 -6
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.d.ts +1 -2
- package/esm/stdlib/behavior/collapse-expand-combo.js +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-tree.d.ts +44 -0
- package/esm/stdlib/behavior/collapse-expand-tree.js +69 -0
- package/esm/stdlib/behavior/collapse-expand-tree.js.map +1 -0
- package/esm/stdlib/behavior/drag-canvas.d.ts +1 -2
- package/esm/stdlib/behavior/drag-canvas.js +15 -11
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.d.ts +16 -4
- package/esm/stdlib/behavior/drag-combo.js +70 -31
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +20 -4
- package/esm/stdlib/behavior/drag-node.js +145 -57
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +1 -2
- package/esm/stdlib/behavior/hover-activate.js +1 -1
- package/esm/stdlib/behavior/hover-activate.js.map +1 -1
- package/esm/stdlib/behavior/index.d.ts +15 -0
- package/esm/stdlib/behavior/index.js +16 -0
- package/esm/stdlib/behavior/index.js.map +1 -0
- package/esm/stdlib/behavior/lasso-select.d.ts +7 -3
- package/esm/stdlib/behavior/lasso-select.js +2 -2
- package/esm/stdlib/behavior/lasso-select.js.map +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +2 -3
- package/esm/stdlib/behavior/orbit-canvas-3d.js +2 -2
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +1 -2
- package/esm/stdlib/behavior/rotate-canvas-3d.js +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +2 -3
- package/esm/stdlib/behavior/track-canvas-3d.js +2 -2
- package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/types.d.ts +13 -0
- package/esm/stdlib/behavior/types.js +2 -0
- package/esm/stdlib/behavior/types.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +1 -2
- package/esm/stdlib/behavior/zoom-canvas-3d.js +7 -7
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +1 -2
- package/esm/stdlib/behavior/zoom-canvas.js +20 -18
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/index.d.ts +3 -0
- package/esm/stdlib/data/index.js +4 -0
- package/esm/stdlib/data/index.js.map +1 -0
- package/esm/stdlib/data/mapNodeSize.d.ts +12 -0
- package/esm/stdlib/data/mapNodeSize.js +43 -0
- package/esm/stdlib/data/mapNodeSize.js.map +1 -0
- package/esm/stdlib/data/transformV4Data.d.ts +9 -0
- package/esm/stdlib/data/transformV4Data.js +142 -0
- package/esm/stdlib/data/transformV4Data.js.map +1 -0
- package/esm/stdlib/data/validateData.d.ts +9 -0
- package/esm/stdlib/data/validateData.js +98 -0
- package/esm/stdlib/data/validateData.js.map +1 -0
- package/esm/stdlib/index.d.ts +113 -69
- package/esm/stdlib/index.js +150 -53
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/index.d.ts +2 -0
- package/esm/stdlib/item/combo/index.js +3 -0
- package/esm/stdlib/item/combo/index.js.map +1 -0
- package/esm/stdlib/item/combo/rect.d.ts +31 -0
- package/esm/stdlib/item/combo/rect.js +65 -0
- package/esm/stdlib/item/combo/rect.js.map +1 -0
- package/esm/stdlib/item/edge/base.d.ts +10 -1
- package/esm/stdlib/item/edge/base.js +36 -5
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/{lib/stdlib/item/edge/cubic-horizon.d.ts → esm/stdlib/item/edge/cubic-horizontal.d.ts} +6 -7
- package/esm/stdlib/item/edge/{cubic-horizon.js → cubic-horizontal.js} +18 -33
- package/esm/stdlib/item/edge/cubic-horizontal.js.map +1 -0
- package/esm/stdlib/item/edge/cubic-vertical.d.ts +7 -8
- package/esm/stdlib/item/edge/cubic-vertical.js +17 -32
- package/esm/stdlib/item/edge/cubic-vertical.js.map +1 -1
- package/esm/stdlib/item/edge/cubic.d.ts +7 -8
- package/esm/stdlib/item/edge/cubic.js +22 -5
- package/esm/stdlib/item/edge/cubic.js.map +1 -1
- package/esm/stdlib/item/edge/index.d.ts +5 -0
- package/esm/stdlib/item/edge/index.js +5 -0
- package/esm/stdlib/item/edge/index.js.map +1 -1
- package/esm/stdlib/item/edge/line.d.ts +1 -1
- package/esm/stdlib/item/edge/line.js +16 -1
- package/esm/stdlib/item/edge/line.js.map +1 -1
- package/esm/stdlib/item/edge/loop.d.ts +32 -0
- package/esm/stdlib/item/edge/loop.js +115 -0
- package/esm/stdlib/item/edge/loop.js.map +1 -0
- package/esm/stdlib/item/edge/polyline.d.ts +44 -0
- package/esm/stdlib/item/edge/polyline.js +92 -0
- package/esm/stdlib/item/edge/polyline.js.map +1 -0
- package/esm/stdlib/item/edge/quadratic.d.ts +5 -6
- package/esm/stdlib/item/edge/quadratic.js +31 -19
- package/esm/stdlib/item/edge/quadratic.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +45 -1
- package/esm/stdlib/item/node/base.js +97 -12
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.js +1 -1
- package/esm/stdlib/item/node/base3d.js.map +1 -1
- package/esm/stdlib/item/node/circle.js +5 -5
- package/esm/stdlib/item/node/circle.js.map +1 -1
- package/esm/stdlib/item/node/diamond.d.ts +32 -0
- package/esm/stdlib/item/node/diamond.js +79 -0
- package/esm/stdlib/item/node/diamond.js.map +1 -0
- package/esm/stdlib/item/node/donut.d.ts +70 -0
- package/esm/stdlib/item/node/donut.js +207 -0
- package/esm/stdlib/item/node/donut.js.map +1 -0
- package/esm/stdlib/item/node/ellipse.d.ts +32 -0
- package/esm/stdlib/item/node/ellipse.js +71 -0
- package/esm/stdlib/item/node/ellipse.js.map +1 -0
- package/esm/stdlib/item/node/hexagon.d.ts +33 -0
- package/esm/stdlib/item/node/hexagon.js +102 -0
- package/esm/stdlib/item/node/hexagon.js.map +1 -0
- package/esm/stdlib/item/node/index.d.ts +7 -0
- package/esm/stdlib/item/node/index.js +7 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/item/node/modelRect.d.ts +61 -0
- package/esm/stdlib/item/node/modelRect.js +186 -0
- package/esm/stdlib/item/node/modelRect.js.map +1 -0
- package/esm/stdlib/item/node/rect.d.ts +1 -0
- package/esm/stdlib/item/node/rect.js +16 -0
- package/esm/stdlib/item/node/rect.js.map +1 -1
- package/esm/stdlib/item/node/star.d.ts +34 -0
- package/esm/stdlib/item/node/star.js +115 -0
- package/esm/stdlib/item/node/star.js.map +1 -0
- package/esm/stdlib/item/node/triangle.d.ts +44 -0
- package/esm/stdlib/item/node/triangle.js +177 -0
- package/esm/stdlib/item/node/triangle.js.map +1 -0
- package/esm/stdlib/plugin/fisheye/index.d.ts +32 -4
- package/esm/stdlib/plugin/fisheye/index.js +3 -2
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -1
- package/esm/stdlib/plugin/grid/index.d.ts +36 -0
- package/esm/stdlib/plugin/grid/index.js +81 -0
- package/esm/stdlib/plugin/grid/index.js.map +1 -0
- package/esm/stdlib/plugin/history/combo-command.d.ts +9 -0
- package/esm/stdlib/plugin/history/combo-command.js +21 -0
- package/esm/stdlib/plugin/history/combo-command.js.map +1 -0
- package/esm/stdlib/plugin/history/command.d.ts +18 -0
- package/esm/stdlib/plugin/history/command.js +51 -0
- package/esm/stdlib/plugin/history/command.js.map +1 -0
- package/esm/stdlib/plugin/history/index.d.ts +112 -0
- package/esm/stdlib/plugin/history/index.js +275 -0
- package/esm/stdlib/plugin/history/index.js.map +1 -0
- package/esm/stdlib/plugin/history/item-data-command.d.ts +14 -0
- package/esm/stdlib/plugin/history/item-data-command.js +63 -0
- package/esm/stdlib/plugin/history/item-data-command.js.map +1 -0
- package/esm/stdlib/plugin/history/layer-updated-command.d.ts +9 -0
- package/esm/stdlib/plugin/history/layer-updated-command.js +21 -0
- package/esm/stdlib/plugin/history/layer-updated-command.js.map +1 -0
- package/esm/stdlib/plugin/history/state-updated-command.d.ts +9 -0
- package/esm/stdlib/plugin/history/state-updated-command.js +20 -0
- package/esm/stdlib/plugin/history/state-updated-command.js.map +1 -0
- package/esm/stdlib/plugin/history/visibility-updated-command.d.ts +10 -0
- package/esm/stdlib/plugin/history/visibility-updated-command.js +23 -0
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -0
- package/esm/stdlib/plugin/hull/bubbleset.d.ts +9 -0
- package/esm/stdlib/plugin/hull/bubbleset.js +592 -0
- package/esm/stdlib/plugin/hull/bubbleset.js.map +1 -0
- package/esm/stdlib/plugin/hull/convexHull.d.ts +14 -0
- package/esm/stdlib/plugin/hull/convexHull.js +56 -0
- package/esm/stdlib/plugin/hull/convexHull.js.map +1 -0
- package/esm/stdlib/plugin/hull/hullComponent.d.ts +87 -0
- package/esm/stdlib/plugin/hull/hullComponent.js +382 -0
- package/esm/stdlib/plugin/hull/hullComponent.js.map +1 -0
- package/esm/stdlib/plugin/hull/index.d.ts +59 -0
- package/esm/stdlib/plugin/hull/index.js +161 -0
- package/esm/stdlib/plugin/hull/index.js.map +1 -0
- package/esm/stdlib/plugin/hull/types.d.ts +15 -0
- package/esm/stdlib/plugin/hull/types.js +2 -0
- package/esm/stdlib/plugin/hull/types.js.map +1 -0
- package/esm/stdlib/plugin/hull/util.d.ts +77 -0
- package/esm/stdlib/plugin/hull/util.js +401 -0
- package/esm/stdlib/plugin/hull/util.js.map +1 -0
- package/esm/stdlib/plugin/index.d.ts +8 -0
- package/esm/stdlib/plugin/index.js +9 -0
- package/esm/stdlib/plugin/index.js.map +1 -0
- package/esm/stdlib/plugin/legend/index.d.ts +45 -3
- package/esm/stdlib/plugin/legend/index.js +47 -42
- package/esm/stdlib/plugin/legend/index.js.map +1 -1
- package/esm/stdlib/plugin/menu/index.d.ts +18 -5
- package/esm/stdlib/plugin/menu/index.js +4 -3
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/minimap/index.d.ts +11 -3
- package/esm/stdlib/plugin/minimap/index.js +19 -21
- package/esm/stdlib/plugin/minimap/index.js.map +1 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +59 -0
- package/esm/stdlib/plugin/toolbar/index.js +215 -0
- package/esm/stdlib/plugin/toolbar/index.js.map +1 -0
- package/esm/stdlib/plugin/tooltip/index.d.ts +24 -3
- package/esm/stdlib/plugin/tooltip/index.js +13 -12
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
- package/esm/stdlib/plugin/types.d.ts +8 -0
- package/esm/stdlib/plugin/types.js +2 -0
- package/esm/stdlib/plugin/types.js.map +1 -0
- package/esm/stdlib/theme/dark.d.ts +1 -2
- package/esm/stdlib/theme/dark.js +9 -1
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/index.d.ts +2 -0
- package/esm/stdlib/theme/index.js +3 -0
- package/esm/stdlib/theme/index.js.map +1 -0
- package/esm/stdlib/theme/light.d.ts +1 -2
- package/esm/stdlib/theme/light.js +12 -2
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/base.d.ts +1 -1
- package/esm/stdlib/themeSolver/base.js +1 -1
- package/esm/stdlib/themeSolver/base.js.map +1 -1
- package/esm/stdlib/themeSolver/index.d.ts +3 -0
- package/esm/stdlib/themeSolver/index.js +4 -0
- package/esm/stdlib/themeSolver/index.js.map +1 -0
- package/esm/stdlib/themeSolver/spec.d.ts +2 -4
- package/esm/stdlib/themeSolver/spec.js +2 -2
- package/esm/stdlib/themeSolver/spec.js.map +1 -1
- package/esm/stdlib/themeSolver/subject.d.ts +2 -4
- package/esm/stdlib/themeSolver/subject.js +2 -2
- package/esm/stdlib/themeSolver/subject.js.map +1 -1
- package/esm/types/behavior.js.map +1 -1
- package/esm/types/combo.d.ts +3 -4
- package/esm/types/common.d.ts +10 -0
- package/esm/types/data.d.ts +10 -4
- package/esm/types/edge.d.ts +17 -2
- package/esm/types/graph.d.ts +129 -16
- package/esm/types/history.d.ts +28 -0
- package/esm/types/history.js +6 -0
- package/esm/types/history.js.map +1 -0
- package/esm/types/hook.d.ts +25 -5
- package/esm/types/index.d.ts +11 -5
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +10 -4
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +4 -1
- package/esm/types/loop.d.ts +21 -0
- package/esm/types/loop.js +12 -0
- package/esm/types/loop.js.map +1 -0
- package/esm/types/node.d.ts +87 -6
- package/esm/types/plugin.d.ts +4 -0
- package/esm/types/plugin.js +1 -1
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/spec.d.ts +26 -9
- package/esm/types/theme.d.ts +76 -10
- package/esm/types/theme.js +1 -2
- package/esm/types/theme.js.map +1 -1
- package/esm/util/animate.d.ts +2 -2
- package/esm/util/animate.js +52 -17
- package/esm/util/animate.js.map +1 -1
- package/esm/util/array.d.ts +8 -0
- package/esm/util/array.js +11 -1
- package/esm/util/array.js.map +1 -1
- package/esm/util/arrow.d.ts +17 -0
- package/esm/util/arrow.js +56 -0
- package/esm/util/arrow.js.map +1 -0
- package/esm/util/bbox.d.ts +106 -0
- package/esm/util/bbox.js +255 -0
- package/esm/util/bbox.js.map +1 -0
- package/esm/util/behavior.d.ts +2 -0
- package/esm/util/behavior.js +12 -0
- package/esm/util/behavior.js.map +1 -0
- package/esm/util/canvas.d.ts +1 -2
- package/esm/util/canvas.js +3 -20
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +33 -2
- package/esm/util/data.js +117 -5
- package/esm/util/data.js.map +1 -1
- package/esm/util/event.d.ts +22 -2
- package/esm/util/event.js +54 -0
- package/esm/util/event.js.map +1 -1
- package/esm/util/extend.d.ts +8 -2
- package/esm/util/extend.js.map +1 -1
- package/esm/util/index.d.ts +41 -3
- package/esm/util/index.js +20 -1
- package/esm/util/index.js.map +1 -1
- package/esm/util/item.d.ts +1 -1
- package/esm/util/item.js +7 -5
- package/esm/util/item.js.map +1 -1
- package/esm/util/layout.d.ts +40 -0
- package/esm/util/layout.js +160 -0
- package/esm/util/layout.js.map +1 -0
- package/esm/util/loop.d.ts +37 -0
- package/esm/util/loop.js +104 -0
- package/esm/util/loop.js.map +1 -0
- package/esm/util/mapper.js +4 -9
- package/esm/util/mapper.js.map +1 -1
- package/esm/util/math.d.ts +15 -0
- package/esm/util/math.js +14 -0
- package/esm/util/math.js.map +1 -1
- package/esm/util/mock.d.ts +30 -0
- package/esm/util/mock.js +69 -0
- package/esm/util/mock.js.map +1 -0
- package/esm/util/path.d.ts +11 -0
- package/esm/util/path.js +44 -0
- package/esm/util/path.js.map +1 -0
- package/esm/util/point.d.ts +24 -2
- package/esm/util/point.js +27 -2
- package/esm/util/point.js.map +1 -1
- package/esm/util/polyline.d.ts +113 -0
- package/esm/util/polyline.js +505 -0
- package/esm/util/polyline.js.map +1 -0
- package/esm/util/router.d.ts +31 -0
- package/esm/util/router.js +380 -0
- package/esm/util/router.js.map +1 -0
- package/esm/util/shape.d.ts +3 -3
- package/esm/util/shape.js +19 -3
- package/esm/util/shape.js.map +1 -1
- package/esm/util/shape3d.d.ts +1 -1
- package/esm/util/shape3d.js +12 -6
- package/esm/util/shape3d.js.map +1 -1
- package/esm/util/type.d.ts +6 -0
- package/esm/util/type.js +7 -1
- package/esm/util/type.js.map +1 -1
- package/esm/util/zoom.d.ts +1 -1
- package/esm/util/zoom.js +6 -2
- package/esm/util/zoom.js.map +1 -1
- package/lib/api-doc/behaviors.d.ts +2 -0
- package/lib/api-doc/behaviors.js +18 -0
- package/lib/api-doc/behaviors.js.map +1 -0
- package/lib/api-doc/graph.d.ts +4 -0
- package/lib/api-doc/graph.js +11 -0
- package/lib/api-doc/graph.js.map +1 -0
- package/lib/api-doc/item.d.ts +9 -0
- package/lib/api-doc/item.js +21 -0
- package/lib/api-doc/item.js.map +1 -0
- package/lib/api-doc/layout.d.ts +1 -0
- package/lib/api-doc/layout.js +3 -0
- package/lib/api-doc/layout.js.map +1 -0
- package/lib/api-doc/plugins.d.ts +1 -0
- package/lib/api-doc/plugins.js +18 -0
- package/lib/api-doc/plugins.js.map +1 -0
- package/lib/api-doc/types.d.ts +0 -0
- package/lib/api-doc/types.js +3 -0
- package/lib/api-doc/types.js.map +1 -0
- package/lib/api-doc/util.d.ts +3 -0
- package/lib/api-doc/util.js +10 -0
- package/lib/api-doc/util.js.map +1 -0
- package/lib/constant/shape.d.ts +7 -14
- package/lib/constant/shape.js +1 -0
- package/lib/constant/shape.js.map +1 -1
- package/lib/index.d.ts +213 -113
- package/lib/index.js +13 -3
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +13 -6
- package/lib/item/combo.js +72 -8
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +12 -9
- package/lib/item/edge.js +38 -11
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +8 -6
- package/lib/item/item.js +123 -80
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +14 -9
- package/lib/item/node.js +63 -48
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +17 -1
- package/lib/runtime/controller/data.js +318 -221
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/interaction.d.ts +1 -0
- package/lib/runtime/controller/interaction.js +7 -4
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +37 -4
- package/lib/runtime/controller/item.js +474 -176
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +4 -1
- package/lib/runtime/controller/layout.js +119 -14
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.d.ts +11 -0
- package/lib/runtime/controller/plugin.js +39 -6
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/controller/theme.js +8 -4
- package/lib/runtime/controller/theme.js.map +1 -1
- package/lib/runtime/graph.d.ts +181 -39
- package/lib/runtime/graph.js +560 -71
- package/lib/runtime/graph.js.map +1 -1
- package/lib/stdlib/behavior/activate-relations.d.ts +2 -3
- package/lib/stdlib/behavior/activate-relations.js +14 -9
- package/lib/stdlib/behavior/activate-relations.js.map +1 -1
- package/lib/stdlib/behavior/brush-select.d.ts +3 -4
- package/lib/stdlib/behavior/brush-select.js +3 -2
- package/lib/stdlib/behavior/brush-select.js.map +1 -1
- package/lib/stdlib/behavior/click-select.d.ts +2 -3
- package/lib/stdlib/behavior/click-select.js +9 -6
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-combo.d.ts +1 -2
- package/lib/stdlib/behavior/collapse-expand-combo.js +2 -1
- package/lib/stdlib/behavior/collapse-expand-combo.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-tree.d.ts +44 -0
- package/lib/stdlib/behavior/collapse-expand-tree.js +73 -0
- package/lib/stdlib/behavior/collapse-expand-tree.js.map +1 -0
- package/lib/stdlib/behavior/drag-canvas.d.ts +1 -2
- package/lib/stdlib/behavior/drag-canvas.js +16 -11
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.d.ts +16 -4
- package/lib/stdlib/behavior/drag-combo.js +70 -30
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +20 -4
- package/lib/stdlib/behavior/drag-node.js +145 -56
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +1 -2
- package/lib/stdlib/behavior/hover-activate.js +2 -1
- package/lib/stdlib/behavior/hover-activate.js.map +1 -1
- package/lib/stdlib/behavior/index.d.ts +15 -0
- package/lib/stdlib/behavior/index.js +32 -0
- package/lib/stdlib/behavior/index.js.map +1 -0
- package/lib/stdlib/behavior/lasso-select.d.ts +7 -3
- package/lib/stdlib/behavior/lasso-select.js +4 -6
- package/lib/stdlib/behavior/lasso-select.js.map +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +2 -3
- package/lib/stdlib/behavior/orbit-canvas-3d.js +4 -6
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +1 -2
- package/lib/stdlib/behavior/rotate-canvas-3d.js +2 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +2 -3
- package/lib/stdlib/behavior/track-canvas-3d.js +4 -6
- package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/types.d.ts +13 -0
- package/lib/stdlib/behavior/types.js +3 -0
- package/lib/stdlib/behavior/types.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +1 -2
- package/lib/stdlib/behavior/zoom-canvas-3d.js +8 -7
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +1 -2
- package/lib/stdlib/behavior/zoom-canvas.js +21 -18
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/index.d.ts +3 -0
- package/lib/stdlib/data/index.js +20 -0
- package/lib/stdlib/data/index.js.map +1 -0
- package/lib/stdlib/data/mapNodeSize.d.ts +12 -0
- package/lib/stdlib/data/mapNodeSize.js +47 -0
- package/lib/stdlib/data/mapNodeSize.js.map +1 -0
- package/lib/stdlib/data/transformV4Data.d.ts +9 -0
- package/lib/stdlib/data/transformV4Data.js +146 -0
- package/lib/stdlib/data/transformV4Data.js.map +1 -0
- package/lib/stdlib/data/validateData.d.ts +9 -0
- package/lib/stdlib/data/validateData.js +102 -0
- package/lib/stdlib/data/validateData.js.map +1 -0
- package/lib/stdlib/index.d.ts +113 -69
- package/lib/stdlib/index.js +188 -67
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/index.d.ts +2 -0
- package/lib/stdlib/item/combo/index.js +19 -0
- package/lib/stdlib/item/combo/index.js.map +1 -0
- package/lib/stdlib/item/combo/rect.d.ts +31 -0
- package/lib/stdlib/item/combo/rect.js +69 -0
- package/lib/stdlib/item/combo/rect.js.map +1 -0
- package/lib/stdlib/item/edge/base.d.ts +10 -1
- package/lib/stdlib/item/edge/base.js +35 -4
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/{esm/stdlib/item/edge/cubic-horizon.d.ts → lib/stdlib/item/edge/cubic-horizontal.d.ts} +6 -7
- package/lib/stdlib/item/edge/{cubic-horizon.js → cubic-horizontal.js} +20 -35
- package/lib/stdlib/item/edge/cubic-horizontal.js.map +1 -0
- package/lib/stdlib/item/edge/cubic-vertical.d.ts +7 -8
- package/lib/stdlib/item/edge/cubic-vertical.js +17 -32
- package/lib/stdlib/item/edge/cubic-vertical.js.map +1 -1
- package/lib/stdlib/item/edge/cubic.d.ts +7 -8
- package/lib/stdlib/item/edge/cubic.js +22 -5
- package/lib/stdlib/item/edge/cubic.js.map +1 -1
- package/lib/stdlib/item/edge/index.d.ts +5 -0
- package/lib/stdlib/item/edge/index.js +5 -0
- package/lib/stdlib/item/edge/index.js.map +1 -1
- package/lib/stdlib/item/edge/line.d.ts +1 -1
- package/lib/stdlib/item/edge/line.js +16 -1
- package/lib/stdlib/item/edge/line.js.map +1 -1
- package/lib/stdlib/item/edge/loop.d.ts +32 -0
- package/lib/stdlib/item/edge/loop.js +119 -0
- package/lib/stdlib/item/edge/loop.js.map +1 -0
- package/lib/stdlib/item/edge/polyline.d.ts +44 -0
- package/lib/stdlib/item/edge/polyline.js +96 -0
- package/lib/stdlib/item/edge/polyline.js.map +1 -0
- package/lib/stdlib/item/edge/quadratic.d.ts +5 -6
- package/lib/stdlib/item/edge/quadratic.js +33 -21
- package/lib/stdlib/item/edge/quadratic.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +45 -1
- package/lib/stdlib/item/node/base.js +97 -12
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.js +1 -1
- package/lib/stdlib/item/node/base3d.js.map +1 -1
- package/lib/stdlib/item/node/circle.js +5 -5
- package/lib/stdlib/item/node/circle.js.map +1 -1
- package/lib/stdlib/item/node/diamond.d.ts +32 -0
- package/lib/stdlib/item/node/diamond.js +83 -0
- package/lib/stdlib/item/node/diamond.js.map +1 -0
- package/lib/stdlib/item/node/donut.d.ts +70 -0
- package/lib/stdlib/item/node/donut.js +211 -0
- package/lib/stdlib/item/node/donut.js.map +1 -0
- package/lib/stdlib/item/node/ellipse.d.ts +32 -0
- package/lib/stdlib/item/node/ellipse.js +75 -0
- package/lib/stdlib/item/node/ellipse.js.map +1 -0
- package/lib/stdlib/item/node/hexagon.d.ts +33 -0
- package/lib/stdlib/item/node/hexagon.js +106 -0
- package/lib/stdlib/item/node/hexagon.js.map +1 -0
- package/lib/stdlib/item/node/index.d.ts +7 -0
- package/lib/stdlib/item/node/index.js +7 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/item/node/modelRect.d.ts +61 -0
- package/lib/stdlib/item/node/modelRect.js +190 -0
- package/lib/stdlib/item/node/modelRect.js.map +1 -0
- package/lib/stdlib/item/node/rect.d.ts +1 -0
- package/lib/stdlib/item/node/rect.js +16 -0
- package/lib/stdlib/item/node/rect.js.map +1 -1
- package/lib/stdlib/item/node/star.d.ts +34 -0
- package/lib/stdlib/item/node/star.js +119 -0
- package/lib/stdlib/item/node/star.js.map +1 -0
- package/lib/stdlib/item/node/triangle.d.ts +44 -0
- package/lib/stdlib/item/node/triangle.js +181 -0
- package/lib/stdlib/item/node/triangle.js.map +1 -0
- package/lib/stdlib/plugin/fisheye/index.d.ts +32 -4
- package/lib/stdlib/plugin/fisheye/index.js +3 -1
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -1
- package/lib/stdlib/plugin/grid/index.d.ts +36 -0
- package/lib/stdlib/plugin/grid/index.js +85 -0
- package/lib/stdlib/plugin/grid/index.js.map +1 -0
- package/lib/stdlib/plugin/history/combo-command.d.ts +9 -0
- package/lib/stdlib/plugin/history/combo-command.js +25 -0
- package/lib/stdlib/plugin/history/combo-command.js.map +1 -0
- package/lib/stdlib/plugin/history/command.d.ts +18 -0
- package/lib/stdlib/plugin/history/command.js +54 -0
- package/lib/stdlib/plugin/history/command.js.map +1 -0
- package/lib/stdlib/plugin/history/index.d.ts +112 -0
- package/lib/stdlib/plugin/history/index.js +283 -0
- package/lib/stdlib/plugin/history/index.js.map +1 -0
- package/lib/stdlib/plugin/history/item-data-command.d.ts +14 -0
- package/lib/stdlib/plugin/history/item-data-command.js +67 -0
- package/lib/stdlib/plugin/history/item-data-command.js.map +1 -0
- package/lib/stdlib/plugin/history/layer-updated-command.d.ts +9 -0
- package/lib/stdlib/plugin/history/layer-updated-command.js +25 -0
- package/lib/stdlib/plugin/history/layer-updated-command.js.map +1 -0
- package/lib/stdlib/plugin/history/state-updated-command.d.ts +9 -0
- package/lib/stdlib/plugin/history/state-updated-command.js +24 -0
- package/lib/stdlib/plugin/history/state-updated-command.js.map +1 -0
- package/lib/stdlib/plugin/history/visibility-updated-command.d.ts +10 -0
- package/lib/stdlib/plugin/history/visibility-updated-command.js +27 -0
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -0
- package/lib/stdlib/plugin/hull/bubbleset.d.ts +9 -0
- package/lib/stdlib/plugin/hull/bubbleset.js +596 -0
- package/lib/stdlib/plugin/hull/bubbleset.js.map +1 -0
- package/lib/stdlib/plugin/hull/convexHull.d.ts +14 -0
- package/lib/stdlib/plugin/hull/convexHull.js +61 -0
- package/lib/stdlib/plugin/hull/convexHull.js.map +1 -0
- package/lib/stdlib/plugin/hull/hullComponent.d.ts +87 -0
- package/lib/stdlib/plugin/hull/hullComponent.js +385 -0
- package/lib/stdlib/plugin/hull/hullComponent.js.map +1 -0
- package/lib/stdlib/plugin/hull/index.d.ts +59 -0
- package/lib/stdlib/plugin/hull/index.js +167 -0
- package/lib/stdlib/plugin/hull/index.js.map +1 -0
- package/lib/stdlib/plugin/hull/types.d.ts +15 -0
- package/lib/stdlib/plugin/hull/types.js +3 -0
- package/lib/stdlib/plugin/hull/types.js.map +1 -0
- package/lib/stdlib/plugin/hull/util.d.ts +77 -0
- package/lib/stdlib/plugin/hull/util.js +419 -0
- package/lib/stdlib/plugin/hull/util.js.map +1 -0
- package/lib/stdlib/plugin/index.d.ts +8 -0
- package/lib/stdlib/plugin/index.js +25 -0
- package/lib/stdlib/plugin/index.js.map +1 -0
- package/lib/stdlib/plugin/legend/index.d.ts +45 -3
- package/lib/stdlib/plugin/legend/index.js +46 -40
- package/lib/stdlib/plugin/legend/index.js.map +1 -1
- package/lib/stdlib/plugin/menu/index.d.ts +18 -5
- package/lib/stdlib/plugin/menu/index.js +5 -3
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/minimap/index.d.ts +11 -3
- package/lib/stdlib/plugin/minimap/index.js +19 -20
- package/lib/stdlib/plugin/minimap/index.js.map +1 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +59 -0
- package/lib/stdlib/plugin/toolbar/index.js +222 -0
- package/lib/stdlib/plugin/toolbar/index.js.map +1 -0
- package/lib/stdlib/plugin/tooltip/index.d.ts +24 -3
- package/lib/stdlib/plugin/tooltip/index.js +14 -12
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
- package/lib/stdlib/plugin/types.d.ts +8 -0
- package/lib/stdlib/plugin/types.js +3 -0
- package/lib/stdlib/plugin/types.js.map +1 -0
- package/lib/stdlib/theme/dark.d.ts +1 -2
- package/lib/stdlib/theme/dark.js +10 -1
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/index.d.ts +2 -0
- package/lib/stdlib/theme/index.js +19 -0
- package/lib/stdlib/theme/index.js.map +1 -0
- package/lib/stdlib/theme/light.d.ts +1 -2
- package/lib/stdlib/theme/light.js +13 -2
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/base.d.ts +1 -1
- package/lib/stdlib/themeSolver/base.js +2 -1
- package/lib/stdlib/themeSolver/base.js.map +1 -1
- package/lib/stdlib/themeSolver/index.d.ts +3 -0
- package/lib/stdlib/themeSolver/index.js +20 -0
- package/lib/stdlib/themeSolver/index.js.map +1 -0
- package/lib/stdlib/themeSolver/spec.d.ts +2 -4
- package/lib/stdlib/themeSolver/spec.js +4 -6
- package/lib/stdlib/themeSolver/spec.js.map +1 -1
- package/lib/stdlib/themeSolver/subject.d.ts +2 -4
- package/lib/stdlib/themeSolver/subject.js +4 -4
- package/lib/stdlib/themeSolver/subject.js.map +1 -1
- package/lib/types/behavior.js.map +1 -1
- package/lib/types/combo.d.ts +3 -4
- package/lib/types/common.d.ts +10 -0
- package/lib/types/data.d.ts +10 -4
- package/lib/types/edge.d.ts +17 -2
- package/lib/types/graph.d.ts +129 -16
- package/lib/types/history.d.ts +28 -0
- package/lib/types/history.js +9 -0
- package/lib/types/history.js.map +1 -0
- package/lib/types/hook.d.ts +25 -5
- package/lib/types/index.d.ts +11 -5
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +10 -4
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +4 -1
- package/lib/types/loop.d.ts +21 -0
- package/lib/types/loop.js +15 -0
- package/lib/types/loop.js.map +1 -0
- package/lib/types/node.d.ts +87 -6
- package/lib/types/plugin.d.ts +4 -0
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/spec.d.ts +26 -9
- package/lib/types/theme.d.ts +76 -10
- package/lib/types/theme.js +1 -2
- package/lib/types/theme.js.map +1 -1
- package/lib/util/animate.d.ts +2 -2
- package/lib/util/animate.js +52 -17
- package/lib/util/animate.js.map +1 -1
- package/lib/util/array.d.ts +8 -0
- package/lib/util/array.js +13 -2
- package/lib/util/array.js.map +1 -1
- package/lib/util/arrow.d.ts +17 -0
- package/lib/util/arrow.js +60 -0
- package/lib/util/arrow.js.map +1 -0
- package/lib/util/bbox.d.ts +106 -0
- package/lib/util/bbox.js +273 -0
- package/lib/util/bbox.js.map +1 -0
- package/lib/util/behavior.d.ts +2 -0
- package/lib/util/behavior.js +16 -0
- package/lib/util/behavior.js.map +1 -0
- package/lib/util/canvas.d.ts +1 -2
- package/lib/util/canvas.js +3 -20
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +33 -2
- package/lib/util/data.js +121 -6
- package/lib/util/data.js.map +1 -1
- package/lib/util/event.d.ts +22 -2
- package/lib/util/event.js +56 -1
- package/lib/util/event.js.map +1 -1
- package/lib/util/extend.d.ts +8 -2
- package/lib/util/extend.js.map +1 -1
- package/lib/util/index.d.ts +41 -3
- package/lib/util/index.js +20 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/item.d.ts +1 -1
- package/lib/util/item.js +7 -5
- package/lib/util/item.js.map +1 -1
- package/lib/util/layout.d.ts +40 -0
- package/lib/util/layout.js +172 -0
- package/lib/util/layout.js.map +1 -0
- package/lib/util/loop.d.ts +37 -0
- package/lib/util/loop.js +111 -0
- package/lib/util/loop.js.map +1 -0
- package/lib/util/mapper.js +4 -9
- package/lib/util/mapper.js.map +1 -1
- package/lib/util/math.d.ts +15 -0
- package/lib/util/math.js +17 -1
- package/lib/util/math.js.map +1 -1
- package/lib/util/mock.d.ts +30 -0
- package/lib/util/mock.js +73 -0
- package/lib/util/mock.js.map +1 -0
- package/lib/util/path.d.ts +11 -0
- package/lib/util/path.js +49 -0
- package/lib/util/path.js.map +1 -0
- package/lib/util/point.d.ts +24 -2
- package/lib/util/point.js +31 -3
- package/lib/util/point.js.map +1 -1
- package/lib/util/polyline.d.ts +113 -0
- package/lib/util/polyline.js +524 -0
- package/lib/util/polyline.js.map +1 -0
- package/lib/util/router.d.ts +31 -0
- package/lib/util/router.js +384 -0
- package/lib/util/router.js.map +1 -0
- package/lib/util/shape.d.ts +3 -3
- package/lib/util/shape.js +19 -3
- package/lib/util/shape.js.map +1 -1
- package/lib/util/shape3d.d.ts +1 -1
- package/lib/util/shape3d.js +11 -5
- package/lib/util/shape3d.js.map +1 -1
- package/lib/util/type.d.ts +6 -0
- package/lib/util/type.js +9 -2
- package/lib/util/type.js.map +1 -1
- package/lib/util/zoom.d.ts +1 -1
- package/lib/util/zoom.js +6 -2
- package/lib/util/zoom.js.map +1 -1
- package/package.json +35 -15
- package/src/api-doc/behaviors.ts +2 -0
- package/src/api-doc/graph.ts +4 -0
- package/src/api-doc/item.ts +43 -0
- package/src/api-doc/layout.ts +13 -0
- package/src/api-doc/plugins.ts +1 -0
- package/src/api-doc/readme.md +59 -0
- package/src/api-doc/types.ts +2 -0
- package/src/api-doc/util.ts +3 -0
- package/src/constant/shape.ts +4 -1
- package/src/index.ts +14 -4
- package/src/item/combo.ts +105 -18
- package/src/item/edge.ts +68 -18
- package/src/item/item.ts +138 -82
- package/src/item/node.ts +100 -54
- package/src/runtime/controller/data.ts +410 -258
- package/src/runtime/controller/interaction.ts +8 -4
- package/src/runtime/controller/item.ts +690 -252
- package/src/runtime/controller/layout.ts +147 -14
- package/src/runtime/controller/plugin.ts +47 -10
- package/src/runtime/controller/theme.ts +8 -4
- package/src/runtime/graph.ts +721 -130
- package/src/stdlib/behavior/activate-relations.ts +14 -11
- package/src/stdlib/behavior/brush-select.ts +4 -5
- package/src/stdlib/behavior/click-select.ts +12 -10
- package/src/stdlib/behavior/collapse-expand-combo.ts +1 -3
- package/src/stdlib/behavior/collapse-expand-tree.ts +106 -0
- package/src/stdlib/behavior/drag-canvas.ts +15 -13
- package/src/stdlib/behavior/drag-combo.ts +109 -53
- package/src/stdlib/behavior/drag-node.ts +220 -83
- package/src/stdlib/behavior/hover-activate.ts +1 -2
- package/src/stdlib/behavior/index.ts +15 -0
- package/src/stdlib/behavior/lasso-select.ts +6 -2
- package/src/stdlib/behavior/orbit-canvas-3d.ts +2 -4
- package/src/stdlib/behavior/rotate-canvas-3d.ts +1 -3
- package/src/stdlib/behavior/track-canvas-3d.ts +2 -4
- package/src/stdlib/behavior/types.ts +15 -0
- package/src/stdlib/behavior/zoom-canvas-3d.ts +5 -7
- package/src/stdlib/behavior/zoom-canvas.ts +19 -19
- package/src/stdlib/data/index.ts +3 -0
- package/src/stdlib/data/mapNodeSize.ts +67 -0
- package/src/stdlib/data/transformV4Data.ts +207 -0
- package/src/stdlib/data/validateData.ts +146 -0
- package/src/stdlib/index.ts +215 -53
- package/src/stdlib/item/combo/index.ts +2 -0
- package/src/stdlib/item/combo/rect.ts +123 -0
- package/src/stdlib/item/edge/base.ts +66 -4
- package/src/stdlib/item/edge/{cubic-horizon.ts → cubic-horizontal.ts} +25 -53
- package/src/stdlib/item/edge/cubic-vertical.ts +24 -55
- package/src/stdlib/item/edge/cubic.ts +36 -36
- package/src/stdlib/item/edge/index.ts +5 -0
- package/src/stdlib/item/edge/line.ts +14 -15
- package/src/stdlib/item/edge/loop.ts +162 -0
- package/src/stdlib/item/edge/polyline.ts +161 -0
- package/src/stdlib/item/edge/quadratic.ts +34 -37
- package/src/stdlib/item/node/base.ts +116 -12
- package/src/stdlib/item/node/base3d.ts +2 -0
- package/src/stdlib/item/node/circle.ts +5 -5
- package/src/stdlib/item/node/diamond.ts +144 -0
- package/src/stdlib/item/node/donut.ts +368 -0
- package/src/stdlib/item/node/ellipse.ts +128 -0
- package/src/stdlib/item/node/hexagon.ts +168 -0
- package/src/stdlib/item/node/index.ts +7 -0
- package/src/stdlib/item/node/modelRect.ts +405 -0
- package/src/stdlib/item/node/rect.ts +17 -0
- package/src/stdlib/item/node/star.ts +181 -0
- package/src/stdlib/item/node/triangle.ts +265 -0
- package/src/stdlib/plugin/fisheye/index.ts +35 -6
- package/src/stdlib/plugin/grid/index.ts +125 -0
- package/src/stdlib/plugin/history/combo-command.ts +28 -0
- package/src/stdlib/plugin/history/command.ts +81 -0
- package/src/stdlib/plugin/history/index.ts +347 -0
- package/src/stdlib/plugin/history/item-data-command.ts +96 -0
- package/src/stdlib/plugin/history/layer-updated-command.ts +28 -0
- package/src/stdlib/plugin/history/state-updated-command.ts +36 -0
- package/src/stdlib/plugin/history/visibility-updated-command.ts +41 -0
- package/src/stdlib/plugin/hull/bubbleset.ts +828 -0
- package/src/stdlib/plugin/hull/convexHull.ts +68 -0
- package/src/stdlib/plugin/hull/hullComponent.ts +501 -0
- package/src/stdlib/plugin/hull/index.ts +234 -0
- package/src/stdlib/plugin/hull/types.ts +15 -0
- package/src/stdlib/plugin/hull/util.ts +511 -0
- package/src/stdlib/plugin/index.ts +8 -0
- package/src/stdlib/plugin/legend/index.ts +122 -61
- package/src/stdlib/plugin/menu/index.ts +21 -6
- package/src/stdlib/plugin/minimap/index.ts +35 -26
- package/src/stdlib/plugin/toolbar/index.ts +257 -0
- package/src/stdlib/plugin/tooltip/index.ts +38 -18
- package/src/stdlib/plugin/types.ts +8 -0
- package/src/stdlib/theme/dark.ts +9 -1
- package/src/stdlib/theme/index.ts +2 -0
- package/src/stdlib/theme/light.ts +13 -3
- package/src/stdlib/themeSolver/base.ts +1 -1
- package/src/stdlib/themeSolver/index.ts +3 -0
- package/src/stdlib/themeSolver/spec.ts +2 -5
- package/src/stdlib/themeSolver/subject.ts +2 -5
- package/src/types/behavior.ts +0 -1
- package/src/types/combo.ts +3 -4
- package/src/types/common.ts +13 -0
- package/src/types/data.ts +23 -4
- package/src/types/edge.ts +28 -4
- package/src/types/graph.ts +161 -11
- package/src/types/history.ts +30 -0
- package/src/types/hook.ts +29 -6
- package/src/types/index.ts +37 -12
- package/src/types/item.ts +15 -2
- package/src/types/layout.ts +20 -16
- package/src/types/loop.ts +23 -0
- package/src/types/node.ts +91 -11
- package/src/types/plugin.ts +7 -1
- package/src/types/spec.ts +30 -13
- package/src/types/theme.ts +80 -10
- package/src/util/animate.ts +58 -17
- package/src/util/array.ts +12 -1
- package/src/util/arrow.ts +62 -0
- package/src/util/bbox.ts +298 -0
- package/src/util/behavior.ts +14 -0
- package/src/util/canvas.ts +6 -24
- package/src/util/data.ts +134 -5
- package/src/util/event.ts +86 -2
- package/src/util/extend.ts +8 -2
- package/src/util/index.ts +31 -1
- package/src/util/item.ts +11 -8
- package/src/util/layout.ts +165 -0
- package/src/util/loop.ts +145 -0
- package/src/util/mapper.ts +10 -9
- package/src/util/math.ts +24 -0
- package/src/util/mock.ts +72 -0
- package/src/util/path.ts +52 -0
- package/src/util/point.ts +33 -2
- package/src/util/polyline.ts +676 -0
- package/src/util/router.ts +552 -0
- package/src/util/shape.ts +23 -7
- package/src/util/shape3d.ts +16 -11
- package/src/util/type.ts +8 -1
- package/src/util/zoom.ts +7 -3
- package/esm/stdlib/data/comboFromNode.d.ts +0 -9
- package/esm/stdlib/data/comboFromNode.js +0 -28
- package/esm/stdlib/data/comboFromNode.js.map +0 -1
- package/esm/stdlib/item/edge/cubic-horizon.js.map +0 -1
- package/lib/stdlib/data/comboFromNode.d.ts +0 -9
- package/lib/stdlib/data/comboFromNode.js +0 -32
- package/lib/stdlib/data/comboFromNode.js.map +0 -1
- package/lib/stdlib/item/edge/cubic-horizon.js.map +0 -1
- package/src/stdlib/data/comboFromNode.ts +0 -28
package/src/item/edge.ts
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { Group } from '@antv/g';
|
|
1
|
+
import { Circle, Group } from '@antv/g';
|
|
2
2
|
import { clone, throttle } from '@antv/util';
|
|
3
|
-
import { EdgeDisplayModel, EdgeModel,
|
|
3
|
+
import { EdgeDisplayModel, EdgeModel, ID } from '../types';
|
|
4
4
|
import { EdgeModelData } from '../types/edge';
|
|
5
5
|
import { DisplayMapper, State, LodStrategyObj } from '../types/item';
|
|
6
6
|
import { updateShapes } from '../util/shape';
|
|
7
7
|
import { animateShapes } from '../util/animate';
|
|
8
8
|
import { EdgeStyleSet } from '../types/theme';
|
|
9
|
+
import { isSamePoint, getNearestPoint } from '../util/point';
|
|
9
10
|
import Item from './item';
|
|
10
11
|
import Node from './node';
|
|
12
|
+
import Combo from './combo';
|
|
11
13
|
|
|
12
14
|
interface IProps {
|
|
13
15
|
model: EdgeModel;
|
|
14
16
|
renderExtensions: any; // TODO: type
|
|
15
17
|
containerGroup: Group;
|
|
16
|
-
mapper
|
|
17
|
-
stateMapper
|
|
18
|
+
mapper?: DisplayMapper;
|
|
19
|
+
stateMapper?: {
|
|
18
20
|
[stateName: string]: DisplayMapper;
|
|
19
21
|
};
|
|
20
|
-
sourceItem: Node;
|
|
21
|
-
targetItem: Node;
|
|
22
|
+
sourceItem: Node | Combo;
|
|
23
|
+
targetItem: Node | Combo;
|
|
22
24
|
zoom?: number;
|
|
23
25
|
theme: {
|
|
24
26
|
styles: EdgeStyleSet;
|
|
25
27
|
lodStrategy: LodStrategyObj;
|
|
26
28
|
};
|
|
27
29
|
onframe?: Function;
|
|
30
|
+
nodeMap?: Map<ID, Node>;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
export default class Edge extends Item {
|
|
@@ -35,32 +38,73 @@ export default class Edge extends Item {
|
|
|
35
38
|
public displayModel: EdgeDisplayModel;
|
|
36
39
|
/** Set to different value in implements */
|
|
37
40
|
public type: 'edge' = 'edge';
|
|
38
|
-
public
|
|
39
|
-
public
|
|
41
|
+
public nodeMap: Map<ID, Node>;
|
|
42
|
+
public sourceItem: Node | Combo;
|
|
43
|
+
public targetItem: Node | Combo;
|
|
40
44
|
|
|
41
45
|
constructor(props: IProps) {
|
|
42
46
|
super(props);
|
|
43
47
|
this.init({ ...props, type: 'edge' });
|
|
44
|
-
const { sourceItem, targetItem } = props;
|
|
48
|
+
const { sourceItem, targetItem, nodeMap } = props;
|
|
45
49
|
this.sourceItem = sourceItem;
|
|
46
50
|
this.targetItem = targetItem;
|
|
51
|
+
this.nodeMap = nodeMap;
|
|
52
|
+
// todo: combo
|
|
53
|
+
if (sourceItem.getType() === 'node') {
|
|
54
|
+
this.nodeMap.set(sourceItem.getID(), sourceItem as Node);
|
|
55
|
+
}
|
|
56
|
+
if (sourceItem.getType() === 'node') {
|
|
57
|
+
this.nodeMap.set(targetItem.getID(), targetItem as Node);
|
|
58
|
+
}
|
|
47
59
|
this.draw(this.displayModel);
|
|
48
60
|
}
|
|
49
61
|
public draw(
|
|
50
62
|
displayModel: EdgeDisplayModel,
|
|
51
63
|
diffData?: { previous: EdgeModelData; current: EdgeModelData },
|
|
52
64
|
diffState?: { previous: State[]; current: State[] },
|
|
65
|
+
animate = true,
|
|
53
66
|
onfinish: Function = () => {},
|
|
54
67
|
) {
|
|
55
|
-
// get the end
|
|
56
|
-
const {
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
|
|
68
|
+
// get the point near the other end
|
|
69
|
+
const { sourceAnchor, targetAnchor, keyShape } = displayModel.data;
|
|
70
|
+
const sourcePosition = this.sourceItem.getPosition();
|
|
71
|
+
const targetPosition = this.targetItem.getPosition();
|
|
72
|
+
|
|
73
|
+
let targetPrevious = sourcePosition;
|
|
74
|
+
let sourcePrevious = targetPosition;
|
|
75
|
+
|
|
76
|
+
// TODO: type
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
if (keyShape?.controlPoints?.length) {
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
const controlPointsBesideEnds = keyShape.controlPoints.filter(
|
|
81
|
+
(point) =>
|
|
82
|
+
!isSamePoint(point, sourcePosition) &&
|
|
83
|
+
!isSamePoint(point, targetPosition),
|
|
84
|
+
);
|
|
85
|
+
sourcePrevious = getNearestPoint(
|
|
86
|
+
controlPointsBesideEnds,
|
|
87
|
+
sourcePosition,
|
|
88
|
+
).nearestPoint;
|
|
89
|
+
targetPrevious = getNearestPoint(
|
|
90
|
+
controlPointsBesideEnds,
|
|
91
|
+
targetPosition,
|
|
92
|
+
).nearestPoint;
|
|
93
|
+
}
|
|
94
|
+
const sourcePoint = this.sourceItem.getAnchorPoint(
|
|
95
|
+
sourcePrevious,
|
|
96
|
+
sourceAnchor,
|
|
97
|
+
);
|
|
98
|
+
const targetPoint = this.targetItem.getAnchorPoint(
|
|
99
|
+
targetPrevious,
|
|
100
|
+
targetAnchor,
|
|
101
|
+
);
|
|
60
102
|
this.renderExt.mergeStyles(displayModel);
|
|
61
103
|
const firstRendering = !this.shapeMap?.keyShape;
|
|
62
104
|
this.renderExt.setSourcePoint(sourcePoint);
|
|
63
105
|
this.renderExt.setTargetPoint(targetPoint);
|
|
106
|
+
this.renderExt.setNodeMap(this.nodeMap);
|
|
107
|
+
|
|
64
108
|
const shapeMap = this.renderExt.draw(
|
|
65
109
|
displayModel,
|
|
66
110
|
sourcePoint,
|
|
@@ -94,7 +138,7 @@ export default class Edge extends Item {
|
|
|
94
138
|
|
|
95
139
|
const timing = firstRendering ? 'buildIn' : 'update';
|
|
96
140
|
// handle shape's animate
|
|
97
|
-
if (!disableAnimate && usingAnimates[timing]?.length) {
|
|
141
|
+
if (animate && !disableAnimate && usingAnimates[timing]?.length) {
|
|
98
142
|
this.animations = animateShapes(
|
|
99
143
|
usingAnimates,
|
|
100
144
|
targetStyles, // targetStylesMap
|
|
@@ -103,9 +147,14 @@ export default class Edge extends Item {
|
|
|
103
147
|
firstRendering ? 'buildIn' : 'update',
|
|
104
148
|
this.changedStates,
|
|
105
149
|
this.animateFrameListener,
|
|
106
|
-
() => onfinish(displayModel.id),
|
|
150
|
+
(canceled) => onfinish(displayModel.id, canceled),
|
|
107
151
|
);
|
|
108
152
|
}
|
|
153
|
+
|
|
154
|
+
if (firstRendering && !this.visible) {
|
|
155
|
+
this.visible = true;
|
|
156
|
+
this.hide(false);
|
|
157
|
+
}
|
|
109
158
|
}
|
|
110
159
|
|
|
111
160
|
/**
|
|
@@ -140,8 +189,8 @@ export default class Edge extends Item {
|
|
|
140
189
|
|
|
141
190
|
public clone(
|
|
142
191
|
containerGroup: Group,
|
|
143
|
-
sourceItem: Node,
|
|
144
|
-
targetItem: Node,
|
|
192
|
+
sourceItem: Node | Combo,
|
|
193
|
+
targetItem: Node | Combo,
|
|
145
194
|
onlyKeyShape?: boolean,
|
|
146
195
|
disableAnimate?: boolean,
|
|
147
196
|
) {
|
|
@@ -159,6 +208,7 @@ export default class Edge extends Item {
|
|
|
159
208
|
renderExtensions: this.renderExtensions,
|
|
160
209
|
sourceItem,
|
|
161
210
|
targetItem,
|
|
211
|
+
nodeMap: this.nodeMap,
|
|
162
212
|
containerGroup,
|
|
163
213
|
mapper: this.mapper,
|
|
164
214
|
stateMapper: this.stateMapper,
|
package/src/item/item.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Group, DisplayObject, AABB, IAnimation } from '@antv/g';
|
|
2
|
-
import { clone, isFunction, throttle } from '@antv/util';
|
|
2
|
+
import { clone, isFunction, isObject, throttle } from '@antv/util';
|
|
3
3
|
import { OTHER_SHAPES_FIELD_NAME, RESERVED_SHAPE_IDS } from '../constant';
|
|
4
4
|
import { EdgeShapeMap } from '../types/edge';
|
|
5
5
|
import {
|
|
@@ -68,11 +68,13 @@ export default abstract class Item implements IItem {
|
|
|
68
68
|
/** The flag of transient item. */
|
|
69
69
|
public transient = false;
|
|
70
70
|
public renderExtensions: any; // TODO
|
|
71
|
-
/** Cache the animation instances to stop at next lifecycle. */
|
|
71
|
+
/** Cache the shape animation instances to stop at next lifecycle. */
|
|
72
72
|
public animations: IAnimation[];
|
|
73
|
+
/** Cache the group animation instances to stop at next lifecycle. */
|
|
74
|
+
public groupAnimations: IAnimation[];
|
|
73
75
|
|
|
74
76
|
public themeStyles: {
|
|
75
|
-
default
|
|
77
|
+
default: ItemShapeStyles;
|
|
76
78
|
[stateName: string]: ItemShapeStyles;
|
|
77
79
|
};
|
|
78
80
|
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
@@ -144,7 +146,7 @@ export default abstract class Item implements IItem {
|
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
this.renderExt = new RenderExtension({
|
|
147
|
-
themeStyles: this.themeStyles
|
|
149
|
+
themeStyles: this.themeStyles?.default,
|
|
148
150
|
lodStrategy,
|
|
149
151
|
device: this.device,
|
|
150
152
|
zoom: this.zoom,
|
|
@@ -159,6 +161,7 @@ export default abstract class Item implements IItem {
|
|
|
159
161
|
displayModel: ItemDisplayModel,
|
|
160
162
|
diffData?: { previous: ItemModelData; current: ItemModelData },
|
|
161
163
|
diffState?: { previous: State[]; current: State[] },
|
|
164
|
+
animate = true,
|
|
162
165
|
onfinish: Function = () => {},
|
|
163
166
|
) {
|
|
164
167
|
// call this.renderExt.draw in extend implementations
|
|
@@ -198,6 +201,7 @@ export default abstract class Item implements IItem {
|
|
|
198
201
|
lodStrategy: LodStrategyObj;
|
|
199
202
|
},
|
|
200
203
|
onlyMove?: boolean,
|
|
204
|
+
animate = true,
|
|
201
205
|
onfinish?: Function,
|
|
202
206
|
) {
|
|
203
207
|
// 1. merge model into this model
|
|
@@ -218,7 +222,7 @@ export default abstract class Item implements IItem {
|
|
|
218
222
|
: itemTheme?.lodStrategy || this.lodStrategy;
|
|
219
223
|
|
|
220
224
|
if (onlyMove) {
|
|
221
|
-
this.updatePosition(displayModel, diffData, onfinish);
|
|
225
|
+
this.updatePosition(displayModel, diffData, animate, onfinish);
|
|
222
226
|
return;
|
|
223
227
|
}
|
|
224
228
|
|
|
@@ -242,9 +246,9 @@ export default abstract class Item implements IItem {
|
|
|
242
246
|
}
|
|
243
247
|
// 3. call element update fn from useLib
|
|
244
248
|
if (this.states?.length) {
|
|
245
|
-
this.drawWithStates(this.states, onfinish);
|
|
249
|
+
this.drawWithStates(this.states, animate, onfinish);
|
|
246
250
|
} else {
|
|
247
|
-
this.draw(this.displayModel, diffData, undefined, onfinish);
|
|
251
|
+
this.draw(this.displayModel, diffData, undefined, animate, onfinish);
|
|
248
252
|
}
|
|
249
253
|
// 4. tag all the states with 'dirty', for state style regenerating when state changed
|
|
250
254
|
this.stateDirtyMap = {};
|
|
@@ -261,6 +265,7 @@ export default abstract class Item implements IItem {
|
|
|
261
265
|
public updatePosition(
|
|
262
266
|
displayModel: ItemDisplayModel,
|
|
263
267
|
diffData?: { previous: ItemModelData; current: ItemModelData },
|
|
268
|
+
animate?: boolean,
|
|
264
269
|
onfinish?: Function,
|
|
265
270
|
) {}
|
|
266
271
|
|
|
@@ -283,8 +288,7 @@ export default abstract class Item implements IItem {
|
|
|
283
288
|
const defaultMapper = DEFAULT_MAPPER[type];
|
|
284
289
|
|
|
285
290
|
const { data: innerModelData, ...otherFields } = innerModel;
|
|
286
|
-
const { current = innerModelData
|
|
287
|
-
const firstRendering = !this.shapeMap?.keyShape;
|
|
291
|
+
const { current = innerModelData } = diffData || {};
|
|
288
292
|
|
|
289
293
|
// === no mapper, displayModel = model ===
|
|
290
294
|
if (!mapper) {
|
|
@@ -322,8 +326,7 @@ export default abstract class Item implements IItem {
|
|
|
322
326
|
let subMapper = mapper[fieldName];
|
|
323
327
|
const isReservedShapeId = RESERVED_SHAPE_IDS.includes(fieldName);
|
|
324
328
|
const isShapeId =
|
|
325
|
-
|
|
326
|
-
fieldName === OTHER_SHAPES_FIELD_NAME;
|
|
329
|
+
isReservedShapeId || fieldName === OTHER_SHAPES_FIELD_NAME;
|
|
327
330
|
|
|
328
331
|
if ((isShapeId && isEncode(subMapper)) || !isShapeId) {
|
|
329
332
|
// fields not about shape
|
|
@@ -351,16 +354,27 @@ export default abstract class Item implements IItem {
|
|
|
351
354
|
|
|
352
355
|
if (isReservedShapeId) {
|
|
353
356
|
// reserved shapes, fieldName is shapeId
|
|
354
|
-
displayModelData[fieldName] =
|
|
357
|
+
displayModelData[fieldName] =
|
|
358
|
+
displayModelData[fieldName] || isObject(innerModel.data[fieldName])
|
|
359
|
+
? {
|
|
360
|
+
...(innerModel.data[fieldName] as object),
|
|
361
|
+
}
|
|
362
|
+
: {};
|
|
355
363
|
updateShapeChange({
|
|
356
364
|
innerModel,
|
|
357
365
|
mapper: subMapper,
|
|
358
366
|
dataChangedFields,
|
|
359
367
|
shapeConfig: displayModelData[fieldName],
|
|
368
|
+
fieldPath: [fieldName],
|
|
360
369
|
});
|
|
361
370
|
} else if (fieldName === OTHER_SHAPES_FIELD_NAME) {
|
|
362
371
|
// other shapes
|
|
363
|
-
displayModelData[fieldName] =
|
|
372
|
+
displayModelData[fieldName] =
|
|
373
|
+
displayModelData[fieldName] || isObject(innerModel.data[fieldName])
|
|
374
|
+
? {
|
|
375
|
+
...(innerModel.data[fieldName] as object),
|
|
376
|
+
}
|
|
377
|
+
: {};
|
|
364
378
|
Object.keys(subMapper).forEach((shapeId) => {
|
|
365
379
|
if (!displayModelData[fieldName]?.hasOwnProperty(shapeId)) {
|
|
366
380
|
displayModelData[fieldName][shapeId] =
|
|
@@ -371,6 +385,7 @@ export default abstract class Item implements IItem {
|
|
|
371
385
|
mapper: shappStyle,
|
|
372
386
|
dataChangedFields,
|
|
373
387
|
shapeConfig: displayModelData[fieldName][shapeId],
|
|
388
|
+
fieldPath: [fieldName, shapeId],
|
|
374
389
|
});
|
|
375
390
|
}
|
|
376
391
|
});
|
|
@@ -395,77 +410,87 @@ export default abstract class Item implements IItem {
|
|
|
395
410
|
|
|
396
411
|
/** Show the item. */
|
|
397
412
|
public show(animate = true) {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
)
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
}
|
|
413
|
+
Promise.all(this.stopAnimations()).finally(() => {
|
|
414
|
+
if (this.destroyed || this.visible) return;
|
|
415
|
+
const { animates = {} } = this.displayModel.data;
|
|
416
|
+
if (animate && animates.show?.length) {
|
|
417
|
+
const showAnimateFieldsMap: any = {};
|
|
418
|
+
Object.values(animates.show).forEach((animate) => {
|
|
419
|
+
const { shapeId = 'group' } = animate;
|
|
420
|
+
showAnimateFieldsMap[shapeId] = (
|
|
421
|
+
showAnimateFieldsMap[shapeId] || []
|
|
422
|
+
).concat(animate.fields);
|
|
423
|
+
});
|
|
424
|
+
const targetStyleMap = {};
|
|
425
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
426
|
+
const shape = this.shapeMap[id];
|
|
427
|
+
if (!this.cacheHiddenShape[id]) {
|
|
428
|
+
// set the animate fields to initial value
|
|
429
|
+
if (showAnimateFieldsMap[id]) {
|
|
430
|
+
targetStyleMap[id] = targetStyleMap[id] || {};
|
|
431
|
+
const beginStyle = getShapeAnimateBeginStyles(shape);
|
|
432
|
+
showAnimateFieldsMap[id].forEach((field) => {
|
|
433
|
+
if (beginStyle.hasOwnProperty(field)) {
|
|
434
|
+
targetStyleMap[id][field] = shape.style[field];
|
|
435
|
+
shape.style[field] = beginStyle[field];
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
shape.show();
|
|
424
440
|
}
|
|
425
|
-
|
|
441
|
+
});
|
|
442
|
+
if (showAnimateFieldsMap.group) {
|
|
443
|
+
showAnimateFieldsMap.group.forEach((field) => {
|
|
444
|
+
const usingField = field === 'size' ? 'transform' : field;
|
|
445
|
+
if (GROUP_ANIMATE_STYLES[0].hasOwnProperty(usingField)) {
|
|
446
|
+
this.group.style[usingField] =
|
|
447
|
+
GROUP_ANIMATE_STYLES[0][usingField];
|
|
448
|
+
}
|
|
449
|
+
});
|
|
426
450
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
451
|
+
|
|
452
|
+
this.animations = this.runWithAnimates(
|
|
453
|
+
animates,
|
|
454
|
+
'show',
|
|
455
|
+
targetStyleMap,
|
|
456
|
+
);
|
|
457
|
+
} else {
|
|
458
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
459
|
+
const shape = this.shapeMap[id];
|
|
460
|
+
if (!this.cacheHiddenShape[id]) shape.show();
|
|
434
461
|
});
|
|
435
462
|
}
|
|
436
463
|
|
|
437
|
-
this.
|
|
438
|
-
}
|
|
439
|
-
Object.keys(this.shapeMap).forEach((id) => {
|
|
440
|
-
const shape = this.shapeMap[id];
|
|
441
|
-
if (!this.cacheHiddenShape[id]) shape.show();
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
this.visible = true;
|
|
464
|
+
this.visible = true;
|
|
465
|
+
});
|
|
446
466
|
}
|
|
447
467
|
|
|
448
468
|
/** Hides the item. */
|
|
449
469
|
public hide(animate = true) {
|
|
450
|
-
// TODO: utilize graphcore's view
|
|
451
|
-
this.stopAnimations();
|
|
452
470
|
const func = () => {
|
|
453
471
|
Object.keys(this.shapeMap).forEach((id) => {
|
|
454
472
|
const shape = this.shapeMap[id];
|
|
455
|
-
if (this.visible && !shape.isVisible())
|
|
473
|
+
if (!this.visible && !shape.isVisible())
|
|
456
474
|
this.cacheHiddenShape[id] = true;
|
|
457
475
|
shape.hide();
|
|
458
476
|
});
|
|
459
477
|
};
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
478
|
+
Promise.all(this.stopAnimations()).then(() => {
|
|
479
|
+
if (this.destroyed || !this.visible) return;
|
|
480
|
+
const { animates = {} } = this.displayModel.data;
|
|
481
|
+
if (animate && animates.hide?.length) {
|
|
482
|
+
this.animations = this.runWithAnimates(
|
|
483
|
+
animates,
|
|
484
|
+
'hide',
|
|
485
|
+
undefined,
|
|
486
|
+
func,
|
|
487
|
+
);
|
|
488
|
+
} else {
|
|
489
|
+
// 2. clear group and remove group
|
|
490
|
+
func();
|
|
491
|
+
}
|
|
492
|
+
this.visible = false;
|
|
493
|
+
});
|
|
469
494
|
}
|
|
470
495
|
|
|
471
496
|
/** Returns the visibility of the item. */
|
|
@@ -606,7 +631,11 @@ export default abstract class Item implements IItem {
|
|
|
606
631
|
* @param previousStates previous states
|
|
607
632
|
* @returns
|
|
608
633
|
*/
|
|
609
|
-
private drawWithStates(
|
|
634
|
+
private drawWithStates(
|
|
635
|
+
previousStates: State[],
|
|
636
|
+
animate = true,
|
|
637
|
+
onfinish?: Function,
|
|
638
|
+
) {
|
|
610
639
|
const { default: _, ...themeStateStyles } = this.themeStyles;
|
|
611
640
|
const { data: displayModelData } = this.displayModel;
|
|
612
641
|
let styles = {}; // merged styles
|
|
@@ -633,6 +662,7 @@ export default abstract class Item implements IItem {
|
|
|
633
662
|
mapper: mapper[shapeId],
|
|
634
663
|
dataChangedFields: undefined,
|
|
635
664
|
shapeConfig: stateStyles[shapeId],
|
|
665
|
+
fieldPath: [shapeId],
|
|
636
666
|
});
|
|
637
667
|
} else if (shapeId === OTHER_SHAPES_FIELD_NAME && mapper[shapeId]) {
|
|
638
668
|
// other shapes
|
|
@@ -645,6 +675,7 @@ export default abstract class Item implements IItem {
|
|
|
645
675
|
mapper: mapper[shapeId][otherShapeId],
|
|
646
676
|
dataChangedFields: undefined,
|
|
647
677
|
shapeConfig: stateStyles[shapeId][otherShapeId],
|
|
678
|
+
fieldPath: [shapeId, otherShapeId],
|
|
648
679
|
});
|
|
649
680
|
});
|
|
650
681
|
}
|
|
@@ -675,6 +706,7 @@ export default abstract class Item implements IItem {
|
|
|
675
706
|
previous: previousStates,
|
|
676
707
|
current: this.states,
|
|
677
708
|
},
|
|
709
|
+
animate,
|
|
678
710
|
onfinish,
|
|
679
711
|
);
|
|
680
712
|
}
|
|
@@ -704,17 +736,15 @@ export default abstract class Item implements IItem {
|
|
|
704
736
|
if (this.animations?.length) {
|
|
705
737
|
// during animations, estimate the final bounds by the styles in displayModel
|
|
706
738
|
const { keyShape, labelShape } = this.shapeMap;
|
|
707
|
-
const {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
getShapeLocalBoundsByStyle(keyShape, keyShapeStyle)
|
|
716
|
-
getShapeLocalBoundsByStyle(labelShape, labelShapeStyle),
|
|
717
|
-
]);
|
|
739
|
+
const { x = 0, y = 0, z = 0 } = this.displayModel.data;
|
|
740
|
+
const { keyShape: keyShapeStyle, labelShape: labelShapeStyle } =
|
|
741
|
+
this.renderExt.mergedStyles;
|
|
742
|
+
const estimateBounds = labelShape
|
|
743
|
+
? combineBounds([
|
|
744
|
+
getShapeLocalBoundsByStyle(keyShape, keyShapeStyle),
|
|
745
|
+
getShapeLocalBoundsByStyle(labelShape, labelShapeStyle),
|
|
746
|
+
])
|
|
747
|
+
: getShapeLocalBoundsByStyle(keyShape, keyShapeStyle);
|
|
718
748
|
[x, y, z].forEach((val: number, i) => {
|
|
719
749
|
estimateBounds.max[i] += val;
|
|
720
750
|
estimateBounds.min[i] += val;
|
|
@@ -729,8 +759,27 @@ export default abstract class Item implements IItem {
|
|
|
729
759
|
* Stop all the animations on the item.
|
|
730
760
|
*/
|
|
731
761
|
public stopAnimations() {
|
|
732
|
-
|
|
733
|
-
this.animations
|
|
762
|
+
const promises = [];
|
|
763
|
+
if (this.animations?.length) {
|
|
764
|
+
while (this.animations.length) {
|
|
765
|
+
const animate = this.animations.pop();
|
|
766
|
+
if (animate.playState !== 'running') break;
|
|
767
|
+
promises.push(stopAnimate(animate));
|
|
768
|
+
// @ts-ignore
|
|
769
|
+
animate.onManualCancel?.();
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
if (this.groupAnimations?.length) {
|
|
773
|
+
while (this.groupAnimations.length) {
|
|
774
|
+
const groupAnimate = this.groupAnimations.pop();
|
|
775
|
+
if (groupAnimate.playState !== 'running') break;
|
|
776
|
+
promises.push(stopAnimate(groupAnimate));
|
|
777
|
+
// @ts-ignore
|
|
778
|
+
groupAnimate.onManualCancel?.();
|
|
779
|
+
}
|
|
780
|
+
this.groupAnimations = [];
|
|
781
|
+
}
|
|
782
|
+
return promises;
|
|
734
783
|
}
|
|
735
784
|
|
|
736
785
|
/**
|
|
@@ -837,8 +886,15 @@ const updateShapeChange = ({
|
|
|
837
886
|
mapper,
|
|
838
887
|
dataChangedFields,
|
|
839
888
|
shapeConfig,
|
|
889
|
+
fieldPath,
|
|
840
890
|
}) => {
|
|
891
|
+
if (!mapper) return;
|
|
892
|
+
let innerModelValue = innerModel.data;
|
|
893
|
+
fieldPath?.forEach((field) => {
|
|
894
|
+
innerModelValue = innerModelValue[field] || {};
|
|
895
|
+
});
|
|
841
896
|
Object.keys(mapper).forEach((shapeAttrName) => {
|
|
897
|
+
if (innerModelValue?.hasOwnProperty(shapeAttrName)) return;
|
|
842
898
|
const { value: mappedValue } = updateChange({
|
|
843
899
|
innerModel,
|
|
844
900
|
mapper,
|