@webqit/webflo 0.20.1 → 0.20.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/package.json +1 -1
  2. package/site/.vitepress/config.ts +1 -0
  3. package/site/.vitepress/dist/-/_.html +56 -0
  4. package/site/.vitepress/dist/-/docs.old.html +679 -0
  5. package/site/.vitepress/dist/404.html +23 -0
  6. package/site/.vitepress/dist/api/webflo-fetch/FormData.html +55 -0
  7. package/site/.vitepress/dist/api/webflo-fetch/Headers.html +55 -0
  8. package/site/.vitepress/dist/api/webflo-fetch/LiveResponse.html +55 -0
  9. package/site/.vitepress/dist/api/webflo-fetch/Request.html +55 -0
  10. package/site/.vitepress/dist/api/webflo-fetch/Response.html +55 -0
  11. package/site/.vitepress/dist/api/webflo-fetch/fetch.html +55 -0
  12. package/site/.vitepress/dist/api/webflo-routing/HttpCookies.html +55 -0
  13. package/site/.vitepress/dist/api/webflo-routing/HttpEvent/respondWith.html +55 -0
  14. package/site/.vitepress/dist/api/webflo-routing/HttpEvent/waitUntil.html +55 -0
  15. package/site/.vitepress/dist/api/webflo-routing/HttpEvent/waitUntilNavigate.html +55 -0
  16. package/site/.vitepress/dist/api/webflo-routing/HttpEvent.html +55 -0
  17. package/site/.vitepress/dist/api/webflo-routing/HttpSession.html +55 -0
  18. package/site/.vitepress/dist/api/webflo-routing/HttpState.html +55 -0
  19. package/site/.vitepress/dist/api/webflo-routing/HttpUser.html +55 -0
  20. package/site/.vitepress/dist/api/webflo-routing/handler/fetch.html +59 -0
  21. package/site/.vitepress/dist/api/webflo-routing/handler/next.html +61 -0
  22. package/site/.vitepress/dist/api/webflo-routing/handler.html +65 -0
  23. package/site/.vitepress/dist/api.html +55 -0
  24. package/site/.vitepress/dist/assets/-__.md.wD5kDRhS.js +1 -0
  25. package/site/.vitepress/dist/assets/-__.md.wD5kDRhS.lean.js +1 -0
  26. package/site/.vitepress/dist/assets/-_docs.old.md.CiqucE_1.js +625 -0
  27. package/site/.vitepress/dist/assets/-_docs.old.md.CiqucE_1.lean.js +1 -0
  28. package/site/.vitepress/dist/assets/api.md.C9KRNLi_.js +1 -0
  29. package/site/.vitepress/dist/assets/api.md.C9KRNLi_.lean.js +1 -0
  30. package/site/.vitepress/dist/assets/api_webflo-fetch_FormData.md.CDuexUTz.js +1 -0
  31. package/site/.vitepress/dist/assets/api_webflo-fetch_FormData.md.CDuexUTz.lean.js +1 -0
  32. package/site/.vitepress/dist/assets/api_webflo-fetch_Headers.md.Cl_4-FUP.js +1 -0
  33. package/site/.vitepress/dist/assets/api_webflo-fetch_Headers.md.Cl_4-FUP.lean.js +1 -0
  34. package/site/.vitepress/dist/assets/api_webflo-fetch_LiveResponse.md.BMidKMB1.js +1 -0
  35. package/site/.vitepress/dist/assets/api_webflo-fetch_LiveResponse.md.BMidKMB1.lean.js +1 -0
  36. package/site/.vitepress/dist/assets/api_webflo-fetch_Request.md.DPwZCPmi.js +1 -0
  37. package/site/.vitepress/dist/assets/api_webflo-fetch_Request.md.DPwZCPmi.lean.js +1 -0
  38. package/site/.vitepress/dist/assets/api_webflo-fetch_Response.md.BaSyoOLE.js +1 -0
  39. package/site/.vitepress/dist/assets/api_webflo-fetch_Response.md.BaSyoOLE.lean.js +1 -0
  40. package/site/.vitepress/dist/assets/api_webflo-fetch_fetch.md.Bc9r3Q9I.js +1 -0
  41. package/site/.vitepress/dist/assets/api_webflo-fetch_fetch.md.Bc9r3Q9I.lean.js +1 -0
  42. package/site/.vitepress/dist/assets/api_webflo-routing_HttpCookies.md.B5ok3jrM.js +1 -0
  43. package/site/.vitepress/dist/assets/api_webflo-routing_HttpCookies.md.B5ok3jrM.lean.js +1 -0
  44. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent.md.DBkSQRTa.js +1 -0
  45. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent.md.DBkSQRTa.lean.js +1 -0
  46. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_respondWith.md.aAxq-5Ie.js +1 -0
  47. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_respondWith.md.aAxq-5Ie.lean.js +1 -0
  48. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntil.md.DyQZLhPR.js +1 -0
  49. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntil.md.DyQZLhPR.lean.js +1 -0
  50. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntilNavigate.md.DKLylwhl.js +1 -0
  51. package/site/.vitepress/dist/assets/api_webflo-routing_HttpEvent_waitUntilNavigate.md.DKLylwhl.lean.js +1 -0
  52. package/site/.vitepress/dist/assets/api_webflo-routing_HttpSession.md.bkeCy7_Q.js +1 -0
  53. package/site/.vitepress/dist/assets/api_webflo-routing_HttpSession.md.bkeCy7_Q.lean.js +1 -0
  54. package/site/.vitepress/dist/assets/api_webflo-routing_HttpState.md.DO53IAM1.js +1 -0
  55. package/site/.vitepress/dist/assets/api_webflo-routing_HttpState.md.DO53IAM1.lean.js +1 -0
  56. package/site/.vitepress/dist/assets/api_webflo-routing_HttpUser.md.CfsaBFdl.js +1 -0
  57. package/site/.vitepress/dist/assets/api_webflo-routing_HttpUser.md.CfsaBFdl.lean.js +1 -0
  58. package/site/.vitepress/dist/assets/api_webflo-routing_handler.md.B0eVFluL.js +11 -0
  59. package/site/.vitepress/dist/assets/api_webflo-routing_handler.md.B0eVFluL.lean.js +1 -0
  60. package/site/.vitepress/dist/assets/api_webflo-routing_handler_fetch.md.CpwUMFMz.js +1 -0
  61. package/site/.vitepress/dist/assets/api_webflo-routing_handler_fetch.md.CpwUMFMz.lean.js +1 -0
  62. package/site/.vitepress/dist/assets/api_webflo-routing_handler_next.md.CA4tDXtV.js +7 -0
  63. package/site/.vitepress/dist/assets/api_webflo-routing_handler_next.md.CA4tDXtV.lean.js +1 -0
  64. package/site/.vitepress/dist/assets/app.B989j-Lw.js +256 -0
  65. package/site/.vitepress/dist/assets/chunks/@localSearchIndexroot.IcaIAE_s.js +1 -0
  66. package/site/.vitepress/dist/assets/chunks/VPLocalSearchBox.CxstEVOs.js +8 -0
  67. package/site/.vitepress/dist/assets/chunks/arc.CNNknwAo.js +1 -0
  68. package/site/.vitepress/dist/assets/chunks/architectureDiagram-VXUJARFQ.DCLYhNHD.js +36 -0
  69. package/site/.vitepress/dist/assets/chunks/basePickBy.Cxi84nlK.js +1 -0
  70. package/site/.vitepress/dist/assets/chunks/baseUniq.DDTOgUAc.js +1 -0
  71. package/site/.vitepress/dist/assets/chunks/blockDiagram-VD42YOAC.BcpiarhA.js +122 -0
  72. package/site/.vitepress/dist/assets/chunks/c4Diagram-YG6GDRKO.BI_5dKaW.js +10 -0
  73. package/site/.vitepress/dist/assets/chunks/channel.CxIJmpCu.js +1 -0
  74. package/site/.vitepress/dist/assets/chunks/chunk-4BX2VUAB.C6goADHj.js +1 -0
  75. package/site/.vitepress/dist/assets/chunks/chunk-55IACEB6.BLGj4Pud.js +1 -0
  76. package/site/.vitepress/dist/assets/chunks/chunk-B4BG7PRW.DsAzxoJ_.js +165 -0
  77. package/site/.vitepress/dist/assets/chunks/chunk-DI55MBZ5.BnE2NeEC.js +220 -0
  78. package/site/.vitepress/dist/assets/chunks/chunk-FMBD7UC4.DGeT8zu4.js +15 -0
  79. package/site/.vitepress/dist/assets/chunks/chunk-QN33PNHL.Bc78W0xn.js +1 -0
  80. package/site/.vitepress/dist/assets/chunks/chunk-QZHKN3VN.BFSSbGEs.js +1 -0
  81. package/site/.vitepress/dist/assets/chunks/chunk-TZMSLE5B.DyZR9PPb.js +1 -0
  82. package/site/.vitepress/dist/assets/chunks/classDiagram-2ON5EDUG._0fUH5ha.js +1 -0
  83. package/site/.vitepress/dist/assets/chunks/classDiagram-v2-WZHVMYZB._0fUH5ha.js +1 -0
  84. package/site/.vitepress/dist/assets/chunks/clone.BYyOtvOD.js +1 -0
  85. package/site/.vitepress/dist/assets/chunks/cose-bilkent-S5V4N54A.TlhUFBAR.js +1 -0
  86. package/site/.vitepress/dist/assets/chunks/cytoscape.esm.CyJtwmzi.js +331 -0
  87. package/site/.vitepress/dist/assets/chunks/dagre-6UL2VRFP.D__9IqfC.js +4 -0
  88. package/site/.vitepress/dist/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
  89. package/site/.vitepress/dist/assets/chunks/diagram-PSM6KHXK.DYSDWndU.js +24 -0
  90. package/site/.vitepress/dist/assets/chunks/diagram-QEK2KX5R.FZi2c8WB.js +43 -0
  91. package/site/.vitepress/dist/assets/chunks/diagram-S2PKOQOG.D-Xxss9Z.js +24 -0
  92. package/site/.vitepress/dist/assets/chunks/erDiagram-Q2GNP2WA.CNdrcxqE.js +60 -0
  93. package/site/.vitepress/dist/assets/chunks/flowDiagram-NV44I4VS.C_6PWuGm.js +162 -0
  94. package/site/.vitepress/dist/assets/chunks/framework.9Uv4PgnO.js +18 -0
  95. package/site/.vitepress/dist/assets/chunks/ganttDiagram-LVOFAZNH._TBJejxF.js +267 -0
  96. package/site/.vitepress/dist/assets/chunks/gitGraphDiagram-NY62KEGX.BmQODSWS.js +65 -0
  97. package/site/.vitepress/dist/assets/chunks/graph.BHWe3GDJ.js +1 -0
  98. package/site/.vitepress/dist/assets/chunks/infoDiagram-ER5ION4S.CbdOaGtv.js +2 -0
  99. package/site/.vitepress/dist/assets/chunks/init.Gi6I4Gst.js +1 -0
  100. package/site/.vitepress/dist/assets/chunks/journeyDiagram-XKPGCS4Q.B-PjYmDZ.js +139 -0
  101. package/site/.vitepress/dist/assets/chunks/kanban-definition-3W4ZIXB7.Bc_8e9KR.js +89 -0
  102. package/site/.vitepress/dist/assets/chunks/katex.BbEIqZs1.js +261 -0
  103. package/site/.vitepress/dist/assets/chunks/layout.hswMW8l0.js +1 -0
  104. package/site/.vitepress/dist/assets/chunks/linear.CUHYPplj.js +1 -0
  105. package/site/.vitepress/dist/assets/chunks/mindmap-definition-VGOIOE7T.CvIaZI8e.js +68 -0
  106. package/site/.vitepress/dist/assets/chunks/ordinal.BYWQX77i.js +1 -0
  107. package/site/.vitepress/dist/assets/chunks/pieDiagram-ADFJNKIX.BSTQM2Ms.js +30 -0
  108. package/site/.vitepress/dist/assets/chunks/quadrantDiagram-AYHSOK5B.CkEJjNYC.js +7 -0
  109. package/site/.vitepress/dist/assets/chunks/requirementDiagram-UZGBJVZJ.QsTahBza.js +64 -0
  110. package/site/.vitepress/dist/assets/chunks/sankeyDiagram-TZEHDZUN.NRsUNMzF.js +10 -0
  111. package/site/.vitepress/dist/assets/chunks/sequenceDiagram-WL72ISMW.rq-YLOb-.js +145 -0
  112. package/site/.vitepress/dist/assets/chunks/stateDiagram-FKZM4ZOC.BseVQjcW.js +1 -0
  113. package/site/.vitepress/dist/assets/chunks/stateDiagram-v2-4FDKWEC3.CH4mdaj_.js +1 -0
  114. package/site/.vitepress/dist/assets/chunks/theme.Jp0RA4YE.js +2 -0
  115. package/site/.vitepress/dist/assets/chunks/timeline-definition-IT6M3QCI.N8DNMk16.js +61 -0
  116. package/site/.vitepress/dist/assets/chunks/treemap-KMMF4GRG.CAwkr_aP.js +128 -0
  117. package/site/.vitepress/dist/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
  118. package/site/.vitepress/dist/assets/chunks/xychartDiagram-PRI3JC2R.CF4KVQhG.js +7 -0
  119. package/site/.vitepress/dist/assets/contributing.md.gqIMCtVI.js +1 -0
  120. package/site/.vitepress/dist/assets/contributing.md.gqIMCtVI.lean.js +1 -0
  121. package/site/.vitepress/dist/assets/docs.md.hvbqYbFY.js +1 -0
  122. package/site/.vitepress/dist/assets/docs.md.hvbqYbFY.lean.js +1 -0
  123. package/site/.vitepress/dist/assets/docs_advanced.md.D048cxnq.js +1 -0
  124. package/site/.vitepress/dist/assets/docs_advanced.md.D048cxnq.lean.js +1 -0
  125. package/site/.vitepress/dist/assets/docs_advanced_lifecycles.md.BICPL-da.js +1 -0
  126. package/site/.vitepress/dist/assets/docs_advanced_lifecycles.md.BICPL-da.lean.js +1 -0
  127. package/site/.vitepress/dist/assets/docs_advanced_redirects.md.BMha6D3W.js +1 -0
  128. package/site/.vitepress/dist/assets/docs_advanced_redirects.md.BMha6D3W.lean.js +1 -0
  129. package/site/.vitepress/dist/assets/docs_advanced_routing.md.Cv63UDJF.js +1 -0
  130. package/site/.vitepress/dist/assets/docs_advanced_routing.md.Cv63UDJF.lean.js +1 -0
  131. package/site/.vitepress/dist/assets/docs_concepts.md.Clwx81Hz.js +3 -0
  132. package/site/.vitepress/dist/assets/docs_concepts.md.Clwx81Hz.lean.js +1 -0
  133. package/site/.vitepress/dist/assets/docs_concepts_realtime.md.CBrMq5Ln.js +218 -0
  134. package/site/.vitepress/dist/assets/docs_concepts_realtime.md.CBrMq5Ln.lean.js +1 -0
  135. package/site/.vitepress/dist/assets/docs_concepts_rendering.md.BWr5Lxgn.js +24 -0
  136. package/site/.vitepress/dist/assets/docs_concepts_rendering.md.BWr5Lxgn.lean.js +1 -0
  137. package/site/.vitepress/dist/assets/docs_concepts_request-response.md.DhplzNqt.js +4 -0
  138. package/site/.vitepress/dist/assets/docs_concepts_request-response.md.DhplzNqt.lean.js +1 -0
  139. package/site/.vitepress/dist/assets/docs_concepts_routing.md.C2KO1eAu.js +228 -0
  140. package/site/.vitepress/dist/assets/docs_concepts_routing.md.C2KO1eAu.lean.js +1 -0
  141. package/site/.vitepress/dist/assets/docs_concepts_state.md.CtbMVS_K.js +10 -0
  142. package/site/.vitepress/dist/assets/docs_concepts_state.md.CtbMVS_K.lean.js +1 -0
  143. package/site/.vitepress/dist/assets/docs_concepts_templates.md.4i6jQcYw.js +15 -0
  144. package/site/.vitepress/dist/assets/docs_concepts_templates.md.4i6jQcYw.lean.js +1 -0
  145. package/site/.vitepress/dist/assets/docs_getting-started.md.CNGtwB_L.js +75 -0
  146. package/site/.vitepress/dist/assets/docs_getting-started.md.CNGtwB_L.lean.js +1 -0
  147. package/site/.vitepress/dist/assets/docs_tech-stack.md.xiWGQstL.js +1 -0
  148. package/site/.vitepress/dist/assets/docs_tech-stack.md.xiWGQstL.lean.js +1 -0
  149. package/site/.vitepress/dist/assets/examples.md.BqDfJd4G.js +1 -0
  150. package/site/.vitepress/dist/assets/examples.md.BqDfJd4G.lean.js +1 -0
  151. package/site/.vitepress/dist/assets/examples_pwa.md.DREN7J2F.js +1 -0
  152. package/site/.vitepress/dist/assets/examples_pwa.md.DREN7J2F.lean.js +1 -0
  153. package/site/.vitepress/dist/assets/examples_web.md.DUhZ0IQL.js +1 -0
  154. package/site/.vitepress/dist/assets/examples_web.md.DUhZ0IQL.lean.js +1 -0
  155. package/site/.vitepress/dist/assets/faq.md.DtfXaXUI.js +1 -0
  156. package/site/.vitepress/dist/assets/faq.md.DtfXaXUI.lean.js +1 -0
  157. package/site/.vitepress/dist/assets/guides.md.BVdQyeU-.js +1 -0
  158. package/site/.vitepress/dist/assets/guides.md.BVdQyeU-.lean.js +1 -0
  159. package/site/.vitepress/dist/assets/guides_guide-auth.md.DNFuRudp.js +1 -0
  160. package/site/.vitepress/dist/assets/guides_guide-auth.md.DNFuRudp.lean.js +1 -0
  161. package/site/.vitepress/dist/assets/guides_guide-file-upload.md.DRbRLk7h.js +1 -0
  162. package/site/.vitepress/dist/assets/guides_guide-file-upload.md.DRbRLk7h.lean.js +1 -0
  163. package/site/.vitepress/dist/assets/guides_guide-service-worker.md.B0wEVcQw.js +1 -0
  164. package/site/.vitepress/dist/assets/guides_guide-service-worker.md.B0wEVcQw.lean.js +1 -0
  165. package/site/.vitepress/dist/assets/guides_tutorial-1-todo.md.D9ket3Re.js +3 -0
  166. package/site/.vitepress/dist/assets/guides_tutorial-1-todo.md.D9ket3Re.lean.js +1 -0
  167. package/site/.vitepress/dist/assets/index.md.DB-CsGEX.js +1 -0
  168. package/site/.vitepress/dist/assets/index.md.DB-CsGEX.lean.js +1 -0
  169. package/site/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  170. package/site/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  171. package/site/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  172. package/site/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  173. package/site/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  174. package/site/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  175. package/site/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  176. package/site/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  177. package/site/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  178. package/site/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  179. package/site/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  180. package/site/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  181. package/site/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  182. package/site/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  183. package/site/.vitepress/dist/assets/recipes_realtime.md.CX1Vs2FD.js +1 -0
  184. package/site/.vitepress/dist/assets/recipes_realtime.md.CX1Vs2FD.lean.js +1 -0
  185. package/site/.vitepress/dist/assets/recipes_streaming.md.C7GFShgF.js +5 -0
  186. package/site/.vitepress/dist/assets/recipes_streaming.md.C7GFShgF.lean.js +1 -0
  187. package/site/.vitepress/dist/assets/reference_cli.md.DERqaQJm.js +1 -0
  188. package/site/.vitepress/dist/assets/reference_cli.md.DERqaQJm.lean.js +1 -0
  189. package/site/.vitepress/dist/assets/reference_config.md.DI_yG-7N.js +1 -0
  190. package/site/.vitepress/dist/assets/reference_config.md.DI_yG-7N.lean.js +1 -0
  191. package/site/.vitepress/dist/assets/reference_tools.md.DZxjdVFX.js +1 -0
  192. package/site/.vitepress/dist/assets/reference_tools.md.DZxjdVFX.lean.js +1 -0
  193. package/site/.vitepress/dist/assets/style.BD0LzINo.css +1 -0
  194. package/site/.vitepress/dist/contributing.html +55 -0
  195. package/site/.vitepress/dist/docs/advanced/lifecycles.html +55 -0
  196. package/site/.vitepress/dist/docs/advanced/redirects.html +55 -0
  197. package/site/.vitepress/dist/docs/advanced/routing.html +55 -0
  198. package/site/.vitepress/dist/docs/advanced.html +55 -0
  199. package/site/.vitepress/dist/docs/concepts/realtime.html +272 -0
  200. package/site/.vitepress/dist/docs/concepts/rendering.html +78 -0
  201. package/site/.vitepress/dist/docs/concepts/request-response.html +58 -0
  202. package/site/.vitepress/dist/docs/concepts/routing.html +282 -0
  203. package/site/.vitepress/dist/docs/concepts/state.html +64 -0
  204. package/site/.vitepress/dist/docs/concepts/templates.html +69 -0
  205. package/site/.vitepress/dist/docs/concepts.html +57 -0
  206. package/site/.vitepress/dist/docs/getting-started.html +129 -0
  207. package/site/.vitepress/dist/docs/tech-stack.html +55 -0
  208. package/site/.vitepress/dist/docs.html +55 -0
  209. package/site/.vitepress/dist/examples/pwa.html +55 -0
  210. package/site/.vitepress/dist/examples/web.html +55 -0
  211. package/site/.vitepress/dist/examples.html +55 -0
  212. package/site/.vitepress/dist/faq.html +55 -0
  213. package/site/.vitepress/dist/guides/guide-auth.html +55 -0
  214. package/site/.vitepress/dist/guides/guide-file-upload.html +55 -0
  215. package/site/.vitepress/dist/guides/guide-service-worker.html +55 -0
  216. package/site/.vitepress/dist/guides/tutorial-1-todo.html +57 -0
  217. package/site/.vitepress/dist/guides.html +55 -0
  218. package/site/.vitepress/dist/hashmap.json +1 -0
  219. package/site/.vitepress/dist/img/brand/logo-670x670.png +0 -0
  220. package/site/.vitepress/dist/index.html +55 -0
  221. package/site/.vitepress/dist/recipes/realtime.html +55 -0
  222. package/site/.vitepress/dist/recipes/streaming.html +59 -0
  223. package/site/.vitepress/dist/reference/cli.html +55 -0
  224. package/site/.vitepress/dist/reference/config.html +55 -0
  225. package/site/.vitepress/dist/reference/tools.html +55 -0
  226. package/site/.vitepress/dist/vp-icons.css +1 -0
  227. package/site/.vitepress/cache/deps/@braintree_sanitize-url 2.js +0 -93
  228. package/site/.vitepress/cache/deps/@braintree_sanitize-url.js 2.map +0 -7
  229. package/site/.vitepress/cache/deps/_metadata 2.json +0 -85
  230. package/site/.vitepress/cache/deps/_metadata.json +0 -85
  231. package/site/.vitepress/cache/deps/chunk-BUSYA2B4 2.js +0 -9
  232. package/site/.vitepress/cache/deps/chunk-BUSYA2B4.js 2.map +0 -7
  233. package/site/.vitepress/cache/deps/chunk-Q2AYPHVK 2.js +0 -9719
  234. package/site/.vitepress/cache/deps/chunk-Q2AYPHVK.js 2.map +0 -7
  235. package/site/.vitepress/cache/deps/chunk-QAXAIFA7 2.js +0 -12705
  236. package/site/.vitepress/cache/deps/chunk-QAXAIFA7.js 2.map +0 -7
  237. package/site/.vitepress/cache/deps/cytoscape 2.js +0 -30278
  238. package/site/.vitepress/cache/deps/cytoscape-cose-bilkent 2.js +0 -4710
  239. package/site/.vitepress/cache/deps/cytoscape-cose-bilkent.js 2.map +0 -7
  240. package/site/.vitepress/cache/deps/cytoscape.js 2.map +0 -7
  241. package/site/.vitepress/cache/deps/dayjs 2.js +0 -285
  242. package/site/.vitepress/cache/deps/dayjs.js 2.map +0 -7
  243. package/site/.vitepress/cache/deps/debug 2.js +0 -453
  244. package/site/.vitepress/cache/deps/debug.js 2.map +0 -7
  245. package/site/.vitepress/cache/deps/package 2.json +0 -3
  246. package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api 2.js +0 -4507
  247. package/site/.vitepress/cache/deps/vitepress___@vue_devtools-api.js 2.map +0 -7
  248. package/site/.vitepress/cache/deps/vitepress___@vueuse_core 2.js +0 -584
  249. package/site/.vitepress/cache/deps/vitepress___@vueuse_core.js 2.map +0 -7
  250. package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap 2.js +0 -1166
  251. package/site/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js 2.map +0 -7
  252. package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js 2.js +0 -1667
  253. package/site/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js 2.map +0 -7
  254. package/site/.vitepress/cache/deps/vitepress___minisearch 2.js +0 -1815
  255. package/site/.vitepress/cache/deps/vitepress___minisearch.js 2.map +0 -7
  256. package/site/.vitepress/cache/deps/vue 2.js +0 -344
  257. package/site/.vitepress/cache/deps/vue.js 2.map +0 -7
  258. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/@braintree_sanitize-url.js +0 -0
  259. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/@braintree_sanitize-url.js.map +0 -0
  260. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/chunk-BUSYA2B4.js +0 -0
  261. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/chunk-BUSYA2B4.js.map +0 -0
  262. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/chunk-Q2AYPHVK.js +0 -0
  263. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/chunk-Q2AYPHVK.js.map +0 -0
  264. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/chunk-QAXAIFA7.js +0 -0
  265. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/chunk-QAXAIFA7.js.map +0 -0
  266. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/cytoscape-cose-bilkent.js +0 -0
  267. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/cytoscape-cose-bilkent.js.map +0 -0
  268. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/cytoscape.js +0 -0
  269. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/cytoscape.js.map +0 -0
  270. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/dayjs.js +0 -0
  271. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/dayjs.js.map +0 -0
  272. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/debug.js +0 -0
  273. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/debug.js.map +0 -0
  274. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/package.json +0 -0
  275. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___@vue_devtools-api.js +0 -0
  276. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___@vue_devtools-api.js.map +0 -0
  277. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___@vueuse_core.js +0 -0
  278. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___@vueuse_core.js.map +0 -0
  279. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___@vueuse_integrations_useFocusTrap.js +0 -0
  280. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___@vueuse_integrations_useFocusTrap.js.map +0 -0
  281. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___mark__js_src_vanilla__js.js +0 -0
  282. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___mark__js_src_vanilla__js.js.map +0 -0
  283. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___minisearch.js +0 -0
  284. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vitepress___minisearch.js.map +0 -0
  285. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vue.js +0 -0
  286. /package/site/.vitepress/cache/{deps → deps_temp_9b107c53}/vue.js.map +0 -0
@@ -1,4710 +0,0 @@
1
- import {
2
- __commonJS
3
- } from "./chunk-BUSYA2B4.js";
4
-
5
- // node_modules/layout-base/layout-base.js
6
- var require_layout_base = __commonJS({
7
- "node_modules/layout-base/layout-base.js"(exports, module) {
8
- (function webpackUniversalModuleDefinition(root, factory) {
9
- if (typeof exports === "object" && typeof module === "object")
10
- module.exports = factory();
11
- else if (typeof define === "function" && define.amd)
12
- define([], factory);
13
- else if (typeof exports === "object")
14
- exports["layoutBase"] = factory();
15
- else
16
- root["layoutBase"] = factory();
17
- })(exports, function() {
18
- return (
19
- /******/
20
- function(modules) {
21
- var installedModules = {};
22
- function __webpack_require__(moduleId) {
23
- if (installedModules[moduleId]) {
24
- return installedModules[moduleId].exports;
25
- }
26
- var module2 = installedModules[moduleId] = {
27
- /******/
28
- i: moduleId,
29
- /******/
30
- l: false,
31
- /******/
32
- exports: {}
33
- /******/
34
- };
35
- modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
36
- module2.l = true;
37
- return module2.exports;
38
- }
39
- __webpack_require__.m = modules;
40
- __webpack_require__.c = installedModules;
41
- __webpack_require__.i = function(value) {
42
- return value;
43
- };
44
- __webpack_require__.d = function(exports2, name, getter) {
45
- if (!__webpack_require__.o(exports2, name)) {
46
- Object.defineProperty(exports2, name, {
47
- /******/
48
- configurable: false,
49
- /******/
50
- enumerable: true,
51
- /******/
52
- get: getter
53
- /******/
54
- });
55
- }
56
- };
57
- __webpack_require__.n = function(module2) {
58
- var getter = module2 && module2.__esModule ? (
59
- /******/
60
- function getDefault() {
61
- return module2["default"];
62
- }
63
- ) : (
64
- /******/
65
- function getModuleExports() {
66
- return module2;
67
- }
68
- );
69
- __webpack_require__.d(getter, "a", getter);
70
- return getter;
71
- };
72
- __webpack_require__.o = function(object, property) {
73
- return Object.prototype.hasOwnProperty.call(object, property);
74
- };
75
- __webpack_require__.p = "";
76
- return __webpack_require__(__webpack_require__.s = 26);
77
- }([
78
- /* 0 */
79
- /***/
80
- function(module2, exports2, __webpack_require__) {
81
- "use strict";
82
- function LayoutConstants() {
83
- }
84
- LayoutConstants.QUALITY = 1;
85
- LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED = false;
86
- LayoutConstants.DEFAULT_INCREMENTAL = false;
87
- LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT = true;
88
- LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT = false;
89
- LayoutConstants.DEFAULT_ANIMATION_PERIOD = 50;
90
- LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false;
91
- LayoutConstants.DEFAULT_GRAPH_MARGIN = 15;
92
- LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = false;
93
- LayoutConstants.SIMPLE_NODE_SIZE = 40;
94
- LayoutConstants.SIMPLE_NODE_HALF_SIZE = LayoutConstants.SIMPLE_NODE_SIZE / 2;
95
- LayoutConstants.EMPTY_COMPOUND_NODE_SIZE = 40;
96
- LayoutConstants.MIN_EDGE_LENGTH = 1;
97
- LayoutConstants.WORLD_BOUNDARY = 1e6;
98
- LayoutConstants.INITIAL_WORLD_BOUNDARY = LayoutConstants.WORLD_BOUNDARY / 1e3;
99
- LayoutConstants.WORLD_CENTER_X = 1200;
100
- LayoutConstants.WORLD_CENTER_Y = 900;
101
- module2.exports = LayoutConstants;
102
- },
103
- /* 1 */
104
- /***/
105
- function(module2, exports2, __webpack_require__) {
106
- "use strict";
107
- var LGraphObject = __webpack_require__(2);
108
- var IGeometry = __webpack_require__(8);
109
- var IMath = __webpack_require__(9);
110
- function LEdge(source, target, vEdge) {
111
- LGraphObject.call(this, vEdge);
112
- this.isOverlapingSourceAndTarget = false;
113
- this.vGraphObject = vEdge;
114
- this.bendpoints = [];
115
- this.source = source;
116
- this.target = target;
117
- }
118
- LEdge.prototype = Object.create(LGraphObject.prototype);
119
- for (var prop in LGraphObject) {
120
- LEdge[prop] = LGraphObject[prop];
121
- }
122
- LEdge.prototype.getSource = function() {
123
- return this.source;
124
- };
125
- LEdge.prototype.getTarget = function() {
126
- return this.target;
127
- };
128
- LEdge.prototype.isInterGraph = function() {
129
- return this.isInterGraph;
130
- };
131
- LEdge.prototype.getLength = function() {
132
- return this.length;
133
- };
134
- LEdge.prototype.isOverlapingSourceAndTarget = function() {
135
- return this.isOverlapingSourceAndTarget;
136
- };
137
- LEdge.prototype.getBendpoints = function() {
138
- return this.bendpoints;
139
- };
140
- LEdge.prototype.getLca = function() {
141
- return this.lca;
142
- };
143
- LEdge.prototype.getSourceInLca = function() {
144
- return this.sourceInLca;
145
- };
146
- LEdge.prototype.getTargetInLca = function() {
147
- return this.targetInLca;
148
- };
149
- LEdge.prototype.getOtherEnd = function(node) {
150
- if (this.source === node) {
151
- return this.target;
152
- } else if (this.target === node) {
153
- return this.source;
154
- } else {
155
- throw "Node is not incident with this edge";
156
- }
157
- };
158
- LEdge.prototype.getOtherEndInGraph = function(node, graph) {
159
- var otherEnd = this.getOtherEnd(node);
160
- var root = graph.getGraphManager().getRoot();
161
- while (true) {
162
- if (otherEnd.getOwner() == graph) {
163
- return otherEnd;
164
- }
165
- if (otherEnd.getOwner() == root) {
166
- break;
167
- }
168
- otherEnd = otherEnd.getOwner().getParent();
169
- }
170
- return null;
171
- };
172
- LEdge.prototype.updateLength = function() {
173
- var clipPointCoordinates = new Array(4);
174
- this.isOverlapingSourceAndTarget = IGeometry.getIntersection(this.target.getRect(), this.source.getRect(), clipPointCoordinates);
175
- if (!this.isOverlapingSourceAndTarget) {
176
- this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2];
177
- this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3];
178
- if (Math.abs(this.lengthX) < 1) {
179
- this.lengthX = IMath.sign(this.lengthX);
180
- }
181
- if (Math.abs(this.lengthY) < 1) {
182
- this.lengthY = IMath.sign(this.lengthY);
183
- }
184
- this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
185
- }
186
- };
187
- LEdge.prototype.updateLengthSimple = function() {
188
- this.lengthX = this.target.getCenterX() - this.source.getCenterX();
189
- this.lengthY = this.target.getCenterY() - this.source.getCenterY();
190
- if (Math.abs(this.lengthX) < 1) {
191
- this.lengthX = IMath.sign(this.lengthX);
192
- }
193
- if (Math.abs(this.lengthY) < 1) {
194
- this.lengthY = IMath.sign(this.lengthY);
195
- }
196
- this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
197
- };
198
- module2.exports = LEdge;
199
- },
200
- /* 2 */
201
- /***/
202
- function(module2, exports2, __webpack_require__) {
203
- "use strict";
204
- function LGraphObject(vGraphObject) {
205
- this.vGraphObject = vGraphObject;
206
- }
207
- module2.exports = LGraphObject;
208
- },
209
- /* 3 */
210
- /***/
211
- function(module2, exports2, __webpack_require__) {
212
- "use strict";
213
- var LGraphObject = __webpack_require__(2);
214
- var Integer = __webpack_require__(10);
215
- var RectangleD = __webpack_require__(13);
216
- var LayoutConstants = __webpack_require__(0);
217
- var RandomSeed = __webpack_require__(16);
218
- var PointD = __webpack_require__(4);
219
- function LNode(gm, loc, size, vNode) {
220
- if (size == null && vNode == null) {
221
- vNode = loc;
222
- }
223
- LGraphObject.call(this, vNode);
224
- if (gm.graphManager != null) gm = gm.graphManager;
225
- this.estimatedSize = Integer.MIN_VALUE;
226
- this.inclusionTreeDepth = Integer.MAX_VALUE;
227
- this.vGraphObject = vNode;
228
- this.edges = [];
229
- this.graphManager = gm;
230
- if (size != null && loc != null) this.rect = new RectangleD(loc.x, loc.y, size.width, size.height);
231
- else this.rect = new RectangleD();
232
- }
233
- LNode.prototype = Object.create(LGraphObject.prototype);
234
- for (var prop in LGraphObject) {
235
- LNode[prop] = LGraphObject[prop];
236
- }
237
- LNode.prototype.getEdges = function() {
238
- return this.edges;
239
- };
240
- LNode.prototype.getChild = function() {
241
- return this.child;
242
- };
243
- LNode.prototype.getOwner = function() {
244
- return this.owner;
245
- };
246
- LNode.prototype.getWidth = function() {
247
- return this.rect.width;
248
- };
249
- LNode.prototype.setWidth = function(width) {
250
- this.rect.width = width;
251
- };
252
- LNode.prototype.getHeight = function() {
253
- return this.rect.height;
254
- };
255
- LNode.prototype.setHeight = function(height) {
256
- this.rect.height = height;
257
- };
258
- LNode.prototype.getCenterX = function() {
259
- return this.rect.x + this.rect.width / 2;
260
- };
261
- LNode.prototype.getCenterY = function() {
262
- return this.rect.y + this.rect.height / 2;
263
- };
264
- LNode.prototype.getCenter = function() {
265
- return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
266
- };
267
- LNode.prototype.getLocation = function() {
268
- return new PointD(this.rect.x, this.rect.y);
269
- };
270
- LNode.prototype.getRect = function() {
271
- return this.rect;
272
- };
273
- LNode.prototype.getDiagonal = function() {
274
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
275
- };
276
- LNode.prototype.getHalfTheDiagonal = function() {
277
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
278
- };
279
- LNode.prototype.setRect = function(upperLeft, dimension) {
280
- this.rect.x = upperLeft.x;
281
- this.rect.y = upperLeft.y;
282
- this.rect.width = dimension.width;
283
- this.rect.height = dimension.height;
284
- };
285
- LNode.prototype.setCenter = function(cx, cy) {
286
- this.rect.x = cx - this.rect.width / 2;
287
- this.rect.y = cy - this.rect.height / 2;
288
- };
289
- LNode.prototype.setLocation = function(x, y) {
290
- this.rect.x = x;
291
- this.rect.y = y;
292
- };
293
- LNode.prototype.moveBy = function(dx, dy) {
294
- this.rect.x += dx;
295
- this.rect.y += dy;
296
- };
297
- LNode.prototype.getEdgeListToNode = function(to) {
298
- var edgeList = [];
299
- var edge;
300
- var self = this;
301
- self.edges.forEach(function(edge2) {
302
- if (edge2.target == to) {
303
- if (edge2.source != self) throw "Incorrect edge source!";
304
- edgeList.push(edge2);
305
- }
306
- });
307
- return edgeList;
308
- };
309
- LNode.prototype.getEdgesBetween = function(other) {
310
- var edgeList = [];
311
- var edge;
312
- var self = this;
313
- self.edges.forEach(function(edge2) {
314
- if (!(edge2.source == self || edge2.target == self)) throw "Incorrect edge source and/or target";
315
- if (edge2.target == other || edge2.source == other) {
316
- edgeList.push(edge2);
317
- }
318
- });
319
- return edgeList;
320
- };
321
- LNode.prototype.getNeighborsList = function() {
322
- var neighbors = /* @__PURE__ */ new Set();
323
- var self = this;
324
- self.edges.forEach(function(edge) {
325
- if (edge.source == self) {
326
- neighbors.add(edge.target);
327
- } else {
328
- if (edge.target != self) {
329
- throw "Incorrect incidency!";
330
- }
331
- neighbors.add(edge.source);
332
- }
333
- });
334
- return neighbors;
335
- };
336
- LNode.prototype.withChildren = function() {
337
- var withNeighborsList = /* @__PURE__ */ new Set();
338
- var childNode;
339
- var children;
340
- withNeighborsList.add(this);
341
- if (this.child != null) {
342
- var nodes = this.child.getNodes();
343
- for (var i = 0; i < nodes.length; i++) {
344
- childNode = nodes[i];
345
- children = childNode.withChildren();
346
- children.forEach(function(node) {
347
- withNeighborsList.add(node);
348
- });
349
- }
350
- }
351
- return withNeighborsList;
352
- };
353
- LNode.prototype.getNoOfChildren = function() {
354
- var noOfChildren = 0;
355
- var childNode;
356
- if (this.child == null) {
357
- noOfChildren = 1;
358
- } else {
359
- var nodes = this.child.getNodes();
360
- for (var i = 0; i < nodes.length; i++) {
361
- childNode = nodes[i];
362
- noOfChildren += childNode.getNoOfChildren();
363
- }
364
- }
365
- if (noOfChildren == 0) {
366
- noOfChildren = 1;
367
- }
368
- return noOfChildren;
369
- };
370
- LNode.prototype.getEstimatedSize = function() {
371
- if (this.estimatedSize == Integer.MIN_VALUE) {
372
- throw "assert failed";
373
- }
374
- return this.estimatedSize;
375
- };
376
- LNode.prototype.calcEstimatedSize = function() {
377
- if (this.child == null) {
378
- return this.estimatedSize = (this.rect.width + this.rect.height) / 2;
379
- } else {
380
- this.estimatedSize = this.child.calcEstimatedSize();
381
- this.rect.width = this.estimatedSize;
382
- this.rect.height = this.estimatedSize;
383
- return this.estimatedSize;
384
- }
385
- };
386
- LNode.prototype.scatter = function() {
387
- var randomCenterX;
388
- var randomCenterY;
389
- var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY;
390
- var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY;
391
- randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX;
392
- var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY;
393
- var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY;
394
- randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY;
395
- this.rect.x = randomCenterX;
396
- this.rect.y = randomCenterY;
397
- };
398
- LNode.prototype.updateBounds = function() {
399
- if (this.getChild() == null) {
400
- throw "assert failed";
401
- }
402
- if (this.getChild().getNodes().length != 0) {
403
- var childGraph = this.getChild();
404
- childGraph.updateBounds(true);
405
- this.rect.x = childGraph.getLeft();
406
- this.rect.y = childGraph.getTop();
407
- this.setWidth(childGraph.getRight() - childGraph.getLeft());
408
- this.setHeight(childGraph.getBottom() - childGraph.getTop());
409
- if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {
410
- var width = childGraph.getRight() - childGraph.getLeft();
411
- var height = childGraph.getBottom() - childGraph.getTop();
412
- if (this.labelWidth > width) {
413
- this.rect.x -= (this.labelWidth - width) / 2;
414
- this.setWidth(this.labelWidth);
415
- }
416
- if (this.labelHeight > height) {
417
- if (this.labelPos == "center") {
418
- this.rect.y -= (this.labelHeight - height) / 2;
419
- } else if (this.labelPos == "top") {
420
- this.rect.y -= this.labelHeight - height;
421
- }
422
- this.setHeight(this.labelHeight);
423
- }
424
- }
425
- }
426
- };
427
- LNode.prototype.getInclusionTreeDepth = function() {
428
- if (this.inclusionTreeDepth == Integer.MAX_VALUE) {
429
- throw "assert failed";
430
- }
431
- return this.inclusionTreeDepth;
432
- };
433
- LNode.prototype.transform = function(trans) {
434
- var left = this.rect.x;
435
- if (left > LayoutConstants.WORLD_BOUNDARY) {
436
- left = LayoutConstants.WORLD_BOUNDARY;
437
- } else if (left < -LayoutConstants.WORLD_BOUNDARY) {
438
- left = -LayoutConstants.WORLD_BOUNDARY;
439
- }
440
- var top = this.rect.y;
441
- if (top > LayoutConstants.WORLD_BOUNDARY) {
442
- top = LayoutConstants.WORLD_BOUNDARY;
443
- } else if (top < -LayoutConstants.WORLD_BOUNDARY) {
444
- top = -LayoutConstants.WORLD_BOUNDARY;
445
- }
446
- var leftTop = new PointD(left, top);
447
- var vLeftTop = trans.inverseTransformPoint(leftTop);
448
- this.setLocation(vLeftTop.x, vLeftTop.y);
449
- };
450
- LNode.prototype.getLeft = function() {
451
- return this.rect.x;
452
- };
453
- LNode.prototype.getRight = function() {
454
- return this.rect.x + this.rect.width;
455
- };
456
- LNode.prototype.getTop = function() {
457
- return this.rect.y;
458
- };
459
- LNode.prototype.getBottom = function() {
460
- return this.rect.y + this.rect.height;
461
- };
462
- LNode.prototype.getParent = function() {
463
- if (this.owner == null) {
464
- return null;
465
- }
466
- return this.owner.getParent();
467
- };
468
- module2.exports = LNode;
469
- },
470
- /* 4 */
471
- /***/
472
- function(module2, exports2, __webpack_require__) {
473
- "use strict";
474
- function PointD(x, y) {
475
- if (x == null && y == null) {
476
- this.x = 0;
477
- this.y = 0;
478
- } else {
479
- this.x = x;
480
- this.y = y;
481
- }
482
- }
483
- PointD.prototype.getX = function() {
484
- return this.x;
485
- };
486
- PointD.prototype.getY = function() {
487
- return this.y;
488
- };
489
- PointD.prototype.setX = function(x) {
490
- this.x = x;
491
- };
492
- PointD.prototype.setY = function(y) {
493
- this.y = y;
494
- };
495
- PointD.prototype.getDifference = function(pt) {
496
- return new DimensionD(this.x - pt.x, this.y - pt.y);
497
- };
498
- PointD.prototype.getCopy = function() {
499
- return new PointD(this.x, this.y);
500
- };
501
- PointD.prototype.translate = function(dim) {
502
- this.x += dim.width;
503
- this.y += dim.height;
504
- return this;
505
- };
506
- module2.exports = PointD;
507
- },
508
- /* 5 */
509
- /***/
510
- function(module2, exports2, __webpack_require__) {
511
- "use strict";
512
- var LGraphObject = __webpack_require__(2);
513
- var Integer = __webpack_require__(10);
514
- var LayoutConstants = __webpack_require__(0);
515
- var LGraphManager = __webpack_require__(6);
516
- var LNode = __webpack_require__(3);
517
- var LEdge = __webpack_require__(1);
518
- var RectangleD = __webpack_require__(13);
519
- var Point2 = __webpack_require__(12);
520
- var LinkedList = __webpack_require__(11);
521
- function LGraph(parent, obj2, vGraph) {
522
- LGraphObject.call(this, vGraph);
523
- this.estimatedSize = Integer.MIN_VALUE;
524
- this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN;
525
- this.edges = [];
526
- this.nodes = [];
527
- this.isConnected = false;
528
- this.parent = parent;
529
- if (obj2 != null && obj2 instanceof LGraphManager) {
530
- this.graphManager = obj2;
531
- } else if (obj2 != null && obj2 instanceof Layout) {
532
- this.graphManager = obj2.graphManager;
533
- }
534
- }
535
- LGraph.prototype = Object.create(LGraphObject.prototype);
536
- for (var prop in LGraphObject) {
537
- LGraph[prop] = LGraphObject[prop];
538
- }
539
- LGraph.prototype.getNodes = function() {
540
- return this.nodes;
541
- };
542
- LGraph.prototype.getEdges = function() {
543
- return this.edges;
544
- };
545
- LGraph.prototype.getGraphManager = function() {
546
- return this.graphManager;
547
- };
548
- LGraph.prototype.getParent = function() {
549
- return this.parent;
550
- };
551
- LGraph.prototype.getLeft = function() {
552
- return this.left;
553
- };
554
- LGraph.prototype.getRight = function() {
555
- return this.right;
556
- };
557
- LGraph.prototype.getTop = function() {
558
- return this.top;
559
- };
560
- LGraph.prototype.getBottom = function() {
561
- return this.bottom;
562
- };
563
- LGraph.prototype.isConnected = function() {
564
- return this.isConnected;
565
- };
566
- LGraph.prototype.add = function(obj1, sourceNode, targetNode) {
567
- if (sourceNode == null && targetNode == null) {
568
- var newNode = obj1;
569
- if (this.graphManager == null) {
570
- throw "Graph has no graph mgr!";
571
- }
572
- if (this.getNodes().indexOf(newNode) > -1) {
573
- throw "Node already in graph!";
574
- }
575
- newNode.owner = this;
576
- this.getNodes().push(newNode);
577
- return newNode;
578
- } else {
579
- var newEdge = obj1;
580
- if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) {
581
- throw "Source or target not in graph!";
582
- }
583
- if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) {
584
- throw "Both owners must be this graph!";
585
- }
586
- if (sourceNode.owner != targetNode.owner) {
587
- return null;
588
- }
589
- newEdge.source = sourceNode;
590
- newEdge.target = targetNode;
591
- newEdge.isInterGraph = false;
592
- this.getEdges().push(newEdge);
593
- sourceNode.edges.push(newEdge);
594
- if (targetNode != sourceNode) {
595
- targetNode.edges.push(newEdge);
596
- }
597
- return newEdge;
598
- }
599
- };
600
- LGraph.prototype.remove = function(obj) {
601
- var node = obj;
602
- if (obj instanceof LNode) {
603
- if (node == null) {
604
- throw "Node is null!";
605
- }
606
- if (!(node.owner != null && node.owner == this)) {
607
- throw "Owner graph is invalid!";
608
- }
609
- if (this.graphManager == null) {
610
- throw "Owner graph manager is invalid!";
611
- }
612
- var edgesToBeRemoved = node.edges.slice();
613
- var edge;
614
- var s = edgesToBeRemoved.length;
615
- for (var i = 0; i < s; i++) {
616
- edge = edgesToBeRemoved[i];
617
- if (edge.isInterGraph) {
618
- this.graphManager.remove(edge);
619
- } else {
620
- edge.source.owner.remove(edge);
621
- }
622
- }
623
- var index = this.nodes.indexOf(node);
624
- if (index == -1) {
625
- throw "Node not in owner node list!";
626
- }
627
- this.nodes.splice(index, 1);
628
- } else if (obj instanceof LEdge) {
629
- var edge = obj;
630
- if (edge == null) {
631
- throw "Edge is null!";
632
- }
633
- if (!(edge.source != null && edge.target != null)) {
634
- throw "Source and/or target is null!";
635
- }
636
- if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) {
637
- throw "Source and/or target owner is invalid!";
638
- }
639
- var sourceIndex = edge.source.edges.indexOf(edge);
640
- var targetIndex = edge.target.edges.indexOf(edge);
641
- if (!(sourceIndex > -1 && targetIndex > -1)) {
642
- throw "Source and/or target doesn't know this edge!";
643
- }
644
- edge.source.edges.splice(sourceIndex, 1);
645
- if (edge.target != edge.source) {
646
- edge.target.edges.splice(targetIndex, 1);
647
- }
648
- var index = edge.source.owner.getEdges().indexOf(edge);
649
- if (index == -1) {
650
- throw "Not in owner's edge list!";
651
- }
652
- edge.source.owner.getEdges().splice(index, 1);
653
- }
654
- };
655
- LGraph.prototype.updateLeftTop = function() {
656
- var top = Integer.MAX_VALUE;
657
- var left = Integer.MAX_VALUE;
658
- var nodeTop;
659
- var nodeLeft;
660
- var margin;
661
- var nodes = this.getNodes();
662
- var s = nodes.length;
663
- for (var i = 0; i < s; i++) {
664
- var lNode = nodes[i];
665
- nodeTop = lNode.getTop();
666
- nodeLeft = lNode.getLeft();
667
- if (top > nodeTop) {
668
- top = nodeTop;
669
- }
670
- if (left > nodeLeft) {
671
- left = nodeLeft;
672
- }
673
- }
674
- if (top == Integer.MAX_VALUE) {
675
- return null;
676
- }
677
- if (nodes[0].getParent().paddingLeft != void 0) {
678
- margin = nodes[0].getParent().paddingLeft;
679
- } else {
680
- margin = this.margin;
681
- }
682
- this.left = left - margin;
683
- this.top = top - margin;
684
- return new Point2(this.left, this.top);
685
- };
686
- LGraph.prototype.updateBounds = function(recursive) {
687
- var left = Integer.MAX_VALUE;
688
- var right = -Integer.MAX_VALUE;
689
- var top = Integer.MAX_VALUE;
690
- var bottom = -Integer.MAX_VALUE;
691
- var nodeLeft;
692
- var nodeRight;
693
- var nodeTop;
694
- var nodeBottom;
695
- var margin;
696
- var nodes = this.nodes;
697
- var s = nodes.length;
698
- for (var i = 0; i < s; i++) {
699
- var lNode = nodes[i];
700
- if (recursive && lNode.child != null) {
701
- lNode.updateBounds();
702
- }
703
- nodeLeft = lNode.getLeft();
704
- nodeRight = lNode.getRight();
705
- nodeTop = lNode.getTop();
706
- nodeBottom = lNode.getBottom();
707
- if (left > nodeLeft) {
708
- left = nodeLeft;
709
- }
710
- if (right < nodeRight) {
711
- right = nodeRight;
712
- }
713
- if (top > nodeTop) {
714
- top = nodeTop;
715
- }
716
- if (bottom < nodeBottom) {
717
- bottom = nodeBottom;
718
- }
719
- }
720
- var boundingRect = new RectangleD(left, top, right - left, bottom - top);
721
- if (left == Integer.MAX_VALUE) {
722
- this.left = this.parent.getLeft();
723
- this.right = this.parent.getRight();
724
- this.top = this.parent.getTop();
725
- this.bottom = this.parent.getBottom();
726
- }
727
- if (nodes[0].getParent().paddingLeft != void 0) {
728
- margin = nodes[0].getParent().paddingLeft;
729
- } else {
730
- margin = this.margin;
731
- }
732
- this.left = boundingRect.x - margin;
733
- this.right = boundingRect.x + boundingRect.width + margin;
734
- this.top = boundingRect.y - margin;
735
- this.bottom = boundingRect.y + boundingRect.height + margin;
736
- };
737
- LGraph.calculateBounds = function(nodes) {
738
- var left = Integer.MAX_VALUE;
739
- var right = -Integer.MAX_VALUE;
740
- var top = Integer.MAX_VALUE;
741
- var bottom = -Integer.MAX_VALUE;
742
- var nodeLeft;
743
- var nodeRight;
744
- var nodeTop;
745
- var nodeBottom;
746
- var s = nodes.length;
747
- for (var i = 0; i < s; i++) {
748
- var lNode = nodes[i];
749
- nodeLeft = lNode.getLeft();
750
- nodeRight = lNode.getRight();
751
- nodeTop = lNode.getTop();
752
- nodeBottom = lNode.getBottom();
753
- if (left > nodeLeft) {
754
- left = nodeLeft;
755
- }
756
- if (right < nodeRight) {
757
- right = nodeRight;
758
- }
759
- if (top > nodeTop) {
760
- top = nodeTop;
761
- }
762
- if (bottom < nodeBottom) {
763
- bottom = nodeBottom;
764
- }
765
- }
766
- var boundingRect = new RectangleD(left, top, right - left, bottom - top);
767
- return boundingRect;
768
- };
769
- LGraph.prototype.getInclusionTreeDepth = function() {
770
- if (this == this.graphManager.getRoot()) {
771
- return 1;
772
- } else {
773
- return this.parent.getInclusionTreeDepth();
774
- }
775
- };
776
- LGraph.prototype.getEstimatedSize = function() {
777
- if (this.estimatedSize == Integer.MIN_VALUE) {
778
- throw "assert failed";
779
- }
780
- return this.estimatedSize;
781
- };
782
- LGraph.prototype.calcEstimatedSize = function() {
783
- var size = 0;
784
- var nodes = this.nodes;
785
- var s = nodes.length;
786
- for (var i = 0; i < s; i++) {
787
- var lNode = nodes[i];
788
- size += lNode.calcEstimatedSize();
789
- }
790
- if (size == 0) {
791
- this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE;
792
- } else {
793
- this.estimatedSize = size / Math.sqrt(this.nodes.length);
794
- }
795
- return this.estimatedSize;
796
- };
797
- LGraph.prototype.updateConnected = function() {
798
- var self = this;
799
- if (this.nodes.length == 0) {
800
- this.isConnected = true;
801
- return;
802
- }
803
- var queue = new LinkedList();
804
- var visited = /* @__PURE__ */ new Set();
805
- var currentNode = this.nodes[0];
806
- var neighborEdges;
807
- var currentNeighbor;
808
- var childrenOfNode = currentNode.withChildren();
809
- childrenOfNode.forEach(function(node) {
810
- queue.push(node);
811
- visited.add(node);
812
- });
813
- while (queue.length !== 0) {
814
- currentNode = queue.shift();
815
- neighborEdges = currentNode.getEdges();
816
- var size = neighborEdges.length;
817
- for (var i = 0; i < size; i++) {
818
- var neighborEdge = neighborEdges[i];
819
- currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this);
820
- if (currentNeighbor != null && !visited.has(currentNeighbor)) {
821
- var childrenOfNeighbor = currentNeighbor.withChildren();
822
- childrenOfNeighbor.forEach(function(node) {
823
- queue.push(node);
824
- visited.add(node);
825
- });
826
- }
827
- }
828
- }
829
- this.isConnected = false;
830
- if (visited.size >= this.nodes.length) {
831
- var noOfVisitedInThisGraph = 0;
832
- visited.forEach(function(visitedNode) {
833
- if (visitedNode.owner == self) {
834
- noOfVisitedInThisGraph++;
835
- }
836
- });
837
- if (noOfVisitedInThisGraph == this.nodes.length) {
838
- this.isConnected = true;
839
- }
840
- }
841
- };
842
- module2.exports = LGraph;
843
- },
844
- /* 6 */
845
- /***/
846
- function(module2, exports2, __webpack_require__) {
847
- "use strict";
848
- var LGraph;
849
- var LEdge = __webpack_require__(1);
850
- function LGraphManager(layout) {
851
- LGraph = __webpack_require__(5);
852
- this.layout = layout;
853
- this.graphs = [];
854
- this.edges = [];
855
- }
856
- LGraphManager.prototype.addRoot = function() {
857
- var ngraph = this.layout.newGraph();
858
- var nnode = this.layout.newNode(null);
859
- var root = this.add(ngraph, nnode);
860
- this.setRootGraph(root);
861
- return this.rootGraph;
862
- };
863
- LGraphManager.prototype.add = function(newGraph, parentNode, newEdge, sourceNode, targetNode) {
864
- if (newEdge == null && sourceNode == null && targetNode == null) {
865
- if (newGraph == null) {
866
- throw "Graph is null!";
867
- }
868
- if (parentNode == null) {
869
- throw "Parent node is null!";
870
- }
871
- if (this.graphs.indexOf(newGraph) > -1) {
872
- throw "Graph already in this graph mgr!";
873
- }
874
- this.graphs.push(newGraph);
875
- if (newGraph.parent != null) {
876
- throw "Already has a parent!";
877
- }
878
- if (parentNode.child != null) {
879
- throw "Already has a child!";
880
- }
881
- newGraph.parent = parentNode;
882
- parentNode.child = newGraph;
883
- return newGraph;
884
- } else {
885
- targetNode = newEdge;
886
- sourceNode = parentNode;
887
- newEdge = newGraph;
888
- var sourceGraph = sourceNode.getOwner();
889
- var targetGraph = targetNode.getOwner();
890
- if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) {
891
- throw "Source not in this graph mgr!";
892
- }
893
- if (!(targetGraph != null && targetGraph.getGraphManager() == this)) {
894
- throw "Target not in this graph mgr!";
895
- }
896
- if (sourceGraph == targetGraph) {
897
- newEdge.isInterGraph = false;
898
- return sourceGraph.add(newEdge, sourceNode, targetNode);
899
- } else {
900
- newEdge.isInterGraph = true;
901
- newEdge.source = sourceNode;
902
- newEdge.target = targetNode;
903
- if (this.edges.indexOf(newEdge) > -1) {
904
- throw "Edge already in inter-graph edge list!";
905
- }
906
- this.edges.push(newEdge);
907
- if (!(newEdge.source != null && newEdge.target != null)) {
908
- throw "Edge source and/or target is null!";
909
- }
910
- if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) {
911
- throw "Edge already in source and/or target incidency list!";
912
- }
913
- newEdge.source.edges.push(newEdge);
914
- newEdge.target.edges.push(newEdge);
915
- return newEdge;
916
- }
917
- }
918
- };
919
- LGraphManager.prototype.remove = function(lObj) {
920
- if (lObj instanceof LGraph) {
921
- var graph = lObj;
922
- if (graph.getGraphManager() != this) {
923
- throw "Graph not in this graph mgr";
924
- }
925
- if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) {
926
- throw "Invalid parent node!";
927
- }
928
- var edgesToBeRemoved = [];
929
- edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges());
930
- var edge;
931
- var s = edgesToBeRemoved.length;
932
- for (var i = 0; i < s; i++) {
933
- edge = edgesToBeRemoved[i];
934
- graph.remove(edge);
935
- }
936
- var nodesToBeRemoved = [];
937
- nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes());
938
- var node;
939
- s = nodesToBeRemoved.length;
940
- for (var i = 0; i < s; i++) {
941
- node = nodesToBeRemoved[i];
942
- graph.remove(node);
943
- }
944
- if (graph == this.rootGraph) {
945
- this.setRootGraph(null);
946
- }
947
- var index = this.graphs.indexOf(graph);
948
- this.graphs.splice(index, 1);
949
- graph.parent = null;
950
- } else if (lObj instanceof LEdge) {
951
- edge = lObj;
952
- if (edge == null) {
953
- throw "Edge is null!";
954
- }
955
- if (!edge.isInterGraph) {
956
- throw "Not an inter-graph edge!";
957
- }
958
- if (!(edge.source != null && edge.target != null)) {
959
- throw "Source and/or target is null!";
960
- }
961
- if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) {
962
- throw "Source and/or target doesn't know this edge!";
963
- }
964
- var index = edge.source.edges.indexOf(edge);
965
- edge.source.edges.splice(index, 1);
966
- index = edge.target.edges.indexOf(edge);
967
- edge.target.edges.splice(index, 1);
968
- if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) {
969
- throw "Edge owner graph or owner graph manager is null!";
970
- }
971
- if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) {
972
- throw "Not in owner graph manager's edge list!";
973
- }
974
- var index = edge.source.owner.getGraphManager().edges.indexOf(edge);
975
- edge.source.owner.getGraphManager().edges.splice(index, 1);
976
- }
977
- };
978
- LGraphManager.prototype.updateBounds = function() {
979
- this.rootGraph.updateBounds(true);
980
- };
981
- LGraphManager.prototype.getGraphs = function() {
982
- return this.graphs;
983
- };
984
- LGraphManager.prototype.getAllNodes = function() {
985
- if (this.allNodes == null) {
986
- var nodeList = [];
987
- var graphs = this.getGraphs();
988
- var s = graphs.length;
989
- for (var i = 0; i < s; i++) {
990
- nodeList = nodeList.concat(graphs[i].getNodes());
991
- }
992
- this.allNodes = nodeList;
993
- }
994
- return this.allNodes;
995
- };
996
- LGraphManager.prototype.resetAllNodes = function() {
997
- this.allNodes = null;
998
- };
999
- LGraphManager.prototype.resetAllEdges = function() {
1000
- this.allEdges = null;
1001
- };
1002
- LGraphManager.prototype.resetAllNodesToApplyGravitation = function() {
1003
- this.allNodesToApplyGravitation = null;
1004
- };
1005
- LGraphManager.prototype.getAllEdges = function() {
1006
- if (this.allEdges == null) {
1007
- var edgeList = [];
1008
- var graphs = this.getGraphs();
1009
- var s = graphs.length;
1010
- for (var i = 0; i < graphs.length; i++) {
1011
- edgeList = edgeList.concat(graphs[i].getEdges());
1012
- }
1013
- edgeList = edgeList.concat(this.edges);
1014
- this.allEdges = edgeList;
1015
- }
1016
- return this.allEdges;
1017
- };
1018
- LGraphManager.prototype.getAllNodesToApplyGravitation = function() {
1019
- return this.allNodesToApplyGravitation;
1020
- };
1021
- LGraphManager.prototype.setAllNodesToApplyGravitation = function(nodeList) {
1022
- if (this.allNodesToApplyGravitation != null) {
1023
- throw "assert failed";
1024
- }
1025
- this.allNodesToApplyGravitation = nodeList;
1026
- };
1027
- LGraphManager.prototype.getRoot = function() {
1028
- return this.rootGraph;
1029
- };
1030
- LGraphManager.prototype.setRootGraph = function(graph) {
1031
- if (graph.getGraphManager() != this) {
1032
- throw "Root not in this graph mgr!";
1033
- }
1034
- this.rootGraph = graph;
1035
- if (graph.parent == null) {
1036
- graph.parent = this.layout.newNode("Root node");
1037
- }
1038
- };
1039
- LGraphManager.prototype.getLayout = function() {
1040
- return this.layout;
1041
- };
1042
- LGraphManager.prototype.isOneAncestorOfOther = function(firstNode, secondNode) {
1043
- if (!(firstNode != null && secondNode != null)) {
1044
- throw "assert failed";
1045
- }
1046
- if (firstNode == secondNode) {
1047
- return true;
1048
- }
1049
- var ownerGraph = firstNode.getOwner();
1050
- var parentNode;
1051
- do {
1052
- parentNode = ownerGraph.getParent();
1053
- if (parentNode == null) {
1054
- break;
1055
- }
1056
- if (parentNode == secondNode) {
1057
- return true;
1058
- }
1059
- ownerGraph = parentNode.getOwner();
1060
- if (ownerGraph == null) {
1061
- break;
1062
- }
1063
- } while (true);
1064
- ownerGraph = secondNode.getOwner();
1065
- do {
1066
- parentNode = ownerGraph.getParent();
1067
- if (parentNode == null) {
1068
- break;
1069
- }
1070
- if (parentNode == firstNode) {
1071
- return true;
1072
- }
1073
- ownerGraph = parentNode.getOwner();
1074
- if (ownerGraph == null) {
1075
- break;
1076
- }
1077
- } while (true);
1078
- return false;
1079
- };
1080
- LGraphManager.prototype.calcLowestCommonAncestors = function() {
1081
- var edge;
1082
- var sourceNode;
1083
- var targetNode;
1084
- var sourceAncestorGraph;
1085
- var targetAncestorGraph;
1086
- var edges = this.getAllEdges();
1087
- var s = edges.length;
1088
- for (var i = 0; i < s; i++) {
1089
- edge = edges[i];
1090
- sourceNode = edge.source;
1091
- targetNode = edge.target;
1092
- edge.lca = null;
1093
- edge.sourceInLca = sourceNode;
1094
- edge.targetInLca = targetNode;
1095
- if (sourceNode == targetNode) {
1096
- edge.lca = sourceNode.getOwner();
1097
- continue;
1098
- }
1099
- sourceAncestorGraph = sourceNode.getOwner();
1100
- while (edge.lca == null) {
1101
- edge.targetInLca = targetNode;
1102
- targetAncestorGraph = targetNode.getOwner();
1103
- while (edge.lca == null) {
1104
- if (targetAncestorGraph == sourceAncestorGraph) {
1105
- edge.lca = targetAncestorGraph;
1106
- break;
1107
- }
1108
- if (targetAncestorGraph == this.rootGraph) {
1109
- break;
1110
- }
1111
- if (edge.lca != null) {
1112
- throw "assert failed";
1113
- }
1114
- edge.targetInLca = targetAncestorGraph.getParent();
1115
- targetAncestorGraph = edge.targetInLca.getOwner();
1116
- }
1117
- if (sourceAncestorGraph == this.rootGraph) {
1118
- break;
1119
- }
1120
- if (edge.lca == null) {
1121
- edge.sourceInLca = sourceAncestorGraph.getParent();
1122
- sourceAncestorGraph = edge.sourceInLca.getOwner();
1123
- }
1124
- }
1125
- if (edge.lca == null) {
1126
- throw "assert failed";
1127
- }
1128
- }
1129
- };
1130
- LGraphManager.prototype.calcLowestCommonAncestor = function(firstNode, secondNode) {
1131
- if (firstNode == secondNode) {
1132
- return firstNode.getOwner();
1133
- }
1134
- var firstOwnerGraph = firstNode.getOwner();
1135
- do {
1136
- if (firstOwnerGraph == null) {
1137
- break;
1138
- }
1139
- var secondOwnerGraph = secondNode.getOwner();
1140
- do {
1141
- if (secondOwnerGraph == null) {
1142
- break;
1143
- }
1144
- if (secondOwnerGraph == firstOwnerGraph) {
1145
- return secondOwnerGraph;
1146
- }
1147
- secondOwnerGraph = secondOwnerGraph.getParent().getOwner();
1148
- } while (true);
1149
- firstOwnerGraph = firstOwnerGraph.getParent().getOwner();
1150
- } while (true);
1151
- return firstOwnerGraph;
1152
- };
1153
- LGraphManager.prototype.calcInclusionTreeDepths = function(graph, depth) {
1154
- if (graph == null && depth == null) {
1155
- graph = this.rootGraph;
1156
- depth = 1;
1157
- }
1158
- var node;
1159
- var nodes = graph.getNodes();
1160
- var s = nodes.length;
1161
- for (var i = 0; i < s; i++) {
1162
- node = nodes[i];
1163
- node.inclusionTreeDepth = depth;
1164
- if (node.child != null) {
1165
- this.calcInclusionTreeDepths(node.child, depth + 1);
1166
- }
1167
- }
1168
- };
1169
- LGraphManager.prototype.includesInvalidEdge = function() {
1170
- var edge;
1171
- var s = this.edges.length;
1172
- for (var i = 0; i < s; i++) {
1173
- edge = this.edges[i];
1174
- if (this.isOneAncestorOfOther(edge.source, edge.target)) {
1175
- return true;
1176
- }
1177
- }
1178
- return false;
1179
- };
1180
- module2.exports = LGraphManager;
1181
- },
1182
- /* 7 */
1183
- /***/
1184
- function(module2, exports2, __webpack_require__) {
1185
- "use strict";
1186
- var LayoutConstants = __webpack_require__(0);
1187
- function FDLayoutConstants() {
1188
- }
1189
- for (var prop in LayoutConstants) {
1190
- FDLayoutConstants[prop] = LayoutConstants[prop];
1191
- }
1192
- FDLayoutConstants.MAX_ITERATIONS = 2500;
1193
- FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;
1194
- FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45;
1195
- FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500;
1196
- FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4;
1197
- FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1;
1198
- FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8;
1199
- FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5;
1200
- FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true;
1201
- FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true;
1202
- FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3;
1203
- FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33;
1204
- FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3;
1205
- FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3;
1206
- FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100;
1207
- FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3;
1208
- FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10;
1209
- FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100;
1210
- FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1;
1211
- FDLayoutConstants.MIN_EDGE_LENGTH = 1;
1212
- FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10;
1213
- module2.exports = FDLayoutConstants;
1214
- },
1215
- /* 8 */
1216
- /***/
1217
- function(module2, exports2, __webpack_require__) {
1218
- "use strict";
1219
- var Point2 = __webpack_require__(12);
1220
- function IGeometry() {
1221
- }
1222
- IGeometry.calcSeparationAmount = function(rectA, rectB, overlapAmount, separationBuffer) {
1223
- if (!rectA.intersects(rectB)) {
1224
- throw "assert failed";
1225
- }
1226
- var directions = new Array(2);
1227
- this.decideDirectionsForOverlappingNodes(rectA, rectB, directions);
1228
- overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x);
1229
- overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y);
1230
- if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) {
1231
- overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight());
1232
- } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) {
1233
- overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight());
1234
- }
1235
- if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) {
1236
- overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom());
1237
- } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) {
1238
- overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom());
1239
- }
1240
- var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX()));
1241
- if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) {
1242
- slope = 1;
1243
- }
1244
- var moveByY = slope * overlapAmount[0];
1245
- var moveByX = overlapAmount[1] / slope;
1246
- if (overlapAmount[0] < moveByX) {
1247
- moveByX = overlapAmount[0];
1248
- } else {
1249
- moveByY = overlapAmount[1];
1250
- }
1251
- overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer);
1252
- overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer);
1253
- };
1254
- IGeometry.decideDirectionsForOverlappingNodes = function(rectA, rectB, directions) {
1255
- if (rectA.getCenterX() < rectB.getCenterX()) {
1256
- directions[0] = -1;
1257
- } else {
1258
- directions[0] = 1;
1259
- }
1260
- if (rectA.getCenterY() < rectB.getCenterY()) {
1261
- directions[1] = -1;
1262
- } else {
1263
- directions[1] = 1;
1264
- }
1265
- };
1266
- IGeometry.getIntersection2 = function(rectA, rectB, result) {
1267
- var p1x = rectA.getCenterX();
1268
- var p1y = rectA.getCenterY();
1269
- var p2x = rectB.getCenterX();
1270
- var p2y = rectB.getCenterY();
1271
- if (rectA.intersects(rectB)) {
1272
- result[0] = p1x;
1273
- result[1] = p1y;
1274
- result[2] = p2x;
1275
- result[3] = p2y;
1276
- return true;
1277
- }
1278
- var topLeftAx = rectA.getX();
1279
- var topLeftAy = rectA.getY();
1280
- var topRightAx = rectA.getRight();
1281
- var bottomLeftAx = rectA.getX();
1282
- var bottomLeftAy = rectA.getBottom();
1283
- var bottomRightAx = rectA.getRight();
1284
- var halfWidthA = rectA.getWidthHalf();
1285
- var halfHeightA = rectA.getHeightHalf();
1286
- var topLeftBx = rectB.getX();
1287
- var topLeftBy = rectB.getY();
1288
- var topRightBx = rectB.getRight();
1289
- var bottomLeftBx = rectB.getX();
1290
- var bottomLeftBy = rectB.getBottom();
1291
- var bottomRightBx = rectB.getRight();
1292
- var halfWidthB = rectB.getWidthHalf();
1293
- var halfHeightB = rectB.getHeightHalf();
1294
- var clipPointAFound = false;
1295
- var clipPointBFound = false;
1296
- if (p1x === p2x) {
1297
- if (p1y > p2y) {
1298
- result[0] = p1x;
1299
- result[1] = topLeftAy;
1300
- result[2] = p2x;
1301
- result[3] = bottomLeftBy;
1302
- return false;
1303
- } else if (p1y < p2y) {
1304
- result[0] = p1x;
1305
- result[1] = bottomLeftAy;
1306
- result[2] = p2x;
1307
- result[3] = topLeftBy;
1308
- return false;
1309
- } else {
1310
- }
1311
- } else if (p1y === p2y) {
1312
- if (p1x > p2x) {
1313
- result[0] = topLeftAx;
1314
- result[1] = p1y;
1315
- result[2] = topRightBx;
1316
- result[3] = p2y;
1317
- return false;
1318
- } else if (p1x < p2x) {
1319
- result[0] = topRightAx;
1320
- result[1] = p1y;
1321
- result[2] = topLeftBx;
1322
- result[3] = p2y;
1323
- return false;
1324
- } else {
1325
- }
1326
- } else {
1327
- var slopeA = rectA.height / rectA.width;
1328
- var slopeB = rectB.height / rectB.width;
1329
- var slopePrime = (p2y - p1y) / (p2x - p1x);
1330
- var cardinalDirectionA = void 0;
1331
- var cardinalDirectionB = void 0;
1332
- var tempPointAx = void 0;
1333
- var tempPointAy = void 0;
1334
- var tempPointBx = void 0;
1335
- var tempPointBy = void 0;
1336
- if (-slopeA === slopePrime) {
1337
- if (p1x > p2x) {
1338
- result[0] = bottomLeftAx;
1339
- result[1] = bottomLeftAy;
1340
- clipPointAFound = true;
1341
- } else {
1342
- result[0] = topRightAx;
1343
- result[1] = topLeftAy;
1344
- clipPointAFound = true;
1345
- }
1346
- } else if (slopeA === slopePrime) {
1347
- if (p1x > p2x) {
1348
- result[0] = topLeftAx;
1349
- result[1] = topLeftAy;
1350
- clipPointAFound = true;
1351
- } else {
1352
- result[0] = bottomRightAx;
1353
- result[1] = bottomLeftAy;
1354
- clipPointAFound = true;
1355
- }
1356
- }
1357
- if (-slopeB === slopePrime) {
1358
- if (p2x > p1x) {
1359
- result[2] = bottomLeftBx;
1360
- result[3] = bottomLeftBy;
1361
- clipPointBFound = true;
1362
- } else {
1363
- result[2] = topRightBx;
1364
- result[3] = topLeftBy;
1365
- clipPointBFound = true;
1366
- }
1367
- } else if (slopeB === slopePrime) {
1368
- if (p2x > p1x) {
1369
- result[2] = topLeftBx;
1370
- result[3] = topLeftBy;
1371
- clipPointBFound = true;
1372
- } else {
1373
- result[2] = bottomRightBx;
1374
- result[3] = bottomLeftBy;
1375
- clipPointBFound = true;
1376
- }
1377
- }
1378
- if (clipPointAFound && clipPointBFound) {
1379
- return false;
1380
- }
1381
- if (p1x > p2x) {
1382
- if (p1y > p2y) {
1383
- cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4);
1384
- cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2);
1385
- } else {
1386
- cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3);
1387
- cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1);
1388
- }
1389
- } else {
1390
- if (p1y > p2y) {
1391
- cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1);
1392
- cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3);
1393
- } else {
1394
- cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2);
1395
- cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4);
1396
- }
1397
- }
1398
- if (!clipPointAFound) {
1399
- switch (cardinalDirectionA) {
1400
- case 1:
1401
- tempPointAy = topLeftAy;
1402
- tempPointAx = p1x + -halfHeightA / slopePrime;
1403
- result[0] = tempPointAx;
1404
- result[1] = tempPointAy;
1405
- break;
1406
- case 2:
1407
- tempPointAx = bottomRightAx;
1408
- tempPointAy = p1y + halfWidthA * slopePrime;
1409
- result[0] = tempPointAx;
1410
- result[1] = tempPointAy;
1411
- break;
1412
- case 3:
1413
- tempPointAy = bottomLeftAy;
1414
- tempPointAx = p1x + halfHeightA / slopePrime;
1415
- result[0] = tempPointAx;
1416
- result[1] = tempPointAy;
1417
- break;
1418
- case 4:
1419
- tempPointAx = bottomLeftAx;
1420
- tempPointAy = p1y + -halfWidthA * slopePrime;
1421
- result[0] = tempPointAx;
1422
- result[1] = tempPointAy;
1423
- break;
1424
- }
1425
- }
1426
- if (!clipPointBFound) {
1427
- switch (cardinalDirectionB) {
1428
- case 1:
1429
- tempPointBy = topLeftBy;
1430
- tempPointBx = p2x + -halfHeightB / slopePrime;
1431
- result[2] = tempPointBx;
1432
- result[3] = tempPointBy;
1433
- break;
1434
- case 2:
1435
- tempPointBx = bottomRightBx;
1436
- tempPointBy = p2y + halfWidthB * slopePrime;
1437
- result[2] = tempPointBx;
1438
- result[3] = tempPointBy;
1439
- break;
1440
- case 3:
1441
- tempPointBy = bottomLeftBy;
1442
- tempPointBx = p2x + halfHeightB / slopePrime;
1443
- result[2] = tempPointBx;
1444
- result[3] = tempPointBy;
1445
- break;
1446
- case 4:
1447
- tempPointBx = bottomLeftBx;
1448
- tempPointBy = p2y + -halfWidthB * slopePrime;
1449
- result[2] = tempPointBx;
1450
- result[3] = tempPointBy;
1451
- break;
1452
- }
1453
- }
1454
- }
1455
- return false;
1456
- };
1457
- IGeometry.getCardinalDirection = function(slope, slopePrime, line) {
1458
- if (slope > slopePrime) {
1459
- return line;
1460
- } else {
1461
- return 1 + line % 4;
1462
- }
1463
- };
1464
- IGeometry.getIntersection = function(s1, s2, f1, f2) {
1465
- if (f2 == null) {
1466
- return this.getIntersection2(s1, s2, f1);
1467
- }
1468
- var x1 = s1.x;
1469
- var y1 = s1.y;
1470
- var x2 = s2.x;
1471
- var y2 = s2.y;
1472
- var x3 = f1.x;
1473
- var y3 = f1.y;
1474
- var x4 = f2.x;
1475
- var y4 = f2.y;
1476
- var x = void 0, y = void 0;
1477
- var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c2 = void 0;
1478
- var denom = void 0;
1479
- a1 = y2 - y1;
1480
- b1 = x1 - x2;
1481
- c1 = x2 * y1 - x1 * y2;
1482
- a2 = y4 - y3;
1483
- b2 = x3 - x4;
1484
- c2 = x4 * y3 - x3 * y4;
1485
- denom = a1 * b2 - a2 * b1;
1486
- if (denom === 0) {
1487
- return null;
1488
- }
1489
- x = (b1 * c2 - b2 * c1) / denom;
1490
- y = (a2 * c1 - a1 * c2) / denom;
1491
- return new Point2(x, y);
1492
- };
1493
- IGeometry.angleOfVector = function(Cx, Cy, Nx, Ny) {
1494
- var C_angle = void 0;
1495
- if (Cx !== Nx) {
1496
- C_angle = Math.atan((Ny - Cy) / (Nx - Cx));
1497
- if (Nx < Cx) {
1498
- C_angle += Math.PI;
1499
- } else if (Ny < Cy) {
1500
- C_angle += this.TWO_PI;
1501
- }
1502
- } else if (Ny < Cy) {
1503
- C_angle = this.ONE_AND_HALF_PI;
1504
- } else {
1505
- C_angle = this.HALF_PI;
1506
- }
1507
- return C_angle;
1508
- };
1509
- IGeometry.doIntersect = function(p1, p2, p3, p4) {
1510
- var a = p1.x;
1511
- var b = p1.y;
1512
- var c = p2.x;
1513
- var d = p2.y;
1514
- var p = p3.x;
1515
- var q = p3.y;
1516
- var r = p4.x;
1517
- var s = p4.y;
1518
- var det = (c - a) * (s - q) - (r - p) * (d - b);
1519
- if (det === 0) {
1520
- return false;
1521
- } else {
1522
- var lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det;
1523
- var gamma = ((b - d) * (r - a) + (c - a) * (s - b)) / det;
1524
- return 0 < lambda && lambda < 1 && 0 < gamma && gamma < 1;
1525
- }
1526
- };
1527
- IGeometry.HALF_PI = 0.5 * Math.PI;
1528
- IGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI;
1529
- IGeometry.TWO_PI = 2 * Math.PI;
1530
- IGeometry.THREE_PI = 3 * Math.PI;
1531
- module2.exports = IGeometry;
1532
- },
1533
- /* 9 */
1534
- /***/
1535
- function(module2, exports2, __webpack_require__) {
1536
- "use strict";
1537
- function IMath() {
1538
- }
1539
- IMath.sign = function(value) {
1540
- if (value > 0) {
1541
- return 1;
1542
- } else if (value < 0) {
1543
- return -1;
1544
- } else {
1545
- return 0;
1546
- }
1547
- };
1548
- IMath.floor = function(value) {
1549
- return value < 0 ? Math.ceil(value) : Math.floor(value);
1550
- };
1551
- IMath.ceil = function(value) {
1552
- return value < 0 ? Math.floor(value) : Math.ceil(value);
1553
- };
1554
- module2.exports = IMath;
1555
- },
1556
- /* 10 */
1557
- /***/
1558
- function(module2, exports2, __webpack_require__) {
1559
- "use strict";
1560
- function Integer() {
1561
- }
1562
- Integer.MAX_VALUE = 2147483647;
1563
- Integer.MIN_VALUE = -2147483648;
1564
- module2.exports = Integer;
1565
- },
1566
- /* 11 */
1567
- /***/
1568
- function(module2, exports2, __webpack_require__) {
1569
- "use strict";
1570
- var _createClass = /* @__PURE__ */ function() {
1571
- function defineProperties(target, props) {
1572
- for (var i = 0; i < props.length; i++) {
1573
- var descriptor = props[i];
1574
- descriptor.enumerable = descriptor.enumerable || false;
1575
- descriptor.configurable = true;
1576
- if ("value" in descriptor) descriptor.writable = true;
1577
- Object.defineProperty(target, descriptor.key, descriptor);
1578
- }
1579
- }
1580
- return function(Constructor, protoProps, staticProps) {
1581
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
1582
- if (staticProps) defineProperties(Constructor, staticProps);
1583
- return Constructor;
1584
- };
1585
- }();
1586
- function _classCallCheck(instance2, Constructor) {
1587
- if (!(instance2 instanceof Constructor)) {
1588
- throw new TypeError("Cannot call a class as a function");
1589
- }
1590
- }
1591
- var nodeFrom = function nodeFrom2(value) {
1592
- return { value, next: null, prev: null };
1593
- };
1594
- var add = function add2(prev, node, next2, list) {
1595
- if (prev !== null) {
1596
- prev.next = node;
1597
- } else {
1598
- list.head = node;
1599
- }
1600
- if (next2 !== null) {
1601
- next2.prev = node;
1602
- } else {
1603
- list.tail = node;
1604
- }
1605
- node.prev = prev;
1606
- node.next = next2;
1607
- list.length++;
1608
- return node;
1609
- };
1610
- var _remove = function _remove2(node, list) {
1611
- var prev = node.prev, next2 = node.next;
1612
- if (prev !== null) {
1613
- prev.next = next2;
1614
- } else {
1615
- list.head = next2;
1616
- }
1617
- if (next2 !== null) {
1618
- next2.prev = prev;
1619
- } else {
1620
- list.tail = prev;
1621
- }
1622
- node.prev = node.next = null;
1623
- list.length--;
1624
- return node;
1625
- };
1626
- var LinkedList = function() {
1627
- function LinkedList2(vals) {
1628
- var _this = this;
1629
- _classCallCheck(this, LinkedList2);
1630
- this.length = 0;
1631
- this.head = null;
1632
- this.tail = null;
1633
- if (vals != null) {
1634
- vals.forEach(function(v) {
1635
- return _this.push(v);
1636
- });
1637
- }
1638
- }
1639
- _createClass(LinkedList2, [{
1640
- key: "size",
1641
- value: function size() {
1642
- return this.length;
1643
- }
1644
- }, {
1645
- key: "insertBefore",
1646
- value: function insertBefore(val, otherNode) {
1647
- return add(otherNode.prev, nodeFrom(val), otherNode, this);
1648
- }
1649
- }, {
1650
- key: "insertAfter",
1651
- value: function insertAfter(val, otherNode) {
1652
- return add(otherNode, nodeFrom(val), otherNode.next, this);
1653
- }
1654
- }, {
1655
- key: "insertNodeBefore",
1656
- value: function insertNodeBefore(newNode, otherNode) {
1657
- return add(otherNode.prev, newNode, otherNode, this);
1658
- }
1659
- }, {
1660
- key: "insertNodeAfter",
1661
- value: function insertNodeAfter(newNode, otherNode) {
1662
- return add(otherNode, newNode, otherNode.next, this);
1663
- }
1664
- }, {
1665
- key: "push",
1666
- value: function push(val) {
1667
- return add(this.tail, nodeFrom(val), null, this);
1668
- }
1669
- }, {
1670
- key: "unshift",
1671
- value: function unshift(val) {
1672
- return add(null, nodeFrom(val), this.head, this);
1673
- }
1674
- }, {
1675
- key: "remove",
1676
- value: function remove(node) {
1677
- return _remove(node, this);
1678
- }
1679
- }, {
1680
- key: "pop",
1681
- value: function pop() {
1682
- return _remove(this.tail, this).value;
1683
- }
1684
- }, {
1685
- key: "popNode",
1686
- value: function popNode() {
1687
- return _remove(this.tail, this);
1688
- }
1689
- }, {
1690
- key: "shift",
1691
- value: function shift() {
1692
- return _remove(this.head, this).value;
1693
- }
1694
- }, {
1695
- key: "shiftNode",
1696
- value: function shiftNode() {
1697
- return _remove(this.head, this);
1698
- }
1699
- }, {
1700
- key: "get_object_at",
1701
- value: function get_object_at(index) {
1702
- if (index <= this.length()) {
1703
- var i = 1;
1704
- var current = this.head;
1705
- while (i < index) {
1706
- current = current.next;
1707
- i++;
1708
- }
1709
- return current.value;
1710
- }
1711
- }
1712
- }, {
1713
- key: "set_object_at",
1714
- value: function set_object_at(index, value) {
1715
- if (index <= this.length()) {
1716
- var i = 1;
1717
- var current = this.head;
1718
- while (i < index) {
1719
- current = current.next;
1720
- i++;
1721
- }
1722
- current.value = value;
1723
- }
1724
- }
1725
- }]);
1726
- return LinkedList2;
1727
- }();
1728
- module2.exports = LinkedList;
1729
- },
1730
- /* 12 */
1731
- /***/
1732
- function(module2, exports2, __webpack_require__) {
1733
- "use strict";
1734
- function Point2(x, y, p) {
1735
- this.x = null;
1736
- this.y = null;
1737
- if (x == null && y == null && p == null) {
1738
- this.x = 0;
1739
- this.y = 0;
1740
- } else if (typeof x == "number" && typeof y == "number" && p == null) {
1741
- this.x = x;
1742
- this.y = y;
1743
- } else if (x.constructor.name == "Point" && y == null && p == null) {
1744
- p = x;
1745
- this.x = p.x;
1746
- this.y = p.y;
1747
- }
1748
- }
1749
- Point2.prototype.getX = function() {
1750
- return this.x;
1751
- };
1752
- Point2.prototype.getY = function() {
1753
- return this.y;
1754
- };
1755
- Point2.prototype.getLocation = function() {
1756
- return new Point2(this.x, this.y);
1757
- };
1758
- Point2.prototype.setLocation = function(x, y, p) {
1759
- if (x.constructor.name == "Point" && y == null && p == null) {
1760
- p = x;
1761
- this.setLocation(p.x, p.y);
1762
- } else if (typeof x == "number" && typeof y == "number" && p == null) {
1763
- if (parseInt(x) == x && parseInt(y) == y) {
1764
- this.move(x, y);
1765
- } else {
1766
- this.x = Math.floor(x + 0.5);
1767
- this.y = Math.floor(y + 0.5);
1768
- }
1769
- }
1770
- };
1771
- Point2.prototype.move = function(x, y) {
1772
- this.x = x;
1773
- this.y = y;
1774
- };
1775
- Point2.prototype.translate = function(dx, dy) {
1776
- this.x += dx;
1777
- this.y += dy;
1778
- };
1779
- Point2.prototype.equals = function(obj) {
1780
- if (obj.constructor.name == "Point") {
1781
- var pt = obj;
1782
- return this.x == pt.x && this.y == pt.y;
1783
- }
1784
- return this == obj;
1785
- };
1786
- Point2.prototype.toString = function() {
1787
- return new Point2().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
1788
- };
1789
- module2.exports = Point2;
1790
- },
1791
- /* 13 */
1792
- /***/
1793
- function(module2, exports2, __webpack_require__) {
1794
- "use strict";
1795
- function RectangleD(x, y, width, height) {
1796
- this.x = 0;
1797
- this.y = 0;
1798
- this.width = 0;
1799
- this.height = 0;
1800
- if (x != null && y != null && width != null && height != null) {
1801
- this.x = x;
1802
- this.y = y;
1803
- this.width = width;
1804
- this.height = height;
1805
- }
1806
- }
1807
- RectangleD.prototype.getX = function() {
1808
- return this.x;
1809
- };
1810
- RectangleD.prototype.setX = function(x) {
1811
- this.x = x;
1812
- };
1813
- RectangleD.prototype.getY = function() {
1814
- return this.y;
1815
- };
1816
- RectangleD.prototype.setY = function(y) {
1817
- this.y = y;
1818
- };
1819
- RectangleD.prototype.getWidth = function() {
1820
- return this.width;
1821
- };
1822
- RectangleD.prototype.setWidth = function(width) {
1823
- this.width = width;
1824
- };
1825
- RectangleD.prototype.getHeight = function() {
1826
- return this.height;
1827
- };
1828
- RectangleD.prototype.setHeight = function(height) {
1829
- this.height = height;
1830
- };
1831
- RectangleD.prototype.getRight = function() {
1832
- return this.x + this.width;
1833
- };
1834
- RectangleD.prototype.getBottom = function() {
1835
- return this.y + this.height;
1836
- };
1837
- RectangleD.prototype.intersects = function(a) {
1838
- if (this.getRight() < a.x) {
1839
- return false;
1840
- }
1841
- if (this.getBottom() < a.y) {
1842
- return false;
1843
- }
1844
- if (a.getRight() < this.x) {
1845
- return false;
1846
- }
1847
- if (a.getBottom() < this.y) {
1848
- return false;
1849
- }
1850
- return true;
1851
- };
1852
- RectangleD.prototype.getCenterX = function() {
1853
- return this.x + this.width / 2;
1854
- };
1855
- RectangleD.prototype.getMinX = function() {
1856
- return this.getX();
1857
- };
1858
- RectangleD.prototype.getMaxX = function() {
1859
- return this.getX() + this.width;
1860
- };
1861
- RectangleD.prototype.getCenterY = function() {
1862
- return this.y + this.height / 2;
1863
- };
1864
- RectangleD.prototype.getMinY = function() {
1865
- return this.getY();
1866
- };
1867
- RectangleD.prototype.getMaxY = function() {
1868
- return this.getY() + this.height;
1869
- };
1870
- RectangleD.prototype.getWidthHalf = function() {
1871
- return this.width / 2;
1872
- };
1873
- RectangleD.prototype.getHeightHalf = function() {
1874
- return this.height / 2;
1875
- };
1876
- module2.exports = RectangleD;
1877
- },
1878
- /* 14 */
1879
- /***/
1880
- function(module2, exports2, __webpack_require__) {
1881
- "use strict";
1882
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
1883
- return typeof obj;
1884
- } : function(obj) {
1885
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1886
- };
1887
- function UniqueIDGeneretor() {
1888
- }
1889
- UniqueIDGeneretor.lastID = 0;
1890
- UniqueIDGeneretor.createID = function(obj) {
1891
- if (UniqueIDGeneretor.isPrimitive(obj)) {
1892
- return obj;
1893
- }
1894
- if (obj.uniqueID != null) {
1895
- return obj.uniqueID;
1896
- }
1897
- obj.uniqueID = UniqueIDGeneretor.getString();
1898
- UniqueIDGeneretor.lastID++;
1899
- return obj.uniqueID;
1900
- };
1901
- UniqueIDGeneretor.getString = function(id) {
1902
- if (id == null) id = UniqueIDGeneretor.lastID;
1903
- return "Object#" + id;
1904
- };
1905
- UniqueIDGeneretor.isPrimitive = function(arg) {
1906
- var type = typeof arg === "undefined" ? "undefined" : _typeof(arg);
1907
- return arg == null || type != "object" && type != "function";
1908
- };
1909
- module2.exports = UniqueIDGeneretor;
1910
- },
1911
- /* 15 */
1912
- /***/
1913
- function(module2, exports2, __webpack_require__) {
1914
- "use strict";
1915
- function _toConsumableArray(arr) {
1916
- if (Array.isArray(arr)) {
1917
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
1918
- arr2[i] = arr[i];
1919
- }
1920
- return arr2;
1921
- } else {
1922
- return Array.from(arr);
1923
- }
1924
- }
1925
- var LayoutConstants = __webpack_require__(0);
1926
- var LGraphManager = __webpack_require__(6);
1927
- var LNode = __webpack_require__(3);
1928
- var LEdge = __webpack_require__(1);
1929
- var LGraph = __webpack_require__(5);
1930
- var PointD = __webpack_require__(4);
1931
- var Transform = __webpack_require__(17);
1932
- var Emitter = __webpack_require__(27);
1933
- function Layout2(isRemoteUse) {
1934
- Emitter.call(this);
1935
- this.layoutQuality = LayoutConstants.QUALITY;
1936
- this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
1937
- this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
1938
- this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;
1939
- this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;
1940
- this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;
1941
- this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;
1942
- this.edgeToDummyNodes = /* @__PURE__ */ new Map();
1943
- this.graphManager = new LGraphManager(this);
1944
- this.isLayoutFinished = false;
1945
- this.isSubLayout = false;
1946
- this.isRemoteUse = false;
1947
- if (isRemoteUse != null) {
1948
- this.isRemoteUse = isRemoteUse;
1949
- }
1950
- }
1951
- Layout2.RANDOM_SEED = 1;
1952
- Layout2.prototype = Object.create(Emitter.prototype);
1953
- Layout2.prototype.getGraphManager = function() {
1954
- return this.graphManager;
1955
- };
1956
- Layout2.prototype.getAllNodes = function() {
1957
- return this.graphManager.getAllNodes();
1958
- };
1959
- Layout2.prototype.getAllEdges = function() {
1960
- return this.graphManager.getAllEdges();
1961
- };
1962
- Layout2.prototype.getAllNodesToApplyGravitation = function() {
1963
- return this.graphManager.getAllNodesToApplyGravitation();
1964
- };
1965
- Layout2.prototype.newGraphManager = function() {
1966
- var gm = new LGraphManager(this);
1967
- this.graphManager = gm;
1968
- return gm;
1969
- };
1970
- Layout2.prototype.newGraph = function(vGraph) {
1971
- return new LGraph(null, this.graphManager, vGraph);
1972
- };
1973
- Layout2.prototype.newNode = function(vNode) {
1974
- return new LNode(this.graphManager, vNode);
1975
- };
1976
- Layout2.prototype.newEdge = function(vEdge) {
1977
- return new LEdge(null, null, vEdge);
1978
- };
1979
- Layout2.prototype.checkLayoutSuccess = function() {
1980
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
1981
- };
1982
- Layout2.prototype.runLayout = function() {
1983
- this.isLayoutFinished = false;
1984
- if (this.tilingPreLayout) {
1985
- this.tilingPreLayout();
1986
- }
1987
- this.initParameters();
1988
- var isLayoutSuccessfull;
1989
- if (this.checkLayoutSuccess()) {
1990
- isLayoutSuccessfull = false;
1991
- } else {
1992
- isLayoutSuccessfull = this.layout();
1993
- }
1994
- if (LayoutConstants.ANIMATE === "during") {
1995
- return false;
1996
- }
1997
- if (isLayoutSuccessfull) {
1998
- if (!this.isSubLayout) {
1999
- this.doPostLayout();
2000
- }
2001
- }
2002
- if (this.tilingPostLayout) {
2003
- this.tilingPostLayout();
2004
- }
2005
- this.isLayoutFinished = true;
2006
- return isLayoutSuccessfull;
2007
- };
2008
- Layout2.prototype.doPostLayout = function() {
2009
- if (!this.incremental) {
2010
- this.transform();
2011
- }
2012
- this.update();
2013
- };
2014
- Layout2.prototype.update2 = function() {
2015
- if (this.createBendsAsNeeded) {
2016
- this.createBendpointsFromDummyNodes();
2017
- this.graphManager.resetAllEdges();
2018
- }
2019
- if (!this.isRemoteUse) {
2020
- var edge;
2021
- var allEdges = this.graphManager.getAllEdges();
2022
- for (var i = 0; i < allEdges.length; i++) {
2023
- edge = allEdges[i];
2024
- }
2025
- var node;
2026
- var nodes = this.graphManager.getRoot().getNodes();
2027
- for (var i = 0; i < nodes.length; i++) {
2028
- node = nodes[i];
2029
- }
2030
- this.update(this.graphManager.getRoot());
2031
- }
2032
- };
2033
- Layout2.prototype.update = function(obj) {
2034
- if (obj == null) {
2035
- this.update2();
2036
- } else if (obj instanceof LNode) {
2037
- var node = obj;
2038
- if (node.getChild() != null) {
2039
- var nodes = node.getChild().getNodes();
2040
- for (var i = 0; i < nodes.length; i++) {
2041
- update(nodes[i]);
2042
- }
2043
- }
2044
- if (node.vGraphObject != null) {
2045
- var vNode = node.vGraphObject;
2046
- vNode.update(node);
2047
- }
2048
- } else if (obj instanceof LEdge) {
2049
- var edge = obj;
2050
- if (edge.vGraphObject != null) {
2051
- var vEdge = edge.vGraphObject;
2052
- vEdge.update(edge);
2053
- }
2054
- } else if (obj instanceof LGraph) {
2055
- var graph = obj;
2056
- if (graph.vGraphObject != null) {
2057
- var vGraph = graph.vGraphObject;
2058
- vGraph.update(graph);
2059
- }
2060
- }
2061
- };
2062
- Layout2.prototype.initParameters = function() {
2063
- if (!this.isSubLayout) {
2064
- this.layoutQuality = LayoutConstants.QUALITY;
2065
- this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;
2066
- this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;
2067
- this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;
2068
- this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;
2069
- this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
2070
- this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;
2071
- }
2072
- if (this.animationDuringLayout) {
2073
- this.animationOnLayout = false;
2074
- }
2075
- };
2076
- Layout2.prototype.transform = function(newLeftTop) {
2077
- if (newLeftTop == void 0) {
2078
- this.transform(new PointD(0, 0));
2079
- } else {
2080
- var trans = new Transform();
2081
- var leftTop = this.graphManager.getRoot().updateLeftTop();
2082
- if (leftTop != null) {
2083
- trans.setWorldOrgX(newLeftTop.x);
2084
- trans.setWorldOrgY(newLeftTop.y);
2085
- trans.setDeviceOrgX(leftTop.x);
2086
- trans.setDeviceOrgY(leftTop.y);
2087
- var nodes = this.getAllNodes();
2088
- var node;
2089
- for (var i = 0; i < nodes.length; i++) {
2090
- node = nodes[i];
2091
- node.transform(trans);
2092
- }
2093
- }
2094
- }
2095
- };
2096
- Layout2.prototype.positionNodesRandomly = function(graph) {
2097
- if (graph == void 0) {
2098
- this.positionNodesRandomly(this.getGraphManager().getRoot());
2099
- this.getGraphManager().getRoot().updateBounds(true);
2100
- } else {
2101
- var lNode;
2102
- var childGraph;
2103
- var nodes = graph.getNodes();
2104
- for (var i = 0; i < nodes.length; i++) {
2105
- lNode = nodes[i];
2106
- childGraph = lNode.getChild();
2107
- if (childGraph == null) {
2108
- lNode.scatter();
2109
- } else if (childGraph.getNodes().length == 0) {
2110
- lNode.scatter();
2111
- } else {
2112
- this.positionNodesRandomly(childGraph);
2113
- lNode.updateBounds();
2114
- }
2115
- }
2116
- }
2117
- };
2118
- Layout2.prototype.getFlatForest = function() {
2119
- var flatForest = [];
2120
- var isForest = true;
2121
- var allNodes = this.graphManager.getRoot().getNodes();
2122
- var isFlat = true;
2123
- for (var i = 0; i < allNodes.length; i++) {
2124
- if (allNodes[i].getChild() != null) {
2125
- isFlat = false;
2126
- }
2127
- }
2128
- if (!isFlat) {
2129
- return flatForest;
2130
- }
2131
- var visited = /* @__PURE__ */ new Set();
2132
- var toBeVisited = [];
2133
- var parents = /* @__PURE__ */ new Map();
2134
- var unProcessedNodes = [];
2135
- unProcessedNodes = unProcessedNodes.concat(allNodes);
2136
- while (unProcessedNodes.length > 0 && isForest) {
2137
- toBeVisited.push(unProcessedNodes[0]);
2138
- while (toBeVisited.length > 0 && isForest) {
2139
- var currentNode = toBeVisited[0];
2140
- toBeVisited.splice(0, 1);
2141
- visited.add(currentNode);
2142
- var neighborEdges = currentNode.getEdges();
2143
- for (var i = 0; i < neighborEdges.length; i++) {
2144
- var currentNeighbor = neighborEdges[i].getOtherEnd(currentNode);
2145
- if (parents.get(currentNode) != currentNeighbor) {
2146
- if (!visited.has(currentNeighbor)) {
2147
- toBeVisited.push(currentNeighbor);
2148
- parents.set(currentNeighbor, currentNode);
2149
- } else {
2150
- isForest = false;
2151
- break;
2152
- }
2153
- }
2154
- }
2155
- }
2156
- if (!isForest) {
2157
- flatForest = [];
2158
- } else {
2159
- var temp = [].concat(_toConsumableArray(visited));
2160
- flatForest.push(temp);
2161
- for (var i = 0; i < temp.length; i++) {
2162
- var value = temp[i];
2163
- var index = unProcessedNodes.indexOf(value);
2164
- if (index > -1) {
2165
- unProcessedNodes.splice(index, 1);
2166
- }
2167
- }
2168
- visited = /* @__PURE__ */ new Set();
2169
- parents = /* @__PURE__ */ new Map();
2170
- }
2171
- }
2172
- return flatForest;
2173
- };
2174
- Layout2.prototype.createDummyNodesForBendpoints = function(edge) {
2175
- var dummyNodes = [];
2176
- var prev = edge.source;
2177
- var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target);
2178
- for (var i = 0; i < edge.bendpoints.length; i++) {
2179
- var dummyNode = this.newNode(null);
2180
- dummyNode.setRect(new Point(0, 0), new Dimension(1, 1));
2181
- graph.add(dummyNode);
2182
- var dummyEdge = this.newEdge(null);
2183
- this.graphManager.add(dummyEdge, prev, dummyNode);
2184
- dummyNodes.add(dummyNode);
2185
- prev = dummyNode;
2186
- }
2187
- var dummyEdge = this.newEdge(null);
2188
- this.graphManager.add(dummyEdge, prev, edge.target);
2189
- this.edgeToDummyNodes.set(edge, dummyNodes);
2190
- if (edge.isInterGraph()) {
2191
- this.graphManager.remove(edge);
2192
- } else {
2193
- graph.remove(edge);
2194
- }
2195
- return dummyNodes;
2196
- };
2197
- Layout2.prototype.createBendpointsFromDummyNodes = function() {
2198
- var edges = [];
2199
- edges = edges.concat(this.graphManager.getAllEdges());
2200
- edges = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges);
2201
- for (var k = 0; k < edges.length; k++) {
2202
- var lEdge = edges[k];
2203
- if (lEdge.bendpoints.length > 0) {
2204
- var path = this.edgeToDummyNodes.get(lEdge);
2205
- for (var i = 0; i < path.length; i++) {
2206
- var dummyNode = path[i];
2207
- var p = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY());
2208
- var ebp = lEdge.bendpoints.get(i);
2209
- ebp.x = p.x;
2210
- ebp.y = p.y;
2211
- dummyNode.getOwner().remove(dummyNode);
2212
- }
2213
- this.graphManager.add(lEdge, lEdge.source, lEdge.target);
2214
- }
2215
- }
2216
- };
2217
- Layout2.transform = function(sliderValue, defaultValue, minDiv, maxMul) {
2218
- if (minDiv != void 0 && maxMul != void 0) {
2219
- var value = defaultValue;
2220
- if (sliderValue <= 50) {
2221
- var minValue = defaultValue / minDiv;
2222
- value -= (defaultValue - minValue) / 50 * (50 - sliderValue);
2223
- } else {
2224
- var maxValue = defaultValue * maxMul;
2225
- value += (maxValue - defaultValue) / 50 * (sliderValue - 50);
2226
- }
2227
- return value;
2228
- } else {
2229
- var a, b;
2230
- if (sliderValue <= 50) {
2231
- a = 9 * defaultValue / 500;
2232
- b = defaultValue / 10;
2233
- } else {
2234
- a = 9 * defaultValue / 50;
2235
- b = -8 * defaultValue;
2236
- }
2237
- return a * sliderValue + b;
2238
- }
2239
- };
2240
- Layout2.findCenterOfTree = function(nodes) {
2241
- var list = [];
2242
- list = list.concat(nodes);
2243
- var removedNodes = [];
2244
- var remainingDegrees = /* @__PURE__ */ new Map();
2245
- var foundCenter = false;
2246
- var centerNode = null;
2247
- if (list.length == 1 || list.length == 2) {
2248
- foundCenter = true;
2249
- centerNode = list[0];
2250
- }
2251
- for (var i = 0; i < list.length; i++) {
2252
- var node = list[i];
2253
- var degree = node.getNeighborsList().size;
2254
- remainingDegrees.set(node, node.getNeighborsList().size);
2255
- if (degree == 1) {
2256
- removedNodes.push(node);
2257
- }
2258
- }
2259
- var tempList = [];
2260
- tempList = tempList.concat(removedNodes);
2261
- while (!foundCenter) {
2262
- var tempList2 = [];
2263
- tempList2 = tempList2.concat(tempList);
2264
- tempList = [];
2265
- for (var i = 0; i < list.length; i++) {
2266
- var node = list[i];
2267
- var index = list.indexOf(node);
2268
- if (index >= 0) {
2269
- list.splice(index, 1);
2270
- }
2271
- var neighbours = node.getNeighborsList();
2272
- neighbours.forEach(function(neighbour) {
2273
- if (removedNodes.indexOf(neighbour) < 0) {
2274
- var otherDegree = remainingDegrees.get(neighbour);
2275
- var newDegree = otherDegree - 1;
2276
- if (newDegree == 1) {
2277
- tempList.push(neighbour);
2278
- }
2279
- remainingDegrees.set(neighbour, newDegree);
2280
- }
2281
- });
2282
- }
2283
- removedNodes = removedNodes.concat(tempList);
2284
- if (list.length == 1 || list.length == 2) {
2285
- foundCenter = true;
2286
- centerNode = list[0];
2287
- }
2288
- }
2289
- return centerNode;
2290
- };
2291
- Layout2.prototype.setGraphManager = function(gm) {
2292
- this.graphManager = gm;
2293
- };
2294
- module2.exports = Layout2;
2295
- },
2296
- /* 16 */
2297
- /***/
2298
- function(module2, exports2, __webpack_require__) {
2299
- "use strict";
2300
- function RandomSeed() {
2301
- }
2302
- RandomSeed.seed = 1;
2303
- RandomSeed.x = 0;
2304
- RandomSeed.nextDouble = function() {
2305
- RandomSeed.x = Math.sin(RandomSeed.seed++) * 1e4;
2306
- return RandomSeed.x - Math.floor(RandomSeed.x);
2307
- };
2308
- module2.exports = RandomSeed;
2309
- },
2310
- /* 17 */
2311
- /***/
2312
- function(module2, exports2, __webpack_require__) {
2313
- "use strict";
2314
- var PointD = __webpack_require__(4);
2315
- function Transform(x, y) {
2316
- this.lworldOrgX = 0;
2317
- this.lworldOrgY = 0;
2318
- this.ldeviceOrgX = 0;
2319
- this.ldeviceOrgY = 0;
2320
- this.lworldExtX = 1;
2321
- this.lworldExtY = 1;
2322
- this.ldeviceExtX = 1;
2323
- this.ldeviceExtY = 1;
2324
- }
2325
- Transform.prototype.getWorldOrgX = function() {
2326
- return this.lworldOrgX;
2327
- };
2328
- Transform.prototype.setWorldOrgX = function(wox) {
2329
- this.lworldOrgX = wox;
2330
- };
2331
- Transform.prototype.getWorldOrgY = function() {
2332
- return this.lworldOrgY;
2333
- };
2334
- Transform.prototype.setWorldOrgY = function(woy) {
2335
- this.lworldOrgY = woy;
2336
- };
2337
- Transform.prototype.getWorldExtX = function() {
2338
- return this.lworldExtX;
2339
- };
2340
- Transform.prototype.setWorldExtX = function(wex) {
2341
- this.lworldExtX = wex;
2342
- };
2343
- Transform.prototype.getWorldExtY = function() {
2344
- return this.lworldExtY;
2345
- };
2346
- Transform.prototype.setWorldExtY = function(wey) {
2347
- this.lworldExtY = wey;
2348
- };
2349
- Transform.prototype.getDeviceOrgX = function() {
2350
- return this.ldeviceOrgX;
2351
- };
2352
- Transform.prototype.setDeviceOrgX = function(dox) {
2353
- this.ldeviceOrgX = dox;
2354
- };
2355
- Transform.prototype.getDeviceOrgY = function() {
2356
- return this.ldeviceOrgY;
2357
- };
2358
- Transform.prototype.setDeviceOrgY = function(doy) {
2359
- this.ldeviceOrgY = doy;
2360
- };
2361
- Transform.prototype.getDeviceExtX = function() {
2362
- return this.ldeviceExtX;
2363
- };
2364
- Transform.prototype.setDeviceExtX = function(dex) {
2365
- this.ldeviceExtX = dex;
2366
- };
2367
- Transform.prototype.getDeviceExtY = function() {
2368
- return this.ldeviceExtY;
2369
- };
2370
- Transform.prototype.setDeviceExtY = function(dey) {
2371
- this.ldeviceExtY = dey;
2372
- };
2373
- Transform.prototype.transformX = function(x) {
2374
- var xDevice = 0;
2375
- var worldExtX = this.lworldExtX;
2376
- if (worldExtX != 0) {
2377
- xDevice = this.ldeviceOrgX + (x - this.lworldOrgX) * this.ldeviceExtX / worldExtX;
2378
- }
2379
- return xDevice;
2380
- };
2381
- Transform.prototype.transformY = function(y) {
2382
- var yDevice = 0;
2383
- var worldExtY = this.lworldExtY;
2384
- if (worldExtY != 0) {
2385
- yDevice = this.ldeviceOrgY + (y - this.lworldOrgY) * this.ldeviceExtY / worldExtY;
2386
- }
2387
- return yDevice;
2388
- };
2389
- Transform.prototype.inverseTransformX = function(x) {
2390
- var xWorld = 0;
2391
- var deviceExtX = this.ldeviceExtX;
2392
- if (deviceExtX != 0) {
2393
- xWorld = this.lworldOrgX + (x - this.ldeviceOrgX) * this.lworldExtX / deviceExtX;
2394
- }
2395
- return xWorld;
2396
- };
2397
- Transform.prototype.inverseTransformY = function(y) {
2398
- var yWorld = 0;
2399
- var deviceExtY = this.ldeviceExtY;
2400
- if (deviceExtY != 0) {
2401
- yWorld = this.lworldOrgY + (y - this.ldeviceOrgY) * this.lworldExtY / deviceExtY;
2402
- }
2403
- return yWorld;
2404
- };
2405
- Transform.prototype.inverseTransformPoint = function(inPoint) {
2406
- var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y));
2407
- return outPoint;
2408
- };
2409
- module2.exports = Transform;
2410
- },
2411
- /* 18 */
2412
- /***/
2413
- function(module2, exports2, __webpack_require__) {
2414
- "use strict";
2415
- function _toConsumableArray(arr) {
2416
- if (Array.isArray(arr)) {
2417
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
2418
- arr2[i] = arr[i];
2419
- }
2420
- return arr2;
2421
- } else {
2422
- return Array.from(arr);
2423
- }
2424
- }
2425
- var Layout2 = __webpack_require__(15);
2426
- var FDLayoutConstants = __webpack_require__(7);
2427
- var LayoutConstants = __webpack_require__(0);
2428
- var IGeometry = __webpack_require__(8);
2429
- var IMath = __webpack_require__(9);
2430
- function FDLayout() {
2431
- Layout2.call(this);
2432
- this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;
2433
- this.idealEdgeLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
2434
- this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;
2435
- this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;
2436
- this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;
2437
- this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;
2438
- this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;
2439
- this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;
2440
- this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;
2441
- this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
2442
- this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
2443
- this.totalDisplacement = 0;
2444
- this.oldTotalDisplacement = 0;
2445
- this.maxIterations = FDLayoutConstants.MAX_ITERATIONS;
2446
- }
2447
- FDLayout.prototype = Object.create(Layout2.prototype);
2448
- for (var prop in Layout2) {
2449
- FDLayout[prop] = Layout2[prop];
2450
- }
2451
- FDLayout.prototype.initParameters = function() {
2452
- Layout2.prototype.initParameters.call(this, arguments);
2453
- this.totalIterations = 0;
2454
- this.notAnimatedIterations = 0;
2455
- this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION;
2456
- this.grid = [];
2457
- };
2458
- FDLayout.prototype.calcIdealEdgeLengths = function() {
2459
- var edge;
2460
- var lcaDepth;
2461
- var source;
2462
- var target;
2463
- var sizeOfSourceInLca;
2464
- var sizeOfTargetInLca;
2465
- var allEdges = this.getGraphManager().getAllEdges();
2466
- for (var i = 0; i < allEdges.length; i++) {
2467
- edge = allEdges[i];
2468
- edge.idealLength = this.idealEdgeLength;
2469
- if (edge.isInterGraph) {
2470
- source = edge.getSource();
2471
- target = edge.getTarget();
2472
- sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize();
2473
- sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize();
2474
- if (this.useSmartIdealEdgeLengthCalculation) {
2475
- edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE;
2476
- }
2477
- lcaDepth = edge.getLca().getInclusionTreeDepth();
2478
- edge.idealLength += FDLayoutConstants.DEFAULT_EDGE_LENGTH * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth);
2479
- }
2480
- }
2481
- };
2482
- FDLayout.prototype.initSpringEmbedder = function() {
2483
- var s = this.getAllNodes().length;
2484
- if (this.incremental) {
2485
- if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {
2486
- this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));
2487
- }
2488
- this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL;
2489
- } else {
2490
- if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {
2491
- this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1 - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));
2492
- } else {
2493
- this.coolingFactor = 1;
2494
- }
2495
- this.initialCoolingFactor = this.coolingFactor;
2496
- this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT;
2497
- }
2498
- this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations);
2499
- this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length;
2500
- this.repulsionRange = this.calcRepulsionRange();
2501
- };
2502
- FDLayout.prototype.calcSpringForces = function() {
2503
- var lEdges = this.getAllEdges();
2504
- var edge;
2505
- for (var i = 0; i < lEdges.length; i++) {
2506
- edge = lEdges[i];
2507
- this.calcSpringForce(edge, edge.idealLength);
2508
- }
2509
- };
2510
- FDLayout.prototype.calcRepulsionForces = function() {
2511
- var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
2512
- var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
2513
- var i, j;
2514
- var nodeA, nodeB;
2515
- var lNodes = this.getAllNodes();
2516
- var processedNodeSet;
2517
- if (this.useFRGridVariant) {
2518
- if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) {
2519
- this.updateGrid();
2520
- }
2521
- processedNodeSet = /* @__PURE__ */ new Set();
2522
- for (i = 0; i < lNodes.length; i++) {
2523
- nodeA = lNodes[i];
2524
- this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate);
2525
- processedNodeSet.add(nodeA);
2526
- }
2527
- } else {
2528
- for (i = 0; i < lNodes.length; i++) {
2529
- nodeA = lNodes[i];
2530
- for (j = i + 1; j < lNodes.length; j++) {
2531
- nodeB = lNodes[j];
2532
- if (nodeA.getOwner() != nodeB.getOwner()) {
2533
- continue;
2534
- }
2535
- this.calcRepulsionForce(nodeA, nodeB);
2536
- }
2537
- }
2538
- }
2539
- };
2540
- FDLayout.prototype.calcGravitationalForces = function() {
2541
- var node;
2542
- var lNodes = this.getAllNodesToApplyGravitation();
2543
- for (var i = 0; i < lNodes.length; i++) {
2544
- node = lNodes[i];
2545
- this.calcGravitationalForce(node);
2546
- }
2547
- };
2548
- FDLayout.prototype.moveNodes = function() {
2549
- var lNodes = this.getAllNodes();
2550
- var node;
2551
- for (var i = 0; i < lNodes.length; i++) {
2552
- node = lNodes[i];
2553
- node.move();
2554
- }
2555
- };
2556
- FDLayout.prototype.calcSpringForce = function(edge, idealLength) {
2557
- var sourceNode = edge.getSource();
2558
- var targetNode = edge.getTarget();
2559
- var length;
2560
- var springForce;
2561
- var springForceX;
2562
- var springForceY;
2563
- if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) {
2564
- edge.updateLengthSimple();
2565
- } else {
2566
- edge.updateLength();
2567
- if (edge.isOverlapingSourceAndTarget) {
2568
- return;
2569
- }
2570
- }
2571
- length = edge.getLength();
2572
- if (length == 0) return;
2573
- springForce = this.springConstant * (length - idealLength);
2574
- springForceX = springForce * (edge.lengthX / length);
2575
- springForceY = springForce * (edge.lengthY / length);
2576
- sourceNode.springForceX += springForceX;
2577
- sourceNode.springForceY += springForceY;
2578
- targetNode.springForceX -= springForceX;
2579
- targetNode.springForceY -= springForceY;
2580
- };
2581
- FDLayout.prototype.calcRepulsionForce = function(nodeA, nodeB) {
2582
- var rectA = nodeA.getRect();
2583
- var rectB = nodeB.getRect();
2584
- var overlapAmount = new Array(2);
2585
- var clipPoints = new Array(4);
2586
- var distanceX;
2587
- var distanceY;
2588
- var distanceSquared;
2589
- var distance;
2590
- var repulsionForce;
2591
- var repulsionForceX;
2592
- var repulsionForceY;
2593
- if (rectA.intersects(rectB)) {
2594
- IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2);
2595
- repulsionForceX = 2 * overlapAmount[0];
2596
- repulsionForceY = 2 * overlapAmount[1];
2597
- var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren);
2598
- nodeA.repulsionForceX -= childrenConstant * repulsionForceX;
2599
- nodeA.repulsionForceY -= childrenConstant * repulsionForceY;
2600
- nodeB.repulsionForceX += childrenConstant * repulsionForceX;
2601
- nodeB.repulsionForceY += childrenConstant * repulsionForceY;
2602
- } else {
2603
- if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) {
2604
- distanceX = rectB.getCenterX() - rectA.getCenterX();
2605
- distanceY = rectB.getCenterY() - rectA.getCenterY();
2606
- } else {
2607
- IGeometry.getIntersection(rectA, rectB, clipPoints);
2608
- distanceX = clipPoints[2] - clipPoints[0];
2609
- distanceY = clipPoints[3] - clipPoints[1];
2610
- }
2611
- if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) {
2612
- distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST;
2613
- }
2614
- if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) {
2615
- distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST;
2616
- }
2617
- distanceSquared = distanceX * distanceX + distanceY * distanceY;
2618
- distance = Math.sqrt(distanceSquared);
2619
- repulsionForce = this.repulsionConstant * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared;
2620
- repulsionForceX = repulsionForce * distanceX / distance;
2621
- repulsionForceY = repulsionForce * distanceY / distance;
2622
- nodeA.repulsionForceX -= repulsionForceX;
2623
- nodeA.repulsionForceY -= repulsionForceY;
2624
- nodeB.repulsionForceX += repulsionForceX;
2625
- nodeB.repulsionForceY += repulsionForceY;
2626
- }
2627
- };
2628
- FDLayout.prototype.calcGravitationalForce = function(node) {
2629
- var ownerGraph;
2630
- var ownerCenterX;
2631
- var ownerCenterY;
2632
- var distanceX;
2633
- var distanceY;
2634
- var absDistanceX;
2635
- var absDistanceY;
2636
- var estimatedSize;
2637
- ownerGraph = node.getOwner();
2638
- ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2;
2639
- ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2;
2640
- distanceX = node.getCenterX() - ownerCenterX;
2641
- distanceY = node.getCenterY() - ownerCenterY;
2642
- absDistanceX = Math.abs(distanceX) + node.getWidth() / 2;
2643
- absDistanceY = Math.abs(distanceY) + node.getHeight() / 2;
2644
- if (node.getOwner() == this.graphManager.getRoot()) {
2645
- estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor;
2646
- if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {
2647
- node.gravitationForceX = -this.gravityConstant * distanceX;
2648
- node.gravitationForceY = -this.gravityConstant * distanceY;
2649
- }
2650
- } else {
2651
- estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor;
2652
- if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {
2653
- node.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant;
2654
- node.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant;
2655
- }
2656
- }
2657
- };
2658
- FDLayout.prototype.isConverged = function() {
2659
- var converged;
2660
- var oscilating = false;
2661
- if (this.totalIterations > this.maxIterations / 3) {
2662
- oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2;
2663
- }
2664
- converged = this.totalDisplacement < this.totalDisplacementThreshold;
2665
- this.oldTotalDisplacement = this.totalDisplacement;
2666
- return converged || oscilating;
2667
- };
2668
- FDLayout.prototype.animate = function() {
2669
- if (this.animationDuringLayout && !this.isSubLayout) {
2670
- if (this.notAnimatedIterations == this.animationPeriod) {
2671
- this.update();
2672
- this.notAnimatedIterations = 0;
2673
- } else {
2674
- this.notAnimatedIterations++;
2675
- }
2676
- }
2677
- };
2678
- FDLayout.prototype.calcNoOfChildrenForAllNodes = function() {
2679
- var node;
2680
- var allNodes = this.graphManager.getAllNodes();
2681
- for (var i = 0; i < allNodes.length; i++) {
2682
- node = allNodes[i];
2683
- node.noOfChildren = node.getNoOfChildren();
2684
- }
2685
- };
2686
- FDLayout.prototype.calcGrid = function(graph) {
2687
- var sizeX = 0;
2688
- var sizeY = 0;
2689
- sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange));
2690
- sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange));
2691
- var grid = new Array(sizeX);
2692
- for (var i = 0; i < sizeX; i++) {
2693
- grid[i] = new Array(sizeY);
2694
- }
2695
- for (var i = 0; i < sizeX; i++) {
2696
- for (var j = 0; j < sizeY; j++) {
2697
- grid[i][j] = new Array();
2698
- }
2699
- }
2700
- return grid;
2701
- };
2702
- FDLayout.prototype.addNodeToGrid = function(v, left, top) {
2703
- var startX = 0;
2704
- var finishX = 0;
2705
- var startY = 0;
2706
- var finishY = 0;
2707
- startX = parseInt(Math.floor((v.getRect().x - left) / this.repulsionRange));
2708
- finishX = parseInt(Math.floor((v.getRect().width + v.getRect().x - left) / this.repulsionRange));
2709
- startY = parseInt(Math.floor((v.getRect().y - top) / this.repulsionRange));
2710
- finishY = parseInt(Math.floor((v.getRect().height + v.getRect().y - top) / this.repulsionRange));
2711
- for (var i = startX; i <= finishX; i++) {
2712
- for (var j = startY; j <= finishY; j++) {
2713
- this.grid[i][j].push(v);
2714
- v.setGridCoordinates(startX, finishX, startY, finishY);
2715
- }
2716
- }
2717
- };
2718
- FDLayout.prototype.updateGrid = function() {
2719
- var i;
2720
- var nodeA;
2721
- var lNodes = this.getAllNodes();
2722
- this.grid = this.calcGrid(this.graphManager.getRoot());
2723
- for (i = 0; i < lNodes.length; i++) {
2724
- nodeA = lNodes[i];
2725
- this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
2726
- }
2727
- };
2728
- FDLayout.prototype.calculateRepulsionForceOfANode = function(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) {
2729
- if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) {
2730
- var surrounding = /* @__PURE__ */ new Set();
2731
- nodeA.surrounding = new Array();
2732
- var nodeB;
2733
- var grid = this.grid;
2734
- for (var i = nodeA.startX - 1; i < nodeA.finishX + 2; i++) {
2735
- for (var j = nodeA.startY - 1; j < nodeA.finishY + 2; j++) {
2736
- if (!(i < 0 || j < 0 || i >= grid.length || j >= grid[0].length)) {
2737
- for (var k = 0; k < grid[i][j].length; k++) {
2738
- nodeB = grid[i][j][k];
2739
- if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) {
2740
- continue;
2741
- }
2742
- if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) {
2743
- var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2);
2744
- var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2);
2745
- if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) {
2746
- surrounding.add(nodeB);
2747
- }
2748
- }
2749
- }
2750
- }
2751
- }
2752
- }
2753
- nodeA.surrounding = [].concat(_toConsumableArray(surrounding));
2754
- }
2755
- for (i = 0; i < nodeA.surrounding.length; i++) {
2756
- this.calcRepulsionForce(nodeA, nodeA.surrounding[i]);
2757
- }
2758
- };
2759
- FDLayout.prototype.calcRepulsionRange = function() {
2760
- return 0;
2761
- };
2762
- module2.exports = FDLayout;
2763
- },
2764
- /* 19 */
2765
- /***/
2766
- function(module2, exports2, __webpack_require__) {
2767
- "use strict";
2768
- var LEdge = __webpack_require__(1);
2769
- var FDLayoutConstants = __webpack_require__(7);
2770
- function FDLayoutEdge(source, target, vEdge) {
2771
- LEdge.call(this, source, target, vEdge);
2772
- this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
2773
- }
2774
- FDLayoutEdge.prototype = Object.create(LEdge.prototype);
2775
- for (var prop in LEdge) {
2776
- FDLayoutEdge[prop] = LEdge[prop];
2777
- }
2778
- module2.exports = FDLayoutEdge;
2779
- },
2780
- /* 20 */
2781
- /***/
2782
- function(module2, exports2, __webpack_require__) {
2783
- "use strict";
2784
- var LNode = __webpack_require__(3);
2785
- function FDLayoutNode(gm, loc, size, vNode) {
2786
- LNode.call(this, gm, loc, size, vNode);
2787
- this.springForceX = 0;
2788
- this.springForceY = 0;
2789
- this.repulsionForceX = 0;
2790
- this.repulsionForceY = 0;
2791
- this.gravitationForceX = 0;
2792
- this.gravitationForceY = 0;
2793
- this.displacementX = 0;
2794
- this.displacementY = 0;
2795
- this.startX = 0;
2796
- this.finishX = 0;
2797
- this.startY = 0;
2798
- this.finishY = 0;
2799
- this.surrounding = [];
2800
- }
2801
- FDLayoutNode.prototype = Object.create(LNode.prototype);
2802
- for (var prop in LNode) {
2803
- FDLayoutNode[prop] = LNode[prop];
2804
- }
2805
- FDLayoutNode.prototype.setGridCoordinates = function(_startX, _finishX, _startY, _finishY) {
2806
- this.startX = _startX;
2807
- this.finishX = _finishX;
2808
- this.startY = _startY;
2809
- this.finishY = _finishY;
2810
- };
2811
- module2.exports = FDLayoutNode;
2812
- },
2813
- /* 21 */
2814
- /***/
2815
- function(module2, exports2, __webpack_require__) {
2816
- "use strict";
2817
- function DimensionD2(width, height) {
2818
- this.width = 0;
2819
- this.height = 0;
2820
- if (width !== null && height !== null) {
2821
- this.height = height;
2822
- this.width = width;
2823
- }
2824
- }
2825
- DimensionD2.prototype.getWidth = function() {
2826
- return this.width;
2827
- };
2828
- DimensionD2.prototype.setWidth = function(width) {
2829
- this.width = width;
2830
- };
2831
- DimensionD2.prototype.getHeight = function() {
2832
- return this.height;
2833
- };
2834
- DimensionD2.prototype.setHeight = function(height) {
2835
- this.height = height;
2836
- };
2837
- module2.exports = DimensionD2;
2838
- },
2839
- /* 22 */
2840
- /***/
2841
- function(module2, exports2, __webpack_require__) {
2842
- "use strict";
2843
- var UniqueIDGeneretor = __webpack_require__(14);
2844
- function HashMap() {
2845
- this.map = {};
2846
- this.keys = [];
2847
- }
2848
- HashMap.prototype.put = function(key, value) {
2849
- var theId = UniqueIDGeneretor.createID(key);
2850
- if (!this.contains(theId)) {
2851
- this.map[theId] = value;
2852
- this.keys.push(key);
2853
- }
2854
- };
2855
- HashMap.prototype.contains = function(key) {
2856
- var theId = UniqueIDGeneretor.createID(key);
2857
- return this.map[key] != null;
2858
- };
2859
- HashMap.prototype.get = function(key) {
2860
- var theId = UniqueIDGeneretor.createID(key);
2861
- return this.map[theId];
2862
- };
2863
- HashMap.prototype.keySet = function() {
2864
- return this.keys;
2865
- };
2866
- module2.exports = HashMap;
2867
- },
2868
- /* 23 */
2869
- /***/
2870
- function(module2, exports2, __webpack_require__) {
2871
- "use strict";
2872
- var UniqueIDGeneretor = __webpack_require__(14);
2873
- function HashSet() {
2874
- this.set = {};
2875
- }
2876
- ;
2877
- HashSet.prototype.add = function(obj) {
2878
- var theId = UniqueIDGeneretor.createID(obj);
2879
- if (!this.contains(theId)) this.set[theId] = obj;
2880
- };
2881
- HashSet.prototype.remove = function(obj) {
2882
- delete this.set[UniqueIDGeneretor.createID(obj)];
2883
- };
2884
- HashSet.prototype.clear = function() {
2885
- this.set = {};
2886
- };
2887
- HashSet.prototype.contains = function(obj) {
2888
- return this.set[UniqueIDGeneretor.createID(obj)] == obj;
2889
- };
2890
- HashSet.prototype.isEmpty = function() {
2891
- return this.size() === 0;
2892
- };
2893
- HashSet.prototype.size = function() {
2894
- return Object.keys(this.set).length;
2895
- };
2896
- HashSet.prototype.addAllTo = function(list) {
2897
- var keys = Object.keys(this.set);
2898
- var length = keys.length;
2899
- for (var i = 0; i < length; i++) {
2900
- list.push(this.set[keys[i]]);
2901
- }
2902
- };
2903
- HashSet.prototype.size = function() {
2904
- return Object.keys(this.set).length;
2905
- };
2906
- HashSet.prototype.addAll = function(list) {
2907
- var s = list.length;
2908
- for (var i = 0; i < s; i++) {
2909
- var v = list[i];
2910
- this.add(v);
2911
- }
2912
- };
2913
- module2.exports = HashSet;
2914
- },
2915
- /* 24 */
2916
- /***/
2917
- function(module2, exports2, __webpack_require__) {
2918
- "use strict";
2919
- var _createClass = /* @__PURE__ */ function() {
2920
- function defineProperties(target, props) {
2921
- for (var i = 0; i < props.length; i++) {
2922
- var descriptor = props[i];
2923
- descriptor.enumerable = descriptor.enumerable || false;
2924
- descriptor.configurable = true;
2925
- if ("value" in descriptor) descriptor.writable = true;
2926
- Object.defineProperty(target, descriptor.key, descriptor);
2927
- }
2928
- }
2929
- return function(Constructor, protoProps, staticProps) {
2930
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
2931
- if (staticProps) defineProperties(Constructor, staticProps);
2932
- return Constructor;
2933
- };
2934
- }();
2935
- function _classCallCheck(instance2, Constructor) {
2936
- if (!(instance2 instanceof Constructor)) {
2937
- throw new TypeError("Cannot call a class as a function");
2938
- }
2939
- }
2940
- var LinkedList = __webpack_require__(11);
2941
- var Quicksort = function() {
2942
- function Quicksort2(A, compareFunction) {
2943
- _classCallCheck(this, Quicksort2);
2944
- if (compareFunction !== null || compareFunction !== void 0) this.compareFunction = this._defaultCompareFunction;
2945
- var length = void 0;
2946
- if (A instanceof LinkedList) length = A.size();
2947
- else length = A.length;
2948
- this._quicksort(A, 0, length - 1);
2949
- }
2950
- _createClass(Quicksort2, [{
2951
- key: "_quicksort",
2952
- value: function _quicksort(A, p, r) {
2953
- if (p < r) {
2954
- var q = this._partition(A, p, r);
2955
- this._quicksort(A, p, q);
2956
- this._quicksort(A, q + 1, r);
2957
- }
2958
- }
2959
- }, {
2960
- key: "_partition",
2961
- value: function _partition(A, p, r) {
2962
- var x = this._get(A, p);
2963
- var i = p;
2964
- var j = r;
2965
- while (true) {
2966
- while (this.compareFunction(x, this._get(A, j))) {
2967
- j--;
2968
- }
2969
- while (this.compareFunction(this._get(A, i), x)) {
2970
- i++;
2971
- }
2972
- if (i < j) {
2973
- this._swap(A, i, j);
2974
- i++;
2975
- j--;
2976
- } else return j;
2977
- }
2978
- }
2979
- }, {
2980
- key: "_get",
2981
- value: function _get(object, index) {
2982
- if (object instanceof LinkedList) return object.get_object_at(index);
2983
- else return object[index];
2984
- }
2985
- }, {
2986
- key: "_set",
2987
- value: function _set(object, index, value) {
2988
- if (object instanceof LinkedList) object.set_object_at(index, value);
2989
- else object[index] = value;
2990
- }
2991
- }, {
2992
- key: "_swap",
2993
- value: function _swap(A, i, j) {
2994
- var temp = this._get(A, i);
2995
- this._set(A, i, this._get(A, j));
2996
- this._set(A, j, temp);
2997
- }
2998
- }, {
2999
- key: "_defaultCompareFunction",
3000
- value: function _defaultCompareFunction(a, b) {
3001
- return b > a;
3002
- }
3003
- }]);
3004
- return Quicksort2;
3005
- }();
3006
- module2.exports = Quicksort;
3007
- },
3008
- /* 25 */
3009
- /***/
3010
- function(module2, exports2, __webpack_require__) {
3011
- "use strict";
3012
- var _createClass = /* @__PURE__ */ function() {
3013
- function defineProperties(target, props) {
3014
- for (var i = 0; i < props.length; i++) {
3015
- var descriptor = props[i];
3016
- descriptor.enumerable = descriptor.enumerable || false;
3017
- descriptor.configurable = true;
3018
- if ("value" in descriptor) descriptor.writable = true;
3019
- Object.defineProperty(target, descriptor.key, descriptor);
3020
- }
3021
- }
3022
- return function(Constructor, protoProps, staticProps) {
3023
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
3024
- if (staticProps) defineProperties(Constructor, staticProps);
3025
- return Constructor;
3026
- };
3027
- }();
3028
- function _classCallCheck(instance2, Constructor) {
3029
- if (!(instance2 instanceof Constructor)) {
3030
- throw new TypeError("Cannot call a class as a function");
3031
- }
3032
- }
3033
- var NeedlemanWunsch = function() {
3034
- function NeedlemanWunsch2(sequence1, sequence2) {
3035
- var match_score = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
3036
- var mismatch_penalty = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1;
3037
- var gap_penalty = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
3038
- _classCallCheck(this, NeedlemanWunsch2);
3039
- this.sequence1 = sequence1;
3040
- this.sequence2 = sequence2;
3041
- this.match_score = match_score;
3042
- this.mismatch_penalty = mismatch_penalty;
3043
- this.gap_penalty = gap_penalty;
3044
- this.iMax = sequence1.length + 1;
3045
- this.jMax = sequence2.length + 1;
3046
- this.grid = new Array(this.iMax);
3047
- for (var i = 0; i < this.iMax; i++) {
3048
- this.grid[i] = new Array(this.jMax);
3049
- for (var j = 0; j < this.jMax; j++) {
3050
- this.grid[i][j] = 0;
3051
- }
3052
- }
3053
- this.tracebackGrid = new Array(this.iMax);
3054
- for (var _i = 0; _i < this.iMax; _i++) {
3055
- this.tracebackGrid[_i] = new Array(this.jMax);
3056
- for (var _j = 0; _j < this.jMax; _j++) {
3057
- this.tracebackGrid[_i][_j] = [null, null, null];
3058
- }
3059
- }
3060
- this.alignments = [];
3061
- this.score = -1;
3062
- this.computeGrids();
3063
- }
3064
- _createClass(NeedlemanWunsch2, [{
3065
- key: "getScore",
3066
- value: function getScore() {
3067
- return this.score;
3068
- }
3069
- }, {
3070
- key: "getAlignments",
3071
- value: function getAlignments() {
3072
- return this.alignments;
3073
- }
3074
- // Main dynamic programming procedure
3075
- }, {
3076
- key: "computeGrids",
3077
- value: function computeGrids() {
3078
- for (var j = 1; j < this.jMax; j++) {
3079
- this.grid[0][j] = this.grid[0][j - 1] + this.gap_penalty;
3080
- this.tracebackGrid[0][j] = [false, false, true];
3081
- }
3082
- for (var i = 1; i < this.iMax; i++) {
3083
- this.grid[i][0] = this.grid[i - 1][0] + this.gap_penalty;
3084
- this.tracebackGrid[i][0] = [false, true, false];
3085
- }
3086
- for (var _i2 = 1; _i2 < this.iMax; _i2++) {
3087
- for (var _j2 = 1; _j2 < this.jMax; _j2++) {
3088
- var diag = void 0;
3089
- if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score;
3090
- else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty;
3091
- var up = this.grid[_i2 - 1][_j2] + this.gap_penalty;
3092
- var left = this.grid[_i2][_j2 - 1] + this.gap_penalty;
3093
- var maxOf = [diag, up, left];
3094
- var indices = this.arrayAllMaxIndexes(maxOf);
3095
- this.grid[_i2][_j2] = maxOf[indices[0]];
3096
- this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)];
3097
- }
3098
- }
3099
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
3100
- }
3101
- // Gets all possible valid sequence combinations
3102
- }, {
3103
- key: "alignmentTraceback",
3104
- value: function alignmentTraceback() {
3105
- var inProcessAlignments = [];
3106
- inProcessAlignments.push({
3107
- pos: [this.sequence1.length, this.sequence2.length],
3108
- seq1: "",
3109
- seq2: ""
3110
- });
3111
- while (inProcessAlignments[0]) {
3112
- var current = inProcessAlignments[0];
3113
- var directions = this.tracebackGrid[current.pos[0]][current.pos[1]];
3114
- if (directions[0]) {
3115
- inProcessAlignments.push({
3116
- pos: [current.pos[0] - 1, current.pos[1] - 1],
3117
- seq1: this.sequence1[current.pos[0] - 1] + current.seq1,
3118
- seq2: this.sequence2[current.pos[1] - 1] + current.seq2
3119
- });
3120
- }
3121
- if (directions[1]) {
3122
- inProcessAlignments.push({
3123
- pos: [current.pos[0] - 1, current.pos[1]],
3124
- seq1: this.sequence1[current.pos[0] - 1] + current.seq1,
3125
- seq2: "-" + current.seq2
3126
- });
3127
- }
3128
- if (directions[2]) {
3129
- inProcessAlignments.push({
3130
- pos: [current.pos[0], current.pos[1] - 1],
3131
- seq1: "-" + current.seq1,
3132
- seq2: this.sequence2[current.pos[1] - 1] + current.seq2
3133
- });
3134
- }
3135
- if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({
3136
- sequence1: current.seq1,
3137
- sequence2: current.seq2
3138
- });
3139
- inProcessAlignments.shift();
3140
- }
3141
- return this.alignments;
3142
- }
3143
- // Helper Functions
3144
- }, {
3145
- key: "getAllIndexes",
3146
- value: function getAllIndexes(arr, val) {
3147
- var indexes = [], i = -1;
3148
- while ((i = arr.indexOf(val, i + 1)) !== -1) {
3149
- indexes.push(i);
3150
- }
3151
- return indexes;
3152
- }
3153
- }, {
3154
- key: "arrayAllMaxIndexes",
3155
- value: function arrayAllMaxIndexes(array) {
3156
- return this.getAllIndexes(array, Math.max.apply(null, array));
3157
- }
3158
- }]);
3159
- return NeedlemanWunsch2;
3160
- }();
3161
- module2.exports = NeedlemanWunsch;
3162
- },
3163
- /* 26 */
3164
- /***/
3165
- function(module2, exports2, __webpack_require__) {
3166
- "use strict";
3167
- var layoutBase = function layoutBase2() {
3168
- return;
3169
- };
3170
- layoutBase.FDLayout = __webpack_require__(18);
3171
- layoutBase.FDLayoutConstants = __webpack_require__(7);
3172
- layoutBase.FDLayoutEdge = __webpack_require__(19);
3173
- layoutBase.FDLayoutNode = __webpack_require__(20);
3174
- layoutBase.DimensionD = __webpack_require__(21);
3175
- layoutBase.HashMap = __webpack_require__(22);
3176
- layoutBase.HashSet = __webpack_require__(23);
3177
- layoutBase.IGeometry = __webpack_require__(8);
3178
- layoutBase.IMath = __webpack_require__(9);
3179
- layoutBase.Integer = __webpack_require__(10);
3180
- layoutBase.Point = __webpack_require__(12);
3181
- layoutBase.PointD = __webpack_require__(4);
3182
- layoutBase.RandomSeed = __webpack_require__(16);
3183
- layoutBase.RectangleD = __webpack_require__(13);
3184
- layoutBase.Transform = __webpack_require__(17);
3185
- layoutBase.UniqueIDGeneretor = __webpack_require__(14);
3186
- layoutBase.Quicksort = __webpack_require__(24);
3187
- layoutBase.LinkedList = __webpack_require__(11);
3188
- layoutBase.LGraphObject = __webpack_require__(2);
3189
- layoutBase.LGraph = __webpack_require__(5);
3190
- layoutBase.LEdge = __webpack_require__(1);
3191
- layoutBase.LGraphManager = __webpack_require__(6);
3192
- layoutBase.LNode = __webpack_require__(3);
3193
- layoutBase.Layout = __webpack_require__(15);
3194
- layoutBase.LayoutConstants = __webpack_require__(0);
3195
- layoutBase.NeedlemanWunsch = __webpack_require__(25);
3196
- module2.exports = layoutBase;
3197
- },
3198
- /* 27 */
3199
- /***/
3200
- function(module2, exports2, __webpack_require__) {
3201
- "use strict";
3202
- function Emitter() {
3203
- this.listeners = [];
3204
- }
3205
- var p = Emitter.prototype;
3206
- p.addListener = function(event, callback) {
3207
- this.listeners.push({
3208
- event,
3209
- callback
3210
- });
3211
- };
3212
- p.removeListener = function(event, callback) {
3213
- for (var i = this.listeners.length; i >= 0; i--) {
3214
- var l = this.listeners[i];
3215
- if (l.event === event && l.callback === callback) {
3216
- this.listeners.splice(i, 1);
3217
- }
3218
- }
3219
- };
3220
- p.emit = function(event, data) {
3221
- for (var i = 0; i < this.listeners.length; i++) {
3222
- var l = this.listeners[i];
3223
- if (event === l.event) {
3224
- l.callback(data);
3225
- }
3226
- }
3227
- };
3228
- module2.exports = Emitter;
3229
- }
3230
- /******/
3231
- ])
3232
- );
3233
- });
3234
- }
3235
- });
3236
-
3237
- // node_modules/cose-base/cose-base.js
3238
- var require_cose_base = __commonJS({
3239
- "node_modules/cose-base/cose-base.js"(exports, module) {
3240
- (function webpackUniversalModuleDefinition(root, factory) {
3241
- if (typeof exports === "object" && typeof module === "object")
3242
- module.exports = factory(require_layout_base());
3243
- else if (typeof define === "function" && define.amd)
3244
- define(["layout-base"], factory);
3245
- else if (typeof exports === "object")
3246
- exports["coseBase"] = factory(require_layout_base());
3247
- else
3248
- root["coseBase"] = factory(root["layoutBase"]);
3249
- })(exports, function(__WEBPACK_EXTERNAL_MODULE_0__) {
3250
- return (
3251
- /******/
3252
- function(modules) {
3253
- var installedModules = {};
3254
- function __webpack_require__(moduleId) {
3255
- if (installedModules[moduleId]) {
3256
- return installedModules[moduleId].exports;
3257
- }
3258
- var module2 = installedModules[moduleId] = {
3259
- /******/
3260
- i: moduleId,
3261
- /******/
3262
- l: false,
3263
- /******/
3264
- exports: {}
3265
- /******/
3266
- };
3267
- modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
3268
- module2.l = true;
3269
- return module2.exports;
3270
- }
3271
- __webpack_require__.m = modules;
3272
- __webpack_require__.c = installedModules;
3273
- __webpack_require__.i = function(value) {
3274
- return value;
3275
- };
3276
- __webpack_require__.d = function(exports2, name, getter) {
3277
- if (!__webpack_require__.o(exports2, name)) {
3278
- Object.defineProperty(exports2, name, {
3279
- /******/
3280
- configurable: false,
3281
- /******/
3282
- enumerable: true,
3283
- /******/
3284
- get: getter
3285
- /******/
3286
- });
3287
- }
3288
- };
3289
- __webpack_require__.n = function(module2) {
3290
- var getter = module2 && module2.__esModule ? (
3291
- /******/
3292
- function getDefault() {
3293
- return module2["default"];
3294
- }
3295
- ) : (
3296
- /******/
3297
- function getModuleExports() {
3298
- return module2;
3299
- }
3300
- );
3301
- __webpack_require__.d(getter, "a", getter);
3302
- return getter;
3303
- };
3304
- __webpack_require__.o = function(object, property) {
3305
- return Object.prototype.hasOwnProperty.call(object, property);
3306
- };
3307
- __webpack_require__.p = "";
3308
- return __webpack_require__(__webpack_require__.s = 7);
3309
- }([
3310
- /* 0 */
3311
- /***/
3312
- function(module2, exports2) {
3313
- module2.exports = __WEBPACK_EXTERNAL_MODULE_0__;
3314
- },
3315
- /* 1 */
3316
- /***/
3317
- function(module2, exports2, __webpack_require__) {
3318
- "use strict";
3319
- var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;
3320
- function CoSEConstants() {
3321
- }
3322
- for (var prop in FDLayoutConstants) {
3323
- CoSEConstants[prop] = FDLayoutConstants[prop];
3324
- }
3325
- CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;
3326
- CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
3327
- CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;
3328
- CoSEConstants.TILE = true;
3329
- CoSEConstants.TILING_PADDING_VERTICAL = 10;
3330
- CoSEConstants.TILING_PADDING_HORIZONTAL = 10;
3331
- CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false;
3332
- module2.exports = CoSEConstants;
3333
- },
3334
- /* 2 */
3335
- /***/
3336
- function(module2, exports2, __webpack_require__) {
3337
- "use strict";
3338
- var FDLayoutEdge = __webpack_require__(0).FDLayoutEdge;
3339
- function CoSEEdge(source, target, vEdge) {
3340
- FDLayoutEdge.call(this, source, target, vEdge);
3341
- }
3342
- CoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);
3343
- for (var prop in FDLayoutEdge) {
3344
- CoSEEdge[prop] = FDLayoutEdge[prop];
3345
- }
3346
- module2.exports = CoSEEdge;
3347
- },
3348
- /* 3 */
3349
- /***/
3350
- function(module2, exports2, __webpack_require__) {
3351
- "use strict";
3352
- var LGraph = __webpack_require__(0).LGraph;
3353
- function CoSEGraph(parent, graphMgr, vGraph) {
3354
- LGraph.call(this, parent, graphMgr, vGraph);
3355
- }
3356
- CoSEGraph.prototype = Object.create(LGraph.prototype);
3357
- for (var prop in LGraph) {
3358
- CoSEGraph[prop] = LGraph[prop];
3359
- }
3360
- module2.exports = CoSEGraph;
3361
- },
3362
- /* 4 */
3363
- /***/
3364
- function(module2, exports2, __webpack_require__) {
3365
- "use strict";
3366
- var LGraphManager = __webpack_require__(0).LGraphManager;
3367
- function CoSEGraphManager(layout) {
3368
- LGraphManager.call(this, layout);
3369
- }
3370
- CoSEGraphManager.prototype = Object.create(LGraphManager.prototype);
3371
- for (var prop in LGraphManager) {
3372
- CoSEGraphManager[prop] = LGraphManager[prop];
3373
- }
3374
- module2.exports = CoSEGraphManager;
3375
- },
3376
- /* 5 */
3377
- /***/
3378
- function(module2, exports2, __webpack_require__) {
3379
- "use strict";
3380
- var FDLayoutNode = __webpack_require__(0).FDLayoutNode;
3381
- var IMath = __webpack_require__(0).IMath;
3382
- function CoSENode(gm, loc, size, vNode) {
3383
- FDLayoutNode.call(this, gm, loc, size, vNode);
3384
- }
3385
- CoSENode.prototype = Object.create(FDLayoutNode.prototype);
3386
- for (var prop in FDLayoutNode) {
3387
- CoSENode[prop] = FDLayoutNode[prop];
3388
- }
3389
- CoSENode.prototype.move = function() {
3390
- var layout = this.graphManager.getLayout();
3391
- this.displacementX = layout.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;
3392
- this.displacementY = layout.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;
3393
- if (Math.abs(this.displacementX) > layout.coolingFactor * layout.maxNodeDisplacement) {
3394
- this.displacementX = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementX);
3395
- }
3396
- if (Math.abs(this.displacementY) > layout.coolingFactor * layout.maxNodeDisplacement) {
3397
- this.displacementY = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementY);
3398
- }
3399
- if (this.child == null) {
3400
- this.moveBy(this.displacementX, this.displacementY);
3401
- } else if (this.child.getNodes().length == 0) {
3402
- this.moveBy(this.displacementX, this.displacementY);
3403
- } else {
3404
- this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
3405
- }
3406
- layout.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);
3407
- this.springForceX = 0;
3408
- this.springForceY = 0;
3409
- this.repulsionForceX = 0;
3410
- this.repulsionForceY = 0;
3411
- this.gravitationForceX = 0;
3412
- this.gravitationForceY = 0;
3413
- this.displacementX = 0;
3414
- this.displacementY = 0;
3415
- };
3416
- CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) {
3417
- var nodes = this.getChild().getNodes();
3418
- var node;
3419
- for (var i = 0; i < nodes.length; i++) {
3420
- node = nodes[i];
3421
- if (node.getChild() == null) {
3422
- node.moveBy(dX, dY);
3423
- node.displacementX += dX;
3424
- node.displacementY += dY;
3425
- } else {
3426
- node.propogateDisplacementToChildren(dX, dY);
3427
- }
3428
- }
3429
- };
3430
- CoSENode.prototype.setPred1 = function(pred12) {
3431
- this.pred1 = pred12;
3432
- };
3433
- CoSENode.prototype.getPred1 = function() {
3434
- return pred1;
3435
- };
3436
- CoSENode.prototype.getPred2 = function() {
3437
- return pred2;
3438
- };
3439
- CoSENode.prototype.setNext = function(next2) {
3440
- this.next = next2;
3441
- };
3442
- CoSENode.prototype.getNext = function() {
3443
- return next;
3444
- };
3445
- CoSENode.prototype.setProcessed = function(processed2) {
3446
- this.processed = processed2;
3447
- };
3448
- CoSENode.prototype.isProcessed = function() {
3449
- return processed;
3450
- };
3451
- module2.exports = CoSENode;
3452
- },
3453
- /* 6 */
3454
- /***/
3455
- function(module2, exports2, __webpack_require__) {
3456
- "use strict";
3457
- var FDLayout = __webpack_require__(0).FDLayout;
3458
- var CoSEGraphManager = __webpack_require__(4);
3459
- var CoSEGraph = __webpack_require__(3);
3460
- var CoSENode = __webpack_require__(5);
3461
- var CoSEEdge = __webpack_require__(2);
3462
- var CoSEConstants = __webpack_require__(1);
3463
- var FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;
3464
- var LayoutConstants = __webpack_require__(0).LayoutConstants;
3465
- var Point2 = __webpack_require__(0).Point;
3466
- var PointD = __webpack_require__(0).PointD;
3467
- var Layout2 = __webpack_require__(0).Layout;
3468
- var Integer = __webpack_require__(0).Integer;
3469
- var IGeometry = __webpack_require__(0).IGeometry;
3470
- var LGraph = __webpack_require__(0).LGraph;
3471
- var Transform = __webpack_require__(0).Transform;
3472
- function CoSELayout() {
3473
- FDLayout.call(this);
3474
- this.toBeTiled = {};
3475
- }
3476
- CoSELayout.prototype = Object.create(FDLayout.prototype);
3477
- for (var prop in FDLayout) {
3478
- CoSELayout[prop] = FDLayout[prop];
3479
- }
3480
- CoSELayout.prototype.newGraphManager = function() {
3481
- var gm = new CoSEGraphManager(this);
3482
- this.graphManager = gm;
3483
- return gm;
3484
- };
3485
- CoSELayout.prototype.newGraph = function(vGraph) {
3486
- return new CoSEGraph(null, this.graphManager, vGraph);
3487
- };
3488
- CoSELayout.prototype.newNode = function(vNode) {
3489
- return new CoSENode(this.graphManager, vNode);
3490
- };
3491
- CoSELayout.prototype.newEdge = function(vEdge) {
3492
- return new CoSEEdge(null, null, vEdge);
3493
- };
3494
- CoSELayout.prototype.initParameters = function() {
3495
- FDLayout.prototype.initParameters.call(this, arguments);
3496
- if (!this.isSubLayout) {
3497
- if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {
3498
- this.idealEdgeLength = 10;
3499
- } else {
3500
- this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;
3501
- }
3502
- this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;
3503
- this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;
3504
- this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;
3505
- this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;
3506
- this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;
3507
- this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;
3508
- this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;
3509
- this.prunedNodesAll = [];
3510
- this.growTreeIterations = 0;
3511
- this.afterGrowthIterations = 0;
3512
- this.isTreeGrowing = false;
3513
- this.isGrowthFinished = false;
3514
- this.coolingCycle = 0;
3515
- this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;
3516
- this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations;
3517
- this.coolingAdjuster = 1;
3518
- }
3519
- };
3520
- CoSELayout.prototype.layout = function() {
3521
- var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;
3522
- if (createBendsAsNeeded) {
3523
- this.createBendpoints();
3524
- this.graphManager.resetAllEdges();
3525
- }
3526
- this.level = 0;
3527
- return this.classicLayout();
3528
- };
3529
- CoSELayout.prototype.classicLayout = function() {
3530
- this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();
3531
- this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);
3532
- this.calcNoOfChildrenForAllNodes();
3533
- this.graphManager.calcLowestCommonAncestors();
3534
- this.graphManager.calcInclusionTreeDepths();
3535
- this.graphManager.getRoot().calcEstimatedSize();
3536
- this.calcIdealEdgeLengths();
3537
- if (!this.incremental) {
3538
- var forest = this.getFlatForest();
3539
- if (forest.length > 0) {
3540
- this.positionNodesRadially(forest);
3541
- } else {
3542
- this.reduceTrees();
3543
- this.graphManager.resetAllNodesToApplyGravitation();
3544
- var allNodes = new Set(this.getAllNodes());
3545
- var intersection = this.nodesWithGravity.filter(function(x) {
3546
- return allNodes.has(x);
3547
- });
3548
- this.graphManager.setAllNodesToApplyGravitation(intersection);
3549
- this.positionNodesRandomly();
3550
- }
3551
- } else {
3552
- if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {
3553
- this.reduceTrees();
3554
- this.graphManager.resetAllNodesToApplyGravitation();
3555
- var allNodes = new Set(this.getAllNodes());
3556
- var intersection = this.nodesWithGravity.filter(function(x) {
3557
- return allNodes.has(x);
3558
- });
3559
- this.graphManager.setAllNodesToApplyGravitation(intersection);
3560
- }
3561
- }
3562
- this.initSpringEmbedder();
3563
- this.runSpringEmbedder();
3564
- return true;
3565
- };
3566
- CoSELayout.prototype.tick = function() {
3567
- this.totalIterations++;
3568
- if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {
3569
- if (this.prunedNodesAll.length > 0) {
3570
- this.isTreeGrowing = true;
3571
- } else {
3572
- return true;
3573
- }
3574
- }
3575
- if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
3576
- if (this.isConverged()) {
3577
- if (this.prunedNodesAll.length > 0) {
3578
- this.isTreeGrowing = true;
3579
- } else {
3580
- return true;
3581
- }
3582
- }
3583
- this.coolingCycle++;
3584
- if (this.layoutQuality == 0) {
3585
- this.coolingAdjuster = this.coolingCycle;
3586
- } else if (this.layoutQuality == 1) {
3587
- this.coolingAdjuster = this.coolingCycle / 3;
3588
- }
3589
- this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature);
3590
- this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
3591
- }
3592
- if (this.isTreeGrowing) {
3593
- if (this.growTreeIterations % 10 == 0) {
3594
- if (this.prunedNodesAll.length > 0) {
3595
- this.graphManager.updateBounds();
3596
- this.updateGrid();
3597
- this.growTree(this.prunedNodesAll);
3598
- this.graphManager.resetAllNodesToApplyGravitation();
3599
- var allNodes = new Set(this.getAllNodes());
3600
- var intersection = this.nodesWithGravity.filter(function(x) {
3601
- return allNodes.has(x);
3602
- });
3603
- this.graphManager.setAllNodesToApplyGravitation(intersection);
3604
- this.graphManager.updateBounds();
3605
- this.updateGrid();
3606
- this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;
3607
- } else {
3608
- this.isTreeGrowing = false;
3609
- this.isGrowthFinished = true;
3610
- }
3611
- }
3612
- this.growTreeIterations++;
3613
- }
3614
- if (this.isGrowthFinished) {
3615
- if (this.isConverged()) {
3616
- return true;
3617
- }
3618
- if (this.afterGrowthIterations % 10 == 0) {
3619
- this.graphManager.updateBounds();
3620
- this.updateGrid();
3621
- }
3622
- this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);
3623
- this.afterGrowthIterations++;
3624
- }
3625
- var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;
3626
- var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
3627
- this.totalDisplacement = 0;
3628
- this.graphManager.updateBounds();
3629
- this.calcSpringForces();
3630
- this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);
3631
- this.calcGravitationalForces();
3632
- this.moveNodes();
3633
- this.animate();
3634
- return false;
3635
- };
3636
- CoSELayout.prototype.getPositionsData = function() {
3637
- var allNodes = this.graphManager.getAllNodes();
3638
- var pData = {};
3639
- for (var i = 0; i < allNodes.length; i++) {
3640
- var rect = allNodes[i].rect;
3641
- var id = allNodes[i].id;
3642
- pData[id] = {
3643
- id,
3644
- x: rect.getCenterX(),
3645
- y: rect.getCenterY(),
3646
- w: rect.width,
3647
- h: rect.height
3648
- };
3649
- }
3650
- return pData;
3651
- };
3652
- CoSELayout.prototype.runSpringEmbedder = function() {
3653
- this.initialAnimationPeriod = 25;
3654
- this.animationPeriod = this.initialAnimationPeriod;
3655
- var layoutEnded = false;
3656
- if (FDLayoutConstants.ANIMATE === "during") {
3657
- this.emit("layoutstarted");
3658
- } else {
3659
- while (!layoutEnded) {
3660
- layoutEnded = this.tick();
3661
- }
3662
- this.graphManager.updateBounds();
3663
- }
3664
- };
3665
- CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() {
3666
- var nodeList = [];
3667
- var graph;
3668
- var graphs = this.graphManager.getGraphs();
3669
- var size = graphs.length;
3670
- var i;
3671
- for (i = 0; i < size; i++) {
3672
- graph = graphs[i];
3673
- graph.updateConnected();
3674
- if (!graph.isConnected) {
3675
- nodeList = nodeList.concat(graph.getNodes());
3676
- }
3677
- }
3678
- return nodeList;
3679
- };
3680
- CoSELayout.prototype.createBendpoints = function() {
3681
- var edges = [];
3682
- edges = edges.concat(this.graphManager.getAllEdges());
3683
- var visited = /* @__PURE__ */ new Set();
3684
- var i;
3685
- for (i = 0; i < edges.length; i++) {
3686
- var edge = edges[i];
3687
- if (!visited.has(edge)) {
3688
- var source = edge.getSource();
3689
- var target = edge.getTarget();
3690
- if (source == target) {
3691
- edge.getBendpoints().push(new PointD());
3692
- edge.getBendpoints().push(new PointD());
3693
- this.createDummyNodesForBendpoints(edge);
3694
- visited.add(edge);
3695
- } else {
3696
- var edgeList = [];
3697
- edgeList = edgeList.concat(source.getEdgeListToNode(target));
3698
- edgeList = edgeList.concat(target.getEdgeListToNode(source));
3699
- if (!visited.has(edgeList[0])) {
3700
- if (edgeList.length > 1) {
3701
- var k;
3702
- for (k = 0; k < edgeList.length; k++) {
3703
- var multiEdge = edgeList[k];
3704
- multiEdge.getBendpoints().push(new PointD());
3705
- this.createDummyNodesForBendpoints(multiEdge);
3706
- }
3707
- }
3708
- edgeList.forEach(function(edge2) {
3709
- visited.add(edge2);
3710
- });
3711
- }
3712
- }
3713
- }
3714
- if (visited.size == edges.length) {
3715
- break;
3716
- }
3717
- }
3718
- };
3719
- CoSELayout.prototype.positionNodesRadially = function(forest) {
3720
- var currentStartingPoint = new Point2(0, 0);
3721
- var numberOfColumns = Math.ceil(Math.sqrt(forest.length));
3722
- var height = 0;
3723
- var currentY = 0;
3724
- var currentX = 0;
3725
- var point = new PointD(0, 0);
3726
- for (var i = 0; i < forest.length; i++) {
3727
- if (i % numberOfColumns == 0) {
3728
- currentX = 0;
3729
- currentY = height;
3730
- if (i != 0) {
3731
- currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;
3732
- }
3733
- height = 0;
3734
- }
3735
- var tree = forest[i];
3736
- var centerNode = Layout2.findCenterOfTree(tree);
3737
- currentStartingPoint.x = currentX;
3738
- currentStartingPoint.y = currentY;
3739
- point = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);
3740
- if (point.y > height) {
3741
- height = Math.floor(point.y);
3742
- }
3743
- currentX = Math.floor(point.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);
3744
- }
3745
- this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point.x / 2, LayoutConstants.WORLD_CENTER_Y - point.y / 2));
3746
- };
3747
- CoSELayout.radialLayout = function(tree, centerNode, startingPoint) {
3748
- var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);
3749
- CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);
3750
- var bounds = LGraph.calculateBounds(tree);
3751
- var transform = new Transform();
3752
- transform.setDeviceOrgX(bounds.getMinX());
3753
- transform.setDeviceOrgY(bounds.getMinY());
3754
- transform.setWorldOrgX(startingPoint.x);
3755
- transform.setWorldOrgY(startingPoint.y);
3756
- for (var i = 0; i < tree.length; i++) {
3757
- var node = tree[i];
3758
- node.transform(transform);
3759
- }
3760
- var bottomRight = new PointD(bounds.getMaxX(), bounds.getMaxY());
3761
- return transform.inverseTransformPoint(bottomRight);
3762
- };
3763
- CoSELayout.branchRadialLayout = function(node, parentOfNode, startAngle, endAngle, distance, radialSeparation) {
3764
- var halfInterval = (endAngle - startAngle + 1) / 2;
3765
- if (halfInterval < 0) {
3766
- halfInterval += 180;
3767
- }
3768
- var nodeAngle = (halfInterval + startAngle) % 360;
3769
- var teta = nodeAngle * IGeometry.TWO_PI / 360;
3770
- var cos_teta = Math.cos(teta);
3771
- var x_ = distance * Math.cos(teta);
3772
- var y_ = distance * Math.sin(teta);
3773
- node.setCenter(x_, y_);
3774
- var neighborEdges = [];
3775
- neighborEdges = neighborEdges.concat(node.getEdges());
3776
- var childCount = neighborEdges.length;
3777
- if (parentOfNode != null) {
3778
- childCount--;
3779
- }
3780
- var branchCount = 0;
3781
- var incEdgesCount = neighborEdges.length;
3782
- var startIndex;
3783
- var edges = node.getEdgesBetween(parentOfNode);
3784
- while (edges.length > 1) {
3785
- var temp = edges[0];
3786
- edges.splice(0, 1);
3787
- var index = neighborEdges.indexOf(temp);
3788
- if (index >= 0) {
3789
- neighborEdges.splice(index, 1);
3790
- }
3791
- incEdgesCount--;
3792
- childCount--;
3793
- }
3794
- if (parentOfNode != null) {
3795
- startIndex = (neighborEdges.indexOf(edges[0]) + 1) % incEdgesCount;
3796
- } else {
3797
- startIndex = 0;
3798
- }
3799
- var stepAngle = Math.abs(endAngle - startAngle) / childCount;
3800
- for (var i = startIndex; branchCount != childCount; i = ++i % incEdgesCount) {
3801
- var currentNeighbor = neighborEdges[i].getOtherEnd(node);
3802
- if (currentNeighbor == parentOfNode) {
3803
- continue;
3804
- }
3805
- var childStartAngle = (startAngle + branchCount * stepAngle) % 360;
3806
- var childEndAngle = (childStartAngle + stepAngle) % 360;
3807
- CoSELayout.branchRadialLayout(currentNeighbor, node, childStartAngle, childEndAngle, distance + radialSeparation, radialSeparation);
3808
- branchCount++;
3809
- }
3810
- };
3811
- CoSELayout.maxDiagonalInTree = function(tree) {
3812
- var maxDiagonal = Integer.MIN_VALUE;
3813
- for (var i = 0; i < tree.length; i++) {
3814
- var node = tree[i];
3815
- var diagonal = node.getDiagonal();
3816
- if (diagonal > maxDiagonal) {
3817
- maxDiagonal = diagonal;
3818
- }
3819
- }
3820
- return maxDiagonal;
3821
- };
3822
- CoSELayout.prototype.calcRepulsionRange = function() {
3823
- return 2 * (this.level + 1) * this.idealEdgeLength;
3824
- };
3825
- CoSELayout.prototype.groupZeroDegreeMembers = function() {
3826
- var self = this;
3827
- var tempMemberGroups = {};
3828
- this.memberGroups = {};
3829
- this.idToDummyNode = {};
3830
- var zeroDegree = [];
3831
- var allNodes = this.graphManager.getAllNodes();
3832
- for (var i = 0; i < allNodes.length; i++) {
3833
- var node = allNodes[i];
3834
- var parent = node.getParent();
3835
- if (this.getNodeDegreeWithChildren(node) === 0 && (parent.id == void 0 || !this.getToBeTiled(parent))) {
3836
- zeroDegree.push(node);
3837
- }
3838
- }
3839
- for (var i = 0; i < zeroDegree.length; i++) {
3840
- var node = zeroDegree[i];
3841
- var p_id = node.getParent().id;
3842
- if (typeof tempMemberGroups[p_id] === "undefined") tempMemberGroups[p_id] = [];
3843
- tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node);
3844
- }
3845
- Object.keys(tempMemberGroups).forEach(function(p_id2) {
3846
- if (tempMemberGroups[p_id2].length > 1) {
3847
- var dummyCompoundId = "DummyCompound_" + p_id2;
3848
- self.memberGroups[dummyCompoundId] = tempMemberGroups[p_id2];
3849
- var parent2 = tempMemberGroups[p_id2][0].getParent();
3850
- var dummyCompound = new CoSENode(self.graphManager);
3851
- dummyCompound.id = dummyCompoundId;
3852
- dummyCompound.paddingLeft = parent2.paddingLeft || 0;
3853
- dummyCompound.paddingRight = parent2.paddingRight || 0;
3854
- dummyCompound.paddingBottom = parent2.paddingBottom || 0;
3855
- dummyCompound.paddingTop = parent2.paddingTop || 0;
3856
- self.idToDummyNode[dummyCompoundId] = dummyCompound;
3857
- var dummyParentGraph = self.getGraphManager().add(self.newGraph(), dummyCompound);
3858
- var parentGraph = parent2.getChild();
3859
- parentGraph.add(dummyCompound);
3860
- for (var i2 = 0; i2 < tempMemberGroups[p_id2].length; i2++) {
3861
- var node2 = tempMemberGroups[p_id2][i2];
3862
- parentGraph.remove(node2);
3863
- dummyParentGraph.add(node2);
3864
- }
3865
- }
3866
- });
3867
- };
3868
- CoSELayout.prototype.clearCompounds = function() {
3869
- var childGraphMap = {};
3870
- var idToNode = {};
3871
- this.performDFSOnCompounds();
3872
- for (var i = 0; i < this.compoundOrder.length; i++) {
3873
- idToNode[this.compoundOrder[i].id] = this.compoundOrder[i];
3874
- childGraphMap[this.compoundOrder[i].id] = [].concat(this.compoundOrder[i].getChild().getNodes());
3875
- this.graphManager.remove(this.compoundOrder[i].getChild());
3876
- this.compoundOrder[i].child = null;
3877
- }
3878
- this.graphManager.resetAllNodes();
3879
- this.tileCompoundMembers(childGraphMap, idToNode);
3880
- };
3881
- CoSELayout.prototype.clearZeroDegreeMembers = function() {
3882
- var self = this;
3883
- var tiledZeroDegreePack = this.tiledZeroDegreePack = [];
3884
- Object.keys(this.memberGroups).forEach(function(id) {
3885
- var compoundNode = self.idToDummyNode[id];
3886
- tiledZeroDegreePack[id] = self.tileNodes(self.memberGroups[id], compoundNode.paddingLeft + compoundNode.paddingRight);
3887
- compoundNode.rect.width = tiledZeroDegreePack[id].width;
3888
- compoundNode.rect.height = tiledZeroDegreePack[id].height;
3889
- });
3890
- };
3891
- CoSELayout.prototype.repopulateCompounds = function() {
3892
- for (var i = this.compoundOrder.length - 1; i >= 0; i--) {
3893
- var lCompoundNode = this.compoundOrder[i];
3894
- var id = lCompoundNode.id;
3895
- var horizontalMargin = lCompoundNode.paddingLeft;
3896
- var verticalMargin = lCompoundNode.paddingTop;
3897
- this.adjustLocations(this.tiledMemberPack[id], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);
3898
- }
3899
- };
3900
- CoSELayout.prototype.repopulateZeroDegreeMembers = function() {
3901
- var self = this;
3902
- var tiledPack = this.tiledZeroDegreePack;
3903
- Object.keys(tiledPack).forEach(function(id) {
3904
- var compoundNode = self.idToDummyNode[id];
3905
- var horizontalMargin = compoundNode.paddingLeft;
3906
- var verticalMargin = compoundNode.paddingTop;
3907
- self.adjustLocations(tiledPack[id], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);
3908
- });
3909
- };
3910
- CoSELayout.prototype.getToBeTiled = function(node) {
3911
- var id = node.id;
3912
- if (this.toBeTiled[id] != null) {
3913
- return this.toBeTiled[id];
3914
- }
3915
- var childGraph = node.getChild();
3916
- if (childGraph == null) {
3917
- this.toBeTiled[id] = false;
3918
- return false;
3919
- }
3920
- var children = childGraph.getNodes();
3921
- for (var i = 0; i < children.length; i++) {
3922
- var theChild = children[i];
3923
- if (this.getNodeDegree(theChild) > 0) {
3924
- this.toBeTiled[id] = false;
3925
- return false;
3926
- }
3927
- if (theChild.getChild() == null) {
3928
- this.toBeTiled[theChild.id] = false;
3929
- continue;
3930
- }
3931
- if (!this.getToBeTiled(theChild)) {
3932
- this.toBeTiled[id] = false;
3933
- return false;
3934
- }
3935
- }
3936
- this.toBeTiled[id] = true;
3937
- return true;
3938
- };
3939
- CoSELayout.prototype.getNodeDegree = function(node) {
3940
- var id = node.id;
3941
- var edges = node.getEdges();
3942
- var degree = 0;
3943
- for (var i = 0; i < edges.length; i++) {
3944
- var edge = edges[i];
3945
- if (edge.getSource().id !== edge.getTarget().id) {
3946
- degree = degree + 1;
3947
- }
3948
- }
3949
- return degree;
3950
- };
3951
- CoSELayout.prototype.getNodeDegreeWithChildren = function(node) {
3952
- var degree = this.getNodeDegree(node);
3953
- if (node.getChild() == null) {
3954
- return degree;
3955
- }
3956
- var children = node.getChild().getNodes();
3957
- for (var i = 0; i < children.length; i++) {
3958
- var child = children[i];
3959
- degree += this.getNodeDegreeWithChildren(child);
3960
- }
3961
- return degree;
3962
- };
3963
- CoSELayout.prototype.performDFSOnCompounds = function() {
3964
- this.compoundOrder = [];
3965
- this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
3966
- };
3967
- CoSELayout.prototype.fillCompexOrderByDFS = function(children) {
3968
- for (var i = 0; i < children.length; i++) {
3969
- var child = children[i];
3970
- if (child.getChild() != null) {
3971
- this.fillCompexOrderByDFS(child.getChild().getNodes());
3972
- }
3973
- if (this.getToBeTiled(child)) {
3974
- this.compoundOrder.push(child);
3975
- }
3976
- }
3977
- };
3978
- CoSELayout.prototype.adjustLocations = function(organization, x, y, compoundHorizontalMargin, compoundVerticalMargin) {
3979
- x += compoundHorizontalMargin;
3980
- y += compoundVerticalMargin;
3981
- var left = x;
3982
- for (var i = 0; i < organization.rows.length; i++) {
3983
- var row = organization.rows[i];
3984
- x = left;
3985
- var maxHeight = 0;
3986
- for (var j = 0; j < row.length; j++) {
3987
- var lnode = row[j];
3988
- lnode.rect.x = x;
3989
- lnode.rect.y = y;
3990
- x += lnode.rect.width + organization.horizontalPadding;
3991
- if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;
3992
- }
3993
- y += maxHeight + organization.verticalPadding;
3994
- }
3995
- };
3996
- CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) {
3997
- var self = this;
3998
- this.tiledMemberPack = [];
3999
- Object.keys(childGraphMap).forEach(function(id) {
4000
- var compoundNode = idToNode[id];
4001
- self.tiledMemberPack[id] = self.tileNodes(childGraphMap[id], compoundNode.paddingLeft + compoundNode.paddingRight);
4002
- compoundNode.rect.width = self.tiledMemberPack[id].width;
4003
- compoundNode.rect.height = self.tiledMemberPack[id].height;
4004
- });
4005
- };
4006
- CoSELayout.prototype.tileNodes = function(nodes, minWidth) {
4007
- var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;
4008
- var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;
4009
- var organization = {
4010
- rows: [],
4011
- rowWidth: [],
4012
- rowHeight: [],
4013
- width: 0,
4014
- height: minWidth,
4015
- // assume minHeight equals to minWidth
4016
- verticalPadding,
4017
- horizontalPadding
4018
- };
4019
- nodes.sort(function(n1, n2) {
4020
- if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) return -1;
4021
- if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) return 1;
4022
- return 0;
4023
- });
4024
- for (var i = 0; i < nodes.length; i++) {
4025
- var lNode = nodes[i];
4026
- if (organization.rows.length == 0) {
4027
- this.insertNodeToRow(organization, lNode, 0, minWidth);
4028
- } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {
4029
- this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth);
4030
- } else {
4031
- this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);
4032
- }
4033
- this.shiftToLastRow(organization);
4034
- }
4035
- return organization;
4036
- };
4037
- CoSELayout.prototype.insertNodeToRow = function(organization, node, rowIndex, minWidth) {
4038
- var minCompoundSize = minWidth;
4039
- if (rowIndex == organization.rows.length) {
4040
- var secondDimension = [];
4041
- organization.rows.push(secondDimension);
4042
- organization.rowWidth.push(minCompoundSize);
4043
- organization.rowHeight.push(0);
4044
- }
4045
- var w = organization.rowWidth[rowIndex] + node.rect.width;
4046
- if (organization.rows[rowIndex].length > 0) {
4047
- w += organization.horizontalPadding;
4048
- }
4049
- organization.rowWidth[rowIndex] = w;
4050
- if (organization.width < w) {
4051
- organization.width = w;
4052
- }
4053
- var h = node.rect.height;
4054
- if (rowIndex > 0) h += organization.verticalPadding;
4055
- var extraHeight = 0;
4056
- if (h > organization.rowHeight[rowIndex]) {
4057
- extraHeight = organization.rowHeight[rowIndex];
4058
- organization.rowHeight[rowIndex] = h;
4059
- extraHeight = organization.rowHeight[rowIndex] - extraHeight;
4060
- }
4061
- organization.height += extraHeight;
4062
- organization.rows[rowIndex].push(node);
4063
- };
4064
- CoSELayout.prototype.getShortestRowIndex = function(organization) {
4065
- var r = -1;
4066
- var min = Number.MAX_VALUE;
4067
- for (var i = 0; i < organization.rows.length; i++) {
4068
- if (organization.rowWidth[i] < min) {
4069
- r = i;
4070
- min = organization.rowWidth[i];
4071
- }
4072
- }
4073
- return r;
4074
- };
4075
- CoSELayout.prototype.getLongestRowIndex = function(organization) {
4076
- var r = -1;
4077
- var max = Number.MIN_VALUE;
4078
- for (var i = 0; i < organization.rows.length; i++) {
4079
- if (organization.rowWidth[i] > max) {
4080
- r = i;
4081
- max = organization.rowWidth[i];
4082
- }
4083
- }
4084
- return r;
4085
- };
4086
- CoSELayout.prototype.canAddHorizontal = function(organization, extraWidth, extraHeight) {
4087
- var sri = this.getShortestRowIndex(organization);
4088
- if (sri < 0) {
4089
- return true;
4090
- }
4091
- var min = organization.rowWidth[sri];
4092
- if (min + organization.horizontalPadding + extraWidth <= organization.width) return true;
4093
- var hDiff = 0;
4094
- if (organization.rowHeight[sri] < extraHeight) {
4095
- if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];
4096
- }
4097
- var add_to_row_ratio;
4098
- if (organization.width - min >= extraWidth + organization.horizontalPadding) {
4099
- add_to_row_ratio = (organization.height + hDiff) / (min + extraWidth + organization.horizontalPadding);
4100
- } else {
4101
- add_to_row_ratio = (organization.height + hDiff) / organization.width;
4102
- }
4103
- hDiff = extraHeight + organization.verticalPadding;
4104
- var add_new_row_ratio;
4105
- if (organization.width < extraWidth) {
4106
- add_new_row_ratio = (organization.height + hDiff) / extraWidth;
4107
- } else {
4108
- add_new_row_ratio = (organization.height + hDiff) / organization.width;
4109
- }
4110
- if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;
4111
- if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;
4112
- return add_to_row_ratio < add_new_row_ratio;
4113
- };
4114
- CoSELayout.prototype.shiftToLastRow = function(organization) {
4115
- var longest = this.getLongestRowIndex(organization);
4116
- var last = organization.rowWidth.length - 1;
4117
- var row = organization.rows[longest];
4118
- var node = row[row.length - 1];
4119
- var diff = node.width + organization.horizontalPadding;
4120
- if (organization.width - organization.rowWidth[last] > diff && longest != last) {
4121
- row.splice(-1, 1);
4122
- organization.rows[last].push(node);
4123
- organization.rowWidth[longest] = organization.rowWidth[longest] - diff;
4124
- organization.rowWidth[last] = organization.rowWidth[last] + diff;
4125
- organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];
4126
- var maxHeight = Number.MIN_VALUE;
4127
- for (var i = 0; i < row.length; i++) {
4128
- if (row[i].height > maxHeight) maxHeight = row[i].height;
4129
- }
4130
- if (longest > 0) maxHeight += organization.verticalPadding;
4131
- var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last];
4132
- organization.rowHeight[longest] = maxHeight;
4133
- if (organization.rowHeight[last] < node.height + organization.verticalPadding) organization.rowHeight[last] = node.height + organization.verticalPadding;
4134
- var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last];
4135
- organization.height += finalTotal - prevTotal;
4136
- this.shiftToLastRow(organization);
4137
- }
4138
- };
4139
- CoSELayout.prototype.tilingPreLayout = function() {
4140
- if (CoSEConstants.TILE) {
4141
- this.groupZeroDegreeMembers();
4142
- this.clearCompounds();
4143
- this.clearZeroDegreeMembers();
4144
- }
4145
- };
4146
- CoSELayout.prototype.tilingPostLayout = function() {
4147
- if (CoSEConstants.TILE) {
4148
- this.repopulateZeroDegreeMembers();
4149
- this.repopulateCompounds();
4150
- }
4151
- };
4152
- CoSELayout.prototype.reduceTrees = function() {
4153
- var prunedNodesAll = [];
4154
- var containsLeaf = true;
4155
- var node;
4156
- while (containsLeaf) {
4157
- var allNodes = this.graphManager.getAllNodes();
4158
- var prunedNodesInStepTemp = [];
4159
- containsLeaf = false;
4160
- for (var i = 0; i < allNodes.length; i++) {
4161
- node = allNodes[i];
4162
- if (node.getEdges().length == 1 && !node.getEdges()[0].isInterGraph && node.getChild() == null) {
4163
- prunedNodesInStepTemp.push([node, node.getEdges()[0], node.getOwner()]);
4164
- containsLeaf = true;
4165
- }
4166
- }
4167
- if (containsLeaf == true) {
4168
- var prunedNodesInStep = [];
4169
- for (var j = 0; j < prunedNodesInStepTemp.length; j++) {
4170
- if (prunedNodesInStepTemp[j][0].getEdges().length == 1) {
4171
- prunedNodesInStep.push(prunedNodesInStepTemp[j]);
4172
- prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]);
4173
- }
4174
- }
4175
- prunedNodesAll.push(prunedNodesInStep);
4176
- this.graphManager.resetAllNodes();
4177
- this.graphManager.resetAllEdges();
4178
- }
4179
- }
4180
- this.prunedNodesAll = prunedNodesAll;
4181
- };
4182
- CoSELayout.prototype.growTree = function(prunedNodesAll) {
4183
- var lengthOfPrunedNodesInStep = prunedNodesAll.length;
4184
- var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];
4185
- var nodeData;
4186
- for (var i = 0; i < prunedNodesInStep.length; i++) {
4187
- nodeData = prunedNodesInStep[i];
4188
- this.findPlaceforPrunedNode(nodeData);
4189
- nodeData[2].add(nodeData[0]);
4190
- nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target);
4191
- }
4192
- prunedNodesAll.splice(prunedNodesAll.length - 1, 1);
4193
- this.graphManager.resetAllNodes();
4194
- this.graphManager.resetAllEdges();
4195
- };
4196
- CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData) {
4197
- var gridForPrunedNode;
4198
- var nodeToConnect;
4199
- var prunedNode = nodeData[0];
4200
- if (prunedNode == nodeData[1].source) {
4201
- nodeToConnect = nodeData[1].target;
4202
- } else {
4203
- nodeToConnect = nodeData[1].source;
4204
- }
4205
- var startGridX = nodeToConnect.startX;
4206
- var finishGridX = nodeToConnect.finishX;
4207
- var startGridY = nodeToConnect.startY;
4208
- var finishGridY = nodeToConnect.finishY;
4209
- var upNodeCount = 0;
4210
- var downNodeCount = 0;
4211
- var rightNodeCount = 0;
4212
- var leftNodeCount = 0;
4213
- var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];
4214
- if (startGridY > 0) {
4215
- for (var i = startGridX; i <= finishGridX; i++) {
4216
- controlRegions[0] += this.grid[i][startGridY - 1].length + this.grid[i][startGridY].length - 1;
4217
- }
4218
- }
4219
- if (finishGridX < this.grid.length - 1) {
4220
- for (var i = startGridY; i <= finishGridY; i++) {
4221
- controlRegions[1] += this.grid[finishGridX + 1][i].length + this.grid[finishGridX][i].length - 1;
4222
- }
4223
- }
4224
- if (finishGridY < this.grid[0].length - 1) {
4225
- for (var i = startGridX; i <= finishGridX; i++) {
4226
- controlRegions[2] += this.grid[i][finishGridY + 1].length + this.grid[i][finishGridY].length - 1;
4227
- }
4228
- }
4229
- if (startGridX > 0) {
4230
- for (var i = startGridY; i <= finishGridY; i++) {
4231
- controlRegions[3] += this.grid[startGridX - 1][i].length + this.grid[startGridX][i].length - 1;
4232
- }
4233
- }
4234
- var min = Integer.MAX_VALUE;
4235
- var minCount;
4236
- var minIndex;
4237
- for (var j = 0; j < controlRegions.length; j++) {
4238
- if (controlRegions[j] < min) {
4239
- min = controlRegions[j];
4240
- minCount = 1;
4241
- minIndex = j;
4242
- } else if (controlRegions[j] == min) {
4243
- minCount++;
4244
- }
4245
- }
4246
- if (minCount == 3 && min == 0) {
4247
- if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {
4248
- gridForPrunedNode = 1;
4249
- } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {
4250
- gridForPrunedNode = 0;
4251
- } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {
4252
- gridForPrunedNode = 3;
4253
- } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {
4254
- gridForPrunedNode = 2;
4255
- }
4256
- } else if (minCount == 2 && min == 0) {
4257
- var random = Math.floor(Math.random() * 2);
4258
- if (controlRegions[0] == 0 && controlRegions[1] == 0) {
4259
- ;
4260
- if (random == 0) {
4261
- gridForPrunedNode = 0;
4262
- } else {
4263
- gridForPrunedNode = 1;
4264
- }
4265
- } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {
4266
- if (random == 0) {
4267
- gridForPrunedNode = 0;
4268
- } else {
4269
- gridForPrunedNode = 2;
4270
- }
4271
- } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {
4272
- if (random == 0) {
4273
- gridForPrunedNode = 0;
4274
- } else {
4275
- gridForPrunedNode = 3;
4276
- }
4277
- } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {
4278
- if (random == 0) {
4279
- gridForPrunedNode = 1;
4280
- } else {
4281
- gridForPrunedNode = 2;
4282
- }
4283
- } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {
4284
- if (random == 0) {
4285
- gridForPrunedNode = 1;
4286
- } else {
4287
- gridForPrunedNode = 3;
4288
- }
4289
- } else {
4290
- if (random == 0) {
4291
- gridForPrunedNode = 2;
4292
- } else {
4293
- gridForPrunedNode = 3;
4294
- }
4295
- }
4296
- } else if (minCount == 4 && min == 0) {
4297
- var random = Math.floor(Math.random() * 4);
4298
- gridForPrunedNode = random;
4299
- } else {
4300
- gridForPrunedNode = minIndex;
4301
- }
4302
- if (gridForPrunedNode == 0) {
4303
- prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);
4304
- } else if (gridForPrunedNode == 1) {
4305
- prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());
4306
- } else if (gridForPrunedNode == 2) {
4307
- prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);
4308
- } else {
4309
- prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());
4310
- }
4311
- };
4312
- module2.exports = CoSELayout;
4313
- },
4314
- /* 7 */
4315
- /***/
4316
- function(module2, exports2, __webpack_require__) {
4317
- "use strict";
4318
- var coseBase = {};
4319
- coseBase.layoutBase = __webpack_require__(0);
4320
- coseBase.CoSEConstants = __webpack_require__(1);
4321
- coseBase.CoSEEdge = __webpack_require__(2);
4322
- coseBase.CoSEGraph = __webpack_require__(3);
4323
- coseBase.CoSEGraphManager = __webpack_require__(4);
4324
- coseBase.CoSELayout = __webpack_require__(6);
4325
- coseBase.CoSENode = __webpack_require__(5);
4326
- module2.exports = coseBase;
4327
- }
4328
- /******/
4329
- ])
4330
- );
4331
- });
4332
- }
4333
- });
4334
-
4335
- // node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js
4336
- var require_cytoscape_cose_bilkent = __commonJS({
4337
- "node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"(exports, module) {
4338
- (function webpackUniversalModuleDefinition(root, factory) {
4339
- if (typeof exports === "object" && typeof module === "object")
4340
- module.exports = factory(require_cose_base());
4341
- else if (typeof define === "function" && define.amd)
4342
- define(["cose-base"], factory);
4343
- else if (typeof exports === "object")
4344
- exports["cytoscapeCoseBilkent"] = factory(require_cose_base());
4345
- else
4346
- root["cytoscapeCoseBilkent"] = factory(root["coseBase"]);
4347
- })(exports, function(__WEBPACK_EXTERNAL_MODULE_0__) {
4348
- return (
4349
- /******/
4350
- function(modules) {
4351
- var installedModules = {};
4352
- function __webpack_require__(moduleId) {
4353
- if (installedModules[moduleId]) {
4354
- return installedModules[moduleId].exports;
4355
- }
4356
- var module2 = installedModules[moduleId] = {
4357
- /******/
4358
- i: moduleId,
4359
- /******/
4360
- l: false,
4361
- /******/
4362
- exports: {}
4363
- /******/
4364
- };
4365
- modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
4366
- module2.l = true;
4367
- return module2.exports;
4368
- }
4369
- __webpack_require__.m = modules;
4370
- __webpack_require__.c = installedModules;
4371
- __webpack_require__.i = function(value) {
4372
- return value;
4373
- };
4374
- __webpack_require__.d = function(exports2, name, getter) {
4375
- if (!__webpack_require__.o(exports2, name)) {
4376
- Object.defineProperty(exports2, name, {
4377
- /******/
4378
- configurable: false,
4379
- /******/
4380
- enumerable: true,
4381
- /******/
4382
- get: getter
4383
- /******/
4384
- });
4385
- }
4386
- };
4387
- __webpack_require__.n = function(module2) {
4388
- var getter = module2 && module2.__esModule ? (
4389
- /******/
4390
- function getDefault() {
4391
- return module2["default"];
4392
- }
4393
- ) : (
4394
- /******/
4395
- function getModuleExports() {
4396
- return module2;
4397
- }
4398
- );
4399
- __webpack_require__.d(getter, "a", getter);
4400
- return getter;
4401
- };
4402
- __webpack_require__.o = function(object, property) {
4403
- return Object.prototype.hasOwnProperty.call(object, property);
4404
- };
4405
- __webpack_require__.p = "";
4406
- return __webpack_require__(__webpack_require__.s = 1);
4407
- }([
4408
- /* 0 */
4409
- /***/
4410
- function(module2, exports2) {
4411
- module2.exports = __WEBPACK_EXTERNAL_MODULE_0__;
4412
- },
4413
- /* 1 */
4414
- /***/
4415
- function(module2, exports2, __webpack_require__) {
4416
- "use strict";
4417
- var LayoutConstants = __webpack_require__(0).layoutBase.LayoutConstants;
4418
- var FDLayoutConstants = __webpack_require__(0).layoutBase.FDLayoutConstants;
4419
- var CoSEConstants = __webpack_require__(0).CoSEConstants;
4420
- var CoSELayout = __webpack_require__(0).CoSELayout;
4421
- var CoSENode = __webpack_require__(0).CoSENode;
4422
- var PointD = __webpack_require__(0).layoutBase.PointD;
4423
- var DimensionD2 = __webpack_require__(0).layoutBase.DimensionD;
4424
- var defaults = {
4425
- // Called on `layoutready`
4426
- ready: function ready() {
4427
- },
4428
- // Called on `layoutstop`
4429
- stop: function stop() {
4430
- },
4431
- // 'draft', 'default' or 'proof"
4432
- // - 'draft' fast cooling rate
4433
- // - 'default' moderate cooling rate
4434
- // - "proof" slow cooling rate
4435
- quality: "default",
4436
- // include labels in node dimensions
4437
- nodeDimensionsIncludeLabels: false,
4438
- // number of ticks per frame; higher is faster but more jerky
4439
- refresh: 30,
4440
- // Whether to fit the network view after when done
4441
- fit: true,
4442
- // Padding on fit
4443
- padding: 10,
4444
- // Whether to enable incremental mode
4445
- randomize: true,
4446
- // Node repulsion (non overlapping) multiplier
4447
- nodeRepulsion: 4500,
4448
- // Ideal edge (non nested) length
4449
- idealEdgeLength: 50,
4450
- // Divisor to compute edge forces
4451
- edgeElasticity: 0.45,
4452
- // Nesting factor (multiplier) to compute ideal edge length for nested edges
4453
- nestingFactor: 0.1,
4454
- // Gravity force (constant)
4455
- gravity: 0.25,
4456
- // Maximum number of iterations to perform
4457
- numIter: 2500,
4458
- // For enabling tiling
4459
- tile: true,
4460
- // Type of layout animation. The option set is {'during', 'end', false}
4461
- animate: "end",
4462
- // Duration for animate:end
4463
- animationDuration: 500,
4464
- // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
4465
- tilingPaddingVertical: 10,
4466
- // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
4467
- tilingPaddingHorizontal: 10,
4468
- // Gravity range (constant) for compounds
4469
- gravityRangeCompound: 1.5,
4470
- // Gravity force (constant) for compounds
4471
- gravityCompound: 1,
4472
- // Gravity range (constant)
4473
- gravityRange: 3.8,
4474
- // Initial cooling factor for incremental layout
4475
- initialEnergyOnIncremental: 0.5
4476
- };
4477
- function extend(defaults2, options) {
4478
- var obj = {};
4479
- for (var i in defaults2) {
4480
- obj[i] = defaults2[i];
4481
- }
4482
- for (var i in options) {
4483
- obj[i] = options[i];
4484
- }
4485
- return obj;
4486
- }
4487
- ;
4488
- function _CoSELayout(_options) {
4489
- this.options = extend(defaults, _options);
4490
- getUserOptions(this.options);
4491
- }
4492
- var getUserOptions = function getUserOptions2(options) {
4493
- if (options.nodeRepulsion != null) CoSEConstants.DEFAULT_REPULSION_STRENGTH = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = options.nodeRepulsion;
4494
- if (options.idealEdgeLength != null) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options.idealEdgeLength;
4495
- if (options.edgeElasticity != null) CoSEConstants.DEFAULT_SPRING_STRENGTH = FDLayoutConstants.DEFAULT_SPRING_STRENGTH = options.edgeElasticity;
4496
- if (options.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options.nestingFactor;
4497
- if (options.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options.gravity;
4498
- if (options.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options.numIter;
4499
- if (options.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options.gravityRange;
4500
- if (options.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options.gravityCompound;
4501
- if (options.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options.gravityRangeCompound;
4502
- if (options.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options.initialEnergyOnIncremental;
4503
- if (options.quality == "draft") LayoutConstants.QUALITY = 0;
4504
- else if (options.quality == "proof") LayoutConstants.QUALITY = 2;
4505
- else LayoutConstants.QUALITY = 1;
4506
- CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options.nodeDimensionsIncludeLabels;
4507
- CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options.randomize;
4508
- CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options.animate;
4509
- CoSEConstants.TILE = options.tile;
4510
- CoSEConstants.TILING_PADDING_VERTICAL = typeof options.tilingPaddingVertical === "function" ? options.tilingPaddingVertical.call() : options.tilingPaddingVertical;
4511
- CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options.tilingPaddingHorizontal === "function" ? options.tilingPaddingHorizontal.call() : options.tilingPaddingHorizontal;
4512
- };
4513
- _CoSELayout.prototype.run = function() {
4514
- var ready;
4515
- var frameId;
4516
- var options = this.options;
4517
- var idToLNode = this.idToLNode = {};
4518
- var layout = this.layout = new CoSELayout();
4519
- var self = this;
4520
- self.stopped = false;
4521
- this.cy = this.options.cy;
4522
- this.cy.trigger({ type: "layoutstart", layout: this });
4523
- var gm = layout.newGraphManager();
4524
- this.gm = gm;
4525
- var nodes = this.options.eles.nodes();
4526
- var edges = this.options.eles.edges();
4527
- this.root = gm.addRoot();
4528
- this.processChildrenList(this.root, this.getTopMostNodes(nodes), layout);
4529
- for (var i = 0; i < edges.length; i++) {
4530
- var edge = edges[i];
4531
- var sourceNode = this.idToLNode[edge.data("source")];
4532
- var targetNode = this.idToLNode[edge.data("target")];
4533
- if (sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) {
4534
- var e1 = gm.add(layout.newEdge(), sourceNode, targetNode);
4535
- e1.id = edge.id();
4536
- }
4537
- }
4538
- var getPositions = function getPositions2(ele, i2) {
4539
- if (typeof ele === "number") {
4540
- ele = i2;
4541
- }
4542
- var theId = ele.data("id");
4543
- var lNode = self.idToLNode[theId];
4544
- return {
4545
- x: lNode.getRect().getCenterX(),
4546
- y: lNode.getRect().getCenterY()
4547
- };
4548
- };
4549
- var iterateAnimated = function iterateAnimated2() {
4550
- var afterReposition = function afterReposition2() {
4551
- if (options.fit) {
4552
- options.cy.fit(options.eles, options.padding);
4553
- }
4554
- if (!ready) {
4555
- ready = true;
4556
- self.cy.one("layoutready", options.ready);
4557
- self.cy.trigger({ type: "layoutready", layout: self });
4558
- }
4559
- };
4560
- var ticksPerFrame = self.options.refresh;
4561
- var isDone;
4562
- for (var i2 = 0; i2 < ticksPerFrame && !isDone; i2++) {
4563
- isDone = self.stopped || self.layout.tick();
4564
- }
4565
- if (isDone) {
4566
- if (layout.checkLayoutSuccess() && !layout.isSubLayout) {
4567
- layout.doPostLayout();
4568
- }
4569
- if (layout.tilingPostLayout) {
4570
- layout.tilingPostLayout();
4571
- }
4572
- layout.isLayoutFinished = true;
4573
- self.options.eles.nodes().positions(getPositions);
4574
- afterReposition();
4575
- self.cy.one("layoutstop", self.options.stop);
4576
- self.cy.trigger({ type: "layoutstop", layout: self });
4577
- if (frameId) {
4578
- cancelAnimationFrame(frameId);
4579
- }
4580
- ready = false;
4581
- return;
4582
- }
4583
- var animationData = self.layout.getPositionsData();
4584
- options.eles.nodes().positions(function(ele, i3) {
4585
- if (typeof ele === "number") {
4586
- ele = i3;
4587
- }
4588
- if (!ele.isParent()) {
4589
- var theId = ele.id();
4590
- var pNode = animationData[theId];
4591
- var temp = ele;
4592
- while (pNode == null) {
4593
- pNode = animationData[temp.data("parent")] || animationData["DummyCompound_" + temp.data("parent")];
4594
- animationData[theId] = pNode;
4595
- temp = temp.parent()[0];
4596
- if (temp == void 0) {
4597
- break;
4598
- }
4599
- }
4600
- if (pNode != null) {
4601
- return {
4602
- x: pNode.x,
4603
- y: pNode.y
4604
- };
4605
- } else {
4606
- return {
4607
- x: ele.position("x"),
4608
- y: ele.position("y")
4609
- };
4610
- }
4611
- }
4612
- });
4613
- afterReposition();
4614
- frameId = requestAnimationFrame(iterateAnimated2);
4615
- };
4616
- layout.addListener("layoutstarted", function() {
4617
- if (self.options.animate === "during") {
4618
- frameId = requestAnimationFrame(iterateAnimated);
4619
- }
4620
- });
4621
- layout.runLayout();
4622
- if (this.options.animate !== "during") {
4623
- self.options.eles.nodes().not(":parent").layoutPositions(self, self.options, getPositions);
4624
- ready = false;
4625
- }
4626
- return this;
4627
- };
4628
- _CoSELayout.prototype.getTopMostNodes = function(nodes) {
4629
- var nodesMap = {};
4630
- for (var i = 0; i < nodes.length; i++) {
4631
- nodesMap[nodes[i].id()] = true;
4632
- }
4633
- var roots = nodes.filter(function(ele, i2) {
4634
- if (typeof ele === "number") {
4635
- ele = i2;
4636
- }
4637
- var parent = ele.parent()[0];
4638
- while (parent != null) {
4639
- if (nodesMap[parent.id()]) {
4640
- return false;
4641
- }
4642
- parent = parent.parent()[0];
4643
- }
4644
- return true;
4645
- });
4646
- return roots;
4647
- };
4648
- _CoSELayout.prototype.processChildrenList = function(parent, children, layout) {
4649
- var size = children.length;
4650
- for (var i = 0; i < size; i++) {
4651
- var theChild = children[i];
4652
- var children_of_children = theChild.children();
4653
- var theNode;
4654
- var dimensions = theChild.layoutDimensions({
4655
- nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
4656
- });
4657
- if (theChild.outerWidth() != null && theChild.outerHeight() != null) {
4658
- theNode = parent.add(new CoSENode(layout.graphManager, new PointD(theChild.position("x") - dimensions.w / 2, theChild.position("y") - dimensions.h / 2), new DimensionD2(parseFloat(dimensions.w), parseFloat(dimensions.h))));
4659
- } else {
4660
- theNode = parent.add(new CoSENode(this.graphManager));
4661
- }
4662
- theNode.id = theChild.data("id");
4663
- theNode.paddingLeft = parseInt(theChild.css("padding"));
4664
- theNode.paddingTop = parseInt(theChild.css("padding"));
4665
- theNode.paddingRight = parseInt(theChild.css("padding"));
4666
- theNode.paddingBottom = parseInt(theChild.css("padding"));
4667
- if (this.options.nodeDimensionsIncludeLabels) {
4668
- if (theChild.isParent()) {
4669
- var labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w;
4670
- var labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h;
4671
- var labelPos = theChild.css("text-halign");
4672
- theNode.labelWidth = labelWidth;
4673
- theNode.labelHeight = labelHeight;
4674
- theNode.labelPos = labelPos;
4675
- }
4676
- }
4677
- this.idToLNode[theChild.data("id")] = theNode;
4678
- if (isNaN(theNode.rect.x)) {
4679
- theNode.rect.x = 0;
4680
- }
4681
- if (isNaN(theNode.rect.y)) {
4682
- theNode.rect.y = 0;
4683
- }
4684
- if (children_of_children != null && children_of_children.length > 0) {
4685
- var theNewGraph;
4686
- theNewGraph = layout.getGraphManager().add(layout.newGraph(), theNode);
4687
- this.processChildrenList(theNewGraph, children_of_children, layout);
4688
- }
4689
- }
4690
- };
4691
- _CoSELayout.prototype.stop = function() {
4692
- this.stopped = true;
4693
- return this;
4694
- };
4695
- var register = function register2(cytoscape2) {
4696
- cytoscape2("layout", "cose-bilkent", _CoSELayout);
4697
- };
4698
- if (typeof cytoscape !== "undefined") {
4699
- register(cytoscape);
4700
- }
4701
- module2.exports = register;
4702
- }
4703
- /******/
4704
- ])
4705
- );
4706
- });
4707
- }
4708
- });
4709
- export default require_cytoscape_cose_bilkent();
4710
- //# sourceMappingURL=cytoscape-cose-bilkent.js.map