@epam/ai-dial-attachment-canvas 1.2.0-dev.3 → 1.2.0-dev.38

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