@relation-graph/react 3.0.0 → 3.0.1

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 (234) hide show
  1. package/package.json +2 -2
  2. package/relation-graph.js +251 -23
  3. package/relation-graph.mjs +7368 -5902
  4. package/relation-graph.umd.js +251 -23
  5. package/types/packages/platforms/react/src/index.d.ts +98 -64
  6. package/types/packages/platforms/react/src/relation-graph/RGProvider.d.ts +4 -0
  7. package/types/packages/platforms/react/src/relation-graph/RelationGraph.d.ts +7 -3
  8. package/types/packages/platforms/react/src/relation-graph/RelationLinker.d.ts +4 -5
  9. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvas.d.ts +2 -3
  10. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvasContent.d.ts +10 -3
  11. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvasContent4CreatingLine.d.ts +10 -0
  12. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvasContent4FakeLines.d.ts +11 -0
  13. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvasContent4Lines.d.ts +12 -0
  14. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvasContent4Nodes.d.ts +13 -0
  15. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGFakeNode.d.ts +1 -1
  16. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGGraphRefs.d.ts +0 -1
  17. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineContent.d.ts +1 -1
  18. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePath.d.ts +1 -1
  19. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePeel.d.ts +2 -3
  20. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineText.d.ts +1 -1
  21. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGNodePeel.d.ts +10 -1
  22. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationGraphUI.d.ts +4 -0
  23. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationGraphView.d.ts +4 -0
  24. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationLinkerCanvas.d.ts +4 -5
  25. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationLinkerUI.d.ts +4 -0
  26. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationLinkerView.d.ts +4 -0
  27. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectSource.d.ts +1 -1
  28. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectTarget.d.ts +1 -1
  29. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingConnectPoints.d.ts +1 -1
  30. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingLineController.d.ts +1 -1
  31. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNearNodeWidget.d.ts +1 -1
  32. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGMiniView.d.ts +1 -1
  33. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLine.d.ts +1 -1
  34. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLineText.d.ts +1 -1
  35. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnNode.d.ts +1 -1
  36. package/types/packages/platforms/react/src/relation-graph/src/core4react/store/index.d.ts +3 -2
  37. package/types/packages/platforms/react/src/relation-graph/src/core4react/store/reducers/RGStore.d.ts +10 -0
  38. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphBackground.d.ts +1 -1
  39. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphOperateStuff.d.ts +1 -1
  40. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphToolBar.d.ts +1 -1
  41. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphWatermark.d.ts +1 -1
  42. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphXsToolBar.d.ts +1 -1
  43. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/RGDebugView.d.ts +3 -0
  44. package/types/packages/platforms/react/src/relation-graph/src/hooks/RGDataProvider.d.ts +17 -0
  45. package/types/packages/platforms/react/src/relation-graph/src/hooks/RGHooks.d.ts +24 -1
  46. package/types/packages/platforms/react/src/relation-graph/src/hooks/useFakeNodesState.d.ts +1 -1
  47. package/types/packages/platforms/react/src/relation-graph/src/hooks/useGraphInstance.d.ts +2 -12
  48. package/types/packages/platforms/react/src/relation-graph/src/hooks/useGraphStore.d.ts +13 -0
  49. package/types/packages/platforms/react/src/relation-graph/src/hooks/useRelationGraph.d.ts +11 -0
  50. package/types/packages/platforms/react/src/relation-graph/src/hooks/useRelationLinker.d.ts +17 -0
  51. package/types/packages/platforms/react/src/types-react.d.ts +24 -24
  52. package/types/packages/platforms/svelte/src/RGProvider.svelte.d.ts +1 -0
  53. package/types/packages/platforms/svelte/src/context.d.ts +4 -0
  54. package/types/packages/platforms/svelte/src/core4svelte/RGCanvas.svelte.d.ts +1 -0
  55. package/types/packages/platforms/svelte/src/core4svelte/RGCanvasContent.svelte.d.ts +1 -0
  56. package/types/packages/platforms/svelte/src/core4svelte/RGCanvasContent4CreatingLine.svelte.d.ts +1 -0
  57. package/types/packages/platforms/svelte/src/core4svelte/RGCanvasContent4FakeLines.svelte.d.ts +1 -0
  58. package/types/packages/platforms/svelte/src/core4svelte/RGCanvasContent4Lines.svelte.d.ts +1 -0
  59. package/types/packages/platforms/svelte/src/core4svelte/RGCanvasContent4Nodes.svelte.d.ts +1 -0
  60. package/types/packages/platforms/svelte/src/core4svelte/RGEasyView.svelte.d.ts +1 -0
  61. package/types/packages/platforms/svelte/src/core4svelte/RGFakeNode.svelte.d.ts +1 -0
  62. package/types/packages/platforms/svelte/src/core4svelte/RGGraphDefs.svelte.d.ts +1 -0
  63. package/types/packages/platforms/svelte/src/core4svelte/RGLineContent.svelte.d.ts +1 -0
  64. package/types/packages/platforms/svelte/src/core4svelte/RGLinePath.svelte.d.ts +1 -0
  65. package/types/packages/platforms/svelte/src/core4svelte/RGLinePeel.svelte.d.ts +1 -0
  66. package/types/packages/platforms/svelte/src/core4svelte/RGLineText.svelte.d.ts +1 -0
  67. package/types/packages/platforms/svelte/src/core4svelte/RGNodeExpandHolder.svelte.d.ts +1 -0
  68. package/types/packages/platforms/svelte/src/core4svelte/RGNodePeel.svelte.d.ts +1 -0
  69. package/types/packages/platforms/svelte/src/core4svelte/RGProvider4Instance.svelte.d.ts +1 -0
  70. package/types/packages/platforms/svelte/src/core4svelte/RelationGraph.svelte.d.ts +1 -0
  71. package/types/packages/platforms/svelte/src/core4svelte/RelationGraphUI.svelte.d.ts +1 -0
  72. package/types/packages/platforms/svelte/src/core4svelte/RelationLinker.svelte.d.ts +1 -0
  73. package/types/packages/platforms/svelte/src/core4svelte/RelationLinkerCanvas.svelte.d.ts +1 -0
  74. package/types/packages/platforms/svelte/src/core4svelte/RelationLinkerUI.svelte.d.ts +1 -0
  75. package/types/packages/platforms/svelte/src/core4svelte/editing/RGConnectSource.svelte.d.ts +1 -0
  76. package/types/packages/platforms/svelte/src/core4svelte/editing/RGConnectTarget.svelte.d.ts +1 -0
  77. package/types/packages/platforms/svelte/src/core4svelte/editing/RGConnectTargetUI.svelte.d.ts +1 -0
  78. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingConnectController.svelte.d.ts +1 -0
  79. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingConnectPoints.svelte.d.ts +1 -0
  80. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingLineController.svelte.d.ts +1 -0
  81. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingLineControllerUI.svelte.d.ts +1 -0
  82. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingNearNodeWidget.svelte.d.ts +1 -0
  83. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingNodeController.svelte.d.ts +1 -0
  84. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingNodeControllerUI.svelte.d.ts +1 -0
  85. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingReferenceLine.svelte.d.ts +1 -0
  86. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingResize.svelte.d.ts +1 -0
  87. package/types/packages/platforms/svelte/src/core4svelte/editing/RGEditingResizeUI.svelte.d.ts +1 -0
  88. package/types/packages/platforms/svelte/src/core4svelte/editing/RGMiniView.svelte.d.ts +1 -0
  89. package/types/packages/platforms/svelte/src/core4svelte/editing/RGMiniViewContent.svelte.d.ts +1 -0
  90. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGConnectTarget.svelte.d.ts +1 -0
  91. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGEditingConnectController.svelte.d.ts +1 -0
  92. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGEditingLineController.svelte.d.ts +1 -0
  93. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGEditingNearNodeWidget.svelte.d.ts +1 -0
  94. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGEditingNodeController.svelte.d.ts +1 -0
  95. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGEditingReferenceLine.svelte.d.ts +1 -0
  96. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGEditingResize.svelte.d.ts +1 -0
  97. package/types/packages/platforms/svelte/src/core4svelte/web-components/RGMiniView.svelte.d.ts +1 -0
  98. package/types/packages/platforms/svelte/src/core4svelte/web-components/RelationGraphWithProvider.svelte.d.ts +1 -0
  99. package/types/packages/platforms/svelte/src/core4svelte/web-components/WebComponentUtils.d.ts +11 -0
  100. package/types/packages/platforms/svelte/src/core4svelte/widgets/GraphBackground.svelte.d.ts +1 -0
  101. package/types/packages/platforms/svelte/src/core4svelte/widgets/GraphLoading.svelte.d.ts +1 -0
  102. package/types/packages/platforms/svelte/src/core4svelte/widgets/GraphMoveOperator.svelte.d.ts +1 -0
  103. package/types/packages/platforms/svelte/src/core4svelte/widgets/GraphOperateStuff.svelte.d.ts +1 -0
  104. package/types/packages/platforms/svelte/src/core4svelte/widgets/GraphWatermark.svelte.d.ts +1 -0
  105. package/types/packages/platforms/svelte/src/core4svelte/widgets/GraphXsToolBar.svelte.d.ts +1 -0
  106. package/types/packages/platforms/svelte/src/core4svelte/widgets/RGIcons.svelte.d.ts +1 -0
  107. package/types/packages/platforms/svelte/src/hooks/RGHooks.d.ts +27 -0
  108. package/types/packages/platforms/svelte/src/hooks/useGraphInstance.d.ts +2 -0
  109. package/types/packages/platforms/svelte/src/hooks/useGraphStore.d.ts +14 -0
  110. package/types/packages/platforms/svelte/src/hooks/useRGDataProvider.d.ts +19 -0
  111. package/types/packages/platforms/svelte/src/hooks/useRelationGraph.d.ts +48 -0
  112. package/types/packages/platforms/svelte/src/index.d.ts +194 -0
  113. package/types/packages/platforms/svelte/src/types-svelte.d.ts +85 -0
  114. package/types/packages/platforms/vue2/src/core4vue/RGCanvas.vue.d.ts +2 -6
  115. package/types/packages/platforms/vue2/src/core4vue/RGCanvasContent.vue.d.ts +6 -6
  116. package/types/packages/platforms/vue2/src/core4vue/RGCanvasContent4CreatingLine.vue.d.ts +9 -0
  117. package/types/packages/platforms/vue2/src/core4vue/RGCanvasContent4FakeLines.vue.d.ts +9 -0
  118. package/types/packages/platforms/vue2/src/core4vue/RGCanvasContent4Lines.vue.d.ts +9 -0
  119. package/types/packages/platforms/vue2/src/core4vue/RGCanvasContent4Nodes.vue.d.ts +9 -0
  120. package/types/packages/platforms/vue2/src/core4vue/RGEasyView.vue.d.ts +1 -0
  121. package/types/packages/platforms/vue2/src/core4vue/RGGraphDefs.vue.d.ts +1 -0
  122. package/types/packages/platforms/vue2/src/core4vue/RGLineContent.vue.d.ts +18 -18
  123. package/types/packages/platforms/vue2/src/core4vue/RGLinePath.vue.d.ts +4 -28
  124. package/types/packages/platforms/vue2/src/core4vue/RGLinePeel.vue.d.ts +4 -15
  125. package/types/packages/platforms/vue2/src/core4vue/RGNodeExpandHolder.vue.d.ts +3 -9
  126. package/types/packages/platforms/vue2/src/core4vue/RGNodePeel.vue.d.ts +5 -20
  127. package/types/packages/platforms/vue2/src/core4vue/RGProvider.vue.d.ts +50 -0
  128. package/types/packages/platforms/vue2/src/core4vue/RelationGraph.vue.d.ts +5 -773
  129. package/types/packages/platforms/vue2/src/core4vue/RelationGraphUI.vue.d.ts +46 -0
  130. package/types/packages/platforms/vue2/src/core4vue/RelationLinker.vue.d.ts +8 -24
  131. package/types/packages/platforms/vue2/src/core4vue/RelationLinkerCanvas.vue.d.ts +1 -0
  132. package/types/packages/platforms/vue2/src/core4vue/RelationLinkerUI.vue.d.ts +23 -0
  133. package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectSource.vue.d.ts +3 -1
  134. package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +1 -0
  135. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingConnectController.vue.d.ts +2 -1
  136. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingConnectPoints.vue.d.ts +1 -0
  137. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingLineController.vue.d.ts +12 -2
  138. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNearNodeWidget.vue.d.ts +1 -0
  139. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNodeController.vue.d.ts +1 -0
  140. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingReferenceLine.vue.d.ts +1 -0
  141. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingResize.vue.d.ts +1 -0
  142. package/types/packages/platforms/vue2/src/core4vue/editing/RGMiniView.vue.d.ts +3 -1
  143. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphBackground.vue.d.ts +1 -0
  144. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphLoading.vue.d.ts +1 -0
  145. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphMoveOperator.vue.d.ts +1 -1
  146. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphOperateStuff.vue.d.ts +1 -0
  147. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphToolBar.vue.d.ts +1 -1
  148. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphWatermark.vue.d.ts +1 -0
  149. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphXsToolBar.vue.d.ts +1 -1
  150. package/types/packages/platforms/vue2/src/core4vue/widgets/RGDebugView.vue.d.ts +12 -0
  151. package/types/packages/platforms/vue2/src/hooks/GraphStoreMixin.d.ts +40 -0
  152. package/types/packages/platforms/vue2/src/index.d.ts +138 -1692
  153. package/types/packages/platforms/vue2/src/types-vue2.d.ts +3 -0
  154. package/types/packages/platforms/vue3/src/constants.d.ts +0 -1
  155. package/types/packages/platforms/vue3/src/index.d.ts +97 -1404
  156. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGConnectSource.vue.d.ts +2 -2
  157. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGConnectTarget.vue.d.ts +4 -4
  158. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingLineController.vue.d.ts +2 -2
  159. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/RGHooks.d.ts +27 -2
  160. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useGraphData.d.ts +2 -0
  161. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useGraphInstance.d.ts +1 -12
  162. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useGraphStore.d.ts +16 -0
  163. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useRGDataProvider.d.ts +17 -0
  164. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useRelationGraph.d.ts +131 -0
  165. package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useRelationLinker.d.ts +39 -0
  166. package/types/packages/platforms/vue3/src/types-vue3.d.ts +104 -4
  167. package/types/packages/platforms/vue3/src/types.d.ts +3 -1
  168. package/types/packages/relation-graph-models/RGObjectsForExport.d.ts +40 -32
  169. package/types/packages/relation-graph-models/data/RGDataDefine.d.ts +23 -0
  170. package/types/packages/relation-graph-models/data/RGDataGetter.d.ts +36 -0
  171. package/types/packages/relation-graph-models/data/RGDataProvider.d.ts +66 -0
  172. package/types/packages/relation-graph-models/data/RGDataProvider4React.d.ts +9 -0
  173. package/types/packages/relation-graph-models/data/RGDataProvider4Svelte.d.ts +10 -0
  174. package/types/packages/relation-graph-models/data/RGDataProvider4Vue2.d.ts +9 -0
  175. package/types/packages/relation-graph-models/data/RGDataProvider4Vue3.d.ts +10 -0
  176. package/types/packages/relation-graph-models/data/RGDataProvider4Vue3V1.d.ts +10 -0
  177. package/types/packages/relation-graph-models/data/RGLineDataUtils.d.ts +9 -0
  178. package/types/packages/relation-graph-models/data/RGNodeDataUtils.d.ts +14 -0
  179. package/types/packages/relation-graph-models/data/RGOptionsDataUtils.d.ts +9 -0
  180. package/types/packages/relation-graph-models/data/utils/EdgeCounter.d.ts +8 -0
  181. package/types/packages/relation-graph-models/layouts/RGBaseLayout.d.ts +37 -0
  182. package/types/packages/relation-graph-models/layouts/RGCenterLayout.d.ts +9 -0
  183. package/types/packages/relation-graph-models/layouts/RGCircleLayout.d.ts +7 -0
  184. package/types/packages/relation-graph-models/layouts/RGFixedLayout.d.ts +10 -0
  185. package/types/packages/relation-graph-models/layouts/RGFolderLayout.d.ts +15 -0
  186. package/types/packages/relation-graph-models/layouts/RGForceLayout.d.ts +77 -0
  187. package/types/packages/relation-graph-models/layouts/RGIOTreeLayout.d.ts +18 -0
  188. package/types/packages/relation-graph-models/layouts/RGSmartTreeLayout.d.ts +14 -0
  189. package/types/packages/relation-graph-models/layouts/RGTreeLayout.d.ts +17 -0
  190. package/types/packages/relation-graph-models/layouts/analyzers/BasicNetworkAnalyzer.d.ts +27 -0
  191. package/types/packages/relation-graph-models/layouts/analyzers/RGNetworkAnalyzer.d.ts +27 -0
  192. package/types/packages/relation-graph-models/models/RelationGraphBase.d.ts +31 -18
  193. package/types/packages/relation-graph-models/models/RelationGraphCore.d.ts +46 -0
  194. package/types/packages/relation-graph-models/models/RelationGraphWith1View.d.ts +91 -0
  195. package/types/packages/relation-graph-models/models/RelationGraphWith2Data.d.ts +34 -381
  196. package/types/packages/relation-graph-models/models/RelationGraphWith2Data1Getter.d.ts +77 -0
  197. package/types/packages/relation-graph-models/models/RelationGraphWith2Data2Analysis.d.ts +172 -0
  198. package/types/packages/relation-graph-models/models/RelationGraphWith2Data3Update.d.ts +257 -0
  199. package/types/packages/relation-graph-models/models/RelationGraphWith2Data4ConnectTarget.d.ts +85 -0
  200. package/types/packages/relation-graph-models/models/RelationGraphWith2Data5LineConfig.d.ts +35 -0
  201. package/types/packages/relation-graph-models/models/RelationGraphWith3Options1Update.d.ts +75 -0
  202. package/types/packages/relation-graph-models/models/RelationGraphWith3Options2API.d.ts +39 -0
  203. package/types/packages/relation-graph-models/models/RelationGraphWith4Line.d.ts +81 -21
  204. package/types/packages/relation-graph-models/models/RelationGraphWith5Zoom.d.ts +19 -21
  205. package/types/packages/relation-graph-models/models/RelationGraphWith6Effect.d.ts +56 -4
  206. package/types/packages/relation-graph-models/models/RelationGraphWith6Layout.d.ts +60 -12
  207. package/types/packages/relation-graph-models/models/RelationGraphWith7Event.d.ts +233 -36
  208. package/types/packages/relation-graph-models/models/RelationGraphWith91Editing.d.ts +176 -25
  209. package/types/packages/relation-graph-models/models/RelationGraphWith92MiniView.d.ts +70 -13
  210. package/types/packages/relation-graph-models/models/RelationGraphWith93Image.d.ts +36 -0
  211. package/types/packages/relation-graph-models/models/RelationGraphWith93Image_codes.d.ts +36 -0
  212. package/types/packages/relation-graph-models/models/RelationGraphWith95Dom.d.ts +108 -0
  213. package/types/packages/relation-graph-models/models/RelationGraphWith99API.d.ts +125 -0
  214. package/types/packages/relation-graph-models/models/RelationGraphWith9EasyView.d.ts +57 -11
  215. package/types/packages/relation-graph-models/utils/RGCanvasImpl2D.d.ts +2 -3
  216. package/types/packages/relation-graph-models/utils/RGCommon.d.ts +6 -1
  217. package/types/packages/relation-graph-models/utils/RGDragUtils.d.ts +14 -11
  218. package/types/packages/relation-graph-models/utils/RGFullscreenUtils.d.ts +1 -1
  219. package/types/packages/relation-graph-models/utils/RGGraphMath.d.ts +27 -0
  220. package/types/packages/relation-graph-models/utils/RGIntergration.d.ts +32 -34
  221. package/types/packages/relation-graph-models/utils/RGNodesAnalytic.d.ts +6 -15
  222. package/types/packages/relation-graph-models/utils/RGTips.d.ts +7 -0
  223. package/types/packages/relation-graph-models/utils/line/RGLinePath.d.ts +16 -1
  224. package/types/packages/relation-graph-models/utils/line/RGLinePathUtils.d.ts +1 -1
  225. package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor1.d.ts +1 -1
  226. package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor4.d.ts +1 -1
  227. package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor44.d.ts +1 -1
  228. package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor49.d.ts +1 -1
  229. package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor6.d.ts +1 -1
  230. package/types/packages/relation-graph-models/utils/line/RGPathGeneratorForCurve.d.ts +1 -1
  231. package/types/packages/types.d.ts +1467 -0
  232. package/types/packages/types.ts +1472 -0
  233. package/types/react.d.ts +38 -38
  234. package/types/vue3.d.ts +229 -229
@@ -0,0 +1,1467 @@
1
+ /**
2
+ * relation-graph
3
+ * Website: http://www.relation-graph.com/
4
+ * Github: https://github.com/seeksdream/relation-graph
5
+ */
6
+
7
+ /**
8
+ * Data types used by relation-graph
9
+ * This document will define and introduce the core data types used by the relation-graph component.
10
+ */
11
+
12
+ import {RelationGraphCore} from './relation-graph-models/models/RelationGraphCore';
13
+ import {RGLinePathCommands} from "./relation-graph-models/utils/line/RGLinePath";
14
+ import {RGNetworkAnalyzer} from "./relation-graph-models/RGObjectsForExport";
15
+
16
+
17
+
18
+ /**
19
+ * Relation-graph instance type, the instance object can provide methods for manipulating the graph, such as adding nodes, deleting nodes, updating node properties, etc.
20
+ * @example:
21
+ * ```ts
22
+ * graphInstance.addNodes([
23
+ * {id: 'a', text: 'Node A', x: 100, y: 100},
24
+ * {id: 'b', text: 'Node B', x: 200, y: 200, color: '#ff0000'},
25
+ * ]);
26
+ * graphInstance.removeNodeById('a');
27
+ * graphInstance.updateNode('b', {text: 'Updated Node B', color: '#00ff00'});
28
+ * ```
29
+ */
30
+ export type RelationGraphInstance = RelationGraphCore;
31
+
32
+ /**
33
+ * Internal connect target types for relation-graph
34
+ */
35
+ export enum RGInnerConnectTargetType {
36
+ Node = 'node',
37
+ NodePoint = 'NodePoint',
38
+ HTMLElementId = 'HTMLElementId',
39
+ CanvasPoint = 'CanvasPoint',
40
+ ViewPoint = 'ViewPoint'
41
+ }
42
+
43
+ /**
44
+ * Junction points for connecting lines to nodes
45
+ * You can set the fromJunctionPoint and toJunctionPoint properties of the line to use it:
46
+ * @example
47
+ * ```ts
48
+ * import {RGJunctionPoint} from 'relation-graph-react';
49
+ * const line = {
50
+ * from: 'node1',
51
+ * to: 'node2',
52
+ * fromJunctionPoint: RGJunctionPoint.left, // Set the junction point on the 'from' node
53
+ * toJunctionPoint: RGJunctionPoint.right // Set the junction point on the 'to' node
54
+ * };
55
+ * ```
56
+ */
57
+ export enum RGJunctionPoint {
58
+ border = 'border',
59
+ ltrb = 'ltrb',
60
+ tb = 'tb',
61
+ lr = 'lr',
62
+ left = 'left',
63
+ right = 'right',
64
+ top = 'top',
65
+ bottom = 'bottom'
66
+ }
67
+
68
+ /**
69
+ * Data type used internally by relation-graph to manage connection points
70
+ * @inner This type is used internally by relation-graph and is not recommended for direct use by users
71
+ */
72
+ export type RGConnectTarget4NodePoint = {
73
+ targetId: string;
74
+ targetType: string;
75
+ nodeId?: string;
76
+ junctionPoint: RGJunctionPoint;
77
+ width: number;
78
+ height: number;
79
+ offsetX: number;
80
+ offsetY: number;
81
+ offsetPercentX: number;
82
+ offsetPercentY: number;
83
+ targetData: Record<string, any>;
84
+ };
85
+ /**
86
+ * Resize handle positions for relation-graph
87
+ * @inner
88
+ */
89
+ export type RGResizeHandlePosition = 't' | 'r' | 'b' | 'l' | 'tl' | 'tr' | 'bl' | 'br';
90
+ /**
91
+ * Used to specify the position for relation-graph widgets (such as toolbars, zoom controls, etc.)
92
+ * @example
93
+ * ```ts
94
+ * import { RGSlotOnView, RGEditingNodeController, RGEditingNearNodeWidget } from 'relation-graph-react';
95
+ * <RGSlotOnView>
96
+ * <RGEditingNodeController> // Used to wrap the node editing area controller, it identifies one or more nodes currently being edited
97
+ * <RGEditingNearNodeWidget position="top"> // Used to display custom widgets near the node editing area, here it is placed above the node
98
+ * <button>Custom Top Widget</button> // This is a custom button that will be displayed above the node
99
+ * </RGEditingNearNodeWidget>
100
+ * </RGEditingNodeController>
101
+ * </RGSlotOnView>
102
+ * ```
103
+ *
104
+ */
105
+ export type RGWidgetPosition = 'top' | 'right' | 'bottom' | 'left' | 'tl' | 'tr' | 'bl' | 'br';
106
+ /**
107
+ * @inner
108
+ */
109
+ export type RGLineEditPoint = 'start' | 'end';
110
+
111
+ /**
112
+ * Node shapes supported by default in relation-graph, which affect the connection points of lines to nodes and the rendering of nodes on Canvas 2D (Thumbnails view, EasyView).
113
+ */
114
+ export enum RGNodeShape {
115
+ circle = 0,
116
+ rect = 1
117
+ }
118
+
119
+ /**
120
+ * Line shapes for relation-graph
121
+ * You can set the lineShape property of the line to use it:
122
+ * @example
123
+ * ```ts
124
+ * import {RGLineShape} from 'relation-graph-react';
125
+ * const line = {
126
+ * from: 'node1',
127
+ * to: 'node2',
128
+ * lineShape: RGLineShape.StandardCurve // Set the line shape to StandardCurve
129
+ * };
130
+ * ```
131
+ */
132
+ export enum RGLineShape {
133
+ StandardStraight = 1,
134
+ StandardCurve = 6,
135
+ Curve2 = 2,
136
+ Curve3 = 3,
137
+ Curve5 = 5,
138
+ Curve7 = 7,
139
+ Curve8 = 8,
140
+ SimpleOrthogonal = 4,
141
+ StandardOrthogonal = 44,
142
+ HardOrthogonal = 49
143
+ }
144
+
145
+ /**
146
+ * The type of target object that triggered the event. For example, in a right-click event (onContextmenu), relation-graph will tell you on which type of object the right-click event was triggered.
147
+ * 'canvas' means the event was triggered on the canvas, 'node' means it was triggered on a node, and 'line' means it was triggered on a line.
148
+ */
149
+ export type RGEventTargetType = 'canvas' | 'node' | 'line';
150
+
151
+ /**
152
+ * Direction enum used in internal logic processing of relation-graph
153
+ */
154
+ export enum RGDirection {
155
+ Left = 'left',
156
+ Top = 'top',
157
+ Right = 'right',
158
+ Bottom = 'bottom',
159
+ }
160
+
161
+ /**
162
+ * User event type for relation-graph, can be MouseEvent or TouchEvent
163
+ */
164
+ export type RGUserEvent = MouseEvent | TouchEvent;
165
+ /**
166
+ * Rectangle target type for nodes in relation-graph
167
+ */
168
+ export type RGRectTarget = {
169
+ x: number;
170
+ y: number;
171
+ nodeShape: RGNodeShape;
172
+ el_W: number;
173
+ el_H: number;
174
+ }
175
+ /**
176
+ * Line target type for lines in relation-graph
177
+ */
178
+ export type RGLineTarget = RGRectTarget & {
179
+ id?: string // Like node.text
180
+ text?: string; // Like node.text
181
+ targetType: RGInnerConnectTargetType | string
182
+ targetData?: Record<string, any>
183
+ hidden?: boolean
184
+ };
185
+ /**
186
+ * JSON node type for relation-graph
187
+ * @example
188
+ * ```ts
189
+ * import {JsonNode} from 'relation-graph-react';
190
+ * const node: JsonNode = {
191
+ * id: 'node1',
192
+ * text: 'Node 1',
193
+ * type: 'customNodeType',
194
+ * x: 100,
195
+ * y: 100,
196
+ * color: '#ff0000',
197
+ * nodeShape: RGNodeShape.rect,
198
+ * width: 120,
199
+ * height: 60,
200
+ * data: {
201
+ * customProperty: 'customValue'
202
+ * }
203
+ * };
204
+ * ```
205
+ */
206
+ export type JsonNode = {
207
+ id: string
208
+ text?: string
209
+ type?: string
210
+ targetType?: string
211
+ expanded?: boolean
212
+ selected?: boolean
213
+ disablePointEvent?: boolean
214
+ disableDrag?: boolean
215
+ className?: string
216
+ nodeShape?: RGNodeShape
217
+ borderColor?: string
218
+ borderWidth?: number
219
+ borderRadius?: number
220
+ fontColor?: string
221
+ fontSize?: number
222
+ color?: string
223
+ opacity?: number
224
+ fixed?: boolean
225
+ width?: number
226
+ height?: number
227
+ x?: number
228
+ y?: number
229
+ zIndex?: number
230
+ data?: Record<string, any>
231
+ expandHolderPosition?: string
232
+ force_weight?: number
233
+ el_W?: number;
234
+ el_H?: number;
235
+ /**
236
+ * Will be ignored when importing data
237
+ */
238
+ children?: JsonNode[]
239
+ hidden?: boolean
240
+ alwaysRender?: boolean
241
+ }
242
+ /**
243
+ * Enhanced node type for runtime in relation-graph, it includes additional properties needed for runtime such as whether to render, calculated visibility, layout information, etc.
244
+ */
245
+ export type RGNode = Omit<JsonNode, 'children'> & RGRectTarget & {
246
+ type: string
247
+ x: number
248
+ y: number
249
+ nodeShape: RGNodeShape
250
+ lot: {
251
+ childs: RGNode[]
252
+ parent?: RGNode | undefined
253
+ eached?: boolean
254
+ strength?: number
255
+ subling?: {
256
+ level: number
257
+ all_size: number
258
+ all_strength: number
259
+ }
260
+ level?: number
261
+ index_of_parent?: number
262
+ strength_of_level?: number
263
+ index_of_level?: number
264
+ childrenSize?: number
265
+ childrenSizeVisible?: number
266
+ index_of_p_childs?: number
267
+ strengthWithChilds?: number
268
+ strengthWithChilds_from?: number
269
+ x?: number
270
+ y?: number
271
+ }
272
+ rgChildrenSize?: number
273
+ rgShouldRender?: boolean
274
+ rgCalcedVisibility?: boolean
275
+ }
276
+ /**
277
+ * JSON line type for relation-graph
278
+ * @example
279
+ * ```ts
280
+ * import {JsonLine, RGLineShape} from 'relation-graph-react';
281
+ * const line: JsonLine = {
282
+ * id: 'line1',
283
+ * from: 'node1',
284
+ * to: 'node2',
285
+ * text: 'Line from Node 1 to Node 2',
286
+ * type: 'customLineType',
287
+ * color: '#0000ff',
288
+ * lineShape: RGLineShape.StandardCurve,
289
+ * data: {
290
+ * customProperty: 'customValue'
291
+ * }
292
+ * };
293
+ * ```
294
+ */
295
+ export type JsonLine = {
296
+ id?: string
297
+ from: string
298
+ to: string
299
+ text?: string
300
+ selected?: boolean
301
+ type?: string;
302
+ isFakeLine?: boolean;
303
+ fromType?: string;
304
+ toType?: string;
305
+ color?: string
306
+ fontColor?: string
307
+ fontSize?: number
308
+ lineWidth?: number
309
+ opacity?: number
310
+ lineShape?: RGLineShape
311
+ className?: string
312
+ showStartArrow?: boolean
313
+ showEndArrow?: boolean
314
+ startMarkerId?: string
315
+ endMarkerId?: string
316
+ useTextPath?: boolean
317
+ onPathStartOffset?: string
318
+ textAnchor?: string
319
+ lineDirection?: string
320
+ polyLineStartDistance?: number
321
+ disablePointEvent?: boolean
322
+ data?: Record<string, any>
323
+ cssVars?: Record<string, any>
324
+ force_elastic?: number
325
+ textOffset_x?: number
326
+ textOffset_y?: number
327
+ animation?: number
328
+ dashType?: number
329
+ lineRadius?: number
330
+ forDisplayOnly?: boolean
331
+ junctionOffset?: number
332
+ fromJunctionPoint?: RGJunctionPoint
333
+ toJunctionPoint?: RGJunctionPoint
334
+ fromJuctionPointOffsetX?: number
335
+ fromJuctionPointOffsetY?: number
336
+ toJuctionPointOffsetX?: number
337
+ toJuctionPointOffsetY?: number
338
+ hidden?: boolean
339
+ }
340
+ /**
341
+ * RGFakeLine can use non-node objects as the start or end points of fake nodes, enabling more complex line connection requirements
342
+ * The difference between RGFakeLine and RGLine is that the from and to properties of RGLine must be node IDs, while RGFakeLine is not restricted, but RGFakeLine does not produce any layout effects
343
+ * By setting fromType and toType to identify the start and end types of the fake line
344
+ * The default supported types are those in the RGInnerConnectTargetType enum. You can also define custom types by using the graphInstance.setFakeLineTargetRender method to specify how to obtain the RGRectTarget information for the custom type.
345
+ */
346
+ export type RGFakeLine = JsonLine & {
347
+ id: string;
348
+ fromType: RGInnerConnectTargetType | string;
349
+ toType: RGInnerConnectTargetType | string;
350
+ }
351
+ /**
352
+ * Enhanced line type for runtime in relation-graph
353
+ * isReverse: indicates whether the line direction is reversed, which is automatically calculated based on the from and to nodes and does not need to be set manually.
354
+ */
355
+ export type RGLine = JsonLine & {
356
+ id: string;
357
+ isReverse?: boolean // 自动计算,无需设置
358
+ }
359
+ /**
360
+ * The runtime derived object type of the line, which can associate the line with its start and end nodes, and contains some additional properties for rendering and visibility calculation
361
+ * You can get the RGLink object through the graphInstance.getLinks() method, or get the RGLink object corresponding to the specified line through the graphInstance.getLinkByLineId(lineId: string) method
362
+ * - line : The RGLine object corresponding to this link
363
+ * - fromNode : The RGNode object representing the start node of the line
364
+ * - toNode : The RGNode object representing the end node of the line
365
+ * - totalLinesBetweenNodes : The total number of lines between the fromNode and toNode
366
+ * - currentLineIndex : The index of the current line among all lines between the fromNode and toNode
367
+ * - rgShouldRender : Indicates whether this link should be rendered, which is calculated based on the visibility of the fromNode and toNode, as well as whether the line itself is hidden
368
+ * - rgCalcedVisibility : Indicates whether this link is visible, which is calculated based on the visibility of the fromNode and toNode, as well as whether the line itself is hidden
369
+ *
370
+ */
371
+ export type RGLink = {
372
+ lineId: string
373
+ line: RGLine,
374
+ fromNode: RGNode
375
+ toNode: RGNode
376
+ totalLinesBetweenNodes: number
377
+ currentLineIndex: number
378
+ rgShouldRender?: boolean
379
+ rgCalcedVisibility?: boolean // allLines(!hidden) && (fromNode rgCalcedVisibility) && (toNode rgCalcedVisibility)
380
+ };
381
+ /**
382
+ * @deprecated Use RGLink instead
383
+ */
384
+ export type RGElementLine = RGLink;
385
+ /**
386
+ * RGJsonData is a JSON data format for quickly setting graph data. Through it, you can quickly import data using the graphInstance.setJsonData method.
387
+ * It is a shortcut method, equivalent to the following code:
388
+ * ```ts
389
+ * const jsonData = {
390
+ * rootId: 'rootNodeId',
391
+ * nodes: [...],
392
+ * lines: [...]
393
+ * };
394
+ * graphInstance.addNodes(jsonData.nodes);
395
+ * graphInstance.addLines(jsonData.lines);
396
+ * graphInstance.setRootNodeId(jsonData.rootId);
397
+ * ```
398
+ */
399
+ export type RGJsonData = {
400
+ rootId?: string
401
+ nodes: JsonNode[]
402
+ lines: JsonLine[]
403
+ fakeLines?: RGFakeLine[]
404
+ };
405
+ /**
406
+ * RGGraphData is the internal data structure used by relation-graph to manage graph data
407
+ */
408
+ export type RGGraphData = {
409
+ rootNode?: RGNode,
410
+ nodes: RGNode[],
411
+ normalLines: RGLine[],
412
+ fakeLines: RGFakeLine[]
413
+ };
414
+ /**
415
+ * Coordinate type for relation-graph
416
+ */
417
+ export type RGCoordinate = {
418
+ x: number;
419
+ y: number;
420
+ };
421
+ /**
422
+ * Rectangle box type for counting node areas
423
+ * For example, you can get the rectangular area occupied by the specified nodes through the following code:
424
+ * ```ts
425
+ * const nodesBoxInfo: RGNodesRectBox = graphInstance.getNodesRectBox(someNodes);
426
+ * ```
427
+ */
428
+ export type RGNodesRectBox = {
429
+ width: number;
430
+ height: number;
431
+ minX: number;
432
+ minY: number;
433
+ maxX: number;
434
+ maxY: number;
435
+ };
436
+ /**
437
+ * Position type for relation-graph
438
+ * Generally used to save position coordinates
439
+ */
440
+ export type RGPosition = RGCoordinate;
441
+ /**
442
+ * Drag callback type used in internal logic processing of relation-graph
443
+ * @inner
444
+ */
445
+ export type RGDraggingCallback = (
446
+ offsetX: number,
447
+ offsetY: number,
448
+ startElPosition: { x: number; y: number },
449
+ startEventPosition: { x: number; y: number },
450
+ event: MouseEvent | TouchEvent
451
+ ) => void;
452
+ /**
453
+ * Drag end callback type used in internal logic processing of relation-graph
454
+ * @inner
455
+ */
456
+ export type RGDraggedCallback = (
457
+ buffX: number,
458
+ buffY: number,
459
+ event: MouseEvent | TouchEvent
460
+ ) => void;
461
+ /**
462
+ * Layout options fragment: node alignment settings
463
+ * - alignItemsX: The coordinate assigned to the node is based on which position of the node, 'start' means left-aligned, 'center' means center-aligned, and 'end' means right-aligned
464
+ * - alignItemsY: The coordinate assigned to the node is based on which position of the node, 'start' means top-aligned, 'center' means center-aligned, and 'end' means bottom-aligned
465
+ */
466
+ export type RGLayoutOptions4Alignment = {
467
+ alignItemsX?: 'start' | 'center' | 'end';
468
+ alignItemsY?: 'start' | 'center' | 'end';
469
+ };
470
+ /**
471
+ * Layout core options type
472
+ * - layoutName: Layout algorithm name such as 'force', 'center', 'tree', etc.
473
+ * - layoutDirection: Layout direction, 'h' means horizontal layout, 'v' means vertical layout
474
+ * - fixedRootNode: By default, the root node is fixed at the center of the canvas (coordinates: 0,0). If set to true, the root node position will not be fixed, and the layout engine will assign relative positions to other nodes based on the current coordinates of the root node.
475
+ * - autoLayouting: Used to get whether the layout engine is currently performing automatic layout calculations (applicable to force-directed layouts and center layouts that inherit from force-directed layouts). This property does not need to be set and is read-only.
476
+ * - supportAutoLayout: Whether to support automatic layout. Generally, force-directed layouts and center layouts that inherit from force-directed layouts support automatic layout, while other layouts do not support automatic layout. This property does not need to be set and is read-only.
477
+ */
478
+ export type RGLayoutOptionsCore = RGLayoutOptions4Alignment & {
479
+ layoutName: string;
480
+ layoutDirection?: 'h' | 'v';
481
+ fixedRootNode?: boolean
482
+ autoLayouting?: boolean
483
+ supportAutoLayout?: boolean
484
+ };
485
+ /**
486
+ * Force-directed layout options type
487
+ * - fastStart: Default is false. The force-directed layout will start the force-directed calculation with a center layout as the initial state. If set to true, it will start the force-directed calculation from a random position, which may speed up the convergence of the layout, but the node positions may be more dispersed in the initial state.
488
+ * - maxLayoutTimes: Maximum number of layout iterations, default is 300. The force-directed layout will stop the layout calculation when it reaches this number of iterations, even if the layout has not fully converged.
489
+ * - byNode: Whether to enable repulsion calculation between nodes, default is true.
490
+ * - byLine: Whether to enable elastic force calculation between lines, default is true.
491
+ * - force_node_repulsion: Repulsion coefficient between nodes, default is 1. The larger this value, the stronger the repulsion between nodes, and the more dispersed the layout will be.
492
+ * - force_line_elastic: Elastic coefficient between lines, default is 1. The larger this value, the stronger the elastic force between lines, and the more compact the layout will be.
493
+ *
494
+ */
495
+ export type RGForceLayoutOptions = RGLayoutOptionsCore & {
496
+ fastStart?: boolean;
497
+ maxLayoutTimes?: number;
498
+ byNode?: boolean;
499
+ byLine?: boolean;
500
+ force_node_repulsion?: number;
501
+ force_line_elastic?: number;
502
+ };
503
+ /**
504
+ * Center layout options type
505
+ * - distance_coefficient: Coefficient for calculating the ideal distance between nodes, default is 1. The larger this value, the greater the ideal distance between nodes, and the more dispersed the layout will be.
506
+ * - levelDistance: Array of distances between levels, default is []. You can set the distance between different levels of nodes in the tree structure. For example, [100, 200, 300] means the distance between level 0 and level 1 is 100, the distance between level 1 and level 2 is 200, and the distance between level 2 and level 3 is 300. If the array length is less than the number of levels, the last value will be used for the remaining levels.
507
+ */
508
+ export type RGCenterLayoutOptions = RGForceLayoutOptions & {
509
+ distance_coefficient?: number
510
+ levelDistance?: number[]
511
+ };
512
+ /**
513
+ * Tree layout options type
514
+ * - from: The node ID from which the tree layout starts
515
+ * - treeNodeGapH: Horizontal gap between tree nodes, default is 50
516
+ * - treeNodeGapV: Vertical gap between tree nodes, default is 50
517
+ * - levelGaps: Array of gaps between levels, default is []. You can set the gap between different levels of nodes in the tree structure. For example, [100, 200, 300] means the gap between level 0 and level 1 is 100, the gap between level 1 and level 2 is 200, and the gap between level 2 and level 3 is 300. If the array length is less than the number of levels, the last value will be used for the remaining levels.
518
+ * - layoutExpansionDirection: Direction of tree expansion, 'start' means expanding from top to bottom or left to right, 'center' means expanding from center to both sides, 'end' means
519
+ * - simpleTree: By default, the tree will expand bidirectionally based on the root node according to the direction of the relationships. If set to true, the tree structure will only expand unidirectionally.
520
+ * - ignoreNodeSize: Whether to ignore node size when calculating tree layout, default is false. If set to true, all nodes will be treated as having the same size during layout calculation, which may speed up the layout calculation but may affect the layout effect.
521
+ * - alignParentItemsX: Alignment of parent nodes in the X direction, 'start' means left-aligned, 'center' means center-aligned, and 'end' means right-aligned. Default is 'center'.
522
+ * - alignParentItemsY: Alignment of parent nodes in the Y direction, 'start' means top-aligned, 'center' means center-aligned, and 'end' means bottom-aligned. Default is 'center'.
523
+ */
524
+ export type RGTreeLayoutOptions = RGLayoutOptionsCore & {
525
+ from: string
526
+ treeNodeGapH?: number
527
+ treeNodeGapV?: number
528
+ levelGaps?: number[]
529
+ layoutExpansionDirection?: 'start' | 'center' | 'end'
530
+ simpleTree?: boolean;
531
+ ignoreNodeSize?: boolean;
532
+ alignParentItemsX?: 'start' | 'center' | 'end';
533
+ alignParentItemsY?: 'start' | 'center' | 'end';
534
+ };
535
+ /**
536
+ * Layout options type for relation-graph
537
+ * Supported layoutName include:
538
+ * - tree: Tree layout, using RGTreeLayout class for layout
539
+ * - center: Center layout, using RGCenterLayout class for layout
540
+ * - circle: Circle layout, using RGCircleLayout class for layout
541
+ * - force: Force-directed layout, using RGForceLayout class for layout
542
+ * - fixed: Fixed layout, using RGFixedLayout class for layout
543
+ * - smart-tree: Smart tree layout, using RGSmartTreeLayout class for layout
544
+ * - io-tree: Input-output tree layout, using RGIOTreeLayout class for layout
545
+ * - folder: Folder layout, using RGFolderLayout class for layout
546
+ */
547
+ export type RGLayoutOptions = RGLayoutOptionsCore
548
+ | RGForceLayoutOptions
549
+ | RGCenterLayoutOptions
550
+ | RGTreeLayoutOptions;
551
+
552
+ /**
553
+ * Layout engine interface type for relation-graph internal use
554
+ * @inner
555
+ */
556
+ export interface RGLayout {
557
+ isMainLayouer: boolean
558
+ requireLinks: boolean
559
+ allNodes: RGNode[]
560
+ rootNode?: RGNode
561
+ layoutOptions: RGLayoutOptions
562
+ networkAnalyzer: RGNetworkAnalyzer
563
+ setLinks: (links: RGLink[]) => void
564
+ placeNodes: (allNodes: RGNode[], rootNode: RGNode) => void
565
+ start?: () => void
566
+ stop?: () => void
567
+ }
568
+
569
+ /**
570
+ * Complete configuration type that includes all options available for users to configure
571
+ */
572
+ export type RGOptionsInited = {
573
+ instanceId: string
574
+ debug: boolean
575
+ showToolBar: boolean
576
+ backgroundColor: string
577
+ disableWheelEvent: boolean
578
+ wheelEventAction: 'zoom' | 'scroll' | 'none'
579
+ dragEventAction: 'move' | 'selection' | 'none'
580
+ disableDragNode: boolean
581
+ disableDragLine: boolean
582
+ canvasMoveMode: boolean
583
+ disableNodePointEvent: boolean
584
+ disableLinePointEvent: boolean
585
+ toolBarDirection: string
586
+ toolBarPositionH: string
587
+ toolBarPositionV: string
588
+ defaultExpandHolderPosition: 'hide' | 'left' | 'top' | 'right' | 'bottom'
589
+ defaultNodeColor: string
590
+ defaultNodeBorderColor: string,
591
+ defaultNodeBorderWidth: number,
592
+ defaultNodeBorderRadius: number,
593
+ defaultNodeShape: RGNodeShape,
594
+ defaultNodeWidth?: number
595
+ defaultNodeHeight?: number
596
+ checkedItemBackgroundColor?: string //
597
+ defaultLineTextOffset_x?: number,
598
+ defaultLineTextOffset_y?: number,
599
+ defaultLineColor: string
600
+ defaultLineWidth: number
601
+ defaultLineShape?: RGLineShape
602
+ // defaultShowLineLabel: boolean
603
+ // hideNodeContentByZoom: boolean
604
+ defaultJunctionPoint?: RGJunctionPoint
605
+ defaultLineJunctionOffset: number,
606
+ // placeSingleNode: boolean
607
+ placeOtherNodes: boolean
608
+ lineUseTextPath: boolean
609
+ lineTextMaxLength: number
610
+ multiLineDistance: number
611
+ checkedNodeId: string // private
612
+ checkedLineId: string // private
613
+ draggingNodeId: string // private
614
+ performanceMode: boolean,
615
+ fullscreenElementXPath: string,
616
+ data: any
617
+ viewHeight: string
618
+ defaultLineMarker: {
619
+ markerWidth: number
620
+ markerHeight: number
621
+ refX: number
622
+ refY: number
623
+ viewBox: string
624
+ data: string
625
+ }
626
+ layout: RGLayoutOptions
627
+ canvasZoom: number // private
628
+ mouseWheelSpeed: number // private
629
+ minCanvasZoom: number // private
630
+ maxCanvasZoom: number // private
631
+ placeOtherGroup: boolean
632
+ defaultPolyLineRadius: number,
633
+ reLayoutWhenExpandedOrCollapsed: boolean
634
+ creatingSelection: boolean
635
+ selectionView: RGSelectionView
636
+ creatingNodePlot: boolean
637
+ showTemplateNode: boolean
638
+ newNodeTemplate: any
639
+ creatingLinePlot: boolean
640
+ newLineTemplate: RGLine
641
+ newLinkTemplate: any
642
+ definitelyNoDataProviderNeeded: boolean
643
+ }
644
+ /**
645
+ * Complete configuration type that includes all runtime state options, none of which can be directly configured by users
646
+ */
647
+ export type RGOptionsFull = RGOptionsInited & {
648
+ snapshotting: boolean
649
+ graphLoading: boolean
650
+ enableNodeXYAnimation: boolean
651
+ enableCanvasTransformAnimation: boolean
652
+ graphLoadingText: string
653
+ editingLineController: RGEditingLine,
654
+ editingController: RGEditingNodes,
655
+ nodeConnectController: RGConnectingNode,
656
+ showReferenceLine: boolean,
657
+ referenceLineAdsorption: boolean,
658
+ editingReferenceLine: {
659
+ show: boolean,
660
+ directionV: boolean,
661
+ directionH: boolean,
662
+ v_x: number,
663
+ v_y: number,
664
+ v_height: number,
665
+ h_x: number,
666
+ h_y: number,
667
+ h_width: number
668
+ },
669
+ showMiniView: boolean,
670
+ miniViewVisibleHandle: {
671
+ x: number,
672
+ y: number,
673
+ width: number,
674
+ height: number,
675
+ emptyContent: boolean
676
+ }
677
+ instanceId: string
678
+ viewSize: { width: number; height: number }
679
+ canvasSize: {
680
+ width: number
681
+ height: number
682
+ }
683
+ canvasOffset: {
684
+ x: number
685
+ y: number
686
+ }
687
+ fullscreen: boolean // private
688
+ showEasyView?: boolean // private
689
+ canvasOpacity?: number // private
690
+ }
691
+ /**
692
+ * Partial configuration type for relation-graph, users can configure any subset of options
693
+ */
694
+ export type RGOptions = Partial<RGOptionsInited>;
695
+ /**
696
+ * When the user performs a selection operation on the canvas (event: onCanvasSelectionEnd), the type of selection view information passed
697
+ */
698
+ export type RGSelectionView = {
699
+ x: number
700
+ y: number
701
+ width: number
702
+ height: number
703
+ };
704
+
705
+ /**
706
+ * Event handler type for relation-graph events
707
+ * @inner
708
+ */
709
+ export type RGEventHandler = (eventName: RGEventNames, ...args: any[]) => void | any;
710
+ /**
711
+ * Event emit hook type for relation-graph events
712
+ * @inner
713
+ */
714
+ export type RGEventEmitHook = (eventName: RGEventNames, ...args: any[]) => void | any;
715
+ /**
716
+ * Control point type for RGLineShape.Line44 lines
717
+ * @inner
718
+ */
719
+ export type RGCtrlPointForLine44 = {
720
+ pIndex: number,
721
+ optionName: string,
722
+ direction: 'v' | 'h',
723
+ x: number,
724
+ y: number,
725
+ startDirection: RGDirection,
726
+ endDirection: RGDirection,
727
+ hide?: boolean
728
+ }
729
+
730
+ /**
731
+ * The exposed interface type of the relation-graph component instance
732
+ * @inner
733
+ */
734
+ export interface RelationGraphExpose {
735
+ getInstance(): RelationGraphInstance;
736
+ }
737
+
738
+ /**
739
+ * Props type for RGNodeSlot component
740
+ */
741
+ export interface RGNodeSlotProps {
742
+ node: RGNode
743
+ defaultExpandHolderPosition?: string
744
+ dragging?: boolean
745
+ checked?: boolean
746
+ }
747
+
748
+ /**
749
+ * Props type for RGLineSlot component
750
+ * @inner
751
+ */
752
+ export interface RGLinePeelProps {
753
+ line: RGLine | RGFakeLine
754
+ checked?: boolean
755
+ lineUseTextPath?: boolean
756
+ graphInstanceId?: string
757
+ }
758
+
759
+ /**
760
+ * Custom line slot component Props type
761
+ * @param lineConfig Configuration parameters for the line, which include information such as the start and end objects, line objects, etc., used for line objects, and global default configurations for rendering lines.
762
+ * @param checked Whether the current line is selected
763
+ * @param lineUseTextPath Whether the line uses textPath to typeset text, allowing the text to be arranged along the line path
764
+ * @param graphInstanceId The ID of the current graph instance, used for creating some unique identifiers, etc. (for example, you can display two relation-graph components with the same data on one page to prevent their ids from conflicting)
765
+ *
766
+ */
767
+ export interface RGLineSlotProps {
768
+ lineConfig: RGGenerateLineConfig
769
+ checked?: boolean
770
+ lineUseTextPath?: boolean
771
+ graphInstanceId?: string
772
+ }
773
+
774
+ /**
775
+ * Props type for RGLinePath component
776
+ * @param lineConfig Configuration parameters for the line, which include information such as the start and end objects, line objects, etc., used for line objects, and global default configurations for rendering lines.
777
+ * @param linePathInfo The path information of the line, including path data, text position, etc., used for rendering the line path
778
+ * @param lineUseTextPath Whether the line uses textPath to typeset text, allowing the text to be arranged along the line path
779
+ * @param checked Whether the current line is selected
780
+ * @param graphInstanceId The ID of the current graph instance, used for creating some unique identifiers, etc. (for example, you can display two relation-graph components with the same data on one page to prevent their ids from conflicting)
781
+ *
782
+ */
783
+ export interface RGLinePathProps {
784
+ lineConfig: RGGenerateLineConfig
785
+ linePathInfo: RGLinePathInfo
786
+ lineUseTextPath?: boolean
787
+ checked?: boolean
788
+ graphInstanceId?: string
789
+ }
790
+
791
+ /**
792
+ * Props type for RGLineText component
793
+ * @param lineConfig Configuration parameters for the line, which include information such as the start and end objects, line objects, etc., used for line objects, and global default configurations for rendering lines.
794
+ * @param linePathInfo The path information of the line, including path data, text position, etc., used for rendering the line path
795
+ * @param checked Whether the current line is selected
796
+ *
797
+ */
798
+ export interface RGLineTextProps {
799
+ lineConfig: RGGenerateLineConfig
800
+ linePathInfo: RGLinePathInfo
801
+ checked?: boolean
802
+ }
803
+
804
+ /**
805
+ * Props type for <RelationGraph /> component
806
+ * @param options Configuration options for relation-graph
807
+ * @param relationGraphCore The core class of relation-graph, default is RelationGraphCore
808
+ */
809
+ export type RelationGraphProps = RGListeners & {
810
+ options: RGOptions;
811
+ relationGraphCore?: new (...args: any[]) => RelationGraphCore;
812
+ };
813
+
814
+ /**
815
+ * Positioning props for <RGToolBar /> components
816
+ * @param direction 'v' means vertical toolbar, 'h' means horizontal toolbar
817
+ * @param positionH 'left' means left-aligned, 'center' means center-aligned, 'right' means right-aligned
818
+ * @param positionV 'top' means top-aligned, 'center' means center-aligned, 'bottom' means bottom-aligned
819
+ */
820
+ export interface RGToolBarProps {
821
+ direction?: 'v' | 'h' | string,
822
+ positionH?: 'left' | 'center' | 'right' | string,
823
+ positionV?: 'top' | 'center' | 'bottom' | string,
824
+ }
825
+
826
+ /**
827
+ * Positioning props for <RGMiniView /> components
828
+ * @param position Position of the mini view: 'tl' | 'tr' | 'bl' | 'br' | 'top' | 'right' | 'bottom' | 'left'
829
+ * @param width Width of the mini view
830
+ * @param height Height of the mini view
831
+ */
832
+ export interface RGMiniViewProps {
833
+ position?: RGWidgetPosition,
834
+ width?: string,
835
+ height?: string,
836
+ className?: string;
837
+ style?: Record<string, string | number | undefined>,
838
+ }
839
+
840
+ /**
841
+ * Positioning props for <RGEditingNearNodeWidget /> components
842
+ * @param position Position of the widget: 'tl' | 'tr' | 'bl' | 'br' | 'top' | 'right' | 'bottom' | 'left'
843
+ */
844
+ export interface RGWidgetProps {
845
+ position?: RGWidgetPosition
846
+ }
847
+
848
+ /**
849
+ * Props type for RGEditingLineController component
850
+ * @inner
851
+ */
852
+ export interface RGEditingLineControllerProps {
853
+ textEditable?: boolean
854
+ onMoveLineVertexStart?: (type: RGLineEditPoint, line: RGLine) => void
855
+ onMoveLineVertexEnd?: RGLineVertexBeDroppedEventHandler
856
+ onLinePathChanged?: (line: RGLine, params: any) => void
857
+ onLineTextDragEnd?: (line: RGLine) => void
858
+ onLineTextChanged?: (line: RGLine) => void
859
+ }
860
+
861
+ /**
862
+ * @inner
863
+ */
864
+ export type RGLineConnectEventHandler = (fromNode: RGNode | RGLineTarget | RGPosition, toNode: RGNode | RGLineTarget | RGPosition, newLineJson?: JsonLine) => void;
865
+ /**
866
+ * @inner
867
+ */
868
+ export type RGLineVertexBeDroppedEventHandler = (fromNode: RGNode | RGLineTarget | RGPosition, toNode: RGNode | RGLineTarget | RGPosition, newLineJson?: JsonLine) => void;
869
+ export type JsonNodeLike = Partial<JsonNode>;
870
+ export type JsonLineLike = Partial<JsonLine>;
871
+ export type JsonNodeTemplate = JsonNodeLike;
872
+ export type JsonLineTemplate = JsonLineLike;
873
+
874
+ /**
875
+ * @inner
876
+ */
877
+ export type CreatingLinePlotOptions = {
878
+ onCreateLine: RGLineConnectEventHandler | undefined
879
+ isReverse?: boolean,
880
+ template?: JsonLineLike
881
+ fromNode?: RGLineTarget
882
+ };
883
+ /**
884
+ * @inner
885
+ */
886
+ export type CreatingNodePlotOptions = {
887
+ templateNode: JsonNodeLike
888
+ templateMove?: (x: number, y: number) => void
889
+ onCreateNode: (x: number, y: number, nodeTemplate?: JsonNodeLike) => void
890
+ };
891
+
892
+ /**
893
+ * Props type for <RGConnectSource> component
894
+ * The RGConnectSource component allows any element to have the functionality of a connection starting point.
895
+ * @param lineTemplate The template information for the connection line, which can be partial properties of JsonLine
896
+ * @param onConnectStart Callback function triggered when starting to initiate a connection line
897
+ * @param onConnectEnd Callback function triggered when the connection line initiation ends
898
+ * @param className Custom class name for the component
899
+ * @param style Custom styles for the component
900
+ * @example
901
+ * ```tsx
902
+ * import {RGLineShape} from 'relation-graph-react';
903
+ *
904
+ * <RGConnectSource
905
+ * :lineTemplate="{ color: 'red', lineShape: RGLineShape.StandardCurve }"
906
+ * :onConnectEnd="(fromNode, toNode, newLineJson) => {
907
+ * console.log('Connection ended:', fromNode, toNode, newLineJson);
908
+ * // You can add the new line to the graph here
909
+ * graphInstance.addLines([newLineJson]);
910
+ * }"
911
+ * >
912
+ * <div class="my-connect-source">
913
+ * Drag from here to connect
914
+ * </div>
915
+ * </RGConnectSource>
916
+ * ```
917
+ */
918
+ export interface RGConnectSourceProps {
919
+ lineTemplate: JsonLineLike;
920
+ onConnectStart?: (newLineTemplate?: JsonLineLike, event?: RGUserEvent) => void;
921
+ onConnectEnd?: RGLineConnectEventHandler; // default is true
922
+ className?: string;
923
+ style?: Record<string, string | number | undefined>,
924
+ }
925
+
926
+ /**
927
+ * Component <RGConnectTarget> Props type
928
+ * The RGConnectTarget component allows any element to have the functionality of a connection endpoint. Unlike RGConnectSource, RGConnectTarget can not only be dragged to start creating a line, but also be used as a connection point for lines.
929
+ * When a connection line is initiated from RGConnectTarget and completed, the new line information can be obtained through the onLineBeCreated event of the <RelationGraph> component and added to the graph. The creation of the line can also be completed through onDragConnectEnd.
930
+ * @param junctionPoint Specifies the junction point information of the connection target
931
+ * @param targetId The target ID corresponding to the connection target, which can be a node ID or a special identifier
932
+ * @param targetType The type of the connection target, which can be customized to distinguish different types of targets, Default is RGInnerConnectTargetType.NodePoint (if RGConnectTarget is placed inside a node) or RGInnerConnectTargetType.CanvasPoint
933
+ * @param targetData Additional data for the connection target, which can store any information related to the target
934
+ * @param onLineVertexBeDropped Callback function triggered when a line endpoint is dragged to this connection target and released
935
+ * @param lineTemplate The template information for the connection line, which can be partial properties of JsonLine
936
+ * @param disableDrop Whether to disable the function of dragging the line endpoint to this connection target for connection, default is false
937
+ * @param disableDrag Whether to disable the function of initiating line connection from this connection target, default is false
938
+ * @param onDragConnectStart Callback function triggered when starting to drag from this connection target to initiate a connection line
939
+ * @param onDragConnectEnd Callback function triggered when the connection line initiated by dragging from this connection target is released
940
+ * @param className Custom class name for the component
941
+ * @param style Custom styles for the component
942
+ * @example
943
+ * ```tsx
944
+ * import {RGJunctionPoint, RGLineShape} from 'relation-graph-react';
945
+ *
946
+ * <RGConnectTarget
947
+ * :junctionPoint="RGJunctionPoint.Bottom"
948
+ * targetId="my-target-1"
949
+ * :targetData="{ info: 'additional data' }"
950
+ * :lineTemplate="{ color: '#ff0000', lineShape: RGLineShape.StandardStraight, data: { info: 'additional data' } }"
951
+ * >
952
+ * <div class="my-connect-target">
953
+ * Drop line here or drag from here to connect
954
+ * </div>
955
+ * </RGConnectTarget>
956
+ * ```
957
+ */
958
+ export interface RGConnectTargetProps {
959
+ junctionPoint: RGJunctionPoint;
960
+ targetId: string;
961
+ targetType?: string;
962
+ targetData?: Record<string, any>;
963
+ onLineVertexBeDropped?: RGLineVertexBeDroppedEventHandler;
964
+ lineTemplate?: JsonLineLike;
965
+ disableDrop?: boolean;
966
+ disableDrag?: boolean;
967
+ onDragConnectStart?: (newLineTemplate?: JsonLineLike, event?: RGUserEvent) => void;
968
+ onDragConnectEnd?: RGLineConnectEventHandler; // default is true
969
+ className?: string;
970
+ style?: Record<string, string | number | undefined>,
971
+ }
972
+
973
+ /**
974
+ * The <RGWatermark /> component is now deprecated. It is recommended to use a custom background component to achieve watermark effects, as custom background components can provide more flexible watermark effects.
975
+ * @deprecated
976
+ */
977
+ export interface RGWatermarkProps {
978
+ forImage?: boolean,
979
+ forDisplay?: boolean,
980
+ position?: RGWidgetPosition,
981
+ width?: string,
982
+ height?: string
983
+ }
984
+
985
+ /**
986
+ * The <RGBackground /> component is now deprecated. It is recommended to use a custom background component to achieve watermark effects, as custom background components can provide more flexible background effects.
987
+ * @deprecated
988
+ */
989
+ export interface RGBackgroundProps {
990
+ forImage?: boolean,
991
+ forDisplay?: boolean,
992
+ }
993
+
994
+ /**
995
+ * @inner
996
+ */
997
+ export type RGLineTextPosition = {
998
+ x: number;
999
+ y: number;
1000
+ rotate: number;
1001
+ };
1002
+ /**
1003
+ * Configuration parameter type passed in when generating line path and rendering information
1004
+ * @param line The line object or fake line object
1005
+ * @param from The starting object of the line
1006
+ * @param to The ending object of the line
1007
+ * @param totalLinesBetweenNodes Total number of lines between the two nodes (including this line)
1008
+ * @param currentLineIndex The index of the current line among the lines between the two nodes (starting from 0)
1009
+ * @param defaultOptions Global default configuration options for rendering lines
1010
+ */
1011
+ export type RGGenerateLineConfig = {
1012
+ line: RGLine | RGFakeLine,
1013
+ from?: RGLineTarget,
1014
+ to?: RGLineTarget,
1015
+ totalLinesBetweenNodes?: number,
1016
+ currentLineIndex?: number,
1017
+ defaultOptions?: any
1018
+ }
1019
+ /**
1020
+ * English: Callback function type for generating fake line target objects when rendering custom lines
1021
+ * @param targetType When the value is 'node', it represents a normal node; 'RGInnerConnectTargetType.NodePoint' represents a connection point inside a node; 'RGInnerConnectTargetType.CanvasPoint' represents a connection point on the canvas. Generally, these built-in node types will be automatically handled, and the node types that can be handled by RGFakeLineTargetRender are all user-defined types.
1022
+ * @param targetId The id of the connectable object (e.g., node id, RGConnectTarget's targetId)
1023
+ * @param fakeLine The fake line object
1024
+ * @returns Returns the corresponding line target object
1025
+ *
1026
+ */
1027
+ export type RGFakeLineTargetRender = (targetType: string, targetId: string, fakeLine: RGFakeLine) => RGLineTarget;
1028
+ /**
1029
+ * @inner
1030
+ */
1031
+ export type RGGenerateLinePrams = {
1032
+ line: RGLine,
1033
+ totalLinesBetweenNodes: number,
1034
+ currentLineIndex: number,
1035
+ lineDirection: 'v' | 'h',
1036
+ lineShape: RGLineShape,
1037
+ lineRadius: number,
1038
+ fromJunctionPoint: RGJunctionPoint,
1039
+ toJunctionPoint: RGJunctionPoint,
1040
+ fx: number,
1041
+ fy: number,
1042
+ fcx: number,
1043
+ fcy: number,
1044
+ f_W: number,
1045
+ f_H: number,
1046
+ tx: number,
1047
+ ty: number,
1048
+ tcx: number,
1049
+ tcy: number,
1050
+ t_W: number,
1051
+ t_H: number
1052
+ }
1053
+ /**
1054
+ * Line path information generated by relation-graph
1055
+ * @param pathData SVG Path data of the line
1056
+ * @param pathCommands Command point information of the line path
1057
+ * @param textPosition Position and rotation information of the line text
1058
+ * @param points Array of key point coordinates on the line path
1059
+ * @param startDirection Line start direction (only valid for certain line shapes)
1060
+ * @param endDirection Line end direction (only valid for certain line shapes)
1061
+ */
1062
+ export type RGLinePathInfo = {
1063
+ pathData: string;
1064
+ pathCommands: RGLinePathCommands;
1065
+ textPosition: RGLineTextPosition,
1066
+ points: RGCoordinate[],
1067
+ startDirection?: RGDirection,
1068
+ endDirection?: RGDirection,
1069
+ };
1070
+ /**
1071
+ * @inner
1072
+ */
1073
+ export type CalcNode = {
1074
+ rgNode: RGNode;
1075
+ x: number;
1076
+ y: number;
1077
+ width: number;
1078
+ height: number;
1079
+ };
1080
+ /**
1081
+ * @inner
1082
+ */
1083
+ export type WriteableData<T> = {
1084
+ set(this: void, value: T): void;
1085
+ // value(): T;
1086
+ // /**
1087
+ // * Update value using callback and inform subscribers.
1088
+ // * @param updater callback
1089
+ // */
1090
+ // update(this: void, updater: (v: T) => T): void;
1091
+ }
1092
+ /**
1093
+ * @inner
1094
+ */
1095
+ export type ReactiveDataStores = {
1096
+ store4Options: WriteableData<RGOptionsFull>,
1097
+ store4ShouldRenderNodes: WriteableData<RGNode[]>,
1098
+ store4ShouldRenderLines: WriteableData<RGLine[]>,
1099
+ store4ShouldRenderFakeLines: WriteableData<RGFakeLine[]>,
1100
+ optionsRef?: any, // Store Vue reactive data
1101
+ shouldRenderNodesRef?: any, // Store Vue reactive data
1102
+ shouldRenderLinesRef?: any, // Store Vue reactive data
1103
+ shouldRenderFakeLinesRef?: any // Store Vue reactive data
1104
+ }
1105
+ /**
1106
+ * @inner
1107
+ */
1108
+ export type ReactiveDataUpdaters = {
1109
+ updateStore4Options: (newValue: RGOptionsFull) => void,
1110
+ updateStore4ShouldRenderNodes: (newValue: RGNode[]) => void,
1111
+ updateStore4ShouldRenderLines: (newValue: RGLine[]) => void,
1112
+ updateStore4FakeLines: (newValue: RGFakeLine[]) => void,
1113
+ }
1114
+ /**
1115
+ * Reactive data object returned by hooks provided by the relation-graph component:
1116
+ * - information about the line being created (the line being dragged into the canvas)
1117
+ * @param creating Whether a line is being created
1118
+ * @param fromTarget The starting target of the line being created
1119
+ * @param toTarget The ending target of the line being created
1120
+ * @param lineJson The JsonLine information of the line being created
1121
+ */
1122
+ export type RGCreatingLine = {
1123
+ creating: true,
1124
+ fromTarget?: RGLineTarget,
1125
+ toTarget?: RGLineTarget,
1126
+ lineJson?: JsonLine
1127
+ } | {
1128
+ creating: false
1129
+ }
1130
+
1131
+ /**
1132
+ * Reactive data object returned by hooks provided by the relation-graph component:
1133
+ * - information about the node being created (the node being dragged into the canvas)
1134
+ * @param creating Whether a node is being created
1135
+ * @param nodeJson The JsonNode information of the node being created
1136
+ */
1137
+ export type RGCreatingNode = {
1138
+ creating: true,
1139
+ nodeJson?: JsonNode
1140
+ } | {
1141
+ creating: false
1142
+ }
1143
+ /**
1144
+ * Reactive data object returned by hooks provided by the relation-graph component:
1145
+ * - information about the nodes being edited
1146
+ * @param show Whether nodes are currently being edited. If there are nodes being edited, it is true; otherwise, it is false. When true, the <RGEditingNodeController /> component will be displayed.
1147
+ * @param nodes The array of nodes being edited
1148
+ * @param x The X position of the editing box
1149
+ * @param y The Y position of the editing box
1150
+ * @param width The width of the editing box
1151
+ * @param height The height of the editing box
1152
+ */
1153
+ export type RGEditingNodes = {
1154
+ show: boolean,
1155
+ nodes: RGNode[],
1156
+ x: number,
1157
+ y: number,
1158
+ width: number,
1159
+ height: number
1160
+ }
1161
+ /**
1162
+ * Reactive data object returned by hooks provided by the relation-graph component:
1163
+ * - Information about the node being connected when creating a line
1164
+ * @param x The X position of the connecting box
1165
+ * @param y The Y position of the connecting box
1166
+ * @param width The width of the connecting box
1167
+ * @param height The height of the connecting box
1168
+ */
1169
+ export type RGConnectingNode = {
1170
+ show: boolean,
1171
+ node: RGNode | RGLineTarget | RGRectTarget,
1172
+ x: number,
1173
+ y: number,
1174
+ width: number,
1175
+ height: number
1176
+ }
1177
+ /**
1178
+ * Reactive data object returned by hooks provided by the relation-graph component:
1179
+ * - Information about the line being edited
1180
+ * @param show Whether a line is currently being edited. If there is a line being edited, it is true; otherwise, it is false. When true, the <RGEditingLineController /> component will be displayed.
1181
+ * @param line The line being edited
1182
+ * @param startPoint The starting point of the line being edited
1183
+ * @param endPoint The ending point of the line being edited
1184
+ */
1185
+ export type RGEditingLine = {
1186
+ show: boolean,
1187
+ line: RGLine | null,
1188
+ startPoint: RGPosition,
1189
+ endPoint: RGPosition,
1190
+ text: {
1191
+ show: boolean,
1192
+ x: number,
1193
+ y: number,
1194
+ width: number,
1195
+ height: number
1196
+ },
1197
+ ctrlPoints: RGPosition[],
1198
+ selectedLines: string[],
1199
+ line44Splits: RGCtrlPointForLine44[],
1200
+ line49Points: RGPosition[],
1201
+ ctrlPoint1: RGPosition,
1202
+ ctrlPoint2: RGPosition,
1203
+ toolbar: RGPosition
1204
+ }
1205
+ /**
1206
+ * Reactive data object returned by hooks provided by the relation-graph component:
1207
+ * - Current view information
1208
+ * @param viewSize The size of the view area
1209
+ * @param fullscreen Whether it is in fullscreen mode
1210
+ * @param canvasSize The size of the canvas
1211
+ * @param canvasZoom The zoom level of the canvas
1212
+ * @param canvasOffset The offset position of the canvas
1213
+ */
1214
+ export type RGViewInformation = {
1215
+ viewSize: { width: number; height: number },
1216
+ fullscreen: boolean,
1217
+ canvasSize: { width: number; height: number },
1218
+ canvasZoom: number,
1219
+ canvasOffset: { x: number; y: number },
1220
+ showEasyView?: boolean,
1221
+ }
1222
+ /**
1223
+ * Reactive data object returned by hooks provided by the relation-graph component:
1224
+ * - Information about the currently selected node or lines
1225
+ * @param checkedLineId The ID of the selected line
1226
+ * @param checkedNodeId The ID of the selected node
1227
+ * @param draggingNodeId The ID of the node being dragged
1228
+ */
1229
+ export type RGCheckedItem = {
1230
+ checkedLineId?: string;
1231
+ checkedNodeId?: string;
1232
+ draggingNodeId?: string;
1233
+ }
1234
+
1235
+ /**
1236
+ * Enumeration of all event names supported by relation-graph
1237
+ */
1238
+ export enum RGEventNames {
1239
+ onReady = 'onReady',
1240
+ onNodeClick = 'onNodeClick',
1241
+ onNodeExpand = 'onNodeExpand',
1242
+ onNodeCollapse = 'onNodeCollapse',
1243
+ onLineClick = 'onLineClick',
1244
+ onNodeDragStart = 'onNodeDragStart',
1245
+ onNodeDragEnd = 'onNodeDragEnd',
1246
+ onNodeDragging = 'onNodeDragging',
1247
+ onCanvasDragEnd = 'onCanvasDragEnd',
1248
+ onCanvasDragging = 'onCanvasDragging',
1249
+ onContextmenu = 'onContextmenu',
1250
+ onFullscreen = 'onFullscreen',
1251
+ onCanvasClick = 'onCanvasClick',
1252
+ onCanvasSelectionEnd = 'onCanvasSelectionEnd',
1253
+ beforeZoomStart = 'beforeZoomStart',
1254
+ onZoomEnd = 'onZoomEnd',
1255
+ onViewResize = 'onViewResize',
1256
+ onResizeStart = 'onResizeStart',
1257
+ beforeNodeResize = 'beforeNodeResize',
1258
+ onResizeEnd = 'onResizeEnd',
1259
+ onLineVertexDropped = 'onLineVertexDropped',
1260
+ beforeCreateLine = 'beforeCreateLine',
1261
+ onLineBeCreated = 'onLineBeCreated',
1262
+ beforeAddNodes = 'beforeAddNodes',
1263
+ beforeAddLines = 'beforeAddLines',
1264
+ onKeyboardDown = 'onKeyboardDown',
1265
+ onKeyboardUp = 'onKeyboardUp',
1266
+ onCanvasDragStart = 'onCanvasDragStart',
1267
+ onForceLayoutFinish = 'onForceLayoutFinish',
1268
+ beforeScrollStart = 'beforeScrollStart'
1269
+ }
1270
+ /**
1271
+ * All event listener types supported by the relation-graph component
1272
+ */
1273
+ export interface RGListeners {
1274
+ /**
1275
+ * When the graph is ready, this event is triggered
1276
+ * @param graphInstance The relation-graph instance object
1277
+ */
1278
+ onReady?: (graphInstance: RelationGraphInstance) => void;
1279
+ /**
1280
+ * Triggered when a node is clicked
1281
+ */
1282
+ onNodeClick?: (node: RGNode, e: RGUserEvent) => boolean | void | Promise<boolean | void>;
1283
+ /**
1284
+ * Triggered when a node is expanded
1285
+ */
1286
+ onNodeExpand?: (node: RGNode, e: RGUserEvent) => boolean | void | Promise<boolean | void>;
1287
+ /**
1288
+ * Triggered when a node is collapsed
1289
+ */
1290
+ onNodeCollapse?: (node: RGNode, e: RGUserEvent) => boolean | void | Promise<boolean | void>;
1291
+ /**
1292
+ * Triggered when a line is clicked, line is the line, link is the RGLink object corresponding to the line
1293
+ */
1294
+ onLineClick?: (line: RGLine, link: RGLink, e: RGUserEvent) => boolean | void | Promise<boolean | void>;
1295
+ /**
1296
+ * Triggered when a node drag starts
1297
+ * @param node The dragged node
1298
+ */
1299
+ onNodeDragStart?: (node: RGNode, e: RGUserEvent) => void;
1300
+ /**
1301
+ * Triggered when a node drag ends
1302
+ * @param node The dragged node
1303
+ * @param e The event that triggered the drag end
1304
+ * @param x_buff The x offset at the end of the drag
1305
+ * @param y_buff The y offset at the end of the drag
1306
+ *
1307
+ */
1308
+ onNodeDragEnd?: (node: RGNode, e: RGUserEvent, x_buff: number, y_buff: number) => void;
1309
+ /**
1310
+ * Triggered when a node is being dragged
1311
+ * @param node The dragged node
1312
+ * @param newX The new X position of the node
1313
+ * @param newY The new Y position of the node
1314
+ * @param buffX The X offset of the node from the start of the drag to the current position
1315
+ * @param buffY The Y offset of the node from the start of the drag to the current position
1316
+ * @return Can return void, or can return an RGPosition object, indicating that the x and y in the returned RGPosition object are used as the new position of the node
1317
+ */
1318
+ onNodeDragging?: (node: RGNode, newX: number, newY: number, buffX: number, buffY: number, e: RGUserEvent) => void | RGPosition | undefined;
1319
+ /**
1320
+ * Triggered when the canvas drag ends
1321
+ */
1322
+ onCanvasDragEnd?: (e: RGUserEvent) => void;
1323
+ /**
1324
+ * Triggered when the canvas is being dragged
1325
+ * @param newX The new offset X of the canvas
1326
+ * @param newY The new offset Y of the canvas
1327
+ * @param buffX The X offset of the canvas from the start of the drag to the current position
1328
+ * @param buffY The Y offset of the canvas from the start of the drag to the current position
1329
+ * @return Can return void, or can return an RGPosition object, indicating that the x and y in the returned RGPosition object are used as the new offset position of the canvas
1330
+ */
1331
+ onCanvasDragging?: (newX: number, newY: number, buffX: number, buffY: number) => void | RGPosition | undefined;
1332
+ /**
1333
+ * Triggered when the canvas is right-clicked
1334
+ * @param e The event that triggered
1335
+ * @param objectType The type of object, which can be 'canvas', 'node', or 'line'
1336
+ * @param object The clicked object, which can be undefined, RGNode, or RGLine
1337
+ * @param eventPositionOnCanvas The coordinates of the event on the canvas
1338
+ * @param eventPositionOnView The coordinates of the event on the view (relative to the top-left corner of the <RelationGraph> component)
1339
+ */
1340
+ onContextmenu?: (e: RGUserEvent, objectType: RGEventTargetType, object: RGNode | RGLine | undefined, eventPositionOnCanvas: RGCoordinate, eventPositionOnView: RGCoordinate) => void;
1341
+ /**
1342
+ * Triggered when the fullscreen state changes
1343
+ * @param newValue The new fullscreen state
1344
+ * @param defaultFullscreen The function to perform the default fullscreen toggle operation
1345
+ */
1346
+ onFullscreen?: (newValue: boolean, defaultFullscreen: () => Promise<void>) => void;
1347
+ /**
1348
+ * Triggered when the canvas is clicked
1349
+ * - This event will not be triggered when clicking on nodes or lines
1350
+ */
1351
+ onCanvasClick?: (e: RGUserEvent) => void;
1352
+ /**
1353
+ * Triggered when the canvas selection ends
1354
+ * @param selectionView The area information of the canvas selection, including x, y, width, height
1355
+ */
1356
+ onCanvasSelectionEnd?: (selectionView: RGSelectionView, e: RGUserEvent) => void;
1357
+ /**
1358
+ * Triggered before zooming starts
1359
+ * @return Returning false can prevent the zoom operation
1360
+ */
1361
+ beforeZoomStart?: () => void | false;
1362
+ /**
1363
+ * Triggered when zooming ends
1364
+ */
1365
+ onZoomEnd?: () => void;
1366
+ /**
1367
+ * Triggered when the view size changes
1368
+ */
1369
+ onViewResize?: () => void;
1370
+ /**
1371
+ * Triggered when one or more nodes (via RGEditingResize) start being resized
1372
+ * @param nodes The array of nodes being resized
1373
+ */
1374
+ onResizeStart?: (nodes: RGNode[], e: RGUserEvent) => void;
1375
+ /**
1376
+ * Triggered before resizing a node, returning false can prevent the resize operation
1377
+ * @param node The node being resized
1378
+ * @param newX The new X position to be resized to
1379
+ * @param newY The new Y position to be resized to
1380
+ * @param newW The new width to be resized to
1381
+ * @param newH The new height to be resized to
1382
+ * @return Return false to prevent resizing
1383
+ */
1384
+ beforeNodeResize?: (node: RGNode, newX: number, newY: number, newW: number, newH: number) => void | false;
1385
+ /**
1386
+ * Triggered when one or more nodes (via RGEditingResize) finish being resized
1387
+ * @param nodes The array of nodes that were resized
1388
+ * @param buffX The X offset at the end of the resize
1389
+ * @param buffY The Y offset at the end of the resize
1390
+ */
1391
+ onResizeEnd?: (nodes: RGNode[], buffX: number, buffY: number, e: RGUserEvent) => void;
1392
+ /**
1393
+ * Triggered when the endpoint (start or end) of a line is dropped
1394
+ * @param fromNode The starting node
1395
+ * @param toNode The target node
1396
+ * @param lineTemplate The line information (JsonLine)
1397
+ *
1398
+ */
1399
+ onLineVertexDropped?: (lineInfo: {
1400
+ newLineTemplate: JsonLine,
1401
+ fromNode: RGLineTarget | RGNode,
1402
+ toNode: RGLineTarget | RGNode
1403
+ }) => void;
1404
+ /**
1405
+ * Triggered after the line creation or modification endpoint is completed, before onLineBeCreated is triggered. You can return false to prevent the creation of the line, or modify the line information.
1406
+ * @param fromNode The starting node
1407
+ * @param toNode The target node
1408
+ * @param lineTemplate The line information (JsonLine)
1409
+ *
1410
+ */
1411
+ beforeCreateLine?: (lineInfo: {
1412
+ lineJson: JsonLine,
1413
+ fromNode: RGLineTarget | RGNode,
1414
+ toNode: RGLineTarget | RGNode
1415
+ }) => void | false;
1416
+ /**
1417
+ * Triggered when a new line is created or the endpoint is modified
1418
+ * - Note: The process of modifying the endpoints (start or end) of a line is actually to first delete the line, and then create a new line with the same id (all other attributes of the line will be retained) through the onLineBeCreated event.
1419
+ * - Please be sure to add the new line to the graph through the graphInstance.addLines method in the onLineBeCreated event, otherwise the line will not actually be created.
1420
+ * @param fromNode The starting node
1421
+ * @param toNode The target node
1422
+ * @param lineTemplate The line information (JsonLine)
1423
+ */
1424
+ onLineBeCreated?: (lineInfo: {
1425
+ lineJson: JsonLine,
1426
+ fromNode: RGLineTarget | RGNode,
1427
+ toNode: RGLineTarget | RGNode
1428
+ }) => void;
1429
+ /**
1430
+ * Triggered before new nodes are added (via setJsonData, addNodes methods) to the graph
1431
+ * @param nodes The array of jsonNode objects that are about to be added
1432
+ */
1433
+ beforeAddNodes?: (nodes: JsonNode[]) => void;
1434
+ /**
1435
+ * Triggered before new lines are added (via setJsonData, addLines methods) to the graph
1436
+ * @param lines The array of jsonLine objects that are about to be added
1437
+ */
1438
+ beforeAddLines?: (lines: JsonLine[]) => void;
1439
+ /**
1440
+ * Triggered when the keyboard is pressed down in the graph area
1441
+ * @param e
1442
+ */
1443
+ onKeyboardDown?: (e: KeyboardEvent) => void;
1444
+ /**
1445
+ * Triggered when the keyboard is released in the graph area
1446
+ * @param e
1447
+ */
1448
+ onKeyboardUp?: (e: KeyboardEvent) => void;
1449
+ /**
1450
+ * Triggered when canvas drag starts
1451
+ * @param canvasMoveStartPosition The initial position of the canvas when dragging starts
1452
+ * @param eventClientStartPosition The client position of the user event when it starts
1453
+ * @param e
1454
+ */
1455
+ onCanvasDragStart?: (canvasMoveStartPosition: RGPosition, eventClientStartPosition: RGPosition, e: RGUserEvent) => void;
1456
+ /**
1457
+ * Triggered when the force-directed layout calculation is completed
1458
+ */
1459
+ onForceLayoutFinish?: () => void;
1460
+ /**
1461
+ * Triggered before performing canvas move scroll, returning true indicates to prevent the scroll from continuing
1462
+ * @param buffX The X offset that is about to be scrolled
1463
+ * @param buffY The Y offset that is about to be scrolled
1464
+ * @return true = Abort Scroll
1465
+ */
1466
+ beforeScrollStart?: (buffX: number, buffY: number, e: Event) => true | undefined | void;
1467
+ }