@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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common options for edge/node/group/port definitions in a view.
|
|
3
|
+
* @group Components
|
|
4
|
+
* @category View
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseViewObjectMapping {
|
|
7
|
+
/**
|
|
8
|
+
* Optional ID of one or more edge definitions to include in this definition. The child definition is merged on top of the parent definition(s). Circular references are not allowed and will throw an error.
|
|
9
|
+
*/
|
|
10
|
+
parent?: string | Array<string>;
|
|
11
|
+
/**
|
|
12
|
+
* When merging a type description into its parent(s), values in the child for `connector`, `anchor` and `anchors` will always overwrite any such values in the parent. But other values, such as `overlays`, will be merged with their parent's entry for that key. You can force a child's type to override _every_ corresponding value in its parent by setting `mergeStrategy:'override'`.
|
|
13
|
+
*/
|
|
14
|
+
mergeStrategy?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Edge } from "../../../core";
|
|
2
|
+
import { BaseViewObjectMapping } from "./common-options";
|
|
3
|
+
import { AnchorSpec, ConnectorSpec, OverlaySpec, PaintStyle } from "../../common";
|
|
4
|
+
import { OverlayVisibility } from "../overlay/overlay";
|
|
5
|
+
import { EdgeEventOptions } from "./events";
|
|
6
|
+
import { LineStyle } from "../core";
|
|
7
|
+
import { FontSpec } from "../../../browser-ui";
|
|
8
|
+
/**
|
|
9
|
+
* Definition of the function you can provide as `deleteConfirm` on an edge definition. VisuallyJs gives you the edge to be possibly deleted and the pointer event that instigated the deletion. If you wish to delete the edge you must invoke the `proceed()` function.
|
|
10
|
+
*/
|
|
11
|
+
export type EdgeDeleteConfirmationFunction = (params: {
|
|
12
|
+
edge: Edge;
|
|
13
|
+
e: Event;
|
|
14
|
+
}, proceed: () => any) => any;
|
|
15
|
+
/**
|
|
16
|
+
* The mapping for the definition of an edge inside a view.
|
|
17
|
+
* @group Components
|
|
18
|
+
* @category View
|
|
19
|
+
*/
|
|
20
|
+
export interface EdgeMapping extends BaseViewObjectMapping, LineStyle {
|
|
21
|
+
/**
|
|
22
|
+
* Name/definition of the connector to use. If you omit this, the default connector will be used.
|
|
23
|
+
*/
|
|
24
|
+
connector?: ConnectorSpec;
|
|
25
|
+
/**
|
|
26
|
+
* Spec for the anchor to use for both source and target for edges of this type.
|
|
27
|
+
*/
|
|
28
|
+
anchor?: AnchorSpec;
|
|
29
|
+
/**
|
|
30
|
+
* [source, target] anchor specs edges of this type.
|
|
31
|
+
*/
|
|
32
|
+
anchors?: [AnchorSpec, AnchorSpec];
|
|
33
|
+
/**
|
|
34
|
+
* Paint style to use for the edge.
|
|
35
|
+
*/
|
|
36
|
+
paintStyle?: PaintStyle;
|
|
37
|
+
/**
|
|
38
|
+
* Paint style to use for the edge when the pointer is hovering over it.
|
|
39
|
+
*/
|
|
40
|
+
hoverPaintStyle?: PaintStyle;
|
|
41
|
+
/**
|
|
42
|
+
* Array of overlays to add to edges of this type.
|
|
43
|
+
*/
|
|
44
|
+
overlays?: Array<OverlaySpec>;
|
|
45
|
+
/**
|
|
46
|
+
* Optional overlay to place at the source of an edge of this type. Location will be set to 0 and direction will be set to -1. This is a shorthand for declaring an overlay at location 0 in the overlays array.
|
|
47
|
+
*/
|
|
48
|
+
sourceMarker?: OverlaySpec;
|
|
49
|
+
/**
|
|
50
|
+
* Optional overlay to place at the target of an edge of this type. Location will be set to 1 and direction will be set to 1. This is a shorthand for declaring an overlay at location 1 in the overlays array.
|
|
51
|
+
*/
|
|
52
|
+
targetMarker?: OverlaySpec;
|
|
53
|
+
/**
|
|
54
|
+
* CSS class to add to edges of the type in the UI
|
|
55
|
+
*/
|
|
56
|
+
cssClass?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Whether or not edges of this type should be detachable with the mouse. Defaults to true.
|
|
59
|
+
*/
|
|
60
|
+
detachable?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional label to use for the edge. If this is set, a label overlay will be created and the value of `label` will be used as the overlay's label. This value can be parameterised, in order to extract a value from the edge's backing data, eg. if you set `label:"{{name}}"` then VisuallyJs would attempt to extract a property with key `name` from the edge's backing data, and use that property's value as the label.
|
|
63
|
+
*/
|
|
64
|
+
label?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Optional css class to set on the label overlay created if `label` is set. This is a static string and does not support parameterisation like `label` does.
|
|
67
|
+
*/
|
|
68
|
+
labelClass?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Optional location for the label. If not provided this defaults to 0.5, but the label location can be controlled via the `labelLocationAttribute`.
|
|
71
|
+
*/
|
|
72
|
+
labelLocation?: number;
|
|
73
|
+
/**
|
|
74
|
+
* This defaults to `labelLocation`, and indicates the name of a property whose value can be expected to hold the location at which the label overlay should be located. The default value for this is `labelLocation`, but the key here is that VisuallyJs looks in the edge data for `labelLocation`, so the location is dynamic, and can be changed by updating `labelLocation`. This parameter allows you to change the name of the property that VisuallyJs will look for in the edge data.
|
|
75
|
+
*/
|
|
76
|
+
labelLocationAttribute?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Optional spec for label font. Will use browser defaults if not specified (or CSS, but remember that CSS is not taken into account when you export an SVG from a diagram or an app using an SVG container)
|
|
79
|
+
*/
|
|
80
|
+
labelFont?: FontSpec;
|
|
81
|
+
/**
|
|
82
|
+
* Optional width of the edge's outline. Defaults to 0.
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* Whether or not when a user detaches a edge of this type it should be automatically reattached. Defaults to false.
|
|
86
|
+
*/
|
|
87
|
+
reattach?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* By default, an SVG element will be used for an edge's label overlay. This is good because the label can be exported as part of an SVG export of your canvas. If you wish to use an HTML element instead, set this flag.
|
|
90
|
+
*/
|
|
91
|
+
useHTMLLabel?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* If true, the edge will be routed to avoid any vertices. Note that if your edge has any user edits, or was loaded with a path specified, the edge will not be routed to avoid vertices.
|
|
94
|
+
*/
|
|
95
|
+
avoidVertices?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Optional delete button.
|
|
98
|
+
*/
|
|
99
|
+
deleteButton?: boolean | OverlayVisibility;
|
|
100
|
+
/**
|
|
101
|
+
* Location for an edge's delete button, if applicable. Defaults to 0.1. You can supply an array of locations if you want multiple buttons.
|
|
102
|
+
*/
|
|
103
|
+
deleteButtonLocation?: number | Array<number>;
|
|
104
|
+
/**
|
|
105
|
+
* An optional function to invoke if the user presses the delete button on some edge. When this is present and the user clicks an edge delete button, instead of just deleting the edge, this function is invoked. It is passed the edge that is a candidate for deletion, and a function which you must invoke if you wish to proceed.
|
|
106
|
+
* @param e
|
|
107
|
+
* @param proceed
|
|
108
|
+
*/
|
|
109
|
+
deleteConfirm?: EdgeDeleteConfirmationFunction;
|
|
110
|
+
/**
|
|
111
|
+
* Optional class name to set on the delete button. Defaults to "vjs-edge-delete".
|
|
112
|
+
*/
|
|
113
|
+
deleteButtonClass?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Whether or not to allow this type of edge to have a source and/or target in whitespace rather than connected to a vertex. Defaults to false. When this is set to true, a user may drag a new edge of this type and drop it into whitespace, and they may also - subject to whether or not the edge is detachable - detach an edge of this type via the mouse/pointer events, and drop into whitespace. If you do not need this level of control you can also use the `allowUnattached` flag in the `edges` section of the UI render options. If you have this set on an edge type, it will override `allowUnattached` from the edges UI options.
|
|
116
|
+
*/
|
|
117
|
+
allowUnattached?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Optional map of event bindings.
|
|
120
|
+
*/
|
|
121
|
+
events?: EdgeEventOptions;
|
|
122
|
+
/**
|
|
123
|
+
* Whether or not to ignore (ie. exclude from the display) edges of this type.
|
|
124
|
+
*/
|
|
125
|
+
ignore?: boolean;
|
|
126
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { EVENT_GROUP_MOVE_END, EVENT_GROUP_MOVE_START, EVENT_NODE_MOVE_END, EVENT_NODE_MOVE_START, Group, Port, Node, VisuallyJsModel, Edge } from "../../../core";
|
|
2
|
+
import { EVENT_CONTEXTMENU, EVENT_DBLTAP, EVENT_TAP, EVENT_VERTEX_CLICK, EVENT_MOUSEOUT, EVENT_MOUSEUP, EVENT_MOUSEOVER, EVENT_MOUSEMOVE, EVENT_VERTEX_DBLCLICK, EVENT_VERTEX_DBLTAP, EVENT_VERTEX_CONTEXTMENU, EVENT_VERTEX_MOUSEMOVE, EVENT_VERTEX_MOUSEOVER, EVENT_VERTEX_MOUSEOUT, EVENT_VERTEX_TAP, EVENT_EDGE_CLICK, EVENT_EDGE_DBLCLICK, EVENT_EDGE_TAP, EVENT_EDGE_MOUSEDOWN, EVENT_EDGE_MOUSEUP, EVENT_EDGE_DBLTAP, EVENT_EDGE_MOUSEOVER, EVENT_EDGE_MOUSEOUT, EVENT_CANVAS_CLICK, EVENT_CANVAS_DBLCLICK, EVENT_PAN, EVENT_CLICK, EVENT_DBLCLICK, EVENT_MOUSEDOWN } from "../event-constants";
|
|
3
|
+
import { UICore } from "../core";
|
|
4
|
+
import { Connection } from "../connector/connection-impl";
|
|
5
|
+
/**
|
|
6
|
+
* Events that can be bound in UI render options.
|
|
7
|
+
* @group Events
|
|
8
|
+
*/
|
|
9
|
+
export type BindableRenderEvent = typeof EVENT_VERTEX_CLICK | typeof EVENT_VERTEX_DBLCLICK | typeof EVENT_VERTEX_CONTEXTMENU | typeof EVENT_VERTEX_DBLTAP | typeof EVENT_VERTEX_MOUSEMOVE | typeof EVENT_VERTEX_MOUSEOUT | typeof EVENT_VERTEX_MOUSEOVER | typeof EVENT_VERTEX_TAP | typeof EVENT_EDGE_CLICK | typeof EVENT_EDGE_DBLCLICK | typeof EVENT_EDGE_TAP | typeof EVENT_EDGE_DBLTAP | typeof EVENT_EDGE_MOUSEDOWN | typeof EVENT_EDGE_MOUSEUP | typeof EVENT_EDGE_MOUSEOVER | typeof EVENT_EDGE_MOUSEOUT | typeof EVENT_CANVAS_CLICK | typeof EVENT_CANVAS_DBLCLICK | typeof EVENT_PAN | typeof EVENT_NODE_MOVE_END | typeof EVENT_GROUP_MOVE_END | typeof EVENT_NODE_MOVE_START | typeof EVENT_GROUP_MOVE_START;
|
|
10
|
+
/**
|
|
11
|
+
* Events that can be bound in a view.
|
|
12
|
+
* @group Events
|
|
13
|
+
*/
|
|
14
|
+
export type BindableViewEvent = typeof EVENT_CLICK | typeof EVENT_DBLCLICK | typeof EVENT_TAP | typeof EVENT_DBLTAP | typeof EVENT_CONTEXTMENU | typeof EVENT_MOUSEDOWN | typeof EVENT_MOUSEOUT | typeof EVENT_MOUSEUP | typeof EVENT_MOUSEOVER | typeof EVENT_MOUSEMOVE;
|
|
15
|
+
/**
|
|
16
|
+
* The payload passed to a {@link NodeEventCallback}
|
|
17
|
+
*/
|
|
18
|
+
export interface NodeEventCallbackPayload<EL> {
|
|
19
|
+
/**
|
|
20
|
+
* Element that represents the vertex in the UI
|
|
21
|
+
*/
|
|
22
|
+
el: EL;
|
|
23
|
+
/**
|
|
24
|
+
* The model object for the vertex
|
|
25
|
+
*/
|
|
26
|
+
obj: Node;
|
|
27
|
+
/**
|
|
28
|
+
* The pointer event that caused the event handler to be invoked
|
|
29
|
+
*/
|
|
30
|
+
e: MouseEvent;
|
|
31
|
+
/**
|
|
32
|
+
* The underlying VisuallyJs model
|
|
33
|
+
*/
|
|
34
|
+
model: VisuallyJsModel;
|
|
35
|
+
/**
|
|
36
|
+
* The UI that rendered this vertex
|
|
37
|
+
*/
|
|
38
|
+
ui: UICore<EL>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The payload passed to a {@link GroupEventCallback}
|
|
42
|
+
*/
|
|
43
|
+
export interface GroupEventCallbackPayload<EL> {
|
|
44
|
+
/**
|
|
45
|
+
* Element that represents the vertex in the UI
|
|
46
|
+
*/
|
|
47
|
+
el: EL;
|
|
48
|
+
/**
|
|
49
|
+
* The group in the model
|
|
50
|
+
*/
|
|
51
|
+
obj: Group;
|
|
52
|
+
/**
|
|
53
|
+
* The pointer event that caused the event handler to be invoked
|
|
54
|
+
*/
|
|
55
|
+
e: MouseEvent;
|
|
56
|
+
/**
|
|
57
|
+
* The underlying VisuallyJs model
|
|
58
|
+
*/
|
|
59
|
+
model: VisuallyJsModel;
|
|
60
|
+
/**
|
|
61
|
+
* The UI that rendered this vertex
|
|
62
|
+
*/
|
|
63
|
+
ui: UICore<EL>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The payload passed to a {@link PortEventCallback}
|
|
67
|
+
*/
|
|
68
|
+
export interface PortEventCallbackPayload<EL> {
|
|
69
|
+
/**
|
|
70
|
+
* Element that represents the vertex in the UI
|
|
71
|
+
*/
|
|
72
|
+
el: EL;
|
|
73
|
+
/**
|
|
74
|
+
* The group in the model
|
|
75
|
+
*/
|
|
76
|
+
obj: Port;
|
|
77
|
+
/**
|
|
78
|
+
* The pointer event that caused the event handler to be invoked
|
|
79
|
+
*/
|
|
80
|
+
e: MouseEvent;
|
|
81
|
+
/**
|
|
82
|
+
* The underlying VisuallyJs model
|
|
83
|
+
*/
|
|
84
|
+
model: VisuallyJsModel;
|
|
85
|
+
/**
|
|
86
|
+
* The UI that rendered this vertex
|
|
87
|
+
*/
|
|
88
|
+
ui: UICore<EL>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The payload passed to an {@link EdgeEventCallback}
|
|
92
|
+
*/
|
|
93
|
+
export interface EdgeEventCallbackPayload {
|
|
94
|
+
/**
|
|
95
|
+
* The connection rendered by the UI
|
|
96
|
+
*/
|
|
97
|
+
connection: Connection<any>;
|
|
98
|
+
/**
|
|
99
|
+
* The edge that the event occurred on
|
|
100
|
+
*/
|
|
101
|
+
obj: Edge;
|
|
102
|
+
/**
|
|
103
|
+
* The event that invoked this callback
|
|
104
|
+
*/
|
|
105
|
+
e: MouseEvent;
|
|
106
|
+
/**
|
|
107
|
+
* The underlying model
|
|
108
|
+
*/
|
|
109
|
+
model: VisuallyJsModel;
|
|
110
|
+
/**
|
|
111
|
+
* The UI that drew this edge
|
|
112
|
+
*/
|
|
113
|
+
ui: UICore<any>;
|
|
114
|
+
}
|
|
115
|
+
export default EdgeEventCallbackPayload;
|
|
116
|
+
/**
|
|
117
|
+
* The definition of a callback function for an edge event mapped in a view.
|
|
118
|
+
*/
|
|
119
|
+
export type EdgeEventCallback = (p: EdgeEventCallbackPayload) => any;
|
|
120
|
+
/**
|
|
121
|
+
* The definition of a callback function for a node event mapped in a view.
|
|
122
|
+
*/
|
|
123
|
+
export type NodeEventCallback<EL> = (p: NodeEventCallbackPayload<EL>) => any;
|
|
124
|
+
/**
|
|
125
|
+
* The definition of a callback function for a port event mapped in a view.
|
|
126
|
+
*/
|
|
127
|
+
export type PortEventCallback<EL> = (p: PortEventCallbackPayload<EL>) => any;
|
|
128
|
+
/**
|
|
129
|
+
* The definition of a callback function for a group event mapped in a view.
|
|
130
|
+
*/
|
|
131
|
+
export type GroupEventCallback<EL> = (p: GroupEventCallbackPayload<EL>) => any;
|
|
132
|
+
/**
|
|
133
|
+
* Events that can be mapped in a node definition in a view.
|
|
134
|
+
* @group Events
|
|
135
|
+
*/
|
|
136
|
+
export type NodeEventOptions<EL> = {
|
|
137
|
+
[K in BindableViewEvent]?: NodeEventCallback<EL>;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Events that can be mapped in a group definition in a view.
|
|
141
|
+
* @group Events
|
|
142
|
+
*/
|
|
143
|
+
export type GroupEventOptions<EL> = {
|
|
144
|
+
[K in BindableViewEvent]?: GroupEventCallback<EL>;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Events that can be mapped in a port definition in a view.
|
|
148
|
+
* @group Events
|
|
149
|
+
*/
|
|
150
|
+
export type PortEventOptions<EL> = {
|
|
151
|
+
[K in BindableViewEvent]?: PortEventCallback<EL>;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Events that can be mapped in an edge definition in a view.
|
|
155
|
+
* @group Events
|
|
156
|
+
*/
|
|
157
|
+
export type EdgeEventOptions = {
|
|
158
|
+
[K in BindableViewEvent]?: EdgeEventCallback;
|
|
159
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LayoutParameters, Group, Size, GroupDefinition, Node } from "../../../core";
|
|
2
|
+
import { GroupEventOptions } from "./events";
|
|
3
|
+
import { AnchorSpec } from "../../common";
|
|
4
|
+
import { NodeOrGroupMapping } from "./node-options";
|
|
5
|
+
/**
|
|
6
|
+
* The mapping for the definition of a group inside a view.
|
|
7
|
+
* @group Components
|
|
8
|
+
* @category View
|
|
9
|
+
*/
|
|
10
|
+
export interface GroupMapping<EL> extends NodeOrGroupMapping<Group, EL, GroupEventOptions<EL>>, GroupDefinition {
|
|
11
|
+
/**
|
|
12
|
+
* True by default - indicates that child members may be dragged around inside the group.
|
|
13
|
+
*/
|
|
14
|
+
elementsDraggable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* False by default - nodes/groups may be dragged outside of the bounds of the group.
|
|
17
|
+
*/
|
|
18
|
+
constrain?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Spec for the anchor to use for connections to children of the group when they are transferred to the group in its collapsed state.
|
|
21
|
+
*/
|
|
22
|
+
anchor?: AnchorSpec;
|
|
23
|
+
/**
|
|
24
|
+
* Optional interceptor that will be invoked to test whether a given node/group may be dropped onto this group.
|
|
25
|
+
* @param v
|
|
26
|
+
*/
|
|
27
|
+
canDrop?: (v: Node | Group) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* False by default. This flag switches on both `autoShrink` and `autoGrow` and also enables support for shrinking a group from its left or top edge
|
|
30
|
+
*/
|
|
31
|
+
autoSize?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* False by default. If true indicates that if a child member is dragged/added/removed and the group's size is recalculated to be smaller than the previous size, the new size should be applied. This also works if the group needs to shrink from its left and/or top edge. If you don't want that behaviour, set `allowShrinkFromOrigin` to false.
|
|
34
|
+
*/
|
|
35
|
+
autoShrink?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Defaults to false, meaning that the group will not be resized if an item addition/removal or drag causes the bounds of the child members to change and the new size is greater than the previous size.
|
|
38
|
+
*/
|
|
39
|
+
autoGrow?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Similar to autoGrow, but the UI shows a visual prompt when a group will be resized as a result of dragging a child.
|
|
42
|
+
*/
|
|
43
|
+
elastic?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Maximum size the group can grow to. If not specified the group can grow to an arbitrary size. Note that this behaviour can also be enforced via CSS.
|
|
46
|
+
*/
|
|
47
|
+
maxSize?: Size;
|
|
48
|
+
/**
|
|
49
|
+
* Minimum size the group can be.
|
|
50
|
+
*/
|
|
51
|
+
minSize?: Size;
|
|
52
|
+
/**
|
|
53
|
+
* Optional padding to set inside a group when computing an auto size.
|
|
54
|
+
*/
|
|
55
|
+
padding?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Options for the group's layout.
|
|
58
|
+
*/
|
|
59
|
+
layout?: {
|
|
60
|
+
type: string;
|
|
61
|
+
options?: LayoutParameters;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* When sizing the group, ensure it fits the underlying grid, if there is one.
|
|
65
|
+
*/
|
|
66
|
+
fitToGrid?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Optional map of event bindings.
|
|
69
|
+
*/
|
|
70
|
+
events?: GroupEventOptions<EL>;
|
|
71
|
+
/**
|
|
72
|
+
* The size to use for this group type when it is collapsed.
|
|
73
|
+
*/
|
|
74
|
+
collapsedSize?: Size;
|
|
75
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NodeMapping } from "./node-options";
|
|
2
|
+
import { EdgeMapping } from "./edge-options";
|
|
3
|
+
import { GroupMapping } from "./group-options";
|
|
4
|
+
import { PortMapping } from "./port-options";
|
|
5
|
+
export * from './common-options';
|
|
6
|
+
export * from './edge-options';
|
|
7
|
+
export * from './events';
|
|
8
|
+
export * from './group-options';
|
|
9
|
+
export * from './node-options';
|
|
10
|
+
export * from './node-or-port-options';
|
|
11
|
+
export * from './port-options';
|
|
12
|
+
export * from './vertex-options';
|
|
13
|
+
/**
|
|
14
|
+
* Mappings of vertex/edge types to their rendering and behaviour.
|
|
15
|
+
* @group Components
|
|
16
|
+
* @category View
|
|
17
|
+
*/
|
|
18
|
+
export interface ViewSpec<EL> {
|
|
19
|
+
/**
|
|
20
|
+
* Node mappings for the view.
|
|
21
|
+
*/
|
|
22
|
+
nodes?: Record<string, NodeMapping<EL>>;
|
|
23
|
+
/**
|
|
24
|
+
* Edge mappings for the view.
|
|
25
|
+
*/
|
|
26
|
+
edges?: Record<string, EdgeMapping>;
|
|
27
|
+
/**
|
|
28
|
+
* Group mappings for the view.
|
|
29
|
+
*/
|
|
30
|
+
groups?: Record<string, GroupMapping<EL>>;
|
|
31
|
+
/**
|
|
32
|
+
* Port mappings for the view.
|
|
33
|
+
*/
|
|
34
|
+
ports?: Record<string, PortMapping<EL>>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NodeOrPortMapping } from "./node-or-port-options";
|
|
2
|
+
import { NodeEventOptions } from "./events";
|
|
3
|
+
import { NodeDefinition, Size, Node } from "../../../core";
|
|
4
|
+
export interface NodeOrGroupMapping<O, EL, EVT> extends NodeOrPortMapping<EL, O, EVT> {
|
|
5
|
+
/**
|
|
6
|
+
* Optional default size to use for the vertex. This is not used to set the size in the DOM for a vertex - it is used to insert `width` and `height` values into the backing data for any vertex of this type that does not have them set.
|
|
7
|
+
*/
|
|
8
|
+
defaultSize?: Size;
|
|
9
|
+
/**
|
|
10
|
+
* If true, vertices of this type will be ignored by this UI and not rendered.
|
|
11
|
+
*/
|
|
12
|
+
ignore?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The mapping for the definition of a node inside a view.
|
|
16
|
+
* @group Components
|
|
17
|
+
* @category View
|
|
18
|
+
*/
|
|
19
|
+
export interface NodeMapping<EL> extends NodeOrGroupMapping<Node, EL, NodeEventOptions<EL>>, NodeDefinition {
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { VertexMapping } from "./vertex-options";
|
|
2
|
+
/**
|
|
3
|
+
* Base view mapping for nodes and ports (and groups, since they extend nodes)
|
|
4
|
+
* @group Components
|
|
5
|
+
* @category View
|
|
6
|
+
*/
|
|
7
|
+
export interface NodeOrPortMapping<E, N, EVT> extends VertexMapping<N, EVT> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether or not to allow edges from this vertex back to itself. Defaults to true. This flag will not prevent an edge from a port back to the node/group to which it belongs - for that, see `allowVertexLoopback`.
|
|
10
|
+
*/
|
|
11
|
+
allowLoopback?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* ID of the template to use for a vertex of this type. This is only for 'vanilla' VisuallyJs: if you are using an integration such as React/Angular/Vue, you will not need to provide this. This parameter is distinct from `template` in that when you provide `templateId` you are expecting VisuallyJs to resolve the template for you, either from a `templates` block in a `render` call, or by looking for a script element in the DOM with the appropriate ID. If you provide this and also `template`, `template` will take precedence.
|
|
14
|
+
*/
|
|
15
|
+
templateId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Template to use for a vertex of this type. This is only for 'vanilla' VisuallyJs: if you are using an integration such as React/Angular/Vue/Svelte, you will not need to provide this. If you provide this and also `templateId`, this will take precedence.
|
|
18
|
+
*/
|
|
19
|
+
template?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whether or not to allow edges from a port back to the vertex it belongs to. Defaults to true.
|
|
22
|
+
*/
|
|
23
|
+
allowVertexLoopback?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A map of parameters that the template engine will merge with the backing data when rendering the vertex.
|
|
26
|
+
*/
|
|
27
|
+
parameters?: Record<string, any>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { NodeOrPortMapping } from "./node-or-port-options";
|
|
2
|
+
import { PortEventOptions } from "./events";
|
|
3
|
+
import { AnchorSpec } from "../../common";
|
|
4
|
+
import { Port } from "../../../core";
|
|
5
|
+
/**
|
|
6
|
+
* Definition of a port inside a view.
|
|
7
|
+
* @group Components
|
|
8
|
+
* @category View
|
|
9
|
+
*/
|
|
10
|
+
export interface PortMapping<E> extends NodeOrPortMapping<E, Port, PortEventOptions<E>> {
|
|
11
|
+
/**
|
|
12
|
+
* Type of edges generated by this port.
|
|
13
|
+
*/
|
|
14
|
+
edgeType?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether or not the port can act as a source for dragged connections. Defaults to false.
|
|
17
|
+
*/
|
|
18
|
+
isSource?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether or not the port can act as a target for dragged connections. Defaults to false.
|
|
21
|
+
*/
|
|
22
|
+
isTarget?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Spec for anchors connected to this port
|
|
25
|
+
*/
|
|
26
|
+
anchor?: AnchorSpec;
|
|
27
|
+
/**
|
|
28
|
+
* The x location of any anchors created for this port. Allows you to specify where, in proportional values, the anchor should be located in the x axis. For a full discussion of how to use this (and the other anchor properties in this interface), see the documentation for anchors.
|
|
29
|
+
*/
|
|
30
|
+
anchorX?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The y location of any anchors created for this port. Allows you to specify where, in proportional values, the anchor should be located in the y axis.
|
|
33
|
+
*/
|
|
34
|
+
anchorY?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The orientation in the x axis for connections attached to an anchor created for this port.
|
|
37
|
+
*/
|
|
38
|
+
anchorOrientationX?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The orientation in the y axis for connections attached to an anchor created for this port.
|
|
41
|
+
*/
|
|
42
|
+
anchorOrientationY?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Offset, in pixels, to apply to the position in the x axis after the `anchorX` value has been used to compute its default position.
|
|
45
|
+
*/
|
|
46
|
+
anchorOffsetX?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Offset, in pixels, to apply to the position in the y axis after the `anchorY` value has been used to compute its default position.
|
|
49
|
+
*/
|
|
50
|
+
anchorOffsetY?: number;
|
|
51
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseViewObjectMapping } from "./common-options";
|
|
2
|
+
import { VertexDefinition, ObjectAnchorSpec } from "../../../core";
|
|
3
|
+
import { AnchorPositionFinder } from "../ui-model";
|
|
4
|
+
/**
|
|
5
|
+
* Base mapping for nodes, groups and ports.
|
|
6
|
+
*/
|
|
7
|
+
export interface VertexMapping<O, EVT> extends BaseViewObjectMapping, VertexDefinition {
|
|
8
|
+
/**
|
|
9
|
+
* Optional map of event bindings.
|
|
10
|
+
*/
|
|
11
|
+
events?: EVT;
|
|
12
|
+
/**
|
|
13
|
+
* Optional array of anchor positions to use.
|
|
14
|
+
*/
|
|
15
|
+
anchorPositions?: Array<ObjectAnchorSpec>;
|
|
16
|
+
/**
|
|
17
|
+
* Optional function to call on connection drop, to determine the location for the target anchor for the new connection. Returning null from this indicates no preference, and VisuallyJs will use its own computed value.
|
|
18
|
+
*/
|
|
19
|
+
anchorPositionFinder?: AnchorPositionFinder<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of connections this vertex supports. Default is 1. A value of -1 means no limit.
|
|
22
|
+
*/
|
|
23
|
+
maxConnections?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Type to assign to edges connected to this vertex as a source.
|
|
26
|
+
*/
|
|
27
|
+
edgeType?: string;
|
|
28
|
+
}
|