@antv/g6 5.0.0-beta.9 → 5.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/g6.min.js +2 -2
- package/dist/lib/animations/executor.d.ts +11 -0
- package/dist/lib/animations/index.d.ts +32 -0
- package/dist/lib/animations/types.d.ts +113 -0
- package/dist/lib/behaviors/base-behavior.d.ts +6 -0
- package/dist/lib/behaviors/brush-select.d.ts +189 -0
- package/dist/lib/behaviors/click-select.d.ts +116 -0
- package/dist/lib/behaviors/collapse-expand.d.ts +64 -0
- package/dist/lib/behaviors/create-edge.d.ts +75 -0
- package/dist/lib/behaviors/drag-canvas.d.ts +83 -0
- package/dist/lib/behaviors/drag-element-force.d.ts +53 -0
- package/dist/lib/behaviors/drag-element.d.ts +209 -0
- package/dist/lib/behaviors/focus-element.d.ts +42 -0
- package/dist/lib/behaviors/hover-activate.d.ts +84 -0
- package/dist/lib/behaviors/index.d.ts +26 -0
- package/dist/lib/behaviors/lasso-select.d.ts +41 -0
- package/dist/lib/behaviors/scroll-canvas.d.ts +85 -0
- package/dist/lib/behaviors/types.d.ts +6 -0
- package/dist/lib/behaviors/zoom-canvas.d.ts +98 -0
- package/dist/lib/constants/animation.d.ts +3 -0
- package/dist/lib/constants/change.d.ts +64 -0
- package/dist/lib/constants/element.d.ts +7 -0
- package/dist/lib/constants/events/animation.d.ts +6 -0
- package/dist/lib/constants/events/canvas.d.ts +115 -0
- package/dist/lib/constants/events/combo.d.ts +109 -0
- package/dist/lib/constants/events/common.d.ts +122 -0
- package/dist/lib/constants/events/container.d.ts +14 -0
- package/dist/lib/constants/events/edge.d.ts +91 -0
- package/dist/lib/constants/events/graph.d.ts +158 -0
- package/dist/lib/constants/events/history.d.ts +38 -0
- package/dist/lib/constants/events/index.d.ts +9 -0
- package/dist/lib/constants/events/node.d.ts +109 -0
- package/dist/lib/constants/graphlib.d.ts +2 -0
- package/dist/lib/constants/index.d.ts +5 -0
- package/dist/lib/constants/registry.d.ts +62 -0
- package/dist/lib/elements/base-element.d.ts +35 -0
- package/dist/lib/elements/combos/base-combo.d.ts +91 -0
- package/dist/lib/elements/combos/circle.d.ts +25 -0
- package/dist/lib/elements/combos/index.d.ts +6 -0
- package/dist/lib/elements/combos/rect.d.ts +21 -0
- package/dist/lib/elements/edges/base-edge.d.ts +164 -0
- package/dist/lib/elements/edges/cubic-horizontal.d.ts +39 -0
- package/dist/lib/elements/edges/cubic-vertical.d.ts +39 -0
- package/dist/lib/elements/edges/cubic.d.ts +48 -0
- package/dist/lib/elements/edges/index.d.ts +14 -0
- package/dist/lib/elements/edges/line.d.ts +25 -0
- package/dist/lib/elements/edges/polyline.d.ts +63 -0
- package/dist/lib/elements/edges/quadratic.d.ts +44 -0
- package/dist/lib/elements/index.d.ts +3 -0
- package/dist/lib/elements/nodes/base-node.d.ts +193 -0
- package/dist/lib/elements/nodes/circle.d.ts +26 -0
- package/dist/lib/elements/nodes/diamond.d.ts +21 -0
- package/dist/lib/elements/nodes/donut.d.ts +45 -0
- package/dist/lib/elements/nodes/ellipse.d.ts +26 -0
- package/dist/lib/elements/nodes/hexagon.d.ts +28 -0
- package/dist/lib/elements/nodes/html.d.ts +41 -0
- package/dist/lib/elements/nodes/image.d.ts +38 -0
- package/dist/lib/elements/nodes/index.d.ts +22 -0
- package/dist/lib/elements/nodes/rect.d.ts +25 -0
- package/dist/lib/elements/nodes/star.d.ts +30 -0
- package/dist/lib/elements/nodes/triangle.d.ts +31 -0
- package/dist/lib/elements/shapes/badge.d.ts +15 -0
- package/dist/lib/elements/shapes/base-shape.d.ts +63 -0
- package/dist/lib/elements/shapes/contour.d.ts +66 -0
- package/dist/lib/elements/shapes/icon.d.ts +13 -0
- package/dist/lib/elements/shapes/index.d.ts +16 -0
- package/dist/lib/elements/shapes/label.d.ts +32 -0
- package/dist/lib/elements/shapes/polygon.d.ts +30 -0
- package/dist/lib/exports.d.ts +40 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/layouts/base-layout.d.ts +10 -0
- package/dist/lib/layouts/index.d.ts +4 -0
- package/dist/lib/layouts/types.d.ts +84 -0
- package/dist/lib/palettes/index.d.ts +10 -0
- package/dist/lib/palettes/types.d.ts +5 -0
- package/dist/lib/plugins/background/index.d.ts +38 -0
- package/dist/lib/plugins/base-plugin.d.ts +6 -0
- package/dist/lib/plugins/bubble-sets.d.ts +116 -0
- package/dist/lib/plugins/camera-setting.d.ts +111 -0
- package/dist/lib/plugins/contextmenu/index.d.ts +115 -0
- package/dist/lib/plugins/contextmenu/util.d.ts +26 -0
- package/dist/lib/plugins/fullscreen/index.d.ts +79 -0
- package/dist/lib/plugins/grid-line.d.ts +106 -0
- package/dist/lib/plugins/history/index.d.ts +120 -0
- package/dist/lib/plugins/history/util.d.ts +21 -0
- package/dist/lib/plugins/hull/index.d.ts +114 -0
- package/dist/lib/plugins/hull/util.d.ts +12 -0
- package/dist/lib/plugins/index.d.ts +28 -0
- package/dist/lib/plugins/legend.d.ts +129 -0
- package/dist/lib/plugins/timebar.d.ts +241 -0
- package/dist/lib/plugins/toolbar/index.d.ts +69 -0
- package/dist/lib/plugins/toolbar/util.d.ts +33 -0
- package/dist/lib/plugins/tooltip.d.ts +116 -0
- package/dist/lib/plugins/types.d.ts +4 -0
- package/dist/lib/plugins/watermark/index.d.ts +191 -0
- package/dist/lib/plugins/watermark/util.d.ts +18 -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 +59 -0
- package/dist/lib/registry/types.d.ts +39 -0
- package/dist/lib/runtime/animation.d.ts +54 -0
- package/dist/lib/runtime/batch.d.ts +11 -0
- package/dist/lib/runtime/behavior.d.ts +20 -0
- package/dist/lib/runtime/canvas.d.ts +60 -0
- package/dist/lib/runtime/data.d.ts +202 -0
- package/dist/lib/runtime/element.d.ts +102 -0
- package/dist/lib/runtime/graph.d.ts +1011 -0
- package/dist/lib/runtime/layout.d.ts +38 -0
- package/dist/lib/runtime/plugin.d.ts +10 -0
- package/dist/lib/runtime/transform.d.ts +12 -0
- package/dist/lib/runtime/types.d.ts +90 -0
- package/dist/lib/runtime/viewport.d.ts +58 -0
- package/dist/lib/spec/behavior.d.ts +30 -0
- package/dist/lib/spec/canvas.d.ts +53 -0
- package/dist/lib/spec/data.d.ts +222 -0
- package/dist/lib/spec/element/animation.d.ts +6 -0
- package/dist/lib/spec/element/combo.d.ts +52 -0
- package/dist/lib/spec/element/edge.d.ts +52 -0
- package/dist/lib/spec/element/node.d.ts +52 -0
- package/dist/lib/spec/element/palette.d.ts +53 -0
- package/dist/lib/spec/graph.d.ts +91 -0
- package/dist/lib/spec/index.d.ts +12 -0
- package/dist/lib/spec/layout.d.ts +4 -0
- package/dist/lib/spec/plugin.d.ts +32 -0
- package/dist/lib/spec/theme.d.ts +7 -0
- package/dist/lib/spec/transform.d.ts +12 -0
- package/dist/lib/spec/viewport.d.ts +82 -0
- package/dist/lib/themes/base.d.ts +34 -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 +9 -0
- package/dist/lib/transforms/arrange-draw-order.d.ts +10 -0
- package/dist/lib/transforms/base-transform.d.ts +8 -0
- package/dist/lib/transforms/collapse-expand-combo.d.ts +11 -0
- package/dist/lib/transforms/collapse-expand-node.d.ts +12 -0
- package/dist/lib/transforms/get-edge-actual-ends.d.ts +13 -0
- package/dist/lib/transforms/index.d.ts +8 -0
- package/dist/lib/transforms/process-parallel-edges.d.ts +85 -0
- package/dist/lib/transforms/types.d.ts +20 -0
- package/dist/lib/transforms/update-related-edge.d.ts +10 -0
- package/dist/lib/transforms/utils.d.ts +13 -0
- package/dist/lib/types/anchor.d.ts +3 -0
- package/dist/lib/types/animation.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 +68 -0
- package/dist/lib/types/combo.d.ts +23 -0
- package/dist/lib/types/data.d.ts +44 -0
- package/dist/lib/types/edge.d.ts +127 -0
- package/dist/lib/types/element.d.ts +18 -0
- package/dist/lib/types/enum.d.ts +1 -0
- package/dist/lib/types/event.d.ts +55 -0
- package/dist/lib/types/graphlib.d.ts +16 -0
- package/dist/lib/types/history.d.ts +51 -0
- package/dist/lib/types/id.d.ts +1 -0
- package/dist/lib/types/index.d.ts +26 -0
- package/dist/lib/types/layout.d.ts +9 -0
- package/dist/lib/types/node.d.ts +144 -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 +17 -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 +9 -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 +36 -0
- package/dist/lib/utils/anchor.d.ts +9 -0
- package/dist/lib/utils/animation.d.ts +47 -0
- package/dist/lib/utils/array.d.ts +9 -0
- package/dist/lib/utils/bbox.d.ts +108 -0
- package/dist/lib/utils/cache.d.ts +36 -0
- package/dist/lib/utils/change.d.ts +17 -0
- package/dist/lib/utils/collapsibility.d.ts +9 -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 +29 -0
- package/dist/lib/utils/edge.d.ts +192 -0
- package/dist/lib/utils/element.d.ts +231 -0
- package/dist/lib/utils/event/events.d.ts +26 -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 +20 -0
- package/dist/lib/utils/is.d.ts +34 -0
- package/dist/lib/utils/layout.d.ts +70 -0
- package/dist/lib/utils/line.d.ts +21 -0
- package/dist/lib/utils/math.d.ts +10 -0
- package/dist/lib/utils/node.d.ts +11 -0
- package/dist/lib/utils/padding.d.ts +9 -0
- package/dist/lib/utils/palette.d.ts +32 -0
- package/dist/lib/utils/path.d.ts +35 -0
- package/dist/lib/utils/placement.d.ts +9 -0
- package/dist/lib/utils/point.d.ts +192 -0
- package/dist/lib/utils/polygon.d.ts +17 -0
- package/dist/lib/utils/position.d.ts +50 -0
- package/dist/lib/utils/prefix.d.ts +66 -0
- package/dist/lib/utils/relation.d.ts +33 -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 +31 -0
- package/dist/lib/utils/size.d.ts +7 -0
- package/dist/lib/utils/style.d.ts +30 -0
- package/dist/lib/utils/symbol.d.ts +30 -0
- package/dist/lib/utils/text.d.ts +26 -0
- package/dist/lib/utils/theme.d.ts +9 -0
- package/dist/lib/utils/transform.d.ts +24 -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 +143 -0
- package/dist/lib/utils/visibility.d.ts +13 -0
- package/esm/animations/executor.d.ts +11 -0
- package/esm/animations/executor.js +70 -0
- package/esm/animations/executor.js.map +1 -0
- package/esm/animations/index.d.ts +32 -0
- package/esm/animations/index.js +15 -0
- package/esm/animations/index.js.map +1 -0
- package/esm/animations/types.d.ts +113 -0
- package/esm/animations/types.js.map +1 -0
- package/esm/behaviors/base-behavior.d.ts +6 -0
- package/esm/behaviors/base-behavior.js +4 -0
- package/esm/behaviors/base-behavior.js.map +1 -0
- package/esm/behaviors/brush-select.d.ts +189 -0
- package/esm/behaviors/brush-select.js +273 -0
- package/esm/behaviors/brush-select.js.map +1 -0
- package/esm/behaviors/click-select.d.ts +116 -0
- package/esm/behaviors/click-select.js +133 -0
- package/esm/behaviors/click-select.js.map +1 -0
- package/esm/behaviors/collapse-expand.d.ts +64 -0
- package/esm/behaviors/collapse-expand.js +76 -0
- package/esm/behaviors/collapse-expand.js.map +1 -0
- package/esm/behaviors/create-edge.d.ts +75 -0
- package/esm/behaviors/create-edge.js +155 -0
- package/esm/behaviors/create-edge.js.map +1 -0
- package/esm/behaviors/drag-canvas.d.ts +83 -0
- package/esm/behaviors/drag-canvas.js +97 -0
- package/esm/behaviors/drag-canvas.js.map +1 -0
- package/esm/behaviors/drag-element-force.d.ts +53 -0
- package/esm/behaviors/drag-element-force.js +94 -0
- package/esm/behaviors/drag-element-force.js.map +1 -0
- package/esm/behaviors/drag-element.d.ts +209 -0
- package/esm/behaviors/drag-element.js +310 -0
- package/esm/behaviors/drag-element.js.map +1 -0
- package/esm/behaviors/focus-element.d.ts +42 -0
- package/esm/behaviors/focus-element.js +58 -0
- package/esm/behaviors/focus-element.js.map +1 -0
- package/esm/behaviors/hover-activate.d.ts +84 -0
- package/esm/behaviors/hover-activate.js +104 -0
- package/esm/behaviors/hover-activate.js.map +1 -0
- package/esm/behaviors/index.d.ts +26 -0
- package/esm/behaviors/index.js +14 -0
- package/esm/behaviors/index.js.map +1 -0
- package/esm/behaviors/lasso-select.d.ts +41 -0
- package/esm/behaviors/lasso-select.js +66 -0
- package/esm/behaviors/lasso-select.js.map +1 -0
- package/esm/behaviors/scroll-canvas.d.ts +85 -0
- package/esm/behaviors/scroll-canvas.js +100 -0
- package/esm/behaviors/scroll-canvas.js.map +1 -0
- package/esm/behaviors/types.d.ts +6 -0
- package/esm/behaviors/types.js.map +1 -0
- package/esm/behaviors/zoom-canvas.d.ts +98 -0
- package/esm/behaviors/zoom-canvas.js +110 -0
- package/esm/behaviors/zoom-canvas.js.map +1 -0
- package/esm/constants/animation.d.ts +3 -0
- package/esm/constants/animation.js +10 -0
- package/esm/constants/animation.js.map +1 -0
- package/esm/constants/change.d.ts +64 -0
- package/esm/constants/change.js +66 -0
- package/esm/constants/change.js.map +1 -0
- package/esm/constants/element.d.ts +7 -0
- package/esm/constants/element.js +8 -0
- package/esm/constants/element.js.map +1 -0
- package/esm/constants/events/animation.d.ts +6 -0
- package/esm/constants/events/animation.js +8 -0
- package/esm/constants/events/animation.js.map +1 -0
- package/esm/constants/events/canvas.d.ts +115 -0
- package/esm/constants/events/canvas.js +117 -0
- package/esm/constants/events/canvas.js.map +1 -0
- package/esm/constants/events/combo.d.ts +109 -0
- package/esm/constants/events/combo.js +111 -0
- package/esm/constants/events/combo.js.map +1 -0
- package/esm/constants/events/common.d.ts +122 -0
- package/esm/constants/events/common.js +124 -0
- package/esm/constants/events/common.js.map +1 -0
- package/esm/constants/events/container.d.ts +14 -0
- package/esm/constants/events/container.js +16 -0
- package/esm/constants/events/container.js.map +1 -0
- package/esm/constants/events/edge.d.ts +91 -0
- package/esm/constants/events/edge.js +93 -0
- package/esm/constants/events/edge.js.map +1 -0
- package/esm/constants/events/graph.d.ts +158 -0
- package/esm/constants/events/graph.js +160 -0
- package/esm/constants/events/graph.js.map +1 -0
- package/esm/constants/events/history.d.ts +38 -0
- package/esm/constants/events/history.js +40 -0
- package/esm/constants/events/history.js.map +1 -0
- package/esm/constants/events/index.d.ts +9 -0
- package/esm/constants/events/index.js +10 -0
- package/esm/constants/events/index.js.map +1 -0
- package/esm/constants/events/node.d.ts +109 -0
- package/esm/constants/events/node.js +111 -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 +5 -0
- package/esm/constants/index.js +6 -0
- package/esm/constants/index.js.map +1 -0
- package/esm/constants/registry.d.ts +62 -0
- package/esm/constants/registry.js +64 -0
- package/esm/constants/registry.js.map +1 -0
- package/esm/elements/base-element.d.ts +35 -0
- package/esm/elements/base-element.js +42 -0
- package/esm/elements/base-element.js.map +1 -0
- package/esm/elements/combos/base-combo.d.ts +91 -0
- package/esm/elements/combos/base-combo.js +162 -0
- package/esm/elements/combos/base-combo.js.map +1 -0
- package/esm/elements/combos/circle.d.ts +25 -0
- package/esm/elements/combos/circle.js +45 -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 +21 -0
- package/esm/elements/combos/rect.js +29 -0
- package/esm/elements/combos/rect.js.map +1 -0
- package/esm/elements/edges/base-edge.d.ts +164 -0
- package/esm/elements/edges/base-edge.js +205 -0
- package/esm/elements/edges/base-edge.js.map +1 -0
- package/esm/elements/edges/cubic-horizontal.d.ts +39 -0
- package/esm/elements/edges/cubic-horizontal.js +28 -0
- package/esm/elements/edges/cubic-horizontal.js.map +1 -0
- package/esm/elements/edges/cubic-vertical.d.ts +39 -0
- package/esm/elements/edges/cubic-vertical.js +28 -0
- package/esm/elements/edges/cubic-vertical.js.map +1 -0
- package/esm/elements/edges/cubic.d.ts +48 -0
- package/esm/elements/edges/cubic.js +35 -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 +25 -0
- package/esm/elements/edges/line.js +23 -0
- package/esm/elements/edges/line.js.map +1 -0
- package/esm/elements/edges/polyline.d.ts +63 -0
- package/esm/elements/edges/polyline.js +67 -0
- package/esm/elements/edges/polyline.js.map +1 -0
- package/esm/elements/edges/quadratic.d.ts +44 -0
- package/esm/elements/edges/quadratic.js +24 -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 +193 -0
- package/esm/elements/nodes/base-node.js +218 -0
- package/esm/elements/nodes/base-node.js.map +1 -0
- package/esm/elements/nodes/circle.d.ts +26 -0
- package/esm/elements/nodes/circle.js +36 -0
- package/esm/elements/nodes/circle.js.map +1 -0
- package/esm/elements/nodes/diamond.d.ts +21 -0
- package/esm/elements/nodes/diamond.js +23 -0
- package/esm/elements/nodes/diamond.js.map +1 -0
- package/esm/elements/nodes/donut.d.ts +45 -0
- package/esm/elements/nodes/donut.js +95 -0
- package/esm/elements/nodes/donut.js.map +1 -0
- package/esm/elements/nodes/ellipse.d.ts +26 -0
- package/esm/elements/nodes/ellipse.js +41 -0
- package/esm/elements/nodes/ellipse.js.map +1 -0
- package/esm/elements/nodes/hexagon.d.ts +28 -0
- package/esm/elements/nodes/hexagon.js +25 -0
- package/esm/elements/nodes/hexagon.js.map +1 -0
- package/esm/elements/nodes/html.d.ts +41 -0
- package/esm/elements/nodes/html.js +222 -0
- package/esm/elements/nodes/html.js.map +1 -0
- package/esm/elements/nodes/image.d.ts +38 -0
- package/esm/elements/nodes/image.js +59 -0
- package/esm/elements/nodes/image.js.map +1 -0
- package/esm/elements/nodes/index.d.ts +22 -0
- package/esm/elements/nodes/index.js +12 -0
- package/esm/elements/nodes/index.js.map +1 -0
- package/esm/elements/nodes/rect.d.ts +25 -0
- package/esm/elements/nodes/rect.js +38 -0
- package/esm/elements/nodes/rect.js.map +1 -0
- package/esm/elements/nodes/star.d.ts +30 -0
- package/esm/elements/nodes/star.js +34 -0
- package/esm/elements/nodes/star.js.map +1 -0
- package/esm/elements/nodes/triangle.d.ts +31 -0
- package/esm/elements/nodes/triangle.js +53 -0
- package/esm/elements/nodes/triangle.js.map +1 -0
- package/esm/elements/shapes/badge.d.ts +15 -0
- package/esm/elements/shapes/badge.js +27 -0
- package/esm/elements/shapes/badge.js.map +1 -0
- package/esm/elements/shapes/base-shape.d.ts +63 -0
- package/esm/elements/shapes/base-shape.js +160 -0
- package/esm/elements/shapes/base-shape.js.map +1 -0
- package/esm/elements/shapes/contour.d.ts +66 -0
- package/esm/elements/shapes/contour.js +36 -0
- package/esm/elements/shapes/contour.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 +16 -0
- package/esm/elements/shapes/index.js +11 -0
- package/esm/elements/shapes/index.js.map +1 -0
- package/esm/elements/shapes/label.d.ts +32 -0
- package/esm/elements/shapes/label.js +71 -0
- package/esm/elements/shapes/label.js.map +1 -0
- package/esm/elements/shapes/polygon.d.ts +30 -0
- package/esm/elements/shapes/polygon.js +27 -0
- package/esm/elements/shapes/polygon.js.map +1 -0
- package/esm/exports.d.ts +40 -0
- package/esm/exports.js +18 -0
- package/esm/exports.js.map +1 -0
- package/esm/index.d.ts +3 -259
- package/esm/index.js +3 -18
- package/esm/index.js.map +1 -1
- package/esm/layouts/base-layout.d.ts +10 -0
- package/esm/layouts/base-layout.js +9 -0
- package/esm/layouts/base-layout.js.map +1 -0
- package/esm/layouts/index.d.ts +4 -0
- package/esm/layouts/index.js +4 -0
- package/esm/layouts/index.js.map +1 -0
- package/esm/layouts/types.d.ts +84 -0
- package/esm/layouts/types.js.map +1 -0
- package/esm/palettes/index.d.ts +10 -0
- package/esm/palettes/index.js +64 -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/background/index.d.ts +38 -0
- package/esm/plugins/background/index.js +48 -0
- package/esm/plugins/background/index.js.map +1 -0
- package/esm/plugins/base-plugin.d.ts +6 -0
- package/esm/plugins/base-plugin.js +4 -0
- package/esm/plugins/base-plugin.js.map +1 -0
- package/esm/plugins/bubble-sets.d.ts +116 -0
- package/esm/plugins/bubble-sets.js +279 -0
- package/esm/plugins/bubble-sets.js.map +1 -0
- package/esm/plugins/camera-setting.d.ts +111 -0
- package/esm/plugins/camera-setting.js +72 -0
- package/esm/plugins/camera-setting.js.map +1 -0
- package/esm/plugins/contextmenu/index.d.ts +115 -0
- package/esm/plugins/contextmenu/index.js +132 -0
- package/esm/plugins/contextmenu/index.js.map +1 -0
- package/esm/plugins/contextmenu/util.d.ts +26 -0
- package/esm/plugins/contextmenu/util.js +45 -0
- package/esm/plugins/contextmenu/util.js.map +1 -0
- package/esm/plugins/fullscreen/index.d.ts +79 -0
- package/esm/plugins/fullscreen/index.js +112 -0
- package/esm/plugins/fullscreen/index.js.map +1 -0
- package/esm/plugins/grid-line.d.ts +106 -0
- package/esm/plugins/grid-line.js +78 -0
- package/esm/plugins/grid-line.js.map +1 -0
- package/esm/plugins/history/index.d.ts +120 -0
- package/esm/plugins/history/index.js +195 -0
- package/esm/plugins/history/index.js.map +1 -0
- package/esm/plugins/history/util.d.ts +21 -0
- package/esm/plugins/history/util.js +83 -0
- package/esm/plugins/history/util.js.map +1 -0
- package/esm/plugins/hull/index.d.ts +114 -0
- package/esm/plugins/hull/index.js +161 -0
- package/esm/plugins/hull/index.js.map +1 -0
- package/esm/plugins/hull/util.d.ts +12 -0
- package/esm/plugins/hull/util.js +203 -0
- package/esm/plugins/hull/util.js.map +1 -0
- package/esm/plugins/index.d.ts +28 -0
- package/esm/plugins/index.js +15 -0
- package/esm/plugins/index.js.map +1 -0
- package/esm/plugins/legend.d.ts +129 -0
- package/esm/plugins/legend.js +318 -0
- package/esm/plugins/legend.js.map +1 -0
- package/esm/plugins/timebar.d.ts +241 -0
- package/esm/plugins/timebar.js +267 -0
- package/esm/plugins/timebar.js.map +1 -0
- package/esm/plugins/toolbar/index.d.ts +69 -0
- package/esm/plugins/toolbar/index.js +71 -0
- package/esm/plugins/toolbar/index.js.map +1 -0
- package/esm/plugins/toolbar/util.d.ts +33 -0
- package/esm/plugins/toolbar/util.js +93 -0
- package/esm/plugins/toolbar/util.js.map +1 -0
- package/esm/plugins/tooltip.d.ts +116 -0
- package/esm/plugins/tooltip.js +294 -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/index.d.ts +191 -0
- package/esm/plugins/watermark/index.js +67 -0
- package/esm/plugins/watermark/index.js.map +1 -0
- package/esm/plugins/watermark/util.d.ts +18 -0
- package/esm/plugins/watermark/util.js +73 -0
- package/esm/plugins/watermark/util.js.map +1 -0
- package/esm/preset.d.ts +1 -0
- package/esm/preset.js +5 -0
- package/esm/preset.js.map +1 -0
- package/esm/registry/build-in.d.ts +6 -0
- package/esm/registry/build-in.js +115 -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 +59 -0
- package/esm/registry/index.js +97 -0
- package/esm/registry/index.js.map +1 -0
- package/esm/registry/types.d.ts +39 -0
- package/esm/registry/types.js +2 -0
- package/esm/registry/types.js.map +1 -0
- package/esm/runtime/animation.d.ts +54 -0
- package/esm/runtime/animation.js +139 -0
- package/esm/runtime/animation.js.map +1 -0
- package/esm/runtime/batch.d.ts +11 -0
- package/esm/runtime/batch.js +31 -0
- package/esm/runtime/batch.js.map +1 -0
- package/esm/runtime/behavior.d.ts +20 -0
- package/esm/runtime/behavior.js +119 -0
- package/esm/runtime/behavior.js.map +1 -0
- package/esm/runtime/canvas.d.ts +60 -0
- package/esm/runtime/canvas.js +258 -0
- package/esm/runtime/canvas.js.map +1 -0
- package/esm/runtime/data.d.ts +202 -0
- package/esm/runtime/data.js +694 -0
- package/esm/runtime/data.js.map +1 -0
- package/esm/runtime/element.d.ts +102 -0
- package/esm/runtime/element.js +553 -0
- package/esm/runtime/element.js.map +1 -0
- package/esm/runtime/graph.d.ts +826 -536
- package/esm/runtime/graph.js +1029 -1832
- package/esm/runtime/graph.js.map +1 -1
- package/esm/runtime/layout.d.ts +38 -0
- package/esm/runtime/layout.js +236 -0
- package/esm/runtime/layout.js.map +1 -0
- package/esm/runtime/plugin.d.ts +10 -0
- package/esm/runtime/plugin.js +15 -0
- package/esm/runtime/plugin.js.map +1 -0
- package/esm/runtime/transform.d.ts +12 -0
- package/esm/runtime/transform.js +27 -0
- package/esm/runtime/transform.js.map +1 -0
- package/esm/runtime/types.d.ts +90 -0
- package/esm/runtime/types.js +2 -0
- package/esm/runtime/types.js.map +1 -0
- package/esm/runtime/viewport.d.ts +58 -0
- package/esm/runtime/viewport.js +241 -0
- package/esm/runtime/viewport.js.map +1 -0
- package/esm/spec/behavior.d.ts +30 -0
- package/esm/spec/behavior.js +2 -0
- package/esm/spec/behavior.js.map +1 -0
- package/esm/spec/canvas.d.ts +53 -0
- package/esm/spec/canvas.js +2 -0
- package/esm/spec/canvas.js.map +1 -0
- package/esm/spec/data.d.ts +222 -0
- package/esm/spec/data.js +2 -0
- package/esm/spec/data.js.map +1 -0
- package/esm/spec/element/animation.d.ts +6 -0
- package/esm/spec/element/animation.js +2 -0
- package/esm/spec/element/animation.js.map +1 -0
- package/esm/spec/element/combo.d.ts +52 -0
- package/esm/spec/element/combo.js +2 -0
- package/esm/spec/element/combo.js.map +1 -0
- package/esm/spec/element/edge.d.ts +52 -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 +52 -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/graph.d.ts +91 -0
- package/esm/spec/graph.js.map +1 -0
- package/esm/spec/index.d.ts +12 -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 +32 -0
- package/esm/spec/plugin.js +2 -0
- package/esm/spec/plugin.js.map +1 -0
- package/esm/spec/theme.d.ts +7 -0
- package/esm/spec/theme.js +2 -0
- package/esm/spec/theme.js.map +1 -0
- package/esm/spec/transform.d.ts +12 -0
- package/esm/spec/transform.js +2 -0
- package/esm/spec/transform.js.map +1 -0
- package/esm/spec/viewport.d.ts +82 -0
- package/esm/spec/viewport.js +2 -0
- package/esm/spec/viewport.js.map +1 -0
- package/esm/themes/base.d.ts +34 -0
- package/esm/themes/base.js +253 -0
- package/esm/themes/base.js.map +1 -0
- package/esm/themes/dark.d.ts +2 -0
- package/esm/themes/dark.js +39 -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 +22 -0
- package/esm/themes/light.js.map +1 -0
- package/esm/themes/types.d.ts +9 -0
- package/esm/themes/types.js +2 -0
- package/esm/themes/types.js.map +1 -0
- package/esm/transforms/arrange-draw-order.d.ts +10 -0
- package/esm/transforms/arrange-draw-order.js +32 -0
- package/esm/transforms/arrange-draw-order.js.map +1 -0
- package/esm/transforms/base-transform.d.ts +8 -0
- package/esm/transforms/base-transform.js +7 -0
- package/esm/transforms/base-transform.js.map +1 -0
- package/esm/transforms/collapse-expand-combo.d.ts +11 -0
- package/esm/transforms/collapse-expand-combo.js +75 -0
- package/esm/transforms/collapse-expand-combo.js.map +1 -0
- package/esm/transforms/collapse-expand-node.d.ts +12 -0
- package/esm/transforms/collapse-expand-node.js +91 -0
- package/esm/transforms/collapse-expand-node.js.map +1 -0
- package/esm/transforms/get-edge-actual-ends.d.ts +13 -0
- package/esm/transforms/get-edge-actual-ends.js +36 -0
- package/esm/transforms/get-edge-actual-ends.js.map +1 -0
- package/esm/transforms/index.d.ts +8 -0
- package/esm/transforms/index.js +8 -0
- package/esm/transforms/index.js.map +1 -0
- package/esm/transforms/process-parallel-edges.d.ts +85 -0
- package/esm/transforms/process-parallel-edges.js +228 -0
- package/esm/transforms/process-parallel-edges.js.map +1 -0
- package/esm/transforms/types.d.ts +20 -0
- package/esm/transforms/types.js +2 -0
- package/esm/transforms/types.js.map +1 -0
- package/esm/transforms/update-related-edge.d.ts +10 -0
- package/esm/transforms/update-related-edge.js +23 -0
- package/esm/transforms/update-related-edge.js.map +1 -0
- package/esm/transforms/utils.d.ts +13 -0
- package/esm/transforms/utils.js +25 -0
- package/esm/transforms/utils.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 +5 -0
- package/esm/types/animation.js +2 -0
- package/esm/types/animation.js.map +1 -0
- 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 +68 -0
- package/esm/types/change.js +2 -0
- package/esm/types/change.js.map +1 -0
- package/esm/types/combo.d.ts +20 -132
- package/esm/types/data.d.ts +44 -27
- package/esm/types/edge.d.ts +110 -97
- package/esm/types/element.d.ts +18 -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 +54 -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/history.d.ts +49 -26
- package/esm/types/history.js +1 -5
- package/esm/types/history.js.map +1 -1
- package/esm/types/id.d.ts +1 -0
- package/esm/types/id.js +2 -0
- package/esm/types/id.js.map +1 -0
- package/esm/types/index.d.ts +26 -16
- package/esm/types/index.js +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/types/layout.d.ts +8 -71
- package/esm/types/layout.js +1 -19
- package/esm/types/layout.js.map +1 -1
- package/esm/types/node.d.ts +132 -203
- 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 +17 -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 +9 -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 +36 -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 +47 -0
- package/esm/utils/animation.js +189 -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 +108 -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 +52 -0
- package/esm/utils/cache.js.map +1 -0
- package/esm/utils/change.d.ts +17 -0
- package/esm/utils/change.js +91 -0
- package/esm/utils/change.js.map +1 -0
- package/esm/utils/collapsibility.d.ts +9 -0
- package/esm/utils/collapsibility.js +11 -0
- package/esm/utils/collapsibility.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 +29 -0
- package/esm/utils/dom.js +92 -0
- package/esm/utils/dom.js.map +1 -0
- package/esm/utils/edge.d.ts +192 -0
- package/esm/utils/edge.js +516 -0
- package/esm/utils/edge.js.map +1 -0
- package/esm/utils/element.d.ts +231 -0
- package/esm/utils/element.js +469 -0
- package/esm/utils/element.js.map +1 -0
- package/esm/utils/event/events.d.ts +26 -0
- package/esm/utils/event/events.js +41 -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 +20 -0
- package/esm/utils/id.js +41 -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 +70 -0
- package/esm/utils/layout.js +204 -0
- package/esm/utils/layout.js.map +1 -0
- package/esm/utils/line.d.ts +21 -0
- package/esm/utils/line.js +41 -0
- package/esm/utils/line.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/node.d.ts +11 -0
- package/esm/utils/node.js +19 -0
- package/esm/utils/node.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 +32 -0
- package/esm/utils/palette.js +111 -0
- package/esm/utils/palette.js.map +1 -0
- package/esm/utils/path.d.ts +35 -0
- package/esm/utils/path.js +143 -0
- package/esm/utils/path.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 +192 -0
- package/esm/utils/point.js +342 -0
- package/esm/utils/point.js.map +1 -0
- package/esm/utils/polygon.d.ts +17 -0
- package/esm/utils/polygon.js +59 -0
- package/esm/utils/polygon.js.map +1 -0
- package/esm/utils/position.d.ts +50 -0
- package/esm/utils/position.js +67 -0
- package/esm/utils/position.js.map +1 -0
- package/esm/utils/prefix.d.ts +66 -0
- package/esm/utils/prefix.js +131 -0
- package/esm/utils/prefix.js.map +1 -0
- package/esm/utils/relation.d.ts +33 -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 +31 -0
- package/esm/utils/shortcut.js +88 -0
- package/esm/utils/shortcut.js.map +1 -0
- package/esm/utils/size.d.ts +7 -0
- package/esm/utils/size.js +12 -0
- package/esm/utils/size.js.map +1 -0
- package/esm/utils/style.d.ts +30 -0
- package/esm/utils/style.js +46 -0
- package/esm/utils/style.js.map +1 -0
- package/esm/utils/symbol.d.ts +30 -0
- package/esm/utils/symbol.js +75 -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/theme.d.ts +9 -0
- package/esm/utils/theme.js +17 -0
- package/esm/utils/theme.js.map +1 -0
- package/esm/utils/transform.d.ts +24 -0
- package/esm/utils/transform.js +43 -0
- package/esm/utils/transform.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 +143 -0
- package/esm/utils/vector.js +191 -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/lib/animations/executor.d.ts +11 -0
- package/lib/animations/executor.js +74 -0
- package/lib/animations/executor.js.map +1 -0
- package/lib/animations/index.d.ts +32 -0
- package/lib/animations/index.js +19 -0
- package/lib/animations/index.js.map +1 -0
- package/lib/animations/types.d.ts +113 -0
- package/lib/animations/types.js.map +1 -0
- package/lib/behaviors/base-behavior.d.ts +6 -0
- package/lib/behaviors/base-behavior.js +8 -0
- package/lib/behaviors/base-behavior.js.map +1 -0
- package/lib/behaviors/brush-select.d.ts +189 -0
- package/lib/behaviors/brush-select.js +278 -0
- package/lib/behaviors/brush-select.js.map +1 -0
- package/lib/behaviors/click-select.d.ts +116 -0
- package/lib/behaviors/click-select.js +137 -0
- package/lib/behaviors/click-select.js.map +1 -0
- package/lib/behaviors/collapse-expand.d.ts +64 -0
- package/lib/behaviors/collapse-expand.js +80 -0
- package/lib/behaviors/collapse-expand.js.map +1 -0
- package/lib/behaviors/create-edge.d.ts +75 -0
- package/lib/behaviors/create-edge.js +159 -0
- package/lib/behaviors/create-edge.js.map +1 -0
- package/lib/behaviors/drag-canvas.d.ts +83 -0
- package/lib/behaviors/drag-canvas.js +101 -0
- package/lib/behaviors/drag-canvas.js.map +1 -0
- package/lib/behaviors/drag-element-force.d.ts +53 -0
- package/lib/behaviors/drag-element-force.js +98 -0
- package/lib/behaviors/drag-element-force.js.map +1 -0
- package/lib/behaviors/drag-element.d.ts +209 -0
- package/lib/behaviors/drag-element.js +314 -0
- package/lib/behaviors/drag-element.js.map +1 -0
- package/lib/behaviors/focus-element.d.ts +42 -0
- package/lib/behaviors/focus-element.js +62 -0
- package/lib/behaviors/focus-element.js.map +1 -0
- package/lib/behaviors/hover-activate.d.ts +84 -0
- package/lib/behaviors/hover-activate.js +108 -0
- package/lib/behaviors/hover-activate.js.map +1 -0
- package/lib/behaviors/index.d.ts +26 -0
- package/lib/behaviors/index.js +30 -0
- package/lib/behaviors/index.js.map +1 -0
- package/lib/behaviors/lasso-select.d.ts +41 -0
- package/lib/behaviors/lasso-select.js +70 -0
- package/lib/behaviors/lasso-select.js.map +1 -0
- package/lib/behaviors/scroll-canvas.d.ts +85 -0
- package/lib/behaviors/scroll-canvas.js +104 -0
- package/lib/behaviors/scroll-canvas.js.map +1 -0
- package/lib/behaviors/types.d.ts +6 -0
- package/lib/behaviors/types.js.map +1 -0
- package/lib/behaviors/zoom-canvas.d.ts +98 -0
- package/lib/behaviors/zoom-canvas.js +114 -0
- package/lib/behaviors/zoom-canvas.js.map +1 -0
- package/lib/constants/animation.d.ts +3 -0
- package/lib/constants/animation.js +13 -0
- package/lib/constants/animation.js.map +1 -0
- package/lib/constants/change.d.ts +64 -0
- package/lib/constants/change.js +69 -0
- package/lib/constants/change.js.map +1 -0
- package/lib/constants/element.d.ts +7 -0
- package/lib/constants/element.js +11 -0
- package/lib/constants/element.js.map +1 -0
- package/lib/constants/events/animation.d.ts +6 -0
- package/lib/constants/events/animation.js +11 -0
- package/lib/constants/events/animation.js.map +1 -0
- package/lib/constants/events/canvas.d.ts +115 -0
- package/lib/constants/events/canvas.js +120 -0
- package/lib/constants/events/canvas.js.map +1 -0
- package/lib/constants/events/combo.d.ts +109 -0
- package/lib/constants/events/combo.js +114 -0
- package/lib/constants/events/combo.js.map +1 -0
- package/lib/constants/events/common.d.ts +122 -0
- package/lib/constants/events/common.js +127 -0
- package/lib/constants/events/common.js.map +1 -0
- package/lib/constants/events/container.d.ts +14 -0
- package/lib/constants/events/container.js +19 -0
- package/lib/constants/events/container.js.map +1 -0
- package/lib/constants/events/edge.d.ts +91 -0
- package/lib/constants/events/edge.js +96 -0
- package/lib/constants/events/edge.js.map +1 -0
- package/lib/constants/events/graph.d.ts +158 -0
- package/lib/constants/events/graph.js +163 -0
- package/lib/constants/events/graph.js.map +1 -0
- package/lib/constants/events/history.d.ts +38 -0
- package/lib/constants/events/history.js +43 -0
- package/lib/constants/events/history.js.map +1 -0
- package/lib/constants/events/index.d.ts +9 -0
- package/lib/constants/events/index.js +22 -0
- package/lib/constants/events/index.js.map +1 -0
- package/lib/constants/events/node.d.ts +109 -0
- package/lib/constants/events/node.js +114 -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 +5 -0
- package/lib/constants/index.js +22 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/constants/registry.d.ts +62 -0
- package/lib/constants/registry.js +67 -0
- package/lib/constants/registry.js.map +1 -0
- package/lib/elements/base-element.d.ts +35 -0
- package/lib/elements/base-element.js +46 -0
- package/lib/elements/base-element.js.map +1 -0
- package/lib/elements/combos/base-combo.d.ts +91 -0
- package/lib/elements/combos/base-combo.js +166 -0
- package/lib/elements/combos/base-combo.js.map +1 -0
- package/lib/elements/combos/circle.d.ts +25 -0
- package/lib/elements/combos/circle.js +49 -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 +21 -0
- package/lib/elements/combos/rect.js +33 -0
- package/lib/elements/combos/rect.js.map +1 -0
- package/lib/elements/edges/base-edge.d.ts +164 -0
- package/lib/elements/edges/base-edge.js +232 -0
- package/lib/elements/edges/base-edge.js.map +1 -0
- package/lib/elements/edges/cubic-horizontal.d.ts +39 -0
- package/lib/elements/edges/cubic-horizontal.js +32 -0
- package/lib/elements/edges/cubic-horizontal.js.map +1 -0
- package/lib/elements/edges/cubic-vertical.d.ts +39 -0
- package/lib/elements/edges/cubic-vertical.js +32 -0
- package/lib/elements/edges/cubic-vertical.js.map +1 -0
- package/lib/elements/edges/cubic.d.ts +48 -0
- package/lib/elements/edges/cubic.js +39 -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 +25 -0
- package/lib/elements/edges/line.js +27 -0
- package/lib/elements/edges/line.js.map +1 -0
- package/lib/elements/edges/polyline.d.ts +63 -0
- package/lib/elements/edges/polyline.js +71 -0
- package/lib/elements/edges/polyline.js.map +1 -0
- package/lib/elements/edges/quadratic.d.ts +44 -0
- package/lib/elements/edges/quadratic.js +28 -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 +193 -0
- package/lib/elements/nodes/base-node.js +222 -0
- package/lib/elements/nodes/base-node.js.map +1 -0
- package/lib/elements/nodes/circle.d.ts +26 -0
- package/lib/elements/nodes/circle.js +40 -0
- package/lib/elements/nodes/circle.js.map +1 -0
- package/lib/elements/nodes/diamond.d.ts +21 -0
- package/lib/elements/nodes/diamond.js +27 -0
- package/lib/elements/nodes/diamond.js.map +1 -0
- package/lib/elements/nodes/donut.d.ts +45 -0
- package/lib/elements/nodes/donut.js +99 -0
- package/lib/elements/nodes/donut.js.map +1 -0
- package/lib/elements/nodes/ellipse.d.ts +26 -0
- package/lib/elements/nodes/ellipse.js +45 -0
- package/lib/elements/nodes/ellipse.js.map +1 -0
- package/lib/elements/nodes/hexagon.d.ts +28 -0
- package/lib/elements/nodes/hexagon.js +29 -0
- package/lib/elements/nodes/hexagon.js.map +1 -0
- package/lib/elements/nodes/html.d.ts +41 -0
- package/lib/elements/nodes/html.js +226 -0
- package/lib/elements/nodes/html.js.map +1 -0
- package/lib/elements/nodes/image.d.ts +38 -0
- package/lib/elements/nodes/image.js +63 -0
- package/lib/elements/nodes/image.js.map +1 -0
- package/lib/elements/nodes/index.d.ts +22 -0
- package/lib/elements/nodes/index.js +26 -0
- package/lib/elements/nodes/index.js.map +1 -0
- package/lib/elements/nodes/rect.d.ts +25 -0
- package/lib/elements/nodes/rect.js +42 -0
- package/lib/elements/nodes/rect.js.map +1 -0
- package/lib/elements/nodes/star.d.ts +30 -0
- package/lib/elements/nodes/star.js +38 -0
- package/lib/elements/nodes/star.js.map +1 -0
- package/lib/elements/nodes/triangle.d.ts +31 -0
- package/lib/elements/nodes/triangle.js +57 -0
- package/lib/elements/nodes/triangle.js.map +1 -0
- package/lib/elements/shapes/badge.d.ts +15 -0
- package/lib/elements/shapes/badge.js +31 -0
- package/lib/elements/shapes/badge.js.map +1 -0
- package/lib/elements/shapes/base-shape.d.ts +63 -0
- package/lib/elements/shapes/base-shape.js +164 -0
- package/lib/elements/shapes/base-shape.js.map +1 -0
- package/lib/elements/shapes/contour.d.ts +66 -0
- package/lib/elements/shapes/contour.js +40 -0
- package/lib/elements/shapes/contour.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 +16 -0
- package/lib/elements/shapes/index.js +19 -0
- package/lib/elements/shapes/index.js.map +1 -0
- package/lib/elements/shapes/label.d.ts +32 -0
- package/lib/elements/shapes/label.js +75 -0
- package/lib/elements/shapes/label.js.map +1 -0
- package/lib/elements/shapes/polygon.d.ts +30 -0
- package/lib/elements/shapes/polygon.js +31 -0
- package/lib/elements/shapes/polygon.js.map +1 -0
- package/lib/exports.d.ts +40 -0
- package/lib/exports.js +109 -0
- package/lib/exports.js.map +1 -0
- package/lib/index.d.ts +3 -259
- package/lib/index.js +4 -27
- package/lib/index.js.map +1 -1
- package/lib/layouts/base-layout.d.ts +10 -0
- package/lib/layouts/base-layout.js +13 -0
- package/lib/layouts/base-layout.js.map +1 -0
- package/lib/layouts/index.d.ts +4 -0
- package/lib/layouts/index.js +25 -0
- package/lib/layouts/index.js.map +1 -0
- package/lib/layouts/types.d.ts +84 -0
- package/lib/layouts/types.js.map +1 -0
- package/lib/palettes/index.d.ts +10 -0
- package/lib/palettes/index.js +67 -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/background/index.d.ts +38 -0
- package/lib/plugins/background/index.js +52 -0
- package/lib/plugins/background/index.js.map +1 -0
- package/lib/plugins/base-plugin.d.ts +6 -0
- package/lib/plugins/base-plugin.js +8 -0
- package/lib/plugins/base-plugin.js.map +1 -0
- package/lib/plugins/bubble-sets.d.ts +116 -0
- package/lib/plugins/bubble-sets.js +283 -0
- package/lib/plugins/bubble-sets.js.map +1 -0
- package/lib/plugins/camera-setting.d.ts +111 -0
- package/lib/plugins/camera-setting.js +76 -0
- package/lib/plugins/camera-setting.js.map +1 -0
- package/lib/plugins/contextmenu/index.d.ts +115 -0
- package/lib/plugins/contextmenu/index.js +136 -0
- package/lib/plugins/contextmenu/index.js.map +1 -0
- package/lib/plugins/contextmenu/util.d.ts +26 -0
- package/lib/plugins/contextmenu/util.js +49 -0
- package/lib/plugins/contextmenu/util.js.map +1 -0
- package/lib/plugins/fullscreen/index.d.ts +79 -0
- package/lib/plugins/fullscreen/index.js +116 -0
- package/lib/plugins/fullscreen/index.js.map +1 -0
- package/lib/plugins/grid-line.d.ts +106 -0
- package/lib/plugins/grid-line.js +82 -0
- package/lib/plugins/grid-line.js.map +1 -0
- package/lib/plugins/history/index.d.ts +120 -0
- package/lib/plugins/history/index.js +202 -0
- package/lib/plugins/history/index.js.map +1 -0
- package/lib/plugins/history/util.d.ts +21 -0
- package/lib/plugins/history/util.js +88 -0
- package/lib/plugins/history/util.js.map +1 -0
- package/lib/plugins/hull/index.d.ts +114 -0
- package/lib/plugins/hull/index.js +168 -0
- package/lib/plugins/hull/index.js.map +1 -0
- package/lib/plugins/hull/util.d.ts +12 -0
- package/lib/plugins/hull/util.js +207 -0
- package/lib/plugins/hull/util.js.map +1 -0
- package/lib/plugins/index.d.ts +28 -0
- package/lib/plugins/index.js +32 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/legend.d.ts +129 -0
- package/lib/plugins/legend.js +322 -0
- package/lib/plugins/legend.js.map +1 -0
- package/lib/plugins/timebar.d.ts +241 -0
- package/lib/plugins/timebar.js +271 -0
- package/lib/plugins/timebar.js.map +1 -0
- package/lib/plugins/toolbar/index.d.ts +69 -0
- package/lib/plugins/toolbar/index.js +75 -0
- package/lib/plugins/toolbar/index.js.map +1 -0
- package/lib/plugins/toolbar/util.d.ts +33 -0
- package/lib/plugins/toolbar/util.js +97 -0
- package/lib/plugins/toolbar/util.js.map +1 -0
- package/lib/plugins/tooltip.d.ts +116 -0
- package/lib/plugins/tooltip.js +298 -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/index.d.ts +191 -0
- package/lib/plugins/watermark/index.js +71 -0
- package/lib/plugins/watermark/index.js.map +1 -0
- package/lib/plugins/watermark/util.d.ts +18 -0
- package/lib/plugins/watermark/util.js +78 -0
- package/lib/plugins/watermark/util.js.map +1 -0
- package/lib/preset.d.ts +1 -0
- package/lib/preset.js +7 -0
- package/lib/preset.js.map +1 -0
- package/lib/registry/build-in.d.ts +6 -0
- package/lib/registry/build-in.js +118 -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 +59 -0
- package/lib/registry/index.js +104 -0
- package/lib/registry/index.js.map +1 -0
- package/lib/registry/types.d.ts +39 -0
- package/lib/registry/types.js +3 -0
- package/lib/registry/types.js.map +1 -0
- package/lib/runtime/animation.d.ts +54 -0
- package/lib/runtime/animation.js +143 -0
- package/lib/runtime/animation.js.map +1 -0
- package/lib/runtime/batch.d.ts +11 -0
- package/lib/runtime/batch.js +35 -0
- package/lib/runtime/batch.js.map +1 -0
- package/lib/runtime/behavior.d.ts +20 -0
- package/lib/runtime/behavior.js +123 -0
- package/lib/runtime/behavior.js.map +1 -0
- package/lib/runtime/canvas.d.ts +60 -0
- package/lib/runtime/canvas.js +262 -0
- package/lib/runtime/canvas.js.map +1 -0
- package/lib/runtime/data.d.ts +202 -0
- package/lib/runtime/data.js +698 -0
- package/lib/runtime/data.js.map +1 -0
- package/lib/runtime/element.d.ts +102 -0
- package/lib/runtime/element.js +557 -0
- package/lib/runtime/element.js.map +1 -0
- package/lib/runtime/graph.d.ts +826 -536
- package/lib/runtime/graph.js +1028 -1830
- package/lib/runtime/graph.js.map +1 -1
- package/lib/runtime/layout.d.ts +38 -0
- package/lib/runtime/layout.js +240 -0
- package/lib/runtime/layout.js.map +1 -0
- package/lib/runtime/plugin.d.ts +10 -0
- package/lib/runtime/plugin.js +19 -0
- package/lib/runtime/plugin.js.map +1 -0
- package/lib/runtime/transform.d.ts +12 -0
- package/lib/runtime/transform.js +31 -0
- package/lib/runtime/transform.js.map +1 -0
- package/lib/runtime/types.d.ts +90 -0
- package/lib/runtime/types.js +3 -0
- package/lib/runtime/types.js.map +1 -0
- package/lib/runtime/viewport.d.ts +58 -0
- package/lib/runtime/viewport.js +245 -0
- package/lib/runtime/viewport.js.map +1 -0
- package/lib/spec/behavior.d.ts +30 -0
- package/lib/spec/behavior.js +3 -0
- package/lib/spec/behavior.js.map +1 -0
- package/lib/spec/canvas.d.ts +53 -0
- package/lib/spec/canvas.js +3 -0
- package/lib/spec/canvas.js.map +1 -0
- package/lib/spec/data.d.ts +222 -0
- package/lib/spec/data.js +3 -0
- package/lib/spec/data.js.map +1 -0
- package/lib/spec/element/animation.d.ts +6 -0
- package/lib/spec/element/animation.js +3 -0
- package/lib/spec/element/animation.js.map +1 -0
- package/lib/spec/element/combo.d.ts +52 -0
- package/lib/spec/element/combo.js +3 -0
- package/lib/spec/element/combo.js.map +1 -0
- package/lib/spec/element/edge.d.ts +52 -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 +52 -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/graph.d.ts +91 -0
- package/lib/spec/graph.js.map +1 -0
- package/lib/spec/index.d.ts +12 -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 +32 -0
- package/lib/spec/plugin.js +3 -0
- package/lib/spec/plugin.js.map +1 -0
- package/lib/spec/theme.d.ts +7 -0
- package/lib/spec/theme.js +3 -0
- package/lib/spec/theme.js.map +1 -0
- package/lib/spec/transform.d.ts +12 -0
- package/lib/spec/transform.js +3 -0
- package/lib/spec/transform.js.map +1 -0
- package/lib/spec/viewport.d.ts +82 -0
- package/lib/spec/viewport.js +3 -0
- package/lib/spec/viewport.js.map +1 -0
- package/lib/themes/base.d.ts +34 -0
- package/lib/themes/base.js +257 -0
- package/lib/themes/base.js.map +1 -0
- package/lib/themes/dark.d.ts +2 -0
- package/lib/themes/dark.js +42 -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 +25 -0
- package/lib/themes/light.js.map +1 -0
- package/lib/themes/types.d.ts +9 -0
- package/lib/themes/types.js +3 -0
- package/lib/themes/types.js.map +1 -0
- package/lib/transforms/arrange-draw-order.d.ts +10 -0
- package/lib/transforms/arrange-draw-order.js +36 -0
- package/lib/transforms/arrange-draw-order.js.map +1 -0
- package/lib/transforms/base-transform.d.ts +8 -0
- package/lib/transforms/base-transform.js +11 -0
- package/lib/transforms/base-transform.js.map +1 -0
- package/lib/transforms/collapse-expand-combo.d.ts +11 -0
- package/lib/transforms/collapse-expand-combo.js +79 -0
- package/lib/transforms/collapse-expand-combo.js.map +1 -0
- package/lib/transforms/collapse-expand-node.d.ts +12 -0
- package/lib/transforms/collapse-expand-node.js +95 -0
- package/lib/transforms/collapse-expand-node.js.map +1 -0
- package/lib/transforms/get-edge-actual-ends.d.ts +13 -0
- package/lib/transforms/get-edge-actual-ends.js +41 -0
- package/lib/transforms/get-edge-actual-ends.js.map +1 -0
- package/lib/transforms/index.d.ts +8 -0
- package/lib/transforms/index.js +18 -0
- package/lib/transforms/index.js.map +1 -0
- package/lib/transforms/process-parallel-edges.d.ts +85 -0
- package/lib/transforms/process-parallel-edges.js +235 -0
- package/lib/transforms/process-parallel-edges.js.map +1 -0
- package/lib/transforms/types.d.ts +20 -0
- package/lib/transforms/types.js +3 -0
- package/lib/transforms/types.js.map +1 -0
- package/lib/transforms/update-related-edge.d.ts +10 -0
- package/lib/transforms/update-related-edge.js +27 -0
- package/lib/transforms/update-related-edge.js.map +1 -0
- package/lib/transforms/utils.d.ts +13 -0
- package/lib/transforms/utils.js +29 -0
- package/lib/transforms/utils.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 +5 -0
- package/lib/types/animation.js +3 -0
- package/lib/types/animation.js.map +1 -0
- 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 +68 -0
- package/lib/types/change.js +3 -0
- package/lib/types/change.js.map +1 -0
- package/lib/types/combo.d.ts +20 -132
- package/lib/types/data.d.ts +44 -27
- package/lib/types/edge.d.ts +110 -97
- package/lib/types/element.d.ts +18 -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 +54 -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/history.d.ts +49 -26
- package/lib/types/history.js +0 -6
- package/lib/types/history.js.map +1 -1
- package/lib/types/id.d.ts +1 -0
- package/lib/types/id.js +3 -0
- package/lib/types/id.js.map +1 -0
- package/lib/types/index.d.ts +26 -16
- package/lib/types/index.js +0 -4
- package/lib/types/index.js.map +1 -1
- package/lib/types/layout.d.ts +8 -71
- package/lib/types/layout.js +0 -22
- package/lib/types/layout.js.map +1 -1
- package/lib/types/node.d.ts +132 -203
- 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 +17 -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 +9 -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 +36 -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 +47 -0
- package/lib/utils/animation.js +197 -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 +108 -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 +59 -0
- package/lib/utils/cache.js.map +1 -0
- package/lib/utils/change.d.ts +17 -0
- package/lib/utils/change.js +96 -0
- package/lib/utils/change.js.map +1 -0
- package/lib/utils/collapsibility.d.ts +9 -0
- package/lib/utils/collapsibility.js +15 -0
- package/lib/utils/collapsibility.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 +29 -0
- package/lib/utils/dom.js +99 -0
- package/lib/utils/dom.js.map +1 -0
- package/lib/utils/edge.d.ts +192 -0
- package/lib/utils/edge.js +537 -0
- package/lib/utils/edge.js.map +1 -0
- package/lib/utils/element.d.ts +231 -0
- package/lib/utils/element.js +498 -0
- package/lib/utils/element.js.map +1 -0
- package/lib/utils/event/events.d.ts +26 -0
- package/lib/utils/event/events.js +49 -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 +20 -0
- package/lib/utils/id.js +47 -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 +70 -0
- package/lib/utils/layout.js +214 -0
- package/lib/utils/layout.js.map +1 -0
- package/lib/utils/line.d.ts +21 -0
- package/lib/utils/line.js +46 -0
- package/lib/utils/line.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/node.d.ts +11 -0
- package/lib/utils/node.js +23 -0
- package/lib/utils/node.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 +32 -0
- package/lib/utils/palette.js +117 -0
- package/lib/utils/palette.js.map +1 -0
- package/lib/utils/path.d.ts +35 -0
- package/lib/utils/path.js +150 -0
- package/lib/utils/path.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 +192 -0
- package/lib/utils/point.js +366 -0
- package/lib/utils/point.js.map +1 -0
- package/lib/utils/polygon.d.ts +17 -0
- package/lib/utils/polygon.js +63 -0
- package/lib/utils/polygon.js.map +1 -0
- package/lib/utils/position.d.ts +50 -0
- package/lib/utils/position.js +75 -0
- package/lib/utils/position.js.map +1 -0
- package/lib/utils/prefix.d.ts +66 -0
- package/lib/utils/prefix.js +141 -0
- package/lib/utils/prefix.js.map +1 -0
- package/lib/utils/relation.d.ts +33 -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 +31 -0
- package/lib/utils/shortcut.js +92 -0
- package/lib/utils/shortcut.js.map +1 -0
- package/lib/utils/size.d.ts +7 -0
- package/lib/utils/size.js +16 -0
- package/lib/utils/size.js.map +1 -0
- package/lib/utils/style.d.ts +30 -0
- package/lib/utils/style.js +52 -0
- package/lib/utils/style.js.map +1 -0
- package/lib/utils/symbol.d.ts +30 -0
- package/lib/utils/symbol.js +85 -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/theme.d.ts +9 -0
- package/lib/utils/theme.js +21 -0
- package/lib/utils/theme.js.map +1 -0
- package/lib/utils/transform.d.ts +24 -0
- package/lib/utils/transform.js +48 -0
- package/lib/utils/transform.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 +143 -0
- package/lib/utils/vector.js +210 -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/package.json +58 -105
- package/scripts/tips.mjs +6 -0
- package/src/animations/executor.ts +94 -0
- package/src/animations/index.ts +23 -0
- package/src/animations/types.ts +122 -0
- package/src/behaviors/base-behavior.ts +6 -0
- package/src/behaviors/brush-select.ts +394 -0
- package/src/behaviors/click-select.ts +245 -0
- package/src/behaviors/collapse-expand.ts +124 -0
- package/src/behaviors/create-edge.ts +224 -0
- package/src/behaviors/drag-canvas.ts +157 -0
- package/src/behaviors/drag-element-force.ts +107 -0
- package/src/behaviors/drag-element.ts +438 -0
- package/src/behaviors/focus-element.ts +88 -0
- package/src/behaviors/hover-activate.ts +185 -0
- package/src/behaviors/index.ts +27 -0
- package/src/behaviors/lasso-select.ts +82 -0
- package/src/behaviors/scroll-canvas.ts +166 -0
- package/src/behaviors/types.ts +7 -0
- package/src/behaviors/zoom-canvas.ts +190 -0
- package/src/constants/animation.ts +12 -0
- package/src/constants/change.ts +65 -0
- package/src/constants/element.ts +8 -0
- package/src/constants/events/animation.ts +6 -0
- package/src/constants/events/canvas.ts +115 -0
- package/src/constants/events/combo.ts +109 -0
- package/src/constants/events/common.ts +122 -0
- package/src/constants/events/container.ts +14 -0
- package/src/constants/events/edge.ts +91 -0
- package/src/constants/events/graph.ts +158 -0
- package/src/constants/events/history.ts +38 -0
- package/src/constants/events/index.ts +9 -0
- package/src/constants/events/node.ts +109 -0
- package/src/constants/graphlib.ts +3 -0
- package/src/constants/index.ts +5 -0
- package/src/constants/registry.ts +62 -0
- package/src/elements/base-element.ts +52 -0
- package/src/elements/combos/base-combo.ts +260 -0
- package/src/elements/combos/circle.ts +61 -0
- package/src/elements/combos/index.ts +7 -0
- package/src/elements/combos/rect.ts +41 -0
- package/src/elements/edges/base-edge.ts +420 -0
- package/src/elements/edges/cubic-horizontal.ts +60 -0
- package/src/elements/edges/cubic-vertical.ts +60 -0
- package/src/elements/edges/cubic.ts +86 -0
- package/src/elements/edges/index.ts +15 -0
- package/src/elements/edges/line.ts +37 -0
- package/src/elements/edges/polyline.ts +143 -0
- package/src/elements/edges/quadratic.ts +61 -0
- package/src/elements/index.ts +3 -0
- package/src/elements/nodes/base-node.ts +426 -0
- package/src/elements/nodes/circle.ts +52 -0
- package/src/elements/nodes/diamond.ts +35 -0
- package/src/elements/nodes/donut.ts +147 -0
- package/src/elements/nodes/ellipse.ts +58 -0
- package/src/elements/nodes/hexagon.ts +45 -0
- package/src/elements/nodes/html.ts +256 -0
- package/src/elements/nodes/image.ts +89 -0
- package/src/elements/nodes/index.ts +23 -0
- package/src/elements/nodes/rect.ts +53 -0
- package/src/elements/nodes/star.ts +56 -0
- package/src/elements/nodes/triangle.ts +78 -0
- package/src/elements/shapes/badge.ts +37 -0
- package/src/elements/shapes/base-shape.ts +199 -0
- package/src/elements/shapes/contour.ts +106 -0
- package/src/elements/shapes/icon.ts +39 -0
- package/src/elements/shapes/index.ts +18 -0
- package/src/elements/shapes/label.ts +106 -0
- package/src/elements/shapes/polygon.ts +51 -0
- package/src/exports.ts +241 -0
- package/src/index.ts +3 -23
- package/src/layouts/base-layout.ts +18 -0
- package/src/layouts/hierarchy.d.ts +10 -0
- package/src/layouts/index.ts +17 -0
- package/src/layouts/types.ts +131 -0
- package/src/palettes/index.ts +67 -0
- package/src/palettes/types.ts +9 -0
- package/src/plugins/background/index.ts +64 -0
- package/src/plugins/base-plugin.ts +6 -0
- package/src/plugins/bubble-sets.ts +333 -0
- package/src/plugins/camera-setting.ts +168 -0
- package/src/plugins/contextmenu/index.ts +225 -0
- package/src/plugins/contextmenu/util.ts +62 -0
- package/src/plugins/fullscreen/index.ts +168 -0
- package/src/plugins/grid-line.ts +165 -0
- package/src/plugins/history/index.ts +256 -0
- package/src/plugins/history/util.ts +90 -0
- package/src/plugins/hull/index.ts +214 -0
- package/src/plugins/hull/util.ts +222 -0
- package/src/plugins/index.ts +29 -0
- package/src/plugins/legend.ts +405 -0
- package/src/plugins/timebar.ts +471 -0
- package/src/plugins/toolbar/index.ts +131 -0
- package/src/plugins/toolbar/util.ts +119 -0
- package/src/plugins/tooltip.ts +343 -0
- package/src/plugins/types.ts +5 -0
- package/src/plugins/watermark/index.ts +239 -0
- package/src/plugins/watermark/util.ts +93 -0
- package/src/preset.ts +5 -0
- package/src/registry/build-in.ts +186 -0
- package/src/registry/extension/index.ts +112 -0
- package/src/registry/extension/types.ts +45 -0
- package/src/registry/index.ts +109 -0
- package/src/registry/types.ts +26 -0
- package/src/runtime/animation.ts +186 -0
- package/src/runtime/batch.ts +38 -0
- package/src/runtime/behavior.ts +136 -0
- package/src/runtime/canvas.ts +348 -0
- package/src/runtime/data.ts +789 -0
- package/src/runtime/element.ts +738 -0
- package/src/runtime/graph.ts +1309 -2353
- package/src/runtime/layout.ts +299 -0
- package/src/runtime/plugin.ts +21 -0
- package/src/runtime/transform.ts +35 -0
- package/src/runtime/types.ts +91 -0
- package/src/runtime/viewport.ts +282 -0
- package/src/spec/behavior.ts +33 -0
- package/src/spec/canvas.ts +54 -0
- package/src/spec/data.ts +225 -0
- package/src/spec/element/animation.ts +6 -0
- package/src/spec/element/combo.ts +55 -0
- package/src/spec/element/edge.ts +55 -0
- package/src/spec/element/node.ts +55 -0
- package/src/spec/element/palette.ts +57 -0
- package/src/spec/graph.ts +93 -0
- package/src/spec/index.ts +12 -0
- package/src/spec/layout.ts +7 -0
- package/src/spec/plugin.ts +35 -0
- package/src/spec/theme.ts +7 -0
- package/src/spec/transform.ts +15 -0
- package/src/spec/viewport.ts +76 -0
- package/src/themes/base.ts +305 -0
- package/src/themes/dark.ts +43 -0
- package/src/themes/index.ts +2 -0
- package/src/themes/light.ts +24 -0
- package/src/themes/types.ts +10 -0
- package/src/transforms/arrange-draw-order.ts +42 -0
- package/src/transforms/base-transform.ts +12 -0
- package/src/transforms/collapse-expand-combo.ts +80 -0
- package/src/transforms/collapse-expand-node.ts +107 -0
- package/src/transforms/get-edge-actual-ends.ts +45 -0
- package/src/transforms/index.ts +9 -0
- package/src/transforms/process-parallel-edges.ts +298 -0
- package/src/transforms/types.ts +23 -0
- package/src/transforms/update-related-edge.ts +31 -0
- package/src/transforms/utils.ts +31 -0
- package/src/types/anchor.ts +5 -0
- package/src/types/animation.ts +7 -0
- package/src/types/callable.ts +33 -0
- package/src/types/canvas.ts +1 -0
- package/src/types/change.ts +82 -0
- package/src/types/combo.ts +21 -174
- package/src/types/data.ts +53 -56
- package/src/types/edge.ts +124 -122
- package/src/types/element.ts +25 -0
- package/src/types/enum.ts +1 -0
- package/src/types/event.ts +73 -43
- package/src/types/graphlib.ts +28 -0
- package/src/types/history.ts +50 -27
- package/src/types/id.ts +1 -0
- package/src/types/index.ts +26 -54
- package/src/types/layout.ts +8 -138
- package/src/types/node.ts +140 -225
- 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 +2 -0
- package/src/types/position.ts +3 -0
- package/src/types/prefix.ts +19 -0
- package/src/types/size.ts +5 -0
- package/src/types/state.ts +1 -0
- package/src/types/style.ts +10 -0
- package/src/types/tree.ts +5 -0
- package/src/types/vector.ts +3 -0
- package/src/types/viewport.ts +41 -0
- package/src/utils/anchor.ts +19 -0
- package/src/utils/animation.ts +208 -0
- package/src/utils/array.ts +15 -0
- package/src/utils/bbox.ts +228 -0
- package/src/utils/cache.ts +57 -0
- package/src/utils/change.ts +101 -0
- package/src/utils/collapsibility.ts +12 -0
- package/src/utils/data.ts +64 -0
- package/src/utils/diff.ts +43 -0
- package/src/utils/dom.ts +115 -0
- package/src/utils/edge.ts +621 -0
- package/src/utils/element.ts +527 -0
- package/src/utils/event/events.ts +72 -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 +46 -0
- package/src/utils/is.ts +53 -0
- package/src/utils/layout.ts +241 -0
- package/src/utils/line.ts +50 -0
- package/src/utils/math.ts +12 -0
- package/src/utils/node.ts +23 -0
- package/src/utils/padding.ts +16 -0
- package/src/utils/palette.ts +126 -0
- package/src/utils/path.ts +153 -0
- package/src/utils/placement.ts +19 -0
- package/src/utils/point.ts +374 -0
- package/src/utils/polygon.ts +69 -0
- package/src/utils/position.ts +73 -0
- package/src/utils/prefix.ts +141 -0
- package/src/utils/relation.ts +83 -0
- package/src/utils/router/orth.ts +323 -0
- package/src/utils/shape.ts +26 -0
- package/src/utils/shortcut.ts +113 -0
- package/src/utils/size.ts +12 -0
- package/src/utils/style.ts +55 -0
- package/src/utils/symbol.ts +86 -0
- package/src/utils/text.ts +51 -0
- package/src/utils/theme.ts +18 -0
- package/src/utils/transform.ts +50 -0
- package/src/utils/traverse.ts +59 -0
- package/src/utils/tree.ts +47 -0
- package/src/utils/vector.ts +208 -0
- package/src/utils/visibility.ts +31 -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.d.ts +0 -0
- 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 -23
- 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 -195
- package/esm/item/combo.js.map +0 -1
- package/esm/item/edge.d.ts +0 -74
- package/esm/item/edge.js +0 -198
- package/esm/item/edge.js.map +0 -1
- package/esm/item/item.d.ts +0 -192
- package/esm/item/item.js +0 -711
- package/esm/item/item.js.map +0 -1
- package/esm/item/node.d.ts +0 -64
- package/esm/item/node.js +0 -208
- package/esm/item/node.js.map +0 -1
- package/esm/runtime/controller/data.d.ts +0 -86
- package/esm/runtime/controller/data.js +0 -722
- 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 -144
- package/esm/runtime/controller/item.js +0 -1257
- 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 -267
- 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/create-edge.d.ts +0 -57
- package/esm/stdlib/behavior/create-edge.js +0 -207
- package/esm/stdlib/behavior/create-edge.js.map +0 -1
- package/esm/stdlib/behavior/drag-canvas.d.ts +0 -82
- package/esm/stdlib/behavior/drag-canvas.js +0 -281
- 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 -391
- 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 -452
- 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 -18
- package/esm/stdlib/behavior/index.js +0 -19
- 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 -78
- 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/scroll-canvas.d.ts +0 -67
- package/esm/stdlib/behavior/scroll-canvas.js +0 -266
- package/esm/stdlib/behavior/scroll-canvas.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 -69
- package/esm/stdlib/behavior/zoom-canvas.js +0 -200
- 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 -156
- package/esm/stdlib/index.js +0 -211
- 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 -448
- 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 -595
- package/esm/stdlib/item/node/base.js.map +0 -1
- package/esm/stdlib/item/node/base3d.d.ts +0 -97
- package/esm/stdlib/item/node/base3d.js +0 -130
- 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 -109
- package/esm/stdlib/item/node/hexagon.js.map +0 -1
- package/esm/stdlib/item/node/image.d.ts +0 -40
- package/esm/stdlib/item/node/image.js +0 -110
- package/esm/stdlib/item/node/image.js.map +0 -1
- package/esm/stdlib/item/node/index.d.ts +0 -11
- package/esm/stdlib/item/node/index.js +0 -12
- 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 -72
- 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 -379
- 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 -10
- package/esm/stdlib/plugin/index.js +0 -11
- 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 -118
- package/esm/stdlib/plugin/minimap/index.js +0 -683
- package/esm/stdlib/plugin/minimap/index.js.map +0 -1
- package/esm/stdlib/plugin/snapline/index.d.ts +0 -167
- package/esm/stdlib/plugin/snapline/index.js +0 -1063
- package/esm/stdlib/plugin/snapline/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 -10
- 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 -332
- 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/behavior.d.ts +0 -45
- package/esm/types/behavior.js +0 -14
- package/esm/types/behavior.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 -620
- package/esm/types/graph.js.map +0 -1
- package/esm/types/hook.d.ts +0 -144
- package/esm/types/hook.js +0 -2
- package/esm/types/hook.js.map +0 -1
- package/esm/types/item.d.ts +0 -241
- package/esm/types/item.js +0 -16
- package/esm/types/item.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 -98
- package/esm/types/spec.js +0 -2
- 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 -28
- 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 -121
- package/esm/util/bbox.js +0 -284
- 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 -42
- package/esm/util/event.js +0 -103
- 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 -30
- package/esm/util/item.js +0 -90
- package/esm/util/item.js.map +0 -1
- package/esm/util/layout.d.ts +0 -51
- package/esm/util/layout.js +0 -205
- 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 -192
- 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 -616
- 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/warn.d.ts +0 -14
- package/esm/util/warn.js +0 -4
- package/esm/util/warn.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.d.ts +0 -0
- 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 -23
- 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 -201
- package/lib/item/combo.js.map +0 -1
- package/lib/item/edge.d.ts +0 -74
- package/lib/item/edge.js +0 -204
- package/lib/item/edge.js.map +0 -1
- package/lib/item/item.d.ts +0 -192
- package/lib/item/item.js +0 -714
- package/lib/item/item.js.map +0 -1
- package/lib/item/node.d.ts +0 -64
- package/lib/item/node.js +0 -214
- package/lib/item/node.js.map +0 -1
- package/lib/runtime/controller/data.d.ts +0 -86
- package/lib/runtime/controller/data.js +0 -726
- 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 -144
- package/lib/runtime/controller/item.js +0 -1264
- 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 -271
- 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/create-edge.d.ts +0 -57
- package/lib/stdlib/behavior/create-edge.js +0 -211
- package/lib/stdlib/behavior/create-edge.js.map +0 -1
- package/lib/stdlib/behavior/drag-canvas.d.ts +0 -82
- package/lib/stdlib/behavior/drag-canvas.js +0 -285
- 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 -395
- 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 -456
- 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 -18
- package/lib/stdlib/behavior/index.js +0 -35
- 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 -82
- 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/scroll-canvas.d.ts +0 -67
- package/lib/stdlib/behavior/scroll-canvas.js +0 -270
- package/lib/stdlib/behavior/scroll-canvas.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 -69
- package/lib/stdlib/behavior/zoom-canvas.js +0 -204
- 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 -156
- package/lib/stdlib/index.js +0 -243
- 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 -452
- 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 -599
- package/lib/stdlib/item/node/base.js.map +0 -1
- package/lib/stdlib/item/node/base3d.d.ts +0 -97
- package/lib/stdlib/item/node/base3d.js +0 -134
- 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 -113
- package/lib/stdlib/item/node/hexagon.js.map +0 -1
- package/lib/stdlib/item/node/image.d.ts +0 -40
- package/lib/stdlib/item/node/image.js +0 -114
- package/lib/stdlib/item/node/image.js.map +0 -1
- package/lib/stdlib/item/node/index.d.ts +0 -11
- package/lib/stdlib/item/node/index.js +0 -28
- 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 -76
- 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 -382
- 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 -10
- package/lib/stdlib/plugin/index.js +0 -27
- 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 -118
- package/lib/stdlib/plugin/minimap/index.js +0 -687
- package/lib/stdlib/plugin/minimap/index.js.map +0 -1
- package/lib/stdlib/plugin/snapline/index.d.ts +0 -167
- package/lib/stdlib/plugin/snapline/index.js +0 -1067
- package/lib/stdlib/plugin/snapline/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 -10
- 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 -335
- 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/behavior.d.ts +0 -45
- package/lib/types/behavior.js +0 -18
- package/lib/types/behavior.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 -620
- package/lib/types/graph.js.map +0 -1
- package/lib/types/hook.d.ts +0 -144
- package/lib/types/hook.js +0 -3
- package/lib/types/hook.js.map +0 -1
- package/lib/types/item.d.ts +0 -241
- package/lib/types/item.js +0 -19
- package/lib/types/item.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 -98
- package/lib/types/spec.js +0 -3
- 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 -28
- 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 -121
- package/lib/util/bbox.js +0 -304
- 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 -42
- package/lib/util/event.js +0 -109
- 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 -30
- package/lib/util/item.js +0 -96
- package/lib/util/item.js.map +0 -1
- package/lib/util/layout.d.ts +0 -51
- package/lib/util/layout.js +0 -218
- 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 -204
- 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 -634
- 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/warn.d.ts +0 -14
- package/lib/util/warn.js +0 -8
- package/lib/util/warn.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 -315
- package/src/item/edge.ts +0 -301
- package/src/item/item.ts +0 -915
- package/src/item/node.ts +0 -358
- package/src/runtime/controller/data.ts +0 -850
- 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 -1775
- 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 -387
- 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/create-edge.ts +0 -296
- package/src/stdlib/behavior/drag-canvas.ts +0 -384
- 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 -18
- package/src/stdlib/behavior/lasso-select.ts +0 -100
- package/src/stdlib/behavior/orbit-canvas-3d.ts +0 -102
- package/src/stdlib/behavior/rotate-canvas-3d.ts +0 -170
- package/src/stdlib/behavior/scroll-canvas.ts +0 -348
- 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 -306
- 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 -295
- 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 -735
- 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 -996
- package/src/stdlib/item/node/base3d.ts +0 -211
- 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 -176
- package/src/stdlib/item/node/image.ts +0 -190
- package/src/stdlib/item/node/index.ts +0 -11
- 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 -114
- 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 -504
- 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 -10
- 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 -808
- package/src/stdlib/plugin/snapline/index.ts +0 -1297
- 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 -10
- package/src/stdlib/selector/lasso.ts +0 -75
- package/src/stdlib/selector/rect.ts +0 -78
- package/src/stdlib/theme/dark.ts +0 -418
- 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/behavior.ts +0 -48
- package/src/types/common.ts +0 -21
- package/src/types/graph.ts +0 -814
- package/src/types/hook.ts +0 -148
- package/src/types/item.ts +0 -348
- package/src/types/loop.ts +0 -23
- package/src/types/render.ts +0 -1
- package/src/types/spec.ts +0 -152
- package/src/types/stdlib.ts +0 -25
- package/src/types/theme.ts +0 -171
- package/src/types/view.ts +0 -36
- 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 -335
- 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 -160
- 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 -173
- package/src/util/layout.ts +0 -210
- 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 -231
- package/src/util/polyline.ts +0 -676
- package/src/util/router.ts +0 -561
- package/src/util/shape.ts +0 -764
- package/src/util/shape3d.ts +0 -203
- package/src/util/text.ts +0 -49
- package/src/util/type.ts +0 -11
- package/src/util/warn.ts +0 -20
- 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/{stdlib/plugin → layouts}/types.js +0 -0
- /package/esm/{types → spec}/graph.js +0 -0
- /package/esm/{api-doc → spec}/layout.js +0 -0
- /package/lib/{stdlib/behavior → animations}/types.js +0 -0
- /package/lib/{stdlib/plugin/hull → behaviors}/types.js +0 -0
- /package/lib/{stdlib/plugin → layouts}/types.js +0 -0
- /package/lib/{types → spec}/graph.js +0 -0
- /package/lib/{api-doc → spec}/layout.js +0 -0
package/lib/runtime/graph.js
CHANGED
|
@@ -1,2075 +1,1273 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Graph = void 0;
|
|
26
7
|
const event_emitter_1 = __importDefault(require("@antv/event-emitter"));
|
|
27
|
-
const g_1 = require("@antv/g");
|
|
28
8
|
const util_1 = require("@antv/util");
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
9
|
+
const constants_1 = require("../constants");
|
|
10
|
+
const registry_1 = require("../registry");
|
|
11
|
+
const collapsibility_1 = require("../utils/collapsibility");
|
|
12
|
+
const dom_1 = require("../utils/dom");
|
|
13
|
+
const event_1 = require("../utils/event");
|
|
14
|
+
const id_1 = require("../utils/id");
|
|
15
|
+
const point_1 = require("../utils/point");
|
|
16
|
+
const style_1 = require("../utils/style");
|
|
17
|
+
const vector_1 = require("../utils/vector");
|
|
18
|
+
const animation_1 = require("./animation");
|
|
19
|
+
const batch_1 = require("./batch");
|
|
20
|
+
const behavior_1 = require("./behavior");
|
|
21
|
+
const canvas_1 = require("./canvas");
|
|
22
|
+
const data_1 = require("./data");
|
|
23
|
+
const element_1 = require("./element");
|
|
24
|
+
const layout_1 = require("./layout");
|
|
25
|
+
const plugin_1 = require("./plugin");
|
|
26
|
+
const transform_1 = require("./transform");
|
|
27
|
+
const viewport_1 = require("./viewport");
|
|
36
28
|
class Graph extends event_emitter_1.default {
|
|
37
|
-
|
|
29
|
+
options;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
static defaultOptions = {
|
|
34
|
+
autoResize: false,
|
|
35
|
+
theme: 'light',
|
|
36
|
+
rotation: 0,
|
|
37
|
+
zoom: 1,
|
|
38
|
+
zoomRange: [0.01, 10],
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* <zh/> 当前图实例是否已经被销毁
|
|
42
|
+
*
|
|
43
|
+
* <en/> Whether the current graph instance has been destroyed
|
|
44
|
+
*/
|
|
45
|
+
destroyed = false;
|
|
46
|
+
// @ts-expect-error will be initialized in createRuntime
|
|
47
|
+
context = {
|
|
48
|
+
model: new data_1.DataController(),
|
|
49
|
+
};
|
|
50
|
+
constructor(options) {
|
|
38
51
|
super();
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
enableStack: true,
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Execute a callback without allowing any stacking operations.
|
|
48
|
-
* @param callback
|
|
49
|
-
*/
|
|
50
|
-
this.executeWithNoStack = (callback) => {
|
|
51
|
-
const history = this.getHistoryPlugin();
|
|
52
|
-
history === null || history === void 0 ? void 0 : history.pauseStack();
|
|
53
|
-
try {
|
|
54
|
-
callback();
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
history === null || history === void 0 ? void 0 : history.resumeStack();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
this.specification = Object.assign({}, this.defaultSpecification, this.formatSpecification(spec));
|
|
61
|
-
this.initHooks();
|
|
62
|
-
this.initCanvas();
|
|
63
|
-
this.initControllers();
|
|
64
|
-
this.initHistory();
|
|
65
|
-
this.hooks.init.emit({
|
|
66
|
-
canvases: {
|
|
67
|
-
background: this.backgroundCanvas,
|
|
68
|
-
main: this.canvas,
|
|
69
|
-
transient: this.transientCanvas,
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
const { data } = spec;
|
|
73
|
-
if (data) {
|
|
74
|
-
// TODO: handle multiple type data configs
|
|
75
|
-
this.read(data);
|
|
76
|
-
}
|
|
52
|
+
this.options = Object.assign({}, Graph.defaultOptions, options);
|
|
53
|
+
this.setOptions(this.options);
|
|
54
|
+
this.context.graph = this;
|
|
55
|
+
// Listening window.resize to autoResize.
|
|
56
|
+
this.options.autoResize && window.addEventListener('resize', this.onResize);
|
|
77
57
|
}
|
|
78
58
|
/**
|
|
79
|
-
*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.
|
|
87
|
-
this.viewportController = new controller_1.ViewportController(this);
|
|
88
|
-
this.extensionController = new controller_1.ExtensionController(this);
|
|
89
|
-
this.pluginController = new plugin_1.PluginController(this);
|
|
90
|
-
}
|
|
91
|
-
initCanvas() {
|
|
92
|
-
const { renderer, container, canvas, backgroundCanvas, transientCanvas, width, height, } = this.specification;
|
|
93
|
-
let pixelRatio;
|
|
94
|
-
if (renderer && !(0, util_1.isString)(renderer)) {
|
|
95
|
-
// @ts-ignore
|
|
96
|
-
this.rendererType = renderer.type || 'canvas';
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
pixelRatio = renderer.pixelRatio;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
this.rendererType = renderer || 'canvas';
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* These 3 canvases can be passed in by users, e.g. when doing serverside rendering we can't use DOM API.
|
|
106
|
-
*/
|
|
107
|
-
if (canvas) {
|
|
108
|
-
this.canvas = canvas;
|
|
109
|
-
this.backgroundCanvas = backgroundCanvas;
|
|
110
|
-
this.transientCanvas = transientCanvas;
|
|
111
|
-
this.container = container;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
const containerDOM = (0, util_1.isString)(container)
|
|
115
|
-
? document.getElementById(container)
|
|
116
|
-
: container;
|
|
117
|
-
if (!containerDOM) {
|
|
118
|
-
console.error(`Create graph failed. The container for graph ${containerDOM} is not exist.`);
|
|
119
|
-
this.destroy();
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
this.container = containerDOM;
|
|
123
|
-
const size = [width, height];
|
|
124
|
-
if (size[0] === undefined) {
|
|
125
|
-
size[0] = containerDOM.scrollWidth;
|
|
126
|
-
}
|
|
127
|
-
if (size[1] === undefined) {
|
|
128
|
-
size[1] = containerDOM.scrollHeight;
|
|
129
|
-
}
|
|
130
|
-
this.backgroundCanvas = (0, canvas_1.createCanvas)(this.rendererType, containerDOM, size[0], size[1], pixelRatio);
|
|
131
|
-
this.canvas = (0, canvas_1.createCanvas)(this.rendererType, containerDOM, size[0], size[1], pixelRatio);
|
|
132
|
-
this.transientCanvas = (0, canvas_1.createCanvas)(this.rendererType, containerDOM, size[0], size[1], pixelRatio);
|
|
133
|
-
}
|
|
134
|
-
Promise.all([this.backgroundCanvas, this.canvas, this.transientCanvas].map((canvas) => canvas.ready)).then(() => {
|
|
135
|
-
[this.backgroundCanvas, this.canvas, this.transientCanvas].forEach((canvas, i) => {
|
|
136
|
-
const $domElement = canvas
|
|
137
|
-
.getContextService()
|
|
138
|
-
.getDomElement();
|
|
139
|
-
if ($domElement && $domElement.style) {
|
|
140
|
-
$domElement.style.position = 'fixed';
|
|
141
|
-
$domElement.style.outline = 'none';
|
|
142
|
-
$domElement.tabIndex = 1; // Enable keyboard events
|
|
143
|
-
// Transient canvas should let interactive events go through.
|
|
144
|
-
if (i === 2) {
|
|
145
|
-
$domElement.style.pointerEvents = 'none';
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
this.canvasReady = true;
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
initHistory() {
|
|
153
|
-
const { enableStack, stackCfg } = this.specification;
|
|
154
|
-
if (enableStack) {
|
|
155
|
-
const history = {
|
|
156
|
-
type: 'history',
|
|
157
|
-
key: 'history',
|
|
158
|
-
enableStack,
|
|
159
|
-
stackCfg,
|
|
160
|
-
};
|
|
161
|
-
if (!this.specification.plugins) {
|
|
162
|
-
this.specification.plugins = [];
|
|
163
|
-
}
|
|
164
|
-
this.specification.plugins.push(history);
|
|
165
|
-
}
|
|
59
|
+
* <zh/> 获取配置项
|
|
60
|
+
*
|
|
61
|
+
* <en/> Get options
|
|
62
|
+
* @returns <zh/> 配置项 | <en/> options
|
|
63
|
+
* @apiCategory option
|
|
64
|
+
*/
|
|
65
|
+
getOptions() {
|
|
66
|
+
return this.options;
|
|
166
67
|
}
|
|
167
68
|
/**
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
69
|
+
* <zh/> 设置配置项
|
|
70
|
+
*
|
|
71
|
+
* <en/> Set options
|
|
72
|
+
* @param options - <zh/> 配置项 | <en/> options
|
|
73
|
+
* @remarks
|
|
74
|
+
* <zh/> 要更新 devicePixelRatio、container 属性请销毁后重新创建实例
|
|
75
|
+
*
|
|
76
|
+
* <en/> To update devicePixelRatio and container properties, please destroy and recreate the instance
|
|
77
|
+
* @apiCategory option
|
|
78
|
+
*/
|
|
79
|
+
setOptions(options) {
|
|
80
|
+
const { background, behaviors, combo, data, edge, height, layout, node, plugins, theme, transforms, width } = options;
|
|
81
|
+
Object.assign(this.options, options);
|
|
82
|
+
if (background)
|
|
83
|
+
this.setBackground(background);
|
|
84
|
+
if (behaviors)
|
|
85
|
+
this.setBehaviors(behaviors);
|
|
86
|
+
if (combo)
|
|
87
|
+
this.setCombo(combo);
|
|
88
|
+
if (data)
|
|
89
|
+
this.setData(data);
|
|
90
|
+
if (edge)
|
|
91
|
+
this.setEdge(edge);
|
|
92
|
+
if (layout)
|
|
93
|
+
this.setLayout(layout);
|
|
94
|
+
if (node)
|
|
95
|
+
this.setNode(node);
|
|
96
|
+
if (theme)
|
|
97
|
+
this.setTheme(theme);
|
|
98
|
+
if (plugins)
|
|
99
|
+
this.setPlugins(plugins);
|
|
100
|
+
if (transforms)
|
|
101
|
+
this.setTransforms(transforms);
|
|
102
|
+
if ((0, util_1.isNumber)(width) || (0, util_1.isNumber)(height))
|
|
103
|
+
this.setSize(width ?? this.options.width ?? 0, height ?? this.options.height ?? 0);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* <zh/> 设置画布背景色
|
|
107
|
+
*
|
|
108
|
+
* <en/> Set canvas background color
|
|
109
|
+
* @param background - <zh/> 背景色 | <en/> background color
|
|
110
|
+
* @apiCategory canvas
|
|
111
|
+
*/
|
|
112
|
+
setBackground(background) {
|
|
113
|
+
this.options.background = background;
|
|
114
|
+
this.context.canvas?.setBackground(background);
|
|
213
115
|
}
|
|
214
116
|
/**
|
|
215
|
-
*
|
|
117
|
+
* <zh/> 获取画布背景色
|
|
118
|
+
*
|
|
119
|
+
* <en/> Get canvas background color
|
|
120
|
+
* @returns <zh/> 背景色 | <en/> background color
|
|
121
|
+
* @apiCategory canvas
|
|
216
122
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// TODO: update something
|
|
220
|
-
return newSpec;
|
|
123
|
+
getBackground() {
|
|
124
|
+
return this.options.background;
|
|
221
125
|
}
|
|
222
126
|
/**
|
|
223
|
-
*
|
|
127
|
+
* <zh/> 获取当前图容器的大小
|
|
128
|
+
*
|
|
129
|
+
* <en/> Get the size of the current canvas container
|
|
130
|
+
* @returns <zh/> 画布尺寸 | <en/> canvas size
|
|
131
|
+
* @apiCategory canvas
|
|
224
132
|
*/
|
|
225
|
-
|
|
226
|
-
this.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
this.hooks.themechange.emit({
|
|
230
|
-
canvases: {
|
|
231
|
-
background: this.backgroundCanvas,
|
|
232
|
-
main: this.canvas,
|
|
233
|
-
transient: this.transientCanvas,
|
|
234
|
-
},
|
|
235
|
-
});
|
|
236
|
-
// theme is formatted by themeController, notify the item controller to update the items
|
|
237
|
-
this.hooks.themechange.emit({
|
|
238
|
-
theme: this.themeController.specification,
|
|
239
|
-
});
|
|
133
|
+
getSize() {
|
|
134
|
+
if (this.context.canvas)
|
|
135
|
+
return this.context.canvas.getSize();
|
|
136
|
+
return [this.options.width || 0, this.options.height || 0];
|
|
240
137
|
}
|
|
241
138
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
this.specification.edge = mapper;
|
|
253
|
-
break;
|
|
254
|
-
case 'combo':
|
|
255
|
-
this.specification.combo = mapper;
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
this.hooks.mapperchange.emit({
|
|
259
|
-
type,
|
|
260
|
-
mapper,
|
|
261
|
-
});
|
|
139
|
+
* <zh/> 获取当前图容器的大小
|
|
140
|
+
*
|
|
141
|
+
* <en/> Get the size of the current canvas container
|
|
142
|
+
* @param width - <zh/> 画布宽度 | <en/> canvas width
|
|
143
|
+
* @param height - <zh/> 画布高度 | <en/> canvas height
|
|
144
|
+
* @apiCategory canvas
|
|
145
|
+
*/
|
|
146
|
+
setSize(width, height) {
|
|
147
|
+
Object.assign(this.options, { width, height });
|
|
148
|
+
this.context.canvas?.resize(width, height);
|
|
262
149
|
}
|
|
263
150
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
* If there is old data, diffs and changes it.
|
|
273
|
-
* @param data
|
|
274
|
-
* @returns
|
|
275
|
-
* @group Data
|
|
276
|
-
*/
|
|
277
|
-
read(data) {
|
|
278
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
279
|
-
const { tileFirstRender, tileFirstRenderSize } = this.specification.optimize || {};
|
|
280
|
-
this.hooks.datachange.emit({ data, type: 'replace' });
|
|
281
|
-
const emitRender = () => __awaiter(this, void 0, void 0, function* () {
|
|
282
|
-
yield this.hooks.render.emitLinearAsync({
|
|
283
|
-
graphCore: this.dataController.graphCore,
|
|
284
|
-
theme: this.themeController.specification,
|
|
285
|
-
transientCanvas: this.transientCanvas,
|
|
286
|
-
tileOptimize: {
|
|
287
|
-
tileFirstRender,
|
|
288
|
-
tileFirstRenderSize,
|
|
289
|
-
},
|
|
290
|
-
});
|
|
291
|
-
this.emit('afterrender');
|
|
292
|
-
this.once('afterlayout', () => __awaiter(this, void 0, void 0, function* () {
|
|
293
|
-
const { autoFit } = this.specification;
|
|
294
|
-
if (autoFit) {
|
|
295
|
-
if (autoFit === 'view') {
|
|
296
|
-
yield this.fitView({ rules: { boundsType: 'layout' } });
|
|
297
|
-
}
|
|
298
|
-
else if (autoFit === 'center') {
|
|
299
|
-
yield this.fitCenter('layout');
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
const { type, effectTiming } = autoFit, others = __rest(autoFit, ["type", "effectTiming"]);
|
|
303
|
-
if (type === 'view') {
|
|
304
|
-
const { padding, rules } = others;
|
|
305
|
-
yield this.fitView({
|
|
306
|
-
padding,
|
|
307
|
-
rules: Object.assign(Object.assign({}, rules), { boundsType: 'layout' }),
|
|
308
|
-
}, effectTiming);
|
|
309
|
-
}
|
|
310
|
-
else if (type === 'center') {
|
|
311
|
-
yield this.fitCenter('layout', effectTiming);
|
|
312
|
-
}
|
|
313
|
-
else if (type === 'position') {
|
|
314
|
-
// TODO: align
|
|
315
|
-
yield this.translateTo(others.position, effectTiming);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}));
|
|
320
|
-
yield this.layout();
|
|
321
|
-
});
|
|
322
|
-
if (this.canvasReady) {
|
|
323
|
-
yield emitRender();
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
yield Promise.all([this.backgroundCanvas, this.canvas, this.transientCanvas].map((canvas) => canvas.ready));
|
|
327
|
-
yield emitRender();
|
|
328
|
-
}
|
|
329
|
-
});
|
|
151
|
+
* <zh/> 获取当前图的缩放区间
|
|
152
|
+
*
|
|
153
|
+
* <en/> Get the zoom range of the current graph
|
|
154
|
+
* @param zoomRange - <zh/> 缩放区间 | <en/> zoom range
|
|
155
|
+
* @apiCategory viewport
|
|
156
|
+
*/
|
|
157
|
+
setZoomRange(zoomRange) {
|
|
158
|
+
this.options.zoomRange = zoomRange;
|
|
330
159
|
}
|
|
331
160
|
/**
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
* @returns
|
|
336
|
-
* @
|
|
337
|
-
*/
|
|
338
|
-
|
|
339
|
-
return
|
|
340
|
-
const { tileFirstRender, tileFirstRenderSize } = this.specification.optimize || {};
|
|
341
|
-
this.hooks.datachange.emit({ data, type });
|
|
342
|
-
this.hooks.render.emit({
|
|
343
|
-
graphCore: this.dataController.graphCore,
|
|
344
|
-
theme: this.themeController.specification,
|
|
345
|
-
transientCanvas: this.transientCanvas,
|
|
346
|
-
tileOptimize: {
|
|
347
|
-
tileFirstRender,
|
|
348
|
-
tileFirstRenderSize,
|
|
349
|
-
},
|
|
350
|
-
});
|
|
351
|
-
this.emit('afterrender');
|
|
352
|
-
yield this.layout();
|
|
353
|
-
});
|
|
161
|
+
* <zh/> 获取当前图的缩放区间
|
|
162
|
+
*
|
|
163
|
+
* <en/> Get the zoom range of the current graph
|
|
164
|
+
* @returns <zh/> 缩放区间 | <en/> zoom range
|
|
165
|
+
* @apiCategory viewport
|
|
166
|
+
*/
|
|
167
|
+
getZoomRange() {
|
|
168
|
+
return this.options.zoomRange;
|
|
354
169
|
}
|
|
355
170
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
171
|
+
* <zh/> 设置节点样式映射
|
|
172
|
+
*
|
|
173
|
+
* <en/> Set node mapper
|
|
174
|
+
* @param node - <zh/> 节点配置 | <en/> node configuration
|
|
175
|
+
* @apiCategory element
|
|
358
176
|
*/
|
|
359
|
-
|
|
360
|
-
this.
|
|
361
|
-
this.
|
|
362
|
-
this.removeData('node', this.getAllNodesData().map((node) => node.id));
|
|
363
|
-
this.removeData('combo', this.getAllCombosData().map((combo) => combo.id));
|
|
364
|
-
this.stopHistoryBatch();
|
|
365
|
-
}
|
|
366
|
-
getViewportCenter() {
|
|
367
|
-
const { width, height } = this.canvas.getConfig();
|
|
368
|
-
return { x: width / 2, y: height / 2 };
|
|
369
|
-
}
|
|
370
|
-
transform(options, effectTiming) {
|
|
371
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
-
const { tileLodSize } = this.specification.optimize || {};
|
|
373
|
-
yield this.hooks.viewportchange.emitLinearAsync({
|
|
374
|
-
transform: options,
|
|
375
|
-
effectTiming,
|
|
376
|
-
tileLodSize,
|
|
377
|
-
});
|
|
378
|
-
this.emit('viewportchange', options);
|
|
379
|
-
});
|
|
177
|
+
setNode(node) {
|
|
178
|
+
this.options.node = node;
|
|
179
|
+
this.context.model.refreshData();
|
|
380
180
|
}
|
|
381
181
|
/**
|
|
382
|
-
*
|
|
182
|
+
* <zh/> 设置边样式映射
|
|
183
|
+
*
|
|
184
|
+
* <en/> Set edge mapper
|
|
185
|
+
* @param edge - <zh/> 边配置 | <en/> edge configuration
|
|
186
|
+
* @apiCategory element
|
|
383
187
|
*/
|
|
384
|
-
|
|
385
|
-
this.
|
|
188
|
+
setEdge(edge) {
|
|
189
|
+
this.options.edge = edge;
|
|
190
|
+
this.context.model.refreshData();
|
|
386
191
|
}
|
|
387
192
|
/**
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
* @param
|
|
193
|
+
* <zh/> 设置组合样式映射
|
|
194
|
+
*
|
|
195
|
+
* <en/> Set combo mapper
|
|
196
|
+
* @param combo - <zh/> 组合配置 | <en/> combo configuration
|
|
197
|
+
* @apiCategory element
|
|
392
198
|
*/
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
translate: distance,
|
|
397
|
-
}, effectTiming);
|
|
398
|
-
});
|
|
199
|
+
setCombo(combo) {
|
|
200
|
+
this.options.combo = combo;
|
|
201
|
+
this.context.model.refreshData();
|
|
399
202
|
}
|
|
400
203
|
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
204
|
+
* <zh/> 获取主题
|
|
205
|
+
*
|
|
206
|
+
* <en/> Get theme
|
|
207
|
+
* @returns <zh/> 主题配置 | <en/> theme configuration
|
|
208
|
+
* @apiCategory theme
|
|
404
209
|
*/
|
|
405
|
-
|
|
406
|
-
return
|
|
407
|
-
const { x: cx, y: cy } = this.getViewportCenter();
|
|
408
|
-
yield this.translate({ dx: cx - x, dy: cy - y }, effectTiming);
|
|
409
|
-
});
|
|
210
|
+
getTheme() {
|
|
211
|
+
return this.options.theme;
|
|
410
212
|
}
|
|
411
213
|
/**
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* @param
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}, effectTiming);
|
|
425
|
-
});
|
|
214
|
+
* <zh/> 设置主题
|
|
215
|
+
*
|
|
216
|
+
* <en/> Set theme
|
|
217
|
+
* @param theme - <zh/> 主题配置 | <en/> theme configuration
|
|
218
|
+
* @apiCategory theme
|
|
219
|
+
*/
|
|
220
|
+
setTheme(theme) {
|
|
221
|
+
this.options.theme = (0, util_1.isFunction)(theme) ? theme(this.getTheme()) : theme;
|
|
222
|
+
const { background } = (0, registry_1.getExtension)('theme', this.options.theme) || {};
|
|
223
|
+
if (background && !this.options.background) {
|
|
224
|
+
this.setBackground(background);
|
|
225
|
+
}
|
|
426
226
|
}
|
|
427
227
|
/**
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* @param
|
|
228
|
+
* <zh/> 设置布局
|
|
229
|
+
*
|
|
230
|
+
* <en/> Set layout
|
|
231
|
+
* @param layout - <zh/> 布局配置 | <en/> layout configuration
|
|
232
|
+
* @apiCategory layout
|
|
432
233
|
*/
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
yield this.zoom(zoom / this.canvas.getCamera().getZoom(), origin, effectTiming);
|
|
436
|
-
});
|
|
234
|
+
setLayout(layout) {
|
|
235
|
+
this.options.layout = (0, util_1.isFunction)(layout) ? layout(this.getLayout()) : layout;
|
|
437
236
|
}
|
|
438
237
|
/**
|
|
439
|
-
*
|
|
440
|
-
*
|
|
238
|
+
* <zh/> 获取布局
|
|
239
|
+
*
|
|
240
|
+
* <en/> Get layout
|
|
241
|
+
* @returns <zh/> 布局配置 | <en/> layout configuration
|
|
242
|
+
* @apiCategory layout
|
|
441
243
|
*/
|
|
442
|
-
|
|
443
|
-
return this.
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Rotate the graph with a relative angle.
|
|
447
|
-
* @param angle
|
|
448
|
-
* @param origin
|
|
449
|
-
* @param effectTiming
|
|
450
|
-
*/
|
|
451
|
-
rotate(angle, origin, effectTiming) {
|
|
452
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
453
|
-
yield this.transform({
|
|
454
|
-
rotate: {
|
|
455
|
-
angle,
|
|
456
|
-
},
|
|
457
|
-
origin,
|
|
458
|
-
}, effectTiming);
|
|
459
|
-
});
|
|
244
|
+
getLayout() {
|
|
245
|
+
return this.options.layout;
|
|
460
246
|
}
|
|
461
247
|
/**
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* @param
|
|
248
|
+
* <zh/> 设置交互
|
|
249
|
+
*
|
|
250
|
+
* <en/> Set behaviors
|
|
251
|
+
* @param behaviors - <zh/> 交互配置 | <en/> behavior configuration
|
|
252
|
+
* @apiCategory behavior
|
|
466
253
|
*/
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
});
|
|
254
|
+
setBehaviors(behaviors) {
|
|
255
|
+
this.options.behaviors = (0, util_1.isFunction)(behaviors) ? behaviors(this.getBehaviors()) : behaviors;
|
|
256
|
+
this.context.behavior?.setBehaviors(this.options.behaviors);
|
|
471
257
|
}
|
|
472
258
|
/**
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
* @param
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
: [0, 0, 0, 0];
|
|
484
|
-
const { direction = 'both', ratioRule = 'min', boundsType = 'render', } = rules || {};
|
|
485
|
-
const { center: [graphCenterX, graphCenterY], halfExtents, } = boundsType === 'render'
|
|
486
|
-
? // Get the bounds of the whole graph content.
|
|
487
|
-
this.canvas.document.documentElement.getBounds()
|
|
488
|
-
: // Get the bounds of the nodes positions while the graph content is not ready.
|
|
489
|
-
(0, layout_1.getLayoutBounds)(this);
|
|
490
|
-
const origin = this.canvas.canvas2Viewport({
|
|
491
|
-
x: graphCenterX,
|
|
492
|
-
y: graphCenterY,
|
|
493
|
-
});
|
|
494
|
-
const { width: viewportWidth, height: viewportHeight } = this.canvas.getConfig();
|
|
495
|
-
const graphWidth = halfExtents[0] * 2;
|
|
496
|
-
const graphHeight = halfExtents[1] * 2;
|
|
497
|
-
const tlInCanvas = this.canvas.viewport2Canvas({ x: left, y: top });
|
|
498
|
-
const brInCanvas = this.canvas.viewport2Canvas({
|
|
499
|
-
x: viewportWidth - right,
|
|
500
|
-
y: viewportHeight - bottom,
|
|
501
|
-
});
|
|
502
|
-
const targetViewWidth = brInCanvas.x - tlInCanvas.x;
|
|
503
|
-
const targetViewHeight = brInCanvas.y - tlInCanvas.y;
|
|
504
|
-
const wRatio = targetViewWidth / graphWidth;
|
|
505
|
-
const hRatio = targetViewHeight / graphHeight;
|
|
506
|
-
let ratio;
|
|
507
|
-
if (direction === 'x') {
|
|
508
|
-
ratio = wRatio;
|
|
509
|
-
}
|
|
510
|
-
else if (direction === 'y') {
|
|
511
|
-
ratio = hRatio;
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
ratio =
|
|
515
|
-
ratioRule === 'max'
|
|
516
|
-
? Math.max(wRatio, hRatio)
|
|
517
|
-
: Math.min(wRatio, hRatio);
|
|
259
|
+
* <zh/> 更新交互
|
|
260
|
+
*
|
|
261
|
+
* <en/> Update behavior
|
|
262
|
+
* @param behavior - <zh/> 交互配置 | <en/> behavior configuration
|
|
263
|
+
* @apiCategory behavior
|
|
264
|
+
*/
|
|
265
|
+
updateBehavior(behavior) {
|
|
266
|
+
this.setBehaviors((behaviors) => behaviors.map((_behavior) => {
|
|
267
|
+
if ((0, util_1.isObject)(_behavior) && _behavior.key === behavior.key) {
|
|
268
|
+
return { ..._behavior, ...behavior };
|
|
518
269
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
dx: viewportWidth / 2 - origin.x,
|
|
522
|
-
dy: viewportHeight / 2 - origin.y,
|
|
523
|
-
},
|
|
524
|
-
zoom: {
|
|
525
|
-
ratio,
|
|
526
|
-
},
|
|
527
|
-
}, effectTiming);
|
|
528
|
-
});
|
|
270
|
+
return _behavior;
|
|
271
|
+
}));
|
|
529
272
|
}
|
|
530
273
|
/**
|
|
531
|
-
*
|
|
532
|
-
*
|
|
274
|
+
* <zh/> 获取交互
|
|
275
|
+
*
|
|
276
|
+
* <en/> Get behaviors
|
|
277
|
+
* @returns <zh/> 交互配置 | <en/> behavior configuration
|
|
278
|
+
* @apiCategory behavior
|
|
533
279
|
*/
|
|
534
|
-
|
|
535
|
-
return
|
|
536
|
-
const { center: [graphCenterX, graphCenterY], } = boundsType === 'render'
|
|
537
|
-
? // Get the bounds of the whole graph content.
|
|
538
|
-
this.canvas.document.documentElement.getBounds()
|
|
539
|
-
: // Get the bounds of the nodes positions while the graph content is not ready.
|
|
540
|
-
(0, layout_1.getLayoutBounds)(this);
|
|
541
|
-
yield this.translateTo(this.canvas.canvas2Viewport({ x: graphCenterX, y: graphCenterY }), effectTiming);
|
|
542
|
-
});
|
|
280
|
+
getBehaviors() {
|
|
281
|
+
return this.options.behaviors || [];
|
|
543
282
|
}
|
|
544
283
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
if (item) {
|
|
555
|
-
const itemBounds = item.group.getBounds();
|
|
556
|
-
if (!bounds) {
|
|
557
|
-
bounds = itemBounds;
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
bounds.add(itemBounds);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
if (bounds) {
|
|
565
|
-
const { center: [itemCenterX, itemCenterY], } = bounds;
|
|
566
|
-
yield this.translateTo(this.canvas.canvas2Viewport({ x: itemCenterX, y: itemCenterY }), effectTiming);
|
|
567
|
-
}
|
|
568
|
-
});
|
|
284
|
+
* <zh/> 设置插件
|
|
285
|
+
*
|
|
286
|
+
* <en/> Set plugins
|
|
287
|
+
* @param plugins - <zh/> 插件配置 | <en/> plugin configuration
|
|
288
|
+
* @apiCategory plugin
|
|
289
|
+
*/
|
|
290
|
+
setPlugins(plugins) {
|
|
291
|
+
this.options.plugins = (0, util_1.isFunction)(plugins) ? plugins(this.getPlugins()) : plugins;
|
|
292
|
+
this.context.plugin?.setPlugins(this.options.plugins);
|
|
569
293
|
}
|
|
570
294
|
/**
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
295
|
+
* <zh/> 更新插件
|
|
296
|
+
*
|
|
297
|
+
* <en/> Update plugin
|
|
298
|
+
* @param plugin - <zh/> 插件配置 | <en/> plugin configuration
|
|
299
|
+
* @apiCategory plugin
|
|
574
300
|
*/
|
|
575
|
-
|
|
576
|
-
|
|
301
|
+
updatePlugin(plugin) {
|
|
302
|
+
this.setPlugins((plugins) => plugins.map((_plugin) => {
|
|
303
|
+
if ((0, util_1.isObject)(_plugin) && _plugin.key === plugin.key) {
|
|
304
|
+
return { ..._plugin, ...plugin };
|
|
305
|
+
}
|
|
306
|
+
return _plugin;
|
|
307
|
+
}));
|
|
577
308
|
}
|
|
578
309
|
/**
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
310
|
+
* <zh/> 获取插件
|
|
311
|
+
*
|
|
312
|
+
* <en/> Get plugins
|
|
313
|
+
* @returns <zh/> 插件配置 | <en/> plugin configuration
|
|
314
|
+
* @apiCategory plugin
|
|
582
315
|
*/
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
return [width, height];
|
|
316
|
+
getPlugins() {
|
|
317
|
+
return this.options.plugins || [];
|
|
586
318
|
}
|
|
587
319
|
/**
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
320
|
+
* <zh/> 获取插件实例
|
|
321
|
+
*
|
|
322
|
+
* <en/> Get plugin instance
|
|
323
|
+
* @param key - <zh/> 插件 key | <en/> plugin key
|
|
324
|
+
* @returns <zh/> 插件实例 | <en/> plugin instance
|
|
325
|
+
* @apiCategory plugin
|
|
591
326
|
*/
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
console.warn(`Failed to setSize. The parameter size: ${size} is invalid. It must be an array with 2 number elements.`);
|
|
595
|
-
return;
|
|
596
|
-
}
|
|
597
|
-
this.specification.width = size[0];
|
|
598
|
-
this.specification.height = size[1];
|
|
599
|
-
this.canvas.resize(size[0], size[1]);
|
|
600
|
-
}
|
|
601
|
-
getCanvasRange() {
|
|
602
|
-
const [width, height] = this.getSize();
|
|
603
|
-
const leftTop = this.getCanvasByViewport({ x: 0, y: 0 });
|
|
604
|
-
const rightBottom = this.getCanvasByViewport({ x: width, y: height });
|
|
605
|
-
return {
|
|
606
|
-
min: [leftTop.x, leftTop.y, leftTop.z],
|
|
607
|
-
max: [rightBottom.x, rightBottom.y, rightBottom.z],
|
|
608
|
-
center: [
|
|
609
|
-
(leftTop.x + rightBottom.x) / 2,
|
|
610
|
-
(leftTop.y + rightBottom.y) / 2,
|
|
611
|
-
(leftTop.z + rightBottom.z) / 2,
|
|
612
|
-
],
|
|
613
|
-
halfExtents: [
|
|
614
|
-
(rightBottom.x - leftTop.x) / 2,
|
|
615
|
-
(rightBottom.y - leftTop.y) / 2,
|
|
616
|
-
(rightBottom.z - leftTop.z) / 2,
|
|
617
|
-
],
|
|
618
|
-
};
|
|
327
|
+
getPluginInstance(key) {
|
|
328
|
+
return this.context.plugin.getPluginInstance(key);
|
|
619
329
|
}
|
|
620
330
|
/**
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
*
|
|
624
|
-
* @
|
|
331
|
+
* <zh/> 设置数据转换器
|
|
332
|
+
*
|
|
333
|
+
* <en/> Set data transforms
|
|
334
|
+
* @param transforms - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
335
|
+
* @apiCategory transform
|
|
625
336
|
*/
|
|
626
|
-
|
|
627
|
-
|
|
337
|
+
setTransforms(transforms) {
|
|
338
|
+
this.options.transforms = (0, util_1.isFunction)(transforms) ? transforms(this.getTransforms()) : transforms;
|
|
339
|
+
this.context.transform?.setTransforms(this.options.transforms);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* <zh/> 更新数据转换器
|
|
343
|
+
*
|
|
344
|
+
* <en/> Update data transform
|
|
345
|
+
* @param transform - <zh/> 数据转换配置 | <en/> data transform configuration
|
|
346
|
+
* @apiCategory transform
|
|
347
|
+
*/
|
|
348
|
+
updateTransform(transform) {
|
|
349
|
+
this.setTransforms((transforms) => transforms.map((_transform) => {
|
|
350
|
+
if ((0, util_1.isObject)(_transform) && _transform.key === transform.key) {
|
|
351
|
+
return { ..._transform, ...transform };
|
|
352
|
+
}
|
|
353
|
+
return _transform;
|
|
354
|
+
}));
|
|
355
|
+
this.context.model.refreshData();
|
|
628
356
|
}
|
|
629
357
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
* @
|
|
358
|
+
* <zh/> 获取数据转换器
|
|
359
|
+
*
|
|
360
|
+
* <en/> Get data transforms
|
|
361
|
+
* @returns <zh/> 数据转换器实例 | <en/> data transform instance
|
|
362
|
+
* @apiCategory transform
|
|
634
363
|
*/
|
|
635
|
-
|
|
636
|
-
return this.
|
|
364
|
+
getTransforms() {
|
|
365
|
+
return this.options.transforms || [];
|
|
637
366
|
}
|
|
638
367
|
/**
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
642
|
-
* @
|
|
368
|
+
* <zh/> 获取数据
|
|
369
|
+
*
|
|
370
|
+
* <en/> Get data
|
|
371
|
+
* @returns <zh/> 数据 | <en/> data
|
|
372
|
+
* @apiCategory data
|
|
373
|
+
*/
|
|
374
|
+
getData() {
|
|
375
|
+
return this.context.model.getData();
|
|
376
|
+
}
|
|
377
|
+
getElementData(ids) {
|
|
378
|
+
if (Array.isArray(ids))
|
|
379
|
+
return ids.map((id) => this.context.model.getElementDataById(id));
|
|
380
|
+
return this.context.model.getElementDataById(ids);
|
|
381
|
+
}
|
|
382
|
+
getNodeData(id) {
|
|
383
|
+
if (id === undefined)
|
|
384
|
+
return this.context.model.getNodeData();
|
|
385
|
+
if (Array.isArray(id))
|
|
386
|
+
return this.context.model.getNodeData(id);
|
|
387
|
+
return this.context.model.getNodeData([id])?.[0];
|
|
388
|
+
}
|
|
389
|
+
getEdgeData(id) {
|
|
390
|
+
if (id === undefined)
|
|
391
|
+
return this.context.model.getEdgeData();
|
|
392
|
+
if (Array.isArray(id))
|
|
393
|
+
return this.context.model.getEdgeData(id);
|
|
394
|
+
return this.context.model.getEdgeData([id])?.[0];
|
|
395
|
+
}
|
|
396
|
+
getComboData(id) {
|
|
397
|
+
if (id === undefined)
|
|
398
|
+
return this.context.model.getComboData();
|
|
399
|
+
if (Array.isArray(id))
|
|
400
|
+
return this.context.model.getComboData(id);
|
|
401
|
+
return this.context.model.getComboData([id])?.[0];
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* <zh/> 设置全量数据
|
|
405
|
+
*
|
|
406
|
+
* <en/> Set full data
|
|
407
|
+
* @param data - <zh/> 数据 | <en/> data
|
|
408
|
+
* @apiCategory data
|
|
643
409
|
*/
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
return this.canvas.viewport2Client(viewportPoint);
|
|
410
|
+
setData(data) {
|
|
411
|
+
this.context.model.setData((0, util_1.isFunction)(data) ? data(this.getData()) : data);
|
|
647
412
|
}
|
|
648
413
|
/**
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
* @
|
|
414
|
+
* <zh/> 新增元素数据
|
|
415
|
+
*
|
|
416
|
+
* <en/> Add element data
|
|
417
|
+
* @param data - <zh/> 元素数据 | <en/> element data
|
|
418
|
+
* @apiCategory data
|
|
653
419
|
*/
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
return this.canvas.viewport2Canvas(viewportPoint);
|
|
420
|
+
addData(data) {
|
|
421
|
+
this.context.model.addData((0, util_1.isFunction)(data) ? data(this.getData()) : data);
|
|
657
422
|
}
|
|
658
|
-
// ===== item operations =====
|
|
659
423
|
/**
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
* @
|
|
424
|
+
* <zh/> 新增节点数据
|
|
425
|
+
*
|
|
426
|
+
* <en/> Add node data
|
|
427
|
+
* @param data - <zh/> 节点数据 | <en/> node data
|
|
428
|
+
* @apiCategory data
|
|
664
429
|
*/
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
const conds = (0, util_1.isString)(condition) || (0, util_1.isNumber)(condition) ? [condition] : condition;
|
|
668
|
-
return (_a = this.dataController.findData('node', conds)) === null || _a === void 0 ? void 0 : _a[0];
|
|
430
|
+
addNodeData(data) {
|
|
431
|
+
this.context.model.addNodeData((0, util_1.isFunction)(data) ? data(this.getNodeData()) : data);
|
|
669
432
|
}
|
|
670
433
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* @
|
|
434
|
+
* <zh/> 新增边数据
|
|
435
|
+
*
|
|
436
|
+
* <en/> Add edge data
|
|
437
|
+
* @param data - <zh/> 边数据 | <en/> edge data
|
|
438
|
+
* @apiCategory data
|
|
675
439
|
*/
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
const conds = (0, util_1.isString)(condition) || (0, util_1.isNumber)(condition) || (0, util_1.isNumber)(condition)
|
|
679
|
-
? [condition]
|
|
680
|
-
: condition;
|
|
681
|
-
return (_a = this.dataController.findData('edge', conds)) === null || _a === void 0 ? void 0 : _a[0];
|
|
440
|
+
addEdgeData(data) {
|
|
441
|
+
this.context.model.addEdgeData((0, util_1.isFunction)(data) ? data(this.getEdgeData()) : data);
|
|
682
442
|
}
|
|
683
443
|
/**
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
* @
|
|
444
|
+
* <zh/> 新增组合数据
|
|
445
|
+
*
|
|
446
|
+
* <en/> Add combo data
|
|
447
|
+
* @param data - <zh/> 组合数据 | <en/> combo data
|
|
448
|
+
* @apiCategory data
|
|
688
449
|
*/
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
const conds = (0, util_1.isString)(condition) || (0, util_1.isNumber)(condition) ? [condition] : condition;
|
|
692
|
-
return (_a = this.dataController.findData('combo', conds)) === null || _a === void 0 ? void 0 : _a[0];
|
|
450
|
+
addComboData(data) {
|
|
451
|
+
this.context.model.addComboData((0, util_1.isFunction)(data) ? data(this.getComboData()) : data);
|
|
693
452
|
}
|
|
694
453
|
/**
|
|
695
|
-
*
|
|
696
|
-
*
|
|
697
|
-
*
|
|
454
|
+
* <zh/> 更新元素数据
|
|
455
|
+
*
|
|
456
|
+
* <en/> Update element data
|
|
457
|
+
* @param data - <zh/> 元素数据 | <en/> element data
|
|
458
|
+
* @apiCategory data
|
|
698
459
|
*/
|
|
699
|
-
|
|
700
|
-
|
|
460
|
+
updateData(data) {
|
|
461
|
+
this.context.model.updateData((0, util_1.isFunction)(data) ? data(this.getData()) : data);
|
|
701
462
|
}
|
|
702
463
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
464
|
+
* <zh/> 更新节点数据
|
|
465
|
+
*
|
|
466
|
+
* <en/> Update node data
|
|
467
|
+
* @param data - <zh/> 节点数据 | <en/> node data
|
|
468
|
+
* @apiCategory data
|
|
706
469
|
*/
|
|
707
|
-
|
|
708
|
-
|
|
470
|
+
updateNodeData(data) {
|
|
471
|
+
this.context.model.updateNodeData((0, util_1.isFunction)(data) ? data(this.getNodeData()) : data);
|
|
709
472
|
}
|
|
710
473
|
/**
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
474
|
+
* <zh/> 更新边数据
|
|
475
|
+
*
|
|
476
|
+
* <en/> Update edge data
|
|
477
|
+
* @param data - <zh/> 边数据 | <en/> edge data
|
|
478
|
+
* @apiCategory data
|
|
714
479
|
*/
|
|
715
|
-
|
|
716
|
-
|
|
480
|
+
updateEdgeData(data) {
|
|
481
|
+
this.context.model.updateEdgeData((0, util_1.isFunction)(data) ? data(this.getEdgeData()) : data);
|
|
717
482
|
}
|
|
718
483
|
/**
|
|
719
|
-
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
722
|
-
* @
|
|
484
|
+
* <zh/> 更新组合数据
|
|
485
|
+
*
|
|
486
|
+
* <en/> Update combo data
|
|
487
|
+
* @param data - <zh/> 组合数据 | <en/> combo data
|
|
488
|
+
* @apiCategory data
|
|
723
489
|
*/
|
|
724
|
-
|
|
725
|
-
|
|
490
|
+
updateComboData(data) {
|
|
491
|
+
this.context.model.updateComboData((0, util_1.isFunction)(data) ? data(this.getComboData()) : data);
|
|
726
492
|
}
|
|
727
493
|
/**
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
* @
|
|
494
|
+
* <zh/> 删除多条元素数据
|
|
495
|
+
*
|
|
496
|
+
* <en/> Remove multiple element data
|
|
497
|
+
* @param ids - <zh/> 元素 ID 数组 | <en/> element ID array
|
|
498
|
+
* @apiCategory data
|
|
732
499
|
*/
|
|
733
|
-
|
|
734
|
-
|
|
500
|
+
removeData(ids) {
|
|
501
|
+
this.context.model.removeData((0, util_1.isFunction)(ids) ? ids(this.getData()) : ids);
|
|
735
502
|
}
|
|
736
503
|
/**
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
* @
|
|
504
|
+
* <zh/> 删除多条节点数据
|
|
505
|
+
*
|
|
506
|
+
* <en/> Remove multiple node data
|
|
507
|
+
* @param ids - <zh/> 节点 ID 数组 | <en/> node ID array
|
|
508
|
+
* @apiCategory data
|
|
741
509
|
*/
|
|
742
|
-
|
|
743
|
-
|
|
510
|
+
removeNodeData(ids) {
|
|
511
|
+
this.context.model.removeNodeData((0, util_1.isFunction)(ids) ? ids(this.getNodeData()) : ids);
|
|
744
512
|
}
|
|
745
|
-
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
* @
|
|
513
|
+
/**
|
|
514
|
+
* <zh/> 删除多条边数据
|
|
515
|
+
*
|
|
516
|
+
* <en/> Remove multiple edge data
|
|
517
|
+
* @param ids - <zh/> 边 ID 数组 | <en/> edge ID array
|
|
518
|
+
* @apiCategory data
|
|
750
519
|
*/
|
|
751
|
-
|
|
752
|
-
|
|
520
|
+
removeEdgeData(ids) {
|
|
521
|
+
this.context.model.removeEdgeData((0, util_1.isFunction)(ids) ? ids(this.getEdgeData()) : ids);
|
|
753
522
|
}
|
|
754
523
|
/**
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
524
|
+
* <zh/> 删除多条组合数据
|
|
525
|
+
*
|
|
526
|
+
* <en/> Remove multiple combo data
|
|
527
|
+
* @param ids - <zh/> 组合 ID 数组 | <en/> 组合 ID array
|
|
528
|
+
* @apiCategory data
|
|
758
529
|
*/
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
return this.itemController.findNearEdgesByNode(nodeId, graphCore);
|
|
530
|
+
removeComboData(ids) {
|
|
531
|
+
this.context.model.removeComboData((0, util_1.isFunction)(ids) ? ids(this.getComboData()) : ids);
|
|
762
532
|
}
|
|
763
533
|
/**
|
|
764
|
-
*
|
|
765
|
-
*
|
|
766
|
-
*
|
|
767
|
-
* @param
|
|
768
|
-
* @returns
|
|
769
|
-
* @
|
|
534
|
+
* <zh/> 获取元素类型
|
|
535
|
+
*
|
|
536
|
+
* <en/> Get element type
|
|
537
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
538
|
+
* @returns <zh/> 元素类型 | <en/> element type
|
|
539
|
+
* @apiCategory element
|
|
770
540
|
*/
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
if (additionalFilter) {
|
|
774
|
-
let getDataFunc = this.getEdgeData;
|
|
775
|
-
if (itemType === 'node')
|
|
776
|
-
getDataFunc = this.getNodeData;
|
|
777
|
-
else if (itemType === 'combo')
|
|
778
|
-
getDataFunc = this.getComboData;
|
|
779
|
-
ids = ids.filter((id) => additionalFilter(getDataFunc(id)));
|
|
780
|
-
}
|
|
781
|
-
return ids;
|
|
782
|
-
}
|
|
783
|
-
/**
|
|
784
|
-
* Add one or more node/edge/combo data to the graph.
|
|
785
|
-
* @param itemType item type
|
|
786
|
-
* @param model user data
|
|
787
|
-
* @returns whether success
|
|
788
|
-
* @group Data
|
|
789
|
-
*/
|
|
790
|
-
addData(itemType, models) {
|
|
791
|
-
// data controller and item controller subscribe additem in order
|
|
792
|
-
const { graphCore } = this.dataController;
|
|
793
|
-
const { specification } = this.themeController;
|
|
794
|
-
graphCore.once('changed', (event) => {
|
|
795
|
-
if (!event.changes.length)
|
|
796
|
-
return;
|
|
797
|
-
const changes = event.changes;
|
|
798
|
-
const timingParameters = {
|
|
799
|
-
type: itemType,
|
|
800
|
-
action: 'add',
|
|
801
|
-
models,
|
|
802
|
-
apiName: 'addData',
|
|
803
|
-
changes,
|
|
804
|
-
};
|
|
805
|
-
this.emit('beforeitemchange', timingParameters);
|
|
806
|
-
this.hooks.itemchange.emit({
|
|
807
|
-
type: itemType,
|
|
808
|
-
changes: graphCore.reduceChanges(event.changes),
|
|
809
|
-
graphCore,
|
|
810
|
-
theme: specification,
|
|
811
|
-
});
|
|
812
|
-
this.emit('afteritemchange', timingParameters);
|
|
813
|
-
});
|
|
814
|
-
const modelArr = (0, util_1.isArray)(models) ? models : [models];
|
|
815
|
-
const data = { nodes: [], edges: [], combos: [] };
|
|
816
|
-
data[`${itemType}s`] = modelArr;
|
|
817
|
-
this.hooks.datachange.emit({
|
|
818
|
-
data,
|
|
819
|
-
type: 'union',
|
|
820
|
-
});
|
|
821
|
-
const dataList = this.dataController.findData(itemType, modelArr.map((model) => model.id));
|
|
822
|
-
return (0, util_1.isArray)(models) ? dataList : dataList[0];
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Remove one or more node/edge/combo data from the graph.
|
|
826
|
-
* @param item the item to be removed
|
|
827
|
-
* @returns whether success
|
|
828
|
-
* @group Data
|
|
829
|
-
*/
|
|
830
|
-
removeData(itemType, ids) {
|
|
831
|
-
const idArr = (0, util_1.isArray)(ids) ? ids : [ids];
|
|
832
|
-
const data = { nodes: [], edges: [], combos: [] };
|
|
833
|
-
const { graphCore } = this.dataController;
|
|
834
|
-
const { specification } = this.themeController;
|
|
835
|
-
const getItem = itemType === 'edge' ? graphCore.getEdge : graphCore.getNode;
|
|
836
|
-
const hasItem = itemType === 'edge' ? graphCore.hasEdge : graphCore.hasNode;
|
|
837
|
-
data[`${itemType}s`] = idArr
|
|
838
|
-
.map((id) => {
|
|
839
|
-
if (!hasItem.bind(graphCore)(id)) {
|
|
840
|
-
console.warn(`The ${itemType} data with id ${id} does not exist. It will be ignored`);
|
|
841
|
-
return;
|
|
842
|
-
}
|
|
843
|
-
return getItem.bind(graphCore)(id);
|
|
844
|
-
})
|
|
845
|
-
.filter(Boolean);
|
|
846
|
-
graphCore.once('changed', (event) => {
|
|
847
|
-
if (!event.changes.length)
|
|
848
|
-
return;
|
|
849
|
-
const changes = event.changes;
|
|
850
|
-
const timingParameters = {
|
|
851
|
-
type: itemType,
|
|
852
|
-
action: 'remove',
|
|
853
|
-
ids: idArr,
|
|
854
|
-
apiName: 'removeData',
|
|
855
|
-
changes,
|
|
856
|
-
};
|
|
857
|
-
this.emit('beforeitemchange', timingParameters);
|
|
858
|
-
this.hooks.itemchange.emit({
|
|
859
|
-
type: itemType,
|
|
860
|
-
changes: event.changes,
|
|
861
|
-
graphCore,
|
|
862
|
-
theme: specification,
|
|
863
|
-
});
|
|
864
|
-
this.emit('afteritemchange', timingParameters);
|
|
865
|
-
});
|
|
866
|
-
this.hooks.datachange.emit({
|
|
867
|
-
data,
|
|
868
|
-
type: 'remove',
|
|
869
|
-
});
|
|
541
|
+
getElementType(id) {
|
|
542
|
+
return this.context.model.getElementType(id);
|
|
870
543
|
}
|
|
871
544
|
/**
|
|
872
|
-
*
|
|
873
|
-
*
|
|
874
|
-
*
|
|
875
|
-
* @param
|
|
876
|
-
* @
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
if (!oldValue || !newValue)
|
|
883
|
-
return change;
|
|
884
|
-
if (propertyName) {
|
|
885
|
-
if (oldValue !== newValue)
|
|
886
|
-
return change;
|
|
887
|
-
return false;
|
|
888
|
-
}
|
|
889
|
-
const displayData = this.getItemById(id).displayModel.data;
|
|
890
|
-
const oldFields = Object.keys(oldValue);
|
|
891
|
-
const newFields = Object.keys(newValue);
|
|
892
|
-
const commonFields = [...new Set([...oldFields, ...newFields])];
|
|
893
|
-
commonFields.forEach((field) => {
|
|
894
|
-
if (!Object.prototype.hasOwnProperty.call(oldValue, field)) {
|
|
895
|
-
oldValue[field] = displayData[field];
|
|
896
|
-
}
|
|
897
|
-
if (!Object.prototype.hasOwnProperty.call(newValue, field)) {
|
|
898
|
-
newValue[field] = displayData[field];
|
|
899
|
-
}
|
|
900
|
-
});
|
|
901
|
-
if ((oldValue.x === undefined || Number.isNaN(oldValue.x)) &&
|
|
902
|
-
!oldValue._isCombo)
|
|
903
|
-
oldValue.x = 0;
|
|
904
|
-
if ((oldValue.y === undefined || Number.isNaN(oldValue.x)) &&
|
|
905
|
-
!oldValue._isCombo)
|
|
906
|
-
oldValue.y = 0;
|
|
907
|
-
if (Number.isNaN(newValue.x))
|
|
908
|
-
delete newValue.x;
|
|
909
|
-
if (Number.isNaN(newValue.y))
|
|
910
|
-
delete newValue.y;
|
|
911
|
-
if ((0, util_1.isEqual)(newValue, oldValue))
|
|
912
|
-
return false;
|
|
913
|
-
return Object.assign(Object.assign({}, change), { newValue,
|
|
914
|
-
oldValue });
|
|
915
|
-
})
|
|
916
|
-
.filter(Boolean);
|
|
917
|
-
}
|
|
918
|
-
/**
|
|
919
|
-
* Update one or more node/edge/combo data on the graph.
|
|
920
|
-
* @param {ITEM_TYPE} itemType 'node' | 'edge' | 'combo'
|
|
921
|
-
* @param models new configurations for every node/edge/combo, which has id field to indicate the specific item
|
|
922
|
-
* @group Data
|
|
923
|
-
*/
|
|
924
|
-
updateData(itemType, models) {
|
|
925
|
-
const modelArr = (0, util_1.isArray)(models) ? models : [models];
|
|
926
|
-
const data = { nodes: [], edges: [], combos: [] };
|
|
927
|
-
data[`${itemType}s`] = modelArr;
|
|
928
|
-
const { graphCore } = this.dataController;
|
|
929
|
-
const { specification } = this.themeController;
|
|
930
|
-
graphCore.once('changed', (event) => {
|
|
931
|
-
const changes = this.extendChanges((0, util_1.clone)(event.changes));
|
|
932
|
-
const timingParameters = {
|
|
933
|
-
type: itemType,
|
|
934
|
-
action: 'update',
|
|
935
|
-
models,
|
|
936
|
-
apiName: 'updateData',
|
|
937
|
-
changes,
|
|
938
|
-
};
|
|
939
|
-
this.emit('beforeitemchange', timingParameters);
|
|
940
|
-
this.hooks.itemchange.emit({
|
|
941
|
-
type: itemType,
|
|
942
|
-
changes: event.changes,
|
|
943
|
-
graphCore,
|
|
944
|
-
theme: specification,
|
|
945
|
-
});
|
|
946
|
-
this.emit('afteritemchange', timingParameters);
|
|
947
|
-
});
|
|
948
|
-
this.hooks.datachange.emit({
|
|
949
|
-
data,
|
|
950
|
-
type: 'update',
|
|
951
|
-
});
|
|
952
|
-
const dataList = this.dataController.findData(itemType, modelArr.map((model) => model.id));
|
|
953
|
-
return (0, util_1.isArray)(models) ? dataList : dataList[0];
|
|
545
|
+
* <zh/> 获取节点或组合关联边的数据
|
|
546
|
+
*
|
|
547
|
+
* <en/> Get edge data related to the node or combo
|
|
548
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
549
|
+
* @param direction - <zh/> 边的方向 | <en/> edge direction
|
|
550
|
+
* @returns <zh/> 边数据 | <en/> edge data
|
|
551
|
+
* @apiCategory data
|
|
552
|
+
*/
|
|
553
|
+
getRelatedEdgesData(id, direction = 'both') {
|
|
554
|
+
return this.context.model.getRelatedEdgesData(id, direction);
|
|
954
555
|
}
|
|
955
556
|
/**
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
* @
|
|
557
|
+
* <zh/> 获取节点或组合的一跳邻居节点数据
|
|
558
|
+
*
|
|
559
|
+
* <en/> Get the one-hop neighbor node data of the node or combo
|
|
560
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
561
|
+
* @returns <zh/> 邻居节点数据 | <en/> neighbor node data
|
|
562
|
+
* @apiCategory data
|
|
960
563
|
*/
|
|
961
|
-
|
|
962
|
-
return this.
|
|
564
|
+
getNeighborNodesData(id) {
|
|
565
|
+
return this.context.model.getNeighborNodesData(id);
|
|
963
566
|
}
|
|
964
567
|
/**
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
* @param
|
|
969
|
-
* @
|
|
568
|
+
* <zh/> 获取节点或组合的祖先元素数据
|
|
569
|
+
*
|
|
570
|
+
* <en/> Get the ancestor element data of the node or combo
|
|
571
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
572
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
573
|
+
* @returns <zh/> 祖先元素数据 | <en/> ancestor element data
|
|
574
|
+
* @remarks
|
|
575
|
+
* <zh/> 数组中的顺序是从父节点到祖先节点
|
|
576
|
+
*
|
|
577
|
+
* <en/> The order in the array is from the parent node to the ancestor node
|
|
578
|
+
* @apiCategory data
|
|
970
579
|
*/
|
|
971
|
-
|
|
972
|
-
return this.
|
|
580
|
+
getAncestorsData(id, hierarchy) {
|
|
581
|
+
return this.context.model.getAncestorsData(id, hierarchy);
|
|
973
582
|
}
|
|
974
583
|
/**
|
|
975
|
-
*
|
|
584
|
+
* <zh/> 获取节点或组合的父元素数据
|
|
585
|
+
*
|
|
586
|
+
* <en/> Get the parent element data of the node or combo
|
|
587
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
588
|
+
* @param hierarchy - <zh/> 指定树图层级关系还是组合层级关系 | <en/> specify tree or combo hierarchy relationship
|
|
589
|
+
* @returns <zh/> 父元素数据 | <en/> parent element data
|
|
590
|
+
* @apiCategory data
|
|
976
591
|
*/
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
592
|
+
getParentData(id, hierarchy) {
|
|
593
|
+
return this.context.model.getParentData(id, hierarchy);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* <zh/> 获取节点或组合的子元素数据
|
|
597
|
+
*
|
|
598
|
+
* <en/> Get the child element data of the node or combo
|
|
599
|
+
* @param id - <zh/> 节点或组合ID | <en/> node or combo ID
|
|
600
|
+
* @returns <zh/> 子元素数据 | <en/> child element data
|
|
601
|
+
* @apiCategory data
|
|
602
|
+
*/
|
|
603
|
+
getChildrenData(id) {
|
|
604
|
+
return this.context.model.getChildrenData(id);
|
|
605
|
+
}
|
|
606
|
+
getElementDataByState(elementType, state) {
|
|
607
|
+
return this.context.model.getElementDataByState(elementType, state);
|
|
608
|
+
}
|
|
609
|
+
async initCanvas() {
|
|
610
|
+
if (this.context.canvas)
|
|
611
|
+
return await this.context.canvas.init();
|
|
612
|
+
const { container = 'container', width, height, renderer, background } = this.options;
|
|
613
|
+
if (container instanceof canvas_1.Canvas) {
|
|
614
|
+
this.context.canvas = container;
|
|
615
|
+
container.setBackground(background);
|
|
616
|
+
await container.init();
|
|
982
617
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
const timingParameters = {
|
|
994
|
-
type,
|
|
995
|
-
action: 'updatePosition',
|
|
996
|
-
upsertAncestors,
|
|
997
|
-
models,
|
|
998
|
-
apiName: 'updatePosition',
|
|
999
|
-
changes,
|
|
1000
|
-
};
|
|
1001
|
-
this.emit('beforeitemchange', timingParameters);
|
|
1002
|
-
this.hooks.itemchange.emit({
|
|
1003
|
-
type,
|
|
1004
|
-
changes: event.changes,
|
|
1005
|
-
graphCore,
|
|
1006
|
-
theme: specification,
|
|
1007
|
-
upsertAncestors,
|
|
1008
|
-
action: 'updatePosition',
|
|
1009
|
-
animate: !disableAnimate,
|
|
1010
|
-
callback,
|
|
1011
|
-
});
|
|
1012
|
-
this.emit('afteritemchange', timingParameters);
|
|
1013
|
-
});
|
|
1014
|
-
this.hooks.datachange.emit({
|
|
1015
|
-
data: {
|
|
1016
|
-
nodes: type === 'node' ? modelArr : [],
|
|
1017
|
-
edges: [],
|
|
1018
|
-
combos: type === 'combo' ? modelArr : [],
|
|
1019
|
-
},
|
|
1020
|
-
type: 'update',
|
|
1021
|
-
});
|
|
1022
|
-
const dataList = this.dataController.findData(type, modelArr.map((model) => model.id));
|
|
1023
|
-
return (0, util_1.isArray)(models) ? dataList : dataList[0];
|
|
1024
|
-
}
|
|
1025
|
-
getItemPreviousVisibility(ids) {
|
|
1026
|
-
const objs = ids.map((id) => ({ id, visible: this.getItemVisible(id) }));
|
|
1027
|
-
const groupedByVisible = (0, util_1.groupBy)(objs, 'visible');
|
|
1028
|
-
const values = [];
|
|
1029
|
-
for (const visible in groupedByVisible) {
|
|
1030
|
-
values.push({
|
|
1031
|
-
ids: (0, util_1.map)(groupedByVisible[visible], (item) => item.id),
|
|
1032
|
-
visible: visible === 'true',
|
|
618
|
+
else {
|
|
619
|
+
const $container = (0, util_1.isString)(container) ? document.getElementById(container) : container;
|
|
620
|
+
const containerSize = (0, dom_1.sizeOf)($container);
|
|
621
|
+
this.emit(constants_1.GraphEvent.BEFORE_CANVAS_INIT, { container: $container, width, height });
|
|
622
|
+
const canvas = new canvas_1.Canvas({
|
|
623
|
+
container: $container,
|
|
624
|
+
width: width || containerSize[0],
|
|
625
|
+
height: height || containerSize[1],
|
|
626
|
+
background,
|
|
627
|
+
renderer,
|
|
1033
628
|
});
|
|
629
|
+
this.context.canvas = canvas;
|
|
630
|
+
await canvas.init();
|
|
631
|
+
this.emit(constants_1.GraphEvent.AFTER_CANVAS_INIT, { canvas });
|
|
1034
632
|
}
|
|
1035
|
-
return values;
|
|
1036
633
|
}
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
634
|
+
initRuntime() {
|
|
635
|
+
this.context.options = this.options;
|
|
636
|
+
if (!this.context.batch)
|
|
637
|
+
this.context.batch = new batch_1.BatchController(this.context);
|
|
638
|
+
if (!this.context.plugin)
|
|
639
|
+
this.context.plugin = new plugin_1.PluginController(this.context);
|
|
640
|
+
if (!this.context.viewport)
|
|
641
|
+
this.context.viewport = new viewport_1.ViewportController(this.context);
|
|
642
|
+
if (!this.context.transform)
|
|
643
|
+
this.context.transform = new transform_1.TransformController(this.context);
|
|
644
|
+
if (!this.context.element)
|
|
645
|
+
this.context.element = new element_1.ElementController(this.context);
|
|
646
|
+
if (!this.context.animation)
|
|
647
|
+
this.context.animation = new animation_1.Animation(this.context);
|
|
648
|
+
if (!this.context.layout)
|
|
649
|
+
this.context.layout = new layout_1.LayoutController(this.context);
|
|
650
|
+
if (!this.context.behavior)
|
|
651
|
+
this.context.behavior = new behavior_1.BehaviorController(this.context);
|
|
652
|
+
}
|
|
653
|
+
async prepare() {
|
|
654
|
+
// 等待同步任务执行完成,避免 render 后立即调用 destroy 导致的问题
|
|
655
|
+
// Wait for synchronous tasks to complete, to avoid problems caused by calling destroy immediately after render
|
|
656
|
+
await Promise.resolve();
|
|
657
|
+
if (this.destroyed)
|
|
658
|
+
throw new Error('Graph has been destroyed');
|
|
659
|
+
await this.initCanvas();
|
|
660
|
+
this.initRuntime();
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* <zh/> 执行渲染
|
|
664
|
+
*
|
|
665
|
+
* <en/> Render
|
|
666
|
+
* @remarks
|
|
667
|
+
* <zh/> 此过程会执行数据更新、绘制元素、执行布局
|
|
668
|
+
*
|
|
669
|
+
* <en/> This process will execute data update, element rendering, and layout execution
|
|
670
|
+
* @apiCategory render
|
|
1042
671
|
*/
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
};
|
|
1051
|
-
this.hooks.itemvisibilitychange.emit({
|
|
1052
|
-
ids: idArr,
|
|
1053
|
-
value: true,
|
|
1054
|
-
graphCore: this.dataController.graphCore,
|
|
1055
|
-
animate: !disableAnimate,
|
|
1056
|
-
});
|
|
1057
|
-
this.emit('afteritemvisibilitychange', {
|
|
1058
|
-
ids,
|
|
1059
|
-
value: true,
|
|
1060
|
-
animate: !disableAnimate,
|
|
1061
|
-
action: 'updateVisibility',
|
|
1062
|
-
apiName: 'showItem',
|
|
1063
|
-
changes,
|
|
1064
|
-
});
|
|
672
|
+
async render() {
|
|
673
|
+
await this.prepare();
|
|
674
|
+
(0, event_1.emit)(this, new event_1.GraphLifeCycleEvent(constants_1.GraphEvent.BEFORE_RENDER));
|
|
675
|
+
const animation = this.context.element.draw();
|
|
676
|
+
await Promise.all([animation?.finished, this.context.layout.layout()]);
|
|
677
|
+
await this.autoFit();
|
|
678
|
+
(0, event_1.emit)(this, new event_1.GraphLifeCycleEvent(constants_1.GraphEvent.AFTER_RENDER));
|
|
1065
679
|
}
|
|
1066
680
|
/**
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1070
|
-
* @
|
|
681
|
+
* <zh/> 绘制元素
|
|
682
|
+
*
|
|
683
|
+
* <en/> Draw elements
|
|
684
|
+
* @returns <zh/> 渲染结果 | <en/> draw result
|
|
685
|
+
* @apiCategory element
|
|
1071
686
|
*/
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
const changes = {
|
|
1077
|
-
newValue: [{ ids: idArr, visible: false }],
|
|
1078
|
-
oldValue: this.getItemPreviousVisibility(idArr),
|
|
1079
|
-
};
|
|
1080
|
-
this.hooks.itemvisibilitychange.emit({
|
|
1081
|
-
ids: idArr,
|
|
1082
|
-
value: false,
|
|
1083
|
-
graphCore: this.dataController.graphCore,
|
|
1084
|
-
animate: !disableAnimate,
|
|
1085
|
-
keepKeyShape,
|
|
1086
|
-
});
|
|
1087
|
-
this.emit('afteritemvisibilitychange', {
|
|
1088
|
-
ids,
|
|
1089
|
-
value: false,
|
|
1090
|
-
animate: !disableAnimate,
|
|
1091
|
-
action: 'updateVisibility',
|
|
1092
|
-
apiName: 'hideItem',
|
|
1093
|
-
keepKeyShape,
|
|
1094
|
-
changes,
|
|
1095
|
-
});
|
|
687
|
+
async draw() {
|
|
688
|
+
await this.prepare();
|
|
689
|
+
await this.context.element.draw()?.finished;
|
|
690
|
+
await this.autoFit();
|
|
1096
691
|
}
|
|
1097
692
|
/**
|
|
1098
|
-
*
|
|
1099
|
-
*
|
|
1100
|
-
*
|
|
1101
|
-
* @
|
|
693
|
+
* <zh/> 执行布局
|
|
694
|
+
*
|
|
695
|
+
* <en/> Execute layout
|
|
696
|
+
* @apiCategory layout
|
|
1102
697
|
*/
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
this.hooks.itemzindexchange.emit({
|
|
1106
|
-
ids: idArr,
|
|
1107
|
-
action: 'front',
|
|
1108
|
-
graphCore: this.dataController.graphCore,
|
|
1109
|
-
});
|
|
1110
|
-
this.emit('afteritemzindexchange', {
|
|
1111
|
-
ids: idArr,
|
|
1112
|
-
action: 'front',
|
|
1113
|
-
apiName: 'frontItem',
|
|
1114
|
-
});
|
|
698
|
+
async layout() {
|
|
699
|
+
await this.context.layout.layout();
|
|
1115
700
|
}
|
|
1116
701
|
/**
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
* @
|
|
702
|
+
* <zh/> 停止布局
|
|
703
|
+
*
|
|
704
|
+
* <en/> Stop layout
|
|
705
|
+
* @remarks
|
|
706
|
+
* <zh/> 适用于带有迭代动画的布局,目前有 `force` 属于此类布局,即停止力导布局的迭代,一般用于布局迭代时间过长情况下的手动停止迭代动画,例如在点击画布/节点的监听中调用
|
|
707
|
+
*
|
|
708
|
+
* <en/> Suitable for layouts with iterative animations. Currently, `force` belongs to this type of layout, that is, stop the iteration of the force-directed layout. It is generally used to manually stop the iteration animation when the layout iteration time is too long, such as calling in the click canvas/node listener
|
|
709
|
+
* @apiCategory layout
|
|
1121
710
|
*/
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
this.hooks.itemzindexchange.emit({
|
|
1125
|
-
ids: idArr,
|
|
1126
|
-
action: 'back',
|
|
1127
|
-
graphCore: this.dataController.graphCore,
|
|
1128
|
-
});
|
|
1129
|
-
this.emit('afteritemzindexchange', {
|
|
1130
|
-
ids: idArr,
|
|
1131
|
-
action: 'back',
|
|
1132
|
-
apiName: 'backItem',
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
getItemPreviousStates(stateOption) {
|
|
1136
|
-
const { ids, states } = stateOption;
|
|
1137
|
-
const idArr = Array.isArray(ids) ? ids : [ids];
|
|
1138
|
-
const stateArr = Array.isArray(states) ? states : [states];
|
|
1139
|
-
if ((0, util_1.isEmpty)(idArr))
|
|
1140
|
-
return;
|
|
1141
|
-
return idArr.flatMap((id) => {
|
|
1142
|
-
return stateArr.map((state) => ({
|
|
1143
|
-
ids: id,
|
|
1144
|
-
states: state,
|
|
1145
|
-
value: this.getItemState(id, state),
|
|
1146
|
-
}));
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
/**
|
|
1150
|
-
* Set state for the item.
|
|
1151
|
-
* @param item the item to be set
|
|
1152
|
-
* @param state the state name
|
|
1153
|
-
* @param value state value
|
|
1154
|
-
* @returns
|
|
1155
|
-
* @group Item
|
|
1156
|
-
*/
|
|
1157
|
-
setItemState(ids, states, value) {
|
|
1158
|
-
const idArr = (0, util_1.isArray)(ids) ? ids : [ids];
|
|
1159
|
-
const stateArr = (0, util_1.isArray)(states) ? states : [states];
|
|
1160
|
-
const stateOption = { ids: idArr, states: stateArr, value };
|
|
1161
|
-
const changes = {
|
|
1162
|
-
newValue: [stateOption],
|
|
1163
|
-
oldValue: this.getItemPreviousStates(stateOption),
|
|
1164
|
-
};
|
|
1165
|
-
this.hooks.itemstatechange.emit({
|
|
1166
|
-
ids: idArr,
|
|
1167
|
-
states: stateArr,
|
|
1168
|
-
value,
|
|
1169
|
-
});
|
|
1170
|
-
this.emit('afteritemstatechange', {
|
|
1171
|
-
ids,
|
|
1172
|
-
states,
|
|
1173
|
-
value,
|
|
1174
|
-
action: 'updateState',
|
|
1175
|
-
apiName: 'setItemState',
|
|
1176
|
-
changes,
|
|
1177
|
-
});
|
|
711
|
+
stopLayout() {
|
|
712
|
+
this.context.layout.stopLayout();
|
|
1178
713
|
}
|
|
1179
714
|
/**
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
* @
|
|
1184
|
-
* @group Item
|
|
715
|
+
* <zh/> 清空画布元素
|
|
716
|
+
*
|
|
717
|
+
* <en/> Clear canvas elements
|
|
718
|
+
* @apiCategory canvas
|
|
1185
719
|
*/
|
|
1186
|
-
|
|
1187
|
-
|
|
720
|
+
async clear() {
|
|
721
|
+
this.context.model.setData({});
|
|
722
|
+
await this.draw();
|
|
1188
723
|
}
|
|
1189
724
|
/**
|
|
1190
|
-
*
|
|
1191
|
-
*
|
|
1192
|
-
*
|
|
1193
|
-
* @
|
|
1194
|
-
*/
|
|
1195
|
-
|
|
1196
|
-
|
|
725
|
+
* <zh/> 销毁当前图实例
|
|
726
|
+
*
|
|
727
|
+
* <en/> Destroy the current graph instance
|
|
728
|
+
* @apiCategory instance
|
|
729
|
+
*/
|
|
730
|
+
destroy() {
|
|
731
|
+
(0, event_1.emit)(this, new event_1.GraphLifeCycleEvent(constants_1.GraphEvent.BEFORE_DESTROY));
|
|
732
|
+
const { layout, animation, element, model, canvas, behavior, plugin } = this.context;
|
|
733
|
+
plugin?.destroy();
|
|
734
|
+
behavior?.destroy();
|
|
735
|
+
layout?.destroy();
|
|
736
|
+
animation?.destroy();
|
|
737
|
+
element?.destroy();
|
|
738
|
+
model.destroy();
|
|
739
|
+
canvas?.destroy();
|
|
740
|
+
this.options = {};
|
|
741
|
+
// @ts-expect-error force delete
|
|
742
|
+
this.context = {};
|
|
743
|
+
this.off();
|
|
744
|
+
window.removeEventListener('resize', this.onResize);
|
|
745
|
+
this.destroyed = true;
|
|
746
|
+
(0, event_1.emit)(this, new event_1.GraphLifeCycleEvent(constants_1.GraphEvent.AFTER_DESTROY));
|
|
1197
747
|
}
|
|
1198
748
|
/**
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1202
|
-
* @returns
|
|
1203
|
-
* @
|
|
749
|
+
* <zh/> 获取画布实例
|
|
750
|
+
*
|
|
751
|
+
* <en/> Get canvas instance
|
|
752
|
+
* @returns - <zh/> 画布实例 | <en/> canvas instance
|
|
753
|
+
* @apiCategory canvas
|
|
1204
754
|
*/
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
const stateOptions = { ids: idArr, states, value: false };
|
|
1208
|
-
const changes = {
|
|
1209
|
-
newValue: [stateOptions],
|
|
1210
|
-
oldValue: this.getItemPreviousStates(stateOptions),
|
|
1211
|
-
};
|
|
1212
|
-
this.hooks.itemstatechange.emit({
|
|
1213
|
-
ids: idArr,
|
|
1214
|
-
states,
|
|
1215
|
-
value: false,
|
|
1216
|
-
});
|
|
1217
|
-
this.emit('afteritemstatechange', {
|
|
1218
|
-
ids,
|
|
1219
|
-
states,
|
|
1220
|
-
value: false,
|
|
1221
|
-
action: 'updateState',
|
|
1222
|
-
apiName: 'clearItemState',
|
|
1223
|
-
changes,
|
|
1224
|
-
});
|
|
755
|
+
getCanvas() {
|
|
756
|
+
return this.context.canvas;
|
|
1225
757
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
if (!id)
|
|
1234
|
-
return this.canvas.getRoot().getRenderBounds();
|
|
1235
|
-
return this.itemController.getItemBBox(id, onlyKeyShape, isTransient);
|
|
1236
|
-
}
|
|
1237
|
-
/**
|
|
1238
|
-
* Get the visibility for a node / edge / combo.
|
|
1239
|
-
* @param id the id for the node / edge / combo
|
|
1240
|
-
* @returns visibility for the item, false for invisible or unexistence for the item
|
|
1241
|
-
* @group Item
|
|
1242
|
-
*/
|
|
1243
|
-
getItemVisible(id) {
|
|
1244
|
-
return this.itemController.getItemVisible(id);
|
|
1245
|
-
}
|
|
1246
|
-
// ===== combo operations =====
|
|
1247
|
-
/**
|
|
1248
|
-
* Add a new combo to the graph, and update the structure of the existed child in childrenIds to be the children of the new combo.
|
|
1249
|
-
* Different from addData with combo type, this API update the succeeds' combo tree strucutres in the same time.
|
|
1250
|
-
* @param model combo user data
|
|
1251
|
-
* @returns whether success
|
|
1252
|
-
* @group Combo
|
|
1253
|
-
*/
|
|
1254
|
-
addCombo(model, childrenIds) {
|
|
1255
|
-
const { graphCore } = this.dataController;
|
|
1256
|
-
const { specification } = this.themeController;
|
|
1257
|
-
graphCore.once('changed', (event) => {
|
|
1258
|
-
if (!event.changes.length)
|
|
1259
|
-
return;
|
|
1260
|
-
const changes = event.changes;
|
|
1261
|
-
const timingParameters = {
|
|
1262
|
-
type: 'combo',
|
|
1263
|
-
action: 'add',
|
|
1264
|
-
models: [model],
|
|
1265
|
-
apiName: 'addCombo',
|
|
1266
|
-
changes,
|
|
1267
|
-
};
|
|
1268
|
-
this.emit('beforeitemchange', timingParameters);
|
|
1269
|
-
this.hooks.itemchange.emit({
|
|
1270
|
-
type: 'combo',
|
|
1271
|
-
changes: graphCore.reduceChanges(event.changes),
|
|
1272
|
-
graphCore,
|
|
1273
|
-
theme: specification,
|
|
1274
|
-
});
|
|
1275
|
-
this.emit('afteritemchange', timingParameters);
|
|
1276
|
-
});
|
|
1277
|
-
const data = {
|
|
1278
|
-
nodes: [],
|
|
1279
|
-
edges: [],
|
|
1280
|
-
combos: [
|
|
1281
|
-
Object.assign(Object.assign({}, model), { data: Object.assign(Object.assign({}, model.data), { _children: childrenIds }) }),
|
|
1282
|
-
],
|
|
1283
|
-
};
|
|
1284
|
-
this.hooks.datachange.emit({
|
|
1285
|
-
data,
|
|
1286
|
-
type: 'addCombo',
|
|
1287
|
-
});
|
|
1288
|
-
return this.dataController.findData('combo', [model.id])[0];
|
|
758
|
+
resize(width, height) {
|
|
759
|
+
const size = !width || !height ? (0, dom_1.sizeOf)(this.context.canvas.getContainer()) : [width, height];
|
|
760
|
+
if ((0, util_1.isEqual)(size, this.getSize()))
|
|
761
|
+
return;
|
|
762
|
+
(0, event_1.emit)(this, new event_1.GraphLifeCycleEvent(constants_1.GraphEvent.BEFORE_SIZE_CHANGE, { size }));
|
|
763
|
+
this.context.canvas.resize(...size);
|
|
764
|
+
(0, event_1.emit)(this, new event_1.GraphLifeCycleEvent(constants_1.GraphEvent.AFTER_SIZE_CHANGE, { size }));
|
|
1289
765
|
}
|
|
1290
766
|
/**
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
1293
|
-
*
|
|
767
|
+
* <zh/> 将图缩放至合适大小并平移至视口中心
|
|
768
|
+
*
|
|
769
|
+
* <en/> Zoom the graph to fit the viewport and move it to the center of the viewport
|
|
770
|
+
* @param options - <zh/> 适配配置 | <en/> fit options
|
|
771
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
772
|
+
* @apiCategory viewport
|
|
1294
773
|
*/
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
this.executeWithNoStack(() => {
|
|
1298
|
-
this.updateData('combo', ids.map((id) => ({ id, data: { collapsed: true } })));
|
|
1299
|
-
});
|
|
1300
|
-
this.emit('aftercollapsecombo', {
|
|
1301
|
-
type: 'combo',
|
|
1302
|
-
action: 'collapseCombo',
|
|
1303
|
-
ids: comboIds,
|
|
1304
|
-
apiName: 'collapseCombo',
|
|
1305
|
-
});
|
|
774
|
+
async fitView(options, animation) {
|
|
775
|
+
await this.context.viewport?.fitView(options, animation);
|
|
1306
776
|
}
|
|
1307
777
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1310
|
-
*
|
|
778
|
+
* <zh/> 将图平移至视口中心
|
|
779
|
+
*
|
|
780
|
+
* <en/> Move the graph to the center of the viewport
|
|
781
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
782
|
+
* @apiCategory viewport
|
|
1311
783
|
*/
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
this.executeWithNoStack(() => {
|
|
1315
|
-
this.updateData('combo', ids.map((id) => ({ id, data: { collapsed: false } })));
|
|
1316
|
-
});
|
|
1317
|
-
this.emit('afterexpandcombo', {
|
|
1318
|
-
type: 'combo',
|
|
1319
|
-
action: 'expandCombo',
|
|
1320
|
-
ids: comboIds,
|
|
1321
|
-
apiName: 'expandCombo',
|
|
1322
|
-
});
|
|
784
|
+
async fitCenter(animation) {
|
|
785
|
+
await this.context.viewport?.fitCenter(animation);
|
|
1323
786
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
ids: idArr,
|
|
1342
|
-
dx,
|
|
1343
|
-
dy,
|
|
1344
|
-
action: 'updatePosition',
|
|
1345
|
-
upsertAncestors,
|
|
1346
|
-
apiName: 'moveCombo',
|
|
1347
|
-
changes,
|
|
1348
|
-
};
|
|
1349
|
-
this.emit('beforeitemchange', timingParameters);
|
|
1350
|
-
this.hooks.itemchange.emit({
|
|
1351
|
-
type: 'combo',
|
|
1352
|
-
changes: event.changes,
|
|
1353
|
-
graphCore,
|
|
1354
|
-
theme: specification,
|
|
1355
|
-
upsertAncestors,
|
|
1356
|
-
action: 'updatePosition',
|
|
1357
|
-
callback,
|
|
1358
|
-
});
|
|
1359
|
-
this.emit('afteritemchange', timingParameters);
|
|
1360
|
-
});
|
|
1361
|
-
this.hooks.datachange.emit({
|
|
1362
|
-
data: {
|
|
1363
|
-
nodes: [],
|
|
1364
|
-
edges: [],
|
|
1365
|
-
combos: idArr.map((id) => ({ id, data: { dx, dy } })),
|
|
1366
|
-
},
|
|
1367
|
-
type: 'moveCombo',
|
|
1368
|
-
});
|
|
1369
|
-
return this.dataController.findData('combo', idArr);
|
|
1370
|
-
}
|
|
1371
|
-
// ===== layout =====
|
|
1372
|
-
/**
|
|
1373
|
-
* Layout the graph (with current configurations if cfg is not assigned).
|
|
1374
|
-
*/
|
|
1375
|
-
layout(options, disableAnimate = false) {
|
|
1376
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1377
|
-
this.emit('beforelayout');
|
|
1378
|
-
const { graphCore } = this.dataController;
|
|
1379
|
-
const formattedOptions = Object.assign(Object.assign({}, this.getSpecification().layout), options);
|
|
1380
|
-
this.updateSpecification({ layout: formattedOptions });
|
|
1381
|
-
const layoutUnset = (!options && !this.getSpecification().layout) ||
|
|
1382
|
-
!Object.keys(formattedOptions).length;
|
|
1383
|
-
if (layoutUnset) {
|
|
1384
|
-
const nodes = graphCore.getAllNodes();
|
|
1385
|
-
if (nodes.every((node) => (0, util_1.isNil)(node.data.x) && (0, util_1.isNil)(node.data.y))) {
|
|
1386
|
-
// Use `grid` layout as default when x/y of each node is unset.
|
|
1387
|
-
formattedOptions.type = 'grid';
|
|
1388
|
-
}
|
|
1389
|
-
else {
|
|
1390
|
-
// Use user-defined position(x/y default to 0).
|
|
1391
|
-
formattedOptions.execute = (graph) => __awaiter(this, void 0, void 0, function* () {
|
|
1392
|
-
const nodes = graph.getAllNodes();
|
|
1393
|
-
return {
|
|
1394
|
-
nodes: nodes.map((node) => ({
|
|
1395
|
-
id: node.id,
|
|
1396
|
-
data: {
|
|
1397
|
-
x: Number(node.data.x) || 0,
|
|
1398
|
-
y: Number(node.data.y) || 0,
|
|
1399
|
-
},
|
|
1400
|
-
})),
|
|
1401
|
-
edges: [],
|
|
1402
|
-
};
|
|
1403
|
-
});
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
yield this.hooks.layout.emitLinearAsync({
|
|
1407
|
-
graphCore,
|
|
1408
|
-
options: formattedOptions,
|
|
1409
|
-
animate: !disableAnimate,
|
|
1410
|
-
});
|
|
1411
|
-
this.emit('afterlayout');
|
|
1412
|
-
});
|
|
787
|
+
async autoFit() {
|
|
788
|
+
const { autoFit } = this.context.options;
|
|
789
|
+
if (!autoFit)
|
|
790
|
+
return;
|
|
791
|
+
if ((0, util_1.isString)(autoFit)) {
|
|
792
|
+
if (autoFit === 'view')
|
|
793
|
+
await this.fitView();
|
|
794
|
+
else if (autoFit === 'center')
|
|
795
|
+
await this.fitCenter();
|
|
796
|
+
}
|
|
797
|
+
else {
|
|
798
|
+
const { type, animation } = autoFit;
|
|
799
|
+
if (type === 'view')
|
|
800
|
+
await this.fitView(autoFit.options, animation);
|
|
801
|
+
else if (type === 'center')
|
|
802
|
+
await this.fitCenter(animation);
|
|
803
|
+
}
|
|
1413
804
|
}
|
|
1414
805
|
/**
|
|
1415
|
-
*
|
|
806
|
+
* <zh/> 移动图,使得元素对齐到视口中心
|
|
807
|
+
*
|
|
808
|
+
* <en/> Move the graph so that the element is aligned to the center of the viewport
|
|
809
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
810
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
811
|
+
* @apiCategory viewport
|
|
1416
812
|
*/
|
|
1417
|
-
|
|
1418
|
-
this.
|
|
813
|
+
async focusElement(id, animation) {
|
|
814
|
+
await this.context.viewport?.focusElements(Array.isArray(id) ? id : [id], animation);
|
|
1419
815
|
}
|
|
1420
816
|
/**
|
|
817
|
+
* <zh/> 基于当前缩放比例进行缩放
|
|
1421
818
|
*
|
|
1422
|
-
*
|
|
819
|
+
* <en/> Zoom based on the current zoom ratio
|
|
820
|
+
* @param ratio - <zh/> 缩放比例 | <en/> zoom ratio
|
|
821
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
822
|
+
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
823
|
+
* @remarks
|
|
824
|
+
* <zh/>
|
|
825
|
+
* - ratio > 1 放大
|
|
826
|
+
* - ratio < 1 缩小
|
|
827
|
+
*
|
|
828
|
+
* <en/>
|
|
829
|
+
* - ratio > 1 zoom in
|
|
830
|
+
* - ratio < 1 zoom out
|
|
831
|
+
* @apiCategory viewport
|
|
1423
832
|
*/
|
|
1424
|
-
|
|
1425
|
-
|
|
833
|
+
async zoomBy(ratio, animation, origin) {
|
|
834
|
+
await this.context.viewport.transform({ mode: 'relative', scale: ratio, origin }, animation);
|
|
1426
835
|
}
|
|
1427
836
|
/**
|
|
1428
|
-
*
|
|
1429
|
-
*
|
|
1430
|
-
*
|
|
1431
|
-
* @
|
|
837
|
+
* <zh/> 缩放画布至指定比例
|
|
838
|
+
*
|
|
839
|
+
* <en/> Zoom the canvas to the specified ratio
|
|
840
|
+
* @param zoom - <zh/> 指定缩放比例 | <en/> specified zoom ratio
|
|
841
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
842
|
+
* @param origin - <zh/> 缩放中心(视口坐标) | <en/> zoom center(viewport coordinates)
|
|
843
|
+
* @remarks
|
|
844
|
+
* <zh/>
|
|
845
|
+
* - zoom = 1 默认大小
|
|
846
|
+
* - zoom > 1 放大
|
|
847
|
+
* - zoom < 1 缩小
|
|
848
|
+
*
|
|
849
|
+
* <en/>
|
|
850
|
+
* - zoom = 1 default size
|
|
851
|
+
* - zoom > 1 zoom in
|
|
852
|
+
* - zoom < 1 zoom out
|
|
853
|
+
* @apiCategory viewport
|
|
1432
854
|
*/
|
|
1433
|
-
|
|
1434
|
-
this.
|
|
855
|
+
async zoomTo(zoom, animation, origin) {
|
|
856
|
+
this.context.viewport.transform({ mode: 'absolute', scale: zoom, origin }, animation);
|
|
1435
857
|
}
|
|
1436
858
|
/**
|
|
1437
|
-
*
|
|
1438
|
-
*
|
|
1439
|
-
*
|
|
859
|
+
* <zh/> 获取当前缩放比例
|
|
860
|
+
*
|
|
861
|
+
* <en/> Get the current zoom ratio
|
|
862
|
+
* @returns <zh/> 缩放比例 | <en/> zoom ratio
|
|
863
|
+
* @apiCategory viewport
|
|
1440
864
|
*/
|
|
1441
|
-
|
|
1442
|
-
return this.
|
|
865
|
+
getZoom() {
|
|
866
|
+
return this.context.viewport.getZoom();
|
|
1443
867
|
}
|
|
1444
868
|
/**
|
|
1445
|
-
*
|
|
1446
|
-
*
|
|
869
|
+
* <zh/> 基于当前旋转角度进行旋转
|
|
870
|
+
*
|
|
871
|
+
* <en/> Rotate based on the current rotation angle
|
|
872
|
+
* @param angle - <zh/> 旋转角度 | <en/> rotation angle
|
|
873
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
874
|
+
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
875
|
+
* @apiCategory viewport
|
|
1447
876
|
*/
|
|
1448
|
-
|
|
1449
|
-
this.
|
|
1450
|
-
this.transientCanvas.setCursor(cursor);
|
|
877
|
+
async rotateBy(angle, animation, origin) {
|
|
878
|
+
await this.context.viewport.transform({ mode: 'relative', rotate: angle, origin }, animation);
|
|
1451
879
|
}
|
|
1452
880
|
/**
|
|
1453
|
-
*
|
|
1454
|
-
*
|
|
1455
|
-
*
|
|
1456
|
-
* @
|
|
1457
|
-
* @
|
|
881
|
+
* <zh/> 旋转画布至指定角度
|
|
882
|
+
*
|
|
883
|
+
* <en/> Rotate the canvas to the specified angle
|
|
884
|
+
* @param angle - <zh/> 目标角度 | <en/> target angle
|
|
885
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
886
|
+
* @param origin - <zh/> 旋转中心(视口坐标) | <en/> rotation center(viewport coordinates)
|
|
887
|
+
* @apiCategory viewport
|
|
1458
888
|
*/
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
const behaviorsArr = (0, util_1.isArray)(behaviors) ? behaviors : [behaviors];
|
|
1462
|
-
this.hooks.behaviorchange.emit({
|
|
1463
|
-
action: 'add',
|
|
1464
|
-
modes: modesArr,
|
|
1465
|
-
// TODO: update type define.
|
|
1466
|
-
// @ts-ignore
|
|
1467
|
-
behaviors: behaviorsArr,
|
|
1468
|
-
});
|
|
1469
|
-
// update the graph specification
|
|
1470
|
-
modesArr.forEach((mode) => {
|
|
1471
|
-
this.specification.modes[mode] =
|
|
1472
|
-
this.specification.modes[mode].concat(behaviorsArr);
|
|
1473
|
-
});
|
|
889
|
+
async rotateTo(angle, animation, origin) {
|
|
890
|
+
await this.context.viewport.transform({ mode: 'absolute', rotate: angle, origin }, animation);
|
|
1474
891
|
}
|
|
1475
892
|
/**
|
|
1476
|
-
*
|
|
1477
|
-
*
|
|
1478
|
-
*
|
|
1479
|
-
* @returns
|
|
1480
|
-
* @
|
|
893
|
+
* <zh/> 获取当前旋转角度
|
|
894
|
+
*
|
|
895
|
+
* <en/> Get the current rotation angle
|
|
896
|
+
* @returns <zh/> 旋转角度 | <en/> rotation angle
|
|
897
|
+
* @apiCategory viewport
|
|
1481
898
|
*/
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
this.hooks.behaviorchange.emit({
|
|
1485
|
-
action: 'remove',
|
|
1486
|
-
modes: modesArr,
|
|
1487
|
-
behaviors: behaviorKeys,
|
|
1488
|
-
});
|
|
1489
|
-
// update the graph specification
|
|
1490
|
-
modesArr.forEach((mode) => {
|
|
1491
|
-
behaviorKeys.forEach((key) => {
|
|
1492
|
-
const oldBehavior = this.specification.modes[mode].find((behavior) => (0, util_1.isObject)(behavior) && behavior.key === key);
|
|
1493
|
-
const indexOfOldBehavior = this.specification.modes[mode].indexOf(oldBehavior);
|
|
1494
|
-
this.specification.modes[mode].splice(indexOfOldBehavior, 1);
|
|
1495
|
-
});
|
|
1496
|
-
});
|
|
899
|
+
getRotation() {
|
|
900
|
+
return this.context.viewport.getRotation();
|
|
1497
901
|
}
|
|
1498
902
|
/**
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
1502
|
-
* @
|
|
1503
|
-
* @
|
|
903
|
+
* <zh/> 将图平移指定距离
|
|
904
|
+
*
|
|
905
|
+
* <en/> Translate the graph by the specified distance
|
|
906
|
+
* @param offset - <zh/> 偏移量 | <en/> offset
|
|
907
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
908
|
+
* @apiCategory viewport
|
|
1504
909
|
*/
|
|
1505
|
-
|
|
1506
|
-
this.
|
|
1507
|
-
action: 'update',
|
|
1508
|
-
modes: [mode],
|
|
1509
|
-
// TODO: update type define.
|
|
1510
|
-
// @ts-ignore
|
|
1511
|
-
behaviors: [behavior],
|
|
1512
|
-
});
|
|
1513
|
-
// no need to update specification since the corresponding part is the same object as the behavior's option
|
|
1514
|
-
// this.specification.modes[mode].forEach((b, i) => {
|
|
1515
|
-
// if (isObject(b) && b.key === behavior.key) {
|
|
1516
|
-
// this.specification.modes[mode][i] = behavior;
|
|
1517
|
-
// }
|
|
1518
|
-
// });
|
|
1519
|
-
}
|
|
1520
|
-
/**
|
|
1521
|
-
* Add plugin(s) to graph.
|
|
1522
|
-
* @param pluginCfgs
|
|
1523
|
-
* @returns
|
|
1524
|
-
* @group Plugin
|
|
1525
|
-
*/
|
|
1526
|
-
addPlugins(pluginCfgs) {
|
|
1527
|
-
const pluginsArr = (0, util_1.isArray)(pluginCfgs) ? pluginCfgs : [pluginCfgs];
|
|
1528
|
-
// update the graph specification
|
|
1529
|
-
if (!this.specification.plugins)
|
|
1530
|
-
this.specification.plugins = [];
|
|
1531
|
-
const oldPlugins = this.specification.plugins;
|
|
1532
|
-
const validPlugins = [];
|
|
1533
|
-
pluginsArr.forEach((config) => {
|
|
1534
|
-
const oldPlugin = oldPlugins.find((oldPlugin) => {
|
|
1535
|
-
if (typeof oldPlugin === 'string' || typeof config === 'string')
|
|
1536
|
-
return false;
|
|
1537
|
-
return oldPlugin.key === config.key;
|
|
1538
|
-
});
|
|
1539
|
-
if (oldPlugin) {
|
|
1540
|
-
console.warn(`Add plugin with key ${config.key} failed, the key is duplicated to the existing plugins on the graph.`);
|
|
1541
|
-
return;
|
|
1542
|
-
}
|
|
1543
|
-
validPlugins.push(config);
|
|
1544
|
-
});
|
|
1545
|
-
this.specification.plugins = oldPlugins.concat(validPlugins);
|
|
1546
|
-
this.hooks.pluginchange.emit({
|
|
1547
|
-
action: 'add',
|
|
1548
|
-
plugins: validPlugins,
|
|
1549
|
-
});
|
|
910
|
+
async translateBy(offset, animation) {
|
|
911
|
+
await this.context.viewport.transform({ mode: 'relative', translate: offset }, animation);
|
|
1550
912
|
}
|
|
1551
913
|
/**
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
* @
|
|
914
|
+
* <zh/> 将图平移至指定位置
|
|
915
|
+
*
|
|
916
|
+
* <en/> Translate the graph to the specified position
|
|
917
|
+
* @param position - <zh/> 指定位置 | <en/> specified position
|
|
918
|
+
* @param animation - <zh/> 动画配置 | <en/> animation configuration
|
|
919
|
+
* @apiCategory viewport
|
|
1556
920
|
*/
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
this.hooks.pluginchange.emit({
|
|
1560
|
-
action: 'remove',
|
|
1561
|
-
plugins: pluginArr,
|
|
1562
|
-
});
|
|
1563
|
-
// update the graph specification
|
|
1564
|
-
const { plugins } = this.specification;
|
|
1565
|
-
this.specification.plugins = plugins === null || plugins === void 0 ? void 0 : plugins.filter((plugin) => {
|
|
1566
|
-
if ((0, util_1.isObject)(plugin))
|
|
1567
|
-
return !(pluginArr.includes(plugin.key) ||
|
|
1568
|
-
pluginArr.includes(plugin));
|
|
1569
|
-
return !pluginArr.includes(plugin);
|
|
1570
|
-
});
|
|
921
|
+
async translateTo(position, animation) {
|
|
922
|
+
await this.context.viewport.transform({ mode: 'absolute', translate: position }, animation);
|
|
1571
923
|
}
|
|
1572
924
|
/**
|
|
1573
|
-
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1576
|
-
* @
|
|
925
|
+
* <zh/> 获取图的位置
|
|
926
|
+
*
|
|
927
|
+
* <en/> Get the position of the graph
|
|
928
|
+
* @returns <zh/> 图的位置 | <en/> position of the graph
|
|
929
|
+
* @remarks
|
|
930
|
+
* <zh/> 默认状态下,图的位置为 [0, 0]
|
|
931
|
+
*
|
|
932
|
+
* <en/> By default, the position of the graph is [0, 0]
|
|
933
|
+
* @apiCategory viewport
|
|
1577
934
|
*/
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
const { key } = plugin;
|
|
1581
|
-
if (!key) {
|
|
1582
|
-
console.warn('Update plugin failed, the key for the plugin to be updated should be assign.');
|
|
1583
|
-
return;
|
|
1584
|
-
}
|
|
1585
|
-
if (!plugins) {
|
|
1586
|
-
console.warn('Update plugin failed, the plugin to be updated does not exist.');
|
|
1587
|
-
return;
|
|
1588
|
-
}
|
|
1589
|
-
const oldPlugin = plugins === null || plugins === void 0 ? void 0 : plugins.find((p) => {
|
|
1590
|
-
if (typeof p === 'string')
|
|
1591
|
-
return p === key;
|
|
1592
|
-
return p.key === key;
|
|
1593
|
-
});
|
|
1594
|
-
if (!oldPlugin) {
|
|
1595
|
-
console.warn('Update plugin failed, the key for the plugin to be updated should be assign.');
|
|
1596
|
-
return;
|
|
1597
|
-
}
|
|
1598
|
-
const idx = plugins.indexOf(oldPlugin);
|
|
1599
|
-
plugins[idx] = Object.assign(Object.assign({}, oldPlugin), plugin);
|
|
1600
|
-
this.hooks.pluginchange.emit({
|
|
1601
|
-
action: 'update',
|
|
1602
|
-
plugins: [plugin],
|
|
1603
|
-
});
|
|
935
|
+
getPosition() {
|
|
936
|
+
return (0, vector_1.subtract)([0, 0], this.getCanvasByViewport([0, 0]));
|
|
1604
937
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
*/
|
|
1612
|
-
drawTransient(type, id, config, canvas) {
|
|
1613
|
-
this.hooks.transientupdate.emit({
|
|
1614
|
-
type,
|
|
1615
|
-
id,
|
|
1616
|
-
config,
|
|
1617
|
-
canvas: canvas || this.transientCanvas,
|
|
1618
|
-
graphCore: this.dataController.graphCore,
|
|
1619
|
-
});
|
|
1620
|
-
return this.itemController.getTransient(String(id));
|
|
1621
|
-
}
|
|
1622
|
-
// ===== download operations =====
|
|
1623
|
-
/**
|
|
1624
|
-
* Asynchronously generates a Data URL representation of the canvas content, including
|
|
1625
|
-
* background, main content, and transient canvas.
|
|
1626
|
-
* @param The type of the Data URL (e.g., 'image/png', 'image/jpeg').
|
|
1627
|
-
* @returns A Promise that resolves to the Data URL string.
|
|
1628
|
-
*/
|
|
1629
|
-
toDataURL(type) {
|
|
1630
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1631
|
-
const backgroundCanvas = this.backgroundCanvas;
|
|
1632
|
-
const canvas = this.canvas;
|
|
1633
|
-
const transientCanvas = this.transientCanvas;
|
|
1634
|
-
const rendererType = this.rendererType;
|
|
1635
|
-
const pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
|
|
1636
|
-
const width = this.getSize()[0];
|
|
1637
|
-
const height = this.getSize()[1];
|
|
1638
|
-
const vContainerDOM = (0, dom_util_1.createDom)('<div id="virtual-image"></div>');
|
|
1639
|
-
const vCanvas = (0, canvas_1.createCanvas)(rendererType, vContainerDOM, width, height, pixelRatio);
|
|
1640
|
-
const vCanvasContextService = vCanvas.getContextService();
|
|
1641
|
-
let bgRect;
|
|
1642
|
-
if (rendererType !== 'svg') {
|
|
1643
|
-
bgRect = new g_1.Rect({
|
|
1644
|
-
style: {
|
|
1645
|
-
x: 0,
|
|
1646
|
-
y: 0,
|
|
1647
|
-
z: -1,
|
|
1648
|
-
width: vCanvasContextService.getDomElement().width,
|
|
1649
|
-
height: vCanvasContextService.getDomElement().height,
|
|
1650
|
-
//@ts-ignore
|
|
1651
|
-
fill: backgroundCanvas.getContextService().getDomElement().style['background-color'],
|
|
1652
|
-
},
|
|
1653
|
-
});
|
|
1654
|
-
vCanvas.appendChild(bgRect);
|
|
1655
|
-
}
|
|
1656
|
-
const backgroundClonedGroup = backgroundCanvas.getRoot().cloneNode(true);
|
|
1657
|
-
const clonedGroup = canvas.getRoot().cloneNode(true);
|
|
1658
|
-
const transientClonedGroup = transientCanvas.getRoot().cloneNode(true);
|
|
1659
|
-
vCanvas.appendChild(backgroundClonedGroup);
|
|
1660
|
-
vCanvas.appendChild(clonedGroup);
|
|
1661
|
-
vCanvas.appendChild(transientClonedGroup);
|
|
1662
|
-
vCanvas.render();
|
|
1663
|
-
if (!type)
|
|
1664
|
-
type = 'image/png';
|
|
1665
|
-
let dataURL = '';
|
|
1666
|
-
yield vCanvasContextService.toDataURL({ type }).then((url) => {
|
|
1667
|
-
dataURL = url;
|
|
1668
|
-
});
|
|
1669
|
-
return dataURL;
|
|
1670
|
-
});
|
|
938
|
+
async translateElementBy(args1, args2, args3 = true) {
|
|
939
|
+
const [config, animation] = (0, util_1.isObject)(args1)
|
|
940
|
+
? [args1, args2 ?? true]
|
|
941
|
+
: [{ [args1]: args2 }, args3];
|
|
942
|
+
Object.entries(config).forEach(([id, offset]) => this.context.model.translateNodeBy(id, offset));
|
|
943
|
+
await this.context.element.draw({ animation })?.finished;
|
|
1671
944
|
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
*/
|
|
1679
|
-
toFullDataURL(type, imageConfig) {
|
|
1680
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1681
|
-
const backgroundCanvas = this.backgroundCanvas;
|
|
1682
|
-
const canvas = this.canvas;
|
|
1683
|
-
const transientCanvas = this.transientCanvas;
|
|
1684
|
-
const backgroundRoot = canvas.getRoot();
|
|
1685
|
-
const root = canvas.getRoot();
|
|
1686
|
-
const transientRoot = transientCanvas.getRoot();
|
|
1687
|
-
const rendererType = this.rendererType;
|
|
1688
|
-
const backgroundBBox = backgroundRoot.getBBox();
|
|
1689
|
-
const BBox = root.getBBox();
|
|
1690
|
-
const transientBBox = transientRoot.getBBox();
|
|
1691
|
-
let padding = imageConfig ? imageConfig.padding : undefined;
|
|
1692
|
-
if (!padding) {
|
|
1693
|
-
padding = [0, 0, 0, 0];
|
|
1694
|
-
}
|
|
1695
|
-
else if ((0, util_1.isNumber)(padding)) {
|
|
1696
|
-
padding = [padding, padding, padding, padding];
|
|
1697
|
-
}
|
|
1698
|
-
const left = (transientBBox.left
|
|
1699
|
-
? backgroundBBox.left
|
|
1700
|
-
? Math.min(backgroundBBox.left, BBox.left, transientBBox.left)
|
|
1701
|
-
: Math.min(BBox.left, transientBBox.left)
|
|
1702
|
-
: BBox.left) - padding[3];
|
|
1703
|
-
const right = (transientBBox.right
|
|
1704
|
-
? backgroundBBox.right
|
|
1705
|
-
? Math.max(backgroundBBox.right, BBox.right, transientBBox.right)
|
|
1706
|
-
: Math.max(BBox.right, transientBBox.right)
|
|
1707
|
-
: BBox.right) + padding[1];
|
|
1708
|
-
const top = (transientBBox.top
|
|
1709
|
-
? backgroundBBox.top
|
|
1710
|
-
? Math.min(backgroundBBox.top, BBox.top, transientBBox.top)
|
|
1711
|
-
: Math.min(BBox.top, transientBBox.top)
|
|
1712
|
-
: BBox.top) - padding[0];
|
|
1713
|
-
const bottom = (transientBBox.bottom
|
|
1714
|
-
? backgroundBBox.bottom
|
|
1715
|
-
? Math.max(backgroundBBox.bottom, BBox.bottom, transientBBox.bottom)
|
|
1716
|
-
: Math.max(BBox.bottom, transientBBox.bottom)
|
|
1717
|
-
: BBox.bottom) + padding[2];
|
|
1718
|
-
const graphCenterX = (left + right) / 2;
|
|
1719
|
-
const graphCenterY = (top + bottom) / 2;
|
|
1720
|
-
const halfX = (right - left) / 2;
|
|
1721
|
-
const halfY = (bottom - top) / 2;
|
|
1722
|
-
const pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;
|
|
1723
|
-
const vWidth = halfX * 2;
|
|
1724
|
-
const vHeight = halfY * 2;
|
|
1725
|
-
const vContainerDOM = (0, dom_util_1.createDom)('<div id="virtual-image"></div>');
|
|
1726
|
-
const vCanvas = (0, canvas_1.createCanvas)(rendererType, vContainerDOM, vWidth, vHeight, pixelRatio);
|
|
1727
|
-
const vCanvasContextService = vCanvas.getContextService();
|
|
1728
|
-
if (rendererType !== 'svg') {
|
|
1729
|
-
const bgRect = new g_1.Rect({
|
|
1730
|
-
style: {
|
|
1731
|
-
x: 0,
|
|
1732
|
-
y: 0,
|
|
1733
|
-
z: -1,
|
|
1734
|
-
width: vCanvasContextService.getDomElement().width,
|
|
1735
|
-
height: vCanvasContextService.getDomElement().height,
|
|
1736
|
-
//@ts-ignore
|
|
1737
|
-
fill: backgroundCanvas.getContextService().getDomElement().style['background-color'],
|
|
1738
|
-
},
|
|
1739
|
-
});
|
|
1740
|
-
vCanvas.appendChild(bgRect);
|
|
1741
|
-
}
|
|
1742
|
-
const backgroundClonedGroup = backgroundRoot.cloneNode(true);
|
|
1743
|
-
const clonedGroup = root.cloneNode(true);
|
|
1744
|
-
const transientClonedGroup = transientRoot.cloneNode(true);
|
|
1745
|
-
const transPosition = [
|
|
1746
|
-
-graphCenterX + halfX,
|
|
1747
|
-
-graphCenterY + halfY,
|
|
1748
|
-
];
|
|
1749
|
-
backgroundClonedGroup.setPosition(transPosition);
|
|
1750
|
-
clonedGroup.setPosition(transPosition);
|
|
1751
|
-
transientClonedGroup.setPosition(transPosition);
|
|
1752
|
-
vCanvas.appendChild(backgroundClonedGroup);
|
|
1753
|
-
vCanvas.appendChild(clonedGroup);
|
|
1754
|
-
vCanvas.appendChild(transientClonedGroup);
|
|
1755
|
-
vCanvas.render();
|
|
1756
|
-
if (!type)
|
|
1757
|
-
type = 'image/png';
|
|
1758
|
-
let dataURL = '';
|
|
1759
|
-
yield vCanvasContextService.toDataURL({ type }).then((url) => {
|
|
1760
|
-
dataURL = url;
|
|
1761
|
-
});
|
|
1762
|
-
return dataURL;
|
|
1763
|
-
});
|
|
945
|
+
async translateElementTo(args1, args2, args3 = true) {
|
|
946
|
+
const [config, animation] = (0, util_1.isObject)(args1)
|
|
947
|
+
? [args1, args2 ?? true]
|
|
948
|
+
: [{ [args1]: args2 }, args3];
|
|
949
|
+
Object.entries(config).forEach(([id, position]) => this.context.model.translateNodeTo(id, position));
|
|
950
|
+
await this.context.element.draw({ animation })?.finished;
|
|
1764
951
|
}
|
|
1765
952
|
/**
|
|
1766
|
-
*
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1769
|
-
* @param
|
|
1770
|
-
* @
|
|
953
|
+
* <zh/> 获取元素位置
|
|
954
|
+
*
|
|
955
|
+
* <en/> Get element position
|
|
956
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
957
|
+
* @returns <zh/> 元素位置 | <en/> element position
|
|
958
|
+
* @apiCategory element
|
|
1771
959
|
*/
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
console.error('Download image failed. The graph is too large or there is invalid attribute values in graph items');
|
|
1775
|
-
return;
|
|
1776
|
-
}
|
|
1777
|
-
if (typeof window !== 'undefined') {
|
|
1778
|
-
if (window.Blob && window.URL && renderer !== 'svg') {
|
|
1779
|
-
const arr = dataURL.split(',');
|
|
1780
|
-
let mime = '';
|
|
1781
|
-
if (arr && arr.length > 0) {
|
|
1782
|
-
const match = arr[0].match(/:(.*?);/);
|
|
1783
|
-
// eslint-disable-next-line prefer-destructuring
|
|
1784
|
-
if (match && match.length >= 2)
|
|
1785
|
-
mime = match[1];
|
|
1786
|
-
}
|
|
1787
|
-
const bstr = atob(arr[1]);
|
|
1788
|
-
let n = bstr.length;
|
|
1789
|
-
const u8arr = new Uint8Array(n);
|
|
1790
|
-
while (n--) {
|
|
1791
|
-
u8arr[n] = bstr.charCodeAt(n);
|
|
1792
|
-
}
|
|
1793
|
-
const blobObj = new Blob([u8arr], { type: mime });
|
|
1794
|
-
if (window.navigator.msSaveBlob) {
|
|
1795
|
-
window.navigator.msSaveBlob(blobObj, fileName);
|
|
1796
|
-
}
|
|
1797
|
-
else {
|
|
1798
|
-
link.addEventListener('click', () => {
|
|
1799
|
-
link.download = fileName;
|
|
1800
|
-
link.href = window.URL.createObjectURL(blobObj);
|
|
1801
|
-
});
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
else {
|
|
1805
|
-
link.addEventListener('click', () => {
|
|
1806
|
-
link.download = fileName;
|
|
1807
|
-
link.href = dataURL;
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
960
|
+
getElementPosition(id) {
|
|
961
|
+
return this.context.model.getElementPosition(id);
|
|
1811
962
|
}
|
|
1812
963
|
/**
|
|
1813
|
-
*
|
|
1814
|
-
*
|
|
1815
|
-
*
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
type = 'image/png';
|
|
1823
|
-
const fileName = (name || 'graph') +
|
|
1824
|
-
(rendererType === 'svg' ? '.svg' : type.split('/')[1]);
|
|
1825
|
-
const link = document.createElement('a');
|
|
1826
|
-
self.asyncToDataUrl(type, (dataURL) => {
|
|
1827
|
-
this.dataURLToImage(dataURL, rendererType, link, fileName);
|
|
1828
|
-
const e = document.createEvent('MouseEvents');
|
|
1829
|
-
e.initEvent('click', false, false);
|
|
1830
|
-
link.dispatchEvent(e);
|
|
1831
|
-
});
|
|
964
|
+
* <zh/> 获取元素渲染样式
|
|
965
|
+
*
|
|
966
|
+
* <en/> Get element rendering style
|
|
967
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
968
|
+
* @returns <zh/> 元素渲染样式 | <en/> element rendering style
|
|
969
|
+
* @apiCategory element
|
|
970
|
+
*/
|
|
971
|
+
getElementRenderStyle(id) {
|
|
972
|
+
return (0, util_1.omit)(this.context.element.getElement(id).attributes, ['context']);
|
|
1832
973
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
const rendererType = this.rendererType;
|
|
1842
|
-
if (!type)
|
|
1843
|
-
type = 'image/png';
|
|
1844
|
-
const fileName = (name || 'graph') +
|
|
1845
|
-
(rendererType === 'svg' ? '.svg' : type.split('/')[1]);
|
|
1846
|
-
const link = document.createElement('a');
|
|
1847
|
-
self.asyncToFullDataUrl(type, imageConfig, (dataURL) => {
|
|
1848
|
-
this.dataURLToImage(dataURL, rendererType, link, fileName);
|
|
1849
|
-
const e = document.createEvent('MouseEvents');
|
|
1850
|
-
e.initEvent('click', false, false);
|
|
1851
|
-
link.dispatchEvent(e);
|
|
974
|
+
async setElementVisibility(args1, args2, args3 = true) {
|
|
975
|
+
const [config, animation] = (0, util_1.isObject)(args1)
|
|
976
|
+
? [args1, args2 ?? true]
|
|
977
|
+
: [{ [args1]: args2 }, args3];
|
|
978
|
+
const dataToUpdate = { nodes: [], edges: [], combos: [] };
|
|
979
|
+
Object.entries(config).forEach(([id, value]) => {
|
|
980
|
+
const elementType = this.getElementType(id);
|
|
981
|
+
dataToUpdate[`${elementType}s`].push({ id, style: { visibility: value } });
|
|
1852
982
|
});
|
|
983
|
+
const { model, element } = this.context;
|
|
984
|
+
model.preventUpdateNodeLikeHierarchy(() => {
|
|
985
|
+
model.updateData(dataToUpdate);
|
|
986
|
+
});
|
|
987
|
+
await element.draw({ animation, stage: 'visibility' })?.finished;
|
|
1853
988
|
}
|
|
1854
989
|
/**
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
*
|
|
990
|
+
* <zh/> 显示元素
|
|
991
|
+
*
|
|
992
|
+
* <en/> Show element
|
|
993
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
994
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
995
|
+
* @apiCategory element
|
|
1858
996
|
*/
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
type = 'image/png';
|
|
1863
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
1864
|
-
yield this.toDataURL(type).then((url) => {
|
|
1865
|
-
dataURL = url;
|
|
1866
|
-
});
|
|
1867
|
-
if (callback)
|
|
1868
|
-
callback(dataURL);
|
|
1869
|
-
}), 16);
|
|
1870
|
-
}
|
|
1871
|
-
/**
|
|
1872
|
-
* Asynchronously converts the entire canvas content to a Data URL of the specified type
|
|
1873
|
-
* with optional padding, and invokes the provided callback.
|
|
1874
|
-
* @param type The type of the Data URL (optional, defaults to 'image/png').
|
|
1875
|
-
* @param imageConfig Configuration options for the image (optional).
|
|
1876
|
-
* @param callback A callback function to handle the Data URL (optional).
|
|
1877
|
-
*/
|
|
1878
|
-
asyncToFullDataUrl(type, imageConfig, callback) {
|
|
1879
|
-
let dataURL = '';
|
|
1880
|
-
if (!type)
|
|
1881
|
-
type = 'image/png';
|
|
1882
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
1883
|
-
yield this.toFullDataURL(type, imageConfig).then((url) => {
|
|
1884
|
-
dataURL = url;
|
|
1885
|
-
});
|
|
1886
|
-
if (callback)
|
|
1887
|
-
callback(dataURL);
|
|
1888
|
-
}), 16);
|
|
997
|
+
async showElement(id, animation) {
|
|
998
|
+
const ids = Array.isArray(id) ? id : [id];
|
|
999
|
+
await this.setElementVisibility(Object.fromEntries(ids.map((_id) => [_id, 'visible'])), animation);
|
|
1889
1000
|
}
|
|
1890
|
-
// ===== history operations =====
|
|
1891
1001
|
/**
|
|
1892
|
-
*
|
|
1002
|
+
* <zh/> 隐藏元素
|
|
1003
|
+
*
|
|
1004
|
+
* <en/> Hide element
|
|
1005
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1006
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
1007
|
+
* @apiCategory element
|
|
1893
1008
|
*/
|
|
1894
|
-
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1009
|
+
async hideElement(id, animation) {
|
|
1010
|
+
const ids = Array.isArray(id) ? id : [id];
|
|
1011
|
+
await this.setElementVisibility(Object.fromEntries(ids.map((_id) => [_id, 'hidden'])), animation);
|
|
1897
1012
|
}
|
|
1898
1013
|
/**
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1902
|
-
* @param
|
|
1014
|
+
* <zh/> 获取元素可见性
|
|
1015
|
+
*
|
|
1016
|
+
* <en/> Get element visibility
|
|
1017
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1018
|
+
* @returns <zh/> 元素可见性 | <en/> element visibility
|
|
1019
|
+
* @apiCategory element
|
|
1903
1020
|
*/
|
|
1904
|
-
|
|
1905
|
-
const
|
|
1906
|
-
return
|
|
1021
|
+
getElementVisibility(id) {
|
|
1022
|
+
const element = this.context.element.getElement(id);
|
|
1023
|
+
return element?.style?.visibility ?? 'visible';
|
|
1907
1024
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1025
|
+
async setElementZIndex(args1, args2) {
|
|
1026
|
+
const dataToUpdate = { nodes: [], edges: [], combos: [] };
|
|
1027
|
+
const config = (0, util_1.isObject)(args1) ? args1 : { [args1]: args2 };
|
|
1028
|
+
Object.entries(config).forEach(([id, value]) => {
|
|
1029
|
+
const elementType = this.getElementType(id);
|
|
1030
|
+
dataToUpdate[`${elementType}s`].push({ id, style: { zIndex: value } });
|
|
1031
|
+
});
|
|
1032
|
+
const { model, element } = this.context;
|
|
1033
|
+
model.preventUpdateNodeLikeHierarchy(() => model.updateData(dataToUpdate));
|
|
1034
|
+
await element.draw({ animation: false })?.finished;
|
|
1914
1035
|
}
|
|
1915
1036
|
/**
|
|
1916
|
-
*
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1037
|
+
* <zh/> 将元素置于最顶层
|
|
1038
|
+
*
|
|
1039
|
+
* <en/> Bring the element to the front
|
|
1040
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1041
|
+
* @apiCategory element
|
|
1042
|
+
*/
|
|
1043
|
+
async frontElement(id) {
|
|
1044
|
+
const ids = Array.isArray(id) ? id : [id];
|
|
1045
|
+
const { model } = this.context;
|
|
1046
|
+
const config = {};
|
|
1047
|
+
ids.map((_id) => {
|
|
1048
|
+
const zIndex = model.getFrontZIndex(_id);
|
|
1049
|
+
const elementType = model.getElementType(_id);
|
|
1050
|
+
if (elementType === 'combo') {
|
|
1051
|
+
const ancestor = model.getAncestorsData(_id, constants_1.COMBO_KEY).at(-1) || this.getComboData(_id);
|
|
1052
|
+
const combos = [ancestor, ...model.getDescendantsData((0, id_1.idOf)(ancestor))].filter((datum) => model.isCombo((0, id_1.idOf)(datum)));
|
|
1053
|
+
const delta = zIndex - (0, style_1.zIndexOf)(ancestor);
|
|
1054
|
+
combos.forEach((combo) => {
|
|
1055
|
+
config[(0, id_1.idOf)(combo)] = (0, style_1.zIndexOf)(combo) + delta;
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
else
|
|
1059
|
+
config[_id] = zIndex;
|
|
1060
|
+
});
|
|
1061
|
+
await this.setElementZIndex(config);
|
|
1921
1062
|
}
|
|
1922
1063
|
/**
|
|
1923
|
-
*
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1064
|
+
* <zh/> 获取元素层级
|
|
1065
|
+
*
|
|
1066
|
+
* <en/> Get element z-index
|
|
1067
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1068
|
+
* @returns <zh/> 元素层级 | <en/> element z-index
|
|
1069
|
+
* @apiCategory element
|
|
1070
|
+
*/
|
|
1071
|
+
getElementZIndex(id) {
|
|
1072
|
+
return (0, style_1.zIndexOf)(this.context.model.getElementDataById(id));
|
|
1073
|
+
}
|
|
1074
|
+
async setElementState(args1, args2, args3 = true) {
|
|
1075
|
+
const [config, animation] = (0, util_1.isObject)(args1)
|
|
1076
|
+
? [args1, args2 ?? true]
|
|
1077
|
+
: [{ [args1]: args2 }, args3];
|
|
1078
|
+
const parseState = (state) => {
|
|
1079
|
+
if (!state)
|
|
1080
|
+
return [];
|
|
1081
|
+
return Array.isArray(state) ? state : [state];
|
|
1082
|
+
};
|
|
1083
|
+
const dataToUpdate = { nodes: [], edges: [], combos: [] };
|
|
1084
|
+
Object.entries(config).forEach(([id, value]) => {
|
|
1085
|
+
const elementType = this.getElementType(id);
|
|
1086
|
+
dataToUpdate[`${elementType}s`].push({ id, states: parseState(value) });
|
|
1087
|
+
});
|
|
1088
|
+
this.updateData(dataToUpdate);
|
|
1089
|
+
await this.context.element.draw({ animation })?.finished;
|
|
1928
1090
|
}
|
|
1929
1091
|
/**
|
|
1930
|
-
*
|
|
1092
|
+
* <zh/> 获取元素状态
|
|
1093
|
+
*
|
|
1094
|
+
* <en/> Get element state
|
|
1095
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1096
|
+
* @returns <zh/> 元素状态 | <en/> element state
|
|
1097
|
+
* @apiCategory element
|
|
1931
1098
|
*/
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
return history === null || history === void 0 ? void 0 : history.getRedoStack();
|
|
1099
|
+
getElementState(id) {
|
|
1100
|
+
return this.context.model.getElementState(id);
|
|
1935
1101
|
}
|
|
1936
1102
|
/**
|
|
1937
|
-
*
|
|
1938
|
-
*
|
|
1103
|
+
* <zh/> 获取元素自身以及子节点在世界坐标系下的渲染包围盒
|
|
1104
|
+
*
|
|
1105
|
+
* <en/> Get the rendering bounding box of the element itself and its child nodes in the world coordinate system
|
|
1106
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1107
|
+
* @returns <zh/> 渲染包围盒 | <en/> render bounding box
|
|
1108
|
+
* @apiCategory element
|
|
1939
1109
|
*/
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
return history === null || history === void 0 ? void 0 : history.getStack();
|
|
1110
|
+
getElementRenderBounds(id) {
|
|
1111
|
+
return this.context.element.getElement(id).getRenderBounds();
|
|
1943
1112
|
}
|
|
1113
|
+
isCollapsingExpanding = false;
|
|
1944
1114
|
/**
|
|
1945
|
-
*
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1115
|
+
* <zh/> 收起 Combo
|
|
1116
|
+
*
|
|
1117
|
+
* <en/> Collapse Combo
|
|
1118
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1119
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
1120
|
+
* @apiCategory element
|
|
1121
|
+
*/
|
|
1122
|
+
async collapseElement(id, animation = true) {
|
|
1123
|
+
const { model, element } = this.context;
|
|
1124
|
+
if ((0, collapsibility_1.isCollapsed)(model.getNodeLikeData([id])[0]))
|
|
1125
|
+
return;
|
|
1126
|
+
if (this.isCollapsingExpanding)
|
|
1127
|
+
return;
|
|
1128
|
+
const elementType = model.getElementType(id);
|
|
1129
|
+
this.isCollapsingExpanding = true;
|
|
1130
|
+
this.setElementCollapsibility(id, true);
|
|
1131
|
+
if (elementType === 'node')
|
|
1132
|
+
await element.collapseNode(id, animation);
|
|
1133
|
+
else if (elementType === 'combo')
|
|
1134
|
+
await element.collapseCombo(id, animation);
|
|
1135
|
+
this.isCollapsingExpanding = false;
|
|
1952
1136
|
}
|
|
1953
1137
|
/**
|
|
1954
|
-
*
|
|
1955
|
-
*
|
|
1956
|
-
*
|
|
1138
|
+
* <zh/> 展开 Combo
|
|
1139
|
+
*
|
|
1140
|
+
* <en/> Expand Combo
|
|
1141
|
+
* @param id - <zh/> 元素 ID | <en/> element ID
|
|
1142
|
+
* @param animation - <zh/> 是否启用动画 | <en/> whether to enable animation
|
|
1143
|
+
* @apiCategory element
|
|
1144
|
+
*/
|
|
1145
|
+
async expandElement(id, animation = true) {
|
|
1146
|
+
const { model, element } = this.context;
|
|
1147
|
+
if (!(0, collapsibility_1.isCollapsed)(model.getNodeLikeData([id])[0]))
|
|
1148
|
+
return;
|
|
1149
|
+
if (this.isCollapsingExpanding)
|
|
1150
|
+
return;
|
|
1151
|
+
const elementType = model.getElementType(id);
|
|
1152
|
+
this.isCollapsingExpanding = true;
|
|
1153
|
+
this.setElementCollapsibility(id, false);
|
|
1154
|
+
if (elementType === 'node')
|
|
1155
|
+
await element.expandNode(id, animation);
|
|
1156
|
+
else if (elementType === 'combo')
|
|
1157
|
+
await element.expandCombo(id, animation);
|
|
1158
|
+
this.isCollapsingExpanding = false;
|
|
1159
|
+
}
|
|
1160
|
+
setElementCollapsibility(id, collapsed) {
|
|
1161
|
+
const elementType = this.getElementType(id);
|
|
1162
|
+
if (elementType === 'node')
|
|
1163
|
+
this.updateNodeData([{ id, style: { collapsed } }]);
|
|
1164
|
+
else if (elementType === 'combo')
|
|
1165
|
+
this.updateComboData([{ id, style: { collapsed } }]);
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* <zh/> 导出画布内容为 DataURL
|
|
1169
|
+
*
|
|
1170
|
+
* <en/> Export canvas content as DataURL
|
|
1171
|
+
* @param options - <zh/> 导出配置 | <en/> export configuration
|
|
1172
|
+
* @returns <zh/> DataURL | <en/> DataURL
|
|
1173
|
+
* @apiCategory exportImage
|
|
1957
1174
|
*/
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
history === null || history === void 0 ? void 0 : history.redo();
|
|
1175
|
+
async toDataURL(options = {}) {
|
|
1176
|
+
return this.context.canvas.toDataURL(options);
|
|
1961
1177
|
}
|
|
1962
1178
|
/**
|
|
1963
|
-
*
|
|
1179
|
+
* <zh/> 给定的视窗 DOM 坐标,转换为画布上的绘制坐标
|
|
1180
|
+
*
|
|
1181
|
+
* <en/> Convert the given viewport DOM coordinates to the drawing coordinates on the canvas
|
|
1182
|
+
* @param point - <zh/> 视窗坐标 | <en/> viewport coordinates
|
|
1183
|
+
* @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
|
|
1184
|
+
* @apiCategory viewport
|
|
1964
1185
|
*/
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
return history === null || history === void 0 ? void 0 : history.canUndo();
|
|
1186
|
+
getCanvasByViewport(point) {
|
|
1187
|
+
return (0, point_1.parsePoint)(this.context.canvas.viewport2Canvas((0, point_1.toPointObject)(point)));
|
|
1968
1188
|
}
|
|
1969
1189
|
/**
|
|
1970
|
-
*
|
|
1190
|
+
* <zh/> 给定画布上的绘制坐标,转换为视窗 DOM 的坐标
|
|
1191
|
+
*
|
|
1192
|
+
* <en/> Convert the given drawing coordinates on the canvas to the coordinates of the viewport DOM
|
|
1193
|
+
* @param point - <zh/> 画布坐标 | <en/> canvas coordinates
|
|
1194
|
+
* @returns <zh/> 视窗 DOM 的坐标 | <en/> coordinates of the viewport DOM
|
|
1195
|
+
* @apiCategory viewport
|
|
1971
1196
|
*/
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
return history === null || history === void 0 ? void 0 : history.canRedo();
|
|
1197
|
+
getViewportByCanvas(point) {
|
|
1198
|
+
return (0, point_1.parsePoint)(this.context.canvas.canvas2Viewport((0, point_1.toPointObject)(point)));
|
|
1975
1199
|
}
|
|
1976
1200
|
/**
|
|
1977
|
-
*
|
|
1978
|
-
*
|
|
1979
|
-
*
|
|
1201
|
+
* <zh/> 给定画布上的绘制坐标,转换为浏览器坐标
|
|
1202
|
+
*
|
|
1203
|
+
* <en/> Convert the given drawing coordinates on the canvas to browser coordinates
|
|
1204
|
+
* @param point - <zh/> 画布坐标 | <en/> canvas coordinates
|
|
1205
|
+
* @returns <zh/> 浏览器坐标 | <en/> browser coordinates
|
|
1206
|
+
* @apiCategory viewport
|
|
1980
1207
|
*/
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
|
|
1208
|
+
getClientByCanvas(point) {
|
|
1209
|
+
const viewportPoint = this.context.canvas.canvas2Viewport((0, point_1.toPointObject)(point));
|
|
1210
|
+
return (0, point_1.parsePoint)(this.context.canvas.viewport2Canvas(viewportPoint));
|
|
1984
1211
|
}
|
|
1985
1212
|
/**
|
|
1986
|
-
*
|
|
1987
|
-
*
|
|
1988
|
-
*
|
|
1213
|
+
* <zh/> 给定的浏览器坐标,转换为画布上的绘制坐标
|
|
1214
|
+
*
|
|
1215
|
+
* <en/> Convert the given browser coordinates to drawing coordinates on the canvas
|
|
1216
|
+
* @param point - <zh/> 浏览器坐标 | <en/> browser coordinates
|
|
1217
|
+
* @returns <zh/> 画布上的绘制坐标 | <en/> drawing coordinates on the canvas
|
|
1218
|
+
* @apiCategory viewport
|
|
1989
1219
|
*/
|
|
1990
|
-
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1220
|
+
getCanvasByClient(point) {
|
|
1221
|
+
const viewportPoint = this.context.canvas.client2Viewport((0, point_1.toPointObject)(point));
|
|
1222
|
+
return (0, point_1.parsePoint)(this.context.canvas.viewport2Canvas(viewportPoint));
|
|
1993
1223
|
}
|
|
1994
1224
|
/**
|
|
1995
|
-
*
|
|
1996
|
-
*
|
|
1997
|
-
*
|
|
1998
|
-
* @
|
|
1225
|
+
* <zh/> 获取视口中心的画布坐标
|
|
1226
|
+
*
|
|
1227
|
+
* <en/> Get the canvas coordinates of the viewport center
|
|
1228
|
+
* @returns <zh/> 视口中心的画布坐标 | <en/> Canvas coordinates of the viewport center
|
|
1229
|
+
* @apiCategory viewport
|
|
1999
1230
|
*/
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
history === null || history === void 0 ? void 0 : history.historyBatch(callback);
|
|
1231
|
+
getViewportCenter() {
|
|
1232
|
+
return this.context.viewport.getViewportCenter();
|
|
2003
1233
|
}
|
|
2004
1234
|
/**
|
|
2005
|
-
*
|
|
2006
|
-
*
|
|
1235
|
+
* <zh/> 获取画布中心的画布坐标
|
|
1236
|
+
*
|
|
1237
|
+
* <en/> Get the canvas coordinates of the canvas center
|
|
1238
|
+
* @returns <zh/> 画布中心的画布坐标 | <en/> Canvas coordinates of the canvas center
|
|
1239
|
+
* @apiCategory viewport
|
|
2007
1240
|
*/
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
if (!stackType)
|
|
2011
|
-
return history === null || history === void 0 ? void 0 : history.clear();
|
|
2012
|
-
return stackType === 'undo'
|
|
2013
|
-
? history === null || history === void 0 ? void 0 : history.clearUndoStack()
|
|
2014
|
-
: history === null || history === void 0 ? void 0 : history.clearRedoStack();
|
|
1241
|
+
getCanvasCenter() {
|
|
1242
|
+
return this.context.viewport.getCanvasCenter();
|
|
2015
1243
|
}
|
|
1244
|
+
onResize = (0, util_1.debounce)(() => {
|
|
1245
|
+
this.resize();
|
|
1246
|
+
}, 300);
|
|
2016
1247
|
/**
|
|
2017
|
-
*
|
|
2018
|
-
*
|
|
2019
|
-
*
|
|
2020
|
-
* @param
|
|
2021
|
-
* @
|
|
2022
|
-
* @
|
|
1248
|
+
* <zh/> 监听事件
|
|
1249
|
+
*
|
|
1250
|
+
* <en/> Listen to events
|
|
1251
|
+
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
1252
|
+
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
1253
|
+
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
1254
|
+
* @apiCategory event
|
|
2023
1255
|
*/
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
ids: (0, util_1.isArray)(ids) ? ids : [ids],
|
|
2027
|
-
action: 'collapse',
|
|
2028
|
-
animate: !disableAnimate,
|
|
2029
|
-
graphCore: this.dataController.graphCore,
|
|
2030
|
-
});
|
|
1256
|
+
on(eventName, callback) {
|
|
1257
|
+
return super.on(eventName, callback);
|
|
2031
1258
|
}
|
|
2032
1259
|
/**
|
|
2033
|
-
*
|
|
2034
|
-
*
|
|
2035
|
-
*
|
|
2036
|
-
* @param
|
|
2037
|
-
* @
|
|
2038
|
-
* @
|
|
1260
|
+
* <zh/> 一次性监听事件
|
|
1261
|
+
*
|
|
1262
|
+
* <en/> Listen to events once
|
|
1263
|
+
* @param eventName - <zh/> 事件名称 | <en/> event name
|
|
1264
|
+
* @param callback - <zh/> 回调函数 | <en/> callback function
|
|
1265
|
+
* @returns <zh/> Graph 实例 | <en/> Graph instance
|
|
1266
|
+
* @apiCategory event
|
|
2039
1267
|
*/
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
ids: (0, util_1.isArray)(ids) ? ids : [ids],
|
|
2043
|
-
action: 'expand',
|
|
2044
|
-
animate: !disableAnimate,
|
|
2045
|
-
graphCore: this.dataController.graphCore,
|
|
2046
|
-
});
|
|
2047
|
-
}
|
|
2048
|
-
/**
|
|
2049
|
-
* Destroy the graph instance and remove the related canvases.
|
|
2050
|
-
* @returns
|
|
2051
|
-
* @group Graph Instance
|
|
2052
|
-
*/
|
|
2053
|
-
destroy(callback) {
|
|
2054
|
-
// TODO: call the destroy functions after items' buildOut animations finished
|
|
2055
|
-
// setTimeout(() => {
|
|
2056
|
-
this.canvas.destroy();
|
|
2057
|
-
this.backgroundCanvas.destroy();
|
|
2058
|
-
this.transientCanvas.destroy();
|
|
2059
|
-
// clear history stack
|
|
2060
|
-
this.cleanHistory();
|
|
2061
|
-
callback === null || callback === void 0 ? void 0 : callback();
|
|
2062
|
-
// }, 500);
|
|
2063
|
-
this.hooks.destroy.emit({});
|
|
2064
|
-
// TODO: destroy controllers and off the listeners
|
|
2065
|
-
// this.dataController.destroy();
|
|
2066
|
-
// this.interactionController.destroy();
|
|
2067
|
-
// this.layoutController.destroy();
|
|
2068
|
-
// this.themeController.destroy();
|
|
2069
|
-
// this.itemController.destroy();
|
|
2070
|
-
// this.extensionController.destroy();
|
|
2071
|
-
this.destroyed = true;
|
|
1268
|
+
once(eventName, callback) {
|
|
1269
|
+
return super.once(eventName, callback);
|
|
2072
1270
|
}
|
|
2073
1271
|
}
|
|
2074
|
-
exports.
|
|
1272
|
+
exports.Graph = Graph;
|
|
2075
1273
|
//# sourceMappingURL=graph.js.map
|