@silurus/ooxml 0.87.0 → 0.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +118 -23
  2. package/THIRD_PARTY_NOTICES.md +7 -6
  3. package/dist/abort-VrnK7mdP.js +10 -0
  4. package/dist/assets/render-worker-CUOU6mL2.js +16 -0
  5. package/dist/assets/render-worker-DOqrFhSU.js +15 -0
  6. package/dist/assets/render-worker-DvWUdZUN.js +35 -0
  7. package/dist/bounded-raw-part-cache-B7JoC1CD.js +64586 -0
  8. package/dist/bundled-asset-url-E2nXURF9.js +15 -0
  9. package/dist/canvas-viewer-mechanics-DfQqRKkD.js +675 -0
  10. package/dist/cfb-guard-9QTRTg7f.js +528 -0
  11. package/dist/chart-ex.mjs +708 -739
  12. package/dist/comment-overlay-controller-B5_zGgG5.js +994 -0
  13. package/dist/comment-ui-runtime-B7ZvovcS.js +2 -0
  14. package/dist/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-D_sb2K6s.js} +5 -5
  15. package/dist/{comment-ui-runtime-BfE7MJZn.js → comment-ui-runtime-Jy-3goA9.js} +5 -5
  16. package/dist/delimited-text-worker-host-CikWU6_m.js +27 -0
  17. package/dist/document-model-source-BKNrXjAL.js +249 -0
  18. package/dist/document-pull-client-CxONDGbk.js +37833 -0
  19. package/dist/document-pull-worker-AMyXYpPq.js +104 -0
  20. package/dist/docx-D91ER1_S.js +495 -0
  21. package/dist/docx-DhDnKEI6.js +3563 -0
  22. package/dist/docx-model-source-CdrSt3hF.js +98 -0
  23. package/dist/docx-source-worker.mjs +455 -0
  24. package/dist/docx.mjs +7 -7
  25. package/dist/docx_parser_bg.wasm +0 -0
  26. package/dist/drawingml-shape-ChcGZNd8.js +310 -0
  27. package/dist/duotone-ekYik4ix.js +126 -0
  28. package/dist/emf-UT6I8rVi.js +1790 -0
  29. package/dist/font-preload-demand-CdJZUMCT.js +2058 -0
  30. package/dist/grid-geometry-uQOgViJU.js +384 -0
  31. package/dist/host-layout-DVMw8hDY.js +56 -0
  32. package/dist/host-layout-measure-CCEgaC_v.js +7 -0
  33. package/dist/in-process-pull-transport-DuXcPZng.js +29 -0
  34. package/dist/index.mjs +4 -4
  35. package/dist/internal-companion.mjs +12 -0
  36. package/dist/line-distribute-CPOV6csk.js +2716 -0
  37. package/dist/math.mjs +2 -2
  38. package/dist/mathjax-stix2.js +10 -10
  39. package/dist/model-source-DJGzDtGb.js +61 -0
  40. package/dist/model-source-kz_NkZqT.js +179 -0
  41. package/dist/model-source-session-Bu9CHFHc.js +71 -0
  42. package/dist/model-source-session-CDuijwv1.js +85 -0
  43. package/dist/model-source-session-sKpNiIJI.js +58 -0
  44. package/dist/node.mjs +7 -1327
  45. package/dist/{pixel-budget-Dgjw269h.js → pixel-budget-BpTYrepD.js} +13 -10
  46. package/dist/plot-area-frame-CaJFvZ7p.js +8502 -0
  47. package/dist/pptx-CDP9dZHe.js +2936 -0
  48. package/dist/pptx-C_uxLVKB.js +183 -0
  49. package/dist/pptx-model-source-O7LhpOjz.js +37 -0
  50. package/dist/pptx-source-worker.mjs +446 -0
  51. package/dist/pptx.mjs +8 -7
  52. package/dist/pptx_parser_bg.wasm +0 -0
  53. package/dist/presentation-model-source-tmROzteR.js +77 -0
  54. package/dist/raster-target-YQ4G6rxo.js +42 -0
  55. package/dist/region-map.mjs +114 -150
  56. package/dist/{render-8Zo7dnds.js → render-CJVglUHl.js} +3 -3
  57. package/dist/{render-worker-host-BfbnEChF.js → render-worker-host-BseIaVvm.js} +1 -1
  58. package/dist/{render-worker-host-DNL9dWRh.js → render-worker-host-CyxPU4JU.js} +1 -1
  59. package/dist/{render-worker-host-IkHrYOci.js → render-worker-host-aF6aWkC0.js} +1 -1
  60. package/dist/renderer-CkGLj0CC.js +5170 -0
  61. package/dist/renderer-Czw1cCC7.js +5823 -0
  62. package/dist/resource-measurement-mXw-WjMF.js +771 -0
  63. package/dist/session-Csv9maad.js +656 -0
  64. package/dist/slide-pull-client-DRZYwBTu.js +6515 -0
  65. package/dist/three-d-BK5siJgJ.js +878 -0
  66. package/dist/three-d.mjs +871 -764
  67. package/dist/{raster-target-ojDdQizC.js → tiff-contract-C6M3QcPp.js} +1 -42
  68. package/dist/tiff.mjs +401 -248
  69. package/dist/types/chart-ex.d.ts +289 -4
  70. package/dist/types/docx.d.ts +473 -98
  71. package/dist/types/index.d.ts +674 -303
  72. package/dist/types/internal-companion.d.ts +11 -0
  73. package/dist/types/math.d.ts +1 -1
  74. package/dist/types/node.d.ts +530 -11
  75. package/dist/types/pptx.d.ts +410 -97
  76. package/dist/types/region-map.d.ts +289 -4
  77. package/dist/types/three-d.d.ts +289 -4
  78. package/dist/types/tiff.d.ts +1 -1
  79. package/dist/types/xlsx.d.ts +483 -134
  80. package/dist/wasm-loader-rlgHmcSv.js +35 -0
  81. package/dist/wasm-runtime-generation-DX4y0Ecl.js +97 -0
  82. package/dist/workbook-model-source-BTC4ISTS.js +94 -0
  83. package/dist/worker-source-I1cIYBel.js +22 -0
  84. package/dist/worker-source-SbudzjYL.js +22 -0
  85. package/dist/worker-source-UAi3GNcM.js +22 -0
  86. package/dist/worksheet-pull-client-CkHgbtyM.js +579 -0
  87. package/dist/xlsx-CpSDPAEU.js +5809 -0
  88. package/dist/xlsx-D5569TPf.js +534 -0
  89. package/dist/xlsx-model-source-DPSkjFic.js +309 -0
  90. package/dist/xlsx-source-worker.mjs +525 -0
  91. package/dist/xlsx.mjs +8 -7
  92. package/dist/xlsx_parser_bg.wasm +0 -0
  93. package/package.json +42 -16
  94. package/dist/assets/render-worker-CeK_iqK3.js +0 -10
  95. package/dist/assets/render-worker-DusrDhPk.js +0 -11
  96. package/dist/assets/render-worker-n2ZG0lrQ.js +0 -31
  97. package/dist/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
  98. package/dist/canvas-viewer-mechanics-Cpk0YFvM.js +0 -1384
  99. package/dist/cjk-fallback-bLI3z70h.js +0 -46
  100. package/dist/comment-occurrence-C8Y2uoVr.js +0 -6
  101. package/dist/comment-ui-runtime-BsK8pmUT.js +0 -2
  102. package/dist/comments-Diid5ujN.js +0 -246
  103. package/dist/delimited-text-worker-host-BVY-Ecni.js +0 -27
  104. package/dist/document-pull-client-yKxI8aDH.js +0 -27251
  105. package/dist/docx-BkSRiy07.js +0 -2995
  106. package/dist/dom-interaction-boundary-CBUQJsIM.js +0 -223
  107. package/dist/highlight-rect-C5hkRqUr.js +0 -13
  108. package/dist/hyperlink-ArrU3ArU.js +0 -36447
  109. package/dist/line-distribute-Dtudnqhs.js +0 -1023
  110. package/dist/line-metrics-B60C86uh.js +0 -60
  111. package/dist/plot-area-frame-D5hEOgkJ.js +0 -2903
  112. package/dist/pptx-62MmVbYB.js +0 -3063
  113. package/dist/renderer-XFSCOT6m.js +0 -5857
  114. package/dist/resource-measurement-CJsgolre.js +0 -150
  115. package/dist/session-CrU8f8DI.js +0 -743
  116. package/dist/slide-pull-client-B9KA8bU6.js +0 -6253
  117. package/dist/source-key-DIJG8BA0.js +0 -42
  118. package/dist/three-d-YYghQndN.js +0 -1346
  119. package/dist/transfer-p6iCC2R7.js +0 -6
  120. package/dist/units-EJdC96r6.js +0 -4
  121. package/dist/worksheet-pull-client-eIcQ-xlD.js +0 -458
  122. package/dist/xlsx-CRcSzZNq.js +0 -8482
  123. /package/dist/{chunk-DmhlhrBa.js → chunk-Dy4uBu1J.js} +0 -0
  124. /package/dist/{mathjax-DoyWZbSp.js → mathjax-BhwN6ilc.js} +0 -0
  125. /package/dist/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-PidH0wnP.js} +0 -0
  126. /package/dist/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-B52rDVKo.js} +0 -0
  127. /package/dist/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-CWM7jv6d.js} +0 -0
  128. /package/dist/{visible-index-BgiHEc1z.js → visible-index-FeVA0mGE.js} +0 -0
package/dist/chart-ex.mjs CHANGED
@@ -1,559 +1,477 @@
1
- import { $t as e, At as t, Ht as n, It as r, J as i, Lt as a, Rt as o, Wt as s, X as c, en as l, f as u, nn as d, qt as f, r as p, t as m, tn as h, u as g, ut as _, zt as v } from "./plot-area-frame-D5hEOgkJ.js";
2
- import { T as y, w as b } from "./three-d-YYghQndN.js";
3
- import { A as x, C as S, D as C, E as w, F as T, I as E, L as D, M as O, N as k, O as A, P as j, R as M, S as N, T as ee, _ as te, a as P, b as ne, c as re, d as F, f as I, g as ie, h as L, i as R, j as z, l as B, m as V, n as ae, o as oe, p as se, r as ce, s as le, t as ue, u as de, v as fe, w as pe, x as me, y as he } from "./renderer-XFSCOT6m.js";
4
- import { t as ge } from "./renderer-module-contract-D91rkYHH.js";
5
- function H(e) {
6
- return e != null && Number.isFinite(e) ? e : null;
7
- }
8
- function U(e) {
9
- return Object.is(e, -0) ? "0" : String(Number.isInteger(e) ? e : Number(e.toPrecision(6)));
10
- }
11
- function _e(e, t) {
12
- if (e.length > 1048576) return { kind: "tooManyInputPoints" };
13
- let n = t.intervalClosed === "r" ? "r" : "l", r = H(t.underflow), i = H(t.overflow);
14
- r != null && i != null && r >= i && (r = null, i = null);
15
- let a = (e) => r != null && (n === "r" ? e <= r : e < r), o = (e) => i != null && (n === "r" ? e > i : e >= i), s = Infinity, c = -Infinity, l = 0, u = 0, d = 0;
16
- for (let t of e) {
17
- let e = H(t);
18
- e != null && (a(e) ? u++ : o(e) ? d++ : (l++, s = Math.min(s, e), c = Math.max(c, e)));
19
- }
20
- if (l + u + d === 0) return {
21
- kind: "bins",
22
- categories: [],
23
- counts: []
24
- };
25
- let f = [], p = [];
26
- if (r != null && (f.push(`${n === "r" ? "≤" : "<"} ${U(r)}`), p.push(u)), l > 0) {
27
- let u = r ?? s, d = i ?? c, m = d - u;
28
- if (!Number.isFinite(m)) f.push(`${U(u)} – ${U(d)}`), p.push(l);
29
- else {
30
- let s = H(t.binSize), c;
31
- c = s != null && s > 0 && m > 0 ? Math.max(1, Math.ceil(m / s)) : t.binCount != null && Number.isFinite(t.binCount) && t.binCount > 0 ? Math.max(1, Math.floor(t.binCount)) : Math.max(1, Math.ceil(Math.sqrt(l)));
32
- let d = m <= 0 ? 1 : Math.min(512, c), h = m > 0 && s != null && s > 0 && c <= 512, g = m === 0 ? 1 : h ? s : m / d, _ = Array(d).fill(0);
33
- for (let t of e) {
34
- let e = H(t);
35
- if (e == null || a(e) || o(e)) continue;
36
- let r = h ? (e - u) / g : m === 0 ? 0 : (e - u) / m * d, i = n === "r" ? Math.ceil(r) - 1 : Math.floor(r), s = Math.max(0, Math.min(d - 1, i));
37
- _[s]++;
38
- }
39
- for (let e = 0; e < d; e++) {
40
- let t = h ? u + g * e : u + e / d * m, a = h ? t + g : u + m * ((e + 1) / d), o = i == null ? a : Math.min(a, i), s = n === "r" && (r != null || e > 0) ? ">" : "≥", c = n === "l" && (i != null || e < d - 1) ? "<" : "≤";
41
- f.push(`${s} ${U(t)} – ${c} ${U(o)}`), p.push(_[e]);
1
+ import { $ as e, $n as t, Aa as n, Ba as r, Fn as i, Gi as a, Ia as o, Ii as s, In as c, J as l, Ki as u, Ln as d, Ma as f, Mt as p, Nn as m, Pn as h, Qn as g, R as _, Rn as ee, Rt as v, S as y, Ui as b, Ut as x, Wi as S, Wt as C, Y as w, Yi as T, Yt as E, Zi as te, Zn as D, Zt as O, _n as k, aa as A, b as j, bt as M, ca as ne, ct as N, er as P, fn as F, ga as I, gn as L, hn as re, in as R, it as z, jt as ie, li as B, mn as ae, na as oe, nt as se, oa as ce, on as le, ot as ue, pn as de, qa as fe, rt as pe, s as me, st as he, t as ge, ta as V, tt as _e, x as H, xn as ve, yt as ye, zt as be } from "./plot-area-frame-CaJFvZ7p.js";
2
+ import { A as xe, C as Se, D as Ce, E as we, O as Te, S as Ee, T as De, _ as U, a as Oe, b as ke, c as Ae, d as je, f as Me, g as Ne, i as Pe, j as Fe, k as Ie, l as Le, m as Re, o as ze, p as Be, s as Ve, u as He, v as Ue, w as We, x as Ge, y as W } from "./renderer-Czw1cCC7.js";
3
+ import { t as G } from "./renderer-module-contract-CWM7jv6d.js";
4
+ //#region packages/core/src/chart/chart-ex-renderer.ts
5
+ function Ke(e, t, r, i = 1) {
6
+ let a = 0, s = Math.max(1, r?.w ?? 32 * i), c = Math.max(1, r?.h ?? 16 * i), l = ae(e, ({ label: r, linkedStyleIndex: l }) => {
7
+ let u = r.labelBox, d = L(u), p = d ? e.chartStyleRoles?.dataLabelCallout ?? e.chartStyleRoles?.dataLabel : e.chartStyleRoles?.dataLabel, m = d ? fe(e, "dataLabelCallout") ?? fe(e, "dataLabel") : fe(e, "dataLabel"), h = k(u, p, m, p != null, 0, l)?.fillPaint, g = n(u?.style, m, 0), _ = u?.borderHidden === !0 ? f(m) : void 0, ee = u?.borderColor != null || u?.borderFill != null || g !== void 0 || _ !== void 0 || u?.borderPaintAuthored === !0 && u?.borderHidden !== !0, v = g === void 0 ? _ === void 0 ? u?.borderFill ?? (u?.borderColor ? {
8
+ fillType: "solid",
9
+ color: u.borderColor
10
+ } : ee ? null : o(p, l)) : _ : g;
11
+ for (let e of [h, v]) {
12
+ if (!e) continue;
13
+ let n = e.fillType === "image" ? me(e, t, s, c, i) ?? 1048577 : B(e);
14
+ if (e.fillType === "gradient" && n > 4096 || n > 1048576 - a) {
15
+ a = le + 1;
16
+ return;
42
17
  }
18
+ a += n;
43
19
  }
44
- }
45
- return i != null && (f.push(`${n === "r" ? ">" : "≥"} ${U(i)}`), p.push(d)), {
46
- kind: "bins",
47
- categories: f,
48
- counts: p
49
- };
50
- }
51
- //#endregion
52
- //#region packages/core/src/chart/pareto-layout.ts
53
- function ve(e, t) {
54
- return e == null ? e : e.flatMap((e) => {
55
- let n = t.get(e.idx);
56
- return n == null ? [] : [{
57
- ...e,
58
- idx: n
59
- }];
60
20
  });
21
+ return l === "not-hierarchy" ? null : l === "too-large" ? le + 1 : a;
61
22
  }
62
- function ye(e, t) {
63
- return e == null ? e : t.map((t) => e[t] ?? null);
64
- }
65
- function be(e, t, n = {}) {
66
- let r = e.values.map((e, t) => ({
67
- value: e,
68
- sourceIndex: t
69
- })).filter((e) => e.value != null && Number.isFinite(e.value) && e.value >= 0);
70
- n.sortDescending !== !1 && r.sort((e, t) => t.value - e.value || e.sourceIndex - t.sourceIndex);
71
- let i = r[0]?.value ?? 0, a = i > 0 ? r.reduce((e, t) => e + t.value / i, 0) : 0, o = 0, s = r.map((n) => (i > 0 && (o += n.value / i), {
72
- sourceIndex: n.sourceIndex,
73
- category: e.categories?.[n.sourceIndex] ?? t[n.sourceIndex] ?? String(n.sourceIndex + 1),
74
- value: n.value,
75
- cumulativeFraction: a > 0 ? o >= a ? 1 : o / a : 0
76
- })), c = s.map((e) => e.sourceIndex), l = new Map(c.map((e, t) => [e, t])), u = s.map((e) => e.category), d = {
77
- ...e,
78
- categories: u,
79
- catFormatCodes: ye(e.catFormatCodes, c),
80
- dataPointColors: ye(e.dataPointColors, c),
81
- dataLabelColors: ye(e.dataLabelColors, c),
82
- dataPointOverrides: ve(e.dataPointOverrides, l),
83
- dataLabelOverrides: ve(e.dataLabelOverrides, l)
84
- };
23
+ function K(e, t, n, r) {
24
+ if (!e.chartexParetoOutlineOwner) return t;
25
+ let i = t.chartexFormatIdx ?? n, a = t.lineColor ?? U(e, i, r, t.chartexStyle);
85
26
  return {
86
- points: s,
87
- categories: u,
88
- orderedSeries: {
89
- ...d,
90
- values: s.map((e) => e.value)
27
+ ...t,
28
+ chartexStyle: {
29
+ ...t.chartexStyle,
30
+ fillHidden: !0,
31
+ fillPaintAuthored: !0
91
32
  },
92
- series: {
93
- ...d,
94
- values: s.map((e) => e.cumulativeFraction)
95
- }
33
+ lineColor: a,
34
+ lineHidden: !1
96
35
  };
97
36
  }
98
- function xe(e) {
99
- if (e.length > 1e4) return !0;
100
- let t = 0;
101
- for (let n of e) {
102
- if (n.path.length > 512 || t > 1e4 - n.path.length) return !0;
103
- t += n.path.length;
104
- }
105
- return !1;
106
- }
107
- function Se(e, t = !1) {
108
- let n = {
109
- label: "",
110
- layoutWeight: 0,
111
- value: 0,
112
- depth: -1,
113
- children: [],
114
- branchIndex: -1,
115
- labelIndex: -1,
116
- a0: 0,
117
- a1: 0
118
- }, r = e.reduce((e, t) => Number.isFinite(t.size) && t.size > e ? t.size : e, 0), i = (e, t) => e > Number.MAX_VALUE - t ? Number.MAX_VALUE : e + t, a = /* @__PURE__ */ new WeakMap();
119
- for (let o of e) {
120
- let e = Number.isFinite(o.size) && o.size > 0 ? o.size : 0, s = r > 0 ? e / r : 0, c = n;
121
- for (let n = 0; n < o.path.length; n++) {
122
- let r = o.path[n], l = a.get(c);
123
- l || (l = /* @__PURE__ */ new Map(), a.set(c, l));
124
- let u = t && n === o.path.length - 1, d = u ? void 0 : l.get(r);
125
- d || (d = {
126
- label: r,
127
- layoutWeight: 0,
128
- value: 0,
129
- depth: n,
130
- children: [],
131
- branchIndex: n === 0 ? c.children.length : c.branchIndex,
132
- labelIndex: -1,
133
- a0: 0,
134
- a1: 0
135
- }, c.children.push(d), u || l.set(r, d)), d.layoutWeight += s, d.value = i(d.value, e), c = d;
37
+ function qe(e, t, n = 1) {
38
+ if (e.chartexSuppressGeometry) return 0;
39
+ if (![
40
+ "waterfall",
41
+ "funnel",
42
+ "boxWhisker",
43
+ "sunburst",
44
+ "treemap",
45
+ "clusteredColumn",
46
+ "histogram",
47
+ "pareto",
48
+ "paretoLine"
49
+ ].includes(e.chartType)) return null;
50
+ let r = 0, i = (e) => {
51
+ if (!e || r > 1048576) return;
52
+ let i = e.fillType === "image" ? me(e, void 0, Math.max(1, t.w), Math.max(1, t.h), n) : B(e);
53
+ e.fillType === "gradient" && i > 4096 || i > 1048576 - r ? r = le + 1 : r += i;
54
+ }, a = (t, n, r, a) => {
55
+ let o = Fe(e, t, n, r, a, "#000000", { linkedNoStyleFallback: !0 });
56
+ o.visible && i(o.paint ?? {
57
+ fillType: "solid",
58
+ color: "000000"
59
+ });
60
+ }, o = (t, n, a, o) => {
61
+ i(Ie(e, t, n, a, o));
62
+ let s = xe(e, t, n, a, o, "#000000");
63
+ if (s.visible && !Ge(s) && i(s.paint ?? {
64
+ fillType: "solid",
65
+ color: "000000"
66
+ }), r > 1048576) return !1;
67
+ }, s = (t, n) => {
68
+ let r = [e.chartexDataPointStyle, e.chartexDataPointLineStyle];
69
+ Te(e, Se(t, n), r, r, n, 1, "#000000", { linkedNoStyleFallback: !0 }).visible && i({
70
+ fillType: "solid",
71
+ color: "000000"
72
+ });
73
+ }, c = j(e, (t, n, r) => n === 0 ? K(e, t, n, r) : t);
74
+ if (c) {
75
+ if (c.kind === "tooManyInputPoints") return le + 1;
76
+ if (y(c, o), r > 1048576 || (H(c, o), r > 1048576)) return r;
77
+ if (e.chartType === "pareto" && c.series.length > 0) {
78
+ let t = e.chartexParetoOwnerIndex ?? 0, n = c.series[t], r = e.series.find((e) => e.seriesType === "line");
79
+ s(r ?? n, r?.chartexFormatIdx ?? n?.chartexFormatIdx ?? 0);
136
80
  }
137
- }
138
- n.layoutWeight = n.children.reduce((e, t) => e + t.layoutWeight, 0), n.value = n.children.reduce((e, t) => i(e, t.value), 0);
139
- let o = 0, s = [...n.children].reverse();
140
- for (; s.length > 0;) {
141
- let e = s.pop();
142
- e.labelIndex = o++;
143
- for (let t = e.children.length - 1; t >= 0; t--) s.push(e.children[t]);
144
- }
145
- return n;
146
- }
147
- function Ce(e) {
148
- let t = [e];
149
- for (; t.length > 0;) {
150
- let e = t.pop(), n = 0;
151
- for (let t of e.children) n += t.layoutWeight;
152
- if (n <= 0) continue;
153
- let r = e.a0;
154
- for (let i of e.children) {
155
- let a = (e.a1 - e.a0) * i.layoutWeight / n;
156
- i.a0 = r, i.a1 = r + a, r = i.a1, t.push(i);
81
+ } else if (e.chartType === "paretoLine") {
82
+ let t = e.series[0];
83
+ t && x(t, e.categories, { sortDescending: e.chartexParetoSortDescending ?? !1 }).points.length > 0 && s(t, v(t, 0));
84
+ } else if (e.chartType === "waterfall") {
85
+ let t = e.series[0], n = t?.values ?? [], r = be(t?.dataPointOverrides), a = F(n, e.categories.length, e.subtotalIndices);
86
+ if (a.cumulativeOverflow || a.rawMax <= a.rawMin) return 0;
87
+ for (let n = 0; n < a.bars.length; n++) {
88
+ let o = a.bars[n];
89
+ if (!o.paintSlot) continue;
90
+ let s = o.semanticIndex, c = r.get(n);
91
+ i(Ie(e, t, c, s, 3));
92
+ let l = xe(e, t, c, s, 3, "#000000");
93
+ l.visible && !Ge(l) && i(l.paint ?? {
94
+ fillType: "solid",
95
+ color: "000000"
96
+ });
157
97
  }
158
- }
159
- }
160
- function W(e) {
161
- let t = e.depth, n = [e];
162
- for (; n.length > 0;) {
163
- let e = n.pop();
164
- t = Math.max(t, e.depth);
165
- for (let t = e.children.length - 1; t >= 0; t--) n.push(e.children[t]);
166
- }
167
- return t;
168
- }
169
- //#endregion
170
- //#region packages/core/src/chart/chart-ex-renderer.ts
171
- function we(e) {
172
- return !e || e.fillNoStyle === !0 ? !1 : e.fillPaintAuthored === !0 || e.fillHidden === !0 || e.fillColors?.some((e) => e != null) === !0 || e.fillPaints?.some((e) => e != null) === !0;
173
- }
174
- function Te(e, t, n, r) {
175
- return t?.fillHidden === !0 || t?.color != null || we(t?.chartexStyle) ? B(e, r, 3, t?.fillHidden === !0 ? {
176
- ...t.chartexStyle,
177
- fillHidden: !0,
178
- fillPaintAuthored: !0
179
- } : t?.chartexStyle, t?.color, {
180
- fillHidden: !0,
181
- fillPaintAuthored: !0
182
- }) : n?.chartexStyle?.fillPaintAuthored === !0 ? B(e, r, 3, n.chartexStyle, n.color, {
183
- fillHidden: !0,
184
- fillPaintAuthored: !0
185
- }) : oe(e, r, 3, n?.chartexStyle, n?.color);
186
- }
187
- function Ee(e) {
188
- let t = e?.chartexStyle;
189
- return e?.lineHidden != null || e?.lineColor != null || e?.lineWidthEmu != null || e?.lineDash != null || t?.linePaintAuthored === !0 || t?.lineHidden != null || t?.lineColors?.some((e) => e != null) === !0 || t?.linePaints?.some((e) => e != null) === !0 || t?.lineWidthEmu != null || t?.lineDash != null || t?.lineCustomDash != null || t?.lineCap != null || t?.lineJoin != null;
190
- }
191
- function De(e) {
192
- let t = e.chartexSunburst ? {
193
- rows: e.chartexSunburst.rows,
194
- kind: "sunburst"
195
- } : e.chartexTreemap ? {
196
- rows: e.chartexTreemap.rows,
197
- kind: "treemap"
198
- } : void 0;
199
- if (!t) return null;
200
- if (t.rows.length === 0) return 0;
201
- if (xe(t.rows)) return c + 1;
202
- let n = Se(t.rows, t.kind === "treemap");
203
- if (n.layoutWeight <= 0 || n.children.length === 0) return 0;
204
- t.kind === "sunburst" && (n.a0 = -Math.PI / 2, n.a1 = n.a0 + Math.PI * 2, Ce(n));
205
- let r = e.series[0], i = S(r?.dataLabelOverrides), a = e.chartexTreemap?.parentLabelLayout ?? "overlapping", o = 0, s = [...n.children];
206
- for (; s.length > 0;) {
207
- let n = s.pop();
208
- for (let e of n.children) s.push(e);
209
- if (n.layoutWeight <= 0 || t.kind === "sunburst" && n.a1 - n.a0 <= 1e-4) continue;
210
- let l;
211
- t.kind === "sunburst" ? l = z(e, r, n.labelIndex, n.label, n.value, {
212
- visible: !1,
213
- showVal: !1,
214
- showCatName: !1
215
- }, i) : n.children.length > 0 ? (l = z(e, r, n.labelIndex, n.label, n.value, {
216
- visible: a !== "none",
217
- showVal: !1,
218
- showCatName: !0
219
- }, i), a === "overlapping" && n.depth !== 0 && (l = null)) : l = z(e, r, n.labelIndex, n.label, n.value, {
220
- visible: !1,
221
- showVal: !1,
222
- showCatName: !1
223
- }, i);
224
- for (let e of [l?.labelBox?.fillPaint, l?.labelBox?.borderFill]) {
225
- if (!e) continue;
226
- let t = _(e);
227
- if (e.fillType === "gradient" && t > 4096 || t > 1048576 - o) return c + 1;
228
- o += t;
98
+ } else if (e.chartType === "funnel") {
99
+ let t = e.series[0], n = t?.values ?? [], r = Math.max(n.length, e.categories.length);
100
+ if (n.some((e) => e != null && e > 0)) {
101
+ let a = be(t?.dataPointOverrides);
102
+ for (let o = 0; o < r; o++) {
103
+ if (!((n[o] ?? 0) > 0)) continue;
104
+ let r = a.get(o);
105
+ i(Ie(e, t, r, 0, 1));
106
+ let s = xe(e, t, r, 0, 1, "#000000");
107
+ s.visible && i(s.paint ?? {
108
+ fillType: "solid",
109
+ color: "000000"
110
+ });
111
+ }
112
+ }
113
+ } else if (e.chartType === "boxWhisker") {
114
+ let t = e.chartexBox, n = t?.series.length ?? 0;
115
+ for (let r = 0; r < n; r++) {
116
+ let o = t.series[r], s = o.chartexFormatIdx ?? r, c = Ue(e, s, n, o.chartexStyle, o.color);
117
+ for (let t of o.valuesByCategory) P(t, o.quartileMethod) && (i(c), a(e.chartexDataPointStyle, Se(o, s), s, n));
229
118
  }
119
+ } else {
120
+ let t = e.series[0], n = 1;
121
+ de(e, ({ node: e }) => {
122
+ n = Math.max(n, e.branchIndex + 1);
123
+ });
124
+ let r = be(t?.dataPointOverrides);
125
+ if (de(e, ({ node: a, paintsBody: o }) => {
126
+ if (!o) return;
127
+ let s = r.get(a.labelIndex);
128
+ i(Ie(e, t, s, a.branchIndex, n));
129
+ let c = xe(e, t, s, a.branchIndex, n, "#000000", e.chartexDataPointStyle, { linkedNoStyleFallback: e.chartType === "treemap" });
130
+ c.visible && i(c.paint ?? {
131
+ fillType: "solid",
132
+ color: "000000"
133
+ });
134
+ }) === "too-large") return le + 1;
230
135
  }
231
- return o;
136
+ return r;
232
137
  }
233
- function G(e, t, n, r, a = 0) {
138
+ function Je(e, t, n, i, a = 0) {
234
139
  let o = t.series[0];
235
140
  if (!o) return;
236
- let s = _e(o.values, t.chartexHistogramBinning ?? {});
141
+ let s = C(o.values, t.chartexHistogramBinning ?? {}, o.valFormatCode, t.date1904 === !0);
237
142
  if (s.kind === "tooManyInputPoints") {
238
- C(e, n, i + 1);
143
+ Le(e, n, R + 1);
239
144
  return;
240
145
  }
241
- A(e, {
242
- ...t,
146
+ ze(e, r(t, {
243
147
  chartType: "clusteredBar",
244
148
  categories: s.categories,
245
149
  series: [{
246
150
  ...o,
247
151
  categories: void 0,
248
- values: s.counts
152
+ values: s.counts,
153
+ valFormatCode: null
249
154
  }]
250
- }, n, r, { gapPolicy: "chartex" }, a);
155
+ }), n, i, { gapPolicy: "chartex" }, a);
251
156
  }
252
- function Oe(t, r, i, a, c) {
253
- let { x: l, y: d, w: f, h } = i, g = r.series[0]?.values ?? [], _ = r.categories, y = Math.max(g.length, _.length);
254
- if (y === 0 || C(t, i, y)) return;
255
- let b = new Set(r.subtotalIndices), x = !1, A = (e, t) => {
256
- let n = e + t;
257
- return Number.isFinite(n) ? n : (x = !0, n < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE);
258
- }, ne = 0, I = [], R = -Infinity, B = 0;
259
- for (let e = 0; e < y; e++) {
260
- let t = g[e], n = t != null && Number.isFinite(t), r = t == null || n, i = n ? t : 0;
261
- if (b.has(e)) {
262
- let e = {
263
- start: 0,
264
- end: i,
265
- isSub: !0,
266
- isPos: !0,
267
- hasValue: n,
268
- paintSlot: r
269
- };
270
- I.push(e), r && (R = Math.max(R, e.start, e.end), B = Math.min(B, e.start, e.end)), n && (ne = i);
271
- } else {
272
- let e = A(ne, i), t = {
273
- start: i >= 0 ? ne : e,
274
- end: i >= 0 ? e : ne,
275
- isSub: !1,
276
- isPos: i >= 0,
277
- hasValue: n,
278
- paintSlot: r
279
- };
280
- I.push(t), r && (R = Math.max(R, t.start, t.end), B = Math.min(B, t.start, t.end)), n && (ne = e);
281
- }
282
- }
283
- if (x) {
284
- t.fillStyle = "#888", t.font = "12px sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("(chart values out of range)", l + f / 2, d + h / 2);
157
+ function Ye(t, n, i, o, s) {
158
+ let { x: c, y: f, w: p, h: m } = i, h = n.series[0]?.values ?? [], g = n.categories, v = Math.max(h.length, g.length);
159
+ if (v === 0 || Le(t, i, v)) return;
160
+ let { bars: y, rawMax: b, rawMin: x, cumulativeOverflow: S } = F(h, g.length, n.subtotalIndices);
161
+ if (S) {
162
+ t.fillStyle = "#888", t.font = "12px sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("(chart values out of range)", c + p / 2, f + m / 2);
285
163
  return;
286
164
  }
287
- if (R <= B) return;
288
- let de = b.size === 0 && I.every((e, t) => !e.hasValue || g[t] >= 0), ge = !r.valAxisHidden && r.valAxisTickLabelPos !== "none" && !de, H = pe(t, r, f, h, a), U = o(r, f, h, a), _e = ce(r.valAxisFontSizeHpt, h, a), ve = ce(r.catAxisFontSizeHpt, h, a), ye = V(r, r.valAxisFontFace, "minor"), be = V(r, r.catAxisFontFace, "minor"), xe = w(r, B, R, h / a);
165
+ if (b <= x) return;
166
+ let C = n.subtotalIndices.length === 0 && y.every((e, t) => !e.hasValue || h[t] >= 0), E = !n.valAxisHidden && n.valAxisTickLabelPos !== "none" && !C, D = Ae(t, n, p, m, o), k = a(n, p, m, o), j = _(n.valAxisFontSizeHpt, m, o), P = _(n.catAxisFontSizeHpt, m, o), L = M(n, n.valAxisFontFace, "minor"), R = M(n, n.catAxisFontFace, "minor"), ie = se(n, x, b, m / o);
289
167
  t.save();
290
- let Se = 0;
291
- if (ge) {
292
- t.font = se(_e, ye, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1);
168
+ let B = 0;
169
+ if (E) {
170
+ t.font = ye(j, L, n.valAxisFontBold ?? !1, n.valAxisFontItalic ?? !1);
293
171
  let e = 0;
294
- for (let n of xe.majorLines) e = Math.max(e, t.measureText(N(r, n, !1)).width);
295
- Se = e + 8;
172
+ for (let r of ie.majorLines) e = Math.max(e, ne(t, _e(n, r, !1)));
173
+ B = e + 8;
296
174
  }
297
- let Ce = Math.max(1, f - U.valBandW - Se - f * .02) / y;
298
- t.font = se(ve, be, r.catAxisFontBold ?? !1, r.catAxisFontItalic ?? !1);
299
- let W = _.slice(0, y).map((e) => M(t, p(e, r.catAxisFormatCode, r.date1904), Math.max(1, Ce - 8))), we = 0;
300
- for (let e of W) e.some(Boolean) && (we = Math.max(we, e.length));
301
- let De = r.catAxisHidden || we === 0 ? 0 : we * (ve + 2) + 4, G = r.series[0], Oe = S(G?.dataLabelOverrides), ke = S(G?.dataPointOverrides), Ae = G?.chartexStyle, je = `#${G?.color ?? P(r, 0, 3, Ae)}`, K = `#${P(r, 1, 3, Ae)}`, q = `#${P(r, 2, 3, Ae)}`, Me = oe(r, 0, 3, Ae, G?.color), Ne = oe(r, 1, 3, Ae), J = oe(r, 2, 3, Ae), Pe = {
302
- ...r,
175
+ let ae = E ? oe(ie.majorLines.map((e) => _e(n, e, !1)), A(j)) / 2 : 0, le = Math.max(1, p - k.valBandW - B - p * .02) / v;
176
+ t.font = ye(P, R, n.catAxisFontBold ?? !1, n.catAxisFontItalic ?? !1);
177
+ let de = g.slice(0, v).map((e) => N(t, ve(e, n.catAxisFormatCode, n.date1904), Math.max(1, le - 8))), fe = 0;
178
+ for (let e of de) e.some(Boolean) && (fe = Math.max(fe, e.length));
179
+ let me = n.catAxisHidden || fe === 0 ? 0 : fe * (P + 2) + 4, V = n.series[0], H = be(V?.dataLabelOverrides), Ce = be(V?.dataPointOverrides), Ee = V?.chartexStyle, De = `#${V?.color ?? U(n, 0, 3, Ee)}`, Oe = `#${U(n, 1, 3, Ee)}`, Pe = `#${U(n, 2, 3, Ee)}`, Fe = Ue(n, 0, 3, Ee, V?.color), Re = Ue(n, 1, 3, Ee), ze = Ue(n, 2, 3, Ee), W = r(n, {
303
180
  chartType: "clusteredBar",
304
181
  series: [
305
- re(r, "Increase", G, r.chartexDataPointStyle, 0, 3, je),
306
- re(r, "Decrease", G, r.chartexDataPointStyle, 1, 3, K),
307
- re(r, "Total", G, r.chartexDataPointStyle, 2, 3, q)
182
+ ke(n, "Increase", V, n.chartexDataPointStyle, 0, 3, De, !1, !0, !0),
183
+ ke(n, "Decrease", V, n.chartexDataPointStyle, 1, 3, Oe, !1, !0, !0),
184
+ ke(n, "Total", V, n.chartexDataPointStyle, 2, 3, Pe, !1, !0, !0)
308
185
  ]
309
- }, Fe = ee(t, Pe, f, h, .22, a), { legRightW: Ie, legLeftW: Le, legTopH: Re, legBottomH: ze } = v(Fe, r.legendOverlay === !0), Y = s(r, l, d, f, h, a, {
310
- titleBand: H,
311
- legendSideReserveFrac: 0,
312
- legendReserve: Fe,
186
+ }), G = Be(t, W, p, m, o), { legRightW: Ke, legLeftW: K, legTopH: qe, legBottomH: Je } = u(G, n.legendOverlay === !0), Ye = te(n, c, f, p, m, o, {
187
+ titleBand: D,
188
+ legendReserve: G,
313
189
  pad: {
314
- t: H.bandH + Re + _e / 2 + 2,
315
- r: Ie + f * .02,
316
- b: ze + U.catBandH + De,
317
- l: Le + U.valBandW + (r.valAxisHidden ? f * .02 : Math.max(f * .03, Se))
190
+ t: D.bandH + qe + j / 2 + 2 + ae,
191
+ r: Ke + p * .02,
192
+ b: Je + k.catBandH + me,
193
+ l: K + k.valBandW + (n.valAxisHidden ? p * .02 : Math.max(p * .03, B))
318
194
  },
319
195
  honorPlotAreaManualLayout: !0
320
196
  });
321
- fe(t, r, l, d, f, h, d + Y.title.topPad, Y.title.fontPx);
322
- let { px0: X, py0: Z, pw: Q, ph: $ } = Y.plotRect;
323
- m(t, r, X, Z, Q, $, a, c);
324
- let Be = w(r, B, R, $ / a), Ve = (e) => Z + $ - Be.frac(e) * $, He = u(r.valAxisLineColor, r.valAxisLineWidthEmu, a), Ue = u(r.catAxisLineColor, r.catAxisLineWidthEmu, a), We = E(r, a);
325
- if (!r.valAxisHidden) {
326
- t.font = se(_e, ye, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1), t.fillStyle = r.valAxisFontColor ? `#${r.valAxisFontColor}` : "#595959", t.textAlign = "right", t.textBaseline = "middle";
327
- let e = D(r, a);
328
- for (let n of Be.minorLines) T(t, X, Q, Ve(n), !1, e);
329
- for (let e of Be.majorLines) {
330
- let n = Ve(e);
331
- if (me(r)) {
332
- t.strokeStyle = We.color, t.lineWidth = We.width;
333
- let e = We.dash.length > 0 && t.getLineDash ? t.getLineDash() : [];
334
- We.dash.length > 0 && t.setLineDash(We.dash), t.beginPath(), t.moveTo(X, n), t.lineTo(X + Q, n), t.stroke(), We.dash.length > 0 && t.setLineDash(e);
197
+ Ve(t, n, c, f, p, m, f + Ye.title.topPad, Ye.title.fontPx);
198
+ let { px0: q, py0: J, pw: Y, ph: X } = Ye.plotRect;
199
+ if (Y <= 0 || X <= 0) return;
200
+ ge(t, n, q, J, Y, X, o, s);
201
+ let Xe = se(n, x, b, X / o), Z = (e) => J + X - Xe.frac(e) * X, Q = O(n.valAxisLineColor, n.valAxisLineWidthEmu, o), Ze = O(n.catAxisLineColor, n.catAxisLineWidthEmu, o), Qe = ue(n, o);
202
+ if (!n.valAxisHidden) {
203
+ t.font = ye(j, L, n.valAxisFontBold ?? !1, n.valAxisFontItalic ?? !1), t.fillStyle = n.valAxisFontColor ? `#${n.valAxisFontColor}` : "#595959", t.textAlign = "right", t.textBaseline = "middle";
204
+ let r = he(n, o);
205
+ for (let e of Xe.minorLines) z(t, q, Y, Z(e), !1, r);
206
+ for (let r of Xe.majorLines) {
207
+ let i = Z(r);
208
+ if (e(n)) {
209
+ t.strokeStyle = Qe.color, t.lineWidth = Qe.width;
210
+ let e = Qe.dash.length > 0 && t.getLineDash ? t.getLineDash() : [];
211
+ Qe.dash.length > 0 && t.setLineDash(Qe.dash), t.beginPath(), t.moveTo(q, i), t.lineTo(q + Y, i), t.stroke(), Qe.dash.length > 0 && t.setLineDash(e);
335
212
  }
336
- ge && t.fillText(N(r, e, !1), X - 4, n), L(t, r.valAxisMajorTickMark, "val", X, n, He.color, He.width, !1, r.valAxisLineHidden, "major", a, r.valAxisLineDash);
213
+ E && ce(t, _e(n, r, !1), q - 4, i, A(j)), l(t, n.valAxisMajorTickMark, "val", q, i, Q.color, Q.width, !1, n.valAxisLineHidden, "major", o, n.valAxisLineDash);
337
214
  }
338
- for (let e of Be.minorTicks) L(t, r.valAxisMinorTickMark, "val", X, Ve(e), He.color, He.width, !1, r.valAxisLineHidden, "minor", a, r.valAxisLineDash);
215
+ for (let e of Xe.minorTicks) l(t, n.valAxisMinorTickMark, "val", q, Z(e), Q.color, Q.width, !1, n.valAxisLineHidden, "minor", o, n.valAxisLineDash);
339
216
  }
340
- let Ge = !r.valAxisHidden && !r.valAxisLineHidden, Ke = !r.catAxisHidden && !r.catAxisLineHidden;
341
- Ge && j(t, X, Z, X, Z + $, He.color, He.width, r.valAxisLineDash), Ke && j(t, X, Z + $, X + Q, Z + $, Ue.color, Ue.width, r.catAxisLineDash);
342
- let qe = Q / y, Je = qe / (1 + e(r.barGapWidth, "chartex") / 100);
343
- I.forEach((e, i) => {
344
- let o = X + qe * i + (qe - Je) / 2, s = Math.min(Ve(e.start), Ve(e.end)), u = Math.max(Ve(e.start), Ve(e.end)), p = Math.max(1, u - s), m = e.isSub ? 2 : +!e.isPos, v = ke.get(i), b = Te(r, v, G, m), x = v?.color ? `#${v.color}` : e.isSub ? q : e.isPos ? je : K;
345
- e.paintSlot && b && (t.fillStyle = le(t, b, o, s, Je, p, x, c), t.fillRect(o, s, Je, p));
346
- let S = F(r, r.chartexDataPointStyle, "line", m, 3), C = Ee(v) ? v : G;
347
- if (e.paintSlot && ue(t, r, r.chartexDataPointStyle, C, m, 3, S ? `#${S}` : x, a) && t.strokeRect(o, s, Je, p), e.paintSlot && I[i + 1]?.paintSlot && i < y - 1 && r.chartexConnectorLines !== !1) {
348
- let n = X + qe * (i + 1) + (qe - Je) / 2, c = e.isPos ? s : u;
217
+ let $e = !n.valAxisHidden && !n.valAxisLineHidden, et = !n.catAxisHidden && !n.catAxisLineHidden;
218
+ $e && pe(t, q, J, q, J + X, Q.color, Q.width, n.valAxisLineDash), et && pe(t, q, J + X, q + Y, J + X, Ze.color, Ze.width, n.catAxisLineDash);
219
+ let tt = Y / v, $ = tt / (1 + I(n.barGapWidth, "chartex") / 100);
220
+ y.forEach((e, r) => {
221
+ let i = q + tt * r + (tt - $) / 2, a = Math.min(Z(e.start), Z(e.end)), l = Math.max(Z(e.start), Z(e.end)), u = Math.max(1, l - a), b = e.semanticIndex, x = Ce.get(r), S = Ie(n, V, x, b, 3), C = x?.color ? `#${x.color}` : e.isSub ? Pe : e.isPos ? De : Oe, w = We(n, n.chartexDataPointStyle, "line", b, 3), E = xe(n, V, x, b, 3, w ? `#${w}` : C);
222
+ if (e.paintSlot && ee(t, d(x?.chartexStyle, V?.chartexStyle), n.chartexDataPointStyle, b, {
223
+ x: i,
224
+ y: a,
225
+ w: $,
226
+ h: u
227
+ }, o, (e) => {
228
+ S && we(e, S, {
229
+ x: i,
230
+ y: a,
231
+ w: $,
232
+ h: u
233
+ }, C, o, s), !Ge(E) && Ne(e, E, o, {
234
+ x: i,
235
+ y: a,
236
+ w: $,
237
+ h: u
238
+ }, s) && e.strokeRect(i, a, $, u);
239
+ }), e.paintSlot && y[r + 1]?.paintSlot && r < v - 1 && n.chartexConnectorLines !== !1) {
240
+ let s = q + tt * (r + 1) + (tt - $) / 2, c = e.isPos ? a : l;
349
241
  t.save();
350
- let l = O(r, r.chartexSeriesLineStyle, G, m, 3, "#000000", { linkedNoStyleFallback: !0 });
351
- ae(t, l, a) && (l.widthEmu ?? (t.lineWidth = .75 * a), t.beginPath(), t.moveTo(o + Je, c), t.lineTo(n, c), t.stroke()), t.restore();
242
+ let u = [n.chartexSeriesLineStyle, n.chartexDataPointLineStyle], d = Te(n, Se(V, b), u, u, b, 3, "#000000", { linkedNoStyleFallback: !0 });
243
+ Ne(t, d, o) && (d.widthEmu ?? (t.lineWidth = .75 * o), t.beginPath(), t.moveTo(i + $, c), t.lineTo(s, c), t.stroke()), t.restore();
352
244
  }
353
- let w = e.hasValue ? g[i] : 0, T = z(r, G, i, _[i] ?? "", w, {
354
- visible: r.showDataLabels,
245
+ let te = e.hasValue ? h[r] : 0, D = re(n, V, r, g[r] ?? "", te, {
246
+ visible: n.showDataLabels,
355
247
  showVal: !0,
356
248
  showCatName: !1
357
- }, Oe, !e.hasValue);
358
- if (T) {
359
- let e = G?.dataLabelColors?.[i] ?? T.fontColor ?? null, u = e ? `#${e}` : r.dataLabelFontColor ? `#${r.dataLabelFontColor}` : "#595959", m = n(T.fontSizeHpt, a) ?? ce(r.dataLabelFontSizeHpt, h, a), g = T.fontBold ?? r.dataLabelFontBold ?? !1, _ = V(r, T.fontFace ?? r.dataLabelFontFace, "minor");
360
- t.font = `${T.textStyle.fontItalic ? "italic " : ""}${g ? "bold " : ""}${m}px ${_}`, te(t, T.text, {
249
+ }, H, !e.hasValue);
250
+ if (D) {
251
+ let e = V?.dataLabelColors?.[r] ?? D.fontColor ?? null, l = e ? `#${e}` : n.dataLabelFontColor ? `#${n.dataLabelFontColor}` : "#595959", d = T(D.fontSizeHpt, o) ?? _(n.dataLabelFontSizeHpt, m, o), h = D.fontBold ?? n.dataLabelFontBold ?? !1, g = M(n, D.fontFace ?? n.dataLabelFontFace, "minor");
252
+ t.font = `${D.textStyle.fontItalic ? "italic " : ""}${h ? "bold " : ""}${d}px ${g}`, He(t, D.text, {
361
253
  kind: "bar",
362
254
  rect: {
363
- x: o,
364
- y: s,
365
- w: Je,
366
- h: p
255
+ x: i,
256
+ y: a,
257
+ w: $,
258
+ h: u
367
259
  },
368
260
  orientation: "vertical",
369
- negative: w < 0,
370
- position: T.position ?? "outEnd"
261
+ negative: te < 0,
262
+ position: D.position ?? "outEnd"
371
263
  }, {
372
- x: X,
373
- y: Z,
374
- w: Q,
375
- h: $
376
- }, m, u, T.manualLayout, {
377
- x: l,
378
- y: d,
379
- w: f,
380
- h
381
- }, k(r, T.richRuns, a, _, g, T.textStyle), void 0, T.textStyle, a, T.labelBox, c);
264
+ x: q,
265
+ y: J,
266
+ w: Y,
267
+ h: X
268
+ }, d, l, D.manualLayout, {
269
+ x: c,
270
+ y: f,
271
+ w: p,
272
+ h: m
273
+ }, je(n, D.richRuns, o, g, h, D.textStyle), void 0, D.textStyle, o, D.labelBox, s);
382
274
  }
383
- }), t.textAlign = "center", t.textBaseline = "top", t.fillStyle = r.catAxisFontColor ? `#${r.catAxisFontColor}` : "#595959", t.font = se(ve, be, r.catAxisFontBold ?? !1, r.catAxisFontItalic ?? !1);
384
- let Ye = Z + $ + 4;
385
- for (let e = 0; e < y && !r.catAxisHidden; e++) {
386
- let n = X + qe * e + qe / 2;
387
- (W[e] ?? []).forEach((e, r) => e && t.fillText(e, n, Ye + r * (ve + 2)));
275
+ }), t.textAlign = "center", t.textBaseline = "top", t.fillStyle = n.catAxisFontColor ? `#${n.catAxisFontColor}` : "#595959", t.font = ye(P, R, n.catAxisFontBold ?? !1, n.catAxisFontItalic ?? !1);
276
+ let nt = J + X + 4;
277
+ for (let e = 0; e < v && !n.catAxisHidden; e++) {
278
+ let n = q + tt * e + tt / 2;
279
+ (de[e] ?? []).forEach((e, r) => e && t.fillText(e, n, nt + r * (P + 2)));
388
280
  }
389
- ie(t, r, l, d, f, h, X, Z, Q, $, Le, ze, U.catFontPx, U.valFontPx), he(t, Pe, Fe, l, d, f, h, X, Z, Q, $, H.bandH + 2, a, [
390
- Me,
391
- Ne,
392
- J
393
- ], c), t.restore();
281
+ w(t, n, c, f, p, m, q, J, Y, X, K, Je, k.catFontPx, k.valFontPx), Me(t, W, G, c, f, p, m, q, J, Y, X, D.bandH + 2, o, [
282
+ Fe,
283
+ Re,
284
+ ze
285
+ ], s), t.restore();
394
286
  }
395
- function ke(t, r, i, a, o) {
396
- let c = r.series[0]?.values ?? [], l = Math.max(c.length, r.categories.length);
397
- if (l === 0 || C(t, i, l)) return;
398
- let d = 0;
399
- for (let e = 0; e < l; e++) d = Math.max(d, c[e] ?? 0);
400
- if (!(d > 0)) return;
401
- let { x: f, y: p, w: h, h: g } = i, _ = pe(t, r, h, g, a), y = r.series[0], b = S(y?.dataLabelOverrides), x = `#${y?.color ?? P(r, 0, 1, y?.chartexStyle)}`, w = oe(r, 0, 1, y?.chartexStyle, y?.color), T = {
402
- ...r,
403
- series: [re(r, y?.name ?? "", y, r.chartexDataPointStyle, 0, 1, x)]
404
- }, E = ee(t, T, h, g, .22, a), { legRightW: D, legLeftW: O, legTopH: A, legBottomH: j } = v(E, r.legendOverlay === !0), M = ce(r.catAxisFontSizeHpt, g, a);
405
- t.save(), t.font = se(M, V(r, r.catAxisFontFace, "minor"), r.catAxisFontBold ?? !1, r.catAxisFontItalic ?? !1);
406
- let N = 0;
407
- if (!r.catAxisHidden) {
408
- for (let e = 0; e < Math.min(l, r.categories.length); e++) N = Math.max(N, t.measureText(r.categories[e]).width);
409
- r.categories.length > 0 && (N += 10);
287
+ function q(e, t, n, r, i) {
288
+ let a = t.series[0]?.values ?? [], o = Math.max(a.length, t.categories.length);
289
+ if (o === 0 || Le(e, n, o)) return;
290
+ let s = 0;
291
+ for (let e = 0; e < o; e++) s = Math.max(s, a[e] ?? 0);
292
+ if (!(s > 0)) return;
293
+ let { x: c, y: l, w: f, h: p } = n, m = Ae(e, t, f, p, r), h = t.series[0], g = be(h?.dataLabelOverrides), v = `#${h?.color ?? U(t, 0, 1, h?.chartexStyle)}`, y = Ue(t, 0, 1, h?.chartexStyle, h?.color), b = {
294
+ ...t,
295
+ series: [ke(t, h?.name ?? "", h, t.chartexDataPointStyle, 0, 1, v)]
296
+ }, x = Be(e, b, f, p, r), { legRightW: S, legLeftW: C, legTopH: w, legBottomH: E } = u(x, t.legendOverlay === !0), D = _(t.catAxisFontSizeHpt, p, r);
297
+ e.save(), e.font = ye(D, M(t, t.catAxisFontFace, "minor"), t.catAxisFontBold ?? !1, t.catAxisFontItalic ?? !1);
298
+ let k = 0;
299
+ if (!t.catAxisHidden) {
300
+ for (let n = 0; n < Math.min(o, t.categories.length); n++) k = Math.max(k, ne(e, t.categories[n]));
301
+ t.categories.length > 0 && (k += 10);
410
302
  }
411
- let ne = s(r, f, p, h, g, a, {
412
- titleBand: _,
413
- legendSideReserveFrac: .22,
414
- legendReserve: E,
303
+ let j = te(t, c, l, f, p, r, {
304
+ titleBand: m,
305
+ legendReserve: x,
415
306
  pad: {
416
- t: _.bandH + A + 2,
417
- r: D + h * .02,
418
- b: j + g * .02,
419
- l: O + N + h * .02
307
+ t: m.bandH + w + 2,
308
+ r: S + f * .02,
309
+ b: E + p * .02,
310
+ l: C + k + f * .02
420
311
  },
421
312
  honorPlotAreaManualLayout: !0
422
313
  });
423
- fe(t, r, f, p, h, g, p + ne.title.topPad, ne.title.fontPx);
424
- let { px0: F, py0: I, pw: ie, ph: L } = ne.plotRect;
425
- m(t, r, F, I, ie, L, a, o);
426
- let R = L / l, B = R / (1 + e(r.barGapWidth, "chartex") / 100);
427
- for (let e = 0; e < l; e++) {
428
- let i = Math.max(0, c[e] ?? 0), s = ie * i / d, l = F + (ie - s) / 2, u = I + R * e + (R - B) / 2;
429
- w && (t.fillStyle = le(t, w, l, u, s, B, x, o), t.fillRect(l, u, s, B)), ue(t, r, r.chartexDataPointStyle, y, 0, 1, x, a) && t.strokeRect(l, u, s, B);
430
- let m = r.categories[e];
431
- !r.catAxisHidden && m != null && (t.fillStyle = r.catAxisFontColor ? `#${r.catAxisFontColor}` : "#595959", t.textAlign = "right", t.textBaseline = "middle", t.fillText(m, F - 6, u + B / 2));
432
- let _ = z(r, y, e, m ?? "", i, {
314
+ Ve(e, t, c, l, f, p, l + j.title.topPad, j.title.fontPx);
315
+ let { px0: N, py0: P, pw: F, ph: L } = j.plotRect;
316
+ if (F <= 0 || L <= 0) return;
317
+ ge(e, t, N, P, F, L, r, i);
318
+ let R = L / o, z = R / (1 + I(t.barGapWidth, "chartex") / 100), ie = be(h?.dataPointOverrides);
319
+ for (let n = 0; n < o; n++) {
320
+ let o = Math.max(0, a[n] ?? 0), u = F * o / s, m = N + (F - u) / 2, y = P + R * n + (R - z) / 2, b = ie.get(n), x = Ie(t, h, b, 0, 1), S = xe(t, h, b, 0, 1, v), C = (e) => {
321
+ x && u > 0 ? we(e, x, {
322
+ x: m,
323
+ y,
324
+ w: u,
325
+ h: z
326
+ }, v, r, i) : x && (e.fillStyle = W(e, x, m, y, u, z, v, i), e.fillRect(m, y, u, z)), Ne(e, S, r, u > 0 ? {
327
+ x: m,
328
+ y,
329
+ w: u,
330
+ h: z
331
+ } : void 0, i) && e.strokeRect(m, y, u, z);
332
+ };
333
+ u > 0 ? ee(e, d(b?.chartexStyle, h?.chartexStyle), t.chartexDataPointStyle, 0, {
334
+ x: m,
335
+ y,
336
+ w: u,
337
+ h: z
338
+ }, r, C) : C(e);
339
+ let w = t.categories[n];
340
+ !t.catAxisHidden && w != null && (e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#595959", e.textAlign = "right", e.textBaseline = "middle", ce(e, w, N - 6, y + z / 2, A(D)));
341
+ let E = re(t, h, n, w ?? "", o, {
433
342
  visible: !1,
434
343
  showVal: !1,
435
344
  showCatName: !1
436
- }, b);
437
- if (_) {
438
- let e = n(_.fontSizeHpt, a) ?? ce(r.dataLabelFontSizeHpt, g, a), i = V(r, _.fontFace ?? r.dataLabelFontFace, "minor");
439
- t.font = `${_.textStyle.fontItalic ? "italic " : ""}${_.fontBold ? "bold " : ""}${e}px ${i}`, te(t, _.text, {
345
+ }, g);
346
+ if (E) {
347
+ let n = T(E.fontSizeHpt, r) ?? _(t.dataLabelFontSizeHpt, p, r), a = M(t, E.fontFace ?? t.dataLabelFontFace, "minor");
348
+ e.font = `${E.textStyle.fontItalic ? "italic " : ""}${E.fontBold ? "bold " : ""}${n}px ${a}`, He(e, E.text, {
440
349
  kind: "bar",
441
350
  rect: {
442
- x: l,
443
- y: u,
444
- w: s,
445
- h: B
351
+ x: m,
352
+ y,
353
+ w: u,
354
+ h: z
446
355
  },
447
356
  orientation: "horizontal",
448
357
  negative: !1,
449
- position: _.position ?? "ctr"
358
+ position: E.position ?? "ctr"
450
359
  }, {
451
- x: F,
452
- y: I,
453
- w: ie,
360
+ x: N,
361
+ y: P,
362
+ w: F,
454
363
  h: L
455
- }, e, _.fontColor ? `#${_.fontColor}` : "#ffffff", _.manualLayout, {
456
- x: f,
457
- y: p,
458
- w: h,
459
- h: g
460
- }, k(r, _.richRuns, a, i, _.fontBold ?? !1, _.textStyle), void 0, _.textStyle, a, _.labelBox, o);
364
+ }, n, E.fontColor ? `#${E.fontColor}` : "#ffffff", E.manualLayout, {
365
+ x: c,
366
+ y: l,
367
+ w: f,
368
+ h: p
369
+ }, je(t, E.richRuns, r, a, E.fontBold ?? !1, E.textStyle), void 0, E.textStyle, r, E.labelBox, i);
461
370
  }
462
371
  }
463
- if (!r.catAxisHidden && !r.catAxisLineHidden) {
464
- let e = u(r.catAxisLineColor, r.catAxisLineWidthEmu, a);
465
- t.strokeStyle = e.color, t.lineWidth = e.width, t.beginPath(), t.moveTo(F, I), t.lineTo(F, I + L), t.stroke();
372
+ if (!t.catAxisHidden && !t.catAxisLineHidden) {
373
+ let n = O(t.catAxisLineColor, t.catAxisLineWidthEmu, r);
374
+ e.strokeStyle = n.color, e.lineWidth = n.width, e.beginPath(), e.moveTo(N, P), e.lineTo(N, P + L), e.stroke();
466
375
  }
467
- he(t, T, E, f, p, h, g, F, I, ie, L, _.bandH + 2, a, [w], o), t.restore();
376
+ Me(e, b, x, c, l, f, p, N, P, F, L, m.bandH + 2, r, [y], i), e.restore();
468
377
  }
469
- function Ae(e, t, n, r, i = 0) {
470
- let a = t.series[0];
471
- if (!a || C(e, n, Math.max(t.categories.length, a.categories?.length ?? 0, a.values.length))) return;
472
- let o = be(a, t.categories, { sortDescending: !1 });
473
- if (o.points.length === 0) return;
474
- let s = de(a, 0), c = O(t, t.chartexDataPointLineStyle, a, s, 1, R(0, a), { linkedNoStyleFallback: !0 });
475
- x(e, {
476
- ...t,
378
+ function J(e, t, n, i, a = 0) {
379
+ let o = t.series[0];
380
+ if (!o || Le(e, n, Math.max(t.categories.length, o.categories?.length ?? 0, o.values.length))) return;
381
+ let s = x(o, t.categories, { sortDescending: t.chartexParetoSortDescending ?? !1 });
382
+ if (s.points.length === 0) return;
383
+ let c = v(o, 0), l = [t.chartexDataPointStyle, t.chartexDataPointLineStyle], u = Te(t, Se(o, c), l, l, c, 1, `#${U(t, c, 1, o.chartexStyle)}`, { linkedNoStyleFallback: !0 });
384
+ Pe(e, r(t, {
477
385
  chartType: "line",
478
- categories: o.categories,
386
+ categories: t.chartexParetoFlatEndpoint ? [...s.categories, ""] : s.categories,
479
387
  series: [{
480
- ...o.series,
388
+ ...s.series,
389
+ values: t.chartexParetoFlatEndpoint ? [...s.series.values, 1] : s.series.values,
481
390
  showMarker: !1,
482
- lineHidden: !c.visible,
483
- lineColor: c.color.replace(/^#/, ""),
484
- lineWidthEmu: c.widthEmu,
391
+ lineHidden: !u.visible,
392
+ lineColor: u.color.replace(/^#/, ""),
393
+ lineWidthEmu: u.widthEmu ?? 9525,
485
394
  chartexStyle: {
486
- lineDash: c.dash,
487
- lineCap: c.cap,
488
- lineJoin: c.join
395
+ lineDash: u.dash,
396
+ lineCap: u.cap,
397
+ lineJoin: u.join
489
398
  }
490
399
  }],
491
400
  catAxisHidden: !1,
492
- catAxisTickLabelPos: "none",
401
+ catAxisTickLabelPos: t.chartexParetoSortDescending == null || !(o.categories ?? t.categories).some((e) => e != null && e !== "") ? "none" : "nextTo",
493
402
  showLegend: !1,
494
403
  valMin: t.valMin ?? 0,
495
- valMax: t.valMax ?? 1.2,
496
- valAxisMajorUnit: t.valAxisMajorUnit ?? .2
497
- }, n, r, i);
404
+ valMax: t.valMax ?? (t.valAxisFormatCode === "0%" ? 1 : 1.2),
405
+ valAxisMajorUnit: t.valAxisMajorUnit ?? (t.valAxisFormatCode === "0%" ? .1 : .2)
406
+ }), n, i, a);
407
+ }
408
+ function Y(e) {
409
+ return {
410
+ min: e.secondaryValAxis?.min ?? 0,
411
+ max: e.secondaryValAxis?.max ?? 1,
412
+ title: e.secondaryValAxis?.title ?? null,
413
+ hidden: e.secondaryValAxis?.hidden ?? !1,
414
+ formatCode: e.secondaryValAxis?.formatCode ?? "0%",
415
+ fontColor: e.secondaryValAxis?.fontColor ?? null,
416
+ fontSizeHpt: e.secondaryValAxis?.fontSizeHpt ?? null,
417
+ fontFace: e.secondaryValAxis?.fontFace ?? null,
418
+ lineColor: e.secondaryValAxis?.lineColor ?? null,
419
+ lineWidthEmu: e.secondaryValAxis?.lineWidthEmu ?? null,
420
+ lineHidden: e.secondaryValAxis?.lineHidden ?? !1,
421
+ majorTickMark: e.secondaryValAxis?.majorTickMark ?? "out",
422
+ minorTickMark: e.secondaryValAxis?.minorTickMark ?? null,
423
+ majorUnit: e.secondaryValAxis?.majorUnit ?? null,
424
+ minorUnit: e.secondaryValAxis?.minorUnit ?? null,
425
+ titleFontSizeHpt: e.secondaryValAxis?.titleFontSizeHpt ?? null,
426
+ titleFontBold: e.secondaryValAxis?.titleFontBold ?? null,
427
+ titleFontColor: e.secondaryValAxis?.titleFontColor ?? null,
428
+ titleFontFace: e.secondaryValAxis?.titleFontFace ?? null
429
+ };
498
430
  }
499
- function je(e, t, n, r, i = 0) {
500
- let a = t.series[0];
501
- if (!a || C(e, n, Math.max(t.categories.length, a.categories?.length ?? 0, a.values.length))) return;
502
- let o = be(a, t.categories);
503
- if (o.points.length === 0) return;
504
- let s = t.series.find((e) => e.seriesType === "line"), c = s?.chartexFormatIdx ?? a.chartexFormatIdx ?? 0, l = {
505
- ...s ?? o.series,
506
- name: s?.name || "Cumulative %",
507
- values: o.series.values,
508
- categories: o.categories,
509
- color: s?.color ?? F(t, t.chartexDataPointLineStyle, "line", c, 1) ?? a.lineColor ?? a.color,
431
+ function X(e, t, n, i, a = 0) {
432
+ let o = t.series.filter((e) => e.seriesType !== "line"), s = t.chartexParetoOwnerIndex ?? 0, c = o[s];
433
+ if (!c || o.length === 0 || Le(e, n, Math.max(t.categories.length, ...o.map((e) => e.values.length)))) return;
434
+ let l = o.map((e, n) => x(n === 0 ? K(t, e, n, o.length) : e, t.categories, {
435
+ sortDescending: t.chartexParetoSortDescending ?? !0,
436
+ keepUnvaluedCategories: !0
437
+ })), u = l[s], d = l[0];
438
+ if (u.points.length === 0 || d.points.length === 0) return;
439
+ let f = t.chartexParetoFlatEndpoint === !0 && d.categories.length === d.points.length, p = t.series.find((e) => e.seriesType === "line"), m = p?.chartexFormatIdx ?? c.chartexFormatIdx ?? 0, h = {
440
+ ...p ?? u.series,
441
+ name: p?.name || "Cumulative %",
442
+ values: u.series.values,
443
+ categories: d.categories,
444
+ color: p?.color ?? We(t, t.chartexDataPointLineStyle, "line", m, 1) ?? c.lineColor ?? c.color,
510
445
  seriesType: "line",
511
446
  useSecondaryAxis: !0,
512
447
  showMarker: !1
513
- }, u = {
514
- min: t.secondaryValAxis?.min ?? 0,
515
- max: t.secondaryValAxis?.max ?? 1,
516
- title: t.secondaryValAxis?.title ?? null,
517
- hidden: t.secondaryValAxis?.hidden ?? !1,
518
- formatCode: t.secondaryValAxis?.formatCode ?? "0%",
519
- fontColor: t.secondaryValAxis?.fontColor ?? null,
520
- fontSizeHpt: t.secondaryValAxis?.fontSizeHpt ?? null,
521
- fontFace: t.secondaryValAxis?.fontFace ?? null,
522
- lineColor: t.secondaryValAxis?.lineColor ?? null,
523
- lineWidthEmu: t.secondaryValAxis?.lineWidthEmu ?? null,
524
- lineHidden: t.secondaryValAxis?.lineHidden ?? !1,
525
- majorTickMark: t.secondaryValAxis?.majorTickMark ?? "out",
526
- minorTickMark: t.secondaryValAxis?.minorTickMark ?? null,
527
- majorUnit: t.secondaryValAxis?.majorUnit ?? null,
528
- minorUnit: t.secondaryValAxis?.minorUnit ?? null,
529
- titleFontSizeHpt: t.secondaryValAxis?.titleFontSizeHpt ?? null,
530
- titleFontBold: t.secondaryValAxis?.titleFontBold ?? null,
531
- titleFontColor: t.secondaryValAxis?.titleFontColor ?? null,
532
- titleFontFace: t.secondaryValAxis?.titleFontFace ?? null
533
- };
534
- A(e, {
535
- ...t,
448
+ }, g = Y(t);
449
+ ze(e, r(t, {
536
450
  chartType: "clusteredBar",
537
- categories: o.categories,
538
- series: [{
539
- ...o.orderedSeries,
451
+ categories: f ? [...d.categories, ""] : d.categories,
452
+ series: [...l.map((e) => ({
453
+ ...e.orderedSeries,
454
+ values: f ? [...e.orderedSeries.values, null] : e.orderedSeries.values,
540
455
  seriesType: null,
541
456
  useSecondaryAxis: !1
542
- }, l],
543
- secondaryValAxis: u
544
- }, n, r, {
457
+ })), f ? {
458
+ ...h,
459
+ values: [...h.values, 1]
460
+ } : h],
461
+ secondaryValAxis: g
462
+ }), n, i, {
545
463
  gapPolicy: "chartex",
546
464
  semanticLineNoStyleFallback: !0
547
- }, i);
465
+ }, a);
548
466
  }
549
- var K = 7, q = .05, Me = 1.2;
550
- function Ne(e, t, n, r) {
467
+ var Xe = 7, Z = .05, Q = 1.2;
468
+ function Ze(e, t, n, r) {
551
469
  let i = (r ?? t) - (n ?? e);
552
470
  if (!(i > 0) || !Number.isFinite(i)) return null;
553
- let a = b(i, K);
471
+ let a = ie(i, Xe);
554
472
  if (!(a > 0) || !Number.isFinite(a)) return null;
555
- let o = e - i * q, s = t + i * q;
556
- e >= 0 && (e === 0 || t > Me * e) && (o = 0), t <= 0 && (t === 0 || Math.abs(e) > Me * Math.abs(t)) && (s = 0);
473
+ let o = e - i * Z, s = t + i * Z;
474
+ e >= 0 && (e === 0 || t > Q * e) && (o = 0), t <= 0 && (t === 0 || Math.abs(e) > Q * Math.abs(t)) && (s = 0);
557
475
  let c = n ?? Math.floor(o / a) * a, l = r ?? Math.ceil(s / a) * a;
558
476
  return ![c, l].every(Number.isFinite) || !(l > c) ? null : {
559
477
  min: c,
@@ -561,272 +479,290 @@ function Ne(e, t, n, r) {
561
479
  majorUnit: a
562
480
  };
563
481
  }
564
- function J(n, i, c, p, _) {
565
- let b = 3 * p, x = i.chartexBox;
566
- if (!x || x.categories.length === 0 || x.series.length === 0) return;
567
- let { x: S, y: O, w: k, h: A } = c;
568
- if (C(n, c, h(x.series.map((e) => e.valuesByCategory), 1e4))) return;
569
- let M = () => {
570
- n.fillStyle = "#888", n.font = "12px sans-serif", n.textAlign = "center", n.textBaseline = "middle", n.fillText("(chart values out of range)", S + k / 2, O + A / 2);
571
- }, te = (e) => {
482
+ function Qe(e, n, r, i, o) {
483
+ let c = 3 * i, f = n.chartexBox;
484
+ if (!f || f.categories.length === 0 || f.series.length === 0) return;
485
+ let { x: m, y: h, w: y, h: x } = r;
486
+ if (Le(e, r, t(f.series.map((e) => e.valuesByCategory), 1e4))) return;
487
+ let C = () => {
488
+ e.fillStyle = "#888", e.font = "12px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("(chart values out of range)", m + y / 2, h + x / 2);
489
+ }, T = (e) => {
572
490
  let t = e.max - e.min, n = t / e.step;
573
491
  return Number.isFinite(e.min) && Number.isFinite(e.max) && Number.isFinite(e.step) && Number.isFinite(t) && Number.isFinite(n) && e.max > e.min && e.step > 0 && n <= 1e3 && e.min + e.step > e.min;
574
- }, R = Infinity, z = -Infinity;
575
- for (let e of x.series) for (let t of e.valuesByCategory) for (let e of t) Number.isFinite(e) && (e < R && (R = e), e > z && (z = e));
576
- if (!isFinite(R) || !isFinite(z)) return;
577
- if (!Number.isFinite(z - R)) {
578
- M();
492
+ }, k = Infinity, j = -Infinity;
493
+ for (let e of f.series) for (let t of e.valuesByCategory) for (let e of t) Number.isFinite(e) && (e < k && (k = e), e > j && (j = e));
494
+ if (!isFinite(k) || !isFinite(j)) return;
495
+ if (!Number.isFinite(j - k)) {
496
+ C();
579
497
  return;
580
498
  }
581
- let ae = i.valAxisMajorUnit == null ? Ne(R, z, i.valMin, i.valMax) : null, me = ae ? {
582
- ...i,
583
- valMin: ae.min,
584
- valMax: ae.max,
585
- valAxisMajorUnit: ae.majorUnit
586
- } : i, ge = V(i, i.valAxisFontFace, "minor"), H = ce(i.valAxisFontSizeHpt, A, p), U = f(H), _e = I(p), ve = y({
587
- dataMin: R,
588
- dataMax: z,
589
- explicitMin: me.valMin,
590
- explicitMax: me.valMax,
591
- axisLenPt: A / p,
592
- majorUnit: me.valAxisMajorUnit
499
+ let N = n.valAxisMajorUnit == null ? Ze(k, j, n.valMin, n.valMax) : null, F = N ? {
500
+ ...n,
501
+ valMin: N.min,
502
+ valMax: N.max,
503
+ valAxisMajorUnit: N.majorUnit
504
+ } : n, L = M(n, n.valAxisFontFace, "minor"), re = _(n.valAxisFontSizeHpt, x, i), R = V(re), ie = Oe(i), B = p({
505
+ dataMin: k,
506
+ dataMax: j,
507
+ explicitMin: F.valMin,
508
+ explicitMax: F.valMax,
509
+ axisLenPt: x / i,
510
+ majorUnit: F.valAxisMajorUnit
593
511
  });
594
- if (!te({
595
- min: ve.min,
596
- max: ve.max,
597
- step: ve.majorUnit
512
+ if (!T({
513
+ min: B.min,
514
+ max: B.max,
515
+ step: B.majorUnit
598
516
  })) {
599
- M();
517
+ C();
600
518
  return;
601
519
  }
602
- let ye = 0;
603
- if (!i.valAxisHidden) {
604
- let e = n.font;
605
- n.font = se(H, ge, i.valAxisFontBold ?? !1, i.valAxisFontItalic ?? !1);
520
+ let ae = 0;
521
+ if (!n.valAxisHidden) {
522
+ let t = e.font;
523
+ e.font = ye(re, L, n.valAxisFontBold ?? !1, n.valAxisFontItalic ?? !1);
606
524
  let r = 0;
607
- for (let e of ve.majorTicks) {
608
- let t = N(i, e, !1);
609
- r = Math.max(r, n.measureText(t).width);
525
+ for (let t of B.majorTicks) {
526
+ let i = _e(n, t, !1);
527
+ r = Math.max(r, ne(e, i));
610
528
  }
611
- n.font = e, ye = r + U + t * p;
529
+ e.font = t, ae = r + R + s * i;
612
530
  }
613
- let be = pe(n, i, k, A, p), xe = ce(i.catAxisFontSizeHpt, A, p), Se = ce(i.valAxisFontSizeHpt, A, p), Ce = o(i, k, A, p), W = x.series.length, we = x.series.map((e, t) => de(e, t)), Te = x.series.map((e, t) => {
614
- let n = we[t], r = e.color ?? P(i, n, W, e.chartexStyle);
615
- return re(i, e.name, e, i.chartexDataPointStyle, n, W, r, !0);
616
- }), Ee = {
617
- ...i,
618
- series: Te
619
- }, De = ee(n, Ee, k, A, .22, p), { legRightW: G, legLeftW: Oe, legTopH: ke, legBottomH: Ae } = v(De, i.legendOverlay === !0), je = s(i, S, O, k, A, p, {
620
- titleBand: be,
621
- legendSideReserveFrac: .22,
622
- legendReserve: De,
531
+ let le = Ae(e, n, y, x, i), de = _(n.catAxisFontSizeHpt, x, i), fe = _(n.valAxisFontSizeHpt, x, i), me = a(n, y, x, i), H = f.series.length, ve = f.series.map((e, t) => v(e, t)), be = f.series.map((e, t) => {
532
+ let r = ve[t], i = e.color ?? U(n, r, H, e.chartexStyle), a = ke(n, e.name, Se(e, r) ?? e, n.chartexDataPointStyle, r, H, i, !0), o = Ce(n, e, r, H, i);
533
+ return o.darkened && a.lineColor != null ? {
534
+ ...a,
535
+ lineColor: o.line.color.replace(/^#/, "")
536
+ } : a;
537
+ }), xe = {
538
+ ...n,
539
+ series: be
540
+ }, Te = Be(e, xe, y, x, i), { legRightW: De, legLeftW: je, legTopH: Pe, legBottomH: Ie } = u(Te, n.legendOverlay === !0), ze = n.valAxisHidden ? 0 : oe(B.majorTicks.map((e) => _e(n, e, !1)), A(re)) / 2, He = n.catAxisHidden ? 0 : oe(f.categories, A(de)), Ge = te(n, m, h, y, x, i, {
541
+ titleBand: le,
542
+ legendReserve: Te,
623
543
  pad: {
624
- t: be.bandH + ke + Se / 2 + 2,
625
- r: G + k * .02,
626
- b: Ae + Ce.catBandH + (i.catAxisHidden ? A * .02 : r(xe)),
627
- l: Oe + Ce.valBandW + (i.valAxisHidden ? k * .02 : ye)
544
+ t: le.bandH + Pe + fe / 2 + 2 + ze,
545
+ r: De + y * .02,
546
+ b: Ie + me.catBandH + (n.catAxisHidden ? x * .02 : b(de) + He),
547
+ l: je + me.valBandW + (n.valAxisHidden ? y * .02 : ae)
628
548
  },
629
549
  honorPlotAreaManualLayout: !0
630
- }), { px0: K, py0: q, pw: Me, ph: J } = je.plotRect;
631
- m(n, i, K, q, Me, J, p, _);
632
- let Pe = x.categories, Fe = Pe.length, Ie = w(me, R, z, J / p);
633
- if (!te(Ie)) {
634
- M();
550
+ }), { px0: W, py0: G, pw: Ke, ph: K } = Ge.plotRect;
551
+ if (Ke <= 0 || K <= 0) {
552
+ Ve(e, n, m, h, y, x, h + Ge.title.topPad, Ge.title.fontPx);
553
+ return;
554
+ }
555
+ ge(e, n, W, G, Ke, K, i, o);
556
+ let qe = f.categories, Je = qe.length, Ye = se(F, k, j, K / i);
557
+ if (!T(Ye)) {
558
+ C();
635
559
  return;
636
560
  }
637
- fe(n, i, S, O, k, A, O + je.title.topPad, je.title.fontPx);
638
- let { min: Le, max: Re } = Ie, ze = Re - Le, Y = (e) => q + J * (1 - (e - Le) / ze), X = u(i.valAxisLineColor, i.valAxisLineWidthEmu, p), Z = E(i, p);
639
- if (n.save(), !i.valAxisHidden) {
640
- if (n.font = se(H, ge, i.valAxisFontBold ?? !1, i.valAxisFontItalic ?? !1), n.textAlign = "right", n.textBaseline = "middle", i.valAxisMinorGridlines) {
641
- let e = D(i, p);
642
- for (let t of Ie.minorLines) T(n, K, Me, Y(t), !1, e);
561
+ Ve(e, n, m, h, y, x, h + Ge.title.topPad, Ge.title.fontPx);
562
+ let { min: q, max: J } = Ye, Y = J - q, X = (e) => G + K * (1 - (e - q) / Y), Xe = O(n.valAxisLineColor, n.valAxisLineWidthEmu, i), Z = ue(n, i);
563
+ if (e.save(), !n.valAxisHidden) {
564
+ if (e.font = ye(re, L, n.valAxisFontBold ?? !1, n.valAxisFontItalic ?? !1), e.textAlign = "right", e.textBaseline = "middle", n.valAxisMinorGridlines) {
565
+ let t = he(n, i);
566
+ for (let n of Ye.minorLines) z(e, W, Ke, X(n), !1, t);
643
567
  }
644
- for (let e of Ie.majorLines) {
645
- let t = Y(e);
646
- if (i.valAxisMajorGridlines !== !1) {
647
- n.strokeStyle = Z.color, n.lineWidth = Z.width;
648
- let e = Z.dash.length > 0 && n.getLineDash ? n.getLineDash() : [];
649
- Z.dash.length > 0 && n.setLineDash(Z.dash), n.beginPath(), n.moveTo(K, t), n.lineTo(K + Me, t), n.stroke(), Z.dash.length > 0 && n.setLineDash(e);
568
+ for (let t of Ye.majorLines) {
569
+ let r = X(t);
570
+ if (n.valAxisMajorGridlines !== !1) {
571
+ e.strokeStyle = Z.color, e.lineWidth = Z.width;
572
+ let t = Z.dash.length > 0 && e.getLineDash ? e.getLineDash() : [];
573
+ Z.dash.length > 0 && e.setLineDash(Z.dash), e.beginPath(), e.moveTo(W, r), e.lineTo(W + Ke, r), e.stroke(), Z.dash.length > 0 && e.setLineDash(t);
650
574
  }
651
- n.fillStyle = i.valAxisFontColor ? `#${i.valAxisFontColor}` : "#595959", n.fillText(N(i, e, !1), K - _e, t), L(n, i.valAxisMajorTickMark, "val", K, t, X.color, X.width, !1, i.valAxisLineHidden, "major", p, i.valAxisLineDash);
575
+ e.fillStyle = n.valAxisFontColor ? `#${n.valAxisFontColor}` : "#595959", ce(e, _e(n, t, !1), W - ie, r, A(re)), l(e, n.valAxisMajorTickMark, "val", W, r, Xe.color, Xe.width, !1, n.valAxisLineHidden, "major", i, n.valAxisLineDash);
652
576
  }
653
- for (let e of Ie.minorTicks) L(n, i.valAxisMinorTickMark, "val", K, Y(e), X.color, X.width, !1, i.valAxisLineHidden, "minor", p, i.valAxisLineDash);
654
- i.valAxisLineHidden || j(n, K, q, K, q + J, X.color, X.width, i.valAxisLineDash);
577
+ for (let t of Ye.minorTicks) l(e, n.valAxisMinorTickMark, "val", W, X(t), Xe.color, Xe.width, !1, n.valAxisLineHidden, "minor", i, n.valAxisLineDash);
578
+ n.valAxisLineHidden || pe(e, W, G, W, G + K, Xe.color, Xe.width, n.valAxisLineDash);
655
579
  }
656
- let Q = u(i.catAxisLineColor, i.catAxisLineWidthEmu, p);
657
- !i.catAxisHidden && !i.catAxisLineHidden && j(n, K, q + J, K + Me, q + J, Q.color, Q.width, i.catAxisLineDash);
658
- let $ = Me / Fe, Be = e(i.barGapWidth, "chartex"), Ve = (e) => `#${x.series[e].color ?? P(i, we[e], W, x.series[e].chartexStyle)}`, He = (e) => oe(i, we[e], W, x.series[e].chartexStyle, x.series[e].color), Ue = x.series.map((e) => e.valuesByCategory.map((t) => d(t, e.quartileMethod))), We = (e, t) => {
659
- let n = l(K, Me, x.oneBoxPerSeries ? 1 : Fe, W, x.oneBoxPerSeries ? 0 : e, t, Be);
580
+ let Q = O(n.catAxisLineColor, n.catAxisLineWidthEmu, i);
581
+ !n.catAxisHidden && !n.catAxisLineHidden && pe(e, W, G + K, W + Ke, G + K, Q.color, Q.width, n.catAxisLineDash);
582
+ let Qe = Ke / Je, $e = I(n.barGapWidth, "chartex"), et = (e) => `#${f.series[e].color ?? U(n, ve[e], H, f.series[e].chartexStyle)}`, tt = (e) => Ue(n, ve[e], H, f.series[e].chartexStyle, f.series[e].color), $ = f.series.map((e) => e.valuesByCategory.map((t) => P(t, e.quartileMethod))), nt = n.chartStyleMarkerSymbol ?? n.chartexMarkerSymbol ?? "circle", rt = f.series.map((e, t) => nt === "none" ? $[t].map(() => []) : g($[t], e.showNonoutliers, e.showOutliers, X, 3 * i)), it = (e, t) => {
583
+ let n = D(W, Ke, f.oneBoxPerSeries ? 1 : Je, H, f.oneBoxPerSeries ? 0 : e, t, $e);
660
584
  return n ? {
661
585
  bx: n.boxX,
662
586
  boxW: n.boxWidth,
663
587
  cx: n.centerX
664
588
  } : {
665
- bx: K,
589
+ bx: W,
666
590
  boxW: 0,
667
- cx: K
591
+ cx: W
668
592
  };
669
- };
670
- for (let e = 0; e < W; e++) {
671
- let t = x.series[e];
672
- if (!t.meanLine) continue;
673
- let r = i.chartexDataPointLineStyle ?? i.chartexDataPointStyle, a = t.lineColor ? `#${t.lineColor}` : Ve(e);
674
- if (n.save(), ue(n, i, r, t, we[e], W, a, p) || t.lineColor != null) {
675
- t.lineColor && (n.strokeStyle = a), t.lineWidthEmu && (n.lineWidth = g(t.lineWidthEmu, p));
676
- let r = !1;
677
- n.beginPath();
678
- for (let t = 0; t < Fe; t++) {
679
- let i = Ue[e][t];
593
+ }, at = (t, r) => {
594
+ let a = f.series[t], s = $[t][r];
595
+ if (!s) return;
596
+ let { bx: l, boxW: u, cx: p } = it(r, t), m = et(t), h = tt(t), g = n.chartexDataPointStyle, _ = n.chartexDataPointMarkerStyle ?? g, v = ve[t], y = Se(a, v) ?? a, b = We(n, g, "line", v, H), x = y.lineColor ? `#${y.lineColor}` : b ? `#${b}` : m, S = Ce(n, a, v, H, x).line, C = We(n, _, "fill", v, H), w = Ee(n, v, H, a.chartexStyle, a.color, _), T = Fe(n, _, y, v, H, We(n, _, "line", v, H) ?? x, { linkedNoStyleFallback: !0 }), te = d(a.chartexStyle), D = X(s.q1), O = X(s.q3), k = Math.min(D, O), A = Math.max(1, Math.abs(D - O)), j = u * .4;
597
+ if (Ne(e, S, i)) {
598
+ let t = X(s.whiskerHi), n = X(s.whiskerLo);
599
+ e.beginPath(), s.whiskerHi > s.q3 && (e.moveTo(p, t), e.lineTo(p, O)), s.whiskerLo < s.q1 && (e.moveTo(p, D), e.lineTo(p, n)), s.whiskerHi >= s.q3 && (e.moveTo(p - j / 2, t), e.lineTo(p + j / 2, t)), s.whiskerLo <= s.q1 && (e.moveTo(p - j / 2, n), e.lineTo(p + j / 2, n)), e.stroke();
600
+ }
601
+ ee(e, a.chartexStyle, g, v, {
602
+ x: l,
603
+ y: k,
604
+ w: u,
605
+ h: A
606
+ }, i, (e) => {
607
+ if (h && we(e, h, {
608
+ x: l,
609
+ y: k,
610
+ w: u,
611
+ h: A
612
+ }, m, i, o), Ne(e, S, i, {
613
+ x: l,
614
+ y: k,
615
+ w: u,
616
+ h: A
617
+ }, o)) {
618
+ let t = e.lineWidth;
619
+ e.strokeRect(l + t / 2, k + t / 2, u - t, A - t);
620
+ }
621
+ });
622
+ let M = X(s.median);
623
+ Ne(e, S, i) && (e.beginPath(), e.moveTo(l, M), e.lineTo(l + u, M), e.stroke());
624
+ for (let n of rt[t][r]) Re(e, p, X(n), nt, 3, w ? C ? `#${C}` : m : "transparent", T.visible ? T.color : null, i, T.widthEmu == null ? 1 : E(T.widthEmu, i), w, o, T.visible ? T.paint : null, T.dash, T.customDash, T.cap, T.join, !1, te, _, v, v);
625
+ if (a.meanMarker) {
626
+ let t = X(s.mean), n = c;
627
+ Ne(e, S, i) && (e.beginPath(), e.moveTo(p - n, t - n), e.lineTo(p + n, t + n), e.moveTo(p + n, t - n), e.lineTo(p - n, t + n), e.stroke());
628
+ }
629
+ }, ot = (t) => {
630
+ let r = f.series[t];
631
+ if (!r.meanLine) return;
632
+ let a = Ce(n, r, ve[t], H, et(t)).line;
633
+ if (e.save(), Ne(e, a, i)) {
634
+ let n = !1;
635
+ e.beginPath();
636
+ for (let r = 0; r < Je; r++) {
637
+ let i = $[t][r];
680
638
  if (!i) {
681
- r = !1;
639
+ n = !1;
682
640
  continue;
683
641
  }
684
- let { cx: a } = We(t, e), o = Y(i.mean);
685
- r ? n.lineTo(a, o) : n.moveTo(a, o), r = !0;
642
+ let { cx: a } = it(r, t), o = X(i.mean);
643
+ n ? e.lineTo(a, o) : e.moveTo(a, o), n = !0;
686
644
  }
687
- n.stroke();
645
+ e.stroke();
688
646
  }
689
- n.restore();
647
+ e.restore();
648
+ };
649
+ for (let e = 0; e < H; e++) {
650
+ for (let t = 0; t < Je; t++) at(e, t);
651
+ ot(e);
690
652
  }
691
- let Ge = ce(i.catAxisFontSizeHpt, A, p), Ke = a(Ge);
692
- for (let e = 0; e < Fe; e++) {
693
- let t = K + $ * (e + .5);
694
- i.catAxisHidden || L(n, i.catAxisMajorTickMark, "cat", q + J, t, Q.color, Q.width, !1, i.catAxisLineHidden, "major", p, i.catAxisLineDash);
695
- for (let t = 0; t < W; t++) {
696
- let r = x.series[t], a = Ue[t][e];
697
- if (!a) continue;
698
- let { bx: o, boxW: s, cx: c } = We(e, t), l = Ve(t), u = He(t), d = i.chartexDataPointStyle, f = i.chartexDataPointLineStyle ?? d, m = i.chartexDataPointMarkerStyle ?? d, h = we[t], v = F(i, d, "line", h, W), y = r.lineColor ? `#${r.lineColor}` : v ? `#${v}` : l, S = r.lineWidthEmu ? g(r.lineWidthEmu, p) : d?.lineWidthEmu == null ? 1 : g(d.lineWidthEmu, p), C = F(i, f, "line", h, W), w = F(i, m, "fill", h, W), T = B(i, h, W, r.chartexStyle, r.color, m), E = F(i, m, "line", h, W), D = (e, t) => {
699
- let a = r.chartexStyle, o = a?.lineHidden != null || a?.lineColors?.some(Boolean) || a?.lineWidthEmu != null || a?.lineDash != null || a?.lineCap != null || a?.lineJoin != null, s = ue(n, i, e, r, h, W, t, p), c = e?.lineNoStyle === !0 && !o && r.lineColor == null && r.lineWidthEmu == null;
700
- return !s && c && (n.strokeStyle = t, n.lineWidth = 1, n.setLineDash([])), r.lineColor && (n.strokeStyle = y), r.lineWidthEmu && (n.lineWidth = S), s || c || r.lineColor != null;
701
- }, O = Y(a.q1), k = Y(a.q3), A = Math.min(O, k), j = Math.max(1, Math.abs(O - k)), M = s * .4;
702
- D(f, C ?? y) && (n.beginPath(), n.moveTo(c, Y(a.whiskerHi)), n.lineTo(c, k), n.moveTo(c, O), n.lineTo(c, Y(a.whiskerLo)), n.moveTo(c - M / 2, Y(a.whiskerHi)), n.lineTo(c + M / 2, Y(a.whiskerHi)), n.moveTo(c - M / 2, Y(a.whiskerLo)), n.lineTo(c + M / 2, Y(a.whiskerLo)), n.stroke()), u && (n.fillStyle = le(n, u, o, A, s, j, l, _), n.fillRect(o, A, s, j)), D(d, y) && n.strokeRect(o + S / 2, A + S / 2, s - S, j - S);
703
- let N = Y(a.median);
704
- if (D(f, C ?? y) && (n.beginPath(), n.moveTo(o, N), n.lineTo(o + s, N), n.stroke()), r.showNonoutliers) {
705
- let e = i.chartStyleMarkerSymbol ?? i.chartexMarkerSymbol ?? "circle";
706
- for (let t of a.inner) {
707
- if (e === "none") continue;
708
- let r = D(m, E ?? y);
709
- ne(n, c, Y(t), e, 3, T ? w ? `#${w}` : l : "transparent", r ? y : null, p, n.lineWidth, T, _);
710
- }
711
- }
712
- if (r.meanMarker) {
713
- let e = Y(a.mean), t = b;
714
- D(m, E ?? y) && (n.beginPath(), n.moveTo(c - t, e - t), n.lineTo(c + t, e + t), n.moveTo(c + t, e - t), n.lineTo(c - t, e + t), n.stroke());
715
- }
716
- if (r.showOutliers) {
717
- let e = i.chartStyleMarkerSymbol ?? i.chartexMarkerSymbol ?? "circle";
718
- for (let t of a.outliers) {
719
- if (e === "none") continue;
720
- let r = D(m, E ?? y);
721
- ne(n, c, Y(t), e, 3, T ? w ? `#${w}` : l : "transparent", r ? y : null, p, n.lineWidth, T, _);
722
- }
723
- }
724
- }
725
- if (!i.catAxisHidden) {
726
- n.font = se(Ge, V(i, i.catAxisFontFace, "minor"), i.catAxisFontBold ?? !1, i.catAxisFontItalic ?? !1), n.fillStyle = i.catAxisFontColor ? `#${i.catAxisFontColor}` : "#595959", n.textAlign = "center", n.textBaseline = "top";
727
- let r = Pe[e];
728
- n.fillText(r, t, q + J + Ke);
653
+ let st = _(n.catAxisFontSizeHpt, x, i), ct = S(st);
654
+ for (let t = 0; t < Je; t++) {
655
+ let r = W + Qe * (t + .5);
656
+ if (n.catAxisHidden || l(e, n.catAxisMajorTickMark, "cat", G + K, r, Q.color, Q.width, !1, n.catAxisLineHidden, "major", i, n.catAxisLineDash), !n.catAxisHidden) {
657
+ e.font = ye(st, M(n, n.catAxisFontFace, "minor"), n.catAxisFontBold ?? !1, n.catAxisFontItalic ?? !1), e.fillStyle = n.catAxisFontColor ? `#${n.catAxisFontColor}` : "#595959", e.textAlign = "center", e.textBaseline = "top";
658
+ let i = qe[t];
659
+ ce(e, i, r, G + K + ct, A(st));
729
660
  }
730
661
  }
731
- n.restore(), ie(n, i, S, O, k, A, K, q, Me, J, Oe, Ae, Ce.catFontPx, Ce.valFontPx), he(n, Ee, De, S, O, k, A, K, q, Me, J, be.bandH + 2, p, x.series.map((e, t) => He(t)), _);
662
+ e.restore(), w(e, n, m, h, y, x, W, G, Ke, K, je, Ie, me.catFontPx, me.valFontPx), Me(e, xe, Te, m, h, y, x, W, G, Ke, K, le.bandH + 2, i, f.series.map((e, t) => tt(t)), o);
732
663
  }
733
- var Pe = .18;
734
- function Fe(e, t, r, a, o) {
735
- let c = t.chartexSunburst;
736
- if (!c || c.rows.length === 0) return;
737
- let { x: l, y: u, w: d, h: f } = r;
738
- if (xe(c.rows)) {
739
- C(e, r, i + 1);
664
+ var $e = .18;
665
+ function et(e, t, n, a, o) {
666
+ let s = t.chartexSunburst;
667
+ if (!s || s.rows.length === 0) return;
668
+ let { x: l, y: u, w: f, h: p } = n;
669
+ if (h(s.rows)) {
670
+ Le(e, n, R + 1);
740
671
  return;
741
672
  }
742
- let p = Se(c.rows);
743
- if (p.layoutWeight <= 0 || p.children.length === 0) return;
744
- let h = t.series[0], g = S(h?.dataLabelOverrides), _ = p.children.map((e, n) => oe(t, n, p.children.length, h?.chartexStyle, h?.color)), v = {
745
- ...t,
673
+ let g = m(s.rows);
674
+ if (g.layoutWeight <= 0 || g.children.length === 0) return;
675
+ let _ = t.series[0], v = be(_?.dataLabelOverrides), y = g.children.map((e, n) => Ue(t, n, g.children.length, _?.chartexStyle, _?.color)), b = r(t, {
746
676
  chartType: "clusteredBar",
747
- series: p.children.map((e) => {
748
- let n = P(t, e.branchIndex, p.children.length, h?.chartexStyle);
749
- return re(t, e.label, h, t.chartexDataPointStyle, e.branchIndex, p.children.length, n, !1, !1);
677
+ series: g.children.map((e) => {
678
+ let n = U(t, e.branchIndex, g.children.length, _?.chartexStyle);
679
+ return ke(t, e.label, _, t.chartexDataPointStyle, e.branchIndex, g.children.length, n, !1, !1);
750
680
  })
751
- }, y = ee(e, v, d, f, .22, a), b = s(t, l, u, d, f, a, {
681
+ }), x = Be(e, b, f, p, a), S = te(t, l, u, f, p, a, {
752
682
  titleTopPadFrac: .035,
753
683
  titleBottomPadFrac: .035,
754
- legendSideReserveFrac: 0,
755
- legendReserve: y,
684
+ legendReserve: x,
756
685
  radialGapFrac: .02,
757
686
  honorPlotAreaManualLayout: !0
758
687
  });
759
- fe(e, t, l, u, d, f, u + b.title.topPad, b.title.fontPx);
760
- let { px0: x, py0: w, pw: T, ph: E } = b.plotRect;
761
- m(e, t, x, w, T, E, a, o);
762
- let D = x + T / 2, O = w + E / 2, A = Math.min(T, E) * .46;
763
- p.a0 = -Math.PI / 2, p.a1 = -Math.PI / 2 + Math.PI * 2, Ce(p);
764
- let j = W(p) + 1, M = A * Pe, N = (A - M) / j, ne = (e) => `#${P(t, e, p.children.length, h?.chartexStyle)}`, F = (e) => oe(t, e, p.children.length, h?.chartexStyle, h?.color), I = h?.seriesDataLabels, ie = V(t, I?.fontFace ?? t.dataLabelFontFace, "minor"), L = n(I?.fontSizeHpt, a) ?? Math.max(7, Math.min(13, A * .075)), R = I?.fontColor ? `#${I.fontColor}` : "#ffffff", B = Array.from({ length: j }, () => []), ae = [p];
688
+ Ve(e, t, l, u, f, p, u + S.title.topPad, S.title.fontPx);
689
+ let { px0: C, py0: w, pw: E, ph: D } = S.plotRect;
690
+ if (!(E > 0) || !(D > 0)) return;
691
+ ge(e, t, C, w, E, D, a, o);
692
+ let O = C + E / 2, k = w + D / 2, A = Math.min(E, D) * .46;
693
+ g.a0 = -Math.PI / 2, g.a1 = -Math.PI / 2 + Math.PI * 2, i(g);
694
+ let j = c(g) + 1, ne = A * $e, N = (A - ne) / j, P = (e) => `#${U(t, e, g.children.length, _?.chartexStyle)}`, F = be(_?.dataPointOverrides), I = _?.seriesDataLabels, L = M(t, I?.fontFace ?? t.dataLabelFontFace, "minor"), z = T(I?.fontSizeHpt, a) ?? Math.max(7, Math.min(13, A * .075)), ie = I?.fontColor ? `#${I.fontColor}` : "#ffffff", B = Array.from({ length: j }, () => []), ae = [g];
765
695
  for (; ae.length > 0;) {
766
696
  let e = ae.pop();
767
697
  e.depth >= 0 && B[e.depth].push(e);
768
698
  for (let t = e.children.length - 1; t >= 0; t--) ae.push(e.children[t]);
769
699
  }
770
700
  e.save();
771
- for (let r = 0; r < j; r++) {
772
- let i = M + r * N, s = i + N;
773
- for (let c of B[r]) {
774
- let r = c.a1 - c.a0;
775
- if (r <= 1e-4) continue;
776
- e.beginPath(), e.arc(D, O, s, c.a0, c.a1), e.arc(D, O, i, c.a1, c.a0, !0), e.closePath();
777
- let m = F(c.branchIndex);
778
- m && (e.fillStyle = le(e, m, D - s, O - s, s * 2, s * 2, ne(c.branchIndex), o), e.fill()), ue(e, t, t.chartexDataPointStyle, t.series[0], c.branchIndex, p.children.length, "#ffffff", a) && e.stroke();
779
- let _ = z(t, h, c.labelIndex, c.label, c.value, {
701
+ for (let n = 0; n < j; n++) {
702
+ let r = ne + n * N, i = r + N;
703
+ for (let s of B[n]) {
704
+ let n = s.a1 - s.a0;
705
+ if (n <= 1e-4) continue;
706
+ let c = F.get(s.labelIndex), m = Ie(t, _, c, s.branchIndex, g.children.length), h = xe(t, _, c, s.branchIndex, g.children.length, "#ffffff"), y = {
707
+ x: O - i,
708
+ y: k - i,
709
+ w: i * 2,
710
+ h: i * 2
711
+ };
712
+ ee(e, d(c?.chartexStyle, _?.chartexStyle), t.chartexDataPointStyle, _?.chartexFormatIdx ?? 0, y, a, (e) => {
713
+ e.beginPath(), e.arc(O, k, i, s.a0, s.a1), e.arc(O, k, r, s.a1, s.a0, !0), e.closePath(), m && De(e, m, y, P(s.branchIndex), a, o), Ne(e, h, a, y, o) && e.stroke();
714
+ }, s.branchIndex);
715
+ let b = re(t, _, s.labelIndex, s.label, s.value, {
780
716
  visible: !1,
781
717
  showVal: !1,
782
718
  showCatName: !1
783
- }, g);
784
- if (!_) continue;
785
- let v = _.text, y = n(_.fontSizeHpt, a) ?? L, b = _.fontColor ? `#${_.fontColor}` : R, S = _.fontFace ? V(t, _.fontFace, "minor") : ie, C = (c.a0 + c.a1) / 2, A = (i + s) / 2, j = N - 4, M = r * A;
786
- if (!_.manualLayout && j < y * .9 && M < y * .9) continue;
787
- let ee = D + Math.cos(C) * A, P = O + Math.sin(C) * A;
788
- if (e.font = `${_.textStyle.fontItalic ? "italic " : ""}${_.fontBold ? "bold " : ""}${y}px ${S}`, _.manualLayout) {
789
- te(e, v, {
719
+ }, v);
720
+ if (!b) continue;
721
+ let x = b.text, S = T(b.fontSizeHpt, a) ?? z, te = b.fontColor ? `#${b.fontColor}` : ie, A = b.fontFace ? M(t, b.fontFace, "minor") : L, j = (s.a0 + s.a1) / 2, ne = (r + i) / 2, I = N - 4, R = n * ne;
722
+ if (!b.manualLayout && I < S * .9 && R < S * .9) continue;
723
+ let B = O + Math.cos(j) * ne, ae = k + Math.sin(j) * ne;
724
+ if (e.font = `${b.textStyle.fontItalic ? "italic " : ""}${b.fontBold ? "bold " : ""}${S}px ${A}`, b.manualLayout) {
725
+ He(e, x, {
790
726
  kind: "point",
791
- x: ee,
792
- y: P,
793
- position: _.position ?? "ctr"
727
+ x: B,
728
+ y: ae,
729
+ position: b.position ?? "ctr"
794
730
  }, {
795
- x,
731
+ x: C,
796
732
  y: w,
797
- w: T,
798
- h: E
799
- }, y, b, _.manualLayout, {
733
+ w: E,
734
+ h: D
735
+ }, S, te, b.manualLayout, {
800
736
  x: l,
801
737
  y: u,
802
- w: d,
803
- h: f
804
- }, k(t, _.richRuns, a, S, _.fontBold ?? !1, _.textStyle), void 0, _.textStyle, a, _.labelBox, o);
738
+ w: f,
739
+ h: p
740
+ }, je(t, b.richRuns, a, A, b.fontBold ?? !1, b.textStyle), void 0, b.textStyle, a, b.labelBox, o);
805
741
  continue;
806
742
  }
807
- e.save(), e.translate(ee, P);
808
- let re = C, I = re * 180 / Math.PI % 360;
809
- (I > 90 || I < -90) && (re += Math.PI), e.rotate(re), e.font = `${_.textStyle.fontItalic ? "italic " : ""}${_.fontBold ? "bold " : ""}${y}px ${S}`, te(e, v, {
743
+ e.save(), e.translate(B, ae);
744
+ let oe = j, se = oe * 180 / Math.PI % 360;
745
+ (se > 90 || se < -90) && (oe += Math.PI), e.rotate(oe), e.font = `${b.textStyle.fontItalic ? "italic " : ""}${b.fontBold ? "bold " : ""}${S}px ${A}`, He(e, x, {
810
746
  kind: "point",
811
747
  x: 0,
812
748
  y: 0,
813
- position: _.position ?? "ctr"
749
+ position: b.position ?? "ctr"
814
750
  }, {
815
- x: -j / 2,
816
- y: -M / 2,
817
- w: j,
818
- h: M
819
- }, y, b, void 0, {
820
- x: -j / 2,
821
- y: -M / 2,
822
- w: j,
823
- h: M
824
- }, k(t, _.richRuns, a, S, _.fontBold ?? !1, _.textStyle), void 0, _.textStyle, a, _.labelBox, o), e.restore();
751
+ x: -I / 2,
752
+ y: -R / 2,
753
+ w: I,
754
+ h: R
755
+ }, S, te, void 0, {
756
+ x: -I / 2,
757
+ y: -R / 2,
758
+ w: I,
759
+ h: R
760
+ }, je(t, b.richRuns, a, A, b.fontBold ?? !1, b.textStyle), void 0, b.textStyle, a, b.labelBox, o), e.restore();
825
761
  }
826
762
  }
827
- e.restore(), he(e, v, y, l, u, d, f, x, w, T, E, b.title.bandH + 2, a, _, o);
763
+ e.restore(), Me(e, b, x, l, u, f, p, C, w, E, D, S.title.bandH + 2, a, y, o);
828
764
  }
829
- function Ie(e, t) {
765
+ function tt(e, t) {
830
766
  let n = e.map((e, t) => ({
831
767
  node: e,
832
768
  index: t,
@@ -889,129 +825,162 @@ function Ie(e, t) {
889
825
  }
890
826
  return p(c, l), o;
891
827
  }
892
- function Le(e, t, r, a, o) {
893
- let c = t.chartexTreemap;
894
- if (!c || c.rows.length === 0) return;
895
- if (xe(c.rows)) {
896
- C(e, r, i + 1);
828
+ function $(e, t, n, i, a) {
829
+ let o = t.chartexTreemap;
830
+ if (!o || o.rows.length === 0) return;
831
+ if (h(o.rows)) {
832
+ Le(e, n, R + 1);
897
833
  return;
898
834
  }
899
- let l = Se(c.rows, !0);
900
- if (l.layoutWeight <= 0 || l.children.length === 0) return;
901
- let u = t.series[0], d = l.children.map((e) => oe(t, e.branchIndex, l.children.length, u?.chartexStyle, u?.color)), f = {
902
- ...t,
835
+ let s = m(o.rows, !0);
836
+ if (s.layoutWeight <= 0 || s.children.length === 0) return;
837
+ let c = t.series[0], l = s.children.map((e) => Ue(t, e.branchIndex, s.children.length, c?.chartexStyle, c?.color)), u = r(t, {
903
838
  chartType: "clusteredBar",
904
- series: l.children.map((e) => {
905
- let n = P(t, e.branchIndex, l.children.length, u?.chartexStyle);
906
- return re(t, e.label, u, t.chartexDataPointStyle, e.branchIndex, l.children.length, n, !0, !1);
839
+ series: s.children.map((e) => {
840
+ let n = U(t, e.branchIndex, s.children.length, c?.chartexStyle);
841
+ return ke(t, e.label, c, t.chartexDataPointStyle, e.branchIndex, s.children.length, n);
907
842
  })
908
- }, p = ee(e, f, r.w, r.h, .22, a), h = s(t, r.x, r.y, r.w, r.h, a, {
843
+ }), f = Be(e, u, n.w, n.h, i), p = te(t, n.x, n.y, n.w, n.h, i, {
909
844
  titleTopPadFrac: .035,
910
845
  titleBottomPadFrac: .035,
911
- legendSideReserveFrac: 0,
912
- legendReserve: p,
846
+ legendReserve: f,
913
847
  radialGapFrac: .015,
914
848
  honorPlotAreaManualLayout: !0
915
849
  });
916
- fe(e, t, r.x, r.y, r.w, r.h, r.y + h.title.topPad, h.title.fontPx);
917
- let { px0: g, py0: _, pw: v, ph: y } = h.plotRect;
918
- m(e, t, g, _, v, y, a, o);
850
+ Ve(e, t, n.x, n.y, n.w, n.h, n.y + p.title.topPad, p.title.fontPx);
851
+ let { px0: g, py0: _, pw: v, ph: y } = p.plotRect;
852
+ if (!(v > 0) || !(y > 0)) return;
853
+ ge(e, t, g, _, v, y, i, a);
919
854
  let b = {
920
855
  x: g,
921
856
  y: _,
922
857
  w: v,
923
858
  h: y
924
- }, x = c.parentLabelLayout ?? "overlapping", S = t.series[0]?.seriesDataLabels, w = V(t, S?.fontFace ?? t.dataLabelFontFace, "minor"), T = n(S?.fontSizeHpt, a) ?? Math.max(8, Math.min(13, h.plotRect.ph * .025)), E = S?.fontColor ? `#${S.fontColor}` : "#ffffff", D = new Map((t.series[0]?.dataLabelOverrides ?? []).map((e) => [e.idx, e])), O = t.chartBg ? t.chartBg.startsWith("#") ? t.chartBg : `#${t.chartBg}` : "#ffffff", A = (i, s) => {
925
- if (s.w < .5 || s.h < .5) return;
926
- let c = `#${P(t, i.branchIndex, l.children.length, u?.chartexStyle)}`, d = oe(t, i.branchIndex, l.children.length, u?.chartexStyle, u?.color), f = D.get(i.labelIndex), p = f?.fontColor ? `#${f.fontColor}` : E, m = n(f?.fontSizeHpt, a) ?? T, h = f?.fontBold ?? S?.fontBold ?? !1;
927
- if (i.children.length > 0) {
928
- let n = z(t, u, i.labelIndex, i.label, i.value, {
859
+ }, x = o.parentLabelLayout ?? "overlapping", S = t.series[0]?.seriesDataLabels, C = M(t, S?.fontFace ?? t.dataLabelFontFace, "minor"), w = T(S?.fontSizeHpt, i) ?? Math.max(8, Math.min(13, p.plotRect.ph * .025)), E = S?.fontColor ? `#${S.fontColor}` : "#ffffff", D = new Map((t.series[0]?.dataLabelOverrides ?? []).map((e) => [e.idx, e])), O = t.chartBg ? t.chartBg.startsWith("#") ? t.chartBg : `#${t.chartBg}` : "#ffffff", k = be(c?.dataPointOverrides), A = (r, o) => {
860
+ if (o.w < .5 || o.h < .5) return;
861
+ let l = `#${U(t, r.branchIndex, s.children.length, c?.chartexStyle)}`, u = k.get(r.labelIndex), f = Ie(t, c, u, r.branchIndex, s.children.length), p = d(u?.chartexStyle, c?.chartexStyle), m = D.get(r.labelIndex), h = m?.fontColor ? `#${m.fontColor}` : E, g = T(m?.fontSizeHpt, i) ?? w, _ = m?.fontBold ?? S?.fontBold ?? !1;
862
+ if (r.children.length > 0) {
863
+ let s = re(t, c, r.labelIndex, r.label, r.value, {
929
864
  visible: x !== "none",
930
865
  showVal: !1,
931
866
  showCatName: !0
932
- }, D, !0), l = n != null && (x !== "overlapping" || i.depth === 0), g = m, _ = n?.fontFace ? V(t, n.fontFace, "minor") : w, v = x === "banner" && l ? Math.min(s.h * .28, g + 7) : 0;
933
- v > 0 && d && (e.fillStyle = le(e, d, s.x, s.y, s.w, v, c, o), e.fillRect(s.x, s.y, s.w, v));
934
- let y = {
935
- x: s.x,
936
- y: s.y + v,
937
- w: s.w,
938
- h: Math.max(0, s.h - v)
867
+ }, D, !0), u = s != null && (x !== "overlapping" || r.depth === 0), d = g, v = s?.fontFace ? M(t, s.fontFace, "minor") : C, y = x === "banner" && u ? Math.min(o.h * .28, d + 7) : 0;
868
+ y > 0 && ee(e, p, t.chartexDataPointStyle, c?.chartexFormatIdx ?? 0, {
869
+ x: o.x,
870
+ y: o.y,
871
+ w: o.w,
872
+ h: y
873
+ }, i, (e) => {
874
+ f && we(e, f, {
875
+ x: o.x,
876
+ y: o.y,
877
+ w: o.w,
878
+ h: y
879
+ }, l, i, a);
880
+ }, r.branchIndex);
881
+ let S = {
882
+ x: o.x,
883
+ y: o.y + y,
884
+ w: o.w,
885
+ h: Math.max(0, o.h - y)
939
886
  };
940
- for (let e of Ie(i.children, y)) A(e.node, e.rect);
941
- if (l && (n.manualLayout || s.w > g * 2 && s.h > g + 4)) {
942
- e.font = `${h ? "bold " : ""}${g}px ${_}`;
943
- let i = v > 0 ? {
944
- x: s.x,
945
- y: s.y,
946
- w: s.w,
947
- h: v
948
- } : s, c = f?.position ?? "inBase";
949
- te(e, n.text, n.manualLayout ? {
887
+ for (let e of tt(r.children, S)) A(e.node, e.rect);
888
+ if (u && (s.manualLayout || o.w > d * 2 && o.h > d + 4)) {
889
+ e.font = `${_ ? "bold " : ""}${d}px ${v}`;
890
+ let r = y > 0 ? {
891
+ x: o.x,
892
+ y: o.y,
893
+ w: o.w,
894
+ h: y
895
+ } : o, c = m?.position ?? "inBase";
896
+ He(e, s.text, s.manualLayout ? {
950
897
  kind: "point",
951
- x: s.x + s.w / 2,
952
- y: s.y + s.h / 2,
898
+ x: o.x + o.w / 2,
899
+ y: o.y + o.h / 2,
953
900
  position: c
954
901
  } : {
955
902
  kind: "box",
956
- rect: i,
903
+ rect: r,
957
904
  position: c
958
- }, n.manualLayout ? b : i, g, p, n.manualLayout, r, k(t, n.richRuns, a, _, h, n.textStyle), void 0, n.textStyle, a, n.labelBox, o);
905
+ }, s.manualLayout ? b : r, d, h, s.manualLayout, n, je(t, s.richRuns, i, v, _, s.textStyle), void 0, s.textStyle, i, s.labelBox, a);
959
906
  }
960
907
  return;
961
908
  }
962
- d && (e.fillStyle = le(e, d, s.x, s.y, s.w, s.h, c, o), e.fillRect(s.x, s.y, s.w, s.h)), ue(e, t, t.chartexDataPointStyle, t.series[0], i.branchIndex, l.children.length, O, a, { linkedNoStyleFallback: !0 }) && e.strokeRect(s.x, s.y, s.w, s.h);
963
- let g = z(t, u, i.labelIndex, i.label, i.value, {
909
+ ee(e, p, t.chartexDataPointStyle, c?.chartexFormatIdx ?? 0, o, i, (e) => {
910
+ f && we(e, f, o, l, i, a), Ne(e, xe(t, c, u, r.branchIndex, s.children.length, O, t.chartexDataPointStyle, { linkedNoStyleFallback: !0 }), i, o, a) && e.strokeRect(o.x, o.y, o.w, o.h);
911
+ }, r.branchIndex);
912
+ let v = re(t, c, r.labelIndex, r.label, r.value, {
964
913
  visible: !1,
965
914
  showVal: !1,
966
915
  showCatName: !1
967
916
  }, D);
968
- if (!g) return;
969
- let _ = n(g.fontSizeHpt, a) ?? m;
970
- if (!g.manualLayout && (s.w <= _ * 1.2 || s.h <= _ * 1.2)) return;
971
- let v = g.fontFace ? V(t, g.fontFace, "minor") : w;
972
- e.font = `${g.fontBold ? "bold " : ""}${_}px ${v}`;
973
- let y = s, C = g.position === "outEnd" ? "inEnd" : g.position ?? "ctr";
974
- te(e, g.text, g.manualLayout ? {
917
+ if (!v) return;
918
+ let y = T(v.fontSizeHpt, i) ?? g;
919
+ if (!v.manualLayout && (o.w <= y * 1.2 || o.h <= y * 1.2)) return;
920
+ let te = v.fontFace ? M(t, v.fontFace, "minor") : C;
921
+ e.font = `${v.fontBold ? "bold " : ""}${y}px ${te}`;
922
+ let j = o, ne = v.position === "outEnd" ? "inEnd" : v.position ?? "ctr";
923
+ He(e, v.text, v.manualLayout ? {
975
924
  kind: "point",
976
- x: s.x + s.w / 2,
977
- y: s.y + s.h / 2,
978
- position: C
925
+ x: o.x + o.w / 2,
926
+ y: o.y + o.h / 2,
927
+ position: ne
979
928
  } : {
980
929
  kind: "box",
981
- rect: y,
982
- position: C
983
- }, g.manualLayout ? b : y, _, g.fontColor ? `#${g.fontColor}` : p, g.manualLayout, r, k(t, g.richRuns, a, v, g.fontBold ?? !1, g.textStyle), void 0, g.textStyle, a, g.labelBox, o);
930
+ rect: j,
931
+ position: ne
932
+ }, v.manualLayout ? b : j, y, v.fontColor ? `#${v.fontColor}` : h, v.manualLayout, n, je(t, v.richRuns, i, te, v.fontBold ?? !1, v.textStyle), void 0, v.textStyle, i, v.labelBox, a);
984
933
  };
985
934
  e.save(), e.beginPath(), e.rect(g, _, v, y), e.clip();
986
- for (let e of Ie(l.children, {
935
+ for (let e of tt(s.children, {
987
936
  x: g,
988
937
  y: _,
989
938
  w: v,
990
939
  h: y
991
940
  })) A(e.node, e.rect);
992
- e.restore(), he(e, f, p, r.x, r.y, r.w, r.h, g, _, v, y, h.title.bandH + 2, a, d, o);
941
+ e.restore(), Me(e, u, f, n.x, n.y, n.w, n.h, g, _, v, y, p.title.bandH + 2, i, l, a);
993
942
  }
994
- function Re(e, t, n, r, a = 0) {
995
- let o = De(t);
996
- if (o != null && o > 1048576) return C(e, n, i + 1), !0;
943
+ function nt(e, t, n, i, a = 0) {
944
+ let o = Ke(t, void 0, n, i), s = qe(t, n, i);
945
+ if (o != null && o > 1048576 || s != null && s > 1048576 || o != null && s != null && o > 1048576 - s) return Le(e, n, R + 1), !0;
946
+ if (t.chartexSuppressGeometry) {
947
+ let r = Ae(e, t, n.w, n.h, i);
948
+ return Ve(e, t, n.x, n.y, n.w, n.h, n.y + r.topPad, r.fontPx), !0;
949
+ }
997
950
  switch (t.chartType) {
998
- case "waterfall": return Oe(e, t, n, r, a), !0;
999
- case "clusteredColumn": return A(e, {
1000
- ...t,
1001
- chartType: "clusteredBar"
1002
- }, n, r, { gapPolicy: "chartex" }, a), !0;
1003
- case "histogram": return G(e, t, n, r, a), !0;
1004
- case "funnel": return ke(e, t, n, r, a), !0;
1005
- case "paretoLine": return Ae(e, t, n, r, a), !0;
1006
- case "pareto": return je(e, t, n, r, a), !0;
1007
- case "boxWhisker": return J(e, t, n, r, a), !0;
1008
- case "sunburst": return Fe(e, t, n, r, a), !0;
1009
- case "treemap": return Le(e, t, n, r, a), !0;
951
+ case "waterfall": return Ye(e, t, n, i, a), !0;
952
+ case "clusteredColumn": {
953
+ let o = t.series.map((e, n) => n === 0 ? K(t, e, n, t.series.length) : e), s = t.chartexParetoSortDescending ? o.map((e) => x(e, t.categories, {
954
+ sortDescending: !0,
955
+ keepUnvaluedCategories: !0
956
+ }).orderedSeries) : o, c = t.chartexShowUnpairedPercentageAxis && s[0] ? [{
957
+ ...s[0],
958
+ name: "",
959
+ values: [],
960
+ seriesType: "line",
961
+ useSecondaryAxis: !0,
962
+ lineHidden: !0,
963
+ showMarker: !1
964
+ }] : [];
965
+ return ze(e, r(t, {
966
+ chartType: "clusteredBar",
967
+ categories: s[0]?.categories ?? t.categories,
968
+ series: [...s, ...c],
969
+ secondaryValAxis: c.length > 0 ? Y(t) : t.secondaryValAxis
970
+ }), n, i, { gapPolicy: "chartex" }, a), !0;
971
+ }
972
+ case "histogram": return Je(e, t, n, i, a), !0;
973
+ case "funnel": return q(e, t, n, i, a), !0;
974
+ case "paretoLine": return J(e, t, n, i, a), !0;
975
+ case "pareto": return X(e, t, n, i, a), !0;
976
+ case "boxWhisker": return Qe(e, t, n, i, a), !0;
977
+ case "sunburst": return et(e, t, n, i, a), !0;
978
+ case "treemap": return $(e, t, n, i, a), !0;
1010
979
  default: return !1;
1011
980
  }
1012
981
  }
1013
982
  //#endregion
1014
983
  //#region src/chart-ex.ts
1015
- var ze = ge({ render: Re }, "chartEx");
984
+ var rt = G({ render: nt }, "chartEx");
1016
985
  //#endregion
1017
- export { ze as chartEx };
986
+ export { rt as chartEx };