ooxml-core 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PptxHandler-X6AO6LKJ.mjs → PptxHandler-2V4PQL6O.mjs} +2 -2
- package/dist/{PptxHandler-4AHDZDA5.cjs → PptxHandler-6TNIQ7S5.cjs} +2 -2
- package/dist/{PptxHandler-5X4VOWAO.mjs → PptxHandler-HSPKEP5E.mjs} +1 -1
- package/dist/{PresentationBuilder-UY3S4YE2.mjs → PresentationBuilder-G7MPEGXJ.mjs} +1 -1
- package/dist/{PresentationBuilder-LRX55PXA.mjs → PresentationBuilder-HQ6C7L4V.mjs} +2 -2
- package/dist/{PresentationBuilder-MJB4LIFS.cjs → PresentationBuilder-RM52LCVN.cjs} +4 -4
- package/dist/automation/index.cjs +535 -266
- package/dist/automation/index.mjs +535 -266
- package/dist/automation/node.cjs +2 -1
- package/dist/automation/node.d.ts.map +1 -1
- package/dist/automation/node.mjs +2 -1
- package/dist/chart/axis-range-auto.d.ts +10 -0
- package/dist/chart/axis-range-auto.d.ts.map +1 -0
- package/dist/chart/axis-range-types.d.ts +27 -0
- package/dist/chart/axis-range-types.d.ts.map +1 -0
- package/dist/chart/axis-range.d.ts +37 -0
- package/dist/chart/axis-range.d.ts.map +1 -0
- package/dist/chart/axis-ticks.d.ts +8 -0
- package/dist/chart/axis-ticks.d.ts.map +1 -0
- package/dist/chart/index.cjs +815 -165
- package/dist/chart/index.d.ts +6 -0
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.mjs +795 -166
- package/dist/chart/line-dash.d.ts +2 -0
- package/dist/chart/line-dash.d.ts.map +1 -0
- package/dist/chart/marker-shape.d.ts +70 -0
- package/dist/chart/marker-shape.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-axes.d.ts +9 -0
- package/dist/chart/render/chart-svg-axes.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-cartesian.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-markers.d.ts +6 -0
- package/dist/chart/render/chart-svg-markers.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-radial.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-xy.d.ts.map +1 -1
- package/dist/chart/render/chart-view-axes.d.ts +30 -0
- package/dist/chart/render/chart-view-axes.d.ts.map +1 -0
- package/dist/chart/render/chart-view-markers.d.ts +27 -0
- package/dist/chart/render/chart-view-markers.d.ts.map +1 -0
- package/dist/chart/render/chart-view-series.d.ts.map +1 -1
- package/dist/chart/render/chart-view.d.ts +4 -1
- package/dist/chart/render/chart-view.d.ts.map +1 -1
- package/dist/chart/render/index.d.ts +2 -0
- package/dist/chart/render/index.d.ts.map +1 -1
- package/dist/chart/render/summary-from-space.d.ts.map +1 -1
- package/dist/chart/render/summary.d.ts +6 -1
- package/dist/chart/render/summary.d.ts.map +1 -1
- package/dist/{chunk-D4GBMBG6.mjs → chunk-365VXA3X.mjs} +1 -1
- package/dist/{chunk-7NWQUCGX.mjs → chunk-4FTUAD2B.mjs} +20 -5
- package/dist/{chunk-PLWRGPRH.mjs → chunk-4YDPRQRH.mjs} +145 -96
- package/dist/{chunk-QXDWDDLN.mjs → chunk-6UV3JVB3.mjs} +1 -1
- package/dist/{chunk-3ATTMOYZ.mjs → chunk-7FPQ7LGN.mjs} +1 -1
- package/dist/{chunk-7WCCQKV2.mjs → chunk-7I7CMDUZ.mjs} +1 -1
- package/dist/{chunk-KZ6UTEES.mjs → chunk-E6WNB3JX.mjs} +1 -1
- package/dist/{chunk-SPG7WICG.mjs → chunk-EDRS3OSM.mjs} +1 -1
- package/dist/{chunk-VXLBSKZ6.mjs → chunk-GKLDCQLY.mjs} +1 -1
- package/dist/{chunk-ITQNJLJW.mjs → chunk-ILG6NKXV.mjs} +1 -1
- package/dist/{chunk-OXZUJR7O.mjs → chunk-J3PD5JWS.mjs} +1 -1
- package/dist/{chunk-I5ZE3VLI.mjs → chunk-JUABSM7C.mjs} +1 -1
- package/dist/{chunk-5GBNB7VU.mjs → chunk-LMDNFNZJ.mjs} +1 -1
- package/dist/{chunk-LT7RCEHY.mjs → chunk-M6GDBVQ7.mjs} +1 -1
- package/dist/{chunk-4SMQRUUE.mjs → chunk-MZP6H7QY.mjs} +1 -1
- package/dist/{chunk-KCALUCYU.mjs → chunk-NIGOXRUP.mjs} +1 -1
- package/dist/{chunk-VB7NKWZH.mjs → chunk-P37EWZBC.mjs} +1 -1
- package/dist/{chunk-VD3XNFJH.mjs → chunk-PIOG7ZFF.mjs} +1 -1
- package/dist/{chunk-R4BCOQHB.cjs → chunk-R5FIHHGB.cjs} +33 -13
- package/dist/{chunk-4EUHK4OA.mjs → chunk-RRQFRNPQ.mjs} +1 -1
- package/dist/{chunk-AXDQEOYK.mjs → chunk-S3E6XBOU.mjs} +1 -1
- package/dist/{chunk-U7IDT6VT.mjs → chunk-SLNQNVQM.mjs} +1 -1
- package/dist/{chunk-Z5Y53IZD.mjs → chunk-TJPUAUWL.mjs} +4 -4
- package/dist/{chunk-53GW7NSV.mjs → chunk-UFZZESXL.mjs} +1 -1
- package/dist/{chunk-4JGKTRLH.mjs → chunk-X45XTEMI.mjs} +1 -1
- package/dist/{chunk-DUSAQQTU.mjs → chunk-YIXIC3TR.mjs} +1 -1
- package/dist/{chunk-YSKKMXDL.mjs → chunk-ZDD2RZGB.mjs} +1 -1
- package/dist/{chunk-C363NN2C.mjs → chunk-ZJ2OKIJN.mjs} +33 -13
- package/dist/docx/index.cjs +695 -168
- package/dist/docx/index.mjs +695 -168
- package/dist/docx/layout/index.cjs +697 -170
- package/dist/docx/layout/index.mjs +697 -170
- package/dist/docx/ui/index.cjs +704 -177
- package/dist/docx/ui/index.mjs +704 -177
- package/dist/index.cjs +912 -262
- package/dist/index.mjs +912 -262
- package/dist/pptx/automation/index.cjs +89 -14
- package/dist/pptx/automation/index.d.ts +2 -2
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/automation/schemas/chart-formatting-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-formatting-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/chart-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/chart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/chart-user-shape-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/element-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/element-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/element-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/element-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/export-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/export-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/export-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/export-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/geometry-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/geometry-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/hyperlink-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/hyperlink-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/index.cjs +145 -96
- package/dist/pptx/automation/schemas/index.mjs +21 -21
- package/dist/pptx/automation/schemas/json-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/json-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/json-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/json-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/layout-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/layout-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/layout-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/lock-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/lock-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/lock-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/metadata-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/metadata-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/ole-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/ole-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/ole-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/presentation-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/section-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/section-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/section-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/section-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/slide-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/slide-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/slide-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/smartart-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/smartart-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/table-style-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/table-style-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/template-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/template-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/template-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/template-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/theme-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/theme-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/theme-schemas.mjs +2 -2
- package/dist/pptx/automation/schemas/validation-schemas.cjs +145 -96
- package/dist/pptx/automation/schemas/validation-schemas.d.ts +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/validation-schemas.mjs +2 -2
- package/dist/pptx/chunks/{index-CiyTR6mm.d.ts → index-B9x557hr.d.ts} +3 -2
- package/dist/pptx/chunks/{index-CiyTR6mm.d.ts.map → index-B9x557hr.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-BWHNCVNC.d.ts → index-Bqm-jFG-.d.ts} +3 -4
- package/dist/pptx/chunks/{index-BWHNCVNC.d.ts.map → index-Bqm-jFG-.d.ts.map} +1 -1
- package/dist/pptx/chunks/schemas-CWr181Wx.d.ts +2186 -0
- package/dist/pptx/chunks/schemas-CWr181Wx.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +89 -14
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/loader/table-style-image-paths.d.ts +1 -0
- package/dist/pptx/editor/render/collaboration-text-native-edit.d.ts +1 -0
- package/dist/pptx/editor/render/collaboration-text-session-paragraph.d.ts +1 -0
- package/dist/pptx/editor/render/collaboration-text-snapshot-positions.d.ts.map +1 -1
- package/dist/pptx/editor/render/find-replace.d.ts +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +1 -1
- package/dist/pptx/editor/render/slide-operations.mjs +1 -1
- package/dist/pptx/index.cjs +84 -6
- package/dist/pptx/index.d.ts +2 -2
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/ui/index.d.ts +1 -0
- package/dist/teams/index.cjs +71 -5
- package/dist/teams/index.mjs +71 -5
- package/dist/visio/index.cjs +483 -214
- package/dist/visio/index.mjs +483 -214
- package/dist/visio/ui/index.cjs +504 -235
- package/dist/visio/ui/index.mjs +504 -235
- package/dist/xlsx/edit/chart-colors.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +818 -281
- package/dist/xlsx/index.mjs +818 -281
- package/dist/xlsx/load/index.cjs +58 -5
- package/dist/xlsx/load/index.mjs +58 -5
- package/dist/xlsx/read/chart.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +835 -298
- package/dist/xlsx/ui/index.mjs +835 -298
- package/package.json +9 -9
- package/dist/pptx/chunks/external-DQ3B4V-o.d.ts +0 -4275
- package/dist/pptx/chunks/external-DQ3B4V-o.d.ts.map +0 -1
package/dist/xlsx/ui/index.mjs
CHANGED
|
@@ -278,8 +278,8 @@ function createWorksheet(name, sheetId) {
|
|
|
278
278
|
preserved: /* @__PURE__ */ new Map()
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
function createWorkbook(
|
|
282
|
-
const names =
|
|
281
|
+
function createWorkbook(options7 = {}) {
|
|
282
|
+
const names = options7.sheets?.length ? options7.sheets : ["Sheet1"];
|
|
283
283
|
return {
|
|
284
284
|
sheets: names.map((name, index3) => createWorksheet(name, index3 + 1)),
|
|
285
285
|
styles: [defaultCellStyle()],
|
|
@@ -1680,15 +1680,15 @@ function renderAbs(v, section, generalWidth) {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
return { text: text4, zero: general === "0" };
|
|
1682
1682
|
}
|
|
1683
|
-
function hashFill(
|
|
1684
|
-
const width =
|
|
1685
|
-
const one2 =
|
|
1683
|
+
function hashFill(options7) {
|
|
1684
|
+
const width = options7.width ?? 0;
|
|
1685
|
+
const one2 = options7.measure ? options7.measure("#") : 1;
|
|
1686
1686
|
return "#".repeat(Math.max(1, Math.floor(one2 > 0 ? width / one2 : width)));
|
|
1687
1687
|
}
|
|
1688
|
-
function fitNumber(value3, format,
|
|
1689
|
-
const date1904 =
|
|
1690
|
-
const width =
|
|
1691
|
-
const fits = (text4) => (
|
|
1688
|
+
function fitNumber(value3, format, options7) {
|
|
1689
|
+
const date1904 = options7.date1904 ?? false;
|
|
1690
|
+
const width = options7.width ?? 0;
|
|
1691
|
+
const fits = (text4) => (options7.measure ? options7.measure(text4) : text4.length) <= width;
|
|
1692
1692
|
const first2 = formatNumber(value3, format, date1904);
|
|
1693
1693
|
if (fits(first2.text) || first2.text === OVERFLOW_TEXT) return first2;
|
|
1694
1694
|
const choice = chooseSection(compileFormat(format), value3);
|
|
@@ -1699,7 +1699,7 @@ function fitNumber(value3, format, options6) {
|
|
|
1699
1699
|
if (fits(next.text)) return next;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
const fill = hashFill(
|
|
1702
|
+
const fill = hashFill(options7);
|
|
1703
1703
|
return first2.color ? { text: fill, color: first2.color } : { text: fill };
|
|
1704
1704
|
}
|
|
1705
1705
|
function formatNumber(value3, format, date1904, generalWidth) {
|
|
@@ -1721,13 +1721,13 @@ function formatNumber(value3, format, date1904, generalWidth) {
|
|
|
1721
1721
|
const minus = value3 < 0 && !abs2 && !zero;
|
|
1722
1722
|
return result(minus ? `-${text4}` : text4, section);
|
|
1723
1723
|
}
|
|
1724
|
-
function formatValue(value3, format,
|
|
1724
|
+
function formatValue(value3, format, options7 = {}) {
|
|
1725
1725
|
if (value3 === null) return { text: "" };
|
|
1726
1726
|
if (typeof value3 === "boolean") return { text: value3 ? "TRUE" : "FALSE" };
|
|
1727
1727
|
if (typeof value3 === "string") return formatText(value3, compileFormat(format).text);
|
|
1728
1728
|
if (isCellError(value3)) return { text: value3.error };
|
|
1729
|
-
if (
|
|
1730
|
-
return formatNumber(value3, format,
|
|
1729
|
+
if (options7.width !== void 0) return fitNumber(value3, format, options7);
|
|
1730
|
+
return formatNumber(value3, format, options7.date1904 ?? false);
|
|
1731
1731
|
}
|
|
1732
1732
|
function isDateFormat(format) {
|
|
1733
1733
|
return compileFormat(format).isDate;
|
|
@@ -1938,7 +1938,7 @@ function parseFractionInput(text4) {
|
|
|
1938
1938
|
numFmt: den < 10 ? "# ?/?" : "# ??/??"
|
|
1939
1939
|
};
|
|
1940
1940
|
}
|
|
1941
|
-
function parseCellInput(text4,
|
|
1941
|
+
function parseCellInput(text4, options7 = {}) {
|
|
1942
1942
|
if (text4 === "") return { value: null };
|
|
1943
1943
|
if (text4.startsWith("=") && text4.length > 1) return { value: null, formula: text4.slice(1) };
|
|
1944
1944
|
if (text4.startsWith("'")) return { value: text4.slice(1) };
|
|
@@ -1949,7 +1949,7 @@ function parseCellInput(text4, options6 = {}) {
|
|
|
1949
1949
|
if (upper2 === "TRUE" || upper2 === "FALSE") return { value: upper2 === "TRUE" };
|
|
1950
1950
|
if (isErrorCode(upper2)) return { value: cellError(upper2) };
|
|
1951
1951
|
}
|
|
1952
|
-
const parsed = parseNumberInput(trimmed2) ?? parseFractionInput(trimmed2) ?? parseDateTimeInput(trimmed2,
|
|
1952
|
+
const parsed = parseNumberInput(trimmed2) ?? parseFractionInput(trimmed2) ?? parseDateTimeInput(trimmed2, options7.date1904 ?? false);
|
|
1953
1953
|
if (!parsed) return { value: text4 };
|
|
1954
1954
|
return parsed.numFmt ? { value: parsed.value, numFmt: parsed.numFmt } : { value: parsed.value };
|
|
1955
1955
|
}
|
|
@@ -3500,7 +3500,7 @@ var int = (value3) => Math.trunc(num(value3));
|
|
|
3500
3500
|
var optNum = (args, i2, fallback) => i2 < args.length ? num(args[i2]) : fallback;
|
|
3501
3501
|
var optBool = (args, i2, fallback) => i2 < args.length ? bool(args[i2]) : fallback;
|
|
3502
3502
|
var omitted = (args, i2) => i2 >= args.length || args[i2] === null;
|
|
3503
|
-
function collectNumbers(ctx, args,
|
|
3503
|
+
function collectNumbers(ctx, args, options7 = {}) {
|
|
3504
3504
|
const out = [];
|
|
3505
3505
|
for (const arg of args) {
|
|
3506
3506
|
ctx.forEach(arg, (value3, kind) => {
|
|
@@ -3509,7 +3509,7 @@ function collectNumbers(ctx, args, options6 = {}) {
|
|
|
3509
3509
|
return;
|
|
3510
3510
|
}
|
|
3511
3511
|
if (isError(value3)) {
|
|
3512
|
-
if (
|
|
3512
|
+
if (options7.ignoreErrors) return;
|
|
3513
3513
|
throw new ErrorSignal(value3);
|
|
3514
3514
|
}
|
|
3515
3515
|
if (kind === "direct") {
|
|
@@ -3517,7 +3517,7 @@ function collectNumbers(ctx, args, options6 = {}) {
|
|
|
3517
3517
|
else out.push(toNumber(value3));
|
|
3518
3518
|
return;
|
|
3519
3519
|
}
|
|
3520
|
-
if (
|
|
3520
|
+
if (options7.includeAll) {
|
|
3521
3521
|
if (typeof value3 === "boolean") out.push(value3 ? 1 : 0);
|
|
3522
3522
|
else if (typeof value3 === "string") out.push(0);
|
|
3523
3523
|
}
|
|
@@ -8482,11 +8482,11 @@ var SUM_FUNCTIONS = [
|
|
|
8482
8482
|
255,
|
|
8483
8483
|
(args, ctx) => {
|
|
8484
8484
|
const code = int(args[0]);
|
|
8485
|
-
const
|
|
8486
|
-
if (code < 1 || code > 19 ||
|
|
8487
|
-
const skipNested =
|
|
8488
|
-
const skipHidden =
|
|
8489
|
-
const skipErrors =
|
|
8485
|
+
const options7 = int(args[1]);
|
|
8486
|
+
if (code < 1 || code > 19 || options7 < 0 || options7 > 7) fail(ERR.VALUE);
|
|
8487
|
+
const skipNested = options7 <= 3;
|
|
8488
|
+
const skipHidden = options7 === 1 || options7 === 3 || options7 === 5 || options7 === 7;
|
|
8489
|
+
const skipErrors = options7 === 2 || options7 === 3 || options7 === 6 || options7 === 7;
|
|
8490
8490
|
if (code >= 14) {
|
|
8491
8491
|
if (args.length !== 4) fail(ERR.VALUE);
|
|
8492
8492
|
const values2 = subtotalValues(ctx, [args[2] ?? null], skipHidden, skipErrors, skipNested);
|
|
@@ -11773,11 +11773,11 @@ function checkXmlLimits(xml, label2, limits = {}) {
|
|
|
11773
11773
|
throw new Error(`${label2} XML exceeds the nesting depth limit of ${maxDepth}`);
|
|
11774
11774
|
}
|
|
11775
11775
|
}
|
|
11776
|
-
function parseXml(xml,
|
|
11777
|
-
const label2 =
|
|
11776
|
+
function parseXml(xml, options7 = {}) {
|
|
11777
|
+
const label2 = options7.label ?? "OOXML";
|
|
11778
11778
|
if (/<!DOCTYPE|<!ENTITY/i.test(xml))
|
|
11779
11779
|
throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
|
|
11780
|
-
checkXmlLimits(xml, label2,
|
|
11780
|
+
checkXmlLimits(xml, label2, options7.limits);
|
|
11781
11781
|
let parseError = "";
|
|
11782
11782
|
let parsed;
|
|
11783
11783
|
try {
|
|
@@ -11991,7 +11991,7 @@ var pivotColumnFields = (pivot) => [
|
|
|
11991
11991
|
// i18n/locale.ts
|
|
11992
11992
|
var SUPPORTED_OFFICE_LOCALES = ["en", "fr", "de", "es", "zh-CN"];
|
|
11993
11993
|
var DEFAULT_REJECTED_SUBTAGS = ["hant", "tw", "hk", "mo"];
|
|
11994
|
-
function normalizeLocale(input, supported, fallback,
|
|
11994
|
+
function normalizeLocale(input, supported, fallback, options7 = {}) {
|
|
11995
11995
|
const parts = (input ?? "").trim().toLowerCase().split(/[-_]/).filter(Boolean);
|
|
11996
11996
|
const language = parts[0];
|
|
11997
11997
|
if (!language) return fallback;
|
|
@@ -12000,7 +12000,7 @@ function normalizeLocale(input, supported, fallback, options6 = {}) {
|
|
|
12000
12000
|
if (exact) return exact;
|
|
12001
12001
|
const base = find3(language);
|
|
12002
12002
|
if (base) return base;
|
|
12003
|
-
const rejected =
|
|
12003
|
+
const rejected = options7.rejectedSubtags ?? DEFAULT_REJECTED_SUBTAGS;
|
|
12004
12004
|
if (parts.slice(1).some((part) => rejected.includes(part))) return fallback;
|
|
12005
12005
|
return supported.find((item) => item.toLowerCase().split("-")[0] === language && item.includes("-")) ?? fallback;
|
|
12006
12006
|
}
|
|
@@ -12035,12 +12035,12 @@ function interpolate(template, params, placeholder2 = "single") {
|
|
|
12035
12035
|
(match2, name) => Object.prototype.hasOwnProperty.call(params, name) && params[name] !== void 0 ? String(params[name]) : match2
|
|
12036
12036
|
);
|
|
12037
12037
|
}
|
|
12038
|
-
function createTranslator(messages, fallbacks = [],
|
|
12039
|
-
const placeholder2 =
|
|
12038
|
+
function createTranslator(messages, fallbacks = [], options7 = {}) {
|
|
12039
|
+
const placeholder2 = options7.placeholder ?? "single";
|
|
12040
12040
|
return (key, params) => {
|
|
12041
12041
|
let text4 = messages?.[key];
|
|
12042
12042
|
for (let i2 = 0; text4 === void 0 && i2 < fallbacks.length; i2++) text4 = fallbacks[i2]?.[key];
|
|
12043
|
-
return interpolate(text4 ??
|
|
12043
|
+
return interpolate(text4 ?? options7.missing?.(key) ?? key, params, placeholder2);
|
|
12044
12044
|
};
|
|
12045
12045
|
}
|
|
12046
12046
|
|
|
@@ -12500,8 +12500,8 @@ function trimmedCaptions(caps) {
|
|
|
12500
12500
|
}
|
|
12501
12501
|
return Object.keys(out).length ? out : void 0;
|
|
12502
12502
|
}
|
|
12503
|
-
function authoredCaptions(
|
|
12504
|
-
const own =
|
|
12503
|
+
function authoredCaptions(options7) {
|
|
12504
|
+
const own = options7.captions ?? localizedPivotCaptions(options7.locale);
|
|
12505
12505
|
return own && Object.keys(own).length ? structuredClone(own) : void 0;
|
|
12506
12506
|
}
|
|
12507
12507
|
|
|
@@ -14980,9 +14980,9 @@ var Deferred = class {
|
|
|
14980
14980
|
};
|
|
14981
14981
|
var MAX_NESTED_COMPUTE = 40;
|
|
14982
14982
|
var EngineHost = class {
|
|
14983
|
-
constructor(workbook,
|
|
14983
|
+
constructor(workbook, options7) {
|
|
14984
14984
|
this.workbook = workbook;
|
|
14985
|
-
this.options =
|
|
14985
|
+
this.options = options7;
|
|
14986
14986
|
}
|
|
14987
14987
|
workbook;
|
|
14988
14988
|
options;
|
|
@@ -16079,8 +16079,8 @@ var Engine = class extends EngineStructure {
|
|
|
16079
16079
|
return [...this.cycles].map(({ sheet, row: row2, col }) => ({ sheet, row: row2, col }));
|
|
16080
16080
|
}
|
|
16081
16081
|
};
|
|
16082
|
-
function createCalcEngine(workbook,
|
|
16083
|
-
return new Engine(workbook,
|
|
16082
|
+
function createCalcEngine(workbook, options7 = {}) {
|
|
16083
|
+
return new Engine(workbook, options7);
|
|
16084
16084
|
}
|
|
16085
16085
|
|
|
16086
16086
|
// xlsx/formula/ref-text.ts
|
|
@@ -19409,8 +19409,8 @@ function rgbToHsl(r, g2, b) {
|
|
|
19409
19409
|
}
|
|
19410
19410
|
return { h: h2, s: clampUnitInterval(s), l: clampUnitInterval(l) };
|
|
19411
19411
|
}
|
|
19412
|
-
function hslToRgb(h2, s, l, roundChannel = Math.round,
|
|
19413
|
-
const sC =
|
|
19412
|
+
function hslToRgb(h2, s, l, roundChannel = Math.round, options7) {
|
|
19413
|
+
const sC = options7?.clampSaturation === false ? s : clampUnitInterval(s);
|
|
19414
19414
|
const lC = clampUnitInterval(l);
|
|
19415
19415
|
const hN = (h2 % 360 + 360) % 360;
|
|
19416
19416
|
const c2 = (1 - Math.abs(2 * lC - 1)) * sC;
|
|
@@ -19908,13 +19908,13 @@ var APPLIED = /* @__PURE__ */ new Set([
|
|
|
19908
19908
|
"lumMod",
|
|
19909
19909
|
"lumOff"
|
|
19910
19910
|
]);
|
|
19911
|
-
function resolveDrawingColor(color, theme2,
|
|
19911
|
+
function resolveDrawingColor(color, theme2, options7) {
|
|
19912
19912
|
const base = baseHex(color, theme2);
|
|
19913
19913
|
const rgb2 = base ? hexToRgbChannels(base) : null;
|
|
19914
19914
|
if (!rgb2) return void 0;
|
|
19915
|
-
if (
|
|
19915
|
+
if (options7?.transformOrder === "document") {
|
|
19916
19916
|
const value3 = orderedColorTransforms(rgb2, color.transforms);
|
|
19917
|
-
const round4 =
|
|
19917
|
+
const round4 = options7.hslRounding === "halfDown" ? (channel) => Math.ceil(channel - 0.5) : Math.round;
|
|
19918
19918
|
return {
|
|
19919
19919
|
hex: `#${toHex(round4(value3.r))}${toHex(round4(value3.g))}${toHex(round4(value3.b))}`,
|
|
19920
19920
|
alpha: value3.alpha,
|
|
@@ -19965,7 +19965,7 @@ function resolveDrawingColor(color, theme2, options6) {
|
|
|
19965
19965
|
if (lumMod !== void 0) hsl.l = clampUnitInterval(hsl.l * lumMod);
|
|
19966
19966
|
const lumOff = parseDrawingFraction(find3("lumOff"));
|
|
19967
19967
|
if (lumOff !== void 0) hsl.l = clampUnitInterval(hsl.l + lumOff);
|
|
19968
|
-
const round4 =
|
|
19968
|
+
const round4 = options7?.hslRounding === "halfDown" ? (value3) => Math.ceil(value3 - 0.5) : Math.round;
|
|
19969
19969
|
({ r, g: g2, b } = hslToRgb(hsl.h, hsl.s, hsl.l, round4));
|
|
19970
19970
|
}
|
|
19971
19971
|
let alpha = parseDrawingPercent(find3("alpha")) ?? 1;
|
|
@@ -21381,7 +21381,7 @@ function resolveInnerRect(fillToRect, focalPoint) {
|
|
|
21381
21381
|
function lerpEdge(inner2, outer, t) {
|
|
21382
21382
|
return inner2 + (outer - inner2) * t;
|
|
21383
21383
|
}
|
|
21384
|
-
function buildRectPathGradientSvg(stops, focalPoint, fillToRect,
|
|
21384
|
+
function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options7) {
|
|
21385
21385
|
if (stops.length === 0) {
|
|
21386
21386
|
return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"/>';
|
|
21387
21387
|
}
|
|
@@ -21390,7 +21390,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options6) {
|
|
|
21390
21390
|
const rects = [];
|
|
21391
21391
|
const alphaRects = [];
|
|
21392
21392
|
const masked = sorted2.some((stop) => (stop.opacity ?? 1) < 1);
|
|
21393
|
-
const bands =
|
|
21393
|
+
const bands = options7?.bands;
|
|
21394
21394
|
if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
|
|
21395
21395
|
for (let i2 = bands; i2 >= 0; i2 -= 1) {
|
|
21396
21396
|
const t = i2 / bands;
|
|
@@ -23129,6 +23129,191 @@ function parseChartSpace(source2) {
|
|
|
23129
23129
|
return { chartSpace, issues: context.issues };
|
|
23130
23130
|
}
|
|
23131
23131
|
|
|
23132
|
+
// chart/marker-shape.ts
|
|
23133
|
+
var CHART_PX_PER_PT = 4 / 3;
|
|
23134
|
+
var DEFAULT_MARKER_OUTLINE_PT = 0.75;
|
|
23135
|
+
var AUTOMATIC_MARKER_CYCLE = [
|
|
23136
|
+
"diamond",
|
|
23137
|
+
"square",
|
|
23138
|
+
"triangle",
|
|
23139
|
+
"x",
|
|
23140
|
+
"star",
|
|
23141
|
+
"circle",
|
|
23142
|
+
"plus",
|
|
23143
|
+
"dot",
|
|
23144
|
+
"dash"
|
|
23145
|
+
];
|
|
23146
|
+
function automaticMarkerSymbol(seriesIdx) {
|
|
23147
|
+
const length = AUTOMATIC_MARKER_CYCLE.length;
|
|
23148
|
+
const normalized = (Math.trunc(seriesIdx) % length + length) % length;
|
|
23149
|
+
return AUTOMATIC_MARKER_CYCLE[Number.isFinite(normalized) ? normalized : 0];
|
|
23150
|
+
}
|
|
23151
|
+
function markerRadius(size, defaultRadius) {
|
|
23152
|
+
if (size === void 0 || !Number.isFinite(size) || size <= 0) {
|
|
23153
|
+
return defaultRadius;
|
|
23154
|
+
}
|
|
23155
|
+
return size / 2;
|
|
23156
|
+
}
|
|
23157
|
+
function polygonPoints(vertices) {
|
|
23158
|
+
return vertices.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
|
|
23159
|
+
}
|
|
23160
|
+
function starVertices(cx2, cy, r) {
|
|
23161
|
+
const inner2 = r * 0.5;
|
|
23162
|
+
const out = [];
|
|
23163
|
+
for (let i2 = 0; i2 < 10; i2++) {
|
|
23164
|
+
const radius = i2 % 2 === 0 ? r : inner2;
|
|
23165
|
+
const angle = -Math.PI / 2 + Math.PI * i2 / 5;
|
|
23166
|
+
out.push([cx2 + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);
|
|
23167
|
+
}
|
|
23168
|
+
return out;
|
|
23169
|
+
}
|
|
23170
|
+
function rectPolygon(x, y, w, h2) {
|
|
23171
|
+
return polygonPoints([
|
|
23172
|
+
[x, y],
|
|
23173
|
+
[x + w, y],
|
|
23174
|
+
[x + w, y + h2],
|
|
23175
|
+
[x, y + h2]
|
|
23176
|
+
]);
|
|
23177
|
+
}
|
|
23178
|
+
function buildMarkerPrimitive(input) {
|
|
23179
|
+
const { symbol: symbol2, cx: cx2, cy, fill } = input;
|
|
23180
|
+
const part = input.part === void 0 ? {} : { part: input.part };
|
|
23181
|
+
if (symbol2 === "none") {
|
|
23182
|
+
return null;
|
|
23183
|
+
}
|
|
23184
|
+
const r = markerRadius(input.size, input.defaultRadius);
|
|
23185
|
+
const outline = input.stroke ? {
|
|
23186
|
+
stroke: input.stroke,
|
|
23187
|
+
strokeWidth: input.strokeWidth ?? DEFAULT_MARKER_OUTLINE_PT * CHART_PX_PER_PT
|
|
23188
|
+
} : void 0;
|
|
23189
|
+
const polygonStroke = outline ?? { stroke: fill, strokeWidth: 0 };
|
|
23190
|
+
const lineStroke = input.stroke ?? fill;
|
|
23191
|
+
switch (symbol2) {
|
|
23192
|
+
case "square":
|
|
23193
|
+
case "dash": {
|
|
23194
|
+
const h2 = symbol2 === "dash" ? r * 0.64 : r * 2;
|
|
23195
|
+
const y = cy - h2 / 2;
|
|
23196
|
+
if (outline) {
|
|
23197
|
+
return {
|
|
23198
|
+
kind: "polygon",
|
|
23199
|
+
points: rectPolygon(cx2 - r, y, r * 2, h2),
|
|
23200
|
+
fill,
|
|
23201
|
+
...outline,
|
|
23202
|
+
...part
|
|
23203
|
+
};
|
|
23204
|
+
}
|
|
23205
|
+
return { kind: "rect", x: cx2 - r, y, w: r * 2, h: h2, fill, ...part };
|
|
23206
|
+
}
|
|
23207
|
+
case "diamond":
|
|
23208
|
+
return {
|
|
23209
|
+
kind: "polygon",
|
|
23210
|
+
points: polygonPoints([
|
|
23211
|
+
[cx2, cy - r],
|
|
23212
|
+
[cx2 + r, cy],
|
|
23213
|
+
[cx2, cy + r],
|
|
23214
|
+
[cx2 - r, cy]
|
|
23215
|
+
]),
|
|
23216
|
+
fill,
|
|
23217
|
+
...polygonStroke,
|
|
23218
|
+
...part
|
|
23219
|
+
};
|
|
23220
|
+
case "triangle":
|
|
23221
|
+
return {
|
|
23222
|
+
kind: "polygon",
|
|
23223
|
+
points: polygonPoints([
|
|
23224
|
+
[cx2, cy - r],
|
|
23225
|
+
[cx2 + r * 0.9, cy + r * 0.75],
|
|
23226
|
+
[cx2 - r * 0.9, cy + r * 0.75]
|
|
23227
|
+
]),
|
|
23228
|
+
fill,
|
|
23229
|
+
...polygonStroke,
|
|
23230
|
+
...part
|
|
23231
|
+
};
|
|
23232
|
+
case "star":
|
|
23233
|
+
return {
|
|
23234
|
+
kind: "polygon",
|
|
23235
|
+
points: polygonPoints(starVertices(cx2, cy, r)),
|
|
23236
|
+
fill,
|
|
23237
|
+
...polygonStroke,
|
|
23238
|
+
...part
|
|
23239
|
+
};
|
|
23240
|
+
case "plus":
|
|
23241
|
+
return {
|
|
23242
|
+
kind: "path",
|
|
23243
|
+
d: `M${(cx2 - r).toFixed(2)},${cy.toFixed(2)} L${(cx2 + r).toFixed(2)},${cy.toFixed(2)} M${cx2.toFixed(2)},${(cy - r).toFixed(2)} L${cx2.toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
23244
|
+
fill: "none",
|
|
23245
|
+
stroke: lineStroke,
|
|
23246
|
+
strokeWidth: Math.max(1, r * 0.4),
|
|
23247
|
+
...part
|
|
23248
|
+
};
|
|
23249
|
+
case "x":
|
|
23250
|
+
return {
|
|
23251
|
+
kind: "path",
|
|
23252
|
+
d: `M${(cx2 - r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx2 + r).toFixed(2)},${(cy + r).toFixed(2)} M${(cx2 + r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx2 - r).toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
23253
|
+
fill: "none",
|
|
23254
|
+
stroke: lineStroke,
|
|
23255
|
+
strokeWidth: Math.max(1, r * 0.4),
|
|
23256
|
+
...part
|
|
23257
|
+
};
|
|
23258
|
+
case "dot":
|
|
23259
|
+
return { kind: "circle", cx: cx2, cy, r: Math.max(r * 0.6, 1), fill, ...part, ...outline };
|
|
23260
|
+
default:
|
|
23261
|
+
return { kind: "circle", cx: cx2, cy, r, fill, ...part, ...outline };
|
|
23262
|
+
}
|
|
23263
|
+
}
|
|
23264
|
+
|
|
23265
|
+
// chart/render/chart-view-markers.ts
|
|
23266
|
+
function summaryMarkers(source2, group2, seriesPosition) {
|
|
23267
|
+
if (!["line", "scatter", "radar"].includes(group2.kind)) return {};
|
|
23268
|
+
const enabled = group2.kind === "line" ? group2.marker === true : group2.kind === "radar" ? group2.radarStyle === "marker" : !["line", "smooth", "none"].includes(group2.scatterStyle ?? "marker");
|
|
23269
|
+
const symbol2 = source2.marker?.symbol;
|
|
23270
|
+
const marker3 = {
|
|
23271
|
+
...source2.marker,
|
|
23272
|
+
symbol: symbol2 && symbol2 !== "auto" ? symbol2 : source2.marker || enabled ? automaticMarkerSymbol(source2.index ?? seriesPosition) : "none"
|
|
23273
|
+
};
|
|
23274
|
+
const pointMarkers = {};
|
|
23275
|
+
for (const point of source2.dataPoints) {
|
|
23276
|
+
if (point.index === void 0 || !point.marker) continue;
|
|
23277
|
+
const override = point.marker;
|
|
23278
|
+
pointMarkers[point.index] = {
|
|
23279
|
+
...marker3,
|
|
23280
|
+
...override,
|
|
23281
|
+
...override.symbol === "auto" || !source2.marker && override.symbol === void 0 ? { symbol: automaticMarkerSymbol(source2.index ?? seriesPosition) } : {},
|
|
23282
|
+
...marker3.spPr || override.spPr ? {
|
|
23283
|
+
spPr: {
|
|
23284
|
+
...marker3.spPr,
|
|
23285
|
+
...override.spPr,
|
|
23286
|
+
...marker3.spPr?.line || override.spPr?.line ? { line: { ...marker3.spPr?.line, ...override.spPr?.line } } : {}
|
|
23287
|
+
}
|
|
23288
|
+
} : {}
|
|
23289
|
+
};
|
|
23290
|
+
}
|
|
23291
|
+
return { marker: marker3, ...Object.keys(pointMarkers).length ? { pointMarkers } : {} };
|
|
23292
|
+
}
|
|
23293
|
+
function seriesMarkerViews(source2, drawingColor) {
|
|
23294
|
+
const fillColor = (fill) => fill?.kind === "none" ? "none" : fill?.kind === "solid" ? drawingColor(fill.color) : void 0;
|
|
23295
|
+
const resolve3 = (marker3) => {
|
|
23296
|
+
const fill = fillColor(marker3.spPr?.fill);
|
|
23297
|
+
const stroke = fillColor(marker3.spPr?.line?.fill);
|
|
23298
|
+
const width = marker3.spPr?.line?.widthEmu;
|
|
23299
|
+
return {
|
|
23300
|
+
...marker3.symbol !== void 0 ? { symbol: marker3.symbol } : {},
|
|
23301
|
+
...marker3.size !== void 0 ? { size: marker3.size } : {},
|
|
23302
|
+
...fill !== void 0 ? { fill } : {},
|
|
23303
|
+
...stroke !== void 0 ? { stroke } : {},
|
|
23304
|
+
...width !== void 0 ? { strokeWidth: width / 9525 } : {}
|
|
23305
|
+
};
|
|
23306
|
+
};
|
|
23307
|
+
return {
|
|
23308
|
+
...source2.marker ? { marker: resolve3(source2.marker) } : {},
|
|
23309
|
+
...source2.pointMarkers ? {
|
|
23310
|
+
pointMarkers: Object.fromEntries(
|
|
23311
|
+
Object.entries(source2.pointMarkers).map(([i2, marker3]) => [i2, resolve3(marker3)])
|
|
23312
|
+
)
|
|
23313
|
+
} : {}
|
|
23314
|
+
};
|
|
23315
|
+
}
|
|
23316
|
+
|
|
23132
23317
|
// chart/render/summary-analysis.ts
|
|
23133
23318
|
function summaryTrendline(source2) {
|
|
23134
23319
|
const kind = chartTrendlineKind(source2.trendlineType);
|
|
@@ -23403,6 +23588,9 @@ function formatChartNumberWithColor(value3, formatCode) {
|
|
|
23403
23588
|
return void 0;
|
|
23404
23589
|
}
|
|
23405
23590
|
}
|
|
23591
|
+
function formatChartNumber(value3, formatCode) {
|
|
23592
|
+
return formatChartNumberWithColor(value3, formatCode)?.text;
|
|
23593
|
+
}
|
|
23406
23594
|
|
|
23407
23595
|
// chart/data-label-text.ts
|
|
23408
23596
|
var DATA_LABEL_SEPARATOR = ", ";
|
|
@@ -23451,17 +23639,17 @@ function composeDataLabelText(input) {
|
|
|
23451
23639
|
}
|
|
23452
23640
|
|
|
23453
23641
|
// chart/render/summary-labels.ts
|
|
23454
|
-
function level(
|
|
23642
|
+
function level(options7, custom) {
|
|
23455
23643
|
const out = {};
|
|
23456
|
-
if (
|
|
23457
|
-
if (
|
|
23458
|
-
if (
|
|
23459
|
-
if (
|
|
23460
|
-
if (
|
|
23461
|
-
if (
|
|
23462
|
-
if (
|
|
23463
|
-
if (
|
|
23464
|
-
if (
|
|
23644
|
+
if (options7.deleted !== void 0) out.deleted = options7.deleted;
|
|
23645
|
+
if (options7.showValue !== void 0) out.showValue = options7.showValue;
|
|
23646
|
+
if (options7.showCategoryName !== void 0) out.showCategory = options7.showCategoryName;
|
|
23647
|
+
if (options7.showSeriesName !== void 0) out.showSeriesName = options7.showSeriesName;
|
|
23648
|
+
if (options7.showPercent !== void 0) out.showPercent = options7.showPercent;
|
|
23649
|
+
if (options7.showBubbleSize !== void 0) out.showBubbleSize = options7.showBubbleSize;
|
|
23650
|
+
if (options7.separator !== void 0) out.separator = options7.separator;
|
|
23651
|
+
if (options7.position) out.position = options7.position;
|
|
23652
|
+
if (options7.numberFormat?.formatCode) out.numberFormat = options7.numberFormat.formatCode;
|
|
23465
23653
|
if (custom?.text !== void 0) out.text = custom.text;
|
|
23466
23654
|
return out;
|
|
23467
23655
|
}
|
|
@@ -23568,7 +23756,10 @@ function extraGroups(chartSpace, firstType) {
|
|
|
23568
23756
|
const type = group2.kind === "bar" ? "column" : group2.kind;
|
|
23569
23757
|
const entry3 = {
|
|
23570
23758
|
chartType: type,
|
|
23571
|
-
series: group2.series.map((source2) =>
|
|
23759
|
+
series: group2.series.map((source2, index3) => ({
|
|
23760
|
+
...chartSummarySeries(source2, type, group2.dataLabels),
|
|
23761
|
+
...summaryMarkers(source2, group2, index3)
|
|
23762
|
+
})),
|
|
23572
23763
|
secondary: valueAxisId(chartSpace, group2.axisIds) !== primary
|
|
23573
23764
|
};
|
|
23574
23765
|
if (group2.grouping && GROUPINGS.has(group2.grouping))
|
|
@@ -23586,13 +23777,16 @@ function chartSummaryFromSpace(chartSpace, extras = {}) {
|
|
|
23586
23777
|
const group2 = chartSpace.plotArea.groups[0];
|
|
23587
23778
|
let chartType = group2 ? GROUP_TYPES[group2.kind] : "column";
|
|
23588
23779
|
if (chartType === "bar" && group2?.barDirection !== "bar") chartType = "column";
|
|
23589
|
-
const series = (group2?.series ?? []).map(
|
|
23590
|
-
|
|
23591
|
-
|
|
23780
|
+
const series = (group2?.series ?? []).map((source2, index3) => ({
|
|
23781
|
+
...chartSummarySeries(source2, chartType, group2?.dataLabels),
|
|
23782
|
+
...group2 ? summaryMarkers(source2, group2, index3) : {}
|
|
23783
|
+
}));
|
|
23592
23784
|
const summary = {
|
|
23593
23785
|
chartType,
|
|
23594
23786
|
series,
|
|
23595
|
-
showLegend: chartSpace.legend !== void 0
|
|
23787
|
+
showLegend: chartSpace.legend !== void 0,
|
|
23788
|
+
axes: chartSpace.plotArea.axes,
|
|
23789
|
+
axisIds: group2?.axisIds ?? []
|
|
23596
23790
|
};
|
|
23597
23791
|
const combined = extraGroups(chartSpace, chartType);
|
|
23598
23792
|
if (combined.length) summary.extraGroups = combined;
|
|
@@ -23675,6 +23869,8 @@ function parseChart(xml, anchor, partName, name) {
|
|
|
23675
23869
|
showLegend: summary.showLegend,
|
|
23676
23870
|
partName
|
|
23677
23871
|
};
|
|
23872
|
+
if (summary.axes) object.axes = summary.axes;
|
|
23873
|
+
if (summary.axisIds) object.axisIds = summary.axisIds;
|
|
23678
23874
|
if (summary.grouping) object.grouping = summary.grouping;
|
|
23679
23875
|
if (summary.barGapWidth !== void 0) object.barGapWidth = summary.barGapWidth;
|
|
23680
23876
|
if (summary.barOverlap !== void 0) object.barOverlap = summary.barOverlap;
|
|
@@ -24453,9 +24649,9 @@ function readPrintOptions(node2) {
|
|
|
24453
24649
|
for (const key of KEYS) if (boolAttr(node2, key)) out[key] = true;
|
|
24454
24650
|
return Object.keys(out).length ? out : void 0;
|
|
24455
24651
|
}
|
|
24456
|
-
function printOptionsXml(
|
|
24457
|
-
if (!
|
|
24458
|
-
const attrs2 = KEYS.filter((key) =>
|
|
24652
|
+
function printOptionsXml(options7) {
|
|
24653
|
+
if (!options7) return "";
|
|
24654
|
+
const attrs2 = KEYS.filter((key) => options7[key]).map((key) => ` ${key}="1"`);
|
|
24459
24655
|
return attrs2.length ? `<printOptions${attrs2.join("")}/>` : "";
|
|
24460
24656
|
}
|
|
24461
24657
|
|
|
@@ -24994,12 +25190,12 @@ Reply:
|
|
|
24994
25190
|
|
|
24995
25191
|
// chart/bar-cluster-geometry.ts
|
|
24996
25192
|
var DEFAULT_BAR_GAP_WIDTH = 150;
|
|
24997
|
-
function assertBarClusterOptions(
|
|
25193
|
+
function assertBarClusterOptions(options7) {
|
|
24998
25194
|
for (const [field, min, max] of [
|
|
24999
25195
|
["barGapWidth", 0, 500],
|
|
25000
25196
|
["barOverlap", -100, 100]
|
|
25001
25197
|
]) {
|
|
25002
|
-
const value3 =
|
|
25198
|
+
const value3 = options7[field];
|
|
25003
25199
|
if (value3 !== void 0 && (!Number.isInteger(value3) || value3 < min || value3 > max))
|
|
25004
25200
|
throw new RangeError(`${field} must be an integer from ${min} to ${max}`);
|
|
25005
25201
|
}
|
|
@@ -25450,8 +25646,8 @@ function titleXml(context, title) {
|
|
|
25450
25646
|
chartTextXml(context, tx, false) + layoutXml(context, title.layout) + valXml("overlay", title.overlay) + shapePropertiesXml(context, title.spPr) + textBodyXml(context, title.txPr) + raw(context, title.extLst)
|
|
25451
25647
|
);
|
|
25452
25648
|
}
|
|
25453
|
-
function labelOptionsXml(context,
|
|
25454
|
-
return numberFormatXml(
|
|
25649
|
+
function labelOptionsXml(context, options7) {
|
|
25650
|
+
return numberFormatXml(options7.numberFormat) + shapePropertiesXml(context, options7.spPr) + textBodyXml(context, options7.txPr) + valXml("dLblPos", options7.position) + valXml("showLegendKey", options7.showLegendKey) + valXml("showVal", options7.showValue) + valXml("showCatName", options7.showCategoryName) + valXml("showSerName", options7.showSeriesName) + valXml("showPercent", options7.showPercent) + valXml("showBubbleSize", options7.showBubbleSize) + (options7.separator === void 0 ? "" : textElement("separator", options7.separator));
|
|
25455
25651
|
}
|
|
25456
25652
|
function labelXml(context, label2) {
|
|
25457
25653
|
return elementXml(
|
|
@@ -25621,7 +25817,7 @@ function styleXml(context, space) {
|
|
|
25621
25817
|
);
|
|
25622
25818
|
}
|
|
25623
25819
|
var relationship = (local, id, content2 = "") => id === void 0 ? "" : elementXml(local, content2, ` r:id="${escapeAttribute(id)}"`);
|
|
25624
|
-
function writeChartSpace(space,
|
|
25820
|
+
function writeChartSpace(space, options7 = {}) {
|
|
25625
25821
|
const bindings = new Map(CHART_ROOT_BINDINGS);
|
|
25626
25822
|
for (const { prefix, uri } of space.namespaceDeclarations ?? [])
|
|
25627
25823
|
if (!bindings.has(prefix) && /^[A-Za-z_][\w.-]*$/.test(prefix)) bindings.set(prefix, uri);
|
|
@@ -25636,7 +25832,7 @@ function writeChartSpace(space, options6 = {}) {
|
|
|
25636
25832
|
space.externalDataRelId,
|
|
25637
25833
|
valXml("autoUpdate", space.externalDataAutoUpdate)
|
|
25638
25834
|
) + raw(context, space.printSettings) + relationship("userShapes", space.userShapesRelId) + raw(context, space.extLst);
|
|
25639
|
-
const breakAfter =
|
|
25835
|
+
const breakAfter = options7.declarationBreak ?? "\r\n";
|
|
25640
25836
|
return `${DECLARATION3}${breakAfter}<c:chartSpace${declarations}>${body2}</c:chartSpace>`;
|
|
25641
25837
|
}
|
|
25642
25838
|
|
|
@@ -25821,6 +26017,14 @@ function chartColorPalettePatch(chart, id) {
|
|
|
25821
26017
|
if (!previous) return copy2;
|
|
25822
26018
|
const previousChoice = chartPaletteSeriesColorChoice(previous, index3, chart.series.length);
|
|
25823
26019
|
const nextChoice = chartPaletteSeriesColorChoice(next, index3, chart.series.length);
|
|
26020
|
+
for (const marker3 of [copy2.marker, ...Object.values(copy2.pointMarkers ?? {})]) {
|
|
26021
|
+
const shape2 = marker3?.spPr;
|
|
26022
|
+
if (!shape2) continue;
|
|
26023
|
+
for (const paint2 of [shape2, shape2.line]) {
|
|
26024
|
+
if (paint2?.fill?.kind === "solid" && sameChartColor(paint2.fill.color, previousChoice))
|
|
26025
|
+
paint2.fill = { kind: "solid", color: structuredClone(nextChoice) };
|
|
26026
|
+
}
|
|
26027
|
+
}
|
|
25824
26028
|
const fill = recolorGradient(copy2.fill, previousChoice, nextChoice);
|
|
25825
26029
|
if (fill) copy2.fill = fill;
|
|
25826
26030
|
if (sameChartColor(
|
|
@@ -26168,10 +26372,10 @@ var PackageWriter = class {
|
|
|
26168
26372
|
async build() {
|
|
26169
26373
|
const zip = new JSZip2();
|
|
26170
26374
|
const date = new Date(Date.UTC(1980, 0, 1));
|
|
26171
|
-
const
|
|
26172
|
-
zip.file("[Content_Types].xml", this.contentTypesXml(),
|
|
26375
|
+
const options7 = { date, createFolders: false };
|
|
26376
|
+
zip.file("[Content_Types].xml", this.contentTypesXml(), options7);
|
|
26173
26377
|
const names = [...this.parts.keys()].sort((a2, b) => rank2(a2) - rank2(b) || a2.localeCompare(b));
|
|
26174
|
-
for (const name of names) zip.file(name, this.parts.get(name) ?? "",
|
|
26378
|
+
for (const name of names) zip.file(name, this.parts.get(name) ?? "", options7);
|
|
26175
26379
|
return zip.generateAsync({
|
|
26176
26380
|
type: "uint8array",
|
|
26177
26381
|
compression: "DEFLATE",
|
|
@@ -32830,15 +33034,15 @@ function pasteAt(ctx, s, at, payload, request) {
|
|
|
32830
33034
|
function pasteSelection(ctx, sheet, selection, payload, request) {
|
|
32831
33035
|
const dest = normalizeRange(selection);
|
|
32832
33036
|
const clip = typeof payload === "string" ? { tsv: payload, html: "", cells: cellsFromText(ctx.workbook, payload) } : payload;
|
|
32833
|
-
const
|
|
32834
|
-
if (
|
|
32835
|
-
return pasteWidths(ctx, sheet, dest, clip.cells,
|
|
32836
|
-
const height =
|
|
32837
|
-
const width =
|
|
33037
|
+
const options7 = resolvePasteOptions(request);
|
|
33038
|
+
if (options7.mode === "widths")
|
|
33039
|
+
return pasteWidths(ctx, sheet, dest, clip.cells, options7.transpose, !!clip.cut);
|
|
33040
|
+
const height = options7.transpose ? clip.cells.cols : clip.cells.rows;
|
|
33041
|
+
const width = options7.transpose ? clip.cells.rows : clip.cells.cols;
|
|
32838
33042
|
const rows2 = dest.end.row - dest.start.row + 1;
|
|
32839
33043
|
const cols = dest.end.col - dest.start.col + 1;
|
|
32840
33044
|
if (clip.cut || !height || !width || rows2 === 1 && cols === 1 || dest.start.row === 0 && dest.end.row === MAX_ROW || dest.start.col === 0 && dest.end.col === MAX_COL)
|
|
32841
|
-
return pasteAt(ctx, sheet, dest.start, clip,
|
|
33045
|
+
return pasteAt(ctx, sheet, dest.start, clip, options7);
|
|
32842
33046
|
if (rows2 % height || cols % width)
|
|
32843
33047
|
throw new RangeError("The copy and paste areas are not compatible sizes.");
|
|
32844
33048
|
if (rows2 * cols > 25e4) throw new RangeError("The selected paste area is too large.");
|
|
@@ -32858,16 +33062,16 @@ function pasteSelection(ctx, sheet, selection, payload, request) {
|
|
|
32858
33062
|
() => {
|
|
32859
33063
|
for (let row2 = dest.start.row; row2 <= dest.end.row; row2 += height)
|
|
32860
33064
|
for (let col = dest.start.col; col <= dest.end.col; col += width)
|
|
32861
|
-
pasteAt(tileContext, sheet, { row: row2, col }, tileClip,
|
|
32862
|
-
if (["all", "formats", "noBorders", "mergeFormats"].includes(
|
|
33065
|
+
pasteAt(tileContext, sheet, { row: row2, col }, tileClip, options7);
|
|
33066
|
+
if (["all", "formats", "noBorders", "mergeFormats"].includes(options7.mode))
|
|
32863
33067
|
pasteConditionalFormats(
|
|
32864
33068
|
sheetAt(ctx.workbook, sheet),
|
|
32865
33069
|
dest,
|
|
32866
33070
|
clip.cells,
|
|
32867
|
-
|
|
32868
|
-
|
|
33071
|
+
options7.transpose,
|
|
33072
|
+
options7.skipBlanks,
|
|
32869
33073
|
void 0,
|
|
32870
|
-
|
|
33074
|
+
options7.mode === "mergeFormats"
|
|
32871
33075
|
);
|
|
32872
33076
|
return dest;
|
|
32873
33077
|
},
|
|
@@ -33318,7 +33522,7 @@ function numberInputText(value3, numFmt, date1904 = false) {
|
|
|
33318
33522
|
if (/%/.test(numFmt.replace(/"[^"]*"|\\./g, ""))) return `${plainNumber(value3 * 100)}%`;
|
|
33319
33523
|
return plainNumber(value3);
|
|
33320
33524
|
}
|
|
33321
|
-
function formulaBarText(workbook, cell,
|
|
33525
|
+
function formulaBarText(workbook, cell, options7 = {}) {
|
|
33322
33526
|
if (!cell) return "";
|
|
33323
33527
|
if (cell.formula !== void 0) return `=${cell.formula}`;
|
|
33324
33528
|
const value3 = cell.value;
|
|
@@ -33332,7 +33536,7 @@ function formulaBarText(workbook, cell, options6 = {}) {
|
|
|
33332
33536
|
workbook.date1904
|
|
33333
33537
|
);
|
|
33334
33538
|
const text4 = cell.richText?.length ? cell.richText.map((run2) => run2.text).join("") : value3;
|
|
33335
|
-
if (text4 === "" ||
|
|
33539
|
+
if (text4 === "" || options7.quote === false) return text4;
|
|
33336
33540
|
const parsed = parseCellInput(text4, { date1904: workbook.date1904 });
|
|
33337
33541
|
const literal2 = parsed.formula === void 0 && parsed.value === text4;
|
|
33338
33542
|
return literal2 ? text4 : `'${text4}`;
|
|
@@ -33958,9 +34162,9 @@ var SessionCalculator = class {
|
|
|
33958
34162
|
// xlsx/edit/goal-solver.ts
|
|
33959
34163
|
var DEFAULT_GOAL_ITERATIONS = 100;
|
|
33960
34164
|
var DEFAULT_GOAL_MAX_CHANGE = 1e-3;
|
|
33961
|
-
function solveGoal(f6, goal, start,
|
|
33962
|
-
const maxIterations =
|
|
33963
|
-
const tolerance =
|
|
34165
|
+
function solveGoal(f6, goal, start, options7 = {}) {
|
|
34166
|
+
const maxIterations = options7.maxIterations ?? DEFAULT_GOAL_ITERATIONS;
|
|
34167
|
+
const tolerance = options7.maxChange ?? DEFAULT_GOAL_MAX_CHANGE;
|
|
33964
34168
|
let iterations = 0;
|
|
33965
34169
|
let best;
|
|
33966
34170
|
let negative;
|
|
@@ -34437,10 +34641,10 @@ function columnOverrides(sheet, mdw, defaultPx) {
|
|
|
34437
34641
|
}
|
|
34438
34642
|
return out;
|
|
34439
34643
|
}
|
|
34440
|
-
function createGridMetrics(sheet,
|
|
34441
|
-
const zoom = zoomPercent(
|
|
34644
|
+
function createGridMetrics(sheet, options7 = {}) {
|
|
34645
|
+
const zoom = zoomPercent(options7.zoom ?? sheet.view.zoom);
|
|
34442
34646
|
const factor = zoom / 100;
|
|
34443
|
-
const mdw =
|
|
34647
|
+
const mdw = options7.mdw ?? DEFAULT_MAX_DIGIT_WIDTH;
|
|
34444
34648
|
const scale2 = (px) => px > 0 ? Math.max(1, Math.round(px * factor)) : 0;
|
|
34445
34649
|
const defaultColPx = defaultColumnPixels(sheet.defaultColWidth, mdw);
|
|
34446
34650
|
const colOverrides = [...columnOverrides(sheet, mdw, defaultColPx)].map(
|
|
@@ -34462,8 +34666,8 @@ function createGridMetrics(sheet, options6 = {}) {
|
|
|
34462
34666
|
for (const merge2 of sheet.merges) lastColUsed = Math.max(lastColUsed, merge2.end.col);
|
|
34463
34667
|
for (const info of sheet.columns)
|
|
34464
34668
|
if (info.max < MAX_COL) lastColUsed = Math.max(lastColUsed, info.max);
|
|
34465
|
-
const lastRow = Math.min(MAX_ROW, lastRowUsed + (
|
|
34466
|
-
const lastCol = Math.min(MAX_COL, lastColUsed + (
|
|
34669
|
+
const lastRow = Math.min(MAX_ROW, lastRowUsed + (options7.extraRows ?? 50));
|
|
34670
|
+
const lastCol = Math.min(MAX_COL, lastColUsed + (options7.extraCols ?? 20));
|
|
34467
34671
|
return {
|
|
34468
34672
|
zoom,
|
|
34469
34673
|
lastRow,
|
|
@@ -34683,37 +34887,37 @@ function writePivot(ctx, s, pivot, old, label2, inside) {
|
|
|
34683
34887
|
);
|
|
34684
34888
|
}
|
|
34685
34889
|
var startRow = (range2, offset2) => range2.start.row + offset2;
|
|
34686
|
-
function createPivotTable(ctx, s, destination,
|
|
34687
|
-
const data = pivotSourceData(ctx.workbook, s,
|
|
34688
|
-
const name =
|
|
34890
|
+
function createPivotTable(ctx, s, destination, options7) {
|
|
34891
|
+
const data = pivotSourceData(ctx.workbook, s, options7.source);
|
|
34892
|
+
const name = options7.name ?? uniqueName(ctx);
|
|
34689
34893
|
checkName2(ctx, name);
|
|
34690
|
-
const aggregate3 =
|
|
34691
|
-
const captions = authoredCaptions(
|
|
34894
|
+
const aggregate3 = options7.aggregate ?? "sum";
|
|
34895
|
+
const captions = authoredCaptions(options7);
|
|
34692
34896
|
const pivot = {
|
|
34693
34897
|
...data,
|
|
34694
34898
|
...captions ? { captions } : {},
|
|
34695
34899
|
name,
|
|
34696
|
-
rowField:
|
|
34697
|
-
layout:
|
|
34698
|
-
subtotalPosition:
|
|
34699
|
-
...
|
|
34700
|
-
...
|
|
34701
|
-
...
|
|
34702
|
-
...
|
|
34900
|
+
rowField: options7.rowField,
|
|
34901
|
+
layout: options7.layout ?? "tabular",
|
|
34902
|
+
subtotalPosition: options7.subtotalPosition ?? (options7.layout && options7.layout !== "tabular" ? "top" : "bottom"),
|
|
34903
|
+
...options7.secondRowField ? { secondRowField: options7.secondRowField } : {},
|
|
34904
|
+
...options7.secondRowField && options7.moreRowFields?.length ? { moreRowFields: [...options7.moreRowFields] } : {},
|
|
34905
|
+
...options7.fieldSubtotals?.length ? { fieldSubtotals: normalizedFieldSubtotals(options7.fieldSubtotals) } : {},
|
|
34906
|
+
...options7.dateGroups?.length ? { dateGroups: structuredClone(options7.dateGroups) } : {},
|
|
34703
34907
|
...ctx.workbook.date1904 ? { date1904: true } : {},
|
|
34704
|
-
...
|
|
34705
|
-
...
|
|
34706
|
-
valueField:
|
|
34908
|
+
...options7.subtotals !== void 0 ? { subtotals: options7.subtotals } : {},
|
|
34909
|
+
...options7.repeatLabels !== void 0 ? { repeatLabels: options7.repeatLabels } : {},
|
|
34910
|
+
valueField: options7.valueField,
|
|
34707
34911
|
aggregate: aggregate3,
|
|
34708
|
-
valueCaption: pivotCaption(aggregate3,
|
|
34709
|
-
...
|
|
34710
|
-
...
|
|
34711
|
-
...
|
|
34712
|
-
...
|
|
34713
|
-
...
|
|
34912
|
+
valueCaption: pivotCaption(aggregate3, options7.valueField, { captions }),
|
|
34913
|
+
...options7.pageFilter !== void 0 ? { pageFilter: structuredClone(options7.pageFilter) } : {},
|
|
34914
|
+
...options7.fieldGroups?.length ? { fieldGroups: structuredClone(options7.fieldGroups) } : {},
|
|
34915
|
+
...options7.valuesAxis !== void 0 ? { valuesAxis: options7.valuesAxis } : {},
|
|
34916
|
+
...options7.valuesPosition !== void 0 ? { valuesPosition: options7.valuesPosition } : {},
|
|
34917
|
+
...options7.additionalValues ? { additionalValues: normalizedPivotMeasures(options7.additionalValues, { captions }) } : {},
|
|
34714
34918
|
location: { start: { ...destination }, end: { ...destination } },
|
|
34715
|
-
...
|
|
34716
|
-
...
|
|
34919
|
+
...options7.columnField ? { columnField: options7.columnField } : {},
|
|
34920
|
+
...options7.columnField && options7.moreColumnFields?.length ? { moreColumnFields: [...options7.moreColumnFields] } : {}
|
|
34717
34921
|
};
|
|
34718
34922
|
if (pivot.dateGroups) reconcileDateAxes(pivot);
|
|
34719
34923
|
const dates = pivotDateFieldsOf(ctx.workbook, s, pivot);
|
|
@@ -38468,7 +38672,7 @@ function displayText2(value3, style3, numFmt, workbook, sheet) {
|
|
|
38468
38672
|
});
|
|
38469
38673
|
return formatted.color ? { text: formatted.text, color: formatted.color } : { text: formatted.text };
|
|
38470
38674
|
}
|
|
38471
|
-
function cellView(workbook, sheetIndex2, row2, col, cf,
|
|
38675
|
+
function cellView(workbook, sheetIndex2, row2, col, cf, options7 = {}) {
|
|
38472
38676
|
const sheet = workbook.sheets[sheetIndex2];
|
|
38473
38677
|
if (!sheet) throw new RangeError(`No sheet at index ${sheetIndex2}`);
|
|
38474
38678
|
const cell = getCell(sheet, row2, col);
|
|
@@ -38507,10 +38711,10 @@ function cellView(workbook, sheetIndex2, row2, col, cf, options6 = {}) {
|
|
|
38507
38711
|
vAlign: alignment.vertical ?? "bottom",
|
|
38508
38712
|
wrap: wrap3,
|
|
38509
38713
|
shrink,
|
|
38510
|
-
indentPx: indentable ? (alignment.indent ?? 0) * (
|
|
38714
|
+
indentPx: indentable ? (alignment.indent ?? 0) * (options7.indentPx ?? INDENT_PX_PER_LEVEL) : 0,
|
|
38511
38715
|
rotation,
|
|
38512
38716
|
isNumber: isNumber2,
|
|
38513
|
-
overflow: (formulaText !== void 0 || typeof value3 === "string" && value3 !== "") && !wrap3 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !(
|
|
38717
|
+
overflow: (formulaText !== void 0 || typeof value3 === "string" && value3 !== "") && !wrap3 && !shrink && rotation === 0 && !vertical2 && hAlign !== "fill" && !(options7.merged ?? sheet.merges.some((m) => rangeContains(m, { row: row2, col }))),
|
|
38514
38718
|
hasComment: sheet.comments.some((c2) => c2.address.row === row2 && c2.address.col === col),
|
|
38515
38719
|
hasHyperlink: false,
|
|
38516
38720
|
validationList: sheet.dataValidations.some(
|
|
@@ -39126,11 +39330,11 @@ function check2(workbook, dv, value3, at, evaluate) {
|
|
|
39126
39330
|
if (dv.type === "whole" && !Number.isInteger(n2)) return false;
|
|
39127
39331
|
return compare(operator, n2, a2, b);
|
|
39128
39332
|
}
|
|
39129
|
-
function validateCellInput(workbook, sheet, row2, col, value3,
|
|
39333
|
+
function validateCellInput(workbook, sheet, row2, col, value3, options7 = {}) {
|
|
39130
39334
|
const dv = validationAt(workbook, sheet, row2, col);
|
|
39131
39335
|
if (!dv || dv.type === "none" || dv.showErrorMessage !== true) return { ok: true };
|
|
39132
39336
|
if (value3 === null || value3 === "") return dv.allowBlank === false ? failure(dv) : { ok: true };
|
|
39133
|
-
const evaluate =
|
|
39337
|
+
const evaluate = options7.evaluate ?? defaultEvaluate(workbook);
|
|
39134
39338
|
return check2(workbook, dv, value3, { sheet, row: row2, col }, evaluate) ? { ok: true } : failure(dv);
|
|
39135
39339
|
}
|
|
39136
39340
|
function failure(dv) {
|
|
@@ -39144,10 +39348,10 @@ function failure(dv) {
|
|
|
39144
39348
|
}
|
|
39145
39349
|
|
|
39146
39350
|
// xlsx/edit/session.ts
|
|
39147
|
-
function createEditSession(workbook,
|
|
39351
|
+
function createEditSession(workbook, options7 = {}) {
|
|
39148
39352
|
const calc = createCalcEngine(workbook);
|
|
39149
|
-
const autoRecalc =
|
|
39150
|
-
const history = new History(
|
|
39353
|
+
const autoRecalc = options7.recalc ?? true;
|
|
39354
|
+
const history = new History(options7.historyLimit ?? 100);
|
|
39151
39355
|
const listeners2 = /* @__PURE__ */ new Set();
|
|
39152
39356
|
let open;
|
|
39153
39357
|
const emit = (change) => {
|
|
@@ -39246,8 +39450,8 @@ function createEditSession(workbook, options6 = {}) {
|
|
|
39246
39450
|
return result2;
|
|
39247
39451
|
};
|
|
39248
39452
|
const ctx = { workbook, calc, run: run2 };
|
|
39249
|
-
if (
|
|
39250
|
-
const autoRows =
|
|
39453
|
+
if (options7.defaultSheetBase) ctx.defaultSheetBase = options7.defaultSheetBase;
|
|
39454
|
+
const autoRows = options7.autoRowHeight ?? true;
|
|
39251
39455
|
const refitRows = (current) => {
|
|
39252
39456
|
const { sheet: s, kind, ranges } = current;
|
|
39253
39457
|
if (!autoRows || s === void 0 || !ranges.length || !current.step.entries.length) return;
|
|
@@ -39255,7 +39459,7 @@ function createEditSession(workbook, options6 = {}) {
|
|
|
39255
39459
|
const sheet = workbook.sheets[s];
|
|
39256
39460
|
if (!sheet) return;
|
|
39257
39461
|
try {
|
|
39258
|
-
autoGrowRows(ctx, s, rowsToRefit(sheet, ranges),
|
|
39462
|
+
autoGrowRows(ctx, s, rowsToRefit(sheet, ranges), options7.measureText);
|
|
39259
39463
|
} catch (error) {
|
|
39260
39464
|
const message = `Row height update failed: ${error instanceof Error ? error.message : String(error)}`;
|
|
39261
39465
|
if (!workbook.warnings.includes(message)) workbook.warnings.push(message);
|
|
@@ -39318,7 +39522,7 @@ function createEditSession(workbook, options6 = {}) {
|
|
|
39318
39522
|
setDefinedName: (name) => setDefinedName(ctx, name),
|
|
39319
39523
|
deleteDefinedName: (name, localSheet) => deleteDefinedName(ctx, name, localSheet),
|
|
39320
39524
|
setDrawingAnchor: (s, index3, anchor) => setDrawingAnchor(ctx, s, index3, anchor),
|
|
39321
|
-
createPivotTable: (s, destination,
|
|
39525
|
+
createPivotTable: (s, destination, options8) => createPivotTable(ctx, s, destination, options8),
|
|
39322
39526
|
refreshPivotTable: (s, name, patch2) => refreshPivotTable(ctx, s, name, patch2),
|
|
39323
39527
|
deletePivotTable: (s, name) => deletePivotTable(ctx, s, name),
|
|
39324
39528
|
setSlicerSelection: (cache3, keys) => setSlicerSelection(ctx, cache3, keys),
|
|
@@ -39368,8 +39572,8 @@ function createEditSession(workbook, options6 = {}) {
|
|
|
39368
39572
|
setDocumentProperties: (patch2) => setDocumentProperties(ctx, patch2),
|
|
39369
39573
|
setAutoRecalc: (enabled) => setCalcMode(ctx, enabled ? "auto" : "manual"),
|
|
39370
39574
|
autoRecalc: () => autoRecalc && calcModeOf(workbook) === "auto",
|
|
39371
|
-
calculateNow(
|
|
39372
|
-
calculator.now(
|
|
39575
|
+
calculateNow(options8) {
|
|
39576
|
+
calculator.now(options8?.full ?? false);
|
|
39373
39577
|
emit({ kind: "cells", label: "Calculate now", structural: false });
|
|
39374
39578
|
},
|
|
39375
39579
|
prepareCalculation: (opts) => calculator.prepare(opts?.timeRemaining),
|
|
@@ -39501,14 +39705,14 @@ function dataBarAppearance(rule, workbook) {
|
|
|
39501
39705
|
}
|
|
39502
39706
|
|
|
39503
39707
|
// xlsx/layout/data-bar-geometry.ts
|
|
39504
|
-
function dataBarGeometry(value3, low, high,
|
|
39505
|
-
const lo =
|
|
39506
|
-
const hi =
|
|
39708
|
+
function dataBarGeometry(value3, low, high, options7) {
|
|
39709
|
+
const lo = options7.autoMin ? Math.min(0, low) : low;
|
|
39710
|
+
const hi = options7.autoMax ? Math.max(0, high) : high;
|
|
39507
39711
|
const clamp = (v) => Math.max(0, Math.min(1, v));
|
|
39508
|
-
const minimum =
|
|
39509
|
-
const delta =
|
|
39712
|
+
const minimum = options7.minLength;
|
|
39713
|
+
const delta = options7.maxLength - minimum;
|
|
39510
39714
|
const interpolate2 = (ratio, offset2 = minimum) => clamp(offset2 + clamp(ratio) * delta);
|
|
39511
|
-
if (
|
|
39715
|
+
if (options7.axis === "none") {
|
|
39512
39716
|
const ratio = hi > lo ? clamp((value3 - lo) / (hi - lo)) : 0.5;
|
|
39513
39717
|
return {
|
|
39514
39718
|
start: 0,
|
|
@@ -39516,7 +39720,7 @@ function dataBarGeometry(value3, low, high, options6) {
|
|
|
39516
39720
|
reverse: false
|
|
39517
39721
|
};
|
|
39518
39722
|
}
|
|
39519
|
-
if (
|
|
39723
|
+
if (options7.axis === "middle") {
|
|
39520
39724
|
const span4 = Math.max(Math.abs(lo), Math.abs(hi));
|
|
39521
39725
|
const fraction2 = interpolate2(span4 > 0 ? Math.abs(value3) / span4 : 0) / 2;
|
|
39522
39726
|
return { start: value3 < 0 ? 0.5 - fraction2 : 0.5, fraction: fraction2, axis: 0.5, reverse: value3 < 0 };
|
|
@@ -39528,7 +39732,7 @@ function dataBarGeometry(value3, low, high, options6) {
|
|
|
39528
39732
|
}
|
|
39529
39733
|
if (hi <= 0) {
|
|
39530
39734
|
const fraction2 = hi > lo ? interpolate2((hi - value3) / (hi - lo), hi === 0 ? minimum / 2 : minimum) : interpolate2(0.5);
|
|
39531
|
-
const axis2 = hi === 0 ? (1 +
|
|
39735
|
+
const axis2 = hi === 0 ? (1 + options7.maxLength - minimum) / 2 : options7.maxLength;
|
|
39532
39736
|
return {
|
|
39533
39737
|
start: axis2 - fraction2,
|
|
39534
39738
|
fraction: fraction2,
|
|
@@ -39536,7 +39740,7 @@ function dataBarGeometry(value3, low, high, options6) {
|
|
|
39536
39740
|
reverse: true
|
|
39537
39741
|
};
|
|
39538
39742
|
}
|
|
39539
|
-
const axis = (1 -
|
|
39743
|
+
const axis = (1 - options7.maxLength + minimum) / 2 + -lo / (hi - lo) * delta;
|
|
39540
39744
|
const bounded = Math.max(lo, Math.min(hi, value3));
|
|
39541
39745
|
const fraction = interpolate2(Math.abs(bounded) / (hi - lo), minimum / 2);
|
|
39542
39746
|
return { start: bounded < 0 ? axis - fraction : axis, fraction, axis, reverse: bounded < 0 };
|
|
@@ -39642,10 +39846,10 @@ function valueText(value3) {
|
|
|
39642
39846
|
|
|
39643
39847
|
// xlsx/layout/cf-evaluator.ts
|
|
39644
39848
|
var GRAPHIC_RULES = /* @__PURE__ */ new Set(["colorScale", "dataBar", "iconSet"]);
|
|
39645
|
-
function createConditionalFormatEvaluator(workbook, sheetIndex2, evaluate,
|
|
39849
|
+
function createConditionalFormatEvaluator(workbook, sheetIndex2, evaluate, options7 = {}) {
|
|
39646
39850
|
const sheet = workbook.sheets[sheetIndex2];
|
|
39647
39851
|
if (!sheet) return { at: () => void 0 };
|
|
39648
|
-
const translate2 =
|
|
39852
|
+
const translate2 = options7.translate ?? translateFormula;
|
|
39649
39853
|
const entries = [];
|
|
39650
39854
|
let order = 0;
|
|
39651
39855
|
for (const format of sheet.conditionalFormats)
|
|
@@ -39665,7 +39869,7 @@ function createConditionalFormatEvaluator(workbook, sheetIndex2, evaluate, optio
|
|
|
39665
39869
|
let todaySerial;
|
|
39666
39870
|
const today = () => {
|
|
39667
39871
|
if (todaySerial !== void 0) return todaySerial;
|
|
39668
|
-
let serial =
|
|
39872
|
+
let serial = options7.today?.();
|
|
39669
39873
|
if (serial === void 0) {
|
|
39670
39874
|
const anchor = { sheet: sheetIndex2, row: 0, col: 0 };
|
|
39671
39875
|
let raw2 = null;
|
|
@@ -39930,14 +40134,14 @@ function* units(raw2) {
|
|
|
39930
40134
|
exp2++;
|
|
39931
40135
|
}
|
|
39932
40136
|
}
|
|
39933
|
-
function niceScale(dataMin, dataMax,
|
|
39934
|
-
const maxIntervals = Math.max(1,
|
|
40137
|
+
function niceScale(dataMin, dataMax, options7 = {}) {
|
|
40138
|
+
const maxIntervals = Math.max(1, options7.maxIntervals ?? 10);
|
|
39935
40139
|
let lo = Number.isFinite(dataMin) ? dataMin : 0;
|
|
39936
40140
|
let hi = Number.isFinite(dataMax) ? dataMax : 0;
|
|
39937
40141
|
if (lo > hi) [lo, hi] = [hi, lo];
|
|
39938
40142
|
if (lo === hi) {
|
|
39939
40143
|
if (lo === 0) hi = 1;
|
|
39940
|
-
else if (
|
|
40144
|
+
else if (options7.noZero) {
|
|
39941
40145
|
const pad7 = Math.abs(lo) * 0.1 || 1;
|
|
39942
40146
|
lo -= pad7;
|
|
39943
40147
|
hi += pad7;
|
|
@@ -39946,7 +40150,7 @@ function niceScale(dataMin, dataMax, options6 = {}) {
|
|
|
39946
40150
|
}
|
|
39947
40151
|
let fixedLo = false;
|
|
39948
40152
|
let fixedHi = false;
|
|
39949
|
-
if (!
|
|
40153
|
+
if (!options7.noZero) {
|
|
39950
40154
|
if (lo >= 0 && hi - lo >= hi / 6) {
|
|
39951
40155
|
lo = 0;
|
|
39952
40156
|
fixedLo = true;
|
|
@@ -39986,6 +40190,202 @@ function formatAxisValue(value3, percent = false) {
|
|
|
39986
40190
|
return `${v < 0 ? "-" : ""}${grouped}${frac ? `.${frac}` : ""}`;
|
|
39987
40191
|
}
|
|
39988
40192
|
|
|
40193
|
+
// chart/axis-range.ts
|
|
40194
|
+
function computeLogValueRange(series, logBase) {
|
|
40195
|
+
const allValues = series.flatMap((item) => item.values).filter((value3) => value3 !== null && Number.isFinite(value3) && value3 > 0);
|
|
40196
|
+
if (allValues.length === 0) {
|
|
40197
|
+
return { min: 1, max: logBase, span: 1, logScale: true, logBase };
|
|
40198
|
+
}
|
|
40199
|
+
const dataMin = Math.min(...allValues);
|
|
40200
|
+
const dataMax = Math.max(...allValues);
|
|
40201
|
+
const logMin = Math.floor(Math.log(dataMin) / Math.log(logBase));
|
|
40202
|
+
const logMax = Math.ceil(Math.log(dataMax) / Math.log(logBase));
|
|
40203
|
+
const min = logBase ** logMin;
|
|
40204
|
+
const max = logBase ** Math.max(logMax, logMin + 1);
|
|
40205
|
+
return {
|
|
40206
|
+
min,
|
|
40207
|
+
max,
|
|
40208
|
+
span: Math.max(Math.log(max) / Math.log(logBase) - Math.log(min) / Math.log(logBase), 1),
|
|
40209
|
+
logScale: true,
|
|
40210
|
+
logBase
|
|
40211
|
+
};
|
|
40212
|
+
}
|
|
40213
|
+
function withAxisBounds(automatic, axis, logBase) {
|
|
40214
|
+
const validMin = typeof axis?.min === "number" && Number.isFinite(axis.min) && (!logBase || axis.min > 0) ? axis.min : void 0;
|
|
40215
|
+
const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
|
|
40216
|
+
const min = validMin ?? automatic.min;
|
|
40217
|
+
let max = validMax ?? automatic.max;
|
|
40218
|
+
const majorUnit = validMin === void 0 && validMax === void 0 ? automatic.majorUnit : void 0;
|
|
40219
|
+
if (max <= min) {
|
|
40220
|
+
max = logBase ? min * logBase : min + 1;
|
|
40221
|
+
}
|
|
40222
|
+
const span4 = logBase ? Math.log(max) / Math.log(logBase) - Math.log(min) / Math.log(logBase) : max - min;
|
|
40223
|
+
return {
|
|
40224
|
+
min,
|
|
40225
|
+
max,
|
|
40226
|
+
span: Math.max(span4, Number.EPSILON),
|
|
40227
|
+
...majorUnit !== void 0 ? { majorUnit } : {},
|
|
40228
|
+
...logBase ? { logScale: true, logBase } : {},
|
|
40229
|
+
...axis?.orientation === "maxMin" ? { reverseOrder: true } : {}
|
|
40230
|
+
};
|
|
40231
|
+
}
|
|
40232
|
+
|
|
40233
|
+
// chart/axis-ticks.ts
|
|
40234
|
+
var LOG_EXPONENT_TOLERANCE = 1e-12;
|
|
40235
|
+
function generateLogTicks(range2) {
|
|
40236
|
+
if (!range2.logScale || !range2.logBase) {
|
|
40237
|
+
return [];
|
|
40238
|
+
}
|
|
40239
|
+
const base = range2.logBase;
|
|
40240
|
+
const logMin = Math.log(range2.min) / Math.log(base);
|
|
40241
|
+
const logMax = Math.log(range2.max) / Math.log(base);
|
|
40242
|
+
const firstExponent = Math.ceil(logMin - LOG_EXPONENT_TOLERANCE);
|
|
40243
|
+
const lastExponent = Math.floor(logMax + LOG_EXPONENT_TOLERANCE);
|
|
40244
|
+
if (lastExponent < firstExponent) {
|
|
40245
|
+
return range2.min === range2.max ? [range2.min] : [range2.min, range2.max];
|
|
40246
|
+
}
|
|
40247
|
+
return Array.from(
|
|
40248
|
+
{ length: lastExponent - firstExponent + 1 },
|
|
40249
|
+
(_unused, index3) => base ** (firstExponent + index3)
|
|
40250
|
+
);
|
|
40251
|
+
}
|
|
40252
|
+
function generateIntervalTicks(range2, unit) {
|
|
40253
|
+
if (!Number.isFinite(unit) || unit <= 0 || range2.logScale) {
|
|
40254
|
+
return [];
|
|
40255
|
+
}
|
|
40256
|
+
const tolerance = Math.max(1, Math.abs(range2.min), Math.abs(range2.max)) * 1e-12;
|
|
40257
|
+
const first2 = Math.ceil((range2.min - tolerance) / unit);
|
|
40258
|
+
const last = Math.floor((range2.max + tolerance) / unit);
|
|
40259
|
+
const count2 = Math.min(Math.max(last - first2 + 1, 0), 2e3);
|
|
40260
|
+
return Array.from({ length: count2 }, (_, index3) => (first2 + index3) * unit);
|
|
40261
|
+
}
|
|
40262
|
+
function generateAxisTicks(range2, axis, defaultIntervals) {
|
|
40263
|
+
if (range2.logScale && range2.logBase) {
|
|
40264
|
+
return generateLogTicks(range2);
|
|
40265
|
+
}
|
|
40266
|
+
const explicit = generateIntervalTicks(range2, axis?.majorUnit ?? 0);
|
|
40267
|
+
if (explicit.length > 0) {
|
|
40268
|
+
return explicit;
|
|
40269
|
+
}
|
|
40270
|
+
const automatic = generateIntervalTicks(range2, range2.majorUnit ?? 0);
|
|
40271
|
+
if (automatic.length > 0) {
|
|
40272
|
+
return automatic;
|
|
40273
|
+
}
|
|
40274
|
+
return Array.from(
|
|
40275
|
+
{ length: defaultIntervals + 1 },
|
|
40276
|
+
(_, index3) => range2.min + range2.span / defaultIntervals * index3
|
|
40277
|
+
);
|
|
40278
|
+
}
|
|
40279
|
+
function generateMinorAxisTicks(range2, axis) {
|
|
40280
|
+
const minor = generateIntervalTicks(range2, axis?.minorUnit ?? 0);
|
|
40281
|
+
if (minor.length === 0) {
|
|
40282
|
+
return [];
|
|
40283
|
+
}
|
|
40284
|
+
const majorUnit = axis?.majorUnit;
|
|
40285
|
+
if (!majorUnit || !Number.isFinite(majorUnit) || majorUnit <= 0) {
|
|
40286
|
+
return minor;
|
|
40287
|
+
}
|
|
40288
|
+
const tolerance = Math.max(1, Math.abs(range2.min), Math.abs(range2.max)) * 1e-10;
|
|
40289
|
+
return minor.filter(
|
|
40290
|
+
(value3) => Math.abs(value3 / majorUnit - Math.round(value3 / majorUnit)) > tolerance
|
|
40291
|
+
);
|
|
40292
|
+
}
|
|
40293
|
+
|
|
40294
|
+
// chart/render/chart-view-axes.ts
|
|
40295
|
+
function chartAxisRatio(value3, scale2, axis) {
|
|
40296
|
+
const range2 = axis?.range;
|
|
40297
|
+
const ratio = range2?.logScale ? Math.log(Math.max(value3, range2.min) / range2.min) / Math.log(range2.max / range2.min) : (value3 - scale2.min) / (scale2.max - scale2.min || 1);
|
|
40298
|
+
return range2?.reverseOrder ? 1 - ratio : ratio;
|
|
40299
|
+
}
|
|
40300
|
+
function chartAxisLabels(axis) {
|
|
40301
|
+
return axis?.source.deleted !== true && axis?.source.tickLabelPosition !== "none";
|
|
40302
|
+
}
|
|
40303
|
+
function options(axis) {
|
|
40304
|
+
return {
|
|
40305
|
+
...axis.scaling,
|
|
40306
|
+
...axis.scaling.logBase === void 0 ? {} : { logScale: true },
|
|
40307
|
+
...axis.majorUnit === void 0 ? {} : { majorUnit: axis.majorUnit },
|
|
40308
|
+
...axis.minorUnit === void 0 ? {} : { minorUnit: axis.minorUnit }
|
|
40309
|
+
};
|
|
40310
|
+
}
|
|
40311
|
+
function applyChartAxes(model, chart, color) {
|
|
40312
|
+
if (!chart.axes?.length) return;
|
|
40313
|
+
const axes2 = chart.axes;
|
|
40314
|
+
const linked = axes2.filter((axis) => axis.id !== void 0 && chart.axisIds?.includes(axis.id));
|
|
40315
|
+
const candidates = linked.length ? linked : axes2;
|
|
40316
|
+
const xy = model.type === "scatter" || model.type === "bubble";
|
|
40317
|
+
const value3 = candidates.find((axis) => axis.kind === "val" && !["b", "t"].includes(axis.position ?? "")) ?? candidates.find((axis) => axis.kind === "val");
|
|
40318
|
+
const category = candidates.find(
|
|
40319
|
+
(axis) => xy ? axis.kind === "val" && axis !== value3 : axis.kind === "cat" || axis.kind === "date"
|
|
40320
|
+
);
|
|
40321
|
+
const secondary = axes2.find((axis) => axis.kind === "val" && axis !== value3 && axis !== category);
|
|
40322
|
+
const paint2 = (shape2) => {
|
|
40323
|
+
const ln2 = shape2?.line;
|
|
40324
|
+
const fill = ln2?.fill;
|
|
40325
|
+
const resolved = fill?.kind === "none" ? "none" : color(fill?.kind === "solid" ? fill.color : void 0);
|
|
40326
|
+
return {
|
|
40327
|
+
...resolved === void 0 ? {} : { color: resolved },
|
|
40328
|
+
...ln2?.widthEmu === void 0 ? {} : { width: ln2.widthEmu / EMU_PER_PIXEL },
|
|
40329
|
+
...ln2?.dash === void 0 ? {} : { dash: ln2.dash }
|
|
40330
|
+
};
|
|
40331
|
+
};
|
|
40332
|
+
const bind = (axis, scale2, values2) => {
|
|
40333
|
+
const opts = options(axis);
|
|
40334
|
+
const automatic = opts.logScale ? computeLogValueRange(
|
|
40335
|
+
[{ values: values2 ?? [] }],
|
|
40336
|
+
opts.logBase && Number.isFinite(opts.logBase) && opts.logBase > 1 ? opts.logBase : 10
|
|
40337
|
+
) : {
|
|
40338
|
+
min: scale2?.min ?? 0,
|
|
40339
|
+
max: scale2?.max ?? 1,
|
|
40340
|
+
span: (scale2?.max ?? 1) - (scale2?.min ?? 0),
|
|
40341
|
+
...scale2 ? { majorUnit: scale2.majorUnit } : {}
|
|
40342
|
+
};
|
|
40343
|
+
const logBase = automatic.logBase;
|
|
40344
|
+
const range2 = withAxisBounds(automatic, opts, logBase);
|
|
40345
|
+
if (scale2) {
|
|
40346
|
+
scale2.min = range2.min;
|
|
40347
|
+
scale2.max = range2.max;
|
|
40348
|
+
scale2.ticks = generateAxisTicks(range2, opts, 5);
|
|
40349
|
+
}
|
|
40350
|
+
return {
|
|
40351
|
+
source: axis,
|
|
40352
|
+
range: range2,
|
|
40353
|
+
minorTicks: generateMinorAxisTicks(range2, opts),
|
|
40354
|
+
line: paint2(axis.spPr),
|
|
40355
|
+
majorGrid: paint2(axis.majorGridlinesSpPr),
|
|
40356
|
+
minorGrid: paint2(axis.minorGridlinesSpPr)
|
|
40357
|
+
};
|
|
40358
|
+
};
|
|
40359
|
+
const out = {};
|
|
40360
|
+
if (value3)
|
|
40361
|
+
out.value = bind(
|
|
40362
|
+
value3,
|
|
40363
|
+
model.valueAxis,
|
|
40364
|
+
[
|
|
40365
|
+
...model.series,
|
|
40366
|
+
...model.extraGroups?.filter((g2) => !g2.secondary).flatMap((g2) => g2.series) ?? []
|
|
40367
|
+
].flatMap((s) => s.values)
|
|
40368
|
+
);
|
|
40369
|
+
if (category)
|
|
40370
|
+
out.category = bind(
|
|
40371
|
+
category,
|
|
40372
|
+
model.xAxis ?? {
|
|
40373
|
+
min: 0,
|
|
40374
|
+
max: Math.max(1, model.categories.length - 1),
|
|
40375
|
+
majorUnit: 1,
|
|
40376
|
+
ticks: []
|
|
40377
|
+
},
|
|
40378
|
+
model.series.flatMap((s) => s.xValues ?? [])
|
|
40379
|
+
);
|
|
40380
|
+
if (secondary)
|
|
40381
|
+
out.secondary = bind(
|
|
40382
|
+
secondary,
|
|
40383
|
+
model.secondaryAxis,
|
|
40384
|
+
model.extraGroups?.filter((g2) => g2.secondary).flatMap((g2) => g2.series.flatMap((s) => s.values))
|
|
40385
|
+
);
|
|
40386
|
+
model.axes = out;
|
|
40387
|
+
}
|
|
40388
|
+
|
|
39989
40389
|
// chart/treemap-squarify.ts
|
|
39990
40390
|
function worstAspectRatio(areas, side) {
|
|
39991
40391
|
const sum3 = areas.reduce((total2, area) => total2 + area, 0);
|
|
@@ -40458,15 +40858,15 @@ function seriesName(series, index3, evaluateRef2) {
|
|
|
40458
40858
|
const fromRef = resolveRef(series.nameRef, evaluateRef2)?.map(toText2).filter((t) => t !== "").join(" ");
|
|
40459
40859
|
return fromRef || series.name || `Series${index3 + 1}`;
|
|
40460
40860
|
}
|
|
40461
|
-
function seriesContext(chart, theme2,
|
|
40861
|
+
function seriesContext(chart, theme2, options7) {
|
|
40462
40862
|
const scheme = chartColorScheme(theme2);
|
|
40463
40863
|
const resolver = { scheme: (name) => scheme[name] };
|
|
40464
40864
|
return {
|
|
40465
40865
|
theme: theme2,
|
|
40466
40866
|
scheme,
|
|
40467
40867
|
palette: chart.colorPalette === void 0 ? void 0 : findChartColorPalette(chart.colorPalette),
|
|
40468
|
-
evaluateRef:
|
|
40469
|
-
seriesColor:
|
|
40868
|
+
evaluateRef: options7.evaluateRef ?? (() => []),
|
|
40869
|
+
seriesColor: options7.seriesColor,
|
|
40470
40870
|
drawingColor: (color) => color && drawingColorCss(resolveDrawingColor(color, resolver, { transformOrder: "document" })),
|
|
40471
40871
|
gradient: (fill) => fill?.kind === "gradient" ? resolveChartGradient(
|
|
40472
40872
|
fill,
|
|
@@ -40492,7 +40892,11 @@ function seriesView(ctx, s, index3, total2, categoriesOf) {
|
|
|
40492
40892
|
})
|
|
40493
40893
|
);
|
|
40494
40894
|
if (Object.keys(points).length) view.pointGradients = points;
|
|
40495
|
-
Object.assign(
|
|
40895
|
+
Object.assign(
|
|
40896
|
+
view,
|
|
40897
|
+
analysisView(s, color, ctx.drawingColor),
|
|
40898
|
+
seriesMarkerViews(s, ctx.drawingColor)
|
|
40899
|
+
);
|
|
40496
40900
|
return view;
|
|
40497
40901
|
}
|
|
40498
40902
|
|
|
@@ -40798,14 +41202,14 @@ function scottBinCount(values2, min, max) {
|
|
|
40798
41202
|
const width = 3.49 * sd * values2.length ** (-1 / 3);
|
|
40799
41203
|
return Math.max(1, Math.ceil((max - min) / width));
|
|
40800
41204
|
}
|
|
40801
|
-
function computeHistogramBins(values2,
|
|
40802
|
-
const closed =
|
|
41205
|
+
function computeHistogramBins(values2, options7, format = String) {
|
|
41206
|
+
const closed = options7.intervalClosed ?? "l";
|
|
40803
41207
|
const finite2 = values2.map((value3, sourceIndex) => ({ value: value3, sourceIndex })).filter((item) => Number.isFinite(item.value));
|
|
40804
41208
|
if (finite2.length === 0) {
|
|
40805
41209
|
return [];
|
|
40806
41210
|
}
|
|
40807
|
-
const underflow = typeof
|
|
40808
|
-
const overflow = typeof
|
|
41211
|
+
const underflow = typeof options7.underflow === "number" ? options7.underflow : void 0;
|
|
41212
|
+
const overflow = typeof options7.overflow === "number" ? options7.overflow : void 0;
|
|
40809
41213
|
const under = underflow === void 0 ? [] : finite2.filter(
|
|
40810
41214
|
(item) => closed === "r" ? item.value <= underflow : item.value < underflow
|
|
40811
41215
|
);
|
|
@@ -40822,8 +41226,8 @@ function computeHistogramBins(values2, options6, format = String) {
|
|
|
40822
41226
|
if (regular.length > 0) {
|
|
40823
41227
|
const min = Math.min(...regular.map((item) => item.value));
|
|
40824
41228
|
const max = Math.max(...regular.map((item) => item.value));
|
|
40825
|
-
const requestedSize =
|
|
40826
|
-
const requestedCount =
|
|
41229
|
+
const requestedSize = options7.binSize && options7.binSize > 0 ? options7.binSize : void 0;
|
|
41230
|
+
const requestedCount = options7.binCount && options7.binCount > 0 ? options7.binCount : void 0;
|
|
40827
41231
|
const start = requestedSize ? Math.floor(min / requestedSize) * requestedSize : min;
|
|
40828
41232
|
const count2 = requestedSize ? Math.max(
|
|
40829
41233
|
closed === "l" ? Math.floor((max - start) / requestedSize) + 1 : Math.ceil((max - start) / requestedSize),
|
|
@@ -40874,9 +41278,9 @@ function aggregateByCategory(values2, rawCategories) {
|
|
|
40874
41278
|
}
|
|
40875
41279
|
|
|
40876
41280
|
// chart/waterfall.ts
|
|
40877
|
-
function buildWaterfallSteps(values2,
|
|
41281
|
+
function buildWaterfallSteps(values2, options7) {
|
|
40878
41282
|
const subtotalIndices = new Set(
|
|
40879
|
-
|
|
41283
|
+
options7?.subtotalIndices ?? (values2.length > 0 ? [values2.length - 1] : [])
|
|
40880
41284
|
);
|
|
40881
41285
|
const steps = [];
|
|
40882
41286
|
let runningTotal = 0;
|
|
@@ -40960,11 +41364,11 @@ function histogramView(chart, model) {
|
|
|
40960
41364
|
const first2 = model.series[0];
|
|
40961
41365
|
if (!first2) return;
|
|
40962
41366
|
const raw2 = first2.values.map((v) => v ?? Number.NaN);
|
|
40963
|
-
const
|
|
40964
|
-
const bins =
|
|
41367
|
+
const options7 = chart.histogram ?? {};
|
|
41368
|
+
const bins = options7.aggregateByCategory ? aggregateByCategory(
|
|
40965
41369
|
first2.values.map((v) => v ?? 0),
|
|
40966
41370
|
model.categories
|
|
40967
|
-
) : computeHistogramBins(raw2,
|
|
41371
|
+
) : computeHistogramBins(raw2, options7, formatAxisValue);
|
|
40968
41372
|
model.categories = bins.map((bin) => bin.label);
|
|
40969
41373
|
first2.values = bins.map((bin) => bin.value);
|
|
40970
41374
|
model.barGapWidth = 0;
|
|
@@ -40988,11 +41392,11 @@ var SUPPORTED = /* @__PURE__ */ new Set([
|
|
|
40988
41392
|
"treemap",
|
|
40989
41393
|
"sunburst"
|
|
40990
41394
|
]);
|
|
40991
|
-
function chartSummaryView(chart, theme2,
|
|
41395
|
+
function chartSummaryView(chart, theme2, options7 = {}) {
|
|
40992
41396
|
const type = chart.chartType;
|
|
40993
41397
|
const radial = type === "pie" || type === "doughnut";
|
|
40994
41398
|
const byPoint = radial || type === "treemap" || type === "sunburst";
|
|
40995
|
-
const ctx = seriesContext(chart, theme2,
|
|
41399
|
+
const ctx = seriesContext(chart, theme2, options7);
|
|
40996
41400
|
const { palette, scheme, drawingColor } = ctx;
|
|
40997
41401
|
const grouping = chart.grouping ?? (type === "bar" || type === "column" ? "clustered" : "standard");
|
|
40998
41402
|
const rawCategories = [];
|
|
@@ -41078,6 +41482,7 @@ function chartSummaryView(chart, theme2, options6 = {}) {
|
|
|
41078
41482
|
else if (!byPoint) model.valueAxis = valueAxis(model);
|
|
41079
41483
|
applyDataLabels(model, chart.series, extra);
|
|
41080
41484
|
chartExtraAxes(model);
|
|
41485
|
+
applyChartAxes(model, chart, ctx.drawingColor);
|
|
41081
41486
|
return model;
|
|
41082
41487
|
}
|
|
41083
41488
|
|
|
@@ -41109,18 +41514,18 @@ function chartSampleVariance(values2) {
|
|
|
41109
41514
|
const mean2 = values2.reduce((sum3, value3) => sum3 + value3, 0) / count2;
|
|
41110
41515
|
return values2.reduce((sum3, value3) => sum3 + (value3 - mean2) ** 2, 0) / Math.max(count2 - 1, 1);
|
|
41111
41516
|
}
|
|
41112
|
-
function chartErrorBarAmount(
|
|
41113
|
-
switch (
|
|
41517
|
+
function chartErrorBarAmount(options7, values2, displayIndex, sourceIndex, side) {
|
|
41518
|
+
switch (options7.valueType) {
|
|
41114
41519
|
case "fixedVal":
|
|
41115
|
-
return
|
|
41520
|
+
return options7.value ?? 0;
|
|
41116
41521
|
case "percentage":
|
|
41117
|
-
return Math.abs(values2[displayIndex] ?? 0) * ((
|
|
41522
|
+
return Math.abs(values2[displayIndex] ?? 0) * ((options7.value ?? 0) / 100);
|
|
41118
41523
|
case "stdDev":
|
|
41119
|
-
return Math.sqrt(chartSampleVariance(values2)) * (
|
|
41524
|
+
return Math.sqrt(chartSampleVariance(values2)) * (options7.value ?? 1);
|
|
41120
41525
|
case "stdErr":
|
|
41121
41526
|
return Math.sqrt(chartSampleVariance(values2) / Math.max(values2.length, 1));
|
|
41122
41527
|
case "cust":
|
|
41123
|
-
return side === "plus" ?
|
|
41528
|
+
return side === "plus" ? options7.customPlus?.[sourceIndex] ?? 0 : options7.customMinus?.[sourceIndex] ?? 0;
|
|
41124
41529
|
}
|
|
41125
41530
|
}
|
|
41126
41531
|
|
|
@@ -41257,13 +41662,13 @@ var noFit = () => ({
|
|
|
41257
41662
|
rSquared: 0,
|
|
41258
41663
|
coefficients: []
|
|
41259
41664
|
});
|
|
41260
|
-
function fitModel(
|
|
41665
|
+
function fitModel(options7, xVals, yVals) {
|
|
41261
41666
|
const xs = [...xVals];
|
|
41262
41667
|
const ys = [...yVals];
|
|
41263
|
-
switch (
|
|
41668
|
+
switch (options7.kind) {
|
|
41264
41669
|
case "linear": {
|
|
41265
41670
|
const reg = computeLinearRegression(xs, ys);
|
|
41266
|
-
const fixed2 =
|
|
41671
|
+
const fixed2 = options7.intercept;
|
|
41267
41672
|
const slope = fixed2 !== void 0 ? ys.reduce((s, y, i2) => s + (y - fixed2) * xs[i2], 0) / xs.reduce((s, x) => s + x * x, 0) : reg.slope;
|
|
41268
41673
|
const b = fixed2 ?? reg.intercept;
|
|
41269
41674
|
return {
|
|
@@ -41313,7 +41718,7 @@ function fitModel(options6, xVals, yVals) {
|
|
|
41313
41718
|
};
|
|
41314
41719
|
}
|
|
41315
41720
|
case "polynomial": {
|
|
41316
|
-
const order = Math.min(
|
|
41721
|
+
const order = Math.min(options7.order ?? 2, 6);
|
|
41317
41722
|
const coeffs = fitPolynomial(xs, ys, order);
|
|
41318
41723
|
const evaluate = (x) => coeffs.reduce((s, c2, i2) => s + c2 * x ** i2, 0);
|
|
41319
41724
|
return {
|
|
@@ -41327,11 +41732,11 @@ function fitModel(options6, xVals, yVals) {
|
|
|
41327
41732
|
return void 0;
|
|
41328
41733
|
}
|
|
41329
41734
|
}
|
|
41330
|
-
function fitChartTrendline(
|
|
41735
|
+
function fitChartTrendline(options7, xVals, yVals) {
|
|
41331
41736
|
const count2 = yVals.length;
|
|
41332
41737
|
if (count2 < 2) return noFit();
|
|
41333
|
-
if (
|
|
41334
|
-
const period =
|
|
41738
|
+
if (options7.kind === "movingAvg") {
|
|
41739
|
+
const period = options7.period ?? 2;
|
|
41335
41740
|
const points2 = [];
|
|
41336
41741
|
for (let i2 = period - 1; i2 < count2; i2++) {
|
|
41337
41742
|
let sum3 = 0;
|
|
@@ -41340,10 +41745,10 @@ function fitChartTrendline(options6, xVals, yVals) {
|
|
|
41340
41745
|
}
|
|
41341
41746
|
return { points: points2, equation: `${period}-period moving average`, rSquared: 0, coefficients: [] };
|
|
41342
41747
|
}
|
|
41343
|
-
const model = fitModel(
|
|
41748
|
+
const model = fitModel(options7, xVals, yVals);
|
|
41344
41749
|
if (!model) return noFit();
|
|
41345
|
-
const startX = Math.min(...xVals) - (
|
|
41346
|
-
const endX = Math.max(...xVals) + (
|
|
41750
|
+
const startX = Math.min(...xVals) - (options7.backward ?? 0);
|
|
41751
|
+
const endX = Math.max(...xVals) + (options7.forward ?? 0);
|
|
41347
41752
|
const steps = Math.max(Math.ceil((endX - startX) * 4), 20);
|
|
41348
41753
|
const points = [];
|
|
41349
41754
|
for (let step = 0; step <= steps; step++) {
|
|
@@ -41520,7 +41925,7 @@ function chartTextAttributes(model, part, fallbackSize = FONT_SIZE) {
|
|
|
41520
41925
|
function chartStroke(model, part) {
|
|
41521
41926
|
const entry3 = model.appearance?.[part];
|
|
41522
41927
|
return {
|
|
41523
|
-
color: entry3?.axisVisible === false ? "none" : entry3?.lineColor ?? (part
|
|
41928
|
+
color: entry3?.axisVisible === false ? "none" : entry3?.lineColor ?? (part.startsWith("gridline") ? GRID_COLOR : AXIS_COLOR),
|
|
41524
41929
|
width: entry3?.lineWidth === void 0 ? 1 : chartPointsToPixels(entry3.lineWidth)
|
|
41525
41930
|
};
|
|
41526
41931
|
}
|
|
@@ -41811,19 +42216,102 @@ function scatterAnalysis(model, px, py, out) {
|
|
|
41811
42216
|
});
|
|
41812
42217
|
}
|
|
41813
42218
|
|
|
42219
|
+
// chart/render/chart-svg-markers.ts
|
|
42220
|
+
function chartMarkerRadius(series, index3, defaultRadius = 3) {
|
|
42221
|
+
const marker3 = { ...series.marker, ...series.pointMarkers?.[index3] };
|
|
42222
|
+
if (marker3.symbol === "none") return 0;
|
|
42223
|
+
const radius = markerRadius(marker3.size, defaultRadius);
|
|
42224
|
+
return marker3.symbol === "dot" ? Math.max(radius * 0.6, 1) : radius;
|
|
42225
|
+
}
|
|
42226
|
+
function chartSeriesMarkerSvg(series, index3, cx2, cy, defaultRadius = 3) {
|
|
42227
|
+
const marker3 = { ...series.marker, ...series.pointMarkers?.[index3] };
|
|
42228
|
+
const primitive = buildMarkerPrimitive({
|
|
42229
|
+
...marker3,
|
|
42230
|
+
symbol: marker3.symbol,
|
|
42231
|
+
size: marker3.size,
|
|
42232
|
+
cx: cx2,
|
|
42233
|
+
cy,
|
|
42234
|
+
fill: marker3.fill ?? series.pointColors?.[index3] ?? series.color,
|
|
42235
|
+
defaultRadius
|
|
42236
|
+
});
|
|
42237
|
+
if (!primitive) return "";
|
|
42238
|
+
let geometry;
|
|
42239
|
+
switch (primitive.kind) {
|
|
42240
|
+
case "circle":
|
|
42241
|
+
geometry = `cx="${n(primitive.cx)}" cy="${n(primitive.cy)}" r="${n(primitive.r)}"`;
|
|
42242
|
+
break;
|
|
42243
|
+
case "rect":
|
|
42244
|
+
geometry = `x="${n(primitive.x)}" y="${n(primitive.y)}" width="${n(primitive.w)}" height="${n(primitive.h)}"`;
|
|
42245
|
+
break;
|
|
42246
|
+
case "path":
|
|
42247
|
+
geometry = `d="${esc(primitive.d)}"`;
|
|
42248
|
+
break;
|
|
42249
|
+
case "polygon":
|
|
42250
|
+
geometry = `points="${esc(primitive.points)}"`;
|
|
42251
|
+
break;
|
|
42252
|
+
}
|
|
42253
|
+
const outline = primitive.stroke ? ` stroke="${esc(primitive.stroke)}" stroke-width="${n(primitive.strokeWidth ?? 1)}"` : "";
|
|
42254
|
+
const filter2 = series.shadowFilter ? ` filter="${esc(series.shadowFilter)}"` : "";
|
|
42255
|
+
return `<${primitive.kind} ${geometry} fill="${esc(primitive.fill)}"${outline}${filter2}/>`;
|
|
42256
|
+
}
|
|
42257
|
+
|
|
42258
|
+
// chart/line-dash.ts
|
|
42259
|
+
function chartLineDashArray(style3, width) {
|
|
42260
|
+
if (!style3 || style3 === "solid") {
|
|
42261
|
+
return void 0;
|
|
42262
|
+
}
|
|
42263
|
+
const unit = Math.max(width, 1);
|
|
42264
|
+
if (style3 === "dot" || style3 === "sysDot") {
|
|
42265
|
+
return `${unit} ${unit * 2}`;
|
|
42266
|
+
}
|
|
42267
|
+
if (style3 === "lgDash") {
|
|
42268
|
+
return `${unit * 6} ${unit * 3}`;
|
|
42269
|
+
}
|
|
42270
|
+
return `${unit * 3} ${unit * 2}`;
|
|
42271
|
+
}
|
|
42272
|
+
|
|
42273
|
+
// chart/render/chart-svg-axes.ts
|
|
42274
|
+
function axisTickText(value3, axis, percent = false) {
|
|
42275
|
+
return formatChartNumber(value3, axis?.source.numberFormat?.formatCode) ?? formatAxisValue(value3, percent);
|
|
42276
|
+
}
|
|
42277
|
+
function axisLine(model, axis, part, x1, y1, x2, y2) {
|
|
42278
|
+
if (axis?.source.deleted) return "";
|
|
42279
|
+
return styledAxisLine(x1, y1, x2, y2, axis?.line, chartStroke(model, part));
|
|
42280
|
+
}
|
|
42281
|
+
function styledAxisLine(x1, y1, x2, y2, paint2, fallback) {
|
|
42282
|
+
const color = paint2?.color ?? fallback.color;
|
|
42283
|
+
const width = paint2?.width ?? fallback.width;
|
|
42284
|
+
if (color === "none" || width === 0) return "";
|
|
42285
|
+
const dash = chartLineDashArray(paint2?.dash, width);
|
|
42286
|
+
return line2(x1, y1, x2, y2, esc(color), width).replace(
|
|
42287
|
+
"/>",
|
|
42288
|
+
dash ? ` stroke-dasharray="${dash}"/>` : "/>"
|
|
42289
|
+
);
|
|
42290
|
+
}
|
|
42291
|
+
function axisGridlines(model, axis, ticks, position, plot2, vertical2) {
|
|
42292
|
+
const draw2 = (values2, paint2, minor2) => {
|
|
42293
|
+
const fallback = chartStroke(model, minor2 ? "gridlineMinor" : "gridlineMajor");
|
|
42294
|
+
return values2.map((value3) => {
|
|
42295
|
+
const p = position(value3);
|
|
42296
|
+
return vertical2 ? styledAxisLine(p, plot2.y, p, plot2.y + plot2.h, paint2, fallback) : styledAxisLine(plot2.x, p, plot2.x + plot2.w, p, paint2, fallback);
|
|
42297
|
+
}).join("");
|
|
42298
|
+
};
|
|
42299
|
+
const major = !axis || axis.source.majorGridlines ? draw2(ticks, axis?.majorGrid, false) : "";
|
|
42300
|
+
const minor = axis?.source.minorGridlines ? draw2(axis.minorTicks, axis.minorGrid, true) : "";
|
|
42301
|
+
return major + minor;
|
|
42302
|
+
}
|
|
42303
|
+
|
|
41814
42304
|
// chart/render/chart-svg-cartesian.ts
|
|
41815
42305
|
function cartesianAxes(model, area, out) {
|
|
41816
42306
|
const scale2 = model.valueAxis;
|
|
41817
42307
|
if (!scale2) return void 0;
|
|
41818
|
-
const labels = scale2.ticks.map((t) =>
|
|
42308
|
+
const labels = scale2.ticks.map((t) => axisTickText(t, model.axes?.value, scale2.percent));
|
|
41819
42309
|
const valueAttrs = chartTextAttributes(model, "valueAxis");
|
|
41820
42310
|
const categoryAttrs = chartTextAttributes(model, "categoryAxis");
|
|
41821
42311
|
const valueSize = valueAttrs.size ?? 10;
|
|
41822
42312
|
const categorySize = categoryAttrs.size ?? 10;
|
|
41823
|
-
const
|
|
41824
|
-
const
|
|
41825
|
-
const valueLabels = model.appearance?.valueAxis?.labelsVisible !== false;
|
|
41826
|
-
const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
|
|
42313
|
+
const valueLabels = chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false;
|
|
42314
|
+
const categoryLabels = chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
|
|
41827
42315
|
const labelW = valueLabels ? Math.max(...labels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
|
|
41828
42316
|
const horizontal2 = model.horizontal;
|
|
41829
42317
|
const cats = Math.max(1, model.categories.length);
|
|
@@ -41832,7 +42320,7 @@ function cartesianAxes(model, area, out) {
|
|
|
41832
42320
|
Math.max(...model.categories.map((c2) => textWidth(c2, categorySize)), 8) + 6
|
|
41833
42321
|
);
|
|
41834
42322
|
const second = horizontal2 ? void 0 : model.secondaryAxis;
|
|
41835
|
-
const secondLabels = second?.ticks.map((t) =>
|
|
42323
|
+
const secondLabels = second?.ticks.map((t) => axisTickText(t, model.axes?.secondary, second.percent)) ?? [];
|
|
41836
42324
|
const secondW = second ? valueLabels ? Math.max(...secondLabels.map((l) => textWidth(l, valueSize)), 8) + 8 : 4 : 0;
|
|
41837
42325
|
const plot2 = horizontal2 ? {
|
|
41838
42326
|
x: area.x + catW,
|
|
@@ -41845,29 +42333,47 @@ function cartesianAxes(model, area, out) {
|
|
|
41845
42333
|
w: Math.max(1, area.w - labelW - 4 - secondW),
|
|
41846
42334
|
h: Math.max(1, area.h - Math.max(20, categorySize * 1.5))
|
|
41847
42335
|
};
|
|
41848
|
-
const
|
|
41849
|
-
const value3 = horizontal2 ? (v) => plot2.x + (v - scale2.min) / span4 * plot2.w : (v) => plot2.y + plot2.h - (v - scale2.min) / span4 * plot2.h;
|
|
42336
|
+
const value3 = horizontal2 ? (v) => plot2.x + chartAxisRatio(v, scale2, model.axes?.value) * plot2.w : (v) => plot2.y + plot2.h - chartAxisRatio(v, scale2, model.axes?.value) * plot2.h;
|
|
41850
42337
|
const bandSize = (horizontal2 ? plot2.h : plot2.w) / cats;
|
|
41851
|
-
const
|
|
42338
|
+
const index3 = (i2) => model.axes?.category?.range.reverseOrder ? cats - 1 - i2 : i2;
|
|
42339
|
+
const band = horizontal2 ? (i2) => plot2.y + plot2.h - bandSize * (index3(i2) + 0.5) : (i2) => plot2.x + bandSize * (index3(i2) + 0.5);
|
|
41852
42340
|
out.push(chartAreaRect(model, "plotArea", plot2));
|
|
42341
|
+
out.push(axisGridlines(model, model.axes?.value, scale2.ticks, value3, plot2, horizontal2));
|
|
42342
|
+
if (model.axes?.category?.source.majorGridlines || model.axes?.category?.source.minorGridlines)
|
|
42343
|
+
out.push(
|
|
42344
|
+
axisGridlines(
|
|
42345
|
+
model,
|
|
42346
|
+
model.axes.category,
|
|
42347
|
+
model.categories.map((_, i2) => i2),
|
|
42348
|
+
band,
|
|
42349
|
+
plot2,
|
|
42350
|
+
!horizontal2
|
|
42351
|
+
)
|
|
42352
|
+
);
|
|
41853
42353
|
scale2.ticks.forEach((t, i2) => {
|
|
41854
42354
|
const p = value3(t);
|
|
41855
42355
|
const label2 = labels[i2] ?? "";
|
|
41856
42356
|
if (horizontal2) {
|
|
41857
|
-
out.push(line2(p, plot2.y, p, plot2.y + plot2.h, grid6.color, grid6.width));
|
|
41858
42357
|
if (valueLabels)
|
|
41859
42358
|
out.push(
|
|
41860
42359
|
text3(p, plot2.y + plot2.h + valueSize + 2, label2, { anchor: "middle", ...valueAttrs })
|
|
41861
42360
|
);
|
|
41862
42361
|
} else {
|
|
41863
|
-
out.push(line2(plot2.x, p, plot2.x + plot2.w, p, grid6.color, grid6.width));
|
|
41864
42362
|
if (valueLabels)
|
|
41865
42363
|
out.push(text3(plot2.x - 4, p + valueSize * 0.3, label2, { anchor: "end", ...valueAttrs }));
|
|
41866
42364
|
}
|
|
41867
42365
|
});
|
|
41868
|
-
const
|
|
41869
|
-
|
|
41870
|
-
|
|
42366
|
+
const source2 = model.axes?.value?.source;
|
|
42367
|
+
const crossing = source2?.crosses === "max" ? scale2.max : source2?.crosses === "min" ? scale2.min : source2?.crossesAt ?? 0;
|
|
42368
|
+
const zero = value3(Math.min(Math.max(crossing, scale2.min), scale2.max));
|
|
42369
|
+
if (horizontal2)
|
|
42370
|
+
out.push(
|
|
42371
|
+
axisLine(model, model.axes?.category, "categoryAxis", zero, plot2.y, zero, plot2.y + plot2.h)
|
|
42372
|
+
);
|
|
42373
|
+
else
|
|
42374
|
+
out.push(
|
|
42375
|
+
axisLine(model, model.axes?.category, "categoryAxis", plot2.x, zero, plot2.x + plot2.w, zero)
|
|
42376
|
+
);
|
|
41871
42377
|
const step = Math.max(
|
|
41872
42378
|
1,
|
|
41873
42379
|
Math.ceil(cats / Math.max(1, Math.floor((horizontal2 ? plot2.h : plot2.w) / 14)))
|
|
@@ -41892,20 +42398,23 @@ function cartesianAxes(model, area, out) {
|
|
|
41892
42398
|
});
|
|
41893
42399
|
const frame = { plot: plot2, value: value3, band, bandSize };
|
|
41894
42400
|
if (second) {
|
|
41895
|
-
|
|
41896
|
-
frame.secondary = (v) => plot2.y + plot2.h - (v - second.min) / secondSpan * plot2.h;
|
|
41897
|
-
const secondAxis = chartStroke(model, "valueAxis");
|
|
42401
|
+
frame.secondary = (v) => plot2.y + plot2.h - chartAxisRatio(v, second, model.axes?.secondary) * plot2.h;
|
|
41898
42402
|
out.push(
|
|
41899
|
-
|
|
42403
|
+
axisLine(
|
|
42404
|
+
model,
|
|
42405
|
+
model.axes?.secondary,
|
|
42406
|
+
"valueAxis",
|
|
41900
42407
|
plot2.x + plot2.w,
|
|
41901
42408
|
plot2.y,
|
|
41902
42409
|
plot2.x + plot2.w,
|
|
41903
|
-
plot2.y + plot2.h
|
|
41904
|
-
secondAxis.color,
|
|
41905
|
-
secondAxis.width
|
|
42410
|
+
plot2.y + plot2.h
|
|
41906
42411
|
)
|
|
41907
42412
|
);
|
|
41908
|
-
if (
|
|
42413
|
+
if (model.axes?.secondary?.source.majorGridlines || model.axes?.secondary?.source.minorGridlines)
|
|
42414
|
+
out.push(
|
|
42415
|
+
axisGridlines(model, model.axes.secondary, second.ticks, frame.secondary, plot2, false)
|
|
42416
|
+
);
|
|
42417
|
+
if (chartAxisLabels(model.axes?.secondary))
|
|
41909
42418
|
second.ticks.forEach(
|
|
41910
42419
|
(t, i2) => out.push(
|
|
41911
42420
|
text3(plot2.x + plot2.w + 4, frame.secondary(t) + valueSize * 0.3, secondLabels[i2] ?? "", {
|
|
@@ -41949,18 +42458,19 @@ function linesAndAreas(model, frame, out) {
|
|
|
41949
42458
|
index: i2,
|
|
41950
42459
|
x: frame.band(i2),
|
|
41951
42460
|
y: frame.value(top),
|
|
41952
|
-
radius: area ? 0 :
|
|
42461
|
+
radius: area ? 0 : chartMarkerRadius(s, i2, 2.5)
|
|
41953
42462
|
});
|
|
41954
42463
|
lower3.push([frame.band(i2), frame.value(below)]);
|
|
41955
42464
|
});
|
|
41956
42465
|
layers.push({
|
|
42466
|
+
series: s,
|
|
41957
42467
|
points,
|
|
41958
42468
|
lower: lower3,
|
|
41959
42469
|
color: s.color,
|
|
41960
42470
|
filter: s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""
|
|
41961
42471
|
});
|
|
41962
42472
|
});
|
|
41963
|
-
for (const { points, lower: lower3, color, filter: filter2 } of area ? [...layers].reverse() : layers) {
|
|
42473
|
+
for (const { points, lower: lower3, color, filter: filter2, series } of area ? [...layers].reverse() : layers) {
|
|
41964
42474
|
if (area) {
|
|
41965
42475
|
const poly = [...points, ...[...lower3].reverse()].map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
|
|
41966
42476
|
out.push(`<polygon points="${poly}" fill="${color}" fill-opacity="0.85"${filter2}/>`);
|
|
@@ -41979,20 +42489,20 @@ function linesAndAreas(model, frame, out) {
|
|
|
41979
42489
|
else segment2.push(`${n(x)},${n(y)}`);
|
|
41980
42490
|
}
|
|
41981
42491
|
flush();
|
|
41982
|
-
|
|
41983
|
-
if (!Number.isNaN(x))
|
|
41984
|
-
|
|
42492
|
+
points.forEach(([x, y], index3) => {
|
|
42493
|
+
if (!Number.isNaN(x)) out.push(chartSeriesMarkerSvg(series, index3, x, y, 2.5));
|
|
42494
|
+
});
|
|
41985
42495
|
}
|
|
41986
42496
|
pointLabels(model, marks, out);
|
|
41987
42497
|
}
|
|
41988
42498
|
|
|
41989
42499
|
// chart/bubble-radius.ts
|
|
41990
|
-
function computeBubbleRadius(sizeVal, maxBubble, medianRadius,
|
|
41991
|
-
const scale2 = (
|
|
42500
|
+
function computeBubbleRadius(sizeVal, maxBubble, medianRadius, options7) {
|
|
42501
|
+
const scale2 = (options7?.bubbleScale ?? 100) / 100;
|
|
41992
42502
|
if (sizeVal === void 0) return medianRadius * scale2;
|
|
41993
42503
|
const denom = maxBubble > 0 ? maxBubble : 1;
|
|
41994
42504
|
const magnitude = Math.abs(sizeVal);
|
|
41995
|
-
const ratio = (
|
|
42505
|
+
const ratio = (options7?.sizeRepresents ?? "w") === "area" ? Math.sqrt(magnitude) / Math.sqrt(denom) : magnitude / denom;
|
|
41996
42506
|
return medianRadius * scale2 * 0.5 + ratio * medianRadius * scale2 * 1.5;
|
|
41997
42507
|
}
|
|
41998
42508
|
function maxBubbleSize(sizes) {
|
|
@@ -42007,16 +42517,14 @@ function scatter(model, area, out) {
|
|
|
42007
42517
|
const ys = model.valueAxis;
|
|
42008
42518
|
const xs = model.xAxis;
|
|
42009
42519
|
if (!ys || !xs) return;
|
|
42010
|
-
const yLabels = ys.ticks.map((t) =>
|
|
42520
|
+
const yLabels = ys.ticks.map((t) => axisTickText(t, model.axes?.value));
|
|
42011
42521
|
const valueAttrs = chartTextAttributes(model, "valueAxis");
|
|
42012
42522
|
const categoryAttrs = chartTextAttributes(model, "categoryAxis");
|
|
42013
42523
|
const valueSize = valueAttrs.size ?? 10;
|
|
42014
42524
|
const categorySize = categoryAttrs.size ?? 10;
|
|
42015
|
-
const grid6 = chartStroke(model, "gridlineMajor");
|
|
42016
42525
|
const xAxis = chartStroke(model, "categoryAxis");
|
|
42017
|
-
const
|
|
42018
|
-
const
|
|
42019
|
-
const categoryLabels = model.appearance?.categoryAxis?.labelsVisible !== false;
|
|
42526
|
+
const valueLabels = chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false;
|
|
42527
|
+
const categoryLabels = chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false;
|
|
42020
42528
|
const labelW = valueLabels ? Math.max(...yLabels.map((l) => textWidth(l, valueSize)), 8) + 6 : 4;
|
|
42021
42529
|
const plot2 = {
|
|
42022
42530
|
x: area.x + labelW,
|
|
@@ -42036,17 +42544,24 @@ function scatter(model, area, out) {
|
|
|
42036
42544
|
s.values.forEach((_, i2) => {
|
|
42037
42545
|
reach = Math.max(reach, radiusOf(s.sizes?.[i2] ?? void 0) ?? 0);
|
|
42038
42546
|
});
|
|
42039
|
-
const widen = (s, length) => {
|
|
42547
|
+
const widen = (s, length, axis) => {
|
|
42548
|
+
if (axis?.range.logScale) return s;
|
|
42040
42549
|
const pad7 = reach * (s.max - s.min || 1) / Math.max(1, length - 2 * reach);
|
|
42041
|
-
return {
|
|
42550
|
+
return {
|
|
42551
|
+
...s,
|
|
42552
|
+
min: axis?.source.scaling.min === void 0 ? s.min - pad7 : s.min,
|
|
42553
|
+
max: axis?.source.scaling.max === void 0 ? s.max + pad7 : s.max
|
|
42554
|
+
};
|
|
42042
42555
|
};
|
|
42043
|
-
const xView = widen(xs, plot2.w);
|
|
42044
|
-
const yView = widen(ys, plot2.h);
|
|
42045
|
-
const px = (v) => plot2.x + (v
|
|
42046
|
-
const py = (v) => plot2.y + plot2.h - (v
|
|
42556
|
+
const xView = widen(xs, plot2.w, model.axes?.category);
|
|
42557
|
+
const yView = widen(ys, plot2.h, model.axes?.value);
|
|
42558
|
+
const px = (v) => plot2.x + chartAxisRatio(v, xView, model.axes?.category) * plot2.w;
|
|
42559
|
+
const py = (v) => plot2.y + plot2.h - chartAxisRatio(v, yView, model.axes?.value) * plot2.h;
|
|
42047
42560
|
out.push(chartAreaRect(model, "plotArea", plot2));
|
|
42561
|
+
out.push(axisGridlines(model, model.axes?.value, ys.ticks, py, plot2, false));
|
|
42562
|
+
if (model.axes?.category)
|
|
42563
|
+
out.push(axisGridlines(model, model.axes.category, xs.ticks, px, plot2, true));
|
|
42048
42564
|
ys.ticks.forEach((t, i2) => {
|
|
42049
|
-
out.push(line2(plot2.x, py(t), plot2.x + plot2.w, py(t), grid6.color, grid6.width));
|
|
42050
42565
|
if (valueLabels)
|
|
42051
42566
|
out.push(
|
|
42052
42567
|
text3(plot2.x - 4, py(t) + valueSize * 0.3, yLabels[i2] ?? "", {
|
|
@@ -42056,19 +42571,30 @@ function scatter(model, area, out) {
|
|
|
42056
42571
|
);
|
|
42057
42572
|
});
|
|
42058
42573
|
for (const t of xs.ticks) {
|
|
42059
|
-
|
|
42574
|
+
if (!model.axes?.category?.source.deleted)
|
|
42575
|
+
out.push(line2(px(t), plot2.y + plot2.h, px(t), plot2.y + plot2.h + 3, xAxis.color, xAxis.width));
|
|
42060
42576
|
if (categoryLabels)
|
|
42061
42577
|
out.push(
|
|
42062
|
-
text3(px(t), plot2.y + plot2.h + categorySize + 3,
|
|
42578
|
+
text3(px(t), plot2.y + plot2.h + categorySize + 3, axisTickText(t, model.axes?.category), {
|
|
42063
42579
|
anchor: "middle",
|
|
42064
42580
|
...categoryAttrs
|
|
42065
42581
|
})
|
|
42066
42582
|
);
|
|
42067
42583
|
}
|
|
42068
42584
|
out.push(
|
|
42069
|
-
|
|
42585
|
+
axisLine(
|
|
42586
|
+
model,
|
|
42587
|
+
model.axes?.category,
|
|
42588
|
+
"categoryAxis",
|
|
42589
|
+
plot2.x,
|
|
42590
|
+
plot2.y + plot2.h,
|
|
42591
|
+
plot2.x + plot2.w,
|
|
42592
|
+
plot2.y + plot2.h
|
|
42593
|
+
)
|
|
42594
|
+
);
|
|
42595
|
+
out.push(
|
|
42596
|
+
axisLine(model, model.axes?.value, "valueAxis", plot2.x, plot2.y, plot2.x, plot2.y + plot2.h)
|
|
42070
42597
|
);
|
|
42071
|
-
out.push(line2(plot2.x, plot2.y, plot2.x, plot2.y + plot2.h, yAxis.color, yAxis.width));
|
|
42072
42598
|
const marks = [];
|
|
42073
42599
|
for (const [si, s] of model.series.entries())
|
|
42074
42600
|
s.values.forEach((v, i2) => {
|
|
@@ -42077,8 +42603,8 @@ function scatter(model, area, out) {
|
|
|
42077
42603
|
const filter2 = s.shadowFilter ? ` filter="${s.shadowFilter}"` : "";
|
|
42078
42604
|
const fill = s.pointColors?.[i2] ?? s.color;
|
|
42079
42605
|
if (!bubble) {
|
|
42080
|
-
out.push(
|
|
42081
|
-
marks.push({ series: s, index: i2, x: px(x), y: py(v), radius:
|
|
42606
|
+
out.push(chartSeriesMarkerSvg(s, i2, px(x), py(v)));
|
|
42607
|
+
marks.push({ series: s, index: i2, x: px(x), y: py(v), radius: chartMarkerRadius(s, i2) });
|
|
42082
42608
|
return;
|
|
42083
42609
|
}
|
|
42084
42610
|
const r = radiusOf(s.sizes?.[i2] ?? void 0);
|
|
@@ -42298,32 +42824,37 @@ function radarSvg(model, area) {
|
|
|
42298
42824
|
const valueSize = valueAttrs.size ?? 9;
|
|
42299
42825
|
const categorySize = categoryAttrs.size ?? 10;
|
|
42300
42826
|
const grid6 = chartStroke(model, "gridlineMajor");
|
|
42301
|
-
const axis = chartStroke(model, "categoryAxis");
|
|
42302
42827
|
const cx2 = area.x + area.w / 2;
|
|
42303
42828
|
const cy = area.y + area.h / 2 + 4;
|
|
42304
42829
|
const radius = Math.max(1, Math.min(area.w, area.h) / 2 - Math.max(18, categorySize * 1.8));
|
|
42305
42830
|
const angle = (i2) => i2 / count2 * Math.PI * 2;
|
|
42306
|
-
const r = (v) => (v
|
|
42831
|
+
const r = (v) => chartAxisRatio(v, scale2, model.axes?.value) * radius;
|
|
42307
42832
|
const labelEvery = Math.max(
|
|
42308
42833
|
1,
|
|
42309
42834
|
Math.ceil(12 / Math.max(1, radius / Math.max(1, scale2.ticks.length - 1)))
|
|
42310
42835
|
);
|
|
42311
42836
|
for (const [k, t] of scale2.ticks.entries()) {
|
|
42312
42837
|
const ring = Array.from({ length: count2 }, (_, i2) => polar2(cx2, cy, r(t), angle(i2))).map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
|
|
42313
|
-
|
|
42314
|
-
`<polygon points="${ring}" fill="none" stroke="${grid6.color}" stroke-width="${n(grid6.width)}"/>`
|
|
42315
|
-
);
|
|
42316
|
-
if (model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
|
|
42838
|
+
if (!model.axes?.value || model.axes.value.source.majorGridlines)
|
|
42317
42839
|
out.push(
|
|
42318
|
-
|
|
42840
|
+
`<polygon points="${ring}" fill="none" stroke="${grid6.color}" stroke-width="${n(grid6.width)}"/>`
|
|
42841
|
+
);
|
|
42842
|
+
if (chartAxisLabels(model.axes?.value) && model.appearance?.valueAxis?.labelsVisible !== false && k % labelEvery === 0)
|
|
42843
|
+
out.push(
|
|
42844
|
+
text3(
|
|
42845
|
+
cx2 + 3,
|
|
42846
|
+
cy - r(t) + valueSize * 0.3,
|
|
42847
|
+
axisTickText(t, model.axes?.value, scale2.percent),
|
|
42848
|
+
valueAttrs
|
|
42849
|
+
)
|
|
42319
42850
|
);
|
|
42320
42851
|
}
|
|
42321
42852
|
model.categories.forEach((c2, i2) => {
|
|
42322
42853
|
const [x, y] = polar2(cx2, cy, radius, angle(i2));
|
|
42323
|
-
out.push(
|
|
42854
|
+
out.push(axisLine(model, model.axes?.category, "categoryAxis", cx2, cy, x, y));
|
|
42324
42855
|
const [lx, ly] = polar2(cx2, cy, radius + 10, angle(i2));
|
|
42325
42856
|
const anchor = Math.abs(lx - cx2) < 2 ? "middle" : lx > cx2 ? "start" : "end";
|
|
42326
|
-
if (model.appearance?.categoryAxis?.labelsVisible !== false)
|
|
42857
|
+
if (chartAxisLabels(model.axes?.category) && model.appearance?.categoryAxis?.labelsVisible !== false)
|
|
42327
42858
|
out.push(
|
|
42328
42859
|
text3(lx, ly + categorySize * 0.3, fit(c2, area.w / 4, categorySize), {
|
|
42329
42860
|
anchor,
|
|
@@ -42334,7 +42865,13 @@ function radarSvg(model, area) {
|
|
|
42334
42865
|
const marks = [];
|
|
42335
42866
|
for (const s of model.series) {
|
|
42336
42867
|
const vertices = s.values.slice(0, count2).map((v, i2) => polar2(cx2, cy, r(v ?? scale2.min), angle(i2)));
|
|
42337
|
-
vertices.forEach(([x, y], i2) =>
|
|
42868
|
+
vertices.forEach(([x, y], i2) => {
|
|
42869
|
+
if (s.values[i2] === null) return;
|
|
42870
|
+
const markerSeries = s;
|
|
42871
|
+
if (markerSeries.marker || markerSeries.pointMarkers)
|
|
42872
|
+
out.push(chartSeriesMarkerSvg(s, i2, x, y));
|
|
42873
|
+
marks.push({ series: s, index: i2, x, y, radius: chartMarkerRadius(s, i2) });
|
|
42874
|
+
});
|
|
42338
42875
|
const points = vertices.map(([x, y]) => `${n(x)},${n(y)}`).join(" ");
|
|
42339
42876
|
out.push(
|
|
42340
42877
|
`<polygon points="${points}" fill="none" stroke="${s.color}" stroke-width="2"${s.shadowFilter ? ` filter="${s.shadowFilter}"` : ""}/>`
|
|
@@ -42524,33 +43061,33 @@ var CHART_FONT_FAMILY = "Calibri, Carlito, Arial, sans-serif";
|
|
|
42524
43061
|
function cssFont(attrs2) {
|
|
42525
43062
|
return `${attrs2.italic ? "italic" : "normal"} ${attrs2.weight ?? "normal"} ${attrs2.size ?? 10}px ${attrs2.family ?? CHART_FONT_FAMILY}`;
|
|
42526
43063
|
}
|
|
42527
|
-
function chartFontMetrics(attrs2,
|
|
42528
|
-
const metrics =
|
|
43064
|
+
function chartFontMetrics(attrs2, options7) {
|
|
43065
|
+
const metrics = options7.measureFont?.(cssFont(attrs2));
|
|
42529
43066
|
return metrics && Number.isFinite(metrics.ascent) && Number.isFinite(metrics.descent) && metrics.ascent >= 0 && metrics.descent >= 0 && metrics.ascent + metrics.descent > 0 ? metrics : void 0;
|
|
42530
43067
|
}
|
|
42531
|
-
function chartTextWidth(content2, attrs2,
|
|
42532
|
-
const width =
|
|
43068
|
+
function chartTextWidth(content2, attrs2, options7) {
|
|
43069
|
+
const width = options7.measureText?.(content2, cssFont(attrs2));
|
|
42533
43070
|
return width !== void 0 && Number.isFinite(width) && width >= 0 ? width : textWidth(content2, attrs2.size);
|
|
42534
43071
|
}
|
|
42535
|
-
function fitChartText(content2, maxWidth, attrs2,
|
|
42536
|
-
if (!
|
|
42537
|
-
if (chartTextWidth(content2, attrs2,
|
|
43072
|
+
function fitChartText(content2, maxWidth, attrs2, options7) {
|
|
43073
|
+
if (!options7.measureText) return fit(content2, maxWidth, attrs2.size);
|
|
43074
|
+
if (chartTextWidth(content2, attrs2, options7) <= maxWidth) return content2;
|
|
42538
43075
|
const points = [...content2];
|
|
42539
43076
|
let low = 0;
|
|
42540
43077
|
let high = points.length;
|
|
42541
43078
|
while (low < high) {
|
|
42542
43079
|
const mid = Math.ceil((low + high) / 2);
|
|
42543
|
-
if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs2,
|
|
43080
|
+
if (chartTextWidth(`${points.slice(0, mid).join("")}\u2026`, attrs2, options7) <= maxWidth) low = mid;
|
|
42544
43081
|
else high = mid - 1;
|
|
42545
43082
|
}
|
|
42546
43083
|
return `${points.slice(0, low).join("")}\u2026`;
|
|
42547
43084
|
}
|
|
42548
43085
|
|
|
42549
43086
|
// chart/render/chart-svg-legend.ts
|
|
42550
|
-
function chartLegendSvg(model, area, frame,
|
|
43087
|
+
function chartLegendSvg(model, area, frame, options7) {
|
|
42551
43088
|
const automatic = [];
|
|
42552
43089
|
const bounds = {};
|
|
42553
|
-
const reserved = automaticLegend(model, area, automatic,
|
|
43090
|
+
const reserved = automaticLegend(model, area, automatic, options7, bounds);
|
|
42554
43091
|
const plot2 = model.legendOverlay ? area : reserved;
|
|
42555
43092
|
const box2 = bounds.box;
|
|
42556
43093
|
if (!box2) return { plot: plot2, markup: "", foreground: false };
|
|
@@ -42564,11 +43101,11 @@ function chartLegendSvg(model, area, frame, options6) {
|
|
|
42564
43101
|
const entries = legendEntries(model);
|
|
42565
43102
|
const attrs2 = chartTextAttributes(model, "legend");
|
|
42566
43103
|
const size = attrs2.size ?? 10;
|
|
42567
|
-
const font = chartFontMetrics(attrs2,
|
|
43104
|
+
const font = chartFontMetrics(attrs2, options7);
|
|
42568
43105
|
const keySize = size / 2;
|
|
42569
43106
|
const keyGap = size / 4;
|
|
42570
43107
|
const widths = entries.map(
|
|
42571
|
-
(entry3) => chartTextWidth(entry3.label, attrs2,
|
|
43108
|
+
(entry3) => chartTextWidth(entry3.label, attrs2, options7) + keySize + keyGap
|
|
42572
43109
|
);
|
|
42573
43110
|
const horizontal2 = manual.width > manual.height && widths.reduce((sum3, width) => sum3 + width, 0) + size <= manual.width;
|
|
42574
43111
|
const rowWidth = horizontal2 ? manual.width / entries.length : manual.width;
|
|
@@ -42583,8 +43120,8 @@ function chartLegendSvg(model, area, frame, options6) {
|
|
|
42583
43120
|
];
|
|
42584
43121
|
const baselineOffset = font ? (font.ascent - font.descent) / 2 : size * 0.35;
|
|
42585
43122
|
entries.forEach((entry3, i2) => {
|
|
42586
|
-
const available = horizontal2 ? chartTextWidth(entry3.label, attrs2,
|
|
42587
|
-
const label2 = fitChartText(entry3.label, available, attrs2,
|
|
43123
|
+
const available = horizontal2 ? chartTextWidth(entry3.label, attrs2, options7) : Math.max(0, rowWidth - size / 2 - keySize - keyGap);
|
|
43124
|
+
const label2 = fitChartText(entry3.label, available, attrs2, options7);
|
|
42588
43125
|
const contentWidth = Math.min(
|
|
42589
43126
|
horizontal2 ? widths[i2] ?? 0 : Math.max(...widths),
|
|
42590
43127
|
rowWidth - size / 2
|
|
@@ -42627,7 +43164,7 @@ function legendEntries(model) {
|
|
|
42627
43164
|
color: s.color
|
|
42628
43165
|
}));
|
|
42629
43166
|
}
|
|
42630
|
-
function automaticLegend(model, area, out,
|
|
43167
|
+
function automaticLegend(model, area, out, options7, bounds) {
|
|
42631
43168
|
const entries = legendEntries(model);
|
|
42632
43169
|
if (!model.showLegend || entries.length === 0) return area;
|
|
42633
43170
|
const pos = model.legendPosition;
|
|
@@ -42636,7 +43173,7 @@ function automaticLegend(model, area, out, options6, bounds) {
|
|
|
42636
43173
|
const rowH = Math.max(16, size * 1.4);
|
|
42637
43174
|
if (pos === "t" || pos === "b") {
|
|
42638
43175
|
const widths = entries.map(
|
|
42639
|
-
(e) => Math.min(chartTextWidth(e.label, attrs2,
|
|
43176
|
+
(e) => Math.min(chartTextWidth(e.label, attrs2, options7) + 20, area.w / 2)
|
|
42640
43177
|
);
|
|
42641
43178
|
const total2 = widths.reduce((a2, b) => a2 + b, 0);
|
|
42642
43179
|
let x2 = area.x + Math.max(0, (area.w - total2) / 2);
|
|
@@ -42653,14 +43190,14 @@ function automaticLegend(model, area, out, options6, bounds) {
|
|
|
42653
43190
|
entries.forEach((e, i2) => {
|
|
42654
43191
|
const w = widths[i2] ?? 0;
|
|
42655
43192
|
out.push(rect(x2, y, 8, 8, e.color));
|
|
42656
|
-
out.push(text3(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs2,
|
|
43193
|
+
out.push(text3(x2 + 12, y + 8, fitChartText(e.label, w - 16, attrs2, options7), attrs2));
|
|
42657
43194
|
x2 += w;
|
|
42658
43195
|
});
|
|
42659
43196
|
return pos === "t" ? { x: area.x, y: area.y + rowH + 4, w: area.w, h: area.h - rowH - 4 } : { x: area.x, y: area.y, w: area.w, h: area.h - rowH - 4 };
|
|
42660
43197
|
}
|
|
42661
43198
|
const width = Math.min(
|
|
42662
43199
|
area.w * 0.35,
|
|
42663
|
-
Math.max(...entries.map((e) => chartTextWidth(e.label, attrs2,
|
|
43200
|
+
Math.max(...entries.map((e) => chartTextWidth(e.label, attrs2, options7))) + 22
|
|
42664
43201
|
);
|
|
42665
43202
|
const height = entries.length * rowH;
|
|
42666
43203
|
const x = pos === "l" ? area.x + 4 : area.x + area.w - width;
|
|
@@ -42678,14 +43215,14 @@ function automaticLegend(model, area, out, options6, bounds) {
|
|
|
42678
43215
|
const y = y0 + i2 * rowH;
|
|
42679
43216
|
if (y + rowH > area.y + area.h + 2) return;
|
|
42680
43217
|
out.push(rect(x, y + 3, 8, 8, e.color));
|
|
42681
|
-
out.push(text3(x + 12, y + 11, fitChartText(e.label, width - 16, attrs2,
|
|
43218
|
+
out.push(text3(x + 12, y + 11, fitChartText(e.label, width - 16, attrs2, options7), attrs2));
|
|
42682
43219
|
});
|
|
42683
43220
|
return pos === "l" ? { x: area.x + width + 8, y: area.y, w: area.w - width - 8, h: area.h } : { x: area.x, y: area.y, w: area.w - width - 8, h: area.h };
|
|
42684
43221
|
}
|
|
42685
43222
|
|
|
42686
43223
|
// text/wrap-styled-runs.ts
|
|
42687
43224
|
var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
42688
|
-
function wrapStyledRuns(runs, maxWidth, measure3,
|
|
43225
|
+
function wrapStyledRuns(runs, maxWidth, measure3, options7 = {}) {
|
|
42689
43226
|
const groups = [];
|
|
42690
43227
|
for (const [source2, run2] of runs.entries()) {
|
|
42691
43228
|
for (const token of run2.text.split(/(\r\n|[\r\n]|[ \t]+)/u).filter(Boolean)) {
|
|
@@ -42733,7 +43270,7 @@ function wrapStyledRuns(runs, maxWidth, measure3, options6 = {}) {
|
|
|
42733
43270
|
if (line3.length && width(merged(line3, [...separator, ...group2.pieces])) > maxWidth) flush();
|
|
42734
43271
|
else line3 = merged(line3, separator);
|
|
42735
43272
|
spaces = [];
|
|
42736
|
-
if (
|
|
43273
|
+
if (options7.breakWords && wordWidth > maxWidth) {
|
|
42737
43274
|
for (const piece of group2.pieces) {
|
|
42738
43275
|
for (const { segment: segment2 } of graphemes.segment(piece.text)) {
|
|
42739
43276
|
const next = { ...piece, text: segment2 };
|
|
@@ -42751,11 +43288,11 @@ function wrapStyledRuns(runs, maxWidth, measure3, options6 = {}) {
|
|
|
42751
43288
|
function spacing2(value3, naturalHeight, fallback) {
|
|
42752
43289
|
return value3 ? value3.unit === "points" ? chartPointsToPixels(value3.value) : naturalHeight * value3.value : fallback;
|
|
42753
43290
|
}
|
|
42754
|
-
function chartRichTitleSvg(model, width,
|
|
43291
|
+
function chartRichTitleSvg(model, width, options7 = {}, frameHeight = 400) {
|
|
42755
43292
|
if (!model.title) return void 0;
|
|
42756
43293
|
const base = chartTextAttributes(model, "title", 14);
|
|
42757
43294
|
const capacity = Math.max(1, width * 0.8 - 8);
|
|
42758
|
-
if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base,
|
|
43295
|
+
if (!model.titleText && !hasManualLayoutFields(model.titleLayout) && !model.titleOverlay && !model.title.includes("\n") && chartTextWidth(model.title, base, options7) <= capacity)
|
|
42759
43296
|
return void 0;
|
|
42760
43297
|
const paragraphs = model.titleText?.paragraphs ?? [
|
|
42761
43298
|
{
|
|
@@ -42791,7 +43328,7 @@ function chartRichTitleSvg(model, width, options6 = {}, frameHeight = 400) {
|
|
|
42791
43328
|
"title",
|
|
42792
43329
|
base.size
|
|
42793
43330
|
),
|
|
42794
|
-
|
|
43331
|
+
options7
|
|
42795
43332
|
),
|
|
42796
43333
|
{ breakWords: true }
|
|
42797
43334
|
);
|
|
@@ -42815,10 +43352,10 @@ function chartRichTitleSvg(model, width, options6 = {}, frameHeight = 400) {
|
|
|
42815
43352
|
return {
|
|
42816
43353
|
...line3,
|
|
42817
43354
|
runs,
|
|
42818
|
-
width: runs.reduce((sum3, run2) => sum3 + chartTextWidth(run2.text, run2.attrs,
|
|
43355
|
+
width: runs.reduce((sum3, run2) => sum3 + chartTextWidth(run2.text, run2.attrs, options7), 0),
|
|
42819
43356
|
size: runs.length ? Math.max(...runs.map((run2) => run2.attrs.size ?? 14)) : base.size ?? 14,
|
|
42820
43357
|
fontMetrics: (runs.length ? runs.map((run2) => run2.attrs) : [base]).map(
|
|
42821
|
-
(attrs2) => chartFontMetrics(attrs2,
|
|
43358
|
+
(attrs2) => chartFontMetrics(attrs2, options7)
|
|
42822
43359
|
)
|
|
42823
43360
|
};
|
|
42824
43361
|
});
|
|
@@ -42856,7 +43393,7 @@ function chartRichTitleSvg(model, width, options6 = {}, frameHeight = 400) {
|
|
|
42856
43393
|
anchor: "start"
|
|
42857
43394
|
}).replace("<text ", '<tspan data-chart-title-run="true" ').replace("</text>", "</tspan>")
|
|
42858
43395
|
);
|
|
42859
|
-
x += chartTextWidth(run2.text, run2.attrs,
|
|
43396
|
+
x += chartTextWidth(run2.text, run2.attrs, options7);
|
|
42860
43397
|
}
|
|
42861
43398
|
}
|
|
42862
43399
|
const parent = text3(0, 0, "", { ...base, underline: false }).replace(
|
|
@@ -42882,7 +43419,7 @@ function chartRichTitleSvg(model, width, options6 = {}, frameHeight = 400) {
|
|
|
42882
43419
|
}
|
|
42883
43420
|
|
|
42884
43421
|
// chart/render/chart-svg.ts
|
|
42885
|
-
function renderChartSvg(model, width, height,
|
|
43422
|
+
function renderChartSvg(model, width, height, options7 = {}) {
|
|
42886
43423
|
const paint2 = chartGradientPaint(model, Math.max(1, width), Math.max(1, height));
|
|
42887
43424
|
model = paint2.model;
|
|
42888
43425
|
const w = Math.max(1, width);
|
|
@@ -42896,7 +43433,7 @@ function renderChartSvg(model, width, height, options6 = {}) {
|
|
|
42896
43433
|
if (paint2.defs) out.push(paint2.defs);
|
|
42897
43434
|
out.push(chartAreaRect(model, "chartArea", { x: 0, y: 0, w, h: h2 }));
|
|
42898
43435
|
let area = { x: 8, y: 8, w: w - 16, h: h2 - 16 };
|
|
42899
|
-
const richTitle = chartRichTitleSvg(model, w,
|
|
43436
|
+
const richTitle = chartRichTitleSvg(model, w, options7, h2);
|
|
42900
43437
|
if (richTitle) {
|
|
42901
43438
|
if (model.titleLayout || model.titleOverlay) foregroundTitle = richTitle.markup;
|
|
42902
43439
|
else out.push(richTitle.markup);
|
|
@@ -42905,9 +43442,9 @@ function renderChartSvg(model, width, height, options6 = {}) {
|
|
|
42905
43442
|
} else if (model.title) {
|
|
42906
43443
|
const attrs2 = chartTextAttributes(model, "title", 14);
|
|
42907
43444
|
const size = attrs2.size ?? 14;
|
|
42908
|
-
const label2 = fitChartText(model.title, w - 16, attrs2,
|
|
42909
|
-
const titleWidth = Math.min(w - 16, chartTextWidth(label2, attrs2,
|
|
42910
|
-
const font = chartFontMetrics(attrs2,
|
|
43445
|
+
const label2 = fitChartText(model.title, w - 16, attrs2, options7);
|
|
43446
|
+
const titleWidth = Math.min(w - 16, chartTextWidth(label2, attrs2, options7) + 8);
|
|
43447
|
+
const font = chartFontMetrics(attrs2, options7);
|
|
42911
43448
|
const titleHeight = Math.max(24, font ? font.ascent + font.descent + 4 : size * 1.4 + 4);
|
|
42912
43449
|
out.push(
|
|
42913
43450
|
chartAreaRect(model, "title", {
|
|
@@ -42935,7 +43472,7 @@ function renderChartSvg(model, width, height, options6 = {}) {
|
|
|
42935
43472
|
out.push("</svg>");
|
|
42936
43473
|
return out.join("");
|
|
42937
43474
|
}
|
|
42938
|
-
const legend = chartLegendSvg(model, area, { width: w, height: h2 },
|
|
43475
|
+
const legend = chartLegendSvg(model, area, { width: w, height: h2 }, options7);
|
|
42939
43476
|
area = legend.plot;
|
|
42940
43477
|
if (!legend.foreground) out.push(legend.markup);
|
|
42941
43478
|
if (area.w > 4 && area.h > 4) {
|
|
@@ -43062,11 +43599,11 @@ function createTemplateWorkbook(id, t) {
|
|
|
43062
43599
|
}
|
|
43063
43600
|
|
|
43064
43601
|
// xlsx/ui/commands.ts
|
|
43065
|
-
function createCommandRegistry(context,
|
|
43602
|
+
function createCommandRegistry(context, options7 = {}) {
|
|
43066
43603
|
const commands6 = /* @__PURE__ */ new Map();
|
|
43067
43604
|
const isEnabled = (id) => {
|
|
43068
43605
|
const command = commands6.get(id);
|
|
43069
|
-
if (!command ||
|
|
43606
|
+
if (!command || options7.isHidden?.(id)) return false;
|
|
43070
43607
|
const ctx = context();
|
|
43071
43608
|
if (command.editing && ctx.readOnly()) return false;
|
|
43072
43609
|
try {
|
|
@@ -43093,7 +43630,7 @@ function createCommandRegistry(context, options6 = {}) {
|
|
|
43093
43630
|
try {
|
|
43094
43631
|
await command.run(ctx, arg);
|
|
43095
43632
|
} catch (error) {
|
|
43096
|
-
|
|
43633
|
+
options7.onError?.(id, error);
|
|
43097
43634
|
return false;
|
|
43098
43635
|
}
|
|
43099
43636
|
ctx.requestRender();
|
|
@@ -49166,9 +49703,9 @@ var grid = {
|
|
|
49166
49703
|
// xlsx/ui/locales/de/options.ts
|
|
49167
49704
|
var options_exports = {};
|
|
49168
49705
|
__export(options_exports, {
|
|
49169
|
-
options: () =>
|
|
49706
|
+
options: () => options2
|
|
49170
49707
|
});
|
|
49171
|
-
var
|
|
49708
|
+
var options2 = {
|
|
49172
49709
|
...optionStrings.de,
|
|
49173
49710
|
"Change options related to formula calculation, performance, and error handling.": "\xC4ndern Sie Optionen f\xFCr Formelberechnung, Leistung und Fehlerbehandlung.",
|
|
49174
49711
|
"Calculation options": "Berechnungsoptionen",
|
|
@@ -49570,9 +50107,9 @@ var grid2 = {
|
|
|
49570
50107
|
// xlsx/ui/locales/en/options.ts
|
|
49571
50108
|
var options_exports2 = {};
|
|
49572
50109
|
__export(options_exports2, {
|
|
49573
|
-
options: () =>
|
|
50110
|
+
options: () => options3
|
|
49574
50111
|
});
|
|
49575
|
-
var
|
|
50112
|
+
var options3 = {
|
|
49576
50113
|
...optionStrings.en,
|
|
49577
50114
|
"Change options related to formula calculation, performance, and error handling.": "Change options related to formula calculation, performance, and error handling.",
|
|
49578
50115
|
"Calculation options": "Calculation options",
|
|
@@ -49974,9 +50511,9 @@ var grid3 = {
|
|
|
49974
50511
|
// xlsx/ui/locales/es/options.ts
|
|
49975
50512
|
var options_exports3 = {};
|
|
49976
50513
|
__export(options_exports3, {
|
|
49977
|
-
options: () =>
|
|
50514
|
+
options: () => options4
|
|
49978
50515
|
});
|
|
49979
|
-
var
|
|
50516
|
+
var options4 = {
|
|
49980
50517
|
...optionStrings.es,
|
|
49981
50518
|
"Change options related to formula calculation, performance, and error handling.": "Cambie las opciones relacionadas con el c\xE1lculo de f\xF3rmulas, el rendimiento y el control de errores.",
|
|
49982
50519
|
"Calculation options": "Opciones de c\xE1lculo",
|
|
@@ -50378,9 +50915,9 @@ var grid4 = {
|
|
|
50378
50915
|
// xlsx/ui/locales/fr/options.ts
|
|
50379
50916
|
var options_exports4 = {};
|
|
50380
50917
|
__export(options_exports4, {
|
|
50381
|
-
options: () =>
|
|
50918
|
+
options: () => options5
|
|
50382
50919
|
});
|
|
50383
|
-
var
|
|
50920
|
+
var options5 = {
|
|
50384
50921
|
...optionStrings.fr,
|
|
50385
50922
|
"Change options related to formula calculation, performance, and error handling.": "Modifiez les options relatives au calcul des formules, aux performances et \xE0 la gestion des erreurs.",
|
|
50386
50923
|
"Calculation options": "Options de calcul",
|
|
@@ -50782,9 +51319,9 @@ var grid5 = {
|
|
|
50782
51319
|
// xlsx/ui/locales/zh-CN/options.ts
|
|
50783
51320
|
var options_exports5 = {};
|
|
50784
51321
|
__export(options_exports5, {
|
|
50785
|
-
options: () =>
|
|
51322
|
+
options: () => options6
|
|
50786
51323
|
});
|
|
50787
|
-
var
|
|
51324
|
+
var options6 = {
|
|
50788
51325
|
...optionStrings["zh-CN"],
|
|
50789
51326
|
"Change options related to formula calculation, performance, and error handling.": "\u66F4\u6539\u4E0E\u516C\u5F0F\u8BA1\u7B97\u3001\u6027\u80FD\u548C\u9519\u8BEF\u5904\u7406\u76F8\u5173\u7684\u9009\u9879\u3002",
|
|
50790
51327
|
"Calculation options": "\u8BA1\u7B97\u9009\u9879",
|
|
@@ -52424,11 +52961,11 @@ var ACCOUNTING_FORMATS = [
|
|
|
52424
52961
|
];
|
|
52425
52962
|
var COMMA = BUILTIN_NUMBER_FORMATS[43] ?? '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)';
|
|
52426
52963
|
function numberFormatOptions(ctx) {
|
|
52427
|
-
const
|
|
52964
|
+
const options7 = FORMAT_PRESETS.map((p) => ({ value: p.format, label: ctx.t(p.label) }));
|
|
52428
52965
|
const current = activeStyle(ctx)?.numFmt;
|
|
52429
|
-
if (current && !
|
|
52430
|
-
|
|
52431
|
-
return
|
|
52966
|
+
if (current && !options7.some((o) => o.value === current))
|
|
52967
|
+
options7.push({ value: current, label: ctx.t("Custom") });
|
|
52968
|
+
return options7;
|
|
52432
52969
|
}
|
|
52433
52970
|
var sampleNumber = (ctx) => {
|
|
52434
52971
|
const t = target(ctx);
|
|
@@ -53102,8 +53639,8 @@ function detectCategory(code) {
|
|
|
53102
53639
|
for (const thousands of [false, true])
|
|
53103
53640
|
for (let symbol2 = 0; symbol2 < SYMBOLS.length; symbol2++)
|
|
53104
53641
|
for (let negative = 0; negative < 4; negative++) {
|
|
53105
|
-
const
|
|
53106
|
-
if (buildCode(category,
|
|
53642
|
+
const options7 = { decimals: dec, thousands, symbol: symbol2, negative, code };
|
|
53643
|
+
if (buildCode(category, options7) === code) return { category, options: options7 };
|
|
53107
53644
|
}
|
|
53108
53645
|
return { category: "custom", options: base };
|
|
53109
53646
|
}
|
|
@@ -53117,7 +53654,7 @@ var absolute = (r) => {
|
|
|
53117
53654
|
};
|
|
53118
53655
|
var value2 = (ws, row2, col) => getCell(ws, row2, col)?.value ?? null;
|
|
53119
53656
|
var isText = (v) => typeof v === "string" && v !== "";
|
|
53120
|
-
function buildChart(workbook, sheetIndex2, range2, type,
|
|
53657
|
+
function buildChart(workbook, sheetIndex2, range2, type, options7 = {}) {
|
|
53121
53658
|
const ws = workbook.sheets[sheetIndex2];
|
|
53122
53659
|
if (!ws) throw new RangeError(`No sheet at index ${sheetIndex2}`);
|
|
53123
53660
|
const r = normalizeRange(range2);
|
|
@@ -53178,8 +53715,8 @@ function buildChart(workbook, sheetIndex2, range2, type, options6 = {}) {
|
|
|
53178
53715
|
showLegend: series.length > 1 || type === "pie" || type === "doughnut",
|
|
53179
53716
|
legendPosition: "b"
|
|
53180
53717
|
};
|
|
53181
|
-
if (
|
|
53182
|
-
if (
|
|
53718
|
+
if (options7.grouping && (type === "column" || type === "bar")) chart.grouping = options7.grouping;
|
|
53719
|
+
if (options7.title) chart.title = options7.title;
|
|
53183
53720
|
return chart;
|
|
53184
53721
|
}
|
|
53185
53722
|
function evaluateRef(workbook, sheetIndex2, ref) {
|
|
@@ -53223,7 +53760,7 @@ function parseChartGrid(text4) {
|
|
|
53223
53760
|
const width = rows2.reduce((most, row2) => Math.max(most, row2.length), 0);
|
|
53224
53761
|
return rows2.map((row2) => [...row2, ...Array(width - row2.length).fill(null)]);
|
|
53225
53762
|
}
|
|
53226
|
-
function gridChart(rows2, type,
|
|
53763
|
+
function gridChart(rows2, type, options7 = {}) {
|
|
53227
53764
|
const width = rows2[0]?.length ?? 0;
|
|
53228
53765
|
if (rows2.length === 0 || width === 0) return void 0;
|
|
53229
53766
|
const workbook = createWorkbook();
|
|
@@ -53233,7 +53770,7 @@ function gridChart(rows2, type, options6 = {}) {
|
|
|
53233
53770
|
rows2.map((row2) => [...row2])
|
|
53234
53771
|
);
|
|
53235
53772
|
const range2 = { start: { row: 0, col: 0 }, end: { row: rows2.length - 1, col: width - 1 } };
|
|
53236
|
-
return { workbook, chart: buildChart(workbook, 0, range2, type,
|
|
53773
|
+
return { workbook, chart: buildChart(workbook, 0, range2, type, options7) };
|
|
53237
53774
|
}
|
|
53238
53775
|
function gridChartSvg(grid6, width, height, bare = false) {
|
|
53239
53776
|
const chart = bare ? { ...grid6.chart, title: "", showLegend: false } : grid6.chart;
|
|
@@ -53242,8 +53779,8 @@ function gridChartSvg(grid6, width, height, bare = false) {
|
|
|
53242
53779
|
}
|
|
53243
53780
|
var EMBED_ANCHOR = { fromCol: 4, toCol: 14, rows: 20 };
|
|
53244
53781
|
var EMBED_ASPECT = (EMBED_ANCHOR.toCol - EMBED_ANCHOR.fromCol) * 64 / (EMBED_ANCHOR.rows * 20);
|
|
53245
|
-
async function gridChartWorkbook(rows2, type,
|
|
53246
|
-
const grid6 = gridChart(rows2, type,
|
|
53782
|
+
async function gridChartWorkbook(rows2, type, options7 = {}) {
|
|
53783
|
+
const grid6 = gridChart(rows2, type, options7);
|
|
53247
53784
|
if (!grid6) return void 0;
|
|
53248
53785
|
const { workbook, chart } = grid6;
|
|
53249
53786
|
chart.anchor = {
|
|
@@ -53622,7 +54159,7 @@ function createEditBridge() {
|
|
|
53622
54159
|
listeners2.add(listener);
|
|
53623
54160
|
return () => listeners2.delete(listener);
|
|
53624
54161
|
},
|
|
53625
|
-
begin: (
|
|
54162
|
+
begin: (options7 = {}) => driver?.begin(options7) ?? false,
|
|
53626
54163
|
update(text4, caret, source2) {
|
|
53627
54164
|
if (!state.editing) return;
|
|
53628
54165
|
state = { ...state, text: text4, caret, source: source2 };
|