@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,185 @@
1
+ import { DiagonalAxis, OrthogonalAxis, PATH_CONSTRAIN_DIAGONAL, PATH_CONSTRAIN_MANHATTAN, PATH_CONSTRAIN_METRO, PATH_CONSTRAIN_NONE, PATH_CONSTRAIN_ORTHOGONAL } from "../constants";
2
+ export type DistanceHeuristic = (x1: number, y1: number, x2: number, y2: number) => number;
3
+ /**
4
+ * A segment in an a* path
5
+ * @internal
6
+ */
7
+ export interface AStarPathSegment {
8
+ ax1: number;
9
+ ay1: number;
10
+ ax2: number;
11
+ ay2: number;
12
+ axis: ParentAxis;
13
+ pathId: string;
14
+ }
15
+ /**
16
+ * An A* path.
17
+ * @internal
18
+ */
19
+ export interface AStarPath {
20
+ id: string;
21
+ segments: Array<AStarPathSegment>;
22
+ targetCell: PathFinderGridCell;
23
+ sourceCell: PathFinderGridCell;
24
+ isEmpty: boolean;
25
+ }
26
+ /**
27
+ * A cell in an A* grid.
28
+ * @internal
29
+ */
30
+ export interface PathFinderGridCell {
31
+ key: string;
32
+ f: number;
33
+ g: number;
34
+ h: number;
35
+ opened: boolean;
36
+ closed: boolean;
37
+ hasSourceObstacles: boolean;
38
+ hasTargetObstacles: boolean;
39
+ /**
40
+ * list of obstacles that intersect this cell. The elements in this array are the
41
+ * core obstacles, without buffer.
42
+ */
43
+ obstacles: Array<string>;
44
+ /**
45
+ * list of buffer zones that intersect this cell. for a given vertex at [50,50] with size [50,50],
46
+ * for example, if we say our obstacle padding is 20 pixels, then there would be a corresponding
47
+ * buffer in this array at [30,30] with size [90,90]. it is helpful to distinguish between the core
48
+ * size of obstacles and that of their buffers, because in some cases we want to treat buffers
49
+ * differently. For instance, when approaching the source/target of some path, we may want to travel
50
+ * through its buffer zone. It wouldnt be our preference, but we could sort buffer zone candidates
51
+ * below non buffer zone candidates, while still rejecting candidates that are in the core of
52
+ * the obstacle. Also, when smoothing a path that is not constrained orthogonal, if we use the
53
+ * theta* approach of following line of sight, we may want to allow line of sight to travel through
54
+ * buffer zones, as this can reduce the number of turns - but we dont want line of sight to travel
55
+ * through obstacles themselves of course.
56
+ *
57
+ * For obstacles that lie in the middle of our path we want to avoid the obstacles _and_ its buffer
58
+ * zone completely, and I'm hoping that the candidate sorting approach will do that. I won't know
59
+ * until I've done the code though.
60
+ */
61
+ buffers: Array<string>;
62
+ x: number;
63
+ y: number;
64
+ cx: number;
65
+ cy: number;
66
+ parent: PathFinderGridCell;
67
+ directionFromParent: DirectionFromParent;
68
+ /**
69
+ * For start and end nodes, which may have a null parent. This axis determines the direction the path should take
70
+ * when entering/leaving, and is derived from the associated anchor's orientation.
71
+ */
72
+ fixedAxis: ParentAxis;
73
+ ax: number;
74
+ ay: number;
75
+ }
76
+ /**
77
+ * Constant defining an empty path
78
+ * @internal
79
+ */
80
+ export declare const EMPTY_ASTAR_PATH = "empty";
81
+ /**
82
+ * The axis of travel from some parent cell to a child.
83
+ * @internal
84
+ */
85
+ export type ParentAxis = DiagonalAxis | OrthogonalAxis | undefined;
86
+ /**
87
+ * Direction of travel from some parent cell to a child. 1 means travelling in the positive direction for the axis of
88
+ * travel, and that of course depends on the axis. -1 means travelling in the negative direction for the axis. 0 means the
89
+ * child has the same value as the parent.
90
+ * @internal
91
+ */
92
+ export type DirectionFromParent = -1 | 1 | 0;
93
+ /**
94
+ * Models an adjacent cell during the path finding phase
95
+ * @internal
96
+ */
97
+ export type AdjacentCell = {
98
+ dx: number;
99
+ dy: number;
100
+ axis: ParentAxis;
101
+ directionFromParent: DirectionFromParent;
102
+ };
103
+ /**
104
+ * Models a list of adjacent cells during the path finding phase.
105
+ * @internal
106
+ */
107
+ export type AdjacentCells = Array<AdjacentCell>;
108
+ /**
109
+ * Models a function that can find adjacent cells given a cell x/y, an axis of travel, and a direction of travel.
110
+ * @internal
111
+ */
112
+ export type AdjacentCellsFinder = (x: number, y: number, pa: ParentAxis, pd: DirectionFromParent) => AdjacentCells;
113
+ /**
114
+ * List of adjacent cells in horizontal, vertical and diagonal directions.
115
+ * @internal
116
+ */
117
+ export declare const freeMovementAdjacencies: Array<AdjacentCell>;
118
+ /**
119
+ * List of adjacent cells in horizontal and vertical directions only
120
+ * @internal
121
+ */
122
+ export declare const orthogonalAdjacencies: Array<AdjacentCell>;
123
+ /**
124
+ * Finder for adjacent orthogonal cells. Finds all cells from orthogonalAdjacencies except the cell that is the previous
125
+ * cell on the current path.
126
+ * @param x
127
+ * @param y
128
+ * @param pa
129
+ * @param pd
130
+ * @internal
131
+ */
132
+ export declare const orthogonalAdjacentCellsFinder: AdjacentCellsFinder;
133
+ /**
134
+ * Finder for adjacent cells in any direction. Finds all cells from freeMovementAdjacencies except the cell that is the previous
135
+ * cell on the current path.
136
+ * @param x
137
+ * @param y
138
+ * @param axis
139
+ * @param direction
140
+ * @internal
141
+ * commenting this out prior to 6.90.0, it doesnt seem necessary.
142
+ */
143
+ /**
144
+ * Finder for adjacent cells when constrain is diagonal. Finds all cells from freeMovementAdjacencies that are either
145
+ * in a straight line with the current path, or at a 45 degree turn (and omits the cell that is the previous
146
+ * cell on the current path)
147
+ * @param x
148
+ * @param y
149
+ * @param axis
150
+ * @param direction
151
+ * @internal
152
+ */
153
+ export declare const diagonalAdjacentCellsFinder: (x: number, y: number, axis: ParentAxis, direction: DirectionFromParent) => AdjacentCell[];
154
+ /**
155
+ * A candidate for the next cell to travel to.
156
+ * @internal
157
+ */
158
+ export interface PathCandidateCell {
159
+ cx: number;
160
+ cy: number;
161
+ obstacles: Array<string>;
162
+ buffers: Array<string>;
163
+ obj: PathFinderGridCell;
164
+ /**
165
+ * This is the axis the path travels on to get from its parent to this candidate.
166
+ */
167
+ axis: ParentAxis;
168
+ /**
169
+ * The is the direction the path is travelling on.
170
+ * Positive horizontal means left to right
171
+ * Negative horizontal means right to left
172
+ * Positive vertical means top to bottom
173
+ * Negative vertical means bottom to top,
174
+ * Positive diagonal LR means left to right and top to bottom
175
+ * Negative diagonal LR means right to left and bottom to top
176
+ * Positive diagonal RL means left to right and bottom to top
177
+ * Negative diagonal RL means right to left and top to bottom
178
+ */
179
+ directionFromParent: DirectionFromParent;
180
+ ax: number;
181
+ ay: number;
182
+ g: number;
183
+ isTarget?: boolean;
184
+ }
185
+ export type AStarPathConstrainment = typeof PATH_CONSTRAIN_ORTHOGONAL | typeof PATH_CONSTRAIN_DIAGONAL | typeof PATH_CONSTRAIN_NONE | typeof PATH_CONSTRAIN_MANHATTAN | typeof PATH_CONSTRAIN_METRO;
@@ -0,0 +1,3 @@
1
+ export * from './definitions';
2
+ export * from './astar-util';
3
+ export * from './candidate-sorter';
@@ -0,0 +1,45 @@
1
+ import { AStarGrid } from "./astar-util";
2
+ import { AStarPath, AStarPathConstrainment, ParentAxis, PathFinderGridCell } from "./definitions";
3
+ import { LineXY } from "../util";
4
+ /**
5
+ * A segment we've chomped out of the chain of parents from some cell.
6
+ * @internal
7
+ */
8
+ type ChompedSegment = {
9
+ axis: ParentAxis;
10
+ source: PathFinderGridCell;
11
+ target: PathFinderGridCell;
12
+ isFirstSegment: boolean;
13
+ length: number;
14
+ };
15
+ /**
16
+ * find the next segment from the given `fromCell`. Potentially returns null.
17
+ * @internal
18
+ */
19
+ export declare function chompSegment(fromCell: PathFinderGridCell): ChompedSegment | null;
20
+ /**
21
+ * Constructs a list of segments that represent the path found between sourceCell and targetCell. This method starts on
22
+ * targetCell and works backwards towards sourceCell, constructing a list of segments by traversing through each cell's
23
+ * parent.
24
+ * @param targetCell
25
+ * @param sourceCell
26
+ * @param grid
27
+ * @param constrain
28
+ * @param pathId
29
+ * @internal
30
+ */
31
+ export declare function defaultPathToSegments(targetCell: PathFinderGridCell, sourceCell: PathFinderGridCell, grid: AStarGrid, constrain: AStarPathConstrainment, pathId: string, optimise: boolean): AStarPath;
32
+ /**
33
+ * Constructs a line of sight optimised path between sourceCell and targetCell, This method first calls the default path to segment
34
+ * routine and then optimises to remove any segments that are unnecessary. The result is that the path does not necessarily
35
+ * follow 90 degree or 45 degree turns - it is free to make turns of any angle.
36
+ * @param targetCell
37
+ * @param sourceCell
38
+ * @param grid
39
+ * @param constrain
40
+ * @param hasLineOfSight Helper function that can say whether or not some line has line of sight.
41
+ * @param pathId
42
+ * @internal
43
+ */
44
+ export declare function lineOfSightPathToSegments(targetCell: PathFinderGridCell, sourceCell: PathFinderGridCell, grid: AStarGrid, constrain: AStarPathConstrainment, hasLineOfSight: (grid: AStarGrid, l: LineXY) => boolean, pathId: string): AStarPath;
45
+ export {};
@@ -0,0 +1,67 @@
1
+ import { ModelEvent, VisuallyJsModel } from "./toolkit";
2
+ type ABinding = [ModelEvent, Function];
3
+ /**
4
+ * Options for the auto save module.
5
+ * @group Model
6
+ */
7
+ export interface AutoSaveOptions {
8
+ /**
9
+ * Whether or not to automatically save the data when an update to a model object occurs. If you set this then you need to provide `saveUrl` or `autoSaveHandler`.
10
+ */
11
+ enabled?: boolean;
12
+ /**
13
+ * Optional type to use for auto save. Defaults to "json", the default input/output format VisuallyJs uses. If you have registered your own exporter you can use this parameter to instruct VisuallyJs to auto save via that exporter.
14
+ */
15
+ type?: string;
16
+ /**
17
+ * URL for auto save endpoint.
18
+ */
19
+ saveUrl?: string;
20
+ /**
21
+ * A debounce timeout to use when the `autoSave` functionality is turned on. You can use this to reduce the number of calls to your auto save endpoint.
22
+ */
23
+ debounceTimeout?: number;
24
+ /**
25
+ * A map of HTTP headers to send along with an auto save request.
26
+ */
27
+ saveHeaders?: any;
28
+ /**
29
+ * A function to call when an auto save operation was successful.
30
+ */
31
+ onAutoSaveSuccess?: () => any;
32
+ /**
33
+ * A function to call when an auto save operation experienced an error.
34
+ */
35
+ onAutoSaveError?: () => any;
36
+ /**
37
+ * A handler for the auto save operation. You need to provide this or `saveUrl` if you set `autoSave:true`.
38
+ * @param instance
39
+ */
40
+ autoSaveHandler?: (instance: VisuallyJsModel) => any;
41
+ /**
42
+ * A function to run before auto save runs.
43
+ */
44
+ onBeforeAutoSave?: () => any;
45
+ /**
46
+ * A function to run after the auto save has run.
47
+ */
48
+ onAfterAutoSave?: () => any;
49
+ }
50
+ /**
51
+ * Saves the model automatically. An instance of this class is created by the UI; it does not need to be
52
+ * created manually.
53
+ * @internal
54
+ */
55
+ export declare class AutoSaver {
56
+ instance: VisuallyJsModel;
57
+ bindings: Array<ABinding>;
58
+ private _timer;
59
+ constructor(instance: VisuallyJsModel, options: AutoSaveOptions);
60
+ discard(): void;
61
+ }
62
+ export declare class CatchAllEventHandler {
63
+ instance: VisuallyJsModel;
64
+ bindings: Array<any>;
65
+ constructor(instance: VisuallyJsModel);
66
+ }
67
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Defines an object that can generate colors for a specific context. The strategy employed to generate colors is implementation specific.
3
+ * @group Utils
4
+ */
5
+ export interface ColorGenerator<CTX = any> {
6
+ /**
7
+ * Generate a color.
8
+ * @param context Current context.
9
+ */
10
+ generate(context?: CTX): string;
11
+ }
12
+ /**
13
+ * A color generator that returns the same color every time it is called.
14
+ * @group Utils
15
+ */
16
+ export declare class SingleColorGenerator<CTX> implements ColorGenerator<CTX> {
17
+ private color;
18
+ constructor(color: string);
19
+ /**
20
+ * Returns the color this class was constructed with.
21
+ */
22
+ generate(ctx?: CTX): string;
23
+ }
24
+ declare class RgbColor {
25
+ r: number;
26
+ g: number;
27
+ b: number;
28
+ constructor(r: number, g: number, b: number);
29
+ toString(): string;
30
+ static fromString(color: string): RgbColor;
31
+ }
32
+ /**
33
+ * A random color generator, random within bounds, it won't return a color with any component outside the range (20, 245). It also attempts to ensure that it doesnt give out two colors that are too similar. You can call `reset` on the color generator if you want to clear its history.
34
+ * @group Utils
35
+ */
36
+ export declare class RandomColorGenerator<CTX> implements ColorGenerator<CTX> {
37
+ assignedColors: Array<RgbColor>;
38
+ /**
39
+ * Generate a random color. Within certain bounds.
40
+ */
41
+ generate(ctx?: CTX): string;
42
+ reset(): void;
43
+ }
44
+ /**
45
+ * A color generator that perpetually cycles through a given list of colors.
46
+ * @group Utils
47
+ */
48
+ export declare class StaticColorGenerator<CTX> implements ColorGenerator<CTX> {
49
+ colors: string[];
50
+ counter: number;
51
+ constructor(...colors: Array<string>);
52
+ /**
53
+ * Returns the next color in the series this class was constructed with.
54
+ */
55
+ generate(ctx?: CTX): string;
56
+ }
57
+ /**
58
+ * Computes the "distance" between two colors, ie. how different a human perceives them to be.
59
+ * @param r1
60
+ * @param r2
61
+ * @internal
62
+ */
63
+ export declare function colourDistance(r1: RgbColor, r2: RgbColor): number;
64
+ export declare function getContrastColor(c: string | RgbColor): RgbColor;
65
+ export declare function getOutlineColor(c: string | RgbColor): RgbColor;
66
+ export {};
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Constant representing the word "width". Various parts of the UI use this.
3
+ * @group Constants
4
+ */
5
+ export declare const WIDTH = "width";
6
+ /**
7
+ * Constant representing the word "height". Various parts of the UI use this.
8
+ * @group Constants
9
+ */
10
+ export declare const HEIGHT = "height";
11
+ /**
12
+ * Constant representing the word "rotation". Various parts of the UI use this.
13
+ * @group Constants
14
+ */
15
+ export declare const ROTATION = "rotation";
16
+ /**
17
+ * Constant representing the letter "v". Various parts of the UI use this.
18
+ * @group Constants
19
+ */
20
+ export declare const V = "v";
21
+ /**
22
+ * Constant representing the letter "h". Various parts of the UI use this.
23
+ * @group Constants
24
+ */
25
+ export declare const H = "h";
26
+ /**
27
+ * Constant representing the word "top". Various parts of the UI use this.
28
+ * @group Constants
29
+ */
30
+ export declare const TOP = "top";
31
+ /**
32
+ * Constant representing the word "left". Various parts of the UI use this.
33
+ * @group Constants
34
+ */
35
+ export declare const LEFT = "left";
36
+ /**
37
+ * Constant representing the word "right". Various parts of the UI use this.
38
+ * @group Constants
39
+ */
40
+ export declare const RIGHT = "right";
41
+ /**
42
+ * Constant representing the word "bottom". Various parts of the UI use this.
43
+ * @group Constants
44
+ */
45
+ export declare const BOTTOM = "bottom";
46
+ /**
47
+ * Constant representing the word "center"
48
+ * @group Constants
49
+ */
50
+ export declare const CENTER = "center";
51
+ /**
52
+ * Constant representing the letter "x"
53
+ * @group Constants
54
+ */
55
+ export declare const X = "x";
56
+ /**
57
+ * Constant representing the letter "y"
58
+ * @group Constants
59
+ */
60
+ export declare const Y = "y";
61
+ /**
62
+ * Models a path segment travelling diagonally, ie with a delta in both X and Y, from top left toward bottom right when moving in the "positive" direction
63
+ * @internal
64
+ */
65
+ export declare const DIAGONAL_AXIS_LR = "dlr";
66
+ /**
67
+ * Models a path segment travelling diagonally, ie with a delta in both X and Y, from top right toward bottom left when moving in the "positive" direction.
68
+ * @internal
69
+ */
70
+ export declare const DIAGONAL_AXIS_RL = "drl";
71
+ /**
72
+ * Models no direction constraint for a path segment. Paths can travel at any angle.
73
+ * @group Edges
74
+ * @category Connectors
75
+ */
76
+ export declare const PATH_CONSTRAIN_NONE = "none";
77
+ /**
78
+ * Models Orthogonal direction constrain for a path - meaning segments can travel vertically or horizontally only.
79
+ * @group Edges
80
+ * @category Connectors
81
+ */
82
+ export declare const PATH_CONSTRAIN_ORTHOGONAL = "orthogonal";
83
+ /**
84
+ * MANHATTAN is an alias for Orthogonal
85
+ * @group Edges
86
+ * @category Connectors
87
+ */
88
+ export declare const PATH_CONSTRAIN_MANHATTAN = "manhattan";
89
+ /**
90
+ * Models Diagonal constrain for a path - meaning segments can travel vertically,
91
+ * horizontally, or lines with a 45 degree angle.
92
+ * @group Edges
93
+ * @category Connectors
94
+ */
95
+ export declare const PATH_CONSTRAIN_DIAGONAL = "diagonal";
96
+ /**
97
+ * METRO is an alias for DIAGONAL
98
+ * @group Edges
99
+ * @category Connectors
100
+ */
101
+ export declare const PATH_CONSTRAIN_METRO = "metro";
102
+ /**
103
+ * @internal
104
+ */
105
+ export declare const NEGATIVE = -1;
106
+ /**
107
+ * The vertical orthogonal axis.
108
+ * @internal
109
+ */
110
+ export declare const ORTHOGONAL_AXIS_VERTICAL = "v";
111
+ /**
112
+ * The horizontal orthogonal axis.
113
+ * @internal
114
+ */
115
+ export declare const ORTHOGONAL_AXIS_HORIZONTAL = "h";
116
+ /**
117
+ * @internal
118
+ */
119
+ export type OrthogonalAxis = typeof ORTHOGONAL_AXIS_HORIZONTAL | typeof ORTHOGONAL_AXIS_VERTICAL;
120
+ /**
121
+ * Models a path segment travelling diagonally, ie with a delta in both X and Y
122
+ * @internal
123
+ */
124
+ export type DiagonalAxis = typeof DIAGONAL_AXIS_LR | typeof DIAGONAL_AXIS_RL;
125
+ /**
126
+ * Constant for matching JS 'undefined'.
127
+ * @internal
128
+ */
129
+ export declare const UNDEFINED = "undefined";
130
+ /**
131
+ * Constant used in various places internally, and as the key for default node, edge, port and group definitions.
132
+ * @group Constants
133
+ */
134
+ export declare const DEFAULT = "default";
135
+ /**
136
+ * Constant for the term "true", as a string.
137
+ * @group Constants
138
+ */
139
+ export declare const TRUE = "true";
140
+ /**
141
+ * Constant for the term "false", as a string.
142
+ * @group Constants
143
+ */
144
+ export declare const FALSE = "false";
145
+ /**
146
+ * The default attribute used to model a vertex's position in the X axis in its backing data
147
+ * @internal
148
+ */
149
+ export declare const DEFAULT_LEFT_ATTRIBUTE = "left";
150
+ /**
151
+ * The default attribute used to model a vertex's position in the X axis in its backing data
152
+ * @internal
153
+ */
154
+ export declare const DEFAULT_TOP_ATTRIBUTE = "top";
155
+ /**
156
+ * The default attribute used to model a vertex's rotation in its backing data
157
+ * @internal
158
+ */
159
+ export declare const DEFAULT_ROTATION_ATTRIBUTE = "rotation";
160
+ /**
161
+ * The default attribute used to model a vertex's width in its backing data
162
+ * @internal
163
+ */
164
+ export declare const DEFAULT_WIDTH_ATTRIBUTE = "width";
165
+ /**
166
+ * The default attribute used to model a vertex's height in its backing data
167
+ * @internal
168
+ */
169
+ export declare const DEFAULT_HEIGHT_ATTRIBUTE = "height";
170
+ /**
171
+ * @internal
172
+ */
173
+ export declare const SOURCE = "source";
174
+ /**
175
+ * @internal
176
+ */
177
+ export declare const TARGET = "target";
178
+ /**
179
+ * @internal
180
+ */
181
+ export type ProxyLocation = typeof SOURCE | typeof TARGET;
@@ -0,0 +1,84 @@
1
+ import { VisuallyJsModel } from "./toolkit";
2
+ import { ObjectData } from "./model/graph";
3
+ export declare const CSV = "csv";
4
+ /**
5
+ * Options for the CsvReader.
6
+ */
7
+ export interface CsvReaderOptions {
8
+ /**
9
+ * Whether to treat the first line of the CSV as headers.
10
+ */
11
+ readHeaders?: boolean;
12
+ /**
13
+ * Number of lines to skip at the beginning of the CSV.
14
+ */
15
+ skipLines?: number;
16
+ /**
17
+ * Optional explicit headers to use if readHeaders is false.
18
+ */
19
+ headers?: string[];
20
+ }
21
+ /**
22
+ * A class to read and process CSV data.
23
+ * @group IO
24
+ */
25
+ export declare class CsvReader {
26
+ csv: string;
27
+ lines: string[];
28
+ startLine: number;
29
+ headers: string[] | undefined;
30
+ /**
31
+ * Creates an instance of CsvReader.
32
+ * @param csv The CSV string to read.
33
+ * @param options Configuration options for reading the CSV.
34
+ */
35
+ constructor(csv: string, options?: CsvReaderOptions);
36
+ /**
37
+ * Internal method to iterate over CSV lines and call a processor function.
38
+ * @param lineProcessor Function to call for each line, receives an array of field values.
39
+ * @private
40
+ */
41
+ _read(lineProcessor: (entries: string[]) => void): void;
42
+ /**
43
+ * Read each line consecutively and call a function with an array representing each line.
44
+ * @param onLineRead Function to call with an array of strings for each line.
45
+ */
46
+ readLines(onLineRead: (entries: string[]) => void): void;
47
+ /**
48
+ * Read each line consecutively and call a function with a record (object) representing each line.
49
+ * If headers are available, they are used as keys; otherwise, "Field 1", "Field 2", etc. are used.
50
+ * @param onRecordRead Function to call with a record object for each line.
51
+ */
52
+ readRecords(onRecordRead: (record: Record<string, string>) => void): void;
53
+ }
54
+ /**
55
+ * Options for a source,target,value CSV parser.
56
+ * @group IO
57
+ */
58
+ export interface SourceValueTargetCsvParserOptions {
59
+ /**
60
+ * Optional function that you can use to decorate loaded nodes prior to their addition to the model
61
+ * @param o Basic data object containing the node's ID.
62
+ * @param isSource Whether or not the given node is an edge source.
63
+ */
64
+ nodeDecorator?: (o: ObjectData, isSource: boolean) => ObjectData;
65
+ /**
66
+ * Defaults to true - whether or not the file is expected to have headers
67
+ */
68
+ readHeaders?: boolean;
69
+ /**
70
+ * Optional function that you can use to decorate loaded edges prior to their addition to the model
71
+ * @param e Basic data object containing the edge's value.
72
+ * @param source Data for the edge's source
73
+ * @param target Data for the edge's target
74
+ */
75
+ edgeDecorator?: (e: ObjectData, source: ObjectData, target: ObjectData) => ObjectData;
76
+ }
77
+ /**
78
+ * Loads CSV data from a file whose lines are in the format `source,target,value`
79
+ * @param csv The CSV string to load.
80
+ * @param model
81
+ * @param parameters Optional parameters (currently unused in this implementation).
82
+ * @returns An object containing nodes and edges.
83
+ */
84
+ export declare const SourceValueTargetCsvParser: (csv: string, model: VisuallyJsModel, parameters?: SourceValueTargetCsvParserOptions) => void;
@@ -0,0 +1,23 @@
1
+ import { GroupDefinition, NodeDefinition, PortDefinition } from "./vertex-definition";
2
+ import { VisuallyJsModel } from "../toolkit";
3
+ /**
4
+ * Base interface a for data model.
5
+ * @internal
6
+ */
7
+ export interface DataModelDefinition {
8
+ nodes?: Record<string, NodeDefinition>;
9
+ groups?: Record<string, GroupDefinition>;
10
+ ports?: Record<string, PortDefinition>;
11
+ }
12
+ /**
13
+ * @internal
14
+ */
15
+ export declare class DataModel {
16
+ private _nodeDefinitions;
17
+ private _groupDefinitions;
18
+ private _portDefinitions;
19
+ constructor(instance: VisuallyJsModel, def?: DataModelDefinition);
20
+ getNodeDefinition(type: string): NodeDefinition;
21
+ getGroupDefinition(type: string): GroupDefinition;
22
+ getPortDefinition(type: string): PortDefinition;
23
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Base class for node, group and port definitions. This interface is shared by the model and the view.
3
+ * @group Nodes and Groups
4
+ * @category View
5
+ */
6
+ export interface VertexDefinition {
7
+ /**
8
+ * Optional connection limit. Defaults to 1. A value of -1 means there is no limit.
9
+ */
10
+ maxConnections?: number;
11
+ /**
12
+ * Whether or not to allow edges from this vertex back to itself. Defaults to false.
13
+ */
14
+ allowLoopback?: boolean;
15
+ /**
16
+ * Whether or not to allow edges from a port back to the vertex it belongs to. Defaults to true.
17
+ */
18
+ allowVertexLoopback?: boolean;
19
+ }
20
+ /**
21
+ * A node definition in a view.
22
+ * @group Nodes and Groups
23
+ * @category View
24
+ */
25
+ export interface NodeDefinition extends VertexDefinition {
26
+ }
27
+ /**
28
+ * A group definition in a view.
29
+ * @group Nodes and Groups
30
+ * @category View
31
+ */
32
+ export interface GroupDefinition extends NodeDefinition {
33
+ }
34
+ /**
35
+ * A port definition in a view.
36
+ * @group Nodes and Groups
37
+ * @category View
38
+ */
39
+ export interface PortDefinition extends VertexDefinition {
40
+ }