file-viewer3 1.0.26 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/README.en.md +7 -377
  2. package/README.md +8 -352
  3. package/dist/file-viewer3.css +1 -2
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/package.json +27 -129
  7. package/dist/components/3MFLoader.js +0 -527
  8. package/dist/components/AMFLoader.js +0 -188
  9. package/dist/components/ArchiveViewer.js +0 -526
  10. package/dist/components/AudioViewer.js +0 -66
  11. package/dist/components/CadViewer.js +0 -9040
  12. package/dist/components/CodeViewer.js +0 -151
  13. package/dist/components/ColladaLoader.js +0 -2282
  14. package/dist/components/DrawingViewer.js +0 -295
  15. package/dist/components/EdaViewer.js +0 -630
  16. package/dist/components/EmailViewer.js +0 -276
  17. package/dist/components/EpubViewer.js +0 -172
  18. package/dist/components/FBXLoader.js +0 -1574
  19. package/dist/components/GLTFLoader.js +0 -1383
  20. package/dist/components/ImageViewer.js +0 -1519
  21. package/dist/components/KMZLoader.js +0 -45
  22. package/dist/components/MarkdownViewer.js +0 -1476
  23. package/dist/components/ModelViewer.js +0 -797
  24. package/dist/components/OBJLoader.js +0 -287
  25. package/dist/components/OfdViewer.js +0 -133
  26. package/dist/components/PCDLoader.js +0 -141
  27. package/dist/components/PLYLoader.js +0 -305
  28. package/dist/components/PdfView.js +0 -27667
  29. package/dist/components/PptxRender.js +0 -11217
  30. package/dist/components/STLLoader.js +0 -83
  31. package/dist/components/TDSLoader.js +0 -228
  32. package/dist/components/TypstViewer.js +0 -1697
  33. package/dist/components/USDLoader.js +0 -2526
  34. package/dist/components/UmdViewer.js +0 -1873
  35. package/dist/components/VRMLLoader.js +0 -6422
  36. package/dist/components/VTKLoader.js +0 -337
  37. package/dist/components/XYZLoader.js +0 -30
  38. package/dist/components/XlsxTable.js +0 -7879
  39. package/dist/components/__vite-browser-external.js +0 -7
  40. package/dist/components/_plugin-vue_export-helper.js +0 -8
  41. package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
  42. package/dist/components/arc.js +0 -79
  43. package/dist/components/architecture-7EHR7CIX.js +0 -3
  44. package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
  45. package/dist/components/archive.js +0 -24
  46. package/dist/components/asyncToGenerator.js +0 -29
  47. package/dist/components/audio.js +0 -19
  48. package/dist/components/az-AZ-76LH7QW2.js +0 -523
  49. package/dist/components/bash.js +0 -169
  50. package/dist/components/bg-BG-XCXSNQG7.js +0 -523
  51. package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
  52. package/dist/components/bn-BD-2XOGV67Q.js +0 -523
  53. package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
  54. package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
  55. package/dist/components/cad.js +0 -23
  56. package/dist/components/cfb.js +0 -1174
  57. package/dist/components/channel.js +0 -5
  58. package/dist/components/chunk-2J33WTMH.js +0 -26
  59. package/dist/components/chunk-3OPIFGDE.js +0 -4167
  60. package/dist/components/chunk-4BX2VUAB.js +0 -19
  61. package/dist/components/chunk-55IACEB6.js +0 -9
  62. package/dist/components/chunk-5ZQYHXKU.js +0 -669
  63. package/dist/components/chunk-6U3AYISY.js +0 -624
  64. package/dist/components/chunk-727SXJPM.js +0 -3356
  65. package/dist/components/chunk-AGHRB4JF.js +0 -324
  66. package/dist/components/chunk-AQP2D5EJ.js +0 -2055
  67. package/dist/components/chunk-BSJP7CBP.js +0 -83
  68. package/dist/components/chunk-CSCIHK7Q.js +0 -3500
  69. package/dist/components/chunk-EIO257PC.js +0 -1836
  70. package/dist/components/chunk-FMBD7UC4.js +0 -5
  71. package/dist/components/chunk-K2UTITRG.js +0 -17627
  72. package/dist/components/chunk-KSCS5N6A.js +0 -572
  73. package/dist/components/chunk-L5ZTLDWV.js +0 -40
  74. package/dist/components/chunk-LZXEDZCA.js +0 -60
  75. package/dist/components/chunk-ND2GUHAM.js +0 -61
  76. package/dist/components/chunk-NNHCCRGN.js +0 -20425
  77. package/dist/components/chunk-NZK2D7GU.js +0 -68
  78. package/dist/components/chunk-O5CBEL6O.js +0 -1894
  79. package/dist/components/chunk-QZHKN3VN.js +0 -12
  80. package/dist/components/chunk-SRAX5OIU.js +0 -22
  81. package/dist/components/chunk-WU5MYG2G.js +0 -14
  82. package/dist/components/chunk-XPW4576I.js +0 -1146
  83. package/dist/components/chunk-Z3N5DIM6.js +0 -59
  84. package/dist/components/chunk-ZUYEQ4TG.js +0 -22
  85. package/dist/components/chunk.js +0 -23
  86. package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
  87. package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
  88. package/dist/components/compiler.js +0 -2
  89. package/dist/components/core.js +0 -845
  90. package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
  91. package/dist/components/cpp.js +0 -225
  92. package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
  93. package/dist/components/csharp.js +0 -260
  94. package/dist/components/css.js +0 -140
  95. package/dist/components/cytoscape.esm.js +0 -18114
  96. package/dist/components/da-DK-5WZEPLOC.js +0 -523
  97. package/dist/components/dagre-BM42HDAG.js +0 -325
  98. package/dist/components/dagre.js +0 -1936
  99. package/dist/components/de-DE-XR44H4JA.js +0 -523
  100. package/dist/components/defaultLocale.js +0 -201
  101. package/dist/components/defineProperty.js +0 -50
  102. package/dist/components/diagram-2AECGRRQ.js +0 -229
  103. package/dist/components/diagram-5GNKFQAL.js +0 -108
  104. package/dist/components/diagram-KO2AKTUF.js +0 -443
  105. package/dist/components/diagram-LMA3HP47.js +0 -139
  106. package/dist/components/diagram-OG6HWLK6.js +0 -541
  107. package/dist/components/diff.js +0 -39
  108. package/dist/components/directory-open-01563666.js +0 -26
  109. package/dist/components/directory-open-4ed118d0.js +0 -83
  110. package/dist/components/dist.js +0 -50
  111. package/dist/components/dist2.js +0 -3291
  112. package/dist/components/dist3.js +0 -1593
  113. package/dist/components/documentSearch.js +0 -378
  114. package/dist/components/docx-preview.js +0 -3113
  115. package/dist/components/drawing.js +0 -19
  116. package/dist/components/ebook.js +0 -16
  117. package/dist/components/eda.js +0 -20
  118. package/dist/components/el-GR-BZB4AONW.js +0 -523
  119. package/dist/components/email.js +0 -21
  120. package/dist/components/en-B4ZKOASM.js +0 -3
  121. package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
  122. package/dist/components/es-ES-U4NZUMDT.js +0 -523
  123. package/dist/components/eu-ES-A7QVB2H4.js +0 -523
  124. package/dist/components/eventmodeling-FCH6USID.js +0 -3
  125. package/dist/components/fa-IR-HGAKTJCU.js +0 -523
  126. package/dist/components/fflate.module.js +0 -323
  127. package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
  128. package/dist/components/file-open-002ab408.js +0 -38
  129. package/dist/components/file-open-7c801643.js +0 -24
  130. package/dist/components/file-save-3189631c.js +0 -40
  131. package/dist/components/file-save-745eba88.js +0 -36
  132. package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
  133. package/dist/components/fr-FR-RHASNOE6.js +0 -523
  134. package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
  135. package/dist/components/gitGraph-WXDBUCRP.js +0 -3
  136. package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
  137. package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
  138. package/dist/components/global-compiler.js +0 -23
  139. package/dist/components/global-renderer.js +0 -23
  140. package/dist/components/go.js +0 -140
  141. package/dist/components/graphlib.js +0 -1267
  142. package/dist/components/he-IL-6SHJWFNN.js +0 -523
  143. package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
  144. package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
  145. package/dist/components/id-ID-SAP4L64H.js +0 -523
  146. package/dist/components/image-GAAHSSAO.js +0 -3
  147. package/dist/components/image-blob-reduce.esm.js +0 -1429
  148. package/dist/components/image.js +0 -17
  149. package/dist/components/info-J43DQDTF.js +0 -3
  150. package/dist/components/infoDiagram-5YYISTIA.js +0 -26
  151. package/dist/components/ini.js +0 -88
  152. package/dist/components/init.js +0 -15
  153. package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
  154. package/dist/components/it-IT-JPQ66NNP.js +0 -523
  155. package/dist/components/ja-JP-DBVTYXUO.js +0 -523
  156. package/dist/components/java.js +0 -169
  157. package/dist/components/javascript.js +0 -436
  158. package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
  159. package/dist/components/json.js +0 -36
  160. package/dist/components/jszip.min.js +0 -3033
  161. package/dist/components/kaa-6HZHGXH3.js +0 -523
  162. package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
  163. package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
  164. package/dist/components/katex.js +0 -21979
  165. package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
  166. package/dist/components/km-KH-HSX4SM5Z.js +0 -523
  167. package/dist/components/ko-KR-MTYHY66A.js +0 -523
  168. package/dist/components/ku-TR-6OUDTVRD.js +0 -523
  169. package/dist/components/lib.js +0 -4877
  170. package/dist/components/libarchive.js +0 -360
  171. package/dist/components/linear.js +0 -289
  172. package/dist/components/lt-LT-XHIRWOB4.js +0 -523
  173. package/dist/components/lv-LV-5QDEKY6T.js +0 -523
  174. package/dist/components/markdown.js +0 -181
  175. package/dist/components/md.js +0 -17
  176. package/dist/components/mermaid-parser.core.js +0 -328
  177. package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
  178. package/dist/components/model.js +0 -21
  179. package/dist/components/mp4.js +0 -12
  180. package/dist/components/mr-IN-CRQNXWMA.js +0 -523
  181. package/dist/components/my-MM-5M5IBNSE.js +0 -523
  182. package/dist/components/nb-NO-T6EIAALU.js +0 -523
  183. package/dist/components/nestedRender.js +0 -158
  184. package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
  185. package/dist/components/nn-NO-6E72VCQL.js +0 -523
  186. package/dist/components/objectSpread2.js +0 -29
  187. package/dist/components/objectWithoutProperties.js +0 -28
  188. package/dist/components/oc-FR-POXYY2M6.js +0 -523
  189. package/dist/components/ofd.js +0 -5261
  190. package/dist/components/ofd2.js +0 -16
  191. package/dist/components/ordinal.js +0 -65
  192. package/dist/components/pa-IN-N4M65BXN.js +0 -523
  193. package/dist/components/packet-YPE3B663.js +0 -3
  194. package/dist/components/pdf.js +0 -24
  195. package/dist/components/percentages-BXMCSKIN.js +0 -3
  196. package/dist/components/php.js +0 -294
  197. package/dist/components/pica.js +0 -1009
  198. package/dist/components/pie-LRSECV5Y.js +0 -3
  199. package/dist/components/pie.js +0 -47
  200. package/dist/components/pieDiagram-4H26LBE5.js +0 -130
  201. package/dist/components/pl-PL-T2D74RX3.js +0 -523
  202. package/dist/components/postal-mime.js +0 -3146
  203. package/dist/components/pptx.js +0 -15
  204. package/dist/components/printLayout.js +0 -42
  205. package/dist/components/prod.js +0 -21770
  206. package/dist/components/pt-BR-5N22H2LF.js +0 -523
  207. package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
  208. package/dist/components/python.js +0 -238
  209. package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
  210. package/dist/components/radar-GUYGQ44K.js +0 -3
  211. package/dist/components/renderer.js +0 -2
  212. package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
  213. package/dist/components/ro-RO-JPDTUUEW.js +0 -523
  214. package/dist/components/rough.esm.js +0 -1355
  215. package/dist/components/roundRect.js +0 -90
  216. package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
  217. package/dist/components/rust.js +0 -169
  218. package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
  219. package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
  220. package/dist/components/shared.js +0 -175
  221. package/dist/components/shared2.js +0 -4
  222. package/dist/components/si-LK-N5RQ5JYF.js +0 -523
  223. package/dist/components/sk-SK-C5VTKIMK.js +0 -523
  224. package/dist/components/sl-SI-NN7IZMDC.js +0 -523
  225. package/dist/components/sourceLoading.js +0 -134
  226. package/dist/components/sql.js +0 -118
  227. package/dist/components/src.js +0 -2664
  228. package/dist/components/src2.js +0 -10722
  229. package/dist/components/stateDiagram-AJRCARHV.js +0 -217
  230. package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
  231. package/dist/components/subset-shared.chunk.js +0 -3
  232. package/dist/components/subset-worker.chunk.js +0 -21
  233. package/dist/components/sv-SE-XGPEYMSR.js +0 -523
  234. package/dist/components/ta-IN-2NMHFXQM.js +0 -523
  235. package/dist/components/text.js +0 -20
  236. package/dist/components/th-TH-HPSO5L25.js +0 -523
  237. package/dist/components/three.module.js +0 -13134
  238. package/dist/components/time.js +0 -910
  239. package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
  240. package/dist/components/tr-TR-DEFEU3FU.js +0 -523
  241. package/dist/components/treeView-BLDUP644.js +0 -3
  242. package/dist/components/treemap-LRROVOQU.js +0 -3
  243. package/dist/components/typescript.js +0 -521
  244. package/dist/components/typst.js +0 -25
  245. package/dist/components/uk-UA-QMV73CPH.js +0 -523
  246. package/dist/components/umd.js +0 -16
  247. package/dist/components/use.js +0 -422
  248. package/dist/components/util.js +0 -49
  249. package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
  250. package/dist/components/vi-VN-M7AON7JQ.js +0 -523
  251. package/dist/components/viewerZoom.js +0 -92
  252. package/dist/components/wardley-L42UT6IY.js +0 -3
  253. package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
  254. package/dist/components/wasm-pack-shim.js +0 -1711
  255. package/dist/components/wasm-pack-shim2.js +0 -934
  256. package/dist/components/wasm.js +0 -97
  257. package/dist/components/word.js +0 -3055
  258. package/dist/components/worker-ref.js +0 -16
  259. package/dist/components/xlsx.js +0 -21
  260. package/dist/components/xml.js +0 -166
  261. package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
  262. package/dist/components/yaml.js +0 -144
  263. package/dist/components/zh-CN-LNUGB5OW.js +0 -523
  264. package/dist/components/zh-HK-E62DVLB3.js +0 -523
  265. package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
  266. package/dist/index.mjs +0 -3293
  267. package/dist/src/App.vue.d.ts +0 -3
  268. package/dist/src/compare/CompareApp.vue.d.ts +0 -3
  269. package/dist/src/compare/main.d.ts +0 -0
  270. package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
  271. package/dist/src/components/HelloWorld.vue.d.ts +0 -3
  272. package/dist/src/components/utils.d.ts +0 -4
  273. package/dist/src/main.d.ts +0 -0
  274. package/dist/src/package/common/printCapability.d.ts +0 -27
  275. package/dist/src/package/common/printLayout.d.ts +0 -16
  276. package/dist/src/package/common/sourceLoading.d.ts +0 -10
  277. package/dist/src/package/common/type.d.ts +0 -544
  278. package/dist/src/package/common/util.d.ts +0 -5
  279. package/dist/src/package/common/worker-ref.d.ts +0 -12
  280. package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
  281. package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
  282. package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
  283. package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
  284. package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
  285. package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
  286. package/dist/src/package/components/FileViewer/index.d.ts +0 -2
  287. package/dist/src/package/components/FileViewer/util.d.ts +0 -3
  288. package/dist/src/package/index.d.ts +0 -22
  289. package/dist/src/package/use/documentLocation.d.ts +0 -15
  290. package/dist/src/package/use/documentSearch.d.ts +0 -234
  291. package/dist/src/package/use/index.d.ts +0 -5
  292. package/dist/src/package/use/loading.d.ts +0 -33
  293. package/dist/src/package/use/viewerZoom.d.ts +0 -42
  294. package/dist/src/package/use/worker.d.ts +0 -24
  295. package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
  296. package/dist/src/package/vendors/archive/cache.d.ts +0 -10
  297. package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
  298. package/dist/src/package/vendors/archive/index.d.ts +0 -3
  299. package/dist/src/package/vendors/archive/shared.d.ts +0 -24
  300. package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
  301. package/dist/src/package/vendors/audio/index.d.ts +0 -7
  302. package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
  303. package/dist/src/package/vendors/cad/index.d.ts +0 -8
  304. package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
  305. package/dist/src/package/vendors/drawing/index.d.ts +0 -7
  306. package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
  307. package/dist/src/package/vendors/ebook/index.d.ts +0 -7
  308. package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
  309. package/dist/src/package/vendors/eda/index.d.ts +0 -2
  310. package/dist/src/package/vendors/eda/parser.d.ts +0 -77
  311. package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
  312. package/dist/src/package/vendors/email/index.d.ts +0 -2
  313. package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
  314. package/dist/src/package/vendors/image/index.d.ts +0 -4
  315. package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
  316. package/dist/src/package/vendors/md/index.d.ts +0 -4
  317. package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
  318. package/dist/src/package/vendors/model/index.d.ts +0 -3
  319. package/dist/src/package/vendors/model/shared.d.ts +0 -1
  320. package/dist/src/package/vendors/mp4/index.d.ts +0 -4
  321. package/dist/src/package/vendors/nestedRender.d.ts +0 -10
  322. package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
  323. package/dist/src/package/vendors/ofd/index.d.ts +0 -7
  324. package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
  325. package/dist/src/package/vendors/pdf/index.d.ts +0 -2
  326. package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
  327. package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
  328. package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
  329. package/dist/src/package/vendors/pptx/index.d.ts +0 -6
  330. package/dist/src/package/vendors/pptx/options.d.ts +0 -39
  331. package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
  332. package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
  333. package/dist/src/package/vendors/renders.d.ts +0 -3
  334. package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
  335. package/dist/src/package/vendors/text/index.d.ts +0 -10
  336. package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
  337. package/dist/src/package/vendors/typst/index.d.ts +0 -8
  338. package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
  339. package/dist/src/package/vendors/umd/index.d.ts +0 -7
  340. package/dist/src/package/vendors/umd/parser.d.ts +0 -30
  341. package/dist/src/package/vendors/word/doc.d.ts +0 -5
  342. package/dist/src/package/vendors/word/docx.d.ts +0 -5
  343. package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
  344. package/dist/src/package/vendors/word/index.d.ts +0 -3
  345. package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
  346. package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
  347. package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
  348. package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
  349. package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
  350. package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
  351. package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
  352. package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
  353. package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
  354. package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
  355. package/dist/style.css +0 -1
  356. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  357. package/dist/wasm/cad/dwg-worker.js +0 -24
  358. package/dist/wasm/cad/libredwg-web.js +0 -15
  359. package/dist/wasm/cad/libredwg-web.wasm +0 -0
@@ -1,2268 +0,0 @@
1
- import { o as e, t } from "./chunk.js";
2
- import { n, t as r } from "./objectSpread2.js";
3
- import { n as i, t as a } from "./asyncToGenerator.js";
4
- import { n as o, r as s } from "./chunk-AGHRB4JF.js";
5
- import { Q as c } from "./src.js";
6
- import { t as l } from "./cytoscape.esm.js";
7
- //#region node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js
8
- var u = /* @__PURE__ */ t(((e, t) => {
9
- (function(n, r) {
10
- typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.layoutBase = r() : n.layoutBase = r();
11
- })(e, function() {
12
- return (function(e) {
13
- var t = {};
14
- function n(r) {
15
- if (t[r]) return t[r].exports;
16
- var i = t[r] = {
17
- i: r,
18
- l: !1,
19
- exports: {}
20
- };
21
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
22
- }
23
- return n.m = e, n.c = t, n.i = function(e) {
24
- return e;
25
- }, n.d = function(e, t, r) {
26
- n.o(e, t) || Object.defineProperty(e, t, {
27
- configurable: !1,
28
- enumerable: !0,
29
- get: r
30
- });
31
- }, n.n = function(e) {
32
- var t = e && e.__esModule ? function() {
33
- return e.default;
34
- } : function() {
35
- return e;
36
- };
37
- return n.d(t, "a", t), t;
38
- }, n.o = function(e, t) {
39
- return Object.prototype.hasOwnProperty.call(e, t);
40
- }, n.p = "", n(n.s = 26);
41
- })([
42
- (function(e, t, n) {
43
- function r() {}
44
- r.QUALITY = 1, r.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, r.DEFAULT_INCREMENTAL = !1, r.DEFAULT_ANIMATION_ON_LAYOUT = !0, r.DEFAULT_ANIMATION_DURING_LAYOUT = !1, r.DEFAULT_ANIMATION_PERIOD = 50, r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, r.DEFAULT_GRAPH_MARGIN = 15, r.NODE_DIMENSIONS_INCLUDE_LABELS = !1, r.SIMPLE_NODE_SIZE = 40, r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2, r.EMPTY_COMPOUND_NODE_SIZE = 40, r.MIN_EDGE_LENGTH = 1, r.WORLD_BOUNDARY = 1e6, r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3, r.WORLD_CENTER_X = 1200, r.WORLD_CENTER_Y = 900, e.exports = r;
45
- }),
46
- (function(e, t, n) {
47
- var r = n(2), i = n(8), a = n(9);
48
- function o(e, t, n) {
49
- r.call(this, n), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = n, this.bendpoints = [], this.source = e, this.target = t;
50
- }
51
- for (var s in o.prototype = Object.create(r.prototype), r) o[s] = r[s];
52
- o.prototype.getSource = function() {
53
- return this.source;
54
- }, o.prototype.getTarget = function() {
55
- return this.target;
56
- }, o.prototype.isInterGraph = function() {
57
- return this.isInterGraph;
58
- }, o.prototype.getLength = function() {
59
- return this.length;
60
- }, o.prototype.isOverlapingSourceAndTarget = function() {
61
- return this.isOverlapingSourceAndTarget;
62
- }, o.prototype.getBendpoints = function() {
63
- return this.bendpoints;
64
- }, o.prototype.getLca = function() {
65
- return this.lca;
66
- }, o.prototype.getSourceInLca = function() {
67
- return this.sourceInLca;
68
- }, o.prototype.getTargetInLca = function() {
69
- return this.targetInLca;
70
- }, o.prototype.getOtherEnd = function(e) {
71
- if (this.source === e) return this.target;
72
- if (this.target === e) return this.source;
73
- throw "Node is not incident with this edge";
74
- }, o.prototype.getOtherEndInGraph = function(e, t) {
75
- for (var n = this.getOtherEnd(e), r = t.getGraphManager().getRoot();;) {
76
- if (n.getOwner() == t) return n;
77
- if (n.getOwner() == r) break;
78
- n = n.getOwner().getParent();
79
- }
80
- return null;
81
- }, o.prototype.updateLength = function() {
82
- var e = [
83
- ,
84
- ,
85
- ,
86
- ,
87
- ];
88
- this.isOverlapingSourceAndTarget = i.getIntersection(this.target.getRect(), this.source.getRect(), e), this.isOverlapingSourceAndTarget || (this.lengthX = e[0] - e[2], this.lengthY = e[1] - e[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
89
- }, o.prototype.updateLengthSimple = function() {
90
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
91
- }, e.exports = o;
92
- }),
93
- (function(e, t, n) {
94
- function r(e) {
95
- this.vGraphObject = e;
96
- }
97
- e.exports = r;
98
- }),
99
- (function(e, t, n) {
100
- var r = n(2), i = n(10), a = n(13), o = n(0), s = n(16), c = n(4);
101
- function l(e, t, n, o) {
102
- n == null && o == null && (o = t), r.call(this, o), e.graphManager != null && (e = e.graphManager), this.estimatedSize = i.MIN_VALUE, this.inclusionTreeDepth = i.MAX_VALUE, this.vGraphObject = o, this.edges = [], this.graphManager = e, n != null && t != null ? this.rect = new a(t.x, t.y, n.width, n.height) : this.rect = new a();
103
- }
104
- for (var u in l.prototype = Object.create(r.prototype), r) l[u] = r[u];
105
- l.prototype.getEdges = function() {
106
- return this.edges;
107
- }, l.prototype.getChild = function() {
108
- return this.child;
109
- }, l.prototype.getOwner = function() {
110
- return this.owner;
111
- }, l.prototype.getWidth = function() {
112
- return this.rect.width;
113
- }, l.prototype.setWidth = function(e) {
114
- this.rect.width = e;
115
- }, l.prototype.getHeight = function() {
116
- return this.rect.height;
117
- }, l.prototype.setHeight = function(e) {
118
- this.rect.height = e;
119
- }, l.prototype.getCenterX = function() {
120
- return this.rect.x + this.rect.width / 2;
121
- }, l.prototype.getCenterY = function() {
122
- return this.rect.y + this.rect.height / 2;
123
- }, l.prototype.getCenter = function() {
124
- return new c(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
125
- }, l.prototype.getLocation = function() {
126
- return new c(this.rect.x, this.rect.y);
127
- }, l.prototype.getRect = function() {
128
- return this.rect;
129
- }, l.prototype.getDiagonal = function() {
130
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
131
- }, l.prototype.getHalfTheDiagonal = function() {
132
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
133
- }, l.prototype.setRect = function(e, t) {
134
- this.rect.x = e.x, this.rect.y = e.y, this.rect.width = t.width, this.rect.height = t.height;
135
- }, l.prototype.setCenter = function(e, t) {
136
- this.rect.x = e - this.rect.width / 2, this.rect.y = t - this.rect.height / 2;
137
- }, l.prototype.setLocation = function(e, t) {
138
- this.rect.x = e, this.rect.y = t;
139
- }, l.prototype.moveBy = function(e, t) {
140
- this.rect.x += e, this.rect.y += t;
141
- }, l.prototype.getEdgeListToNode = function(e) {
142
- var t = [], n = this;
143
- return n.edges.forEach(function(r) {
144
- if (r.target == e) {
145
- if (r.source != n) throw "Incorrect edge source!";
146
- t.push(r);
147
- }
148
- }), t;
149
- }, l.prototype.getEdgesBetween = function(e) {
150
- var t = [], n = this;
151
- return n.edges.forEach(function(r) {
152
- if (!(r.source == n || r.target == n)) throw "Incorrect edge source and/or target";
153
- (r.target == e || r.source == e) && t.push(r);
154
- }), t;
155
- }, l.prototype.getNeighborsList = function() {
156
- var e = /* @__PURE__ */ new Set(), t = this;
157
- return t.edges.forEach(function(n) {
158
- if (n.source == t) e.add(n.target);
159
- else {
160
- if (n.target != t) throw "Incorrect incidency!";
161
- e.add(n.source);
162
- }
163
- }), e;
164
- }, l.prototype.withChildren = function() {
165
- var e = /* @__PURE__ */ new Set(), t, n;
166
- if (e.add(this), this.child != null) for (var r = this.child.getNodes(), i = 0; i < r.length; i++) t = r[i], n = t.withChildren(), n.forEach(function(t) {
167
- e.add(t);
168
- });
169
- return e;
170
- }, l.prototype.getNoOfChildren = function() {
171
- var e = 0, t;
172
- if (this.child == null) e = 1;
173
- else for (var n = this.child.getNodes(), r = 0; r < n.length; r++) t = n[r], e += t.getNoOfChildren();
174
- return e == 0 && (e = 1), e;
175
- }, l.prototype.getEstimatedSize = function() {
176
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
177
- return this.estimatedSize;
178
- }, l.prototype.calcEstimatedSize = function() {
179
- return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
180
- }, l.prototype.scatter = function() {
181
- var e, t, n = -o.INITIAL_WORLD_BOUNDARY, r = o.INITIAL_WORLD_BOUNDARY;
182
- e = o.WORLD_CENTER_X + s.nextDouble() * (r - n) + n;
183
- var i = -o.INITIAL_WORLD_BOUNDARY, a = o.INITIAL_WORLD_BOUNDARY;
184
- t = o.WORLD_CENTER_Y + s.nextDouble() * (a - i) + i, this.rect.x = e, this.rect.y = t;
185
- }, l.prototype.updateBounds = function() {
186
- if (this.getChild() == null) throw "assert failed";
187
- if (this.getChild().getNodes().length != 0) {
188
- var e = this.getChild();
189
- if (e.updateBounds(!0), this.rect.x = e.getLeft(), this.rect.y = e.getTop(), this.setWidth(e.getRight() - e.getLeft()), this.setHeight(e.getBottom() - e.getTop()), o.NODE_DIMENSIONS_INCLUDE_LABELS) {
190
- var t = e.getRight() - e.getLeft(), n = e.getBottom() - e.getTop();
191
- this.labelWidth > t && (this.rect.x -= (this.labelWidth - t) / 2, this.setWidth(this.labelWidth)), this.labelHeight > n && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - n) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - n), this.setHeight(this.labelHeight));
192
- }
193
- }
194
- }, l.prototype.getInclusionTreeDepth = function() {
195
- if (this.inclusionTreeDepth == i.MAX_VALUE) throw "assert failed";
196
- return this.inclusionTreeDepth;
197
- }, l.prototype.transform = function(e) {
198
- var t = this.rect.x;
199
- t > o.WORLD_BOUNDARY ? t = o.WORLD_BOUNDARY : t < -o.WORLD_BOUNDARY && (t = -o.WORLD_BOUNDARY);
200
- var n = this.rect.y;
201
- n > o.WORLD_BOUNDARY ? n = o.WORLD_BOUNDARY : n < -o.WORLD_BOUNDARY && (n = -o.WORLD_BOUNDARY);
202
- var r = new c(t, n), i = e.inverseTransformPoint(r);
203
- this.setLocation(i.x, i.y);
204
- }, l.prototype.getLeft = function() {
205
- return this.rect.x;
206
- }, l.prototype.getRight = function() {
207
- return this.rect.x + this.rect.width;
208
- }, l.prototype.getTop = function() {
209
- return this.rect.y;
210
- }, l.prototype.getBottom = function() {
211
- return this.rect.y + this.rect.height;
212
- }, l.prototype.getParent = function() {
213
- return this.owner == null ? null : this.owner.getParent();
214
- }, e.exports = l;
215
- }),
216
- (function(e, t, n) {
217
- function r(e, t) {
218
- e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
219
- }
220
- r.prototype.getX = function() {
221
- return this.x;
222
- }, r.prototype.getY = function() {
223
- return this.y;
224
- }, r.prototype.setX = function(e) {
225
- this.x = e;
226
- }, r.prototype.setY = function(e) {
227
- this.y = e;
228
- }, r.prototype.getDifference = function(e) {
229
- return new DimensionD(this.x - e.x, this.y - e.y);
230
- }, r.prototype.getCopy = function() {
231
- return new r(this.x, this.y);
232
- }, r.prototype.translate = function(e) {
233
- return this.x += e.width, this.y += e.height, this;
234
- }, e.exports = r;
235
- }),
236
- (function(e, t, n) {
237
- var r = n(2), i = n(10), a = n(0), o = n(6), s = n(3), c = n(1), l = n(13), u = n(12), d = n(11);
238
- function f(e, t, n) {
239
- r.call(this, n), this.estimatedSize = i.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = e, t != null && t instanceof o ? this.graphManager = t : t != null && t instanceof Layout && (this.graphManager = t.graphManager);
240
- }
241
- for (var p in f.prototype = Object.create(r.prototype), r) f[p] = r[p];
242
- f.prototype.getNodes = function() {
243
- return this.nodes;
244
- }, f.prototype.getEdges = function() {
245
- return this.edges;
246
- }, f.prototype.getGraphManager = function() {
247
- return this.graphManager;
248
- }, f.prototype.getParent = function() {
249
- return this.parent;
250
- }, f.prototype.getLeft = function() {
251
- return this.left;
252
- }, f.prototype.getRight = function() {
253
- return this.right;
254
- }, f.prototype.getTop = function() {
255
- return this.top;
256
- }, f.prototype.getBottom = function() {
257
- return this.bottom;
258
- }, f.prototype.isConnected = function() {
259
- return this.isConnected;
260
- }, f.prototype.add = function(e, t, n) {
261
- if (t == null && n == null) {
262
- var r = e;
263
- if (this.graphManager == null) throw "Graph has no graph mgr!";
264
- if (this.getNodes().indexOf(r) > -1) throw "Node already in graph!";
265
- return r.owner = this, this.getNodes().push(r), r;
266
- } else {
267
- var i = e;
268
- if (!(this.getNodes().indexOf(t) > -1 && this.getNodes().indexOf(n) > -1)) throw "Source or target not in graph!";
269
- if (!(t.owner == n.owner && t.owner == this)) throw "Both owners must be this graph!";
270
- return t.owner == n.owner ? (i.source = t, i.target = n, i.isInterGraph = !1, this.getEdges().push(i), t.edges.push(i), n != t && n.edges.push(i), i) : null;
271
- }
272
- }, f.prototype.remove = function(e) {
273
- var t = e;
274
- if (e instanceof s) {
275
- if (t == null) throw "Node is null!";
276
- if (!(t.owner != null && t.owner == this)) throw "Owner graph is invalid!";
277
- if (this.graphManager == null) throw "Owner graph manager is invalid!";
278
- for (var n = t.edges.slice(), r, i = n.length, a = 0; a < i; a++) r = n[a], r.isInterGraph ? this.graphManager.remove(r) : r.source.owner.remove(r);
279
- var o = this.nodes.indexOf(t);
280
- if (o == -1) throw "Node not in owner node list!";
281
- this.nodes.splice(o, 1);
282
- } else if (e instanceof c) {
283
- var r = e;
284
- if (r == null) throw "Edge is null!";
285
- if (!(r.source != null && r.target != null)) throw "Source and/or target is null!";
286
- if (!(r.source.owner != null && r.target.owner != null && r.source.owner == this && r.target.owner == this)) throw "Source and/or target owner is invalid!";
287
- var l = r.source.edges.indexOf(r), u = r.target.edges.indexOf(r);
288
- if (!(l > -1 && u > -1)) throw "Source and/or target doesn't know this edge!";
289
- r.source.edges.splice(l, 1), r.target != r.source && r.target.edges.splice(u, 1);
290
- var o = r.source.owner.getEdges().indexOf(r);
291
- if (o == -1) throw "Not in owner's edge list!";
292
- r.source.owner.getEdges().splice(o, 1);
293
- }
294
- }, f.prototype.updateLeftTop = function() {
295
- for (var e = i.MAX_VALUE, t = i.MAX_VALUE, n, r, a, o = this.getNodes(), s = o.length, c = 0; c < s; c++) {
296
- var l = o[c];
297
- n = l.getTop(), r = l.getLeft(), e > n && (e = n), t > r && (t = r);
298
- }
299
- return e == i.MAX_VALUE ? null : (a = o[0].getParent().paddingLeft == null ? this.margin : o[0].getParent().paddingLeft, this.left = t - a, this.top = e - a, new u(this.left, this.top));
300
- }, f.prototype.updateBounds = function(e) {
301
- for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d, f = this.nodes, p = f.length, m = 0; m < p; m++) {
302
- var h = f[m];
303
- e && h.child != null && h.updateBounds(), o = h.getLeft(), s = h.getRight(), c = h.getTop(), u = h.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
304
- }
305
- var g = new l(t, r, n - t, a - r);
306
- t == i.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), d = f[0].getParent().paddingLeft == null ? this.margin : f[0].getParent().paddingLeft, this.left = g.x - d, this.right = g.x + g.width + d, this.top = g.y - d, this.bottom = g.y + g.height + d;
307
- }, f.calculateBounds = function(e) {
308
- for (var t = i.MAX_VALUE, n = -i.MAX_VALUE, r = i.MAX_VALUE, a = -i.MAX_VALUE, o, s, c, u, d = e.length, f = 0; f < d; f++) {
309
- var p = e[f];
310
- o = p.getLeft(), s = p.getRight(), c = p.getTop(), u = p.getBottom(), t > o && (t = o), n < s && (n = s), r > c && (r = c), a < u && (a = u);
311
- }
312
- return new l(t, r, n - t, a - r);
313
- }, f.prototype.getInclusionTreeDepth = function() {
314
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
315
- }, f.prototype.getEstimatedSize = function() {
316
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
317
- return this.estimatedSize;
318
- }, f.prototype.calcEstimatedSize = function() {
319
- for (var e = 0, t = this.nodes, n = t.length, r = 0; r < n; r++) {
320
- var i = t[r];
321
- e += i.calcEstimatedSize();
322
- }
323
- return e == 0 ? this.estimatedSize = a.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = e / Math.sqrt(this.nodes.length), this.estimatedSize;
324
- }, f.prototype.updateConnected = function() {
325
- var e = this;
326
- if (this.nodes.length == 0) {
327
- this.isConnected = !0;
328
- return;
329
- }
330
- var t = new d(), n = /* @__PURE__ */ new Set(), r = this.nodes[0], i, a;
331
- for (r.withChildren().forEach(function(e) {
332
- t.push(e), n.add(e);
333
- }); t.length !== 0;) {
334
- r = t.shift(), i = r.getEdges();
335
- for (var o = i.length, s = 0; s < o; s++) a = i[s].getOtherEndInGraph(r, this), a != null && !n.has(a) && a.withChildren().forEach(function(e) {
336
- t.push(e), n.add(e);
337
- });
338
- }
339
- if (this.isConnected = !1, n.size >= this.nodes.length) {
340
- var c = 0;
341
- n.forEach(function(t) {
342
- t.owner == e && c++;
343
- }), c == this.nodes.length && (this.isConnected = !0);
344
- }
345
- }, e.exports = f;
346
- }),
347
- (function(e, t, n) {
348
- var r, i = n(1);
349
- function a(e) {
350
- r = n(5), this.layout = e, this.graphs = [], this.edges = [];
351
- }
352
- a.prototype.addRoot = function() {
353
- var e = this.layout.newGraph(), t = this.layout.newNode(null), n = this.add(e, t);
354
- return this.setRootGraph(n), this.rootGraph;
355
- }, a.prototype.add = function(e, t, n, r, i) {
356
- if (n == null && r == null && i == null) {
357
- if (e == null) throw "Graph is null!";
358
- if (t == null) throw "Parent node is null!";
359
- if (this.graphs.indexOf(e) > -1) throw "Graph already in this graph mgr!";
360
- if (this.graphs.push(e), e.parent != null) throw "Already has a parent!";
361
- if (t.child != null) throw "Already has a child!";
362
- return e.parent = t, t.child = e, e;
363
- } else {
364
- i = n, r = t, n = e;
365
- var a = r.getOwner(), o = i.getOwner();
366
- if (!(a != null && a.getGraphManager() == this)) throw "Source not in this graph mgr!";
367
- if (!(o != null && o.getGraphManager() == this)) throw "Target not in this graph mgr!";
368
- if (a == o) return n.isInterGraph = !1, a.add(n, r, i);
369
- if (n.isInterGraph = !0, n.source = r, n.target = i, this.edges.indexOf(n) > -1) throw "Edge already in inter-graph edge list!";
370
- if (this.edges.push(n), !(n.source != null && n.target != null)) throw "Edge source and/or target is null!";
371
- if (!(n.source.edges.indexOf(n) == -1 && n.target.edges.indexOf(n) == -1)) throw "Edge already in source and/or target incidency list!";
372
- return n.source.edges.push(n), n.target.edges.push(n), n;
373
- }
374
- }, a.prototype.remove = function(e) {
375
- if (e instanceof r) {
376
- var t = e;
377
- if (t.getGraphManager() != this) throw "Graph not in this graph mgr";
378
- if (!(t == this.rootGraph || t.parent != null && t.parent.graphManager == this)) throw "Invalid parent node!";
379
- var n = [];
380
- n = n.concat(t.getEdges());
381
- for (var a, o = n.length, s = 0; s < o; s++) a = n[s], t.remove(a);
382
- var c = [];
383
- c = c.concat(t.getNodes());
384
- var l;
385
- o = c.length;
386
- for (var s = 0; s < o; s++) l = c[s], t.remove(l);
387
- t == this.rootGraph && this.setRootGraph(null);
388
- var u = this.graphs.indexOf(t);
389
- this.graphs.splice(u, 1), t.parent = null;
390
- } else if (e instanceof i) {
391
- if (a = e, a == null) throw "Edge is null!";
392
- if (!a.isInterGraph) throw "Not an inter-graph edge!";
393
- if (!(a.source != null && a.target != null)) throw "Source and/or target is null!";
394
- if (!(a.source.edges.indexOf(a) != -1 && a.target.edges.indexOf(a) != -1)) throw "Source and/or target doesn't know this edge!";
395
- var u = a.source.edges.indexOf(a);
396
- if (a.source.edges.splice(u, 1), u = a.target.edges.indexOf(a), a.target.edges.splice(u, 1), !(a.source.owner != null && a.source.owner.getGraphManager() != null)) throw "Edge owner graph or owner graph manager is null!";
397
- if (a.source.owner.getGraphManager().edges.indexOf(a) == -1) throw "Not in owner graph manager's edge list!";
398
- var u = a.source.owner.getGraphManager().edges.indexOf(a);
399
- a.source.owner.getGraphManager().edges.splice(u, 1);
400
- }
401
- }, a.prototype.updateBounds = function() {
402
- this.rootGraph.updateBounds(!0);
403
- }, a.prototype.getGraphs = function() {
404
- return this.graphs;
405
- }, a.prototype.getAllNodes = function() {
406
- if (this.allNodes == null) {
407
- for (var e = [], t = this.getGraphs(), n = t.length, r = 0; r < n; r++) e = e.concat(t[r].getNodes());
408
- this.allNodes = e;
409
- }
410
- return this.allNodes;
411
- }, a.prototype.resetAllNodes = function() {
412
- this.allNodes = null;
413
- }, a.prototype.resetAllEdges = function() {
414
- this.allEdges = null;
415
- }, a.prototype.resetAllNodesToApplyGravitation = function() {
416
- this.allNodesToApplyGravitation = null;
417
- }, a.prototype.getAllEdges = function() {
418
- if (this.allEdges == null) {
419
- var e = [], t = this.getGraphs();
420
- t.length;
421
- for (var n = 0; n < t.length; n++) e = e.concat(t[n].getEdges());
422
- e = e.concat(this.edges), this.allEdges = e;
423
- }
424
- return this.allEdges;
425
- }, a.prototype.getAllNodesToApplyGravitation = function() {
426
- return this.allNodesToApplyGravitation;
427
- }, a.prototype.setAllNodesToApplyGravitation = function(e) {
428
- if (this.allNodesToApplyGravitation != null) throw "assert failed";
429
- this.allNodesToApplyGravitation = e;
430
- }, a.prototype.getRoot = function() {
431
- return this.rootGraph;
432
- }, a.prototype.setRootGraph = function(e) {
433
- if (e.getGraphManager() != this) throw "Root not in this graph mgr!";
434
- this.rootGraph = e, e.parent == null && (e.parent = this.layout.newNode("Root node"));
435
- }, a.prototype.getLayout = function() {
436
- return this.layout;
437
- }, a.prototype.isOneAncestorOfOther = function(e, t) {
438
- if (!(e != null && t != null)) throw "assert failed";
439
- if (e == t) return !0;
440
- var n = e.getOwner(), r;
441
- do {
442
- if (r = n.getParent(), r == null) break;
443
- if (r == t) return !0;
444
- if (n = r.getOwner(), n == null) break;
445
- } while (!0);
446
- n = t.getOwner();
447
- do {
448
- if (r = n.getParent(), r == null) break;
449
- if (r == e) return !0;
450
- if (n = r.getOwner(), n == null) break;
451
- } while (!0);
452
- return !1;
453
- }, a.prototype.calcLowestCommonAncestors = function() {
454
- for (var e, t, n, r, i, a = this.getAllEdges(), o = a.length, s = 0; s < o; s++) {
455
- if (e = a[s], t = e.source, n = e.target, e.lca = null, e.sourceInLca = t, e.targetInLca = n, t == n) {
456
- e.lca = t.getOwner();
457
- continue;
458
- }
459
- for (r = t.getOwner(); e.lca == null;) {
460
- for (e.targetInLca = n, i = n.getOwner(); e.lca == null;) {
461
- if (i == r) {
462
- e.lca = i;
463
- break;
464
- }
465
- if (i == this.rootGraph) break;
466
- if (e.lca != null) throw "assert failed";
467
- e.targetInLca = i.getParent(), i = e.targetInLca.getOwner();
468
- }
469
- if (r == this.rootGraph) break;
470
- e.lca == null && (e.sourceInLca = r.getParent(), r = e.sourceInLca.getOwner());
471
- }
472
- if (e.lca == null) throw "assert failed";
473
- }
474
- }, a.prototype.calcLowestCommonAncestor = function(e, t) {
475
- if (e == t) return e.getOwner();
476
- var n = e.getOwner();
477
- do {
478
- if (n == null) break;
479
- var r = t.getOwner();
480
- do {
481
- if (r == null) break;
482
- if (r == n) return r;
483
- r = r.getParent().getOwner();
484
- } while (!0);
485
- n = n.getParent().getOwner();
486
- } while (!0);
487
- return n;
488
- }, a.prototype.calcInclusionTreeDepths = function(e, t) {
489
- e == null && t == null && (e = this.rootGraph, t = 1);
490
- for (var n, r = e.getNodes(), i = r.length, a = 0; a < i; a++) n = r[a], n.inclusionTreeDepth = t, n.child != null && this.calcInclusionTreeDepths(n.child, t + 1);
491
- }, a.prototype.includesInvalidEdge = function() {
492
- for (var e, t = this.edges.length, n = 0; n < t; n++) if (e = this.edges[n], this.isOneAncestorOfOther(e.source, e.target)) return !0;
493
- return !1;
494
- }, e.exports = a;
495
- }),
496
- (function(e, t, n) {
497
- var r = n(0);
498
- function i() {}
499
- for (var a in r) i[a] = r[a];
500
- i.MAX_ITERATIONS = 2500, i.DEFAULT_EDGE_LENGTH = 50, i.DEFAULT_SPRING_STRENGTH = .45, i.DEFAULT_REPULSION_STRENGTH = 4500, i.DEFAULT_GRAVITY_STRENGTH = .4, i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, i.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, i.DEFAULT_COOLING_FACTOR_INCREMENTAL = .3, i.COOLING_ADAPTATION_FACTOR = .33, i.ADAPTATION_LOWER_NODE_LIMIT = 1e3, i.ADAPTATION_UPPER_NODE_LIMIT = 5e3, i.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, i.MAX_NODE_DISPLACEMENT = i.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, i.MIN_REPULSION_DIST = i.DEFAULT_EDGE_LENGTH / 10, i.CONVERGENCE_CHECK_PERIOD = 100, i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = .1, i.MIN_EDGE_LENGTH = 1, i.GRID_CALCULATION_CHECK_PERIOD = 10, e.exports = i;
501
- }),
502
- (function(e, t, n) {
503
- var r = n(12);
504
- function i() {}
505
- i.calcSeparationAmount = function(e, t, n, r) {
506
- if (!e.intersects(t)) throw "assert failed";
507
- var i = [, ,];
508
- this.decideDirectionsForOverlappingNodes(e, t, i), n[0] = Math.min(e.getRight(), t.getRight()) - Math.max(e.x, t.x), n[1] = Math.min(e.getBottom(), t.getBottom()) - Math.max(e.y, t.y), e.getX() <= t.getX() && e.getRight() >= t.getRight() ? n[0] += Math.min(t.getX() - e.getX(), e.getRight() - t.getRight()) : t.getX() <= e.getX() && t.getRight() >= e.getRight() && (n[0] += Math.min(e.getX() - t.getX(), t.getRight() - e.getRight())), e.getY() <= t.getY() && e.getBottom() >= t.getBottom() ? n[1] += Math.min(t.getY() - e.getY(), e.getBottom() - t.getBottom()) : t.getY() <= e.getY() && t.getBottom() >= e.getBottom() && (n[1] += Math.min(e.getY() - t.getY(), t.getBottom() - e.getBottom()));
509
- var a = Math.abs((t.getCenterY() - e.getCenterY()) / (t.getCenterX() - e.getCenterX()));
510
- t.getCenterY() === e.getCenterY() && t.getCenterX() === e.getCenterX() && (a = 1);
511
- var o = a * n[0], s = n[1] / a;
512
- n[0] < s ? s = n[0] : o = n[1], n[0] = -1 * i[0] * (s / 2 + r), n[1] = -1 * i[1] * (o / 2 + r);
513
- }, i.decideDirectionsForOverlappingNodes = function(e, t, n) {
514
- e.getCenterX() < t.getCenterX() ? n[0] = -1 : n[0] = 1, e.getCenterY() < t.getCenterY() ? n[1] = -1 : n[1] = 1;
515
- }, i.getIntersection2 = function(e, t, n) {
516
- var r = e.getCenterX(), i = e.getCenterY(), a = t.getCenterX(), o = t.getCenterY();
517
- if (e.intersects(t)) return n[0] = r, n[1] = i, n[2] = a, n[3] = o, !0;
518
- var s = e.getX(), c = e.getY(), l = e.getRight(), u = e.getX(), d = e.getBottom(), f = e.getRight(), p = e.getWidthHalf(), m = e.getHeightHalf(), h = t.getX(), g = t.getY(), _ = t.getRight(), v = t.getX(), y = t.getBottom(), b = t.getRight(), x = t.getWidthHalf(), S = t.getHeightHalf(), C = !1, w = !1;
519
- if (r === a) {
520
- if (i > o) return n[0] = r, n[1] = c, n[2] = a, n[3] = y, !1;
521
- if (i < o) return n[0] = r, n[1] = d, n[2] = a, n[3] = g, !1;
522
- } else if (i === o) {
523
- if (r > a) return n[0] = s, n[1] = i, n[2] = _, n[3] = o, !1;
524
- if (r < a) return n[0] = l, n[1] = i, n[2] = h, n[3] = o, !1;
525
- } else {
526
- var T = e.height / e.width, E = t.height / t.width, D = (o - i) / (a - r), O = void 0, k = void 0, A = void 0, j = void 0, M = void 0, N = void 0;
527
- if (-T === D ? r > a ? (n[0] = u, n[1] = d, C = !0) : (n[0] = l, n[1] = c, C = !0) : T === D && (r > a ? (n[0] = s, n[1] = c, C = !0) : (n[0] = f, n[1] = d, C = !0)), -E === D ? a > r ? (n[2] = v, n[3] = y, w = !0) : (n[2] = _, n[3] = g, w = !0) : E === D && (a > r ? (n[2] = h, n[3] = g, w = !0) : (n[2] = b, n[3] = y, w = !0)), C && w) return !1;
528
- if (r > a ? i > o ? (O = this.getCardinalDirection(T, D, 4), k = this.getCardinalDirection(E, D, 2)) : (O = this.getCardinalDirection(-T, D, 3), k = this.getCardinalDirection(-E, D, 1)) : i > o ? (O = this.getCardinalDirection(-T, D, 1), k = this.getCardinalDirection(-E, D, 3)) : (O = this.getCardinalDirection(T, D, 2), k = this.getCardinalDirection(E, D, 4)), !C) switch (O) {
529
- case 1:
530
- j = c, A = r + -m / D, n[0] = A, n[1] = j;
531
- break;
532
- case 2:
533
- A = f, j = i + p * D, n[0] = A, n[1] = j;
534
- break;
535
- case 3:
536
- j = d, A = r + m / D, n[0] = A, n[1] = j;
537
- break;
538
- case 4:
539
- A = u, j = i + -p * D, n[0] = A, n[1] = j;
540
- break;
541
- }
542
- if (!w) switch (k) {
543
- case 1:
544
- N = g, M = a + -S / D, n[2] = M, n[3] = N;
545
- break;
546
- case 2:
547
- M = b, N = o + x * D, n[2] = M, n[3] = N;
548
- break;
549
- case 3:
550
- N = y, M = a + S / D, n[2] = M, n[3] = N;
551
- break;
552
- case 4:
553
- M = v, N = o + -x * D, n[2] = M, n[3] = N;
554
- break;
555
- }
556
- }
557
- return !1;
558
- }, i.getCardinalDirection = function(e, t, n) {
559
- return e > t ? n : 1 + n % 4;
560
- }, i.getIntersection = function(e, t, n, i) {
561
- if (i == null) return this.getIntersection2(e, t, n);
562
- var a = e.x, o = e.y, s = t.x, c = t.y, l = n.x, u = n.y, d = i.x, f = i.y, p = void 0, m = void 0, h = void 0, g = void 0, _ = void 0, v = void 0, y = void 0, b = void 0, x = void 0;
563
- return h = c - o, _ = a - s, y = s * o - a * c, g = f - u, v = l - d, b = d * u - l * f, x = h * v - g * _, x === 0 ? null : (p = (_ * b - v * y) / x, m = (g * y - h * b) / x, new r(p, m));
564
- }, i.angleOfVector = function(e, t, n, r) {
565
- var i = void 0;
566
- return e === n ? i = r < t ? this.ONE_AND_HALF_PI : this.HALF_PI : (i = Math.atan((r - t) / (n - e)), n < e ? i += Math.PI : r < t && (i += this.TWO_PI)), i;
567
- }, i.doIntersect = function(e, t, n, r) {
568
- var i = e.x, a = e.y, o = t.x, s = t.y, c = n.x, l = n.y, u = r.x, d = r.y, f = (o - i) * (d - l) - (u - c) * (s - a);
569
- if (f === 0) return !1;
570
- var p = ((d - l) * (u - i) + (c - u) * (d - a)) / f, m = ((a - s) * (u - i) + (o - i) * (d - a)) / f;
571
- return 0 < p && p < 1 && 0 < m && m < 1;
572
- }, i.HALF_PI = .5 * Math.PI, i.ONE_AND_HALF_PI = 1.5 * Math.PI, i.TWO_PI = 2 * Math.PI, i.THREE_PI = 3 * Math.PI, e.exports = i;
573
- }),
574
- (function(e, t, n) {
575
- function r() {}
576
- r.sign = function(e) {
577
- return e > 0 ? 1 : e < 0 ? -1 : 0;
578
- }, r.floor = function(e) {
579
- return e < 0 ? Math.ceil(e) : Math.floor(e);
580
- }, r.ceil = function(e) {
581
- return e < 0 ? Math.floor(e) : Math.ceil(e);
582
- }, e.exports = r;
583
- }),
584
- (function(e, t, n) {
585
- function r() {}
586
- r.MAX_VALUE = 2147483647, r.MIN_VALUE = -2147483648, e.exports = r;
587
- }),
588
- (function(e, t, n) {
589
- var r = function() {
590
- function e(e, t) {
591
- for (var n = 0; n < t.length; n++) {
592
- var r = t[n];
593
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
594
- }
595
- }
596
- return function(t, n, r) {
597
- return n && e(t.prototype, n), r && e(t, r), t;
598
- };
599
- }();
600
- function i(e, t) {
601
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
602
- }
603
- var a = function(e) {
604
- return {
605
- value: e,
606
- next: null,
607
- prev: null
608
- };
609
- }, o = function(e, t, n, r) {
610
- return e === null ? r.head = t : e.next = t, n === null ? r.tail = t : n.prev = t, t.prev = e, t.next = n, r.length++, t;
611
- }, s = function(e, t) {
612
- var n = e.prev, r = e.next;
613
- return n === null ? t.head = r : n.next = r, r === null ? t.tail = n : r.prev = n, e.prev = e.next = null, t.length--, e;
614
- };
615
- e.exports = function() {
616
- function e(t) {
617
- var n = this;
618
- i(this, e), this.length = 0, this.head = null, this.tail = null, t != null && t.forEach(function(e) {
619
- return n.push(e);
620
- });
621
- }
622
- return r(e, [
623
- {
624
- key: "size",
625
- value: function() {
626
- return this.length;
627
- }
628
- },
629
- {
630
- key: "insertBefore",
631
- value: function(e, t) {
632
- return o(t.prev, a(e), t, this);
633
- }
634
- },
635
- {
636
- key: "insertAfter",
637
- value: function(e, t) {
638
- return o(t, a(e), t.next, this);
639
- }
640
- },
641
- {
642
- key: "insertNodeBefore",
643
- value: function(e, t) {
644
- return o(t.prev, e, t, this);
645
- }
646
- },
647
- {
648
- key: "insertNodeAfter",
649
- value: function(e, t) {
650
- return o(t, e, t.next, this);
651
- }
652
- },
653
- {
654
- key: "push",
655
- value: function(e) {
656
- return o(this.tail, a(e), null, this);
657
- }
658
- },
659
- {
660
- key: "unshift",
661
- value: function(e) {
662
- return o(null, a(e), this.head, this);
663
- }
664
- },
665
- {
666
- key: "remove",
667
- value: function(e) {
668
- return s(e, this);
669
- }
670
- },
671
- {
672
- key: "pop",
673
- value: function() {
674
- return s(this.tail, this).value;
675
- }
676
- },
677
- {
678
- key: "popNode",
679
- value: function() {
680
- return s(this.tail, this);
681
- }
682
- },
683
- {
684
- key: "shift",
685
- value: function() {
686
- return s(this.head, this).value;
687
- }
688
- },
689
- {
690
- key: "shiftNode",
691
- value: function() {
692
- return s(this.head, this);
693
- }
694
- },
695
- {
696
- key: "get_object_at",
697
- value: function(e) {
698
- if (e <= this.length()) {
699
- for (var t = 1, n = this.head; t < e;) n = n.next, t++;
700
- return n.value;
701
- }
702
- }
703
- },
704
- {
705
- key: "set_object_at",
706
- value: function(e, t) {
707
- if (e <= this.length()) {
708
- for (var n = 1, r = this.head; n < e;) r = r.next, n++;
709
- r.value = t;
710
- }
711
- }
712
- }
713
- ]), e;
714
- }();
715
- }),
716
- (function(e, t, n) {
717
- function r(e, t, n) {
718
- this.x = null, this.y = null, e == null && t == null && n == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && n == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && n == null && (n = e, this.x = n.x, this.y = n.y);
719
- }
720
- r.prototype.getX = function() {
721
- return this.x;
722
- }, r.prototype.getY = function() {
723
- return this.y;
724
- }, r.prototype.getLocation = function() {
725
- return new r(this.x, this.y);
726
- }, r.prototype.setLocation = function(e, t, n) {
727
- e.constructor.name == "Point" && t == null && n == null ? (n = e, this.setLocation(n.x, n.y)) : typeof e == "number" && typeof t == "number" && n == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + .5), this.y = Math.floor(t + .5)));
728
- }, r.prototype.move = function(e, t) {
729
- this.x = e, this.y = t;
730
- }, r.prototype.translate = function(e, t) {
731
- this.x += e, this.y += t;
732
- }, r.prototype.equals = function(e) {
733
- if (e.constructor.name == "Point") {
734
- var t = e;
735
- return this.x == t.x && this.y == t.y;
736
- }
737
- return this == e;
738
- }, r.prototype.toString = function() {
739
- return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
740
- }, e.exports = r;
741
- }),
742
- (function(e, t, n) {
743
- function r(e, t, n, r) {
744
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && n != null && r != null && (this.x = e, this.y = t, this.width = n, this.height = r);
745
- }
746
- r.prototype.getX = function() {
747
- return this.x;
748
- }, r.prototype.setX = function(e) {
749
- this.x = e;
750
- }, r.prototype.getY = function() {
751
- return this.y;
752
- }, r.prototype.setY = function(e) {
753
- this.y = e;
754
- }, r.prototype.getWidth = function() {
755
- return this.width;
756
- }, r.prototype.setWidth = function(e) {
757
- this.width = e;
758
- }, r.prototype.getHeight = function() {
759
- return this.height;
760
- }, r.prototype.setHeight = function(e) {
761
- this.height = e;
762
- }, r.prototype.getRight = function() {
763
- return this.x + this.width;
764
- }, r.prototype.getBottom = function() {
765
- return this.y + this.height;
766
- }, r.prototype.intersects = function(e) {
767
- return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
768
- }, r.prototype.getCenterX = function() {
769
- return this.x + this.width / 2;
770
- }, r.prototype.getMinX = function() {
771
- return this.getX();
772
- }, r.prototype.getMaxX = function() {
773
- return this.getX() + this.width;
774
- }, r.prototype.getCenterY = function() {
775
- return this.y + this.height / 2;
776
- }, r.prototype.getMinY = function() {
777
- return this.getY();
778
- }, r.prototype.getMaxY = function() {
779
- return this.getY() + this.height;
780
- }, r.prototype.getWidthHalf = function() {
781
- return this.width / 2;
782
- }, r.prototype.getHeightHalf = function() {
783
- return this.height / 2;
784
- }, e.exports = r;
785
- }),
786
- (function(e, t, n) {
787
- var r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
788
- return typeof e;
789
- } : function(e) {
790
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
791
- };
792
- function i() {}
793
- i.lastID = 0, i.createID = function(e) {
794
- return i.isPrimitive(e) ? e : e.uniqueID == null ? (e.uniqueID = i.getString(), i.lastID++, e.uniqueID) : e.uniqueID;
795
- }, i.getString = function(e) {
796
- return e == null && (e = i.lastID), "Object#" + e;
797
- }, i.isPrimitive = function(e) {
798
- var t = e === void 0 ? "undefined" : r(e);
799
- return e == null || t != "object" && t != "function";
800
- }, e.exports = i;
801
- }),
802
- (function(e, t, n) {
803
- function r(e) {
804
- if (Array.isArray(e)) {
805
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
806
- return n;
807
- } else return Array.from(e);
808
- }
809
- var i = n(0), a = n(6), o = n(3), s = n(1), c = n(5), l = n(4), u = n(17), d = n(27);
810
- function f(e) {
811
- d.call(this), this.layoutQuality = i.QUALITY, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = i.DEFAULT_INCREMENTAL, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, e != null && (this.isRemoteUse = e);
812
- }
813
- f.RANDOM_SEED = 1, f.prototype = Object.create(d.prototype), f.prototype.getGraphManager = function() {
814
- return this.graphManager;
815
- }, f.prototype.getAllNodes = function() {
816
- return this.graphManager.getAllNodes();
817
- }, f.prototype.getAllEdges = function() {
818
- return this.graphManager.getAllEdges();
819
- }, f.prototype.getAllNodesToApplyGravitation = function() {
820
- return this.graphManager.getAllNodesToApplyGravitation();
821
- }, f.prototype.newGraphManager = function() {
822
- var e = new a(this);
823
- return this.graphManager = e, e;
824
- }, f.prototype.newGraph = function(e) {
825
- return new c(null, this.graphManager, e);
826
- }, f.prototype.newNode = function(e) {
827
- return new o(this.graphManager, e);
828
- }, f.prototype.newEdge = function(e) {
829
- return new s(null, null, e);
830
- }, f.prototype.checkLayoutSuccess = function() {
831
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
832
- }, f.prototype.runLayout = function() {
833
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
834
- var e = this.checkLayoutSuccess() ? !1 : this.layout();
835
- return i.ANIMATE === "during" ? !1 : (e && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, e);
836
- }, f.prototype.doPostLayout = function() {
837
- this.incremental || this.transform(), this.update();
838
- }, f.prototype.update2 = function() {
839
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
840
- for (var e = this.graphManager.getAllEdges(), t = 0; t < e.length; t++) e[t];
841
- for (var n = this.graphManager.getRoot().getNodes(), t = 0; t < n.length; t++) n[t];
842
- this.update(this.graphManager.getRoot());
843
- }
844
- }, f.prototype.update = function(e) {
845
- if (e == null) this.update2();
846
- else if (e instanceof o) {
847
- var t = e;
848
- if (t.getChild() != null) for (var n = t.getChild().getNodes(), r = 0; r < n.length; r++) update(n[r]);
849
- t.vGraphObject != null && t.vGraphObject.update(t);
850
- } else if (e instanceof s) {
851
- var i = e;
852
- i.vGraphObject != null && i.vGraphObject.update(i);
853
- } else if (e instanceof c) {
854
- var a = e;
855
- a.vGraphObject != null && a.vGraphObject.update(a);
856
- }
857
- }, f.prototype.initParameters = function() {
858
- this.isSubLayout || (this.layoutQuality = i.QUALITY, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = i.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
859
- }, f.prototype.transform = function(e) {
860
- if (e == null) this.transform(new l(0, 0));
861
- else {
862
- var t = new u(), n = this.graphManager.getRoot().updateLeftTop();
863
- if (n != null) {
864
- t.setWorldOrgX(e.x), t.setWorldOrgY(e.y), t.setDeviceOrgX(n.x), t.setDeviceOrgY(n.y);
865
- for (var r = this.getAllNodes(), i, a = 0; a < r.length; a++) i = r[a], i.transform(t);
866
- }
867
- }
868
- }, f.prototype.positionNodesRandomly = function(e) {
869
- if (e == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
870
- else for (var t, n, r = e.getNodes(), i = 0; i < r.length; i++) t = r[i], n = t.getChild(), n == null || n.getNodes().length == 0 ? t.scatter() : (this.positionNodesRandomly(n), t.updateBounds());
871
- }, f.prototype.getFlatForest = function() {
872
- for (var e = [], t = !0, n = this.graphManager.getRoot().getNodes(), i = !0, a = 0; a < n.length; a++) n[a].getChild() != null && (i = !1);
873
- if (!i) return e;
874
- var o = /* @__PURE__ */ new Set(), s = [], c = /* @__PURE__ */ new Map(), l = [];
875
- for (l = l.concat(n); l.length > 0 && t;) {
876
- for (s.push(l[0]); s.length > 0 && t;) {
877
- var u = s[0];
878
- s.splice(0, 1), o.add(u);
879
- for (var d = u.getEdges(), a = 0; a < d.length; a++) {
880
- var f = d[a].getOtherEnd(u);
881
- if (c.get(u) != f) if (!o.has(f)) s.push(f), c.set(f, u);
882
- else {
883
- t = !1;
884
- break;
885
- }
886
- }
887
- }
888
- if (!t) e = [];
889
- else {
890
- var p = [].concat(r(o));
891
- e.push(p);
892
- for (var a = 0; a < p.length; a++) {
893
- var m = p[a], h = l.indexOf(m);
894
- h > -1 && l.splice(h, 1);
895
- }
896
- o = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
897
- }
898
- }
899
- return e;
900
- }, f.prototype.createDummyNodesForBendpoints = function(e) {
901
- for (var t = [], n = e.source, r = this.graphManager.calcLowestCommonAncestor(e.source, e.target), i = 0; i < e.bendpoints.length; i++) {
902
- var a = this.newNode(null);
903
- a.setRect(new Point(0, 0), new Dimension(1, 1)), r.add(a);
904
- var o = this.newEdge(null);
905
- this.graphManager.add(o, n, a), t.add(a), n = a;
906
- }
907
- var o = this.newEdge(null);
908
- return this.graphManager.add(o, n, e.target), this.edgeToDummyNodes.set(e, t), e.isInterGraph() ? this.graphManager.remove(e) : r.remove(e), t;
909
- }, f.prototype.createBendpointsFromDummyNodes = function() {
910
- var e = [];
911
- e = e.concat(this.graphManager.getAllEdges()), e = [].concat(r(this.edgeToDummyNodes.keys()), e);
912
- for (var t = 0; t < e.length; t++) {
913
- var n = e[t];
914
- if (n.bendpoints.length > 0) {
915
- for (var i = this.edgeToDummyNodes.get(n), a = 0; a < i.length; a++) {
916
- var o = i[a], s = new l(o.getCenterX(), o.getCenterY()), c = n.bendpoints.get(a);
917
- c.x = s.x, c.y = s.y, o.getOwner().remove(o);
918
- }
919
- this.graphManager.add(n, n.source, n.target);
920
- }
921
- }
922
- }, f.transform = function(e, t, n, r) {
923
- if (n != null && r != null) {
924
- var i = t;
925
- if (e <= 50) {
926
- var a = t / n;
927
- i -= (t - a) / 50 * (50 - e);
928
- } else {
929
- var o = t * r;
930
- i += (o - t) / 50 * (e - 50);
931
- }
932
- return i;
933
- } else {
934
- var s, c;
935
- return e <= 50 ? (s = 9 * t / 500, c = t / 10) : (s = 9 * t / 50, c = -8 * t), s * e + c;
936
- }
937
- }, f.findCenterOfTree = function(e) {
938
- var t = [];
939
- t = t.concat(e);
940
- var n = [], r = /* @__PURE__ */ new Map(), i = !1, a = null;
941
- (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
942
- for (var o = 0; o < t.length; o++) {
943
- var s = t[o], c = s.getNeighborsList().size;
944
- r.set(s, s.getNeighborsList().size), c == 1 && n.push(s);
945
- }
946
- var l = [];
947
- for (l = l.concat(n); !i;) {
948
- var u = [];
949
- u = u.concat(l), l = [];
950
- for (var o = 0; o < t.length; o++) {
951
- var s = t[o], d = t.indexOf(s);
952
- d >= 0 && t.splice(d, 1), s.getNeighborsList().forEach(function(e) {
953
- if (n.indexOf(e) < 0) {
954
- var t = r.get(e) - 1;
955
- t == 1 && l.push(e), r.set(e, t);
956
- }
957
- });
958
- }
959
- n = n.concat(l), (t.length == 1 || t.length == 2) && (i = !0, a = t[0]);
960
- }
961
- return a;
962
- }, f.prototype.setGraphManager = function(e) {
963
- this.graphManager = e;
964
- }, e.exports = f;
965
- }),
966
- (function(e, t, n) {
967
- function r() {}
968
- r.seed = 1, r.x = 0, r.nextDouble = function() {
969
- return r.x = Math.sin(r.seed++) * 1e4, r.x - Math.floor(r.x);
970
- }, e.exports = r;
971
- }),
972
- (function(e, t, n) {
973
- var r = n(4);
974
- function i(e, t) {
975
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
976
- }
977
- i.prototype.getWorldOrgX = function() {
978
- return this.lworldOrgX;
979
- }, i.prototype.setWorldOrgX = function(e) {
980
- this.lworldOrgX = e;
981
- }, i.prototype.getWorldOrgY = function() {
982
- return this.lworldOrgY;
983
- }, i.prototype.setWorldOrgY = function(e) {
984
- this.lworldOrgY = e;
985
- }, i.prototype.getWorldExtX = function() {
986
- return this.lworldExtX;
987
- }, i.prototype.setWorldExtX = function(e) {
988
- this.lworldExtX = e;
989
- }, i.prototype.getWorldExtY = function() {
990
- return this.lworldExtY;
991
- }, i.prototype.setWorldExtY = function(e) {
992
- this.lworldExtY = e;
993
- }, i.prototype.getDeviceOrgX = function() {
994
- return this.ldeviceOrgX;
995
- }, i.prototype.setDeviceOrgX = function(e) {
996
- this.ldeviceOrgX = e;
997
- }, i.prototype.getDeviceOrgY = function() {
998
- return this.ldeviceOrgY;
999
- }, i.prototype.setDeviceOrgY = function(e) {
1000
- this.ldeviceOrgY = e;
1001
- }, i.prototype.getDeviceExtX = function() {
1002
- return this.ldeviceExtX;
1003
- }, i.prototype.setDeviceExtX = function(e) {
1004
- this.ldeviceExtX = e;
1005
- }, i.prototype.getDeviceExtY = function() {
1006
- return this.ldeviceExtY;
1007
- }, i.prototype.setDeviceExtY = function(e) {
1008
- this.ldeviceExtY = e;
1009
- }, i.prototype.transformX = function(e) {
1010
- var t = 0, n = this.lworldExtX;
1011
- return n != 0 && (t = this.ldeviceOrgX + (e - this.lworldOrgX) * this.ldeviceExtX / n), t;
1012
- }, i.prototype.transformY = function(e) {
1013
- var t = 0, n = this.lworldExtY;
1014
- return n != 0 && (t = this.ldeviceOrgY + (e - this.lworldOrgY) * this.ldeviceExtY / n), t;
1015
- }, i.prototype.inverseTransformX = function(e) {
1016
- var t = 0, n = this.ldeviceExtX;
1017
- return n != 0 && (t = this.lworldOrgX + (e - this.ldeviceOrgX) * this.lworldExtX / n), t;
1018
- }, i.prototype.inverseTransformY = function(e) {
1019
- var t = 0, n = this.ldeviceExtY;
1020
- return n != 0 && (t = this.lworldOrgY + (e - this.ldeviceOrgY) * this.lworldExtY / n), t;
1021
- }, i.prototype.inverseTransformPoint = function(e) {
1022
- return new r(this.inverseTransformX(e.x), this.inverseTransformY(e.y));
1023
- }, e.exports = i;
1024
- }),
1025
- (function(e, t, n) {
1026
- function r(e) {
1027
- if (Array.isArray(e)) {
1028
- for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
1029
- return n;
1030
- } else return Array.from(e);
1031
- }
1032
- var i = n(15), a = n(7), o = n(0), s = n(8), c = n(9);
1033
- function l() {
1034
- i.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = a.DEFAULT_EDGE_LENGTH, this.springConstant = a.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = a.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1035
- }
1036
- for (var u in l.prototype = Object.create(i.prototype), i) l[u] = i[u];
1037
- l.prototype.initParameters = function() {
1038
- i.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1039
- }, l.prototype.calcIdealEdgeLengths = function() {
1040
- for (var e, t, n, r, i, s, c = this.getGraphManager().getAllEdges(), l = 0; l < c.length; l++) e = c[l], e.idealLength = this.idealEdgeLength, e.isInterGraph && (n = e.getSource(), r = e.getTarget(), i = e.getSourceInLca().getEstimatedSize(), s = e.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (e.idealLength += i + s - 2 * o.SIMPLE_NODE_SIZE), t = e.getLca().getInclusionTreeDepth(), e.idealLength += a.DEFAULT_EDGE_LENGTH * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (n.getInclusionTreeDepth() + r.getInclusionTreeDepth() - 2 * t));
1041
- }, l.prototype.initSpringEmbedder = function() {
1042
- var e = this.getAllNodes().length;
1043
- this.incremental ? (e > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (e > a.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (e - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1044
- }, l.prototype.calcSpringForces = function() {
1045
- for (var e = this.getAllEdges(), t, n = 0; n < e.length; n++) t = e[n], this.calcSpringForce(t, t.idealLength);
1046
- }, l.prototype.calcRepulsionForces = function() {
1047
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n, r, i, o, s = this.getAllNodes(), c;
1048
- if (this.useFRGridVariant) for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && e && this.updateGrid(), c = /* @__PURE__ */ new Set(), n = 0; n < s.length; n++) i = s[n], this.calculateRepulsionForceOfANode(i, c, e, t), c.add(i);
1049
- else for (n = 0; n < s.length; n++) for (i = s[n], r = n + 1; r < s.length; r++) o = s[r], i.getOwner() == o.getOwner() && this.calcRepulsionForce(i, o);
1050
- }, l.prototype.calcGravitationalForces = function() {
1051
- for (var e, t = this.getAllNodesToApplyGravitation(), n = 0; n < t.length; n++) e = t[n], this.calcGravitationalForce(e);
1052
- }, l.prototype.moveNodes = function() {
1053
- for (var e = this.getAllNodes(), t, n = 0; n < e.length; n++) t = e[n], t.move();
1054
- }, l.prototype.calcSpringForce = function(e, t) {
1055
- var n = e.getSource(), r = e.getTarget(), i, a, o, s;
1056
- if (this.uniformLeafNodeSizes && n.getChild() == null && r.getChild() == null) e.updateLengthSimple();
1057
- else if (e.updateLength(), e.isOverlapingSourceAndTarget) return;
1058
- i = e.getLength(), i != 0 && (a = this.springConstant * (i - t), o = a * (e.lengthX / i), s = a * (e.lengthY / i), n.springForceX += o, n.springForceY += s, r.springForceX -= o, r.springForceY -= s);
1059
- }, l.prototype.calcRepulsionForce = function(e, t) {
1060
- var n = e.getRect(), r = t.getRect(), i = [, ,], o = [
1061
- ,
1062
- ,
1063
- ,
1064
- ,
1065
- ], l, u, d, f, p, m, h;
1066
- if (n.intersects(r)) {
1067
- s.calcSeparationAmount(n, r, i, a.DEFAULT_EDGE_LENGTH / 2), m = 2 * i[0], h = 2 * i[1];
1068
- var g = e.noOfChildren * t.noOfChildren / (e.noOfChildren + t.noOfChildren);
1069
- e.repulsionForceX -= g * m, e.repulsionForceY -= g * h, t.repulsionForceX += g * m, t.repulsionForceY += g * h;
1070
- } else this.uniformLeafNodeSizes && e.getChild() == null && t.getChild() == null ? (l = r.getCenterX() - n.getCenterX(), u = r.getCenterY() - n.getCenterY()) : (s.getIntersection(n, r, o), l = o[2] - o[0], u = o[3] - o[1]), Math.abs(l) < a.MIN_REPULSION_DIST && (l = c.sign(l) * a.MIN_REPULSION_DIST), Math.abs(u) < a.MIN_REPULSION_DIST && (u = c.sign(u) * a.MIN_REPULSION_DIST), d = l * l + u * u, f = Math.sqrt(d), p = this.repulsionConstant * e.noOfChildren * t.noOfChildren / d, m = p * l / f, h = p * u / f, e.repulsionForceX -= m, e.repulsionForceY -= h, t.repulsionForceX += m, t.repulsionForceY += h;
1071
- }, l.prototype.calcGravitationalForce = function(e) {
1072
- var t = e.getOwner(), n = (t.getRight() + t.getLeft()) / 2, r = (t.getTop() + t.getBottom()) / 2, i = e.getCenterX() - n, a = e.getCenterY() - r, o = Math.abs(i) + e.getWidth() / 2, s = Math.abs(a) + e.getHeight() / 2, c;
1073
- e.getOwner() == this.graphManager.getRoot() ? (c = t.getEstimatedSize() * this.gravityRangeFactor, (o > c || s > c) && (e.gravitationForceX = -this.gravityConstant * i, e.gravitationForceY = -this.gravityConstant * a)) : (c = t.getEstimatedSize() * this.compoundGravityRangeFactor, (o > c || s > c) && (e.gravitationForceX = -this.gravityConstant * i * this.compoundGravityConstant, e.gravitationForceY = -this.gravityConstant * a * this.compoundGravityConstant));
1074
- }, l.prototype.isConverged = function() {
1075
- var e, t = !1;
1076
- return this.totalIterations > this.maxIterations / 3 && (t = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), e = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, e || t;
1077
- }, l.prototype.animate = function() {
1078
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1079
- }, l.prototype.calcNoOfChildrenForAllNodes = function() {
1080
- for (var e, t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) e = t[n], e.noOfChildren = e.getNoOfChildren();
1081
- }, l.prototype.calcGrid = function(e) {
1082
- var t = 0, n = 0;
1083
- t = parseInt(Math.ceil((e.getRight() - e.getLeft()) / this.repulsionRange)), n = parseInt(Math.ceil((e.getBottom() - e.getTop()) / this.repulsionRange));
1084
- for (var r = Array(t), i = 0; i < t; i++) r[i] = Array(n);
1085
- for (var i = 0; i < t; i++) for (var a = 0; a < n; a++) r[i][a] = [];
1086
- return r;
1087
- }, l.prototype.addNodeToGrid = function(e, t, n) {
1088
- var r = 0, i = 0, a = 0, o = 0;
1089
- r = parseInt(Math.floor((e.getRect().x - t) / this.repulsionRange)), i = parseInt(Math.floor((e.getRect().width + e.getRect().x - t) / this.repulsionRange)), a = parseInt(Math.floor((e.getRect().y - n) / this.repulsionRange)), o = parseInt(Math.floor((e.getRect().height + e.getRect().y - n) / this.repulsionRange));
1090
- for (var s = r; s <= i; s++) for (var c = a; c <= o; c++) this.grid[s][c].push(e), e.setGridCoordinates(r, i, a, o);
1091
- }, l.prototype.updateGrid = function() {
1092
- var e, t, n = this.getAllNodes();
1093
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), e = 0; e < n.length; e++) t = n[e], this.addNodeToGrid(t, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1094
- }, l.prototype.calculateRepulsionForceOfANode = function(e, t, n, i) {
1095
- if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && n || i) {
1096
- var o = /* @__PURE__ */ new Set();
1097
- e.surrounding = [];
1098
- for (var s, c = this.grid, l = e.startX - 1; l < e.finishX + 2; l++) for (var u = e.startY - 1; u < e.finishY + 2; u++) if (!(l < 0 || u < 0 || l >= c.length || u >= c[0].length)) {
1099
- for (var d = 0; d < c[l][u].length; d++) if (s = c[l][u][d], !(e.getOwner() != s.getOwner() || e == s) && !t.has(s) && !o.has(s)) {
1100
- var f = Math.abs(e.getCenterX() - s.getCenterX()) - (e.getWidth() / 2 + s.getWidth() / 2), p = Math.abs(e.getCenterY() - s.getCenterY()) - (e.getHeight() / 2 + s.getHeight() / 2);
1101
- f <= this.repulsionRange && p <= this.repulsionRange && o.add(s);
1102
- }
1103
- }
1104
- e.surrounding = [].concat(r(o));
1105
- }
1106
- for (l = 0; l < e.surrounding.length; l++) this.calcRepulsionForce(e, e.surrounding[l]);
1107
- }, l.prototype.calcRepulsionRange = function() {
1108
- return 0;
1109
- }, e.exports = l;
1110
- }),
1111
- (function(e, t, n) {
1112
- var r = n(1), i = n(7);
1113
- function a(e, t, n) {
1114
- r.call(this, e, t, n), this.idealLength = i.DEFAULT_EDGE_LENGTH;
1115
- }
1116
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1117
- e.exports = a;
1118
- }),
1119
- (function(e, t, n) {
1120
- var r = n(3);
1121
- function i(e, t, n, i) {
1122
- r.call(this, e, t, n, i), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
1123
- }
1124
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1125
- i.prototype.setGridCoordinates = function(e, t, n, r) {
1126
- this.startX = e, this.finishX = t, this.startY = n, this.finishY = r;
1127
- }, e.exports = i;
1128
- }),
1129
- (function(e, t, n) {
1130
- function r(e, t) {
1131
- this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1132
- }
1133
- r.prototype.getWidth = function() {
1134
- return this.width;
1135
- }, r.prototype.setWidth = function(e) {
1136
- this.width = e;
1137
- }, r.prototype.getHeight = function() {
1138
- return this.height;
1139
- }, r.prototype.setHeight = function(e) {
1140
- this.height = e;
1141
- }, e.exports = r;
1142
- }),
1143
- (function(e, t, n) {
1144
- var r = n(14);
1145
- function i() {
1146
- this.map = {}, this.keys = [];
1147
- }
1148
- i.prototype.put = function(e, t) {
1149
- var n = r.createID(e);
1150
- this.contains(n) || (this.map[n] = t, this.keys.push(e));
1151
- }, i.prototype.contains = function(e) {
1152
- return r.createID(e), this.map[e] != null;
1153
- }, i.prototype.get = function(e) {
1154
- var t = r.createID(e);
1155
- return this.map[t];
1156
- }, i.prototype.keySet = function() {
1157
- return this.keys;
1158
- }, e.exports = i;
1159
- }),
1160
- (function(e, t, n) {
1161
- var r = n(14);
1162
- function i() {
1163
- this.set = {};
1164
- }
1165
- i.prototype.add = function(e) {
1166
- var t = r.createID(e);
1167
- this.contains(t) || (this.set[t] = e);
1168
- }, i.prototype.remove = function(e) {
1169
- delete this.set[r.createID(e)];
1170
- }, i.prototype.clear = function() {
1171
- this.set = {};
1172
- }, i.prototype.contains = function(e) {
1173
- return this.set[r.createID(e)] == e;
1174
- }, i.prototype.isEmpty = function() {
1175
- return this.size() === 0;
1176
- }, i.prototype.size = function() {
1177
- return Object.keys(this.set).length;
1178
- }, i.prototype.addAllTo = function(e) {
1179
- for (var t = Object.keys(this.set), n = t.length, r = 0; r < n; r++) e.push(this.set[t[r]]);
1180
- }, i.prototype.size = function() {
1181
- return Object.keys(this.set).length;
1182
- }, i.prototype.addAll = function(e) {
1183
- for (var t = e.length, n = 0; n < t; n++) {
1184
- var r = e[n];
1185
- this.add(r);
1186
- }
1187
- }, e.exports = i;
1188
- }),
1189
- (function(e, t, n) {
1190
- var r = function() {
1191
- function e(e, t) {
1192
- for (var n = 0; n < t.length; n++) {
1193
- var r = t[n];
1194
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1195
- }
1196
- }
1197
- return function(t, n, r) {
1198
- return n && e(t.prototype, n), r && e(t, r), t;
1199
- };
1200
- }();
1201
- function i(e, t) {
1202
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1203
- }
1204
- var a = n(11);
1205
- e.exports = function() {
1206
- function e(t, n) {
1207
- i(this, e), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1208
- var r = void 0;
1209
- r = t instanceof a ? t.size() : t.length, this._quicksort(t, 0, r - 1);
1210
- }
1211
- return r(e, [
1212
- {
1213
- key: "_quicksort",
1214
- value: function(e, t, n) {
1215
- if (t < n) {
1216
- var r = this._partition(e, t, n);
1217
- this._quicksort(e, t, r), this._quicksort(e, r + 1, n);
1218
- }
1219
- }
1220
- },
1221
- {
1222
- key: "_partition",
1223
- value: function(e, t, n) {
1224
- for (var r = this._get(e, t), i = t, a = n;;) {
1225
- for (; this.compareFunction(r, this._get(e, a));) a--;
1226
- for (; this.compareFunction(this._get(e, i), r);) i++;
1227
- if (i < a) this._swap(e, i, a), i++, a--;
1228
- else return a;
1229
- }
1230
- }
1231
- },
1232
- {
1233
- key: "_get",
1234
- value: function(e, t) {
1235
- return e instanceof a ? e.get_object_at(t) : e[t];
1236
- }
1237
- },
1238
- {
1239
- key: "_set",
1240
- value: function(e, t, n) {
1241
- e instanceof a ? e.set_object_at(t, n) : e[t] = n;
1242
- }
1243
- },
1244
- {
1245
- key: "_swap",
1246
- value: function(e, t, n) {
1247
- var r = this._get(e, t);
1248
- this._set(e, t, this._get(e, n)), this._set(e, n, r);
1249
- }
1250
- },
1251
- {
1252
- key: "_defaultCompareFunction",
1253
- value: function(e, t) {
1254
- return t > e;
1255
- }
1256
- }
1257
- ]), e;
1258
- }();
1259
- }),
1260
- (function(e, t, n) {
1261
- var r = function() {
1262
- function e(e, t) {
1263
- for (var n = 0; n < t.length; n++) {
1264
- var r = t[n];
1265
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1266
- }
1267
- }
1268
- return function(t, n, r) {
1269
- return n && e(t.prototype, n), r && e(t, r), t;
1270
- };
1271
- }();
1272
- function i(e, t) {
1273
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1274
- }
1275
- e.exports = function() {
1276
- function e(t, n) {
1277
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1278
- i(this, e), this.sequence1 = t, this.sequence2 = n, this.match_score = r, this.mismatch_penalty = a, this.gap_penalty = o, this.iMax = t.length + 1, this.jMax = n.length + 1, this.grid = Array(this.iMax);
1279
- for (var s = 0; s < this.iMax; s++) {
1280
- this.grid[s] = Array(this.jMax);
1281
- for (var c = 0; c < this.jMax; c++) this.grid[s][c] = 0;
1282
- }
1283
- this.tracebackGrid = Array(this.iMax);
1284
- for (var l = 0; l < this.iMax; l++) {
1285
- this.tracebackGrid[l] = Array(this.jMax);
1286
- for (var u = 0; u < this.jMax; u++) this.tracebackGrid[l][u] = [
1287
- null,
1288
- null,
1289
- null
1290
- ];
1291
- }
1292
- this.alignments = [], this.score = -1, this.computeGrids();
1293
- }
1294
- return r(e, [
1295
- {
1296
- key: "getScore",
1297
- value: function() {
1298
- return this.score;
1299
- }
1300
- },
1301
- {
1302
- key: "getAlignments",
1303
- value: function() {
1304
- return this.alignments;
1305
- }
1306
- },
1307
- {
1308
- key: "computeGrids",
1309
- value: function() {
1310
- for (var e = 1; e < this.jMax; e++) this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [
1311
- !1,
1312
- !1,
1313
- !0
1314
- ];
1315
- for (var t = 1; t < this.iMax; t++) this.grid[t][0] = this.grid[t - 1][0] + this.gap_penalty, this.tracebackGrid[t][0] = [
1316
- !1,
1317
- !0,
1318
- !1
1319
- ];
1320
- for (var n = 1; n < this.iMax; n++) for (var r = 1; r < this.jMax; r++) {
1321
- var i = void 0;
1322
- i = this.sequence1[n - 1] === this.sequence2[r - 1] ? this.grid[n - 1][r - 1] + this.match_score : this.grid[n - 1][r - 1] + this.mismatch_penalty;
1323
- var a = this.grid[n - 1][r] + this.gap_penalty, o = this.grid[n][r - 1] + this.gap_penalty, s = [
1324
- i,
1325
- a,
1326
- o
1327
- ], c = this.arrayAllMaxIndexes(s);
1328
- this.grid[n][r] = s[c[0]], this.tracebackGrid[n][r] = [
1329
- c.includes(0),
1330
- c.includes(1),
1331
- c.includes(2)
1332
- ];
1333
- }
1334
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1335
- }
1336
- },
1337
- {
1338
- key: "alignmentTraceback",
1339
- value: function() {
1340
- var e = [];
1341
- for (e.push({
1342
- pos: [this.sequence1.length, this.sequence2.length],
1343
- seq1: "",
1344
- seq2: ""
1345
- }); e[0];) {
1346
- var t = e[0], n = this.tracebackGrid[t.pos[0]][t.pos[1]];
1347
- n[0] && e.push({
1348
- pos: [t.pos[0] - 1, t.pos[1] - 1],
1349
- seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1350
- seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1351
- }), n[1] && e.push({
1352
- pos: [t.pos[0] - 1, t.pos[1]],
1353
- seq1: this.sequence1[t.pos[0] - 1] + t.seq1,
1354
- seq2: "-" + t.seq2
1355
- }), n[2] && e.push({
1356
- pos: [t.pos[0], t.pos[1] - 1],
1357
- seq1: "-" + t.seq1,
1358
- seq2: this.sequence2[t.pos[1] - 1] + t.seq2
1359
- }), t.pos[0] === 0 && t.pos[1] === 0 && this.alignments.push({
1360
- sequence1: t.seq1,
1361
- sequence2: t.seq2
1362
- }), e.shift();
1363
- }
1364
- return this.alignments;
1365
- }
1366
- },
1367
- {
1368
- key: "getAllIndexes",
1369
- value: function(e, t) {
1370
- for (var n = [], r = -1; (r = e.indexOf(t, r + 1)) !== -1;) n.push(r);
1371
- return n;
1372
- }
1373
- },
1374
- {
1375
- key: "arrayAllMaxIndexes",
1376
- value: function(e) {
1377
- return this.getAllIndexes(e, Math.max.apply(null, e));
1378
- }
1379
- }
1380
- ]), e;
1381
- }();
1382
- }),
1383
- (function(e, t, n) {
1384
- var r = function() {};
1385
- r.FDLayout = n(18), r.FDLayoutConstants = n(7), r.FDLayoutEdge = n(19), r.FDLayoutNode = n(20), r.DimensionD = n(21), r.HashMap = n(22), r.HashSet = n(23), r.IGeometry = n(8), r.IMath = n(9), r.Integer = n(10), r.Point = n(12), r.PointD = n(4), r.RandomSeed = n(16), r.RectangleD = n(13), r.Transform = n(17), r.UniqueIDGeneretor = n(14), r.Quicksort = n(24), r.LinkedList = n(11), r.LGraphObject = n(2), r.LGraph = n(5), r.LEdge = n(1), r.LGraphManager = n(6), r.LNode = n(3), r.Layout = n(15), r.LayoutConstants = n(0), r.NeedlemanWunsch = n(25), e.exports = r;
1386
- }),
1387
- (function(e, t, n) {
1388
- function r() {
1389
- this.listeners = [];
1390
- }
1391
- var i = r.prototype;
1392
- i.addListener = function(e, t) {
1393
- this.listeners.push({
1394
- event: e,
1395
- callback: t
1396
- });
1397
- }, i.removeListener = function(e, t) {
1398
- for (var n = this.listeners.length; n >= 0; n--) {
1399
- var r = this.listeners[n];
1400
- r.event === e && r.callback === t && this.listeners.splice(n, 1);
1401
- }
1402
- }, i.emit = function(e, t) {
1403
- for (var n = 0; n < this.listeners.length; n++) {
1404
- var r = this.listeners[n];
1405
- e === r.event && r.callback(t);
1406
- }
1407
- }, e.exports = r;
1408
- })
1409
- ]);
1410
- });
1411
- })), d = /* @__PURE__ */ t(((e, t) => {
1412
- (function(n, r) {
1413
- typeof e == "object" && typeof t == "object" ? t.exports = r(u()) : typeof define == "function" && define.amd ? define(["layout-base"], r) : typeof e == "object" ? e.coseBase = r(u()) : n.coseBase = r(n.layoutBase);
1414
- })(e, function(e) {
1415
- return (function(e) {
1416
- var t = {};
1417
- function n(r) {
1418
- if (t[r]) return t[r].exports;
1419
- var i = t[r] = {
1420
- i: r,
1421
- l: !1,
1422
- exports: {}
1423
- };
1424
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
1425
- }
1426
- return n.m = e, n.c = t, n.i = function(e) {
1427
- return e;
1428
- }, n.d = function(e, t, r) {
1429
- n.o(e, t) || Object.defineProperty(e, t, {
1430
- configurable: !1,
1431
- enumerable: !0,
1432
- get: r
1433
- });
1434
- }, n.n = function(e) {
1435
- var t = e && e.__esModule ? function() {
1436
- return e.default;
1437
- } : function() {
1438
- return e;
1439
- };
1440
- return n.d(t, "a", t), t;
1441
- }, n.o = function(e, t) {
1442
- return Object.prototype.hasOwnProperty.call(e, t);
1443
- }, n.p = "", n(n.s = 7);
1444
- })([
1445
- (function(t, n) {
1446
- t.exports = e;
1447
- }),
1448
- (function(e, t, n) {
1449
- var r = n(0).FDLayoutConstants;
1450
- function i() {}
1451
- for (var a in r) i[a] = r[a];
1452
- i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TREE_REDUCTION_ON_INCREMENTAL = !1, e.exports = i;
1453
- }),
1454
- (function(e, t, n) {
1455
- var r = n(0).FDLayoutEdge;
1456
- function i(e, t, n) {
1457
- r.call(this, e, t, n);
1458
- }
1459
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1460
- e.exports = i;
1461
- }),
1462
- (function(e, t, n) {
1463
- var r = n(0).LGraph;
1464
- function i(e, t, n) {
1465
- r.call(this, e, t, n);
1466
- }
1467
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1468
- e.exports = i;
1469
- }),
1470
- (function(e, t, n) {
1471
- var r = n(0).LGraphManager;
1472
- function i(e) {
1473
- r.call(this, e);
1474
- }
1475
- for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
1476
- e.exports = i;
1477
- }),
1478
- (function(e, t, n) {
1479
- var r = n(0).FDLayoutNode, i = n(0).IMath;
1480
- function a(e, t, n, i) {
1481
- r.call(this, e, t, n, i);
1482
- }
1483
- for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
1484
- a.prototype.move = function() {
1485
- var e = this.graphManager.getLayout();
1486
- this.displacementX = e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), this.child == null || this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), e.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
1487
- }, a.prototype.propogateDisplacementToChildren = function(e, t) {
1488
- for (var n = this.getChild().getNodes(), r, i = 0; i < n.length; i++) r = n[i], r.getChild() == null ? (r.moveBy(e, t), r.displacementX += e, r.displacementY += t) : r.propogateDisplacementToChildren(e, t);
1489
- }, a.prototype.setPred1 = function(e) {
1490
- this.pred1 = e;
1491
- }, a.prototype.getPred1 = function() {
1492
- return pred1;
1493
- }, a.prototype.getPred2 = function() {
1494
- return pred2;
1495
- }, a.prototype.setNext = function(e) {
1496
- this.next = e;
1497
- }, a.prototype.getNext = function() {
1498
- return next;
1499
- }, a.prototype.setProcessed = function(e) {
1500
- this.processed = e;
1501
- }, a.prototype.isProcessed = function() {
1502
- return processed;
1503
- }, e.exports = a;
1504
- }),
1505
- (function(e, t, n) {
1506
- var r = n(0).FDLayout, i = n(4), a = n(3), o = n(5), s = n(2), c = n(1), l = n(0).FDLayoutConstants, u = n(0).LayoutConstants, d = n(0).Point, f = n(0).PointD, p = n(0).Layout, m = n(0).Integer, h = n(0).IGeometry, g = n(0).LGraph, _ = n(0).Transform;
1507
- function v() {
1508
- r.call(this), this.toBeTiled = {};
1509
- }
1510
- for (var y in v.prototype = Object.create(r.prototype), r) v[y] = r[y];
1511
- v.prototype.newGraphManager = function() {
1512
- var e = new i(this);
1513
- return this.graphManager = e, e;
1514
- }, v.prototype.newGraph = function(e) {
1515
- return new a(null, this.graphManager, e);
1516
- }, v.prototype.newNode = function(e) {
1517
- return new o(this.graphManager, e);
1518
- }, v.prototype.newEdge = function(e) {
1519
- return new s(null, null, e);
1520
- }, v.prototype.initParameters = function() {
1521
- r.prototype.initParameters.call(this, arguments), this.isSubLayout || (c.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = c.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = l.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = l.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = l.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = l.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = l.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / l.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = l.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1522
- }, v.prototype.layout = function() {
1523
- return u.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1524
- }, v.prototype.classicLayout = function() {
1525
- if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), !this.incremental) {
1526
- var e = this.getFlatForest();
1527
- if (e.length > 0) this.positionNodesRadially(e);
1528
- else {
1529
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1530
- var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1531
- return t.has(e);
1532
- });
1533
- this.graphManager.setAllNodesToApplyGravitation(n), this.positionNodesRandomly();
1534
- }
1535
- } else if (c.TREE_REDUCTION_ON_INCREMENTAL) {
1536
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1537
- var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
1538
- return t.has(e);
1539
- });
1540
- this.graphManager.setAllNodesToApplyGravitation(n);
1541
- }
1542
- return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1543
- }, v.prototype.tick = function() {
1544
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1545
- else return !0;
1546
- if (this.totalIterations % l.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1547
- if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1548
- else return !0;
1549
- this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), 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), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
1550
- }
1551
- if (this.isTreeGrowing) {
1552
- if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
1553
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1554
- var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
1555
- return e.has(t);
1556
- });
1557
- this.graphManager.setAllNodesToApplyGravitation(t), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1558
- } else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1559
- this.growTreeIterations++;
1560
- }
1561
- if (this.isGrowthFinished) {
1562
- if (this.isConverged()) return !0;
1563
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = l.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1564
- }
1565
- var n = !this.isTreeGrowing && !this.isGrowthFinished, r = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1566
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(n, r), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1567
- }, v.prototype.getPositionsData = function() {
1568
- for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) {
1569
- var r = e[n].rect, i = e[n].id;
1570
- t[i] = {
1571
- id: i,
1572
- x: r.getCenterX(),
1573
- y: r.getCenterY(),
1574
- w: r.width,
1575
- h: r.height
1576
- };
1577
- }
1578
- return t;
1579
- }, v.prototype.runSpringEmbedder = function() {
1580
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1581
- var e = !1;
1582
- if (l.ANIMATE === "during") this.emit("layoutstarted");
1583
- else {
1584
- for (; !e;) e = this.tick();
1585
- this.graphManager.updateBounds();
1586
- }
1587
- }, v.prototype.calculateNodesToApplyGravitationTo = function() {
1588
- var e = [], t, n = this.graphManager.getGraphs(), r = n.length, i;
1589
- for (i = 0; i < r; i++) t = n[i], t.updateConnected(), t.isConnected || (e = e.concat(t.getNodes()));
1590
- return e;
1591
- }, v.prototype.createBendpoints = function() {
1592
- var e = [];
1593
- e = e.concat(this.graphManager.getAllEdges());
1594
- var t = /* @__PURE__ */ new Set(), n;
1595
- for (n = 0; n < e.length; n++) {
1596
- var r = e[n];
1597
- if (!t.has(r)) {
1598
- var i = r.getSource(), a = r.getTarget();
1599
- if (i == a) r.getBendpoints().push(new f()), r.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(r), t.add(r);
1600
- else {
1601
- var o = [];
1602
- if (o = o.concat(i.getEdgeListToNode(a)), o = o.concat(a.getEdgeListToNode(i)), !t.has(o[0])) {
1603
- if (o.length > 1) {
1604
- var s;
1605
- for (s = 0; s < o.length; s++) {
1606
- var c = o[s];
1607
- c.getBendpoints().push(new f()), this.createDummyNodesForBendpoints(c);
1608
- }
1609
- }
1610
- o.forEach(function(e) {
1611
- t.add(e);
1612
- });
1613
- }
1614
- }
1615
- }
1616
- if (t.size == e.length) break;
1617
- }
1618
- }, v.prototype.positionNodesRadially = function(e) {
1619
- for (var t = new d(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new f(0, 0), s = 0; s < e.length; s++) {
1620
- s % n == 0 && (a = 0, i = r, s != 0 && (i += c.DEFAULT_COMPONENT_SEPERATION), r = 0);
1621
- var l = e[s], m = p.findCenterOfTree(l);
1622
- t.x = a, t.y = i, o = v.radialLayout(l, m, t), o.y > r && (r = Math.floor(o.y)), a = Math.floor(o.x + c.DEFAULT_COMPONENT_SEPERATION);
1623
- }
1624
- this.transform(new f(u.WORLD_CENTER_X - o.x / 2, u.WORLD_CENTER_Y - o.y / 2));
1625
- }, v.radialLayout = function(e, t, n) {
1626
- var r = Math.max(this.maxDiagonalInTree(e), c.DEFAULT_RADIAL_SEPARATION);
1627
- v.branchRadialLayout(t, null, 0, 359, 0, r);
1628
- var i = g.calculateBounds(e), a = new _();
1629
- a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y);
1630
- for (var o = 0; o < e.length; o++) e[o].transform(a);
1631
- var s = new f(i.getMaxX(), i.getMaxY());
1632
- return a.inverseTransformPoint(s);
1633
- }, v.branchRadialLayout = function(e, t, n, r, i, a) {
1634
- var o = (r - n + 1) / 2;
1635
- o < 0 && (o += 180);
1636
- var s = (o + n) % 360 * h.TWO_PI / 360, c = i * Math.cos(s), l = i * Math.sin(s);
1637
- e.setCenter(c, l);
1638
- var u = [];
1639
- u = u.concat(e.getEdges());
1640
- var d = u.length;
1641
- t != null && d--;
1642
- for (var f = 0, p = u.length, m, g = e.getEdgesBetween(t); g.length > 1;) {
1643
- var _ = g[0];
1644
- g.splice(0, 1);
1645
- var y = u.indexOf(_);
1646
- y >= 0 && u.splice(y, 1), p--, d--;
1647
- }
1648
- m = t == null ? 0 : (u.indexOf(g[0]) + 1) % p;
1649
- for (var b = Math.abs(r - n) / d, x = m; f != d; x = ++x % p) {
1650
- var S = u[x].getOtherEnd(e);
1651
- if (S != t) {
1652
- var C = (n + f * b) % 360, w = (C + b) % 360;
1653
- v.branchRadialLayout(S, e, C, w, i + a, a), f++;
1654
- }
1655
- }
1656
- }, v.maxDiagonalInTree = function(e) {
1657
- for (var t = m.MIN_VALUE, n = 0; n < e.length; n++) {
1658
- var r = e[n].getDiagonal();
1659
- r > t && (t = r);
1660
- }
1661
- return t;
1662
- }, v.prototype.calcRepulsionRange = function() {
1663
- return 2 * (this.level + 1) * this.idealEdgeLength;
1664
- }, v.prototype.groupZeroDegreeMembers = function() {
1665
- var e = this, t = {};
1666
- this.memberGroups = {}, this.idToDummyNode = {};
1667
- for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) {
1668
- var a = r[i], s = a.getParent();
1669
- this.getNodeDegreeWithChildren(a) === 0 && (s.id == null || !this.getToBeTiled(s)) && n.push(a);
1670
- }
1671
- for (var i = 0; i < n.length; i++) {
1672
- var a = n[i], c = a.getParent().id;
1673
- t[c] === void 0 && (t[c] = []), t[c] = t[c].concat(a);
1674
- }
1675
- Object.keys(t).forEach(function(n) {
1676
- if (t[n].length > 1) {
1677
- var r = "DummyCompound_" + n;
1678
- e.memberGroups[r] = t[n];
1679
- var i = t[n][0].getParent(), a = new o(e.graphManager);
1680
- a.id = r, a.paddingLeft = i.paddingLeft || 0, a.paddingRight = i.paddingRight || 0, a.paddingBottom = i.paddingBottom || 0, a.paddingTop = i.paddingTop || 0, e.idToDummyNode[r] = a;
1681
- var s = e.getGraphManager().add(e.newGraph(), a), c = i.getChild();
1682
- c.add(a);
1683
- for (var l = 0; l < t[n].length; l++) {
1684
- var u = t[n][l];
1685
- c.remove(u), s.add(u);
1686
- }
1687
- }
1688
- });
1689
- }, v.prototype.clearCompounds = function() {
1690
- var e = {}, t = {};
1691
- this.performDFSOnCompounds();
1692
- for (var n = 0; n < this.compoundOrder.length; n++) t[this.compoundOrder[n].id] = this.compoundOrder[n], e[this.compoundOrder[n].id] = [].concat(this.compoundOrder[n].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[n].getChild()), this.compoundOrder[n].child = null;
1693
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t);
1694
- }, v.prototype.clearZeroDegreeMembers = function() {
1695
- var e = this, t = this.tiledZeroDegreePack = [];
1696
- Object.keys(this.memberGroups).forEach(function(n) {
1697
- var r = e.idToDummyNode[n];
1698
- t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight), r.rect.width = t[n].width, r.rect.height = t[n].height;
1699
- });
1700
- }, v.prototype.repopulateCompounds = function() {
1701
- for (var e = this.compoundOrder.length - 1; e >= 0; e--) {
1702
- var t = this.compoundOrder[e], n = t.id, r = t.paddingLeft, i = t.paddingTop;
1703
- this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i);
1704
- }
1705
- }, v.prototype.repopulateZeroDegreeMembers = function() {
1706
- var e = this, t = this.tiledZeroDegreePack;
1707
- Object.keys(t).forEach(function(n) {
1708
- var r = e.idToDummyNode[n], i = r.paddingLeft, a = r.paddingTop;
1709
- e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a);
1710
- });
1711
- }, v.prototype.getToBeTiled = function(e) {
1712
- var t = e.id;
1713
- if (this.toBeTiled[t] != null) return this.toBeTiled[t];
1714
- var n = e.getChild();
1715
- if (n == null) return this.toBeTiled[t] = !1, !1;
1716
- for (var r = n.getNodes(), i = 0; i < r.length; i++) {
1717
- var a = r[i];
1718
- if (this.getNodeDegree(a) > 0) return this.toBeTiled[t] = !1, !1;
1719
- if (a.getChild() == null) {
1720
- this.toBeTiled[a.id] = !1;
1721
- continue;
1722
- }
1723
- if (!this.getToBeTiled(a)) return this.toBeTiled[t] = !1, !1;
1724
- }
1725
- return this.toBeTiled[t] = !0, !0;
1726
- }, v.prototype.getNodeDegree = function(e) {
1727
- e.id;
1728
- for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) {
1729
- var i = t[r];
1730
- i.getSource().id !== i.getTarget().id && (n += 1);
1731
- }
1732
- return n;
1733
- }, v.prototype.getNodeDegreeWithChildren = function(e) {
1734
- var t = this.getNodeDegree(e);
1735
- if (e.getChild() == null) return t;
1736
- for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) {
1737
- var i = n[r];
1738
- t += this.getNodeDegreeWithChildren(i);
1739
- }
1740
- return t;
1741
- }, v.prototype.performDFSOnCompounds = function() {
1742
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
1743
- }, v.prototype.fillCompexOrderByDFS = function(e) {
1744
- for (var t = 0; t < e.length; t++) {
1745
- var n = e[t];
1746
- n.getChild() != null && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n);
1747
- }
1748
- }, v.prototype.adjustLocations = function(e, t, n, r, i) {
1749
- t += r, n += i;
1750
- for (var a = t, o = 0; o < e.rows.length; o++) {
1751
- var s = e.rows[o];
1752
- t = a;
1753
- for (var c = 0, l = 0; l < s.length; l++) {
1754
- var u = s[l];
1755
- u.rect.x = t, u.rect.y = n, t += u.rect.width + e.horizontalPadding, u.rect.height > c && (c = u.rect.height);
1756
- }
1757
- n += c + e.verticalPadding;
1758
- }
1759
- }, v.prototype.tileCompoundMembers = function(e, t) {
1760
- var n = this;
1761
- this.tiledMemberPack = [], Object.keys(e).forEach(function(r) {
1762
- var i = t[r];
1763
- n.tiledMemberPack[r] = n.tileNodes(e[r], i.paddingLeft + i.paddingRight), i.rect.width = n.tiledMemberPack[r].width, i.rect.height = n.tiledMemberPack[r].height;
1764
- });
1765
- }, v.prototype.tileNodes = function(e, t) {
1766
- var n = {
1767
- rows: [],
1768
- rowWidth: [],
1769
- rowHeight: [],
1770
- width: 0,
1771
- height: t,
1772
- verticalPadding: c.TILING_PADDING_VERTICAL,
1773
- horizontalPadding: c.TILING_PADDING_HORIZONTAL
1774
- };
1775
- e.sort(function(e, t) {
1776
- return e.rect.width * e.rect.height > t.rect.width * t.rect.height ? -1 : +(e.rect.width * e.rect.height < t.rect.width * t.rect.height);
1777
- });
1778
- for (var r = 0; r < e.length; r++) {
1779
- var i = e[r];
1780
- n.rows.length == 0 ? this.insertNodeToRow(n, i, 0, t) : this.canAddHorizontal(n, i.rect.width, i.rect.height) ? this.insertNodeToRow(n, i, this.getShortestRowIndex(n), t) : this.insertNodeToRow(n, i, n.rows.length, t), this.shiftToLastRow(n);
1781
- }
1782
- return n;
1783
- }, v.prototype.insertNodeToRow = function(e, t, n, r) {
1784
- var i = r;
1785
- n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0));
1786
- var a = e.rowWidth[n] + t.rect.width;
1787
- e.rows[n].length > 0 && (a += e.horizontalPadding), e.rowWidth[n] = a, e.width < a && (e.width = a);
1788
- var o = t.rect.height;
1789
- n > 0 && (o += e.verticalPadding);
1790
- var s = 0;
1791
- o > e.rowHeight[n] && (s = e.rowHeight[n], e.rowHeight[n] = o, s = e.rowHeight[n] - s), e.height += s, e.rows[n].push(t);
1792
- }, v.prototype.getShortestRowIndex = function(e) {
1793
- for (var t = -1, n = Number.MAX_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] < n && (t = r, n = e.rowWidth[r]);
1794
- return t;
1795
- }, v.prototype.getLongestRowIndex = function(e) {
1796
- for (var t = -1, n = Number.MIN_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] > n && (t = r, n = e.rowWidth[r]);
1797
- return t;
1798
- }, v.prototype.canAddHorizontal = function(e, t, n) {
1799
- var r = this.getShortestRowIndex(e);
1800
- if (r < 0) return !0;
1801
- var i = e.rowWidth[r];
1802
- if (i + e.horizontalPadding + t <= e.width) return !0;
1803
- var a = 0;
1804
- e.rowHeight[r] < n && r > 0 && (a = n + e.verticalPadding - e.rowHeight[r]);
1805
- var o = e.width - i >= t + e.horizontalPadding ? (e.height + a) / (i + t + e.horizontalPadding) : (e.height + a) / e.width;
1806
- a = n + e.verticalPadding;
1807
- var s = e.width < t ? (e.height + a) / t : (e.height + a) / e.width;
1808
- return s < 1 && (s = 1 / s), o < 1 && (o = 1 / o), o < s;
1809
- }, v.prototype.shiftToLastRow = function(e) {
1810
- var t = this.getLongestRowIndex(e), n = e.rowWidth.length - 1, r = e.rows[t], i = r[r.length - 1], a = i.width + e.horizontalPadding;
1811
- if (e.width - e.rowWidth[n] > a && t != n) {
1812
- r.splice(-1, 1), e.rows[n].push(i), e.rowWidth[t] = e.rowWidth[t] - a, e.rowWidth[n] = e.rowWidth[n] + a, e.width = e.rowWidth[instance.getLongestRowIndex(e)];
1813
- for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height);
1814
- t > 0 && (o += e.verticalPadding);
1815
- var c = e.rowHeight[t] + e.rowHeight[n];
1816
- e.rowHeight[t] = o, e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding);
1817
- var l = e.rowHeight[t] + e.rowHeight[n];
1818
- e.height += l - c, this.shiftToLastRow(e);
1819
- }
1820
- }, v.prototype.tilingPreLayout = function() {
1821
- c.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
1822
- }, v.prototype.tilingPostLayout = function() {
1823
- c.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
1824
- }, v.prototype.reduceTrees = function() {
1825
- for (var e = [], t = !0, n; t;) {
1826
- var r = this.graphManager.getAllNodes(), i = [];
1827
- t = !1;
1828
- for (var a = 0; a < r.length; a++) n = r[a], n.getEdges().length == 1 && !n.getEdges()[0].isInterGraph && n.getChild() == null && (i.push([
1829
- n,
1830
- n.getEdges()[0],
1831
- n.getOwner()
1832
- ]), t = !0);
1833
- if (t == 1) {
1834
- for (var o = [], s = 0; s < i.length; s++) i[s][0].getEdges().length == 1 && (o.push(i[s]), i[s][0].getOwner().remove(i[s][0]));
1835
- e.push(o), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1836
- }
1837
- }
1838
- this.prunedNodesAll = e;
1839
- }, v.prototype.growTree = function(e) {
1840
- for (var t = e[e.length - 1], n, r = 0; r < t.length; r++) n = t[r], this.findPlaceforPrunedNode(n), n[2].add(n[0]), n[2].add(n[1], n[1].source, n[1].target);
1841
- e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1842
- }, v.prototype.findPlaceforPrunedNode = function(e) {
1843
- var t, n, r = e[0];
1844
- n = r == e[1].source ? e[1].target : e[1].source;
1845
- var i = n.startX, a = n.finishX, o = n.startY, s = n.finishY, c = [
1846
- 0,
1847
- 0,
1848
- 0,
1849
- 0
1850
- ];
1851
- if (o > 0) for (var u = i; u <= a; u++) c[0] += this.grid[u][o - 1].length + this.grid[u][o].length - 1;
1852
- if (a < this.grid.length - 1) for (var u = o; u <= s; u++) c[1] += this.grid[a + 1][u].length + this.grid[a][u].length - 1;
1853
- if (s < this.grid[0].length - 1) for (var u = i; u <= a; u++) c[2] += this.grid[u][s + 1].length + this.grid[u][s].length - 1;
1854
- if (i > 0) for (var u = o; u <= s; u++) c[3] += this.grid[i - 1][u].length + this.grid[i][u].length - 1;
1855
- for (var d = m.MAX_VALUE, f, p, h = 0; h < c.length; h++) c[h] < d ? (d = c[h], f = 1, p = h) : c[h] == d && f++;
1856
- if (f == 3 && d == 0) c[0] == 0 && c[1] == 0 && c[2] == 0 ? t = 1 : c[0] == 0 && c[1] == 0 && c[3] == 0 ? t = 0 : c[0] == 0 && c[2] == 0 && c[3] == 0 ? t = 3 : c[1] == 0 && c[2] == 0 && c[3] == 0 && (t = 2);
1857
- else if (f == 2 && d == 0) {
1858
- var g = Math.floor(Math.random() * 2);
1859
- t = c[0] == 0 && c[1] == 0 ? g == 0 ? 0 : 1 : c[0] == 0 && c[2] == 0 ? g == 0 ? 0 : 2 : c[0] == 0 && c[3] == 0 ? g == 0 ? 0 : 3 : c[1] == 0 && c[2] == 0 ? g == 0 ? 1 : 2 : c[1] == 0 && c[3] == 0 ? g == 0 ? 1 : 3 : g == 0 ? 2 : 3;
1860
- } else if (f == 4 && d == 0) {
1861
- var g = Math.floor(Math.random() * 4);
1862
- t = g;
1863
- } else t = p;
1864
- t == 0 ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - l.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) : t == 1 ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + l.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) : t == 2 ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + l.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) : r.setCenter(n.getCenterX() - n.getWidth() / 2 - l.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY());
1865
- }, e.exports = v;
1866
- }),
1867
- (function(e, t, n) {
1868
- var r = {};
1869
- r.layoutBase = n(0), r.CoSEConstants = n(1), r.CoSEEdge = n(2), r.CoSEGraph = n(3), r.CoSEGraphManager = n(4), r.CoSELayout = n(6), r.CoSENode = n(5), e.exports = r;
1870
- })
1871
- ]);
1872
- });
1873
- })), f = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1874
- (function(n, r) {
1875
- typeof e == "object" && typeof t == "object" ? t.exports = r(d()) : typeof define == "function" && define.amd ? define(["cose-base"], r) : typeof e == "object" ? e.cytoscapeCoseBilkent = r(d()) : n.cytoscapeCoseBilkent = r(n.coseBase);
1876
- })(e, function(e) {
1877
- return (function(e) {
1878
- var t = {};
1879
- function n(r) {
1880
- if (t[r]) return t[r].exports;
1881
- var i = t[r] = {
1882
- i: r,
1883
- l: !1,
1884
- exports: {}
1885
- };
1886
- return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
1887
- }
1888
- return n.m = e, n.c = t, n.i = function(e) {
1889
- return e;
1890
- }, n.d = function(e, t, r) {
1891
- n.o(e, t) || Object.defineProperty(e, t, {
1892
- configurable: !1,
1893
- enumerable: !0,
1894
- get: r
1895
- });
1896
- }, n.n = function(e) {
1897
- var t = e && e.__esModule ? function() {
1898
- return e.default;
1899
- } : function() {
1900
- return e;
1901
- };
1902
- return n.d(t, "a", t), t;
1903
- }, n.o = function(e, t) {
1904
- return Object.prototype.hasOwnProperty.call(e, t);
1905
- }, n.p = "", n(n.s = 1);
1906
- })([(function(t, n) {
1907
- t.exports = e;
1908
- }), (function(e, t, n) {
1909
- var r = n(0).layoutBase.LayoutConstants, i = n(0).layoutBase.FDLayoutConstants, a = n(0).CoSEConstants, o = n(0).CoSELayout, s = n(0).CoSENode, c = n(0).layoutBase.PointD, l = n(0).layoutBase.DimensionD, u = {
1910
- ready: function() {},
1911
- stop: function() {},
1912
- quality: "default",
1913
- nodeDimensionsIncludeLabels: !1,
1914
- refresh: 30,
1915
- fit: !0,
1916
- padding: 10,
1917
- randomize: !0,
1918
- nodeRepulsion: 4500,
1919
- idealEdgeLength: 50,
1920
- edgeElasticity: .45,
1921
- nestingFactor: .1,
1922
- gravity: .25,
1923
- numIter: 2500,
1924
- tile: !0,
1925
- animate: "end",
1926
- animationDuration: 500,
1927
- tilingPaddingVertical: 10,
1928
- tilingPaddingHorizontal: 10,
1929
- gravityRangeCompound: 1.5,
1930
- gravityCompound: 1,
1931
- gravityRange: 3.8,
1932
- initialEnergyOnIncremental: .5
1933
- };
1934
- function d(e, t) {
1935
- var n = {};
1936
- for (var r in e) n[r] = e[r];
1937
- for (var r in t) n[r] = t[r];
1938
- return n;
1939
- }
1940
- function f(e) {
1941
- this.options = d(u, e), p(this.options);
1942
- }
1943
- var p = function(e) {
1944
- e.nodeRepulsion != null && (a.DEFAULT_REPULSION_STRENGTH = i.DEFAULT_REPULSION_STRENGTH = e.nodeRepulsion), e.idealEdgeLength != null && (a.DEFAULT_EDGE_LENGTH = i.DEFAULT_EDGE_LENGTH = e.idealEdgeLength), e.edgeElasticity != null && (a.DEFAULT_SPRING_STRENGTH = i.DEFAULT_SPRING_STRENGTH = e.edgeElasticity), e.nestingFactor != null && (a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = e.nestingFactor), e.gravity != null && (a.DEFAULT_GRAVITY_STRENGTH = i.DEFAULT_GRAVITY_STRENGTH = e.gravity), e.numIter != null && (a.MAX_ITERATIONS = i.MAX_ITERATIONS = e.numIter), e.gravityRange != null && (a.DEFAULT_GRAVITY_RANGE_FACTOR = i.DEFAULT_GRAVITY_RANGE_FACTOR = e.gravityRange), e.gravityCompound != null && (a.DEFAULT_COMPOUND_GRAVITY_STRENGTH = i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = e.gravityCompound), e.gravityRangeCompound != null && (a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = e.gravityRangeCompound), e.initialEnergyOnIncremental != null && (a.DEFAULT_COOLING_FACTOR_INCREMENTAL = i.DEFAULT_COOLING_FACTOR_INCREMENTAL = e.initialEnergyOnIncremental), e.quality == "draft" ? r.QUALITY = 0 : e.quality == "proof" ? r.QUALITY = 2 : r.QUALITY = 1, a.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = r.NODE_DIMENSIONS_INCLUDE_LABELS = e.nodeDimensionsIncludeLabels, a.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = r.DEFAULT_INCREMENTAL = !e.randomize, a.ANIMATE = i.ANIMATE = r.ANIMATE = e.animate, a.TILE = e.tile, a.TILING_PADDING_VERTICAL = typeof e.tilingPaddingVertical == "function" ? e.tilingPaddingVertical.call() : e.tilingPaddingVertical, a.TILING_PADDING_HORIZONTAL = typeof e.tilingPaddingHorizontal == "function" ? e.tilingPaddingHorizontal.call() : e.tilingPaddingHorizontal;
1945
- };
1946
- f.prototype.run = function() {
1947
- var e, t, n = this.options;
1948
- this.idToLNode = {};
1949
- var r = this.layout = new o(), i = this;
1950
- i.stopped = !1, this.cy = this.options.cy, this.cy.trigger({
1951
- type: "layoutstart",
1952
- layout: this
1953
- });
1954
- var a = r.newGraphManager();
1955
- this.gm = a;
1956
- var s = this.options.eles.nodes(), c = this.options.eles.edges();
1957
- this.root = a.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(s), r);
1958
- for (var l = 0; l < c.length; l++) {
1959
- var u = c[l], d = this.idToLNode[u.data("source")], f = this.idToLNode[u.data("target")];
1960
- if (d !== f && d.getEdgesBetween(f).length == 0) {
1961
- var p = a.add(r.newEdge(), d, f);
1962
- p.id = u.id();
1963
- }
1964
- }
1965
- var m = function(e, t) {
1966
- typeof e == "number" && (e = t);
1967
- var n = e.data("id"), r = i.idToLNode[n];
1968
- return {
1969
- x: r.getRect().getCenterX(),
1970
- y: r.getRect().getCenterY()
1971
- };
1972
- }, h = function a() {
1973
- for (var o = function() {
1974
- n.fit && n.cy.fit(n.eles, n.padding), e || (e = !0, i.cy.one("layoutready", n.ready), i.cy.trigger({
1975
- type: "layoutready",
1976
- layout: i
1977
- }));
1978
- }, s = i.options.refresh, c, l = 0; l < s && !c; l++) c = i.stopped || i.layout.tick();
1979
- if (c) {
1980
- r.checkLayoutSuccess() && !r.isSubLayout && r.doPostLayout(), r.tilingPostLayout && r.tilingPostLayout(), r.isLayoutFinished = !0, i.options.eles.nodes().positions(m), o(), i.cy.one("layoutstop", i.options.stop), i.cy.trigger({
1981
- type: "layoutstop",
1982
- layout: i
1983
- }), t && cancelAnimationFrame(t), e = !1;
1984
- return;
1985
- }
1986
- var u = i.layout.getPositionsData();
1987
- n.eles.nodes().positions(function(e, t) {
1988
- if (typeof e == "number" && (e = t), !e.isParent()) {
1989
- for (var n = e.id(), r = u[n], i = e; r == null && (r = u[i.data("parent")] || u["DummyCompound_" + i.data("parent")], u[n] = r, i = i.parent()[0], i != null););
1990
- return r == null ? {
1991
- x: e.position("x"),
1992
- y: e.position("y")
1993
- } : {
1994
- x: r.x,
1995
- y: r.y
1996
- };
1997
- }
1998
- }), o(), t = requestAnimationFrame(a);
1999
- };
2000
- return r.addListener("layoutstarted", function() {
2001
- i.options.animate === "during" && (t = requestAnimationFrame(h));
2002
- }), r.runLayout(), this.options.animate !== "during" && (i.options.eles.nodes().not(":parent").layoutPositions(i, i.options, m), e = !1), this;
2003
- }, f.prototype.getTopMostNodes = function(e) {
2004
- for (var t = {}, n = 0; n < e.length; n++) t[e[n].id()] = !0;
2005
- return e.filter(function(e, n) {
2006
- typeof e == "number" && (e = n);
2007
- for (var r = e.parent()[0]; r != null;) {
2008
- if (t[r.id()]) return !1;
2009
- r = r.parent()[0];
2010
- }
2011
- return !0;
2012
- });
2013
- }, f.prototype.processChildrenList = function(e, t, n) {
2014
- for (var r = t.length, i = 0; i < r; i++) {
2015
- var a = t[i], o = a.children(), u, d = a.layoutDimensions({ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels });
2016
- if (u = a.outerWidth() != null && a.outerHeight() != null ? e.add(new s(n.graphManager, new c(a.position("x") - d.w / 2, a.position("y") - d.h / 2), new l(parseFloat(d.w), parseFloat(d.h)))) : e.add(new s(this.graphManager)), u.id = a.data("id"), u.paddingLeft = parseInt(a.css("padding")), u.paddingTop = parseInt(a.css("padding")), u.paddingRight = parseInt(a.css("padding")), u.paddingBottom = parseInt(a.css("padding")), this.options.nodeDimensionsIncludeLabels && a.isParent()) {
2017
- var f = a.boundingBox({
2018
- includeLabels: !0,
2019
- includeNodes: !1
2020
- }).w, p = a.boundingBox({
2021
- includeLabels: !0,
2022
- includeNodes: !1
2023
- }).h, m = a.css("text-halign");
2024
- u.labelWidth = f, u.labelHeight = p, u.labelPos = m;
2025
- }
2026
- if (this.idToLNode[a.data("id")] = u, isNaN(u.rect.x) && (u.rect.x = 0), isNaN(u.rect.y) && (u.rect.y = 0), o != null && o.length > 0) {
2027
- var h = n.getGraphManager().add(n.newGraph(), u);
2028
- this.processChildrenList(h, o, n);
2029
- }
2030
- }
2031
- }, f.prototype.stop = function() {
2032
- return this.stopped = !0, this;
2033
- };
2034
- var m = function(e) {
2035
- e("layout", "cose-bilkent", f);
2036
- };
2037
- typeof cytoscape < "u" && m(cytoscape), e.exports = m;
2038
- })]);
2039
- });
2040
- })))(), 1);
2041
- i(), n(), l.use(f.default);
2042
- function p(e, t) {
2043
- e.forEach((e) => {
2044
- var n, r, i;
2045
- let a = {
2046
- id: e.id,
2047
- labelText: e.label,
2048
- height: e.height,
2049
- width: e.width,
2050
- padding: (n = e.padding) == null ? 0 : n
2051
- };
2052
- Object.keys(e).forEach((t) => {
2053
- [
2054
- "id",
2055
- "label",
2056
- "height",
2057
- "width",
2058
- "padding",
2059
- "x",
2060
- "y"
2061
- ].includes(t) || (a[t] = e[t]);
2062
- }), t.add({
2063
- group: "nodes",
2064
- data: a,
2065
- position: {
2066
- x: (r = e.x) == null ? 0 : r,
2067
- y: (i = e.y) == null ? 0 : i
2068
- }
2069
- });
2070
- });
2071
- }
2072
- o(p, "addNodes");
2073
- function m(e, t) {
2074
- e.forEach((e) => {
2075
- let n = {
2076
- id: e.id,
2077
- source: e.start,
2078
- target: e.end
2079
- };
2080
- Object.keys(e).forEach((t) => {
2081
- [
2082
- "id",
2083
- "start",
2084
- "end"
2085
- ].includes(t) || (n[t] = e[t]);
2086
- }), t.add({
2087
- group: "edges",
2088
- data: n
2089
- });
2090
- });
2091
- }
2092
- o(m, "addEdges");
2093
- function h(e) {
2094
- return new Promise((t) => {
2095
- let n = c("body").append("div").attr("id", "cy").attr("style", "display:none"), r = l({
2096
- container: document.getElementById("cy"),
2097
- style: [{
2098
- selector: "edge",
2099
- style: { "curve-style": "bezier" }
2100
- }]
2101
- });
2102
- n.remove(), p(e.nodes, r), m(e.edges, r), r.nodes().forEach(function(e) {
2103
- e.layoutDimensions = () => {
2104
- let t = e.data();
2105
- return {
2106
- w: t.width,
2107
- h: t.height
2108
- };
2109
- };
2110
- }), r.layout({
2111
- name: "cose-bilkent",
2112
- quality: "proof",
2113
- styleEnabled: !1,
2114
- animate: !1
2115
- }).run(), r.ready((e) => {
2116
- s.info("Cytoscape ready", e), t(r);
2117
- });
2118
- });
2119
- }
2120
- o(h, "createCytoscapeInstance");
2121
- function g(e) {
2122
- return e.nodes().map((e) => {
2123
- let t = e.data(), n = e.position(), r = {
2124
- id: t.id,
2125
- x: n.x,
2126
- y: n.y
2127
- };
2128
- return Object.keys(t).forEach((e) => {
2129
- e !== "id" && (r[e] = t[e]);
2130
- }), r;
2131
- });
2132
- }
2133
- o(g, "extractPositionedNodes");
2134
- function _(e) {
2135
- return e.edges().map((e) => {
2136
- let t = e.data(), n = e._private.rscratch, r = {
2137
- id: t.id,
2138
- source: t.source,
2139
- target: t.target,
2140
- startX: n.startX,
2141
- startY: n.startY,
2142
- midX: n.midX,
2143
- midY: n.midY,
2144
- endX: n.endX,
2145
- endY: n.endY
2146
- };
2147
- return Object.keys(t).forEach((e) => {
2148
- [
2149
- "id",
2150
- "source",
2151
- "target"
2152
- ].includes(e) || (r[e] = t[e]);
2153
- }), r;
2154
- });
2155
- }
2156
- o(_, "extractPositionedEdges");
2157
- function v(e, t) {
2158
- return y.apply(this, arguments);
2159
- }
2160
- function y() {
2161
- return y = a(function* (e, t) {
2162
- s.debug("Starting cose-bilkent layout algorithm");
2163
- try {
2164
- b(e);
2165
- let t = yield h(e), n = g(t), r = _(t);
2166
- return s.debug(`Layout completed: ${n.length} nodes, ${r.length} edges`), {
2167
- nodes: n,
2168
- edges: r
2169
- };
2170
- } catch (e) {
2171
- throw s.error("Error in cose-bilkent layout algorithm:", e), e;
2172
- }
2173
- }), y.apply(this, arguments);
2174
- }
2175
- o(v, "executeCoseBilkentLayout");
2176
- function b(e) {
2177
- if (!e) throw Error("Layout data is required");
2178
- if (!e.config) throw Error("Configuration is required in layout data");
2179
- if (!e.rootNode) throw Error("Root node is required");
2180
- if (!e.nodes || !Array.isArray(e.nodes)) throw Error("No nodes found in layout data");
2181
- if (!Array.isArray(e.edges)) throw Error("Edges array is required in layout data");
2182
- return !0;
2183
- }
2184
- o(b, "validateLayoutData");
2185
- var x = /* @__PURE__ */ o(function() {
2186
- var e = a(function* (e, t, { insertCluster: n, insertEdge: i, insertEdgeLabel: o, insertMarkers: s, insertNode: c, log: l, positionEdgeLabel: u }, { algorithm: d }) {
2187
- let f = {}, p = {}, m = t.select("g");
2188
- s(m, e.markers, e.type, e.diagramId);
2189
- let h = m.insert("g").attr("class", "subgraphs"), g = m.insert("g").attr("class", "edgePaths"), _ = m.insert("g").attr("class", "edgeLabels"), y = m.insert("g").attr("class", "nodes");
2190
- l.debug("Inserting nodes into DOM for dimension calculation"), yield Promise.all(e.nodes.map(function() {
2191
- var t = a(function* (t) {
2192
- if (t.isGroup) {
2193
- let e = r({}, t);
2194
- p[t.id] = e, f[t.id] = e, yield n(h, t);
2195
- } else {
2196
- let n = r({}, t);
2197
- f[t.id] = n;
2198
- let i = yield c(y, t, {
2199
- config: e.config,
2200
- dir: e.direction || "TB"
2201
- }), a = i.node().getBBox();
2202
- n.width = a.width, n.height = a.height, n.domId = i, l.debug(`Node ${t.id} dimensions: ${a.width}x${a.height}`);
2203
- }
2204
- });
2205
- return function(e) {
2206
- return t.apply(this, arguments);
2207
- };
2208
- }())), l.debug("Running cose-bilkent layout algorithm");
2209
- let b = yield v(r(r({}, e), {}, { nodes: e.nodes.map((e) => {
2210
- let t = f[e.id];
2211
- return r(r({}, e), {}, {
2212
- width: t.width,
2213
- height: t.height
2214
- });
2215
- }) }), e.config);
2216
- l.debug("Positioning nodes based on layout results"), b.nodes.forEach((e) => {
2217
- let t = f[e.id];
2218
- t != null && t.domId && (t.domId.attr("transform", `translate(${e.x}, ${e.y})`), t.x = e.x, t.y = e.y, l.debug(`Positioned node ${t.id} at center (${e.x}, ${e.y})`));
2219
- }), b.edges.forEach((t) => {
2220
- let n = e.edges.find((e) => e.id === t.id);
2221
- n && (n.points = [
2222
- {
2223
- x: t.startX,
2224
- y: t.startY
2225
- },
2226
- {
2227
- x: t.midX,
2228
- y: t.midY
2229
- },
2230
- {
2231
- x: t.endX,
2232
- y: t.endY
2233
- }
2234
- ]);
2235
- }), l.debug("Inserting and positioning edges"), yield Promise.all(e.edges.map(function() {
2236
- var t = a(function* (t) {
2237
- var n, a;
2238
- yield o(_, t);
2239
- let s = f[(n = t.start) == null ? "" : n], c = f[(a = t.end) == null ? "" : a];
2240
- if (s && c) {
2241
- let n = b.edges.find((e) => e.id === t.id);
2242
- if (n) {
2243
- l.debug("APA01 positionedEdge", n);
2244
- let a = r({}, t);
2245
- u(a, i(g, a, p, e.type, s, c, e.diagramId));
2246
- } else {
2247
- let n = r(r({}, t), {}, { points: [{
2248
- x: s.x || 0,
2249
- y: s.y || 0
2250
- }, {
2251
- x: c.x || 0,
2252
- y: c.y || 0
2253
- }] });
2254
- u(n, i(g, n, p, e.type, s, c, e.diagramId));
2255
- }
2256
- }
2257
- });
2258
- return function(e) {
2259
- return t.apply(this, arguments);
2260
- };
2261
- }())), l.debug("Cose-bilkent rendering completed");
2262
- });
2263
- return function(t, n, r, i) {
2264
- return e.apply(this, arguments);
2265
- };
2266
- }(), "render");
2267
- //#endregion
2268
- export { x as render };