@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.
Files changed (427) hide show
  1. package/css/visuallyjs-theme.css +148 -0
  2. package/css/visuallyjs.css +1879 -0
  3. package/js/visuallyjs.browser-ui.cjs.js +143 -0
  4. package/js/visuallyjs.browser-ui.esm.js +143 -0
  5. package/package.json +16 -0
  6. package/types/browser-ui/base-dom-ui-layout-adapter.d.ts +14 -0
  7. package/types/browser-ui/browser-ui.d.ts +95 -0
  8. package/types/browser-ui/browser-util.d.ts +233 -0
  9. package/types/browser-ui/browser-visuallyjs-instance.d.ts +881 -0
  10. package/types/browser-ui/canvas-layout-adapter.d.ts +15 -0
  11. package/types/browser-ui/collicat.d.ts +245 -0
  12. package/types/browser-ui/components/controls/controls-component.d.ts +137 -0
  13. package/types/browser-ui/components/controls/copy-paste-controls-component.d.ts +9 -0
  14. package/types/browser-ui/components/controls/css-classes.d.ts +79 -0
  15. package/types/browser-ui/components/controls/index.d.ts +4 -0
  16. package/types/browser-ui/components/controls/svg-export-component.d.ts +60 -0
  17. package/types/browser-ui/components/edge-type-picker/edge-type-picker.d.ts +37 -0
  18. package/types/browser-ui/components/edge-type-picker/index.d.ts +1 -0
  19. package/types/browser-ui/components/index.d.ts +4 -0
  20. package/types/browser-ui/components/inspector/color-picker-tag.d.ts +32 -0
  21. package/types/browser-ui/components/inspector/definitions.d.ts +114 -0
  22. package/types/browser-ui/components/inspector/edge-type-tag.d.ts +15 -0
  23. package/types/browser-ui/components/inspector/index.d.ts +6 -0
  24. package/types/browser-ui/components/inspector/inspector.d.ts +138 -0
  25. package/types/browser-ui/components/inspector/shape-type-inspector.d.ts +43 -0
  26. package/types/browser-ui/components/inspector/vanilla-inspector.d.ts +39 -0
  27. package/types/browser-ui/components/palette/index.d.ts +2 -0
  28. package/types/browser-ui/components/palette/palette-content-generator.d.ts +14 -0
  29. package/types/browser-ui/components/palette/palette-options.d.ts +159 -0
  30. package/types/browser-ui/components/palette/palette.d.ts +126 -0
  31. package/types/browser-ui/connector-editor.d.ts +65 -0
  32. package/types/browser-ui/connector-editors/anchors.d.ts +31 -0
  33. package/types/browser-ui/connector-editors/css-constants.d.ts +33 -0
  34. package/types/browser-ui/connector-editors/definitions.d.ts +74 -0
  35. package/types/browser-ui/connector-editors/editor-base.d.ts +177 -0
  36. package/types/browser-ui/connector-editors/index.d.ts +52 -0
  37. package/types/browser-ui/connector-editors/util.d.ts +33 -0
  38. package/types/browser-ui/connector-editors-bezier/bezier-editor.d.ts +82 -0
  39. package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +42 -0
  40. package/types/browser-ui/connector-editors-bezier/index.d.ts +9 -0
  41. package/types/browser-ui/connector-editors-orthogonal/css-constants.d.ts +28 -0
  42. package/types/browser-ui/connector-editors-orthogonal/index.d.ts +9 -0
  43. package/types/browser-ui/connector-editors-orthogonal/orthogonal-editor.d.ts +86 -0
  44. package/types/browser-ui/connector-editors-straight/auto-split-mode.d.ts +24 -0
  45. package/types/browser-ui/connector-editors-straight/click-split-mode.d.ts +20 -0
  46. package/types/browser-ui/connector-editors-straight/css-constants.d.ts +30 -0
  47. package/types/browser-ui/connector-editors-straight/definitions.d.ts +69 -0
  48. package/types/browser-ui/connector-editors-straight/index.d.ts +11 -0
  49. package/types/browser-ui/connector-editors-straight/straight-editor.d.ts +42 -0
  50. package/types/browser-ui/constants.d.ts +79 -0
  51. package/types/browser-ui/copy-paste/clipboard.d.ts +34 -0
  52. package/types/browser-ui/copy-paste/index.d.ts +2 -0
  53. package/types/browser-ui/copy-paste/transformer.d.ts +14 -0
  54. package/types/browser-ui/css-constants.d.ts +436 -0
  55. package/types/browser-ui/d.d.ts +2 -0
  56. package/types/browser-ui/definitions.d.ts +442 -0
  57. package/types/browser-ui/dialogs/binder.d.ts +49 -0
  58. package/types/browser-ui/dialogs/constants.d.ts +51 -0
  59. package/types/browser-ui/dialogs/dialogs.d.ts +30 -0
  60. package/types/browser-ui/dialogs/index.d.ts +3 -0
  61. package/types/browser-ui/drag-manager-2.d.ts +54 -0
  62. package/types/browser-ui/edge-handler-base.d.ts +168 -0
  63. package/types/browser-ui/edge-input-handler.d.ts +116 -0
  64. package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +22 -0
  65. package/types/browser-ui/edge-mappings/index.d.ts +1 -0
  66. package/types/browser-ui/edge-relocate-handler.d.ts +51 -0
  67. package/types/browser-ui/element-drag-handler-2.d.ts +254 -0
  68. package/types/browser-ui/element-dragger.d.ts +45 -0
  69. package/types/browser-ui/element-facade.d.ts +11 -0
  70. package/types/browser-ui/event-manager.d.ts +50 -0
  71. package/types/browser-ui/fixed-layer.d.ts +107 -0
  72. package/types/browser-ui/group-layout-adapter.d.ts +19 -0
  73. package/types/browser-ui/html-element-overlay.d.ts +32 -0
  74. package/types/browser-ui/icons/definitions.d.ts +59 -0
  75. package/types/browser-ui/icons/icon-renderer.d.ts +43 -0
  76. package/types/browser-ui/icons/index.d.ts +2 -0
  77. package/types/browser-ui/index.d.ts +48 -0
  78. package/types/browser-ui/pan-zoom-options.d.ts +262 -0
  79. package/types/browser-ui/pan-zoom.d.ts +674 -0
  80. package/types/browser-ui/paper-renderer/definitions.d.ts +83 -0
  81. package/types/browser-ui/paper-renderer/index.d.ts +2 -0
  82. package/types/browser-ui/paper-renderer/paper.d.ts +50 -0
  83. package/types/browser-ui/pinch-listener.d.ts +33 -0
  84. package/types/browser-ui/plugins/background/available-backgrounds.d.ts +12 -0
  85. package/types/browser-ui/plugins/background/background-options.d.ts +62 -0
  86. package/types/browser-ui/plugins/background/background-plugin.d.ts +62 -0
  87. package/types/browser-ui/plugins/background/generated-grid-background.d.ts +230 -0
  88. package/types/browser-ui/plugins/background/index.d.ts +6 -0
  89. package/types/browser-ui/plugins/background/simple-background.d.ts +33 -0
  90. package/types/browser-ui/plugins/background/tiled-background.d.ts +118 -0
  91. package/types/browser-ui/plugins/browser-ui-plugin.d.ts +90 -0
  92. package/types/browser-ui/plugins/edge-routing/index.d.ts +66 -0
  93. package/types/browser-ui/plugins/index.d.ts +5 -0
  94. package/types/browser-ui/plugins/selected-edge-highlight/index.d.ts +1 -0
  95. package/types/browser-ui/plugins/selected-edge-highlight/selected-edge-highlight-plugin.d.ts +36 -0
  96. package/types/browser-ui/plugins/ui-states/index.d.ts +2 -0
  97. package/types/browser-ui/plugins/ui-states/ui-state.d.ts +14 -0
  98. package/types/browser-ui/plugins/ui-states/ui-states-plugin.d.ts +69 -0
  99. package/types/browser-ui/positioning-and-sizing-utils.d.ts +103 -0
  100. package/types/browser-ui/shape-library/index.d.ts +4 -0
  101. package/types/browser-ui/shape-library/shape-library-definitions.d.ts +243 -0
  102. package/types/browser-ui/shape-library/shape-library.d.ts +266 -0
  103. package/types/browser-ui/shape-library/shapes-basic.d.ts +7 -0
  104. package/types/browser-ui/shape-library/shapes-flowchart.d.ts +7 -0
  105. package/types/browser-ui/storage.d.ts +8 -0
  106. package/types/browser-ui/surface-renderer/anim/anim.d.ts +64 -0
  107. package/types/browser-ui/surface-renderer/anim/constants.d.ts +74 -0
  108. package/types/browser-ui/surface-renderer/anim/definitions.d.ts +134 -0
  109. package/types/browser-ui/surface-renderer/anim/index.d.ts +4 -0
  110. package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +23 -0
  111. package/types/browser-ui/surface-renderer/css-classes.d.ts +64 -0
  112. package/types/browser-ui/surface-renderer/decorators.d.ts +162 -0
  113. package/types/browser-ui/surface-renderer/definitions.d.ts +83 -0
  114. package/types/browser-ui/surface-renderer/diagrams/constants.d.ts +28 -0
  115. package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +528 -0
  116. package/types/browser-ui/surface-renderer/diagrams/diagram-cell.d.ts +123 -0
  117. package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +116 -0
  118. package/types/browser-ui/surface-renderer/diagrams/diagram-palette.d.ts +11 -0
  119. package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +112 -0
  120. package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +221 -0
  121. package/types/browser-ui/surface-renderer/diagrams/index.d.ts +25 -0
  122. package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +59 -0
  123. package/types/browser-ui/surface-renderer/diagrams/util.d.ts +15 -0
  124. package/types/browser-ui/surface-renderer/elastic-group-manager.d.ts +102 -0
  125. package/types/browser-ui/surface-renderer/index.d.ts +34 -0
  126. package/types/browser-ui/surface-renderer/params.d.ts +175 -0
  127. package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +26 -0
  128. package/types/browser-ui/surface-renderer/plugins/controls/index.d.ts +1 -0
  129. package/types/browser-ui/surface-renderer/plugins/drag-groups/drag-groups-plugin.d.ts +78 -0
  130. package/types/browser-ui/surface-renderer/plugins/drag-groups/index.d.ts +1 -0
  131. package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +25 -0
  132. package/types/browser-ui/surface-renderer/plugins/export-controls/index.d.ts +1 -0
  133. package/types/browser-ui/surface-renderer/plugins/index.d.ts +10 -0
  134. package/types/browser-ui/surface-renderer/plugins/lasso/index.d.ts +2 -0
  135. package/types/browser-ui/surface-renderer/plugins/lasso/lasso-plugin.d.ts +78 -0
  136. package/types/browser-ui/surface-renderer/plugins/lasso/lasso.d.ts +74 -0
  137. package/types/browser-ui/surface-renderer/plugins/miniview/index.d.ts +1 -0
  138. package/types/browser-ui/surface-renderer/plugins/miniview/miniview-plugin.d.ts +235 -0
  139. package/types/browser-ui/surface-renderer/plugins/palette/index.d.ts +1 -0
  140. package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +17 -0
  141. package/types/browser-ui/surface-renderer/plugins/pan-buttons/index.d.ts +1 -0
  142. package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +55 -0
  143. package/types/browser-ui/surface-renderer/plugins/resizing-tools/border-drag-handlers.d.ts +3 -0
  144. package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +411 -0
  145. package/types/browser-ui/surface-renderer/plugins/resizing-tools/drag-handlers.d.ts +3 -0
  146. package/types/browser-ui/surface-renderer/plugins/resizing-tools/handle-gen.d.ts +15 -0
  147. package/types/browser-ui/surface-renderer/plugins/resizing-tools/index.d.ts +4 -0
  148. package/types/browser-ui/surface-renderer/plugins/resizing-tools/resizing-tools-plugin.d.ts +185 -0
  149. package/types/browser-ui/surface-renderer/plugins/resizing-tools/util.d.ts +16 -0
  150. package/types/browser-ui/surface-renderer/plugins/snaplines/index.d.ts +1 -0
  151. package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +128 -0
  152. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/definitions.d.ts +90 -0
  153. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/index.d.ts +2 -0
  154. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +64 -0
  155. package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +127 -0
  156. package/types/browser-ui/surface-renderer/shape-palette.d.ts +55 -0
  157. package/types/browser-ui/surface-renderer/surface-decorator.d.ts +35 -0
  158. package/types/browser-ui/surface-renderer/surface-events.d.ts +9 -0
  159. package/types/browser-ui/surface-renderer/surface-render-options.d.ts +125 -0
  160. package/types/browser-ui/surface-renderer/surface.d.ts +665 -0
  161. package/types/browser-ui/svg-component.d.ts +6 -0
  162. package/types/browser-ui/svg-element-connector.d.ts +16 -0
  163. package/types/browser-ui/svg-element-overlay.d.ts +55 -0
  164. package/types/browser-ui/svg-export/definitions.d.ts +153 -0
  165. package/types/browser-ui/svg-export/image-export-ui.d.ts +20 -0
  166. package/types/browser-ui/svg-export/image-exporter.d.ts +15 -0
  167. package/types/browser-ui/svg-export/index.d.ts +6 -0
  168. package/types/browser-ui/svg-export/svg-export-ui.d.ts +11 -0
  169. package/types/browser-ui/svg-export/svg-exporter.d.ts +8 -0
  170. package/types/browser-ui/svg-export/util.d.ts +23 -0
  171. package/types/browser-ui/svg-util.d.ts +27 -0
  172. package/types/browser-ui/templating/browser-ui-recado.d.ts +48 -0
  173. package/types/browser-ui/templating/custom-tag-definition.d.ts +32 -0
  174. package/types/browser-ui/templating/index.d.ts +11 -0
  175. package/types/browser-ui/templating/recado-template-renderer.d.ts +69 -0
  176. package/types/browser-ui/ui-path.d.ts +57 -0
  177. package/types/browser-ui/util.d.ts +4 -0
  178. package/types/browser-ui/wheel-listener.d.ts +2 -0
  179. package/types/charts/area/area-chart.d.ts +85 -0
  180. package/types/charts/area/index.d.ts +1 -0
  181. package/types/charts/bar-and-column/bar-chart.d.ts +34 -0
  182. package/types/charts/bar-and-column/bar-plot.d.ts +90 -0
  183. package/types/charts/bar-and-column/column-chart.d.ts +35 -0
  184. package/types/charts/bar-and-column/index.d.ts +3 -0
  185. package/types/charts/base-chart.d.ts +395 -0
  186. package/types/charts/base-xy-chart.d.ts +224 -0
  187. package/types/charts/bubble/bubble-chart.d.ts +30 -0
  188. package/types/charts/bubble/definitions.d.ts +32 -0
  189. package/types/charts/bubble/index.d.ts +2 -0
  190. package/types/charts/category-value-chart.d.ts +146 -0
  191. package/types/charts/chart-exporter.d.ts +38 -0
  192. package/types/charts/chart-zoom-controls.d.ts +23 -0
  193. package/types/charts/constants.d.ts +16 -0
  194. package/types/charts/css-classes.d.ts +312 -0
  195. package/types/charts/datasource.d.ts +61 -0
  196. package/types/charts/definitions.d.ts +261 -0
  197. package/types/charts/domain_scale_utilities.d.ts +72 -0
  198. package/types/charts/dual-value-chart.d.ts +60 -0
  199. package/types/charts/gauge/definitions.d.ts +108 -0
  200. package/types/charts/gauge/gauge-chart.d.ts +91 -0
  201. package/types/charts/gauge/index.d.ts +2 -0
  202. package/types/charts/index.d.ts +25 -0
  203. package/types/charts/legend.d.ts +120 -0
  204. package/types/charts/line/index.d.ts +1 -0
  205. package/types/charts/line/line-chart.d.ts +79 -0
  206. package/types/charts/markers.d.ts +13 -0
  207. package/types/charts/pie/index.d.ts +1 -0
  208. package/types/charts/pie/pie-chart.d.ts +146 -0
  209. package/types/charts/plot.d.ts +75 -0
  210. package/types/charts/sankey/index.d.ts +1 -0
  211. package/types/charts/sankey/preprocessor.d.ts +37 -0
  212. package/types/charts/sankey/sankey.d.ts +208 -0
  213. package/types/charts/scatter/definitions.d.ts +6 -0
  214. package/types/charts/scatter/index.d.ts +2 -0
  215. package/types/charts/scatter/scatter-chart.d.ts +16 -0
  216. package/types/charts/series/array-based-series.d.ts +95 -0
  217. package/types/charts/series/collation-series.d.ts +24 -0
  218. package/types/charts/series/definitions.d.ts +52 -0
  219. package/types/charts/series/dual-value-chart-series.d.ts +26 -0
  220. package/types/charts/series/index.d.ts +7 -0
  221. package/types/charts/series/record-based-series.d.ts +58 -0
  222. package/types/charts/series/series.d.ts +66 -0
  223. package/types/charts/series/summing-collation-series.d.ts +31 -0
  224. package/types/charts/series/summing-series.d.ts +19 -0
  225. package/types/charts/series-based-chart.d.ts +59 -0
  226. package/types/charts/tooltip.d.ts +167 -0
  227. package/types/charts/util.d.ts +149 -0
  228. package/types/core/astar/astar-path-finder.d.ts +37 -0
  229. package/types/core/astar/astar-util.d.ts +100 -0
  230. package/types/core/astar/candidate-finder.d.ts +16 -0
  231. package/types/core/astar/candidate-sorter.d.ts +10 -0
  232. package/types/core/astar/definitions.d.ts +185 -0
  233. package/types/core/astar/index.d.ts +3 -0
  234. package/types/core/astar/path-to-segments.d.ts +45 -0
  235. package/types/core/autosaver.d.ts +67 -0
  236. package/types/core/color-generator.d.ts +66 -0
  237. package/types/core/constants.d.ts +181 -0
  238. package/types/core/csv-loader.d.ts +84 -0
  239. package/types/core/datamodel/data-model.d.ts +23 -0
  240. package/types/core/datamodel/vertex-definition.d.ts +40 -0
  241. package/types/core/datasource.d.ts +87 -0
  242. package/types/core/event-constants.d.ts +308 -0
  243. package/types/core/event-generator.d.ts +102 -0
  244. package/types/core/filterable-dataset.d.ts +38 -0
  245. package/types/core/geom.d.ts +278 -0
  246. package/types/core/index.d.ts +39 -0
  247. package/types/core/io.d.ts +106 -0
  248. package/types/core/layout/absolute-layout.d.ts +91 -0
  249. package/types/core/layout/abstract-layout-adapter.d.ts +17 -0
  250. package/types/core/layout/abstract-layout.d.ts +192 -0
  251. package/types/core/layout/circular/circular-layout.d.ts +31 -0
  252. package/types/core/layout/circular/index.d.ts +1 -0
  253. package/types/core/layout/empty-layout.d.ts +17 -0
  254. package/types/core/layout/force-directed/force-directed-layout.d.ts +148 -0
  255. package/types/core/layout/force-directed/index.d.ts +1 -0
  256. package/types/core/layout/grid/definitions.d.ts +81 -0
  257. package/types/core/layout/grid/grid-layout.d.ts +60 -0
  258. package/types/core/layout/grid/index.d.ts +2 -0
  259. package/types/core/layout/hierarchical/abstract-hierarchical-layout.d.ts +90 -0
  260. package/types/core/layout/hierarchical/balloon-layout.d.ts +62 -0
  261. package/types/core/layout/hierarchical/definitions.d.ts +45 -0
  262. package/types/core/layout/hierarchical/hierarchical-layout.d.ts +102 -0
  263. package/types/core/layout/hierarchical/index.d.ts +5 -0
  264. package/types/core/layout/hierarchical/parent-relative-placement.d.ts +96 -0
  265. package/types/core/layout/hierarchy/assign-layers-stage.d.ts +26 -0
  266. package/types/core/layout/hierarchy/crossing-stage.d.ts +78 -0
  267. package/types/core/layout/hierarchy/definitions.d.ts +261 -0
  268. package/types/core/layout/hierarchy/edge-routing.d.ts +25 -0
  269. package/types/core/layout/hierarchy/hierarchy-layout-stage.d.ts +9 -0
  270. package/types/core/layout/hierarchy/hierarchy-layout.d.ts +87 -0
  271. package/types/core/layout/hierarchy/index.d.ts +11 -0
  272. package/types/core/layout/hierarchy/model.d.ts +167 -0
  273. package/types/core/layout/hierarchy/parent-relative-placement.d.ts +69 -0
  274. package/types/core/layout/hierarchy/placement-stage.d.ts +82 -0
  275. package/types/core/layout/hierarchy/util.d.ts +13 -0
  276. package/types/core/layout/hierarchy/vertex-set.d.ts +45 -0
  277. package/types/core/layout/index.d.ts +10 -0
  278. package/types/core/layout/layouts.d.ts +10 -0
  279. package/types/core/magnetizer.d.ts +232 -0
  280. package/types/core/model/anchor.d.ts +38 -0
  281. package/types/core/model/cluster.d.ts +19 -0
  282. package/types/core/model/defs.d.ts +8 -0
  283. package/types/core/model/djikstra.d.ts +26 -0
  284. package/types/core/model/floyd-warshall.d.ts +15 -0
  285. package/types/core/model/graph.d.ts +1166 -0
  286. package/types/core/model/path.d.ts +227 -0
  287. package/types/core/params.d.ts +476 -0
  288. package/types/core/renderer.d.ts +74 -0
  289. package/types/core/router/common.d.ts +104 -0
  290. package/types/core/router/direct-router.d.ts +12 -0
  291. package/types/core/router/index.d.ts +3 -0
  292. package/types/core/router/orthogonal-router.d.ts +46 -0
  293. package/types/core/rtree/definitions.d.ts +24 -0
  294. package/types/core/rtree/hilbert.d.ts +9 -0
  295. package/types/core/rtree/index.d.ts +4 -0
  296. package/types/core/rtree/rtree.d.ts +102 -0
  297. package/types/core/rtree/util.d.ts +55 -0
  298. package/types/core/search/index.d.ts +1 -0
  299. package/types/core/search/visuallyjs-search.d.ts +167 -0
  300. package/types/core/selection.d.ts +394 -0
  301. package/types/core/templates/abstract-entry.d.ts +19 -0
  302. package/types/core/templates/comment-entry.d.ts +11 -0
  303. package/types/core/templates/core.d.ts +162 -0
  304. package/types/core/templates/custom-tag.d.ts +74 -0
  305. package/types/core/templates/defs.d.ts +123 -0
  306. package/types/core/templates/each-entry.d.ts +23 -0
  307. package/types/core/templates/element-entry.d.ts +18 -0
  308. package/types/core/templates/elements.d.ts +14 -0
  309. package/types/core/templates/executions.d.ts +100 -0
  310. package/types/core/templates/expressions.d.ts +47 -0
  311. package/types/core/templates/fake-dom.d.ts +42 -0
  312. package/types/core/templates/headless.d.ts +15 -0
  313. package/types/core/templates/if-entry.d.ts +25 -0
  314. package/types/core/templates/index.d.ts +14 -0
  315. package/types/core/templates/parser.d.ts +84 -0
  316. package/types/core/templates/text-entry.d.ts +17 -0
  317. package/types/core/templates/tmpl-entry.d.ts +13 -0
  318. package/types/core/toolkit.d.ts +1314 -0
  319. package/types/core/undo-redo/compound-action.d.ts +19 -0
  320. package/types/core/undo-redo/edge-action.d.ts +62 -0
  321. package/types/core/undo-redo/group-action.d.ts +60 -0
  322. package/types/core/undo-redo/move-action.d.ts +18 -0
  323. package/types/core/undo-redo/node-group-action.d.ts +62 -0
  324. package/types/core/undo-redo/port-action.d.ts +29 -0
  325. package/types/core/undo-redo/renderer-vertex-removed-action.d.ts +17 -0
  326. package/types/core/undo-redo/set-type-action.d.ts +14 -0
  327. package/types/core/undo-redo/undo-redo.d.ts +203 -0
  328. package/types/core/undo-redo/update-action.d.ts +20 -0
  329. package/types/core/undo-redo/vertex-update-action.d.ts +12 -0
  330. package/types/core/util.d.ts +661 -0
  331. package/types/index.d.ts +16 -0
  332. package/types/l.d.ts +2 -0
  333. package/types/test-support/index.d.ts +1 -0
  334. package/types/test-support/test-support.d.ts +833 -0
  335. package/types/ui/common/abstract-segment.d.ts +88 -0
  336. package/types/ui/common/anchor.d.ts +280 -0
  337. package/types/ui/common/connector.d.ts +106 -0
  338. package/types/ui/common/index.d.ts +5 -0
  339. package/types/ui/common/overlay.d.ts +117 -0
  340. package/types/ui/common/paint-style.d.ts +33 -0
  341. package/types/ui/connector-bezier/abstract-bezier-connector.d.ts +68 -0
  342. package/types/ui/connector-bezier/bezier-connector.d.ts +34 -0
  343. package/types/ui/connector-bezier/bezier-segment.d.ts +31 -0
  344. package/types/ui/connector-bezier/bezier.d.ts +129 -0
  345. package/types/ui/connector-bezier/index.d.ts +6 -0
  346. package/types/ui/connector-bezier/operations.d.ts +18 -0
  347. package/types/ui/connector-bezier/quadratic-bezier-connector.d.ts +35 -0
  348. package/types/ui/connector-orthogonal/default-orthogonal-path-compute.d.ts +11 -0
  349. package/types/ui/connector-orthogonal/definitions.d.ts +120 -0
  350. package/types/ui/connector-orthogonal/index.d.ts +7 -0
  351. package/types/ui/connector-orthogonal/modern-source-target-relocator.d.ts +37 -0
  352. package/types/ui/connector-orthogonal/operations.d.ts +49 -0
  353. package/types/ui/connector-orthogonal/stub-calculators.d.ts +12 -0
  354. package/types/ui/connector-orthogonal/utils.d.ts +134 -0
  355. package/types/ui/connector-orthogonal/vertex-avoidance.d.ts +29 -0
  356. package/types/ui/connector-straight/index.d.ts +2 -0
  357. package/types/ui/connector-straight/operations.d.ts +55 -0
  358. package/types/ui/connector-straight/straight-connector.d.ts +121 -0
  359. package/types/ui/copy-paste/clipboard.d.ts +45 -0
  360. package/types/ui/copy-paste/copy-data.d.ts +93 -0
  361. package/types/ui/copy-paste/index.d.ts +2 -0
  362. package/types/ui/core/callbacks.d.ts +48 -0
  363. package/types/ui/core/component/component.d.ts +115 -0
  364. package/types/ui/core/connector/abstract-connector.d.ts +66 -0
  365. package/types/ui/core/connector/arc-segment.d.ts +39 -0
  366. package/types/ui/core/connector/connection-impl.d.ts +81 -0
  367. package/types/ui/core/connector/connections.d.ts +113 -0
  368. package/types/ui/core/connector/connectors.d.ts +205 -0
  369. package/types/ui/core/connector/operations.d.ts +0 -0
  370. package/types/ui/core/connector/segments.d.ts +24 -0
  371. package/types/ui/core/connector/straight-segment.d.ts +32 -0
  372. package/types/ui/core/constants.d.ts +181 -0
  373. package/types/ui/core/context.d.ts +26 -0
  374. package/types/ui/core/core-events.d.ts +7 -0
  375. package/types/ui/core/core.d.ts +1734 -0
  376. package/types/ui/core/css-constants.d.ts +149 -0
  377. package/types/ui/core/defaults.d.ts +242 -0
  378. package/types/ui/core/definitions.d.ts +540 -0
  379. package/types/ui/core/event-constants.d.ts +510 -0
  380. package/types/ui/core/factory/anchor-record-factory.d.ts +17 -0
  381. package/types/ui/core/factory/continuous-anchors.d.ts +27 -0
  382. package/types/ui/core/factory/overlay-factory.d.ts +8 -0
  383. package/types/ui/core/grid-profile.d.ts +28 -0
  384. package/types/ui/core/group-collapse-expand.d.ts +23 -0
  385. package/types/ui/core/group-sizer.d.ts +9 -0
  386. package/types/ui/core/index.d.ts +45 -0
  387. package/types/ui/core/magnetize-profile.d.ts +82 -0
  388. package/types/ui/core/overlay/arrow-overlay.d.ts +34 -0
  389. package/types/ui/core/overlay/custom-overlay.d.ts +38 -0
  390. package/types/ui/core/overlay/diamond-overlay.d.ts +14 -0
  391. package/types/ui/core/overlay/dot-overlay.d.ts +54 -0
  392. package/types/ui/core/overlay/ellipse-overlay.d.ts +60 -0
  393. package/types/ui/core/overlay/label-overlay.d.ts +37 -0
  394. package/types/ui/core/overlay/overlay.d.ts +131 -0
  395. package/types/ui/core/overlay/plain-arrow-overlay.d.ts +15 -0
  396. package/types/ui/core/overlay/rectangle-overlay.d.ts +66 -0
  397. package/types/ui/core/params.d.ts +223 -0
  398. package/types/ui/core/router/astar-path-finder.d.ts +29 -0
  399. package/types/ui/core/router/base-router.d.ts +100 -0
  400. package/types/ui/core/router/default-router.d.ts +38 -0
  401. package/types/ui/core/router/index.d.ts +5 -0
  402. package/types/ui/core/router/router-utils.d.ts +118 -0
  403. package/types/ui/core/router/router.d.ts +30 -0
  404. package/types/ui/core/type-descriptors.d.ts +83 -0
  405. package/types/ui/core/ui-model.d.ts +65 -0
  406. package/types/ui/core/view/common-options.d.ts +15 -0
  407. package/types/ui/core/view/edge-options.d.ts +126 -0
  408. package/types/ui/core/view/events.d.ts +159 -0
  409. package/types/ui/core/view/group-options.d.ts +75 -0
  410. package/types/ui/core/view/index.d.ts +35 -0
  411. package/types/ui/core/view/node-options.d.ts +20 -0
  412. package/types/ui/core/view/node-or-port-options.d.ts +28 -0
  413. package/types/ui/core/view/port-options.d.ts +51 -0
  414. package/types/ui/core/view/vertex-options.d.ts +28 -0
  415. package/types/ui/core/viewport.d.ts +297 -0
  416. package/types/ui/index.d.ts +9 -0
  417. package/types/ui/plugins/definitions.d.ts +118 -0
  418. package/types/ui/plugins/index.d.ts +2 -0
  419. package/types/ui/plugins/plugins.d.ts +7 -0
  420. package/types/ui/property-mappings/definitions.d.ts +28 -0
  421. package/types/ui/property-mappings/index.d.ts +2 -0
  422. package/types/ui/property-mappings/property-mapper.d.ts +16 -0
  423. package/types/ui/util/index.d.ts +3 -0
  424. package/types/ui/util/property-tracker.d.ts +8 -0
  425. package/types/ui/util/svg-constants.d.ts +111 -0
  426. package/types/ui/util/util.d.ts +69 -0
  427. package/types/version.d.ts +1 -0
@@ -0,0 +1,227 @@
1
+ import { VisuallyJsModel } from "../toolkit";
2
+ import { Edge, Group, Node, Vertex } from "./graph";
3
+ import { ShortestPathComponent, ShortestPathResult } from "./djikstra";
4
+ import { FilterableDataset } from "../filterable-dataset";
5
+ /**
6
+ * Options for a Path.
7
+ * @group Data Model
8
+ * @category Graph Objects
9
+ */
10
+ export interface PathOptions {
11
+ /**
12
+ * Path source. Either a vertex (node/group/port) or a vertex id.
13
+ */
14
+ source: string | Vertex;
15
+ /**
16
+ * Path target. Either a vertex (node/group/port) or a vertex id.
17
+ */
18
+ target: string | Vertex;
19
+ /**
20
+ * Sets whether or not paths are searched strictly by the given source/target. If you supply a node as the source, but there are only edges connected to ports on that node, by default these edges will be ignored. Switching `strict` to false will mean these edges are considered.
21
+ */
22
+ strict?: boolean;
23
+ /**
24
+ * This function is given each Node/Group's backing data and asked to return true or false - true means include the Node/Group, false means exclude it.
25
+ * @param n
26
+ */
27
+ nodeFilter?: (n: Node) => boolean;
28
+ /**
29
+ * This function is given each Edge's backing data and asked to return true or false - true means include the Edge, false means exclude it.
30
+ * @param n
31
+ */
32
+ edgeFilter?: (n: Edge) => boolean;
33
+ }
34
+ /**
35
+ * Models the path between two vertices, which consists of a series of vertices connected by edges.
36
+ * @group Data Model
37
+ * @category Graph Objects
38
+ */
39
+ export interface Path extends FilterableDataset {
40
+ /**
41
+ * Deletes, from the underlying model, all of the edges in this path.
42
+ */
43
+ deleteEdges(): void;
44
+ /**
45
+ * Deletes, from the underlying model, all the nodes/groups in this path. As with the `contains` method, there is a special consideration here: if a path passes through ports on a node/group, then that node/group will be, for the purposes of this method, considered to be part of the path and it will be deleted. If you instead wish to delete only the ports in a path, use `deletePorts`. Note that this method will, of course, have the effect of also deleting all the edges, since the nodes/groups for those edges will no longer exist.
46
+ */
47
+ deleteVertices(): void;
48
+ /**
49
+ * Returns true if the path contains the given object (a node, group, port or edge), false otherwise.
50
+ * @param obj Node/Port/Edge, or object id, of the element to test for.
51
+ * @param doNotFuzzyMatchNodes By default, if you pass a node/group in to this method and the path passes through a port on that node/group, this method returns true. But if you set `doNotFuzzyMatchNodes` to true, then this method will return true only if the node/group itself is on the path.
52
+ * @returns True if Path contains the object, false otherwise.
53
+ */
54
+ contains(obj: Edge | Vertex, doNotFuzzyMatchNodes?: boolean): boolean;
55
+ /**
56
+ * Get all the vertices in the path.
57
+ */
58
+ getVertices(): Array<Vertex>;
59
+ /**
60
+ * Retrieve the specified vertex from the path
61
+ * @param obj Either a vertex ID or a node/group/port.
62
+ * @returns A Vertex, if the given vertex is in the path, otherwise null.
63
+ */
64
+ getVertex(obj: string | Vertex): Vertex;
65
+ /**
66
+ * Gets all the edges in the path that are connected to the given vertex.
67
+ * @param v Vertex to get edges for.
68
+ */
69
+ getAllEdgesFor(v: Vertex): Array<Edge>;
70
+ /**
71
+ * Iterates through the path one step at a time. Each step consists of an object containing a `vertex`, and, for all entries except the first, an `edge` member, which supplies the Edge that links to the Vertex (which is why it is null for the first entry).
72
+ * @param fn Function to call for each step.
73
+ */
74
+ each(fn: (i: number, p: ShortestPathComponent) => any): void;
75
+ /**
76
+ * Counts the number of vertices in the Path (including the start and end nodes/groups). Note that for the purposes of this calculation, a Port is considered a vertex, as is a Group.
77
+ */
78
+ getVertexCount(): number;
79
+ /**
80
+ * Gets the Vertex at the given index in the path.
81
+ * @param idx Index of the vertex to retrieve.
82
+ * @returns vertex at the given index, or null if no vertex exists at the given index.
83
+ */
84
+ getNodeAt(idx: number): Vertex;
85
+ /**
86
+ * Counts the number of edges in the path. This may be zero, if the given path spec did not select a valid path in the model.
87
+ */
88
+ getEdgeCount(): number;
89
+ /**
90
+ * Gets the Edge at the given index in the Path.
91
+ * @param idx Index of the Edge to retrieve. You can use negative numbers here: an index of -1 means get the last edge. An index of -2 means get the last but one. etc.
92
+ */
93
+ getEdgeAt(idx: number): Edge;
94
+ /**
95
+ * Removes all vertices and edges in this path from the underlying Toolkit. This is an alias for `deleteVertices`, since deleting a vertex causes its edges to also be deleted.
96
+ */
97
+ deleteAll(): void;
98
+ /**
99
+ * Returns whether or not a given path is empty
100
+ * @returns True if path is empty, false otherwise.
101
+ */
102
+ isEmpty(): boolean;
103
+ /**
104
+ * Gets the cost of the given path. Edges in VisuallyJs can have a cost associated with them (the default is 1), and so the cost of any given path is the sum of the cost of all of the edges in the path.
105
+ * @returns Total cost of the Path. Null if path does not exist.
106
+ */
107
+ getCost(): number;
108
+ /**
109
+ * Returns whether or not a given path exists.
110
+ * @returns True if path exists, false otherwise.
111
+ */
112
+ exists(): boolean;
113
+ /**
114
+ * @internal
115
+ */
116
+ result: ShortestPathResult;
117
+ }
118
+ /**
119
+ * Implementation of the Path interface
120
+ * @internal
121
+ */
122
+ export declare class PathImpl implements Path {
123
+ instance: VisuallyJsModel;
124
+ result: ShortestPathResult;
125
+ private _vertices;
126
+ private _vertexMap;
127
+ /**
128
+ * @param instance model instance from which to get the path info.
129
+ * @param params Path specification
130
+ */
131
+ constructor(instance: VisuallyJsModel, params?: PathOptions);
132
+ /**
133
+ * Deletes, from the underlying model, all of the edges in this path.
134
+ */
135
+ deleteEdges(): this;
136
+ /**
137
+ * Deletes, from the underlying model, all the nodes/groups in this path. As with the `contains` method, there is a special consideration here: if a path passes through ports on a node/group, then that node/group will be, for the purposes of this method, considered to be part of the path and it will be deleted. If you instead wish to delete only the ports in a path, use `deletePorts`. Note that this method will, of course, have the effect of also deleting all the edges, since the nodes/groups for those edges will no longer exist.
138
+ */
139
+ deleteVertices(): this;
140
+ /**
141
+ * Returns true if the path contains the given object (a node, group, port or edge), false otherwise.
142
+ * @param obj Node/Port/Edge, or object id, of the element to test for.
143
+ * @param doNotFuzzyMatchNodes By default, if you pass a node/group in to this method and the path passes through a port on that node/group, this method returns true. But if you set `doNotFuzzyMatchNodes` to true, then this method will return true only if the node/group itself is on the path.
144
+ * @returns True if Path contains the object, false otherwise.
145
+ */
146
+ contains(obj: Edge | Vertex, doNotFuzzyMatchNodes?: boolean): boolean;
147
+ /**
148
+ * Get all the vertices in the path.
149
+ */
150
+ getVertices(): Array<Vertex>;
151
+ /**
152
+ * Retrieve the specified vertex from the path
153
+ * @param obj Either a vertex ID or a node/group/port.
154
+ * @returns A Vertex, if the given vertex is in the path, otherwise null.
155
+ */
156
+ getVertex(obj: string | Vertex): Vertex;
157
+ /**
158
+ * Gets all the edges in the path that are connected to the given vertex.
159
+ * @param v Vertex to get edges for.
160
+ */
161
+ getAllEdgesFor(v: Vertex): Array<Edge>;
162
+ filter(spec: any, includePartials?: boolean): void;
163
+ private _each;
164
+ /**
165
+ * Iterates through the path one step at a time. Each step consists of an object containing a `vertex`, and, for all entries except the first, an `edge` member, which supplies the Edge that links to the Vertex (which is why it is null for the first entry).
166
+ * @param fn Function to call for each step.
167
+ */
168
+ each(fn: (i: number, p: ShortestPathComponent) => any): void;
169
+ /**
170
+ * Iterates through the Nodes/Groups/Ports in the path one step at a time.
171
+ * @param fn Function to call for each step.
172
+ */
173
+ eachVertex(fn: (idx: number, v: Vertex) => any): void;
174
+ /**
175
+ * Iterates through the Edges in the path one step at a time. There is always one fewer Edges than Nodes/Ports.
176
+ * @param fn Function to call for each step.
177
+ */
178
+ eachEdge(fn: (i: number, e: Edge) => any): void;
179
+ /**
180
+ * Iterates through the Nodes in the path one step at a time.
181
+ * @param fn Function to call for each step.
182
+ */
183
+ eachNode(fn: (i: number, n: Node) => void): void;
184
+ /**
185
+ * Iterates through the Groups in the path one step at a time.
186
+ * @param fn Function to call for each step.
187
+ */
188
+ eachGroup(fn: (i: number, g: Group) => void): void;
189
+ /**
190
+ * Counts the number of vertices in the Path (including the start and end nodes/groups). Note that for the purposes of this calculation, a Port is considered a vertex, as is a Group.
191
+ */
192
+ getVertexCount(): number;
193
+ /**
194
+ * Gets the Vertex at the given index in the path.
195
+ * @param idx Index of the vertex to retrieve.
196
+ * @returns vertex at the given index, or null if no vertex exists at the given index.
197
+ */
198
+ getNodeAt(idx: number): Vertex;
199
+ /**
200
+ * Counts the number of edges in the path. This may be zero, if the given path spec did not select a valid path in the Toolkit instance.
201
+ */
202
+ getEdgeCount(): number;
203
+ /**
204
+ * Gets the Edge at the given index in the Path.
205
+ * @param idx Index of the Edge to retrieve. You can use negative numbers here: an index of -1 means get the last edge. An index of -2 means get the last but one. etc.
206
+ */
207
+ getEdgeAt(idx: number): Edge;
208
+ /**
209
+ * Removes all vertices and edges in this path from the underlying Toolkit. This is an alias for `deleteVertices`, since deleting a vertex causes its edges to also be deleted.
210
+ */
211
+ deleteAll(): void;
212
+ /**
213
+ * Returns whether or not a given path is empty
214
+ * @returns True if path is empty, false otherwise.
215
+ */
216
+ isEmpty(): boolean;
217
+ /**
218
+ * Gets the cost of the given path. Edges in the Toolkit can have a cost associated with them (the default is 1), and so the cost of any given path is the sum of the cost of all of the edges in the path.
219
+ * @returns Total cost of the Path. Null if path does not exist.
220
+ */
221
+ getCost(): number;
222
+ /**
223
+ * Returns whether or not a given path exists.
224
+ * @returns True if path exists, false otherwise.
225
+ */
226
+ exists(): boolean;
227
+ }
@@ -0,0 +1,476 @@
1
+ import { Group, Node, ObjectData, Port, Edge, Vertex, Base } from "./model/graph";
2
+ import { VisuallyJsRenderer } from "./renderer";
3
+ import { PointXY } from "./util";
4
+ import { EdgeUpdatedReason, VertexUpdatedReason } from "./toolkit";
5
+ import { VisuallyJsSelection } from "./selection";
6
+ import { ObjectAnchorSpec } from "./model/anchor";
7
+ /**
8
+ * Defines the payload for a node added event.
9
+ * @group Events
10
+ * @category Payloads
11
+ */
12
+ export interface NodeAddedParams {
13
+ node: Node;
14
+ eventInfo?: any;
15
+ parentGroup?: Group;
16
+ }
17
+ /**
18
+ * Defines the payload for a port added event.
19
+ * @group Events
20
+ * @category Payloads
21
+ */
22
+ export interface PortAddedParams {
23
+ vertex: Node | Group;
24
+ data: ObjectData;
25
+ port: Port;
26
+ }
27
+ /**
28
+ * Defines the payload for a selection cleared event.
29
+ * @group Events
30
+ * @category Payloads
31
+ */
32
+ export interface SelectionClearedParams {
33
+ selection: VisuallyJsSelection;
34
+ }
35
+ /**
36
+ * Defines the payload for a selection event.
37
+ * @group Events
38
+ * @category Payloads
39
+ */
40
+ export interface SelectionParams {
41
+ /**
42
+ * Selection this event pertains to
43
+ */
44
+ selection: VisuallyJsSelection;
45
+ /**
46
+ * The subject of the selection event
47
+ */
48
+ obj: Base;
49
+ /**
50
+ * Optional reason for the selection event, which can be passed to the model when selecting some object.
51
+ */
52
+ reason?: string;
53
+ }
54
+ /**
55
+ * Payload for a group member added event in the model.
56
+ * @group Events
57
+ * @category Payloads
58
+ */
59
+ export interface GroupMemberAddedParams {
60
+ /**
61
+ * Vertex that was added to the group
62
+ */
63
+ vertex: Node | Group;
64
+ /**
65
+ * Group the vertex was added to
66
+ */
67
+ group: Group;
68
+ /**
69
+ * Optional original location for the vertex that was added
70
+ */
71
+ originalPosition?: PointXY;
72
+ /**
73
+ * Optional new location for the vertex that was added
74
+ */
75
+ pos?: PointXY;
76
+ /**
77
+ * If a vertex being added to some group is currently a member of some other group, that group is provided here.
78
+ */
79
+ sourceGroup?: Group;
80
+ /**
81
+ * @internal
82
+ */
83
+ source?: VisuallyJsRenderer<any>;
84
+ /**
85
+ * Set to true if the vertex is also brand new, not copied from elsewhere in the dataset.
86
+ */
87
+ vertexIsNew?: boolean;
88
+ /**
89
+ * @internal
90
+ */
91
+ payload?: Record<string, any>;
92
+ positionInGroup?: PointXY;
93
+ }
94
+ /**
95
+ * Payload for a group member removed event in the model
96
+ * @group Events
97
+ * @category Payloads
98
+ */
99
+ export interface GroupMemberRemovedParams {
100
+ /**
101
+ * Vertex that was removed from the group
102
+ */
103
+ vertex: Node | Group;
104
+ /**
105
+ * Group the vertex was removed from
106
+ */
107
+ group: Group;
108
+ /**
109
+ * @internal
110
+ */
111
+ source?: VisuallyJsRenderer<any>;
112
+ /**
113
+ * If the vertex is being moved to some other group, that group is provided here.
114
+ */
115
+ targetGroup?: Group;
116
+ /**
117
+ * Optional new position for the vertex.
118
+ */
119
+ newPosition?: PointXY;
120
+ /**
121
+ * Optional original position for the vertex.
122
+ */
123
+ originalPosition?: PointXY;
124
+ }
125
+ /**
126
+ * Payload for a group added event in the model
127
+ * @group Events
128
+ * @category Payloads
129
+ */
130
+ export interface GroupAddedParams {
131
+ /**
132
+ * Group that was added
133
+ */
134
+ group: Group;
135
+ /** @internal */
136
+ eventInfo?: any;
137
+ /**
138
+ * If the group is a child of some other group, that group is provided here.
139
+ */
140
+ parentGroup?: Group;
141
+ }
142
+ /**
143
+ * Payload for a group added event in the model
144
+ * @group Events
145
+ * @category Payloads
146
+ */
147
+ export interface GroupRemovedParams {
148
+ /**
149
+ * Group that was removed
150
+ */
151
+ group: Group;
152
+ /**
153
+ * If true, indicates the group's children were also removed
154
+ */
155
+ removeChildren?: boolean;
156
+ /**
157
+ * If children were removed, this is the list of them
158
+ */
159
+ children: Array<Node | Group>;
160
+ /**
161
+ * If the group was a member of some other group, that group is provided here
162
+ */
163
+ parentGroup?: Group;
164
+ /**
165
+ * Indicates that the group is being removed because some parent group is being removed and is forcing removal of its children.
166
+ */
167
+ parentGroupIsBeingRemoved: boolean;
168
+ }
169
+ /**
170
+ * Payload for a node removed event in the model
171
+ * @group Events
172
+ * @category Payloads
173
+ */
174
+ export interface NodeRemovedParams {
175
+ /**
176
+ * Node that was removed
177
+ */
178
+ node: Node;
179
+ /**
180
+ * List of edges that are being removed as a result of this node's removal.
181
+ */
182
+ edges: Array<Edge>;
183
+ /**
184
+ * If the node was a member of some other group, that group is provided here
185
+ */
186
+ parentGroup?: Group;
187
+ /**
188
+ * Indicates that the node is being removed because some parent group is being removed and is forcing removal of its children.
189
+ */
190
+ parentGroupIsBeingRemoved: boolean;
191
+ }
192
+ /**
193
+ * Payload for a vertex updated event.
194
+ * @group Events
195
+ * @category Payloads
196
+ */
197
+ export interface VertexUpdatedParams {
198
+ vertex: Node | Group;
199
+ updates: ObjectData;
200
+ originalData: ObjectData;
201
+ originalId?: string;
202
+ originalPortId?: string;
203
+ reason: VertexUpdatedReason;
204
+ port?: Port;
205
+ }
206
+ /**
207
+ * Payload for a port removed event.
208
+ * @group Events
209
+ * @category Payloads
210
+ */
211
+ export interface PortRemovedParams {
212
+ vertex: Node | Group;
213
+ port: Port;
214
+ edges: Array<Edge>;
215
+ }
216
+ /**
217
+ * Payload for a port updated event.
218
+ * @group Events
219
+ * @category Payloads
220
+ */
221
+ export interface PortUpdatedParams {
222
+ vertex: Node | Group;
223
+ port: Port;
224
+ updates: ObjectData;
225
+ originalData: ObjectData;
226
+ originalId: string;
227
+ originalPortId?: string;
228
+ }
229
+ /**
230
+ * Payload for an edge added event
231
+ * @group Events
232
+ * @category Payloads
233
+ */
234
+ export interface EdgeAddedParams {
235
+ edge: Edge;
236
+ source?: VisuallyJsRenderer<any>;
237
+ geometry: any;
238
+ addedByMouse?: boolean;
239
+ transient?: boolean;
240
+ reason: ConnectReason;
241
+ }
242
+ /**
243
+ * Payload for a vertex moved event
244
+ * @group Events
245
+ * @category Payloads
246
+ */
247
+ export interface VertexMovedParams<T> {
248
+ ui: VisuallyJsRenderer<any>;
249
+ dragGroup: Array<{
250
+ el: T;
251
+ pos: PointXY;
252
+ originalPosition: PointXY;
253
+ vertex: Node | Group;
254
+ }>;
255
+ }
256
+ /**
257
+ * Payload for an edge updated event
258
+ * @group Events
259
+ * @category Payloads
260
+ */
261
+ export interface EdgeUpdatedParams {
262
+ edge: Edge;
263
+ updates: ObjectData;
264
+ originalData: ObjectData;
265
+ reason?: EdgeUpdatedReason;
266
+ }
267
+ /**
268
+ * @internal
269
+ */
270
+ export interface RendererAddedParams {
271
+ renderer: VisuallyJsRenderer<any>;
272
+ id: string;
273
+ }
274
+ /**
275
+ * Payload for an event from the undo/redo manager
276
+ * @group Events
277
+ * @category Payloads
278
+ */
279
+ export interface UndoRedoUpdateParams {
280
+ /**
281
+ * Current size of the undo stack
282
+ */
283
+ undoCount: number;
284
+ /**
285
+ * Current size of the redo stack
286
+ */
287
+ redoCount: number;
288
+ }
289
+ /**
290
+ * Payload for an edge path edited event.
291
+ * @group Events
292
+ * @category Payloads
293
+ */
294
+ export interface EdgePathEditedParams {
295
+ /**
296
+ * The UI the user is editing the path on
297
+ */
298
+ ui: VisuallyJsRenderer<any>;
299
+ /**
300
+ * The edge that was edited
301
+ */
302
+ edge: Edge;
303
+ /**
304
+ * The edge's new geometry
305
+ */
306
+ geometry: any;
307
+ /**
308
+ * The edge's original geometry
309
+ */
310
+ originalGeometry: any;
311
+ }
312
+ /**
313
+ * Payload for an edge remove event
314
+ * @group Events
315
+ * @category Payloads
316
+ */
317
+ export interface EdgeRemovedParams {
318
+ edge: Edge;
319
+ source?: any;
320
+ }
321
+ /**
322
+ * Superclass for edge target changed/edge source changed payloads.
323
+ * @group Events
324
+ * @category Payloads
325
+ */
326
+ export interface EdgeVertexChangedParams {
327
+ /**
328
+ * Previous source/target/position
329
+ */
330
+ old?: Vertex | PointXY;
331
+ /**
332
+ * Current source/target
333
+ */
334
+ new?: Vertex | PointXY;
335
+ /**
336
+ * Edge that was updated
337
+ */
338
+ edge: Edge;
339
+ /**
340
+ * Whether or not the operation was successful
341
+ */
342
+ success: boolean;
343
+ /**
344
+ * The UI in which this operation occurred. Not set if the operation was as a result of a programmatic call to the model.
345
+ */
346
+ source?: VisuallyJsRenderer<any>;
347
+ }
348
+ /**
349
+ * Payload for the event fired when an edge target is changed.
350
+ * @group Events
351
+ * @category Payloads
352
+ */
353
+ export interface EdgeTargetChangedParams extends EdgeVertexChangedParams {
354
+ }
355
+ /**
356
+ * Payload for the event fired when an edge source is changed.
357
+ * @group Events
358
+ * @category Payloads
359
+ */
360
+ export interface EdgeSourceChangedParams extends EdgeVertexChangedParams {
361
+ }
362
+ /**
363
+ * Options for the select edges method.
364
+ * @group Edges
365
+ */
366
+ export interface EdgeSelectionParams {
367
+ source?: string | Vertex;
368
+ target?: string | Vertex;
369
+ element?: string | Vertex;
370
+ filter?: (e: Edge) => boolean;
371
+ }
372
+ /**
373
+ * @internal
374
+ */
375
+ export interface EdgeGeometryParams {
376
+ edge: Edge;
377
+ geometry: any;
378
+ originalGeometry: any;
379
+ }
380
+ export declare const CONNECT_REASON_UNDO_REDO = "undoRedo";
381
+ export declare const CONNECT_REASON_USER_ACTIVITY = "userActivity";
382
+ export declare const CONNECT_REASON_API = "api";
383
+ export declare const CONNECT_REASON_DATA_LOAD = "dataLoad";
384
+ export declare const CONNECT_REASON_TRANSIENT = "transient";
385
+ export declare const CONNECT_REASON_COPY_PASTE = "copyPaste";
386
+ export type ConnectReason = typeof CONNECT_REASON_API | typeof CONNECT_REASON_UNDO_REDO | typeof CONNECT_REASON_USER_ACTIVITY | typeof CONNECT_REASON_DATA_LOAD | typeof CONNECT_REASON_TRANSIENT | typeof CONNECT_REASON_COPY_PASTE;
387
+ /**
388
+ * Options for loading data.
389
+ * @group Model
390
+ * @category Input and Output
391
+ */
392
+ export interface LoadOptions {
393
+ /**
394
+ * Specifies the data type of the data to load. Defaults to `json`. This must match the name of a loader registered with the given instance of VisuallyJs.
395
+ */
396
+ type?: string;
397
+ /**
398
+ * Optional. JSON data to load directly.
399
+ */
400
+ data?: any;
401
+ /**
402
+ * URL to retrieve data from. Optional, but you need to supply either this or `data`.
403
+ */
404
+ url?: string;
405
+ /**
406
+ * Optional, defaults to false. Tells VisuallyJs that the data is coming via JSON-P.
407
+ */
408
+ jsonp?: boolean;
409
+ /**
410
+ * Optional callback to execute once the data has loaded. Most often used when you are retrieving remote data (using `url`)
411
+ */
412
+ onload?: Function;
413
+ /**
414
+ * Optional parameters to pass to the loader.
415
+ */
416
+ parameters?: Record<string, any>;
417
+ /**
418
+ * Optional function to call on load error.
419
+ * @param e
420
+ * @param status
421
+ */
422
+ error?: (e: any, status?: any) => any;
423
+ /**
424
+ * Optional map of HTTP header values, if loading via URL.
425
+ */
426
+ headers?: Record<string, string>;
427
+ /**
428
+ * Optional dataType to pass in the request
429
+ */
430
+ dataType?: string;
431
+ /**
432
+ * By default the model's load method is incremental, meaning it does not clear itself when loading new data. Set this flag to `false` if you want the model to call `clear()` after parsing the data (either passed in directly or having been retrieved from a url) and before loading it.
433
+ */
434
+ incremental?: boolean;
435
+ }
436
+ /**
437
+ * Options for the `addEdge` method in the {@link VisuallyJsModel} class.
438
+ * @group Edges
439
+ */
440
+ export interface AddEdgeOptions {
441
+ /**
442
+ * Source for the edge - a vertex, vertex id, or canvas location.
443
+ */
444
+ source: Vertex | string | PointXY;
445
+ /**
446
+ * Target for the edge - a vertex, vertex id, or canvas location.
447
+ */
448
+ target: Vertex | string | PointXY;
449
+ /**
450
+ * Optional edge geometry.
451
+ */
452
+ geometry?: any;
453
+ /**
454
+ * Optional backing data for the edge.
455
+ */
456
+ data?: any;
457
+ /**
458
+ * Optional edge cost. Defaults to 1.
459
+ */
460
+ cost?: number;
461
+ /**
462
+ * By default edges are not directed. This is used only when computing paths between vertices.
463
+ */
464
+ directed?: boolean;
465
+ /**
466
+ * @internal
467
+ */
468
+ transient?: boolean;
469
+ /**
470
+ * Optional anchors for the edge.
471
+ */
472
+ anchors?: {
473
+ source?: ObjectAnchorSpec;
474
+ target?: ObjectAnchorSpec;
475
+ };
476
+ }