@office-open/core 0.12.0 → 0.12.2
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/chart/index.d.mts +2 -2
- package/dist/chart/index.mjs +2 -2
- package/dist/{chart-DED4tXC9.mjs → chart-DEIF3VZn.mjs} +82 -60
- package/dist/chart-DEIF3VZn.mjs.map +1 -0
- package/dist/drawing/index.mjs +1 -1
- package/dist/{drawing-BCAyrCCw.mjs → drawing-BVwCkNXB.mjs} +7 -2
- package/dist/{drawing-BCAyrCCw.mjs.map → drawing-BVwCkNXB.mjs.map} +1 -1
- package/dist/{index-BP541uS-.d.mts → index-BwRtWyaP.d.mts} +86 -70
- package/dist/index-BwRtWyaP.d.mts.map +1 -0
- package/dist/{index-BAxlDUQ1.d.mts → index-DF3lKLF_.d.mts} +3 -1
- package/dist/index-DF3lKLF_.d.mts.map +1 -0
- package/dist/{index-Di6XPdGl.d.mts → index-DRggxtp7.d.mts} +2 -1
- package/dist/{index-Di6XPdGl.d.mts.map → index-DRggxtp7.d.mts.map} +1 -1
- package/dist/index-L6AXewfV.d.mts.map +1 -1
- package/dist/index.d.mts +27 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +61 -21
- package/dist/index.mjs.map +1 -1
- package/dist/smartart/index.d.mts +1 -1
- package/dist/smartart/index.mjs +1 -1
- package/dist/{smartart-n1kYJ6Jg.mjs → smartart-YH87Emca.mjs} +14 -10
- package/dist/smartart-YH87Emca.mjs.map +1 -0
- package/dist/{style-matrix-B6jhPAT3.mjs → style-matrix-DjhMuuQg.mjs} +2 -2
- package/dist/{style-matrix-B6jhPAT3.mjs.map → style-matrix-DjhMuuQg.mjs.map} +1 -1
- package/dist/theme/index.mjs +2 -2
- package/dist/{theme-BKnXRmvn.mjs → theme-Dx0Db9bX.mjs} +3 -3
- package/dist/{theme-BKnXRmvn.mjs.map → theme-Dx0Db9bX.mjs.map} +1 -1
- package/dist/util/index.d.mts +1 -1
- package/dist/util/index.mjs +1 -1
- package/dist/{util-ptE16MEk.mjs → util-Cr7rwR6t.mjs} +2 -2
- package/dist/{util-ptE16MEk.mjs.map → util-Cr7rwR6t.mjs.map} +1 -1
- package/dist/vector/index.mjs +1 -1
- package/dist/{vector-DhLGZjP5.mjs → vector-DZ_OteHJ.mjs} +93 -78
- package/dist/vector-DZ_OteHJ.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/chart-DED4tXC9.mjs.map +0 -1
- package/dist/index-BAxlDUQ1.d.mts.map +0 -1
- package/dist/index-BP541uS-.d.mts.map +0 -1
- package/dist/smartart-n1kYJ6Jg.mjs.map +0 -1
- package/dist/vector-DhLGZjP5.mjs.map +0 -1
package/dist/chart/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AbsoluteSizeAnchorOptions, AxisCrossBetween, AxisCrosses, AxisKind, AxisLabelAlignment, AxisNumberFormatOptions, AxisOptions, AxisOrientation, AxisPosition, AxisScalingOptions, AxisTickLabelPosition, AxisTickMark, BandFormatOptions, BarShape, BubbleSeriesData, BuiltInDisplayUnit, ChartCollection, ChartData, ChartGrouping, ChartHeaderFooterOptions, ChartLinesOptions, ChartPageMarginsOptions, ChartPageSetupOptions, ChartPivotFormatOptions, ChartSeriesCommon, ChartSeriesData, ChartSpaceOptions, ChartStyle2010Options, ChartTitleOptions, ChartType, DataLabelOptions, DataLabelPosition, DataLabelsOptions, DataPointOptions, DataTableOptions, DisplayBlanksAs, DisplayUnitsOptions, ErrorBarDirection, ErrorBarOptions, ErrorBarType, ErrorValueType, ExternalDataOptions, LayoutMode, LayoutTarget, LegendEntryOptions, LegendPosition, ManualLayoutOptions, MarkerOptions, MarkerSymbol, OfPieType, PageSetupOrientation, PictureFormat, PictureOptionsOptions, PivotSourceOptions, PrintSettingsOptions, ProtectionOptions, RadarStyle, RelativeSizeAnchorOptions, ScatterSeriesData, SecondaryChartGroupOptions, SizeRepresents, SplitType, SurfaceOptions, TimeUnit, TrendlineLabelOptions, TrendlineOptions, TrendlineType, UserShapeConnectorOptions, UserShapeExtentOptions, UserShapeGraphicFrameOptions, UserShapeGroupOptions, UserShapeMarkerOptions, UserShapeObjectOptions, UserShapePictureOptions, UserShapeShapeOptions, UserShapesOptions, View3DOptions, chartSpaceDesc, userShapesDesc };
|
|
1
|
+
import { $ as PivotSourceOptions, A as DataLabelOptions, B as ErrorValueType, C as ChartSeriesCommon, Ct as UserShapesOptions, D as ChartTitleOptions, Dt as ChartData, E as ChartStyle2010Options, Et as ChartCollection, F as DisplayBlanksAs, G as LegendPosition, H as LayoutMode, I as DisplayUnitsOptions, J as MarkerSymbol, K as ManualLayoutOptions, L as ErrorBarDirection, M as DataLabelsOptions, N as DataPointOptions, O as ChartType, P as DataTableOptions, Q as PictureOptionsOptions, R as ErrorBarOptions, S as ChartPivotFormatOptions, St as UserShapeShapeOptions, T as ChartSpaceOptions, Tt as userShapesDesc, U as LayoutTarget, V as ExternalDataOptions, W as LegendEntryOptions, X as PageSetupOrientation, Y as OfPieType, Z as PictureFormat, _ as ChartGrouping, _t as UserShapeGraphicFrameOptions, a as AxisLabelAlignment, at as SizeRepresents, b as ChartPageMarginsOptions, bt as UserShapeObjectOptions, c as AxisOrientation, ct as TimeUnit, d as AxisTickLabelPosition, dt as TrendlineType, et as PrintSettingsOptions, f as AxisTickMark, ft as View3DOptions, g as BuiltInDisplayUnit, gt as UserShapeExtentOptions, h as BubbleSeriesData, ht as UserShapeConnectorOptions, i as AxisKind, it as SecondaryChartGroupOptions, j as DataLabelPosition, k as ChartUserShapesOptions, l as AxisPosition, lt as TrendlineLabelOptions, m as BarShape, mt as RelativeSizeAnchorOptions, n as AxisCrossBetween, nt as RadarStyle, o as AxisNumberFormatOptions, ot as SplitType, p as BandFormatOptions, pt as AbsoluteSizeAnchorOptions, q as MarkerOptions, r as AxisCrosses, rt as ScatterSeriesData, s as AxisOptions, st as SurfaceOptions, t as chartSpaceDesc, tt as ProtectionOptions, u as AxisScalingOptions, ut as TrendlineOptions, v as ChartHeaderFooterOptions, vt as UserShapeGroupOptions, w as ChartSeriesData, wt as buildUserShapesData, x as ChartPageSetupOptions, xt as UserShapePictureOptions, y as ChartLinesOptions, yt as UserShapeMarkerOptions, z as ErrorBarType } from "../index-BwRtWyaP.mjs";
|
|
2
|
+
export { AbsoluteSizeAnchorOptions, AxisCrossBetween, AxisCrosses, AxisKind, AxisLabelAlignment, AxisNumberFormatOptions, AxisOptions, AxisOrientation, AxisPosition, AxisScalingOptions, AxisTickLabelPosition, AxisTickMark, BandFormatOptions, BarShape, BubbleSeriesData, BuiltInDisplayUnit, ChartCollection, ChartData, ChartGrouping, ChartHeaderFooterOptions, ChartLinesOptions, ChartPageMarginsOptions, ChartPageSetupOptions, ChartPivotFormatOptions, ChartSeriesCommon, ChartSeriesData, ChartSpaceOptions, ChartStyle2010Options, ChartTitleOptions, ChartType, ChartUserShapesOptions, DataLabelOptions, DataLabelPosition, DataLabelsOptions, DataPointOptions, DataTableOptions, DisplayBlanksAs, DisplayUnitsOptions, ErrorBarDirection, ErrorBarOptions, ErrorBarType, ErrorValueType, ExternalDataOptions, LayoutMode, LayoutTarget, LegendEntryOptions, LegendPosition, ManualLayoutOptions, MarkerOptions, MarkerSymbol, OfPieType, PageSetupOrientation, PictureFormat, PictureOptionsOptions, PivotSourceOptions, PrintSettingsOptions, ProtectionOptions, RadarStyle, RelativeSizeAnchorOptions, ScatterSeriesData, SecondaryChartGroupOptions, SizeRepresents, SplitType, SurfaceOptions, TimeUnit, TrendlineLabelOptions, TrendlineOptions, TrendlineType, UserShapeConnectorOptions, UserShapeExtentOptions, UserShapeGraphicFrameOptions, UserShapeGroupOptions, UserShapeMarkerOptions, UserShapeObjectOptions, UserShapePictureOptions, UserShapeShapeOptions, UserShapesOptions, View3DOptions, buildUserShapesData, chartSpaceDesc, userShapesDesc };
|
package/dist/chart/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
export { ChartCollection, chartSpaceDesc, userShapesDesc };
|
|
1
|
+
import { i as ChartCollection, n as userShapesDesc, r as chartSpaceDesc, t as buildUserShapesData } from "../chart-DEIF3VZn.mjs";
|
|
2
|
+
export { ChartCollection, buildUserShapesData, chartSpaceDesc, userShapesDesc };
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { B as xsdAxisCrossBetween, Ct as xsdSizeRepresents, Ft as xsdTrendlineType, H as xsdAxisLabelAlignment, Tt as xsdSplitType, U as xsdAxisOrientation, V as xsdAxisCrosses, W as xsdAxisPosition, Z as xsdDataLabelPosition, Zt as parseOnOff, st as xsdLegendPosition, tt as xsdErrorValueType } from "./ext-uri-BHBcIrW7.mjs";
|
|
2
|
-
import { A as groupShapePropertiesDesc, N as transform2DDesc, a as textBodyDesc, dt as stringifyNonVisualDrawingProperties, hn as blipFillDesc, j as shapePropertiesDesc } from "./drawing-
|
|
2
|
+
import { A as groupShapePropertiesDesc, N as transform2DDesc, a as textBodyDesc, dt as stringifyNonVisualDrawingProperties, hn as blipFillDesc, j as shapePropertiesDesc } from "./drawing-BVwCkNXB.mjs";
|
|
3
3
|
import { o as parse$1, s as stringify$1 } from "./descriptor-BqaNZrrZ.mjs";
|
|
4
|
-
import { i as stringifyShapeStyle, n as parseShapeStyle } from "./style-matrix-
|
|
4
|
+
import { i as stringifyShapeStyle, n as parseShapeStyle } from "./style-matrix-DjhMuuQg.mjs";
|
|
5
5
|
import { n as parseColorMapping, r as stringifyColorMapping } from "./color-mapping-CFF0vRSe.mjs";
|
|
6
6
|
import { attr, children, escapeXml, findChild, findFirst, stringify, stringifyElement, textOf } from "@office-open/xml";
|
|
7
7
|
//#region src/chart/chart-collection.ts
|
|
8
8
|
var ChartCollection = class {
|
|
9
9
|
map;
|
|
10
|
+
/** Cached `array` snapshot — invalidated on add. */
|
|
11
|
+
cachedArray;
|
|
10
12
|
constructor() {
|
|
11
13
|
this.map = /* @__PURE__ */ new Map();
|
|
12
14
|
}
|
|
13
15
|
addChart(key, chartData) {
|
|
14
16
|
this.map.set(key, chartData);
|
|
17
|
+
this.cachedArray = void 0;
|
|
15
18
|
}
|
|
16
19
|
get array() {
|
|
17
|
-
|
|
20
|
+
if (this.cachedArray === void 0) this.cachedArray = [...this.map.values()];
|
|
21
|
+
return this.cachedArray;
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
24
|
//#endregion
|
|
@@ -124,29 +128,9 @@ function stringifyErrBars(opts) {
|
|
|
124
128
|
if (opts.value !== void 0) parts.push(valEl("c:val", opts.value));
|
|
125
129
|
return `<c:errBars>${parts.join("")}</c:errBars>`;
|
|
126
130
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const inner = [];
|
|
130
|
-
if (opts.layout === true) inner.push("<c:layout/>");
|
|
131
|
-
else if (opts.layout) inner.push(stringifyLayout(opts.layout));
|
|
132
|
-
if (opts.text) inner.push(`<c:tx><c:rich>${textBodyDesc.stringify(opts.text, ctx) ?? ""}</c:rich></c:tx>`);
|
|
133
|
-
if (opts.numberFormat !== void 0) inner.push(`<c:numFmt formatCode="${escapeXml(opts.numberFormat)}" sourceLinked="0"/>`);
|
|
134
|
-
inner.push(chartSpPr(opts.shapeProperties, ctx));
|
|
135
|
-
if (opts.textProperties) inner.push(`<c:txPr>${textBodyDesc.stringify(opts.textProperties, ctx) ?? ""}</c:txPr>`);
|
|
136
|
-
if (opts.position !== void 0) inner.push(valEl("c:dLblPos", xsdDataLabelPosition.to(opts.position)));
|
|
137
|
-
if (opts.showLegendKey !== void 0) inner.push(`<c:showLegendKey${boolVal(opts.showLegendKey)}/>`);
|
|
138
|
-
if (opts.showVal !== void 0) inner.push(`<c:showVal${boolVal(opts.showVal)}/>`);
|
|
139
|
-
if (opts.showCatName !== void 0) inner.push(`<c:showCatName${boolVal(opts.showCatName)}/>`);
|
|
140
|
-
if (opts.showSerName !== void 0) inner.push(`<c:showSerName${boolVal(opts.showSerName)}/>`);
|
|
141
|
-
if (opts.showPercent !== void 0) inner.push(`<c:showPercent${boolVal(opts.showPercent)}/>`);
|
|
142
|
-
if (opts.showBubbleSize !== void 0) inner.push(`<c:showBubbleSize${boolVal(opts.showBubbleSize)}/>`);
|
|
143
|
-
if (opts.separator !== void 0) inner.push(`<c:separator>${escapeXml(opts.separator)}</c:separator>`);
|
|
144
|
-
return `<c:dLbl><c:idx val="${opts.index}"/>${inner.join("")}</c:dLbl>`;
|
|
145
|
-
}
|
|
146
|
-
function stringifyDataLabels(opts, ctx) {
|
|
131
|
+
/** EG_DLblShared members — emitted identically by per-point c:dLbl and group c:dLbls. */
|
|
132
|
+
function dataLabelSharedParts(opts, ctx) {
|
|
147
133
|
const parts = [];
|
|
148
|
-
if (opts.labels) for (const lbl of opts.labels) parts.push(stringifyDataLabel(lbl, ctx));
|
|
149
|
-
if (opts.delete !== void 0) parts.push(`<c:delete${boolVal(opts.delete)}/>`);
|
|
150
134
|
if (opts.numberFormat !== void 0) parts.push(`<c:numFmt formatCode="${escapeXml(opts.numberFormat)}" sourceLinked="0"/>`);
|
|
151
135
|
parts.push(chartSpPr(opts.shapeProperties, ctx));
|
|
152
136
|
if (opts.textProperties) parts.push(`<c:txPr>${textBodyDesc.stringify(opts.textProperties, ctx) ?? ""}</c:txPr>`);
|
|
@@ -158,11 +142,40 @@ function stringifyDataLabels(opts, ctx) {
|
|
|
158
142
|
if (opts.showPercent !== void 0) parts.push(`<c:showPercent${boolVal(opts.showPercent)}/>`);
|
|
159
143
|
if (opts.showBubbleSize !== void 0) parts.push(`<c:showBubbleSize${boolVal(opts.showBubbleSize)}/>`);
|
|
160
144
|
if (opts.separator !== void 0) parts.push(`<c:separator>${escapeXml(opts.separator)}</c:separator>`);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
145
|
+
return parts;
|
|
146
|
+
}
|
|
147
|
+
function stringifyDataLabel(opts, ctx) {
|
|
148
|
+
if (opts.delete) return `<c:dLbl><c:idx val="${opts.index}"/><c:delete val="1"/></c:dLbl>`;
|
|
149
|
+
const inner = [];
|
|
150
|
+
if (opts.layout === true) inner.push("<c:layout/>");
|
|
151
|
+
else if (opts.layout) inner.push(stringifyLayout(opts.layout));
|
|
152
|
+
if (opts.text) inner.push(`<c:tx><c:rich>${textBodyDesc.stringify(opts.text, ctx) ?? ""}</c:rich></c:tx>`);
|
|
153
|
+
inner.push(...dataLabelSharedParts(opts, ctx));
|
|
154
|
+
return `<c:dLbl><c:idx val="${opts.index}"/>${inner.join("")}</c:dLbl>`;
|
|
155
|
+
}
|
|
156
|
+
const DATA_LABELS_SHARED_KEYS = [
|
|
157
|
+
"numberFormat",
|
|
158
|
+
"shapeProperties",
|
|
159
|
+
"textProperties",
|
|
160
|
+
"position",
|
|
161
|
+
"showLegendKey",
|
|
162
|
+
"showVal",
|
|
163
|
+
"showCatName",
|
|
164
|
+
"showSerName",
|
|
165
|
+
"showPercent",
|
|
166
|
+
"showBubbleSize",
|
|
167
|
+
"separator",
|
|
168
|
+
"showLeaderLines",
|
|
169
|
+
"leaderLines"
|
|
170
|
+
];
|
|
171
|
+
function stringifyDataLabels(opts, ctx) {
|
|
172
|
+
const head = opts.labels?.map((lbl) => stringifyDataLabel(lbl, ctx)).join("") ?? "";
|
|
173
|
+
const hasShared = DATA_LABELS_SHARED_KEYS.some((key) => opts[key] !== void 0);
|
|
174
|
+
if (opts.delete === true || opts.delete !== void 0 && !hasShared) return `<c:dLbls>${head}<c:delete val="${opts.delete ? 1 : 0}"/></c:dLbls>`;
|
|
175
|
+
const parts = dataLabelSharedParts(opts, ctx);
|
|
176
|
+
if (opts.showLeaderLines !== void 0) parts.push(`<c:showLeaderLines${boolVal(opts.showLeaderLines)}/>`);
|
|
177
|
+
if (opts.leaderLines) parts.push(emptyEl("c:leaderLines"));
|
|
178
|
+
return `<c:dLbls>${head}${parts.join("")}</c:dLbls>`;
|
|
166
179
|
}
|
|
167
180
|
function stringifyView3D(opts) {
|
|
168
181
|
const parts = [];
|
|
@@ -295,10 +308,6 @@ function stringifyMultiLvlStrRef(levels, formula) {
|
|
|
295
308
|
}).join("");
|
|
296
309
|
return `<c:multiLvlStrRef>${refFormula(formula)}<c:multiLvlStrCache><c:ptCount ${attrVal("val", ptCount)}/>${lvls}</c:multiLvlStrCache></c:multiLvlStrRef>`;
|
|
297
310
|
}
|
|
298
|
-
function stringifyNumCatRef(values, formula, formatCode) {
|
|
299
|
-
const pts = values.map((v, i) => `<c:pt idx="${i}"><c:v>${escapeXml(v)}</c:v></c:pt>`).join("");
|
|
300
|
-
return `<c:numRef>${refFormula(formula)}<c:numCache><c:formatCode>${escapeXml(formatCode ?? "General")}</c:formatCode><c:ptCount ${attrVal("val", values.length)}/>${pts}</c:numCache></c:numRef>`;
|
|
301
|
-
}
|
|
302
311
|
/** Whether the chart carries category-source data (c:cat is optional in CT_Ser). */
|
|
303
312
|
function hasCategoryData(opts) {
|
|
304
313
|
return opts.categories !== void 0 || opts.categoryLabels !== void 0 || opts.multiLevelCategories !== void 0 || opts.numericCategories === true;
|
|
@@ -306,11 +315,11 @@ function hasCategoryData(opts) {
|
|
|
306
315
|
function stringifyCategorySource(opts) {
|
|
307
316
|
if (opts.multiLevelCategories) return stringifyMultiLvlStrRef(opts.multiLevelCategories, opts.categoryFormula);
|
|
308
317
|
if (opts.categoryLabels) return stringifyStrLit(opts.categoryLabels);
|
|
309
|
-
if (opts.numericCategories) return
|
|
318
|
+
if (opts.numericCategories) return stringifyNumRef(opts.categories ?? [], opts.categoryFormula, opts.categoryFormatCode);
|
|
310
319
|
return stringifyStrRef(opts.categories ?? [], opts.categoryFormula);
|
|
311
320
|
}
|
|
312
321
|
function stringifyNumRef(values, formula, formatCode) {
|
|
313
|
-
const pts = values.map((v, i) => `<c:pt idx="${i}"><c:v>${v}</c:v></c:pt>`).join("");
|
|
322
|
+
const pts = values.map((v, i) => `<c:pt idx="${i}"><c:v>${typeof v === "number" ? v : escapeXml(v)}</c:v></c:pt>`).join("");
|
|
314
323
|
return `<c:numRef>${refFormula(formula)}<c:numCache><c:formatCode>${escapeXml(formatCode ?? "General")}</c:formatCode><c:ptCount ${attrVal("val", values.length)}/>${pts}</c:numCache></c:numRef>`;
|
|
315
324
|
}
|
|
316
325
|
function stringifyNumLitList(values, formatCode) {
|
|
@@ -336,11 +345,11 @@ function stringifyDataTable(opts, ctx) {
|
|
|
336
345
|
}
|
|
337
346
|
function stringifyProtection(opts) {
|
|
338
347
|
const parts = [];
|
|
339
|
-
if (opts.chartObject !== void 0) parts.push(`<c:chartObject
|
|
340
|
-
if (opts.data !== void 0) parts.push(`<c:data
|
|
341
|
-
if (opts.formatting !== void 0) parts.push(`<c:formatting
|
|
342
|
-
if (opts.selection !== void 0) parts.push(`<c:selection
|
|
343
|
-
if (opts.userInterface !== void 0) parts.push(`<c:userInterface
|
|
348
|
+
if (opts.chartObject !== void 0) parts.push(`<c:chartObject${boolVal(opts.chartObject)}/>`);
|
|
349
|
+
if (opts.data !== void 0) parts.push(`<c:data${boolVal(opts.data)}/>`);
|
|
350
|
+
if (opts.formatting !== void 0) parts.push(`<c:formatting${boolVal(opts.formatting)}/>`);
|
|
351
|
+
if (opts.selection !== void 0) parts.push(`<c:selection${boolVal(opts.selection)}/>`);
|
|
352
|
+
if (opts.userInterface !== void 0) parts.push(`<c:userInterface${boolVal(opts.userInterface)}/>`);
|
|
344
353
|
return `<c:protection>${parts.join("")}</c:protection>`;
|
|
345
354
|
}
|
|
346
355
|
function stringifyExternalData(opts) {
|
|
@@ -547,10 +556,10 @@ function stringifySeries(index, series, opts, ctx, groupType) {
|
|
|
547
556
|
parts.push(`<c:xVal>${stringifyCategorySource(opts)}</c:xVal>`);
|
|
548
557
|
parts.push(`<c:yVal>${stringifyNumRef(s.values, s.valueFormula, s.formatCode)}</c:yVal>`);
|
|
549
558
|
}
|
|
550
|
-
} else
|
|
551
|
-
parts.push(`<c:cat>${stringifyCategorySource(opts)}</c:cat>`);
|
|
559
|
+
} else {
|
|
560
|
+
if (hasCategoryData(opts)) parts.push(`<c:cat>${stringifyCategorySource(opts)}</c:cat>`);
|
|
552
561
|
parts.push(`<c:val>${s.valueLiteral ? stringifyNumLitList(s.values, s.formatCode) : stringifyNumRef(s.values, s.valueFormula, s.formatCode)}</c:val>`);
|
|
553
|
-
}
|
|
562
|
+
}
|
|
554
563
|
if ((chartType === "line" || chartType === "scatter") && s.smooth !== void 0) parts.push(`<c:smooth${boolVal(s.smooth)}/>`);
|
|
555
564
|
if ((chartType === "column" || chartType === "bar") && s.shape !== void 0) parts.push(valEl("c:shape", s.shape));
|
|
556
565
|
if (chartType === "bubble" && s.bubble3D !== void 0) parts.push(`<c:bubble3D${boolVal(s.bubble3D)}/>`);
|
|
@@ -677,16 +686,14 @@ function stringifySecondaryGroup(g, opts, ctx) {
|
|
|
677
686
|
return `${parts.join("")}</${CHART_TYPE_TAGS[g.type]}>`;
|
|
678
687
|
}
|
|
679
688
|
function stringifyTitle(title, ctx) {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
return `<c:title><c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${escapeXml(title)}</a:t></a:r></a:p></c:rich></c:tx></c:title>`;
|
|
689
|
+
const opts = typeof title === "string" ? { text: title } : title;
|
|
690
|
+
const parts = [];
|
|
691
|
+
if (opts.text !== void 0) parts.push(typeof opts.text === "string" ? `<c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:r><a:t>${escapeXml(opts.text)}</a:t></a:r></a:p></c:rich></c:tx>` : `<c:tx><c:rich>${textBodyDesc.stringify(opts.text, ctx) ?? ""}</c:rich></c:tx>`);
|
|
692
|
+
if (opts.layout !== void 0) parts.push(opts.layout === true ? "<c:layout/>" : stringifyLayout(opts.layout));
|
|
693
|
+
if (opts.overlay !== void 0) parts.push(`<c:overlay${boolVal(opts.overlay)}/>`);
|
|
694
|
+
if (opts.shapeProperties) parts.push(chartSpPr(opts.shapeProperties, ctx));
|
|
695
|
+
if (opts.textProperties) parts.push(`<c:txPr>${textBodyDesc.stringify(opts.textProperties, ctx) ?? ""}</c:txPr>`);
|
|
696
|
+
return `<c:title>${parts.join("")}</c:title>`;
|
|
690
697
|
}
|
|
691
698
|
function stringifyLegendEntry(entry, ctx) {
|
|
692
699
|
if (entry.delete) return `<c:legendEntry><c:idx val="${entry.index}"/><c:delete val="1"/></c:legendEntry>`;
|
|
@@ -1111,7 +1118,8 @@ function readDataLabels(serEl, ctx) {
|
|
|
1111
1118
|
const lblEls = children(dlEl, "c:dLbl");
|
|
1112
1119
|
if (lblEls.length > 0) opts.labels = lblEls.map((el) => {
|
|
1113
1120
|
const result = { index: readValNum(el, "c:idx") ?? 0 };
|
|
1114
|
-
|
|
1121
|
+
const labelDelete = readBoolAttr(el, "c:delete");
|
|
1122
|
+
if (labelDelete !== void 0) result.delete = labelDelete;
|
|
1115
1123
|
const layoutEl = findChild(el, "c:layout");
|
|
1116
1124
|
if (layoutEl) result.layout = readManualLayout(layoutEl) ?? true;
|
|
1117
1125
|
const richEl = findChild(findChild(el, "c:tx"), "c:rich");
|
|
@@ -1815,7 +1823,7 @@ const chartSpaceDesc = {
|
|
|
1815
1823
|
if (ext) parts.push(ext);
|
|
1816
1824
|
}
|
|
1817
1825
|
if (opts.printSettings) parts.push(stringifyPrintSettings(opts.printSettings));
|
|
1818
|
-
if (opts.userShapes !== void 0) parts.push(`<c:userShapes r:id="${escapeXml(opts.userShapes)}"/>`);
|
|
1826
|
+
if (opts.userShapes !== void 0) parts.push(`<c:userShapes r:id="${escapeXml(opts.userShapes.relationshipId ?? "rId1")}"/>`);
|
|
1819
1827
|
if (opts.ext) parts.push(`<c:extLst>${opts.ext}</c:extLst>`);
|
|
1820
1828
|
parts.push("</c:chartSpace>");
|
|
1821
1829
|
return parts.join("");
|
|
@@ -2035,7 +2043,10 @@ const chartSpaceDesc = {
|
|
|
2035
2043
|
const userShapesEl = findChild(el, "c:userShapes");
|
|
2036
2044
|
if (userShapesEl) {
|
|
2037
2045
|
const rid = attr(userShapesEl, "r:id");
|
|
2038
|
-
if (rid !== void 0) result.userShapes =
|
|
2046
|
+
if (rid !== void 0) result.userShapes = {
|
|
2047
|
+
relationshipId: rid,
|
|
2048
|
+
anchors: []
|
|
2049
|
+
};
|
|
2039
2050
|
}
|
|
2040
2051
|
const spaceExtLst = findChild(el, "c:extLst");
|
|
2041
2052
|
if (spaceExtLst) result.ext = (spaceExtLst.elements ?? []).map((e) => stringifyElement(e)).join("");
|
|
@@ -2090,7 +2101,7 @@ function stringifyObject(obj) {
|
|
|
2090
2101
|
const nvSpPr = `<cdr:nvSpPr>${stringifyCnvPr(obj.id, obj.nonVisualProperties)}<cdr:cNvSpPr${obj.textBox ? " txBox=\"1\"" : ""}/></cdr:nvSpPr>`;
|
|
2091
2102
|
const spPrXml = stringify$1(shapePropertiesDesc, obj.shapeProperties, DIRECT_CTX) ?? "";
|
|
2092
2103
|
const styleXml = obj.style ? stringifyShapeStyle(obj.style, DIRECT_CTX) : "";
|
|
2093
|
-
const txBodyXml = obj.textBody ? stringify$1(textBodyDesc, obj.textBody, DIRECT_CTX) ?? "" : "";
|
|
2104
|
+
const txBodyXml = obj.textBody ? `<cdr:txBody>${stringify$1(textBodyDesc, obj.textBody, DIRECT_CTX) ?? ""}</cdr:txBody>` : "";
|
|
2094
2105
|
return `<cdr:sp${commonAttrs(obj)}${textLinkAttr}${locksTextAttr}>` + nvSpPr + `<cdr:spPr>${spPrXml}</cdr:spPr>` + styleXml + txBodyXml + "</cdr:sp>";
|
|
2095
2106
|
}
|
|
2096
2107
|
case "connector": {
|
|
@@ -2319,7 +2330,18 @@ function readAnchorObject(anchorEl, ctx) {
|
|
|
2319
2330
|
if (object) return object;
|
|
2320
2331
|
}
|
|
2321
2332
|
}
|
|
2333
|
+
/**
|
|
2334
|
+
* Companion part entry the format compilers register alongside the chart
|
|
2335
|
+
* space: the serialized body plus the relationship id the c:userShapes
|
|
2336
|
+
* reference carries (same rId1 default as the chart-space reference).
|
|
2337
|
+
*/
|
|
2338
|
+
function buildUserShapesData(userShapes) {
|
|
2339
|
+
return {
|
|
2340
|
+
relationshipId: userShapes.relationshipId ?? "rId1",
|
|
2341
|
+
xml: userShapesDesc.stringify({ anchors: userShapes.anchors }, DIRECT_CTX) ?? ""
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2322
2344
|
//#endregion
|
|
2323
|
-
export {
|
|
2345
|
+
export { ChartCollection as i, userShapesDesc as n, chartSpaceDesc as r, buildUserShapesData as t };
|
|
2324
2346
|
|
|
2325
|
-
//# sourceMappingURL=chart-
|
|
2347
|
+
//# sourceMappingURL=chart-DEIF3VZn.mjs.map
|