@silurus/ooxml 0.86.1 → 0.88.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 (72) hide show
  1. package/README.md +42 -2
  2. package/dist/assets/render-worker-1uPAxMZr.js +31 -0
  3. package/dist/assets/render-worker-BlvJybji.js +10 -0
  4. package/dist/assets/render-worker-CzmiJfFL.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-DN5SqWGS.js → canvas-viewer-mechanics-DbLz0rYW.js} +75 -66
  6. package/dist/chart-ex.mjs +581 -616
  7. package/dist/cjk-fallback-bLI3z70h.js +46 -0
  8. package/dist/comment-ui-runtime-BsK8pmUT.js +2 -0
  9. package/dist/{comment-ui-runtime-lXwVOgjW.js → comment-ui-runtime-CWGqn5Vr.js} +5 -5
  10. package/dist/{comment-ui-runtime-DEtgcmj7.js → comment-ui-runtime-DcJOYlw-.js} +5 -5
  11. package/dist/{comments-CAn2A_Xh.js → comments-Diid5ujN.js} +1 -1
  12. package/dist/{document-pull-client-uopDjRde.js → document-pull-client-B9PTM-pL.js} +4693 -4621
  13. package/dist/{docx-wPzeF76A.js → docx-BF9WXrYH.js} +503 -388
  14. package/dist/docx.mjs +6 -6
  15. package/dist/docx_parser_bg.wasm +0 -0
  16. package/dist/{dom-interaction-boundary-CswB9Tzi.js → dom-interaction-boundary-Cnm8DSBN.js} +22 -19
  17. package/dist/{hyperlink-BR1NCO7S.js → hyperlink-Cxzhet30.js} +842 -829
  18. package/dist/index.mjs +3 -3
  19. package/dist/{line-distribute-IsUGfHXm.js → line-distribute-D1WNHKz_.js} +2 -2
  20. package/dist/math.mjs +2 -2
  21. package/dist/node.mjs +356 -352
  22. package/dist/plot-area-frame-DLTYKHNP.js +4354 -0
  23. package/dist/{pptx-BxJ_RBSY.js → pptx-DkyYBYoL.js} +444 -435
  24. package/dist/pptx.mjs +7 -7
  25. package/dist/pptx_parser_bg.wasm +0 -0
  26. package/dist/region-map.mjs +5 -5
  27. package/dist/{render-DEiun_AH.js → render-D3iqVKCo.js} +31 -29
  28. package/dist/{render-worker-host-Ba6Fchqr.js → render-worker-host-B5wQfB7U.js} +1 -1
  29. package/dist/{render-worker-host-BEfLZvSL.js → render-worker-host-D4123J27.js} +1 -1
  30. package/dist/{render-worker-host-C3xwtHnv.js → render-worker-host-Di3LxLc0.js} +1 -1
  31. package/dist/renderer-B4GZb5We.js +6492 -0
  32. package/dist/{resource-measurement-CclArDRs.js → resource-measurement-SHQCbkh2.js} +3 -3
  33. package/dist/{session-BuJL_xcp.js → session-BGq81gRQ.js} +98 -98
  34. package/dist/{slide-pull-client-Ck8wfRT_.js → slide-pull-client-DiPnm240.js} +767 -738
  35. package/dist/{three-d-YYghQndN.js → three-d-DJBl8g8M.js} +251 -435
  36. package/dist/three-d.mjs +998 -906
  37. package/dist/tiff.mjs +2 -2
  38. package/dist/types/chart-ex.d.ts +142 -4
  39. package/dist/types/docx.d.ts +155 -13
  40. package/dist/types/index.d.ts +131 -19
  41. package/dist/types/math.d.ts +1 -1
  42. package/dist/types/node.d.ts +120 -8
  43. package/dist/types/pptx.d.ts +123 -13
  44. package/dist/types/region-map.d.ts +142 -4
  45. package/dist/types/three-d.d.ts +142 -4
  46. package/dist/types/tiff.d.ts +1 -1
  47. package/dist/types/xlsx.d.ts +155 -13
  48. package/dist/{worksheet-pull-client-CAvuf22q.js → worksheet-pull-client-BM8ywvbu.js} +51 -51
  49. package/dist/{xlsx-Bblm5r1h.js → xlsx-C9NVjgaV.js} +1592 -1564
  50. package/dist/xlsx.mjs +6 -6
  51. package/dist/xlsx_parser_bg.wasm +0 -0
  52. package/package.json +1 -1
  53. package/dist/assets/render-worker-D21h5TGR.js +0 -10
  54. package/dist/assets/render-worker-Dsfekaht.js +0 -11
  55. package/dist/assets/render-worker-DxU7IrKo.js +0 -31
  56. package/dist/comment-ui-runtime-TLHustXJ.js +0 -2
  57. package/dist/plot-area-frame-D5hEOgkJ.js +0 -2903
  58. package/dist/renderer-XFSCOT6m.js +0 -5857
  59. /package/dist/{bounded-raw-part-cache-BfbSxRIL.js → bounded-raw-part-cache-Cg1BsSZQ.js} +0 -0
  60. /package/dist/{comment-occurrence-CqejEuts.js → comment-occurrence-C8Y2uoVr.js} +0 -0
  61. /package/dist/{delimited-text-worker-host-DcHj_JZt.js → delimited-text-worker-host-BVY-Ecni.js} +0 -0
  62. /package/dist/{highlight-rect-FuUSmL3a.js → highlight-rect-C5hkRqUr.js} +0 -0
  63. /package/dist/{line-metrics-CBbw80Ko.js → line-metrics-B60C86uh.js} +0 -0
  64. /package/dist/{mathjax-DS69BmJd.js → mathjax-DoyWZbSp.js} +0 -0
  65. /package/dist/{pixel-budget-Dgjw269h.js → pixel-budget-9P63Bsk5.js} +0 -0
  66. /package/dist/{read-only-comment-decoration-BTnWEeo5.js → read-only-comment-decoration-Dz7eTQ4d.js} +0 -0
  67. /package/dist/{read-only-comment-margin-plStyGfE.js → read-only-comment-margin-DkgzASAl.js} +0 -0
  68. /package/dist/{renderer-module-contract-Cu-GKuPd.js → renderer-module-contract-D91rkYHH.js} +0 -0
  69. /package/dist/{source-key-Ktb1GRE5.js → source-key-DIJG8BA0.js} +0 -0
  70. /package/dist/{transfer-mIj7E7NB.js → transfer-p6iCC2R7.js} +0 -0
  71. /package/dist/{units-EJdC96r6.js → units-BzZ0gAxs.js} +0 -0
  72. /package/dist/{visible-index-DPoQYSDt.js → visible-index-BgiHEc1z.js} +0 -0
package/dist/chart-ex.mjs CHANGED
@@ -1,20 +1,20 @@
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-Cu-GKuPd.js";
5
- function H(e) {
1
+ import { $ as e, $n as t, An as n, D as r, F as i, Gn as a, H as o, I as s, In as c, L as l, N as u, On as d, P as f, Pn as p, Q as m, R as h, Sn as g, T as _, X as v, Y as y, Yt as b, Z as x, Zn as S, dt as C, et as ee, ft as w, g as T, ir as E, jn as D, kn as O, pr as k, r as A, t as j, ut as M, v as N, zn as P } from "./plot-area-frame-DLTYKHNP.js";
2
+ import { A as F, C as I, D as te, E as L, F as ne, I as R, L as re, M as ie, N as ae, O as oe, P as se, R as ce, S as le, T as ue, _ as de, a as z, b as fe, c as pe, d as me, f as he, g as ge, h as _e, i as ve, k as ye, l as B, m as V, n as H, o as U, p as be, r as xe, s as Se, t as Ce, u as we, v as Te, w as Ee, x as De, y as Oe, z as ke } from "./renderer-B4GZb5We.js";
3
+ import { C as Ae, S as je } from "./three-d-DJBl8g8M.js";
4
+ import { t as Me } from "./renderer-module-contract-D91rkYHH.js";
5
+ function Ne(e) {
6
6
  return e != null && Number.isFinite(e) ? e : null;
7
7
  }
8
- function U(e) {
8
+ function Pe(e) {
9
9
  return Object.is(e, -0) ? "0" : String(Number.isInteger(e) ? e : Number(e.toPrecision(6)));
10
10
  }
11
- function _e(e, t) {
11
+ function Fe(e, t) {
12
12
  if (e.length > 1048576) return { kind: "tooManyInputPoints" };
13
- let n = t.intervalClosed === "r" ? "r" : "l", r = H(t.underflow), i = H(t.overflow);
13
+ let n = t.intervalClosed === "r" ? "r" : "l", r = Ne(t.underflow), i = Ne(t.overflow);
14
14
  r != null && i != null && r >= i && (r = null, i = null);
15
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
16
  for (let t of e) {
17
- let e = H(t);
17
+ let e = Ne(t);
18
18
  e != null && (a(e) ? u++ : o(e) ? d++ : (l++, s = Math.min(s, e), c = Math.max(c, e)));
19
19
  }
20
20
  if (l + u + d === 0) return {
@@ -23,26 +23,26 @@ function _e(e, t) {
23
23
  counts: []
24
24
  };
25
25
  let f = [], p = [];
26
- if (r != null && (f.push(`${n === "r" ? "≤" : "<"} ${U(r)}`), p.push(u)), l > 0) {
26
+ if (r != null && (f.push(`${n === "r" ? "≤" : "<"} ${Pe(r)}`), p.push(u)), l > 0) {
27
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);
28
+ if (!Number.isFinite(m)) f.push(`${Pe(u)} – ${Pe(d)}`), p.push(l);
29
29
  else {
30
- let s = H(t.binSize), c;
30
+ let s = Ne(t.binSize), c;
31
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
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
33
  for (let t of e) {
34
- let e = H(t);
34
+ let e = Ne(t);
35
35
  if (e == null || a(e) || o(e)) continue;
36
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
37
  _[s]++;
38
38
  }
39
39
  for (let e = 0; e < d; e++) {
40
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]);
41
+ f.push(`${s} ${Pe(t)} – ${c} ${Pe(o)}`), p.push(_[e]);
42
42
  }
43
43
  }
44
44
  }
45
- return i != null && (f.push(`${n === "r" ? ">" : "≥"} ${U(i)}`), p.push(d)), {
45
+ return i != null && (f.push(`${n === "r" ? ">" : "≥"} ${Pe(i)}`), p.push(d)), {
46
46
  kind: "bins",
47
47
  categories: f,
48
48
  counts: p
@@ -50,7 +50,7 @@ function _e(e, t) {
50
50
  }
51
51
  //#endregion
52
52
  //#region packages/core/src/chart/pareto-layout.ts
53
- function ve(e, t) {
53
+ function Ie(e, t) {
54
54
  return e == null ? e : e.flatMap((e) => {
55
55
  let n = t.get(e.idx);
56
56
  return n == null ? [] : [{
@@ -59,10 +59,10 @@ function ve(e, t) {
59
59
  }];
60
60
  });
61
61
  }
62
- function ye(e, t) {
62
+ function W(e, t) {
63
63
  return e == null ? e : t.map((t) => e[t] ?? null);
64
64
  }
65
- function be(e, t, n = {}) {
65
+ function G(e, t, n = {}) {
66
66
  let r = e.values.map((e, t) => ({
67
67
  value: e,
68
68
  sourceIndex: t
@@ -76,11 +76,11 @@ function be(e, t, n = {}) {
76
76
  })), c = s.map((e) => e.sourceIndex), l = new Map(c.map((e, t) => [e, t])), u = s.map((e) => e.category), d = {
77
77
  ...e,
78
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)
79
+ catFormatCodes: W(e.catFormatCodes, c),
80
+ dataPointColors: W(e.dataPointColors, c),
81
+ dataLabelColors: W(e.dataLabelColors, c),
82
+ dataPointOverrides: Ie(e.dataPointOverrides, l),
83
+ dataLabelOverrides: Ie(e.dataLabelOverrides, l)
84
84
  };
85
85
  return {
86
86
  points: s,
@@ -95,384 +95,328 @@ function be(e, t, n = {}) {
95
95
  }
96
96
  };
97
97
  }
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;
136
- }
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);
157
- }
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
98
  //#endregion
170
99
  //#region packages/core/src/chart/chart-ex-renderer.ts
171
- function we(e) {
100
+ function K(e) {
172
101
  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
102
  }
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 ? {
103
+ function q(e, t, n, r) {
104
+ return t?.fillHidden === !0 || t?.color != null || K(t?.chartexStyle) ? U(e, r, 3, t?.fillHidden === !0 ? {
176
105
  ...t.chartexStyle,
177
106
  fillHidden: !0,
178
107
  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);
108
+ } : t?.chartexStyle, t?.color) : n?.chartexStyle?.fillPaintAuthored === !0 ? U(e, r, 3, n.chartexStyle, n.color) : U(e, r, 3, n?.chartexStyle, n?.color);
186
109
  }
187
- function Ee(e) {
110
+ function Le(e) {
188
111
  let t = e?.chartexStyle;
189
112
  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
113
  }
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]) {
114
+ function Re(e, n, a, o = 1) {
115
+ let s = 0, c = Math.max(1, a?.w ?? 32 * o), u = Math.max(1, a?.h ?? 16 * o), d = i(e, ({ label: i, linkedStyleIndex: a }) => {
116
+ let d = i.labelBox, f = l(d), p = f ? e.chartStyleRoles?.dataLabelCallout ?? e.chartStyleRoles?.dataLabel : e.chartStyleRoles?.dataLabel, m = f ? k(e, "dataLabelCallout") ?? k(e, "dataLabel") : k(e, "dataLabel"), g = h(d, p, m, p != null, 0, a)?.fillPaint, _ = S(d?.style, m, 0), v = d?.borderHidden === !0 ? t(m) : void 0, y = d?.borderColor != null || d?.borderFill != null || _ !== void 0 || v !== void 0 || d?.borderPaintAuthored === !0 && d?.borderHidden !== !0, x = _ === void 0 ? v === void 0 ? d?.borderFill ?? (d?.borderColor ? {
117
+ fillType: "solid",
118
+ color: d.borderColor
119
+ } : y ? null : E(p, a)) : v : _;
120
+ for (let e of [g, x]) {
225
121
  if (!e) continue;
226
- let t = _(e);
227
- if (e.fillType === "gradient" && t > 4096 || t > 1048576 - o) return c + 1;
228
- o += t;
122
+ let t = e.fillType === "image" ? A(e, n, c, u, o) ?? 1048577 : b(e);
123
+ if (e.fillType === "gradient" && t > 4096 || t > 1048576 - s) {
124
+ s = r + 1;
125
+ return;
126
+ }
127
+ s += t;
229
128
  }
129
+ });
130
+ return d === "not-hierarchy" ? null : d === "too-large" ? r + 1 : s;
131
+ }
132
+ function ze(e, t, n = 1) {
133
+ if (![
134
+ "waterfall",
135
+ "funnel",
136
+ "boxWhisker",
137
+ "sunburst",
138
+ "treemap"
139
+ ].includes(e.chartType)) return null;
140
+ let i = 0, a = (e) => {
141
+ if (!e || i > 1048576) return;
142
+ let a = e.fillType === "image" ? A(e, void 0, Math.max(1, t.w), Math.max(1, t.h), n) : b(e);
143
+ e.fillType === "gradient" && a > 4096 || a > 1048576 - i ? i = r + 1 : i += a;
144
+ }, o = (t, n, r, i) => {
145
+ let o = ae(e, t, n, r, i, "#000000", { linkedNoStyleFallback: !0 });
146
+ o.visible && a(o.paint ?? {
147
+ fillType: "solid",
148
+ color: "000000"
149
+ });
150
+ };
151
+ if (e.chartType === "waterfall") {
152
+ let t = e.series[0], n = t?.values ?? [], r = I(t?.dataPointOverrides), i = u(n, e.categories.length, e.subtotalIndices);
153
+ if (i.cumulativeOverflow || i.rawMax <= i.rawMin) return 0;
154
+ for (let n = 0; n < i.bars.length; n++) {
155
+ let s = i.bars[n];
156
+ if (!s.paintSlot) continue;
157
+ let c = s.semanticIndex, l = r.get(n);
158
+ a(q(e, l, t, c)), o(e.chartexDataPointStyle, Le(l) ? l : t, c, 3);
159
+ }
160
+ } else if (e.chartType === "funnel") {
161
+ let t = e.series[0], n = t?.values ?? [], r = Math.max(n.length, e.categories.length);
162
+ if (n.some((e) => e != null && e > 0)) {
163
+ let i = U(e, 0, 1, t?.chartexStyle, t?.color);
164
+ for (let s = 0; s < r; s++) (n[s] ?? 0) > 0 && (a(i), o(e.chartexDataPointStyle, t, 0, 1));
165
+ }
166
+ } else if (e.chartType === "boxWhisker") {
167
+ let t = e.chartexBox, n = t?.series.length ?? 0;
168
+ for (let r = 0; r < n; r++) {
169
+ let i = t.series[r], s = i.chartexFormatIdx ?? r, c = U(e, s, n, i.chartexStyle, i.color);
170
+ for (let t of i.valuesByCategory) w(t, i.quartileMethod) && (a(c), o(e.chartexDataPointStyle, i, s, n));
171
+ }
172
+ } else {
173
+ let t = e.series[0], n = 1;
174
+ if (f(e, ({ node: e }) => {
175
+ n = Math.max(n, e.branchIndex + 1);
176
+ }), f(e, ({ node: r, paintsBody: i }) => {
177
+ i && (a(U(e, r.branchIndex, n, t?.chartexStyle, t?.color)), o(e.chartexDataPointStyle, t, r.branchIndex, n));
178
+ }) === "too-large") return r + 1;
230
179
  }
231
- return o;
180
+ return i;
232
181
  }
233
- function G(e, t, n, r, a = 0) {
234
- let o = t.series[0];
235
- if (!o) return;
236
- let s = _e(o.values, t.chartexHistogramBinning ?? {});
237
- if (s.kind === "tooManyInputPoints") {
238
- C(e, n, i + 1);
182
+ function Be(e, t, n, r, i = 0) {
183
+ let a = t.series[0];
184
+ if (!a) return;
185
+ let o = Fe(a.values, t.chartexHistogramBinning ?? {});
186
+ if (o.kind === "tooManyInputPoints") {
187
+ ye(e, n, _ + 1);
239
188
  return;
240
189
  }
241
- A(e, {
190
+ F(e, {
242
191
  ...t,
243
192
  chartType: "clusteredBar",
244
- categories: s.categories,
193
+ categories: o.categories,
245
194
  series: [{
246
- ...o,
195
+ ...a,
247
196
  categories: void 0,
248
- values: s.counts
197
+ values: o.counts
249
198
  }]
250
- }, n, r, { gapPolicy: "chartex" }, a);
199
+ }, n, r, { gapPolicy: "chartex" }, i);
251
200
  }
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);
201
+ function Ve(t, r, i, l, d) {
202
+ let { x: f, y: m, w: h, h: g } = i, _ = r.series[0]?.values ?? [], v = r.categories, y = Math.max(_.length, v.length);
203
+ if (y === 0 || ye(t, i, y)) return;
204
+ let { bars: b, rawMax: x, rawMin: S, cumulativeOverflow: C } = u(_, v.length, r.subtotalIndices);
205
+ if (C) {
206
+ t.fillStyle = "#888", t.font = "12px sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("(chart values out of range)", f + h / 2, m + g / 2);
285
207
  return;
286
208
  }
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);
209
+ if (x <= S) return;
210
+ let w = r.subtotalIndices.length === 0 && b.every((e, t) => !e.hasValue || _[t] >= 0), T = !r.valAxisHidden && r.valAxisTickLabelPos !== "none" && !w, E = Ee(t, r, h, g, l), O = n(r, h, g, l), k = xe(r.valAxisFontSizeHpt, g, l), A = xe(r.catAxisFontSizeHpt, g, l), M = V(r, r.valAxisFontFace, "minor"), P = V(r, r.catAxisFontFace, "minor"), F = oe(r, S, x, g / l);
289
211
  t.save();
290
- let Se = 0;
291
- if (ge) {
292
- t.font = se(_e, ye, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1);
212
+ let L = 0;
213
+ if (T) {
214
+ t.font = be(k, M, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1);
293
215
  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;
216
+ for (let n of F.majorLines) e = Math.max(e, t.measureText(le(r, n, !1)).width);
217
+ L = e + 8;
296
218
  }
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 = {
219
+ let ie = Math.max(1, h - O.valBandW - L - h * .02) / y;
220
+ t.font = be(A, P, r.catAxisFontBold ?? !1, r.catAxisFontItalic ?? !1);
221
+ let fe = v.slice(0, y).map((e) => ke(t, o(e, r.catAxisFormatCode, r.date1904), Math.max(1, ie - 8))), he = 0;
222
+ for (let e of fe) e.some(Boolean) && (he = Math.max(he, e.length));
223
+ let ve = r.catAxisHidden || he === 0 ? 0 : he * (A + 2) + 4, B = r.series[0], Se = I(B?.dataLabelOverrides), we = I(B?.dataPointOverrides), Ae = B?.chartexStyle, je = `#${B?.color ?? z(r, 0, 3, Ae)}`, Me = `#${z(r, 1, 3, Ae)}`, Ne = `#${z(r, 2, 3, Ae)}`, Pe = U(r, 0, 3, Ae, B?.color), Fe = U(r, 1, 3, Ae), Ie = U(r, 2, 3, Ae), W = {
302
224
  ...r,
303
225
  chartType: "clusteredBar",
304
226
  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)
227
+ pe(r, "Increase", B, r.chartexDataPointStyle, 0, 3, je),
228
+ pe(r, "Decrease", B, r.chartexDataPointStyle, 1, 3, Me),
229
+ pe(r, "Total", B, r.chartexDataPointStyle, 2, 3, Ne)
308
230
  ]
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,
231
+ }, G = ue(t, W, h, g, .22, l), { legRightW: K, legLeftW: Re, legTopH: ze, legBottomH: Be } = D(G, r.legendOverlay === !0), Ve = c(r, f, m, h, g, l, {
232
+ titleBand: E,
311
233
  legendSideReserveFrac: 0,
312
- legendReserve: Fe,
234
+ legendReserve: G,
313
235
  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))
236
+ t: E.bandH + ze + k / 2 + 2,
237
+ r: K + h * .02,
238
+ b: Be + O.catBandH + ve,
239
+ l: Re + O.valBandW + (r.valAxisHidden ? h * .02 : Math.max(h * .03, L))
318
240
  },
319
241
  honorPlotAreaManualLayout: !0
320
242
  });
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);
243
+ Te(t, r, f, m, h, g, m + Ve.title.topPad, Ve.title.fontPx);
244
+ let { px0: J, py0: Y, pw: X, ph: Z } = Ve.plotRect;
245
+ j(t, r, J, Y, X, Z, l, d);
246
+ let He = oe(r, S, x, Z / l), Q = (e) => Y + Z - He.frac(e) * Z, Ue = N(r.valAxisLineColor, r.valAxisLineWidthEmu, l), We = N(r.catAxisLineColor, r.catAxisLineWidthEmu, l), Ge = re(r, l);
325
247
  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);
248
+ t.font = be(k, M, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1), t.fillStyle = r.valAxisFontColor ? `#${r.valAxisFontColor}` : "#595959", t.textAlign = "right", t.textBaseline = "middle";
249
+ let e = ce(r, l);
250
+ for (let n of He.minorLines) R(t, J, X, Q(n), !1, e);
251
+ for (let e of He.majorLines) {
252
+ let n = Q(e);
253
+ if (De(r)) {
254
+ t.strokeStyle = Ge.color, t.lineWidth = Ge.width;
255
+ let e = Ge.dash.length > 0 && t.getLineDash ? t.getLineDash() : [];
256
+ Ge.dash.length > 0 && t.setLineDash(Ge.dash), t.beginPath(), t.moveTo(J, n), t.lineTo(J + X, n), t.stroke(), Ge.dash.length > 0 && t.setLineDash(e);
335
257
  }
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);
258
+ T && t.fillText(le(r, e, !1), J - 4, n), _e(t, r.valAxisMajorTickMark, "val", J, n, Ue.color, Ue.width, !1, r.valAxisLineHidden, "major", l, r.valAxisLineDash);
337
259
  }
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);
260
+ for (let e of He.minorTicks) _e(t, r.valAxisMinorTickMark, "val", J, Q(e), Ue.color, Ue.width, !1, r.valAxisLineHidden, "minor", l, r.valAxisLineDash);
339
261
  }
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;
262
+ let Ke = !r.valAxisHidden && !r.valAxisLineHidden, qe = !r.catAxisHidden && !r.catAxisLineHidden;
263
+ Ke && ne(t, J, Y, J, Y + Z, Ue.color, Ue.width, r.valAxisLineDash), qe && ne(t, J, Y + Z, J + X, Y + Z, We.color, We.width, r.catAxisLineDash);
264
+ let Je = X / y, $ = Je / (1 + a(r.barGapWidth, "chartex") / 100);
265
+ b.forEach((n, i) => {
266
+ let a = J + Je * i + (Je - $) / 2, o = Math.min(Q(n.start), Q(n.end)), c = Math.max(Q(n.start), Q(n.end)), u = Math.max(1, c - o), x = n.semanticIndex, S = we.get(i), C = q(r, S, B, x), w = S?.color ? `#${S.color}` : n.isSub ? Ne : n.isPos ? je : Me, T = me(r, r.chartexDataPointStyle, "line", x, 3), E = Le(S) ? S : B;
267
+ if (n.paintSlot && ee(t, e(S?.chartexStyle, B?.chartexStyle), r.chartexDataPointStyle, x, {
268
+ x: a,
269
+ y: o,
270
+ w: $,
271
+ h: u
272
+ }, l, (e) => {
273
+ C && te(e, C, {
274
+ x: a,
275
+ y: o,
276
+ w: $,
277
+ h: u
278
+ }, w, l, d), Ce(e, r, r.chartexDataPointStyle, E, x, 3, T ? `#${T}` : w, l) && e.strokeRect(a, o, $, u);
279
+ }), n.paintSlot && b[i + 1]?.paintSlot && i < y - 1 && r.chartexConnectorLines !== !1) {
280
+ let e = J + Je * (i + 1) + (Je - $) / 2, s = n.isPos ? o : c;
349
281
  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();
282
+ let u = ae(r, r.chartexSeriesLineStyle, B, x, 3, "#000000", { linkedNoStyleFallback: !0 });
283
+ H(t, u, l) && (u.widthEmu ?? (t.lineWidth = .75 * l), t.beginPath(), t.moveTo(a + $, s), t.lineTo(e, s), t.stroke()), t.restore();
352
284
  }
353
- let w = e.hasValue ? g[i] : 0, T = z(r, G, i, _[i] ?? "", w, {
285
+ let D = n.hasValue ? _[i] : 0, O = s(r, B, i, v[i] ?? "", D, {
354
286
  visible: r.showDataLabels,
355
287
  showVal: !0,
356
288
  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, {
289
+ }, Se, !n.hasValue);
290
+ if (O) {
291
+ let e = B?.dataLabelColors?.[i] ?? O.fontColor ?? null, n = e ? `#${e}` : r.dataLabelFontColor ? `#${r.dataLabelFontColor}` : "#595959", s = p(O.fontSizeHpt, l) ?? xe(r.dataLabelFontSizeHpt, g, l), c = O.fontBold ?? r.dataLabelFontBold ?? !1, _ = V(r, O.fontFace ?? r.dataLabelFontFace, "minor");
292
+ t.font = `${O.textStyle.fontItalic ? "italic " : ""}${c ? "bold " : ""}${s}px ${_}`, de(t, O.text, {
361
293
  kind: "bar",
362
294
  rect: {
363
- x: o,
364
- y: s,
365
- w: Je,
366
- h: p
295
+ x: a,
296
+ y: o,
297
+ w: $,
298
+ h: u
367
299
  },
368
300
  orientation: "vertical",
369
- negative: w < 0,
370
- position: T.position ?? "outEnd"
301
+ negative: D < 0,
302
+ position: O.position ?? "outEnd"
371
303
  }, {
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);
304
+ x: J,
305
+ y: Y,
306
+ w: X,
307
+ h: Z
308
+ }, s, n, O.manualLayout, {
309
+ x: f,
310
+ y: m,
311
+ w: h,
312
+ h: g
313
+ }, se(r, O.richRuns, l, _, c, O.textStyle), void 0, O.textStyle, l, O.labelBox, d);
382
314
  }
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;
315
+ }), t.textAlign = "center", t.textBaseline = "top", t.fillStyle = r.catAxisFontColor ? `#${r.catAxisFontColor}` : "#595959", t.font = be(A, P, r.catAxisFontBold ?? !1, r.catAxisFontItalic ?? !1);
316
+ let Ye = Y + Z + 4;
385
317
  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)));
318
+ let n = J + Je * e + Je / 2;
319
+ (fe[e] ?? []).forEach((e, r) => e && t.fillText(e, n, Ye + r * (A + 2)));
388
320
  }
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();
321
+ ge(t, r, f, m, h, g, J, Y, X, Z, Re, Be, O.catFontPx, O.valFontPx), Oe(t, W, G, f, m, h, g, J, Y, X, Z, E.bandH + 2, l, [
322
+ Pe,
323
+ Fe,
324
+ Ie
325
+ ], d), t.restore();
394
326
  }
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);
327
+ function J(e, t, n, r, i) {
328
+ let o = t.series[0]?.values ?? [], l = Math.max(o.length, t.categories.length);
329
+ if (l === 0 || ye(e, n, l)) return;
330
+ let u = 0;
331
+ for (let e = 0; e < l; e++) u = Math.max(u, o[e] ?? 0);
332
+ if (!(u > 0)) return;
333
+ let { x: d, y: f, w: m, h } = n, g = Ee(e, t, m, h, r), _ = t.series[0], v = I(_?.dataLabelOverrides), y = `#${_?.color ?? z(t, 0, 1, _?.chartexStyle)}`, b = U(t, 0, 1, _?.chartexStyle, _?.color), x = {
334
+ ...t,
335
+ series: [pe(t, _?.name ?? "", _, t.chartexDataPointStyle, 0, 1, y)]
336
+ }, S = ue(e, x, m, h, .22, r), { legRightW: C, legLeftW: w, legTopH: T, legBottomH: E } = D(S, t.legendOverlay === !0), O = xe(t.catAxisFontSizeHpt, h, r);
337
+ e.save(), e.font = be(O, V(t, t.catAxisFontFace, "minor"), t.catAxisFontBold ?? !1, t.catAxisFontItalic ?? !1);
338
+ let k = 0;
339
+ if (!t.catAxisHidden) {
340
+ for (let n = 0; n < Math.min(l, t.categories.length); n++) k = Math.max(k, e.measureText(t.categories[n]).width);
341
+ t.categories.length > 0 && (k += 10);
410
342
  }
411
- let ne = s(r, f, p, h, g, a, {
412
- titleBand: _,
343
+ let A = c(t, d, f, m, h, r, {
344
+ titleBand: g,
413
345
  legendSideReserveFrac: .22,
414
- legendReserve: E,
346
+ legendReserve: S,
415
347
  pad: {
416
- t: _.bandH + A + 2,
417
- r: D + h * .02,
418
- b: j + g * .02,
419
- l: O + N + h * .02
348
+ t: g.bandH + T + 2,
349
+ r: C + m * .02,
350
+ b: E + h * .02,
351
+ l: w + k + m * .02
420
352
  },
421
353
  honorPlotAreaManualLayout: !0
422
354
  });
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, {
355
+ Te(e, t, d, f, m, h, f + A.title.topPad, A.title.fontPx);
356
+ let { px0: M, py0: P, pw: F, ph: L } = A.plotRect;
357
+ j(e, t, M, P, F, L, r, i);
358
+ let ne = L / l, R = ne / (1 + a(t.barGapWidth, "chartex") / 100);
359
+ for (let n = 0; n < l; n++) {
360
+ let a = Math.max(0, o[n] ?? 0), c = F * a / u, l = M + (F - c) / 2, g = P + ne * n + (ne - R) / 2, x = (e) => {
361
+ b && c > 0 ? te(e, b, {
362
+ x: l,
363
+ y: g,
364
+ w: c,
365
+ h: R
366
+ }, y, r, i) : b && (e.fillStyle = Se(e, b, l, g, c, R, y, i), e.fillRect(l, g, c, R)), Ce(e, t, t.chartexDataPointStyle, _, 0, 1, y, r) && e.strokeRect(l, g, c, R);
367
+ };
368
+ c > 0 ? ee(e, _?.chartexStyle, t.chartexDataPointStyle, 0, {
369
+ x: l,
370
+ y: g,
371
+ w: c,
372
+ h: R
373
+ }, r, x) : x(e);
374
+ let S = t.categories[n];
375
+ !t.catAxisHidden && S != null && (e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#595959", e.textAlign = "right", e.textBaseline = "middle", e.fillText(S, M - 6, g + R / 2));
376
+ let C = s(t, _, n, S ?? "", a, {
433
377
  visible: !1,
434
378
  showVal: !1,
435
379
  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, {
380
+ }, v);
381
+ if (C) {
382
+ let n = p(C.fontSizeHpt, r) ?? xe(t.dataLabelFontSizeHpt, h, r), a = V(t, C.fontFace ?? t.dataLabelFontFace, "minor");
383
+ e.font = `${C.textStyle.fontItalic ? "italic " : ""}${C.fontBold ? "bold " : ""}${n}px ${a}`, de(e, C.text, {
440
384
  kind: "bar",
441
385
  rect: {
442
386
  x: l,
443
- y: u,
444
- w: s,
445
- h: B
387
+ y: g,
388
+ w: c,
389
+ h: R
446
390
  },
447
391
  orientation: "horizontal",
448
392
  negative: !1,
449
- position: _.position ?? "ctr"
393
+ position: C.position ?? "ctr"
450
394
  }, {
451
- x: F,
452
- y: I,
453
- w: ie,
395
+ x: M,
396
+ y: P,
397
+ w: F,
454
398
  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);
399
+ }, n, C.fontColor ? `#${C.fontColor}` : "#ffffff", C.manualLayout, {
400
+ x: d,
401
+ y: f,
402
+ w: m,
403
+ h
404
+ }, se(t, C.richRuns, r, a, C.fontBold ?? !1, C.textStyle), void 0, C.textStyle, r, C.labelBox, i);
461
405
  }
462
406
  }
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();
407
+ if (!t.catAxisHidden && !t.catAxisLineHidden) {
408
+ let n = N(t.catAxisLineColor, t.catAxisLineWidthEmu, r);
409
+ e.strokeStyle = n.color, e.lineWidth = n.width, e.beginPath(), e.moveTo(M, P), e.lineTo(M, P + L), e.stroke();
466
410
  }
467
- he(t, T, E, f, p, h, g, F, I, ie, L, _.bandH + 2, a, [w], o), t.restore();
411
+ Oe(e, x, S, d, f, m, h, M, P, F, L, g.bandH + 2, r, [b], i), e.restore();
468
412
  }
469
- function Ae(e, t, n, r, i = 0) {
413
+ function Y(e, t, n, r, i = 0) {
470
414
  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 });
415
+ if (!a || ye(e, n, Math.max(t.categories.length, a.categories?.length ?? 0, a.values.length))) return;
416
+ let o = G(a, t.categories, { sortDescending: !1 });
473
417
  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, {
418
+ let s = we(a, 0), c = ae(t, t.chartexDataPointLineStyle, a, s, 1, ve(0, a), { linkedNoStyleFallback: !0 });
419
+ ie(e, {
476
420
  ...t,
477
421
  chartType: "line",
478
422
  categories: o.categories,
@@ -496,17 +440,17 @@ function Ae(e, t, n, r, i = 0) {
496
440
  valAxisMajorUnit: t.valAxisMajorUnit ?? .2
497
441
  }, n, r, i);
498
442
  }
499
- function je(e, t, n, r, i = 0) {
443
+ function X(e, t, n, r, i = 0) {
500
444
  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);
445
+ if (!a || ye(e, n, Math.max(t.categories.length, a.categories?.length ?? 0, a.values.length))) return;
446
+ let o = G(a, t.categories);
503
447
  if (o.points.length === 0) return;
504
448
  let s = t.series.find((e) => e.seriesType === "line"), c = s?.chartexFormatIdx ?? a.chartexFormatIdx ?? 0, l = {
505
449
  ...s ?? o.series,
506
450
  name: s?.name || "Cumulative %",
507
451
  values: o.series.values,
508
452
  categories: o.categories,
509
- color: s?.color ?? F(t, t.chartexDataPointLineStyle, "line", c, 1) ?? a.lineColor ?? a.color,
453
+ color: s?.color ?? me(t, t.chartexDataPointLineStyle, "line", c, 1) ?? a.lineColor ?? a.color,
510
454
  seriesType: "line",
511
455
  useSecondaryAxis: !0,
512
456
  showMarker: !1
@@ -531,7 +475,7 @@ function je(e, t, n, r, i = 0) {
531
475
  titleFontColor: t.secondaryValAxis?.titleFontColor ?? null,
532
476
  titleFontFace: t.secondaryValAxis?.titleFontFace ?? null
533
477
  };
534
- A(e, {
478
+ F(e, {
535
479
  ...t,
536
480
  chartType: "clusteredBar",
537
481
  categories: o.categories,
@@ -546,14 +490,14 @@ function je(e, t, n, r, i = 0) {
546
490
  semanticLineNoStyleFallback: !0
547
491
  }, i);
548
492
  }
549
- var K = 7, q = .05, Me = 1.2;
550
- function Ne(e, t, n, r) {
493
+ var Z = 7, He = .05, Q = 1.2;
494
+ function Ue(e, t, n, r) {
551
495
  let i = (r ?? t) - (n ?? e);
552
496
  if (!(i > 0) || !Number.isFinite(i)) return null;
553
- let a = b(i, K);
497
+ let a = je(i, Z);
554
498
  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);
499
+ let o = e - i * He, s = t + i * He;
500
+ e >= 0 && (e === 0 || t > Q * e) && (o = 0), t <= 0 && (t === 0 || Math.abs(e) > Q * Math.abs(t)) && (s = 0);
557
501
  let c = n ?? Math.floor(o / a) * a, l = r ?? Math.ceil(s / a) * a;
558
502
  return ![c, l].every(Number.isFinite) || !(l > c) ? null : {
559
503
  min: c,
@@ -561,272 +505,279 @@ function Ne(e, t, n, r) {
561
505
  majorUnit: a
562
506
  };
563
507
  }
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) => {
508
+ function We(t, r, i, o, s) {
509
+ let l = 3 * o, u = r.chartexBox;
510
+ if (!u || u.categories.length === 0 || u.series.length === 0) return;
511
+ let { x: f, y: p, w: m, h } = i;
512
+ if (ye(t, i, C(u.series.map((e) => e.valuesByCategory), 1e4))) return;
513
+ let _ = () => {
514
+ t.fillStyle = "#888", t.font = "12px sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("(chart values out of range)", f + m / 2, p + h / 2);
515
+ }, v = (e) => {
572
516
  let t = e.max - e.min, n = t / e.step;
573
517
  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();
518
+ }, y = Infinity, b = -Infinity;
519
+ for (let e of u.series) for (let t of e.valuesByCategory) for (let e of t) Number.isFinite(e) && (e < y && (y = e), e > b && (b = e));
520
+ if (!isFinite(y) || !isFinite(b)) return;
521
+ if (!Number.isFinite(b - y)) {
522
+ _();
579
523
  return;
580
524
  }
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
525
+ let x = r.valAxisMajorUnit == null ? Ue(y, b, r.valMin, r.valMax) : null, S = x ? {
526
+ ...r,
527
+ valMin: x.min,
528
+ valMax: x.max,
529
+ valAxisMajorUnit: x.majorUnit
530
+ } : r, E = V(r, r.valAxisFontFace, "minor"), k = xe(r.valAxisFontSizeHpt, h, o), A = P(k), F = he(o), I = Ae({
531
+ dataMin: y,
532
+ dataMax: b,
533
+ explicitMin: S.valMin,
534
+ explicitMax: S.valMax,
535
+ axisLenPt: h / o,
536
+ majorUnit: S.valAxisMajorUnit
593
537
  });
594
- if (!te({
595
- min: ve.min,
596
- max: ve.max,
597
- step: ve.majorUnit
538
+ if (!v({
539
+ min: I.min,
540
+ max: I.max,
541
+ step: I.majorUnit
598
542
  })) {
599
- M();
543
+ _();
600
544
  return;
601
545
  }
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);
606
- 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);
546
+ let L = 0;
547
+ if (!r.valAxisHidden) {
548
+ let e = t.font;
549
+ t.font = be(k, E, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1);
550
+ let n = 0;
551
+ for (let e of I.majorTicks) {
552
+ let i = le(r, e, !1);
553
+ n = Math.max(n, t.measureText(i).width);
610
554
  }
611
- n.font = e, ye = r + U + t * p;
555
+ t.font = e, L = n + A + g * o;
612
556
  }
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,
557
+ let ie = Ee(t, r, m, h, o), se = xe(r.catAxisFontSizeHpt, h, o), de = xe(r.valAxisFontSizeHpt, h, o), ve = n(r, m, h, o), H = u.series.length, Se = u.series.map((e, t) => we(e, t)), De = u.series.map((e, t) => {
558
+ let n = Se[t], i = e.color ?? z(r, n, H, e.chartexStyle);
559
+ return pe(r, e.name, e, r.chartexDataPointStyle, n, H, i, !0);
560
+ }), ke = {
561
+ ...r,
562
+ series: De
563
+ }, je = ue(t, ke, m, h, .22, o), { legRightW: Me, legLeftW: Ne, legTopH: Pe, legBottomH: Fe } = D(je, r.legendOverlay === !0), Ie = c(r, f, p, m, h, o, {
564
+ titleBand: ie,
621
565
  legendSideReserveFrac: .22,
622
- legendReserve: De,
566
+ legendReserve: je,
623
567
  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)
568
+ t: ie.bandH + Pe + de / 2 + 2,
569
+ r: Me + m * .02,
570
+ b: Fe + ve.catBandH + (r.catAxisHidden ? h * .02 : d(se)),
571
+ l: Ne + ve.valBandW + (r.valAxisHidden ? m * .02 : L)
628
572
  },
629
573
  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();
574
+ }), { px0: W, py0: G, pw: K, ph: q } = Ie.plotRect;
575
+ j(t, r, W, G, K, q, o, s);
576
+ let Le = u.categories, Re = Le.length, ze = oe(S, y, b, q / o);
577
+ if (!v(ze)) {
578
+ _();
635
579
  return;
636
580
  }
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);
581
+ Te(t, r, f, p, m, h, p + Ie.title.topPad, Ie.title.fontPx);
582
+ let { min: Be, max: Ve } = ze, J = Ve - Be, Y = (e) => G + q * (1 - (e - Be) / J), X = N(r.valAxisLineColor, r.valAxisLineWidthEmu, o), Z = re(r, o);
583
+ if (t.save(), !r.valAxisHidden) {
584
+ if (t.font = be(k, E, r.valAxisFontBold ?? !1, r.valAxisFontItalic ?? !1), t.textAlign = "right", t.textBaseline = "middle", r.valAxisMinorGridlines) {
585
+ let e = ce(r, o);
586
+ for (let n of ze.minorLines) R(t, W, K, Y(n), !1, e);
643
587
  }
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);
588
+ for (let e of ze.majorLines) {
589
+ let n = Y(e);
590
+ if (r.valAxisMajorGridlines !== !1) {
591
+ t.strokeStyle = Z.color, t.lineWidth = Z.width;
592
+ let e = Z.dash.length > 0 && t.getLineDash ? t.getLineDash() : [];
593
+ Z.dash.length > 0 && t.setLineDash(Z.dash), t.beginPath(), t.moveTo(W, n), t.lineTo(W + K, n), t.stroke(), Z.dash.length > 0 && t.setLineDash(e);
650
594
  }
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);
595
+ t.fillStyle = r.valAxisFontColor ? `#${r.valAxisFontColor}` : "#595959", t.fillText(le(r, e, !1), W - F, n), _e(t, r.valAxisMajorTickMark, "val", W, n, X.color, X.width, !1, r.valAxisLineHidden, "major", o, r.valAxisLineDash);
652
596
  }
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);
597
+ for (let e of ze.minorTicks) _e(t, r.valAxisMinorTickMark, "val", W, Y(e), X.color, X.width, !1, r.valAxisLineHidden, "minor", o, r.valAxisLineDash);
598
+ r.valAxisLineHidden || ne(t, W, G, W, G + q, X.color, X.width, r.valAxisLineDash);
655
599
  }
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);
600
+ let He = N(r.catAxisLineColor, r.catAxisLineWidthEmu, o);
601
+ !r.catAxisHidden && !r.catAxisLineHidden && ne(t, W, G + q, W + K, G + q, He.color, He.width, r.catAxisLineDash);
602
+ let Q = K / Re, We = a(r.barGapWidth, "chartex"), Ge = (e) => `#${u.series[e].color ?? z(r, Se[e], H, u.series[e].chartexStyle)}`, Ke = (e) => U(r, Se[e], H, u.series[e].chartexStyle, u.series[e].color), qe = u.series.map((e) => e.valuesByCategory.map((t) => w(t, e.quartileMethod))), Je = (e, t) => {
603
+ let n = M(W, K, u.oneBoxPerSeries ? 1 : Re, H, u.oneBoxPerSeries ? 0 : e, t, We);
660
604
  return n ? {
661
605
  bx: n.boxX,
662
606
  boxW: n.boxWidth,
663
607
  cx: n.centerX
664
608
  } : {
665
- bx: K,
609
+ bx: W,
666
610
  boxW: 0,
667
- cx: K
611
+ cx: W
668
612
  };
669
613
  };
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));
614
+ for (let e = 0; e < H; e++) {
615
+ let n = u.series[e];
616
+ if (!n.meanLine) continue;
617
+ let i = r.chartexDataPointLineStyle ?? r.chartexDataPointStyle, a = n.lineColor ? `#${n.lineColor}` : Ge(e);
618
+ if (t.save(), Ce(t, r, i, n, Se[e], H, a, o) || n.lineColor != null) {
619
+ n.lineColor && (t.strokeStyle = a), n.lineWidthEmu && (t.lineWidth = T(n.lineWidthEmu, o));
676
620
  let r = !1;
677
- n.beginPath();
678
- for (let t = 0; t < Fe; t++) {
679
- let i = Ue[e][t];
621
+ t.beginPath();
622
+ for (let n = 0; n < Re; n++) {
623
+ let i = qe[e][n];
680
624
  if (!i) {
681
625
  r = !1;
682
626
  continue;
683
627
  }
684
- let { cx: a } = We(t, e), o = Y(i.mean);
685
- r ? n.lineTo(a, o) : n.moveTo(a, o), r = !0;
628
+ let { cx: a } = Je(n, e), o = Y(i.mean);
629
+ r ? t.lineTo(a, o) : t.moveTo(a, o), r = !0;
686
630
  }
687
- n.stroke();
631
+ t.stroke();
688
632
  }
689
- n.restore();
633
+ t.restore();
690
634
  }
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
- }
635
+ let $ = xe(r.catAxisFontSizeHpt, h, o), Ye = O($);
636
+ for (let n = 0; n < Re; n++) {
637
+ let i = W + Q * (n + .5);
638
+ r.catAxisHidden || _e(t, r.catAxisMajorTickMark, "cat", G + q, i, He.color, He.width, !1, r.catAxisLineHidden, "major", o, r.catAxisLineDash);
639
+ for (let i = 0; i < H; i++) {
640
+ let a = u.series[i], c = qe[i][n];
641
+ if (!c) continue;
642
+ let { bx: d, boxW: f, cx: p } = Je(n, i), m = Ge(i), h = Ke(i), g = r.chartexDataPointStyle, _ = r.chartexDataPointLineStyle ?? g, v = r.chartexDataPointMarkerStyle ?? g, y = Se[i], b = me(r, g, "line", y, H), x = a.lineColor ? `#${a.lineColor}` : b ? `#${b}` : m, S = a.lineWidthEmu ? T(a.lineWidthEmu, o) : g?.lineWidthEmu == null ? 1 : T(g.lineWidthEmu, o), C = me(r, _, "line", y, H), w = me(r, v, "fill", y, H), E = B(r, y, H, a.chartexStyle, a.color, v), D = me(r, v, "line", y, H), O = ae(r, v, a, y, H, D ?? x, { linkedNoStyleFallback: !0 }), k = e(a.chartexStyle), A = (e, n) => Ce(t, r, e, a, y, H, n, o, { linkedNoStyleFallback: !0 }), j = Y(c.q1), M = Y(c.q3), N = Math.min(j, M), P = Math.max(1, Math.abs(j - M)), F = f * .4;
643
+ A(_, C ?? x) && (t.beginPath(), t.moveTo(p, Y(c.whiskerHi)), t.lineTo(p, M), t.moveTo(p, j), t.lineTo(p, Y(c.whiskerLo)), t.moveTo(p - F / 2, Y(c.whiskerHi)), t.lineTo(p + F / 2, Y(c.whiskerHi)), t.moveTo(p - F / 2, Y(c.whiskerLo)), t.lineTo(p + F / 2, Y(c.whiskerLo)), t.stroke()), ee(t, a.chartexStyle, g, y, {
644
+ x: d,
645
+ y: N,
646
+ w: f,
647
+ h: P
648
+ }, o, (e) => {
649
+ h && te(e, h, {
650
+ x: d,
651
+ y: N,
652
+ w: f,
653
+ h: P
654
+ }, m, o, s), Ce(e, r, g, a, y, H, x, o, { linkedNoStyleFallback: !0 }) && e.strokeRect(d + S / 2, N + S / 2, f - S, P - S);
655
+ });
656
+ let I = Y(c.median);
657
+ if (A(_, C ?? x) && (t.beginPath(), t.moveTo(d, I), t.lineTo(d + f, I), t.stroke()), a.showNonoutliers) {
658
+ let e = r.chartStyleMarkerSymbol ?? r.chartexMarkerSymbol ?? "circle";
659
+ for (let n of c.inner) e !== "none" && fe(t, p, Y(n), e, 3, E ? w ? `#${w}` : m : "transparent", O.visible ? O.color : null, o, O.widthEmu == null ? 1 : T(O.widthEmu, o), E, s, O.visible ? O.paint : null, O.dash, O.customDash, O.cap, O.join, !1, k, v, y, y);
711
660
  }
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());
661
+ if (a.meanMarker) {
662
+ let e = Y(c.mean), n = l;
663
+ A(v, D ?? x) && (t.beginPath(), t.moveTo(p - n, e - n), t.lineTo(p + n, e + n), t.moveTo(p + n, e - n), t.lineTo(p - n, e + n), t.stroke());
715
664
  }
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
- }
665
+ if (a.showOutliers) {
666
+ let e = r.chartStyleMarkerSymbol ?? r.chartexMarkerSymbol ?? "circle";
667
+ for (let n of c.outliers) e !== "none" && fe(t, p, Y(n), e, 3, E ? w ? `#${w}` : m : "transparent", O.visible ? O.color : null, o, O.widthEmu == null ? 1 : T(O.widthEmu, o), E, s, O.visible ? O.paint : null, O.dash, O.customDash, O.cap, O.join, !1, k, v, y, y);
723
668
  }
724
669
  }
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);
670
+ if (!r.catAxisHidden) {
671
+ t.font = be($, V(r, r.catAxisFontFace, "minor"), r.catAxisFontBold ?? !1, r.catAxisFontItalic ?? !1), t.fillStyle = r.catAxisFontColor ? `#${r.catAxisFontColor}` : "#595959", t.textAlign = "center", t.textBaseline = "top";
672
+ let e = Le[n];
673
+ t.fillText(e, i, G + q + Ye);
729
674
  }
730
675
  }
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)), _);
676
+ t.restore(), ge(t, r, f, p, m, h, W, G, K, q, Ne, Fe, ve.catFontPx, ve.valFontPx), Oe(t, ke, je, f, p, m, h, W, G, K, q, ie.bandH + 2, o, u.series.map((e, t) => Ke(t)), s);
732
677
  }
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);
678
+ var Ge = .18;
679
+ function Ke(e, t, n, r, i) {
680
+ let a = t.chartexSunburst;
681
+ if (!a || a.rows.length === 0) return;
682
+ let { x: o, y: l, w: u, h: d } = n;
683
+ if (v(a.rows)) {
684
+ ye(e, n, _ + 1);
740
685
  return;
741
686
  }
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 = {
687
+ let f = y(a.rows);
688
+ if (f.layoutWeight <= 0 || f.children.length === 0) return;
689
+ let h = t.series[0], g = I(h?.dataLabelOverrides), b = f.children.map((e, n) => U(t, n, f.children.length, h?.chartexStyle, h?.color)), S = {
745
690
  ...t,
746
691
  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);
692
+ series: f.children.map((e) => {
693
+ let n = z(t, e.branchIndex, f.children.length, h?.chartexStyle);
694
+ return pe(t, e.label, h, t.chartexDataPointStyle, e.branchIndex, f.children.length, n, !1, !1);
750
695
  })
751
- }, y = ee(e, v, d, f, .22, a), b = s(t, l, u, d, f, a, {
696
+ }, C = ue(e, S, u, d, .22, r), w = c(t, o, l, u, d, r, {
752
697
  titleTopPadFrac: .035,
753
698
  titleBottomPadFrac: .035,
754
699
  legendSideReserveFrac: 0,
755
- legendReserve: y,
700
+ legendReserve: C,
756
701
  radialGapFrac: .02,
757
702
  honorPlotAreaManualLayout: !0
758
703
  });
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];
765
- for (; ae.length > 0;) {
766
- let e = ae.pop();
767
- e.depth >= 0 && B[e.depth].push(e);
768
- for (let t = e.children.length - 1; t >= 0; t--) ae.push(e.children[t]);
704
+ Te(e, t, o, l, u, d, l + w.title.topPad, w.title.fontPx);
705
+ let { px0: T, py0: E, pw: D, ph: O } = w.plotRect;
706
+ j(e, t, T, E, D, O, r, i);
707
+ let k = T + D / 2, A = E + O / 2, M = Math.min(D, O) * .46;
708
+ f.a0 = -Math.PI / 2, f.a1 = -Math.PI / 2 + Math.PI * 2, x(f);
709
+ let N = m(f) + 1, P = M * Ge, F = (M - P) / N, te = (e) => `#${z(t, e, f.children.length, h?.chartexStyle)}`, ne = (e) => U(t, e, f.children.length, h?.chartexStyle, h?.color), R = h?.seriesDataLabels, re = V(t, R?.fontFace ?? t.dataLabelFontFace, "minor"), ie = p(R?.fontSizeHpt, r) ?? Math.max(7, Math.min(13, M * .075)), ae = R?.fontColor ? `#${R.fontColor}` : "#ffffff", oe = Array.from({ length: N }, () => []), ce = [f];
710
+ for (; ce.length > 0;) {
711
+ let e = ce.pop();
712
+ e.depth >= 0 && oe[e.depth].push(e);
713
+ for (let t = e.children.length - 1; t >= 0; t--) ce.push(e.children[t]);
769
714
  }
770
715
  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, {
716
+ for (let n = 0; n < N; n++) {
717
+ let a = P + n * F, c = a + F;
718
+ for (let m of oe[n]) {
719
+ let n = m.a1 - m.a0;
720
+ if (n <= 1e-4) continue;
721
+ let _ = ne(m.branchIndex), v = {
722
+ x: k - c,
723
+ y: A - c,
724
+ w: c * 2,
725
+ h: c * 2
726
+ };
727
+ ee(e, h?.chartexStyle, t.chartexDataPointStyle, h?.chartexFormatIdx ?? 0, v, r, (e) => {
728
+ e.beginPath(), e.arc(k, A, c, m.a0, m.a1), e.arc(k, A, a, m.a1, m.a0, !0), e.closePath(), _ && L(e, _, v, te(m.branchIndex), r, i), Ce(e, t, t.chartexDataPointStyle, t.series[0], m.branchIndex, f.children.length, "#ffffff", r) && e.stroke();
729
+ }, m.branchIndex);
730
+ let y = s(t, h, m.labelIndex, m.label, m.value, {
780
731
  visible: !1,
781
732
  showVal: !1,
782
733
  showCatName: !1
783
734
  }, 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, {
735
+ if (!y) continue;
736
+ let b = y.text, x = p(y.fontSizeHpt, r) ?? ie, S = y.fontColor ? `#${y.fontColor}` : ae, C = y.fontFace ? V(t, y.fontFace, "minor") : re, w = (m.a0 + m.a1) / 2, j = (a + c) / 2, M = F - 4, N = n * j;
737
+ if (!y.manualLayout && M < x * .9 && N < x * .9) continue;
738
+ let P = k + Math.cos(w) * j, I = A + Math.sin(w) * j;
739
+ if (e.font = `${y.textStyle.fontItalic ? "italic " : ""}${y.fontBold ? "bold " : ""}${x}px ${C}`, y.manualLayout) {
740
+ de(e, b, {
790
741
  kind: "point",
791
- x: ee,
792
- y: P,
793
- position: _.position ?? "ctr"
742
+ x: P,
743
+ y: I,
744
+ position: y.position ?? "ctr"
794
745
  }, {
795
- x,
796
- y: w,
797
- w: T,
798
- h: E
799
- }, y, b, _.manualLayout, {
800
- x: l,
801
- y: u,
802
- w: d,
803
- h: f
804
- }, k(t, _.richRuns, a, S, _.fontBold ?? !1, _.textStyle), void 0, _.textStyle, a, _.labelBox, o);
746
+ x: T,
747
+ y: E,
748
+ w: D,
749
+ h: O
750
+ }, x, S, y.manualLayout, {
751
+ x: o,
752
+ y: l,
753
+ w: u,
754
+ h: d
755
+ }, se(t, y.richRuns, r, C, y.fontBold ?? !1, y.textStyle), void 0, y.textStyle, r, y.labelBox, i);
805
756
  continue;
806
757
  }
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, {
758
+ e.save(), e.translate(P, I);
759
+ let R = w, oe = R * 180 / Math.PI % 360;
760
+ (oe > 90 || oe < -90) && (R += Math.PI), e.rotate(R), e.font = `${y.textStyle.fontItalic ? "italic " : ""}${y.fontBold ? "bold " : ""}${x}px ${C}`, de(e, b, {
810
761
  kind: "point",
811
762
  x: 0,
812
763
  y: 0,
813
- position: _.position ?? "ctr"
764
+ position: y.position ?? "ctr"
814
765
  }, {
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();
766
+ x: -M / 2,
767
+ y: -N / 2,
768
+ w: M,
769
+ h: N
770
+ }, x, S, void 0, {
771
+ x: -M / 2,
772
+ y: -N / 2,
773
+ w: M,
774
+ h: N
775
+ }, se(t, y.richRuns, r, C, y.fontBold ?? !1, y.textStyle), void 0, y.textStyle, r, y.labelBox, i), e.restore();
825
776
  }
826
777
  }
827
- e.restore(), he(e, v, y, l, u, d, f, x, w, T, E, b.title.bandH + 2, a, _, o);
778
+ e.restore(), Oe(e, S, C, o, l, u, d, T, E, D, O, w.title.bandH + 2, r, b, i);
828
779
  }
829
- function Ie(e, t) {
780
+ function qe(e, t) {
830
781
  let n = e.map((e, t) => ({
831
782
  node: e,
832
783
  index: t,
@@ -889,129 +840,143 @@ function Ie(e, t) {
889
840
  }
890
841
  return p(c, l), o;
891
842
  }
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);
843
+ function Je(e, t, n, r, i) {
844
+ let a = t.chartexTreemap;
845
+ if (!a || a.rows.length === 0) return;
846
+ if (v(a.rows)) {
847
+ ye(e, n, _ + 1);
897
848
  return;
898
849
  }
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 = {
850
+ let o = y(a.rows, !0);
851
+ if (o.layoutWeight <= 0 || o.children.length === 0) return;
852
+ let l = t.series[0], u = o.children.map((e) => U(t, e.branchIndex, o.children.length, l?.chartexStyle, l?.color)), d = {
902
853
  ...t,
903
854
  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);
855
+ series: o.children.map((e) => {
856
+ let n = z(t, e.branchIndex, o.children.length, l?.chartexStyle);
857
+ return pe(t, e.label, l, t.chartexDataPointStyle, e.branchIndex, o.children.length, n, !0, !1);
907
858
  })
908
- }, p = ee(e, f, r.w, r.h, .22, a), h = s(t, r.x, r.y, r.w, r.h, a, {
859
+ }, f = ue(e, d, n.w, n.h, .22, r), m = c(t, n.x, n.y, n.w, n.h, r, {
909
860
  titleTopPadFrac: .035,
910
861
  titleBottomPadFrac: .035,
911
862
  legendSideReserveFrac: 0,
912
- legendReserve: p,
863
+ legendReserve: f,
913
864
  radialGapFrac: .015,
914
865
  honorPlotAreaManualLayout: !0
915
866
  });
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);
919
- let b = {
920
- x: g,
921
- y: _,
922
- w: v,
923
- 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, {
929
- visible: x !== "none",
867
+ Te(e, t, n.x, n.y, n.w, n.h, n.y + m.title.topPad, m.title.fontPx);
868
+ let { px0: h, py0: g, pw: b, ph: x } = m.plotRect;
869
+ j(e, t, h, g, b, x, r, i);
870
+ let S = {
871
+ x: h,
872
+ y: g,
873
+ w: b,
874
+ h: x
875
+ }, C = a.parentLabelLayout ?? "overlapping", w = t.series[0]?.seriesDataLabels, T = V(t, w?.fontFace ?? t.dataLabelFontFace, "minor"), E = p(w?.fontSizeHpt, r) ?? Math.max(8, Math.min(13, m.plotRect.ph * .025)), D = w?.fontColor ? `#${w.fontColor}` : "#ffffff", O = new Map((t.series[0]?.dataLabelOverrides ?? []).map((e) => [e.idx, e])), k = t.chartBg ? t.chartBg.startsWith("#") ? t.chartBg : `#${t.chartBg}` : "#ffffff", A = (a, c) => {
876
+ if (c.w < .5 || c.h < .5) return;
877
+ let u = `#${z(t, a.branchIndex, o.children.length, l?.chartexStyle)}`, d = U(t, a.branchIndex, o.children.length, l?.chartexStyle, l?.color), f = O.get(a.labelIndex), m = f?.fontColor ? `#${f.fontColor}` : D, h = p(f?.fontSizeHpt, r) ?? E, g = f?.fontBold ?? w?.fontBold ?? !1;
878
+ if (a.children.length > 0) {
879
+ let o = s(t, l, a.labelIndex, a.label, a.value, {
880
+ visible: C !== "none",
930
881
  showVal: !1,
931
882
  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)
883
+ }, O, !0), p = o != null && (C !== "overlapping" || a.depth === 0), _ = h, v = o?.fontFace ? V(t, o.fontFace, "minor") : T, y = C === "banner" && p ? Math.min(c.h * .28, _ + 7) : 0;
884
+ y > 0 && ee(e, l?.chartexStyle, t.chartexDataPointStyle, l?.chartexFormatIdx ?? 0, {
885
+ x: c.x,
886
+ y: c.y,
887
+ w: c.w,
888
+ h: y
889
+ }, r, (e) => {
890
+ d && te(e, d, {
891
+ x: c.x,
892
+ y: c.y,
893
+ w: c.w,
894
+ h: y
895
+ }, u, r, i);
896
+ }, a.branchIndex);
897
+ let b = {
898
+ x: c.x,
899
+ y: c.y + y,
900
+ w: c.w,
901
+ h: Math.max(0, c.h - y)
939
902
  };
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 ? {
903
+ for (let e of qe(a.children, b)) A(e.node, e.rect);
904
+ if (p && (o.manualLayout || c.w > _ * 2 && c.h > _ + 4)) {
905
+ e.font = `${g ? "bold " : ""}${_}px ${v}`;
906
+ let a = y > 0 ? {
907
+ x: c.x,
908
+ y: c.y,
909
+ w: c.w,
910
+ h: y
911
+ } : c, s = f?.position ?? "inBase";
912
+ de(e, o.text, o.manualLayout ? {
950
913
  kind: "point",
951
- x: s.x + s.w / 2,
952
- y: s.y + s.h / 2,
953
- position: c
914
+ x: c.x + c.w / 2,
915
+ y: c.y + c.h / 2,
916
+ position: s
954
917
  } : {
955
918
  kind: "box",
956
- rect: i,
957
- 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);
919
+ rect: a,
920
+ position: s
921
+ }, o.manualLayout ? S : a, _, m, o.manualLayout, n, se(t, o.richRuns, r, v, g, o.textStyle), void 0, o.textStyle, r, o.labelBox, i);
959
922
  }
960
923
  return;
961
924
  }
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, {
925
+ ee(e, l?.chartexStyle, t.chartexDataPointStyle, l?.chartexFormatIdx ?? 0, c, r, (e) => {
926
+ d && te(e, d, c, u, r, i), Ce(e, t, t.chartexDataPointStyle, t.series[0], a.branchIndex, o.children.length, k, r, { linkedNoStyleFallback: !0 }) && e.strokeRect(c.x, c.y, c.w, c.h);
927
+ }, a.branchIndex);
928
+ let _ = s(t, l, a.labelIndex, a.label, a.value, {
964
929
  visible: !1,
965
930
  showVal: !1,
966
931
  showCatName: !1
967
- }, 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 ? {
932
+ }, O);
933
+ if (!_) return;
934
+ let v = p(_.fontSizeHpt, r) ?? h;
935
+ if (!_.manualLayout && (c.w <= v * 1.2 || c.h <= v * 1.2)) return;
936
+ let y = _.fontFace ? V(t, _.fontFace, "minor") : T;
937
+ e.font = `${_.fontBold ? "bold " : ""}${v}px ${y}`;
938
+ let b = c, x = _.position === "outEnd" ? "inEnd" : _.position ?? "ctr";
939
+ de(e, _.text, _.manualLayout ? {
975
940
  kind: "point",
976
- x: s.x + s.w / 2,
977
- y: s.y + s.h / 2,
978
- position: C
941
+ x: c.x + c.w / 2,
942
+ y: c.y + c.h / 2,
943
+ position: x
979
944
  } : {
980
945
  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);
946
+ rect: b,
947
+ position: x
948
+ }, _.manualLayout ? S : b, v, _.fontColor ? `#${_.fontColor}` : m, _.manualLayout, n, se(t, _.richRuns, r, y, _.fontBold ?? !1, _.textStyle), void 0, _.textStyle, r, _.labelBox, i);
984
949
  };
985
- e.save(), e.beginPath(), e.rect(g, _, v, y), e.clip();
986
- for (let e of Ie(l.children, {
987
- x: g,
988
- y: _,
989
- w: v,
990
- h: y
950
+ e.save(), e.beginPath(), e.rect(h, g, b, x), e.clip();
951
+ for (let e of qe(o.children, {
952
+ x: h,
953
+ y: g,
954
+ w: b,
955
+ h: x
991
956
  })) 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);
957
+ e.restore(), Oe(e, d, f, n.x, n.y, n.w, n.h, h, g, b, x, m.title.bandH + 2, r, u, i);
993
958
  }
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;
959
+ function $(e, t, n, r, i = 0) {
960
+ let a = Re(t, void 0, n, r), o = ze(t, n, r);
961
+ if (a != null && a > 1048576 || o != null && o > 1048576 || a != null && o != null && a > 1048576 - o) return ye(e, n, _ + 1), !0;
997
962
  switch (t.chartType) {
998
- case "waterfall": return Oe(e, t, n, r, a), !0;
999
- case "clusteredColumn": return A(e, {
963
+ case "waterfall": return Ve(e, t, n, r, i), !0;
964
+ case "clusteredColumn": return F(e, {
1000
965
  ...t,
1001
966
  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;
967
+ }, n, r, { gapPolicy: "chartex" }, i), !0;
968
+ case "histogram": return Be(e, t, n, r, i), !0;
969
+ case "funnel": return J(e, t, n, r, i), !0;
970
+ case "paretoLine": return Y(e, t, n, r, i), !0;
971
+ case "pareto": return X(e, t, n, r, i), !0;
972
+ case "boxWhisker": return We(e, t, n, r, i), !0;
973
+ case "sunburst": return Ke(e, t, n, r, i), !0;
974
+ case "treemap": return Je(e, t, n, r, i), !0;
1010
975
  default: return !1;
1011
976
  }
1012
977
  }
1013
978
  //#endregion
1014
979
  //#region src/chart-ex.ts
1015
- var ze = ge({ render: Re }, "chartEx");
980
+ var Ye = Me({ render: $ }, "chartEx");
1016
981
  //#endregion
1017
- export { ze as chartEx };
982
+ export { Ye as chartEx };