@officedk/pptxdk 0.2.0 → 0.2.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/build.d.ts +5 -8
- package/dist/build.js +44 -52
- package/dist/core/dist/capabilities/audio/audio-declaration.js +7 -0
- package/dist/core/dist/capabilities/audio/audio-source.js +172 -0
- package/dist/core/dist/capabilities/audio/entry.js +122 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-codegen.js +7 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/box/box.js +14 -15
- package/dist/core/dist/capabilities/box/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-codegen.js +11 -18
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-import.js +891 -468
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-labels.js +30 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-model.js +1 -1
- package/dist/{capabilities/dist/chart/preview/number-format.js → core/dist/capabilities/chart/chart-number-format.js} +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-schemas.js +73 -79
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart-xml.js +41 -36
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/chart.js +175 -113
- package/dist/core/dist/capabilities/chart/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/axes-and-grid.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/bar-column.js +1 -1
- package/dist/core/dist/capabilities/chart/preview/data-labels.js +474 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/error-bars.js +3 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/index.js +28 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/layout.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/legend.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/line-area.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/markers.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/pie-doughnut.js +39 -60
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scales.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/scatter.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/style.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/text-render.js +34 -24
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/trendlines.js +3 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/chart/preview/types.js +1 -1
- package/dist/core/dist/capabilities/comment/comment-codegen.js +25 -0
- package/dist/core/dist/capabilities/comment/comment-declaration.js +37 -0
- package/dist/core/dist/capabilities/comment/comment-import.js +176 -0
- package/dist/core/dist/capabilities/comment/comment.js +141 -0
- package/dist/core/dist/capabilities/comment/entry.js +1 -0
- package/dist/core/dist/capabilities/footer-placeholder/entry.js +2 -0
- package/dist/core/dist/capabilities/footer-placeholder/footer-placeholder-codegen.js +16 -0
- package/dist/{capabilities/dist/masters → core/dist/capabilities/footer-placeholder}/footer-placeholder.js +113 -50
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer-import.js +121 -0
- package/dist/core/dist/capabilities/footer-placeholder/print-header-footer.js +123 -0
- package/dist/core/dist/capabilities/group/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-declaration.js +8 -8
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-import.js +36 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/group/group.js +17 -17
- package/dist/core/dist/capabilities/image/entry.js +4 -0
- package/dist/core/dist/capabilities/image/image-codegen.js +59 -0
- package/dist/core/dist/capabilities/image/image-declaration.js +8 -0
- package/dist/core/dist/capabilities/image/image-import.js +26 -0
- package/dist/core/dist/capabilities/image/image.js +57 -0
- package/dist/core/dist/capabilities/line/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-codegen.js +6 -7
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-declaration.js +15 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-import.js +15 -95
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/line/line.js +41 -43
- package/dist/core/dist/capabilities/masters/entry.js +1 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters-codegen.js +7 -26
- package/dist/{capabilities/dist → core/dist/capabilities}/masters/masters.js +23 -35
- package/dist/core/dist/capabilities/motion/entry.js +5 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-codegen.js +15 -35
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-import.js +25 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-plan.js +17 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion-query.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/motion/motion.js +79 -75
- package/dist/core/dist/capabilities/notes/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-codegen.js +4 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-import.js +16 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes-schemas.js +6 -6
- package/dist/{capabilities/dist → core/dist/capabilities}/notes/notes.js +16 -41
- package/dist/{import/dist/sections.js → core/dist/capabilities/notes/sections-import.js} +5 -5
- package/dist/core/dist/capabilities/placeholder/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-codegen.js +5 -15
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder-schemas.js +7 -9
- package/dist/{capabilities/dist → core/dist/capabilities}/placeholder/placeholder.js +50 -107
- package/dist/core/dist/capabilities/shape/entry.js +6 -0
- package/dist/core/dist/capabilities/shape/shape-codegen.js +112 -0
- package/dist/core/dist/capabilities/shape/shape-import.js +152 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape-xml.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/shape/shape.js +44 -30
- package/dist/core/dist/capabilities/shared/container-slots.js +59 -0
- package/dist/core/dist/capabilities/shared/date-time.js +98 -0
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-embedding.js +5 -6
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-engine.js +34 -13
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-import.js +62 -23
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font-subset.js +24 -9
- package/dist/{capabilities/dist → core/dist/capabilities/shared}/font/font.js +4 -4
- package/dist/core/dist/capabilities/shared/geometry-codegen.js +101 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/geometry.js +47 -44
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/identity.js +56 -38
- package/dist/core/dist/capabilities/shared/image-codegen.js +94 -0
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-decode.js +17 -79
- package/dist/{capabilities/dist/image → core/dist/capabilities/shared}/image-schemas.js +16 -26
- package/dist/core/dist/capabilities/shared/line-match.js +78 -0
- package/dist/core/dist/capabilities/shared/media-codegen.js +86 -0
- package/dist/core/dist/capabilities/shared/media-import.js +156 -0
- package/dist/core/dist/capabilities/shared/media-placement.js +20 -0
- package/dist/core/dist/capabilities/shared/media-poster.js +50 -0
- package/dist/core/dist/capabilities/shared/media-schemas.js +60 -0
- package/dist/core/dist/capabilities/shared/media-source.js +107 -0
- package/dist/core/dist/capabilities/shared/media-trim.js +102 -0
- package/dist/core/dist/capabilities/shared/media.js +134 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/morph-api.js +5 -5
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-api.js +112 -99
- package/dist/{capabilities/dist/motion → core/dist/capabilities/shared}/motion-schemas.js +19 -5
- package/dist/{capabilities/dist/image/image-import.js → core/dist/capabilities/shared/picture-import.js} +97 -158
- package/dist/core/dist/capabilities/shared/picture-xml.js +13 -0
- package/dist/core/dist/capabilities/shared/picture.js +510 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/placeholder-import.js +50 -20
- package/dist/core/dist/capabilities/shared/placeholder-roles.js +42 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/preset-definitions.js +1 -1
- package/dist/core/dist/capabilities/shared/print-xml.js +77 -0
- package/dist/{capabilities/dist/text/text-codegen.js → core/dist/capabilities/shared/rich-text-codegen.js} +23 -102
- package/dist/core/dist/capabilities/shared/rich-text-import.js +472 -0
- package/dist/{capabilities/dist/shape → core/dist/capabilities/shared}/shape-declaration.js +14 -14
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/style-inheritance.js +12 -5
- package/dist/{capabilities/dist/text → core/dist/capabilities/shared}/text-declaration.js +7 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-schemas.js +77 -77
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/text-service.js +571 -260
- package/dist/{capabilities/dist → core/dist/capabilities}/shared/visual.js +137 -112
- package/dist/core/dist/capabilities/slide-background/entry.js +1 -0
- package/dist/core/dist/capabilities/slide-background/slide-background-codegen.js +15 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-import.js +5 -5
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background-xml.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/slide-background/slide-background.js +27 -33
- package/dist/core/dist/capabilities/table/entry.js +2 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-codegen.js +6 -13
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-declaration.js +2 -2
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-import.js +22 -57
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-schemas.js +40 -37
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table-xml.js +9 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/table/table.js +60 -45
- package/dist/core/dist/capabilities/text/entry.js +3 -0
- package/dist/core/dist/capabilities/text/text-codegen.js +66 -0
- package/dist/core/dist/capabilities/text/text-import.js +468 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text-xml.js +3 -4
- package/dist/{capabilities/dist → core/dist/capabilities}/text/text.js +61 -54
- package/dist/core/dist/capabilities/transition/entry.js +3 -0
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-api.js +1 -1
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-codegen.js +2 -3
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition-import.js +25 -27
- package/dist/{capabilities/dist → core/dist/capabilities}/transition/transition.js +23 -23
- package/dist/core/dist/capabilities/video/entry.js +77 -0
- package/dist/core/dist/capabilities/video/video-declaration.js +7 -0
- package/dist/core/dist/capabilities/video/video-source.js +42 -0
- package/dist/{codegen/dist → core/dist/codegen}/assets.js +13 -8
- package/dist/{codegen/dist → core/dist/codegen}/codegen.js +54 -122
- package/dist/{codegen/dist → core/dist/codegen}/identifiers.js +17 -1
- package/dist/{codegen/dist → core/dist/codegen}/index.js +2 -2
- package/dist/{codegen/dist → core/dist/codegen}/printer.js +23 -4
- package/dist/core/dist/document/all.js +41 -0
- package/dist/core/dist/document/default.js +10 -0
- package/dist/core/dist/document/document.js +218 -0
- package/dist/core/dist/document/index.js +62 -0
- package/dist/core/dist/document/stages.js +54 -0
- package/dist/{emit/dist → core/dist/emit}/emit.js +122 -60
- package/dist/core/dist/emit/index.js +6 -0
- package/dist/core/dist/emit/ooxml.js +241 -0
- package/dist/{import/dist → core/dist/import}/import.js +221 -187
- package/dist/core/dist/import/index.js +19 -0
- package/dist/{import/dist → core/dist/import}/masters.js +253 -317
- package/dist/core/dist/import/media-timing.js +233 -0
- package/dist/{import/dist → core/dist/import}/notes-masters.js +48 -45
- package/dist/core/dist/index.js +47 -15
- package/dist/core/dist/{author-ids.js → kernel/author-ids.js} +1 -1
- package/dist/core/dist/{author-schemas.js → kernel/author-schemas.js} +59 -98
- package/dist/core/dist/{block-flex-layout.js → kernel/block-flex-layout.js} +109 -78
- package/dist/core/dist/kernel/build.js +4 -0
- package/dist/core/dist/kernel/capability.js +17 -0
- package/dist/{codegen/dist/types.js → core/dist/kernel/codegen.js} +22 -2
- package/dist/core/dist/kernel/container-slots.js +104 -0
- package/dist/core/dist/kernel/date-time-format.js +18 -0
- package/dist/core/dist/kernel/declaration-snapshot.js +68 -0
- package/dist/core/dist/{declaration.js → kernel/declaration.js} +1 -1
- package/dist/core/dist/{diagnostics.js → kernel/diagnostics.js} +22 -5
- package/dist/core/dist/{document-internals.js → kernel/document-internals.js} +1 -1
- package/dist/core/dist/{document.js → kernel/document.js} +6 -5
- package/dist/core/dist/kernel/drawing-units.js +14 -0
- package/dist/core/dist/{font-seal.js → kernel/font-seal.js} +2 -2
- package/dist/core/dist/{geometry-schemas.js → kernel/geometry-schemas.js} +2 -6
- package/dist/core/dist/{grid-layout.js → kernel/grid-layout.js} +156 -55
- package/dist/core/dist/{host.js → kernel/host.js} +1 -1
- package/dist/core/dist/kernel/index.js +24 -0
- package/dist/core/dist/{input-values.js → kernel/input-values.js} +4 -3
- package/dist/core/dist/kernel/layout-definition.js +7 -0
- package/dist/core/dist/{layout-protocol.js → kernel/layout-protocol.js} +1 -1
- package/dist/core/dist/{layout-schemas.js → kernel/layout-schemas.js} +2 -6
- package/dist/core/dist/{layout.js → kernel/layout.js} +37 -38
- package/dist/core/dist/{masters.js → kernel/masters.js} +32 -55
- package/dist/core/dist/{morph.js → kernel/morph.js} +1 -1
- package/dist/core/dist/{placeholders.js → kernel/placeholders.js} +23 -9
- package/dist/{import/dist → core/dist/kernel/pptx-read}/alternate-content.js +1 -1
- package/dist/{import/dist → core/dist/kernel/pptx-read}/diagnostics.js +1 -1
- package/dist/core/dist/kernel/pptx-read/drawing-list-import.js +251 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/fonts.js +1 -1
- package/dist/core/dist/kernel/pptx-read/index.js +15 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/mechanism.js +1 -1
- package/dist/core/dist/kernel/pptx-read/media.js +26 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/namespaces.js +5 -7
- package/dist/{import/dist → core/dist/kernel/pptx-read}/opc.js +62 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/resources.js +1 -1
- package/dist/core/dist/kernel/pptx-read/shape-tree.js +57 -0
- package/dist/{import/dist → core/dist/kernel/pptx-read}/themes.js +40 -5
- package/dist/{import/dist → core/dist/kernel/pptx-read}/visual.js +94 -67
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-fragments.js +56 -13
- package/dist/{import/dist → core/dist/kernel/pptx-read}/xml-reader.js +8 -1
- package/dist/{emit/dist → core/dist/kernel/pptx-write}/shape-tree.js +1 -1
- package/dist/core/dist/kernel/pptx-write/timing.js +52 -0
- package/dist/{emit/dist/ooxml.js → core/dist/kernel/pptx-write/xml.js} +62 -274
- package/dist/core/dist/{query.js → kernel/query.js} +5 -1
- package/dist/core/dist/{resolution.js → kernel/resolution.js} +1 -1
- package/dist/core/dist/kernel/resolve-work.js +58 -0
- package/dist/core/dist/{resolve.js → kernel/resolve.js} +226 -257
- package/dist/core/dist/kernel/resource-source.js +11 -0
- package/dist/core/dist/{stage-options.js → kernel/stage-options.js} +23 -11
- package/dist/core/dist/{theme.js → kernel/theme.js} +54 -36
- package/dist/core/dist/{transform-geometry.js → kernel/transform-geometry.js} +1 -1
- package/dist/core/dist/kernel/xml-values.js +13 -0
- package/dist/{document-41spD7bq.d.ts → document-C0lPlH-L.d.ts} +614 -522
- package/dist/{capability-BbKW9w4O.d.ts → index-B9_OUeA-.d.ts} +660 -553
- package/dist/{index-BEwhk7c8.d.ts → index-BJEzQxWV.d.ts} +27 -24
- package/dist/{index-cK2KtukZ.d.ts → index-DA9flrlR.d.ts} +2 -17
- package/dist/{index-v77CTJev.d.ts → index-GSt0t9VO.d.ts} +3 -4
- package/dist/index.d.ts +7 -8
- package/dist/index.js +68 -66
- package/dist/node.d.ts +16 -14
- package/dist/node.js +86 -43
- package/dist/pptxdk/src/cli-commands.js +9 -5
- package/dist/pptxdk/src/compose.js +28 -29
- package/dist/pptxdk/src/preview-result.js +24 -0
- package/dist/{capabilities/dist/image → preview/dist}/gif-decoder.js +5 -5
- package/dist/preview/dist/index.js +84 -34
- package/dist/preview/dist/options.js +8 -4
- package/dist/preview/dist/raster.js +66 -0
- package/dist/preview/dist/svg-guard.js +8 -7
- package/dist/preview.d.ts +3 -9
- package/dist/preview.js +7 -25
- package/dist/react/dist/append.js +3 -3
- package/dist/react/dist/author/audio-elements.js +14 -0
- package/dist/{capabilities/dist/box → react/dist/author}/box-elements.js +5 -3
- package/dist/react/dist/author/chart-elements.js +14 -0
- package/dist/react/dist/author/comment-elements.js +15 -0
- package/dist/react/dist/author/group-elements.js +14 -0
- package/dist/react/dist/author/image-elements.js +14 -0
- package/dist/react/dist/author/line-elements.js +14 -0
- package/dist/{capabilities/dist/motion → react/dist/author}/motion-elements.js +6 -4
- package/dist/react/dist/author/notes-elements.js +14 -0
- package/dist/react/dist/author/placeholder-elements.js +14 -0
- package/dist/react/dist/author/shape-elements.js +14 -0
- package/dist/{capabilities/dist/table → react/dist/author}/table-elements.js +6 -4
- package/dist/{capabilities/dist/text → react/dist/author}/text-elements.js +15 -5
- package/dist/react/dist/author/video-elements.js +14 -0
- package/dist/react/dist/document-adapter.js +4 -4
- package/dist/react/dist/elements.js +7 -4
- package/dist/react/dist/from-vanilla.js +3 -3
- package/dist/react/dist/index.js +17 -3
- package/dist/react/dist/reconciler.js +3 -3
- package/dist/react.d.ts +103 -69
- package/dist/react.js +28 -28
- package/dist/{index-1ag7U9Jt.d.ts → stages-DYHSHKt4.d.ts} +23 -6
- package/dist/vanilla.d.ts +4 -4
- package/dist/vanilla.js +14 -15
- package/package.json +8 -7
- package/dist/build-zrZuX4fK.d.ts +0 -3
- package/dist/capabilities/dist/all.js +0 -34
- package/dist/capabilities/dist/chart/chart-elements.js +0 -12
- package/dist/capabilities/dist/chart/preview/data-labels.js +0 -334
- package/dist/capabilities/dist/document.js +0 -168
- package/dist/capabilities/dist/group/group-elements.js +0 -12
- package/dist/capabilities/dist/image/image-codegen.js +0 -164
- package/dist/capabilities/dist/image/image-declaration.js +0 -8
- package/dist/capabilities/dist/image/image-elements.js +0 -12
- package/dist/capabilities/dist/image/image-xml.js +0 -12
- package/dist/capabilities/dist/image/image.js +0 -552
- package/dist/capabilities/dist/line/line-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-elements.js +0 -12
- package/dist/capabilities/dist/notes/notes-xml.js +0 -38
- package/dist/capabilities/dist/placeholder/placeholder-elements.js +0 -13
- package/dist/capabilities/dist/shape/shape-codegen.js +0 -236
- package/dist/capabilities/dist/shape/shape-elements.js +0 -12
- package/dist/capabilities/dist/shape/shape-import.js +0 -628
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +0 -44
- package/dist/capabilities/dist/text/text-import.js +0 -1224
- package/dist/core/dist/build.js +0 -4
- package/dist/core/dist/capability.js +0 -15
- package/dist/emit/dist/index.js +0 -5
- package/dist/import/dist/index.js +0 -16
- package/dist/pptxdk/src/slide.js +0 -9
- package/dist/transition-6n8GZxSg.d.ts +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../
|
|
1
|
+
// ../core/dist/capabilities/chart/chart-labels.js
|
|
2
2
|
function invertRecord(record) {
|
|
3
3
|
return Object.fromEntries(Object.entries(record).map(([key, value]) => [value, key]));
|
|
4
4
|
}
|
|
@@ -78,9 +78,36 @@ function mergeDataLabels(base, override) {
|
|
|
78
78
|
if (override === void 0) return base;
|
|
79
79
|
if (override === false) return false;
|
|
80
80
|
if (base === false || base === void 0) return override;
|
|
81
|
+
const { style } = override;
|
|
81
82
|
return {
|
|
82
83
|
...base,
|
|
83
|
-
...override
|
|
84
|
+
...override,
|
|
85
|
+
...style === void 0 ? { style: base.style } : { style: {
|
|
86
|
+
...base.style,
|
|
87
|
+
...style
|
|
88
|
+
} }
|
|
84
89
|
};
|
|
85
90
|
}
|
|
86
|
-
|
|
91
|
+
/** Display order of automatic fields in a chart data label. */
|
|
92
|
+
const chartDataLabelFieldOrder = [
|
|
93
|
+
"seriesName",
|
|
94
|
+
"category",
|
|
95
|
+
"xValue",
|
|
96
|
+
"value",
|
|
97
|
+
"percent"
|
|
98
|
+
];
|
|
99
|
+
/** Tests the automatic fields that this chart kind can display. */
|
|
100
|
+
function hasAutomaticDataLabels(kind, labels) {
|
|
101
|
+
return labels.value === true || labels.seriesName === true || (kind === "scatter" ? labels.xValue === true : labels.category === true) || (kind === "pie" || kind === "doughnut") && labels.percent === true;
|
|
102
|
+
}
|
|
103
|
+
function hasVisibleDataLabels(kind, labels) {
|
|
104
|
+
return !!labels && (!!labels.text || hasAutomaticDataLabels(kind, labels));
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A series can retain leader lines when all its current points hide their labels.
|
|
108
|
+
* Pass the merged group/series settings and the index-validated points of that series.
|
|
109
|
+
*/
|
|
110
|
+
function hasVisibleSeriesDataLabels(kind, labels, points) {
|
|
111
|
+
return !!labels && hasAutomaticDataLabels(kind, labels) || Object.values(points ?? {}).some((point) => hasVisibleDataLabels(kind, mergeDataLabels(labels, point.dataLabels)));
|
|
112
|
+
}
|
|
113
|
+
export { chartAxisPositionCodes, chartAxisPositionFromNative, chartDataLabelFieldOrder, chartDataLabelPositionFromNative, chartDataLabelPositions, chartErrorBarValueTypeFromNative, chartErrorBarValueTypes, chartLegendPositionFromNative, chartLegendPositions, chartLineDashFromNative, chartLineDashValues, chartTrendlineTypeFromNative, chartTrendlineTypeValues, hasAutomaticDataLabels, hasVisibleDataLabels, hasVisibleSeriesDataLabels, mergeDataLabels };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { chartTextStyleKeys as chartTextStyleKeys$1 } from "./chart-schemas.js";
|
|
2
|
-
// ../
|
|
2
|
+
// ../core/dist/capabilities/chart/chart-model.js
|
|
3
3
|
const chartTextStyleKeys = [...chartTextStyleKeys$1];
|
|
4
4
|
function textOnlyChartStyle(value) {
|
|
5
5
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { CapabilityError } from "
|
|
2
|
-
import { authorIdSchema } from "
|
|
3
|
-
import { layoutStyleShape } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { linkTargetSchema } from "
|
|
7
|
-
import "../../../core/dist/capability.js";
|
|
8
|
-
import { pxToEmu, xmlEscape } from "../../../emit/dist/ooxml.js";
|
|
9
|
-
import "../../../emit/dist/index.js";
|
|
10
|
-
import { motionPropsShape } from "../motion/motion-schemas.js";
|
|
1
|
+
import { CapabilityError, zodIssueField } from "../../kernel/diagnostics.js";
|
|
2
|
+
import { authorIdSchema } from "../../kernel/author-ids.js";
|
|
3
|
+
import { layoutStyleShape } from "../../kernel/layout-schemas.js";
|
|
4
|
+
import { pxToEmu } from "../../kernel/drawing-units.js";
|
|
5
|
+
import { colorMapSchema, colorValueSchema, textStyleShape, themeOverrideSchema } from "../../kernel/theme.js";
|
|
6
|
+
import { linkTargetSchema } from "../../kernel/author-schemas.js";
|
|
11
7
|
import { morphKeySchema } from "../shared/morph-api.js";
|
|
8
|
+
import { motionPropsShape } from "../shared/motion-schemas.js";
|
|
9
|
+
import "../../kernel/capability.js";
|
|
10
|
+
import { xmlEscape } from "../../kernel/pptx-write/xml.js";
|
|
12
11
|
import { chartDataLabelPositions } from "./chart-labels.js";
|
|
13
12
|
import { z } from "zod";
|
|
14
|
-
// ../
|
|
13
|
+
// ../core/dist/capabilities/chart/chart-schemas.js
|
|
15
14
|
const maximumLineWidthEmu = 20116800;
|
|
16
15
|
const maximumShapeExtentEmu = 2147483647;
|
|
17
16
|
const maximumExplosionForCurrentValidationProfile = 2147483647;
|
|
@@ -26,15 +25,12 @@ function isValidXml10String(value) {
|
|
|
26
25
|
return false;
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
|
-
function addChartIssue(ctx, errorCode, message, path = []
|
|
28
|
+
function addChartIssue(ctx, errorCode, message, path = []) {
|
|
30
29
|
ctx.addIssue({
|
|
31
30
|
code: "custom",
|
|
32
31
|
message,
|
|
33
32
|
path: [...path],
|
|
34
|
-
params: {
|
|
35
|
-
errorCode,
|
|
36
|
-
...fieldPath === void 0 ? {} : { fieldPath }
|
|
37
|
-
}
|
|
33
|
+
params: { errorCode }
|
|
38
34
|
});
|
|
39
35
|
}
|
|
40
36
|
function nonEmptyStringSchema(errorCode, message) {
|
|
@@ -74,6 +70,7 @@ const chartKindSchema = z.enum([
|
|
|
74
70
|
const rawChartTextStyleObjectSchema = z.strictObject(textStyleShape).omit({ textWrap: true });
|
|
75
71
|
const rawChartTextStyleSchema = rawChartTextStyleObjectSchema.readonly();
|
|
76
72
|
const chartTextStyleKeys = Object.keys(rawChartTextStyleObjectSchema.shape);
|
|
73
|
+
const chartTextStyleSchema = rawChartTextStyleSchema;
|
|
77
74
|
const rawChartStyleObjectSchema = z.strictObject({
|
|
78
75
|
...rawChartTextStyleObjectSchema.shape,
|
|
79
76
|
...layoutStyleShape
|
|
@@ -138,6 +135,9 @@ const rawChartDataLabelPositionSchema = z.enum([
|
|
|
138
135
|
const separatorStringSchema = z.string().min(1).superRefine((value, ctx) => {
|
|
139
136
|
if (!isValidXml10String(value)) addChartIssue(ctx, "invalid-xml-character", "separator contains characters not allowed in XML 1.0");
|
|
140
137
|
});
|
|
138
|
+
const pointLabelTextSchema = xmlStringSchema("text").superRefine((value, ctx) => {
|
|
139
|
+
if (value.length === 0) addChartIssue(ctx, "invalid-data-labels", "text must be a non-empty string");
|
|
140
|
+
}).optional();
|
|
141
141
|
const dataLabelCommonFields = {
|
|
142
142
|
value: z.boolean().optional(),
|
|
143
143
|
percent: z.boolean().optional(),
|
|
@@ -155,15 +155,11 @@ const chartDataLabelsObjectSchema = z.strictObject({
|
|
|
155
155
|
});
|
|
156
156
|
const rawChartDataLabelsBaseSchema = chartDataLabelsObjectSchema.readonly();
|
|
157
157
|
const rawChartDataLabelOverrideSchema = chartDataLabelsObjectSchema.omit({
|
|
158
|
-
style: true,
|
|
159
158
|
leaderLines: true,
|
|
160
159
|
xValue: true
|
|
161
|
-
}).readonly();
|
|
162
|
-
chartDataLabelsObjectSchema.omit({
|
|
163
|
-
|
|
164
|
-
xValue: true
|
|
165
|
-
}).readonly();
|
|
166
|
-
chartDataLabelsObjectSchema.readonly();
|
|
160
|
+
}).extend({ text: pointLabelTextSchema }).readonly();
|
|
161
|
+
chartDataLabelsObjectSchema.omit({ xValue: true }).readonly();
|
|
162
|
+
chartDataLabelsObjectSchema.extend({ text: pointLabelTextSchema }).readonly();
|
|
167
163
|
const scatterDataLabelsObjectSchema = z.strictObject({
|
|
168
164
|
...dataLabelCommonFields,
|
|
169
165
|
position: z.enum([
|
|
@@ -174,17 +170,16 @@ const scatterDataLabelsObjectSchema = z.strictObject({
|
|
|
174
170
|
"center"
|
|
175
171
|
]).optional()
|
|
176
172
|
});
|
|
177
|
-
scatterDataLabelsObjectSchema.omit({
|
|
173
|
+
const rawScatterDataLabelsBaseSchema = scatterDataLabelsObjectSchema.omit({
|
|
178
174
|
percent: true,
|
|
179
175
|
category: true,
|
|
180
176
|
leaderLines: true
|
|
181
177
|
}).readonly();
|
|
182
178
|
const rawScatterDataLabelOverrideSchema = scatterDataLabelsObjectSchema.omit({
|
|
183
|
-
style: true,
|
|
184
179
|
percent: true,
|
|
185
180
|
category: true,
|
|
186
181
|
leaderLines: true
|
|
187
|
-
}).readonly();
|
|
182
|
+
}).extend({ text: pointLabelTextSchema }).readonly();
|
|
188
183
|
const chartPointSchema = z.strictObject({
|
|
189
184
|
color: colorValueSchema.optional(),
|
|
190
185
|
line: rawChartLineSchema.optional(),
|
|
@@ -196,14 +191,12 @@ const chartPointSchema = z.strictObject({
|
|
|
196
191
|
errorCode: "invalid-chart-option",
|
|
197
192
|
label: "explosion"
|
|
198
193
|
}).optional(),
|
|
199
|
-
labelColor: colorValueSchema.optional(),
|
|
200
194
|
dataLabels: z.union([z.literal(false), rawChartDataLabelOverrideSchema]).optional()
|
|
201
195
|
}).readonly();
|
|
202
196
|
const rawScatterChartPointSchema = z.strictObject({
|
|
203
197
|
color: colorValueSchema.optional(),
|
|
204
198
|
line: rawChartLineSchema.optional(),
|
|
205
199
|
marker: rawChartMarkerOptionSchema.optional(),
|
|
206
|
-
labelColor: colorValueSchema.optional(),
|
|
207
200
|
dataLabels: z.union([z.literal(false), rawScatterDataLabelOverrideSchema]).optional()
|
|
208
201
|
}).readonly();
|
|
209
202
|
z.enum([
|
|
@@ -284,7 +277,7 @@ const errorBarStyleFields = {
|
|
|
284
277
|
endCap: z.boolean().optional(),
|
|
285
278
|
line: rawChartLineSchema.optional()
|
|
286
279
|
};
|
|
287
|
-
const rawChartCustomErrorBarsSchema = z.
|
|
280
|
+
const rawChartCustomErrorBarsSchema = z.discriminatedUnion("include", [
|
|
288
281
|
z.strictObject({
|
|
289
282
|
...errorBarStyleFields,
|
|
290
283
|
type: z.literal("custom"),
|
|
@@ -310,7 +303,7 @@ const rawChartCustomErrorBarsSchema = z.union([
|
|
|
310
303
|
value: z.never().optional()
|
|
311
304
|
}).readonly()
|
|
312
305
|
]);
|
|
313
|
-
const rawChartErrorBarsSchema = z.
|
|
306
|
+
const rawChartErrorBarsSchema = z.discriminatedUnion("type", [
|
|
314
307
|
z.strictObject({
|
|
315
308
|
...errorBarStyleFields,
|
|
316
309
|
include: rawChartErrorBarIncludeSchema.optional(),
|
|
@@ -374,7 +367,7 @@ const scatterChartSeriesSchema = z.strictObject({
|
|
|
374
367
|
y: rawChartSeriesValuesSchema,
|
|
375
368
|
color: colorValueSchema.optional(),
|
|
376
369
|
line: rawChartLineSchema.optional(),
|
|
377
|
-
dataLabels: z.union([z.literal(false),
|
|
370
|
+
dataLabels: z.union([z.literal(false), rawScatterDataLabelsBaseSchema]).optional(),
|
|
378
371
|
marker: rawChartMarkerOptionSchema.optional(),
|
|
379
372
|
points: z.record(z.string(), rawScatterChartPointSchema).readonly().optional(),
|
|
380
373
|
trendlines: z.array(rawChartTrendlineSchema).readonly().optional(),
|
|
@@ -490,9 +483,8 @@ function validatePointIndexKeys(points, pointCount, seriesName, ctx, pathPrefix)
|
|
|
490
483
|
]);
|
|
491
484
|
}
|
|
492
485
|
}
|
|
493
|
-
function validateDataLabelSettingsForKind(labels, kind, stacking, ctx, path,
|
|
486
|
+
function validateDataLabelSettingsForKind(labels, kind, stacking, ctx, path, allowLeaderLines) {
|
|
494
487
|
if (labels === void 0 || labels === false) return;
|
|
495
|
-
if (!allowStyle && labels.style !== void 0) addChartIssue(ctx, "unknown-parameter", "dataLabels contains unimplemented parameter style", [...path, "style"]);
|
|
496
488
|
if (!allowLeaderLines && labels.leaderLines !== void 0) addChartIssue(ctx, "unknown-parameter", "dataLabels contains unimplemented parameter leaderLines", [...path, "leaderLines"]);
|
|
497
489
|
if (labels.xValue !== void 0 && kind !== "scatter") addChartIssue(ctx, "invalid-data-labels", "xValue is only supported for scatter charts", [...path, "xValue"]);
|
|
498
490
|
if (labels.percent === true && kind !== "pie" && kind !== "doughnut") addChartIssue(ctx, "invalid-data-labels", "percent is only supported for pie and doughnut charts", [...path, "percent"]);
|
|
@@ -567,7 +559,7 @@ function validateTrendlinesForGroup(trendlines, kind, stacking, pointCount, fitP
|
|
|
567
559
|
}
|
|
568
560
|
function validateCategoryGroupSeries(group, ctx) {
|
|
569
561
|
const { kind, data, series, stacking } = group;
|
|
570
|
-
validateDataLabelSettingsForKind(group.dataLabels, kind, stacking, ctx, ["dataLabels"], true
|
|
562
|
+
validateDataLabelSettingsForKind(group.dataLabels, kind, stacking, ctx, ["dataLabels"], true);
|
|
571
563
|
if (kind === "pie" && series.length !== 1) addChartIssue(ctx, "invalid-data", "pie chart currently only supports a single data series", ["series"]);
|
|
572
564
|
for (const [seriesIndex, item] of series.entries()) {
|
|
573
565
|
const seriesPath = ["series", seriesIndex];
|
|
@@ -596,7 +588,7 @@ function validateCategoryGroupSeries(group, ctx) {
|
|
|
596
588
|
}
|
|
597
589
|
}
|
|
598
590
|
if (item.smooth !== void 0 && kind !== "line") addChartIssue(ctx, "invalid-smooth", `Series "${item.name}".smooth is only applicable to line chart series`, [...seriesPath, "smooth"]);
|
|
599
|
-
validateDataLabelSettingsForKind(item.dataLabels, kind, stacking, ctx, [...seriesPath, "dataLabels"],
|
|
591
|
+
validateDataLabelSettingsForKind(item.dataLabels, kind, stacking, ctx, [...seriesPath, "dataLabels"], true);
|
|
600
592
|
validatePointIndexKeys(item.points, categories.length, item.name, ctx, seriesPath);
|
|
601
593
|
if (item.points !== void 0) for (const [rawIndex, point] of Object.entries(item.points)) {
|
|
602
594
|
if (kind === "area" && point.color !== void 0) addChartIssue(ctx, "invalid-data", "Area chart data points do not support individual fill colors; set the series color instead.", [
|
|
@@ -604,7 +596,7 @@ function validateCategoryGroupSeries(group, ctx) {
|
|
|
604
596
|
"points",
|
|
605
597
|
rawIndex,
|
|
606
598
|
"color"
|
|
607
|
-
]
|
|
599
|
+
]);
|
|
608
600
|
if (point.marker !== void 0) {
|
|
609
601
|
if (kind !== "line") addChartIssue(ctx, "invalid-marker", `Series "${item.name}" data point ${rawIndex}.marker is only applicable to line and scatter chart series and points`, [
|
|
610
602
|
...seriesPath,
|
|
@@ -637,7 +629,7 @@ function validateCategoryGroupSeries(group, ctx) {
|
|
|
637
629
|
"points",
|
|
638
630
|
rawIndex,
|
|
639
631
|
"dataLabels"
|
|
640
|
-
], false
|
|
632
|
+
], false);
|
|
641
633
|
}
|
|
642
634
|
validateErrorBarsForKind(item.errorBars, kind, categories.length, ctx, [...seriesPath, "errorBars"]);
|
|
643
635
|
validateTrendlinesForGroup(item.trendlines, kind, stacking, categories.length, item.values.flatMap((value, pointIndex) => value === null ? [] : [{
|
|
@@ -753,13 +745,13 @@ const rawScatterChartGroupSchema = z.strictObject({
|
|
|
753
745
|
const markers = group.markers ?? true;
|
|
754
746
|
const showLine = line !== void 0 && line !== false;
|
|
755
747
|
if (!showLine && !markers) addChartIssue(ctx, "invalid-scatter-presentation", "scatter group must draw markers or a connecting line");
|
|
756
|
-
validateDataLabelSettingsForKind(group.dataLabels, "scatter", void 0, ctx, ["dataLabels"],
|
|
748
|
+
validateDataLabelSettingsForKind(group.dataLabels, "scatter", void 0, ctx, ["dataLabels"], false);
|
|
757
749
|
for (const [seriesIndex, item] of group.series.entries()) {
|
|
758
750
|
const seriesPath = ["series", seriesIndex];
|
|
759
751
|
if (item.x.length !== item.y.length) addChartIssue(ctx, "invalid-data", `Series "${item.name}" has ${item.x.length} X and ${item.y.length} Y observations`, [...seriesPath]);
|
|
760
752
|
if (!showLine && item.line !== void 0) addChartIssue(ctx, "invalid-line", `Series "${item.name}".line requires a connecting line on its scatter group`, [...seriesPath, "line"]);
|
|
761
753
|
if (!markers && item.marker !== void 0 && item.marker !== false) addChartIssue(ctx, "invalid-marker", `Series "${item.name}".marker requires the scatter group to enable markers`, [...seriesPath, "marker"]);
|
|
762
|
-
validateDataLabelSettingsForKind(item.dataLabels, "scatter", void 0, ctx, [...seriesPath, "dataLabels"], false
|
|
754
|
+
validateDataLabelSettingsForKind(item.dataLabels, "scatter", void 0, ctx, [...seriesPath, "dataLabels"], false);
|
|
763
755
|
validatePointIndexKeys(item.points, item.x.length, item.name, ctx, seriesPath);
|
|
764
756
|
if (item.points !== void 0) for (const [rawIndex, point] of Object.entries(item.points)) {
|
|
765
757
|
if (!markers && point.marker !== void 0 && point.marker !== false) addChartIssue(ctx, "invalid-marker", `Series "${item.name}" data point ${rawIndex}.marker requires the scatter group to enable markers`, [
|
|
@@ -773,7 +765,7 @@ const rawScatterChartGroupSchema = z.strictObject({
|
|
|
773
765
|
"points",
|
|
774
766
|
rawIndex,
|
|
775
767
|
"dataLabels"
|
|
776
|
-
], false
|
|
768
|
+
], false);
|
|
777
769
|
}
|
|
778
770
|
if (item.errorBars !== void 0) {
|
|
779
771
|
validateErrorBarsForKind(item.errorBars.x, "scatter", item.x.length, ctx, [
|
|
@@ -829,14 +821,16 @@ const chartPropsObjectSchema = z.strictObject({
|
|
|
829
821
|
id: authorIdSchema.optional(),
|
|
830
822
|
name: xmlStringSchema("Chart.name").optional(),
|
|
831
823
|
placeholder: z.string().optional(),
|
|
832
|
-
nativePlaceholder: nativePlaceholderRefSchema.optional(),
|
|
833
824
|
morphKey: morphKeySchema.optional(),
|
|
834
825
|
link: linkTargetSchema.optional(),
|
|
835
826
|
axes: chartAxesSchema.optional(),
|
|
836
827
|
groups: z.array(chartGroupSchema).min(1).readonly(),
|
|
828
|
+
colorMapOverride: colorMapSchema.optional(),
|
|
829
|
+
themeOverride: themeOverrideSchema.optional(),
|
|
837
830
|
title: rawChartTitleSchema.optional(),
|
|
838
831
|
displayBlanksAs: rawChartDisplayBlanksAsSchema.optional(),
|
|
839
832
|
legend: rawChartLegendSchema.optional(),
|
|
833
|
+
legendStyle: rawChartTextStyleSchema.optional(),
|
|
840
834
|
plotArea: rawChartPlotAreaSchema.optional(),
|
|
841
835
|
style: rawChartStyleSchema.optional(),
|
|
842
836
|
...motionPropsShape
|
|
@@ -844,16 +838,11 @@ const chartPropsObjectSchema = z.strictObject({
|
|
|
844
838
|
chartPropsObjectSchema.readonly();
|
|
845
839
|
const chartAllowedPropKeys = Object.keys(chartPropsObjectSchema.shape);
|
|
846
840
|
/** Maps a Zod validation issue inside chart authoring data to a stable `CapabilityError` code. */
|
|
847
|
-
function resolveChartZodError(issue, fallbackCode
|
|
848
|
-
if (issue.code === "custom" && "params" in issue && isPlainRecord(issue.params) && typeof issue.params["errorCode"] === "string") {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
code: issue.params["errorCode"],
|
|
853
|
-
message: issue.message,
|
|
854
|
-
...fieldPath === void 0 ? {} : { fieldPath }
|
|
855
|
-
};
|
|
856
|
-
}
|
|
841
|
+
function resolveChartZodError(issue, fallbackCode) {
|
|
842
|
+
if (issue.code === "custom" && "params" in issue && isPlainRecord(issue.params) && typeof issue.params["errorCode"] === "string") return {
|
|
843
|
+
code: issue.params["errorCode"],
|
|
844
|
+
message: issue.message
|
|
845
|
+
};
|
|
857
846
|
const path = issue.path;
|
|
858
847
|
if (issue.code === "unrecognized_keys") return {
|
|
859
848
|
code: "unknown-parameter",
|
|
@@ -864,7 +853,7 @@ function resolveChartZodError(issue, fallbackCode, groupLabel) {
|
|
|
864
853
|
code: "invalid-font-size",
|
|
865
854
|
message: `${pathStr}: ${issue.message}`
|
|
866
855
|
};
|
|
867
|
-
if (pathStr.endsWith(".color") || pathStr.endsWith(".fill")
|
|
856
|
+
if (pathStr.endsWith(".color") || pathStr.endsWith(".fill")) return {
|
|
868
857
|
code: "invalid-color",
|
|
869
858
|
message: `${pathStr}: ${issue.message}`
|
|
870
859
|
};
|
|
@@ -951,14 +940,19 @@ function resolveChartZodError(issue, fallbackCode, groupLabel) {
|
|
|
951
940
|
}
|
|
952
941
|
function throwChartZodError(error, fallbackCode, label) {
|
|
953
942
|
const issue = error.issues[0];
|
|
954
|
-
if (issue === void 0) throw new CapabilityError(fallbackCode, `${label} is invalid
|
|
955
|
-
const resolved = resolveChartZodError(issue, fallbackCode
|
|
956
|
-
|
|
943
|
+
if (issue === void 0) throw new CapabilityError(fallbackCode, `${label} is invalid`, void 0, { field: label });
|
|
944
|
+
const resolved = resolveChartZodError(issue, fallbackCode);
|
|
945
|
+
const prop = issue.code === "unrecognized_keys" ? issue.keys[0] : void 0;
|
|
946
|
+
const field = zodIssueField(issue, label);
|
|
947
|
+
throw new CapabilityError(resolved.code, resolved.message, void 0, {
|
|
948
|
+
field,
|
|
949
|
+
prop
|
|
950
|
+
});
|
|
957
951
|
}
|
|
958
952
|
/** Validates and parses a chart axis entry using the local `ChartAxis` Zod schemas. */
|
|
959
953
|
function parseChartAxisBySchema(value, label, expected) {
|
|
960
|
-
if (!isPlainRecord(value)) throw new CapabilityError("invalid-axis", `${label} must be an object
|
|
961
|
-
if (value["kind"] !== expected) throw new CapabilityError("invalid-chart-axis-role", `${label} must declare kind "${expected}" as referenced by its chart group`);
|
|
954
|
+
if (!isPlainRecord(value)) throw new CapabilityError("invalid-axis", `${label} must be an object`, void 0, { field: label });
|
|
955
|
+
if (value["kind"] !== expected) throw new CapabilityError("invalid-chart-axis-role", `${label} must declare kind "${expected}" as referenced by its chart group`, void 0, { field: `${label}.kind` });
|
|
962
956
|
const parsed = (expected === "category" ? chartCategoryAxisSchema : chartValueAxisSchema).safeParse(value);
|
|
963
957
|
if (!parsed.success) {
|
|
964
958
|
const first = parsed.error.issues[0];
|
|
@@ -969,20 +963,20 @@ function parseChartAxisBySchema(value, label, expected) {
|
|
|
969
963
|
"minorUnit",
|
|
970
964
|
"numberFormat",
|
|
971
965
|
"logBase"
|
|
972
|
-
].includes(k))) throw new CapabilityError("invalid-axis", `${label}.${first.keys[0]} is only applicable to value axis`);
|
|
966
|
+
].includes(k))) throw new CapabilityError("invalid-axis", `${label}.${first.keys[0]} is only applicable to value axis`, void 0, { field: `${label}.${first.keys[0]}` });
|
|
973
967
|
throwChartZodError(parsed.error, "invalid-axis", label);
|
|
974
968
|
}
|
|
975
969
|
return parsed.data;
|
|
976
970
|
}
|
|
977
|
-
const
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
971
|
+
const commonGroupShape = ColumnOrBarStackedGroupSchema.unwrap().pick({
|
|
972
|
+
kind: true,
|
|
973
|
+
data: true,
|
|
974
|
+
series: true,
|
|
975
|
+
axes: true,
|
|
976
|
+
dataLabels: true
|
|
977
|
+
}).shape;
|
|
984
978
|
function groupOptionKeysFromShape(shape) {
|
|
985
|
-
return Object.keys(shape).filter((key) => !
|
|
979
|
+
return Object.keys(shape).filter((key) => !Object.hasOwn(commonGroupShape, key));
|
|
986
980
|
}
|
|
987
981
|
const groupOptionsByKind = {
|
|
988
982
|
column: groupOptionKeysFromShape(ColumnOrBarStackedGroupSchema.unwrap().shape),
|
|
@@ -995,13 +989,13 @@ const groupOptionsByKind = {
|
|
|
995
989
|
};
|
|
996
990
|
/** Validates and parses one chart group entry via its kind-specific local Zod schema. */
|
|
997
991
|
function parseChartGroupBySchema(value, label) {
|
|
998
|
-
if (!isPlainRecord(value)) throw new CapabilityError("invalid-chart-groups", `${label} must be an object
|
|
992
|
+
if (!isPlainRecord(value)) throw new CapabilityError("invalid-chart-groups", `${label} must be an object`, void 0, { field: label });
|
|
999
993
|
const kindParsed = chartKindSchema.safeParse(value["kind"]);
|
|
1000
|
-
if (!kindParsed.success) throw new CapabilityError("unsupported-chart-kind", `Unsupported chart kind ${String(value["kind"])}`);
|
|
994
|
+
if (!kindParsed.success) throw new CapabilityError("unsupported-chart-kind", `Unsupported chart kind ${String(value["kind"])}`, void 0, { field: `${label}.kind` });
|
|
1001
995
|
const kind = kindParsed.data;
|
|
1002
996
|
for (const key of Object.keys(value)) if (key !== "kind" && key !== "data" && key !== "series" && key !== "axes" && key !== "dataLabels" && !groupOptionsByKind[kind].includes(key)) {
|
|
1003
997
|
const isKnownOtherGroupOption = Object.values(groupOptionsByKind).flat().includes(key);
|
|
1004
|
-
throw new CapabilityError(isKnownOtherGroupOption ? "invalid-chart-option" : "unknown-parameter", isKnownOtherGroupOption ? `${kind} chart group does not support ${key}` : `${label} contains unimplemented parameter ${key}`);
|
|
998
|
+
throw new CapabilityError(isKnownOtherGroupOption ? "invalid-chart-option" : "unknown-parameter", isKnownOtherGroupOption ? `${kind} chart group does not support ${key}` : `${label} contains unimplemented parameter ${key}`, void 0, { field: `${label}.${key}` });
|
|
1005
999
|
}
|
|
1006
1000
|
if (kind === "scatter") {
|
|
1007
1001
|
const parsed = scatterChartGroupSchema.safeParse(value);
|
|
@@ -1043,40 +1037,40 @@ function parseChartTitleBySchema(value, label) {
|
|
|
1043
1037
|
function parseChartPlotAreaBySchema(value, box) {
|
|
1044
1038
|
if (value === void 0) return void 0;
|
|
1045
1039
|
const parsed = chartPlotAreaSchema.safeParse(value);
|
|
1046
|
-
if (!parsed.success) throwChartZodError(parsed.error, "invalid-plot-area", "
|
|
1040
|
+
if (!parsed.success) throwChartZodError(parsed.error, "invalid-plot-area", "plotArea");
|
|
1047
1041
|
const result = parsed.data;
|
|
1048
|
-
if (box !== void 0 && (result.left + result.width > box.width || result.top + result.height > box.height)) throw new CapabilityError("invalid-plot-area", "Chart.plotArea must be inside chart box with positive width and height");
|
|
1042
|
+
if (box !== void 0 && (result.left + result.width > box.width || result.top + result.height > box.height)) throw new CapabilityError("invalid-plot-area", "Chart.plotArea must be inside chart box with positive width and height", void 0, { field: "plotArea" });
|
|
1049
1043
|
return result;
|
|
1050
1044
|
}
|
|
1051
1045
|
/** Validates and parses `Chart.legend` using `chartLegendSchema`. */
|
|
1052
1046
|
function parseChartLegendBySchema(value) {
|
|
1053
1047
|
if (value === void 0) return void 0;
|
|
1054
1048
|
const parsed = chartLegendSchema.safeParse(value);
|
|
1055
|
-
if (!parsed.success) throw new CapabilityError("invalid-legend", "Chart.legend must be false, top, bottom, left, right, or topRight");
|
|
1049
|
+
if (!parsed.success) throw new CapabilityError("invalid-legend", "Chart.legend must be false, top, bottom, left, right, or topRight", void 0, { field: "legend" });
|
|
1056
1050
|
return parsed.data;
|
|
1057
1051
|
}
|
|
1058
1052
|
/** Validates and parses a chart coordinate (`x` or `y`) via `chartCoordinateSchema`. */
|
|
1059
1053
|
function parseChartCoordinateBySchema(value, label) {
|
|
1060
1054
|
if (value === void 0) return 0;
|
|
1061
1055
|
const parsed = chartCoordinateSchema.safeParse(value);
|
|
1062
|
-
if (!parsed.success) throw new CapabilityError("invalid-coordinate", `${label} must be a finite pixel value between -1000000 and 1000000
|
|
1056
|
+
if (!parsed.success) throw new CapabilityError("invalid-coordinate", `${label} must be a finite pixel value between -1000000 and 1000000`, void 0, { field: label === "x" ? "style.left" : "style.top" });
|
|
1063
1057
|
return parsed.data;
|
|
1064
1058
|
}
|
|
1065
1059
|
/** Validates and parses a chart extent (`width` or `height`) via `chartExtentSchema`. */
|
|
1066
1060
|
function parseChartExtentBySchema(value, label) {
|
|
1067
1061
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1068
|
-
if (value === 0 || pxToEmu(value) === 0) throw new CapabilityError("invalid-coordinate", `Computed ${label} is 0px; ${label} must be greater than 0px`);
|
|
1069
|
-
if (value < 0 || pxToEmu(value) < 1) throw new CapabilityError("invalid-coordinate", `Computed ${label} is ${value}px; ${label} must be greater than 0px`);
|
|
1070
|
-
} else throw new CapabilityError("invalid-coordinate", `${label} must be a finite positive pixel value`);
|
|
1062
|
+
if (value === 0 || pxToEmu(value) === 0) throw new CapabilityError("invalid-coordinate", `Computed ${label} is 0px; ${label} must be greater than 0px`, void 0, { field: `style.${label}` });
|
|
1063
|
+
if (value < 0 || pxToEmu(value) < 1) throw new CapabilityError("invalid-coordinate", `Computed ${label} is ${value}px; ${label} must be greater than 0px`, void 0, { field: `style.${label}` });
|
|
1064
|
+
} else throw new CapabilityError("invalid-coordinate", `${label} must be a finite positive pixel value`, void 0, { field: `style.${label}` });
|
|
1071
1065
|
const parsed = chartExtentSchema.safeParse(value);
|
|
1072
|
-
if (!parsed.success) throwChartZodError(parsed.error, "invalid-coordinate", `
|
|
1066
|
+
if (!parsed.success) throwChartZodError(parsed.error, "invalid-coordinate", `style.${label}`);
|
|
1073
1067
|
return parsed.data;
|
|
1074
1068
|
}
|
|
1075
1069
|
/** Validates and parses `Chart.displayBlanksAs` via `chartDisplayBlanksAsSchema`. */
|
|
1076
1070
|
function parseChartDisplayBlanksAsBySchema(value) {
|
|
1077
1071
|
if (value === void 0) return void 0;
|
|
1078
1072
|
const parsed = chartDisplayBlanksAsSchema.safeParse(value);
|
|
1079
|
-
if (!parsed.success) throw new CapabilityError("invalid-chart-missing-values", "Chart.displayBlanksAs must be gap, zero, or span");
|
|
1073
|
+
if (!parsed.success) throw new CapabilityError("invalid-chart-missing-values", "Chart.displayBlanksAs must be gap, zero, or span", void 0, { field: "displayBlanksAs" });
|
|
1080
1074
|
return parsed.data;
|
|
1081
1075
|
}
|
|
1082
1076
|
/** Validates an XML 1.0 string via `xmlStringSchema`. */
|
|
@@ -1085,4 +1079,4 @@ function parseChartXmlTextBySchema(value, label) {
|
|
|
1085
1079
|
if (!parsed.success) throwChartZodError(parsed.error, "invalid-xml-character", label);
|
|
1086
1080
|
return parsed.data;
|
|
1087
1081
|
}
|
|
1088
|
-
export { areaChartGroupSchema, chartAllowedPropKeys, chartAxesSchema, chartCategoryAxisSchema, chartCoordinateSchema, chartDisplayBlanksAsSchema, chartExtentSchema, chartGroupSchema, chartKindSchema, chartLegendSchema, chartMarkerOptionSchema, chartPlotAreaSchema, chartPointSchema, chartPointValueSchema, chartSeriesSchema, chartStyleKeys, chartStyleSchema, chartTextStyleKeys, chartTitleSchema, chartValueAxisSchema, columnOrBarChartGroupSchema, doughnutChartGroupSchema, independentCategorySeriesSchema, lineChartGroupSchema, parseChartAxisBySchema, parseChartCoordinateBySchema, parseChartDisplayBlanksAsBySchema, parseChartExtentBySchema, parseChartGroupBySchema, parseChartLegendBySchema, parseChartPlotAreaBySchema, parseChartTitleBySchema, parseChartXmlTextBySchema, pieChartGroupSchema, resolveChartZodError, scatterChartGroupSchema, scatterChartSeriesSchema };
|
|
1082
|
+
export { areaChartGroupSchema, chartAllowedPropKeys, chartAxesSchema, chartCategoryAxisSchema, chartCoordinateSchema, chartDisplayBlanksAsSchema, chartExtentSchema, chartGroupSchema, chartKindSchema, chartLegendSchema, chartMarkerOptionSchema, chartPlotAreaSchema, chartPointSchema, chartPointValueSchema, chartSeriesSchema, chartStyleKeys, chartStyleSchema, chartTextStyleKeys, chartTextStyleSchema, chartTitleSchema, chartValueAxisSchema, columnOrBarChartGroupSchema, doughnutChartGroupSchema, independentCategorySeriesSchema, lineChartGroupSchema, parseChartAxisBySchema, parseChartCoordinateBySchema, parseChartDisplayBlanksAsBySchema, parseChartExtentBySchema, parseChartGroupBySchema, parseChartLegendBySchema, parseChartPlotAreaBySchema, parseChartTitleBySchema, parseChartXmlTextBySchema, pieChartGroupSchema, resolveChartZodError, scatterChartGroupSchema, scatterChartSeriesSchema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { chartAxisPositionCodes, chartDataLabelPositions, chartErrorBarValueTypes, chartLegendPositions, chartLineDashValues, chartTrendlineTypeValues, mergeDataLabels } from "./chart-labels.js";
|
|
1
|
+
import { pxToEmu } from "../../kernel/drawing-units.js";
|
|
2
|
+
import { placeholderRefXml, resolvedColorXml, xmlEscape } from "../../kernel/pptx-write/xml.js";
|
|
3
|
+
import { chartAxisPositionCodes, chartDataLabelPositions, chartErrorBarValueTypes, chartLegendPositions, chartLineDashValues, chartTrendlineTypeValues, hasAutomaticDataLabels, hasVisibleSeriesDataLabels, mergeDataLabels } from "./chart-labels.js";
|
|
4
4
|
import { strToU8, zipSync } from "fflate";
|
|
5
|
-
// ../
|
|
5
|
+
// ../core/dist/capabilities/chart/chart-xml.js
|
|
6
6
|
const chartNamespace = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
7
7
|
const drawingNamespace = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
8
8
|
const relationshipNamespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
@@ -309,48 +309,51 @@ function categoryLabelsEnabled(labels) {
|
|
|
309
309
|
function dataLabels(group, series, groupIndex, textStyles, theme, categoryRange) {
|
|
310
310
|
const seriesLabels = mergeDataLabels(group.dataLabels, series.dataLabels);
|
|
311
311
|
const hasPosition = group.kind === "column" || group.kind === "bar" || group.kind === "line" || group.kind === "pie" || group.kind === "scatter";
|
|
312
|
-
const hasVisibleContent = (labels) => labels.value === true || labels.percent === true || labels.category === true || labels.xValue === true || labels.seriesName === true;
|
|
313
312
|
const leaderLineSettings = (labels) => {
|
|
314
313
|
if (labels.leaderLines === void 0) return [];
|
|
315
|
-
const visible =
|
|
314
|
+
const visible = hasVisibleSeriesDataLabels(group.kind, labels, series.points);
|
|
316
315
|
if (labels.leaderLines === false) return visible ? [el("c:showLeaderLines", { val: false })] : [];
|
|
317
316
|
if (!visible) return [];
|
|
318
317
|
return [el("c:showLeaderLines", { val: true }), el("c:leaderLines", null, typeof labels.leaderLines === "object" ? el("c:spPr", null, chartLine(labels.leaderLines, theme)) : void 0)];
|
|
319
318
|
};
|
|
320
|
-
const settings = (labels, textStyle, includeLeaderLines, categoryField) =>
|
|
321
|
-
labels.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
319
|
+
const settings = (labels, textStyle, includeLeaderLines, categoryField, local) => {
|
|
320
|
+
const inherits = (field) => local !== void 0 && labels.text === void 0 && local[field] === void 0 && labels[field] === true;
|
|
321
|
+
const horizontal = group.kind === "scatter" ? "xValue" : "category";
|
|
322
|
+
return [
|
|
323
|
+
labels.numberFormat === void 0 ? void 0 : el("c:numFmt", {
|
|
324
|
+
formatCode: labels.numberFormat,
|
|
325
|
+
sourceLinked: false
|
|
326
|
+
}),
|
|
327
|
+
transparent(),
|
|
328
|
+
raw(textStyle),
|
|
329
|
+
labels.position === void 0 || !hasPosition ? void 0 : el("c:dLblPos", { val: chartDataLabelPositions[labels.position] }),
|
|
330
|
+
el("c:showLegendKey", { val: false }),
|
|
331
|
+
inherits("value") ? void 0 : el("c:showVal", { val: labels.value === true || labels.text !== void 0 && !hasAutomaticDataLabels(group.kind, labels) }),
|
|
332
|
+
inherits(horizontal) ? void 0 : el("c:showCatName", { val: categoryRange === void 0 ? (group.kind === "scatter" ? labels.xValue : labels.category) ?? false : false }),
|
|
333
|
+
inherits("seriesName") ? void 0 : el("c:showSerName", { val: labels.seriesName ?? false }),
|
|
334
|
+
inherits("percent") ? void 0 : el("c:showPercent", { val: group.kind === "pie" || group.kind === "doughnut" ? labels.percent ?? false : false }),
|
|
335
|
+
el("c:showBubbleSize", { val: false }),
|
|
336
|
+
labels.separator === void 0 ? void 0 : el("c:separator", null, labels.separator),
|
|
337
|
+
includeLeaderLines ? leaderLineSettings(labels) : void 0,
|
|
338
|
+
categoryField && !inherits("category") ? categoryLabelFieldExtension(categoryLabelsEnabled(labels)) : void 0
|
|
339
|
+
];
|
|
340
|
+
};
|
|
341
|
+
const seriesStyle = textStyles.seriesDataLabels?.get(series.seriesIndex) ?? textStyles.groupDataLabels?.get(groupIndex);
|
|
339
342
|
const pointBase = seriesLabels === false ? {} : seriesLabels;
|
|
340
343
|
const pointLabels = Object.entries(series.points ?? {}).flatMap(([pointIndex, point]) => {
|
|
341
|
-
if (point.dataLabels === void 0
|
|
344
|
+
if (point.dataLabels === void 0) return [];
|
|
342
345
|
const index = Number(pointIndex);
|
|
343
346
|
const effective = mergeDataLabels(pointBase, point.dataLabels);
|
|
344
347
|
if (effective === false) return [el("c:dLbl", null, el("c:idx", { val: index }), el("c:delete", { val: true }))];
|
|
345
348
|
if (effective === void 0) return [];
|
|
346
|
-
|
|
347
|
-
const style =
|
|
348
|
-
return [el("c:dLbl", null, el("c:idx", { val: index }), settings(effective, style, false, categoryRange !== void 0))];
|
|
349
|
+
const pointText = textStyles.pointLabels?.get(`${series.seriesIndex}:${pointIndex}`);
|
|
350
|
+
const style = pointText?.properties ?? seriesStyle;
|
|
351
|
+
return [el("c:dLbl", null, el("c:idx", { val: index }), raw(pointText?.customText), settings(effective, style, false, categoryRange !== void 0, point.dataLabels || void 0))];
|
|
349
352
|
});
|
|
350
353
|
const base = seriesLabels === false ? pointLabels.length > 0 ? {} : false : seriesLabels ?? (pointLabels.length > 0 ? {} : void 0);
|
|
351
354
|
if (base === void 0) return void 0;
|
|
352
355
|
if (base === false) return el("c:dLbls", null, el("c:delete", { val: true }));
|
|
353
|
-
return el("c:dLbls", null, pointLabels, settings(base,
|
|
356
|
+
return el("c:dLbls", null, pointLabels, settings(base, seriesStyle, true, categoryRange !== void 0));
|
|
354
357
|
}
|
|
355
358
|
function seriesShape(kind, itemColor, line, theme) {
|
|
356
359
|
if (kind === "line") {
|
|
@@ -473,6 +476,8 @@ function scatterStyle(group) {
|
|
|
473
476
|
return "marker";
|
|
474
477
|
}
|
|
475
478
|
function chartGroup(group, groupIndex, cells, textStyles, channels, theme) {
|
|
479
|
+
const groupStyle = textStyles.groupDataLabels?.get(groupIndex);
|
|
480
|
+
const groupLabels = groupStyle === void 0 ? void 0 : el("c:dLbls", null, raw(groupStyle));
|
|
476
481
|
const seriesCell = (seriesIndex) => {
|
|
477
482
|
const value = cells.series.get(seriesIndex);
|
|
478
483
|
if (value === void 0) throw new Error(`Chart series ${seriesIndex} is missing workbook columns`);
|
|
@@ -481,28 +486,28 @@ function chartGroup(group, groupIndex, cells, textStyles, channels, theme) {
|
|
|
481
486
|
switch (group.kind) {
|
|
482
487
|
case "scatter": {
|
|
483
488
|
const items = group.series.map((item) => scatterChartSeries(group, item, seriesCell(item.seriesIndex), groupIndex, textStyles, channels, theme));
|
|
484
|
-
return el("c:scatterChart", null, el("c:scatterStyle", { val: scatterStyle(group) }), el("c:varyColors", { val: false }), items, el("c:axId", { val: group.axes.x.id }), el("c:axId", { val: group.axes.y.id }));
|
|
489
|
+
return el("c:scatterChart", null, el("c:scatterStyle", { val: scatterStyle(group) }), el("c:varyColors", { val: false }), items, groupLabels, el("c:axId", { val: group.axes.x.id }), el("c:axId", { val: group.axes.y.id }));
|
|
485
490
|
}
|
|
486
491
|
case "column":
|
|
487
492
|
case "bar": {
|
|
488
493
|
const items = group.series.map((item) => categoryChartSeries(group, item, seriesCell(item.seriesIndex), groupIndex, textStyles, channels, theme));
|
|
489
494
|
const axes = [el("c:axId", { val: group.axes.category.id }), el("c:axId", { val: group.axes.value.id })];
|
|
490
|
-
return el("c:barChart", null, el("c:barDir", { val: group.kind === "bar" ? "bar" : "col" }), el("c:grouping", { val: grouping(group.stacking) }), el("c:varyColors", { val: false }), items, el("c:gapWidth", { val: Math.round(group.gapWidth) }), group.overlap !== void 0 ? el("c:overlap", { val: Math.round(group.overlap) }) : group.stacking === "clustered" ? void 0 : el("c:overlap", { val: 100 }), axes);
|
|
495
|
+
return el("c:barChart", null, el("c:barDir", { val: group.kind === "bar" ? "bar" : "col" }), el("c:grouping", { val: grouping(group.stacking) }), el("c:varyColors", { val: false }), items, groupLabels, el("c:gapWidth", { val: Math.round(group.gapWidth) }), group.overlap !== void 0 ? el("c:overlap", { val: Math.round(group.overlap) }) : group.stacking === "clustered" ? void 0 : el("c:overlap", { val: 100 }), axes);
|
|
491
496
|
}
|
|
492
497
|
case "line": {
|
|
493
498
|
const items = group.series.map((item) => categoryChartSeries(group, item, seriesCell(item.seriesIndex), groupIndex, textStyles, channels, theme));
|
|
494
499
|
const axes = [el("c:axId", { val: group.axes.category.id }), el("c:axId", { val: group.axes.value.id })];
|
|
495
|
-
return el("c:lineChart", null, el("c:grouping", { val: grouping(group.stacking) }), el("c:varyColors", { val: false }), items, el("c:marker", { val: true }), axes);
|
|
500
|
+
return el("c:lineChart", null, el("c:grouping", { val: grouping(group.stacking) }), el("c:varyColors", { val: false }), items, groupLabels, el("c:marker", { val: true }), axes);
|
|
496
501
|
}
|
|
497
502
|
case "area": {
|
|
498
503
|
const items = group.series.map((item) => categoryChartSeries(group, item, seriesCell(item.seriesIndex), groupIndex, textStyles, channels, theme));
|
|
499
504
|
const axes = [el("c:axId", { val: group.axes.category.id }), el("c:axId", { val: group.axes.value.id })];
|
|
500
|
-
return el("c:areaChart", null, el("c:grouping", { val: grouping(group.stacking) }), el("c:varyColors", { val: false }), items, axes);
|
|
505
|
+
return el("c:areaChart", null, el("c:grouping", { val: grouping(group.stacking) }), el("c:varyColors", { val: false }), items, groupLabels, axes);
|
|
501
506
|
}
|
|
502
507
|
case "pie":
|
|
503
508
|
case "doughnut": {
|
|
504
509
|
const items = group.series.map((item) => categoryChartSeries(group, item, seriesCell(item.seriesIndex), groupIndex, textStyles, channels, theme));
|
|
505
|
-
return el(group.kind === "pie" ? "c:pieChart" : "c:doughnutChart", null, el("c:varyColors", { val: true }), items, el("c:firstSliceAng", { val: group.firstSliceAngle }), group.kind === "doughnut" ? el("c:holeSize", { val: group.holeSize }) : void 0);
|
|
510
|
+
return el(group.kind === "pie" ? "c:pieChart" : "c:doughnutChart", null, el("c:varyColors", { val: true }), items, groupLabels, el("c:firstSliceAng", { val: group.firstSliceAngle }), group.kind === "doughnut" ? el("c:holeSize", { val: group.holeSize }) : void 0);
|
|
506
511
|
}
|
|
507
512
|
default: return assertNever(group);
|
|
508
513
|
}
|
|
@@ -595,7 +600,7 @@ function chartPartXml(parsed, box, relatedRelationshipId, textStyles, theme) {
|
|
|
595
600
|
"xmlns:c": chartNamespace,
|
|
596
601
|
"xmlns:a": drawingNamespace,
|
|
597
602
|
"xmlns:r": relationshipNamespace
|
|
598
|
-
}, el("c:date1904", { val: false }), el("c:lang", { val: chartLang }), el("c:roundedCorners", { val: false }), el("c:chart", null, raw(textStyles.title), el("c:autoTitleDeleted", { val: parsed.title === void 0 }), el("c:plotArea", null, plotLayout(parsed, box), parsed.groups.map((group, groupIndex) => chartGroup(group, groupIndex, cells, textStyles, channels, theme)), axes(parsed, cells, textStyles, theme), transparent()), parsed.legend === void 0 || parsed.legend === false ? void 0 : el("c:legend", null, el("c:legendPos", { val: chartLegendPositions[parsed.legend] }), independentLegendEntries(parsed), el("c:overlay", { val: false })), el("c:plotVisOnly", { val: true }), parsed.displayBlanksAs === void 0 ? void 0 : el("c:dispBlanksAs", { val: parsed.displayBlanksAs })), transparent(), raw(textStyles.chart), el("c:externalData", { "r:id": relatedRelationshipId }, el("c:autoUpdate", { val: false }))));
|
|
603
|
+
}, el("c:date1904", { val: false }), el("c:lang", { val: chartLang }), el("c:roundedCorners", { val: false }), parsed.colorMapOverride === void 0 ? void 0 : el("c:clrMapOvr", parsed.colorMapOverride), el("c:chart", null, raw(textStyles.title), el("c:autoTitleDeleted", { val: parsed.title === void 0 }), el("c:plotArea", null, plotLayout(parsed, box), parsed.groups.map((group, groupIndex) => chartGroup(group, groupIndex, cells, textStyles, channels, theme)), axes(parsed, cells, textStyles, theme), transparent()), parsed.legend === void 0 || parsed.legend === false ? void 0 : el("c:legend", null, el("c:legendPos", { val: chartLegendPositions[parsed.legend] }), independentLegendEntries(parsed), el("c:overlay", { val: false }), raw(textStyles.legend)), el("c:plotVisOnly", { val: true }), parsed.displayBlanksAs === void 0 ? void 0 : el("c:dispBlanksAs", { val: parsed.displayBlanksAs })), transparent(), raw(textStyles.chart), el("c:externalData", { "r:id": relatedRelationshipId }, el("c:autoUpdate", { val: false }))));
|
|
599
604
|
}
|
|
600
605
|
function chartFrameXml(id, name, box, relationshipId, link, placeholder) {
|
|
601
606
|
const linkAttributes = {
|