@silurus/ooxml 0.18.2 → 0.20.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.
- package/README.md +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/pptx-Ywwc_EMp.cjs +1 -0
- package/dist/pptx-nyHInjlO.js +23854 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/{renderer-Ctkyp4ee.js → renderer-BYSB4UM-.js} +86 -68
- package/dist/renderer-Bve7huQq.cjs +1 -0
- package/dist/types/index.d.ts +62 -1
- package/dist/types/pptx.d.ts +6 -0
- package/dist/types/xlsx.d.ts +56 -1
- package/dist/xlsx-BNTrfz9O.js +2757 -0
- package/dist/xlsx-CqPROU5n.cjs +10 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
- package/dist/pptx-B9bdrXoy.js +0 -23854
- package/dist/pptx-CUEsKfI-.cjs +0 -1
- package/dist/renderer-DfM3skLm.cjs +0 -1
- package/dist/xlsx-BmpsSkCq.js +0 -2687
- package/dist/xlsx-BqdGQJ8B.cjs +0 -10
package/dist/pptx.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./autoResize-ggn4hzd8.cjs`),t=require(`./pptx-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./autoResize-ggn4hzd8.cjs`),t=require(`./pptx-Ywwc_EMp.cjs`);exports.PptxPresentation=t.r,exports.PptxViewer=t.n,exports.autoResize=e.t,exports.renderSlide=t.i;
|
package/dist/pptx.mjs
CHANGED
|
@@ -275,17 +275,17 @@ function _(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
function v(e, t, n, r, i) {
|
|
278
|
+
function v(e, t, n, r, i, a, o) {
|
|
279
279
|
if (t === "none" || !t) return;
|
|
280
|
-
let
|
|
281
|
-
if (e.strokeStyle = "#888", e.lineWidth = 1, e.beginPath(), n === "val") {
|
|
282
|
-
let n = r, a = i, o = t === "out" || t === "cross" ? -
|
|
283
|
-
e.moveTo(n + o, a), e.lineTo(n +
|
|
280
|
+
let s = o ? Math.max(4, o + 2) : 4, c = e.strokeStyle, l = e.lineWidth;
|
|
281
|
+
if (e.strokeStyle = a ?? "#888", e.lineWidth = o ?? 1, e.beginPath(), n === "val") {
|
|
282
|
+
let n = r, a = i, o = t === "out" || t === "cross" ? -s : 0, c = t === "in" || t === "cross" ? s : 0;
|
|
283
|
+
e.moveTo(n + o, a), e.lineTo(n + c, a);
|
|
284
284
|
} else {
|
|
285
|
-
let n = r, a = i, o = t === "out" || t === "cross" ?
|
|
286
|
-
e.moveTo(a, n + o), e.lineTo(a, n +
|
|
285
|
+
let n = r, a = i, o = t === "out" || t === "cross" ? s : 0, c = t === "in" || t === "cross" ? -s : 0;
|
|
286
|
+
e.moveTo(a, n + o), e.lineTo(a, n + c);
|
|
287
287
|
}
|
|
288
|
-
e.stroke(), e.strokeStyle =
|
|
288
|
+
e.stroke(), e.strokeStyle = c, e.lineWidth = l;
|
|
289
289
|
}
|
|
290
290
|
function y(e, t, n) {
|
|
291
291
|
return e.titleFontSizeHpt ? e.titleFontSizeHpt / 100 * n : Math.max(10, t * .085);
|
|
@@ -610,76 +610,91 @@ function O(e, n, o, c) {
|
|
|
610
610
|
_(e, n, T, l, u, d, f, M - A / 2, N - j / 2, A, j, w + 2);
|
|
611
611
|
}
|
|
612
612
|
function k(e, n, r, a) {
|
|
613
|
-
let { x: o, y: s, w: l, h: u } = r, d = n.title ? y(n, u, a) : 0, f = n.title ? u * .035 : 0, p = n.title ? u * .035 : 0, h = n.title ? d + f + p : 0,
|
|
613
|
+
let { x: o, y: s, w: l, h: u } = r, d = n.title ? y(n, u, a) : 0, f = n.title ? u * .035 : 0, p = n.title ? u * .035 : 0, h = n.title ? d + f + p : 0, b = g(n, l, u), S = b?.side === "r" ? b.reserveW : 0, C = b?.side === "l" ? b.reserveW : 0, w = b?.side === "t" ? b.reserveH : 0, T = b?.side === "b" ? b.reserveH : 0, E = Math.max(8, Math.min(10, u * .045)), D = n.catAxisTitle ? E + 4 : 0, O = n.valAxisTitle ? E + 4 : 0;
|
|
614
614
|
if (n.title) {
|
|
615
615
|
let t = n.titleManualLayout;
|
|
616
616
|
t && (t.x !== void 0 || t.y !== void 0) ? x(e, n, o + t.x * l, s + t.y * u, (t.w ?? .5) * l, d) : x(e, n, o, s + f, l, d);
|
|
617
617
|
}
|
|
618
|
-
let
|
|
619
|
-
if (
|
|
618
|
+
let k = n.plotAreaManualLayout, N, F, I, L;
|
|
619
|
+
if (k && k.w != null && k.h != null) N = o + k.x * l, F = s + k.y * u, I = k.w * l, L = k.h * u;
|
|
620
620
|
else {
|
|
621
621
|
let e = {
|
|
622
|
-
t: h +
|
|
623
|
-
r:
|
|
624
|
-
b: (n.catAxisHidden ? u * .04 : u * .12) +
|
|
625
|
-
l: (n.valAxisHidden ? l * .04 : l * .12) +
|
|
622
|
+
t: h + w + u * .02,
|
|
623
|
+
r: S + l * .05,
|
|
624
|
+
b: (n.catAxisHidden ? u * .04 : u * .12) + D + T,
|
|
625
|
+
l: (n.valAxisHidden ? l * .04 : l * .12) + O + C
|
|
626
626
|
};
|
|
627
|
-
|
|
627
|
+
N = o + e.l, F = s + e.t, I = l - e.l - e.r, L = u - e.t - e.b;
|
|
628
628
|
}
|
|
629
|
-
if (
|
|
630
|
-
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(
|
|
631
|
-
let
|
|
629
|
+
if (I <= 0 || L <= 0) return;
|
|
630
|
+
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(N, F, I, L));
|
|
631
|
+
let R = [], z = [];
|
|
632
632
|
for (let e of n.series) {
|
|
633
633
|
let t = e.categories ?? [];
|
|
634
634
|
for (let e of t) {
|
|
635
635
|
let t = parseFloat(e);
|
|
636
|
-
isNaN(t) ||
|
|
636
|
+
isNaN(t) || R.push(t);
|
|
637
637
|
}
|
|
638
|
-
for (let t of e.values) t != null &&
|
|
638
|
+
for (let t of e.values) t != null && z.push(t);
|
|
639
639
|
}
|
|
640
|
-
let
|
|
641
|
-
if (
|
|
640
|
+
let B = R.length === 0;
|
|
641
|
+
if (B) {
|
|
642
642
|
let e = Math.max(...n.series.map((e) => e.values.length));
|
|
643
|
-
for (let t = 0; t < e; t++)
|
|
643
|
+
for (let t = 0; t < e; t++) R.push(t);
|
|
644
644
|
}
|
|
645
|
-
let
|
|
646
|
-
|
|
647
|
-
|
|
645
|
+
let V = Math.min(...R), H = Math.max(...R), U = Math.min(...z), W = Math.max(...z);
|
|
646
|
+
if (V === H && (--V, H += 1), U === W && (--U, W += 1), n.valMin == null ? U > 0 && (U = 0) : U = n.valMin, n.valMax != null && (W = n.valMax), n.catAxisMin != null && (V = n.catAxisMin), n.catAxisMax != null && (H = n.catAxisMax), n.catAxisMin == null || n.catAxisMax == null) {
|
|
647
|
+
let e = i(H - V);
|
|
648
|
+
e > 0 && (n.catAxisMin ?? (V = Math.floor(V / e) * e), n.catAxisMax ?? (H = Math.ceil(H / e) * e));
|
|
649
|
+
}
|
|
650
|
+
let G = (e) => N + (e - V) / (H - V) * I, K = (e) => F + L - (e - U) / (W - U) * L;
|
|
648
651
|
if (!n.valAxisHidden) {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
652
|
+
let t = Math.max(8, Math.min(11, L / 20));
|
|
653
|
+
e.font = `${n.valAxisFontBold ? "bold " : ""}${t}px sans-serif`;
|
|
654
|
+
let r = i(W - U), a = Math.round((W - U) / r) + 1;
|
|
655
|
+
for (let t = 0; t < a; t++) {
|
|
656
|
+
let i = U + t * r;
|
|
657
|
+
if (i > W + r * .01) break;
|
|
658
|
+
let a = K(i);
|
|
659
|
+
e.strokeStyle = "#e0e0e0", e.lineWidth = .5, e.beginPath(), e.moveTo(N, a), e.lineTo(N + I, a), e.stroke(), e.fillStyle = "#555", e.textAlign = "right", e.textBaseline = "middle", e.fillText(c(i, n.valAxisFormatCode), N - 4, a);
|
|
660
|
+
let o = n.valAxisLineColor ? `#${n.valAxisLineColor}` : void 0, s = n.valAxisLineWidthEmu ? Math.max(.5, n.valAxisLineWidthEmu / 12700) : void 0;
|
|
661
|
+
v(e, n.valAxisMajorTickMark, "val", N, a, o, s);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
let q = F + L;
|
|
665
|
+
if (n.catAxisCrossesAt != null) q = P(K(n.catAxisCrossesAt), F, F + L);
|
|
666
|
+
else {
|
|
667
|
+
let e = n.catAxisCrosses ?? "autoZero";
|
|
668
|
+
e === "autoZero" && U < 0 && W > 0 ? q = P(K(0), F, F + L) : e === "min" ? q = F + L : e === "max" && (q = F);
|
|
669
|
+
}
|
|
670
|
+
if (e.save(), e.strokeStyle = n.catAxisLineColor ? `#${n.catAxisLineColor}` : "#888", e.lineWidth = n.catAxisLineWidthEmu ? Math.max(.5, n.catAxisLineWidthEmu / 12700) : 1, e.lineCap = "butt", e.beginPath(), e.moveTo(N, q), e.lineTo(N + I, q), e.stroke(), e.restore(), n.valAxisHidden || (e.save(), e.strokeStyle = n.valAxisLineColor ? `#${n.valAxisLineColor}` : "#888", e.lineWidth = n.valAxisLineWidthEmu ? Math.max(.5, n.valAxisLineWidthEmu / 12700) : 1, e.beginPath(), e.moveTo(N, F), e.lineTo(N, F + L), e.stroke(), e.restore()), !n.catAxisHidden) {
|
|
671
|
+
let t = Math.max(8, Math.min(11, L / 20));
|
|
672
|
+
e.font = `${n.catAxisFontBold ? "bold " : ""}${t}px sans-serif`;
|
|
673
|
+
let r = i(H - V), a = Math.round((H - V) / r) + 1;
|
|
661
674
|
e.fillStyle = "#555", e.textAlign = "center", e.textBaseline = "top";
|
|
662
|
-
for (let
|
|
663
|
-
let
|
|
664
|
-
if (
|
|
665
|
-
let a =
|
|
666
|
-
e.fillText(c(
|
|
675
|
+
for (let t = 0; t < a; t++) {
|
|
676
|
+
let i = V + t * r;
|
|
677
|
+
if (i > H + r * .01) break;
|
|
678
|
+
let a = G(i);
|
|
679
|
+
e.fillText(c(i, n.catAxisFormatCode), a, q + 4);
|
|
680
|
+
let o = n.catAxisLineColor ? `#${n.catAxisLineColor}` : void 0, s = n.catAxisLineWidthEmu ? Math.max(.5, n.catAxisLineWidthEmu / 12700) : void 0;
|
|
681
|
+
v(e, n.catAxisMajorTickMark, "cat", q, a, o, s);
|
|
667
682
|
}
|
|
668
683
|
}
|
|
669
684
|
for (let r = 0; r < n.series.length; r++) {
|
|
670
685
|
let i = n.series[r], o = t(r, i), s = i.categories ?? [];
|
|
671
|
-
for (let t of i.errBars ?? []) j(e, i, t, s,
|
|
686
|
+
for (let t of i.errBars ?? []) j(e, i, t, s, B, G, K, o);
|
|
672
687
|
if (!(i.showMarker === !1 || typeof i.markerSymbol == "string" && i.markerSymbol === "none")) for (let t = 0; t < i.values.length; t++) {
|
|
673
688
|
let n = i.values[t];
|
|
674
689
|
if (n == null) continue;
|
|
675
|
-
let r =
|
|
690
|
+
let r = B ? t : parseFloat(s[t] ?? "0");
|
|
676
691
|
if (isNaN(r)) continue;
|
|
677
692
|
let c = (i.dataPointOverrides ?? []).find((e) => e.idx === t), l = c?.markerSymbol ?? i.markerSymbol ?? "circle", u = c?.markerSize ?? i.markerSize ?? 5, d = c?.markerFill ?? c?.color ?? i.markerFill ?? o, f = c?.markerLine ?? i.markerLine ?? null;
|
|
678
|
-
A(e,
|
|
693
|
+
A(e, G(r), K(n), l, u, d, f, a);
|
|
679
694
|
}
|
|
680
|
-
M(e, i, s,
|
|
695
|
+
M(e, i, s, B, G, K, L, a);
|
|
681
696
|
}
|
|
682
|
-
_(e, n,
|
|
697
|
+
_(e, n, b, o, s, l, u, N, F, I, L, h + 2), n.catAxisTitle && m(e, n.catAxisTitle, N, F, I, L, "cat", E), n.valAxisTitle && m(e, n.valAxisTitle, N, F, I, L, "val", E);
|
|
683
698
|
}
|
|
684
699
|
function A(e, t, n, r, i, a, o, s) {
|
|
685
700
|
let c = Math.max(2, i * s), l = c / 2;
|
|
@@ -722,7 +737,7 @@ function A(e, t, n, r, i, a, o, s) {
|
|
|
722
737
|
e.restore();
|
|
723
738
|
}
|
|
724
739
|
function j(e, t, n, r, i, a, o, s) {
|
|
725
|
-
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / 12700) : 1, e.setLineDash(
|
|
740
|
+
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / 12700) : 1, e.setLineDash(F(n.dash));
|
|
726
741
|
let c = n.barType === "plus" || n.barType === "both", l = n.barType === "minus" || n.barType === "both", u = n.dir === "x", d = e.lineWidth * 1.5;
|
|
727
742
|
for (let s = 0; s < t.values.length; s++) {
|
|
728
743
|
let f = t.values[s];
|
|
@@ -761,39 +776,42 @@ function M(e, t, n, r, i, a, o, s) {
|
|
|
761
776
|
let e = [];
|
|
762
777
|
if (u.showCatName && !r && e.push(n[d] ?? ""), u.showSerName && e.push(t.name), u.showVal && e.push(c(f, u.formatCode ?? null)), h = e.filter(Boolean).join(" "), !h) continue;
|
|
763
778
|
} else continue;
|
|
764
|
-
let g = m?.position ?? u?.position ?? "r", _ = m?.fontSizeHpt
|
|
765
|
-
N(e, i(p), a(f), h, g,
|
|
779
|
+
let g = m?.position ?? u?.position ?? "r", _ = m?.fontSizeHpt ?? u?.fontSizeHpt, v = _ ? _ / 100 * s : Math.max(9, Math.min(11, o / 25)), y = m?.fontColor ?? u?.fontColor, b = m?.fontBold ?? u?.fontBold ?? !1;
|
|
780
|
+
N(e, i(p), a(f), h, g, v, y, b);
|
|
766
781
|
}
|
|
767
782
|
}
|
|
768
|
-
function N(e, t, n, r, i, a, o) {
|
|
769
|
-
e.save(), e.font = `${a}px sans-serif`, e.fillStyle = o ? `#${o}` : "#333";
|
|
770
|
-
let
|
|
783
|
+
function N(e, t, n, r, i, a, o, s) {
|
|
784
|
+
e.save(), e.font = `${s ? "bold " : ""}${a}px sans-serif`, e.fillStyle = o ? `#${o}` : "#333";
|
|
785
|
+
let c = a * .6, l = t, u = n;
|
|
771
786
|
switch (i) {
|
|
772
787
|
case "l":
|
|
773
|
-
e.textAlign = "right", e.textBaseline = "middle",
|
|
788
|
+
e.textAlign = "right", e.textBaseline = "middle", l = t - c;
|
|
774
789
|
break;
|
|
775
790
|
case "r":
|
|
776
|
-
e.textAlign = "left", e.textBaseline = "middle",
|
|
791
|
+
e.textAlign = "left", e.textBaseline = "middle", l = t + c;
|
|
777
792
|
break;
|
|
778
793
|
case "t":
|
|
779
|
-
e.textAlign = "center", e.textBaseline = "bottom",
|
|
794
|
+
e.textAlign = "center", e.textBaseline = "bottom", u = n - c;
|
|
780
795
|
break;
|
|
781
796
|
case "b":
|
|
782
|
-
e.textAlign = "center", e.textBaseline = "top",
|
|
797
|
+
e.textAlign = "center", e.textBaseline = "top", u = n + c;
|
|
783
798
|
break;
|
|
784
799
|
case "ctr":
|
|
785
800
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
786
801
|
break;
|
|
787
802
|
default:
|
|
788
|
-
e.textAlign = "left", e.textBaseline = "middle",
|
|
803
|
+
e.textAlign = "left", e.textBaseline = "middle", l = t + c;
|
|
789
804
|
break;
|
|
790
805
|
}
|
|
791
|
-
let
|
|
792
|
-
e.textBaseline === "middle" ?
|
|
793
|
-
for (let t of
|
|
806
|
+
let d = r.split(/\r?\n/), f = a * 1.15, p = f * d.length, m = u;
|
|
807
|
+
e.textBaseline === "middle" ? m = u - (p - f) / 2 : e.textBaseline === "bottom" && (m = u - (p - f));
|
|
808
|
+
for (let t of d) e.fillText(t, l, m), m += f;
|
|
794
809
|
e.restore();
|
|
795
810
|
}
|
|
796
|
-
function P(e) {
|
|
811
|
+
function P(e, t, n) {
|
|
812
|
+
return e < t ? t : e > n ? n : e;
|
|
813
|
+
}
|
|
814
|
+
function F(e) {
|
|
797
815
|
if (!e) return [];
|
|
798
816
|
switch (e) {
|
|
799
817
|
case "solid": return [];
|
|
@@ -828,7 +846,7 @@ function P(e) {
|
|
|
828
846
|
default: return [];
|
|
829
847
|
}
|
|
830
848
|
}
|
|
831
|
-
function
|
|
849
|
+
function I(e, t, n) {
|
|
832
850
|
let { x: r, y: a, w: o, h: s } = n, c = o * .11, l = o * .04, u = s * .08, d = s * .18, f = r + c, p = a + u, m = o - c - l, h = s - u - d, g = t.series[0]?.values ?? [], _ = t.categories, v = _.length;
|
|
833
851
|
if (v === 0) return;
|
|
834
852
|
let y = new Set(t.subtotalIndices), b = 0, x = [];
|
|
@@ -878,7 +896,7 @@ function F(e, t, n) {
|
|
|
878
896
|
}
|
|
879
897
|
e.restore();
|
|
880
898
|
}
|
|
881
|
-
function
|
|
899
|
+
function L(e, t, n, r = 1.333) {
|
|
882
900
|
let { x: i, y: a, w: o, h: s } = n;
|
|
883
901
|
if (t.chartBg && (e.fillStyle = `#${t.chartBg}`, e.fillRect(i, a, o, s)), t.series.length === 0) {
|
|
884
902
|
e.fillStyle = "#888", e.font = "12px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("(no data)", i + o / 2, a + s / 2);
|
|
@@ -917,10 +935,10 @@ function I(e, t, n, r = 1.333) {
|
|
|
917
935
|
k(e, t, n, r);
|
|
918
936
|
break;
|
|
919
937
|
case "waterfall":
|
|
920
|
-
|
|
938
|
+
I(e, t, n);
|
|
921
939
|
break;
|
|
922
940
|
default: e.fillStyle = "#888", e.font = "11px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(`Chart: ${t.chartType}`, i + o / 2, a + s / 2);
|
|
923
941
|
}
|
|
924
942
|
}
|
|
925
943
|
//#endregion
|
|
926
|
-
export {
|
|
944
|
+
export { L as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[`4472C4`,`ED7D31`,`A9D18E`,`FF0000`,`70AD47`,`4BACC6`,`FFC000`,`9E480E`,`843C0C`,`636363`,`255E91`,`967300`];function t(t,n){return n?.color?`#${n.color}`:`#${e[t%e.length]}`}function n(t,n){let r=n.dataPointColors?.[t];return r?`#${r}`:`#${e[t%e.length]}`}function r(e,t){let n=e.startsWith(`#`)?e.slice(1):e;return`rgba(${parseInt(n.slice(0,2),16)},${parseInt(n.slice(2,4),16)},${parseInt(n.slice(4,6),16)},${t})`}function i(e,t=5){if(e===0)return 1;let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r;return(i<1.5?1:i<3.5?2:i<7.5?5:10)*r}function a(e,t){if(e<=0)return t;let n=Math.ceil(e/t)*t;return Math.abs(n-e)<t*1e-9?n+t:n}function o(e,t){if(e>=0)return 0;let n=Math.floor(e/t)*t;return Math.abs(n-e)<t*1e-9?n-t:n}function s(e){return Number.isInteger(e)?String(e):e.toFixed(6).replace(/\.?0+$/,``)}function c(e,t){if(!t)return s(e);if(l(t))return u(e,t);let n=d(t),r;return r=e>0?n[0]??t:e<0?n[1]??n[0]??t:n[2]??n[0]??t,r===``?``:(e<0&&n.length<2?`-`:``)+f(Math.abs(e),r)}function l(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`){t=!t;continue}if(!t){if(r===`\\`){n++;continue}if(r===`[`){for(;n<e.length&&e[n]!==`]`;)n++;continue}if(r===`y`||r===`Y`||r===`d`||r===`D`||r===`m`||r===`M`||r===`h`||r===`H`||r===`s`||r===`S`)return!0}}return!1}function u(e,t){let n=Date.UTC(1899,11,30),r=e<60?e+1:e,i=n+Math.floor(r)*864e5,a=new Date(i),o=a.getUTCFullYear(),s=a.getUTCMonth()+1,c=a.getUTCDate(),l=(e-Math.floor(e))*86400,u=Math.floor(l/3600),d=Math.floor(l%3600/60),f=Math.floor(l%60),p=``,m=!1,h=0;for(;h<t.length;){let e=t[h];if(e===`"`){m=!m,h++;continue}if(m){p+=e,h++;continue}if(e===`\\`&&h+1<t.length){p+=t[h+1],h+=2;continue}if(e===`[`){for(;h<t.length&&t[h]!==`]`;)h++;h<t.length&&h++;continue}if(e===`y`||e===`Y`){let e=0;for(;h<t.length&&(t[h]===`y`||t[h]===`Y`);)e++,h++;p+=e>=3?String(o):String(o%100).padStart(2,`0`);continue}if(e===`m`||e===`M`){let e=0;for(;h<t.length&&(t[h]===`m`||t[h]===`M`);)e++,h++;p.match(/[Hh]+\W*$/)?p+=e>=2?String(d).padStart(2,`0`):String(d):p+=e>=2?String(s).padStart(2,`0`):String(s);continue}if(e===`d`||e===`D`){let e=0;for(;h<t.length&&(t[h]===`d`||t[h]===`D`);)e++,h++;p+=e>=2?String(c).padStart(2,`0`):String(c);continue}if(e===`h`||e===`H`){let e=0;for(;h<t.length&&(t[h]===`h`||t[h]===`H`);)e++,h++;p+=e>=2?String(u).padStart(2,`0`):String(u);continue}if(e===`s`||e===`S`){let e=0;for(;h<t.length&&(t[h]===`s`||t[h]===`S`);)e++,h++;p+=e>=2?String(f).padStart(2,`0`):String(f);continue}p+=e,h++}return p}function d(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length){n+=i+e[r+1],r++;continue}if(i===`"`){for(n+=i,r++;r<e.length&&e[r]!==`"`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`[`){for(n+=i,r++;r<e.length&&e[r]!==`]`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`;`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function f(e,t){let n=[],r=0,i=!1,a=!1;for(;r<t.length;){let e=t[r];if(e===`"`){r++;let e=``;for(;r<t.length&&t[r]!==`"`;)e+=t[r],r++;r<t.length&&r++,n.push({kind:`lit`,text:e});continue}if(e===`\\`&&r+1<t.length){n.push({kind:`lit`,text:t[r+1]}),r+=2;continue}if(e===`_`&&r+1<t.length){n.push({kind:`lit`,text:` `}),r+=2;continue}if(e===`*`&&r+1<t.length){r+=2;continue}if(e===`[`){for(r++;r<t.length&&t[r]!==`]`;)r++;r<t.length&&r++;continue}if(e===`%`){a=!0,n.push({kind:`lit`,text:`%`}),r++;continue}if(e===`#`||e===`0`||e===`.`||e===`,`||e===`?`){let e=``;for(;r<t.length&&(t[r]===`#`||t[r]===`0`||t[r]===`.`||t[r]===`,`||t[r]===`?`);)e+=t[r],r++;n.push({kind:`num`,text:e}),i=!0;continue}n.push({kind:`lit`,text:e}),r++}if(!i)return n.map(e=>e.text).join(``);let o=a?e*100:e,s=``;for(let e of n)e.kind===`num`&&(s+=e.text);let c=p(o,s),l=!1;return n.map(e=>e.kind===`lit`?e.text:l?``:(l=!0,c)).join(``)}function p(e,t){let n=t.indexOf(`.`),r=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):``,a=/,/.test(r),o=(i.match(/[#0?]/g)??[]).length,s=(r.replace(/,/g,``).match(/0/g)??[]).length,[c,l=``]=e.toFixed(o).split(`.`),u=c.padStart(s,`0`),d=a?u.replace(/\B(?=(\d{3})+(?!\d))/g,`,`):u;return o===0?d:`${d}.${l.padEnd(o,`0`)}`}function m(e,t,n,r,i,a,o,s){e.save(),e.font=`${s}px sans-serif`,e.fillStyle=`#555`,o===`cat`?(e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(t.slice(0,30),n+i/2,r+a+s+2)):(e.translate(n-s-4,r+a/2),e.rotate(-Math.PI/2),e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t.slice(0,30),0,0)),e.restore()}function h(e,n,r,i,a,o,s=`vertical`){if(s===`horizontal`){let s=Math.max(9,Math.min(12,o*.7));e.font=`${s}px sans-serif`,e.textBaseline=`middle`;let c=n.map((e,t)=>e.name||`Series ${t+1}`),l=c.map(t=>14+e.measureText(t.slice(0,30)).width),u=r+(a-(l.reduce((e,t)=>e+t,0)+12*Math.max(0,n.length-1)))/2,d=i+o/2;for(let r=0;r<n.length;r++)e.fillStyle=t(r,n[r]),e.fillRect(u,d-s/2,10,s),e.fillStyle=`#333`,e.textAlign=`left`,e.fillText(c[r].slice(0,30),u+10+4,d),u+=l[r]+12;return}let c=Math.max(9,Math.min(12,o/(n.length+1)));e.font=`${c}px sans-serif`,e.textBaseline=`middle`;let l=c+4,u=i+(o-l*n.length)/2;for(let i=0;i<n.length;i++){e.fillStyle=t(i,n[i]),e.fillRect(r,u,10,c),e.fillStyle=`#333`,e.textAlign=`left`;let a=n[i].name||`Series ${i+1}`;e.fillText(a.slice(0,20),r+10+4,u+c/2),u+=l}}function g(e,t,n){if(!e.showLegend)return null;let r=e.legendPos??`r`,i=r===`l`?`l`:r===`t`?`t`:r===`b`?`b`:`r`;return i===`r`||i===`l`?{side:i,reserveW:Math.max(80,t*.22),reserveH:0}:{side:i,reserveW:0,reserveH:Math.max(18,n*.08)}}function _(e,t,n,r,i,a,o,s,c,l,u,d){if(!n)return;let f=t.legendManualLayout;if(f&&f.xMode===`edge`&&f.yMode===`edge`&&f.w>0&&f.h>0){let n=r+f.x*a,s=i+f.y*o,c=f.w*a,l=f.h*o,u=c>=l?`horizontal`:`vertical`;h(e,t.series,n,s,c,l,u);return}switch(n.side){case`r`:h(e,t.series,r+a-n.reserveW+4,c,n.reserveW-8,u);break;case`l`:h(e,t.series,r+4,c,n.reserveW-8,u);break;case`t`:h(e,t.series,s,i+d,l,n.reserveH,`horizontal`);break;case`b`:h(e,t.series,s,i+o-n.reserveH,l,n.reserveH,`horizontal`);break}}function v(e,t,n,r,i,a,o){if(t===`none`||!t)return;let s=o?Math.max(4,o+2):4,c=e.strokeStyle,l=e.lineWidth;if(e.strokeStyle=a??`#888`,e.lineWidth=o??1,e.beginPath(),n===`val`){let n=r,a=i,o=t===`out`||t===`cross`?-s:0,c=t===`in`||t===`cross`?s:0;e.moveTo(n+o,a),e.lineTo(n+c,a)}else{let n=r,a=i,o=t===`out`||t===`cross`?s:0,c=t===`in`||t===`cross`?-s:0;e.moveTo(a,n+o),e.lineTo(a,n+c)}e.stroke(),e.strokeStyle=c,e.lineWidth=l}function y(e,t,n){return e.titleFontSizeHpt?e.titleFontSizeHpt/100*n:Math.max(10,t*.085)}function b(e,t,n){return e?e/100*n:Math.max(8,t*.045)}function x(e,t,n,r,i,a){t.title&&(e.font=`bold ${a}px ${t.titleFontFace?`"${t.titleFontFace}", Calibri, Arial, sans-serif`:`Calibri, Arial, sans-serif`}`,e.fillStyle=t.titleFontColor?`#${t.titleFontColor}`:`#333`,e.textAlign=`center`,e.textBaseline=`top`,e.fillText(t.title,n+i/2,r))}function S(e){if(e.categories.length>0)return e.categories;let t=e.series[0];if(t?.categories&&t.categories.length>0)return t.categories;let n=0;for(let t of e.series)t.values.length>n&&(n=t.values.length);return n>0?Array.from({length:n},(e,t)=>String(t+1)):[]}function C(e,t,n,r,i,a,o,s,c){let l=s??`outEnd`;if(e.fillStyle=c?`#${c}`:`#333`,o===`vertical`){let o=n+a/2;l===`inBase`?(e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(t,o,r+i-2)):l===`inEnd`?(e.textAlign=`center`,e.textBaseline=`top`,e.fillText(t,o,r+2)):l===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,o,r+i/2)):(e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(t,o,r-1))}else{let o=r+a/2;l===`inBase`?(e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(t,n+4,o)):l===`inEnd`?(e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(t,n+i-4,o)):l===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,n+i/2,o)):(e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(t,n+i+2,o))}}function w(e,n,r,o){let{x:s,y:l,w:u,h:d}=r,f=n.chartType===`clusteredBarH`||n.chartType===`stackedBarH`||n.chartType===`stackedBarHPct`,p=n.chartType.startsWith(`stacked`),h=n.chartType===`stackedBarPct`||n.chartType===`stackedBarHPct`,v=n.series.filter(e=>e.seriesType!==`line`),b=n.series.filter(e=>e.seriesType===`line`),w=S(n),T=w.length;if(T===0)return;let E=n.title?y(n,d,o):0,D=n.title?d*.02:0,O=n.title?d*.025:0,k=n.title?E+D+O:0,A=g(n,u,d),j=A?.side===`r`?A.reserveW:0,M=A?.side===`l`?A.reserveW:0,N=A?.side===`t`?A.reserveH:0,P=A?.side===`b`?A.reserveH:0,F=Math.max(8,Math.min(10,d*.045)),I=n.catAxisTitle?F+4:0,L=n.valAxisTitle?F+4:0,R={t:k+N+d*.02,r:j+u*.03,b:d*.14+I+P,l:u*.12+L+M};f&&(R.l=(n.catAxisHidden?u*.03:u*.22)+L+M,R.b=(n.valAxisHidden?d*.02:d*.08)+I+P),x(e,n,s,l+D,u,E);let z=s+R.l,B=l+R.t,V=u-R.l-R.r,H=d-R.t-R.b;if(V<=0||H<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(z,B,V,H));let U=0;for(let e=0;e<T;e++){let t=0;for(let n of v){let r=n.values[e]??0;p?t+=Math.abs(r):U=Math.max(U,Math.abs(r))}p&&(U=Math.max(U,t))}h&&(U=100),n.valMax!=null&&(U=n.valMax),U===0&&(U=1);let W=i(U),G=n.valMax??a(U,W),K=`#e0e0e0`,q=Math.round(G/W);if(e.textBaseline=`middle`,e.font=`${Math.max(8,Math.min(11,H/20))}px sans-serif`,e.fillStyle=`#555`,!n.valAxisHidden)for(let t=0;t<=q;t++){let r=t*W,i=h?`${Math.round(r)}%`:c(r,n.valAxisFormatCode);if(f){let n=z+r/G*V;e.strokeStyle=t===0?`#aaa`:K,e.lineWidth=t===0?1:.5,e.beginPath(),e.moveTo(n,B),e.lineTo(n,B+H),e.stroke(),e.textAlign=`center`,e.fillText(i,n,B+H+10)}else{let n=B+H-r/G*H;e.strokeStyle=t===0?`#aaa`:K,e.lineWidth=t===0?1:.5,e.beginPath(),e.moveTo(z,n),e.lineTo(z+V,n),e.stroke(),e.textAlign=`right`,e.fillText(i,z-4,n)}}e.strokeStyle=`#aaa`,e.lineWidth=1,f?(e.beginPath(),e.moveTo(z,B),e.lineTo(z,B+H),e.stroke()):(e.beginPath(),e.moveTo(z,B+H),e.lineTo(z+V,B+H),e.stroke());let J=f?H/T:V/T,Y=p?1:Math.max(1,v.length),X=p?0:n.barOverlap??0,ee=n.barGapWidth??150,Z=J/(1+(Y-1)*(1-X/100)+ee/100),Q=p?0:Z*(1-X/100),$=(J-(Z+(Y-1)*Q))/2;for(let r=0;r<T;r++){let i=0,a=0;if(h){for(let e of v)a+=Math.abs(e.values[r]??0);a===0&&(a=1)}for(let o=0;o<v.length;o++){let s=v[o],l=s.values[r]??0,u=h?Math.abs(l)/a*100:Math.abs(l),d=t(o,s);if(f){let t=p?o:v.length-1-o,a=p?B+(T-1-r)*J+$:B+(T-1-r)*J+$+t*Q,l=u/G*V,f=p?z+i/G*V:z;e.fillStyle=d,e.fillRect(f,a,l,Z),n.showDataLabels&&u>0&&(e.font=`bold ${Math.max(7,Math.min(11,Z*.6))}px sans-serif`,C(e,h?`${Math.round(u)}%`:c(u,n.dataLabelFormatCode??s.valFormatCode??null),f,a,l,Z,`horizontal`,n.dataLabelPosition??null,n.dataLabelFontColor??null))}else{let t=p?z+r*J+$:z+r*J+$+o*Q,a=u/G*H,l=B+H-(p?i+u:u)/G*H;e.fillStyle=d,e.fillRect(t,l,Z,a),n.showDataLabels&&u>0&&(e.font=`bold ${Math.max(7,Math.min(11,Z*.6))}px sans-serif`,C(e,h?`${Math.round(u)}%`:c(u,n.dataLabelFormatCode??s.valFormatCode??null),t,l,Z,a,`vertical`,n.dataLabelPosition??null,n.dataLabelFontColor??null))}p&&(i+=u)}}if(!n.catAxisHidden){e.fillStyle=`#555`,e.font=`${Math.max(8,Math.min(11,J*.5))}px sans-serif`;for(let t=0;t<T;t++){let n=(w[t]??``).toString().slice(0,12);if(f){let r=B+(T-1-t)*J+J/2;e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(n,z-4,r)}else{let r=z+t*J+J/2;e.textAlign=`center`,e.textBaseline=`top`,e.fillText(n,r,B+H+3)}}}if(b.length>0&&!f)for(let n=0;n<b.length;n++){let r=b[n],i=t(v.length+n,r);e.strokeStyle=i,e.lineWidth=2,e.setLineDash([]),e.beginPath();let a=!1;for(let t=0;t<T;t++){let n=r.values[t];if(n==null){a=!1;continue}let i=z+t*J+J/2,o=B+H-n/G*H;a?e.lineTo(i,o):(e.moveTo(i,o),a=!0)}if(e.stroke(),r.showMarker!==!1)for(let t=0;t<T;t++){let n=r.values[t];if(n==null)continue;let a=z+t*J+J/2,o=B+H-n/G*H;e.fillStyle=i,e.beginPath(),e.arc(a,o,3,0,Math.PI*2),e.fill()}}_(e,f&&!p?{...n,series:[...n.series].reverse()}:n,A,s,l,u,d,z,B,V,H,k+2),n.catAxisTitle&&m(e,n.catAxisTitle,z,B,V,H,`cat`,F),n.valAxisTitle&&m(e,n.valAxisTitle,z,B,V,H,`val`,F)}function T(e,n,r,l){let{x:u,y:d,w:f,h:p}=r,h=S(n),C=h.length;if(C===0)return;let w=n.title?y(n,p,l):0,T=n.title?p*.045:0,E=n.title?p*.035:0,D=n.title?w+T+E:0,O=g(n,f,p),k=O?.side===`r`?O.reserveW:0,A=O?.side===`l`?O.reserveW:0,j=O?.side===`t`?O.reserveH:0,M=O?.side===`b`?O.reserveH:0,N=b(n.catAxisFontSizeHpt,p,l),P=b(n.valAxisFontSizeHpt,p,l),F=Math.max(N,P),I=n.catAxisTitle?F+4:0,L=n.valAxisTitle?F+4:0,R={t:D+j+P/2+2,r:k+f*.05,b:N+12+I+M,l:P*2.2+10+L+A};x(e,n,u,d+T,f,w);let z=u+R.l,B=d+R.t,V=f-R.l-R.r,H=p-R.t-R.b;if(V<=0||H<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(z,B,V,H));let U=1/0,W=-1/0;for(let e of n.series)for(let t of e.values)t!=null&&(U=Math.min(U,t),W=Math.max(W,t));isFinite(U)||(U=0,W=1),n.valMin==null?U>0&&(U=0):U=n.valMin,n.valMax==null?W<0&&(W=0):W=n.valMax,W===U&&(W=U+1);let G=i(W-U),K=n.valMin??o(U,G),q=n.valMax??a(W,G),J=q-K;if(J===0)return;let Y=e=>B+H-(e-K)/J*H,X=n.catAxisCrossBetween===`midCat`?e=>z+(C===1?V/2:e/(C-1)*V):e=>z+(e+.5)/C*V;if(!n.valAxisHidden){let t=Math.round((q-K)/G);e.font=`${P}px sans-serif`,e.textBaseline=`middle`;for(let r=0;r<=t;r++){let t=K+r*G,i=Y(t);e.strokeStyle=t===0?`#aaa`:`#e0e0e0`,e.lineWidth=t===0?1:.5,e.beginPath(),e.moveTo(z,i),e.lineTo(z+V,i),e.stroke(),v(e,n.valAxisMajorTickMark,`val`,z,i),e.fillStyle=`#555`,e.textAlign=`right`,e.fillText(c(t,n.valAxisFormatCode),z-6,i)}}e.strokeStyle=`#aaa`,e.lineWidth=1,e.beginPath(),e.moveTo(z,B+H),e.lineTo(z+V,B+H),e.stroke(),n.valAxisHidden||(e.beginPath(),e.moveTo(z,B),e.lineTo(z,B+H),e.stroke());let ee=Math.max(1,2.25*l),Z=Math.max(2,2.5*l),Q=b(n.dataLabelFontSizeHpt,p,l);for(let r=0;r<n.series.length;r++){let i=n.series[r],a=t(r,i);e.strokeStyle=a,e.lineWidth=ee,e.setLineDash([]),e.beginPath();let o=!1;for(let t=0;t<C;t++){let n=i.values[t];if(n==null){o=!1;continue}let r=X(t),a=Y(n);o?e.lineTo(r,a):(e.moveTo(r,a),o=!0)}e.stroke(),e.fillStyle=a;let c=i.showMarker!==!1;for(let t=0;t<C;t++){let r=i.values[t];if(r!=null&&(c&&(e.beginPath(),e.arc(X(t),Y(r),Z,0,Math.PI*2),e.fill()),n.showDataLabels)){e.font=`${Q}px sans-serif`,e.fillStyle=`#333`,e.textAlign=`center`,e.textBaseline=`bottom`;let n=c?Z+1:2;e.fillText(s(r),X(t),Y(r)-n),e.fillStyle=a}}}if(!n.catAxisHidden){let t=Math.max(1,Math.ceil(C/8));e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${N}px sans-serif`;for(let r=0;r<C;r+=t){let t=X(r);v(e,n.catAxisMajorTickMark,`cat`,B+H,t),e.fillStyle=`#555`,e.fillText((h[r]??``).toString().slice(0,10),t,B+H+5)}}_(e,n,O,u,d,f,p,z,B,V,H,D+2),n.catAxisTitle&&m(e,n.catAxisTitle,z,B,V,H,`cat`,F),n.valAxisTitle&&m(e,n.valAxisTitle,z,B,V,H,`val`,F)}function E(e,n,o,s){let{x:l,y:u,w:d,h:f}=o,p=S(n),h=p.length;if(h===0)return;let v=n.chartType===`stackedArea`||n.chartType===`stackedAreaPct`,b=n.title?y(n,f,s):0,C=n.title?f*.035:0,w=n.title?f*.035:0,T=n.title?b+C+w:0,E=g(n,d,f),D=E?.side===`r`?E.reserveW:0,O=E?.side===`l`?E.reserveW:0,k=E?.side===`t`?E.reserveH:0,A=E?.side===`b`?E.reserveH:0,j=Math.max(8,Math.min(10,f*.045)),M=n.catAxisTitle?j+4:0,N=n.valAxisTitle?j+4:0,P={t:T+k+f*.02,r:D+d*.05,b:f*.14+M+A,l:d*.12+N+O};x(e,n,l,u+C,d,b);let F=l+P.l,I=u+P.t,L=d-P.l-P.r,R=f-P.t-P.b;if(L<=0||R<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(F,I,L,R));let z=0;for(let e=0;e<h;e++)if(v){let t=0;for(let r of n.series)t+=r.values[e]??0;z=Math.max(z,t)}else for(let t of n.series)z=Math.max(z,t.values[e]??0);n.valMax!=null&&(z=n.valMax),z===0&&(z=1);let B=i(z),V=n.valMax??a(z,B),H=e=>F+(h===1?L/2:e/(h-1)*L),U=e=>I+R-e/V*R;if(!n.valAxisHidden){e.font=`${Math.max(8,Math.min(11,R/20))}px sans-serif`,e.textBaseline=`middle`;let t=Math.round(V/B);for(let r=0;r<=t;r++){let t=r*B,i=U(t);e.strokeStyle=r===0?`#aaa`:`#e0e0e0`,e.lineWidth=r===0?1:.5,e.beginPath(),e.moveTo(F,i),e.lineTo(F+L,i),e.stroke(),e.fillStyle=`#555`,e.textAlign=`right`,e.fillText(c(t,n.valAxisFormatCode),F-4,i)}}e.strokeStyle=`#aaa`,e.lineWidth=1,e.beginPath(),e.moveTo(F,I+R),e.lineTo(F+L,I+R),e.stroke();let W=v?Array(h).fill(0):null;for(let i=n.series.length-1;i>=0;i--){let a=n.series[i],o=t(i,a),s=I+R;if(e.beginPath(),v&&W){for(let t=0;t<h;t++){let n=(a.values[t]??0)+W[t],r=H(t),i=U(n);t===0?e.moveTo(r,i):e.lineTo(r,i)}for(let t=h-1;t>=0;t--)e.lineTo(H(t),U(W[t]));for(let e=0;e<h;e++)W[e]+=a.values[e]??0}else{e.moveTo(H(0),s);for(let t=0;t<h;t++)e.lineTo(H(t),U(a.values[t]??0));e.lineTo(H(h-1),s)}e.closePath(),e.fillStyle=r(o,.6),e.fill(),e.strokeStyle=o,e.lineWidth=1.5,e.setLineDash([]),e.stroke()}if(!n.catAxisHidden){let t=Math.max(1,Math.ceil(h/8));e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${Math.max(8,Math.min(11,L/h*.8))}px sans-serif`;for(let n=0;n<h;n+=t)e.fillText((p[n]??``).toString().slice(0,10),H(n),I+R+3)}_(e,n,E,l,u,d,f,F,I,L,R,T+2),n.catAxisTitle&&m(e,n.catAxisTitle,F,I,L,R,`cat`,j),n.valAxisTitle&&m(e,n.valAxisTitle,F,I,L,R,`val`,j)}function D(t,r,i,a,o){let{x:s,y:c,w:l,h:u}=i,d=r.series[0];if(!d)return;let f=d.categories&&d.categories.length>0?d.categories:r.categories,p=d.values.map(e=>Math.abs(e??0)),m=p.reduce((e,t)=>e+t,0);if(m===0)return;let h=r.title?y(r,u,o):0,g=r.title?u*.035:0,v=r.title?u*.035:0,b=r.title?h+g+v:0;x(t,r,s,c+g,l,h);let S=r.showLegend?(()=>{let e=r.legendPos??`r`,t=e===`l`?`l`:e===`t`?`t`:e===`b`?`b`:`r`;return t===`r`||t===`l`?{side:t,reserveW:Math.max(80,l*.28),reserveH:0}:{side:t,reserveW:0,reserveH:Math.max(18,u*.08)}})():null,C=S?.side===`r`?S.reserveW:0,w=S?.side===`l`?S.reserveW:0,T=S?.side===`t`?S.reserveH:0,E=S?.side===`b`?S.reserveH:0,D=l-C-w,O=u-b-T-E-u*.02,k=s+w+D/2,A=c+b+T+u*.02+O/2,j=Math.min(D,O)*.42,M=a?j*.5:0,N=-Math.PI/2;for(let e=0;e<p.length;e++){let i=p[e]/m*Math.PI*2,o=n(e,d);if(t.beginPath(),t.moveTo(k,A),t.arc(k,A,j,N,N+i),t.closePath(),t.fillStyle=o,t.fill(),t.strokeStyle=`#fff`,t.lineWidth=1,t.stroke(),r.showDataLabels&&i>.15){let n=N+i/2,r=j*(a?.75:.6),o=k+Math.cos(n)*r,s=A+Math.sin(n)*r,c=Math.round(p[e]/m*100);t.font=`bold ${Math.max(8,j*.1)}px sans-serif`,t.fillStyle=`#fff`,t.textAlign=`center`,t.textBaseline=`middle`,t.fillText(`${c}%`,o,s)}N+=i}if(a&&(t.beginPath(),t.arc(k,A,M,0,Math.PI*2),t.fillStyle=`#fff`,t.fill()),S){let n=p.map((t,n)=>({name:(f[n]??`Item ${n+1}`).toString(),color:d.dataPointColors?.[n]??d.color??e[n%e.length],values:[]})),i=k-D/2;_(t,{...r,series:n},S,s,c,l,u,i,A-O/2,D,O,b+2)}}function O(e,n,o,c){let{x:l,y:u,w:d,h:f}=o,p=S(n),m=p.length;if(m<3)return;let h=n.title?y(n,f,c):0,v=n.title?f*.035:0,C=n.title?f*.035:0,w=n.title?h+v+C:0,T=g(n,d,f),E=T?.side===`r`?T.reserveW:0,D=T?.side===`l`?T.reserveW:0,O=T?.side===`t`?T.reserveH:0,k=T?.side===`b`?T.reserveH:0;x(e,n,l,u+v,d,h);let A=d-E-D,j=f-w-O-k-f*.02,M=l+D+A/2,N=u+w+O+f*.02+j/2,P=Math.min(A,j)*.38,F=0;for(let e of n.series)for(let t of e.values)F=Math.max(F,t??0);n.valMax!=null&&(F=n.valMax),F===0&&(F=1);let I=i(F),L=n.valMax??a(F,I),R=-Math.PI/2,z=e=>R+e/m*Math.PI*2,B=Math.round(L/I);e.strokeStyle=`#ddd`,e.lineWidth=.5;for(let t=1;t<=B;t++){let n=t/B*P;e.beginPath();for(let t=0;t<m;t++){let r=z(t),i=M+Math.cos(r)*n,a=N+Math.sin(r)*n;t===0?e.moveTo(i,a):e.lineTo(i,a)}e.closePath(),e.stroke()}e.strokeStyle=`#bbb`,e.lineWidth=.5;for(let t=0;t<m;t++){let n=z(t);e.beginPath(),e.moveTo(M,N),e.lineTo(M+Math.cos(n)*P,N+Math.sin(n)*P),e.stroke()}if(!n.valAxisHidden){e.font=`${b(n.valAxisFontSizeHpt,f,c)}px sans-serif`,e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`;for(let t=1;t<=B;t++){let n=t/B*L,r=t/B*P;e.fillText(s(n),M-3,N-r)}}e.font=`${Math.max(8,Math.min(11,P*.2))}px sans-serif`,e.fillStyle=`#444`,e.textBaseline=`middle`;for(let t=0;t<m;t++){let n=z(t),r=M+Math.cos(n)*(P+12),i=N+Math.sin(n)*(P+12);e.textAlign=Math.cos(n)<-.1?`right`:Math.cos(n)>.1?`left`:`center`,e.fillText((p[t]??``).toString().slice(0,12),r,i)}for(let i=0;i<n.series.length;i++){let a=n.series[i],o=t(i,a);e.beginPath();for(let t=0;t<m;t++){let n=(a.values[t]??0)/L,r=z(t),i=M+Math.cos(r)*P*n,o=N+Math.sin(r)*P*n;t===0?e.moveTo(i,o):e.lineTo(i,o)}e.closePath(),e.fillStyle=r(o,.25),e.fill(),e.strokeStyle=o,e.lineWidth=2,e.stroke()}_(e,n,T,l,u,d,f,M-A/2,N-j/2,A,j,w+2)}function k(e,n,r,a){let{x:o,y:s,w:l,h:u}=r,d=n.title?y(n,u,a):0,f=n.title?u*.035:0,p=n.title?u*.035:0,h=n.title?d+f+p:0,b=g(n,l,u),S=b?.side===`r`?b.reserveW:0,C=b?.side===`l`?b.reserveW:0,w=b?.side===`t`?b.reserveH:0,T=b?.side===`b`?b.reserveH:0,E=Math.max(8,Math.min(10,u*.045)),D=n.catAxisTitle?E+4:0,O=n.valAxisTitle?E+4:0;if(n.title){let t=n.titleManualLayout;t&&(t.x!==void 0||t.y!==void 0)?x(e,n,o+t.x*l,s+t.y*u,(t.w??.5)*l,d):x(e,n,o,s+f,l,d)}let k=n.plotAreaManualLayout,N,F,I,L;if(k&&k.w!=null&&k.h!=null)N=o+k.x*l,F=s+k.y*u,I=k.w*l,L=k.h*u;else{let e={t:h+w+u*.02,r:S+l*.05,b:(n.catAxisHidden?u*.04:u*.12)+D+T,l:(n.valAxisHidden?l*.04:l*.12)+O+C};N=o+e.l,F=s+e.t,I=l-e.l-e.r,L=u-e.t-e.b}if(I<=0||L<=0)return;n.plotAreaBg&&(e.fillStyle=`#${n.plotAreaBg}`,e.fillRect(N,F,I,L));let R=[],z=[];for(let e of n.series){let t=e.categories??[];for(let e of t){let t=parseFloat(e);isNaN(t)||R.push(t)}for(let t of e.values)t!=null&&z.push(t)}let B=R.length===0;if(B){let e=Math.max(...n.series.map(e=>e.values.length));for(let t=0;t<e;t++)R.push(t)}let V=Math.min(...R),H=Math.max(...R),U=Math.min(...z),W=Math.max(...z);if(V===H&&(--V,H+=1),U===W&&(--U,W+=1),n.valMin==null?U>0&&(U=0):U=n.valMin,n.valMax!=null&&(W=n.valMax),n.catAxisMin!=null&&(V=n.catAxisMin),n.catAxisMax!=null&&(H=n.catAxisMax),n.catAxisMin==null||n.catAxisMax==null){let e=i(H-V);e>0&&(n.catAxisMin??(V=Math.floor(V/e)*e),n.catAxisMax??(H=Math.ceil(H/e)*e))}let G=e=>N+(e-V)/(H-V)*I,K=e=>F+L-(e-U)/(W-U)*L;if(!n.valAxisHidden){let t=Math.max(8,Math.min(11,L/20));e.font=`${n.valAxisFontBold?`bold `:``}${t}px sans-serif`;let r=i(W-U),a=Math.round((W-U)/r)+1;for(let t=0;t<a;t++){let i=U+t*r;if(i>W+r*.01)break;let a=K(i);e.strokeStyle=`#e0e0e0`,e.lineWidth=.5,e.beginPath(),e.moveTo(N,a),e.lineTo(N+I,a),e.stroke(),e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(c(i,n.valAxisFormatCode),N-4,a);let o=n.valAxisLineColor?`#${n.valAxisLineColor}`:void 0,s=n.valAxisLineWidthEmu?Math.max(.5,n.valAxisLineWidthEmu/12700):void 0;v(e,n.valAxisMajorTickMark,`val`,N,a,o,s)}}let q=F+L;if(n.catAxisCrossesAt!=null)q=P(K(n.catAxisCrossesAt),F,F+L);else{let e=n.catAxisCrosses??`autoZero`;e===`autoZero`&&U<0&&W>0?q=P(K(0),F,F+L):e===`min`?q=F+L:e===`max`&&(q=F)}if(e.save(),e.strokeStyle=n.catAxisLineColor?`#${n.catAxisLineColor}`:`#888`,e.lineWidth=n.catAxisLineWidthEmu?Math.max(.5,n.catAxisLineWidthEmu/12700):1,e.lineCap=`butt`,e.beginPath(),e.moveTo(N,q),e.lineTo(N+I,q),e.stroke(),e.restore(),n.valAxisHidden||(e.save(),e.strokeStyle=n.valAxisLineColor?`#${n.valAxisLineColor}`:`#888`,e.lineWidth=n.valAxisLineWidthEmu?Math.max(.5,n.valAxisLineWidthEmu/12700):1,e.beginPath(),e.moveTo(N,F),e.lineTo(N,F+L),e.stroke(),e.restore()),!n.catAxisHidden){let t=Math.max(8,Math.min(11,L/20));e.font=`${n.catAxisFontBold?`bold `:``}${t}px sans-serif`;let r=i(H-V),a=Math.round((H-V)/r)+1;e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`;for(let t=0;t<a;t++){let i=V+t*r;if(i>H+r*.01)break;let a=G(i);e.fillText(c(i,n.catAxisFormatCode),a,q+4);let o=n.catAxisLineColor?`#${n.catAxisLineColor}`:void 0,s=n.catAxisLineWidthEmu?Math.max(.5,n.catAxisLineWidthEmu/12700):void 0;v(e,n.catAxisMajorTickMark,`cat`,q,a,o,s)}}for(let r=0;r<n.series.length;r++){let i=n.series[r],o=t(r,i),s=i.categories??[];for(let t of i.errBars??[])j(e,i,t,s,B,G,K,o);if(!(i.showMarker===!1||typeof i.markerSymbol==`string`&&i.markerSymbol===`none`))for(let t=0;t<i.values.length;t++){let n=i.values[t];if(n==null)continue;let r=B?t:parseFloat(s[t]??`0`);if(isNaN(r))continue;let c=(i.dataPointOverrides??[]).find(e=>e.idx===t),l=c?.markerSymbol??i.markerSymbol??`circle`,u=c?.markerSize??i.markerSize??5,d=c?.markerFill??c?.color??i.markerFill??o,f=c?.markerLine??i.markerLine??null;A(e,G(r),K(n),l,u,d,f,a)}M(e,i,s,B,G,K,L,a)}_(e,n,b,o,s,l,u,N,F,I,L,h+2),n.catAxisTitle&&m(e,n.catAxisTitle,N,F,I,L,`cat`,E),n.valAxisTitle&&m(e,n.valAxisTitle,N,F,I,L,`val`,E)}function A(e,t,n,r,i,a,o,s){let c=Math.max(2,i*s),l=c/2;switch(e.save(),e.fillStyle=`#${a}`,o&&(e.strokeStyle=`#${o}`,e.lineWidth=1),r){case`square`:e.fillRect(t-l,n-l,c,c),o&&e.strokeRect(t-l,n-l,c,c);break;case`diamond`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n),e.lineTo(t,n+l),e.lineTo(t-l,n),e.closePath(),e.fill(),o&&e.stroke();break;case`triangle`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n+l),e.lineTo(t-l,n+l),e.closePath(),e.fill(),o&&e.stroke();break;case`x`:e.strokeStyle=`#${a}`,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n-l),e.lineTo(t+l,n+l),e.moveTo(t-l,n+l),e.lineTo(t+l,n-l),e.stroke();break;case`plus`:e.strokeStyle=`#${a}`,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.moveTo(t,n-l),e.lineTo(t,n+l),e.stroke();break;case`star`:e.beginPath();for(let r=0;r<10;r++){let i=r%2==0?l:l*.45,a=-Math.PI/2+r*Math.PI/5,o=t+Math.cos(a)*i,s=n+Math.sin(a)*i;r===0?e.moveTo(o,s):e.lineTo(o,s)}e.closePath(),e.fill(),o&&e.stroke();break;case`dot`:e.beginPath(),e.arc(t,n,Math.max(1,c*.25),0,Math.PI*2),e.fill();break;case`dash`:{let r=Math.max(1,c*.25);e.fillRect(t-l,n-r/2,c,r);break}default:e.beginPath(),e.arc(t,n,l,0,Math.PI*2),e.fill(),o&&e.stroke();break}e.restore()}function j(e,t,n,r,i,a,o,s){e.save(),e.strokeStyle=n.color?`#${n.color}`:s,e.lineWidth=n.lineWidthEmu?Math.max(.5,n.lineWidthEmu/12700):1,e.setLineDash(F(n.dash));let c=n.barType===`plus`||n.barType===`both`,l=n.barType===`minus`||n.barType===`both`,u=n.dir===`x`,d=e.lineWidth*1.5;for(let s=0;s<t.values.length;s++){let f=t.values[s];if(f==null)continue;let p=i?s:parseFloat(r[s]??`0`);if(isNaN(p))continue;let m=a(p),h=o(f),g=t=>{let r=m,i=h;u?r=a(p+t):i=o(f+t),e.beginPath(),e.moveTo(m,h),e.lineTo(r,i),e.stroke(),n.noEndCap||(e.save(),e.setLineDash([]),e.beginPath(),u?(e.moveTo(r,i-d),e.lineTo(r,i+d)):(e.moveTo(r-d,i),e.lineTo(r+d,i)),e.stroke(),e.restore())};if(c){let e=n.plus[s];e!=null&&g(e)}if(l){let e=n.minus[s];e!=null&&g(-e)}}e.restore()}function M(e,t,n,r,i,a,o,s){let l=t.dataLabelOverrides??[];if(l.length===0&&!t.seriesDataLabels)return;let u=t.seriesDataLabels;for(let d=0;d<t.values.length;d++){let f=t.values[d];if(f==null)continue;let p=r?d:parseFloat(n[d]??`0`);if(isNaN(p))continue;let m=l.find(e=>e.idx===d),h;if(m){if(m.text===``)continue;h=m.text}else if(u&&(u.showVal||u.showSerName||u.showCatName)){let e=[];if(u.showCatName&&!r&&e.push(n[d]??``),u.showSerName&&e.push(t.name),u.showVal&&e.push(c(f,u.formatCode??null)),h=e.filter(Boolean).join(` `),!h)continue}else continue;let g=m?.position??u?.position??`r`,_=m?.fontSizeHpt??u?.fontSizeHpt,v=_?_/100*s:Math.max(9,Math.min(11,o/25)),y=m?.fontColor??u?.fontColor,b=m?.fontBold??u?.fontBold??!1;N(e,i(p),a(f),h,g,v,y,b)}}function N(e,t,n,r,i,a,o,s){e.save(),e.font=`${s?`bold `:``}${a}px sans-serif`,e.fillStyle=o?`#${o}`:`#333`;let c=a*.6,l=t,u=n;switch(i){case`l`:e.textAlign=`right`,e.textBaseline=`middle`,l=t-c;break;case`r`:e.textAlign=`left`,e.textBaseline=`middle`,l=t+c;break;case`t`:e.textAlign=`center`,e.textBaseline=`bottom`,u=n-c;break;case`b`:e.textAlign=`center`,e.textBaseline=`top`,u=n+c;break;case`ctr`:e.textAlign=`center`,e.textBaseline=`middle`;break;default:e.textAlign=`left`,e.textBaseline=`middle`,l=t+c;break}let d=r.split(/\r?\n/),f=a*1.15,p=f*d.length,m=u;e.textBaseline===`middle`?m=u-(p-f)/2:e.textBaseline===`bottom`&&(m=u-(p-f));for(let t of d)e.fillText(t,l,m),m+=f;e.restore()}function P(e,t,n){return e<t?t:e>n?n:e}function F(e){if(!e)return[];switch(e){case`solid`:return[];case`dot`:case`sysDot`:return[1,2];case`dash`:case`sysDash`:return[4,2];case`lgDash`:return[8,3];case`dashDot`:case`sysDashDot`:return[4,2,1,2];case`lgDashDot`:return[8,3,1,3];case`dashDotDot`:case`sysDashDotDot`:case`lgDashDotDot`:return[4,2,1,2,1,2];default:return[]}}function I(e,t,n){let{x:r,y:a,w:o,h:s}=n,c=o*.11,l=o*.04,u=s*.08,d=s*.18,f=r+c,p=a+u,m=o-c-l,h=s-u-d,g=t.series[0]?.values??[],_=t.categories,v=_.length;if(v===0)return;let y=new Set(t.subtotalIndices),b=0,x=[];for(let e=0;e<v;e++){let t=g[e]??0;if(e===0||y.has(e))x.push({start:0,end:t,isSub:!0,isPos:!0}),b=t;else{let e=t>=0?b:b+t,n=t>=0?b+t:b;x.push({start:e,end:n,isSub:!1,isPos:t>=0}),b+=t}}let S=x.map(e=>e.end),C=x.map(e=>e.start),w=Math.max(...S,...C),T=Math.min(...C,0),E=w-T;if(E<=0)return;let D=E*1.1,O=T-E*.05,k=O+D,A=i(D);e.save();let j=Math.round(s*.042);e.font=`${j}px sans-serif`,e.strokeStyle=`#e8e8e8`,e.lineWidth=.7,e.fillStyle=`#666`,e.textAlign=`right`,e.textBaseline=`middle`;for(let t=Math.ceil(O/A)*A;t<=k;t+=A){let n=p+h*(1-(t-O)/D);e.beginPath(),e.moveTo(f,n),e.lineTo(f+m,n),e.stroke(),e.fillText(t.toLocaleString(),f-4,n)}e.strokeStyle=`#bbb`,e.lineWidth=1,e.beginPath(),e.moveTo(f,p),e.lineTo(f,p+h),e.lineTo(f+m,p+h),e.stroke();let M=m/v*.55,N=m/v;x.forEach((t,n)=>{let r=f+N*n+(N-M)/2,i=p+h*(1-(t.end-O)/D),a=p+h*(1-(t.start-O)/D),o=Math.max(1,a-i);if(t.isSub?(e.fillStyle=`#196ECA`,e.fillRect(r,i,M,o)):(e.strokeStyle=t.isPos?`#5BA4E6`:`#E46970`,e.lineWidth=1.5,e.strokeRect(r+.75,i+.75,M-1.5,o-1.5)),n<v-1){let o=f+N*(n+1)+(N-M)/2,s=t.isPos?i:a;e.strokeStyle=`#ccc`,e.lineWidth=.8,e.setLineDash([3,3]),e.beginPath(),e.moveTo(r+M,s),e.lineTo(o,s),e.stroke(),e.setLineDash([])}let c=g[n]??0,l=c<0?`△ ${Math.abs(c).toLocaleString()}`:c.toLocaleString();e.fillStyle=`#595959`,e.font=`bold ${Math.round(s*.044)}px sans-serif`,e.textAlign=`center`,e.textBaseline=`bottom`,e.fillText(l,r+M/2,i-3)}),e.textAlign=`center`,e.textBaseline=`top`,e.fillStyle=`#666`,e.font=`${Math.round(s*.038)}px sans-serif`;let P=p+h+4;for(let t=0;t<v;t++){let n=f+N*t+N/2;_[t].split(/\s+/).forEach((t,r)=>e.fillText(t,n,P+r*(j+2)))}e.restore()}function L(e,t,n,r=1.333){let{x:i,y:a,w:o,h:s}=n;if(t.chartBg&&(e.fillStyle=`#${t.chartBg}`,e.fillRect(i,a,o,s)),t.series.length===0){e.fillStyle=`#888`,e.font=`12px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`(no data)`,i+o/2,a+s/2);return}switch(t.chartType){case`clusteredBar`:case`clusteredBarH`:case`stackedBar`:case`stackedBarH`:case`stackedBarPct`:case`stackedBarHPct`:w(e,t,n,r);break;case`line`:case`stackedLine`:case`stackedLinePct`:T(e,t,n,r);break;case`area`:case`stackedArea`:case`stackedAreaPct`:E(e,t,n,r);break;case`pie`:D(e,t,n,!1,r);break;case`doughnut`:D(e,t,n,!0,r);break;case`radar`:O(e,t,n,r);break;case`scatter`:case`bubble`:k(e,t,n,r);break;case`waterfall`:I(e,t,n);break;default:e.fillStyle=`#888`,e.font=`11px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`Chart: ${t.chartType}`,i+o/2,a+s/2)}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return L}});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -150,6 +150,9 @@ declare interface CellXf {
|
|
|
150
150
|
/** Text rotation: 1–90 = counter-clockwise °, 91–180 = (val−90)° clockwise, 255 = stacked */
|
|
151
151
|
textRotation?: number;
|
|
152
152
|
shrinkToFit?: boolean;
|
|
153
|
+
/** `<alignment readingOrder>` (ECMA-376 §18.8.1) — 0 = context (default),
|
|
154
|
+
* 1 = LTR, 2 = RTL. Drives canvas `direction`. */
|
|
155
|
+
readingOrder?: number;
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
declare interface CfIcon {
|
|
@@ -293,6 +296,31 @@ declare interface ChartData {
|
|
|
293
296
|
/** `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
|
|
294
297
|
* number format (§21.2.2.35). */
|
|
295
298
|
dataLabelFormatCode?: string | null;
|
|
299
|
+
/** `<c:title>...defRPr@b>` chart title bold flag. */
|
|
300
|
+
titleFontBold?: boolean;
|
|
301
|
+
/** `<c:catAx><c:txPr>...defRPr@b>` X-axis tick label bold flag. */
|
|
302
|
+
catAxisFontBold?: boolean;
|
|
303
|
+
/** `<c:valAx><c:txPr>...defRPr@b>` Y-axis tick label bold flag. */
|
|
304
|
+
valAxisFontBold?: boolean;
|
|
305
|
+
/** `<c:catAx><c:crosses val>` (`autoZero` | `min` | `max`). Drives where
|
|
306
|
+
* the X axis sits along the Y axis. Default `autoZero`. */
|
|
307
|
+
catAxisCrosses?: string;
|
|
308
|
+
/** `<c:catAx><c:crossesAt val>` explicit numeric crossing. */
|
|
309
|
+
catAxisCrossesAt?: number;
|
|
310
|
+
valAxisCrosses?: string;
|
|
311
|
+
valAxisCrossesAt?: number;
|
|
312
|
+
/** Axis line color (hex without `#`) and width in EMU, from
|
|
313
|
+
* `<c:catAx|valAx><c:spPr><a:ln>`. */
|
|
314
|
+
catAxisLineColor?: string;
|
|
315
|
+
catAxisLineWidthEmu?: number;
|
|
316
|
+
valAxisLineColor?: string;
|
|
317
|
+
valAxisLineWidthEmu?: number;
|
|
318
|
+
/** `<c:catAx | valAx><c:majorTickMark val>` / `<c:minorTickMark val>` —
|
|
319
|
+
* one of `none`/`out`/`in`/`cross` (ECMA-376 §21.2.2.49). */
|
|
320
|
+
catAxisMajorTickMark?: string;
|
|
321
|
+
catAxisMinorTickMark?: string;
|
|
322
|
+
valAxisMajorTickMark?: string;
|
|
323
|
+
valAxisMinorTickMark?: string;
|
|
296
324
|
/** `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). */
|
|
297
325
|
catAxisFormatCode?: string;
|
|
298
326
|
/** `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. */
|
|
@@ -316,6 +344,8 @@ declare interface ChartDataLabelOverride {
|
|
|
316
344
|
position?: string;
|
|
317
345
|
fontColor?: string;
|
|
318
346
|
fontSizeHpt?: number;
|
|
347
|
+
/** `<a:defRPr b="1">` inside the per-idx rich text. */
|
|
348
|
+
fontBold?: boolean;
|
|
319
349
|
}
|
|
320
350
|
|
|
321
351
|
declare interface ChartDataPointOverride {
|
|
@@ -474,6 +504,10 @@ declare interface ChartSeriesDataLabels {
|
|
|
474
504
|
position?: string;
|
|
475
505
|
fontColor?: string;
|
|
476
506
|
formatCode?: string;
|
|
507
|
+
/** Series-level bold default for data labels. */
|
|
508
|
+
fontBold?: boolean;
|
|
509
|
+
/** Series-level font size for data labels (OOXML hundredths of a point). */
|
|
510
|
+
fontSizeHpt?: number;
|
|
477
511
|
}
|
|
478
512
|
|
|
479
513
|
declare interface ConditionalFormat {
|
|
@@ -488,6 +522,7 @@ declare interface DataLabelOverride {
|
|
|
488
522
|
position?: string;
|
|
489
523
|
fontColor?: string;
|
|
490
524
|
fontSizeHpt?: number;
|
|
525
|
+
fontBold?: boolean;
|
|
491
526
|
}
|
|
492
527
|
|
|
493
528
|
declare interface DataPointOverride {
|
|
@@ -877,6 +912,22 @@ declare interface LoadOptions {
|
|
|
877
912
|
useGoogleFonts?: boolean;
|
|
878
913
|
}
|
|
879
914
|
|
|
915
|
+
/** Options for {@link XlsxWorkbook.load}. */
|
|
916
|
+
declare interface LoadOptions_2 {
|
|
917
|
+
/**
|
|
918
|
+
* Opt in to loading Office-font metric substitutes (Carlito for Calibri,
|
|
919
|
+
* Caladea for Cambria) from Google Fonts (`fonts.googleapis.com`). Without
|
|
920
|
+
* these the canvas falls back to system Arial / Helvetica which is
|
|
921
|
+
* noticeably wider per character, so column layouts diverge from Excel.
|
|
922
|
+
*
|
|
923
|
+
* When enabled, end-user IP / User-Agent is sent to Google, which may have
|
|
924
|
+
* privacy / GDPR implications for your application. Default `false` — host
|
|
925
|
+
* the substitute webfonts yourself and reference them via `@font-face` in
|
|
926
|
+
* your application CSS to avoid the third-party request.
|
|
927
|
+
*/
|
|
928
|
+
useGoogleFonts?: boolean;
|
|
929
|
+
}
|
|
930
|
+
|
|
880
931
|
declare interface ManualLayout {
|
|
881
932
|
xMode: string;
|
|
882
933
|
yMode: string;
|
|
@@ -1386,6 +1437,8 @@ declare interface SeriesDataLabels {
|
|
|
1386
1437
|
position?: string;
|
|
1387
1438
|
fontColor?: string;
|
|
1388
1439
|
formatCode?: string;
|
|
1440
|
+
fontBold?: boolean;
|
|
1441
|
+
fontSizeHpt?: number;
|
|
1389
1442
|
}
|
|
1390
1443
|
|
|
1391
1444
|
declare interface Shadow {
|
|
@@ -2010,6 +2063,14 @@ declare interface XlsxViewerOptions {
|
|
|
2010
2063
|
onError?: (err: Error) => void;
|
|
2011
2064
|
/** Called when the selected cell range changes. null means no selection. */
|
|
2012
2065
|
onSelectionChange?: (selection: CellRange_2 | null) => void;
|
|
2066
|
+
/**
|
|
2067
|
+
* Opt in to Google-Fonts-hosted, metric-compatible substitutes for the
|
|
2068
|
+
* Office default fonts (Carlito for Calibri, Caladea for Cambria) so
|
|
2069
|
+
* column layouts match Excel on systems without Office installed.
|
|
2070
|
+
* Default `false`. See `XlsxWorkbook.LoadOptions.useGoogleFonts` for the
|
|
2071
|
+
* privacy implications.
|
|
2072
|
+
*/
|
|
2073
|
+
useGoogleFonts?: boolean;
|
|
2013
2074
|
}
|
|
2014
2075
|
|
|
2015
2076
|
declare class XlsxWorkbook {
|
|
@@ -2020,7 +2081,7 @@ declare class XlsxWorkbook {
|
|
|
2020
2081
|
private imageCache;
|
|
2021
2082
|
private rawData;
|
|
2022
2083
|
constructor();
|
|
2023
|
-
load(source: string | ArrayBuffer): Promise<void>;
|
|
2084
|
+
load(source: string | ArrayBuffer, opts?: LoadOptions_2): Promise<void>;
|
|
2024
2085
|
get sheetNames(): string[];
|
|
2025
2086
|
get sheetCount(): number;
|
|
2026
2087
|
getWorksheet(sheetIndex: number): Promise<Worksheet>;
|
package/dist/types/pptx.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ declare interface ChartDataLabelOverride {
|
|
|
56
56
|
position?: string;
|
|
57
57
|
fontColor?: string;
|
|
58
58
|
fontSizeHpt?: number;
|
|
59
|
+
/** `<a:defRPr b="1">` inside the per-idx rich text. */
|
|
60
|
+
fontBold?: boolean;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
declare interface ChartDataPointOverride {
|
|
@@ -214,6 +216,10 @@ declare interface ChartSeriesDataLabels {
|
|
|
214
216
|
position?: string;
|
|
215
217
|
fontColor?: string;
|
|
216
218
|
formatCode?: string;
|
|
219
|
+
/** Series-level bold default for data labels. */
|
|
220
|
+
fontBold?: boolean;
|
|
221
|
+
/** Series-level font size for data labels (OOXML hundredths of a point). */
|
|
222
|
+
fontSizeHpt?: number;
|
|
217
223
|
}
|
|
218
224
|
|
|
219
225
|
export declare type Fill = SolidFill | NoFill | GradientFill;
|
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -104,6 +104,9 @@ export declare interface CellXf {
|
|
|
104
104
|
/** Text rotation: 1–90 = counter-clockwise °, 91–180 = (val−90)° clockwise, 255 = stacked */
|
|
105
105
|
textRotation?: number;
|
|
106
106
|
shrinkToFit?: boolean;
|
|
107
|
+
/** `<alignment readingOrder>` (ECMA-376 §18.8.1) — 0 = context (default),
|
|
108
|
+
* 1 = LTR, 2 = RTL. Drives canvas `direction`. */
|
|
109
|
+
readingOrder?: number;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
declare interface CfIcon {
|
|
@@ -247,6 +250,31 @@ declare interface ChartData {
|
|
|
247
250
|
/** `<c:dLbls><c:numFmt@formatCode>` — chart-level override for data label
|
|
248
251
|
* number format (§21.2.2.35). */
|
|
249
252
|
dataLabelFormatCode?: string | null;
|
|
253
|
+
/** `<c:title>...defRPr@b>` chart title bold flag. */
|
|
254
|
+
titleFontBold?: boolean;
|
|
255
|
+
/** `<c:catAx><c:txPr>...defRPr@b>` X-axis tick label bold flag. */
|
|
256
|
+
catAxisFontBold?: boolean;
|
|
257
|
+
/** `<c:valAx><c:txPr>...defRPr@b>` Y-axis tick label bold flag. */
|
|
258
|
+
valAxisFontBold?: boolean;
|
|
259
|
+
/** `<c:catAx><c:crosses val>` (`autoZero` | `min` | `max`). Drives where
|
|
260
|
+
* the X axis sits along the Y axis. Default `autoZero`. */
|
|
261
|
+
catAxisCrosses?: string;
|
|
262
|
+
/** `<c:catAx><c:crossesAt val>` explicit numeric crossing. */
|
|
263
|
+
catAxisCrossesAt?: number;
|
|
264
|
+
valAxisCrosses?: string;
|
|
265
|
+
valAxisCrossesAt?: number;
|
|
266
|
+
/** Axis line color (hex without `#`) and width in EMU, from
|
|
267
|
+
* `<c:catAx|valAx><c:spPr><a:ln>`. */
|
|
268
|
+
catAxisLineColor?: string;
|
|
269
|
+
catAxisLineWidthEmu?: number;
|
|
270
|
+
valAxisLineColor?: string;
|
|
271
|
+
valAxisLineWidthEmu?: number;
|
|
272
|
+
/** `<c:catAx | valAx><c:majorTickMark val>` / `<c:minorTickMark val>` —
|
|
273
|
+
* one of `none`/`out`/`in`/`cross` (ECMA-376 §21.2.2.49). */
|
|
274
|
+
catAxisMajorTickMark?: string;
|
|
275
|
+
catAxisMinorTickMark?: string;
|
|
276
|
+
valAxisMajorTickMark?: string;
|
|
277
|
+
valAxisMinorTickMark?: string;
|
|
250
278
|
/** `<c:catAx><c:numFmt@formatCode>` (or scatter X-axis valAx). */
|
|
251
279
|
catAxisFormatCode?: string;
|
|
252
280
|
/** `<c:catAx><c:scaling><c:min/max>` — explicit X-axis range. */
|
|
@@ -274,6 +302,7 @@ declare interface DataLabelOverride {
|
|
|
274
302
|
position?: string;
|
|
275
303
|
fontColor?: string;
|
|
276
304
|
fontSizeHpt?: number;
|
|
305
|
+
fontBold?: boolean;
|
|
277
306
|
}
|
|
278
307
|
|
|
279
308
|
declare interface DataPointOverride {
|
|
@@ -381,6 +410,22 @@ declare interface LegendManualLayout {
|
|
|
381
410
|
h: number;
|
|
382
411
|
}
|
|
383
412
|
|
|
413
|
+
/** Options for {@link XlsxWorkbook.load}. */
|
|
414
|
+
declare interface LoadOptions {
|
|
415
|
+
/**
|
|
416
|
+
* Opt in to loading Office-font metric substitutes (Carlito for Calibri,
|
|
417
|
+
* Caladea for Cambria) from Google Fonts (`fonts.googleapis.com`). Without
|
|
418
|
+
* these the canvas falls back to system Arial / Helvetica which is
|
|
419
|
+
* noticeably wider per character, so column layouts diverge from Excel.
|
|
420
|
+
*
|
|
421
|
+
* When enabled, end-user IP / User-Agent is sent to Google, which may have
|
|
422
|
+
* privacy / GDPR implications for your application. Default `false` — host
|
|
423
|
+
* the substitute webfonts yourself and reference them via `@font-face` in
|
|
424
|
+
* your application CSS to avoid the third-party request.
|
|
425
|
+
*/
|
|
426
|
+
useGoogleFonts?: boolean;
|
|
427
|
+
}
|
|
428
|
+
|
|
384
429
|
declare interface ManualLayout {
|
|
385
430
|
xMode: string;
|
|
386
431
|
yMode: string;
|
|
@@ -500,6 +545,8 @@ declare interface SeriesDataLabels {
|
|
|
500
545
|
position?: string;
|
|
501
546
|
fontColor?: string;
|
|
502
547
|
formatCode?: string;
|
|
548
|
+
fontBold?: boolean;
|
|
549
|
+
fontSizeHpt?: number;
|
|
503
550
|
}
|
|
504
551
|
|
|
505
552
|
declare interface ShapeAnchor {
|
|
@@ -818,6 +865,14 @@ export declare interface XlsxViewerOptions {
|
|
|
818
865
|
onError?: (err: Error) => void;
|
|
819
866
|
/** Called when the selected cell range changes. null means no selection. */
|
|
820
867
|
onSelectionChange?: (selection: CellRange | null) => void;
|
|
868
|
+
/**
|
|
869
|
+
* Opt in to Google-Fonts-hosted, metric-compatible substitutes for the
|
|
870
|
+
* Office default fonts (Carlito for Calibri, Caladea for Cambria) so
|
|
871
|
+
* column layouts match Excel on systems without Office installed.
|
|
872
|
+
* Default `false`. See `XlsxWorkbook.LoadOptions.useGoogleFonts` for the
|
|
873
|
+
* privacy implications.
|
|
874
|
+
*/
|
|
875
|
+
useGoogleFonts?: boolean;
|
|
821
876
|
}
|
|
822
877
|
|
|
823
878
|
export declare class XlsxWorkbook {
|
|
@@ -828,7 +883,7 @@ export declare class XlsxWorkbook {
|
|
|
828
883
|
private imageCache;
|
|
829
884
|
private rawData;
|
|
830
885
|
constructor();
|
|
831
|
-
load(source: string | ArrayBuffer): Promise<void>;
|
|
886
|
+
load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<void>;
|
|
832
887
|
get sheetNames(): string[];
|
|
833
888
|
get sheetCount(): number;
|
|
834
889
|
getWorksheet(sheetIndex: number): Promise<Worksheet>;
|