@antv/g6 5.0.0-beta.3 → 5.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g6.min.js +2 -2
- package/dist/lib/animations/executor.d.ts +12 -0
- package/dist/lib/animations/index.d.ts +18 -0
- package/dist/lib/animations/types.d.ts +56 -0
- package/dist/lib/behaviors/base-behavior.d.ts +5 -0
- package/dist/lib/behaviors/collapse-expand.d.ts +41 -0
- package/dist/lib/behaviors/drag-canvas.d.ts +56 -0
- package/dist/lib/behaviors/drag-element.d.ts +100 -0
- package/dist/lib/behaviors/focus-element.d.ts +29 -0
- package/dist/lib/behaviors/hover-element.d.ts +61 -0
- package/dist/lib/behaviors/index.d.ts +14 -0
- package/dist/lib/behaviors/types.d.ts +5 -0
- package/dist/lib/behaviors/zoom-canvas.d.ts +70 -0
- package/dist/lib/constants/animation.d.ts +2 -0
- package/dist/lib/constants/change.d.ts +15 -0
- package/dist/lib/constants/element.d.ts +6 -0
- package/dist/lib/constants/events/animation.d.ts +7 -0
- package/dist/lib/constants/events/canvas.d.ts +38 -0
- package/dist/lib/constants/events/combo.d.ts +2 -0
- package/dist/lib/constants/events/common.d.ts +42 -0
- package/dist/lib/constants/events/container.d.ts +6 -0
- package/dist/lib/constants/events/edge.d.ts +30 -0
- package/dist/lib/constants/events/graph.d.ts +60 -0
- package/dist/lib/constants/events/index.d.ts +8 -0
- package/dist/lib/constants/events/node.d.ts +36 -0
- package/dist/lib/constants/graphlib.d.ts +2 -0
- package/dist/lib/constants/index.d.ts +4 -0
- package/dist/lib/elements/combos/base-combo.d.ts +47 -0
- package/dist/lib/elements/combos/circle.d.ts +18 -0
- package/dist/lib/elements/combos/index.d.ts +6 -0
- package/dist/lib/elements/combos/rect.d.ts +15 -0
- package/dist/lib/elements/edges/base-edge.d.ts +58 -0
- package/dist/lib/elements/edges/cubic-horizontal.d.ts +21 -0
- package/dist/lib/elements/edges/cubic-vertical.d.ts +21 -0
- package/dist/lib/elements/edges/cubic.d.ts +30 -0
- package/dist/lib/elements/edges/index.d.ts +14 -0
- package/dist/lib/elements/edges/line.d.ts +15 -0
- package/dist/lib/elements/edges/polyline.d.ts +42 -0
- package/dist/lib/elements/edges/quadratic.d.ts +29 -0
- package/dist/lib/elements/index.d.ts +3 -0
- package/dist/lib/elements/nodes/base-node.d.ts +107 -0
- package/dist/lib/elements/nodes/circle.d.ts +20 -0
- package/dist/lib/elements/nodes/diamond.d.ts +15 -0
- package/dist/lib/elements/nodes/ellipse.d.ts +17 -0
- package/dist/lib/elements/nodes/hexagon.d.ts +21 -0
- package/dist/lib/elements/nodes/image.d.ts +20 -0
- package/dist/lib/elements/nodes/index.d.ts +18 -0
- package/dist/lib/elements/nodes/polygon.d.ts +17 -0
- package/dist/lib/elements/nodes/rect.d.ts +19 -0
- package/dist/lib/elements/nodes/star.d.ts +24 -0
- package/dist/lib/elements/nodes/triangle.d.ts +24 -0
- package/dist/lib/elements/shapes/badge.d.ts +14 -0
- package/dist/lib/elements/shapes/base-shape.d.ts +58 -0
- package/dist/lib/elements/shapes/icon.d.ts +13 -0
- package/dist/lib/elements/shapes/index.d.ts +13 -0
- package/dist/lib/elements/shapes/label.d.ts +22 -0
- package/dist/lib/exports.d.ts +32 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/layouts/index.d.ts +3 -0
- package/dist/lib/layouts/types.d.ts +77 -0
- package/dist/lib/palettes/index.d.ts +9 -0
- package/dist/lib/palettes/types.d.ts +5 -0
- package/dist/lib/plugins/base-plugin.d.ts +5 -0
- package/dist/lib/plugins/contextmenu.d.ts +88 -0
- package/dist/lib/plugins/grid-line.d.ts +30 -0
- package/dist/lib/plugins/index.d.ts +12 -0
- package/dist/lib/plugins/toolbar/index.d.ts +62 -0
- package/dist/lib/plugins/toolbar/util.d.ts +34 -0
- package/dist/lib/plugins/tooltip.d.ts +39 -0
- package/dist/lib/plugins/types.d.ts +4 -0
- package/dist/lib/plugins/watermark.d.ts +51 -0
- package/dist/lib/preset.d.ts +1 -0
- package/dist/lib/registry/build-in.d.ts +6 -0
- package/dist/lib/registry/extension/index.d.ts +33 -0
- package/dist/lib/registry/extension/types.d.ts +38 -0
- package/dist/lib/registry/index.d.ts +57 -0
- package/dist/lib/registry/types.d.ts +41 -0
- package/dist/lib/runtime/behavior.d.ts +15 -0
- package/dist/lib/runtime/canvas.d.ts +49 -0
- package/dist/lib/runtime/data.d.ts +187 -0
- package/dist/lib/runtime/element.d.ts +138 -0
- package/dist/lib/runtime/graph.d.ts +441 -0
- package/dist/lib/runtime/index.d.ts +6 -0
- package/dist/lib/runtime/layout.d.ts +49 -0
- package/dist/lib/runtime/plugin.d.ts +9 -0
- package/dist/lib/runtime/types.d.ts +69 -0
- package/dist/lib/runtime/viewport.d.ts +59 -0
- package/dist/lib/spec/behavior.d.ts +12 -0
- package/dist/lib/spec/canvas.d.ts +42 -0
- package/dist/lib/spec/data.d.ts +44 -0
- package/dist/lib/spec/element/animation.d.ts +12 -0
- package/dist/lib/spec/element/base.d.ts +6 -0
- package/dist/lib/spec/element/combo.d.ts +48 -0
- package/dist/lib/spec/element/edge.d.ts +46 -0
- package/dist/lib/spec/element/node.d.ts +48 -0
- package/dist/lib/spec/element/palette.d.ts +53 -0
- package/dist/lib/spec/index.d.ts +11 -0
- package/dist/lib/spec/layout.d.ts +4 -0
- package/dist/lib/spec/plugin.d.ts +12 -0
- package/dist/lib/spec/spec.d.ts +76 -0
- package/dist/lib/spec/theme.d.ts +10 -0
- package/dist/lib/spec/viewport.d.ts +86 -0
- package/dist/lib/themes/base.d.ts +27 -0
- package/dist/lib/themes/dark.d.ts +2 -0
- package/dist/lib/themes/index.d.ts +2 -0
- package/dist/lib/themes/light.d.ts +2 -0
- package/dist/lib/themes/types.d.ts +10 -0
- package/dist/lib/types/anchor.d.ts +3 -0
- package/dist/lib/types/animation.d.ts +6 -0
- package/dist/lib/types/behavior.d.ts +5 -0
- package/dist/lib/types/callable.d.ts +30 -0
- package/dist/lib/types/canvas.d.ts +1 -0
- package/dist/lib/types/change.d.ts +51 -0
- package/dist/lib/types/data.d.ts +44 -0
- package/dist/lib/types/edge.d.ts +34 -0
- package/dist/lib/types/element.d.ts +149 -0
- package/dist/lib/types/enum.d.ts +1 -0
- package/dist/lib/types/event.d.ts +8 -0
- package/dist/lib/types/graphlib.d.ts +16 -0
- package/dist/lib/types/index.d.ts +24 -0
- package/dist/lib/types/node.d.ts +16 -0
- package/dist/lib/types/padding.d.ts +2 -0
- package/dist/lib/types/placement.d.ts +5 -0
- package/dist/lib/types/plugin.d.ts +5 -0
- package/dist/lib/types/point.d.ts +2 -0
- package/dist/lib/types/position.d.ts +2 -0
- package/dist/lib/types/prefix.d.ts +7 -0
- package/dist/lib/types/size.d.ts +3 -0
- package/dist/lib/types/state.d.ts +1 -0
- package/dist/lib/types/style.d.ts +11 -0
- package/dist/lib/types/tree.d.ts +5 -0
- package/dist/lib/types/vector.d.ts +2 -0
- package/dist/lib/types/viewport.d.ts +38 -0
- package/dist/lib/utils/anchor.d.ts +9 -0
- package/dist/lib/utils/animation.d.ts +73 -0
- package/dist/lib/utils/array.d.ts +9 -0
- package/dist/lib/utils/bbox.d.ts +109 -0
- package/dist/lib/utils/cache.d.ts +36 -0
- package/dist/lib/utils/change.d.ts +9 -0
- package/dist/lib/utils/combo.d.ts +33 -0
- package/dist/lib/utils/contextmenu.d.ts +26 -0
- package/dist/lib/utils/data.d.ts +34 -0
- package/dist/lib/utils/diff.d.ts +15 -0
- package/dist/lib/utils/dom.d.ts +23 -0
- package/dist/lib/utils/edge.d.ts +158 -0
- package/dist/lib/utils/element.d.ts +208 -0
- package/dist/lib/utils/event/events.d.ts +31 -0
- package/dist/lib/utils/event/index.d.ts +29 -0
- package/dist/lib/utils/extension.d.ts +10 -0
- package/dist/lib/utils/graphlib.d.ts +14 -0
- package/dist/lib/utils/id.d.ts +26 -0
- package/dist/lib/utils/is.d.ts +34 -0
- package/dist/lib/utils/layout.d.ts +25 -0
- package/dist/lib/utils/math.d.ts +10 -0
- package/dist/lib/utils/padding.d.ts +9 -0
- package/dist/lib/utils/palette.d.ts +33 -0
- package/dist/lib/utils/placement.d.ts +9 -0
- package/dist/lib/utils/point.d.ts +129 -0
- package/dist/lib/utils/position.d.ts +37 -0
- package/dist/lib/utils/prefix.d.ts +66 -0
- package/dist/lib/utils/relation.d.ts +34 -0
- package/dist/lib/utils/router/orth.d.ts +103 -0
- package/dist/lib/utils/shape.d.ts +9 -0
- package/dist/lib/utils/shortcut.d.ts +20 -0
- package/dist/lib/utils/size.d.ts +7 -0
- package/dist/lib/utils/style.d.ts +20 -0
- package/dist/lib/utils/symbol.d.ts +30 -0
- package/dist/lib/utils/text.d.ts +26 -0
- package/dist/lib/utils/traverse.d.ts +23 -0
- package/dist/lib/utils/tree.d.ts +17 -0
- package/dist/lib/utils/vector.d.ts +142 -0
- package/dist/lib/utils/visibility.d.ts +13 -0
- package/dist/lib/utils/watermark.d.ts +18 -0
- package/esm/animations/executor.d.ts +12 -0
- package/esm/animations/executor.js +75 -0
- package/esm/animations/executor.js.map +1 -0
- package/esm/animations/index.d.ts +18 -0
- package/esm/animations/index.js +17 -0
- package/esm/animations/index.js.map +1 -0
- package/esm/animations/types.d.ts +56 -0
- package/esm/animations/types.js.map +1 -0
- package/esm/behaviors/base-behavior.d.ts +5 -0
- package/esm/behaviors/base-behavior.js +4 -0
- package/esm/behaviors/base-behavior.js.map +1 -0
- package/esm/behaviors/collapse-expand.d.ts +41 -0
- package/esm/behaviors/collapse-expand.js +54 -0
- package/esm/behaviors/collapse-expand.js.map +1 -0
- package/esm/behaviors/drag-canvas.d.ts +56 -0
- package/esm/behaviors/drag-canvas.js +61 -0
- package/esm/behaviors/drag-canvas.js.map +1 -0
- package/esm/behaviors/drag-element.d.ts +100 -0
- package/esm/behaviors/drag-element.js +202 -0
- package/esm/behaviors/drag-element.js.map +1 -0
- package/esm/behaviors/focus-element.d.ts +29 -0
- package/esm/behaviors/focus-element.js +57 -0
- package/esm/behaviors/focus-element.js.map +1 -0
- package/esm/behaviors/hover-element.d.ts +61 -0
- package/esm/behaviors/hover-element.js +85 -0
- package/esm/behaviors/hover-element.js.map +1 -0
- package/esm/behaviors/index.d.ts +14 -0
- package/esm/behaviors/index.js +8 -0
- package/esm/behaviors/index.js.map +1 -0
- package/esm/behaviors/types.d.ts +5 -0
- package/esm/behaviors/types.js.map +1 -0
- package/esm/behaviors/zoom-canvas.d.ts +70 -0
- package/esm/behaviors/zoom-canvas.js +81 -0
- package/esm/behaviors/zoom-canvas.js.map +1 -0
- package/esm/constants/animation.d.ts +2 -0
- package/esm/constants/animation.js +10 -0
- package/esm/constants/animation.js.map +1 -0
- package/esm/constants/change.d.ts +15 -0
- package/esm/constants/change.js +17 -0
- package/esm/constants/change.js.map +1 -0
- package/esm/constants/element.d.ts +6 -0
- package/esm/constants/element.js +7 -0
- package/esm/constants/element.js.map +1 -0
- package/esm/constants/events/animation.d.ts +7 -0
- package/esm/constants/events/animation.js +10 -0
- package/esm/constants/events/animation.js.map +1 -0
- package/esm/constants/events/canvas.d.ts +38 -0
- package/esm/constants/events/canvas.js +40 -0
- package/esm/constants/events/canvas.js.map +1 -0
- package/esm/constants/events/combo.d.ts +2 -0
- package/esm/constants/events/combo.js +3 -0
- package/esm/constants/events/combo.js.map +1 -0
- package/esm/constants/events/common.d.ts +42 -0
- package/esm/constants/events/common.js +44 -0
- package/esm/constants/events/common.js.map +1 -0
- package/esm/constants/events/container.d.ts +6 -0
- package/esm/constants/events/container.js +8 -0
- package/esm/constants/events/container.js.map +1 -0
- package/esm/constants/events/edge.d.ts +30 -0
- package/esm/constants/events/edge.js +32 -0
- package/esm/constants/events/edge.js.map +1 -0
- package/esm/constants/events/graph.d.ts +60 -0
- package/esm/constants/events/graph.js +64 -0
- package/esm/constants/events/graph.js.map +1 -0
- package/esm/constants/events/index.d.ts +8 -0
- package/esm/constants/events/index.js +9 -0
- package/esm/constants/events/index.js.map +1 -0
- package/esm/constants/events/node.d.ts +36 -0
- package/esm/constants/events/node.js +38 -0
- package/esm/constants/events/node.js.map +1 -0
- package/esm/constants/graphlib.d.ts +2 -0
- package/esm/constants/graphlib.js +3 -0
- package/esm/constants/graphlib.js.map +1 -0
- package/esm/constants/index.d.ts +4 -0
- package/esm/constants/index.js +5 -0
- package/esm/constants/index.js.map +1 -0
- package/esm/elements/combos/base-combo.d.ts +47 -0
- package/esm/elements/combos/base-combo.js +132 -0
- package/esm/elements/combos/base-combo.js.map +1 -0
- package/esm/elements/combos/circle.d.ts +18 -0
- package/esm/elements/combos/circle.js +46 -0
- package/esm/elements/combos/circle.js.map +1 -0
- package/esm/elements/combos/index.d.ts +6 -0
- package/esm/elements/combos/index.js +4 -0
- package/esm/elements/combos/index.js.map +1 -0
- package/esm/elements/combos/rect.d.ts +15 -0
- package/esm/elements/combos/rect.js +27 -0
- package/esm/elements/combos/rect.js.map +1 -0
- package/esm/elements/edges/base-edge.d.ts +58 -0
- package/esm/elements/edges/base-edge.js +166 -0
- package/esm/elements/edges/base-edge.js.map +1 -0
- package/esm/elements/edges/cubic-horizontal.d.ts +21 -0
- package/esm/elements/edges/cubic-horizontal.js +19 -0
- package/esm/elements/edges/cubic-horizontal.js.map +1 -0
- package/esm/elements/edges/cubic-vertical.d.ts +21 -0
- package/esm/elements/edges/cubic-vertical.js +19 -0
- package/esm/elements/edges/cubic-vertical.js.map +1 -0
- package/esm/elements/edges/cubic.d.ts +30 -0
- package/esm/elements/edges/cubic.js +27 -0
- package/esm/elements/edges/cubic.js.map +1 -0
- package/esm/elements/edges/index.d.ts +14 -0
- package/esm/elements/edges/index.js +8 -0
- package/esm/elements/edges/index.js.map +1 -0
- package/esm/elements/edges/line.d.ts +15 -0
- package/esm/elements/edges/line.js +19 -0
- package/esm/elements/edges/line.js.map +1 -0
- package/esm/elements/edges/polyline.d.ts +42 -0
- package/esm/elements/edges/polyline.js +58 -0
- package/esm/elements/edges/polyline.js.map +1 -0
- package/esm/elements/edges/quadratic.d.ts +29 -0
- package/esm/elements/edges/quadratic.js +19 -0
- package/esm/elements/edges/quadratic.js.map +1 -0
- package/esm/elements/index.d.ts +3 -0
- package/esm/elements/index.js +4 -0
- package/esm/elements/index.js.map +1 -0
- package/esm/elements/nodes/base-node.d.ts +107 -0
- package/esm/elements/nodes/base-node.js +208 -0
- package/esm/elements/nodes/base-node.js.map +1 -0
- package/esm/elements/nodes/circle.d.ts +20 -0
- package/esm/elements/nodes/circle.js +34 -0
- package/esm/elements/nodes/circle.js.map +1 -0
- package/esm/elements/nodes/diamond.d.ts +15 -0
- package/esm/elements/nodes/diamond.js +21 -0
- package/esm/elements/nodes/diamond.js.map +1 -0
- package/esm/elements/nodes/ellipse.d.ts +17 -0
- package/esm/elements/nodes/ellipse.js +36 -0
- package/esm/elements/nodes/ellipse.js.map +1 -0
- package/esm/elements/nodes/hexagon.d.ts +21 -0
- package/esm/elements/nodes/hexagon.js +20 -0
- package/esm/elements/nodes/hexagon.js.map +1 -0
- package/esm/elements/nodes/image.d.ts +20 -0
- package/esm/elements/nodes/image.js +52 -0
- package/esm/elements/nodes/image.js.map +1 -0
- package/esm/elements/nodes/index.d.ts +18 -0
- package/esm/elements/nodes/index.js +10 -0
- package/esm/elements/nodes/index.js.map +1 -0
- package/esm/elements/nodes/polygon.d.ts +17 -0
- package/esm/elements/nodes/polygon.js +24 -0
- package/esm/elements/nodes/polygon.js.map +1 -0
- package/esm/elements/nodes/rect.d.ts +19 -0
- package/esm/elements/nodes/rect.js +39 -0
- package/esm/elements/nodes/rect.js.map +1 -0
- package/esm/elements/nodes/star.d.ts +24 -0
- package/esm/elements/nodes/star.js +29 -0
- package/esm/elements/nodes/star.js.map +1 -0
- package/esm/elements/nodes/triangle.d.ts +24 -0
- package/esm/elements/nodes/triangle.js +47 -0
- package/esm/elements/nodes/triangle.js.map +1 -0
- package/esm/elements/shapes/badge.d.ts +14 -0
- package/esm/elements/shapes/badge.js +25 -0
- package/esm/elements/shapes/badge.js.map +1 -0
- package/esm/elements/shapes/base-shape.d.ts +58 -0
- package/esm/elements/shapes/base-shape.js +115 -0
- package/esm/elements/shapes/base-shape.js.map +1 -0
- package/esm/elements/shapes/icon.d.ts +13 -0
- package/esm/elements/shapes/icon.js +31 -0
- package/esm/elements/shapes/icon.js.map +1 -0
- package/esm/elements/shapes/index.d.ts +13 -0
- package/esm/elements/shapes/index.js +10 -0
- package/esm/elements/shapes/index.js.map +1 -0
- package/esm/elements/shapes/label.d.ts +22 -0
- package/esm/elements/shapes/label.js +60 -0
- package/esm/elements/shapes/label.js.map +1 -0
- package/esm/elements/types.js +15 -0
- package/esm/elements/types.js.map +1 -0
- package/esm/exports.d.ts +32 -0
- package/esm/exports.js +25 -0
- package/esm/exports.js.map +1 -0
- package/esm/index.d.ts +3 -248
- package/esm/index.js +3 -18
- package/esm/index.js.map +1 -1
- package/esm/layouts/index.d.ts +3 -0
- package/esm/layouts/index.js +3 -0
- package/esm/layouts/index.js.map +1 -0
- package/esm/layouts/types.d.ts +77 -0
- package/esm/layouts/types.js.map +1 -0
- package/esm/palettes/index.d.ts +9 -0
- package/esm/palettes/index.js +52 -0
- package/esm/palettes/index.js.map +1 -0
- package/esm/palettes/types.d.ts +5 -0
- package/esm/palettes/types.js +2 -0
- package/esm/palettes/types.js.map +1 -0
- package/esm/plugins/base-plugin.d.ts +5 -0
- package/esm/plugins/base-plugin.js +4 -0
- package/esm/plugins/base-plugin.js.map +1 -0
- package/esm/plugins/contextmenu.d.ts +88 -0
- package/esm/plugins/contextmenu.js +122 -0
- package/esm/plugins/contextmenu.js.map +1 -0
- package/esm/plugins/grid-line.d.ts +30 -0
- package/esm/plugins/grid-line.js +59 -0
- package/esm/plugins/grid-line.js.map +1 -0
- package/esm/plugins/index.d.ts +12 -0
- package/esm/plugins/index.js +7 -0
- package/esm/plugins/index.js.map +1 -0
- package/esm/plugins/toolbar/index.d.ts +62 -0
- package/esm/plugins/toolbar/index.js +68 -0
- package/esm/plugins/toolbar/index.js.map +1 -0
- package/esm/plugins/toolbar/util.d.ts +34 -0
- package/esm/plugins/toolbar/util.js +88 -0
- package/esm/plugins/toolbar/util.js.map +1 -0
- package/esm/plugins/tooltip.d.ts +39 -0
- package/esm/plugins/tooltip.js +232 -0
- package/esm/plugins/tooltip.js.map +1 -0
- package/esm/plugins/types.d.ts +4 -0
- package/esm/plugins/types.js +2 -0
- package/esm/plugins/types.js.map +1 -0
- package/esm/plugins/watermark.d.ts +51 -0
- package/esm/plugins/watermark.js +53 -0
- package/esm/plugins/watermark.js.map +1 -0
- package/esm/preset.d.ts +1 -0
- package/esm/preset.js +8 -0
- package/esm/preset.js.map +1 -0
- package/esm/registry/build-in.d.ts +6 -0
- package/esm/registry/build-in.js +85 -0
- package/esm/registry/build-in.js.map +1 -0
- package/esm/registry/extension/index.d.ts +33 -0
- package/esm/registry/extension/index.js +84 -0
- package/esm/registry/extension/index.js.map +1 -0
- package/esm/registry/extension/types.d.ts +38 -0
- package/esm/registry/extension/types.js +2 -0
- package/esm/registry/extension/types.js.map +1 -0
- package/esm/registry/index.d.ts +57 -0
- package/esm/registry/index.js +94 -0
- package/esm/registry/index.js.map +1 -0
- package/esm/registry/types.d.ts +41 -0
- package/esm/registry/types.js +2 -0
- package/esm/registry/types.js.map +1 -0
- package/esm/runtime/behavior.d.ts +15 -0
- package/esm/runtime/behavior.js +106 -0
- package/esm/runtime/behavior.js.map +1 -0
- package/esm/runtime/canvas.d.ts +49 -0
- package/esm/runtime/canvas.js +197 -0
- package/esm/runtime/canvas.js.map +1 -0
- package/esm/runtime/data.d.ts +187 -0
- package/esm/runtime/data.js +671 -0
- package/esm/runtime/data.js.map +1 -0
- package/esm/runtime/element.d.ts +138 -0
- package/esm/runtime/element.js +586 -0
- package/esm/runtime/element.js.map +1 -0
- package/esm/runtime/graph.d.ts +364 -564
- package/esm/runtime/graph.js +609 -1548
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/index.d.ts +6 -0
- package/esm/runtime/index.js +7 -0
- package/esm/runtime/index.js.map +1 -0
- package/esm/runtime/layout.d.ts +49 -0
- package/esm/runtime/layout.js +333 -0
- package/esm/runtime/layout.js.map +1 -0
- package/esm/runtime/plugin.d.ts +9 -0
- package/esm/runtime/plugin.js +12 -0
- package/esm/runtime/plugin.js.map +1 -0
- package/esm/runtime/types.d.ts +69 -0
- package/esm/runtime/types.js +2 -0
- package/esm/runtime/types.js.map +1 -0
- package/esm/runtime/viewport.d.ts +59 -0
- package/esm/runtime/viewport.js +241 -0
- package/esm/runtime/viewport.js.map +1 -0
- package/esm/spec/behavior.d.ts +12 -0
- package/esm/spec/behavior.js +2 -0
- package/esm/spec/behavior.js.map +1 -0
- package/esm/spec/canvas.d.ts +42 -0
- package/esm/spec/canvas.js +2 -0
- package/esm/spec/canvas.js.map +1 -0
- package/esm/spec/data.d.ts +44 -0
- package/esm/spec/data.js +2 -0
- package/esm/spec/data.js.map +1 -0
- package/esm/spec/element/animation.d.ts +12 -0
- package/esm/spec/element/animation.js +2 -0
- package/esm/spec/element/animation.js.map +1 -0
- package/esm/spec/element/base.d.ts +6 -0
- package/esm/spec/element/base.js +2 -0
- package/esm/spec/element/base.js.map +1 -0
- package/esm/spec/element/combo.d.ts +48 -0
- package/esm/spec/element/combo.js.map +1 -0
- package/esm/spec/element/edge.d.ts +46 -0
- package/esm/spec/element/edge.js +2 -0
- package/esm/spec/element/edge.js.map +1 -0
- package/esm/spec/element/node.d.ts +48 -0
- package/esm/spec/element/node.js +2 -0
- package/esm/spec/element/node.js.map +1 -0
- package/esm/spec/element/palette.d.ts +53 -0
- package/esm/spec/element/palette.js +2 -0
- package/esm/spec/element/palette.js.map +1 -0
- package/esm/spec/index.d.ts +11 -0
- package/esm/spec/index.js +2 -0
- package/esm/spec/index.js.map +1 -0
- package/esm/spec/layout.d.ts +4 -0
- package/esm/spec/layout.js.map +1 -0
- package/esm/spec/plugin.d.ts +12 -0
- package/esm/spec/plugin.js +2 -0
- package/esm/spec/plugin.js.map +1 -0
- package/esm/spec/spec.d.ts +76 -0
- package/esm/spec/spec.js.map +1 -0
- package/esm/spec/theme.d.ts +10 -0
- package/esm/spec/theme.js +2 -0
- package/esm/spec/theme.js.map +1 -0
- package/esm/spec/viewport.d.ts +86 -0
- package/esm/spec/viewport.js +2 -0
- package/esm/spec/viewport.js.map +1 -0
- package/esm/themes/base.d.ts +27 -0
- package/esm/themes/base.js +204 -0
- package/esm/themes/base.js.map +1 -0
- package/esm/themes/dark.d.ts +2 -0
- package/esm/themes/dark.js +16 -0
- package/esm/themes/dark.js.map +1 -0
- package/esm/themes/index.d.ts +2 -0
- package/esm/themes/index.js +3 -0
- package/esm/themes/index.js.map +1 -0
- package/esm/themes/light.d.ts +2 -0
- package/esm/themes/light.js +16 -0
- package/esm/themes/light.js.map +1 -0
- package/esm/themes/types.d.ts +10 -0
- package/esm/themes/types.js +2 -0
- package/esm/themes/types.js.map +1 -0
- package/esm/types/anchor.d.ts +3 -0
- package/esm/types/anchor.js +2 -0
- package/esm/types/anchor.js.map +1 -0
- package/esm/types/animation.d.ts +6 -0
- package/esm/types/animation.js +2 -0
- package/esm/types/animation.js.map +1 -0
- package/esm/types/behavior.d.ts +5 -45
- package/esm/types/behavior.js +1 -13
- package/esm/types/behavior.js.map +1 -1
- package/esm/types/callable.d.ts +30 -0
- package/esm/types/callable.js +2 -0
- package/esm/types/callable.js.map +1 -0
- package/esm/types/canvas.d.ts +1 -0
- package/esm/types/canvas.js +2 -0
- package/esm/types/canvas.js.map +1 -0
- package/esm/types/change.d.ts +51 -0
- package/esm/types/change.js +2 -0
- package/esm/types/change.js.map +1 -0
- package/esm/types/data.d.ts +44 -27
- package/esm/types/edge.d.ts +24 -104
- package/esm/types/element.d.ts +149 -0
- package/esm/types/element.js +2 -0
- package/esm/types/element.js.map +1 -0
- package/esm/types/enum.d.ts +1 -0
- package/esm/types/enum.js +2 -0
- package/esm/types/enum.js.map +1 -0
- package/esm/types/event.d.ts +7 -38
- package/esm/types/event.js +1 -30
- package/esm/types/event.js.map +1 -1
- package/esm/types/graphlib.d.ts +16 -0
- package/esm/types/graphlib.js +2 -0
- package/esm/types/graphlib.js.map +1 -0
- package/esm/types/index.d.ts +24 -16
- package/esm/types/index.js +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/types/node.d.ts +15 -214
- package/esm/types/padding.d.ts +2 -0
- package/esm/types/padding.js +2 -0
- package/esm/types/padding.js.map +1 -0
- package/esm/types/placement.d.ts +5 -0
- package/esm/types/placement.js +2 -0
- package/esm/types/placement.js.map +1 -0
- package/esm/types/plugin.d.ts +5 -44
- package/esm/types/plugin.js +1 -52
- package/esm/types/plugin.js.map +1 -1
- package/esm/types/point.d.ts +2 -0
- package/esm/types/point.js +2 -0
- package/esm/types/point.js.map +1 -0
- package/esm/types/position.d.ts +2 -0
- package/esm/types/position.js +2 -0
- package/esm/types/position.js.map +1 -0
- package/esm/types/prefix.d.ts +7 -0
- package/esm/types/prefix.js +2 -0
- package/esm/types/prefix.js.map +1 -0
- package/esm/types/size.d.ts +3 -0
- package/esm/types/size.js +2 -0
- package/esm/types/size.js.map +1 -0
- package/esm/types/state.d.ts +1 -0
- package/esm/types/state.js +2 -0
- package/esm/types/state.js.map +1 -0
- package/esm/types/style.d.ts +11 -0
- package/esm/types/style.js +2 -0
- package/esm/types/style.js.map +1 -0
- package/esm/types/tree.d.ts +5 -0
- package/esm/types/tree.js +2 -0
- package/esm/types/tree.js.map +1 -0
- package/esm/types/vector.d.ts +2 -0
- package/esm/types/vector.js +2 -0
- package/esm/types/vector.js.map +1 -0
- package/esm/types/viewport.d.ts +38 -0
- package/esm/types/viewport.js +2 -0
- package/esm/types/viewport.js.map +1 -0
- package/esm/utils/anchor.d.ts +9 -0
- package/esm/utils/anchor.js +16 -0
- package/esm/utils/anchor.js.map +1 -0
- package/esm/utils/animation.d.ts +73 -0
- package/esm/utils/animation.js +208 -0
- package/esm/utils/animation.js.map +1 -0
- package/esm/utils/array.d.ts +9 -0
- package/esm/utils/array.js +16 -0
- package/esm/utils/array.js.map +1 -0
- package/esm/utils/bbox.d.ts +109 -0
- package/esm/utils/bbox.js +206 -0
- package/esm/utils/bbox.js.map +1 -0
- package/esm/utils/cache.d.ts +36 -0
- package/esm/utils/cache.js +53 -0
- package/esm/utils/cache.js.map +1 -0
- package/esm/utils/change.d.ts +9 -0
- package/esm/utils/change.js +56 -0
- package/esm/utils/change.js.map +1 -0
- package/esm/utils/combo.d.ts +33 -0
- package/esm/utils/combo.js +111 -0
- package/esm/utils/combo.js.map +1 -0
- package/esm/utils/contextmenu.d.ts +26 -0
- package/esm/utils/contextmenu.js +45 -0
- package/esm/utils/contextmenu.js.map +1 -0
- package/esm/utils/data.d.ts +34 -0
- package/esm/utils/data.js +59 -0
- package/esm/utils/data.js.map +1 -0
- package/esm/utils/diff.d.ts +15 -0
- package/esm/utils/diff.js +40 -0
- package/esm/utils/diff.js.map +1 -0
- package/esm/utils/dom.d.ts +23 -0
- package/esm/utils/dom.js +79 -0
- package/esm/utils/dom.js.map +1 -0
- package/esm/utils/edge.d.ts +158 -0
- package/esm/utils/edge.js +464 -0
- package/esm/utils/edge.js.map +1 -0
- package/esm/utils/element.d.ts +208 -0
- package/esm/utils/element.js +431 -0
- package/esm/utils/element.js.map +1 -0
- package/esm/utils/event/events.d.ts +31 -0
- package/esm/utils/event/events.js +46 -0
- package/esm/utils/event/events.js.map +1 -0
- package/esm/utils/event/index.d.ts +29 -0
- package/esm/utils/event/index.js +45 -0
- package/esm/utils/event/index.js.map +1 -0
- package/esm/utils/extension.d.ts +10 -0
- package/esm/utils/extension.js +25 -0
- package/esm/utils/extension.js.map +1 -0
- package/esm/utils/graphlib.d.ts +14 -0
- package/esm/utils/graphlib.js +44 -0
- package/esm/utils/graphlib.js.map +1 -0
- package/esm/utils/id.d.ts +26 -0
- package/esm/utils/id.js +37 -0
- package/esm/utils/id.js.map +1 -0
- package/esm/utils/is.d.ts +34 -0
- package/esm/utils/is.js +48 -0
- package/esm/utils/is.js.map +1 -0
- package/esm/utils/layout.d.ts +25 -0
- package/esm/utils/layout.js +38 -0
- package/esm/utils/layout.js.map +1 -0
- package/esm/utils/math.d.ts +10 -0
- package/esm/utils/math.js +13 -0
- package/esm/utils/math.js.map +1 -0
- package/esm/utils/padding.d.ts +9 -0
- package/esm/utils/padding.js +15 -0
- package/esm/utils/padding.js.map +1 -0
- package/esm/utils/palette.d.ts +33 -0
- package/esm/utils/palette.js +103 -0
- package/esm/utils/palette.js.map +1 -0
- package/esm/utils/placement.d.ts +9 -0
- package/esm/utils/placement.js +18 -0
- package/esm/utils/placement.js.map +1 -0
- package/esm/utils/point.d.ts +129 -0
- package/esm/utils/point.js +216 -0
- package/esm/utils/point.js.map +1 -0
- package/esm/utils/position.d.ts +37 -0
- package/esm/utils/position.js +51 -0
- package/esm/utils/position.js.map +1 -0
- package/esm/utils/prefix.d.ts +66 -0
- package/esm/utils/prefix.js +117 -0
- package/esm/utils/prefix.js.map +1 -0
- package/esm/utils/relation.d.ts +34 -0
- package/esm/utils/relation.js +72 -0
- package/esm/utils/relation.js.map +1 -0
- package/esm/utils/router/orth.d.ts +103 -0
- package/esm/utils/router/orth.js +280 -0
- package/esm/utils/router/orth.js.map +1 -0
- package/esm/utils/shape.d.ts +9 -0
- package/esm/utils/shape.js +22 -0
- package/esm/utils/shape.js.map +1 -0
- package/esm/utils/shortcut.d.ts +20 -0
- package/esm/utils/shortcut.js +56 -0
- package/esm/utils/shortcut.js.map +1 -0
- package/esm/utils/size.d.ts +7 -0
- package/esm/utils/size.js +13 -0
- package/esm/utils/size.js.map +1 -0
- package/esm/utils/style.d.ts +20 -0
- package/esm/utils/style.js +31 -0
- package/esm/utils/style.js.map +1 -0
- package/esm/utils/symbol.d.ts +30 -0
- package/esm/utils/symbol.js +61 -0
- package/esm/utils/symbol.js.map +1 -0
- package/esm/utils/text.d.ts +26 -0
- package/esm/utils/text.js +44 -0
- package/esm/utils/text.js.map +1 -0
- package/esm/utils/traverse.d.ts +23 -0
- package/esm/utils/traverse.js +44 -0
- package/esm/utils/traverse.js.map +1 -0
- package/esm/utils/tree.d.ts +17 -0
- package/esm/utils/tree.js +28 -0
- package/esm/utils/tree.js.map +1 -0
- package/esm/utils/vector.d.ts +142 -0
- package/esm/utils/vector.js +184 -0
- package/esm/utils/vector.js.map +1 -0
- package/esm/utils/visibility.d.ts +13 -0
- package/esm/utils/visibility.js +28 -0
- package/esm/utils/visibility.js.map +1 -0
- package/esm/utils/watermark.d.ts +18 -0
- package/esm/utils/watermark.js +73 -0
- package/esm/utils/watermark.js.map +1 -0
- package/lib/animations/executor.d.ts +12 -0
- package/lib/animations/executor.js +79 -0
- package/lib/animations/executor.js.map +1 -0
- package/lib/animations/index.d.ts +18 -0
- package/lib/animations/index.js +21 -0
- package/lib/animations/index.js.map +1 -0
- package/lib/animations/types.d.ts +56 -0
- package/lib/animations/types.js.map +1 -0
- package/lib/behaviors/base-behavior.d.ts +5 -0
- package/lib/behaviors/base-behavior.js +8 -0
- package/lib/behaviors/base-behavior.js.map +1 -0
- package/lib/behaviors/collapse-expand.d.ts +41 -0
- package/lib/behaviors/collapse-expand.js +58 -0
- package/lib/behaviors/collapse-expand.js.map +1 -0
- package/lib/behaviors/drag-canvas.d.ts +56 -0
- package/lib/behaviors/drag-canvas.js +65 -0
- package/lib/behaviors/drag-canvas.js.map +1 -0
- package/lib/behaviors/drag-element.d.ts +100 -0
- package/lib/behaviors/drag-element.js +206 -0
- package/lib/behaviors/drag-element.js.map +1 -0
- package/lib/behaviors/focus-element.d.ts +29 -0
- package/lib/behaviors/focus-element.js +61 -0
- package/lib/behaviors/focus-element.js.map +1 -0
- package/lib/behaviors/hover-element.d.ts +61 -0
- package/lib/behaviors/hover-element.js +89 -0
- package/lib/behaviors/hover-element.js.map +1 -0
- package/lib/behaviors/index.d.ts +14 -0
- package/lib/behaviors/index.js +18 -0
- package/lib/behaviors/index.js.map +1 -0
- package/lib/behaviors/types.d.ts +5 -0
- package/lib/behaviors/types.js.map +1 -0
- package/lib/behaviors/zoom-canvas.d.ts +70 -0
- package/lib/behaviors/zoom-canvas.js +85 -0
- package/lib/behaviors/zoom-canvas.js.map +1 -0
- package/lib/constants/animation.d.ts +2 -0
- package/lib/constants/animation.js +13 -0
- package/lib/constants/animation.js.map +1 -0
- package/lib/constants/change.d.ts +15 -0
- package/lib/constants/change.js +20 -0
- package/lib/constants/change.js.map +1 -0
- package/lib/constants/element.d.ts +6 -0
- package/lib/constants/element.js +10 -0
- package/lib/constants/element.js.map +1 -0
- package/lib/constants/events/animation.d.ts +7 -0
- package/lib/constants/events/animation.js +13 -0
- package/lib/constants/events/animation.js.map +1 -0
- package/lib/constants/events/canvas.d.ts +38 -0
- package/lib/constants/events/canvas.js +43 -0
- package/lib/constants/events/canvas.js.map +1 -0
- package/lib/constants/events/combo.d.ts +2 -0
- package/lib/constants/events/combo.js +6 -0
- package/lib/constants/events/combo.js.map +1 -0
- package/lib/constants/events/common.d.ts +42 -0
- package/lib/constants/events/common.js +47 -0
- package/lib/constants/events/common.js.map +1 -0
- package/lib/constants/events/container.d.ts +6 -0
- package/lib/constants/events/container.js +11 -0
- package/lib/constants/events/container.js.map +1 -0
- package/lib/constants/events/edge.d.ts +30 -0
- package/lib/constants/events/edge.js +35 -0
- package/lib/constants/events/edge.js.map +1 -0
- package/lib/constants/events/graph.d.ts +60 -0
- package/lib/constants/events/graph.js +67 -0
- package/lib/constants/events/graph.js.map +1 -0
- package/lib/constants/events/index.d.ts +8 -0
- package/lib/constants/events/index.js +20 -0
- package/lib/constants/events/index.js.map +1 -0
- package/lib/constants/events/node.d.ts +36 -0
- package/lib/constants/events/node.js +41 -0
- package/lib/constants/events/node.js.map +1 -0
- package/lib/constants/graphlib.d.ts +2 -0
- package/lib/constants/graphlib.js +6 -0
- package/lib/constants/graphlib.js.map +1 -0
- package/lib/constants/index.d.ts +4 -0
- package/lib/constants/index.js +21 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/elements/combos/base-combo.d.ts +47 -0
- package/lib/elements/combos/base-combo.js +136 -0
- package/lib/elements/combos/base-combo.js.map +1 -0
- package/lib/elements/combos/circle.d.ts +18 -0
- package/lib/elements/combos/circle.js +50 -0
- package/lib/elements/combos/circle.js.map +1 -0
- package/lib/elements/combos/index.d.ts +6 -0
- package/lib/elements/combos/index.js +10 -0
- package/lib/elements/combos/index.js.map +1 -0
- package/lib/elements/combos/rect.d.ts +15 -0
- package/lib/elements/combos/rect.js +31 -0
- package/lib/elements/combos/rect.js.map +1 -0
- package/lib/elements/edges/base-edge.d.ts +58 -0
- package/lib/elements/edges/base-edge.js +193 -0
- package/lib/elements/edges/base-edge.js.map +1 -0
- package/lib/elements/edges/cubic-horizontal.d.ts +21 -0
- package/lib/elements/edges/cubic-horizontal.js +23 -0
- package/lib/elements/edges/cubic-horizontal.js.map +1 -0
- package/lib/elements/edges/cubic-vertical.d.ts +21 -0
- package/lib/elements/edges/cubic-vertical.js +23 -0
- package/lib/elements/edges/cubic-vertical.js.map +1 -0
- package/lib/elements/edges/cubic.d.ts +30 -0
- package/lib/elements/edges/cubic.js +31 -0
- package/lib/elements/edges/cubic.js.map +1 -0
- package/lib/elements/edges/index.d.ts +14 -0
- package/lib/elements/edges/index.js +18 -0
- package/lib/elements/edges/index.js.map +1 -0
- package/lib/elements/edges/line.d.ts +15 -0
- package/lib/elements/edges/line.js +23 -0
- package/lib/elements/edges/line.js.map +1 -0
- package/lib/elements/edges/polyline.d.ts +42 -0
- package/lib/elements/edges/polyline.js +62 -0
- package/lib/elements/edges/polyline.js.map +1 -0
- package/lib/elements/edges/quadratic.d.ts +29 -0
- package/lib/elements/edges/quadratic.js +23 -0
- package/lib/elements/edges/quadratic.js.map +1 -0
- package/lib/elements/index.d.ts +3 -0
- package/lib/elements/index.js +20 -0
- package/lib/elements/index.js.map +1 -0
- package/lib/elements/nodes/base-node.d.ts +107 -0
- package/lib/elements/nodes/base-node.js +212 -0
- package/lib/elements/nodes/base-node.js.map +1 -0
- package/lib/elements/nodes/circle.d.ts +20 -0
- package/lib/elements/nodes/circle.js +38 -0
- package/lib/elements/nodes/circle.js.map +1 -0
- package/lib/elements/nodes/diamond.d.ts +15 -0
- package/lib/elements/nodes/diamond.js +25 -0
- package/lib/elements/nodes/diamond.js.map +1 -0
- package/lib/elements/nodes/ellipse.d.ts +17 -0
- package/lib/elements/nodes/ellipse.js +40 -0
- package/lib/elements/nodes/ellipse.js.map +1 -0
- package/lib/elements/nodes/hexagon.d.ts +21 -0
- package/lib/elements/nodes/hexagon.js +24 -0
- package/lib/elements/nodes/hexagon.js.map +1 -0
- package/lib/elements/nodes/image.d.ts +20 -0
- package/lib/elements/nodes/image.js +56 -0
- package/lib/elements/nodes/image.js.map +1 -0
- package/lib/elements/nodes/index.d.ts +18 -0
- package/lib/elements/nodes/index.js +22 -0
- package/lib/elements/nodes/index.js.map +1 -0
- package/lib/elements/nodes/polygon.d.ts +17 -0
- package/lib/elements/nodes/polygon.js +28 -0
- package/lib/elements/nodes/polygon.js.map +1 -0
- package/lib/elements/nodes/rect.d.ts +19 -0
- package/lib/elements/nodes/rect.js +43 -0
- package/lib/elements/nodes/rect.js.map +1 -0
- package/lib/elements/nodes/star.d.ts +24 -0
- package/lib/elements/nodes/star.js +33 -0
- package/lib/elements/nodes/star.js.map +1 -0
- package/lib/elements/nodes/triangle.d.ts +24 -0
- package/lib/elements/nodes/triangle.js +51 -0
- package/lib/elements/nodes/triangle.js.map +1 -0
- package/lib/elements/shapes/badge.d.ts +14 -0
- package/lib/elements/shapes/badge.js +29 -0
- package/lib/elements/shapes/badge.js.map +1 -0
- package/lib/elements/shapes/base-shape.d.ts +58 -0
- package/lib/elements/shapes/base-shape.js +119 -0
- package/lib/elements/shapes/base-shape.js.map +1 -0
- package/lib/elements/shapes/icon.d.ts +13 -0
- package/lib/elements/shapes/icon.js +35 -0
- package/lib/elements/shapes/icon.js.map +1 -0
- package/lib/elements/shapes/index.d.ts +13 -0
- package/lib/elements/shapes/index.js +17 -0
- package/lib/elements/shapes/index.js.map +1 -0
- package/lib/elements/shapes/label.d.ts +22 -0
- package/lib/elements/shapes/label.js +64 -0
- package/lib/elements/shapes/label.js.map +1 -0
- package/lib/elements/types.js +15 -0
- package/lib/elements/types.js.map +1 -0
- package/lib/exports.d.ts +32 -0
- package/lib/exports.js +46 -0
- package/lib/exports.js.map +1 -0
- package/lib/index.d.ts +3 -248
- package/lib/index.js +4 -27
- package/lib/index.js.map +1 -1
- package/lib/layouts/index.d.ts +3 -0
- package/lib/layouts/index.js +23 -0
- package/lib/layouts/index.js.map +1 -0
- package/lib/layouts/types.d.ts +77 -0
- package/lib/layouts/types.js.map +1 -0
- package/lib/palettes/index.d.ts +9 -0
- package/lib/palettes/index.js +55 -0
- package/lib/palettes/index.js.map +1 -0
- package/lib/palettes/types.d.ts +5 -0
- package/lib/palettes/types.js +3 -0
- package/lib/palettes/types.js.map +1 -0
- package/lib/plugins/base-plugin.d.ts +5 -0
- package/lib/plugins/base-plugin.js +8 -0
- package/lib/plugins/base-plugin.js.map +1 -0
- package/lib/plugins/contextmenu.d.ts +88 -0
- package/lib/plugins/contextmenu.js +126 -0
- package/lib/plugins/contextmenu.js.map +1 -0
- package/lib/plugins/grid-line.d.ts +30 -0
- package/lib/plugins/grid-line.js +63 -0
- package/lib/plugins/grid-line.js.map +1 -0
- package/lib/plugins/index.d.ts +12 -0
- package/lib/plugins/index.js +16 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/toolbar/index.d.ts +62 -0
- package/lib/plugins/toolbar/index.js +72 -0
- package/lib/plugins/toolbar/index.js.map +1 -0
- package/lib/plugins/toolbar/util.d.ts +34 -0
- package/lib/plugins/toolbar/util.js +92 -0
- package/lib/plugins/toolbar/util.js.map +1 -0
- package/lib/plugins/tooltip.d.ts +39 -0
- package/lib/plugins/tooltip.js +236 -0
- package/lib/plugins/tooltip.js.map +1 -0
- package/lib/plugins/types.d.ts +4 -0
- package/lib/plugins/types.js +3 -0
- package/lib/plugins/types.js.map +1 -0
- package/lib/plugins/watermark.d.ts +51 -0
- package/lib/plugins/watermark.js +57 -0
- package/lib/plugins/watermark.js.map +1 -0
- package/lib/preset.d.ts +1 -0
- package/lib/preset.js +10 -0
- package/lib/preset.js.map +1 -0
- package/lib/registry/build-in.d.ts +6 -0
- package/lib/registry/build-in.js +88 -0
- package/lib/registry/build-in.js.map +1 -0
- package/lib/registry/extension/index.d.ts +33 -0
- package/lib/registry/extension/index.js +89 -0
- package/lib/registry/extension/index.js.map +1 -0
- package/lib/registry/extension/types.d.ts +38 -0
- package/lib/registry/extension/types.js +3 -0
- package/lib/registry/extension/types.js.map +1 -0
- package/lib/registry/index.d.ts +57 -0
- package/lib/registry/index.js +101 -0
- package/lib/registry/index.js.map +1 -0
- package/lib/registry/types.d.ts +41 -0
- package/lib/registry/types.js +3 -0
- package/lib/registry/types.js.map +1 -0
- package/lib/runtime/behavior.d.ts +15 -0
- package/lib/runtime/behavior.js +110 -0
- package/lib/runtime/behavior.js.map +1 -0
- package/lib/runtime/canvas.d.ts +49 -0
- package/lib/runtime/canvas.js +201 -0
- package/lib/runtime/canvas.js.map +1 -0
- package/lib/runtime/data.d.ts +187 -0
- package/lib/runtime/data.js +675 -0
- package/lib/runtime/data.js.map +1 -0
- package/lib/runtime/element.d.ts +138 -0
- package/lib/runtime/element.js +590 -0
- package/lib/runtime/element.js.map +1 -0
- package/lib/runtime/graph.d.ts +364 -564
- package/lib/runtime/graph.js +609 -1547
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/index.d.ts +6 -0
- package/lib/runtime/index.js +8 -0
- package/lib/runtime/index.js.map +1 -0
- package/lib/runtime/layout.d.ts +49 -0
- package/lib/runtime/layout.js +337 -0
- package/lib/runtime/layout.js.map +1 -0
- package/lib/runtime/plugin.d.ts +9 -0
- package/lib/runtime/plugin.js +16 -0
- package/lib/runtime/plugin.js.map +1 -0
- package/lib/runtime/types.d.ts +69 -0
- package/lib/runtime/types.js +3 -0
- package/lib/runtime/types.js.map +1 -0
- package/lib/runtime/viewport.d.ts +59 -0
- package/lib/runtime/viewport.js +245 -0
- package/lib/runtime/viewport.js.map +1 -0
- package/lib/spec/behavior.d.ts +12 -0
- package/lib/spec/behavior.js +3 -0
- package/lib/spec/behavior.js.map +1 -0
- package/lib/spec/canvas.d.ts +42 -0
- package/lib/spec/canvas.js +3 -0
- package/lib/spec/canvas.js.map +1 -0
- package/lib/spec/data.d.ts +44 -0
- package/lib/spec/data.js +3 -0
- package/lib/spec/data.js.map +1 -0
- package/lib/spec/element/animation.d.ts +12 -0
- package/lib/spec/element/animation.js +3 -0
- package/lib/spec/element/animation.js.map +1 -0
- package/lib/spec/element/base.d.ts +6 -0
- package/lib/spec/element/base.js +3 -0
- package/lib/spec/element/base.js.map +1 -0
- package/lib/spec/element/combo.d.ts +48 -0
- package/lib/spec/element/combo.js.map +1 -0
- package/lib/spec/element/edge.d.ts +46 -0
- package/lib/spec/element/edge.js +3 -0
- package/lib/spec/element/edge.js.map +1 -0
- package/lib/spec/element/node.d.ts +48 -0
- package/lib/spec/element/node.js +3 -0
- package/lib/spec/element/node.js.map +1 -0
- package/lib/spec/element/palette.d.ts +53 -0
- package/lib/spec/element/palette.js +3 -0
- package/lib/spec/element/palette.js.map +1 -0
- package/lib/spec/index.d.ts +11 -0
- package/lib/spec/index.js +3 -0
- package/lib/spec/index.js.map +1 -0
- package/lib/spec/layout.d.ts +4 -0
- package/lib/spec/layout.js.map +1 -0
- package/lib/spec/plugin.d.ts +12 -0
- package/lib/spec/plugin.js +3 -0
- package/lib/spec/plugin.js.map +1 -0
- package/lib/spec/spec.d.ts +76 -0
- package/lib/spec/spec.js.map +1 -0
- package/lib/spec/theme.d.ts +10 -0
- package/lib/spec/theme.js +3 -0
- package/lib/spec/theme.js.map +1 -0
- package/lib/spec/viewport.d.ts +86 -0
- package/lib/spec/viewport.js +3 -0
- package/lib/spec/viewport.js.map +1 -0
- package/lib/themes/base.d.ts +27 -0
- package/lib/themes/base.js +208 -0
- package/lib/themes/base.js.map +1 -0
- package/lib/themes/dark.d.ts +2 -0
- package/lib/themes/dark.js +19 -0
- package/lib/themes/dark.js.map +1 -0
- package/lib/themes/index.d.ts +2 -0
- package/lib/themes/index.js +8 -0
- package/lib/themes/index.js.map +1 -0
- package/lib/themes/light.d.ts +2 -0
- package/lib/themes/light.js +19 -0
- package/lib/themes/light.js.map +1 -0
- package/lib/themes/types.d.ts +10 -0
- package/lib/themes/types.js +3 -0
- package/lib/themes/types.js.map +1 -0
- package/lib/types/anchor.d.ts +3 -0
- package/lib/types/anchor.js +3 -0
- package/lib/types/anchor.js.map +1 -0
- package/lib/types/animation.d.ts +6 -0
- package/lib/types/animation.js +3 -0
- package/lib/types/animation.js.map +1 -0
- package/lib/types/behavior.d.ts +5 -45
- package/lib/types/behavior.js +0 -15
- package/lib/types/behavior.js.map +1 -1
- package/lib/types/callable.d.ts +30 -0
- package/lib/types/callable.js +3 -0
- package/lib/types/callable.js.map +1 -0
- package/lib/types/canvas.d.ts +1 -0
- package/lib/types/canvas.js +3 -0
- package/lib/types/canvas.js.map +1 -0
- package/lib/types/change.d.ts +51 -0
- package/lib/types/change.js +3 -0
- package/lib/types/change.js.map +1 -0
- package/lib/types/data.d.ts +44 -27
- package/lib/types/edge.d.ts +24 -104
- package/lib/types/element.d.ts +149 -0
- package/lib/types/element.js +3 -0
- package/lib/types/element.js.map +1 -0
- package/lib/types/enum.d.ts +1 -0
- package/lib/types/enum.js +3 -0
- package/lib/types/enum.js.map +1 -0
- package/lib/types/event.d.ts +7 -38
- package/lib/types/event.js +0 -31
- package/lib/types/event.js.map +1 -1
- package/lib/types/graphlib.d.ts +16 -0
- package/lib/types/graphlib.js +3 -0
- package/lib/types/graphlib.js.map +1 -0
- package/lib/types/index.d.ts +24 -16
- package/lib/types/index.js +0 -4
- package/lib/types/index.js.map +1 -1
- package/lib/types/node.d.ts +15 -214
- package/lib/types/padding.d.ts +2 -0
- package/lib/types/padding.js +3 -0
- package/lib/types/padding.js.map +1 -0
- package/lib/types/placement.d.ts +5 -0
- package/lib/types/placement.js +3 -0
- package/lib/types/placement.js.map +1 -0
- package/lib/types/plugin.d.ts +5 -44
- package/lib/types/plugin.js +0 -54
- package/lib/types/plugin.js.map +1 -1
- package/lib/types/point.d.ts +2 -0
- package/lib/types/point.js +3 -0
- package/lib/types/point.js.map +1 -0
- package/lib/types/position.d.ts +2 -0
- package/lib/types/position.js +3 -0
- package/lib/types/position.js.map +1 -0
- package/lib/types/prefix.d.ts +7 -0
- package/lib/types/prefix.js +3 -0
- package/lib/types/prefix.js.map +1 -0
- package/lib/types/size.d.ts +3 -0
- package/lib/types/size.js +3 -0
- package/lib/types/size.js.map +1 -0
- package/lib/types/state.d.ts +1 -0
- package/lib/types/state.js +3 -0
- package/lib/types/state.js.map +1 -0
- package/lib/types/style.d.ts +11 -0
- package/lib/types/style.js +3 -0
- package/lib/types/style.js.map +1 -0
- package/lib/types/tree.d.ts +5 -0
- package/lib/types/tree.js +3 -0
- package/lib/types/tree.js.map +1 -0
- package/lib/types/vector.d.ts +2 -0
- package/lib/types/vector.js +3 -0
- package/lib/types/vector.js.map +1 -0
- package/lib/types/viewport.d.ts +38 -0
- package/lib/types/viewport.js +3 -0
- package/lib/types/viewport.js.map +1 -0
- package/lib/utils/anchor.d.ts +9 -0
- package/lib/utils/anchor.js +20 -0
- package/lib/utils/anchor.js.map +1 -0
- package/lib/utils/animation.d.ts +73 -0
- package/lib/utils/animation.js +218 -0
- package/lib/utils/animation.js.map +1 -0
- package/lib/utils/array.d.ts +9 -0
- package/lib/utils/array.js +20 -0
- package/lib/utils/array.js.map +1 -0
- package/lib/utils/bbox.d.ts +109 -0
- package/lib/utils/bbox.js +222 -0
- package/lib/utils/bbox.js.map +1 -0
- package/lib/utils/cache.d.ts +36 -0
- package/lib/utils/cache.js +60 -0
- package/lib/utils/cache.js.map +1 -0
- package/lib/utils/change.d.ts +9 -0
- package/lib/utils/change.js +60 -0
- package/lib/utils/change.js.map +1 -0
- package/lib/utils/combo.d.ts +33 -0
- package/lib/utils/combo.js +117 -0
- package/lib/utils/combo.js.map +1 -0
- package/lib/utils/contextmenu.d.ts +26 -0
- package/lib/utils/contextmenu.js +49 -0
- package/lib/utils/contextmenu.js.map +1 -0
- package/lib/utils/data.d.ts +34 -0
- package/lib/utils/data.js +65 -0
- package/lib/utils/data.js.map +1 -0
- package/lib/utils/diff.d.ts +15 -0
- package/lib/utils/diff.js +44 -0
- package/lib/utils/diff.js.map +1 -0
- package/lib/utils/dom.d.ts +23 -0
- package/lib/utils/dom.js +85 -0
- package/lib/utils/dom.js.map +1 -0
- package/lib/utils/edge.d.ts +158 -0
- package/lib/utils/edge.js +481 -0
- package/lib/utils/edge.js.map +1 -0
- package/lib/utils/element.d.ts +208 -0
- package/lib/utils/element.js +457 -0
- package/lib/utils/element.js.map +1 -0
- package/lib/utils/event/events.d.ts +31 -0
- package/lib/utils/event/events.js +55 -0
- package/lib/utils/event/events.js.map +1 -0
- package/lib/utils/event/index.d.ts +29 -0
- package/lib/utils/event/index.js +64 -0
- package/lib/utils/event/index.js.map +1 -0
- package/lib/utils/extension.d.ts +10 -0
- package/lib/utils/extension.js +29 -0
- package/lib/utils/extension.js.map +1 -0
- package/lib/utils/graphlib.d.ts +14 -0
- package/lib/utils/graphlib.js +50 -0
- package/lib/utils/graphlib.js.map +1 -0
- package/lib/utils/id.d.ts +26 -0
- package/lib/utils/id.js +43 -0
- package/lib/utils/id.js.map +1 -0
- package/lib/utils/is.d.ts +34 -0
- package/lib/utils/is.js +55 -0
- package/lib/utils/is.js.map +1 -0
- package/lib/utils/layout.d.ts +25 -0
- package/lib/utils/layout.js +44 -0
- package/lib/utils/layout.js.map +1 -0
- package/lib/utils/math.d.ts +10 -0
- package/lib/utils/math.js +17 -0
- package/lib/utils/math.js.map +1 -0
- package/lib/utils/padding.d.ts +9 -0
- package/lib/utils/padding.js +19 -0
- package/lib/utils/padding.js.map +1 -0
- package/lib/utils/palette.d.ts +33 -0
- package/lib/utils/palette.js +109 -0
- package/lib/utils/palette.js.map +1 -0
- package/lib/utils/placement.d.ts +9 -0
- package/lib/utils/placement.js +22 -0
- package/lib/utils/placement.js.map +1 -0
- package/lib/utils/point.d.ts +129 -0
- package/lib/utils/point.js +233 -0
- package/lib/utils/point.js.map +1 -0
- package/lib/utils/position.d.ts +37 -0
- package/lib/utils/position.js +58 -0
- package/lib/utils/position.js.map +1 -0
- package/lib/utils/prefix.d.ts +66 -0
- package/lib/utils/prefix.js +127 -0
- package/lib/utils/prefix.js.map +1 -0
- package/lib/utils/relation.d.ts +34 -0
- package/lib/utils/relation.js +77 -0
- package/lib/utils/relation.js.map +1 -0
- package/lib/utils/router/orth.d.ts +103 -0
- package/lib/utils/router/orth.js +292 -0
- package/lib/utils/router/orth.js.map +1 -0
- package/lib/utils/shape.d.ts +9 -0
- package/lib/utils/shape.js +26 -0
- package/lib/utils/shape.js.map +1 -0
- package/lib/utils/shortcut.d.ts +20 -0
- package/lib/utils/shortcut.js +60 -0
- package/lib/utils/shortcut.js.map +1 -0
- package/lib/utils/size.d.ts +7 -0
- package/lib/utils/size.js +17 -0
- package/lib/utils/size.js.map +1 -0
- package/lib/utils/style.d.ts +20 -0
- package/lib/utils/style.js +36 -0
- package/lib/utils/style.js.map +1 -0
- package/lib/utils/symbol.d.ts +30 -0
- package/lib/utils/symbol.js +71 -0
- package/lib/utils/symbol.js.map +1 -0
- package/lib/utils/text.d.ts +26 -0
- package/lib/utils/text.js +50 -0
- package/lib/utils/text.js.map +1 -0
- package/lib/utils/traverse.d.ts +23 -0
- package/lib/utils/traverse.js +49 -0
- package/lib/utils/traverse.js.map +1 -0
- package/lib/utils/tree.d.ts +17 -0
- package/lib/utils/tree.js +32 -0
- package/lib/utils/tree.js.map +1 -0
- package/lib/utils/vector.d.ts +142 -0
- package/lib/utils/vector.js +203 -0
- package/lib/utils/vector.js.map +1 -0
- package/lib/utils/visibility.d.ts +13 -0
- package/lib/utils/visibility.js +32 -0
- package/lib/utils/visibility.js.map +1 -0
- package/lib/utils/watermark.d.ts +18 -0
- package/lib/utils/watermark.js +78 -0
- package/lib/utils/watermark.js.map +1 -0
- package/package.json +47 -94
- package/src/animations/executor.ts +95 -0
- package/src/animations/index.ts +19 -0
- package/src/animations/types.ts +68 -0
- package/src/behaviors/base-behavior.ts +6 -0
- package/src/behaviors/collapse-expand.ts +91 -0
- package/src/behaviors/drag-canvas.ts +114 -0
- package/src/behaviors/drag-element.ts +301 -0
- package/src/behaviors/focus-element.ts +89 -0
- package/src/behaviors/hover-element.ts +147 -0
- package/src/behaviors/index.ts +15 -0
- package/src/behaviors/types.ts +6 -0
- package/src/behaviors/zoom-canvas.ts +148 -0
- package/src/constants/animation.ts +10 -0
- package/src/constants/change.ts +16 -0
- package/src/constants/element.ts +7 -0
- package/src/constants/events/animation.ts +8 -0
- package/src/constants/events/canvas.ts +38 -0
- package/src/constants/events/combo.ts +3 -0
- package/src/constants/events/common.ts +42 -0
- package/src/constants/events/container.ts +6 -0
- package/src/constants/events/edge.ts +30 -0
- package/src/constants/events/graph.ts +62 -0
- package/src/constants/events/index.ts +8 -0
- package/src/constants/events/node.ts +36 -0
- package/src/constants/graphlib.ts +3 -0
- package/src/constants/index.ts +4 -0
- package/src/elements/combos/base-combo.ts +186 -0
- package/src/elements/combos/circle.ts +66 -0
- package/src/elements/combos/index.ts +7 -0
- package/src/elements/combos/rect.ts +38 -0
- package/src/elements/edges/base-edge.ts +277 -0
- package/src/elements/edges/cubic-horizontal.ts +42 -0
- package/src/elements/edges/cubic-vertical.ts +42 -0
- package/src/elements/edges/cubic.ts +68 -0
- package/src/elements/edges/index.ts +15 -0
- package/src/elements/edges/line.ts +28 -0
- package/src/elements/edges/polyline.ts +118 -0
- package/src/elements/edges/quadratic.ts +46 -0
- package/src/elements/index.ts +3 -0
- package/src/elements/nodes/base-node.ts +338 -0
- package/src/elements/nodes/circle.ts +47 -0
- package/src/elements/nodes/diamond.ts +30 -0
- package/src/elements/nodes/ellipse.ts +50 -0
- package/src/elements/nodes/hexagon.ts +37 -0
- package/src/elements/nodes/image.ts +68 -0
- package/src/elements/nodes/index.ts +19 -0
- package/src/elements/nodes/polygon.ts +36 -0
- package/src/elements/nodes/rect.ts +51 -0
- package/src/elements/nodes/star.ts +49 -0
- package/src/elements/nodes/triangle.ts +69 -0
- package/src/elements/shapes/badge.ts +35 -0
- package/src/elements/shapes/base-shape.ts +157 -0
- package/src/elements/shapes/icon.ts +41 -0
- package/src/elements/shapes/index.ts +15 -0
- package/src/elements/shapes/label.ts +86 -0
- package/src/elements/types.ts +21 -0
- package/src/exports.ts +53 -0
- package/src/index.ts +3 -23
- package/src/layouts/hierarchy.d.ts +10 -0
- package/src/layouts/index.ts +16 -0
- package/src/layouts/types.ts +119 -0
- package/src/palettes/index.ts +54 -0
- package/src/palettes/types.ts +9 -0
- package/src/plugins/base-plugin.ts +6 -0
- package/src/plugins/contextmenu.ts +198 -0
- package/src/plugins/grid-line.ts +91 -0
- package/src/plugins/index.ts +13 -0
- package/src/plugins/toolbar/index.ts +125 -0
- package/src/plugins/toolbar/util.ts +117 -0
- package/src/plugins/tooltip.ts +268 -0
- package/src/plugins/types.ts +5 -0
- package/src/plugins/watermark.ts +98 -0
- package/src/preset.ts +9 -0
- package/src/registry/build-in.ts +121 -0
- package/src/registry/extension/index.ts +112 -0
- package/src/registry/extension/types.ts +45 -0
- package/src/registry/index.ts +103 -0
- package/src/registry/types.ts +31 -0
- package/src/runtime/behavior.ts +122 -0
- package/src/runtime/canvas.ts +271 -0
- package/src/runtime/data.ts +766 -0
- package/src/runtime/element.ts +771 -0
- package/src/runtime/graph.ts +767 -1957
- package/src/runtime/index.ts +7 -0
- package/src/runtime/layout.ts +406 -0
- package/src/runtime/plugin.ts +17 -0
- package/src/runtime/types.ts +70 -0
- package/src/runtime/viewport.ts +283 -0
- package/src/spec/behavior.ts +15 -0
- package/src/spec/canvas.ts +43 -0
- package/src/spec/data.ts +48 -0
- package/src/spec/element/animation.ts +16 -0
- package/src/spec/element/base.ts +6 -0
- package/src/spec/element/combo.ts +51 -0
- package/src/spec/element/edge.ts +49 -0
- package/src/spec/element/node.ts +51 -0
- package/src/spec/element/palette.ts +57 -0
- package/src/spec/index.ts +11 -0
- package/src/spec/layout.ts +7 -0
- package/src/spec/plugin.ts +15 -0
- package/src/spec/spec.ts +78 -0
- package/src/spec/theme.ts +11 -0
- package/src/spec/viewport.ts +85 -0
- package/src/themes/base.ts +243 -0
- package/src/themes/dark.ts +18 -0
- package/src/themes/index.ts +2 -0
- package/src/themes/light.ts +18 -0
- package/src/themes/types.ts +12 -0
- package/src/types/anchor.ts +5 -0
- package/src/types/animation.ts +9 -0
- package/src/types/behavior.ts +5 -47
- package/src/types/callable.ts +33 -0
- package/src/types/canvas.ts +1 -0
- package/src/types/change.ts +64 -0
- package/src/types/data.ts +53 -56
- package/src/types/edge.ts +27 -131
- package/src/types/element.ts +163 -0
- package/src/types/enum.ts +1 -0
- package/src/types/event.ts +7 -44
- package/src/types/graphlib.ts +28 -0
- package/src/types/index.ts +24 -54
- package/src/types/node.ts +14 -238
- package/src/types/padding.ts +3 -0
- package/src/types/placement.ts +17 -0
- package/src/types/plugin.ts +5 -82
- package/src/types/point.ts +3 -0
- package/src/types/position.ts +3 -0
- package/src/types/prefix.ts +9 -0
- package/src/types/size.ts +5 -0
- package/src/types/state.ts +1 -0
- package/src/types/style.ts +12 -0
- package/src/types/tree.ts +5 -0
- package/src/types/vector.ts +3 -0
- package/src/types/viewport.ts +43 -0
- package/src/utils/anchor.ts +19 -0
- package/src/utils/animation.ts +236 -0
- package/src/utils/array.ts +15 -0
- package/src/utils/bbox.ts +229 -0
- package/src/utils/cache.ts +58 -0
- package/src/utils/change.ts +56 -0
- package/src/utils/combo.ts +133 -0
- package/src/utils/contextmenu.ts +62 -0
- package/src/utils/data.ts +64 -0
- package/src/utils/diff.ts +43 -0
- package/src/utils/dom.ts +102 -0
- package/src/utils/edge.ts +548 -0
- package/src/utils/element.ts +479 -0
- package/src/utils/event/events.ts +70 -0
- package/src/utils/event/index.ts +50 -0
- package/src/utils/extension.ts +26 -0
- package/src/utils/graphlib.ts +54 -0
- package/src/utils/id.ts +40 -0
- package/src/utils/is.ts +53 -0
- package/src/utils/layout.ts +39 -0
- package/src/utils/math.ts +12 -0
- package/src/utils/padding.ts +16 -0
- package/src/utils/palette.ts +118 -0
- package/src/utils/placement.ts +19 -0
- package/src/utils/point.ts +238 -0
- package/src/utils/position.ts +56 -0
- package/src/utils/prefix.ts +126 -0
- package/src/utils/relation.ts +84 -0
- package/src/utils/router/orth.ts +323 -0
- package/src/utils/shape.ts +26 -0
- package/src/utils/shortcut.ts +77 -0
- package/src/utils/size.ts +13 -0
- package/src/utils/style.ts +38 -0
- package/src/utils/symbol.ts +72 -0
- package/src/utils/text.ts +51 -0
- package/src/utils/traverse.ts +59 -0
- package/src/utils/tree.ts +47 -0
- package/src/utils/vector.ts +201 -0
- package/src/utils/visibility.ts +31 -0
- package/src/utils/watermark.ts +93 -0
- package/esm/api-doc/behaviors.d.ts +0 -2
- package/esm/api-doc/behaviors.js +0 -2
- package/esm/api-doc/behaviors.js.map +0 -1
- package/esm/api-doc/graph.d.ts +0 -4
- package/esm/api-doc/graph.js +0 -4
- package/esm/api-doc/graph.js.map +0 -1
- package/esm/api-doc/item.d.ts +0 -11
- package/esm/api-doc/item.js +0 -5
- package/esm/api-doc/item.js.map +0 -1
- package/esm/api-doc/layout.d.ts +0 -1
- package/esm/api-doc/layout.js.map +0 -1
- package/esm/api-doc/plugins.d.ts +0 -1
- package/esm/api-doc/plugins.js +0 -2
- package/esm/api-doc/plugins.js.map +0 -1
- package/esm/api-doc/types.js +0 -3
- package/esm/api-doc/types.js.map +0 -1
- package/esm/api-doc/util.d.ts +0 -3
- package/esm/api-doc/util.js +0 -4
- package/esm/api-doc/util.js.map +0 -1
- package/esm/constant/index.d.ts +0 -1
- package/esm/constant/index.js +0 -2
- package/esm/constant/index.js.map +0 -1
- package/esm/constant/shape.d.ts +0 -21
- package/esm/constant/shape.js +0 -27
- package/esm/constant/shape.js.map +0 -1
- package/esm/item/combo.d.ts +0 -81
- package/esm/item/combo.js +0 -188
- package/esm/item/combo.js.map +0 -1
- package/esm/item/edge.d.ts +0 -57
- package/esm/item/edge.js +0 -142
- package/esm/item/edge.js.map +0 -1
- package/esm/item/item.d.ts +0 -191
- package/esm/item/item.js +0 -701
- package/esm/item/item.js.map +0 -1
- package/esm/item/node.d.ts +0 -63
- package/esm/item/node.js +0 -190
- package/esm/item/node.js.map +0 -1
- package/esm/runtime/controller/data.d.ts +0 -89
- package/esm/runtime/controller/data.js +0 -878
- package/esm/runtime/controller/data.js.map +0 -1
- package/esm/runtime/controller/extension.d.ts +0 -9
- package/esm/runtime/controller/extension.js +0 -11
- package/esm/runtime/controller/extension.js.map +0 -1
- package/esm/runtime/controller/index.d.ts +0 -7
- package/esm/runtime/controller/index.js +0 -8
- package/esm/runtime/controller/index.js.map +0 -1
- package/esm/runtime/controller/interaction.d.ts +0 -52
- package/esm/runtime/controller/interaction.js +0 -274
- package/esm/runtime/controller/interaction.js.map +0 -1
- package/esm/runtime/controller/item.d.ts +0 -143
- package/esm/runtime/controller/item.js +0 -1141
- package/esm/runtime/controller/item.js.map +0 -1
- package/esm/runtime/controller/layout.d.ts +0 -33
- package/esm/runtime/controller/layout.js +0 -300
- package/esm/runtime/controller/layout.js.map +0 -1
- package/esm/runtime/controller/plugin.d.ts +0 -45
- package/esm/runtime/controller/plugin.js +0 -173
- package/esm/runtime/controller/plugin.js.map +0 -1
- package/esm/runtime/controller/theme.d.ts +0 -29
- package/esm/runtime/controller/theme.js +0 -58
- package/esm/runtime/controller/theme.js.map +0 -1
- package/esm/runtime/controller/viewport.d.ts +0 -11
- package/esm/runtime/controller/viewport.js +0 -102
- package/esm/runtime/controller/viewport.js.map +0 -1
- package/esm/runtime/hooks.d.ts +0 -33
- package/esm/runtime/hooks.js +0 -74
- package/esm/runtime/hooks.js.map +0 -1
- package/esm/stdlib/behavior/activate-relations.d.ts +0 -61
- package/esm/stdlib/behavior/activate-relations.js +0 -85
- package/esm/stdlib/behavior/activate-relations.js.map +0 -1
- package/esm/stdlib/behavior/brush-select.d.ts +0 -109
- package/esm/stdlib/behavior/brush-select.js +0 -268
- package/esm/stdlib/behavior/brush-select.js.map +0 -1
- package/esm/stdlib/behavior/click-select.d.ts +0 -73
- package/esm/stdlib/behavior/click-select.js +0 -157
- package/esm/stdlib/behavior/click-select.js.map +0 -1
- package/esm/stdlib/behavior/collapse-expand-combo.d.ts +0 -28
- package/esm/stdlib/behavior/collapse-expand-combo.js +0 -35
- package/esm/stdlib/behavior/collapse-expand-combo.js.map +0 -1
- package/esm/stdlib/behavior/collapse-expand-tree.d.ts +0 -44
- package/esm/stdlib/behavior/collapse-expand-tree.js +0 -69
- package/esm/stdlib/behavior/collapse-expand-tree.js.map +0 -1
- package/esm/stdlib/behavior/drag-canvas.d.ts +0 -81
- package/esm/stdlib/behavior/drag-canvas.js +0 -250
- package/esm/stdlib/behavior/drag-canvas.js.map +0 -1
- package/esm/stdlib/behavior/drag-combo.d.ts +0 -111
- package/esm/stdlib/behavior/drag-combo.js +0 -380
- package/esm/stdlib/behavior/drag-combo.js.map +0 -1
- package/esm/stdlib/behavior/drag-node.d.ts +0 -100
- package/esm/stdlib/behavior/drag-node.js +0 -439
- package/esm/stdlib/behavior/drag-node.js.map +0 -1
- package/esm/stdlib/behavior/hover-activate.d.ts +0 -42
- package/esm/stdlib/behavior/hover-activate.js +0 -64
- package/esm/stdlib/behavior/hover-activate.js.map +0 -1
- package/esm/stdlib/behavior/index.d.ts +0 -16
- package/esm/stdlib/behavior/index.js +0 -17
- package/esm/stdlib/behavior/index.js.map +0 -1
- package/esm/stdlib/behavior/lasso-select.d.ts +0 -31
- package/esm/stdlib/behavior/lasso-select.js +0 -79
- package/esm/stdlib/behavior/lasso-select.js.map +0 -1
- package/esm/stdlib/behavior/orbit-canvas-3d.d.ts +0 -36
- package/esm/stdlib/behavior/orbit-canvas-3d.js +0 -62
- package/esm/stdlib/behavior/orbit-canvas-3d.js.map +0 -1
- package/esm/stdlib/behavior/rotate-canvas-3d.d.ts +0 -60
- package/esm/stdlib/behavior/rotate-canvas-3d.js +0 -123
- package/esm/stdlib/behavior/rotate-canvas-3d.js.map +0 -1
- package/esm/stdlib/behavior/shortcuts-call.d.ts +0 -38
- package/esm/stdlib/behavior/shortcuts-call.js +0 -80
- package/esm/stdlib/behavior/shortcuts-call.js.map +0 -1
- package/esm/stdlib/behavior/track-canvas-3d.d.ts +0 -36
- package/esm/stdlib/behavior/track-canvas-3d.js +0 -62
- package/esm/stdlib/behavior/track-canvas-3d.js.map +0 -1
- package/esm/stdlib/behavior/types.d.ts +0 -13
- package/esm/stdlib/behavior/types.js.map +0 -1
- package/esm/stdlib/behavior/zoom-canvas-3d.d.ts +0 -58
- package/esm/stdlib/behavior/zoom-canvas-3d.js +0 -98
- package/esm/stdlib/behavior/zoom-canvas-3d.js.map +0 -1
- package/esm/stdlib/behavior/zoom-canvas.d.ts +0 -68
- package/esm/stdlib/behavior/zoom-canvas.js +0 -169
- package/esm/stdlib/behavior/zoom-canvas.js.map +0 -1
- package/esm/stdlib/data/index.d.ts +0 -3
- package/esm/stdlib/data/index.js +0 -4
- package/esm/stdlib/data/index.js.map +0 -1
- package/esm/stdlib/data/mapNodeSize.d.ts +0 -12
- package/esm/stdlib/data/mapNodeSize.js +0 -43
- package/esm/stdlib/data/mapNodeSize.js.map +0 -1
- package/esm/stdlib/data/transformV4Data.d.ts +0 -9
- package/esm/stdlib/data/transformV4Data.js +0 -142
- package/esm/stdlib/data/transformV4Data.js.map +0 -1
- package/esm/stdlib/data/validateData.d.ts +0 -9
- package/esm/stdlib/data/validateData.js +0 -103
- package/esm/stdlib/data/validateData.js.map +0 -1
- package/esm/stdlib/index.d.ts +0 -149
- package/esm/stdlib/index.js +0 -204
- package/esm/stdlib/index.js.map +0 -1
- package/esm/stdlib/item/combo/circle.d.ts +0 -29
- package/esm/stdlib/item/combo/circle.js +0 -56
- package/esm/stdlib/item/combo/circle.js.map +0 -1
- package/esm/stdlib/item/combo/index.d.ts +0 -2
- package/esm/stdlib/item/combo/index.js +0 -3
- package/esm/stdlib/item/combo/index.js.map +0 -1
- package/esm/stdlib/item/combo/rect.d.ts +0 -31
- package/esm/stdlib/item/combo/rect.js +0 -65
- package/esm/stdlib/item/combo/rect.js.map +0 -1
- package/esm/stdlib/item/edge/base.d.ts +0 -210
- package/esm/stdlib/item/edge/base.js +0 -444
- package/esm/stdlib/item/edge/base.js.map +0 -1
- package/esm/stdlib/item/edge/cubic-horizontal.d.ts +0 -36
- package/esm/stdlib/item/edge/cubic-horizontal.js +0 -56
- package/esm/stdlib/item/edge/cubic-horizontal.js.map +0 -1
- package/esm/stdlib/item/edge/cubic-vertical.d.ts +0 -36
- package/esm/stdlib/item/edge/cubic-vertical.js +0 -56
- package/esm/stdlib/item/edge/cubic-vertical.js.map +0 -1
- package/esm/stdlib/item/edge/cubic.d.ts +0 -59
- package/esm/stdlib/item/edge/cubic.js +0 -116
- package/esm/stdlib/item/edge/cubic.js.map +0 -1
- package/esm/stdlib/item/edge/index.d.ts +0 -7
- package/esm/stdlib/item/edge/index.js +0 -8
- package/esm/stdlib/item/edge/index.js.map +0 -1
- package/esm/stdlib/item/edge/line.d.ts +0 -33
- package/esm/stdlib/item/edge/line.js +0 -63
- package/esm/stdlib/item/edge/line.js.map +0 -1
- package/esm/stdlib/item/edge/loop.d.ts +0 -32
- package/esm/stdlib/item/edge/loop.js +0 -115
- package/esm/stdlib/item/edge/loop.js.map +0 -1
- package/esm/stdlib/item/edge/polyline.d.ts +0 -45
- package/esm/stdlib/item/edge/polyline.js +0 -92
- package/esm/stdlib/item/edge/polyline.js.map +0 -1
- package/esm/stdlib/item/edge/quadratic.d.ts +0 -40
- package/esm/stdlib/item/edge/quadratic.js +0 -78
- package/esm/stdlib/item/edge/quadratic.js.map +0 -1
- package/esm/stdlib/item/node/base.d.ts +0 -256
- package/esm/stdlib/item/node/base.js +0 -603
- package/esm/stdlib/item/node/base.js.map +0 -1
- package/esm/stdlib/item/node/base3d.d.ts +0 -96
- package/esm/stdlib/item/node/base3d.js +0 -129
- package/esm/stdlib/item/node/base3d.js.map +0 -1
- package/esm/stdlib/item/node/circle.d.ts +0 -30
- package/esm/stdlib/item/node/circle.js +0 -56
- package/esm/stdlib/item/node/circle.js.map +0 -1
- package/esm/stdlib/item/node/diamond.d.ts +0 -32
- package/esm/stdlib/item/node/diamond.js +0 -79
- package/esm/stdlib/item/node/diamond.js.map +0 -1
- package/esm/stdlib/item/node/donut.d.ts +0 -70
- package/esm/stdlib/item/node/donut.js +0 -207
- package/esm/stdlib/item/node/donut.js.map +0 -1
- package/esm/stdlib/item/node/ellipse.d.ts +0 -32
- package/esm/stdlib/item/node/ellipse.js +0 -71
- package/esm/stdlib/item/node/ellipse.js.map +0 -1
- package/esm/stdlib/item/node/hexagon.d.ts +0 -33
- package/esm/stdlib/item/node/hexagon.js +0 -105
- package/esm/stdlib/item/node/hexagon.js.map +0 -1
- package/esm/stdlib/item/node/index.d.ts +0 -10
- package/esm/stdlib/item/node/index.js +0 -11
- package/esm/stdlib/item/node/index.js.map +0 -1
- package/esm/stdlib/item/node/modelRect.d.ts +0 -61
- package/esm/stdlib/item/node/modelRect.js +0 -186
- package/esm/stdlib/item/node/modelRect.js.map +0 -1
- package/esm/stdlib/item/node/rect.d.ts +0 -32
- package/esm/stdlib/item/node/rect.js +0 -75
- package/esm/stdlib/item/node/rect.js.map +0 -1
- package/esm/stdlib/item/node/sphere.d.ts +0 -33
- package/esm/stdlib/item/node/sphere.js +0 -52
- package/esm/stdlib/item/node/sphere.js.map +0 -1
- package/esm/stdlib/item/node/star.d.ts +0 -34
- package/esm/stdlib/item/node/star.js +0 -115
- package/esm/stdlib/item/node/star.js.map +0 -1
- package/esm/stdlib/item/node/triangle.d.ts +0 -44
- package/esm/stdlib/item/node/triangle.js +0 -177
- package/esm/stdlib/item/node/triangle.js.map +0 -1
- package/esm/stdlib/plugin/fisheye/index.d.ts +0 -130
- package/esm/stdlib/plugin/fisheye/index.js +0 -488
- package/esm/stdlib/plugin/fisheye/index.js.map +0 -1
- package/esm/stdlib/plugin/grid/index.d.ts +0 -36
- package/esm/stdlib/plugin/grid/index.js +0 -81
- package/esm/stdlib/plugin/grid/index.js.map +0 -1
- package/esm/stdlib/plugin/history/combo-command.d.ts +0 -9
- package/esm/stdlib/plugin/history/combo-command.js +0 -21
- package/esm/stdlib/plugin/history/combo-command.js.map +0 -1
- package/esm/stdlib/plugin/history/command.d.ts +0 -18
- package/esm/stdlib/plugin/history/command.js +0 -51
- package/esm/stdlib/plugin/history/command.js.map +0 -1
- package/esm/stdlib/plugin/history/index.d.ts +0 -112
- package/esm/stdlib/plugin/history/index.js +0 -275
- package/esm/stdlib/plugin/history/index.js.map +0 -1
- package/esm/stdlib/plugin/history/item-data-command.d.ts +0 -14
- package/esm/stdlib/plugin/history/item-data-command.js +0 -63
- package/esm/stdlib/plugin/history/item-data-command.js.map +0 -1
- package/esm/stdlib/plugin/history/layer-updated-command.d.ts +0 -9
- package/esm/stdlib/plugin/history/layer-updated-command.js +0 -21
- package/esm/stdlib/plugin/history/layer-updated-command.js.map +0 -1
- package/esm/stdlib/plugin/history/state-updated-command.d.ts +0 -9
- package/esm/stdlib/plugin/history/state-updated-command.js +0 -20
- package/esm/stdlib/plugin/history/state-updated-command.js.map +0 -1
- package/esm/stdlib/plugin/history/visibility-updated-command.d.ts +0 -10
- package/esm/stdlib/plugin/history/visibility-updated-command.js +0 -23
- package/esm/stdlib/plugin/history/visibility-updated-command.js.map +0 -1
- package/esm/stdlib/plugin/hull/bubbleset.d.ts +0 -9
- package/esm/stdlib/plugin/hull/bubbleset.js +0 -592
- package/esm/stdlib/plugin/hull/bubbleset.js.map +0 -1
- package/esm/stdlib/plugin/hull/convexHull.d.ts +0 -14
- package/esm/stdlib/plugin/hull/convexHull.js +0 -56
- package/esm/stdlib/plugin/hull/convexHull.js.map +0 -1
- package/esm/stdlib/plugin/hull/hullComponent.d.ts +0 -87
- package/esm/stdlib/plugin/hull/hullComponent.js +0 -382
- package/esm/stdlib/plugin/hull/hullComponent.js.map +0 -1
- package/esm/stdlib/plugin/hull/index.d.ts +0 -59
- package/esm/stdlib/plugin/hull/index.js +0 -161
- package/esm/stdlib/plugin/hull/index.js.map +0 -1
- package/esm/stdlib/plugin/hull/types.d.ts +0 -15
- package/esm/stdlib/plugin/hull/types.js.map +0 -1
- package/esm/stdlib/plugin/hull/util.d.ts +0 -77
- package/esm/stdlib/plugin/hull/util.js +0 -401
- package/esm/stdlib/plugin/hull/util.js.map +0 -1
- package/esm/stdlib/plugin/index.d.ts +0 -9
- package/esm/stdlib/plugin/index.js +0 -10
- package/esm/stdlib/plugin/index.js.map +0 -1
- package/esm/stdlib/plugin/legend/index.d.ts +0 -163
- package/esm/stdlib/plugin/legend/index.js +0 -594
- package/esm/stdlib/plugin/legend/index.js.map +0 -1
- package/esm/stdlib/plugin/menu/index.d.ts +0 -55
- package/esm/stdlib/plugin/menu/index.js +0 -237
- package/esm/stdlib/plugin/menu/index.js.map +0 -1
- package/esm/stdlib/plugin/minimap/index.d.ts +0 -114
- package/esm/stdlib/plugin/minimap/index.js +0 -576
- package/esm/stdlib/plugin/minimap/index.js.map +0 -1
- package/esm/stdlib/plugin/timebar/index.d.ts +0 -98
- package/esm/stdlib/plugin/timebar/index.js +0 -303
- package/esm/stdlib/plugin/timebar/index.js.map +0 -1
- package/esm/stdlib/plugin/toolbar/index.d.ts +0 -59
- package/esm/stdlib/plugin/toolbar/index.js +0 -215
- package/esm/stdlib/plugin/toolbar/index.js.map +0 -1
- package/esm/stdlib/plugin/tooltip/index.d.ts +0 -96
- package/esm/stdlib/plugin/tooltip/index.js +0 -378
- package/esm/stdlib/plugin/tooltip/index.js.map +0 -1
- package/esm/stdlib/plugin/types.d.ts +0 -9
- package/esm/stdlib/plugin/types.js.map +0 -1
- package/esm/stdlib/selector/lasso.d.ts +0 -15
- package/esm/stdlib/selector/lasso.js +0 -61
- package/esm/stdlib/selector/lasso.js.map +0 -1
- package/esm/stdlib/selector/rect.d.ts +0 -16
- package/esm/stdlib/selector/rect.js +0 -54
- package/esm/stdlib/selector/rect.js.map +0 -1
- package/esm/stdlib/theme/dark.d.ts +0 -2
- package/esm/stdlib/theme/dark.js +0 -292
- package/esm/stdlib/theme/dark.js.map +0 -1
- package/esm/stdlib/theme/index.d.ts +0 -2
- package/esm/stdlib/theme/index.js +0 -3
- package/esm/stdlib/theme/index.js.map +0 -1
- package/esm/stdlib/theme/light.d.ts +0 -2
- package/esm/stdlib/theme/light.js +0 -330
- package/esm/stdlib/theme/light.js.map +0 -1
- package/esm/stdlib/themeSolver/base.d.ts +0 -15
- package/esm/stdlib/themeSolver/base.js +0 -11
- package/esm/stdlib/themeSolver/base.js.map +0 -1
- package/esm/stdlib/themeSolver/index.d.ts +0 -3
- package/esm/stdlib/themeSolver/index.js +0 -4
- package/esm/stdlib/themeSolver/index.js.map +0 -1
- package/esm/stdlib/themeSolver/spec.d.ts +0 -35
- package/esm/stdlib/themeSolver/spec.js +0 -66
- package/esm/stdlib/themeSolver/spec.js.map +0 -1
- package/esm/stdlib/themeSolver/subject.d.ts +0 -41
- package/esm/stdlib/themeSolver/subject.js +0 -396
- package/esm/stdlib/themeSolver/subject.js.map +0 -1
- package/esm/types/animate.d.ts +0 -59
- package/esm/types/animate.js +0 -2
- package/esm/types/animate.js.map +0 -1
- package/esm/types/combo.d.ts +0 -135
- package/esm/types/combo.js.map +0 -1
- package/esm/types/common.d.ts +0 -17
- package/esm/types/common.js +0 -2
- package/esm/types/common.js.map +0 -1
- package/esm/types/graph.d.ts +0 -594
- package/esm/types/graph.js +0 -2
- package/esm/types/graph.js.map +0 -1
- package/esm/types/history.d.ts +0 -28
- package/esm/types/history.js +0 -6
- package/esm/types/history.js.map +0 -1
- package/esm/types/hook.d.ts +0 -124
- package/esm/types/hook.js +0 -2
- package/esm/types/hook.js.map +0 -1
- package/esm/types/item.d.ts +0 -235
- package/esm/types/item.js +0 -16
- package/esm/types/item.js.map +0 -1
- package/esm/types/layout.d.ts +0 -72
- package/esm/types/layout.js +0 -20
- package/esm/types/layout.js.map +0 -1
- package/esm/types/loop.d.ts +0 -21
- package/esm/types/loop.js +0 -12
- package/esm/types/loop.js.map +0 -1
- package/esm/types/render.d.ts +0 -1
- package/esm/types/render.js +0 -2
- package/esm/types/render.js.map +0 -1
- package/esm/types/spec.d.ts +0 -82
- package/esm/types/spec.js.map +0 -1
- package/esm/types/stdlib.d.ts +0 -13
- package/esm/types/stdlib.js +0 -2
- package/esm/types/stdlib.js.map +0 -1
- package/esm/types/theme.d.ts +0 -168
- package/esm/types/theme.js +0 -14
- package/esm/types/theme.js.map +0 -1
- package/esm/types/view.d.ts +0 -23
- package/esm/types/view.js +0 -2
- package/esm/types/view.js.map +0 -1
- package/esm/util/animate.d.ts +0 -106
- package/esm/util/animate.js +0 -391
- package/esm/util/animate.js.map +0 -1
- package/esm/util/array.d.ts +0 -28
- package/esm/util/array.js +0 -70
- package/esm/util/array.js.map +0 -1
- package/esm/util/arrow.d.ts +0 -17
- package/esm/util/arrow.js +0 -56
- package/esm/util/arrow.js.map +0 -1
- package/esm/util/bbox.d.ts +0 -106
- package/esm/util/bbox.js +0 -255
- package/esm/util/bbox.js.map +0 -1
- package/esm/util/behavior.d.ts +0 -2
- package/esm/util/behavior.js +0 -12
- package/esm/util/behavior.js.map +0 -1
- package/esm/util/canvas.d.ts +0 -19
- package/esm/util/canvas.js +0 -66
- package/esm/util/canvas.js.map +0 -1
- package/esm/util/data.d.ts +0 -96
- package/esm/util/data.js +0 -262
- package/esm/util/data.js.map +0 -1
- package/esm/util/event.d.ts +0 -40
- package/esm/util/event.js +0 -96
- package/esm/util/event.js.map +0 -1
- package/esm/util/extend.d.ts +0 -27
- package/esm/util/extend.js +0 -22
- package/esm/util/extend.js.map +0 -1
- package/esm/util/extension.d.ts +0 -10
- package/esm/util/extension.js +0 -24
- package/esm/util/extension.js.map +0 -1
- package/esm/util/index.d.ts +0 -52
- package/esm/util/index.js +0 -24
- package/esm/util/index.js.map +0 -1
- package/esm/util/item.d.ts +0 -15
- package/esm/util/item.js +0 -67
- package/esm/util/item.js.map +0 -1
- package/esm/util/layout.d.ts +0 -40
- package/esm/util/layout.js +0 -160
- package/esm/util/layout.js.map +0 -1
- package/esm/util/loop.d.ts +0 -37
- package/esm/util/loop.js +0 -104
- package/esm/util/loop.js.map +0 -1
- package/esm/util/mapper.d.ts +0 -17
- package/esm/util/mapper.js +0 -55
- package/esm/util/mapper.js.map +0 -1
- package/esm/util/math.d.ts +0 -23
- package/esm/util/math.js +0 -23
- package/esm/util/math.js.map +0 -1
- package/esm/util/mock.d.ts +0 -30
- package/esm/util/mock.js +0 -69
- package/esm/util/mock.js.map +0 -1
- package/esm/util/path.d.ts +0 -11
- package/esm/util/path.js +0 -44
- package/esm/util/path.js.map +0 -1
- package/esm/util/point.d.ts +0 -83
- package/esm/util/point.js +0 -185
- package/esm/util/point.js.map +0 -1
- package/esm/util/polyline.d.ts +0 -113
- package/esm/util/polyline.js +0 -505
- package/esm/util/polyline.js.map +0 -1
- package/esm/util/router.d.ts +0 -32
- package/esm/util/router.js +0 -383
- package/esm/util/router.js.map +0 -1
- package/esm/util/shape.d.ts +0 -140
- package/esm/util/shape.js +0 -620
- package/esm/util/shape.js.map +0 -1
- package/esm/util/shape3d.d.ts +0 -23
- package/esm/util/shape3d.js +0 -153
- package/esm/util/shape3d.js.map +0 -1
- package/esm/util/text.d.ts +0 -18
- package/esm/util/text.js +0 -36
- package/esm/util/text.js.map +0 -1
- package/esm/util/type.d.ts +0 -8
- package/esm/util/type.js +0 -8
- package/esm/util/type.js.map +0 -1
- package/esm/util/zoom.d.ts +0 -17
- package/esm/util/zoom.js +0 -40
- package/esm/util/zoom.js.map +0 -1
- package/lib/api-doc/behaviors.d.ts +0 -2
- package/lib/api-doc/behaviors.js +0 -18
- package/lib/api-doc/behaviors.js.map +0 -1
- package/lib/api-doc/graph.d.ts +0 -4
- package/lib/api-doc/graph.js +0 -11
- package/lib/api-doc/graph.js.map +0 -1
- package/lib/api-doc/item.d.ts +0 -11
- package/lib/api-doc/item.js +0 -25
- package/lib/api-doc/item.js.map +0 -1
- package/lib/api-doc/layout.d.ts +0 -1
- package/lib/api-doc/layout.js.map +0 -1
- package/lib/api-doc/plugins.d.ts +0 -1
- package/lib/api-doc/plugins.js +0 -18
- package/lib/api-doc/plugins.js.map +0 -1
- package/lib/api-doc/types.js +0 -3
- package/lib/api-doc/types.js.map +0 -1
- package/lib/api-doc/util.d.ts +0 -3
- package/lib/api-doc/util.js +0 -10
- package/lib/api-doc/util.js.map +0 -1
- package/lib/constant/index.d.ts +0 -1
- package/lib/constant/index.js +0 -18
- package/lib/constant/index.js.map +0 -1
- package/lib/constant/shape.d.ts +0 -21
- package/lib/constant/shape.js +0 -30
- package/lib/constant/shape.js.map +0 -1
- package/lib/item/combo.d.ts +0 -81
- package/lib/item/combo.js +0 -194
- package/lib/item/combo.js.map +0 -1
- package/lib/item/edge.d.ts +0 -57
- package/lib/item/edge.js +0 -148
- package/lib/item/edge.js.map +0 -1
- package/lib/item/item.d.ts +0 -191
- package/lib/item/item.js +0 -704
- package/lib/item/item.js.map +0 -1
- package/lib/item/node.d.ts +0 -63
- package/lib/item/node.js +0 -196
- package/lib/item/node.js.map +0 -1
- package/lib/runtime/controller/data.d.ts +0 -89
- package/lib/runtime/controller/data.js +0 -882
- package/lib/runtime/controller/data.js.map +0 -1
- package/lib/runtime/controller/extension.d.ts +0 -9
- package/lib/runtime/controller/extension.js +0 -15
- package/lib/runtime/controller/extension.js.map +0 -1
- package/lib/runtime/controller/index.d.ts +0 -7
- package/lib/runtime/controller/index.js +0 -24
- package/lib/runtime/controller/index.js.map +0 -1
- package/lib/runtime/controller/interaction.d.ts +0 -52
- package/lib/runtime/controller/interaction.js +0 -278
- package/lib/runtime/controller/interaction.js.map +0 -1
- package/lib/runtime/controller/item.d.ts +0 -143
- package/lib/runtime/controller/item.js +0 -1148
- package/lib/runtime/controller/item.js.map +0 -1
- package/lib/runtime/controller/layout.d.ts +0 -33
- package/lib/runtime/controller/layout.js +0 -327
- package/lib/runtime/controller/layout.js.map +0 -1
- package/lib/runtime/controller/plugin.d.ts +0 -45
- package/lib/runtime/controller/plugin.js +0 -180
- package/lib/runtime/controller/plugin.js.map +0 -1
- package/lib/runtime/controller/theme.d.ts +0 -29
- package/lib/runtime/controller/theme.js +0 -65
- package/lib/runtime/controller/theme.js.map +0 -1
- package/lib/runtime/controller/viewport.d.ts +0 -11
- package/lib/runtime/controller/viewport.js +0 -106
- package/lib/runtime/controller/viewport.js.map +0 -1
- package/lib/runtime/hooks.d.ts +0 -33
- package/lib/runtime/hooks.js +0 -77
- package/lib/runtime/hooks.js.map +0 -1
- package/lib/stdlib/behavior/activate-relations.d.ts +0 -61
- package/lib/stdlib/behavior/activate-relations.js +0 -89
- package/lib/stdlib/behavior/activate-relations.js.map +0 -1
- package/lib/stdlib/behavior/brush-select.d.ts +0 -109
- package/lib/stdlib/behavior/brush-select.js +0 -272
- package/lib/stdlib/behavior/brush-select.js.map +0 -1
- package/lib/stdlib/behavior/click-select.d.ts +0 -73
- package/lib/stdlib/behavior/click-select.js +0 -161
- package/lib/stdlib/behavior/click-select.js.map +0 -1
- package/lib/stdlib/behavior/collapse-expand-combo.d.ts +0 -28
- package/lib/stdlib/behavior/collapse-expand-combo.js +0 -39
- package/lib/stdlib/behavior/collapse-expand-combo.js.map +0 -1
- package/lib/stdlib/behavior/collapse-expand-tree.d.ts +0 -44
- package/lib/stdlib/behavior/collapse-expand-tree.js +0 -73
- package/lib/stdlib/behavior/collapse-expand-tree.js.map +0 -1
- package/lib/stdlib/behavior/drag-canvas.d.ts +0 -81
- package/lib/stdlib/behavior/drag-canvas.js +0 -254
- package/lib/stdlib/behavior/drag-canvas.js.map +0 -1
- package/lib/stdlib/behavior/drag-combo.d.ts +0 -111
- package/lib/stdlib/behavior/drag-combo.js +0 -384
- package/lib/stdlib/behavior/drag-combo.js.map +0 -1
- package/lib/stdlib/behavior/drag-node.d.ts +0 -100
- package/lib/stdlib/behavior/drag-node.js +0 -443
- package/lib/stdlib/behavior/drag-node.js.map +0 -1
- package/lib/stdlib/behavior/hover-activate.d.ts +0 -42
- package/lib/stdlib/behavior/hover-activate.js +0 -68
- package/lib/stdlib/behavior/hover-activate.js.map +0 -1
- package/lib/stdlib/behavior/index.d.ts +0 -16
- package/lib/stdlib/behavior/index.js +0 -33
- package/lib/stdlib/behavior/index.js.map +0 -1
- package/lib/stdlib/behavior/lasso-select.d.ts +0 -31
- package/lib/stdlib/behavior/lasso-select.js +0 -83
- package/lib/stdlib/behavior/lasso-select.js.map +0 -1
- package/lib/stdlib/behavior/orbit-canvas-3d.d.ts +0 -36
- package/lib/stdlib/behavior/orbit-canvas-3d.js +0 -66
- package/lib/stdlib/behavior/orbit-canvas-3d.js.map +0 -1
- package/lib/stdlib/behavior/rotate-canvas-3d.d.ts +0 -60
- package/lib/stdlib/behavior/rotate-canvas-3d.js +0 -127
- package/lib/stdlib/behavior/rotate-canvas-3d.js.map +0 -1
- package/lib/stdlib/behavior/shortcuts-call.d.ts +0 -38
- package/lib/stdlib/behavior/shortcuts-call.js +0 -84
- package/lib/stdlib/behavior/shortcuts-call.js.map +0 -1
- package/lib/stdlib/behavior/track-canvas-3d.d.ts +0 -36
- package/lib/stdlib/behavior/track-canvas-3d.js +0 -66
- package/lib/stdlib/behavior/track-canvas-3d.js.map +0 -1
- package/lib/stdlib/behavior/types.d.ts +0 -13
- package/lib/stdlib/behavior/types.js.map +0 -1
- package/lib/stdlib/behavior/zoom-canvas-3d.d.ts +0 -58
- package/lib/stdlib/behavior/zoom-canvas-3d.js +0 -102
- package/lib/stdlib/behavior/zoom-canvas-3d.js.map +0 -1
- package/lib/stdlib/behavior/zoom-canvas.d.ts +0 -68
- package/lib/stdlib/behavior/zoom-canvas.js +0 -173
- package/lib/stdlib/behavior/zoom-canvas.js.map +0 -1
- package/lib/stdlib/data/index.d.ts +0 -3
- package/lib/stdlib/data/index.js +0 -20
- package/lib/stdlib/data/index.js.map +0 -1
- package/lib/stdlib/data/mapNodeSize.d.ts +0 -12
- package/lib/stdlib/data/mapNodeSize.js +0 -47
- package/lib/stdlib/data/mapNodeSize.js.map +0 -1
- package/lib/stdlib/data/transformV4Data.d.ts +0 -9
- package/lib/stdlib/data/transformV4Data.js +0 -146
- package/lib/stdlib/data/transformV4Data.js.map +0 -1
- package/lib/stdlib/data/validateData.d.ts +0 -9
- package/lib/stdlib/data/validateData.js +0 -107
- package/lib/stdlib/data/validateData.js.map +0 -1
- package/lib/stdlib/index.d.ts +0 -149
- package/lib/stdlib/index.js +0 -236
- package/lib/stdlib/index.js.map +0 -1
- package/lib/stdlib/item/combo/circle.d.ts +0 -29
- package/lib/stdlib/item/combo/circle.js +0 -60
- package/lib/stdlib/item/combo/circle.js.map +0 -1
- package/lib/stdlib/item/combo/index.d.ts +0 -2
- package/lib/stdlib/item/combo/index.js +0 -19
- package/lib/stdlib/item/combo/index.js.map +0 -1
- package/lib/stdlib/item/combo/rect.d.ts +0 -31
- package/lib/stdlib/item/combo/rect.js +0 -69
- package/lib/stdlib/item/combo/rect.js.map +0 -1
- package/lib/stdlib/item/edge/base.d.ts +0 -210
- package/lib/stdlib/item/edge/base.js +0 -448
- package/lib/stdlib/item/edge/base.js.map +0 -1
- package/lib/stdlib/item/edge/cubic-horizontal.d.ts +0 -36
- package/lib/stdlib/item/edge/cubic-horizontal.js +0 -60
- package/lib/stdlib/item/edge/cubic-horizontal.js.map +0 -1
- package/lib/stdlib/item/edge/cubic-vertical.d.ts +0 -36
- package/lib/stdlib/item/edge/cubic-vertical.js +0 -60
- package/lib/stdlib/item/edge/cubic-vertical.js.map +0 -1
- package/lib/stdlib/item/edge/cubic.d.ts +0 -59
- package/lib/stdlib/item/edge/cubic.js +0 -120
- package/lib/stdlib/item/edge/cubic.js.map +0 -1
- package/lib/stdlib/item/edge/index.d.ts +0 -7
- package/lib/stdlib/item/edge/index.js +0 -24
- package/lib/stdlib/item/edge/index.js.map +0 -1
- package/lib/stdlib/item/edge/line.d.ts +0 -33
- package/lib/stdlib/item/edge/line.js +0 -67
- package/lib/stdlib/item/edge/line.js.map +0 -1
- package/lib/stdlib/item/edge/loop.d.ts +0 -32
- package/lib/stdlib/item/edge/loop.js +0 -119
- package/lib/stdlib/item/edge/loop.js.map +0 -1
- package/lib/stdlib/item/edge/polyline.d.ts +0 -45
- package/lib/stdlib/item/edge/polyline.js +0 -96
- package/lib/stdlib/item/edge/polyline.js.map +0 -1
- package/lib/stdlib/item/edge/quadratic.d.ts +0 -40
- package/lib/stdlib/item/edge/quadratic.js +0 -82
- package/lib/stdlib/item/edge/quadratic.js.map +0 -1
- package/lib/stdlib/item/node/base.d.ts +0 -256
- package/lib/stdlib/item/node/base.js +0 -607
- package/lib/stdlib/item/node/base.js.map +0 -1
- package/lib/stdlib/item/node/base3d.d.ts +0 -96
- package/lib/stdlib/item/node/base3d.js +0 -133
- package/lib/stdlib/item/node/base3d.js.map +0 -1
- package/lib/stdlib/item/node/circle.d.ts +0 -30
- package/lib/stdlib/item/node/circle.js +0 -60
- package/lib/stdlib/item/node/circle.js.map +0 -1
- package/lib/stdlib/item/node/diamond.d.ts +0 -32
- package/lib/stdlib/item/node/diamond.js +0 -83
- package/lib/stdlib/item/node/diamond.js.map +0 -1
- package/lib/stdlib/item/node/donut.d.ts +0 -70
- package/lib/stdlib/item/node/donut.js +0 -211
- package/lib/stdlib/item/node/donut.js.map +0 -1
- package/lib/stdlib/item/node/ellipse.d.ts +0 -32
- package/lib/stdlib/item/node/ellipse.js +0 -75
- package/lib/stdlib/item/node/ellipse.js.map +0 -1
- package/lib/stdlib/item/node/hexagon.d.ts +0 -33
- package/lib/stdlib/item/node/hexagon.js +0 -109
- package/lib/stdlib/item/node/hexagon.js.map +0 -1
- package/lib/stdlib/item/node/index.d.ts +0 -10
- package/lib/stdlib/item/node/index.js +0 -27
- package/lib/stdlib/item/node/index.js.map +0 -1
- package/lib/stdlib/item/node/modelRect.d.ts +0 -61
- package/lib/stdlib/item/node/modelRect.js +0 -190
- package/lib/stdlib/item/node/modelRect.js.map +0 -1
- package/lib/stdlib/item/node/rect.d.ts +0 -32
- package/lib/stdlib/item/node/rect.js +0 -79
- package/lib/stdlib/item/node/rect.js.map +0 -1
- package/lib/stdlib/item/node/sphere.d.ts +0 -33
- package/lib/stdlib/item/node/sphere.js +0 -56
- package/lib/stdlib/item/node/sphere.js.map +0 -1
- package/lib/stdlib/item/node/star.d.ts +0 -34
- package/lib/stdlib/item/node/star.js +0 -119
- package/lib/stdlib/item/node/star.js.map +0 -1
- package/lib/stdlib/item/node/triangle.d.ts +0 -44
- package/lib/stdlib/item/node/triangle.js +0 -181
- package/lib/stdlib/item/node/triangle.js.map +0 -1
- package/lib/stdlib/plugin/fisheye/index.d.ts +0 -130
- package/lib/stdlib/plugin/fisheye/index.js +0 -492
- package/lib/stdlib/plugin/fisheye/index.js.map +0 -1
- package/lib/stdlib/plugin/grid/index.d.ts +0 -36
- package/lib/stdlib/plugin/grid/index.js +0 -85
- package/lib/stdlib/plugin/grid/index.js.map +0 -1
- package/lib/stdlib/plugin/history/combo-command.d.ts +0 -9
- package/lib/stdlib/plugin/history/combo-command.js +0 -25
- package/lib/stdlib/plugin/history/combo-command.js.map +0 -1
- package/lib/stdlib/plugin/history/command.d.ts +0 -18
- package/lib/stdlib/plugin/history/command.js +0 -54
- package/lib/stdlib/plugin/history/command.js.map +0 -1
- package/lib/stdlib/plugin/history/index.d.ts +0 -112
- package/lib/stdlib/plugin/history/index.js +0 -283
- package/lib/stdlib/plugin/history/index.js.map +0 -1
- package/lib/stdlib/plugin/history/item-data-command.d.ts +0 -14
- package/lib/stdlib/plugin/history/item-data-command.js +0 -67
- package/lib/stdlib/plugin/history/item-data-command.js.map +0 -1
- package/lib/stdlib/plugin/history/layer-updated-command.d.ts +0 -9
- package/lib/stdlib/plugin/history/layer-updated-command.js +0 -25
- package/lib/stdlib/plugin/history/layer-updated-command.js.map +0 -1
- package/lib/stdlib/plugin/history/state-updated-command.d.ts +0 -9
- package/lib/stdlib/plugin/history/state-updated-command.js +0 -24
- package/lib/stdlib/plugin/history/state-updated-command.js.map +0 -1
- package/lib/stdlib/plugin/history/visibility-updated-command.d.ts +0 -10
- package/lib/stdlib/plugin/history/visibility-updated-command.js +0 -27
- package/lib/stdlib/plugin/history/visibility-updated-command.js.map +0 -1
- package/lib/stdlib/plugin/hull/bubbleset.d.ts +0 -9
- package/lib/stdlib/plugin/hull/bubbleset.js +0 -596
- package/lib/stdlib/plugin/hull/bubbleset.js.map +0 -1
- package/lib/stdlib/plugin/hull/convexHull.d.ts +0 -14
- package/lib/stdlib/plugin/hull/convexHull.js +0 -61
- package/lib/stdlib/plugin/hull/convexHull.js.map +0 -1
- package/lib/stdlib/plugin/hull/hullComponent.d.ts +0 -87
- package/lib/stdlib/plugin/hull/hullComponent.js +0 -385
- package/lib/stdlib/plugin/hull/hullComponent.js.map +0 -1
- package/lib/stdlib/plugin/hull/index.d.ts +0 -59
- package/lib/stdlib/plugin/hull/index.js +0 -167
- package/lib/stdlib/plugin/hull/index.js.map +0 -1
- package/lib/stdlib/plugin/hull/types.d.ts +0 -15
- package/lib/stdlib/plugin/hull/types.js.map +0 -1
- package/lib/stdlib/plugin/hull/util.d.ts +0 -77
- package/lib/stdlib/plugin/hull/util.js +0 -419
- package/lib/stdlib/plugin/hull/util.js.map +0 -1
- package/lib/stdlib/plugin/index.d.ts +0 -9
- package/lib/stdlib/plugin/index.js +0 -26
- package/lib/stdlib/plugin/index.js.map +0 -1
- package/lib/stdlib/plugin/legend/index.d.ts +0 -163
- package/lib/stdlib/plugin/legend/index.js +0 -598
- package/lib/stdlib/plugin/legend/index.js.map +0 -1
- package/lib/stdlib/plugin/menu/index.d.ts +0 -55
- package/lib/stdlib/plugin/menu/index.js +0 -244
- package/lib/stdlib/plugin/menu/index.js.map +0 -1
- package/lib/stdlib/plugin/minimap/index.d.ts +0 -114
- package/lib/stdlib/plugin/minimap/index.js +0 -580
- package/lib/stdlib/plugin/minimap/index.js.map +0 -1
- package/lib/stdlib/plugin/timebar/index.d.ts +0 -98
- package/lib/stdlib/plugin/timebar/index.js +0 -307
- package/lib/stdlib/plugin/timebar/index.js.map +0 -1
- package/lib/stdlib/plugin/toolbar/index.d.ts +0 -59
- package/lib/stdlib/plugin/toolbar/index.js +0 -222
- package/lib/stdlib/plugin/toolbar/index.js.map +0 -1
- package/lib/stdlib/plugin/tooltip/index.d.ts +0 -96
- package/lib/stdlib/plugin/tooltip/index.js +0 -385
- package/lib/stdlib/plugin/tooltip/index.js.map +0 -1
- package/lib/stdlib/plugin/types.d.ts +0 -9
- package/lib/stdlib/plugin/types.js.map +0 -1
- package/lib/stdlib/selector/lasso.d.ts +0 -15
- package/lib/stdlib/selector/lasso.js +0 -63
- package/lib/stdlib/selector/lasso.js.map +0 -1
- package/lib/stdlib/selector/rect.d.ts +0 -16
- package/lib/stdlib/selector/rect.js +0 -56
- package/lib/stdlib/selector/rect.js.map +0 -1
- package/lib/stdlib/theme/dark.d.ts +0 -2
- package/lib/stdlib/theme/dark.js +0 -295
- package/lib/stdlib/theme/dark.js.map +0 -1
- package/lib/stdlib/theme/index.d.ts +0 -2
- package/lib/stdlib/theme/index.js +0 -19
- package/lib/stdlib/theme/index.js.map +0 -1
- package/lib/stdlib/theme/light.d.ts +0 -2
- package/lib/stdlib/theme/light.js +0 -333
- package/lib/stdlib/theme/light.js.map +0 -1
- package/lib/stdlib/themeSolver/base.d.ts +0 -15
- package/lib/stdlib/themeSolver/base.js +0 -15
- package/lib/stdlib/themeSolver/base.js.map +0 -1
- package/lib/stdlib/themeSolver/index.d.ts +0 -3
- package/lib/stdlib/themeSolver/index.js +0 -20
- package/lib/stdlib/themeSolver/index.js.map +0 -1
- package/lib/stdlib/themeSolver/spec.d.ts +0 -35
- package/lib/stdlib/themeSolver/spec.js +0 -70
- package/lib/stdlib/themeSolver/spec.js.map +0 -1
- package/lib/stdlib/themeSolver/subject.d.ts +0 -41
- package/lib/stdlib/themeSolver/subject.js +0 -404
- package/lib/stdlib/themeSolver/subject.js.map +0 -1
- package/lib/types/animate.d.ts +0 -59
- package/lib/types/animate.js +0 -3
- package/lib/types/animate.js.map +0 -1
- package/lib/types/combo.d.ts +0 -135
- package/lib/types/combo.js.map +0 -1
- package/lib/types/common.d.ts +0 -17
- package/lib/types/common.js +0 -3
- package/lib/types/common.js.map +0 -1
- package/lib/types/graph.d.ts +0 -594
- package/lib/types/graph.js +0 -3
- package/lib/types/graph.js.map +0 -1
- package/lib/types/history.d.ts +0 -28
- package/lib/types/history.js +0 -9
- package/lib/types/history.js.map +0 -1
- package/lib/types/hook.d.ts +0 -124
- package/lib/types/hook.js +0 -3
- package/lib/types/hook.js.map +0 -1
- package/lib/types/item.d.ts +0 -235
- package/lib/types/item.js +0 -19
- package/lib/types/item.js.map +0 -1
- package/lib/types/layout.d.ts +0 -72
- package/lib/types/layout.js +0 -25
- package/lib/types/layout.js.map +0 -1
- package/lib/types/loop.d.ts +0 -21
- package/lib/types/loop.js +0 -15
- package/lib/types/loop.js.map +0 -1
- package/lib/types/render.d.ts +0 -1
- package/lib/types/render.js +0 -3
- package/lib/types/render.js.map +0 -1
- package/lib/types/spec.d.ts +0 -82
- package/lib/types/spec.js.map +0 -1
- package/lib/types/stdlib.d.ts +0 -13
- package/lib/types/stdlib.js +0 -3
- package/lib/types/stdlib.js.map +0 -1
- package/lib/types/theme.d.ts +0 -168
- package/lib/types/theme.js +0 -18
- package/lib/types/theme.js.map +0 -1
- package/lib/types/view.d.ts +0 -23
- package/lib/types/view.js +0 -3
- package/lib/types/view.js.map +0 -1
- package/lib/util/animate.d.ts +0 -106
- package/lib/util/animate.js +0 -400
- package/lib/util/animate.js.map +0 -1
- package/lib/util/array.d.ts +0 -28
- package/lib/util/array.js +0 -79
- package/lib/util/array.js.map +0 -1
- package/lib/util/arrow.d.ts +0 -17
- package/lib/util/arrow.js +0 -60
- package/lib/util/arrow.js.map +0 -1
- package/lib/util/bbox.d.ts +0 -106
- package/lib/util/bbox.js +0 -273
- package/lib/util/bbox.js.map +0 -1
- package/lib/util/behavior.d.ts +0 -2
- package/lib/util/behavior.js +0 -16
- package/lib/util/behavior.js.map +0 -1
- package/lib/util/canvas.d.ts +0 -19
- package/lib/util/canvas.js +0 -71
- package/lib/util/canvas.js.map +0 -1
- package/lib/util/data.d.ts +0 -96
- package/lib/util/data.js +0 -276
- package/lib/util/data.js.map +0 -1
- package/lib/util/event.d.ts +0 -40
- package/lib/util/event.js +0 -102
- package/lib/util/event.js.map +0 -1
- package/lib/util/extend.d.ts +0 -27
- package/lib/util/extend.js +0 -29
- package/lib/util/extend.js.map +0 -1
- package/lib/util/extension.d.ts +0 -10
- package/lib/util/extension.js +0 -29
- package/lib/util/extension.js.map +0 -1
- package/lib/util/index.d.ts +0 -52
- package/lib/util/index.js +0 -26
- package/lib/util/index.js.map +0 -1
- package/lib/util/item.d.ts +0 -15
- package/lib/util/item.js +0 -72
- package/lib/util/item.js.map +0 -1
- package/lib/util/layout.d.ts +0 -40
- package/lib/util/layout.js +0 -172
- package/lib/util/layout.js.map +0 -1
- package/lib/util/loop.d.ts +0 -37
- package/lib/util/loop.js +0 -111
- package/lib/util/loop.js.map +0 -1
- package/lib/util/mapper.d.ts +0 -17
- package/lib/util/mapper.js +0 -58
- package/lib/util/mapper.js.map +0 -1
- package/lib/util/math.d.ts +0 -23
- package/lib/util/math.js +0 -29
- package/lib/util/math.js.map +0 -1
- package/lib/util/mock.d.ts +0 -30
- package/lib/util/mock.js +0 -73
- package/lib/util/mock.js.map +0 -1
- package/lib/util/path.d.ts +0 -11
- package/lib/util/path.js +0 -49
- package/lib/util/path.js.map +0 -1
- package/lib/util/point.d.ts +0 -83
- package/lib/util/point.js +0 -197
- package/lib/util/point.js.map +0 -1
- package/lib/util/polyline.d.ts +0 -113
- package/lib/util/polyline.js +0 -524
- package/lib/util/polyline.js.map +0 -1
- package/lib/util/router.d.ts +0 -32
- package/lib/util/router.js +0 -387
- package/lib/util/router.js.map +0 -1
- package/lib/util/shape.d.ts +0 -140
- package/lib/util/shape.js +0 -638
- package/lib/util/shape.js.map +0 -1
- package/lib/util/shape3d.d.ts +0 -23
- package/lib/util/shape3d.js +0 -159
- package/lib/util/shape3d.js.map +0 -1
- package/lib/util/text.d.ts +0 -18
- package/lib/util/text.js +0 -41
- package/lib/util/text.js.map +0 -1
- package/lib/util/type.d.ts +0 -8
- package/lib/util/type.js +0 -13
- package/lib/util/type.js.map +0 -1
- package/lib/util/zoom.d.ts +0 -17
- package/lib/util/zoom.js +0 -45
- package/lib/util/zoom.js.map +0 -1
- package/src/api-doc/behaviors.ts +0 -2
- package/src/api-doc/graph.ts +0 -4
- package/src/api-doc/item.ts +0 -45
- package/src/api-doc/layout.ts +0 -13
- package/src/api-doc/plugins.ts +0 -1
- package/src/api-doc/types.ts +0 -2
- package/src/api-doc/util.ts +0 -3
- package/src/constant/index.ts +0 -1
- package/src/constant/shape.ts +0 -37
- package/src/item/combo.ts +0 -310
- package/src/item/edge.ts +0 -227
- package/src/item/item.ts +0 -906
- package/src/item/node.ts +0 -343
- package/src/runtime/controller/data.ts +0 -1049
- package/src/runtime/controller/extension.ts +0 -14
- package/src/runtime/controller/index.ts +0 -7
- package/src/runtime/controller/interaction.ts +0 -367
- package/src/runtime/controller/item.ts +0 -1611
- package/src/runtime/controller/layout.ts +0 -403
- package/src/runtime/controller/plugin.ts +0 -220
- package/src/runtime/controller/theme.ts +0 -73
- package/src/runtime/controller/viewport.ts +0 -131
- package/src/runtime/hooks.ts +0 -64
- package/src/stdlib/behavior/activate-relations.ts +0 -142
- package/src/stdlib/behavior/brush-select.ts +0 -385
- package/src/stdlib/behavior/click-select.ts +0 -216
- package/src/stdlib/behavior/collapse-expand-combo.ts +0 -57
- package/src/stdlib/behavior/collapse-expand-tree.ts +0 -106
- package/src/stdlib/behavior/drag-canvas.ts +0 -335
- package/src/stdlib/behavior/drag-combo.ts +0 -589
- package/src/stdlib/behavior/drag-node.ts +0 -676
- package/src/stdlib/behavior/hover-activate.ts +0 -102
- package/src/stdlib/behavior/index.ts +0 -16
- package/src/stdlib/behavior/lasso-select.ts +0 -98
- package/src/stdlib/behavior/orbit-canvas-3d.ts +0 -102
- package/src/stdlib/behavior/rotate-canvas-3d.ts +0 -170
- package/src/stdlib/behavior/shortcuts-call.ts +0 -120
- package/src/stdlib/behavior/track-canvas-3d.ts +0 -102
- package/src/stdlib/behavior/types.ts +0 -15
- package/src/stdlib/behavior/zoom-canvas-3d.ts +0 -168
- package/src/stdlib/behavior/zoom-canvas.ts +0 -259
- package/src/stdlib/data/index.ts +0 -3
- package/src/stdlib/data/mapNodeSize.ts +0 -67
- package/src/stdlib/data/transformV4Data.ts +0 -207
- package/src/stdlib/data/validateData.ts +0 -151
- package/src/stdlib/index.ts +0 -284
- package/src/stdlib/item/combo/circle.ts +0 -113
- package/src/stdlib/item/combo/index.ts +0 -2
- package/src/stdlib/item/combo/rect.ts +0 -123
- package/src/stdlib/item/edge/base.ts +0 -731
- package/src/stdlib/item/edge/cubic-horizontal.ts +0 -86
- package/src/stdlib/item/edge/cubic-vertical.ts +0 -85
- package/src/stdlib/item/edge/cubic.ts +0 -198
- package/src/stdlib/item/edge/index.ts +0 -7
- package/src/stdlib/item/edge/line.ts +0 -103
- package/src/stdlib/item/edge/loop.ts +0 -162
- package/src/stdlib/item/edge/polyline.ts +0 -163
- package/src/stdlib/item/edge/quadratic.ts +0 -133
- package/src/stdlib/item/node/base.ts +0 -1001
- package/src/stdlib/item/node/base3d.ts +0 -210
- package/src/stdlib/item/node/circle.ts +0 -113
- package/src/stdlib/item/node/diamond.ts +0 -144
- package/src/stdlib/item/node/donut.ts +0 -368
- package/src/stdlib/item/node/ellipse.ts +0 -128
- package/src/stdlib/item/node/hexagon.ts +0 -172
- package/src/stdlib/item/node/index.ts +0 -10
- package/src/stdlib/item/node/modelRect.ts +0 -405
- package/src/stdlib/item/node/rect.ts +0 -141
- package/src/stdlib/item/node/sphere.ts +0 -99
- package/src/stdlib/item/node/star.ts +0 -181
- package/src/stdlib/item/node/triangle.ts +0 -265
- package/src/stdlib/plugin/fisheye/index.ts +0 -607
- package/src/stdlib/plugin/grid/index.ts +0 -125
- package/src/stdlib/plugin/history/combo-command.ts +0 -28
- package/src/stdlib/plugin/history/command.ts +0 -81
- package/src/stdlib/plugin/history/index.ts +0 -347
- package/src/stdlib/plugin/history/item-data-command.ts +0 -96
- package/src/stdlib/plugin/history/layer-updated-command.ts +0 -28
- package/src/stdlib/plugin/history/state-updated-command.ts +0 -36
- package/src/stdlib/plugin/history/visibility-updated-command.ts +0 -41
- package/src/stdlib/plugin/hull/bubbleset.ts +0 -828
- package/src/stdlib/plugin/hull/convexHull.ts +0 -68
- package/src/stdlib/plugin/hull/hullComponent.ts +0 -501
- package/src/stdlib/plugin/hull/index.ts +0 -234
- package/src/stdlib/plugin/hull/types.ts +0 -15
- package/src/stdlib/plugin/hull/util.ts +0 -511
- package/src/stdlib/plugin/index.ts +0 -9
- package/src/stdlib/plugin/legend/index.ts +0 -795
- package/src/stdlib/plugin/menu/index.ts +0 -275
- package/src/stdlib/plugin/minimap/index.ts +0 -698
- package/src/stdlib/plugin/timebar/index.ts +0 -473
- package/src/stdlib/plugin/toolbar/index.ts +0 -257
- package/src/stdlib/plugin/tooltip/index.ts +0 -444
- package/src/stdlib/plugin/types.ts +0 -9
- package/src/stdlib/selector/lasso.ts +0 -75
- package/src/stdlib/selector/rect.ts +0 -78
- package/src/stdlib/theme/dark.ts +0 -354
- package/src/stdlib/theme/index.ts +0 -2
- package/src/stdlib/theme/light.ts +0 -413
- package/src/stdlib/themeSolver/base.ts +0 -22
- package/src/stdlib/themeSolver/index.ts +0 -3
- package/src/stdlib/themeSolver/spec.ts +0 -107
- package/src/stdlib/themeSolver/subject.ts +0 -499
- package/src/types/animate.ts +0 -71
- package/src/types/combo.ts +0 -177
- package/src/types/common.ts +0 -21
- package/src/types/graph.ts +0 -780
- package/src/types/history.ts +0 -30
- package/src/types/hook.ts +0 -128
- package/src/types/item.ts +0 -338
- package/src/types/layout.ts +0 -142
- package/src/types/loop.ts +0 -23
- package/src/types/render.ts +0 -1
- package/src/types/spec.ts +0 -133
- package/src/types/stdlib.ts +0 -25
- package/src/types/theme.ts +0 -171
- package/src/types/view.ts +0 -31
- package/src/util/animate.ts +0 -477
- package/src/util/array.ts +0 -68
- package/src/util/arrow.ts +0 -62
- package/src/util/bbox.ts +0 -298
- package/src/util/behavior.ts +0 -14
- package/src/util/canvas.ts +0 -87
- package/src/util/data.ts +0 -307
- package/src/util/event.ts +0 -147
- package/src/util/extend.ts +0 -48
- package/src/util/extension.ts +0 -29
- package/src/util/index.ts +0 -34
- package/src/util/item.ts +0 -136
- package/src/util/layout.ts +0 -165
- package/src/util/loop.ts +0 -145
- package/src/util/mapper.ts +0 -62
- package/src/util/math.ts +0 -33
- package/src/util/mock.ts +0 -72
- package/src/util/path.ts +0 -52
- package/src/util/point.ts +0 -226
- package/src/util/polyline.ts +0 -676
- package/src/util/router.ts +0 -561
- package/src/util/shape.ts +0 -765
- package/src/util/shape3d.ts +0 -203
- package/src/util/text.ts +0 -49
- package/src/util/type.ts +0 -11
- package/src/util/zoom.ts +0 -43
- /package/esm/{stdlib/behavior → animations}/types.js +0 -0
- /package/esm/{stdlib/plugin/hull → behaviors}/types.js +0 -0
- /package/esm/{api-doc → elements}/types.d.ts +0 -0
- /package/esm/{stdlib/plugin → layouts}/types.js +0 -0
- /package/esm/{types → spec/element}/combo.js +0 -0
- /package/esm/{api-doc → spec}/layout.js +0 -0
- /package/esm/{types → spec}/spec.js +0 -0
- /package/lib/{stdlib/behavior → animations}/types.js +0 -0
- /package/lib/{stdlib/plugin/hull → behaviors}/types.js +0 -0
- /package/lib/{api-doc → elements}/types.d.ts +0 -0
- /package/lib/{stdlib/plugin → layouts}/types.js +0 -0
- /package/lib/{types → spec/element}/combo.js +0 -0
- /package/lib/{api-doc → spec}/layout.js +0 -0
- /package/lib/{types → spec}/spec.js +0 -0
package/src/runtime/graph.ts
CHANGED
|
@@ -1,2217 +1,1027 @@
|
|
|
1
1
|
import EventEmitter from '@antv/event-emitter';
|
|
2
|
-
import { AABB,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
isArray,
|
|
8
|
-
isEmpty,
|
|
9
|
-
isEqual,
|
|
10
|
-
isNil,
|
|
11
|
-
isNumber,
|
|
12
|
-
isObject,
|
|
13
|
-
isString,
|
|
14
|
-
map,
|
|
15
|
-
} from '@antv/util';
|
|
16
|
-
import { History } from '../stdlib/plugin/history';
|
|
17
|
-
import { Command } from '../stdlib/plugin/history/command';
|
|
2
|
+
import type { AABB, BaseStyleProps, DataURLOptions } from '@antv/g';
|
|
3
|
+
import type { ID } from '@antv/graphlib';
|
|
4
|
+
import { debounce, isEqual, isFunction, isNumber, isObject, isString, omit } from '@antv/util';
|
|
5
|
+
import { COMBO_KEY, GraphEvent } from '../constants';
|
|
6
|
+
import { getExtension } from '../registry';
|
|
18
7
|
import type {
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
BehaviorOptions,
|
|
9
|
+
ComboData,
|
|
10
|
+
ComboOptions,
|
|
11
|
+
EdgeData,
|
|
12
|
+
EdgeOptions,
|
|
13
|
+
G6Spec,
|
|
21
14
|
GraphData,
|
|
22
|
-
IGraph,
|
|
23
|
-
NodeUserModel,
|
|
24
|
-
Specification,
|
|
25
|
-
} from '../types';
|
|
26
|
-
import type { CameraAnimationOptions } from '../types/animate';
|
|
27
|
-
import type { BehaviorOptionsOf, BehaviorRegistry } from '../types/behavior';
|
|
28
|
-
import type { ComboDisplayModel, ComboModel } from '../types/combo';
|
|
29
|
-
import type { Padding, Point } from '../types/common';
|
|
30
|
-
import type { DataChangeType, DataConfig, GraphCore } from '../types/data';
|
|
31
|
-
import type { EdgeDisplayModel, EdgeModel, EdgeModelData } from '../types/edge';
|
|
32
|
-
import type { StackType } from '../types/history';
|
|
33
|
-
import type { Hooks, ViewportChangeHookParams } from '../types/hook';
|
|
34
|
-
import type { ITEM_TYPE, SHAPE_TYPE, ShapeStyle } from '../types/item';
|
|
35
|
-
import type {
|
|
36
|
-
ImmediatelyInvokedLayoutOptions,
|
|
37
15
|
LayoutOptions,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
NodeData,
|
|
17
|
+
NodeOptions,
|
|
18
|
+
PluginOptions,
|
|
19
|
+
ThemeOptions,
|
|
20
|
+
} from '../spec';
|
|
21
|
+
import { UpdateBehaviorOption } from '../spec/behavior';
|
|
22
|
+
import { UpdatePluginOption } from '../spec/plugin';
|
|
42
23
|
import type {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} from '
|
|
60
|
-
import {
|
|
61
|
-
import
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
private
|
|
92
|
-
|
|
93
|
-
private defaultSpecification = {
|
|
94
|
-
theme: {
|
|
95
|
-
type: 'spec',
|
|
96
|
-
base: 'light',
|
|
97
|
-
},
|
|
98
|
-
enableStack: true,
|
|
24
|
+
CallableValue,
|
|
25
|
+
DataID,
|
|
26
|
+
EdgeDirection,
|
|
27
|
+
ElementDatum,
|
|
28
|
+
ElementType,
|
|
29
|
+
FitViewOptions,
|
|
30
|
+
NodeLikeData,
|
|
31
|
+
PartialEdgeData,
|
|
32
|
+
PartialGraphData,
|
|
33
|
+
PartialNodeLikeData,
|
|
34
|
+
Point,
|
|
35
|
+
Position,
|
|
36
|
+
State,
|
|
37
|
+
Vector2,
|
|
38
|
+
ViewportAnimationEffectTiming,
|
|
39
|
+
} from '../types';
|
|
40
|
+
import { sizeOf } from '../utils/dom';
|
|
41
|
+
import { ElementStateChangeEvent, GraphLifeCycleEvent, emit } from '../utils/event';
|
|
42
|
+
import { idOf } from '../utils/id';
|
|
43
|
+
import { parsePoint, toPointObject } from '../utils/point';
|
|
44
|
+
import { zIndexOf } from '../utils/style';
|
|
45
|
+
import { subtract } from '../utils/vector';
|
|
46
|
+
import { BehaviorController } from './behavior';
|
|
47
|
+
import { Canvas } from './canvas';
|
|
48
|
+
import type { HierarchyKey } from './data';
|
|
49
|
+
import { DataController } from './data';
|
|
50
|
+
import { ElementController } from './element';
|
|
51
|
+
import { LayoutController } from './layout';
|
|
52
|
+
import { PluginController } from './plugin';
|
|
53
|
+
import { RuntimeContext } from './types';
|
|
54
|
+
import { ViewportController } from './viewport';
|
|
55
|
+
|
|
56
|
+
export class Graph extends EventEmitter {
|
|
57
|
+
private options: G6Spec;
|
|
58
|
+
|
|
59
|
+
static defaultOptions: G6Spec = {
|
|
60
|
+
autoResize: false,
|
|
61
|
+
width: 800,
|
|
62
|
+
height: 600,
|
|
63
|
+
theme: 'light',
|
|
64
|
+
rotation: 0,
|
|
65
|
+
zoom: 1,
|
|
66
|
+
zoomRange: [0.01, 10],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
public destroyed = false;
|
|
70
|
+
|
|
71
|
+
// @ts-expect-error will be initialized in createRuntime
|
|
72
|
+
private context: RuntimeContext = {
|
|
73
|
+
model: new DataController(),
|
|
99
74
|
};
|
|
100
75
|
|
|
101
|
-
constructor(
|
|
76
|
+
constructor(options: G6Spec) {
|
|
102
77
|
super();
|
|
78
|
+
this.options = Object.assign({}, Graph.defaultOptions, options);
|
|
79
|
+
this.setOptions(this.options);
|
|
80
|
+
this.context.graph = this;
|
|
103
81
|
|
|
104
|
-
|
|
105
|
-
this.
|
|
106
|
-
|
|
107
|
-
this.initControllers();
|
|
108
|
-
this.initHistory();
|
|
109
|
-
|
|
110
|
-
this.hooks.init.emit({
|
|
111
|
-
canvases: {
|
|
112
|
-
background: this.backgroundCanvas,
|
|
113
|
-
main: this.canvas,
|
|
114
|
-
transient: this.transientCanvas,
|
|
115
|
-
},
|
|
116
|
-
});
|
|
82
|
+
// Listening window.resize to autoResize.
|
|
83
|
+
this.options.autoResize && window.addEventListener('resize', this.onResize);
|
|
84
|
+
}
|
|
117
85
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
86
|
+
/**
|
|
87
|
+
* <zh/> 获取配置项
|
|
88
|
+
*
|
|
89
|
+
* <en/> Get options
|
|
90
|
+
* @returns <zh/> 配置项 | <en/> options
|
|
91
|
+
*/
|
|
92
|
+
public getOptions(): G6Spec {
|
|
93
|
+
return this.options;
|
|
123
94
|
}
|
|
124
95
|
|
|
125
96
|
/**
|
|
126
|
-
*
|
|
97
|
+
* <zh/> 设置配置项
|
|
98
|
+
*
|
|
99
|
+
* <en/> Set options
|
|
100
|
+
* @param options - <zh/> 配置项 | <en/> options
|
|
101
|
+
* @description
|
|
102
|
+
* <zh/> 要更新 devicePixelRatio、container 属性请销毁后重新创建实例
|
|
103
|
+
*
|
|
104
|
+
* <en/> To update devicePixelRatio and container properties, please destroy and recreate the instance
|
|
127
105
|
*/
|
|
128
|
-
|
|
129
|
-
this.dataController = new DataController(this);
|
|
130
|
-
this.interactionController = new InteractionController(this);
|
|
131
|
-
this.layoutController = new LayoutController(this);
|
|
132
|
-
this.themeController = new ThemeController(this);
|
|
133
|
-
this.itemController = new ItemController(this);
|
|
134
|
-
this.viewportController = new ViewportController(this);
|
|
135
|
-
this.extensionController = new ExtensionController(this);
|
|
136
|
-
this.pluginController = new PluginController(this);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private initCanvas() {
|
|
106
|
+
public setOptions(options: G6Spec): void {
|
|
140
107
|
const {
|
|
141
|
-
|
|
108
|
+
animation,
|
|
109
|
+
background,
|
|
110
|
+
behaviors,
|
|
111
|
+
combo,
|
|
142
112
|
container,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
transientCanvas,
|
|
146
|
-
width,
|
|
113
|
+
data,
|
|
114
|
+
edge,
|
|
147
115
|
height,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
// @ts-ignore
|
|
158
|
-
this.rendererType = renderer || 'canvas';
|
|
159
|
-
}
|
|
116
|
+
layout,
|
|
117
|
+
node,
|
|
118
|
+
padding,
|
|
119
|
+
theme,
|
|
120
|
+
plugins,
|
|
121
|
+
width,
|
|
122
|
+
zoomRange,
|
|
123
|
+
zoom,
|
|
124
|
+
} = options;
|
|
160
125
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
: (container as HTMLElement);
|
|
126
|
+
if (background) this.setBackground(background);
|
|
127
|
+
if (behaviors) this.setBehaviors(behaviors);
|
|
128
|
+
if (combo) this.setCombo(combo);
|
|
129
|
+
if (data) this.setData(data);
|
|
130
|
+
if (edge) this.setEdge(edge);
|
|
131
|
+
if (layout) this.setLayout(layout);
|
|
132
|
+
if (node) this.setNode(node);
|
|
133
|
+
if (theme) this.setTheme(theme);
|
|
134
|
+
if (plugins) this.setPlugins(plugins);
|
|
135
|
+
if (isNumber(width) || isNumber(height))
|
|
136
|
+
this.setSize(width ?? this.options.width ?? 0, height ?? this.options.height ?? 0);
|
|
173
137
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
this.destroy();
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
this.container = containerDOM;
|
|
183
|
-
const size = [width, height];
|
|
184
|
-
if (size[0] === undefined) {
|
|
185
|
-
size[0] = containerDOM.scrollWidth;
|
|
186
|
-
}
|
|
187
|
-
if (size[1] === undefined) {
|
|
188
|
-
size[1] = containerDOM.scrollHeight;
|
|
189
|
-
}
|
|
190
|
-
this.backgroundCanvas = createCanvas(
|
|
191
|
-
this.rendererType,
|
|
192
|
-
containerDOM,
|
|
193
|
-
size[0],
|
|
194
|
-
size[1],
|
|
195
|
-
pixelRatio,
|
|
196
|
-
);
|
|
197
|
-
this.canvas = createCanvas(
|
|
198
|
-
this.rendererType,
|
|
199
|
-
containerDOM,
|
|
200
|
-
size[0],
|
|
201
|
-
size[1],
|
|
202
|
-
pixelRatio,
|
|
203
|
-
);
|
|
204
|
-
this.transientCanvas = createCanvas(
|
|
205
|
-
this.rendererType,
|
|
206
|
-
containerDOM,
|
|
207
|
-
size[0],
|
|
208
|
-
size[1],
|
|
209
|
-
pixelRatio,
|
|
210
|
-
);
|
|
211
|
-
}
|
|
138
|
+
if (zoomRange) this.options.zoomRange = zoomRange;
|
|
139
|
+
if (isNumber(zoom)) this.options.zoom = zoom;
|
|
140
|
+
if (isNumber(padding)) this.options.padding = padding;
|
|
141
|
+
}
|
|
212
142
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
),
|
|
217
|
-
).then(() => {
|
|
218
|
-
[this.backgroundCanvas, this.canvas, this.transientCanvas].forEach(
|
|
219
|
-
(canvas, i) => {
|
|
220
|
-
const $domElement = canvas
|
|
221
|
-
.getContextService()
|
|
222
|
-
.getDomElement() as unknown as HTMLElement;
|
|
223
|
-
if ($domElement && $domElement.style) {
|
|
224
|
-
$domElement.style.position = 'fixed';
|
|
225
|
-
$domElement.style.outline = 'none';
|
|
226
|
-
$domElement.tabIndex = 1; // Enable keyboard events
|
|
227
|
-
// Transient canvas should let interactive events go through.
|
|
228
|
-
if (i === 2) {
|
|
229
|
-
$domElement.style.pointerEvents = 'none';
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
);
|
|
234
|
-
|
|
235
|
-
this.canvasReady = true;
|
|
236
|
-
});
|
|
143
|
+
public setBackground(background: G6Spec['background']): void {
|
|
144
|
+
this.options.background = background;
|
|
145
|
+
this.context.canvas?.setBackground(background);
|
|
237
146
|
}
|
|
238
147
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (enableStack) {
|
|
242
|
-
const history = {
|
|
243
|
-
type: 'history',
|
|
244
|
-
key: 'history',
|
|
245
|
-
enableStack,
|
|
246
|
-
stackCfg,
|
|
247
|
-
};
|
|
248
|
-
if (!this.specification.plugins) {
|
|
249
|
-
this.specification.plugins = [];
|
|
250
|
-
}
|
|
251
|
-
this.specification.plugins.push(history);
|
|
252
|
-
}
|
|
148
|
+
public getBackground(): G6Spec['background'] {
|
|
149
|
+
return this.options.background;
|
|
253
150
|
}
|
|
254
151
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
* @returns
|
|
259
|
-
*/
|
|
260
|
-
public changeRenderer(type) {
|
|
261
|
-
this.rendererType = type || 'canvas';
|
|
262
|
-
changeRenderer(this.rendererType, this.canvas);
|
|
152
|
+
public getSize(): [number, number] {
|
|
153
|
+
if (this.context.canvas) return this.context.canvas.getSize();
|
|
154
|
+
return [this.options.width || 0, this.options.height || 0];
|
|
263
155
|
}
|
|
264
156
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
private initHooks() {
|
|
269
|
-
this.hooks = {
|
|
270
|
-
init: new Hook<{
|
|
271
|
-
canvases: {
|
|
272
|
-
background: Canvas;
|
|
273
|
-
main: Canvas;
|
|
274
|
-
transient: Canvas;
|
|
275
|
-
};
|
|
276
|
-
}>({ name: 'init' }),
|
|
277
|
-
datachange: new Hook<{ data: GraphData; type: DataChangeType }>({
|
|
278
|
-
name: 'datachange',
|
|
279
|
-
}),
|
|
280
|
-
itemchange: new Hook<{
|
|
281
|
-
type: ITEM_TYPE;
|
|
282
|
-
changes: GraphChange<NodeModelData, EdgeModelData>[];
|
|
283
|
-
graphCore: GraphCore;
|
|
284
|
-
theme: ThemeSpecification;
|
|
285
|
-
animate?: boolean;
|
|
286
|
-
upsertAncestors?: boolean;
|
|
287
|
-
}>({ name: 'itemchange' }),
|
|
288
|
-
render: new Hook<{
|
|
289
|
-
graphCore: GraphCore;
|
|
290
|
-
theme: ThemeSpecification;
|
|
291
|
-
transientCanvas: Canvas;
|
|
292
|
-
}>({
|
|
293
|
-
name: 'render',
|
|
294
|
-
}),
|
|
295
|
-
layout: new Hook<{
|
|
296
|
-
graphCore: GraphCore;
|
|
297
|
-
options?: LayoutOptions;
|
|
298
|
-
animate?: boolean;
|
|
299
|
-
}>({ name: 'layout' }),
|
|
300
|
-
viewportchange: new Hook<ViewportChangeHookParams>({ name: 'viewport' }),
|
|
301
|
-
modechange: new Hook<{ mode: string }>({ name: 'modechange' }),
|
|
302
|
-
behaviorchange: new Hook<{
|
|
303
|
-
action: 'update' | 'add' | 'remove';
|
|
304
|
-
modes: string[];
|
|
305
|
-
behaviors: (string | BehaviorOptionsOf<{}>)[];
|
|
306
|
-
}>({ name: 'behaviorchange' }),
|
|
307
|
-
itemstatechange: new Hook<{
|
|
308
|
-
ids: ID[];
|
|
309
|
-
states?: string[];
|
|
310
|
-
value?: boolean;
|
|
311
|
-
}>({
|
|
312
|
-
name: 'itemstatechange',
|
|
313
|
-
}),
|
|
314
|
-
itemvisibilitychange: new Hook<{ ids: ID[]; value: boolean }>({
|
|
315
|
-
name: 'itemvisibilitychange',
|
|
316
|
-
}),
|
|
317
|
-
itemzindexchange: new Hook<{
|
|
318
|
-
ids: ID[];
|
|
319
|
-
action: 'front' | 'back';
|
|
320
|
-
graphCore: GraphCore;
|
|
321
|
-
}>({
|
|
322
|
-
name: 'itemzindexchange',
|
|
323
|
-
}),
|
|
324
|
-
transientupdate: new Hook<{
|
|
325
|
-
type: ITEM_TYPE | SHAPE_TYPE;
|
|
326
|
-
id: ID;
|
|
327
|
-
config: {
|
|
328
|
-
style: ShapeStyle;
|
|
329
|
-
action: 'remove' | 'add' | 'update' | undefined;
|
|
330
|
-
};
|
|
331
|
-
canvas: Canvas;
|
|
332
|
-
graphCore: GraphCore;
|
|
333
|
-
}>({ name: 'transientupdate' }),
|
|
334
|
-
pluginchange: new Hook<{
|
|
335
|
-
action: 'update' | 'add' | 'remove';
|
|
336
|
-
plugins: (
|
|
337
|
-
| string
|
|
338
|
-
| { key: string; type: string; [cfgName: string]: unknown }
|
|
339
|
-
)[];
|
|
340
|
-
}>({ name: 'pluginchange' }),
|
|
341
|
-
themechange: new Hook<{
|
|
342
|
-
theme: ThemeSpecification;
|
|
343
|
-
canvases: {
|
|
344
|
-
background: Canvas;
|
|
345
|
-
main: Canvas;
|
|
346
|
-
transient: Canvas;
|
|
347
|
-
};
|
|
348
|
-
}>({ name: 'init' }),
|
|
349
|
-
treecollapseexpand: new Hook<{
|
|
350
|
-
ids: ID[];
|
|
351
|
-
animate: boolean;
|
|
352
|
-
action: 'collapse' | 'expand';
|
|
353
|
-
graphCore: GraphCore;
|
|
354
|
-
}>({ name: 'treecollapseexpand' }),
|
|
355
|
-
destroy: new Hook<{}>({ name: 'destroy' }),
|
|
356
|
-
};
|
|
157
|
+
public setSize(width: number, height: number): void {
|
|
158
|
+
this.options.width = width;
|
|
159
|
+
this.options.height = height;
|
|
357
160
|
}
|
|
358
161
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
*/
|
|
362
|
-
public updateSpecification(spec: Specification<B, T>): Specification<B, T> {
|
|
363
|
-
return Object.assign(this.specification, spec);
|
|
162
|
+
public setZoomRange(zoomRange: G6Spec['zoomRange']): void {
|
|
163
|
+
this.options.zoomRange = zoomRange;
|
|
364
164
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
public updateTheme(theme: ThemeOptionsOf<T>) {
|
|
369
|
-
this.specification.theme = theme;
|
|
370
|
-
// const { specification } = this.themeController;
|
|
371
|
-
// notifiying the themeController
|
|
372
|
-
this.hooks.themechange.emit({
|
|
373
|
-
canvases: {
|
|
374
|
-
background: this.backgroundCanvas,
|
|
375
|
-
main: this.canvas,
|
|
376
|
-
transient: this.transientCanvas,
|
|
377
|
-
},
|
|
378
|
-
});
|
|
379
|
-
// theme is formatted by themeController, notify the item controller to update the items
|
|
380
|
-
this.hooks.themechange.emit({
|
|
381
|
-
theme: this.themeController.specification,
|
|
382
|
-
});
|
|
165
|
+
|
|
166
|
+
public getZoomRange(): G6Spec['zoomRange'] {
|
|
167
|
+
return this.options.zoomRange;
|
|
383
168
|
}
|
|
384
169
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
* @returns graph specs
|
|
388
|
-
*/
|
|
389
|
-
public getSpecification(): Specification<B, T> {
|
|
390
|
-
return this.specification;
|
|
170
|
+
public setNode(node: NodeOptions): void {
|
|
171
|
+
this.options.node = node;
|
|
391
172
|
}
|
|
392
173
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
* If there is old data, diffs and changes it.
|
|
396
|
-
* @param data
|
|
397
|
-
* @returns
|
|
398
|
-
* @group Data
|
|
399
|
-
*/
|
|
400
|
-
public async read(data: DataConfig) {
|
|
401
|
-
this.hooks.datachange.emit({ data, type: 'replace' });
|
|
402
|
-
const emitRender = async () => {
|
|
403
|
-
this.hooks.render.emit({
|
|
404
|
-
graphCore: this.dataController.graphCore,
|
|
405
|
-
theme: this.themeController.specification,
|
|
406
|
-
transientCanvas: this.transientCanvas,
|
|
407
|
-
});
|
|
408
|
-
this.emit('afterrender');
|
|
409
|
-
|
|
410
|
-
this.once('afterlayout', async () => {
|
|
411
|
-
const { autoFit } = this.specification;
|
|
412
|
-
if (autoFit) {
|
|
413
|
-
if (autoFit === 'view') {
|
|
414
|
-
await this.fitView();
|
|
415
|
-
} else if (autoFit === 'center') {
|
|
416
|
-
await this.fitCenter();
|
|
417
|
-
} else {
|
|
418
|
-
const { type, effectTiming, ...others } = autoFit;
|
|
419
|
-
if (type === 'view') {
|
|
420
|
-
await this.fitView(others as any, effectTiming);
|
|
421
|
-
} else if (type === 'center') {
|
|
422
|
-
await this.fitCenter(effectTiming);
|
|
423
|
-
} else if (type === 'position') {
|
|
424
|
-
// TODO: align
|
|
425
|
-
await this.translateTo((others as any).position, effectTiming);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
await this.layout();
|
|
431
|
-
};
|
|
432
|
-
if (this.canvasReady) {
|
|
433
|
-
await emitRender();
|
|
434
|
-
} else {
|
|
435
|
-
await Promise.all(
|
|
436
|
-
[this.backgroundCanvas, this.canvas, this.transientCanvas].map(
|
|
437
|
-
(canvas) => canvas.ready,
|
|
438
|
-
),
|
|
439
|
-
);
|
|
440
|
-
await emitRender();
|
|
441
|
-
}
|
|
174
|
+
public setEdge(edge: EdgeOptions): void {
|
|
175
|
+
this.options.edge = edge;
|
|
442
176
|
}
|
|
443
177
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
* @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)
|
|
448
|
-
* @returns
|
|
449
|
-
* @group Data
|
|
450
|
-
*/
|
|
451
|
-
public async changeData(
|
|
452
|
-
data: DataConfig,
|
|
453
|
-
type: 'replace' | 'mergeReplace' = 'mergeReplace',
|
|
454
|
-
) {
|
|
455
|
-
this.hooks.datachange.emit({ data, type });
|
|
456
|
-
this.hooks.render.emit({
|
|
457
|
-
graphCore: this.dataController.graphCore,
|
|
458
|
-
theme: this.themeController.specification,
|
|
459
|
-
transientCanvas: this.transientCanvas,
|
|
460
|
-
});
|
|
461
|
-
this.emit('afterrender');
|
|
178
|
+
public setCombo(combo: ComboOptions): void {
|
|
179
|
+
this.options.combo = combo;
|
|
180
|
+
}
|
|
462
181
|
|
|
463
|
-
|
|
182
|
+
public getTheme(): ThemeOptions {
|
|
183
|
+
return this.options.theme!;
|
|
464
184
|
}
|
|
465
185
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
'edge',
|
|
474
|
-
this.getAllEdgesData().map((edge) => edge.id),
|
|
475
|
-
);
|
|
476
|
-
this.removeData(
|
|
477
|
-
'node',
|
|
478
|
-
this.getAllNodesData().map((node) => node.id),
|
|
479
|
-
);
|
|
480
|
-
this.removeData(
|
|
481
|
-
'combo',
|
|
482
|
-
this.getAllCombosData().map((combo) => combo.id),
|
|
483
|
-
);
|
|
484
|
-
this.stopBatch();
|
|
186
|
+
public setTheme(theme: CallableValue<ThemeOptions>): void {
|
|
187
|
+
this.options.theme = isFunction(theme) ? theme(this.getTheme()) : theme;
|
|
188
|
+
|
|
189
|
+
const { background } = getExtension('theme', this.options.theme) || {};
|
|
190
|
+
if (background && !this.options.background) {
|
|
191
|
+
this.setBackground(background);
|
|
192
|
+
}
|
|
485
193
|
}
|
|
486
194
|
|
|
487
|
-
public
|
|
488
|
-
|
|
489
|
-
return { x: width! / 2, y: height! / 2 };
|
|
195
|
+
public setLayout(layout: CallableValue<LayoutOptions>): void {
|
|
196
|
+
this.options.layout = isFunction(layout) ? layout(this.getLayout()) : layout;
|
|
490
197
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
): Promise<void> {
|
|
495
|
-
await this.hooks.viewportchange.emitLinearAsync({
|
|
496
|
-
transform: options,
|
|
497
|
-
effectTiming,
|
|
498
|
-
});
|
|
499
|
-
this.emit('viewportchange', options);
|
|
198
|
+
|
|
199
|
+
public getLayout(): LayoutOptions {
|
|
200
|
+
return this.options.layout!;
|
|
500
201
|
}
|
|
501
202
|
|
|
502
203
|
/**
|
|
503
|
-
*
|
|
204
|
+
* <zh/> 设置交互
|
|
205
|
+
*
|
|
206
|
+
* <en/> Set behaviors
|
|
207
|
+
* @param behaviors - <zh/> 交互配置 | <en/> behavior configuration
|
|
504
208
|
*/
|
|
505
|
-
public
|
|
506
|
-
this.
|
|
209
|
+
public setBehaviors(behaviors: CallableValue<BehaviorOptions>): void {
|
|
210
|
+
this.options.behaviors = isFunction(behaviors) ? behaviors(this.getBehaviors()) : behaviors;
|
|
211
|
+
this.context.behavior?.setBehaviors(this.options.behaviors);
|
|
507
212
|
}
|
|
508
213
|
|
|
509
214
|
/**
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
* @param
|
|
514
|
-
*/
|
|
515
|
-
public
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
await this.transform(
|
|
524
|
-
{
|
|
525
|
-
translate: distance,
|
|
526
|
-
},
|
|
527
|
-
effectTiming,
|
|
215
|
+
* <zh/> 更新交互
|
|
216
|
+
*
|
|
217
|
+
* <en/> Update behavior
|
|
218
|
+
* @param behavior - <zh/> 交互配置 | <en/> behavior configuration
|
|
219
|
+
*/
|
|
220
|
+
public updateBehavior(behavior: UpdateBehaviorOption): void {
|
|
221
|
+
this.setBehaviors((behaviors) =>
|
|
222
|
+
behaviors.map((_behavior) => {
|
|
223
|
+
if (isObject(_behavior) && _behavior.key === behavior.key) {
|
|
224
|
+
return { ..._behavior, ...behavior };
|
|
225
|
+
}
|
|
226
|
+
return _behavior;
|
|
227
|
+
}),
|
|
528
228
|
);
|
|
529
229
|
}
|
|
530
230
|
|
|
531
231
|
/**
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
232
|
+
* <zh/> 获取交互
|
|
233
|
+
*
|
|
234
|
+
* <en/> Get behaviors
|
|
235
|
+
* @returns <zh/> 交互配置 | <en/> behavior configuration
|
|
535
236
|
*/
|
|
536
|
-
public
|
|
537
|
-
|
|
538
|
-
effectTiming?: CameraAnimationOptions,
|
|
539
|
-
) {
|
|
540
|
-
const { x: cx, y: cy } = this.getViewportCenter();
|
|
541
|
-
await this.translate({ dx: cx - x, dy: cy - y }, effectTiming);
|
|
237
|
+
public getBehaviors(): BehaviorOptions {
|
|
238
|
+
return this.options.behaviors || [];
|
|
542
239
|
}
|
|
543
240
|
|
|
544
241
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
* @param
|
|
242
|
+
* <zh/> 设置插件
|
|
243
|
+
*
|
|
244
|
+
* <en/> Set plugins
|
|
245
|
+
* @param plugins - <zh/> 插件配置 | <en/> plugin configuration
|
|
549
246
|
*/
|
|
550
|
-
public
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
effectTiming?: CameraAnimationOptions,
|
|
554
|
-
) {
|
|
555
|
-
await this.transform(
|
|
556
|
-
{
|
|
557
|
-
zoom: {
|
|
558
|
-
ratio,
|
|
559
|
-
},
|
|
560
|
-
origin,
|
|
561
|
-
},
|
|
562
|
-
effectTiming,
|
|
563
|
-
);
|
|
247
|
+
public setPlugins(plugins: CallableValue<PluginOptions>): void {
|
|
248
|
+
this.options.plugins = isFunction(plugins) ? plugins(this.getPlugins()) : plugins;
|
|
249
|
+
this.context.plugin?.setPlugins(this.options.plugins);
|
|
564
250
|
}
|
|
565
251
|
|
|
566
252
|
/**
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
* @param
|
|
571
|
-
*/
|
|
572
|
-
public
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
effectTiming,
|
|
253
|
+
* <zh/> 更新插件
|
|
254
|
+
*
|
|
255
|
+
* <en/> Update plugin
|
|
256
|
+
* @param plugin - <zh/> 插件配置 | <en/> plugin configuration
|
|
257
|
+
*/
|
|
258
|
+
public updatePlugin(plugin: UpdatePluginOption): void {
|
|
259
|
+
this.setPlugins((plugins) =>
|
|
260
|
+
plugins.map((_plugin) => {
|
|
261
|
+
if (isObject(_plugin) && _plugin.key === plugin.key) {
|
|
262
|
+
return { ..._plugin, ...plugin };
|
|
263
|
+
}
|
|
264
|
+
return _plugin;
|
|
265
|
+
}),
|
|
581
266
|
);
|
|
582
267
|
}
|
|
583
268
|
|
|
584
269
|
/**
|
|
585
|
-
*
|
|
586
|
-
*
|
|
270
|
+
* <zh/> 获取插件
|
|
271
|
+
*
|
|
272
|
+
* <en/> Get plugins
|
|
273
|
+
* @returns <zh/> 插件配置 | <en/> plugin configuration
|
|
587
274
|
*/
|
|
588
|
-
public
|
|
589
|
-
return this.
|
|
275
|
+
public getPlugins(): PluginOptions {
|
|
276
|
+
return this.options.plugins || [];
|
|
590
277
|
}
|
|
591
278
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
* @param angle
|
|
595
|
-
* @param origin
|
|
596
|
-
* @param effectTiming
|
|
597
|
-
*/
|
|
598
|
-
public async rotate(
|
|
599
|
-
angle: number,
|
|
600
|
-
origin?: PointLike,
|
|
601
|
-
effectTiming?: CameraAnimationOptions,
|
|
602
|
-
) {
|
|
603
|
-
await this.transform(
|
|
604
|
-
{
|
|
605
|
-
rotate: {
|
|
606
|
-
angle,
|
|
607
|
-
},
|
|
608
|
-
origin,
|
|
609
|
-
},
|
|
610
|
-
effectTiming,
|
|
611
|
-
);
|
|
279
|
+
public getData(): GraphData {
|
|
280
|
+
return this.context.model.getData();
|
|
612
281
|
}
|
|
613
282
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
angle: number,
|
|
622
|
-
origin?: PointLike,
|
|
623
|
-
effectTiming?: CameraAnimationOptions,
|
|
624
|
-
) {
|
|
625
|
-
await this.rotate(
|
|
626
|
-
angle - this.canvas.getCamera().getRoll(),
|
|
627
|
-
origin,
|
|
628
|
-
effectTiming,
|
|
629
|
-
);
|
|
283
|
+
public getNodeData(): NodeData[];
|
|
284
|
+
public getNodeData(id: ID): NodeData;
|
|
285
|
+
public getNodeData(ids: ID[]): NodeData[];
|
|
286
|
+
public getNodeData(id?: ID | ID[]): NodeData | NodeData[] {
|
|
287
|
+
if (id === undefined) return this.context.model.getNodeData();
|
|
288
|
+
if (Array.isArray(id)) return this.context.model.getNodeData(id);
|
|
289
|
+
return this.context.model.getNodeData([id])?.[0];
|
|
630
290
|
}
|
|
631
291
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
padding: Padding;
|
|
641
|
-
rules: FitViewRules;
|
|
642
|
-
},
|
|
643
|
-
effectTiming?: CameraAnimationOptions,
|
|
644
|
-
) {
|
|
645
|
-
const { padding, rules } = options || {};
|
|
646
|
-
const [top, right, bottom, left] = padding
|
|
647
|
-
? formatPadding(padding)
|
|
648
|
-
: [0, 0, 0, 0];
|
|
649
|
-
const { direction = 'both', ratioRule = 'min' } = rules || {};
|
|
650
|
-
|
|
651
|
-
// Get the bounds of the whole graph.
|
|
652
|
-
const {
|
|
653
|
-
center: [graphCenterX, graphCenterY],
|
|
654
|
-
halfExtents,
|
|
655
|
-
} = this.canvas.document.documentElement.getBounds();
|
|
656
|
-
const origin = this.canvas.canvas2Viewport({
|
|
657
|
-
x: graphCenterX,
|
|
658
|
-
y: graphCenterY,
|
|
659
|
-
});
|
|
660
|
-
const { width: viewportWidth, height: viewportHeight } =
|
|
661
|
-
this.canvas.getConfig();
|
|
662
|
-
|
|
663
|
-
const graphWidth = halfExtents[0] * 2;
|
|
664
|
-
const graphHeight = halfExtents[1] * 2;
|
|
665
|
-
const tlInCanvas = this.canvas.viewport2Canvas({ x: left, y: top });
|
|
666
|
-
const brInCanvas = this.canvas.viewport2Canvas({
|
|
667
|
-
x: viewportWidth! - right,
|
|
668
|
-
y: viewportHeight! - bottom,
|
|
669
|
-
});
|
|
292
|
+
public getEdgeData(): EdgeData[];
|
|
293
|
+
public getEdgeData(id: ID): EdgeData;
|
|
294
|
+
public getEdgeData(ids: ID[]): EdgeData[];
|
|
295
|
+
public getEdgeData(id?: ID | ID[]): EdgeData | EdgeData[] {
|
|
296
|
+
if (id === undefined) return this.context.model.getEdgeData();
|
|
297
|
+
if (Array.isArray(id)) return this.context.model.getEdgeData(id);
|
|
298
|
+
return this.context.model.getEdgeData([id])?.[0];
|
|
299
|
+
}
|
|
670
300
|
|
|
671
|
-
|
|
672
|
-
|
|
301
|
+
public getComboData(): ComboData[];
|
|
302
|
+
public getComboData(id: ID): ComboData;
|
|
303
|
+
public getComboData(ids: ID[]): ComboData[];
|
|
304
|
+
public getComboData(id?: ID | ID[]): ComboData | ComboData[] {
|
|
305
|
+
if (id === undefined) return this.context.model.getComboData();
|
|
306
|
+
if (Array.isArray(id)) return this.context.model.getComboData(id);
|
|
307
|
+
return this.context.model.getComboData([id])?.[0];
|
|
308
|
+
}
|
|
673
309
|
|
|
674
|
-
|
|
675
|
-
|
|
310
|
+
public setData(data: CallableValue<GraphData>): void {
|
|
311
|
+
this.context.model.setData(isFunction(data) ? data(this.getData()) : data);
|
|
312
|
+
}
|
|
676
313
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
} else if (direction === 'y') {
|
|
681
|
-
ratio = hRatio;
|
|
682
|
-
} else {
|
|
683
|
-
ratio =
|
|
684
|
-
ratioRule === 'max'
|
|
685
|
-
? Math.max(wRatio, hRatio)
|
|
686
|
-
: Math.min(wRatio, hRatio);
|
|
687
|
-
}
|
|
314
|
+
public addData(data: CallableValue<GraphData>): void {
|
|
315
|
+
this.context.model.addData(isFunction(data) ? data(this.getData()) : data);
|
|
316
|
+
}
|
|
688
317
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
translate: {
|
|
692
|
-
dx: viewportWidth! / 2 - origin.x,
|
|
693
|
-
dy: viewportHeight! / 2 - origin.y,
|
|
694
|
-
},
|
|
695
|
-
zoom: {
|
|
696
|
-
ratio,
|
|
697
|
-
},
|
|
698
|
-
},
|
|
699
|
-
effectTiming,
|
|
700
|
-
);
|
|
318
|
+
public addNodeData(data: CallableValue<NodeData[]>): void {
|
|
319
|
+
this.context.model.addNodeData(isFunction(data) ? data(this.getNodeData()) : data);
|
|
701
320
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
*/
|
|
706
|
-
public async fitCenter(effectTiming?: CameraAnimationOptions) {
|
|
707
|
-
// Get the bounds of the whole graph.
|
|
708
|
-
const {
|
|
709
|
-
center: [graphCenterX, graphCenterY],
|
|
710
|
-
} = this.canvas.document.documentElement.getBounds();
|
|
711
|
-
await this.translateTo(
|
|
712
|
-
this.canvas.canvas2Viewport({ x: graphCenterX, y: graphCenterY }),
|
|
713
|
-
effectTiming,
|
|
714
|
-
);
|
|
321
|
+
|
|
322
|
+
public addEdgeData(data: CallableValue<EdgeData[]>): void {
|
|
323
|
+
this.context.model.addEdgeData(isFunction(data) ? data(this.getEdgeData()) : data);
|
|
715
324
|
}
|
|
716
|
-
/**
|
|
717
|
-
* Move the graph to make the item align the view center.
|
|
718
|
-
* @param item node/edge/combo item or its id
|
|
719
|
-
* @param effectTiming animation configurations
|
|
720
|
-
*/
|
|
721
|
-
public async focusItem(id: ID | ID[], effectTiming?: CameraAnimationOptions) {
|
|
722
|
-
let bounds: AABB | null = null;
|
|
723
|
-
for (const itemId of !isArray(id) ? [id] : id) {
|
|
724
|
-
const item = this.getItemById(itemId);
|
|
725
|
-
if (item) {
|
|
726
|
-
const itemBounds = item.group.getBounds();
|
|
727
|
-
if (!bounds) {
|
|
728
|
-
bounds = itemBounds;
|
|
729
|
-
} else {
|
|
730
|
-
bounds.add(itemBounds);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
325
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
center: [itemCenterX, itemCenterY],
|
|
738
|
-
} = bounds;
|
|
739
|
-
await this.translateTo(
|
|
740
|
-
this.canvas.canvas2Viewport({ x: itemCenterX, y: itemCenterY }),
|
|
741
|
-
effectTiming,
|
|
742
|
-
);
|
|
743
|
-
}
|
|
326
|
+
public addComboData(data: CallableValue<ComboData[]>): void {
|
|
327
|
+
this.context.model.addComboData(isFunction(data) ? data(this.getComboData()) : data);
|
|
744
328
|
}
|
|
745
329
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
* @param id
|
|
749
|
-
* @returns Node | Edge | Combo
|
|
750
|
-
*/
|
|
751
|
-
private getItemById(id: ID) {
|
|
752
|
-
return this.itemController.getItemById(id);
|
|
330
|
+
public updateData(data: CallableValue<PartialGraphData>): void {
|
|
331
|
+
this.context.model.updateData(isFunction(data) ? data(this.getData()) : data);
|
|
753
332
|
}
|
|
754
333
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
* @returns [width, height]
|
|
758
|
-
* @group View
|
|
759
|
-
*/
|
|
760
|
-
public getSize(): number[] {
|
|
761
|
-
const { width = 500, height = 500 } = this.specification;
|
|
762
|
-
return [width, height];
|
|
334
|
+
public updateNodeData(data: CallableValue<PartialNodeLikeData<NodeData>[]>): void {
|
|
335
|
+
this.context.model.updateNodeData(isFunction(data) ? data(this.getNodeData()) : data);
|
|
763
336
|
}
|
|
764
337
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
* @param number[] [width, height]
|
|
768
|
-
* @group View
|
|
769
|
-
*/
|
|
770
|
-
public setSize(size: number[]) {
|
|
771
|
-
if (!isArray(size) || size.length < 2) {
|
|
772
|
-
console.warn(
|
|
773
|
-
`Failed to setSize. The parameter size: ${size} is invalid. It must be an array with 2 number elements.`,
|
|
774
|
-
);
|
|
775
|
-
return;
|
|
776
|
-
}
|
|
777
|
-
this.specification.width = size[0];
|
|
778
|
-
this.specification.height = size[1];
|
|
779
|
-
this.canvas.resize(size[0], size[1]);
|
|
338
|
+
public updateEdgeData(data: CallableValue<PartialEdgeData<EdgeData>[]>): void {
|
|
339
|
+
this.context.model.updateEdgeData(isFunction(data) ? data(this.getEdgeData()) : data);
|
|
780
340
|
}
|
|
781
341
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
* @param Point rendering coordinate
|
|
785
|
-
* @returns canvas dom (viewport) coordinate
|
|
786
|
-
* @group View
|
|
787
|
-
*/
|
|
788
|
-
public getCanvasByViewport(viewportPoint: Point): Point {
|
|
789
|
-
return this.canvas.viewport2Canvas(viewportPoint);
|
|
342
|
+
public updateComboData(data: CallableValue<PartialNodeLikeData<ComboData>[]>): void {
|
|
343
|
+
this.context.model.updateComboData(isFunction(data) ? data(this.getComboData()) : data);
|
|
790
344
|
}
|
|
791
345
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
* @param Point canvas dom (viewport) coordinate
|
|
795
|
-
* @returns rendering coordinate
|
|
796
|
-
* @group View
|
|
797
|
-
*/
|
|
798
|
-
public getViewportByCanvas(canvasPoint: Point): Point {
|
|
799
|
-
return this.canvas.canvas2Viewport(canvasPoint);
|
|
346
|
+
public removeData(id: DataID | ((data: GraphData) => DataID)): void {
|
|
347
|
+
this.context.model.removeData(isFunction(id) ? id(this.getData()) : id);
|
|
800
348
|
}
|
|
801
349
|
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
* @param Point rendering coordinate
|
|
805
|
-
* @returns browser coordinate
|
|
806
|
-
* @group View
|
|
807
|
-
*/
|
|
808
|
-
public getClientByCanvas(canvasPoint: Point): Point {
|
|
809
|
-
const viewportPoint = this.canvas.canvas2Viewport(canvasPoint);
|
|
810
|
-
return this.canvas.viewport2Client(viewportPoint as any);
|
|
350
|
+
public removeNodeData(ids: ID[] | ((data: NodeData[]) => ID[])): void {
|
|
351
|
+
this.context.model.removeNodeData(isFunction(ids) ? ids(this.getNodeData()) : ids);
|
|
811
352
|
}
|
|
812
353
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
* @param Point browser coordinate
|
|
816
|
-
* @returns rendering coordinate
|
|
817
|
-
* @group View
|
|
818
|
-
*/
|
|
819
|
-
public getCanvasByClient(clientPoint: Point): Point {
|
|
820
|
-
const viewportPoint = this.canvas.client2Viewport(clientPoint);
|
|
821
|
-
return this.canvas.viewport2Canvas(viewportPoint as any);
|
|
354
|
+
public removeEdgeData(ids: ID[] | ((data: EdgeData[]) => ID[])): void {
|
|
355
|
+
this.context.model.removeEdgeData(isFunction(ids) ? ids(this.getEdgeData()) : ids);
|
|
822
356
|
}
|
|
823
357
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
* Find a node's inner data according to id or function.
|
|
827
|
-
* @param { ID | Function } condition id or condition function
|
|
828
|
-
* @returns result node's inner data
|
|
829
|
-
* @group Data
|
|
830
|
-
*/
|
|
831
|
-
public getNodeData(condition: ID | Function): NodeModel | undefined {
|
|
832
|
-
const conds =
|
|
833
|
-
isString(condition) || isNumber(condition) ? [condition] : condition;
|
|
834
|
-
return this.dataController.findData('node', conds)?.[0] as NodeModel;
|
|
358
|
+
public removeComboData(ids: ID[] | ((data: ComboData[]) => ID[])): void {
|
|
359
|
+
this.context.model.removeComboData(isFunction(ids) ? ids(this.getComboData()) : ids);
|
|
835
360
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
* @returns result edge's inner data
|
|
840
|
-
* @group Data
|
|
841
|
-
*/
|
|
842
|
-
public getEdgeData(condition: ID | Function): EdgeModel | undefined {
|
|
843
|
-
const conds =
|
|
844
|
-
isString(condition) || isNumber(condition) || isNumber(condition)
|
|
845
|
-
? [condition]
|
|
846
|
-
: condition;
|
|
847
|
-
return this.dataController.findData('edge', conds)?.[0] as EdgeModel;
|
|
361
|
+
|
|
362
|
+
public getElementType(id: ID): ElementType {
|
|
363
|
+
return this.context.model.getElementType(id);
|
|
848
364
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
* @returns result combo's inner data
|
|
853
|
-
* @group Data
|
|
854
|
-
*/
|
|
855
|
-
public getComboData(condition: ID | Function): ComboModel | undefined {
|
|
856
|
-
const conds =
|
|
857
|
-
isString(condition) || isNumber(condition) ? [condition] : condition;
|
|
858
|
-
return this.dataController.findData('combo', conds)?.[0] as ComboModel;
|
|
365
|
+
|
|
366
|
+
public getRelatedEdgesData(id: ID, direction: EdgeDirection = 'both'): EdgeData[] {
|
|
367
|
+
return this.context.model.getRelatedEdgesData(id, direction);
|
|
859
368
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
* @group Data
|
|
864
|
-
*/
|
|
865
|
-
public getAllNodesData(): NodeModel[] {
|
|
866
|
-
return this.dataController.findAllData('node') as NodeModel[];
|
|
369
|
+
|
|
370
|
+
public getNeighborNodesData(id: ID): NodeData[] {
|
|
371
|
+
return this.context.model.getNeighborNodesData(id);
|
|
867
372
|
}
|
|
373
|
+
|
|
868
374
|
/**
|
|
869
|
-
*
|
|
870
|
-
*
|
|
871
|
-
*
|
|
375
|
+
* <zh/> 获取节点或 combo 的祖先元素数据
|
|
376
|
+
*
|
|
377
|
+
* <en/> Get the ancestor element data of the node or combo
|
|
378
|
+
* @param id - <zh/> 节点或 combo ID | <en/> node or combo ID
|
|
379
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是 combo 层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
380
|
+
* @returns <zh/> 祖先元素数据 | <en/> ancestor element data
|
|
381
|
+
* @description
|
|
382
|
+
* <zh/> 数组中的顺序是从父节点到祖先节点
|
|
383
|
+
*
|
|
384
|
+
* <en/> The order in the array is from the parent node to the ancestor node
|
|
872
385
|
*/
|
|
873
|
-
public
|
|
874
|
-
return this.
|
|
386
|
+
public getAncestorsData(id: ID, hierarchy: HierarchyKey): NodeLikeData[] {
|
|
387
|
+
return this.context.model.getAncestorsData(id, hierarchy);
|
|
875
388
|
}
|
|
389
|
+
|
|
876
390
|
/**
|
|
877
|
-
*
|
|
878
|
-
*
|
|
879
|
-
*
|
|
391
|
+
* <zh/> 获取节点或 combo 的父元素数据
|
|
392
|
+
*
|
|
393
|
+
* <en/> Get the parent element data of the node or combo
|
|
394
|
+
* @param id - <zh/> 节点或 combo ID | <en/> node or combo ID
|
|
395
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是 combo 层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
396
|
+
* @returns <zh/> 父元素数据 | <en/> parent element data
|
|
880
397
|
*/
|
|
881
|
-
public
|
|
882
|
-
return this.
|
|
398
|
+
public getParentData(id: ID, hierarchy: HierarchyKey): NodeLikeData | undefined {
|
|
399
|
+
return this.context.model.getParentData(id, hierarchy);
|
|
883
400
|
}
|
|
401
|
+
|
|
884
402
|
/**
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
* @
|
|
403
|
+
* <zh/> 获取节点或 combo 的子元素数据
|
|
404
|
+
*
|
|
405
|
+
* <en/> Get the child element data of the node or combo
|
|
406
|
+
* @param id - <zh/> 节点或 combo ID | <en/> node or combo ID
|
|
407
|
+
* @returns <zh/> 子元素数据 | <en/> child element data
|
|
889
408
|
*/
|
|
890
|
-
public
|
|
891
|
-
|
|
892
|
-
direction: 'in' | 'out' | 'both' = 'both',
|
|
893
|
-
): EdgeModel[] {
|
|
894
|
-
return this.dataController.findRelatedEdges(nodeId, direction);
|
|
409
|
+
public getChildrenData(id: ID): NodeLikeData[] {
|
|
410
|
+
return this.context.model.getChildrenData(id);
|
|
895
411
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
public getNeighborNodesData(
|
|
903
|
-
nodeId: ID,
|
|
904
|
-
direction: 'in' | 'out' | 'both' = 'both',
|
|
905
|
-
): NodeModel[] {
|
|
906
|
-
return this.dataController.findNeighborNodes(nodeId, direction);
|
|
412
|
+
|
|
413
|
+
public getElementDataByState(elementType: 'node', state: State): NodeData[];
|
|
414
|
+
public getElementDataByState(elementType: 'edge', state: State): EdgeData[];
|
|
415
|
+
public getElementDataByState(elementType: 'combo', state: State): ComboData[];
|
|
416
|
+
public getElementDataByState(elementType: ElementType, state: State): ElementDatum[] {
|
|
417
|
+
return this.context.model.getElementDataByState(elementType, state);
|
|
907
418
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
419
|
+
|
|
420
|
+
private createCanvas() {
|
|
421
|
+
if (this.context.canvas) return this.context.canvas;
|
|
422
|
+
|
|
423
|
+
const { container = 'container', width, height, renderer, background } = this.options;
|
|
424
|
+
|
|
425
|
+
if (container instanceof Canvas) {
|
|
426
|
+
this.context.canvas = container;
|
|
427
|
+
container.setBackground(background);
|
|
428
|
+
} else {
|
|
429
|
+
const $container = isString(container) ? document.getElementById(container!) : container;
|
|
430
|
+
|
|
431
|
+
this.context.canvas = new Canvas({
|
|
432
|
+
container: $container!,
|
|
433
|
+
width,
|
|
434
|
+
height,
|
|
435
|
+
renderer,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return this.context.canvas;
|
|
916
440
|
}
|
|
917
441
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
id: ID,
|
|
926
|
-
): NodeDisplayModel | EdgeDisplayModel | ComboDisplayModel {
|
|
927
|
-
return this.itemController.findDisplayModel(id);
|
|
442
|
+
private createRuntime() {
|
|
443
|
+
this.context.options = this.options;
|
|
444
|
+
if (!this.context.plugin) this.context.plugin = new PluginController(this.context);
|
|
445
|
+
if (!this.context.viewport) this.context.viewport = new ViewportController(this.context);
|
|
446
|
+
if (!this.context.element) this.context.element = new ElementController(this.context);
|
|
447
|
+
if (!this.context.layout) this.context.layout = new LayoutController(this.context);
|
|
448
|
+
if (!this.context.behavior) this.context.behavior = new BehaviorController(this.context);
|
|
928
449
|
}
|
|
929
450
|
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
public getNearEdgesForNode(nodeId: ID): EdgeModel[] {
|
|
936
|
-
const { graphCore } = this.dataController;
|
|
937
|
-
return this.itemController.findNearEdgesByNode(nodeId, graphCore);
|
|
451
|
+
private async prepare(): Promise<void> {
|
|
452
|
+
if (this.destroyed) throw new Error('Graph has been destroyed');
|
|
453
|
+
|
|
454
|
+
await this.createCanvas().init();
|
|
455
|
+
this.createRuntime();
|
|
938
456
|
}
|
|
939
457
|
|
|
940
458
|
/**
|
|
941
|
-
*
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
* @
|
|
945
|
-
*
|
|
946
|
-
*
|
|
459
|
+
* <zh/> 执行渲染
|
|
460
|
+
*
|
|
461
|
+
* <en/> Render
|
|
462
|
+
* @description
|
|
463
|
+
* <zh/> 此过程会执行数据更新、绘制元素、执行布局
|
|
464
|
+
*
|
|
465
|
+
* <en/> This process will execute data update, element rendering, and layout execution
|
|
947
466
|
*/
|
|
948
|
-
public
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
let ids = this.itemController.findIdByState(itemType, state, value);
|
|
955
|
-
if (additionalFilter) {
|
|
956
|
-
let getDataFunc: any = this.getEdgeData;
|
|
957
|
-
if (itemType === 'node') getDataFunc = this.getNodeData;
|
|
958
|
-
else if (itemType === 'combo') getDataFunc = this.getComboData;
|
|
959
|
-
ids = ids.filter((id) => additionalFilter(getDataFunc(id)));
|
|
960
|
-
}
|
|
961
|
-
return ids;
|
|
467
|
+
public async render(): Promise<void> {
|
|
468
|
+
emit(this, new GraphLifeCycleEvent(GraphEvent.BEFORE_RENDER));
|
|
469
|
+
await this.prepare();
|
|
470
|
+
await Promise.all([this.context.element?.draw(), this.context.layout?.layout()]);
|
|
471
|
+
await this.autoFit();
|
|
472
|
+
emit(this, new GraphLifeCycleEvent(GraphEvent.AFTER_RENDER));
|
|
962
473
|
}
|
|
474
|
+
|
|
963
475
|
/**
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
* @returns
|
|
968
|
-
* @group Data
|
|
476
|
+
* <zh/> 绘制元素
|
|
477
|
+
*
|
|
478
|
+
* <en/> Draw elements
|
|
479
|
+
* @returns <zh/> 渲染结果 | <en/> draw result
|
|
969
480
|
*/
|
|
970
|
-
public
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
| EdgeUserModel
|
|
975
|
-
| ComboUserModel
|
|
976
|
-
| NodeUserModel[]
|
|
977
|
-
| EdgeUserModel[]
|
|
978
|
-
| ComboUserModel[],
|
|
979
|
-
):
|
|
980
|
-
| NodeModel
|
|
981
|
-
| EdgeModel
|
|
982
|
-
| ComboModel
|
|
983
|
-
| NodeModel[]
|
|
984
|
-
| EdgeModel[]
|
|
985
|
-
| ComboModel[] {
|
|
986
|
-
// data controller and item controller subscribe additem in order
|
|
987
|
-
|
|
988
|
-
const { graphCore } = this.dataController;
|
|
989
|
-
const { specification } = this.themeController;
|
|
990
|
-
graphCore.once('changed', (event) => {
|
|
991
|
-
if (!event.changes.length) return;
|
|
992
|
-
const changes = event.changes;
|
|
993
|
-
this.hooks.itemchange.emit({
|
|
994
|
-
type: itemType,
|
|
995
|
-
changes: graphCore.reduceChanges(event.changes),
|
|
996
|
-
graphCore,
|
|
997
|
-
theme: specification,
|
|
998
|
-
});
|
|
999
|
-
this.emit('afteritemchange', {
|
|
1000
|
-
type: itemType,
|
|
1001
|
-
action: 'add',
|
|
1002
|
-
models,
|
|
1003
|
-
apiName: 'addData',
|
|
1004
|
-
changes,
|
|
1005
|
-
});
|
|
1006
|
-
});
|
|
481
|
+
public async draw(): Promise<void> {
|
|
482
|
+
await this.prepare();
|
|
483
|
+
return this.context.element!.draw();
|
|
484
|
+
}
|
|
1007
485
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
data[`${itemType}s`] = modelArr;
|
|
1011
|
-
this.hooks.datachange.emit({
|
|
1012
|
-
data,
|
|
1013
|
-
type: 'union',
|
|
1014
|
-
});
|
|
1015
|
-
const dataList = this.dataController.findData(
|
|
1016
|
-
itemType,
|
|
1017
|
-
modelArr.map((model) => model.id),
|
|
1018
|
-
);
|
|
1019
|
-
return isArray(models) ? dataList : dataList[0];
|
|
486
|
+
public layout(): Promise<void> {
|
|
487
|
+
return this.context.layout!.layout();
|
|
1020
488
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
* @returns whether success
|
|
1025
|
-
* @group Data
|
|
1026
|
-
*/
|
|
1027
|
-
public removeData(itemType: ITEM_TYPE, ids: ID | ID[]) {
|
|
1028
|
-
const idArr = isArray(ids) ? ids : [ids];
|
|
1029
|
-
const data = { nodes: [], edges: [], combos: [] };
|
|
1030
|
-
const { userGraphCore, graphCore } = this.dataController;
|
|
1031
|
-
const { specification } = this.themeController;
|
|
1032
|
-
const getItem =
|
|
1033
|
-
itemType === 'edge' ? userGraphCore.getEdge : userGraphCore.getNode;
|
|
1034
|
-
data[`${itemType}s`] = idArr.map((id) => getItem.bind(userGraphCore)(id));
|
|
1035
|
-
graphCore.once('changed', (event) => {
|
|
1036
|
-
if (!event.changes.length) return;
|
|
1037
|
-
const changes = event.changes;
|
|
1038
|
-
this.hooks.itemchange.emit({
|
|
1039
|
-
type: itemType,
|
|
1040
|
-
changes: event.changes,
|
|
1041
|
-
graphCore,
|
|
1042
|
-
theme: specification,
|
|
1043
|
-
});
|
|
1044
|
-
this.emit('afteritemchange', {
|
|
1045
|
-
type: itemType,
|
|
1046
|
-
action: 'remove',
|
|
1047
|
-
ids: idArr,
|
|
1048
|
-
apiName: 'removeData',
|
|
1049
|
-
changes,
|
|
1050
|
-
});
|
|
1051
|
-
});
|
|
1052
|
-
this.hooks.datachange.emit({
|
|
1053
|
-
data,
|
|
1054
|
-
type: 'remove',
|
|
1055
|
-
});
|
|
489
|
+
|
|
490
|
+
public stopLayout() {
|
|
491
|
+
return this.context.layout!.stopLayout();
|
|
1056
492
|
}
|
|
493
|
+
|
|
1057
494
|
/**
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
* @param changes
|
|
1062
|
-
* @returns
|
|
495
|
+
* <zh/> 清空画布元素
|
|
496
|
+
*
|
|
497
|
+
* <en/> Clear canvas elements
|
|
1063
498
|
*/
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
if (!oldValue || !newValue) return change;
|
|
1069
|
-
if (propertyName) {
|
|
1070
|
-
if (oldValue !== newValue) return change;
|
|
1071
|
-
return false;
|
|
1072
|
-
}
|
|
499
|
+
public async clear(): Promise<void> {
|
|
500
|
+
this.context.model.setData({});
|
|
501
|
+
await this.draw();
|
|
502
|
+
}
|
|
1073
503
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
504
|
+
public destroy(): void {
|
|
505
|
+
const { layout, element, model, canvas, behavior, plugin } = this.context;
|
|
506
|
+
plugin?.destroy();
|
|
507
|
+
behavior?.destroy();
|
|
508
|
+
layout?.destroy();
|
|
509
|
+
element?.destroy();
|
|
510
|
+
model.destroy();
|
|
511
|
+
canvas?.destroy();
|
|
512
|
+
this.options = {};
|
|
513
|
+
// @ts-expect-error force delete
|
|
514
|
+
this.context = {};
|
|
515
|
+
|
|
516
|
+
this.off();
|
|
517
|
+
window.removeEventListener('resize', this.onResize);
|
|
1087
518
|
|
|
1088
|
-
|
|
1089
|
-
(oldValue.x === undefined || Number.isNaN(oldValue.x)) &&
|
|
1090
|
-
!oldValue._isCombo
|
|
1091
|
-
)
|
|
1092
|
-
oldValue.x = 0;
|
|
1093
|
-
if (
|
|
1094
|
-
(oldValue.y === undefined || Number.isNaN(oldValue.x)) &&
|
|
1095
|
-
!oldValue._isCombo
|
|
1096
|
-
)
|
|
1097
|
-
oldValue.y = 0;
|
|
1098
|
-
if (Number.isNaN(newValue.x)) delete newValue.x;
|
|
1099
|
-
if (Number.isNaN(newValue.y)) delete newValue.y;
|
|
1100
|
-
|
|
1101
|
-
if (isEqual(newValue, oldValue)) return false;
|
|
1102
|
-
|
|
1103
|
-
return {
|
|
1104
|
-
...change,
|
|
1105
|
-
newValue,
|
|
1106
|
-
oldValue,
|
|
1107
|
-
};
|
|
1108
|
-
})
|
|
1109
|
-
.filter(Boolean);
|
|
519
|
+
this.destroyed = true;
|
|
1110
520
|
}
|
|
1111
|
-
/**
|
|
1112
|
-
* Update one or more node/edge/combo data on the graph.
|
|
1113
|
-
* @param {ITEM_TYPE} itemType 'node' | 'edge' | 'combo'
|
|
1114
|
-
* @param models new configurations for every node/edge/combo, which has id field to indicate the specific item
|
|
1115
|
-
* @group Data
|
|
1116
|
-
*/
|
|
1117
|
-
public updateData(
|
|
1118
|
-
itemType: ITEM_TYPE,
|
|
1119
|
-
models:
|
|
1120
|
-
| Partial<NodeUserModel>
|
|
1121
|
-
| Partial<EdgeUserModel>
|
|
1122
|
-
| Partial<
|
|
1123
|
-
| ComboUserModel
|
|
1124
|
-
| Partial<NodeUserModel>[]
|
|
1125
|
-
| Partial<EdgeUserModel>[]
|
|
1126
|
-
| Partial<ComboUserModel>[]
|
|
1127
|
-
>,
|
|
1128
|
-
):
|
|
1129
|
-
| NodeModel
|
|
1130
|
-
| EdgeModel
|
|
1131
|
-
| ComboModel
|
|
1132
|
-
| NodeModel[]
|
|
1133
|
-
| EdgeModel[]
|
|
1134
|
-
| ComboModel[] {
|
|
1135
|
-
const modelArr = isArray(models) ? models : [models];
|
|
1136
|
-
const data = { nodes: [], edges: [], combos: [] };
|
|
1137
|
-
data[`${itemType}s`] = modelArr;
|
|
1138
|
-
|
|
1139
|
-
const { graphCore } = this.dataController;
|
|
1140
|
-
const { specification } = this.themeController;
|
|
1141
|
-
graphCore.once('changed', (event) => {
|
|
1142
|
-
const changes = this.extendChanges(clone(event.changes));
|
|
1143
|
-
this.hooks.itemchange.emit({
|
|
1144
|
-
type: itemType,
|
|
1145
|
-
changes: event.changes,
|
|
1146
|
-
graphCore,
|
|
1147
|
-
theme: specification,
|
|
1148
|
-
});
|
|
1149
|
-
this.emit('afteritemchange', {
|
|
1150
|
-
type: itemType,
|
|
1151
|
-
action: 'update',
|
|
1152
|
-
models,
|
|
1153
|
-
apiName: 'updateData',
|
|
1154
|
-
changes,
|
|
1155
|
-
});
|
|
1156
|
-
});
|
|
1157
521
|
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
type: 'update',
|
|
1161
|
-
});
|
|
1162
|
-
const dataList = this.dataController.findData(
|
|
1163
|
-
itemType,
|
|
1164
|
-
modelArr.map((model) => model.id),
|
|
1165
|
-
);
|
|
1166
|
-
return isArray(models) ? dataList : dataList[0];
|
|
522
|
+
public getCanvas(): Canvas {
|
|
523
|
+
return this.context.canvas;
|
|
1167
524
|
}
|
|
1168
525
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
| Partial<NodeUserModel>
|
|
1178
|
-
| Partial<
|
|
1179
|
-
ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]
|
|
1180
|
-
>,
|
|
1181
|
-
upsertAncestors?: boolean,
|
|
1182
|
-
disableAnimate = false,
|
|
1183
|
-
callback?: (
|
|
1184
|
-
model: NodeModel | EdgeModel | ComboModel,
|
|
1185
|
-
canceled?: boolean,
|
|
1186
|
-
) => void,
|
|
1187
|
-
stack?: boolean,
|
|
1188
|
-
) {
|
|
1189
|
-
return this.updatePosition(
|
|
1190
|
-
'node',
|
|
1191
|
-
models,
|
|
1192
|
-
upsertAncestors,
|
|
1193
|
-
disableAnimate,
|
|
1194
|
-
callback,
|
|
1195
|
-
stack,
|
|
1196
|
-
);
|
|
526
|
+
public resize(): void;
|
|
527
|
+
public resize(width: number, height: number): void;
|
|
528
|
+
public resize(width?: number, height?: number): void {
|
|
529
|
+
const size: Vector2 = !width || !height ? sizeOf(this.context.canvas!.getContainer()!) : [width, height];
|
|
530
|
+
if (isEqual(size, this.getSize())) return;
|
|
531
|
+
emit(this, new GraphLifeCycleEvent(GraphEvent.BEFORE_SIZE_CHANGE, { size }));
|
|
532
|
+
this.context.canvas.resize(...size);
|
|
533
|
+
emit(this, new GraphLifeCycleEvent(GraphEvent.AFTER_SIZE_CHANGE, { size }));
|
|
1197
534
|
}
|
|
1198
535
|
|
|
1199
536
|
/**
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1202
|
-
*
|
|
1203
|
-
* @param
|
|
1204
|
-
* @
|
|
537
|
+
* <zh/> 将图缩放至合适大小并平移至视口中心
|
|
538
|
+
*
|
|
539
|
+
* <en/> Zoom the graph to fit the viewport and move it to the center of the viewport
|
|
540
|
+
* @param options - <zh/> 适配配置 | <en/> fit options
|
|
541
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
1205
542
|
*/
|
|
1206
|
-
public
|
|
1207
|
-
|
|
1208
|
-
| Partial<NodeUserModel>
|
|
1209
|
-
| Partial<
|
|
1210
|
-
ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]
|
|
1211
|
-
>,
|
|
1212
|
-
upsertAncestors?: boolean,
|
|
1213
|
-
disableAnimate = false,
|
|
1214
|
-
callback?: (model: NodeModel | EdgeModel | ComboModel) => void,
|
|
1215
|
-
stack?: boolean,
|
|
1216
|
-
) {
|
|
1217
|
-
return this.updatePosition(
|
|
1218
|
-
'combo',
|
|
1219
|
-
models,
|
|
1220
|
-
upsertAncestors,
|
|
1221
|
-
disableAnimate,
|
|
1222
|
-
callback,
|
|
1223
|
-
stack,
|
|
1224
|
-
);
|
|
543
|
+
public async fitView(options?: FitViewOptions, animation?: ViewportAnimationEffectTiming): Promise<void> {
|
|
544
|
+
await this.context.viewport?.fitView(options, animation);
|
|
1225
545
|
}
|
|
1226
546
|
|
|
1227
547
|
/**
|
|
1228
|
-
*
|
|
548
|
+
* <zh/> 将图平移至视口中心
|
|
549
|
+
*
|
|
550
|
+
* <en/> Move the graph to the center of the viewport
|
|
551
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
1229
552
|
*/
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
!this.specification.enableStack ||
|
|
1233
|
-
!this.pluginController.hasPlugin('history')
|
|
1234
|
-
) {
|
|
1235
|
-
console.error('The history plugin is not loaded or initialized.');
|
|
1236
|
-
return;
|
|
1237
|
-
}
|
|
1238
|
-
return this.pluginController.getPlugin('history') as History;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
private updatePosition(
|
|
1242
|
-
type: 'node' | 'combo',
|
|
1243
|
-
models:
|
|
1244
|
-
| Partial<NodeUserModel>
|
|
1245
|
-
| Partial<
|
|
1246
|
-
ComboUserModel | Partial<NodeUserModel>[] | Partial<ComboUserModel>[]
|
|
1247
|
-
>,
|
|
1248
|
-
upsertAncestors?: boolean,
|
|
1249
|
-
disableAnimate = false,
|
|
1250
|
-
callback?: (
|
|
1251
|
-
model: NodeModel | EdgeModel | ComboModel,
|
|
1252
|
-
canceled?: boolean,
|
|
1253
|
-
) => void,
|
|
1254
|
-
stack?: boolean,
|
|
1255
|
-
) {
|
|
1256
|
-
const modelArr = isArray(models) ? models : [models];
|
|
1257
|
-
const { graphCore } = this.dataController;
|
|
1258
|
-
const { specification } = this.themeController;
|
|
1259
|
-
graphCore.once('changed', (event) => {
|
|
1260
|
-
if (!event.changes.length) return;
|
|
1261
|
-
const changes = event.changes.filter(
|
|
1262
|
-
(change) => !isEqual(change.newValue, change.oldValue),
|
|
1263
|
-
);
|
|
1264
|
-
this.hooks.itemchange.emit({
|
|
1265
|
-
type,
|
|
1266
|
-
changes: event.changes,
|
|
1267
|
-
graphCore,
|
|
1268
|
-
theme: specification,
|
|
1269
|
-
upsertAncestors,
|
|
1270
|
-
action: 'updatePosition',
|
|
1271
|
-
animate: !disableAnimate,
|
|
1272
|
-
callback,
|
|
1273
|
-
});
|
|
1274
|
-
this.emit('afteritemchange', {
|
|
1275
|
-
type,
|
|
1276
|
-
action: 'updatePosition',
|
|
1277
|
-
upsertAncestors,
|
|
1278
|
-
models,
|
|
1279
|
-
apiName: 'updatePosition',
|
|
1280
|
-
changes,
|
|
1281
|
-
});
|
|
1282
|
-
});
|
|
1283
|
-
|
|
1284
|
-
this.hooks.datachange.emit({
|
|
1285
|
-
data: {
|
|
1286
|
-
nodes: type === 'node' ? (modelArr as NodeUserModel[]) : [],
|
|
1287
|
-
edges: [],
|
|
1288
|
-
combos: type === 'combo' ? (modelArr as ComboUserModel[]) : [],
|
|
1289
|
-
},
|
|
1290
|
-
type: 'update',
|
|
1291
|
-
});
|
|
1292
|
-
const dataList = this.dataController.findData(
|
|
1293
|
-
type,
|
|
1294
|
-
modelArr.map((model) => model.id),
|
|
1295
|
-
);
|
|
1296
|
-
return isArray(models) ? dataList : dataList[0];
|
|
553
|
+
public async fitCenter(animation?: ViewportAnimationEffectTiming): Promise<void> {
|
|
554
|
+
await this.context.viewport?.fitCenter(animation);
|
|
1297
555
|
}
|
|
1298
556
|
|
|
1299
|
-
private
|
|
1300
|
-
const
|
|
1301
|
-
|
|
557
|
+
private async autoFit(): Promise<void> {
|
|
558
|
+
const { autoFit } = this.context.options;
|
|
559
|
+
if (!autoFit) return;
|
|
1302
560
|
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
561
|
+
if (isString(autoFit)) {
|
|
562
|
+
if (autoFit === 'view') await this.fitView();
|
|
563
|
+
else if (autoFit === 'center') await this.fitCenter();
|
|
564
|
+
} else {
|
|
565
|
+
const { type, animation } = autoFit;
|
|
566
|
+
if (type === 'view') await this.fitView(autoFit.options, animation);
|
|
567
|
+
else if (type === 'center') await this.fitCenter(animation);
|
|
1309
568
|
}
|
|
1310
|
-
return values;
|
|
1311
569
|
}
|
|
1312
570
|
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
* @param item the item to be shown
|
|
1316
|
-
* @returns
|
|
1317
|
-
* @group Item
|
|
1318
|
-
*/
|
|
1319
|
-
public showItem(ids: ID | ID[], disableAnimate = false) {
|
|
1320
|
-
const idArr = isArray(ids) ? ids : [ids];
|
|
1321
|
-
if (isEmpty(idArr)) return;
|
|
1322
|
-
const changes = {
|
|
1323
|
-
newValue: [{ ids: idArr, visible: true }],
|
|
1324
|
-
oldValue: this.getItemPreviousVisibility(idArr),
|
|
1325
|
-
};
|
|
1326
|
-
this.hooks.itemvisibilitychange.emit({
|
|
1327
|
-
ids: idArr as ID[],
|
|
1328
|
-
value: true,
|
|
1329
|
-
graphCore: this.dataController.graphCore,
|
|
1330
|
-
animate: !disableAnimate,
|
|
1331
|
-
});
|
|
1332
|
-
this.emit('afteritemvisibilitychange', {
|
|
1333
|
-
ids,
|
|
1334
|
-
value: true,
|
|
1335
|
-
animate: !disableAnimate,
|
|
1336
|
-
action: 'updateVisibility',
|
|
1337
|
-
apiName: 'showItem',
|
|
1338
|
-
changes,
|
|
1339
|
-
});
|
|
1340
|
-
}
|
|
1341
|
-
/**
|
|
1342
|
-
* Hide the item(s).
|
|
1343
|
-
* @param item the item to be hidden
|
|
1344
|
-
* @returns
|
|
1345
|
-
* @group Item
|
|
1346
|
-
*/
|
|
1347
|
-
public hideItem(ids: ID | ID[], disableAnimate = false) {
|
|
1348
|
-
const idArr = isArray(ids) ? ids : [ids];
|
|
1349
|
-
if (isEmpty(idArr)) return;
|
|
1350
|
-
const changes = {
|
|
1351
|
-
newValue: [{ ids: idArr, visible: false }],
|
|
1352
|
-
oldValue: this.getItemPreviousVisibility(idArr),
|
|
1353
|
-
};
|
|
1354
|
-
this.hooks.itemvisibilitychange.emit({
|
|
1355
|
-
ids: idArr as ID[],
|
|
1356
|
-
value: false,
|
|
1357
|
-
graphCore: this.dataController.graphCore,
|
|
1358
|
-
animate: !disableAnimate,
|
|
1359
|
-
});
|
|
1360
|
-
this.emit('afteritemvisibilitychange', {
|
|
1361
|
-
ids,
|
|
1362
|
-
value: false,
|
|
1363
|
-
animate: !disableAnimate,
|
|
1364
|
-
action: 'updateVisibility',
|
|
1365
|
-
apiName: 'hideItem',
|
|
1366
|
-
changes,
|
|
1367
|
-
});
|
|
571
|
+
public async focusElement(id: ID | ID[], animation?: ViewportAnimationEffectTiming): Promise<void> {
|
|
572
|
+
await this.context.viewport?.focusElements(Array.isArray(id) ? id : [id], animation);
|
|
1368
573
|
}
|
|
1369
574
|
|
|
1370
575
|
/**
|
|
1371
|
-
*
|
|
1372
|
-
*
|
|
1373
|
-
*
|
|
1374
|
-
* @
|
|
576
|
+
* <zh/> 基于当前缩放比例进行缩放
|
|
577
|
+
*
|
|
578
|
+
* <en/> Zoom based on the current zoom ratio
|
|
579
|
+
* @param ratio - <zh/> 缩放比例 | <en/> zoom ratio
|
|
580
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
581
|
+
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
582
|
+
* @description
|
|
583
|
+
* <zh/>
|
|
584
|
+
* - ratio > 1 放大
|
|
585
|
+
* - ratio < 1 缩小
|
|
586
|
+
* <en/>
|
|
587
|
+
* - ratio > 1 zoom in
|
|
588
|
+
* - ratio < 1 zoom out
|
|
1375
589
|
*/
|
|
1376
|
-
public
|
|
1377
|
-
|
|
1378
|
-
this.hooks.itemzindexchange.emit({
|
|
1379
|
-
ids: idArr as ID[],
|
|
1380
|
-
action: 'front',
|
|
1381
|
-
graphCore: this.dataController.graphCore,
|
|
1382
|
-
});
|
|
1383
|
-
this.emit('afteritemzindexchange', {
|
|
1384
|
-
ids: idArr,
|
|
1385
|
-
action: 'front',
|
|
1386
|
-
apiName: 'frontItem',
|
|
1387
|
-
});
|
|
590
|
+
public async zoomBy(ratio: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void> {
|
|
591
|
+
await this.context.viewport!.transform({ mode: 'relative', scale: ratio, origin }, animation);
|
|
1388
592
|
}
|
|
593
|
+
|
|
1389
594
|
/**
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1393
|
-
* @
|
|
595
|
+
* <zh/> 缩放画布至指定比例
|
|
596
|
+
*
|
|
597
|
+
* <en/> Zoom the canvas to the specified ratio
|
|
598
|
+
* @param zoom - <zh/> 指定缩放比例 | <en/> specified zoom ratio
|
|
599
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
600
|
+
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
601
|
+
* @description
|
|
602
|
+
* <zh/>
|
|
603
|
+
* - zoom = 1 默认大小
|
|
604
|
+
* - zoom > 1 放大
|
|
605
|
+
* - zoom < 1 缩小
|
|
606
|
+
* <en/>
|
|
607
|
+
* - zoom = 1 default size
|
|
608
|
+
* - zoom > 1 zoom in
|
|
609
|
+
* - zoom < 1 zoom out
|
|
610
|
+
*/
|
|
611
|
+
public async zoomTo(zoom: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void> {
|
|
612
|
+
this.context.viewport!.transform({ mode: 'absolute', scale: zoom, origin }, animation);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* <zh/> 获取当前缩放比例
|
|
617
|
+
*
|
|
618
|
+
* <en/> Get the current zoom ratio
|
|
619
|
+
* @returns <zh/> 缩放比例 | <en/> zoom ratio
|
|
1394
620
|
*/
|
|
1395
|
-
public
|
|
1396
|
-
|
|
1397
|
-
this.hooks.itemzindexchange.emit({
|
|
1398
|
-
ids: idArr as ID[],
|
|
1399
|
-
action: 'back',
|
|
1400
|
-
graphCore: this.dataController.graphCore,
|
|
1401
|
-
});
|
|
1402
|
-
this.emit('afteritemzindexchange', {
|
|
1403
|
-
ids: idArr,
|
|
1404
|
-
action: 'back',
|
|
1405
|
-
apiName: 'backItem',
|
|
1406
|
-
});
|
|
621
|
+
public getZoom(): number {
|
|
622
|
+
return this.context.viewport!.getZoom();
|
|
1407
623
|
}
|
|
1408
624
|
|
|
1409
|
-
private getItemPreviousStates(stateOption: {
|
|
1410
|
-
ids: ID | ID[];
|
|
1411
|
-
states: string | string[];
|
|
1412
|
-
value: boolean;
|
|
1413
|
-
}) {
|
|
1414
|
-
const { ids, states } = stateOption;
|
|
1415
|
-
const idArr = Array.isArray(ids) ? ids : [ids];
|
|
1416
|
-
const stateArr = Array.isArray(states) ? states : [states];
|
|
1417
|
-
if (isEmpty(idArr)) return;
|
|
1418
|
-
return idArr.flatMap((id) => {
|
|
1419
|
-
return stateArr.map((state) => ({
|
|
1420
|
-
ids: id,
|
|
1421
|
-
states: state,
|
|
1422
|
-
value: this.getItemState(id, state),
|
|
1423
|
-
}));
|
|
1424
|
-
});
|
|
1425
|
-
}
|
|
1426
625
|
/**
|
|
1427
|
-
*
|
|
1428
|
-
*
|
|
1429
|
-
*
|
|
1430
|
-
* @param
|
|
1431
|
-
* @
|
|
1432
|
-
* @
|
|
626
|
+
* <zh/> 基于当前旋转角度进行旋转
|
|
627
|
+
*
|
|
628
|
+
* <en/> Rotate based on the current rotation angle
|
|
629
|
+
* @param angle - <zh/> 旋转角度 | <en/> rotation angle
|
|
630
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
631
|
+
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
1433
632
|
*/
|
|
1434
|
-
public
|
|
1435
|
-
|
|
1436
|
-
states: string | string[],
|
|
1437
|
-
value: boolean,
|
|
1438
|
-
) {
|
|
1439
|
-
const idArr = isArray(ids) ? ids : [ids];
|
|
1440
|
-
const stateArr = isArray(states) ? states : [states];
|
|
1441
|
-
const stateOption = { ids: idArr, states: stateArr, value };
|
|
1442
|
-
const changes = {
|
|
1443
|
-
newValue: [stateOption],
|
|
1444
|
-
oldValue: this.getItemPreviousStates(stateOption),
|
|
1445
|
-
};
|
|
1446
|
-
this.hooks.itemstatechange.emit({
|
|
1447
|
-
ids: idArr as ID[],
|
|
1448
|
-
states: stateArr as string[],
|
|
1449
|
-
value,
|
|
1450
|
-
});
|
|
1451
|
-
this.emit('afteritemstatechange', {
|
|
1452
|
-
ids,
|
|
1453
|
-
states,
|
|
1454
|
-
value,
|
|
1455
|
-
action: 'updateState',
|
|
1456
|
-
apiName: 'setItemState',
|
|
1457
|
-
changes,
|
|
1458
|
-
});
|
|
633
|
+
public async rotateBy(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void> {
|
|
634
|
+
await this.context.viewport!.transform({ mode: 'relative', rotate: angle, origin }, animation);
|
|
1459
635
|
}
|
|
636
|
+
|
|
1460
637
|
/**
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1464
|
-
* @
|
|
1465
|
-
* @
|
|
638
|
+
* <zh/> 旋转画布至指定角度
|
|
639
|
+
*
|
|
640
|
+
* <en/> Rotate the canvas to the specified angle
|
|
641
|
+
* @param angle - <zh/> 目标角度 | <en/> target angle
|
|
642
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
643
|
+
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
1466
644
|
*/
|
|
1467
|
-
public
|
|
1468
|
-
|
|
645
|
+
public async rotateTo(angle: number, animation?: ViewportAnimationEffectTiming, origin?: Point): Promise<void> {
|
|
646
|
+
await this.context.viewport!.transform({ mode: 'absolute', rotate: angle, origin }, animation);
|
|
1469
647
|
}
|
|
1470
648
|
|
|
1471
649
|
/**
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
1474
|
-
*
|
|
1475
|
-
* @
|
|
650
|
+
* <zh/> 获取当前旋转角度
|
|
651
|
+
*
|
|
652
|
+
* <en/> Get the current rotation angle
|
|
653
|
+
* @returns <zh/> 旋转角度 | <en/> rotation angle
|
|
1476
654
|
*/
|
|
1477
|
-
public
|
|
1478
|
-
return this.
|
|
655
|
+
public getRotation(): number {
|
|
656
|
+
return this.context.viewport!.getRotation();
|
|
1479
657
|
}
|
|
1480
658
|
|
|
1481
659
|
/**
|
|
1482
|
-
*
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1485
|
-
* @
|
|
1486
|
-
* @
|
|
660
|
+
* <zh/> 将图平移指定距离
|
|
661
|
+
*
|
|
662
|
+
* <en/> Translate the graph by the specified distance
|
|
663
|
+
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
664
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
1487
665
|
*/
|
|
1488
|
-
public
|
|
1489
|
-
|
|
1490
|
-
const stateOptions = { ids: idArr, states, value: false };
|
|
1491
|
-
const changes = {
|
|
1492
|
-
newValue: [stateOptions],
|
|
1493
|
-
oldValue: this.getItemPreviousStates(stateOptions),
|
|
1494
|
-
};
|
|
1495
|
-
this.hooks.itemstatechange.emit({
|
|
1496
|
-
ids: idArr as ID[],
|
|
1497
|
-
states,
|
|
1498
|
-
value: false,
|
|
1499
|
-
});
|
|
1500
|
-
this.emit('afteritemstatechange', {
|
|
1501
|
-
ids,
|
|
1502
|
-
states,
|
|
1503
|
-
value: false,
|
|
1504
|
-
action: 'updateState',
|
|
1505
|
-
apiName: 'clearItemState',
|
|
1506
|
-
changes,
|
|
1507
|
-
});
|
|
666
|
+
public async translateBy(offset: Point, animation?: ViewportAnimationEffectTiming): Promise<void> {
|
|
667
|
+
await this.context.viewport!.transform({ mode: 'relative', translate: offset }, animation);
|
|
1508
668
|
}
|
|
1509
669
|
|
|
1510
670
|
/**
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1513
|
-
*
|
|
1514
|
-
* @
|
|
671
|
+
* <zh/> 将图平移至指定位置
|
|
672
|
+
*
|
|
673
|
+
* <en/> Translate the graph to the specified position
|
|
674
|
+
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
675
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
676
|
+
* @description
|
|
1515
677
|
*/
|
|
1516
|
-
public
|
|
1517
|
-
|
|
1518
|
-
onlyKeyShape = false,
|
|
1519
|
-
isTransient = false,
|
|
1520
|
-
): AABB | false {
|
|
1521
|
-
if (!id) return this.canvas.getRoot().getRenderBounds();
|
|
1522
|
-
return this.itemController.getItemBBox(id, onlyKeyShape, isTransient);
|
|
678
|
+
public async translateTo(position: Point, animation?: ViewportAnimationEffectTiming): Promise<void> {
|
|
679
|
+
await this.context.viewport!.transform({ mode: 'absolute', translate: position }, animation);
|
|
1523
680
|
}
|
|
1524
681
|
|
|
1525
682
|
/**
|
|
1526
|
-
*
|
|
1527
|
-
*
|
|
1528
|
-
*
|
|
1529
|
-
* @
|
|
683
|
+
* <zh/> 获取图的位置
|
|
684
|
+
*
|
|
685
|
+
* <en/> Get the position of the graph
|
|
686
|
+
* @returns <zh/> 图的位置 | <en/> position of the graph
|
|
687
|
+
* @description
|
|
688
|
+
* <zh/> 默认状态下,图的位置为 [0, 0]
|
|
689
|
+
*
|
|
690
|
+
* <en/> By default, the position of the graph is [0, 0]
|
|
1530
691
|
*/
|
|
1531
|
-
public
|
|
1532
|
-
return this.
|
|
692
|
+
public getPosition(): Point {
|
|
693
|
+
return subtract([0, 0], this.getCanvasByViewport([0, 0]));
|
|
1533
694
|
}
|
|
1534
695
|
|
|
1535
|
-
// ===== combo operations =====
|
|
1536
|
-
|
|
1537
696
|
/**
|
|
1538
|
-
*
|
|
1539
|
-
*
|
|
1540
|
-
*
|
|
1541
|
-
* @
|
|
1542
|
-
* @
|
|
697
|
+
* <zh/> 将元素平移指定距离
|
|
698
|
+
*
|
|
699
|
+
* <en/> Translate the element by the specified distance
|
|
700
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
701
|
+
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
702
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
1543
703
|
*/
|
|
1544
|
-
public
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
changes,
|
|
1562
|
-
});
|
|
1563
|
-
});
|
|
704
|
+
public async translateElementBy(id: ID, offset: Position, animation?: boolean): Promise<void>;
|
|
705
|
+
/**
|
|
706
|
+
* <zh/> 批量将元素平移指定距离
|
|
707
|
+
*
|
|
708
|
+
* <en/> Batch translate elements by the specified distance
|
|
709
|
+
* @param offsets - <zh/> 偏移量配置 | <en/> offset configuration
|
|
710
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
711
|
+
*/
|
|
712
|
+
public async translateElementBy(offsets: Record<ID, Position>, animation?: boolean): Promise<void>;
|
|
713
|
+
public async translateElementBy(
|
|
714
|
+
args1: ID | Record<ID, Position>,
|
|
715
|
+
args2?: Position | boolean,
|
|
716
|
+
args3: boolean = true,
|
|
717
|
+
): Promise<void> {
|
|
718
|
+
const [config, animation] = isObject(args1)
|
|
719
|
+
? [args1, (args2 as boolean) ?? true]
|
|
720
|
+
: [{ [args1 as ID]: args2 as Position }, args3];
|
|
1564
721
|
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
edges: [],
|
|
1568
|
-
combos: [
|
|
1569
|
-
{
|
|
1570
|
-
...model,
|
|
1571
|
-
data: {
|
|
1572
|
-
...model.data,
|
|
1573
|
-
_children: childrenIds,
|
|
1574
|
-
},
|
|
1575
|
-
},
|
|
1576
|
-
],
|
|
1577
|
-
};
|
|
1578
|
-
this.hooks.datachange.emit({
|
|
1579
|
-
data,
|
|
1580
|
-
type: 'addCombo',
|
|
1581
|
-
});
|
|
1582
|
-
return this.dataController.findData('combo', [model.id])[0] as ComboModel;
|
|
722
|
+
Object.entries(config).forEach(([id, offset]) => this.context.model.translateNodeBy(id, offset));
|
|
723
|
+
await this.context.element!.draw({ animation });
|
|
1583
724
|
}
|
|
725
|
+
|
|
1584
726
|
/**
|
|
1585
|
-
*
|
|
1586
|
-
*
|
|
1587
|
-
*
|
|
727
|
+
* <zh/> 将元素平移至指定位置
|
|
728
|
+
*
|
|
729
|
+
* <en/> Translate the element to the specified position
|
|
730
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
731
|
+
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
732
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
1588
733
|
*/
|
|
1589
|
-
public
|
|
1590
|
-
const ids = isArray(comboIds) ? comboIds : [comboIds];
|
|
1591
|
-
this.executeWithoutStacking(() => {
|
|
1592
|
-
this.updateData(
|
|
1593
|
-
'combo',
|
|
1594
|
-
ids.map((id) => ({ id, data: { collapsed: true } })),
|
|
1595
|
-
);
|
|
1596
|
-
});
|
|
1597
|
-
this.emit('aftercollapsecombo', {
|
|
1598
|
-
type: 'combo',
|
|
1599
|
-
action: 'collapseCombo',
|
|
1600
|
-
ids: comboIds,
|
|
1601
|
-
apiName: 'collapseCombo',
|
|
1602
|
-
});
|
|
1603
|
-
}
|
|
734
|
+
public async translateElementTo(id: ID, position: Position, animation?: boolean): Promise<void>;
|
|
1604
735
|
/**
|
|
1605
|
-
*
|
|
1606
|
-
*
|
|
1607
|
-
*
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
});
|
|
736
|
+
* <zh/> 批量将元素平移至指定位置
|
|
737
|
+
*
|
|
738
|
+
* <en/> Batch translate elements to the specified position
|
|
739
|
+
* @param positions - <zh/> 位置配置 | <en/> position configuration
|
|
740
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
741
|
+
*/
|
|
742
|
+
public async translateElementTo(positions: Record<ID, Position>, animation?: boolean): Promise<void>;
|
|
743
|
+
public async translateElementTo(
|
|
744
|
+
args1: ID | Record<ID, Position>,
|
|
745
|
+
args2?: boolean | Position,
|
|
746
|
+
args3: boolean = true,
|
|
747
|
+
): Promise<void> {
|
|
748
|
+
const [config, animation] = isObject(args1)
|
|
749
|
+
? [args1, (args2 as boolean) ?? true]
|
|
750
|
+
: [{ [args1 as ID]: args2 as Position }, args3];
|
|
751
|
+
|
|
752
|
+
Object.entries(config).forEach(([id, position]) => this.context.model.translateNodeTo(id, position));
|
|
753
|
+
await this.context.element!.draw({ animation });
|
|
1623
754
|
}
|
|
1624
755
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
* In fact, it changes the succeed nodes positions to affect the combo's position, but not modify the combo's position directly.
|
|
1629
|
-
* @param models new configurations with x and y for every combo, which has id field to indicate the specific item
|
|
1630
|
-
* @group Combo
|
|
1631
|
-
*/
|
|
1632
|
-
public moveCombo(
|
|
1633
|
-
ids: ID | ID[],
|
|
1634
|
-
dx: number,
|
|
1635
|
-
dy: number,
|
|
1636
|
-
upsertAncestors?: boolean,
|
|
1637
|
-
callback?: (
|
|
1638
|
-
model: NodeModel | EdgeModel | ComboModel,
|
|
1639
|
-
canceled?: boolean,
|
|
1640
|
-
) => void,
|
|
1641
|
-
): ComboModel[] {
|
|
1642
|
-
const idArr = isArray(ids) ? ids : [ids];
|
|
1643
|
-
const { graphCore } = this.dataController;
|
|
1644
|
-
const { specification } = this.themeController;
|
|
1645
|
-
graphCore.once('changed', (event) => {
|
|
1646
|
-
if (!event.changes.length) return;
|
|
1647
|
-
const changes = this.extendChanges(clone(event.changes));
|
|
1648
|
-
this.hooks.itemchange.emit({
|
|
1649
|
-
type: 'combo',
|
|
1650
|
-
changes: event.changes,
|
|
1651
|
-
graphCore,
|
|
1652
|
-
theme: specification,
|
|
1653
|
-
upsertAncestors,
|
|
1654
|
-
action: 'updatePosition',
|
|
1655
|
-
callback,
|
|
1656
|
-
});
|
|
1657
|
-
this.emit('afteritemchange', {
|
|
1658
|
-
type: 'combo',
|
|
1659
|
-
ids: idArr,
|
|
1660
|
-
dx,
|
|
1661
|
-
dy,
|
|
1662
|
-
action: 'updatePosition',
|
|
1663
|
-
upsertAncestors,
|
|
1664
|
-
apiName: 'moveCombo',
|
|
1665
|
-
changes,
|
|
1666
|
-
});
|
|
1667
|
-
});
|
|
756
|
+
public getElementPosition(id: ID): Position {
|
|
757
|
+
return this.context.model.getElementPosition(id);
|
|
758
|
+
}
|
|
1668
759
|
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
nodes: [],
|
|
1672
|
-
edges: [],
|
|
1673
|
-
combos: idArr.map((id) => ({ id, data: { dx, dy } })),
|
|
1674
|
-
},
|
|
1675
|
-
type: 'moveCombo',
|
|
1676
|
-
});
|
|
1677
|
-
return this.dataController.findData('combo', idArr) as ComboModel[];
|
|
760
|
+
public getElementRenderStyle(id: ID) {
|
|
761
|
+
return omit(this.context.element!.getElement(id)!.attributes, ['context']);
|
|
1678
762
|
}
|
|
1679
763
|
|
|
1680
|
-
// ===== layout =====
|
|
1681
764
|
/**
|
|
1682
|
-
*
|
|
765
|
+
* <zh/> 设置元素可见性
|
|
766
|
+
*
|
|
767
|
+
* <en/> Set element visibility
|
|
768
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
769
|
+
* @param visibility - <zh/> 可见性 | <en/> visibility
|
|
770
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
1683
771
|
*/
|
|
1684
|
-
public async
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
y: Number(node.data.y) || 0,
|
|
1714
|
-
},
|
|
1715
|
-
})),
|
|
1716
|
-
edges: [],
|
|
1717
|
-
};
|
|
1718
|
-
};
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
await this.hooks.layout.emitLinearAsync({
|
|
1723
|
-
graphCore,
|
|
1724
|
-
options: formattedOptions,
|
|
1725
|
-
animate: !disableAnimate,
|
|
772
|
+
public async setElementVisibility(
|
|
773
|
+
id: ID,
|
|
774
|
+
visibility: BaseStyleProps['visibility'],
|
|
775
|
+
animation?: boolean,
|
|
776
|
+
): Promise<void>;
|
|
777
|
+
/**
|
|
778
|
+
* <zh/> 批量设置元素可见性
|
|
779
|
+
*
|
|
780
|
+
* <en/> Batch set element visibility
|
|
781
|
+
* @param visibility - <zh/> 可见性配置 | <en/> visibility configuration
|
|
782
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
783
|
+
*/
|
|
784
|
+
public async setElementVisibility(
|
|
785
|
+
visibility: Record<ID, BaseStyleProps['visibility']>,
|
|
786
|
+
animation?: boolean,
|
|
787
|
+
): Promise<void>;
|
|
788
|
+
public async setElementVisibility(
|
|
789
|
+
args1: ID | Record<ID, BaseStyleProps['visibility']>,
|
|
790
|
+
args2?: boolean | BaseStyleProps['visibility'],
|
|
791
|
+
args3: boolean = true,
|
|
792
|
+
): Promise<void> {
|
|
793
|
+
const [config, animation] = isObject(args1)
|
|
794
|
+
? [args1, (args2 as boolean) ?? true]
|
|
795
|
+
: [{ [args1]: args2 as BaseStyleProps['visibility'] }, args3];
|
|
796
|
+
|
|
797
|
+
const dataToUpdate: Required<PartialGraphData> = { nodes: [], edges: [], combos: [] };
|
|
798
|
+
Object.entries(config).forEach(([id, value]) => {
|
|
799
|
+
const elementType = this.getElementType(id);
|
|
800
|
+
dataToUpdate[`${elementType}s`].push({ id, style: { visibility: value } });
|
|
1726
801
|
});
|
|
802
|
+
this.updateData(dataToUpdate);
|
|
1727
803
|
|
|
1728
|
-
this.
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
/**
|
|
1732
|
-
* Some layout algorithms has many iterations which can be stopped at any time.
|
|
1733
|
-
*/
|
|
1734
|
-
public stopLayout() {
|
|
1735
|
-
this.layoutController.stopLayout();
|
|
804
|
+
await this.context.element!.draw({ animation, stage: 'visibility' });
|
|
1736
805
|
}
|
|
1737
806
|
|
|
1738
807
|
/**
|
|
808
|
+
* <zh/> 显示元素
|
|
1739
809
|
*
|
|
1740
|
-
*
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
810
|
+
* <en/> Show element
|
|
811
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
812
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
813
|
+
*/
|
|
814
|
+
public async showElement(id: ID | ID[], animation?: boolean): Promise<void> {
|
|
815
|
+
const ids = Array.isArray(id) ? id : [id];
|
|
816
|
+
await this.setElementVisibility(
|
|
817
|
+
Object.fromEntries(ids.map((_id) => [_id, 'visible'] as [ID, BaseStyleProps['visibility']])),
|
|
818
|
+
animation,
|
|
819
|
+
);
|
|
1744
820
|
}
|
|
1745
821
|
|
|
1746
822
|
/**
|
|
1747
|
-
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
* @
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
823
|
+
* <zh/> 隐藏元素
|
|
824
|
+
*
|
|
825
|
+
* <en/> Hide element
|
|
826
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
827
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
828
|
+
*/
|
|
829
|
+
public async hideElement(id: ID | ID[], animation?: boolean): Promise<void> {
|
|
830
|
+
const ids = Array.isArray(id) ? id : [id];
|
|
831
|
+
await this.setElementVisibility(
|
|
832
|
+
Object.fromEntries(ids.map((_id) => [_id, 'hidden'] as [ID, BaseStyleProps['visibility']])),
|
|
833
|
+
animation,
|
|
834
|
+
);
|
|
1754
835
|
}
|
|
1755
836
|
|
|
1756
837
|
/**
|
|
1757
|
-
*
|
|
1758
|
-
*
|
|
1759
|
-
*
|
|
838
|
+
* <zh/> 获取元素可见性
|
|
839
|
+
*
|
|
840
|
+
* <en/> Get element visibility
|
|
841
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
842
|
+
* @returns <zh/> 元素可见性 | <en/> element visibility
|
|
1760
843
|
*/
|
|
1761
|
-
public
|
|
1762
|
-
|
|
844
|
+
public getElementVisibility(id: ID): BaseStyleProps['visibility'] {
|
|
845
|
+
const element = this.context.element!.getElement(id)!;
|
|
846
|
+
return element?.style?.visibility ?? 'visible';
|
|
1763
847
|
}
|
|
1764
848
|
|
|
1765
849
|
/**
|
|
1766
|
-
*
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1769
|
-
* @
|
|
1770
|
-
* @
|
|
1771
|
-
*/
|
|
1772
|
-
public addBehaviors(
|
|
1773
|
-
behaviors: BehaviorOptionsOf<B> | BehaviorOptionsOf<B>[],
|
|
1774
|
-
modes: string | string[],
|
|
1775
|
-
) {
|
|
1776
|
-
const modesArr = isArray(modes) ? modes : [modes];
|
|
1777
|
-
const behaviorsArr = isArray(behaviors) ? behaviors : [behaviors];
|
|
1778
|
-
this.hooks.behaviorchange.emit({
|
|
1779
|
-
action: 'add',
|
|
1780
|
-
modes: modesArr,
|
|
1781
|
-
// TODO: update type define.
|
|
1782
|
-
// @ts-ignore
|
|
1783
|
-
behaviors: behaviorsArr,
|
|
1784
|
-
});
|
|
1785
|
-
// update the graph specification
|
|
1786
|
-
modesArr.forEach((mode) => {
|
|
1787
|
-
this.specification.modes[mode] =
|
|
1788
|
-
this.specification.modes[mode].concat(behaviorsArr);
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
/**
|
|
1792
|
-
* Remove behavior(s) from mode(s).
|
|
1793
|
-
* @param behaviors behavior configs with unique key
|
|
1794
|
-
* @param modes mode names
|
|
1795
|
-
* @returns
|
|
1796
|
-
* @group Interaction
|
|
850
|
+
* <zh/> 设置元素层级
|
|
851
|
+
*
|
|
852
|
+
* <en/> Set element z-index
|
|
853
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
854
|
+
* @param zIndex - <zh/> 层级 | <en/> z-index
|
|
1797
855
|
*/
|
|
1798
|
-
public
|
|
1799
|
-
const modesArr = isArray(modes) ? modes : [modes];
|
|
1800
|
-
this.hooks.behaviorchange.emit({
|
|
1801
|
-
action: 'remove',
|
|
1802
|
-
modes: modesArr,
|
|
1803
|
-
behaviors: behaviorKeys,
|
|
1804
|
-
});
|
|
1805
|
-
// update the graph specification
|
|
1806
|
-
modesArr.forEach((mode) => {
|
|
1807
|
-
behaviorKeys.forEach((key) => {
|
|
1808
|
-
const oldBehavior = this.specification.modes[mode].find(
|
|
1809
|
-
(behavior) => isObject(behavior) && behavior.key === key,
|
|
1810
|
-
);
|
|
1811
|
-
const indexOfOldBehavior =
|
|
1812
|
-
this.specification.modes[mode].indexOf(oldBehavior);
|
|
1813
|
-
this.specification.modes[mode].splice(indexOfOldBehavior, 1);
|
|
1814
|
-
});
|
|
1815
|
-
});
|
|
1816
|
-
}
|
|
1817
|
-
|
|
856
|
+
public async setElementZIndex(id: ID, zIndex: number): Promise<void>;
|
|
1818
857
|
/**
|
|
1819
|
-
*
|
|
1820
|
-
*
|
|
1821
|
-
*
|
|
1822
|
-
* @
|
|
1823
|
-
* @group Interaction
|
|
858
|
+
* <zh/> 批量设置元素层级
|
|
859
|
+
*
|
|
860
|
+
* <en/> Batch set element z-index
|
|
861
|
+
* @param zIndex - <zh/> 层级配置 | <en/> z-index configuration
|
|
1824
862
|
*/
|
|
1825
|
-
public
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
// TODO: update type define.
|
|
1830
|
-
// @ts-ignore
|
|
1831
|
-
behaviors: [behavior],
|
|
1832
|
-
});
|
|
1833
|
-
// no need to update specification since the corresponding part is the same object as the behavior's option
|
|
1834
|
-
// this.specification.modes[mode].forEach((b, i) => {
|
|
1835
|
-
// if (isObject(b) && b.key === behavior.key) {
|
|
1836
|
-
// this.specification.modes[mode][i] = behavior;
|
|
1837
|
-
// }
|
|
1838
|
-
// });
|
|
1839
|
-
}
|
|
863
|
+
public async setElementZIndex(zIndex: Record<ID, number>): Promise<void>;
|
|
864
|
+
public async setElementZIndex(args1: ID | Record<ID, number>, args2?: number): Promise<void> {
|
|
865
|
+
const dataToUpdate: Required<PartialGraphData> = { nodes: [], edges: [], combos: [] };
|
|
866
|
+
const config = isObject(args1) ? args1 : { [args1 as ID]: args2 as number };
|
|
1840
867
|
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
* @returns
|
|
1845
|
-
* @group Plugin
|
|
1846
|
-
*/
|
|
1847
|
-
public addPlugins(
|
|
1848
|
-
pluginCfgs: (
|
|
1849
|
-
| {
|
|
1850
|
-
key: string;
|
|
1851
|
-
type: string;
|
|
1852
|
-
[cfgName: string]: unknown; // TODO: configs from plugins
|
|
1853
|
-
}
|
|
1854
|
-
| string
|
|
1855
|
-
)[],
|
|
1856
|
-
) {
|
|
1857
|
-
const pluginsArr = isArray(pluginCfgs) ? pluginCfgs : [pluginCfgs];
|
|
1858
|
-
|
|
1859
|
-
// update the graph specification
|
|
1860
|
-
if (!this.specification.plugins) this.specification.plugins = [];
|
|
1861
|
-
const oldPlugins = this.specification.plugins;
|
|
1862
|
-
const validPlugins: (
|
|
1863
|
-
| {
|
|
1864
|
-
key: string;
|
|
1865
|
-
type: string;
|
|
1866
|
-
[cfgName: string]: unknown; // TODO: configs from plugins
|
|
1867
|
-
}
|
|
1868
|
-
| string
|
|
1869
|
-
)[] = [];
|
|
1870
|
-
pluginsArr.forEach((config) => {
|
|
1871
|
-
const oldPlugin = oldPlugins.find((oldPlugin) => {
|
|
1872
|
-
if (typeof oldPlugin === 'string' || typeof config === 'string')
|
|
1873
|
-
return false;
|
|
1874
|
-
return oldPlugin.key === config.key;
|
|
1875
|
-
});
|
|
1876
|
-
if (oldPlugin) {
|
|
1877
|
-
console.warn(
|
|
1878
|
-
`Add plugin with key ${
|
|
1879
|
-
(config as any).key
|
|
1880
|
-
} failed, the key is duplicated to the existing plugins on the graph.`,
|
|
1881
|
-
);
|
|
1882
|
-
return;
|
|
1883
|
-
}
|
|
1884
|
-
validPlugins.push(config);
|
|
868
|
+
Object.entries(config).forEach(([id, value]) => {
|
|
869
|
+
const elementType = this.getElementType(id);
|
|
870
|
+
dataToUpdate[`${elementType}s`].push({ id, style: { zIndex: value } });
|
|
1885
871
|
});
|
|
1886
|
-
this.specification.plugins = oldPlugins.concat(validPlugins);
|
|
1887
872
|
|
|
1888
|
-
this.
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
});
|
|
873
|
+
const { model, element } = this.context;
|
|
874
|
+
model.preventUpdateNodeLikeHierarchy(() => model.updateData(dataToUpdate));
|
|
875
|
+
await element!.draw({ animation: false });
|
|
1892
876
|
}
|
|
1893
877
|
|
|
1894
878
|
/**
|
|
1895
|
-
*
|
|
1896
|
-
*
|
|
1897
|
-
*
|
|
1898
|
-
* @
|
|
1899
|
-
*/
|
|
1900
|
-
public
|
|
1901
|
-
const
|
|
1902
|
-
this.
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
pluginArr.includes(plugin as PluginBase)
|
|
879
|
+
* <zh/> 将元素置于最顶层
|
|
880
|
+
*
|
|
881
|
+
* <en/> Bring the element to the front
|
|
882
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
883
|
+
*/
|
|
884
|
+
public async frontElement(id: ID | ID[]): Promise<void> {
|
|
885
|
+
const ids = Array.isArray(id) ? id : [id];
|
|
886
|
+
const { model } = this.context;
|
|
887
|
+
const config: Record<ID, number> = {};
|
|
888
|
+
|
|
889
|
+
ids.map((_id) => {
|
|
890
|
+
const zIndex = model.getFrontZIndex(_id);
|
|
891
|
+
const elementType = model.getElementType(_id);
|
|
892
|
+
if (elementType === 'combo') {
|
|
893
|
+
const ancestor = model.getAncestorsData(_id, COMBO_KEY).at(-1) || this.getComboData(_id);
|
|
894
|
+
const combos = [ancestor, ...model.getDescendantsData(idOf(ancestor))].filter((datum) =>
|
|
895
|
+
model.isCombo(idOf(datum)),
|
|
1913
896
|
);
|
|
1914
|
-
|
|
897
|
+
const delta = zIndex - zIndexOf(ancestor);
|
|
898
|
+
combos.forEach((combo) => {
|
|
899
|
+
config[idOf(combo)] = zIndexOf(combo) + delta;
|
|
900
|
+
});
|
|
901
|
+
} else config[_id] = zIndex;
|
|
1915
902
|
});
|
|
1916
|
-
}
|
|
1917
903
|
|
|
1918
|
-
|
|
1919
|
-
* Update a plugin of the graph.
|
|
1920
|
-
* @param plugin plugin configs, whose key indicates the behavior to be updated
|
|
1921
|
-
* @returns
|
|
1922
|
-
* @group Interaction
|
|
1923
|
-
*/
|
|
1924
|
-
public updatePlugin(
|
|
1925
|
-
plugin:
|
|
1926
|
-
| {
|
|
1927
|
-
key: string;
|
|
1928
|
-
type: string;
|
|
1929
|
-
[cfg: string]: unknown;
|
|
1930
|
-
}
|
|
1931
|
-
| PluginBase,
|
|
1932
|
-
) {
|
|
1933
|
-
const { plugins } = this.specification;
|
|
1934
|
-
const { key } = plugin;
|
|
1935
|
-
if (!key) {
|
|
1936
|
-
console.warn(
|
|
1937
|
-
'Update plugin failed, the key for the plugin to be updated should be assign.',
|
|
1938
|
-
);
|
|
1939
|
-
return;
|
|
1940
|
-
}
|
|
1941
|
-
if (!plugins) {
|
|
1942
|
-
console.warn(
|
|
1943
|
-
'Update plugin failed, the plugin to be updated does not exist.',
|
|
1944
|
-
);
|
|
1945
|
-
return;
|
|
1946
|
-
}
|
|
1947
|
-
const oldPlugin = plugins?.find((p) => {
|
|
1948
|
-
if (typeof p === 'string') return p === key;
|
|
1949
|
-
return p.key === key;
|
|
1950
|
-
});
|
|
1951
|
-
if (!oldPlugin) {
|
|
1952
|
-
console.warn(
|
|
1953
|
-
'Update plugin failed, the key for the plugin to be updated should be assign.',
|
|
1954
|
-
);
|
|
1955
|
-
return;
|
|
1956
|
-
}
|
|
1957
|
-
const idx = plugins.indexOf(oldPlugin);
|
|
1958
|
-
plugins[idx] = {
|
|
1959
|
-
// TODO: update type define.
|
|
1960
|
-
// @ts-ignore
|
|
1961
|
-
...oldPlugin,
|
|
1962
|
-
...plugin,
|
|
1963
|
-
};
|
|
1964
|
-
|
|
1965
|
-
this.hooks.pluginchange.emit({
|
|
1966
|
-
action: 'update',
|
|
1967
|
-
plugins: [plugin],
|
|
1968
|
-
});
|
|
904
|
+
await this.setElementZIndex(config);
|
|
1969
905
|
}
|
|
1970
906
|
|
|
1971
907
|
/**
|
|
1972
|
-
*
|
|
1973
|
-
*
|
|
1974
|
-
*
|
|
1975
|
-
* @
|
|
1976
|
-
* @
|
|
1977
|
-
*/
|
|
1978
|
-
public drawTransient(
|
|
1979
|
-
type: ITEM_TYPE | SHAPE_TYPE,
|
|
1980
|
-
id: ID,
|
|
1981
|
-
config: {
|
|
1982
|
-
action: 'remove' | 'add' | 'update' | undefined;
|
|
1983
|
-
style: ShapeStyle;
|
|
1984
|
-
onlyDrawKeyShape?: boolean;
|
|
1985
|
-
upsertAncestors?: boolean;
|
|
1986
|
-
},
|
|
1987
|
-
canvas?: Canvas,
|
|
1988
|
-
): DisplayObject {
|
|
1989
|
-
this.hooks.transientupdate.emit({
|
|
1990
|
-
type,
|
|
1991
|
-
id,
|
|
1992
|
-
config,
|
|
1993
|
-
canvas: canvas || this.transientCanvas,
|
|
1994
|
-
graphCore: this.dataController.graphCore,
|
|
1995
|
-
});
|
|
1996
|
-
return this.itemController.getTransient(String(id));
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
// ===== history operations =====
|
|
2000
|
-
|
|
2001
|
-
/**
|
|
2002
|
-
* Determine if history (redo/undo) is enabled.
|
|
908
|
+
* <zh/> 获取元素层级
|
|
909
|
+
*
|
|
910
|
+
* <en/> Get element z-index
|
|
911
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
912
|
+
* @returns <zh/> 元素层级 | <en/> element z-index
|
|
2003
913
|
*/
|
|
2004
|
-
public
|
|
2005
|
-
|
|
2006
|
-
return history?.isEnable();
|
|
914
|
+
public getElementZIndex(id: ID): number {
|
|
915
|
+
return zIndexOf(this.context.model.getElementsData([id])[0]);
|
|
2007
916
|
}
|
|
2008
917
|
|
|
2009
918
|
/**
|
|
2010
|
-
*
|
|
2011
|
-
*
|
|
2012
|
-
*
|
|
2013
|
-
* @param
|
|
919
|
+
* <zh/> 设置元素状态
|
|
920
|
+
*
|
|
921
|
+
* <en/> Set element state
|
|
922
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
923
|
+
* @param state - <zh/> 状态 | <en/> state
|
|
924
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
2014
925
|
*/
|
|
2015
|
-
public
|
|
2016
|
-
const history = this.getHistoryPlugin();
|
|
2017
|
-
return history?.push(cmd, stackType, isNew);
|
|
2018
|
-
}
|
|
2019
|
-
|
|
926
|
+
public async setElementState(id: ID, state: State | State[], animation?: boolean): Promise<void>;
|
|
2020
927
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
928
|
+
* <zh/> 批量设置元素状态
|
|
929
|
+
*
|
|
930
|
+
* <en/> Batch set element state
|
|
931
|
+
* @param state - <zh/> 状态配置 | <en/> state configuration
|
|
932
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
933
|
+
*/
|
|
934
|
+
public async setElementState(state: Record<ID, State | State[]>, animation?: boolean): Promise<void>;
|
|
935
|
+
public async setElementState(
|
|
936
|
+
args1: ID | Record<ID, State | State[]>,
|
|
937
|
+
args2?: boolean | State | State[],
|
|
938
|
+
args3: boolean = true,
|
|
939
|
+
): Promise<void> {
|
|
940
|
+
const [config, animation] = isObject(args1)
|
|
941
|
+
? [args1, (args2 as boolean) ?? true]
|
|
942
|
+
: [{ [args1]: args2 as State | State[] }, args3];
|
|
2027
943
|
|
|
2028
|
-
|
|
2029
|
-
* Resume stacking operation.
|
|
2030
|
-
*/
|
|
2031
|
-
public resumeStacking(): void {
|
|
2032
|
-
const history = this.getHistoryPlugin();
|
|
2033
|
-
return history?.resumeStacking();
|
|
2034
|
-
}
|
|
944
|
+
emit(this, new ElementStateChangeEvent(GraphEvent.BEFORE_ELEMENT_STATE_CHANGE, config));
|
|
2035
945
|
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
history?.pauseStacking();
|
|
2043
|
-
try {
|
|
2044
|
-
callback();
|
|
2045
|
-
} finally {
|
|
2046
|
-
history?.resumeStacking();
|
|
2047
|
-
}
|
|
2048
|
-
};
|
|
946
|
+
const dataToUpdate: Required<PartialGraphData> = { nodes: [], edges: [], combos: [] };
|
|
947
|
+
Object.entries(config).forEach(([id, value]) => {
|
|
948
|
+
const elementType = this.getElementType(id);
|
|
949
|
+
dataToUpdate[`${elementType}s`].push({ id, style: { states: Array.isArray(value) ? value : [value] } });
|
|
950
|
+
});
|
|
951
|
+
this.updateData(dataToUpdate);
|
|
2049
952
|
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
*/
|
|
2053
|
-
public getUndoStack() {
|
|
2054
|
-
const history = this.getHistoryPlugin();
|
|
2055
|
-
return history?.getUndoStack();
|
|
953
|
+
await this.context.element!.draw({ animation });
|
|
954
|
+
emit(this, new ElementStateChangeEvent(GraphEvent.AFTER_ELEMENT_STATE_CHANGE, config));
|
|
2056
955
|
}
|
|
2057
956
|
|
|
2058
957
|
/**
|
|
2059
|
-
*
|
|
958
|
+
* <zh/> 获取元素状态
|
|
959
|
+
*
|
|
960
|
+
* <en/> Get element state
|
|
961
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
962
|
+
* @returns <zh/> 元素状态 | <en/> element state
|
|
2060
963
|
*/
|
|
2061
|
-
public
|
|
2062
|
-
|
|
2063
|
-
return history?.getRedoStack();
|
|
964
|
+
public getElementState(id: ID): State[] {
|
|
965
|
+
return this.context.model.getElementState(id);
|
|
2064
966
|
}
|
|
2065
967
|
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
* @returns
|
|
2069
|
-
*/
|
|
2070
|
-
public getStack() {
|
|
2071
|
-
const history = this.getHistoryPlugin();
|
|
2072
|
-
return history?.getStack();
|
|
968
|
+
public getElementRenderBounds(id: ID): AABB {
|
|
969
|
+
return this.context.element!.getElement(id)!.getRenderBounds();
|
|
2073
970
|
}
|
|
2074
971
|
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
* @returns
|
|
2079
|
-
*/
|
|
2080
|
-
public undo() {
|
|
2081
|
-
const history = this.getHistoryPlugin();
|
|
2082
|
-
history?.undo();
|
|
972
|
+
public async collapse(id: ID, animation: boolean = true): Promise<void> {
|
|
973
|
+
this.setElementCollapsibility(id, true);
|
|
974
|
+
await this.context.element!.draw({ animation, stage: 'collapse' });
|
|
2083
975
|
}
|
|
2084
976
|
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
* @returns
|
|
2089
|
-
*/
|
|
2090
|
-
public redo() {
|
|
2091
|
-
const history = this.getHistoryPlugin();
|
|
2092
|
-
history?.redo();
|
|
977
|
+
public async expand(id: ID, animation: boolean = true): Promise<void> {
|
|
978
|
+
this.setElementCollapsibility(id, false);
|
|
979
|
+
await this.context.element!.draw({ animation, stage: 'expand' });
|
|
2093
980
|
}
|
|
2094
981
|
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
const history = this.getHistoryPlugin();
|
|
2100
|
-
return history?.canUndo();
|
|
982
|
+
private setElementCollapsibility(id: ID, collapsed: boolean) {
|
|
983
|
+
const elementType = this.getElementType(id);
|
|
984
|
+
if (elementType === 'node') this.updateNodeData([{ id, style: { collapsed } }]);
|
|
985
|
+
else if (elementType === 'combo') this.updateComboData([{ id, style: { collapsed } }]);
|
|
2101
986
|
}
|
|
2102
987
|
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
*/
|
|
2106
|
-
public canRedo() {
|
|
2107
|
-
const history = this.getHistoryPlugin();
|
|
2108
|
-
return history?.canRedo();
|
|
988
|
+
public async toDataURL(options: Partial<DataURLOptions> = {}): Promise<string> {
|
|
989
|
+
return this.context.canvas!.toDataURL(options);
|
|
2109
990
|
}
|
|
2110
991
|
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
* Any operations performed between `startBatch` and `stopBatch` are grouped together.
|
|
2114
|
-
* treated as a single operation when undoing or redoing.
|
|
2115
|
-
*/
|
|
2116
|
-
public startBatch() {
|
|
2117
|
-
const history = this.getHistoryPlugin();
|
|
2118
|
-
history?.startBatch();
|
|
992
|
+
public getCanvasByViewport(point: Point): Point {
|
|
993
|
+
return parsePoint(this.context.canvas!.viewport2Canvas(toPointObject(point)));
|
|
2119
994
|
}
|
|
2120
995
|
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
* Any operations performed between `startBatch` and `stopBatch` are grouped together.
|
|
2124
|
-
* treated as a single operation when undoing or redoing.
|
|
2125
|
-
*/
|
|
2126
|
-
public stopBatch() {
|
|
2127
|
-
const history = this.getHistoryPlugin();
|
|
2128
|
-
history?.stopBatch();
|
|
996
|
+
public getViewportByCanvas(point: Point): Point {
|
|
997
|
+
return parsePoint(this.context.canvas.canvas2Viewport(toPointObject(point)));
|
|
2129
998
|
}
|
|
2130
999
|
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
* more convenient way without manually invoking `startBatch` and `stopBatch`.
|
|
2135
|
-
* @param callback The func containing operations to be batched together.
|
|
2136
|
-
*/
|
|
2137
|
-
public batch(callback: () => void) {
|
|
2138
|
-
const history = this.getHistoryPlugin();
|
|
2139
|
-
history?.batch(callback);
|
|
1000
|
+
public getClientByCanvas(point: Point): Point {
|
|
1001
|
+
const viewportPoint = this.context.canvas.canvas2Viewport(toPointObject(point));
|
|
1002
|
+
return parsePoint(this.context.canvas.viewport2Canvas(viewportPoint));
|
|
2140
1003
|
}
|
|
2141
1004
|
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
*/
|
|
2146
|
-
public clearStack(stackType?: StackType) {
|
|
2147
|
-
const history = this.getHistoryPlugin();
|
|
2148
|
-
if (!stackType) return history?.clear();
|
|
2149
|
-
return stackType === 'undo'
|
|
2150
|
-
? history?.clearUndoStack()
|
|
2151
|
-
: history?.clearRedoStack();
|
|
1005
|
+
public getCanvasByClient(point: Point): Point {
|
|
1006
|
+
const viewportPoint = this.context.canvas.client2Viewport(toPointObject(point));
|
|
1007
|
+
return parsePoint(this.context.canvas.viewport2Canvas(viewportPoint));
|
|
2152
1008
|
}
|
|
2153
1009
|
|
|
2154
1010
|
/**
|
|
2155
|
-
*
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
2158
|
-
* @
|
|
2159
|
-
* @returns
|
|
2160
|
-
* @group Tree
|
|
2161
|
-
*/
|
|
2162
|
-
public collapse(ids: ID | ID[], disableAnimate = false, stack?: boolean) {
|
|
2163
|
-
this.hooks.treecollapseexpand.emit({
|
|
2164
|
-
ids: isArray(ids) ? ids : [ids],
|
|
2165
|
-
action: 'collapse',
|
|
2166
|
-
animate: !disableAnimate,
|
|
2167
|
-
graphCore: this.dataController.graphCore,
|
|
2168
|
-
});
|
|
2169
|
-
}
|
|
2170
|
-
/**
|
|
2171
|
-
* Expand sub tree(s).
|
|
2172
|
-
* @param ids Root id(s) of the sub trees.
|
|
2173
|
-
* @param disableAnimate Whether disable the animations for this operation.
|
|
2174
|
-
* @param stack Whether push this operation to stack.
|
|
2175
|
-
* @returns
|
|
2176
|
-
* @group Tree
|
|
1011
|
+
* <zh/> 获取视口中心的画布坐标
|
|
1012
|
+
*
|
|
1013
|
+
* <en/> Get the canvas coordinates of the viewport center
|
|
1014
|
+
* @returns <zh/> 视口中心的画布坐标 | <en/> Canvas coordinates of the viewport center
|
|
2177
1015
|
*/
|
|
2178
|
-
public
|
|
2179
|
-
this.
|
|
2180
|
-
ids: isArray(ids) ? ids : [ids],
|
|
2181
|
-
action: 'expand',
|
|
2182
|
-
animate: !disableAnimate,
|
|
2183
|
-
graphCore: this.dataController.graphCore,
|
|
2184
|
-
});
|
|
1016
|
+
public getViewportCenter(): Point {
|
|
1017
|
+
return this.context.viewport!.getViewportCenter();
|
|
2185
1018
|
}
|
|
2186
1019
|
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
* @returns
|
|
2190
|
-
* @group Graph Instance
|
|
2191
|
-
*/
|
|
2192
|
-
public destroy(callback?: Function) {
|
|
2193
|
-
// TODO: call the destroy functions after items' buildOut animations finished
|
|
2194
|
-
// setTimeout(() => {
|
|
2195
|
-
this.canvas.destroy();
|
|
2196
|
-
this.backgroundCanvas.destroy();
|
|
2197
|
-
this.transientCanvas.destroy();
|
|
2198
|
-
|
|
2199
|
-
// clear history stack
|
|
2200
|
-
this.clearStack();
|
|
2201
|
-
|
|
2202
|
-
callback?.();
|
|
2203
|
-
// }, 500);
|
|
2204
|
-
|
|
2205
|
-
this.hooks.destroy.emit({});
|
|
2206
|
-
|
|
2207
|
-
// TODO: destroy controllers and off the listeners
|
|
2208
|
-
// this.dataController.destroy();
|
|
2209
|
-
// this.interactionController.destroy();
|
|
2210
|
-
// this.layoutController.destroy();
|
|
2211
|
-
// this.themeController.destroy();
|
|
2212
|
-
// this.itemController.destroy();
|
|
2213
|
-
// this.extensionController.destroy();
|
|
2214
|
-
|
|
2215
|
-
this.destroyed = true;
|
|
1020
|
+
public getCanvasCenter(): Point {
|
|
1021
|
+
return this.context.viewport!.getCanvasCenter();
|
|
2216
1022
|
}
|
|
1023
|
+
|
|
1024
|
+
private onResize = debounce(() => {
|
|
1025
|
+
this.resize();
|
|
1026
|
+
}, 300);
|
|
2217
1027
|
}
|