@darajs/ui-causal-graph-editor 0.4.8

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 (223) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +12 -0
  3. package/dist/CanvasPool.5cd3cdcd.js +30 -0
  4. package/dist/SharedSystems.140ebe02.js +1905 -0
  5. package/dist/WebGLRenderer.6ede660f.js +2241 -0
  6. package/dist/WebGPURenderer.f884c756.js +1544 -0
  7. package/dist/browserAll.2dcaa9f7.js +953 -0
  8. package/dist/colorToUniform.7c604fe6.js +76 -0
  9. package/dist/index.a01cfc5f.js +61895 -0
  10. package/dist/index.js +35 -0
  11. package/dist/index.umd.cjs +10287 -0
  12. package/dist/init.73e5c5e2.js +2602 -0
  13. package/dist/style.css +1 -0
  14. package/dist/types/graph-viewer/causal-graph-editor.d.ts +58 -0
  15. package/dist/types/graph-viewer/causal-graph-editor.d.ts.map +1 -0
  16. package/dist/types/graph-viewer/storybook/stories-utils.d.ts +1247 -0
  17. package/dist/types/graph-viewer/storybook/stories-utils.d.ts.map +1 -0
  18. package/dist/types/graph-viewer/utils/use-iterate-edges.d.ts +32 -0
  19. package/dist/types/graph-viewer/utils/use-iterate-edges.d.ts.map +1 -0
  20. package/dist/types/graph-viewer/utils/use-iterate-nodes.d.ts +32 -0
  21. package/dist/types/graph-viewer/utils/use-iterate-nodes.d.ts.map +1 -0
  22. package/dist/types/index.d.ts +32 -0
  23. package/dist/types/index.d.ts.map +1 -0
  24. package/dist/types/jest-setup.d.ts +18 -0
  25. package/dist/types/jest-setup.d.ts.map +1 -0
  26. package/dist/types/node-hierarchy-builder/index.d.ts +19 -0
  27. package/dist/types/node-hierarchy-builder/index.d.ts.map +1 -0
  28. package/dist/types/node-hierarchy-builder/layer-divider.d.ts +15 -0
  29. package/dist/types/node-hierarchy-builder/layer-divider.d.ts.map +1 -0
  30. package/dist/types/node-hierarchy-builder/layer-label-editor.d.ts +24 -0
  31. package/dist/types/node-hierarchy-builder/layer-label-editor.d.ts.map +1 -0
  32. package/dist/types/node-hierarchy-builder/layer.d.ts +35 -0
  33. package/dist/types/node-hierarchy-builder/layer.d.ts.map +1 -0
  34. package/dist/types/node-hierarchy-builder/node-hierarchy-builder.d.ts +27 -0
  35. package/dist/types/node-hierarchy-builder/node-hierarchy-builder.d.ts.map +1 -0
  36. package/dist/types/node-hierarchy-builder/node.d.ts +21 -0
  37. package/dist/types/node-hierarchy-builder/node.d.ts.map +1 -0
  38. package/dist/types/node-hierarchy-builder/shared.d.ts +93 -0
  39. package/dist/types/node-hierarchy-builder/shared.d.ts.map +1 -0
  40. package/dist/types/shared/causal-graph-store.d.ts +118 -0
  41. package/dist/types/shared/causal-graph-store.d.ts.map +1 -0
  42. package/dist/types/shared/editor-overlay/buttons/add-node-button.d.ts +25 -0
  43. package/dist/types/shared/editor-overlay/buttons/add-node-button.d.ts.map +1 -0
  44. package/dist/types/shared/editor-overlay/buttons/center-graph-button.d.ts +7 -0
  45. package/dist/types/shared/editor-overlay/buttons/center-graph-button.d.ts.map +1 -0
  46. package/dist/types/shared/editor-overlay/buttons/collapse-all-button.d.ts +7 -0
  47. package/dist/types/shared/editor-overlay/buttons/collapse-all-button.d.ts.map +1 -0
  48. package/dist/types/shared/editor-overlay/buttons/collapse-expand-button.d.ts +26 -0
  49. package/dist/types/shared/editor-overlay/buttons/collapse-expand-button.d.ts.map +1 -0
  50. package/dist/types/shared/editor-overlay/buttons/drag-mode-button.d.ts +27 -0
  51. package/dist/types/shared/editor-overlay/buttons/drag-mode-button.d.ts.map +1 -0
  52. package/dist/types/shared/editor-overlay/buttons/index.d.ts +24 -0
  53. package/dist/types/shared/editor-overlay/buttons/index.d.ts.map +1 -0
  54. package/dist/types/shared/editor-overlay/buttons/recalculate-layout-button.d.ts +7 -0
  55. package/dist/types/shared/editor-overlay/buttons/recalculate-layout-button.d.ts.map +1 -0
  56. package/dist/types/shared/editor-overlay/buttons/save-image-button.d.ts +7 -0
  57. package/dist/types/shared/editor-overlay/buttons/save-image-button.d.ts.map +1 -0
  58. package/dist/types/shared/editor-overlay/buttons/soft-edge-arrow-button.d.ts +19 -0
  59. package/dist/types/shared/editor-overlay/buttons/soft-edge-arrow-button.d.ts.map +1 -0
  60. package/dist/types/shared/editor-overlay/floating-elements.d.ts +29 -0
  61. package/dist/types/shared/editor-overlay/floating-elements.d.ts.map +1 -0
  62. package/dist/types/shared/editor-overlay/index.d.ts +22 -0
  63. package/dist/types/shared/editor-overlay/index.d.ts.map +1 -0
  64. package/dist/types/shared/editor-overlay/legend/index.d.ts +19 -0
  65. package/dist/types/shared/editor-overlay/legend/index.d.ts.map +1 -0
  66. package/dist/types/shared/editor-overlay/legend/legend-data.d.ts +49 -0
  67. package/dist/types/shared/editor-overlay/legend/legend-data.d.ts.map +1 -0
  68. package/dist/types/shared/editor-overlay/legend/legend-list.d.ts +6 -0
  69. package/dist/types/shared/editor-overlay/legend/legend-list.d.ts.map +1 -0
  70. package/dist/types/shared/editor-overlay/legend/legend.d.ts +7 -0
  71. package/dist/types/shared/editor-overlay/legend/legend.d.ts.map +1 -0
  72. package/dist/types/shared/editor-overlay/overlay.d.ts +42 -0
  73. package/dist/types/shared/editor-overlay/overlay.d.ts.map +1 -0
  74. package/dist/types/shared/editor-overlay/panel-content/edge/edge-editor.d.ts +8 -0
  75. package/dist/types/shared/editor-overlay/panel-content/edge/edge-editor.d.ts.map +1 -0
  76. package/dist/types/shared/editor-overlay/panel-content/edge/edge-info-content.d.ts +41 -0
  77. package/dist/types/shared/editor-overlay/panel-content/edge/edge-info-content.d.ts.map +1 -0
  78. package/dist/types/shared/editor-overlay/panel-content/edge/editor-props.d.ts +35 -0
  79. package/dist/types/shared/editor-overlay/panel-content/edge/editor-props.d.ts.map +1 -0
  80. package/dist/types/shared/editor-overlay/panel-content/edge/encoder-editor.d.ts +23 -0
  81. package/dist/types/shared/editor-overlay/panel-content/edge/encoder-editor.d.ts.map +1 -0
  82. package/dist/types/shared/editor-overlay/panel-content/edge/index.d.ts +18 -0
  83. package/dist/types/shared/editor-overlay/panel-content/edge/index.d.ts.map +1 -0
  84. package/dist/types/shared/editor-overlay/panel-content/edge/pag-editor.d.ts +23 -0
  85. package/dist/types/shared/editor-overlay/panel-content/edge/pag-editor.d.ts.map +1 -0
  86. package/dist/types/shared/editor-overlay/panel-content/edge/resolver-editor.d.ts +7 -0
  87. package/dist/types/shared/editor-overlay/panel-content/edge/resolver-editor.d.ts.map +1 -0
  88. package/dist/types/shared/editor-overlay/panel-content/edge/sections/constraint-editor.d.ts +27 -0
  89. package/dist/types/shared/editor-overlay/panel-content/edge/sections/constraint-editor.d.ts.map +1 -0
  90. package/dist/types/shared/editor-overlay/panel-content/edge/sections/description-editor.d.ts +15 -0
  91. package/dist/types/shared/editor-overlay/panel-content/edge/sections/description-editor.d.ts.map +1 -0
  92. package/dist/types/shared/editor-overlay/panel-content/edge/sections/direction-editor.d.ts +21 -0
  93. package/dist/types/shared/editor-overlay/panel-content/edge/sections/direction-editor.d.ts.map +1 -0
  94. package/dist/types/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.d.ts +17 -0
  95. package/dist/types/shared/editor-overlay/panel-content/edge/sections/edge-type-editor.d.ts.map +1 -0
  96. package/dist/types/shared/editor-overlay/panel-content/edge/sections/index.d.ts +19 -0
  97. package/dist/types/shared/editor-overlay/panel-content/edge/sections/index.d.ts.map +1 -0
  98. package/dist/types/shared/editor-overlay/panel-content/index.d.ts +20 -0
  99. package/dist/types/shared/editor-overlay/panel-content/index.d.ts.map +1 -0
  100. package/dist/types/shared/editor-overlay/panel-content/node/index.d.ts +18 -0
  101. package/dist/types/shared/editor-overlay/panel-content/node/index.d.ts.map +1 -0
  102. package/dist/types/shared/editor-overlay/panel-content/node/label-editor.d.ts +11 -0
  103. package/dist/types/shared/editor-overlay/panel-content/node/label-editor.d.ts.map +1 -0
  104. package/dist/types/shared/editor-overlay/panel-content/node/node-info-content.d.ts +34 -0
  105. package/dist/types/shared/editor-overlay/panel-content/node/node-info-content.d.ts.map +1 -0
  106. package/dist/types/shared/editor-overlay/panel-content/panel-content.d.ts +17 -0
  107. package/dist/types/shared/editor-overlay/panel-content/panel-content.d.ts.map +1 -0
  108. package/dist/types/shared/editor-overlay/panel-content/panel-title.d.ts +12 -0
  109. package/dist/types/shared/editor-overlay/panel-content/panel-title.d.ts.map +1 -0
  110. package/dist/types/shared/editor-overlay/panel-content/styled.d.ts +9 -0
  111. package/dist/types/shared/editor-overlay/panel-content/styled.d.ts.map +1 -0
  112. package/dist/types/shared/editor-overlay/positional-divs.d.ts +25 -0
  113. package/dist/types/shared/editor-overlay/positional-divs.d.ts.map +1 -0
  114. package/dist/types/shared/editor-overlay/search-bar/index.d.ts +19 -0
  115. package/dist/types/shared/editor-overlay/search-bar/index.d.ts.map +1 -0
  116. package/dist/types/shared/editor-overlay/search-bar/search-bar.d.ts +21 -0
  117. package/dist/types/shared/editor-overlay/search-bar/search-bar.d.ts.map +1 -0
  118. package/dist/types/shared/editor-overlay/search-bar/use-search.d.ts +32 -0
  119. package/dist/types/shared/editor-overlay/search-bar/use-search.d.ts.map +1 -0
  120. package/dist/types/shared/editor-overlay/zoom-prompt.d.ts +9 -0
  121. package/dist/types/shared/editor-overlay/zoom-prompt.d.ts.map +1 -0
  122. package/dist/types/shared/graph-context.d.ts +26 -0
  123. package/dist/types/shared/graph-context.d.ts.map +1 -0
  124. package/dist/types/shared/graph-layout/circular-layout.d.ts +32 -0
  125. package/dist/types/shared/graph-layout/circular-layout.d.ts.map +1 -0
  126. package/dist/types/shared/graph-layout/common.d.ts +96 -0
  127. package/dist/types/shared/graph-layout/common.d.ts.map +1 -0
  128. package/dist/types/shared/graph-layout/custom-layout.d.ts +36 -0
  129. package/dist/types/shared/graph-layout/custom-layout.d.ts.map +1 -0
  130. package/dist/types/shared/graph-layout/fcose-layout.d.ts +132 -0
  131. package/dist/types/shared/graph-layout/fcose-layout.d.ts.map +1 -0
  132. package/dist/types/shared/graph-layout/force-atlas-layout.d.ts +103 -0
  133. package/dist/types/shared/graph-layout/force-atlas-layout.d.ts.map +1 -0
  134. package/dist/types/shared/graph-layout/index.d.ts +25 -0
  135. package/dist/types/shared/graph-layout/index.d.ts.map +1 -0
  136. package/dist/types/shared/graph-layout/marketing-layout.d.ts +63 -0
  137. package/dist/types/shared/graph-layout/marketing-layout.d.ts.map +1 -0
  138. package/dist/types/shared/graph-layout/planar-layout.d.ts +67 -0
  139. package/dist/types/shared/graph-layout/planar-layout.d.ts.map +1 -0
  140. package/dist/types/shared/graph-layout/spring-layout.d.ts +101 -0
  141. package/dist/types/shared/graph-layout/spring-layout.d.ts.map +1 -0
  142. package/dist/types/shared/graph-layout/worker/circular.d.ts +5 -0
  143. package/dist/types/shared/graph-layout/worker/circular.d.ts.map +1 -0
  144. package/dist/types/shared/graph-layout/worker/client.d.ts +22 -0
  145. package/dist/types/shared/graph-layout/worker/client.d.ts.map +1 -0
  146. package/dist/types/shared/graph-layout/worker/fcose.d.ts +18 -0
  147. package/dist/types/shared/graph-layout/worker/fcose.d.ts.map +1 -0
  148. package/dist/types/shared/graph-layout/worker/force-atlas.d.ts +5 -0
  149. package/dist/types/shared/graph-layout/worker/force-atlas.d.ts.map +1 -0
  150. package/dist/types/shared/graph-layout/worker/marketing.d.ts +5 -0
  151. package/dist/types/shared/graph-layout/worker/marketing.d.ts.map +1 -0
  152. package/dist/types/shared/graph-layout/worker/planar.d.ts +5 -0
  153. package/dist/types/shared/graph-layout/worker/planar.d.ts.map +1 -0
  154. package/dist/types/shared/graph-layout/worker/spring.d.ts +19 -0
  155. package/dist/types/shared/graph-layout/worker/spring.d.ts.map +1 -0
  156. package/dist/types/shared/graph-layout/worker/worker.d.ts +27 -0
  157. package/dist/types/shared/graph-layout/worker/worker.d.ts.map +1 -0
  158. package/dist/types/shared/parsers.d.ts +43 -0
  159. package/dist/types/shared/parsers.d.ts.map +1 -0
  160. package/dist/types/shared/pointer-context.d.ts +20 -0
  161. package/dist/types/shared/pointer-context.d.ts.map +1 -0
  162. package/dist/types/shared/rendering/background.d.ts +48 -0
  163. package/dist/types/shared/rendering/background.d.ts.map +1 -0
  164. package/dist/types/shared/rendering/colors.d.ts +27 -0
  165. package/dist/types/shared/rendering/colors.d.ts.map +1 -0
  166. package/dist/types/shared/rendering/edge/curve.d.ts +51 -0
  167. package/dist/types/shared/rendering/edge/curve.d.ts.map +1 -0
  168. package/dist/types/shared/rendering/edge/definitions.d.ts +73 -0
  169. package/dist/types/shared/rendering/edge/definitions.d.ts.map +1 -0
  170. package/dist/types/shared/rendering/edge/edge-object.d.ts +93 -0
  171. package/dist/types/shared/rendering/edge/edge-object.d.ts.map +1 -0
  172. package/dist/types/shared/rendering/edge/index.d.ts +19 -0
  173. package/dist/types/shared/rendering/edge/index.d.ts.map +1 -0
  174. package/dist/types/shared/rendering/edge/symbols.d.ts +40 -0
  175. package/dist/types/shared/rendering/edge/symbols.d.ts.map +1 -0
  176. package/dist/types/shared/rendering/edge/utils.d.ts +27 -0
  177. package/dist/types/shared/rendering/edge/utils.d.ts.map +1 -0
  178. package/dist/types/shared/rendering/engine.d.ts +436 -0
  179. package/dist/types/shared/rendering/engine.d.ts.map +1 -0
  180. package/dist/types/shared/rendering/grouping/group-container-object.d.ts +56 -0
  181. package/dist/types/shared/rendering/grouping/group-container-object.d.ts.map +1 -0
  182. package/dist/types/shared/rendering/grouping/index.d.ts +2 -0
  183. package/dist/types/shared/rendering/grouping/index.d.ts.map +1 -0
  184. package/dist/types/shared/rendering/node/definitions.d.ts +59 -0
  185. package/dist/types/shared/rendering/node/definitions.d.ts.map +1 -0
  186. package/dist/types/shared/rendering/node/index.d.ts +20 -0
  187. package/dist/types/shared/rendering/node/index.d.ts.map +1 -0
  188. package/dist/types/shared/rendering/node/node-object.d.ts +78 -0
  189. package/dist/types/shared/rendering/node/node-object.d.ts.map +1 -0
  190. package/dist/types/shared/rendering/node/utils.d.ts +33 -0
  191. package/dist/types/shared/rendering/node/utils.d.ts.map +1 -0
  192. package/dist/types/shared/rendering/svg.d.ts +26 -0
  193. package/dist/types/shared/rendering/svg.d.ts.map +1 -0
  194. package/dist/types/shared/rendering/text.d.ts +33 -0
  195. package/dist/types/shared/rendering/text.d.ts.map +1 -0
  196. package/dist/types/shared/rendering/texture-cache.d.ts +47 -0
  197. package/dist/types/shared/rendering/texture-cache.d.ts.map +1 -0
  198. package/dist/types/shared/rendering/use-render-engine.d.ts +115 -0
  199. package/dist/types/shared/rendering/use-render-engine.d.ts.map +1 -0
  200. package/dist/types/shared/rendering/utils.d.ts +27 -0
  201. package/dist/types/shared/rendering/utils.d.ts.map +1 -0
  202. package/dist/types/shared/serializer.d.ts +39 -0
  203. package/dist/types/shared/serializer.d.ts.map +1 -0
  204. package/dist/types/shared/settings-context.d.ts +56 -0
  205. package/dist/types/shared/settings-context.d.ts.map +1 -0
  206. package/dist/types/shared/styles.d.ts +4 -0
  207. package/dist/types/shared/styles.d.ts.map +1 -0
  208. package/dist/types/shared/use-causal-graph-editor.d.ts +22 -0
  209. package/dist/types/shared/use-causal-graph-editor.d.ts.map +1 -0
  210. package/dist/types/shared/use-drag-mode.d.ts +33 -0
  211. package/dist/types/shared/use-drag-mode.d.ts.map +1 -0
  212. package/dist/types/shared/use-edge-encoder.d.ts +45 -0
  213. package/dist/types/shared/use-edge-encoder.d.ts.map +1 -0
  214. package/dist/types/shared/use-graph-tooltip.d.ts +15 -0
  215. package/dist/types/shared/use-graph-tooltip.d.ts.map +1 -0
  216. package/dist/types/shared/use-pane-visibility.d.ts +12 -0
  217. package/dist/types/shared/use-pane-visibility.d.ts.map +1 -0
  218. package/dist/types/shared/utils.d.ts +79 -0
  219. package/dist/types/shared/utils.d.ts.map +1 -0
  220. package/dist/types/types.d.ts +277 -0
  221. package/dist/types/types.d.ts.map +1 -0
  222. package/dist/webworkerAll.2e3715a5.js +7 -0
  223. package/package.json +120 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-object.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/node/node-object.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAA0B,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAU9D;;GAEG;AACH,qBAAa,UAAW,SAAQ,YAAY,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IACvE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;IAExB,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;IAE7B;;OAEG;IACH,KAAK,EAAE,SAAS,CAKd;;IAQF;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAwClB;;OAEG;IACH,OAAO,CAAC,eAAe;IAoBvB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IAqF3G;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACvB,YAAY,EAAE,IAAI,CAAC,SAAS,EAC5B,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,YAAY,GAC3B,IAAI;IAmCP;;;;;OAKG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAQlG;;;;;OAKG;IACH,MAAM,CAAC,yBAAyB,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAK1F;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI;IAK9C;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IAWvE;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;CAI/C"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { DefaultTheme } from '@darajs/styled-components';
18
+ import type { PixiNodeStyle } from './definitions';
19
+ /**
20
+ * Get node color based on its category
21
+ *
22
+ * @param category node category
23
+ * @param theme current theme colors
24
+ */
25
+ export declare function getNodeColor(category: PixiNodeStyle['category'], theme: DefaultTheme): [bg: string, font: string];
26
+ /**
27
+ * Get node size based on configured size and category
28
+ *
29
+ * @param size configured node size
30
+ * @param group group node is in
31
+ */
32
+ export declare function getNodeSize(size: number, category: PixiNodeStyle['category']): number;
33
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/node/utils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CASjH;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,MAAM,CAIrF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { Graphics } from 'pixi.js';
18
+ export declare const QUESTION_MARK = "M5.46163 12.2353C4.4028 12.2353 3.57927 13.0588 3.57927 14.1176C3.57927 15.1765 4.34986 16 5.46163 16C6.46751 16 7.34398 15.1765 7.34398 14.1176C7.34398 13.0588 6.46751 12.2353 5.46163 12.2353ZM7.40869 0H4.4028C2.10869 0 0.285156 1.82353 0.285156 4.11765C0.285156 4.88235 0.932215 5.52941 1.69692 5.52941C2.46163 5.52941 3.10869 4.88235 3.10869 4.11765C3.10869 3.41176 3.64398 2.82353 4.34986 2.82353H7.35575C8.11457 2.82353 8.75575 3.41176 8.75575 4.11765C8.75575 4.58824 8.52045 4.94706 8.10869 5.18235L4.75575 7.23529C4.28516 7.52941 4.04986 8 4.04986 8.47059V9.41176C4.04986 10.1765 4.69692 10.8235 5.46163 10.8235C6.22633 10.8235 6.87339 10.1765 6.87339 9.41176V9.29412L9.52633 7.64706C10.7616 6.88235 11.5263 5.52941 11.5263 4.11765C11.5793 1.82353 9.75575 0 7.40869 0Z";
19
+ /**
20
+ * Draw a given SVG path using given Graphics object
21
+ *
22
+ * @param d SVG path `d` attribute
23
+ * @param gfx graphics object
24
+ */
25
+ export declare function drawPath(d: string, gfx: Graphics): void;
26
+ //# sourceMappingURL=svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/svg.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,eAAO,MAAM,aAAa,4wBACmvB,CAAC;AAE9wB;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAyCvD"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as PIXI from 'pixi.js';
18
+ export declare const FONT_FAMILY = "Manrope";
19
+ /**
20
+ * Get default text style to display in nodes
21
+ *
22
+ * @param size text size
23
+ */
24
+ export declare function getTextStyle(size: number): PIXI.TextStyle;
25
+ /**
26
+ * Trim given text to fit within maximum size
27
+ *
28
+ * @param text text to fit
29
+ * @param maxSize max vertical and horizontal size
30
+ * @param textStyle pixi text style
31
+ */
32
+ export declare function trimToFit(text: string, maxSize: number, textStyle: PIXI.TextStyle): string;
33
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/text.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,SAAS,CAWzD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,MAAM,CAoF1F"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { Container, Renderer, Texture } from 'pixi.js';
18
+ /**
19
+ * Utility cache to create and store textures
20
+ */
21
+ export declare class TextureCache {
22
+ renderer: Renderer;
23
+ private textures;
24
+ constructor(renderer: Renderer);
25
+ /**
26
+ * Get a texture for a given cache key or create a default one
27
+ *
28
+ * @param key unique key to identify the texture
29
+ * @param defaultCallback callback to create a new texture if one doesn't exist
30
+ */
31
+ get(key: string, defaultCallback: () => Container, padding?: number): Texture;
32
+ /**
33
+ * Delete texture for given cache key
34
+ *
35
+ * @param key cache key to delete texture for
36
+ */
37
+ delete(key: string): void;
38
+ /**
39
+ * Clear out all stored textures
40
+ */
41
+ clear(): void;
42
+ /**
43
+ * Destroy the texture cache
44
+ */
45
+ destroy(): void;
46
+ }
47
+ //# sourceMappingURL=texture-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texture-cache.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/texture-cache.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG5D;;GAEG;AACH,qBAAa,YAAY;IACrB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,OAAO,CAAC,QAAQ,CAA8B;gBAElC,QAAQ,EAAE,QAAQ;IAI9B;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,EAAE,OAAO,SAAI,GAAG,OAAO;IAwBxE;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAUzB;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,OAAO,IAAI,IAAI;CAGlB"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type * as PIXI from 'pixi.js';
18
+ import * as React from 'react';
19
+ import type { NotificationPayload } from '@darajs/ui-notifications';
20
+ import type { EdgeConstraint, EditorMode, SimulationEdge, SimulationGraph, ZoomThresholds } from '../../types';
21
+ import type { GraphLayout } from '../graph-layout';
22
+ import type { DragMode } from '../use-drag-mode';
23
+ import type { PixiEdgeStyle } from './edge';
24
+ import type { EngineEvents } from './engine';
25
+ interface UseRenderEngineApi {
26
+ /**
27
+ * Get current center position of the viewport
28
+ */
29
+ getCenterPosition: () => PIXI.PointData;
30
+ /**
31
+ * Should be called whenever an edge selection should change
32
+ *
33
+ * @param path selected edge
34
+ */
35
+ onEdgeSelected: (path: [string, string]) => void;
36
+ /**
37
+ * Should be called whenever node selection should change
38
+ *
39
+ * @param node selected node
40
+ */
41
+ onNodeSelected: (node: string) => void;
42
+ /**
43
+ * Should be called wheneve search results change
44
+ *
45
+ * @param nodes found nodes
46
+ */
47
+ onSearchResults: (nodes: string[]) => void;
48
+ /**
49
+ * Should be called whenever drag mode changes
50
+ *
51
+ * @param dragMode new drag mode
52
+ */
53
+ onSetDragMode: (dragMode: DragMode | null) => void;
54
+ /**
55
+ * Notify the engine about whether the canvas has focus
56
+ */
57
+ onSetFocus: (isFocused: boolean) => void;
58
+ /**
59
+ * Should be called whenever available constraints change
60
+ *
61
+ * @param constraints new set of constraints
62
+ */
63
+ onUpdateConstraints: (constraints: EdgeConstraint[]) => void;
64
+ /**
65
+ * Recompute the layout
66
+ */
67
+ resetLayout: () => void;
68
+ /**
69
+ * Reset the viewport - reset zoom and center
70
+ */
71
+ resetViewport: () => void;
72
+ /**
73
+ * Collapses all groups
74
+ */
75
+ collapseGroups: () => void;
76
+ /**
77
+ * Expand all groups
78
+ */
79
+ expandGroups: () => void;
80
+ /**
81
+ * Get current canvas state as an image
82
+ */
83
+ extractImage: () => Promise<string | undefined>;
84
+ /**
85
+ * Register a handler for a given engine event.
86
+ *
87
+ * @param eventName name of event to respond to
88
+ * @param handler callback to execute whenever the event is fired
89
+ */
90
+ useEngineEvent: <T extends keyof EngineEvents>(eventName: T, handler: EngineEvents[T]) => void;
91
+ }
92
+ /**
93
+ * Use a PIXI graph rendering engine.
94
+ *
95
+ * @param parentRef ref to container where canvas will be injected
96
+ * @param graph graph instance
97
+ * @param layout graph layout
98
+ * @param editorMode current editor mode
99
+ * @param constraints initial edge constraints
100
+ * @param zoomThresholds zoom thresholds
101
+ */
102
+ export declare function useRenderEngine({ parentRef, graph, layout, editable, editorMode, constraints, errorHandler, processEdgeStyle, zoomThresholds, requireFocusToZoom, }: {
103
+ constraints?: EdgeConstraint[];
104
+ editable: boolean;
105
+ editorMode: EditorMode;
106
+ errorHandler?: (error: NotificationPayload) => void;
107
+ graph: SimulationGraph;
108
+ layout: GraphLayout;
109
+ parentRef: React.MutableRefObject<HTMLElement>;
110
+ processEdgeStyle?: (edge: PixiEdgeStyle, attributes: SimulationEdge) => PixiEdgeStyle;
111
+ requireFocusToZoom?: boolean;
112
+ zoomThresholds?: ZoomThresholds;
113
+ }): UseRenderEngineApi;
114
+ export {};
115
+ //# sourceMappingURL=use-render-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-render-engine.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/use-render-engine.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,UAAU,kBAAkB;IACxB;;OAEG;IACH,iBAAiB,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC;IACxC;;;;OAIG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACjD;;;;OAIG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,UAAU,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD;;;;;OAKG;IACH,cAAc,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAClG;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACrB,EAAE;IACC,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACpD,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC/C,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,KAAK,aAAa,CAAC;IACtF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC,GAAG,kBAAkB,CAiHrB"}
@@ -0,0 +1,27 @@
1
+ import type { ZoomState, ZoomThresholds } from '../../types';
2
+ import type { GraphLayout, GraphLayoutWithGrouping, GraphLayoutWithTiers } from '../graph-layout/common';
3
+ export declare const MOUSE_EVENTS: readonly ["mousemove", "mouseover", "mouseout", "mousedown", "mouseup"];
4
+ /**
5
+ * Parse a given CSS color definition to a format understood by PIXI.
6
+ *
7
+ * Memoized for performance
8
+ *
9
+ * @param color string color definition
10
+ */
11
+ export declare function colorToPixi(color: string): [hex: number, alpha: number];
12
+ /**
13
+ * Create a unique key based on given set of params
14
+ *
15
+ * @param params parameters to use
16
+ */
17
+ export declare function createKey(...params: Array<string | number | boolean>): string;
18
+ /**
19
+ * Get current zoom state based on current scale
20
+ *
21
+ * @param scale current zoom scale
22
+ * @param zoomThresholds custom zoom thresholds to use, if not provided, default thresholds are used
23
+ */
24
+ export declare function getZoomState(scale: number, zoomThresholds?: ZoomThresholds): ZoomState;
25
+ export declare function isGraphLayoutWithTiers(layout: GraphLayout): layout is GraphLayoutWithTiers;
26
+ export declare function isGraphLayoutWithGroups(layout: GraphLayout): layout is GraphLayoutWithGrouping;
27
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/utils.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEzG,eAAO,MAAM,YAAY,yEAA0E,CAAC;AAIpG;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CASvE;AAID;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,MAAM,CAE7E;AASD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAQtF;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,IAAI,oBAAoB,CAE1F;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,IAAI,uBAAuB,CAE9F"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { CausalGraph, CausalGraphEdge, CausalGraphNode, GraphState, SimulationEdge, SimulationNode } from '../types';
18
+ /**
19
+ * Serialize a simulation edge into a causal graph edge
20
+ *
21
+ * @param attributes simulation edge data
22
+ * @param source optional source to include in output data
23
+ * @param destination optional destination to include in output data
24
+ */
25
+ export declare function serializeGraphEdge(attributes: SimulationEdge, source: CausalGraphNode, destination: CausalGraphNode): CausalGraphEdge;
26
+ /**
27
+ * Serialize a simulation node into a causal graph node
28
+ *
29
+ * @param attributes simulation node data
30
+ * @param includeIdentifier whether to include data to identify the node
31
+ */
32
+ export declare function serializeGraphNode(attributes: SimulationNode): CausalGraphNode;
33
+ /**
34
+ * Serialize internal graph representation into a CausalGraph
35
+ *
36
+ * @param graph internal graph representation
37
+ */
38
+ export declare function causalGraphSerializer(state: GraphState): CausalGraph;
39
+ //# sourceMappingURL=serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/shared/serializer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EACR,WAAW,EACX,eAAe,EACf,eAAe,EAIf,UAAU,EAEV,cAAc,EACd,cAAc,EACjB,MAAM,UAAU,CAAC;AAiBlB;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,eAAe,EACvB,WAAW,EAAE,eAAe,GAC7B,eAAe,CAuCjB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,eAAe,CAwB9E;AAMD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CA8DpE"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as React from 'react';
18
+ import type { NotificationPayload } from '@darajs/ui-notifications';
19
+ import type { EditorMode } from '../types';
20
+ /**
21
+ * Common graph settings used inside graph sub-components
22
+ */
23
+ export interface Settings {
24
+ /** Whether node dragging is enabled */
25
+ allowNodeDrag?: boolean;
26
+ /** Whether to show the details panel when the graph is not editable */
27
+ allowSelectionWhenNotEditable?: boolean;
28
+ /** Flag for disabling edge addition */
29
+ disableEdgeAdd?: boolean;
30
+ /** Flag for disabling latent node addition */
31
+ disableLatentNodeAdd?: boolean;
32
+ /** Flag for disabling node removal */
33
+ disableNodeRemoval?: boolean;
34
+ /** Allow editing */
35
+ editable?: boolean;
36
+ /** Mode the graph viewer should operate in */
37
+ editorMode?: EditorMode;
38
+ /** On notify handler to show a notification */
39
+ onNotify?: (payload: NotificationPayload) => void | Promise<void>;
40
+ /** Whether to show verbose descriptions in the editor frame */
41
+ verboseDescriptions?: boolean;
42
+ }
43
+ interface SettingsProviderProps {
44
+ children: React.ReactNode;
45
+ settings: Settings;
46
+ }
47
+ /**
48
+ * Wrapper around SettingsContext which requires settings to be set
49
+ */
50
+ export declare function SettingsProvider({ children, settings }: SettingsProviderProps): JSX.Element;
51
+ /**
52
+ * Helper hook that pulls in Settings from the SettingsContext
53
+ */
54
+ export declare function useSettings(): Settings;
55
+ export {};
56
+ //# sourceMappingURL=settings-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-context.d.ts","sourceRoot":"","sources":["../../../src/shared/settings-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,uCAAuC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8CAA8C;IAC9C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sCAAsC;IACtC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,+DAA+D;IAC/D,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAID,UAAU,qBAAqB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAE3F;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAQtC"}
@@ -0,0 +1,4 @@
1
+ export declare const Wrapper: import("styled-components").StyledComponent<"div", import("@darajs/styled-components").DefaultTheme, {}, never>;
2
+ export declare const Center: import("styled-components").StyledComponent<"div", import("@darajs/styled-components").DefaultTheme, {}, never>;
3
+ export declare const Graph: import("styled-components").StyledComponent<"div", import("@darajs/styled-components").DefaultTheme, {}, never>;
4
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/shared/styles.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,OAAO,iHAOnB,CAAC;AAEF,eAAO,MAAM,MAAM,iHAMlB,CAAC;AAEF,eAAO,MAAM,KAAK,iHAejB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { CausalGraph, GraphState } from '../types';
2
+ import { EditorMode } from '../types';
3
+ import { GraphActionCreators } from './causal-graph-store';
4
+ import type { GraphLayout } from './graph-layout';
5
+ export interface UseCausalGraphEditorApi {
6
+ api: GraphApi;
7
+ layout: GraphLayout;
8
+ state: GraphState;
9
+ }
10
+ type ActionName = keyof typeof GraphActionCreators;
11
+ /**
12
+ * Graph API object containing all available methods to modify the graph
13
+ */
14
+ export type GraphApi = {
15
+ [k in ActionName]: (...args: Parameters<(typeof GraphActionCreators)[k]>) => void;
16
+ };
17
+ /**
18
+ * A helper hook to inject causal graph editor API for given initial graphdata
19
+ */
20
+ export default function useCausalGraphEditor(graphData: CausalGraph, editorMode: EditorMode, graphLayout: GraphLayout, availableInputs?: string[]): UseCausalGraphEditorApi;
21
+ export {};
22
+ //# sourceMappingURL=use-causal-graph-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-causal-graph-editor.d.ts","sourceRoot":"","sources":["../../../src/shared/use-causal-graph-editor.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAiC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,QAAQ,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;CACrB;AAED,KAAK,UAAU,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAGnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;KAClB,CAAC,IAAI,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CACpF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CACxC,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,eAAe,CAAC,EAAE,MAAM,EAAE,GAC3B,uBAAuB,CAgFzB"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright 2023 Impulse Innovations Limited
3
+ *
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type React from 'react';
18
+ export type DragMode = 'create_edge' | 'move_node';
19
+ /**
20
+ * Helper hook controlling switching and enabling drag mode
21
+ *
22
+ * @param editMode whether app is in edit mode
23
+ * @param allowEdgeAdd whether to allow adding edges
24
+ * @param allowNodeDrag whether to allow node dragging
25
+ * @param onDragModeChange callback to execute whenever drag mode changes
26
+ */
27
+ declare function useDragMode(editMode: boolean, allowEdgeAdd: boolean, allowNodeDrag: boolean, onDragModeChange: (dragMode: DragMode | null) => void): {
28
+ dragEnabled: boolean;
29
+ dragMode: DragMode;
30
+ setDragMode: React.Dispatch<React.SetStateAction<DragMode>>;
31
+ };
32
+ export default useDragMode;
33
+ //# sourceMappingURL=use-drag-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-drag-mode.d.ts","sourceRoot":"","sources":["../../../src/shared/use-drag-mode.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC;AAEnD;;;;;;;GAOG;AACH,iBAAS,WAAW,CAChB,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,OAAO,EACtB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,GACtD;IAAE,WAAW,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAA;CAAE,CAuD3G;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { EdgeConstraint, EdgeConstraintItem } from '../types';
2
+ /**
3
+ * Parse edge constraints into internal representation
4
+ *
5
+ * @param constraints edge constraints to parse
6
+ */
7
+ export declare function parseConstraints(constraints: EdgeConstraint[]): EdgeConstraintItem[];
8
+ /**
9
+ * Parse internal edge constraint items to external representation
10
+ *
11
+ * @param constraintItems edge constraint items to parse
12
+ */
13
+ export declare function parseConstraintItems(constraintItems: EdgeConstraintItem[]): EdgeConstraint[];
14
+ interface EdgeConstraintEncoderApi {
15
+ /**
16
+ * Add a new constraint
17
+ */
18
+ addConstraint: (source?: string, target?: string) => void;
19
+ /**
20
+ * Current constraints
21
+ */
22
+ constraints: EdgeConstraintItem[];
23
+ /**
24
+ * Remove a constraint with the given id
25
+ */
26
+ removeConstraint: (id: string) => void;
27
+ /**
28
+ * Reverse a given constraint - switch source and target
29
+ */
30
+ reverseConstraint: (edgeConstraint: EdgeConstraintItem) => void;
31
+ /**
32
+ * Update given constraint
33
+ */
34
+ updateConstraint: (edgeConstraint: EdgeConstraintItem) => void;
35
+ }
36
+ /**
37
+ * Hook exposing common logic to manage edge constraints
38
+ * Can be re-used with different frontends to maintain the same functionality
39
+ *
40
+ * @param initialConstraints Initial constraints to show
41
+ * @param onUpdate Handler called whenever constraints are updated
42
+ */
43
+ export declare function useEdgeConstraintEncoder(initialConstraints: EdgeConstraint[], onUpdate?: (constraints: EdgeConstraint[]) => void | Promise<void>): EdgeConstraintEncoderApi;
44
+ export {};
45
+ //# sourceMappingURL=use-edge-encoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-edge-encoder.d.ts","sourceRoot":"","sources":["../../../src/shared/use-edge-encoder.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,kBAAkB,EAAE,CA0BpF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,GAAG,cAAc,EAAE,CAK5F;AAED,UAAU,wBAAwB;IAC9B;;OAEG;IACH,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D;;OAEG;IACH,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC;;OAEG;IACH,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,iBAAiB,EAAE,CAAC,cAAc,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAChE;;OAEG;IACH,gBAAgB,EAAE,CAAC,cAAc,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAClE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACpC,kBAAkB,EAAE,cAAc,EAAE,EACpC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACnE,wBAAwB,CAmD1B"}
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import type { GetReferenceClientRect } from 'tippy.js';
3
+ /**
4
+ * Helper hook to manage a tooltip for the graph pane
5
+ *
6
+ * Handles showing and hiding the tooltip based on the visibility of the pane
7
+ *
8
+ * @param pane - pane to observe visibility of
9
+ * @param tooltipRef - ref to the tooltip position
10
+ */
11
+ export default function useGraphTooltip(pane: React.RefObject<HTMLElement>, tooltipRef: React.MutableRefObject<GetReferenceClientRect>): {
12
+ setTooltipContent: (content: React.ReactNode) => void;
13
+ tooltipContent: React.ReactNode;
14
+ };
15
+ //# sourceMappingURL=use-graph-tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-graph-tooltip.d.ts","sourceRoot":"","sources":["../../../src/shared/use-graph-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIvD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACnC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAClC,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,GAC3D;IACC,iBAAiB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACtD,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC,CA0DA"}
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Hook to observe the visibility of a pane. Accepts a callback to call when the visibility changes,
4
+ * and returns a function to check whether a given domRect is visible within the pane.
5
+ *
6
+ * @param pane - pane to observe visibility of
7
+ * @param onVisibilityChange - callback to call when visibility changes
8
+ */
9
+ export default function usePaneVisibility(pane: React.RefObject<HTMLElement>, onVisibilityChange: (isVisible: boolean) => void): {
10
+ isRectVisible: (domRect: DOMRect) => Promise<boolean>;
11
+ };
12
+ //# sourceMappingURL=use-pane-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-pane-visibility.d.ts","sourceRoot":"","sources":["../../../src/shared/use-pane-visibility.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACrC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAClC,kBAAkB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GACjD;IAAE,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAmF3D"}