boardplot 0.0.0-stage → 0.52.5

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 (817) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE.md +180 -0
  4. package/README.md +208 -2
  5. package/THIRD_PARTY_NOTICES.md +1110 -0
  6. package/dist/DiagnosticDetails-UNYNYCAH.js +69 -0
  7. package/dist/ReaderBox-VUNSFKZY.js +137 -0
  8. package/dist/annotateEngine-H7OW4H3W.js +30 -0
  9. package/dist/build-identity.json +6 -0
  10. package/dist/chunk-24WB3HMB.js +621 -0
  11. package/dist/chunk-263SZKIL.js +8 -0
  12. package/dist/chunk-27QQEWNV.js +18 -0
  13. package/dist/chunk-2AKWCMS4.js +24 -0
  14. package/dist/chunk-2DHJJ2EN.js +24 -0
  15. package/dist/chunk-2EQE4E3I.js +22 -0
  16. package/dist/chunk-2GELJH37.js +88 -0
  17. package/dist/chunk-2JAWQ7VV.js +3874 -0
  18. package/dist/chunk-2LMCD3ZR.js +6 -0
  19. package/dist/chunk-2MTWKMEG.js +841 -0
  20. package/dist/chunk-2SGIHKKU.js +33 -0
  21. package/dist/chunk-2UVTHU7A.js +1146 -0
  22. package/dist/chunk-33CBPK5Q.js +2800 -0
  23. package/dist/chunk-33PLBIMA.js +176 -0
  24. package/dist/chunk-35DZP2R2.js +22 -0
  25. package/dist/chunk-3D3D3D23.js +25 -0
  26. package/dist/chunk-3EZRM4YM.js +92 -0
  27. package/dist/chunk-3GZECHOK.js +802 -0
  28. package/dist/chunk-3HHNQPAH.js +68 -0
  29. package/dist/chunk-3I6RANBJ.js +1058 -0
  30. package/dist/chunk-3SIRPKMP.js +12 -0
  31. package/dist/chunk-3W23F7EY.js +185 -0
  32. package/dist/chunk-3XQ635KD.js +24 -0
  33. package/dist/chunk-3ZCKEANJ.js +24 -0
  34. package/dist/chunk-4DNOEV3Q.js +25857 -0
  35. package/dist/chunk-4GB7TBY7.js +373 -0
  36. package/dist/chunk-4SM2ONUC.js +18 -0
  37. package/dist/chunk-5C7TWNYZ.js +79 -0
  38. package/dist/chunk-5DJXJXDE.js +58 -0
  39. package/dist/chunk-5ENRZX6I.js +687 -0
  40. package/dist/chunk-5KWXRYAT.js +294 -0
  41. package/dist/chunk-5T5YW52S.js +47 -0
  42. package/dist/chunk-627P6T25.js +936 -0
  43. package/dist/chunk-62FR4FYJ.js +23 -0
  44. package/dist/chunk-6JUJ2DU3.js +67 -0
  45. package/dist/chunk-6KWIQ5KF.js +18 -0
  46. package/dist/chunk-6UBEGKIQ.js +25 -0
  47. package/dist/chunk-6XE3GVGU.js +116 -0
  48. package/dist/chunk-76ANFJOI.js +227 -0
  49. package/dist/chunk-7IFLQMJL.js +160 -0
  50. package/dist/chunk-7JVAQX6C.js +28 -0
  51. package/dist/chunk-7QDAHY5M.js +63 -0
  52. package/dist/chunk-7VXZDB45.js +149 -0
  53. package/dist/chunk-7X65ZQN4.js +38 -0
  54. package/dist/chunk-A2FHZH7E.js +1410 -0
  55. package/dist/chunk-A372DLQX.js +54 -0
  56. package/dist/chunk-A3ULWR5N.js +76 -0
  57. package/dist/chunk-A4QZXLXF.js +7 -0
  58. package/dist/chunk-A5JWFZVU.js +1467 -0
  59. package/dist/chunk-A5LZUYK4.js +59 -0
  60. package/dist/chunk-A6XCAQ52.js +89 -0
  61. package/dist/chunk-A7A4PDG5.js +24 -0
  62. package/dist/chunk-A7IEVBYI.js +35 -0
  63. package/dist/chunk-ACXX2JNL.js +6 -0
  64. package/dist/chunk-AFK47A6O.js +25 -0
  65. package/dist/chunk-ALKTNXMR.js +3650 -0
  66. package/dist/chunk-AOQ6VF5H.js +6 -0
  67. package/dist/chunk-ASAON7G4.js +648 -0
  68. package/dist/chunk-ATTE3FYC.js +24 -0
  69. package/dist/chunk-AZOUSKZD.js +728 -0
  70. package/dist/chunk-B2EBEXIS.js +113 -0
  71. package/dist/chunk-B67K5X4M.js +58 -0
  72. package/dist/chunk-BBL3R5YZ.js +186 -0
  73. package/dist/chunk-BIDIGDGH.js +6 -0
  74. package/dist/chunk-BKYMLFUG.js +69 -0
  75. package/dist/chunk-BLFWUMTD.js +12 -0
  76. package/dist/chunk-BM6SFFWF.js +6 -0
  77. package/dist/chunk-BUPLB3EX.js +129 -0
  78. package/dist/chunk-BVWU6GOB.js +47 -0
  79. package/dist/chunk-BW5VLBSZ.js +15 -0
  80. package/dist/chunk-C64FBRJO.js +290 -0
  81. package/dist/chunk-CAE2HK2G.js +295 -0
  82. package/dist/chunk-CCQNL33L.js +446 -0
  83. package/dist/chunk-CDZHNLO6.js +42 -0
  84. package/dist/chunk-COKHNEJP.js +24 -0
  85. package/dist/chunk-COYPDRJK.js +21 -0
  86. package/dist/chunk-CRZKGHZ6.js +1810 -0
  87. package/dist/chunk-CS4DHFNG.js +128 -0
  88. package/dist/chunk-CYDZP5W6.js +1589 -0
  89. package/dist/chunk-D4BIV6WG.js +1072 -0
  90. package/dist/chunk-D4SOADBD.js +19 -0
  91. package/dist/chunk-DCCJRLAJ.js +422 -0
  92. package/dist/chunk-DFKTS6XJ.js +75 -0
  93. package/dist/chunk-DGDOGOTQ.js +25 -0
  94. package/dist/chunk-DLC23CKC.js +53 -0
  95. package/dist/chunk-DRTA6JG5.js +160 -0
  96. package/dist/chunk-DVKBU23L.js +97 -0
  97. package/dist/chunk-E2HEVF23.js +692 -0
  98. package/dist/chunk-EC2NAYPQ.js +24 -0
  99. package/dist/chunk-EKQK5D6G.js +14 -0
  100. package/dist/chunk-EKQMYG2B.js +2353 -0
  101. package/dist/chunk-ELYU6TRQ.js +98 -0
  102. package/dist/chunk-EQT3EPTB.js +203 -0
  103. package/dist/chunk-ERAIVAK5.js +1359 -0
  104. package/dist/chunk-ETHWK2RZ.js +16 -0
  105. package/dist/chunk-EWVKBRLV.js +72 -0
  106. package/dist/chunk-F77BNDAT.js +43 -0
  107. package/dist/chunk-FGAGGPFF.js +566 -0
  108. package/dist/chunk-FIANWJXX.js +19 -0
  109. package/dist/chunk-FIWNDOMO.js +6 -0
  110. package/dist/chunk-FOKEGVPB.js +24 -0
  111. package/dist/chunk-FT3F72C3.js +30 -0
  112. package/dist/chunk-FT47HQ5U.js +47 -0
  113. package/dist/chunk-GDOW2KNP.js +19 -0
  114. package/dist/chunk-GDQ3NGDZ.js +17 -0
  115. package/dist/chunk-GH3ZMBFX.js +563 -0
  116. package/dist/chunk-GQPESFAF.js +3378 -0
  117. package/dist/chunk-GQS46LC3.js +50 -0
  118. package/dist/chunk-GULJ6KVT.js +587 -0
  119. package/dist/chunk-GWQIXU37.js +2774 -0
  120. package/dist/chunk-GZ2VNM4L.js +24 -0
  121. package/dist/chunk-GZ4RHGIW.js +836 -0
  122. package/dist/chunk-H4H4O62O.js +46 -0
  123. package/dist/chunk-H57TJD3B.js +72 -0
  124. package/dist/chunk-H7UZZ7KP.js +24 -0
  125. package/dist/chunk-HAAUJDGB.js +83 -0
  126. package/dist/chunk-HFG76JTS.js +296 -0
  127. package/dist/chunk-HJXXFPOL.js +211 -0
  128. package/dist/chunk-HTYFQHRC.js +24 -0
  129. package/dist/chunk-HUF6TQ2J.js +24 -0
  130. package/dist/chunk-HUFCSX2Y.js +89 -0
  131. package/dist/chunk-HX3MQ3H4.js +26 -0
  132. package/dist/chunk-HZQEQ34U.js +296 -0
  133. package/dist/chunk-I322G5UG.js +888 -0
  134. package/dist/chunk-IDDA5INB.js +60 -0
  135. package/dist/chunk-IDTLHPTK.js +60 -0
  136. package/dist/chunk-II7652VA.js +2918 -0
  137. package/dist/chunk-IN4QT33I.js +38 -0
  138. package/dist/chunk-IV2UXZXX.js +16 -0
  139. package/dist/chunk-IXSZ7OKR.js +133 -0
  140. package/dist/chunk-IYEFEBRN.js +41 -0
  141. package/dist/chunk-IZ35GMGB.js +2543 -0
  142. package/dist/chunk-IZCOG3FS.js +28 -0
  143. package/dist/chunk-JA755JHN.js +379 -0
  144. package/dist/chunk-JETXFF3M.js +33 -0
  145. package/dist/chunk-JFBEAUJ6.js +24 -0
  146. package/dist/chunk-JFG4DHKQ.js +48 -0
  147. package/dist/chunk-JL5BRMDT.js +179 -0
  148. package/dist/chunk-JLCAWQ3H.js +195 -0
  149. package/dist/chunk-JLZM7XMZ.js +525 -0
  150. package/dist/chunk-JMH5MD5A.js +19 -0
  151. package/dist/chunk-JRPI64AQ.js +3066 -0
  152. package/dist/chunk-JSX3C6LL.js +344 -0
  153. package/dist/chunk-JY4R3GML.js +83 -0
  154. package/dist/chunk-JYBT2JNY.js +61 -0
  155. package/dist/chunk-K2HNV4LE.js +2008 -0
  156. package/dist/chunk-KAXJFL7N.js +43 -0
  157. package/dist/chunk-KDMKHR5A.js +32 -0
  158. package/dist/chunk-KFFNCDX6.js +19 -0
  159. package/dist/chunk-KKWZWP67.js +24 -0
  160. package/dist/chunk-KOJ5QETJ.js +8 -0
  161. package/dist/chunk-KPMGGE4W.js +51 -0
  162. package/dist/chunk-KS7DXCXH.js +27 -0
  163. package/dist/chunk-KSYVTEKR.js +24 -0
  164. package/dist/chunk-KU4YS6HN.js +61 -0
  165. package/dist/chunk-KYELSLDJ.js +40 -0
  166. package/dist/chunk-LC3PSQJJ.js +383 -0
  167. package/dist/chunk-LC6DYCTG.js +85 -0
  168. package/dist/chunk-LNKY5Z2X.js +23 -0
  169. package/dist/chunk-LO2DANS6.js +302 -0
  170. package/dist/chunk-M4SPKUZE.js +7 -0
  171. package/dist/chunk-M4YLED7M.js +17 -0
  172. package/dist/chunk-M6KTNAND.js +746 -0
  173. package/dist/chunk-MCOIEWW6.js +54 -0
  174. package/dist/chunk-MDYLOIS2.js +48 -0
  175. package/dist/chunk-MEISCROL.js +24 -0
  176. package/dist/chunk-MFLH5ZDQ.js +69 -0
  177. package/dist/chunk-MIXKQJ64.js +935 -0
  178. package/dist/chunk-MJMJEURO.js +359 -0
  179. package/dist/chunk-MNJ2DHU6.js +526 -0
  180. package/dist/chunk-NEVSQGOI.js +63 -0
  181. package/dist/chunk-NG5IGZXC.js +1179 -0
  182. package/dist/chunk-NLOMCLKI.js +3303 -0
  183. package/dist/chunk-NMCOUVN5.js +24 -0
  184. package/dist/chunk-NT3HAZYT.js +51 -0
  185. package/dist/chunk-NXNQQ3DS.js +382 -0
  186. package/dist/chunk-NYEY6W5R.js +569 -0
  187. package/dist/chunk-OAPCJO6W.js +23 -0
  188. package/dist/chunk-OH7FA4TF.js +251 -0
  189. package/dist/chunk-OLNORNCT.js +331 -0
  190. package/dist/chunk-OQEBOVUO.js +30 -0
  191. package/dist/chunk-ORUJI3VB.js +83 -0
  192. package/dist/chunk-PEN2DK7T.js +49 -0
  193. package/dist/chunk-PGIQMQRU.js +1650 -0
  194. package/dist/chunk-PTVOXB5T.js +39 -0
  195. package/dist/chunk-PUVGWJQ5.js +24 -0
  196. package/dist/chunk-PWROWDZS.js +137 -0
  197. package/dist/chunk-Q6XJOJTY.js +29 -0
  198. package/dist/chunk-QBR6IKIX.js +50 -0
  199. package/dist/chunk-QETGGFH2.js +30 -0
  200. package/dist/chunk-QG6MOQLI.js +2934 -0
  201. package/dist/chunk-QGCEHR6S.js +13 -0
  202. package/dist/chunk-QHFQHQDC.js +43 -0
  203. package/dist/chunk-QHRE2M6V.js +26 -0
  204. package/dist/chunk-QKL7IY42.js +38 -0
  205. package/dist/chunk-QN6JHMGU.js +44 -0
  206. package/dist/chunk-QNHZXFRA.js +347 -0
  207. package/dist/chunk-QPWRHDLZ.js +17 -0
  208. package/dist/chunk-QVABTUDS.js +80 -0
  209. package/dist/chunk-QXILAMAU.js +28 -0
  210. package/dist/chunk-QZAT46PP.js +95 -0
  211. package/dist/chunk-R3WI7ZLE.js +545 -0
  212. package/dist/chunk-R5SWC3EW.js +30 -0
  213. package/dist/chunk-RJQ5YS3Q.js +40 -0
  214. package/dist/chunk-RNOD2UWF.js +613 -0
  215. package/dist/chunk-RNXITK5M.js +24 -0
  216. package/dist/chunk-ROXO4R3J.js +16 -0
  217. package/dist/chunk-RQ5DNYLG.js +10 -0
  218. package/dist/chunk-RSWVH7DB.js +24 -0
  219. package/dist/chunk-RTJXOIIQ.js +12 -0
  220. package/dist/chunk-RZNYW7UP.js +133 -0
  221. package/dist/chunk-S4F27M7N.js +37 -0
  222. package/dist/chunk-S4ONWRJE.js +28 -0
  223. package/dist/chunk-S53OGZL6.js +168 -0
  224. package/dist/chunk-S5ADHIZK.js +2508 -0
  225. package/dist/chunk-S62M63LU.js +19 -0
  226. package/dist/chunk-S7VDRUED.js +62 -0
  227. package/dist/chunk-SGD3ZHID.js +250 -0
  228. package/dist/chunk-SGSPYHFE.js +40 -0
  229. package/dist/chunk-SLTMRTXV.js +597 -0
  230. package/dist/chunk-SXGTRZFN.js +26 -0
  231. package/dist/chunk-SZPTTNW7.js +16 -0
  232. package/dist/chunk-T3IGJARD.js +22 -0
  233. package/dist/chunk-TA3TFKYZ.js +86 -0
  234. package/dist/chunk-TNEHPP3H.js +18 -0
  235. package/dist/chunk-TPYV2FTV.js +25 -0
  236. package/dist/chunk-TPZB2YWR.js +25 -0
  237. package/dist/chunk-TSR5YDPS.js +1266 -0
  238. package/dist/chunk-TTR7EWNH.js +170 -0
  239. package/dist/chunk-TVHLKVUO.js +24 -0
  240. package/dist/chunk-TXINIAFL.js +198 -0
  241. package/dist/chunk-TXZBBZOG.js +58 -0
  242. package/dist/chunk-UEU46Q3D.js +300 -0
  243. package/dist/chunk-UMDEWWXT.js +33 -0
  244. package/dist/chunk-UQSVWO7Z.js +334 -0
  245. package/dist/chunk-UZF3G2FN.js +942 -0
  246. package/dist/chunk-V422EKLW.js +24 -0
  247. package/dist/chunk-V4DYVLOO.js +433 -0
  248. package/dist/chunk-V4VC25UL.js +128 -0
  249. package/dist/chunk-V667FCIJ.js +12 -0
  250. package/dist/chunk-VABRPZVC.js +43 -0
  251. package/dist/chunk-VB2MJLET.js +19 -0
  252. package/dist/chunk-VDAKTZQP.js +18 -0
  253. package/dist/chunk-VDAZPGR2.js +79 -0
  254. package/dist/chunk-VXZFQKBJ.js +21 -0
  255. package/dist/chunk-VYMGZ27S.js +133 -0
  256. package/dist/chunk-W2RGSGRR.js +131 -0
  257. package/dist/chunk-W7UZXD5D.js +1109 -0
  258. package/dist/chunk-WDUNR2VI.js +2718 -0
  259. package/dist/chunk-WHSTEAVP.js +229 -0
  260. package/dist/chunk-WJMUMN3I.js +127 -0
  261. package/dist/chunk-WLZ54FWG.js +120 -0
  262. package/dist/chunk-WMJPFLF3.js +2980 -0
  263. package/dist/chunk-WRHFBCVY.js +24 -0
  264. package/dist/chunk-WVSNSWBJ.js +47 -0
  265. package/dist/chunk-WYJEOMNY.js +31 -0
  266. package/dist/chunk-WYJMV62X.js +24 -0
  267. package/dist/chunk-WZGJSQKN.js +29 -0
  268. package/dist/chunk-WZL4EEBS.js +11 -0
  269. package/dist/chunk-X7TXGKRX.js +272 -0
  270. package/dist/chunk-XB4KZ6WO.js +81 -0
  271. package/dist/chunk-XDLQRSSH.js +266 -0
  272. package/dist/chunk-XDS4UZGR.js +113 -0
  273. package/dist/chunk-XEGRWWNO.js +30 -0
  274. package/dist/chunk-XO5ONLVM.js +420 -0
  275. package/dist/chunk-XPWRD424.js +24 -0
  276. package/dist/chunk-XTNV2YMB.js +50 -0
  277. package/dist/chunk-XW5J5JAX.js +42 -0
  278. package/dist/chunk-XY5O74BH.js +33 -0
  279. package/dist/chunk-XYONCO5Q.js +984 -0
  280. package/dist/chunk-Y4PXIJMD.js +829 -0
  281. package/dist/chunk-YAYRRKC7.js +24 -0
  282. package/dist/chunk-YEDYBMCW.js +210 -0
  283. package/dist/chunk-YFG4E3N2.js +1161 -0
  284. package/dist/chunk-YHTO46W2.js +2670 -0
  285. package/dist/chunk-YI2ZVTCB.js +38 -0
  286. package/dist/chunk-YKO3VCTF.js +24 -0
  287. package/dist/chunk-YP3I6W7T.js +24 -0
  288. package/dist/chunk-YQ2B3YVF.js +687 -0
  289. package/dist/chunk-YS6KMYM4.js +91 -0
  290. package/dist/chunk-YTSSXSZR.js +197 -0
  291. package/dist/chunk-Z256ACGC.js +27 -0
  292. package/dist/chunk-Z2MGTKDR.js +20 -0
  293. package/dist/chunk-Z5VSLLNY.js +23 -0
  294. package/dist/chunk-Z7X3RGGA.js +22 -0
  295. package/dist/chunk-ZF43WRG3.js +29 -0
  296. package/dist/chunk-ZJKOLOVF.js +1754 -0
  297. package/dist/chunk-ZQ4VFQID.js +76 -0
  298. package/dist/chunk-ZSLGN6CO.js +89 -0
  299. package/dist/chunk-ZVTFZF4V.js +542 -0
  300. package/dist/cli/index.js +9 -0
  301. package/dist/core-5Z6UW5DS.js +31 -0
  302. package/dist/core-6ANZ2OWO.js +40 -0
  303. package/dist/core-6LLJNZ4O.js +37 -0
  304. package/dist/core-CPN2HF75.js +33 -0
  305. package/dist/core-CS7AKNME.js +37 -0
  306. package/dist/core-DBRILYNB.js +38 -0
  307. package/dist/core-DU77ZYPR.js +34 -0
  308. package/dist/core-E6YD7VU4.js +32 -0
  309. package/dist/core-EE55P6XK.js +56 -0
  310. package/dist/core-FFLPH5XK.js +41 -0
  311. package/dist/core-IV26EL5C.js +32 -0
  312. package/dist/core-IZVZ2B7Y.js +34 -0
  313. package/dist/core-JQV7STNF.js +34 -0
  314. package/dist/core-KBH3EJZV.js +32 -0
  315. package/dist/core-KFBW5PRT.js +36 -0
  316. package/dist/core-KWGXHBJE.js +37 -0
  317. package/dist/core-MZMR2DF4.js +32 -0
  318. package/dist/core-OK2ZY5OJ.js +29 -0
  319. package/dist/core-OV5MPTZP.js +43 -0
  320. package/dist/core-OW5V74Q4.js +40 -0
  321. package/dist/core-PL64QPOH.js +57 -0
  322. package/dist/core-PVINU5JJ.js +33 -0
  323. package/dist/core-QUYSNTC7.js +34 -0
  324. package/dist/core-RE3L6YCM.js +29 -0
  325. package/dist/core-RUA3EWW3.js +39 -0
  326. package/dist/core-RY6IFRKM.js +35 -0
  327. package/dist/core-SCWEVNUY.js +34 -0
  328. package/dist/core-SE67HHFG.js +55 -0
  329. package/dist/core-T5Q4DSH2.js +32 -0
  330. package/dist/core-TJX3I7KH.js +37 -0
  331. package/dist/core-ULUA5ZB2.js +55 -0
  332. package/dist/core-WLVU2HWX.js +46 -0
  333. package/dist/core-WQPHNVNY.js +51 -0
  334. package/dist/core-XXIOJY2X.js +52 -0
  335. package/dist/core-ZH7XTJTD.js +39 -0
  336. package/dist/core-ZHE7N4NS.js +50 -0
  337. package/dist/core-ZJYLJWZQ.js +38 -0
  338. package/dist/dataTable-IL7HVDHL.js +58 -0
  339. package/dist/engine-MYLZI5VH.js +961 -0
  340. package/dist/fixtures.d.ts +1 -0
  341. package/dist/fixtures.js +40 -0
  342. package/dist/fontTables-ZYBUCJ5N.js +18 -0
  343. package/dist/fonts.d.ts +1 -0
  344. package/dist/fonts.js +19 -0
  345. package/dist/geo/dach.d.ts +1 -0
  346. package/dist/geo/dach.js +14 -0
  347. package/dist/geo/de-states.d.ts +1 -0
  348. package/dist/geo/de-states.js +14 -0
  349. package/dist/geo/eu27.d.ts +1 -0
  350. package/dist/geo/eu27.js +14 -0
  351. package/dist/geo/europe.d.ts +1 -0
  352. package/dist/geo/europe.js +14 -0
  353. package/dist/geo/index.d.ts +1 -0
  354. package/dist/geo/index.js +41 -0
  355. package/dist/geo/us-states.d.ts +1 -0
  356. package/dist/geo/us-states.js +14 -0
  357. package/dist/geo/world.d.ts +1 -0
  358. package/dist/geo/world.js +14 -0
  359. package/dist/index.d.ts +1 -0
  360. package/dist/index.js +363 -0
  361. package/dist/main-ISJ53IS5.js +568 -0
  362. package/dist/mcp/server.js +1023 -0
  363. package/dist/module-SVEW5ZUE.js +137233 -0
  364. package/dist/react/bar.d.ts +1 -0
  365. package/dist/react/bar.js +80 -0
  366. package/dist/react/bartable.d.ts +1 -0
  367. package/dist/react/bartable.js +70 -0
  368. package/dist/react/box.d.ts +1 -0
  369. package/dist/react/box.js +64 -0
  370. package/dist/react/bullet.d.ts +1 -0
  371. package/dist/react/bullet.js +71 -0
  372. package/dist/react/butterfly.d.ts +1 -0
  373. package/dist/react/butterfly.js +65 -0
  374. package/dist/react/choropleth.d.ts +1 -0
  375. package/dist/react/choropleth.js +67 -0
  376. package/dist/react/cohort.d.ts +1 -0
  377. package/dist/react/cohort.js +69 -0
  378. package/dist/react/column.d.ts +1 -0
  379. package/dist/react/column.js +85 -0
  380. package/dist/react/combo.d.ts +1 -0
  381. package/dist/react/combo.js +85 -0
  382. package/dist/react/creative.d.ts +1 -0
  383. package/dist/react/creative.js +61 -0
  384. package/dist/react/diagram.d.ts +1 -0
  385. package/dist/react/diagram.js +60 -0
  386. package/dist/react/dimswitch.d.ts +1 -0
  387. package/dist/react/dimswitch.js +71 -0
  388. package/dist/react/dot.d.ts +1 -0
  389. package/dist/react/dot.js +69 -0
  390. package/dist/react/export.d.ts +1 -0
  391. package/dist/react/export.js +657 -0
  392. package/dist/react/funnel.d.ts +1 -0
  393. package/dist/react/funnel.js +62 -0
  394. package/dist/react/gantt.d.ts +1 -0
  395. package/dist/react/gantt.js +62 -0
  396. package/dist/react/grid.d.ts +1 -0
  397. package/dist/react/grid.js +66 -0
  398. package/dist/react/heatmap.d.ts +1 -0
  399. package/dist/react/heatmap.js +67 -0
  400. package/dist/react/histogram.d.ts +1 -0
  401. package/dist/react/histogram.js +85 -0
  402. package/dist/react/index.d.ts +1 -0
  403. package/dist/react/index.js +503 -0
  404. package/dist/react/kpi.d.ts +1 -0
  405. package/dist/react/kpi.js +67 -0
  406. package/dist/react/likert.d.ts +1 -0
  407. package/dist/react/likert.js +82 -0
  408. package/dist/react/line.d.ts +1 -0
  409. package/dist/react/line.js +80 -0
  410. package/dist/react/mekko.d.ts +1 -0
  411. package/dist/react/mekko.js +70 -0
  412. package/dist/react/pareto.d.ts +1 -0
  413. package/dist/react/pareto.js +89 -0
  414. package/dist/react/pie.d.ts +1 -0
  415. package/dist/react/pie.js +63 -0
  416. package/dist/react/prepare.d.ts +1 -0
  417. package/dist/react/prepare.js +277 -0
  418. package/dist/react/pvm.d.ts +1 -0
  419. package/dist/react/pvm.js +67 -0
  420. package/dist/react/pyramid.d.ts +1 -0
  421. package/dist/react/pyramid.js +66 -0
  422. package/dist/react/sankey.d.ts +1 -0
  423. package/dist/react/sankey.js +59 -0
  424. package/dist/react/scatter.d.ts +1 -0
  425. package/dist/react/scatter.js +62 -0
  426. package/dist/react/slope.d.ts +1 -0
  427. package/dist/react/slope.js +63 -0
  428. package/dist/react/sparkline.d.ts +1 -0
  429. package/dist/react/sparkline.js +59 -0
  430. package/dist/react/spec.d.ts +1 -0
  431. package/dist/react/spec.js +370 -0
  432. package/dist/react/status.d.ts +1 -0
  433. package/dist/react/status.js +64 -0
  434. package/dist/react/story.d.ts +1 -0
  435. package/dist/react/story.js +140 -0
  436. package/dist/react/table.d.ts +1 -0
  437. package/dist/react/table.js +68 -0
  438. package/dist/react/theme.d.ts +1 -0
  439. package/dist/react/theme.js +53 -0
  440. package/dist/react/tilemap.d.ts +1 -0
  441. package/dist/react/tilemap.js +66 -0
  442. package/dist/react/treemap.d.ts +1 -0
  443. package/dist/react/treemap.js +61 -0
  444. package/dist/react/variance.d.ts +1 -0
  445. package/dist/react/variance.js +64 -0
  446. package/dist/react/waffle.d.ts +1 -0
  447. package/dist/react/waffle.js +62 -0
  448. package/dist/react/waterfall.d.ts +1 -0
  449. package/dist/react/waterfall.js +67 -0
  450. package/dist/resvg-ZOVDIZTV.js +23 -0
  451. package/dist/rows.d.ts +1 -0
  452. package/dist/rows.js +23 -0
  453. package/dist/rowsModule-3Y4I3M3E.js +27 -0
  454. package/dist/schema-2BMZOHXI.js +22 -0
  455. package/dist/schema-2GUBWOBC.js +26 -0
  456. package/dist/schema-34ZELWRQ.js +25 -0
  457. package/dist/schema-3BHL2B76.js +22 -0
  458. package/dist/schema-4735XAZX.js +29 -0
  459. package/dist/schema-5YTNQ6JY.js +22 -0
  460. package/dist/schema-7J3NAIN2.js +27 -0
  461. package/dist/schema-AOJJ7JZB.js +22 -0
  462. package/dist/schema-CVMV4LRA.js +22 -0
  463. package/dist/schema-D3RCMN3T.js +22 -0
  464. package/dist/schema-E2ISJ65D.js +23 -0
  465. package/dist/schema-E6YOSOWB.js +28 -0
  466. package/dist/schema-EQQB43AY.js +22 -0
  467. package/dist/schema-EVLLL5UF.js +22 -0
  468. package/dist/schema-EYQ5IBLF.js +23 -0
  469. package/dist/schema-EYZVD73N.js +22 -0
  470. package/dist/schema-G4KFMQBL.js +22 -0
  471. package/dist/schema-GH7IKSOU.js +23 -0
  472. package/dist/schema-IF5N3J56.js +42 -0
  473. package/dist/schema-IG7JIR4H.js +23 -0
  474. package/dist/schema-JJYJOQTT.js +23 -0
  475. package/dist/schema-KFC4WYH4.js +32 -0
  476. package/dist/schema-L7263JMT.js +25 -0
  477. package/dist/schema-MEAFRXVH.js +53 -0
  478. package/dist/schema-P63S63GE.js +23 -0
  479. package/dist/schema-P7LJFJAJ.js +22 -0
  480. package/dist/schema-PA2MXYY4.js +23 -0
  481. package/dist/schema-PDZ6256H.js +23 -0
  482. package/dist/schema-PNC3Z7AH.js +25 -0
  483. package/dist/schema-QEVSIMGO.js +22 -0
  484. package/dist/schema-QJJPRRE7.js +22 -0
  485. package/dist/schema-S3EQKVOT.js +23 -0
  486. package/dist/schema-STGL44TL.js +22 -0
  487. package/dist/schema-T4NE2EAO.js +22 -0
  488. package/dist/schema-TQYTESG3.js +22 -0
  489. package/dist/schema-W376PAJG.js +22 -0
  490. package/dist/schema-XYYDUUHS.js +26 -0
  491. package/dist/specValidation-NVBIZMEE.js +48 -0
  492. package/dist/theme.d.ts +1 -0
  493. package/dist/theme.js +24 -0
  494. package/dist/themeShapeRules-5C2463YH.js +11 -0
  495. package/dist/types/core/a11y/accessibility.d.ts +43 -0
  496. package/dist/types/core/a11y/recordsShared.d.ts +44 -0
  497. package/dist/types/core/a11y/structuralRecords.d.ts +6 -0
  498. package/dist/types/core/a11y/types.d.ts +116 -0
  499. package/dist/types/core/annotate.d.ts +300 -0
  500. package/dist/types/core/annotateArms.d.ts +37 -0
  501. package/dist/types/core/annotateFields.d.ts +30 -0
  502. package/dist/types/core/annotateGapBracket.d.ts +66 -0
  503. package/dist/types/core/annotateLinks.d.ts +47 -0
  504. package/dist/types/core/annotateTargets.d.ts +90 -0
  505. package/dist/types/core/axis.d.ts +179 -0
  506. package/dist/types/core/bandSelect.d.ts +10 -0
  507. package/dist/types/core/bands.d.ts +14 -0
  508. package/dist/types/core/calendarLabels.d.ts +101 -0
  509. package/dist/types/core/charts/band/stacks.d.ts +155 -0
  510. package/dist/types/core/charts/bar/fixtures.d.ts +9 -0
  511. package/dist/types/core/charts/bar/layout.d.ts +95 -0
  512. package/dist/types/core/charts/bartable/fixtures.d.ts +4 -0
  513. package/dist/types/core/charts/bartable/types.d.ts +192 -0
  514. package/dist/types/core/charts/box/fixtures.d.ts +12 -0
  515. package/dist/types/core/charts/box/types.d.ts +110 -0
  516. package/dist/types/core/charts/bullet/fixtures.d.ts +11 -0
  517. package/dist/types/core/charts/butterfly/fixtures.d.ts +9 -0
  518. package/dist/types/core/charts/choropleth/fixtures.d.ts +3 -0
  519. package/dist/types/core/charts/choropleth/overlayTypes.d.ts +68 -0
  520. package/dist/types/core/charts/choropleth/types.d.ts +117 -0
  521. package/dist/types/core/charts/cohort/fixtures.d.ts +12 -0
  522. package/dist/types/core/charts/cohort/types.d.ts +165 -0
  523. package/dist/types/core/charts/column/anomaly.d.ts +204 -0
  524. package/dist/types/core/charts/column/fixtures.d.ts +12 -0
  525. package/dist/types/core/charts/column/layout.d.ts +116 -0
  526. package/dist/types/core/charts/column/model.d.ts +295 -0
  527. package/dist/types/core/charts/column/types.d.ts +56 -0
  528. package/dist/types/core/charts/combo/endpoints.d.ts +165 -0
  529. package/dist/types/core/charts/combo/fixtures.d.ts +12 -0
  530. package/dist/types/core/charts/combo/layout.d.ts +48 -0
  531. package/dist/types/core/charts/creative/fixtures.d.ts +4 -0
  532. package/dist/types/core/charts/creative/types.d.ts +73 -0
  533. package/dist/types/core/charts/diagram/fixtures.d.ts +3 -0
  534. package/dist/types/core/charts/dimswitch/compile.d.ts +20 -0
  535. package/dist/types/core/charts/dimswitch/fixtures.d.ts +3 -0
  536. package/dist/types/core/charts/dimswitch/types.d.ts +152 -0
  537. package/dist/types/core/charts/dot/fixtures.d.ts +11 -0
  538. package/dist/types/core/charts/funnel/fixtures.d.ts +11 -0
  539. package/dist/types/core/charts/gantt/fixtures.d.ts +9 -0
  540. package/dist/types/core/charts/gantt/layout.d.ts +56 -0
  541. package/dist/types/core/charts/grid/fixtures.d.ts +3 -0
  542. package/dist/types/core/charts/grid/metricStack.d.ts +108 -0
  543. package/dist/types/core/charts/grid/metricStackSchema.d.ts +74 -0
  544. package/dist/types/core/charts/grid/normalize.d.ts +99 -0
  545. package/dist/types/core/charts/grid/schema.d.ts +168 -0
  546. package/dist/types/core/charts/heatmap/fixtures.d.ts +11 -0
  547. package/dist/types/core/charts/histogram/fixtures.d.ts +15 -0
  548. package/dist/types/core/charts/histogram/types.d.ts +98 -0
  549. package/dist/types/core/charts/kpi/fixtures.d.ts +9 -0
  550. package/dist/types/core/charts/likert/fixtures.d.ts +11 -0
  551. package/dist/types/core/charts/likert/layout.d.ts +111 -0
  552. package/dist/types/core/charts/line/fixtures.d.ts +16 -0
  553. package/dist/types/core/charts/line/types.d.ts +6 -0
  554. package/dist/types/core/charts/mekko/fixtures.d.ts +13 -0
  555. package/dist/types/core/charts/pareto/fixtures.d.ts +5 -0
  556. package/dist/types/core/charts/pareto/layout.d.ts +68 -0
  557. package/dist/types/core/charts/pie/fixtures.d.ts +14 -0
  558. package/dist/types/core/charts/pvm/fixtures.d.ts +13 -0
  559. package/dist/types/core/charts/pvm/types.d.ts +118 -0
  560. package/dist/types/core/charts/pyramid/fixtures.d.ts +4 -0
  561. package/dist/types/core/charts/pyramid/types.d.ts +92 -0
  562. package/dist/types/core/charts/sankey/fixtures.d.ts +4 -0
  563. package/dist/types/core/charts/sankey/types.d.ts +116 -0
  564. package/dist/types/core/charts/scatter/fixtures.d.ts +12 -0
  565. package/dist/types/core/charts/scatter/types.d.ts +58 -0
  566. package/dist/types/core/charts/slope/fixtures.d.ts +13 -0
  567. package/dist/types/core/charts/sparkline/fixtures.d.ts +9 -0
  568. package/dist/types/core/charts/status/fixtures.d.ts +8 -0
  569. package/dist/types/core/charts/status/layout.d.ts +71 -0
  570. package/dist/types/core/charts/table/fitFormats.d.ts +67 -0
  571. package/dist/types/core/charts/table/fixtures.d.ts +7 -0
  572. package/dist/types/core/charts/table/resolve.d.ts +72 -0
  573. package/dist/types/core/charts/table/view.d.ts +156 -0
  574. package/dist/types/core/charts/tilemap/fixtures.d.ts +3 -0
  575. package/dist/types/core/charts/tilemap/types.d.ts +94 -0
  576. package/dist/types/core/charts/treemap/fixtures.d.ts +4 -0
  577. package/dist/types/core/charts/treemap/types.d.ts +78 -0
  578. package/dist/types/core/charts/variance/fixtures.d.ts +12 -0
  579. package/dist/types/core/charts/waffle/fixtures.d.ts +5 -0
  580. package/dist/types/core/charts/waffle/types.d.ts +117 -0
  581. package/dist/types/core/charts/waterfall/fixtures.d.ts +9 -0
  582. package/dist/types/core/claims/browser.d.ts +49 -0
  583. package/dist/types/core/claims/manifest.d.ts +22 -0
  584. package/dist/types/core/dateFormat.d.ts +39 -0
  585. package/dist/types/core/deferred.d.ts +121 -0
  586. package/dist/types/core/diagnostics/describe.d.ts +149 -0
  587. package/dist/types/core/diagnostics/jsonPatch.d.ts +36 -0
  588. package/dist/types/core/doc/bareChart.d.ts +2 -0
  589. package/dist/types/core/doc/diagnostics.d.ts +124 -0
  590. package/dist/types/core/doc/docExpand.d.ts +39 -0
  591. package/dist/types/core/doc/document.d.ts +43 -0
  592. package/dist/types/core/doc/ownedDocumentCopy.d.ts +5 -0
  593. package/dist/types/core/doc/specError.d.ts +6 -0
  594. package/dist/types/core/emptyData.d.ts +27 -0
  595. package/dist/types/core/eventLane.d.ts +208 -0
  596. package/dist/types/core/fontMetrics/index.d.ts +47 -0
  597. package/dist/types/core/fontMetrics/injected.d.ts +40 -0
  598. package/dist/types/core/fontMetrics/tableDocument.d.ts +73 -0
  599. package/dist/types/core/fontMetrics/tables.generated.d.ts +17 -0
  600. package/dist/types/core/footer.d.ts +59 -0
  601. package/dist/types/core/format.d.ts +149 -0
  602. package/dist/types/core/formatPrecision.d.ts +136 -0
  603. package/dist/types/core/formatSpec.d.ts +302 -0
  604. package/dist/types/core/frame.d.ts +583 -0
  605. package/dist/types/core/geo/packs/all.d.ts +7 -0
  606. package/dist/types/core/geo/packs/dach.d.ts +16 -0
  607. package/dist/types/core/geo/packs/de-states.d.ts +16 -0
  608. package/dist/types/core/geo/packs/eu27.d.ts +16 -0
  609. package/dist/types/core/geo/packs/europe.d.ts +16 -0
  610. package/dist/types/core/geo/packs/index.d.ts +22 -0
  611. package/dist/types/core/geo/packs/registry.d.ts +37 -0
  612. package/dist/types/core/geo/packs/us-states.d.ts +16 -0
  613. package/dist/types/core/geo/packs/world.d.ts +16 -0
  614. package/dist/types/core/geo/tiles/eu27.generated.d.ts +412 -0
  615. package/dist/types/core/geo/tiles/europe.generated.d.ts +842 -0
  616. package/dist/types/core/geo/tiles/index.d.ts +8 -0
  617. package/dist/types/core/geo/tiles/types.d.ts +36 -0
  618. package/dist/types/core/geo/tiles/us-states.generated.d.ts +952 -0
  619. package/dist/types/core/geo/tiles/world.generated.d.ts +968 -0
  620. package/dist/types/core/geo/types.d.ts +146 -0
  621. package/dist/types/core/geometry.d.ts +102 -0
  622. package/dist/types/core/grid/sharedScale.d.ts +82 -0
  623. package/dist/types/core/icons.d.ts +227 -0
  624. package/dist/types/core/inputError.d.ts +14 -0
  625. package/dist/types/core/isoDate.d.ts +2 -0
  626. package/dist/types/core/isoTime.d.ts +7 -0
  627. package/dist/types/core/label/categoryRow.d.ts +332 -0
  628. package/dist/types/core/label/occupied.d.ts +41 -0
  629. package/dist/types/core/label/ownership.d.ts +83 -0
  630. package/dist/types/core/label/solver.d.ts +380 -0
  631. package/dist/types/core/label/tickRow.d.ts +78 -0
  632. package/dist/types/core/live/types.d.ts +50 -0
  633. package/dist/types/core/normalize/shared.d.ts +56 -0
  634. package/dist/types/core/notes.d.ts +174 -0
  635. package/dist/types/core/othersShade.d.ts +9 -0
  636. package/dist/types/core/periodYears.d.ts +9 -0
  637. package/dist/types/core/polyline.d.ts +11 -0
  638. package/dist/types/core/rangeRules.d.ts +19 -0
  639. package/dist/types/core/ratioTier.d.ts +120 -0
  640. package/dist/types/core/readerStrings.d.ts +13 -0
  641. package/dist/types/core/reading.d.ts +120 -0
  642. package/dist/types/core/registry.d.ts +178 -0
  643. package/dist/types/core/repaintGeometry.d.ts +19 -0
  644. package/dist/types/core/request.d.ts +124 -0
  645. package/dist/types/core/rows.d.ts +45 -0
  646. package/dist/types/core/scale.d.ts +106 -0
  647. package/dist/types/core/schema/capability.d.ts +229 -0
  648. package/dist/types/core/schema/namedColumns.d.ts +45 -0
  649. package/dist/types/core/schema/reference.d.ts +31 -0
  650. package/dist/types/core/schema/refusals.d.ts +45 -0
  651. package/dist/types/core/schema/unknownKeys.d.ts +45 -0
  652. package/dist/types/core/seriesIdentity.d.ts +120 -0
  653. package/dist/types/core/shareRounding.d.ts +49 -0
  654. package/dist/types/core/sizing.d.ts +330 -0
  655. package/dist/types/core/staticFooter.d.ts +6 -0
  656. package/dist/types/core/story.d.ts +41 -0
  657. package/dist/types/core/structureCounts.d.ts +10 -0
  658. package/dist/types/core/svg/renderSvg.d.ts +51 -0
  659. package/dist/types/core/target.d.ts +89 -0
  660. package/dist/types/core/text.d.ts +113 -0
  661. package/dist/types/core/theme.d.ts +478 -0
  662. package/dist/types/core/themeFields.d.ts +11 -0
  663. package/dist/types/core/themeRules.d.ts +111 -0
  664. package/dist/types/core/themeShape.d.ts +87 -0
  665. package/dist/types/core/themeValidate.d.ts +15 -0
  666. package/dist/types/core/timeAxis.d.ts +106 -0
  667. package/dist/types/core/types/annotations.d.ts +223 -0
  668. package/dist/types/core/types/cell.d.ts +82 -0
  669. package/dist/types/core/types/data.d.ts +309 -0
  670. package/dist/types/core/types/diagram.d.ts +234 -0
  671. package/dist/types/core/types/index.d.ts +8 -0
  672. package/dist/types/core/types/options.d.ts +1583 -0
  673. package/dist/types/core/types/scene.d.ts +990 -0
  674. package/dist/types/core/types/sizing.d.ts +51 -0
  675. package/dist/types/core/types/table.d.ts +873 -0
  676. package/dist/types/core/types/theme.d.ts +806 -0
  677. package/dist/types/core/zoom.d.ts +106 -0
  678. package/dist/types/fixtures/index.d.ts +40 -0
  679. package/dist/types/fixtures/registry.d.ts +15 -0
  680. package/dist/types/fonts.d.ts +10 -0
  681. package/dist/types/index.d.ts +70 -0
  682. package/dist/types/react/BoardplotTheme.d.ts +9 -0
  683. package/dist/types/react/DimSwitchChart.d.ts +36 -0
  684. package/dist/types/react/ScaleGroup.d.ts +31 -0
  685. package/dist/types/react/SceneRenderer.d.ts +23 -0
  686. package/dist/types/react/SizePlaceholder.d.ts +51 -0
  687. package/dist/types/react/StoryFrame.d.ts +42 -0
  688. package/dist/types/react/TableChart.d.ts +220 -0
  689. package/dist/types/react/a11ySurface.d.ts +20 -0
  690. package/dist/types/react/barrelCharts.d.ts +1023 -0
  691. package/dist/types/react/charts/bar.d.ts +28 -0
  692. package/dist/types/react/charts/bartable.d.ts +27 -0
  693. package/dist/types/react/charts/box.d.ts +27 -0
  694. package/dist/types/react/charts/bullet.d.ts +28 -0
  695. package/dist/types/react/charts/butterfly.d.ts +28 -0
  696. package/dist/types/react/charts/choropleth.d.ts +27 -0
  697. package/dist/types/react/charts/cohort.d.ts +52 -0
  698. package/dist/types/react/charts/column.d.ts +27 -0
  699. package/dist/types/react/charts/combo.d.ts +7 -0
  700. package/dist/types/react/charts/creative.d.ts +27 -0
  701. package/dist/types/react/charts/diagram.d.ts +162 -0
  702. package/dist/types/react/charts/dimswitch.d.ts +6 -0
  703. package/dist/types/react/charts/dot.d.ts +28 -0
  704. package/dist/types/react/charts/funnel.d.ts +28 -0
  705. package/dist/types/react/charts/gantt.d.ts +28 -0
  706. package/dist/types/react/charts/grid.d.ts +29 -0
  707. package/dist/types/react/charts/heatmap.d.ts +28 -0
  708. package/dist/types/react/charts/histogram.d.ts +27 -0
  709. package/dist/types/react/charts/kpi.d.ts +28 -0
  710. package/dist/types/react/charts/likert.d.ts +27 -0
  711. package/dist/types/react/charts/line.d.ts +28 -0
  712. package/dist/types/react/charts/mekko.d.ts +28 -0
  713. package/dist/types/react/charts/pareto.d.ts +28 -0
  714. package/dist/types/react/charts/pie.d.ts +28 -0
  715. package/dist/types/react/charts/pvm.d.ts +27 -0
  716. package/dist/types/react/charts/pyramid.d.ts +27 -0
  717. package/dist/types/react/charts/sankey.d.ts +27 -0
  718. package/dist/types/react/charts/scatter.d.ts +28 -0
  719. package/dist/types/react/charts/slope.d.ts +28 -0
  720. package/dist/types/react/charts/sparkline.d.ts +28 -0
  721. package/dist/types/react/charts/status.d.ts +27 -0
  722. package/dist/types/react/charts/table.d.ts +6 -0
  723. package/dist/types/react/charts/tilemap.d.ts +27 -0
  724. package/dist/types/react/charts/treemap.d.ts +27 -0
  725. package/dist/types/react/charts/variance.d.ts +28 -0
  726. package/dist/types/react/charts/waffle.d.ts +28 -0
  727. package/dist/types/react/charts/waterfall.d.ts +28 -0
  728. package/dist/types/react/createChartComponent.d.ts +135 -0
  729. package/dist/types/react/export/clipboard.d.ts +8 -0
  730. package/dist/types/react/export/csv.d.ts +2 -0
  731. package/dist/types/react/export/frame.d.ts +35 -0
  732. package/dist/types/react/export/index.d.ts +7 -0
  733. package/dist/types/react/export/png.d.ts +14 -0
  734. package/dist/types/react/export/svg.d.ts +5 -0
  735. package/dist/types/react/export/types.d.ts +69 -0
  736. package/dist/types/react/export/useExport.d.ts +17 -0
  737. package/dist/types/react/exportLink.d.ts +49 -0
  738. package/dist/types/react/footerFrame.d.ts +25 -0
  739. package/dist/types/react/hover/dataTable.d.ts +13 -0
  740. package/dist/types/react/hover/engine.d.ts +210 -0
  741. package/dist/types/react/hover/keyboard.d.ts +44 -0
  742. package/dist/types/react/hover/labelCard.d.ts +170 -0
  743. package/dist/types/react/hover/placement.d.ts +49 -0
  744. package/dist/types/react/index.d.ts +16 -0
  745. package/dist/types/react/parseChartSpec.d.ts +16 -0
  746. package/dist/types/react/prepare.d.ts +32 -0
  747. package/dist/types/react/prepared.d.ts +53 -0
  748. package/dist/types/react/preparedTable.d.ts +15 -0
  749. package/dist/types/react/rowsInput.d.ts +55 -0
  750. package/dist/types/react/rowsModule.d.ts +18 -0
  751. package/dist/types/react/rowsStore.d.ts +50 -0
  752. package/dist/types/react/scale-group.d.ts +2 -0
  753. package/dist/types/react/scaleGroupContext.d.ts +22 -0
  754. package/dist/types/react/scenePaint.d.ts +10 -0
  755. package/dist/types/react/scrollState.d.ts +26 -0
  756. package/dist/types/react/spec.d.ts +65 -0
  757. package/dist/types/react/specValidation.d.ts +45 -0
  758. package/dist/types/react/story.d.ts +15 -0
  759. package/dist/types/react/theme.d.ts +9 -0
  760. package/dist/types/react/themeContext.d.ts +44 -0
  761. package/dist/types/react/useChartLayout.d.ts +22 -0
  762. package/dist/types/react/useContainerSize.d.ts +57 -0
  763. package/dist/types/react/useHover.d.ts +100 -0
  764. package/dist/types/react/useZoom.d.ts +50 -0
  765. package/dist/types/rows.d.ts +58 -0
  766. package/dist/types/tableLooks.d.ts +6 -0
  767. package/dist/types/theme.d.ts +3 -0
  768. package/dist/types/validate.d.ts +3 -0
  769. package/dist/validate.d.ts +1 -0
  770. package/dist/validate.js +222 -0
  771. package/docs/FONTS.md +68 -0
  772. package/docs/TELEMETRY.md +94 -0
  773. package/docs/manual.md +838 -0
  774. package/docs/reference/bar.md +222 -0
  775. package/docs/reference/bartable.md +143 -0
  776. package/docs/reference/box.md +93 -0
  777. package/docs/reference/bullet.md +118 -0
  778. package/docs/reference/butterfly.md +117 -0
  779. package/docs/reference/choropleth.md +148 -0
  780. package/docs/reference/cohort.md +149 -0
  781. package/docs/reference/column.md +275 -0
  782. package/docs/reference/combo.md +219 -0
  783. package/docs/reference/creative.md +147 -0
  784. package/docs/reference/diagram.md +191 -0
  785. package/docs/reference/dimswitch.md +1395 -0
  786. package/docs/reference/dot.md +117 -0
  787. package/docs/reference/fixtures.md +1088 -0
  788. package/docs/reference/funnel.md +121 -0
  789. package/docs/reference/gantt.md +132 -0
  790. package/docs/reference/grid.md +302 -0
  791. package/docs/reference/heatmap.md +127 -0
  792. package/docs/reference/histogram.md +77 -0
  793. package/docs/reference/kpi.md +115 -0
  794. package/docs/reference/likert.md +113 -0
  795. package/docs/reference/line.md +436 -0
  796. package/docs/reference/mekko.md +114 -0
  797. package/docs/reference/options.md +313 -0
  798. package/docs/reference/pareto.md +102 -0
  799. package/docs/reference/pie.md +114 -0
  800. package/docs/reference/pvm.md +114 -0
  801. package/docs/reference/pyramid.md +99 -0
  802. package/docs/reference/react.md +703 -0
  803. package/docs/reference/reading.md +28 -0
  804. package/docs/reference/sankey.md +110 -0
  805. package/docs/reference/scatter.md +211 -0
  806. package/docs/reference/slope.md +126 -0
  807. package/docs/reference/sparkline.md +74 -0
  808. package/docs/reference/status.md +107 -0
  809. package/docs/reference/table.md +673 -0
  810. package/docs/reference/theme.md +361 -0
  811. package/docs/reference/tilemap.md +121 -0
  812. package/docs/reference/treemap.md +86 -0
  813. package/docs/reference/variance.md +126 -0
  814. package/docs/reference/waffle.md +106 -0
  815. package/docs/reference/waterfall.md +164 -0
  816. package/llms.txt +57 -0
  817. package/package.json +437 -4
@@ -0,0 +1,1410 @@
1
+ import {
2
+ INSIDE_MIN_H,
3
+ INSIDE_MIN_W
4
+ } from "./chunk-HJXXFPOL.js";
5
+ import {
6
+ warnMissingValue
7
+ } from "./chunk-7QDAHY5M.js";
8
+ import {
9
+ labelOn
10
+ } from "./chunk-V667FCIJ.js";
11
+ import {
12
+ annotateEngine,
13
+ runAnnotatePass
14
+ } from "./chunk-GQS46LC3.js";
15
+ import {
16
+ chartPalette,
17
+ chartTheme
18
+ } from "./chunk-SXGTRZFN.js";
19
+ import {
20
+ structureCount
21
+ } from "./chunk-B2EBEXIS.js";
22
+ import {
23
+ calendarCategories,
24
+ chartSizing,
25
+ linearScale,
26
+ rowSizing,
27
+ warnSpreadOverflow
28
+ } from "./chunk-GQPESFAF.js";
29
+ import {
30
+ prepareFractionData
31
+ } from "./chunk-3EZRM4YM.js";
32
+ import {
33
+ PRIORITY,
34
+ SWATCH_RESERVE,
35
+ adjacentSeriesWarnings,
36
+ authoredFootnoteCount,
37
+ authoredNotes,
38
+ clamp,
39
+ composedTextRole,
40
+ createOccupiedIndex,
41
+ fitText,
42
+ footnoteSuffix,
43
+ frameTextOptions,
44
+ labelCtx,
45
+ labelsToNodes,
46
+ normalizeLegendOption,
47
+ rectContains,
48
+ rectSeriesAdjacentWarnings,
49
+ rectsOverlap,
50
+ retainAdjacentWarningRule,
51
+ solveFrame,
52
+ solveLabels
53
+ } from "./chunk-2JAWQ7VV.js";
54
+ import {
55
+ disclosureNote
56
+ } from "./chunk-YTSSXSZR.js";
57
+ import {
58
+ formatterFromExample,
59
+ seriesRasterFormatter
60
+ } from "./chunk-ASAON7G4.js";
61
+ import {
62
+ MINUS,
63
+ chartStrings,
64
+ formatAutomaticNumber,
65
+ formatAutomaticPercent,
66
+ notApplicableGlyph,
67
+ smallRateDecimals
68
+ } from "./chunk-YQ2B3YVF.js";
69
+ import {
70
+ cellMeta,
71
+ cellValue
72
+ } from "./chunk-OAPCJO6W.js";
73
+ import {
74
+ PLAN_MUTED_PAINT,
75
+ STAGE_SHADE_MAX,
76
+ canvasMargin,
77
+ effectiveFill,
78
+ emphasisWeight,
79
+ isOthersFill,
80
+ markRolePaint,
81
+ mixedPaint,
82
+ othersSeparation,
83
+ paintColor,
84
+ seriesPaint,
85
+ solidMutedPlan,
86
+ strokeToken,
87
+ withSegmentSeams
88
+ } from "./chunk-II7652VA.js";
89
+ import {
90
+ NormalizeError,
91
+ accessibleTitle,
92
+ normalizeCategory,
93
+ normalizeScenario,
94
+ normalizeSeriesValues,
95
+ resolveHighlight,
96
+ resolveSize
97
+ } from "./chunk-SGD3ZHID.js";
98
+ import {
99
+ maxOf,
100
+ pushAll
101
+ } from "./chunk-WYJEOMNY.js";
102
+ import {
103
+ defaultMeasurer
104
+ } from "./chunk-TXINIAFL.js";
105
+
106
+ // src/core/strings/funnel.ts
107
+ var EN = {
108
+ // reader-facing wording linked only by its consumers.
109
+ funnelTitle: "Funnel: {v1} to {v2}",
110
+ stagesCount: "{v1} stage{v2}",
111
+ funnelDesc: "Funnel chart with {v1} stage{v2}. {v3}.",
112
+ funnelUndefined: "{v1}: not defined, the previous stage is zero.",
113
+ totalCvr: "Total CVR",
114
+ stepCvr: "Step CVR",
115
+ // A spanning head over the two short column heads.
116
+ cvrSpanHeader: "Conversion rate",
117
+ stepCvrShort: "Step",
118
+ totalCvrShort: "Total",
119
+ centeredFunnelDesc: "Centered funnel chart with {v1} equal-height stage bands; width at each boundary is proportional to the stage total. {v2}.",
120
+ stageIncreased: "\u2191 increased",
121
+ stageAdvance: "{v1} advance",
122
+ previousStageZero: "not defined: previous stage is zero",
123
+ advanceProbe: "44% advance",
124
+ missing: "missing",
125
+ funnelIncreaseDesc: " ({v1} \u2192 {v2}: stage total increased; conversion percentage not shown)",
126
+ funnelConversionDesc: " ({v1} \u2192 {v2}: {v3} conversion)",
127
+ stageCvrDesc: "{v1} {v2}; stage CVR {v3}; total CVR {v4}",
128
+ clampedFunnelNote: "{v1} {v2} below zero shown as 0.",
129
+ biggestDrop: "Biggest drop: {v1}",
130
+ dropValue: "Drop {v1}",
131
+ stagePair: "{v1} to {v2}"
132
+ }, DE = {
133
+ // reader-facing wording linked only by its consumers.
134
+ funnelTitle: "Trichter: {v1} bis {v2}",
135
+ stagesCount: "{v1} {v1|Stufe|Stufen}",
136
+ funnelDesc: "Trichterdiagramm mit {v1} {v1|Stufe|Stufen}. {v3}.",
137
+ funnelUndefined: "{v1}: nicht definiert, vorherige Stufe ist null.",
138
+ totalCvr: "Gesamt-CVR",
139
+ stepCvr: "Stufen-CVR",
140
+ // A spanning head over the two short column heads.
141
+ cvrSpanHeader: "Konversionsrate",
142
+ stepCvrShort: "Stufe",
143
+ totalCvrShort: "Gesamt",
144
+ centeredFunnelDesc: "Zentriertes Trichterdiagramm mit {v1} {v1|gleich hoher Stufe|gleich hohen Stufen}. Die Breite jeder Grenze ist proportional zur Summe der Stufe. {v2}.",
145
+ stageIncreased: "\u2191 gestiegen",
146
+ stageAdvance: "{v1} weiter",
147
+ previousStageZero: "nicht definiert: vorherige Stufe ist null",
148
+ advanceProbe: "44% weiter",
149
+ missing: "fehlend",
150
+ funnelIncreaseDesc: " ({v1} \u2192 {v2}: Stufensumme gestiegen; Umwandlungsprozentsatz nicht gezeigt)",
151
+ funnelConversionDesc: " ({v1} \u2192 {v2}: {v3} Umwandlung)",
152
+ stageCvrDesc: "{v1} {v2}; Stufen-CVR {v3}; Gesamt-CVR {v4}",
153
+ clampedFunnelNote: "{v1} {v1|Wert|Werte} unter null als 0 gezeigt.",
154
+ biggestDrop: "Gr\xF6\xDFter Abfall: {v1}",
155
+ dropValue: "Abfall {v1}",
156
+ stagePair: "{v1} bis {v2}"
157
+ }, { chartString } = chartStrings(EN, DE);
158
+
159
+ // src/core/charts/funnel/derive.ts
160
+ function clampedNote(clamped, options) {
161
+ return clamped === 0 ? [] : [disclosureNote(chartString(options, "clampedFunnelNote", { v1: clamped, v2: clamped === 1 ? "value" : "values" }))];
162
+ }
163
+ function deriveFunnel(plotted, stages, fmt, warnings) {
164
+ let clamped = 0, raw = plotted.map(() => []), values = plotted.map(
165
+ (s, si) => normalizeSeriesValues(s, stages, si).map((cell, ci) => {
166
+ let v = cellValue(cell);
167
+ raw[si][ci] = v;
168
+ let owner = { seriesId: s.id, categoryId: stages[ci].id };
169
+ return v === null ? (warnMissingValue(
170
+ warnings,
171
+ `series '${s.id}' at stage '${stages[ci].id}'`,
172
+ owner,
173
+ "no segment, no stage total and no conversion to or from that stage"
174
+ ), null) : v < 0 ? (warnings.push({
175
+ code: "negative-value",
176
+ severity: "warn",
177
+ message: `series '${s.id}' at stage '${stages[ci].id}': negative value ${v} clamped to 0`,
178
+ owner
179
+ }), clamped++, 0) : v;
180
+ })
181
+ ), stageTotals = {}, shownTotals = {}, clampedStage = stages.map((_c, ci) => raw.some((row) => (row[ci] ?? 0) < 0)), known = stages.map((c, ci) => {
182
+ let cells = values.map((row) => row[ci] ?? null), sum = cells.reduce((a, v) => a + (v ?? 0), 0);
183
+ return stageTotals[c.id] = cells.includes(null) ? null : sum, shownTotals[c.id] = cells.includes(null) ? null : raw.reduce((a, row) => a + row[ci], 0), sum;
184
+ }), conversions = [], undefinedSteps = [];
185
+ for (let ci = 0; ci < stages.length - 1; ci++) {
186
+ let from = stages[ci], to = stages[ci + 1], fromTotal = stageTotals[from.id] ?? null, toTotal = stageTotals[to.id] ?? null;
187
+ if (!(fromTotal === null || toTotal === null || clampedStage[ci] || clampedStage[ci + 1])) {
188
+ if (toTotal > fromTotal && warnings.push({
189
+ code: "funnel-stage-increased",
190
+ severity: "warn",
191
+ message: `stage total increased from '${from.id}' (${fmt(fromTotal)}) to '${to.id}' (${fmt(toTotal)}) \u2014 conversion is not shown as a percentage`,
192
+ owner: { categoryId: from.id }
193
+ }), fromTotal <= 0) {
194
+ warnings.push({
195
+ code: "conversion-undefined",
196
+ severity: "warn",
197
+ message: `stage '${from.id}' has zero total \u2014 conversion to '${to.id}' is undefined`,
198
+ owner: { categoryId: from.id }
199
+ }), undefinedSteps.push({ fromId: from.id, toId: to.id });
200
+ continue;
201
+ }
202
+ conversions.push({ fromId: from.id, toId: to.id, rate: toTotal / fromTotal });
203
+ }
204
+ }
205
+ let worstDrop;
206
+ for (let c of conversions)
207
+ c.rate <= 1 && (!worstDrop || c.rate < worstDrop.rate) && (worstDrop = c);
208
+ return { values, known, stageTotals, shownTotals, clampedStages: clampedStage, conversions, undefinedSteps, clamped, ...worstDrop ? { worstDrop } : {} };
209
+ }
210
+ function missingGlyph(theme) {
211
+ return theme.table?.glyphs?.missing ?? "\u2013";
212
+ }
213
+
214
+ // src/core/charts/funnel/centered.ts
215
+ var CVR_SPAN_HEADER = "cvr:span-header";
216
+ function stageLabelInfo(name, value, font, measure) {
217
+ let lines = value ? [name, value] : [name];
218
+ return {
219
+ text: lines.join(" \xB7 "),
220
+ lines,
221
+ w: Math.max(...lines.map((line) => measure(line, font).width)),
222
+ h: font.size * (font.lineHeight ?? 1.2) * lines.length
223
+ };
224
+ }
225
+ function centeredLabelNodes(theme, labels, strong, header, labelFont, marks) {
226
+ let emitted = labelsToNodes(theme, labels, (label) => label.id.startsWith("stage:") ? strong : label.id === "total-cvr:header" || label.id === "step-cvr:header" || label.id === CVR_SPAN_HEADER ? header : labelFont, marks), byNode = new Map(labels.map((label) => [label.nodeId, label]));
227
+ for (let node of emitted) {
228
+ if (node.t !== "text" || !node.id.endsWith(":body")) continue;
229
+ let label = byNode.get(node.id.slice(0, -5));
230
+ if (!label?.align) continue;
231
+ node.x = label.align === "middle" ? label.rect.x + label.rect.w / 2 : label.rect.x + label.rect.w, node.align = label.align, node.role = composedTextRole(node.lines.join(" "));
232
+ let head = emitted.find((item) => item.id === label.nodeId);
233
+ if (head?.t === "text") {
234
+ let round = (v) => Math.round(v * 100) / 100;
235
+ head.y = round(head.y), node.y = round(head.y + node.font.size * (node.font.lineHeight ?? 1.2));
236
+ }
237
+ }
238
+ return emitted;
239
+ }
240
+ var LABEL_COLUMN_GAP = 8;
241
+ function rampFunnelPaint(theme, plotted, series, stageIndex, palette, stageCount) {
242
+ if (theme.marks?.funnelFill !== "ramp" || series.fill) return;
243
+ let ramp = theme.color.palettes?.[palette ?? ""] ?? theme.color.series;
244
+ if (plotted.length === 1 && stageCount > ramp.length) return;
245
+ let lost = (candidate) => candidate.colorRole === "status-lost" || candidate.colorRole === "bad";
246
+ if (lost(series)) return { token: "badFill", tint: 0.55 };
247
+ let rank = plotted.length === 1 ? stageIndex : plotted.filter((candidate) => !lost(candidate)).indexOf(series);
248
+ return seriesPaint(Math.max(0, rank), palette);
249
+ }
250
+ function shadeStage(paint, index, count, direction) {
251
+ let progress = index / (count - 1);
252
+ return shadeBy(paint, STAGE_SHADE_MAX * (direction === "lighten" ? progress : 1 - progress));
253
+ }
254
+ function shadeBy(paint, amount) {
255
+ return amount <= 0 ? paint : mixedPaint(paint, { token: "background", theme: { kind: "brighter-pole" } }, 1 - amount, "token" in paint ? paint.token : "series-1");
256
+ }
257
+ function insideStagePaint(paint, pattern, theme) {
258
+ return {
259
+ insidePaint: paint,
260
+ insidePattern: pattern,
261
+ insideFill: effectiveFill(paintColor(theme, paint), pattern, theme)
262
+ };
263
+ }
264
+ var MIN_FUNNEL_W = 96, MIN_FUNNEL_W_COMPACT = 64;
265
+ function layoutCenteredFunnel(data, options) {
266
+ let warnings = [];
267
+ options.bandFraction !== void 0 && warnings.push({
268
+ code: "funnel-centered-band-fraction-ignored",
269
+ severity: "info",
270
+ message: "variant:'centered' uses equal, contiguous stage heights \u2014 bandFraction is ignored"
271
+ }), options.worstDropCallout && warnings.push({ code: "funnel-worst-drop-callout-rows-only", severity: "warn", message: "funnel worstDropCallout requires variant:'rows' \u2014 ignored" });
272
+ let theme = chartTheme(options), na = notApplicableGlyph(options.strings), paletteRamp = chartPalette(theme, options.palette, warnings), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, autoDecimals = (value) => Number.isInteger(value) || Math.abs(value) >= 100 ? 0 : 1, fmt = options.format ? formatterFromExample(options.format, options.locale?.language) : (value) => formatAutomaticNumber(value, { locale: options.locale?.language, decimals: autoDecimals(value) }), fmtPct = (rate) => {
273
+ let pct = rate * 100;
274
+ return formatAutomaticPercent(pct, smallRateDecimals(pct), !1, options.locale?.language);
275
+ }, highlights = new Set(resolveHighlight(options.highlight)), labelsOpt = options.labels, labelOn2 = (kind) => labelOn(options, kind);
276
+ if (!data || !Array.isArray(data.categories) || data.categories.length === 0)
277
+ throw new NormalizeError("empty-data", "categories", "funnel requires at least one stage");
278
+ if (!Array.isArray(data.series) || data.series.length === 0)
279
+ throw new NormalizeError("empty-data", "series", "funnel requires at least one series");
280
+ let stages = data.categories.map(
281
+ (category, index) => normalizeCategory(category, index)
282
+ ), plotted = data.series.filter((series) => series.role !== "reference");
283
+ if (plotted.length === 0)
284
+ throw new NormalizeError("empty-data", "series", "funnel requires at least one data-role series");
285
+ let numbers = deriveFunnel(plotted, stages, fmt, warnings), { stageTotals, conversions, worstDrop } = numbers, values = numbers.values.map((row) => row.map((value) => value ?? 0)), glyph = missingGlyph(theme), cells = plotted.map((series, si) => normalizeSeriesValues(series, stages, si));
286
+ plotted.length > 1 && cells.some((row) => row.some((cell) => cellMeta(cell)?.label !== void 0)) && warnings.push({
287
+ code: "funnel-cell-label-ignored",
288
+ severity: "warn",
289
+ message: "values[].label has no effect on a centered funnel with several series because each stage prints its total, not segment values.",
290
+ suggest: "Set variant: 'rows' to show the cell labels, or remove values[].label."
291
+ });
292
+ let formats = stages.map((_, ci) => seriesRasterFormatter(options.format, plotted.length === 1 ? numbers.values[0] : plotted.map((_2, si) => numbers.values[si][ci]), options.locale?.language, options.unit, options.target, void 0, !0)), totalRaster = seriesRasterFormatter(options.format, Object.values(stageTotals), options.locale?.language, options.unit, options.target), totalFmt = totalRaster.fmt;
293
+ if (!options.format) for (let format of [...formats, totalRaster]) format.spec.wholeCounts = !0;
294
+ let valueText = (si, ci, value) => formats[ci].forSeries(plotted[si], cellMeta(cells[si][ci])?.format)(value), firstTotal = stageTotals[stages[0].id] ?? null, cumulativeCvrs = stages.map((stage, ci) => {
295
+ let total = stageTotals[stage.id] ?? null, measurable = !numbers.clampedStages[0] && !numbers.clampedStages[ci];
296
+ return { stageId: stage.id, rate: measurable && firstTotal !== null && firstTotal > 0 && total !== null ? total / firstTotal : null };
297
+ }), totalText = (stage) => {
298
+ let total = numbers.shownTotals[stage.id] ?? null;
299
+ if (total === null) return glyph;
300
+ if (plotted.length !== 1) return totalFmt(total);
301
+ let ci = stages.findIndex((item) => item.id === stage.id), label = cellMeta(cells[0][ci])?.label, text = valueText(0, ci, total);
302
+ return label === !1 ? "" : typeof label == "string" ? label.replace(/\$\{value\}/g, text) : text;
303
+ }, stageCvrText = (categoryIndex) => {
304
+ if (categoryIndex === 0) return "\u2013";
305
+ let previous = stages[categoryIndex - 1], stage = stages[categoryIndex], conversion = conversions.find(
306
+ (candidate) => candidate.fromId === previous.id && candidate.toId === stage.id
307
+ );
308
+ return conversion ? conversion.rate > 1 ? "increased" : fmtPct(conversion.rate) : na;
309
+ }, cumulativeCvrText = (rate) => rate === null ? na : rate > 1 ? "increased" : fmtPct(rate), occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), sides = canvasMargin(theme, size.width), margin = { top: 20, right: sides.right, bottom: 16, left: sides.left, ...options.margin }, legendOpts = normalizeLegendOption(options.legend, plotted.length > 1 ? { position: "top" } : void 0), legendItems = plotted.map((series, seriesIndex) => ({
310
+ id: series.id,
311
+ label: series.label ?? series.id,
312
+ paint: seriesPaint2(series, seriesIndex),
313
+ pattern: centeredPattern(series)
314
+ }));
315
+ if (legendOpts?.order) {
316
+ let rank = new Map(legendOpts.order.map((id, index) => [id, index]));
317
+ legendItems.sort((a, b) => (rank.get(a.id) ?? 999) - (rank.get(b.id) ?? 999));
318
+ }
319
+ let frameResult = solveFrame(
320
+ {
321
+ size,
322
+ margin,
323
+ ...frameTextOptions(options),
324
+ footnotes: [
325
+ ...authoredNotes(options),
326
+ ...clampedNote(numbers.clamped, options),
327
+ ...numbers.undefinedSteps.length ? [disclosureNote(chartString(options, "funnelUndefined", { v1: na }))] : []
328
+ ],
329
+ legend: legendOpts ? { options: legendOpts, items: legendItems } : void 0,
330
+ theme,
331
+ measure
332
+ },
333
+ occupied
334
+ ), inner = frameResult.plot, labelFont = { family: theme.type.family, ...theme.type.label }, strongFont = { family: theme.type.family, ...theme.type.label, weight: emphasisWeight(theme) }, headerFont = { family: theme.type.family, ...theme.type.axis }, stageLabelInfos = stages.map((stage) => stageLabelInfo(
335
+ stage.label ?? stage.id,
336
+ totalText(stage),
337
+ strongFont,
338
+ measure
339
+ )), showTotalCvr = options.totalCvr === "column" && labelsOpt !== !1, cvrFont = strongFont, compactForm = options.mode === "compact", colPad = compactForm ? 10 : 16, splitHeads = compactForm, headLines = (text) => splitHeads ? text.split(" ") : [text], headSize = (text) => {
340
+ let lines = headLines(text);
341
+ return { width: Math.max(...lines.map((line) => measure(line, headerFont).width)), height: lines.length * measure(lines[0], headerFont).height };
342
+ }, spanForm = showTotalCvr && labelOn2("annotation") && labelOn2("point") && stages.length > 1, spanText = chartString(options, "cvrSpanHeader"), spanSize = measure(spanText, headerFont), cvrHeaderText = chartString(options, spanForm ? "totalCvrShort" : "totalCvr"), cvrHeaderSize = headSize(cvrHeaderText), cvrTexts = cumulativeCvrs.map((item) => cumulativeCvrText(item.rate)), cvrSizes = cvrTexts.map((text) => measure(text, cvrFont)), cvrBlockWidth = showTotalCvr ? Math.max(cvrHeaderSize.width, maxOf(cvrSizes.map((item) => item.width))) + colPad : 0, showStepCvr = labelsOpt !== !1 && labelOn2("point") && stages.length > 1, stepHeaderText = chartString(options, spanForm ? "stepCvrShort" : "stepCvr"), stepHeaderSize = headSize(stepHeaderText), stepTexts = stages.map((_, index) => stageCvrText(index)), stepSizes = stepTexts.map((text) => measure(text, labelFont)), stepBlockWidth = showStepCvr ? Math.max(stepHeaderSize.width, maxOf(stepSizes.map((item) => item.width))) + colPad : 0, headBlockH = () => 2 * measure(stepHeaderText.split(" ")[0] ?? "", headerFont).height, headerReserve = showTotalCvr || showStepCvr ? headBlockH() + 8 : 0, rowsTop = inner.y + headerReserve, rowsBottom = inner.y + inner.h, rowsHeight = Math.max(stages.length, rowsBottom - rowsTop), bandHeight = rowsHeight / stages.length, setTableForm = (split) => {
343
+ splitHeads = split, cvrHeaderSize = headSize(cvrHeaderText), cvrBlockWidth = showTotalCvr ? Math.max(cvrHeaderSize.width, maxOf(cvrSizes.map((item) => item.width))) + colPad : 0, stepHeaderSize = headSize(stepHeaderText), stepBlockWidth = showStepCvr ? Math.max(stepHeaderSize.width, maxOf(stepSizes.map((item) => item.width))) + colPad : 0, headerReserve = showTotalCvr || showStepCvr ? headBlockH() + 8 : 0, rowsTop = inner.y + headerReserve, rowsHeight = Math.max(stages.length, rowsBottom - rowsTop), bandHeight = rowsHeight / stages.length;
344
+ }, maxTotal = Math.max(0, maxOf(numbers.known)), boundaryWidthFor = (categoryIndex, funnelWidth2) => maxTotal > 0 ? numbers.known[categoryIndex] / maxTotal * funnelWidth2 : 0, fitsInside = (categoryIndex, funnelWidth2, label) => {
345
+ if (label.h + 6 > bandHeight) return !1;
346
+ let topWidth = boundaryWidthFor(categoryIndex, funnelWidth2), bottomWidth = boundaryWidthFor(
347
+ Math.min(categoryIndex + 1, stages.length - 1),
348
+ funnelWidth2
349
+ ), topT = clamp((bandHeight - label.h) / 2 / bandHeight, 0, 1), bottomT = clamp((bandHeight + label.h) / 2 / bandHeight, 0, 1), widthAt = (t) => topWidth + (bottomWidth - topWidth) * t;
350
+ return Math.min(widthAt(topT), widthAt(bottomT)) >= label.w + 12;
351
+ }, minFunnelW = compactForm ? MIN_FUNNEL_W_COMPACT : MIN_FUNNEL_W, cagrReserve = (options.annotations ?? []).some((ann) => ann.kind === "cagr") ? measure("\u2212100.0% p.a.", strongFont).width + (compactForm ? 24 : 48) : 0, fitAllInside = () => stageLabelInfos.every((label, categoryIndex) => fitsInside(categoryIndex, Math.max(10, inner.w - stepBlockWidth - cvrBlockWidth - cagrReserve), label)), allInside = fitAllInside();
352
+ !allInside && !splitHeads && labelOn2("total") && (setTableForm(!0), allInside = fitAllInside());
353
+ let labelColumnW = labelOn2("total") && !allInside ? maxOf(stageLabelInfos.map((label) => label.w)) + LABEL_COLUMN_GAP : 0, funnelWidth = Math.max(10, inner.w - stepBlockWidth - cvrBlockWidth - cagrReserve - labelColumnW), funnelLeft = inner.x + labelColumnW, narrowestFunnel = 1 / 0, columnW = labelOn2("total") ? maxOf(stageLabelInfos.map((label) => label.w)) + LABEL_COLUMN_GAP : 0;
354
+ for (let w = minFunnelW; w <= Math.max(minFunnelW, 640); w += 4) {
355
+ let outside = stageLabelInfos.every((label, ci) => fitsInside(ci, w, label)) ? 0 : columnW;
356
+ if (narrowestFunnel = Math.min(narrowestFunnel, w + outside), outside === 0) break;
357
+ }
358
+ narrowestFunnel = Math.min(narrowestFunnel, minFunnelW + columnW);
359
+ let axisX = funnelLeft + funnelWidth / 2, stepX = funnelLeft + funnelWidth + cagrReserve + 8, cvrX = stepX + stepBlockWidth, headY = (h) => inner.y + Math.max(0, headerReserve - 8 - h), flushRight = (x, block, w) => x + Math.max(0, block - colPad) - w, boundaryWidths = {};
360
+ stages.forEach((stage, categoryIndex) => {
361
+ boundaryWidths[stage.id] = boundaryWidthFor(categoryIndex, funnelWidth);
362
+ });
363
+ let plot = { x: funnelLeft, y: rowsTop, w: funnelWidth, h: rowsHeight }, nodes = [...frameResult.nodes], marks = { rows: [] }, labelRequests = [], rowLanes = [];
364
+ stages.forEach((stage, categoryIndex) => {
365
+ let yTop = rowsTop + categoryIndex * bandHeight, yBottom = yTop + bandHeight, nextIndex = Math.min(categoryIndex + 1, stages.length - 1), topWidth = boundaryWidths[stage.id], bottomWidth = boundaryWidths[stages[nextIndex].id], fullRect = {
366
+ x: axisX - Math.max(topWidth, bottomWidth) / 2,
367
+ y: yTop,
368
+ w: Math.max(topWidth, bottomWidth),
369
+ h: bandHeight
370
+ }, lane = { x: inner.x, y: yTop, w: inner.w, h: bandHeight };
371
+ rowLanes.push(lane);
372
+ let segmentRecords = [], topCumulative = 0, bottomCumulative = 0;
373
+ if (plotted.forEach((series, seriesIndex) => {
374
+ let topValue = values[seriesIndex][categoryIndex], bottomValue = values[seriesIndex][nextIndex], topLeft = axisX - topWidth / 2 + scaleValue(topCumulative), topRight = topLeft + scaleValue(topValue), bottomLeft = axisX - bottomWidth / 2 + scaleValue(bottomCumulative), bottomRight = bottomLeft + scaleValue(bottomValue);
375
+ if (topCumulative += topValue, bottomCumulative += bottomValue, topValue <= 0 && bottomValue <= 0 || numbers.values[seriesIndex][categoryIndex] === null) return;
376
+ let rect = {
377
+ x: Math.min(topLeft, bottomLeft),
378
+ y: yTop,
379
+ w: Math.max(topRight, bottomRight) - Math.min(topLeft, bottomLeft),
380
+ h: bandHeight
381
+ }, nodeId = `mark:${stage.id}:${series.id}`, pattern = centeredPattern(series), paint = stagePaint(series, seriesIndex, categoryIndex), outlined = pattern === "outline" && !solidMutedPlan(theme), sep = pattern === void 0 ? othersSeparation(paint, theme) : void 0, pathNode = {
382
+ t: "path",
383
+ id: nodeId,
384
+ d: quadrilateralPath(topLeft, topRight, bottomRight, bottomLeft, yTop, yBottom),
385
+ fill: outlined ? { token: "background" } : pattern === "outline" ? PLAN_MUTED_PAINT : paint,
386
+ stroke: outlined ? paint : sep?.stroke ?? { token: "background" },
387
+ width: outlined ? theme.pattern.outlineStrokeWidth : sep?.strokeWidth ?? strokeToken(theme, "hair"),
388
+ ...pattern === void 0 && isOthersFill(paint) ? { separation: { fill: paint, backing: { token: "background" }, fallback: { stroke: { token: "background" }, strokeWidth: strokeToken(theme, "hair") } } } : {},
389
+ owner: { categoryId: stage.id, seriesId: series.id },
390
+ part: "segment"
391
+ };
392
+ nodes.push(pathNode), occupied.claim(rect, "mark", pathNode.owner, pathNode.part), segmentRecords.push({ id: series.id, rect, nodeId });
393
+ }), marks.rows.push({
394
+ categoryId: stage.id,
395
+ rect: fullRect,
396
+ lane,
397
+ segments: segmentRecords
398
+ }), labelOn2("total")) {
399
+ let info = stageLabelInfos[categoryIndex], rowCenterY = yTop + bandHeight / 2, inside = allInside, candidates = inside ? [{
400
+ slot: "insideCenter",
401
+ rect: {
402
+ x: axisX - info.w / 2,
403
+ y: rowCenterY - info.h / 2,
404
+ w: info.w,
405
+ h: info.h
406
+ },
407
+ penalty: 0,
408
+ ...plotted.length === 1 ? insideStagePaint(stagePaint(plotted[0], 0, categoryIndex), centeredPattern(plotted[0]), theme) : { needsBacking: !0 }
409
+ }] : [{
410
+ slot: "outsideLeft",
411
+ rect: { x: funnelLeft - LABEL_COLUMN_GAP - info.w, y: rowCenterY - info.h / 2, w: info.w, h: info.h },
412
+ penalty: 0
413
+ }];
414
+ labelRequests.push({
415
+ id: `stage:${stage.id}`,
416
+ kind: "total",
417
+ role: composedTextRole(info.text),
418
+ owner: { categoryId: stage.id },
419
+ text: info.text,
420
+ lines: info.lines,
421
+ font: strongFont,
422
+ align: inside ? "middle" : "end",
423
+ priority: PRIORITY.total + (highlights.has(stage.id) ? PRIORITY.highlightBonus : 0),
424
+ candidates
425
+ });
426
+ }
427
+ if (showStepCvr) {
428
+ let stepText = stepTexts[categoryIndex], stepSize = stepSizes[categoryIndex];
429
+ labelRequests.push({
430
+ id: `step-cvr:${stage.id}`,
431
+ ...categoryIndex > 0 && conversions.some((c) => c.toId === stage.id) ? { claimId: `funnel:conv:${stages[categoryIndex - 1].id}:${stage.id}` } : {},
432
+ kind: "point",
433
+ role: composedTextRole(stepText),
434
+ owner: { categoryId: stage.id },
435
+ text: stepText,
436
+ lines: [stepText],
437
+ font: labelFont,
438
+ priority: PRIORITY.extreme,
439
+ // A named column's values are its content: the density gate keeps them with the head.
440
+ keepWhenDense: !0,
441
+ candidates: [{
442
+ slot: "stepCvrColumn",
443
+ rect: { x: flushRight(stepX, stepBlockWidth, stepSize.width), y: yTop + bandHeight / 2 - stepSize.height / 2, w: stepSize.width, h: stepSize.height },
444
+ penalty: 0
445
+ }]
446
+ });
447
+ }
448
+ if (showTotalCvr && labelOn2("point")) {
449
+ let cvrText = cvrTexts[categoryIndex], cvrSize = cvrSizes[categoryIndex];
450
+ labelRequests.push({
451
+ id: `total-cvr:${stage.id}`,
452
+ ...cumulativeCvrs[categoryIndex].rate !== null ? { claimId: `funnel:total-cvr:${stage.id}` } : {},
453
+ kind: "point",
454
+ role: composedTextRole(cvrText),
455
+ owner: { categoryId: stage.id },
456
+ text: cvrText,
457
+ lines: [cvrText],
458
+ font: cvrFont,
459
+ priority: PRIORITY.extreme,
460
+ keepWhenDense: !0,
461
+ candidates: [{
462
+ slot: "cvrColumn",
463
+ rect: {
464
+ x: flushRight(cvrX, cvrBlockWidth, cvrSize.width),
465
+ y: yTop + bandHeight / 2 - cvrSize.height / 2,
466
+ w: cvrSize.width,
467
+ h: cvrSize.height
468
+ },
469
+ penalty: 0
470
+ }]
471
+ });
472
+ }
473
+ }), showStepCvr && labelOn2("annotation") && labelRequests.push({
474
+ id: "step-cvr:header",
475
+ kind: "annotation",
476
+ role: "caption",
477
+ ...spanForm ? { pad: 0 } : {},
478
+ owner: { annotationId: "step-cvr-header" },
479
+ text: stepHeaderText,
480
+ lines: headLines(stepHeaderText),
481
+ font: headerFont,
482
+ priority: PRIORITY.total,
483
+ align: "end",
484
+ candidates: [{ slot: "cvrHeader", rect: { x: flushRight(stepX, stepBlockWidth, stepHeaderSize.width), y: headY(stepHeaderSize.height), w: stepHeaderSize.width, h: stepHeaderSize.height }, penalty: 0 }]
485
+ }), spanForm && labelRequests.push({
486
+ id: CVR_SPAN_HEADER,
487
+ kind: "annotation",
488
+ role: "caption",
489
+ owner: { annotationId: "cvr-span-header" },
490
+ text: spanText,
491
+ lines: [spanText],
492
+ font: headerFont,
493
+ priority: PRIORITY.total,
494
+ align: "end",
495
+ // The two head rows touch; their line height keeps the air between them.
496
+ pad: 0,
497
+ // Flush right over the total column; a longer head reaches left over the
498
+ // empty head row above the funnel and never widens the columns.
499
+ candidates: [{ slot: "cvrHeader", rect: { x: Math.max(inner.x, cvrX + cvrBlockWidth - colPad - spanSize.width), y: inner.y, w: spanSize.width, h: spanSize.height }, penalty: 0 }]
500
+ }), showTotalCvr && labelOn2("annotation") && labelRequests.push({
501
+ id: "total-cvr:header",
502
+ kind: "annotation",
503
+ role: "caption",
504
+ ...spanForm ? { pad: 0 } : {},
505
+ owner: { annotationId: "total-cvr-header" },
506
+ text: cvrHeaderText,
507
+ lines: headLines(cvrHeaderText),
508
+ font: headerFont,
509
+ priority: PRIORITY.total,
510
+ align: "end",
511
+ candidates: [{
512
+ slot: "cvrHeader",
513
+ rect: {
514
+ x: flushRight(cvrX, cvrBlockWidth, cvrHeaderSize.width),
515
+ y: headY(cvrHeaderSize.height),
516
+ w: cvrHeaderSize.width,
517
+ h: cvrHeaderSize.height
518
+ },
519
+ penalty: 0
520
+ }]
521
+ });
522
+ for (let request of labelRequests) {
523
+ let categoryId = request.owner.categoryId;
524
+ if (categoryId === void 0) continue;
525
+ let categoryIndex = stages.findIndex((stage) => stage.id === categoryId);
526
+ request.candidates = request.candidates.filter(
527
+ (candidate) => rectContains(rowLanes[categoryIndex], candidate.rect)
528
+ );
529
+ }
530
+ stages.forEach((stage, categoryIndex) => {
531
+ occupied.claim(
532
+ rowLanes[categoryIndex],
533
+ "mark",
534
+ { categoryId: stage.id },
535
+ "funnel-row-lane"
536
+ );
537
+ });
538
+ let solveCtx = labelCtx(theme, size, options, {
539
+ measure,
540
+ plot,
541
+ labelPad: 2
542
+ }), solved = solveLabels(labelRequests, occupied, solveCtx);
543
+ pushAll(warnings, solved.warnings);
544
+ for (let label of solved.placed)
545
+ label.id.startsWith("stage:") && label.lines.length > 1 && (label.font = labelFont, label.headLines = 1, label.headWeight = emphasisWeight(theme)), label.id.startsWith("total-cvr:") && label.id !== "total-cvr:header" && (label.font = cvrFont), (label.id === "step-cvr:header" || label.id === "total-cvr:header" || label.id === CVR_SPAN_HEADER) && (label.ink = { token: "inkMuted" });
546
+ for (let column of ["step-cvr", "total-cvr"]) {
547
+ let values2 = solved.placed.filter((label) => label.id.startsWith(`${column}:`) && label.id !== `${column}:header`), head = solved.placed.find((label) => label.id === `${column}:header`);
548
+ head && !head.hidden && values2.length > 0 && values2.every((label) => label.hidden) && (head.hidden = values2[0].hidden);
549
+ }
550
+ let span = solved.placed.find((label) => label.id === CVR_SPAN_HEADER), columnHeads = solved.placed.filter((label) => label.id === "step-cvr:header" || label.id === "total-cvr:header");
551
+ span && !span.hidden && columnHeads.length > 0 && columnHeads.every((label) => label.hidden) && (span.hidden = columnHeads[0].hidden);
552
+ for (let label of solved.placed)
553
+ label.hidden !== "collision" || label.owner.categoryId === void 0 || warnings.push({
554
+ code: "funnel-label-hidden",
555
+ severity: "warn",
556
+ message: `label '${label.id}' could not stay in stage '${label.owner.categoryId}' without a collision \u2014 hidden`,
557
+ owner: label.owner
558
+ });
559
+ let resolve = (ref) => {
560
+ let normalized = typeof ref == "string" ? { categoryId: ref, edge: "total" } : ref;
561
+ if (!("categoryId" in normalized) || !normalized.categoryId) return null;
562
+ let categoryIndex = stages.findIndex((stage2) => stage2.id === normalized.categoryId);
563
+ if (categoryIndex < 0) return null;
564
+ let stage = stages[categoryIndex], nextIndex = Math.min(categoryIndex + 1, stages.length - 1), y = rowsTop + (categoryIndex + 0.5) * bandHeight, value = stageTotals[stage.id] ?? null, boundaryX = axisX + (normalized.edge === "start" ? -1 : 1) * boundaryWidths[stage.id] / 2, left = axisX - (boundaryWidths[stage.id] + boundaryWidths[stages[nextIndex].id]) / 4, right = axisX + (boundaryWidths[stage.id] + boundaryWidths[stages[nextIndex].id]) / 4;
565
+ if ("seriesId" in normalized && normalized.seriesId) {
566
+ let seriesIndex = plotted.findIndex((series) => series.id === normalized.seriesId);
567
+ if (seriesIndex < 0) return null;
568
+ value = numbers.values[seriesIndex][categoryIndex] ?? null;
569
+ let topBefore = values.slice(0, seriesIndex).reduce((sum, seriesValues) => sum + seriesValues[categoryIndex], 0), bottomBefore = values.slice(0, seriesIndex).reduce((sum, seriesValues) => sum + seriesValues[nextIndex], 0), topLeft = axisX - boundaryWidths[stage.id] / 2 + scaleValue(topBefore);
570
+ boundaryX = topLeft + (normalized.edge === "start" ? 0 : scaleValue(value ?? 0));
571
+ let bottomLeft = axisX - boundaryWidths[stages[nextIndex].id] / 2 + scaleValue(bottomBefore);
572
+ left = (topLeft + bottomLeft) / 2, right = left + (scaleValue(values[seriesIndex][categoryIndex]) + scaleValue(values[seriesIndex][nextIndex])) / 2;
573
+ }
574
+ return value === null ? null : {
575
+ x: normalized.edge === "start" ? left : right,
576
+ y,
577
+ comparisonPoint: { x: boundaryX, y: rowsTop + categoryIndex * bandHeight },
578
+ row: { y: rowsTop + categoryIndex * bandHeight, h: bandHeight },
579
+ value,
580
+ date: stage.date,
581
+ label: stage.label,
582
+ owner: { categoryId: stage.id, ...normalized.seriesId ? { seriesId: normalized.seriesId } : {} }
583
+ };
584
+ }, annotationOccupied = createOccupiedIndex({
585
+ x: 0,
586
+ y: 0,
587
+ w: size.width,
588
+ h: size.height
589
+ }), columnRects = new Set(solved.placed.filter((label) => cagrReserve > 0 && /^(step|total)-cvr:/.test(label.id)).map((label) => JSON.stringify(label.rect))), annotationSeed = occupied.snapshot().filter((claim) => claim.part !== "funnel-row-lane" && !(claim.kind === "label" && columnRects.has(JSON.stringify(claim.rect))));
590
+ for (let claim of annotationSeed)
591
+ annotationOccupied.claim(claim.rect, claim.kind, claim.owner, claim.part);
592
+ let annotationResult = runAnnotatePass({
593
+ annotations: options.annotations ?? [],
594
+ valueAxis: "horizontal",
595
+ defaultSpan: stages.length > 1 ? { from: stages[0].id, to: stages.at(-1).id } : void 0,
596
+ resolve,
597
+ occupied: annotationOccupied,
598
+ plot,
599
+ theme,
600
+ measure,
601
+ format: options.format,
602
+ locale: options.locale?.language,
603
+ strings: options.strings,
604
+ solveCtx
605
+ });
606
+ pushAll(warnings, annotationResult.warnings);
607
+ for (let claim of annotationOccupied.snapshot().slice(annotationSeed.length))
608
+ occupied.claim(claim.rect, claim.kind, claim.owner, claim.part);
609
+ let allLabels = [...solved.placed, ...annotationResult.labels];
610
+ pushAll(nodes, annotationResult.nodes), pushAll(nodes, centeredLabelNodes(theme, allLabels, strongFont, headerFont, labelFont, nodes));
611
+ let heads = allLabels.filter((label) => !label.hidden && (label.id === "step-cvr:header" || label.id === "total-cvr:header"));
612
+ if (heads.length > 0) {
613
+ let ruleY = Math.round(Math.max(...heads.map((label) => label.rect.y + label.rect.h)) + 3) + 0.5, left = showStepCvr ? stepX : cvrX, right = Math.max(...heads.map((label) => label.rect.x + label.rect.w));
614
+ ruleY < rowsTop && nodes.push({ t: "line", id: "cvr:header-rule", x1: left, y1: ruleY, x2: right, y2: ruleY, stroke: { token: "grid" }, width: strokeToken(theme, "hair"), owner: {}, part: "gridline" });
615
+ }
616
+ let a11yParts = stages.map((stage, categoryIndex) => {
617
+ let stageCvr = stageCvrText(categoryIndex), totalCvr = cumulativeCvrText(cumulativeCvrs[categoryIndex].rate);
618
+ return chartString(options, "stageCvrDesc", { v1: stage.label, v2: numbers.shownTotals[stage.id] == null ? chartString(options, "missing") : totalFmt(numbers.shownTotals[stage.id]), v3: stageCvr, v4: totalCvr });
619
+ }), first = stages[0], last = stages[stages.length - 1], tallestStageLabelH = Math.max(0, maxOf(stageLabelInfos.map((label) => label.h))), paintWarningRules = [];
620
+ return pushAll(warnings, centeredAdjacentWarnings(marks, nodes, values, plotted, theme, { rules: paintWarningRules, before: warnings.filter((warning) => !["pie-ramp-crowded", "likert-ramp-invisible", "band-lightness-insufficient", "series-adjacent-similar", "highlight-reads-as-loss"].includes(warning.code)).length })), {
621
+ type: "funnel",
622
+ size,
623
+ // Rows share one pitch, so the tallest stage label sizes them: a hidden value makes only its own label one line.
624
+ sizing: rowSizing("funnel", size, {
625
+ chromeH: size.height - rowsHeight,
626
+ minimumRowsH: stages.length * Math.max(28, labelOn2("total") ? tallestStageLabelH + 6 : 0),
627
+ // A wide card gets air around each stage (pitch 56 at 960, 52 at 720, 40 at 480, 36 at 400): 0.05 px of air
628
+ // per px of canvas over 400, up to 19 px.
629
+ naturalRowsH: stages.length * (Math.max(28, labelOn2("total") ? tallestStageLabelH + 6 : 0) + clamp((size.width - 400) * 0.05, 0, 19)),
630
+ // The frame, the funnel at its narrowest readable width, the stage
631
+ // labels it sends outside, and the CVR columns.
632
+ // The funnel width plus the labels it sends outside, at the narrowest sum.
633
+ minWidth: size.width - inner.w + cagrReserve + stepBlockWidth + cvrBlockWidth + narrowestFunnel
634
+ }),
635
+ plot,
636
+ scene: nodes,
637
+ labels: allLabels,
638
+ axes: [{
639
+ axis: "y",
640
+ ticks: stages.map((stage, categoryIndex) => ({
641
+ at: stage.id,
642
+ pos: rowsTop + (categoryIndex + 0.5) * bandHeight,
643
+ labelId: labelOn2("total") ? `stage:${stage.id}` : void 0
644
+ }))
645
+ }],
646
+ annotations: annotationResult.placed,
647
+ legend: frameResult.legend,
648
+ frame: frameResult.frame,
649
+ marks,
650
+ derived: {
651
+ stageTotals,
652
+ conversions,
653
+ ...worstDrop ? { worstDrop } : {},
654
+ cumulativeCvrs,
655
+ boundaryWidths
656
+ },
657
+ a11y: {
658
+ title: accessibleTitle(options.title, chartString(options, "funnelTitle", { v1: first.label, v2: last.label })),
659
+ desc: chartString(options, "centeredFunnelDesc", { v1: stages.length, v2: a11yParts.join("; ") })
660
+ },
661
+ warnings,
662
+ paintWarningRules,
663
+ debug: {
664
+ occupied: occupied.snapshot(),
665
+ decisions: [...solved.decisions, ...annotationResult.decisions]
666
+ }
667
+ };
668
+ function scaleValue(value) {
669
+ return maxTotal > 0 ? value / maxTotal * funnelWidth : 0;
670
+ }
671
+ function seriesPaint2(series, seriesIndex, stageIndex = 0) {
672
+ let ramp = rampFunnelPaint(theme, plotted, series, stageIndex, paletteRamp ? options.palette : void 0, stages.length);
673
+ return ramp || (series.fill ? { css: series.fill } : series.colorRole ? markRolePaint(series.colorRole, !0) : seriesPaint(seriesIndex, paletteRamp ? options.palette : void 0));
674
+ }
675
+ function stagePaint(series, seriesIndex, categoryIndex) {
676
+ let paint = seriesPaint2(series, seriesIndex, categoryIndex);
677
+ return plotted.length !== 1 || stages.length === 1 || series.fill || series.colorRole || paletteRamp || rampFunnelPaint(theme, plotted, series, categoryIndex, void 0, stages.length) ? paint : shadeStage(paint, categoryIndex, stages.length, options.stageShade);
678
+ }
679
+ function centeredPattern(series) {
680
+ let scenario = normalizeScenario(series.scenario, `series[${series.id}].scenario`);
681
+ if (scenario === "FC") {
682
+ warnings.some((warning) => warning.code === "funnel-centered-pattern-fallback") || warnings.push({
683
+ code: "funnel-centered-pattern-fallback",
684
+ severity: "warn",
685
+ message: "variant:'centered' renders FC stage faces with their existing solid paint because path hatching is unavailable"
686
+ });
687
+ return;
688
+ }
689
+ return scenario === "PL" ? "outline" : void 0;
690
+ }
691
+ }
692
+ function centeredAdjacentWarnings(marks, nodes, values, series, theme, capture) {
693
+ let byId = new Map(nodes.map((node) => [node.id, node])), samples = [];
694
+ return marks.rows.forEach((row, categoryIndex) => {
695
+ let nextIndex = Math.min(categoryIndex + 1, marks.rows.length - 1), end = 0;
696
+ series.forEach((series2, seriesIndex) => {
697
+ let from = end;
698
+ end += (values[seriesIndex][categoryIndex] + values[seriesIndex][nextIndex]) / 2;
699
+ let segment = row.segments.find((segment2) => segment2.id === series2.id), node = segment ? byId.get(segment.nodeId) : void 0;
700
+ if (node?.t !== "path" || !node.fill) return;
701
+ let paint = "token" in node.fill && node.fill.token === "background" && node.stroke ? node.stroke : node.fill;
702
+ samples.push({ seriesId: series2.id, categoryId: row.categoryId, from, to: end, paint, css: paintColor(theme, paint), highlighted: !1 });
703
+ });
704
+ }), retainAdjacentWarningRule(samples, !0, capture), adjacentSeriesWarnings(samples, !0, theme);
705
+ }
706
+ function quadrilateralPath(topLeft, topRight, bottomRight, bottomLeft, yTop, yBottom) {
707
+ return `M ${topLeft} ${yTop} L ${topRight} ${yTop} L ${bottomRight} ${yBottom} L ${bottomLeft} ${yBottom} Z`;
708
+ }
709
+
710
+ // src/core/charts/funnel/comparisons.ts
711
+ function isText(claim) {
712
+ return claim.kind === "label" || claim.part === "caption";
713
+ }
714
+ function arrowRects(a, b, y) {
715
+ return [
716
+ { x: a.x - 1, y: Math.min(a.y, y), w: 2, h: Math.abs(y - a.y) },
717
+ { x: b.x - 1, y: Math.min(b.y, y), w: 2, h: Math.abs(y - b.y) },
718
+ { x: Math.min(a.x, b.x), y: y - 3, w: Math.max(Math.abs(a.x - b.x), 1), h: 6 }
719
+ ];
720
+ }
721
+ function clearOfText(occupied, a, b, y) {
722
+ return arrowRects(a, b, y).every((rect) => !occupied.hitsWhich(rect, 1).some(isText));
723
+ }
724
+ function shaftStrip(a, b, y) {
725
+ return { x: Math.min(a.x, b.x), y: y - 3, w: Math.max(Math.abs(a.x - b.x), 1), h: 6 };
726
+ }
727
+ function funnelComparisonLayout(bandY) {
728
+ let takenLanes = [];
729
+ return {
730
+ draw(pass, a, b, text, id, kind, computed, derivation) {
731
+ let shared = { ...pass, input: { ...pass.input, comparisonLayout: void 0 } };
732
+ if (kind === "cagr") {
733
+ annotateEngine().drawCagrArm(shared, a, b, text, id, computed, derivation);
734
+ return;
735
+ }
736
+ let lane = [...bandY === void 0 ? [] : [bandY], (a.y + b.y) / 2].find(
737
+ (y) => !takenLanes.some((taken) => Math.abs(taken - y) < 0.5) && clearOfText(pass.input.occupied, a, b, y) && !pass.input.occupied.hits(shaftStrip(a, b, y), 2)
738
+ );
739
+ if (lane === void 0) {
740
+ pass.warn?.(
741
+ "label-hidden",
742
+ `diff '${id}': every lane between the two stages and under the last row is taken by another arrow or crosses a step caption, so the arrow was not drawn`
743
+ );
744
+ return;
745
+ }
746
+ takenLanes.push(lane);
747
+ let before = pass.nodes.length;
748
+ annotateEngine().drawHorizontalLevelDiff({ ...shared, diffHeights: [lane] }, a, b, text, id, computed, derivation);
749
+ for (let node of pass.nodes.slice(before))
750
+ node.t !== "line" || node.part !== "leader" || pass.input.occupied.claim(
751
+ { x: node.x1 - 1, y: Math.min(node.y1, node.y2), w: 2, h: Math.abs(node.y2 - node.y1) },
752
+ "annotation",
753
+ { annotationId: id },
754
+ "leader"
755
+ );
756
+ },
757
+ emit: () => []
758
+ };
759
+ }
760
+
761
+ // src/core/charts/funnel/outsideValues.ts
762
+ var OUTSIDE_GAP = 8, BAR_GAP = 8, TOTAL_GAP = 10;
763
+ function outsideStart(rowEndX, totalW) {
764
+ return rowEndX + BAR_GAP + (totalW > 0 ? totalW + TOTAL_GAP : 0);
765
+ }
766
+ function outsideWidth(textW, totalW) {
767
+ return textW + (totalW > 0 ? SWATCH_RESERVE : 0);
768
+ }
769
+ function outsideSegments(row, pxPerUnit, fits) {
770
+ let drawn = row.segments.filter((segment) => segment.value * pxPerUnit > 0.01);
771
+ return drawn.every((segment, index) => fits(segment.textW, segment.value * pxPerUnit, index === 0)) ? [] : drawn.map((segment) => outsideWidth(segment.textW, row.totalW));
772
+ }
773
+ function barWidthForOutsideValues(input) {
774
+ let { x0, limit, maxTotal, rows, fits } = input;
775
+ if (maxTotal <= 0) return input.barW;
776
+ let floor = Math.max(10, input.barW / 2), barW = input.barW;
777
+ for (let pass = 0; pass < 8; pass++) {
778
+ let next = barW;
779
+ for (let row of rows) {
780
+ let widths = outsideSegments(row, barW / maxTotal, fits);
781
+ if (widths.length === 0 || row.total <= 0) continue;
782
+ let cluster = widths.reduce((sum, w) => sum + w, 0) + OUTSIDE_GAP * (widths.length - 1), room = limit - (outsideStart(x0, row.totalW) - x0) - cluster - x0;
783
+ next = Math.min(next, room * maxTotal / row.total);
784
+ }
785
+ if (next = Math.max(floor, next), next >= barW - 0.01) break;
786
+ barW = next;
787
+ }
788
+ return barW;
789
+ }
790
+
791
+ // src/core/charts/funnel/rowsText.ts
792
+ function lineHeight(font) {
793
+ return font.size * (font.lineHeight ?? 1.2);
794
+ }
795
+ function fitText2(text, font, maxWidth, maxLines, measure, options) {
796
+ let fitted = fitText(text, font, maxWidth, maxLines, measure, options), lines = fitted.lines.length > 0 ? fitted.lines : [""];
797
+ return {
798
+ lines,
799
+ w: Math.max(1, ...lines.map((line) => measure(line, font).width)),
800
+ h: lines.length * lineHeight(font),
801
+ ...fitted.title !== void 0 ? { title: fitted.title } : {}
802
+ };
803
+ }
804
+ var CALLOUT_GUTTER = 12, CALLOUT_MAX_LINES = 3;
805
+ function calloutForm(cap, dropText, pair, font, measure, options) {
806
+ let wide = chartString(options, "biggestDrop", { v1: dropText }), head = measure(wide, font).width <= cap ? wide : chartString(options, "dropValue", { v1: dropText }), body = fitText2(pair, font, cap, CALLOUT_MAX_LINES - 1, measure), lines = [head, ...body.lines], w = Math.max(...lines.map((line) => measure(line, font).width)), cut = body.title !== void 0 || measure(head, font).width > cap;
807
+ return { lines, w, h: lines.length * lineHeight(font), ...cut ? { title: `${wide} \xB7 ${pair}` } : {} };
808
+ }
809
+ function dropCallout(dropPercent, fromLabel, toLabel, font, measure, space, options) {
810
+ let dropText = `${MINUS}${dropPercent}%`, pair = chartString(options, "stagePair", { v1: fromLabel, v2: toLabel }), below = space.besideCaption ? fitText2(chartString(options, "biggestDrop", { v1: dropText }), font, space.captionW, 2, measure) : fitText2(`Biggest drop: ${dropText} \xB7 ${pair}`, font, space.captionW, 2, measure), natural = calloutForm(Number.POSITIVE_INFINITY, dropText, pair, font, measure, options), caps = [natural.w, space.innerW * 0.3, space.innerW * 0.24, space.innerW * 0.18].filter((cap, index) => index === 0 || cap < natural.w).map((cap) => Math.max(40, cap));
811
+ for (let cap of caps) {
812
+ let form = cap === natural.w ? natural : calloutForm(cap, dropText, pair, font, measure, options), reserve = form.w + CALLOUT_GUTTER;
813
+ if (form.title === void 0 && space.avail - reserve >= space.avail * 0.6)
814
+ return { column: form, reserve, below };
815
+ }
816
+ return { column: null, reserve: 0, below };
817
+ }
818
+ var CALLOUT_BESIDE_GAP = 10;
819
+ function belowCalloutCandidates(below, caption, lane, captionLineH) {
820
+ let size = { w: below.w, h: below.h }, laneSlot = { slot: "sourceOutbound", rect: { ...lane, ...size }, penalty: 2 };
821
+ if (!caption) return [laneSlot];
822
+ let lastLineCy = caption.y + caption.h - captionLineH / 2;
823
+ return [
824
+ { slot: "captionBeside", rect: { x: caption.x + caption.w + CALLOUT_BESIDE_GAP, y: lastLineCy - below.h / 2, ...size }, penalty: 0 },
825
+ { slot: "captionUnder", rect: { x: caption.x, y: caption.y + caption.h + LABEL_PAD, ...size }, penalty: 1 },
826
+ // Under a caption in the right-aligned conversion column, aligned to its right edge.
827
+ { slot: "captionUnderRight", rect: { x: caption.x + caption.w - below.w, y: caption.y + caption.h + LABEL_PAD, ...size }, penalty: 1 },
828
+ laneSlot
829
+ ];
830
+ }
831
+ var LANE_PAD = 3;
832
+ function laneY(lane, desiredCy, h, padding = LANE_PAD) {
833
+ let centred = desiredCy - h / 2;
834
+ if (centred >= lane.y && centred + h <= lane.y + lane.h) return centred;
835
+ let pad = Math.min(padding, Math.max(0, (lane.h - h) / 2)), top = lane.y + pad, bottom = lane.y + lane.h - h - pad;
836
+ return Math.min(Math.max(desiredCy - h / 2, top), Math.max(top, bottom));
837
+ }
838
+ var LABEL_PAD = 2, MAX_GAP_FRACTION = 0.55;
839
+ function rowGapFraction(stageCount, step, captionBandH, piBase) {
840
+ return stageCount <= 1 ? piBase : clamp((captionBandH + 8) / Math.max(step, 1), piBase, MAX_GAP_FRACTION);
841
+ }
842
+
843
+ // src/core/charts/funnel/layout.ts
844
+ var CAT_LABEL_LINES = 2, MIN_LONGEST_BAR = 96, INSIDE_SIDE_PAD = 4, CONVERSION_GAP = 12, CALLOUT_INSET = 10, CALLOUT_GUTTER2 = 12, CHIP_GAP = 14, CHIP_BAR_GAP = 6, CHIP_BLOCK_GAP = 16, CHIP_RIGHT_SHARE = 0.6, CHIP_BAR = 26, CHIP_BAR_CARD = 24, CARD_PLOT_W = 440, CHIP_CAPTION_PAD = 12, CHIP_TINT_PAD = 8, CHIP_TINT_OUTSET = 6;
845
+ function rowOptionWarnings(options) {
846
+ let warnings = [];
847
+ return options.totalCvr === "column" && warnings.push({
848
+ code: "funnel-total-cvr-centered-only",
849
+ severity: "warn",
850
+ message: "funnel totalCvr:'column' requires variant:'centered' \u2014 ignored"
851
+ }), options.stageShade !== void 0 && warnings.push({
852
+ code: "funnel-stage-shade-centered-only",
853
+ severity: "warn",
854
+ message: "funnel stageShade requires variant:'centered'; row paints remain unchanged"
855
+ }), warnings;
856
+ }
857
+ function segmentLabelPriority(value, maxAbs, highlighted) {
858
+ return PRIORITY.interior + (maxAbs > 0 ? Math.round(99 * Math.abs(value) / maxAbs) : 0) + (highlighted ? PRIORITY.highlightBonus : 0);
859
+ }
860
+ function layoutFunnel(data, options = {}) {
861
+ if (options.variant === "centered") return layoutCenteredFunnel(data, options);
862
+ let warnings = rowOptionWarnings(options), theme = chartTheme(options), paletteRamp = chartPalette(theme, options.palette, warnings), size = resolveSize(options.size), measure = options.measure ?? defaultMeasurer, autoDecimals = (v) => Number.isInteger(v) || Math.abs(v) >= 100 ? 0 : 1, fmt = options.format ? formatterFromExample(options.format, options.locale?.language) : (v) => formatAutomaticNumber(v, { locale: options.locale?.language, decimals: autoDecimals(v) }), fmtPct = (rate) => {
863
+ let pct = rate * 100;
864
+ return formatAutomaticPercent(pct, smallRateDecimals(pct), !1, options.locale?.language);
865
+ }, highlights = new Set(resolveHighlight(options.highlight)), labelsOpt = options.labels, labelOn2 = (kind) => labelOn(options, kind);
866
+ if (!data || !Array.isArray(data.categories) || data.categories.length === 0)
867
+ throw new NormalizeError("empty-data", "categories", "funnel requires at least one stage");
868
+ if (!Array.isArray(data.series) || data.series.length === 0)
869
+ throw new NormalizeError("empty-data", "series", "funnel requires at least one series");
870
+ let stages = data.categories.map((c, i) => normalizeCategory(c, i)), plotted = data.series.filter((s) => s.role !== "reference");
871
+ if (plotted.length === 0)
872
+ throw new NormalizeError("empty-data", "series", "funnel requires at least one data-role series");
873
+ let { values, known, stageTotals, shownTotals, conversions, worstDrop, undefinedSteps, clamped } = deriveFunnel(plotted, stages, fmt, warnings), glyph = missingGlyph(theme), cells = plotted.map((series, si) => normalizeSeriesValues(series, stages, si)), formats = stages.map((_, ci) => seriesRasterFormatter(options.format, plotted.length === 1 ? values[0] : plotted.map((_2, si) => values[si][ci]), options.locale?.language, options.unit, options.target, void 0, !0)), totalRaster = seriesRasterFormatter(options.format, Object.values(stageTotals), options.locale?.language, options.unit, options.target), totalFmt = totalRaster.fmt;
874
+ if (!options.format) for (let format of [...formats, totalRaster]) format.spec.wholeCounts = !0;
875
+ let valueText = (si, ci, value) => formats[ci].forSeries(plotted[si], cellMeta(cells[si][ci])?.format)(value), cellText = (si, ci, value) => {
876
+ let label = cellMeta(cells[si][ci])?.label;
877
+ return label === !1 ? null : typeof label == "string" ? label.replace(/\$\{value\}/g, valueText(si, ci, value)) : valueText(si, ci, value);
878
+ }, occupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), margin = { ...canvasMargin(theme, size.width), ...options.margin }, legendOpts = normalizeLegendOption(options.legend, plotted.length > 1 ? { position: "top" } : void 0), legendItems = plotted.map((s, si) => ({
879
+ id: s.id,
880
+ label: s.label ?? s.id,
881
+ paint: seriesPaint2(s, si),
882
+ pattern: seriesPattern(s)
883
+ }));
884
+ if (legendOpts?.order) {
885
+ let rank = new Map(legendOpts.order.map((id, i) => [id, i]));
886
+ legendItems.sort((a, b) => (rank.get(a.id) ?? 999) - (rank.get(b.id) ?? 999));
887
+ }
888
+ let keyed = legendOpts ? { options: legendOpts, items: legendItems } : void 0, frameResult = solveFrame(
889
+ {
890
+ size,
891
+ margin,
892
+ ...frameTextOptions(options),
893
+ footnotes: [...authoredNotes(options), ...clampedNote(clamped, options)],
894
+ legend: keyed,
895
+ theme,
896
+ measure
897
+ },
898
+ occupied
899
+ ), inner = frameResult.plot, innerRight = inner.x + inner.w, tickFont = { family: theme.type.family, ...theme.type.axis }, labelFont = { family: theme.type.family, ...theme.type.label }, strongFont = { family: theme.type.family, ...theme.type.label, weight: emphasisWeight(theme) }, captionFont = { family: theme.type.family, ...theme.type.footnote }, captionStrong = { ...captionFont, weight: emphasisWeight(theme) }, tickStrong = { ...tickFont, weight: emphasisWeight(theme) }, highlightedStep = (fromId) => highlights.has(fromId), catCap = options.mode === "compact" ? Math.max(40, inner.w * 0.18) : Math.max(50, inner.w * 0.24), catMarkOf = (c) => footnoteSuffix(c.footnote, c.id, { count: authoredFootnoteCount(options), warnings }), catNameOf = (c) => c.label ?? c.id, catLabelOf = (c) => `${catNameOf(c)}${catMarkOf(c)}`, catFont = (c) => highlights.has(c.id) ? tickStrong : tickFont, withCatMark = (fitted, c) => {
900
+ let mark = catMarkOf(c);
901
+ if (!mark) return fitted;
902
+ let lines = [...fitted.lines];
903
+ return lines[lines.length - 1] = `${lines[lines.length - 1] ?? ""}${mark}`, { ...fitted, lines, w: fitted.w + measure(mark, catFont(c)).width };
904
+ }, fitCatName = (c, maxWidth, maxLines) => withCatMark(fitText2(catNameOf(c), catFont(c), Math.max(1, maxWidth - (catMarkOf(c) ? measure(catMarkOf(c), catFont(c)).width : 0)), maxLines, measure, { target: options.target, typeRole: "axis" }), c), catInfo = stages.map((c) => fitCatName(c, catCap, CAT_LABEL_LINES)), bandW = labelOn2("category") ? maxOf(catInfo.map((c) => c.w)) + 14 : 0, totalTexts = stages.map((c, ci) => {
905
+ let total = shownTotals[c.id] ?? null;
906
+ return total === null ? glyph : plotted.length === 1 ? cellText(0, ci, total) ?? "" : totalFmt(total);
907
+ }), totalSizes = totalTexts.map((t) => measure(t, strongFont)), totalReserve = labelOn2("total") ? maxOf(totalSizes.map((t) => t.width)) + 14 : 8, callout = null;
908
+ worstDrop && options.worstDropCallout === !0 && labelsOpt !== !1 && !(options.annotations ?? []).some((a) => a.kind === "note") && (callout = dropCallout(
909
+ formatAutomaticNumber((1 - worstDrop.rate) * 100, { locale: options.locale?.language, decimals: 0 }),
910
+ stages.find((c) => c.id === worstDrop.fromId)?.label ?? worstDrop.fromId,
911
+ stages.find((c) => c.id === worstDrop.toId)?.label ?? worstDrop.toId,
912
+ labelFont,
913
+ measure,
914
+ // Captions live right of the baseline: their width is the row right of the label band.
915
+ { innerW: inner.w, avail: inner.w - bandW - totalReserve, captionW: inner.w - bandW - 8, besideCaption: labelOn2("point") },
916
+ options
917
+ ));
918
+ let noteReserve = callout?.reserve ?? 0, steps = [
919
+ ...conversions.map((conv) => ({ ...conv, text: conv.rate > 1 ? chartString(options, "stageIncreased") : chartString(options, "stageAdvance", { v1: fmtPct(conv.rate) }) })),
920
+ ...undefinedSteps.map((step) => ({ ...step, text: chartString(options, "previousStageZero") }))
921
+ ], captions = new Map(labelOn2("point") ? steps.map(({ fromId, text }) => {
922
+ let font = highlightedStep(fromId) ? captionStrong : captionFont, caption = { lines: [text], w: measure(text, font).width, h: lineHeight(font) };
923
+ return [fromId, caption];
924
+ }) : []), convColW = Math.max(0, maxOf([...captions.values()].map((c) => c.w))), convRight = innerRight - noteReserve - 2, x0 = inner.x + bandW, rowsTop = inner.y + 4, authoredKinds = new Set((options.annotations ?? []).map((a) => a.kind)), arrowBandH = authoredKinds.has("diff") ? Math.ceil(lineHeight(labelFont) + 14) : 0, annotationBandH = arrowBandH + (authoredKinds.has("delta") || authoredKinds.has("abs") ? Math.ceil(lineHeight(labelFont) + 10) : 0), rowsSpace = inner.y + Math.max(14, inner.h) - 4 - annotationBandH - rowsTop, rowsH = Math.max(10, rowsSpace), rowsBottom = rowsTop + rowsH, convProbe = measure(chartString(options, "advanceProbe"), captionFont), bf = options.bandFraction ?? 0.68, piBase = 1 - bf, stepApprox = rowsH / stages.length, maxTotal = Math.max(0, maxOf(known)), maxAbsValue = Math.max(0, maxOf(values.flat().map((v) => Math.abs(v ?? 0)))), worstCaption = callout && !callout.column && labelOn2("point") ? captions.get(worstDrop.fromId) : void 0, calloutStackH = worstCaption ? callout.below.h + LABEL_PAD : 0, shownCaptions = [...captions.values()].map((c) => ({ ...c, h: c.h + (c === worstCaption ? calloutStackH : 0) })), multi = plotted.length > 1, captionOnlyBandH = Math.max(convProbe.height, maxOf(shownCaptions.map((c) => c.h))), totalAnnotationGap = (options.annotations ?? []).some((ann) => (ann.kind === "delta" || ann.kind === "abs") && totalAnchorStage(ann.at) >= 0) ? 2 * (measure("0", labelFont).height + 6) : 0, captionBandH = captions.size > 0 || totalAnnotationGap > 0 ? Math.max(captionOnlyBandH, totalAnnotationGap) : 0, pi = captionBandH > 0 ? rowGapFraction(stages.length, stepApprox, captionBandH, piBase) : piBase;
925
+ options.bandFraction !== void 0 && pi > piBase + 1e-6 && warnings.push({
926
+ code: "funnel-band-fraction-overridden",
927
+ severity: "warn",
928
+ message: `bandFraction ${bf} leaves the step captions no room at this height; the bars take ${Math.round((1 - pi) * 100)}% of each row. Give the chart more height, or drop bandFraction`
929
+ });
930
+ let chipMode = multi && labelOn2("segment"), chips = chipMode ? chipColumns() : void 0, barRoom = Math.max(10, inner.w - bandW - totalReserve - noteReserve), chipsRight = chips !== void 0 && barRoom - chips.blockW - CHIP_BLOCK_GAP >= CHIP_RIGHT_SHARE * barRoom, chipPerLine = 1, chipLines = 0, chipUnderH = 0, setChipLines = (reserve) => {
931
+ chipPerLine = chips === void 0 ? 1 : chipsRight ? plotted.length : Math.max(1, Math.floor((innerRight - noteReserve - reserve - 2 - x0 + CHIP_GAP) / chips.pitch)), chipLines = chips === void 0 || chipsRight ? 0 : Math.ceil(plotted.length / chipPerLine), chipUnderH = chipLines > 0 ? CHIP_BAR_GAP + chipLines * chips.lineH : 0;
932
+ };
933
+ setChipLines(0);
934
+ let chipIsRedundant = (ci, drawn, text) => drawn === 1 && labelOn2("total") && stageTotals[stages[ci].id] != null && text === totalTexts[ci], chipsOnRow = (ci) => {
935
+ if (chipLines === 0) return !1;
936
+ let drawn = plotted.filter((_s, si) => (values[si][ci] ?? 0) > 0).length;
937
+ return drawn !== 1 ? drawn > 1 : plotted.some((_s, si) => {
938
+ let value = values[si][ci];
939
+ if (value == null || value <= 0) return !1;
940
+ let text = cellText(si, ci, value);
941
+ return !!text && !chipIsRedundant(ci, drawn, text);
942
+ });
943
+ }, band = chipRowBand(), underH = (ci) => chipsOnRow(ci) ? chipUnderH : 0, inGap = band.step - band.bandwidth - chipUnderH >= captionBandH + 2 * LABEL_PAD, convReserve = !inGap && convColW > 0 ? convColW + CONVERSION_GAP : 0;
944
+ chipMode && chipLines > 0 && convReserve > 0 && (setChipLines(convReserve), band = chipRowBand());
945
+ let barW0 = Math.max(10, inner.w - bandW - totalReserve - noteReserve - convReserve), chipLimit = innerRight - noteReserve - convReserve - 2, chipX0 = chips === void 0 ? x0 : chipsRight ? chipLimit - chips.blockW : x0, fitsInside = (textW, segmentW, first2) => textW + 2 * INSIDE_SIDE_PAD + (first2 ? 2 : 0) <= segmentW && labelFont.size <= band.bandwidth && segmentW >= INSIDE_MIN_W && band.bandwidth >= INSIDE_MIN_H, barW = chipMode ? Math.max(10, chipsRight ? barW0 - chips.blockW - CHIP_BLOCK_GAP : barW0) : barWidthForOutsideValues({
946
+ barW: barW0,
947
+ x0,
948
+ limit: innerRight - noteReserve - convReserve - 2,
949
+ maxTotal,
950
+ fits: fitsInside,
951
+ rows: stages.map((_c, ci) => ({
952
+ total: known[ci],
953
+ totalW: labelOn2("total") ? totalSizes[ci].width : 0,
954
+ segments: multi && labelOn2("segment") ? plotted.flatMap((_s, si) => {
955
+ let value = values[si][ci] ?? null, text = value === null ? null : cellText(si, ci, value);
956
+ return text === null ? [] : [{ value, textW: measure(text, labelFont).width }];
957
+ }) : []
958
+ }))
959
+ }), xScale = linearScale([0, maxTotal || 1], [x0, x0 + barW]), plot = { x: x0, y: rowsTop, w: barW, h: rowsH }, rowLanes = stages.map((_stage, ci) => {
960
+ let y = ci === 0 ? rowsTop : band.position(ci), bottom = ci + 1 < stages.length ? band.position(ci + 1) : rowsBottom;
961
+ return { x: inner.x, y, w: inner.w, h: Math.max(bottom - y, band.bandwidth) };
962
+ }), nodes = [...frameResult.nodes], marks = { rows: [] }, labelRequests = [];
963
+ stages.forEach((cat, ci) => {
964
+ if (!highlights.has(cat.id)) return;
965
+ let chipPad = Math.max(0, Math.min(CHIP_TINT_PAD, (band.step - band.bandwidth - chipUnderH - captionOnlyBandH) / 2 - LABEL_PAD)), tintTop = band.position(ci) - chipPad, tintBottom = ci + 1 < stages.length ? band.position(ci + 1) - chipPad - LABEL_PAD : band.position(ci) + band.bandwidth + underH(ci) + chipPad, outset = Math.min(CHIP_TINT_OUTSET, inner.x / 2);
966
+ nodes.push({
967
+ t: "rect",
968
+ id: `rowTint:${cat.id}`,
969
+ rect: { x: inner.x - outset, y: tintTop, w: inner.w + 2 * outset, h: tintBottom - tintTop },
970
+ fill: { token: "others" },
971
+ owner: { categoryId: cat.id },
972
+ part: "rowTint"
973
+ });
974
+ });
975
+ let rowEnds = [], rowValueEnd = /* @__PURE__ */ new Map(), cumEnd = stages.map(() => plotted.map(() => x0));
976
+ function pushSegmentValues(row) {
977
+ let { cat, segLabs, rowCy, rowEndX, lane } = row;
978
+ if (segLabs.length === 0) return;
979
+ if (segLabs.some((l) => !l.fits)) for (let l of segLabs) l.fits = !1;
980
+ let outs = segLabs.filter((l) => !l.fits), outXs = /* @__PURE__ */ new Map(), totalW = labelOn2("total") ? row.totalWidth : 0, cursor = outsideStart(rowEndX, totalW), queue = (l) => {
981
+ outXs.set(l, cursor), cursor += outsideWidth(l.w, totalW) + OUTSIDE_GAP;
982
+ };
983
+ outs.forEach(queue), outs.length > 0 && rowValueEnd.set(cat.id, cursor - OUTSIDE_GAP), warnSpreadOverflow(warnings, cursor - OUTSIDE_GAP <= innerRight - 2, "displaced segment labels exceed their row band even after spreading \u2014 labels stay bounded but overlap; fewer segments or a larger canvas fixes it"), segLabs.filter((l) => l.fits).forEach(queue), segLabs.forEach((l) => {
984
+ let candidates = [{
985
+ slot: "outsideRight",
986
+ rect: { x: outXs.get(l), y: laneY(lane, rowCy, l.h), w: outsideWidth(l.w, totalW), h: l.h },
987
+ penalty: 2,
988
+ ...totalW > 0 ? { swatch: l.insidePaint } : {}
989
+ }];
990
+ l.fits && candidates.unshift({
991
+ slot: "insideCenter",
992
+ // Pad 0: an inside value belongs on its segment, so it is pushed
993
+ // into the lane only far enough to stay out of the next row.
994
+ rect: { x: l.cx - l.w / 2, y: laneY(lane, rowCy, l.h, 0), w: l.w, h: l.h },
995
+ penalty: 0,
996
+ insideFill: l.fillCss,
997
+ insidePaint: l.insidePaint,
998
+ insidePattern: l.insidePattern
999
+ }), labelRequests.push({
1000
+ id: `segment:${cat.id}:${l.sid}`,
1001
+ kind: "segment",
1002
+ owner: { categoryId: cat.id, seriesId: l.sid },
1003
+ text: l.text,
1004
+ lines: [l.text],
1005
+ font: labelFont,
1006
+ priority: l.priority,
1007
+ // One drawn segment means the segment value IS the stage total, and
1008
+ // the bold total at the bar end already prints it, unless a missing
1009
+ // value left that total unknown.
1010
+ ...row.drawn === 1 && labelOn2("total") && stageTotals[cat.id] != null && l.text === totalTexts[stages.findIndex((stage) => stage.id === cat.id)] ? { redundant: !0, suppressedAs: "redundant" } : {},
1011
+ candidates
1012
+ });
1013
+ });
1014
+ }
1015
+ function pushChips(cat, ci, rowChips, drawn) {
1016
+ if (!chips || rowChips.length === 0) return;
1017
+ let lane = rowLanes[ci], top = band.position(ci), font = highlights.has(cat.id) ? strongFont : labelFont, hasPrintedChip = !1;
1018
+ for (let chip of rowChips) {
1019
+ let redundant = chipIsRedundant(ci, drawn, chip.text);
1020
+ hasPrintedChip ||= !redundant;
1021
+ let t = measure(chip.text, font), line = chipsRight ? 0 : Math.floor(chip.si / chipPerLine), col = chipsRight ? chip.si : chip.si % chipPerLine, cy = chipsRight ? top + band.bandwidth / 2 : top + band.bandwidth + CHIP_BAR_GAP + (line + 0.5) * chips.lineH, y = laneY(lane, cy, t.height, 0), fits = chipsRight || y >= top + band.bandwidth;
1022
+ labelRequests.push({
1023
+ id: `segment:${cat.id}:${chip.sid}`,
1024
+ kind: "segment",
1025
+ owner: { categoryId: cat.id, seriesId: chip.sid },
1026
+ text: chip.text,
1027
+ lines: [chip.text],
1028
+ font,
1029
+ priority: segmentLabelPriority(chip.value, maxAbsValue, highlights.has(chip.sid) || highlights.has(cat.id)),
1030
+ ...redundant ? { redundant: !0, suppressedAs: "redundant" } : {},
1031
+ candidates: fits ? [{
1032
+ slot: chipsRight ? "chipColumn" : "chipLine",
1033
+ rect: { x: chipX0 + col * chips.pitch, y, w: t.width + SWATCH_RESERVE, h: t.height },
1034
+ penalty: 0,
1035
+ swatch: chip.paint
1036
+ }] : []
1037
+ });
1038
+ }
1039
+ if (hasPrintedChip) {
1040
+ let end = chipX0 + Math.min(plotted.length, chipPerLine) * chips.pitch - CHIP_GAP;
1041
+ rowValueEnd.set(cat.id, Math.max(rowValueEnd.get(cat.id) ?? end, end));
1042
+ }
1043
+ }
1044
+ stages.forEach((cat, ci) => {
1045
+ let ry = band.position(ci), bw = band.bandwidth, rowCy = ry + bw / 2, cum = 0, segRecs = [], segLabs = [], rowChips = [];
1046
+ plotted.forEach((s, si) => {
1047
+ let v = values[si][ci] ?? null;
1048
+ if (v === null) {
1049
+ cumEnd[ci][si] = xScale(cum);
1050
+ return;
1051
+ }
1052
+ let sx = xScale(cum), ex = xScale(cum + v);
1053
+ cum += v, cumEnd[ci][si] = ex;
1054
+ let w = ex - sx;
1055
+ if (v === 0) return;
1056
+ let rect = { x: sx, y: ry, w, h: bw }, nodeId = `mark:${cat.id}:${s.id}`, segmentPaint = seriesPaint2(s, si, ci), sep = othersSeparation(segmentPaint, theme);
1057
+ nodes.push({
1058
+ t: "rect",
1059
+ id: nodeId,
1060
+ rect,
1061
+ fill: segmentPaint,
1062
+ pattern: seriesPattern(s),
1063
+ ...sep ? { stroke: sep.stroke, strokeWidth: sep.strokeWidth } : {},
1064
+ ...isOthersFill(segmentPaint) ? { separation: { fill: segmentPaint, backing: { token: "background" } } } : {},
1065
+ owner: { categoryId: cat.id, seriesId: s.id },
1066
+ part: "segment",
1067
+ display: { value: valueText(si, ci, v) }
1068
+ }), occupied.claim(rect, "mark", { categoryId: cat.id, seriesId: s.id }), segRecs.push({ id: s.id, rect, nodeId });
1069
+ let text = cellText(si, ci, v);
1070
+ if (chipMode && text)
1071
+ rowChips.push({ si, sid: s.id, text, paint: segmentPaint, value: v });
1072
+ else if (multi && labelOn2("segment") && text) {
1073
+ let t = measure(text, labelFont);
1074
+ segLabs.push({
1075
+ sid: s.id,
1076
+ text,
1077
+ w: t.width,
1078
+ h: t.height,
1079
+ rect,
1080
+ cx: sx + w / 2,
1081
+ fits: fitsInside(t.width, w, segLabs.length === 0),
1082
+ fillCss: effectiveFill(seriesCss(s, si, ci), seriesPattern(s), theme),
1083
+ insidePaint: seriesPaint2(s, si, ci),
1084
+ insidePattern: seriesPattern(s),
1085
+ priority: segmentLabelPriority(v, maxAbsValue, highlights.has(s.id) || highlights.has(cat.id))
1086
+ });
1087
+ }
1088
+ });
1089
+ let rowEndX = xScale(known[ci]);
1090
+ rowEnds.push(rowEndX), rowValueEnd.set(cat.id, labelOn2("total") ? rowEndX + 6 + totalSizes[ci].width : rowEndX), marks.rows.push({
1091
+ categoryId: cat.id,
1092
+ rect: { x: x0, y: ry, w: Math.max(rowEndX - x0, 0), h: bw },
1093
+ lane: rowLanes[ci],
1094
+ segments: segRecs
1095
+ });
1096
+ let totText = totalTexts[ci], totSize = totalSizes[ci], lane = rowLanes[ci];
1097
+ if (labelOn2("total") && totText) {
1098
+ let slotAt = (desiredCy, slot, penalty) => ({
1099
+ slot,
1100
+ rect: {
1101
+ x: rowEndX + 6,
1102
+ y: laneY(lane, desiredCy, totSize.height),
1103
+ w: totSize.width,
1104
+ h: totSize.height
1105
+ },
1106
+ penalty
1107
+ });
1108
+ labelRequests.push({
1109
+ id: `total:${cat.id}`,
1110
+ kind: "total",
1111
+ owner: { categoryId: cat.id },
1112
+ text: totText,
1113
+ lines: [totText],
1114
+ font: strongFont,
1115
+ priority: PRIORITY.total + (highlights.has(cat.id) ? PRIORITY.highlightBonus : 0),
1116
+ candidates: [
1117
+ slotAt(rowCy, "outsideEnd", 0),
1118
+ slotAt(rowCy - totSize.height - 2, "outsideEndUp", 1),
1119
+ slotAt(rowCy + totSize.height + 2, "outsideEndDown", 2)
1120
+ ]
1121
+ });
1122
+ }
1123
+ if (labelOn2("category")) {
1124
+ let lanes = Math.max(1, Math.floor(lane.h / lineHeight(catFont(cat)))), info = lanes >= catInfo[ci].lines.length ? catInfo[ci] : fitCatName(cat, bandW - 14, lanes);
1125
+ labelRequests.push({
1126
+ id: `category:${cat.id}`,
1127
+ kind: "category",
1128
+ owner: { categoryId: cat.id },
1129
+ text: catLabelOf(cat),
1130
+ lines: info.lines,
1131
+ ...info.title ? { title: info.title } : {},
1132
+ font: catFont(cat),
1133
+ priority: PRIORITY.grandTotal,
1134
+ candidates: [
1135
+ {
1136
+ slot: "left",
1137
+ // names stand left-aligned at the plot edge.
1138
+ rect: { x: inner.x, y: laneY(lane, rowCy, info.h), w: info.w, h: info.h },
1139
+ penalty: 0
1140
+ }
1141
+ ]
1142
+ });
1143
+ }
1144
+ chipMode ? pushChips(cat, ci, rowChips, segRecs.length) : pushSegmentValues({
1145
+ cat,
1146
+ segLabs,
1147
+ drawn: segRecs.length,
1148
+ ry,
1149
+ bw,
1150
+ rowCy,
1151
+ rowEndX,
1152
+ lane,
1153
+ totalWidth: totSize.width
1154
+ });
1155
+ });
1156
+ let worstCaptionRect, captionRects = [];
1157
+ if (labelOn2("point") && steps.forEach((conv) => {
1158
+ let ci = stages.findIndex((c) => c.id === conv.fromId);
1159
+ if (ci < 0 || ci + 1 >= stages.length) return;
1160
+ let gapTop = band.position(ci) + band.bandwidth + (inGap ? underH(ci) : 0), gapBot = band.position(ci + 1), gapCy = (gapTop + gapBot) / 2, caption = captions.get(conv.fromId), text = caption.lines.join(" "), t = { width: caption.w, height: caption.h }, centred = { x: inGap ? x0 : convRight - t.width, y: gapCy - t.height / 2, w: t.width, h: t.height }, stacked = caption === worstCaption && calloutStackH > 0 ? { ...centred, y: gapCy - (t.height + calloutStackH) / 2 } : void 0;
1161
+ caption === worstCaption && (worstCaptionRect = stacked ?? centred), captionRects.push(stacked ?? centred), labelRequests.push({
1162
+ id: `conv:${conv.fromId}:${conv.toId}`,
1163
+ claimId: `funnel:conv:${conv.fromId}:${conv.toId}`,
1164
+ kind: "point",
1165
+ role: composedTextRole(text),
1166
+ owner: { categoryId: conv.fromId },
1167
+ text,
1168
+ lines: caption.lines,
1169
+ ...caption.title ? { title: caption.title } : {},
1170
+ font: highlightedStep(conv.fromId) ? captionStrong : captionFont,
1171
+ typeRole: "footnote",
1172
+ priority: PRIORITY.extreme + (highlights.has(conv.fromId) ? PRIORITY.highlightBonus : 0),
1173
+ candidates: [
1174
+ ...stacked ? [{ slot: "conversionColumnStacked", rect: stacked, penalty: 0 }] : [],
1175
+ { slot: "conversionColumn", rect: centred, penalty: 0 }
1176
+ ]
1177
+ });
1178
+ }), callout && worstDrop) {
1179
+ let ci = stages.findIndex((c) => c.id === worstDrop.fromId), lane = rowLanes[ci], rowCy = band.position(ci) + band.bandwidth / 2, shown = callout.column ?? callout.below, candidates = [];
1180
+ if (callout.column) {
1181
+ let column = callout.column, far = Math.max(inner.x + 2, innerRight - column.w - 2), near = clamp(rowValueEnd.get(worstDrop.fromId) + CALLOUT_GUTTER2, inner.x + 2, far), rect = (x) => ({ x, y: laneY(lane, rowCy, column.h), w: column.w, h: column.h }), nearClear = far - near > 1 && !captionRects.some((r) => rectsOverlap(r, rect(near), 2));
1182
+ nearClear && candidates.push({ slot: "sourceOuter", rect: rect(near), penalty: 0 }), candidates.push({ slot: nearClear ? "sourceOuterFar" : "sourceOuter", rect: rect(far), penalty: nearClear ? 1 : 0 });
1183
+ } else
1184
+ candidates.push(...belowCalloutCandidates(callout.below, worstCaptionRect, {
1185
+ x: clamp(rowEnds[ci] + 8, x0 + 4, Math.max(x0 + 4, innerRight - callout.below.w - 2)),
1186
+ y: Math.max(lane.y, lane.y + lane.h - callout.below.h - 3)
1187
+ }, lineHeight(captionFont)));
1188
+ labelRequests.push({
1189
+ id: "annotation:note-worst-drop",
1190
+ kind: "annotation",
1191
+ owner: { categoryId: worstDrop.fromId, annotationId: "note-worst-drop" },
1192
+ text: shown.lines.join(" "),
1193
+ lines: shown.lines,
1194
+ ...shown.title ? { title: shown.title } : {},
1195
+ font: labelFont,
1196
+ priority: PRIORITY.extreme,
1197
+ candidates
1198
+ });
1199
+ }
1200
+ for (let request of labelRequests) {
1201
+ let categoryId = request.owner.categoryId;
1202
+ if (categoryId === void 0) continue;
1203
+ let ci = stages.findIndex((stage) => stage.id === categoryId);
1204
+ ci < 0 || (request.candidates = request.candidates.filter(
1205
+ (candidate) => rectContains(rowLanes[ci], candidate.rect)
1206
+ ));
1207
+ }
1208
+ stages.forEach((stage, ci) => {
1209
+ let lane = rowLanes[ci];
1210
+ occupied.claim(
1211
+ { x: lane.x, y: lane.y + LANE_PAD, w: lane.w, h: Math.max(1, lane.h - 2 * LANE_PAD) },
1212
+ "mark",
1213
+ { categoryId: stage.id },
1214
+ "funnel-row-lane"
1215
+ );
1216
+ });
1217
+ let solveCtx = labelCtx(theme, size, options, {
1218
+ measure,
1219
+ plot,
1220
+ labelPad: LABEL_PAD
1221
+ }), solved = solveLabels(labelRequests, occupied, solveCtx);
1222
+ pushAll(warnings, solved.warnings);
1223
+ for (let label of solved.placed)
1224
+ label.hidden !== "collision" || label.owner.categoryId === void 0 || warnings.push({
1225
+ code: "funnel-label-hidden",
1226
+ severity: "warn",
1227
+ message: `label '${label.id}' could not stay in row '${label.owner.categoryId}' without a collision \u2014 hidden`,
1228
+ owner: label.owner
1229
+ });
1230
+ let resolve = (ref) => {
1231
+ let norm = typeof ref == "string" ? { categoryId: ref, edge: "total" } : ref;
1232
+ if (!("categoryId" in norm) || !norm.categoryId) return null;
1233
+ let ci = stages.findIndex((c) => c.id === norm.categoryId);
1234
+ if (ci < 0) return null;
1235
+ let cat = stages[ci], rowCy = band.position(ci) + band.bandwidth / 2, value = stageTotals[cat.id] ?? null, xEnd = xScale(known[ci]);
1236
+ if ("seriesId" in norm && norm.seriesId) {
1237
+ let si = plotted.findIndex((s) => s.id === norm.seriesId);
1238
+ if (si < 0) return null;
1239
+ value = values[si][ci] ?? null, xEnd = cumEnd[ci][si];
1240
+ }
1241
+ if (value === null) return null;
1242
+ let edge = norm.edge ?? "total", underBar = totalAnchorStage(ref) === ci;
1243
+ return {
1244
+ x: edge === "start" ? x0 : xEnd,
1245
+ y: underBar ? band.position(ci) + band.bandwidth : rowCy,
1246
+ ...underBar ? { comparisonPoint: { x: xEnd, y: rowCy } } : {},
1247
+ // A callout leads onto its own bar, inside the bar end, so it cannot
1248
+ // read as pointing at the row above.
1249
+ calloutPoint: {
1250
+ x: edge === "start" ? x0 : Math.max(x0 + 1, xEnd - Math.min(CALLOUT_INSET, (xEnd - x0) / 2)),
1251
+ y: band.position(ci) + Math.min(CALLOUT_INSET, band.bandwidth / 4)
1252
+ },
1253
+ value,
1254
+ date: cat.date,
1255
+ label: cat.label,
1256
+ owner: { categoryId: cat.id, ...norm.seriesId ? { seriesId: norm.seriesId } : {} }
1257
+ };
1258
+ }, userAnnotations = options.annotations ?? [], annotationOccupied = createOccupiedIndex({ x: 0, y: 0, w: size.width, h: size.height }), annotationSeed = occupied.snapshot().filter((claim) => claim.part !== "funnel-row-lane");
1259
+ for (let claim of annotationSeed)
1260
+ annotationOccupied.claim(claim.rect, claim.kind, claim.owner, claim.part);
1261
+ for (let ann of userAnnotations) {
1262
+ let ci = ann.kind === "delta" || ann.kind === "abs" ? totalAnchorStage(ann.at) : -1;
1263
+ if (ci < 0) continue;
1264
+ let endX = xScale(known[ci]);
1265
+ annotationOccupied.claim(
1266
+ { x: endX, y: band.position(ci), w: innerRight - endX, h: band.bandwidth },
1267
+ "mark",
1268
+ { categoryId: stages[ci].id },
1269
+ "funnel-value-column"
1270
+ );
1271
+ }
1272
+ let annResult = runAnnotatePass({
1273
+ annotations: userAnnotations,
1274
+ valueAxis: "horizontal",
1275
+ defaultSpan: stages.length > 1 ? { from: stages[0].id, to: stages.at(-1).id } : void 0,
1276
+ calloutLeaderWidths: 3,
1277
+ comparisonLayout: funnelComparisonLayout(arrowBandH > 0 ? rowsBottom + annotationBandH - 5 : void 0),
1278
+ resolve,
1279
+ occupied: annotationOccupied,
1280
+ plot: { ...plot, h: plot.h + annotationBandH },
1281
+ theme,
1282
+ measure,
1283
+ format: options.format,
1284
+ locale: options.locale?.language,
1285
+ strings: options.strings,
1286
+ solveCtx
1287
+ });
1288
+ pushAll(warnings, annResult.warnings);
1289
+ let annotationClaims = annotationOccupied.snapshot().slice(annotationSeed.length).filter((claim) => claim.part !== "funnel-value-column");
1290
+ for (let claim of annotationClaims)
1291
+ occupied.claim(claim.rect, claim.kind, claim.owner, claim.part);
1292
+ let autoNoteAnnotations = callout && worstDrop ? [{
1293
+ id: "note-worst-drop",
1294
+ kind: "note",
1295
+ computedText: (callout.column ?? callout.below).lines.join(" "),
1296
+ nodeIds: [],
1297
+ labelId: "annotation:note-worst-drop"
1298
+ }] : [], allLabels = [...solved.placed, ...annResult.labels];
1299
+ for (let label of allLabels)
1300
+ label.id.startsWith("conv:") && !highlightedStep(label.owner.categoryId ?? "") && (label.ink = { token: "inkMuted" });
1301
+ pushAll(nodes, annResult.nodes), pushAll(nodes, labelsToNodes(
1302
+ theme,
1303
+ allLabels,
1304
+ (l) => l.kind === "total" ? strongFont : l.id.startsWith("conv:") ? highlightedStep(l.owner.categoryId ?? "") ? captionStrong : captionFont : l.kind === "category" ? highlights.has(l.owner.categoryId ?? "") ? tickStrong : tickFont : chipMode && l.kind === "segment" && highlights.has(l.owner.categoryId ?? "") ? strongFont : labelFont,
1305
+ nodes
1306
+ ));
1307
+ let first = stages[0], last = stages[stages.length - 1], a11yParts = stages.map((c, ci) => {
1308
+ let total = shownTotals[c.id] ?? null, p = `${c.label} ${total === null ? chartString(options, "missing") : totalFmt(total)}`, conv = conversions.find((cv) => cv.fromId === c.id);
1309
+ if (conv) {
1310
+ let to = stages[ci + 1];
1311
+ p += conv.rate > 1 ? chartString(options, "funnelIncreaseDesc", { v1: c.label, v2: to.label }) : chartString(options, "funnelConversionDesc", { v1: c.label, v2: to.label, v3: fmtPct(conv.rate) });
1312
+ }
1313
+ return p;
1314
+ }), labelH = Math.max(maxOf(catInfo.map((label) => label.h)), maxOf(totalSizes.map((label) => label.height))), chipLastH = (barH) => Math.max(barH + (totalAnnotationGap > 0 ? totalAnnotationGap / 2 + 2 * LANE_PAD : 0), labelH + 2 * LANE_PAD) + (chipsOnRow(stages.length - 1) ? chipUnderH : 0), chipCap = inner.w < CARD_PLOT_W ? CHIP_BAR_CARD : CHIP_BAR, chipCaptionGap = (pad) => captions.size > 0 ? maxOf(shownCaptions.map((c) => c.h)) + 2 * pad : 2 * pad, naturalRowsH = (stages.length - 1) * Math.max(chipCap + chipUnderH + chipCaptionGap(CHIP_CAPTION_PAD), labelH + 2 * LABEL_PAD) + chipLastH(chipCap), chipMinBar = Math.min(chipCap, Math.max(10, labelH)), chipMinimumRowsH = (stages.length - 1) * Math.max(chipMinBar + chipUnderH + LABEL_PAD, labelH + 2 * LABEL_PAD) + chipLastH(chipMinBar), paintWarningRules = [];
1315
+ return pushAll(warnings, rectSeriesAdjacentWarnings(nodes, (paint) => paintColor(theme, paint), "horizontal", highlights, theme, { rules: paintWarningRules, before: warnings.filter((warning) => !["pie-ramp-crowded", "likert-ramp-invisible", "band-lightness-insufficient", "series-adjacent-similar", "highlight-reads-as-loss"].includes(warning.code)).length })), {
1316
+ type: "funnel",
1317
+ size,
1318
+ sizing: rowSizing("funnel", size, {
1319
+ chromeH: size.height - rowsSpace,
1320
+ minimumRowsH: chipMinimumRowsH,
1321
+ naturalRowsH,
1322
+ // The frame around the rows, the stage-name column, the longest bar
1323
+ // at its shortest readable length, and the stage totals after it.
1324
+ minWidth: size.width - inner.w + bandW + MIN_LONGEST_BAR + totalReserve
1325
+ }),
1326
+ plot,
1327
+ scene: withSegmentSeams(nodes, theme),
1328
+ labels: allLabels,
1329
+ axes: [
1330
+ {
1331
+ axis: "y",
1332
+ ticks: stages.map((c, ci) => ({
1333
+ at: c.id,
1334
+ pos: band.position(ci) + band.bandwidth / 2,
1335
+ labelId: labelOn2("category") ? `category:${c.id}` : void 0
1336
+ }))
1337
+ }
1338
+ ],
1339
+ annotations: [...annResult.placed, ...autoNoteAnnotations],
1340
+ legend: frameResult.legend,
1341
+ frame: frameResult.frame,
1342
+ marks,
1343
+ derived: { stageTotals, conversions, ...worstDrop ? { worstDrop } : {} },
1344
+ a11y: {
1345
+ title: accessibleTitle(options.title, chartString(options, "funnelTitle", { v1: first.label, v2: last.label })),
1346
+ counts: [structureCount("stages", stages.length, chartString(options, "stagesCount", { v1: stages.length, v2: stages.length === 1 ? "" : "s" }))],
1347
+ desc: chartString(options, "funnelDesc", { v1: stages.length, v2: stages.length === 1 ? "" : "s", v3: a11yParts.join("; ") })
1348
+ },
1349
+ warnings,
1350
+ paintWarningRules,
1351
+ debug: {
1352
+ occupied: occupied.snapshot(),
1353
+ decisions: [...solved.decisions, ...annResult.decisions]
1354
+ }
1355
+ };
1356
+ function chipColumns() {
1357
+ let textW = 0;
1358
+ stages.forEach((c, ci) => plotted.forEach((_s, si) => {
1359
+ let v = values[si][ci];
1360
+ if (v == null || v <= 0) return;
1361
+ let text = cellText(si, ci, v);
1362
+ text && (textW = Math.max(textW, measure(text, highlights.has(c.id) ? strongFont : labelFont).width));
1363
+ }));
1364
+ let colW = textW + SWATCH_RESERVE, pitch = colW + CHIP_GAP;
1365
+ return { colW, pitch, blockW: plotted.length * pitch - CHIP_GAP, lineH: lineHeight(labelFont) };
1366
+ }
1367
+ function chipRowBand() {
1368
+ let n = stages.length, cap = inner.w < CARD_PLOT_W ? CHIP_BAR_CARD : CHIP_BAR, rowLabelH = Math.max(maxOf(catInfo.map((c) => c.h)), maxOf(totalSizes.map((t) => t.height))), lastExtra = chipsOnRow(n - 1) ? chipUnderH : 0, minGap = captions.size > 0 ? captionOnlyBandH + 2 * LABEL_PAD : 4, lastFloor = Math.max(
1369
+ rowLabelH + 2 * LANE_PAD,
1370
+ totalAnnotationGap > 0 ? Math.min(cap, rowsH / n) + totalAnnotationGap / 2 + 2 * LANE_PAD : 0
1371
+ ), fitBw = n > 1 ? (rowsH - lastExtra - lastFloor - (n - 1) * (chipUnderH + minGap)) / (n - 1) : rowsH - lastExtra, want = options.bandFraction !== void 0 ? options.bandFraction * (rowsH / n) : cap, floor = Math.min(want, Math.max(10, rowLabelH)), bandwidth = Math.max(floor, Math.min(want, fitBw)), lastH = Math.max(bandwidth, lastFloor) + lastExtra, step = n > 1 ? Math.max(bandwidth, (rowsH - lastH) / (n - 1)) : rowsH;
1372
+ return { position: (i) => rowsTop + i * step, bandwidth, step };
1373
+ }
1374
+ function totalAnchorStage(ref) {
1375
+ let norm = typeof ref == "string" ? { categoryId: ref } : ref;
1376
+ return !("categoryId" in norm) || norm.seriesId || (norm.edge ?? "total") !== "total" ? -1 : stages.findIndex((stage) => stage.id === norm.categoryId);
1377
+ }
1378
+ function seriesPaint2(s, si, ci) {
1379
+ let ramp = rampFunnelPaint(theme, plotted, s, ci ?? 0, paletteRamp ? options.palette : void 0, stages.length);
1380
+ if (ramp) return ramp;
1381
+ if (s.fill) return { css: s.fill };
1382
+ if (s.colorRole) return markRolePaint(s.colorRole, !0);
1383
+ let paint = seriesPaint(si, paletteRamp ? options.palette : void 0);
1384
+ return ci !== void 0 && theme.marks?.funnelFill === "ramp" && plotted.length === 1 && stages.length > 1 ? shadeStage(paint, ci, stages.length, void 0) : paint;
1385
+ }
1386
+ function seriesCss(s, si, ci) {
1387
+ return paintColor(theme, seriesPaint2(s, si, ci));
1388
+ }
1389
+ }
1390
+ function seriesPattern(s) {
1391
+ let sc = normalizeScenario(s.scenario, `series[${s.id}].scenario`);
1392
+ return sc === "FC" ? "hatch45" : sc === "PL" ? "outline" : void 0;
1393
+ }
1394
+
1395
+ // src/core/charts/funnel/core.ts
1396
+ var funnelCore = {
1397
+ type: "funnel",
1398
+ sizing: chartSizing("funnel"),
1399
+ title: "Funnel / pipeline",
1400
+ summary: "Stage-flow funnel: stacked rows or an honest-width centered silhouette with derived conversion rates",
1401
+ layout: (data, options) => layoutFunnel(prepareFractionData(data), options),
1402
+ categoryLabels: calendarCategories,
1403
+ prepare: prepareFractionData,
1404
+ defaults: { worstDropCallout: !1 },
1405
+ annotationKinds: ["note", "callout", "delta", "abs", "diff", "cagr"]
1406
+ };
1407
+
1408
+ export {
1409
+ funnelCore
1410
+ };