@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,62 @@
1
+ import { AbstractHierarchicalLayout, AbstractHierarchicalLayoutParameters, ChildEdgesFunction } from "./abstract-hierarchical-layout";
2
+ import { Vertex } from "../../model/graph";
3
+ import { Magnetizer } from "../../magnetizer";
4
+ import { InternalLayoutOptions } from "../abstract-layout";
5
+ import { DataSource } from "../../datasource";
6
+ import { PointXY, Size } from "../../util";
7
+ /**
8
+ * Models a cluster of elements. Used internally by a few layouts.
9
+ * @internal
10
+ */
11
+ export declare class ElementCluster {
12
+ focus: any;
13
+ readonly id: string;
14
+ children: Set<Vertex>;
15
+ private _positions;
16
+ private _incidentAngles;
17
+ group: Array<any>;
18
+ extents: [number, number, number, number];
19
+ offsets: Record<string, PointXY>;
20
+ constructor(focus: any);
21
+ setPosition(id: string, x: number, y: number): void;
22
+ getPosition(id: string): PointXY;
23
+ getIncidentAngle(id: string): number;
24
+ setIncidentAngle(id: string, theta: number): void;
25
+ getPositions(): Map<string, PointXY>;
26
+ }
27
+ /**
28
+ * Constructor parameters for a Balloon layout.
29
+ * @group Layouts
30
+ * @category Balloon
31
+ */
32
+ export interface BalloonLayoutParameters extends AbstractHierarchicalLayoutParameters<Vertex> {
33
+ /**
34
+ * Minimum distance between a group of vertices and its neighbours. Defaults to 100 pixels.
35
+ */
36
+ groupPadding?: number;
37
+ /**
38
+ * The function that retrieves child edges for a given vertex. This function defines how the
39
+ * layout walks your data model to generate the output.
40
+ */
41
+ getChildEdges: ChildEdgesFunction;
42
+ }
43
+ /**
44
+ * Balloon layout arranges the direct children of some vertex in a circle around that vertex, recursively. It is best used
45
+ * for hierarchical data, in particular where each vertex has a single parent. This layout is a
46
+ * concrete implementation of {@link AbstractHierarchicalLayout}.
47
+ * @group Layouts
48
+ * @category Balloon
49
+ */
50
+ export declare class BalloonLayout extends AbstractHierarchicalLayout<BalloonLayoutParameters> {
51
+ static type: string;
52
+ readonly type: string;
53
+ _getChildEdges: ChildEdgesFunction;
54
+ private _clusters;
55
+ clusterMagnetizer: Magnetizer<ElementCluster>;
56
+ groupPadding: number;
57
+ constructor(params: InternalLayoutOptions<BalloonLayoutParameters>);
58
+ getDefaultParameters(): BalloonLayoutParameters;
59
+ begin(toolkit: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: BalloonLayoutParameters): void;
60
+ private _one;
61
+ step(toolkit: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: BalloonLayoutParameters): void;
62
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Possible values for the `align` option on a {@link HierarchicalLayout}
3
+ * @group Layouts
4
+ * @category Hierarchical
5
+ */
6
+ export type HierarchicalLayoutAlignment = "center" | "start" | "end";
7
+ /**
8
+ * The default layout alignment for a {@link HierarchicalLayout}
9
+ * @group Layouts
10
+ * @internal
11
+ */
12
+ export declare const DEFAULT_HIERARCHICAL_LAYOUT_ALIGN = "center";
13
+ /**
14
+ * The default padding used by a Hierarchical Layout
15
+ * @group Layouts
16
+ * @internal
17
+ */
18
+ export declare const DEFAULT_HIERARCHICAL_LAYOUT_PADDING: {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ /**
23
+ * Defines the type of the `spacing` option on a {@link HierarchicalLayout}
24
+ * @group Layouts
25
+ * @category Hierarchical
26
+ */
27
+ export type HierarchicalLayoutSpacing = "compress" | "auto";
28
+ /**
29
+ * The default type of spacing used in a {@link HierarchicalLayout}
30
+ * @group Layouts
31
+ * @internal
32
+ */
33
+ export declare const DEFAULT_HIERARCHICAL_LAYOUT_SPACING: HierarchicalLayoutSpacing;
34
+ /**
35
+ * The default alignment used in a {@link HierarchicalLayout}
36
+ * @group Layouts
37
+ * @internal
38
+ */
39
+ export declare const DEFAULT_HIERARCHICAL_LAYOUT_ALIGNMENT = "center";
40
+ /**
41
+ * Possible values for {@link HierarchicalLayout} orientation. `horizontal` means that the layers of vertices are arranged horizontally. `vertical` means the layers of vertices are arranged vertically.
42
+ * @group Layouts
43
+ * @category Hierarchical
44
+ */
45
+ export type HierarchicalLayoutOrientation = "horizontal" | "vertical";
@@ -0,0 +1,102 @@
1
+ import { AbstractHierarchicalLayout, AbstractHierarchicalLayoutParameters, HierarchicalLayoutChildVerticesFunction } from "./abstract-hierarchical-layout";
2
+ import { Vertex } from "../../model/graph";
3
+ import { InternalLayoutOptions } from "../abstract-layout";
4
+ import { DataSource } from "../../datasource";
5
+ import { PointXY, Size } from "../../util";
6
+ import { HierarchicalLayoutAlignment, HierarchicalLayoutOrientation, HierarchicalLayoutSpacing } from "./definitions";
7
+ interface ChildGroup {
8
+ nodes: Array<any>;
9
+ loc: number;
10
+ size: number;
11
+ parents: Array<any>;
12
+ depth: number;
13
+ children: Array<any>;
14
+ }
15
+ /**
16
+ * @internal
17
+ */
18
+ interface HierarchicalLayoutEntry {
19
+ root?: boolean;
20
+ node: Vertex;
21
+ parents: Array<HierarchicalLayoutEntry>;
22
+ childGroup: ChildGroup;
23
+ childGroupIndex: number;
24
+ loc: number;
25
+ index: number;
26
+ dimensions: Size;
27
+ size: number;
28
+ children: Array<HierarchicalLayoutEntry>;
29
+ }
30
+ /**
31
+ * @internal
32
+ */
33
+ interface HierarchicalLayoutLayer {
34
+ entries: Array<HierarchicalLayoutEntry>;
35
+ pointer: number;
36
+ otherAxis: number;
37
+ otherAxisSize: number;
38
+ }
39
+ /**
40
+ * Parameters for the {@link HierarchicalLayout}
41
+ * @group Layouts
42
+ * @category Hierarchical
43
+ */
44
+ export interface HierarchicalLayoutParameters extends AbstractHierarchicalLayoutParameters<Vertex> {
45
+ /**
46
+ * Optional, defaults to "vertical". Valid values are "vertical" and "horizontal".
47
+ */
48
+ orientation?: HierarchicalLayoutOrientation;
49
+ /**
50
+ * Optional, defaults to false. If true, the layout will be inverted, ie. the root node will be at the bottom for horizontal layouts, and to the right for vertical layouts
51
+ */
52
+ invert?: boolean;
53
+ /**
54
+ * Optional, defaults to "auto". Valid values are: "auto" (`Spacing.auto`) Spaces each node and its parent according to the size of the biggest node in the given node's level. "compress" (`Spacing.compress`) Uses a regular spacing between each node and its parent
55
+ */
56
+ spacing?: HierarchicalLayoutSpacing;
57
+ /**
58
+ * Optional, defaults to "center". Instructs the layout how to place child nodes with respect to their parent nodes. By default, a group of child nodes is centered on its parent. The layout also supports "start" and "end" for this value, which work in much the same way as "flex-start" and "flex-end" do in CSS: for a hierarchical layout with the root at the top of the tree and the child nodes underneath, a value of "start" for align would cause the first child of the root to be placed immediately under the root, with its first child immediately underneath, etc. The remainder of the content would fan out to the right. This option also works in conjunction with invert and orientation:"vertical"
59
+ */
60
+ align?: HierarchicalLayoutAlignment;
61
+ }
62
+ /**
63
+ * Constant used to identify the Hierarchical layout.
64
+ * @group Layouts
65
+ * @internal
66
+ */
67
+ export declare const LAYOUT_TYPE_HIERARCHICAL = "Hierarchical";
68
+ /**
69
+ * A layout that places vertices into a series of layers. This layout expects no cycles, and does not deal well with cycles. You can use
70
+ * the {@link Hierarchy} layout if your dataset has cycles. We originally intended to leave this layout out of VisuallyJs, because you
71
+ * can use the HierarchyLayout but for some basic use cases this layout is still helpful.
72
+ * @group Layouts
73
+ * @category Hierarchical
74
+ */
75
+ export declare class HierarchicalLayout extends AbstractHierarchicalLayout<HierarchicalLayoutParameters> {
76
+ static type: string;
77
+ readonly type: string;
78
+ private _orientation;
79
+ private _horizontal;
80
+ private _axisIndex;
81
+ private readonly _compress;
82
+ private readonly _invert;
83
+ private readonly _alignment;
84
+ private readonly _spacing;
85
+ private _hierarchy;
86
+ _getChildVertices: HierarchicalLayoutChildVerticesFunction<Vertex>;
87
+ constructor(params: InternalLayoutOptions<HierarchicalLayoutParameters>);
88
+ getDefaultParameters(): HierarchicalLayoutParameters;
89
+ begin(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: HierarchicalLayoutParameters): void;
90
+ step(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: Record<string, any>): void;
91
+ /**
92
+ * Gets the computed hierarchy. This is returned as an array of objects, one for each level, inside which
93
+ * there is a `nodes` array.
94
+ */
95
+ getHierarchy(): Array<HierarchicalLayoutLayer>;
96
+ /**
97
+ * Gets the orientation of the layout - "horizontal" or "vertical".
98
+ * @returns "horizontal" or "vertical"
99
+ */
100
+ getOrientation(): HierarchicalLayoutOrientation;
101
+ }
102
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./abstract-hierarchical-layout";
2
+ export * from './parent-relative-placement';
3
+ export * from "./hierarchical-layout";
4
+ export * from "./balloon-layout";
5
+ export * from './definitions';
@@ -0,0 +1,96 @@
1
+ import { HierarchicalLayoutChildVerticesFunction } from "./abstract-hierarchical-layout";
2
+ import { HierarchicalLayoutAlignment } from "./definitions";
3
+ import { HasId } from "../../model/graph";
4
+ import { PointXY, Size } from "../../util";
5
+ import { HEIGHT, WIDTH } from "../../constants";
6
+ import { DataSource } from "../../datasource";
7
+ /**
8
+ * Placement strategy that places children relative to their parent - for {@link HierarchicalLayout}.
9
+ * @group Layouts
10
+ * @category Hierarchical
11
+ * @internal
12
+ */
13
+ export type HierarchicalParentRelativePlacementStrategyOptions<T extends HasId> = {
14
+ rootNode: any | Array<any>;
15
+ compress?: boolean;
16
+ axisIndex: number;
17
+ invert?: boolean;
18
+ padding: PointXY;
19
+ alignment?: HierarchicalLayoutAlignment;
20
+ idFunction: (v: any) => string;
21
+ sizeFunction: (id: string) => Size;
22
+ childVerticesFunction: HierarchicalLayoutChildVerticesFunction<T>;
23
+ absolutePositionFunction: (v: any) => PointXY;
24
+ absoluteBacked?: boolean;
25
+ };
26
+ export type BooleanMap = Record<string, boolean>;
27
+ export type SizeAxis = typeof WIDTH | typeof HEIGHT;
28
+ /**
29
+ * Places elements with respect to their parents, aligning them at parent start/end/center depending on the
30
+ * value of `alignment`.
31
+ * @internal
32
+ */
33
+ export declare class HierarchicalParentRelativePlacementStrategy<T extends HasId> {
34
+ private dataSource;
35
+ private readonly _rootNodes;
36
+ private readonly _compress;
37
+ private readonly _invert;
38
+ private readonly _hierarchy;
39
+ private readonly _childGroups;
40
+ private readonly _visitedNodes;
41
+ private _padding;
42
+ private readonly _axisPadding;
43
+ private readonly _otherAxisPadding;
44
+ private readonly _axisIndex;
45
+ private readonly _otherAxisIndex;
46
+ private readonly _horizontal;
47
+ private readonly _absoluteBacked;
48
+ private readonly _alignment;
49
+ private _maximumPointer;
50
+ private _minimumPointer;
51
+ private readonly _otherAxisPositionProperty;
52
+ private readonly _axisSizeProperty;
53
+ private readonly _otherAxisSizeProperty;
54
+ private _maxSizes;
55
+ positions: Map<string, {
56
+ position: PointXY;
57
+ layer: number;
58
+ }>;
59
+ _alignmentLocationCalculators: {
60
+ center: (cg: any) => number;
61
+ start: (cg: any) => any;
62
+ end: (cg: any) => number;
63
+ };
64
+ private readonly _getId;
65
+ private readonly _getSize;
66
+ private readonly _getChildVertices;
67
+ private readonly _absolutePositionFunction;
68
+ constructor(dataSource: DataSource, parameters: HierarchicalParentRelativePlacementStrategyOptions<T>);
69
+ execute(): Map<string, {
70
+ position: PointXY;
71
+ layer: number;
72
+ }>;
73
+ /**
74
+ * set the position of the given element, and adjust the max/min pointers to account for it. note that for
75
+ * max pointer we add the size of the element in the layout's axis.
76
+ * @param id
77
+ * @param pos
78
+ * @param layer
79
+ * @internal
80
+ */
81
+ private _setPosition;
82
+ private _get;
83
+ private _add;
84
+ private _addChildGroup;
85
+ _setGroupParentLocation(g: any, loc: any): void;
86
+ private _getMaximumParentSizeInAxis;
87
+ private _alignChildGroup;
88
+ _parentAlignmentCalculators: {
89
+ center: (cg: any, min: number, max: number) => number;
90
+ start: (cg: any, min: number, max: number) => number;
91
+ end: (cg: any, min: number, max: number) => number;
92
+ };
93
+ private _alignParent;
94
+ private _alignParents;
95
+ private _doOne;
96
+ }
@@ -0,0 +1,26 @@
1
+ import { HierarchyLayoutStage } from "./hierarchy-layout-stage";
2
+ import { Edge } from "../../model/graph";
3
+ import { HierarchyLayoutModel } from "./model";
4
+ import { VertexSet } from "./vertex-set";
5
+ /**
6
+ * @internal
7
+ */
8
+ export declare class AssignLayersStage extends HierarchyLayoutStage {
9
+ private vertexSet;
10
+ private _placedMap;
11
+ private _done;
12
+ private _currentLayer;
13
+ private _unprocessedChildren;
14
+ private _filteredEdges;
15
+ private _leavesAtBottom;
16
+ constructor(model: HierarchyLayoutModel, vertexSet: VertexSet);
17
+ private _countUnplacedAdjacentVertices;
18
+ private _oneNode;
19
+ private _cascadeEdgeNodes;
20
+ execute(currentNode: any): void;
21
+ _pushLeavesToBottom(): void;
22
+ /**
23
+ * @internal
24
+ */
25
+ getFilteredEdges(): Array<Edge>;
26
+ }
@@ -0,0 +1,78 @@
1
+ import { HierarchyLayoutLayerEntry } from "./definitions";
2
+ import { LayoutLayer, LayoutLayerEntry, LayoutLayerOrdering } from "../abstract-layout";
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface CrossingStageOptions {
7
+ maxIterations?: number;
8
+ maxIterationsWithoutImprovement?: number;
9
+ }
10
+ /**
11
+ * @internal
12
+ */
13
+ export type EnhancedCrossing = {
14
+ sourceLayer: number;
15
+ targetLayer: number;
16
+ sourceVertex: number;
17
+ targetVertex: number;
18
+ };
19
+ /**
20
+ * @internal
21
+ */
22
+ export type EnhancedCrossings<L extends LayoutLayerEntry> = {
23
+ total: number;
24
+ layers: Array<Array<EnhancedCrossing>>;
25
+ ordering: LayoutLayerOrdering<L>;
26
+ };
27
+ /**
28
+ * @internal
29
+ */
30
+ export declare class CrossingStage<L extends HierarchyLayoutLayerEntry> {
31
+ protected vertexSet: {
32
+ layers: Array<LayoutLayer<L>>;
33
+ };
34
+ private getAdjacentEntries;
35
+ private readonly _maxIterations;
36
+ private readonly _maxIterationsWithoutImprovement;
37
+ constructor(vertexSet: {
38
+ layers: Array<LayoutLayer<L>>;
39
+ }, getAdjacentEntries: (ordering: LayoutLayerOrdering<L>, otherLayerIndex: number, node: L) => Array<[L, number]>, options: CrossingStageOptions);
40
+ /**
41
+ * @internal
42
+ */
43
+ private _computeInitialOrdering;
44
+ /**
45
+ * @internal
46
+ */
47
+ execute(): void;
48
+ /**
49
+ * @internal
50
+ * @param ordering
51
+ */
52
+ private _computeTotalEnhancedCrossings;
53
+ /**
54
+ * Compute the total enhanced crossings in the given layer. in this version, we get the
55
+ * index of the source and target vertices.
56
+ * @param i
57
+ * @param ordering
58
+ * @internal
59
+ */
60
+ private _computeLayerEnhancedCrossing;
61
+ /**
62
+ * Computes a reordering of the given model. Nodes in each layer are positioned at the average
63
+ * index of the nodes in either the next or previous layer to which the given node is connected. This is non
64
+ * destructive: a new model is returned, and the model passed in is not altered.
65
+ * @param iteration
66
+ * @param ordering
67
+ * @internal
68
+ */
69
+ private _computeAverageWeighting;
70
+ /**
71
+ * Computes a reordering of the layer at `layerIndex` in the given model. For each node in the layer we compute the average of the indices of the nodes in the other layer to which the node is connected. This is an improvement over the median approach: consider one node attached to nodes 0 and 1 in the other layer, and a node attached to node 1 in the other layer. The median value in the other layer for both of these is 1, when we use the right most, and so then ordering the nodes in the focus layer is indeterminate. But it's clear the node attached to [0] and [1] should be on the left, so if we use the average, we get, for the node attached to [0] and [1], and average of 0.5, and for the node attached only to [1], an average of [1]. When we order these averages everything lines up how we want it.
72
+ * @param layerIndex The layer to rearrange
73
+ * @param ordering The entire model
74
+ * @param downwards If true, the layer after layerIndex is used as the comparison layer. If false, the layer before layerIndex is used as the comparison layer. When trying to compute an optimum set of crossings, the main algorithm flips this value each time it runs a sweep through the layers.
75
+ * @internal
76
+ */
77
+ private _computeLayerArrangedByAverage;
78
+ }
@@ -0,0 +1,261 @@
1
+ import { AbstractEdgeTerminus, Edge, Group, HasId, HasIdAndType, Node } from "../../model/graph";
2
+ import { VisuallyJsModel } from "../../toolkit";
3
+ import { AbsoluteBackedLayoutParameters } from "../absolute-layout";
4
+ import { PlacementStageStrategy } from "./placement-stage";
5
+ import { HierarchyLayout } from "./hierarchy-layout";
6
+ import { VertexSet } from "./vertex-set";
7
+ import { LayoutLayerEntry, LayoutLayerOrdering } from "../abstract-layout";
8
+ import { GatedPath } from "../../router";
9
+ import { PointXY, Size } from "../../util";
10
+ /**
11
+ * @internal
12
+ */
13
+ export declare const EDGE = "edge";
14
+ /**
15
+ * @internal
16
+ */
17
+ export declare const VERTEX = "vertex";
18
+ /**
19
+ * Definition of a function that can retrieve child vertices of some vertex, used in the {@link HierarchyLayout}. This function can be used to implement layouts that only show a certain subset of the entire dataset, or to implement a collapse/expand scheme.
20
+ * @group Layouts
21
+ * @category Hierarchy
22
+ * @typeParam T Defines the type of the object from which child vertices will be retrieved, and the type of the child vertices.
23
+ */
24
+ export type ChildVerticesFunction<T extends HasId> = (node: T, layer: number, instance: VisuallyJsModel) => Array<T>;
25
+ /**
26
+ * Axis types for a {@link HierarchyLayout}
27
+ * @group Layouts
28
+ * @category Hierarchy
29
+ */
30
+ export type HierarchyLayoutAxis = "horizontal" | "vertical";
31
+ /**
32
+ * Defines the alignment of members in a row/column of a {@link HierarchyLayout}
33
+ * @group Layouts
34
+ * @category Hierarchy
35
+ */
36
+ export type HierarchyLayoutAlignment = "start" | "center" | "end";
37
+ /**
38
+ * The default alignment for a {@link HierarchyLayout}
39
+ * @group Layouts
40
+ * @category Hierarchy
41
+ * @internal
42
+ */
43
+ export declare const DEFAULT_HIERARCHY_LAYOUT_ALIGNMENT = "center";
44
+ /**
45
+ * Default amount of space to assign to edge nodes - dummy nodes that are placed on a layer for an edge to pass through to the layer below.
46
+ * @internal
47
+ */
48
+ export declare const DEFAULT_EDGE_NODE_SIZE = 30;
49
+ /**
50
+ * Optional parameters for a Hierarchy layout
51
+ * @group Layouts
52
+ * @category Hierarchy
53
+ */
54
+ export interface HierarchyLayoutParameters extends AbsoluteBackedLayoutParameters {
55
+ /**
56
+ * Either `horizontal` (the default, groups of child vertices are laid out in rows) or `vertical` (groups of child vertices are laid out in columns)
57
+ */
58
+ axis?: HierarchyLayoutAxis;
59
+ /**
60
+ * Number of iterations to try rearranging the graph without an improvement in legibility before accepting the current state. Defaults to 2.
61
+ */
62
+ maxIterationsWithoutImprovement?: number;
63
+ /**
64
+ * Maximum number of iterations to run. Defaults to 24.
65
+ */
66
+ maxIterations?: number;
67
+ /**
68
+ * Optional node to use as the root. If this is not provided the layout calculates the best candidate based upon incoming and outgoing edges for each vertex.
69
+ */
70
+ rootNode?: any;
71
+ /**
72
+ * Optional function you can provide that will dynamically be invoked to get the root node to use.
73
+ */
74
+ getRootNode?: () => AbstractEdgeTerminus;
75
+ /**
76
+ * Defaults to false. If true, the layout generates routing information for the channels between layers and edge nodes, and for edge routing.
77
+ */
78
+ generateRouting?: boolean;
79
+ /**
80
+ * The strategy to use when placing vertices. Default is 'center', meaning every row is centered around the axis orthogonal to the axis in which the vertices are laid out.
81
+ */
82
+ placementStrategy?: PlacementStageStrategy;
83
+ /**
84
+ * Optional, defaults to `HierarchyLayoutAlignmentValues.center`. Instructs the layout how to place child nodes with respect to their parent nodes. By default, a group of child nodes is centered on its parent. The layout also supports "start" and "end" for this value, which work in much the same way as "flex-start" and "flex-end" do in CSS: for a layout with the root at the top of the tree and the child nodes underneath, a value of "start" for align would cause the first child of the root to be placed immediately under the root, with its first child immediately underneath, etc. The remainder of the content would fan out to the right. This option also works in conjunction with invert and axis:HierarchyLayoutAxisValues.vertical.
85
+ */
86
+ alignment?: HierarchyLayoutAlignment;
87
+ /**
88
+ * Optional size - in the main axis - to use for edge nodes, which are dummy nodes (not visible) that are inserted on a layer to allow an edge to pass through to a layer below.
89
+ * @internal
90
+ */
91
+ edgeNodeSize?: number;
92
+ /**
93
+ * Optional filter for edges. If provided, this function will be used to filter the edges that identify links between vertices. All filtered edges are gathered
94
+ * @param e
95
+ * @internal
96
+ */
97
+ edgeFilter?: (e: Edge) => boolean;
98
+ /**
99
+ * @internal
100
+ */
101
+ filteredEdgeProcessor?: FilteredEdgeProcessor;
102
+ /**
103
+ * If true, the layout will be inverted in its perpendicular axis. For instance, if `axis` is "horizontal" and `invert` is true, the root nodes of the layout will be placed at the bottom of the layout, and their children will be placed above them.
104
+ */
105
+ invert?: boolean;
106
+ /**
107
+ * If true, the layout will take into account 'directed' edges, and attempt to place the source of any given edge in a higher layer than the edge's target. This flag also has the effect of positioning any nodes that act only as the source of one or more edges on the root layer of the layout.
108
+ *
109
+ * It isn't always possible to place the source of some edge in a higher layer than the edge's target, due to the graph's topology, but this flag will ensure the layout makes every effort to do so.
110
+ */
111
+ /**
112
+ * If true root nodes that do not have children will be positioned adjacent to the last root node that does have children. When false (which is the default), unattached roots are spaced apart so that they do not overlap any child trees.
113
+ */
114
+ gatherUnattachedRoots?: boolean;
115
+ /**
116
+ * If true, all of the leaf nodes will be placed at the bottom of the layout (or at the right hand side if the axis is `vertical`)
117
+ */
118
+ leavesAtBottom?: boolean;
119
+ }
120
+ /**
121
+ * List of edges that were filtered by an `edgeFilter` and which were not used in the calculation of the layout.
122
+ * @internal
123
+ */
124
+ export type UnprocessedEdgeList = Array<{
125
+ sourceEntry: HierarchyLayoutLayerEntry;
126
+ sourceEntryIndex: number;
127
+ targetEntry: HierarchyLayoutLayerEntry;
128
+ targetEntryIndex: number;
129
+ edge: Edge;
130
+ }>;
131
+ export type FilteredEdgeProcessor = (edges: UnprocessedEdgeList, layout: HierarchyLayout) => any;
132
+ /**
133
+ * Models an edge that spans more than one level. Used internally in assign layers, crossings and edge routing stages.
134
+ * @internal
135
+ */
136
+ export interface SpanningEdgeNode extends HasIdAndType {
137
+ /**
138
+ * The underlying edge.
139
+ */
140
+ edge: Edge;
141
+ /**
142
+ * The source node/group for the edge. If the edge's source is a Port, this will be the Port's parent.
143
+ */
144
+ sourceNode: Node | Group;
145
+ /**
146
+ * The target node/group for the edge. If the edge's target is a Port, this will be the Port's parent.
147
+ */
148
+ targetNode: Node | Group;
149
+ /**
150
+ * Index of the edge's root layer
151
+ */
152
+ rootLayer: number;
153
+ /**
154
+ * Index of the edge's target layer
155
+ */
156
+ targetLayer: number;
157
+ /**
158
+ * Span of the edge, which of course you can calculate via targetLayer - rootLayer.
159
+ */
160
+ span: number;
161
+ /**
162
+ * The individual entries making up the path followed by this edge.
163
+ */
164
+ entries: Array<EdgeEntry>;
165
+ }
166
+ /**
167
+ * @internal
168
+ */
169
+ export interface ResultSet {
170
+ node: Node | Group;
171
+ edgeNodes: Array<EdgeEntry>;
172
+ paths: Record<string, GatedPath>;
173
+ }
174
+ /**
175
+ * @internal
176
+ */
177
+ export interface HierarchyLayoutOrdering extends LayoutLayerOrdering<HierarchyLayoutLayerEntry> {
178
+ }
179
+ /**
180
+ * @internal
181
+ */
182
+ export interface HierarchyLayoutLayerEntry<T extends HasIdAndType = HasIdAndType> extends LayoutLayerEntry<T> {
183
+ leaf: boolean;
184
+ vertexSet: VertexSet;
185
+ }
186
+ /**
187
+ * A single entry in the layout
188
+ * @internal
189
+ */
190
+ export interface VertexEntry extends HierarchyLayoutLayerEntry<Node | Group> {
191
+ obj: Node | Group;
192
+ adjacent: Array<{
193
+ id: string;
194
+ edges: Set<Edge>;
195
+ }>;
196
+ sourceEdges: Array<{
197
+ id: string;
198
+ edges: Set<Edge>;
199
+ }>;
200
+ targetEdges: Array<{
201
+ id: string;
202
+ edges: Set<Edge>;
203
+ }>;
204
+ type: typeof VERTEX;
205
+ }
206
+ /**
207
+ * Models an edge entry in a layer.
208
+ * @internal
209
+ */
210
+ export interface EdgeEntry extends HierarchyLayoutLayerEntry<SpanningEdgeNode> {
211
+ obj: SpanningEdgeNode;
212
+ previous?: EdgeEntry;
213
+ next?: EdgeEntry;
214
+ type: typeof EDGE;
215
+ leaf: false;
216
+ }
217
+ /**
218
+ * @internal
219
+ */
220
+ export interface ParentRelativePlacementStrategyOptions<T extends HasId> {
221
+ rootNode: any | Array<any>;
222
+ compress?: boolean;
223
+ axisIndex: number;
224
+ invert?: boolean;
225
+ padding: PointXY;
226
+ alignment?: HierarchyLayoutAlignment;
227
+ idFunction: (v: any) => string;
228
+ sizeFunction: (id: string) => Size;
229
+ childVerticesFunction: ChildVerticesFunction<T>;
230
+ absolutePositionFunction: (v: any) => PointXY;
231
+ absoluteBacked?: boolean;
232
+ }
233
+ /**
234
+ * @internal
235
+ */
236
+ export interface ParentRelativeChildGroup {
237
+ nodes: Array<any>;
238
+ loc: number;
239
+ size: number;
240
+ parents: Array<ParentRelativePlacementEntry<any>>;
241
+ depth: number;
242
+ children: Array<any>;
243
+ index: number;
244
+ id: string;
245
+ }
246
+ /**
247
+ * An entry in the internal hierarchy used by the parent relative placement code.
248
+ * @internal
249
+ */
250
+ export interface ParentRelativePlacementEntry<N> {
251
+ node: N;
252
+ parents: Array<ParentRelativePlacementEntry<N>>;
253
+ childGroup?: ParentRelativeChildGroup;
254
+ loc: number;
255
+ index: number;
256
+ dimensions: Size;
257
+ size: number;
258
+ children: Array<ParentRelativePlacementEntry<N>>;
259
+ root?: boolean;
260
+ childGroupIndex?: number;
261
+ }