@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,1734 @@
1
+ import { UICoreDefaults, UICoreOptions } from "./defaults";
2
+ import { Overlay, OverlayPaintParams } from "./overlay/overlay";
3
+ import { RedrawResult, Router } from "./router/router";
4
+ import { CompiledTypeDescriptor, TypeDescriptorBase } from './type-descriptors';
5
+ import { ConnectionEstablishedParams } from "./callbacks";
6
+ import { Viewport, ViewportElement, ViewportGroupElement, ViewportNodeElement } from "./viewport";
7
+ import { ComponentBase } from './component/component';
8
+ import { LabelOverlay } from './overlay/label-overlay';
9
+ import { AnchorSpec, LightweightAnchor, FullOverlaySpec, OverlaySpec, Connector, PaintStyle, ConnectorSpec } from "../common";
10
+ import { GroupRelayoutReason } from './event-constants';
11
+ import { Connection } from "./connector/connection-impl";
12
+ import { Base, Edge, Group, Node, ObjectData, Port, Vertex, IntersectingVertex, PortRemovedParams, PortAddedParams, ProxyLocation, ObjectAnchorSpec } from "../../core";
13
+ import { UIModel, UIObjectInfo } from "./ui-model";
14
+ import { GroupMapping, NodeMapping, NodeOrGroupMapping, PortMapping, VertexMapping } from "./view";
15
+ import { Magnetizer, MagnetizeResult } from "../../core/magnetizer";
16
+ import { AbstractLayout, LayoutParameters, LayoutResultSet } from "../../core/layout/abstract-layout";
17
+ import { DataSource, EdgeAddedParams, EdgeRemovedParams, EdgeSourceChangedParams, EdgeTargetChangedParams, Extents, FilterableDataset, Grid, GroupAddedParams, GroupMemberAddedParams, GroupMemberRemovedParams, GroupRemovedParams, NodeAddedParams, NodeRemovedParams, OptimisticEventGenerator, PointXY, RectangleXY, VisuallyJsSelection, Size, VisuallyJsRenderer, VertexUpdatedParams, VisuallyJsModel, SaveOptions, Rotations, AbstractLayoutAdapter } from "../../core";
18
+ import { DataHook, ElementType, EnclosedVerticesOptions, GroupContentAreaInfo, GroupResizeResult, IntersectingVerticesOptions, UIExportOptions, UISaveData, ViewportBounds, ZoomToElementsOptions, ZoomToFitIfNecessaryOptions, ZoomToFitOptions } from "./definitions";
19
+ import { GridProfile } from "./grid-profile";
20
+ import { MagnetizeProfile } from "./magnetize-profile";
21
+ import { UIPlugin, UIPluginOptions, UIPluginSpec } from "../plugins/definitions";
22
+ import { CoreUIEvent } from "./core-events";
23
+ /**
24
+ * @internal
25
+ */
26
+ export type GroupSizeInfo = {
27
+ position: PointXY;
28
+ size: Size;
29
+ originalSize: Size;
30
+ layoutShiftX: number;
31
+ layoutShiftY: number;
32
+ };
33
+ /**
34
+ * Options for the cloneVertex method.
35
+ * @group Components
36
+ * @category Options
37
+ */
38
+ export interface VertexCloneOptions {
39
+ /**
40
+ * Optional position to use for the new vertex
41
+ */
42
+ newPosition?: PointXY;
43
+ /**
44
+ * Defaults to 50 pixels in X and Y - the offset to use for the new vertex's position. Ignored if you provide newPosition.
45
+ */
46
+ offsetPosition?: PointXY;
47
+ /**
48
+ * When the UI is in constant magnetize mode, the default behaviour - if you do not provide a newPosition - is to magnetize a newly cloned vertex, so that it moves to fit into whitespace. Without this, when the user drags a newly cloned vertex that is overlapping the vertex it was cloned from, the original vertex is magnetized out of the way, and the experience is a bit disconcerting for the user. When the UI is not in constant magnetize mode, the default is to not magnetize. Set this flag explicitly to get the behaviour you desire if the default doesnt suit.
49
+ */
50
+ magnetize?: boolean;
51
+ /**
52
+ * If true, the newly cloned vertex will be set as the model's current selection.
53
+ */
54
+ selectAfterCreate?: boolean;
55
+ }
56
+ /**
57
+ * Defines the simple properties for an edge style.
58
+ * @group Edges
59
+ */
60
+ export interface LineStyle {
61
+ /**
62
+ * Width of the edge path
63
+ */
64
+ lineWidth?: number;
65
+ /**
66
+ * Width to draw the edge's outline path
67
+ */
68
+ outlineWidth?: number;
69
+ /**
70
+ * Color to paint the edge's path
71
+ */
72
+ color?: string;
73
+ /**
74
+ * Color to paint the edge's outline path
75
+ */
76
+ outlineColor?: string;
77
+ /**
78
+ * Definition of dash pattern to use to draw the edge path
79
+ */
80
+ dashArray?: string;
81
+ }
82
+ /**
83
+ * Base UI for apps and diagrams.
84
+ * @internal
85
+ */
86
+ export declare abstract class UICore<EL, EVT = CoreUIEvent> extends OptimisticEventGenerator<EVT | CoreUIEvent> implements VisuallyJsRenderer<EL> {
87
+ protected _boundToolkitEvents: Array<any>;
88
+ protected _boundCanvasEvents: Array<[string, Function]>;
89
+ containerType: ElementType;
90
+ id: string;
91
+ defaults: UICoreDefaults<EL>;
92
+ private _initialDefaults;
93
+ hoverSuspended: boolean;
94
+ _suspendDrawing: boolean;
95
+ _suspendedAt: string;
96
+ $_dataLoading: boolean;
97
+ zoomToFitOnLoad: boolean;
98
+ plugins: Array<UIPlugin<EL, any, any>>;
99
+ pluginMap: Map<string, UIPlugin<EL, any, any>>;
100
+ connectorClass: string;
101
+ connectorOutlineClass: string;
102
+ connectorPathClass: string;
103
+ overlayClass: string;
104
+ labelOverlayClass: string;
105
+ /** @internal */
106
+ $_connMap: Record<string, Connection<EL>>;
107
+ allowNestedGroups: boolean;
108
+ $_discardEdgeEditsOnDrag: boolean;
109
+ $_vertexBuffer: number;
110
+ $_vertexBorder: number;
111
+ private _$_edgesAvoidVertices;
112
+ readonly viewport: Viewport<EL>;
113
+ readonly router: Router<EL, any>;
114
+ private _connectionTypes;
115
+ protected _container: EL;
116
+ private _pendingGroupsToSize;
117
+ private _DEFAULT_SCOPE;
118
+ get defaultScope(): string;
119
+ $defaultConnector: ConnectorSpec;
120
+ $defaultOverlays: Array<FullOverlaySpec>;
121
+ $defaultAnchor: AnchorSpec;
122
+ $defaultAnchors: [AnchorSpec, AnchorSpec];
123
+ private _sourceMarker;
124
+ private _targetMarker;
125
+ /**
126
+ * Set by helper classes when something is in motion. We use this to assist in deciding whether or not to respond to certain events (such as disable hover on edges when something is being dragged)
127
+ * @internal
128
+ */
129
+ protected $isInMotion: boolean;
130
+ magnetizerProfile: MagnetizeProfile;
131
+ protected magnetizer: Magnetizer<Vertex>;
132
+ /**
133
+ * Map of vertices that have been passed to the renderer but which have not yet been reported as rendered. Users of the API should not modify the contents of this map.
134
+ * @internal
135
+ */
136
+ protected $unrenderedVertices: Map<string, {
137
+ vertex: Vertex;
138
+ def: any;
139
+ eventInfo: any;
140
+ }>;
141
+ /**
142
+ * Map of group member added events which have not yet been processed, due to the group in question not having yet been rendered at the time the event was fired. The contents of this map are processed whenever a new group is added. Users of the API should not modify the contents of this map.
143
+ * @internal
144
+ */
145
+ protected $unprocessedGroupMemberships: Map<string, Array<GroupMemberAddedParams>>;
146
+ get $modelTopAttribute(): string;
147
+ get $modelLeftAttribute(): string;
148
+ get $modelWidthAttribute(): string;
149
+ get $modelHeightAttribute(): string;
150
+ get $modelRotationAttribute(): string;
151
+ $_useModelForSizes: boolean;
152
+ $_writeSizeToElements: boolean;
153
+ $_useModelForPositions: boolean;
154
+ readonly $_allowUnattachedEdges: boolean;
155
+ readonly $_edgesDetachable: boolean;
156
+ readonly $_reattachEdges: boolean;
157
+ readonly $paintConnectorOutline: boolean;
158
+ readonly $connectorOutlineColor: string;
159
+ readonly $connectorOutlineWidth: number;
160
+ private _zoom;
161
+ get currentZoom(): number;
162
+ /**
163
+ * @internal
164
+ * @protected
165
+ */
166
+ protected $collapsedGroupSizeCalculator: (group: Group, currentSize: Size) => Size;
167
+ private _defaultCollapsedGroupSize;
168
+ private _canCollapse;
169
+ private _canExpand;
170
+ /**
171
+ * @internal
172
+ */
173
+ view: UIModel<EL>;
174
+ /**
175
+ * @internal
176
+ */
177
+ gridProfile: GridProfile;
178
+ /**
179
+ * Method to invoke on connection established. Subclasses may wish to provide this.
180
+ * @internal
181
+ */
182
+ $connectionEstablished: (payload: ConnectionEstablishedParams) => any;
183
+ vertexList: Array<Node>;
184
+ /**
185
+ * Defaults to false. When true, if a port is added to a vertex programmatically, the UI treats the vertex's element as the element for the port if it cannot find a specific element for the port.
186
+ * @internal
187
+ */
188
+ logicalPorts: boolean;
189
+ /**
190
+ * Optional filter used to determine whether or not we want to render some specific object.
191
+ */
192
+ objectFilter: (b: Base) => boolean;
193
+ /**
194
+ * Map of layouts for groups. Do not manipulate the contents of this map.
195
+ * @internal
196
+ */
197
+ layoutMap: Map<string, AbstractLayout<any>>;
198
+ /**
199
+ * Current layout.
200
+ * @internal
201
+ */
202
+ $_layout: AbstractLayout<any>;
203
+ /**
204
+ * The underlying data model. You can access this on any instance of the UI to manipulate the data model - to add, remove, update model objects, create selections, etc.
205
+ */
206
+ model: VisuallyJsModel;
207
+ /**
208
+ * The data model that is being rendered. In the majority of cases this points to the same object as `model`, but you can render some subset of a data model, such as a dynamically updated Selection.
209
+ */
210
+ dataSource: DataSource;
211
+ /**
212
+ * @internal
213
+ */
214
+ private _refreshLayoutOnEdgeConnect;
215
+ /**
216
+ * @internal
217
+ */
218
+ private _simpleEdgeStyles;
219
+ /**
220
+ * The root element the UI is hosted in.
221
+ * @internal
222
+ */
223
+ rootElement: EL;
224
+ protected constructor(model: VisuallyJsModel, dataSource: DataSource, rootElement: EL, options: UICoreOptions<EL, any>, defaults?: UICoreDefaults<EL>);
225
+ /**
226
+ * Gets the Layout this surface is currently using.
227
+ */
228
+ getLayout(): AbstractLayout<any>;
229
+ /**
230
+ * Directly sets the size of a group element (using the `setSize` method, which abstracts out if its an HTML or SVG element)
231
+ * @internal
232
+ * @param group
233
+ * @param size
234
+ */
235
+ abstract $setGroupElementSize(group: Group, size: Size): void;
236
+ /**
237
+ * Notification from the model that the target for some edge has changed.
238
+ * @param data
239
+ * @private
240
+ */
241
+ $edgeTargetChanged(data: EdgeTargetChangedParams): void;
242
+ $select(d: {
243
+ append: boolean;
244
+ obj: Base;
245
+ selection: VisuallyJsSelection;
246
+ }): void;
247
+ /**
248
+ *
249
+ * @param val Subclasses should override
250
+ * @param thenRefresh
251
+ * @internal
252
+ */
253
+ setSuspendRendering(val: boolean, thenRefresh?: boolean): void;
254
+ $deselect(d: {
255
+ selection: VisuallyJsSelection;
256
+ obj: Base;
257
+ }): void;
258
+ $selectionCleared(sel: VisuallyJsSelection): any;
259
+ private __findAndRegisterPortElement;
260
+ /**
261
+ * Notification from the model that the source for some edge has changed.
262
+ * @param data
263
+ * @private
264
+ * @internal
265
+ */
266
+ $edgeSourceChanged(data: EdgeSourceChangedParams): void;
267
+ /**
268
+ * Part of the renderer contract: the model wants to know if this renderer is destroyed.
269
+ * @param cb
270
+ * @internal
271
+ */
272
+ onDestroy(cb: (r: VisuallyJsRenderer<EL>) => any): void;
273
+ /**
274
+ * Bind to an event on the model. Always use this method when you bind something new, because it tracks the various bindings, allowing us to unregister them from the model if/when this component gets destroyed.
275
+ * @param evt
276
+ * @param fn
277
+ * @internal
278
+ */
279
+ private __bindToToolkit;
280
+ /**
281
+ * Called upon receiving an EVENT_DATA_LOAD_START from the model. TODO this should also be the first entry for the internal code that loads a model's existing data when the Surface is created.
282
+ * @internal
283
+ */
284
+ $dataLoadStart(): void;
285
+ /**
286
+ * Called upon receiving an EVENT_DATA_APPEND_START from the model.
287
+ * @internal
288
+ */
289
+ $dataAppendStart(): void;
290
+ $dataAppendEnd(noDataWasAppended?: boolean): void;
291
+ /**
292
+ This method needs to be updated to work with _setDataLoading to ensure that all vertices for some batch load have been rendered before the stuff here happens. Vertices might be painted async by the underlying template engine, such as React 18 or Vue 3.
293
+ * @param noDataWasLoaded
294
+ * @internal
295
+ */
296
+ $dataLoadEnd(noDataWasLoaded?: boolean): void;
297
+ /**
298
+ * Zooms the display so that all the tracked elements fit inside the viewport. This method will also, by default, increase the zoom if necessary - meaning the default behaviour is to adjust the zoom so that the content fills the viewport. You can suppress zoom increase by setting `doNotZoomIfVisible:true` on the parameters to this method.
299
+ * @tags zoom
300
+ */
301
+ zoomToFit(params?: ZoomToFitOptions): void;
302
+ /**
303
+ * Zooms the display so that all the tracked elements fit inside the viewport, but does not make any adjustments to zoom if all the elements are currently visible (it still does center the content though).
304
+ * @tags zoom
305
+ */
306
+ zoomToFitIfNecessary(params?: ZoomToFitIfNecessaryOptions): void;
307
+ /**
308
+ * Zooms the viewport so that all of the given elements are visible.
309
+ * @param zParams
310
+ * @tags zoom
311
+ */
312
+ zoomToElements(zParams: ZoomToElementsOptions<EL>): void;
313
+ /**
314
+ * Clones the given vertex. NOTE: this does not clone the children of a group. Only the group will be cloned, and it will be empty.
315
+ * @param vertex
316
+ * @param options Optional position to use for the new vertex. May be null.
317
+ */
318
+ cloneVertex(vertex: string | Node | Group | Element, options?: VertexCloneOptions): Node | Group | null;
319
+ _loadExistingData(): boolean;
320
+ /**
321
+ * list of edges that are as-yet unrendered due to one or both of their vertices not having been rendered.
322
+ * @internal
323
+ */
324
+ private _unrenderedEdges;
325
+ /**
326
+ * @internal
327
+ */
328
+ $_hasUnrenderedEdges(): boolean;
329
+ private _resolveSourceAndTargetTypes;
330
+ /**
331
+ * Extract simple edge styles from the given edge data and apply to the given object, returning true if one or more styles were extracted.
332
+ * @param edge
333
+ * @param o
334
+ * @internal
335
+ */
336
+ $_extractSimpleEdgeStyles(data: ObjectData, o: Record<string, any>): boolean;
337
+ private _doRenderEdgeNew;
338
+ /**
339
+ * @internal
340
+ */
341
+ $graphClearStart(): void;
342
+ /**
343
+ * @internal
344
+ */
345
+ $graphClearEnd(): void;
346
+ /**
347
+ * Notification from the model that a group was removed. We remove the managed element, and, optionally, managed elements for its children, if the children were removed.
348
+ * @internal
349
+ */
350
+ $groupRemoved(deletion: GroupRemovedParams): ViewportGroupElement<EL>;
351
+ /**
352
+ * Queues up an edge for rendering, perhaps rendering it immediately if its vertices are both available. Otherwise whenever a new vertex is rendered we'll check to see if the edge can then be rendered.
353
+ * @param edge
354
+ * @param flushNow
355
+ * @internal
356
+ */
357
+ private _enqueueEdge;
358
+ /**
359
+ * Checks the list of edges that are currently unrendered to see if there are any for which the vertices have now
360
+ * been rendered, and therefore the edge can be rendered. For internal use.
361
+ * @internal
362
+ */
363
+ private $flushUnrenderedEdges;
364
+ /**
365
+ * Check to see if an edge can be rendered (ie. there is an element available for both its source and target), and
366
+ * if so, render it.
367
+ * @internal
368
+ */
369
+ private _maybeRenderEdge;
370
+ $edgeAdded(data: EdgeAddedParams, context?: Record<string, any>): void;
371
+ $edgeRemoved(data: EdgeRemovedParams): void;
372
+ /**
373
+ * Callback from the model when the geometry for some edge has been updated.
374
+ * @internal
375
+ * @param edge
376
+ * @param geometry
377
+ * @param originalGeometry
378
+ * @private
379
+ */
380
+ $edgeGeometryUpdated(edge: Edge, geometry: any, originalGeometry: any): void;
381
+ $exportEdgeGeometry(edge: Edge): any;
382
+ $nodeAdded(params: NodeAddedParams): void;
383
+ $groupAdded(params: GroupAddedParams): void;
384
+ $portAdded(p: PortAddedParams): void;
385
+ $vertexUpdated(p: VertexUpdatedParams): void;
386
+ private __fireVertexMovedEvent;
387
+ private __fireNodeRemovedEvent;
388
+ /**
389
+ * Gets the layout that is managing the given vertex: if its inside a group, the layout is the layout for the vertex's parent group. Otherwise the layout is the surface's layout.
390
+ * @internal
391
+ * @param obj
392
+ */
393
+ getLayoutFor(obj: Vertex): AbstractLayout<any>;
394
+ /**
395
+ * Notification from the model that a vertex was added to a group. We attempt to execute this immediately but in some cases the renderer hasnt rendered the group yet, in which case we enqueue the addition, and we'll process it when we are notified that the given group has been rendered.
396
+ * @param p
397
+ * @private
398
+ * @internal
399
+ */
400
+ $groupMemberAdded(p: GroupMemberAddedParams): void;
401
+ /**
402
+ * Attempts to process the addition of some child vertex to a group, returning true if successful and false if not (it is possible the group has not yet been rendered).
403
+ * @param p
404
+ * @private
405
+ */
406
+ private $_processGroupAddition;
407
+ /**
408
+ * Notification from the model that a vertex was removed from a group.
409
+ * @param p
410
+ * @private
411
+ * @internal
412
+ */
413
+ $groupMemberRemoved(p: GroupMemberRemovedParams): void;
414
+ /**
415
+ * Notification from the model that a node was removed
416
+ * @internal
417
+ * @param deletion
418
+ */
419
+ $nodeRemoved(deletion: NodeRemovedParams): ViewportElement<EL>;
420
+ /**
421
+ * Notification from the model that a port was removed
422
+ * @internal
423
+ * @param deletion
424
+ */
425
+ $portRemoved(deletion: PortRemovedParams): void;
426
+ /**
427
+ * Notification from the model that an edge type changed. We check for an edge definition for the new type and
428
+ * adjust anything we need to if we find one.
429
+ * @param edge
430
+ * @param previousType
431
+ * @param newType
432
+ * @private
433
+ * @internal
434
+ */
435
+ $edgeTypeChanged(edge: Edge, previousType: string, newType: string): void;
436
+ /**
437
+ * Notification from the model that a group type changed. NOP, currently.
438
+ * @internal
439
+ * @param group
440
+ * @param previousType
441
+ * @param newType
442
+ * @private
443
+ * @internal
444
+ */
445
+ $groupTypeChanged(group: Group, previousType: string, newType: string): void;
446
+ /**
447
+ * Notification from the model that a node type changed.
448
+ * @internal
449
+ * @param node
450
+ * @param previousType
451
+ * @param newType
452
+ * @private
453
+ */
454
+ $nodeTypeChanged(node: Node, previousType: string, newType: string): void;
455
+ /**
456
+ * Notification from the model that a poty type changed. NOP, currently.
457
+ * @internal
458
+ * @param port
459
+ * @param previousType
460
+ * @param newType
461
+ * @private
462
+ * @internal
463
+ */
464
+ $portTypeChanged(port: Port, previousType: string, newType: string): void;
465
+ /**
466
+ * Notification from a template engine that a vertex was rendered
467
+ * @param v
468
+ * @param el
469
+ * @param def
470
+ * @param eventInfo
471
+ * @internal
472
+ */
473
+ $vertexRendered<N extends Vertex>(v: N, el: EL, def: VertexMapping<any, EL>, eventInfo?: {
474
+ position: PointXY;
475
+ }): void;
476
+ /**
477
+ * Toggle the visible state of some edge.
478
+ * @param edge
479
+ * @param state
480
+ * @param doNotCascade
481
+ * @internal
482
+ */
483
+ private __toggleEdge;
484
+ /**
485
+ * Returns whether or not the given model object is visible.
486
+ * @param obj
487
+ */
488
+ isVisible(obj: Base): any;
489
+ /**
490
+ * Sets the visible state of some model object or group of model objects. If the object is a vertex, the visible state will be applied to all edges connected to the given vertex.
491
+ *
492
+ * By default this method will, for groups and nodes, cascade down to any nested vertices.
493
+ * @param obj - Edge, Group, Node or Port, and array of these, or a `FilterableDataset`, such as a `Selection`.
494
+ * @param state - True if edges should be visible, false otherwise.
495
+ * @param doNotCascade - Defaults to false. If true, don't cascade down to any nested vertices.
496
+ *
497
+ */
498
+ setVisible(obj: FilterableDataset | ArrayLike<Edge | Group | Node | Port> | Base, state: boolean, doNotCascade?: boolean): void;
499
+ private __toggleNode;
500
+ /**
501
+ *
502
+ * @internal
503
+ */
504
+ private _applyFunctionToObject;
505
+ /**
506
+ * Get a size for the given vertex based upon its backing data, and if there are no width/height values
507
+ * in the backing data, use the default from either the node/group definition mapping the vertex, or
508
+ * the node/group default.
509
+ * @param v
510
+ * @param def
511
+ * @internal
512
+ */
513
+ protected $resolveVertexSizeFromModel(v: Vertex, def: VertexMapping<any, EL>): Size;
514
+ /**
515
+ * Gets the size to use for the given vertex according to the current defaults - either as specified in the vertex
516
+ * definition, or if that is not present, from the instance defaults for the vertex type (either group or node).
517
+ * @param v
518
+ * @param def
519
+ */
520
+ protected $_getDefaultSizeForVertex(v: Vertex, def: NodeOrGroupMapping<any, EL, any>): Size;
521
+ /**
522
+ * Gets the size for the given vertex by reading its data object. Returns null if a value for both width and height
523
+ * are not found.
524
+ * @param v
525
+ */
526
+ protected $_getModelSizeForVertex(v: Vertex): Size | null;
527
+ getContainer(): any;
528
+ /**
529
+ * Sets the current zoom. Subclasses can/should override this to do anything specific related to their internal architecture.
530
+ * @param z
531
+ * @param animate
532
+ */
533
+ setZoom(z: number, animate?: boolean): number;
534
+ /**
535
+ * Gets the internal ID for the given element by reading the value of its ATTRIBUTE_MANAGED attribute; writing a value for that attribute if it is not currently set.
536
+ * @internal
537
+ * @param element
538
+ */
539
+ _getId(element: EL): string;
540
+ /**
541
+ * @internal
542
+ * @param c
543
+ */
544
+ setContainer(c: EL): void;
545
+ private _set;
546
+ /**
547
+ * Change the source of the given connection to be the given element.
548
+ * @param connection
549
+ * @param el
550
+ * @internal
551
+ */
552
+ private __setSource;
553
+ /**
554
+ * Change the target of the given connection to be the given element.
555
+ * @param connection
556
+ * @param el
557
+ * @internal
558
+ */
559
+ private __setTarget;
560
+ /**
561
+ * Sets the type of a connection and then repaints it.
562
+ * @param connection
563
+ * @param type
564
+ * @internal
565
+ */
566
+ private $_setConnectionType;
567
+ /**
568
+ * Sets whether or not drawing is suspended.
569
+ * @param val - True to suspend, false to enable.
570
+ * @param repaintAfterwards - If true, repaint everything afterwards.
571
+ * @internal
572
+ */
573
+ protected $_setSuspendDrawing(val?: boolean, repaintAfterwards?: boolean): boolean;
574
+ /**
575
+ * Suspend drawing, run the given function, and then re-enable drawing, optionally repainting everything.
576
+ * @param fn - Function to run while drawing is suspended.
577
+ * @param doNotRepaintAfterwards - Whether or not to repaint everything after drawing is re-enabled.
578
+ * @internal
579
+ */
580
+ $batch(fn: Function, doNotRepaintAfterwards?: boolean): void;
581
+ /**
582
+ * Update the cached offset information for some element.
583
+ * @param params
584
+ * @returns an UpdateOffsetResult containing the offset information for the given element.
585
+ * @internal
586
+ */
587
+ private _updateOffset;
588
+ private _beforeDetach;
589
+ /**
590
+ * Delete the given connection. Do not call this method as part of the API. It will not result in the model being
591
+ * updated. This method is called in response to model changes.
592
+ * @param connection - Connection to delete.
593
+ * @param params - Optional extra parameters.
594
+ * @internal
595
+ */
596
+ private _deleteConnection;
597
+ /**
598
+ * Manage an element. Adds the element to the viewport and sets up tracking for connections for the element
599
+ * @param element - Element to manage. An element of the type the current renderer works with. In the browser-ui package, for example, this is a DOM element.
600
+ * @internal
601
+ */
602
+ $manage(element: EL, modelObject: Vertex, position: PointXY, size: Size, rotation: number, _recalc: boolean): ViewportElement<EL>;
603
+ /**
604
+ * Gets the managed element with the given ID from the list managed elements, null if not currently managed.
605
+ * @param id
606
+ * @internal
607
+ */
608
+ $getManagedElement<N extends ViewportElement<EL>>(id: string): N;
609
+ /**
610
+ * Stops managing the given element, removing it from internal tracking and clearing the custom attribute that is added by VisuallyJs to mark it as managed. This method fires an 'element:unmanage' event containing the unmanaged element and its managed id.
611
+ * @param el - Element, or ID of the element to stop managing.
612
+ * @param removeElement - If true, also remove the element from the renderer.
613
+ * @internal
614
+ */
615
+ $__unmanage(el: EL, removeChildren: boolean, removeElement: boolean): void;
616
+ /**
617
+ * Rotate the given vertex by the given number of degrees. The UI element representing the vertex is rotated and the view is updated, and an event is pushed to the undo stack.
618
+ * @param obj - Either a vertex ID, or a Node/Group
619
+ * @param amountInDegrees - Amount - in degrees - to rotate.
620
+ */
621
+ rotate(obj: string | Vertex, amountInDegrees: number): void;
622
+ /**
623
+ * Sets the width and height of the given vertex, updating the UI and the model, and adding an event to the undo stack. NOTE this method may not have entirely the effect you want unless you have `useModelForSizes` set in the constructor options for this UI instance.
624
+ * @param obj
625
+ * @param width
626
+ * @param height
627
+ */
628
+ setSize(obj: string | Vertex, width: number, height: number): void;
629
+ /**
630
+ * Sets rotation for the element to the given number of degrees (not radians). A value of null is treated as a rotation of 0 degrees. Updates the viewport, and expects subclasses to update the UI to reflect the rotation. DOES NOT update the model, or add anything to the undo stack.
631
+ * @param element - Element to rotate
632
+ * @param rotation - Amount to rotate, in degrees.
633
+ * @param _doNotRepaint - For internal use.
634
+ * @internal
635
+ */
636
+ private _rotateElement;
637
+ abstract $isTouchDevice(): boolean;
638
+ abstract $syncManagedElementWithView(mel: ViewportElement<EL>, andThenRepaint: boolean): void;
639
+ /**
640
+ * Gets the current bounds of the UI's viewport.
641
+ */
642
+ abstract getViewportBoundsInfo(): ViewportBounds;
643
+ abstract getApparentCanvasLocation(): PointXY;
644
+ abstract toFront(v: string | Vertex | EL, alsoBringAncestorsToFront?: boolean): void;
645
+ abstract toBack(v: string | Vertex | EL, alsoSendAncestorsToBack?: boolean): void;
646
+ /**
647
+ * Gets the current rotation for the element with the given ID. This method exists for internal use.
648
+ * @param elementId - Internal ID of the element for which to retrieve rotation.
649
+ * @internal
650
+ */
651
+ $getRotation(elementId: string): number;
652
+ /**
653
+ * Returns a list of rotation transformations that apply to the given element. An element may have rotation applied directly to it, and/or it may be within a group, which may itself be rotated, and that group may be inside a group which is also rotated, etc. It's rotated turtles all the way down, or at least it could be. This method is intended for internal use only.
654
+ * @param elementId
655
+ * @internal
656
+ */
657
+ $getRotations(elementId: string): Rotations;
658
+ /**
659
+ * Updates position/size information for the given element, if we are managing it. See `_revalidateManagedElement` for further information.
660
+ * @param element element to revalidate
661
+ * @param timestamp - Optional, used internally to avoid recomputing position/size information if it has already been computed.
662
+ * @internal
663
+ * @see _revalidateManagedElement
664
+ */
665
+ $revalidateElement(element: EL, timestamp?: string): RedrawResult;
666
+ /**
667
+ * Updates position/size information for the element with the given id. See `_revalidateManagedElement` for further information.
668
+ * @param id ID of the element to revalidate
669
+ * @param timestamp - Optional, used internally to avoid recomputing position/size information if it has already been computed.
670
+ * @internal
671
+ * @see _revalidateManagedElement
672
+ */
673
+ $revalidateElementById(id: string, timestamp?: string): RedrawResult;
674
+ /**
675
+ * Updates position/size information for the given managed element and redraws its Connections. Use this method when you've made a change to some element that may have caused the element to change its position or size and you want to ensure the connections are in the right place.
676
+ * @param entry - Managed Element to revalidate.
677
+ * @param timestamp - Optional, used internally to avoid recomputing position/size information if it has already been computed.
678
+ * @internal
679
+ */
680
+ $revalidateManagedElement(entry: ViewportElement<EL>, timestamp?: string): RedrawResult;
681
+ /**
682
+ * Repaint every connection in the instance.
683
+ */
684
+ repaintEverything(doNotRefreshElements?: boolean): void;
685
+ /**
686
+ * Repaints the given vertex and all of the edges connected to it.
687
+ * @param el Either an element, a vertex id, or a Vertex.
688
+ * @param resetToLayoutPosition If true, the UI will also ensure that the given element's position in the canvas is reset to the position the viewport has. This is mostly an internal flag, used when resetting certain dragging scenarios.
689
+ */
690
+ repaint(el: string | EL | Vertex, resetToLayoutPosition?: boolean): void;
691
+ /**
692
+ * Repaints all connections associated with the given element, _without recomputing the element size and position_. If you want to first recompute element size and position you should call `revalidate(el)` instead,
693
+ * @param el - Element to repaint.
694
+ * @param timestamp - Optional parameter used internally to avoid recalculating offsets multiple times in one paint.
695
+ * @param offsetsWereJustCalculated - If true, we don't recalculate the offsets of child elements of the element we're repainting.
696
+ * @internal
697
+ */
698
+ $repaintUIElement(el: ViewportElement<EL>, timestamp?: string, offsetsWereJustCalculated?: boolean): RedrawResult;
699
+ /**
700
+ * Clears all connections from the UI instance. Does not also clear out event listeners, selectors, or
701
+ * connection types - for that, use `destroy()`.
702
+ */
703
+ reset(): void;
704
+ /**
705
+ * Gets the underlying connection that was rendered for the Edge with the given id.
706
+ * @param edgeId ID of the Edge to retrieve the Connection for.
707
+ * @returns A Connection, null if not found.
708
+ *
709
+ */
710
+ getRenderedConnection(edgeId: string): Connection<EL>;
711
+ getNodes(): Array<Node>;
712
+ getGroups(): Array<Group>;
713
+ getUIGroups(): Array<ViewportGroupElement<EL>>;
714
+ /**
715
+ * Clears the instance and unbinds any listeners on the instance. After you call this method you cannot use this instance of VisuallyJs again.
716
+ */
717
+ destroy(): void;
718
+ /**
719
+ * Register a connection type: a set of connection attributes grouped together with an ID.
720
+ * @param id
721
+ * @param type
722
+ * @internal
723
+ */
724
+ $registerConnectionType(id: string, type: TypeDescriptorBase): void;
725
+ /**
726
+ * Retrieve a connection type by its id.
727
+ * @param id
728
+ * @internal
729
+ */
730
+ $getConnectionType(id: string): CompiledTypeDescriptor;
731
+ /**
732
+ * @internal
733
+ * @param originalId
734
+ * @param newId
735
+ * @param connection
736
+ * @param newElement
737
+ * @param index
738
+ */
739
+ $sourceOrTargetChanged(originalId: string, newId: string, connection: Connection<EL>, newElement: EL, index: ProxyLocation): void;
740
+ private _cascadeGroupResize;
741
+ /**
742
+ * Expand a collapsed group, unproxying any connections from the collapsed group to their original destination
743
+ * @param groupIdOrGroup
744
+ */
745
+ expandGroup(groupIdOrGroup: Group | string): void;
746
+ /**
747
+ * @internal
748
+ * @param e
749
+ * @param index
750
+ * @param managedElement
751
+ * @private
752
+ */
753
+ $_proxyEdge(e: Edge, index: ProxyLocation, managedElement: ViewportElement<EL>, anchor?: LightweightAnchor): void;
754
+ $_unproxyEdge(e: Edge, index: ProxyLocation, newAnchorSpec?: ObjectAnchorSpec): ViewportElement<EL> | null;
755
+ private _cascadeGroupExpand;
756
+ /**
757
+ * Expand a group if it is collapsed, or collapse it if it is expanded.
758
+ * @param group
759
+ *
760
+ */
761
+ toggleGroup(group: string | Group): void;
762
+ /**
763
+ * Searches for an ancestor of the given group that is in a collapsed state. The collapse/expand methods use this to determine whether or not to take any action: if there is an ancestor that is collapsed, we would not want to collapse/expand one of its descendants.
764
+ * @internal
765
+ * @param group Group to search for a collapsed ancestor for.
766
+ */
767
+ private __getCollapseParent;
768
+ /**
769
+ * Collapse the given group, hiding all of its internal edges and proxying any edges to internal members to the collapsed element (unless the group definition for this group specifies `proxied:false`). Every edge with a source/target that is a descendant of this group is a candidate for proxying.
770
+ * @param groupIdOrGroup
771
+ */
772
+ collapseGroup(groupIdOrGroup: Group | string): void;
773
+ protected $computeCollapsedGroupSize(group: Group, currentSize: Size): Size;
774
+ protected $getCollapsedGroupSize(group: Group, currentSize: Size): Size;
775
+ /**
776
+ * Find all the children of the given group that are themselves groups.
777
+ * @param group
778
+ * @private
779
+ */
780
+ private __getGroupsInGroup;
781
+ /**
782
+ * Cascade the processing of the edges of some collapsed group down to its children and their children etc - when a parent group is collapsed, so must all of its descendants be. This _only_ collects edges, and makes no model updates.
783
+ * @param collapsedGroup
784
+ * @param targetGroup
785
+ * @param collapsedIds
786
+ * @internal
787
+ */
788
+ private _cascadeGroupCollapseEdgeProcessing;
789
+ private _getGroupsOrderedByDepth;
790
+ private __orderGroupsByDepth;
791
+ /**
792
+ * Gets all of the managed nodes that are visible, or partly visible, in the current viewport.
793
+ * @internal
794
+ */
795
+ abstract $getNodesInViewport(): Array<{
796
+ el: ViewportNodeElement<EL>;
797
+ bb: RectangleXY;
798
+ }>;
799
+ /**
800
+ * Gets all of the managed groups that are visible, or partly visible, in the current viewport.
801
+ * @internal
802
+ */
803
+ abstract $getGroupsInViewport(): Array<{
804
+ el: ViewportGroupElement<EL>;
805
+ bb: RectangleXY;
806
+ }>;
807
+ /**
808
+ * Relayout the given group.
809
+ * @param groupOrId The group - or the ID of the group - to relayout.
810
+ * @public
811
+ */
812
+ relayoutGroup(groupOrId: string | Group, reason?: GroupRelayoutReason): void;
813
+ /**
814
+ * Update the position of a set of vertices, optionally adding the given offset to their values prior to writing to the viewport. This latter mechanism is used when storing the results of a group layout. Does not update the model unless requested.
815
+ * @internal
816
+ * @param positions
817
+ * @param sizes
818
+ */
819
+ $_updateVertexPositions(p: {
820
+ /**
821
+ * Positions to store
822
+ */
823
+ positions: Record<string, PointXY>;
824
+ /**
825
+ * associated sizes, may be null
826
+ */
827
+ sizes: Record<string, Size>;
828
+ /**
829
+ * rotations to set, may be null
830
+ */
831
+ rotations: Record<string, number>;
832
+ /**
833
+ * sizes of groups, may be null
834
+ */
835
+ resizedGroups: Record<string, {
836
+ group: Group;
837
+ originalGroupSize: Size;
838
+ newGroupSize: Size;
839
+ }>;
840
+ /**
841
+ * optional parent offset, set to null if you dont need it (it's used when updating group members)
842
+ */
843
+ offset: PointXY;
844
+ /**
845
+ * whether or not to store positions in the model.
846
+ */
847
+ storePositionsInModel: boolean;
848
+ /**
849
+ * Whether or not to repaint connections to these vertices afterwards.
850
+ */
851
+ repaintConnections: boolean;
852
+ writeSizesToElements: boolean;
853
+ /**
854
+ * Whether or not to also apply the rotations to the element
855
+ */
856
+ writeRotationsToElements: boolean;
857
+ }): RedrawResult;
858
+ /**
859
+ * Runs a relayout of all vertices in the canvas, and of each group.
860
+ * @param newParameters
861
+ * @param doNotRepaintConnections
862
+ *
863
+ */
864
+ relayout(newParameters?: any, doNotRepaintConnections?: boolean): void;
865
+ /**
866
+ * Refreshes the layout. For some layouts this is the same as a full relayout.
867
+ * @param doNotRepaintConnections
868
+ *
869
+ */
870
+ refresh(doNotRepaintConnections?: boolean): void;
871
+ /**
872
+ * Runs the layout, then perhaps runs the magnetizer afterwards, then runs group layout for all groups. Stores positions in the model and updates the UI.
873
+ * @param executor
874
+ * @param runAfter
875
+ * @param event
876
+ * @param doNotRepaintConnections
877
+ * @private
878
+ * @internal
879
+ */
880
+ private __runLayout;
881
+ /**
882
+ * Repaint this edge.
883
+ * @param edge
884
+ */
885
+ repaintEdge(edge: Edge): void;
886
+ /**
887
+ * Repaint this set of edges.
888
+ * @param edges
889
+ */
890
+ repaintEdges(edges: Array<Edge>): void;
891
+ /**
892
+ * @internal
893
+ * @param connection
894
+ * @param params
895
+ */
896
+ $paintConnection(connection: Connection<EL>, params?: {
897
+ timestamp?: string;
898
+ }): void;
899
+ /**
900
+ * Adds an overlay to the given component, repainting the UI as necessary.
901
+ * @param component - A Connection to add the overlay to
902
+ * @param overlay - Spec for the overlay
903
+ * @param doNotRevalidate - Defaults to true. If false, a repaint won't occur after adding the overlay. This flag can be used when adding several overlays in a loop.
904
+ * @internal
905
+ */
906
+ $addOverlay(component: Connection<EL>, overlay: OverlaySpec, doNotRevalidate?: boolean): Overlay<EL>;
907
+ /**
908
+ * Remove the overlay with the given id from the given component.
909
+ * @param conn - Connection to remove the overlay from.
910
+ * @param overlayId - ID of the overlay to remove.
911
+ * @internal
912
+ */
913
+ $removeOverlay<E>(conn: Connection<E>, overlayId: string): void;
914
+ /**
915
+ * Internal method to set line style, with option to not repaint.
916
+ * @param conn
917
+ * @param style
918
+ * @param doNotRepaint
919
+ * @internal
920
+ */
921
+ $_setLineStyle(conn: Connection<EL>, style: LineStyle, repaintAfterwards: boolean): void;
922
+ /**
923
+ * Sets the current view for this renderer.
924
+ * @param view View to set.
925
+ * @internal
926
+ */
927
+ private $setView;
928
+ /**
929
+ * Finds all of the vertices that intersect the rectangle described by `origin` and `dimensions`.
930
+ * @param options Options for the find operation.
931
+ */
932
+ findIntersectingVertices(options: IntersectingVerticesOptions): Array<IntersectingVertex<EL>>;
933
+ /**
934
+ * Finds all of the vertices that are enclosed by the rectangle described by `origin` and `dimensions`.
935
+ * @param options Options for the find operation.
936
+ */
937
+ findEnclosedVertices(options: EnclosedVerticesOptions): Array<IntersectingVertex<EL>>;
938
+ abstract $zoomToFit(params?: ZoomToFitOptions): void;
939
+ abstract $zoomToFitIfNecessary(params?: ZoomToFitIfNecessaryOptions): void;
940
+ abstract $zoomToElements(zParams: ZoomToElementsOptions<EL>): void;
941
+ /**
942
+ * Remove one or more classes from the given element or list of elements.
943
+ * @param el Element, or list of elements from which to remove the class(es)
944
+ * @param clazz A space separated list of classes to remove.
945
+ * @internal
946
+ */
947
+ abstract $removeClassFromElement(el: EL | ArrayLike<EL>, clazz: string): void;
948
+ /**
949
+ * Add one or more classes to the given element or list of elements.
950
+ * @param el Element, or list of elements to which to add the class(es)
951
+ * @param clazz A space separated list of classes to add.
952
+ * @internal
953
+ */
954
+ abstract $addClassToElement(el: EL | ArrayLike<EL>, clazz: string): void;
955
+ /**
956
+ * Toggles one or more classes on the given element or list of elements.
957
+ * @param el Element, or list of elements on which to toggle the class(es)
958
+ * @param clazz A space separated list of classes to toggle.
959
+ * @internal
960
+ */
961
+ abstract $toggleClassOnElement(el: EL | ArrayLike<EL>, clazz: string): void;
962
+ /**
963
+ * Gets the CSS class for the given element.
964
+ * @param el
965
+ * @internal
966
+ */
967
+ abstract $getClassFromElement(el: EL): string;
968
+ /**
969
+ * Returns whether or not the given element has the given class.
970
+ * @param el
971
+ * @param clazz
972
+ * @internal
973
+ */
974
+ abstract $elementHasClass(el: EL, clazz: string): boolean;
975
+ /**
976
+ * Updates classes for the given element
977
+ * @param el
978
+ * @param classesToAdd
979
+ * @param classesToRemove
980
+ * @internal
981
+ */
982
+ abstract $updateElementClasses(el: EL, classesToAdd: Array<string>, classesToRemove: Array<string>): void;
983
+ /**
984
+ * Sets an attribute on the given element.
985
+ * @param el
986
+ * @param name
987
+ * @param value
988
+ * @internal
989
+ */
990
+ abstract $setAttribute(el: EL, name: string, value: string): void;
991
+ /**
992
+ * Gets an attribute from the given element.
993
+ * @param el
994
+ * @param name
995
+ * @internal
996
+ */
997
+ abstract $getAttribute(el: EL, name: string): string;
998
+ /**
999
+ * Sets some attributes on the given element.
1000
+ * @param el - Element to set attributes on
1001
+ * @param atts - Map of attributes to set.
1002
+ * @internal
1003
+ */
1004
+ abstract $setAttributes(el: EL, atts: Record<string, string>): void;
1005
+ /**
1006
+ * Remove an attribute from the given element.
1007
+ * @param el - Element to remove an attribute from
1008
+ * @param attName - Name of the attribute to remove
1009
+ * @internal
1010
+ */
1011
+ abstract $removeAttribute(el: EL, attName: string): void;
1012
+ /**
1013
+ * Exposed on this class to assist core in abstracting out the specifics of the renderer.
1014
+ * @internal
1015
+ * @param ctx Either a string representing a selector, or an element. If a string, the container root is assumed to be the element context. Otherwise the context is this value and the selector is the second arg to the method.
1016
+ * @param spec If `ctx` is an element, this is the selector
1017
+ */
1018
+ abstract $getSelector(ctx: string | EL, spec?: string): Array<EL>;
1019
+ /**
1020
+ * Gets a style property from some element. Exposed on this class to assist core in abstracting out the specifics of the renderer.
1021
+ * @internal
1022
+ * @param el Element to get property from
1023
+ * @param prop Property to look up
1024
+ */
1025
+ abstract $getStyle(el: EL, prop: string): any;
1026
+ /**
1027
+ * For some element, find the model object it represents (and the DOM element for that model object)
1028
+ * @param el
1029
+ * @param searchAncestors
1030
+ * @internal
1031
+ */
1032
+ abstract getModelObjectFromElement(el: EL, searchAncestors: boolean, createMissingPorts: boolean): {
1033
+ obj: Node | Group | Port | Edge;
1034
+ el: EL;
1035
+ } | null;
1036
+ /**
1037
+ * Gets the element that was rendered for the Port with the given id (does not retrieve `vjs-endpoint` elements)
1038
+ * @param portId
1039
+ */
1040
+ abstract getRenderedPort(port: string | Port): EL;
1041
+ /**
1042
+ * for some node/group/port, get the element that was used to render it.
1043
+ * @param obj
1044
+ */
1045
+ abstract getRenderedElement(obj: string | Base): EL;
1046
+ /**
1047
+ * Method that will be invoked after a full relayout has occurred
1048
+ * @param p
1049
+ * @private
1050
+ * @internal
1051
+ */
1052
+ abstract $afterRelayout(p: LayoutResultSet): void;
1053
+ /**
1054
+ * Method that will be invoked after a layout refresh has occurred
1055
+ * @param p
1056
+ * @private
1057
+ * @internal
1058
+ */
1059
+ abstract $afterRefresh(p: LayoutResultSet): void;
1060
+ /**
1061
+ * Tests whether the given item is of the current element type
1062
+ * @param e
1063
+ * @internal
1064
+ */
1065
+ abstract $isSupportedElement(e: any): e is EL;
1066
+ /**
1067
+ * For some given element, find any other elements we want to draw whenever that element
1068
+ * is being drawn. for groups, for example, this means any child elements of the group. For an element that has
1069
+ * child elements that are also managed, it means those child elements.
1070
+ * @param el
1071
+ * @internal
1072
+ */
1073
+ abstract $getAssociatedElements(el: EL): Array<EL>;
1074
+ abstract $isElement(obj: any): obj is EL;
1075
+ abstract $removeElement(el: EL): void;
1076
+ abstract $appendElement(el: EL, parent: EL, insertAtStart?: boolean): void;
1077
+ abstract $appendElementToContainer(e: EL, insertAtStart?: boolean): void;
1078
+ abstract $appendElementToVertexLayer(e: EL, insertAtStart?: boolean): void;
1079
+ abstract $appendElementToToolsLayer(e: EL, insertAtStart?: boolean): void;
1080
+ /**
1081
+ * Append an element that represents an overlay. It is up to the subclass to decide where to append the element - there may be
1082
+ * a separate layer dedicated to overlays, for example.
1083
+ * @param e
1084
+ * @param insertAtStart
1085
+ * @internal
1086
+ */
1087
+ abstract $appendOverlayElement(e: EL, insertAtStart?: boolean): void;
1088
+ /**
1089
+ * Append an element that represents a vertex. It is up to the subclass to decide where to append the element - there may be
1090
+ * a separate layer dedicated to vertices, for example.
1091
+ * @param e
1092
+ * @param insertAtStart
1093
+ * @internal
1094
+ */
1095
+ abstract $appendVertexElement(e: EL, insertAtStart?: boolean): void;
1096
+ /**
1097
+ * Append an element that represents an Edge. It is up to the subclass to decide where to append the element - there may be
1098
+ * a separate layer dedicated to edges, for example.
1099
+ * @param e
1100
+ * @param insertAtStart
1101
+ * @internal
1102
+ */
1103
+ abstract $appendEdgeElement(e: EL, insertAtStart?: boolean): void;
1104
+ abstract $setElementVisible(el: EL, visible: boolean): void;
1105
+ /**
1106
+ * Sets the size of the element in the UI. The details of this are specific to the concrete subclass. No model edits occur as a result of this method.
1107
+ * @param el
1108
+ * @param width
1109
+ * @param height
1110
+ * @internal
1111
+ */
1112
+ abstract $setElementSizeInUI(el: EL, width: number, height: number): void;
1113
+ /**
1114
+ * Sets the width of the element in the UI. The details of this are specific to the concrete subclass. No model edits occur as a result of this method.
1115
+ * @param el
1116
+ * @param width
1117
+ * @internal
1118
+ */
1119
+ abstract $setElementWidth(el: EL, width: number): void;
1120
+ /**
1121
+ * Sets the height of the element in the UI. The details of this are specific to the concrete subclass. No model edits occur as a result of this method.
1122
+ * @param el
1123
+ * @param height
1124
+ * @internal
1125
+ */
1126
+ abstract $setElementHeight(el: EL, height: number): void;
1127
+ /**
1128
+ * Gets the size of the element in the UI. The details of this are specific to the concrete subclass.
1129
+ * @internal
1130
+ */
1131
+ abstract $getSize(el: EL): Size;
1132
+ /**
1133
+ * Sets the element's rotation.The details of this are specific to the concrete subclass.
1134
+ * @param el
1135
+ * @param r
1136
+ * @internal
1137
+ */
1138
+ abstract $setElementRotation(el: EL, r: number): void;
1139
+ /**
1140
+ * Gets the position and size of the given element relative to the window origin, _in page coordinates_. This method abstracts the `getBoundingClientRect()` method in the browser UI renderer.
1141
+ * @param el Element to get position for
1142
+ * @internal
1143
+ */
1144
+ abstract $getElementPositionInWindow(el: EL): RectangleXY;
1145
+ /**
1146
+ * Gets the position of the given element relative to its offset parent, in canvas coordinates, ie. not scaled per the current zoom. Currently this method is only used to find the offset to a group's content area. The details of this are specific to the concrete subclass.
1147
+ * TODO can the group content area code use some other existing method?
1148
+ * @param el
1149
+ * @param width
1150
+ * @param height
1151
+ * @internal
1152
+ */
1153
+ abstract $getElementPositionInUIRelativeToParent(el: EL): PointXY;
1154
+ /**
1155
+ * Gets the x,y of the given element relative to the canvas origin, taking the scroll of any parent elements into account, and taking into account nested groups etc.
1156
+ * @internal
1157
+ * @param el
1158
+ */
1159
+ abstract $getElementPositionInUIRelativeToCanvasOrigin(el: EL, knownElementSize?: Size): PointXY;
1160
+ /**
1161
+ * Gets the position of the given element relative to the browser window's origin.
1162
+ * @param el
1163
+ * @internal
1164
+ */
1165
+ abstract $getOffsetRelativeToRoot(el: EL | string): PointXY;
1166
+ /**
1167
+ * Gets the element that acts as the content area for the group represented by `el`. The details of this are specific to the concrete instance.
1168
+ * @param el
1169
+ * @internal
1170
+ */
1171
+ abstract $getGroupContentAreaElement(el: EL): EL;
1172
+ /**
1173
+ * Gets the element that acts as the content area for the given Group.
1174
+ * @param group
1175
+ * @internal
1176
+ */
1177
+ private _getGroupContentArea;
1178
+ /**
1179
+ * For the given group id, get the origin of the content area for the group, in page coordinates, plus its offset from the group's origin, in group coordinates, and the element representing the content area. For groups whose template does not declare a content area child element, the content area is the group's element, the content area origin is the origin of the group itself. But when there's a content area inside the group, the origin needs to be adjusted. The `pageOrigin` member of the return value from this method contains the point which acts as the origin for any of this group's child vertices.
1180
+ * @param id
1181
+ * @internal
1182
+ */
1183
+ $_getGroupContentAreaInfo(id: string): GroupContentAreaInfo<EL>;
1184
+ getElementPosition(id: string): PointXY;
1185
+ getElementSize(id: string): Size;
1186
+ getElement(id: string): ViewportElement<EL>;
1187
+ getGroupElement(id: string): ViewportGroupElement<EL>;
1188
+ /**
1189
+ * Decodes the given input into a data structure containing a model object, its type, its ID, and the element used to represent it. Always returns a value even if no model object could be resolved for the given input, because in some circumstances the given input represents an element from the UI that is not in the model (such as when dragging a new edge)
1190
+ * @param obj - Object to decode. Can be in many different forms - an existing model object, a vertex id, an element, a Connection, some backing data.
1191
+ * @typeParam V The type of object you're expecting back from the method. This is for convenience, so that the `obj` member of the return value is typed conveniently for what you want to do with it.
1192
+ */
1193
+ getObjectInfo<V extends Base>(obj: EL | Connection<EL> | string | Base | ObjectData, createMissingPorts: boolean): UIObjectInfo<V, EL>;
1194
+ /**
1195
+ * Gets the current list of magnetizable vertices, ie vertices that are not inside a group.
1196
+ * @private
1197
+ * @internal
1198
+ */
1199
+ private _getMagnetizableVertices;
1200
+ private _prepareMagnetizerParams;
1201
+ /**
1202
+ *
1203
+ * Run the magnetizer and get some updated positions back, but DO NOT update the model.
1204
+ * @internal
1205
+ * @param focus Optional focus element, which should not be moved (and which will provide the center of the magnetize operation).
1206
+ * @param origin Optional origin for the magnetize. Not needed if you provide `focus`, and if you dont provide either focus or this we use the computed center of all thevertices
1207
+ * @param gather Defaults to false. If true, dont magnetize, gather
1208
+ * @param knownLocations Map of vertices whose location is already known, which doesnt necessarily mean that's where the vertices are, it's just where we want to _say_ they are for the purposes of this run of the magnetizer.
1209
+ * @param vertices list of vertices to operate on. If not provided, all vertices in the data source will be used.
1210
+ */
1211
+ private _runMagnetizer;
1212
+ /**
1213
+ * Run the magnetizer and then update the affected elements in the model afterwards.
1214
+ * @param focus
1215
+ * @param origin
1216
+ * @param event
1217
+ * @param gather
1218
+ * @internal
1219
+ */
1220
+ private _runMagnetizerAndUpdate;
1221
+ /**
1222
+ * Magnetize the elements in the display. If `focus` is provided it will be used as the origin for magnetization,
1223
+ * and not moved (unless `repositionFocus` is true). If no `focus` is provided, the computed center of all the
1224
+ * elements will be used as the origin.
1225
+ * @param focus
1226
+ *
1227
+ */
1228
+ magnetize(focus?: string | Vertex, repositionFocus?: boolean): void;
1229
+ /**
1230
+ * Run the magnetizer on the elements in the display, but DO NOT update the model. All args are optional but since this is an internal method you have to supply a value for each one, even if it is mull.
1231
+ * @param focus Optional focus element which by default will not be moved
1232
+ * @param repositionFocus If true, and `focus` is provided, `focus` _will_ be moved in the event of a collision.
1233
+ * @param knownLocations Optional map of locations we already know (such as the results of a drag or some other tentative UI manipulation)
1234
+ * @param knownSizes Optional map of element sizes we already know (such as the results of some other tentative UI manipulation)
1235
+ * @internal
1236
+ */
1237
+ $provisionallyMagnetize(focus: string | Vertex, repositionFocus: boolean, knownLocations: Record<string, PointXY>, knownSizes: Record<string, Size>, magnetizerIsAlreadyPrimed: boolean, invertTrackbackPreference: boolean): MagnetizeResult;
1238
+ /**
1239
+ * Run the magnetizer in gather mode on the given focus, but DO NOT update the model.
1240
+ * @param focus Element to gather around.
1241
+ * @param knownLocations Optional map of locations we already know (such as the results of a drag or some other tentative UI manipulation)
1242
+ * @param knownSizes Optional map of element sizes we already know (such as the results of some other tentative UI manipulation)
1243
+ * @internal
1244
+ */
1245
+ $provisionallyGather(focus: string | Vertex, knownLocations: Record<string, PointXY>, knownSizes: Record<string, Size>, magnetizerIsAlreadyPrimed: boolean, ignoreTrackback: boolean): MagnetizeResult;
1246
+ /**
1247
+ * Magnetize the elements in the display, using the given point as the origin.
1248
+ * @param origin
1249
+ * @tags magnetizer,foo
1250
+ */
1251
+ magnetizeAtPoint(origin: PointXY): void;
1252
+ /**
1253
+ * Gather the elements in the display. If `focus` is provided the elements will be gathered around it. Otherwise, the elements will be gathered around the computed center of all the elements.
1254
+ * @param focus - Optional ID of a Vertex, or the Vertex itself, around which to gather elements.
1255
+ * @magnetizer
1256
+ */
1257
+ gather(focus?: string | Vertex): void;
1258
+ /**
1259
+ * Called to set the elements on the magnetizer and have it store their positions. Subsequent magnetize calls might
1260
+ * attempt to revert anything that got moved by some other element, up until the $stopMagnetizer method is called.
1261
+ * @internal
1262
+ */
1263
+ $startMagnetizer(): void;
1264
+ /**
1265
+ * Instruct the magnetizer to stop tracking element positions.
1266
+ * @internal
1267
+ */
1268
+ $stopMagnetizer(): void;
1269
+ $startMotion(): void;
1270
+ $stopMotion(): void;
1271
+ /**
1272
+ * Make a dataset representing an update into the model for the given point, by constructing an object whose keys are this surface's `$modelLeftAttribute` and `$modelTopAttribute`.
1273
+ * @param pos
1274
+ * @private
1275
+ * @internal
1276
+ */
1277
+ private _prepareModelUpdate;
1278
+ /**
1279
+ * Prepares a model update for the left/top values for this vertex and then invokes `updateVertex` on the model. The model will then write the change to the data objects, add an item to the undo stack, and call the UI back, which will move the element in the UI. Use this method when you want to change the position of some element in the model AND the UI. Don't use this method if your positioning call is supposed to be transient.
1280
+ * @param v
1281
+ * @param pos
1282
+ * @internal
1283
+ */
1284
+ private _setVertexPositionInModel;
1285
+ /**
1286
+ * Update a set of vertices at once, in a transaction (unless a transaction is in progress, in which case these changes are added to it).
1287
+ * @param elementsToMove
1288
+ * @internal
1289
+ */
1290
+ protected _updateMultipleElements(elementsToMove: MagnetizeResult, reason: string, beforeCommit?: () => any): void;
1291
+ /**
1292
+ * Writes the current position for the given vertex into the data model. Does not fire an event.
1293
+ * @param params - Parameters
1294
+ * @param params.obj - Object to store vertex positions for.
1295
+ * @param params.leftAttribute - Name of the attribute to use for the left position. Default is 'left'
1296
+ * @param params.topAttribute - Name of the attribute to use for the top position. Default is 'top'
1297
+ *
1298
+ */
1299
+ private $storePositionInModel;
1300
+ /**
1301
+ * Writes the current size for the given vertex into the data model.
1302
+ * @param objOrId - Object to store vertex positions for - either an ID, or the object itself.
1303
+ * @param size - Size to store. If not supplied, the size is retrieved from the viewport.
1304
+ *
1305
+ */
1306
+ private _storeSizeInModel;
1307
+ /**
1308
+ * Sets the position of the given node/group and runs the magnetizer, updating the UI and storing results in the model. This operation is wrapped in a transaction so if undo is called then every element affected by the magnetize is relocated.
1309
+ * @param vertex
1310
+ * @param x
1311
+ * @param y
1312
+ * @magnetizer
1313
+ */
1314
+ setMagnetizedPosition(vertex: string | Node | Group | EL, x: number, y: number): void;
1315
+ /**
1316
+ * Sets the position of some vertex and updates the model. This method will honour any grid that is currently in effect.
1317
+ *
1318
+ * @param vertex Node/group id, or some node/group, or the element representing some node/group.
1319
+ * @param x X position, in canvas coordinates, to set.
1320
+ * @param y Y position, in canvas coordinates, to set.
1321
+ * @param magnetize Whether or not to apply the magnetizer to move other vertices out of this vertex's way.
1322
+ * @param force Used in conjunction with magnetize. When null, or true, the element is positioned where requested
1323
+ * and other elements move. When false, the element is positioned as close to the requested position as
1324
+ * possible, without moving any other elements.
1325
+ */
1326
+ setPosition(vertex: string | Node | Group | EL, x: number, y: number, magnetize?: boolean, force?: boolean): void;
1327
+ /**
1328
+ * Run an adhoc layout on the given group. The layout will be applied one time, and then the previous layout will be restored (but not run, of course, otherwise the results of this adhoc layout would be overwritten!).
1329
+ * @param group The group on which to run an adhoc layout.
1330
+ * @param layoutParams Params for the adhoc layout.
1331
+ * @public
1332
+ */
1333
+ adHocGroupLayout(group: string | Group, layoutParams: {
1334
+ type: string;
1335
+ options: LayoutParameters;
1336
+ }): void;
1337
+ /**
1338
+ * @internal
1339
+ */
1340
+ getGroupDefinition(group: Group): GroupMapping<EL>;
1341
+ /**
1342
+ * Gets the port mapping for the given port.
1343
+ * @internal
1344
+ */
1345
+ getPortDefinition(port: Port): PortMapping<EL>;
1346
+ /**
1347
+ * @internal
1348
+ */
1349
+ getNodeDefinition(node: Node): NodeMapping<EL>;
1350
+ /**
1351
+ * For some given vertex, computes the new positions of all affected elements - taking into account whether the magnetizer is switched on. This method does not move any elements, either in the model or in the DOM or viewport. The return value of this method is expected to be used to update the model, and the model will call all the renderers
1352
+ * @param vertex
1353
+ * @param x
1354
+ * @param y
1355
+ * @param magnetize If true, run the magnetizer. By default this will move other nodes to get the focus where we want it.
1356
+ * @param moveMagnetizeFocus False by default. When true, and `magnetize` is set, we try to put the focus where it was requested, but we move the focus to fit in around what is already there.
1357
+ * @param skipSetMagnetizerVertices If true, we assume the magnetizer already knows what vertices to run on, so we dont tell it again. This can happen during a drag.
1358
+ * @internal
1359
+ */
1360
+ private __provisionallyMoveElement;
1361
+ /**
1362
+ * Returns the names of the attributes used to store positioning information in the model. Mostly an internal
1363
+ * method but exposed in case it proves useful to someone.
1364
+ */
1365
+ getModelPositionAttributes(): {
1366
+ x: string;
1367
+ y: string;
1368
+ };
1369
+ /**
1370
+ * Writes the current position for each node into the data model. A common use case is to run an auto layout the
1371
+ * first time some dataset is seen, and then to save the locations of all the vertices once a human being has moved
1372
+ * things around.
1373
+ * @param params - Parameters
1374
+ * @param params.leftAttribute - Name of the attribute to use for the left position. Default is 'left'
1375
+ * @param params.topAttribute - Name of the attribute to use for the top position. Default is 'top'
1376
+ *
1377
+ */
1378
+ storePositionsInModel(params?: {
1379
+ leftAttribute?: string;
1380
+ topAttribute?: string;
1381
+ }): void;
1382
+ /**
1383
+ * Sets the current grid for element dragging, magnetization and group sizing.
1384
+ * @param grid Grid to use. If you provide null as the value the grid will be cleared.
1385
+ *
1386
+ */
1387
+ setGrid(grid: Grid): void;
1388
+ /**
1389
+ * Get the grid for this instance. May be null.
1390
+ *
1391
+ */
1392
+ getGrid(): Grid;
1393
+ /**
1394
+ * Used to determine whether or not grid snapping is active.
1395
+ * @internal
1396
+ */
1397
+ _isGridSnap(): boolean;
1398
+ /**
1399
+ * @internal
1400
+ * @param el
1401
+ */
1402
+ _sizeElementToGrid(el: EL): Size | null;
1403
+ /**
1404
+ * Snaps one or all vertices to the current grid or to the grid provided to this method.
1405
+ * @param el ID of vertex, Vertex, or DOM element representing a Vertex.
1406
+ * @param grid Optional grid to snap to. If not provided, the Surface will use the `grid` passed in to its
1407
+ * constructor. If that is also null, nothing will be snapped.
1408
+ *
1409
+ */
1410
+ snapToGrid(el?: string | Vertex | EL, grid?: Grid): MagnetizeResult | null;
1411
+ /**
1412
+ * Run the group auto size routine on a given group (as well as any ancestor groups), and moves elements around as necessary
1413
+ * @param group The group to auto size
1414
+ * @param force If true, this flag will override an `autoSize:false` directive on the Group (and any ancestors).
1415
+ * @public
1416
+ */
1417
+ autoSizeGroup(group: Group, force?: boolean): GroupResizeResult<EL>;
1418
+ /**
1419
+ * Calculates the appropriate size for each group in the given set, based upon the location and dimensions of the group's child vertices. Groups are first ordered by depth, so that nested groups are resized first, and their parent groups can take these sizes into account.
1420
+ *
1421
+ * Group size changes are pushed to the model and to the undo stack, plugins are notified, an internal group size change event is fired, and a public group update event is fired.
1422
+ *
1423
+ * @internal
1424
+ * @param groups
1425
+ * @param force
1426
+ */
1427
+ $_sizeGroupsToFit(groups: Set<Group>, knownPositions: Record<string, PointXY>, knownSizes: Record<string, Size>, force: boolean): Record<string, GroupResizeResult<EL>>;
1428
+ /**
1429
+ * Computes the appropriate size for a single group. This method makes no changes to the model and fires no events; it exists really just to reduce the complexity of the `$_sizeGroupsToFit` method above - the bulk of the thinking about group size occurs in the {@link __computeGroupSize} method of this class.
1430
+ * @param group
1431
+ * @param recurse
1432
+ * @param force
1433
+ * @param knownPositions
1434
+ * @param knownSizes
1435
+ * @private
1436
+ * @internal
1437
+ */
1438
+ private __sizeGroupToFit;
1439
+ /**
1440
+ * Runs group layouts, without storing any of the results in the model or updating the UI.
1441
+ * By default the group layout will use information stored in the
1442
+ * @param knownPositions
1443
+ * @param knownSizes
1444
+ * @private
1445
+ * @internal
1446
+ */
1447
+ private __computeGroupLayouts;
1448
+ /**
1449
+ * Compute the extents of all the child members of the given group, by default with respect to the group's origin, which effectively gives you the internal size required by the group, or, if you set `relativeToCanvasOrigin`, with respect to the canvas origin.
1450
+ * @param group The group to find extents for
1451
+ * @param relativeToCanvasOrigin Defaults to false.
1452
+ */
1453
+ getGroupContentExtents(group: Group, relativeToCanvasOrigin?: boolean): Extents;
1454
+ /**
1455
+ * Track group size changes by firing an event through the model. This method update's the group's data with new width/height values, using the appropriate width/height property names. It then fires an internal group size event, which the undo/redo manager catches, and pushes to the stack. It then dispatches the group resize to registered plugins, and then finally it fires a public group updated event, which API users can listen to, but which is not used internally.
1456
+ *
1457
+ * TODO strictly speaking this breaks the concept of multiple renderers, since this event goes on the model's stack and it may not be relevant for some other renderer. Plus some other renderer could execute an undo and cause changes in this renderer. The solution for that is I guess to have an undo stack per renderer, which wraps the model's undo.
1458
+ *
1459
+ * @param resizedGroups
1460
+ * @private
1461
+ * @internal
1462
+ */
1463
+ $trackGroupSizeChanges(resizedGroups: Record<string, GroupResizeResult<EL>>): void;
1464
+ /**
1465
+ * Computes the appropriate size for the given group, based upon the location and dimensions of its child vertices, plus the rules governing how resize applies to this group type (eg, should shrink, should grow, is resize allowed at all, etc).
1466
+ *
1467
+ * This method updates the UI to reflect the computed group size, but it DOES NOT update the model or fire any events.
1468
+ *
1469
+ * This method is called in a few scenarios:
1470
+ *
1471
+ * 1. by the __runLayout method. This should NOT enable elastic manager
1472
+ * 2. by the __sizeGroupToFit method, which is itself called by
1473
+ * $_sizeGroupsToFit, which is itself called by
1474
+ * ResizingToolsPlugin, up listener
1475
+ * ElementDragHandler2, stop listener
1476
+ * uicore public autoSizeGroup
1477
+ * uicore public autoSizeGroups
1478
+ * 3. by the __cascadeGroupResize method, which is itself called by
1479
+ * public expandGroup
1480
+ * public collapseGroup
1481
+ * public setPosition
1482
+ *
1483
+ *
1484
+ *
1485
+ * @param group
1486
+ * @param knownPositions
1487
+ * @param knownSizes
1488
+ * @param groupExtents
1489
+ * @param force
1490
+ * @private
1491
+ * @internal
1492
+ */
1493
+ private __computeGroupSize;
1494
+ /**
1495
+ * Update the size of the given list of groups so that its content area encompasses all of the child elements of the group, unless `force` is not specified and a specific group has `autoSize` set to false.
1496
+ * @param groups Groups to size. If null, every group is auto sized.
1497
+ * @param force If true, this flag will override an autoSize:false directive on the Group (and any ancestors)
1498
+ * @public
1499
+ */
1500
+ autoSizeGroups(groups?: Array<Group>, force?: boolean): Record<string, GroupResizeResult<EL>>;
1501
+ abstract $createDefaultLayoutAdapter(): AbstractLayoutAdapter<EL>;
1502
+ abstract $createGroupLayoutAdapter(group: Group): AbstractLayoutAdapter<EL>;
1503
+ /**
1504
+ * Create a layout for the surface to use.
1505
+ * @param params
1506
+ * @internal
1507
+ */
1508
+ private _createLayout;
1509
+ /**
1510
+ * Create a layout for a given group.
1511
+ * @param params
1512
+ * @param group
1513
+ * @internal
1514
+ */
1515
+ private _createGroupLayout;
1516
+ /**
1517
+ * Apply the given layout to the viewport, by default refreshing the viewport afterwards.
1518
+ * @param layoutParams Spec for the layout to set.
1519
+ * @param doNotRefresh Defaults to true. Whether or not to repaint the UI after setting the layout.
1520
+ *
1521
+ */
1522
+ setLayout<LP extends LayoutParameters>(layoutParams: {
1523
+ type: string;
1524
+ options?: LP;
1525
+ }, doNotRefresh?: boolean): void;
1526
+ /**
1527
+ * Run an adhoc layout on the viewport, inside a transaction, so the entire operation can be undone at once.
1528
+ * Note that invoking this method also has the effect of clearing the geometry of every edge and resetting edge
1529
+ * paths to the default computed values: edge paths are linked to their vertex locations, and this method can
1530
+ * move any vertex from its current location.
1531
+ * @param layoutParams Spec for the layout to apply
1532
+ *
1533
+ */
1534
+ adHocLayout<LP extends LayoutParameters>(layoutParams: {
1535
+ type: string;
1536
+ options: LP;
1537
+ }): void;
1538
+ private $_doRenderTransientVertex;
1539
+ /**
1540
+ * Adds a transient vertex to the data model, creates an element to represent it, and registers the
1541
+ * element as a managed element.
1542
+ * @param data
1543
+ * @param style
1544
+ * @param clazz
1545
+ * @param atts
1546
+ * @internal
1547
+ */
1548
+ $addTransientVertex(position: PointXY, size: Size, data?: ObjectData, style?: Record<string, any>, clazz?: string, atts?: Record<string, string>): {
1549
+ vertex: Node;
1550
+ el: ViewportElement<EL>;
1551
+ };
1552
+ /**
1553
+ * Renders a dummy vertex. The model calls this at various points in the lifecycle.
1554
+ * @param v
1555
+ * @internal
1556
+ */
1557
+ $renderDummyVertex(v: Vertex): void;
1558
+ /**
1559
+ * Removes a transient vertex from the data model and from the DOM, removing it from the list of
1560
+ * tracked elements.
1561
+ * @param el
1562
+ * @internal
1563
+ */
1564
+ $removeTransientVertex(el: ViewportElement<Element>): void;
1565
+ /**
1566
+ * Adds a transient edge, ie. an edge that would not be exported as part of the dataset. When a user is dragging a
1567
+ * new edge, for example, that's a transient edge. It is attached to some transient target vertex, and both the
1568
+ * edge and the target vertex are discarded at the end of the drag.
1569
+ * @param source
1570
+ * @param target
1571
+ * @param data
1572
+ * @internal
1573
+ */
1574
+ $addTransientEdge(source: Vertex, target: Vertex, data?: ObjectData, context?: Record<string, any>): Edge;
1575
+ /**
1576
+ * Tests if the given edge type may be unattached at its source and/or target. An edge type might mandate some
1577
+ * preference for that, or it may have been set via the `allowUnattached` flag in the edges defaults.
1578
+ * @param edge
1579
+ * @internal
1580
+ */
1581
+ $isUnattachedEdgeAllowed(edge: Edge): boolean;
1582
+ /**
1583
+ * Subclasses must implement this method to render an element
1584
+ * for some transient vertex.
1585
+ * @param v
1586
+ * @param position
1587
+ * @param size
1588
+ * @param style
1589
+ * @param clazz
1590
+ * @param atts
1591
+ * @internal
1592
+ */
1593
+ abstract $renderTransientVertex(position: PointXY, size: Size, data?: ObjectData, style?: Record<string, any>, clazz?: string, atts?: Record<string, string>): EL;
1594
+ protected _initPlugins(options: UICoreOptions<EL, any>): void;
1595
+ /**
1596
+ * Add a plugin to the UI. You can provide a type parameter to this method to avoid having to cast the return
1597
+ * value, if you need to retain a reference to the plugin.
1598
+ * @param pluginSpec
1599
+ * @typeParam O Defines the options type for the plugin to add
1600
+ * @typeParam P Defines the type of the plugin that will be returned from this method
1601
+ */
1602
+ addPlugin<O extends UIPluginOptions, P extends UIPlugin<EL, O, any>>(pluginSpec: UIPluginSpec<O>): P;
1603
+ /**
1604
+ * @internal
1605
+ * @param pluginSpec
1606
+ * @param fireEvent
1607
+ * @private
1608
+ */
1609
+ private _addPlugin;
1610
+ /**
1611
+ * Gets the plugin registered for the given type, null if nothing matching found.
1612
+ * @param pluginType
1613
+ *
1614
+ */
1615
+ getPlugin<P extends UIPlugin<EL, any, any>>(pluginType: string): P | null;
1616
+ /**
1617
+ * Dispatch an event to the list of plugins.
1618
+ * @param fn
1619
+ * @private
1620
+ * @internal
1621
+ */
1622
+ protected _dispatchToPlugins(fn: (p: UIPlugin<EL, any, any>) => any): void;
1623
+ protected $_dataHooks: Array<{
1624
+ load: (d: UISaveData) => void;
1625
+ save: (d: UISaveData) => void;
1626
+ }>;
1627
+ /**
1628
+ * Register a {@link DataHook} - a pair of functions that are invoked during a `load` and a `save`. This mechanism is a means you can use for storing/retrieving custom data from the payload the UI exports: in the save method you can decorate the data provided to you with anything you like, but you must ensure that it is serializable, ie. it must be pure data. In your load method you can read out this data and take appropriate action.
1629
+ * @param hook
1630
+ * @tags input/output
1631
+ */
1632
+ registerDataHook(hook: DataHook): void;
1633
+ /**
1634
+ * Export the dataset and the current state of the UI - its zoom setting, but subclasses can override this method and add other data.
1635
+ * @param options Options for the save.
1636
+ * @tags input/output
1637
+ */
1638
+ save(options?: UIExportOptions): UISaveData;
1639
+ /**
1640
+ * Saves the return value of this object's `save` method via ajax POST to a given URL.
1641
+ * @param options Save options
1642
+ * @tags input/output
1643
+ */
1644
+ saveToUrl(options: SaveOptions): void;
1645
+ /**
1646
+ * Load the dataset and the current state of the UI - its zoom setting, but subclasses can override this method and extract other information.
1647
+ * @param data
1648
+ * @param onload Optional function to invoke after load.
1649
+ * @tags input/output
1650
+ */
1651
+ load(data: UISaveData, onload?: Function): void;
1652
+ $isArrayLike<E = any>(el: any): el is ArrayLike<E>;
1653
+ abstract $doRenderNode(n: Node, eventInfo?: any): void;
1654
+ abstract $doRenderGroup(g: Group, eventInfo?: any): void;
1655
+ abstract $reRenderNode(n: Node): void;
1656
+ /**
1657
+ * @internal
1658
+ * @param o
1659
+ * @param params
1660
+ * @param extents
1661
+ */
1662
+ abstract $paintOverlay(o: Overlay<EL>, params: OverlayPaintParams, parentOrigin: PointXY): void;
1663
+ abstract $addOverlayClass(o: Overlay<EL>, clazz: string): void;
1664
+ abstract $removeOverlayClass(o: Overlay<EL>, clazz: string): void;
1665
+ abstract setOverlayVisible(o: Overlay<EL>, visible: boolean): void;
1666
+ abstract destroyOverlay(o: Overlay<EL>): void;
1667
+ abstract updateLabel(o: LabelOverlay<EL>): void;
1668
+ abstract $drawOverlay(overlay: Overlay<EL>, component: Connector, paintStyle: PaintStyle, absolutePosition?: PointXY): OverlayPaintParams;
1669
+ abstract $reattachOverlay(o: Overlay<EL>, c: Connection<EL>): void;
1670
+ abstract $setOverlayHover(o: Overlay<EL>, hover: boolean): void;
1671
+ abstract $setHover(component: ComponentBase<EL>, hover: boolean): void;
1672
+ /**
1673
+ * @internal
1674
+ * @param connector
1675
+ * @param paintStyle
1676
+ * @param extents
1677
+ */
1678
+ abstract $paintConnector(connection: Connection<any>, paintStyle: PaintStyle): void;
1679
+ /**
1680
+ * @internal
1681
+ * @param connection
1682
+ * @param force
1683
+ */
1684
+ abstract $destroyConnector(connection: Connection<EL>, force?: boolean): void;
1685
+ /**
1686
+ * @internal
1687
+ * @param connection
1688
+ * @param h
1689
+ */
1690
+ abstract $setConnectorHover(connection: Connection<EL>, h: boolean): void;
1691
+ abstract $isAsynchronousRender(): boolean;
1692
+ /**
1693
+ * Subclasses should implement this to indicate that element dragging is supported.
1694
+ * @internal
1695
+ */
1696
+ abstract $isDraggingSupported(): boolean;
1697
+ /**
1698
+ * @internal
1699
+ * @param connector
1700
+ * @param clazz
1701
+ */
1702
+ abstract $addConnectorClass(connector: Connector, clazz: string): void;
1703
+ abstract $removeConnectorClass(connector: Connector, clazz: string): void;
1704
+ abstract $setConnectorVisible(connector: Connector, v: boolean): void;
1705
+ abstract $getConnectorClass(connector: Connector): string;
1706
+ abstract $applyConnectorType(connector: Connector, t: TypeDescriptorBase): void;
1707
+ abstract $setConnectionVisible(c: Connection<EL>, v: boolean): void;
1708
+ /**
1709
+ * Sets the position of the given viewport element, taking rotation into account when necessary.
1710
+ * @param el
1711
+ * @param p
1712
+ * @internal
1713
+ */
1714
+ abstract $setViewportElementPosition(el: ViewportElement<EL>, p: PointXY): void;
1715
+ abstract on(el: Document | EL | ArrayLike<EL>, event: string, callbackOrSelector: Function | string, callback?: Function): void;
1716
+ abstract off(el: Document | EL | ArrayLike<EL>, event: string, callback: Function): void;
1717
+ /**
1718
+ * Trigger an event on the given element. Exposed for API users but mostly intended for internal use.
1719
+ * @param el - Element to trigger the event on.
1720
+ * @param event - Name of the event to trigger.
1721
+ * @param originalEvent - Optional event that gave rise to this method being called.
1722
+ * @param payload - Optional `payload` to set on the Event that is created.
1723
+ * @param detail - Optional detail for the Event that is created.
1724
+ */
1725
+ abstract trigger(el: Document | EL, event: string, originalEvent?: Event, payload?: any, detail?: number): void;
1726
+ /**
1727
+ * Subclasses must implement this to handle a vertex update event.
1728
+ * @internal
1729
+ * @param el
1730
+ * @param p
1731
+ */
1732
+ abstract $doVertexUpdated(el: ViewportElement<EL>): void;
1733
+ abstract getVisibleCanvasBounds(): RectangleXY;
1734
+ }