@antv/g6 5.0.0-alpha.9 → 5.0.0-beta.1
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 +11 -0
- package/esm/api-doc/item.js +5 -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 +321 -224
- 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 +22 -18
- 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 +103 -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 +95 -5
- package/esm/stdlib/item/edge/base.js +106 -9
- 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 +121 -3
- package/esm/stdlib/item/node/base.js +158 -15
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.d.ts +23 -0
- package/esm/stdlib/item/node/base3d.js +24 -9
- 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 +51 -44
- 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 +27 -10
- 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 +11 -0
- package/lib/api-doc/item.js +25 -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 +319 -222
- 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 +23 -18
- 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 +107 -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 +95 -5
- package/lib/stdlib/item/edge/base.js +105 -8
- 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 +121 -3
- package/lib/stdlib/item/node/base.js +158 -15
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.d.ts +23 -0
- package/lib/stdlib/item/node/base3d.js +24 -9
- 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 +50 -42
- 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 +27 -10
- 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 +45 -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 +411 -259
- 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 +59 -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 +22 -20
- 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 +151 -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 +156 -8
- 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 +195 -15
- package/src/stdlib/item/node/base3d.ts +25 -9
- 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 +126 -64
- 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 +31 -14
- 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/lib/item/edge.d.ts
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { Group } from '@antv/g';
|
|
2
|
-
import { EdgeDisplayModel, EdgeModel } from '../types';
|
|
2
|
+
import { EdgeDisplayModel, EdgeModel, ID } from '../types';
|
|
3
3
|
import { EdgeModelData } from '../types/edge';
|
|
4
4
|
import { DisplayMapper, State, LodStrategyObj } from '../types/item';
|
|
5
5
|
import { EdgeStyleSet } from '../types/theme';
|
|
6
6
|
import Item from './item';
|
|
7
7
|
import Node from './node';
|
|
8
|
+
import Combo from './combo';
|
|
8
9
|
interface IProps {
|
|
9
10
|
model: EdgeModel;
|
|
10
11
|
renderExtensions: any;
|
|
11
12
|
containerGroup: Group;
|
|
12
|
-
mapper
|
|
13
|
-
stateMapper
|
|
13
|
+
mapper?: DisplayMapper;
|
|
14
|
+
stateMapper?: {
|
|
14
15
|
[stateName: string]: DisplayMapper;
|
|
15
16
|
};
|
|
16
|
-
sourceItem: Node;
|
|
17
|
-
targetItem: Node;
|
|
17
|
+
sourceItem: Node | Combo;
|
|
18
|
+
targetItem: Node | Combo;
|
|
18
19
|
zoom?: number;
|
|
19
20
|
theme: {
|
|
20
21
|
styles: EdgeStyleSet;
|
|
21
22
|
lodStrategy: LodStrategyObj;
|
|
22
23
|
};
|
|
23
24
|
onframe?: Function;
|
|
25
|
+
nodeMap?: Map<ID, Node>;
|
|
24
26
|
}
|
|
25
27
|
export default class Edge extends Item {
|
|
26
28
|
destroyed: boolean;
|
|
@@ -28,8 +30,9 @@ export default class Edge extends Item {
|
|
|
28
30
|
displayModel: EdgeDisplayModel;
|
|
29
31
|
/** Set to different value in implements */
|
|
30
32
|
type: 'edge';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
nodeMap: Map<ID, Node>;
|
|
34
|
+
sourceItem: Node | Combo;
|
|
35
|
+
targetItem: Node | Combo;
|
|
33
36
|
constructor(props: IProps);
|
|
34
37
|
draw(displayModel: EdgeDisplayModel, diffData?: {
|
|
35
38
|
previous: EdgeModelData;
|
|
@@ -37,7 +40,7 @@ export default class Edge extends Item {
|
|
|
37
40
|
}, diffState?: {
|
|
38
41
|
previous: State[];
|
|
39
42
|
current: State[];
|
|
40
|
-
}, onfinish?: Function): void;
|
|
43
|
+
}, animate?: boolean, onfinish?: Function): void;
|
|
41
44
|
/**
|
|
42
45
|
* Sometimes no changes on edge data, but need to re-draw it
|
|
43
46
|
* e.g. source and target nodes' position changed
|
|
@@ -49,6 +52,6 @@ export default class Edge extends Item {
|
|
|
49
52
|
* @param endItem new item to ended
|
|
50
53
|
*/
|
|
51
54
|
updateEnd(type: 'source' | 'target', endItem: Node): void;
|
|
52
|
-
clone(containerGroup: Group, sourceItem: Node, targetItem: Node, onlyKeyShape?: boolean, disableAnimate?: boolean): Group | Edge;
|
|
55
|
+
clone(containerGroup: Group, sourceItem: Node | Combo, targetItem: Node | Combo, onlyKeyShape?: boolean, disableAnimate?: boolean): Group | Edge;
|
|
53
56
|
}
|
|
54
57
|
export {};
|
package/lib/item/edge.js
CHANGED
|
@@ -7,6 +7,7 @@ const g_1 = require("@antv/g");
|
|
|
7
7
|
const util_1 = require("@antv/util");
|
|
8
8
|
const shape_1 = require("../util/shape");
|
|
9
9
|
const animate_1 = require("../util/animate");
|
|
10
|
+
const point_1 = require("../util/point");
|
|
10
11
|
const item_1 = __importDefault(require("./item"));
|
|
11
12
|
class Edge extends item_1.default {
|
|
12
13
|
constructor(props) {
|
|
@@ -26,22 +27,43 @@ class Edge extends item_1.default {
|
|
|
26
27
|
trailing: true,
|
|
27
28
|
});
|
|
28
29
|
this.init(Object.assign(Object.assign({}, props), { type: 'edge' }));
|
|
29
|
-
const { sourceItem, targetItem } = props;
|
|
30
|
+
const { sourceItem, targetItem, nodeMap } = props;
|
|
30
31
|
this.sourceItem = sourceItem;
|
|
31
32
|
this.targetItem = targetItem;
|
|
33
|
+
this.nodeMap = nodeMap;
|
|
34
|
+
// todo: combo
|
|
35
|
+
if (sourceItem.getType() === 'node') {
|
|
36
|
+
this.nodeMap.set(sourceItem.getID(), sourceItem);
|
|
37
|
+
}
|
|
38
|
+
if (sourceItem.getType() === 'node') {
|
|
39
|
+
this.nodeMap.set(targetItem.getID(), targetItem);
|
|
40
|
+
}
|
|
32
41
|
this.draw(this.displayModel);
|
|
33
42
|
}
|
|
34
|
-
draw(displayModel, diffData, diffState, onfinish = () => { }) {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
// get the end
|
|
37
|
-
const {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
43
|
+
draw(displayModel, diffData, diffState, animate = true, onfinish = () => { }) {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
// get the point near the other end
|
|
46
|
+
const { sourceAnchor, targetAnchor, keyShape } = displayModel.data;
|
|
47
|
+
const sourcePosition = this.sourceItem.getPosition();
|
|
48
|
+
const targetPosition = this.targetItem.getPosition();
|
|
49
|
+
let targetPrevious = sourcePosition;
|
|
50
|
+
let sourcePrevious = targetPosition;
|
|
51
|
+
// TODO: type
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
if ((_a = keyShape === null || keyShape === void 0 ? void 0 : keyShape.controlPoints) === null || _a === void 0 ? void 0 : _a.length) {
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
const controlPointsBesideEnds = keyShape.controlPoints.filter((point) => !(0, point_1.isSamePoint)(point, sourcePosition) &&
|
|
56
|
+
!(0, point_1.isSamePoint)(point, targetPosition));
|
|
57
|
+
sourcePrevious = (0, point_1.getNearestPoint)(controlPointsBesideEnds, sourcePosition).nearestPoint;
|
|
58
|
+
targetPrevious = (0, point_1.getNearestPoint)(controlPointsBesideEnds, targetPosition).nearestPoint;
|
|
59
|
+
}
|
|
60
|
+
const sourcePoint = this.sourceItem.getAnchorPoint(sourcePrevious, sourceAnchor);
|
|
61
|
+
const targetPoint = this.targetItem.getAnchorPoint(targetPrevious, targetAnchor);
|
|
41
62
|
this.renderExt.mergeStyles(displayModel);
|
|
42
|
-
const firstRendering = !((
|
|
63
|
+
const firstRendering = !((_b = this.shapeMap) === null || _b === void 0 ? void 0 : _b.keyShape);
|
|
43
64
|
this.renderExt.setSourcePoint(sourcePoint);
|
|
44
65
|
this.renderExt.setTargetPoint(targetPoint);
|
|
66
|
+
this.renderExt.setNodeMap(this.nodeMap);
|
|
45
67
|
const shapeMap = this.renderExt.draw(displayModel, sourcePoint, targetPoint, this.shapeMap, diffData, diffState);
|
|
46
68
|
// add shapes to group, and update shapeMap
|
|
47
69
|
this.shapeMap = (0, shape_1.updateShapes)(this.shapeMap, shapeMap, this.group);
|
|
@@ -64,10 +86,14 @@ class Edge extends item_1.default {
|
|
|
64
86
|
}
|
|
65
87
|
const timing = firstRendering ? 'buildIn' : 'update';
|
|
66
88
|
// handle shape's animate
|
|
67
|
-
if (!disableAnimate && ((
|
|
89
|
+
if (animate && !disableAnimate && ((_c = usingAnimates[timing]) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
68
90
|
this.animations = (0, animate_1.animateShapes)(usingAnimates, targetStyles, // targetStylesMap
|
|
69
91
|
this.shapeMap, // shapeMap
|
|
70
|
-
this.group, firstRendering ? 'buildIn' : 'update', this.changedStates, this.animateFrameListener, () => onfinish(displayModel.id));
|
|
92
|
+
this.group, firstRendering ? 'buildIn' : 'update', this.changedStates, this.animateFrameListener, (canceled) => onfinish(displayModel.id, canceled));
|
|
93
|
+
}
|
|
94
|
+
if (firstRendering && !this.visible) {
|
|
95
|
+
this.visible = true;
|
|
96
|
+
this.hide(false);
|
|
71
97
|
}
|
|
72
98
|
}
|
|
73
99
|
/**
|
|
@@ -100,6 +126,7 @@ class Edge extends item_1.default {
|
|
|
100
126
|
renderExtensions: this.renderExtensions,
|
|
101
127
|
sourceItem,
|
|
102
128
|
targetItem,
|
|
129
|
+
nodeMap: this.nodeMap,
|
|
103
130
|
containerGroup,
|
|
104
131
|
mapper: this.mapper,
|
|
105
132
|
stateMapper: this.stateMapper,
|
package/lib/item/edge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge.js","sourceRoot":"src/","sources":["item/edge.ts"],"names":[],"mappings":";;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"edge.js","sourceRoot":"src/","sources":["item/edge.ts"],"names":[],"mappings":"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"}
|
package/lib/item/item.d.ts
CHANGED
|
@@ -36,10 +36,12 @@ export default abstract class Item implements IItem {
|
|
|
36
36
|
/** The flag of transient item. */
|
|
37
37
|
transient: boolean;
|
|
38
38
|
renderExtensions: any;
|
|
39
|
-
/** Cache the animation instances to stop at next lifecycle. */
|
|
39
|
+
/** Cache the shape animation instances to stop at next lifecycle. */
|
|
40
40
|
animations: IAnimation[];
|
|
41
|
+
/** Cache the group animation instances to stop at next lifecycle. */
|
|
42
|
+
groupAnimations: IAnimation[];
|
|
41
43
|
themeStyles: {
|
|
42
|
-
default
|
|
44
|
+
default: ItemShapeStyles;
|
|
43
45
|
[stateName: string]: ItemShapeStyles;
|
|
44
46
|
};
|
|
45
47
|
/** The zoom strategy to show and hide shapes according to their lod. */
|
|
@@ -68,7 +70,7 @@ export default abstract class Item implements IItem {
|
|
|
68
70
|
}, diffState?: {
|
|
69
71
|
previous: State[];
|
|
70
72
|
current: State[];
|
|
71
|
-
}, onfinish?: Function): void;
|
|
73
|
+
}, animate?: boolean, onfinish?: Function): void;
|
|
72
74
|
/**
|
|
73
75
|
* Updates the shapes.
|
|
74
76
|
* @internal
|
|
@@ -79,7 +81,7 @@ export default abstract class Item implements IItem {
|
|
|
79
81
|
}, isReplace?: boolean, itemTheme?: {
|
|
80
82
|
styles: NodeStyleSet | EdgeStyleSet;
|
|
81
83
|
lodStrategy: LodStrategyObj;
|
|
82
|
-
}, onlyMove?: boolean, onfinish?: Function): void;
|
|
84
|
+
}, onlyMove?: boolean, animate?: boolean, onfinish?: Function): void;
|
|
83
85
|
/**
|
|
84
86
|
* Update the group's position, e.g. node, combo.
|
|
85
87
|
* @param displayModel
|
|
@@ -90,7 +92,7 @@ export default abstract class Item implements IItem {
|
|
|
90
92
|
updatePosition(displayModel: ItemDisplayModel, diffData?: {
|
|
91
93
|
previous: ItemModelData;
|
|
92
94
|
current: ItemModelData;
|
|
93
|
-
}, onfinish?: Function): void;
|
|
95
|
+
}, animate?: boolean, onfinish?: Function): void;
|
|
94
96
|
/**
|
|
95
97
|
* Maps (mapper will be function, value, or encode format) model to displayModel and find out the shapes to be update for incremental updating.
|
|
96
98
|
* @param model inner model
|
|
@@ -174,7 +176,7 @@ export default abstract class Item implements IItem {
|
|
|
174
176
|
/**
|
|
175
177
|
* Stop all the animations on the item.
|
|
176
178
|
*/
|
|
177
|
-
stopAnimations():
|
|
179
|
+
stopAnimations(): any[];
|
|
178
180
|
/**
|
|
179
181
|
* Animations' frame listemer.
|
|
180
182
|
*/
|
package/lib/item/item.js
CHANGED
|
@@ -54,6 +54,7 @@ class Item {
|
|
|
54
54
|
}
|
|
55
55
|
/** Initiate the item. */
|
|
56
56
|
init(props) {
|
|
57
|
+
var _a;
|
|
57
58
|
const { model, containerGroup, mapper, stateMapper, renderExtensions, zoom = 1, theme = {}, type: itemType, } = props;
|
|
58
59
|
this.type = itemType;
|
|
59
60
|
this.group = new g_1.Group({ style: { zIndex: 0 } });
|
|
@@ -84,7 +85,7 @@ class Item {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
this.renderExt = new RenderExtension({
|
|
87
|
-
themeStyles: this.themeStyles.default,
|
|
88
|
+
themeStyles: (_a = this.themeStyles) === null || _a === void 0 ? void 0 : _a.default,
|
|
88
89
|
lodStrategy,
|
|
89
90
|
device: this.device,
|
|
90
91
|
zoom: this.zoom,
|
|
@@ -94,7 +95,7 @@ class Item {
|
|
|
94
95
|
* Draws the shapes.
|
|
95
96
|
* @internal
|
|
96
97
|
* */
|
|
97
|
-
draw(displayModel, diffData, diffState, onfinish = () => { }) {
|
|
98
|
+
draw(displayModel, diffData, diffState, animate = true, onfinish = () => { }) {
|
|
98
99
|
var _a, _b;
|
|
99
100
|
// call this.renderExt.draw in extend implementations
|
|
100
101
|
this.afterDrawShapeMap =
|
|
@@ -112,7 +113,7 @@ class Item {
|
|
|
112
113
|
* Updates the shapes.
|
|
113
114
|
* @internal
|
|
114
115
|
* */
|
|
115
|
-
update(model, diffData, isReplace, itemTheme, onlyMove, onfinish) {
|
|
116
|
+
update(model, diffData, isReplace, itemTheme, onlyMove, animate = true, onfinish) {
|
|
116
117
|
var _a;
|
|
117
118
|
// 1. merge model into this model
|
|
118
119
|
this.model = model;
|
|
@@ -126,7 +127,7 @@ class Item {
|
|
|
126
127
|
? (0, zoom_1.formatLodStrategy)(displayModel.data.lodStrategy)
|
|
127
128
|
: (itemTheme === null || itemTheme === void 0 ? void 0 : itemTheme.lodStrategy) || this.lodStrategy;
|
|
128
129
|
if (onlyMove) {
|
|
129
|
-
this.updatePosition(displayModel, diffData, onfinish);
|
|
130
|
+
this.updatePosition(displayModel, diffData, animate, onfinish);
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
133
|
if (typeChange) {
|
|
@@ -147,10 +148,10 @@ class Item {
|
|
|
147
148
|
}
|
|
148
149
|
// 3. call element update fn from useLib
|
|
149
150
|
if ((_a = this.states) === null || _a === void 0 ? void 0 : _a.length) {
|
|
150
|
-
this.drawWithStates(this.states, onfinish);
|
|
151
|
+
this.drawWithStates(this.states, animate, onfinish);
|
|
151
152
|
}
|
|
152
153
|
else {
|
|
153
|
-
this.draw(this.displayModel, diffData, undefined, onfinish);
|
|
154
|
+
this.draw(this.displayModel, diffData, undefined, animate, onfinish);
|
|
154
155
|
}
|
|
155
156
|
// 4. tag all the states with 'dirty', for state style regenerating when state changed
|
|
156
157
|
this.stateDirtyMap = {};
|
|
@@ -163,7 +164,7 @@ class Item {
|
|
|
163
164
|
* @param onfinish
|
|
164
165
|
* @returns
|
|
165
166
|
*/
|
|
166
|
-
updatePosition(displayModel, diffData, onfinish) { }
|
|
167
|
+
updatePosition(displayModel, diffData, animate, onfinish) { }
|
|
167
168
|
/**
|
|
168
169
|
* Maps (mapper will be function, value, or encode format) model to displayModel and find out the shapes to be update for incremental updating.
|
|
169
170
|
* @param model inner model
|
|
@@ -172,12 +173,10 @@ class Item {
|
|
|
172
173
|
* @returns
|
|
173
174
|
*/
|
|
174
175
|
getDisplayModelAndChanges(innerModel, diffData, isReplace) {
|
|
175
|
-
var _a;
|
|
176
176
|
const { mapper, type } = this;
|
|
177
177
|
const defaultMapper = mapper_1.DEFAULT_MAPPER[type];
|
|
178
178
|
const { data: innerModelData } = innerModel, otherFields = __rest(innerModel, ["data"]);
|
|
179
|
-
const { current = innerModelData
|
|
180
|
-
const firstRendering = !((_a = this.shapeMap) === null || _a === void 0 ? void 0 : _a.keyShape);
|
|
179
|
+
const { current = innerModelData } = diffData || {};
|
|
181
180
|
// === no mapper, displayModel = model ===
|
|
182
181
|
if (!mapper) {
|
|
183
182
|
// compare the previous data and current data to find shape changes
|
|
@@ -207,8 +206,7 @@ class Item {
|
|
|
207
206
|
Object.keys(mapper).forEach((fieldName) => {
|
|
208
207
|
let subMapper = mapper[fieldName];
|
|
209
208
|
const isReservedShapeId = constant_1.RESERVED_SHAPE_IDS.includes(fieldName);
|
|
210
|
-
const isShapeId = constant_1.
|
|
211
|
-
fieldName === constant_1.OTHER_SHAPES_FIELD_NAME;
|
|
209
|
+
const isShapeId = isReservedShapeId || fieldName === constant_1.OTHER_SHAPES_FIELD_NAME;
|
|
212
210
|
if ((isShapeId && (0, type_1.isEncode)(subMapper)) || !isShapeId) {
|
|
213
211
|
// fields not about shape
|
|
214
212
|
if (!displayModelData.hasOwnProperty(fieldName)) {
|
|
@@ -236,17 +234,22 @@ class Item {
|
|
|
236
234
|
}
|
|
237
235
|
if (isReservedShapeId) {
|
|
238
236
|
// reserved shapes, fieldName is shapeId
|
|
239
|
-
displayModelData[fieldName] =
|
|
237
|
+
displayModelData[fieldName] =
|
|
238
|
+
displayModelData[fieldName] || (0, util_1.isObject)(innerModel.data[fieldName])
|
|
239
|
+
? Object.assign({}, innerModel.data[fieldName]) : {};
|
|
240
240
|
updateShapeChange({
|
|
241
241
|
innerModel,
|
|
242
242
|
mapper: subMapper,
|
|
243
243
|
dataChangedFields,
|
|
244
244
|
shapeConfig: displayModelData[fieldName],
|
|
245
|
+
fieldPath: [fieldName],
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
248
|
else if (fieldName === constant_1.OTHER_SHAPES_FIELD_NAME) {
|
|
248
249
|
// other shapes
|
|
249
|
-
displayModelData[fieldName] =
|
|
250
|
+
displayModelData[fieldName] =
|
|
251
|
+
displayModelData[fieldName] || (0, util_1.isObject)(innerModel.data[fieldName])
|
|
252
|
+
? Object.assign({}, innerModel.data[fieldName]) : {};
|
|
250
253
|
Object.keys(subMapper).forEach((shapeId) => {
|
|
251
254
|
var _a;
|
|
252
255
|
if (!((_a = displayModelData[fieldName]) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(shapeId))) {
|
|
@@ -258,6 +261,7 @@ class Item {
|
|
|
258
261
|
mapper: shappStyle,
|
|
259
262
|
dataChangedFields,
|
|
260
263
|
shapeConfig: displayModelData[fieldName][shapeId],
|
|
264
|
+
fieldPath: [fieldName, shapeId],
|
|
261
265
|
});
|
|
262
266
|
}
|
|
263
267
|
});
|
|
@@ -276,75 +280,80 @@ class Item {
|
|
|
276
280
|
}
|
|
277
281
|
/** Show the item. */
|
|
278
282
|
show(animate = true) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
283
|
+
Promise.all(this.stopAnimations()).finally(() => {
|
|
284
|
+
var _a;
|
|
285
|
+
if (this.destroyed || this.visible)
|
|
286
|
+
return;
|
|
287
|
+
const { animates = {} } = this.displayModel.data;
|
|
288
|
+
if (animate && ((_a = animates.show) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
289
|
+
const showAnimateFieldsMap = {};
|
|
290
|
+
Object.values(animates.show).forEach((animate) => {
|
|
291
|
+
const { shapeId = 'group' } = animate;
|
|
292
|
+
showAnimateFieldsMap[shapeId] = (showAnimateFieldsMap[shapeId] || []).concat(animate.fields);
|
|
293
|
+
});
|
|
294
|
+
const targetStyleMap = {};
|
|
295
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
296
|
+
const shape = this.shapeMap[id];
|
|
297
|
+
if (!this.cacheHiddenShape[id]) {
|
|
298
|
+
// set the animate fields to initial value
|
|
299
|
+
if (showAnimateFieldsMap[id]) {
|
|
300
|
+
targetStyleMap[id] = targetStyleMap[id] || {};
|
|
301
|
+
const beginStyle = (0, animate_1.getShapeAnimateBeginStyles)(shape);
|
|
302
|
+
showAnimateFieldsMap[id].forEach((field) => {
|
|
303
|
+
if (beginStyle.hasOwnProperty(field)) {
|
|
304
|
+
targetStyleMap[id][field] = shape.style[field];
|
|
305
|
+
shape.style[field] = beginStyle[field];
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
shape.show();
|
|
303
310
|
}
|
|
304
|
-
|
|
311
|
+
});
|
|
312
|
+
if (showAnimateFieldsMap.group) {
|
|
313
|
+
showAnimateFieldsMap.group.forEach((field) => {
|
|
314
|
+
const usingField = field === 'size' ? 'transform' : field;
|
|
315
|
+
if (animate_1.GROUP_ANIMATE_STYLES[0].hasOwnProperty(usingField)) {
|
|
316
|
+
this.group.style[usingField] =
|
|
317
|
+
animate_1.GROUP_ANIMATE_STYLES[0][usingField];
|
|
318
|
+
}
|
|
319
|
+
});
|
|
305
320
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
321
|
+
this.animations = this.runWithAnimates(animates, 'show', targetStyleMap);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
Object.keys(this.shapeMap).forEach((id) => {
|
|
325
|
+
const shape = this.shapeMap[id];
|
|
326
|
+
if (!this.cacheHiddenShape[id])
|
|
327
|
+
shape.show();
|
|
313
328
|
});
|
|
314
329
|
}
|
|
315
|
-
this.
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
Object.keys(this.shapeMap).forEach((id) => {
|
|
319
|
-
const shape = this.shapeMap[id];
|
|
320
|
-
if (!this.cacheHiddenShape[id])
|
|
321
|
-
shape.show();
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
this.visible = true;
|
|
330
|
+
this.visible = true;
|
|
331
|
+
});
|
|
325
332
|
}
|
|
326
333
|
/** Hides the item. */
|
|
327
334
|
hide(animate = true) {
|
|
328
|
-
var _a;
|
|
329
|
-
// TODO: utilize graphcore's view
|
|
330
|
-
this.stopAnimations();
|
|
331
335
|
const func = () => {
|
|
332
336
|
Object.keys(this.shapeMap).forEach((id) => {
|
|
333
337
|
const shape = this.shapeMap[id];
|
|
334
|
-
if (this.visible && !shape.isVisible())
|
|
338
|
+
if (!this.visible && !shape.isVisible())
|
|
335
339
|
this.cacheHiddenShape[id] = true;
|
|
336
340
|
shape.hide();
|
|
337
341
|
});
|
|
338
342
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
343
|
+
Promise.all(this.stopAnimations()).then(() => {
|
|
344
|
+
var _a;
|
|
345
|
+
if (this.destroyed || !this.visible)
|
|
346
|
+
return;
|
|
347
|
+
const { animates = {} } = this.displayModel.data;
|
|
348
|
+
if (animate && ((_a = animates.hide) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
349
|
+
this.animations = this.runWithAnimates(animates, 'hide', undefined, func);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
// 2. clear group and remove group
|
|
353
|
+
func();
|
|
354
|
+
}
|
|
355
|
+
this.visible = false;
|
|
356
|
+
});
|
|
348
357
|
}
|
|
349
358
|
/** Returns the visibility of the item. */
|
|
350
359
|
isVisible() {
|
|
@@ -464,7 +473,7 @@ class Item {
|
|
|
464
473
|
* @param previousStates previous states
|
|
465
474
|
* @returns
|
|
466
475
|
*/
|
|
467
|
-
drawWithStates(previousStates, onfinish) {
|
|
476
|
+
drawWithStates(previousStates, animate = true, onfinish) {
|
|
468
477
|
const _a = this.themeStyles, { default: _ } = _a, themeStateStyles = __rest(_a, ["default"]);
|
|
469
478
|
const { data: displayModelData } = this.displayModel;
|
|
470
479
|
let styles = {}; // merged styles
|
|
@@ -489,6 +498,7 @@ class Item {
|
|
|
489
498
|
mapper: mapper[shapeId],
|
|
490
499
|
dataChangedFields: undefined,
|
|
491
500
|
shapeConfig: stateStyles[shapeId],
|
|
501
|
+
fieldPath: [shapeId],
|
|
492
502
|
});
|
|
493
503
|
}
|
|
494
504
|
else if (shapeId === constant_1.OTHER_SHAPES_FIELD_NAME && mapper[shapeId]) {
|
|
@@ -502,6 +512,7 @@ class Item {
|
|
|
502
512
|
mapper: mapper[shapeId][otherShapeId],
|
|
503
513
|
dataChangedFields: undefined,
|
|
504
514
|
shapeConfig: stateStyles[shapeId][otherShapeId],
|
|
515
|
+
fieldPath: [shapeId, otherShapeId],
|
|
505
516
|
});
|
|
506
517
|
});
|
|
507
518
|
}
|
|
@@ -526,7 +537,7 @@ class Item {
|
|
|
526
537
|
{
|
|
527
538
|
previous: previousStates,
|
|
528
539
|
current: this.states,
|
|
529
|
-
}, onfinish);
|
|
540
|
+
}, animate, onfinish);
|
|
530
541
|
}
|
|
531
542
|
/**
|
|
532
543
|
* Get the rendering bouding box of the keyShape.
|
|
@@ -552,11 +563,14 @@ class Item {
|
|
|
552
563
|
if ((_a = this.animations) === null || _a === void 0 ? void 0 : _a.length) {
|
|
553
564
|
// during animations, estimate the final bounds by the styles in displayModel
|
|
554
565
|
const { keyShape, labelShape } = this.shapeMap;
|
|
555
|
-
const {
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
(0, shape_1.
|
|
559
|
-
|
|
566
|
+
const { x = 0, y = 0, z = 0 } = this.displayModel.data;
|
|
567
|
+
const { keyShape: keyShapeStyle, labelShape: labelShapeStyle } = this.renderExt.mergedStyles;
|
|
568
|
+
const estimateBounds = labelShape
|
|
569
|
+
? (0, shape_1.combineBounds)([
|
|
570
|
+
(0, shape_1.getShapeLocalBoundsByStyle)(keyShape, keyShapeStyle),
|
|
571
|
+
(0, shape_1.getShapeLocalBoundsByStyle)(labelShape, labelShapeStyle),
|
|
572
|
+
])
|
|
573
|
+
: (0, shape_1.getShapeLocalBoundsByStyle)(keyShape, keyShapeStyle);
|
|
560
574
|
[x, y, z].forEach((val, i) => {
|
|
561
575
|
estimateBounds.max[i] += val;
|
|
562
576
|
estimateBounds.min[i] += val;
|
|
@@ -570,9 +584,30 @@ class Item {
|
|
|
570
584
|
* Stop all the animations on the item.
|
|
571
585
|
*/
|
|
572
586
|
stopAnimations() {
|
|
573
|
-
var _a;
|
|
574
|
-
|
|
575
|
-
this.animations
|
|
587
|
+
var _a, _b, _c, _d;
|
|
588
|
+
const promises = [];
|
|
589
|
+
if ((_a = this.animations) === null || _a === void 0 ? void 0 : _a.length) {
|
|
590
|
+
while (this.animations.length) {
|
|
591
|
+
const animate = this.animations.pop();
|
|
592
|
+
if (animate.playState !== 'running')
|
|
593
|
+
break;
|
|
594
|
+
promises.push((0, animate_1.stopAnimate)(animate));
|
|
595
|
+
// @ts-ignore
|
|
596
|
+
(_b = animate.onManualCancel) === null || _b === void 0 ? void 0 : _b.call(animate);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
if ((_c = this.groupAnimations) === null || _c === void 0 ? void 0 : _c.length) {
|
|
600
|
+
while (this.groupAnimations.length) {
|
|
601
|
+
const groupAnimate = this.groupAnimations.pop();
|
|
602
|
+
if (groupAnimate.playState !== 'running')
|
|
603
|
+
break;
|
|
604
|
+
promises.push((0, animate_1.stopAnimate)(groupAnimate));
|
|
605
|
+
// @ts-ignore
|
|
606
|
+
(_d = groupAnimate.onManualCancel) === null || _d === void 0 ? void 0 : _d.call(groupAnimate);
|
|
607
|
+
}
|
|
608
|
+
this.groupAnimations = [];
|
|
609
|
+
}
|
|
610
|
+
return promises;
|
|
576
611
|
}
|
|
577
612
|
/**
|
|
578
613
|
* Call render extension's onZoom to response the graph zooming.
|
|
@@ -647,8 +682,16 @@ const updateChange = ({ innerModel, fieldName, mapper, dataChangedFields, }) =>
|
|
|
647
682
|
* }
|
|
648
683
|
* @returns { changed: boolean, value: unknown } return whether the mapper affects the value, and the mapped result
|
|
649
684
|
*/
|
|
650
|
-
const updateShapeChange = ({ innerModel, mapper, dataChangedFields, shapeConfig, }) => {
|
|
685
|
+
const updateShapeChange = ({ innerModel, mapper, dataChangedFields, shapeConfig, fieldPath, }) => {
|
|
686
|
+
if (!mapper)
|
|
687
|
+
return;
|
|
688
|
+
let innerModelValue = innerModel.data;
|
|
689
|
+
fieldPath === null || fieldPath === void 0 ? void 0 : fieldPath.forEach((field) => {
|
|
690
|
+
innerModelValue = innerModelValue[field] || {};
|
|
691
|
+
});
|
|
651
692
|
Object.keys(mapper).forEach((shapeAttrName) => {
|
|
693
|
+
if (innerModelValue === null || innerModelValue === void 0 ? void 0 : innerModelValue.hasOwnProperty(shapeAttrName))
|
|
694
|
+
return;
|
|
652
695
|
const { value: mappedValue } = updateChange({
|
|
653
696
|
innerModel,
|
|
654
697
|
mapper,
|