@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,192 @@
1
+ import { AbstractLayoutAdapter } from "./abstract-layout-adapter";
2
+ import { Node, Group, Vertex, HasIdAndType } from "../model/graph";
3
+ import { VisuallyJsModel } from "../toolkit";
4
+ import { Extents, PointXY, Size } from "../util";
5
+ import { DataSource } from "../datasource";
6
+ /**
7
+ * @internal
8
+ */
9
+ export interface InternalLayoutOptions<LP extends LayoutParameters> {
10
+ adapter: AbstractLayoutAdapter<any>;
11
+ instance: VisuallyJsModel;
12
+ dataSource: DataSource;
13
+ container: any;
14
+ options: LP;
15
+ }
16
+ /**
17
+ * Used by layouts. This type defines a function that, given some vertex, can provide the x/y location of the vertex on the canvas. During a group layout, the second argument will contain the group that is being laid out, but when running the layout for the main canvas, `parentGroup` will not be provided.
18
+ * @group Layouts
19
+ */
20
+ export type LocationFunction = (n: Vertex, parentGroup?: Group) => PointXY;
21
+ /**
22
+ * Base interface for layout parameters. All layout parameter interfaces extend this.
23
+ * @group Layouts
24
+ */
25
+ export interface LayoutParameters extends Record<string, any> {
26
+ /**
27
+ * Optional function that, given some vertex, can provide the x/y location of the vertex on the canvas
28
+ */
29
+ locationFunction?: LocationFunction;
30
+ /**
31
+ * Optional padding to put around the elements.
32
+ */
33
+ padding?: PointXY;
34
+ /**
35
+ * Optional fixed width for the layout.
36
+ */
37
+ width?: number;
38
+ /**
39
+ * Optional fixed height for the layout.
40
+ */
41
+ height?: number;
42
+ }
43
+ /**
44
+ * Specification of a layout, containing the layout's name and, optionally, configuration options for the layout.
45
+ */
46
+ export type LayoutSpec = {
47
+ /**
48
+ * The name of the layout
49
+ */
50
+ type: string;
51
+ /**
52
+ * Optional configuration for the layout.
53
+ */
54
+ options?: LayoutParameters;
55
+ };
56
+ /**
57
+ * Abstract base class for all layouts.
58
+ * @group Layouts
59
+ */
60
+ export declare abstract class AbstractLayout<P extends LayoutParameters> {
61
+ /**
62
+ * @internal
63
+ */
64
+ instance: VisuallyJsModel;
65
+ /**
66
+ * @internal
67
+ */
68
+ adapter: AbstractLayoutAdapter<any>;
69
+ /**
70
+ * @internal
71
+ */
72
+ $vertices: Array<Node | Group>;
73
+ /** @internal */
74
+ parameters: P;
75
+ protected done: boolean;
76
+ /** @internal */
77
+ width: number;
78
+ /** @internal */
79
+ height: number;
80
+ /** @internal */
81
+ container: any;
82
+ /** @internal */
83
+ containerSize: Size;
84
+ /** @internal */
85
+ padding: PointXY;
86
+ /** @internal */
87
+ xShift: number;
88
+ /** @internal */
89
+ yShift: number;
90
+ protected _locationFunction: LocationFunction;
91
+ /** @internal */
92
+ abstract getDefaultParameters(): LayoutParameters;
93
+ abstract type: string;
94
+ constructor(params: InternalLayoutOptions<P>);
95
+ abstract reset(): void;
96
+ /**
97
+ * @internal
98
+ * */
99
+ _reset(): void;
100
+ private static _defaultParameters;
101
+ private _$_prepareParameters;
102
+ /**
103
+ * Gets the size of the vertex with the given id, retrieving from the viewport and caching it for later use if not found locally. It is cached only for the duration of one run of the layout.
104
+ * @param id - ID of the vertex whose size to retrieve
105
+ * @param sizes Size cache. When a size is first computed in a given run it is stored in this cache.
106
+ * @returns Width and height of vertex
107
+ * @internal
108
+ */
109
+ getSize(id: string, sizes: Record<string, Size>): Size;
110
+ protected _getRandomPosition(id: string, sizes: Record<string, Size>, w?: number, h?: number, doNotCalculateExtents?: boolean): PointXY;
111
+ /**
112
+ * This is an abstract function that subclasses may implement if they wish. It will be called at the beginning of a layout.
113
+ * @param dataSource The associated dataSource
114
+ * @param positionGetter Function to get position for some element
115
+ * @param positionSetter Function to set position for some element. Updates current extents as it sets the position.
116
+ * @param sizes Map of element sizes.
117
+ * @param parameters Parameters configured for the layout.
118
+ */
119
+ abstract begin(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: P): void;
120
+ /**
121
+ * This is an abstract function that subclasses may implement if they wish. It will be called at the end of a layout.
122
+ * @param dataSource The associated VisuallyJs model
123
+ * @param positionGetter Function to get position for some element
124
+ * @param positionSetter Function to set position for some element. Updates current extents as it sets the position.
125
+ * @param sizes Map of element sizes.
126
+ * @param parameters Parameters configured for the layout.
127
+ */
128
+ abstract end(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: P): void;
129
+ /**
130
+ * Step through the layout. For some layouts there is only a single step, but others continue stepping until some condition is met. Once the condition is met, the subclass must set `this.done = true`, or the layout will continue looping indefinitely.
131
+ * @param dataSource The associated VisuallyJs model
132
+ * @param positionGetter
133
+ * @param positionSetter
134
+ * @param sizes
135
+ * @param parameters Parameters configured for the layout.
136
+ */
137
+ abstract step(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: P): void;
138
+ /**
139
+ * private method to run the layout.
140
+ */
141
+ private _layout;
142
+ /**
143
+ * Runs the layout, first doing a reset of element positions. Next, if the subclass has defined a `begin` method, that will be called first. Then, the subclass's `step` method will be called repeatedly, until the subclass makes a call to `_super.setDone`. Use the `layout` method to run the layout incrementally without first resetting everything.
144
+ * @param newParameters Optional new set of parameters to apply.
145
+ * @param onComplete Optional function to call on completion of relayout.
146
+ * @internal
147
+ */
148
+ relayout(newParameters: P, onComplete: LayoutResultsFunction): void;
149
+ /**
150
+ * Runs the layout, without resetting calculated or user-provided positions beforehand. If the subclass has defined a `begin` method, that will be called first. Then, the subclass's `step` method will be called repeatedly, until the subclass makes a call to `_super.setDone`.
151
+ * @internal
152
+ */
153
+ layout(onComplete: LayoutResultsFunction): void;
154
+ }
155
+ /**
156
+ * Defines the signature of the callback method that a layout will hit after it has run. The layout passes back the position of every element, the bounds of the layout (min/max in each axis), and the size of every element.
157
+ * @internal
158
+ */
159
+ export type LayoutResultsFunction = (result: LayoutResultSet) => any;
160
+ /**
161
+ * @internal
162
+ */
163
+ export type LayoutResultSet = {
164
+ positions: Record<string, PointXY>;
165
+ bounds: Extents;
166
+ sizes: Record<string, Size>;
167
+ layout: AbstractLayout<any>;
168
+ };
169
+ /**
170
+ * Models an entry in one layer of a layout. Only some layouts have layers, like the Hierarchy layout, and this came from there initially. But when we came to do the Sankey diagram it became clear that it would be useful to genericise the code that reduced crossings between layers, and so this interface was extracted as part of that work.
171
+ * @internal
172
+ */
173
+ export interface LayoutLayerEntry<T extends HasIdAndType = HasIdAndType> extends HasIdAndType {
174
+ obj: T;
175
+ id: string;
176
+ size: Size;
177
+ type: string;
178
+ layer: number;
179
+ }
180
+ /**
181
+ * Models a set of layers in a layout. See {@link LayoutLayerEntry}
182
+ * @internal
183
+ */
184
+ export type LayoutLayerOrdering<T extends LayoutLayerEntry = LayoutLayerEntry> = Array<Array<T>>;
185
+ /**
186
+ * Models a layer in the layout. For internal use.
187
+ * @internal
188
+ */
189
+ export type LayoutLayer<T extends LayoutLayerEntry<H>, H extends HasIdAndType = HasIdAndType> = {
190
+ layer: number;
191
+ entries: Array<T>;
192
+ };
@@ -0,0 +1,31 @@
1
+ import { AbstractLayout, InternalLayoutOptions, LayoutParameters } from "../abstract-layout";
2
+ import { DataSource } from "../../datasource";
3
+ import { PointXY, Size } from "../../util";
4
+ /**
5
+ * Parameters for the circular layout.
6
+ * @group Layouts
7
+ * @category Circular
8
+ */
9
+ export interface CircularLayoutParameters extends LayoutParameters {
10
+ /**
11
+ * If true, the first node in the data set will be placed in the center of the circle. Defaults to false.
12
+ */
13
+ centerRoot?: boolean;
14
+ }
15
+ /**
16
+ * A layout that places vertices in a circle, optionally with one at the center.
17
+ * @group Layouts
18
+ * @category Circular
19
+ */
20
+ export declare class CircularLayout extends AbstractLayout<CircularLayoutParameters> {
21
+ private readonly _centerRoot;
22
+ static type: string;
23
+ readonly type: string;
24
+ padding: PointXY;
25
+ constructor(params: InternalLayoutOptions<CircularLayoutParameters>);
26
+ getDefaultParameters(): CircularLayoutParameters;
27
+ begin(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: CircularLayoutParameters): void;
28
+ end(dataSource: DataSource, getPosition: (id: string) => PointXY, setPosition: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: CircularLayoutParameters): void;
29
+ reset(): void;
30
+ step(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: CircularLayoutParameters): void;
31
+ }
@@ -0,0 +1 @@
1
+ export * from "./circular-layout";
@@ -0,0 +1,17 @@
1
+ import { AbstractLayout, InternalLayoutOptions, LayoutParameters } from "./abstract-layout";
2
+ import { DataSource } from "../datasource";
3
+ import { PointXY, Size } from "../util";
4
+ /**
5
+ * A layout that has no opinions whatsoever about where nodes should be placed. Everything is placed at [0,0] and assumed to have a width and height of 0. This layout is a placeholder, used during certain parts of the lifecycle of the UI, but it is not a layout that API users are expected to want to use.
6
+ * @group Layouts
7
+ */
8
+ export declare class EmptyLayout extends AbstractLayout<LayoutParameters> {
9
+ static type: string;
10
+ readonly type: string;
11
+ constructor(options: InternalLayoutOptions<LayoutParameters>);
12
+ getDefaultParameters(): Record<string, any>;
13
+ reset(): void;
14
+ begin(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: LayoutParameters): void;
15
+ end(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: LayoutParameters): void;
16
+ step(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: LayoutParameters): void;
17
+ }
@@ -0,0 +1,148 @@
1
+ import { AbsoluteBackedLayout, AbsoluteBackedLayoutParameters } from "../absolute-layout";
2
+ import { InternalLayoutOptions } from "../abstract-layout";
3
+ import { DataSource } from "../../datasource";
4
+ import { PointXY, Size } from "../../util";
5
+ /**
6
+ * Parameters for the force directed layout
7
+ * @group Layouts
8
+ * @category Force Directed
9
+ */
10
+ export interface ForceDirectedLayoutParameters extends AbsoluteBackedLayoutParameters {
11
+ /**
12
+ * Maximum number of iterations to run. Defaults to 50. Increasing this number may result in a nicer output, at the expense of run time.
13
+ */
14
+ iterations?: number;
15
+ /**
16
+ * Ideal spacing to leave between elements. Defaults to 250px, but this does not mean that elements end up separated by exactly 250px.
17
+ */
18
+ spacing?: number;
19
+ /**
20
+ * The amount of travel to impose on each element every time a repulsion or attraction event occurs during the calculation of the layout. This is expressed as a fraction of the distance the two elements would travel in order to be `spacing` pixels apart. Defaults to 0.25. A value of 1 here may seem desirable but in general will not provide the best results: moving one pair of elements by their ideal amount can negatively affect many others. It is better to provide a fractional value here and allow the layout to compromise.
21
+ */
22
+ r?: number;
23
+ }
24
+ /**
25
+ * A layout that treats edges as springs, and places each vertex in proximity to other vertices to which it is connected.
26
+ * @group Layouts
27
+ * @category Force Directed
28
+ */
29
+ export declare class ForceDirectedLayout extends AbsoluteBackedLayout<ForceDirectedLayoutParameters> {
30
+ /**
31
+ * @internal
32
+ */
33
+ private _currentIteration;
34
+ static type: string;
35
+ readonly type: string;
36
+ /**
37
+ * @internal
38
+ */
39
+ private _elements;
40
+ /**
41
+ * map of locked elements. This map survives multiple runs
42
+ * of the layout, but is cleared on reset.
43
+ */
44
+ private _lockMap;
45
+ /**
46
+ * @internal
47
+ */
48
+ private _moveCount;
49
+ /**
50
+ * @internal
51
+ */
52
+ private readonly _absoluteBacked;
53
+ /**
54
+ * @internal
55
+ */
56
+ private _minx;
57
+ /**
58
+ * @internal
59
+ */
60
+ private _maxx;
61
+ /**
62
+ * @internal
63
+ */
64
+ private _miny;
65
+ /**
66
+ * @internal
67
+ */
68
+ private _maxy;
69
+ /**
70
+ * @internal
71
+ */
72
+ private _cache;
73
+ /**
74
+ * @internal
75
+ */
76
+ private _edgeLists;
77
+ /**
78
+ * @internal
79
+ */
80
+ private _currentParameters;
81
+ /**
82
+ * @internal
83
+ */
84
+ private _adjustment;
85
+ constructor(params: InternalLayoutOptions<ForceDirectedLayoutParameters>);
86
+ /**
87
+ * Get default values for the layout
88
+ */
89
+ getDefaultParameters(): ForceDirectedLayoutParameters;
90
+ /**
91
+ * @internal
92
+ * @param rec
93
+ * @param x
94
+ * @param y
95
+ */
96
+ private _update;
97
+ private _locked;
98
+ private _lock;
99
+ /**
100
+ * @internal
101
+ */
102
+ reset(): void;
103
+ /**
104
+ * @internal
105
+ */
106
+ begin(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: ForceDirectedLayoutParameters): void;
107
+ /**
108
+ * @internal
109
+ * @param obj
110
+ */
111
+ private _get;
112
+ /**
113
+ * Get an element record from the cache, priming the cache if necessary. The cache is cleared when reset is called.
114
+ * This method also populated the list of edges for the given node.
115
+ * @param idx
116
+ * @internal
117
+ */
118
+ private _getCached;
119
+ /**
120
+ * @internal
121
+ */
122
+ step(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: ForceDirectedLayoutParameters): void;
123
+ /**
124
+ * @internal
125
+ */
126
+ end(dataSource: DataSource, getPosition: (id: string) => PointXY, setPosition: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: ForceDirectedLayoutParameters): void;
127
+ /**
128
+ * Updates the position for the given element, as well as the current layout bounds.
129
+ * @param node
130
+ * @param x
131
+ * @param y
132
+ * @internal
133
+ */
134
+ private _setElementPosition;
135
+ /**
136
+ * Writes final positions.
137
+ * @internal
138
+ */
139
+ private _finalisePositions;
140
+ /**
141
+ * @internal
142
+ */
143
+ private _repulsion;
144
+ /**
145
+ * @internal
146
+ */
147
+ private _attraction;
148
+ }
@@ -0,0 +1 @@
1
+ export * from './force-directed-layout';
@@ -0,0 +1,81 @@
1
+ import { LayoutParameters } from "../abstract-layout";
2
+ import { BOTTOM, CENTER, LEFT, RIGHT, TOP } from "../../constants";
3
+ /**
4
+ * GridLayout type. You can use this in a layout spec for a Surface's render parameters.
5
+ * @internal
6
+ */
7
+ export declare const LAYOUT_TYPE_GRID = "Grid";
8
+ /**
9
+ * Specialised instance of the GridLayout where `orientation` is set to "column" and the number of columns is fixed to 1.
10
+ * @internal
11
+ */
12
+ export declare const LAYOUT_TYPE_COLUMN = "Column";
13
+ /**
14
+ * Specialised instance of the GridLayout where `orientation` is set to "row" and the number of rows is fixed to 1.
15
+ * @internal
16
+ */
17
+ export declare const LAYOUT_TYPE_ROW = "Row";
18
+ /**
19
+ * Grid layout orientation
20
+ * @see {@link GridLayoutParameters}
21
+ * @group Layouts
22
+ * @category Grid
23
+ */
24
+ export type GridLayoutOrientation = "row" | "column";
25
+ /**
26
+ * Possible values for grid layout vertical alignment
27
+ * @see {@link GridLayoutParameters}
28
+ * @group Layouts
29
+ * @category Grid Layout
30
+ */
31
+ /**
32
+ * Possible values for grid layout horizontal alignment
33
+ * @see {@link GridLayoutParameters}
34
+ * @group Layouts
35
+ * @category Grid Layout
36
+ */
37
+ /**
38
+ * Vertical alignment for cells in grid layout.
39
+ * @see {@link GridLayoutParameters}
40
+ * @group Layouts
41
+ * @category Grid
42
+ */
43
+ export type GridLayoutVerticalAlignment = typeof TOP | typeof BOTTOM | typeof CENTER;
44
+ /**
45
+ * Horizontal alignment for cells in grid layout.
46
+ * @see {@link GridLayoutParameters}
47
+ * @group Layouts
48
+ * @category Grid
49
+ */
50
+ export type GridLayoutHorizontalAlignment = typeof LEFT | typeof CENTER | typeof RIGHT;
51
+ /**
52
+ * Options for the GridLayout.
53
+ * @group Layouts
54
+ * @category Grid
55
+ */
56
+ export interface GridLayoutParameters extends LayoutParameters {
57
+ /**
58
+ * Whether to lay out items row first or column first. Additionally, this
59
+ * setting will determine where any extra items are placed if the dataset does
60
+ * not conform to a grid of equal width and height
61
+ */
62
+ orientation?: GridLayoutOrientation;
63
+ /**
64
+ * Optional fixed number of rows. By default this is set to -1 - meaning not fixed - which will result in the layout
65
+ * making its best effort at drawing a grid of equal width and height.
66
+ */
67
+ rows?: number;
68
+ /**
69
+ * Optional fixed number of columns. By default this is set to -1 - meaning not fixed - which will result in the layout
70
+ * making its best effort at drawing a grid of equal width and height
71
+ */
72
+ columns?: number;
73
+ /**
74
+ * Optional alignment for vertical placement in cells. Defaults to center.
75
+ */
76
+ verticalAlignment?: GridLayoutVerticalAlignment;
77
+ /**
78
+ * Optional alignment for horizontal placement in cells. Defaults to center.
79
+ */
80
+ horizontalAlignment?: GridLayoutHorizontalAlignment;
81
+ }
@@ -0,0 +1,60 @@
1
+ import { AbstractLayout, InternalLayoutOptions } from "../abstract-layout";
2
+ import { CircularLayoutParameters } from "../circular/circular-layout";
3
+ import { DataSource } from "../../datasource";
4
+ import { GridLayoutParameters } from "./definitions";
5
+ import { PointXY, Size } from "../../util";
6
+ /**
7
+ * Constant defining row orientation
8
+ * @group Layouts
9
+ * @category Grid
10
+ */
11
+ export declare const ROW = "row";
12
+ /**
13
+ * A layout that places elements into a grid, optionally with fixed number of rows or columns. If you provide a fixed value for both rows and columns only the rows value will be honoured.
14
+ *
15
+ * Elements are placed such that they are centered in their cell, where the width and height of each cell is fixed, and is determined by the maximum width/height of all the vertices in the layout. For that reason if you have a dataset where the size of your vertices varies largely you may not get the best results - there could be a lot of whitespace.
16
+ * @group Layouts
17
+ * @category Grid
18
+ */
19
+ export declare class GridLayout extends AbstractLayout<GridLayoutParameters> {
20
+ private _cells;
21
+ private readonly _verticalAlignment;
22
+ private readonly _horizontalAlignment;
23
+ private readonly _orientation;
24
+ private readonly _rowCount;
25
+ private readonly _columnCount;
26
+ private _maxWidth;
27
+ private _maxHeight;
28
+ getDefaultParameters(): CircularLayoutParameters;
29
+ constructor(params: InternalLayoutOptions<GridLayoutParameters>);
30
+ type: string;
31
+ static type: string;
32
+ /**
33
+ *
34
+ * @param dataSource
35
+ * @param parameters
36
+ */
37
+ begin(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: GridLayoutParameters): void;
38
+ end(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: GridLayoutParameters): void;
39
+ reset(): void;
40
+ private _computePadding;
41
+ step(dataSource: DataSource, positionGetter: (id: string) => PointXY, positionSetter: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters?: any): void;
42
+ }
43
+ /**
44
+ * Specialised instance of the {@link GridLayout} where `orientation` is set to "column" and the number of columns is fixed to 1.
45
+ * @group Layouts
46
+ * @category Column
47
+ */
48
+ export declare class ColumnLayout extends GridLayout {
49
+ static type: string;
50
+ constructor(params: InternalLayoutOptions<GridLayoutParameters>);
51
+ }
52
+ /**
53
+ * Specialised instance of the {@link GridLayout} where `orientation` is set to "row" and the number of rows is fixed to 1.
54
+ * @group Layouts
55
+ * @category Grid
56
+ */
57
+ export declare class RowLayout extends GridLayout {
58
+ static type: string;
59
+ constructor(params: InternalLayoutOptions<GridLayoutParameters>);
60
+ }
@@ -0,0 +1,2 @@
1
+ export * from './definitions';
2
+ export * from "./grid-layout";
@@ -0,0 +1,90 @@
1
+ import { AbsoluteBackedLayout, AbsoluteBackedLayoutParameters } from "../absolute-layout";
2
+ import { VisuallyJsModel } from "../../toolkit";
3
+ import { Edge, HasId, Vertex } from "../../model/graph";
4
+ import { InternalLayoutOptions } from "../abstract-layout";
5
+ import { DataSource } from "../../datasource";
6
+ import { PointXY, Size } from "../../util";
7
+ /**
8
+ * Defines the function used to find child edges from some vertex.
9
+ * @group Layouts
10
+ * @category Hierarchical
11
+ */
12
+ export type ChildEdgesFunction = (node: Vertex, layer: number, instance: VisuallyJsModel) => Array<Edge>;
13
+ /**
14
+ * Defines the function used to find child edges in some {@link HierarchicalLayout}. 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.
15
+ * @group Layouts
16
+ * @category Hierarchical
17
+ * @typeParam T Defines the type of the object from which child vertices will be retrieved, and the type of the child vertices.
18
+ */
19
+ export type HierarchicalLayoutChildVerticesFunction<T extends HasId> = (node: T, layer: number, dataSource: DataSource) => Array<T>;
20
+ /**
21
+ * Base parameters for layouts that extend {@link AbstractHierarchicalLayout}.
22
+ * @group Layouts
23
+ * @category Hierarchical
24
+ */
25
+ export interface AbstractHierarchicalLayoutParameters<T extends HasId> extends AbsoluteBackedLayoutParameters {
26
+ /**
27
+ * Defaults to true. If a loop is found during the layout it is usually ignored, unless this is set to true.
28
+ */
29
+ ignoreLoops?: boolean;
30
+ /**
31
+ * Optional, defaults to true. If false, multiple roots are not supported, and assuming you have not overridden
32
+ * getRootNode, the layout uses the first node found in the dataset (otherwise it still uses the result of your
33
+ * getRootNode function)
34
+ */
35
+ /**
36
+ * Optional. A function that is given the data source instance as argument and is expected to return either a
37
+ * single node/group, or an array of nodes/groups, to use as the root(s) for the layout
38
+ * @param dataSource
39
+ */
40
+ getRootNode?: (dataSource: DataSource) => Array<Vertex>;
41
+ /**
42
+ * Defaults to false, meaning that ports are taken into account when figuring the list of edges from some vertex.
43
+ * If you set this to `true`, ports will be ignored and the layout will only consider edges connected directly to
44
+ * each vertex.
45
+ */
46
+ ignorePorts?: boolean;
47
+ /**
48
+ * Optional function used to determine the edges to traverse to find children from some node
49
+ * @param node
50
+ * @param toolkit
51
+ */
52
+ getChildVertices?: HierarchicalLayoutChildVerticesFunction<T>;
53
+ /**
54
+ * Optional. Defines the nodes/groups to use as the root of the tree. These may be provided as an array of either a
55
+ * node/group id or a node/group object. If this parameter is not specified and multipleRoots is not false then the
56
+ * layout uses the result(s) of the `getRootNode` function; otherwise it uses the first node/group found in the
57
+ * dataset.
58
+ */
59
+ rootNode?: Array<Vertex>;
60
+ }
61
+ /**
62
+ * Superclass for {@link HierarchicalLayout} and {@link BalloonLayout}.
63
+ * @group Layouts
64
+ * @category Hierarchical
65
+ */
66
+ export declare abstract class AbstractHierarchicalLayout<P extends AbstractHierarchicalLayoutParameters<Vertex>> extends AbsoluteBackedLayout<P> {
67
+ /**
68
+ * @internal
69
+ */
70
+ private _ignoreLoops;
71
+ /**
72
+ * @internal
73
+ */
74
+ _getRootNode: (instance: VisuallyJsModel) => Array<Vertex>;
75
+ /**
76
+ * @internal
77
+ */
78
+ /**
79
+ * @internal
80
+ */
81
+ private _ignorePorts;
82
+ /**
83
+ * @internal
84
+ */
85
+ protected constructor(params: InternalLayoutOptions<P>);
86
+ /**
87
+ * @internal
88
+ */
89
+ begin(dataSource: DataSource, getPosition: (id: string) => PointXY, setPosition: (id: string, x: number, y: number) => void, sizes: Record<string, Size>, parameters: AbstractHierarchicalLayoutParameters<Vertex>): void;
90
+ }