@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,112 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import { clearCrossOriginForCORSIfNotSameOrigin } from './helpers/imageHelper';
11
+ /*
12
+ * ImageLoader is a part of sigma/rendering/webgl/programs/node.image
13
+ * It loads images in one texture, which used for all nodes.
14
+ */
15
+ var MAX_TEXTURE_SIZE = 128;
16
+ var WebGLImageLoader = /** @class */ (function () {
17
+ function WebGLImageLoader() {
18
+ var _this = this;
19
+ this.rebindTextureFns = [];
20
+ this.images = {};
21
+ this.hasReceivedImages = false;
22
+ this.pendingImagesFrameID = undefined;
23
+ /**
24
+ * Helper to load an image:
25
+ */
26
+ this.loadImage = function (id, imageSource) {
27
+ if (_this.images[id])
28
+ return;
29
+ var image = new Image();
30
+ image.addEventListener('load', function () {
31
+ _this.images[id] = {
32
+ status: 'pending',
33
+ image: image
34
+ };
35
+ if (typeof _this.pendingImagesFrameID !== 'number') {
36
+ _this.pendingImagesFrameID = requestAnimationFrame(function () { return _this.finalizePendingImages(); });
37
+ }
38
+ });
39
+ image.addEventListener('error', function () {
40
+ _this.images[id] = { status: 'error' };
41
+ });
42
+ _this.images[id] = { status: 'loading' };
43
+ // Load image:
44
+ clearCrossOriginForCORSIfNotSameOrigin(image, imageSource);
45
+ // add ?not-from-cache parameter for loading image not from cache
46
+ // because cached image does not contain cors headers
47
+ // https://www.hacksoft.io/blog/handle-images-cors-error-in-chrome
48
+ image.src = imageSource.startsWith('data:image') ? imageSource : imageSource + '?not-from-cache';
49
+ };
50
+ /**
51
+ * Helper that takes all pending images and adds them into the texture:
52
+ */
53
+ this.finalizePendingImages = function () {
54
+ _this.pendingImagesFrameID = undefined;
55
+ var pendingImages = [];
56
+ // List all pending images:
57
+ for (var id in _this.images) {
58
+ var state = _this.images[id];
59
+ if (state.status === 'pending') {
60
+ pendingImages.push({
61
+ id: id,
62
+ image: state.image,
63
+ size: Math.min(state.image.width, state.image.height) || 1
64
+ });
65
+ }
66
+ }
67
+ // Add images to texture:
68
+ var canvas = document.createElement('canvas');
69
+ var ctx = canvas.getContext('2d');
70
+ canvas.width = pendingImages.reduce(function (iter, _a) {
71
+ var size = _a.size;
72
+ return iter + size;
73
+ }, _this.hasReceivedImages ? _this.textureImage.width : 0);
74
+ canvas.height = Math.max.apply(Math, __spreadArray([_this.hasReceivedImages ? _this.textureImage.height : 0], pendingImages.map(function (_a) {
75
+ var size = _a.size;
76
+ return size;
77
+ }), false));
78
+ var xOffset = 0;
79
+ if (_this.hasReceivedImages) {
80
+ ctx.putImageData(_this.textureImage, 0, 0);
81
+ xOffset = _this.textureImage.width;
82
+ }
83
+ pendingImages.forEach(function (_a) {
84
+ var id = _a.id, image = _a.image, size = _a.size;
85
+ var imageSizeInTexture = Math.min(MAX_TEXTURE_SIZE, size);
86
+ // Crop image, to only keep the biggest square, centered:
87
+ var dx = 0, dy = 0;
88
+ if ((image.width || 0) > (image.height || 0)) {
89
+ dx = (image.width - image.height) / 2;
90
+ }
91
+ else {
92
+ dy = (image.height - image.width) / 2;
93
+ }
94
+ ctx.drawImage(image, dx, dy, size, size, xOffset, 0, imageSizeInTexture, imageSizeInTexture);
95
+ // Update image state:
96
+ _this.images[id] = {
97
+ status: 'ready',
98
+ x: xOffset,
99
+ y: 0,
100
+ width: imageSizeInTexture,
101
+ height: imageSizeInTexture
102
+ };
103
+ xOffset += imageSizeInTexture;
104
+ });
105
+ _this.textureImage = ctx.getImageData(0, 0, canvas.width, canvas.height);
106
+ _this.hasReceivedImages = true;
107
+ _this.rebindTextureFns.forEach(function (fn) { return fn(); });
108
+ };
109
+ }
110
+ return WebGLImageLoader;
111
+ }());
112
+ export { WebGLImageLoader };
@@ -0,0 +1,11 @@
1
+ import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
2
+ import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
3
+ import { GraphNodeAttributes } from '../../types/graphDataTypes';
4
+ export declare class NodeBorderProgram extends AbstractNodeProgram {
5
+ borderSize: GLint;
6
+ inactive: GLint;
7
+ constructor(gl: WebGLRenderingContext);
8
+ bind(): void;
9
+ process(data: GraphNodeAttributes, hidden: boolean, offset: number): void;
10
+ render(params: RenderParams): void;
11
+ }
@@ -0,0 +1,76 @@
1
+ /*
2
+ * This class copies sigma/examples/custom-rendering/programs/node.border, but with a some
3
+ * difference: The fragment shader ("./node.border.frag.glsl") draws a transparent
4
+ * disc with a colored border. Size of border depends on hasBorder and highlighted props
5
+ */
6
+ var __extends = (this && this.__extends) || (function () {
7
+ var extendStatics = function (d, b) {
8
+ extendStatics = Object.setPrototypeOf ||
9
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
11
+ return extendStatics(d, b);
12
+ };
13
+ return function (d, b) {
14
+ if (typeof b !== "function" && b !== null)
15
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
16
+ extendStatics(d, b);
17
+ function __() { this.constructor = d; }
18
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
19
+ };
20
+ })();
21
+ import { floatColor } from 'sigma/utils';
22
+ import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
23
+ import { vertexShaderSource } from './shaders/node.border.vert.glsl';
24
+ import { fragmentShaderSource } from './shaders/node.border.frag.glsl';
25
+ var POINTS = 1; // number of vertices for a node
26
+ var ATTRIBUTES = 6; // number of attributes for one vertex
27
+ var NodeBorderProgram = /** @class */ (function (_super) {
28
+ __extends(NodeBorderProgram, _super);
29
+ function NodeBorderProgram(gl) {
30
+ var _this = _super.call(this, gl, vertexShaderSource, fragmentShaderSource, POINTS, ATTRIBUTES) || this;
31
+ // Attribute Location
32
+ _this.borderSize = gl.getAttribLocation(_this.program, 'a_borderSize');
33
+ _this.inactive = gl.getAttribLocation(_this.program, 'a_inactive');
34
+ _this.bind();
35
+ return _this;
36
+ }
37
+ NodeBorderProgram.prototype.bind = function () {
38
+ _super.prototype.bind.call(this);
39
+ var gl = this.gl;
40
+ gl.enableVertexAttribArray(this.borderSize);
41
+ gl.enableVertexAttribArray(this.inactive);
42
+ gl.vertexAttribPointer(this.borderSize, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 16);
43
+ gl.vertexAttribPointer(this.inactive, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 20);
44
+ };
45
+ NodeBorderProgram.prototype.process = function (data, hidden, offset) {
46
+ var array = this.array;
47
+ var i = offset * POINTS * ATTRIBUTES;
48
+ if (hidden || !data.hasBorder) {
49
+ // draw border only for nodes with hasBorder or not hidden
50
+ array[i++] = 0;
51
+ array[i++] = 0;
52
+ array[i++] = 0;
53
+ array[i++] = 0;
54
+ array[i++] = 0;
55
+ array[i++] = 0;
56
+ return;
57
+ }
58
+ array[i++] = data.x; // position of center
59
+ array[i++] = data.y;
60
+ array[i++] = data.size; // size
61
+ array[i++] = floatColor(data.color); // color
62
+ array[i++] = data.highlighted ? 4 : 2; // size of border in pixels
63
+ array[i] = data.inactive ? 1 : 0; // inactive flag
64
+ };
65
+ NodeBorderProgram.prototype.render = function (params) {
66
+ var gl = this.gl;
67
+ var program = this.program;
68
+ gl.useProgram(program);
69
+ gl.uniform1f(this.ratioLocation, 1 / Math.sqrt(params.ratio));
70
+ gl.uniform1f(this.scaleLocation, params.scalingRatio);
71
+ gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
72
+ gl.drawArrays(gl.POINTS, 0, this.array.length / ATTRIBUTES);
73
+ };
74
+ return NodeBorderProgram;
75
+ }(AbstractNodeProgram));
76
+ export { NodeBorderProgram };
@@ -0,0 +1,11 @@
1
+ import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
2
+ import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
3
+ import { GraphNodeAttributes } from '../../types/graphDataTypes';
4
+ export declare class NodeDashedBorderProgram extends AbstractNodeProgram {
5
+ borderSize: GLint;
6
+ inactive: GLint;
7
+ constructor(gl: WebGLRenderingContext);
8
+ bind(): void;
9
+ process(data: GraphNodeAttributes, hidden: boolean, offset: number): void;
10
+ render(params: RenderParams): void;
11
+ }
@@ -0,0 +1,74 @@
1
+ /*
2
+ * This class copies our node.border program, but with another fragment shader to support dashed borders
3
+ */
4
+ var __extends = (this && this.__extends) || (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics = Object.setPrototypeOf ||
7
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
9
+ return extendStatics(d, b);
10
+ };
11
+ return function (d, b) {
12
+ if (typeof b !== "function" && b !== null)
13
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
+ extendStatics(d, b);
15
+ function __() { this.constructor = d; }
16
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
+ };
18
+ })();
19
+ import { floatColor } from 'sigma/utils';
20
+ import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
21
+ import { vertexShaderSource } from './shaders/node.border.vert.glsl';
22
+ import { fragmentShaderSource } from './shaders/node.dashed.border.frag.glsl';
23
+ var POINTS = 1; // number of vertices for a node
24
+ var ATTRIBUTES = 6; // number of attributes for one vertex
25
+ var NodeDashedBorderProgram = /** @class */ (function (_super) {
26
+ __extends(NodeDashedBorderProgram, _super);
27
+ function NodeDashedBorderProgram(gl) {
28
+ var _this = _super.call(this, gl, vertexShaderSource, fragmentShaderSource, POINTS, ATTRIBUTES) || this;
29
+ // Attribute Location
30
+ _this.borderSize = gl.getAttribLocation(_this.program, 'a_borderSize');
31
+ _this.inactive = gl.getAttribLocation(_this.program, 'a_inactive');
32
+ _this.bind();
33
+ return _this;
34
+ }
35
+ NodeDashedBorderProgram.prototype.bind = function () {
36
+ _super.prototype.bind.call(this);
37
+ var gl = this.gl;
38
+ gl.enableVertexAttribArray(this.borderSize);
39
+ gl.enableVertexAttribArray(this.inactive);
40
+ gl.vertexAttribPointer(this.borderSize, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 16);
41
+ gl.vertexAttribPointer(this.inactive, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 20);
42
+ };
43
+ NodeDashedBorderProgram.prototype.process = function (data, hidden, offset) {
44
+ var array = this.array;
45
+ var i = offset * POINTS * ATTRIBUTES;
46
+ if (hidden || !data.hasBorder) {
47
+ // draw border only for nodes with hasBorder or not hidden
48
+ array[i++] = 0;
49
+ array[i++] = 0;
50
+ array[i++] = 0;
51
+ array[i++] = 0;
52
+ array[i++] = 0;
53
+ array[i++] = 0;
54
+ return;
55
+ }
56
+ array[i++] = data.x; // position of center
57
+ array[i++] = data.y;
58
+ array[i++] = data.size; // size
59
+ array[i++] = floatColor(data.color); // color
60
+ array[i++] = data.highlighted ? 2 : 1; // size of border in pixels
61
+ array[i] = data.inactive ? 1 : 0; // inactive flag
62
+ };
63
+ NodeDashedBorderProgram.prototype.render = function (params) {
64
+ var gl = this.gl;
65
+ var program = this.program;
66
+ gl.useProgram(program);
67
+ gl.uniform1f(this.ratioLocation, 1 / Math.sqrt(params.ratio));
68
+ gl.uniform1f(this.scaleLocation, params.scalingRatio);
69
+ gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
70
+ gl.drawArrays(gl.POINTS, 0, this.array.length / ATTRIBUTES);
71
+ };
72
+ return NodeDashedBorderProgram;
73
+ }(AbstractNodeProgram));
74
+ export { NodeDashedBorderProgram };
@@ -0,0 +1,18 @@
1
+ import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
2
+ import { RenderParams } from 'sigma/rendering/webgl/programs/common/program';
3
+ import Sigma from 'sigma/sigma';
4
+ import { WebGLImageLoader } from './image';
5
+ import { GraphNodeAttributes } from '../../types/graphDataTypes';
6
+ export declare class NodeImageProgram extends AbstractNodeProgram {
7
+ imageLoader: WebGLImageLoader;
8
+ texture: WebGLTexture;
9
+ textureLocation: GLint;
10
+ atlasLocation: WebGLUniformLocation;
11
+ latestRenderParams?: RenderParams;
12
+ inactive: GLint;
13
+ constructor(gl: WebGLRenderingContext, renderer: Sigma);
14
+ bind(): void;
15
+ process(data: GraphNodeAttributes, hidden: boolean, offset: number): void;
16
+ render(params: RenderParams): void;
17
+ rebindTexture(): void;
18
+ }
@@ -0,0 +1,144 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ /*
17
+ * This class copies sigma/rendering/webgl/programs/node.image, but with a some
18
+ * difference: it can change color of picture for inactive state
19
+ * Program rendering nodes using GL_POINTS, but that draws an image on top of
20
+ * the classic colored disc.
21
+ */
22
+ import { vertexShaderSource } from './shaders/node.image.vert.glsl';
23
+ import { fragmentShaderSource } from './shaders/node.image.frag.glsl';
24
+ import { AbstractNodeProgram } from 'sigma/rendering/webgl/programs/common/node';
25
+ import { floatColor } from 'sigma/utils';
26
+ import { svg2Url } from '@reltio/mdm-sdk';
27
+ import { DEFAULT_PROFILE_IMAGE } from '../icons/no_photo.inline.svg';
28
+ import { WebGLImageLoader } from './image';
29
+ var POINTS = 1;
30
+ var ATTRIBUTES = 9;
31
+ var defaultImage = { id: 'defaultImage', path: svg2Url(DEFAULT_PROFILE_IMAGE) };
32
+ /*
33
+ * To share the texture between the program instances of the graph and the
34
+ * hovered nodes (to prevent some flickering, mostly), this program must be
35
+ * "built" for each sigma instance:
36
+ */
37
+ var NodeImageProgram = /** @class */ (function (_super) {
38
+ __extends(NodeImageProgram, _super);
39
+ function NodeImageProgram(gl, renderer) {
40
+ var _this = _super.call(this, gl, vertexShaderSource, fragmentShaderSource, POINTS, ATTRIBUTES) || this;
41
+ _this.imageLoader = new WebGLImageLoader();
42
+ _this.imageLoader.rebindTextureFns.push(function () {
43
+ if (_this && _this.rebindTexture)
44
+ _this.rebindTexture();
45
+ if (renderer && renderer.refresh)
46
+ renderer.refresh();
47
+ });
48
+ _this.imageLoader.textureImage = new ImageData(1, 1);
49
+ // Attribute Location
50
+ _this.textureLocation = gl.getAttribLocation(_this.program, 'a_texture');
51
+ _this.inactive = gl.getAttribLocation(_this.program, 'a_inactive');
52
+ // Uniform Location
53
+ var atlasLocation = gl.getUniformLocation(_this.program, 'u_atlas');
54
+ if (atlasLocation === null)
55
+ throw new Error('NodeProgramImage: error while getting atlasLocation');
56
+ _this.atlasLocation = atlasLocation;
57
+ // Initialize WebGL texture:
58
+ _this.texture = gl.createTexture();
59
+ gl.bindTexture(gl.TEXTURE_2D, _this.texture);
60
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 0]));
61
+ _this.imageLoader.loadImage(defaultImage.id, defaultImage.path);
62
+ _this.bind();
63
+ return _this;
64
+ }
65
+ NodeImageProgram.prototype.bind = function () {
66
+ _super.prototype.bind.call(this);
67
+ var gl = this.gl;
68
+ gl.enableVertexAttribArray(this.textureLocation);
69
+ gl.enableVertexAttribArray(this.inactive);
70
+ gl.vertexAttribPointer(this.inactive, 1, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 16);
71
+ gl.vertexAttribPointer(this.textureLocation, 4, gl.FLOAT, false, this.attributes * Float32Array.BYTES_PER_ELEMENT, 20);
72
+ };
73
+ NodeImageProgram.prototype.process = function (data, hidden, offset) {
74
+ var array = this.array;
75
+ var i = offset * POINTS * ATTRIBUTES;
76
+ var imageSource = data.image;
77
+ var imageState = imageSource && this.imageLoader.images[imageSource];
78
+ if (typeof imageSource === 'string' && !imageState) {
79
+ this.imageLoader.loadImage(imageSource, imageSource);
80
+ }
81
+ if (hidden) {
82
+ array[i++] = 0;
83
+ array[i++] = 0;
84
+ array[i++] = 0;
85
+ array[i++] = 0;
86
+ array[i++] = 0;
87
+ // Texture:
88
+ array[i++] = 0;
89
+ array[i++] = 0;
90
+ array[i++] = 0;
91
+ array[i++] = 0;
92
+ return;
93
+ }
94
+ array[i++] = data.x; // position of center
95
+ array[i++] = data.y;
96
+ array[i++] = data.size; // size
97
+ array[i++] = floatColor(data.color); // color
98
+ array[i++] = data.inactive ? 1 : 0; // inactive property
99
+ // Reference texture:
100
+ if (!imageState || imageState.status !== 'ready') {
101
+ imageState = this.imageLoader.images[defaultImage.id];
102
+ }
103
+ if (imageState && imageState.status === 'ready') {
104
+ var _a = this.imageLoader.textureImage, width = _a.width, height = _a.height;
105
+ array[i++] = imageState.x / width;
106
+ array[i++] = imageState.y / height;
107
+ array[i++] = imageState.width / width;
108
+ array[i++] = imageState.height / height;
109
+ }
110
+ else {
111
+ array[i++] = 0;
112
+ array[i++] = 0;
113
+ array[i++] = 0;
114
+ array[i++] = 0;
115
+ }
116
+ };
117
+ NodeImageProgram.prototype.render = function (params) {
118
+ if (this.hasNothingToRender())
119
+ return;
120
+ this.latestRenderParams = params;
121
+ var gl = this.gl;
122
+ var program = this.program;
123
+ gl.useProgram(program);
124
+ gl.uniform1f(this.ratioLocation, 1 / Math.sqrt(params.ratio));
125
+ gl.uniform1f(this.scaleLocation, params.scalingRatio);
126
+ gl.uniformMatrix3fv(this.matrixLocation, false, params.matrix);
127
+ gl.uniform1i(this.atlasLocation, 0);
128
+ gl.drawArrays(gl.POINTS, 0, this.array.length / ATTRIBUTES);
129
+ };
130
+ NodeImageProgram.prototype.rebindTexture = function () {
131
+ var gl = this.gl;
132
+ gl.activeTexture(gl.TEXTURE0);
133
+ gl.bindTexture(gl.TEXTURE_2D, this.texture);
134
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this.imageLoader.textureImage);
135
+ gl.generateMipmap(gl.TEXTURE_2D);
136
+ if (this.latestRenderParams) {
137
+ this.bind();
138
+ this.bufferData();
139
+ this.render(this.latestRenderParams);
140
+ }
141
+ };
142
+ return NodeImageProgram;
143
+ }(AbstractNodeProgram));
144
+ export { NodeImageProgram };
@@ -0,0 +1 @@
1
+ export declare const vertexShaderSource = "\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\nattribute float a_arrowSizeRatio;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // our change - apply a_arrowSizeRatio depending on current zoom and minThickness\n float arrowSizeCoefficient = min(a_arrowSizeRatio, a_arrowSizeRatio / (u_sqrtZoomRatio * minThickness));\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio * arrowSizeCoefficient;\n\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}";
@@ -0,0 +1,5 @@
1
+ /*
2
+ * This file copies sigma/src/rendering/webgl/shaders/edge.clamped.vert.glsl, but with a some
3
+ * difference: added calculation of arrowSizeCoefficient using a_arrowSizeRatio attribute
4
+ */
5
+ export var vertexShaderSource = "\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\nattribute float a_arrowSizeRatio;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // our change - apply a_arrowSizeRatio depending on current zoom and minThickness\n float arrowSizeCoefficient = min(a_arrowSizeRatio, a_arrowSizeRatio / (u_sqrtZoomRatio * minThickness));\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio * arrowSizeCoefficient;\n\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}";
@@ -0,0 +1 @@
1
+ export declare const fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_position; // our addition - the position along the line\n\nconst float feather = 0.001;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float u_dashSize = 0.01; // our addition\nconst float u_gapSize = 0.005; // our addition\n\nvoid main(void) {\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - feather,\n v_thickness,\n dist\n );\n\n // our additions\n float totalSize = u_dashSize + u_gapSize;\n float positionInDashGap = mod(v_position, totalSize);\n float dashGapRatio = positionInDashGap / u_dashSize;\n // end additions (dashGapRatio is used below in if)\n\n if (dashGapRatio < 1.0) {\n gl_FragColor = mix(v_color, transparent, t);\n } else {\n discard;\n }\n}\n";
@@ -0,0 +1,5 @@
1
+ /*
2
+ * This file copies sigma/src/rendering/webgl/shaders/edge.frag.glsl, but with a some changes
3
+ * difference: added a dash-gap pattern to the edge
4
+ */
5
+ export var fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_position; // our addition - the position along the line\n\nconst float feather = 0.001;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float u_dashSize = 0.01; // our addition\nconst float u_gapSize = 0.005; // our addition\n\nvoid main(void) {\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - feather,\n v_thickness,\n dist\n );\n\n // our additions\n float totalSize = u_dashSize + u_gapSize;\n float positionInDashGap = mod(v_position, totalSize);\n float dashGapRatio = positionInDashGap / u_dashSize;\n // end additions (dashGapRatio is used below in if)\n\n if (dashGapRatio < 1.0) {\n gl_FragColor = mix(v_color, transparent, t);\n } else {\n discard;\n }\n}\n";
@@ -0,0 +1 @@
1
+ export declare const vertexShaderSource = "\nattribute float a_lineLength; // our addition\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_position; // our addition\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // We require edges to be at least 'minThickness' pixels thick *on screen*\n // (so we need to compensate the SQRT zoom ratio):\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n\n // Then, we need to retrieve the normalized thickness of the edge in the WebGL\n // referential (in a ([0, 1], [0, 1]) space), using our \"magic\" correction\n // ratio:\n float webGLThickness = pixelsThickness * u_correctionRatio;\n\n // Finally, we adapt the edge thickness to the \"SQRT rule\" in sigma (so that\n // items are not too big when zoomed in, and not too small when zoomed out).\n // The exact computation should be 'adapted = value * zoom / sqrt(zoom)', but\n // it's simpler like this:\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness, 1)).xy, 0, 1);\n\n // For the fragment shader though, we need a thickness that takes the \"magic\"\n // correction ratio into account (as in webGLThickness), but so that the\n // antialiasing effect does not depend on the zoom level. So here's yet\n // another thickness version:\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n v_position = a_lineLength / u_sqrtZoomRatio; // our addition\n}\n";
@@ -0,0 +1,5 @@
1
+ /*
2
+ * This file copies sigma/src/rendering/webgl/shaders/edge.vert.glsl, but with a some changes
3
+ * difference: added v_position calculation based on a_lineLength and u_sqrtZoomRatio
4
+ */
5
+ export var vertexShaderSource = "\nattribute float a_lineLength; // our addition\nattribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\nvarying float v_position; // our addition\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // We require edges to be at least 'minThickness' pixels thick *on screen*\n // (so we need to compensate the SQRT zoom ratio):\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n\n // Then, we need to retrieve the normalized thickness of the edge in the WebGL\n // referential (in a ([0, 1], [0, 1]) space), using our \"magic\" correction\n // ratio:\n float webGLThickness = pixelsThickness * u_correctionRatio;\n\n // Finally, we adapt the edge thickness to the \"SQRT rule\" in sigma (so that\n // items are not too big when zoomed in, and not too small when zoomed out).\n // The exact computation should be 'adapted = value * zoom / sqrt(zoom)', but\n // it's simpler like this:\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness, 1)).xy, 0, 1);\n\n // For the fragment shader though, we need a thickness that takes the \"magic\"\n // correction ratio into account (as in webGLThickness), but so that the\n // antialiasing effect does not depend on the zoom level. So here's yet\n // another thickness version:\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n v_position = a_lineLength / u_sqrtZoomRatio; // our addition\n}\n";
@@ -0,0 +1 @@
1
+ export declare const fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\nvarying float v_inactive;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\n\n\n// convert color to pale gray\nvec4 toPaleGrayscale(in vec4 color, float paleFactor)\n{\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n vec4 paleColor = mix(color, white, paleFactor);\n\n float average = (paleColor.r + paleColor.g + paleColor.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toPaleGrayscale(v_color, 0.5);\n } else {\n color = v_color;\n }\n\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n}\n";
@@ -0,0 +1,6 @@
1
+ /*
2
+ * This file copies sigma/examples/custom-rendering/programs/node.border.frag.glsl, but with a some
3
+ * difference: white color was changed to transparent and used border radius from v_borderRadius variable
4
+ */
5
+ import { toPaleGrayscale } from './utils';
6
+ export var fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\nvarying float v_inactive;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\n\n".concat(toPaleGrayscale, "\n\nvoid main(void) {\n vec4 color;\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toPaleGrayscale(v_color, 0.5);\n } else {\n color = v_color;\n }\n\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n}\n");
@@ -0,0 +1 @@
1
+ export declare const vertexShaderSource = "\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\nvarying float v_inactive;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}";
@@ -0,0 +1,5 @@
1
+ /*
2
+ * This file copies sigma/examples/custom-rendering/programs/node.border.vert.glsl, but with a some
3
+ * difference: added calculation of v_borderRadius using a_borderSize variable
4
+ */
5
+ export var vertexShaderSource = "\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute float a_borderSize;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\nvarying float v_borderRadius;\nvarying float v_inactive;\n\nconst float bias = 255.0 / 254.0;\nconst float radius = 0.5;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n v_borderRadius = radius - (radius * a_borderSize / a_size); // border radius in node's size (full size is 1)\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}";
@@ -0,0 +1 @@
1
+ export declare const fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\nvarying float v_inactive;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\nconst float dashGapRatio = 5.5; // adjust this to change the ratio of dash size to gap size\nconst float totalLength = 2.0 * 3.14159 * radius;\nconst float dashSize = totalLength / (dashGapRatio + 1.0);\nconst float gapSize = dashSize / dashGapRatio;\n\n\n// convert color to pale gray\nvec4 toPaleGrayscale(in vec4 color, float paleFactor)\n{\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n vec4 paleColor = mix(color, white, paleFactor);\n\n float average = (paleColor.r + paleColor.g + paleColor.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toPaleGrayscale(v_color, 0.5);\n } else {\n color = v_color;\n }\n\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n float distAlongBorder = atan(gl_PointCoord.y - 0.5, gl_PointCoord.x - 0.5); // distance along the border\n float dashGapRatio = mod(distAlongBorder, dashSize + gapSize) / dashSize; // ratio of dash to gap\n\n // our change - added if statement to check if within a dash\n if (dashGapRatio < 1.0) {// if within a dash\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n } else {\n gl_FragColor = transparent;\n }\n}\n";
@@ -0,0 +1,5 @@
1
+ /*
2
+ * This file copies our node.border.frag.glsl.ts, but with changes to support dashed borders
3
+ */
4
+ import { toPaleGrayscale } from './utils';
5
+ export var fragmentShaderSource = "\nprecision mediump float;\n\nvarying vec4 v_color; // base color of node\nvarying float v_border;\nvarying float v_borderRadius; // inner border radius\nvarying float v_inactive;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); // transparent color\nconst float radius = 0.5;\nconst float dashGapRatio = 5.5; // adjust this to change the ratio of dash size to gap size\nconst float totalLength = 2.0 * 3.14159 * radius;\nconst float dashSize = totalLength / (dashGapRatio + 1.0);\nconst float gapSize = dashSize / dashGapRatio;\n\n".concat(toPaleGrayscale, "\n\nvoid main(void) {\n vec4 color;\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toPaleGrayscale(v_color, 0.5);\n } else {\n color = v_color;\n }\n\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5)); // distance from current point to center of node\n float distAlongBorder = atan(gl_PointCoord.y - 0.5, gl_PointCoord.x - 0.5); // distance along the border\n float dashGapRatio = mod(distAlongBorder, dashSize + gapSize) / dashSize; // ratio of dash to gap\n\n // our change - added if statement to check if within a dash\n if (dashGapRatio < 1.0) {// if within a dash\n if (distToCenter < v_borderRadius - v_border) // distance to inner border radius\n gl_FragColor = transparent;\n else if (distToCenter < v_borderRadius)\n gl_FragColor = mix(color, transparent, (v_borderRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border) // distance to outer border radius\n gl_FragColor = color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, color, (radius - distToCenter) / v_border);\n else // points outside the button\n gl_FragColor = transparent;\n } else {\n gl_FragColor = transparent;\n }\n}\n");
@@ -0,0 +1 @@
1
+ export declare const fragmentShaderSource = "\nprecision mediump float;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float radius = 0.5;\n\n\n// convert color to pale gray\nvec4 toPaleGrayscale(in vec4 color, float paleFactor)\n{\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n vec4 paleColor = mix(color, white, paleFactor);\n\n float average = (paleColor.r + paleColor.g + paleColor.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}\n\nvoid main(void) {\n vec4 color;\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n } else {\n color = v_color;\n }\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toPaleGrayscale(color, 0.5);\n }\n\n // distance from point to center of node\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n\n if (dist < radius - v_border) // points inside node\n gl_FragColor = color;\n else if (dist < radius) // border of node\n gl_FragColor = mix(transparent, color, (radius - dist) / v_border);\n else // points outside node\n gl_FragColor = transparent;\n}";
@@ -0,0 +1,2 @@
1
+ import { toPaleGrayscale } from './utils';
2
+ export var fragmentShaderSource = "\nprecision mediump float;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nuniform sampler2D u_atlas;\n\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\nconst float radius = 0.5;\n\n".concat(toPaleGrayscale, "\n\nvoid main(void) {\n vec4 color;\n\n // set texel as color of point\n if (v_texture.w > 0.0) {\n vec4 texel = texture2D(u_atlas, v_texture.xy + gl_PointCoord * v_texture.zw, -1.0);\n color = vec4(mix(v_color, texel, texel.a).rgb, max(texel.a, v_color.a));\n } else {\n color = v_color;\n }\n\n // convert color to gray\n if (v_inactive > 0.0) {\n color = toPaleGrayscale(color, 0.5);\n }\n\n // distance from point to center of node\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n\n if (dist < radius - v_border) // points inside node\n gl_FragColor = color;\n else if (dist < radius) // border of node\n gl_FragColor = mix(transparent, color, (radius - dist) / v_border);\n else // points outside node\n gl_FragColor = transparent;\n}");
@@ -0,0 +1 @@
1
+ export declare const vertexShaderSource = "\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_texture;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}";
@@ -0,0 +1,5 @@
1
+ /*
2
+ * This file copies sigma/examples/custom-rendering/programs/node.image.vert.glsl, but with a some
3
+ * difference: white color was changed to transparent and used border radius from v_borderRadius variable
4
+ */
5
+ export var vertexShaderSource = "\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_texture;\nattribute float a_inactive;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying float v_border;\nvarying float v_inactive;\nvarying vec4 v_color;\nvarying vec4 v_texture;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n\n // Pass the texture coordinates:\n v_texture = a_texture;\n\n // Pass inactive property\n v_inactive = a_inactive;\n}";
@@ -0,0 +1 @@
1
+ export declare const toPaleGrayscale = "\n// convert color to pale gray\nvec4 toPaleGrayscale(in vec4 color, float paleFactor)\n{\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n vec4 paleColor = mix(color, white, paleFactor);\n\n float average = (paleColor.r + paleColor.g + paleColor.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}";
@@ -0,0 +1 @@
1
+ export var toPaleGrayscale = "\n// convert color to pale gray\nvec4 toPaleGrayscale(in vec4 color, float paleFactor)\n{\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n vec4 paleColor = mix(color, white, paleFactor);\n\n float average = (paleColor.r + paleColor.g + paleColor.b) / 3.0;\n return vec4(average, average, average, 1.0);\n}";
@@ -0,0 +1,51 @@
1
+ import Graph from 'graphology';
2
+ import { NodeDisplayData, EdgeDisplayData } from 'sigma/types';
3
+ import { Settings } from 'sigma/settings';
4
+ export type GraphEdgeAttributes = EdgeDisplayData & {
5
+ loop: boolean;
6
+ arrowSizeRatio?: number;
7
+ selected?: boolean;
8
+ labelColor?: string;
9
+ };
10
+ export type GraphNodeAttributes = NodeDisplayData & {
11
+ secondaryLabel?: string;
12
+ image?: string;
13
+ hasBorder?: boolean;
14
+ selected?: boolean;
15
+ inactive?: boolean;
16
+ labelColor?: string;
17
+ secondaryLabelColor?: string;
18
+ };
19
+ export declare enum DataModelGraphNodeType {
20
+ entityType = "entityType",
21
+ interactionType = "interactionType"
22
+ }
23
+ export type DataModelGraphEdgeAttributes = GraphEdgeAttributes & {
24
+ edgeType: string;
25
+ };
26
+ export type DataModelGraphNodeAttributes = GraphNodeAttributes & {
27
+ nodeType: DataModelGraphNodeType;
28
+ };
29
+ export type GraphContainerSettings = Partial<Settings & {
30
+ secondaryLabelColor: {
31
+ attribute?: string;
32
+ color?: string;
33
+ };
34
+ }>;
35
+ export interface GraphologyLayout<T> {
36
+ (graph: Graph, options: T): {
37
+ [node: string]: {
38
+ [dimension: string]: number;
39
+ };
40
+ };
41
+ assign?(graph: Graph, options: T): void;
42
+ }
43
+ interface GraphologyWorkerLayout {
44
+ stop: () => void;
45
+ start: () => void;
46
+ kill: () => void;
47
+ }
48
+ export interface GraphologyWorkerLayoutConstructor<T> {
49
+ new (graph: Graph, settings: T): GraphologyWorkerLayout;
50
+ }
51
+ export {};