@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,27 @@
1
+ import type { LayoutMapping, XYPosition } from 'graphology-layout/utils';
2
+ import type { SerializedGraph } from 'graphology-types';
3
+ import type { SimulationAttributes, SimulationEdge, SimulationNode } from '../../../types';
4
+ import type { BaseLayoutParams, LayoutComputationCallbacks, SerializableLayoutComputationResult } from '../common';
5
+ /**
6
+ * Compute the layout for the given graph using the provided layout parameters.
7
+ *
8
+ * @param layoutParams layout parameters
9
+ * @param serializedGraph the graph to apply the layout to, in its serialized form created by graphology
10
+ * @param forceUpdate callback to update the layout, is a proxy to the main thread
11
+ */
12
+ export declare function applyLayout<TParams extends BaseLayoutParams>(layoutParams: TParams, serializedGraph: SerializedGraph<SimulationNode, SimulationEdge, SimulationAttributes>, forceUpdate?: (layout: LayoutMapping<XYPosition>, edgePoints?: LayoutMapping<XYPosition[]>) => void): Promise<SerializableLayoutComputationResult>;
13
+ /**
14
+ * Invoke a callback registered by the layout computation.
15
+ *
16
+ * @param cbName name of the callback to invoke
17
+ * @param args arguments to pass to the callback
18
+ */
19
+ export declare function invokeCallback<CbName extends keyof LayoutComputationCallbacks>(cbName: CbName, ...args: Parameters<LayoutComputationCallbacks[CbName]>): Promise<void>;
20
+ /**
21
+ * Public API exposed from the worker
22
+ */
23
+ export declare const workerApi: {
24
+ readonly applyLayout: typeof applyLayout;
25
+ readonly invokeCallback: typeof invokeCallback;
26
+ };
27
+ //# sourceMappingURL=worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../../../src/shared/graph-layout/worker/worker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEnF,OAAO,KAAK,EACR,gBAAgB,EAChB,0BAA0B,EAE1B,mCAAmC,EACtC,MAAM,WAAW,CAAC;AA8BnB;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,OAAO,SAAS,gBAAgB,EAC9D,YAAY,EAAE,OAAO,EACrB,eAAe,EAAE,eAAe,CAAC,cAAc,EAAE,cAAc,EAAE,oBAAoB,CAAC,EACtF,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,GACpG,OAAO,CAAC,mCAAmC,CAAC,CA6B9C;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,MAAM,SAAS,MAAM,0BAA0B,EAChF,MAAM,EAAE,MAAM,EACd,GAAG,IAAI,EAAE,UAAU,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,GACxD,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { LayoutMapping, XYPosition } from 'graphology-layout/utils';
2
+ import type { CausalGraph, CausalGraphEdge, CausalGraphNode, D3SimulationEdge, SimulationEdge, SimulationGraph, SimulationNode, SimulationNodeWithCategory } from '../types';
3
+ /**
4
+ * Get graph edges in d3 expected format
5
+ *
6
+ * @param graph graph to get edges from
7
+ */
8
+ export declare function getD3Data(graph: SimulationGraph): [edges: D3SimulationEdge[], nodes: SimulationNodeWithCategory[]];
9
+ /**
10
+ * Format node data in a layoutmapping format
11
+ *
12
+ * @param nodes
13
+ */
14
+ export declare function nodesToLayout(nodes: SimulationNode[]): LayoutMapping<XYPosition>;
15
+ /**
16
+ * Parse a causal graph node into a simulation node
17
+ *
18
+ * @param nodeKey node id
19
+ * @param nodeData node data
20
+ * @param data whole graph data
21
+ * @param availableInputs optional list of input nodes
22
+ */
23
+ export declare function parseGraphNode(nodeKey: string, nodeData: CausalGraphNode, data: CausalGraph, availableInputs?: string[]): SimulationNode;
24
+ /**
25
+ * Parse a causal graph edge into simulation edge
26
+ *
27
+ * @param edgeData edge data
28
+ */
29
+ export declare function parseGraphEdge(edgeData: CausalGraphEdge): SimulationEdge;
30
+ /**
31
+ * Function which receives a list of nodes and adds property for those that share a variable_name
32
+ *
33
+ * @param graph Simulation graph
34
+ */
35
+ export declare function updateNodesForTimeSeries(graph: SimulationGraph): void;
36
+ /**
37
+ * Parses CausalGraph structure into a SimulationGraph representation
38
+ *
39
+ * @param data input CausalGraph structure
40
+ * @param availableInputs names of input nodes
41
+ */
42
+ export declare function causalGraphParser(data: CausalGraph, availableInputs?: string[], initialGraph?: SimulationGraph): SimulationGraph;
43
+ //# sourceMappingURL=parsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../src/shared/parsers.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIzE,OAAO,KAAK,EACR,WAAW,EACX,eAAe,EACf,eAAe,EACf,gBAAgB,EAIhB,cAAc,EACd,eAAe,EACf,cAAc,EACd,0BAA0B,EAC7B,MAAM,UAAU,CAAC;AAGlB;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAqBlH;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,UAAU,CAAC,CAShF;AAaD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,WAAW,EACjB,eAAe,CAAC,EAAE,MAAM,EAAE,GAC3B,cAAc,CAoChB;AAaD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,cAAc,CAoBxE;AAiBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAwBrE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,WAAW,EACjB,eAAe,CAAC,EAAE,MAAM,EAAE,EAC1B,YAAY,CAAC,EAAE,eAAe,GAC/B,eAAe,CAgFjB"}
@@ -0,0 +1,20 @@
1
+ interface PointerContext {
2
+ /**
3
+ * Whether to disable pointer events on the panels
4
+ */
5
+ disablePointerEvents: boolean;
6
+ /**
7
+ * Handler for when a panel is hovered over
8
+ */
9
+ onPanelEnter: () => void;
10
+ /**
11
+ * Handler for when a panel is no longer hovered over
12
+ */
13
+ onPanelExit: () => void;
14
+ }
15
+ /**
16
+ * Context for handling interactions between the editor overlay and the editor canvas
17
+ */
18
+ declare const pointerCtx: import("react").Context<PointerContext>;
19
+ export default pointerCtx;
20
+ //# sourceMappingURL=pointer-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointer-context.d.ts","sourceRoot":"","sources":["../../../src/shared/pointer-context.tsx"],"names":[],"mappings":"AAkBA,UAAU,cAAc;IACpB;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,QAAA,MAAM,UAAU,yCAAsC,CAAC;AAEvD,eAAe,UAAU,CAAC"}
@@ -0,0 +1,48 @@
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 { Viewport } from 'pixi-viewport';
18
+ import * as PIXI from 'pixi.js';
19
+ import type { DefaultTheme } from '@darajs/styled-components';
20
+ import type { TextureCache } from './texture-cache';
21
+ export declare class Background extends PIXI.EventEmitter<'click'> {
22
+ sprite: PIXI.TilingSprite;
23
+ constructor(theme: DefaultTheme, textureCache: TextureCache, viewport: Viewport);
24
+ /**
25
+ * Setup the listeners for the background clicks.
26
+ *
27
+ * The listener is set on the viewport itself as the background is behind
28
+ * the viewport so it does not receive clicks itself.
29
+ *
30
+ * @param viewport viewport to listen to
31
+ */
32
+ private setupListeners;
33
+ private createGfx;
34
+ /**
35
+ * Update the size of the background to fit container
36
+ *
37
+ * @param container
38
+ */
39
+ updatePosition(container: HTMLElement): void;
40
+ /**
41
+ * Update the texture of the sprite based on the theme
42
+ *
43
+ * @param theme theme to get bg color from
44
+ * @param textureCache texture cache to get texture from
45
+ */
46
+ updateTexture(theme: DefaultTheme, textureCache: TextureCache): void;
47
+ }
48
+ //# sourceMappingURL=background.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/background.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,qBAAa,UAAW,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;IAC/C,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC;gBAErB,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ;IAW/E;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,SAAS;IAoBjB;;;;OAIG;IACI,cAAc,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI;IAOnD;;;;;OAKG;IACI,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CAI9E"}
@@ -0,0 +1,27 @@
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
+ interface Shadows {
19
+ shadowHover: string;
20
+ shadowNormal: string;
21
+ }
22
+ /**
23
+ * Shadow colors for the graph UI
24
+ */
25
+ export declare const SHADOWS: Record<DefaultTheme['themeType'], Shadows>;
26
+ export {};
27
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/shared/rendering/colors.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,UAAU,OAAO;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,OAAO,CAS9D,CAAC"}
@@ -0,0 +1,51 @@
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
+ /**
19
+ * Get points on a curve to draw a smooth curve.
20
+ *
21
+ * Utilise Cubic Hermite cardinal splines. Adapted from https://stackoverflow.com/a/15528789
22
+ *
23
+ * @param points points the curve should go through
24
+ * @param tension tension of the curve
25
+ * @param numOfSegments number of segments to use per point
26
+ */
27
+ export declare function getCurvePoints(points: PIXI.PointData[], tension?: number, numOfSegments?: number): PIXI.PointData[];
28
+ /**
29
+ * Get points on a polygon encapsulating the given curve from two sides, parallel to the curve.
30
+ *
31
+ * We do this by computing points offset from the curve by the given distance.
32
+ * Each point is the middle of the line between two consecutive points on the curve,
33
+ * and is offset by the given distance from the curve at the angle perpendicular to the curve.
34
+ *
35
+ * @param curve curve points
36
+ * @param distance distance between the curve and the polygon
37
+ */
38
+ export declare function getPolygonFromCurve(curve: PIXI.PointData[], distance?: number): PIXI.PointData[];
39
+ /**
40
+ * Compute positions of X circles along a curve.
41
+ *
42
+ * The first circle is offset by `offset`.
43
+ * The circles are evenly spaced along the curve by `distanceBetweenCircles`
44
+ *
45
+ * @param curvePoints points on the curve
46
+ * @param numCircles number of circles to draw
47
+ * @param distanceBetweenCircles distance between each circle
48
+ * @param offset offset of the first circle
49
+ */
50
+ export declare function getCirclesAlongCurve(curvePoints: PIXI.PointData[], numCircles: number, distanceBetweenCircles: number, offset: number): PIXI.PointData[];
51
+ //# sourceMappingURL=curve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/edge/curve.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AAYrC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,OAAO,SAAM,EAAE,aAAa,SAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CA+C5G;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,QAAQ,SAAI,GAAG,IAAI,CAAC,SAAS,EAAE,CAiC3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAChC,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,sBAAsB,EAAE,MAAM,EAC9B,MAAM,EAAE,MAAM,GACf,IAAI,CAAC,SAAS,EAAE,CA8BlB"}
@@ -0,0 +1,73 @@
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 type { DefaultTheme } from '@darajs/styled-components';
19
+ import type { EdgeConstraint, EdgeType, EditorMode } from '../../../types';
20
+ export interface PixiEdgeStyle {
21
+ /** Whether edge is accepted by domain expert */
22
+ accepted?: boolean;
23
+ /** Optional color override */
24
+ color?: string;
25
+ /** Constraint attached to the edge, used in EdgeEncoder mode */
26
+ constraint?: EdgeConstraint;
27
+ /** Current editor mode */
28
+ editorMode: EditorMode;
29
+ /** Whether edge is forced by domain knowledge */
30
+ forced?: boolean;
31
+ /** Whether there is an edge currently selected */
32
+ isEdgeSelected: boolean;
33
+ /** Edge points; if provided, edge will be drawn as a curve along the points */
34
+ points?: Array<PIXI.PointData>;
35
+ /** Current edge state */
36
+ state: EdgeState;
37
+ /** Strength definition to be used if provided */
38
+ strength?: EdgeStrengthDefinition;
39
+ /** The number of collapsed edges at either end of the edge */
40
+ collapsedEdgesCount?: number;
41
+ /** Current theme object */
42
+ theme: DefaultTheme;
43
+ /** Optional thickness override */
44
+ thickness?: number;
45
+ /** Edge type */
46
+ type: EdgeType;
47
+ }
48
+ /**
49
+ * Current edge state
50
+ */
51
+ export interface EdgeState {
52
+ hover: boolean;
53
+ selected: boolean;
54
+ }
55
+ export interface EdgeStrengthDefinition {
56
+ /**
57
+ * Number of dots to show
58
+ */
59
+ dots: 0 | 1 | 2 | 3 | 4;
60
+ /**
61
+ * Opacity 0-1
62
+ */
63
+ opacity: number;
64
+ /**
65
+ * Edge thickness
66
+ */
67
+ thickness: 2 | 3 | 4;
68
+ }
69
+ /**
70
+ * Define strength visuals based on bins
71
+ */
72
+ export declare const EDGE_STRENGTHS: Array<EdgeStrengthDefinition>;
73
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/edge/definitions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3E,MAAM,WAAW,aAAa;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,0BAA0B;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,iDAAiD;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,cAAc,EAAE,OAAO,CAAC;IACxB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,yBAAyB;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,8DAA8D;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,IAAI,EAAE,QAAQ,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,sBAAsB,CA0BxD,CAAC"}
@@ -0,0 +1,93 @@
1
+ import type { Viewport } from 'pixi-viewport';
2
+ import * as PIXI from 'pixi.js';
3
+ import type { ZoomState } from '../../../types';
4
+ import type { TextureCache } from '../texture-cache';
5
+ import { MOUSE_EVENTS } from '../utils';
6
+ import type { EdgeState, PixiEdgeStyle } from './definitions';
7
+ export declare class EdgeObject extends PIXI.EventEmitter<(typeof MOUSE_EVENTS)[number]> {
8
+ edgeGfx: PIXI.Container;
9
+ edgeSymbolsGfx: PIXI.Container;
10
+ /**
11
+ * Current edge state
12
+ */
13
+ state: EdgeState;
14
+ private temporary;
15
+ constructor(temporary?: boolean);
16
+ private createEdge;
17
+ /**
18
+ * Create a new edge symbols container, including sprites for:
19
+ * - top symbol - e.g. different arrows
20
+ * - center symbol - e.g. question mark/cross
21
+ * - bottom symbol - e.g. arrows
22
+ * - strength symbol - strength marker circles
23
+ */
24
+ private createEdgeSymbols;
25
+ /**
26
+ * Update edge style of a given edgeGfx container
27
+ *
28
+ * @param edgeGfx edge graphics container
29
+ * @param edgeStyle current edge style
30
+ * @param textureCache texture cache instance
31
+ */
32
+ static updateEdgeStyle(edgeGfx: PIXI.Container, edgeStyle: PixiEdgeStyle, textureCache: TextureCache): void;
33
+ /**
34
+ * Update edge style of a given edgeSymbolsGfx container
35
+ *
36
+ * @param edgeGfx edge graphics container
37
+ * @param edgeSymbolsGfx edge symbols graphics container
38
+ * @param edgeStyle current edge style
39
+ * @param textureCache texture cache instance
40
+ */
41
+ static updateEdgeSymbolsStyle(edgeGfx: PIXI.Container, edgeSymbolsGfx: PIXI.Container, edgeStyle: PixiEdgeStyle, textureCache: TextureCache): void;
42
+ /**
43
+ * Update visibility of edge elements based on zoomstep
44
+ *
45
+ * @param edgeGfx edge graphics container
46
+ * @param zoomStep zoom step
47
+ */
48
+ static updateEdgeVisibility(edgeGfx: PIXI.Container, zoomState: ZoomState, state: EdgeState): void;
49
+ /**
50
+ * Update visibility of edge symbol elements based on zoomstep
51
+ *
52
+ * @param edgeSymbolsGfx edge symbol graphics container
53
+ * @param zoomStep zoom step
54
+ */
55
+ static updateEdgeSymbolVisibility(edgeSymbolsGfx: PIXI.Container, zoomState: ZoomState, hasPoints: boolean): void;
56
+ /**
57
+ * Update position of the edge
58
+ *
59
+ * @param edgeStyle current edge style
60
+ * @param sourceNodePosition source node center position
61
+ * @param targetNodePosition target node center position
62
+ * @param sourceSize source node diameter
63
+ * @param targetSize target node diameter
64
+ * @param viewport viewport
65
+ * @param textureCache texture cache
66
+ */
67
+ updatePosition(edgeStyle: PixiEdgeStyle, sourceNodePosition: PIXI.PointData, targetNodePosition: PIXI.PointData, sourceSize: number, targetSize: number, viewport: Viewport, textureCache: TextureCache, isSourceSquare?: boolean, isTargetSquare?: boolean): void;
68
+ /**
69
+ * Render a curved edge.
70
+ *
71
+ * Should be called on each render.
72
+ *
73
+ * @param edgeStyle current edge style
74
+ * @param sourceBoundPosition source node bound position
75
+ * @param targetBoundPosition target node bound position
76
+ * @param viewport viewport
77
+ */
78
+ private renderCurvedEdge;
79
+ /**
80
+ * Update styles of all edge graphics
81
+ *
82
+ * @param edgeStyle current edge style
83
+ * @param textureCache texture cache instance
84
+ */
85
+ updateStyle(edgeStyle: PixiEdgeStyle, textureCache: TextureCache): void;
86
+ /**
87
+ * Update visibility of edge graphics
88
+ *
89
+ * @param zoomStep current zoom step
90
+ */
91
+ updateVisibility(zoomState: ZoomState, hasPoints: boolean): void;
92
+ }
93
+ //# sourceMappingURL=edge-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge-object.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/edge/edge-object.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,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;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAkB9D,qBAAa,UAAW,SAAQ,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5E,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;IAExB,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC;IAE/B;;OAEG;IACH,KAAK,EAAE,SAAS,CAGd;IAEF,OAAO,CAAC,SAAS,CAAU;gBAEf,SAAS,UAAQ;IAO7B,OAAO,CAAC,UAAU;IAyBlB;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAyCzB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IA6G3G;;;;;;;OAOG;IACH,MAAM,CAAC,sBAAsB,CACzB,OAAO,EAAE,IAAI,CAAC,SAAS,EACvB,cAAc,EAAE,IAAI,CAAC,SAAS,EAC9B,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,YAAY,GAC3B,IAAI;IAuGP;;;;;OAKG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAyBlG;;;;;OAKG;IACH,MAAM,CAAC,0BAA0B,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAajH;;;;;;;;;;OAUG;IACH,cAAc,CACV,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAAE,IAAI,CAAC,SAAS,EAClC,kBAAkB,EAAE,IAAI,CAAC,SAAS,EAClC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,CAAC,EAAE,OAAO,EACxB,cAAc,CAAC,EAAE,OAAO,GACzB,IAAI;IAmFP;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IA0IxB;;;;;OAKG;IACH,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IASvE;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;CAInE"}
@@ -0,0 +1,19 @@
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
+ export { EdgeObject } from './edge-object';
18
+ export { type EdgeStrengthDefinition, EDGE_STRENGTHS, type PixiEdgeStyle } from './definitions';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/edge/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,sBAAsB,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,40 @@
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
+ import type { PixiEdgeStyle } from './definitions';
19
+ /**
20
+ * Create a graphics object for a side (top or bottom) edge symbol
21
+ *
22
+ * @param style edge style
23
+ * @param position position of the object on the edge
24
+ * @param tint tint of the symbol
25
+ * @param bgTint tint of the background behind the symbol, e.g. to make it not transparent
26
+ */
27
+ export declare function createSideSymbol(style: PixiEdgeStyle, position: 'top' | 'bottom', tint: number, bgTint: number): PIXI.Graphics;
28
+ /**
29
+ * Create a graphics object for the edge strength symbol
30
+ *
31
+ * @param dots number of dots to include in the symbol
32
+ */
33
+ export declare function createStrengthSymbol(dots: number): PIXI.Graphics;
34
+ /**
35
+ * Create a graphics object for center edge symbol
36
+ *
37
+ * @param style edge style
38
+ */
39
+ export declare function createCenterSymbol(style: PixiEdgeStyle): PIXI.Graphics;
40
+ //# sourceMappingURL=symbols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/edge/symbols.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAIhC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,KAAK,GAAG,QAAQ,EAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACf,IAAI,CAAC,QAAQ,CA8Df;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,QAAQ,CAahE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC,QAAQ,CA4BtE"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Calculates the x and y position that the edge should be connected to a square node
3
+ * Note that we do not take into account the rounded edges of the square, if required the below can be modified to include it
4
+ *
5
+ * @param centerX center x coordinate of the square node
6
+ * @param centerY center y coordinate of the square node
7
+ * @param rotation goes from -pi to pi inclusive and represents the angle between the x axis going counterclockwise to the edge from the centre of source node
8
+ * @param width of the square node
9
+ */
10
+ export declare function calculateSourceBoundPosition(centerX: number, centerY: number, rotation: number, width: number): {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ /**
15
+ * Calculates the x and y position that the edge should be connected to a square node
16
+ * Note that we do not take into account the rounded edges of the square, if required the below can be modified to include it
17
+ *
18
+ * @param centerX center x coordinate of the square node
19
+ * @param centerY center y coordinate of the square node
20
+ * @param rotation goes from -pi to pi inclusive and represents the angle between the x axis going counterclockwise to the edge from the centre of source node
21
+ * @param width width of the square node
22
+ */
23
+ export declare function calculateTargetBoundPosition(centerX: number, centerY: number, rotation: number, width: number): {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/shared/rendering/edge/utils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACd;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAyC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACd;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAyC1B"}