@office-open/core 0.6.10 → 0.7.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.
@@ -0,0 +1,1097 @@
1
+ import { a as BuilderElement, g as wrapEl, l as chartAttr, o as EmptyElement, y as XmlComponent } from "./xml-components-xJkfJ6ff.mjs";
2
+ //#region src/chart/axes.ts
3
+ /**
4
+ * c:scaling — axis scaling configuration (minOccurs=1 in EG_AxShared).
5
+ */
6
+ var Scaling = class extends XmlComponent {
7
+ constructor() {
8
+ super("c:scaling");
9
+ this.root.push(wrapEl("c:orientation", chartAttr({ val: "minMax" })));
10
+ }
11
+ };
12
+ /**
13
+ * c:catAx — category axis.
14
+ *
15
+ * XSD sequence: EG_AxShared (axId, scaling, delete, axPos, ..., crossAx, crosses)
16
+ * then: auto, lblAlgn, lblOffset, tickLblSkip, tickMarkSkip, noMultiLvlLbl
17
+ */
18
+ var CatAx = class extends XmlComponent {
19
+ constructor(axId, crossAx) {
20
+ super("c:catAx");
21
+ this.root.push(wrapEl("c:axId", chartAttr({ val: axId })));
22
+ this.root.push(new Scaling());
23
+ this.root.push(wrapEl("c:delete", chartAttr({ val: 0 })));
24
+ this.root.push(wrapEl("c:axPos", chartAttr({ val: "b" })));
25
+ this.root.push(wrapEl("c:crossAx", chartAttr({ val: crossAx })));
26
+ this.root.push(wrapEl("c:crosses", chartAttr({ val: "autoZero" })));
27
+ this.root.push(wrapEl("c:auto", chartAttr({ val: 1 })));
28
+ this.root.push(wrapEl("c:lblOffset", chartAttr({ val: 100 })));
29
+ this.root.push(wrapEl("c:noMultiLvlLbl", chartAttr({ val: 0 })));
30
+ }
31
+ };
32
+ /**
33
+ * c:valAx — value axis.
34
+ *
35
+ * XSD sequence: EG_AxShared (axId, scaling, delete, axPos, ..., spPr, ..., crossAx, crosses)
36
+ * then: crossBetween, majorUnit, minorUnit, dispUnits
37
+ */
38
+ var ValAx = class extends XmlComponent {
39
+ constructor(axId, crossAx) {
40
+ super("c:valAx");
41
+ this.root.push(wrapEl("c:axId", chartAttr({ val: axId })));
42
+ this.root.push(new Scaling());
43
+ this.root.push(wrapEl("c:delete", chartAttr({ val: 0 })));
44
+ this.root.push(wrapEl("c:axPos", chartAttr({ val: "l" })));
45
+ this.root.push(wrapEl("c:numFmt", chartAttr({
46
+ formatCode: "General",
47
+ sourceLinked: 1
48
+ })));
49
+ this.root.push(new BuilderElement({ name: "c:spPr" }));
50
+ this.root.push(wrapEl("c:crossAx", chartAttr({ val: crossAx })));
51
+ this.root.push(wrapEl("c:crosses", chartAttr({ val: "autoZero" })));
52
+ }
53
+ };
54
+ var SerAx = class extends XmlComponent {
55
+ constructor(axId, crossAx) {
56
+ super("c:serAx");
57
+ this.root.push(wrapEl("c:axId", chartAttr({ val: axId })));
58
+ this.root.push(new Scaling());
59
+ this.root.push(wrapEl("c:delete", chartAttr({ val: 0 })));
60
+ this.root.push(wrapEl("c:axPos", chartAttr({ val: "b" })));
61
+ this.root.push(wrapEl("c:numFmt", chartAttr({
62
+ formatCode: "General",
63
+ sourceLinked: 1
64
+ })));
65
+ this.root.push(new BuilderElement({ name: "c:spPr" }));
66
+ this.root.push(wrapEl("c:crossAx", chartAttr({ val: crossAx })));
67
+ this.root.push(wrapEl("c:crosses", chartAttr({ val: "autoZero" })));
68
+ this.root.push(wrapEl("c:tickLblSkip", chartAttr({ val: 1 })));
69
+ }
70
+ };
71
+ //#endregion
72
+ //#region src/chart/series/series-data.ts
73
+ const createStrRef$1 = (values) => {
74
+ return new StrRef(typeof values === "string" ? [values] : values);
75
+ };
76
+ const createNumRef$1 = (values) => new NumRef(values);
77
+ var StrRef = class extends XmlComponent {
78
+ constructor(values) {
79
+ super("c:strRef");
80
+ this.root.push(new EmptyElement("c:f"));
81
+ this.root.push(new StrCache$1(values));
82
+ }
83
+ };
84
+ var StrCache$1 = class extends XmlComponent {
85
+ constructor(values) {
86
+ super("c:strCache");
87
+ this.root.push(wrapEl("c:ptCount", chartAttr({ val: values.length })));
88
+ for (let i = 0; i < values.length; i++) this.root.push(new StrPt$1(i, values[i]));
89
+ }
90
+ };
91
+ var StrPt$1 = class extends XmlComponent {
92
+ constructor(index, value) {
93
+ super("c:pt");
94
+ this.root.push(chartAttr({ idx: index }));
95
+ this.root.push(new StringValue$1("c:v", value));
96
+ }
97
+ };
98
+ var NumRef = class extends XmlComponent {
99
+ constructor(values) {
100
+ super("c:numRef");
101
+ this.root.push(new EmptyElement("c:f"));
102
+ this.root.push(new NumCache$1(values));
103
+ }
104
+ };
105
+ var NumCache$1 = class extends XmlComponent {
106
+ constructor(values) {
107
+ super("c:numCache");
108
+ this.root.push(new FormatCode$1("General"));
109
+ this.root.push(wrapEl("c:ptCount", chartAttr({ val: values.length })));
110
+ for (let i = 0; i < values.length; i++) this.root.push(new NumPt$1(i, values[i]));
111
+ }
112
+ };
113
+ var NumPt$1 = class extends XmlComponent {
114
+ constructor(index, value) {
115
+ super("c:pt");
116
+ this.root.push(chartAttr({ idx: index }));
117
+ this.root.push(new StringValue$1("c:v", String(value)));
118
+ }
119
+ };
120
+ var FormatCode$1 = class extends XmlComponent {
121
+ constructor(code) {
122
+ super("c:formatCode");
123
+ this.root.push(code);
124
+ }
125
+ };
126
+ var StringValue$1 = class extends XmlComponent {
127
+ constructor(name, val) {
128
+ super(name);
129
+ this.root.push(val);
130
+ }
131
+ };
132
+ //#endregion
133
+ //#region src/chart/chart-types/area-chart.ts
134
+ var AreaChart = class extends XmlComponent {
135
+ constructor(options) {
136
+ super("c:areaChart");
137
+ this.root.push(wrapEl("c:grouping", chartAttr({ val: "standard" })));
138
+ for (let i = 0; i < options.series.length; i++) this.root.push(new AreaSeries(i, options.series[i], options.categories));
139
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
140
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
141
+ }
142
+ };
143
+ var AreaSeries = class extends XmlComponent {
144
+ constructor(index, series, categories) {
145
+ super("c:ser");
146
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
147
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
148
+ this.root.push(new SeriesTx$13(series.name));
149
+ this.root.push(new EmptyElement("c:spPr"));
150
+ this.root.push(new SeriesCat$10(categories));
151
+ this.root.push(new SeriesVal$11(series.values));
152
+ }
153
+ };
154
+ var SeriesTx$13 = class extends XmlComponent {
155
+ constructor(name) {
156
+ super("c:tx");
157
+ this.root.push(createStrRef$1(name));
158
+ }
159
+ };
160
+ var SeriesCat$10 = class extends XmlComponent {
161
+ constructor(categories) {
162
+ super("c:cat");
163
+ this.root.push(createStrRef$1(categories));
164
+ }
165
+ };
166
+ var SeriesVal$11 = class extends XmlComponent {
167
+ constructor(values) {
168
+ super("c:val");
169
+ this.root.push(createNumRef$1(values));
170
+ }
171
+ };
172
+ //#endregion
173
+ //#region src/chart/chart-types/area3d-chart.ts
174
+ var Area3DChart = class extends XmlComponent {
175
+ constructor(options) {
176
+ super("c:area3DChart");
177
+ this.root.push(wrapEl("c:grouping", chartAttr({ val: "standard" })));
178
+ for (let i = 0; i < options.series.length; i++) this.root.push(new Area3DSeries(i, options.series[i], options.categories));
179
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
180
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
181
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 30 })));
182
+ }
183
+ };
184
+ var Area3DSeries = class extends XmlComponent {
185
+ constructor(index, series, categories) {
186
+ super("c:ser");
187
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
188
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
189
+ this.root.push(new SeriesTx$12(series.name));
190
+ this.root.push(new EmptyElement("c:spPr"));
191
+ this.root.push(new SeriesCat$9(categories));
192
+ this.root.push(new SeriesVal$10(series.values));
193
+ }
194
+ };
195
+ var SeriesTx$12 = class extends XmlComponent {
196
+ constructor(name) {
197
+ super("c:tx");
198
+ this.root.push(createStrRef$1(name));
199
+ }
200
+ };
201
+ var SeriesCat$9 = class extends XmlComponent {
202
+ constructor(categories) {
203
+ super("c:cat");
204
+ this.root.push(createStrRef$1(categories));
205
+ }
206
+ };
207
+ var SeriesVal$10 = class extends XmlComponent {
208
+ constructor(values) {
209
+ super("c:val");
210
+ this.root.push(createNumRef$1(values));
211
+ }
212
+ };
213
+ //#endregion
214
+ //#region src/chart/chart-types/bar-chart.ts
215
+ var BarChart = class extends XmlComponent {
216
+ constructor(options) {
217
+ super("c:barChart");
218
+ this.root.push(wrapEl("c:barDir", chartAttr({ val: options.barDirection })));
219
+ this.root.push(wrapEl("c:grouping", chartAttr({ val: "clustered" })));
220
+ for (let i = 0; i < options.series.length; i++) this.root.push(new BarSeries(i, options.series[i], options.categories));
221
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
222
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
223
+ }
224
+ };
225
+ var BarSeries = class extends XmlComponent {
226
+ constructor(index, series, categories) {
227
+ super("c:ser");
228
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
229
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
230
+ this.root.push(new SeriesTx$11(series.name));
231
+ this.root.push(new EmptyElement("c:spPr"));
232
+ this.root.push(new SeriesCat$8(categories));
233
+ this.root.push(new SeriesVal$9(series.values));
234
+ }
235
+ };
236
+ var SeriesTx$11 = class extends XmlComponent {
237
+ constructor(name) {
238
+ super("c:tx");
239
+ this.root.push(createStrRef$1(name));
240
+ }
241
+ };
242
+ var SeriesCat$8 = class extends XmlComponent {
243
+ constructor(categories) {
244
+ super("c:cat");
245
+ this.root.push(createStrRef$1(categories));
246
+ }
247
+ };
248
+ var SeriesVal$9 = class extends XmlComponent {
249
+ constructor(values) {
250
+ super("c:val");
251
+ this.root.push(createNumRef$1(values));
252
+ }
253
+ };
254
+ //#endregion
255
+ //#region src/chart/chart-types/bar3d-chart.ts
256
+ var Bar3DChart = class extends XmlComponent {
257
+ constructor(options) {
258
+ super("c:bar3DChart");
259
+ this.root.push(wrapEl("c:barDir", chartAttr({ val: options.barDirection })));
260
+ this.root.push(wrapEl("c:grouping", chartAttr({ val: "clustered" })));
261
+ for (let i = 0; i < options.series.length; i++) this.root.push(new Bar3DSeries(i, options.series[i], options.categories));
262
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
263
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
264
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 30 })));
265
+ }
266
+ };
267
+ var Bar3DSeries = class extends XmlComponent {
268
+ constructor(index, series, categories) {
269
+ super("c:ser");
270
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
271
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
272
+ this.root.push(new SeriesTx$10(series.name));
273
+ this.root.push(new EmptyElement("c:spPr"));
274
+ this.root.push(new SeriesCat$7(categories));
275
+ this.root.push(new SeriesVal$8(series.values));
276
+ }
277
+ };
278
+ var SeriesTx$10 = class extends XmlComponent {
279
+ constructor(name) {
280
+ super("c:tx");
281
+ this.root.push(createStrRef$1(name));
282
+ }
283
+ };
284
+ var SeriesCat$7 = class extends XmlComponent {
285
+ constructor(categories) {
286
+ super("c:cat");
287
+ this.root.push(createStrRef$1(categories));
288
+ }
289
+ };
290
+ var SeriesVal$8 = class extends XmlComponent {
291
+ constructor(values) {
292
+ super("c:val");
293
+ this.root.push(createNumRef$1(values));
294
+ }
295
+ };
296
+ //#endregion
297
+ //#region src/chart/chart-types/bubble-chart.ts
298
+ var BubbleChart = class extends XmlComponent {
299
+ constructor(options) {
300
+ super("c:bubbleChart");
301
+ this.root.push(wrapEl("c:varyColors", chartAttr({ val: true })));
302
+ for (let i = 0; i < options.series.length; i++) this.root.push(new BubbleSeries(i, options.series[i]));
303
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
304
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
305
+ }
306
+ };
307
+ var BubbleSeries = class extends XmlComponent {
308
+ constructor(index, series) {
309
+ super("c:ser");
310
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
311
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
312
+ this.root.push(new SeriesTx$9(series.name));
313
+ this.root.push(new EmptyElement("c:spPr"));
314
+ this.root.push(new SeriesXValues(series.xValues));
315
+ this.root.push(new SeriesYValues(series.yValues));
316
+ this.root.push(new SeriesBubbleSize(series.bubbleSize));
317
+ }
318
+ };
319
+ var SeriesTx$9 = class extends XmlComponent {
320
+ constructor(name) {
321
+ super("c:tx");
322
+ this.root.push(createStrRef(name));
323
+ }
324
+ };
325
+ const createStrRef = (value) => new class extends XmlComponent {
326
+ constructor() {
327
+ super("c:strRef");
328
+ this.root.push(new EmptyElement("c:f"));
329
+ this.root.push(new StrCache(value));
330
+ }
331
+ }();
332
+ var StrCache = class extends XmlComponent {
333
+ constructor(value) {
334
+ super("c:strCache");
335
+ this.root.push(wrapEl("c:ptCount", chartAttr({ val: 1 })));
336
+ this.root.push(new StrPt(0, value));
337
+ }
338
+ };
339
+ var StrPt = class extends XmlComponent {
340
+ constructor(index, value) {
341
+ super("c:pt");
342
+ this.root.push(chartAttr({ idx: index }));
343
+ this.root.push(new StringValue("c:v", value));
344
+ }
345
+ };
346
+ var StringValue = class extends XmlComponent {
347
+ constructor(name, val) {
348
+ super(name);
349
+ this.root.push(val);
350
+ }
351
+ };
352
+ var SeriesXValues = class extends XmlComponent {
353
+ constructor(values) {
354
+ super("c:xVal");
355
+ this.root.push(createNumRef(values));
356
+ }
357
+ };
358
+ var SeriesYValues = class extends XmlComponent {
359
+ constructor(values) {
360
+ super("c:yVal");
361
+ this.root.push(createNumRef(values));
362
+ }
363
+ };
364
+ var SeriesBubbleSize = class extends XmlComponent {
365
+ constructor(values) {
366
+ super("c:bubbleSize");
367
+ this.root.push(createNumRef(values));
368
+ }
369
+ };
370
+ const createNumRef = (values) => new class extends XmlComponent {
371
+ constructor() {
372
+ super("c:numRef");
373
+ this.root.push(new EmptyElement("c:f"));
374
+ this.root.push(new NumCache(values));
375
+ }
376
+ }();
377
+ var NumCache = class extends XmlComponent {
378
+ constructor(values) {
379
+ super("c:numCache");
380
+ this.root.push(new FormatCode("General"));
381
+ this.root.push(wrapEl("c:ptCount", chartAttr({ val: values.length })));
382
+ for (let i = 0; i < values.length; i++) this.root.push(new NumPt(i, values[i]));
383
+ }
384
+ };
385
+ var NumPt = class extends XmlComponent {
386
+ constructor(index, value) {
387
+ super("c:pt");
388
+ this.root.push(chartAttr({ idx: index }));
389
+ this.root.push(new StringValue("c:v", String(value)));
390
+ }
391
+ };
392
+ var FormatCode = class extends XmlComponent {
393
+ constructor(code) {
394
+ super("c:formatCode");
395
+ this.root.push(code);
396
+ }
397
+ };
398
+ //#endregion
399
+ //#region src/chart/chart-types/doughnut-chart.ts
400
+ var DoughnutChart = class extends XmlComponent {
401
+ constructor(options) {
402
+ super("c:doughnutChart");
403
+ this.root.push(wrapEl("c:varyColors", chartAttr({ val: true })));
404
+ if (options.holeSize !== void 0) this.root.push(wrapEl("c:firstSliceAng", chartAttr({ val: 0 })));
405
+ for (let i = 0; i < options.series.length; i++) this.root.push(new DoughnutSeries(i, options.series[i], options.categories));
406
+ }
407
+ };
408
+ var DoughnutSeries = class extends XmlComponent {
409
+ constructor(index, series, categories) {
410
+ super("c:ser");
411
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
412
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
413
+ this.root.push(new SeriesTx$8(series.name));
414
+ this.root.push(new EmptyElement("c:spPr"));
415
+ this.root.push(new SeriesCat$6(categories));
416
+ this.root.push(new SeriesVal$7(series.values));
417
+ }
418
+ };
419
+ var SeriesTx$8 = class extends XmlComponent {
420
+ constructor(name) {
421
+ super("c:tx");
422
+ this.root.push(createStrRef$1(name));
423
+ }
424
+ };
425
+ var SeriesCat$6 = class extends XmlComponent {
426
+ constructor(categories) {
427
+ super("c:cat");
428
+ this.root.push(createStrRef$1(categories));
429
+ }
430
+ };
431
+ var SeriesVal$7 = class extends XmlComponent {
432
+ constructor(values) {
433
+ super("c:val");
434
+ this.root.push(createNumRef$1(values));
435
+ }
436
+ };
437
+ //#endregion
438
+ //#region src/chart/chart-types/line-chart.ts
439
+ var LineChart = class extends XmlComponent {
440
+ constructor(options) {
441
+ super("c:lineChart");
442
+ this.root.push(wrapEl("c:grouping", chartAttr({ val: "standard" })));
443
+ for (let i = 0; i < options.series.length; i++) this.root.push(new LineSeries(i, options.series[i], options.categories));
444
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
445
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
446
+ }
447
+ };
448
+ var LineSeries = class extends XmlComponent {
449
+ constructor(index, series, categories) {
450
+ super("c:ser");
451
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
452
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
453
+ this.root.push(new SeriesTx$7(series.name));
454
+ this.root.push(new EmptyElement("c:spPr"));
455
+ this.root.push(new SeriesCat$5(categories));
456
+ this.root.push(new SeriesVal$6(series.values));
457
+ }
458
+ };
459
+ var SeriesTx$7 = class extends XmlComponent {
460
+ constructor(name) {
461
+ super("c:tx");
462
+ this.root.push(createStrRef$1(name));
463
+ }
464
+ };
465
+ var SeriesCat$5 = class extends XmlComponent {
466
+ constructor(categories) {
467
+ super("c:cat");
468
+ this.root.push(createStrRef$1(categories));
469
+ }
470
+ };
471
+ var SeriesVal$6 = class extends XmlComponent {
472
+ constructor(values) {
473
+ super("c:val");
474
+ this.root.push(createNumRef$1(values));
475
+ }
476
+ };
477
+ //#endregion
478
+ //#region src/chart/chart-types/line3d-chart.ts
479
+ var Line3DChart = class extends XmlComponent {
480
+ constructor(options) {
481
+ super("c:line3DChart");
482
+ this.root.push(wrapEl("c:grouping", chartAttr({ val: "standard" })));
483
+ for (let i = 0; i < options.series.length; i++) this.root.push(new Line3DSeries(i, options.series[i], options.categories));
484
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
485
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
486
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 30 })));
487
+ }
488
+ };
489
+ var Line3DSeries = class extends XmlComponent {
490
+ constructor(index, series, categories) {
491
+ super("c:ser");
492
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
493
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
494
+ this.root.push(new SeriesTx$6(series.name));
495
+ this.root.push(new EmptyElement("c:spPr"));
496
+ this.root.push(new SeriesCat$4(categories));
497
+ this.root.push(new SeriesVal$5(series.values));
498
+ }
499
+ };
500
+ var SeriesTx$6 = class extends XmlComponent {
501
+ constructor(name) {
502
+ super("c:tx");
503
+ this.root.push(createStrRef$1(name));
504
+ }
505
+ };
506
+ var SeriesCat$4 = class extends XmlComponent {
507
+ constructor(categories) {
508
+ super("c:cat");
509
+ this.root.push(createStrRef$1(categories));
510
+ }
511
+ };
512
+ var SeriesVal$5 = class extends XmlComponent {
513
+ constructor(values) {
514
+ super("c:val");
515
+ this.root.push(createNumRef$1(values));
516
+ }
517
+ };
518
+ //#endregion
519
+ //#region src/chart/chart-types/pie-chart.ts
520
+ var PieChart = class extends XmlComponent {
521
+ constructor(options) {
522
+ super("c:pieChart");
523
+ this.root.push(wrapEl("c:varyColors", chartAttr({ val: true })));
524
+ for (let i = 0; i < options.series.length; i++) this.root.push(new PieSeries(i, options.series[i], options.categories));
525
+ }
526
+ };
527
+ var PieSeries = class extends XmlComponent {
528
+ constructor(index, series, categories) {
529
+ super("c:ser");
530
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
531
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
532
+ this.root.push(new SeriesTx$5(series.name));
533
+ this.root.push(new EmptyElement("c:spPr"));
534
+ this.root.push(new SeriesCat$3(categories));
535
+ this.root.push(new SeriesVal$4(series.values));
536
+ }
537
+ };
538
+ var SeriesTx$5 = class extends XmlComponent {
539
+ constructor(name) {
540
+ super("c:tx");
541
+ this.root.push(createStrRef$1(name));
542
+ }
543
+ };
544
+ var SeriesCat$3 = class extends XmlComponent {
545
+ constructor(categories) {
546
+ super("c:cat");
547
+ this.root.push(createStrRef$1(categories));
548
+ }
549
+ };
550
+ var SeriesVal$4 = class extends XmlComponent {
551
+ constructor(values) {
552
+ super("c:val");
553
+ this.root.push(createNumRef$1(values));
554
+ }
555
+ };
556
+ //#endregion
557
+ //#region src/chart/chart-types/pie3d-chart.ts
558
+ var Pie3DChart = class extends XmlComponent {
559
+ constructor(options) {
560
+ super("c:pie3DChart");
561
+ this.root.push(wrapEl("c:varyColors", chartAttr({ val: true })));
562
+ for (let i = 0; i < options.series.length; i++) this.root.push(new Pie3DSeries(i, options.series[i], options.categories));
563
+ }
564
+ };
565
+ var Pie3DSeries = class extends XmlComponent {
566
+ constructor(index, series, categories) {
567
+ super("c:ser");
568
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
569
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
570
+ this.root.push(new SeriesTx$4(series.name));
571
+ this.root.push(new EmptyElement("c:spPr"));
572
+ this.root.push(new SeriesCat$2(categories));
573
+ this.root.push(new SeriesVal$3(series.values));
574
+ }
575
+ };
576
+ var SeriesTx$4 = class extends XmlComponent {
577
+ constructor(name) {
578
+ super("c:tx");
579
+ this.root.push(createStrRef$1(name));
580
+ }
581
+ };
582
+ var SeriesCat$2 = class extends XmlComponent {
583
+ constructor(categories) {
584
+ super("c:cat");
585
+ this.root.push(createStrRef$1(categories));
586
+ }
587
+ };
588
+ var SeriesVal$3 = class extends XmlComponent {
589
+ constructor(values) {
590
+ super("c:val");
591
+ this.root.push(createNumRef$1(values));
592
+ }
593
+ };
594
+ //#endregion
595
+ //#region src/chart/chart-types/radar-chart.ts
596
+ var RadarChart = class extends XmlComponent {
597
+ constructor(options) {
598
+ super("c:radarChart");
599
+ this.root.push(wrapEl("c:radarStyle", chartAttr({ val: options.radarStyle ?? "standard" })));
600
+ for (let i = 0; i < options.series.length; i++) this.root.push(new RadarSeries(i, options.series[i], options.categories));
601
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
602
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
603
+ }
604
+ };
605
+ var RadarSeries = class extends XmlComponent {
606
+ constructor(index, series, categories) {
607
+ super("c:ser");
608
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
609
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
610
+ this.root.push(new SeriesTx$3(series.name));
611
+ this.root.push(new EmptyElement("c:spPr"));
612
+ this.root.push(new SeriesCat$1(categories));
613
+ this.root.push(new SeriesVal$2(series.values));
614
+ }
615
+ };
616
+ var SeriesTx$3 = class extends XmlComponent {
617
+ constructor(name) {
618
+ super("c:tx");
619
+ this.root.push(createStrRef$1(name));
620
+ }
621
+ };
622
+ var SeriesCat$1 = class extends XmlComponent {
623
+ constructor(categories) {
624
+ super("c:cat");
625
+ this.root.push(createStrRef$1(categories));
626
+ }
627
+ };
628
+ var SeriesVal$2 = class extends XmlComponent {
629
+ constructor(values) {
630
+ super("c:val");
631
+ this.root.push(createNumRef$1(values));
632
+ }
633
+ };
634
+ //#endregion
635
+ //#region src/chart/chart-types/scatter-chart.ts
636
+ var ScatterChart = class extends XmlComponent {
637
+ constructor(options) {
638
+ super("c:scatterChart");
639
+ this.root.push(wrapEl("c:scatterStyle", chartAttr({ val: "line" })));
640
+ for (let i = 0; i < options.series.length; i++) this.root.push(new ScatterSeries(i, options.series[i], options.categories));
641
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
642
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
643
+ }
644
+ };
645
+ var ScatterSeries = class extends XmlComponent {
646
+ constructor(index, series, categories) {
647
+ super("c:ser");
648
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
649
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
650
+ this.root.push(new SeriesTx$2(series.name));
651
+ this.root.push(new EmptyElement("c:spPr"));
652
+ this.root.push(new SeriesXVal(categories));
653
+ this.root.push(new SeriesYVal(series.values));
654
+ }
655
+ };
656
+ var SeriesTx$2 = class extends XmlComponent {
657
+ constructor(name) {
658
+ super("c:tx");
659
+ this.root.push(createStrRef$1(name));
660
+ }
661
+ };
662
+ var SeriesXVal = class extends XmlComponent {
663
+ constructor(categories) {
664
+ super("c:xVal");
665
+ this.root.push(createStrRef$1(categories));
666
+ }
667
+ };
668
+ var SeriesYVal = class extends XmlComponent {
669
+ constructor(values) {
670
+ super("c:yVal");
671
+ this.root.push(createNumRef$1(values));
672
+ }
673
+ };
674
+ //#endregion
675
+ //#region src/chart/chart-types/stock-chart.ts
676
+ var StockChart = class extends XmlComponent {
677
+ constructor(options) {
678
+ super("c:stockChart");
679
+ for (let i = 0; i < options.series.length; i++) this.root.push(new StockSeries(i, options.series[i]));
680
+ this.root.push(new DropLines());
681
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
682
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
683
+ }
684
+ };
685
+ var StockSeries = class extends XmlComponent {
686
+ constructor(index, series) {
687
+ super("c:ser");
688
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
689
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
690
+ this.root.push(new SeriesTx$1(series.name));
691
+ this.root.push(new EmptyElement("c:spPr"));
692
+ this.root.push(new SeriesVal$1(series.values));
693
+ }
694
+ };
695
+ var SeriesTx$1 = class extends XmlComponent {
696
+ constructor(name) {
697
+ super("c:tx");
698
+ this.root.push(createStrRef$1(name));
699
+ }
700
+ };
701
+ var SeriesVal$1 = class extends XmlComponent {
702
+ constructor(values) {
703
+ super("c:val");
704
+ this.root.push(createNumRef$1(values));
705
+ }
706
+ };
707
+ var DropLines = class extends XmlComponent {
708
+ constructor() {
709
+ super("c:dropLines");
710
+ this.root.push(new EmptyElement("c:spPr"));
711
+ }
712
+ };
713
+ //#endregion
714
+ //#region src/chart/chart-types/surface-chart.ts
715
+ var SurfaceChart = class extends XmlComponent {
716
+ constructor(options) {
717
+ super("c:surfaceChart");
718
+ if (options.wireframe) this.root.push(wrapEl("c:wireframe", chartAttr({ val: true })));
719
+ for (let i = 0; i < options.series.length; i++) this.root.push(new SurfaceSeries(i, options.series[i], options.categories));
720
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 10 })));
721
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 20 })));
722
+ this.root.push(wrapEl("c:axId", chartAttr({ val: 30 })));
723
+ }
724
+ };
725
+ var SurfaceSeries = class extends XmlComponent {
726
+ constructor(index, series, categories) {
727
+ super("c:ser");
728
+ this.root.push(wrapEl("c:idx", chartAttr({ val: index })));
729
+ this.root.push(wrapEl("c:order", chartAttr({ val: index })));
730
+ this.root.push(new SeriesTx(series.name));
731
+ this.root.push(new EmptyElement("c:spPr"));
732
+ this.root.push(new SeriesCat(categories));
733
+ this.root.push(new SeriesVal(series.values));
734
+ }
735
+ };
736
+ var SeriesTx = class extends XmlComponent {
737
+ constructor(name) {
738
+ super("c:tx");
739
+ this.root.push(createStrRef$1(name));
740
+ }
741
+ };
742
+ var SeriesCat = class extends XmlComponent {
743
+ constructor(categories) {
744
+ super("c:cat");
745
+ this.root.push(createStrRef$1(categories));
746
+ }
747
+ };
748
+ var SeriesVal = class extends XmlComponent {
749
+ constructor(values) {
750
+ super("c:val");
751
+ this.root.push(createNumRef$1(values));
752
+ }
753
+ };
754
+ //#endregion
755
+ //#region src/chart/create-chart-type.ts
756
+ const is3D = (opts) => opts.threeD === true;
757
+ const createChartType = (options) => {
758
+ if (options.type === "bubble") return new BubbleChart({ series: options.series });
759
+ const opts = options;
760
+ switch (opts.type) {
761
+ case "column":
762
+ case "bar": return is3D(opts) ? new Bar3DChart({
763
+ barDirection: opts.type === "column" ? "col" : "bar",
764
+ categories: opts.categories,
765
+ series: opts.series
766
+ }) : new BarChart({
767
+ barDirection: opts.type === "column" ? "col" : "bar",
768
+ categories: opts.categories,
769
+ series: opts.series
770
+ });
771
+ case "line": return is3D(opts) ? new Line3DChart({
772
+ categories: opts.categories,
773
+ series: opts.series
774
+ }) : new LineChart({
775
+ categories: opts.categories,
776
+ series: opts.series
777
+ });
778
+ case "pie": return is3D(opts) ? new Pie3DChart({
779
+ categories: opts.categories,
780
+ series: opts.series
781
+ }) : new PieChart({
782
+ categories: opts.categories,
783
+ series: opts.series
784
+ });
785
+ case "area": return is3D(opts) ? new Area3DChart({
786
+ categories: opts.categories,
787
+ series: opts.series
788
+ }) : new AreaChart({
789
+ categories: opts.categories,
790
+ series: opts.series
791
+ });
792
+ case "scatter": return new ScatterChart({
793
+ categories: opts.categories,
794
+ series: opts.series
795
+ });
796
+ case "doughnut": return new DoughnutChart({
797
+ categories: opts.categories,
798
+ series: opts.series
799
+ });
800
+ case "radar": return new RadarChart({
801
+ categories: opts.categories,
802
+ series: opts.series
803
+ });
804
+ case "stock": return new StockChart({
805
+ categories: opts.categories,
806
+ series: opts.series
807
+ });
808
+ case "surface": return new SurfaceChart({
809
+ categories: opts.categories,
810
+ series: opts.series
811
+ });
812
+ default: throw new Error(`Unsupported chart type: ${options.type}`);
813
+ }
814
+ };
815
+ //#endregion
816
+ //#region src/chart/title.ts
817
+ var ChartTitle = class extends XmlComponent {
818
+ constructor(title) {
819
+ super("c:title");
820
+ this.root.push(new TitleTx(title));
821
+ this.root.push(new TitleOverlay());
822
+ }
823
+ };
824
+ var TitleTx = class extends XmlComponent {
825
+ constructor(title) {
826
+ super("c:tx");
827
+ const rich = new class extends XmlComponent {
828
+ constructor() {
829
+ super("c:rich");
830
+ }
831
+ }();
832
+ rich["root"].push(new class extends XmlComponent {
833
+ constructor() {
834
+ super("a:bodyPr");
835
+ }
836
+ }());
837
+ rich["root"].push(new class extends XmlComponent {
838
+ constructor() {
839
+ super("a:lstStyle");
840
+ }
841
+ }());
842
+ const p = new class extends XmlComponent {
843
+ constructor() {
844
+ super("a:p");
845
+ }
846
+ }();
847
+ const r = new class extends XmlComponent {
848
+ constructor() {
849
+ super("a:r");
850
+ }
851
+ }();
852
+ r["root"].push(new class extends XmlComponent {
853
+ constructor() {
854
+ super("a:t");
855
+ this.root.push(title);
856
+ }
857
+ }());
858
+ p["root"].push(r);
859
+ rich["root"].push(p);
860
+ this.root.push(rich);
861
+ }
862
+ };
863
+ var TitleOverlay = class extends XmlComponent {
864
+ constructor() {
865
+ super("c:overlay");
866
+ this.root.push(chartAttr({ val: 0 }));
867
+ }
868
+ };
869
+ //#endregion
870
+ //#region src/chart/chart-space.ts
871
+ /**
872
+ * ChartSpace — root element for chart XML parts (c:chartSpace).
873
+ *
874
+ * Full XSD-compliant implementation with all optional elements.
875
+ *
876
+ * @module
877
+ */
878
+ /**
879
+ * c:chartSpace — root element for chart XML parts.
880
+ */
881
+ var ChartSpace = class extends XmlComponent {
882
+ constructor(options) {
883
+ super("c:chartSpace");
884
+ this.root.push(chartAttr({
885
+ "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
886
+ "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
887
+ "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
888
+ }));
889
+ this.root.push(wrapEl("c:date1904", chartAttr({ val: 0 })));
890
+ this.root.push(wrapEl("c:lang", chartAttr({ val: "en-US" })));
891
+ this.root.push(wrapEl("c:roundedCorners", chartAttr({ val: 0 })));
892
+ if (options.style !== void 0) this.root.push(new ChartStyle(options.style));
893
+ const chart = new ChartContainer();
894
+ if (options.title) chart["root"].push(new ChartTitle(options.title));
895
+ chart["root"].push(wrapEl("c:autoTitleDeleted", chartAttr({ val: 0 })));
896
+ const plotArea = new PlotArea();
897
+ plotArea["root"].push(new BuilderElement({ name: "c:layout" }));
898
+ plotArea["root"].push(createChartType({
899
+ categories: options.categories ?? [],
900
+ series: options.series,
901
+ type: options.type,
902
+ threeD: options.threeD
903
+ }));
904
+ if (!(options.type === "pie" || options.type === "doughnut")) if (options.type === "scatter" || options.type === "bubble") {
905
+ plotArea["root"].push(new ValAx(10, 20));
906
+ plotArea["root"].push(new ValAx(20, 10));
907
+ } else if (options.type === "stock") {
908
+ plotArea["root"].push(new CatAx(10, 20));
909
+ plotArea["root"].push(new ValAx(20, 10));
910
+ } else if (options.type === "surface") {
911
+ plotArea["root"].push(new CatAx(10, 20));
912
+ plotArea["root"].push(new ValAx(20, 10));
913
+ plotArea["root"].push(new SerAx(30, 10));
914
+ } else {
915
+ plotArea["root"].push(new CatAx(10, 20));
916
+ plotArea["root"].push(new ValAx(20, 10));
917
+ if (options.threeD) plotArea["root"].push(new CatAx(30, 10));
918
+ }
919
+ chart["root"].push(plotArea);
920
+ if (options.showLegend !== false) chart["root"].push(createLegend());
921
+ this.root.push(chart);
922
+ this.root.push(createChartSpPr());
923
+ this.root.push(createChartTxPr());
924
+ }
925
+ };
926
+ var ChartContainer = class extends XmlComponent {
927
+ constructor() {
928
+ super("c:chart");
929
+ }
930
+ };
931
+ var PlotArea = class extends XmlComponent {
932
+ constructor() {
933
+ super("c:plotArea");
934
+ }
935
+ };
936
+ function createLegend() {
937
+ const legend = new class extends XmlComponent {
938
+ constructor() {
939
+ super("c:legend");
940
+ }
941
+ }();
942
+ legend["root"].push(wrapEl("c:legendPos", chartAttr({ val: "b" })));
943
+ legend["root"].push(new BuilderElement({ name: "c:layout" }));
944
+ legend["root"].push(wrapEl("c:overlay", chartAttr({ val: 0 })));
945
+ legend["root"].push(createNoFillSpPr());
946
+ legend["root"].push(createTxPr());
947
+ return legend;
948
+ }
949
+ function createNoFillSpPr() {
950
+ const spPr = new class extends XmlComponent {
951
+ constructor() {
952
+ super("c:spPr");
953
+ }
954
+ }();
955
+ spPr["root"].push(new class extends XmlComponent {
956
+ constructor() {
957
+ super("a:noFill");
958
+ }
959
+ }());
960
+ spPr["root"].push(new class extends XmlComponent {
961
+ constructor() {
962
+ super("a:ln");
963
+ this.root.push(new class extends XmlComponent {
964
+ constructor() {
965
+ super("a:noFill");
966
+ }
967
+ }());
968
+ }
969
+ }());
970
+ spPr["root"].push(new BuilderElement({ name: "a:effectLst" }));
971
+ return spPr;
972
+ }
973
+ function createChartSpPr() {
974
+ const spPr = new class extends XmlComponent {
975
+ constructor() {
976
+ super("c:spPr");
977
+ }
978
+ }();
979
+ spPr["root"].push(new class extends XmlComponent {
980
+ constructor() {
981
+ super("a:noFill");
982
+ }
983
+ }());
984
+ spPr["root"].push(new class extends XmlComponent {
985
+ constructor() {
986
+ super("a:ln");
987
+ this.root.push(new class extends XmlComponent {
988
+ constructor() {
989
+ super("a:noFill");
990
+ }
991
+ }());
992
+ }
993
+ }());
994
+ spPr["root"].push(new BuilderElement({ name: "a:effectLst" }));
995
+ return spPr;
996
+ }
997
+ function createChartTxPr() {
998
+ const txPr = new class extends XmlComponent {
999
+ constructor() {
1000
+ super("c:txPr");
1001
+ }
1002
+ }();
1003
+ txPr["root"].push(new BuilderElement({ name: "a:bodyPr" }));
1004
+ txPr["root"].push(new BuilderElement({ name: "a:lstStyle" }));
1005
+ txPr["root"].push(createTextParagraph());
1006
+ return txPr;
1007
+ }
1008
+ function createTxPr() {
1009
+ const txPr = new class extends XmlComponent {
1010
+ constructor() {
1011
+ super("c:txPr");
1012
+ }
1013
+ }();
1014
+ txPr["root"].push(createBodyPr());
1015
+ txPr["root"].push(new BuilderElement({ name: "a:lstStyle" }));
1016
+ txPr["root"].push(createTextParagraph());
1017
+ return txPr;
1018
+ }
1019
+ function createBodyPr() {
1020
+ return new BuilderElement({
1021
+ name: "a:bodyPr",
1022
+ attributes: {
1023
+ rot: {
1024
+ key: "rot",
1025
+ value: "0"
1026
+ },
1027
+ spcFirstLastPara: {
1028
+ key: "spcFirstLastPara",
1029
+ value: "1"
1030
+ },
1031
+ vertOverflow: {
1032
+ key: "vertOverflow",
1033
+ value: "ellipsis"
1034
+ },
1035
+ vert: {
1036
+ key: "vert",
1037
+ value: "horz"
1038
+ },
1039
+ wrap: {
1040
+ key: "wrap",
1041
+ value: "square"
1042
+ },
1043
+ anchor: {
1044
+ key: "anchor",
1045
+ value: "ctr"
1046
+ },
1047
+ anchorCtr: {
1048
+ key: "anchorCtr",
1049
+ value: "1"
1050
+ }
1051
+ }
1052
+ });
1053
+ }
1054
+ function createTextParagraph() {
1055
+ const p = new class extends XmlComponent {
1056
+ constructor() {
1057
+ super("a:p");
1058
+ }
1059
+ }();
1060
+ const pPr = new class extends XmlComponent {
1061
+ constructor() {
1062
+ super("a:pPr");
1063
+ }
1064
+ }();
1065
+ pPr["root"].push(new BuilderElement({ name: "a:defRPr" }));
1066
+ p["root"].push(pPr);
1067
+ p["root"].push(new BuilderElement({
1068
+ name: "a:endParaRPr",
1069
+ attributes: { lang: {
1070
+ key: "lang",
1071
+ value: "en-US"
1072
+ } }
1073
+ }));
1074
+ return p;
1075
+ }
1076
+ var ChartStyle = class extends XmlComponent {
1077
+ constructor(val) {
1078
+ super("c:style");
1079
+ this.root.push(chartAttr({ val: String(val) }));
1080
+ }
1081
+ };
1082
+ //#endregion
1083
+ //#region src/chart/chart-collection.ts
1084
+ var ChartCollection = class {
1085
+ map;
1086
+ constructor() {
1087
+ this.map = /* @__PURE__ */ new Map();
1088
+ }
1089
+ addChart(key, chartData) {
1090
+ this.map.set(key, chartData);
1091
+ }
1092
+ get array() {
1093
+ return [...this.map.values()];
1094
+ }
1095
+ };
1096
+ //#endregion
1097
+ export { ValAx as C, SerAx as S, Area3DChart as _, SurfaceChart as a, createStrRef$1 as b, RadarChart as c, Line3DChart as d, LineChart as f, BarChart as g, Bar3DChart as h, createChartType as i, Pie3DChart as l, BubbleChart as m, ChartSpace as n, StockChart as o, DoughnutChart as p, ChartTitle as r, ScatterChart as s, ChartCollection as t, PieChart as u, AreaChart as v, CatAx as x, createNumRef$1 as y };