@visuallyjs/browser-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/visuallyjs-theme.css +148 -0
- package/css/visuallyjs.css +1879 -0
- package/js/visuallyjs.browser-ui.cjs.js +143 -0
- package/js/visuallyjs.browser-ui.esm.js +143 -0
- package/package.json +16 -0
- package/types/browser-ui/base-dom-ui-layout-adapter.d.ts +14 -0
- package/types/browser-ui/browser-ui.d.ts +95 -0
- package/types/browser-ui/browser-util.d.ts +233 -0
- package/types/browser-ui/browser-visuallyjs-instance.d.ts +881 -0
- package/types/browser-ui/canvas-layout-adapter.d.ts +15 -0
- package/types/browser-ui/collicat.d.ts +245 -0
- package/types/browser-ui/components/controls/controls-component.d.ts +137 -0
- package/types/browser-ui/components/controls/copy-paste-controls-component.d.ts +9 -0
- package/types/browser-ui/components/controls/css-classes.d.ts +79 -0
- package/types/browser-ui/components/controls/index.d.ts +4 -0
- package/types/browser-ui/components/controls/svg-export-component.d.ts +60 -0
- package/types/browser-ui/components/edge-type-picker/edge-type-picker.d.ts +37 -0
- package/types/browser-ui/components/edge-type-picker/index.d.ts +1 -0
- package/types/browser-ui/components/index.d.ts +4 -0
- package/types/browser-ui/components/inspector/color-picker-tag.d.ts +32 -0
- package/types/browser-ui/components/inspector/definitions.d.ts +114 -0
- package/types/browser-ui/components/inspector/edge-type-tag.d.ts +15 -0
- package/types/browser-ui/components/inspector/index.d.ts +6 -0
- package/types/browser-ui/components/inspector/inspector.d.ts +138 -0
- package/types/browser-ui/components/inspector/shape-type-inspector.d.ts +43 -0
- package/types/browser-ui/components/inspector/vanilla-inspector.d.ts +39 -0
- package/types/browser-ui/components/palette/index.d.ts +2 -0
- package/types/browser-ui/components/palette/palette-content-generator.d.ts +14 -0
- package/types/browser-ui/components/palette/palette-options.d.ts +159 -0
- package/types/browser-ui/components/palette/palette.d.ts +126 -0
- package/types/browser-ui/connector-editor.d.ts +65 -0
- package/types/browser-ui/connector-editors/anchors.d.ts +31 -0
- package/types/browser-ui/connector-editors/css-constants.d.ts +33 -0
- package/types/browser-ui/connector-editors/definitions.d.ts +74 -0
- package/types/browser-ui/connector-editors/editor-base.d.ts +177 -0
- package/types/browser-ui/connector-editors/index.d.ts +52 -0
- package/types/browser-ui/connector-editors/util.d.ts +33 -0
- package/types/browser-ui/connector-editors-bezier/bezier-editor.d.ts +82 -0
- package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +42 -0
- package/types/browser-ui/connector-editors-bezier/index.d.ts +9 -0
- package/types/browser-ui/connector-editors-orthogonal/css-constants.d.ts +28 -0
- package/types/browser-ui/connector-editors-orthogonal/index.d.ts +9 -0
- package/types/browser-ui/connector-editors-orthogonal/orthogonal-editor.d.ts +86 -0
- package/types/browser-ui/connector-editors-straight/auto-split-mode.d.ts +24 -0
- package/types/browser-ui/connector-editors-straight/click-split-mode.d.ts +20 -0
- package/types/browser-ui/connector-editors-straight/css-constants.d.ts +30 -0
- package/types/browser-ui/connector-editors-straight/definitions.d.ts +69 -0
- package/types/browser-ui/connector-editors-straight/index.d.ts +11 -0
- package/types/browser-ui/connector-editors-straight/straight-editor.d.ts +42 -0
- package/types/browser-ui/constants.d.ts +79 -0
- package/types/browser-ui/copy-paste/clipboard.d.ts +34 -0
- package/types/browser-ui/copy-paste/index.d.ts +2 -0
- package/types/browser-ui/copy-paste/transformer.d.ts +14 -0
- package/types/browser-ui/css-constants.d.ts +436 -0
- package/types/browser-ui/d.d.ts +2 -0
- package/types/browser-ui/definitions.d.ts +442 -0
- package/types/browser-ui/dialogs/binder.d.ts +49 -0
- package/types/browser-ui/dialogs/constants.d.ts +51 -0
- package/types/browser-ui/dialogs/dialogs.d.ts +30 -0
- package/types/browser-ui/dialogs/index.d.ts +3 -0
- package/types/browser-ui/drag-manager-2.d.ts +54 -0
- package/types/browser-ui/edge-handler-base.d.ts +168 -0
- package/types/browser-ui/edge-input-handler.d.ts +116 -0
- package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +22 -0
- package/types/browser-ui/edge-mappings/index.d.ts +1 -0
- package/types/browser-ui/edge-relocate-handler.d.ts +51 -0
- package/types/browser-ui/element-drag-handler-2.d.ts +254 -0
- package/types/browser-ui/element-dragger.d.ts +45 -0
- package/types/browser-ui/element-facade.d.ts +11 -0
- package/types/browser-ui/event-manager.d.ts +50 -0
- package/types/browser-ui/fixed-layer.d.ts +107 -0
- package/types/browser-ui/group-layout-adapter.d.ts +19 -0
- package/types/browser-ui/html-element-overlay.d.ts +32 -0
- package/types/browser-ui/icons/definitions.d.ts +59 -0
- package/types/browser-ui/icons/icon-renderer.d.ts +43 -0
- package/types/browser-ui/icons/index.d.ts +2 -0
- package/types/browser-ui/index.d.ts +48 -0
- package/types/browser-ui/pan-zoom-options.d.ts +262 -0
- package/types/browser-ui/pan-zoom.d.ts +674 -0
- package/types/browser-ui/paper-renderer/definitions.d.ts +83 -0
- package/types/browser-ui/paper-renderer/index.d.ts +2 -0
- package/types/browser-ui/paper-renderer/paper.d.ts +50 -0
- package/types/browser-ui/pinch-listener.d.ts +33 -0
- package/types/browser-ui/plugins/background/available-backgrounds.d.ts +12 -0
- package/types/browser-ui/plugins/background/background-options.d.ts +62 -0
- package/types/browser-ui/plugins/background/background-plugin.d.ts +62 -0
- package/types/browser-ui/plugins/background/generated-grid-background.d.ts +230 -0
- package/types/browser-ui/plugins/background/index.d.ts +6 -0
- package/types/browser-ui/plugins/background/simple-background.d.ts +33 -0
- package/types/browser-ui/plugins/background/tiled-background.d.ts +118 -0
- package/types/browser-ui/plugins/browser-ui-plugin.d.ts +90 -0
- package/types/browser-ui/plugins/edge-routing/index.d.ts +66 -0
- package/types/browser-ui/plugins/index.d.ts +5 -0
- package/types/browser-ui/plugins/selected-edge-highlight/index.d.ts +1 -0
- package/types/browser-ui/plugins/selected-edge-highlight/selected-edge-highlight-plugin.d.ts +36 -0
- package/types/browser-ui/plugins/ui-states/index.d.ts +2 -0
- package/types/browser-ui/plugins/ui-states/ui-state.d.ts +14 -0
- package/types/browser-ui/plugins/ui-states/ui-states-plugin.d.ts +69 -0
- package/types/browser-ui/positioning-and-sizing-utils.d.ts +103 -0
- package/types/browser-ui/shape-library/index.d.ts +4 -0
- package/types/browser-ui/shape-library/shape-library-definitions.d.ts +243 -0
- package/types/browser-ui/shape-library/shape-library.d.ts +266 -0
- package/types/browser-ui/shape-library/shapes-basic.d.ts +7 -0
- package/types/browser-ui/shape-library/shapes-flowchart.d.ts +7 -0
- package/types/browser-ui/storage.d.ts +8 -0
- package/types/browser-ui/surface-renderer/anim/anim.d.ts +64 -0
- package/types/browser-ui/surface-renderer/anim/constants.d.ts +74 -0
- package/types/browser-ui/surface-renderer/anim/definitions.d.ts +134 -0
- package/types/browser-ui/surface-renderer/anim/index.d.ts +4 -0
- package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +23 -0
- package/types/browser-ui/surface-renderer/css-classes.d.ts +64 -0
- package/types/browser-ui/surface-renderer/decorators.d.ts +162 -0
- package/types/browser-ui/surface-renderer/definitions.d.ts +83 -0
- package/types/browser-ui/surface-renderer/diagrams/constants.d.ts +28 -0
- package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +528 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-cell.d.ts +123 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +116 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-palette.d.ts +11 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +112 -0
- package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +221 -0
- package/types/browser-ui/surface-renderer/diagrams/index.d.ts +25 -0
- package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +59 -0
- package/types/browser-ui/surface-renderer/diagrams/util.d.ts +15 -0
- package/types/browser-ui/surface-renderer/elastic-group-manager.d.ts +102 -0
- package/types/browser-ui/surface-renderer/index.d.ts +34 -0
- package/types/browser-ui/surface-renderer/params.d.ts +175 -0
- package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +26 -0
- package/types/browser-ui/surface-renderer/plugins/controls/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/drag-groups/drag-groups-plugin.d.ts +78 -0
- package/types/browser-ui/surface-renderer/plugins/drag-groups/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +25 -0
- package/types/browser-ui/surface-renderer/plugins/export-controls/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/index.d.ts +10 -0
- package/types/browser-ui/surface-renderer/plugins/lasso/index.d.ts +2 -0
- package/types/browser-ui/surface-renderer/plugins/lasso/lasso-plugin.d.ts +78 -0
- package/types/browser-ui/surface-renderer/plugins/lasso/lasso.d.ts +74 -0
- package/types/browser-ui/surface-renderer/plugins/miniview/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/miniview/miniview-plugin.d.ts +235 -0
- package/types/browser-ui/surface-renderer/plugins/palette/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +17 -0
- package/types/browser-ui/surface-renderer/plugins/pan-buttons/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +55 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/border-drag-handlers.d.ts +3 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +411 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/drag-handlers.d.ts +3 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/handle-gen.d.ts +15 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/index.d.ts +4 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/resizing-tools-plugin.d.ts +185 -0
- package/types/browser-ui/surface-renderer/plugins/resizing-tools/util.d.ts +16 -0
- package/types/browser-ui/surface-renderer/plugins/snaplines/index.d.ts +1 -0
- package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +128 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/definitions.d.ts +90 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/index.d.ts +2 -0
- package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +64 -0
- package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +127 -0
- package/types/browser-ui/surface-renderer/shape-palette.d.ts +55 -0
- package/types/browser-ui/surface-renderer/surface-decorator.d.ts +35 -0
- package/types/browser-ui/surface-renderer/surface-events.d.ts +9 -0
- package/types/browser-ui/surface-renderer/surface-render-options.d.ts +125 -0
- package/types/browser-ui/surface-renderer/surface.d.ts +665 -0
- package/types/browser-ui/svg-component.d.ts +6 -0
- package/types/browser-ui/svg-element-connector.d.ts +16 -0
- package/types/browser-ui/svg-element-overlay.d.ts +55 -0
- package/types/browser-ui/svg-export/definitions.d.ts +153 -0
- package/types/browser-ui/svg-export/image-export-ui.d.ts +20 -0
- package/types/browser-ui/svg-export/image-exporter.d.ts +15 -0
- package/types/browser-ui/svg-export/index.d.ts +6 -0
- package/types/browser-ui/svg-export/svg-export-ui.d.ts +11 -0
- package/types/browser-ui/svg-export/svg-exporter.d.ts +8 -0
- package/types/browser-ui/svg-export/util.d.ts +23 -0
- package/types/browser-ui/svg-util.d.ts +27 -0
- package/types/browser-ui/templating/browser-ui-recado.d.ts +48 -0
- package/types/browser-ui/templating/custom-tag-definition.d.ts +32 -0
- package/types/browser-ui/templating/index.d.ts +11 -0
- package/types/browser-ui/templating/recado-template-renderer.d.ts +69 -0
- package/types/browser-ui/ui-path.d.ts +57 -0
- package/types/browser-ui/util.d.ts +4 -0
- package/types/browser-ui/wheel-listener.d.ts +2 -0
- package/types/charts/area/area-chart.d.ts +85 -0
- package/types/charts/area/index.d.ts +1 -0
- package/types/charts/bar-and-column/bar-chart.d.ts +34 -0
- package/types/charts/bar-and-column/bar-plot.d.ts +90 -0
- package/types/charts/bar-and-column/column-chart.d.ts +35 -0
- package/types/charts/bar-and-column/index.d.ts +3 -0
- package/types/charts/base-chart.d.ts +395 -0
- package/types/charts/base-xy-chart.d.ts +224 -0
- package/types/charts/bubble/bubble-chart.d.ts +30 -0
- package/types/charts/bubble/definitions.d.ts +32 -0
- package/types/charts/bubble/index.d.ts +2 -0
- package/types/charts/category-value-chart.d.ts +146 -0
- package/types/charts/chart-exporter.d.ts +38 -0
- package/types/charts/chart-zoom-controls.d.ts +23 -0
- package/types/charts/constants.d.ts +16 -0
- package/types/charts/css-classes.d.ts +312 -0
- package/types/charts/datasource.d.ts +61 -0
- package/types/charts/definitions.d.ts +261 -0
- package/types/charts/domain_scale_utilities.d.ts +72 -0
- package/types/charts/dual-value-chart.d.ts +60 -0
- package/types/charts/gauge/definitions.d.ts +108 -0
- package/types/charts/gauge/gauge-chart.d.ts +91 -0
- package/types/charts/gauge/index.d.ts +2 -0
- package/types/charts/index.d.ts +25 -0
- package/types/charts/legend.d.ts +120 -0
- package/types/charts/line/index.d.ts +1 -0
- package/types/charts/line/line-chart.d.ts +79 -0
- package/types/charts/markers.d.ts +13 -0
- package/types/charts/pie/index.d.ts +1 -0
- package/types/charts/pie/pie-chart.d.ts +146 -0
- package/types/charts/plot.d.ts +75 -0
- package/types/charts/sankey/index.d.ts +1 -0
- package/types/charts/sankey/preprocessor.d.ts +37 -0
- package/types/charts/sankey/sankey.d.ts +208 -0
- package/types/charts/scatter/definitions.d.ts +6 -0
- package/types/charts/scatter/index.d.ts +2 -0
- package/types/charts/scatter/scatter-chart.d.ts +16 -0
- package/types/charts/series/array-based-series.d.ts +95 -0
- package/types/charts/series/collation-series.d.ts +24 -0
- package/types/charts/series/definitions.d.ts +52 -0
- package/types/charts/series/dual-value-chart-series.d.ts +26 -0
- package/types/charts/series/index.d.ts +7 -0
- package/types/charts/series/record-based-series.d.ts +58 -0
- package/types/charts/series/series.d.ts +66 -0
- package/types/charts/series/summing-collation-series.d.ts +31 -0
- package/types/charts/series/summing-series.d.ts +19 -0
- package/types/charts/series-based-chart.d.ts +59 -0
- package/types/charts/tooltip.d.ts +167 -0
- package/types/charts/util.d.ts +149 -0
- package/types/core/astar/astar-path-finder.d.ts +37 -0
- package/types/core/astar/astar-util.d.ts +100 -0
- package/types/core/astar/candidate-finder.d.ts +16 -0
- package/types/core/astar/candidate-sorter.d.ts +10 -0
- package/types/core/astar/definitions.d.ts +185 -0
- package/types/core/astar/index.d.ts +3 -0
- package/types/core/astar/path-to-segments.d.ts +45 -0
- package/types/core/autosaver.d.ts +67 -0
- package/types/core/color-generator.d.ts +66 -0
- package/types/core/constants.d.ts +181 -0
- package/types/core/csv-loader.d.ts +84 -0
- package/types/core/datamodel/data-model.d.ts +23 -0
- package/types/core/datamodel/vertex-definition.d.ts +40 -0
- package/types/core/datasource.d.ts +87 -0
- package/types/core/event-constants.d.ts +308 -0
- package/types/core/event-generator.d.ts +102 -0
- package/types/core/filterable-dataset.d.ts +38 -0
- package/types/core/geom.d.ts +278 -0
- package/types/core/index.d.ts +39 -0
- package/types/core/io.d.ts +106 -0
- package/types/core/layout/absolute-layout.d.ts +91 -0
- package/types/core/layout/abstract-layout-adapter.d.ts +17 -0
- package/types/core/layout/abstract-layout.d.ts +192 -0
- package/types/core/layout/circular/circular-layout.d.ts +31 -0
- package/types/core/layout/circular/index.d.ts +1 -0
- package/types/core/layout/empty-layout.d.ts +17 -0
- package/types/core/layout/force-directed/force-directed-layout.d.ts +148 -0
- package/types/core/layout/force-directed/index.d.ts +1 -0
- package/types/core/layout/grid/definitions.d.ts +81 -0
- package/types/core/layout/grid/grid-layout.d.ts +60 -0
- package/types/core/layout/grid/index.d.ts +2 -0
- package/types/core/layout/hierarchical/abstract-hierarchical-layout.d.ts +90 -0
- package/types/core/layout/hierarchical/balloon-layout.d.ts +62 -0
- package/types/core/layout/hierarchical/definitions.d.ts +45 -0
- package/types/core/layout/hierarchical/hierarchical-layout.d.ts +102 -0
- package/types/core/layout/hierarchical/index.d.ts +5 -0
- package/types/core/layout/hierarchical/parent-relative-placement.d.ts +96 -0
- package/types/core/layout/hierarchy/assign-layers-stage.d.ts +26 -0
- package/types/core/layout/hierarchy/crossing-stage.d.ts +78 -0
- package/types/core/layout/hierarchy/definitions.d.ts +261 -0
- package/types/core/layout/hierarchy/edge-routing.d.ts +25 -0
- package/types/core/layout/hierarchy/hierarchy-layout-stage.d.ts +9 -0
- package/types/core/layout/hierarchy/hierarchy-layout.d.ts +87 -0
- package/types/core/layout/hierarchy/index.d.ts +11 -0
- package/types/core/layout/hierarchy/model.d.ts +167 -0
- package/types/core/layout/hierarchy/parent-relative-placement.d.ts +69 -0
- package/types/core/layout/hierarchy/placement-stage.d.ts +82 -0
- package/types/core/layout/hierarchy/util.d.ts +13 -0
- package/types/core/layout/hierarchy/vertex-set.d.ts +45 -0
- package/types/core/layout/index.d.ts +10 -0
- package/types/core/layout/layouts.d.ts +10 -0
- package/types/core/magnetizer.d.ts +232 -0
- package/types/core/model/anchor.d.ts +38 -0
- package/types/core/model/cluster.d.ts +19 -0
- package/types/core/model/defs.d.ts +8 -0
- package/types/core/model/djikstra.d.ts +26 -0
- package/types/core/model/floyd-warshall.d.ts +15 -0
- package/types/core/model/graph.d.ts +1166 -0
- package/types/core/model/path.d.ts +227 -0
- package/types/core/params.d.ts +476 -0
- package/types/core/renderer.d.ts +74 -0
- package/types/core/router/common.d.ts +104 -0
- package/types/core/router/direct-router.d.ts +12 -0
- package/types/core/router/index.d.ts +3 -0
- package/types/core/router/orthogonal-router.d.ts +46 -0
- package/types/core/rtree/definitions.d.ts +24 -0
- package/types/core/rtree/hilbert.d.ts +9 -0
- package/types/core/rtree/index.d.ts +4 -0
- package/types/core/rtree/rtree.d.ts +102 -0
- package/types/core/rtree/util.d.ts +55 -0
- package/types/core/search/index.d.ts +1 -0
- package/types/core/search/visuallyjs-search.d.ts +167 -0
- package/types/core/selection.d.ts +394 -0
- package/types/core/templates/abstract-entry.d.ts +19 -0
- package/types/core/templates/comment-entry.d.ts +11 -0
- package/types/core/templates/core.d.ts +162 -0
- package/types/core/templates/custom-tag.d.ts +74 -0
- package/types/core/templates/defs.d.ts +123 -0
- package/types/core/templates/each-entry.d.ts +23 -0
- package/types/core/templates/element-entry.d.ts +18 -0
- package/types/core/templates/elements.d.ts +14 -0
- package/types/core/templates/executions.d.ts +100 -0
- package/types/core/templates/expressions.d.ts +47 -0
- package/types/core/templates/fake-dom.d.ts +42 -0
- package/types/core/templates/headless.d.ts +15 -0
- package/types/core/templates/if-entry.d.ts +25 -0
- package/types/core/templates/index.d.ts +14 -0
- package/types/core/templates/parser.d.ts +84 -0
- package/types/core/templates/text-entry.d.ts +17 -0
- package/types/core/templates/tmpl-entry.d.ts +13 -0
- package/types/core/toolkit.d.ts +1314 -0
- package/types/core/undo-redo/compound-action.d.ts +19 -0
- package/types/core/undo-redo/edge-action.d.ts +62 -0
- package/types/core/undo-redo/group-action.d.ts +60 -0
- package/types/core/undo-redo/move-action.d.ts +18 -0
- package/types/core/undo-redo/node-group-action.d.ts +62 -0
- package/types/core/undo-redo/port-action.d.ts +29 -0
- package/types/core/undo-redo/renderer-vertex-removed-action.d.ts +17 -0
- package/types/core/undo-redo/set-type-action.d.ts +14 -0
- package/types/core/undo-redo/undo-redo.d.ts +203 -0
- package/types/core/undo-redo/update-action.d.ts +20 -0
- package/types/core/undo-redo/vertex-update-action.d.ts +12 -0
- package/types/core/util.d.ts +661 -0
- package/types/index.d.ts +16 -0
- package/types/l.d.ts +2 -0
- package/types/test-support/index.d.ts +1 -0
- package/types/test-support/test-support.d.ts +833 -0
- package/types/ui/common/abstract-segment.d.ts +88 -0
- package/types/ui/common/anchor.d.ts +280 -0
- package/types/ui/common/connector.d.ts +106 -0
- package/types/ui/common/index.d.ts +5 -0
- package/types/ui/common/overlay.d.ts +117 -0
- package/types/ui/common/paint-style.d.ts +33 -0
- package/types/ui/connector-bezier/abstract-bezier-connector.d.ts +68 -0
- package/types/ui/connector-bezier/bezier-connector.d.ts +34 -0
- package/types/ui/connector-bezier/bezier-segment.d.ts +31 -0
- package/types/ui/connector-bezier/bezier.d.ts +129 -0
- package/types/ui/connector-bezier/index.d.ts +6 -0
- package/types/ui/connector-bezier/operations.d.ts +18 -0
- package/types/ui/connector-bezier/quadratic-bezier-connector.d.ts +35 -0
- package/types/ui/connector-orthogonal/default-orthogonal-path-compute.d.ts +11 -0
- package/types/ui/connector-orthogonal/definitions.d.ts +120 -0
- package/types/ui/connector-orthogonal/index.d.ts +7 -0
- package/types/ui/connector-orthogonal/modern-source-target-relocator.d.ts +37 -0
- package/types/ui/connector-orthogonal/operations.d.ts +49 -0
- package/types/ui/connector-orthogonal/stub-calculators.d.ts +12 -0
- package/types/ui/connector-orthogonal/utils.d.ts +134 -0
- package/types/ui/connector-orthogonal/vertex-avoidance.d.ts +29 -0
- package/types/ui/connector-straight/index.d.ts +2 -0
- package/types/ui/connector-straight/operations.d.ts +55 -0
- package/types/ui/connector-straight/straight-connector.d.ts +121 -0
- package/types/ui/copy-paste/clipboard.d.ts +45 -0
- package/types/ui/copy-paste/copy-data.d.ts +93 -0
- package/types/ui/copy-paste/index.d.ts +2 -0
- package/types/ui/core/callbacks.d.ts +48 -0
- package/types/ui/core/component/component.d.ts +115 -0
- package/types/ui/core/connector/abstract-connector.d.ts +66 -0
- package/types/ui/core/connector/arc-segment.d.ts +39 -0
- package/types/ui/core/connector/connection-impl.d.ts +81 -0
- package/types/ui/core/connector/connections.d.ts +113 -0
- package/types/ui/core/connector/connectors.d.ts +205 -0
- package/types/ui/core/connector/operations.d.ts +0 -0
- package/types/ui/core/connector/segments.d.ts +24 -0
- package/types/ui/core/connector/straight-segment.d.ts +32 -0
- package/types/ui/core/constants.d.ts +181 -0
- package/types/ui/core/context.d.ts +26 -0
- package/types/ui/core/core-events.d.ts +7 -0
- package/types/ui/core/core.d.ts +1734 -0
- package/types/ui/core/css-constants.d.ts +149 -0
- package/types/ui/core/defaults.d.ts +242 -0
- package/types/ui/core/definitions.d.ts +540 -0
- package/types/ui/core/event-constants.d.ts +510 -0
- package/types/ui/core/factory/anchor-record-factory.d.ts +17 -0
- package/types/ui/core/factory/continuous-anchors.d.ts +27 -0
- package/types/ui/core/factory/overlay-factory.d.ts +8 -0
- package/types/ui/core/grid-profile.d.ts +28 -0
- package/types/ui/core/group-collapse-expand.d.ts +23 -0
- package/types/ui/core/group-sizer.d.ts +9 -0
- package/types/ui/core/index.d.ts +45 -0
- package/types/ui/core/magnetize-profile.d.ts +82 -0
- package/types/ui/core/overlay/arrow-overlay.d.ts +34 -0
- package/types/ui/core/overlay/custom-overlay.d.ts +38 -0
- package/types/ui/core/overlay/diamond-overlay.d.ts +14 -0
- package/types/ui/core/overlay/dot-overlay.d.ts +54 -0
- package/types/ui/core/overlay/ellipse-overlay.d.ts +60 -0
- package/types/ui/core/overlay/label-overlay.d.ts +37 -0
- package/types/ui/core/overlay/overlay.d.ts +131 -0
- package/types/ui/core/overlay/plain-arrow-overlay.d.ts +15 -0
- package/types/ui/core/overlay/rectangle-overlay.d.ts +66 -0
- package/types/ui/core/params.d.ts +223 -0
- package/types/ui/core/router/astar-path-finder.d.ts +29 -0
- package/types/ui/core/router/base-router.d.ts +100 -0
- package/types/ui/core/router/default-router.d.ts +38 -0
- package/types/ui/core/router/index.d.ts +5 -0
- package/types/ui/core/router/router-utils.d.ts +118 -0
- package/types/ui/core/router/router.d.ts +30 -0
- package/types/ui/core/type-descriptors.d.ts +83 -0
- package/types/ui/core/ui-model.d.ts +65 -0
- package/types/ui/core/view/common-options.d.ts +15 -0
- package/types/ui/core/view/edge-options.d.ts +126 -0
- package/types/ui/core/view/events.d.ts +159 -0
- package/types/ui/core/view/group-options.d.ts +75 -0
- package/types/ui/core/view/index.d.ts +35 -0
- package/types/ui/core/view/node-options.d.ts +20 -0
- package/types/ui/core/view/node-or-port-options.d.ts +28 -0
- package/types/ui/core/view/port-options.d.ts +51 -0
- package/types/ui/core/view/vertex-options.d.ts +28 -0
- package/types/ui/core/viewport.d.ts +297 -0
- package/types/ui/index.d.ts +9 -0
- package/types/ui/plugins/definitions.d.ts +118 -0
- package/types/ui/plugins/index.d.ts +2 -0
- package/types/ui/plugins/plugins.d.ts +7 -0
- package/types/ui/property-mappings/definitions.d.ts +28 -0
- package/types/ui/property-mappings/index.d.ts +2 -0
- package/types/ui/property-mappings/property-mapper.d.ts +16 -0
- package/types/ui/util/index.d.ts +3 -0
- package/types/ui/util/property-tracker.d.ts +8 -0
- package/types/ui/util/svg-constants.d.ts +111 -0
- package/types/ui/util/util.d.ts +69 -0
- package/types/version.d.ts +1 -0
|
@@ -0,0 +1,1166 @@
|
|
|
1
|
+
import { ShortestPathResult } from "./djikstra";
|
|
2
|
+
import { Cluster } from "./cluster";
|
|
3
|
+
import { ObjectAnchorSpec } from "./anchor";
|
|
4
|
+
/**
|
|
5
|
+
* A function that can return the ID representing the given object data. The default implementation of this returns the value of the object's `id` property.
|
|
6
|
+
* @group Data Model
|
|
7
|
+
* @category Type Aliases
|
|
8
|
+
*/
|
|
9
|
+
export type IdFunction = (o: ObjectData) => string;
|
|
10
|
+
/**
|
|
11
|
+
* A function that can return the type representing the given object data. The default implementation of this returns the value of the object's `type` property.
|
|
12
|
+
* @group Data Model
|
|
13
|
+
* @category Type Aliases
|
|
14
|
+
*/
|
|
15
|
+
export type TypeFunction = (o: ObjectData) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Basic object data definition - a map of objects of any type keyed by strings.
|
|
18
|
+
* @group Data Model
|
|
19
|
+
* @category Type Aliases
|
|
20
|
+
*/
|
|
21
|
+
export type ObjectData = Record<string, any>;
|
|
22
|
+
/**
|
|
23
|
+
* Models an object that has an ID
|
|
24
|
+
* @group Data Model
|
|
25
|
+
* @category Type Aliases
|
|
26
|
+
*/
|
|
27
|
+
export interface HasId {
|
|
28
|
+
/**
|
|
29
|
+
* ID of the object.
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Models an object that has a type
|
|
35
|
+
* @group Data Model
|
|
36
|
+
* @category Type Aliases
|
|
37
|
+
*/
|
|
38
|
+
export interface HasType {
|
|
39
|
+
/**
|
|
40
|
+
* Type of the object.
|
|
41
|
+
*/
|
|
42
|
+
type: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Models an object that has an ID and a type.
|
|
46
|
+
* @group Data Model
|
|
47
|
+
* @category Type Aliases
|
|
48
|
+
*/
|
|
49
|
+
export interface HasIdAndType extends HasId, HasType {
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Models an object that has an x/y location.
|
|
53
|
+
* @group Data Model
|
|
54
|
+
* @category Type Aliases
|
|
55
|
+
*/
|
|
56
|
+
export interface HasXY {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Models an object that has a width and height
|
|
62
|
+
* @group Data Model
|
|
63
|
+
* @category Type Aliases
|
|
64
|
+
*/
|
|
65
|
+
export interface HasWidthHeight {
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Base interface for the result of some delete operation. All operations can result in the deletion of zero or more edges, and if the deletion was for a vertex then that vertex may have been inside some group.
|
|
71
|
+
*/
|
|
72
|
+
export interface Deletion {
|
|
73
|
+
/**
|
|
74
|
+
* Optional, provided if the deleted object was the child of a group.
|
|
75
|
+
*/
|
|
76
|
+
parentGroup?: Group;
|
|
77
|
+
/**
|
|
78
|
+
* List of edges that were deleted. Always present but may be empty.
|
|
79
|
+
*/
|
|
80
|
+
edges: Array<Edge>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The result of a node deletion.
|
|
84
|
+
*/
|
|
85
|
+
export interface NodeDeletion extends Deletion {
|
|
86
|
+
/**
|
|
87
|
+
* The node that was deleted.
|
|
88
|
+
*/
|
|
89
|
+
node: Node;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The result of a group deletion.
|
|
93
|
+
* @group Model
|
|
94
|
+
*/
|
|
95
|
+
export interface GroupDeletion extends Deletion {
|
|
96
|
+
/**
|
|
97
|
+
* The group that was deleted
|
|
98
|
+
*/
|
|
99
|
+
group: Group;
|
|
100
|
+
/**
|
|
101
|
+
* List of group's child nodes that were also deleted as a result of this group's deletion. This array is always present but may be empty: the group may have been empty, or the user may have instructed the model not to delete its child nodes.
|
|
102
|
+
*/
|
|
103
|
+
nodes: Array<NodeDeletion>;
|
|
104
|
+
/**
|
|
105
|
+
* List of group's child groups that were also deleted as a result of this group's deletion. This array is always present but may be empty: the group may have been empty, or the user may have instructed the model not to delete its child groups.
|
|
106
|
+
*/
|
|
107
|
+
nestedGroups: Array<GroupDeletion>;
|
|
108
|
+
/**
|
|
109
|
+
* List all nodes and groups that were deleted. Always present; may be empty.
|
|
110
|
+
*/
|
|
111
|
+
children: Array<Node | Group>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* for the given vertex, resolves the id of the node/group it belongs to - the vertex might be a port, which has
|
|
115
|
+
* a parent node or group.
|
|
116
|
+
* @param v
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
export declare function resolveNodeId(v: Vertex): string;
|
|
120
|
+
/**
|
|
121
|
+
* For the given vertex, resolves the node/group it pertains to. If the vertex is already a node/group, it is returned. Otherwise, if
|
|
122
|
+
* it is a port, the parent of the port is returned.
|
|
123
|
+
* @param v
|
|
124
|
+
* @group Data Model
|
|
125
|
+
* @category Utils
|
|
126
|
+
*/
|
|
127
|
+
export declare function resolveNode(v: Vertex): Node | Group;
|
|
128
|
+
/**
|
|
129
|
+
* For the given vertex, resolve its port id. If it is not a port, null is returned. If it is a port, its id is returned (without the parent vertex's id prefixed to it)
|
|
130
|
+
* @param v
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
export declare function resolvePortId(v: Vertex): string;
|
|
134
|
+
/**
|
|
135
|
+
* Returns whether or not the given object is a Node. This method is a type guard and after using this method to test an object it can subsequently be treated as a Node if the method returns true.
|
|
136
|
+
* @group Data Model
|
|
137
|
+
* @category Utils
|
|
138
|
+
* @param obj
|
|
139
|
+
*/
|
|
140
|
+
export declare function isNode(obj: any): obj is Node;
|
|
141
|
+
/**
|
|
142
|
+
* Returns whether or not the given object is a Node and it is inside a Group. This method is a type guard and after using this method to test an object it can subsequently be treated as a Node if the method returns true.
|
|
143
|
+
* @group Data Model
|
|
144
|
+
* @category Utils
|
|
145
|
+
* @param obj
|
|
146
|
+
*/
|
|
147
|
+
export declare function isNodeInsideAGroup(obj: Base): obj is Node;
|
|
148
|
+
/**
|
|
149
|
+
* Returns whether or not the given object is a Group. This method is a type guard and after using this method to test an object it can subsequently be treated as a Group if the method returns true.
|
|
150
|
+
* @group Data Model
|
|
151
|
+
* @category Utils
|
|
152
|
+
* @param obj
|
|
153
|
+
*/
|
|
154
|
+
export declare function isGroup(obj: any): obj is Group;
|
|
155
|
+
/**
|
|
156
|
+
* Returns whether or not the given object is a Group and is nested inside another group. This method is a type guard and after using this method to test an object it can subsequently be treated as a Group if the method returns true.
|
|
157
|
+
* @group Data Model
|
|
158
|
+
* @category Utils
|
|
159
|
+
* @param obj
|
|
160
|
+
*/
|
|
161
|
+
export declare function isNestedGroup(obj: Base): obj is Group;
|
|
162
|
+
/**
|
|
163
|
+
* Returns whether or not the given object is an Edge. This method is a type guard and after using this method to test an object it can subsequently be treated as an Edge if the method returns true.
|
|
164
|
+
* @group Data Model
|
|
165
|
+
* @category Utils
|
|
166
|
+
* @param obj
|
|
167
|
+
*/
|
|
168
|
+
export declare function isEdge(obj: any): obj is Edge;
|
|
169
|
+
/**
|
|
170
|
+
* Returns whether or not the given object is a Port. This method is a type guard and after using this method to test an object it can subsequently be treated as a Port if the method returns true.
|
|
171
|
+
* @group Data Model
|
|
172
|
+
* @category Utils
|
|
173
|
+
* @param obj
|
|
174
|
+
*/
|
|
175
|
+
export declare function isPort(obj: any): obj is Port;
|
|
176
|
+
/**
|
|
177
|
+
* Returns whether or not the given Vertex is a Node or Group (ie. not a Port). This method is a type guard and after using this method to test an object it can subsequently be treated as a Node if the method returns true.
|
|
178
|
+
* @group Data Model
|
|
179
|
+
* @category Utils
|
|
180
|
+
* @param v
|
|
181
|
+
*/
|
|
182
|
+
export declare function isNodeVertex(v: Vertex): v is Node;
|
|
183
|
+
/**
|
|
184
|
+
* Returns whether or not the given object is a Vertex. This method is a type guard and after using this method to test an object it can subsequently be treated as a Vertex if the method returns true.
|
|
185
|
+
* @param o
|
|
186
|
+
* @group Data Model
|
|
187
|
+
* @category Utils
|
|
188
|
+
*/
|
|
189
|
+
export declare function isVertex(o: any): o is Vertex;
|
|
190
|
+
/**
|
|
191
|
+
* @internal
|
|
192
|
+
*/
|
|
193
|
+
export interface InternalAddEdgeOptions {
|
|
194
|
+
source: Vertex | string;
|
|
195
|
+
target: Vertex | string;
|
|
196
|
+
geometry?: any;
|
|
197
|
+
data?: any;
|
|
198
|
+
cost?: number;
|
|
199
|
+
directed?: boolean;
|
|
200
|
+
transient?: boolean;
|
|
201
|
+
anchors?: {
|
|
202
|
+
source?: ObjectAnchorSpec;
|
|
203
|
+
target?: ObjectAnchorSpec;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @internal
|
|
208
|
+
* @param obj
|
|
209
|
+
*/
|
|
210
|
+
export declare function defaultIdFunction(obj: ObjectData): string;
|
|
211
|
+
/**
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
export interface GraphOptions {
|
|
215
|
+
id?: string;
|
|
216
|
+
defaultDirected?: boolean;
|
|
217
|
+
defaultCost?: number;
|
|
218
|
+
defaultIdFunction?: IdFunction;
|
|
219
|
+
typeFunction?: TypeFunction;
|
|
220
|
+
enableSubgraphs?: boolean;
|
|
221
|
+
portSeparator?: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* The super-interface of every object type in a Graph.
|
|
225
|
+
* @group Data Model
|
|
226
|
+
* @category Graph Objects
|
|
227
|
+
*/
|
|
228
|
+
export interface GraphObject {
|
|
229
|
+
/**
|
|
230
|
+
* Gets the object's "full" id. For many objects this is the same as `id`, but a Port's full ID is in the form `vertex.portId`.
|
|
231
|
+
*/
|
|
232
|
+
getFullId(): string;
|
|
233
|
+
/**
|
|
234
|
+
* Object's backing data
|
|
235
|
+
*/
|
|
236
|
+
data: any;
|
|
237
|
+
/**
|
|
238
|
+
* The kind of the object.
|
|
239
|
+
*/
|
|
240
|
+
objectType: string;
|
|
241
|
+
/**
|
|
242
|
+
* Object's ID, unique to some scope. All edges must have a unique ID, but an edge may have the same ID as some vertex. No two nodes and groups may have the same ID. Ports must have a unique ID on the vertex on which they reside.
|
|
243
|
+
*/
|
|
244
|
+
id: string;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* This is the base interface for objects in a Graph that can act as the terminus for an Edge.
|
|
248
|
+
* @group Data Model
|
|
249
|
+
* @category Graph Objects
|
|
250
|
+
*/
|
|
251
|
+
export interface AbstractEdgeTerminus extends GraphObject {
|
|
252
|
+
/**
|
|
253
|
+
* Gets edges attached to this terminus where this terminus is the source
|
|
254
|
+
*/
|
|
255
|
+
getSourceEdges(): Array<Edge>;
|
|
256
|
+
/**
|
|
257
|
+
* Gets edges attached to this terminus where this terminus is the target
|
|
258
|
+
*/
|
|
259
|
+
getTargetEdges(): Array<Edge>;
|
|
260
|
+
/**
|
|
261
|
+
* Gets edges attached to this terminus where this terminus is the source or target
|
|
262
|
+
*/
|
|
263
|
+
getAllEdges(): Array<Edge>;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Gets all Edges where this Vertex is either the source or the target of the Edge. Note that this does *not* retrieve Edges on any Ports associated with this Vertex - for that, see {@link getAllEdges}.
|
|
267
|
+
* @param v
|
|
268
|
+
* @param filter Optional function to test whether a given edge should be included.
|
|
269
|
+
* @returns List of matching edges.
|
|
270
|
+
* @group Data Model
|
|
271
|
+
* @category Utils
|
|
272
|
+
*/
|
|
273
|
+
export declare function getEdges(v: Vertex, filter?: (e: Edge) => boolean): Array<Edge>;
|
|
274
|
+
/**
|
|
275
|
+
* Retrieves all edges from the given vertex and all of its ports, optionally with a filter.
|
|
276
|
+
* @param v
|
|
277
|
+
* @param filter Optional function to test whether a given edge should be included.
|
|
278
|
+
* @group Data Model
|
|
279
|
+
* @category Utils
|
|
280
|
+
*/
|
|
281
|
+
export declare function getAllEdges(v: Vertex, filter?: (e: Edge) => boolean): Array<Edge>;
|
|
282
|
+
/**
|
|
283
|
+
* Gets all Edges where this Vertex is the source. Does not take into account edges connected to ports on the given vertex.
|
|
284
|
+
* @group Data Model
|
|
285
|
+
* @category Utils
|
|
286
|
+
*/
|
|
287
|
+
export declare function getSourceEdges(v: Vertex): Array<Edge>;
|
|
288
|
+
/**
|
|
289
|
+
* Gets all Edges where this Vertex is the target. Does not take into account edges connected to ports on the given vertex.
|
|
290
|
+
* @group Data Model
|
|
291
|
+
* @category Utils
|
|
292
|
+
*/
|
|
293
|
+
export declare function getTargetEdges(v: Vertex): Array<Edge>;
|
|
294
|
+
/**
|
|
295
|
+
* Gets all edges where this vertex, or one of its ports, is the source.
|
|
296
|
+
* @param v
|
|
297
|
+
* @group Data Model
|
|
298
|
+
* @category Utils
|
|
299
|
+
* @graphQuery
|
|
300
|
+
*/
|
|
301
|
+
export declare function getAllSourceEdges(v: Vertex): Edge[];
|
|
302
|
+
/**
|
|
303
|
+
* Gets all edges where this vertex, or one of its ports, is the target.
|
|
304
|
+
* @param v
|
|
305
|
+
* @group Data Model
|
|
306
|
+
* @category Utils
|
|
307
|
+
* @graphQuery
|
|
308
|
+
*/
|
|
309
|
+
export declare function getAllTargetEdges(v: Vertex): Edge[];
|
|
310
|
+
/**
|
|
311
|
+
* Gets edges connected to descendants of the given group.
|
|
312
|
+
* @param g Group to retrieve descendant edges for
|
|
313
|
+
* @param thisGroupOnly If true, the code only retrieves edges connected to vertices that are a direct child of this group. Otherwise, the code descends through all child groups.
|
|
314
|
+
* @param includePorts If true, the code will retrieve edges connected to the ports of any child vertex that is encountered as well as edges connected to the child vertex itself.
|
|
315
|
+
* @param filter Optional filter to use to exclude edges
|
|
316
|
+
* @group Data Model
|
|
317
|
+
* @category Utils
|
|
318
|
+
* @graphQuery
|
|
319
|
+
*/
|
|
320
|
+
export declare function getDescendantEdges(g: Group, thisGroupOnly?: boolean, includePorts?: boolean, filter?: (e: Edge) => boolean): Array<Edge>;
|
|
321
|
+
/**
|
|
322
|
+
* For the given vertex, calculate how deeply it is nested inside groups. A value of 0 means no nesting.
|
|
323
|
+
* @param v Vertex to test.
|
|
324
|
+
* @group Data Model
|
|
325
|
+
* @category Utils
|
|
326
|
+
* @graph
|
|
327
|
+
* @graphQuery
|
|
328
|
+
*/
|
|
329
|
+
export declare function calculateNestedDepth(v: Node | Group): number;
|
|
330
|
+
/**
|
|
331
|
+
* Gets a list of groups that are ancestors of the given node/group/port. The list of ancestors is ordered in terms of their proximity to the focus, ie. the first entry is the focus vertex's immediate parent.
|
|
332
|
+
* @param vertex
|
|
333
|
+
* @group Data Model
|
|
334
|
+
* @category Utils
|
|
335
|
+
* @graph
|
|
336
|
+
* @graphQuery
|
|
337
|
+
*/
|
|
338
|
+
export declare function getAncestors(vertex: Vertex): Array<Group>;
|
|
339
|
+
/**
|
|
340
|
+
* Returns whether or not `possibleAncestor` is in fact an ancestor of the given focus node/group
|
|
341
|
+
* @param focus
|
|
342
|
+
* @param possibleAncestor
|
|
343
|
+
* @group Data Model
|
|
344
|
+
* @category Utils
|
|
345
|
+
* @graph
|
|
346
|
+
* @graphQuery
|
|
347
|
+
*/
|
|
348
|
+
export declare function isAncestor(focus: Vertex, possibleAncestor: Group): boolean;
|
|
349
|
+
/**
|
|
350
|
+
* Determine whether the `possibleDescendant` is in fact a descendant of the `ancestor` group
|
|
351
|
+
* @param possibleDescendant Group to test
|
|
352
|
+
* @param ancestor Ancestor group
|
|
353
|
+
* @group Data Model
|
|
354
|
+
* @category Utils
|
|
355
|
+
* @graph
|
|
356
|
+
* @graphQuery
|
|
357
|
+
*/
|
|
358
|
+
export declare function isDescendantGroup(possibleDescendant: Group, ancestor: Group): boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Gets a list of nodes/groups that are descendants of the given group.
|
|
361
|
+
* @param vertex
|
|
362
|
+
* @group Data Model
|
|
363
|
+
* @category Utils
|
|
364
|
+
* @group
|
|
365
|
+
* @graphQuery
|
|
366
|
+
*/
|
|
367
|
+
export declare function getDescendants(vertex: Group): Array<Node | Group>;
|
|
368
|
+
/**
|
|
369
|
+
* Gets the list of vertices that are the targets of edges connected to this vertex as a source.
|
|
370
|
+
* @param obj The vertex to get downstream vertices for.
|
|
371
|
+
* @param vertexOnly If `obj` is a Node or Group, this method will automatically include vertices connected to ports on the node/group. Set this to true to suppress that behaviour.
|
|
372
|
+
* @graph
|
|
373
|
+
* @group Data Model
|
|
374
|
+
* @category Utils
|
|
375
|
+
* @graphQuery
|
|
376
|
+
*/
|
|
377
|
+
export declare function getDownstreamVertices(obj: Vertex, vertexOnly: boolean): Array<Vertex>;
|
|
378
|
+
/**
|
|
379
|
+
* Gets the list of vertices that are the sources of edges connected to this vertex as a target.
|
|
380
|
+
* @param obj The vertex to get upstream vertices for.
|
|
381
|
+
* @param vertexOnly If `obj` is a Node or Group, this method will automatically include vertices connected to ports on the node/group. Set this to true to suppress that behaviour.
|
|
382
|
+
* @graph
|
|
383
|
+
* @group Data Model
|
|
384
|
+
* @category Utils
|
|
385
|
+
* @graphQuery
|
|
386
|
+
*/
|
|
387
|
+
export declare function getUpstreamVertices(obj: Vertex, vertexOnly?: boolean): Array<Vertex>;
|
|
388
|
+
/**
|
|
389
|
+
* Gets the list of vertices that are attached to this vertex via an edge, either upstream or downstream.
|
|
390
|
+
* @param obj The vertex to get connected vertices for.
|
|
391
|
+
* @param vertexOnly If `obj` is a Node or Group, this method will automatically include vertices connected to ports on the node/group. Set this to true to suppress that behaviour.
|
|
392
|
+
* @graph
|
|
393
|
+
* @group Data Model
|
|
394
|
+
* @category Utils
|
|
395
|
+
* @graphQuery
|
|
396
|
+
*/
|
|
397
|
+
export declare function getConnectedVertices(obj: Vertex, vertexOnly?: boolean): Array<Vertex>;
|
|
398
|
+
/**
|
|
399
|
+
* Returns whether or not the two vertices are connected by an edge.
|
|
400
|
+
* @graph
|
|
401
|
+
* @param v1
|
|
402
|
+
* @param v2
|
|
403
|
+
* @group Data Model
|
|
404
|
+
* @category Utils
|
|
405
|
+
* @graphQuery
|
|
406
|
+
*/
|
|
407
|
+
export declare function areVerticesConnected(v1: Vertex, v2: Vertex): boolean;
|
|
408
|
+
/**
|
|
409
|
+
* Models a directed/undirected graph, consisting of a set of vertices and edges, which may be directed or undirected. Users of the API do not interact directly with this class; access is mediated via the VisuallyJsModel class.
|
|
410
|
+
* @group Data Model
|
|
411
|
+
* @category Graph Objects
|
|
412
|
+
*/
|
|
413
|
+
export declare class Graph {
|
|
414
|
+
nodes: Array<Node>;
|
|
415
|
+
id: string;
|
|
416
|
+
edges: Array<Edge>;
|
|
417
|
+
groups: Array<Group>;
|
|
418
|
+
_nodeMap: Map<string, Node>;
|
|
419
|
+
_edgeMap: Map<string, Edge>;
|
|
420
|
+
_groupMap: Map<string, Group>;
|
|
421
|
+
defaultDirected: boolean;
|
|
422
|
+
defaultCost: number;
|
|
423
|
+
_defaultIdFunction: IdFunction;
|
|
424
|
+
typeFunction: TypeFunction;
|
|
425
|
+
enableSubgraphs: boolean;
|
|
426
|
+
portSeparator: string;
|
|
427
|
+
_topLevelCache: Record<string, Vertex>;
|
|
428
|
+
private _removeFromTopLevelCache;
|
|
429
|
+
private _addToTopLevelCache;
|
|
430
|
+
private _clearTopLevelCache;
|
|
431
|
+
constructor(params: GraphOptions);
|
|
432
|
+
getIdFunction(): IdFunction;
|
|
433
|
+
setIdFunction(f: IdFunction): void;
|
|
434
|
+
setTypeFunction(f: TypeFunction): void;
|
|
435
|
+
/**
|
|
436
|
+
* Gets the type for some data, by running it through the current typeFunction.
|
|
437
|
+
* @param data Object to get type from.
|
|
438
|
+
* @returns The calculated type for the given object.
|
|
439
|
+
* @internal
|
|
440
|
+
*/
|
|
441
|
+
getType(data: ObjectData): string;
|
|
442
|
+
getId(data?: ObjectData, idFunction?: IdFunction): string;
|
|
443
|
+
getTopLevelElements(): Record<string, Vertex>;
|
|
444
|
+
/**
|
|
445
|
+
* Sets whether or not Nodes are Graphs themselves, and can have child Nodes. If you enable this then you cannot use slashes (/) in your Node ids, as they will be treated as components of a path to a Node in a nested Graph.
|
|
446
|
+
* @param enable True to enable, false to disable.
|
|
447
|
+
* @internal
|
|
448
|
+
*/
|
|
449
|
+
setEnableSubgraphs(enable: boolean): void;
|
|
450
|
+
/**
|
|
451
|
+
* Sets the character(s) used to separate ports from nodes in port ids. By default this is '.', ie a port is addressed as `nodeId.portId`. This may need to be changed depending on the data in your model.
|
|
452
|
+
* @param separator Separator to use.
|
|
453
|
+
* @internal
|
|
454
|
+
*/
|
|
455
|
+
setPortSeparator(separator: string): void;
|
|
456
|
+
/**
|
|
457
|
+
* Gets the current port separator.
|
|
458
|
+
* @returns Port separator string. Default is "."
|
|
459
|
+
* @internal
|
|
460
|
+
*/
|
|
461
|
+
getPortSeparator(): string;
|
|
462
|
+
/**
|
|
463
|
+
* Splits the given port id using the current portSeparator.
|
|
464
|
+
* @param portId Port ID to split.
|
|
465
|
+
* @returns An array of [ vertexId, portId], or [] if the portId was null.
|
|
466
|
+
* @internal
|
|
467
|
+
*/
|
|
468
|
+
splitPortId(portId: string): Array<string>;
|
|
469
|
+
/**
|
|
470
|
+
* Looks up a vertex identified by the port id, which is in full port id (vertexId.portId) format, returning null if nothing found.
|
|
471
|
+
* (Note that we show full port id format as vertexId.portId, but the '.' is just the default portSeparator; it is possible to change that
|
|
472
|
+
* to some other character)
|
|
473
|
+
* @param portId ID of the port to find a vertex for.
|
|
474
|
+
* @internal
|
|
475
|
+
*/
|
|
476
|
+
getVertexByPortId(portId: string): Vertex;
|
|
477
|
+
getVertex(e: string | Base, createPortsIfMissing?: boolean): Vertex;
|
|
478
|
+
clear(): void;
|
|
479
|
+
/**
|
|
480
|
+
* Gets all the nodes in the Graph.
|
|
481
|
+
* @internal
|
|
482
|
+
*/
|
|
483
|
+
getVertices(): Array<Node>;
|
|
484
|
+
/**
|
|
485
|
+
* Gets the count of nodes in the Graph.
|
|
486
|
+
* @internal
|
|
487
|
+
*/
|
|
488
|
+
getVertexCount(): number;
|
|
489
|
+
/**
|
|
490
|
+
* Returns the vertex at the given index (used for bulk init type purposes)
|
|
491
|
+
* @param index Index of the Node to retrieve
|
|
492
|
+
* @returns vertex at the given index.
|
|
493
|
+
* @internal
|
|
494
|
+
*/
|
|
495
|
+
getVertexAt(index: number): Node;
|
|
496
|
+
/**
|
|
497
|
+
* Returns the total number of Edges in the graph.
|
|
498
|
+
* @returns The total number of Edges.
|
|
499
|
+
* @internal
|
|
500
|
+
*/
|
|
501
|
+
getEdgeCount(): number;
|
|
502
|
+
/**
|
|
503
|
+
* Adds an edge to the graph.
|
|
504
|
+
* @param id ID for the edge.
|
|
505
|
+
* @param params Source, target, cost, directional etc
|
|
506
|
+
* @param idFunction
|
|
507
|
+
* @internal
|
|
508
|
+
*/
|
|
509
|
+
addEdge(params: InternalAddEdgeOptions, id?: string, idFunction?: IdFunction): Edge;
|
|
510
|
+
addNode(data?: ObjectData, idFunction?: IdFunction): Node;
|
|
511
|
+
/**
|
|
512
|
+
* Adds a list of Nodes to the Graph
|
|
513
|
+
* @param data List of data objects, one for each Node to be added.
|
|
514
|
+
* @param idFunction Optional function to use to retrieve ID from backing data. Defaults to retrieving `id` from data object.
|
|
515
|
+
* @internal
|
|
516
|
+
*/
|
|
517
|
+
addNodes(data: Array<ObjectData>, idFunction?: IdFunction): void;
|
|
518
|
+
/**
|
|
519
|
+
* Adds a Group to the Graph.
|
|
520
|
+
* @param data
|
|
521
|
+
* @param idFunction
|
|
522
|
+
* @internal
|
|
523
|
+
*/
|
|
524
|
+
addGroup(data: ObjectData, idFunction?: IdFunction): Group;
|
|
525
|
+
getGroupCount(): number;
|
|
526
|
+
/**
|
|
527
|
+
* Returns the Group at the given index.
|
|
528
|
+
* @param idx Index into group list
|
|
529
|
+
* @returns a Group, or null if not found.
|
|
530
|
+
* @internal
|
|
531
|
+
*/
|
|
532
|
+
getGroupAt(idx: number): Group;
|
|
533
|
+
/**
|
|
534
|
+
* Gets the Groups in the graph.
|
|
535
|
+
* @returns All the groups in the Graph.
|
|
536
|
+
* @internal
|
|
537
|
+
*/
|
|
538
|
+
getGroups(): Array<Group>;
|
|
539
|
+
$addMemberToGroup(v: Node, g: string | Group): void;
|
|
540
|
+
$addMembersToGroup(v: Array<Node>, g: Group): void;
|
|
541
|
+
$removeMemberFromGroup(v: string | Node): void;
|
|
542
|
+
$removeMembersFromGroup(v: Array<Node>): void;
|
|
543
|
+
getGroup(group: string | Group): Group;
|
|
544
|
+
/**
|
|
545
|
+
* Deletes a Group
|
|
546
|
+
* @param g Either a Group, or a Group id.
|
|
547
|
+
* @param removeMembers If true, also remove all the Nodes/Groups that are members of the Group.
|
|
548
|
+
* @internal
|
|
549
|
+
*/
|
|
550
|
+
deleteGroup(g: string | Group, removeMembers?: boolean): GroupDeletion;
|
|
551
|
+
/**
|
|
552
|
+
* @internal
|
|
553
|
+
* @param port
|
|
554
|
+
*/
|
|
555
|
+
deletePort(port: Port): Array<Edge>;
|
|
556
|
+
private $_removeNodeFromCache;
|
|
557
|
+
/**
|
|
558
|
+
* Deletes a Node
|
|
559
|
+
* @param vertex a Node
|
|
560
|
+
* @internal
|
|
561
|
+
*/
|
|
562
|
+
deleteNode(vertex: Node): NodeDeletion;
|
|
563
|
+
/**
|
|
564
|
+
* Deletes an Edge.
|
|
565
|
+
* @param edge Edge, or ID of Edge, to delete.
|
|
566
|
+
* @internal
|
|
567
|
+
*/
|
|
568
|
+
deleteEdge(edge: string | Edge): void;
|
|
569
|
+
/**
|
|
570
|
+
* Gets an Edge by id, or if the given object is already an Edge, hands that back.
|
|
571
|
+
* @param e ID of the Edge to retrieve, or an actual Edge, or some data from which an ID could be derived.
|
|
572
|
+
* @returns The requested Edge, if found, otherwise null.
|
|
573
|
+
* @internal
|
|
574
|
+
*/
|
|
575
|
+
getEdge(e: string | Edge | any): Edge;
|
|
576
|
+
/**
|
|
577
|
+
* For some given node, get a subset of edges that match the given filter function.
|
|
578
|
+
* @param params Method parameters
|
|
579
|
+
* @param params.source If true, only match edges for which this node is the source.
|
|
580
|
+
* @param params.target If true, only match edges for which this node is the target.
|
|
581
|
+
* @param params.filter Optional edge filter.
|
|
582
|
+
* @internal
|
|
583
|
+
*/
|
|
584
|
+
getEdges(params?: {
|
|
585
|
+
node?: Vertex | string;
|
|
586
|
+
source?: boolean;
|
|
587
|
+
target?: boolean;
|
|
588
|
+
filter?: (e: Edge) => boolean;
|
|
589
|
+
}): Array<Edge>;
|
|
590
|
+
/**
|
|
591
|
+
* Gets every edge in the Graph.
|
|
592
|
+
* @internal
|
|
593
|
+
*/
|
|
594
|
+
getAllEdges(): Array<Edge>;
|
|
595
|
+
/**
|
|
596
|
+
* @internal
|
|
597
|
+
* @param port
|
|
598
|
+
* @param newId
|
|
599
|
+
*/
|
|
600
|
+
renamePort(port: Port, newId: string): boolean;
|
|
601
|
+
/**
|
|
602
|
+
* Finds the shortest path from source to target, using the Djikstra algorithm.
|
|
603
|
+
* @param source Source Node or Node ID.
|
|
604
|
+
* @param target Target Node or Node ID.
|
|
605
|
+
* @param strict Defaults to true. Sets whether or not paths are searched strictly by the given source/target. If, for instance, you supply a node as the source, but there are only edges connected to ports on that node, by default these edges will be ignored. Switching `strict` to false will mean these edges are considered.
|
|
606
|
+
* @param nodeFilter Optional function that is given each Node's backing data and asked to return true or false - true means include the Node, false means exclude it.
|
|
607
|
+
* @param edgeFilter Optional function that is given each Edge's backing data and asked to return true or false - true means include the Edge, false means exclude it.
|
|
608
|
+
* @returns A ShortestPathResult object.
|
|
609
|
+
* @internal
|
|
610
|
+
* @graphQuery
|
|
611
|
+
*/
|
|
612
|
+
findPath(source: string | Vertex, target: string | Vertex, strict?: boolean, nodeFilter?: Function, edgeFilter?: Function): ShortestPathResult;
|
|
613
|
+
/**
|
|
614
|
+
* Finds the distance between source and target.
|
|
615
|
+
* @param source Source vertex or vertex ID.
|
|
616
|
+
* @param target Target vertex or vertex ID.
|
|
617
|
+
* @param strict Defauls to true. Sets whether or not paths are searched strictly by the given source/target. If, for instance, you supply a node as the source, but there are only edges connected to ports on that node, by default these edges will be ignored. Switching `strict` to false will mean these edges are considered.
|
|
618
|
+
* @returns Distance from the source to the target.
|
|
619
|
+
* @internal
|
|
620
|
+
* @graphQuery
|
|
621
|
+
*/
|
|
622
|
+
getDistance(source: Vertex, target: Vertex, strict?: boolean): number;
|
|
623
|
+
/**
|
|
624
|
+
* Sets the target Group/Node/Port for some Edge.
|
|
625
|
+
* @param edge The Edge to change the target for
|
|
626
|
+
* @param o group/Node/Port/id for new Edge target
|
|
627
|
+
* @internal
|
|
628
|
+
*/
|
|
629
|
+
setTarget(edge: Edge, o: string | Vertex): {
|
|
630
|
+
old?: Vertex;
|
|
631
|
+
edge?: Edge;
|
|
632
|
+
new?: Vertex;
|
|
633
|
+
success: boolean;
|
|
634
|
+
};
|
|
635
|
+
/**
|
|
636
|
+
* Sets the source Group/Node/Port for some Edge.
|
|
637
|
+
* @param edge The Edge to change the source for
|
|
638
|
+
* @param o Group/Node/Port or id for new Edge source
|
|
639
|
+
* @internal
|
|
640
|
+
*/
|
|
641
|
+
setSource(edge: Edge, o: string | Vertex): {
|
|
642
|
+
old?: Vertex;
|
|
643
|
+
edge?: Edge;
|
|
644
|
+
new?: Vertex;
|
|
645
|
+
success: boolean;
|
|
646
|
+
};
|
|
647
|
+
/**
|
|
648
|
+
* Returns the path from source to target as a string.
|
|
649
|
+
* @returns Printed path. Mostly useful for debugging.
|
|
650
|
+
* @internal
|
|
651
|
+
*/
|
|
652
|
+
printPath(source: string | Vertex, target: string | Vertex): string;
|
|
653
|
+
/**
|
|
654
|
+
* Returns the `diameter` of the Graph.
|
|
655
|
+
* @param dontUseMax Whether or not to return Infinity if there is at least one pair of nodes for which there is no available path. Defaults to false.
|
|
656
|
+
* @returns Diameter of the Graph.
|
|
657
|
+
* @internal
|
|
658
|
+
* @graphQuery
|
|
659
|
+
*/
|
|
660
|
+
getDiameter(dontUseMax?: boolean): number;
|
|
661
|
+
/**
|
|
662
|
+
* @internal
|
|
663
|
+
* @param node
|
|
664
|
+
* @graphQuery
|
|
665
|
+
*/
|
|
666
|
+
getCentrality(node: Vertex | string): number;
|
|
667
|
+
/**
|
|
668
|
+
* Returns the indegree centrality of the given vertex (number of connections entering the vertex)
|
|
669
|
+
* @param vertex Vertex, or Vertex ID, to retrieve indegree centrality for.
|
|
670
|
+
* @returns Vertex's indegree centrality.
|
|
671
|
+
* @internal
|
|
672
|
+
* @graphQuery
|
|
673
|
+
*/
|
|
674
|
+
getIndegreeCentrality(vertex: Vertex | string): number;
|
|
675
|
+
/**
|
|
676
|
+
* Returns the outdegree centrality of the given vertex (number of connections exiting the vertex)
|
|
677
|
+
* @param vertex Vertex, or Vertex ID, to retrieve outdegree centrality for.
|
|
678
|
+
* @returns Vertex's indegree centrality.
|
|
679
|
+
* @internal
|
|
680
|
+
* @graphQuery
|
|
681
|
+
*/
|
|
682
|
+
getOutdegreeCentrality(vertex: Vertex | string): number;
|
|
683
|
+
/**
|
|
684
|
+
* Returns the Closeness centrality of the given vertex. This is the inverse of the vertex's farness.
|
|
685
|
+
* @param vertex Vertex, or Vertex ID, to retrieve closeness for.
|
|
686
|
+
* @returns Node's "closeness".
|
|
687
|
+
* @see getFarness
|
|
688
|
+
* @internal
|
|
689
|
+
* @graphQuery
|
|
690
|
+
*/
|
|
691
|
+
getCloseness(vertex: Vertex | string): number;
|
|
692
|
+
/**
|
|
693
|
+
* Returns the farness centrality of the given node, ie. the sum of its distance from all other nodes, where the distance from one vertex to another is given by the associated cost of the Edge joining the two nodes.
|
|
694
|
+
* @param vertex Vertex, or Vertex ID, to retrieve farness for.
|
|
695
|
+
* @returns Vertex's "farness".
|
|
696
|
+
* @internal
|
|
697
|
+
* @graphQuery
|
|
698
|
+
*/
|
|
699
|
+
getFarness(vertex: Vertex | string): number;
|
|
700
|
+
/**
|
|
701
|
+
* Returns the betweenness centrality of the given node.
|
|
702
|
+
* @param vertex Vertex, or Vertex ID, to retrieve betweenness centrality for.
|
|
703
|
+
* @returns Vertex's "betweenness" centrality.
|
|
704
|
+
* @internal
|
|
705
|
+
* @graphQuery
|
|
706
|
+
*/
|
|
707
|
+
getBetweenness(vertex: Vertex | string): number;
|
|
708
|
+
inspect(): string;
|
|
709
|
+
/**
|
|
710
|
+
* Serialize the graph.
|
|
711
|
+
* @internal
|
|
712
|
+
*/
|
|
713
|
+
serialize(): any;
|
|
714
|
+
/**
|
|
715
|
+
* Calculates "clusters" of nodes (and groups), where a 'cluster' is a set of Nodes/Groups that are connected. Direction of connections is not taken into account. Nodes that are children of Groups are included in all cluster calculations, which might cause some weird situations, but this functionality is mostly intended just for Nodes anyway.
|
|
716
|
+
* @returns An array of Clusters
|
|
717
|
+
* @internal
|
|
718
|
+
* @graphQuery
|
|
719
|
+
*/
|
|
720
|
+
getClusters(): Array<Cluster>;
|
|
721
|
+
/**
|
|
722
|
+
* Get the cluster containing the given vertex.
|
|
723
|
+
* @param seed
|
|
724
|
+
* @graphQuery
|
|
725
|
+
*/
|
|
726
|
+
getCluster(seed: Vertex): Cluster;
|
|
727
|
+
private _getClusters;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Base class for model objects.
|
|
731
|
+
* @group Data Model
|
|
732
|
+
* @category Graph Objects
|
|
733
|
+
*/
|
|
734
|
+
export declare abstract class Base {
|
|
735
|
+
protected graph: Graph;
|
|
736
|
+
data: ObjectData;
|
|
737
|
+
atts: Map<string, string>;
|
|
738
|
+
/**
|
|
739
|
+
* Object's type.
|
|
740
|
+
*/
|
|
741
|
+
type: string;
|
|
742
|
+
abstract objectType: string;
|
|
743
|
+
abstract getFullId(): string;
|
|
744
|
+
protected constructor(graph: Graph, data?: ObjectData);
|
|
745
|
+
setAttribute(key: string, value: string): void;
|
|
746
|
+
getAttribute(key: string): string;
|
|
747
|
+
getType(): string;
|
|
748
|
+
/**
|
|
749
|
+
* @internal
|
|
750
|
+
* @param t
|
|
751
|
+
*/
|
|
752
|
+
setType(t: string): void;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Base vertex class, extended by Port and Node (which is itself extended by Group). A vertex models some entity in your app, and may have one or more edges to other vertices.
|
|
756
|
+
* @group Data Model
|
|
757
|
+
* @category Graph Objects
|
|
758
|
+
*/
|
|
759
|
+
export declare abstract class Vertex extends Base implements AbstractEdgeTerminus, HasId {
|
|
760
|
+
graph: Graph;
|
|
761
|
+
/**
|
|
762
|
+
* The vertex's id. Must be a string.
|
|
763
|
+
*/
|
|
764
|
+
id: string;
|
|
765
|
+
/**
|
|
766
|
+
* Transient vertices are created at various points in the lifecycle of a renderer, such as dragging new edges, and are not exported in the dataset
|
|
767
|
+
* @internal
|
|
768
|
+
*/
|
|
769
|
+
transient?: boolean;
|
|
770
|
+
/**
|
|
771
|
+
* Transient vertices may have a renderer associated with them.
|
|
772
|
+
* @internal
|
|
773
|
+
*/
|
|
774
|
+
transientRenderer?: string;
|
|
775
|
+
/**
|
|
776
|
+
* Marks an internal dummy vertex, which is associated with a single edge and which will be removed from the dataset if the associated edge is removed.
|
|
777
|
+
* @internal
|
|
778
|
+
*/
|
|
779
|
+
dummy?: boolean;
|
|
780
|
+
/**
|
|
781
|
+
* @internal
|
|
782
|
+
*/
|
|
783
|
+
edges: Array<Edge>;
|
|
784
|
+
protected indegreeCentrality: number;
|
|
785
|
+
protected outdegreeCentrality: number;
|
|
786
|
+
nestedGraphs: Array<Graph>;
|
|
787
|
+
graphs: Array<Graph>;
|
|
788
|
+
protected constructor(graph: Graph, data?: ObjectData, idFunction?: IdFunction);
|
|
789
|
+
/**
|
|
790
|
+
* Returns the indegree centrality of this vertex.
|
|
791
|
+
*
|
|
792
|
+
*/
|
|
793
|
+
getIndegreeCentrality(): number;
|
|
794
|
+
/**
|
|
795
|
+
* Returns the outdegree centrality of this vertex.
|
|
796
|
+
*
|
|
797
|
+
*/
|
|
798
|
+
getOutdegreeCentrality(): number;
|
|
799
|
+
/**
|
|
800
|
+
* Adds a sub-graph to this vertex. If you provide an existing Graph instance that does not have
|
|
801
|
+
* an id, one will be assigned.
|
|
802
|
+
* @param g Either a Graph instance, or the id you wish to assign to a new Graph.
|
|
803
|
+
* @returns The Graph that was added.
|
|
804
|
+
* @internal
|
|
805
|
+
*/
|
|
806
|
+
addGraph(g: string | Graph): Graph;
|
|
807
|
+
/**
|
|
808
|
+
* Retrieves a sub-graph by id.
|
|
809
|
+
* @returns Sub-graph with the given id, null if not found.
|
|
810
|
+
* @internal
|
|
811
|
+
*/
|
|
812
|
+
getGraph(id: string): Graph;
|
|
813
|
+
/**
|
|
814
|
+
* Gets the Vertex's id, which, for Nodes and Groups, is just the `id` property. This method is overridden by Ports.
|
|
815
|
+
* @returns Vertex id
|
|
816
|
+
*/
|
|
817
|
+
getFullId(): string;
|
|
818
|
+
/**
|
|
819
|
+
* Gets all edges where this vertex is either the source or the target of the edge.
|
|
820
|
+
* Note that this does *not* retrieve edges on any ports associated with this Vertex - for that, @see #getAllEdges.
|
|
821
|
+
* @param params.filter Optional function to test whether a given edge should be included.
|
|
822
|
+
* @returns List of matching edges.
|
|
823
|
+
*/
|
|
824
|
+
getEdges(params?: {
|
|
825
|
+
filter: (e: Edge) => boolean;
|
|
826
|
+
}): Array<Edge>;
|
|
827
|
+
/**
|
|
828
|
+
* Gets all edges where this vertex - or any of its ports - are the source of target of the edge.
|
|
829
|
+
* @param filter
|
|
830
|
+
*/
|
|
831
|
+
abstract getAllEdges(filter?: (e: Edge) => boolean): Array<Edge>;
|
|
832
|
+
/**
|
|
833
|
+
* Gets all Edges where this Vertex is the source.
|
|
834
|
+
*/
|
|
835
|
+
getSourceEdges(): Array<Edge>;
|
|
836
|
+
/**
|
|
837
|
+
* Gets all Edges where this Vertex is the target.
|
|
838
|
+
*/
|
|
839
|
+
getTargetEdges(): Array<Edge>;
|
|
840
|
+
/**
|
|
841
|
+
* Adds an Edge to the vertex.
|
|
842
|
+
* @param edge The Edge to add.
|
|
843
|
+
* @internal
|
|
844
|
+
*/
|
|
845
|
+
$addEdge(edge: Edge): void;
|
|
846
|
+
/**
|
|
847
|
+
* Deletes an Edge from the Vertex.
|
|
848
|
+
* @param edge The Edge to delete.
|
|
849
|
+
* @internal
|
|
850
|
+
*/
|
|
851
|
+
$deleteEdge(edge: Edge): boolean;
|
|
852
|
+
/**
|
|
853
|
+
* Returns a string representation of the Vertex.
|
|
854
|
+
* @returns Vertex dumped to a string.
|
|
855
|
+
*/
|
|
856
|
+
inspect(): string;
|
|
857
|
+
isChildOf(v: Vertex | Graph | Edge): boolean;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* A Node is a Vertex that does not contain other nodes/groups.
|
|
861
|
+
* @group Data Model
|
|
862
|
+
* @category Graph Objects
|
|
863
|
+
*/
|
|
864
|
+
export declare class Node extends Vertex {
|
|
865
|
+
static objectType: string;
|
|
866
|
+
objectType: string;
|
|
867
|
+
/**
|
|
868
|
+
* Array of ports on the node, if any. This property should never be written by user code.
|
|
869
|
+
* @internal
|
|
870
|
+
*/
|
|
871
|
+
ports: Array<Port>;
|
|
872
|
+
/**
|
|
873
|
+
* Group the node is a member of, if any. This property should never be written by your code.
|
|
874
|
+
*
|
|
875
|
+
*/
|
|
876
|
+
group: Group;
|
|
877
|
+
/**
|
|
878
|
+
* @internal
|
|
879
|
+
*/
|
|
880
|
+
portMap: Record<string, Port>;
|
|
881
|
+
private defaultInternalCost;
|
|
882
|
+
private internalEdges;
|
|
883
|
+
constructor(graph: Graph, data?: any, idFunction?: IdFunction);
|
|
884
|
+
/**
|
|
885
|
+
* Gets all of the edges connected to this node, both on the node itself and on all of its ports.
|
|
886
|
+
* @param filter Optional Edge filter.
|
|
887
|
+
*
|
|
888
|
+
*/
|
|
889
|
+
getAllEdges(filter?: (e: Edge) => boolean): Array<Edge>;
|
|
890
|
+
/**
|
|
891
|
+
* Gets all of the Edges connected to this Node, both on the Node itself and on all of its Ports, where this node/port is the source of edge
|
|
892
|
+
*
|
|
893
|
+
*/
|
|
894
|
+
getAllSourceEdges(): Edge[];
|
|
895
|
+
/**
|
|
896
|
+
* Gets all of the Edges connected to this Node, both on the Node itself and on all of its Ports, where this node/port is the target of edge
|
|
897
|
+
*
|
|
898
|
+
*/
|
|
899
|
+
getAllTargetEdges(): Edge[];
|
|
900
|
+
/**
|
|
901
|
+
* Gets all Edges directly connected to this Vertex, ie. not to one of the Ports on the Vertex. This is an alias for `getEdges`.
|
|
902
|
+
* @param filter Optional Edge filter.
|
|
903
|
+
*
|
|
904
|
+
*/
|
|
905
|
+
getDirectEdges(filter?: (e: Edge) => boolean): Edge[];
|
|
906
|
+
/**
|
|
907
|
+
* Gets all Edges directly connected to this Vertex, ie. not to one of the Ports on the Vertex, where this Vertex is the source.
|
|
908
|
+
* This is an alias for `getSourceEdges`.
|
|
909
|
+
*
|
|
910
|
+
*/
|
|
911
|
+
getDirectSourceEdges(): Edge[];
|
|
912
|
+
/**
|
|
913
|
+
* Gets all Edges directly connected to this Vertex, ie. not to one of the Ports on the Vertex, where this Vertex is the target.
|
|
914
|
+
* This is an alias for `getTargetEdges`.
|
|
915
|
+
*
|
|
916
|
+
*/
|
|
917
|
+
getDirectTargetEdges(): Edge[];
|
|
918
|
+
/**
|
|
919
|
+
* Gets all Edges that are connected to Ports on this Node, not directly to the Node itself.
|
|
920
|
+
* @param filter Optional edge filter
|
|
921
|
+
*
|
|
922
|
+
*/
|
|
923
|
+
getPortEdges(filter?: (e: Edge) => boolean): Array<Edge>;
|
|
924
|
+
/**
|
|
925
|
+
* Gets all Edges that are connected to Ports on this Node, not directly to the Node itself, where the Port on this Node is the source of the edge.
|
|
926
|
+
*
|
|
927
|
+
*/
|
|
928
|
+
getPortSourceEdges(): Array<Edge>;
|
|
929
|
+
/**
|
|
930
|
+
* Gets all Edges that are connected to Ports on this Node, not directly to the Node itself, where the Port on this Node is the target of the edge.
|
|
931
|
+
*/
|
|
932
|
+
getPortTargetEdges(): Array<Edge>;
|
|
933
|
+
/**
|
|
934
|
+
* Gets this Node's "indegree" centrality; a measure of how many other Nodes are connected to this Node as the target of some Edge.
|
|
935
|
+
*/
|
|
936
|
+
getIndegreeCentrality(): number;
|
|
937
|
+
/**
|
|
938
|
+
* Gets this Node's "outdegree" centrality; a measure of how many other Nodes this Node is connected to as the source of some Edge.
|
|
939
|
+
*/
|
|
940
|
+
getOutdegreeCentrality(): number;
|
|
941
|
+
/**
|
|
942
|
+
* Gets all Ports associated with this Node.
|
|
943
|
+
*/
|
|
944
|
+
getPorts(): Array<Port>;
|
|
945
|
+
/**
|
|
946
|
+
* Adds a Port to the Node.
|
|
947
|
+
* @param data Optional data backing the Port. This object can be of any type you like.
|
|
948
|
+
* @param idFunction Optional function that can take a Port's data and return its ID. By default this looks for an `id` member in the backing data.
|
|
949
|
+
* @internal
|
|
950
|
+
*/
|
|
951
|
+
$addPort(data: any, idFunction?: IdFunction): Port;
|
|
952
|
+
/**
|
|
953
|
+
* Sets the underlying data for the Port with the given id. If the Port does not yet exist, it is created.
|
|
954
|
+
* @param id Id of the Port for which to set data.
|
|
955
|
+
* @param data Data to set for the Port.
|
|
956
|
+
* @internal
|
|
957
|
+
*/
|
|
958
|
+
$setPort(id: string, data?: any): Port;
|
|
959
|
+
/**
|
|
960
|
+
* Gets the Port with the given id, null if nothing found.
|
|
961
|
+
* @param portId Port id.
|
|
962
|
+
*
|
|
963
|
+
*/
|
|
964
|
+
getPort(portId: string): Port;
|
|
965
|
+
/**
|
|
966
|
+
* Change the ID of some port
|
|
967
|
+
* @param port
|
|
968
|
+
* @param newId
|
|
969
|
+
* @internal
|
|
970
|
+
*/
|
|
971
|
+
$renamePort(port: Port, newId: string): boolean;
|
|
972
|
+
/**
|
|
973
|
+
* Removes the given Port.
|
|
974
|
+
* @param port Either a Port, or a port id.
|
|
975
|
+
* @internal
|
|
976
|
+
*/
|
|
977
|
+
$removePort(port: string | Port): boolean;
|
|
978
|
+
/**
|
|
979
|
+
* Sets the default cost of travelling from one Port to another inside some Node. When a Node is created, this value is set to 1.
|
|
980
|
+
* @param cost Default internal cost.
|
|
981
|
+
* @internal
|
|
982
|
+
*/
|
|
983
|
+
$setDefaultInternalCost(cost: number): void;
|
|
984
|
+
/**
|
|
985
|
+
* Gets an "internal" Edge from one Port to another.
|
|
986
|
+
* @param source Source Port.
|
|
987
|
+
* @param target Target Port.
|
|
988
|
+
* @internal
|
|
989
|
+
*/
|
|
990
|
+
getInternalEdge(source: string | Port, target: string | Port): any;
|
|
991
|
+
/**
|
|
992
|
+
* Sets the cost and directedness of some internal Edge.
|
|
993
|
+
* @param source Source Port.
|
|
994
|
+
* @param target Target Port.
|
|
995
|
+
* @param cost Cost to set. If you leave this as null, the default will be used.
|
|
996
|
+
* @param directed Whether or not the internal Edge is directed.
|
|
997
|
+
* @internal
|
|
998
|
+
*/
|
|
999
|
+
$setInternalEdge(source: string | Port, target: string | Port, cost?: number, directed?: boolean): Edge;
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* A Port models a logical connection point on some vertex. Examples are things like columns on a database table, or yes/no outputs in a flowchart question, or, from the real world, TCP ports on a server
|
|
1003
|
+
* @group Data Model
|
|
1004
|
+
* @category Graph Objects
|
|
1005
|
+
*/
|
|
1006
|
+
export declare class Port extends Vertex {
|
|
1007
|
+
parent: Node;
|
|
1008
|
+
static objectType: string;
|
|
1009
|
+
objectType: string;
|
|
1010
|
+
constructor(parent: Node, data?: any, idFunction?: IdFunction);
|
|
1011
|
+
/**
|
|
1012
|
+
* Gets the vertex this Port belongs to. Remember that Group extends Node, so this could be a Group, but Ports cannot have child Ports.
|
|
1013
|
+
*/
|
|
1014
|
+
getParent(): Node;
|
|
1015
|
+
/**
|
|
1016
|
+
* Overrides the `getFullId` of Node to return a value in dotted notation of the form `nodeId.portId`.
|
|
1017
|
+
*/
|
|
1018
|
+
getFullId(): string;
|
|
1019
|
+
/**
|
|
1020
|
+
* Returns whether or not this port is a child of the given object.
|
|
1021
|
+
* @param v Object to test if this is a child.
|
|
1022
|
+
*/
|
|
1023
|
+
isChildOf(v: Vertex | Graph | Edge): boolean;
|
|
1024
|
+
/**
|
|
1025
|
+
* gets all the edges connected to this port, as source or target.
|
|
1026
|
+
* @param filter
|
|
1027
|
+
*/
|
|
1028
|
+
getAllEdges(filter?: (e: Edge) => boolean): Array<Edge>;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* A group is an extension of node that can contain other nodes and groups.
|
|
1032
|
+
* @group Data Model
|
|
1033
|
+
* @category Graph Objects
|
|
1034
|
+
*/
|
|
1035
|
+
export declare class Group extends Node {
|
|
1036
|
+
static objectType: string;
|
|
1037
|
+
objectType: string;
|
|
1038
|
+
/**
|
|
1039
|
+
* Members of the group. Do not write to, or manipulate in any way, this array.
|
|
1040
|
+
*
|
|
1041
|
+
*/
|
|
1042
|
+
members: Array<Node>;
|
|
1043
|
+
/**
|
|
1044
|
+
* @internal
|
|
1045
|
+
*/
|
|
1046
|
+
_memberMap: Record<string, Node>;
|
|
1047
|
+
constructor(graph: Graph, data?: any, idFunction?: IdFunction);
|
|
1048
|
+
/**
|
|
1049
|
+
* @internal
|
|
1050
|
+
* @param v
|
|
1051
|
+
*/
|
|
1052
|
+
$addMember(v: Node): boolean;
|
|
1053
|
+
/**
|
|
1054
|
+
* Gets how many members the group has.
|
|
1055
|
+
* @graphQuery
|
|
1056
|
+
*/
|
|
1057
|
+
getMemberCount(): number;
|
|
1058
|
+
/**
|
|
1059
|
+
* Gets the group members
|
|
1060
|
+
* @graphQuery
|
|
1061
|
+
*/
|
|
1062
|
+
getMembers(): Node[];
|
|
1063
|
+
/**
|
|
1064
|
+
* @internal
|
|
1065
|
+
* @param v
|
|
1066
|
+
*/
|
|
1067
|
+
$removeMember(v: string | Node): boolean;
|
|
1068
|
+
/**
|
|
1069
|
+
* Gets all the edges connecting to this group and any ports on the group.
|
|
1070
|
+
* @param filter Optional edge filter.
|
|
1071
|
+
* @graphQuery
|
|
1072
|
+
*/
|
|
1073
|
+
getAllDirectEdges(filter?: (e: Edge) => boolean): Array<Edge>;
|
|
1074
|
+
/**
|
|
1075
|
+
* Gets all the edges to/from the group, any ports the Group has, and any edges connected to all child vertices of the group.
|
|
1076
|
+
* @param filter Optional edge filter to apply to all members and the group itself.
|
|
1077
|
+
* @graphQuery
|
|
1078
|
+
*/
|
|
1079
|
+
getInternalEdges(filter?: (e: Edge) => boolean): Array<Edge>;
|
|
1080
|
+
}
|
|
1081
|
+
export interface EdgeOptions {
|
|
1082
|
+
graph: Graph;
|
|
1083
|
+
data?: any;
|
|
1084
|
+
source: Vertex;
|
|
1085
|
+
target: Vertex;
|
|
1086
|
+
cost?: number;
|
|
1087
|
+
directed?: boolean;
|
|
1088
|
+
id?: string;
|
|
1089
|
+
geometry?: any;
|
|
1090
|
+
transient?: boolean;
|
|
1091
|
+
anchors?: {
|
|
1092
|
+
source?: ObjectAnchorSpec;
|
|
1093
|
+
target?: ObjectAnchorSpec;
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* An edge connects two vertices.
|
|
1098
|
+
* @group Data Model
|
|
1099
|
+
* @category Graph Objects
|
|
1100
|
+
*/
|
|
1101
|
+
export declare class Edge extends Base {
|
|
1102
|
+
static objectType: string;
|
|
1103
|
+
objectType: string;
|
|
1104
|
+
/**
|
|
1105
|
+
* Source of the Edge.
|
|
1106
|
+
*/
|
|
1107
|
+
source: Vertex;
|
|
1108
|
+
/**
|
|
1109
|
+
* Target of the Edge.
|
|
1110
|
+
*/
|
|
1111
|
+
target: Vertex;
|
|
1112
|
+
/**
|
|
1113
|
+
* Edge cost
|
|
1114
|
+
*/
|
|
1115
|
+
cost: number;
|
|
1116
|
+
directed: boolean;
|
|
1117
|
+
id: string;
|
|
1118
|
+
geometry: any;
|
|
1119
|
+
transient: boolean;
|
|
1120
|
+
anchors?: {
|
|
1121
|
+
source?: ObjectAnchorSpec;
|
|
1122
|
+
target?: ObjectAnchorSpec;
|
|
1123
|
+
};
|
|
1124
|
+
constructor(params: EdgeOptions);
|
|
1125
|
+
/**
|
|
1126
|
+
* Gets the cost for this edge. Defaults to 1.
|
|
1127
|
+
* @returns Edge cost.
|
|
1128
|
+
*/
|
|
1129
|
+
getCost(): number;
|
|
1130
|
+
/**
|
|
1131
|
+
* Sets the cost for this edge.
|
|
1132
|
+
* @param c Edge cost.
|
|
1133
|
+
* @internal
|
|
1134
|
+
*/
|
|
1135
|
+
setCost(c: number): void;
|
|
1136
|
+
/**
|
|
1137
|
+
* Gets the id for this Edge.
|
|
1138
|
+
* @returns Edge id.
|
|
1139
|
+
*/
|
|
1140
|
+
getId(): string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Alias for the getId method.
|
|
1143
|
+
*/
|
|
1144
|
+
getFullId(): string;
|
|
1145
|
+
/**
|
|
1146
|
+
* @internal
|
|
1147
|
+
* @param id
|
|
1148
|
+
*/
|
|
1149
|
+
setId(id: string): void;
|
|
1150
|
+
/**
|
|
1151
|
+
* Gets whether or not the Edge is directed.
|
|
1152
|
+
* @returns True if the Edge is directed (unidirectional), false otherwise.
|
|
1153
|
+
*/
|
|
1154
|
+
isDirected(): boolean;
|
|
1155
|
+
/**
|
|
1156
|
+
* Sets whether or not the Edge is directed.
|
|
1157
|
+
* @internal
|
|
1158
|
+
*/
|
|
1159
|
+
setDirected(directed: boolean): void;
|
|
1160
|
+
/**
|
|
1161
|
+
* Returns a string representation of the Edge.
|
|
1162
|
+
* @returns Edge dumped to a string.
|
|
1163
|
+
* @internal
|
|
1164
|
+
*/
|
|
1165
|
+
inspect(): string;
|
|
1166
|
+
}
|