@rowsncolumns/toolkit 24.5.8 → 24.5.10
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/cjs/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/charts.js +64 -15
- package/dist/cjs/exporter/xlsx/chart-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/chart-builder.js +98 -31
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/charts.js +55 -0
- package/dist/esm/exporter/xlsx/chart-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/chart-builder.js +70 -24
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/charts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EAGT,aAAa,EACb,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAEhB,UAAU,EACV,UAAU,EACX,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrE;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;AAkDnF,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,kBAAkB,EAC7B,SAAS,EAAE,GAAG,EACd,eAAe,CAAC,EAAE,eAAe,EACjC,cAAc,CAAC,EAAE,cAAc,GAC9B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../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ACzB,SAAS,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACD,SAAS,CAiCZ"}
|
|
@@ -52,7 +52,7 @@ function toInt(value) {
|
|
|
52
52
|
}
|
|
53
53
|
export function processChart(chartTarget, drawingPath, anchor, sheetId, zipParser, xmlParser, sheetDimensions, resolveSheetId) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
-
var chartPath, drawingDir, chartContent, chartXml, chart, chartSpaceRoot, roundedCornersRaw, roundedCornersVal, roundedCorners, chartStyle, pivotSourceName, pivotSourceFormatId, pivotFormats, pivotFieldButtons, chartSpacePr, chartAreaFill, chartAreaBorder, chartId, title, titleTextFormat, chartType, plotArea, series, domains, dataRange, bubbleSizes, scatterStyle, hiddenDimensionStrategy, emptyCells, showNaAsEmpty, position, legend, dataLabels, _a, valueAxisOptions, secondaryValueAxisOptions, categoryAxisOptions, doughnutHoleSize, explosion, ofPieOptions, threeDSourceChartType, radarStyle, binCount, barLayout, lineLayout, stockVariant, err_1;
|
|
55
|
+
var chartPath, drawingDir, chartContent, chartXml, chart, chartSpaceRoot, roundedCornersRaw, roundedCornersVal, roundedCorners, chartStyle, pivotSourceName, pivotSourceFormatId, pivotFormats, pivotFieldButtons, chartSpacePr, chartAreaFill, chartAreaBorder, chartId, title, titleTextFormat, chartType, plotArea, series, domains, dataRange, bubbleSizes, scatterStyle, bubbleSizing, hiddenDimensionStrategy, emptyCells, showNaAsEmpty, position, legend, dataLabels, _a, valueAxisOptions, secondaryValueAxisOptions, categoryAxisOptions, doughnutHoleSize, explosion, ofPieOptions, threeDSourceChartType, radarStyle, binCount, barLayout, lineLayout, stockVariant, err_1;
|
|
56
56
|
var _b, _c;
|
|
57
57
|
var _d, _e, _f, _g;
|
|
58
58
|
return __generator(this, function (_h) {
|
|
@@ -121,6 +121,7 @@ export function processChart(chartTarget, drawingPath, anchor, sheetId, zipParse
|
|
|
121
121
|
? extractChartBubbleSizes(plotArea, sheetId, resolveSheetId)
|
|
122
122
|
: undefined;
|
|
123
123
|
scatterStyle = chartType === "scatter" ? extractScatterStyle(plotArea) : undefined;
|
|
124
|
+
bubbleSizing = chartType === "bubble" ? extractBubbleSizing(plotArea) : undefined;
|
|
124
125
|
hiddenDimensionStrategy = extractHiddenDimensionStrategy(chart);
|
|
125
126
|
emptyCells = extractEmptyCellsPolicy(chart);
|
|
126
127
|
showNaAsEmpty = extractShowNaAsEmpty(chart);
|
|
@@ -147,11 +148,11 @@ export function processChart(chartTarget, drawingPath, anchor, sheetId, zipParse
|
|
|
147
148
|
: undefined;
|
|
148
149
|
lineLayout = chartType === "line" ? extractLineChartOptions(plotArea, series) : undefined;
|
|
149
150
|
stockVariant = chartType === "stock" ? extractStockVariant(plotArea) : undefined;
|
|
150
|
-
return [2 /*return*/, __assign(__assign({ chartId: chartId, spec: __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ title: title }, (titleTextFormat ? { titleTextFormat: titleTextFormat } : {})), { chartType: chartType, domains: domains, series: series, dataRange: dataRange, hiddenDimensionStrategy: hiddenDimensionStrategy }), (emptyCells && emptyCells !== "gaps" ? { emptyCells: emptyCells } : {})), (showNaAsEmpty === false ? { showNaAsEmpty: showNaAsEmpty } : {})), (chartType === "scatter" || chartType === "bubble"
|
|
151
|
+
return [2 /*return*/, __assign(__assign({ chartId: chartId, spec: __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ title: title }, (titleTextFormat ? { titleTextFormat: titleTextFormat } : {})), { chartType: chartType, domains: domains, series: series, dataRange: dataRange, hiddenDimensionStrategy: hiddenDimensionStrategy }), (emptyCells && emptyCells !== "gaps" ? { emptyCells: emptyCells } : {})), (showNaAsEmpty === false ? { showNaAsEmpty: showNaAsEmpty } : {})), (chartType === "scatter" || chartType === "bubble"
|
|
151
152
|
? { bubbleLabels: [] }
|
|
152
153
|
: {})), (bubbleSizes && bubbleSizes.length ? { bubbleSizes: bubbleSizes } : {})), (scatterStyle
|
|
153
154
|
? { scatterStyle: scatterStyle }
|
|
154
|
-
: {})), (legend ? { legend: legend } : {})), (dataLabels ? { dataLabels: dataLabels } : {})), (valueAxisOptions ? { valueAxisOptions: valueAxisOptions } : {})), (secondaryValueAxisOptions
|
|
155
|
+
: {})), (bubbleSizing !== null && bubbleSizing !== void 0 ? bubbleSizing : {})), (legend ? { legend: legend } : {})), (dataLabels ? { dataLabels: dataLabels } : {})), (valueAxisOptions ? { valueAxisOptions: valueAxisOptions } : {})), (secondaryValueAxisOptions
|
|
155
156
|
? { secondaryValueAxisOptions: secondaryValueAxisOptions }
|
|
156
157
|
: {})), (categoryAxisOptions ? { categoryAxisOptions: categoryAxisOptions } : {})), (typeof doughnutHoleSize === "number"
|
|
157
158
|
? { doughnutHoleSize: doughnutHoleSize }
|
|
@@ -1586,6 +1587,7 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1586
1587
|
var errorBars = extractErrorBars(ser, sheetId, resolveSheetId);
|
|
1587
1588
|
var marker = extractSeriesMarker(ser);
|
|
1588
1589
|
var dataPointColors = extractSeriesDataPointColors(ser);
|
|
1590
|
+
var seriesDataLabels = extractSeriesDataLabels(ser);
|
|
1589
1591
|
var nameRef = getWithFallback(ser, TX_REF_PATHS);
|
|
1590
1592
|
// Per-series category reference — charts whose series plot against
|
|
1591
1593
|
// different category ranges can't be represented by the single
|
|
@@ -1597,9 +1599,9 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1597
1599
|
? resolveSourcesFromRef(serCatRef, sheetId, resolveSheetId)
|
|
1598
1600
|
: [];
|
|
1599
1601
|
orders.push(seriesOrderOf(ser));
|
|
1600
|
-
series.push(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dataLabel: seriesTitle || "Series ".concat(seriesIndex + 1) }, (nameRef ? { dataLabelRef: nameRef } : {})), (categorySources.length ? { categorySources: categorySources } : {})), { color: colorInfo.color }), (colorInfo.noFill ? { noFill: true } : {})), { negativeColor: colorInfo.negativeColor, invertIfNegative: colorInfo.invertIfNegative }), (colorInfo.gradient ? { gradient: colorInfo.gradient } : {})), (container.isXY ? {} : { seriesChartType: seriesChartType })), (useSecondaryAxis ? { useSecondaryAxis: true } : {})), { sources: sources }), (inlineValues && inlineValues.length ? { inlineValues: inlineValues } : {})), (trendlines && trendlines.length ? { trendlines: trendlines } : {})), (errorBars ? { errorBars: errorBars } : {})), (marker ? { marker: marker } : {})), (dataPointColors && dataPointColors.length
|
|
1602
|
+
series.push(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dataLabel: seriesTitle || "Series ".concat(seriesIndex + 1) }, (nameRef ? { dataLabelRef: nameRef } : {})), (categorySources.length ? { categorySources: categorySources } : {})), { color: colorInfo.color }), (colorInfo.noFill ? { noFill: true } : {})), { negativeColor: colorInfo.negativeColor, invertIfNegative: colorInfo.invertIfNegative }), (colorInfo.gradient ? { gradient: colorInfo.gradient } : {})), (container.isXY ? {} : { seriesChartType: seriesChartType })), (useSecondaryAxis ? { useSecondaryAxis: true } : {})), { sources: sources }), (inlineValues && inlineValues.length ? { inlineValues: inlineValues } : {})), (trendlines && trendlines.length ? { trendlines: trendlines } : {})), (errorBars ? { errorBars: errorBars } : {})), (marker ? { marker: marker } : {})), (dataPointColors && dataPointColors.length
|
|
1601
1603
|
? { dataPointColors: dataPointColors }
|
|
1602
|
-
: {})));
|
|
1604
|
+
: {})), (seriesDataLabels ? { dataLabels: seriesDataLabels } : {})));
|
|
1603
1605
|
seriesIndex++;
|
|
1604
1606
|
}
|
|
1605
1607
|
}
|
|
@@ -1653,6 +1655,7 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1653
1655
|
}
|
|
1654
1656
|
var marker = extractSeriesMarker(ser);
|
|
1655
1657
|
var dataPointColors = extractSeriesDataPointColors(ser);
|
|
1658
|
+
var seriesDataLabels = extractSeriesDataLabels(ser);
|
|
1656
1659
|
var nameRef = getWithFallback(ser, TX_REF_PATHS);
|
|
1657
1660
|
var serCatRef = isXYChart(chartType)
|
|
1658
1661
|
? undefined
|
|
@@ -1661,9 +1664,9 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1661
1664
|
? resolveSourcesFromRef(serCatRef, sheetId, resolveSheetId)
|
|
1662
1665
|
: [];
|
|
1663
1666
|
orders.push(seriesOrderOf(ser));
|
|
1664
|
-
series.push(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dataLabel: seriesTitle || "Series ".concat(index + 1) }, (nameRef ? { dataLabelRef: nameRef } : {})), (categorySources.length ? { categorySources: categorySources } : {})), { color: colorInfo.color }), (colorInfo.noFill ? { noFill: true } : {})), { negativeColor: colorInfo.negativeColor, invertIfNegative: colorInfo.invertIfNegative }), (colorInfo.gradient ? { gradient: colorInfo.gradient } : {})), { sources: sources }), (inlineValues && inlineValues.length ? { inlineValues: inlineValues } : {})), (marker ? { marker: marker } : {})), (dataPointColors && dataPointColors.length
|
|
1667
|
+
series.push(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dataLabel: seriesTitle || "Series ".concat(index + 1) }, (nameRef ? { dataLabelRef: nameRef } : {})), (categorySources.length ? { categorySources: categorySources } : {})), { color: colorInfo.color }), (colorInfo.noFill ? { noFill: true } : {})), { negativeColor: colorInfo.negativeColor, invertIfNegative: colorInfo.invertIfNegative }), (colorInfo.gradient ? { gradient: colorInfo.gradient } : {})), { sources: sources }), (inlineValues && inlineValues.length ? { inlineValues: inlineValues } : {})), (marker ? { marker: marker } : {})), (dataPointColors && dataPointColors.length
|
|
1665
1668
|
? { dataPointColors: dataPointColors }
|
|
1666
|
-
: {})));
|
|
1669
|
+
: {})), (seriesDataLabels ? { dataLabels: seriesDataLabels } : {})));
|
|
1667
1670
|
});
|
|
1668
1671
|
}
|
|
1669
1672
|
}
|
|
@@ -2019,6 +2022,24 @@ function extractScatterStyle(plotArea) {
|
|
|
2019
2022
|
var val = (_c = (_b = (_a = get(plotArea, "c:scatterChart.c:scatterStyle.a$.val")) !== null && _a !== void 0 ? _a : get(plotArea, "scatterChart.scatterStyle.a$.val")) !== null && _b !== void 0 ? _b : get(plotArea, "c:scatterChart.c:scatterStyle.a$.t$")) !== null && _c !== void 0 ? _c : get(plotArea, "scatterChart.scatterStyle.a$.t$");
|
|
2020
2023
|
return typeof val === "string" && val ? val : undefined;
|
|
2021
2024
|
}
|
|
2025
|
+
/**
|
|
2026
|
+
* Bubble-chart sizing: `<c:bubbleScale val="0..300">` and
|
|
2027
|
+
* `<c:sizeRepresents val="area|w">` under `<c:bubbleChart>`. Only the
|
|
2028
|
+
* non-default values are recorded (Excel's defaults are 100 and area).
|
|
2029
|
+
*/
|
|
2030
|
+
function extractBubbleSizing(plotArea) {
|
|
2031
|
+
var _a, _b;
|
|
2032
|
+
var result = {};
|
|
2033
|
+
var scale = Number((_a = get(plotArea, "c:bubbleChart.c:bubbleScale.a$.val")) !== null && _a !== void 0 ? _a : get(plotArea, "bubbleChart.bubbleScale.a$.val"));
|
|
2034
|
+
if (Number.isFinite(scale) && scale !== 100) {
|
|
2035
|
+
result.bubbleScale = scale;
|
|
2036
|
+
}
|
|
2037
|
+
var represents = (_b = get(plotArea, "c:bubbleChart.c:sizeRepresents.a$.val")) !== null && _b !== void 0 ? _b : get(plotArea, "bubbleChart.sizeRepresents.a$.val");
|
|
2038
|
+
if (represents === "w") {
|
|
2039
|
+
result.sizeRepresents = "width";
|
|
2040
|
+
}
|
|
2041
|
+
return Object.keys(result).length ? result : undefined;
|
|
2042
|
+
}
|
|
2022
2043
|
function extractSeriesTitleFromSeries(ser) {
|
|
2023
2044
|
var e_25, _a;
|
|
2024
2045
|
// Prefer cached textual value if present
|
|
@@ -2707,7 +2728,7 @@ var mapDataLabelPosition = function (val) {
|
|
|
2707
2728
|
};
|
|
2708
2729
|
function extractDataLabelsOptions(plotArea, chartType) {
|
|
2709
2730
|
var e_35, _a;
|
|
2710
|
-
var _b, _c, _d, _e
|
|
2731
|
+
var _b, _c, _d, _e;
|
|
2711
2732
|
// Look for <c:dLbls> inside the chartType-specific container. We pick
|
|
2712
2733
|
// the first one we find — chart-level labels apply to all series.
|
|
2713
2734
|
// The 3-D classes (bar3DChart / line3DChart / pie3DChart / area3DChart)
|
|
@@ -2727,6 +2748,8 @@ function extractDataLabelsOptions(plotArea, chartType) {
|
|
|
2727
2748
|
],
|
|
2728
2749
|
doughnut: ["c:doughnutChart", "doughnutChart"],
|
|
2729
2750
|
area: ["c:areaChart", "areaChart", "c:area3DChart", "area3DChart"],
|
|
2751
|
+
scatter: ["c:scatterChart", "scatterChart"],
|
|
2752
|
+
bubble: ["c:bubbleChart", "bubbleChart"],
|
|
2730
2753
|
};
|
|
2731
2754
|
var keys = (_b = containerKeys[chartType]) !== null && _b !== void 0 ? _b : [];
|
|
2732
2755
|
var container;
|
|
@@ -2746,43 +2769,69 @@ function extractDataLabelsOptions(plotArea, chartType) {
|
|
|
2746
2769
|
var dLbls = (_e = (_d = (_c = get(container, "c:dLbls")) !== null && _c !== void 0 ? _c : get(container, "dLbls")) !== null && _d !== void 0 ? _d : get(plotArea, "c:dLbls")) !== null && _e !== void 0 ? _e : get(plotArea, "dLbls");
|
|
2747
2770
|
if (!dLbls)
|
|
2748
2771
|
return undefined;
|
|
2772
|
+
return readDataLabelsNode(dLbls);
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* `<c:ser><c:dLbls>` — this series' own labels, which replace the group's
|
|
2776
|
+
* for it. `<c:delete val="1"/>`, or a node with every `show*` flag off,
|
|
2777
|
+
* turns a labelled group's labels off for the series.
|
|
2778
|
+
*/
|
|
2779
|
+
function extractSeriesDataLabels(ser) {
|
|
2780
|
+
var _a, _b;
|
|
2781
|
+
var dLbls = (_a = get(ser, "c:dLbls")) !== null && _a !== void 0 ? _a : get(ser, "dLbls");
|
|
2782
|
+
if (!dLbls)
|
|
2783
|
+
return undefined;
|
|
2784
|
+
var deleted = readBoolean((_b = get(dLbls, "c:delete.a$.val")) !== null && _b !== void 0 ? _b : get(dLbls, "delete.a$.val"));
|
|
2785
|
+
if (deleted)
|
|
2786
|
+
return { show: false };
|
|
2787
|
+
var options = readDataLabelsNode(dLbls);
|
|
2788
|
+
return (options === null || options === void 0 ? void 0 : options.show) ? options : { show: false };
|
|
2789
|
+
}
|
|
2790
|
+
/** The `ChartDataLabelsOptions` a `<c:dLbls>` node describes. */
|
|
2791
|
+
function readDataLabelsNode(dLbls) {
|
|
2792
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2749
2793
|
var result = {};
|
|
2750
|
-
var pos = (
|
|
2794
|
+
var pos = (_a = get(dLbls, "c:dLblPos.a$.val")) !== null && _a !== void 0 ? _a : get(dLbls, "dLblPos.a$.val");
|
|
2751
2795
|
var position = mapDataLabelPosition(pos);
|
|
2752
2796
|
if (position)
|
|
2753
2797
|
result.position = position;
|
|
2754
|
-
var showVal = readBoolean((
|
|
2798
|
+
var showVal = readBoolean((_b = get(dLbls, "c:showVal.a$.val")) !== null && _b !== void 0 ? _b : get(dLbls, "showVal.a$.val"));
|
|
2755
2799
|
if (showVal) {
|
|
2756
2800
|
result.show = true;
|
|
2757
2801
|
result.showValue = true;
|
|
2758
2802
|
}
|
|
2759
|
-
var showCat = readBoolean((
|
|
2803
|
+
var showCat = readBoolean((_c = get(dLbls, "c:showCatName.a$.val")) !== null && _c !== void 0 ? _c : get(dLbls, "showCatName.a$.val"));
|
|
2760
2804
|
if (showCat) {
|
|
2761
2805
|
result.show = true;
|
|
2762
2806
|
result.showCategoryName = true;
|
|
2763
2807
|
}
|
|
2764
|
-
var showPct = readBoolean((
|
|
2808
|
+
var showPct = readBoolean((_d = get(dLbls, "c:showPercent.a$.val")) !== null && _d !== void 0 ? _d : get(dLbls, "showPercent.a$.val"));
|
|
2765
2809
|
if (showPct) {
|
|
2766
2810
|
result.show = true;
|
|
2767
2811
|
result.showPercent = true;
|
|
2768
2812
|
}
|
|
2769
|
-
var showSer = readBoolean((
|
|
2813
|
+
var showSer = readBoolean((_e = get(dLbls, "c:showSerName.a$.val")) !== null && _e !== void 0 ? _e : get(dLbls, "showSerName.a$.val"));
|
|
2770
2814
|
if (showSer) {
|
|
2771
2815
|
result.show = true;
|
|
2772
2816
|
result.showSeriesName = true;
|
|
2773
2817
|
}
|
|
2818
|
+
var showBubbleSize = readBoolean((_f = get(dLbls, "c:showBubbleSize.a$.val")) !== null && _f !== void 0 ? _f : get(dLbls, "showBubbleSize.a$.val"));
|
|
2819
|
+
if (showBubbleSize) {
|
|
2820
|
+
result.show = true;
|
|
2821
|
+
result.showBubbleSize = true;
|
|
2822
|
+
}
|
|
2774
2823
|
// If only `position` was set with no `show*` flags, treat as "show".
|
|
2775
2824
|
if (position && result.show === undefined)
|
|
2776
2825
|
result.show = true;
|
|
2777
2826
|
// <c:txPr> on the dLbls block — affects every label in the chart.
|
|
2778
|
-
var textFormat = extractTextProperties((
|
|
2827
|
+
var textFormat = extractTextProperties((_g = get(dLbls, "c:txPr")) !== null && _g !== void 0 ? _g : get(dLbls, "txPr"));
|
|
2779
2828
|
if (textFormat)
|
|
2780
2829
|
result.textFormat = textFormat;
|
|
2781
2830
|
// <c:numFmt formatCode="…"/> — Excel uses this to render labels as
|
|
2782
2831
|
// currency / percent / etc. (`"$"#,##0`, `0.00%`). Without parsing
|
|
2783
2832
|
// this, the renderer falls back to raw numbers (e.g. `1831` instead
|
|
2784
2833
|
// of `$1,831`).
|
|
2785
|
-
var numFmt = (
|
|
2834
|
+
var numFmt = (_k = (_j = (_h = get(dLbls, "c:numFmt.a$.formatCode")) !== null && _h !== void 0 ? _h : get(dLbls, "numFmt.a$.formatCode")) !== null && _j !== void 0 ? _j : get(dLbls, "c:numFmt.a$.t$")) !== null && _k !== void 0 ? _k : get(dLbls, "numFmt.a$.t$");
|
|
2786
2835
|
if (typeof numFmt === "string" && numFmt) {
|
|
2787
2836
|
result.numberFormatPattern = numFmt;
|
|
2788
2837
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/chart-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAi4CnC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,YAAY,EAAE,MAAM,GAAG,MAAM,KAC1B,MAAM,GAAG,SAAS,CAAC;AAExB,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,yBAAyB,sBAAsB,KAC9C,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"chart-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/chart-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAi4CnC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,YAAY,EAAE,MAAM,GAAG,MAAM,KAC1B,MAAM,GAAG,SAAS,CAAC;AAExB,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,yBAAyB,sBAAsB,KAC9C,MAAM,GAAG,SAqrBX,CAAC"}
|
|
@@ -1723,9 +1723,20 @@ export var buildChartXml = function (input, sheetNameById, resolvePivotSourceNam
|
|
|
1723
1723
|
var scatterChart = plotArea["c:scatterChart"];
|
|
1724
1724
|
if (chartType === "bubble") {
|
|
1725
1725
|
removeProp(scatterChart, "c:scatterStyle");
|
|
1726
|
-
|
|
1726
|
+
// `bubbleScale` / `sizeRepresents` round-trip from the spec; Excel's
|
|
1727
|
+
// defaults (100 / area) fill in when the spec is silent.
|
|
1728
|
+
var bubbleScale = chart.spec.bubbleScale;
|
|
1729
|
+
scatterChart["c:bubbleScale"] = {
|
|
1730
|
+
a$: {
|
|
1731
|
+
val: String(typeof bubbleScale === "number" && Number.isFinite(bubbleScale)
|
|
1732
|
+
? Math.min(300, Math.max(0, Math.round(bubbleScale)))
|
|
1733
|
+
: 100),
|
|
1734
|
+
},
|
|
1735
|
+
};
|
|
1727
1736
|
scatterChart["c:showNegBubbles"] = { a$: { val: "0" } };
|
|
1728
|
-
scatterChart["c:sizeRepresents"] = {
|
|
1737
|
+
scatterChart["c:sizeRepresents"] = {
|
|
1738
|
+
a$: { val: chart.spec.sizeRepresents === "width" ? "w" : "area" },
|
|
1739
|
+
};
|
|
1729
1740
|
replacePlotAreaChartGroups(plotArea, [["c:bubbleChart", scatterChart]], "c:scatterChart");
|
|
1730
1741
|
}
|
|
1731
1742
|
else {
|
|
@@ -2170,8 +2181,9 @@ var SERIES_CONTAINER_KEYS = [
|
|
|
2170
2181
|
];
|
|
2171
2182
|
/**
|
|
2172
2183
|
* Walk the per-chart-type containers in plotArea and apply trendlines
|
|
2173
|
-
* / errBars to each emitted `<c:ser>`. The
|
|
2174
|
-
* matches the order emitted by the builder,
|
|
2184
|
+
* / errBars / the series' own data labels to each emitted `<c:ser>`. The
|
|
2185
|
+
* series order in spec.series matches the order emitted by the builder,
|
|
2186
|
+
* so we index by position.
|
|
2175
2187
|
*/
|
|
2176
2188
|
var applySeriesOverlays = function (plotArea, series, sheetNameById) {
|
|
2177
2189
|
var e_19, _a, e_20, _b, e_21, _c;
|
|
@@ -2222,6 +2234,13 @@ var applySeriesOverlays = function (plotArea, series, sheetNameById) {
|
|
|
2222
2234
|
if (built)
|
|
2223
2235
|
node["c:errBars"] = built;
|
|
2224
2236
|
}
|
|
2237
|
+
// `ChartData.dataLabels` — the series' own `<c:dLbls>` overrides the
|
|
2238
|
+
// group's; `{ show: false }` is Excel's `<c:delete val="1"/>`.
|
|
2239
|
+
if (data.dataLabels) {
|
|
2240
|
+
node["c:dLbls"] = data.dataLabels.show
|
|
2241
|
+
? buildDataLabelsNode(data.dataLabels)
|
|
2242
|
+
: { "c:delete": { a$: { val: "1" } } };
|
|
2243
|
+
}
|
|
2225
2244
|
}
|
|
2226
2245
|
}
|
|
2227
2246
|
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
@@ -2717,25 +2736,8 @@ var applyLegend = function (chartNode, legend) {
|
|
|
2717
2736
|
}
|
|
2718
2737
|
chartNode["c:legend"] = __assign({ "c:legendPos": { a$: { val: posCode } }, "c:overlay": { a$: { val: "0" } } }, (txPr ? { "c:txPr": txPr } : {}));
|
|
2719
2738
|
};
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
if (!(dataLabels === null || dataLabels === void 0 ? void 0 : dataLabels.show))
|
|
2723
|
-
return;
|
|
2724
|
-
// Find the chart-type container inside <c:plotArea>. We attach <c:dLbls>
|
|
2725
|
-
// to whichever exists.
|
|
2726
|
-
// Chart-level labels apply to every chart group — a combo chart has
|
|
2727
|
-
// one per series type.
|
|
2728
|
-
var containers = [
|
|
2729
|
-
"c:barChart",
|
|
2730
|
-
"c:lineChart",
|
|
2731
|
-
"c:pieChart",
|
|
2732
|
-
"c:doughnutChart",
|
|
2733
|
-
"c:areaChart",
|
|
2734
|
-
]
|
|
2735
|
-
.flatMap(function (k) { return (Array.isArray(plotArea[k]) ? plotArea[k] : [plotArea[k]]); })
|
|
2736
|
-
.filter(Boolean);
|
|
2737
|
-
if (!containers.length)
|
|
2738
|
-
return;
|
|
2739
|
+
/** A `<c:dLbls>` node for `ChartDataLabelsOptions` with `show: true`. */
|
|
2740
|
+
var buildDataLabelsNode = function (dataLabels) {
|
|
2739
2741
|
var posCode = dataLabels.position && DLBL_POS[dataLabels.position];
|
|
2740
2742
|
var dLbls = {};
|
|
2741
2743
|
if (posCode)
|
|
@@ -2772,11 +2774,76 @@ var applyDataLabels = function (plotArea, dataLabels) {
|
|
|
2772
2774
|
dLbls["c:showPercent"] = {
|
|
2773
2775
|
a$: { val: dataLabels.showPercent ? "1" : "0" },
|
|
2774
2776
|
};
|
|
2775
|
-
dLbls["c:showBubbleSize"] = {
|
|
2777
|
+
dLbls["c:showBubbleSize"] = {
|
|
2778
|
+
a$: { val: dataLabels.showBubbleSize ? "1" : "0" },
|
|
2779
|
+
};
|
|
2780
|
+
return dLbls;
|
|
2781
|
+
};
|
|
2782
|
+
var applyDataLabels = function (plotArea, dataLabels) {
|
|
2783
|
+
var e_27, _a, e_28, _b, e_29, _c;
|
|
2784
|
+
if (!(dataLabels === null || dataLabels === void 0 ? void 0 : dataLabels.show))
|
|
2785
|
+
return;
|
|
2786
|
+
// Find the chart-type container inside <c:plotArea>. We attach <c:dLbls>
|
|
2787
|
+
// to whichever exists.
|
|
2788
|
+
// Chart-level labels apply to every chart group — a combo chart has
|
|
2789
|
+
// one per series type.
|
|
2790
|
+
var containers = [
|
|
2791
|
+
"c:barChart",
|
|
2792
|
+
"c:lineChart",
|
|
2793
|
+
"c:pieChart",
|
|
2794
|
+
"c:doughnutChart",
|
|
2795
|
+
"c:areaChart",
|
|
2796
|
+
"c:scatterChart",
|
|
2797
|
+
"c:bubbleChart",
|
|
2798
|
+
]
|
|
2799
|
+
.flatMap(function (k) { return (Array.isArray(plotArea[k]) ? plotArea[k] : [plotArea[k]]); })
|
|
2800
|
+
.filter(Boolean);
|
|
2801
|
+
if (!containers.length)
|
|
2802
|
+
return;
|
|
2803
|
+
var dLbls = buildDataLabelsNode(dataLabels);
|
|
2776
2804
|
try {
|
|
2777
2805
|
for (var containers_1 = __values(containers), containers_1_1 = containers_1.next(); !containers_1_1.done; containers_1_1 = containers_1.next()) {
|
|
2778
2806
|
var container = containers_1_1.value;
|
|
2779
|
-
|
|
2807
|
+
// Every chart group's schema puts <c:dLbls> right after its series
|
|
2808
|
+
// (before gapWidth / bubbleScale / axId …): splice it in there so the
|
|
2809
|
+
// serialised child order stays valid.
|
|
2810
|
+
var next = {};
|
|
2811
|
+
var placed = false;
|
|
2812
|
+
try {
|
|
2813
|
+
for (var _d = (e_28 = void 0, __values(Object.entries(container))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
2814
|
+
var _f = __read(_e.value, 2), key = _f[0], value = _f[1];
|
|
2815
|
+
if (key === "c:dLbls")
|
|
2816
|
+
continue;
|
|
2817
|
+
next[key] = value;
|
|
2818
|
+
if (key === "c:ser") {
|
|
2819
|
+
next["c:dLbls"] = cloneTemplate(dLbls);
|
|
2820
|
+
placed = true;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
2825
|
+
finally {
|
|
2826
|
+
try {
|
|
2827
|
+
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
|
2828
|
+
}
|
|
2829
|
+
finally { if (e_28) throw e_28.error; }
|
|
2830
|
+
}
|
|
2831
|
+
if (!placed)
|
|
2832
|
+
next["c:dLbls"] = cloneTemplate(dLbls);
|
|
2833
|
+
try {
|
|
2834
|
+
for (var _g = (e_29 = void 0, __values(Object.keys(container))), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
2835
|
+
var key = _h.value;
|
|
2836
|
+
delete container[key];
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
2840
|
+
finally {
|
|
2841
|
+
try {
|
|
2842
|
+
if (_h && !_h.done && (_c = _g.return)) _c.call(_g);
|
|
2843
|
+
}
|
|
2844
|
+
finally { if (e_29) throw e_29.error; }
|
|
2845
|
+
}
|
|
2846
|
+
Object.assign(container, next);
|
|
2780
2847
|
}
|
|
2781
2848
|
}
|
|
2782
2849
|
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
@@ -2858,7 +2925,7 @@ var applyExplosion = function (plotArea, explosion) {
|
|
|
2858
2925
|
: [];
|
|
2859
2926
|
var explosionNode = { a$: { val: String(Math.round(explosion)) } };
|
|
2860
2927
|
var rebuiltSers = sers.map(function (ser) {
|
|
2861
|
-
var
|
|
2928
|
+
var e_30, _a;
|
|
2862
2929
|
var rebuilt = {};
|
|
2863
2930
|
var placed = false;
|
|
2864
2931
|
try {
|
|
@@ -2873,12 +2940,12 @@ var applyExplosion = function (plotArea, explosion) {
|
|
|
2873
2940
|
rebuilt[key] = value;
|
|
2874
2941
|
}
|
|
2875
2942
|
}
|
|
2876
|
-
catch (
|
|
2943
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
2877
2944
|
finally {
|
|
2878
2945
|
try {
|
|
2879
2946
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2880
2947
|
}
|
|
2881
|
-
finally { if (
|
|
2948
|
+
finally { if (e_30) throw e_30.error; }
|
|
2882
2949
|
}
|
|
2883
2950
|
if (!placed)
|
|
2884
2951
|
rebuilt["c:explosion"] = explosionNode;
|
|
@@ -2930,7 +2997,7 @@ var applySliceColors = function (plotArea, spec) {
|
|
|
2930
2997
|
var palette = spec === null || spec === void 0 ? void 0 : spec.palette;
|
|
2931
2998
|
var series = ((_b = spec === null || spec === void 0 ? void 0 : spec.series) !== null && _b !== void 0 ? _b : []);
|
|
2932
2999
|
var rebuiltSers = sers.map(function (ser, index) {
|
|
2933
|
-
var
|
|
3000
|
+
var e_31, _a;
|
|
2934
3001
|
var _b;
|
|
2935
3002
|
var entry = series[index];
|
|
2936
3003
|
var authored = entry === null || entry === void 0 ? void 0 : entry.dataPointColors;
|
|
@@ -2954,12 +3021,12 @@ var applySliceColors = function (plotArea, spec) {
|
|
|
2954
3021
|
rebuilt[key] = value;
|
|
2955
3022
|
}
|
|
2956
3023
|
}
|
|
2957
|
-
catch (
|
|
3024
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2958
3025
|
finally {
|
|
2959
3026
|
try {
|
|
2960
3027
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2961
3028
|
}
|
|
2962
|
-
finally { if (
|
|
3029
|
+
finally { if (e_31) throw e_31.error; }
|
|
2963
3030
|
}
|
|
2964
3031
|
if (dPtNodes && !placed)
|
|
2965
3032
|
rebuilt["c:dPt"] = dPtNodes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/charts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EAGT,aAAa,EACb,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAEhB,UAAU,EACV,UAAU,EACX,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrE;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;AAkDnF,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,kBAAkB,EAC7B,SAAS,EAAE,GAAG,EACd,eAAe,CAAC,EAAE,eAAe,EACjC,cAAc,CAAC,EAAE,cAAc,GAC9B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/charts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,SAAS,EAGT,aAAa,EACb,sBAAsB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AClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACD,SAAS,CAiCZ"}
|
|
@@ -126,6 +126,10 @@ export async function processChart(chartTarget, drawingPath, anchor, sheetId, zi
|
|
|
126
126
|
// whether points are connected and whether markers are drawn.
|
|
127
127
|
// Excel's default when omitted is "lineMarker".
|
|
128
128
|
const scatterStyle = chartType === "scatter" ? extractScatterStyle(plotArea) : undefined;
|
|
129
|
+
// Bubble only — `<c:bubbleScale>` (percent of the default size) and
|
|
130
|
+
// `<c:sizeRepresents val="area|w">`; Excel's defaults (100 / area) are
|
|
131
|
+
// left implicit.
|
|
132
|
+
const bubbleSizing = chartType === "bubble" ? extractBubbleSizing(plotArea) : undefined;
|
|
129
133
|
// Extract hidden dimension strategy from plotVisOnly
|
|
130
134
|
const hiddenDimensionStrategy = extractHiddenDimensionStrategy(chart);
|
|
131
135
|
// "Hidden and Empty Cells": only the non-default choices are recorded
|
|
@@ -194,6 +198,7 @@ export async function processChart(chartTarget, drawingPath, anchor, sheetId, zi
|
|
|
194
198
|
...(scatterStyle
|
|
195
199
|
? { scatterStyle: scatterStyle }
|
|
196
200
|
: {}),
|
|
201
|
+
...(bubbleSizing ?? {}),
|
|
197
202
|
...(legend ? { legend } : {}),
|
|
198
203
|
...(dataLabels ? { dataLabels } : {}),
|
|
199
204
|
...(valueAxisOptions ? { valueAxisOptions } : {}),
|
|
@@ -1437,6 +1442,7 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1437
1442
|
const errorBars = extractErrorBars(ser, sheetId, resolveSheetId);
|
|
1438
1443
|
const marker = extractSeriesMarker(ser);
|
|
1439
1444
|
const dataPointColors = extractSeriesDataPointColors(ser);
|
|
1445
|
+
const seriesDataLabels = extractSeriesDataLabels(ser);
|
|
1440
1446
|
const nameRef = getWithFallback(ser, TX_REF_PATHS);
|
|
1441
1447
|
// Per-series category reference — charts whose series plot against
|
|
1442
1448
|
// different category ranges can't be represented by the single
|
|
@@ -1472,6 +1478,7 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1472
1478
|
...(dataPointColors && dataPointColors.length
|
|
1473
1479
|
? { dataPointColors }
|
|
1474
1480
|
: {}),
|
|
1481
|
+
...(seriesDataLabels ? { dataLabels: seriesDataLabels } : {}),
|
|
1475
1482
|
});
|
|
1476
1483
|
seriesIndex++;
|
|
1477
1484
|
}
|
|
@@ -1509,6 +1516,7 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1509
1516
|
}
|
|
1510
1517
|
const marker = extractSeriesMarker(ser);
|
|
1511
1518
|
const dataPointColors = extractSeriesDataPointColors(ser);
|
|
1519
|
+
const seriesDataLabels = extractSeriesDataLabels(ser);
|
|
1512
1520
|
const nameRef = getWithFallback(ser, TX_REF_PATHS);
|
|
1513
1521
|
const serCatRef = isXYChart(chartType)
|
|
1514
1522
|
? undefined
|
|
@@ -1532,6 +1540,7 @@ export function extractChartSeries(plotArea, chartType, sheetId, resolveSheetId)
|
|
|
1532
1540
|
...(dataPointColors && dataPointColors.length
|
|
1533
1541
|
? { dataPointColors }
|
|
1534
1542
|
: {}),
|
|
1543
|
+
...(seriesDataLabels ? { dataLabels: seriesDataLabels } : {}),
|
|
1535
1544
|
});
|
|
1536
1545
|
});
|
|
1537
1546
|
}
|
|
@@ -1899,6 +1908,25 @@ function extractScatterStyle(plotArea) {
|
|
|
1899
1908
|
get(plotArea, "scatterChart.scatterStyle.a$.t$");
|
|
1900
1909
|
return typeof val === "string" && val ? val : undefined;
|
|
1901
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Bubble-chart sizing: `<c:bubbleScale val="0..300">` and
|
|
1913
|
+
* `<c:sizeRepresents val="area|w">` under `<c:bubbleChart>`. Only the
|
|
1914
|
+
* non-default values are recorded (Excel's defaults are 100 and area).
|
|
1915
|
+
*/
|
|
1916
|
+
function extractBubbleSizing(plotArea) {
|
|
1917
|
+
const result = {};
|
|
1918
|
+
const scale = Number(get(plotArea, "c:bubbleChart.c:bubbleScale.a$.val") ??
|
|
1919
|
+
get(plotArea, "bubbleChart.bubbleScale.a$.val"));
|
|
1920
|
+
if (Number.isFinite(scale) && scale !== 100) {
|
|
1921
|
+
result.bubbleScale = scale;
|
|
1922
|
+
}
|
|
1923
|
+
const represents = get(plotArea, "c:bubbleChart.c:sizeRepresents.a$.val") ??
|
|
1924
|
+
get(plotArea, "bubbleChart.sizeRepresents.a$.val");
|
|
1925
|
+
if (represents === "w") {
|
|
1926
|
+
result.sizeRepresents = "width";
|
|
1927
|
+
}
|
|
1928
|
+
return Object.keys(result).length ? result : undefined;
|
|
1929
|
+
}
|
|
1902
1930
|
function extractSeriesTitleFromSeries(ser) {
|
|
1903
1931
|
// Prefer cached textual value if present
|
|
1904
1932
|
const cacheEntries = get(ser, "c:tx.c:strRef.c:strCache.c:pt");
|
|
@@ -2506,6 +2534,8 @@ function extractDataLabelsOptions(plotArea, chartType) {
|
|
|
2506
2534
|
],
|
|
2507
2535
|
doughnut: ["c:doughnutChart", "doughnutChart"],
|
|
2508
2536
|
area: ["c:areaChart", "areaChart", "c:area3DChart", "area3DChart"],
|
|
2537
|
+
scatter: ["c:scatterChart", "scatterChart"],
|
|
2538
|
+
bubble: ["c:bubbleChart", "bubbleChart"],
|
|
2509
2539
|
};
|
|
2510
2540
|
const keys = containerKeys[chartType] ?? [];
|
|
2511
2541
|
let container;
|
|
@@ -2518,6 +2548,25 @@ function extractDataLabelsOptions(plotArea, chartType) {
|
|
|
2518
2548
|
get(plotArea, "dLbls");
|
|
2519
2549
|
if (!dLbls)
|
|
2520
2550
|
return undefined;
|
|
2551
|
+
return readDataLabelsNode(dLbls);
|
|
2552
|
+
}
|
|
2553
|
+
/**
|
|
2554
|
+
* `<c:ser><c:dLbls>` — this series' own labels, which replace the group's
|
|
2555
|
+
* for it. `<c:delete val="1"/>`, or a node with every `show*` flag off,
|
|
2556
|
+
* turns a labelled group's labels off for the series.
|
|
2557
|
+
*/
|
|
2558
|
+
function extractSeriesDataLabels(ser) {
|
|
2559
|
+
const dLbls = get(ser, "c:dLbls") ?? get(ser, "dLbls");
|
|
2560
|
+
if (!dLbls)
|
|
2561
|
+
return undefined;
|
|
2562
|
+
const deleted = readBoolean(get(dLbls, "c:delete.a$.val") ?? get(dLbls, "delete.a$.val"));
|
|
2563
|
+
if (deleted)
|
|
2564
|
+
return { show: false };
|
|
2565
|
+
const options = readDataLabelsNode(dLbls);
|
|
2566
|
+
return options?.show ? options : { show: false };
|
|
2567
|
+
}
|
|
2568
|
+
/** The `ChartDataLabelsOptions` a `<c:dLbls>` node describes. */
|
|
2569
|
+
function readDataLabelsNode(dLbls) {
|
|
2521
2570
|
const result = {};
|
|
2522
2571
|
const pos = get(dLbls, "c:dLblPos.a$.val") ?? get(dLbls, "dLblPos.a$.val");
|
|
2523
2572
|
const position = mapDataLabelPosition(pos);
|
|
@@ -2543,6 +2592,12 @@ function extractDataLabelsOptions(plotArea, chartType) {
|
|
|
2543
2592
|
result.show = true;
|
|
2544
2593
|
result.showSeriesName = true;
|
|
2545
2594
|
}
|
|
2595
|
+
const showBubbleSize = readBoolean(get(dLbls, "c:showBubbleSize.a$.val") ??
|
|
2596
|
+
get(dLbls, "showBubbleSize.a$.val"));
|
|
2597
|
+
if (showBubbleSize) {
|
|
2598
|
+
result.show = true;
|
|
2599
|
+
result.showBubbleSize = true;
|
|
2600
|
+
}
|
|
2546
2601
|
// If only `position` was set with no `show*` flags, treat as "show".
|
|
2547
2602
|
if (position && result.show === undefined)
|
|
2548
2603
|
result.show = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/chart-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAi4CnC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,YAAY,EAAE,MAAM,GAAG,MAAM,KAC1B,MAAM,GAAG,SAAS,CAAC;AAExB,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,yBAAyB,sBAAsB,KAC9C,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"chart-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/chart-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAi4CnC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,YAAY,EAAE,MAAM,GAAG,MAAM,KAC1B,MAAM,GAAG,SAAS,CAAC;AAExB,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,yBAAyB,sBAAsB,KAC9C,MAAM,GAAG,SAqrBX,CAAC"}
|
|
@@ -1594,9 +1594,20 @@ export const buildChartXml = (input, sheetNameById, resolvePivotSourceName) => {
|
|
|
1594
1594
|
const scatterChart = plotArea["c:scatterChart"];
|
|
1595
1595
|
if (chartType === "bubble") {
|
|
1596
1596
|
removeProp(scatterChart, "c:scatterStyle");
|
|
1597
|
-
|
|
1597
|
+
// `bubbleScale` / `sizeRepresents` round-trip from the spec; Excel's
|
|
1598
|
+
// defaults (100 / area) fill in when the spec is silent.
|
|
1599
|
+
const bubbleScale = chart.spec.bubbleScale;
|
|
1600
|
+
scatterChart["c:bubbleScale"] = {
|
|
1601
|
+
a$: {
|
|
1602
|
+
val: String(typeof bubbleScale === "number" && Number.isFinite(bubbleScale)
|
|
1603
|
+
? Math.min(300, Math.max(0, Math.round(bubbleScale)))
|
|
1604
|
+
: 100),
|
|
1605
|
+
},
|
|
1606
|
+
};
|
|
1598
1607
|
scatterChart["c:showNegBubbles"] = { a$: { val: "0" } };
|
|
1599
|
-
scatterChart["c:sizeRepresents"] = {
|
|
1608
|
+
scatterChart["c:sizeRepresents"] = {
|
|
1609
|
+
a$: { val: chart.spec.sizeRepresents === "width" ? "w" : "area" },
|
|
1610
|
+
};
|
|
1600
1611
|
replacePlotAreaChartGroups(plotArea, [["c:bubbleChart", scatterChart]], "c:scatterChart");
|
|
1601
1612
|
}
|
|
1602
1613
|
else {
|
|
@@ -1962,8 +1973,9 @@ const SERIES_CONTAINER_KEYS = [
|
|
|
1962
1973
|
];
|
|
1963
1974
|
/**
|
|
1964
1975
|
* Walk the per-chart-type containers in plotArea and apply trendlines
|
|
1965
|
-
* / errBars to each emitted `<c:ser>`. The
|
|
1966
|
-
* matches the order emitted by the builder,
|
|
1976
|
+
* / errBars / the series' own data labels to each emitted `<c:ser>`. The
|
|
1977
|
+
* series order in spec.series matches the order emitted by the builder,
|
|
1978
|
+
* so we index by position.
|
|
1967
1979
|
*/
|
|
1968
1980
|
const applySeriesOverlays = (plotArea, series, sheetNameById) => {
|
|
1969
1981
|
if (!Array.isArray(series) || !series.length)
|
|
@@ -2006,6 +2018,13 @@ const applySeriesOverlays = (plotArea, series, sheetNameById) => {
|
|
|
2006
2018
|
if (built)
|
|
2007
2019
|
node["c:errBars"] = built;
|
|
2008
2020
|
}
|
|
2021
|
+
// `ChartData.dataLabels` — the series' own `<c:dLbls>` overrides the
|
|
2022
|
+
// group's; `{ show: false }` is Excel's `<c:delete val="1"/>`.
|
|
2023
|
+
if (data.dataLabels) {
|
|
2024
|
+
node["c:dLbls"] = data.dataLabels.show
|
|
2025
|
+
? buildDataLabelsNode(data.dataLabels)
|
|
2026
|
+
: { "c:delete": { a$: { val: "1" } } };
|
|
2027
|
+
}
|
|
2009
2028
|
}
|
|
2010
2029
|
}
|
|
2011
2030
|
}
|
|
@@ -2416,24 +2435,8 @@ const applyLegend = (chartNode, legend) => {
|
|
|
2416
2435
|
...(txPr ? { "c:txPr": txPr } : {}),
|
|
2417
2436
|
};
|
|
2418
2437
|
};
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
return;
|
|
2422
|
-
// Find the chart-type container inside <c:plotArea>. We attach <c:dLbls>
|
|
2423
|
-
// to whichever exists.
|
|
2424
|
-
// Chart-level labels apply to every chart group — a combo chart has
|
|
2425
|
-
// one per series type.
|
|
2426
|
-
const containers = [
|
|
2427
|
-
"c:barChart",
|
|
2428
|
-
"c:lineChart",
|
|
2429
|
-
"c:pieChart",
|
|
2430
|
-
"c:doughnutChart",
|
|
2431
|
-
"c:areaChart",
|
|
2432
|
-
]
|
|
2433
|
-
.flatMap((k) => (Array.isArray(plotArea[k]) ? plotArea[k] : [plotArea[k]]))
|
|
2434
|
-
.filter(Boolean);
|
|
2435
|
-
if (!containers.length)
|
|
2436
|
-
return;
|
|
2438
|
+
/** A `<c:dLbls>` node for `ChartDataLabelsOptions` with `show: true`. */
|
|
2439
|
+
const buildDataLabelsNode = (dataLabels) => {
|
|
2437
2440
|
const posCode = dataLabels.position && DLBL_POS[dataLabels.position];
|
|
2438
2441
|
const dLbls = {};
|
|
2439
2442
|
if (posCode)
|
|
@@ -2470,9 +2473,52 @@ const applyDataLabels = (plotArea, dataLabels) => {
|
|
|
2470
2473
|
dLbls["c:showPercent"] = {
|
|
2471
2474
|
a$: { val: dataLabels.showPercent ? "1" : "0" },
|
|
2472
2475
|
};
|
|
2473
|
-
dLbls["c:showBubbleSize"] = {
|
|
2476
|
+
dLbls["c:showBubbleSize"] = {
|
|
2477
|
+
a$: { val: dataLabels.showBubbleSize ? "1" : "0" },
|
|
2478
|
+
};
|
|
2479
|
+
return dLbls;
|
|
2480
|
+
};
|
|
2481
|
+
const applyDataLabels = (plotArea, dataLabels) => {
|
|
2482
|
+
if (!dataLabels?.show)
|
|
2483
|
+
return;
|
|
2484
|
+
// Find the chart-type container inside <c:plotArea>. We attach <c:dLbls>
|
|
2485
|
+
// to whichever exists.
|
|
2486
|
+
// Chart-level labels apply to every chart group — a combo chart has
|
|
2487
|
+
// one per series type.
|
|
2488
|
+
const containers = [
|
|
2489
|
+
"c:barChart",
|
|
2490
|
+
"c:lineChart",
|
|
2491
|
+
"c:pieChart",
|
|
2492
|
+
"c:doughnutChart",
|
|
2493
|
+
"c:areaChart",
|
|
2494
|
+
"c:scatterChart",
|
|
2495
|
+
"c:bubbleChart",
|
|
2496
|
+
]
|
|
2497
|
+
.flatMap((k) => (Array.isArray(plotArea[k]) ? plotArea[k] : [plotArea[k]]))
|
|
2498
|
+
.filter(Boolean);
|
|
2499
|
+
if (!containers.length)
|
|
2500
|
+
return;
|
|
2501
|
+
const dLbls = buildDataLabelsNode(dataLabels);
|
|
2474
2502
|
for (const container of containers) {
|
|
2475
|
-
|
|
2503
|
+
// Every chart group's schema puts <c:dLbls> right after its series
|
|
2504
|
+
// (before gapWidth / bubbleScale / axId …): splice it in there so the
|
|
2505
|
+
// serialised child order stays valid.
|
|
2506
|
+
const next = {};
|
|
2507
|
+
let placed = false;
|
|
2508
|
+
for (const [key, value] of Object.entries(container)) {
|
|
2509
|
+
if (key === "c:dLbls")
|
|
2510
|
+
continue;
|
|
2511
|
+
next[key] = value;
|
|
2512
|
+
if (key === "c:ser") {
|
|
2513
|
+
next["c:dLbls"] = cloneTemplate(dLbls);
|
|
2514
|
+
placed = true;
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
if (!placed)
|
|
2518
|
+
next["c:dLbls"] = cloneTemplate(dLbls);
|
|
2519
|
+
for (const key of Object.keys(container))
|
|
2520
|
+
delete container[key];
|
|
2521
|
+
Object.assign(container, next);
|
|
2476
2522
|
}
|
|
2477
2523
|
};
|
|
2478
2524
|
const applyAxisOptions = (plotArea, options, kind) => {
|