ooxml-core 1.29.0 → 1.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/dist/{PptxHandler-CZG6ISCZ.cjs → PptxHandler-DHQPVTUI.cjs} +3 -3
  2. package/dist/PptxHandler-E4DDV3FQ.mjs +4 -0
  3. package/dist/{PptxHandler-QIHYALOV.mjs → PptxHandler-KKLAYUGQ.mjs} +2 -2
  4. package/dist/{PresentationBuilder-66EU3N3O.cjs → PresentationBuilder-JORMF5CP.cjs} +5 -5
  5. package/dist/{PresentationBuilder-5YM2L7DA.mjs → PresentationBuilder-Q2Z33LLM.mjs} +2 -2
  6. package/dist/{PresentationBuilder-UAINQZA2.mjs → PresentationBuilder-YYZYCKTZ.mjs} +2 -2
  7. package/dist/automation/index.cjs +4250 -3145
  8. package/dist/automation/index.mjs +4250 -3145
  9. package/dist/chart/box-distribution.d.ts +10 -0
  10. package/dist/chart/box-distribution.d.ts.map +1 -0
  11. package/dist/chart/data-table-layout.d.ts +8 -0
  12. package/dist/chart/data-table-layout.d.ts.map +1 -0
  13. package/dist/chart/date-axis.d.ts +3 -0
  14. package/dist/chart/date-axis.d.ts.map +1 -0
  15. package/dist/chart/date-format.d.ts +39 -0
  16. package/dist/chart/date-format.d.ts.map +1 -0
  17. package/dist/chart/edit/chartex-action.d.ts.map +1 -1
  18. package/dist/chart/edit/chartex-axis.d.ts.map +1 -1
  19. package/dist/chart/edit/chartex-structure.d.ts.map +1 -1
  20. package/dist/chart/edit/chartex.d.ts +3 -1
  21. package/dist/chart/edit/chartex.d.ts.map +1 -1
  22. package/dist/chart/edit/draft.d.ts.map +1 -1
  23. package/dist/chart/funnel-geometry.d.ts +15 -0
  24. package/dist/chart/funnel-geometry.d.ts.map +1 -0
  25. package/dist/chart/index.cjs +1392 -404
  26. package/dist/chart/index.d.ts +6 -0
  27. package/dist/chart/index.d.ts.map +1 -1
  28. package/dist/chart/index.mjs +1379 -405
  29. package/dist/chart/line-path.d.ts +30 -0
  30. package/dist/chart/line-path.d.ts.map +1 -0
  31. package/dist/chart/manual-layout.d.ts +15 -0
  32. package/dist/chart/manual-layout.d.ts.map +1 -1
  33. package/dist/chart/render/chart-svg-analysis.d.ts +2 -0
  34. package/dist/chart/render/chart-svg-analysis.d.ts.map +1 -1
  35. package/dist/chart/render/chart-svg-bars.d.ts.map +1 -1
  36. package/dist/chart/render/chart-svg-box.d.ts +5 -0
  37. package/dist/chart/render/chart-svg-box.d.ts.map +1 -0
  38. package/dist/chart/render/chart-svg-cartesian.d.ts +3 -1
  39. package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
  40. package/dist/chart/render/chart-svg-data-table.d.ts +11 -0
  41. package/dist/chart/render/chart-svg-data-table.d.ts.map +1 -0
  42. package/dist/chart/render/chart-svg-date-axis.d.ts +9 -0
  43. package/dist/chart/render/chart-svg-date-axis.d.ts.map +1 -0
  44. package/dist/chart/render/chart-svg-funnel.d.ts +4 -0
  45. package/dist/chart/render/chart-svg-funnel.d.ts.map +1 -0
  46. package/dist/chart/render/chart-svg-labels.d.ts +16 -16
  47. package/dist/chart/render/chart-svg-labels.d.ts.map +1 -1
  48. package/dist/chart/render/chart-svg-line.d.ts +5 -0
  49. package/dist/chart/render/chart-svg-line.d.ts.map +1 -0
  50. package/dist/chart/render/chart-svg-plot-layout.d.ts +6 -0
  51. package/dist/chart/render/chart-svg-plot-layout.d.ts.map +1 -0
  52. package/dist/chart/render/chart-svg-plots.d.ts +2 -1
  53. package/dist/chart/render/chart-svg-plots.d.ts.map +1 -1
  54. package/dist/chart/render/chart-svg-radial.d.ts.map +1 -1
  55. package/dist/chart/render/chart-svg-slice-labels.d.ts +18 -0
  56. package/dist/chart/render/chart-svg-slice-labels.d.ts.map +1 -0
  57. package/dist/chart/render/chart-svg-xy.d.ts +2 -1
  58. package/dist/chart/render/chart-svg-xy.d.ts.map +1 -1
  59. package/dist/chart/render/chart-svg.d.ts.map +1 -1
  60. package/dist/chart/render/chart-title-text.d.ts +3 -1
  61. package/dist/chart/render/chart-title-text.d.ts.map +1 -1
  62. package/dist/chart/render/chart-view-analysis.d.ts +2 -1
  63. package/dist/chart/render/chart-view-analysis.d.ts.map +1 -1
  64. package/dist/chart/render/chart-view-data-table.d.ts +13 -0
  65. package/dist/chart/render/chart-view-data-table.d.ts.map +1 -0
  66. package/dist/chart/render/chart-view-labels.d.ts +6 -1
  67. package/dist/chart/render/chart-view-labels.d.ts.map +1 -1
  68. package/dist/chart/render/chart-view-series.d.ts.map +1 -1
  69. package/dist/chart/render/chart-view.d.ts +13 -0
  70. package/dist/chart/render/chart-view.d.ts.map +1 -1
  71. package/dist/chart/render/render-space.d.ts.map +1 -1
  72. package/dist/chart/render/summary-ex-series.d.ts +5 -0
  73. package/dist/chart/render/summary-ex-series.d.ts.map +1 -0
  74. package/dist/chart/render/summary-from-chartex.d.ts.map +1 -1
  75. package/dist/chart/render/summary-from-space.d.ts +1 -1
  76. package/dist/chart/render/summary-from-space.d.ts.map +1 -1
  77. package/dist/chart/render/summary-labels.d.ts.map +1 -1
  78. package/dist/chart/render/summary.d.ts +14 -1
  79. package/dist/chart/render/summary.d.ts.map +1 -1
  80. package/dist/{chunk-6C4NLBLB.mjs → chunk-6FXOAMNL.mjs} +1 -1
  81. package/dist/{chunk-T7HBA3CW.cjs → chunk-7T3SJQA6.cjs} +11 -9
  82. package/dist/{chunk-XROY25LN.cjs → chunk-7XYVFUB3.cjs} +4 -0
  83. package/dist/{chunk-I2CGNAP2.cjs → chunk-B4LXDHBX.cjs} +1409 -1389
  84. package/dist/{chunk-GUNTIFGT.cjs → chunk-CZXM4ZJH.cjs} +158 -26
  85. package/dist/{chunk-RYOJHYA3.mjs → chunk-DJ3CDTMX.mjs} +157 -27
  86. package/dist/{chunk-BBK3UB7M.mjs → chunk-FFJBOR2Y.mjs} +4 -4
  87. package/dist/{chunk-DWEQWFQU.mjs → chunk-GJDFCP2T.mjs} +248 -228
  88. package/dist/{chunk-KBER3RAP.mjs → chunk-KWJYMAEF.mjs} +248 -228
  89. package/dist/{chunk-XCRDAVFN.mjs → chunk-MKDONWNO.mjs} +237 -95
  90. package/dist/{chunk-3UMDVJRN.mjs → chunk-NBMXEVHL.mjs} +4 -1
  91. package/dist/{chunk-TVJL7QIG.cjs → chunk-OGEL4Z4S.cjs} +8 -1
  92. package/dist/{chunk-HRU3KOE5.mjs → chunk-OORQCSVA.mjs} +5 -3
  93. package/dist/{chunk-7RJYOVQU.mjs → chunk-R7NS42KQ.mjs} +5 -2
  94. package/dist/{chunk-DXOBT2JE.mjs → chunk-UZWV2HAJ.mjs} +8 -2
  95. package/dist/{chunk-PDZ4GQLI.mjs → chunk-WZJ25K7P.mjs} +1 -1
  96. package/dist/{chunk-IETFPVLN.cjs → chunk-XTUX5RMG.cjs} +15 -12
  97. package/dist/diagram/drawing.d.ts.map +1 -1
  98. package/dist/diagram/index.cjs +1218 -592
  99. package/dist/diagram/index.mjs +1218 -592
  100. package/dist/diagram/load.d.ts.map +1 -1
  101. package/dist/diagram/relationships.d.ts +1 -0
  102. package/dist/diagram/relationships.d.ts.map +1 -1
  103. package/dist/diagram/types.d.ts +2 -0
  104. package/dist/diagram/types.d.ts.map +1 -1
  105. package/dist/docx/diagram.d.ts.map +1 -1
  106. package/dist/docx/drawing.d.ts.map +1 -1
  107. package/dist/docx/embedded.cjs +1850 -1138
  108. package/dist/docx/embedded.mjs +1850 -1138
  109. package/dist/docx/index.cjs +3312 -1713
  110. package/dist/docx/index.mjs +3312 -1713
  111. package/dist/docx/layout/adapter.d.ts.map +1 -1
  112. package/dist/docx/layout/fonts.d.ts +1 -1
  113. package/dist/docx/layout/fonts.d.ts.map +1 -1
  114. package/dist/docx/layout/index.cjs +1933 -518
  115. package/dist/docx/layout/index.mjs +1933 -518
  116. package/dist/docx/layout/script-fonts.d.ts +6 -0
  117. package/dist/docx/layout/script-fonts.d.ts.map +1 -0
  118. package/dist/docx/load/index.cjs +1853 -1141
  119. package/dist/docx/load/index.mjs +1853 -1141
  120. package/dist/docx/parse.d.ts.map +1 -1
  121. package/dist/docx/shape-model.d.ts +2 -0
  122. package/dist/docx/shape-model.d.ts.map +1 -1
  123. package/dist/docx/shape-parse.d.ts.map +1 -1
  124. package/dist/docx/shape-svg.d.ts.map +1 -1
  125. package/dist/docx/ui/index.cjs +1763 -593
  126. package/dist/docx/ui/index.mjs +1763 -593
  127. package/dist/docx/write-shape.d.ts.map +1 -1
  128. package/dist/drawingml/custom-geometry.d.ts +5 -0
  129. package/dist/drawingml/custom-geometry.d.ts.map +1 -0
  130. package/dist/drawingml/drawing-fill.d.ts.map +1 -1
  131. package/dist/drawingml/drawing-geometry.d.ts.map +1 -1
  132. package/dist/drawingml/image-content-type.d.ts +2 -0
  133. package/dist/drawingml/image-content-type.d.ts.map +1 -0
  134. package/dist/drawingml/index.cjs +1128 -179
  135. package/dist/drawingml/index.d.ts +9 -0
  136. package/dist/drawingml/index.d.ts.map +1 -1
  137. package/dist/drawingml/index.mjs +1110 -180
  138. package/dist/drawingml/path-data.d.ts +4 -0
  139. package/dist/drawingml/path-data.d.ts.map +1 -0
  140. package/dist/drawingml/picture-crop.d.ts +8 -0
  141. package/dist/drawingml/picture-crop.d.ts.map +1 -0
  142. package/dist/drawingml/picture-effects.d.ts +37 -0
  143. package/dist/drawingml/picture-effects.d.ts.map +1 -0
  144. package/dist/drawingml/picture-fill.d.ts +7 -0
  145. package/dist/drawingml/picture-fill.d.ts.map +1 -0
  146. package/dist/drawingml/read-3d-values.d.ts +8 -0
  147. package/dist/drawingml/read-3d-values.d.ts.map +1 -0
  148. package/dist/drawingml/read-text-3d.d.ts +8 -0
  149. package/dist/drawingml/read-text-3d.d.ts.map +1 -0
  150. package/dist/drawingml/read-text-body.d.ts.map +1 -1
  151. package/dist/drawingml/scene3d-coordinate.d.ts +45 -0
  152. package/dist/drawingml/scene3d-coordinate.d.ts.map +1 -0
  153. package/dist/drawingml/scene3d-presets.d.ts +12 -0
  154. package/dist/drawingml/scene3d-presets.d.ts.map +1 -0
  155. package/dist/drawingml/text-3d-model.d.ts +71 -0
  156. package/dist/drawingml/text-3d-model.d.ts.map +1 -0
  157. package/dist/drawingml/text-model.d.ts +3 -0
  158. package/dist/drawingml/text-model.d.ts.map +1 -1
  159. package/dist/drawingml/types.d.ts +3 -0
  160. package/dist/drawingml/types.d.ts.map +1 -1
  161. package/dist/drawingml/write-pattern-picture.d.ts.map +1 -1
  162. package/dist/drawingml/write-text-3d.d.ts +6 -0
  163. package/dist/drawingml/write-text-3d.d.ts.map +1 -0
  164. package/dist/drawingml/write-text-body.d.ts.map +1 -1
  165. package/dist/geometry/element-transform.d.ts +3 -0
  166. package/dist/geometry/element-transform.d.ts.map +1 -1
  167. package/dist/geometry/index.cjs +69 -4
  168. package/dist/geometry/index.d.ts +2 -0
  169. package/dist/geometry/index.d.ts.map +1 -1
  170. package/dist/geometry/index.mjs +66 -5
  171. package/dist/geometry/picture-crop.d.ts +21 -0
  172. package/dist/geometry/picture-crop.d.ts.map +1 -0
  173. package/dist/geometry/resize-aspect.d.ts +12 -0
  174. package/dist/geometry/resize-aspect.d.ts.map +1 -0
  175. package/dist/index.cjs +4201 -2058
  176. package/dist/index.mjs +4201 -2058
  177. package/dist/opc/index.cjs +9 -6
  178. package/dist/opc/index.mjs +9 -6
  179. package/dist/opc/safe-href.d.ts +10 -3
  180. package/dist/opc/safe-href.d.ts.map +1 -1
  181. package/dist/pptx/automation/index.cjs +634 -361
  182. package/dist/pptx/automation/index.d.ts +6 -6
  183. package/dist/pptx/automation/index.mjs +5 -5
  184. package/dist/pptx/chunks/{elements-CCEghtE_.d.ts → elements-mSCZ84Tc.d.ts} +4 -4
  185. package/dist/pptx/chunks/elements-mSCZ84Tc.d.ts.map +1 -0
  186. package/dist/pptx/chunks/{index-D90lhgiE.d.ts → index-BQDcu_0a.d.ts} +19 -111
  187. package/dist/pptx/chunks/index-BQDcu_0a.d.ts.map +1 -0
  188. package/dist/pptx/chunks/{index-CmnbpSCL.d.ts → index-CBV1oHN7.d.ts} +5 -5
  189. package/dist/pptx/chunks/{index-CmnbpSCL.d.ts.map → index-CBV1oHN7.d.ts.map} +1 -1
  190. package/dist/pptx/chunks/{index-DJIPX0Ge.d.ts → index-PdM5zpmu.d.ts} +5 -5
  191. package/dist/pptx/chunks/{index-DJIPX0Ge.d.ts.map → index-PdM5zpmu.d.ts.map} +1 -1
  192. package/dist/pptx/chunks/{smart-art-BLBSej3J.d.ts → smart-art-DLumQo90.d.ts} +135 -103
  193. package/dist/pptx/chunks/smart-art-DLumQo90.d.ts.map +1 -0
  194. package/dist/pptx/chunks/{text-D49FKllA.d.ts → text-P9xVnXXf.d.ts} +49 -60
  195. package/dist/pptx/chunks/text-P9xVnXXf.d.ts.map +1 -0
  196. package/dist/pptx/chunks/{text-operations-DZ1IgDJN.d.ts → text-operations-hyPODwIQ.d.ts} +4 -4
  197. package/dist/pptx/chunks/{text-operations-DZ1IgDJN.d.ts.map → text-operations-hyPODwIQ.d.ts.map} +1 -1
  198. package/dist/pptx/cli/index.cjs +630 -357
  199. package/dist/pptx/cli/index.d.ts +1 -1
  200. package/dist/pptx/cli/index.mjs +4 -4
  201. package/dist/pptx/converter/index.cjs +102 -67
  202. package/dist/pptx/converter/index.d.ts +1 -1
  203. package/dist/pptx/converter/index.mjs +2 -2
  204. package/dist/pptx/editor/render/collaboration-assets.cjs +15 -11
  205. package/dist/pptx/editor/render/collaboration-assets.d.ts +2 -2
  206. package/dist/pptx/editor/render/collaboration-assets.mjs +1 -1
  207. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +5 -5
  208. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +3 -3
  209. package/dist/pptx/editor/render/collaboration-reconcile.cjs +9 -9
  210. package/dist/pptx/editor/render/collaboration-reconcile.d.ts.map +1 -1
  211. package/dist/pptx/editor/render/collaboration-reconcile.mjs +3 -3
  212. package/dist/pptx/editor/render/collaboration-sync.cjs +29 -25
  213. package/dist/pptx/editor/render/collaboration-sync.d.ts +7 -0
  214. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  215. package/dist/pptx/editor/render/collaboration-sync.mjs +2 -2
  216. package/dist/pptx/editor/render/find-replace.cjs +14 -14
  217. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  218. package/dist/pptx/editor/render/find-replace.mjs +1 -1
  219. package/dist/pptx/editor/render/font-family-update.d.ts +1 -1
  220. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +1 -1
  221. package/dist/pptx/editor/render/slide-operations.cjs +8 -8
  222. package/dist/pptx/editor/render/slide-operations.mjs +2 -2
  223. package/dist/pptx/editor/render/table-cell-edit.cjs +8 -4
  224. package/dist/pptx/editor/render/table-cell-edit.d.ts +5 -0
  225. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  226. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  227. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  228. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  229. package/dist/pptx/editor/render/table-data-grid-ops.cjs +2 -2
  230. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  231. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  232. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  233. package/dist/pptx/editor/render/text-content-style.d.ts +1 -1
  234. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
  235. package/dist/pptx/editor/render/text-style-scope.d.ts +2 -2
  236. package/dist/pptx/editor/render/update-text-segment-style.d.ts +1 -1
  237. package/dist/pptx/index.cjs +696 -419
  238. package/dist/pptx/index.d.ts +8 -8
  239. package/dist/pptx/index.mjs +5 -5
  240. package/dist/pptx/node/index.d.ts +1 -1
  241. package/dist/pptx/smartart-layouts/index.d.ts +1 -1
  242. package/dist/teams/index.cjs +1816 -1049
  243. package/dist/teams/index.mjs +1816 -1049
  244. package/dist/text/font-style-name.d.ts +11 -0
  245. package/dist/text/font-style-name.d.ts.map +1 -0
  246. package/dist/text/font-substitution-map.d.ts +3 -0
  247. package/dist/text/font-substitution-map.d.ts.map +1 -0
  248. package/dist/text/font-substitution.d.ts +34 -0
  249. package/dist/text/font-substitution.d.ts.map +1 -0
  250. package/dist/text/index.cjs +460 -0
  251. package/dist/text/index.d.ts +3 -0
  252. package/dist/text/index.d.ts.map +1 -1
  253. package/dist/text/index.mjs +443 -1
  254. package/dist/text/metric-font-family.d.ts +7 -0
  255. package/dist/text/metric-font-family.d.ts.map +1 -0
  256. package/dist/text/panose.d.ts +55 -0
  257. package/dist/text/panose.d.ts.map +1 -0
  258. package/dist/text/script-fonts.d.ts +26 -0
  259. package/dist/text/script-fonts.d.ts.map +1 -0
  260. package/dist/visio/edit-geometry-admission.d.ts +1 -1
  261. package/dist/visio/edit-geometry-admission.d.ts.map +1 -1
  262. package/dist/visio/edit-group-resize.d.ts +26 -0
  263. package/dist/visio/edit-group-resize.d.ts.map +1 -0
  264. package/dist/visio/edit-recalculate-index.d.ts +2 -0
  265. package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
  266. package/dist/visio/edit-resize-anchor.d.ts.map +1 -1
  267. package/dist/visio/edit-resize-plan.d.ts +14 -0
  268. package/dist/visio/edit-resize-plan.d.ts.map +1 -0
  269. package/dist/visio/edit-scope.d.ts.map +1 -1
  270. package/dist/visio/index.cjs +1326 -389
  271. package/dist/visio/index.mjs +1326 -389
  272. package/dist/visio/ui/geometry-expectation.d.ts +17 -0
  273. package/dist/visio/ui/geometry-expectation.d.ts.map +1 -0
  274. package/dist/visio/ui/guides.d.ts +2 -0
  275. package/dist/visio/ui/guides.d.ts.map +1 -1
  276. package/dist/visio/ui/index.cjs +1582 -411
  277. package/dist/visio/ui/index.d.ts +2 -0
  278. package/dist/visio/ui/index.d.ts.map +1 -1
  279. package/dist/visio/ui/index.mjs +1579 -412
  280. package/dist/visio/ui/selection-resize.d.ts +19 -0
  281. package/dist/visio/ui/selection-resize.d.ts.map +1 -0
  282. package/dist/visio/ui/shape-move.d.ts +1 -1
  283. package/dist/visio/ui/shape-move.d.ts.map +1 -1
  284. package/dist/visio/ui/shape-resize.d.ts.map +1 -1
  285. package/dist/xlsx/edit/drawings.d.ts +5 -0
  286. package/dist/xlsx/edit/drawings.d.ts.map +1 -1
  287. package/dist/xlsx/edit/session.d.ts.map +1 -1
  288. package/dist/xlsx/edit/types.d.ts +4 -0
  289. package/dist/xlsx/edit/types.d.ts.map +1 -1
  290. package/dist/xlsx/index.cjs +3908 -2256
  291. package/dist/xlsx/index.mjs +3908 -2256
  292. package/dist/xlsx/layout/chart-view.d.ts.map +1 -1
  293. package/dist/xlsx/load/index.cjs +2003 -1239
  294. package/dist/xlsx/load/index.mjs +2003 -1239
  295. package/dist/xlsx/model.d.ts +4 -0
  296. package/dist/xlsx/model.d.ts.map +1 -1
  297. package/dist/xlsx/read/chart.d.ts.map +1 -1
  298. package/dist/xlsx/read/drawing.d.ts.map +1 -1
  299. package/dist/xlsx/read/smart-art.d.ts.map +1 -1
  300. package/dist/xlsx/ui/index.cjs +3880 -2228
  301. package/dist/xlsx/ui/index.mjs +3880 -2228
  302. package/dist/xlsx/write/drawing.d.ts.map +1 -1
  303. package/package.json +1 -1
  304. package/dist/PptxHandler-DSXSXMEG.mjs +0 -4
  305. package/dist/pptx/chunks/elements-CCEghtE_.d.ts.map +0 -1
  306. package/dist/pptx/chunks/index-D90lhgiE.d.ts.map +0 -1
  307. package/dist/pptx/chunks/smart-art-BLBSej3J.d.ts.map +0 -1
  308. package/dist/pptx/chunks/text-D49FKllA.d.ts.map +0 -1
@@ -95,13 +95,13 @@ function groupRowsByCategory(rawCategories) {
95
95
  const rowIndexesByCategory = /* @__PURE__ */ new Map();
96
96
  rawCategories.forEach((rawLabel, rowIndex) => {
97
97
  const label = rawLabel ?? "";
98
- let rows = rowIndexesByCategory.get(label);
99
- if (!rows) {
100
- rows = [];
101
- rowIndexesByCategory.set(label, rows);
98
+ let rows2 = rowIndexesByCategory.get(label);
99
+ if (!rows2) {
100
+ rows2 = [];
101
+ rowIndexesByCategory.set(label, rows2);
102
102
  uniqueCategories.push(label);
103
103
  }
104
- rows.push(rowIndex);
104
+ rows2.push(rowIndex);
105
105
  });
106
106
  return { uniqueCategories, rowIndexesByCategory };
107
107
  }
@@ -731,10 +731,10 @@ function squarify(nodes, box) {
731
731
 
732
732
  // chart/hierarchy.ts
733
733
  function normalizeLevels(levels, pointCount) {
734
- return levels.map((level2) => {
734
+ return levels.map((level3) => {
735
735
  let previous = "";
736
736
  return Array.from({ length: pointCount }, (_, index) => {
737
- const label = level2[index]?.trim() ?? "";
737
+ const label = level3[index]?.trim() ?? "";
738
738
  if (label) previous = label;
739
739
  return label || previous;
740
740
  });
@@ -892,12 +892,12 @@ function computeSunburstArcs(series2, cx, cy, maxR) {
892
892
  });
893
893
  return out;
894
894
  }
895
- function hierarchyKey(levels, level2, index) {
896
- return levels.slice(level2).map((labels2) => labels2[index] ?? "").join("\0");
895
+ function hierarchyKey(levels, level3, index) {
896
+ return levels.slice(level3).map((labels2) => labels2[index] ?? "").join("\0");
897
897
  }
898
898
  function computeHierarchicalSunburstArcs(categoryLevels2, values, cx, cy, maxR) {
899
- const levels = categoryLevels2.filter((level2) => level2.length > 0);
900
- const leafCount = Math.max(values.length, ...levels.map((level2) => level2.length), 0);
899
+ const levels = categoryLevels2.filter((level3) => level3.length > 0);
900
+ const leafCount = Math.max(values.length, ...levels.map((level3) => level3.length), 0);
901
901
  if (levels.length === 0 || leafCount === 0) return [];
902
902
  const rawWeights = Array.from({ length: leafCount }, (_, index) => Math.abs(values[index] ?? 0));
903
903
  const weights = rawWeights.some((value) => value !== 0) ? rawWeights : rawWeights.map(() => 1);
@@ -908,15 +908,15 @@ function computeHierarchicalSunburstArcs(categoryLevels2, values, cx, cy, maxR)
908
908
  const rootLabels = levels[levels.length - 1] ?? [];
909
909
  const rootColors = /* @__PURE__ */ new Map();
910
910
  const out = [];
911
- for (let level2 = levels.length - 1; level2 >= 0; level2--) {
912
- const ringIndex = levels.length - 1 - level2;
911
+ for (let level3 = levels.length - 1; level3 >= 0; level3--) {
912
+ const ringIndex = levels.length - 1 - level3;
913
913
  const innerRadius = ringWidth * (ringIndex + 0.5);
914
914
  const outerRadius = ringWidth * (ringIndex + 1.5);
915
915
  let start = 0;
916
916
  while (start < leafCount) {
917
- const key = hierarchyKey(levels, level2, start);
917
+ const key = hierarchyKey(levels, level3, start);
918
918
  let end = start + 1;
919
- while (end < leafCount && hierarchyKey(levels, level2, end) === key) end++;
919
+ while (end < leafCount && hierarchyKey(levels, level3, end) === key) end++;
920
920
  const startAngle = -Math.PI / 2 + (prefix[start] ?? 0) / total * Math.PI * 2;
921
921
  const endAngle = -Math.PI / 2 + (prefix[end] ?? 0) / total * Math.PI * 2;
922
922
  const rootLabel = rootLabels[start] ?? "";
@@ -926,8 +926,8 @@ function computeHierarchicalSunburstArcs(categoryLevels2, values, cx, cy, maxR)
926
926
  colorIndex: rootColors.get(rootLabel) ?? start,
927
927
  opacity: Math.max(0.1, 0.9 - ringIndex * 0.1),
928
928
  level: ringIndex,
929
- label: levels[level2]?.[start] ?? "",
930
- ...level2 === 0 && end === start + 1 ? { pointIndex: start } : {},
929
+ label: levels[level3]?.[start] ?? "",
930
+ ...level3 === 0 && end === start + 1 ? { pointIndex: start } : {},
931
931
  ...arcLabelPlacement(cx, cy, (innerRadius + outerRadius) / 2, startAngle, endAngle)
932
932
  });
933
933
  start = end;
@@ -1185,11 +1185,11 @@ function computeHistogramBins(values, options2, format = String) {
1185
1185
  function aggregateByCategory(values, rawCategories) {
1186
1186
  const { uniqueCategories, rowIndexesByCategory } = groupRowsByCategory(rawCategories);
1187
1187
  return uniqueCategories.map((label) => {
1188
- const rows = rowIndexesByCategory.get(label) ?? [];
1188
+ const rows2 = rowIndexesByCategory.get(label) ?? [];
1189
1189
  return {
1190
- value: rows.reduce((sum, row) => sum + (values[row] ?? 0), 0),
1190
+ value: rows2.reduce((sum, row) => sum + (values[row] ?? 0), 0),
1191
1191
  label,
1192
- sourceIndices: rows
1192
+ sourceIndices: rows2
1193
1193
  };
1194
1194
  });
1195
1195
  }
@@ -2042,8 +2042,8 @@ function parseXml(xml, options2 = {}) {
2042
2042
  let parsed;
2043
2043
  try {
2044
2044
  parsed = new DOMParser({
2045
- onError: (level2, message) => {
2046
- if (level2 !== "warning") parseError = message;
2045
+ onError: (level3, message) => {
2046
+ if (level3 !== "warning") parseError = message;
2047
2047
  }
2048
2048
  }).parseFromString(xml, "application/xml");
2049
2049
  } catch (error) {
@@ -2530,6 +2530,141 @@ function builtInChartTextStyle(id) {
2530
2530
  };
2531
2531
  }
2532
2532
 
2533
+ // drawingml/picture-crop.ts
2534
+ var SIDES = { l: "cropLeft", t: "cropTop", r: "cropRight", b: "cropBottom" };
2535
+ function parsePictureCrop(blipFill) {
2536
+ const rect2 = first(blipFill, "srcRect", NS.a);
2537
+ if (!rect2) return void 0;
2538
+ const result = {};
2539
+ for (const [attr2, key] of Object.entries(SIDES)) {
2540
+ const raw2 = rect2.getAttribute(attr2);
2541
+ if (raw2 === null || !raw2.trim()) continue;
2542
+ const percent = raw2.endsWith("%");
2543
+ const value = Number(percent ? raw2.slice(0, -1) : raw2) / (percent ? 100 : 1e5);
2544
+ if (Number.isFinite(value)) result[key] = value;
2545
+ }
2546
+ return result;
2547
+ }
2548
+ function applyPictureCrop(blipFill, crop) {
2549
+ let rect2 = first(blipFill, "srcRect", NS.a);
2550
+ if (!rect2 && crop && Object.values(crop).some((value) => value !== void 0)) {
2551
+ rect2 = blipFill.ownerDocument.createElementNS(NS.a, "a:srcRect");
2552
+ const blip = first(blipFill, "blip", NS.a);
2553
+ blipFill.insertBefore(rect2, blip?.nextSibling ?? blipFill.firstChild);
2554
+ }
2555
+ if (!rect2) return;
2556
+ for (const [attr2, key] of Object.entries(SIDES)) {
2557
+ const value = crop?.[key];
2558
+ if (value === void 0) rect2.removeAttribute(attr2);
2559
+ else {
2560
+ if (!Number.isFinite(value)) throw new RangeError("Picture crop must be finite");
2561
+ rect2.setAttribute(attr2, String(Math.round(value * 1e5)));
2562
+ }
2563
+ }
2564
+ }
2565
+
2566
+ // drawingml/picture-effects.ts
2567
+ function picturePercentage(value) {
2568
+ const text2 = String(value ?? "").trim();
2569
+ if (!text2) return void 0;
2570
+ const percent = text2.endsWith("%");
2571
+ const n2 = Number(percent ? text2.slice(0, -1) : text2) / (percent ? 100 : 1e5);
2572
+ return Number.isFinite(n2) ? n2 : void 0;
2573
+ }
2574
+ function readPictureEffect(name, attribute2) {
2575
+ if (name === "grayscl") return { kind: "grayscale" };
2576
+ if (name === "lum") {
2577
+ const brightness = picturePercentage(attribute2("bright"));
2578
+ const contrast = picturePercentage(attribute2("contrast"));
2579
+ for (const [name2, value] of [
2580
+ ["bright", brightness],
2581
+ ["contrast", contrast]
2582
+ ]) {
2583
+ const raw2 = attribute2(name2);
2584
+ if (raw2 !== void 0 && raw2 !== null && (value === void 0 || Math.abs(value) > 1))
2585
+ return void 0;
2586
+ }
2587
+ return {
2588
+ kind: "luminance",
2589
+ ...brightness !== void 0 ? { brightness } : {},
2590
+ ...contrast !== void 0 ? { contrast } : {}
2591
+ };
2592
+ }
2593
+ if (name === "alphaModFix") {
2594
+ const raw2 = attribute2("amt");
2595
+ const amount = raw2 === void 0 || raw2 === null ? 1 : picturePercentage(raw2);
2596
+ if (amount !== void 0 && amount >= 0) return { kind: "alphaModFix", amount };
2597
+ }
2598
+ return void 0;
2599
+ }
2600
+ function parsePictureEffects(blip) {
2601
+ if (!blip) return [];
2602
+ return elements(blip).map((node) => ({
2603
+ ...(node.namespaceURI === NS.a ? readPictureEffect(node.localName, (name) => node.getAttribute(name)) : void 0) ?? { kind: "unsupported", name: node.localName },
2604
+ sourceXml: buildXml(node)
2605
+ }));
2606
+ }
2607
+ function applyPictureEffects(blip, effects2) {
2608
+ if (JSON.stringify(parsePictureEffects(blip)) === JSON.stringify(effects2)) return;
2609
+ const nodes = effects2.map((effect) => {
2610
+ const name = effect.kind === "grayscale" ? "grayscl" : effect.kind === "luminance" ? "lum" : effect.kind === "unsupported" ? effect.name : effect.kind;
2611
+ const source = effect.sourceXml ? parseXml(effect.sourceXml).documentElement : void 0;
2612
+ if (effect.kind === "unsupported" && !source)
2613
+ throw new Error("An unsupported picture effect needs source XML");
2614
+ const node = source ? blip.ownerDocument.importNode(source, true) : blip.ownerDocument.createElementNS(NS.a, `a:${name}`);
2615
+ if (effect.kind !== "unsupported" && (node.namespaceURI !== NS.a || node.localName !== name))
2616
+ throw new Error("Picture effect source does not match its kind");
2617
+ const set = (name2, value) => {
2618
+ const original = picturePercentage(node.getAttribute(name2));
2619
+ if (value === void 0) node.removeAttribute(name2);
2620
+ else if (value !== original) {
2621
+ if (!Number.isFinite(value)) throw new RangeError("Picture effect must be finite");
2622
+ node.setAttribute(name2, String(Math.round(value * 1e5)));
2623
+ }
2624
+ };
2625
+ if (effect.kind === "luminance") {
2626
+ if ([effect.brightness, effect.contrast].some(
2627
+ (value) => value !== void 0 && (!Number.isFinite(value) || Math.abs(value) > 1)
2628
+ ))
2629
+ throw new RangeError("Picture luminance must be between -1 and 1");
2630
+ set("bright", effect.brightness);
2631
+ set("contrast", effect.contrast);
2632
+ }
2633
+ if (effect.kind === "alphaModFix") {
2634
+ if (effect.amount < 0) throw new RangeError("Picture alpha must be nonnegative");
2635
+ set("amt", effect.amount);
2636
+ }
2637
+ return node;
2638
+ });
2639
+ for (const node of elements(blip)) blip.removeChild(node);
2640
+ for (const node of nodes) blip.appendChild(node);
2641
+ }
2642
+
2643
+ // drawingml/picture-fill.ts
2644
+ function parseDrawingPictureFill(fill) {
2645
+ const blip = first(fill, "blip", NS.a);
2646
+ const relId = blip?.getAttributeNS(NS.r, "embed") || blip?.getAttribute("r:embed") || void 0;
2647
+ const linkRelId = blip?.getAttributeNS(NS.r, "link") || void 0;
2648
+ const crop = parsePictureCrop(fill);
2649
+ const effects2 = parsePictureEffects(blip);
2650
+ const tile = first(fill, "tile", NS.a);
2651
+ const rect2 = first(first(fill, "stretch", NS.a), "fillRect", NS.a);
2652
+ const unsupported2 = [
2653
+ ...tile ? ["tile"] : [],
2654
+ ...rect2 && ["l", "t", "r", "b"].some((key) => Number(rect2.getAttribute(key) ?? 0) !== 0) ? ["fillRect"] : [],
2655
+ ...fill.getAttribute("rotWithShape") === "0" || fill.getAttribute("rotWithShape") === "false" ? ["rotWithShape"] : []
2656
+ ];
2657
+ return {
2658
+ kind: "picture",
2659
+ sourceXml: buildXml(fill),
2660
+ ...relId ? { relId } : {},
2661
+ ...linkRelId ? { linkRelId } : {},
2662
+ ...crop ? { crop } : {},
2663
+ ...effects2.length ? { effects: effects2 } : {},
2664
+ ...unsupported2.length ? { unsupportedPicture: unsupported2 } : {}
2665
+ };
2666
+ }
2667
+
2533
2668
  // drawingml/drawing-fill.ts
2534
2669
  var FILL_ELEMENTS = /* @__PURE__ */ new Set([
2535
2670
  "noFill",
@@ -2539,13 +2674,13 @@ var FILL_ELEMENTS = /* @__PURE__ */ new Set([
2539
2674
  "blipFill",
2540
2675
  "grpFill"
2541
2676
  ]);
2542
- function fillElementOf(properties2) {
2543
- return properties2 ? elements(properties2).find(
2677
+ function fillElementOf(properties) {
2678
+ return properties ? elements(properties).find(
2544
2679
  (element2) => FILL_ELEMENTS.has(element2.localName) && (!element2.namespaceURI || element2.namespaceURI === NS.a)
2545
2680
  ) : void 0;
2546
2681
  }
2547
- function parseDrawingFill(properties2) {
2548
- const fill = fillElementOf(properties2);
2682
+ function parseDrawingFill(properties) {
2683
+ const fill = fillElementOf(properties);
2549
2684
  if (!fill) return void 0;
2550
2685
  switch (fill.localName) {
2551
2686
  case "noFill":
@@ -2600,17 +2735,8 @@ function parseDrawingFill(properties2) {
2600
2735
  ...background ? { background } : {}
2601
2736
  };
2602
2737
  }
2603
- case "blipFill": {
2604
- const blip = first(fill, "blip", NS.a);
2605
- const relId = blip?.getAttributeNS(NS.r, "embed") || blip?.getAttribute("r:embed") || void 0;
2606
- const linkRelId = blip?.getAttributeNS(NS.r, "link") || void 0;
2607
- return {
2608
- kind: "picture",
2609
- sourceXml: buildXml(fill),
2610
- ...relId ? { relId } : {},
2611
- ...linkRelId ? { linkRelId } : {}
2612
- };
2613
- }
2738
+ case "blipFill":
2739
+ return parseDrawingPictureFill(fill);
2614
2740
  default:
2615
2741
  return { kind: "unsupported", element: fill.localName };
2616
2742
  }
@@ -2667,7 +2793,7 @@ function drawingDashLength(value) {
2667
2793
  }
2668
2794
 
2669
2795
  // chart/read-appearance.ts
2670
- function readChartAppearance(text2, properties2) {
2796
+ function readChartAppearance(text2, properties) {
2671
2797
  const out = {};
2672
2798
  const size = Number(text2?.getAttribute("sz") ?? NaN);
2673
2799
  if (Number.isFinite(size) && size > 0) out.fontSize = size / 100;
@@ -2684,8 +2810,8 @@ function readChartAppearance(text2, properties2) {
2684
2810
  if (typeface2) out.typeface = typeface2;
2685
2811
  const color2 = parseDrawingColorIn(first(text2, "solidFill", NS.a));
2686
2812
  if (color2) out.textColor = color2;
2687
- const fill = parseDrawingFill(properties2);
2688
- const line2 = parseDrawingLine(first(properties2, "ln", NS.a));
2813
+ const fill = parseDrawingFill(properties);
2814
+ const line2 = parseDrawingLine(first(properties, "ln", NS.a));
2689
2815
  if (fill) out.fill = fill;
2690
2816
  if (line2) out.line = line2;
2691
2817
  const effects2 = first(text2, "effectLst", NS.a);
@@ -2770,19 +2896,19 @@ function parseSpacing(parent) {
2770
2896
  }
2771
2897
  return void 0;
2772
2898
  }
2773
- function parseProperties(properties2) {
2899
+ function parseProperties(properties) {
2774
2900
  const parsed = {};
2775
- const size = Number.parseInt(properties2?.getAttribute("sz") ?? "", 10);
2901
+ const size = Number.parseInt(properties?.getAttribute("sz") ?? "", 10);
2776
2902
  if (Number.isFinite(size)) parsed.sizePt = size / 100;
2777
- const bold = booleanAttribute(properties2, "b");
2903
+ const bold = booleanAttribute(properties, "b");
2778
2904
  if (bold !== void 0) parsed.bold = bold;
2779
- const italic = booleanAttribute(properties2, "i");
2905
+ const italic = booleanAttribute(properties, "i");
2780
2906
  if (italic !== void 0) parsed.italic = italic;
2781
- const underline = properties2?.getAttribute("u");
2907
+ const underline = properties?.getAttribute("u");
2782
2908
  if (underline) parsed.underline = underline !== "none";
2783
- const color2 = parseDrawingColorIn(first(properties2, "solidFill", NS.a));
2909
+ const color2 = parseDrawingColorIn(first(properties, "solidFill", NS.a));
2784
2910
  if (color2) parsed.color = color2;
2785
- const typeface2 = first(properties2, "latin", NS.a)?.getAttribute("typeface");
2911
+ const typeface2 = first(properties, "latin", NS.a)?.getAttribute("typeface");
2786
2912
  if (typeface2) parsed.typeface = typeface2;
2787
2913
  return parsed;
2788
2914
  }
@@ -2797,12 +2923,12 @@ function parseParagraph(paragraph2) {
2797
2923
  for (const child3 of elements(paragraph2))
2798
2924
  if (child3.namespaceURI === NS.a && ["r", "fld", "br"].includes(child3.localName))
2799
2925
  runs.push(parseRun(child3));
2800
- const properties2 = first(paragraph2, "pPr", NS.a);
2801
- const align = properties2?.getAttribute("algn");
2802
- const defaults = parseProperties(first(properties2, "defRPr", NS.a));
2803
- const lineSpacing = parseSpacing(first(properties2, "lnSpc", NS.a));
2804
- const spaceBefore = parseSpacing(first(properties2, "spcBef", NS.a));
2805
- const spaceAfter = parseSpacing(first(properties2, "spcAft", NS.a));
2926
+ const properties = first(paragraph2, "pPr", NS.a);
2927
+ const align = properties?.getAttribute("algn");
2928
+ const defaults = parseProperties(first(properties, "defRPr", NS.a));
2929
+ const lineSpacing = parseSpacing(first(properties, "lnSpc", NS.a));
2930
+ const spaceBefore = parseSpacing(first(properties, "spcBef", NS.a));
2931
+ const spaceAfter = parseSpacing(first(properties, "spcAft", NS.a));
2806
2932
  return {
2807
2933
  ...align ? { align } : {},
2808
2934
  ...Object.keys(defaults).length ? { defaultProperties: defaults } : {},
@@ -2814,13 +2940,13 @@ function parseParagraph(paragraph2) {
2814
2940
  }
2815
2941
  function parseDrawingTextBody(body) {
2816
2942
  if (!body) return void 0;
2817
- const properties2 = first(body, "bodyPr", NS.a);
2943
+ const properties = first(body, "bodyPr", NS.a);
2818
2944
  const paragraphs = children(body, "p", NS.a).map(parseParagraph);
2819
2945
  const result = {
2820
2946
  paragraphs,
2821
2947
  text: paragraphs.map((paragraph2) => paragraph2.runs.map((run2) => run2.text).join("")).join("\n")
2822
2948
  };
2823
- const anchor = properties2?.getAttribute("anchor");
2949
+ const anchor = properties?.getAttribute("anchor");
2824
2950
  if (anchor) result.anchor = anchor;
2825
2951
  const insets = {};
2826
2952
  for (const [key, attribute2] of [
@@ -2829,7 +2955,7 @@ function parseDrawingTextBody(body) {
2829
2955
  ["right", "rIns"],
2830
2956
  ["bottom", "bIns"]
2831
2957
  ]) {
2832
- const value = Number.parseInt(properties2?.getAttribute(attribute2) ?? "", 10);
2958
+ const value = Number.parseInt(properties?.getAttribute(attribute2) ?? "", 10);
2833
2959
  if (Number.isFinite(value)) insets[key] = value;
2834
2960
  }
2835
2961
  if (Object.keys(insets).length > 0) result.insetsEmu = insets;
@@ -2879,6 +3005,20 @@ function resolveManualLayoutRect(layout, frame, auto) {
2879
3005
  const height = layout.height === void 0 ? auto.height : layout.heightMode === "edge" ? layout.height * frame.height - y : layout.height * frame.height;
2880
3006
  return { x, y, width: Math.max(width, 1), height: Math.max(height, 1) };
2881
3007
  }
3008
+ function resolveManualPlotRect(layout, frame, auto, bands) {
3009
+ const rect2 = resolveManualLayoutRect(layout, frame, auto);
3010
+ if (!rect2 || layout?.layoutTarget === "inner") return rect2;
3011
+ return {
3012
+ x: rect2.x + bands.left,
3013
+ y: rect2.y + bands.top,
3014
+ width: Math.max(1, rect2.width - bands.left - bands.right),
3015
+ height: Math.max(1, rect2.height - bands.top - bands.bottom)
3016
+ };
3017
+ }
3018
+ function applyLabelManualLayout(layout, frame, point) {
3019
+ const rect2 = resolveManualLayoutRect(layout, frame, { ...point, width: 1, height: 1 });
3020
+ return rect2 ? { x: rect2.x, y: rect2.y } : point;
3021
+ }
2882
3022
 
2883
3023
  // chart/read-formatting.ts
2884
3024
  var c = (parent, name) => first(parent, name, NS.c);
@@ -3137,6 +3277,10 @@ function drawingPatternPictureXml(fill) {
3137
3277
  else if (blip.getAttributeNS(NS.r, attribute2) !== value)
3138
3278
  blip.setAttributeNS(NS.r, `r:${attribute2}`, value);
3139
3279
  }
3280
+ if (fill.crop !== void 0 && JSON.stringify(before?.kind === "picture" ? before.crop : void 0) !== JSON.stringify(fill.crop))
3281
+ applyPictureCrop(root, fill.crop);
3282
+ if (fill.effects !== void 0 && JSON.stringify(before?.kind === "picture" ? before.effects ?? [] : []) !== JSON.stringify(fill.effects ?? []))
3283
+ applyPictureEffects(blip, fill.effects ?? []);
3140
3284
  if (!fill.sourceXml) {
3141
3285
  const stretch = doc.createElementNS(NS.a, "a:stretch");
3142
3286
  stretch.appendChild(doc.createElementNS(NS.a, "a:fillRect"));
@@ -3147,26 +3291,26 @@ function drawingPatternPictureXml(fill) {
3147
3291
  }
3148
3292
 
3149
3293
  // drawingml/write-fill.ts
3150
- function setDrawingFillXml(properties2, xml) {
3151
- const doc = properties2.ownerDocument;
3294
+ function setDrawingFillXml(properties, xml) {
3295
+ const doc = properties.ownerDocument;
3152
3296
  const wrapper = parseXml(`<w xmlns:a="${NS.a}">${xml}</w>`);
3153
3297
  const fill = elements(wrapper.documentElement)[0];
3154
3298
  const names = ["solidFill", "gradFill", "pattFill", "blipFill", "grpFill", "noFill"];
3155
3299
  if (elements(wrapper.documentElement).length !== 1 || !fill || fill.namespaceURI !== NS.a || !names.includes(fill.localName))
3156
3300
  throw new Error("Invalid DrawingML fill XML");
3157
- const existing = elements(properties2).filter(
3301
+ const existing = elements(properties).filter(
3158
3302
  (node) => node.namespaceURI === NS.a && names.includes(node.localName)
3159
3303
  );
3160
3304
  const next = doc.importNode(fill, true);
3161
- if (existing[0]) properties2.replaceChild(next, existing[0]);
3305
+ if (existing[0]) properties.replaceChild(next, existing[0]);
3162
3306
  else
3163
- properties2.insertBefore(
3307
+ properties.insertBefore(
3164
3308
  next,
3165
- elements(properties2).find(
3309
+ elements(properties).find(
3166
3310
  (node) => node.namespaceURI === NS.a && ["ln", "effectLst", "effectDag", "scene3d", "sp3d", "extLst"].includes(node.localName)
3167
3311
  ) ?? null
3168
3312
  );
3169
- for (const extra of existing.slice(1)) properties2.removeChild(extra);
3313
+ for (const extra of existing.slice(1)) properties.removeChild(extra);
3170
3314
  }
3171
3315
  function drawingFillXml(fill) {
3172
3316
  if (fill.kind === "none") return "<a:noFill/>";
@@ -3249,12 +3393,12 @@ function writeChartFillFormatting(root, formatting) {
3249
3393
  for (const [part, node] of Object.entries(chartFormattingNodes(root))) {
3250
3394
  const fill = formatting.entries[part]?.fill;
3251
3395
  if (!node || !fill) continue;
3252
- let properties2 = first(node, "spPr", NS.c);
3253
- if (JSON.stringify(parseDrawingFill(properties2)) === JSON.stringify(fill)) continue;
3396
+ let properties = first(node, "spPr", NS.c);
3397
+ if (JSON.stringify(parseDrawingFill(properties)) === JSON.stringify(fill)) continue;
3254
3398
  const xml = drawingFillXml(fill);
3255
3399
  if (xml === void 0) continue;
3256
- if (!properties2) {
3257
- properties2 = root.ownerDocument.createElementNS(NS.c, "c:spPr");
3400
+ if (!properties) {
3401
+ properties = root.ownerDocument.createElementNS(NS.c, "c:spPr");
3258
3402
  const successors = [
3259
3403
  "txPr",
3260
3404
  "crossAx",
@@ -3273,13 +3417,13 @@ function writeChartFillFormatting(root, formatting) {
3273
3417
  "extLst"
3274
3418
  ];
3275
3419
  node.insertBefore(
3276
- properties2,
3420
+ properties,
3277
3421
  elements(node).find(
3278
3422
  (child3) => child3.namespaceURI === NS.c && successors.includes(child3.localName)
3279
3423
  ) ?? null
3280
3424
  );
3281
3425
  }
3282
- setDrawingFillXml(properties2, xml);
3426
+ setDrawingFillXml(properties, xml);
3283
3427
  changed = true;
3284
3428
  }
3285
3429
  return changed;
@@ -4810,8 +4954,8 @@ function drawingLineXml(line2) {
4810
4954
  }
4811
4955
 
4812
4956
  // chart/write-text-body.ts
4813
- function runProperties(local, properties2) {
4814
- const p = properties2 ?? {};
4957
+ function runProperties(local, properties) {
4958
+ const p = properties ?? {};
4815
4959
  const attributes2 = [
4816
4960
  p.sizePt === void 0 ? "" : ` sz="${Math.round(p.sizePt * 100)}"`,
4817
4961
  p.bold === void 0 ? "" : ` b="${p.bold ? 1 : 0}"`,
@@ -4827,16 +4971,16 @@ function spacing(local, value) {
4827
4971
  return `<a:${local}>${inner}</a:${local}>`;
4828
4972
  }
4829
4973
  function run(value) {
4830
- const { text: text2, ...properties2 } = value;
4831
- const hasProperties = Object.keys(properties2).length > 0;
4974
+ const { text: text2, ...properties } = value;
4975
+ const hasProperties = Object.keys(properties).length > 0;
4832
4976
  if (text2 === "\n")
4833
- return hasProperties ? `<a:br>${runProperties("rPr", properties2)}</a:br>` : "<a:br/>";
4834
- return `<a:r>${hasProperties ? runProperties("rPr", properties2) : ""}<a:t>${escapeText(text2)}</a:t></a:r>`;
4977
+ return hasProperties ? `<a:br>${runProperties("rPr", properties)}</a:br>` : "<a:br/>";
4978
+ return `<a:r>${hasProperties ? runProperties("rPr", properties) : ""}<a:t>${escapeText(text2)}</a:t></a:r>`;
4835
4979
  }
4836
4980
  function paragraph(value) {
4837
4981
  const align = value.align ? ` algn="${escapeAttribute(value.align)}"` : "";
4838
- const properties2 = spacing("lnSpc", value.lineSpacing) + spacing("spcBef", value.spaceBefore) + spacing("spcAft", value.spaceAfter) + runProperties("defRPr", value.defaultProperties);
4839
- return `<a:p><a:pPr${align}>${properties2}</a:pPr>${value.runs.map(run).join("")}</a:p>`;
4982
+ const properties = spacing("lnSpc", value.lineSpacing) + spacing("spcBef", value.spaceBefore) + spacing("spcAft", value.spaceAfter) + runProperties("defRPr", value.defaultProperties);
4983
+ return `<a:p><a:pPr${align}>${properties}</a:pPr>${value.runs.map(run).join("")}</a:p>`;
4840
4984
  }
4841
4985
  function writeTextBody(body) {
4842
4986
  const insets = body.insetsEmu ?? {};
@@ -4981,7 +5125,7 @@ function dataSourceInner(source) {
4981
5125
  case "multiLvlStrRef": {
4982
5126
  const levels = source.levels ? elementXml(
4983
5127
  "multiLvlStrCache",
4984
- valXml("ptCount", source.levelPointCount) + source.levels.map((level2) => elementXml("lvl", cachePoints(level2))).join("")
5128
+ valXml("ptCount", source.levelPointCount) + source.levels.map((level3) => elementXml("lvl", cachePoints(level3))).join("")
4985
5129
  ) : "";
4986
5130
  return `<c:multiLvlStrRef>${formula2}${levels}</c:multiLvlStrRef>`;
4987
5131
  }
@@ -5470,7 +5614,7 @@ function parseDimension(context, element2) {
5470
5614
  return assignDefined(
5471
5615
  {
5472
5616
  kind: element2.localName,
5473
- levels: cxChildren(element2, "lvl").map((level2) => parseLevel(context, level2))
5617
+ levels: cxChildren(element2, "lvl").map((level3) => parseLevel(context, level3))
5474
5618
  },
5475
5619
  {
5476
5620
  type: attribute(element2, "type"),
@@ -5911,13 +6055,13 @@ function numberFormatXml2(format) {
5911
6055
  function dataXml(context, data) {
5912
6056
  const dimensions = data.dimensions.map((dimension2) => {
5913
6057
  const levels = dimension2.levels.map(
5914
- (level2) => cxElement(
6058
+ (level3) => cxElement(
5915
6059
  "lvl",
5916
- level2.points.map((point) => cxText("pt", point.value, attributes([["idx", point.index]]))).join("") + raw(context, level2.extLst),
6060
+ level3.points.map((point) => cxText("pt", point.value, attributes([["idx", point.index]]))).join("") + raw(context, level3.extLst),
5917
6061
  attributes([
5918
- ["ptCount", level2.pointCount],
5919
- ["formatCode", level2.formatCode],
5920
- ["name", level2.name]
6062
+ ["ptCount", level3.pointCount],
6063
+ ["formatCode", level3.formatCode],
6064
+ ["name", level3.name]
5921
6065
  ])
5922
6066
  )
5923
6067
  ).join("");
@@ -6287,6 +6431,7 @@ function firstChartGroup(space) {
6287
6431
  return group2;
6288
6432
  }
6289
6433
  function assignOrDelete(target, key, value) {
6434
+ if (key === "__proto__" || key === "constructor" || key === "prototype") return;
6290
6435
  if (value === void 0) delete target[key];
6291
6436
  else target[key] = value;
6292
6437
  }
@@ -6446,6 +6591,11 @@ function chartExSeriesAt(space, index) {
6446
6591
  if (!series2) throw new RangeError(`No chart series at index ${String(index)}`);
6447
6592
  return series2;
6448
6593
  }
6594
+ function chartExAxisAt(space, index) {
6595
+ const axis = typeof index === "number" && Number.isSafeInteger(index) ? space.plotArea.axes.find((_, position) => position === index) : void 0;
6596
+ if (!axis) throw new RangeError(`No chart axis at index ${String(index)}`);
6597
+ return axis;
6598
+ }
6449
6599
  function setChartExTitle(space, text2) {
6450
6600
  return editChartExSpace(space, (draft) => {
6451
6601
  if (text2 === void 0) {
@@ -6562,15 +6712,15 @@ function chartExValueType(layoutId) {
6562
6712
  return layoutId === "treemap" || layoutId === "sunburst" ? "size" : layoutId === "regionMap" ? "colorVal" : "val";
6563
6713
  }
6564
6714
  function freshLevel(values, previous, numeric) {
6565
- const level2 = {
6715
+ const level3 = {
6566
6716
  pointCount: values.length,
6567
6717
  points: values.flatMap(
6568
6718
  (value, index) => value === null || value === "" ? [] : [{ index, value: String(value) }]
6569
6719
  )
6570
6720
  };
6571
- if (numeric) level2.formatCode = previous?.formatCode ?? "General";
6572
- if (previous?.name !== void 0) level2.name = previous.name;
6573
- return level2;
6721
+ if (numeric) level3.formatCode = previous?.formatCode ?? "General";
6722
+ if (previous?.name !== void 0) level3.name = previous.name;
6723
+ return level3;
6574
6724
  }
6575
6725
  function dataOf(draft, index) {
6576
6726
  const series2 = chartExSeriesAt(draft, index);
@@ -6617,7 +6767,7 @@ function setChartExCategories(space, categories) {
6617
6767
  seen.add(data);
6618
6768
  const dimension2 = dimensionOf(data, "strDim", "cat");
6619
6769
  dimension2.levels = levels.map(
6620
- (level2, position) => freshLevel(level2, dimension2.levels[position], false)
6770
+ (level3, position) => freshLevel(level3, dimension2.levels[position], false)
6621
6771
  );
6622
6772
  });
6623
6773
  });
@@ -6647,14 +6797,14 @@ function addChartExSeries(space, name, templateIndex = 0) {
6647
6797
  delete dimension2.formula;
6648
6798
  delete dimension2.nameFormula;
6649
6799
  if (dimension2.kind === "numDim")
6650
- for (const level2 of dimension2.levels) {
6800
+ for (const level3 of dimension2.levels) {
6651
6801
  const count = Math.max(
6652
- level2.pointCount ?? 0,
6653
- ...level2.points.map((point) => (point.index ?? 0) + 1),
6802
+ level3.pointCount ?? 0,
6803
+ ...level3.points.map((point) => (point.index ?? 0) + 1),
6654
6804
  0
6655
6805
  );
6656
- level2.pointCount = count;
6657
- level2.points = Array.from({ length: count }, (_, index) => ({ index, value: "0" }));
6806
+ level3.pointCount = count;
6807
+ level3.points = Array.from({ length: count }, (_, index) => ({ index, value: "0" }));
6658
6808
  }
6659
6809
  }
6660
6810
  draft.chartData.data.push(copy);
@@ -6731,15 +6881,14 @@ function setChartExLayout(space, layout) {
6731
6881
  });
6732
6882
  }
6733
6883
  function setChartExAxis(space, index, edit) {
6734
- if (!Number.isSafeInteger(index) || !space.plotArea.axes[index])
6735
- throw new RangeError("No chart axis at index.");
6884
+ chartExAxisAt(space, index);
6736
6885
  if (edit.scaling) {
6737
6886
  for (const value of Object.values(edit.scaling))
6738
6887
  if (typeof value === "number" && !Number.isFinite(value))
6739
6888
  throw new RangeError("Axis values must be finite.");
6740
6889
  }
6741
6890
  return editChartExSpace(space, (draft) => {
6742
- Object.assign(draft.plotArea.axes[index], edit);
6891
+ Object.assign(chartExAxisAt(draft, index), edit);
6743
6892
  });
6744
6893
  }
6745
6894
  function setChartExPointLabel(space, seriesIndex, pointIndex, label) {
@@ -6773,14 +6922,14 @@ function chartExSeriesDimension(space, index, numeric) {
6773
6922
  (d) => d.kind === (numeric ? "numDim" : "strDim") && (d.type === type || !numeric && d.type === void 0)
6774
6923
  );
6775
6924
  }
6776
- function chartExLevelValues(level2) {
6925
+ function chartExLevelValues(level3) {
6777
6926
  const count = Math.max(
6778
- level2?.pointCount ?? 0,
6779
- ...(level2?.points ?? []).map((p) => (p.index ?? 0) + 1),
6927
+ level3?.pointCount ?? 0,
6928
+ ...(level3?.points ?? []).map((p) => (p.index ?? 0) + 1),
6780
6929
  0
6781
6930
  );
6782
6931
  const values = Array(count).fill("");
6783
- for (const point of level2?.points ?? [])
6932
+ for (const point of level3?.points ?? [])
6784
6933
  if (point.index !== void 0 && point.index >= 0 && point.index < count)
6785
6934
  values[point.index] = point.value;
6786
6935
  return values;
@@ -6804,9 +6953,9 @@ function chartExSpaceDataSheet(space) {
6804
6953
  }))
6805
6954
  };
6806
6955
  }
6807
- function rewrite(level2, values) {
6808
- level2.pointCount = values.length;
6809
- level2.points = values.flatMap(
6956
+ function rewrite(level3, values) {
6957
+ level3.pointCount = values.length;
6958
+ level3.points = values.flatMap(
6810
6959
  (value, index) => value === null || value === "" ? [] : [{ index, value: String(value) }]
6811
6960
  );
6812
6961
  }
@@ -6842,17 +6991,17 @@ function applyChartExSpaceDataSheetEdits(space, edits) {
6842
6991
  const dimension2 = chartExSeriesDimension(draft, i, numeric);
6843
6992
  if (!dimension2 || seen.has(dimension2)) continue;
6844
6993
  seen.add(dimension2);
6845
- dimension2.levels.forEach((level2, l) => {
6846
- const values = chartExLevelValues(level2);
6994
+ dimension2.levels.forEach((level3, l) => {
6995
+ const values = chartExLevelValues(level3);
6847
6996
  if (edit.kind === "category-label") {
6848
- if (!numeric && l === 0) rewrite(level2, next.categories);
6997
+ if (!numeric && l === 0) rewrite(level3, next.categories);
6849
6998
  } else if (edit.kind === "add-category") {
6850
6999
  values.push(numeric ? "0" : "");
6851
7000
  if (!numeric && l === 0) values[values.length - 1] = next.categories.at(-1);
6852
- rewrite(level2, values);
7001
+ rewrite(level3, values);
6853
7002
  } else if (edit.kind === "remove-category") {
6854
7003
  values.splice(edit.category, 1);
6855
- rewrite(level2, values);
7004
+ rewrite(level3, values);
6856
7005
  }
6857
7006
  });
6858
7007
  }
@@ -7027,8 +7176,8 @@ function dimensionWrites(dimension2, resolve) {
7027
7176
  const count = horizontal ? range2.end.col - range2.start.col + 1 : range2.end.row - range2.start.row + 1;
7028
7177
  if (levelCount !== dimension2.levels.length)
7029
7178
  throw new Error("ChartEx source dimensions do not match cached levels.");
7030
- return dimension2.levels.map((level2, index) => {
7031
- const values = chartExLevelValues(level2);
7179
+ return dimension2.levels.map((level3, index) => {
7180
+ const values = chartExLevelValues(level3);
7032
7181
  if (values.length !== count)
7033
7182
  throw new Error("ChartEx source range does not match cached points.");
7034
7183
  const offset = dimension2.kind === "strDim" ? levelCount - 1 - index : index;
@@ -7075,10 +7224,10 @@ function chartExDataChanged(before, after) {
7075
7224
  kind: dimension2.kind,
7076
7225
  formula: dimension2.formula,
7077
7226
  nameFormula: dimension2.nameFormula,
7078
- levels: dimension2.levels.map((level2) => ({
7079
- pointCount: level2.pointCount,
7080
- points: level2.points,
7081
- name: level2.name
7227
+ levels: dimension2.levels.map((level3) => ({
7228
+ pointCount: level3.pointCount,
7229
+ points: level3.points,
7230
+ name: level3.name
7082
7231
  }))
7083
7232
  }))
7084
7233
  });
@@ -7113,9 +7262,9 @@ function dimensionLevels(dimension2, read) {
7113
7262
  const horizontal = dimension2.formula.direction === "row";
7114
7263
  const count = horizontal ? grid.columns : grid.rows;
7115
7264
  const length = horizontal ? grid.rows : grid.columns;
7116
- const levels = Array.from({ length }, (_, level2) => {
7117
- const offset = dimension2.kind === "strDim" ? length - 1 - level2 : level2;
7118
- const previous = dimension2.levels[level2];
7265
+ const levels = Array.from({ length }, (_, level3) => {
7266
+ const offset = dimension2.kind === "strDim" ? length - 1 - level3 : level3;
7267
+ const previous = dimension2.levels[level3];
7119
7268
  const points2 = Array.from({ length: count }, (_2, index) => {
7120
7269
  const value = grid.values[horizontal ? offset * grid.columns + index : index * grid.columns + offset];
7121
7270
  return value === null || value === void 0 || value === "" ? [] : [{ index, value: String(value) }];
@@ -7155,8 +7304,8 @@ function chartExDataLayout(space, sheetName) {
7155
7304
  const start = columns.length;
7156
7305
  const ordered = dimension2.kind === "strDim" ? [...dimension2.levels].reverse() : dimension2.levels;
7157
7306
  let count2 = 0;
7158
- for (const level2 of ordered) {
7159
- const values = chartExLevelValues(level2);
7307
+ for (const level3 of ordered) {
7308
+ const values = chartExLevelValues(level3);
7160
7309
  count2 = Math.max(count2, values.length);
7161
7310
  const data2 = values.map((value) => {
7162
7311
  if (dimension2.kind !== "numDim") return value;
@@ -7165,7 +7314,7 @@ function chartExDataLayout(space, sheetName) {
7165
7314
  if (!Number.isFinite(n2)) throw new Error("Numeric chart data is invalid.");
7166
7315
  return n2;
7167
7316
  });
7168
- columns.push([level2.name ?? `Data ${columns.length + 1}`, ...data2]);
7317
+ columns.push([level3.name ?? `Data ${columns.length + 1}`, ...data2]);
7169
7318
  }
7170
7319
  if (!count2) throw new Error("ChartEx source has no data points.");
7171
7320
  const first2 = ref(start, count2).split(":")[0];
@@ -7205,18 +7354,18 @@ function cell(col, row, value) {
7205
7354
  return `<c r="${ref}" t="inlineStr"><is><t xml:space="preserve">${escape(value)}</t></is></c>`;
7206
7355
  }
7207
7356
  function chartDataWorksheetXml(sheet) {
7208
- const rows = [];
7357
+ const rows2 = [];
7209
7358
  const header = sheet.series.map((series2, index) => cell(index + 1, 0, series2.name)).join("");
7210
- rows.push(`<row r="1">${header}</row>`);
7359
+ rows2.push(`<row r="1">${header}</row>`);
7211
7360
  sheet.categories.forEach((label, category) => {
7212
7361
  const values = sheet.series.map((series2, index) => cell(index + 1, category + 1, series2.values[category] ?? null)).join("");
7213
- rows.push(`<row r="${category + 2}">${cell(0, category + 1, label)}${values}</row>`);
7362
+ rows2.push(`<row r="${category + 2}">${cell(0, category + 1, label)}${values}</row>`);
7214
7363
  });
7215
7364
  const last = formatCellAddress({
7216
7365
  col: Math.max(1, sheet.series.length),
7217
7366
  row: Math.max(1, sheet.categories.length)
7218
7367
  });
7219
- return `${DECLARATION4}<worksheet xmlns="${MAIN}" xmlns:r="${REL}"><dimension ref="A1:${last}"/><sheetData>${rows.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`;
7368
+ return `${DECLARATION4}<worksheet xmlns="${MAIN}" xmlns:r="${REL}"><dimension ref="A1:${last}"/><sheetData>${rows2.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`;
7220
7369
  }
7221
7370
  var STYLES = `${DECLARATION4}<styleSheet xmlns="${MAIN}"><fonts count="1"><font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`;
7222
7371
  async function createChartWorkbook(sheet, sheetName = DEFAULT_CHART_SHEET_NAME) {
@@ -7241,10 +7390,10 @@ async function createChartWorkbook(sheet, sheetName = DEFAULT_CHART_SHEET_NAME)
7241
7390
  zip.file("xl/styles.xml", STYLES);
7242
7391
  return zip.generateAsync({ type: "uint8array", compression: "DEFLATE" });
7243
7392
  }
7244
- function chartWorkbookRowsXml(rows) {
7245
- const count = Math.max(1, ...rows.map((row) => row.length));
7246
- const body = rows.map((row, r) => `<row r="${r + 1}">${row.map((value, c2) => cell(c2, r, value)).join("")}</row>`).join("");
7247
- const last = formatCellAddress({ col: count - 1, row: Math.max(0, rows.length - 1) });
7393
+ function chartWorkbookRowsXml(rows2) {
7394
+ const count = Math.max(1, ...rows2.map((row) => row.length));
7395
+ const body = rows2.map((row, r) => `<row r="${r + 1}">${row.map((value, c2) => cell(c2, r, value)).join("")}</row>`).join("");
7396
+ const last = formatCellAddress({ col: count - 1, row: Math.max(0, rows2.length - 1) });
7248
7397
  return `${DECLARATION4}<worksheet xmlns="${MAIN}" xmlns:r="${REL}"><dimension ref="A1:${last}"/><sheetData>${body}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`;
7249
7398
  }
7250
7399
  var DEFAULT_ZIP_LIMITS = {
@@ -7524,12 +7673,12 @@ function ensureCell(sheetData, ref) {
7524
7673
  const address = parseCellAddress(ref);
7525
7674
  if (!address) return void 0;
7526
7675
  const rowNumber = address.row + 1;
7527
- const rows = childrenNamed(sheetData, "row");
7528
- let row = rows.find((candidate) => Number(candidate.getAttribute("r")) === rowNumber);
7676
+ const rows2 = childrenNamed(sheetData, "row");
7677
+ let row = rows2.find((candidate) => Number(candidate.getAttribute("r")) === rowNumber);
7529
7678
  if (!row) {
7530
7679
  row = create(sheetData, "row");
7531
7680
  row.setAttribute("r", String(rowNumber));
7532
- const after = rows.find((candidate) => Number(candidate.getAttribute("r")) > rowNumber);
7681
+ const after = rows2.find((candidate) => Number(candidate.getAttribute("r")) > rowNumber);
7533
7682
  sheetData.insertBefore(row, after ?? null);
7534
7683
  }
7535
7684
  const cells = childrenNamed(row, "c");
@@ -7633,12 +7782,12 @@ function syncTable(table, doc, writes, shared) {
7633
7782
  const cols = new Set(
7634
7783
  cells.filter((cell2) => cell2.row >= box.start.row && cell2.row <= box.end.row + 1).map((cell2) => cell2.col)
7635
7784
  );
7636
- const rows = new Set(
7785
+ const rows2 = new Set(
7637
7786
  cells.filter((cell2) => cell2.col >= box.start.col && cell2.col <= box.end.col + 1).map((cell2) => cell2.row)
7638
7787
  );
7639
7788
  const next = {
7640
7789
  start: box.start,
7641
- end: { col: grown(box.end.col, cols), row: grown(box.end.row, rows) }
7790
+ end: { col: grown(box.end.col, cols), row: grown(box.end.row, rows2) }
7642
7791
  };
7643
7792
  let changed = false;
7644
7793
  const list = childrenNamed(columns, "tableColumn");
@@ -7911,10 +8060,10 @@ async function appendChartWorkbookSheet(bytes, rowsForName, options2 = {}) {
7911
8060
  break;
7912
8061
  }
7913
8062
  }
7914
- const rows = rowsForName(sheetName);
7915
- if (rows.length > 1048576 || rows.some((row) => row.length > 16384))
8063
+ const rows2 = rowsForName(sheetName);
8064
+ if (rows2.length > 1048576 || rows2.some((row) => row.length > 16384))
7916
8065
  throw new RangeError("Chart data exceeds worksheet bounds.");
7917
- for (const row of rows)
8066
+ for (const row of rows2)
7918
8067
  for (const value of row)
7919
8068
  if (typeof value === "number" && !Number.isFinite(value))
7920
8069
  throw new RangeError("Chart workbook numbers must be finite.");
@@ -7970,7 +8119,7 @@ async function appendChartWorkbookSheet(bytes, rowsForName, options2 = {}) {
7970
8119
  zip.file("xl/workbook.xml", DECLARATION5 + buildXml(workbook), { createFolders: false });
7971
8120
  zip.file("xl/_rels/workbook.xml.rels", DECLARATION5 + buildXml(rels), { createFolders: false });
7972
8121
  zip.file("[Content_Types].xml", DECLARATION5 + buildXml(types), { createFolders: false });
7973
- zip.file(part, chartWorkbookRowsXml(rows), { createFolders: false });
8122
+ zip.file(part, chartWorkbookRowsXml(rows2), { createFolders: false });
7974
8123
  return {
7975
8124
  bytes: await zip.generateAsync({ type: "uint8array", compression: "DEFLATE" }),
7976
8125
  sheetName
@@ -8275,6 +8424,9 @@ function summaryAnalysis(series2) {
8275
8424
  // chart/render/summary-labels.ts
8276
8425
  function level(options2, custom) {
8277
8426
  const out = {};
8427
+ if (options2.layout) out.layout = options2.layout;
8428
+ if (options2.showLeaderLines !== void 0) out.showLeaderLines = options2.showLeaderLines;
8429
+ if (options2.leaderLines?.spPr?.line) out.leaderLine = options2.leaderLines.spPr.line;
8278
8430
  if (options2.deleted !== void 0) out.deleted = options2.deleted;
8279
8431
  if (options2.showValue !== void 0) out.showValue = options2.showValue;
8280
8432
  if (options2.showCategoryName !== void 0) out.showCategory = options2.showCategoryName;
@@ -8324,7 +8476,7 @@ var GROUP_TYPES = {
8324
8476
  surface: "surface"
8325
8477
  };
8326
8478
  var GROUPINGS = /* @__PURE__ */ new Set(["clustered", "stacked", "percentStacked", "standard"]);
8327
- function chartSummarySeries(source, chartType, groupLabels) {
8479
+ function chartSummarySeries(source, chartType, groupLabels, groupSmooth) {
8328
8480
  const categories = source.categories ?? source.xValues;
8329
8481
  const values = source.values ?? source.yValues;
8330
8482
  const numeric = (v) => typeof v === "number" ? v : v === "" ? null : Number.isFinite(Number(v)) ? Number(v) : null;
@@ -8332,6 +8484,9 @@ function chartSummarySeries(source, chartType, groupLabels) {
8332
8484
  categories: chartSourceValues(categories),
8333
8485
  values: chartSourceValues(values).map(numeric)
8334
8486
  };
8487
+ const smooth = source.smooth ?? groupSmooth;
8488
+ if (smooth !== void 0) out.smooth = smooth;
8489
+ if (source.spPr?.line) out.line = source.spPr.line;
8335
8490
  if (values?.cache?.formatCode !== void 0) out.numberFormat = values.cache.formatCode;
8336
8491
  if (source.bubbleSizes) {
8337
8492
  out.bubbleSizes = chartSourceValues(source.bubbleSizes).map(numeric);
@@ -8352,12 +8507,12 @@ function chartSummarySeries(source, chartType, groupLabels) {
8352
8507
  const points2 = {};
8353
8508
  const pointFills = {};
8354
8509
  for (const point of source.dataPoints) {
8355
- const properties2 = point.spPr ?? point.marker?.spPr;
8510
+ const properties = point.spPr ?? point.marker?.spPr;
8356
8511
  if (point.index === void 0) continue;
8357
- const pointColor = solidColor(properties2?.fill);
8512
+ const pointColor = solidColor(properties?.fill);
8358
8513
  if (pointColor) points2[point.index] = pointColor;
8359
- if (properties2?.fill && properties2.fill.kind !== "solid")
8360
- pointFills[point.index] = properties2.fill;
8514
+ if (properties?.fill && properties.fill.kind !== "solid")
8515
+ pointFills[point.index] = properties.fill;
8361
8516
  }
8362
8517
  if (Object.keys(points2).length) out.pointColors = points2;
8363
8518
  if (Object.keys(pointFills).length) out.pointFills = pointFills;
@@ -8391,7 +8546,12 @@ function extraGroups(chartSpace, firstType) {
8391
8546
  const entry3 = {
8392
8547
  chartType: type,
8393
8548
  series: group2.series.map((source, index) => ({
8394
- ...chartSummarySeries(source, type, group2.dataLabels),
8549
+ ...chartSummarySeries(
8550
+ source,
8551
+ type,
8552
+ group2.dataLabels,
8553
+ group2.smooth ?? (group2.scatterStyle ? ["smooth", "smoothMarker"].includes(group2.scatterStyle) : void 0)
8554
+ ),
8395
8555
  ...summaryMarkers(source, group2, index)
8396
8556
  })),
8397
8557
  secondary: valueAxisId(chartSpace, group2.axisIds) !== primary
@@ -8412,8 +8572,14 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
8412
8572
  let chartType = group2 ? GROUP_TYPES[group2.kind] : "column";
8413
8573
  if (chartType === "bar" && group2?.barDirection !== "bar") chartType = "column";
8414
8574
  const series2 = (group2?.series ?? []).map((source, index) => ({
8415
- ...chartSummarySeries(source, chartType, group2?.dataLabels),
8416
- ...group2 ? summaryMarkers(source, group2, index) : {}
8575
+ ...chartSummarySeries(
8576
+ source,
8577
+ chartType,
8578
+ group2?.dataLabels,
8579
+ group2?.smooth ?? (group2?.scatterStyle ? ["smooth", "smoothMarker"].includes(group2.scatterStyle) : void 0)
8580
+ ),
8581
+ ...group2 ? summaryMarkers(source, group2, index) : {},
8582
+ ...group2?.kind === "scatter" ? { showLine: !["marker", "none"].includes(group2.scatterStyle ?? "marker") } : {}
8417
8583
  }));
8418
8584
  const summary = {
8419
8585
  chartType,
@@ -8422,6 +8588,9 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
8422
8588
  axes: chartSpace.plotArea.axes,
8423
8589
  axisIds: group2?.axisIds ?? []
8424
8590
  };
8591
+ if (chartSpace.plotArea.dataTable) summary.dataTable = chartSpace.plotArea.dataTable;
8592
+ if (chartSpace.date1904 !== void 0) summary.date1904 = chartSpace.date1904;
8593
+ if (chartSpace.plotArea.layout) summary.plotLayout = chartSpace.plotArea.layout;
8425
8594
  const combined = extraGroups(chartSpace, chartType);
8426
8595
  if (combined.length) summary.extraGroups = combined;
8427
8596
  if (chartType === "stock" && group2) summary.stock = stockStyle(group2);
@@ -8460,6 +8629,41 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
8460
8629
  return summary;
8461
8630
  }
8462
8631
 
8632
+ // chart/render/summary-ex-series.ts
8633
+ var level2 = (source) => ({
8634
+ ...source.visibility?.value === void 0 ? {} : { showValue: source.visibility.value },
8635
+ ...source.visibility?.categoryName === void 0 ? {} : { showCategory: source.visibility.categoryName },
8636
+ ...source.visibility?.seriesName === void 0 ? {} : { showSeriesName: source.visibility.seriesName },
8637
+ ...source.position ? { position: source.position } : {},
8638
+ ...source.numberFormat?.formatCode ? { numberFormat: source.numberFormat.formatCode } : {},
8639
+ ...source.separator === void 0 ? {} : { separator: source.separator }
8640
+ });
8641
+ function chartExSeriesPaint(source, series2, defaultValues = false) {
8642
+ const fill = source.spPr?.fill;
8643
+ if (fill) series2.fill = fill;
8644
+ const points2 = {};
8645
+ const fills = {};
8646
+ for (const point of source.dataPoints) {
8647
+ if (point.index === void 0) continue;
8648
+ const fill2 = point.spPr?.fill;
8649
+ if (fill2?.kind === "solid") points2[point.index] = fill2.color;
8650
+ else if (fill2) fills[point.index] = fill2;
8651
+ }
8652
+ if (Object.keys(points2).length) series2.pointColors = points2;
8653
+ if (Object.keys(fills).length) series2.pointFills = fills;
8654
+ const labels2 = source.dataLabels;
8655
+ if (!labels2 && !defaultValues) return;
8656
+ const overrides = {};
8657
+ for (const label of labels2?.labels ?? [])
8658
+ if (label.index !== void 0) overrides[label.index] = level2(label);
8659
+ for (const index of labels2?.hidden ?? [])
8660
+ overrides[index] = { ...overrides[index], deleted: true };
8661
+ series2.dataLabels = {
8662
+ series: { showValue: defaultValues, ...labels2 ? level2(labels2) : {} },
8663
+ points: overrides
8664
+ };
8665
+ }
8666
+
8463
8667
  // chart/render/summary-from-chartex.ts
8464
8668
  function seriesData(space, series2) {
8465
8669
  if (series2.data) return series2.data;
@@ -8467,17 +8671,17 @@ function seriesData(space, series2) {
8467
8671
  return series2.dataId === void 0 ? shared[0] : shared.find((data) => data.id === series2.dataId);
8468
8672
  }
8469
8673
  var findDimension = (data, kind, type) => data?.dimensions.find((d) => d.kind === kind && (d.type ?? "") === type);
8470
- function levelPoints(level2) {
8674
+ function levelPoints(level3) {
8471
8675
  const points2 = [];
8472
- for (const point of level2.points) points2[point.index ?? points2.length] = point.value.trim();
8473
- for (let i = 0; i < Math.max(level2.pointCount ?? 0, points2.length); i++) points2[i] ??= "";
8676
+ for (const point of level3.points) points2[point.index ?? points2.length] = point.value.trim();
8677
+ for (let i = 0; i < Math.max(level3.pointCount ?? 0, points2.length); i++) points2[i] ??= "";
8474
8678
  return points2;
8475
8679
  }
8476
8680
  function dimension(data, kind, type) {
8477
8681
  const element2 = findDimension(data, kind, type);
8478
8682
  if (!element2) return void 0;
8479
- const level2 = element2.levels[0];
8480
- const out = { points: level2 ? levelPoints(level2) : [] };
8683
+ const level3 = element2.levels[0];
8684
+ const out = { points: level3 ? levelPoints(level3) : [] };
8481
8685
  const formula2 = element2.formula?.formula.trim();
8482
8686
  if (formula2) out.formula = formula2;
8483
8687
  return out;
@@ -8541,13 +8745,8 @@ function chartExFormatting() {
8541
8745
  }
8542
8746
  };
8543
8747
  }
8544
- function chartExSummaryFromModel(space) {
8545
- const all = space.plotArea.series;
8546
- const primary = all.find((s) => s.layoutId !== "paretoLine") ?? all[0];
8547
- const layoutId = primary?.layoutId ?? "";
8548
- const chartType = layoutId === "waterfall" ? "waterfall" : layoutId === "clusteredColumn" ? "histogram" : layoutId === "treemap" || layoutId === "sunburst" ? layoutId : void 0;
8549
- if (!primary || !chartType) return { layoutId };
8550
- const data = seriesData(space, primary);
8748
+ function summarySeries(space, source, chartType) {
8749
+ const data = seriesData(space, source);
8551
8750
  const categories = dimension(data, "strDim", "cat");
8552
8751
  const values = dimension(
8553
8752
  data,
@@ -8559,17 +8758,63 @@ function chartExSummaryFromModel(space) {
8559
8758
  values: (values?.points ?? []).map(
8560
8759
  (p) => p !== "" && Number.isFinite(Number(p)) ? Number(p) : null
8561
8760
  ),
8562
- ...seriesFill(primary)
8761
+ ...seriesFill(source)
8563
8762
  };
8564
- const name = primary.tx?.value?.trim();
8763
+ if (chartType === "funnel" || chartType === "boxWhisker") {
8764
+ chartExSeriesPaint(source, series2, chartType === "funnel" && source.dataLabels !== void 0);
8765
+ if (source.hidden !== void 0) series2.hidden = source.hidden;
8766
+ }
8767
+ if (chartType === "boxWhisker") series2.boxWhisker = source.layoutProperties ?? {};
8768
+ const name = source.tx?.value?.trim();
8565
8769
  if (name) series2.name = name;
8566
- const nameRef = primary.tx?.formula?.formula.trim();
8770
+ const nameRef = source.tx?.formula?.formula.trim();
8567
8771
  if (nameRef) series2.nameRef = nameRef;
8568
8772
  if (categories?.formula) series2.categoriesRef = categories.formula;
8569
8773
  if (values?.formula) series2.valuesRef = values.formula;
8774
+ return series2;
8775
+ }
8776
+ function chartExSummaryFromModel(space) {
8777
+ const all = space.plotArea.series;
8778
+ const primary = all.find((s) => s.layoutId !== "paretoLine") ?? all[0];
8779
+ const layoutId = primary?.layoutId ?? "";
8780
+ const chartType = layoutId === "waterfall" ? "waterfall" : layoutId === "clusteredColumn" ? "histogram" : layoutId === "treemap" || layoutId === "sunburst" || layoutId === "funnel" || layoutId === "boxWhisker" ? layoutId : void 0;
8781
+ if (!primary || !chartType) return { layoutId };
8782
+ const series2 = summarySeries(space, primary, chartType);
8570
8783
  const layout = primary.layoutProperties;
8571
8784
  const legend = space.legend;
8572
- const summary = { chartType, series: [series2], showLegend: legend !== void 0 };
8785
+ const summary = {
8786
+ chartType,
8787
+ series: chartType === "boxWhisker" ? all.filter((s) => s.layoutId === "boxWhisker").map((source) => summarySeries(space, source, chartType)) : [series2],
8788
+ showLegend: legend !== void 0
8789
+ };
8790
+ if (chartType === "boxWhisker") {
8791
+ summary.axes = space.plotArea.axes.flatMap((axis) => {
8792
+ const scaling = axis.scaling;
8793
+ if (!scaling) return [];
8794
+ const value = scaling.kind === "val";
8795
+ return [
8796
+ {
8797
+ kind: value ? "val" : "cat",
8798
+ ...axis.id === void 0 ? {} : { id: axis.id },
8799
+ position: value ? "l" : "b",
8800
+ deleted: axis.hidden ?? false,
8801
+ scaling: {
8802
+ ...value && typeof scaling.min === "number" ? { min: scaling.min } : {},
8803
+ ...value && typeof scaling.max === "number" ? { max: scaling.max } : {}
8804
+ },
8805
+ majorGridlines: !!axis.majorGridlines,
8806
+ minorGridlines: !!axis.minorGridlines,
8807
+ ...axis.majorGridlines?.spPr ? { majorGridlinesSpPr: axis.majorGridlines.spPr } : {},
8808
+ ...axis.minorGridlines?.spPr ? { minorGridlinesSpPr: axis.minorGridlines.spPr } : {},
8809
+ ...value && typeof scaling.majorUnit === "number" ? { majorUnit: scaling.majorUnit } : {},
8810
+ ...value && typeof scaling.minorUnit === "number" ? { minorUnit: scaling.minorUnit } : {},
8811
+ ...axis.spPr ? { spPr: axis.spPr } : {},
8812
+ ...axis.numberFormat ? { numberFormat: axis.numberFormat } : {},
8813
+ ...axis.tickLabels ? {} : { tickLabelPosition: "none" }
8814
+ }
8815
+ ];
8816
+ });
8817
+ }
8573
8818
  summary.formatting = chartExFormatting();
8574
8819
  const title = titleOf(space);
8575
8820
  if (title) summary.title = title;
@@ -8584,11 +8829,11 @@ function chartExSummaryFromModel(space) {
8584
8829
  } else if (chartType === "treemap" || chartType === "sunburst") {
8585
8830
  const parentLayout = layout?.parentLabelLayout;
8586
8831
  summary.hierarchy = {
8587
- levels: categoryLevels(data),
8832
+ levels: categoryLevels(seriesData(space, primary)),
8588
8833
  dataLabels: primary.dataLabels !== void 0,
8589
8834
  ...parentLayout === "none" || parentLayout === "banner" || parentLayout === "overlapping" ? { parentLabelLayout: parentLayout } : {}
8590
8835
  };
8591
- } else summary.histogram = histogramOptions(primary);
8836
+ } else if (chartType === "histogram") summary.histogram = histogramOptions(primary);
8592
8837
  return { layoutId, summary };
8593
8838
  }
8594
8839
 
@@ -8749,45 +8994,15 @@ function themeSlotHex(color2) {
8749
8994
  return value ? value.toUpperCase() : void 0;
8750
8995
  }
8751
8996
 
8752
- // chart/render/chart-svg-util.ts
8753
- var TEXT_COLOR = "#595959";
8754
- var GRID_COLOR = "#D9D9D9";
8755
- var AXIS_COLOR = "#BFBFBF";
8756
- var FONT_SIZE = 10;
8757
- function esc(text2) {
8758
- return text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
8759
- }
8760
- var n = (value) => String(Math.round(value * 100) / 100);
8761
- var textWidth = (text2, size = FONT_SIZE) => text2.length * size * 0.55;
8762
- function text(x, y, content, attrs = {}) {
8763
- const parts = [`x="${n(x)}"`, `y="${n(y)}"`];
8764
- parts.push(`font-size="${attrs.size ?? FONT_SIZE}"`);
8765
- parts.push(`fill="${esc(attrs.fill ?? TEXT_COLOR)}"`);
8766
- if (attrs.anchor && attrs.anchor !== "start") parts.push(`text-anchor="${attrs.anchor}"`);
8767
- if (attrs.weight) parts.push(`font-weight="${attrs.weight}"`);
8768
- if (attrs.baseline) parts.push(`dominant-baseline="${attrs.baseline}"`);
8769
- if (attrs.family) parts.push(`font-family="${esc(attrs.family)}"`);
8770
- if (attrs.filter) parts.push(`filter="${esc(attrs.filter)}"`);
8771
- if (attrs.italic !== void 0) parts.push(`font-style="${attrs.italic ? "italic" : "normal"}"`);
8772
- if (attrs.underline !== void 0)
8773
- parts.push(`text-decoration="${attrs.underline ? "underline" : "none"}"`);
8774
- return `<text ${parts.join(" ")}>${esc(content)}</text>`;
8775
- }
8776
- var line = (x1, y1, x2, y2, stroke, width = 1) => `<line x1="${n(x1)}" y1="${n(y1)}" x2="${n(x2)}" y2="${n(y2)}" stroke="${stroke}" stroke-width="${width}"/>`;
8777
- var rect = (x, y, w, h, fill, filter) => `<rect x="${n(x)}" y="${n(y)}" width="${n(Math.max(0, w))}" height="${n(Math.max(0, h))}" fill="${fill}"${filter ? ` filter="${esc(filter)}"` : ""}/>`;
8778
- function fit(content, maxWidth, size = FONT_SIZE) {
8779
- if (textWidth(content, size) <= maxWidth) return content;
8780
- const chars = Math.max(1, Math.floor(maxWidth / (size * 0.55)) - 1);
8781
- return `${content.slice(0, chars)}\u2026`;
8782
- }
8783
-
8784
- // chart/render/chart-spacing.ts
8785
- function chartBarSpacing(chart) {
8786
- const stacked = chart.grouping === "stacked" || chart.grouping === "percentStacked";
8787
- return {
8788
- barGapWidth: chart.barGapWidth ?? DEFAULT_BAR_GAP_WIDTH,
8789
- barOverlap: chart.barOverlap ?? (stacked ? 100 : 0)
8790
- };
8997
+ // chart/funnel-geometry.ts
8998
+ function computeFunnelGeometry(values, plot) {
8999
+ const max = Math.max(...values.map((v) => Math.abs(v)), 1);
9000
+ const height = plot.height / Math.max(1, values.length);
9001
+ const center = plot.x + plot.width / 2;
9002
+ return values.map((value, index) => {
9003
+ const width = Math.abs(value) / max * plot.width;
9004
+ return { index, x: center - width / 2, y: plot.y + index * height, width, height, center };
9005
+ });
8791
9006
  }
8792
9007
 
8793
9008
  // drawingml/drawing-color-css.ts
@@ -8992,6 +9207,38 @@ function chartAppearance(chart, theme) {
8992
9207
  return out;
8993
9208
  }
8994
9209
 
9210
+ // chart/render/chart-svg-util.ts
9211
+ var TEXT_COLOR = "#595959";
9212
+ var GRID_COLOR = "#D9D9D9";
9213
+ var AXIS_COLOR = "#BFBFBF";
9214
+ var FONT_SIZE = 10;
9215
+ function esc(text2) {
9216
+ return text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
9217
+ }
9218
+ var n = (value) => String(Math.round(value * 100) / 100);
9219
+ var textWidth = (text2, size = FONT_SIZE) => text2.length * size * 0.55;
9220
+ function text(x, y, content, attrs = {}) {
9221
+ const parts = [`x="${n(x)}"`, `y="${n(y)}"`];
9222
+ parts.push(`font-size="${attrs.size ?? FONT_SIZE}"`);
9223
+ parts.push(`fill="${esc(attrs.fill ?? TEXT_COLOR)}"`);
9224
+ if (attrs.anchor && attrs.anchor !== "start") parts.push(`text-anchor="${attrs.anchor}"`);
9225
+ if (attrs.weight) parts.push(`font-weight="${attrs.weight}"`);
9226
+ if (attrs.baseline) parts.push(`dominant-baseline="${attrs.baseline}"`);
9227
+ if (attrs.family) parts.push(`font-family="${esc(attrs.family)}"`);
9228
+ if (attrs.filter) parts.push(`filter="${esc(attrs.filter)}"`);
9229
+ if (attrs.italic !== void 0) parts.push(`font-style="${attrs.italic ? "italic" : "normal"}"`);
9230
+ if (attrs.underline !== void 0)
9231
+ parts.push(`text-decoration="${attrs.underline ? "underline" : "none"}"`);
9232
+ return `<text ${parts.join(" ")}>${esc(content)}</text>`;
9233
+ }
9234
+ var line = (x1, y1, x2, y2, stroke, width = 1) => `<line x1="${n(x1)}" y1="${n(y1)}" x2="${n(x2)}" y2="${n(y2)}" stroke="${stroke}" stroke-width="${width}"/>`;
9235
+ var rect = (x, y, w, h, fill, filter) => `<rect x="${n(x)}" y="${n(y)}" width="${n(Math.max(0, w))}" height="${n(Math.max(0, h))}" fill="${fill}"${filter ? ` filter="${esc(filter)}"` : ""}/>`;
9236
+ function fit(content, maxWidth, size = FONT_SIZE) {
9237
+ if (textWidth(content, size) <= maxWidth) return content;
9238
+ const chars = Math.max(1, Math.floor(maxWidth / (size * 0.55)) - 1);
9239
+ return `${content.slice(0, chars)}\u2026`;
9240
+ }
9241
+
8995
9242
  // text/css-font-family.ts
8996
9243
  var FALLBACKS = {
8997
9244
  calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
@@ -9017,9 +9264,9 @@ function chartGradientPaint(model, width = 1024, height = 768) {
9017
9264
  const defs = [];
9018
9265
  const shadowPaint = (shadow, suffix) => {
9019
9266
  const id = `${prefix}-${suffix}`;
9020
- const pad = Math.max(4, shadow.blur * 3 + Math.abs(shadow.dx) + Math.abs(shadow.dy));
9267
+ const pad2 = Math.max(4, shadow.blur * 3 + Math.abs(shadow.dx) + Math.abs(shadow.dy));
9021
9268
  defs.push(
9022
- `<filter id="${id}" filterUnits="userSpaceOnUse" x="${n(-pad)}" y="${n(-pad)}" width="${n(width + pad * 2)}" height="${n(height + pad * 2)}" color-interpolation-filters="sRGB">${svgDropShadowElement(shadow, { number: n, color: (value) => esc(value) })}</filter>`
9269
+ `<filter id="${id}" filterUnits="userSpaceOnUse" x="${n(-pad2)}" y="${n(-pad2)}" width="${n(width + pad2 * 2)}" height="${n(height + pad2 * 2)}" color-interpolation-filters="sRGB">${svgDropShadowElement(shadow, { number: n, color: (value) => esc(value) })}</filter>`
9023
9270
  );
9024
9271
  return `url(#${id})`;
9025
9272
  };
@@ -9097,6 +9344,155 @@ function chartAreaRect(model, part, area) {
9097
9344
  return `${defs}<rect x="${n(area.x)}" y="${n(area.y)}" width="${n(area.w)}" height="${n(area.h)}" fill="${esc(fill)}" stroke="${esc(stroke)}" stroke-width="${n(width)}" data-chart-part="${part}"/>`;
9098
9345
  }
9099
9346
 
9347
+ // chart/render/chart-svg-funnel.ts
9348
+ function funnelSvg(model, area) {
9349
+ const series2 = model.series[0];
9350
+ if (!series2 || series2.hidden) return "";
9351
+ const attrs = chartTextAttributes(model, "categoryAxis", 10);
9352
+ const width = Math.min(
9353
+ area.w * 0.3,
9354
+ Math.max(32, ...model.categories.map((s) => s.length * (attrs.size ?? 10) * 0.55 + 8))
9355
+ );
9356
+ const plot = { x: area.x + width, y: area.y, width: Math.max(1, area.w - width), height: area.h };
9357
+ const out = [
9358
+ chartAreaRect(model, "plotArea", { x: plot.x, y: plot.y, w: plot.width, h: plot.height })
9359
+ ];
9360
+ for (const bar of computeFunnelGeometry(
9361
+ series2.values.map((v) => v ?? 0),
9362
+ plot
9363
+ )) {
9364
+ const value = series2.values[bar.index];
9365
+ if (value === null || value === void 0) continue;
9366
+ out.push(`<g data-chart-series="${series2.sourceIndex ?? 0}" data-chart-point="${bar.index}">`);
9367
+ out.push(
9368
+ rect(bar.x, bar.y, bar.width, bar.height, series2.pointColors?.[bar.index] ?? series2.color)
9369
+ );
9370
+ const size = Math.min(10, bar.height * 0.4);
9371
+ const label = series2.labels?.[bar.index];
9372
+ if (label)
9373
+ out.push(
9374
+ text(bar.center, bar.y + bar.height / 2 + size * 0.35, label.text, {
9375
+ ...chartTextAttributes(model, "dataLabel", size),
9376
+ size,
9377
+ anchor: "middle"
9378
+ })
9379
+ );
9380
+ out.push(
9381
+ text(
9382
+ plot.x - 8,
9383
+ bar.y + bar.height / 2 + (attrs.size ?? 10) * 0.35,
9384
+ fit(model.categories[bar.index] ?? "", width - 8, attrs.size ?? 10),
9385
+ { ...attrs, anchor: "end" }
9386
+ )
9387
+ );
9388
+ out.push("</g>");
9389
+ }
9390
+ return out.join("");
9391
+ }
9392
+
9393
+ // chart/box-distribution.ts
9394
+ function boxWhiskerDistribution(values, method = "exclusive", trimOutliers = false) {
9395
+ const stats = computeBoxStats(values, method);
9396
+ if (!stats) return void 0;
9397
+ const iqr = stats.q3 - stats.q1;
9398
+ const lowerFence = stats.q1 - 1.5 * iqr;
9399
+ const upperFence = stats.q3 + 1.5 * iqr;
9400
+ const inliers = values.filter((v) => !trimOutliers || v >= lowerFence && v <= upperFence);
9401
+ return {
9402
+ stats,
9403
+ whiskerMin: inliers.length ? Math.min(...inliers) : stats.min,
9404
+ whiskerMax: inliers.length ? Math.max(...inliers) : stats.max,
9405
+ mean: values.reduce((a2, b) => a2 + b, 0) / values.length
9406
+ };
9407
+ }
9408
+ function boxMeanMarkerPath(x, y, radius = 3) {
9409
+ return `M${x - radius},${y - radius} L${x + radius},${y + radius} M${x - radius},${y + radius} L${x + radius},${y - radius}`;
9410
+ }
9411
+
9412
+ // chart/render/chart-svg-box.ts
9413
+ function boxWhiskerSvg(model, frame, out) {
9414
+ const visible = model.series.filter((s) => !s.hidden);
9415
+ const slot = frame.bandSize / Math.max(1, visible.length);
9416
+ const width = slot * 0.7;
9417
+ visible.forEach((series2, si) => {
9418
+ if (series2.hidden) return;
9419
+ const groups = groupRowsByCategory(series2.boxCategories ?? []);
9420
+ model.categories.forEach((category, ci) => {
9421
+ const observations = (groups.rowIndexesByCategory.get(category) ?? []).flatMap((row) => {
9422
+ const value = series2.values[row];
9423
+ return value === null || value === void 0 ? [] : [{ row, value }];
9424
+ });
9425
+ const options2 = series2.boxWhisker;
9426
+ const rawMethod = options2?.statistics?.quartileMethod;
9427
+ const method = rawMethod === "inclusive" ? "inclusive" : "exclusive";
9428
+ const visibility = options2?.visibility;
9429
+ const trim = rawMethod === "inclusive" || rawMethod === "exclusive" || !!visibility && Object.values(visibility).some((v) => v !== void 0);
9430
+ const distribution = boxWhiskerDistribution(
9431
+ observations.map((p) => p.value),
9432
+ method,
9433
+ trim
9434
+ );
9435
+ if (!distribution) return;
9436
+ const { stats, whiskerMin, whiskerMax, mean } = distribution;
9437
+ const x = frame.band(ci) - frame.bandSize / 2 + si * slot + (slot - width) / 2;
9438
+ const mid = x + width / 2;
9439
+ const y = frame.value;
9440
+ out.push(
9441
+ `<g data-chart-part="box" data-chart-series="${series2.sourceIndex ?? si}" data-chart-point="${ci}">`
9442
+ );
9443
+ out.push(line(mid, y(whiskerMax), mid, y(stats.q3), "#64748b", 1));
9444
+ out.push(line(mid, y(stats.q1), mid, y(whiskerMin), "#64748b", 1));
9445
+ out.push(
9446
+ line(x + width * 0.25, y(whiskerMin), x + width * 0.75, y(whiskerMin), "#64748b", 1)
9447
+ );
9448
+ out.push(
9449
+ line(x + width * 0.25, y(whiskerMax), x + width * 0.75, y(whiskerMax), "#64748b", 1)
9450
+ );
9451
+ out.push(
9452
+ rect(
9453
+ x,
9454
+ Math.min(y(stats.q1), y(stats.q3)),
9455
+ width,
9456
+ Math.abs(y(stats.q1) - y(stats.q3)),
9457
+ series2.pointColors?.[ci] ?? series2.color
9458
+ )
9459
+ );
9460
+ out.push(line(x, y(stats.median), x + width, y(stats.median), "#1e293b", 2));
9461
+ if (visibility?.meanLine) out.push(line(x, y(mean), x + width, y(mean), "#0f766e", 1.5));
9462
+ if (visibility?.meanMarker !== false)
9463
+ out.push(
9464
+ `<path d="${boxMeanMarkerPath(mid, y(mean))}" fill="none" stroke="#0f766e" stroke-width="1.5" data-chart-part="mean"/>`
9465
+ );
9466
+ observations.forEach((point, index) => {
9467
+ const outlier = point.value < whiskerMin || point.value > whiskerMax;
9468
+ if (outlier ? !visibility?.outliers : !visibility?.nonoutliers) return;
9469
+ const px = x + width * (0.2 + 0.6 * (index + 1) / (observations.length + 1));
9470
+ out.push(
9471
+ `<circle cx="${n(px)}" cy="${n(y(point.value))}" r="2.25" fill="${outlier ? "#dc2626" : "#1e293b"}" data-chart-series="${series2.sourceIndex ?? si}" data-chart-point="${point.row}" data-chart-part="${outlier ? "outlier" : "observation"}"/>`
9472
+ );
9473
+ });
9474
+ out.push("</g>");
9475
+ });
9476
+ });
9477
+ }
9478
+
9479
+ // chart/data-table-layout.ts
9480
+ function chartDataTableMetrics(fontSize, names, showKeys = true) {
9481
+ const rowH = Math.max(14, Math.round(fontSize * 1.45));
9482
+ const longestName = names.reduce((m, name) => Math.max(m, name.length), 0);
9483
+ const keyW = Math.min(160, Math.max(40, longestName * fontSize * 0.55 + (showKeys ? 24 : 8)));
9484
+ return { fontSize, rowH, keyW, height: rowH * (1 + names.length) };
9485
+ }
9486
+
9487
+ // chart/render/chart-spacing.ts
9488
+ function chartBarSpacing(chart) {
9489
+ const stacked = chart.grouping === "stacked" || chart.grouping === "percentStacked";
9490
+ return {
9491
+ barGapWidth: chart.barGapWidth ?? DEFAULT_BAR_GAP_WIDTH,
9492
+ barOverlap: chart.barOverlap ?? (stacked ? 100 : 0)
9493
+ };
9494
+ }
9495
+
9100
9496
  // chart/render/chart-svg-labels.ts
9101
9497
  var GAP = 3;
9102
9498
  var LINE = 1.2;
@@ -9106,6 +9502,7 @@ function measure(model, label) {
9106
9502
  const size = attrs.size ?? 10;
9107
9503
  const lines2 = label.text.split("\n");
9108
9504
  return {
9505
+ ...model.frameSize ? { frame: model.frameSize } : {},
9109
9506
  lines: lines2,
9110
9507
  size,
9111
9508
  w: Math.max(...lines2.map((l) => textWidth(l, size))),
@@ -9114,6 +9511,7 @@ function measure(model, label) {
9114
9511
  };
9115
9512
  }
9116
9513
  function draw(m, label, x, y, anchor, out) {
9514
+ if (m.frame) ({ x, y } = applyLabelManualLayout(label.layout, m.frame, { x, y }));
9117
9515
  const fill = label.color && NAMED_COLORS.test(label.color) ? label.color.toLowerCase() : void 0;
9118
9516
  m.lines.forEach((line2, k) => {
9119
9517
  const lineY = y - m.h / 2 + (k + 0.5) * m.size * LINE + m.size * 0.35;
@@ -9173,46 +9571,6 @@ function pointLabels(model, marks, out) {
9173
9571
  }
9174
9572
  }
9175
9573
  }
9176
- function sliceLabels(model, marks, out) {
9177
- for (const mark of marks) {
9178
- const label = mark.series.labels?.[mark.index];
9179
- if (!label) continue;
9180
- const m = measure(model, label);
9181
- const mid = (mark.start + mark.end) / 2;
9182
- const ux = Math.sin(mid);
9183
- const uy = -Math.cos(mid);
9184
- const place = (radius) => [
9185
- mark.cx + radius * ux,
9186
- mark.cy + radius * uy
9187
- ];
9188
- const position = model.type === "doughnut" ? "ctr" : label.position ?? "bestFit";
9189
- let x;
9190
- let y;
9191
- if (position === "ctr") [x, y] = place(mark.inner + (mark.outer - mark.inner) / 2);
9192
- else if (position === "inEnd") {
9193
- const extent = Math.abs(ux) * m.w / 2 + Math.abs(uy) * m.h / 2;
9194
- [x, y] = place(Math.max(0, mark.outer - GAP - extent));
9195
- } else if (position === "outEnd") {
9196
- const extent = Math.abs(ux) * m.w / 2 + Math.abs(uy) * m.h / 2;
9197
- [x, y] = place(mark.outer + GAP + extent);
9198
- } else {
9199
- const placed = placeBestFitLabel(
9200
- {
9201
- cx: mark.cx,
9202
- cy: mark.cy,
9203
- outerR: mark.outer,
9204
- startAngle: mark.start - Math.PI / 2,
9205
- endAngle: mark.end - Math.PI / 2
9206
- },
9207
- m.w,
9208
- m.h
9209
- );
9210
- x = placed.x;
9211
- y = placed.y;
9212
- }
9213
- draw(m, label, x, y, "middle", out);
9214
- }
9215
- }
9216
9574
  function hasOutsideLabels(model) {
9217
9575
  return model.series.some(
9218
9576
  (s) => s.labels?.some(
@@ -9238,7 +9596,8 @@ function bars(model, frame, out, values) {
9238
9596
  const marks = [];
9239
9597
  model.series.forEach((s, si) => {
9240
9598
  values[si]?.forEach((v, i) => {
9241
- if (v === null || i >= model.categories.length) return;
9599
+ if (v === null || i >= model.categories.length || frame.order && !frame.order.includes(i))
9600
+ return;
9242
9601
  let from = 0;
9243
9602
  let to = v;
9244
9603
  if (stacked) {
@@ -9364,69 +9723,15 @@ function scatterAnalysis(model, px, py, out) {
9364
9723
  });
9365
9724
  }
9366
9725
 
9367
- // chart/render/chart-svg-markers.ts
9368
- function chartMarkerRadius(series2, index, defaultRadius = 3) {
9369
- const marker = { ...series2.marker, ...series2.pointMarkers?.[index] };
9370
- if (marker.symbol === "none") return 0;
9371
- const radius = markerRadius(marker.size, defaultRadius);
9372
- return marker.symbol === "dot" ? Math.max(radius * 0.6, 1) : radius;
9373
- }
9374
- function chartSeriesMarkerSvg(series2, index, cx, cy, defaultRadius = 3) {
9375
- const marker = { ...series2.marker, ...series2.pointMarkers?.[index] };
9376
- const primitive = buildMarkerPrimitive({
9377
- ...marker,
9378
- symbol: marker.symbol,
9379
- size: marker.size,
9380
- cx,
9381
- cy,
9382
- fill: marker.fill ?? series2.pointColors?.[index] ?? series2.color,
9383
- defaultRadius
9384
- });
9385
- if (!primitive) return "";
9386
- let geometry;
9387
- switch (primitive.kind) {
9388
- case "circle":
9389
- geometry = `cx="${n(primitive.cx)}" cy="${n(primitive.cy)}" r="${n(primitive.r)}"`;
9390
- break;
9391
- case "rect":
9392
- geometry = `x="${n(primitive.x)}" y="${n(primitive.y)}" width="${n(primitive.w)}" height="${n(primitive.h)}"`;
9393
- break;
9394
- case "path":
9395
- geometry = `d="${esc(primitive.d)}"`;
9396
- break;
9397
- case "polygon":
9398
- geometry = `points="${esc(primitive.points)}"`;
9399
- break;
9400
- }
9401
- const outline = primitive.stroke ? ` stroke="${esc(primitive.stroke)}" stroke-width="${n(primitive.strokeWidth ?? 1)}"` : "";
9402
- const filter = series2.shadowFilter ? ` filter="${esc(series2.shadowFilter)}"` : "";
9403
- return `<${primitive.kind} ${geometry} fill="${esc(primitive.fill)}"${outline}${filter}/>`;
9404
- }
9405
-
9406
- // chart/line-dash.ts
9407
- function chartLineDashArray(style, width) {
9408
- if (!style || style === "solid") {
9409
- return void 0;
9410
- }
9411
- const unit = Math.max(width, 1);
9412
- if (style === "dot" || style === "sysDot") {
9413
- return `${unit} ${unit * 2}`;
9414
- }
9415
- if (style === "lgDash") {
9416
- return `${unit * 6} ${unit * 3}`;
9417
- }
9418
- return `${unit * 3} ${unit * 2}`;
9419
- }
9420
-
9421
- // chart/render/chart-scale.ts
9422
- var clean = (n2) => Number(n2.toPrecision(12));
9423
- function* units(raw2) {
9424
- let exp = Math.floor(Math.log10(raw2)) - 1;
9425
- for (; ; ) {
9426
- const base = 10 ** exp;
9427
- for (const m of [1, 2, 5]) yield clean(m * base);
9428
- exp++;
9429
- }
9726
+ // chart/render/chart-scale.ts
9727
+ var clean = (n2) => Number(n2.toPrecision(12));
9728
+ function* units(raw2) {
9729
+ let exp = Math.floor(Math.log10(raw2)) - 1;
9730
+ for (; ; ) {
9731
+ const base = 10 ** exp;
9732
+ for (const m of [1, 2, 5]) yield clean(m * base);
9733
+ exp++;
9734
+ }
9430
9735
  }
9431
9736
  function niceScale(dataMin, dataMax, options2 = {}) {
9432
9737
  const maxIntervals = Math.max(1, options2.maxIntervals ?? 10);
@@ -9436,9 +9741,9 @@ function niceScale(dataMin, dataMax, options2 = {}) {
9436
9741
  if (lo === hi) {
9437
9742
  if (lo === 0) hi = 1;
9438
9743
  else if (options2.noZero) {
9439
- const pad = Math.abs(lo) * 0.1 || 1;
9440
- lo -= pad;
9441
- hi += pad;
9744
+ const pad2 = Math.abs(lo) * 0.1 || 1;
9745
+ lo -= pad2;
9746
+ hi += pad2;
9442
9747
  } else if (lo > 0) lo = 0;
9443
9748
  else hi = 0;
9444
9749
  }
@@ -9484,6 +9789,488 @@ function formatAxisValue(value, percent = false) {
9484
9789
  return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
9485
9790
  }
9486
9791
 
9792
+ // chart/render/chart-svg-data-table.ts
9793
+ var rows = (model) => [
9794
+ ...model.series,
9795
+ ...(model.extraGroups ?? []).flatMap((g) => g.series)
9796
+ ];
9797
+ function chartTableMetrics(model) {
9798
+ if (!model.dataTable) return void 0;
9799
+ const size = model.dataTable.text?.fontSize;
9800
+ return chartDataTableMetrics(
9801
+ size === void 0 ? 13.333333333333334 : chartPointsToPixels(size),
9802
+ rows(model).map((s) => s.name),
9803
+ model.dataTable.source.showKeys !== false
9804
+ );
9805
+ }
9806
+ function chartDataTableSvg(model, plot) {
9807
+ const table = model.dataTable;
9808
+ const metrics = chartTableMetrics(model);
9809
+ if (!table || !metrics) return "";
9810
+ const { source } = table;
9811
+ const { rowH, keyW, height, fontSize } = metrics;
9812
+ const series2 = rows(model);
9813
+ const top = plot.y + plot.h;
9814
+ const left = plot.x - keyW;
9815
+ const right = plot.x + plot.w;
9816
+ const bottom = top + height;
9817
+ const cellW = plot.w / Math.max(1, model.categories.length);
9818
+ const styled = { ...model, appearance: { ...model.appearance, dataLabel: table.text ?? {} } };
9819
+ const attrs = chartTextAttributes(styled, "dataLabel", fontSize);
9820
+ const out = ['<g data-chart-part="dataTable">'];
9821
+ const border = (x1, y1, x2, y2) => out.push(
9822
+ `<line x1="${n(x1)}" y1="${n(y1)}" x2="${n(x2)}" y2="${n(y2)}" ${strokeAttributes(table.stroke)}/>`
9823
+ );
9824
+ const label = (x, y, value, width, anchor = "middle") => out.push(
9825
+ text(x, y + fontSize * 0.35, fit(value, Math.max(1, width), fontSize), { ...attrs, anchor })
9826
+ );
9827
+ if (table.fill) out.push(rect(left, top, right - left, height, table.fill));
9828
+ if (source.showOutline !== false) {
9829
+ border(plot.x, top, right, top);
9830
+ border(right, top, right, bottom);
9831
+ border(right, bottom, left, bottom);
9832
+ border(left, bottom, left, top + rowH);
9833
+ border(left, top + rowH, plot.x, top + rowH);
9834
+ border(plot.x, top, plot.x, top + rowH);
9835
+ }
9836
+ model.categories.forEach((category, i) => {
9837
+ label(plot.x + (i + 0.5) * cellW, top + rowH / 2, category, cellW - 4);
9838
+ if (source.showVerticalBorder !== false && i > 0)
9839
+ border(plot.x + i * cellW, top, plot.x + i * cellW, bottom);
9840
+ });
9841
+ if (source.showVerticalBorder !== false) border(plot.x, top, plot.x, bottom);
9842
+ series2.forEach((s, i) => {
9843
+ const rowTop = top + rowH * (i + 1);
9844
+ const cy = rowTop + rowH / 2;
9845
+ if (source.showHorizontalBorder !== false) border(left, rowTop, right, rowTop);
9846
+ if (source.showKeys !== false) {
9847
+ const swatch = Math.max(6, Math.round(fontSize * 0.55));
9848
+ out.push(rect(left + 4, cy - swatch / 2, swatch, swatch, s.color));
9849
+ }
9850
+ const keyInset = source.showKeys !== false ? Math.max(6, Math.round(fontSize * 0.55)) + 7 : 4;
9851
+ label(left + keyInset, cy, s.name, keyW - keyInset - 4, "start");
9852
+ model.categories.forEach((_, j) => {
9853
+ const value = s.values[j];
9854
+ const formatted = value === null || value === void 0 ? "" : formatChartNumber(value, s.numberFormat) ?? formatAxisValue(value);
9855
+ label(plot.x + (j + 0.5) * cellW, cy, formatted, cellW - 4);
9856
+ });
9857
+ });
9858
+ return out.join("") + "</g>";
9859
+ }
9860
+
9861
+ // chart/date-axis.ts
9862
+ var DAY_MS = 864e5;
9863
+ function excelSerialToDate(serial, date1904 = false) {
9864
+ const epoch = date1904 ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, serial < 60 ? 31 : 30);
9865
+ return new Date(epoch + serial * DAY_MS);
9866
+ }
9867
+ function addUnit(date, amount, unit) {
9868
+ const next = new Date(date);
9869
+ if (unit === "days") {
9870
+ next.setUTCDate(next.getUTCDate() + amount);
9871
+ } else if (unit === "months") {
9872
+ next.setUTCMonth(next.getUTCMonth() + amount);
9873
+ } else {
9874
+ next.setUTCFullYear(next.getUTCFullYear() + amount);
9875
+ }
9876
+ return next;
9877
+ }
9878
+ function calendarTicks(min, max, date1904, unit, step) {
9879
+ const result = [];
9880
+ let date = excelSerialToDate(min, date1904);
9881
+ for (let guard = 0; guard < 1e3 && date.getTime() <= excelSerialToDate(max, date1904).getTime(); guard++) {
9882
+ result.push(min + (date.getTime() - excelSerialToDate(min, date1904).getTime()) / DAY_MS);
9883
+ date = addUnit(date, step, unit);
9884
+ }
9885
+ return result;
9886
+ }
9887
+
9888
+ // chart/date-format.ts
9889
+ var MONTH_ABBR = [
9890
+ "Jan",
9891
+ "Feb",
9892
+ "Mar",
9893
+ "Apr",
9894
+ "May",
9895
+ "Jun",
9896
+ "Jul",
9897
+ "Aug",
9898
+ "Sep",
9899
+ "Oct",
9900
+ "Nov",
9901
+ "Dec"
9902
+ ];
9903
+ var MONTH_FULL = [
9904
+ "January",
9905
+ "February",
9906
+ "March",
9907
+ "April",
9908
+ "May",
9909
+ "June",
9910
+ "July",
9911
+ "August",
9912
+ "September",
9913
+ "October",
9914
+ "November",
9915
+ "December"
9916
+ ];
9917
+ var WEEKDAY_ABBR = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
9918
+ var WEEKDAY_FULL = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
9919
+ function scanDateFormatTokens(code) {
9920
+ const tokens = [];
9921
+ let i = 0;
9922
+ while (i < code.length) {
9923
+ const ch = code[i];
9924
+ if (ch === '"') {
9925
+ const close = code.indexOf('"', i + 1);
9926
+ tokens.push({
9927
+ kind: "literal",
9928
+ text: close === -1 ? code.slice(i + 1) : code.slice(i + 1, close)
9929
+ });
9930
+ i = close === -1 ? code.length : close + 1;
9931
+ continue;
9932
+ }
9933
+ if (ch === "\\") {
9934
+ tokens.push({ kind: "literal", text: code[i + 1] ?? "" });
9935
+ i += 2;
9936
+ continue;
9937
+ }
9938
+ const rest = code.slice(i);
9939
+ if (/^am\/pm/iu.test(rest)) {
9940
+ tokens.push({ kind: "ampm", upper: ch === ch.toUpperCase(), short: false });
9941
+ i += 5;
9942
+ continue;
9943
+ }
9944
+ if (/^a\/p/iu.test(rest)) {
9945
+ tokens.push({ kind: "ampm", upper: ch === ch.toUpperCase(), short: true });
9946
+ i += 3;
9947
+ continue;
9948
+ }
9949
+ if (/[ymdhs]/iu.test(ch)) {
9950
+ let j = i + 1;
9951
+ while (j < code.length && code[j].toLowerCase() === ch.toLowerCase()) {
9952
+ j += 1;
9953
+ }
9954
+ tokens.push({
9955
+ kind: "letters",
9956
+ letter: ch.toLowerCase(),
9957
+ count: j - i
9958
+ });
9959
+ i = j;
9960
+ continue;
9961
+ }
9962
+ tokens.push({ kind: "literal", text: ch });
9963
+ i += 1;
9964
+ }
9965
+ return tokens;
9966
+ }
9967
+ function findNonLiteral(tokens, index, step) {
9968
+ for (let i = index + step; i >= 0 && i < tokens.length; i += step) {
9969
+ if (tokens[i].kind !== "literal") {
9970
+ return tokens[i];
9971
+ }
9972
+ }
9973
+ return void 0;
9974
+ }
9975
+ function pad(n2, width) {
9976
+ return String(n2).padStart(width, "0");
9977
+ }
9978
+ function renderDatePart(part, count, date, twelveHour) {
9979
+ switch (part) {
9980
+ case "year":
9981
+ return count >= 4 ? pad(date.getUTCFullYear(), 4) : pad(date.getUTCFullYear() % 100, 2);
9982
+ case "month":
9983
+ if (count >= 4) {
9984
+ return MONTH_FULL[date.getUTCMonth()] ?? "";
9985
+ }
9986
+ if (count === 3) {
9987
+ return MONTH_ABBR[date.getUTCMonth()] ?? "";
9988
+ }
9989
+ return count >= 2 ? pad(date.getUTCMonth() + 1, 2) : String(date.getUTCMonth() + 1);
9990
+ case "day":
9991
+ if (count >= 4) {
9992
+ return WEEKDAY_FULL[date.getUTCDay()] ?? "";
9993
+ }
9994
+ if (count === 3) {
9995
+ return WEEKDAY_ABBR[date.getUTCDay()] ?? "";
9996
+ }
9997
+ return count >= 2 ? pad(date.getUTCDate(), 2) : String(date.getUTCDate());
9998
+ case "hour": {
9999
+ const h24 = date.getUTCHours();
10000
+ const h = twelveHour ? h24 % 12 === 0 ? 12 : h24 % 12 : h24;
10001
+ return count >= 2 ? pad(h, 2) : String(h);
10002
+ }
10003
+ case "minute":
10004
+ return count >= 2 ? pad(date.getUTCMinutes(), 2) : String(date.getUTCMinutes());
10005
+ case "second":
10006
+ return count >= 2 ? pad(date.getUTCSeconds(), 2) : String(date.getUTCSeconds());
10007
+ }
10008
+ }
10009
+ function renderExcelDateFormat(date, code) {
10010
+ const tokens = scanDateFormatTokens(code);
10011
+ const hasAmPm = tokens.some((t) => t.kind === "ampm");
10012
+ let out = "";
10013
+ for (const [index, token] of tokens.entries()) {
10014
+ if (token.kind === "literal") {
10015
+ out += token.text;
10016
+ continue;
10017
+ }
10018
+ if (token.kind === "ampm") {
10019
+ const hour = date.getUTCHours(), text2 = token.short ? hour < 12 ? "A" : "P" : hour < 12 ? "AM" : "PM";
10020
+ out += token.upper ? text2 : text2.toLowerCase();
10021
+ continue;
10022
+ }
10023
+ if (token.letter === "m") {
10024
+ const prev = findNonLiteral(tokens, index, -1), next = findNonLiteral(tokens, index, 1), isMinute = prev?.kind === "letters" && prev.letter === "h" || next?.kind === "letters" && next.letter === "s";
10025
+ out += renderDatePart(isMinute ? "minute" : "month", token.count, date, hasAmPm);
10026
+ continue;
10027
+ }
10028
+ const part = { y: "year", d: "day", h: "hour", s: "second" };
10029
+ out += renderDatePart(part[token.letter], token.count, date, hasAmPm);
10030
+ }
10031
+ return out;
10032
+ }
10033
+ function formatDate(date, unit, format) {
10034
+ if (format && /[ymdhs]/iu.test(format)) {
10035
+ const rendered = renderExcelDateFormat(date, format);
10036
+ if (rendered.length > 0) {
10037
+ return rendered;
10038
+ }
10039
+ }
10040
+ const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" }), year = String(date.getUTCFullYear()), day = String(date.getUTCDate());
10041
+ if (unit === "years") {
10042
+ return year;
10043
+ }
10044
+ if (unit === "months") {
10045
+ return `${month} ${year}`;
10046
+ }
10047
+ return `${day} ${month}`;
10048
+ }
10049
+
10050
+ // chart/render/chart-svg-date-axis.ts
10051
+ function chartDateAxis(model, plot, out) {
10052
+ const axis = model.axes?.category?.source;
10053
+ const values = model.dateCategories;
10054
+ if (axis?.kind !== "date" || !values?.length) return void 0;
10055
+ const points2 = values.flatMap(
10056
+ (value, index) => value === null || !Number.isFinite(value) ? [] : [{ value, index }]
10057
+ ).sort((a2, b) => a2.value - b.value);
10058
+ if (!points2.length) return void 0;
10059
+ const min = axis.scaling.min ?? points2[0].value;
10060
+ const max = axis.scaling.max ?? points2.at(-1).value;
10061
+ if (!Number.isFinite(min) || !Number.isFinite(max) || max < min) return void 0;
10062
+ const position = (value) => {
10063
+ const ratio = max === min ? 0.5 : (value - min) / (max - min);
10064
+ const t = axis.scaling.orientation === "maxMin" ? 1 - ratio : ratio;
10065
+ return model.horizontal ? plot.y + plot.h * (1 - t) : plot.x + plot.w * t;
10066
+ };
10067
+ const visible = points2.filter((p) => p.value >= min && p.value <= max);
10068
+ const unitOf = (unit2) => unit2 === "months" || unit2 === "years" ? unit2 : "days";
10069
+ const unit = unitOf(axis.majorTimeUnit ?? axis.baseTimeUnit);
10070
+ const ticks = calendarTicks(
10071
+ min,
10072
+ max,
10073
+ model.date1904 ?? false,
10074
+ unit,
10075
+ Math.max(1, axis.majorUnit ?? 1)
10076
+ );
10077
+ const attrs = chartTextAttributes(model, "categoryAxis");
10078
+ const size = attrs.size ?? 10;
10079
+ const y = axis.position === "t" ? plot.y : plot.y + plot.h;
10080
+ const paint2 = model.axes?.category?.line;
10081
+ const stroke = { color: paint2?.color ?? "#BFBFBF", width: paint2?.width ?? 1 };
10082
+ const mark = (serial, placement, length) => {
10083
+ if (!placement || placement === "none" || axis.deleted) return;
10084
+ const inward = axis.position === "t" ? length : -length;
10085
+ const start = placement === "cross" ? -length : 0;
10086
+ const end = placement === "cross" ? length : placement === "in" ? inward : -inward;
10087
+ if (model.horizontal) {
10088
+ const x = axis.position === "r" ? plot.x + plot.w : plot.x;
10089
+ const direction = axis.position === "r" ? -1 : 1;
10090
+ const a2 = placement === "cross" ? -length : 0;
10091
+ const b = placement === "cross" ? length : placement === "in" ? direction * length : -direction * length;
10092
+ out.push(
10093
+ `<line x1="${x + a2}" y1="${position(serial)}" x2="${x + b}" y2="${position(serial)}" ${strokeAttributes(stroke)} data-chart-part="dateTick"/>`
10094
+ );
10095
+ } else
10096
+ out.push(
10097
+ `<line x1="${position(serial)}" y1="${y + start}" x2="${position(serial)}" y2="${y + end}" ${strokeAttributes(stroke)} data-chart-part="dateTick"/>`
10098
+ );
10099
+ };
10100
+ ticks.forEach((serial, index) => {
10101
+ if (index % Math.max(1, axis.tickMarkSkip ?? 1) === 0) mark(serial, axis.majorTickMark, 4);
10102
+ if (axis.deleted || model.dataTable || axis.tickLabelPosition === "none" || index % Math.max(1, axis.tickLabelSkip ?? 1))
10103
+ return;
10104
+ const label = formatDate(
10105
+ excelSerialToDate(serial, model.date1904),
10106
+ unit,
10107
+ axis.numberFormat?.formatCode
10108
+ );
10109
+ if (model.horizontal)
10110
+ out.push(text(plot.x - 4, position(serial) + size * 0.3, label, { ...attrs, anchor: "end" }));
10111
+ else {
10112
+ const above = axis.tickLabelPosition === "high" || axis.tickLabelPosition !== "low" && axis.position === "t";
10113
+ const baseline = axis.tickLabelPosition === "high" ? plot.y : axis.tickLabelPosition === "low" ? plot.y + plot.h : y;
10114
+ out.push(
10115
+ text(position(serial), baseline + (above ? -4 : size + 3), label, {
10116
+ ...attrs,
10117
+ anchor: "middle"
10118
+ })
10119
+ );
10120
+ }
10121
+ });
10122
+ if (axis.minorTickMark && axis.minorTickMark !== "none")
10123
+ for (const serial of calendarTicks(
10124
+ min,
10125
+ max,
10126
+ model.date1904 ?? false,
10127
+ unitOf(axis.minorTimeUnit ?? axis.baseTimeUnit ?? unit),
10128
+ Math.max(1, axis.minorUnit ?? 1)
10129
+ ))
10130
+ mark(serial, axis.minorTickMark, 2.5);
10131
+ return {
10132
+ order: visible.map((p) => p.index),
10133
+ band: (index) => position(values[index] ?? min),
10134
+ bandSize: (model.horizontal ? plot.h : plot.w) / Math.max(1, max - min + 1)
10135
+ };
10136
+ }
10137
+
10138
+ // chart/line-path.ts
10139
+ function smoothLinePath(points2) {
10140
+ if (points2.length === 0) {
10141
+ return "";
10142
+ }
10143
+ if (points2.length === 1) {
10144
+ return `M${points2[0].x.toFixed(2)},${points2[0].y.toFixed(2)}`;
10145
+ }
10146
+ if (points2.length === 2) {
10147
+ return `M${points2[0].x.toFixed(2)},${points2[0].y.toFixed(2)} L${points2[1].x.toFixed(2)},${points2[1].y.toFixed(2)}`;
10148
+ }
10149
+ let d = `M${points2[0].x.toFixed(2)},${points2[0].y.toFixed(2)}`;
10150
+ for (let i = 0; i < points2.length - 1; i++) {
10151
+ const [cp1, cp2, end] = smoothSegment(points2, i);
10152
+ d += ` C${cp1.x.toFixed(2)},${cp1.y.toFixed(2)} ${cp2.x.toFixed(2)},${cp2.y.toFixed(2)} ${end.x.toFixed(2)},${end.y.toFixed(2)}`;
10153
+ }
10154
+ return d;
10155
+ }
10156
+ function smoothSegment(points2, i) {
10157
+ const p0 = points2[i - 1] ?? points2[i];
10158
+ const p1 = points2[i];
10159
+ const p2 = points2[i + 1];
10160
+ const p3 = points2[i + 2] ?? p2;
10161
+ return [
10162
+ { x: p1.x + (p2.x - p0.x) / 6, y: p1.y + (p2.y - p0.y) / 6 },
10163
+ { x: p2.x - (p3.x - p1.x) / 6, y: p2.y - (p3.y - p1.y) / 6 },
10164
+ p2
10165
+ ];
10166
+ }
10167
+ function sampleSmoothLine(points2, stepsPerSegment = 16) {
10168
+ if (points2.length < 3) {
10169
+ return [...points2];
10170
+ }
10171
+ const out = [points2[0]];
10172
+ for (let i = 0; i < points2.length - 1; i++) {
10173
+ const start = points2[i], [cp1, cp2, end] = smoothSegment(points2, i);
10174
+ for (let step = 1; step <= stepsPerSegment; step++) {
10175
+ const t = step / stepsPerSegment, u = 1 - t, a2 = u * u * u, b = 3 * u * u * t, c2 = 3 * u * t * t, d = t * t * t;
10176
+ out.push(
10177
+ step === stepsPerSegment ? end : {
10178
+ x: a2 * start.x + b * cp1.x + c2 * cp2.x + d * end.x,
10179
+ y: a2 * start.y + b * cp1.y + c2 * cp2.y + d * end.y
10180
+ }
10181
+ );
10182
+ }
10183
+ }
10184
+ return out;
10185
+ }
10186
+ function polylineRunsPath(runs) {
10187
+ return runs.map(
10188
+ (run2) => run2.map((p, i) => `${i === 0 ? "M" : "L"}${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(" ")
10189
+ ).join(" ");
10190
+ }
10191
+
10192
+ // chart/render/chart-svg-line.ts
10193
+ function chartLineSvg(points2, series2) {
10194
+ if (points2.length < 2) return "";
10195
+ const stroke = series2.stroke;
10196
+ const attrs = strokeAttributes(
10197
+ stroke ? { ...stroke, color: stroke.color === "none" ? "none" : series2.color } : { color: series2.color, width: 2.25 }
10198
+ );
10199
+ const filter = series2.shadowFilter ? ` filter="${series2.shadowFilter}"` : "";
10200
+ return series2.smooth ? `<path d="${smoothLinePath(points2)}" fill="none" ${attrs} stroke-linejoin="round"${filter}/>` : `<polyline points="${points2.map((p) => `${n(p.x)},${n(p.y)}`).join(" ")}" fill="none" ${attrs} stroke-linejoin="round"${filter}/>`;
10201
+ }
10202
+
10203
+ // chart/render/chart-svg-plot-layout.ts
10204
+ function chartPlotRect(model, auto, outer, frame) {
10205
+ if (!frame) return auto;
10206
+ const rect2 = resolveManualPlotRect(
10207
+ model.plotLayout,
10208
+ frame,
10209
+ { x: auto.x, y: auto.y, width: auto.w, height: auto.h },
10210
+ {
10211
+ left: auto.x - outer.x,
10212
+ top: auto.y - outer.y,
10213
+ right: Math.max(0, outer.x + outer.w - auto.x - auto.w),
10214
+ bottom: Math.max(0, outer.y + outer.h - auto.y - auto.h)
10215
+ }
10216
+ );
10217
+ return rect2 ? { x: rect2.x, y: rect2.y, w: rect2.width, h: rect2.height } : auto;
10218
+ }
10219
+
10220
+ // chart/render/chart-svg-markers.ts
10221
+ function chartMarkerRadius(series2, index, defaultRadius = 3) {
10222
+ const marker = { ...series2.marker, ...series2.pointMarkers?.[index] };
10223
+ if (marker.symbol === "none") return 0;
10224
+ const radius = markerRadius(marker.size, defaultRadius);
10225
+ return marker.symbol === "dot" ? Math.max(radius * 0.6, 1) : radius;
10226
+ }
10227
+ function chartSeriesMarkerSvg(series2, index, cx, cy, defaultRadius = 3) {
10228
+ const marker = { ...series2.marker, ...series2.pointMarkers?.[index] };
10229
+ const primitive = buildMarkerPrimitive({
10230
+ ...marker,
10231
+ symbol: marker.symbol,
10232
+ size: marker.size,
10233
+ cx,
10234
+ cy,
10235
+ fill: marker.fill ?? series2.pointColors?.[index] ?? series2.color,
10236
+ defaultRadius
10237
+ });
10238
+ if (!primitive) return "";
10239
+ let geometry;
10240
+ switch (primitive.kind) {
10241
+ case "circle":
10242
+ geometry = `cx="${n(primitive.cx)}" cy="${n(primitive.cy)}" r="${n(primitive.r)}"`;
10243
+ break;
10244
+ case "rect":
10245
+ geometry = `x="${n(primitive.x)}" y="${n(primitive.y)}" width="${n(primitive.w)}" height="${n(primitive.h)}"`;
10246
+ break;
10247
+ case "path":
10248
+ geometry = `d="${esc(primitive.d)}"`;
10249
+ break;
10250
+ case "polygon":
10251
+ geometry = `points="${esc(primitive.points)}"`;
10252
+ break;
10253
+ }
10254
+ const outline = primitive.stroke ? ` stroke="${esc(primitive.stroke)}" stroke-width="${n(primitive.strokeWidth ?? 1)}"` : "";
10255
+ const filter = series2.shadowFilter ? ` filter="${esc(series2.shadowFilter)}"` : "";
10256
+ return `<${primitive.kind} ${geometry} fill="${esc(primitive.fill)}"${outline}${filter}/>`;
10257
+ }
10258
+
10259
+ // chart/line-dash.ts
10260
+ function chartLineDashArray(style, width) {
10261
+ if (!style || style === "solid") {
10262
+ return void 0;
10263
+ }
10264
+ const unit = Math.max(width, 1);
10265
+ if (style === "dot" || style === "sysDot") {
10266
+ return `${unit} ${unit * 2}`;
10267
+ }
10268
+ if (style === "lgDash") {
10269
+ return `${unit * 6} ${unit * 3}`;
10270
+ }
10271
+ return `${unit * 3} ${unit * 2}`;
10272
+ }
10273
+
9487
10274
  // chart/render/chart-svg-axes.ts
9488
10275
  function axisTickText(value, axis, percent = false) {
9489
10276
  return formatChartNumber(value, axis?.source.numberFormat?.formatCode) ?? formatAxisValue(value, percent);
@@ -9806,6 +10593,50 @@ function applyChartAxes(model, chart, color2) {
9806
10593
  model.axes = out;
9807
10594
  }
9808
10595
 
10596
+ // chart/render/chart-title-text.ts
10597
+ function chartRunStyle(run2) {
10598
+ return {
10599
+ ...run2.sizePt === void 0 ? {} : { fontSize: run2.sizePt },
10600
+ ...run2.bold === void 0 ? {} : { bold: run2.bold },
10601
+ ...run2.italic === void 0 ? {} : { italic: run2.italic },
10602
+ ...run2.underline === void 0 ? {} : { underline: run2.underline },
10603
+ ...run2.typeface === void 0 ? {} : { typeface: run2.typeface },
10604
+ ...run2.color === void 0 ? {} : { textColor: run2.color }
10605
+ };
10606
+ }
10607
+ function chartTitleText(chart, theme) {
10608
+ const formatting = chart.formatting;
10609
+ const entry3 = formatting?.entries.title;
10610
+ const body = entry3?.textBody;
10611
+ if (!formatting || !body || body.text !== chart.title) return void 0;
10612
+ if (body.paragraphs.length === 1 && body.paragraphs[0].runs.length <= 1 && !body.text.includes("\n") && !body.paragraphs[0].lineSpacing && !body.paragraphs[0].spaceBefore && !body.paragraphs[0].spaceAfter)
10613
+ return void 0;
10614
+ return {
10615
+ paragraphs: body.paragraphs.map((paragraph2) => ({
10616
+ ...paragraph2.align ? { align: paragraph2.align } : {},
10617
+ ...paragraph2.lineSpacing ? { lineSpacing: paragraph2.lineSpacing } : {},
10618
+ ...paragraph2.spaceBefore ? { spaceBefore: paragraph2.spaceBefore } : {},
10619
+ ...paragraph2.spaceAfter ? { spaceAfter: paragraph2.spaceAfter } : {},
10620
+ runs: paragraph2.runs.map((run2) => {
10621
+ const direct = {
10622
+ sourceXml: "",
10623
+ ...entry3.textBodyStyle,
10624
+ ...chartRunStyle(paragraph2.defaultProperties ?? {}),
10625
+ ...chartRunStyle(run2)
10626
+ };
10627
+ const appearance = chartAppearance(
10628
+ {
10629
+ ...chart,
10630
+ formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
10631
+ },
10632
+ theme
10633
+ )?.title ?? {};
10634
+ return { text: run2.text, appearance };
10635
+ })
10636
+ }))
10637
+ };
10638
+ }
10639
+
9809
10640
  // chart/render/chart-view-analysis.ts
9810
10641
  function strokeOf(line2, fallback, resolve) {
9811
10642
  if (line2?.fill?.kind === "none") return void 0;
@@ -9833,6 +10664,40 @@ function analysisView(source, seriesColor, resolve) {
9833
10664
  };
9834
10665
  }
9835
10666
 
10667
+ // chart/render/chart-view-data-table.ts
10668
+ function chartDataTableView(chart, theme, color2) {
10669
+ const source = chart.dataTable;
10670
+ if (!source) return void 0;
10671
+ const props = source.txPr?.paragraphs[0];
10672
+ const direct = {
10673
+ sourceXml: "",
10674
+ ...chartRunStyle(props?.defaultProperties ?? {}),
10675
+ ...chartRunStyle(props?.runs[0] ?? {})
10676
+ };
10677
+ const formatting = chart.formatting;
10678
+ const appearance = chartAppearance(
10679
+ {
10680
+ ...chart,
10681
+ formatting: {
10682
+ ...formatting,
10683
+ sourceXml: formatting?.sourceXml ?? "",
10684
+ entries: { ...formatting?.entries, categoryAxis: direct }
10685
+ }
10686
+ },
10687
+ theme
10688
+ );
10689
+ const fill = source.spPr?.fill;
10690
+ return {
10691
+ source,
10692
+ stroke: strokeOf(source.spPr?.line, { color: "#D9D9D9", width: 1 }, color2) ?? {
10693
+ color: "none",
10694
+ width: 0
10695
+ },
10696
+ ...fill?.kind === "solid" && color2(fill.color) ? { fill: color2(fill.color) } : {},
10697
+ ...appearance?.categoryAxis ? { text: appearance.categoryAxis } : {}
10698
+ };
10699
+ }
10700
+
9836
10701
  // chart/render/chart-view-series.ts
9837
10702
  var isRefError = (value) => typeof value === "object" && value !== null && "error" in value;
9838
10703
  function toText(value) {
@@ -9874,7 +10739,8 @@ function seriesContext(chart, theme, options2) {
9874
10739
  function seriesView(ctx, s, index, total, categoriesOf) {
9875
10740
  const { theme, scheme, palette, evaluateRef } = ctx;
9876
10741
  const values = resolveRef(s.valuesRef, evaluateRef)?.map(toNumber) ?? s.values.map(toNumber);
9877
- categoriesOf(resolveRef(s.categoriesRef, evaluateRef) ?? s.categories);
10742
+ const categoryValues2 = resolveRef(s.categoriesRef, evaluateRef) ?? s.categories;
10743
+ categoriesOf(categoryValues2);
9878
10744
  const paletteColor = palette && chartPaletteSeriesColor(palette, index, total, scheme);
9879
10745
  const color2 = s.fill?.kind === "none" ? "none" : ctx.drawingColor(s.fill?.kind === "solid" ? s.fill.color : s.drawingColor) ?? ctx.seriesColor?.(s, index) ?? paletteColor ?? autoSeriesColor(theme, index);
9880
10746
  const view = {
@@ -9883,6 +10749,19 @@ function seriesView(ctx, s, index, total, categoriesOf) {
9883
10749
  color: color2,
9884
10750
  sourceIndex: index
9885
10751
  };
10752
+ if (s.hidden !== void 0) view.hidden = s.hidden;
10753
+ if (s.boxWhisker) {
10754
+ view.boxWhisker = s.boxWhisker;
10755
+ view.boxCategories = categoryValues2.map(toText);
10756
+ }
10757
+ if (s.numberFormat !== void 0) view.numberFormat = s.numberFormat;
10758
+ if (s.showLine !== void 0) view.showLine = s.showLine;
10759
+ if (s.smooth !== void 0) view.smooth = s.smooth;
10760
+ if (s.line)
10761
+ view.stroke = strokeOf(s.line, { color: color2, width: 2.25 }, ctx.drawingColor) ?? {
10762
+ color: "none",
10763
+ width: 0
10764
+ };
9886
10765
  const shadow = resolveDrawingShadowXml(s.effectsXml, { scheme: (name) => scheme[name] });
9887
10766
  if (shadow) view.shadow = shadow;
9888
10767
  const resolvedGradient = ctx.gradient(s.fill);
@@ -10027,52 +10906,8 @@ function categoryTotals(model) {
10027
10906
  );
10028
10907
  }
10029
10908
 
10030
- // chart/render/chart-title-text.ts
10031
- function properties(run2) {
10032
- return {
10033
- ...run2.sizePt === void 0 ? {} : { fontSize: run2.sizePt },
10034
- ...run2.bold === void 0 ? {} : { bold: run2.bold },
10035
- ...run2.italic === void 0 ? {} : { italic: run2.italic },
10036
- ...run2.underline === void 0 ? {} : { underline: run2.underline },
10037
- ...run2.typeface === void 0 ? {} : { typeface: run2.typeface },
10038
- ...run2.color === void 0 ? {} : { textColor: run2.color }
10039
- };
10040
- }
10041
- function chartTitleText(chart, theme) {
10042
- const formatting = chart.formatting;
10043
- const entry3 = formatting?.entries.title;
10044
- const body = entry3?.textBody;
10045
- if (!formatting || !body || body.text !== chart.title) return void 0;
10046
- if (body.paragraphs.length === 1 && body.paragraphs[0].runs.length <= 1 && !body.text.includes("\n") && !body.paragraphs[0].lineSpacing && !body.paragraphs[0].spaceBefore && !body.paragraphs[0].spaceAfter)
10047
- return void 0;
10048
- return {
10049
- paragraphs: body.paragraphs.map((paragraph2) => ({
10050
- ...paragraph2.align ? { align: paragraph2.align } : {},
10051
- ...paragraph2.lineSpacing ? { lineSpacing: paragraph2.lineSpacing } : {},
10052
- ...paragraph2.spaceBefore ? { spaceBefore: paragraph2.spaceBefore } : {},
10053
- ...paragraph2.spaceAfter ? { spaceAfter: paragraph2.spaceAfter } : {},
10054
- runs: paragraph2.runs.map((run2) => {
10055
- const direct = {
10056
- sourceXml: "",
10057
- ...entry3.textBodyStyle,
10058
- ...properties(paragraph2.defaultProperties ?? {}),
10059
- ...properties(run2)
10060
- };
10061
- const appearance = chartAppearance(
10062
- {
10063
- ...chart,
10064
- formatting: { ...formatting, entries: { ...formatting.entries, title: direct } }
10065
- },
10066
- theme
10067
- )?.title ?? {};
10068
- return { text: run2.text, appearance };
10069
- })
10070
- }))
10071
- };
10072
- }
10073
-
10074
10909
  // chart/render/chart-view-labels.ts
10075
- function labelsOf(source, view, categories, numberFormat3) {
10910
+ function labelsOf(source, view, categories, numberFormat3, resolveColor) {
10076
10911
  const { chart, series: series2, points: points2 } = source;
10077
10912
  if ((series2?.deleted ?? chart?.deleted) === true) return void 0;
10078
10913
  const percentBase = view.values.reduce(
@@ -10108,19 +10943,35 @@ function labelsOf(source, view, categories, numberFormat3) {
10108
10943
  });
10109
10944
  }
10110
10945
  if (!built) return;
10946
+ const layout = point?.layout;
10947
+ const showLeaderLines = series2?.showLeaderLines ?? chart?.showLeaderLines;
10948
+ const leaderLine = strokeOf(
10949
+ series2?.leaderLine ?? chart?.leaderLine,
10950
+ { color: "#94a3b8", width: 0.75 },
10951
+ resolveColor
10952
+ ) ?? { color: "none", width: 0 };
10111
10953
  any = true;
10112
10954
  out[i] = {
10113
10955
  text: built.text,
10956
+ ...layout ? { layout } : {},
10957
+ ...showLeaderLines !== void 0 ? { showLeaderLines } : {},
10958
+ ...leaderLine ? { leaderLine } : {},
10114
10959
  ...position ? { position } : {},
10115
10960
  ...built.color ? { color: built.color } : {}
10116
10961
  };
10117
10962
  });
10118
10963
  return any ? out : void 0;
10119
10964
  }
10120
- function applyDataLabels(model, sources, extra) {
10965
+ function applyDataLabels(model, sources, extra, resolveColor) {
10121
10966
  const apply = (source, view) => {
10122
10967
  if (!source?.dataLabels) return;
10123
- const labels2 = labelsOf(source.dataLabels, view, model.categories, source.numberFormat);
10968
+ const labels2 = labelsOf(
10969
+ source.dataLabels,
10970
+ view,
10971
+ model.categories,
10972
+ source.numberFormat,
10973
+ resolveColor
10974
+ );
10124
10975
  if (labels2) view.labels = labels2;
10125
10976
  };
10126
10977
  model.series.forEach((view, i) => apply(sources[i], view));
@@ -10225,7 +11076,9 @@ var SUPPORTED = /* @__PURE__ */ new Set([
10225
11076
  "bubble",
10226
11077
  "stock",
10227
11078
  "treemap",
10228
- "sunburst"
11079
+ "sunburst",
11080
+ "funnel",
11081
+ "boxWhisker"
10229
11082
  ]);
10230
11083
  function chartSummaryView(chart, theme, options2 = {}) {
10231
11084
  const type = chart.chartType;
@@ -10283,10 +11136,17 @@ function chartSummaryView(chart, theme, options2 = {}) {
10283
11136
  showLegend: chart.showLegend,
10284
11137
  legendPosition: chart.legendPosition ?? "r",
10285
11138
  categories,
10286
- series: series2,
11139
+ series: type === "boxWhisker" ? series2.filter((s) => !s.hidden) : series2,
10287
11140
  horizontal: type === "bar",
10288
11141
  supported: SUPPORTED.has(type)
10289
11142
  };
11143
+ const table = chartDataTableView(chart, theme, ctx.drawingColor);
11144
+ if (table) model.dataTable = table;
11145
+ if (chart.date1904 !== void 0) model.date1904 = chart.date1904;
11146
+ if (chart.axes?.some((a2) => a2.kind === "date")) model.dateCategories = firstCats.map(toNumber);
11147
+ if (chart.plotLayout) model.plotLayout = chart.plotLayout;
11148
+ if (type === "boxWhisker")
11149
+ model.categories = [...new Set(model.series.flatMap((s) => s.boxCategories ?? []))];
10290
11150
  if (chart.title) model.title = chart.title;
10291
11151
  const titleFormatting = chart.formatting?.entries.title;
10292
11152
  if (titleFormatting?.layout) model.titleLayout = titleFormatting.layout;
@@ -10308,6 +11168,11 @@ function chartSummaryView(chart, theme, options2 = {}) {
10308
11168
  const range2 = extentOf(xs);
10309
11169
  model.xAxis = xs.length ? niceScale(range2.min, range2.max) : niceScale(0, 1);
10310
11170
  }
11171
+ if (type === "funnel" || type === "boxWhisker")
11172
+ series2.forEach((s, i) => {
11173
+ const points2 = chart.series[i]?.pointColors;
11174
+ if (points2) s.pointColors = s.values.map((_, j) => drawingColor(points2[j]) ?? s.color);
11175
+ });
10311
11176
  if (type === "stock") model.stock = stockView(chart.stock, ctx);
10312
11177
  if (type === "bubble") bubbleView(chart, model, ctx.evaluateRef);
10313
11178
  if (type === "treemap" || type === "sunburst") hierarchyView(chart, model, ctx.evaluateRef);
@@ -10316,23 +11181,31 @@ function chartSummaryView(chart, theme, options2 = {}) {
10316
11181
  chartExtraView(chart, model, ctx, total, collect);
10317
11182
  if (type === "waterfall") waterfallView(chart, model, ctx);
10318
11183
  else if (!byPoint) model.valueAxis = valueAxis(model);
10319
- applyDataLabels(model, chart.series, extra);
11184
+ applyDataLabels(model, chart.series, extra, ctx.drawingColor);
10320
11185
  chartExtraAxes(model);
10321
11186
  applyChartAxes(model, chart, ctx.drawingColor);
10322
11187
  return model;
10323
11188
  }
10324
11189
 
10325
11190
  // chart/render/chart-svg-cartesian.ts
10326
- function cartesianAxes(model, area, out) {
11191
+ function cartesianAxes(model, area, out, size) {
10327
11192
  const scale = model.valueAxis;
10328
11193
  if (!scale) return void 0;
11194
+ const table = chartTableMetrics(model);
11195
+ if (table)
11196
+ area = {
11197
+ ...area,
11198
+ x: Math.max(area.x, table.keyW + 8),
11199
+ w: Math.max(1, area.w - Math.max(0, table.keyW + 8 - area.x)),
11200
+ h: Math.max(1, area.h - table.height)
11201
+ };
10329
11202
  const labels2 = scale.ticks.map((t) => axisTickText(t, model.axes?.value, scale.percent));
10330
11203
  const valueAttrs = chartTextAttributes(model, "valueAxis");
10331
11204
  const categoryAttrs = chartTextAttributes(model, "categoryAxis");
10332
11205
  const valueSize = valueAttrs.size ?? 10;
10333
11206
  const categorySize = categoryAttrs.size ?? 10;
10334
11207
  const valueLabels = chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false;
10335
- const categoryLabels = chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
11208
+ const categoryLabels = !table && chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
10336
11209
  const labelW = valueLabels ? Math.max(...labels2.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
10337
11210
  const horizontal = model.horizontal;
10338
11211
  const cats = Math.max(1, model.categories.length);
@@ -10343,7 +11216,7 @@ function cartesianAxes(model, area, out) {
10343
11216
  const second = horizontal ? void 0 : model.secondaryAxis;
10344
11217
  const secondLabels = second?.ticks.map((t) => axisTickText(t, model.axes?.secondary, second.percent)) ?? [];
10345
11218
  const secondW = second ? valueLabels ? Math.max(...secondLabels.map((l) => textWidth(l, valueSize)), 8) + 8 : 4 : 0;
10346
- const plot = horizontal ? {
11219
+ const auto = horizontal ? {
10347
11220
  x: area.x + catW,
10348
11221
  y: area.y,
10349
11222
  w: Math.max(1, area.w - catW - 4),
@@ -10354,10 +11227,13 @@ function cartesianAxes(model, area, out) {
10354
11227
  w: Math.max(1, area.w - labelW - 4 - secondW),
10355
11228
  h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
10356
11229
  };
11230
+ const plot = chartPlotRect(model, auto, area, size);
10357
11231
  const value = horizontal ? (v) => plot.x + chartAxisRatio(v, scale, model.axes?.value) * plot.w : (v) => plot.y + plot.h - chartAxisRatio(v, scale, model.axes?.value) * plot.h;
10358
- const bandSize = (horizontal ? plot.h : plot.w) / cats;
11232
+ const dateMarkup = [];
11233
+ const dates = chartDateAxis(model, plot, dateMarkup);
11234
+ const bandSize = dates?.bandSize ?? (horizontal ? plot.h : plot.w) / cats;
10359
11235
  const index = (i) => model.axes?.category?.range.reverseOrder ? cats - 1 - i : i;
10360
- const band = horizontal ? (i) => plot.y + plot.h - bandSize * (index(i) + 0.5) : (i) => plot.x + bandSize * (index(i) + 0.5);
11236
+ const band = dates?.band ?? (horizontal ? (i) => plot.y + plot.h - bandSize * (index(i) + 0.5) : (i) => plot.x + bandSize * (index(i) + 0.5));
10361
11237
  out.push(chartAreaRect(model, "plotArea", plot));
10362
11238
  out.push(axisGridlines(model, model.axes?.value, scale.ticks, value, plot, horizontal));
10363
11239
  if (model.axes?.category?.source.majorGridlines || model.axes?.category?.source.minorGridlines)
@@ -10395,12 +11271,13 @@ function cartesianAxes(model, area, out) {
10395
11271
  out.push(
10396
11272
  axisLine(model, model.axes?.category, "categoryAxis", plot.x, zero, plot.x + plot.w, zero)
10397
11273
  );
11274
+ out.push(...dateMarkup);
10398
11275
  const step = Math.max(
10399
11276
  1,
10400
11277
  Math.ceil(cats / Math.max(1, Math.floor((horizontal ? plot.h : plot.w) / 14)))
10401
11278
  );
10402
11279
  model.categories.forEach((c2, i) => {
10403
- if (!categoryLabels || i % step !== 0) return;
11280
+ if (dates || !categoryLabels || i % step !== 0) return;
10404
11281
  const p = band(i);
10405
11282
  if (horizontal)
10406
11283
  out.push(
@@ -10417,7 +11294,7 @@ function cartesianAxes(model, area, out) {
10417
11294
  })
10418
11295
  );
10419
11296
  });
10420
- const frame = { plot, value, band, bandSize };
11297
+ const frame = { plot, value, band, bandSize, ...dates ? { order: dates.order } : {} };
10421
11298
  if (second) {
10422
11299
  frame.secondary = (v) => plot.y + plot.h - chartAxisRatio(v, second, model.axes?.secondary) * plot.h;
10423
11300
  out.push(
@@ -10464,7 +11341,7 @@ function linesAndAreas(model, frame, out) {
10464
11341
  model.series.forEach((s, si) => {
10465
11342
  const points2 = [];
10466
11343
  const lower = [];
10467
- model.categories.forEach((_, i) => {
11344
+ (frame.order ?? model.categories.map((_, i) => i)).forEach((i) => {
10468
11345
  const v = values[si]?.[i] ?? null;
10469
11346
  if (v === null && !area) {
10470
11347
  points2.push([NaN, NaN]);
@@ -10499,26 +11376,24 @@ function linesAndAreas(model, frame, out) {
10499
11376
  }
10500
11377
  let segment2 = [];
10501
11378
  const flush = () => {
10502
- if (segment2.length > 1)
10503
- out.push(
10504
- `<polyline points="${segment2.join(" ")}" fill="none" stroke="${color2}" stroke-width="2.25" stroke-linejoin="round"${filter}/>`
10505
- );
11379
+ out.push(chartLineSvg(segment2, series2));
10506
11380
  segment2 = [];
10507
11381
  };
10508
11382
  for (const [x, y] of points2) {
10509
11383
  if (Number.isNaN(x)) flush();
10510
- else segment2.push(`${n(x)},${n(y)}`);
11384
+ else segment2.push({ x, y });
10511
11385
  }
10512
11386
  flush();
10513
11387
  points2.forEach(([x, y], index) => {
10514
- if (!Number.isNaN(x)) out.push(chartSeriesMarkerSvg(series2, index, x, y, 2.5));
11388
+ if (!Number.isNaN(x))
11389
+ out.push(chartSeriesMarkerSvg(series2, frame.order?.[index] ?? index, x, y, 2.5));
10515
11390
  });
10516
11391
  }
10517
11392
  pointLabels(model, marks, out);
10518
11393
  }
10519
11394
 
10520
11395
  // chart/render/chart-svg-xy.ts
10521
- function scatter(model, area, out) {
11396
+ function scatter(model, area, out, size) {
10522
11397
  const ys = model.valueAxis;
10523
11398
  const xs = model.xAxis;
10524
11399
  if (!ys || !xs) return;
@@ -10531,18 +11406,19 @@ function scatter(model, area, out) {
10531
11406
  const valueLabels = chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false;
10532
11407
  const categoryLabels = chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
10533
11408
  const labelW = valueLabels ? Math.max(...yLabels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
10534
- const plot = {
11409
+ const auto = {
10535
11410
  x: area.x + labelW,
10536
11411
  y: area.y + 4,
10537
11412
  w: Math.max(1, area.w - labelW - 8),
10538
11413
  h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
10539
11414
  };
11415
+ const plot = chartPlotRect(model, auto, area, size);
10540
11416
  const bubble = model.type === "bubble" ? model.bubble : void 0;
10541
11417
  const biggest = maxBubbleSize(
10542
11418
  model.series.flatMap((s) => (s.sizes ?? []).filter((v) => v !== null))
10543
11419
  );
10544
11420
  const median = medianBubbleRadius(plot.w, plot.h);
10545
- const radiusOf = (size) => bubble && !(size !== void 0 && size < 0 && !bubble.showNegativeBubbles) ? computeBubbleRadius(size, biggest, median, bubble) : void 0;
11421
+ const radiusOf = (size2) => bubble && !(size2 !== void 0 && size2 < 0 && !bubble.showNegativeBubbles) ? computeBubbleRadius(size2, biggest, median, bubble) : void 0;
10546
11422
  let reach = 0;
10547
11423
  if (bubble)
10548
11424
  for (const s of model.series)
@@ -10551,11 +11427,11 @@ function scatter(model, area, out) {
10551
11427
  });
10552
11428
  const widen = (s, length, axis) => {
10553
11429
  if (axis?.range.logScale) return s;
10554
- const pad = reach * (s.max - s.min || 1) / Math.max(1, length - 2 * reach);
11430
+ const pad2 = reach * (s.max - s.min || 1) / Math.max(1, length - 2 * reach);
10555
11431
  return {
10556
11432
  ...s,
10557
- min: axis?.source.scaling.min === void 0 ? s.min - pad : s.min,
10558
- max: axis?.source.scaling.max === void 0 ? s.max + pad : s.max
11433
+ min: axis?.source.scaling.min === void 0 ? s.min - pad2 : s.min,
11434
+ max: axis?.source.scaling.max === void 0 ? s.max + pad2 : s.max
10559
11435
  };
10560
11436
  };
10561
11437
  const xView = widen(xs, plot.w, model.axes?.category);
@@ -10600,6 +11476,21 @@ function scatter(model, area, out) {
10600
11476
  out.push(
10601
11477
  axisLine(model, model.axes?.value, "valueAxis", plot.x, plot.y, plot.x, plot.y + plot.h)
10602
11478
  );
11479
+ if (!bubble)
11480
+ for (const series2 of model.series) {
11481
+ if (!series2.showLine) continue;
11482
+ let run2 = [];
11483
+ const flush = () => {
11484
+ out.push(chartLineSvg(run2, series2));
11485
+ run2 = [];
11486
+ };
11487
+ series2.values.forEach((value, i) => {
11488
+ const x = series2.xValues?.[i];
11489
+ if (value === null || x === null || x === void 0) flush();
11490
+ else run2.push({ x: px(x), y: py(value) });
11491
+ });
11492
+ flush();
11493
+ }
10603
11494
  const marks = [];
10604
11495
  for (const [si, s] of model.series.entries())
10605
11496
  s.values.forEach((v, i) => {
@@ -10731,14 +11622,19 @@ function clusterLayers(layers) {
10731
11622
  }
10732
11623
  return out;
10733
11624
  }
10734
- function cartesianSvg(model, area) {
11625
+ function cartesianSvg(model, area, size) {
10735
11626
  const out = [];
10736
11627
  if (model.type === "scatter" || model.type === "bubble") {
10737
- scatter(model, area, out);
11628
+ scatter(model, area, out, size);
10738
11629
  return out.join("");
10739
11630
  }
10740
- const frame = cartesianAxes(model, area, out);
11631
+ const frame = cartesianAxes(model, area, out, size);
10741
11632
  if (!frame) return "";
11633
+ out.push(chartDataTableSvg(model, frame.plot));
11634
+ if (model.type === "boxWhisker") {
11635
+ boxWhiskerSvg(model, frame, out);
11636
+ return out.join("");
11637
+ }
10742
11638
  if (model.type === "waterfall") {
10743
11639
  waterfallBars(model, frame, out);
10744
11640
  return out.join("");
@@ -10771,6 +11667,83 @@ function cartesianSvg(model, area) {
10771
11667
  return out.join("");
10772
11668
  }
10773
11669
 
11670
+ // chart/render/chart-svg-slice-labels.ts
11671
+ var GAP2 = 3;
11672
+ function sliceLabels(model, marks, out) {
11673
+ const items = [];
11674
+ for (const mark of marks) {
11675
+ const label = mark.series.labels?.[mark.index];
11676
+ if (!label) continue;
11677
+ const m = measure(model, label);
11678
+ const mid = (mark.start + mark.end) / 2;
11679
+ const ux = Math.sin(mid);
11680
+ const uy = -Math.cos(mid);
11681
+ const place = (radius) => [
11682
+ mark.cx + radius * ux,
11683
+ mark.cy + radius * uy
11684
+ ];
11685
+ const position = label.position ?? (model.type === "doughnut" ? "ctr" : "bestFit");
11686
+ let x;
11687
+ let y;
11688
+ if (position === "ctr") [x, y] = place(mark.inner + (mark.outer - mark.inner) / 2);
11689
+ else if (position === "inEnd") {
11690
+ const extent = Math.abs(ux) * m.w / 2 + Math.abs(uy) * m.h / 2;
11691
+ [x, y] = place(Math.max(0, mark.outer - GAP2 - extent));
11692
+ } else if (position === "outEnd") {
11693
+ const extent = Math.abs(ux) * m.w / 2 + Math.abs(uy) * m.h / 2;
11694
+ [x, y] = place(mark.outer + GAP2 + extent);
11695
+ } else {
11696
+ const placed = placeBestFitLabel(
11697
+ {
11698
+ cx: mark.cx,
11699
+ cy: mark.cy,
11700
+ outerR: mark.outer,
11701
+ startAngle: mark.start - Math.PI / 2,
11702
+ endAngle: mark.end - Math.PI / 2
11703
+ },
11704
+ m.w,
11705
+ m.h
11706
+ );
11707
+ x = placed.x;
11708
+ y = placed.y;
11709
+ }
11710
+ items.push({
11711
+ mark,
11712
+ label,
11713
+ m,
11714
+ x,
11715
+ y,
11716
+ outside: Math.hypot(x - mark.cx, y - mark.cy) > mark.outer
11717
+ });
11718
+ }
11719
+ const first2 = marks[0];
11720
+ if (!first2) return;
11721
+ const nudges = nudgeOutsideLabels(
11722
+ items.flatMap(
11723
+ (item, id) => item.outside && !item.label.layout ? [{ id, x: item.x, y: item.y, w: item.m.w, h: item.m.h }] : []
11724
+ ),
11725
+ { cx: first2.cx, cy: first2.cy, r: first2.outer },
11726
+ first2.cy - first2.outer,
11727
+ first2.cy + first2.outer
11728
+ );
11729
+ for (const [id, item] of items.entries()) {
11730
+ const { mark, label, m } = item;
11731
+ const nudge = nudges.find((n2) => n2.id === id);
11732
+ let point = { x: item.x + (nudge?.dx ?? 0), y: item.y + (nudge?.dy ?? 0) };
11733
+ if (model.frameSize) point = applyLabelManualLayout(label.layout, model.frameSize, point);
11734
+ const moved = point.x !== item.x || point.y !== item.y;
11735
+ if (label.showLeaderLines !== false && (item.outside || moved)) {
11736
+ const mid = (mark.start + mark.end) / 2;
11737
+ const stroke = label.leaderLine ?? { color: "#94a3b8", width: 0.75 };
11738
+ out.push(
11739
+ `<line x1="${n(mark.cx + mark.outer * Math.sin(mid))}" y1="${n(mark.cy - mark.outer * Math.cos(mid))}" x2="${n(point.x)}" y2="${n(point.y)}" ${strokeAttributes(stroke)} data-chart-part="leaderLine"/>`
11740
+ );
11741
+ }
11742
+ const { layout: _layout, ...fixed } = label;
11743
+ draw(m, fixed, point.x, point.y, "middle", out);
11744
+ }
11745
+ }
11746
+
10774
11747
  // chart/render/chart-svg-radial.ts
10775
11748
  var polar = (cx, cy, r, angle) => [
10776
11749
  cx + r * Math.sin(angle),
@@ -11253,9 +12226,9 @@ function chartRichTitleSvg(model, width, options2 = {}, frameHeight = 400) {
11253
12226
  ),
11254
12227
  { breakWords: true }
11255
12228
  );
11256
- const { spaceBefore, spaceAfter, ...properties2 } = line2;
12229
+ const { spaceBefore, spaceAfter, ...properties } = line2;
11257
12230
  return wrapped.map((runs, index) => ({
11258
- ...properties2,
12231
+ ...properties,
11259
12232
  runs,
11260
12233
  ...index === 0 && spaceBefore ? { spaceBefore } : {},
11261
12234
  ...index === wrapped.length - 1 && spaceAfter ? { spaceAfter } : {}
@@ -11342,7 +12315,7 @@ function chartRichTitleSvg(model, width, options2 = {}, frameHeight = 400) {
11342
12315
  // chart/render/chart-svg.ts
11343
12316
  function renderChartSvg(model, width, height, options2 = {}) {
11344
12317
  const paint2 = chartGradientPaint(model, Math.max(1, width), Math.max(1, height));
11345
- model = paint2.model;
12318
+ model = { ...paint2.model, frameSize: { width: Math.max(1, width), height: Math.max(1, height) } };
11346
12319
  const w = Math.max(1, width);
11347
12320
  const h = Math.max(1, height);
11348
12321
  const out = [];
@@ -11398,10 +12371,11 @@ function renderChartSvg(model, width, height, options2 = {}) {
11398
12371
  if (!legend.foreground) out.push(legend.markup);
11399
12372
  if (area.w > 4 && area.h > 4) {
11400
12373
  if (model.type === "pie" || model.type === "doughnut") out.push(pieSvg(model, area));
12374
+ else if (model.type === "funnel") out.push(funnelSvg(model, area));
11401
12375
  else if (model.type === "radar") out.push(radarSvg(model, area));
11402
12376
  else if (model.type === "treemap") out.push(treemapSvg(model, area));
11403
12377
  else if (model.type === "sunburst") out.push(sunburstSvg(model, area));
11404
- else out.push(cartesianSvg(model, area));
12378
+ else out.push(cartesianSvg(model, area, { width: w, height: h }));
11405
12379
  }
11406
12380
  if (legend.foreground) out.push(legend.markup);
11407
12381
  if (foregroundTitle) out.push(foregroundTitle);
@@ -11424,7 +12398,9 @@ var DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
11424
12398
  "bubble",
11425
12399
  "stock",
11426
12400
  "treemap",
11427
- "sunburst"
12401
+ "sunburst",
12402
+ "funnel",
12403
+ "boxWhisker"
11428
12404
  ]);
11429
12405
  function chartThemePalette(theme, fonts = {}) {
11430
12406
  return {
@@ -13381,7 +14357,7 @@ function setChartTypedCategories(space, values) {
13381
14357
  if (source?.levels) {
13382
14358
  if (Math.max(
13383
14359
  source.levelPointCount ?? 0,
13384
- ...source.levels.map((level2) => chartCacheValues(level2).length)
14360
+ ...source.levels.map((level3) => chartCacheValues(level3).length)
13385
14361
  ) !== values.length)
13386
14362
  throw new RangeError("Growing a hierarchy requires every category level.");
13387
14363
  const first2 = source.levels[0];
@@ -13396,7 +14372,7 @@ function setChartTypedCategories(space, values) {
13396
14372
  });
13397
14373
  }
13398
14374
  function setChartCategoryLevels(space, levels) {
13399
- if (!levels.length || levels.some((level2) => level2.length !== levels[0].length))
14375
+ if (!levels.length || levels.some((level3) => level3.length !== levels[0].length))
13400
14376
  throw new RangeError("Category levels must have matching lengths.");
13401
14377
  return editChartSpace(space, (draft) => {
13402
14378
  for (const { group: group2, series: series2 } of chartSeriesEntries(draft)) {
@@ -14887,15 +15863,14 @@ function applyChartExEditIntent(space, intent) {
14887
15863
 
14888
15864
  // chart/edit/chartex-axis.ts
14889
15865
  function editChartExAxis(space, index, edit) {
14890
- if (!Number.isSafeInteger(index) || !space.plotArea.axes[index])
14891
- throw new RangeError("No ChartEx axis at index.");
15866
+ chartExAxisAt(space, index);
14892
15867
  for (const key of ["min", "max", "majorUnit", "minorUnit"]) {
14893
15868
  const value = edit[key];
14894
15869
  if (value !== void 0 && value !== null && (!Number.isFinite(value) || (key === "majorUnit" || key === "minorUnit") && value <= 0))
14895
15870
  throw new RangeError("Invalid ChartEx axis scaling.");
14896
15871
  }
14897
15872
  return editChartExSpace(space, (draft) => {
14898
- const axis = draft.plotArea.axes[index];
15873
+ const axis = chartExAxisAt(draft, index);
14899
15874
  for (const key of ["min", "max", "majorUnit", "minorUnit"])
14900
15875
  if (edit[key] !== void 0) {
14901
15876
  if (axis.scaling?.kind !== "val")
@@ -15053,8 +16028,7 @@ function applyChartExEditAction(space, action) {
15053
16028
  return setChartExAxis(space, action.axisIndex, action.edit);
15054
16029
  case "tickLabels":
15055
16030
  return editChartExSpace(space, (draft) => {
15056
- const axis = draft.plotArea.axes[action.axisIndex];
15057
- if (!axis) throw new RangeError("No chart axis at index.");
16031
+ const axis = chartExAxisAt(draft, action.axisIndex);
15058
16032
  if (action.visible) axis.tickLabels ??= {};
15059
16033
  else delete axis.tickLabels;
15060
16034
  });
@@ -15581,13 +16555,13 @@ function chartSpaceWorkbookWrites(space) {
15581
16555
  // chart/workbook/rebase-data.ts
15582
16556
  function rebaseChartData(space, sheetName) {
15583
16557
  const next = structuredClone(space);
15584
- const rows = [[]];
16558
+ const rows2 = [[]];
15585
16559
  let column = 0;
15586
16560
  const ref = (col, row) => formatCellAddress({ col, row }).replace(/^([A-Z]+)(\d+)$/u, "$$$1$$$2");
15587
16561
  const formula2 = (from, to, count, row = 1) => `${quoteChartSheetName(sheetName)}!${ref(from, row)}:${ref(to, row + Math.max(1, count) - 1)}`;
15588
16562
  const vector = (cache, heading) => {
15589
16563
  const col = column++;
15590
- rows[0][col] = heading;
16564
+ rows2[0][col] = heading;
15591
16565
  let count = cache.pointCount ?? 0;
15592
16566
  for (const [at, point] of cache.points.entries()) {
15593
16567
  const index = point.index ?? at;
@@ -15598,11 +16572,11 @@ function rebaseChartData(space, sheetName) {
15598
16572
  const value = cache.type === "number" && text2.trim() !== "" ? Number(text2) : text2;
15599
16573
  if (typeof value === "number" && !Number.isFinite(value))
15600
16574
  throw new RangeError("Invalid chart number");
15601
- (rows[index + 1] ??= [])[col] = text2 === "" ? null : value;
16575
+ (rows2[index + 1] ??= [])[col] = text2 === "" ? null : value;
15602
16576
  }
15603
16577
  if (count > 1048575 || column > 16384)
15604
16578
  throw new RangeError("Chart data exceeds worksheet bounds");
15605
- for (let i = 1; i <= Math.max(1, count); i++) (rows[i] ??= [])[col] ??= null;
16579
+ for (let i = 1; i <= Math.max(1, count); i++) (rows2[i] ??= [])[col] ??= null;
15606
16580
  return { col, count };
15607
16581
  };
15608
16582
  const source = (data, heading) => {
@@ -15639,8 +16613,8 @@ function rebaseChartData(space, sheetName) {
15639
16613
  };
15640
16614
  source(series2.bubbleSizes, `${name} Size`);
15641
16615
  }
15642
- for (const row of rows) for (let col = 0; col < column; col++) row[col] ??= null;
15643
- return { chartSpace: next, rows };
16616
+ for (const row of rows2) for (let col = 0; col < column; col++) row[col] ??= null;
16617
+ return { chartSpace: next, rows: rows2 };
15644
16618
  }
15645
16619
 
15646
- export { BEST_FIT_EDGE_TOLERANCE, BEST_FIT_OUTSIDE_GAP, BEST_FIT_RIM_INSET, CHART_AUTO_TITLE, CHART_COLOR_PALETTES, CHART_COLOR_STYLE_CONTENT_TYPE, CHART_COLOR_STYLE_NS, CHART_COLOR_STYLE_REL, CHART_ELEMENT_PARTS, CHART_ERROR_BAR_DIRECTIONS, CHART_ERROR_BAR_TYPES, CHART_ERROR_VALUE_TYPES, CHART_EX_LAYOUTS, CHART_EX_ROOT_DECLARATIONS, CHART_GROUP_ELEMENTS, GROUP_FIELDS as CHART_GROUP_FIELDS, CHART_MARKER_SYMBOLS, CHART_QUICK_LAYOUTS, CHART_QUICK_LAYOUT_AXIS_TITLE, CHART_QUICK_LAYOUT_KINDS, CHART_STYLE_PARTS, CHART_STYLE_PRESETS, DATA_LABEL_CATEGORY_PERCENT_SEPARATOR, DATA_LABEL_SEPARATOR, DEFAULT_BAR_GAP_WIDTH, DEFAULT_CHART_AXIS_IDS, DEFAULT_CHART_DATA_SHEET, DEFAULT_CHART_PALETTE, DEFAULT_CHART_SHEET_NAME, DEFAULT_THEME_COLORS, DRAWN_CHART_TYPES, LABEL_COLLISION_GAP, STOCK_DEFAULT_DOWN_FILL, STOCK_DEFAULT_UP_FILL, STOCK_DEFAULT_WICK_COLOR, STOCK_TICK_WIDTH, THEME_SLOTS, addChartCategory, addChartExSeries, addChartSeries, aggregate, aggregateByCategory, appendChartExWorkbookData, appendChartWorkbookSheet, applyCellWritesToWorksheet, applyChartAppearance, applyChartColorPalette, applyChartDataSheetEdit, applyChartDataSheetEdits, applyChartEditIntent, applyChartExAppearance, applyChartExEditAction, applyChartExEditIntent, applyChartExSpaceDataSheetEdits, applyChartQuickLayout, applyChartSpaceDataSheetEdits, applyChartStylePreset, applyStandardChartLayout, assertBarClusterOptions, assertChartPercent, assignOrDelete, autoSeriesColor, automaticMarkerSymbol, axisTargetIntervals, buildChartGradientDef, buildHierarchyRoots, buildMarkerPrimitive, buildWaterfallSteps, builtInChartStyleXml, builtInChartTextStyle, canApplyChartDataSheetEdit, categorySource, categoryTotals, chartAxisAt, chartCacheValues, chartColorScheme, chartColorStyleId, chartColorStyleXml, chartDataLabelsRange, chartDataSheetCellEdit, chartDataSheetPasteEdits, chartDataWorksheetXml, chartDrawingColorFromHex, chartDrawingGradientFrom, chartEffectEditsFromAppearance, chartElementShape, chartErrorBarAmount, chartExDataChanged, chartExDataLayout, chartExLevelValues, chartExLocalRange, chartExSeriesAt, chartExSeriesData, chartExSeriesDimension, chartExSpaceDataSheet, chartExSpaceWorkbookWrites, chartExStyleSpace, chartExSummary, chartExSummaryFromModel, chartExValueType, chartExWriteOptionsOf, chartFillFromAppearance, chartFormatTargetKey, chartGradientMarkup, chartGradientStopTransparency, groupHasAxes as chartGroupHasAxes, chartGroupPaintsLine, chartIssuesLostOnWrite, chartLineDashArray, chartLineFromAppearance, chartMarkerRadius, chartPaletteColors, chartPaletteSeriesColor, chartPaletteSeriesColorChoice, chartPointsToEmu, chartQuickLayoutOf, chartSampleVariance, chartSeriesAnalysisSupported, chartSeriesEntries, chartSeriesEntryAt, stripSeriesForKind as chartSeriesForKind, chartSeriesMarkerSvg, chartSeriesMarkersSupported, chartSeriesOnSecondaryAxis, chartSeriesSecondaryAxisSupported, chartSourceValues, chartSpaceDataSheet, chartSpaceKind, chartSpaceSeries, chartSpaceWorkbookWrites, chartStylePresetOfColors, chartSummaryFromSpace, chartSummarySeries, chartSummaryView, chartSupportsQuickLayout, chartTargetDraftShapes, chartTargetEffects, chartTargetHasText, chartTargetShape, chartTargetTextFormatting, chartTargetThreeD, chartTextBodyElement, chartTextEditsFromAppearance, chartThemePalette, chartThreeDFromAppearance, chartTitleRichXml, chartTitleWithText, chartTrendlineKind, chartTrendlineType, chartWorkbookRowsXml, clearChartAreaPaint, clusteredBarGeometry, columnIndexToLetter, columnLetterToIndex, composeDataLabelText, computeAxisStackedValueRange, computeAxisValueRange, computeBoxStats, computeBubbleRadius, computeHierarchicalSunburstArcs, computeHistogramBins, computeLinearRegression, computeLogValueRange, computeRSquared, computeRadarPoints, computeStackedSeriesPlots, computeStackedValueRangeForAxis, computeSunburstArcs, computeValueRangeForAxis, computeValueRangeForChart, computeWaterfallRange, convertChartAxis, createChartExSpace, createChartWorkbook, defaultChartAxes, drawingColorAlphaTransforms, drawingColorTransparency, editChartEffectList, editChartElementGradient, editChartExAxis, editChartExLabels, editChartExPointLabel, editChartExSpace, editChartExStyle, editChartGradientFill, editChartLayout, editChartLine, editChartSeriesGradient, editChartShapeProperties, editChartShapeXml, editChartSpace, editChartTextBody, editChartTextRunProperties, effectiveBuiltInChartStyle, expandRangeAddresses, findChartColorPalette, findChartQuickLayout, findChartStylePreset, findLogAxis, firstChartGroup, fitChartTrendline, fitPolynomial, formatCellAddress, formatChartNumber, formatChartNumberWithColor, formatCompactAxisValue, formatExponentialEquation, formatLinearEquation, formatLogarithmicEquation, formatPolynomialEquation, formatPowerEquation, formatTrendlineCoefficient, generateAxisTicks, generateLogTicks, generateMinorAxisTicks, getChartStylePalette, groupRowsByCategory, hasManualLayoutFields, hierarchyBranchLabels, hydrateChartExSpace, impliesAutoTitle, isChartExRoot, isChartexOnlyType, isEmbeddedXlsxPart, isXYChartKind, layoutTreemap, markerOutline, markerRadius, maxBubbleSize, medianBubbleRadius, modulateLuminance, moveChartSeries, newChartSpace, newChartTitle, nextChartCategoryName, nextChartSeriesName, niceAxisStep, niceValueAxisBounds, normalizeLevels, nudgeOutsideLabels, numberSource, openEmbeddedPackage, parseCellAddress, parseChartExSpace, parseChartFormatTargetKey, parseChartFormulaRange, parseChartSpace, patchChartFormulas, placeBestFitLabel, quoteChartSheetName, radarAngle, radarRingPoints, readBuiltInChartStyle, readChartFormatting, readChartManualLayoutValues, readChartStyle, readDisplayNaAsBlank, rebaseChartData, recolorPaletteGradient, removeChartCategory, removeChartExSeries, removeChartSeries, removeGradientStop, renameChartExSeries, renameChartSeries, renderChartSpaceSvg, renderChartSummarySvg, renderChartSvg, repaintSeriesForFamily, resolveAutoTitleText, resolveBlankDisplay, resolveChartGradient, resolveChartStyleDefinition, resolveDataLabelFlags, resolveManualLayoutRect, retextChartTextBody, rotatedAxisPosition, sameChartColors, sameDrawingColor, saveChartWorkbookUpdates, scottBinCount, seriesMarkerViews, setChartAxis, setChartAxisTitleText, setChartCategories, setChartCategoryLevels, setChartChrome, setChartDataLabelFormatting, setChartDataLabels, setChartDataLabelsRange, setChartDataPointFill, setChartDataPointValue, setChartDataTable, setChartDisplayUnitsLabel, setChartElementFill, setChartElementLine, setChartErrorBars, setChartExAxis, setChartExBinning, setChartExBoxWhisker, setChartExCategories, setChartExDataLabelsVisible, setChartExLayout, setChartExLegend, setChartExParentLabelLayout, setChartExPointLabel, setChartExSeriesFill, setChartExSeriesValues, setChartExTitle, setChartExWaterfall, setChartGridlineShape, setChartGroupDecorations, setChartGroupOptions, setChartGrouping, setChartLayout, setChartLegend, setChartLegendEntries, setChartMarker, setChartNumericCategories, setChartPointLabel, setChartPointOptions, setChartProtection, setChartSeriesAxis, setChartSeriesBubbleSizes, setChartSeriesColor, setChartSeriesFill, setChartSeriesLine, setChartSeriesOptions, setChartSeriesSecondaryAxis, setChartSeriesTransparency, setChartSeriesType, setChartSeriesValues, setChartSeriesXValues, setChartStyle, setChartSurface, setChartTargetEffect, setChartTargetFill, setChartTargetLine, setChartTargetLineOptions, setChartTargetPattern, setChartTargetText, setChartTargetThreeD, setChartTargetTransparency, setChartTitle, setChartTitleOverlay, setChartTitleRuns, setChartTitleVisible, setChartTrendline, setChartType, setChartTypedCategories, setChartView3D, shade, sharedStringTexts, sortGradientStops, squarify, standardChartFormulas, standardChartLayoutSheet, stockCandle, stockSlots, summaryMarkers, sunburstArcPath, syncWorksheetTables, themeColor, tint, updateGradientStop, validateAtomicChartWorkbookWrites, validateChartTextEdit, valueToYLog, visibleRuns, withAlphaOf, withAxisBounds, withChartGradientDirection, withDrawingColorTransparency, withUnmodelledChartChildren, withinLinearTransform, worksheetPathsByName, writeChartAxisFormatting, writeChartExSpace, writeChartExSpaceOverSource, writeChartFillFormatting, writeChartLayoutFormatting, writeChartSpace, writeChartSpaceOverSource, writeChartWorkbookUpdates };
16620
+ export { BEST_FIT_EDGE_TOLERANCE, BEST_FIT_OUTSIDE_GAP, BEST_FIT_RIM_INSET, CHART_AUTO_TITLE, CHART_COLOR_PALETTES, CHART_COLOR_STYLE_CONTENT_TYPE, CHART_COLOR_STYLE_NS, CHART_COLOR_STYLE_REL, CHART_ELEMENT_PARTS, CHART_ERROR_BAR_DIRECTIONS, CHART_ERROR_BAR_TYPES, CHART_ERROR_VALUE_TYPES, CHART_EX_LAYOUTS, CHART_EX_ROOT_DECLARATIONS, CHART_GROUP_ELEMENTS, GROUP_FIELDS as CHART_GROUP_FIELDS, CHART_MARKER_SYMBOLS, CHART_QUICK_LAYOUTS, CHART_QUICK_LAYOUT_AXIS_TITLE, CHART_QUICK_LAYOUT_KINDS, CHART_STYLE_PARTS, CHART_STYLE_PRESETS, DATA_LABEL_CATEGORY_PERCENT_SEPARATOR, DATA_LABEL_SEPARATOR, DEFAULT_BAR_GAP_WIDTH, DEFAULT_CHART_AXIS_IDS, DEFAULT_CHART_DATA_SHEET, DEFAULT_CHART_PALETTE, DEFAULT_CHART_SHEET_NAME, DEFAULT_THEME_COLORS, DRAWN_CHART_TYPES, LABEL_COLLISION_GAP, STOCK_DEFAULT_DOWN_FILL, STOCK_DEFAULT_UP_FILL, STOCK_DEFAULT_WICK_COLOR, STOCK_TICK_WIDTH, THEME_SLOTS, addChartCategory, addChartExSeries, addChartSeries, aggregate, aggregateByCategory, appendChartExWorkbookData, appendChartWorkbookSheet, applyCellWritesToWorksheet, applyChartAppearance, applyChartColorPalette, applyChartDataSheetEdit, applyChartDataSheetEdits, applyChartEditIntent, applyChartExAppearance, applyChartExEditAction, applyChartExEditIntent, applyChartExSpaceDataSheetEdits, applyChartQuickLayout, applyChartSpaceDataSheetEdits, applyChartStylePreset, applyLabelManualLayout, applyStandardChartLayout, assertBarClusterOptions, assertChartPercent, assignOrDelete, autoSeriesColor, automaticMarkerSymbol, axisTargetIntervals, boxMeanMarkerPath, boxWhiskerDistribution, buildChartGradientDef, buildHierarchyRoots, buildMarkerPrimitive, buildWaterfallSteps, builtInChartStyleXml, builtInChartTextStyle, calendarTicks, canApplyChartDataSheetEdit, categorySource, categoryTotals, chartAxisAt, chartCacheValues, chartColorScheme, chartColorStyleId, chartColorStyleXml, chartDataLabelsRange, chartDataSheetCellEdit, chartDataSheetPasteEdits, chartDataTableMetrics, chartDataWorksheetXml, chartDrawingColorFromHex, chartDrawingGradientFrom, chartEffectEditsFromAppearance, chartElementShape, chartErrorBarAmount, chartExAxisAt, chartExDataChanged, chartExDataLayout, chartExLevelValues, chartExLocalRange, chartExSeriesAt, chartExSeriesData, chartExSeriesDimension, chartExSpaceDataSheet, chartExSpaceWorkbookWrites, chartExStyleSpace, chartExSummary, chartExSummaryFromModel, chartExValueType, chartExWriteOptionsOf, chartFillFromAppearance, chartFormatTargetKey, chartGradientMarkup, chartGradientStopTransparency, groupHasAxes as chartGroupHasAxes, chartGroupPaintsLine, chartIssuesLostOnWrite, chartLineDashArray, chartLineFromAppearance, chartMarkerRadius, chartPaletteColors, chartPaletteSeriesColor, chartPaletteSeriesColorChoice, chartPointsToEmu, chartQuickLayoutOf, chartSampleVariance, chartSeriesAnalysisSupported, chartSeriesEntries, chartSeriesEntryAt, stripSeriesForKind as chartSeriesForKind, chartSeriesMarkerSvg, chartSeriesMarkersSupported, chartSeriesOnSecondaryAxis, chartSeriesSecondaryAxisSupported, chartSourceValues, chartSpaceDataSheet, chartSpaceKind, chartSpaceSeries, chartSpaceWorkbookWrites, chartStylePresetOfColors, chartSummaryFromSpace, chartSummarySeries, chartSummaryView, chartSupportsQuickLayout, chartTargetDraftShapes, chartTargetEffects, chartTargetHasText, chartTargetShape, chartTargetTextFormatting, chartTargetThreeD, chartTextBodyElement, chartTextEditsFromAppearance, chartThemePalette, chartThreeDFromAppearance, chartTitleRichXml, chartTitleWithText, chartTrendlineKind, chartTrendlineType, chartWorkbookRowsXml, clearChartAreaPaint, clusteredBarGeometry, columnIndexToLetter, columnLetterToIndex, composeDataLabelText, computeAxisStackedValueRange, computeAxisValueRange, computeBoxStats, computeBubbleRadius, computeFunnelGeometry, computeHierarchicalSunburstArcs, computeHistogramBins, computeLinearRegression, computeLogValueRange, computeRSquared, computeRadarPoints, computeStackedSeriesPlots, computeStackedValueRangeForAxis, computeSunburstArcs, computeValueRangeForAxis, computeValueRangeForChart, computeWaterfallRange, convertChartAxis, createChartExSpace, createChartWorkbook, defaultChartAxes, drawingColorAlphaTransforms, drawingColorTransparency, editChartEffectList, editChartElementGradient, editChartExAxis, editChartExLabels, editChartExPointLabel, editChartExSpace, editChartExStyle, editChartGradientFill, editChartLayout, editChartLine, editChartSeriesGradient, editChartShapeProperties, editChartShapeXml, editChartSpace, editChartTextBody, editChartTextRunProperties, effectiveBuiltInChartStyle, excelSerialToDate, expandRangeAddresses, findChartColorPalette, findChartQuickLayout, findChartStylePreset, findLogAxis, firstChartGroup, fitChartTrendline, fitPolynomial, formatCellAddress, formatChartNumber, formatChartNumberWithColor, formatCompactAxisValue, formatDate, formatExponentialEquation, formatLinearEquation, formatLogarithmicEquation, formatPolynomialEquation, formatPowerEquation, formatTrendlineCoefficient, generateAxisTicks, generateLogTicks, generateMinorAxisTicks, getChartStylePalette, groupRowsByCategory, hasManualLayoutFields, hierarchyBranchLabels, hydrateChartExSpace, impliesAutoTitle, isChartExRoot, isChartexOnlyType, isEmbeddedXlsxPart, isXYChartKind, layoutTreemap, markerOutline, markerRadius, maxBubbleSize, medianBubbleRadius, modulateLuminance, moveChartSeries, newChartSpace, newChartTitle, nextChartCategoryName, nextChartSeriesName, niceAxisStep, niceValueAxisBounds, normalizeLevels, nudgeOutsideLabels, numberSource, openEmbeddedPackage, parseCellAddress, parseChartExSpace, parseChartFormatTargetKey, parseChartFormulaRange, parseChartSpace, patchChartFormulas, placeBestFitLabel, polylineRunsPath, quoteChartSheetName, radarAngle, radarRingPoints, readBuiltInChartStyle, readChartFormatting, readChartManualLayoutValues, readChartStyle, readDisplayNaAsBlank, rebaseChartData, recolorPaletteGradient, removeChartCategory, removeChartExSeries, removeChartSeries, removeGradientStop, renameChartExSeries, renameChartSeries, renderChartSpaceSvg, renderChartSummarySvg, renderChartSvg, renderExcelDateFormat, repaintSeriesForFamily, resolveAutoTitleText, resolveBlankDisplay, resolveChartGradient, resolveChartStyleDefinition, resolveDataLabelFlags, resolveManualLayoutRect, resolveManualPlotRect, retextChartTextBody, rotatedAxisPosition, sameChartColors, sameDrawingColor, sampleSmoothLine, saveChartWorkbookUpdates, scottBinCount, seriesMarkerViews, setChartAxis, setChartAxisTitleText, setChartCategories, setChartCategoryLevels, setChartChrome, setChartDataLabelFormatting, setChartDataLabels, setChartDataLabelsRange, setChartDataPointFill, setChartDataPointValue, setChartDataTable, setChartDisplayUnitsLabel, setChartElementFill, setChartElementLine, setChartErrorBars, setChartExAxis, setChartExBinning, setChartExBoxWhisker, setChartExCategories, setChartExDataLabelsVisible, setChartExLayout, setChartExLegend, setChartExParentLabelLayout, setChartExPointLabel, setChartExSeriesFill, setChartExSeriesValues, setChartExTitle, setChartExWaterfall, setChartGridlineShape, setChartGroupDecorations, setChartGroupOptions, setChartGrouping, setChartLayout, setChartLegend, setChartLegendEntries, setChartMarker, setChartNumericCategories, setChartPointLabel, setChartPointOptions, setChartProtection, setChartSeriesAxis, setChartSeriesBubbleSizes, setChartSeriesColor, setChartSeriesFill, setChartSeriesLine, setChartSeriesOptions, setChartSeriesSecondaryAxis, setChartSeriesTransparency, setChartSeriesType, setChartSeriesValues, setChartSeriesXValues, setChartStyle, setChartSurface, setChartTargetEffect, setChartTargetFill, setChartTargetLine, setChartTargetLineOptions, setChartTargetPattern, setChartTargetText, setChartTargetThreeD, setChartTargetTransparency, setChartTitle, setChartTitleOverlay, setChartTitleRuns, setChartTitleVisible, setChartTrendline, setChartType, setChartTypedCategories, setChartView3D, shade, sharedStringTexts, smoothLinePath, sortGradientStops, squarify, standardChartFormulas, standardChartLayoutSheet, stockCandle, stockSlots, summaryMarkers, sunburstArcPath, syncWorksheetTables, themeColor, tint, updateGradientStop, validateAtomicChartWorkbookWrites, validateChartTextEdit, valueToYLog, visibleRuns, withAlphaOf, withAxisBounds, withChartGradientDirection, withDrawingColorTransparency, withUnmodelledChartChildren, withinLinearTransform, worksheetPathsByName, writeChartAxisFormatting, writeChartExSpace, writeChartExSpaceOverSource, writeChartFillFormatting, writeChartLayoutFormatting, writeChartSpace, writeChartSpaceOverSource, writeChartWorkbookUpdates };