@antv/g6 4.8.14 → 5.0.0-alpha.2
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 +19 -3
- package/esm/constant/index.d.ts +1 -0
- package/esm/constant/index.js +2 -0
- package/esm/constant/index.js.map +1 -0
- package/esm/constant/shape.d.ts +27 -0
- package/esm/constant/shape.js +26 -0
- package/esm/constant/shape.js.map +1 -0
- package/esm/index.d.ts +124 -0
- package/esm/index.js +11 -0
- package/esm/index.js.map +1 -0
- package/esm/item/combo.d.ts +4 -0
- package/esm/item/combo.js +4 -0
- package/esm/item/combo.js.map +1 -0
- package/esm/item/edge.d.ts +54 -0
- package/esm/item/edge.js +113 -0
- package/esm/item/edge.js.map +1 -0
- package/esm/item/item.d.ts +189 -0
- package/esm/item/item.js +636 -0
- package/esm/item/item.js.map +1 -0
- package/esm/item/node.d.ts +54 -0
- package/esm/item/node.js +170 -0
- package/esm/item/node.js.map +1 -0
- package/esm/runtime/controller/data.d.ts +65 -0
- package/esm/runtime/controller/data.js +489 -0
- package/esm/runtime/controller/data.js.map +1 -0
- package/esm/runtime/controller/extension.d.ts +9 -0
- package/esm/runtime/controller/extension.js +11 -0
- package/esm/runtime/controller/extension.js.map +1 -0
- package/esm/runtime/controller/index.d.ts +7 -0
- package/esm/runtime/controller/index.js +8 -0
- package/esm/runtime/controller/index.js.map +1 -0
- package/esm/runtime/controller/interaction.d.ts +51 -0
- package/esm/runtime/controller/interaction.js +259 -0
- package/esm/runtime/controller/interaction.js.map +1 -0
- package/esm/runtime/controller/item.d.ts +101 -0
- package/esm/runtime/controller/item.js +537 -0
- package/esm/runtime/controller/item.js.map +1 -0
- package/esm/runtime/controller/layout.d.ts +30 -0
- package/esm/runtime/controller/layout.js +204 -0
- package/esm/runtime/controller/layout.js.map +1 -0
- package/esm/runtime/controller/plugin.d.ts +34 -0
- package/esm/runtime/controller/plugin.js +140 -0
- package/esm/runtime/controller/plugin.js.map +1 -0
- package/esm/runtime/controller/theme.d.ts +29 -0
- package/esm/runtime/controller/theme.js +54 -0
- package/esm/runtime/controller/theme.js.map +1 -0
- package/esm/runtime/controller/viewport.d.ts +11 -0
- package/esm/runtime/controller/viewport.js +102 -0
- package/esm/runtime/controller/viewport.js.map +1 -0
- package/esm/runtime/graph.d.ts +462 -0
- package/esm/runtime/graph.js +1077 -0
- package/esm/runtime/graph.js.map +1 -0
- package/esm/runtime/hooks.d.ts +33 -0
- package/esm/runtime/hooks.js +74 -0
- package/esm/runtime/hooks.js.map +1 -0
- package/esm/stdlib/behavior/activate-relations.d.ts +62 -0
- package/esm/stdlib/behavior/activate-relations.js +81 -0
- package/esm/stdlib/behavior/activate-relations.js.map +1 -0
- package/esm/stdlib/behavior/brush-select.d.ts +110 -0
- package/esm/stdlib/behavior/brush-select.js +268 -0
- package/esm/stdlib/behavior/brush-select.js.map +1 -0
- package/esm/stdlib/behavior/click-select.d.ts +71 -0
- package/esm/stdlib/behavior/click-select.js +143 -0
- package/esm/stdlib/behavior/click-select.js.map +1 -0
- package/esm/stdlib/behavior/drag-canvas.d.ts +82 -0
- package/esm/stdlib/behavior/drag-canvas.js +246 -0
- package/esm/stdlib/behavior/drag-canvas.js.map +1 -0
- package/esm/stdlib/behavior/drag-node.d.ts +80 -0
- package/esm/stdlib/behavior/drag-node.js +250 -0
- package/esm/stdlib/behavior/drag-node.js.map +1 -0
- package/esm/stdlib/behavior/hover-activate.d.ts +41 -0
- package/esm/stdlib/behavior/hover-activate.js +63 -0
- package/esm/stdlib/behavior/hover-activate.js.map +1 -0
- package/esm/stdlib/behavior/lasso-select.d.ts +27 -0
- package/esm/stdlib/behavior/lasso-select.js +79 -0
- package/esm/stdlib/behavior/lasso-select.js.map +1 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.js +62 -0
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.js +123 -0
- package/esm/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +37 -0
- package/esm/stdlib/behavior/track-canvas-3d.js +62 -0
- package/esm/stdlib/behavior/track-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js +74 -0
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
- package/esm/stdlib/behavior/zoom-canvas.d.ts +61 -0
- package/esm/stdlib/behavior/zoom-canvas.js +160 -0
- package/esm/stdlib/behavior/zoom-canvas.js.map +1 -0
- package/esm/stdlib/data/comboFromNode.d.ts +9 -0
- package/esm/stdlib/data/comboFromNode.js +28 -0
- package/esm/stdlib/data/comboFromNode.js.map +1 -0
- package/esm/stdlib/index.d.ts +80 -0
- package/esm/stdlib/index.js +82 -0
- package/esm/stdlib/index.js.map +1 -0
- package/esm/stdlib/item/edge/base.d.ts +111 -0
- package/esm/stdlib/item/edge/base.js +341 -0
- package/esm/stdlib/item/edge/base.js.map +1 -0
- package/esm/stdlib/item/edge/index.d.ts +1 -0
- package/esm/stdlib/item/edge/index.js +2 -0
- package/esm/stdlib/item/edge/index.js.map +1 -0
- package/esm/stdlib/item/edge/line.d.ts +33 -0
- package/esm/stdlib/item/edge/line.js +45 -0
- package/esm/stdlib/item/edge/line.js.map +1 -0
- package/esm/stdlib/item/node/base.d.ts +137 -0
- package/esm/stdlib/item/node/base.js +414 -0
- package/esm/stdlib/item/node/base.js.map +1 -0
- package/esm/stdlib/item/node/base3d.d.ts +72 -0
- package/esm/stdlib/item/node/base3d.js +113 -0
- package/esm/stdlib/item/node/base3d.js.map +1 -0
- package/esm/stdlib/item/node/circle.d.ts +30 -0
- package/esm/stdlib/item/node/circle.js +56 -0
- package/esm/stdlib/item/node/circle.js.map +1 -0
- package/esm/stdlib/item/node/index.d.ts +2 -0
- package/esm/stdlib/item/node/index.js +3 -0
- package/esm/stdlib/item/node/index.js.map +1 -0
- package/esm/stdlib/item/node/sphere.d.ts +33 -0
- package/esm/stdlib/item/node/sphere.js +52 -0
- package/esm/stdlib/item/node/sphere.js.map +1 -0
- package/esm/stdlib/plugin/legend/index.d.ts +121 -0
- package/esm/stdlib/plugin/legend/index.js +587 -0
- package/esm/stdlib/plugin/legend/index.js.map +1 -0
- package/esm/stdlib/plugin/minimap/index.d.ts +106 -0
- package/esm/stdlib/plugin/minimap/index.js +578 -0
- package/esm/stdlib/plugin/minimap/index.js.map +1 -0
- package/esm/stdlib/selector/lasso.d.ts +15 -0
- package/esm/stdlib/selector/lasso.js +61 -0
- package/esm/stdlib/selector/lasso.js.map +1 -0
- package/esm/stdlib/selector/rect.d.ts +16 -0
- package/esm/stdlib/selector/rect.js +54 -0
- package/esm/stdlib/selector/rect.js.map +1 -0
- package/esm/stdlib/theme/dark.d.ts +3 -0
- package/esm/stdlib/theme/dark.js +279 -0
- package/esm/stdlib/theme/dark.js.map +1 -0
- package/esm/stdlib/theme/light.d.ts +3 -0
- package/esm/stdlib/theme/light.js +274 -0
- package/esm/stdlib/theme/light.js.map +1 -0
- package/esm/stdlib/themeSolver/base.d.ts +15 -0
- package/esm/stdlib/themeSolver/base.js +11 -0
- package/esm/stdlib/themeSolver/base.js.map +1 -0
- package/esm/stdlib/themeSolver/spec.d.ts +37 -0
- package/esm/stdlib/themeSolver/spec.js +66 -0
- package/esm/stdlib/themeSolver/spec.js.map +1 -0
- package/esm/stdlib/themeSolver/subject.d.ts +43 -0
- package/esm/stdlib/themeSolver/subject.js +396 -0
- package/esm/stdlib/themeSolver/subject.js.map +1 -0
- package/esm/types/animate.d.ts +59 -0
- package/esm/types/animate.js +2 -0
- package/esm/types/animate.js.map +1 -0
- package/esm/types/behavior.d.ts +45 -0
- package/esm/types/behavior.js +14 -0
- package/esm/types/behavior.js.map +1 -0
- package/esm/types/combo.d.ts +87 -0
- package/esm/types/combo.js +2 -0
- package/esm/types/combo.js.map +1 -0
- package/esm/types/common.d.ts +6 -0
- package/esm/types/common.js +2 -0
- package/esm/types/common.js.map +1 -0
- package/esm/types/data.d.ts +21 -0
- package/esm/types/data.js +2 -0
- package/esm/types/data.js.map +1 -0
- package/esm/types/edge.d.ts +100 -0
- package/esm/types/edge.js +2 -0
- package/esm/types/edge.js.map +1 -0
- package/esm/types/event.d.ts +30 -0
- package/esm/types/event.js +31 -0
- package/esm/types/event.js.map +1 -0
- package/esm/types/graph.d.ts +445 -0
- package/esm/types/graph.js +2 -0
- package/esm/types/graph.js.map +1 -0
- package/esm/types/hook.d.ts +97 -0
- package/esm/types/hook.js +2 -0
- package/esm/types/hook.js.map +1 -0
- package/esm/types/index.d.ts +10 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/item.d.ts +229 -0
- package/esm/types/item.js +16 -0
- package/esm/types/item.js.map +1 -0
- package/esm/types/layout.d.ts +69 -0
- package/esm/types/layout.js +20 -0
- package/esm/types/layout.js.map +1 -0
- package/esm/types/node.d.ts +134 -0
- package/esm/types/node.js +2 -0
- package/esm/types/node.js.map +1 -0
- package/esm/types/plugin.d.ts +40 -0
- package/esm/types/plugin.js +53 -0
- package/esm/types/plugin.js.map +1 -0
- package/esm/types/render.d.ts +1 -0
- package/esm/types/render.js +2 -0
- package/esm/types/render.js.map +1 -0
- package/esm/types/spec.d.ts +65 -0
- package/esm/types/spec.js +2 -0
- package/esm/types/spec.js.map +1 -0
- package/esm/types/stdlib.d.ts +13 -0
- package/esm/types/stdlib.js +2 -0
- package/esm/types/stdlib.js.map +1 -0
- package/esm/types/theme.d.ts +102 -0
- package/esm/types/theme.js +15 -0
- package/esm/types/theme.js.map +1 -0
- package/esm/types/view.d.ts +23 -0
- package/esm/types/view.js +2 -0
- package/esm/types/view.js.map +1 -0
- package/esm/util/animate.d.ts +101 -0
- package/esm/util/animate.js +350 -0
- package/esm/util/animate.js.map +1 -0
- package/esm/util/array.d.ts +20 -0
- package/esm/util/array.js +60 -0
- package/esm/util/array.js.map +1 -0
- package/esm/util/canvas.d.ts +20 -0
- package/esm/util/canvas.js +81 -0
- package/esm/util/canvas.js.map +1 -0
- package/esm/util/event.d.ts +12 -0
- package/esm/util/event.js +26 -0
- package/esm/util/event.js.map +1 -0
- package/esm/util/extend.d.ts +21 -0
- package/esm/util/extend.js +22 -0
- package/esm/util/extend.js.map +1 -0
- package/esm/util/extension.d.ts +10 -0
- package/esm/util/extension.js +24 -0
- package/esm/util/extension.js.map +1 -0
- package/esm/util/index.d.ts +14 -0
- package/esm/util/index.js +5 -0
- package/esm/util/index.js.map +1 -0
- package/esm/util/item.d.ts +14 -0
- package/esm/util/item.js +42 -0
- package/esm/util/item.js.map +1 -0
- package/esm/util/mapper.d.ts +17 -0
- package/esm/util/mapper.js +60 -0
- package/esm/util/mapper.js.map +1 -0
- package/esm/util/math.d.ts +8 -0
- package/esm/util/math.js +9 -0
- package/esm/util/math.js.map +1 -0
- package/esm/util/point.d.ts +61 -0
- package/esm/util/point.js +160 -0
- package/esm/util/point.js.map +1 -0
- package/esm/util/shape.d.ts +105 -0
- package/esm/util/shape.js +504 -0
- package/esm/util/shape.js.map +1 -0
- package/esm/util/shape3d.d.ts +23 -0
- package/esm/util/shape3d.js +147 -0
- package/esm/util/shape3d.js.map +1 -0
- package/esm/util/text.d.ts +18 -0
- package/esm/util/text.js +36 -0
- package/esm/util/text.js.map +1 -0
- package/esm/util/type.d.ts +2 -0
- package/esm/util/type.js +2 -0
- package/esm/util/type.js.map +1 -0
- package/esm/util/zoom.d.ts +17 -0
- package/esm/util/zoom.js +36 -0
- package/esm/util/zoom.js.map +1 -0
- package/lib/constant/index.d.ts +1 -0
- package/lib/constant/index.js +18 -0
- package/lib/constant/index.js.map +1 -0
- package/lib/constant/shape.d.ts +27 -0
- package/lib/constant/shape.js +29 -0
- package/lib/constant/shape.js.map +1 -0
- package/lib/index.d.ts +124 -4
- package/lib/index.js +30 -27
- package/lib/index.js.map +1 -0
- package/lib/item/combo.d.ts +4 -0
- package/lib/item/combo.js +10 -0
- package/lib/item/combo.js.map +1 -0
- package/lib/item/edge.d.ts +54 -0
- package/lib/item/edge.js +119 -0
- package/lib/item/edge.js.map +1 -0
- package/lib/item/item.d.ts +189 -0
- package/lib/item/item.js +639 -0
- package/lib/item/item.js.map +1 -0
- package/lib/item/node.d.ts +54 -0
- package/lib/item/node.js +176 -0
- package/lib/item/node.js.map +1 -0
- package/lib/runtime/controller/data.d.ts +65 -0
- package/lib/runtime/controller/data.js +493 -0
- package/lib/runtime/controller/data.js.map +1 -0
- package/lib/runtime/controller/extension.d.ts +9 -0
- package/lib/runtime/controller/extension.js +15 -0
- package/lib/runtime/controller/extension.js.map +1 -0
- package/lib/runtime/controller/index.d.ts +7 -0
- package/lib/runtime/controller/index.js +24 -0
- package/lib/runtime/controller/index.js.map +1 -0
- package/lib/runtime/controller/interaction.d.ts +51 -0
- package/lib/runtime/controller/interaction.js +263 -0
- package/lib/runtime/controller/interaction.js.map +1 -0
- package/lib/runtime/controller/item.d.ts +101 -0
- package/lib/runtime/controller/item.js +544 -0
- package/lib/runtime/controller/item.js.map +1 -0
- package/lib/runtime/controller/layout.d.ts +30 -0
- package/lib/runtime/controller/layout.js +208 -0
- package/lib/runtime/controller/layout.js.map +1 -0
- package/lib/runtime/controller/plugin.d.ts +34 -0
- package/lib/runtime/controller/plugin.js +147 -0
- package/lib/runtime/controller/plugin.js.map +1 -0
- package/lib/runtime/controller/theme.d.ts +29 -0
- package/lib/runtime/controller/theme.js +61 -0
- package/lib/runtime/controller/theme.js.map +1 -0
- package/lib/runtime/controller/viewport.d.ts +11 -0
- package/lib/runtime/controller/viewport.js +106 -0
- package/lib/runtime/controller/viewport.js.map +1 -0
- package/lib/runtime/graph.d.ts +462 -0
- package/lib/runtime/graph.js +1083 -0
- package/lib/runtime/graph.js.map +1 -0
- package/lib/runtime/hooks.d.ts +33 -0
- package/lib/runtime/hooks.js +77 -0
- package/lib/runtime/hooks.js.map +1 -0
- package/lib/stdlib/behavior/activate-relations.d.ts +62 -0
- package/lib/stdlib/behavior/activate-relations.js +84 -0
- package/lib/stdlib/behavior/activate-relations.js.map +1 -0
- package/lib/stdlib/behavior/brush-select.d.ts +110 -0
- package/lib/stdlib/behavior/brush-select.js +271 -0
- package/lib/stdlib/behavior/brush-select.js.map +1 -0
- package/lib/stdlib/behavior/click-select.d.ts +71 -0
- package/lib/stdlib/behavior/click-select.js +146 -0
- package/lib/stdlib/behavior/click-select.js.map +1 -0
- package/lib/stdlib/behavior/drag-canvas.d.ts +82 -0
- package/lib/stdlib/behavior/drag-canvas.js +249 -0
- package/lib/stdlib/behavior/drag-canvas.js.map +1 -0
- package/lib/stdlib/behavior/drag-node.d.ts +80 -0
- package/lib/stdlib/behavior/drag-node.js +253 -0
- package/lib/stdlib/behavior/drag-node.js.map +1 -0
- package/lib/stdlib/behavior/hover-activate.d.ts +41 -0
- package/lib/stdlib/behavior/hover-activate.js +67 -0
- package/lib/stdlib/behavior/hover-activate.js.map +1 -0
- package/lib/stdlib/behavior/lasso-select.d.ts +27 -0
- package/lib/stdlib/behavior/lasso-select.js +85 -0
- package/lib/stdlib/behavior/lasso-select.js.map +1 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +37 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.js +68 -0
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +61 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.js +126 -0
- package/lib/stdlib/behavior/rotate-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +37 -0
- package/lib/stdlib/behavior/track-canvas-3d.js +68 -0
- package/lib/stdlib/behavior/track-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +51 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js +77 -0
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +1 -0
- package/lib/stdlib/behavior/zoom-canvas.d.ts +61 -0
- package/lib/stdlib/behavior/zoom-canvas.js +163 -0
- package/lib/stdlib/behavior/zoom-canvas.js.map +1 -0
- package/lib/stdlib/data/comboFromNode.d.ts +9 -0
- package/lib/stdlib/data/comboFromNode.js +32 -0
- package/lib/stdlib/data/comboFromNode.js.map +1 -0
- package/lib/stdlib/index.d.ts +80 -0
- package/lib/stdlib/index.js +90 -0
- package/lib/stdlib/index.js.map +1 -0
- package/lib/stdlib/item/edge/base.d.ts +111 -0
- package/lib/stdlib/item/edge/base.js +345 -0
- package/lib/stdlib/item/edge/base.js.map +1 -0
- package/lib/stdlib/item/edge/index.d.ts +1 -0
- package/lib/stdlib/item/edge/index.js +18 -0
- package/lib/stdlib/item/edge/index.js.map +1 -0
- package/lib/stdlib/item/edge/line.d.ts +33 -0
- package/lib/stdlib/item/edge/line.js +49 -0
- package/lib/stdlib/item/edge/line.js.map +1 -0
- package/lib/stdlib/item/node/base.d.ts +137 -0
- package/lib/stdlib/item/node/base.js +418 -0
- package/lib/stdlib/item/node/base.js.map +1 -0
- package/lib/stdlib/item/node/base3d.d.ts +72 -0
- package/lib/stdlib/item/node/base3d.js +117 -0
- package/lib/stdlib/item/node/base3d.js.map +1 -0
- package/lib/stdlib/item/node/circle.d.ts +30 -0
- package/lib/stdlib/item/node/circle.js +60 -0
- package/lib/stdlib/item/node/circle.js.map +1 -0
- package/lib/stdlib/item/node/index.d.ts +2 -0
- package/lib/stdlib/item/node/index.js +19 -0
- package/lib/stdlib/item/node/index.js.map +1 -0
- package/lib/stdlib/item/node/sphere.d.ts +33 -0
- package/lib/stdlib/item/node/sphere.js +56 -0
- package/lib/stdlib/item/node/sphere.js.map +1 -0
- package/lib/stdlib/plugin/legend/index.d.ts +121 -0
- package/lib/stdlib/plugin/legend/index.js +590 -0
- package/lib/stdlib/plugin/legend/index.js.map +1 -0
- package/lib/stdlib/plugin/minimap/index.d.ts +106 -0
- package/lib/stdlib/plugin/minimap/index.js +581 -0
- package/lib/stdlib/plugin/minimap/index.js.map +1 -0
- package/lib/stdlib/selector/lasso.d.ts +15 -0
- package/lib/stdlib/selector/lasso.js +63 -0
- package/lib/stdlib/selector/lasso.js.map +1 -0
- package/lib/stdlib/selector/rect.d.ts +16 -0
- package/lib/stdlib/selector/rect.js +56 -0
- package/lib/stdlib/selector/rect.js.map +1 -0
- package/lib/stdlib/theme/dark.d.ts +3 -0
- package/lib/stdlib/theme/dark.js +281 -0
- package/lib/stdlib/theme/dark.js.map +1 -0
- package/lib/stdlib/theme/light.d.ts +3 -0
- package/lib/stdlib/theme/light.js +276 -0
- package/lib/stdlib/theme/light.js.map +1 -0
- package/lib/stdlib/themeSolver/base.d.ts +15 -0
- package/lib/stdlib/themeSolver/base.js +14 -0
- package/lib/stdlib/themeSolver/base.js.map +1 -0
- package/lib/stdlib/themeSolver/spec.d.ts +37 -0
- package/lib/stdlib/themeSolver/spec.js +72 -0
- package/lib/stdlib/themeSolver/spec.js.map +1 -0
- package/lib/stdlib/themeSolver/subject.d.ts +43 -0
- package/lib/stdlib/themeSolver/subject.js +404 -0
- package/lib/stdlib/themeSolver/subject.js.map +1 -0
- package/lib/types/animate.d.ts +59 -0
- package/lib/types/animate.js +3 -0
- package/lib/types/animate.js.map +1 -0
- package/lib/types/behavior.d.ts +45 -0
- package/lib/types/behavior.js +18 -0
- package/lib/types/behavior.js.map +1 -0
- package/lib/types/combo.d.ts +87 -0
- package/lib/types/combo.js +3 -0
- package/lib/types/combo.js.map +1 -0
- package/lib/types/common.d.ts +6 -0
- package/lib/types/common.js +3 -0
- package/lib/types/common.js.map +1 -0
- package/lib/types/data.d.ts +21 -0
- package/lib/types/data.js +3 -0
- package/lib/types/data.js.map +1 -0
- package/lib/types/edge.d.ts +100 -0
- package/lib/types/edge.js +3 -0
- package/lib/types/edge.js.map +1 -0
- package/lib/types/event.d.ts +30 -0
- package/lib/types/event.js +34 -0
- package/lib/types/event.js.map +1 -0
- package/lib/types/graph.d.ts +445 -0
- package/lib/types/graph.js +3 -0
- package/lib/types/graph.js.map +1 -0
- package/lib/types/hook.d.ts +97 -0
- package/lib/types/hook.js +3 -0
- package/lib/types/hook.js.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.js +7 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/item.d.ts +229 -0
- package/lib/types/item.js +19 -0
- package/lib/types/item.js.map +1 -0
- package/lib/types/layout.d.ts +69 -0
- package/lib/types/layout.js +25 -0
- package/lib/types/layout.js.map +1 -0
- package/lib/types/node.d.ts +134 -0
- package/lib/types/node.js +3 -0
- package/lib/types/node.js.map +1 -0
- package/lib/types/plugin.d.ts +40 -0
- package/lib/types/plugin.js +57 -0
- package/lib/types/plugin.js.map +1 -0
- package/lib/types/render.d.ts +1 -0
- package/lib/types/render.js +3 -0
- package/lib/types/render.js.map +1 -0
- package/lib/types/spec.d.ts +65 -0
- package/lib/types/spec.js +3 -0
- package/lib/types/spec.js.map +1 -0
- package/lib/types/stdlib.d.ts +13 -0
- package/lib/types/stdlib.js +3 -0
- package/lib/types/stdlib.js.map +1 -0
- package/lib/types/theme.d.ts +102 -0
- package/lib/types/theme.js +19 -0
- package/lib/types/theme.js.map +1 -0
- package/lib/types/view.d.ts +23 -0
- package/lib/types/view.js +3 -0
- package/lib/types/view.js.map +1 -0
- package/lib/util/animate.d.ts +101 -0
- package/lib/util/animate.js +358 -0
- package/lib/util/animate.js.map +1 -0
- package/lib/util/array.d.ts +20 -0
- package/lib/util/array.js +68 -0
- package/lib/util/array.js.map +1 -0
- package/lib/util/canvas.d.ts +20 -0
- package/lib/util/canvas.js +86 -0
- package/lib/util/canvas.js.map +1 -0
- package/lib/util/event.d.ts +12 -0
- package/lib/util/event.js +30 -0
- package/lib/util/event.js.map +1 -0
- package/lib/util/extend.d.ts +21 -0
- package/lib/util/extend.js +29 -0
- package/lib/util/extend.js.map +1 -0
- package/lib/util/extension.d.ts +10 -0
- package/lib/util/extension.js +29 -0
- package/lib/util/extension.js.map +1 -0
- package/lib/util/index.d.ts +14 -0
- package/lib/util/index.js +7 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/item.d.ts +14 -0
- package/lib/util/item.js +47 -0
- package/lib/util/item.js.map +1 -0
- package/lib/util/mapper.d.ts +17 -0
- package/lib/util/mapper.js +63 -0
- package/lib/util/mapper.js.map +1 -0
- package/lib/util/math.d.ts +8 -0
- package/lib/util/math.js +13 -0
- package/lib/util/math.js.map +1 -0
- package/lib/util/point.d.ts +61 -0
- package/lib/util/point.js +169 -0
- package/lib/util/point.js.map +1 -0
- package/lib/util/shape.d.ts +105 -0
- package/lib/util/shape.js +519 -0
- package/lib/util/shape.js.map +1 -0
- package/lib/util/shape3d.d.ts +23 -0
- package/lib/util/shape3d.js +153 -0
- package/lib/util/shape3d.js.map +1 -0
- package/lib/util/text.d.ts +18 -0
- package/lib/util/text.js +41 -0
- package/lib/util/text.js.map +1 -0
- package/lib/util/type.d.ts +2 -0
- package/lib/util/type.js +6 -0
- package/lib/util/type.js.map +1 -0
- package/lib/util/zoom.d.ts +17 -0
- package/lib/util/zoom.js +41 -0
- package/lib/util/zoom.js.map +1 -0
- package/package.json +82 -50
- package/src/constant/index.ts +1 -0
- package/src/constant/shape.ts +33 -0
- package/src/index.ts +13 -0
- package/src/item/combo.ts +5 -0
- package/src/item/edge.ts +177 -0
- package/src/item/item.ts +812 -0
- package/src/item/node.ts +275 -0
- package/src/runtime/controller/data.ts +575 -0
- package/src/runtime/controller/extension.ts +14 -0
- package/src/runtime/controller/index.ts +7 -0
- package/src/runtime/controller/interaction.ts +343 -0
- package/src/runtime/controller/item.ts +780 -0
- package/src/runtime/controller/layout.ts +251 -0
- package/src/runtime/controller/plugin.ts +171 -0
- package/src/runtime/controller/theme.ts +69 -0
- package/src/runtime/controller/viewport.ts +131 -0
- package/src/runtime/graph.ts +1439 -0
- package/src/runtime/hooks.ts +64 -0
- package/src/stdlib/behavior/activate-relations.ts +139 -0
- package/src/stdlib/behavior/brush-select.ts +386 -0
- package/src/stdlib/behavior/click-select.ts +201 -0
- package/src/stdlib/behavior/drag-canvas.ts +333 -0
- package/src/stdlib/behavior/drag-node.ts +402 -0
- package/src/stdlib/behavior/hover-activate.ts +106 -0
- package/src/stdlib/behavior/lasso-select.ts +94 -0
- package/src/stdlib/behavior/orbit-canvas-3d.ts +104 -0
- package/src/stdlib/behavior/rotate-canvas-3d.ts +172 -0
- package/src/stdlib/behavior/track-canvas-3d.ts +104 -0
- package/src/stdlib/behavior/zoom-canvas-3d.ts +127 -0
- package/src/stdlib/behavior/zoom-canvas.ts +244 -0
- package/src/stdlib/data/comboFromNode.ts +28 -0
- package/src/stdlib/index.ts +87 -0
- package/src/stdlib/item/edge/base.ts +571 -0
- package/src/stdlib/item/edge/index.ts +1 -0
- package/src/stdlib/item/edge/line.ts +98 -0
- package/src/stdlib/item/node/base.ts +726 -0
- package/src/stdlib/item/node/base3d.ts +192 -0
- package/src/stdlib/item/node/circle.ts +113 -0
- package/src/stdlib/item/node/index.ts +2 -0
- package/src/stdlib/item/node/sphere.ts +99 -0
- package/src/stdlib/plugin/legend/index.ts +733 -0
- package/src/stdlib/plugin/minimap/index.ts +689 -0
- package/src/stdlib/selector/lasso.ts +75 -0
- package/src/stdlib/selector/rect.ts +78 -0
- package/src/stdlib/theme/dark.ts +340 -0
- package/src/stdlib/theme/light.ts +333 -0
- package/src/stdlib/themeSolver/base.ts +22 -0
- package/src/stdlib/themeSolver/spec.ts +110 -0
- package/src/stdlib/themeSolver/subject.ts +502 -0
- package/src/types/animate.ts +71 -0
- package/src/types/behavior.ts +49 -0
- package/src/types/combo.ts +120 -0
- package/src/types/common.ts +7 -0
- package/src/types/data.ts +35 -0
- package/src/types/edge.ts +119 -0
- package/src/types/event.ts +47 -0
- package/src/types/graph.ts +573 -0
- package/src/types/hook.ts +98 -0
- package/src/types/index.ts +29 -0
- package/src/types/item.ts +324 -0
- package/src/types/layout.ts +138 -0
- package/src/types/node.ts +162 -0
- package/src/types/plugin.ts +77 -0
- package/src/types/render.ts +1 -0
- package/src/types/spec.ts +116 -0
- package/src/types/stdlib.ts +25 -0
- package/src/types/theme.ts +101 -0
- package/src/types/view.ts +31 -0
- package/src/util/animate.ts +430 -0
- package/src/util/array.ts +57 -0
- package/src/util/canvas.ts +95 -0
- package/src/util/event.ts +34 -0
- package/src/util/extend.ts +42 -0
- package/src/util/extension.ts +29 -0
- package/src/util/index.ts +4 -0
- package/src/util/item.ts +70 -0
- package/src/util/mapper.ts +61 -0
- package/src/util/math.ts +9 -0
- package/src/util/point.ts +195 -0
- package/src/util/shape.ts +609 -0
- package/src/util/shape3d.ts +198 -0
- package/src/util/text.ts +49 -0
- package/src/util/type.ts +4 -0
- package/src/util/zoom.ts +39 -0
- package/README.en-US.md +0 -170
- package/README.md +0 -177
- package/dist/g6.min.js.map +0 -1
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -5
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import EventEmitter from '@antv/event-emitter';
|
|
2
|
+
import { AABB, Canvas, DisplayObject, PointLike } from '@antv/g';
|
|
3
|
+
import { ID } from '@antv/graphlib';
|
|
4
|
+
import { ComboUserModel, EdgeUserModel, GraphData, IGraph, NodeUserModel, Specification } from '../types';
|
|
5
|
+
import { CameraAnimationOptions } from '../types/animate';
|
|
6
|
+
import { BehaviorOptionsOf, BehaviorRegistry } from '../types/behavior';
|
|
7
|
+
import { ComboModel } from '../types/combo';
|
|
8
|
+
import { Padding, Point } from '../types/common';
|
|
9
|
+
import { EdgeModel } from '../types/edge';
|
|
10
|
+
import { Hooks } from '../types/hook';
|
|
11
|
+
import { ITEM_TYPE, ShapeStyle, SHAPE_TYPE } from '../types/item';
|
|
12
|
+
import { LayoutOptions } from '../types/layout';
|
|
13
|
+
import { NodeModel } from '../types/node';
|
|
14
|
+
import { RendererName } from '../types/render';
|
|
15
|
+
import { ThemeOptionsOf, ThemeRegistry } from '../types/theme';
|
|
16
|
+
import { FitViewRules, GraphTransformOptions } from '../types/view';
|
|
17
|
+
export default class Graph<B extends BehaviorRegistry, T extends ThemeRegistry> extends EventEmitter implements IGraph<B, T> {
|
|
18
|
+
hooks: Hooks;
|
|
19
|
+
canvas: Canvas;
|
|
20
|
+
container: HTMLElement;
|
|
21
|
+
destroyed: boolean;
|
|
22
|
+
rendererType: RendererName;
|
|
23
|
+
transientCanvas: Canvas;
|
|
24
|
+
backgroundCanvas: Canvas;
|
|
25
|
+
private canvasReady;
|
|
26
|
+
private specification;
|
|
27
|
+
private dataController;
|
|
28
|
+
private interactionController;
|
|
29
|
+
private layoutController;
|
|
30
|
+
private viewportController;
|
|
31
|
+
private itemController;
|
|
32
|
+
private extensionController;
|
|
33
|
+
private themeController;
|
|
34
|
+
private pluginController;
|
|
35
|
+
private defaultSpecification;
|
|
36
|
+
constructor(spec: Specification<B, T>);
|
|
37
|
+
/**
|
|
38
|
+
* Initialize the controllers for different plugins.
|
|
39
|
+
*/
|
|
40
|
+
private initControllers;
|
|
41
|
+
private initCanvas;
|
|
42
|
+
/**
|
|
43
|
+
* Change the renderer at runtime.
|
|
44
|
+
* @param type renderer name
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
changeRenderer(type: any): void;
|
|
48
|
+
/**
|
|
49
|
+
* Initialize the hooks for graph's lifecycles.
|
|
50
|
+
*/
|
|
51
|
+
private initHooks;
|
|
52
|
+
/**
|
|
53
|
+
* Update the specs(configurations).
|
|
54
|
+
*/
|
|
55
|
+
updateSpecification(spec: Specification<B, T>): Specification<B, T>;
|
|
56
|
+
/**
|
|
57
|
+
* Update the theme specs (configurations).
|
|
58
|
+
*/
|
|
59
|
+
updateTheme(theme: ThemeOptionsOf<T>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Get the copy of specs(configurations).
|
|
62
|
+
* @returns graph specs
|
|
63
|
+
*/
|
|
64
|
+
getSpecification(): Specification<B, T>;
|
|
65
|
+
/**
|
|
66
|
+
* Input data and render the graph.
|
|
67
|
+
* If there is old data, diffs and changes it.
|
|
68
|
+
* @param data
|
|
69
|
+
* @returns
|
|
70
|
+
* @group Data
|
|
71
|
+
*/
|
|
72
|
+
read(data: GraphData): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Change graph data.
|
|
75
|
+
* @param data new data
|
|
76
|
+
* @param type the way to change data, 'replace' means discard the old data and use the new one; 'mergeReplace' means merge the common part, remove (old - new), add (new - old)
|
|
77
|
+
* @returns
|
|
78
|
+
* @group Data
|
|
79
|
+
*/
|
|
80
|
+
changeData(data: GraphData, type?: 'replace' | 'mergeReplace'): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Clear the graph, means remove all the items on the graph.
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
clear(): void;
|
|
86
|
+
getViewportCenter(): PointLike;
|
|
87
|
+
transform(options: GraphTransformOptions, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Stop the current transition of transform immediately.
|
|
90
|
+
*/
|
|
91
|
+
stopTransformTransition(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Move the graph with a relative distance under viewport coordinates.
|
|
94
|
+
* @param dx x of the relative distance
|
|
95
|
+
* @param dy y of the relative distance
|
|
96
|
+
* @param effectTiming animation configurations
|
|
97
|
+
*/
|
|
98
|
+
translate(distance: Partial<{
|
|
99
|
+
dx: number;
|
|
100
|
+
dy: number;
|
|
101
|
+
dz: number;
|
|
102
|
+
}>, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Move the graph to destination under viewport coordinates.
|
|
105
|
+
* @param destination destination under viewport coordinates.
|
|
106
|
+
* @param effectTiming animation configurations
|
|
107
|
+
*/
|
|
108
|
+
translateTo({ x, y }: PointLike, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Zoom the graph with a relative ratio.
|
|
111
|
+
* @param ratio relative ratio to zoom
|
|
112
|
+
* @param origin origin under viewport coordinates.
|
|
113
|
+
* @param effectTiming animation configurations
|
|
114
|
+
*/
|
|
115
|
+
zoom(ratio: number, origin?: PointLike, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Zoom the graph to a specified ratio.
|
|
118
|
+
* @param zoom specified ratio
|
|
119
|
+
* @param origin zoom center
|
|
120
|
+
* @param effectTiming animation configurations
|
|
121
|
+
*/
|
|
122
|
+
zoomTo(zoom: number, origin?: PointLike, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Return the current zoom level of camera.
|
|
125
|
+
* @returns current zoom
|
|
126
|
+
*/
|
|
127
|
+
getZoom(): number;
|
|
128
|
+
/**
|
|
129
|
+
* Rotate the graph with a relative angle.
|
|
130
|
+
* @param angle
|
|
131
|
+
* @param origin
|
|
132
|
+
* @param effectTiming
|
|
133
|
+
*/
|
|
134
|
+
rotate(angle: number, origin?: PointLike, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Rotate the graph to an absolute angle.
|
|
137
|
+
* @param angle
|
|
138
|
+
* @param origin
|
|
139
|
+
* @param effectTiming
|
|
140
|
+
*/
|
|
141
|
+
rotateTo(angle: number, origin?: PointLike, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Fit the graph content to the view.
|
|
144
|
+
* @param options.padding padding while fitting
|
|
145
|
+
* @param options.rules rules for fitting
|
|
146
|
+
* @param effectTiming animation configurations
|
|
147
|
+
*/
|
|
148
|
+
fitView(options?: {
|
|
149
|
+
padding: Padding;
|
|
150
|
+
rules: FitViewRules;
|
|
151
|
+
}, effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Fit the graph center to the view center.
|
|
154
|
+
* @param effectTiming animation configurations
|
|
155
|
+
*/
|
|
156
|
+
fitCenter(effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Move the graph to make the item align the view center.
|
|
159
|
+
* @param item node/edge/combo item or its id
|
|
160
|
+
* @param effectTiming animation configurations
|
|
161
|
+
*/
|
|
162
|
+
focusItem(id: ID | ID[], effectTiming?: CameraAnimationOptions): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Get the size of the graph canvas.
|
|
165
|
+
* @returns [width, height]
|
|
166
|
+
* @group View
|
|
167
|
+
*/
|
|
168
|
+
getSize(): number[];
|
|
169
|
+
/**
|
|
170
|
+
* Set the size for the graph canvas.
|
|
171
|
+
* @param number[] [width, height]
|
|
172
|
+
* @group View
|
|
173
|
+
*/
|
|
174
|
+
setSize(size: number[]): void;
|
|
175
|
+
/**
|
|
176
|
+
* Get the rendering coordinate according to the canvas dom (viewport) coordinate.
|
|
177
|
+
* @param Point rendering coordinate
|
|
178
|
+
* @returns canvas dom (viewport) coordinate
|
|
179
|
+
* @group View
|
|
180
|
+
*/
|
|
181
|
+
getCanvasByViewport(viewportPoint: Point): Point;
|
|
182
|
+
/**
|
|
183
|
+
* Get the canvas dom (viewport) coordinate according to the rendering coordinate.
|
|
184
|
+
* @param Point canvas dom (viewport) coordinate
|
|
185
|
+
* @returns rendering coordinate
|
|
186
|
+
* @group View
|
|
187
|
+
*/
|
|
188
|
+
getViewportByCanvas(canvasPoint: Point): Point;
|
|
189
|
+
/**
|
|
190
|
+
* Get the browser coordinate according to the rendering coordinate.
|
|
191
|
+
* @param Point rendering coordinate
|
|
192
|
+
* @returns browser coordinate
|
|
193
|
+
* @group View
|
|
194
|
+
*/
|
|
195
|
+
getClientByCanvas(canvasPoint: Point): Point;
|
|
196
|
+
/**
|
|
197
|
+
* Get the rendering coordinate according to the browser coordinate.
|
|
198
|
+
* @param Point browser coordinate
|
|
199
|
+
* @returns rendering coordinate
|
|
200
|
+
* @group View
|
|
201
|
+
*/
|
|
202
|
+
getCanvasByClient(clientPoint: Point): Point;
|
|
203
|
+
/**
|
|
204
|
+
* Find a node's inner data according to id or function.
|
|
205
|
+
* @param { ID | Function } condition id or condition function
|
|
206
|
+
* @returns result node's inner data
|
|
207
|
+
* @group Data
|
|
208
|
+
*/
|
|
209
|
+
getNodeData(condition: ID | Function): NodeModel | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Find an edge's inner data according to id or function.
|
|
212
|
+
* @param { ID | Function } condition id or condition function
|
|
213
|
+
* @returns result edge's inner data
|
|
214
|
+
* @group Data
|
|
215
|
+
*/
|
|
216
|
+
getEdgeData(condition: ID | Function): EdgeModel | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* Find an combo's inner data according to id or function.
|
|
219
|
+
* @param { ID | Function } condition id or condition function
|
|
220
|
+
* @returns result combo's inner data
|
|
221
|
+
* @group Data
|
|
222
|
+
*/
|
|
223
|
+
getComboData(condition: ID | Function): ComboModel | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* Get all the nodes' inner data
|
|
226
|
+
* @returns all nodes' inner data on the graph
|
|
227
|
+
* @group Data
|
|
228
|
+
*/
|
|
229
|
+
getAllNodesData(): NodeModel[];
|
|
230
|
+
/**
|
|
231
|
+
* Get all the edges' inner data
|
|
232
|
+
* @returns all edges' inner data on the graph
|
|
233
|
+
* @group Data
|
|
234
|
+
*/
|
|
235
|
+
getAllEdgesData(): EdgeModel[];
|
|
236
|
+
/**
|
|
237
|
+
* Get all the combos' inner data
|
|
238
|
+
* @returns all combos' inner data on the graph
|
|
239
|
+
* @group Data
|
|
240
|
+
*/
|
|
241
|
+
getAllCombosData(): ComboModel[];
|
|
242
|
+
/**
|
|
243
|
+
* Get one-hop edge ids from a start node.
|
|
244
|
+
* @param nodeId id of the start node
|
|
245
|
+
* @returns one-hop edge ids
|
|
246
|
+
* @group Data
|
|
247
|
+
*/
|
|
248
|
+
getRelatedEdgesData(nodeId: ID, direction?: 'in' | 'out' | 'both'): EdgeModel[];
|
|
249
|
+
/**
|
|
250
|
+
* Get one-hop node ids from a start node.
|
|
251
|
+
* @param nodeId id of the start node
|
|
252
|
+
* @returns one-hop node ids
|
|
253
|
+
* @group Data
|
|
254
|
+
*/
|
|
255
|
+
getNeighborNodesData(nodeId: ID, direction?: 'in' | 'out' | 'both'): NodeModel[];
|
|
256
|
+
/**
|
|
257
|
+
* Find items which has the state.
|
|
258
|
+
* @param itemType item type
|
|
259
|
+
* @param state state name
|
|
260
|
+
* @param additionalFilter additional filter function
|
|
261
|
+
* @returns items that is the type and has the state
|
|
262
|
+
* @group Item
|
|
263
|
+
*/
|
|
264
|
+
findIdByState(itemType: ITEM_TYPE, state: string, value?: string | boolean, additionalFilter?: (item: NodeModel | EdgeModel | ComboModel) => boolean): ID[];
|
|
265
|
+
/**
|
|
266
|
+
* Add one or more node/edge/combo data to the graph.
|
|
267
|
+
* @param itemType item type
|
|
268
|
+
* @param model user data
|
|
269
|
+
* @param stack whether push this operation to stack
|
|
270
|
+
* @returns whether success
|
|
271
|
+
* @group Data
|
|
272
|
+
*/
|
|
273
|
+
addData(itemType: ITEM_TYPE, models: NodeUserModel | EdgeUserModel | ComboUserModel | NodeUserModel[] | EdgeUserModel[] | ComboUserModel[], stack?: boolean): NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
274
|
+
/**
|
|
275
|
+
* Remove one or more node/edge/combo data from the graph.
|
|
276
|
+
* @param item the item to be removed
|
|
277
|
+
* @param stack whether push this operation to stack
|
|
278
|
+
* @returns whether success
|
|
279
|
+
* @group Data
|
|
280
|
+
*/
|
|
281
|
+
removeData(itemType: ITEM_TYPE, ids: ID | ID[], stack?: boolean): void;
|
|
282
|
+
/**
|
|
283
|
+
* Update one or more node/edge/combo data on the graph.
|
|
284
|
+
* @param {ITEM_TYPE} itemType 'node' | 'edge' | 'combo'
|
|
285
|
+
* @param models new configurations for every node/edge/combo, which has id field to indicate the specific item
|
|
286
|
+
* @param {boolean} stack whether push this operation into graph's stack, true by default
|
|
287
|
+
* @group Data
|
|
288
|
+
*/
|
|
289
|
+
updateData(itemType: ITEM_TYPE, models: Partial<NodeUserModel> | Partial<EdgeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<EdgeUserModel>[] | Partial<ComboUserModel>[]>, stack?: boolean): NodeModel | EdgeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
290
|
+
/**
|
|
291
|
+
* Update one or more nodes' positions,
|
|
292
|
+
* do not update other styles which leads to better performance than updating positions by updateData.
|
|
293
|
+
* @param models new configurations with x and y for every node, which has id field to indicate the specific item
|
|
294
|
+
* @param {boolean} stack whether push this operation into graph's stack, true by default
|
|
295
|
+
* @group Data
|
|
296
|
+
*/
|
|
297
|
+
updateNodePosition(models: Partial<NodeUserModel> | Partial<ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]>, stack?: boolean): EdgeModel | NodeModel | ComboModel | NodeModel[] | EdgeModel[] | ComboModel[];
|
|
298
|
+
/**
|
|
299
|
+
* Show the item(s).
|
|
300
|
+
* @param item the item to be shown
|
|
301
|
+
* @returns
|
|
302
|
+
* @group Item
|
|
303
|
+
*/
|
|
304
|
+
showItem(ids: ID | ID[], disableAniamte?: boolean): void;
|
|
305
|
+
/**
|
|
306
|
+
* Hide the item(s).
|
|
307
|
+
* @param item the item to be hidden
|
|
308
|
+
* @returns
|
|
309
|
+
* @group Item
|
|
310
|
+
*/
|
|
311
|
+
hideItem(ids: ID | ID[], disableAniamte?: boolean): void;
|
|
312
|
+
/**
|
|
313
|
+
* Set state for the item.
|
|
314
|
+
* @param item the item to be set
|
|
315
|
+
* @param state the state name
|
|
316
|
+
* @param value state value
|
|
317
|
+
* @returns
|
|
318
|
+
* @group Item
|
|
319
|
+
*/
|
|
320
|
+
setItemState(ids: ID | ID[], states: string | string[], value: boolean): void;
|
|
321
|
+
/**
|
|
322
|
+
* Get the state value for an item.
|
|
323
|
+
* @param id the id for the item
|
|
324
|
+
* @param states the state name
|
|
325
|
+
* @returns {boolean} the state value
|
|
326
|
+
* @group Item
|
|
327
|
+
*/
|
|
328
|
+
getItemState(id: ID, state: string): string | boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Clear all the states for item(s).
|
|
331
|
+
* @param ids the id(s) for the item(s) to be clear
|
|
332
|
+
* @param states the states' names, all the states wil be cleared if states is not assigned
|
|
333
|
+
* @returns
|
|
334
|
+
* @group Item
|
|
335
|
+
*/
|
|
336
|
+
clearItemState(ids: ID | ID[], states?: string[]): void;
|
|
337
|
+
/**
|
|
338
|
+
* Get the rendering bbox for a node / edge / combo, or the graph (when the id is not assigned).
|
|
339
|
+
* @param id the id for the node / edge / combo, undefined for the whole graph
|
|
340
|
+
* @returns rendering bounding box. returns false if the item is not exist
|
|
341
|
+
* @group Item
|
|
342
|
+
*/
|
|
343
|
+
getRenderBBox(id: ID | undefined): AABB | false;
|
|
344
|
+
/**
|
|
345
|
+
* Get the visibility for a node / edge / combo.
|
|
346
|
+
* @param id the id for the node / edge / combo
|
|
347
|
+
* @returns visibility for the item, false for invisible or unexistence for the item
|
|
348
|
+
* @group Item
|
|
349
|
+
*/
|
|
350
|
+
getItemVisible(id: ID): boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Create a new combo with existing child nodes and combos.
|
|
353
|
+
* @param combo combo ID or Combo model
|
|
354
|
+
* @param childrenIds id array of children of the new combo
|
|
355
|
+
* @group Combo
|
|
356
|
+
*/
|
|
357
|
+
createCombo(combo: string | ComboUserModel, childrenIds: string[], stack?: boolean): void;
|
|
358
|
+
/**
|
|
359
|
+
* dissolve combo
|
|
360
|
+
* @param {String | ICombo} item combo item or id to be dissolve
|
|
361
|
+
* @group Combo
|
|
362
|
+
*/
|
|
363
|
+
uncombo(comboId: ID, stack?: boolean): void;
|
|
364
|
+
/**
|
|
365
|
+
* Collapse a combo.
|
|
366
|
+
* @param comboId combo id or item
|
|
367
|
+
* @group Combo
|
|
368
|
+
*/
|
|
369
|
+
collapseCombo(comboId: ID, stack?: boolean): void;
|
|
370
|
+
/**
|
|
371
|
+
* Expand a combo.
|
|
372
|
+
* @param combo combo ID 或 combo 实例
|
|
373
|
+
* @group Combo
|
|
374
|
+
*/
|
|
375
|
+
expandCombo(comboId: ID, stack?: boolean): void;
|
|
376
|
+
/**
|
|
377
|
+
* Layout the graph (with current configurations if cfg is not assigned).
|
|
378
|
+
*/
|
|
379
|
+
layout(options?: LayoutOptions): Promise<void>;
|
|
380
|
+
/**
|
|
381
|
+
* Some layout algorithms has many iterations which can be stopped at any time.
|
|
382
|
+
*/
|
|
383
|
+
stopLayout(): void;
|
|
384
|
+
/**
|
|
385
|
+
* Switch mode.
|
|
386
|
+
* @param mode mode name
|
|
387
|
+
* @returns
|
|
388
|
+
* @group Interaction
|
|
389
|
+
*/
|
|
390
|
+
setMode(mode: string): void;
|
|
391
|
+
/**
|
|
392
|
+
* Add behavior(s) to mode(s).
|
|
393
|
+
* @param behaviors behavior names or configs
|
|
394
|
+
* @param modes mode names
|
|
395
|
+
* @returns
|
|
396
|
+
* @group Interaction
|
|
397
|
+
*/
|
|
398
|
+
addBehaviors(behaviors: BehaviorOptionsOf<B>[], modes: string | string[]): void;
|
|
399
|
+
/**
|
|
400
|
+
* Remove behavior(s) from mode(s).
|
|
401
|
+
* @param behaviors behavior configs with unique key
|
|
402
|
+
* @param modes mode names
|
|
403
|
+
* @returns
|
|
404
|
+
* @group Interaction
|
|
405
|
+
*/
|
|
406
|
+
removeBehaviors(behaviorKeys: string[], modes: string | string[]): void;
|
|
407
|
+
/**
|
|
408
|
+
* Update a behavior on a mode.
|
|
409
|
+
* @param behavior behavior configs, whose name indicates the behavior to be updated
|
|
410
|
+
* @param mode mode name
|
|
411
|
+
* @returns
|
|
412
|
+
* @group Interaction
|
|
413
|
+
*/
|
|
414
|
+
updateBehavior(behavior: BehaviorOptionsOf<B>, mode?: string): void;
|
|
415
|
+
/**
|
|
416
|
+
* Add plugin(s) to graph.
|
|
417
|
+
* @param pluginCfgs
|
|
418
|
+
* @returns
|
|
419
|
+
* @group Plugin
|
|
420
|
+
*/
|
|
421
|
+
addPlugins(pluginCfgs: ({
|
|
422
|
+
key: string;
|
|
423
|
+
type: string;
|
|
424
|
+
[cfgName: string]: unknown;
|
|
425
|
+
} | string)[]): void;
|
|
426
|
+
/**
|
|
427
|
+
* Remove plugin(s) from graph.
|
|
428
|
+
* @param pluginKeys
|
|
429
|
+
* @returns
|
|
430
|
+
* @group Plugin
|
|
431
|
+
*/
|
|
432
|
+
removePlugins(pluginKeys: string[]): void;
|
|
433
|
+
/**
|
|
434
|
+
* Update a plugin of the graph.
|
|
435
|
+
* @param plugin plugin configs, whose key indicates the behavior to be updated
|
|
436
|
+
* @returns
|
|
437
|
+
* @group Interaction
|
|
438
|
+
*/
|
|
439
|
+
updatePlugin(plugin: {
|
|
440
|
+
key: string;
|
|
441
|
+
type: string;
|
|
442
|
+
[cfg: string]: unknown;
|
|
443
|
+
}): void;
|
|
444
|
+
/**
|
|
445
|
+
* Draw or update a G shape or group to the transient canvas.
|
|
446
|
+
* @param type shape type or item type
|
|
447
|
+
* @param id new shape id or updated shape id for a interation shape, node/edge/combo id for item interaction group drawing
|
|
448
|
+
* @returns upserted shape or group
|
|
449
|
+
* @group Interaction
|
|
450
|
+
*/
|
|
451
|
+
drawTransient(type: ITEM_TYPE | SHAPE_TYPE, id: ID, config: {
|
|
452
|
+
action: 'remove' | 'add' | 'update' | undefined;
|
|
453
|
+
style: ShapeStyle;
|
|
454
|
+
onlyDrawKeyShape?: boolean;
|
|
455
|
+
}): DisplayObject;
|
|
456
|
+
/**
|
|
457
|
+
* Destroy the graph instance and remove the related canvases.
|
|
458
|
+
* @returns
|
|
459
|
+
* @group Graph Instance
|
|
460
|
+
*/
|
|
461
|
+
destroy(callback?: Function): void;
|
|
462
|
+
}
|