pptx-react-viewer 3.19.2 → 3.20.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/CHANGELOG.md +35 -0
- package/dist/{AiChatPanel-ZH52BQBE.mjs → AiChatPanel-7AU4A3A7.mjs} +4 -4
- package/dist/AiChatPanel-7AU4A3A7.mjs.br +0 -0
- package/dist/AiChatPanel-7AU4A3A7.mjs.gz +0 -0
- package/dist/{AiChatPanel-KILEXOPT.js → AiChatPanel-FIUTFT55.js} +25 -25
- package/dist/AiChatPanel-FIUTFT55.js.br +0 -0
- package/dist/AiChatPanel-FIUTFT55.js.gz +0 -0
- package/dist/{Area3DChartScene-UHN7ZOZT.mjs → Area3DChartScene-SPRHDMNQ.mjs} +1 -1
- package/dist/{Area3DChartScene-UHN7ZOZT.mjs.br → Area3DChartScene-SPRHDMNQ.mjs.br} +0 -0
- package/dist/Area3DChartScene-SPRHDMNQ.mjs.gz +0 -0
- package/dist/{Area3DChartScene-HS7EBQLQ.js → Area3DChartScene-ZGVLTYDW.js} +2 -2
- package/dist/Area3DChartScene-ZGVLTYDW.js.br +0 -0
- package/dist/Area3DChartScene-ZGVLTYDW.js.gz +0 -0
- package/dist/{Bar3DChartScene-TFGSYASD.mjs → Bar3DChartScene-FJCRJCZV.mjs} +1 -1
- package/dist/{Bar3DChartScene-TFGSYASD.mjs.br → Bar3DChartScene-FJCRJCZV.mjs.br} +0 -0
- package/dist/Bar3DChartScene-FJCRJCZV.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-E57TRVUU.js → Bar3DChartScene-GVIX7ENI.js} +2 -2
- package/dist/Bar3DChartScene-GVIX7ENI.js.br +0 -0
- package/dist/Bar3DChartScene-GVIX7ENI.js.gz +0 -0
- package/dist/{Line3DChartScene-NM7YYLZD.js → Line3DChartScene-6C3WDA42.js} +2 -2
- package/dist/Line3DChartScene-6C3WDA42.js.br +0 -0
- package/dist/Line3DChartScene-6C3WDA42.js.gz +0 -0
- package/dist/{Line3DChartScene-RES5D7W7.mjs → Line3DChartScene-KP4RMVAQ.mjs} +1 -1
- package/dist/{Line3DChartScene-RES5D7W7.mjs.br → Line3DChartScene-KP4RMVAQ.mjs.br} +0 -0
- package/dist/Line3DChartScene-KP4RMVAQ.mjs.gz +0 -0
- package/dist/{Model3DScene-6CWFGE7M.mjs → Model3DScene-SH6ZLOXE.mjs} +1 -1
- package/dist/Model3DScene-SH6ZLOXE.mjs.br +0 -0
- package/dist/Model3DScene-SH6ZLOXE.mjs.gz +0 -0
- package/dist/{Model3DScene-SL3QF63O.js → Model3DScene-SXZYGMN6.js} +2 -2
- package/dist/Model3DScene-SXZYGMN6.js.br +0 -0
- package/dist/Model3DScene-SXZYGMN6.js.gz +0 -0
- package/dist/{PieChart3DScene-QYJUOYMB.mjs → PieChart3DScene-F4IE7565.mjs} +1 -1
- package/dist/{PieChart3DScene-QYJUOYMB.mjs.br → PieChart3DScene-F4IE7565.mjs.br} +0 -0
- package/dist/PieChart3DScene-F4IE7565.mjs.gz +0 -0
- package/dist/{PieChart3DScene-WIVYOQUQ.js → PieChart3DScene-V2Q73UEQ.js} +2 -2
- package/dist/PieChart3DScene-V2Q73UEQ.js.br +0 -0
- package/dist/PieChart3DScene-V2Q73UEQ.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-Y2LF73QQ.mjs → SurfaceChart3DScene-AXLDY5BB.mjs} +1 -1
- package/dist/{SurfaceChart3DScene-Y2LF73QQ.mjs.br → SurfaceChart3DScene-AXLDY5BB.mjs.br} +0 -0
- package/dist/SurfaceChart3DScene-AXLDY5BB.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-QCUYYQBZ.js → SurfaceChart3DScene-XUGVYHD2.js} +2 -2
- package/dist/SurfaceChart3DScene-XUGVYHD2.js.br +0 -0
- package/dist/SurfaceChart3DScene-XUGVYHD2.js.gz +0 -0
- package/dist/{chunk-RPPLJQ6R.js → chunk-2BQKGTIF.js} +1571 -1366
- package/dist/chunk-2BQKGTIF.js.br +0 -0
- package/dist/chunk-2BQKGTIF.js.gz +0 -0
- package/dist/{chunk-7XJ7I6TJ.mjs → chunk-F65J67TW.mjs} +7 -3
- package/dist/chunk-F65J67TW.mjs.br +0 -0
- package/dist/chunk-F65J67TW.mjs.gz +0 -0
- package/dist/{chunk-ATKAU2J4.mjs → chunk-GV6LVDBE.mjs} +562 -357
- package/dist/chunk-GV6LVDBE.mjs.br +0 -0
- package/dist/chunk-GV6LVDBE.mjs.gz +0 -0
- package/dist/{chunk-ZUIM5737.js → chunk-HN5QJSVB.js} +514 -172
- package/dist/chunk-HN5QJSVB.js.br +0 -0
- package/dist/chunk-HN5QJSVB.js.gz +0 -0
- package/dist/{chunk-M5BAPEQL.mjs → chunk-JIP6BCRV.mjs} +9 -9
- package/dist/chunk-JIP6BCRV.mjs.br +0 -0
- package/dist/chunk-JIP6BCRV.mjs.gz +0 -0
- package/dist/{chunk-F7VYECOL.js → chunk-K7TAGREH.js} +5 -5
- package/dist/chunk-K7TAGREH.js.br +0 -0
- package/dist/chunk-K7TAGREH.js.gz +0 -0
- package/dist/{chunk-BRJN3ZMG.js → chunk-M24DEOP6.js} +15 -0
- package/dist/chunk-M24DEOP6.js.br +0 -0
- package/dist/chunk-M24DEOP6.js.gz +0 -0
- package/dist/{chunk-2LK3OHAN.js → chunk-ML4MTTPV.js} +796 -796
- package/dist/chunk-ML4MTTPV.js.br +0 -0
- package/dist/chunk-ML4MTTPV.js.gz +0 -0
- package/dist/{chunk-GULL4H2I.mjs → chunk-MWNB4BX5.mjs} +511 -173
- package/dist/chunk-MWNB4BX5.mjs.br +0 -0
- package/dist/chunk-MWNB4BX5.mjs.gz +0 -0
- package/dist/{chunk-NEMPFYZ5.mjs → chunk-OKIHMWGI.mjs} +1 -1
- package/dist/chunk-OKIHMWGI.mjs.br +0 -0
- package/dist/chunk-OKIHMWGI.mjs.gz +0 -0
- package/dist/{chunk-MQUTXOET.mjs → chunk-R664EPDC.mjs} +15 -0
- package/dist/chunk-R664EPDC.mjs.br +0 -0
- package/dist/chunk-R664EPDC.mjs.gz +0 -0
- package/dist/{chunk-YH4ODPSH.js → chunk-U46O2NL5.js} +187 -183
- package/dist/chunk-U46O2NL5.js.br +0 -0
- package/dist/chunk-U46O2NL5.js.gz +0 -0
- package/dist/i18n/de.cjs +15 -0
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +15 -0
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +15 -0
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +15 -0
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +15 -0
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +15 -0
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +15 -0
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +15 -0
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +48 -48
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +4 -4
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +37 -0
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +37 -0
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-KILEXOPT.js.br +0 -0
- package/dist/AiChatPanel-KILEXOPT.js.gz +0 -0
- package/dist/AiChatPanel-ZH52BQBE.mjs.br +0 -0
- package/dist/AiChatPanel-ZH52BQBE.mjs.gz +0 -0
- package/dist/Area3DChartScene-HS7EBQLQ.js.br +0 -0
- package/dist/Area3DChartScene-HS7EBQLQ.js.gz +0 -0
- package/dist/Area3DChartScene-UHN7ZOZT.mjs.gz +0 -0
- package/dist/Bar3DChartScene-E57TRVUU.js.br +0 -0
- package/dist/Bar3DChartScene-E57TRVUU.js.gz +0 -0
- package/dist/Bar3DChartScene-TFGSYASD.mjs.gz +0 -0
- package/dist/Line3DChartScene-NM7YYLZD.js.br +0 -0
- package/dist/Line3DChartScene-NM7YYLZD.js.gz +0 -0
- package/dist/Line3DChartScene-RES5D7W7.mjs.gz +0 -0
- package/dist/Model3DScene-6CWFGE7M.mjs.br +0 -0
- package/dist/Model3DScene-6CWFGE7M.mjs.gz +0 -0
- package/dist/Model3DScene-SL3QF63O.js.br +0 -0
- package/dist/Model3DScene-SL3QF63O.js.gz +0 -0
- package/dist/PieChart3DScene-QYJUOYMB.mjs.gz +0 -0
- package/dist/PieChart3DScene-WIVYOQUQ.js.br +0 -0
- package/dist/PieChart3DScene-WIVYOQUQ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-QCUYYQBZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-QCUYYQBZ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-Y2LF73QQ.mjs.gz +0 -0
- package/dist/chunk-2LK3OHAN.js.br +0 -0
- package/dist/chunk-2LK3OHAN.js.gz +0 -0
- package/dist/chunk-7XJ7I6TJ.mjs.br +0 -0
- package/dist/chunk-7XJ7I6TJ.mjs.gz +0 -0
- package/dist/chunk-ATKAU2J4.mjs.br +0 -0
- package/dist/chunk-ATKAU2J4.mjs.gz +0 -0
- package/dist/chunk-BRJN3ZMG.js.br +0 -0
- package/dist/chunk-BRJN3ZMG.js.gz +0 -0
- package/dist/chunk-F7VYECOL.js.br +0 -0
- package/dist/chunk-F7VYECOL.js.gz +0 -0
- package/dist/chunk-GULL4H2I.mjs.br +0 -0
- package/dist/chunk-GULL4H2I.mjs.gz +0 -0
- package/dist/chunk-M5BAPEQL.mjs.br +0 -0
- package/dist/chunk-M5BAPEQL.mjs.gz +0 -0
- package/dist/chunk-MQUTXOET.mjs.br +0 -0
- package/dist/chunk-MQUTXOET.mjs.gz +0 -0
- package/dist/chunk-NEMPFYZ5.mjs.br +0 -0
- package/dist/chunk-NEMPFYZ5.mjs.gz +0 -0
- package/dist/chunk-RPPLJQ6R.js.br +0 -0
- package/dist/chunk-RPPLJQ6R.js.gz +0 -0
- package/dist/chunk-YH4ODPSH.js.br +0 -0
- package/dist/chunk-YH4ODPSH.js.gz +0 -0
- package/dist/chunk-ZUIM5737.js.br +0 -0
- package/dist/chunk-ZUIM5737.js.gz +0 -0
|
@@ -24292,7 +24292,9 @@ function getElementTextContent(element) {
|
|
|
24292
24292
|
return element.textSegments.map((segment) => String(segment.text || "")).join("");
|
|
24293
24293
|
}
|
|
24294
24294
|
function createEditorId(prefix) {
|
|
24295
|
-
|
|
24295
|
+
const random = Math.random().toString(36).slice(2, 8).padEnd(6, "0");
|
|
24296
|
+
const sequence = (nextEditorIdSequence++).toString(36);
|
|
24297
|
+
return `${prefix}-${Date.now()}-${random}${sequence}`;
|
|
24296
24298
|
}
|
|
24297
24299
|
function ensureArrayValue(value) {
|
|
24298
24300
|
if (!value) {
|
|
@@ -24300,10 +24302,12 @@ function ensureArrayValue(value) {
|
|
|
24300
24302
|
}
|
|
24301
24303
|
return Array.isArray(value) ? value : [value];
|
|
24302
24304
|
}
|
|
24305
|
+
var nextEditorIdSequence;
|
|
24303
24306
|
var init_element_utils = __esm({
|
|
24304
24307
|
"src/core/utils/element-utils.ts"() {
|
|
24305
24308
|
init_types();
|
|
24306
24309
|
init_clone_utils();
|
|
24310
|
+
nextEditorIdSequence = 0;
|
|
24307
24311
|
}
|
|
24308
24312
|
});
|
|
24309
24313
|
function isTemplateElementId(elementId) {
|
|
@@ -46694,7 +46698,9 @@ function buildChartMarkerXml(existing, marker, getLocalName2, resolveColor2) {
|
|
|
46694
46698
|
throw new RangeError("marker size must be an integer from 2 through 72");
|
|
46695
46699
|
}
|
|
46696
46700
|
const node = {};
|
|
46697
|
-
|
|
46701
|
+
if (marker.symbol !== "auto") {
|
|
46702
|
+
node["c:symbol"] = { "@_val": marker.symbol };
|
|
46703
|
+
}
|
|
46698
46704
|
if (marker.size !== void 0) {
|
|
46699
46705
|
node["c:size"] = { "@_val": String(marker.size) };
|
|
46700
46706
|
}
|
|
@@ -47059,10 +47065,7 @@ function parseMarker(markerNode, xmlLookup, colorParser) {
|
|
|
47059
47065
|
}
|
|
47060
47066
|
const symbolNode = xmlLookup.getChildByLocalName(markerNode, "symbol");
|
|
47061
47067
|
const rawSymbol = String(symbolNode?.["@_val"] || "").trim();
|
|
47062
|
-
const symbol = MARKER_SYMBOL_MAP[rawSymbol];
|
|
47063
|
-
if (!symbol) {
|
|
47064
|
-
return void 0;
|
|
47065
|
-
}
|
|
47068
|
+
const symbol = MARKER_SYMBOL_MAP[rawSymbol] ?? "auto";
|
|
47066
47069
|
const result = { symbol };
|
|
47067
47070
|
const sizeNode = xmlLookup.getChildByLocalName(markerNode, "size");
|
|
47068
47071
|
const size = Number(sizeNode?.["@_val"]);
|
|
@@ -48337,6 +48340,13 @@ function safeInt3(val2) {
|
|
|
48337
48340
|
const n = parseInt(String(val2), 10);
|
|
48338
48341
|
return Number.isFinite(n) ? n : void 0;
|
|
48339
48342
|
}
|
|
48343
|
+
function hasLocalName(node, name) {
|
|
48344
|
+
if (Object.hasOwn(node, name)) {
|
|
48345
|
+
return true;
|
|
48346
|
+
}
|
|
48347
|
+
const suffix = `:${name}`;
|
|
48348
|
+
return Object.keys(node).some((key2) => key2.endsWith(suffix));
|
|
48349
|
+
}
|
|
48340
48350
|
function parseChartAxes(plotArea, xmlLookup, colorParser, getLocalName2, resolveTypeface) {
|
|
48341
48351
|
const result = [];
|
|
48342
48352
|
for (const key2 of Object.keys(plotArea)) {
|
|
@@ -48432,20 +48442,24 @@ function parseSingleAxis(axisNode, axisType, xmlLookup, colorParser, getLocalNam
|
|
|
48432
48442
|
result,
|
|
48433
48443
|
(parent, name) => xmlLookup.getChildByLocalName(parent, name)
|
|
48434
48444
|
);
|
|
48435
|
-
|
|
48436
|
-
if (majorGrid) {
|
|
48445
|
+
if (hasLocalName(axisNode, "majorGridlines")) {
|
|
48437
48446
|
result.majorGridlines = true;
|
|
48438
48447
|
result.majorGridlinesSpPr = parseShapeProps(
|
|
48439
|
-
xmlLookup.getChildByLocalName(
|
|
48448
|
+
xmlLookup.getChildByLocalName(
|
|
48449
|
+
xmlLookup.getChildByLocalName(axisNode, "majorGridlines"),
|
|
48450
|
+
"spPr"
|
|
48451
|
+
),
|
|
48440
48452
|
xmlLookup,
|
|
48441
48453
|
colorParser
|
|
48442
48454
|
);
|
|
48443
48455
|
}
|
|
48444
|
-
|
|
48445
|
-
if (minorGrid) {
|
|
48456
|
+
if (hasLocalName(axisNode, "minorGridlines")) {
|
|
48446
48457
|
result.minorGridlines = true;
|
|
48447
48458
|
result.minorGridlinesSpPr = parseShapeProps(
|
|
48448
|
-
xmlLookup.getChildByLocalName(
|
|
48459
|
+
xmlLookup.getChildByLocalName(
|
|
48460
|
+
xmlLookup.getChildByLocalName(axisNode, "minorGridlines"),
|
|
48461
|
+
"spPr"
|
|
48462
|
+
),
|
|
48449
48463
|
xmlLookup,
|
|
48450
48464
|
colorParser
|
|
48451
48465
|
);
|
|
@@ -48648,20 +48662,24 @@ function parseSingleCxAxis(axisNode, xmlLookup, colorParser, resolveTypeface) {
|
|
|
48648
48662
|
if (formatCode) {
|
|
48649
48663
|
result.numFmt = { formatCode, sourceLinked: numFmtNode?.["@_sourceLinked"] === "1" };
|
|
48650
48664
|
}
|
|
48651
|
-
|
|
48652
|
-
if (majorGrid) {
|
|
48665
|
+
if (hasLocalName(axisNode, "majorGridlines")) {
|
|
48653
48666
|
result.majorGridlines = true;
|
|
48654
48667
|
result.majorGridlinesSpPr = parseShapeProps(
|
|
48655
|
-
xmlLookup.getChildByLocalName(
|
|
48668
|
+
xmlLookup.getChildByLocalName(
|
|
48669
|
+
xmlLookup.getChildByLocalName(axisNode, "majorGridlines"),
|
|
48670
|
+
"spPr"
|
|
48671
|
+
),
|
|
48656
48672
|
xmlLookup,
|
|
48657
48673
|
colorParser
|
|
48658
48674
|
);
|
|
48659
48675
|
}
|
|
48660
|
-
|
|
48661
|
-
if (minorGrid) {
|
|
48676
|
+
if (hasLocalName(axisNode, "minorGridlines")) {
|
|
48662
48677
|
result.minorGridlines = true;
|
|
48663
48678
|
result.minorGridlinesSpPr = parseShapeProps(
|
|
48664
|
-
xmlLookup.getChildByLocalName(
|
|
48679
|
+
xmlLookup.getChildByLocalName(
|
|
48680
|
+
xmlLookup.getChildByLocalName(axisNode, "minorGridlines"),
|
|
48681
|
+
"spPr"
|
|
48682
|
+
),
|
|
48665
48683
|
xmlLookup,
|
|
48666
48684
|
colorParser
|
|
48667
48685
|
);
|
|
@@ -48700,6 +48718,7 @@ function parseCxAxes(plotArea, xmlLookup, colorParser, resolveTypeface) {
|
|
|
48700
48718
|
var NO_COLOR;
|
|
48701
48719
|
var init_chart_cx_axis_parser = __esm({
|
|
48702
48720
|
"src/core/utils/chart-cx-axis-parser.ts"() {
|
|
48721
|
+
init_chart_axis_parser();
|
|
48703
48722
|
init_chart_series_detail_parser();
|
|
48704
48723
|
init_chart_title_xml_ops();
|
|
48705
48724
|
NO_COLOR = { parseColor: () => void 0 };
|
|
@@ -97010,6 +97029,7 @@ var PptxHandlerRuntime10;
|
|
|
97010
97029
|
var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
97011
97030
|
"src/core/core/runtime/PptxHandlerRuntimePresentationProps.ts"() {
|
|
97012
97031
|
init_chart_data_label_parser();
|
|
97032
|
+
init_chart_def_rpr_style();
|
|
97013
97033
|
init_chart_legend_serializer();
|
|
97014
97034
|
init_chart_title_style_parser();
|
|
97015
97035
|
init_pptx_presentation_props_helpers();
|
|
@@ -97164,6 +97184,18 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
97164
97184
|
if (entries.length > 0) {
|
|
97165
97185
|
style.legendEntries = entries;
|
|
97166
97186
|
}
|
|
97187
|
+
const legendTxPr = this.xmlLookupService.getChildByLocalName(legend, "txPr");
|
|
97188
|
+
const chartSpaceTxPr = this.xmlLookupService.getChildByLocalName(chartSpace, "txPr");
|
|
97189
|
+
const legendDefRPr = resolveTxPrDefRPr(legendTxPr ?? chartSpaceTxPr, this.xmlLookupService);
|
|
97190
|
+
const legendTextStyle = parseDefRPrTextStyle(
|
|
97191
|
+
legendDefRPr,
|
|
97192
|
+
this.xmlLookupService,
|
|
97193
|
+
{ parseColor: (node) => this.parseColor(node) },
|
|
97194
|
+
(raw) => this.resolveThemeTypeface(raw) ?? raw
|
|
97195
|
+
);
|
|
97196
|
+
if (legendTextStyle) {
|
|
97197
|
+
style.legendTextStyle = legendTextStyle;
|
|
97198
|
+
}
|
|
97167
97199
|
}
|
|
97168
97200
|
const title = this.xmlLookupService.getChildByLocalName(chartRoot, "title");
|
|
97169
97201
|
if (title) {
|
|
@@ -122317,6 +122349,9 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
122317
122349
|
buildChartSeries(seriesList, categories, seriesChartType, axisId, containerChartType) {
|
|
122318
122350
|
return seriesList.map((seriesNode, seriesIndex) => {
|
|
122319
122351
|
const seriesName = this.extractChartSeriesName(seriesNode);
|
|
122352
|
+
const rawIdx = this.xmlLookupService.getChildByLocalName(seriesNode, "idx")?.["@_val"];
|
|
122353
|
+
const parsedIdx = rawIdx !== void 0 ? Number.parseInt(String(rawIdx), 10) : Number.NaN;
|
|
122354
|
+
const idx = Number.isFinite(parsedIdx) ? parsedIdx : void 0;
|
|
122320
122355
|
const valNode2 = this.xmlLookupService.getChildByLocalName(seriesNode, "val") || this.xmlLookupService.getChildByLocalName(seriesNode, "yVal");
|
|
122321
122356
|
const expanded = extractSeriesNumbersWithBlanks(valNode2, this.xmlLookupService);
|
|
122322
122357
|
const hasBlanks = expanded.some((value) => value === null);
|
|
@@ -122406,6 +122441,7 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
122406
122441
|
) : void 0;
|
|
122407
122442
|
return {
|
|
122408
122443
|
name: seriesName.trim().length > 0 ? seriesName : `Series ${seriesIndex + 1}`,
|
|
122444
|
+
...idx !== void 0 ? { idx } : {},
|
|
122409
122445
|
values: fallbackValues,
|
|
122410
122446
|
...blanks ? { blanks } : {},
|
|
122411
122447
|
...xValues.length > 0 ? { xValues } : {},
|
|
@@ -138556,6 +138592,7 @@ var GroupElementProcessor = class {
|
|
|
138556
138592
|
return children13.join("\n\n");
|
|
138557
138593
|
}
|
|
138558
138594
|
};
|
|
138595
|
+
init_blob_url_to_data_url();
|
|
138559
138596
|
init_type_guards();
|
|
138560
138597
|
var ImageElementProcessor = class {
|
|
138561
138598
|
supportedTypes = ["image", "picture"];
|
|
@@ -138596,14 +138633,37 @@ var ImageElementProcessor = class {
|
|
|
138596
138633
|
return { w: maxW, h: Math.round(origH * scale2) };
|
|
138597
138634
|
}
|
|
138598
138635
|
async extractImage(imageElement, ctx) {
|
|
138599
|
-
|
|
138600
|
-
|
|
138636
|
+
const imageData = await this.resolveToDataUrl(imageElement.imageData, "image/png");
|
|
138637
|
+
if (imageData) {
|
|
138638
|
+
return await ctx.mediaContext.saveImage(imageData, `slide${ctx.slideNumber}`);
|
|
138601
138639
|
}
|
|
138602
|
-
|
|
138603
|
-
|
|
138640
|
+
const svgData = await this.resolveToDataUrl(imageElement.svgData, "image/svg+xml");
|
|
138641
|
+
if (svgData) {
|
|
138642
|
+
return await ctx.mediaContext.saveImage(svgData, `slide${ctx.slideNumber}`);
|
|
138604
138643
|
}
|
|
138605
138644
|
return null;
|
|
138606
138645
|
}
|
|
138646
|
+
/**
|
|
138647
|
+
* Accepts an already-decoded `data:` URI as-is. A `blob:` URL (e.g. a
|
|
138648
|
+
* Node `blob:nodedata:...` Object URL minted by `eagerDecodeImages` in a
|
|
138649
|
+
* non-browser runtime) is re-fetched and re-encoded, since only its own
|
|
138650
|
+
* process can resolve it and it would otherwise never satisfy the
|
|
138651
|
+
* `data:` check below. Anything else (undefined, an unresolved relative
|
|
138652
|
+
* path) is not extractable.
|
|
138653
|
+
*/
|
|
138654
|
+
async resolveToDataUrl(value, fallbackMimeType) {
|
|
138655
|
+
if (!value) {
|
|
138656
|
+
return void 0;
|
|
138657
|
+
}
|
|
138658
|
+
if (value.startsWith("data:")) {
|
|
138659
|
+
return value;
|
|
138660
|
+
}
|
|
138661
|
+
if (value.startsWith("blob:")) {
|
|
138662
|
+
const resolved = await blobUrlToDataUrl(value, fallbackMimeType);
|
|
138663
|
+
return resolved.startsWith("data:") ? resolved : void 0;
|
|
138664
|
+
}
|
|
138665
|
+
return void 0;
|
|
138666
|
+
}
|
|
138607
138667
|
/** Clean and truncate image alt text for readable markdown output. */
|
|
138608
138668
|
sanitiseAltText(raw) {
|
|
138609
138669
|
if (!raw) {
|
|
@@ -150568,7 +150628,20 @@ function compileEquationTemplateMathMl() {
|
|
|
150568
150628
|
}
|
|
150569
150629
|
var NICE_STEPS = [1, 2, 2.5, 5, 10];
|
|
150570
150630
|
var HEADROOM = 0.05;
|
|
150631
|
+
var POINTS_PER_GRIDLINE = 20;
|
|
150632
|
+
var MIN_TARGET_INTERVALS = 1;
|
|
150633
|
+
var MAX_TARGET_INTERVALS = 10;
|
|
150634
|
+
var PX_PER_POINT = 4 / 3;
|
|
150635
|
+
var DEFAULT_TARGET_INTERVALS = 4;
|
|
150571
150636
|
var ZERO_ANCHOR_RATIO = 5 / 6;
|
|
150637
|
+
function axisTargetIntervals(plotHeightPx) {
|
|
150638
|
+
if (!Number.isFinite(plotHeightPx) || plotHeightPx <= 0) {
|
|
150639
|
+
return DEFAULT_TARGET_INTERVALS;
|
|
150640
|
+
}
|
|
150641
|
+
const plotHeightPt = plotHeightPx / PX_PER_POINT;
|
|
150642
|
+
const raw = Math.round(plotHeightPt / POINTS_PER_GRIDLINE);
|
|
150643
|
+
return Math.min(MAX_TARGET_INTERVALS, Math.max(MIN_TARGET_INTERVALS, raw));
|
|
150644
|
+
}
|
|
150572
150645
|
function niceAxisStep(value) {
|
|
150573
150646
|
if (!Number.isFinite(value) || value <= 0) {
|
|
150574
150647
|
return 1;
|
|
@@ -150584,7 +150657,7 @@ function snap(value, unit, direction) {
|
|
|
150584
150657
|
const rounded = direction === "up" ? Math.ceil(scaled - 1e-9) : Math.floor(scaled + 1e-9);
|
|
150585
150658
|
return rounded * unit;
|
|
150586
150659
|
}
|
|
150587
|
-
function niceValueAxisBounds(dataMin, dataMax, targetIntervals =
|
|
150660
|
+
function niceValueAxisBounds(dataMin, dataMax, targetIntervals = DEFAULT_TARGET_INTERVALS) {
|
|
150588
150661
|
if (!Number.isFinite(dataMin) || !Number.isFinite(dataMax)) {
|
|
150589
150662
|
return { min: 0, max: 1, majorUnit: 0.5 };
|
|
150590
150663
|
}
|
|
@@ -150988,14 +151061,15 @@ function getChartStylePalette(styleId) {
|
|
|
150988
151061
|
}
|
|
150989
151062
|
return palette;
|
|
150990
151063
|
}
|
|
150991
|
-
function computeValueRange(series) {
|
|
151064
|
+
function computeValueRange(series, plotHeightPx) {
|
|
150992
151065
|
const allValues = series.flatMap((s) => s.values);
|
|
150993
151066
|
if (allValues.length === 0) {
|
|
150994
151067
|
return { min: 0, max: 1, span: 1 };
|
|
150995
151068
|
}
|
|
150996
151069
|
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
150997
151070
|
Math.min(...allValues),
|
|
150998
|
-
Math.max(...allValues)
|
|
151071
|
+
Math.max(...allValues),
|
|
151072
|
+
plotHeightPx !== void 0 ? axisTargetIntervals(plotHeightPx) : void 0
|
|
150999
151073
|
);
|
|
151000
151074
|
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
151001
151075
|
}
|
|
@@ -151096,10 +151170,10 @@ function computeLogValueRange(series, logBase) {
|
|
|
151096
151170
|
logBase
|
|
151097
151171
|
};
|
|
151098
151172
|
}
|
|
151099
|
-
function computeValueRangeForAxis(series, axis) {
|
|
151173
|
+
function computeValueRangeForAxis(series, axis, plotHeightPx) {
|
|
151100
151174
|
const requestedLogBase = axis?.logBase ?? 10;
|
|
151101
151175
|
const logBase = axis?.logScale && Number.isFinite(requestedLogBase) && requestedLogBase > 1 ? requestedLogBase : axis?.logScale ? 10 : void 0;
|
|
151102
|
-
const automatic = logBase ? computeLogValueRange(series, logBase) : computeValueRange(series);
|
|
151176
|
+
const automatic = logBase ? computeLogValueRange(series, logBase) : computeValueRange(series, plotHeightPx);
|
|
151103
151177
|
const validMin = typeof axis?.min === "number" && Number.isFinite(axis.min) && (!logBase || axis.min > 0) ? axis.min : void 0;
|
|
151104
151178
|
const validMax = typeof axis?.max === "number" && Number.isFinite(axis.max) && (!logBase || axis.max > 0) ? axis.max : void 0;
|
|
151105
151179
|
const min = validMin ?? automatic.min;
|
|
@@ -151176,9 +151250,9 @@ function generateMinorAxisTicks(range, axis) {
|
|
|
151176
151250
|
(value) => Math.abs(value / majorUnit - Math.round(value / majorUnit)) > tolerance
|
|
151177
151251
|
);
|
|
151178
151252
|
}
|
|
151179
|
-
function computeValueRangeForChart(series, axes) {
|
|
151253
|
+
function computeValueRangeForChart(series, axes, plotHeightPx) {
|
|
151180
151254
|
const primaryAxis = axes?.find((axis) => axis.axisType === "valAx" && axis.axPos === "l") ?? axes?.find((axis) => axis.axisType === "valAx" && axis.axPos !== "r");
|
|
151181
|
-
return computeValueRangeForAxis(series, primaryAxis);
|
|
151255
|
+
return computeValueRangeForAxis(series, primaryAxis, plotHeightPx);
|
|
151182
151256
|
}
|
|
151183
151257
|
var DISPLAY_UNIT_DIVISORS = {
|
|
151184
151258
|
hundreds: 100,
|
|
@@ -151326,6 +151400,113 @@ function shade2(hex4, amount) {
|
|
|
151326
151400
|
const [r, g2, b] = hexToRgb3(hex4);
|
|
151327
151401
|
return rgbToHex2(r * (1 - amount), g2 * (1 - amount), b * (1 - amount));
|
|
151328
151402
|
}
|
|
151403
|
+
var AUTOMATIC_MARKER_CYCLE = [
|
|
151404
|
+
"diamond",
|
|
151405
|
+
"square",
|
|
151406
|
+
"triangle",
|
|
151407
|
+
"x",
|
|
151408
|
+
"star",
|
|
151409
|
+
"circle",
|
|
151410
|
+
"plus",
|
|
151411
|
+
"dot",
|
|
151412
|
+
"dash"
|
|
151413
|
+
];
|
|
151414
|
+
function automaticMarkerSymbol(seriesIdx) {
|
|
151415
|
+
const length = AUTOMATIC_MARKER_CYCLE.length;
|
|
151416
|
+
const normalized = (seriesIdx % length + length) % length;
|
|
151417
|
+
return AUTOMATIC_MARKER_CYCLE[normalized];
|
|
151418
|
+
}
|
|
151419
|
+
function markerRadius(size, defaultRadius2) {
|
|
151420
|
+
if (size === void 0 || !Number.isFinite(size) || size <= 0) {
|
|
151421
|
+
return defaultRadius2;
|
|
151422
|
+
}
|
|
151423
|
+
return size / 2;
|
|
151424
|
+
}
|
|
151425
|
+
function polygonPoints(vertices) {
|
|
151426
|
+
return vertices.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
|
|
151427
|
+
}
|
|
151428
|
+
function starVertices(cx, cy, r) {
|
|
151429
|
+
const inner = r * 0.5;
|
|
151430
|
+
const out = [];
|
|
151431
|
+
for (let i2 = 0; i2 < 10; i2++) {
|
|
151432
|
+
const radius = i2 % 2 === 0 ? r : inner;
|
|
151433
|
+
const angle = -Math.PI / 2 + Math.PI * i2 / 5;
|
|
151434
|
+
out.push([cx + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);
|
|
151435
|
+
}
|
|
151436
|
+
return out;
|
|
151437
|
+
}
|
|
151438
|
+
function buildMarkerPrimitive(input) {
|
|
151439
|
+
const { symbol, cx, cy, fill, part } = input;
|
|
151440
|
+
if (symbol === "none") {
|
|
151441
|
+
return null;
|
|
151442
|
+
}
|
|
151443
|
+
const r = markerRadius(input.size, input.defaultRadius);
|
|
151444
|
+
const stroke = fill;
|
|
151445
|
+
switch (symbol) {
|
|
151446
|
+
case "square":
|
|
151447
|
+
return { kind: "rect", x: cx - r, y: cy - r, w: r * 2, h: r * 2, fill, part };
|
|
151448
|
+
case "dash":
|
|
151449
|
+
return { kind: "rect", x: cx - r, y: cy - r * 0.32, w: r * 2, h: r * 0.64, fill, part };
|
|
151450
|
+
case "diamond":
|
|
151451
|
+
return {
|
|
151452
|
+
kind: "polygon",
|
|
151453
|
+
points: polygonPoints([
|
|
151454
|
+
[cx, cy - r],
|
|
151455
|
+
[cx + r, cy],
|
|
151456
|
+
[cx, cy + r],
|
|
151457
|
+
[cx - r, cy]
|
|
151458
|
+
]),
|
|
151459
|
+
fill,
|
|
151460
|
+
stroke,
|
|
151461
|
+
strokeWidth: 0,
|
|
151462
|
+
part
|
|
151463
|
+
};
|
|
151464
|
+
case "triangle":
|
|
151465
|
+
return {
|
|
151466
|
+
kind: "polygon",
|
|
151467
|
+
points: polygonPoints([
|
|
151468
|
+
[cx, cy - r],
|
|
151469
|
+
[cx + r * 0.9, cy + r * 0.75],
|
|
151470
|
+
[cx - r * 0.9, cy + r * 0.75]
|
|
151471
|
+
]),
|
|
151472
|
+
fill,
|
|
151473
|
+
stroke,
|
|
151474
|
+
strokeWidth: 0,
|
|
151475
|
+
part
|
|
151476
|
+
};
|
|
151477
|
+
case "star":
|
|
151478
|
+
return {
|
|
151479
|
+
kind: "polygon",
|
|
151480
|
+
points: polygonPoints(starVertices(cx, cy, r)),
|
|
151481
|
+
fill,
|
|
151482
|
+
stroke,
|
|
151483
|
+
strokeWidth: 0,
|
|
151484
|
+
part
|
|
151485
|
+
};
|
|
151486
|
+
case "plus":
|
|
151487
|
+
return {
|
|
151488
|
+
kind: "path",
|
|
151489
|
+
d: `M${(cx - r).toFixed(2)},${cy.toFixed(2)} L${(cx + r).toFixed(2)},${cy.toFixed(2)} M${cx.toFixed(2)},${(cy - r).toFixed(2)} L${cx.toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
151490
|
+
fill: "none",
|
|
151491
|
+
stroke,
|
|
151492
|
+
strokeWidth: Math.max(1, r * 0.4),
|
|
151493
|
+
part
|
|
151494
|
+
};
|
|
151495
|
+
case "x":
|
|
151496
|
+
return {
|
|
151497
|
+
kind: "path",
|
|
151498
|
+
d: `M${(cx - r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx + r).toFixed(2)},${(cy + r).toFixed(2)} M${(cx + r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx - r).toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
151499
|
+
fill: "none",
|
|
151500
|
+
stroke,
|
|
151501
|
+
strokeWidth: Math.max(1, r * 0.4),
|
|
151502
|
+
part
|
|
151503
|
+
};
|
|
151504
|
+
case "dot":
|
|
151505
|
+
return { kind: "circle", cx, cy, r: Math.max(r * 0.6, 1), fill, part };
|
|
151506
|
+
default:
|
|
151507
|
+
return { kind: "circle", cx, cy, r, fill, part };
|
|
151508
|
+
}
|
|
151509
|
+
}
|
|
151329
151510
|
function findDataPoint(series, pointIndex) {
|
|
151330
151511
|
return series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
151331
151512
|
}
|
|
@@ -151340,10 +151521,13 @@ function resolveDataPointExplosion(series, pointIndex) {
|
|
|
151340
151521
|
const point = findDataPoint(series, pointIndex);
|
|
151341
151522
|
return point?.explosion ?? series.explosion ?? 0;
|
|
151342
151523
|
}
|
|
151343
|
-
function resolveDataPointMarker(series, pointIndex) {
|
|
151524
|
+
function resolveDataPointMarker(series, pointIndex, seriesPosition = 0) {
|
|
151344
151525
|
const point = findDataPoint(series, pointIndex)?.marker;
|
|
151526
|
+
const hasMarker = point !== void 0 || series.marker !== void 0;
|
|
151527
|
+
const rawSymbol = point?.symbol ?? series.marker?.symbol;
|
|
151528
|
+
const symbol = hasMarker && (rawSymbol === void 0 || rawSymbol === "auto") ? automaticMarkerSymbol(series.idx ?? seriesPosition) : rawSymbol;
|
|
151345
151529
|
return {
|
|
151346
|
-
symbol
|
|
151530
|
+
symbol,
|
|
151347
151531
|
size: point?.size ?? series.marker?.size,
|
|
151348
151532
|
fill: point?.spPr?.fillColor ?? series.marker?.spPr?.fillColor
|
|
151349
151533
|
};
|
|
@@ -151609,97 +151793,6 @@ function computeChartLegendLayout(vm) {
|
|
|
151609
151793
|
};
|
|
151610
151794
|
});
|
|
151611
151795
|
}
|
|
151612
|
-
function markerRadius(size, defaultRadius2) {
|
|
151613
|
-
if (size === void 0 || !Number.isFinite(size) || size <= 0) {
|
|
151614
|
-
return defaultRadius2;
|
|
151615
|
-
}
|
|
151616
|
-
return size / 2;
|
|
151617
|
-
}
|
|
151618
|
-
function polygonPoints(vertices) {
|
|
151619
|
-
return vertices.map(([x, y]) => `${x.toFixed(2)},${y.toFixed(2)}`).join(" ");
|
|
151620
|
-
}
|
|
151621
|
-
function starVertices(cx, cy, r) {
|
|
151622
|
-
const inner = r * 0.5;
|
|
151623
|
-
const out = [];
|
|
151624
|
-
for (let i2 = 0; i2 < 10; i2++) {
|
|
151625
|
-
const radius = i2 % 2 === 0 ? r : inner;
|
|
151626
|
-
const angle = -Math.PI / 2 + Math.PI * i2 / 5;
|
|
151627
|
-
out.push([cx + radius * Math.cos(angle), cy + radius * Math.sin(angle)]);
|
|
151628
|
-
}
|
|
151629
|
-
return out;
|
|
151630
|
-
}
|
|
151631
|
-
function buildMarkerPrimitive(input) {
|
|
151632
|
-
const { symbol, cx, cy, fill, part } = input;
|
|
151633
|
-
if (symbol === "none") {
|
|
151634
|
-
return null;
|
|
151635
|
-
}
|
|
151636
|
-
const r = markerRadius(input.size, input.defaultRadius);
|
|
151637
|
-
const stroke = fill;
|
|
151638
|
-
switch (symbol) {
|
|
151639
|
-
case "square":
|
|
151640
|
-
return { kind: "rect", x: cx - r, y: cy - r, w: r * 2, h: r * 2, fill, part };
|
|
151641
|
-
case "dash":
|
|
151642
|
-
return { kind: "rect", x: cx - r, y: cy - r * 0.32, w: r * 2, h: r * 0.64, fill, part };
|
|
151643
|
-
case "diamond":
|
|
151644
|
-
return {
|
|
151645
|
-
kind: "polygon",
|
|
151646
|
-
points: polygonPoints([
|
|
151647
|
-
[cx, cy - r],
|
|
151648
|
-
[cx + r, cy],
|
|
151649
|
-
[cx, cy + r],
|
|
151650
|
-
[cx - r, cy]
|
|
151651
|
-
]),
|
|
151652
|
-
fill,
|
|
151653
|
-
stroke,
|
|
151654
|
-
strokeWidth: 0,
|
|
151655
|
-
part
|
|
151656
|
-
};
|
|
151657
|
-
case "triangle":
|
|
151658
|
-
return {
|
|
151659
|
-
kind: "polygon",
|
|
151660
|
-
points: polygonPoints([
|
|
151661
|
-
[cx, cy - r],
|
|
151662
|
-
[cx + r * 0.9, cy + r * 0.75],
|
|
151663
|
-
[cx - r * 0.9, cy + r * 0.75]
|
|
151664
|
-
]),
|
|
151665
|
-
fill,
|
|
151666
|
-
stroke,
|
|
151667
|
-
strokeWidth: 0,
|
|
151668
|
-
part
|
|
151669
|
-
};
|
|
151670
|
-
case "star":
|
|
151671
|
-
return {
|
|
151672
|
-
kind: "polygon",
|
|
151673
|
-
points: polygonPoints(starVertices(cx, cy, r)),
|
|
151674
|
-
fill,
|
|
151675
|
-
stroke,
|
|
151676
|
-
strokeWidth: 0,
|
|
151677
|
-
part
|
|
151678
|
-
};
|
|
151679
|
-
case "plus":
|
|
151680
|
-
return {
|
|
151681
|
-
kind: "path",
|
|
151682
|
-
d: `M${(cx - r).toFixed(2)},${cy.toFixed(2)} L${(cx + r).toFixed(2)},${cy.toFixed(2)} M${cx.toFixed(2)},${(cy - r).toFixed(2)} L${cx.toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
151683
|
-
fill: "none",
|
|
151684
|
-
stroke,
|
|
151685
|
-
strokeWidth: Math.max(1, r * 0.4),
|
|
151686
|
-
part
|
|
151687
|
-
};
|
|
151688
|
-
case "x":
|
|
151689
|
-
return {
|
|
151690
|
-
kind: "path",
|
|
151691
|
-
d: `M${(cx - r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx + r).toFixed(2)},${(cy + r).toFixed(2)} M${(cx + r).toFixed(2)},${(cy - r).toFixed(2)} L${(cx - r).toFixed(2)},${(cy + r).toFixed(2)}`,
|
|
151692
|
-
fill: "none",
|
|
151693
|
-
stroke,
|
|
151694
|
-
strokeWidth: Math.max(1, r * 0.4),
|
|
151695
|
-
part
|
|
151696
|
-
};
|
|
151697
|
-
case "dot":
|
|
151698
|
-
return { kind: "circle", cx, cy, r: Math.max(r * 0.6, 1), fill, part };
|
|
151699
|
-
default:
|
|
151700
|
-
return { kind: "circle", cx, cy, r, fill, part };
|
|
151701
|
-
}
|
|
151702
|
-
}
|
|
151703
151796
|
var LEGEND_LINE_SWATCH_WIDTH = 2;
|
|
151704
151797
|
var LEGEND_MARKER_RADIUS = 3;
|
|
151705
151798
|
var SWATCH_CENTER_Y = -2;
|
|
@@ -151707,8 +151800,8 @@ var SWATCH_WIDTH = 10;
|
|
|
151707
151800
|
function resolveLegendSwatchKind(kind) {
|
|
151708
151801
|
return kind === "line" || kind === "scatter" ? "line" : "rect";
|
|
151709
151802
|
}
|
|
151710
|
-
function buildLineLegendSwatch(series, color2) {
|
|
151711
|
-
const resolved = resolveDataPointMarker(series, -1), primitives = [];
|
|
151803
|
+
function buildLineLegendSwatch(series, color2, seriesPosition = 0) {
|
|
151804
|
+
const resolved = resolveDataPointMarker(series, -1, seriesPosition), primitives = [];
|
|
151712
151805
|
if (!series.lineNoFill) {
|
|
151713
151806
|
primitives.push({
|
|
151714
151807
|
kind: "line",
|
|
@@ -151825,7 +151918,7 @@ function paletteColor2(index, colorPalette) {
|
|
|
151825
151918
|
function seriesColor2(series, index, colorPalette) {
|
|
151826
151919
|
return series.color ?? series.marker?.spPr?.fillColor ?? paletteColor2(index, colorPalette);
|
|
151827
151920
|
}
|
|
151828
|
-
function computeValueRange2(series) {
|
|
151921
|
+
function computeValueRange2(series, plotHeightPx) {
|
|
151829
151922
|
let dataMin = Number.POSITIVE_INFINITY, dataMax = Number.NEGATIVE_INFINITY;
|
|
151830
151923
|
for (const item of series) {
|
|
151831
151924
|
for (const value of item.values) {
|
|
@@ -151840,10 +151933,14 @@ function computeValueRange2(series) {
|
|
|
151840
151933
|
if (dataMin === Number.POSITIVE_INFINITY) {
|
|
151841
151934
|
return { min: 0, max: 1, span: 1 };
|
|
151842
151935
|
}
|
|
151843
|
-
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
151936
|
+
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
151937
|
+
dataMin,
|
|
151938
|
+
dataMax,
|
|
151939
|
+
plotHeightPx !== void 0 ? axisTargetIntervals(plotHeightPx) : void 0
|
|
151940
|
+
);
|
|
151844
151941
|
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
151845
151942
|
}
|
|
151846
|
-
function computeStackedValueRange(series, catCount) {
|
|
151943
|
+
function computeStackedValueRange(series, catCount, plotHeightPx) {
|
|
151847
151944
|
let maxSum = 0, minSum = 0;
|
|
151848
151945
|
for (let ci = 0; ci < catCount; ci++) {
|
|
151849
151946
|
let pos2 = 0, neg = 0;
|
|
@@ -151858,7 +151955,11 @@ function computeStackedValueRange(series, catCount) {
|
|
|
151858
151955
|
maxSum = Math.max(maxSum, pos2);
|
|
151859
151956
|
minSum = Math.min(minSum, neg);
|
|
151860
151957
|
}
|
|
151861
|
-
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
151958
|
+
const { min, max, majorUnit } = niceValueAxisBounds(
|
|
151959
|
+
Math.min(minSum, 0),
|
|
151960
|
+
Math.max(maxSum, 0),
|
|
151961
|
+
plotHeightPx !== void 0 ? axisTargetIntervals(plotHeightPx) : void 0
|
|
151962
|
+
);
|
|
151862
151963
|
return { min, max, span: Math.max(max - min, Number.EPSILON), majorUnit };
|
|
151863
151964
|
}
|
|
151864
151965
|
function valueToY2(val2, range, topY, bottomY) {
|
|
@@ -151898,7 +151999,7 @@ function buildLegend(series, colorPalette, svgWidth, legendPos, svgHeight, plotT
|
|
|
151898
151999
|
return {
|
|
151899
152000
|
color: color2,
|
|
151900
152001
|
label: s.name,
|
|
151901
|
-
...kind === "line" ? { lineSwatch: buildLineLegendSwatch(s, color2) } : {}
|
|
152002
|
+
...kind === "line" ? { lineSwatch: buildLineLegendSwatch(s, color2, i2) } : {}
|
|
151902
152003
|
};
|
|
151903
152004
|
});
|
|
151904
152005
|
let legendX = svgWidth / 2, legendY = svgHeight - 8, legendAnchor = "middle";
|
|
@@ -152595,8 +152696,8 @@ function xyMarkTooltip(seriesName, xVal, yVal, numberFormat) {
|
|
|
152595
152696
|
const y = formatAxisValue2(yVal, numberFormat), coords = xVal !== void 0 ? `(${formatAxisValue2(xVal)}, ${y})` : y;
|
|
152596
152697
|
return seriesName.length > 0 ? `${seriesName}: ${coords}` : coords;
|
|
152597
152698
|
}
|
|
152598
|
-
function pushMarker(out, series, pointIndex, cx, cy, fill, defaultRadius2, part, opacity2, title) {
|
|
152599
|
-
const marker = resolveDataPointMarker(series, pointIndex), m = buildMarkerPrimitive({
|
|
152699
|
+
function pushMarker(out, series, pointIndex, cx, cy, fill, defaultRadius2, part, opacity2, title, seriesPosition = part.seriesIndex ?? 0) {
|
|
152700
|
+
const marker = resolveDataPointMarker(series, pointIndex, seriesPosition), m = buildMarkerPrimitive({
|
|
152600
152701
|
symbol: marker.symbol,
|
|
152601
152702
|
size: marker.size,
|
|
152602
152703
|
cx,
|
|
@@ -154361,7 +154462,7 @@ function barFill(chartData, series, seriesIndex, pointIndex) {
|
|
|
154361
154462
|
return resolveDataPointFill(series, pointIndex, paletteColor2(seriesIndex, palette)) ?? seriesColor2(series, seriesIndex, palette);
|
|
154362
154463
|
}
|
|
154363
154464
|
function buildHorizontalBarViewModel(element, chartData, categoryLabels) {
|
|
154364
|
-
const layout = computePlotLayout(element.width, element.height, chartData, true), catCount = Math.max(categoryLabels.length, 1), series = chartData.series, grouping = chartData.grouping ?? "clustered", isStacked = grouping === "stacked" || grouping === "percentStacked", isPercent = grouping === "percentStacked", range = isPercent ? { min: 0, max: 100, span: 100 } : isStacked ? computeStackedValueRange(series, catCount) : computeValueRangeForChart(series, chartData.axes), { gridlines, axisLabels } = buildTransposedValueAxis(range, layout), zeroX = valueToX(0, range, layout.plotLeft, layout.plotRight), zeroLine = range.min < 0 && range.max > 0 ? {
|
|
154465
|
+
const layout = computePlotLayout(element.width, element.height, chartData, true), catCount = Math.max(categoryLabels.length, 1), series = chartData.series, grouping = chartData.grouping ?? "clustered", isStacked = grouping === "stacked" || grouping === "percentStacked", isPercent = grouping === "percentStacked", range = isPercent ? { min: 0, max: 100, span: 100 } : isStacked ? computeStackedValueRange(series, catCount, layout.plotWidth) : computeValueRangeForChart(series, chartData.axes, layout.plotWidth), { gridlines, axisLabels } = buildTransposedValueAxis(range, layout), zeroX = valueToX(0, range, layout.plotLeft, layout.plotRight), zeroLine = range.min < 0 && range.max > 0 ? {
|
|
154365
154466
|
kind: "line",
|
|
154366
154467
|
x1: zeroX,
|
|
154367
154468
|
y1: layout.plotTop,
|
|
@@ -154947,11 +155048,11 @@ function computeTrendlinePrimitives(chartData, catCount, layout, range, mode = "
|
|
|
154947
155048
|
});
|
|
154948
155049
|
return out;
|
|
154949
155050
|
}
|
|
154950
|
-
function stackedRange(chartData, catCount, isPercent) {
|
|
155051
|
+
function stackedRange(chartData, catCount, isPercent, plotHeightPx) {
|
|
154951
155052
|
if (isPercent) {
|
|
154952
155053
|
return { min: 0, max: 100, span: 100 };
|
|
154953
155054
|
}
|
|
154954
|
-
return computeStackedValueRange(chartData.series, catCount);
|
|
155055
|
+
return computeStackedValueRange(chartData.series, catCount, plotHeightPx);
|
|
154955
155056
|
}
|
|
154956
155057
|
function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
|
|
154957
155058
|
if (kind === "bar" && chartData.barDirection === "bar") {
|
|
@@ -154972,15 +155073,17 @@ function buildCartesianViewModel(element, chartData, categoryLabels, kind) {
|
|
|
154972
155073
|
(axis) => axis.axisType === "valAx" && axis.axPos !== "r"
|
|
154973
155074
|
);
|
|
154974
155075
|
const primaryRange = isStacked ? {
|
|
154975
|
-
...stackedRange(chartData, catCount, isPercent),
|
|
155076
|
+
...stackedRange(chartData, catCount, isPercent, layout.autoPlotHeight),
|
|
154976
155077
|
...primaryAxis?.orientation === "maxMin" ? { reverseOrder: true } : {}
|
|
154977
155078
|
} : computeValueRangeForChart(
|
|
154978
155079
|
primaryPlotSeries.length > 0 ? primaryPlotSeries : chartData.series,
|
|
154979
|
-
chartData.axes
|
|
155080
|
+
chartData.axes,
|
|
155081
|
+
layout.autoPlotHeight
|
|
154980
155082
|
);
|
|
154981
155083
|
const secondaryRange = useSecondary && secondaryPlotSeries.length > 0 ? computeValueRangeForAxis(
|
|
154982
155084
|
secondaryPlotSeries,
|
|
154983
|
-
chartData.axes?.find((axis) => axis.axisType === "valAx" && axis.axPos === "r")
|
|
155085
|
+
chartData.axes?.find((axis) => axis.axisType === "valAx" && axis.axPos === "r"),
|
|
155086
|
+
layout.autoPlotHeight
|
|
154984
155087
|
) : void 0;
|
|
154985
155088
|
const axisRes = buildCartesianAxes(chartData, layout, primaryRange, secondaryRange, catCount);
|
|
154986
155089
|
const zeroLine = primaryRange.logScale ? void 0 : buildZeroLine(primaryRange, layout);
|
|
@@ -155246,10 +155349,11 @@ function buildComboViewModel(element, chartData, categoryLabels) {
|
|
|
155246
155349
|
const primaryAxisId = getPrimaryValueAxisId(chartData.axes);
|
|
155247
155350
|
const primaryAxis = chartData.axes?.find((axis) => axis.axisId === primaryAxisId);
|
|
155248
155351
|
const secondaryAxisFormatting = getSecondaryValueAxis(chartData.axes);
|
|
155249
|
-
const primaryRange = computeValueRangeForAxis(primarySeries, primaryAxis);
|
|
155352
|
+
const primaryRange = computeValueRangeForAxis(primarySeries, primaryAxis, layout.autoPlotHeight);
|
|
155250
155353
|
const secondaryRange = secondary.length > 0 ? computeValueRangeForAxis(
|
|
155251
155354
|
secondary.map((entry2) => entry2.series),
|
|
155252
|
-
secondaryAxisFormatting
|
|
155355
|
+
secondaryAxisFormatting,
|
|
155356
|
+
layout.autoPlotHeight
|
|
155253
155357
|
) : void 0;
|
|
155254
155358
|
const primaryCategoryAxis2 = chartData.axes?.find(
|
|
155255
155359
|
(axis) => (axis.axisType === "catAx" || axis.axisType === "dateAx") && axis.axisId === primaryAxis?.crossAxisId
|
|
@@ -155420,7 +155524,11 @@ function buildStockViewModel(element, chartData, categoryLabels) {
|
|
|
155420
155524
|
computeLayoutOptions(chartData.axes, chartData.dataTable, chartData.series.length)
|
|
155421
155525
|
);
|
|
155422
155526
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
155423
|
-
const range = computeValueRangeForChart(
|
|
155527
|
+
const range = computeValueRangeForChart(
|
|
155528
|
+
chartData.series,
|
|
155529
|
+
chartData.axes,
|
|
155530
|
+
layout.plotHeight
|
|
155531
|
+
);
|
|
155424
155532
|
const valueAxis = chartData.axes?.find((axis) => axis.axisType === "valAx" && axis.axPos !== "r");
|
|
155425
155533
|
const categoryAxis = chartData.axes?.find(
|
|
155426
155534
|
(axis) => (axis.axisType === "catAx" || axis.axisType === "dateAx") && axis.axisId === valueAxis?.crossAxisId
|
|
@@ -156241,18 +156349,19 @@ function buildSunburstViewModel(element, chartData, categoryLabels) {
|
|
|
156241
156349
|
legendAnchor: "middle"
|
|
156242
156350
|
};
|
|
156243
156351
|
}
|
|
156244
|
-
function applyLegendEntryOverrides(legend, entries) {
|
|
156245
|
-
if (!entries || entries.length === 0) {
|
|
156352
|
+
function applyLegendEntryOverrides(legend, entries, defaultTextStyle) {
|
|
156353
|
+
if ((!entries || entries.length === 0) && !defaultTextStyle) {
|
|
156246
156354
|
return legend;
|
|
156247
156355
|
}
|
|
156248
|
-
const byIndex = new Map(entries.map((entry2) => [entry2.index, entry2]));
|
|
156356
|
+
const byIndex = new Map((entries ?? []).map((entry2) => [entry2.index, entry2]));
|
|
156249
156357
|
const result = [];
|
|
156250
156358
|
legend.forEach((item, index) => {
|
|
156251
156359
|
const override = byIndex.get(index);
|
|
156252
156360
|
if (override?.deleted) {
|
|
156253
156361
|
return;
|
|
156254
156362
|
}
|
|
156255
|
-
|
|
156363
|
+
const textStyle = override?.textStyle ?? defaultTextStyle;
|
|
156364
|
+
result.push(textStyle ? { ...item, textStyle } : item);
|
|
156256
156365
|
});
|
|
156257
156366
|
return result;
|
|
156258
156367
|
}
|
|
@@ -156572,7 +156681,7 @@ function buildSurfaceWallPanels(cols, rows, cellSize, zScale, offsetX, offsetY,
|
|
|
156572
156681
|
}
|
|
156573
156682
|
function buildIsometricSurfaceViewModel(element, chartData, categoryLabels) {
|
|
156574
156683
|
const layout = computePlotLayout(element.width, element.height, chartData, false);
|
|
156575
|
-
const range = computeValueRange2(chartData.series);
|
|
156684
|
+
const range = computeValueRange2(chartData.series, layout.autoPlotHeight);
|
|
156576
156685
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
156577
156686
|
const seriesCount = chartData.series.length;
|
|
156578
156687
|
const cols = Math.max(catCount - 1, 1);
|
|
@@ -156691,7 +156800,7 @@ function buildIsometricSurfaceViewModel(element, chartData, categoryLabels) {
|
|
|
156691
156800
|
}
|
|
156692
156801
|
function buildFlatSurfaceViewModel(element, chartData, categoryLabels) {
|
|
156693
156802
|
const layout = computePlotLayout(element.width, element.height, chartData, false);
|
|
156694
|
-
const range = computeValueRange2(chartData.series);
|
|
156803
|
+
const range = computeValueRange2(chartData.series, layout.autoPlotHeight);
|
|
156695
156804
|
const catCount = Math.max(categoryLabels.length, 1);
|
|
156696
156805
|
const seriesCount = chartData.series.length;
|
|
156697
156806
|
const cellW = layout.plotWidth / Math.max(catCount - 1, 1);
|
|
@@ -157579,6 +157688,7 @@ function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, opti
|
|
|
157579
157688
|
const rowCount = options.dataTableRowCount ?? 1;
|
|
157580
157689
|
plotBottom -= 14 + rowCount * 14;
|
|
157581
157690
|
}
|
|
157691
|
+
const autoPlotHeight = Math.max(plotBottom - plotTop, 1);
|
|
157582
157692
|
const plotLayout = manualLayoutOf(chartData, "plotArea"), manual = resolveManualLayoutRect(
|
|
157583
157693
|
plotLayout,
|
|
157584
157694
|
{ width: svgWidth, height: svgHeight },
|
|
@@ -157603,7 +157713,8 @@ function computePlotLayout(elementWidth, elementHeight, chartData, hasAxes, opti
|
|
|
157603
157713
|
plotRight: plotLeft + plotWidth,
|
|
157604
157714
|
plotBottom: plotTop + plotHeight,
|
|
157605
157715
|
plotWidth,
|
|
157606
|
-
plotHeight
|
|
157716
|
+
plotHeight,
|
|
157717
|
+
autoPlotHeight
|
|
157607
157718
|
};
|
|
157608
157719
|
}
|
|
157609
157720
|
var RADAR_RINGS = 4;
|
|
@@ -158449,13 +158560,16 @@ function buildWaterfallSteps(values, options) {
|
|
|
158449
158560
|
}
|
|
158450
158561
|
return steps;
|
|
158451
158562
|
}
|
|
158452
|
-
function computeWaterfallRange(steps) {
|
|
158453
|
-
return computeValueRange2(
|
|
158454
|
-
|
|
158455
|
-
|
|
158456
|
-
|
|
158457
|
-
|
|
158458
|
-
|
|
158563
|
+
function computeWaterfallRange(steps, plotHeightPx) {
|
|
158564
|
+
return computeValueRange2(
|
|
158565
|
+
[
|
|
158566
|
+
{
|
|
158567
|
+
name: "Waterfall range",
|
|
158568
|
+
values: steps.flatMap((step) => [step.startValue, step.endValue])
|
|
158569
|
+
}
|
|
158570
|
+
],
|
|
158571
|
+
plotHeightPx
|
|
158572
|
+
);
|
|
158459
158573
|
}
|
|
158460
158574
|
var WF_COLOR_POSITIVE = "#22c55e";
|
|
158461
158575
|
var WF_COLOR_NEGATIVE = "#ef4444";
|
|
@@ -158466,7 +158580,7 @@ function buildWaterfallViewModel(element, chartData, categoryLabels) {
|
|
|
158466
158580
|
const series = chartData.series[0];
|
|
158467
158581
|
const values = series?.values ?? [];
|
|
158468
158582
|
const steps = buildWaterfallSteps(values, series?.waterfallOptions);
|
|
158469
|
-
const range = computeWaterfallRange(steps);
|
|
158583
|
+
const range = computeWaterfallRange(steps, layout.autoPlotHeight);
|
|
158470
158584
|
const catCount = Math.max(categoryLabels.length, values.length, 1);
|
|
158471
158585
|
const barWidth = layout.plotWidth / catCount * 0.6;
|
|
158472
158586
|
const gap = layout.plotWidth / catCount * 0.2;
|
|
@@ -158622,7 +158736,11 @@ function withDataPointPictureFills(vm, chartData, elementId) {
|
|
|
158622
158736
|
return { ...vm, primitives, defs: [...vm.defs ?? [], ...defs] };
|
|
158623
158737
|
}
|
|
158624
158738
|
function withLegendEntries(vm, chartData) {
|
|
158625
|
-
const legend = applyLegendEntryOverrides(
|
|
158739
|
+
const legend = applyLegendEntryOverrides(
|
|
158740
|
+
vm.legend,
|
|
158741
|
+
chartData.style?.legendEntries,
|
|
158742
|
+
chartData.style?.legendTextStyle
|
|
158743
|
+
);
|
|
158626
158744
|
return legend === vm.legend ? vm : { ...vm, legend };
|
|
158627
158745
|
}
|
|
158628
158746
|
function withChartAreaFill(vm, chartData) {
|
|
@@ -159413,13 +159531,16 @@ function hideChartSeries(data, seriesIndex) {
|
|
|
159413
159531
|
return null;
|
|
159414
159532
|
}
|
|
159415
159533
|
const series = data.series[seriesIndex];
|
|
159416
|
-
|
|
159417
|
-
|
|
159418
|
-
|
|
159419
|
-
|
|
159420
|
-
|
|
159421
|
-
|
|
159422
|
-
idx
|
|
159534
|
+
let idx = series.idx;
|
|
159535
|
+
if (idx === void 0) {
|
|
159536
|
+
const taken = /* @__PURE__ */ new Set([
|
|
159537
|
+
...data.series.map((_, i2) => i2).filter((i2) => i2 !== seriesIndex),
|
|
159538
|
+
...(data.filteredSeries ?? []).map((f6) => f6.idx)
|
|
159539
|
+
]);
|
|
159540
|
+
idx = 0;
|
|
159541
|
+
while (taken.has(idx)) {
|
|
159542
|
+
idx++;
|
|
159543
|
+
}
|
|
159423
159544
|
}
|
|
159424
159545
|
const filteredEntry = {
|
|
159425
159546
|
idx,
|
|
@@ -159427,7 +159548,12 @@ function hideChartSeries(data, seriesIndex) {
|
|
|
159427
159548
|
name: series.name,
|
|
159428
159549
|
categories: data.categories,
|
|
159429
159550
|
values: series.values,
|
|
159430
|
-
...series.uniqueId ? { uniqueId: series.uniqueId } : {}
|
|
159551
|
+
...series.uniqueId ? { uniqueId: series.uniqueId } : {},
|
|
159552
|
+
// Full snapshot so restoreFilteredSeries can bring back everything
|
|
159553
|
+
// (fill/line formatting, marker, data labels, ...), not just name and
|
|
159554
|
+
// values: this used to silently reset a series with a picture fill
|
|
159555
|
+
// or any other non-default formatting to plain defaults on restore.
|
|
159556
|
+
originalSeries: series
|
|
159431
159557
|
};
|
|
159432
159558
|
return {
|
|
159433
159559
|
...data,
|
|
@@ -159443,15 +159569,19 @@ function restoreFilteredSeries(data, filteredIndex) {
|
|
|
159443
159569
|
const name = filtered.name ?? data.filteredSeriesTitle ?? `Series ${data.series.length + 1}`;
|
|
159444
159570
|
const categories = data.categories;
|
|
159445
159571
|
const values = filtered.values ?? (filtered.categories ?? data.filteredCategoryTitle)?.map(() => 0) ?? categories.map(() => 0);
|
|
159446
|
-
const restored = {
|
|
159572
|
+
const restored = filtered.originalSeries ? { ...filtered.originalSeries, idx: filtered.idx } : {
|
|
159447
159573
|
name,
|
|
159448
159574
|
values,
|
|
159575
|
+
idx: filtered.idx,
|
|
159449
159576
|
...filtered.uniqueId ? { uniqueId: filtered.uniqueId } : {}
|
|
159450
159577
|
};
|
|
159578
|
+
const insertAt3 = data.series.findIndex((s, i2) => (s.idx ?? i2) > filtered.idx);
|
|
159579
|
+
const nextSeries = [...data.series];
|
|
159580
|
+
nextSeries.splice(insertAt3 === -1 ? nextSeries.length : insertAt3, 0, restored);
|
|
159451
159581
|
const remainingFiltered = (data.filteredSeries ?? []).filter((_, i2) => i2 !== filteredIndex);
|
|
159452
159582
|
return {
|
|
159453
159583
|
...data,
|
|
159454
|
-
series:
|
|
159584
|
+
series: nextSeries,
|
|
159455
159585
|
...remainingFiltered.length > 0 ? { filteredSeries: remainingFiltered } : { filteredSeries: void 0 }
|
|
159456
159586
|
};
|
|
159457
159587
|
}
|
|
@@ -159470,6 +159600,199 @@ function setDataLabelsRangeCache(series, pointIndex, text22) {
|
|
|
159470
159600
|
dataLabelOptions: { ...series.dataLabelOptions, dataLabelsRange: { ...range, cache } }
|
|
159471
159601
|
};
|
|
159472
159602
|
}
|
|
159603
|
+
var CHART_STYLE_PRESETS = [
|
|
159604
|
+
{ id: "colorful", labelKey: "pptx.chart.styleColorful", styleId: 2 },
|
|
159605
|
+
{ id: "monochrome", labelKey: "pptx.chart.styleMonochrome", styleId: 10 },
|
|
159606
|
+
{ id: "colorfulLight", labelKey: "pptx.chart.styleColorfulLight", styleId: 18 },
|
|
159607
|
+
{ id: "colorfulDark", labelKey: "pptx.chart.styleColorfulDark", styleId: 26 },
|
|
159608
|
+
{ id: "mutedDark", labelKey: "pptx.chart.styleMutedDark", styleId: 34 },
|
|
159609
|
+
{ id: "pastel", labelKey: "pptx.chart.stylePastel", styleId: 42 }
|
|
159610
|
+
];
|
|
159611
|
+
function paletteEquals(a, b) {
|
|
159612
|
+
if (!b || a.length !== b.length) {
|
|
159613
|
+
return false;
|
|
159614
|
+
}
|
|
159615
|
+
return a.every((c, i2) => c.toLowerCase() === b[i2]?.toLowerCase());
|
|
159616
|
+
}
|
|
159617
|
+
function findPreset(id) {
|
|
159618
|
+
return CHART_STYLE_PRESETS.find((p) => p.id === id);
|
|
159619
|
+
}
|
|
159620
|
+
function buildChartStylePresets(chartData) {
|
|
159621
|
+
return CHART_STYLE_PRESETS.map(({ id, labelKey, styleId }) => {
|
|
159622
|
+
const colors = getChartStylePalette(styleId);
|
|
159623
|
+
return {
|
|
159624
|
+
id,
|
|
159625
|
+
labelKey,
|
|
159626
|
+
colors,
|
|
159627
|
+
applied: paletteEquals(colors, chartData.colorPalette)
|
|
159628
|
+
};
|
|
159629
|
+
});
|
|
159630
|
+
}
|
|
159631
|
+
function clearDataPointFill(point) {
|
|
159632
|
+
const { spPr, marker, ...rest } = point;
|
|
159633
|
+
const nextSpPr = spPr && { ...spPr, fillColor: void 0 };
|
|
159634
|
+
const nextMarker = marker?.spPr && {
|
|
159635
|
+
...marker,
|
|
159636
|
+
spPr: { ...marker.spPr, fillColor: void 0 }
|
|
159637
|
+
};
|
|
159638
|
+
return { ...rest, ...spPr && { spPr: nextSpPr }, ...nextMarker && { marker: nextMarker } };
|
|
159639
|
+
}
|
|
159640
|
+
function clearSeriesColor(series) {
|
|
159641
|
+
const { color: _color, marker, dataPoints, ...rest } = series;
|
|
159642
|
+
const nextMarker = marker?.spPr && { ...marker, spPr: { ...marker.spPr, fillColor: void 0 } };
|
|
159643
|
+
return {
|
|
159644
|
+
...rest,
|
|
159645
|
+
...marker && { marker: nextMarker ?? marker },
|
|
159646
|
+
...dataPoints && { dataPoints: dataPoints.map(clearDataPointFill) }
|
|
159647
|
+
};
|
|
159648
|
+
}
|
|
159649
|
+
function applyChartStylePreset(chartData, presetId) {
|
|
159650
|
+
const preset = findPreset(presetId);
|
|
159651
|
+
if (!preset) {
|
|
159652
|
+
return null;
|
|
159653
|
+
}
|
|
159654
|
+
const colors = [...getChartStylePalette(preset.styleId)];
|
|
159655
|
+
return {
|
|
159656
|
+
...chartData,
|
|
159657
|
+
colorPalette: colors,
|
|
159658
|
+
style: { ...chartData.style, styleId: preset.styleId },
|
|
159659
|
+
series: chartData.series.map(clearSeriesColor)
|
|
159660
|
+
};
|
|
159661
|
+
}
|
|
159662
|
+
var AXIS_TYPES_WITH_TITLES = [
|
|
159663
|
+
"catAx",
|
|
159664
|
+
"valAx",
|
|
159665
|
+
"dateAx"
|
|
159666
|
+
];
|
|
159667
|
+
var DEFAULT_AXIS_TITLE_TEXT = "Axis Title";
|
|
159668
|
+
function chartAxesVisibilityPatch(chartData, show) {
|
|
159669
|
+
const axes = (chartData.axes ?? []).map(
|
|
159670
|
+
(axis) => AXIS_TYPES_WITH_TITLES.includes(axis.axisType) ? { ...axis, deleted: !show } : axis
|
|
159671
|
+
);
|
|
159672
|
+
return { axes };
|
|
159673
|
+
}
|
|
159674
|
+
function chartAxesVisibilityState(chartData) {
|
|
159675
|
+
const relevant = (chartData.axes ?? []).filter(
|
|
159676
|
+
(axis) => AXIS_TYPES_WITH_TITLES.includes(axis.axisType)
|
|
159677
|
+
);
|
|
159678
|
+
return relevant.length === 0 || relevant.some((axis) => !axis.deleted);
|
|
159679
|
+
}
|
|
159680
|
+
function chartAxisTitlesPatch(chartData, show) {
|
|
159681
|
+
const axes = (chartData.axes ?? []).map((axis) => {
|
|
159682
|
+
if (!AXIS_TYPES_WITH_TITLES.includes(axis.axisType)) {
|
|
159683
|
+
return axis;
|
|
159684
|
+
}
|
|
159685
|
+
if (!show) {
|
|
159686
|
+
return { ...axis, titleText: void 0 };
|
|
159687
|
+
}
|
|
159688
|
+
return { ...axis, titleText: axis.titleText || DEFAULT_AXIS_TITLE_TEXT };
|
|
159689
|
+
});
|
|
159690
|
+
return { axes };
|
|
159691
|
+
}
|
|
159692
|
+
function chartAxisTitlesState(chartData) {
|
|
159693
|
+
return (chartData.axes ?? []).some(
|
|
159694
|
+
(axis) => AXIS_TYPES_WITH_TITLES.includes(axis.axisType) && Boolean(axis.titleText)
|
|
159695
|
+
);
|
|
159696
|
+
}
|
|
159697
|
+
function applyChartElementToggle(chartData, key2, checked) {
|
|
159698
|
+
switch (key2) {
|
|
159699
|
+
case "title":
|
|
159700
|
+
return patchChartData(chartData, { style: { ...chartData.style, hasTitle: checked } });
|
|
159701
|
+
case "legend":
|
|
159702
|
+
return patchChartData(chartData, { style: { ...chartData.style, hasLegend: checked } });
|
|
159703
|
+
case "dataLabels":
|
|
159704
|
+
return patchChartData(chartData, { style: { ...chartData.style, hasDataLabels: checked } });
|
|
159705
|
+
case "gridlines":
|
|
159706
|
+
return patchChartData(chartData, chartGridlinesPatch(chartData, checked));
|
|
159707
|
+
case "axes":
|
|
159708
|
+
return patchChartData(chartData, chartAxesVisibilityPatch(chartData, checked));
|
|
159709
|
+
case "axisTitles":
|
|
159710
|
+
return patchChartData(chartData, chartAxisTitlesPatch(chartData, checked));
|
|
159711
|
+
default:
|
|
159712
|
+
return chartData;
|
|
159713
|
+
}
|
|
159714
|
+
}
|
|
159715
|
+
var CHART_QUICK_ACTION_BUTTON_SIZE = 24;
|
|
159716
|
+
var BUTTON_GAP = 6;
|
|
159717
|
+
var OUTSIDE_GAP = 8;
|
|
159718
|
+
var BUTTON_ORDER = [
|
|
159719
|
+
{ id: "elements", labelKey: "pptx.chart.quickElements" },
|
|
159720
|
+
{ id: "styles", labelKey: "pptx.chart.quickStyles" },
|
|
159721
|
+
{ id: "filters", labelKey: "pptx.chart.quickFilters" }
|
|
159722
|
+
];
|
|
159723
|
+
function buildButtons(selectionBox, showFilters) {
|
|
159724
|
+
const x = selectionBox.x + selectionBox.width + OUTSIDE_GAP;
|
|
159725
|
+
return BUTTON_ORDER.filter((entry2) => entry2.id !== "filters" || showFilters).map((entry2, i2) => ({
|
|
159726
|
+
...entry2,
|
|
159727
|
+
x,
|
|
159728
|
+
y: selectionBox.y + i2 * (CHART_QUICK_ACTION_BUTTON_SIZE + BUTTON_GAP),
|
|
159729
|
+
size: CHART_QUICK_ACTION_BUTTON_SIZE
|
|
159730
|
+
}));
|
|
159731
|
+
}
|
|
159732
|
+
function buildElements(chartData) {
|
|
159733
|
+
const items = [
|
|
159734
|
+
{ key: "title", labelKey: "pptx.chart.showTitle", checked: chartData.style?.hasTitle ?? false },
|
|
159735
|
+
{
|
|
159736
|
+
key: "legend",
|
|
159737
|
+
labelKey: "pptx.chart.showLegend",
|
|
159738
|
+
checked: chartData.style?.hasLegend ?? false
|
|
159739
|
+
},
|
|
159740
|
+
{
|
|
159741
|
+
key: "gridlines",
|
|
159742
|
+
labelKey: "pptx.chart.showGridlines",
|
|
159743
|
+
checked: chartGridlinesState(chartData)
|
|
159744
|
+
},
|
|
159745
|
+
{
|
|
159746
|
+
key: "dataLabels",
|
|
159747
|
+
labelKey: "pptx.chart.showDataLabels",
|
|
159748
|
+
checked: chartData.style?.hasDataLabels ?? false
|
|
159749
|
+
}
|
|
159750
|
+
];
|
|
159751
|
+
if (chartData.axes && chartData.axes.length > 0) {
|
|
159752
|
+
items.push({
|
|
159753
|
+
key: "axes",
|
|
159754
|
+
labelKey: "pptx.chart.quickAxes",
|
|
159755
|
+
checked: chartAxesVisibilityState(chartData)
|
|
159756
|
+
});
|
|
159757
|
+
items.push({
|
|
159758
|
+
key: "axisTitles",
|
|
159759
|
+
labelKey: "pptx.chart.quickAxisTitles",
|
|
159760
|
+
checked: chartAxisTitlesState(chartData)
|
|
159761
|
+
});
|
|
159762
|
+
}
|
|
159763
|
+
return items;
|
|
159764
|
+
}
|
|
159765
|
+
function buildFilters(chartData) {
|
|
159766
|
+
const visibleSeries = chartData.series.map((series2, index) => ({
|
|
159767
|
+
key: `visible-${index}`,
|
|
159768
|
+
name: series2.name,
|
|
159769
|
+
visible: true,
|
|
159770
|
+
seriesIndex: index,
|
|
159771
|
+
sortKey: series2.idx ?? index
|
|
159772
|
+
}));
|
|
159773
|
+
const filtered = (chartData.filteredSeries ?? []).map((entry2, index) => ({
|
|
159774
|
+
key: `filtered-${index}`,
|
|
159775
|
+
name: entry2.name ?? chartData.filteredSeriesTitle ?? `Series ${index + 1}`,
|
|
159776
|
+
visible: false,
|
|
159777
|
+
filteredIndex: index,
|
|
159778
|
+
sortKey: entry2.idx
|
|
159779
|
+
}));
|
|
159780
|
+
const series = [...visibleSeries, ...filtered].sort((a, b) => a.sortKey - b.sortKey).map(({ sortKey: _sortKey, ...rest }) => rest);
|
|
159781
|
+
return { visible: series.length > 1, series };
|
|
159782
|
+
}
|
|
159783
|
+
function buildChartQuickActionsDescriptor(input) {
|
|
159784
|
+
if (!input.isChartSelected || !input.chartData) {
|
|
159785
|
+
return null;
|
|
159786
|
+
}
|
|
159787
|
+
const { chartData, selectionBox } = input;
|
|
159788
|
+
const filters = buildFilters(chartData);
|
|
159789
|
+
return {
|
|
159790
|
+
buttons: buildButtons(selectionBox, filters.visible),
|
|
159791
|
+
elements: buildElements(chartData),
|
|
159792
|
+
filters,
|
|
159793
|
+
styles: { presets: buildChartStylePresets(chartData) }
|
|
159794
|
+
};
|
|
159795
|
+
}
|
|
159473
159796
|
var TWO_PI = Math.PI * 2;
|
|
159474
159797
|
var ANGLE_EPSILON = TWO_PI * 1e-3;
|
|
159475
159798
|
function buildPieDragGeometry(element, chartData, pointIndex) {
|
|
@@ -159526,7 +159849,7 @@ function buildStackedDragGeometry(element, chartData, seriesIndex, pointIndex) {
|
|
|
159526
159849
|
), plots = computeStackedSeriesPlots(seriesValues, catCount, percent3), baseValue = plots[seriesIndex]?.base[pointIndex] ?? 0, otherAbsSum = seriesValues.reduce(
|
|
159527
159850
|
(sum, values, si) => si === seriesIndex ? sum : sum + Math.abs(values[pointIndex] ?? 0),
|
|
159528
159851
|
0
|
|
159529
|
-
),
|
|
159852
|
+
), layoutOpts = computeLayoutOptions(chartData.axes, chartData.dataTable, chartData.series.length), layout = computePlotLayout(element.width, element.height, chartData, true, layoutOpts), range = percent3 ? { min: 0, max: 100, span: 100 } : computeStackedValueRange(chartData.series, catCount, layout.autoPlotHeight);
|
|
159530
159853
|
return {
|
|
159531
159854
|
range,
|
|
159532
159855
|
plotTop: layout.plotTop,
|
|
@@ -172827,6 +173150,7 @@ var translationsEn = {
|
|
|
172827
173150
|
"pptx.sections.addAfter": "Add Section After",
|
|
172828
173151
|
// Notes
|
|
172829
173152
|
"pptx.notes.title": "Notes",
|
|
173153
|
+
"pptx.notes.hasNotes": "(has notes)",
|
|
172830
173154
|
"pptx.notes.slideN": "Slide {{n}}",
|
|
172831
173155
|
"pptx.notes.noSlide": "No slide selected",
|
|
172832
173156
|
"pptx.notes.clickToAddNotes": "Click to add notes",
|
|
@@ -173027,6 +173351,17 @@ var translationsEn = {
|
|
|
173027
173351
|
"pptx.chart.chartFilters": "Chart filters",
|
|
173028
173352
|
"pptx.chart.hideSeries": "Hide {{name}}",
|
|
173029
173353
|
"pptx.chart.showSeries": "Show {{name}}",
|
|
173354
|
+
"pptx.chart.quickElements": "Chart Elements",
|
|
173355
|
+
"pptx.chart.quickStyles": "Chart Styles",
|
|
173356
|
+
"pptx.chart.quickFilters": "Chart Filters",
|
|
173357
|
+
"pptx.chart.quickAxes": "Axes",
|
|
173358
|
+
"pptx.chart.quickAxisTitles": "Axis Titles",
|
|
173359
|
+
"pptx.chart.styleColorful": "Colorful",
|
|
173360
|
+
"pptx.chart.styleMonochrome": "Monochrome",
|
|
173361
|
+
"pptx.chart.styleColorfulLight": "Colorful Light",
|
|
173362
|
+
"pptx.chart.styleColorfulDark": "Colorful Dark",
|
|
173363
|
+
"pptx.chart.styleMutedDark": "Muted Dark",
|
|
173364
|
+
"pptx.chart.stylePastel": "Pastel",
|
|
173030
173365
|
"pptx.chart.valueFromCells": "Value from cells: {{name}}",
|
|
173031
173366
|
"pptx.chart.removeCategory": "Remove category",
|
|
173032
173367
|
"pptx.chart.axes": "Axes",
|
|
@@ -173171,6 +173506,8 @@ var translationsEn = {
|
|
|
173171
173506
|
"pptx.slideShow.subtitles": "Subtitles",
|
|
173172
173507
|
// Record tab (camera overlay placeholders)
|
|
173173
173508
|
"pptx.record.cameo": "Cameo",
|
|
173509
|
+
"pptx.record.manage": "Manage",
|
|
173510
|
+
"pptx.record.camera": "Camera",
|
|
173174
173511
|
"pptx.record.clear": "Clear",
|
|
173175
173512
|
"pptx.record.learnMore": "Learn More",
|
|
173176
173513
|
"pptx.record.resetToCameo": "Reset to Cameo",
|
|
@@ -175280,6 +175617,7 @@ var translationsEn = {
|
|
|
175280
175617
|
"pptx.textFormatting.paragraphBefore": "Paragraph Before",
|
|
175281
175618
|
"pptx.textFormatting.textFlow": "Text Flow",
|
|
175282
175619
|
"pptx.textProperties.advancedTextHeading": "Advanced Text",
|
|
175620
|
+
"pptx.textProperties.autoFitToShape": "Auto-fit text to shape",
|
|
175283
175621
|
"pptx.textProperties.defaultFontOption": "Default ({{font}})",
|
|
175284
175622
|
"pptx.textProperties.firstIndent": "First Indent",
|
|
175285
175623
|
"pptx.textProperties.leftMargin": "Left Margin",
|
|
@@ -177623,10 +177961,10 @@ function resolveTrackedTextWidth(text22, font, naturalWidth) {
|
|
|
177623
177961
|
const tracking = resolveMetricTrackingPx(text22, font);
|
|
177624
177962
|
return tracking === 0 ? naturalWidth : naturalWidth + tracking * [...text22].length;
|
|
177625
177963
|
}
|
|
177626
|
-
var
|
|
177964
|
+
var PX_PER_POINT2 = 96 / 72;
|
|
177627
177965
|
function authoredLetterSpacingPx(style) {
|
|
177628
177966
|
const spc = style?.characterSpacing;
|
|
177629
|
-
return typeof spc === "number" && spc !== 0 ? spc / 100 *
|
|
177967
|
+
return typeof spc === "number" && spc !== 0 ? spc / 100 * PX_PER_POINT2 : 0;
|
|
177630
177968
|
}
|
|
177631
177969
|
function pieceLetterSpacing(authoredPx, tracking) {
|
|
177632
177970
|
const spacing = authoredPx + tracking;
|
|
@@ -191599,7 +191937,7 @@ function buildSurfaceChart3DData(chartData, categoryLabels, options) {
|
|
|
191599
191937
|
if (seriesCount === 0 || catCount === 0) {
|
|
191600
191938
|
return null;
|
|
191601
191939
|
}
|
|
191602
|
-
const range = computeValueRange2(chartData.series);
|
|
191940
|
+
const range = computeValueRange2(chartData.series, options.height);
|
|
191603
191941
|
const heightMap = new Float32Array(seriesCount * catCount);
|
|
191604
191942
|
const colorMap = new Float32Array(seriesCount * catCount * 3);
|
|
191605
191943
|
const values = new Float32Array(seriesCount * catCount);
|
|
@@ -192432,7 +192770,7 @@ function buildBarChart3DData(chartData, categoryLabels, options) {
|
|
|
192432
192770
|
const isPercent = grouping === "percentStacked";
|
|
192433
192771
|
const horizontal = chartData.barDirection === "bar";
|
|
192434
192772
|
const points4 = buildPoints(chartData, cols, isPercent);
|
|
192435
|
-
const range = isPercent ? { min: 0, max: 100, span: 100 } : grouping === "stacked" ? computeStackedValueRange(chartData.series, cols) : computeValueRange2(chartData.series);
|
|
192773
|
+
const range = isPercent ? { min: 0, max: 100, span: 100 } : grouping === "stacked" ? computeStackedValueRange(chartData.series, cols, options.height) : computeValueRange2(chartData.series, options.height);
|
|
192436
192774
|
const depthPercent = chartData.view3D?.depthPercent;
|
|
192437
192775
|
const boxes = layoutBarChart3D(points4, cols, rows, range, grouping, depthPercent, horizontal);
|
|
192438
192776
|
return {
|
|
@@ -192548,7 +192886,7 @@ function buildCartesianLine3DSceneData(chartData, categoryLabels, options) {
|
|
|
192548
192886
|
return null;
|
|
192549
192887
|
}
|
|
192550
192888
|
const points4 = buildPoints2(chartData, cols);
|
|
192551
|
-
const range = computeValueRange2(chartData.series);
|
|
192889
|
+
const range = computeValueRange2(chartData.series, options.height);
|
|
192552
192890
|
const depthPercent = chartData.view3D?.depthPercent;
|
|
192553
192891
|
const series = layoutCartesianLine3DSeries(points4, cols, rows, range, depthPercent);
|
|
192554
192892
|
return {
|
|
@@ -207424,6 +207762,7 @@ exports.BEVEL_PRESETS = BEVEL_PRESETS;
|
|
|
207424
207762
|
exports.BROADCAST_THROTTLE_MS = BROADCAST_THROTTLE_MS;
|
|
207425
207763
|
exports.CATEGORIES = CATEGORIES;
|
|
207426
207764
|
exports.CHARACTER_SPACING_OPTIONS = CHARACTER_SPACING_OPTIONS;
|
|
207765
|
+
exports.CHART_QUICK_ACTION_BUTTON_SIZE = CHART_QUICK_ACTION_BUTTON_SIZE;
|
|
207427
207766
|
exports.CHART_TYPE_OPTIONS = CHART_TYPE_OPTIONS;
|
|
207428
207767
|
exports.CINEMATIC_TRANSITION_KEYFRAMES = CINEMATIC_TRANSITION_KEYFRAMES;
|
|
207429
207768
|
exports.COMMENT_MARKER_SIZE = COMMENT_MARKER_SIZE;
|
|
@@ -207617,7 +207956,9 @@ exports.applyActiveInlineListFormatting = applyActiveInlineListFormatting;
|
|
|
207617
207956
|
exports.applyAnimationTimelineOrder = applyAnimationTimelineOrder;
|
|
207618
207957
|
exports.applyAutoCorrect = applyAutoCorrect;
|
|
207619
207958
|
exports.applyCaseTransformToSegments = applyCaseTransformToSegments;
|
|
207959
|
+
exports.applyChartElementToggle = applyChartElementToggle;
|
|
207620
207960
|
exports.applyChartPartHighlight = applyChartPartHighlight;
|
|
207961
|
+
exports.applyChartStylePreset = applyChartStylePreset;
|
|
207621
207962
|
exports.applyColorChange = applyColorChange;
|
|
207622
207963
|
exports.applyDuotone = applyDuotone;
|
|
207623
207964
|
exports.applyFindReplacements = applyFindReplacements;
|
|
@@ -207674,6 +208015,7 @@ exports.buildBroadcastViewerUrl = buildBroadcastViewerUrl;
|
|
|
207674
208015
|
exports.buildCacheKey = buildCacheKey;
|
|
207675
208016
|
exports.buildCalloutLeaderLineSvgPath = buildCalloutLeaderLineSvgPath;
|
|
207676
208017
|
exports.buildChartMarkDragGeometry = buildChartMarkDragGeometry;
|
|
208018
|
+
exports.buildChartQuickActionsDescriptor = buildChartQuickActionsDescriptor;
|
|
207677
208019
|
exports.buildChartViewModel = buildChartViewModel;
|
|
207678
208020
|
exports.buildChromeStyle = buildChromeStyle;
|
|
207679
208021
|
exports.buildCollaborationShareUrl = buildCollaborationShareUrl;
|