@reltio/components 1.4.1844 → 1.4.1845

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 (305) hide show
  1. package/cjs/EmptyState/EmptyState.d.ts +1 -0
  2. package/cjs/EmptyState/EmptyState.js +3 -1
  3. package/cjs/features/graph/DataModelGraph/DataModelGraph.d.ts +12 -0
  4. package/cjs/features/graph/DataModelGraph/DataModelGraph.js +28 -0
  5. package/cjs/features/graph/DataModelGraph/DataModelGraph.test.d.ts +1 -0
  6. package/cjs/features/graph/DataModelGraph/DataModelGraph.test.js +63 -0
  7. package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.d.ts +11 -0
  8. package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.js +21 -0
  9. package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.d.ts +9 -0
  10. package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.js +38 -0
  11. package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.d.ts +1 -0
  12. package/cjs/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.js +74 -0
  13. package/cjs/features/graph/DataModelGraph/hooks/defaultGraph.test-data.d.ts +2 -0
  14. package/cjs/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +52 -0
  15. package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +17 -0
  16. package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +139 -0
  17. package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.d.ts +1 -0
  18. package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +192 -0
  19. package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.d.ts +10 -0
  20. package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +171 -0
  21. package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.d.ts +1 -0
  22. package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +176 -0
  23. package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.d.ts +8 -0
  24. package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.js +36 -0
  25. package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.d.ts +1 -0
  26. package/cjs/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +37 -0
  27. package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.d.ts +2 -0
  28. package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.js +41 -0
  29. package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.d.ts +1 -0
  30. package/cjs/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +63 -0
  31. package/cjs/features/graph/DataModelGraph/icons/interaction.inline.svg.d.ts +1 -0
  32. package/cjs/features/graph/DataModelGraph/icons/interaction.inline.svg.js +4 -0
  33. package/cjs/features/graph/DataModelGraph/index.d.ts +1 -0
  34. package/cjs/features/graph/DataModelGraph/index.js +5 -0
  35. package/cjs/features/graph/DataModelGraph/styles.d.ts +1 -0
  36. package/cjs/features/graph/DataModelGraph/styles.js +26 -0
  37. package/cjs/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.d.ts +6 -0
  38. package/cjs/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.js +15 -0
  39. package/cjs/features/graph/SigmaCustomRenderersContainer/index.d.ts +1 -0
  40. package/cjs/features/graph/SigmaCustomRenderersContainer/index.js +5 -0
  41. package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.d.ts +9 -0
  42. package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.js +86 -0
  43. package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.d.ts +1 -0
  44. package/cjs/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.js +26 -0
  45. package/cjs/features/graph/SigmaGraphContainer/index.d.ts +1 -0
  46. package/cjs/features/graph/SigmaGraphContainer/index.js +5 -0
  47. package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.d.ts +1 -0
  48. package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.js +40 -0
  49. package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.d.ts +1 -0
  50. package/cjs/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.js +37 -0
  51. package/cjs/features/graph/SigmaGraphResizer/index.d.ts +1 -0
  52. package/cjs/features/graph/SigmaGraphResizer/index.js +5 -0
  53. package/cjs/features/graph/ZoomSlider/ZoomSlider.d.ts +7 -0
  54. package/cjs/features/graph/ZoomSlider/ZoomSlider.js +113 -0
  55. package/cjs/features/graph/ZoomSlider/ZoomSlider.test.d.ts +1 -0
  56. package/cjs/features/graph/ZoomSlider/ZoomSlider.test.js +83 -0
  57. package/cjs/features/graph/ZoomSlider/index.d.ts +1 -0
  58. package/cjs/features/graph/ZoomSlider/index.js +5 -0
  59. package/cjs/features/graph/ZoomSlider/styles.d.ts +1 -0
  60. package/cjs/features/graph/ZoomSlider/styles.js +63 -0
  61. package/cjs/features/graph/contexts/SigmaCustomRenderersContext.d.ts +9 -0
  62. package/cjs/features/graph/contexts/SigmaCustomRenderersContext.js +15 -0
  63. package/cjs/features/graph/hooks/useAnimatedGraphLayout.d.ts +13 -0
  64. package/cjs/features/graph/hooks/useAnimatedGraphLayout.js +35 -0
  65. package/cjs/features/graph/hooks/useCircleLayout.d.ts +9 -0
  66. package/cjs/features/graph/hooks/useCircleLayout.js +50 -0
  67. package/cjs/features/graph/hooks/useLoopRenderer.d.ts +5 -0
  68. package/cjs/features/graph/hooks/useLoopRenderer.js +47 -0
  69. package/cjs/features/graph/hooks/useLoopRenderer.test.d.ts +1 -0
  70. package/cjs/features/graph/hooks/useLoopRenderer.test.js +221 -0
  71. package/cjs/features/graph/hooks/useSigmaCustomRenderers.d.ts +7 -0
  72. package/cjs/features/graph/hooks/useSigmaCustomRenderers.js +95 -0
  73. package/cjs/features/graph/hooks/useSigmaCustomRenderers.test.d.ts +1 -0
  74. package/cjs/features/graph/hooks/useSigmaCustomRenderers.test.js +200 -0
  75. package/cjs/features/graph/index.d.ts +16 -0
  76. package/cjs/features/graph/index.js +34 -0
  77. package/cjs/features/graph/rendering/canvas/hover.d.ts +2 -0
  78. package/cjs/features/graph/rendering/canvas/hover.js +10 -0
  79. package/cjs/features/graph/rendering/canvas/hover.spec.d.ts +1 -0
  80. package/cjs/features/graph/rendering/canvas/hover.spec.js +26 -0
  81. package/cjs/features/graph/rendering/canvas/label.d.ts +7 -0
  82. package/cjs/features/graph/rendering/canvas/label.js +32 -0
  83. package/cjs/features/graph/rendering/canvas/label.spec.d.ts +1 -0
  84. package/cjs/features/graph/rendering/canvas/label.spec.js +81 -0
  85. package/cjs/features/graph/rendering/canvas/labelBackground.d.ts +9 -0
  86. package/cjs/features/graph/rendering/canvas/labelBackground.js +37 -0
  87. package/cjs/features/graph/rendering/canvas/labelBackground.spec.d.ts +1 -0
  88. package/cjs/features/graph/rendering/canvas/labelBackground.spec.js +92 -0
  89. package/cjs/features/graph/rendering/canvas/nodeArc.d.ts +10 -0
  90. package/cjs/features/graph/rendering/canvas/nodeArc.js +33 -0
  91. package/cjs/features/graph/rendering/canvas/selfRelationLoop.d.ts +11 -0
  92. package/cjs/features/graph/rendering/canvas/selfRelationLoop.js +73 -0
  93. package/cjs/features/graph/rendering/canvas/selfRelationLoop.spec.d.ts +1 -0
  94. package/cjs/features/graph/rendering/canvas/selfRelationLoop.spec.js +92 -0
  95. package/cjs/features/graph/rendering/canvas/tooltip.d.ts +2 -0
  96. package/cjs/features/graph/rendering/canvas/tooltip.js +28 -0
  97. package/cjs/features/graph/rendering/canvas/tooltip.spec.d.ts +1 -0
  98. package/cjs/features/graph/rendering/canvas/tooltip.spec.js +32 -0
  99. package/cjs/features/graph/rendering/canvas/utils.d.ts +4 -0
  100. package/cjs/features/graph/rendering/canvas/utils.js +10 -0
  101. package/cjs/features/graph/rendering/canvas/utils.spec.d.ts +1 -0
  102. package/cjs/features/graph/rendering/canvas/utils.spec.js +22 -0
  103. package/cjs/features/graph/rendering/icons/no_photo.inline.svg.d.ts +1 -0
  104. package/cjs/features/graph/rendering/icons/no_photo.inline.svg.js +4 -0
  105. package/cjs/features/graph/rendering/webgl/edge.arrowHead.d.ts +8 -0
  106. package/cjs/features/graph/rendering/webgl/edge.arrowHead.js +84 -0
  107. package/cjs/features/graph/rendering/webgl/edge.clamped.d.ts +29 -0
  108. package/cjs/features/graph/rendering/webgl/edge.clamped.js +176 -0
  109. package/cjs/features/graph/rendering/webgl/edge.dashed.d.ts +23 -0
  110. package/cjs/features/graph/rendering/webgl/edge.dashed.js +162 -0
  111. package/cjs/features/graph/rendering/webgl/edge.reversedArrowHead.d.ts +5 -0
  112. package/cjs/features/graph/rendering/webgl/edge.reversedArrowHead.js +32 -0
  113. package/cjs/features/graph/rendering/webgl/helpers/imageHelper.d.ts +17 -0
  114. package/cjs/features/graph/rendering/webgl/helpers/imageHelper.js +9 -0
  115. package/cjs/features/graph/rendering/webgl/helpers/imageHelper.spec.d.ts +1 -0
  116. package/cjs/features/graph/rendering/webgl/helpers/imageHelper.spec.js +29 -0
  117. package/cjs/features/graph/rendering/webgl/image.d.ts +17 -0
  118. package/cjs/features/graph/rendering/webgl/image.js +115 -0
  119. package/cjs/features/graph/rendering/webgl/node.border.d.ts +11 -0
  120. package/cjs/features/graph/rendering/webgl/node.border.js +79 -0
  121. package/cjs/features/graph/rendering/webgl/node.dashed.border.d.ts +11 -0
  122. package/cjs/features/graph/rendering/webgl/node.dashed.border.js +77 -0
  123. package/cjs/features/graph/rendering/webgl/node.image.d.ts +18 -0
  124. package/cjs/features/graph/rendering/webgl/node.image.js +147 -0
  125. package/cjs/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.d.ts +1 -0
  126. package/cjs/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.js +8 -0
  127. package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.d.ts +1 -0
  128. package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.js +8 -0
  129. package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.d.ts +1 -0
  130. package/cjs/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.js +8 -0
  131. package/cjs/features/graph/rendering/webgl/shaders/node.border.frag.glsl.d.ts +1 -0
  132. package/cjs/features/graph/rendering/webgl/shaders/node.border.frag.glsl.js +9 -0
  133. package/cjs/features/graph/rendering/webgl/shaders/node.border.vert.glsl.d.ts +1 -0
  134. package/cjs/features/graph/rendering/webgl/shaders/node.border.vert.glsl.js +8 -0
  135. package/cjs/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.d.ts +1 -0
  136. package/cjs/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.js +8 -0
  137. package/cjs/features/graph/rendering/webgl/shaders/node.image.frag.glsl.d.ts +1 -0
  138. package/cjs/features/graph/rendering/webgl/shaders/node.image.frag.glsl.js +5 -0
  139. package/cjs/features/graph/rendering/webgl/shaders/node.image.vert.glsl.d.ts +1 -0
  140. package/cjs/features/graph/rendering/webgl/shaders/node.image.vert.glsl.js +8 -0
  141. package/cjs/features/graph/rendering/webgl/shaders/utils.d.ts +1 -0
  142. package/cjs/features/graph/rendering/webgl/shaders/utils.js +4 -0
  143. package/cjs/features/graph/types/graphDataTypes.d.ts +51 -0
  144. package/cjs/features/graph/types/graphDataTypes.js +8 -0
  145. package/cjs/features/graph/types/sigmaCustomRenderersTypes.d.ts +11 -0
  146. package/cjs/features/graph/types/sigmaCustomRenderersTypes.js +2 -0
  147. package/cjs/icons/EmptyLoading.d.ts +3 -0
  148. package/cjs/icons/EmptyLoading.js +150 -0
  149. package/cjs/icons/index.d.ts +1 -0
  150. package/cjs/icons/index.js +4 -2
  151. package/cjs/index.d.ts +1 -0
  152. package/cjs/index.js +2 -0
  153. package/esm/EmptyState/EmptyState.d.ts +1 -0
  154. package/esm/EmptyState/EmptyState.js +3 -1
  155. package/esm/features/graph/DataModelGraph/DataModelGraph.d.ts +12 -0
  156. package/esm/features/graph/DataModelGraph/DataModelGraph.js +21 -0
  157. package/esm/features/graph/DataModelGraph/DataModelGraph.test.d.ts +1 -0
  158. package/esm/features/graph/DataModelGraph/DataModelGraph.test.js +58 -0
  159. package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.d.ts +11 -0
  160. package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/DataModelCircleLayuot.js +17 -0
  161. package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.d.ts +9 -0
  162. package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.js +33 -0
  163. package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.d.ts +1 -0
  164. package/esm/features/graph/DataModelGraph/helpers/edgeLabelHelpers.test.js +72 -0
  165. package/esm/features/graph/DataModelGraph/hooks/defaultGraph.test-data.d.ts +2 -0
  166. package/esm/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +45 -0
  167. package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +17 -0
  168. package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +135 -0
  169. package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.d.ts +1 -0
  170. package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +190 -0
  171. package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.d.ts +10 -0
  172. package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +167 -0
  173. package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.d.ts +1 -0
  174. package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +174 -0
  175. package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.d.ts +8 -0
  176. package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.js +32 -0
  177. package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.d.ts +1 -0
  178. package/esm/features/graph/DataModelGraph/hooks/useFakeCenterNode.test.js +35 -0
  179. package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.d.ts +2 -0
  180. package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.js +37 -0
  181. package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.d.ts +1 -0
  182. package/esm/features/graph/DataModelGraph/hooks/useSelectedNodeRenderer.test.js +61 -0
  183. package/esm/features/graph/DataModelGraph/icons/interaction.inline.svg.d.ts +1 -0
  184. package/esm/features/graph/DataModelGraph/icons/interaction.inline.svg.js +1 -0
  185. package/esm/features/graph/DataModelGraph/index.d.ts +1 -0
  186. package/esm/features/graph/DataModelGraph/index.js +1 -0
  187. package/esm/features/graph/DataModelGraph/styles.d.ts +1 -0
  188. package/esm/features/graph/DataModelGraph/styles.js +23 -0
  189. package/esm/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.d.ts +6 -0
  190. package/esm/features/graph/SigmaCustomRenderersContainer/SigmaCustomRenderersContainer.js +8 -0
  191. package/esm/features/graph/SigmaCustomRenderersContainer/index.d.ts +1 -0
  192. package/esm/features/graph/SigmaCustomRenderersContainer/index.js +1 -0
  193. package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.d.ts +9 -0
  194. package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.js +56 -0
  195. package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.d.ts +1 -0
  196. package/esm/features/graph/SigmaGraphContainer/SigmaGraphContainer.test.js +21 -0
  197. package/esm/features/graph/SigmaGraphContainer/index.d.ts +1 -0
  198. package/esm/features/graph/SigmaGraphContainer/index.js +1 -0
  199. package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.d.ts +1 -0
  200. package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.js +10 -0
  201. package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.d.ts +1 -0
  202. package/esm/features/graph/SigmaGraphResizer/SigmaGraphResizer.test.js +32 -0
  203. package/esm/features/graph/SigmaGraphResizer/index.d.ts +1 -0
  204. package/esm/features/graph/SigmaGraphResizer/index.js +1 -0
  205. package/esm/features/graph/ZoomSlider/ZoomSlider.d.ts +7 -0
  206. package/esm/features/graph/ZoomSlider/ZoomSlider.js +83 -0
  207. package/esm/features/graph/ZoomSlider/ZoomSlider.test.d.ts +1 -0
  208. package/esm/features/graph/ZoomSlider/ZoomSlider.test.js +78 -0
  209. package/esm/features/graph/ZoomSlider/index.d.ts +1 -0
  210. package/esm/features/graph/ZoomSlider/index.js +1 -0
  211. package/esm/features/graph/ZoomSlider/styles.d.ts +1 -0
  212. package/esm/features/graph/ZoomSlider/styles.js +60 -0
  213. package/esm/features/graph/contexts/SigmaCustomRenderersContext.d.ts +9 -0
  214. package/esm/features/graph/contexts/SigmaCustomRenderersContext.js +11 -0
  215. package/esm/features/graph/hooks/useAnimatedGraphLayout.d.ts +13 -0
  216. package/esm/features/graph/hooks/useAnimatedGraphLayout.js +31 -0
  217. package/esm/features/graph/hooks/useCircleLayout.d.ts +9 -0
  218. package/esm/features/graph/hooks/useCircleLayout.js +43 -0
  219. package/esm/features/graph/hooks/useLoopRenderer.d.ts +5 -0
  220. package/esm/features/graph/hooks/useLoopRenderer.js +43 -0
  221. package/esm/features/graph/hooks/useLoopRenderer.test.d.ts +1 -0
  222. package/esm/features/graph/hooks/useLoopRenderer.test.js +219 -0
  223. package/esm/features/graph/hooks/useSigmaCustomRenderers.d.ts +7 -0
  224. package/esm/features/graph/hooks/useSigmaCustomRenderers.js +91 -0
  225. package/esm/features/graph/hooks/useSigmaCustomRenderers.test.d.ts +1 -0
  226. package/esm/features/graph/hooks/useSigmaCustomRenderers.test.js +198 -0
  227. package/esm/features/graph/index.d.ts +16 -0
  228. package/esm/features/graph/index.js +17 -0
  229. package/esm/features/graph/rendering/canvas/hover.d.ts +2 -0
  230. package/esm/features/graph/rendering/canvas/hover.js +6 -0
  231. package/esm/features/graph/rendering/canvas/hover.spec.d.ts +1 -0
  232. package/esm/features/graph/rendering/canvas/hover.spec.js +24 -0
  233. package/esm/features/graph/rendering/canvas/label.d.ts +7 -0
  234. package/esm/features/graph/rendering/canvas/label.js +28 -0
  235. package/esm/features/graph/rendering/canvas/label.spec.d.ts +1 -0
  236. package/esm/features/graph/rendering/canvas/label.spec.js +79 -0
  237. package/esm/features/graph/rendering/canvas/labelBackground.d.ts +9 -0
  238. package/esm/features/graph/rendering/canvas/labelBackground.js +33 -0
  239. package/esm/features/graph/rendering/canvas/labelBackground.spec.d.ts +1 -0
  240. package/esm/features/graph/rendering/canvas/labelBackground.spec.js +90 -0
  241. package/esm/features/graph/rendering/canvas/nodeArc.d.ts +10 -0
  242. package/esm/features/graph/rendering/canvas/nodeArc.js +27 -0
  243. package/esm/features/graph/rendering/canvas/selfRelationLoop.d.ts +11 -0
  244. package/esm/features/graph/rendering/canvas/selfRelationLoop.js +69 -0
  245. package/esm/features/graph/rendering/canvas/selfRelationLoop.spec.d.ts +1 -0
  246. package/esm/features/graph/rendering/canvas/selfRelationLoop.spec.js +90 -0
  247. package/esm/features/graph/rendering/canvas/tooltip.d.ts +2 -0
  248. package/esm/features/graph/rendering/canvas/tooltip.js +25 -0
  249. package/esm/features/graph/rendering/canvas/tooltip.spec.d.ts +1 -0
  250. package/esm/features/graph/rendering/canvas/tooltip.spec.js +30 -0
  251. package/esm/features/graph/rendering/canvas/utils.d.ts +4 -0
  252. package/esm/features/graph/rendering/canvas/utils.js +6 -0
  253. package/esm/features/graph/rendering/canvas/utils.spec.d.ts +1 -0
  254. package/esm/features/graph/rendering/canvas/utils.spec.js +20 -0
  255. package/esm/features/graph/rendering/icons/no_photo.inline.svg.d.ts +1 -0
  256. package/esm/features/graph/rendering/icons/no_photo.inline.svg.js +1 -0
  257. package/esm/features/graph/rendering/webgl/edge.arrowHead.d.ts +8 -0
  258. package/esm/features/graph/rendering/webgl/edge.arrowHead.js +79 -0
  259. package/esm/features/graph/rendering/webgl/edge.clamped.d.ts +29 -0
  260. package/esm/features/graph/rendering/webgl/edge.clamped.js +171 -0
  261. package/esm/features/graph/rendering/webgl/edge.dashed.d.ts +23 -0
  262. package/esm/features/graph/rendering/webgl/edge.dashed.js +160 -0
  263. package/esm/features/graph/rendering/webgl/edge.reversedArrowHead.d.ts +5 -0
  264. package/esm/features/graph/rendering/webgl/edge.reversedArrowHead.js +27 -0
  265. package/esm/features/graph/rendering/webgl/helpers/imageHelper.d.ts +17 -0
  266. package/esm/features/graph/rendering/webgl/helpers/imageHelper.js +5 -0
  267. package/esm/features/graph/rendering/webgl/helpers/imageHelper.spec.d.ts +1 -0
  268. package/esm/features/graph/rendering/webgl/helpers/imageHelper.spec.js +27 -0
  269. package/esm/features/graph/rendering/webgl/image.d.ts +17 -0
  270. package/esm/features/graph/rendering/webgl/image.js +112 -0
  271. package/esm/features/graph/rendering/webgl/node.border.d.ts +11 -0
  272. package/esm/features/graph/rendering/webgl/node.border.js +76 -0
  273. package/esm/features/graph/rendering/webgl/node.dashed.border.d.ts +11 -0
  274. package/esm/features/graph/rendering/webgl/node.dashed.border.js +74 -0
  275. package/esm/features/graph/rendering/webgl/node.image.d.ts +18 -0
  276. package/esm/features/graph/rendering/webgl/node.image.js +144 -0
  277. package/esm/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.d.ts +1 -0
  278. package/esm/features/graph/rendering/webgl/shaders/edge.clamped.vert.glsl.js +5 -0
  279. package/esm/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.d.ts +1 -0
  280. package/esm/features/graph/rendering/webgl/shaders/edge.dashed.frag.glsl.js +5 -0
  281. package/esm/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.d.ts +1 -0
  282. package/esm/features/graph/rendering/webgl/shaders/edge.dashed.vert.glsl.js +5 -0
  283. package/esm/features/graph/rendering/webgl/shaders/node.border.frag.glsl.d.ts +1 -0
  284. package/esm/features/graph/rendering/webgl/shaders/node.border.frag.glsl.js +6 -0
  285. package/esm/features/graph/rendering/webgl/shaders/node.border.vert.glsl.d.ts +1 -0
  286. package/esm/features/graph/rendering/webgl/shaders/node.border.vert.glsl.js +5 -0
  287. package/esm/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.d.ts +1 -0
  288. package/esm/features/graph/rendering/webgl/shaders/node.dashed.border.frag.glsl.js +5 -0
  289. package/esm/features/graph/rendering/webgl/shaders/node.image.frag.glsl.d.ts +1 -0
  290. package/esm/features/graph/rendering/webgl/shaders/node.image.frag.glsl.js +2 -0
  291. package/esm/features/graph/rendering/webgl/shaders/node.image.vert.glsl.d.ts +1 -0
  292. package/esm/features/graph/rendering/webgl/shaders/node.image.vert.glsl.js +5 -0
  293. package/esm/features/graph/rendering/webgl/shaders/utils.d.ts +1 -0
  294. package/esm/features/graph/rendering/webgl/shaders/utils.js +1 -0
  295. package/esm/features/graph/types/graphDataTypes.d.ts +51 -0
  296. package/esm/features/graph/types/graphDataTypes.js +5 -0
  297. package/esm/features/graph/types/sigmaCustomRenderersTypes.d.ts +11 -0
  298. package/esm/features/graph/types/sigmaCustomRenderersTypes.js +1 -0
  299. package/esm/icons/EmptyLoading.d.ts +3 -0
  300. package/esm/icons/EmptyLoading.js +145 -0
  301. package/esm/icons/index.d.ts +1 -0
  302. package/esm/icons/index.js +1 -0
  303. package/esm/index.d.ts +1 -0
  304. package/esm/index.js +2 -0
  305. package/package.json +2 -2
@@ -0,0 +1,24 @@
1
+ import { drawHover } from './hover';
2
+ import { drawLabel } from './label';
3
+ import { drawTwoArcs } from './nodeArc';
4
+ jest.mock('./label', function () { return ({
5
+ drawLabel: jest.fn()
6
+ }); });
7
+ jest.mock('./nodeArc', function () { return ({
8
+ drawTwoArcs: jest.fn()
9
+ }); });
10
+ describe('drawHover tests', function () {
11
+ var context = {};
12
+ var settings = {};
13
+ var data = {
14
+ x: 1,
15
+ y: 1,
16
+ size: 12,
17
+ label: 'Test label'
18
+ };
19
+ it('should call drawTwoArcs and drawLabel', function () {
20
+ drawHover(context, data, settings);
21
+ expect(drawTwoArcs).toHaveBeenCalledWith(context, data);
22
+ expect(drawLabel).toHaveBeenCalledWith(context, data, settings, { backgroundColor: '#FFF' });
23
+ });
24
+ });
@@ -0,0 +1,7 @@
1
+ import { GraphContainerSettings, GraphNodeAttributes } from '../../types/graphDataTypes';
2
+ type Options = {
3
+ backgroundColor?: string;
4
+ borderColor?: string;
5
+ };
6
+ export declare const drawLabel: (context: CanvasRenderingContext2D, data: Pick<GraphNodeAttributes, 'x' | 'y' | 'size' | 'label' | 'selected' | 'labelColor' | 'secondaryLabel'>, settings: GraphContainerSettings, { backgroundColor, borderColor }?: Options) => Path2D;
7
+ export {};
@@ -0,0 +1,28 @@
1
+ import { drawLabelBackground } from './labelBackground';
2
+ export var drawLabel = function (context, data, settings, _a) {
3
+ var _b, _c, _d, _e;
4
+ var _f = _a === void 0 ? {} : _a, backgroundColor = _f.backgroundColor, borderColor = _f.borderColor;
5
+ if (!data.label)
6
+ return;
7
+ var size = settings.labelSize, font = settings.labelFont, weight = settings.labelWeight, marginLeft = data.selected ? 6 : 2, lineHeight = size * 1.2;
8
+ var PERMANENT_MARGIN_LEFT = 9;
9
+ var labelBackgroundPath = drawLabelBackground(context, data, settings, {
10
+ backgroundColor: data.selected ? '#FFF' : backgroundColor,
11
+ marginLeft: marginLeft,
12
+ borderColor: borderColor,
13
+ lineHeight: lineHeight
14
+ });
15
+ context.fillStyle = ((_b = settings.labelColor) === null || _b === void 0 ? void 0 : _b.attribute)
16
+ ? data[settings.labelColor.attribute] || settings.labelColor.color || '#000'
17
+ : settings.labelColor.color;
18
+ context.font = "".concat(weight, " ").concat(size, "px ").concat(font);
19
+ var y = data.secondaryLabel ? data.y - size / (3 * 1.25) : data.y + size / 3;
20
+ context.fillText(data.label, data.x + data.size + PERMANENT_MARGIN_LEFT + marginLeft, y);
21
+ if (data.secondaryLabel) {
22
+ context.fillStyle = ((_c = settings.secondaryLabelColor) === null || _c === void 0 ? void 0 : _c.attribute)
23
+ ? data[settings.secondaryLabelColor.attribute] || ((_d = settings.secondaryLabelColor) === null || _d === void 0 ? void 0 : _d.color) || '#000'
24
+ : (_e = settings.secondaryLabelColor) === null || _e === void 0 ? void 0 : _e.color;
25
+ context.fillText(data.secondaryLabel, data.x + data.size + PERMANENT_MARGIN_LEFT + marginLeft, y + lineHeight);
26
+ }
27
+ return labelBackgroundPath;
28
+ };
@@ -0,0 +1,79 @@
1
+ import { drawLabel } from './label';
2
+ import { drawLabelBackground } from './labelBackground';
3
+ jest.mock('./labelBackground', function () { return ({
4
+ drawLabelBackground: jest.fn()
5
+ }); });
6
+ describe('drawLabel tests', function () {
7
+ var context = {
8
+ fillText: jest.fn()
9
+ };
10
+ var settings = {
11
+ labelFont: 'Roboto',
12
+ labelSize: 12,
13
+ labelColor: {
14
+ color: 'rgba(0, 0, 0, 0.87)'
15
+ },
16
+ labelWeight: 'normal'
17
+ };
18
+ afterEach(function () {
19
+ jest.clearAllMocks();
20
+ });
21
+ it('should not call context.fillText if label is empty', function () {
22
+ var data = {
23
+ x: 1,
24
+ y: 1,
25
+ size: 12,
26
+ label: ''
27
+ };
28
+ drawLabel(context, data, settings);
29
+ expect(context.fillText).not.toHaveBeenCalled();
30
+ expect(drawLabelBackground).not.toHaveBeenCalled();
31
+ });
32
+ it('should call context.fillText if label is not empty', function () {
33
+ var data = {
34
+ x: 1,
35
+ y: 1,
36
+ size: 12,
37
+ label: 'Test label'
38
+ };
39
+ drawLabel(context, data, settings);
40
+ expect(context.font).toBe('normal 12px Roboto');
41
+ expect(context.fillStyle).toBe(settings.labelColor.color);
42
+ expect(context.fillText).toHaveBeenCalledWith(data.label, 24, 5);
43
+ expect(drawLabelBackground).toHaveBeenCalledWith(context, data, settings, {
44
+ marginLeft: 2,
45
+ lineHeight: settings.labelSize * 1.2
46
+ });
47
+ });
48
+ it('should call drawLabelBackground to show background with specified color', function () {
49
+ var data = {
50
+ x: 1,
51
+ y: 1,
52
+ size: 12,
53
+ label: 'Test label'
54
+ };
55
+ drawLabel(context, data, settings, { backgroundColor: '#FFF' });
56
+ expect(drawLabelBackground).toHaveBeenCalledWith(context, data, settings, {
57
+ backgroundColor: '#FFF',
58
+ marginLeft: 2,
59
+ lineHeight: settings.labelSize * 1.2
60
+ });
61
+ expect(context.fillText).toHaveBeenCalledWith(data.label, 24, 5);
62
+ });
63
+ it('should call drawLabelBackground with special background and margin in selected state', function () {
64
+ var data = {
65
+ x: 1,
66
+ y: 1,
67
+ size: 12,
68
+ label: 'Test label',
69
+ selected: true
70
+ };
71
+ drawLabel(context, data, settings);
72
+ expect(drawLabelBackground).toHaveBeenCalledWith(context, data, settings, {
73
+ backgroundColor: '#FFF',
74
+ marginLeft: 6,
75
+ lineHeight: settings.labelSize * 1.2
76
+ });
77
+ expect(context.fillText).toHaveBeenCalledWith(data.label, 28, 5);
78
+ });
79
+ });
@@ -0,0 +1,9 @@
1
+ import { GraphContainerSettings, GraphNodeAttributes } from '../../types/graphDataTypes';
2
+ type Options = {
3
+ backgroundColor?: string;
4
+ marginLeft?: number;
5
+ lineHeight?: number;
6
+ borderColor?: string;
7
+ };
8
+ export declare const drawLabelBackground: (context: CanvasRenderingContext2D, data: Pick<GraphNodeAttributes, 'x' | 'y' | 'size' | 'label' | 'secondaryLabel'>, settings: GraphContainerSettings, { backgroundColor, marginLeft, borderColor, lineHeight }?: Options) => Path2D;
9
+ export {};
@@ -0,0 +1,33 @@
1
+ var PADDING = 2;
2
+ export var drawLabelBackground = function (context, data, settings, _a) {
3
+ var _b = _a === void 0 ? {} : _a, _c = _b.backgroundColor, backgroundColor = _c === void 0 ? 'rgba(245, 245, 245, 0.9)' : _c, _d = _b.marginLeft, marginLeft = _d === void 0 ? 2 : _d, borderColor = _b.borderColor, lineHeight = _b.lineHeight;
4
+ context.fillStyle = backgroundColor;
5
+ if (borderColor) {
6
+ context.strokeStyle = borderColor;
7
+ }
8
+ var path = new Path2D();
9
+ if (typeof data.label === 'string') {
10
+ var secondLineHeight = data.secondaryLabel ? lineHeight : 0;
11
+ var size = settings.labelSize + secondLineHeight + 2;
12
+ var borderRadius = 2;
13
+ var textWidth = Math.max(context.measureText(data.label).width, context.measureText(data.secondaryLabel || '').width), boxWidth = Math.round(textWidth + 14), boxHeight = Math.round(size + 2 * PADDING), radius = data.size + PADDING;
14
+ var top_1 = data.y - boxHeight / 2;
15
+ var bottom = data.y + boxHeight / 2;
16
+ var left = data.x + radius + marginLeft;
17
+ var right = left + boxWidth;
18
+ path.moveTo(left, bottom - borderRadius);
19
+ path.quadraticCurveTo(left, bottom, left + borderRadius, bottom);
20
+ path.lineTo(right - borderRadius, bottom);
21
+ path.quadraticCurveTo(right, bottom, right, bottom - borderRadius);
22
+ path.lineTo(right, top_1 + borderRadius);
23
+ path.quadraticCurveTo(right, top_1, right - borderRadius, top_1);
24
+ path.lineTo(left + borderRadius, top_1);
25
+ path.quadraticCurveTo(left, top_1, left, top_1 + borderRadius);
26
+ path.closePath();
27
+ context.fill(path);
28
+ if (borderColor) {
29
+ context.stroke(path);
30
+ }
31
+ }
32
+ return path;
33
+ };
@@ -0,0 +1,90 @@
1
+ import { drawLabelBackground } from './labelBackground';
2
+ describe('drawLabelBackground tests', function () {
3
+ var context = {
4
+ beginPath: jest.fn(),
5
+ moveTo: jest.fn(),
6
+ lineTo: jest.fn(),
7
+ arc: jest.fn(),
8
+ closePath: jest.fn(),
9
+ fill: jest.fn(),
10
+ measureText: jest.fn().mockReturnValue({
11
+ width: 100
12
+ }),
13
+ fillText: jest.fn(),
14
+ quadraticCurveTo: jest.fn(),
15
+ stroke: jest.fn()
16
+ };
17
+ var settings = {
18
+ labelFont: 'Roboto',
19
+ labelSize: 12,
20
+ labelColor: {
21
+ color: 'rgba(0, 0, 0, 0.87)'
22
+ },
23
+ labelWeight: 'normal'
24
+ };
25
+ afterEach(function () {
26
+ jest.clearAllMocks();
27
+ });
28
+ var get2DPathEventTypes = function (path) {
29
+ return path._events.map(function (event) { return event.type; });
30
+ };
31
+ it('should call context methods if label is string (hover behavior)', function () {
32
+ var data = {
33
+ x: 1,
34
+ y: 1,
35
+ size: 12,
36
+ label: 'Test label'
37
+ };
38
+ var canvasPath = drawLabelBackground(context, data, settings);
39
+ var expectedEvents = [
40
+ 'moveTo',
41
+ 'quadraticCurveTo',
42
+ 'lineTo',
43
+ 'quadraticCurveTo',
44
+ 'lineTo',
45
+ 'quadraticCurveTo',
46
+ 'lineTo',
47
+ 'quadraticCurveTo',
48
+ 'closePath'
49
+ ];
50
+ expect(get2DPathEventTypes(canvasPath)).toEqual(expectedEvents);
51
+ expect(context.fill).toHaveBeenCalledWith(canvasPath);
52
+ expect(context.stroke).not.toHaveBeenCalled();
53
+ });
54
+ it('should not call context methods if label is not string', function () {
55
+ var data = {
56
+ x: 1,
57
+ y: 1,
58
+ size: 12,
59
+ label: null
60
+ };
61
+ var canvasPath = drawLabelBackground(context, data, settings);
62
+ expect(get2DPathEventTypes(canvasPath)).toEqual([]);
63
+ expect(context.fill).not.toHaveBeenCalled();
64
+ expect(context.stroke).not.toHaveBeenCalled();
65
+ });
66
+ it('should draw stroke if borderColor option is provided', function () {
67
+ var data = {
68
+ x: 1,
69
+ y: 1,
70
+ size: 12,
71
+ label: 'Test label'
72
+ };
73
+ var canvasPath = drawLabelBackground(context, data, settings, { borderColor: 'red' });
74
+ expect(context.strokeStyle).toEqual('red');
75
+ var expectedEvents = [
76
+ 'moveTo',
77
+ 'quadraticCurveTo',
78
+ 'lineTo',
79
+ 'quadraticCurveTo',
80
+ 'lineTo',
81
+ 'quadraticCurveTo',
82
+ 'lineTo',
83
+ 'quadraticCurveTo',
84
+ 'closePath'
85
+ ];
86
+ expect(get2DPathEventTypes(canvasPath)).toEqual(expectedEvents);
87
+ expect(context.fill).toHaveBeenCalledWith(canvasPath);
88
+ expect(context.stroke).toHaveBeenCalledWith(canvasPath);
89
+ });
90
+ });
@@ -0,0 +1,10 @@
1
+ import { GraphNodeAttributes } from '../../types/graphDataTypes';
2
+ type Options = {
3
+ padding?: number;
4
+ lineWidth?: number;
5
+ color?: string;
6
+ };
7
+ export declare const drawNodeArc: (context: CanvasRenderingContext2D, data: Pick<GraphNodeAttributes, 'x' | 'y' | 'size' | 'label' | 'selected'>, { padding, color, lineWidth }?: Options) => void;
8
+ export declare const drawOuterArc: (context: CanvasRenderingContext2D, data: Pick<GraphNodeAttributes, 'x' | 'y' | 'size' | 'label' | 'selected'>) => void;
9
+ export declare const drawTwoArcs: (context: CanvasRenderingContext2D, data: Pick<GraphNodeAttributes, 'x' | 'y' | 'size' | 'label' | 'selected'>) => void;
10
+ export {};
@@ -0,0 +1,27 @@
1
+ var PADDING = 1.5;
2
+ export var drawNodeArc = function (context, data, _a) {
3
+ var _b = _a === void 0 ? {} : _a, _c = _b.padding, padding = _c === void 0 ? PADDING : _c, _d = _b.color, color = _d === void 0 ? '#FFF' : _d, _e = _b.lineWidth, lineWidth = _e === void 0 ? 4 : _e;
4
+ context.lineWidth = lineWidth;
5
+ context.strokeStyle = color;
6
+ context.beginPath();
7
+ context.arc(data.x, data.y, data.size + padding, 0, Math.PI * 2);
8
+ context.closePath();
9
+ context.stroke();
10
+ };
11
+ export var drawOuterArc = function (context, data) {
12
+ if (data.selected) {
13
+ context.shadowColor = 'rgba(0, 114, 206, 0.5)';
14
+ context.shadowBlur = 10;
15
+ drawNodeArc(context, data, {
16
+ lineWidth: 2,
17
+ color: '#0072CE',
18
+ padding: 4.5
19
+ });
20
+ context.shadowColor = 'none';
21
+ context.shadowBlur = 0;
22
+ }
23
+ };
24
+ export var drawTwoArcs = function (context, data) {
25
+ drawOuterArc(context, data);
26
+ drawNodeArc(context, data);
27
+ };
@@ -0,0 +1,11 @@
1
+ import { NodeDisplayData, PartialButFor } from 'sigma/types';
2
+ import { GraphEdgeAttributes } from '../../types/graphDataTypes';
3
+ export declare const LOOP_SCALE = 0.6;
4
+ export declare const getSelfLoopControlPoints: (x: number, y: number, size: number, a?: number) => {
5
+ x1: number;
6
+ y1: number;
7
+ x2: number;
8
+ y2: number;
9
+ };
10
+ declare const drawSelfRelationLoop: (context: CanvasRenderingContext2D, edgeData: GraphEdgeAttributes, sourceData: PartialButFor<NodeDisplayData, 'x' | 'y' | 'size'>) => Path2D;
11
+ export { drawSelfRelationLoop };
@@ -0,0 +1,69 @@
1
+ var ARROW_SCALE = 0.4;
2
+ export var LOOP_SCALE = 0.6;
3
+ var ARROW_SIZE_RATIO_SCALE = 2.2;
4
+ export var getSelfLoopControlPoints = function (x, y, size, a) {
5
+ if (a === void 0) { a = 0; }
6
+ return {
7
+ x1: x - (size + a) * 7,
8
+ y1: y,
9
+ x2: x,
10
+ y2: y + (size + a) * 7
11
+ };
12
+ };
13
+ var getArrowPoints = function (x, y, d, sX, sY, size, aSize) {
14
+ var aX = x + ((sX - x) * (d - aSize - size)) / d;
15
+ var aY = y + ((sY - y) * (d - aSize - size)) / d;
16
+ var vX = ((sX - x) * aSize) / d;
17
+ var vY = ((sY - y) * aSize) / d;
18
+ return { aX: aX, aY: aY, vX: vX, vY: vY };
19
+ };
20
+ var getFirstArrowPoints = function (cp, sX, sY, size, aSize) {
21
+ var d = Math.sqrt(Math.pow(sX - cp.x1, 2) + Math.pow(sY - cp.y1, 2));
22
+ return getArrowPoints(cp.x2, cp.y2, d, sX, sY, size, aSize);
23
+ };
24
+ var getSecondArrowPoints = function (cp, sX, sY, size, aSize) {
25
+ var d = Math.sqrt(Math.pow(sX - cp.x1, 2) + Math.pow(sY - cp.y1, 2));
26
+ return getArrowPoints(cp.x1, cp.y1, d, sX, sY, size, aSize);
27
+ };
28
+ var drawArrow = function (context, aX, aY, vX, vY) {
29
+ context.beginPath();
30
+ context.moveTo(aX + vX, aY + vY);
31
+ context.lineTo(aX + vY * ARROW_SCALE, aY - vX * ARROW_SCALE);
32
+ context.lineTo(aX - vY * ARROW_SCALE, aY + vX * ARROW_SCALE);
33
+ context.lineTo(aX + vX, aY + vY);
34
+ context.closePath();
35
+ context.fill();
36
+ };
37
+ var drawSelfRelationLoop = function (context, edgeData, sourceData) {
38
+ var size = edgeData.size, color = edgeData.color, _a = edgeData.arrowSizeRatio, arrowSizeRatio = _a === void 0 ? 1 : _a;
39
+ var sX = sourceData.x;
40
+ var sY = sourceData.y;
41
+ var sSize = sourceData.size;
42
+ var scale = sSize * LOOP_SCALE;
43
+ var cp = getSelfLoopControlPoints(sX, sY, scale);
44
+ context.strokeStyle = color;
45
+ context.lineWidth = size;
46
+ var bezier = new Path2D();
47
+ if (edgeData.type === 'arrow' || edgeData.type === 'doubleArrow') {
48
+ context.fillStyle = color;
49
+ if (edgeData.type === 'doubleArrow') {
50
+ var firstArrowPoints = getFirstArrowPoints(cp, sX, sY, sSize, size * arrowSizeRatio * ARROW_SIZE_RATIO_SCALE);
51
+ drawArrow(context, firstArrowPoints.aX, firstArrowPoints.aY, firstArrowPoints.vX, firstArrowPoints.vY);
52
+ bezier.moveTo(firstArrowPoints.aX, firstArrowPoints.aY);
53
+ }
54
+ else {
55
+ bezier.moveTo(sX, sY);
56
+ }
57
+ var secondArrowPoints = getSecondArrowPoints(cp, sX, sY, sSize, size * arrowSizeRatio * ARROW_SIZE_RATIO_SCALE);
58
+ bezier.bezierCurveTo(cp.x2, cp.y2, cp.x1, cp.y1, secondArrowPoints.aX, secondArrowPoints.aY);
59
+ context.stroke(bezier);
60
+ drawArrow(context, secondArrowPoints.aX, secondArrowPoints.aY, secondArrowPoints.vX, secondArrowPoints.vY);
61
+ }
62
+ else {
63
+ bezier.moveTo(sX, sY);
64
+ bezier.bezierCurveTo(cp.x1, cp.y1, cp.x2, cp.y2, sX, sY);
65
+ context.stroke(bezier);
66
+ }
67
+ return bezier;
68
+ };
69
+ export { drawSelfRelationLoop };
@@ -0,0 +1,90 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { drawSelfRelationLoop } from './selfRelationLoop';
13
+ describe('Graph selfRelationLoop behavior', function () {
14
+ var context = {
15
+ beginPath: jest.fn(),
16
+ moveTo: jest.fn(),
17
+ lineTo: jest.fn(),
18
+ bezierCurveTo: jest.fn(),
19
+ stroke: jest.fn(),
20
+ closePath: jest.fn(),
21
+ fill: jest.fn()
22
+ };
23
+ var pathInstance = {
24
+ moveTo: jest.fn(),
25
+ bezierCurveTo: jest.fn()
26
+ };
27
+ var edgeData = {
28
+ key: 'id_47',
29
+ size: 1,
30
+ color: 'rgba(0, 0, 0, 0.2)',
31
+ forceLabel: true,
32
+ loop: true,
33
+ hidden: false,
34
+ label: '',
35
+ type: 'line',
36
+ zIndex: 1
37
+ };
38
+ var sourceData = {
39
+ x: 20,
40
+ y: 30,
41
+ size: 1
42
+ };
43
+ beforeEach(function () {
44
+ jest.spyOn(window, 'Path2D').mockImplementation(function () {
45
+ return pathInstance;
46
+ });
47
+ });
48
+ afterEach(function () {
49
+ jest.clearAllMocks();
50
+ });
51
+ it('should call context methods for not arrow edge', function () {
52
+ drawSelfRelationLoop(context, edgeData, sourceData);
53
+ expect(Path2D).toHaveBeenCalled();
54
+ expect(pathInstance.moveTo).toHaveBeenCalledWith(sourceData.x, sourceData.y);
55
+ expect(pathInstance.bezierCurveTo).toHaveBeenCalledWith(15.8, 30, 20, 34.2, sourceData.x, sourceData.y);
56
+ expect(context.stroke).toHaveBeenCalledWith(pathInstance);
57
+ });
58
+ it('should call context methods for arrow edge correctly', function () {
59
+ drawSelfRelationLoop(context, __assign(__assign({}, edgeData), { type: 'arrow' }), sourceData);
60
+ expect(Path2D).toHaveBeenCalled();
61
+ expect(pathInstance.moveTo).toHaveBeenCalledWith(sourceData.x, sourceData.y);
62
+ expect(pathInstance.bezierCurveTo).toHaveBeenCalledWith(sourceData.x, 34.2, 15.8, 30, 16.8, sourceData.y);
63
+ expect(context.stroke).toHaveBeenCalledWith(pathInstance);
64
+ expect(context.beginPath).toHaveBeenCalled();
65
+ expect(context.moveTo).toHaveBeenCalledWith(19, 30);
66
+ expect(context.lineTo).toHaveBeenNthCalledWith(1, 16.8, 29.12);
67
+ expect(context.lineTo).toHaveBeenNthCalledWith(2, 16.8, 30.88);
68
+ expect(context.lineTo).toHaveBeenNthCalledWith(3, 19, 30);
69
+ expect(context.closePath).toHaveBeenCalled();
70
+ expect(context.fill).toHaveBeenCalled();
71
+ });
72
+ it('should call context methods for doubleArrow edge correctly', function () {
73
+ drawSelfRelationLoop(context, __assign(__assign({}, edgeData), { type: 'doubleArrow' }), sourceData);
74
+ expect(Path2D).toHaveBeenCalled();
75
+ expect(context.beginPath).toHaveBeenCalledTimes(2);
76
+ expect(context.fill).toHaveBeenCalledTimes(2);
77
+ expect(context.closePath).toHaveBeenCalledTimes(2);
78
+ expect(context.moveTo).toHaveBeenNthCalledWith(1, sourceData.x, 31);
79
+ expect(context.lineTo).toHaveBeenNthCalledWith(1, 19.119999999999997, 33.2);
80
+ expect(context.lineTo).toHaveBeenNthCalledWith(2, 20.880000000000003, 33.2);
81
+ expect(context.lineTo).toHaveBeenNthCalledWith(3, sourceData.x, 31);
82
+ expect(pathInstance.moveTo).toHaveBeenCalledWith(sourceData.x, 33.2);
83
+ expect(pathInstance.bezierCurveTo).toHaveBeenCalledWith(sourceData.x, 34.2, 15.8, 30, 16.8, sourceData.y);
84
+ expect(context.stroke).toHaveBeenCalledWith(pathInstance);
85
+ expect(context.moveTo).toHaveBeenNthCalledWith(2, 19, sourceData.y);
86
+ expect(context.lineTo).toHaveBeenNthCalledWith(4, 16.8, 29.12);
87
+ expect(context.lineTo).toHaveBeenNthCalledWith(5, 16.8, 30.88);
88
+ expect(context.lineTo).toHaveBeenNthCalledWith(6, 19, sourceData.y);
89
+ });
90
+ });
@@ -0,0 +1,2 @@
1
+ declare const drawTooltip: (context: CanvasRenderingContext2D, centerX: number, centerY: number, text: string) => void;
2
+ export { drawTooltip };
@@ -0,0 +1,25 @@
1
+ var drawRoundedRect = function (context, x, y, width, height, radius) {
2
+ context.beginPath();
3
+ context.moveTo(x, y + radius);
4
+ context.arcTo(x, y + height, x + radius, y + height, radius);
5
+ context.arcTo(x + width, y + height, x + width, y + height - radius, radius);
6
+ context.arcTo(x + width, y, x + width - radius, y, radius);
7
+ context.arcTo(x, y, x, y + radius, radius);
8
+ context.fill();
9
+ };
10
+ var drawTooltip = function (context, centerX, centerY, text) {
11
+ context.font = 'normal 10px Roboto';
12
+ context.textAlign = 'center';
13
+ context.textBaseline = 'middle';
14
+ var xPadding = 8;
15
+ var width = context.measureText(text).width + xPadding * 2;
16
+ var height = 24;
17
+ var radius = 4;
18
+ var x = centerX - width / 2;
19
+ var y = centerY - height / 2;
20
+ context.fillStyle = 'rgba(0, 0, 0, 0.54)';
21
+ drawRoundedRect(context, x, y, width, height, radius);
22
+ context.fillStyle = '#fff';
23
+ context.fillText(text, x + width / 2, y + height / 2);
24
+ };
25
+ export { drawTooltip };
@@ -0,0 +1,30 @@
1
+ import { drawTooltip } from './tooltip';
2
+ describe('tests', function () {
3
+ var context = {
4
+ beginPath: jest.fn(),
5
+ moveTo: jest.fn(),
6
+ fill: jest.fn(),
7
+ measureText: jest.fn(function (text) { return ({ width: text.length * 5 }); }),
8
+ arcTo: jest.fn(),
9
+ fillText: jest.fn()
10
+ };
11
+ beforeEach(function () {
12
+ jest.clearAllMocks();
13
+ });
14
+ it('drawTooltip should work correctly', function () {
15
+ var label = 'label';
16
+ drawTooltip(context, 600, 600, label);
17
+ expect(context.beginPath).toHaveBeenCalledTimes(1);
18
+ expect(context.measureText).toHaveBeenCalledWith(label);
19
+ expect(context.moveTo).toHaveBeenCalledWith(579.5, 592);
20
+ expect(context.arcTo).toHaveBeenNthCalledWith(1, 579.5, 612, 583.5, 612, 4);
21
+ expect(context.arcTo).toHaveBeenNthCalledWith(2, 620.5, 612, 620.5, 608, 4);
22
+ expect(context.arcTo).toHaveBeenNthCalledWith(3, 620.5, 588, 616.5, 588, 4);
23
+ expect(context.arcTo).toHaveBeenNthCalledWith(4, 579.5, 588, 579.5, 592, 4);
24
+ expect(context.fill).toHaveBeenCalled();
25
+ expect(context.fillText).toHaveBeenCalledWith(label, 600, 600);
26
+ expect(context.font).toBe('normal 10px Roboto');
27
+ expect(context.textAlign).toBe('center');
28
+ expect(context.textBaseline).toBe('middle');
29
+ });
30
+ });
@@ -0,0 +1,4 @@
1
+ export declare const getCanvasMousePos: (canvas: HTMLCanvasElement, event: MouseEvent) => {
2
+ x: number;
3
+ y: number;
4
+ };
@@ -0,0 +1,6 @@
1
+ export var getCanvasMousePos = function (canvas, event) {
2
+ var rect = canvas.getBoundingClientRect();
3
+ var x = ((event.clientX - rect.left) / (rect.right - rect.left)) * canvas.width;
4
+ var y = ((event.clientY - rect.top) / (rect.bottom - rect.top)) * canvas.height;
5
+ return { x: x, y: y };
6
+ };
@@ -0,0 +1,20 @@
1
+ import { getCanvasMousePos } from './utils';
2
+ describe('getCanvasMousePos behaviour', function () {
3
+ it('should return real mouse position correctly', function () {
4
+ var canvas = {
5
+ getBoundingClientRect: function () { return ({
6
+ left: 64,
7
+ right: 888,
8
+ top: 148,
9
+ bottom: 1000
10
+ }); },
11
+ width: 772,
12
+ height: 798
13
+ };
14
+ var mouseEvent = {
15
+ clientX: 864,
16
+ clientY: 547
17
+ };
18
+ expect(getCanvasMousePos(canvas, mouseEvent)).toEqual({ x: 749.5145631067961, y: 373.7112676056338 });
19
+ });
20
+ });
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_PROFILE_IMAGE = "\n<svg width=\"400px\" height=\"400px\" viewBox=\"0 0 400 400\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <title>Group</title>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"Group\" fill-rule=\"nonzero\">\n <rect id=\"Rectangle\" fill=\"#DFE5E9\" x=\"0\" y=\"0\" width=\"400\" height=\"400\"></rect>\n <path d=\"M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z\" id=\"Path\" fill=\"#B3BCC4\"></path>\n <path d=\"M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z\" id=\"Path\" fill=\"#B3BCC4\"></path>\n <path d=\"M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z\" id=\"Path\" fill=\"#B3BCC4\"></path>\n </g>\n </g>\n</svg>\n";
@@ -0,0 +1 @@
1
+ export var DEFAULT_PROFILE_IMAGE = "\n<svg width=\"400px\" height=\"400px\" viewBox=\"0 0 400 400\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <title>Group</title>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"Group\" fill-rule=\"nonzero\">\n <rect id=\"Rectangle\" fill=\"#DFE5E9\" x=\"0\" y=\"0\" width=\"400\" height=\"400\"></rect>\n <path d=\"M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z\" id=\"Path\" fill=\"#B3BCC4\"></path>\n <path d=\"M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z\" id=\"Path\" fill=\"#B3BCC4\"></path>\n <path d=\"M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z\" id=\"Path\" fill=\"#B3BCC4\"></path>\n </g>\n </g>\n</svg>\n";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This class extends src/rendering/webgl/programs/edge.arrowHead.ts for arrowSizeRatio support
3
+ */
4
+ import SigmaEdgeArrowHeadProgram from 'sigma/rendering/webgl/programs/edge.arrowHead';
5
+ import { GraphEdgeAttributes, GraphNodeAttributes } from '../../types/graphDataTypes';
6
+ export default class EdgeArrowHeadProgram extends SigmaEdgeArrowHeadProgram {
7
+ process(sourceData: GraphNodeAttributes, targetData: GraphNodeAttributes, data: GraphEdgeAttributes, hidden: boolean, offset: number): void;
8
+ }