ooxml-core 0.19.0 → 0.21.0
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/README.md +21 -43
- package/dist/automation/index.cjs +195 -193
- package/dist/automation/index.mjs +195 -193
- package/dist/chart/axis-nice.d.ts +97 -0
- package/dist/chart/axis-nice.d.ts.map +1 -0
- package/dist/chart/histogram-binning.d.ts +40 -0
- package/dist/chart/histogram-binning.d.ts.map +1 -0
- package/dist/chart/index.cjs +167 -0
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.d.ts.map +1 -1
- package/dist/chart/index.mjs +162 -1
- package/dist/diagram/index.cjs +2 -1
- package/dist/diagram/index.mjs +2 -1
- package/dist/docx/attr-units.d.ts +11 -0
- package/dist/docx/attr-units.d.ts.map +1 -0
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/case-transform.d.ts +9 -0
- package/dist/docx/case-transform.d.ts.map +1 -0
- package/dist/docx/embedded.cjs +2 -1
- package/dist/docx/embedded.mjs +2 -1
- package/dist/docx/index.cjs +289 -3
- package/dist/docx/index.d.ts +5 -0
- package/dist/docx/index.d.ts.map +1 -1
- package/dist/docx/index.mjs +269 -4
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/table-layout.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +2 -1
- package/dist/docx/load/index.mjs +2 -1
- package/dist/docx/page-setup-model.d.ts +29 -0
- package/dist/docx/page-setup-model.d.ts.map +1 -0
- package/dist/docx/page-size.d.ts +11 -0
- package/dist/docx/page-size.d.ts.map +1 -0
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/section-edit.d.ts +19 -0
- package/dist/docx/section-edit.d.ts.map +1 -0
- package/dist/docx/tab-stops.d.ts.map +1 -1
- package/dist/docx/ui/backstage-focus.d.ts +6 -0
- package/dist/docx/ui/backstage-focus.d.ts.map +1 -0
- package/dist/docx/ui/break-note-schema.d.ts +11 -0
- package/dist/docx/ui/break-note-schema.d.ts.map +1 -0
- package/dist/docx/ui/collaboration-authority.d.ts +31 -0
- package/dist/docx/ui/collaboration-authority.d.ts.map +1 -0
- package/dist/docx/ui/collaboration-identity.d.ts +8 -0
- package/dist/docx/ui/collaboration-identity.d.ts.map +1 -0
- package/dist/docx/ui/collaboration-protocol.d.ts +25 -0
- package/dist/docx/ui/collaboration-protocol.d.ts.map +1 -0
- package/dist/docx/ui/collaboration.d.ts +30 -0
- package/dist/docx/ui/collaboration.d.ts.map +1 -0
- package/dist/docx/ui/defined.d.ts +3 -0
- package/dist/docx/ui/defined.d.ts.map +1 -0
- package/dist/docx/ui/dirty-state.d.ts +9 -0
- package/dist/docx/ui/dirty-state.d.ts.map +1 -0
- package/dist/docx/ui/field-guard.d.ts +21 -0
- package/dist/docx/ui/field-guard.d.ts.map +1 -0
- package/dist/docx/ui/header-footer-history.d.ts +15 -0
- package/dist/docx/ui/header-footer-history.d.ts.map +1 -0
- package/dist/docx/ui/index.cjs +2380 -0
- package/dist/docx/ui/index.d.ts +30 -0
- package/dist/docx/ui/index.d.ts.map +1 -0
- package/dist/docx/ui/index.mjs +2317 -0
- package/dist/docx/ui/inline-content-schema.d.ts +15 -0
- package/dist/docx/ui/inline-content-schema.d.ts.map +1 -0
- package/dist/docx/ui/ligature-style.d.ts +4 -0
- package/dist/docx/ui/ligature-style.d.ts.map +1 -0
- package/dist/docx/ui/node-numbering.d.ts +8 -0
- package/dist/docx/ui/node-numbering.d.ts.map +1 -0
- package/dist/docx/ui/review-schema.d.ts +90 -0
- package/dist/docx/ui/review-schema.d.ts.map +1 -0
- package/dist/docx/ui/ribbon-action-ids.d.ts +26 -0
- package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -0
- package/dist/docx/ui/ribbon-colors.d.ts +3 -0
- package/dist/docx/ui/ribbon-colors.d.ts.map +1 -0
- package/dist/docx/ui/ribbon-legacy-labels.d.ts +6 -0
- package/dist/docx/ui/ribbon-legacy-labels.d.ts.map +1 -0
- package/dist/docx/ui/run-compare.d.ts +5 -0
- package/dist/docx/ui/run-compare.d.ts.map +1 -0
- package/dist/docx/ui/run-extra-mark.d.ts +17 -0
- package/dist/docx/ui/run-extra-mark.d.ts.map +1 -0
- package/dist/docx/ui/schema-marks.d.ts +273 -0
- package/dist/docx/ui/schema-marks.d.ts.map +1 -0
- package/dist/docx/ui/smartart-theme.d.ts +21 -0
- package/dist/docx/ui/smartart-theme.d.ts.map +1 -0
- package/dist/docx/ui/table-render.d.ts +24 -0
- package/dist/docx/ui/table-render.d.ts.map +1 -0
- package/dist/docx/ui/table-visuals.d.ts +3 -0
- package/dist/docx/ui/table-visuals.d.ts.map +1 -0
- package/dist/docx/ui/theme/css-vars.d.ts +6 -0
- package/dist/docx/ui/theme/css-vars.d.ts.map +1 -0
- package/dist/docx/ui/theme/defaults.d.ts +12 -0
- package/dist/docx/ui/theme/defaults.d.ts.map +1 -0
- package/dist/docx/ui/theme/element.d.ts +9 -0
- package/dist/docx/ui/theme/element.d.ts.map +1 -0
- package/dist/docx/ui/theme/index.d.ts +5 -0
- package/dist/docx/ui/theme/index.d.ts.map +1 -0
- package/dist/docx/ui/theme/types.d.ts +42 -0
- package/dist/docx/ui/theme/types.d.ts.map +1 -0
- package/dist/docx/ui/word-count.d.ts +3 -0
- package/dist/docx/ui/word-count.d.ts.map +1 -0
- package/dist/docx/ui/zoom-fit.d.ts +16 -0
- package/dist/docx/ui/zoom-fit.d.ts.map +1 -0
- package/dist/docx/validate-paragraph.d.ts.map +1 -1
- package/dist/index.cjs +169 -1
- package/dist/index.mjs +169 -1
- package/dist/math/index.cjs +2 -1
- package/dist/math/index.mjs +2 -1
- package/dist/opc/index.cjs +2 -1
- package/dist/opc/index.mjs +2 -1
- package/dist/pptx/automation/index.cjs +1572 -863
- package/dist/pptx/automation/index.d.ts +4 -3
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +1572 -863
- package/dist/pptx/chunks/color-ref-BM66NGFP.d.ts +42 -0
- package/dist/pptx/chunks/color-ref-BM66NGFP.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-D0yGoLyw.d.ts → index-CcQTCBnT.d.ts} +63 -479
- package/dist/pptx/chunks/index-CcQTCBnT.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-BtBj3VG1.d.ts → index-DHoPgFcH.d.ts} +529 -11
- package/dist/pptx/chunks/index-DHoPgFcH.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-GuisjlbR.d.ts → text-operations-BzdehTeY.d.ts} +50 -51
- package/dist/pptx/chunks/text-operations-BzdehTeY.d.ts.map +1 -0
- package/dist/pptx/cli/index.cjs +1204 -489
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +1204 -489
- package/dist/pptx/converter/index.cjs +8 -5
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +8 -5
- package/dist/pptx/index.cjs +1699 -989
- package/dist/pptx/index.d.ts +5 -4
- package/dist/pptx/index.mjs +1698 -990
- package/dist/pptx/ui/index.cjs +510 -0
- package/dist/pptx/ui/index.d.ts +80 -0
- package/dist/pptx/ui/index.d.ts.map +1 -0
- package/dist/pptx/ui/index.mjs +499 -0
- package/dist/visio/index.cjs +2 -1
- package/dist/visio/index.mjs +2 -1
- package/dist/visio/ui/contract.d.ts +33 -0
- package/dist/visio/ui/contract.d.ts.map +1 -0
- package/dist/visio/ui/demo-document.d.ts +4 -0
- package/dist/visio/ui/demo-document.d.ts.map +1 -0
- package/dist/visio/ui/diagnostics.d.ts +10 -0
- package/dist/visio/ui/diagnostics.d.ts.map +1 -0
- package/dist/visio/ui/document-history.d.ts +43 -0
- package/dist/visio/ui/document-history.d.ts.map +1 -0
- package/dist/visio/ui/document-text-search.d.ts +45 -0
- package/dist/visio/ui/document-text-search.d.ts.map +1 -0
- package/dist/visio/ui/edit-commands.d.ts +4 -0
- package/dist/visio/ui/edit-commands.d.ts.map +1 -0
- package/dist/visio/ui/edit-error.d.ts +5 -0
- package/dist/visio/ui/edit-error.d.ts.map +1 -0
- package/dist/visio/ui/foreign-vector-budget.d.ts +25 -0
- package/dist/visio/ui/foreign-vector-budget.d.ts.map +1 -0
- package/dist/visio/ui/index.cjs +1523 -0
- package/dist/visio/ui/index.d.ts +12 -0
- package/dist/visio/ui/index.d.ts.map +1 -0
- package/dist/visio/ui/index.mjs +1498 -0
- package/dist/visio/ui/scene-details.d.ts +8 -0
- package/dist/visio/ui/scene-details.d.ts.map +1 -0
- package/dist/visio/ui/scene-validation.d.ts +5 -0
- package/dist/visio/ui/scene-validation.d.ts.map +1 -0
- package/dist/visio/ui/snapshot-scene.d.ts +9 -0
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -0
- package/dist/xlsx/index.cjs +100 -98
- package/dist/xlsx/index.mjs +100 -98
- package/dist/xlsx/load/index.cjs +68 -66
- package/dist/xlsx/load/index.mjs +68 -66
- package/dist/xlsx/ui/backstage/templates.d.ts +16 -0
- package/dist/xlsx/ui/backstage/templates.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/alignment.d.ts +4 -0
- package/dist/xlsx/ui/commands/alignment.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/cells.d.ts +3 -0
- package/dist/xlsx/ui/commands/cells.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/cf-presets.d.ts +15 -0
- package/dist/xlsx/ui/commands/cf-presets.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/clipboard.d.ts +22 -0
- package/dist/xlsx/ui/commands/clipboard.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/contextual.d.ts +13 -0
- package/dist/xlsx/ui/commands/contextual.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/data.d.ts +3 -0
- package/dist/xlsx/ui/commands/data.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/editing.d.ts +13 -0
- package/dist/xlsx/ui/commands/editing.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/font.d.ts +21 -0
- package/dist/xlsx/ui/commands/font.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/formulas.d.ts +15 -0
- package/dist/xlsx/ui/commands/formulas.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/core-features.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/core-features.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/format-cells.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/format-cells.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts +4 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/messages.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/messages.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-home.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-home.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-tabs.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/ribbon-tabs.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/rules.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/rules.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/tools.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/types.d.ts +5 -0
- package/dist/xlsx/ui/commands/i18n/types.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/icons.d.ts +4 -0
- package/dist/xlsx/ui/commands/icons.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/number.d.ts +11 -0
- package/dist/xlsx/ui/commands/number.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/page-layout.d.ts +10 -0
- package/dist/xlsx/ui/commands/page-layout.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/select-special.d.ts +12 -0
- package/dist/xlsx/ui/commands/select-special.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/sort-filter.d.ts +3 -0
- package/dist/xlsx/ui/commands/sort-filter.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/style-presets.d.ts +21 -0
- package/dist/xlsx/ui/commands/style-presets.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/util.d.ts +59 -0
- package/dist/xlsx/ui/commands/util.d.ts.map +1 -0
- package/dist/xlsx/ui/commands.d.ts +36 -0
- package/dist/xlsx/ui/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/context-menu/items.d.ts +36 -0
- package/dist/xlsx/ui/context-menu/items.d.ts.map +1 -0
- package/dist/xlsx/ui/context.d.ts +65 -0
- package/dist/xlsx/ui/context.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs/format-cells/number-categories.d.ts +28 -0
- package/dist/xlsx/ui/dialogs/format-cells/number-categories.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs/format-cells/types.d.ts +40 -0
- package/dist/xlsx/ui/dialogs/format-cells/types.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs/insert-chart-model.d.ts +9 -0
- package/dist/xlsx/ui/dialogs/insert-chart-model.d.ts.map +1 -0
- package/dist/xlsx/ui/dialogs.d.ts +9 -0
- package/dist/xlsx/ui/dialogs.d.ts.map +1 -0
- package/dist/xlsx/ui/dirty-state.d.ts +9 -0
- package/dist/xlsx/ui/dirty-state.d.ts.map +1 -0
- package/dist/xlsx/ui/formula-bar/name-resolve.d.ts +23 -0
- package/dist/xlsx/ui/formula-bar/name-resolve.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/cell-items.d.ts +42 -0
- package/dist/xlsx/ui/grid/cell-items.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/cell-paint.d.ts +26 -0
- package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/edit-bridge.d.ts +47 -0
- package/dist/xlsx/ui/grid/edit-bridge.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/geometry.d.ts +76 -0
- package/dist/xlsx/ui/grid/geometry.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/icon-sets.d.ts +3 -0
- package/dist/xlsx/ui/grid/icon-sets.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/number-fit.d.ts +3 -0
- package/dist/xlsx/ui/grid/number-fit.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/selection-ops.d.ts +32 -0
- package/dist/xlsx/ui/grid/selection-ops.d.ts.map +1 -0
- package/dist/xlsx/ui/grid/view-cache.d.ts +15 -0
- package/dist/xlsx/ui/grid/view-cache.d.ts.map +1 -0
- package/dist/xlsx/ui/index.cjs +28484 -0
- package/dist/xlsx/ui/index.d.ts +56 -0
- package/dist/xlsx/ui/index.d.ts.map +1 -0
- package/dist/xlsx/ui/index.mjs +28290 -0
- package/dist/xlsx/ui/locales/de/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/de/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/de/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/de/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/de/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/en/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/en/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/es/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/es/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/fr/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/fr/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/merge.d.ts +7 -0
- package/dist/xlsx/ui/locales/merge.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/commands.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/commands.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/grid.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/grid.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/index.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/index.d.ts.map +1 -0
- package/dist/xlsx/ui/locales/zh-CN/shell.d.ts +2 -0
- package/dist/xlsx/ui/locales/zh-CN/shell.d.ts.map +1 -0
- package/dist/xlsx/ui/localization.d.ts +23 -0
- package/dist/xlsx/ui/localization.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/icon-paths.d.ts +9 -0
- package/dist/xlsx/ui/ribbon/icon-paths.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/parts.d.ts +88 -0
- package/dist/xlsx/ui/ribbon/parts.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tab-api.d.ts +21 -0
- package/dist/xlsx/ui/ribbon/tab-api.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts +5 -0
- package/dist/xlsx/ui/ribbon/tabs/review-view.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tabs/theme-palette.d.ts +8 -0
- package/dist/xlsx/ui/ribbon/tabs/theme-palette.d.ts.map +1 -0
- package/dist/xlsx/ui/ribbon/tell-me.d.ts +16 -0
- package/dist/xlsx/ui/ribbon/tell-me.d.ts.map +1 -0
- package/dist/xlsx/ui/selection.d.ts +34 -0
- package/dist/xlsx/ui/selection.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/css-vars.d.ts +6 -0
- package/dist/xlsx/ui/theme/css-vars.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/defaults.d.ts +6 -0
- package/dist/xlsx/ui/theme/defaults.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/element.d.ts +9 -0
- package/dist/xlsx/ui/theme/element.d.ts.map +1 -0
- package/dist/xlsx/ui/theme/types.d.ts +54 -0
- package/dist/xlsx/ui/theme/types.d.ts.map +1 -0
- package/dist/xml/index.cjs +2 -1
- package/dist/xml/index.mjs +2 -1
- package/package.json +42 -4
- package/dist/pptx/chunks/index-BtBj3VG1.d.ts.map +0 -1
- package/dist/pptx/chunks/index-D0yGoLyw.d.ts.map +0 -1
- package/dist/pptx/chunks/text-operations-GuisjlbR.d.ts.map +0 -1
package/dist/pptx/index.cjs
CHANGED
|
@@ -3447,6 +3447,955 @@ var init_chart_gradient_input = __esm({
|
|
|
3447
3447
|
}
|
|
3448
3448
|
});
|
|
3449
3449
|
|
|
3450
|
+
// src/pptx/core/utils/chart-container-content-model.ts
|
|
3451
|
+
function chartTypeToContainerLocalName(chartType) {
|
|
3452
|
+
return TYPE_TO_CONTAINER[chartType];
|
|
3453
|
+
}
|
|
3454
|
+
function isKnownChartContainer(containerLocal) {
|
|
3455
|
+
return containerLocal in CHART_CONTAINER_CHILD_ORDER;
|
|
3456
|
+
}
|
|
3457
|
+
function chartContainerAllows(containerLocal, childLocal) {
|
|
3458
|
+
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
3459
|
+
return order !== void 0 && order.includes(childLocal);
|
|
3460
|
+
}
|
|
3461
|
+
var CHART_CONTAINER_CHILD_ORDER, REQUIRED_LEADING_CHILD, TYPE_TO_CONTAINER, AXIS_LOCAL_NAMES;
|
|
3462
|
+
var init_chart_container_content_model = __esm({
|
|
3463
|
+
"src/pptx/core/utils/chart-container-content-model.ts"() {
|
|
3464
|
+
CHART_CONTAINER_CHILD_ORDER = {
|
|
3465
|
+
areaChart: ["grouping", "varyColors", "ser", "dLbls", "dropLines", "axId", "extLst"],
|
|
3466
|
+
area3DChart: [
|
|
3467
|
+
"grouping",
|
|
3468
|
+
"varyColors",
|
|
3469
|
+
"ser",
|
|
3470
|
+
"dLbls",
|
|
3471
|
+
"dropLines",
|
|
3472
|
+
"gapDepth",
|
|
3473
|
+
"axId",
|
|
3474
|
+
"extLst"
|
|
3475
|
+
],
|
|
3476
|
+
barChart: [
|
|
3477
|
+
"barDir",
|
|
3478
|
+
"grouping",
|
|
3479
|
+
"varyColors",
|
|
3480
|
+
"ser",
|
|
3481
|
+
"dLbls",
|
|
3482
|
+
"gapWidth",
|
|
3483
|
+
"overlap",
|
|
3484
|
+
"serLines",
|
|
3485
|
+
"axId",
|
|
3486
|
+
"extLst"
|
|
3487
|
+
],
|
|
3488
|
+
bar3DChart: [
|
|
3489
|
+
"barDir",
|
|
3490
|
+
"grouping",
|
|
3491
|
+
"varyColors",
|
|
3492
|
+
"ser",
|
|
3493
|
+
"dLbls",
|
|
3494
|
+
"gapWidth",
|
|
3495
|
+
"gapDepth",
|
|
3496
|
+
"shape",
|
|
3497
|
+
"axId",
|
|
3498
|
+
"extLst"
|
|
3499
|
+
],
|
|
3500
|
+
bubbleChart: [
|
|
3501
|
+
"varyColors",
|
|
3502
|
+
"ser",
|
|
3503
|
+
"dLbls",
|
|
3504
|
+
"bubble3D",
|
|
3505
|
+
"bubbleScale",
|
|
3506
|
+
"showNegBubbles",
|
|
3507
|
+
"sizeRepresents",
|
|
3508
|
+
"axId",
|
|
3509
|
+
"extLst"
|
|
3510
|
+
],
|
|
3511
|
+
doughnutChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "holeSize", "extLst"],
|
|
3512
|
+
lineChart: [
|
|
3513
|
+
"grouping",
|
|
3514
|
+
"varyColors",
|
|
3515
|
+
"ser",
|
|
3516
|
+
"dLbls",
|
|
3517
|
+
"dropLines",
|
|
3518
|
+
"hiLowLines",
|
|
3519
|
+
"upDownBars",
|
|
3520
|
+
"marker",
|
|
3521
|
+
"smooth",
|
|
3522
|
+
"axId",
|
|
3523
|
+
"extLst"
|
|
3524
|
+
],
|
|
3525
|
+
line3DChart: [
|
|
3526
|
+
"grouping",
|
|
3527
|
+
"varyColors",
|
|
3528
|
+
"ser",
|
|
3529
|
+
"dLbls",
|
|
3530
|
+
"dropLines",
|
|
3531
|
+
"gapDepth",
|
|
3532
|
+
"axId",
|
|
3533
|
+
"extLst"
|
|
3534
|
+
],
|
|
3535
|
+
ofPieChart: [
|
|
3536
|
+
"ofPieType",
|
|
3537
|
+
"varyColors",
|
|
3538
|
+
"ser",
|
|
3539
|
+
"dLbls",
|
|
3540
|
+
"gapWidth",
|
|
3541
|
+
"splitType",
|
|
3542
|
+
"splitPos",
|
|
3543
|
+
"custSplit",
|
|
3544
|
+
"secondPieSize",
|
|
3545
|
+
"serLines",
|
|
3546
|
+
"extLst"
|
|
3547
|
+
],
|
|
3548
|
+
pieChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "extLst"],
|
|
3549
|
+
pie3DChart: ["varyColors", "ser", "dLbls", "extLst"],
|
|
3550
|
+
radarChart: ["radarStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
3551
|
+
scatterChart: ["scatterStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
3552
|
+
stockChart: ["ser", "dLbls", "dropLines", "hiLowLines", "upDownBars", "axId", "extLst"],
|
|
3553
|
+
surfaceChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"],
|
|
3554
|
+
surface3DChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"]
|
|
3555
|
+
};
|
|
3556
|
+
REQUIRED_LEADING_CHILD = {
|
|
3557
|
+
barChart: { local: "barDir", val: "col" },
|
|
3558
|
+
bar3DChart: { local: "barDir", val: "col" },
|
|
3559
|
+
lineChart: { local: "grouping", val: "standard" },
|
|
3560
|
+
line3DChart: { local: "grouping", val: "standard" },
|
|
3561
|
+
ofPieChart: { local: "ofPieType", val: "pie" },
|
|
3562
|
+
radarChart: { local: "radarStyle", val: "marker" },
|
|
3563
|
+
scatterChart: { local: "scatterStyle", val: "lineMarker" }
|
|
3564
|
+
};
|
|
3565
|
+
TYPE_TO_CONTAINER = {
|
|
3566
|
+
area: "areaChart",
|
|
3567
|
+
area3D: "area3DChart",
|
|
3568
|
+
bar: "barChart",
|
|
3569
|
+
bar3D: "bar3DChart",
|
|
3570
|
+
bubble: "bubbleChart",
|
|
3571
|
+
doughnut: "doughnutChart",
|
|
3572
|
+
line: "lineChart",
|
|
3573
|
+
line3D: "line3DChart",
|
|
3574
|
+
ofPie: "ofPieChart",
|
|
3575
|
+
pie: "pieChart",
|
|
3576
|
+
pie3D: "pie3DChart",
|
|
3577
|
+
radar: "radarChart",
|
|
3578
|
+
scatter: "scatterChart",
|
|
3579
|
+
stock: "stockChart",
|
|
3580
|
+
surface: "surfaceChart"
|
|
3581
|
+
};
|
|
3582
|
+
AXIS_LOCAL_NAMES = ["catAx", "valAx", "dateAx", "serAx"];
|
|
3583
|
+
}
|
|
3584
|
+
});
|
|
3585
|
+
|
|
3586
|
+
// src/pptx/core/utils/chart-container-schema.ts
|
|
3587
|
+
function normalizeChartGroupingValue(containerLocal, value) {
|
|
3588
|
+
const isBar = containerLocal === "barChart" || containerLocal === "bar3DChart";
|
|
3589
|
+
return !isBar && value === "clustered" ? "standard" : value;
|
|
3590
|
+
}
|
|
3591
|
+
function normalizeGroupingNode(containerLocal, node) {
|
|
3592
|
+
const value = node["@_val"];
|
|
3593
|
+
if (value !== void 0) {
|
|
3594
|
+
node["@_val"] = normalizeChartGroupingValue(containerLocal, value);
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
function normalizeChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
3598
|
+
if (!isKnownChartContainer(containerLocal)) {
|
|
3599
|
+
return;
|
|
3600
|
+
}
|
|
3601
|
+
for (const key2 of Object.keys(container2)) {
|
|
3602
|
+
if (key2.startsWith("@_") || key2 === "#text") {
|
|
3603
|
+
continue;
|
|
3604
|
+
}
|
|
3605
|
+
const local = getLocalName2(key2);
|
|
3606
|
+
if (!chartContainerAllows(containerLocal, local)) {
|
|
3607
|
+
delete container2[key2];
|
|
3608
|
+
continue;
|
|
3609
|
+
}
|
|
3610
|
+
if (local === "grouping") {
|
|
3611
|
+
const node = container2[key2];
|
|
3612
|
+
if (node && typeof node === "object" && !Array.isArray(node)) {
|
|
3613
|
+
normalizeGroupingNode(containerLocal, node);
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
const required = REQUIRED_LEADING_CHILD[containerLocal];
|
|
3618
|
+
if (required) {
|
|
3619
|
+
const present = Object.keys(container2).some((k) => getLocalName2(k) === required.local);
|
|
3620
|
+
if (!present) {
|
|
3621
|
+
container2[`c:${required.local}`] = { "@_val": required.val };
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
function orderChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
3626
|
+
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
3627
|
+
if (!order) {
|
|
3628
|
+
return;
|
|
3629
|
+
}
|
|
3630
|
+
const keys = Object.keys(container2).filter((k) => !k.startsWith("@_") && k !== "#text");
|
|
3631
|
+
if (keys.some((k) => !order.includes(getLocalName2(k)))) {
|
|
3632
|
+
return;
|
|
3633
|
+
}
|
|
3634
|
+
const sorted = [...keys].sort(
|
|
3635
|
+
(a, b) => order.indexOf(getLocalName2(a)) - order.indexOf(getLocalName2(b))
|
|
3636
|
+
);
|
|
3637
|
+
if (sorted.every((k, i2) => k === keys[i2])) {
|
|
3638
|
+
return;
|
|
3639
|
+
}
|
|
3640
|
+
const saved = sorted.map((k) => [k, container2[k]]);
|
|
3641
|
+
for (const k of keys) {
|
|
3642
|
+
delete container2[k];
|
|
3643
|
+
}
|
|
3644
|
+
for (const [k, v] of saved) {
|
|
3645
|
+
container2[k] = v;
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
function renameXmlKeyInPlace(obj, oldKey, newKey) {
|
|
3649
|
+
if (oldKey === newKey || !(oldKey in obj)) {
|
|
3650
|
+
return;
|
|
3651
|
+
}
|
|
3652
|
+
const entries = Object.keys(obj).map((k) => [k === oldKey ? newKey : k, obj[k]]);
|
|
3653
|
+
for (const k of Object.keys(obj)) {
|
|
3654
|
+
delete obj[k];
|
|
3655
|
+
}
|
|
3656
|
+
for (const [k, v] of entries) {
|
|
3657
|
+
obj[k] = v;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
function referencedAxisIds(plotArea, getLocalName2) {
|
|
3661
|
+
const ids = /* @__PURE__ */ new Set();
|
|
3662
|
+
for (const key2 of Object.keys(plotArea)) {
|
|
3663
|
+
if (!getLocalName2(key2).endsWith("Chart")) {
|
|
3664
|
+
continue;
|
|
3665
|
+
}
|
|
3666
|
+
for (const container2 of toArray(plotArea[key2])) {
|
|
3667
|
+
for (const childKey3 of Object.keys(container2)) {
|
|
3668
|
+
if (getLocalName2(childKey3) !== "axId") {
|
|
3669
|
+
continue;
|
|
3670
|
+
}
|
|
3671
|
+
for (const axId of toArray(container2[childKey3])) {
|
|
3672
|
+
const val = axId["@_val"];
|
|
3673
|
+
if (val !== void 0) {
|
|
3674
|
+
ids.add(String(val));
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
return ids;
|
|
3681
|
+
}
|
|
3682
|
+
function toArray(value) {
|
|
3683
|
+
if (Array.isArray(value)) {
|
|
3684
|
+
return value.filter((v) => typeof v === "object" && v !== null);
|
|
3685
|
+
}
|
|
3686
|
+
return typeof value === "object" && value !== null ? [value] : [];
|
|
3687
|
+
}
|
|
3688
|
+
function reconcileChartPlotAreaAxes(plotArea, getLocalName2) {
|
|
3689
|
+
const referenced = referencedAxisIds(plotArea, getLocalName2);
|
|
3690
|
+
let removed = 0;
|
|
3691
|
+
for (const key2 of Object.keys(plotArea)) {
|
|
3692
|
+
const local = getLocalName2(key2);
|
|
3693
|
+
if (!AXIS_LOCAL_NAMES.includes(local)) {
|
|
3694
|
+
continue;
|
|
3695
|
+
}
|
|
3696
|
+
const axes = toArray(plotArea[key2]);
|
|
3697
|
+
const kept = axes.filter((axis) => {
|
|
3698
|
+
const axIdKey = Object.keys(axis).find((k) => getLocalName2(k) === "axId");
|
|
3699
|
+
const val = axIdKey ? toArray(axis[axIdKey])[0]?.["@_val"] : void 0;
|
|
3700
|
+
return val !== void 0 && referenced.has(String(val));
|
|
3701
|
+
});
|
|
3702
|
+
removed += axes.length - kept.length;
|
|
3703
|
+
if (kept.length === 0) {
|
|
3704
|
+
delete plotArea[key2];
|
|
3705
|
+
} else if (kept.length !== axes.length) {
|
|
3706
|
+
plotArea[key2] = kept.length === 1 ? kept[0] : kept;
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
return removed;
|
|
3710
|
+
}
|
|
3711
|
+
var init_chart_container_schema = __esm({
|
|
3712
|
+
"src/pptx/core/utils/chart-container-schema.ts"() {
|
|
3713
|
+
init_chart_container_content_model();
|
|
3714
|
+
init_chart_container_content_model();
|
|
3715
|
+
}
|
|
3716
|
+
});
|
|
3717
|
+
|
|
3718
|
+
// src/pptx/core/utils/chart-group-options.ts
|
|
3719
|
+
function chartGroupOptionVal(spec, value) {
|
|
3720
|
+
return String(Math.min(spec.max, Math.max(spec.min, Math.round(value))));
|
|
3721
|
+
}
|
|
3722
|
+
function localNameOf2(key2) {
|
|
3723
|
+
return key2.replace(/^.*:/u, "");
|
|
3724
|
+
}
|
|
3725
|
+
function findKey3(obj, local, getLocalName2) {
|
|
3726
|
+
return Object.keys(obj).find((key2) => getLocalName2(key2) === local);
|
|
3727
|
+
}
|
|
3728
|
+
function modelValue(chartData, spec) {
|
|
3729
|
+
if (spec.element === "gapWidth" && chartData.chartType === "ofPie") {
|
|
3730
|
+
return chartData.ofPieOptions?.gapWidth ?? chartData.barGapWidth;
|
|
3731
|
+
}
|
|
3732
|
+
const value = chartData[spec.field];
|
|
3733
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
3734
|
+
}
|
|
3735
|
+
function applyGeneratedChartGroupOptions(container2, containerLocal, chartData) {
|
|
3736
|
+
for (const spec of CHART_GROUP_OPTIONS) {
|
|
3737
|
+
if (!chartContainerAllows(containerLocal, spec.element)) {
|
|
3738
|
+
continue;
|
|
3739
|
+
}
|
|
3740
|
+
const value = modelValue(chartData, spec) ?? spec.generatedDefault;
|
|
3741
|
+
if (value !== void 0) {
|
|
3742
|
+
container2[`c:${spec.element}`] = { "@_val": chartGroupOptionVal(spec, value) };
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
orderChartContainerChildren(container2, containerLocal, localNameOf2);
|
|
3746
|
+
}
|
|
3747
|
+
function authoredValue(node) {
|
|
3748
|
+
if (!node || typeof node !== "object") {
|
|
3749
|
+
return void 0;
|
|
3750
|
+
}
|
|
3751
|
+
const raw = node["@_val"];
|
|
3752
|
+
const num4 = raw === void 0 || raw === null || raw === "" ? NaN : Number.parseFloat(String(raw));
|
|
3753
|
+
return Number.isFinite(num4) ? num4 : void 0;
|
|
3754
|
+
}
|
|
3755
|
+
function applyChartGroupOptionsToXml(container2, containerLocal, chartData, getLocalName2) {
|
|
3756
|
+
let changed = false;
|
|
3757
|
+
for (const spec of CHART_GROUP_OPTIONS) {
|
|
3758
|
+
if (!chartContainerAllows(containerLocal, spec.element)) {
|
|
3759
|
+
continue;
|
|
3760
|
+
}
|
|
3761
|
+
if (spec.element === "gapWidth" && containerLocal === "ofPieChart") {
|
|
3762
|
+
continue;
|
|
3763
|
+
}
|
|
3764
|
+
const key2 = findKey3(container2, spec.element, getLocalName2);
|
|
3765
|
+
const authored = key2 ? authoredValue(container2[key2]) : void 0;
|
|
3766
|
+
const value = chartData[spec.field];
|
|
3767
|
+
if (value === void 0) {
|
|
3768
|
+
if (key2 && authored !== void 0) {
|
|
3769
|
+
delete container2[key2];
|
|
3770
|
+
changed = true;
|
|
3771
|
+
}
|
|
3772
|
+
continue;
|
|
3773
|
+
}
|
|
3774
|
+
if (authored === value) {
|
|
3775
|
+
continue;
|
|
3776
|
+
}
|
|
3777
|
+
container2[key2 ?? `c:${spec.element}`] = { "@_val": chartGroupOptionVal(spec, value) };
|
|
3778
|
+
changed = true;
|
|
3779
|
+
}
|
|
3780
|
+
return changed;
|
|
3781
|
+
}
|
|
3782
|
+
var CHART_GROUP_OPTIONS;
|
|
3783
|
+
var init_chart_group_options = __esm({
|
|
3784
|
+
"src/pptx/core/utils/chart-group-options.ts"() {
|
|
3785
|
+
init_chart_container_content_model();
|
|
3786
|
+
init_chart_container_schema();
|
|
3787
|
+
CHART_GROUP_OPTIONS = [
|
|
3788
|
+
{
|
|
3789
|
+
element: "gapWidth",
|
|
3790
|
+
field: "barGapWidth",
|
|
3791
|
+
schemaType: "ST_GapAmount",
|
|
3792
|
+
min: 0,
|
|
3793
|
+
max: 500,
|
|
3794
|
+
generatedDefault: 150
|
|
3795
|
+
},
|
|
3796
|
+
{ element: "overlap", field: "barOverlap", schemaType: "ST_Overlap", min: -100, max: 100 },
|
|
3797
|
+
{
|
|
3798
|
+
element: "firstSliceAng",
|
|
3799
|
+
field: "firstSliceAngle",
|
|
3800
|
+
schemaType: "ST_FirstSliceAng",
|
|
3801
|
+
min: 0,
|
|
3802
|
+
max: 360
|
|
3803
|
+
},
|
|
3804
|
+
{
|
|
3805
|
+
element: "holeSize",
|
|
3806
|
+
field: "doughnutHoleSize",
|
|
3807
|
+
schemaType: "ST_HoleSize",
|
|
3808
|
+
min: 1,
|
|
3809
|
+
max: 90,
|
|
3810
|
+
generatedDefault: 50
|
|
3811
|
+
}
|
|
3812
|
+
];
|
|
3813
|
+
}
|
|
3814
|
+
});
|
|
3815
|
+
|
|
3816
|
+
// src/pptx/core/builders/sdk/chart-layout-input.ts
|
|
3817
|
+
function allowedTypes(element) {
|
|
3818
|
+
return CLASSIC_TYPES.filter((type) => {
|
|
3819
|
+
const local = chartTypeToContainerLocalName(type);
|
|
3820
|
+
return local !== void 0 && chartContainerAllows(local, element);
|
|
3821
|
+
});
|
|
3822
|
+
}
|
|
3823
|
+
function drawnTypes(chartData) {
|
|
3824
|
+
if (chartData.chartType !== "combo") {
|
|
3825
|
+
return [chartData.chartType];
|
|
3826
|
+
}
|
|
3827
|
+
return chartData.series.map((s) => s.seriesChartType ?? chartData.chartType);
|
|
3828
|
+
}
|
|
3829
|
+
function validateValue(spec, name, value) {
|
|
3830
|
+
if (!Number.isInteger(value) || value < spec.min || value > spec.max) {
|
|
3831
|
+
throw new RangeError(
|
|
3832
|
+
`${name} must be an integer from ${spec.min} to ${spec.max} (${spec.schemaType}), got ${value}.`
|
|
3833
|
+
);
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
function applyChartGroupOptionsInput(chartData, input) {
|
|
3837
|
+
for (const spec of CHART_GROUP_OPTIONS) {
|
|
3838
|
+
const name = INPUT_KEYS[spec.element];
|
|
3839
|
+
const value = input[name];
|
|
3840
|
+
if (value === void 0) {
|
|
3841
|
+
continue;
|
|
3842
|
+
}
|
|
3843
|
+
if (value === null) {
|
|
3844
|
+
delete chartData[spec.field];
|
|
3845
|
+
continue;
|
|
3846
|
+
}
|
|
3847
|
+
validateValue(spec, name, value);
|
|
3848
|
+
const types = drawnTypes(chartData);
|
|
3849
|
+
const allowed = allowedTypes(spec.element);
|
|
3850
|
+
if (!types.some((type) => allowed.includes(type))) {
|
|
3851
|
+
throw new Error(
|
|
3852
|
+
`${name} applies to ${allowed.join(", ")} charts; this chart is drawn as "${types.join('", "')}".`
|
|
3853
|
+
);
|
|
3854
|
+
}
|
|
3855
|
+
chartData[spec.field] = value;
|
|
3856
|
+
if (spec.element === "gapWidth" && chartData.ofPieOptions) {
|
|
3857
|
+
chartData.ofPieOptions.gapWidth = value;
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
function toPaint(value, name) {
|
|
3862
|
+
const trimmed = value.trim();
|
|
3863
|
+
if (trimmed === "none") {
|
|
3864
|
+
return "none";
|
|
3865
|
+
}
|
|
3866
|
+
if (!HEX_COLOR2.test(trimmed)) {
|
|
3867
|
+
throw new Error(`${name} must be a 6-digit hex colour or 'none', got "${value}".`);
|
|
3868
|
+
}
|
|
3869
|
+
return `#${trimmed.replace(/^#/u, "").toUpperCase()}`;
|
|
3870
|
+
}
|
|
3871
|
+
function applyChartAreaFormatInput(chartData, area, input) {
|
|
3872
|
+
const style = chartData.style ??= {};
|
|
3873
|
+
const fillKey = area === "chart" ? "chartAreaFill" : "plotAreaFill";
|
|
3874
|
+
const gradientKey = area === "chart" ? "chartAreaGradient" : "plotAreaGradient";
|
|
3875
|
+
const borderKey = area === "chart" ? "chartAreaBorder" : "plotAreaBorder";
|
|
3876
|
+
if (input === null) {
|
|
3877
|
+
delete style[fillKey];
|
|
3878
|
+
delete style[gradientKey];
|
|
3879
|
+
delete style[borderKey];
|
|
3880
|
+
if (area === "chart") {
|
|
3881
|
+
delete chartData.roundedCorners;
|
|
3882
|
+
}
|
|
3883
|
+
return;
|
|
3884
|
+
}
|
|
3885
|
+
if (input.roundedCorners !== void 0 && area !== "chart") {
|
|
3886
|
+
throw new Error("roundedCorners applies to the chart area only.");
|
|
3887
|
+
}
|
|
3888
|
+
if (input.fill !== void 0) {
|
|
3889
|
+
delete style[fillKey];
|
|
3890
|
+
delete style[gradientKey];
|
|
3891
|
+
if (typeof input.fill === "string") {
|
|
3892
|
+
style[fillKey] = toPaint(input.fill, "fill");
|
|
3893
|
+
} else if (input.fill !== null) {
|
|
3894
|
+
style[gradientKey] = toChartGradientFill(input.fill);
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3897
|
+
if (input.border !== void 0) {
|
|
3898
|
+
if (input.border === null) {
|
|
3899
|
+
delete style[borderKey];
|
|
3900
|
+
} else {
|
|
3901
|
+
style[borderKey] = toPaint(input.border, "border");
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
if (input.roundedCorners !== void 0) {
|
|
3905
|
+
if (input.roundedCorners === null) {
|
|
3906
|
+
delete chartData.roundedCorners;
|
|
3907
|
+
} else {
|
|
3908
|
+
chartData.roundedCorners = input.roundedCorners;
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
var INPUT_KEYS, CLASSIC_TYPES, HEX_COLOR2;
|
|
3913
|
+
var init_chart_layout_input = __esm({
|
|
3914
|
+
"src/pptx/core/builders/sdk/chart-layout-input.ts"() {
|
|
3915
|
+
init_chart_group_options();
|
|
3916
|
+
init_chart_container_content_model();
|
|
3917
|
+
init_chart_gradient_input();
|
|
3918
|
+
INPUT_KEYS = {
|
|
3919
|
+
gapWidth: "gapWidth",
|
|
3920
|
+
overlap: "overlap",
|
|
3921
|
+
firstSliceAng: "firstSliceAngle",
|
|
3922
|
+
holeSize: "holeSize"
|
|
3923
|
+
};
|
|
3924
|
+
CLASSIC_TYPES = [
|
|
3925
|
+
"bar",
|
|
3926
|
+
"bar3D",
|
|
3927
|
+
"line",
|
|
3928
|
+
"line3D",
|
|
3929
|
+
"pie",
|
|
3930
|
+
"pie3D",
|
|
3931
|
+
"ofPie",
|
|
3932
|
+
"doughnut",
|
|
3933
|
+
"area",
|
|
3934
|
+
"area3D",
|
|
3935
|
+
"scatter",
|
|
3936
|
+
"bubble",
|
|
3937
|
+
"radar",
|
|
3938
|
+
"stock",
|
|
3939
|
+
"surface"
|
|
3940
|
+
];
|
|
3941
|
+
HEX_COLOR2 = /^#?[0-9a-f]{6}$/iu;
|
|
3942
|
+
}
|
|
3943
|
+
});
|
|
3944
|
+
|
|
3945
|
+
// src/pptx/core/builders/sdk/chart-operations.ts
|
|
3946
|
+
function ensureChartData(element) {
|
|
3947
|
+
if (!element.chartData) {
|
|
3948
|
+
throw new Error(
|
|
3949
|
+
"Chart element has no chartData. Cannot perform chart operations on an uninitialised chart."
|
|
3950
|
+
);
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
function validateSeriesIndex(element, seriesIndex) {
|
|
3954
|
+
ensureChartData(element);
|
|
3955
|
+
if (seriesIndex < 0 || seriesIndex >= element.chartData.series.length) {
|
|
3956
|
+
throw new RangeError(
|
|
3957
|
+
`Series index ${seriesIndex} is out of range. Chart has ${element.chartData.series.length} series (indices 0\u2013${element.chartData.series.length - 1}).`
|
|
3958
|
+
);
|
|
3959
|
+
}
|
|
3960
|
+
}
|
|
3961
|
+
function setChartType(element, newType) {
|
|
3962
|
+
ensureChartData(element);
|
|
3963
|
+
element.chartData.chartType = newType;
|
|
3964
|
+
}
|
|
3965
|
+
function addChartSeries(element, series) {
|
|
3966
|
+
ensureChartData(element);
|
|
3967
|
+
element.chartData.series.push({
|
|
3968
|
+
name: series.name,
|
|
3969
|
+
values: series.values,
|
|
3970
|
+
color: series.color
|
|
3971
|
+
});
|
|
3972
|
+
}
|
|
3973
|
+
function removeChartSeries(element, seriesIndex) {
|
|
3974
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3975
|
+
element.chartData.series.splice(seriesIndex, 1);
|
|
3976
|
+
}
|
|
3977
|
+
function setChartCategories(element, categories) {
|
|
3978
|
+
ensureChartData(element);
|
|
3979
|
+
element.chartData.categories = categories;
|
|
3980
|
+
}
|
|
3981
|
+
function updateChartSeriesValues(element, seriesIndex, values) {
|
|
3982
|
+
validateSeriesIndex(element, seriesIndex);
|
|
3983
|
+
element.chartData.series[seriesIndex].values = values;
|
|
3984
|
+
}
|
|
3985
|
+
function setChartTitle(element, title) {
|
|
3986
|
+
ensureChartData(element);
|
|
3987
|
+
element.chartData.title = title;
|
|
3988
|
+
}
|
|
3989
|
+
function setChartGrouping(element, grouping) {
|
|
3990
|
+
ensureChartData(element);
|
|
3991
|
+
element.chartData.grouping = grouping;
|
|
3992
|
+
}
|
|
3993
|
+
function setChartLegend(element, options) {
|
|
3994
|
+
ensureChartData(element);
|
|
3995
|
+
const style = element.chartData.style ??= {};
|
|
3996
|
+
if (options.show !== void 0) {
|
|
3997
|
+
style.hasLegend = options.show;
|
|
3998
|
+
}
|
|
3999
|
+
if (options.position !== void 0) {
|
|
4000
|
+
style.legendPosition = options.position;
|
|
4001
|
+
if (style.hasLegend === void 0) {
|
|
4002
|
+
style.hasLegend = true;
|
|
4003
|
+
}
|
|
4004
|
+
}
|
|
4005
|
+
}
|
|
4006
|
+
function setChartDataLabels(element, edit) {
|
|
4007
|
+
ensureChartData(element);
|
|
4008
|
+
const style = element.chartData.style ??= {};
|
|
4009
|
+
if (edit.show !== void 0) {
|
|
4010
|
+
style.hasDataLabels = edit.show;
|
|
4011
|
+
const labels = style.dataLabels;
|
|
4012
|
+
const anyContent = labels?.showValue === true || labels?.showCategory === true || labels?.showSeriesName === true || labels?.showPercent === true || labels?.showBubbleSize === true;
|
|
4013
|
+
if (edit.show && labels !== void 0 && !anyContent && edit.showValue === void 0) {
|
|
4014
|
+
labels.showValue = true;
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
4017
|
+
const contentKeys = [
|
|
4018
|
+
"showValue",
|
|
4019
|
+
"showCategory",
|
|
4020
|
+
"showSeriesName",
|
|
4021
|
+
"showPercent",
|
|
4022
|
+
"showLegendKey"
|
|
4023
|
+
];
|
|
4024
|
+
const hasContentEdit = contentKeys.some((k) => edit[k] !== void 0) || edit.position !== void 0;
|
|
4025
|
+
if (hasContentEdit) {
|
|
4026
|
+
const opts = style.dataLabels ??= {};
|
|
4027
|
+
for (const k of contentKeys) {
|
|
4028
|
+
if (edit[k] !== void 0) {
|
|
4029
|
+
opts[k] = edit[k];
|
|
4030
|
+
}
|
|
4031
|
+
}
|
|
4032
|
+
if (edit.position !== void 0) {
|
|
4033
|
+
opts.position = edit.position || void 0;
|
|
4034
|
+
}
|
|
4035
|
+
if (style.hasDataLabels === void 0) {
|
|
4036
|
+
style.hasDataLabels = true;
|
|
4037
|
+
}
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
function setChartSeriesTrendline(element, seriesIndex, trendline) {
|
|
4041
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4042
|
+
element.chartData.series[seriesIndex].trendlines = trendline ? [trendline] : [];
|
|
4043
|
+
}
|
|
4044
|
+
function setChartSeriesErrorBars(element, seriesIndex, errBars) {
|
|
4045
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4046
|
+
element.chartData.series[seriesIndex].errBars = errBars ? [errBars] : [];
|
|
4047
|
+
}
|
|
4048
|
+
function setChartAxis(element, axisType, edit) {
|
|
4049
|
+
ensureChartData(element);
|
|
4050
|
+
const axes = element.chartData.axes ??= [];
|
|
4051
|
+
let axis = axes.find((a) => a.axisType === axisType);
|
|
4052
|
+
if (!axis) {
|
|
4053
|
+
axis = { axisType };
|
|
4054
|
+
axes.push(axis);
|
|
4055
|
+
}
|
|
4056
|
+
if (edit.min !== void 0) {
|
|
4057
|
+
axis.min = edit.min ?? void 0;
|
|
4058
|
+
}
|
|
4059
|
+
if (edit.max !== void 0) {
|
|
4060
|
+
axis.max = edit.max ?? void 0;
|
|
4061
|
+
}
|
|
4062
|
+
if (edit.majorUnit !== void 0) {
|
|
4063
|
+
axis.majorUnit = edit.majorUnit ?? void 0;
|
|
4064
|
+
}
|
|
4065
|
+
if (edit.minorUnit !== void 0) {
|
|
4066
|
+
axis.minorUnit = edit.minorUnit ?? void 0;
|
|
4067
|
+
}
|
|
4068
|
+
if (edit.orientation !== void 0) {
|
|
4069
|
+
axis.orientation = edit.orientation ?? void 0;
|
|
4070
|
+
}
|
|
4071
|
+
if (edit.numberFormat !== void 0) {
|
|
4072
|
+
axis.numFmt = edit.numberFormat ? { formatCode: edit.numberFormat, sourceLinked: false } : void 0;
|
|
4073
|
+
}
|
|
4074
|
+
if (edit.tickLabelPosition !== void 0) {
|
|
4075
|
+
axis.tickLblPos = edit.tickLabelPosition;
|
|
4076
|
+
}
|
|
4077
|
+
if (edit.title !== void 0) {
|
|
4078
|
+
axis.titleText = edit.title ?? "";
|
|
4079
|
+
}
|
|
4080
|
+
if (edit.majorGridlines !== void 0) {
|
|
4081
|
+
axis.majorGridlines = edit.majorGridlines;
|
|
4082
|
+
}
|
|
4083
|
+
if (edit.minorGridlines !== void 0) {
|
|
4084
|
+
axis.minorGridlines = edit.minorGridlines;
|
|
4085
|
+
}
|
|
4086
|
+
if (edit.displayUnits !== void 0) {
|
|
4087
|
+
axis.displayUnits = edit.displayUnits ?? void 0;
|
|
4088
|
+
}
|
|
4089
|
+
if (edit.displayUnitsValue !== void 0) {
|
|
4090
|
+
axis.displayUnitsValue = edit.displayUnitsValue ?? void 0;
|
|
4091
|
+
}
|
|
4092
|
+
if (edit.displayUnitsLabel !== void 0) {
|
|
4093
|
+
axis.displayUnitsLabel = edit.displayUnitsLabel;
|
|
4094
|
+
}
|
|
4095
|
+
if (edit.visible !== void 0) {
|
|
4096
|
+
axis.deleted = !edit.visible;
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
4099
|
+
function updateChartDataPoint(element, seriesIndex, pointIndex, value) {
|
|
4100
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4101
|
+
const series = element.chartData.series[seriesIndex];
|
|
4102
|
+
if (pointIndex < 0 || pointIndex >= series.values.length) {
|
|
4103
|
+
throw new RangeError(
|
|
4104
|
+
`Point index ${pointIndex} is out of range. Series "${series.name}" has ${series.values.length} data points (indices 0\u2013${series.values.length - 1}).`
|
|
4105
|
+
);
|
|
4106
|
+
}
|
|
4107
|
+
series.values[pointIndex] = value;
|
|
4108
|
+
}
|
|
4109
|
+
function addChartCategory(element, categoryName) {
|
|
4110
|
+
ensureChartData(element);
|
|
4111
|
+
element.chartData.categories.push(categoryName);
|
|
4112
|
+
for (const series of element.chartData.series) {
|
|
4113
|
+
series.values.push(0);
|
|
4114
|
+
}
|
|
4115
|
+
}
|
|
4116
|
+
function removeChartCategory(element, categoryIndex) {
|
|
4117
|
+
ensureChartData(element);
|
|
4118
|
+
if (categoryIndex < 0 || categoryIndex >= element.chartData.categories.length) {
|
|
4119
|
+
throw new RangeError(
|
|
4120
|
+
`Category index ${categoryIndex} is out of range. Chart has ${element.chartData.categories.length} categories (indices 0\u2013${element.chartData.categories.length - 1}).`
|
|
4121
|
+
);
|
|
4122
|
+
}
|
|
4123
|
+
element.chartData.categories.splice(categoryIndex, 1);
|
|
4124
|
+
for (const series of element.chartData.series) {
|
|
4125
|
+
series.values.splice(categoryIndex, 1);
|
|
4126
|
+
}
|
|
4127
|
+
}
|
|
4128
|
+
function setChartSeriesColor(element, seriesIndex, color2) {
|
|
4129
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4130
|
+
const series = element.chartData.series[seriesIndex];
|
|
4131
|
+
delete series.gradientFill;
|
|
4132
|
+
if (!color2) {
|
|
4133
|
+
series.color = void 0;
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
const trimmed = color2.trim();
|
|
4137
|
+
series.color = trimmed.startsWith("#") ? trimmed : `#${trimmed}`;
|
|
4138
|
+
}
|
|
4139
|
+
function ensureAxis(element, axisType) {
|
|
4140
|
+
ensureChartData(element);
|
|
4141
|
+
const axes = element.chartData.axes ??= [];
|
|
4142
|
+
let axis = axes.find((a) => a.axisType === axisType);
|
|
4143
|
+
if (!axis) {
|
|
4144
|
+
axis = { axisType };
|
|
4145
|
+
axes.push(axis);
|
|
4146
|
+
}
|
|
4147
|
+
return axis;
|
|
4148
|
+
}
|
|
4149
|
+
function setChartAxisLogScale(element, axisType, opts) {
|
|
4150
|
+
const axis = ensureAxis(element, axisType);
|
|
4151
|
+
axis.logScale = opts.enabled;
|
|
4152
|
+
if (opts.enabled) {
|
|
4153
|
+
axis.logBase = opts.base ?? axis.logBase ?? 10;
|
|
4154
|
+
} else {
|
|
4155
|
+
axis.logBase = void 0;
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
4158
|
+
function setChartAxisTitleStyle(element, axisType, edit) {
|
|
4159
|
+
const axis = ensureAxis(element, axisType);
|
|
4160
|
+
if (edit.fontFamily !== void 0) {
|
|
4161
|
+
axis.fontFamily = edit.fontFamily ?? void 0;
|
|
4162
|
+
}
|
|
4163
|
+
if (edit.fontSize !== void 0) {
|
|
4164
|
+
axis.fontSize = edit.fontSize ?? void 0;
|
|
4165
|
+
}
|
|
4166
|
+
if (edit.fontBold !== void 0) {
|
|
4167
|
+
axis.fontBold = edit.fontBold;
|
|
4168
|
+
}
|
|
4169
|
+
if (edit.fontColor !== void 0) {
|
|
4170
|
+
axis.fontColor = edit.fontColor ?? void 0;
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
function setChartAxisGridlineStyle(element, axisType, which, edit) {
|
|
4174
|
+
const axis = ensureAxis(element, axisType);
|
|
4175
|
+
const key2 = which === "major" ? "majorGridlinesSpPr" : "minorGridlinesSpPr";
|
|
4176
|
+
const flagKey = which === "major" ? "majorGridlines" : "minorGridlines";
|
|
4177
|
+
const props = { ...axis[key2] ?? {} };
|
|
4178
|
+
if (edit.color !== void 0) {
|
|
4179
|
+
props.strokeColor = edit.color ?? void 0;
|
|
4180
|
+
}
|
|
4181
|
+
if (edit.width !== void 0) {
|
|
4182
|
+
props.strokeWidth = edit.width ?? void 0;
|
|
4183
|
+
}
|
|
4184
|
+
if (edit.dashStyle !== void 0) {
|
|
4185
|
+
props.strokeDashStyle = edit.dashStyle ?? void 0;
|
|
4186
|
+
}
|
|
4187
|
+
const hasAnyProp = props.strokeColor !== void 0 || props.strokeWidth !== void 0 || props.strokeDashStyle !== void 0 || props.fillColor !== void 0;
|
|
4188
|
+
axis[key2] = hasAnyProp ? props : void 0;
|
|
4189
|
+
if (hasAnyProp) {
|
|
4190
|
+
axis[flagKey] = true;
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
function setChartSeriesMarker(element, seriesIndex, marker) {
|
|
4194
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4195
|
+
const series = element.chartData.series[seriesIndex];
|
|
4196
|
+
if (marker === null) {
|
|
4197
|
+
series.marker = void 0;
|
|
4198
|
+
return;
|
|
4199
|
+
}
|
|
4200
|
+
const existing = series.marker;
|
|
4201
|
+
if ("symbol" in marker && "spPr" in marker) {
|
|
4202
|
+
series.marker = marker;
|
|
4203
|
+
return;
|
|
4204
|
+
}
|
|
4205
|
+
const patch = marker;
|
|
4206
|
+
const next = {
|
|
4207
|
+
symbol: patch.symbol ?? existing?.symbol ?? "circle",
|
|
4208
|
+
size: patch.size ?? existing?.size,
|
|
4209
|
+
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
4210
|
+
};
|
|
4211
|
+
if (patch.fillColor !== void 0) {
|
|
4212
|
+
next.spPr = { ...next.spPr ?? {}, fillColor: patch.fillColor };
|
|
4213
|
+
}
|
|
4214
|
+
series.marker = next;
|
|
4215
|
+
}
|
|
4216
|
+
function setChartSeriesChartType(element, seriesIndex, seriesType) {
|
|
4217
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4218
|
+
const data = element.chartData;
|
|
4219
|
+
data.series[seriesIndex].seriesChartType = seriesType ?? void 0;
|
|
4220
|
+
const effective = new Set(
|
|
4221
|
+
data.series.map((s) => s.seriesChartType ?? data.chartType).filter((t) => t !== "combo")
|
|
4222
|
+
);
|
|
4223
|
+
if (effective.size > 1) {
|
|
4224
|
+
data.chartType = "combo";
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
function ensureDataPoint(series, pointIndex) {
|
|
4228
|
+
const points4 = series.dataPoints ??= [];
|
|
4229
|
+
let dp = points4.find((p) => p.idx === pointIndex);
|
|
4230
|
+
if (!dp) {
|
|
4231
|
+
dp = { idx: pointIndex };
|
|
4232
|
+
points4.push(dp);
|
|
4233
|
+
points4.sort((a, b) => a.idx - b.idx);
|
|
4234
|
+
}
|
|
4235
|
+
return dp;
|
|
4236
|
+
}
|
|
4237
|
+
function setChartDataPointFill(element, seriesIndex, pointIndex, color2) {
|
|
4238
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4239
|
+
const series = element.chartData.series[seriesIndex];
|
|
4240
|
+
if (color2 === null) {
|
|
4241
|
+
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
4242
|
+
if (!dp2) {
|
|
4243
|
+
return;
|
|
4244
|
+
}
|
|
4245
|
+
if (dp2.spPr) {
|
|
4246
|
+
dp2.spPr = { ...dp2.spPr, fillColor: void 0 };
|
|
4247
|
+
if (dp2.spPr.fillColor === void 0 && dp2.spPr.strokeColor === void 0 && dp2.spPr.strokeWidth === void 0 && dp2.spPr.strokeDashStyle === void 0) {
|
|
4248
|
+
dp2.spPr = void 0;
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
removeEmptyDataPoint(series, pointIndex);
|
|
4252
|
+
return;
|
|
4253
|
+
}
|
|
4254
|
+
const dp = ensureDataPoint(series, pointIndex);
|
|
4255
|
+
dp.spPr = { ...dp.spPr ?? {}, fillColor: color2 };
|
|
4256
|
+
delete dp.gradientFill;
|
|
4257
|
+
}
|
|
4258
|
+
function setChartDataPointExplosion(element, seriesIndex, pointIndex, explosion) {
|
|
4259
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4260
|
+
const series = element.chartData.series[seriesIndex];
|
|
4261
|
+
if (explosion === null) {
|
|
4262
|
+
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
4263
|
+
if (dp2) {
|
|
4264
|
+
dp2.explosion = void 0;
|
|
4265
|
+
removeEmptyDataPoint(series, pointIndex);
|
|
4266
|
+
}
|
|
4267
|
+
return;
|
|
4268
|
+
}
|
|
4269
|
+
const dp = ensureDataPoint(series, pointIndex);
|
|
4270
|
+
dp.explosion = explosion;
|
|
4271
|
+
}
|
|
4272
|
+
function setChartDataPointMarker(element, seriesIndex, pointIndex, marker) {
|
|
4273
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4274
|
+
const series = element.chartData.series[seriesIndex];
|
|
4275
|
+
if (marker === null) {
|
|
4276
|
+
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
4277
|
+
if (dp2) {
|
|
4278
|
+
dp2.marker = void 0;
|
|
4279
|
+
removeEmptyDataPoint(series, pointIndex);
|
|
4280
|
+
}
|
|
4281
|
+
return;
|
|
4282
|
+
}
|
|
4283
|
+
const dp = ensureDataPoint(series, pointIndex);
|
|
4284
|
+
const existing = dp.marker;
|
|
4285
|
+
const next = {
|
|
4286
|
+
symbol: marker.symbol ?? existing?.symbol ?? "circle",
|
|
4287
|
+
size: marker.size ?? existing?.size,
|
|
4288
|
+
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
4289
|
+
};
|
|
4290
|
+
if (marker.fillColor !== void 0) {
|
|
4291
|
+
next.spPr = { ...next.spPr ?? {}, fillColor: marker.fillColor };
|
|
4292
|
+
}
|
|
4293
|
+
dp.marker = next;
|
|
4294
|
+
}
|
|
4295
|
+
function applyLabelEdit(label, edit) {
|
|
4296
|
+
if (edit.showValue !== void 0) {
|
|
4297
|
+
label.showVal = edit.showValue;
|
|
4298
|
+
}
|
|
4299
|
+
if (edit.showCategory !== void 0) {
|
|
4300
|
+
label.showCatName = edit.showCategory;
|
|
4301
|
+
}
|
|
4302
|
+
if (edit.showSeriesName !== void 0) {
|
|
4303
|
+
label.showSerName = edit.showSeriesName;
|
|
4304
|
+
}
|
|
4305
|
+
if (edit.showPercent !== void 0) {
|
|
4306
|
+
label.showPercent = edit.showPercent;
|
|
4307
|
+
}
|
|
4308
|
+
if (edit.showLegendKey !== void 0) {
|
|
4309
|
+
label.showLegendKey = edit.showLegendKey;
|
|
4310
|
+
}
|
|
4311
|
+
if (edit.position !== void 0) {
|
|
4312
|
+
label.position = edit.position;
|
|
4313
|
+
}
|
|
4314
|
+
if (edit.text !== void 0) {
|
|
4315
|
+
label.text = edit.text === "" ? void 0 : edit.text;
|
|
4316
|
+
}
|
|
4317
|
+
if (edit.spPr !== void 0) {
|
|
4318
|
+
label.spPr = edit.spPr === null ? void 0 : { ...label.spPr ?? {}, ...edit.spPr };
|
|
4319
|
+
}
|
|
4320
|
+
if (edit.txPr !== void 0) {
|
|
4321
|
+
label.txPr = edit.txPr === null ? void 0 : { ...label.txPr ?? {}, ...edit.txPr };
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
function setChartDataPointLabel(element, seriesIndex, pointIndex, edit) {
|
|
4325
|
+
validateSeriesIndex(element, seriesIndex);
|
|
4326
|
+
const series = element.chartData.series[seriesIndex];
|
|
4327
|
+
if (edit === null) {
|
|
4328
|
+
if (!series.dataLabels) {
|
|
4329
|
+
return;
|
|
4330
|
+
}
|
|
4331
|
+
series.dataLabels = series.dataLabels.filter((l) => l.idx !== pointIndex);
|
|
4332
|
+
if (series.dataLabels.length === 0) {
|
|
4333
|
+
series.dataLabels = void 0;
|
|
4334
|
+
}
|
|
4335
|
+
return;
|
|
4336
|
+
}
|
|
4337
|
+
const labels = series.dataLabels ??= [];
|
|
4338
|
+
let label = labels.find((l) => l.idx === pointIndex);
|
|
4339
|
+
if (!label) {
|
|
4340
|
+
label = { idx: pointIndex };
|
|
4341
|
+
labels.push(label);
|
|
4342
|
+
labels.sort((a, b) => a.idx - b.idx);
|
|
4343
|
+
}
|
|
4344
|
+
applyLabelEdit(label, edit);
|
|
4345
|
+
}
|
|
4346
|
+
function removeEmptyDataPoint(series, pointIndex) {
|
|
4347
|
+
if (!series.dataPoints) {
|
|
4348
|
+
return;
|
|
4349
|
+
}
|
|
4350
|
+
const dp = series.dataPoints.find((p) => p.idx === pointIndex);
|
|
4351
|
+
if (!dp) {
|
|
4352
|
+
return;
|
|
4353
|
+
}
|
|
4354
|
+
const empty = dp.spPr === void 0 && dp.gradientFill === void 0 && dp.explosion === void 0 && dp.invertIfNegative === void 0 && dp.bubble3D === void 0 && dp.marker === void 0;
|
|
4355
|
+
if (empty) {
|
|
4356
|
+
series.dataPoints = series.dataPoints.filter((p) => p.idx !== pointIndex);
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
var init_chart_operations = __esm({
|
|
4360
|
+
"src/pptx/core/builders/sdk/chart-operations.ts"() {
|
|
4361
|
+
}
|
|
4362
|
+
});
|
|
4363
|
+
|
|
4364
|
+
// src/pptx/core/builders/sdk/chart-layout-operations.ts
|
|
4365
|
+
function setChartGroupOptions(element, options) {
|
|
4366
|
+
ensureChartData(element);
|
|
4367
|
+
applyChartGroupOptionsInput(element.chartData, options);
|
|
4368
|
+
}
|
|
4369
|
+
function setChartAreaFormat(element, area, format) {
|
|
4370
|
+
ensureChartData(element);
|
|
4371
|
+
applyChartAreaFormatInput(element.chartData, area, format);
|
|
4372
|
+
}
|
|
4373
|
+
function applyChartInputLayout(element, input) {
|
|
4374
|
+
setChartGroupOptions(element, {
|
|
4375
|
+
...input.gapWidth !== void 0 ? { gapWidth: input.gapWidth } : {},
|
|
4376
|
+
...input.overlap !== void 0 ? { overlap: input.overlap } : {},
|
|
4377
|
+
...input.firstSliceAngle !== void 0 ? { firstSliceAngle: input.firstSliceAngle } : {},
|
|
4378
|
+
...input.holeSize !== void 0 ? { holeSize: input.holeSize } : {}
|
|
4379
|
+
});
|
|
4380
|
+
if (input.chartArea) {
|
|
4381
|
+
setChartAreaFormat(element, "chart", input.chartArea);
|
|
4382
|
+
}
|
|
4383
|
+
if (input.plotArea) {
|
|
4384
|
+
setChartAreaFormat(element, "plot", input.plotArea);
|
|
4385
|
+
}
|
|
4386
|
+
for (const [axisType, edit] of Object.entries(input.axes ?? {})) {
|
|
4387
|
+
if (edit) {
|
|
4388
|
+
setChartAxis(element, axisType, edit);
|
|
4389
|
+
}
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
var init_chart_layout_operations = __esm({
|
|
4393
|
+
"src/pptx/core/builders/sdk/chart-layout-operations.ts"() {
|
|
4394
|
+
init_chart_layout_input();
|
|
4395
|
+
init_chart_operations();
|
|
4396
|
+
}
|
|
4397
|
+
});
|
|
4398
|
+
|
|
3450
4399
|
// src/pptx/core/builders/sdk/ElementFactory.ts
|
|
3451
4400
|
function generateId(prefix) {
|
|
3452
4401
|
idCounter += 1;
|
|
@@ -3793,12 +4742,14 @@ function createChartElement(chartType, input, options) {
|
|
|
3793
4742
|
legendPosition: input.legendPosition
|
|
3794
4743
|
}
|
|
3795
4744
|
};
|
|
3796
|
-
|
|
4745
|
+
const element = {
|
|
3797
4746
|
type: "chart",
|
|
3798
4747
|
id: generateId("cht"),
|
|
3799
4748
|
...p,
|
|
3800
4749
|
chartData
|
|
3801
4750
|
};
|
|
4751
|
+
applyChartInputLayout(element, input);
|
|
4752
|
+
return element;
|
|
3802
4753
|
}
|
|
3803
4754
|
function createMediaElement(mediaType, source, options) {
|
|
3804
4755
|
const p = pos("media", options);
|
|
@@ -3864,6 +4815,7 @@ var init_ElementFactory = __esm({
|
|
|
3864
4815
|
init_table_style_defaults();
|
|
3865
4816
|
init_custom_geometry();
|
|
3866
4817
|
init_chart_gradient_input();
|
|
4818
|
+
init_chart_layout_operations();
|
|
3867
4819
|
idCounter = 0;
|
|
3868
4820
|
DEFAULTS = {
|
|
3869
4821
|
text: { x: 100, y: 100, width: 600, height: 50 },
|
|
@@ -20424,7 +21376,7 @@ function nsGet(obj, localName29) {
|
|
|
20424
21376
|
return obj[localName29];
|
|
20425
21377
|
}
|
|
20426
21378
|
for (const key2 of Object.keys(obj)) {
|
|
20427
|
-
if (
|
|
21379
|
+
if (localNameOf3(key2) === localName29 && !key2.startsWith("@_")) {
|
|
20428
21380
|
return obj[key2];
|
|
20429
21381
|
}
|
|
20430
21382
|
}
|
|
@@ -20436,13 +21388,13 @@ function nsAttr(obj, localName29) {
|
|
|
20436
21388
|
return direct;
|
|
20437
21389
|
}
|
|
20438
21390
|
for (const key2 of Object.keys(obj)) {
|
|
20439
|
-
if (key2.startsWith("@_") &&
|
|
21391
|
+
if (key2.startsWith("@_") && localNameOf3(key2.slice(2)) === localName29) {
|
|
20440
21392
|
return obj[key2];
|
|
20441
21393
|
}
|
|
20442
21394
|
}
|
|
20443
21395
|
return void 0;
|
|
20444
21396
|
}
|
|
20445
|
-
function
|
|
21397
|
+
function localNameOf3(key2) {
|
|
20446
21398
|
const colon = key2.indexOf(":");
|
|
20447
21399
|
return colon >= 0 ? key2.slice(colon + 1) : key2;
|
|
20448
21400
|
}
|
|
@@ -20462,7 +21414,7 @@ function collectByLocalName(node, localName29) {
|
|
|
20462
21414
|
if (key2.startsWith("@_") || key2 === "#text") {
|
|
20463
21415
|
continue;
|
|
20464
21416
|
}
|
|
20465
|
-
if (
|
|
21417
|
+
if (localNameOf3(key2) === localName29) {
|
|
20466
21418
|
for (const item of ensureArray(value)) {
|
|
20467
21419
|
found.push(item);
|
|
20468
21420
|
}
|
|
@@ -20518,7 +21470,7 @@ function resolveTiltMode(strokes) {
|
|
|
20518
21470
|
}
|
|
20519
21471
|
function buildInkMlContent(strokes, rawXml) {
|
|
20520
21472
|
const data = rawXml ? { ...rawXml } : {};
|
|
20521
|
-
const existingKey = Object.keys(data).find((key2) =>
|
|
21473
|
+
const existingKey = Object.keys(data).find((key2) => localNameOf4(key2) === "ink");
|
|
20522
21474
|
const existingRoot = existingKey ? data[existingKey] : void 0;
|
|
20523
21475
|
const root = existingRoot ? { ...existingRoot } : {};
|
|
20524
21476
|
root["@_xmlns:ink"] = INKML_NAMESPACE;
|
|
@@ -20563,13 +21515,13 @@ function deleteStaleInkChildren(root) {
|
|
|
20563
21515
|
if (key2.startsWith("ink:") || key2.startsWith("@_") || key2 === "#text") {
|
|
20564
21516
|
continue;
|
|
20565
21517
|
}
|
|
20566
|
-
const local =
|
|
21518
|
+
const local = localNameOf4(key2);
|
|
20567
21519
|
if (local === "trace" || local === "brush" || local === "traceGroup" || local === "definitions") {
|
|
20568
21520
|
delete root[key2];
|
|
20569
21521
|
}
|
|
20570
21522
|
}
|
|
20571
21523
|
}
|
|
20572
|
-
function
|
|
21524
|
+
function localNameOf4(key2) {
|
|
20573
21525
|
const colon = key2.indexOf(":");
|
|
20574
21526
|
return colon >= 0 ? key2.slice(colon + 1) : key2;
|
|
20575
21527
|
}
|
|
@@ -22077,7 +23029,7 @@ var init_xml_access = __esm({
|
|
|
22077
23029
|
});
|
|
22078
23030
|
|
|
22079
23031
|
// src/pptx/core/utils/chart-xlsx-sheet-cells.ts
|
|
22080
|
-
function
|
|
23032
|
+
function toArray2(value) {
|
|
22081
23033
|
if (Array.isArray(value)) {
|
|
22082
23034
|
return value;
|
|
22083
23035
|
}
|
|
@@ -22101,7 +23053,7 @@ function ensureCell(sheetData, ref) {
|
|
|
22101
23053
|
return void 0;
|
|
22102
23054
|
}
|
|
22103
23055
|
const rowNumber = address.row + 1;
|
|
22104
|
-
const rows =
|
|
23056
|
+
const rows = toArray2(sheetData["row"]);
|
|
22105
23057
|
let row = rows.find((r) => Number(r["@_r"]) === rowNumber);
|
|
22106
23058
|
if (!row) {
|
|
22107
23059
|
row = { "@_r": String(rowNumber), c: [] };
|
|
@@ -22113,7 +23065,7 @@ function ensureCell(sheetData, ref) {
|
|
|
22113
23065
|
}
|
|
22114
23066
|
sheetData["row"] = rows;
|
|
22115
23067
|
}
|
|
22116
|
-
const cells2 =
|
|
23068
|
+
const cells2 = toArray2(row["c"]);
|
|
22117
23069
|
let cell = cells2.find((c) => String(c["@_r"] ?? "") === ref);
|
|
22118
23070
|
if (!cell) {
|
|
22119
23071
|
cell = { "@_r": ref };
|
|
@@ -28499,7 +29451,7 @@ var init_smartart_layout_interpreter_choose_composite = __esm({
|
|
|
28499
29451
|
});
|
|
28500
29452
|
|
|
28501
29453
|
// src/pptx/core/utils/smartart-layout-interpreter-choose-algorithm.ts
|
|
28502
|
-
function branchAlg(raw, nodeCount, context,
|
|
29454
|
+
function branchAlg(raw, nodeCount, context, allowedTypes2 = CHOOSE_ALG_TYPES) {
|
|
28503
29455
|
if (!raw) {
|
|
28504
29456
|
return void 0;
|
|
28505
29457
|
}
|
|
@@ -28523,7 +29475,7 @@ function branchAlg(raw, nodeCount, context, allowedTypes = CHOOSE_ALG_TYPES) {
|
|
|
28523
29475
|
if (name === "alg") {
|
|
28524
29476
|
for (const candidate of Array.isArray(entry) ? entry : [entry]) {
|
|
28525
29477
|
const type = candidate && typeof candidate === "object" ? String(candidate["@_type"] ?? "") : "";
|
|
28526
|
-
if (
|
|
29478
|
+
if (allowedTypes2.has(type)) {
|
|
28527
29479
|
found = { type, raw: candidate };
|
|
28528
29480
|
return;
|
|
28529
29481
|
}
|
|
@@ -28604,7 +29556,7 @@ function chooseAlgorithm(node, nodeCount, context = {}) {
|
|
|
28604
29556
|
}
|
|
28605
29557
|
return void 0;
|
|
28606
29558
|
}
|
|
28607
|
-
function chooseAlgorithmOfType(node, nodeCount,
|
|
29559
|
+
function chooseAlgorithmOfType(node, nodeCount, allowedTypes2, context = {}) {
|
|
28608
29560
|
if (!node.choose || node.choose.length === 0) {
|
|
28609
29561
|
return void 0;
|
|
28610
29562
|
}
|
|
@@ -28613,7 +29565,7 @@ function chooseAlgorithmOfType(node, nodeCount, allowedTypes, context = {}) {
|
|
|
28613
29565
|
activeBranch(choose, nodeCount, context),
|
|
28614
29566
|
nodeCount,
|
|
28615
29567
|
context,
|
|
28616
|
-
|
|
29568
|
+
allowedTypes2
|
|
28617
29569
|
);
|
|
28618
29570
|
if (found) {
|
|
28619
29571
|
const parameters = parseBranchAlgParams(found.raw);
|
|
@@ -43162,7 +44114,7 @@ var init_smartart_node_style_apply = __esm({
|
|
|
43162
44114
|
});
|
|
43163
44115
|
|
|
43164
44116
|
// src/pptx/core/utils/smartart-pres-layout-vars.ts
|
|
43165
|
-
function
|
|
44117
|
+
function localNameOf5(key2) {
|
|
43166
44118
|
const idx = key2.indexOf(":");
|
|
43167
44119
|
return idx >= 0 ? key2.slice(idx + 1) : key2;
|
|
43168
44120
|
}
|
|
@@ -43183,7 +44135,7 @@ function findVarsContainer(node) {
|
|
|
43183
44135
|
if (key2.startsWith("@_")) {
|
|
43184
44136
|
continue;
|
|
43185
44137
|
}
|
|
43186
|
-
if (CONTAINER_LOCAL_NAMES.has(
|
|
44138
|
+
if (CONTAINER_LOCAL_NAMES.has(localNameOf5(key2))) {
|
|
43187
44139
|
const container2 = Array.isArray(value) ? value[0] : value;
|
|
43188
44140
|
if (container2 && typeof container2 === "object") {
|
|
43189
44141
|
return container2;
|
|
@@ -43198,7 +44150,7 @@ function findVarsContainer(node) {
|
|
|
43198
44150
|
}
|
|
43199
44151
|
function presNameOf(pt2) {
|
|
43200
44152
|
for (const [key2, value] of Object.entries(pt2)) {
|
|
43201
|
-
if (key2.startsWith("@_") ||
|
|
44153
|
+
if (key2.startsWith("@_") || localNameOf5(key2) !== "prSet") {
|
|
43202
44154
|
continue;
|
|
43203
44155
|
}
|
|
43204
44156
|
const prSet = Array.isArray(value) ? value[0] : value;
|
|
@@ -43226,7 +44178,7 @@ function findNamedPresVars(node, presName) {
|
|
|
43226
44178
|
if (key2.startsWith("@_")) {
|
|
43227
44179
|
continue;
|
|
43228
44180
|
}
|
|
43229
|
-
if (
|
|
44181
|
+
if (localNameOf5(key2) === "pt") {
|
|
43230
44182
|
for (const pt2 of Array.isArray(value) ? value : [value]) {
|
|
43231
44183
|
if (pt2 && typeof pt2 === "object" && presNameOf(pt2) === presName) {
|
|
43232
44184
|
const vars = findVarsContainer(pt2);
|
|
@@ -43245,7 +44197,7 @@ function findNamedPresVars(node, presName) {
|
|
|
43245
44197
|
}
|
|
43246
44198
|
function varValue(container2, name) {
|
|
43247
44199
|
for (const [key2, value] of Object.entries(container2)) {
|
|
43248
|
-
if (key2.startsWith("@_") ||
|
|
44200
|
+
if (key2.startsWith("@_") || localNameOf5(key2) !== name) {
|
|
43249
44201
|
continue;
|
|
43250
44202
|
}
|
|
43251
44203
|
const node = Array.isArray(value) ? value[0] : value;
|
|
@@ -44483,7 +45435,7 @@ var init_smartart_effect_intensity = __esm({
|
|
|
44483
45435
|
});
|
|
44484
45436
|
|
|
44485
45437
|
// src/pptx/core/utils/smartart-color-lists.ts
|
|
44486
|
-
function
|
|
45438
|
+
function localNameOf6(key2) {
|
|
44487
45439
|
const idx = key2.indexOf(":");
|
|
44488
45440
|
return idx >= 0 ? key2.slice(idx + 1) : key2;
|
|
44489
45441
|
}
|
|
@@ -44496,7 +45448,7 @@ function parseSmartArtColorListHexes(list2, deps) {
|
|
|
44496
45448
|
if (key2.startsWith("@_")) {
|
|
44497
45449
|
continue;
|
|
44498
45450
|
}
|
|
44499
|
-
const local =
|
|
45451
|
+
const local = localNameOf6(key2);
|
|
44500
45452
|
if (!COLOR_LOCAL_NAMES.has(local)) {
|
|
44501
45453
|
continue;
|
|
44502
45454
|
}
|
|
@@ -49488,7 +50440,7 @@ var init_chart_shape_props_writer = __esm({
|
|
|
49488
50440
|
});
|
|
49489
50441
|
|
|
49490
50442
|
// src/pptx/core/utils/chart-marker-serializer.ts
|
|
49491
|
-
function
|
|
50443
|
+
function findKey4(obj, local, getLocalName2) {
|
|
49492
50444
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
49493
50445
|
}
|
|
49494
50446
|
function insertOrdered(seriesNode, key2, value, getLocalName2) {
|
|
@@ -49522,7 +50474,7 @@ function buildChartMarkerXml(existing, marker, getLocalName2, resolveColor2) {
|
|
|
49522
50474
|
if (marker.size !== void 0) {
|
|
49523
50475
|
node["c:size"] = { "@_val": String(marker.size) };
|
|
49524
50476
|
}
|
|
49525
|
-
const existingSpPr = existing ? existing[
|
|
50477
|
+
const existingSpPr = existing ? existing[findKey4(existing, "spPr", getLocalName2) ?? ""] : void 0;
|
|
49526
50478
|
const spPr = buildMarkerSpPr(existingSpPr, marker, getLocalName2, resolveColor2);
|
|
49527
50479
|
if (spPr) {
|
|
49528
50480
|
node["c:spPr"] = spPr;
|
|
@@ -49538,7 +50490,7 @@ function buildChartMarkerXml(existing, marker, getLocalName2, resolveColor2) {
|
|
|
49538
50490
|
return node;
|
|
49539
50491
|
}
|
|
49540
50492
|
function applySeriesMarkerToXml(seriesNode, marker, getLocalName2, resolveColor2) {
|
|
49541
|
-
const existingKey =
|
|
50493
|
+
const existingKey = findKey4(seriesNode, "marker", getLocalName2);
|
|
49542
50494
|
if (!marker) {
|
|
49543
50495
|
if (existingKey) {
|
|
49544
50496
|
delete seriesNode[existingKey];
|
|
@@ -49575,7 +50527,7 @@ var init_chart_marker_serializer = __esm({
|
|
|
49575
50527
|
});
|
|
49576
50528
|
|
|
49577
50529
|
// src/pptx/core/utils/chart-datapoint-serializer.ts
|
|
49578
|
-
function
|
|
50530
|
+
function findKey5(obj, local, getLocalName2) {
|
|
49579
50531
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
49580
50532
|
}
|
|
49581
50533
|
function ensureArray2(v) {
|
|
@@ -49614,7 +50566,7 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
49614
50566
|
if (dp.invertIfNegative !== void 0) {
|
|
49615
50567
|
node["c:invertIfNegative"] = { "@_val": dp.invertIfNegative ? "1" : "0" };
|
|
49616
50568
|
}
|
|
49617
|
-
const existingMarker = existing ? existing[
|
|
50569
|
+
const existingMarker = existing ? existing[findKey5(existing, "marker", getLocalName2) ?? ""] : void 0;
|
|
49618
50570
|
if (dp.marker) {
|
|
49619
50571
|
node["c:marker"] = buildChartMarkerXml(existingMarker, dp.marker, getLocalName2, resolveColor2);
|
|
49620
50572
|
} else if (existingMarker) {
|
|
@@ -49623,7 +50575,7 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
49623
50575
|
if (dp.bubble3D !== void 0) {
|
|
49624
50576
|
node["c:bubble3D"] = { "@_val": dp.bubble3D ? "1" : "0" };
|
|
49625
50577
|
} else if (existing) {
|
|
49626
|
-
const bubbleKey =
|
|
50578
|
+
const bubbleKey = findKey5(existing, "bubble3D", getLocalName2);
|
|
49627
50579
|
if (bubbleKey) {
|
|
49628
50580
|
node[bubbleKey] = existing[bubbleKey];
|
|
49629
50581
|
}
|
|
@@ -49631,12 +50583,12 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
49631
50583
|
if (dp.explosion !== void 0) {
|
|
49632
50584
|
node["c:explosion"] = { "@_val": String(dp.explosion) };
|
|
49633
50585
|
}
|
|
49634
|
-
const existingSpPr = existing ? existing[
|
|
50586
|
+
const existingSpPr = existing ? existing[findKey5(existing, "spPr", getLocalName2) ?? ""] : void 0;
|
|
49635
50587
|
const spPr = buildDptSpPr(existingSpPr, dp, getLocalName2, resolveColor2, gradient);
|
|
49636
50588
|
if (spPr) {
|
|
49637
50589
|
node["c:spPr"] = spPr;
|
|
49638
50590
|
}
|
|
49639
|
-
const existingPictureOptions = existing ? existing[
|
|
50591
|
+
const existingPictureOptions = existing ? existing[findKey5(existing, "pictureOptions", getLocalName2) ?? ""] : void 0;
|
|
49640
50592
|
const pictureOptions = buildDptPictureOptions(existingPictureOptions, dp.picture);
|
|
49641
50593
|
if (pictureOptions) {
|
|
49642
50594
|
node["c:pictureOptions"] = pictureOptions;
|
|
@@ -49654,11 +50606,11 @@ function buildDataPoint(existing, dp, getLocalName2, resolveColor2, gradient) {
|
|
|
49654
50606
|
return node;
|
|
49655
50607
|
}
|
|
49656
50608
|
function applySeriesDataPointsToXml(seriesNode, dataPoints, getLocalName2, resolveColor2, gradient) {
|
|
49657
|
-
const existingKey =
|
|
50609
|
+
const existingKey = findKey5(seriesNode, "dPt", getLocalName2);
|
|
49658
50610
|
const existingNodes = existingKey ? ensureArray2(seriesNode[existingKey]) : [];
|
|
49659
50611
|
const byIdx = /* @__PURE__ */ new Map();
|
|
49660
50612
|
for (const node of existingNodes) {
|
|
49661
|
-
const idxNode = node[
|
|
50613
|
+
const idxNode = node[findKey5(node, "idx", getLocalName2) ?? ""];
|
|
49662
50614
|
const idx = idxNode ? Number.parseInt(String(idxNode["@_val"]), 10) : NaN;
|
|
49663
50615
|
if (Number.isFinite(idx)) {
|
|
49664
50616
|
byIdx.set(idx, node);
|
|
@@ -49688,7 +50640,7 @@ function applySeriesDataPointsToXml(seriesNode, dataPoints, getLocalName2, resol
|
|
|
49688
50640
|
}
|
|
49689
50641
|
}
|
|
49690
50642
|
function applySeriesPictureOptionsToXml(seriesNode, picture, getLocalName2) {
|
|
49691
|
-
const existingKey =
|
|
50643
|
+
const existingKey = findKey5(seriesNode, "pictureOptions", getLocalName2);
|
|
49692
50644
|
const existing = existingKey ? seriesNode[existingKey] : void 0;
|
|
49693
50645
|
const built = buildDptPictureOptions(existing, picture);
|
|
49694
50646
|
if (existingKey) {
|
|
@@ -49829,7 +50781,7 @@ var init_chart_series_identity = __esm({
|
|
|
49829
50781
|
});
|
|
49830
50782
|
|
|
49831
50783
|
// src/pptx/core/utils/chart-series-detail-parser.ts
|
|
49832
|
-
function
|
|
50784
|
+
function localNameOf7(key2) {
|
|
49833
50785
|
return key2.replace(/^.*:/u, "");
|
|
49834
50786
|
}
|
|
49835
50787
|
function safeInt2(val) {
|
|
@@ -49967,7 +50919,7 @@ function parseSeriesDataPoints(seriesNode, xmlLookup, colorParser, parseGradient
|
|
|
49967
50919
|
if (bubble3D !== void 0) {
|
|
49968
50920
|
result.bubble3D = bubble3D;
|
|
49969
50921
|
}
|
|
49970
|
-
const uniqueId = parseChartUniqueId(node,
|
|
50922
|
+
const uniqueId = parseChartUniqueId(node, localNameOf7);
|
|
49971
50923
|
if (uniqueId !== void 0) {
|
|
49972
50924
|
result.uniqueId = uniqueId;
|
|
49973
50925
|
}
|
|
@@ -50051,7 +51003,7 @@ var init_chart_data_table_parser = __esm({
|
|
|
50051
51003
|
});
|
|
50052
51004
|
|
|
50053
51005
|
// src/pptx/core/utils/chart-data-label-field-table.ts
|
|
50054
|
-
function
|
|
51006
|
+
function localNameOf8(key2) {
|
|
50055
51007
|
const colonIndex = key2.lastIndexOf(":");
|
|
50056
51008
|
return colonIndex >= 0 ? key2.slice(colonIndex + 1) : key2;
|
|
50057
51009
|
}
|
|
@@ -50078,7 +51030,7 @@ function collectByLocalName2(node, target, out) {
|
|
|
50078
51030
|
const items = Array.isArray(child27) ? child27 : [child27];
|
|
50079
51031
|
for (const item of items) {
|
|
50080
51032
|
if (item && typeof item === "object") {
|
|
50081
|
-
if (
|
|
51033
|
+
if (localNameOf8(key2) === target) {
|
|
50082
51034
|
out.push(item);
|
|
50083
51035
|
}
|
|
50084
51036
|
collectByLocalName2(item, target, out);
|
|
@@ -50274,7 +51226,7 @@ function dataLabelsRangeUnchanged(dLbls, range, showDataLabelsRange, getLocalNam
|
|
|
50274
51226
|
}
|
|
50275
51227
|
return existingRange.formula === range.formula && existingRange.cache.length === range.cache.length && existingRange.cache.every((value, idx) => value === range.cache[idx]) && existingShow === (showDataLabelsRange !== false);
|
|
50276
51228
|
}
|
|
50277
|
-
function
|
|
51229
|
+
function findKey6(obj, local, getLocalName2) {
|
|
50278
51230
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
50279
51231
|
}
|
|
50280
51232
|
function asExtArray(value) {
|
|
@@ -50290,9 +51242,9 @@ function applyDataLabelsRangeToDLbls(dLbls, range, showDataLabelsRange, getLocal
|
|
|
50290
51242
|
if (dataLabelsRangeUnchanged(dLbls, range, showDataLabelsRange, getLocalName2)) {
|
|
50291
51243
|
return;
|
|
50292
51244
|
}
|
|
50293
|
-
const extLstKey =
|
|
51245
|
+
const extLstKey = findKey6(dLbls, "extLst", getLocalName2) ?? "c:extLst";
|
|
50294
51246
|
const extLst = { ...dLbls[extLstKey] ?? {} };
|
|
50295
|
-
const extKey =
|
|
51247
|
+
const extKey = findKey6(extLst, "ext", getLocalName2);
|
|
50296
51248
|
const exts = extKey ? asExtArray(extLst[extKey]) : [];
|
|
50297
51249
|
const otherExts = exts.filter((ext) => ext["@_uri"] !== CHART15_EXT_URI);
|
|
50298
51250
|
const ownExt = { ...exts.find((ext) => ext["@_uri"] === CHART15_EXT_URI) ?? {} };
|
|
@@ -50381,7 +51333,7 @@ function scalar3(parent, name, xmlLookup) {
|
|
|
50381
51333
|
const node = xmlLookup.getChildByLocalName(parent, name);
|
|
50382
51334
|
return node?.["#text"] === void 0 ? void 0 : String(node["#text"]);
|
|
50383
51335
|
}
|
|
50384
|
-
function
|
|
51336
|
+
function localNameOf9(key2) {
|
|
50385
51337
|
const colonIndex = key2.lastIndexOf(":");
|
|
50386
51338
|
return colonIndex >= 0 ? key2.slice(colonIndex + 1) : key2;
|
|
50387
51339
|
}
|
|
@@ -50449,7 +51401,7 @@ function parseSeriesDataLabels(seriesNode, xmlLookup, colorParser, resolveTypefa
|
|
|
50449
51401
|
if (numberFormat !== void 0) {
|
|
50450
51402
|
result.numberFormat = numberFormat;
|
|
50451
51403
|
}
|
|
50452
|
-
const layout = parseChartManualLayout(node,
|
|
51404
|
+
const layout = parseChartManualLayout(node, localNameOf9);
|
|
50453
51405
|
if (layout) {
|
|
50454
51406
|
result.layout = layout;
|
|
50455
51407
|
}
|
|
@@ -50552,7 +51504,7 @@ var init_chart_data_label_parser = __esm({
|
|
|
50552
51504
|
|
|
50553
51505
|
// src/pptx/core/utils/chart-axis-dispunits-serializer.ts
|
|
50554
51506
|
function setOrdered(node, name, value, order, localName29) {
|
|
50555
|
-
const existing =
|
|
51507
|
+
const existing = findKey7(node, name, localName29);
|
|
50556
51508
|
if (existing) {
|
|
50557
51509
|
node[existing] = value;
|
|
50558
51510
|
return;
|
|
@@ -50644,7 +51596,7 @@ function applyLabel(node, edit, localName29, resolveColor2) {
|
|
|
50644
51596
|
if (edit === void 0) {
|
|
50645
51597
|
return;
|
|
50646
51598
|
}
|
|
50647
|
-
const key2 =
|
|
51599
|
+
const key2 = findKey7(node, "dispUnitsLbl", localName29);
|
|
50648
51600
|
if (edit === null) {
|
|
50649
51601
|
if (key2) {
|
|
50650
51602
|
delete node[key2];
|
|
@@ -50666,7 +51618,7 @@ function applyLabel(node, edit, localName29, resolveColor2) {
|
|
|
50666
51618
|
);
|
|
50667
51619
|
}
|
|
50668
51620
|
if (labelEdit.spPr !== void 0) {
|
|
50669
|
-
const spPrKey =
|
|
51621
|
+
const spPrKey = findKey7(label, "spPr", localName29);
|
|
50670
51622
|
if (labelEdit.spPr === null) {
|
|
50671
51623
|
if (spPrKey) {
|
|
50672
51624
|
delete label[spPrKey];
|
|
@@ -50694,7 +51646,7 @@ function applyLabel(node, edit, localName29, resolveColor2) {
|
|
|
50694
51646
|
);
|
|
50695
51647
|
}
|
|
50696
51648
|
function applyChartAxisDisplayUnitsToXml(axisNode, axis, localName29, resolveColor2) {
|
|
50697
|
-
const existingKey =
|
|
51649
|
+
const existingKey = findKey7(axisNode, "dispUnits", localName29);
|
|
50698
51650
|
if (!axis.displayUnits) {
|
|
50699
51651
|
if (existingKey) {
|
|
50700
51652
|
delete axisNode[existingKey];
|
|
@@ -50708,7 +51660,7 @@ function applyChartAxisDisplayUnitsToXml(axisNode, axis, localName29, resolveCol
|
|
|
50708
51660
|
...existingKey ? axisNode[existingKey] : void 0
|
|
50709
51661
|
};
|
|
50710
51662
|
for (const choice of ["custUnit", "builtInUnit"]) {
|
|
50711
|
-
const key2 =
|
|
51663
|
+
const key2 = findKey7(node, choice, localName29);
|
|
50712
51664
|
if (key2) {
|
|
50713
51665
|
delete node[key2];
|
|
50714
51666
|
}
|
|
@@ -50737,7 +51689,7 @@ function applyChartAxisDisplayUnitsToXml(axisNode, axis, localName29, resolveCol
|
|
|
50737
51689
|
applyLabel(node, axis.displayUnitsLabel, localName29, resolveColor2);
|
|
50738
51690
|
setOrdered(axisNode, "dispUnits", node, ["dispUnits", "extLst"], localName29);
|
|
50739
51691
|
}
|
|
50740
|
-
var BUILT_IN_UNITS,
|
|
51692
|
+
var BUILT_IN_UNITS, findKey7;
|
|
50741
51693
|
var init_chart_axis_dispunits_serializer = __esm({
|
|
50742
51694
|
"src/pptx/core/utils/chart-axis-dispunits-serializer.ts"() {
|
|
50743
51695
|
init_chart_color_choice();
|
|
@@ -50754,7 +51706,7 @@ var init_chart_axis_dispunits_serializer = __esm({
|
|
|
50754
51706
|
"billions",
|
|
50755
51707
|
"trillions"
|
|
50756
51708
|
]);
|
|
50757
|
-
|
|
51709
|
+
findKey7 = (node, name, localName29) => Object.keys(node).find((key2) => localName29(key2) === name);
|
|
50758
51710
|
}
|
|
50759
51711
|
});
|
|
50760
51712
|
|
|
@@ -50771,11 +51723,11 @@ var init_chart_percent_union_value = __esm({
|
|
|
50771
51723
|
});
|
|
50772
51724
|
|
|
50773
51725
|
// src/pptx/core/utils/chart-axis-label-formatting.ts
|
|
50774
|
-
function
|
|
51726
|
+
function findKey8(node, name, localName29) {
|
|
50775
51727
|
return Object.keys(node).find((key2) => localName29(key2) === name);
|
|
50776
51728
|
}
|
|
50777
51729
|
function child8(node, name, localName29) {
|
|
50778
|
-
const key2 =
|
|
51730
|
+
const key2 = findKey8(node, name, localName29);
|
|
50779
51731
|
const value = key2 ? node[key2] : void 0;
|
|
50780
51732
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
50781
51733
|
}
|
|
@@ -50849,7 +51801,7 @@ function parseChartAxisLabelFormatting(node, axisType, localName29) {
|
|
|
50849
51801
|
return Object.fromEntries(Object.entries(result).filter(([, value]) => value !== void 0));
|
|
50850
51802
|
}
|
|
50851
51803
|
function upsertOrdered(node, name, value, localName29) {
|
|
50852
|
-
const key2 =
|
|
51804
|
+
const key2 = findKey8(node, name, localName29);
|
|
50853
51805
|
if (key2) {
|
|
50854
51806
|
node[key2] = { ...node[key2], ...value };
|
|
50855
51807
|
return;
|
|
@@ -50888,13 +51840,13 @@ function applyChartAxisLabelFormatting(node, formatting, localName29) {
|
|
|
50888
51840
|
if (!Number.isFinite(formatting.crossesAt)) {
|
|
50889
51841
|
throw new RangeError("crossesAt must be finite");
|
|
50890
51842
|
}
|
|
50891
|
-
const crossesKey =
|
|
51843
|
+
const crossesKey = findKey8(node, "crosses", localName29);
|
|
50892
51844
|
if (crossesKey) {
|
|
50893
51845
|
delete node[crossesKey];
|
|
50894
51846
|
}
|
|
50895
51847
|
upsertOrdered(node, "crossesAt", { "@_val": String(formatting.crossesAt) }, localName29);
|
|
50896
51848
|
} else if (formatting.crosses !== void 0) {
|
|
50897
|
-
const crossesAtKey =
|
|
51849
|
+
const crossesAtKey = findKey8(node, "crossesAt", localName29);
|
|
50898
51850
|
if (crossesAtKey) {
|
|
50899
51851
|
delete node[crossesAtKey];
|
|
50900
51852
|
}
|
|
@@ -51046,9 +51998,30 @@ function applyChartAxisScaling(scalingNode, axis, getLocalName2) {
|
|
|
51046
51998
|
if (axis.orientation !== void 0) {
|
|
51047
51999
|
upsertChartAxisChild(scalingNode, "orientation", axis.orientation, getLocalName2);
|
|
51048
52000
|
}
|
|
52001
|
+
orderScalingChildren(scalingNode, getLocalName2);
|
|
51049
52002
|
}
|
|
52003
|
+
function orderScalingChildren(scalingNode, getLocalName2) {
|
|
52004
|
+
const rank = (key2) => {
|
|
52005
|
+
const index = SCALING_ORDER.indexOf(getLocalName2(key2));
|
|
52006
|
+
return index === -1 ? SCALING_ORDER.length : index;
|
|
52007
|
+
};
|
|
52008
|
+
const keys = Object.keys(scalingNode).filter((key2) => !key2.startsWith("@_"));
|
|
52009
|
+
const sorted = [...keys].sort((a, b) => rank(a) - rank(b));
|
|
52010
|
+
if (sorted.every((key2, i2) => key2 === keys[i2])) {
|
|
52011
|
+
return;
|
|
52012
|
+
}
|
|
52013
|
+
const entries = sorted.map((key2) => [key2, scalingNode[key2]]);
|
|
52014
|
+
for (const key2 of keys) {
|
|
52015
|
+
delete scalingNode[key2];
|
|
52016
|
+
}
|
|
52017
|
+
for (const [key2, value] of entries) {
|
|
52018
|
+
scalingNode[key2] = value;
|
|
52019
|
+
}
|
|
52020
|
+
}
|
|
52021
|
+
var SCALING_ORDER;
|
|
51050
52022
|
var init_chart_axis_scaling = __esm({
|
|
51051
52023
|
"src/pptx/core/utils/chart-axis-scaling.ts"() {
|
|
52024
|
+
SCALING_ORDER = ["logBase", "orientation", "max", "min"];
|
|
51052
52025
|
}
|
|
51053
52026
|
});
|
|
51054
52027
|
|
|
@@ -51136,7 +52109,7 @@ var init_chart_date_axis = __esm({
|
|
|
51136
52109
|
});
|
|
51137
52110
|
|
|
51138
52111
|
// src/pptx/core/utils/chart-title-xml-ops.ts
|
|
51139
|
-
function
|
|
52112
|
+
function findKey9(node, localName29, getLocalName2) {
|
|
51140
52113
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName29);
|
|
51141
52114
|
}
|
|
51142
52115
|
function replaceEntries(parent, entries) {
|
|
@@ -51154,7 +52127,7 @@ function insertAt2(parent, index, key2, value) {
|
|
|
51154
52127
|
}
|
|
51155
52128
|
function setAutoTitleDeleted(chartRoot, deleted, getLocalName2) {
|
|
51156
52129
|
const value = { "@_val": deleted ? "1" : "0" };
|
|
51157
|
-
const existingKey =
|
|
52130
|
+
const existingKey = findKey9(chartRoot, "autoTitleDeleted", getLocalName2);
|
|
51158
52131
|
if (existingKey) {
|
|
51159
52132
|
chartRoot[existingKey] = value;
|
|
51160
52133
|
return;
|
|
@@ -55463,9 +56436,9 @@ function parseKinsoku(presentationXml3) {
|
|
|
55463
56436
|
if (!presentationXml3) {
|
|
55464
56437
|
return void 0;
|
|
55465
56438
|
}
|
|
55466
|
-
const rootKey =
|
|
56439
|
+
const rootKey = findKey10(presentationXml3, "presentation");
|
|
55467
56440
|
const root = rootKey ? presentationXml3[rootKey] : void 0;
|
|
55468
|
-
const key2 = root ?
|
|
56441
|
+
const key2 = root ? findKey10(root, "kinsoku") : void 0;
|
|
55469
56442
|
const node = key2 && root ? root[key2] : void 0;
|
|
55470
56443
|
if (!node) {
|
|
55471
56444
|
return void 0;
|
|
@@ -55484,7 +56457,7 @@ function parseKinsoku(presentationXml3) {
|
|
|
55484
56457
|
return result;
|
|
55485
56458
|
}
|
|
55486
56459
|
function setAttribute2(node, name, value) {
|
|
55487
|
-
const key2 =
|
|
56460
|
+
const key2 = findKey10(node, name);
|
|
55488
56461
|
if (value === null) {
|
|
55489
56462
|
if (key2) {
|
|
55490
56463
|
delete node[key2];
|
|
@@ -55513,7 +56486,7 @@ function insertKinsoku(root, key2, value) {
|
|
|
55513
56486
|
return result;
|
|
55514
56487
|
}
|
|
55515
56488
|
function applyKinsokuToXml(presentation, kinsoku) {
|
|
55516
|
-
const existingKey =
|
|
56489
|
+
const existingKey = findKey10(presentation, "kinsoku");
|
|
55517
56490
|
if (kinsoku === void 0) {
|
|
55518
56491
|
return presentation;
|
|
55519
56492
|
}
|
|
@@ -55540,7 +56513,7 @@ function applyKinsokuToXml(presentation, kinsoku) {
|
|
|
55540
56513
|
Object.assign(presentation, rebuilt);
|
|
55541
56514
|
return presentation;
|
|
55542
56515
|
}
|
|
55543
|
-
var BEFORE_KINSOKU, localName8,
|
|
56516
|
+
var BEFORE_KINSOKU, localName8, findKey10;
|
|
55544
56517
|
var init_kinsoku_parser = __esm({
|
|
55545
56518
|
"src/pptx/core/utils/kinsoku-parser.ts"() {
|
|
55546
56519
|
BEFORE_KINSOKU = /* @__PURE__ */ new Set([
|
|
@@ -55557,7 +56530,7 @@ var init_kinsoku_parser = __esm({
|
|
|
55557
56530
|
"custDataLst"
|
|
55558
56531
|
]);
|
|
55559
56532
|
localName8 = (key2) => key2.replace(/^@_/u, "").replace(/^.*:/u, "");
|
|
55560
|
-
|
|
56533
|
+
findKey10 = (node, name) => Object.keys(node).find((key2) => localName8(key2) === name);
|
|
55561
56534
|
}
|
|
55562
56535
|
});
|
|
55563
56536
|
|
|
@@ -62655,11 +63628,11 @@ function localName12(key2) {
|
|
|
62655
63628
|
const idx = key2.indexOf(":");
|
|
62656
63629
|
return idx >= 0 ? key2.slice(idx + 1) : key2;
|
|
62657
63630
|
}
|
|
62658
|
-
function
|
|
63631
|
+
function findKey11(obj, local) {
|
|
62659
63632
|
return Object.keys(obj).find((k) => localName12(k) === local);
|
|
62660
63633
|
}
|
|
62661
63634
|
function ensureChild(obj, local, prefixedFallback) {
|
|
62662
|
-
const key2 =
|
|
63635
|
+
const key2 = findKey11(obj, local) ?? prefixedFallback;
|
|
62663
63636
|
const existing = obj[key2];
|
|
62664
63637
|
if (existing && typeof existing === "object" && !Array.isArray(existing)) {
|
|
62665
63638
|
return existing;
|
|
@@ -62675,7 +63648,7 @@ function solidFill2(color2) {
|
|
|
62675
63648
|
return { "a:srgbClr": { "@_val": hexValue(color2) } };
|
|
62676
63649
|
}
|
|
62677
63650
|
function setSolidFill(parent, color2) {
|
|
62678
|
-
const key2 =
|
|
63651
|
+
const key2 = findKey11(parent, "solidFill") ?? "a:solidFill";
|
|
62679
63652
|
parent[key2] = solidFill2(color2);
|
|
62680
63653
|
}
|
|
62681
63654
|
function applyShapeStyle(pt2, style) {
|
|
@@ -62692,7 +63665,7 @@ function applyShapeStyle(pt2, style) {
|
|
|
62692
63665
|
}
|
|
62693
63666
|
}
|
|
62694
63667
|
function ensureFirstRunRPr(pt2) {
|
|
62695
|
-
const tKey =
|
|
63668
|
+
const tKey = findKey11(pt2, "t");
|
|
62696
63669
|
if (!tKey) {
|
|
62697
63670
|
return void 0;
|
|
62698
63671
|
}
|
|
@@ -62700,7 +63673,7 @@ function ensureFirstRunRPr(pt2) {
|
|
|
62700
63673
|
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
62701
63674
|
return void 0;
|
|
62702
63675
|
}
|
|
62703
|
-
const pKey =
|
|
63676
|
+
const pKey = findKey11(body, "p");
|
|
62704
63677
|
if (!pKey) {
|
|
62705
63678
|
return void 0;
|
|
62706
63679
|
}
|
|
@@ -62709,7 +63682,7 @@ function ensureFirstRunRPr(pt2) {
|
|
|
62709
63682
|
if (!firstP || typeof firstP !== "object") {
|
|
62710
63683
|
return void 0;
|
|
62711
63684
|
}
|
|
62712
|
-
const rKey =
|
|
63685
|
+
const rKey = findKey11(firstP, "r");
|
|
62713
63686
|
if (!rKey) {
|
|
62714
63687
|
return void 0;
|
|
62715
63688
|
}
|
|
@@ -63747,7 +64720,7 @@ var init_layout_display_name = __esm({
|
|
|
63747
64720
|
});
|
|
63748
64721
|
|
|
63749
64722
|
// src/pptx/core/utils/chart-bubble-options.ts
|
|
63750
|
-
function
|
|
64723
|
+
function findKey12(node, name, localName29) {
|
|
63751
64724
|
return Object.keys(node).find((key2) => localName29(key2) === name);
|
|
63752
64725
|
}
|
|
63753
64726
|
function boolValue2(node) {
|
|
@@ -63762,7 +64735,7 @@ function parseBubbleChartOptions(container2, localName29) {
|
|
|
63762
64735
|
return void 0;
|
|
63763
64736
|
}
|
|
63764
64737
|
const node = (name) => {
|
|
63765
|
-
const key2 =
|
|
64738
|
+
const key2 = findKey12(container2, name, localName29);
|
|
63766
64739
|
return key2 ? container2[key2] : void 0;
|
|
63767
64740
|
};
|
|
63768
64741
|
const options = {};
|
|
@@ -63791,7 +64764,7 @@ function parseBubbleChartOptions(container2, localName29) {
|
|
|
63791
64764
|
return Object.keys(options).length > 0 ? options : void 0;
|
|
63792
64765
|
}
|
|
63793
64766
|
function insertOrdered2(container2, name, value, localName29) {
|
|
63794
|
-
const existingKey =
|
|
64767
|
+
const existingKey = findKey12(container2, name, localName29);
|
|
63795
64768
|
if (existingKey) {
|
|
63796
64769
|
container2[existingKey] = { ...container2[existingKey], ...value };
|
|
63797
64770
|
return;
|
|
@@ -64119,7 +65092,7 @@ function parseChartUpDownBars(chartContainer, xmlLookup, colorParser) {
|
|
|
64119
65092
|
return result;
|
|
64120
65093
|
}
|
|
64121
65094
|
function setOrdered2(node, name, value, order, localName29) {
|
|
64122
|
-
const key2 =
|
|
65095
|
+
const key2 = findKey13(node, name, localName29);
|
|
64123
65096
|
if (key2) {
|
|
64124
65097
|
node[key2] = value;
|
|
64125
65098
|
return;
|
|
@@ -64142,7 +65115,7 @@ function applyChartUpDownBars(chartContainer, options, localName29, resolveColor
|
|
|
64142
65115
|
if (options === void 0) {
|
|
64143
65116
|
return;
|
|
64144
65117
|
}
|
|
64145
|
-
const key2 =
|
|
65118
|
+
const key2 = findKey13(chartContainer, "upDownBars", localName29);
|
|
64146
65119
|
if (options === null) {
|
|
64147
65120
|
if (key2) {
|
|
64148
65121
|
delete chartContainer[key2];
|
|
@@ -64164,11 +65137,11 @@ function applyChartUpDownBars(chartContainer, options, localName29, resolveColor
|
|
|
64164
65137
|
if (!style) {
|
|
64165
65138
|
continue;
|
|
64166
65139
|
}
|
|
64167
|
-
const existingBar =
|
|
65140
|
+
const existingBar = findKey13(node, name, localName29);
|
|
64168
65141
|
const bar = {
|
|
64169
65142
|
...existingBar ? node[existingBar] : void 0
|
|
64170
65143
|
};
|
|
64171
|
-
const spPrKey =
|
|
65144
|
+
const spPrKey = findKey13(bar, "spPr", localName29) ?? "c:spPr";
|
|
64172
65145
|
bar[spPrKey] = writeChartShapeProps(
|
|
64173
65146
|
bar[spPrKey],
|
|
64174
65147
|
style,
|
|
@@ -64179,7 +65152,7 @@ function applyChartUpDownBars(chartContainer, options, localName29, resolveColor
|
|
|
64179
65152
|
}
|
|
64180
65153
|
setOrdered2(chartContainer, "upDownBars", node, CONTAINER_ORDER, localName29);
|
|
64181
65154
|
}
|
|
64182
|
-
var CONTAINER_ORDER,
|
|
65155
|
+
var CONTAINER_ORDER, findKey13;
|
|
64183
65156
|
var init_chart_up_down_bars = __esm({
|
|
64184
65157
|
"src/pptx/core/utils/chart-up-down-bars.ts"() {
|
|
64185
65158
|
init_chart_percent_union_value();
|
|
@@ -64198,7 +65171,7 @@ var init_chart_up_down_bars = __esm({
|
|
|
64198
65171
|
"axId",
|
|
64199
65172
|
"extLst"
|
|
64200
65173
|
];
|
|
64201
|
-
|
|
65174
|
+
findKey13 = (node, name, localName29) => Object.keys(node).find((key2) => localName29(key2) === name);
|
|
64202
65175
|
}
|
|
64203
65176
|
});
|
|
64204
65177
|
|
|
@@ -74275,9 +75248,7 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
74275
75248
|
}
|
|
74276
75249
|
const widthEmu = parseInt(String(node["@_w"] || "0"), 10);
|
|
74277
75250
|
if (widthEmu > 0) {
|
|
74278
|
-
style[`${prefix}Width`] =
|
|
74279
|
-
widthEmu / context.emuPerPx
|
|
74280
|
-
);
|
|
75251
|
+
style[`${prefix}Width`] = widthEmu / context.emuPerPx;
|
|
74281
75252
|
hasStyle = true;
|
|
74282
75253
|
}
|
|
74283
75254
|
const color2 = context.parseColor(node["a:solidFill"]);
|
|
@@ -74307,7 +75278,7 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
74307
75278
|
hasStyle = true;
|
|
74308
75279
|
}
|
|
74309
75280
|
if (w > 0) {
|
|
74310
|
-
style.borderDiagDownWidth =
|
|
75281
|
+
style.borderDiagDownWidth = w / context.emuPerPx;
|
|
74311
75282
|
hasStyle = true;
|
|
74312
75283
|
}
|
|
74313
75284
|
}
|
|
@@ -74320,7 +75291,7 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
74320
75291
|
hasStyle = true;
|
|
74321
75292
|
}
|
|
74322
75293
|
if (w > 0) {
|
|
74323
|
-
style.borderDiagUpWidth =
|
|
75294
|
+
style.borderDiagUpWidth = w / context.emuPerPx;
|
|
74324
75295
|
hasStyle = true;
|
|
74325
75296
|
}
|
|
74326
75297
|
}
|
|
@@ -74338,7 +75309,7 @@ function applyCellMarginStyle(cellProperties, style, context) {
|
|
|
74338
75309
|
return void 0;
|
|
74339
75310
|
}
|
|
74340
75311
|
const w = parseInt(String(node["@_w"]), 10);
|
|
74341
|
-
return Number.isFinite(w) && w >= 0 ?
|
|
75312
|
+
return Number.isFinite(w) && w >= 0 ? w / context.emuPerPx : void 0;
|
|
74342
75313
|
};
|
|
74343
75314
|
const ml = parseMargin(tcMar["a:marL"]);
|
|
74344
75315
|
const mr = parseMargin(tcMar["a:marR"]);
|
|
@@ -74372,7 +75343,7 @@ function applyCellMarginStyle(cellProperties, style, context) {
|
|
|
74372
75343
|
if (style[key2] === void 0 && raw !== void 0 && raw !== null) {
|
|
74373
75344
|
const v = parseInt(String(raw), 10);
|
|
74374
75345
|
if (Number.isFinite(v) && v >= 0) {
|
|
74375
|
-
style[key2] =
|
|
75346
|
+
style[key2] = v / context.emuPerPx;
|
|
74376
75347
|
hasStyle = true;
|
|
74377
75348
|
}
|
|
74378
75349
|
}
|
|
@@ -74668,6 +75639,10 @@ function applyRunProperties(run, runProperties2, context) {
|
|
|
74668
75639
|
if (fontFamily) {
|
|
74669
75640
|
run.fontFamily = fontFamily;
|
|
74670
75641
|
}
|
|
75642
|
+
const baseline = parseInt(String(runProperties2["@_baseline"] ?? ""), 10);
|
|
75643
|
+
if (Number.isFinite(baseline) && baseline !== 0) {
|
|
75644
|
+
run.baseline = baseline;
|
|
75645
|
+
}
|
|
74671
75646
|
}
|
|
74672
75647
|
function extractTableCellTextRuns(tableCell, context) {
|
|
74673
75648
|
const paragraphs = context.ensureArray(
|
|
@@ -103194,7 +104169,7 @@ function parseEmbeddedFontList(presentationData) {
|
|
|
103194
104169
|
};
|
|
103195
104170
|
}
|
|
103196
104171
|
function applyAttribute(node, name, value) {
|
|
103197
|
-
const key2 =
|
|
104172
|
+
const key2 = findKey14(node, name);
|
|
103198
104173
|
if (value === null) {
|
|
103199
104174
|
if (key2) {
|
|
103200
104175
|
delete node[key2];
|
|
@@ -103242,7 +104217,7 @@ function serializeEntry(entry) {
|
|
|
103242
104217
|
}
|
|
103243
104218
|
for (const name of ENTRY_ORDER) {
|
|
103244
104219
|
const edit = edits.get(name);
|
|
103245
|
-
const key2 =
|
|
104220
|
+
const key2 = findKey14(source, name) ?? `p:${name}`;
|
|
103246
104221
|
if (edit !== null && edit !== void 0) {
|
|
103247
104222
|
result[key2] = edit;
|
|
103248
104223
|
} else if (!edits.has(name) && source[key2] !== void 0) {
|
|
@@ -103261,7 +104236,7 @@ function serializeEmbeddedFontList(list2) {
|
|
|
103261
104236
|
throw new Error("CT_EmbeddedFontList requires at least one embeddedFont");
|
|
103262
104237
|
}
|
|
103263
104238
|
const source = { ...list2.rawXml ?? {} };
|
|
103264
|
-
const key2 =
|
|
104239
|
+
const key2 = findKey14(source, "embeddedFont") ?? "p:embeddedFont";
|
|
103265
104240
|
source[key2] = list2.fonts.map(serializeEntry);
|
|
103266
104241
|
return source;
|
|
103267
104242
|
}
|
|
@@ -103271,7 +104246,7 @@ function setEmbeddedFontList(presentationData, list2) {
|
|
|
103271
104246
|
return;
|
|
103272
104247
|
}
|
|
103273
104248
|
const root = presentationData[rootKey];
|
|
103274
|
-
const existingKey =
|
|
104249
|
+
const existingKey = findKey14(root, "embeddedFontLst");
|
|
103275
104250
|
const result = {};
|
|
103276
104251
|
let inserted = false;
|
|
103277
104252
|
for (const [key2, value] of Object.entries(root)) {
|
|
@@ -103290,7 +104265,7 @@ function setEmbeddedFontList(presentationData, list2) {
|
|
|
103290
104265
|
}
|
|
103291
104266
|
presentationData[rootKey] = result;
|
|
103292
104267
|
}
|
|
103293
|
-
var ENTRY_ORDER, PRESENTATION_BEFORE, localName17,
|
|
104268
|
+
var ENTRY_ORDER, PRESENTATION_BEFORE, localName17, findKey14, child16, children12;
|
|
103294
104269
|
var init_embedded_font_list = __esm({
|
|
103295
104270
|
"src/pptx/core/utils/embedded-font-list.ts"() {
|
|
103296
104271
|
ENTRY_ORDER = ["font", "regular", "bold", "italic", "boldItalic"];
|
|
@@ -103304,13 +104279,13 @@ var init_embedded_font_list = __esm({
|
|
|
103304
104279
|
"smartTags"
|
|
103305
104280
|
]);
|
|
103306
104281
|
localName17 = (key2) => key2.replace(/^@_/u, "").replace(/^.*:/u, "");
|
|
103307
|
-
|
|
104282
|
+
findKey14 = (node, name) => Object.keys(node).find((key2) => localName17(key2) === name);
|
|
103308
104283
|
child16 = (node, name) => {
|
|
103309
|
-
const key2 =
|
|
104284
|
+
const key2 = findKey14(node, name);
|
|
103310
104285
|
return key2 ? node[key2] : void 0;
|
|
103311
104286
|
};
|
|
103312
104287
|
children12 = (node, name) => {
|
|
103313
|
-
const key2 =
|
|
104288
|
+
const key2 = findKey14(node, name);
|
|
103314
104289
|
const value = key2 ? node[key2] : void 0;
|
|
103315
104290
|
return Array.isArray(value) ? value : value ? [value] : [];
|
|
103316
104291
|
};
|
|
@@ -103825,7 +104800,7 @@ function parseChartBandFmts(seriesContainer, xmlLookup, colorParser) {
|
|
|
103825
104800
|
return result.length > 0 ? result : void 0;
|
|
103826
104801
|
}
|
|
103827
104802
|
function setOrdered3(node, name, value, order, localName29) {
|
|
103828
|
-
const key2 =
|
|
104803
|
+
const key2 = findKey15(node, name, localName29);
|
|
103829
104804
|
if (key2) {
|
|
103830
104805
|
node[key2] = value;
|
|
103831
104806
|
return;
|
|
@@ -103848,7 +104823,7 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName29, resolveColor
|
|
|
103848
104823
|
if (bandFmts === void 0) {
|
|
103849
104824
|
return;
|
|
103850
104825
|
}
|
|
103851
|
-
const containerKey =
|
|
104826
|
+
const containerKey = findKey15(seriesContainer, "bandFmts", localName29);
|
|
103852
104827
|
if (bandFmts.length === 0) {
|
|
103853
104828
|
if (containerKey) {
|
|
103854
104829
|
delete seriesContainer[containerKey];
|
|
@@ -103856,11 +104831,11 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName29, resolveColor
|
|
|
103856
104831
|
return;
|
|
103857
104832
|
}
|
|
103858
104833
|
const bandFmtsNode = containerKey ? seriesContainer[containerKey] : void 0;
|
|
103859
|
-
const bandFmtKey = bandFmtsNode ?
|
|
104834
|
+
const bandFmtKey = bandFmtsNode ? findKey15(bandFmtsNode, "bandFmt", localName29) : void 0;
|
|
103860
104835
|
const existingRaw = bandFmtKey ? bandFmtsNode?.[bandFmtKey] : void 0;
|
|
103861
104836
|
const existingNodes = existingRaw ? Array.isArray(existingRaw) ? existingRaw : [existingRaw] : [];
|
|
103862
104837
|
const bandIndexOf = (node) => {
|
|
103863
|
-
const idxKey =
|
|
104838
|
+
const idxKey = findKey15(node, "idx", localName29);
|
|
103864
104839
|
return idxKey ? safeUnsignedInt2(node[idxKey]?.["@_val"]) : void 0;
|
|
103865
104840
|
};
|
|
103866
104841
|
const byIndex = new Map(existingNodes.map((node) => [bandIndexOf(node), node]));
|
|
@@ -103872,7 +104847,7 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName29, resolveColor
|
|
|
103872
104847
|
updated.push(node);
|
|
103873
104848
|
}
|
|
103874
104849
|
if (band.spPr) {
|
|
103875
|
-
const spPrKey =
|
|
104850
|
+
const spPrKey = findKey15(node, "spPr", localName29);
|
|
103876
104851
|
const spPr = writeChartShapeProps(
|
|
103877
104852
|
spPrKey ? node[spPrKey] : void 0,
|
|
103878
104853
|
band.spPr,
|
|
@@ -103890,12 +104865,12 @@ function applyChartBandFmts(seriesContainer, bandFmts, localName29, resolveColor
|
|
|
103890
104865
|
localName29
|
|
103891
104866
|
);
|
|
103892
104867
|
}
|
|
103893
|
-
var
|
|
104868
|
+
var findKey15;
|
|
103894
104869
|
var init_chart_band_fmts = __esm({
|
|
103895
104870
|
"src/pptx/core/utils/chart-band-fmts.ts"() {
|
|
103896
104871
|
init_chart_series_detail_parser();
|
|
103897
104872
|
init_chart_shape_props_writer();
|
|
103898
|
-
|
|
104873
|
+
findKey15 = (node, name, localName29) => Object.keys(node).find((key2) => localName29(key2) === name);
|
|
103899
104874
|
}
|
|
103900
104875
|
});
|
|
103901
104876
|
|
|
@@ -103945,142 +104920,6 @@ var init_chart_blank_values = __esm({
|
|
|
103945
104920
|
}
|
|
103946
104921
|
});
|
|
103947
104922
|
|
|
103948
|
-
// src/pptx/core/utils/chart-container-content-model.ts
|
|
103949
|
-
function chartTypeToContainerLocalName(chartType) {
|
|
103950
|
-
return TYPE_TO_CONTAINER[chartType];
|
|
103951
|
-
}
|
|
103952
|
-
function isKnownChartContainer(containerLocal) {
|
|
103953
|
-
return containerLocal in CHART_CONTAINER_CHILD_ORDER;
|
|
103954
|
-
}
|
|
103955
|
-
function chartContainerAllows(containerLocal, childLocal) {
|
|
103956
|
-
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
103957
|
-
return order !== void 0 && order.includes(childLocal);
|
|
103958
|
-
}
|
|
103959
|
-
var CHART_CONTAINER_CHILD_ORDER, REQUIRED_LEADING_CHILD, TYPE_TO_CONTAINER, AXIS_LOCAL_NAMES;
|
|
103960
|
-
var init_chart_container_content_model = __esm({
|
|
103961
|
-
"src/pptx/core/utils/chart-container-content-model.ts"() {
|
|
103962
|
-
CHART_CONTAINER_CHILD_ORDER = {
|
|
103963
|
-
areaChart: ["grouping", "varyColors", "ser", "dLbls", "dropLines", "axId", "extLst"],
|
|
103964
|
-
area3DChart: [
|
|
103965
|
-
"grouping",
|
|
103966
|
-
"varyColors",
|
|
103967
|
-
"ser",
|
|
103968
|
-
"dLbls",
|
|
103969
|
-
"dropLines",
|
|
103970
|
-
"gapDepth",
|
|
103971
|
-
"axId",
|
|
103972
|
-
"extLst"
|
|
103973
|
-
],
|
|
103974
|
-
barChart: [
|
|
103975
|
-
"barDir",
|
|
103976
|
-
"grouping",
|
|
103977
|
-
"varyColors",
|
|
103978
|
-
"ser",
|
|
103979
|
-
"dLbls",
|
|
103980
|
-
"gapWidth",
|
|
103981
|
-
"overlap",
|
|
103982
|
-
"serLines",
|
|
103983
|
-
"axId",
|
|
103984
|
-
"extLst"
|
|
103985
|
-
],
|
|
103986
|
-
bar3DChart: [
|
|
103987
|
-
"barDir",
|
|
103988
|
-
"grouping",
|
|
103989
|
-
"varyColors",
|
|
103990
|
-
"ser",
|
|
103991
|
-
"dLbls",
|
|
103992
|
-
"gapWidth",
|
|
103993
|
-
"gapDepth",
|
|
103994
|
-
"shape",
|
|
103995
|
-
"axId",
|
|
103996
|
-
"extLst"
|
|
103997
|
-
],
|
|
103998
|
-
bubbleChart: [
|
|
103999
|
-
"varyColors",
|
|
104000
|
-
"ser",
|
|
104001
|
-
"dLbls",
|
|
104002
|
-
"bubble3D",
|
|
104003
|
-
"bubbleScale",
|
|
104004
|
-
"showNegBubbles",
|
|
104005
|
-
"sizeRepresents",
|
|
104006
|
-
"axId",
|
|
104007
|
-
"extLst"
|
|
104008
|
-
],
|
|
104009
|
-
doughnutChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "holeSize", "extLst"],
|
|
104010
|
-
lineChart: [
|
|
104011
|
-
"grouping",
|
|
104012
|
-
"varyColors",
|
|
104013
|
-
"ser",
|
|
104014
|
-
"dLbls",
|
|
104015
|
-
"dropLines",
|
|
104016
|
-
"hiLowLines",
|
|
104017
|
-
"upDownBars",
|
|
104018
|
-
"marker",
|
|
104019
|
-
"smooth",
|
|
104020
|
-
"axId",
|
|
104021
|
-
"extLst"
|
|
104022
|
-
],
|
|
104023
|
-
line3DChart: [
|
|
104024
|
-
"grouping",
|
|
104025
|
-
"varyColors",
|
|
104026
|
-
"ser",
|
|
104027
|
-
"dLbls",
|
|
104028
|
-
"dropLines",
|
|
104029
|
-
"gapDepth",
|
|
104030
|
-
"axId",
|
|
104031
|
-
"extLst"
|
|
104032
|
-
],
|
|
104033
|
-
ofPieChart: [
|
|
104034
|
-
"ofPieType",
|
|
104035
|
-
"varyColors",
|
|
104036
|
-
"ser",
|
|
104037
|
-
"dLbls",
|
|
104038
|
-
"gapWidth",
|
|
104039
|
-
"splitType",
|
|
104040
|
-
"splitPos",
|
|
104041
|
-
"custSplit",
|
|
104042
|
-
"secondPieSize",
|
|
104043
|
-
"serLines",
|
|
104044
|
-
"extLst"
|
|
104045
|
-
],
|
|
104046
|
-
pieChart: ["varyColors", "ser", "dLbls", "firstSliceAng", "extLst"],
|
|
104047
|
-
pie3DChart: ["varyColors", "ser", "dLbls", "extLst"],
|
|
104048
|
-
radarChart: ["radarStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
104049
|
-
scatterChart: ["scatterStyle", "varyColors", "ser", "dLbls", "axId", "extLst"],
|
|
104050
|
-
stockChart: ["ser", "dLbls", "dropLines", "hiLowLines", "upDownBars", "axId", "extLst"],
|
|
104051
|
-
surfaceChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"],
|
|
104052
|
-
surface3DChart: ["wireframe", "ser", "bandFmts", "axId", "extLst"]
|
|
104053
|
-
};
|
|
104054
|
-
REQUIRED_LEADING_CHILD = {
|
|
104055
|
-
barChart: { local: "barDir", val: "col" },
|
|
104056
|
-
bar3DChart: { local: "barDir", val: "col" },
|
|
104057
|
-
lineChart: { local: "grouping", val: "standard" },
|
|
104058
|
-
line3DChart: { local: "grouping", val: "standard" },
|
|
104059
|
-
ofPieChart: { local: "ofPieType", val: "pie" },
|
|
104060
|
-
radarChart: { local: "radarStyle", val: "marker" },
|
|
104061
|
-
scatterChart: { local: "scatterStyle", val: "lineMarker" }
|
|
104062
|
-
};
|
|
104063
|
-
TYPE_TO_CONTAINER = {
|
|
104064
|
-
area: "areaChart",
|
|
104065
|
-
area3D: "area3DChart",
|
|
104066
|
-
bar: "barChart",
|
|
104067
|
-
bar3D: "bar3DChart",
|
|
104068
|
-
bubble: "bubbleChart",
|
|
104069
|
-
doughnut: "doughnutChart",
|
|
104070
|
-
line: "lineChart",
|
|
104071
|
-
line3D: "line3DChart",
|
|
104072
|
-
ofPie: "ofPieChart",
|
|
104073
|
-
pie: "pieChart",
|
|
104074
|
-
pie3D: "pie3DChart",
|
|
104075
|
-
radar: "radarChart",
|
|
104076
|
-
scatter: "scatterChart",
|
|
104077
|
-
stock: "stockChart",
|
|
104078
|
-
surface: "surfaceChart"
|
|
104079
|
-
};
|
|
104080
|
-
AXIS_LOCAL_NAMES = ["catAx", "valAx", "dateAx", "serAx"];
|
|
104081
|
-
}
|
|
104082
|
-
});
|
|
104083
|
-
|
|
104084
104923
|
// src/pptx/core/utils/chart-container-type-map.ts
|
|
104085
104924
|
function chartContainerLocalNameToType(localName29) {
|
|
104086
104925
|
return CONTAINER_LOCAL_NAME_TO_TYPE[localName29];
|
|
@@ -104140,7 +104979,7 @@ var init_chart_date_categories = __esm({
|
|
|
104140
104979
|
});
|
|
104141
104980
|
|
|
104142
104981
|
// src/pptx/core/utils/chart-filtered-series.ts
|
|
104143
|
-
function
|
|
104982
|
+
function localNameOf10(key2) {
|
|
104144
104983
|
return key2.replace(/^.*:/u, "");
|
|
104145
104984
|
}
|
|
104146
104985
|
function scalarChild(parent, name, xmlLookup) {
|
|
@@ -104220,7 +105059,7 @@ function parseOneFilteredSeries(node, xmlLookup) {
|
|
|
104220
105059
|
if (values.length > 0) {
|
|
104221
105060
|
result.values = values;
|
|
104222
105061
|
}
|
|
104223
|
-
const uniqueId = parseChartUniqueId(node,
|
|
105062
|
+
const uniqueId = parseChartUniqueId(node, localNameOf10);
|
|
104224
105063
|
if (uniqueId) {
|
|
104225
105064
|
result.uniqueId = uniqueId;
|
|
104226
105065
|
}
|
|
@@ -104238,7 +105077,7 @@ function parseFilteredSeries(container2, xmlLookup) {
|
|
|
104238
105077
|
if (!ext) {
|
|
104239
105078
|
return void 0;
|
|
104240
105079
|
}
|
|
104241
|
-
const wrapperKey = Object.keys(ext).find((key2) => /^filtered.*series$/iu.test(
|
|
105080
|
+
const wrapperKey = Object.keys(ext).find((key2) => /^filtered.*series$/iu.test(localNameOf10(key2)));
|
|
104242
105081
|
if (!wrapperKey) {
|
|
104243
105082
|
return void 0;
|
|
104244
105083
|
}
|
|
@@ -108126,7 +108965,7 @@ function parsePrintProperties(node) {
|
|
|
108126
108965
|
};
|
|
108127
108966
|
}
|
|
108128
108967
|
function applyAttribute2(node, name, value) {
|
|
108129
|
-
const existingKey =
|
|
108968
|
+
const existingKey = findKey16(node, name);
|
|
108130
108969
|
if (value === null) {
|
|
108131
108970
|
if (existingKey) {
|
|
108132
108971
|
delete node[existingKey];
|
|
@@ -108161,14 +109000,14 @@ function serializePrintProperties(properties) {
|
|
|
108161
109000
|
result[key2] = value;
|
|
108162
109001
|
}
|
|
108163
109002
|
}
|
|
108164
|
-
const extKey =
|
|
109003
|
+
const extKey = findKey16(source, "extLst");
|
|
108165
109004
|
if (extKey) {
|
|
108166
109005
|
result[extKey] = source[extKey];
|
|
108167
109006
|
}
|
|
108168
109007
|
return result;
|
|
108169
109008
|
}
|
|
108170
109009
|
function findChildByLocalName2(parent, name) {
|
|
108171
|
-
const key2 =
|
|
109010
|
+
const key2 = findKey16(parent, name);
|
|
108172
109011
|
return key2 ? parent[key2] : void 0;
|
|
108173
109012
|
}
|
|
108174
109013
|
function setPresentationPropertiesChild(root, name, value) {
|
|
@@ -108207,7 +109046,7 @@ function slidesPerPageToPrintOutput(value) {
|
|
|
108207
109046
|
}
|
|
108208
109047
|
return `handouts${value}`;
|
|
108209
109048
|
}
|
|
108210
|
-
var PRINT_OUTPUTS, COLOR_MODES, ROOT_ORDER, localName21,
|
|
109049
|
+
var PRINT_OUTPUTS, COLOR_MODES, ROOT_ORDER, localName21, findKey16;
|
|
108211
109050
|
var init_pptx_print_properties = __esm({
|
|
108212
109051
|
"src/pptx/core/core/runtime/pptx-print-properties.ts"() {
|
|
108213
109052
|
PRINT_OUTPUTS = /* @__PURE__ */ new Set([
|
|
@@ -108224,7 +109063,7 @@ var init_pptx_print_properties = __esm({
|
|
|
108224
109063
|
COLOR_MODES = /* @__PURE__ */ new Set(["bw", "gray", "clr"]);
|
|
108225
109064
|
ROOT_ORDER = ["htmlPubPr", "webPr", "prnPr", "showPr", "clrMru", "extLst"];
|
|
108226
109065
|
localName21 = (key2) => key2.replace(/^@_/u, "").replace(/^.*:/u, "");
|
|
108227
|
-
|
|
109066
|
+
findKey16 = (node, name) => Object.keys(node).find((key2) => localName21(key2) === name);
|
|
108228
109067
|
}
|
|
108229
109068
|
});
|
|
108230
109069
|
|
|
@@ -113715,7 +114554,7 @@ var init_chart_cx_generator = __esm({
|
|
|
113715
114554
|
});
|
|
113716
114555
|
|
|
113717
114556
|
// src/pptx/core/utils/chart-data-labels-serializer.ts
|
|
113718
|
-
function
|
|
114557
|
+
function findKey17(obj, local, getLocalName2) {
|
|
113719
114558
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
113720
114559
|
}
|
|
113721
114560
|
function boolVal(on) {
|
|
@@ -113789,7 +114628,7 @@ function applyChartDataLabelsToXml(plotArea, style, getLocalName2) {
|
|
|
113789
114628
|
if (!container2 || typeof container2 !== "object") {
|
|
113790
114629
|
continue;
|
|
113791
114630
|
}
|
|
113792
|
-
const existingKey =
|
|
114631
|
+
const existingKey = findKey17(container2, "dLbls", getLocalName2);
|
|
113793
114632
|
if (style.hasDataLabels === false) {
|
|
113794
114633
|
const existing2 = existingKey ? container2[existingKey] : void 0;
|
|
113795
114634
|
const off = ordered3(existing2, { "c:delete": { "@_val": "1" } }, getLocalName2);
|
|
@@ -113867,11 +114706,11 @@ var init_chart_data_labels_serializer = __esm({
|
|
|
113867
114706
|
});
|
|
113868
114707
|
|
|
113869
114708
|
// src/pptx/core/utils/chart-data-table.ts
|
|
113870
|
-
function
|
|
114709
|
+
function findKey18(node, name, localName29) {
|
|
113871
114710
|
return Object.keys(node).find((key2) => localName29(key2) === name);
|
|
113872
114711
|
}
|
|
113873
114712
|
function setOrdered4(node, name, value, order, localName29) {
|
|
113874
|
-
const existingKey =
|
|
114713
|
+
const existingKey = findKey18(node, name, localName29);
|
|
113875
114714
|
if (existingKey) {
|
|
113876
114715
|
node[existingKey] = value;
|
|
113877
114716
|
return;
|
|
@@ -113894,7 +114733,7 @@ function applyChartDataTable(plotArea, dataTable, localName29, resolveColor2) {
|
|
|
113894
114733
|
if (dataTable === void 0) {
|
|
113895
114734
|
return;
|
|
113896
114735
|
}
|
|
113897
|
-
const tableKey =
|
|
114736
|
+
const tableKey = findKey18(plotArea, "dTable", localName29);
|
|
113898
114737
|
if (dataTable === null) {
|
|
113899
114738
|
if (tableKey) {
|
|
113900
114739
|
delete plotArea[tableKey];
|
|
@@ -113911,7 +114750,7 @@ function applyChartDataTable(plotArea, dataTable, localName29, resolveColor2) {
|
|
|
113911
114750
|
}
|
|
113912
114751
|
}
|
|
113913
114752
|
if (dataTable.spPr) {
|
|
113914
|
-
const spPrKey =
|
|
114753
|
+
const spPrKey = findKey18(table, "spPr", localName29);
|
|
113915
114754
|
const spPr = writeChartShapeProps(
|
|
113916
114755
|
spPrKey ? table[spPrKey] : void 0,
|
|
113917
114756
|
dataTable.spPr,
|
|
@@ -113921,13 +114760,13 @@ function applyChartDataTable(plotArea, dataTable, localName29, resolveColor2) {
|
|
|
113921
114760
|
setOrdered4(table, "spPr", spPr, TABLE_ORDER, localName29);
|
|
113922
114761
|
}
|
|
113923
114762
|
if (dataTable.txPr) {
|
|
113924
|
-
const txPrKey =
|
|
114763
|
+
const txPrKey = findKey18(table, "txPr", localName29);
|
|
113925
114764
|
const authoredDefRPr = resolveTxPrDefRPr(txPrKey ? table[txPrKey] : void 0, {
|
|
113926
114765
|
getChildByLocalName: (parent, name) => {
|
|
113927
114766
|
if (!parent) {
|
|
113928
114767
|
return void 0;
|
|
113929
114768
|
}
|
|
113930
|
-
const key2 =
|
|
114769
|
+
const key2 = findKey18(parent, name, localName29);
|
|
113931
114770
|
return key2 ? parent[key2] : void 0;
|
|
113932
114771
|
}
|
|
113933
114772
|
});
|
|
@@ -113987,7 +114826,7 @@ var init_chart_data_table = __esm({
|
|
|
113987
114826
|
});
|
|
113988
114827
|
|
|
113989
114828
|
// src/pptx/core/utils/chart-errbars-serializer.ts
|
|
113990
|
-
function
|
|
114829
|
+
function findKey19(obj, local, getLocalName2) {
|
|
113991
114830
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
113992
114831
|
}
|
|
113993
114832
|
function ensureArray14(v) {
|
|
@@ -114030,7 +114869,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
114030
114869
|
if (e.noEndCap !== void 0) {
|
|
114031
114870
|
node["c:noEndCap"] = { "@_val": e.noEndCap ? "1" : "0" };
|
|
114032
114871
|
} else if (existing) {
|
|
114033
|
-
const noEndCapKey =
|
|
114872
|
+
const noEndCapKey = findKey19(existing, "noEndCap", getLocalName2);
|
|
114034
114873
|
if (noEndCapKey) {
|
|
114035
114874
|
node["c:noEndCap"] = existing[noEndCapKey];
|
|
114036
114875
|
}
|
|
@@ -114045,7 +114884,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
114045
114884
|
} else if (e.val !== void 0) {
|
|
114046
114885
|
node["c:val"] = { "@_val": String(e.val) };
|
|
114047
114886
|
}
|
|
114048
|
-
const spPrKey = existing ?
|
|
114887
|
+
const spPrKey = existing ? findKey19(existing, "spPr", getLocalName2) : void 0;
|
|
114049
114888
|
const existingSpPr = spPrKey ? existing?.[spPrKey] : void 0;
|
|
114050
114889
|
if (e.color || e.width !== void 0 || e.dashStyle) {
|
|
114051
114890
|
node["c:spPr"] = buildSpPr(existingSpPr, e, getLocalName2, resolveColor2);
|
|
@@ -114053,7 +114892,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
114053
114892
|
node["c:spPr"] = existingSpPr;
|
|
114054
114893
|
}
|
|
114055
114894
|
if (existing) {
|
|
114056
|
-
const extKey =
|
|
114895
|
+
const extKey = findKey19(existing, "extLst", getLocalName2);
|
|
114057
114896
|
if (extKey) {
|
|
114058
114897
|
node["c:extLst"] = existing[extKey];
|
|
114059
114898
|
}
|
|
@@ -114061,7 +114900,7 @@ function buildErrBars(existing, e, getLocalName2, resolveColor2) {
|
|
|
114061
114900
|
return node;
|
|
114062
114901
|
}
|
|
114063
114902
|
function applySeriesErrBarsToXml(seriesNode, errBars, getLocalName2, resolveColor2) {
|
|
114064
|
-
const existingKey =
|
|
114903
|
+
const existingKey = findKey19(seriesNode, "errBars", getLocalName2);
|
|
114065
114904
|
const existingNodes = existingKey ? ensureArray14(seriesNode[existingKey]) : [];
|
|
114066
114905
|
const built = errBars.map(
|
|
114067
114906
|
(e, i2) => buildErrBars(existingNodes[i2], e, getLocalName2, resolveColor2)
|
|
@@ -114095,7 +114934,7 @@ var init_chart_errbars_serializer = __esm({
|
|
|
114095
114934
|
});
|
|
114096
114935
|
|
|
114097
114936
|
// src/pptx/core/utils/chart-series-datalabel-build.ts
|
|
114098
|
-
function
|
|
114937
|
+
function findKey20(obj, local, getLocalName2) {
|
|
114099
114938
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
114100
114939
|
}
|
|
114101
114940
|
function boolVal2(on) {
|
|
@@ -114144,7 +114983,7 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
114144
114983
|
node["c:delete"] = { "@_val": "0" };
|
|
114145
114984
|
}
|
|
114146
114985
|
if (existing && label.layout === void 0) {
|
|
114147
|
-
const layoutKey =
|
|
114986
|
+
const layoutKey = findKey20(existing, "layout", getLocalName2);
|
|
114148
114987
|
if (layoutKey) {
|
|
114149
114988
|
node[layoutKey] = existing[layoutKey];
|
|
114150
114989
|
}
|
|
@@ -114163,7 +115002,7 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
114163
115002
|
}
|
|
114164
115003
|
};
|
|
114165
115004
|
} else if (existing) {
|
|
114166
|
-
const txKey =
|
|
115005
|
+
const txKey = findKey20(existing, "tx", getLocalName2);
|
|
114167
115006
|
if (txKey) {
|
|
114168
115007
|
node[txKey] = existing[txKey];
|
|
114169
115008
|
}
|
|
@@ -114179,7 +115018,7 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
114179
115018
|
if (local === "txPr" && label.txPr !== void 0) {
|
|
114180
115019
|
continue;
|
|
114181
115020
|
}
|
|
114182
|
-
const k =
|
|
115021
|
+
const k = findKey20(existing, local, getLocalName2);
|
|
114183
115022
|
if (k) {
|
|
114184
115023
|
node[k] = existing[k];
|
|
114185
115024
|
}
|
|
@@ -114191,15 +115030,15 @@ function buildDLbl(existing, label, getLocalName2, resolveColor2) {
|
|
|
114191
115030
|
}
|
|
114192
115031
|
if (label.spPr !== void 0) {
|
|
114193
115032
|
replaced.add("spPr");
|
|
114194
|
-
const existingSpPr = existing ? existing[
|
|
115033
|
+
const existingSpPr = existing ? existing[findKey20(existing, "spPr", getLocalName2) ?? ""] : void 0;
|
|
114195
115034
|
node["c:spPr"] = writeChartShapeProps(existingSpPr, label.spPr, getLocalName2, resolveColor2);
|
|
114196
115035
|
}
|
|
114197
115036
|
if (label.txPr !== void 0) {
|
|
114198
115037
|
replaced.add("txPr");
|
|
114199
|
-
const existingTxPr = existing ? existing[
|
|
114200
|
-
const paragraph = existingTxPr ? existingTxPr[
|
|
114201
|
-
const pPr = paragraph ? paragraph[
|
|
114202
|
-
const authoredDefRPr = pPr ? pPr[
|
|
115038
|
+
const existingTxPr = existing ? existing[findKey20(existing, "txPr", getLocalName2) ?? ""] : void 0;
|
|
115039
|
+
const paragraph = existingTxPr ? existingTxPr[findKey20(existingTxPr, "p", getLocalName2) ?? ""] : void 0;
|
|
115040
|
+
const pPr = paragraph ? paragraph[findKey20(paragraph, "pPr", getLocalName2) ?? ""] : void 0;
|
|
115041
|
+
const authoredDefRPr = pPr ? pPr[findKey20(pPr, "defRPr", getLocalName2) ?? ""] : void 0;
|
|
114203
115042
|
const txPr = buildDefRPrTextProperties(label.txPr, authoredDefRPr, resolveColor2);
|
|
114204
115043
|
if (txPr) {
|
|
114205
115044
|
node["c:txPr"] = txPr;
|
|
@@ -114269,17 +115108,17 @@ var init_chart_series_datalabel_build = __esm({
|
|
|
114269
115108
|
|
|
114270
115109
|
// src/pptx/core/utils/chart-series-datalabel-serializer.ts
|
|
114271
115110
|
function applySeriesDataLabelsToXml(seriesNode, dataLabels, getLocalName2, resolveColor2) {
|
|
114272
|
-
const dLblsKey =
|
|
115111
|
+
const dLblsKey = findKey20(seriesNode, "dLbls", getLocalName2);
|
|
114273
115112
|
const labels = dataLabels ?? [];
|
|
114274
115113
|
const existingByIdx = /* @__PURE__ */ new Map();
|
|
114275
115114
|
let groupChildren = [];
|
|
114276
115115
|
if (dLblsKey) {
|
|
114277
115116
|
const dLbls = seriesNode[dLblsKey];
|
|
114278
|
-
const dLblKey =
|
|
115117
|
+
const dLblKey = findKey20(dLbls, "dLbl", getLocalName2);
|
|
114279
115118
|
if (dLblKey) {
|
|
114280
115119
|
const nodes = Array.isArray(dLbls[dLblKey]) ? dLbls[dLblKey] : [dLbls[dLblKey]];
|
|
114281
115120
|
for (const node of nodes) {
|
|
114282
|
-
const idxKey =
|
|
115121
|
+
const idxKey = findKey20(node, "idx", getLocalName2);
|
|
114283
115122
|
const idxNode = idxKey ? node[idxKey] : void 0;
|
|
114284
115123
|
const idx = idxNode ? Number.parseInt(String(idxNode["@_val"]), 10) : NaN;
|
|
114285
115124
|
if (Number.isFinite(idx)) {
|
|
@@ -114368,7 +115207,7 @@ var init_chart_space_metadata = __esm({
|
|
|
114368
115207
|
});
|
|
114369
115208
|
|
|
114370
115209
|
// src/pptx/core/utils/chart-trendline-serializer.ts
|
|
114371
|
-
function
|
|
115210
|
+
function findKey21(obj, local, getLocalName2) {
|
|
114372
115211
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
114373
115212
|
}
|
|
114374
115213
|
function ensureArray15(v) {
|
|
@@ -114407,14 +115246,14 @@ function buildSpPr2(existing, t, getLocalName2, resolveColor2) {
|
|
|
114407
115246
|
function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
114408
115247
|
validateTrendline(t);
|
|
114409
115248
|
const node = {};
|
|
114410
|
-
const existingNameKey = existing ?
|
|
115249
|
+
const existingNameKey = existing ? findKey21(existing, "name", getLocalName2) : void 0;
|
|
114411
115250
|
if (t.name !== void 0) {
|
|
114412
115251
|
node["c:name"] = t.name;
|
|
114413
115252
|
} else if (existing && existingNameKey) {
|
|
114414
115253
|
node["c:name"] = existing[existingNameKey];
|
|
114415
115254
|
}
|
|
114416
115255
|
const spPr = buildSpPr2(
|
|
114417
|
-
existing ? existing[
|
|
115256
|
+
existing ? existing[findKey21(existing, "spPr", getLocalName2) ?? ""] : void 0,
|
|
114418
115257
|
t,
|
|
114419
115258
|
getLocalName2,
|
|
114420
115259
|
resolveColor2
|
|
@@ -114444,7 +115283,7 @@ function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
|
114444
115283
|
if (t.displayEq !== void 0) {
|
|
114445
115284
|
node["c:dispEq"] = { "@_val": t.displayEq ? "1" : "0" };
|
|
114446
115285
|
}
|
|
114447
|
-
const lblKey = existing ?
|
|
115286
|
+
const lblKey = existing ? findKey21(existing, "trendlineLbl", getLocalName2) : void 0;
|
|
114448
115287
|
if (t.label) {
|
|
114449
115288
|
node["c:trendlineLbl"] = buildTrendlineLabel(
|
|
114450
115289
|
lblKey ? existing?.[lblKey] : void 0,
|
|
@@ -114455,7 +115294,7 @@ function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
|
114455
115294
|
node["c:trendlineLbl"] = existing[lblKey];
|
|
114456
115295
|
}
|
|
114457
115296
|
if (existing) {
|
|
114458
|
-
const extKey =
|
|
115297
|
+
const extKey = findKey21(existing, "extLst", getLocalName2);
|
|
114459
115298
|
if (extKey) {
|
|
114460
115299
|
node["c:extLst"] = existing[extKey];
|
|
114461
115300
|
}
|
|
@@ -114463,7 +115302,7 @@ function buildTrendline(existing, t, getLocalName2, resolveColor2) {
|
|
|
114463
115302
|
return node;
|
|
114464
115303
|
}
|
|
114465
115304
|
function applySeriesTrendlinesToXml(seriesNode, trendlines, getLocalName2, resolveColor2) {
|
|
114466
|
-
const existingKey =
|
|
115305
|
+
const existingKey = findKey21(seriesNode, "trendline", getLocalName2);
|
|
114467
115306
|
const existingNodes = existingKey ? ensureArray15(seriesNode[existingKey]) : [];
|
|
114468
115307
|
const built = trendlines.map(
|
|
114469
115308
|
(t, i2) => buildTrendline(existingNodes[i2], t, getLocalName2, resolveColor2)
|
|
@@ -114506,11 +115345,292 @@ var init_chart_trendline_serializer = __esm({
|
|
|
114506
115345
|
}
|
|
114507
115346
|
});
|
|
114508
115347
|
|
|
115348
|
+
// src/pptx/core/utils/chart-area-format.ts
|
|
115349
|
+
function findKey22(obj, local, getLocalName2) {
|
|
115350
|
+
return Object.keys(obj).find((key2) => getLocalName2(key2) === local);
|
|
115351
|
+
}
|
|
115352
|
+
function asObject(value) {
|
|
115353
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
115354
|
+
}
|
|
115355
|
+
function parsePaint(node, getLocalName2, resolveColor2) {
|
|
115356
|
+
if (!node) {
|
|
115357
|
+
return void 0;
|
|
115358
|
+
}
|
|
115359
|
+
if (findKey22(node, "noFill", getLocalName2) !== void 0) {
|
|
115360
|
+
return "none";
|
|
115361
|
+
}
|
|
115362
|
+
const solid = asObject(node[findKey22(node, "solidFill", getLocalName2) ?? ""]);
|
|
115363
|
+
return solid ? resolveColor2(solid) : void 0;
|
|
115364
|
+
}
|
|
115365
|
+
function parseChartAreaFormat(owner, getLocalName2, resolveColor2, parseGradient) {
|
|
115366
|
+
const spPr = owner ? asObject(owner[findKey22(owner, "spPr", getLocalName2) ?? ""]) : void 0;
|
|
115367
|
+
if (!spPr) {
|
|
115368
|
+
return {};
|
|
115369
|
+
}
|
|
115370
|
+
const format = {};
|
|
115371
|
+
const fill = parsePaint(spPr, getLocalName2, resolveColor2);
|
|
115372
|
+
if (fill !== void 0) {
|
|
115373
|
+
format.fill = fill;
|
|
115374
|
+
}
|
|
115375
|
+
const gradient = parseGradient?.(spPr);
|
|
115376
|
+
if (gradient) {
|
|
115377
|
+
format.gradient = gradient;
|
|
115378
|
+
}
|
|
115379
|
+
const ln = asObject(spPr[findKey22(spPr, "ln", getLocalName2) ?? ""]);
|
|
115380
|
+
const border = parsePaint(ln, getLocalName2, resolveColor2);
|
|
115381
|
+
if (border !== void 0) {
|
|
115382
|
+
format.border = border;
|
|
115383
|
+
}
|
|
115384
|
+
return format;
|
|
115385
|
+
}
|
|
115386
|
+
function paintXml(paint) {
|
|
115387
|
+
return paint === "none" ? { "a:noFill": {} } : { "a:solidFill": { "a:srgbClr": { "@_val": chartColorHex(paint) } } };
|
|
115388
|
+
}
|
|
115389
|
+
function buildChartAreaSpPr(format) {
|
|
115390
|
+
const spPr = {};
|
|
115391
|
+
if (format.gradient) {
|
|
115392
|
+
spPr["a:gradFill"] = buildChartGradFillXml(format.gradient);
|
|
115393
|
+
} else if (format.fill !== void 0) {
|
|
115394
|
+
Object.assign(spPr, paintXml(format.fill));
|
|
115395
|
+
}
|
|
115396
|
+
if (format.border !== void 0) {
|
|
115397
|
+
spPr["a:ln"] = paintXml(format.border);
|
|
115398
|
+
}
|
|
115399
|
+
return Object.keys(spPr).length > 0 ? spPr : void 0;
|
|
115400
|
+
}
|
|
115401
|
+
function samePaint(a, b) {
|
|
115402
|
+
if (a === void 0 || b === void 0 || a === "none" || b === "none") {
|
|
115403
|
+
return a === b;
|
|
115404
|
+
}
|
|
115405
|
+
return colorsEqual(a, b);
|
|
115406
|
+
}
|
|
115407
|
+
function sameFill(model, authored) {
|
|
115408
|
+
if (model.gradient || authored.gradient) {
|
|
115409
|
+
return Boolean(
|
|
115410
|
+
model.gradient && authored.gradient && chartGradientsEqual(model.gradient, authored.gradient)
|
|
115411
|
+
);
|
|
115412
|
+
}
|
|
115413
|
+
return samePaint(model.fill, authored.fill);
|
|
115414
|
+
}
|
|
115415
|
+
function setPaint(node, entry, choices, after, getLocalName2) {
|
|
115416
|
+
const entries = Object.entries(node).filter(([key2]) => !choices.has(getLocalName2(key2)));
|
|
115417
|
+
if (entry) {
|
|
115418
|
+
const at2 = entries.findIndex(([key2]) => after.has(getLocalName2(key2)));
|
|
115419
|
+
entries.splice(at2 === -1 ? entries.length : at2, 0, entry);
|
|
115420
|
+
}
|
|
115421
|
+
for (const key2 of Object.keys(node)) {
|
|
115422
|
+
delete node[key2];
|
|
115423
|
+
}
|
|
115424
|
+
for (const [key2, value] of entries) {
|
|
115425
|
+
node[key2] = value;
|
|
115426
|
+
}
|
|
115427
|
+
}
|
|
115428
|
+
function paintEntry(paint, authored, getLocalName2, resolveColor2) {
|
|
115429
|
+
if (paint === void 0) {
|
|
115430
|
+
return void 0;
|
|
115431
|
+
}
|
|
115432
|
+
if (paint === "none") {
|
|
115433
|
+
return ["a:noFill", {}];
|
|
115434
|
+
}
|
|
115435
|
+
const solid = asObject(authored[findKey22(authored, "solidFill", getLocalName2) ?? ""]);
|
|
115436
|
+
return ["a:solidFill", chartColorChoiceValue(solid, paint, resolveColor2)];
|
|
115437
|
+
}
|
|
115438
|
+
function applyChartAreaFormatToXml(owner, format, getLocalName2, options) {
|
|
115439
|
+
const authored = parseChartAreaFormat(
|
|
115440
|
+
owner,
|
|
115441
|
+
getLocalName2,
|
|
115442
|
+
options.resolveColor,
|
|
115443
|
+
options.parseGradient
|
|
115444
|
+
);
|
|
115445
|
+
const fillChanged = !sameFill(format, authored);
|
|
115446
|
+
const borderChanged = !samePaint(format.border, authored.border);
|
|
115447
|
+
if (!fillChanged && !borderChanged) {
|
|
115448
|
+
return false;
|
|
115449
|
+
}
|
|
115450
|
+
let spPr = asObject(owner[findKey22(owner, "spPr", getLocalName2) ?? ""]);
|
|
115451
|
+
if (!spPr) {
|
|
115452
|
+
spPr = {};
|
|
115453
|
+
options.insertSpPr(owner, spPr);
|
|
115454
|
+
}
|
|
115455
|
+
if (fillChanged) {
|
|
115456
|
+
if (format.gradient) {
|
|
115457
|
+
applyChartGradientToSpPr(spPr, format.gradient, getLocalName2, options);
|
|
115458
|
+
} else {
|
|
115459
|
+
const entry = paintEntry(format.fill, spPr, getLocalName2, options.resolveColor);
|
|
115460
|
+
setPaint(spPr, entry, FILL_CHOICE2, /* @__PURE__ */ new Set(["ln", ...AFTER_LN]), getLocalName2);
|
|
115461
|
+
}
|
|
115462
|
+
}
|
|
115463
|
+
if (borderChanged) {
|
|
115464
|
+
const lnKey = findKey22(spPr, "ln", getLocalName2);
|
|
115465
|
+
const ln = asObject(lnKey ? spPr[lnKey] : void 0) ?? {};
|
|
115466
|
+
const entry = paintEntry(format.border, ln, getLocalName2, options.resolveColor);
|
|
115467
|
+
setPaint(
|
|
115468
|
+
ln,
|
|
115469
|
+
entry,
|
|
115470
|
+
LN_FILL_CHOICE,
|
|
115471
|
+
/* @__PURE__ */ new Set(["prstDash", "custDash", "round", "bevel", "miter", "headEnd", "tailEnd", "extLst"]),
|
|
115472
|
+
getLocalName2
|
|
115473
|
+
);
|
|
115474
|
+
if (Object.keys(ln).length === 0) {
|
|
115475
|
+
if (lnKey) {
|
|
115476
|
+
delete spPr[lnKey];
|
|
115477
|
+
}
|
|
115478
|
+
} else if (!lnKey) {
|
|
115479
|
+
setPaint(spPr, ["a:ln", ln], /* @__PURE__ */ new Set(), AFTER_LN, getLocalName2);
|
|
115480
|
+
}
|
|
115481
|
+
}
|
|
115482
|
+
if (Object.keys(spPr).length === 0) {
|
|
115483
|
+
const spPrKey = findKey22(owner, "spPr", getLocalName2);
|
|
115484
|
+
if (spPrKey) {
|
|
115485
|
+
delete owner[spPrKey];
|
|
115486
|
+
}
|
|
115487
|
+
}
|
|
115488
|
+
return true;
|
|
115489
|
+
}
|
|
115490
|
+
var FILL_CHOICE2, AFTER_LN, LN_FILL_CHOICE;
|
|
115491
|
+
var init_chart_area_format = __esm({
|
|
115492
|
+
"src/pptx/core/utils/chart-area-format.ts"() {
|
|
115493
|
+
init_chart_color_choice();
|
|
115494
|
+
init_chart_gradient_fill_writer();
|
|
115495
|
+
init_chart_gradient_fill_xml();
|
|
115496
|
+
init_color_xml_preservation();
|
|
115497
|
+
FILL_CHOICE2 = /* @__PURE__ */ new Set(["noFill", "solidFill", "gradFill", "blipFill", "pattFill", "grpFill"]);
|
|
115498
|
+
AFTER_LN = /* @__PURE__ */ new Set(["effectLst", "effectDag", "scene3d", "sp3d", "extLst"]);
|
|
115499
|
+
LN_FILL_CHOICE = /* @__PURE__ */ new Set(["noFill", "solidFill", "gradFill", "pattFill"]);
|
|
115500
|
+
}
|
|
115501
|
+
});
|
|
115502
|
+
|
|
115503
|
+
// src/pptx/core/utils/chart-space-format.ts
|
|
115504
|
+
function findKey23(obj, local, getLocalName2) {
|
|
115505
|
+
return Object.keys(obj).find((key2) => getLocalName2(key2) === local);
|
|
115506
|
+
}
|
|
115507
|
+
function insertBefore(node, key2, value, after, getLocalName2) {
|
|
115508
|
+
const entries = Object.entries(node);
|
|
115509
|
+
const at2 = entries.findIndex(
|
|
115510
|
+
([candidate]) => !candidate.startsWith("@_") && after.has(getLocalName2(candidate))
|
|
115511
|
+
);
|
|
115512
|
+
entries.splice(at2 === -1 ? entries.length : at2, 0, [key2, value]);
|
|
115513
|
+
for (const candidate of Object.keys(node)) {
|
|
115514
|
+
delete node[candidate];
|
|
115515
|
+
}
|
|
115516
|
+
for (const [candidate, child27] of entries) {
|
|
115517
|
+
node[candidate] = child27;
|
|
115518
|
+
}
|
|
115519
|
+
}
|
|
115520
|
+
function chartAreaFormatOf(chartData) {
|
|
115521
|
+
const style = chartData.style;
|
|
115522
|
+
return {
|
|
115523
|
+
...style?.chartAreaFill !== void 0 ? { fill: style.chartAreaFill } : {},
|
|
115524
|
+
...style?.chartAreaGradient ? { gradient: style.chartAreaGradient } : {},
|
|
115525
|
+
...style?.chartAreaBorder !== void 0 ? { border: style.chartAreaBorder } : {}
|
|
115526
|
+
};
|
|
115527
|
+
}
|
|
115528
|
+
function plotAreaFormatOf(chartData) {
|
|
115529
|
+
const style = chartData.style;
|
|
115530
|
+
return {
|
|
115531
|
+
...style?.plotAreaFill !== void 0 ? { fill: style.plotAreaFill } : {},
|
|
115532
|
+
...style?.plotAreaGradient ? { gradient: style.plotAreaGradient } : {},
|
|
115533
|
+
...style?.plotAreaBorder !== void 0 ? { border: style.plotAreaBorder } : {}
|
|
115534
|
+
};
|
|
115535
|
+
}
|
|
115536
|
+
function applyGeneratedChartSpaceFormat(tree, chartData) {
|
|
115537
|
+
const chartSpace = tree["c:chartSpace"];
|
|
115538
|
+
if (!chartSpace) {
|
|
115539
|
+
return;
|
|
115540
|
+
}
|
|
115541
|
+
const localName29 = (key2) => key2.replace(/^.*:/u, "");
|
|
115542
|
+
const plotArea = chartSpace["c:chart"]?.["c:plotArea"];
|
|
115543
|
+
const plotSpPr = buildChartAreaSpPr(plotAreaFormatOf(chartData));
|
|
115544
|
+
if (plotArea && plotSpPr) {
|
|
115545
|
+
insertBefore(plotArea, "c:spPr", plotSpPr, /* @__PURE__ */ new Set(["extLst"]), localName29);
|
|
115546
|
+
}
|
|
115547
|
+
const chartSpPr = buildChartAreaSpPr(chartAreaFormatOf(chartData));
|
|
115548
|
+
if (chartSpPr) {
|
|
115549
|
+
insertBefore(chartSpace, "c:spPr", chartSpPr, AFTER_CHART_SPACE_SP_PR, localName29);
|
|
115550
|
+
}
|
|
115551
|
+
if (chartData.roundedCorners !== void 0) {
|
|
115552
|
+
insertBefore(
|
|
115553
|
+
chartSpace,
|
|
115554
|
+
"c:roundedCorners",
|
|
115555
|
+
{ "@_val": chartData.roundedCorners ? "1" : "0" },
|
|
115556
|
+
AFTER_ROUNDED_CORNERS,
|
|
115557
|
+
localName29
|
|
115558
|
+
);
|
|
115559
|
+
}
|
|
115560
|
+
}
|
|
115561
|
+
function authoredBool(node) {
|
|
115562
|
+
if (node === void 0) {
|
|
115563
|
+
return void 0;
|
|
115564
|
+
}
|
|
115565
|
+
const val = node && typeof node === "object" ? node["@_val"] : void 0;
|
|
115566
|
+
if (val === void 0 || val === null || val === "") {
|
|
115567
|
+
return true;
|
|
115568
|
+
}
|
|
115569
|
+
return !(val === "0" || val === "false");
|
|
115570
|
+
}
|
|
115571
|
+
function applyChartSpaceFormatToXml(chartSpace, plotArea, chartData, getLocalName2, options) {
|
|
115572
|
+
let changed = false;
|
|
115573
|
+
const roundedKey = findKey23(chartSpace, "roundedCorners", getLocalName2);
|
|
115574
|
+
const authoredRounded = roundedKey ? authoredBool(chartSpace[roundedKey]) : void 0;
|
|
115575
|
+
if (chartData.roundedCorners === void 0) {
|
|
115576
|
+
if (roundedKey) {
|
|
115577
|
+
delete chartSpace[roundedKey];
|
|
115578
|
+
changed = true;
|
|
115579
|
+
}
|
|
115580
|
+
} else if (chartData.roundedCorners !== authoredRounded) {
|
|
115581
|
+
const node = { "@_val": chartData.roundedCorners ? "1" : "0" };
|
|
115582
|
+
if (roundedKey) {
|
|
115583
|
+
chartSpace[roundedKey] = node;
|
|
115584
|
+
} else {
|
|
115585
|
+
insertBefore(chartSpace, "c:roundedCorners", node, AFTER_ROUNDED_CORNERS, getLocalName2);
|
|
115586
|
+
}
|
|
115587
|
+
changed = true;
|
|
115588
|
+
}
|
|
115589
|
+
changed = applyChartAreaFormatToXml(chartSpace, chartAreaFormatOf(chartData), getLocalName2, {
|
|
115590
|
+
...options,
|
|
115591
|
+
insertSpPr: (owner, spPr) => insertBefore(owner, "c:spPr", spPr, AFTER_CHART_SPACE_SP_PR, getLocalName2)
|
|
115592
|
+
}) || changed;
|
|
115593
|
+
if (plotArea) {
|
|
115594
|
+
changed = applyChartAreaFormatToXml(plotArea, plotAreaFormatOf(chartData), getLocalName2, {
|
|
115595
|
+
...options,
|
|
115596
|
+
insertSpPr: (owner, spPr) => insertBefore(owner, "c:spPr", spPr, /* @__PURE__ */ new Set(["extLst"]), getLocalName2)
|
|
115597
|
+
}) || changed;
|
|
115598
|
+
}
|
|
115599
|
+
return changed;
|
|
115600
|
+
}
|
|
115601
|
+
var AFTER_ROUNDED_CORNERS, AFTER_CHART_SPACE_SP_PR;
|
|
115602
|
+
var init_chart_space_format = __esm({
|
|
115603
|
+
"src/pptx/core/utils/chart-space-format.ts"() {
|
|
115604
|
+
init_chart_area_format();
|
|
115605
|
+
AFTER_ROUNDED_CORNERS = /* @__PURE__ */ new Set([
|
|
115606
|
+
"AlternateContent",
|
|
115607
|
+
"style",
|
|
115608
|
+
"clrMapOvr",
|
|
115609
|
+
"pivotSource",
|
|
115610
|
+
"protection",
|
|
115611
|
+
"chart",
|
|
115612
|
+
"spPr",
|
|
115613
|
+
"txPr",
|
|
115614
|
+
"externalData",
|
|
115615
|
+
"printSettings",
|
|
115616
|
+
"userShapes",
|
|
115617
|
+
"extLst"
|
|
115618
|
+
]);
|
|
115619
|
+
AFTER_CHART_SPACE_SP_PR = /* @__PURE__ */ new Set([
|
|
115620
|
+
"txPr",
|
|
115621
|
+
"externalData",
|
|
115622
|
+
"printSettings",
|
|
115623
|
+
"userShapes",
|
|
115624
|
+
"extLst"
|
|
115625
|
+
]);
|
|
115626
|
+
}
|
|
115627
|
+
});
|
|
115628
|
+
|
|
114509
115629
|
// src/pptx/core/utils/chart-axis-gridlines-serializer.ts
|
|
114510
|
-
function
|
|
115630
|
+
function findKey24(obj, local, getLocalName2) {
|
|
114511
115631
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
114512
115632
|
}
|
|
114513
|
-
function
|
|
115633
|
+
function insertBefore2(axisNode, newKey, value, afterSet, getLocalName2) {
|
|
114514
115634
|
const keys = Object.keys(axisNode);
|
|
114515
115635
|
const beforeIdx = keys.findIndex((k) => afterSet.has(getLocalName2(k)));
|
|
114516
115636
|
const entries = keys.map((k) => [k, axisNode[k]]);
|
|
@@ -114527,7 +115647,7 @@ function applyOne(axisNode, local, key2, flag, afterSet, getLocalName2) {
|
|
|
114527
115647
|
if (flag === void 0) {
|
|
114528
115648
|
return;
|
|
114529
115649
|
}
|
|
114530
|
-
const existingKey =
|
|
115650
|
+
const existingKey = findKey24(axisNode, local, getLocalName2);
|
|
114531
115651
|
if (!flag) {
|
|
114532
115652
|
if (existingKey) {
|
|
114533
115653
|
delete axisNode[existingKey];
|
|
@@ -114535,7 +115655,7 @@ function applyOne(axisNode, local, key2, flag, afterSet, getLocalName2) {
|
|
|
114535
115655
|
return;
|
|
114536
115656
|
}
|
|
114537
115657
|
if (!existingKey) {
|
|
114538
|
-
|
|
115658
|
+
insertBefore2(axisNode, key2, {}, afterSet, getLocalName2);
|
|
114539
115659
|
}
|
|
114540
115660
|
}
|
|
114541
115661
|
function applyChartAxisGridlinesToXml(axisNode, opts, getLocalName2, resolveColor2) {
|
|
@@ -114575,14 +115695,14 @@ function hex(color2) {
|
|
|
114575
115695
|
}
|
|
114576
115696
|
function buildGridlineSpPr(existing, style, getLocalName2, resolveColor2) {
|
|
114577
115697
|
const spPr = existing ? { ...existing } : {};
|
|
114578
|
-
const lnKey =
|
|
115698
|
+
const lnKey = findKey24(spPr, "ln", getLocalName2) ?? "a:ln";
|
|
114579
115699
|
const ln = { ...spPr[lnKey] ?? {} };
|
|
114580
115700
|
if (style.strokeWidth !== void 0) {
|
|
114581
115701
|
ln["@_w"] = String(Math.round(style.strokeWidth * 12700));
|
|
114582
115702
|
}
|
|
114583
115703
|
if (style.strokeColor) {
|
|
114584
|
-
const fillKey =
|
|
114585
|
-
const noFillKey =
|
|
115704
|
+
const fillKey = findKey24(ln, "solidFill", getLocalName2) ?? "a:solidFill";
|
|
115705
|
+
const noFillKey = findKey24(ln, "noFill", getLocalName2);
|
|
114586
115706
|
if (noFillKey) {
|
|
114587
115707
|
delete ln[noFillKey];
|
|
114588
115708
|
}
|
|
@@ -114594,7 +115714,7 @@ function buildGridlineSpPr(existing, style, getLocalName2, resolveColor2) {
|
|
|
114594
115714
|
);
|
|
114595
115715
|
}
|
|
114596
115716
|
if (style.strokeDashStyle) {
|
|
114597
|
-
const dashKey =
|
|
115717
|
+
const dashKey = findKey24(ln, "prstDash", getLocalName2) ?? "a:prstDash";
|
|
114598
115718
|
ln[dashKey] = { "@_val": style.strokeDashStyle };
|
|
114599
115719
|
}
|
|
114600
115720
|
spPr[lnKey] = ln;
|
|
@@ -114604,12 +115724,12 @@ function applyGridlineStyle(axisNode, local, style, getLocalName2, resolveColor2
|
|
|
114604
115724
|
if (!style) {
|
|
114605
115725
|
return;
|
|
114606
115726
|
}
|
|
114607
|
-
const gridKey =
|
|
115727
|
+
const gridKey = findKey24(axisNode, local, getLocalName2);
|
|
114608
115728
|
if (!gridKey) {
|
|
114609
115729
|
return;
|
|
114610
115730
|
}
|
|
114611
115731
|
const grid = { ...axisNode[gridKey] ?? {} };
|
|
114612
|
-
const spPrKey =
|
|
115732
|
+
const spPrKey = findKey24(grid, "spPr", getLocalName2) ?? "c:spPr";
|
|
114613
115733
|
grid[spPrKey] = buildGridlineSpPr(
|
|
114614
115734
|
grid[spPrKey],
|
|
114615
115735
|
style,
|
|
@@ -114649,7 +115769,7 @@ function buildGeneratedChartAxis(axId, crossId, pos2, formatting) {
|
|
|
114649
115769
|
const axis = {
|
|
114650
115770
|
"c:axId": { "@_val": String(axId) },
|
|
114651
115771
|
"c:scaling": { "c:orientation": { "@_val": "minMax" } },
|
|
114652
|
-
"c:delete": { "@_val": "0" },
|
|
115772
|
+
"c:delete": { "@_val": formatting?.deleted ? "1" : "0" },
|
|
114653
115773
|
"c:axPos": { "@_val": pos2 },
|
|
114654
115774
|
"c:crossAx": { "@_val": String(crossId) }
|
|
114655
115775
|
};
|
|
@@ -114808,7 +115928,7 @@ function buildSeries(family, s, index, categories, dateCategories) {
|
|
|
114808
115928
|
function axisFormatting(chartData, type, id, index = 0) {
|
|
114809
115929
|
return chartData.axes?.find((axis) => axis.axisId === id) ?? chartData.axes?.filter((axis) => axis.axisType === type)[index];
|
|
114810
115930
|
}
|
|
114811
|
-
function buildChartTypeContainer(chartData, family) {
|
|
115931
|
+
function buildChartTypeContainer(chartData, family, containerLocal) {
|
|
114812
115932
|
const container2 = {};
|
|
114813
115933
|
if (family === "bar") {
|
|
114814
115934
|
container2["c:barDir"] = { "@_val": chartData.barDirection === "bar" ? "bar" : "col" };
|
|
@@ -114842,9 +115962,6 @@ function buildChartTypeContainer(chartData, family) {
|
|
|
114842
115962
|
if (family === "line" && chartData.upDownBars !== void 0) {
|
|
114843
115963
|
applyChartUpDownBars(container2, chartData.upDownBars, (key2) => key2.replace(/^.*:/u, ""));
|
|
114844
115964
|
}
|
|
114845
|
-
if (family === "bar" || family === "ofPie") {
|
|
114846
|
-
container2["c:gapWidth"] = { "@_val": "150" };
|
|
114847
|
-
}
|
|
114848
115965
|
if (family === "bar" && chartData.chartType === "bar3D" && chartData.barShape) {
|
|
114849
115966
|
container2["c:shape"] = { "@_val": chartData.barShape };
|
|
114850
115967
|
}
|
|
@@ -114853,14 +115970,13 @@ function buildChartTypeContainer(chartData, family) {
|
|
|
114853
115970
|
}
|
|
114854
115971
|
if (family === "bar" || family === "line" || family === "area" || family === "radar" || family === "scatter" || family === "bubble" || family === "stock" || family === "surface") {
|
|
114855
115972
|
container2["c:axId"] = [{ "@_val": String(CAT_AX_ID) }, { "@_val": String(VAL_AX_ID) }];
|
|
114856
|
-
} else if (family === "doughnut") {
|
|
114857
|
-
container2["c:holeSize"] = { "@_val": "50" };
|
|
114858
115973
|
}
|
|
115974
|
+
applyGeneratedChartGroupOptions(container2, containerLocal, chartData);
|
|
114859
115975
|
return container2;
|
|
114860
115976
|
}
|
|
114861
115977
|
function buildPlotArea(chartData, tag, family) {
|
|
114862
115978
|
const plotArea = { "c:layout": {} };
|
|
114863
|
-
plotArea[tag] = buildChartTypeContainer(chartData, family);
|
|
115979
|
+
plotArea[tag] = buildChartTypeContainer(chartData, family, tag.replace(/^.*:/u, ""));
|
|
114864
115980
|
if (chartData.style) {
|
|
114865
115981
|
applyChartDataLabelsToXml(plotArea, chartData.style, (key2) => key2.replace(/^.*:/u, ""));
|
|
114866
115982
|
}
|
|
@@ -114937,6 +116053,7 @@ function buildChartSpaceXml(chartData) {
|
|
|
114937
116053
|
}
|
|
114938
116054
|
};
|
|
114939
116055
|
applyGeneratedChartSpaceMetadata(result, chartData);
|
|
116056
|
+
applyGeneratedChartSpaceFormat(result, chartData);
|
|
114940
116057
|
return result;
|
|
114941
116058
|
}
|
|
114942
116059
|
var NS_C2, NS_A2, NS_R2, CAT_AX_ID, VAL_AX_ID, SCATTER_LIKE;
|
|
@@ -114952,6 +116069,8 @@ var init_chart_xml_generator = __esm({
|
|
|
114952
116069
|
init_chart_series_datalabel_serializer();
|
|
114953
116070
|
init_chart_space_metadata();
|
|
114954
116071
|
init_chart_trendline_serializer();
|
|
116072
|
+
init_chart_group_options();
|
|
116073
|
+
init_chart_space_format();
|
|
114955
116074
|
init_chart_up_down_bars();
|
|
114956
116075
|
init_chart_xml_axis_generator();
|
|
114957
116076
|
init_chart_xml_container_map();
|
|
@@ -115299,14 +116418,14 @@ function isCustomXmlRelationship(value) {
|
|
|
115299
116418
|
return String(value ?? "").endsWith("/relationships/customXml");
|
|
115300
116419
|
}
|
|
115301
116420
|
function placeCustomerDataList(container2, list2, location) {
|
|
115302
|
-
const
|
|
116421
|
+
const insertBefore4 = location === "presentation" ? /* @__PURE__ */ new Set(["p:kinsoku", "p:defaultTextStyle", "p:modifyVerifier", "p:extLst"]) : /* @__PURE__ */ new Set(["p:controls", "p:extLst"]);
|
|
115303
116422
|
const rebuilt = {};
|
|
115304
116423
|
let inserted = false;
|
|
115305
116424
|
for (const [key2, value] of Object.entries(container2)) {
|
|
115306
116425
|
if (key2 === "p:custDataLst") {
|
|
115307
116426
|
continue;
|
|
115308
116427
|
}
|
|
115309
|
-
if (!inserted &&
|
|
116428
|
+
if (!inserted && insertBefore4.has(key2)) {
|
|
115310
116429
|
rebuilt["p:custDataLst"] = list2;
|
|
115311
116430
|
inserted = true;
|
|
115312
116431
|
}
|
|
@@ -115394,14 +116513,14 @@ function resolveTagsContainer(data) {
|
|
|
115394
116513
|
}
|
|
115395
116514
|
return void 0;
|
|
115396
116515
|
}
|
|
115397
|
-
function placeAtKey(container2, key2, value,
|
|
116516
|
+
function placeAtKey(container2, key2, value, insertBefore4) {
|
|
115398
116517
|
const rebuilt = {};
|
|
115399
116518
|
let inserted = false;
|
|
115400
116519
|
for (const [childKey3, childValue] of Object.entries(container2)) {
|
|
115401
116520
|
if (childKey3 === key2) {
|
|
115402
116521
|
continue;
|
|
115403
116522
|
}
|
|
115404
|
-
if (!inserted &&
|
|
116523
|
+
if (!inserted && insertBefore4.has(childKey3)) {
|
|
115405
116524
|
rebuilt[key2] = value;
|
|
115406
116525
|
inserted = true;
|
|
115407
116526
|
}
|
|
@@ -115425,10 +116544,10 @@ async function upsertTagsOwningElement(zip, codec, sourcePartPath, relationshipI
|
|
|
115425
116544
|
if (!resolved) {
|
|
115426
116545
|
return;
|
|
115427
116546
|
}
|
|
115428
|
-
const { container: container2, insertBefore:
|
|
116547
|
+
const { container: container2, insertBefore: insertBefore4 } = resolved;
|
|
115429
116548
|
const list2 = { ...container2["p:custDataLst"] ?? {} };
|
|
115430
116549
|
list2["p:tags"] = { "@_r:id": relationshipId2 };
|
|
115431
|
-
placeAtKey(container2, "p:custDataLst", list2,
|
|
116550
|
+
placeAtKey(container2, "p:custDataLst", list2, insertBefore4);
|
|
115432
116551
|
zip.file(sourcePartPath, codec.build(data));
|
|
115433
116552
|
}
|
|
115434
116553
|
async function removeTagsOwningElement(zip, codec, sourcePartPath) {
|
|
@@ -115696,6 +116815,49 @@ var init_tag_package = __esm({
|
|
|
115696
116815
|
}
|
|
115697
116816
|
});
|
|
115698
116817
|
|
|
116818
|
+
// src/pptx/core/utils/chart-axis-deleted.ts
|
|
116819
|
+
function authoredDeleted(node) {
|
|
116820
|
+
if (node === void 0) {
|
|
116821
|
+
return false;
|
|
116822
|
+
}
|
|
116823
|
+
const val = node && typeof node === "object" ? node["@_val"] : void 0;
|
|
116824
|
+
if (val === void 0 || val === null || val === "") {
|
|
116825
|
+
return true;
|
|
116826
|
+
}
|
|
116827
|
+
return !(val === "0" || val === "false");
|
|
116828
|
+
}
|
|
116829
|
+
function applyChartAxisDeletedToXml(axisNode, deleted, getLocalName2) {
|
|
116830
|
+
if (deleted === void 0) {
|
|
116831
|
+
return false;
|
|
116832
|
+
}
|
|
116833
|
+
const key2 = Object.keys(axisNode).find((candidate) => getLocalName2(candidate) === "delete");
|
|
116834
|
+
if (authoredDeleted(key2 ? axisNode[key2] : void 0) === deleted) {
|
|
116835
|
+
return false;
|
|
116836
|
+
}
|
|
116837
|
+
const node = { "@_val": deleted ? "1" : "0" };
|
|
116838
|
+
if (key2) {
|
|
116839
|
+
axisNode[key2] = node;
|
|
116840
|
+
return true;
|
|
116841
|
+
}
|
|
116842
|
+
const entries = Object.entries(axisNode);
|
|
116843
|
+
const at2 = entries.findIndex(([candidate]) => {
|
|
116844
|
+
const local = getLocalName2(candidate);
|
|
116845
|
+
return local !== "axId" && local !== "scaling" && !candidate.startsWith("@_");
|
|
116846
|
+
});
|
|
116847
|
+
entries.splice(at2 === -1 ? entries.length : at2, 0, ["c:delete", node]);
|
|
116848
|
+
for (const candidate of Object.keys(axisNode)) {
|
|
116849
|
+
delete axisNode[candidate];
|
|
116850
|
+
}
|
|
116851
|
+
for (const [candidate, value] of entries) {
|
|
116852
|
+
axisNode[candidate] = value;
|
|
116853
|
+
}
|
|
116854
|
+
return true;
|
|
116855
|
+
}
|
|
116856
|
+
var init_chart_axis_deleted = __esm({
|
|
116857
|
+
"src/pptx/core/utils/chart-axis-deleted.ts"() {
|
|
116858
|
+
}
|
|
116859
|
+
});
|
|
116860
|
+
|
|
115699
116861
|
// src/pptx/core/utils/chart-axis-title-serializer.ts
|
|
115700
116862
|
function firstTextRun(paragraph, getLocalName2) {
|
|
115701
116863
|
for (const [key2, value] of Object.entries(paragraph)) {
|
|
@@ -115703,7 +116865,7 @@ function firstTextRun(paragraph, getLocalName2) {
|
|
|
115703
116865
|
continue;
|
|
115704
116866
|
}
|
|
115705
116867
|
for (const run of Array.isArray(value) ? value : [value]) {
|
|
115706
|
-
if (run && typeof run === "object" && !Array.isArray(run) &&
|
|
116868
|
+
if (run && typeof run === "object" && !Array.isArray(run) && findKey9(run, "t", getLocalName2)) {
|
|
115707
116869
|
return [key2, run];
|
|
115708
116870
|
}
|
|
115709
116871
|
}
|
|
@@ -115711,7 +116873,7 @@ function firstTextRun(paragraph, getLocalName2) {
|
|
|
115711
116873
|
return void 0;
|
|
115712
116874
|
}
|
|
115713
116875
|
function setTitleText(title, text2, getLocalName2) {
|
|
115714
|
-
const txKey =
|
|
116876
|
+
const txKey = findKey9(title, "tx", getLocalName2) ?? "c:tx";
|
|
115715
116877
|
const tx = title[txKey];
|
|
115716
116878
|
const texts = [];
|
|
115717
116879
|
if (tx && typeof tx === "object") {
|
|
@@ -115720,7 +116882,7 @@ function setTitleText(title, text2, getLocalName2) {
|
|
|
115720
116882
|
if (texts.join("") === text2) {
|
|
115721
116883
|
return;
|
|
115722
116884
|
}
|
|
115723
|
-
const richKey = tx && typeof tx === "object" ?
|
|
116885
|
+
const richKey = tx && typeof tx === "object" ? findKey9(tx, "rich", getLocalName2) : void 0;
|
|
115724
116886
|
const rich = richKey ? tx[richKey] : void 0;
|
|
115725
116887
|
if (!rich || typeof rich !== "object" || Array.isArray(rich)) {
|
|
115726
116888
|
const textNode = buildTitle(text2)["c:tx"];
|
|
@@ -115731,7 +116893,7 @@ function setTitleText(title, text2, getLocalName2) {
|
|
|
115731
116893
|
}
|
|
115732
116894
|
return;
|
|
115733
116895
|
}
|
|
115734
|
-
const pKey =
|
|
116896
|
+
const pKey = findKey9(rich, "p", getLocalName2) ?? "a:p";
|
|
115735
116897
|
const value = rich[pKey];
|
|
115736
116898
|
const paragraphs = (Array.isArray(value) ? value : [value]).filter(
|
|
115737
116899
|
(entry) => Boolean(entry) && typeof entry === "object" && !Array.isArray(entry)
|
|
@@ -115740,9 +116902,9 @@ function setTitleText(title, text2, getLocalName2) {
|
|
|
115740
116902
|
const carrier = firstTextRun(paragraph, getLocalName2);
|
|
115741
116903
|
const original = carrier?.[1] ?? {};
|
|
115742
116904
|
const runKey = carrier ? carrier[0].replace(/[^:]+$/u, "r") : "a:r";
|
|
115743
|
-
const rPrKey =
|
|
116905
|
+
const rPrKey = findKey9(original, "rPr", getLocalName2);
|
|
115744
116906
|
const run = carrier && getLocalName2(carrier[0]) === "r" ? { ...original } : rPrKey ? { [rPrKey]: original[rPrKey] } : {};
|
|
115745
|
-
const textKey =
|
|
116907
|
+
const textKey = findKey9(original, "t", getLocalName2) ?? "a:t";
|
|
115746
116908
|
const oldText = original[textKey];
|
|
115747
116909
|
const attributes = oldText && typeof oldText === "object" && !Array.isArray(oldText) ? oldText : void 0;
|
|
115748
116910
|
run[textKey] = attributes ? { ...attributes, "#text": text2 } : text2;
|
|
@@ -115782,7 +116944,7 @@ function applyChartAxisTitleToXml(axisNode, titleText, getLocalName2) {
|
|
|
115782
116944
|
if (titleText === void 0) {
|
|
115783
116945
|
return;
|
|
115784
116946
|
}
|
|
115785
|
-
const titleKey =
|
|
116947
|
+
const titleKey = findKey9(axisNode, "title", getLocalName2);
|
|
115786
116948
|
if (titleText === "") {
|
|
115787
116949
|
if (titleKey) {
|
|
115788
116950
|
delete axisNode[titleKey];
|
|
@@ -115822,27 +116984,27 @@ function applyChartAxisTitleStyleToXml(axisNode, style, getLocalName2, resolveCo
|
|
|
115822
116984
|
if (!hasAny) {
|
|
115823
116985
|
return;
|
|
115824
116986
|
}
|
|
115825
|
-
const titleKey =
|
|
116987
|
+
const titleKey = findKey9(axisNode, "title", getLocalName2);
|
|
115826
116988
|
if (!titleKey) {
|
|
115827
116989
|
return;
|
|
115828
116990
|
}
|
|
115829
116991
|
const title = { ...axisNode[titleKey] ?? {} };
|
|
115830
|
-
const txPrKey =
|
|
116992
|
+
const txPrKey = findKey9(title, "txPr", getLocalName2) ?? "c:txPr";
|
|
115831
116993
|
const txPr = { ...title[txPrKey] ?? {} };
|
|
115832
|
-
if (!txPr[
|
|
116994
|
+
if (!txPr[findKey9(txPr, "bodyPr", getLocalName2) ?? "a:bodyPr"]) {
|
|
115833
116995
|
txPr["a:bodyPr"] = {};
|
|
115834
116996
|
}
|
|
115835
|
-
if (!txPr[
|
|
116997
|
+
if (!txPr[findKey9(txPr, "lstStyle", getLocalName2) ?? "a:lstStyle"]) {
|
|
115836
116998
|
txPr["a:lstStyle"] = {};
|
|
115837
116999
|
}
|
|
115838
|
-
const pKey =
|
|
117000
|
+
const pKey = findKey9(txPr, "p", getLocalName2) ?? "a:p";
|
|
115839
117001
|
const existingP = txPr[pKey];
|
|
115840
117002
|
const para = {
|
|
115841
117003
|
...(Array.isArray(existingP) ? existingP[0] : existingP) ?? {}
|
|
115842
117004
|
};
|
|
115843
|
-
const pPrKey =
|
|
117005
|
+
const pPrKey = findKey9(para, "pPr", getLocalName2) ?? "a:pPr";
|
|
115844
117006
|
const pPr = { ...para[pPrKey] ?? {} };
|
|
115845
|
-
const defRPrKey =
|
|
117007
|
+
const defRPrKey = findKey9(pPr, "defRPr", getLocalName2) ?? "a:defRPr";
|
|
115846
117008
|
const existingDefRPr = pPr[defRPrKey] ?? {};
|
|
115847
117009
|
pPr[defRPrKey] = { ...existingDefRPr, ...buildDefRPr(style, existingDefRPr, resolveColor2) };
|
|
115848
117010
|
para[pPrKey] = pPr;
|
|
@@ -115934,140 +117096,8 @@ var init_chart_color_map_override = __esm({
|
|
|
115934
117096
|
}
|
|
115935
117097
|
});
|
|
115936
117098
|
|
|
115937
|
-
// src/pptx/core/utils/chart-container-schema.ts
|
|
115938
|
-
function normalizeChartGroupingValue(containerLocal, value) {
|
|
115939
|
-
const isBar = containerLocal === "barChart" || containerLocal === "bar3DChart";
|
|
115940
|
-
return !isBar && value === "clustered" ? "standard" : value;
|
|
115941
|
-
}
|
|
115942
|
-
function normalizeGroupingNode(containerLocal, node) {
|
|
115943
|
-
const value = node["@_val"];
|
|
115944
|
-
if (value !== void 0) {
|
|
115945
|
-
node["@_val"] = normalizeChartGroupingValue(containerLocal, value);
|
|
115946
|
-
}
|
|
115947
|
-
}
|
|
115948
|
-
function normalizeChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
115949
|
-
if (!isKnownChartContainer(containerLocal)) {
|
|
115950
|
-
return;
|
|
115951
|
-
}
|
|
115952
|
-
for (const key2 of Object.keys(container2)) {
|
|
115953
|
-
if (key2.startsWith("@_") || key2 === "#text") {
|
|
115954
|
-
continue;
|
|
115955
|
-
}
|
|
115956
|
-
const local = getLocalName2(key2);
|
|
115957
|
-
if (!chartContainerAllows(containerLocal, local)) {
|
|
115958
|
-
delete container2[key2];
|
|
115959
|
-
continue;
|
|
115960
|
-
}
|
|
115961
|
-
if (local === "grouping") {
|
|
115962
|
-
const node = container2[key2];
|
|
115963
|
-
if (node && typeof node === "object" && !Array.isArray(node)) {
|
|
115964
|
-
normalizeGroupingNode(containerLocal, node);
|
|
115965
|
-
}
|
|
115966
|
-
}
|
|
115967
|
-
}
|
|
115968
|
-
const required = REQUIRED_LEADING_CHILD[containerLocal];
|
|
115969
|
-
if (required) {
|
|
115970
|
-
const present = Object.keys(container2).some((k) => getLocalName2(k) === required.local);
|
|
115971
|
-
if (!present) {
|
|
115972
|
-
container2[`c:${required.local}`] = { "@_val": required.val };
|
|
115973
|
-
}
|
|
115974
|
-
}
|
|
115975
|
-
}
|
|
115976
|
-
function orderChartContainerChildren(container2, containerLocal, getLocalName2) {
|
|
115977
|
-
const order = CHART_CONTAINER_CHILD_ORDER[containerLocal];
|
|
115978
|
-
if (!order) {
|
|
115979
|
-
return;
|
|
115980
|
-
}
|
|
115981
|
-
const keys = Object.keys(container2).filter((k) => !k.startsWith("@_") && k !== "#text");
|
|
115982
|
-
if (keys.some((k) => !order.includes(getLocalName2(k)))) {
|
|
115983
|
-
return;
|
|
115984
|
-
}
|
|
115985
|
-
const sorted = [...keys].sort(
|
|
115986
|
-
(a, b) => order.indexOf(getLocalName2(a)) - order.indexOf(getLocalName2(b))
|
|
115987
|
-
);
|
|
115988
|
-
if (sorted.every((k, i2) => k === keys[i2])) {
|
|
115989
|
-
return;
|
|
115990
|
-
}
|
|
115991
|
-
const saved = sorted.map((k) => [k, container2[k]]);
|
|
115992
|
-
for (const k of keys) {
|
|
115993
|
-
delete container2[k];
|
|
115994
|
-
}
|
|
115995
|
-
for (const [k, v] of saved) {
|
|
115996
|
-
container2[k] = v;
|
|
115997
|
-
}
|
|
115998
|
-
}
|
|
115999
|
-
function renameXmlKeyInPlace(obj, oldKey, newKey) {
|
|
116000
|
-
if (oldKey === newKey || !(oldKey in obj)) {
|
|
116001
|
-
return;
|
|
116002
|
-
}
|
|
116003
|
-
const entries = Object.keys(obj).map((k) => [k === oldKey ? newKey : k, obj[k]]);
|
|
116004
|
-
for (const k of Object.keys(obj)) {
|
|
116005
|
-
delete obj[k];
|
|
116006
|
-
}
|
|
116007
|
-
for (const [k, v] of entries) {
|
|
116008
|
-
obj[k] = v;
|
|
116009
|
-
}
|
|
116010
|
-
}
|
|
116011
|
-
function referencedAxisIds(plotArea, getLocalName2) {
|
|
116012
|
-
const ids = /* @__PURE__ */ new Set();
|
|
116013
|
-
for (const key2 of Object.keys(plotArea)) {
|
|
116014
|
-
if (!getLocalName2(key2).endsWith("Chart")) {
|
|
116015
|
-
continue;
|
|
116016
|
-
}
|
|
116017
|
-
for (const container2 of toArray2(plotArea[key2])) {
|
|
116018
|
-
for (const childKey3 of Object.keys(container2)) {
|
|
116019
|
-
if (getLocalName2(childKey3) !== "axId") {
|
|
116020
|
-
continue;
|
|
116021
|
-
}
|
|
116022
|
-
for (const axId of toArray2(container2[childKey3])) {
|
|
116023
|
-
const val = axId["@_val"];
|
|
116024
|
-
if (val !== void 0) {
|
|
116025
|
-
ids.add(String(val));
|
|
116026
|
-
}
|
|
116027
|
-
}
|
|
116028
|
-
}
|
|
116029
|
-
}
|
|
116030
|
-
}
|
|
116031
|
-
return ids;
|
|
116032
|
-
}
|
|
116033
|
-
function toArray2(value) {
|
|
116034
|
-
if (Array.isArray(value)) {
|
|
116035
|
-
return value.filter((v) => typeof v === "object" && v !== null);
|
|
116036
|
-
}
|
|
116037
|
-
return typeof value === "object" && value !== null ? [value] : [];
|
|
116038
|
-
}
|
|
116039
|
-
function reconcileChartPlotAreaAxes(plotArea, getLocalName2) {
|
|
116040
|
-
const referenced = referencedAxisIds(plotArea, getLocalName2);
|
|
116041
|
-
let removed = 0;
|
|
116042
|
-
for (const key2 of Object.keys(plotArea)) {
|
|
116043
|
-
const local = getLocalName2(key2);
|
|
116044
|
-
if (!AXIS_LOCAL_NAMES.includes(local)) {
|
|
116045
|
-
continue;
|
|
116046
|
-
}
|
|
116047
|
-
const axes = toArray2(plotArea[key2]);
|
|
116048
|
-
const kept = axes.filter((axis) => {
|
|
116049
|
-
const axIdKey = Object.keys(axis).find((k) => getLocalName2(k) === "axId");
|
|
116050
|
-
const val = axIdKey ? toArray2(axis[axIdKey])[0]?.["@_val"] : void 0;
|
|
116051
|
-
return val !== void 0 && referenced.has(String(val));
|
|
116052
|
-
});
|
|
116053
|
-
removed += axes.length - kept.length;
|
|
116054
|
-
if (kept.length === 0) {
|
|
116055
|
-
delete plotArea[key2];
|
|
116056
|
-
} else if (kept.length !== axes.length) {
|
|
116057
|
-
plotArea[key2] = kept.length === 1 ? kept[0] : kept;
|
|
116058
|
-
}
|
|
116059
|
-
}
|
|
116060
|
-
return removed;
|
|
116061
|
-
}
|
|
116062
|
-
var init_chart_container_schema = __esm({
|
|
116063
|
-
"src/pptx/core/utils/chart-container-schema.ts"() {
|
|
116064
|
-
init_chart_container_content_model();
|
|
116065
|
-
init_chart_container_content_model();
|
|
116066
|
-
}
|
|
116067
|
-
});
|
|
116068
|
-
|
|
116069
117099
|
// src/pptx/core/utils/chart-combo-serializer.ts
|
|
116070
|
-
function
|
|
117100
|
+
function findKey25(obj, local, getLocalName2) {
|
|
116071
117101
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
116072
117102
|
}
|
|
116073
117103
|
function nonSeriesEntries(container2, getLocalName2) {
|
|
@@ -116099,14 +117129,14 @@ function consolidateComboContainersInXml(plotArea, getLocalName2) {
|
|
|
116099
117129
|
if (!primary) {
|
|
116100
117130
|
return { primaryKey, containerChildren };
|
|
116101
117131
|
}
|
|
116102
|
-
const serKey =
|
|
117132
|
+
const serKey = findKey25(primary, "ser", getLocalName2) ?? "c:ser";
|
|
116103
117133
|
const allSeries = [];
|
|
116104
117134
|
for (const key2 of containerKeys) {
|
|
116105
117135
|
const container2 = plotArea[key2];
|
|
116106
117136
|
if (!container2) {
|
|
116107
117137
|
continue;
|
|
116108
117138
|
}
|
|
116109
|
-
const containerSerKey =
|
|
117139
|
+
const containerSerKey = findKey25(container2, "ser", getLocalName2);
|
|
116110
117140
|
if (containerSerKey) {
|
|
116111
117141
|
allSeries.push(...ensureArray18(container2[containerSerKey]));
|
|
116112
117142
|
}
|
|
@@ -116134,7 +117164,7 @@ function applyComboSeriesTypesToXml(plotArea, originalKey, series, chartLevelTyp
|
|
|
116134
117164
|
if (!original) {
|
|
116135
117165
|
return false;
|
|
116136
117166
|
}
|
|
116137
|
-
const serKey =
|
|
117167
|
+
const serKey = findKey25(original, "ser", getLocalName2) ?? "c:ser";
|
|
116138
117168
|
const serNodes = ensureArray18(original[serKey]);
|
|
116139
117169
|
if (serNodes.length !== series.length) {
|
|
116140
117170
|
return false;
|
|
@@ -116191,7 +117221,7 @@ function applyGroupAxisReferences(container2, series, axes, getLocalName2) {
|
|
|
116191
117221
|
if (valueAxisId === void 0 || categoryAxisId === void 0) {
|
|
116192
117222
|
return;
|
|
116193
117223
|
}
|
|
116194
|
-
const key2 =
|
|
117224
|
+
const key2 = findKey25(container2, "axId", getLocalName2) ?? "c:axId";
|
|
116195
117225
|
container2[key2] = [{ "@_val": String(categoryAxisId) }, { "@_val": String(valueAxisId) }];
|
|
116196
117226
|
}
|
|
116197
117227
|
var init_chart_combo_serializer = __esm({
|
|
@@ -116201,7 +117231,7 @@ var init_chart_combo_serializer = __esm({
|
|
|
116201
117231
|
});
|
|
116202
117232
|
|
|
116203
117233
|
// src/pptx/core/utils/chart-filtered-series-writer.ts
|
|
116204
|
-
function
|
|
117234
|
+
function findKey26(obj, local, getLocalName2) {
|
|
116205
117235
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
116206
117236
|
}
|
|
116207
117237
|
function points3(values) {
|
|
@@ -116259,9 +117289,9 @@ function filteredSeriesUnchanged(container2, filteredSeries, xmlLookup) {
|
|
|
116259
117289
|
});
|
|
116260
117290
|
}
|
|
116261
117291
|
function applyFilteredSeriesToXml(container2, filteredSeries, categories, containerLocalName, getLocalName2) {
|
|
116262
|
-
const extLstKey =
|
|
117292
|
+
const extLstKey = findKey26(container2, "extLst", getLocalName2) ?? "c:extLst";
|
|
116263
117293
|
const extLst = { ...container2[extLstKey] ?? {} };
|
|
116264
|
-
const extKey =
|
|
117294
|
+
const extKey = findKey26(extLst, "ext", getLocalName2);
|
|
116265
117295
|
const exts = extKey ? Array.isArray(extLst[extKey]) ? [...extLst[extKey]] : [extLst[extKey]] : [];
|
|
116266
117296
|
const otherExts = exts.filter((ext) => ext["@_uri"] !== CHART_FILTERED_SERIES_EXT_URI);
|
|
116267
117297
|
const ownExt = {
|
|
@@ -116475,11 +117505,11 @@ var init_chart_legend_serializer = __esm({
|
|
|
116475
117505
|
});
|
|
116476
117506
|
|
|
116477
117507
|
// src/pptx/core/utils/chart-line-style-serializer.ts
|
|
116478
|
-
function
|
|
117508
|
+
function findKey27(node, name, localName29) {
|
|
116479
117509
|
return Object.keys(node).find((key2) => localName29(key2) === name);
|
|
116480
117510
|
}
|
|
116481
117511
|
function setOrdered5(node, name, value, localName29) {
|
|
116482
|
-
const key2 =
|
|
117512
|
+
const key2 = findKey27(node, name, localName29);
|
|
116483
117513
|
if (key2) {
|
|
116484
117514
|
node[key2] = value;
|
|
116485
117515
|
return;
|
|
@@ -116504,7 +117534,7 @@ function applyChartLineStyle(chartContainer, elementName, style, localName29, re
|
|
|
116504
117534
|
if (style === void 0) {
|
|
116505
117535
|
return;
|
|
116506
117536
|
}
|
|
116507
|
-
const key2 =
|
|
117537
|
+
const key2 = findKey27(chartContainer, elementName, localName29);
|
|
116508
117538
|
if (style === null) {
|
|
116509
117539
|
if (key2) {
|
|
116510
117540
|
delete chartContainer[key2];
|
|
@@ -116515,7 +117545,7 @@ function applyChartLineStyle(chartContainer, elementName, style, localName29, re
|
|
|
116515
117545
|
const node = { ...existing };
|
|
116516
117546
|
const hasLineProps = style.color || style.width !== void 0 || style.dashStyle;
|
|
116517
117547
|
if (hasLineProps) {
|
|
116518
|
-
const spPrKey =
|
|
117548
|
+
const spPrKey = findKey27(node, "spPr", localName29) ?? "c:spPr";
|
|
116519
117549
|
node[spPrKey] = writeChartShapeProps(
|
|
116520
117550
|
node[spPrKey],
|
|
116521
117551
|
{ strokeColor: style.color, strokeWidth: style.width, strokeDashStyle: style.dashStyle },
|
|
@@ -116549,7 +117579,7 @@ var init_chart_line_style_serializer = __esm({
|
|
|
116549
117579
|
});
|
|
116550
117580
|
|
|
116551
117581
|
// src/pptx/core/utils/chart-series-color-serializer.ts
|
|
116552
|
-
function
|
|
117582
|
+
function findKey28(obj, local, getLocalName2) {
|
|
116553
117583
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
116554
117584
|
}
|
|
116555
117585
|
function insertBeforeLn(obj, key2, value, getLocalName2) {
|
|
@@ -116579,14 +117609,14 @@ function insertFirst(obj, key2, value) {
|
|
|
116579
117609
|
function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolveColor2) {
|
|
116580
117610
|
const normalizedHex = hex3.replace(/^#/u, "");
|
|
116581
117611
|
if (isLineFamily) {
|
|
116582
|
-
const lnKey =
|
|
117612
|
+
const lnKey = findKey28(spPr, "ln", getLocalName2) ?? "a:ln";
|
|
116583
117613
|
const ln = spPr[lnKey] ?? {};
|
|
116584
117614
|
const hadLn = Boolean(spPr[lnKey]);
|
|
116585
|
-
const noFillKey =
|
|
117615
|
+
const noFillKey = findKey28(ln, "noFill", getLocalName2);
|
|
116586
117616
|
if (noFillKey) {
|
|
116587
117617
|
delete ln[noFillKey];
|
|
116588
117618
|
}
|
|
116589
|
-
const lnFillKey =
|
|
117619
|
+
const lnFillKey = findKey28(ln, "solidFill", getLocalName2) ?? "a:solidFill";
|
|
116590
117620
|
const authoredFill2 = ln[lnFillKey];
|
|
116591
117621
|
const fillNode2 = serializeColorChoice(
|
|
116592
117622
|
authoredFill2,
|
|
@@ -116603,7 +117633,7 @@ function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolve
|
|
|
116603
117633
|
}
|
|
116604
117634
|
return;
|
|
116605
117635
|
}
|
|
116606
|
-
const fillKey =
|
|
117636
|
+
const fillKey = findKey28(spPr, "solidFill", getLocalName2) ?? "a:solidFill";
|
|
116607
117637
|
const authoredFill = spPr[fillKey];
|
|
116608
117638
|
const fillNode = serializeColorChoice(
|
|
116609
117639
|
authoredFill,
|
|
@@ -116611,7 +117641,7 @@ function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolve
|
|
|
116611
117641
|
normalizedHex
|
|
116612
117642
|
);
|
|
116613
117643
|
if (authoredFill) {
|
|
116614
|
-
const noFillKey =
|
|
117644
|
+
const noFillKey = findKey28(spPr, "noFill", getLocalName2);
|
|
116615
117645
|
if (noFillKey) {
|
|
116616
117646
|
delete spPr[noFillKey];
|
|
116617
117647
|
}
|
|
@@ -116626,7 +117656,7 @@ function writeSeriesColorToSpPr(spPr, hex3, isLineFamily, getLocalName2, resolve
|
|
|
116626
117656
|
}
|
|
116627
117657
|
}
|
|
116628
117658
|
function ensureSeriesSpPr(seriesNode, getLocalName2) {
|
|
116629
|
-
const existingKey =
|
|
117659
|
+
const existingKey = findKey28(seriesNode, "spPr", getLocalName2);
|
|
116630
117660
|
if (existingKey) {
|
|
116631
117661
|
return seriesNode[existingKey];
|
|
116632
117662
|
}
|
|
@@ -116646,7 +117676,7 @@ function applySeriesGradientToXml(seriesNode, gradient, getLocalName2, options =
|
|
|
116646
117676
|
if (options.lineDrawn) {
|
|
116647
117677
|
return false;
|
|
116648
117678
|
}
|
|
116649
|
-
const spPrKey =
|
|
117679
|
+
const spPrKey = findKey28(seriesNode, "spPr", getLocalName2);
|
|
116650
117680
|
if (!spPrKey && !gradient) {
|
|
116651
117681
|
return false;
|
|
116652
117682
|
}
|
|
@@ -116682,11 +117712,11 @@ var init_chart_series_color_serializer = __esm({
|
|
|
116682
117712
|
});
|
|
116683
117713
|
|
|
116684
117714
|
// src/pptx/core/utils/chart-subtype-serializer.ts
|
|
116685
|
-
function
|
|
117715
|
+
function findKey29(obj, local, getLocalName2) {
|
|
116686
117716
|
return Object.keys(obj).find((k) => getLocalName2(k) === local);
|
|
116687
117717
|
}
|
|
116688
117718
|
function upsertValChild(parent, localName29, value, getLocalName2) {
|
|
116689
|
-
const existingKey =
|
|
117719
|
+
const existingKey = findKey29(parent, localName29, getLocalName2);
|
|
116690
117720
|
if (value === void 0) {
|
|
116691
117721
|
if (existingKey) {
|
|
116692
117722
|
delete parent[existingKey];
|
|
@@ -116726,7 +117756,7 @@ function applySurfaceWireframeToXml(chartTypeContainer, containerLocalName, wire
|
|
|
116726
117756
|
orderChartContainerChildren(chartTypeContainer, containerLocalName, getLocalName2);
|
|
116727
117757
|
}
|
|
116728
117758
|
function applySeriesBar3DShapeToXml(seriesNode, shape, getLocalName2) {
|
|
116729
|
-
const existingKey =
|
|
117759
|
+
const existingKey = findKey29(seriesNode, "shape", getLocalName2);
|
|
116730
117760
|
if (shape === void 0) {
|
|
116731
117761
|
if (existingKey) {
|
|
116732
117762
|
delete seriesNode[existingKey];
|
|
@@ -116871,7 +117901,7 @@ var init_chart_title_run_alignment = __esm({
|
|
|
116871
117901
|
// src/pptx/core/utils/chart-title-serializer.ts
|
|
116872
117902
|
function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefix: "c" }) {
|
|
116873
117903
|
const { prefix } = options;
|
|
116874
|
-
const existingKey =
|
|
117904
|
+
const existingKey = findKey9(chartRoot, "title", getLocalName2);
|
|
116875
117905
|
const remove = model.hasTitle === false || model.title === "" && model.hasTitle !== true;
|
|
116876
117906
|
if (remove) {
|
|
116877
117907
|
if (existingKey) {
|
|
@@ -116909,14 +117939,14 @@ function applyChartTitleToXml(chartRoot, model, getLocalName2, options = { prefi
|
|
|
116909
117939
|
insertAt2(chartRoot, 0, `${prefix}:title`, titleNode);
|
|
116910
117940
|
}
|
|
116911
117941
|
} else if (runs) {
|
|
116912
|
-
const txKey =
|
|
117942
|
+
const txKey = findKey9(titleNode, "tx", getLocalName2);
|
|
116913
117943
|
if (txKey) {
|
|
116914
117944
|
titleNode[txKey] = buildTitleTextFromRuns(prefix, runs);
|
|
116915
117945
|
} else {
|
|
116916
117946
|
insertAt2(titleNode, 0, `${prefix}:tx`, buildTitleTextFromRuns(prefix, runs));
|
|
116917
117947
|
}
|
|
116918
117948
|
} else if (model.title !== void 0 && !replaceFirstText(titleNode, model.title, getLocalName2)) {
|
|
116919
|
-
const txKey =
|
|
117949
|
+
const txKey = findKey9(titleNode, "tx", getLocalName2);
|
|
116920
117950
|
if (txKey) {
|
|
116921
117951
|
titleNode[txKey] = buildTitleText(prefix, model.title);
|
|
116922
117952
|
} else {
|
|
@@ -116937,7 +117967,7 @@ var init_chart_title_serializer = __esm({
|
|
|
116937
117967
|
});
|
|
116938
117968
|
|
|
116939
117969
|
// src/pptx/core/utils/chart-title-style-serializer.ts
|
|
116940
|
-
function
|
|
117970
|
+
function findKey30(node, localName29, getLocalName2) {
|
|
116941
117971
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName29);
|
|
116942
117972
|
}
|
|
116943
117973
|
function setChildOrdered(node, key2, existingKey, value, laterNames, getLocalName2) {
|
|
@@ -116980,9 +118010,9 @@ function asArray3(value) {
|
|
|
116980
118010
|
return value && typeof value === "object" ? [value] : [];
|
|
116981
118011
|
}
|
|
116982
118012
|
function applyRichTitleFont(title, style, getLocalName2, resolveColor2) {
|
|
116983
|
-
const txKey =
|
|
118013
|
+
const txKey = findKey30(title, "tx", getLocalName2);
|
|
116984
118014
|
const tx = txKey ? title[txKey] : void 0;
|
|
116985
|
-
const richKey = tx ?
|
|
118015
|
+
const richKey = tx ? findKey30(tx, "rich", getLocalName2) : void 0;
|
|
116986
118016
|
const rich = richKey && tx ? tx[richKey] : void 0;
|
|
116987
118017
|
if (!tx || !rich || !txKey || !richKey) {
|
|
116988
118018
|
return void 0;
|
|
@@ -116991,22 +118021,22 @@ function applyRichTitleFont(title, style, getLocalName2, resolveColor2) {
|
|
|
116991
118021
|
if (!hasFont) {
|
|
116992
118022
|
return txKey;
|
|
116993
118023
|
}
|
|
116994
|
-
const pKey =
|
|
118024
|
+
const pKey = findKey30(rich, "p", getLocalName2) ?? "a:p";
|
|
116995
118025
|
const paragraphs = asArray3(rich[pKey]).map((para) => {
|
|
116996
118026
|
const next = { ...para };
|
|
116997
|
-
const pPrKey =
|
|
118027
|
+
const pPrKey = findKey30(next, "pPr", getLocalName2) ?? "a:pPr";
|
|
116998
118028
|
const pPr = { ...next[pPrKey] ?? {} };
|
|
116999
|
-
const defRPrKey =
|
|
118029
|
+
const defRPrKey = findKey30(pPr, "defRPr", getLocalName2) ?? "a:defRPr";
|
|
117000
118030
|
const existingDefRPr = pPr[defRPrKey] ?? {};
|
|
117001
118031
|
pPr[defRPrKey] = {
|
|
117002
118032
|
...existingDefRPr,
|
|
117003
118033
|
...buildTitleDefRPr(style, existingDefRPr, resolveColor2)
|
|
117004
118034
|
};
|
|
117005
118035
|
next[pPrKey] = pPr;
|
|
117006
|
-
const rKey =
|
|
118036
|
+
const rKey = findKey30(next, "r", getLocalName2);
|
|
117007
118037
|
if (rKey) {
|
|
117008
118038
|
const runs = asArray3(next[rKey]).map((run) => {
|
|
117009
|
-
const rPrKey =
|
|
118039
|
+
const rPrKey = findKey30(run, "rPr", getLocalName2) ?? "a:rPr";
|
|
117010
118040
|
const existingRPr = run[rPrKey] ?? {};
|
|
117011
118041
|
const nextRun = { ...run };
|
|
117012
118042
|
nextRun[rPrKey] = { ...existingRPr, ...buildTitleDefRPr(style, existingRPr, resolveColor2) };
|
|
@@ -117029,13 +118059,13 @@ function applyChartTitleStyleToXml(chartRoot, style, getLocalName2, options = {
|
|
|
117029
118059
|
return;
|
|
117030
118060
|
}
|
|
117031
118061
|
const { prefix } = options;
|
|
117032
|
-
const titleKey =
|
|
118062
|
+
const titleKey = findKey30(chartRoot, "title", getLocalName2);
|
|
117033
118063
|
if (!titleKey) {
|
|
117034
118064
|
return;
|
|
117035
118065
|
}
|
|
117036
118066
|
const title = { ...chartRoot[titleKey] ?? {} };
|
|
117037
118067
|
if (style.spPr !== void 0) {
|
|
117038
|
-
const spPrKey =
|
|
118068
|
+
const spPrKey = findKey30(title, "spPr", getLocalName2);
|
|
117039
118069
|
if (style.spPr === null) {
|
|
117040
118070
|
if (spPrKey) {
|
|
117041
118071
|
delete title[spPrKey];
|
|
@@ -117052,23 +118082,23 @@ function applyChartTitleStyleToXml(chartRoot, style, getLocalName2, options = {
|
|
|
117052
118082
|
}
|
|
117053
118083
|
const richKey = applyRichTitleFont(title, style, getLocalName2, resolveColor2);
|
|
117054
118084
|
if (hasFont && richKey === void 0) {
|
|
117055
|
-
const existingTxPrKey =
|
|
118085
|
+
const existingTxPrKey = findKey30(title, "txPr", getLocalName2);
|
|
117056
118086
|
const txPrKey = existingTxPrKey ?? `${prefix}:txPr`;
|
|
117057
118087
|
const txPr = { ...title[txPrKey] ?? {} };
|
|
117058
|
-
if (!txPr[
|
|
118088
|
+
if (!txPr[findKey30(txPr, "bodyPr", getLocalName2) ?? "a:bodyPr"]) {
|
|
117059
118089
|
txPr["a:bodyPr"] = {};
|
|
117060
118090
|
}
|
|
117061
|
-
if (!txPr[
|
|
118091
|
+
if (!txPr[findKey30(txPr, "lstStyle", getLocalName2) ?? "a:lstStyle"]) {
|
|
117062
118092
|
txPr["a:lstStyle"] = {};
|
|
117063
118093
|
}
|
|
117064
|
-
const pKey =
|
|
118094
|
+
const pKey = findKey30(txPr, "p", getLocalName2) ?? "a:p";
|
|
117065
118095
|
const existingP = txPr[pKey];
|
|
117066
118096
|
const para = {
|
|
117067
118097
|
...(Array.isArray(existingP) ? existingP[0] : existingP) ?? {}
|
|
117068
118098
|
};
|
|
117069
|
-
const pPrKey =
|
|
118099
|
+
const pPrKey = findKey30(para, "pPr", getLocalName2) ?? "a:pPr";
|
|
117070
118100
|
const pPr = { ...para[pPrKey] ?? {} };
|
|
117071
|
-
const defRPrKey =
|
|
118101
|
+
const defRPrKey = findKey30(pPr, "defRPr", getLocalName2) ?? "a:defRPr";
|
|
117072
118102
|
const existingDefRPr = pPr[defRPrKey] ?? {};
|
|
117073
118103
|
pPr[defRPrKey] = {
|
|
117074
118104
|
...existingDefRPr,
|
|
@@ -117218,7 +118248,7 @@ var init_chart_xlsx_writer = __esm({
|
|
|
117218
118248
|
});
|
|
117219
118249
|
|
|
117220
118250
|
// src/pptx/core/core/runtime/chart-cx-update-data.ts
|
|
117221
|
-
function
|
|
118251
|
+
function findKey31(node, localName29, getLocalName2) {
|
|
117222
118252
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName29);
|
|
117223
118253
|
}
|
|
117224
118254
|
function asArray4(value) {
|
|
@@ -117233,8 +118263,8 @@ function dimensionType(node) {
|
|
|
117233
118263
|
return String(node["@_type"] ?? "");
|
|
117234
118264
|
}
|
|
117235
118265
|
function replaceLevels(target, source, getLocalName2) {
|
|
117236
|
-
const targetKey =
|
|
117237
|
-
const sourceKey =
|
|
118266
|
+
const targetKey = findKey31(target, "lvl", getLocalName2) ?? "cx:lvl";
|
|
118267
|
+
const sourceKey = findKey31(source, "lvl", getLocalName2);
|
|
117238
118268
|
const oldLevels = asArray4(target[targetKey]);
|
|
117239
118269
|
const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level2, index) => {
|
|
117240
118270
|
const old = oldLevels[index];
|
|
@@ -117253,8 +118283,8 @@ function replaceLevels(target, source, getLocalName2) {
|
|
|
117253
118283
|
}
|
|
117254
118284
|
function replaceChartExDataDimensions(target, fresh, getLocalName2) {
|
|
117255
118285
|
for (const kind of ["strDim", "numDim"]) {
|
|
117256
|
-
const targetKey =
|
|
117257
|
-
const freshKey =
|
|
118286
|
+
const targetKey = findKey31(target, kind, getLocalName2) ?? `cx:${kind}`;
|
|
118287
|
+
const freshKey = findKey31(fresh, kind, getLocalName2);
|
|
117258
118288
|
const existing = asArray4(target[targetKey]);
|
|
117259
118289
|
const incoming = asArray4(freshKey ? fresh[freshKey] : void 0);
|
|
117260
118290
|
for (const dimension of incoming) {
|
|
@@ -117283,14 +118313,14 @@ var init_chart_cx_update_data = __esm({
|
|
|
117283
118313
|
});
|
|
117284
118314
|
|
|
117285
118315
|
// src/pptx/core/core/runtime/chart-cx-update-series.ts
|
|
117286
|
-
function
|
|
118316
|
+
function findKey32(node, localName29, getLocalName2) {
|
|
117287
118317
|
return Object.keys(node).find((key2) => getLocalName2(key2) === localName29);
|
|
117288
118318
|
}
|
|
117289
118319
|
function child24(node, localName29, getLocalName2) {
|
|
117290
118320
|
if (!node) {
|
|
117291
118321
|
return void 0;
|
|
117292
118322
|
}
|
|
117293
|
-
const key2 =
|
|
118323
|
+
const key2 = findKey32(node, localName29, getLocalName2);
|
|
117294
118324
|
const value = key2 ? node[key2] : void 0;
|
|
117295
118325
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
117296
118326
|
}
|
|
@@ -117302,7 +118332,7 @@ function asArray5(value) {
|
|
|
117302
118332
|
(entry) => Boolean(entry) && typeof entry === "object"
|
|
117303
118333
|
);
|
|
117304
118334
|
}
|
|
117305
|
-
function
|
|
118335
|
+
function insertBefore3(parent, key2, value, before, getLocalName2) {
|
|
117306
118336
|
const entries = Object.keys(parent).map((k) => [k, parent[k]]);
|
|
117307
118337
|
let index = entries.findIndex(([k]) => !k.startsWith("@_") && before.includes(getLocalName2(k)));
|
|
117308
118338
|
if (index === -1) {
|
|
@@ -117320,15 +118350,15 @@ function applySeriesName(node, name, getLocalName2) {
|
|
|
117320
118350
|
const tx = child24(node, "tx", getLocalName2);
|
|
117321
118351
|
const txData = child24(tx, "txData", getLocalName2);
|
|
117322
118352
|
if (tx && txData) {
|
|
117323
|
-
const vKey =
|
|
118353
|
+
const vKey = findKey32(txData, "v", getLocalName2) ?? "cx:v";
|
|
117324
118354
|
txData[vKey] = name;
|
|
117325
118355
|
return;
|
|
117326
118356
|
}
|
|
117327
|
-
const txKey =
|
|
118357
|
+
const txKey = findKey32(node, "tx", getLocalName2);
|
|
117328
118358
|
if (txKey) {
|
|
117329
118359
|
delete node[txKey];
|
|
117330
118360
|
}
|
|
117331
|
-
|
|
118361
|
+
insertBefore3(node, "cx:tx", { "cx:txData": { "cx:v": name } }, AFTER_TX, getLocalName2);
|
|
117332
118362
|
}
|
|
117333
118363
|
function currentSeriesColor(node, getLocalName2) {
|
|
117334
118364
|
const srgb = child24(
|
|
@@ -117350,7 +118380,7 @@ function applySeriesColor(node, series, getLocalName2) {
|
|
|
117350
118380
|
}
|
|
117351
118381
|
const spPr = child24(node, "spPr", getLocalName2);
|
|
117352
118382
|
if (!spPr) {
|
|
117353
|
-
|
|
118383
|
+
insertBefore3(node, "cx:spPr", fill, AFTER_TX.slice(1), getLocalName2);
|
|
117354
118384
|
return;
|
|
117355
118385
|
}
|
|
117356
118386
|
for (const key2 of Object.keys(spPr)) {
|
|
@@ -117358,13 +118388,13 @@ function applySeriesColor(node, series, getLocalName2) {
|
|
|
117358
118388
|
delete spPr[key2];
|
|
117359
118389
|
}
|
|
117360
118390
|
}
|
|
117361
|
-
|
|
118391
|
+
insertBefore3(spPr, "a:solidFill", fill["a:solidFill"], AFTER_FILL2, getLocalName2);
|
|
117362
118392
|
}
|
|
117363
118393
|
function applySeriesDataLabels(node, hasDataLabels, getLocalName2) {
|
|
117364
118394
|
if (hasDataLabels === void 0) {
|
|
117365
118395
|
return;
|
|
117366
118396
|
}
|
|
117367
|
-
const key2 =
|
|
118397
|
+
const key2 = findKey32(node, "dataLabels", getLocalName2);
|
|
117368
118398
|
if (!hasDataLabels) {
|
|
117369
118399
|
if (key2) {
|
|
117370
118400
|
delete node[key2];
|
|
@@ -117372,7 +118402,7 @@ function applySeriesDataLabels(node, hasDataLabels, getLocalName2) {
|
|
|
117372
118402
|
return;
|
|
117373
118403
|
}
|
|
117374
118404
|
if (!key2) {
|
|
117375
|
-
|
|
118405
|
+
insertBefore3(
|
|
117376
118406
|
node,
|
|
117377
118407
|
"cx:dataLabels",
|
|
117378
118408
|
buildChartExDataLabels(),
|
|
@@ -117403,7 +118433,7 @@ function bindSeriesData(node, dataNodes, chartData, series, getLocalName2) {
|
|
|
117403
118433
|
);
|
|
117404
118434
|
return;
|
|
117405
118435
|
}
|
|
117406
|
-
const inlineKey =
|
|
118436
|
+
const inlineKey = findKey32(node, "data", getLocalName2);
|
|
117407
118437
|
if (inlineKey && !dataIdNode) {
|
|
117408
118438
|
const inline = node[inlineKey];
|
|
117409
118439
|
if (inline && typeof inline === "object" && !Array.isArray(inline)) {
|
|
@@ -117420,7 +118450,7 @@ function bindSeriesData(node, dataNodes, chartData, series, getLocalName2) {
|
|
|
117420
118450
|
if (dataIdNode) {
|
|
117421
118451
|
dataIdNode["@_val"] = String(id);
|
|
117422
118452
|
} else {
|
|
117423
|
-
|
|
118453
|
+
insertBefore3(
|
|
117424
118454
|
node,
|
|
117425
118455
|
"cx:dataId",
|
|
117426
118456
|
{ "@_val": String(id) },
|
|
@@ -117456,7 +118486,7 @@ function applyLegend(chartRoot, chartData, getLocalName2) {
|
|
|
117456
118486
|
if (!style || style.hasLegend === void 0) {
|
|
117457
118487
|
return;
|
|
117458
118488
|
}
|
|
117459
|
-
const key2 =
|
|
118489
|
+
const key2 = findKey32(chartRoot, "legend", getLocalName2);
|
|
117460
118490
|
if (!style.hasLegend) {
|
|
117461
118491
|
if (key2) {
|
|
117462
118492
|
delete chartRoot[key2];
|
|
@@ -117474,7 +118504,7 @@ function applyLegend(chartRoot, chartData, getLocalName2) {
|
|
|
117474
118504
|
delete chartRoot[key2];
|
|
117475
118505
|
}
|
|
117476
118506
|
const legend = buildChartExLegend(style.legendPosition);
|
|
117477
|
-
|
|
118507
|
+
insertBefore3(chartRoot, "cx:legend", legend, ["extLst"], getLocalName2);
|
|
117478
118508
|
}
|
|
117479
118509
|
function chartExLayoutChanged(chartSpace, chartData, getLocalName2) {
|
|
117480
118510
|
const region = child24(
|
|
@@ -117482,7 +118512,7 @@ function chartExLayoutChanged(chartSpace, chartData, getLocalName2) {
|
|
|
117482
118512
|
"plotAreaRegion",
|
|
117483
118513
|
getLocalName2
|
|
117484
118514
|
);
|
|
117485
|
-
const seriesKey = region ?
|
|
118515
|
+
const seriesKey = region ? findKey32(region, "series", getLocalName2) : void 0;
|
|
117486
118516
|
const first = region && seriesKey ? asArray5(region[seriesKey])[0] : void 0;
|
|
117487
118517
|
const existing = String(first?.["@_layoutId"] ?? "").toLowerCase();
|
|
117488
118518
|
const series = chartData.series[0];
|
|
@@ -117498,11 +118528,11 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
|
|
|
117498
118528
|
if (!chartRoot || !region) {
|
|
117499
118529
|
return false;
|
|
117500
118530
|
}
|
|
117501
|
-
const chartDataKey =
|
|
118531
|
+
const chartDataKey = findKey32(chartSpace, "chartData", getLocalName2);
|
|
117502
118532
|
const chartDataNode = (chartDataKey ? chartSpace[chartDataKey] : void 0) ?? {};
|
|
117503
|
-
const dataKey =
|
|
118533
|
+
const dataKey = findKey32(chartDataNode, "data", getLocalName2) ?? "cx:data";
|
|
117504
118534
|
const dataNodes = asArray5(chartDataNode[dataKey]);
|
|
117505
|
-
const seriesKey =
|
|
118535
|
+
const seriesKey = findKey32(region, "series", getLocalName2) ?? "cx:series";
|
|
117506
118536
|
const existing = asArray5(region[seriesKey]);
|
|
117507
118537
|
const updated = [];
|
|
117508
118538
|
chartData.series.forEach((series, index) => {
|
|
@@ -117531,7 +118561,7 @@ function applyChartExUpdate(chartSpace, chartData, getLocalName2) {
|
|
|
117531
118561
|
region[seriesKey] = updated.length === 1 ? updated[0] : updated;
|
|
117532
118562
|
chartDataNode[dataKey] = survivingData.length === 1 ? survivingData[0] : survivingData;
|
|
117533
118563
|
if (!chartDataKey) {
|
|
117534
|
-
|
|
118564
|
+
insertBefore3(chartSpace, "cx:chartData", chartDataNode, ["chart"], getLocalName2);
|
|
117535
118565
|
}
|
|
117536
118566
|
applyChartTitleToXml(
|
|
117537
118567
|
chartRoot,
|
|
@@ -119895,7 +120925,7 @@ var init_master_color_map = __esm({
|
|
|
119895
120925
|
|
|
119896
120926
|
// src/pptx/core/services/native-animation-theme-colors.ts
|
|
119897
120927
|
function resolveToken2(value, resolveThemeColor) {
|
|
119898
|
-
if (!value ||
|
|
120928
|
+
if (!value || HEX_COLOR3.test(value)) {
|
|
119899
120929
|
return value;
|
|
119900
120930
|
}
|
|
119901
120931
|
return resolveThemeColor(value) ?? value;
|
|
@@ -119919,10 +120949,10 @@ function resolveNativeAnimationThemeColors(animations, resolveThemeColor) {
|
|
|
119919
120949
|
} : animation
|
|
119920
120950
|
);
|
|
119921
120951
|
}
|
|
119922
|
-
var
|
|
120952
|
+
var HEX_COLOR3;
|
|
119923
120953
|
var init_native_animation_theme_colors = __esm({
|
|
119924
120954
|
"src/pptx/core/services/native-animation-theme-colors.ts"() {
|
|
119925
|
-
|
|
120955
|
+
HEX_COLOR3 = /^#?[0-9a-f]{6}$/iu;
|
|
119926
120956
|
}
|
|
119927
120957
|
});
|
|
119928
120958
|
|
|
@@ -123651,6 +124681,7 @@ var init_PptxHandlerRuntimeSlideMasters = __esm({
|
|
|
123651
124681
|
var PptxHandlerRuntime10;
|
|
123652
124682
|
var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
123653
124683
|
"src/pptx/core/core/runtime/PptxHandlerRuntimePresentationProps.ts"() {
|
|
124684
|
+
init_chart_area_format();
|
|
123654
124685
|
init_chart_data_label_parser();
|
|
123655
124686
|
init_chart_data_labels_visibility();
|
|
123656
124687
|
init_chart_def_rpr_style();
|
|
@@ -123749,27 +124780,18 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
123749
124780
|
}
|
|
123750
124781
|
}
|
|
123751
124782
|
/**
|
|
123752
|
-
* Resolve the `c:spPr` fill of a chart container
|
|
123753
|
-
* `c:plotArea`) to a colour string, or the literal
|
|
123754
|
-
* `<a:noFill
|
|
123755
|
-
*
|
|
123756
|
-
*
|
|
123757
|
-
* `<a:noFill/>` parses to the empty STRING, so presence - not truthiness -
|
|
123758
|
-
* has to decide.
|
|
124783
|
+
* Resolve the `c:spPr` fill and border of a chart container
|
|
124784
|
+
* (`c:chartSpace` or `c:plotArea`) to a colour string, or the literal
|
|
124785
|
+
* `'none'` for `<a:noFill/>`; `undefined` when the container declares
|
|
124786
|
+
* nothing, which leaves the choice to the renderer. The save path reads it
|
|
124787
|
+
* back with the same function (`chart-area-format.ts`).
|
|
123759
124788
|
*/
|
|
123760
|
-
|
|
123761
|
-
|
|
123762
|
-
|
|
123763
|
-
|
|
123764
|
-
|
|
123765
|
-
const hasNoFill = Object.keys(shapeProperties).some(
|
|
123766
|
-
(key2) => this.compatibilityService.getXmlLocalName(key2) === "noFill"
|
|
124789
|
+
parseChartContainerFormat(container2) {
|
|
124790
|
+
return parseChartAreaFormat(
|
|
124791
|
+
container2,
|
|
124792
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2),
|
|
124793
|
+
(node) => this.parseColor(node)
|
|
123767
124794
|
);
|
|
123768
|
-
if (hasNoFill) {
|
|
123769
|
-
return "none";
|
|
123770
|
-
}
|
|
123771
|
-
const solidFill3 = this.xmlLookupService.getChildByLocalName(shapeProperties, "solidFill");
|
|
123772
|
-
return solidFill3 ? this.parseColor(solidFill3) : void 0;
|
|
123773
124795
|
}
|
|
123774
124796
|
/**
|
|
123775
124797
|
* Extract chart style metadata from chart XML.
|
|
@@ -123785,9 +124807,13 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
123785
124807
|
style.styleId = parseInt(String(styleNode["@_val"]));
|
|
123786
124808
|
hasStyle = true;
|
|
123787
124809
|
}
|
|
123788
|
-
const
|
|
123789
|
-
if (
|
|
123790
|
-
style.chartAreaFill =
|
|
124810
|
+
const chartArea = this.parseChartContainerFormat(chartSpace);
|
|
124811
|
+
if (chartArea.fill) {
|
|
124812
|
+
style.chartAreaFill = chartArea.fill;
|
|
124813
|
+
hasStyle = true;
|
|
124814
|
+
}
|
|
124815
|
+
if (chartArea.border) {
|
|
124816
|
+
style.chartAreaBorder = chartArea.border;
|
|
123791
124817
|
hasStyle = true;
|
|
123792
124818
|
}
|
|
123793
124819
|
const chartAreaGradient = parseChartGradientFill(
|
|
@@ -123855,9 +124881,13 @@ var init_PptxHandlerRuntimePresentationProps = __esm({
|
|
|
123855
124881
|
if (plotAreaGradient) {
|
|
123856
124882
|
style.plotAreaGradient = plotAreaGradient;
|
|
123857
124883
|
}
|
|
123858
|
-
const
|
|
123859
|
-
if (
|
|
123860
|
-
style.plotAreaFill =
|
|
124884
|
+
const plotAreaFormat = this.parseChartContainerFormat(plotArea);
|
|
124885
|
+
if (plotAreaFormat.fill) {
|
|
124886
|
+
style.plotAreaFill = plotAreaFormat.fill;
|
|
124887
|
+
hasStyle = true;
|
|
124888
|
+
}
|
|
124889
|
+
if (plotAreaFormat.border) {
|
|
124890
|
+
style.plotAreaBorder = plotAreaFormat.border;
|
|
123861
124891
|
hasStyle = true;
|
|
123862
124892
|
}
|
|
123863
124893
|
const valAx = this.xmlLookupService.getChildByLocalName(plotArea, "valAx");
|
|
@@ -129457,7 +130487,10 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
129457
130487
|
init_chart_axis_dispunits_serializer();
|
|
129458
130488
|
init_chart_axis_gridlines_serializer();
|
|
129459
130489
|
init_chart_axis_label_formatting();
|
|
130490
|
+
init_chart_axis_deleted();
|
|
129460
130491
|
init_chart_axis_scaling();
|
|
130492
|
+
init_chart_group_options();
|
|
130493
|
+
init_chart_space_format();
|
|
129461
130494
|
init_chart_axis_title_serializer();
|
|
129462
130495
|
init_chart_band_fmts();
|
|
129463
130496
|
init_chart_bubble_options();
|
|
@@ -129711,6 +130744,15 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
129711
130744
|
} else if (groupingKey) {
|
|
129712
130745
|
delete chartTypeContainer[groupingKey];
|
|
129713
130746
|
}
|
|
130747
|
+
const singleContainer = (consolidation?.containerChildren.size ?? 1) <= 1;
|
|
130748
|
+
if (singleContainer && chartData.chartType !== "combo") {
|
|
130749
|
+
applyChartGroupOptionsToXml(
|
|
130750
|
+
chartTypeContainer,
|
|
130751
|
+
containerLocalName,
|
|
130752
|
+
chartData,
|
|
130753
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2)
|
|
130754
|
+
);
|
|
130755
|
+
}
|
|
129714
130756
|
const seriesNodes = this.xmlLookupService.getChildrenArrayByLocalName(
|
|
129715
130757
|
chartTypeContainer,
|
|
129716
130758
|
"ser"
|
|
@@ -130115,6 +131157,11 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
130115
131157
|
if (!matchingAxis) {
|
|
130116
131158
|
continue;
|
|
130117
131159
|
}
|
|
131160
|
+
applyChartAxisDeletedToXml(
|
|
131161
|
+
axisNode,
|
|
131162
|
+
matchingAxis.deleted,
|
|
131163
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2)
|
|
131164
|
+
);
|
|
130118
131165
|
const scalingNode = this.xmlLookupService.getChildByLocalName(axisNode, "scaling");
|
|
130119
131166
|
if (scalingNode) {
|
|
130120
131167
|
applyChartAxisScaling(
|
|
@@ -130190,6 +131237,18 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
130190
131237
|
}
|
|
130191
131238
|
}
|
|
130192
131239
|
}
|
|
131240
|
+
if (chartSpace) {
|
|
131241
|
+
applyChartSpaceFormatToXml(
|
|
131242
|
+
chartSpace,
|
|
131243
|
+
plotArea,
|
|
131244
|
+
chartData,
|
|
131245
|
+
(key2) => this.compatibilityService.getXmlLocalName(key2),
|
|
131246
|
+
{
|
|
131247
|
+
...this.chartGradientWriteOptions(false),
|
|
131248
|
+
resolveColor: (node) => this.parseColor(node)
|
|
131249
|
+
}
|
|
131250
|
+
);
|
|
131251
|
+
}
|
|
130193
131252
|
for (const key2 of Object.keys(plotArea)) {
|
|
130194
131253
|
const local = this.compatibilityService.getXmlLocalName(key2);
|
|
130195
131254
|
if (!local.endsWith("Chart")) {
|
|
@@ -130623,7 +131682,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
130623
131682
|
});
|
|
130624
131683
|
|
|
130625
131684
|
// src/pptx/core/core/runtime/smartart-definition-builder.ts
|
|
130626
|
-
function
|
|
131685
|
+
function findKey33(node, name, localName29) {
|
|
130627
131686
|
return Object.keys(node).find((key2) => localName29(key2) === name);
|
|
130628
131687
|
}
|
|
130629
131688
|
function prefixFor2(node) {
|
|
@@ -130642,7 +131701,7 @@ function setChildren(node, name, values, localName29) {
|
|
|
130642
131701
|
if (values === void 0) {
|
|
130643
131702
|
return false;
|
|
130644
131703
|
}
|
|
130645
|
-
const existing =
|
|
131704
|
+
const existing = findKey33(node, name, localName29);
|
|
130646
131705
|
if (values.length === 0) {
|
|
130647
131706
|
if (existing) {
|
|
130648
131707
|
delete node[existing];
|
|
@@ -130669,7 +131728,7 @@ function applySmartArtDefinitionMetadata(node, metadata, localName29) {
|
|
|
130669
131728
|
changed = setChildren(node, "title", textNodes(metadata.titles), localName29) || changed;
|
|
130670
131729
|
changed = setChildren(node, "desc", textNodes(metadata.descriptions), localName29) || changed;
|
|
130671
131730
|
if (metadata.categories !== void 0) {
|
|
130672
|
-
const key2 =
|
|
131731
|
+
const key2 = findKey33(node, "catLst", localName29);
|
|
130673
131732
|
if (metadata.categories.length === 0) {
|
|
130674
131733
|
if (key2) {
|
|
130675
131734
|
delete node[key2];
|
|
@@ -130693,7 +131752,7 @@ function applySmartArtDefinitionMetadata(node, metadata, localName29) {
|
|
|
130693
131752
|
return changed;
|
|
130694
131753
|
}
|
|
130695
131754
|
function ensureLabels(node, localName29) {
|
|
130696
|
-
const key2 =
|
|
131755
|
+
const key2 = findKey33(node, "styleLbl", localName29) ?? `${prefixFor2(node)}styleLbl`;
|
|
130697
131756
|
return { key: key2, labels: objects2(node[key2]) };
|
|
130698
131757
|
}
|
|
130699
131758
|
function applySmartArtQuickStyleLabels(node, labels, localName29) {
|
|
@@ -130708,7 +131767,7 @@ function applySmartArtQuickStyleLabels(node, labels, localName29) {
|
|
|
130708
131767
|
return true;
|
|
130709
131768
|
}
|
|
130710
131769
|
function applyColorList(label, name, metadata, localName29) {
|
|
130711
|
-
const key2 =
|
|
131770
|
+
const key2 = findKey33(label, name, localName29) ?? `${prefixFor2(label)}${name}`;
|
|
130712
131771
|
const list2 = objects2(label[key2])[0] ?? {};
|
|
130713
131772
|
if (metadata.method !== void 0) {
|
|
130714
131773
|
list2["@_meth"] = metadata.method;
|
|
@@ -130751,17 +131810,17 @@ var init_smartart_definition_builder = __esm({
|
|
|
130751
131810
|
});
|
|
130752
131811
|
|
|
130753
131812
|
// src/pptx/core/core/runtime/smartart-colors-builder.ts
|
|
130754
|
-
function
|
|
131813
|
+
function asObject2(value) {
|
|
130755
131814
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
130756
131815
|
}
|
|
130757
131816
|
function toArray4(value) {
|
|
130758
131817
|
if (Array.isArray(value)) {
|
|
130759
|
-
return value.filter((entry) => Boolean(
|
|
131818
|
+
return value.filter((entry) => Boolean(asObject2(entry)));
|
|
130760
131819
|
}
|
|
130761
|
-
const obj =
|
|
131820
|
+
const obj = asObject2(value);
|
|
130762
131821
|
return obj ? [obj] : [];
|
|
130763
131822
|
}
|
|
130764
|
-
function
|
|
131823
|
+
function findKey34(obj, name, getLocalName2) {
|
|
130765
131824
|
return Object.keys(obj).find((k) => getLocalName2(k) === name);
|
|
130766
131825
|
}
|
|
130767
131826
|
function hex2(value) {
|
|
@@ -130776,13 +131835,13 @@ function applyColorToList(list2, value, getLocalName2, resolveColor2) {
|
|
|
130776
131835
|
}
|
|
130777
131836
|
const existing = list2[colorKey];
|
|
130778
131837
|
if (resolveColor2) {
|
|
130779
|
-
const authored =
|
|
131838
|
+
const authored = asObject2(Array.isArray(existing) ? existing[0] : existing);
|
|
130780
131839
|
const authoredHex = authored ? resolveColor2({ [colorKey]: authored }) : void 0;
|
|
130781
131840
|
if (authoredHex && colorsEqual(authoredHex, value)) {
|
|
130782
131841
|
return;
|
|
130783
131842
|
}
|
|
130784
131843
|
}
|
|
130785
|
-
const rest = Array.isArray(existing) ? existing.slice(1).filter((entry) => Boolean(
|
|
131844
|
+
const rest = Array.isArray(existing) ? existing.slice(1).filter((entry) => Boolean(asObject2(entry))) : [];
|
|
130786
131845
|
if (colorKey !== "a:srgbClr") {
|
|
130787
131846
|
delete list2[colorKey];
|
|
130788
131847
|
}
|
|
@@ -130797,7 +131856,7 @@ function applyColorListValues(list2, values, getLocalName2, resolveColor2) {
|
|
|
130797
131856
|
const existing = Array.isArray(existingRaw) ? existingRaw : existingRaw ? [existingRaw] : [];
|
|
130798
131857
|
if (resolveColor2 && colorKey && existing.length === values.length) {
|
|
130799
131858
|
const unchanged2 = existing.every((entryRaw, index) => {
|
|
130800
|
-
const entry =
|
|
131859
|
+
const entry = asObject2(entryRaw);
|
|
130801
131860
|
const authoredHex = entry ? resolveColor2({ [colorKey]: entry }) : void 0;
|
|
130802
131861
|
return authoredHex !== void 0 && colorsEqual(authoredHex, values[index]);
|
|
130803
131862
|
});
|
|
@@ -130820,16 +131879,16 @@ function applyRoleColors(labels, roleColors, getLocalName2, resolveColor2) {
|
|
|
130820
131879
|
if (!role) {
|
|
130821
131880
|
continue;
|
|
130822
131881
|
}
|
|
130823
|
-
const fillKey =
|
|
131882
|
+
const fillKey = findKey34(label, "fillClrLst", getLocalName2);
|
|
130824
131883
|
if (fillKey) {
|
|
130825
|
-
const list2 =
|
|
131884
|
+
const list2 = asObject2(label[fillKey]);
|
|
130826
131885
|
if (list2 && applyColorListValues(list2, role.fill, getLocalName2, resolveColor2)) {
|
|
130827
131886
|
mutated = true;
|
|
130828
131887
|
}
|
|
130829
131888
|
}
|
|
130830
|
-
const lineKey =
|
|
131889
|
+
const lineKey = findKey34(label, "linClrLst", getLocalName2);
|
|
130831
131890
|
if (lineKey) {
|
|
130832
|
-
const list2 =
|
|
131891
|
+
const list2 = asObject2(label[lineKey]);
|
|
130833
131892
|
if (list2 && applyColorListValues(list2, role.line, getLocalName2, resolveColor2)) {
|
|
130834
131893
|
mutated = true;
|
|
130835
131894
|
}
|
|
@@ -130844,7 +131903,7 @@ function applySmartArtColorTransform(colorsDef, transform6, getLocalName2, resol
|
|
|
130844
131903
|
let mutated = false;
|
|
130845
131904
|
mutated = applySmartArtDefinitionMetadata(colorsDef, transform6, getLocalName2) || mutated;
|
|
130846
131905
|
mutated = applySmartArtColorStyleLabels(colorsDef, transform6.labels, getLocalName2) || mutated;
|
|
130847
|
-
const styleLblKey =
|
|
131906
|
+
const styleLblKey = findKey34(colorsDef, "styleLbl", getLocalName2);
|
|
130848
131907
|
if (!styleLblKey) {
|
|
130849
131908
|
return mutated;
|
|
130850
131909
|
}
|
|
@@ -130858,19 +131917,19 @@ function applySmartArtColorTransform(colorsDef, transform6, getLocalName2, resol
|
|
|
130858
131917
|
let fillIndex = 0;
|
|
130859
131918
|
let lineIndex = 0;
|
|
130860
131919
|
for (const label of labels) {
|
|
130861
|
-
const fillKey =
|
|
131920
|
+
const fillKey = findKey34(label, "fillClrLst", getLocalName2);
|
|
130862
131921
|
if (fillKey) {
|
|
130863
131922
|
const value = transform6.fillColors[fillIndex++];
|
|
130864
|
-
const list2 =
|
|
131923
|
+
const list2 = asObject2(label[fillKey]);
|
|
130865
131924
|
if (list2 && value) {
|
|
130866
131925
|
applyColorToList(list2, value, getLocalName2, resolveColor2);
|
|
130867
131926
|
mutated = true;
|
|
130868
131927
|
}
|
|
130869
131928
|
}
|
|
130870
|
-
const lineKey =
|
|
131929
|
+
const lineKey = findKey34(label, "linClrLst", getLocalName2);
|
|
130871
131930
|
if (lineKey) {
|
|
130872
131931
|
const value = transform6.lineColors[lineIndex++];
|
|
130873
|
-
const list2 =
|
|
131932
|
+
const list2 = asObject2(label[lineKey]);
|
|
130874
131933
|
if (list2 && value) {
|
|
130875
131934
|
applyColorToList(list2, value, getLocalName2, resolveColor2);
|
|
130876
131935
|
mutated = true;
|
|
@@ -131127,40 +132186,40 @@ var init_smartart_quick_style_builder = __esm({
|
|
|
131127
132186
|
});
|
|
131128
132187
|
|
|
131129
132188
|
// src/pptx/core/core/runtime/smartart-save-chrome.ts
|
|
131130
|
-
function
|
|
132189
|
+
function asObject3(value) {
|
|
131131
132190
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
131132
132191
|
}
|
|
131133
132192
|
function applySmartArtChrome(dataModel, chrome, getLocalName2) {
|
|
131134
132193
|
if (!chrome || !chrome.backgroundColor && !chrome.backgroundFillXml && !chrome.outlineColor && (chrome.outlineWidth === null || chrome.outlineWidth === void 0)) {
|
|
131135
132194
|
return;
|
|
131136
132195
|
}
|
|
131137
|
-
const
|
|
132196
|
+
const findKey35 = (obj, name) => Object.keys(obj).find((k) => getLocalName2(k) === name);
|
|
131138
132197
|
if (chrome.backgroundFillXml) {
|
|
131139
|
-
const bgKey =
|
|
131140
|
-
const bg =
|
|
131141
|
-
const fillKey =
|
|
132198
|
+
const bgKey = findKey35(dataModel, "bg") ?? "dgm:bg";
|
|
132199
|
+
const bg = asObject3(dataModel[bgKey]);
|
|
132200
|
+
const fillKey = findKey35(bg, chrome.backgroundFillXml.localName) ?? `a:${chrome.backgroundFillXml.localName}`;
|
|
131142
132201
|
bg[fillKey] = chrome.backgroundFillXml.xml;
|
|
131143
132202
|
dataModel[bgKey] = bg;
|
|
131144
132203
|
} else if (chrome.backgroundColor) {
|
|
131145
132204
|
const hex3 = chrome.backgroundColor.replace("#", "");
|
|
131146
|
-
const bgKey =
|
|
131147
|
-
const bg =
|
|
131148
|
-
const fillKey =
|
|
132205
|
+
const bgKey = findKey35(dataModel, "bg") ?? "dgm:bg";
|
|
132206
|
+
const bg = asObject3(dataModel[bgKey]);
|
|
132207
|
+
const fillKey = findKey35(bg, "solidFill") ?? "a:solidFill";
|
|
131149
132208
|
bg[fillKey] = { "a:srgbClr": { "@_val": hex3 } };
|
|
131150
132209
|
dataModel[bgKey] = bg;
|
|
131151
132210
|
}
|
|
131152
132211
|
const hasOutlineWidth = chrome.outlineWidth !== null && chrome.outlineWidth !== void 0;
|
|
131153
132212
|
if (chrome.outlineColor || hasOutlineWidth) {
|
|
131154
|
-
const wholeKey =
|
|
131155
|
-
const whole =
|
|
131156
|
-
const lnKey =
|
|
131157
|
-
const ln =
|
|
132213
|
+
const wholeKey = findKey35(dataModel, "whole") ?? "dgm:whole";
|
|
132214
|
+
const whole = asObject3(dataModel[wholeKey]);
|
|
132215
|
+
const lnKey = findKey35(whole, "ln") ?? "a:ln";
|
|
132216
|
+
const ln = asObject3(whole[lnKey]);
|
|
131158
132217
|
if (hasOutlineWidth) {
|
|
131159
132218
|
ln["@_w"] = String(Math.round(chrome.outlineWidth * 12700));
|
|
131160
132219
|
}
|
|
131161
132220
|
if (chrome.outlineColor) {
|
|
131162
132221
|
const hex3 = chrome.outlineColor.replace("#", "");
|
|
131163
|
-
const fillKey =
|
|
132222
|
+
const fillKey = findKey35(ln, "solidFill") ?? "a:solidFill";
|
|
131164
132223
|
ln[fillKey] = { "a:srgbClr": { "@_val": hex3 } };
|
|
131165
132224
|
}
|
|
131166
132225
|
whole[lnKey] = ln;
|
|
@@ -149503,6 +150562,7 @@ var init_PptxHandlerRuntimeChartColorStyle = __esm({
|
|
|
149503
150562
|
var SCATTER_STYLES, PptxHandlerRuntime94;
|
|
149504
150563
|
var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
149505
150564
|
"src/pptx/core/core/runtime/PptxHandlerRuntimeChartParsing.ts"() {
|
|
150565
|
+
init_units2();
|
|
149506
150566
|
init_chart_advanced_parser();
|
|
149507
150567
|
init_chart_axis_parser();
|
|
149508
150568
|
init_chart_band_fmts();
|
|
@@ -150085,6 +151145,10 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
150085
151145
|
const lineNoFill = seriesLine ? Object.keys(seriesLine).some(
|
|
150086
151146
|
(key2) => this.compatibilityService.getXmlLocalName(key2) === "noFill"
|
|
150087
151147
|
) : false;
|
|
151148
|
+
const lineWidthEmu = Number(seriesLine?.["@_w"]);
|
|
151149
|
+
const lineWidth = Number.isFinite(lineWidthEmu) && lineWidthEmu > 0 ? lineWidthEmu / exports.EMU_PER_POINT : void 0;
|
|
151150
|
+
const lineDashRaw = this.xmlLookupService.getChildByLocalName(seriesLine, "prstDash")?.["@_val"];
|
|
151151
|
+
const lineDashStyle = typeof lineDashRaw === "string" && lineDashRaw.length > 0 ? lineDashRaw : void 0;
|
|
150088
151152
|
const smoothNode = this.xmlLookupService.getChildByLocalName(seriesNode, "smooth");
|
|
150089
151153
|
const smooth = smoothNode ? !(smoothNode["@_val"] === "0" || smoothNode["@_val"] === "false") : void 0;
|
|
150090
151154
|
const invertNode = this.xmlLookupService.getChildByLocalName(seriesNode, "invertIfNegative");
|
|
@@ -150103,6 +151167,8 @@ var init_PptxHandlerRuntimeChartParsing = __esm({
|
|
|
150103
151167
|
...bubbleSizes.length > 0 ? { bubbleSizes } : {},
|
|
150104
151168
|
...dataLabelOptions && Object.keys(dataLabelOptions).length > 0 ? { dataLabelOptions } : {},
|
|
150105
151169
|
...lineNoFill ? { lineNoFill } : {},
|
|
151170
|
+
...lineWidth !== void 0 ? { lineWidth } : {},
|
|
151171
|
+
...lineDashStyle ? { lineDashStyle } : {},
|
|
150106
151172
|
...seriesNumberFormat ? { numberFormat: seriesNumberFormat } : {},
|
|
150107
151173
|
color: seriesColor2,
|
|
150108
151174
|
...this.colorStyleCodec ? seriesGradientFill(seriesShapeProperties, this.xmlLookupService, this.colorStyleCodec) : {},
|
|
@@ -157129,420 +158195,10 @@ var Presentation = class _Presentation {
|
|
|
157129
158195
|
init_PresentationBuilder();
|
|
157130
158196
|
init_SlideBuilder();
|
|
157131
158197
|
init_ElementFactory();
|
|
157132
|
-
|
|
157133
|
-
// src/pptx/core/builders/sdk/chart-operations.ts
|
|
157134
|
-
function ensureChartData(element) {
|
|
157135
|
-
if (!element.chartData) {
|
|
157136
|
-
throw new Error(
|
|
157137
|
-
"Chart element has no chartData. Cannot perform chart operations on an uninitialised chart."
|
|
157138
|
-
);
|
|
157139
|
-
}
|
|
157140
|
-
}
|
|
157141
|
-
function validateSeriesIndex(element, seriesIndex) {
|
|
157142
|
-
ensureChartData(element);
|
|
157143
|
-
if (seriesIndex < 0 || seriesIndex >= element.chartData.series.length) {
|
|
157144
|
-
throw new RangeError(
|
|
157145
|
-
`Series index ${seriesIndex} is out of range. Chart has ${element.chartData.series.length} series (indices 0\u2013${element.chartData.series.length - 1}).`
|
|
157146
|
-
);
|
|
157147
|
-
}
|
|
157148
|
-
}
|
|
157149
|
-
function setChartType(element, newType) {
|
|
157150
|
-
ensureChartData(element);
|
|
157151
|
-
element.chartData.chartType = newType;
|
|
157152
|
-
}
|
|
157153
|
-
function addChartSeries(element, series) {
|
|
157154
|
-
ensureChartData(element);
|
|
157155
|
-
element.chartData.series.push({
|
|
157156
|
-
name: series.name,
|
|
157157
|
-
values: series.values,
|
|
157158
|
-
color: series.color
|
|
157159
|
-
});
|
|
157160
|
-
}
|
|
157161
|
-
function removeChartSeries(element, seriesIndex) {
|
|
157162
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157163
|
-
element.chartData.series.splice(seriesIndex, 1);
|
|
157164
|
-
}
|
|
157165
|
-
function setChartCategories(element, categories) {
|
|
157166
|
-
ensureChartData(element);
|
|
157167
|
-
element.chartData.categories = categories;
|
|
157168
|
-
}
|
|
157169
|
-
function updateChartSeriesValues(element, seriesIndex, values) {
|
|
157170
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157171
|
-
element.chartData.series[seriesIndex].values = values;
|
|
157172
|
-
}
|
|
157173
|
-
function setChartTitle(element, title) {
|
|
157174
|
-
ensureChartData(element);
|
|
157175
|
-
element.chartData.title = title;
|
|
157176
|
-
}
|
|
157177
|
-
function setChartGrouping(element, grouping) {
|
|
157178
|
-
ensureChartData(element);
|
|
157179
|
-
element.chartData.grouping = grouping;
|
|
157180
|
-
}
|
|
157181
|
-
function setChartLegend(element, options) {
|
|
157182
|
-
ensureChartData(element);
|
|
157183
|
-
const style = element.chartData.style ??= {};
|
|
157184
|
-
if (options.show !== void 0) {
|
|
157185
|
-
style.hasLegend = options.show;
|
|
157186
|
-
}
|
|
157187
|
-
if (options.position !== void 0) {
|
|
157188
|
-
style.legendPosition = options.position;
|
|
157189
|
-
if (style.hasLegend === void 0) {
|
|
157190
|
-
style.hasLegend = true;
|
|
157191
|
-
}
|
|
157192
|
-
}
|
|
157193
|
-
}
|
|
157194
|
-
function setChartDataLabels(element, edit) {
|
|
157195
|
-
ensureChartData(element);
|
|
157196
|
-
const style = element.chartData.style ??= {};
|
|
157197
|
-
if (edit.show !== void 0) {
|
|
157198
|
-
style.hasDataLabels = edit.show;
|
|
157199
|
-
const labels = style.dataLabels;
|
|
157200
|
-
const anyContent = labels?.showValue === true || labels?.showCategory === true || labels?.showSeriesName === true || labels?.showPercent === true || labels?.showBubbleSize === true;
|
|
157201
|
-
if (edit.show && labels !== void 0 && !anyContent && edit.showValue === void 0) {
|
|
157202
|
-
labels.showValue = true;
|
|
157203
|
-
}
|
|
157204
|
-
}
|
|
157205
|
-
const contentKeys = [
|
|
157206
|
-
"showValue",
|
|
157207
|
-
"showCategory",
|
|
157208
|
-
"showSeriesName",
|
|
157209
|
-
"showPercent",
|
|
157210
|
-
"showLegendKey"
|
|
157211
|
-
];
|
|
157212
|
-
const hasContentEdit = contentKeys.some((k) => edit[k] !== void 0) || edit.position !== void 0;
|
|
157213
|
-
if (hasContentEdit) {
|
|
157214
|
-
const opts = style.dataLabels ??= {};
|
|
157215
|
-
for (const k of contentKeys) {
|
|
157216
|
-
if (edit[k] !== void 0) {
|
|
157217
|
-
opts[k] = edit[k];
|
|
157218
|
-
}
|
|
157219
|
-
}
|
|
157220
|
-
if (edit.position !== void 0) {
|
|
157221
|
-
opts.position = edit.position || void 0;
|
|
157222
|
-
}
|
|
157223
|
-
if (style.hasDataLabels === void 0) {
|
|
157224
|
-
style.hasDataLabels = true;
|
|
157225
|
-
}
|
|
157226
|
-
}
|
|
157227
|
-
}
|
|
157228
|
-
function setChartSeriesTrendline(element, seriesIndex, trendline) {
|
|
157229
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157230
|
-
element.chartData.series[seriesIndex].trendlines = trendline ? [trendline] : [];
|
|
157231
|
-
}
|
|
157232
|
-
function setChartSeriesErrorBars(element, seriesIndex, errBars) {
|
|
157233
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157234
|
-
element.chartData.series[seriesIndex].errBars = errBars ? [errBars] : [];
|
|
157235
|
-
}
|
|
157236
|
-
function setChartAxis(element, axisType, edit) {
|
|
157237
|
-
ensureChartData(element);
|
|
157238
|
-
const axes = element.chartData.axes ??= [];
|
|
157239
|
-
let axis = axes.find((a) => a.axisType === axisType);
|
|
157240
|
-
if (!axis) {
|
|
157241
|
-
axis = { axisType };
|
|
157242
|
-
axes.push(axis);
|
|
157243
|
-
}
|
|
157244
|
-
if (edit.min !== void 0) {
|
|
157245
|
-
axis.min = edit.min ?? void 0;
|
|
157246
|
-
}
|
|
157247
|
-
if (edit.max !== void 0) {
|
|
157248
|
-
axis.max = edit.max ?? void 0;
|
|
157249
|
-
}
|
|
157250
|
-
if (edit.majorUnit !== void 0) {
|
|
157251
|
-
axis.majorUnit = edit.majorUnit ?? void 0;
|
|
157252
|
-
}
|
|
157253
|
-
if (edit.minorUnit !== void 0) {
|
|
157254
|
-
axis.minorUnit = edit.minorUnit ?? void 0;
|
|
157255
|
-
}
|
|
157256
|
-
if (edit.orientation !== void 0) {
|
|
157257
|
-
axis.orientation = edit.orientation ?? void 0;
|
|
157258
|
-
}
|
|
157259
|
-
if (edit.numberFormat !== void 0) {
|
|
157260
|
-
axis.numFmt = edit.numberFormat ? { formatCode: edit.numberFormat, sourceLinked: false } : void 0;
|
|
157261
|
-
}
|
|
157262
|
-
if (edit.tickLabelPosition !== void 0) {
|
|
157263
|
-
axis.tickLblPos = edit.tickLabelPosition;
|
|
157264
|
-
}
|
|
157265
|
-
if (edit.title !== void 0) {
|
|
157266
|
-
axis.titleText = edit.title ?? "";
|
|
157267
|
-
}
|
|
157268
|
-
if (edit.majorGridlines !== void 0) {
|
|
157269
|
-
axis.majorGridlines = edit.majorGridlines;
|
|
157270
|
-
}
|
|
157271
|
-
if (edit.minorGridlines !== void 0) {
|
|
157272
|
-
axis.minorGridlines = edit.minorGridlines;
|
|
157273
|
-
}
|
|
157274
|
-
if (edit.displayUnits !== void 0) {
|
|
157275
|
-
axis.displayUnits = edit.displayUnits ?? void 0;
|
|
157276
|
-
}
|
|
157277
|
-
if (edit.displayUnitsValue !== void 0) {
|
|
157278
|
-
axis.displayUnitsValue = edit.displayUnitsValue ?? void 0;
|
|
157279
|
-
}
|
|
157280
|
-
if (edit.displayUnitsLabel !== void 0) {
|
|
157281
|
-
axis.displayUnitsLabel = edit.displayUnitsLabel;
|
|
157282
|
-
}
|
|
157283
|
-
}
|
|
157284
|
-
function updateChartDataPoint(element, seriesIndex, pointIndex, value) {
|
|
157285
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157286
|
-
const series = element.chartData.series[seriesIndex];
|
|
157287
|
-
if (pointIndex < 0 || pointIndex >= series.values.length) {
|
|
157288
|
-
throw new RangeError(
|
|
157289
|
-
`Point index ${pointIndex} is out of range. Series "${series.name}" has ${series.values.length} data points (indices 0\u2013${series.values.length - 1}).`
|
|
157290
|
-
);
|
|
157291
|
-
}
|
|
157292
|
-
series.values[pointIndex] = value;
|
|
157293
|
-
}
|
|
157294
|
-
function addChartCategory(element, categoryName) {
|
|
157295
|
-
ensureChartData(element);
|
|
157296
|
-
element.chartData.categories.push(categoryName);
|
|
157297
|
-
for (const series of element.chartData.series) {
|
|
157298
|
-
series.values.push(0);
|
|
157299
|
-
}
|
|
157300
|
-
}
|
|
157301
|
-
function removeChartCategory(element, categoryIndex) {
|
|
157302
|
-
ensureChartData(element);
|
|
157303
|
-
if (categoryIndex < 0 || categoryIndex >= element.chartData.categories.length) {
|
|
157304
|
-
throw new RangeError(
|
|
157305
|
-
`Category index ${categoryIndex} is out of range. Chart has ${element.chartData.categories.length} categories (indices 0\u2013${element.chartData.categories.length - 1}).`
|
|
157306
|
-
);
|
|
157307
|
-
}
|
|
157308
|
-
element.chartData.categories.splice(categoryIndex, 1);
|
|
157309
|
-
for (const series of element.chartData.series) {
|
|
157310
|
-
series.values.splice(categoryIndex, 1);
|
|
157311
|
-
}
|
|
157312
|
-
}
|
|
157313
|
-
function setChartSeriesColor(element, seriesIndex, color2) {
|
|
157314
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157315
|
-
const series = element.chartData.series[seriesIndex];
|
|
157316
|
-
delete series.gradientFill;
|
|
157317
|
-
if (!color2) {
|
|
157318
|
-
series.color = void 0;
|
|
157319
|
-
return;
|
|
157320
|
-
}
|
|
157321
|
-
const trimmed = color2.trim();
|
|
157322
|
-
series.color = trimmed.startsWith("#") ? trimmed : `#${trimmed}`;
|
|
157323
|
-
}
|
|
157324
|
-
function ensureAxis(element, axisType) {
|
|
157325
|
-
ensureChartData(element);
|
|
157326
|
-
const axes = element.chartData.axes ??= [];
|
|
157327
|
-
let axis = axes.find((a) => a.axisType === axisType);
|
|
157328
|
-
if (!axis) {
|
|
157329
|
-
axis = { axisType };
|
|
157330
|
-
axes.push(axis);
|
|
157331
|
-
}
|
|
157332
|
-
return axis;
|
|
157333
|
-
}
|
|
157334
|
-
function setChartAxisLogScale(element, axisType, opts) {
|
|
157335
|
-
const axis = ensureAxis(element, axisType);
|
|
157336
|
-
axis.logScale = opts.enabled;
|
|
157337
|
-
if (opts.enabled) {
|
|
157338
|
-
axis.logBase = opts.base ?? axis.logBase ?? 10;
|
|
157339
|
-
} else {
|
|
157340
|
-
axis.logBase = void 0;
|
|
157341
|
-
}
|
|
157342
|
-
}
|
|
157343
|
-
function setChartAxisTitleStyle(element, axisType, edit) {
|
|
157344
|
-
const axis = ensureAxis(element, axisType);
|
|
157345
|
-
if (edit.fontFamily !== void 0) {
|
|
157346
|
-
axis.fontFamily = edit.fontFamily ?? void 0;
|
|
157347
|
-
}
|
|
157348
|
-
if (edit.fontSize !== void 0) {
|
|
157349
|
-
axis.fontSize = edit.fontSize ?? void 0;
|
|
157350
|
-
}
|
|
157351
|
-
if (edit.fontBold !== void 0) {
|
|
157352
|
-
axis.fontBold = edit.fontBold;
|
|
157353
|
-
}
|
|
157354
|
-
if (edit.fontColor !== void 0) {
|
|
157355
|
-
axis.fontColor = edit.fontColor ?? void 0;
|
|
157356
|
-
}
|
|
157357
|
-
}
|
|
157358
|
-
function setChartAxisGridlineStyle(element, axisType, which, edit) {
|
|
157359
|
-
const axis = ensureAxis(element, axisType);
|
|
157360
|
-
const key2 = which === "major" ? "majorGridlinesSpPr" : "minorGridlinesSpPr";
|
|
157361
|
-
const flagKey = which === "major" ? "majorGridlines" : "minorGridlines";
|
|
157362
|
-
const props = { ...axis[key2] ?? {} };
|
|
157363
|
-
if (edit.color !== void 0) {
|
|
157364
|
-
props.strokeColor = edit.color ?? void 0;
|
|
157365
|
-
}
|
|
157366
|
-
if (edit.width !== void 0) {
|
|
157367
|
-
props.strokeWidth = edit.width ?? void 0;
|
|
157368
|
-
}
|
|
157369
|
-
if (edit.dashStyle !== void 0) {
|
|
157370
|
-
props.strokeDashStyle = edit.dashStyle ?? void 0;
|
|
157371
|
-
}
|
|
157372
|
-
const hasAnyProp = props.strokeColor !== void 0 || props.strokeWidth !== void 0 || props.strokeDashStyle !== void 0 || props.fillColor !== void 0;
|
|
157373
|
-
axis[key2] = hasAnyProp ? props : void 0;
|
|
157374
|
-
if (hasAnyProp) {
|
|
157375
|
-
axis[flagKey] = true;
|
|
157376
|
-
}
|
|
157377
|
-
}
|
|
157378
|
-
function setChartSeriesMarker(element, seriesIndex, marker) {
|
|
157379
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157380
|
-
const series = element.chartData.series[seriesIndex];
|
|
157381
|
-
if (marker === null) {
|
|
157382
|
-
series.marker = void 0;
|
|
157383
|
-
return;
|
|
157384
|
-
}
|
|
157385
|
-
const existing = series.marker;
|
|
157386
|
-
if ("symbol" in marker && "spPr" in marker) {
|
|
157387
|
-
series.marker = marker;
|
|
157388
|
-
return;
|
|
157389
|
-
}
|
|
157390
|
-
const patch = marker;
|
|
157391
|
-
const next = {
|
|
157392
|
-
symbol: patch.symbol ?? existing?.symbol ?? "circle",
|
|
157393
|
-
size: patch.size ?? existing?.size,
|
|
157394
|
-
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
157395
|
-
};
|
|
157396
|
-
if (patch.fillColor !== void 0) {
|
|
157397
|
-
next.spPr = { ...next.spPr ?? {}, fillColor: patch.fillColor };
|
|
157398
|
-
}
|
|
157399
|
-
series.marker = next;
|
|
157400
|
-
}
|
|
157401
|
-
function setChartSeriesChartType(element, seriesIndex, seriesType) {
|
|
157402
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157403
|
-
const data = element.chartData;
|
|
157404
|
-
data.series[seriesIndex].seriesChartType = seriesType ?? void 0;
|
|
157405
|
-
const effective = new Set(
|
|
157406
|
-
data.series.map((s) => s.seriesChartType ?? data.chartType).filter((t) => t !== "combo")
|
|
157407
|
-
);
|
|
157408
|
-
if (effective.size > 1) {
|
|
157409
|
-
data.chartType = "combo";
|
|
157410
|
-
}
|
|
157411
|
-
}
|
|
157412
|
-
function ensureDataPoint(series, pointIndex) {
|
|
157413
|
-
const points4 = series.dataPoints ??= [];
|
|
157414
|
-
let dp = points4.find((p) => p.idx === pointIndex);
|
|
157415
|
-
if (!dp) {
|
|
157416
|
-
dp = { idx: pointIndex };
|
|
157417
|
-
points4.push(dp);
|
|
157418
|
-
points4.sort((a, b) => a.idx - b.idx);
|
|
157419
|
-
}
|
|
157420
|
-
return dp;
|
|
157421
|
-
}
|
|
157422
|
-
function setChartDataPointFill(element, seriesIndex, pointIndex, color2) {
|
|
157423
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157424
|
-
const series = element.chartData.series[seriesIndex];
|
|
157425
|
-
if (color2 === null) {
|
|
157426
|
-
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
157427
|
-
if (!dp2) {
|
|
157428
|
-
return;
|
|
157429
|
-
}
|
|
157430
|
-
if (dp2.spPr) {
|
|
157431
|
-
dp2.spPr = { ...dp2.spPr, fillColor: void 0 };
|
|
157432
|
-
if (dp2.spPr.fillColor === void 0 && dp2.spPr.strokeColor === void 0 && dp2.spPr.strokeWidth === void 0 && dp2.spPr.strokeDashStyle === void 0) {
|
|
157433
|
-
dp2.spPr = void 0;
|
|
157434
|
-
}
|
|
157435
|
-
}
|
|
157436
|
-
removeEmptyDataPoint(series, pointIndex);
|
|
157437
|
-
return;
|
|
157438
|
-
}
|
|
157439
|
-
const dp = ensureDataPoint(series, pointIndex);
|
|
157440
|
-
dp.spPr = { ...dp.spPr ?? {}, fillColor: color2 };
|
|
157441
|
-
delete dp.gradientFill;
|
|
157442
|
-
}
|
|
157443
|
-
function setChartDataPointExplosion(element, seriesIndex, pointIndex, explosion) {
|
|
157444
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157445
|
-
const series = element.chartData.series[seriesIndex];
|
|
157446
|
-
if (explosion === null) {
|
|
157447
|
-
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
157448
|
-
if (dp2) {
|
|
157449
|
-
dp2.explosion = void 0;
|
|
157450
|
-
removeEmptyDataPoint(series, pointIndex);
|
|
157451
|
-
}
|
|
157452
|
-
return;
|
|
157453
|
-
}
|
|
157454
|
-
const dp = ensureDataPoint(series, pointIndex);
|
|
157455
|
-
dp.explosion = explosion;
|
|
157456
|
-
}
|
|
157457
|
-
function setChartDataPointMarker(element, seriesIndex, pointIndex, marker) {
|
|
157458
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157459
|
-
const series = element.chartData.series[seriesIndex];
|
|
157460
|
-
if (marker === null) {
|
|
157461
|
-
const dp2 = series.dataPoints?.find((p) => p.idx === pointIndex);
|
|
157462
|
-
if (dp2) {
|
|
157463
|
-
dp2.marker = void 0;
|
|
157464
|
-
removeEmptyDataPoint(series, pointIndex);
|
|
157465
|
-
}
|
|
157466
|
-
return;
|
|
157467
|
-
}
|
|
157468
|
-
const dp = ensureDataPoint(series, pointIndex);
|
|
157469
|
-
const existing = dp.marker;
|
|
157470
|
-
const next = {
|
|
157471
|
-
symbol: marker.symbol ?? existing?.symbol ?? "circle",
|
|
157472
|
-
size: marker.size ?? existing?.size,
|
|
157473
|
-
spPr: existing?.spPr ? { ...existing.spPr } : void 0
|
|
157474
|
-
};
|
|
157475
|
-
if (marker.fillColor !== void 0) {
|
|
157476
|
-
next.spPr = { ...next.spPr ?? {}, fillColor: marker.fillColor };
|
|
157477
|
-
}
|
|
157478
|
-
dp.marker = next;
|
|
157479
|
-
}
|
|
157480
|
-
function applyLabelEdit(label, edit) {
|
|
157481
|
-
if (edit.showValue !== void 0) {
|
|
157482
|
-
label.showVal = edit.showValue;
|
|
157483
|
-
}
|
|
157484
|
-
if (edit.showCategory !== void 0) {
|
|
157485
|
-
label.showCatName = edit.showCategory;
|
|
157486
|
-
}
|
|
157487
|
-
if (edit.showSeriesName !== void 0) {
|
|
157488
|
-
label.showSerName = edit.showSeriesName;
|
|
157489
|
-
}
|
|
157490
|
-
if (edit.showPercent !== void 0) {
|
|
157491
|
-
label.showPercent = edit.showPercent;
|
|
157492
|
-
}
|
|
157493
|
-
if (edit.showLegendKey !== void 0) {
|
|
157494
|
-
label.showLegendKey = edit.showLegendKey;
|
|
157495
|
-
}
|
|
157496
|
-
if (edit.position !== void 0) {
|
|
157497
|
-
label.position = edit.position;
|
|
157498
|
-
}
|
|
157499
|
-
if (edit.text !== void 0) {
|
|
157500
|
-
label.text = edit.text === "" ? void 0 : edit.text;
|
|
157501
|
-
}
|
|
157502
|
-
if (edit.spPr !== void 0) {
|
|
157503
|
-
label.spPr = edit.spPr === null ? void 0 : { ...label.spPr ?? {}, ...edit.spPr };
|
|
157504
|
-
}
|
|
157505
|
-
if (edit.txPr !== void 0) {
|
|
157506
|
-
label.txPr = edit.txPr === null ? void 0 : { ...label.txPr ?? {}, ...edit.txPr };
|
|
157507
|
-
}
|
|
157508
|
-
}
|
|
157509
|
-
function setChartDataPointLabel(element, seriesIndex, pointIndex, edit) {
|
|
157510
|
-
validateSeriesIndex(element, seriesIndex);
|
|
157511
|
-
const series = element.chartData.series[seriesIndex];
|
|
157512
|
-
if (edit === null) {
|
|
157513
|
-
if (!series.dataLabels) {
|
|
157514
|
-
return;
|
|
157515
|
-
}
|
|
157516
|
-
series.dataLabels = series.dataLabels.filter((l) => l.idx !== pointIndex);
|
|
157517
|
-
if (series.dataLabels.length === 0) {
|
|
157518
|
-
series.dataLabels = void 0;
|
|
157519
|
-
}
|
|
157520
|
-
return;
|
|
157521
|
-
}
|
|
157522
|
-
const labels = series.dataLabels ??= [];
|
|
157523
|
-
let label = labels.find((l) => l.idx === pointIndex);
|
|
157524
|
-
if (!label) {
|
|
157525
|
-
label = { idx: pointIndex };
|
|
157526
|
-
labels.push(label);
|
|
157527
|
-
labels.sort((a, b) => a.idx - b.idx);
|
|
157528
|
-
}
|
|
157529
|
-
applyLabelEdit(label, edit);
|
|
157530
|
-
}
|
|
157531
|
-
function removeEmptyDataPoint(series, pointIndex) {
|
|
157532
|
-
if (!series.dataPoints) {
|
|
157533
|
-
return;
|
|
157534
|
-
}
|
|
157535
|
-
const dp = series.dataPoints.find((p) => p.idx === pointIndex);
|
|
157536
|
-
if (!dp) {
|
|
157537
|
-
return;
|
|
157538
|
-
}
|
|
157539
|
-
const empty = dp.spPr === void 0 && dp.gradientFill === void 0 && dp.explosion === void 0 && dp.invertIfNegative === void 0 && dp.bubble3D === void 0 && dp.marker === void 0;
|
|
157540
|
-
if (empty) {
|
|
157541
|
-
series.dataPoints = series.dataPoints.filter((p) => p.idx !== pointIndex);
|
|
157542
|
-
}
|
|
157543
|
-
}
|
|
158198
|
+
init_chart_operations();
|
|
157544
158199
|
|
|
157545
158200
|
// src/pptx/core/builders/sdk/chart-formatting-operations.ts
|
|
158201
|
+
init_chart_operations();
|
|
157546
158202
|
function setChartDataPointStyle(element, seriesIndex, pointIndex, style) {
|
|
157547
158203
|
validateSeriesIndex(element, seriesIndex);
|
|
157548
158204
|
const series = element.chartData.series[seriesIndex];
|
|
@@ -157582,6 +158238,7 @@ function setChartColorMapOverride(element, overrides28) {
|
|
|
157582
158238
|
|
|
157583
158239
|
// src/pptx/core/builders/sdk/chart-gradient-operations.ts
|
|
157584
158240
|
init_chart_gradient_input();
|
|
158241
|
+
init_chart_operations();
|
|
157585
158242
|
function seriesChartType(element, seriesIndex) {
|
|
157586
158243
|
const data = element.chartData;
|
|
157587
158244
|
return data.series[seriesIndex].seriesChartType ?? data.chartType;
|
|
@@ -157622,6 +158279,7 @@ function setChartDataPointGradient(element, seriesIndex, pointIndex, gradient) {
|
|
|
157622
158279
|
|
|
157623
158280
|
// src/pptx/core/builders/sdk/index.ts
|
|
157624
158281
|
init_chart_gradient_input();
|
|
158282
|
+
init_chart_layout_operations();
|
|
157625
158283
|
|
|
157626
158284
|
// src/pptx/core/builders/sdk/chart-user-shape-operations.ts
|
|
157627
158285
|
function ensureChartData2(element) {
|
|
@@ -159439,6 +160097,53 @@ var ChartBuilder = class _ChartBuilder {
|
|
|
159439
160097
|
this._input.grouping = mode;
|
|
159440
160098
|
return this;
|
|
159441
160099
|
}
|
|
160100
|
+
// -- Spacing, geometry and areas (validated by build()) -----------------
|
|
160101
|
+
/** Gap between bar clusters, % of bar width (`c:gapWidth`, 0..500). Bar, bar3D, ofPie. */
|
|
160102
|
+
gapWidth(percent) {
|
|
160103
|
+
this._input.gapWidth = percent;
|
|
160104
|
+
return this;
|
|
160105
|
+
}
|
|
160106
|
+
/** Overlap of bars within a cluster, % (`c:overlap`, -100..100). 2-D bar only. */
|
|
160107
|
+
overlap(percent) {
|
|
160108
|
+
this._input.overlap = percent;
|
|
160109
|
+
return this;
|
|
160110
|
+
}
|
|
160111
|
+
/** Angle of the first slice, degrees clockwise from 12 o'clock (`c:firstSliceAng`, 0..360). */
|
|
160112
|
+
firstSliceAngle(degrees) {
|
|
160113
|
+
this._input.firstSliceAngle = degrees;
|
|
160114
|
+
return this;
|
|
160115
|
+
}
|
|
160116
|
+
/** Doughnut hole size, % of the diameter (`c:holeSize`, 1..90). */
|
|
160117
|
+
holeSize(percent) {
|
|
160118
|
+
this._input.holeSize = percent;
|
|
160119
|
+
return this;
|
|
160120
|
+
}
|
|
160121
|
+
/**
|
|
160122
|
+
* Chart-area fill, border and rounded corners.
|
|
160123
|
+
*
|
|
160124
|
+
* @example
|
|
160125
|
+
* ```ts
|
|
160126
|
+
* builder.chartArea({ fill: "none", border: "none", roundedCorners: false });
|
|
160127
|
+
* ```
|
|
160128
|
+
*/
|
|
160129
|
+
chartArea(format) {
|
|
160130
|
+
this._input.chartArea = format;
|
|
160131
|
+
return this;
|
|
160132
|
+
}
|
|
160133
|
+
/** Plot-area fill and border. */
|
|
160134
|
+
plotArea(format) {
|
|
160135
|
+
this._input.plotArea = format;
|
|
160136
|
+
return this;
|
|
160137
|
+
}
|
|
160138
|
+
/**
|
|
160139
|
+
* Edit an axis, e.g. `.axis("catAx", { visible: false })` to hide it.
|
|
160140
|
+
* Merges with earlier edits of the same axis.
|
|
160141
|
+
*/
|
|
160142
|
+
axis(axisType, edit) {
|
|
160143
|
+
const axes = this._input.axes ??= {};
|
|
160144
|
+
axes[axisType] = { ...axes[axisType], ...edit };
|
|
160145
|
+
return this;
|
|
160146
|
+
}
|
|
159442
160147
|
// -- Build --------------------------------------------------------------
|
|
159443
160148
|
/**
|
|
159444
160149
|
* Build the final {@link ChartPptxElement}.
|
|
@@ -170982,6 +171687,9 @@ function cssColorSafe(value) {
|
|
|
170982
171687
|
}
|
|
170983
171688
|
return void 0;
|
|
170984
171689
|
}
|
|
171690
|
+
function cssBorderPx(width) {
|
|
171691
|
+
return Math.max(1, Math.round(width));
|
|
171692
|
+
}
|
|
170985
171693
|
function cssFontFamilySafe(value) {
|
|
170986
171694
|
if (typeof value !== "string") {
|
|
170987
171695
|
return void 0;
|
|
@@ -171109,19 +171817,19 @@ ${htmlRows.join("\n")}
|
|
|
171109
171817
|
const edges = [];
|
|
171110
171818
|
const topColor = cssColorSafe(style.borderTopColor);
|
|
171111
171819
|
if (style.borderTopWidth && topColor) {
|
|
171112
|
-
edges.push(`border-top:${
|
|
171820
|
+
edges.push(`border-top:${cssBorderPx(style.borderTopWidth)}px solid ${topColor}`);
|
|
171113
171821
|
}
|
|
171114
171822
|
const bottomColor = cssColorSafe(style.borderBottomColor);
|
|
171115
171823
|
if (style.borderBottomWidth && bottomColor) {
|
|
171116
|
-
edges.push(`border-bottom:${
|
|
171824
|
+
edges.push(`border-bottom:${cssBorderPx(style.borderBottomWidth)}px solid ${bottomColor}`);
|
|
171117
171825
|
}
|
|
171118
171826
|
const leftColor = cssColorSafe(style.borderLeftColor);
|
|
171119
171827
|
if (style.borderLeftWidth && leftColor) {
|
|
171120
|
-
edges.push(`border-left:${
|
|
171828
|
+
edges.push(`border-left:${cssBorderPx(style.borderLeftWidth)}px solid ${leftColor}`);
|
|
171121
171829
|
}
|
|
171122
171830
|
const rightColor = cssColorSafe(style.borderRightColor);
|
|
171123
171831
|
if (style.borderRightWidth && rightColor) {
|
|
171124
|
-
edges.push(`border-right:${
|
|
171832
|
+
edges.push(`border-right:${cssBorderPx(style.borderRightWidth)}px solid ${rightColor}`);
|
|
171125
171833
|
}
|
|
171126
171834
|
const fallback = cssColorSafe(style.borderColor);
|
|
171127
171835
|
if (edges.length === 0 && fallback) {
|
|
@@ -171141,7 +171849,7 @@ ${htmlRows.join("\n")}
|
|
|
171141
171849
|
if (t === 0 && r === 0 && b === 0 && l === 0) {
|
|
171142
171850
|
return "";
|
|
171143
171851
|
}
|
|
171144
|
-
return `padding:${t}px ${r}px ${b}px ${l}px`;
|
|
171852
|
+
return `padding:${Math.round(t)}px ${Math.round(r)}px ${Math.round(b)}px ${Math.round(l)}px`;
|
|
171145
171853
|
}
|
|
171146
171854
|
/**
|
|
171147
171855
|
* Renders cell content as HTML spans preserving per-run styling
|
|
@@ -173930,6 +174638,7 @@ exports.serializePptxToJson = serializePptxToJson;
|
|
|
173930
174638
|
exports.serializeSmartArtDefinitionHeaderList = serializeSmartArtDefinitionHeaderList;
|
|
173931
174639
|
exports.serializeSvgPath = serializeSvgPath;
|
|
173932
174640
|
exports.serializeTimeTargetElement = serializeTimeTargetElement;
|
|
174641
|
+
exports.setChartAreaFormat = setChartAreaFormat;
|
|
173933
174642
|
exports.setChartAxis = setChartAxis;
|
|
173934
174643
|
exports.setChartAxisGridlineStyle = setChartAxisGridlineStyle;
|
|
173935
174644
|
exports.setChartAxisLogScale = setChartAxisLogScale;
|
|
@@ -173943,6 +174652,7 @@ exports.setChartDataPointGradient = setChartDataPointGradient;
|
|
|
173943
174652
|
exports.setChartDataPointLabel = setChartDataPointLabel;
|
|
173944
174653
|
exports.setChartDataPointMarker = setChartDataPointMarker;
|
|
173945
174654
|
exports.setChartDataPointStyle = setChartDataPointStyle;
|
|
174655
|
+
exports.setChartGroupOptions = setChartGroupOptions;
|
|
173946
174656
|
exports.setChartGrouping = setChartGrouping;
|
|
173947
174657
|
exports.setChartHelperLine = setChartHelperLine;
|
|
173948
174658
|
exports.setChartLegend = setChartLegend;
|