@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,88 @@
|
|
|
1
|
+
import { Extents, BoundingBox, PointXY } from "../../core";
|
|
2
|
+
export interface SegmentParams {
|
|
3
|
+
x1: number;
|
|
4
|
+
x2: number;
|
|
5
|
+
y1: number;
|
|
6
|
+
y2: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export type PointNearPath = {
|
|
12
|
+
s?: Segment;
|
|
13
|
+
d: number;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
l: number;
|
|
17
|
+
x1: number;
|
|
18
|
+
x2: number;
|
|
19
|
+
y1: number;
|
|
20
|
+
y2: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Definition of a segment. This is an internal class that users of the API need not access.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export interface Segment {
|
|
27
|
+
x1: number;
|
|
28
|
+
x2: number;
|
|
29
|
+
y1: number;
|
|
30
|
+
y2: number;
|
|
31
|
+
type: string;
|
|
32
|
+
extents: Extents;
|
|
33
|
+
}
|
|
34
|
+
export interface SegmentHandler<S extends Segment, SP extends SegmentParams> {
|
|
35
|
+
lineIntersection(segment: S, x1: number, y1: number, x2: number, y2: number): Array<PointXY>;
|
|
36
|
+
boxIntersection(segment: S, x: number, y: number, w: number, h: number): Array<PointXY>;
|
|
37
|
+
boundingBoxIntersection(segment: S, box: BoundingBox): Array<PointXY>;
|
|
38
|
+
getLength(segment: S): number;
|
|
39
|
+
pointOnPath(segment: S, location: number, absolute?: boolean): PointXY;
|
|
40
|
+
gradientAtPoint(segment: S, location: number, absolute?: boolean): number;
|
|
41
|
+
pointAlongPathFrom(segment: S, location: number, distance: number, absolute?: boolean): PointXY;
|
|
42
|
+
findClosestPointOnPath(segment: S, x: number, y: number): PointNearPath;
|
|
43
|
+
getPath(segment: S, isFirstSegment: boolean): string;
|
|
44
|
+
create(params: SP): S;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Finds the closest point on this segment to the given x/y, returning both the x and y of the point plus its distance from
|
|
48
|
+
* the supplied point, and its location along the length of the path inscribed by the segment. This implementation returns
|
|
49
|
+
* Infinity for distance and null values for everything else subclasses are expected to override.
|
|
50
|
+
* @param x - X location to find closest point to
|
|
51
|
+
* @param y - Y location to find closest point to
|
|
52
|
+
* @returns a `PointNearPath` object, which contains the location of the closest point plus other useful information.
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export declare function _defaultSegmentFindClosestPointOnPath(s: Segment, x: number, y: number): PointNearPath;
|
|
56
|
+
/**
|
|
57
|
+
* Computes the list of points on the segment that intersect the given line.
|
|
58
|
+
* @param x1 - X location of point 1
|
|
59
|
+
* @param y1 - Y location of point 1
|
|
60
|
+
* @param x2 - X location of point 2
|
|
61
|
+
* @param y2 - Y location of point 2
|
|
62
|
+
* @returns A list of intersecting points
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export declare function _defaultSegmentLineIntersection(s: Segment, x1: number, y1: number, x2: number, y2: number): Array<PointXY>;
|
|
66
|
+
/**
|
|
67
|
+
* Computes the list of points on the segment that intersect the box with the given origin and size.
|
|
68
|
+
* @param x - x origin of the box
|
|
69
|
+
* @param y - y origin of the box
|
|
70
|
+
* @param w - width of the box
|
|
71
|
+
* @param h - height of the box
|
|
72
|
+
* @returns A list of intersecting points
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export declare function _defaultSegmentBoxIntersection(s: Segment, x: number, y: number, w: number, h: number): Array<PointXY>;
|
|
76
|
+
/**
|
|
77
|
+
* Computes the list of points on the segment that intersect the given bounding box.
|
|
78
|
+
* @param box - Box to test for intersections.
|
|
79
|
+
* @returns A list of intersecting points
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare function _defaultSegmentBoundingBoxIntersection(s: Segment, box: BoundingBox): Array<PointXY>;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
* @param sp
|
|
86
|
+
* @private
|
|
87
|
+
*/
|
|
88
|
+
export declare function _createBaseSegment(sp: SegmentParams): Segment;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common options for anchors.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
import { PointXY, Size, Rotations, AnchorOrientationHint, ObjectAnchorSpec } from "../../core";
|
|
6
|
+
import { Connection } from "../core";
|
|
7
|
+
export type Orientation = Record<"y" | "x", AnchorOrientationHint>;
|
|
8
|
+
export declare const OBJECT_TYPE_ANCHOR = "Anchor";
|
|
9
|
+
export declare const FACE_TOP = "top";
|
|
10
|
+
export declare const FACE_LEFT = "left";
|
|
11
|
+
export declare const FACE_RIGHT = "right";
|
|
12
|
+
export declare const FACE_BOTTOM = "bottom";
|
|
13
|
+
export type Face = typeof FACE_TOP | typeof FACE_LEFT | typeof FACE_RIGHT | typeof FACE_BOTTOM;
|
|
14
|
+
export declare const faceOrientations: {
|
|
15
|
+
top: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
bottom: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
right: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
left: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type Axis = [Face, Face];
|
|
33
|
+
export declare const X_AXIS_FACES: Axis;
|
|
34
|
+
export declare const Y_AXIS_FACES: Axis;
|
|
35
|
+
/**
|
|
36
|
+
* for each face, what are the two faces that are orthogonal to it?
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export declare const ORTHOGONAL_FACES: Record<Face, [Face, Face]>;
|
|
40
|
+
/**
|
|
41
|
+
* for each face, what is the face opposite?
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
export declare const OPPOSITE_FACES: Record<Face, Face>;
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export type AnchorComputeParams = {
|
|
49
|
+
xy?: PointXY;
|
|
50
|
+
wh?: Size;
|
|
51
|
+
txy?: PointXY;
|
|
52
|
+
twh?: Size;
|
|
53
|
+
timestamp?: string;
|
|
54
|
+
index?: number;
|
|
55
|
+
connection?: Connection<any>;
|
|
56
|
+
elementId: string;
|
|
57
|
+
otherElementId?: string;
|
|
58
|
+
rotation?: Rotations;
|
|
59
|
+
tRotation?: Rotations;
|
|
60
|
+
otherAnchor?: LightweightAnchor;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Defines a single location an anchor may be placed at.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
export interface AnchorRecord {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
ox: AnchorOrientationHint;
|
|
70
|
+
oy: AnchorOrientationHint;
|
|
71
|
+
offsetX?: number;
|
|
72
|
+
offsetY?: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
export interface ComputedPosition {
|
|
78
|
+
curX: number;
|
|
79
|
+
curY: number;
|
|
80
|
+
ox: AnchorOrientationHint;
|
|
81
|
+
oy: AnchorOrientationHint;
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Representation of an anchor.
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export interface LightweightAnchor {
|
|
90
|
+
objectType: typeof OBJECT_TYPE_ANCHOR;
|
|
91
|
+
locations: Array<AnchorRecord>;
|
|
92
|
+
currentLocation: number;
|
|
93
|
+
id: string;
|
|
94
|
+
cssClass: string;
|
|
95
|
+
/**
|
|
96
|
+
* Indicates whether this anchor was constructed as a Continuous anchor. If isFixed is set, this flag will be ignored.
|
|
97
|
+
*/
|
|
98
|
+
isContinuous: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Indicates whether this anchor was constructed as a Dynamic anchor, ie. it has more than one location it can choose
|
|
101
|
+
* from. However given the fact that the code treats multiple locations in the same code path as a single location, it
|
|
102
|
+
* seems likely this flag can be removed.
|
|
103
|
+
*/
|
|
104
|
+
isDynamic: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Indicates the position of this anchor has been fixed somehow and that all calculations should use `fixedLocation` for
|
|
107
|
+
* the anchor's location (ignoring the fact that the anchor may be declared as dynamic or continuous). Anchors can
|
|
108
|
+
* currently be fixed via their edge having anchor information declared, but it seems likely that other parts of the
|
|
109
|
+
* codebase could make use of this too (such as when an edge is being edited)
|
|
110
|
+
*/
|
|
111
|
+
isFixed: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* When isFixed is set, this is the fixed position.
|
|
114
|
+
*/
|
|
115
|
+
fixedLocation: AnchorRecord;
|
|
116
|
+
timestamp: string;
|
|
117
|
+
type: string;
|
|
118
|
+
computedPosition?: ComputedPosition;
|
|
119
|
+
}
|
|
120
|
+
export interface LightweightPerimeterAnchor extends LightweightAnchor {
|
|
121
|
+
shape: PerimeterAnchorShapes;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A continuous anchor has faces it can choose from, and may be locked to some axis or a face.
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
export interface LightweightContinuousAnchor extends LightweightAnchor {
|
|
128
|
+
faces: Array<Face>;
|
|
129
|
+
lockedFace: Face;
|
|
130
|
+
isContinuous: true;
|
|
131
|
+
isDynamic: false;
|
|
132
|
+
isGeometric: false;
|
|
133
|
+
currentFace: Face;
|
|
134
|
+
lockedAxis: Axis;
|
|
135
|
+
clockwise: boolean;
|
|
136
|
+
}
|
|
137
|
+
export interface AnchorOptions extends Record<string, any> {
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Supported shapes for a Perimeter anchor.
|
|
141
|
+
* @group Edges
|
|
142
|
+
*/
|
|
143
|
+
export declare enum PerimeterAnchorShapes {
|
|
144
|
+
Circle = "Circle",
|
|
145
|
+
Ellipse = "Ellipse",
|
|
146
|
+
Triangle = "Triangle",
|
|
147
|
+
Diamond = "Diamond",
|
|
148
|
+
Rectangle = "Rectangle",
|
|
149
|
+
Square = "Square"
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Constructor options for a Perimeter Anchor.
|
|
153
|
+
* @group Edges
|
|
154
|
+
*/
|
|
155
|
+
export interface PerimeterAnchorOptions extends AnchorOptions {
|
|
156
|
+
/**
|
|
157
|
+
* The shape to use for the anchor
|
|
158
|
+
*/
|
|
159
|
+
shape: keyof PerimeterAnchorShapes;
|
|
160
|
+
/**
|
|
161
|
+
* Optional rotation
|
|
162
|
+
*/
|
|
163
|
+
rotation?: number;
|
|
164
|
+
/**
|
|
165
|
+
* How many anchors to use to approximate the perimeter.
|
|
166
|
+
*/
|
|
167
|
+
anchorCount?: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Default anchor locations.
|
|
171
|
+
* @group Edges
|
|
172
|
+
* @category Anchors
|
|
173
|
+
*/
|
|
174
|
+
export declare enum AnchorLocations {
|
|
175
|
+
/**
|
|
176
|
+
* User must specify an assignment function.
|
|
177
|
+
*/
|
|
178
|
+
Assign = "Assign",
|
|
179
|
+
/**
|
|
180
|
+
* Chooses from Top, Left, Bottom or Right, depending on which is closest to the anchor at the other end of the connection.
|
|
181
|
+
*/
|
|
182
|
+
AutoDefault = "AutoDefault",
|
|
183
|
+
/**
|
|
184
|
+
* Bottom middle of the element.
|
|
185
|
+
*/
|
|
186
|
+
Bottom = "Bottom",
|
|
187
|
+
/**
|
|
188
|
+
* Bottom left corner of the element.
|
|
189
|
+
*/
|
|
190
|
+
BottomLeft = "BottomLeft",
|
|
191
|
+
/**
|
|
192
|
+
* Bottom right corner of the element.
|
|
193
|
+
*/
|
|
194
|
+
BottomRight = "BottomRight",
|
|
195
|
+
/**
|
|
196
|
+
* Center of the element.
|
|
197
|
+
*/
|
|
198
|
+
Center = "Center",
|
|
199
|
+
/**
|
|
200
|
+
* Assigns a separate anchor point for each endpoint, choosing whichever face is closest to the element at the other end of each connection.
|
|
201
|
+
*/
|
|
202
|
+
Continuous = "Continuous",
|
|
203
|
+
/**
|
|
204
|
+
* As with Continuous, but only use the bottom face.
|
|
205
|
+
*/
|
|
206
|
+
ContinuousBottom = "ContinuousBottom",
|
|
207
|
+
/**
|
|
208
|
+
* As with Continuous, but only use the left face.
|
|
209
|
+
*/
|
|
210
|
+
ContinuousLeft = "ContinuousLeft",
|
|
211
|
+
/**
|
|
212
|
+
* As with Continuous, but only use the right face.
|
|
213
|
+
*/
|
|
214
|
+
ContinuousRight = "ContinuousRight",
|
|
215
|
+
/**
|
|
216
|
+
* As with Continuous, but only use the top face.
|
|
217
|
+
*/
|
|
218
|
+
ContinuousTop = "ContinuousTop",
|
|
219
|
+
/**
|
|
220
|
+
* As with Continuous, but only use the left and right faces.
|
|
221
|
+
*/
|
|
222
|
+
ContinuousLeftRight = "ContinuousLeftRight",
|
|
223
|
+
/**
|
|
224
|
+
* As with Continuous, but only use the top and bottom faces.
|
|
225
|
+
*/
|
|
226
|
+
ContinuousTopBottom = "ContinuousTopBottom",
|
|
227
|
+
/**
|
|
228
|
+
* Center of the left edge of the element.
|
|
229
|
+
*/
|
|
230
|
+
Left = "Left",
|
|
231
|
+
/**
|
|
232
|
+
* Center of the right edge of the element.
|
|
233
|
+
*/
|
|
234
|
+
Right = "Right",
|
|
235
|
+
/**
|
|
236
|
+
* Center of the top edge of the element.
|
|
237
|
+
*/
|
|
238
|
+
Top = "Top",
|
|
239
|
+
/**
|
|
240
|
+
* Top left corner of the element.
|
|
241
|
+
*/
|
|
242
|
+
TopLeft = "TopLeft",
|
|
243
|
+
/**
|
|
244
|
+
* Top right corner of the element.
|
|
245
|
+
*/
|
|
246
|
+
TopRight = "TopRight"
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* List of entries in the AnchorLocations enum
|
|
250
|
+
* @group Edges
|
|
251
|
+
* @category Anchors
|
|
252
|
+
*/
|
|
253
|
+
export type AnchorId = keyof typeof AnchorLocations;
|
|
254
|
+
/**
|
|
255
|
+
* An anchor spec in the form `{type:..., options:{ ... }}`
|
|
256
|
+
* @group Edges
|
|
257
|
+
* @category Anchors
|
|
258
|
+
*/
|
|
259
|
+
export type FullAnchorSpec = {
|
|
260
|
+
/**
|
|
261
|
+
* Anchor type
|
|
262
|
+
*/
|
|
263
|
+
type: AnchorId;
|
|
264
|
+
/**
|
|
265
|
+
* Options for the anchor.
|
|
266
|
+
*/
|
|
267
|
+
options: AnchorOptions;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Models the specification of a single anchor.
|
|
271
|
+
* @group Edges
|
|
272
|
+
* @category Anchors
|
|
273
|
+
*/
|
|
274
|
+
export type SingleAnchorSpec = AnchorId | FullAnchorSpec | ObjectAnchorSpec;
|
|
275
|
+
/**
|
|
276
|
+
* Models the specification of an anchor - which may be a SingleAnchorSpec, or an array of SingleAnchorSpec objects.
|
|
277
|
+
* @group Edges
|
|
278
|
+
* @category Anchors
|
|
279
|
+
*/
|
|
280
|
+
export type AnchorSpec = SingleAnchorSpec | Array<SingleAnchorSpec>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Segment } from "./abstract-segment";
|
|
2
|
+
import { PaintGeometry } from "../core/connector/abstract-connector";
|
|
3
|
+
import { Extents, Geometry, PATH_CONSTRAIN_DIAGONAL, PATH_CONSTRAIN_MANHATTAN, PATH_CONSTRAIN_METRO, PATH_CONSTRAIN_NONE, PATH_CONSTRAIN_ORTHOGONAL } from "../../core";
|
|
4
|
+
/**
|
|
5
|
+
* Common options for connectors.
|
|
6
|
+
* @group Edges
|
|
7
|
+
* @category Connectors
|
|
8
|
+
*/
|
|
9
|
+
export interface ConnectorOptions extends Record<string, any> {
|
|
10
|
+
/**
|
|
11
|
+
* Stub defines a number of pixels that the connector travels away from its element before the connector's actual path begins.
|
|
12
|
+
*/
|
|
13
|
+
stub?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Defines a number of pixels between the end of the connector and its anchor point. Defaults to zero.
|
|
16
|
+
*/
|
|
17
|
+
gap?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Optional class to set on the element used to render the connector.
|
|
20
|
+
*/
|
|
21
|
+
cssClass?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional class to set on the element used to render the connector when the mouse is hovering over the connector.
|
|
24
|
+
*/
|
|
25
|
+
hoverClass?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Alias for the use case that a Connector is referenced just by its `type`.
|
|
29
|
+
* @group Edges
|
|
30
|
+
* @category Connectors
|
|
31
|
+
*/
|
|
32
|
+
export type ConnectorId = string;
|
|
33
|
+
/**
|
|
34
|
+
* Connector spec with type and options.
|
|
35
|
+
* @group Edges
|
|
36
|
+
* @category Connectors
|
|
37
|
+
*/
|
|
38
|
+
export type ConnectorWithOptions<T extends ConnectorOptions = ConnectorOptions> = {
|
|
39
|
+
/**
|
|
40
|
+
* Id of the connector
|
|
41
|
+
*/
|
|
42
|
+
type: ConnectorId;
|
|
43
|
+
/**
|
|
44
|
+
* Options for the connector.
|
|
45
|
+
*/
|
|
46
|
+
options: T;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Specification of a connector - either the type id of some Connector, a type+options object.
|
|
50
|
+
* @group Edges
|
|
51
|
+
* @category Connectors
|
|
52
|
+
*/
|
|
53
|
+
export type ConnectorSpec<T extends ConnectorOptions = ConnectorOptions> = ConnectorId | ConnectorWithOptions<T>;
|
|
54
|
+
/**
|
|
55
|
+
* Used internally by connectors.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export type PaintAxis = "y" | "x";
|
|
59
|
+
/**
|
|
60
|
+
* High level definition of a Connector.
|
|
61
|
+
* @group Edges
|
|
62
|
+
* @category Connectors
|
|
63
|
+
*/
|
|
64
|
+
export interface Connector {
|
|
65
|
+
/**
|
|
66
|
+
* The connector's type.
|
|
67
|
+
*/
|
|
68
|
+
type: string;
|
|
69
|
+
typeDescriptor: string;
|
|
70
|
+
idPrefix: string;
|
|
71
|
+
/**
|
|
72
|
+
* Path for this connector. Written by the router, or a path editor. This is distinct from the edge geometry, in
|
|
73
|
+
* that this member is used as a BAU field, but edge geometry is only set when the edge path has been edited and
|
|
74
|
+
* we want to persist the changes.
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
geometry: Geometry;
|
|
78
|
+
edited: boolean;
|
|
79
|
+
stub: number | number[];
|
|
80
|
+
sourceStub: number;
|
|
81
|
+
targetStub: number;
|
|
82
|
+
typeId: string;
|
|
83
|
+
gap: number;
|
|
84
|
+
sourceGap: number;
|
|
85
|
+
targetGap: number;
|
|
86
|
+
internalSegments: Array<Segment>;
|
|
87
|
+
totalLength: number;
|
|
88
|
+
segmentProportions: Array<[number, number]>;
|
|
89
|
+
segmentProportionalLengths: Array<number>;
|
|
90
|
+
paintInfo: PaintGeometry;
|
|
91
|
+
strokeWidth: number;
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
quadrant: number;
|
|
97
|
+
bounds: Extents;
|
|
98
|
+
cssClass: string;
|
|
99
|
+
hoverClass: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Types of movement constrainment possible for a connector path.
|
|
103
|
+
* @group Edges
|
|
104
|
+
* @category Connectors
|
|
105
|
+
*/
|
|
106
|
+
export type ConnectorPathConstrainment = typeof PATH_CONSTRAIN_ORTHOGONAL | typeof PATH_CONSTRAIN_DIAGONAL | typeof PATH_CONSTRAIN_NONE | typeof PATH_CONSTRAIN_MANHATTAN | typeof PATH_CONSTRAIN_METRO;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { PaintStyle } from './paint-style';
|
|
2
|
+
import { OverlayEvents, OverlayVisibility } from "../core/overlay/overlay";
|
|
3
|
+
import { FontSpec } from "../../browser-ui";
|
|
4
|
+
/**
|
|
5
|
+
* Base options for an overlay.
|
|
6
|
+
* @group Edges
|
|
7
|
+
* @category Constants
|
|
8
|
+
*/
|
|
9
|
+
export interface OverlayOptions extends Record<string, any> {
|
|
10
|
+
/**
|
|
11
|
+
* Optional ID for the overlay. Can be used to retrieve the overlay from a connection.
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional CSS class(es) to add to the overlay's element.
|
|
16
|
+
*/
|
|
17
|
+
cssClass?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Defaults to 0.5. See docs.
|
|
20
|
+
*/
|
|
21
|
+
location?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 1 to point forwards (the default), -1 to point backwards. Only taken into consideration in some overlay types.
|
|
24
|
+
*/
|
|
25
|
+
direction?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Optional event handlers to attach to the overlay.
|
|
28
|
+
*/
|
|
29
|
+
events?: Record<OverlayEvents, (value: any, event?: any) => any>;
|
|
30
|
+
/**
|
|
31
|
+
* Optional custom attributes to write to the overlay's element.
|
|
32
|
+
*/
|
|
33
|
+
attributes?: Record<string, string>;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the overlay is always visible, or only on hover. Defaults to OVERLAY_VISIBILITY_ALWAYS.
|
|
36
|
+
*/
|
|
37
|
+
visibility?: OverlayVisibility;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Common options for subclasses of SimpleShapeOverlay
|
|
41
|
+
*/
|
|
42
|
+
export interface SimpleShapeOverlayOptions extends OverlayOptions {
|
|
43
|
+
/**
|
|
44
|
+
* Optional paint style to use.
|
|
45
|
+
*/
|
|
46
|
+
paintStyle?: PaintStyle;
|
|
47
|
+
/**
|
|
48
|
+
* Defaults to false. When true, the arrow is stroked but not filled.
|
|
49
|
+
*/
|
|
50
|
+
hollow?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Options for an Arrow overlay.
|
|
54
|
+
* @group Edges
|
|
55
|
+
* @category Overlays
|
|
56
|
+
*/
|
|
57
|
+
export interface ArrowOverlayOptions extends SimpleShapeOverlayOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Width of the arrow's baseline. Defaults to 20.
|
|
60
|
+
*/
|
|
61
|
+
width?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Length from the head to the baseline. Defaults to 20.
|
|
64
|
+
*/
|
|
65
|
+
length?: number;
|
|
66
|
+
/**
|
|
67
|
+
* How far, as a decimal, along the line from head to baseline to fold back into. Defaults to 0.623.
|
|
68
|
+
*/
|
|
69
|
+
foldback?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @group Edges
|
|
73
|
+
* @category Overlays
|
|
74
|
+
*/
|
|
75
|
+
export interface LabelOverlayOptions extends OverlayOptions {
|
|
76
|
+
/**
|
|
77
|
+
* String, or a function returning a string, for the label.
|
|
78
|
+
*/
|
|
79
|
+
label: string | Function;
|
|
80
|
+
/**
|
|
81
|
+
* Optional name of the attribute that identifies this overlay's location on the path. Defaults to `location`.
|
|
82
|
+
*/
|
|
83
|
+
labelLocationAttribute?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Whether or not to use an HTML element. Defaults to false (uses an SVG element)
|
|
86
|
+
*/
|
|
87
|
+
useHTMLElement?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Optional spec for the font to use on this label.
|
|
90
|
+
*/
|
|
91
|
+
font?: FontSpec;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* An overlay specified by name and options.
|
|
95
|
+
* @group Edges
|
|
96
|
+
* @category Overlays
|
|
97
|
+
*/
|
|
98
|
+
export type FullOverlaySpec = {
|
|
99
|
+
/**
|
|
100
|
+
* Overlay type
|
|
101
|
+
*/
|
|
102
|
+
type: string;
|
|
103
|
+
/**
|
|
104
|
+
* Options for the overlay
|
|
105
|
+
*/
|
|
106
|
+
options: OverlayOptions;
|
|
107
|
+
};
|
|
108
|
+
export type InternalOverlaySpec = FullOverlaySpec & {
|
|
109
|
+
sourceMarker?: boolean;
|
|
110
|
+
targetMarker?: boolean;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* A specifier for an overlay.
|
|
114
|
+
* @group Edges
|
|
115
|
+
* @category Overlays
|
|
116
|
+
*/
|
|
117
|
+
export type OverlaySpec = string | FullOverlaySpec;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic style definition for an edge
|
|
3
|
+
*/
|
|
4
|
+
export interface PaintStyle {
|
|
5
|
+
/**
|
|
6
|
+
* Stroke color for the edge
|
|
7
|
+
*/
|
|
8
|
+
stroke?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Fill color for the edge.
|
|
11
|
+
*/
|
|
12
|
+
fill?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Width of the stroke
|
|
15
|
+
*/
|
|
16
|
+
strokeWidth?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Color for the outline path
|
|
19
|
+
*/
|
|
20
|
+
outlineStroke?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Width of the outline path
|
|
23
|
+
*/
|
|
24
|
+
outlineWidth?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Definition for stroke pattern
|
|
27
|
+
*/
|
|
28
|
+
dashArray?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Definition of a linear gradient to apply. Each entry is [offset, color].
|
|
31
|
+
*/
|
|
32
|
+
gradient?: Array<[number, string]>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bezier connector's internal representation of a path.
|
|
3
|
+
*/
|
|
4
|
+
import { Connector, ConnectorOptions, ConnectorPathConstrainment } from "../common";
|
|
5
|
+
import { Connection } from "../core/connector/connection-impl";
|
|
6
|
+
import { PointXY, BaseGeometrySegment, Geometry } from "../../core";
|
|
7
|
+
export interface BezierGeometrySegment extends BaseGeometrySegment {
|
|
8
|
+
cp1: PointXY;
|
|
9
|
+
cp2: PointXY;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Defines the geometry used by a cubic bezier connector.
|
|
13
|
+
* @group Edges
|
|
14
|
+
* @category Connectors
|
|
15
|
+
*/
|
|
16
|
+
export interface BezierConnectorGeometry extends Geometry {
|
|
17
|
+
segments: Array<BezierGeometrySegment>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* This is the default location of a Cubic Bezier connector's control point, relative to the distance between the two anchors. It is used as the default value for the Bezier connector's "scale". A larger value will make the
|
|
21
|
+
* connector "curvier".
|
|
22
|
+
* @group Connectors
|
|
23
|
+
* @category Bezier
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_BEZIER_CONTROL_POINT_SCALE = 0.45;
|
|
27
|
+
/**
|
|
28
|
+
* The default distance the control point will be placed at for a bezier curve when the source and target are the same
|
|
29
|
+
* element.
|
|
30
|
+
* @group Connectors
|
|
31
|
+
* @category Bezier
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEFAULT_BEZIER_LOOPBACK_DISTANCE = 62;
|
|
35
|
+
/**
|
|
36
|
+
* Base options interface for Quadratic and Cubic Bezier connectors.
|
|
37
|
+
* @group Edges
|
|
38
|
+
* @category Connectors
|
|
39
|
+
*/
|
|
40
|
+
export interface AbstractBezierOptions extends ConnectorOptions {
|
|
41
|
+
proximityLimit?: number;
|
|
42
|
+
orientation?: string;
|
|
43
|
+
/**
|
|
44
|
+
* When the connector's source and target is the same vertex, this is a measure of how far the control point will
|
|
45
|
+
* be placed from the element. Defaults to 62 pixels
|
|
46
|
+
*/
|
|
47
|
+
loopbackDistance?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export interface BezierConnectorBase extends Connector {
|
|
53
|
+
curviness: number;
|
|
54
|
+
proximityLimit: number;
|
|
55
|
+
orientation: string;
|
|
56
|
+
loopbackDistance: number;
|
|
57
|
+
clockwise: boolean;
|
|
58
|
+
isLoopbackCurrently: boolean;
|
|
59
|
+
geometry: BezierConnectorGeometry;
|
|
60
|
+
constrain: ConnectorPathConstrainment;
|
|
61
|
+
smooth: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @param connection
|
|
65
|
+
* @param params
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function createAbstractBezierConnector(type: string, connection: Connection<any>, params: AbstractBezierOptions): BezierConnectorBase;
|