@antv/g6 5.0.0-alpha.8 → 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 +6 -19
- 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 +215 -95
- package/esm/index.js +11 -4
- package/esm/index.js.map +1 -1
- package/esm/item/combo.d.ts +79 -2
- package/esm/item/combo.js +186 -2
- package/esm/item/combo.js.map +1 -1
- package/esm/item/edge.d.ts +15 -12
- package/esm/item/edge.js +40 -14
- package/esm/item/edge.js.map +1 -1
- package/esm/item/item.d.ts +12 -10
- package/esm/item/item.js +155 -83
- package/esm/item/item.js.map +1 -1
- package/esm/item/node.d.ts +32 -23
- package/esm/item/node.js +70 -49
- package/esm/item/node.js.map +1 -1
- package/esm/runtime/controller/data.d.ts +28 -4
- package/esm/runtime/controller/data.js +562 -173
- package/esm/runtime/controller/data.js.map +1 -1
- package/esm/runtime/controller/interaction.d.ts +1 -0
- package/esm/runtime/controller/interaction.js +23 -8
- package/esm/runtime/controller/interaction.js.map +1 -1
- package/esm/runtime/controller/item.d.ts +47 -5
- package/esm/runtime/controller/item.js +712 -122
- package/esm/runtime/controller/item.js.map +1 -1
- package/esm/runtime/controller/layout.d.ts +4 -1
- package/esm/runtime/controller/layout.js +109 -13
- 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 +226 -47
- package/esm/runtime/graph.js +710 -90
- 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 +5 -3
- package/esm/stdlib/behavior/click-select.js +21 -7
- package/esm/stdlib/behavior/click-select.js.map +1 -1
- package/esm/stdlib/behavior/collapse-expand-combo.d.ts +28 -0
- package/esm/stdlib/behavior/collapse-expand-combo.js +35 -0
- package/esm/stdlib/behavior/collapse-expand-combo.js.map +1 -0
- 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 +111 -0
- package/esm/stdlib/behavior/drag-combo.js +380 -0
- package/esm/stdlib/behavior/drag-combo.js.map +1 -0
- package/esm/stdlib/behavior/drag-node.d.ts +33 -13
- package/esm/stdlib/behavior/drag-node.js +252 -67
- package/esm/stdlib/behavior/drag-node.js.map +1 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +2 -1
- package/esm/stdlib/behavior/hover-activate.js +2 -0
- 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 +115 -49
- package/esm/stdlib/index.js +156 -37
- package/esm/stdlib/index.js.map +1 -1
- package/esm/stdlib/item/combo/circle.d.ts +29 -0
- package/esm/stdlib/item/combo/circle.js +56 -0
- package/esm/stdlib/item/combo/circle.js.map +1 -0
- 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 +12 -3
- package/esm/stdlib/item/edge/base.js +39 -5
- package/esm/stdlib/item/edge/base.js.map +1 -1
- package/esm/stdlib/item/edge/cubic-horizontal.d.ts +36 -0
- package/esm/stdlib/item/edge/cubic-horizontal.js +56 -0
- package/esm/stdlib/item/edge/cubic-horizontal.js.map +1 -0
- package/esm/stdlib/item/edge/cubic-vertical.d.ts +36 -0
- package/esm/stdlib/item/edge/cubic-vertical.js +56 -0
- package/esm/stdlib/item/edge/cubic-vertical.js.map +1 -0
- package/esm/stdlib/item/edge/cubic.d.ts +59 -0
- package/esm/stdlib/item/edge/cubic.js +116 -0
- package/esm/stdlib/item/edge/cubic.js.map +1 -0
- package/esm/stdlib/item/edge/index.d.ts +6 -0
- package/esm/stdlib/item/edge/index.js +6 -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 +40 -0
- package/esm/stdlib/item/edge/quadratic.js +78 -0
- package/esm/stdlib/item/edge/quadratic.js.map +1 -0
- package/esm/stdlib/item/node/base.d.ts +83 -38
- package/esm/stdlib/item/node/base.js +100 -15
- 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 +8 -0
- package/esm/stdlib/item/node/index.js +8 -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 +32 -0
- package/esm/stdlib/item/node/rect.js +75 -0
- package/esm/stdlib/item/node/rect.js.map +1 -0
- 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 +130 -0
- package/esm/stdlib/plugin/fisheye/index.js +488 -0
- package/esm/stdlib/plugin/fisheye/index.js.map +1 -0
- 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 +55 -0
- package/esm/stdlib/plugin/menu/index.js +237 -0
- package/esm/stdlib/plugin/menu/index.js.map +1 -0
- 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 +96 -0
- package/esm/stdlib/plugin/tooltip/index.js +378 -0
- package/esm/stdlib/plugin/tooltip/index.js.map +1 -0
- 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 +13 -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 +65 -10
- 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 +51 -3
- package/esm/types/common.d.ts +10 -0
- package/esm/types/data.d.ts +13 -7
- package/esm/types/edge.d.ts +19 -5
- package/esm/types/event.d.ts +9 -1
- package/esm/types/event.js +8 -8
- package/esm/types/event.js.map +1 -1
- package/esm/types/graph.d.ts +169 -20
- 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 +33 -6
- package/esm/types/index.d.ts +11 -5
- package/esm/types/index.js.map +1 -1
- package/esm/types/item.d.ts +14 -8
- 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 +90 -10
- 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 +11 -20
- package/esm/util/canvas.js.map +1 -1
- package/esm/util/data.d.ts +96 -0
- package/esm/util/data.js +262 -0
- package/esm/util/data.js.map +1 -0
- package/esm/util/event.d.ts +29 -1
- package/esm/util/event.js +70 -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 +2 -1
- package/esm/util/item.js +38 -13
- 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 +39 -4
- package/esm/util/shape.js +118 -2
- 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 +2 -2
- 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 +215 -95
- package/lib/index.js +13 -3
- package/lib/index.js.map +1 -1
- package/lib/item/combo.d.ts +79 -2
- package/lib/item/combo.js +186 -2
- package/lib/item/combo.js.map +1 -1
- package/lib/item/edge.d.ts +15 -12
- package/lib/item/edge.js +40 -14
- package/lib/item/edge.js.map +1 -1
- package/lib/item/item.d.ts +12 -10
- package/lib/item/item.js +153 -81
- package/lib/item/item.js.map +1 -1
- package/lib/item/node.d.ts +32 -23
- package/lib/item/node.js +70 -49
- package/lib/item/node.js.map +1 -1
- package/lib/runtime/controller/data.d.ts +28 -4
- package/lib/runtime/controller/data.js +561 -172
- package/lib/runtime/controller/data.js.map +1 -1
- package/lib/runtime/controller/interaction.d.ts +1 -0
- package/lib/runtime/controller/interaction.js +22 -7
- package/lib/runtime/controller/interaction.js.map +1 -1
- package/lib/runtime/controller/item.d.ts +47 -5
- package/lib/runtime/controller/item.js +710 -120
- package/lib/runtime/controller/item.js.map +1 -1
- package/lib/runtime/controller/layout.d.ts +4 -1
- package/lib/runtime/controller/layout.js +132 -13
- 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 +226 -47
- package/lib/runtime/graph.js +709 -89
- 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 +5 -3
- package/lib/stdlib/behavior/click-select.js +22 -7
- package/lib/stdlib/behavior/click-select.js.map +1 -1
- package/lib/stdlib/behavior/collapse-expand-combo.d.ts +28 -0
- package/lib/stdlib/behavior/collapse-expand-combo.js +39 -0
- package/lib/stdlib/behavior/collapse-expand-combo.js.map +1 -0
- 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 +111 -0
- package/lib/stdlib/behavior/drag-combo.js +384 -0
- package/lib/stdlib/behavior/drag-combo.js.map +1 -0
- package/lib/stdlib/behavior/drag-node.d.ts +33 -13
- package/lib/stdlib/behavior/drag-node.js +252 -66
- package/lib/stdlib/behavior/drag-node.js.map +1 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +2 -1
- package/lib/stdlib/behavior/hover-activate.js +2 -0
- 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 +115 -49
- package/lib/stdlib/index.js +190 -47
- package/lib/stdlib/index.js.map +1 -1
- package/lib/stdlib/item/combo/circle.d.ts +29 -0
- package/lib/stdlib/item/combo/circle.js +60 -0
- package/lib/stdlib/item/combo/circle.js.map +1 -0
- 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 +12 -3
- package/lib/stdlib/item/edge/base.js +38 -4
- package/lib/stdlib/item/edge/base.js.map +1 -1
- package/lib/stdlib/item/edge/cubic-horizontal.d.ts +36 -0
- package/lib/stdlib/item/edge/cubic-horizontal.js +60 -0
- package/lib/stdlib/item/edge/cubic-horizontal.js.map +1 -0
- package/lib/stdlib/item/edge/cubic-vertical.d.ts +36 -0
- package/lib/stdlib/item/edge/cubic-vertical.js +60 -0
- package/lib/stdlib/item/edge/cubic-vertical.js.map +1 -0
- package/lib/stdlib/item/edge/cubic.d.ts +59 -0
- package/lib/stdlib/item/edge/cubic.js +120 -0
- package/lib/stdlib/item/edge/cubic.js.map +1 -0
- package/lib/stdlib/item/edge/index.d.ts +6 -0
- package/lib/stdlib/item/edge/index.js +6 -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 +40 -0
- package/lib/stdlib/item/edge/quadratic.js +82 -0
- package/lib/stdlib/item/edge/quadratic.js.map +1 -0
- package/lib/stdlib/item/node/base.d.ts +83 -38
- package/lib/stdlib/item/node/base.js +100 -15
- 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 +8 -0
- package/lib/stdlib/item/node/index.js +8 -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 +32 -0
- package/lib/stdlib/item/node/rect.js +79 -0
- package/lib/stdlib/item/node/rect.js.map +1 -0
- 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 +130 -0
- package/lib/stdlib/plugin/fisheye/index.js +492 -0
- package/lib/stdlib/plugin/fisheye/index.js.map +1 -0
- 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 +55 -0
- package/lib/stdlib/plugin/menu/index.js +244 -0
- package/lib/stdlib/plugin/menu/index.js.map +1 -0
- 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 +96 -0
- package/lib/stdlib/plugin/tooltip/index.js +385 -0
- package/lib/stdlib/plugin/tooltip/index.js.map +1 -0
- 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 +14 -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 +66 -10
- 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 +51 -3
- package/lib/types/common.d.ts +10 -0
- package/lib/types/data.d.ts +13 -7
- package/lib/types/edge.d.ts +19 -5
- package/lib/types/event.d.ts +9 -1
- package/lib/types/event.js +10 -10
- package/lib/types/event.js.map +1 -1
- package/lib/types/graph.d.ts +169 -20
- 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 +33 -6
- package/lib/types/index.d.ts +11 -5
- package/lib/types/index.js.map +1 -1
- package/lib/types/item.d.ts +14 -8
- package/lib/types/item.js +1 -1
- 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 +90 -10
- 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 +11 -20
- package/lib/util/canvas.js.map +1 -1
- package/lib/util/data.d.ts +96 -0
- package/lib/util/data.js +276 -0
- package/lib/util/data.js.map +1 -0
- package/lib/util/event.d.ts +29 -1
- package/lib/util/event.js +73 -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 +2 -1
- package/lib/util/item.js +38 -13
- 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 +39 -4
- package/lib/util/shape.js +122 -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 +2 -2
- package/lib/util/zoom.js +6 -2
- package/lib/util/zoom.js.map +1 -1
- package/package.json +42 -22
- 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 +307 -2
- package/src/item/edge.ts +73 -24
- package/src/item/item.ts +184 -85
- package/src/item/node.ts +138 -69
- package/src/runtime/controller/data.ts +665 -191
- package/src/runtime/controller/interaction.ts +31 -7
- package/src/runtime/controller/item.ts +990 -172
- package/src/runtime/controller/layout.ts +165 -13
- package/src/runtime/controller/plugin.ts +47 -10
- package/src/runtime/controller/theme.ts +8 -4
- package/src/runtime/graph.ts +922 -144
- 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 +26 -11
- package/src/stdlib/behavior/collapse-expand-combo.ts +57 -0
- 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 +589 -0
- package/src/stdlib/behavior/drag-node.ts +380 -110
- package/src/stdlib/behavior/hover-activate.ts +3 -5
- 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 +3 -5
- package/src/stdlib/behavior/rotate-canvas-3d.ts +1 -3
- package/src/stdlib/behavior/track-canvas-3d.ts +3 -5
- 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 +221 -37
- package/src/stdlib/item/combo/circle.ts +113 -0
- 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 +71 -6
- package/src/stdlib/item/edge/cubic-horizontal.ts +86 -0
- package/src/stdlib/item/edge/cubic-vertical.ts +85 -0
- package/src/stdlib/item/edge/cubic.ts +198 -0
- package/src/stdlib/item/edge/index.ts +6 -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 +133 -0
- package/src/stdlib/item/node/base.ts +195 -53
- 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 +8 -0
- package/src/stdlib/item/node/modelRect.ts +405 -0
- package/src/stdlib/item/node/rect.ts +141 -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 +607 -0
- 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 +275 -0
- 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 +444 -0
- package/src/stdlib/plugin/types.ts +8 -0
- package/src/stdlib/theme/dark.ts +13 -1
- package/src/stdlib/theme/index.ts +2 -0
- package/src/stdlib/theme/light.ts +88 -10
- 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 +61 -4
- package/src/types/common.ts +13 -0
- package/src/types/data.ts +28 -7
- package/src/types/edge.ts +30 -6
- package/src/types/event.ts +8 -8
- package/src/types/graph.ts +232 -25
- package/src/types/history.ts +30 -0
- package/src/types/hook.ts +37 -7
- package/src/types/index.ts +37 -12
- package/src/types/item.ts +25 -11
- package/src/types/layout.ts +20 -16
- package/src/types/loop.ts +23 -0
- package/src/types/node.ts +94 -14
- 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 +60 -20
- 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 +16 -24
- package/src/util/data.ts +307 -0
- package/src/util/event.ts +114 -1
- package/src/util/extend.ts +8 -2
- package/src/util/index.ts +31 -1
- package/src/util/item.ts +79 -13
- 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 +159 -6
- package/src/util/shape3d.ts +16 -11
- package/src/util/type.ts +8 -1
- package/src/util/zoom.ts +8 -4
- 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/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/src/stdlib/data/comboFromNode.ts +0 -28
|
@@ -8,13 +8,20 @@ import {
|
|
|
8
8
|
SHAPE_TYPE_3D,
|
|
9
9
|
ShapeStyle,
|
|
10
10
|
State,
|
|
11
|
-
|
|
11
|
+
LodStrategyObj,
|
|
12
12
|
} from '../../../types/item';
|
|
13
13
|
import {
|
|
14
14
|
NodeModelData,
|
|
15
15
|
NodeShapeMap,
|
|
16
16
|
NodeShapeStyles,
|
|
17
|
+
IAnchorPositionMap,
|
|
17
18
|
} from '../../../types/node';
|
|
19
|
+
import {
|
|
20
|
+
ComboDisplayModel,
|
|
21
|
+
ComboModelData,
|
|
22
|
+
ComboShapeStyles,
|
|
23
|
+
ComboShapeMap,
|
|
24
|
+
} from '../../../types/combo';
|
|
18
25
|
import {
|
|
19
26
|
LOCAL_BOUNDS_DIRTY_FLAG_KEY,
|
|
20
27
|
formatPadding,
|
|
@@ -23,20 +30,28 @@ import {
|
|
|
23
30
|
upsertShape,
|
|
24
31
|
} from '../../../util/shape';
|
|
25
32
|
import { getWordWrapWidthByBox } from '../../../util/text';
|
|
33
|
+
import { convertToNumber } from '../../../util/type';
|
|
26
34
|
import { DEFAULT_ANIMATE_CFG, fadeIn, fadeOut } from '../../../util/animate';
|
|
27
35
|
import { getZoomLevel } from '../../../util/zoom';
|
|
28
36
|
import { AnimateCfg } from '../../../types/animate';
|
|
29
37
|
|
|
30
38
|
export abstract class BaseNode {
|
|
31
39
|
type: string;
|
|
32
|
-
defaultStyles: NodeShapeStyles;
|
|
33
|
-
themeStyles: NodeShapeStyles;
|
|
34
|
-
mergedStyles: NodeShapeStyles;
|
|
35
|
-
lodStrategy?:
|
|
40
|
+
defaultStyles: NodeShapeStyles | ComboShapeStyles;
|
|
41
|
+
themeStyles: NodeShapeStyles | ComboShapeStyles;
|
|
42
|
+
mergedStyles: NodeShapeStyles | ComboShapeStyles;
|
|
43
|
+
lodStrategy?: LodStrategyObj;
|
|
36
44
|
boundsCache: {
|
|
37
45
|
keyShapeLocal?: AABB;
|
|
38
46
|
labelShapeGeometry?: AABB;
|
|
39
47
|
};
|
|
48
|
+
//vertex coordinate
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Cache the scale transform calculated by balancing size, for restoring.
|
|
52
|
+
*/
|
|
53
|
+
protected scaleTransformCache = '';
|
|
54
|
+
|
|
40
55
|
// cache the zoom level infomations
|
|
41
56
|
protected zoomCache: {
|
|
42
57
|
// the id of shapes which are hidden by zoom changing.
|
|
@@ -80,12 +95,16 @@ export abstract class BaseNode {
|
|
|
80
95
|
...lodStrategy?.animateCfg,
|
|
81
96
|
};
|
|
82
97
|
}
|
|
83
|
-
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Merge default style with the style Customized by users
|
|
101
|
+
*/
|
|
102
|
+
public mergeStyles(model: NodeDisplayModel | ComboDisplayModel) {
|
|
84
103
|
this.mergedStyles = this.getMergedStyles(model);
|
|
85
104
|
}
|
|
86
|
-
public getMergedStyles(model: NodeDisplayModel) {
|
|
105
|
+
public getMergedStyles(model: NodeDisplayModel | ComboDisplayModel) {
|
|
87
106
|
const { data } = model;
|
|
88
|
-
const dataStyles = {} as NodeShapeStyles;
|
|
107
|
+
const dataStyles = {} as NodeShapeStyles | ComboShapeStyles;
|
|
89
108
|
Object.keys(data).forEach((fieldName) => {
|
|
90
109
|
if (RESERVED_SHAPE_IDS.includes(fieldName)) {
|
|
91
110
|
if (fieldName === 'badgeShapes') {
|
|
@@ -149,7 +168,7 @@ export abstract class BaseNode {
|
|
|
149
168
|
}
|
|
150
169
|
});
|
|
151
170
|
|
|
152
|
-
const
|
|
171
|
+
const levelShapes = {};
|
|
153
172
|
Object.keys(shapeMap).forEach((shapeId) => {
|
|
154
173
|
const { lod } = shapeMap[shapeId].attributes;
|
|
155
174
|
if (lod !== undefined) {
|
|
@@ -157,6 +176,7 @@ export abstract class BaseNode {
|
|
|
157
176
|
levelShapes[lod].push(shapeId);
|
|
158
177
|
}
|
|
159
178
|
});
|
|
179
|
+
this.zoomCache.levelShapes = levelShapes;
|
|
160
180
|
|
|
161
181
|
if (shapeMap.labelShape && this.boundsCache.keyShapeLocal) {
|
|
162
182
|
const { maxWidth = '200%' } = this.mergedStyles.labelShape || {};
|
|
@@ -167,10 +187,17 @@ export abstract class BaseNode {
|
|
|
167
187
|
);
|
|
168
188
|
}
|
|
169
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Draw all elements related to the graphic.
|
|
192
|
+
* You should call `drawKeyShape` and `drawAnchorShape`,`drawLabelShape`,`drawIconShape`...as you like.
|
|
193
|
+
*/
|
|
170
194
|
abstract draw(
|
|
171
|
-
model: NodeDisplayModel,
|
|
195
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
172
196
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
173
|
-
diffData?: {
|
|
197
|
+
diffData?: {
|
|
198
|
+
previous: NodeModelData | ComboModelData;
|
|
199
|
+
current: NodeModelData | ComboModelData;
|
|
200
|
+
},
|
|
174
201
|
diffState?: { previous: State[]; current: State[] },
|
|
175
202
|
): {
|
|
176
203
|
keyShape: DisplayObject;
|
|
@@ -180,7 +207,7 @@ export abstract class BaseNode {
|
|
|
180
207
|
};
|
|
181
208
|
|
|
182
209
|
public afterDraw(
|
|
183
|
-
model: NodeDisplayModel,
|
|
210
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
184
211
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
185
212
|
shapesChanged?: string[],
|
|
186
213
|
): { [otherShapeId: string]: DisplayObject } {
|
|
@@ -193,19 +220,34 @@ export abstract class BaseNode {
|
|
|
193
220
|
shapeMap: { [shapeId: string]: DisplayObject },
|
|
194
221
|
) => void;
|
|
195
222
|
|
|
223
|
+
/**
|
|
224
|
+
* The key function of drawing shape.
|
|
225
|
+
* Defined the basic shape of the node.
|
|
226
|
+
*/
|
|
196
227
|
abstract drawKeyShape(
|
|
197
|
-
model: NodeDisplayModel,
|
|
198
|
-
shapeMap: NodeShapeMap,
|
|
199
|
-
diffData?: {
|
|
228
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
229
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
230
|
+
diffData?: {
|
|
231
|
+
previous: NodeModelData | ComboModelData;
|
|
232
|
+
current: NodeModelData | ComboModelData;
|
|
233
|
+
},
|
|
200
234
|
diffState?: { previous: State[]; current: State[] },
|
|
201
235
|
): DisplayObject;
|
|
202
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Draw the label of the node
|
|
239
|
+
*/
|
|
203
240
|
public drawLabelShape(
|
|
204
|
-
model: NodeDisplayModel,
|
|
205
|
-
shapeMap: NodeShapeMap,
|
|
206
|
-
diffData?: {
|
|
241
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
242
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
243
|
+
diffData?: {
|
|
244
|
+
previous: NodeModelData | ComboModelData;
|
|
245
|
+
current: NodeModelData | ComboModelData;
|
|
246
|
+
},
|
|
207
247
|
diffState?: { previous: State[]; current: State[] },
|
|
208
248
|
): DisplayObject {
|
|
249
|
+
const { labelShape: shapeStyle } = this.mergedStyles;
|
|
250
|
+
if (!shapeStyle) return;
|
|
209
251
|
const { keyShape } = shapeMap;
|
|
210
252
|
this.boundsCache.keyShapeLocal =
|
|
211
253
|
this.boundsCache.keyShapeLocal || keyShape.getLocalBounds();
|
|
@@ -214,13 +256,14 @@ export abstract class BaseNode {
|
|
|
214
256
|
this.mergedStyles.keyShape,
|
|
215
257
|
this.boundsCache.keyShapeLocal,
|
|
216
258
|
);
|
|
217
|
-
const { labelShape: shapeStyle } = this.mergedStyles;
|
|
218
259
|
const {
|
|
219
260
|
position,
|
|
220
261
|
offsetX: propsOffsetX,
|
|
221
262
|
offsetY: propsOffsetY,
|
|
222
263
|
offsetZ: propsOffsetZ,
|
|
223
264
|
maxWidth,
|
|
265
|
+
// @ts-ignore
|
|
266
|
+
angle,
|
|
224
267
|
...otherStyle
|
|
225
268
|
} = shapeStyle;
|
|
226
269
|
|
|
@@ -285,15 +328,25 @@ export abstract class BaseNode {
|
|
|
285
328
|
const style: any = {
|
|
286
329
|
...this.defaultStyles.labelShape,
|
|
287
330
|
...positionPreset,
|
|
331
|
+
isBillboard: true,
|
|
288
332
|
...otherStyle,
|
|
289
333
|
};
|
|
334
|
+
if (angle) {
|
|
335
|
+
style.transform = `rotate(${angle}rad)`;
|
|
336
|
+
}
|
|
290
337
|
return this.upsertShape('text', 'labelShape', style, shapeMap, model);
|
|
291
338
|
}
|
|
292
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Draw the label background of the node
|
|
342
|
+
*/
|
|
293
343
|
public drawLabelBackgroundShape(
|
|
294
|
-
model: NodeDisplayModel,
|
|
295
|
-
shapeMap: NodeShapeMap,
|
|
296
|
-
diffData?: {
|
|
344
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
345
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
346
|
+
diffData?: {
|
|
347
|
+
previous: NodeModelData | ComboModelData;
|
|
348
|
+
current: NodeModelData | ComboModelData;
|
|
349
|
+
},
|
|
297
350
|
diffState?: { oldState: State[]; newState: State[] },
|
|
298
351
|
): DisplayObject {
|
|
299
352
|
const { labelShape } = shapeMap;
|
|
@@ -336,10 +389,16 @@ export abstract class BaseNode {
|
|
|
336
389
|
return bgShape;
|
|
337
390
|
}
|
|
338
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Draw the icon of the node
|
|
394
|
+
*/
|
|
339
395
|
public drawIconShape(
|
|
340
|
-
model: NodeDisplayModel,
|
|
341
|
-
shapeMap: NodeShapeMap,
|
|
342
|
-
diffData?: {
|
|
396
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
397
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
398
|
+
diffData?: {
|
|
399
|
+
previous: NodeModelData | ComboModelData;
|
|
400
|
+
current: NodeModelData | ComboModelData;
|
|
401
|
+
},
|
|
343
402
|
diffState?: { previous: State[]; current: State[] },
|
|
344
403
|
): DisplayObject {
|
|
345
404
|
const { iconShape: shapeStyle } = this.mergedStyles;
|
|
@@ -376,22 +435,33 @@ export abstract class BaseNode {
|
|
|
376
435
|
);
|
|
377
436
|
}
|
|
378
437
|
|
|
438
|
+
/**
|
|
439
|
+
* Draw the halo of the node
|
|
440
|
+
*/
|
|
379
441
|
public drawHaloShape(
|
|
380
|
-
model: NodeDisplayModel,
|
|
381
|
-
shapeMap: NodeShapeMap,
|
|
382
|
-
diffData?: {
|
|
442
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
443
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
444
|
+
diffData?: {
|
|
445
|
+
previous: NodeModelData | ComboModelData;
|
|
446
|
+
current: NodeModelData | ComboModelData;
|
|
447
|
+
},
|
|
383
448
|
diffState?: { previous: State[]; current: State[] },
|
|
384
449
|
): DisplayObject {
|
|
385
450
|
const { keyShape } = shapeMap;
|
|
386
|
-
const { haloShape: haloShapeStyle } =
|
|
451
|
+
const { haloShape: haloShapeStyle, keyShape: keyShapeStyle } =
|
|
452
|
+
this.mergedStyles;
|
|
387
453
|
if (haloShapeStyle.visible === false) return;
|
|
388
454
|
const { nodeName, attributes } = keyShape;
|
|
455
|
+
const { x, y, fill } = attributes;
|
|
389
456
|
return this.upsertShape(
|
|
390
457
|
nodeName as SHAPE_TYPE,
|
|
391
458
|
'haloShape',
|
|
392
459
|
{
|
|
393
460
|
...attributes,
|
|
394
|
-
|
|
461
|
+
...keyShapeStyle,
|
|
462
|
+
x,
|
|
463
|
+
y,
|
|
464
|
+
stroke: fill,
|
|
395
465
|
...haloShapeStyle,
|
|
396
466
|
batchKey: 'halo',
|
|
397
467
|
},
|
|
@@ -400,10 +470,16 @@ export abstract class BaseNode {
|
|
|
400
470
|
);
|
|
401
471
|
}
|
|
402
472
|
|
|
473
|
+
/**
|
|
474
|
+
* Draw the anchors of the node
|
|
475
|
+
*/
|
|
403
476
|
public drawAnchorShapes(
|
|
404
|
-
model: NodeDisplayModel,
|
|
405
|
-
shapeMap: NodeShapeMap,
|
|
406
|
-
diffData?: {
|
|
477
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
478
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
479
|
+
diffData?: {
|
|
480
|
+
previous: NodeModelData | ComboModelData;
|
|
481
|
+
current: NodeModelData | ComboModelData;
|
|
482
|
+
},
|
|
407
483
|
diffState?: { previous: State[]; current: State[] },
|
|
408
484
|
): {
|
|
409
485
|
[shapeId: string]: DisplayObject;
|
|
@@ -417,20 +493,18 @@ export abstract class BaseNode {
|
|
|
417
493
|
if (!individualConfigs.length) return;
|
|
418
494
|
this.boundsCache.keyShapeLocal =
|
|
419
495
|
this.boundsCache.keyShapeLocal || shapeMap.keyShape.getLocalBounds();
|
|
420
|
-
const keyShapeBBox = this.boundsCache.keyShapeLocal;
|
|
421
|
-
const keyShapeWidth = keyShapeBBox.max[0] - keyShapeBBox.min[0];
|
|
422
|
-
const keyShapeHeight = keyShapeBBox.max[1] - keyShapeBBox.min[1];
|
|
423
|
-
|
|
424
496
|
const shapes = {};
|
|
497
|
+
const anchorPositionMap = this.calculateAnchorPosition(keyShapeStyle);
|
|
425
498
|
individualConfigs.forEach((config, i) => {
|
|
426
499
|
const { position, fill = keyShapeStyle.fill, ...style } = config;
|
|
500
|
+
const [cx, cy] = this.getAnchorPosition(position, anchorPositionMap);
|
|
427
501
|
const id = `anchorShape${i}`;
|
|
428
502
|
shapes[id] = this.upsertShape(
|
|
429
503
|
'circle',
|
|
430
504
|
id,
|
|
431
505
|
{
|
|
432
|
-
cx
|
|
433
|
-
cy
|
|
506
|
+
cx,
|
|
507
|
+
cy,
|
|
434
508
|
fill,
|
|
435
509
|
...commonStyle,
|
|
436
510
|
...style,
|
|
@@ -442,10 +516,63 @@ export abstract class BaseNode {
|
|
|
442
516
|
return shapes;
|
|
443
517
|
}
|
|
444
518
|
|
|
519
|
+
private getAnchorPosition(
|
|
520
|
+
position: string | [number, number],
|
|
521
|
+
anchorPositionMap: IAnchorPositionMap,
|
|
522
|
+
): [number, number] {
|
|
523
|
+
const keyShapeBBox = this.boundsCache.keyShapeLocal;
|
|
524
|
+
const keyShapeWidth = keyShapeBBox.max[0] - keyShapeBBox.min[0];
|
|
525
|
+
const keyShapeHeight = keyShapeBBox.max[1] - keyShapeBBox.min[1];
|
|
526
|
+
const defaultPosition: [number, number] = [
|
|
527
|
+
keyShapeBBox.max[0],
|
|
528
|
+
keyShapeBBox.min[1],
|
|
529
|
+
]; //topRight
|
|
530
|
+
if (position instanceof Array) {
|
|
531
|
+
return [
|
|
532
|
+
keyShapeWidth * (position[0] - 0.5),
|
|
533
|
+
keyShapeHeight * (position[1] - 0.5),
|
|
534
|
+
];
|
|
535
|
+
} else if (typeof position === 'string') {
|
|
536
|
+
position = position.toLowerCase();
|
|
537
|
+
//receive a unknown string, remind the user.
|
|
538
|
+
return (
|
|
539
|
+
anchorPositionMap[position] ||
|
|
540
|
+
anchorPositionMap['default'] ||
|
|
541
|
+
defaultPosition
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
//receive a position in unknown type (such as a number or undefined).
|
|
545
|
+
return anchorPositionMap['default'] || defaultPosition;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Configure anchor position by keyShapeStyle. return the configuration.
|
|
550
|
+
* e.g CircleNode `return {"right":keyShapeStyle.x+keyShapeStyle.r, keyShapeStyle.y}`
|
|
551
|
+
* @param {*} keyShapeStyle
|
|
552
|
+
* @return {IAnchorPositionMap} anchorpositionMap
|
|
553
|
+
*/
|
|
554
|
+
public calculateAnchorPosition(keyShapeStyle: any): IAnchorPositionMap {
|
|
555
|
+
const x = convertToNumber(keyShapeStyle.x);
|
|
556
|
+
const y = convertToNumber(keyShapeStyle.y);
|
|
557
|
+
const r = convertToNumber(keyShapeStyle.r);
|
|
558
|
+
const anchorPositionMap = {};
|
|
559
|
+
anchorPositionMap['top'] = [x, y - r];
|
|
560
|
+
anchorPositionMap['left'] = [x - r, y];
|
|
561
|
+
anchorPositionMap['right'] = anchorPositionMap['default'] = [x + r, y];
|
|
562
|
+
anchorPositionMap['bottom'] = [x, y + r];
|
|
563
|
+
return anchorPositionMap;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Draw the badges of the node
|
|
568
|
+
*/
|
|
445
569
|
public drawBadgeShapes(
|
|
446
|
-
model: NodeDisplayModel,
|
|
447
|
-
shapeMap: NodeShapeMap,
|
|
448
|
-
diffData?: {
|
|
570
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
571
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
572
|
+
diffData?: {
|
|
573
|
+
previous: NodeModelData | ComboModelData;
|
|
574
|
+
current: NodeModelData | ComboModelData;
|
|
575
|
+
},
|
|
449
576
|
diffState?: { previous: State[]; current: State[] },
|
|
450
577
|
): {
|
|
451
578
|
[shapeId: string]: DisplayObject;
|
|
@@ -594,10 +721,16 @@ export abstract class BaseNode {
|
|
|
594
721
|
return shapes;
|
|
595
722
|
}
|
|
596
723
|
|
|
724
|
+
/**
|
|
725
|
+
* Draw other shapes(such as preRect,stateIcon) of the node
|
|
726
|
+
*/
|
|
597
727
|
public drawOtherShapes(
|
|
598
|
-
model: NodeDisplayModel,
|
|
599
|
-
shapeMap: NodeShapeMap,
|
|
600
|
-
diffData?: {
|
|
728
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
729
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
730
|
+
diffData?: {
|
|
731
|
+
previous: NodeModelData | ComboModelData;
|
|
732
|
+
current: NodeModelData | ComboModelData;
|
|
733
|
+
},
|
|
601
734
|
diffState?: { previous: State[]; current: State[] },
|
|
602
735
|
): { [id: string]: DisplayObject } {
|
|
603
736
|
return {};
|
|
@@ -610,7 +743,7 @@ export abstract class BaseNode {
|
|
|
610
743
|
* @param shapeMap
|
|
611
744
|
* @param zoom
|
|
612
745
|
*/
|
|
613
|
-
public onZoom = (shapeMap: NodeShapeMap, zoom: number) => {
|
|
746
|
+
public onZoom = (shapeMap: NodeShapeMap | ComboShapeMap, zoom: number) => {
|
|
614
747
|
// zoomLevel changed
|
|
615
748
|
if (this.lodStrategy) {
|
|
616
749
|
const { levels } = this.lodStrategy;
|
|
@@ -671,16 +804,19 @@ export abstract class BaseNode {
|
|
|
671
804
|
* @param zoom
|
|
672
805
|
* @returns
|
|
673
806
|
*/
|
|
674
|
-
private balanceShapeSize(
|
|
807
|
+
private balanceShapeSize(
|
|
808
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
809
|
+
zoom: number,
|
|
810
|
+
) {
|
|
675
811
|
// balance the size for label, badges
|
|
676
|
-
const { labelShape, labelBackgroundShape } = shapeMap;
|
|
812
|
+
const { keyShape, labelShape, labelBackgroundShape } = shapeMap;
|
|
677
813
|
const balanceRatio = 1 / zoom || 1;
|
|
678
814
|
this.zoomCache.balanceRatio = balanceRatio;
|
|
815
|
+
if (!labelShape || !labelShape.isVisible()) return;
|
|
679
816
|
const { labelShape: labelStyle } = this.mergedStyles;
|
|
680
817
|
const { position = 'bottom' } = labelStyle;
|
|
681
|
-
if (!labelShape || !labelShape.isVisible()) return;
|
|
682
818
|
|
|
683
|
-
const keyShapeLocal =
|
|
819
|
+
const keyShapeLocal = keyShape.getLocalBounds();
|
|
684
820
|
if (zoom < 1) {
|
|
685
821
|
// if it is zoom-out, do not scale the gap between keyShape and labelShape, differentiate from zoom-in by adjusting transformOrigin
|
|
686
822
|
if (position === 'bottom') labelShape.style.transformOrigin = '0';
|
|
@@ -713,7 +849,13 @@ export abstract class BaseNode {
|
|
|
713
849
|
break;
|
|
714
850
|
}
|
|
715
851
|
}
|
|
716
|
-
labelShape.style.transform
|
|
852
|
+
const oriTransform = (labelShape.style.transform || '').replace(
|
|
853
|
+
this.scaleTransformCache,
|
|
854
|
+
'',
|
|
855
|
+
);
|
|
856
|
+
const scaleTransform = `scale(${balanceRatio}, ${balanceRatio})`;
|
|
857
|
+
labelShape.style.transform = `${oriTransform} ${scaleTransform}`;
|
|
858
|
+
this.scaleTransformCache = scaleTransform;
|
|
717
859
|
const wordWrapWidth = this.zoomCache.wordWrapWidth * zoom;
|
|
718
860
|
labelShape.style.wordWrapWidth = wordWrapWidth;
|
|
719
861
|
|
|
@@ -769,8 +911,8 @@ export abstract class BaseNode {
|
|
|
769
911
|
type: SHAPE_TYPE | SHAPE_TYPE_3D,
|
|
770
912
|
id: string,
|
|
771
913
|
style: ShapeStyle,
|
|
772
|
-
shapeMap: NodeShapeMap,
|
|
773
|
-
model: NodeDisplayModel,
|
|
914
|
+
shapeMap: NodeShapeMap | ComboShapeMap,
|
|
915
|
+
model: NodeDisplayModel | ComboDisplayModel,
|
|
774
916
|
): DisplayObject {
|
|
775
917
|
return upsertShape(
|
|
776
918
|
type as SHAPE_TYPE,
|
|
@@ -102,8 +102,10 @@ 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
|
|
|
@@ -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
|
+
}
|