@antv/g6 5.0.0-alpha.9 → 5.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +2 -2
- package/esm/api-doc/behaviors.d.ts +2 -0
- package/esm/api-doc/behaviors.js +2 -0
- package/esm/api-doc/behaviors.js.map +1 -0
- package/esm/api-doc/graph.d.ts +4 -0
- package/esm/api-doc/graph.js +4 -0
- package/esm/api-doc/graph.js.map +1 -0
- package/esm/api-doc/item.d.ts +9 -0
- package/esm/api-doc/item.js +3 -0
- package/esm/api-doc/item.js.map +1 -0
- package/esm/api-doc/layout.d.ts +1 -0
- package/esm/api-doc/layout.js +2 -0
- package/esm/api-doc/layout.js.map +1 -0
- package/esm/api-doc/plugins.d.ts +1 -0
- package/esm/api-doc/plugins.js +2 -0
- package/esm/api-doc/plugins.js.map +1 -0
- package/esm/api-doc/types.d.ts +0 -0
- package/esm/api-doc/types.js +3 -0
- package/esm/api-doc/types.js.map +1 -0
- package/esm/api-doc/util.d.ts +3 -0
- package/esm/api-doc/util.js +4 -0
- package/esm/api-doc/util.js.map +1 -0
- package/esm/constant/shape.d.ts +7 -14
- package/esm/constant/shape.js +1 -0
- package/esm/constant/shape.js.map +1 -1
- package/esm/index.d.ts +213 -113
- package/esm/index.js +11 -4
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +13 -6
- package/esm/item/combo.js +72 -8
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +12 -9
- package/esm/item/edge.js +38 -11
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +8 -6
- package/esm/item/item.js +124 -81
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +14 -9
- package/esm/item/node.js +63 -48
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +17 -1
- package/esm/runtime/controller/data.js +320 -223
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/interaction.d.ts +1 -0
- package/esm/runtime/controller/interaction.js +7 -4
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +37 -4
- package/esm/runtime/controller/item.js +475 -177
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +4 -1
- package/esm/runtime/controller/layout.js +96 -14
- package/esm/runtime/controller/layout.js.map +1 -1
- package/esm/runtime/controller/plugin.d.ts +11 -0
- package/esm/runtime/controller/plugin.js +39 -6
- package/esm/runtime/controller/plugin.js.map +1 -1
- package/esm/runtime/controller/theme.js +8 -4
- package/esm/runtime/controller/theme.js.map +1 -1
- package/esm/runtime/graph.d.ts +181 -39
- package/esm/runtime/graph.js +561 -72
- package/esm/runtime/graph.js.map +1 -1
- package/esm/stdlib/behavior/activate-relations.d.ts +2 -3
- package/esm/stdlib/behavior/activate-relations.js +13 -9
- package/esm/stdlib/behavior/activate-relations.js.map +1 -1
- package/esm/stdlib/behavior/brush-select.d.ts +3 -4
- package/esm/stdlib/behavior/brush-select.js +2 -2
- package/esm/stdlib/behavior/brush-select.js.map +1 -1
- package/esm/stdlib/behavior/click-select.d.ts +2 -3
- package/esm/stdlib/behavior/click-select.js +8 -6
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.d.ts +1 -2
- package/esm/stdlib/behavior/collapse-expand-combo.js +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-tree.d.ts +44 -0
- package/esm/stdlib/behavior/collapse-expand-tree.js +69 -0
- package/esm/stdlib/behavior/collapse-expand-tree.js.map +1 -0
- package/esm/stdlib/behavior/drag-canvas.d.ts +1 -2
- package/esm/stdlib/behavior/drag-canvas.js +15 -11
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -1
- package/esm/stdlib/behavior/drag-combo.d.ts +16 -4
- package/esm/stdlib/behavior/drag-combo.js +70 -31
- package/esm/stdlib/behavior/drag-combo.js.map +1 -1
- package/esm/stdlib/behavior/drag-node.d.ts +20 -4
- package/esm/stdlib/behavior/drag-node.js +145 -57
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +1 -2
- package/esm/stdlib/behavior/hover-activate.js +1 -1
- package/esm/stdlib/behavior/hover-activate.js.map +1 -1
- package/esm/stdlib/behavior/index.d.ts +15 -0
- package/esm/stdlib/behavior/index.js +16 -0
- package/esm/stdlib/behavior/index.js.map +1 -0
- package/esm/stdlib/behavior/lasso-select.d.ts +7 -3
- package/esm/stdlib/behavior/lasso-select.js +2 -2
- package/esm/stdlib/behavior/lasso-select.js.map +1 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +2 -3
- package/esm/stdlib/behavior/orbit-canvas-3d.js +2 -2
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +1 -2
- package/esm/stdlib/behavior/rotate-canvas-3d.js +1 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +2 -3
- package/esm/stdlib/behavior/track-canvas-3d.js +2 -2
- package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/types.d.ts +13 -0
- package/esm/stdlib/behavior/types.js +2 -0
- package/esm/stdlib/behavior/types.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +1 -2
- package/esm/stdlib/behavior/zoom-canvas-3d.js +7 -7
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +1 -2
- package/esm/stdlib/behavior/zoom-canvas.js +20 -18
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/esm/stdlib/data/index.d.ts +3 -0
- package/esm/stdlib/data/index.js +4 -0
- package/esm/stdlib/data/index.js.map +1 -0
- package/esm/stdlib/data/mapNodeSize.d.ts +12 -0
- package/esm/stdlib/data/mapNodeSize.js +43 -0
- package/esm/stdlib/data/mapNodeSize.js.map +1 -0
- package/esm/stdlib/data/transformV4Data.d.ts +9 -0
- package/esm/stdlib/data/transformV4Data.js +142 -0
- package/esm/stdlib/data/transformV4Data.js.map +1 -0
- package/esm/stdlib/data/validateData.d.ts +9 -0
- package/esm/stdlib/data/validateData.js +98 -0
- package/esm/stdlib/data/validateData.js.map +1 -0
- package/esm/stdlib/index.d.ts +113 -69
- package/esm/stdlib/index.js +150 -53
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/index.d.ts +2 -0
- package/esm/stdlib/item/combo/index.js +3 -0
- package/esm/stdlib/item/combo/index.js.map +1 -0
- package/esm/stdlib/item/combo/rect.d.ts +31 -0
- package/esm/stdlib/item/combo/rect.js +65 -0
- package/esm/stdlib/item/combo/rect.js.map +1 -0
- package/esm/stdlib/item/edge/base.d.ts +10 -1
- package/esm/stdlib/item/edge/base.js +36 -5
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/{lib/stdlib/item/edge/cubic-horizon.d.ts → esm/stdlib/item/edge/cubic-horizontal.d.ts} +6 -7
- package/esm/stdlib/item/edge/{cubic-horizon.js → cubic-horizontal.js} +18 -33
- package/esm/stdlib/item/edge/cubic-horizontal.js.map +1 -0
- package/esm/stdlib/item/edge/cubic-vertical.d.ts +7 -8
- package/esm/stdlib/item/edge/cubic-vertical.js +17 -32
- package/esm/stdlib/item/edge/cubic-vertical.js.map +1 -1
- package/esm/stdlib/item/edge/cubic.d.ts +7 -8
- package/esm/stdlib/item/edge/cubic.js +22 -5
- package/esm/stdlib/item/edge/cubic.js.map +1 -1
- package/esm/stdlib/item/edge/index.d.ts +5 -0
- package/esm/stdlib/item/edge/index.js +5 -0
- package/esm/stdlib/item/edge/index.js.map +1 -1
- package/esm/stdlib/item/edge/line.d.ts +1 -1
- package/esm/stdlib/item/edge/line.js +16 -1
- package/esm/stdlib/item/edge/line.js.map +1 -1
- package/esm/stdlib/item/edge/loop.d.ts +32 -0
- package/esm/stdlib/item/edge/loop.js +115 -0
- package/esm/stdlib/item/edge/loop.js.map +1 -0
- package/esm/stdlib/item/edge/polyline.d.ts +44 -0
- package/esm/stdlib/item/edge/polyline.js +92 -0
- package/esm/stdlib/item/edge/polyline.js.map +1 -0
- package/esm/stdlib/item/edge/quadratic.d.ts +5 -6
- package/esm/stdlib/item/edge/quadratic.js +31 -19
- package/esm/stdlib/item/edge/quadratic.js.map +1 -1
- package/esm/stdlib/item/node/base.d.ts +45 -1
- package/esm/stdlib/item/node/base.js +97 -12
- package/esm/stdlib/item/node/base.js.map +1 -1
- package/esm/stdlib/item/node/base3d.js +1 -1
- package/esm/stdlib/item/node/base3d.js.map +1 -1
- package/esm/stdlib/item/node/circle.js +5 -5
- package/esm/stdlib/item/node/circle.js.map +1 -1
- package/esm/stdlib/item/node/diamond.d.ts +32 -0
- package/esm/stdlib/item/node/diamond.js +79 -0
- package/esm/stdlib/item/node/diamond.js.map +1 -0
- package/esm/stdlib/item/node/donut.d.ts +70 -0
- package/esm/stdlib/item/node/donut.js +207 -0
- package/esm/stdlib/item/node/donut.js.map +1 -0
- package/esm/stdlib/item/node/ellipse.d.ts +32 -0
- package/esm/stdlib/item/node/ellipse.js +71 -0
- package/esm/stdlib/item/node/ellipse.js.map +1 -0
- package/esm/stdlib/item/node/hexagon.d.ts +33 -0
- package/esm/stdlib/item/node/hexagon.js +102 -0
- package/esm/stdlib/item/node/hexagon.js.map +1 -0
- package/esm/stdlib/item/node/index.d.ts +7 -0
- package/esm/stdlib/item/node/index.js +7 -0
- package/esm/stdlib/item/node/index.js.map +1 -1
- package/esm/stdlib/item/node/modelRect.d.ts +61 -0
- package/esm/stdlib/item/node/modelRect.js +186 -0
- package/esm/stdlib/item/node/modelRect.js.map +1 -0
- package/esm/stdlib/item/node/rect.d.ts +1 -0
- package/esm/stdlib/item/node/rect.js +16 -0
- package/esm/stdlib/item/node/rect.js.map +1 -1
- package/esm/stdlib/item/node/star.d.ts +34 -0
- package/esm/stdlib/item/node/star.js +115 -0
- package/esm/stdlib/item/node/star.js.map +1 -0
- package/esm/stdlib/item/node/triangle.d.ts +44 -0
- package/esm/stdlib/item/node/triangle.js +177 -0
- package/esm/stdlib/item/node/triangle.js.map +1 -0
- package/esm/stdlib/plugin/fisheye/index.d.ts +32 -4
- package/esm/stdlib/plugin/fisheye/index.js +3 -2
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -1
- package/esm/stdlib/plugin/grid/index.d.ts +36 -0
- package/esm/stdlib/plugin/grid/index.js +81 -0
- package/esm/stdlib/plugin/grid/index.js.map +1 -0
- package/esm/stdlib/plugin/history/combo-command.d.ts +9 -0
- package/esm/stdlib/plugin/history/combo-command.js +21 -0
- package/esm/stdlib/plugin/history/combo-command.js.map +1 -0
- package/esm/stdlib/plugin/history/command.d.ts +18 -0
- package/esm/stdlib/plugin/history/command.js +51 -0
- package/esm/stdlib/plugin/history/command.js.map +1 -0
- package/esm/stdlib/plugin/history/index.d.ts +112 -0
- package/esm/stdlib/plugin/history/index.js +275 -0
- package/esm/stdlib/plugin/history/index.js.map +1 -0
- package/esm/stdlib/plugin/history/item-data-command.d.ts +14 -0
- package/esm/stdlib/plugin/history/item-data-command.js +63 -0
- package/esm/stdlib/plugin/history/item-data-command.js.map +1 -0
- package/esm/stdlib/plugin/history/layer-updated-command.d.ts +9 -0
- package/esm/stdlib/plugin/history/layer-updated-command.js +21 -0
- package/esm/stdlib/plugin/history/layer-updated-command.js.map +1 -0
- package/esm/stdlib/plugin/history/state-updated-command.d.ts +9 -0
- package/esm/stdlib/plugin/history/state-updated-command.js +20 -0
- package/esm/stdlib/plugin/history/state-updated-command.js.map +1 -0
- package/esm/stdlib/plugin/history/visibility-updated-command.d.ts +10 -0
- package/esm/stdlib/plugin/history/visibility-updated-command.js +23 -0
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +1 -0
- package/esm/stdlib/plugin/hull/bubbleset.d.ts +9 -0
- package/esm/stdlib/plugin/hull/bubbleset.js +592 -0
- package/esm/stdlib/plugin/hull/bubbleset.js.map +1 -0
- package/esm/stdlib/plugin/hull/convexHull.d.ts +14 -0
- package/esm/stdlib/plugin/hull/convexHull.js +56 -0
- package/esm/stdlib/plugin/hull/convexHull.js.map +1 -0
- package/esm/stdlib/plugin/hull/hullComponent.d.ts +87 -0
- package/esm/stdlib/plugin/hull/hullComponent.js +382 -0
- package/esm/stdlib/plugin/hull/hullComponent.js.map +1 -0
- package/esm/stdlib/plugin/hull/index.d.ts +59 -0
- package/esm/stdlib/plugin/hull/index.js +161 -0
- package/esm/stdlib/plugin/hull/index.js.map +1 -0
- package/esm/stdlib/plugin/hull/types.d.ts +15 -0
- package/esm/stdlib/plugin/hull/types.js +2 -0
- package/esm/stdlib/plugin/hull/types.js.map +1 -0
- package/esm/stdlib/plugin/hull/util.d.ts +77 -0
- package/esm/stdlib/plugin/hull/util.js +401 -0
- package/esm/stdlib/plugin/hull/util.js.map +1 -0
- package/esm/stdlib/plugin/index.d.ts +8 -0
- package/esm/stdlib/plugin/index.js +9 -0
- package/esm/stdlib/plugin/index.js.map +1 -0
- package/esm/stdlib/plugin/legend/index.d.ts +45 -3
- package/esm/stdlib/plugin/legend/index.js +47 -42
- package/esm/stdlib/plugin/legend/index.js.map +1 -1
- package/esm/stdlib/plugin/menu/index.d.ts +18 -5
- package/esm/stdlib/plugin/menu/index.js +4 -3
- package/esm/stdlib/plugin/menu/index.js.map +1 -1
- package/esm/stdlib/plugin/minimap/index.d.ts +11 -3
- package/esm/stdlib/plugin/minimap/index.js +19 -21
- package/esm/stdlib/plugin/minimap/index.js.map +1 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +59 -0
- package/esm/stdlib/plugin/toolbar/index.js +215 -0
- package/esm/stdlib/plugin/toolbar/index.js.map +1 -0
- package/esm/stdlib/plugin/tooltip/index.d.ts +24 -3
- package/esm/stdlib/plugin/tooltip/index.js +13 -12
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -1
- package/esm/stdlib/plugin/types.d.ts +8 -0
- package/esm/stdlib/plugin/types.js +2 -0
- package/esm/stdlib/plugin/types.js.map +1 -0
- package/esm/stdlib/theme/dark.d.ts +1 -2
- package/esm/stdlib/theme/dark.js +9 -1
- package/esm/stdlib/theme/dark.js.map +1 -1
- package/esm/stdlib/theme/index.d.ts +2 -0
- package/esm/stdlib/theme/index.js +3 -0
- package/esm/stdlib/theme/index.js.map +1 -0
- package/esm/stdlib/theme/light.d.ts +1 -2
- package/esm/stdlib/theme/light.js +12 -2
- package/esm/stdlib/theme/light.js.map +1 -1
- package/esm/stdlib/themeSolver/base.d.ts +1 -1
- package/esm/stdlib/themeSolver/base.js +1 -1
- package/esm/stdlib/themeSolver/base.js.map +1 -1
- package/esm/stdlib/themeSolver/index.d.ts +3 -0
- package/esm/stdlib/themeSolver/index.js +4 -0
- package/esm/stdlib/themeSolver/index.js.map +1 -0
- package/esm/stdlib/themeSolver/spec.d.ts +2 -4
- package/esm/stdlib/themeSolver/spec.js +2 -2
- package/esm/stdlib/themeSolver/spec.js.map +1 -1
- package/esm/stdlib/themeSolver/subject.d.ts +2 -4
- package/esm/stdlib/themeSolver/subject.js +2 -2
- package/esm/stdlib/themeSolver/subject.js.map +1 -1
- package/esm/types/behavior.js.map +1 -1
- package/esm/types/combo.d.ts +3 -4
- package/esm/types/common.d.ts +10 -0
- package/esm/types/data.d.ts +10 -4
- package/esm/types/edge.d.ts +17 -2
- package/esm/types/graph.d.ts +129 -16
- package/esm/types/history.d.ts +28 -0
- package/esm/types/history.js +6 -0
- package/esm/types/history.js.map +1 -0
- package/esm/types/hook.d.ts +25 -5
- package/esm/types/index.d.ts +11 -5
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +10 -4
- package/esm/types/item.js.map +1 -1
- package/esm/types/layout.d.ts +4 -1
- package/esm/types/loop.d.ts +21 -0
- package/esm/types/loop.js +12 -0
- package/esm/types/loop.js.map +1 -0
- package/esm/types/node.d.ts +87 -6
- package/esm/types/plugin.d.ts +4 -0
- package/esm/types/plugin.js +1 -1
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/spec.d.ts +26 -9
- package/esm/types/theme.d.ts +76 -10
- package/esm/types/theme.js +1 -2
- package/esm/types/theme.js.map +1 -1
- package/esm/util/animate.d.ts +2 -2
- package/esm/util/animate.js +52 -17
- package/esm/util/animate.js.map +1 -1
- package/esm/util/array.d.ts +8 -0
- package/esm/util/array.js +11 -1
- package/esm/util/array.js.map +1 -1
- package/esm/util/arrow.d.ts +17 -0
- package/esm/util/arrow.js +56 -0
- package/esm/util/arrow.js.map +1 -0
- package/esm/util/bbox.d.ts +106 -0
- package/esm/util/bbox.js +255 -0
- package/esm/util/bbox.js.map +1 -0
- package/esm/util/behavior.d.ts +2 -0
- package/esm/util/behavior.js +12 -0
- package/esm/util/behavior.js.map +1 -0
- package/esm/util/canvas.d.ts +1 -2
- package/esm/util/canvas.js +3 -20
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +33 -2
- package/esm/util/data.js +117 -5
- package/esm/util/data.js.map +1 -1
- package/esm/util/event.d.ts +22 -2
- package/esm/util/event.js +54 -0
- package/esm/util/event.js.map +1 -1
- package/esm/util/extend.d.ts +8 -2
- package/esm/util/extend.js.map +1 -1
- package/esm/util/index.d.ts +41 -3
- package/esm/util/index.js +20 -1
- package/esm/util/index.js.map +1 -1
- package/esm/util/item.d.ts +1 -1
- package/esm/util/item.js +7 -5
- package/esm/util/item.js.map +1 -1
- package/esm/util/layout.d.ts +40 -0
- package/esm/util/layout.js +160 -0
- package/esm/util/layout.js.map +1 -0
- package/esm/util/loop.d.ts +37 -0
- package/esm/util/loop.js +104 -0
- package/esm/util/loop.js.map +1 -0
- package/esm/util/mapper.js +4 -9
- package/esm/util/mapper.js.map +1 -1
- package/esm/util/math.d.ts +15 -0
- package/esm/util/math.js +14 -0
- package/esm/util/math.js.map +1 -1
- package/esm/util/mock.d.ts +30 -0
- package/esm/util/mock.js +69 -0
- package/esm/util/mock.js.map +1 -0
- package/esm/util/path.d.ts +11 -0
- package/esm/util/path.js +44 -0
- package/esm/util/path.js.map +1 -0
- package/esm/util/point.d.ts +24 -2
- package/esm/util/point.js +27 -2
- package/esm/util/point.js.map +1 -1
- package/esm/util/polyline.d.ts +113 -0
- package/esm/util/polyline.js +505 -0
- package/esm/util/polyline.js.map +1 -0
- package/esm/util/router.d.ts +31 -0
- package/esm/util/router.js +380 -0
- package/esm/util/router.js.map +1 -0
- package/esm/util/shape.d.ts +3 -3
- package/esm/util/shape.js +19 -3
- package/esm/util/shape.js.map +1 -1
- package/esm/util/shape3d.d.ts +1 -1
- package/esm/util/shape3d.js +12 -6
- package/esm/util/shape3d.js.map +1 -1
- package/esm/util/type.d.ts +6 -0
- package/esm/util/type.js +7 -1
- package/esm/util/type.js.map +1 -1
- package/esm/util/zoom.d.ts +1 -1
- package/esm/util/zoom.js +6 -2
- package/esm/util/zoom.js.map +1 -1
- package/lib/api-doc/behaviors.d.ts +2 -0
- package/lib/api-doc/behaviors.js +18 -0
- package/lib/api-doc/behaviors.js.map +1 -0
- package/lib/api-doc/graph.d.ts +4 -0
- package/lib/api-doc/graph.js +11 -0
- package/lib/api-doc/graph.js.map +1 -0
- package/lib/api-doc/item.d.ts +9 -0
- package/lib/api-doc/item.js +21 -0
- package/lib/api-doc/item.js.map +1 -0
- package/lib/api-doc/layout.d.ts +1 -0
- package/lib/api-doc/layout.js +3 -0
- package/lib/api-doc/layout.js.map +1 -0
- package/lib/api-doc/plugins.d.ts +1 -0
- package/lib/api-doc/plugins.js +18 -0
- package/lib/api-doc/plugins.js.map +1 -0
- package/lib/api-doc/types.d.ts +0 -0
- package/lib/api-doc/types.js +3 -0
- package/lib/api-doc/types.js.map +1 -0
- package/lib/api-doc/util.d.ts +3 -0
- package/lib/api-doc/util.js +10 -0
- package/lib/api-doc/util.js.map +1 -0
- package/lib/constant/shape.d.ts +7 -14
- package/lib/constant/shape.js +1 -0
- package/lib/constant/shape.js.map +1 -1
- package/lib/index.d.ts +213 -113
- package/lib/index.js +13 -3
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +13 -6
- package/lib/item/combo.js +72 -8
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +12 -9
- package/lib/item/edge.js +38 -11
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +8 -6
- package/lib/item/item.js +123 -80
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +14 -9
- package/lib/item/node.js +63 -48
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +17 -1
- package/lib/runtime/controller/data.js +318 -221
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/interaction.d.ts +1 -0
- package/lib/runtime/controller/interaction.js +7 -4
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +37 -4
- package/lib/runtime/controller/item.js +474 -176
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +4 -1
- package/lib/runtime/controller/layout.js +119 -14
- package/lib/runtime/controller/layout.js.map +1 -1
- package/lib/runtime/controller/plugin.d.ts +11 -0
- package/lib/runtime/controller/plugin.js +39 -6
- package/lib/runtime/controller/plugin.js.map +1 -1
- package/lib/runtime/controller/theme.js +8 -4
- package/lib/runtime/controller/theme.js.map +1 -1
- package/lib/runtime/graph.d.ts +181 -39
- package/lib/runtime/graph.js +560 -71
- package/lib/runtime/graph.js.map +1 -1
- package/lib/stdlib/behavior/activate-relations.d.ts +2 -3
- package/lib/stdlib/behavior/activate-relations.js +14 -9
- package/lib/stdlib/behavior/activate-relations.js.map +1 -1
- package/lib/stdlib/behavior/brush-select.d.ts +3 -4
- package/lib/stdlib/behavior/brush-select.js +3 -2
- package/lib/stdlib/behavior/brush-select.js.map +1 -1
- package/lib/stdlib/behavior/click-select.d.ts +2 -3
- package/lib/stdlib/behavior/click-select.js +9 -6
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-combo.d.ts +1 -2
- package/lib/stdlib/behavior/collapse-expand-combo.js +2 -1
- package/lib/stdlib/behavior/collapse-expand-combo.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-tree.d.ts +44 -0
- package/lib/stdlib/behavior/collapse-expand-tree.js +73 -0
- package/lib/stdlib/behavior/collapse-expand-tree.js.map +1 -0
- package/lib/stdlib/behavior/drag-canvas.d.ts +1 -2
- package/lib/stdlib/behavior/drag-canvas.js +16 -11
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -1
- package/lib/stdlib/behavior/drag-combo.d.ts +16 -4
- package/lib/stdlib/behavior/drag-combo.js +70 -30
- package/lib/stdlib/behavior/drag-combo.js.map +1 -1
- package/lib/stdlib/behavior/drag-node.d.ts +20 -4
- package/lib/stdlib/behavior/drag-node.js +145 -56
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +1 -2
- package/lib/stdlib/behavior/hover-activate.js +2 -1
- package/lib/stdlib/behavior/hover-activate.js.map +1 -1
- package/lib/stdlib/behavior/index.d.ts +15 -0
- package/lib/stdlib/behavior/index.js +32 -0
- package/lib/stdlib/behavior/index.js.map +1 -0
- package/lib/stdlib/behavior/lasso-select.d.ts +7 -3
- package/lib/stdlib/behavior/lasso-select.js +4 -6
- package/lib/stdlib/behavior/lasso-select.js.map +1 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +2 -3
- package/lib/stdlib/behavior/orbit-canvas-3d.js +4 -6
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +1 -2
- package/lib/stdlib/behavior/rotate-canvas-3d.js +2 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +2 -3
- package/lib/stdlib/behavior/track-canvas-3d.js +4 -6
- package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/types.d.ts +13 -0
- package/lib/stdlib/behavior/types.js +3 -0
- package/lib/stdlib/behavior/types.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +1 -2
- package/lib/stdlib/behavior/zoom-canvas-3d.js +8 -7
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +1 -2
- package/lib/stdlib/behavior/zoom-canvas.js +21 -18
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -1
- package/lib/stdlib/data/index.d.ts +3 -0
- package/lib/stdlib/data/index.js +20 -0
- package/lib/stdlib/data/index.js.map +1 -0
- package/lib/stdlib/data/mapNodeSize.d.ts +12 -0
- package/lib/stdlib/data/mapNodeSize.js +47 -0
- package/lib/stdlib/data/mapNodeSize.js.map +1 -0
- package/lib/stdlib/data/transformV4Data.d.ts +9 -0
- package/lib/stdlib/data/transformV4Data.js +146 -0
- package/lib/stdlib/data/transformV4Data.js.map +1 -0
- package/lib/stdlib/data/validateData.d.ts +9 -0
- package/lib/stdlib/data/validateData.js +102 -0
- package/lib/stdlib/data/validateData.js.map +1 -0
- package/lib/stdlib/index.d.ts +113 -69
- package/lib/stdlib/index.js +188 -67
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/index.d.ts +2 -0
- package/lib/stdlib/item/combo/index.js +19 -0
- package/lib/stdlib/item/combo/index.js.map +1 -0
- package/lib/stdlib/item/combo/rect.d.ts +31 -0
- package/lib/stdlib/item/combo/rect.js +69 -0
- package/lib/stdlib/item/combo/rect.js.map +1 -0
- package/lib/stdlib/item/edge/base.d.ts +10 -1
- package/lib/stdlib/item/edge/base.js +35 -4
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/{esm/stdlib/item/edge/cubic-horizon.d.ts → lib/stdlib/item/edge/cubic-horizontal.d.ts} +6 -7
- package/lib/stdlib/item/edge/{cubic-horizon.js → cubic-horizontal.js} +20 -35
- package/lib/stdlib/item/edge/cubic-horizontal.js.map +1 -0
- package/lib/stdlib/item/edge/cubic-vertical.d.ts +7 -8
- package/lib/stdlib/item/edge/cubic-vertical.js +17 -32
- package/lib/stdlib/item/edge/cubic-vertical.js.map +1 -1
- package/lib/stdlib/item/edge/cubic.d.ts +7 -8
- package/lib/stdlib/item/edge/cubic.js +22 -5
- package/lib/stdlib/item/edge/cubic.js.map +1 -1
- package/lib/stdlib/item/edge/index.d.ts +5 -0
- package/lib/stdlib/item/edge/index.js +5 -0
- package/lib/stdlib/item/edge/index.js.map +1 -1
- package/lib/stdlib/item/edge/line.d.ts +1 -1
- package/lib/stdlib/item/edge/line.js +16 -1
- package/lib/stdlib/item/edge/line.js.map +1 -1
- package/lib/stdlib/item/edge/loop.d.ts +32 -0
- package/lib/stdlib/item/edge/loop.js +119 -0
- package/lib/stdlib/item/edge/loop.js.map +1 -0
- package/lib/stdlib/item/edge/polyline.d.ts +44 -0
- package/lib/stdlib/item/edge/polyline.js +96 -0
- package/lib/stdlib/item/edge/polyline.js.map +1 -0
- package/lib/stdlib/item/edge/quadratic.d.ts +5 -6
- package/lib/stdlib/item/edge/quadratic.js +33 -21
- package/lib/stdlib/item/edge/quadratic.js.map +1 -1
- package/lib/stdlib/item/node/base.d.ts +45 -1
- package/lib/stdlib/item/node/base.js +97 -12
- package/lib/stdlib/item/node/base.js.map +1 -1
- package/lib/stdlib/item/node/base3d.js +1 -1
- package/lib/stdlib/item/node/base3d.js.map +1 -1
- package/lib/stdlib/item/node/circle.js +5 -5
- package/lib/stdlib/item/node/circle.js.map +1 -1
- package/lib/stdlib/item/node/diamond.d.ts +32 -0
- package/lib/stdlib/item/node/diamond.js +83 -0
- package/lib/stdlib/item/node/diamond.js.map +1 -0
- package/lib/stdlib/item/node/donut.d.ts +70 -0
- package/lib/stdlib/item/node/donut.js +211 -0
- package/lib/stdlib/item/node/donut.js.map +1 -0
- package/lib/stdlib/item/node/ellipse.d.ts +32 -0
- package/lib/stdlib/item/node/ellipse.js +75 -0
- package/lib/stdlib/item/node/ellipse.js.map +1 -0
- package/lib/stdlib/item/node/hexagon.d.ts +33 -0
- package/lib/stdlib/item/node/hexagon.js +106 -0
- package/lib/stdlib/item/node/hexagon.js.map +1 -0
- package/lib/stdlib/item/node/index.d.ts +7 -0
- package/lib/stdlib/item/node/index.js +7 -0
- package/lib/stdlib/item/node/index.js.map +1 -1
- package/lib/stdlib/item/node/modelRect.d.ts +61 -0
- package/lib/stdlib/item/node/modelRect.js +190 -0
- package/lib/stdlib/item/node/modelRect.js.map +1 -0
- package/lib/stdlib/item/node/rect.d.ts +1 -0
- package/lib/stdlib/item/node/rect.js +16 -0
- package/lib/stdlib/item/node/rect.js.map +1 -1
- package/lib/stdlib/item/node/star.d.ts +34 -0
- package/lib/stdlib/item/node/star.js +119 -0
- package/lib/stdlib/item/node/star.js.map +1 -0
- package/lib/stdlib/item/node/triangle.d.ts +44 -0
- package/lib/stdlib/item/node/triangle.js +181 -0
- package/lib/stdlib/item/node/triangle.js.map +1 -0
- package/lib/stdlib/plugin/fisheye/index.d.ts +32 -4
- package/lib/stdlib/plugin/fisheye/index.js +3 -1
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -1
- package/lib/stdlib/plugin/grid/index.d.ts +36 -0
- package/lib/stdlib/plugin/grid/index.js +85 -0
- package/lib/stdlib/plugin/grid/index.js.map +1 -0
- package/lib/stdlib/plugin/history/combo-command.d.ts +9 -0
- package/lib/stdlib/plugin/history/combo-command.js +25 -0
- package/lib/stdlib/plugin/history/combo-command.js.map +1 -0
- package/lib/stdlib/plugin/history/command.d.ts +18 -0
- package/lib/stdlib/plugin/history/command.js +54 -0
- package/lib/stdlib/plugin/history/command.js.map +1 -0
- package/lib/stdlib/plugin/history/index.d.ts +112 -0
- package/lib/stdlib/plugin/history/index.js +283 -0
- package/lib/stdlib/plugin/history/index.js.map +1 -0
- package/lib/stdlib/plugin/history/item-data-command.d.ts +14 -0
- package/lib/stdlib/plugin/history/item-data-command.js +67 -0
- package/lib/stdlib/plugin/history/item-data-command.js.map +1 -0
- package/lib/stdlib/plugin/history/layer-updated-command.d.ts +9 -0
- package/lib/stdlib/plugin/history/layer-updated-command.js +25 -0
- package/lib/stdlib/plugin/history/layer-updated-command.js.map +1 -0
- package/lib/stdlib/plugin/history/state-updated-command.d.ts +9 -0
- package/lib/stdlib/plugin/history/state-updated-command.js +24 -0
- package/lib/stdlib/plugin/history/state-updated-command.js.map +1 -0
- package/lib/stdlib/plugin/history/visibility-updated-command.d.ts +10 -0
- package/lib/stdlib/plugin/history/visibility-updated-command.js +27 -0
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +1 -0
- package/lib/stdlib/plugin/hull/bubbleset.d.ts +9 -0
- package/lib/stdlib/plugin/hull/bubbleset.js +596 -0
- package/lib/stdlib/plugin/hull/bubbleset.js.map +1 -0
- package/lib/stdlib/plugin/hull/convexHull.d.ts +14 -0
- package/lib/stdlib/plugin/hull/convexHull.js +61 -0
- package/lib/stdlib/plugin/hull/convexHull.js.map +1 -0
- package/lib/stdlib/plugin/hull/hullComponent.d.ts +87 -0
- package/lib/stdlib/plugin/hull/hullComponent.js +385 -0
- package/lib/stdlib/plugin/hull/hullComponent.js.map +1 -0
- package/lib/stdlib/plugin/hull/index.d.ts +59 -0
- package/lib/stdlib/plugin/hull/index.js +167 -0
- package/lib/stdlib/plugin/hull/index.js.map +1 -0
- package/lib/stdlib/plugin/hull/types.d.ts +15 -0
- package/lib/stdlib/plugin/hull/types.js +3 -0
- package/lib/stdlib/plugin/hull/types.js.map +1 -0
- package/lib/stdlib/plugin/hull/util.d.ts +77 -0
- package/lib/stdlib/plugin/hull/util.js +419 -0
- package/lib/stdlib/plugin/hull/util.js.map +1 -0
- package/lib/stdlib/plugin/index.d.ts +8 -0
- package/lib/stdlib/plugin/index.js +25 -0
- package/lib/stdlib/plugin/index.js.map +1 -0
- package/lib/stdlib/plugin/legend/index.d.ts +45 -3
- package/lib/stdlib/plugin/legend/index.js +46 -40
- package/lib/stdlib/plugin/legend/index.js.map +1 -1
- package/lib/stdlib/plugin/menu/index.d.ts +18 -5
- package/lib/stdlib/plugin/menu/index.js +5 -3
- package/lib/stdlib/plugin/menu/index.js.map +1 -1
- package/lib/stdlib/plugin/minimap/index.d.ts +11 -3
- package/lib/stdlib/plugin/minimap/index.js +19 -20
- package/lib/stdlib/plugin/minimap/index.js.map +1 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +59 -0
- package/lib/stdlib/plugin/toolbar/index.js +222 -0
- package/lib/stdlib/plugin/toolbar/index.js.map +1 -0
- package/lib/stdlib/plugin/tooltip/index.d.ts +24 -3
- package/lib/stdlib/plugin/tooltip/index.js +14 -12
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -1
- package/lib/stdlib/plugin/types.d.ts +8 -0
- package/lib/stdlib/plugin/types.js +3 -0
- package/lib/stdlib/plugin/types.js.map +1 -0
- package/lib/stdlib/theme/dark.d.ts +1 -2
- package/lib/stdlib/theme/dark.js +10 -1
- package/lib/stdlib/theme/dark.js.map +1 -1
- package/lib/stdlib/theme/index.d.ts +2 -0
- package/lib/stdlib/theme/index.js +19 -0
- package/lib/stdlib/theme/index.js.map +1 -0
- package/lib/stdlib/theme/light.d.ts +1 -2
- package/lib/stdlib/theme/light.js +13 -2
- package/lib/stdlib/theme/light.js.map +1 -1
- package/lib/stdlib/themeSolver/base.d.ts +1 -1
- package/lib/stdlib/themeSolver/base.js +2 -1
- package/lib/stdlib/themeSolver/base.js.map +1 -1
- package/lib/stdlib/themeSolver/index.d.ts +3 -0
- package/lib/stdlib/themeSolver/index.js +20 -0
- package/lib/stdlib/themeSolver/index.js.map +1 -0
- package/lib/stdlib/themeSolver/spec.d.ts +2 -4
- package/lib/stdlib/themeSolver/spec.js +4 -6
- package/lib/stdlib/themeSolver/spec.js.map +1 -1
- package/lib/stdlib/themeSolver/subject.d.ts +2 -4
- package/lib/stdlib/themeSolver/subject.js +4 -4
- package/lib/stdlib/themeSolver/subject.js.map +1 -1
- package/lib/types/behavior.js.map +1 -1
- package/lib/types/combo.d.ts +3 -4
- package/lib/types/common.d.ts +10 -0
- package/lib/types/data.d.ts +10 -4
- package/lib/types/edge.d.ts +17 -2
- package/lib/types/graph.d.ts +129 -16
- package/lib/types/history.d.ts +28 -0
- package/lib/types/history.js +9 -0
- package/lib/types/history.js.map +1 -0
- package/lib/types/hook.d.ts +25 -5
- package/lib/types/index.d.ts +11 -5
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +10 -4
- package/lib/types/item.js.map +1 -1
- package/lib/types/layout.d.ts +4 -1
- package/lib/types/loop.d.ts +21 -0
- package/lib/types/loop.js +15 -0
- package/lib/types/loop.js.map +1 -0
- package/lib/types/node.d.ts +87 -6
- package/lib/types/plugin.d.ts +4 -0
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/spec.d.ts +26 -9
- package/lib/types/theme.d.ts +76 -10
- package/lib/types/theme.js +1 -2
- package/lib/types/theme.js.map +1 -1
- package/lib/util/animate.d.ts +2 -2
- package/lib/util/animate.js +52 -17
- package/lib/util/animate.js.map +1 -1
- package/lib/util/array.d.ts +8 -0
- package/lib/util/array.js +13 -2
- package/lib/util/array.js.map +1 -1
- package/lib/util/arrow.d.ts +17 -0
- package/lib/util/arrow.js +60 -0
- package/lib/util/arrow.js.map +1 -0
- package/lib/util/bbox.d.ts +106 -0
- package/lib/util/bbox.js +273 -0
- package/lib/util/bbox.js.map +1 -0
- package/lib/util/behavior.d.ts +2 -0
- package/lib/util/behavior.js +16 -0
- package/lib/util/behavior.js.map +1 -0
- package/lib/util/canvas.d.ts +1 -2
- package/lib/util/canvas.js +3 -20
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +33 -2
- package/lib/util/data.js +121 -6
- package/lib/util/data.js.map +1 -1
- package/lib/util/event.d.ts +22 -2
- package/lib/util/event.js +56 -1
- package/lib/util/event.js.map +1 -1
- package/lib/util/extend.d.ts +8 -2
- package/lib/util/extend.js.map +1 -1
- package/lib/util/index.d.ts +41 -3
- package/lib/util/index.js +20 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/item.d.ts +1 -1
- package/lib/util/item.js +7 -5
- package/lib/util/item.js.map +1 -1
- package/lib/util/layout.d.ts +40 -0
- package/lib/util/layout.js +172 -0
- package/lib/util/layout.js.map +1 -0
- package/lib/util/loop.d.ts +37 -0
- package/lib/util/loop.js +111 -0
- package/lib/util/loop.js.map +1 -0
- package/lib/util/mapper.js +4 -9
- package/lib/util/mapper.js.map +1 -1
- package/lib/util/math.d.ts +15 -0
- package/lib/util/math.js +17 -1
- package/lib/util/math.js.map +1 -1
- package/lib/util/mock.d.ts +30 -0
- package/lib/util/mock.js +73 -0
- package/lib/util/mock.js.map +1 -0
- package/lib/util/path.d.ts +11 -0
- package/lib/util/path.js +49 -0
- package/lib/util/path.js.map +1 -0
- package/lib/util/point.d.ts +24 -2
- package/lib/util/point.js +31 -3
- package/lib/util/point.js.map +1 -1
- package/lib/util/polyline.d.ts +113 -0
- package/lib/util/polyline.js +524 -0
- package/lib/util/polyline.js.map +1 -0
- package/lib/util/router.d.ts +31 -0
- package/lib/util/router.js +384 -0
- package/lib/util/router.js.map +1 -0
- package/lib/util/shape.d.ts +3 -3
- package/lib/util/shape.js +19 -3
- package/lib/util/shape.js.map +1 -1
- package/lib/util/shape3d.d.ts +1 -1
- package/lib/util/shape3d.js +11 -5
- package/lib/util/shape3d.js.map +1 -1
- package/lib/util/type.d.ts +6 -0
- package/lib/util/type.js +9 -2
- package/lib/util/type.js.map +1 -1
- package/lib/util/zoom.d.ts +1 -1
- package/lib/util/zoom.js +6 -2
- package/lib/util/zoom.js.map +1 -1
- package/package.json +35 -15
- package/src/api-doc/behaviors.ts +2 -0
- package/src/api-doc/graph.ts +4 -0
- package/src/api-doc/item.ts +43 -0
- package/src/api-doc/layout.ts +13 -0
- package/src/api-doc/plugins.ts +1 -0
- package/src/api-doc/readme.md +59 -0
- package/src/api-doc/types.ts +2 -0
- package/src/api-doc/util.ts +3 -0
- package/src/constant/shape.ts +4 -1
- package/src/index.ts +14 -4
- package/src/item/combo.ts +105 -18
- package/src/item/edge.ts +68 -18
- package/src/item/item.ts +138 -82
- package/src/item/node.ts +100 -54
- package/src/runtime/controller/data.ts +410 -258
- package/src/runtime/controller/interaction.ts +8 -4
- package/src/runtime/controller/item.ts +690 -252
- package/src/runtime/controller/layout.ts +147 -14
- package/src/runtime/controller/plugin.ts +47 -10
- package/src/runtime/controller/theme.ts +8 -4
- package/src/runtime/graph.ts +721 -130
- package/src/stdlib/behavior/activate-relations.ts +14 -11
- package/src/stdlib/behavior/brush-select.ts +4 -5
- package/src/stdlib/behavior/click-select.ts +12 -10
- package/src/stdlib/behavior/collapse-expand-combo.ts +1 -3
- package/src/stdlib/behavior/collapse-expand-tree.ts +106 -0
- package/src/stdlib/behavior/drag-canvas.ts +15 -13
- package/src/stdlib/behavior/drag-combo.ts +109 -53
- package/src/stdlib/behavior/drag-node.ts +220 -83
- package/src/stdlib/behavior/hover-activate.ts +1 -2
- package/src/stdlib/behavior/index.ts +15 -0
- package/src/stdlib/behavior/lasso-select.ts +6 -2
- package/src/stdlib/behavior/orbit-canvas-3d.ts +2 -4
- package/src/stdlib/behavior/rotate-canvas-3d.ts +1 -3
- package/src/stdlib/behavior/track-canvas-3d.ts +2 -4
- package/src/stdlib/behavior/types.ts +15 -0
- package/src/stdlib/behavior/zoom-canvas-3d.ts +5 -7
- package/src/stdlib/behavior/zoom-canvas.ts +19 -19
- package/src/stdlib/data/index.ts +3 -0
- package/src/stdlib/data/mapNodeSize.ts +67 -0
- package/src/stdlib/data/transformV4Data.ts +207 -0
- package/src/stdlib/data/validateData.ts +146 -0
- package/src/stdlib/index.ts +215 -53
- package/src/stdlib/item/combo/index.ts +2 -0
- package/src/stdlib/item/combo/rect.ts +123 -0
- package/src/stdlib/item/edge/base.ts +66 -4
- package/src/stdlib/item/edge/{cubic-horizon.ts → cubic-horizontal.ts} +25 -53
- package/src/stdlib/item/edge/cubic-vertical.ts +24 -55
- package/src/stdlib/item/edge/cubic.ts +36 -36
- package/src/stdlib/item/edge/index.ts +5 -0
- package/src/stdlib/item/edge/line.ts +14 -15
- package/src/stdlib/item/edge/loop.ts +162 -0
- package/src/stdlib/item/edge/polyline.ts +161 -0
- package/src/stdlib/item/edge/quadratic.ts +34 -37
- package/src/stdlib/item/node/base.ts +116 -12
- package/src/stdlib/item/node/base3d.ts +2 -0
- package/src/stdlib/item/node/circle.ts +5 -5
- package/src/stdlib/item/node/diamond.ts +144 -0
- package/src/stdlib/item/node/donut.ts +368 -0
- package/src/stdlib/item/node/ellipse.ts +128 -0
- package/src/stdlib/item/node/hexagon.ts +168 -0
- package/src/stdlib/item/node/index.ts +7 -0
- package/src/stdlib/item/node/modelRect.ts +405 -0
- package/src/stdlib/item/node/rect.ts +17 -0
- package/src/stdlib/item/node/star.ts +181 -0
- package/src/stdlib/item/node/triangle.ts +265 -0
- package/src/stdlib/plugin/fisheye/index.ts +35 -6
- package/src/stdlib/plugin/grid/index.ts +125 -0
- package/src/stdlib/plugin/history/combo-command.ts +28 -0
- package/src/stdlib/plugin/history/command.ts +81 -0
- package/src/stdlib/plugin/history/index.ts +347 -0
- package/src/stdlib/plugin/history/item-data-command.ts +96 -0
- package/src/stdlib/plugin/history/layer-updated-command.ts +28 -0
- package/src/stdlib/plugin/history/state-updated-command.ts +36 -0
- package/src/stdlib/plugin/history/visibility-updated-command.ts +41 -0
- package/src/stdlib/plugin/hull/bubbleset.ts +828 -0
- package/src/stdlib/plugin/hull/convexHull.ts +68 -0
- package/src/stdlib/plugin/hull/hullComponent.ts +501 -0
- package/src/stdlib/plugin/hull/index.ts +234 -0
- package/src/stdlib/plugin/hull/types.ts +15 -0
- package/src/stdlib/plugin/hull/util.ts +511 -0
- package/src/stdlib/plugin/index.ts +8 -0
- package/src/stdlib/plugin/legend/index.ts +122 -61
- package/src/stdlib/plugin/menu/index.ts +21 -6
- package/src/stdlib/plugin/minimap/index.ts +35 -26
- package/src/stdlib/plugin/toolbar/index.ts +257 -0
- package/src/stdlib/plugin/tooltip/index.ts +38 -18
- package/src/stdlib/plugin/types.ts +8 -0
- package/src/stdlib/theme/dark.ts +9 -1
- package/src/stdlib/theme/index.ts +2 -0
- package/src/stdlib/theme/light.ts +13 -3
- package/src/stdlib/themeSolver/base.ts +1 -1
- package/src/stdlib/themeSolver/index.ts +3 -0
- package/src/stdlib/themeSolver/spec.ts +2 -5
- package/src/stdlib/themeSolver/subject.ts +2 -5
- package/src/types/behavior.ts +0 -1
- package/src/types/combo.ts +3 -4
- package/src/types/common.ts +13 -0
- package/src/types/data.ts +23 -4
- package/src/types/edge.ts +28 -4
- package/src/types/graph.ts +161 -11
- package/src/types/history.ts +30 -0
- package/src/types/hook.ts +29 -6
- package/src/types/index.ts +37 -12
- package/src/types/item.ts +15 -2
- package/src/types/layout.ts +20 -16
- package/src/types/loop.ts +23 -0
- package/src/types/node.ts +91 -11
- package/src/types/plugin.ts +7 -1
- package/src/types/spec.ts +30 -13
- package/src/types/theme.ts +80 -10
- package/src/util/animate.ts +58 -17
- package/src/util/array.ts +12 -1
- package/src/util/arrow.ts +62 -0
- package/src/util/bbox.ts +298 -0
- package/src/util/behavior.ts +14 -0
- package/src/util/canvas.ts +6 -24
- package/src/util/data.ts +134 -5
- package/src/util/event.ts +86 -2
- package/src/util/extend.ts +8 -2
- package/src/util/index.ts +31 -1
- package/src/util/item.ts +11 -8
- package/src/util/layout.ts +165 -0
- package/src/util/loop.ts +145 -0
- package/src/util/mapper.ts +10 -9
- package/src/util/math.ts +24 -0
- package/src/util/mock.ts +72 -0
- package/src/util/path.ts +52 -0
- package/src/util/point.ts +33 -2
- package/src/util/polyline.ts +676 -0
- package/src/util/router.ts +552 -0
- package/src/util/shape.ts +23 -7
- package/src/util/shape3d.ts +16 -11
- package/src/util/type.ts +8 -1
- package/src/util/zoom.ts +7 -3
- package/esm/stdlib/data/comboFromNode.d.ts +0 -9
- package/esm/stdlib/data/comboFromNode.js +0 -28
- package/esm/stdlib/data/comboFromNode.js.map +0 -1
- package/esm/stdlib/item/edge/cubic-horizon.js.map +0 -1
- package/lib/stdlib/data/comboFromNode.d.ts +0 -9
- package/lib/stdlib/data/comboFromNode.js +0 -32
- package/lib/stdlib/data/comboFromNode.js.map +0 -1
- package/lib/stdlib/item/edge/cubic-horizon.js.map +0 -1
- package/src/stdlib/data/comboFromNode.ts +0 -28
package/src/types/layout.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ForceLayoutOptions,
|
|
8
8
|
FruchtermanLayoutOptions,
|
|
9
9
|
GridLayoutOptions,
|
|
10
|
+
Layout,
|
|
10
11
|
LayoutMapping,
|
|
11
12
|
MDSLayoutOptions,
|
|
12
13
|
RadialLayoutOptions,
|
|
@@ -51,22 +52,21 @@ type CustomLayout = {
|
|
|
51
52
|
[option: string]: any;
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
export type StandardLayoutOptions =
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Workerized;
|
|
55
|
+
export type StandardLayoutOptions = (
|
|
56
|
+
| CircularLayout
|
|
57
|
+
| RandomLayout
|
|
58
|
+
| ConcentricLayout
|
|
59
|
+
| GridLayout
|
|
60
|
+
| MDSLayout
|
|
61
|
+
| RadialLayout
|
|
62
|
+
| FruchtermanLayout
|
|
63
|
+
| D3ForceLayout
|
|
64
|
+
| ForceLayout
|
|
65
|
+
| ForceAtlas2
|
|
66
|
+
| CustomLayout
|
|
67
|
+
) &
|
|
68
|
+
Animatable &
|
|
69
|
+
Workerized;
|
|
70
70
|
|
|
71
71
|
export type LayoutOptions =
|
|
72
72
|
| StandardLayoutOptions
|
|
@@ -136,3 +136,7 @@ interface ForceLayout extends ForceLayoutOptions {
|
|
|
136
136
|
interface ForceAtlas2 extends ForceAtlas2LayoutOptions {
|
|
137
137
|
type: 'forceAtlas2';
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
export interface LayoutRegistry {
|
|
141
|
+
[key: string]: Layout<LayoutOptions>;
|
|
142
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export enum LOOP_POSITION {
|
|
2
|
+
'top' = 'top',
|
|
3
|
+
'top-right' = 'top-right',
|
|
4
|
+
'right' = 'right',
|
|
5
|
+
'bottom-right' = 'bottom-right',
|
|
6
|
+
'bottom' = 'bottom',
|
|
7
|
+
'bottom-left' = 'bottom-left',
|
|
8
|
+
'left' = 'left',
|
|
9
|
+
'top-left' = 'top-left',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type LoopPosition = `${LOOP_POSITION}`;
|
|
13
|
+
|
|
14
|
+
export type LoopCfg = {
|
|
15
|
+
/** Specifies the relative position of the self-loop to the node. Default: top. */
|
|
16
|
+
position?: LoopPosition;
|
|
17
|
+
/** Determine the position from the edge of the node keyShape to the top of the self-loop, used to specify the curvature of the self-loop, the default is the height. */
|
|
18
|
+
dist?: number;
|
|
19
|
+
/** Specify whether to draw the ring clockwise. Default: true */
|
|
20
|
+
clockwise?: boolean;
|
|
21
|
+
/** For non-circular nodes, the offset between the connection point and the center coordinates of the node (top-right, bottom-right, top-left, bottom-left are special, which are four corner coordinates) in the x-axis or y-axis direction, The default is 1/4 of the minimum value of node width and high. */
|
|
22
|
+
pointPadding?: number;
|
|
23
|
+
};
|
package/src/types/node.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { DisplayObject
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
2
|
import { Node as GNode, ID, PlainObject } from '@antv/graphlib';
|
|
3
|
+
import { BaseNode } from '../stdlib/item/node/base';
|
|
4
|
+
import { BaseNode3D } from '../stdlib/item/node/base3d';
|
|
3
5
|
import { IAnimates } from './animate';
|
|
4
6
|
import {
|
|
5
7
|
BadgePosition,
|
|
@@ -7,10 +9,10 @@ import {
|
|
|
7
9
|
IBadgePosition,
|
|
8
10
|
IItem,
|
|
9
11
|
ItemShapeStyles,
|
|
12
|
+
LodStrategy,
|
|
10
13
|
ShapeAttrEncode,
|
|
11
|
-
ShapesEncode,
|
|
12
14
|
ShapeStyle,
|
|
13
|
-
|
|
15
|
+
ShapesEncode,
|
|
14
16
|
} from './item';
|
|
15
17
|
|
|
16
18
|
export type NodeLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'right';
|
|
@@ -18,17 +20,23 @@ export type NodeLabelPosition = 'bottom' | 'center' | 'top' | 'left' | 'right';
|
|
|
18
20
|
/** Data in user input model. */
|
|
19
21
|
export interface NodeUserModelData extends PlainObject {
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* The x-coordinate of node.
|
|
22
24
|
*/
|
|
23
25
|
x?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The y-coordinate of node.
|
|
28
|
+
*/
|
|
24
29
|
y?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The z-coordinate of node.
|
|
32
|
+
*/
|
|
25
33
|
z?: number;
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
35
|
+
* The type of node, e.g. `circle-node`.
|
|
28
36
|
*/
|
|
29
37
|
type?: string;
|
|
30
38
|
/**
|
|
31
|
-
*
|
|
39
|
+
* The subject color of the node's keyShape and anchor points.
|
|
32
40
|
* More styles should be configured in node mapper.
|
|
33
41
|
*/
|
|
34
42
|
color?: string;
|
|
@@ -42,9 +50,13 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
42
50
|
*/
|
|
43
51
|
visible?: boolean;
|
|
44
52
|
/**
|
|
45
|
-
*
|
|
53
|
+
* The id of parent combo.
|
|
46
54
|
*/
|
|
47
55
|
parentId?: ID;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to be a root at when used as a tree.
|
|
58
|
+
*/
|
|
59
|
+
isRoot?: boolean;
|
|
48
60
|
/**
|
|
49
61
|
* The icon to show on the node.
|
|
50
62
|
* More styles should be configured in node mapper.
|
|
@@ -55,7 +67,7 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
55
67
|
img?: string;
|
|
56
68
|
};
|
|
57
69
|
/**
|
|
58
|
-
* The ratio position of the keyShape for related edges linking into.
|
|
70
|
+
* The ratio position of the keyShape for related edges linking into. e.g. `[[0,0.5],[1,0.5]]`
|
|
59
71
|
* More styles should be configured in node mapper.
|
|
60
72
|
*/
|
|
61
73
|
anchorPoints?: number[][];
|
|
@@ -68,6 +80,13 @@ export interface NodeUserModelData extends PlainObject {
|
|
|
68
80
|
text: string;
|
|
69
81
|
position: BadgePosition;
|
|
70
82
|
}[];
|
|
83
|
+
/**
|
|
84
|
+
* Whether to prevent overlap with unassociated edges.
|
|
85
|
+
* - Used to preempt position.
|
|
86
|
+
* - Defaults to false.
|
|
87
|
+
* - Only valid for polyline
|
|
88
|
+
*/
|
|
89
|
+
preventPolylineEdgeOverlap?: boolean;
|
|
71
90
|
}
|
|
72
91
|
|
|
73
92
|
/** Data in inner model. Same format to the user data. */
|
|
@@ -75,21 +94,57 @@ export type NodeModelData = NodeUserModelData;
|
|
|
75
94
|
|
|
76
95
|
export interface NodeShapeStyles extends ItemShapeStyles {
|
|
77
96
|
// keyShape, iconShape, haloShape are defined in ItemShapeStyles
|
|
97
|
+
/**
|
|
98
|
+
* Style of the text to show on the node.
|
|
99
|
+
*/
|
|
78
100
|
labelShape?: ShapeStyle & {
|
|
101
|
+
/**
|
|
102
|
+
* Position of the text to show on the node.
|
|
103
|
+
*/
|
|
79
104
|
position?: 'top' | 'bottom' | 'left' | 'right' | 'center';
|
|
105
|
+
/**
|
|
106
|
+
* The x-axis offset of the text relative to the current position
|
|
107
|
+
*/
|
|
80
108
|
offsetX?: number;
|
|
109
|
+
/**
|
|
110
|
+
* The y-axis offset of the text relative to the current position
|
|
111
|
+
*/
|
|
81
112
|
offsetY?: number;
|
|
113
|
+
/**
|
|
114
|
+
* The z-axis offset of the text relative to the current position
|
|
115
|
+
*/
|
|
82
116
|
offsetZ?: number;
|
|
83
|
-
|
|
117
|
+
/**
|
|
118
|
+
* The max width of the text
|
|
119
|
+
* string means the percentage of the keyShape, number means pixel
|
|
120
|
+
*/
|
|
84
121
|
maxWidth?: string | number;
|
|
122
|
+
/**
|
|
123
|
+
* The clockwise rotation Angle, used in radians
|
|
124
|
+
*/
|
|
125
|
+
angle?: number;
|
|
85
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* The background style of the label
|
|
129
|
+
*/
|
|
86
130
|
labelBackgroundShape?: ShapeStyle & {
|
|
87
131
|
padding?: number | number[];
|
|
88
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Style of the badges to show on the node.
|
|
135
|
+
*/
|
|
89
136
|
badgeShapes?: ShapeStyle & {
|
|
90
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Background color of the badge.
|
|
139
|
+
*/
|
|
91
140
|
color?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Background color of the badge.
|
|
143
|
+
*/
|
|
92
144
|
palette?: string[];
|
|
145
|
+
/**
|
|
146
|
+
* Color of the text in badge.
|
|
147
|
+
*/
|
|
93
148
|
textColor?: string;
|
|
94
149
|
// individual styles and their position
|
|
95
150
|
[key: number]: ShapeStyle & {
|
|
@@ -99,12 +154,29 @@ export interface NodeShapeStyles extends ItemShapeStyles {
|
|
|
99
154
|
};
|
|
100
155
|
};
|
|
101
156
|
anchorShapes?: ShapeStyle & {
|
|
102
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Background color of the anchor.
|
|
159
|
+
*/
|
|
103
160
|
color?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Color of the text in anchor.
|
|
163
|
+
*/
|
|
104
164
|
textColor?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Size of the text in anchor.
|
|
167
|
+
*/
|
|
105
168
|
size?: number;
|
|
169
|
+
/**
|
|
170
|
+
* The x-axis offset of the text relative to the current position
|
|
171
|
+
*/
|
|
106
172
|
offsetX?: number;
|
|
173
|
+
/**
|
|
174
|
+
* The y-axis offset of the text relative to the current position
|
|
175
|
+
*/
|
|
107
176
|
offsetY?: number;
|
|
177
|
+
/**
|
|
178
|
+
* The z-axis offset of the text relative to the current position
|
|
179
|
+
*/
|
|
108
180
|
offsetZ?: number;
|
|
109
181
|
// individual styles and their position
|
|
110
182
|
[key: number]: ShapeStyle & {
|
|
@@ -161,3 +233,11 @@ export interface NodeShapeMap {
|
|
|
161
233
|
|
|
162
234
|
// TODO
|
|
163
235
|
export type INode = IItem;
|
|
236
|
+
|
|
237
|
+
export interface IAnchorPositionMap {
|
|
238
|
+
[key: string]: [number, number];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface NodeRegistry {
|
|
242
|
+
[key: string]: typeof BaseNode | typeof BaseNode3D;
|
|
243
|
+
}
|
package/src/types/plugin.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { deepMix, each } from '@antv/util';
|
|
2
2
|
import { IGraph } from './graph';
|
|
3
3
|
|
|
4
4
|
export interface IPluginBaseConfig {
|
|
@@ -13,6 +13,8 @@ interface EventMapType {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export abstract class Plugin {
|
|
16
|
+
public key: string;
|
|
17
|
+
|
|
16
18
|
private events: EventMapType;
|
|
17
19
|
|
|
18
20
|
public options: IPluginBaseConfig;
|
|
@@ -75,3 +77,7 @@ export abstract class Plugin {
|
|
|
75
77
|
this.destroyed = true;
|
|
76
78
|
}
|
|
77
79
|
}
|
|
80
|
+
|
|
81
|
+
export interface PluginRegistry {
|
|
82
|
+
[key: string]: typeof Plugin;
|
|
83
|
+
}
|
package/src/types/spec.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
GraphData,
|
|
6
|
-
InlineDataConfig,
|
|
7
|
-
TransformerFn,
|
|
8
|
-
} from './data';
|
|
1
|
+
import { Canvas } from '@antv/g';
|
|
2
|
+
import { AnimateCfg, CameraAnimationOptions } from './animate';
|
|
3
|
+
import { Padding, Point } from './common';
|
|
4
|
+
import { DataConfig, TransformerFn } from './data';
|
|
9
5
|
import {
|
|
10
6
|
EdgeDisplayModel,
|
|
11
7
|
EdgeEncode,
|
|
@@ -18,7 +14,7 @@ import {
|
|
|
18
14
|
NodeModel,
|
|
19
15
|
NodeShapesEncode,
|
|
20
16
|
} from './node';
|
|
21
|
-
import { GraphAlignment } from './view';
|
|
17
|
+
import { FitViewRules, GraphAlignment } from './view';
|
|
22
18
|
import {
|
|
23
19
|
ComboDisplayModel,
|
|
24
20
|
ComboEncode,
|
|
@@ -30,13 +26,17 @@ import { LayoutOptions } from './layout';
|
|
|
30
26
|
import { ThemeOptionsOf, ThemeRegistry } from './theme';
|
|
31
27
|
|
|
32
28
|
import { RendererName } from './render';
|
|
29
|
+
import { StackCfg } from './history';
|
|
30
|
+
import { Plugin } from './plugin';
|
|
33
31
|
|
|
34
32
|
export interface Specification<
|
|
35
33
|
B extends BehaviorRegistry,
|
|
36
34
|
T extends ThemeRegistry,
|
|
37
35
|
> {
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
container?: string | HTMLElement;
|
|
37
|
+
backgroundCanvas?: Canvas;
|
|
38
|
+
canvas?: Canvas;
|
|
39
|
+
transientCanvas?: Canvas;
|
|
40
40
|
width?: number;
|
|
41
41
|
height?: number;
|
|
42
42
|
renderer?:
|
|
@@ -51,13 +51,25 @@ export interface Specification<
|
|
|
51
51
|
| 'view'
|
|
52
52
|
| 'center'
|
|
53
53
|
| {
|
|
54
|
+
type: 'view';
|
|
55
|
+
padding?: Padding;
|
|
56
|
+
rules?: FitViewRules;
|
|
57
|
+
effectTiming?: CameraAnimationOptions;
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
type: 'center';
|
|
61
|
+
effectTiming?: CameraAnimationOptions;
|
|
62
|
+
}
|
|
63
|
+
| {
|
|
64
|
+
type: 'position';
|
|
54
65
|
position: Point;
|
|
55
|
-
alignment
|
|
66
|
+
alignment?: GraphAlignment;
|
|
67
|
+
effectTiming?: CameraAnimationOptions;
|
|
56
68
|
};
|
|
57
69
|
optimizeThreshold?: number;
|
|
58
70
|
|
|
59
71
|
/** data */
|
|
60
|
-
data
|
|
72
|
+
data?: DataConfig;
|
|
61
73
|
transform?:
|
|
62
74
|
| string[]
|
|
63
75
|
| {
|
|
@@ -109,8 +121,13 @@ export interface Specification<
|
|
|
109
121
|
type: string;
|
|
110
122
|
[cfgName: string]: unknown; // TODO: configs from plugins
|
|
111
123
|
}
|
|
124
|
+
| Plugin
|
|
112
125
|
)[];
|
|
113
126
|
|
|
114
127
|
/** theme */
|
|
115
128
|
theme?: ThemeOptionsOf<T>;
|
|
129
|
+
|
|
130
|
+
enableStack?: boolean;
|
|
131
|
+
|
|
132
|
+
stackCfg?: StackCfg;
|
|
116
133
|
}
|
package/src/types/theme.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseThemeSolver from '../stdlib/themeSolver/base';
|
|
1
|
+
import { BaseThemeSolver } from '../stdlib/themeSolver/base';
|
|
2
2
|
import { ComboShapeStyles } from './combo';
|
|
3
3
|
import { EdgeShapeStyles } from './edge';
|
|
4
4
|
import { LodStrategy } from './item';
|
|
@@ -6,8 +6,7 @@ import { NodeShapeStyles } from './node';
|
|
|
6
6
|
|
|
7
7
|
export interface ThemeOption {}
|
|
8
8
|
/**
|
|
9
|
-
* Base
|
|
10
|
-
* Two implementing ways: getSpec or getEvents
|
|
9
|
+
* Base Theme class.
|
|
11
10
|
*/
|
|
12
11
|
export abstract class Theme {
|
|
13
12
|
options: any = {};
|
|
@@ -28,7 +27,7 @@ export interface ThemeRegistry {
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
|
-
* Type
|
|
30
|
+
* Type templates, input registry table, output configure type.
|
|
32
31
|
* @example ThemeOptionsOf<{ 'drag-node': typeof DragNodeBehavior }> // 'drag-node' | { type: 'drag-node', key?: 'ctrl' | 'shift' }
|
|
33
32
|
*/
|
|
34
33
|
export type ThemeOptionsOf<T extends ThemeRegistry = {}> =
|
|
@@ -45,43 +44,114 @@ export type ThemeObjectOptionsOf<T extends ThemeRegistry = {}> = {
|
|
|
45
44
|
: never;
|
|
46
45
|
}[Extract<keyof T, string>];
|
|
47
46
|
|
|
48
|
-
/** Default and
|
|
47
|
+
/** Default and state styles for a node. */
|
|
49
48
|
export type NodeStyleSet = {
|
|
50
|
-
default
|
|
51
|
-
|
|
49
|
+
/** Styles in default state. */
|
|
50
|
+
default: NodeShapeStyles;
|
|
51
|
+
/** Styles in different states. */
|
|
52
52
|
[stateName: string]: NodeShapeStyles;
|
|
53
53
|
};
|
|
54
|
+
/** Default and state styles for an edge. */
|
|
54
55
|
export type EdgeStyleSet = {
|
|
55
|
-
default
|
|
56
|
+
/** Styles in default state. */
|
|
57
|
+
default: EdgeShapeStyles;
|
|
58
|
+
/** Styles in different states. */
|
|
56
59
|
[stateName: string]: EdgeShapeStyles;
|
|
57
60
|
};
|
|
61
|
+
/** Default and state styles for a combo. */
|
|
58
62
|
export type ComboStyleSet = {
|
|
59
|
-
default
|
|
63
|
+
/** Styles in default state. */
|
|
64
|
+
default: ComboShapeStyles;
|
|
65
|
+
/** Styles in different states. */
|
|
60
66
|
[stateName: string]: ComboShapeStyles;
|
|
61
67
|
};
|
|
62
68
|
|
|
69
|
+
/** Array of node style sets to map the palette in order.
|
|
70
|
+
* e.g.
|
|
71
|
+
* [
|
|
72
|
+
* { default: { keyShape: { fill: 'red', stroke: 'black' } }, selected: { keyShape: { fill: 'yellow' }} },
|
|
73
|
+
* { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} }
|
|
74
|
+
* ]
|
|
75
|
+
* If you want to map specified style set to a special data type value, use the map type where key is the to the data type value (e.g. cluster1, cluster2) and the value is the specification style set.
|
|
76
|
+
* e.g.
|
|
77
|
+
* {
|
|
78
|
+
* 'cluster1': { default: { keyShape: { fill: 'red', stroke: 'black' } }, selected: { keyShape: { fill: 'yellow' }} },
|
|
79
|
+
* 'cluster2': { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} },
|
|
80
|
+
* }
|
|
81
|
+
**/
|
|
63
82
|
export type NodeStyleSets =
|
|
64
83
|
| NodeStyleSet[]
|
|
65
84
|
| { [dataTypeValue: string]: NodeStyleSet };
|
|
85
|
+
|
|
86
|
+
/** Array of edge style sets to map the palette in order.
|
|
87
|
+
* e.g.
|
|
88
|
+
* [
|
|
89
|
+
* { default: { keyShape: { fill: 'red', stroke: 'black' } }, selected: { keyShape: { fill: 'yellow' }} },
|
|
90
|
+
* { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} }
|
|
91
|
+
* ]
|
|
92
|
+
* If you want to map specified style set to a special data type value, use the map type where key is the to the data type value (e.g. cluster1, cluster2) and the value is the specification style set.
|
|
93
|
+
* e.g.
|
|
94
|
+
* {
|
|
95
|
+
* 'cluster1': { default: { keyShape: { fill: 'red', stroke: 'black' } }, selected: { keyShape: { fill: 'yellow' }} },
|
|
96
|
+
* 'cluster2': { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} },
|
|
97
|
+
* }
|
|
98
|
+
**/
|
|
66
99
|
export type EdgeStyleSets =
|
|
67
100
|
| EdgeStyleSet[]
|
|
68
101
|
| { [dataTypeValue: string]: EdgeStyleSet };
|
|
102
|
+
|
|
103
|
+
/** Array of combo style sets to map the palette in order.
|
|
104
|
+
* e.g.
|
|
105
|
+
* [
|
|
106
|
+
* { default: { keyShape: { fill: 'red', stroke: 'black' } }, selected: { keyShape: { fill: 'yellow' }} },
|
|
107
|
+
* { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} }
|
|
108
|
+
* ]
|
|
109
|
+
* If you want to map specified style set to a special data type value, use the map type where key is the to the data type value (e.g. cluster1, cluster2) and the value is the specification style set.
|
|
110
|
+
* e.g.
|
|
111
|
+
* {
|
|
112
|
+
* 'cluster1': { default: { keyShape: { fill: 'red', stroke: 'black' } }, selected: { keyShape: { fill: 'yellow' }} },
|
|
113
|
+
* 'cluster2': { default: { keyShape: { fill: 'blue', stroke: 'black' } }, selected: { keyShape: { fill: 'green' }} },
|
|
114
|
+
* }
|
|
115
|
+
**/
|
|
69
116
|
export type ComboStyleSets =
|
|
70
117
|
| ComboStyleSet[]
|
|
71
118
|
| { [dataTypeValue: string]: ComboStyleSet };
|
|
72
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Theme specification for node.
|
|
122
|
+
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
123
|
+
* palette - color palette.
|
|
124
|
+
* styles - style sets to map.
|
|
125
|
+
* lodStrategy - level of detail strategy for global setting.
|
|
126
|
+
*/
|
|
73
127
|
export interface NodeThemeSpecifications {
|
|
74
128
|
dataTypeField?: string;
|
|
75
129
|
palette?: string[] | { [dataTypeValue: string]: string };
|
|
76
130
|
styles?: NodeStyleSets;
|
|
77
131
|
lodStrategy?: LodStrategy;
|
|
78
132
|
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Theme specification for edge.
|
|
136
|
+
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
137
|
+
* palette - color palette.
|
|
138
|
+
* styles - style sets to map.
|
|
139
|
+
* lodStrategy - level of detail strategy for global setting.
|
|
140
|
+
*/
|
|
79
141
|
export interface EdgeThemeSpecifications {
|
|
80
142
|
dataTypeField?: string;
|
|
81
143
|
palette?: string[] | { [dataTypeValue: string]: string };
|
|
82
144
|
styles?: EdgeStyleSets;
|
|
83
145
|
lodStrategy?: LodStrategy;
|
|
84
146
|
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Theme specification for combo.
|
|
150
|
+
* dataTypeField - the field name in model.data that indicates the data type to map style set.
|
|
151
|
+
* palette - color palette.
|
|
152
|
+
* styles - style sets to map.
|
|
153
|
+
* lodStrategy - level of detail strategy for global setting.
|
|
154
|
+
*/
|
|
85
155
|
export interface ComboThemeSpecifications {
|
|
86
156
|
dataTypeField?: string;
|
|
87
157
|
palette?: string[] | { [dataTypeValue: string]: string };
|
|
@@ -89,7 +159,7 @@ export interface ComboThemeSpecifications {
|
|
|
89
159
|
lodStrategy?: LodStrategy;
|
|
90
160
|
}
|
|
91
161
|
/**
|
|
92
|
-
* Theme specification
|
|
162
|
+
* Theme specification with node / edge / combo palette and style mappers. And also canvas DOM CSS settings.
|
|
93
163
|
*/
|
|
94
164
|
export interface ThemeSpecification {
|
|
95
165
|
node?: NodeThemeSpecifications;
|
package/src/util/animate.ts
CHANGED
|
@@ -248,7 +248,7 @@ const runAnimateGroupOnShapes = (
|
|
|
248
248
|
maxDurationIdx = i;
|
|
249
249
|
}
|
|
250
250
|
if (animation) {
|
|
251
|
-
animation.
|
|
251
|
+
animation.onManualCancel = () => {
|
|
252
252
|
hasCanceled = true;
|
|
253
253
|
cancelAnimations();
|
|
254
254
|
};
|
|
@@ -275,7 +275,6 @@ const runAnimateOnShape = (
|
|
|
275
275
|
beginStyle: ShapeStyle,
|
|
276
276
|
animateConfig,
|
|
277
277
|
) => {
|
|
278
|
-
if (!shape.isVisible()) return;
|
|
279
278
|
let animateArr;
|
|
280
279
|
if (!fields?.length) {
|
|
281
280
|
animateArr = getStyleDiff(shape.attributes, targetStyle);
|
|
@@ -293,10 +292,44 @@ const runAnimateOnShape = (
|
|
|
293
292
|
}
|
|
294
293
|
});
|
|
295
294
|
}
|
|
296
|
-
if (
|
|
295
|
+
if (!checkFrames(animateArr, shape)) return;
|
|
296
|
+
if (!shape.isVisible()) {
|
|
297
|
+
// Invisible, do not apply animate. Directly assign the target style instead.
|
|
298
|
+
Object.keys(animateArr[1]).forEach(
|
|
299
|
+
(field) => (shape.style[field] = animateArr[1][field]),
|
|
300
|
+
);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
297
303
|
return shape.animate(animateArr, animateConfig);
|
|
298
304
|
};
|
|
299
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Check and format the frames. If the frames are same, return false. If frames contains undefined x or y, format them.
|
|
308
|
+
* @param frames
|
|
309
|
+
* @param shape
|
|
310
|
+
* @returns
|
|
311
|
+
*/
|
|
312
|
+
const checkFrames = (frames, shape) => {
|
|
313
|
+
if (JSON.stringify(frames[0]) === JSON.stringify(frames[1])) return false;
|
|
314
|
+
['x', 'y'].forEach((dim) => {
|
|
315
|
+
if (!frames[0].hasOwnProperty(dim)) return;
|
|
316
|
+
let val;
|
|
317
|
+
const formatted = [...frames];
|
|
318
|
+
if (frames[0][dim] === undefined && frames[0][dim] !== frames[1][dim])
|
|
319
|
+
val = frames[1][dim];
|
|
320
|
+
if (frames[1][dim] === undefined && frames[0][dim] !== frames[1][dim])
|
|
321
|
+
val = frames[1][dim];
|
|
322
|
+
if (val !== undefined) {
|
|
323
|
+
shape.style[dim] = val;
|
|
324
|
+
delete formatted[0][dim];
|
|
325
|
+
delete formatted[1][dim];
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
if (JSON.stringify(frames[0]) === JSON.stringify(frames[1])) return false;
|
|
329
|
+
|
|
330
|
+
return true;
|
|
331
|
+
};
|
|
332
|
+
|
|
300
333
|
/**
|
|
301
334
|
* Handle shape and group animations.
|
|
302
335
|
* Should be called after canvas ready and shape appended.
|
|
@@ -318,7 +351,7 @@ export const animateShapes = (
|
|
|
318
351
|
onAnimatesEnd: Function = () => {},
|
|
319
352
|
): IAnimation[] => {
|
|
320
353
|
if (!animates?.[timing]) {
|
|
321
|
-
onAnimatesEnd();
|
|
354
|
+
onAnimatesEnd(false);
|
|
322
355
|
return;
|
|
323
356
|
}
|
|
324
357
|
const segmentedTiming =
|
|
@@ -335,7 +368,7 @@ export const animateShapes = (
|
|
|
335
368
|
let canceled = false;
|
|
336
369
|
const onfinish = () => {
|
|
337
370
|
if (i >= groupKeys.length) {
|
|
338
|
-
onAnimatesEnd();
|
|
371
|
+
!canceled && onAnimatesEnd(canceled);
|
|
339
372
|
return;
|
|
340
373
|
}
|
|
341
374
|
const groupAnimations = runAnimateGroupOnShapes(
|
|
@@ -345,7 +378,10 @@ export const animateShapes = (
|
|
|
345
378
|
mergedStyles,
|
|
346
379
|
timing,
|
|
347
380
|
onfinish, // execute next order group
|
|
348
|
-
() =>
|
|
381
|
+
() => {
|
|
382
|
+
canceled = true;
|
|
383
|
+
onAnimatesEnd(canceled);
|
|
384
|
+
},
|
|
349
385
|
canceled,
|
|
350
386
|
).filter(Boolean);
|
|
351
387
|
groupAnimations.forEach((animation) => {
|
|
@@ -362,17 +398,17 @@ export const animateShapes = (
|
|
|
362
398
|
export const getAnimatesExcludePosition = (animates) => {
|
|
363
399
|
if (!animates.update) return animates;
|
|
364
400
|
const isGroupId = (id) => !id || id === 'group';
|
|
365
|
-
// const groupUpdateAnimates = animates.update.filter(
|
|
366
|
-
// ({ shapeId }) => isGroupId(shapeId),
|
|
367
|
-
// );
|
|
368
401
|
const excludedAnimates = [];
|
|
369
402
|
animates.update.forEach((animate) => {
|
|
370
403
|
const { shapeId, fields } = animate;
|
|
404
|
+
const newFields = [...fields];
|
|
371
405
|
if (!isGroupId(shapeId)) {
|
|
372
|
-
excludedAnimates.push(
|
|
406
|
+
excludedAnimates.push({
|
|
407
|
+
...animate,
|
|
408
|
+
fields: newFields,
|
|
409
|
+
});
|
|
373
410
|
return;
|
|
374
411
|
}
|
|
375
|
-
const newFields = fields;
|
|
376
412
|
let isGroupPosition = false;
|
|
377
413
|
if (fields.includes('x')) {
|
|
378
414
|
const xFieldIdx = newFields.indexOf('x');
|
|
@@ -394,7 +430,10 @@ export const getAnimatesExcludePosition = (animates) => {
|
|
|
394
430
|
});
|
|
395
431
|
}
|
|
396
432
|
} else {
|
|
397
|
-
excludedAnimates.push(
|
|
433
|
+
excludedAnimates.push({
|
|
434
|
+
...animate,
|
|
435
|
+
fields: newFields,
|
|
436
|
+
});
|
|
398
437
|
}
|
|
399
438
|
});
|
|
400
439
|
return {
|
|
@@ -416,21 +455,23 @@ export const fadeIn = (id, shape, style, hiddenShape, animateConfig) => {
|
|
|
416
455
|
shape.animate([{ opacity: 0 }, { opacity }], animateConfig);
|
|
417
456
|
};
|
|
418
457
|
|
|
419
|
-
export const fadeOut = (id, shape,
|
|
458
|
+
export const fadeOut = (id, shape, hiddenShapeMap, animateConfig) => {
|
|
420
459
|
if (!shape?.isVisible()) return;
|
|
421
|
-
|
|
460
|
+
hiddenShapeMap[id] = true;
|
|
422
461
|
const { opacity = 1 } = shape.attributes;
|
|
423
462
|
if (opacity === 0) return;
|
|
424
463
|
const animation = shape.animate([{ opacity }, { opacity: 0 }], animateConfig);
|
|
425
|
-
animation.onfinish = () => shape.hide();
|
|
464
|
+
if (animation) animation.onfinish = () => shape.hide();
|
|
465
|
+
else shape.hide();
|
|
426
466
|
};
|
|
427
467
|
|
|
428
468
|
/**
|
|
429
469
|
* Make the animation to the end frame and clear it from the target shape.
|
|
430
470
|
* @param animation
|
|
431
471
|
*/
|
|
432
|
-
export const stopAnimate = (animation) => {
|
|
472
|
+
export const stopAnimate = (animation: IAnimation): Promise<any> => {
|
|
433
473
|
const timing = animation.effect.getTiming();
|
|
434
474
|
animation.currentTime = Number(timing.duration) + Number(timing.delay || 0);
|
|
435
|
-
animation.
|
|
475
|
+
animation.finish();
|
|
476
|
+
return animation.finished;
|
|
436
477
|
};
|