@aiderdesk/aiderdesk 0.87.0 → 0.89.0

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 (223) hide show
  1. package/out/renderer/assets/2DXBBFLN-DhlZjS3f.js +666 -0
  2. package/out/renderer/assets/46IJ22JX-C1e8pvI2.js +853 -0
  3. package/out/renderer/assets/4TTDE5I4-Bea_IXhu.js +501 -0
  4. package/out/renderer/assets/4UF3HTLV-CVqcE2iq.js +29 -0
  5. package/out/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
  6. package/out/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
  7. package/out/renderer/assets/AAXQQPKT-BVbjBycX.js +1130 -0
  8. package/out/renderer/assets/AKE5O7KZ-Dr4O6i9X.js +184 -0
  9. package/out/renderer/assets/{AgentSettings-Cp7VI6CM.js → AgentSettings-ByYnHHTv.js} +710 -255
  10. package/out/renderer/assets/BNMLP6AG-CHDGj3j_.js +804 -0
  11. package/out/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
  12. package/out/renderer/assets/DR6PKOQU-C6a3Tq7K.js +301 -0
  13. package/out/renderer/assets/E4RJ7UJB-BQWgl9gv.js +441 -0
  14. package/out/renderer/assets/ELSXBIJH-CVPK3kX4.js +39 -0
  15. package/out/renderer/assets/ERTIBQVS-71_Ru0iJ.js +182 -0
  16. package/out/renderer/assets/F653G4FO-Dj2Ang6n.js +1497 -0
  17. package/out/renderer/assets/FKCDD66M-DCrQTwBi.js +205 -0
  18. package/out/renderer/assets/FP7KDXVC-DKVnH-En.js +221 -0
  19. package/out/renderer/assets/FT5I3RHX-hlTJy7Nw.js +243 -0
  20. package/out/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
  21. package/out/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
  22. package/out/renderer/assets/GY35JXOZ-cSi0MdIc.js +168 -0
  23. package/out/renderer/assets/H5EEJPP2-bpYW0xE8.js +353 -0
  24. package/out/renderer/assets/HWDLEDTA-uLGgs5fE.js +982 -0
  25. package/out/renderer/assets/{InfoIcon-DesJ60KC.js → InfoIcon-DI4teJbi.js} +1 -1
  26. package/out/renderer/assets/JZWSX6AR-B0pkfB2b.js +67 -0
  27. package/out/renderer/assets/KQOEJWJY-EQFQbIDt.js +84 -0
  28. package/out/renderer/assets/KS3BB3KE-DclWHpbY.js +138 -0
  29. package/out/renderer/assets/KXJRRZHI-CHoCRoQ4.js +502 -0
  30. package/out/renderer/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  31. package/out/renderer/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  32. package/out/renderer/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  33. package/out/renderer/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  34. package/out/renderer/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  35. package/out/renderer/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  36. package/out/renderer/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  37. package/out/renderer/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  38. package/out/renderer/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  39. package/out/renderer/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  40. package/out/renderer/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  41. package/out/renderer/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  42. package/out/renderer/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  43. package/out/renderer/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  44. package/out/renderer/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  45. package/out/renderer/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  46. package/out/renderer/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  47. package/out/renderer/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  48. package/out/renderer/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  49. package/out/renderer/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  50. package/out/renderer/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  51. package/out/renderer/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  52. package/out/renderer/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  53. package/out/renderer/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  54. package/out/renderer/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  55. package/out/renderer/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  56. package/out/renderer/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  57. package/out/renderer/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  58. package/out/renderer/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  59. package/out/renderer/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  60. package/out/renderer/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  61. package/out/renderer/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  62. package/out/renderer/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  63. package/out/renderer/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  64. package/out/renderer/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  65. package/out/renderer/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  66. package/out/renderer/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  67. package/out/renderer/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  68. package/out/renderer/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  69. package/out/renderer/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  70. package/out/renderer/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  71. package/out/renderer/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  72. package/out/renderer/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  73. package/out/renderer/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  74. package/out/renderer/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  75. package/out/renderer/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  76. package/out/renderer/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  77. package/out/renderer/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  78. package/out/renderer/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  79. package/out/renderer/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  80. package/out/renderer/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  81. package/out/renderer/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  82. package/out/renderer/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  83. package/out/renderer/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  84. package/out/renderer/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  85. package/out/renderer/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  86. package/out/renderer/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  87. package/out/renderer/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  88. package/out/renderer/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  89. package/out/renderer/assets/MFVI5XKI-TmPyVySZ.js +10 -0
  90. package/out/renderer/assets/MWY2J62P-BlVjis68.js +1102 -0
  91. package/out/renderer/assets/MXGNCBL2-HvKcixVr.js +216 -0
  92. package/out/renderer/assets/N6DAJLIZ-B0JHSPS3.js +120 -0
  93. package/out/renderer/assets/NU5M23IW-CWgVJ5o_.js +116 -0
  94. package/out/renderer/assets/NV4XNBIS-uOSoaYKk.js +1221 -0
  95. package/out/renderer/assets/OGLU4SIR-CiNpshB1.js +289 -0
  96. package/out/renderer/assets/OUNS5N76-C6p0zhvm.js +1064 -0
  97. package/out/renderer/assets/{Onboarding-B2h7iatR.js → Onboarding-Ct6-CF4Z.js} +4 -4
  98. package/out/renderer/assets/PU4ISKXV-BQc-2oYa.js +515 -0
  99. package/out/renderer/assets/PUZGS23X-Bf89SCAj.js +21 -0
  100. package/out/renderer/assets/{ProviderHeader-BvigqAWX.js → ProviderHeader-Buje398H.js} +2 -2
  101. package/out/renderer/assets/Q3IYVLG5-DbP4qs2C.js +500 -0
  102. package/out/renderer/assets/QYHQDLKZ-dANs6SeT.js +983 -0
  103. package/out/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
  104. package/out/renderer/assets/RZSVICHU-CeuX_9H4.js +263 -0
  105. package/out/renderer/assets/{SettingsPage-CBonY1bv.js → SettingsPage-CLpPKXG1.js} +978 -848
  106. package/out/renderer/assets/UEXXS2NB-Bmbum3yG.js +25 -0
  107. package/out/renderer/assets/UHTQJXKL-C2OuiQBx.js +134 -0
  108. package/out/renderer/assets/URA2L2QI-DJ2BF8fn.js +201 -0
  109. package/out/renderer/assets/UXCHDUKG-B6wMZRAn.js +173 -0
  110. package/out/renderer/assets/{UsageDashboard-DFgckoeT.js → UsageDashboard-ORnsHGxF.js} +9130 -6449
  111. package/out/renderer/assets/VKNV3BUX-BMK4lviM.js +277 -0
  112. package/out/renderer/assets/VMV7XPHP-CzHnUaWh.js +127 -0
  113. package/out/renderer/assets/WEVWDWVA-BYWYeLxq.js +57 -0
  114. package/out/renderer/assets/XRRJ35LF-DaeQ2kbN.js +119 -0
  115. package/out/renderer/assets/YFKBLVVN-DsXlM7HO.js +990 -0
  116. package/out/renderer/assets/YHRE5QGZ-nB9z3NP1.js +697 -0
  117. package/out/renderer/assets/ZF3OVT4B-Ctn5OOBd.js +420 -0
  118. package/out/renderer/assets/{index-BFhJk8dv.js → index-BCaQe4ny.js} +2 -2
  119. package/out/renderer/assets/{index-Dk4pOCFt.js → index-BD-JYQGT.js} +5 -5
  120. package/out/renderer/assets/{index-bNFXvWqr.js → index-BGR4ZXWZ.js} +2 -2
  121. package/out/renderer/assets/{index-BP0q4HOE.js → index-BZBhErKV.js} +2 -2
  122. package/out/renderer/assets/{index-x_iC3w5N.js → index-BcWszklu.js} +1 -1
  123. package/out/renderer/assets/{index-C8TOzJWw.js → index-BpNNugm2.js} +4 -4
  124. package/out/renderer/assets/{index-uAJ0Zw9K.js → index-BrgyIQaN.js} +2 -2
  125. package/out/renderer/assets/{index-CuQvDzzr.js → index-Bt1dN7k_.js} +1 -1
  126. package/out/renderer/assets/{index-BZmjwrvJ.js → index-Bxu6rqm3.js} +1 -1
  127. package/out/renderer/assets/{index-tNlkrDYM.js → index-C6mXHxX3.js} +1 -1
  128. package/out/renderer/assets/{index-Z71oMk_m.js → index-CCbq90uE.js} +1 -1
  129. package/out/renderer/assets/{index-DE2koGci.js → index-CCm3UXZP.js} +2 -2
  130. package/out/renderer/assets/{index-DKNYbwcH.js → index-CNkiGtsK.js} +3 -3
  131. package/out/renderer/assets/{index-D_o1aMFn.css → index-CWfnJXNI.css} +130 -0
  132. package/out/renderer/assets/{index-47ZLfCU8.js → index-Cc-He418.js} +72999 -82151
  133. package/out/renderer/assets/{index-Dx6kKrXY.js → index-Crdzxx6k.js} +19 -15
  134. package/out/renderer/assets/{index-B_PkNLqT.js → index-D30k3y98.js} +1 -1
  135. package/out/renderer/assets/{index-CasrGDb0.js → index-DAWoHfjM.js} +2 -2
  136. package/out/renderer/assets/{index-D-rE7YVD.js → index-DG5AIC6J.js} +3 -3
  137. package/out/renderer/assets/{index-BzOM6AUj.js → index-DSBgCNMv.js} +2 -2
  138. package/out/renderer/assets/{index-C1I2Idqy.js → index-DeRKeskE.js} +5 -5
  139. package/out/renderer/assets/{index-Bh4xfAPL.js → index-DgQEgdew.js} +2 -2
  140. package/out/renderer/assets/{index-BKmr7UTW.js → index-Dgdp4i2K.js} +1 -1
  141. package/out/renderer/assets/{index-Bbv79qeB.js → index-DnNK6R2g.js} +2 -2
  142. package/out/renderer/assets/{index-CiIr--kg.js → index-DrNutodm.js} +2 -2
  143. package/out/renderer/assets/{index-B2jZTTYL.js → index-FS3mY8Ct.js} +1 -1
  144. package/out/renderer/assets/{index-DvSWnCZD.js → index-KId2jLzt.js} +2 -2
  145. package/out/renderer/assets/{index-DWZF-uSf.js → index-PyRCX6hq.js} +5 -5
  146. package/out/renderer/assets/{index-J-dLn6uq.js → index-U8nE80jx.js} +2 -2
  147. package/out/renderer/assets/{index-cO9XeYPQ.js → index-Vw8jKJU_.js} +5 -5
  148. package/out/renderer/assets/{index-B9bf5T9j.js → index-_a6zbU-0.js} +1 -1
  149. package/out/renderer/assets/{index-CenYyetH.js → index-dsqlqRSG.js} +5 -5
  150. package/out/renderer/assets/{index-D4dhIRp1.js → index-rQL1hwaP.js} +5 -5
  151. package/out/renderer/assets/{jsx-dev-runtime-CtvYhMha.js → jsx-dev-runtime-Bwt8d4vP.js} +1 -1
  152. package/out/renderer/index.html +2 -2
  153. package/out/resources/prompts/system-prompt.hbs +11 -0
  154. package/out/resources/skills/extension-creator/SKILL.md +20 -1
  155. package/out/resources/skills/extension-creator/references/event-types.md +5 -3
  156. package/out/resources/skills/extension-creator/references/extension-interface.md +62 -1
  157. package/out/resources/skills/extension-creator/references/external-agent-providers.md +90 -0
  158. package/out/runner.js +2016 -615
  159. package/package.json +3 -3
  160. package/out/renderer/assets/abnfDiagram-N423BO3Z-DV7pjob8.js +0 -118
  161. package/out/renderer/assets/arc-C2NyJjKR.js +0 -131
  162. package/out/renderer/assets/architectureDiagram-T3A2C74G-BmG8PHmc.js +0 -8829
  163. package/out/renderer/assets/band-zXq5o_Ib.js +0 -77
  164. package/out/renderer/assets/blockDiagram-VBNYF7ZC-CJndPtzf.js +0 -3824
  165. package/out/renderer/assets/c4Diagram-5PPSVZJV-B9DY2Hnr.js +0 -2482
  166. package/out/renderer/assets/channel-CCPkBLnh.js +0 -7
  167. package/out/renderer/assets/chunk-2GRJ4B5K-Bt46bDfT.js +0 -116
  168. package/out/renderer/assets/chunk-2Q5K7J3B-DkQwfKC2.js +0 -19
  169. package/out/renderer/assets/chunk-5RXB4S5H-CFNEWvlR.js +0 -1988
  170. package/out/renderer/assets/chunk-5VM5RSS4-BNeZg_6d.js +0 -19
  171. package/out/renderer/assets/chunk-6Q2QTUOP-BU5gT8Us.js +0 -860
  172. package/out/renderer/assets/chunk-GF5L2VYU-BNML5JwJ.js +0 -2026
  173. package/out/renderer/assets/chunk-JWPE2WC7-Dvih3ku3.js +0 -16
  174. package/out/renderer/assets/chunk-KBJHAD2P-CMgAbRkQ.js +0 -24
  175. package/out/renderer/assets/chunk-RYQCIY6F-CAJ6Qldz.js +0 -474
  176. package/out/renderer/assets/chunk-XXDRQBXY-BDZJ-WFV.js +0 -13
  177. package/out/renderer/assets/classDiagram-JCYQIIEL-BJCilkUQ.js +0 -23
  178. package/out/renderer/assets/classDiagram-v2-OCEON4UE-BJCilkUQ.js +0 -23
  179. package/out/renderer/assets/cose-bilkent-JH36ORCC-D6MsqBP5.js +0 -4942
  180. package/out/renderer/assets/cynefin-VYW2F7L2-3kPlVPG0.js +0 -32093
  181. package/out/renderer/assets/cynefinDiagram-MW4NZA55-6BlkJqWN.js +0 -453
  182. package/out/renderer/assets/cytoscape.esm-Bx_1tVW-.js +0 -30332
  183. package/out/renderer/assets/dagre-VZM6K2ZE-Chj1W0as.js +0 -522
  184. package/out/renderer/assets/defaultLocale-B2RvLBDe.js +0 -206
  185. package/out/renderer/assets/diagram-7IWD3JNH-CHFj7vIm.js +0 -488
  186. package/out/renderer/assets/diagram-B4RE2ZJO-BqOMO30m.js +0 -632
  187. package/out/renderer/assets/diagram-LBJQPF4R-CkiuQM5K.js +0 -212
  188. package/out/renderer/assets/diagram-Q27KOJAE-WVbpb4Iq.js +0 -857
  189. package/out/renderer/assets/diagram-UB23O5K3-B9Q0wQI3.js +0 -311
  190. package/out/renderer/assets/ebnfDiagram-BXEA7PRR-BUhf1ZxU.js +0 -138
  191. package/out/renderer/assets/erDiagram-JOGREHBK-DGxWkssI.js +0 -1238
  192. package/out/renderer/assets/flowDiagram-UKHOOZJN-D3ul5aGG.js +0 -2348
  193. package/out/renderer/assets/ganttDiagram-PKOTCBZU-BD3VbhAZ.js +0 -2782
  194. package/out/renderer/assets/gitGraphDiagram-DS77QQ5N-x-7NMw7v.js +0 -1373
  195. package/out/renderer/assets/graph-BDbmSegI.js +0 -1308
  196. package/out/renderer/assets/infoDiagram-6WML65LV-BMwbA6CU.js +0 -31
  197. package/out/renderer/assets/init-CTO7spbL.js +0 -35
  198. package/out/renderer/assets/ishikawaDiagram-WSZJBQD7-Bx90Gz0s.js +0 -967
  199. package/out/renderer/assets/journeyDiagram-NVQOT4AX-Dh4pUAU5.js +0 -1255
  200. package/out/renderer/assets/kanban-definition-27J2QSJJ-BZ_lX-ko.js +0 -1052
  201. package/out/renderer/assets/katex-oVG3DVWa.js +0 -14499
  202. package/out/renderer/assets/layout-oaOUFeBM.js +0 -2326
  203. package/out/renderer/assets/linear-B2eGZpM_.js +0 -361
  204. package/out/renderer/assets/map-BijQCI9U.js +0 -299
  205. package/out/renderer/assets/mindmap-definition-FAOFIHXS-BeWZh5qg.js +0 -1153
  206. package/out/renderer/assets/ordinal-BD3Y6v77.js +0 -77
  207. package/out/renderer/assets/pegDiagram-VL7TDLO6-BA6NzzN6.js +0 -126
  208. package/out/renderer/assets/pieDiagram-7S7Q4E2Y-KJmT5t-P.js +0 -316
  209. package/out/renderer/assets/quadrantDiagram-CIZ2JOQS-BdFz_bQU.js +0 -1343
  210. package/out/renderer/assets/railroadDiagram-AXF67PYL-CbH2ZZ1S.js +0 -92
  211. package/out/renderer/assets/requirementDiagram-LRYGKXZP-BZXG5Vgf.js +0 -1204
  212. package/out/renderer/assets/sankeyDiagram-W5VNT64P-CV1Upv22.js +0 -1274
  213. package/out/renderer/assets/sequenceDiagram-SI44F4Z6-Csbi3ivi.js +0 -4514
  214. package/out/renderer/assets/sizeCapture-X5ZJPWSS-CaN4k1d3.js +0 -62
  215. package/out/renderer/assets/stateDiagram-OKZ733FA-DSo1KeOQ.js +0 -452
  216. package/out/renderer/assets/stateDiagram-v2-UEYNNEHI-BhXw89HT.js +0 -22
  217. package/out/renderer/assets/swimlanes-SLNWSIFB-p3GZ-wkU.js +0 -8557
  218. package/out/renderer/assets/swimlanesDiagram-ULZ7WXOC-DGBdyiqy.js +0 -20
  219. package/out/renderer/assets/time-4LaKa9ym.js +0 -985
  220. package/out/renderer/assets/timeline-definition-Z64GVDOM-DfY8hG5p.js +0 -1596
  221. package/out/renderer/assets/vennDiagram-T6HMQDX7-wp87GaTi.js +0 -2515
  222. package/out/renderer/assets/wardleyDiagram-T6FBY63Y-DNrC2vOI.js +0 -975
  223. package/out/renderer/assets/xychartDiagram-ELKLHX3M-Bn8J2SKt.js +0 -1943
@@ -1,857 +0,0 @@
1
- import { p as populateCommonDb } from "./chunk-JWPE2WC7-Dvih3ku3.js";
2
- import { _ as __name, ao as getThemeVariables3, a3 as getConfig, a5 as cleanAndMerge, a8 as selectSvgElement, B as configureSvgSize, A as log, dd as styles2String, z as select, x as setAccTitle, w as getAccTitle, V as setDiagramTitle, W as getDiagramTitle, v as getAccDescription, u as setAccDescription, a6 as defaultConfig_default, de as isLabelStyle, X as clear } from "./index-47ZLfCU8.js";
3
- import { s as setupViewPortForSVG } from "./chunk-KBJHAD2P-CMgAbRkQ.js";
4
- import { p as parse } from "./cynefin-VYW2F7L2-3kPlVPG0.js";
5
- import { b as format } from "./defaultLocale-B2RvLBDe.js";
6
- import { o as ordinal } from "./ordinal-BD3Y6v77.js";
7
- import "./init-CTO7spbL.js";
8
- function count(node) {
9
- var sum = 0, children = node.children, i = children && children.length;
10
- if (!i) sum = 1;
11
- else while (--i >= 0) sum += children[i].value;
12
- node.value = sum;
13
- }
14
- function node_count() {
15
- return this.eachAfter(count);
16
- }
17
- function node_each(callback, that) {
18
- let index = -1;
19
- for (const node of this) {
20
- callback.call(that, node, ++index, this);
21
- }
22
- return this;
23
- }
24
- function node_eachBefore(callback, that) {
25
- var node = this, nodes = [node], children, i, index = -1;
26
- while (node = nodes.pop()) {
27
- callback.call(that, node, ++index, this);
28
- if (children = node.children) {
29
- for (i = children.length - 1; i >= 0; --i) {
30
- nodes.push(children[i]);
31
- }
32
- }
33
- }
34
- return this;
35
- }
36
- function node_eachAfter(callback, that) {
37
- var node = this, nodes = [node], next = [], children, i, n, index = -1;
38
- while (node = nodes.pop()) {
39
- next.push(node);
40
- if (children = node.children) {
41
- for (i = 0, n = children.length; i < n; ++i) {
42
- nodes.push(children[i]);
43
- }
44
- }
45
- }
46
- while (node = next.pop()) {
47
- callback.call(that, node, ++index, this);
48
- }
49
- return this;
50
- }
51
- function node_find(callback, that) {
52
- let index = -1;
53
- for (const node of this) {
54
- if (callback.call(that, node, ++index, this)) {
55
- return node;
56
- }
57
- }
58
- }
59
- function node_sum(value) {
60
- return this.eachAfter(function(node) {
61
- var sum = +value(node.data) || 0, children = node.children, i = children && children.length;
62
- while (--i >= 0) sum += children[i].value;
63
- node.value = sum;
64
- });
65
- }
66
- function node_sort(compare) {
67
- return this.eachBefore(function(node) {
68
- if (node.children) {
69
- node.children.sort(compare);
70
- }
71
- });
72
- }
73
- function node_path(end) {
74
- var start = this, ancestor = leastCommonAncestor(start, end), nodes = [start];
75
- while (start !== ancestor) {
76
- start = start.parent;
77
- nodes.push(start);
78
- }
79
- var k = nodes.length;
80
- while (end !== ancestor) {
81
- nodes.splice(k, 0, end);
82
- end = end.parent;
83
- }
84
- return nodes;
85
- }
86
- function leastCommonAncestor(a, b) {
87
- if (a === b) return a;
88
- var aNodes = a.ancestors(), bNodes = b.ancestors(), c = null;
89
- a = aNodes.pop();
90
- b = bNodes.pop();
91
- while (a === b) {
92
- c = a;
93
- a = aNodes.pop();
94
- b = bNodes.pop();
95
- }
96
- return c;
97
- }
98
- function node_ancestors() {
99
- var node = this, nodes = [node];
100
- while (node = node.parent) {
101
- nodes.push(node);
102
- }
103
- return nodes;
104
- }
105
- function node_descendants() {
106
- return Array.from(this);
107
- }
108
- function node_leaves() {
109
- var leaves = [];
110
- this.eachBefore(function(node) {
111
- if (!node.children) {
112
- leaves.push(node);
113
- }
114
- });
115
- return leaves;
116
- }
117
- function node_links() {
118
- var root = this, links = [];
119
- root.each(function(node) {
120
- if (node !== root) {
121
- links.push({ source: node.parent, target: node });
122
- }
123
- });
124
- return links;
125
- }
126
- function* node_iterator() {
127
- var node = this, current, next = [node], children, i, n;
128
- do {
129
- current = next.reverse(), next = [];
130
- while (node = current.pop()) {
131
- yield node;
132
- if (children = node.children) {
133
- for (i = 0, n = children.length; i < n; ++i) {
134
- next.push(children[i]);
135
- }
136
- }
137
- }
138
- } while (next.length);
139
- }
140
- function hierarchy(data, children) {
141
- if (data instanceof Map) {
142
- data = [void 0, data];
143
- if (children === void 0) children = mapChildren;
144
- } else if (children === void 0) {
145
- children = objectChildren;
146
- }
147
- var root = new Node(data), node, nodes = [root], child, childs, i, n;
148
- while (node = nodes.pop()) {
149
- if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {
150
- node.children = childs;
151
- for (i = n - 1; i >= 0; --i) {
152
- nodes.push(child = childs[i] = new Node(childs[i]));
153
- child.parent = node;
154
- child.depth = node.depth + 1;
155
- }
156
- }
157
- }
158
- return root.eachBefore(computeHeight);
159
- }
160
- function node_copy() {
161
- return hierarchy(this).eachBefore(copyData);
162
- }
163
- function objectChildren(d) {
164
- return d.children;
165
- }
166
- function mapChildren(d) {
167
- return Array.isArray(d) ? d[1] : null;
168
- }
169
- function copyData(node) {
170
- if (node.data.value !== void 0) node.value = node.data.value;
171
- node.data = node.data.data;
172
- }
173
- function computeHeight(node) {
174
- var height = 0;
175
- do
176
- node.height = height;
177
- while ((node = node.parent) && node.height < ++height);
178
- }
179
- function Node(data) {
180
- this.data = data;
181
- this.depth = this.height = 0;
182
- this.parent = null;
183
- }
184
- Node.prototype = hierarchy.prototype = {
185
- constructor: Node,
186
- count: node_count,
187
- each: node_each,
188
- eachAfter: node_eachAfter,
189
- eachBefore: node_eachBefore,
190
- find: node_find,
191
- sum: node_sum,
192
- sort: node_sort,
193
- path: node_path,
194
- ancestors: node_ancestors,
195
- descendants: node_descendants,
196
- leaves: node_leaves,
197
- links: node_links,
198
- copy: node_copy,
199
- [Symbol.iterator]: node_iterator
200
- };
201
- function required(f) {
202
- if (typeof f !== "function") throw new Error();
203
- return f;
204
- }
205
- function constantZero() {
206
- return 0;
207
- }
208
- function constant(x) {
209
- return function() {
210
- return x;
211
- };
212
- }
213
- function roundNode(node) {
214
- node.x0 = Math.round(node.x0);
215
- node.y0 = Math.round(node.y0);
216
- node.x1 = Math.round(node.x1);
217
- node.y1 = Math.round(node.y1);
218
- }
219
- function treemapDice(parent, x0, y0, x1, y1) {
220
- var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (x1 - x0) / parent.value;
221
- while (++i < n) {
222
- node = nodes[i], node.y0 = y0, node.y1 = y1;
223
- node.x0 = x0, node.x1 = x0 += node.value * k;
224
- }
225
- }
226
- function treemapSlice(parent, x0, y0, x1, y1) {
227
- var nodes = parent.children, node, i = -1, n = nodes.length, k = parent.value && (y1 - y0) / parent.value;
228
- while (++i < n) {
229
- node = nodes[i], node.x0 = x0, node.x1 = x1;
230
- node.y0 = y0, node.y1 = y0 += node.value * k;
231
- }
232
- }
233
- var phi = (1 + Math.sqrt(5)) / 2;
234
- function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
235
- var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n = nodes.length, dx, dy, value = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
236
- while (i0 < n) {
237
- dx = x1 - x0, dy = y1 - y0;
238
- do
239
- sumValue = nodes[i1++].value;
240
- while (!sumValue && i1 < n);
241
- minValue = maxValue = sumValue;
242
- alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
243
- beta = sumValue * sumValue * alpha;
244
- minRatio = Math.max(maxValue / beta, beta / minValue);
245
- for (; i1 < n; ++i1) {
246
- sumValue += nodeValue = nodes[i1].value;
247
- if (nodeValue < minValue) minValue = nodeValue;
248
- if (nodeValue > maxValue) maxValue = nodeValue;
249
- beta = sumValue * sumValue * alpha;
250
- newRatio = Math.max(maxValue / beta, beta / minValue);
251
- if (newRatio > minRatio) {
252
- sumValue -= nodeValue;
253
- break;
254
- }
255
- minRatio = newRatio;
256
- }
257
- rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
258
- if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
259
- else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
260
- value -= sumValue, i0 = i1;
261
- }
262
- return rows;
263
- }
264
- const squarify = (function custom(ratio) {
265
- function squarify2(parent, x0, y0, x1, y1) {
266
- squarifyRatio(ratio, parent, x0, y0, x1, y1);
267
- }
268
- squarify2.ratio = function(x) {
269
- return custom((x = +x) > 1 ? x : 1);
270
- };
271
- return squarify2;
272
- })(phi);
273
- function treemap() {
274
- var tile = squarify, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
275
- function treemap2(root) {
276
- root.x0 = root.y0 = 0;
277
- root.x1 = dx;
278
- root.y1 = dy;
279
- root.eachBefore(positionNode);
280
- paddingStack = [0];
281
- if (round) root.eachBefore(roundNode);
282
- return root;
283
- }
284
- function positionNode(node) {
285
- var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
286
- if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
287
- if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
288
- node.x0 = x0;
289
- node.y0 = y0;
290
- node.x1 = x1;
291
- node.y1 = y1;
292
- if (node.children) {
293
- p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
294
- x0 += paddingLeft(node) - p;
295
- y0 += paddingTop(node) - p;
296
- x1 -= paddingRight(node) - p;
297
- y1 -= paddingBottom(node) - p;
298
- if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
299
- if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
300
- tile(node, x0, y0, x1, y1);
301
- }
302
- }
303
- treemap2.round = function(x) {
304
- return arguments.length ? (round = !!x, treemap2) : round;
305
- };
306
- treemap2.size = function(x) {
307
- return arguments.length ? (dx = +x[0], dy = +x[1], treemap2) : [dx, dy];
308
- };
309
- treemap2.tile = function(x) {
310
- return arguments.length ? (tile = required(x), treemap2) : tile;
311
- };
312
- treemap2.padding = function(x) {
313
- return arguments.length ? treemap2.paddingInner(x).paddingOuter(x) : treemap2.paddingInner();
314
- };
315
- treemap2.paddingInner = function(x) {
316
- return arguments.length ? (paddingInner = typeof x === "function" ? x : constant(+x), treemap2) : paddingInner;
317
- };
318
- treemap2.paddingOuter = function(x) {
319
- return arguments.length ? treemap2.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap2.paddingTop();
320
- };
321
- treemap2.paddingTop = function(x) {
322
- return arguments.length ? (paddingTop = typeof x === "function" ? x : constant(+x), treemap2) : paddingTop;
323
- };
324
- treemap2.paddingRight = function(x) {
325
- return arguments.length ? (paddingRight = typeof x === "function" ? x : constant(+x), treemap2) : paddingRight;
326
- };
327
- treemap2.paddingBottom = function(x) {
328
- return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant(+x), treemap2) : paddingBottom;
329
- };
330
- treemap2.paddingLeft = function(x) {
331
- return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant(+x), treemap2) : paddingLeft;
332
- };
333
- return treemap2;
334
- }
335
- var TreeMapDB = class {
336
- constructor() {
337
- this.nodes = [];
338
- this.levels = /* @__PURE__ */ new Map();
339
- this.outerNodes = [];
340
- this.classes = /* @__PURE__ */ new Map();
341
- this.setAccTitle = setAccTitle;
342
- this.getAccTitle = getAccTitle;
343
- this.setDiagramTitle = setDiagramTitle;
344
- this.getDiagramTitle = getDiagramTitle;
345
- this.getAccDescription = getAccDescription;
346
- this.setAccDescription = setAccDescription;
347
- }
348
- static {
349
- __name(this, "TreeMapDB");
350
- }
351
- getNodes() {
352
- return this.nodes;
353
- }
354
- getConfig() {
355
- const defaultConfig = defaultConfig_default;
356
- const userConfig = getConfig();
357
- return cleanAndMerge({
358
- ...defaultConfig.treemap,
359
- ...userConfig.treemap ?? {}
360
- });
361
- }
362
- addNode(node, level) {
363
- this.nodes.push(node);
364
- this.levels.set(node, level);
365
- if (level === 0) {
366
- this.outerNodes.push(node);
367
- this.root ??= node;
368
- }
369
- }
370
- getRoot() {
371
- return { name: "", children: this.outerNodes };
372
- }
373
- addClass(id, _style) {
374
- const styleClass = this.classes.get(id) ?? { id, styles: [], textStyles: [] };
375
- const styles = _style.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
376
- if (styles) {
377
- styles.forEach((s) => {
378
- if (isLabelStyle(s)) {
379
- if (styleClass?.textStyles) {
380
- styleClass.textStyles.push(s);
381
- } else {
382
- styleClass.textStyles = [s];
383
- }
384
- }
385
- if (styleClass?.styles) {
386
- styleClass.styles.push(s);
387
- } else {
388
- styleClass.styles = [s];
389
- }
390
- });
391
- }
392
- this.classes.set(id, styleClass);
393
- }
394
- getClasses() {
395
- return this.classes;
396
- }
397
- getStylesForClass(classSelector) {
398
- return this.classes.get(classSelector)?.styles ?? [];
399
- }
400
- clear() {
401
- clear();
402
- this.nodes = [];
403
- this.levels = /* @__PURE__ */ new Map();
404
- this.outerNodes = [];
405
- this.classes = /* @__PURE__ */ new Map();
406
- this.root = void 0;
407
- }
408
- };
409
- function buildHierarchy(items) {
410
- if (!items.length) {
411
- return [];
412
- }
413
- const root = [];
414
- const stack = [];
415
- items.forEach((item) => {
416
- const node = {
417
- name: item.name,
418
- children: item.type === "Leaf" ? void 0 : []
419
- };
420
- node.classSelector = item?.classSelector;
421
- if (item?.cssCompiledStyles) {
422
- node.cssCompiledStyles = item.cssCompiledStyles;
423
- }
424
- if (item.type === "Leaf" && item.value !== void 0) {
425
- node.value = item.value;
426
- }
427
- while (stack.length > 0 && stack[stack.length - 1].level >= item.level) {
428
- stack.pop();
429
- }
430
- if (stack.length === 0) {
431
- root.push(node);
432
- } else {
433
- const parent = stack[stack.length - 1].node;
434
- if (parent.children) {
435
- parent.children.push(node);
436
- } else {
437
- parent.children = [node];
438
- }
439
- }
440
- if (item.type !== "Leaf") {
441
- stack.push({ node, level: item.level });
442
- }
443
- });
444
- return root;
445
- }
446
- __name(buildHierarchy, "buildHierarchy");
447
- var populate = /* @__PURE__ */ __name((ast, db) => {
448
- populateCommonDb(ast, db);
449
- const items = [];
450
- for (const row of ast.TreemapRows ?? []) {
451
- if (row.$type === "ClassDefStatement") {
452
- db.addClass(row.className ?? "", row.styleText ?? "");
453
- }
454
- }
455
- for (const row of ast.TreemapRows ?? []) {
456
- const item = row.item;
457
- if (!item) {
458
- continue;
459
- }
460
- const level = row.indent ? parseInt(row.indent) : 0;
461
- const name = getItemName(item);
462
- const styles = item.classSelector ? db.getStylesForClass(item.classSelector) : [];
463
- const cssCompiledStyles = styles.length > 0 ? styles : void 0;
464
- const itemData = {
465
- level,
466
- name,
467
- type: item.$type,
468
- value: item.value,
469
- classSelector: item.classSelector,
470
- cssCompiledStyles
471
- };
472
- items.push(itemData);
473
- }
474
- const hierarchyNodes = buildHierarchy(items);
475
- const addNodesRecursively = /* @__PURE__ */ __name((nodes, level) => {
476
- for (const node of nodes) {
477
- db.addNode(node, level);
478
- if (node.children && node.children.length > 0) {
479
- addNodesRecursively(node.children, level + 1);
480
- }
481
- }
482
- }, "addNodesRecursively");
483
- addNodesRecursively(hierarchyNodes, 0);
484
- }, "populate");
485
- var getItemName = /* @__PURE__ */ __name((item) => {
486
- return item.name ? String(item.name) : "";
487
- }, "getItemName");
488
- var parser = {
489
- // @ts-expect-error - TreeMapDB is not assignable to DiagramDB
490
- parser: { yy: void 0 },
491
- parse: /* @__PURE__ */ __name(async (text) => {
492
- try {
493
- const parseFunc = parse;
494
- const ast = await parseFunc("treemap", text);
495
- log.debug("Treemap AST:", ast);
496
- const db = parser.parser?.yy;
497
- if (!(db instanceof TreeMapDB)) {
498
- throw new Error(
499
- "parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
500
- );
501
- }
502
- populate(ast, db);
503
- } catch (error) {
504
- log.error("Error parsing treemap:", error);
505
- throw error;
506
- }
507
- }, "parse")
508
- };
509
- var DEFAULT_INNER_PADDING = 10;
510
- var SECTION_INNER_PADDING = 10;
511
- var SECTION_HEADER_HEIGHT = 25;
512
- var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
513
- const treemapDb = diagram2.db;
514
- const config = treemapDb.getConfig();
515
- const treemapInnerPadding = config.padding ?? DEFAULT_INNER_PADDING;
516
- const title = treemapDb.getDiagramTitle();
517
- const root = treemapDb.getRoot();
518
- const { themeVariables } = getConfig();
519
- if (!root) {
520
- return;
521
- }
522
- const titleHeight = title ? 30 : 0;
523
- const svg = selectSvgElement(id);
524
- const width = config.nodeWidth ? config.nodeWidth * SECTION_INNER_PADDING : 960;
525
- const height = config.nodeHeight ? config.nodeHeight * SECTION_INNER_PADDING : 500;
526
- const svgWidth = width;
527
- const svgHeight = height + titleHeight;
528
- svg.attr("viewBox", `0 0 ${svgWidth} ${svgHeight}`);
529
- configureSvgSize(svg, svgHeight, svgWidth, config.useMaxWidth);
530
- let valueFormat;
531
- try {
532
- const formatStr = config.valueFormat || ",";
533
- if (formatStr === "$0,0") {
534
- valueFormat = /* @__PURE__ */ __name((value) => "$" + format(",")(value), "valueFormat");
535
- } else if (formatStr.startsWith("$") && formatStr.includes(",")) {
536
- const precision = /\.\d+/.exec(formatStr);
537
- const precisionStr = precision ? precision[0] : "";
538
- valueFormat = /* @__PURE__ */ __name((value) => "$" + format("," + precisionStr)(value), "valueFormat");
539
- } else if (formatStr.startsWith("$")) {
540
- const restOfFormat = formatStr.substring(1);
541
- valueFormat = /* @__PURE__ */ __name((value) => "$" + format(restOfFormat || "")(value), "valueFormat");
542
- } else {
543
- valueFormat = format(formatStr);
544
- }
545
- } catch (error) {
546
- log.error("Error creating format function:", error);
547
- valueFormat = format(",");
548
- }
549
- const colorScale = ordinal().range([
550
- "transparent",
551
- themeVariables.cScale0,
552
- themeVariables.cScale1,
553
- themeVariables.cScale2,
554
- themeVariables.cScale3,
555
- themeVariables.cScale4,
556
- themeVariables.cScale5,
557
- themeVariables.cScale6,
558
- themeVariables.cScale7,
559
- themeVariables.cScale8,
560
- themeVariables.cScale9,
561
- themeVariables.cScale10,
562
- themeVariables.cScale11
563
- ]);
564
- const colorScalePeer = ordinal().range([
565
- "transparent",
566
- themeVariables.cScalePeer0,
567
- themeVariables.cScalePeer1,
568
- themeVariables.cScalePeer2,
569
- themeVariables.cScalePeer3,
570
- themeVariables.cScalePeer4,
571
- themeVariables.cScalePeer5,
572
- themeVariables.cScalePeer6,
573
- themeVariables.cScalePeer7,
574
- themeVariables.cScalePeer8,
575
- themeVariables.cScalePeer9,
576
- themeVariables.cScalePeer10,
577
- themeVariables.cScalePeer11
578
- ]);
579
- const colorScaleLabel = ordinal().range([
580
- themeVariables.cScaleLabel0,
581
- themeVariables.cScaleLabel1,
582
- themeVariables.cScaleLabel2,
583
- themeVariables.cScaleLabel3,
584
- themeVariables.cScaleLabel4,
585
- themeVariables.cScaleLabel5,
586
- themeVariables.cScaleLabel6,
587
- themeVariables.cScaleLabel7,
588
- themeVariables.cScaleLabel8,
589
- themeVariables.cScaleLabel9,
590
- themeVariables.cScaleLabel10,
591
- themeVariables.cScaleLabel11
592
- ]);
593
- if (title) {
594
- svg.append("text").attr("x", svgWidth / 2).attr("y", titleHeight / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(title);
595
- }
596
- const g = svg.append("g").attr("transform", `translate(0, ${titleHeight})`).attr("class", "treemapContainer");
597
- const hierarchyRoot = hierarchy(root).sum((d) => d.value ?? 0).sort((a, b) => (b.value ?? 0) - (a.value ?? 0));
598
- const treemapLayout = treemap().size([width, height]).paddingTop(
599
- (d) => d.children && d.children.length > 0 ? SECTION_HEADER_HEIGHT + SECTION_INNER_PADDING : 0
600
- ).paddingInner(treemapInnerPadding).paddingLeft((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).paddingRight((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).paddingBottom((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).round(true);
601
- const treemapData = treemapLayout(hierarchyRoot);
602
- const branchNodes = treemapData.descendants().filter((d) => d.children && d.children.length > 0);
603
- const sections = g.selectAll(".treemapSection").data(branchNodes).enter().append("g").attr("class", "treemapSection").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
604
- sections.append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", SECTION_HEADER_HEIGHT).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (d) => {
605
- if (d.depth === 0) {
606
- return "display: none;";
607
- }
608
- return "";
609
- });
610
- sections.append("clipPath").attr("id", (_d, i) => `clip-section-${id}-${i}`).append("rect").attr("width", (d) => Math.max(0, d.x1 - d.x0 - 12)).attr("height", SECTION_HEADER_HEIGHT);
611
- sections.append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).attr("class", (_d, i) => {
612
- return `treemapSection section${i}`;
613
- }).attr("fill", (d) => colorScale(d.data.name)).attr("fill-opacity", 0.6).attr("stroke", (d) => colorScalePeer(d.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (d) => {
614
- if (d.depth === 0) {
615
- return "display: none;";
616
- }
617
- const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
618
- return styles.nodeStyles + ";" + styles.borderStyles.join(";");
619
- });
620
- sections.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", SECTION_HEADER_HEIGHT / 2).attr("dominant-baseline", "middle").text((d) => d.depth === 0 ? "" : d.data.name).attr("font-weight", "bold").attr("clip-path", (_d, i) => `url(#clip-section-${id}-${i})`).attr("style", (d) => {
621
- if (d.depth === 0) {
622
- return "display: none;";
623
- }
624
- const labelStyles = "dominant-baseline: middle; font-size: 12px; fill:" + colorScaleLabel(d.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";
625
- const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
626
- return labelStyles + styles.labelStyles.replace("color:", "fill:");
627
- }).each(function(d) {
628
- if (d.depth === 0) {
629
- return;
630
- }
631
- const self = select(this);
632
- const originalText = d.data.name;
633
- self.text(originalText);
634
- const totalHeaderWidth = d.x1 - d.x0;
635
- const labelXPosition = 6;
636
- let spaceForTextContent;
637
- if (config.showValues !== false && d.value) {
638
- const valueEndsAtXRelative = totalHeaderWidth - 10;
639
- const estimatedValueTextActualWidth = 30;
640
- const gapBetweenLabelAndValue = 10;
641
- const labelMustEndBeforeX = valueEndsAtXRelative - estimatedValueTextActualWidth - gapBetweenLabelAndValue;
642
- spaceForTextContent = labelMustEndBeforeX - labelXPosition;
643
- } else {
644
- const labelOwnRightPadding = 6;
645
- spaceForTextContent = totalHeaderWidth - labelXPosition - labelOwnRightPadding;
646
- }
647
- const minimumWidthToDisplay = 15;
648
- const actualAvailableWidth = Math.max(minimumWidthToDisplay, spaceForTextContent);
649
- const textNode = self.node();
650
- const currentTextContentLength = textNode.getComputedTextLength();
651
- if (currentTextContentLength > actualAvailableWidth) {
652
- const ellipsis = "...";
653
- let currentTruncatedText = originalText;
654
- while (currentTruncatedText.length > 0) {
655
- currentTruncatedText = originalText.substring(0, currentTruncatedText.length - 1);
656
- if (currentTruncatedText.length === 0) {
657
- self.text(ellipsis);
658
- if (textNode.getComputedTextLength() > actualAvailableWidth) {
659
- self.text("");
660
- }
661
- break;
662
- }
663
- self.text(currentTruncatedText + ellipsis);
664
- if (textNode.getComputedTextLength() <= actualAvailableWidth) {
665
- break;
666
- }
667
- }
668
- }
669
- });
670
- if (config.showValues !== false) {
671
- sections.append("text").attr("class", "treemapSectionValue").attr("x", (d) => d.x1 - d.x0 - 10).attr("y", SECTION_HEADER_HEIGHT / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((d) => d.value ? valueFormat(d.value) : "").attr("font-style", "italic").attr("style", (d) => {
672
- if (d.depth === 0) {
673
- return "display: none;";
674
- }
675
- const labelStyles = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + colorScaleLabel(d.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";
676
- const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
677
- return labelStyles + styles.labelStyles.replace("color:", "fill:");
678
- });
679
- }
680
- const leafNodes = treemapData.leaves();
681
- const isComplexTreemap = leafNodes.length > 20;
682
- const baseLabelFontSize = isComplexTreemap ? 16 : 38;
683
- const baseValueFontSize = isComplexTreemap ? 14 : 28;
684
- const minLabelFontSize = isComplexTreemap ? 4 : 8;
685
- const minValueFontSize = isComplexTreemap ? 4 : 6;
686
- const labelPadding = isComplexTreemap ? 2 : 4;
687
- const minDisplayThreshold = isComplexTreemap ? 8 : 10;
688
- const spacingBetweenLabelAndValue = isComplexTreemap ? 1 : 2;
689
- const cell = g.selectAll(".treemapLeafGroup").data(leafNodes).enter().append("g").attr("class", (d, i) => {
690
- return `treemapNode treemapLeafGroup leaf${i}${d.data.classSelector ? ` ${d.data.classSelector}` : ""}x`;
691
- }).attr("transform", (d) => `translate(${d.x0},${d.y0})`);
692
- cell.append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0).attr("class", "treemapLeaf").attr("fill", (d) => {
693
- return d.parent ? colorScale(d.parent.data.name) : colorScale(d.data.name);
694
- }).attr("style", (d) => {
695
- const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
696
- return styles.nodeStyles;
697
- }).attr("fill-opacity", 0.3).attr("stroke", (d) => {
698
- return d.parent ? colorScale(d.parent.data.name) : colorScale(d.data.name);
699
- }).attr("stroke-width", 3);
700
- cell.append("clipPath").attr("id", (_d, i) => `clip-${id}-${i}`).append("rect").attr("width", (d) => Math.max(0, d.x1 - d.x0 - 4)).attr("height", (d) => Math.max(0, d.y1 - d.y0 - 4));
701
- const leafLabels = cell.append("text").attr("class", "treemapLabel").attr("x", (d) => (d.x1 - d.x0) / 2).attr("y", (d) => (d.y1 - d.y0) / 2).attr("style", (d) => {
702
- const labelStyles = `text-anchor: middle; dominant-baseline: middle; font-size: ${baseLabelFontSize}px;fill:` + colorScaleLabel(d.data.name) + ";";
703
- const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
704
- return labelStyles + styles.labelStyles.replace("color:", "fill:");
705
- }).attr("clip-path", (_d, i) => `url(#clip-${id}-${i})`).text((d) => d.data.name);
706
- leafLabels.each(function(d) {
707
- const self = select(this);
708
- const nodeWidth = d.x1 - d.x0;
709
- const nodeHeight = d.y1 - d.y0;
710
- const textNode = self.node();
711
- const availableWidth = nodeWidth - 2 * labelPadding;
712
- const availableHeight = nodeHeight - 2 * labelPadding;
713
- if (availableWidth < minDisplayThreshold || availableHeight < minDisplayThreshold) {
714
- self.style("display", "none");
715
- return;
716
- }
717
- let currentLabelFontSize = parseInt(self.style("font-size"), 10);
718
- const valueScaleFactor = 0.6;
719
- while (textNode.getComputedTextLength() > availableWidth && currentLabelFontSize > minLabelFontSize) {
720
- currentLabelFontSize--;
721
- self.style("font-size", `${currentLabelFontSize}px`);
722
- }
723
- let prospectiveValueFontSize = Math.max(
724
- minValueFontSize,
725
- Math.min(baseValueFontSize, Math.round(currentLabelFontSize * valueScaleFactor))
726
- );
727
- let combinedHeight = currentLabelFontSize + spacingBetweenLabelAndValue + prospectiveValueFontSize;
728
- while (combinedHeight > availableHeight && currentLabelFontSize > minLabelFontSize) {
729
- currentLabelFontSize--;
730
- prospectiveValueFontSize = Math.max(
731
- minValueFontSize,
732
- Math.min(baseValueFontSize, Math.round(currentLabelFontSize * valueScaleFactor))
733
- );
734
- if (prospectiveValueFontSize < minValueFontSize && currentLabelFontSize === minLabelFontSize) {
735
- break;
736
- }
737
- self.style("font-size", `${currentLabelFontSize}px`);
738
- combinedHeight = currentLabelFontSize + spacingBetweenLabelAndValue + prospectiveValueFontSize;
739
- }
740
- self.style("font-size", `${currentLabelFontSize}px`);
741
- if (isComplexTreemap) {
742
- if (currentLabelFontSize < minLabelFontSize || availableHeight < minLabelFontSize) {
743
- self.style("display", "none");
744
- }
745
- } else {
746
- if (textNode.getComputedTextLength() > availableWidth || currentLabelFontSize < minLabelFontSize || availableHeight < currentLabelFontSize) {
747
- self.style("display", "none");
748
- }
749
- }
750
- });
751
- if (config.showValues !== false) {
752
- const leafValues = cell.append("text").attr("class", "treemapValue").attr("x", (d) => (d.x1 - d.x0) / 2).attr("y", function(d) {
753
- return (d.y1 - d.y0) / 2;
754
- }).attr("style", (d) => {
755
- const labelStyles = `text-anchor: middle; dominant-baseline: hanging; font-size: ${baseValueFontSize}px;fill:` + colorScaleLabel(d.data.name) + ";";
756
- const styles = styles2String({ cssCompiledStyles: d.data.cssCompiledStyles });
757
- return labelStyles + styles.labelStyles.replace("color:", "fill:");
758
- }).attr("clip-path", (_d, i) => `url(#clip-${id}-${i})`).text((d) => d.value ? valueFormat(d.value) : "");
759
- leafValues.each(function(d) {
760
- const valueTextElement = select(this);
761
- const parentCellNode = this.parentNode;
762
- if (!parentCellNode) {
763
- valueTextElement.style("display", "none");
764
- return;
765
- }
766
- const labelElement = select(parentCellNode).select(".treemapLabel");
767
- if (labelElement.empty() || labelElement.style("display") === "none") {
768
- valueTextElement.style("display", "none");
769
- return;
770
- }
771
- const finalLabelFontSize = parseFloat(labelElement.style("font-size"));
772
- const valueScaleFactor = 0.6;
773
- const actualValueFontSize = Math.max(
774
- minValueFontSize,
775
- Math.min(baseValueFontSize, Math.round(finalLabelFontSize * valueScaleFactor))
776
- );
777
- valueTextElement.style("font-size", `${actualValueFontSize}px`);
778
- const labelCenterY = (d.y1 - d.y0) / 2;
779
- const valueTopActualY = labelCenterY + finalLabelFontSize / 2 + spacingBetweenLabelAndValue;
780
- valueTextElement.attr("y", valueTopActualY);
781
- const nodeWidth = d.x1 - d.x0;
782
- const nodeTotalHeight = d.y1 - d.y0;
783
- const cellBottomPadding = 4;
784
- const maxValueBottomY = nodeTotalHeight - cellBottomPadding;
785
- const availableWidthForValue = nodeWidth - 2 * labelPadding;
786
- if (valueTextElement.node().getComputedTextLength() > availableWidthForValue || valueTopActualY + actualValueFontSize > maxValueBottomY || actualValueFontSize < minValueFontSize) {
787
- valueTextElement.style("display", "none");
788
- } else {
789
- valueTextElement.style("display", null);
790
- }
791
- });
792
- }
793
- const diagramPadding = config.diagramPadding ?? 8;
794
- setupViewPortForSVG(svg, diagramPadding, "flowchart", config?.useMaxWidth || false);
795
- }, "draw");
796
- var getClasses = /* @__PURE__ */ __name(function(_text, diagramObj) {
797
- return diagramObj.db.getClasses();
798
- }, "getClasses");
799
- var renderer = { draw, getClasses };
800
- var defaultTreemapStyleOptions = {
801
- sectionStrokeColor: "black",
802
- sectionStrokeWidth: "1",
803
- sectionFillColor: "#efefef",
804
- leafStrokeColor: "black",
805
- leafStrokeWidth: "1",
806
- leafFillColor: "#efefef",
807
- labelFontSize: "12px",
808
- valueFontSize: "10px",
809
- titleFontSize: "14px"
810
- };
811
- var getStyles = /* @__PURE__ */ __name(({
812
- treemap: treemap2
813
- } = {}) => {
814
- const defaultThemeVariables = getThemeVariables3();
815
- const currentConfig = getConfig();
816
- const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);
817
- const options = cleanAndMerge(defaultTreemapStyleOptions, treemap2);
818
- const titleColor = options.titleColor ?? themeVariables.titleColor;
819
- const labelColor = options.labelColor ?? themeVariables.textColor;
820
- const valueColor = options.valueColor ?? themeVariables.textColor;
821
- return `
822
- .treemapNode.section {
823
- stroke: ${options.sectionStrokeColor};
824
- stroke-width: ${options.sectionStrokeWidth};
825
- fill: ${options.sectionFillColor};
826
- }
827
- .treemapNode.leaf {
828
- stroke: ${options.leafStrokeColor};
829
- stroke-width: ${options.leafStrokeWidth};
830
- fill: ${options.leafFillColor};
831
- }
832
- .treemapLabel {
833
- fill: ${labelColor};
834
- font-size: ${options.labelFontSize};
835
- }
836
- .treemapValue {
837
- fill: ${valueColor};
838
- font-size: ${options.valueFontSize};
839
- }
840
- .treemapTitle {
841
- fill: ${titleColor};
842
- font-size: ${options.titleFontSize};
843
- }
844
- `;
845
- }, "getStyles");
846
- var styles_default = getStyles;
847
- var diagram = {
848
- parser,
849
- get db() {
850
- return new TreeMapDB();
851
- },
852
- renderer,
853
- styles: styles_default
854
- };
855
- export {
856
- diagram
857
- };