@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
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
NodeModelData,
|
|
15
15
|
NodeShapeMap,
|
|
16
16
|
NodeShapeStyles,
|
|
17
|
+
IAnchorPositionMap,
|
|
17
18
|
} from '../../../types/node';
|
|
18
19
|
import {
|
|
19
20
|
ComboDisplayModel,
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
upsertShape,
|
|
30
31
|
} from '../../../util/shape';
|
|
31
32
|
import { getWordWrapWidthByBox } from '../../../util/text';
|
|
33
|
+
import { convertToNumber } from '../../../util/type';
|
|
32
34
|
import { DEFAULT_ANIMATE_CFG, fadeIn, fadeOut } from '../../../util/animate';
|
|
33
35
|
import { getZoomLevel } from '../../../util/zoom';
|
|
34
36
|
import { AnimateCfg } from '../../../types/animate';
|
|
@@ -43,6 +45,13 @@ export abstract class BaseNode {
|
|
|
43
45
|
keyShapeLocal?: AABB;
|
|
44
46
|
labelShapeGeometry?: AABB;
|
|
45
47
|
};
|
|
48
|
+
//vertex coordinate
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Cache the scale transform calculated by balancing size, for restoring.
|
|
52
|
+
*/
|
|
53
|
+
protected scaleTransformCache = '';
|
|
54
|
+
|
|
46
55
|
// cache the zoom level infomations
|
|
47
56
|
protected zoomCache: {
|
|
48
57
|
// the id of shapes which are hidden by zoom changing.
|
|
@@ -86,9 +95,20 @@ export abstract class BaseNode {
|
|
|
86
95
|
...lodStrategy?.animateCfg,
|
|
87
96
|
};
|
|
88
97
|
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get merged styles from `getMergedStyles` and assigns the merged styles to the 'mergedStyles' property.
|
|
101
|
+
* @param model - The NodeDisplayModel or ComboDisplayModel to merge the styles from.
|
|
102
|
+
*/
|
|
89
103
|
public mergeStyles(model: NodeDisplayModel | ComboDisplayModel) {
|
|
90
104
|
this.mergedStyles = this.getMergedStyles(model);
|
|
91
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Merge style
|
|
109
|
+
* @param model - The NodeDisplayModel or ComboDisplayModel to retrieve the merged styles from.
|
|
110
|
+
* @returns The merged styles as a NodeShapeStyles object.
|
|
111
|
+
*/
|
|
92
112
|
public getMergedStyles(model: NodeDisplayModel | ComboDisplayModel) {
|
|
93
113
|
const { data } = model;
|
|
94
114
|
const dataStyles = {} as NodeShapeStyles | ComboShapeStyles;
|
|
@@ -138,6 +158,7 @@ export abstract class BaseNode {
|
|
|
138
158
|
}
|
|
139
159
|
/**
|
|
140
160
|
* Call it after calling draw function to update cache about bounds and zoom levels.
|
|
161
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
141
162
|
*/
|
|
142
163
|
public updateCache(shapeMap) {
|
|
143
164
|
['keyShape', 'labelShape']
|
|
@@ -155,7 +176,7 @@ export abstract class BaseNode {
|
|
|
155
176
|
}
|
|
156
177
|
});
|
|
157
178
|
|
|
158
|
-
const
|
|
179
|
+
const levelShapes = {};
|
|
159
180
|
Object.keys(shapeMap).forEach((shapeId) => {
|
|
160
181
|
const { lod } = shapeMap[shapeId].attributes;
|
|
161
182
|
if (lod !== undefined) {
|
|
@@ -163,6 +184,7 @@ export abstract class BaseNode {
|
|
|
163
184
|
levelShapes[lod].push(shapeId);
|
|
164
185
|
}
|
|
165
186
|
});
|
|
187
|
+
this.zoomCache.levelShapes = levelShapes;
|
|
166
188
|
|
|
167
189
|
if (shapeMap.labelShape && this.boundsCache.keyShapeLocal) {
|
|
168
190
|
const { maxWidth = '200%' } = this.mergedStyles.labelShape || {};
|
|
@@ -173,6 +195,15 @@ export abstract class BaseNode {
|
|
|
173
195
|
);
|
|
174
196
|
}
|
|
175
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Draw all elements related to the node.
|
|
200
|
+
* You should call `drawKeyShape` and `drawAnchorShape`,`drawLabelShape`,`drawIconShape`...as you like.
|
|
201
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
202
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
203
|
+
* @param diffData An object that contains previous and current data.
|
|
204
|
+
* @param diffState An object that contains previous and current node's state.
|
|
205
|
+
* @returns An object containing the keyShape and optional labelShape, iconShape, and some otherShapes properties
|
|
206
|
+
*/
|
|
176
207
|
abstract draw(
|
|
177
208
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
178
209
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
@@ -188,6 +219,13 @@ export abstract class BaseNode {
|
|
|
188
219
|
[otherShapeId: string]: DisplayObject;
|
|
189
220
|
};
|
|
190
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Perform additional drawing operations or add custom shapes after drawing node.
|
|
224
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
225
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
226
|
+
* @param shapesChanged An array of shape IDs that have changed and need to be updated.
|
|
227
|
+
* @returns An object that contains some new shapes to be added to the node.
|
|
228
|
+
*/
|
|
191
229
|
public afterDraw(
|
|
192
230
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
193
231
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
@@ -196,12 +234,28 @@ export abstract class BaseNode {
|
|
|
196
234
|
return {};
|
|
197
235
|
}
|
|
198
236
|
// shouldUpdate: (model: NodeDisplayModel, prevModel: NodeDisplayModel) => boolean = () => true;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Set the state for the node.
|
|
240
|
+
* @param state state name
|
|
241
|
+
* @param value state value
|
|
242
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
243
|
+
*/
|
|
199
244
|
public setState: (
|
|
200
245
|
name: string,
|
|
201
246
|
value: boolean,
|
|
202
247
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
203
248
|
) => void;
|
|
204
249
|
|
|
250
|
+
/**
|
|
251
|
+
* The key function of drawing shape.
|
|
252
|
+
* Draw the key shape of the node based on the provided model and shape map.
|
|
253
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
254
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
255
|
+
* @param diffData An object that contains previous and current data.
|
|
256
|
+
* @param diffState An object that contains previous and current node's state.
|
|
257
|
+
* @returns The display object representing the key shape of the node.
|
|
258
|
+
*/
|
|
205
259
|
abstract drawKeyShape(
|
|
206
260
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
207
261
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -212,6 +266,14 @@ export abstract class BaseNode {
|
|
|
212
266
|
diffState?: { previous: State[]; current: State[] },
|
|
213
267
|
): DisplayObject;
|
|
214
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Draw the label shape of the node
|
|
271
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
272
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
273
|
+
* @param diffData An object that contains previous and current data.
|
|
274
|
+
* @param diffState An object that contains previous and current node's state.
|
|
275
|
+
* @returns The display object representing the label shape of the node.
|
|
276
|
+
*/
|
|
215
277
|
public drawLabelShape(
|
|
216
278
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
217
279
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -221,6 +283,8 @@ export abstract class BaseNode {
|
|
|
221
283
|
},
|
|
222
284
|
diffState?: { previous: State[]; current: State[] },
|
|
223
285
|
): DisplayObject {
|
|
286
|
+
const { labelShape: shapeStyle } = this.mergedStyles;
|
|
287
|
+
if (!shapeStyle || !shapeStyle.text || !model.data.labelShape) return;
|
|
224
288
|
const { keyShape } = shapeMap;
|
|
225
289
|
this.boundsCache.keyShapeLocal =
|
|
226
290
|
this.boundsCache.keyShapeLocal || keyShape.getLocalBounds();
|
|
@@ -229,13 +293,14 @@ export abstract class BaseNode {
|
|
|
229
293
|
this.mergedStyles.keyShape,
|
|
230
294
|
this.boundsCache.keyShapeLocal,
|
|
231
295
|
);
|
|
232
|
-
const { labelShape: shapeStyle } = this.mergedStyles;
|
|
233
296
|
const {
|
|
234
297
|
position,
|
|
235
298
|
offsetX: propsOffsetX,
|
|
236
299
|
offsetY: propsOffsetY,
|
|
237
300
|
offsetZ: propsOffsetZ,
|
|
238
301
|
maxWidth,
|
|
302
|
+
// @ts-ignore
|
|
303
|
+
angle,
|
|
239
304
|
...otherStyle
|
|
240
305
|
} = shapeStyle;
|
|
241
306
|
|
|
@@ -300,11 +365,23 @@ export abstract class BaseNode {
|
|
|
300
365
|
const style: any = {
|
|
301
366
|
...this.defaultStyles.labelShape,
|
|
302
367
|
...positionPreset,
|
|
368
|
+
isBillboard: true,
|
|
303
369
|
...otherStyle,
|
|
304
370
|
};
|
|
371
|
+
if (angle) {
|
|
372
|
+
style.transform = `rotate(${angle}rad)`;
|
|
373
|
+
}
|
|
305
374
|
return this.upsertShape('text', 'labelShape', style, shapeMap, model);
|
|
306
375
|
}
|
|
307
376
|
|
|
377
|
+
/**
|
|
378
|
+
* Draw the label background shape of the node
|
|
379
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
380
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
381
|
+
* @param diffData An object that contains previous and current data.
|
|
382
|
+
* @param diffState An object that contains previous and current node's state.
|
|
383
|
+
* @returns The display object representing the label background shape of the node.
|
|
384
|
+
*/
|
|
308
385
|
public drawLabelBackgroundShape(
|
|
309
386
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
310
387
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -315,7 +392,7 @@ export abstract class BaseNode {
|
|
|
315
392
|
diffState?: { oldState: State[]; newState: State[] },
|
|
316
393
|
): DisplayObject {
|
|
317
394
|
const { labelShape } = shapeMap;
|
|
318
|
-
if (!labelShape || !model.data.labelShape) return;
|
|
395
|
+
if (!labelShape || !labelShape.style.text || !model.data.labelShape) return;
|
|
319
396
|
if (
|
|
320
397
|
!this.boundsCache.labelShapeGeometry ||
|
|
321
398
|
labelShape.getAttribute(LOCAL_BOUNDS_DIRTY_FLAG_KEY)
|
|
@@ -354,6 +431,14 @@ export abstract class BaseNode {
|
|
|
354
431
|
return bgShape;
|
|
355
432
|
}
|
|
356
433
|
|
|
434
|
+
/**
|
|
435
|
+
* Draw the icon shape of the node
|
|
436
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
437
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
438
|
+
* @param diffData An object that contains previous and current data.
|
|
439
|
+
* @param diffState An object that contains previous and current node's state.
|
|
440
|
+
* @returns The display object representing the icon shape of the node.
|
|
441
|
+
*/
|
|
357
442
|
public drawIconShape(
|
|
358
443
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
359
444
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -397,6 +482,14 @@ export abstract class BaseNode {
|
|
|
397
482
|
);
|
|
398
483
|
}
|
|
399
484
|
|
|
485
|
+
/**
|
|
486
|
+
* Draw the halo shape of the node
|
|
487
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
488
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
489
|
+
* @param diffData An object that contains previous and current data.
|
|
490
|
+
* @param diffState An object that contains previous and current node's state.
|
|
491
|
+
* @returns The display object representing the halo shape of the node.
|
|
492
|
+
*/
|
|
400
493
|
public drawHaloShape(
|
|
401
494
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
402
495
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -411,13 +504,16 @@ export abstract class BaseNode {
|
|
|
411
504
|
this.mergedStyles;
|
|
412
505
|
if (haloShapeStyle.visible === false) return;
|
|
413
506
|
const { nodeName, attributes } = keyShape;
|
|
507
|
+
const { x, y, fill } = attributes;
|
|
414
508
|
return this.upsertShape(
|
|
415
509
|
nodeName as SHAPE_TYPE,
|
|
416
510
|
'haloShape',
|
|
417
511
|
{
|
|
418
512
|
...attributes,
|
|
419
513
|
...keyShapeStyle,
|
|
420
|
-
|
|
514
|
+
x,
|
|
515
|
+
y,
|
|
516
|
+
stroke: fill,
|
|
421
517
|
...haloShapeStyle,
|
|
422
518
|
batchKey: 'halo',
|
|
423
519
|
},
|
|
@@ -426,6 +522,14 @@ export abstract class BaseNode {
|
|
|
426
522
|
);
|
|
427
523
|
}
|
|
428
524
|
|
|
525
|
+
/**
|
|
526
|
+
* Draw the anchors shape of the node
|
|
527
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
528
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
529
|
+
* @param diffData An object that contains previous and current data.
|
|
530
|
+
* @param diffState An object that contains previous and current node's state.
|
|
531
|
+
* @returns The display object representing the anchors shape of the node.
|
|
532
|
+
*/
|
|
429
533
|
public drawAnchorShapes(
|
|
430
534
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
431
535
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -446,20 +550,18 @@ export abstract class BaseNode {
|
|
|
446
550
|
if (!individualConfigs.length) return;
|
|
447
551
|
this.boundsCache.keyShapeLocal =
|
|
448
552
|
this.boundsCache.keyShapeLocal || shapeMap.keyShape.getLocalBounds();
|
|
449
|
-
const keyShapeBBox = this.boundsCache.keyShapeLocal;
|
|
450
|
-
const keyShapeWidth = keyShapeBBox.max[0] - keyShapeBBox.min[0];
|
|
451
|
-
const keyShapeHeight = keyShapeBBox.max[1] - keyShapeBBox.min[1];
|
|
452
|
-
|
|
453
553
|
const shapes = {};
|
|
554
|
+
const anchorPositionMap = this.calculateAnchorPosition(keyShapeStyle);
|
|
454
555
|
individualConfigs.forEach((config, i) => {
|
|
455
556
|
const { position, fill = keyShapeStyle.fill, ...style } = config;
|
|
557
|
+
const [cx, cy] = this.getAnchorPosition(position, anchorPositionMap);
|
|
456
558
|
const id = `anchorShape${i}`;
|
|
457
559
|
shapes[id] = this.upsertShape(
|
|
458
560
|
'circle',
|
|
459
561
|
id,
|
|
460
562
|
{
|
|
461
|
-
cx
|
|
462
|
-
cy
|
|
563
|
+
cx,
|
|
564
|
+
cy,
|
|
463
565
|
fill,
|
|
464
566
|
...commonStyle,
|
|
465
567
|
...style,
|
|
@@ -471,6 +573,61 @@ export abstract class BaseNode {
|
|
|
471
573
|
return shapes;
|
|
472
574
|
}
|
|
473
575
|
|
|
576
|
+
private getAnchorPosition(
|
|
577
|
+
position: string | [number, number],
|
|
578
|
+
anchorPositionMap: IAnchorPositionMap,
|
|
579
|
+
): [number, number] {
|
|
580
|
+
const keyShapeBBox = this.boundsCache.keyShapeLocal;
|
|
581
|
+
const keyShapeWidth = keyShapeBBox.max[0] - keyShapeBBox.min[0];
|
|
582
|
+
const keyShapeHeight = keyShapeBBox.max[1] - keyShapeBBox.min[1];
|
|
583
|
+
const defaultPosition: [number, number] = [
|
|
584
|
+
keyShapeBBox.max[0],
|
|
585
|
+
keyShapeBBox.min[1],
|
|
586
|
+
]; //topRight
|
|
587
|
+
if (position instanceof Array) {
|
|
588
|
+
return [
|
|
589
|
+
keyShapeWidth * (position[0] - 0.5),
|
|
590
|
+
keyShapeHeight * (position[1] - 0.5),
|
|
591
|
+
];
|
|
592
|
+
} else if (typeof position === 'string') {
|
|
593
|
+
position = position.toLowerCase();
|
|
594
|
+
//receive a unknown string, remind the user.
|
|
595
|
+
return (
|
|
596
|
+
anchorPositionMap[position] ||
|
|
597
|
+
anchorPositionMap['default'] ||
|
|
598
|
+
defaultPosition
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
//receive a position in unknown type (such as a number or undefined).
|
|
602
|
+
return anchorPositionMap['default'] || defaultPosition;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Configures the anchor positions based on the provided keyShapeStyle and returns the configuration.
|
|
607
|
+
* e.g for a CircleNode, it returns: `{"right":keyShapeStyle.x+keyShapeStyle.r, keyShapeStyle.y}`
|
|
608
|
+
* @param keyShapeStyle - The keyShapeStyle object that contains the style information of the key shape.
|
|
609
|
+
* @returns The anchor position configuration as an IAnchorPositionMap object.
|
|
610
|
+
*/
|
|
611
|
+
public calculateAnchorPosition(keyShapeStyle: any): IAnchorPositionMap {
|
|
612
|
+
const x = convertToNumber(keyShapeStyle.x);
|
|
613
|
+
const y = convertToNumber(keyShapeStyle.y);
|
|
614
|
+
const r = convertToNumber(keyShapeStyle.r);
|
|
615
|
+
const anchorPositionMap = {};
|
|
616
|
+
anchorPositionMap['top'] = [x, y - r];
|
|
617
|
+
anchorPositionMap['left'] = [x - r, y];
|
|
618
|
+
anchorPositionMap['right'] = anchorPositionMap['default'] = [x + r, y];
|
|
619
|
+
anchorPositionMap['bottom'] = [x, y + r];
|
|
620
|
+
return anchorPositionMap;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Draw the badges shape of the node
|
|
625
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
626
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
627
|
+
* @param diffData An object that contains previous and current data.
|
|
628
|
+
* @param diffState An object that contains previous and current node's state.
|
|
629
|
+
* @returns The display object representing the badges shape of the node.
|
|
630
|
+
*/
|
|
474
631
|
public drawBadgeShapes(
|
|
475
632
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
476
633
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -626,6 +783,14 @@ export abstract class BaseNode {
|
|
|
626
783
|
return shapes;
|
|
627
784
|
}
|
|
628
785
|
|
|
786
|
+
/**
|
|
787
|
+
* Draw other shapes(such as preRect,stateIcon) of the node
|
|
788
|
+
* @param model The displayed model of this node, only for drawing and not received by users.
|
|
789
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
790
|
+
* @param diffData An object that contains previous and current data.
|
|
791
|
+
* @param diffState An object that contains previous and current node's state.
|
|
792
|
+
* @returns The display object representing the other shapes of the node.
|
|
793
|
+
*/
|
|
629
794
|
public drawOtherShapes(
|
|
630
795
|
model: NodeDisplayModel | ComboDisplayModel,
|
|
631
796
|
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
@@ -642,8 +807,8 @@ export abstract class BaseNode {
|
|
|
642
807
|
* The listener for graph zooming.
|
|
643
808
|
* 1. show / hide some shapes while zoom level changed;
|
|
644
809
|
* 2. change the shapes' sizes to make them have same visual size while zooming, e.g. labelShape, labelBackgroundShape.
|
|
645
|
-
* @param shapeMap
|
|
646
|
-
* @param zoom
|
|
810
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
811
|
+
* @param zoom The zoom level of the graph.
|
|
647
812
|
*/
|
|
648
813
|
public onZoom = (shapeMap: NodeShapeMap | ComboShapeMap, zoom: number) => {
|
|
649
814
|
// zoomLevel changed
|
|
@@ -711,14 +876,14 @@ export abstract class BaseNode {
|
|
|
711
876
|
zoom: number,
|
|
712
877
|
) {
|
|
713
878
|
// balance the size for label, badges
|
|
714
|
-
const { labelShape, labelBackgroundShape } = shapeMap;
|
|
879
|
+
const { keyShape, labelShape, labelBackgroundShape } = shapeMap;
|
|
715
880
|
const balanceRatio = 1 / zoom || 1;
|
|
716
881
|
this.zoomCache.balanceRatio = balanceRatio;
|
|
717
882
|
if (!labelShape || !labelShape.isVisible()) return;
|
|
718
883
|
const { labelShape: labelStyle } = this.mergedStyles;
|
|
719
884
|
const { position = 'bottom' } = labelStyle;
|
|
720
885
|
|
|
721
|
-
const keyShapeLocal =
|
|
886
|
+
const keyShapeLocal = keyShape.getLocalBounds();
|
|
722
887
|
if (zoom < 1) {
|
|
723
888
|
// if it is zoom-out, do not scale the gap between keyShape and labelShape, differentiate from zoom-in by adjusting transformOrigin
|
|
724
889
|
if (position === 'bottom') labelShape.style.transformOrigin = '0';
|
|
@@ -751,7 +916,13 @@ export abstract class BaseNode {
|
|
|
751
916
|
break;
|
|
752
917
|
}
|
|
753
918
|
}
|
|
754
|
-
labelShape.style.transform
|
|
919
|
+
const oriTransform = (labelShape.style.transform || '').replace(
|
|
920
|
+
this.scaleTransformCache,
|
|
921
|
+
'',
|
|
922
|
+
);
|
|
923
|
+
const scaleTransform = `scale(${balanceRatio}, ${balanceRatio})`;
|
|
924
|
+
labelShape.style.transform = `${oriTransform} ${scaleTransform}`;
|
|
925
|
+
this.scaleTransformCache = scaleTransform;
|
|
755
926
|
const wordWrapWidth = this.zoomCache.wordWrapWidth * zoom;
|
|
756
927
|
labelShape.style.wordWrapWidth = wordWrapWidth;
|
|
757
928
|
|
|
@@ -803,6 +974,15 @@ export abstract class BaseNode {
|
|
|
803
974
|
labelBackgroundShape.style.transform = `scale(${xAxistRatio}, ${balanceRatio})`;
|
|
804
975
|
}
|
|
805
976
|
|
|
977
|
+
/**
|
|
978
|
+
* Create (if does not exit in shapeMap) or update the shape according to the configurations.
|
|
979
|
+
* @param type shape's type
|
|
980
|
+
* @param id unique string to indicates the shape
|
|
981
|
+
* @param style style to be updated
|
|
982
|
+
* @param shapeMap the shape map of a node / combo
|
|
983
|
+
* @param model data model of the node / combo
|
|
984
|
+
* @returns The display object representing the shape.
|
|
985
|
+
*/
|
|
806
986
|
public upsertShape(
|
|
807
987
|
type: SHAPE_TYPE | SHAPE_TYPE_3D,
|
|
808
988
|
id: string,
|
|
@@ -26,7 +26,14 @@ export abstract class BaseNode3D extends BaseNode {
|
|
|
26
26
|
this.device = props.device;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Draw the label shape of the 3D node
|
|
31
|
+
* @param model The displayed model of this 3D node, only for drawing and not received by users.
|
|
32
|
+
* @param shapeMap The shape map that contains all of the elements to show on the 3D node.
|
|
33
|
+
* @param diffData An object that contains previous and current data.
|
|
34
|
+
* @param diffState An object that contains previous and current 3D node's state.
|
|
35
|
+
* @returns The display object representing the label shape of the 3D node.
|
|
36
|
+
*/
|
|
30
37
|
public drawLabelShape(
|
|
31
38
|
model: NodeDisplayModel,
|
|
32
39
|
shapeMap: NodeShapeMap,
|
|
@@ -49,13 +56,6 @@ export abstract class BaseNode3D extends BaseNode {
|
|
|
49
56
|
...otherStyle
|
|
50
57
|
} = shapeStyle;
|
|
51
58
|
|
|
52
|
-
// TODO
|
|
53
|
-
// const wordWrapWidth = getWordWrapWidthByBox(
|
|
54
|
-
// keyShapeBox,
|
|
55
|
-
// maxWidth,
|
|
56
|
-
// this.zoomCache.zoom,
|
|
57
|
-
// );
|
|
58
|
-
|
|
59
59
|
const positionPreset = {
|
|
60
60
|
x: keyShapeBox.center[0],
|
|
61
61
|
y: keyShapeBox.max[1],
|
|
@@ -102,12 +102,21 @@ export abstract class BaseNode3D extends BaseNode {
|
|
|
102
102
|
const style: any = {
|
|
103
103
|
...this.defaultStyles.labelShape,
|
|
104
104
|
...positionPreset,
|
|
105
|
+
isBillboard: true,
|
|
105
106
|
...otherStyle,
|
|
106
107
|
};
|
|
108
|
+
|
|
107
109
|
return this.upsertShape('text', 'labelShape', style, shapeMap);
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Draw the icon shape of the 3D node
|
|
114
|
+
* @param model The displayed model of this 3D node, only for drawing and not received by users.
|
|
115
|
+
* @param shapeMap The shape map that contains all of the elements to show on the 3D node.
|
|
116
|
+
* @param diffData An object that contains previous and current data.
|
|
117
|
+
* @param diffState An object that contains previous and current 3D node's state.
|
|
118
|
+
* @returns The display object representing the icon shape of the 3D node.
|
|
119
|
+
*/
|
|
111
120
|
public drawIconShape(
|
|
112
121
|
model: NodeDisplayModel,
|
|
113
122
|
shapeMap: NodeShapeMap,
|
|
@@ -190,5 +199,12 @@ export abstract class BaseNode3D extends BaseNode {
|
|
|
190
199
|
return upsertShape3D(type, id, style as GShapeStyle, shapeMap, this.device);
|
|
191
200
|
}
|
|
192
201
|
|
|
202
|
+
/**
|
|
203
|
+
* The listener for graph zooming.
|
|
204
|
+
* 1. show / hide some shapes while zoom level changed;
|
|
205
|
+
* 2. change the shapes' sizes to make them have same visual size while zooming, e.g. labelShape, labelBackgroundShape.
|
|
206
|
+
* @param shapeMap The shape map that contains all of the elements to show on the node.
|
|
207
|
+
* @param zoom The zoom level of the graph.
|
|
208
|
+
*/
|
|
193
209
|
public onZoom = (shapeMap: NodeShapeMap, zoom: number) => {};
|
|
194
210
|
}
|
|
@@ -40,12 +40,12 @@ export class CircleNode extends BaseNode {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// labelShape
|
|
43
|
-
if (data.labelShape) {
|
|
43
|
+
if (data.labelShape && this.drawLabelShape) {
|
|
44
44
|
shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// labelBackgroundShape
|
|
48
|
-
if (data.labelBackgroundShape) {
|
|
48
|
+
if (data.labelBackgroundShape && this.drawLabelBackgroundShape) {
|
|
49
49
|
shapes.labelBackgroundShape = this.drawLabelBackgroundShape(
|
|
50
50
|
model,
|
|
51
51
|
shapeMap,
|
|
@@ -54,7 +54,7 @@ export class CircleNode extends BaseNode {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// anchor shapes
|
|
57
|
-
if (data.anchorShapes) {
|
|
57
|
+
if (data.anchorShapes && this.drawAnchorShapes) {
|
|
58
58
|
const anchorShapes = this.drawAnchorShapes(
|
|
59
59
|
model,
|
|
60
60
|
shapeMap,
|
|
@@ -68,12 +68,12 @@ export class CircleNode extends BaseNode {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// iconShape
|
|
71
|
-
if (data.iconShape) {
|
|
71
|
+
if (data.iconShape && this.drawIconShape) {
|
|
72
72
|
shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// badgeShape
|
|
76
|
-
if (data.badgeShapes) {
|
|
76
|
+
if (data.badgeShapes && this.drawBadgeShapes) {
|
|
77
77
|
const badgeShapes = this.drawBadgeShapes(
|
|
78
78
|
model,
|
|
79
79
|
shapeMap,
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
|
+
import { NodeDisplayModel } from '../../../types';
|
|
3
|
+
import { State } from '../../../types/item';
|
|
4
|
+
import {
|
|
5
|
+
IAnchorPositionMap,
|
|
6
|
+
NodeModelData,
|
|
7
|
+
NodeShapeMap,
|
|
8
|
+
NodeShapeStyles,
|
|
9
|
+
} from '../../../types/node';
|
|
10
|
+
import { BaseNode } from './base';
|
|
11
|
+
type PathArray = any; //TODO: cannot import type PathArray
|
|
12
|
+
export class DiamondNode extends BaseNode {
|
|
13
|
+
override defaultStyles = {
|
|
14
|
+
keyShape: {
|
|
15
|
+
size: [50, 30],
|
|
16
|
+
x: 0,
|
|
17
|
+
y: 0,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
mergedStyles: NodeShapeStyles;
|
|
21
|
+
constructor(props) {
|
|
22
|
+
super(props);
|
|
23
|
+
// suggest to merge default styles like this to avoid style value missing
|
|
24
|
+
// this.defaultStyles = mergeStyles([this.baseDefaultStyles, this.defaultStyles]);
|
|
25
|
+
}
|
|
26
|
+
public draw(
|
|
27
|
+
model: NodeDisplayModel,
|
|
28
|
+
shapeMap: NodeShapeMap,
|
|
29
|
+
diffData?: { previous: NodeModelData; current: NodeModelData },
|
|
30
|
+
diffState?: { previous: State[]; current: State[] },
|
|
31
|
+
): NodeShapeMap {
|
|
32
|
+
const { data = {} } = model;
|
|
33
|
+
let shapes: NodeShapeMap = { keyShape: undefined };
|
|
34
|
+
|
|
35
|
+
// keyShape
|
|
36
|
+
shapes.keyShape = this.drawKeyShape(model, shapeMap, diffData);
|
|
37
|
+
|
|
38
|
+
// haloShape
|
|
39
|
+
if (data.haloShape && this.drawHaloShape) {
|
|
40
|
+
shapes.haloShape = this.drawHaloShape(model, shapeMap, diffData);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// labelShape
|
|
44
|
+
if (data.labelShape) {
|
|
45
|
+
shapes.labelShape = this.drawLabelShape(model, shapeMap, diffData);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// labelBackgroundShape
|
|
49
|
+
if (data.labelBackgroundShape) {
|
|
50
|
+
shapes.labelBackgroundShape = this.drawLabelBackgroundShape(
|
|
51
|
+
model,
|
|
52
|
+
shapeMap,
|
|
53
|
+
diffData,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// anchor shapes
|
|
58
|
+
if (data.anchorShapes) {
|
|
59
|
+
const anchorShapes = this.drawAnchorShapes(
|
|
60
|
+
model,
|
|
61
|
+
shapeMap,
|
|
62
|
+
diffData,
|
|
63
|
+
diffState,
|
|
64
|
+
);
|
|
65
|
+
shapes = {
|
|
66
|
+
...shapes,
|
|
67
|
+
...anchorShapes,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// iconShape
|
|
72
|
+
if (data.iconShape) {
|
|
73
|
+
shapes.iconShape = this.drawIconShape(model, shapeMap, diffData);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// badgeShape
|
|
77
|
+
if (data.badgeShapes) {
|
|
78
|
+
const badgeShapes = this.drawBadgeShapes(
|
|
79
|
+
model,
|
|
80
|
+
shapeMap,
|
|
81
|
+
diffData,
|
|
82
|
+
diffState,
|
|
83
|
+
);
|
|
84
|
+
shapes = {
|
|
85
|
+
...shapes,
|
|
86
|
+
...badgeShapes,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// otherShapes
|
|
91
|
+
if (data.otherShapes && this.drawOtherShapes) {
|
|
92
|
+
shapes = {
|
|
93
|
+
...shapes,
|
|
94
|
+
...this.drawOtherShapes(model, shapeMap, diffData),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return shapes;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public drawKeyShape(
|
|
101
|
+
model: NodeDisplayModel,
|
|
102
|
+
shapeMap: NodeShapeMap,
|
|
103
|
+
diffData?: { previous: NodeModelData; current: NodeModelData },
|
|
104
|
+
diffState?: { previous: State[]; current: State[] },
|
|
105
|
+
): DisplayObject {
|
|
106
|
+
const { keyShape: keyShapeStyle } = this.mergedStyles as any;
|
|
107
|
+
return this.upsertShape(
|
|
108
|
+
'path',
|
|
109
|
+
'keyShape',
|
|
110
|
+
{
|
|
111
|
+
...this.mergedStyles.keyShape,
|
|
112
|
+
path: this.getDiamondPath(keyShapeStyle),
|
|
113
|
+
},
|
|
114
|
+
shapeMap,
|
|
115
|
+
model,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private getDiamondPath(keyShapeStyle): PathArray {
|
|
120
|
+
const width = keyShapeStyle.size[0];
|
|
121
|
+
const height = keyShapeStyle.size[1];
|
|
122
|
+
const path = [
|
|
123
|
+
['M', 0, -height / 2], // top
|
|
124
|
+
['L', width / 2, 0], // right
|
|
125
|
+
['L', 0, height / 2], // bottom
|
|
126
|
+
['L', -width / 2, 0], // left
|
|
127
|
+
['Z'], // close
|
|
128
|
+
];
|
|
129
|
+
return path;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public override calculateAnchorPosition(
|
|
133
|
+
keyShapeStyle: any,
|
|
134
|
+
): IAnchorPositionMap {
|
|
135
|
+
const anchorPositionMap = {};
|
|
136
|
+
const width = keyShapeStyle.size[0];
|
|
137
|
+
const height = keyShapeStyle.size[1];
|
|
138
|
+
anchorPositionMap['bottom'] = [0, height / 2];
|
|
139
|
+
anchorPositionMap['left'] = [-width / 2, 0];
|
|
140
|
+
anchorPositionMap['right'] = anchorPositionMap['default'] = [width / 2, 0];
|
|
141
|
+
anchorPositionMap['top'] = [0, -height / 2];
|
|
142
|
+
return anchorPositionMap;
|
|
143
|
+
}
|
|
144
|
+
}
|