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