@cj-tech-master/excelts 9.4.2 → 9.5.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/dist/browser/index.browser.d.ts +8 -5
- package/dist/browser/index.browser.js +19 -1
- package/dist/browser/index.d.ts +4 -2
- package/dist/browser/index.js +9 -1
- package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/browser/modules/excel/chart/chart-api.js +364 -0
- package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/browser/modules/excel/chart/chart-images.js +363 -0
- package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
- package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
- package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
- package/dist/browser/modules/excel/chart/chart.js +1320 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/browser/modules/excel/chart/index.d.ts +54 -0
- package/dist/browser/modules/excel/chart/index.js +46 -0
- package/dist/browser/modules/excel/chart/install.d.ts +44 -0
- package/dist/browser/modules/excel/chart/install.js +91 -0
- package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/browser/modules/excel/chart/topojson.js +236 -0
- package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
- package/dist/browser/modules/excel/chart/types.js +8 -0
- package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/browser/modules/excel/chart-host-registry.js +90 -0
- package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
- package/dist/browser/modules/excel/chartsheet.js +196 -0
- package/dist/browser/modules/excel/defined-names.d.ts +35 -0
- package/dist/browser/modules/excel/defined-names.js +44 -4
- package/dist/browser/modules/excel/errors.d.ts +6 -0
- package/dist/browser/modules/excel/errors.js +9 -0
- package/dist/browser/modules/excel/form-control.d.ts +6 -0
- package/dist/browser/modules/excel/form-control.js +17 -0
- package/dist/browser/modules/excel/image.js +12 -2
- package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/browser/modules/excel/pivot-chart.js +53 -0
- package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
- package/dist/browser/modules/excel/pivot-table.js +35 -0
- package/dist/browser/modules/excel/range.js +5 -1
- package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/browser/modules/excel/sparkline/index.js +7 -0
- package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/browser/modules/excel/table.js +42 -6
- package/dist/browser/modules/excel/types.d.ts +72 -0
- package/dist/browser/modules/excel/utils/address.d.ts +18 -0
- package/dist/browser/modules/excel/utils/address.js +28 -0
- package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
- package/dist/browser/modules/excel/utils/guid.js +35 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/browser/modules/excel/workbook.browser.js +966 -31
- package/dist/browser/modules/excel/workbook.d.ts +43 -0
- package/dist/browser/modules/excel/workbook.js +48 -0
- package/dist/browser/modules/excel/worksheet.d.ts +157 -3
- package/dist/browser/modules/excel/worksheet.js +394 -35
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
- package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/browser/modules/pdf/excel-bridge.js +683 -12
- package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/browser/modules/pdf/font/font-manager.js +39 -0
- package/dist/browser/modules/pdf/index.d.ts +5 -2
- package/dist/browser/modules/pdf/index.js +3 -1
- package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
- package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
- package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
- package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/browser/modules/pdf/types.d.ts +227 -23
- package/dist/browser/modules/pdf/types.js +4 -0
- package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/browser/modules/pdf/word-bridge.js +304 -0
- package/dist/browser/modules/word/constants.d.ts +179 -0
- package/dist/browser/modules/word/constants.js +231 -0
- package/dist/browser/modules/word/content-types.d.ts +27 -0
- package/dist/browser/modules/word/content-types.js +53 -0
- package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
- package/dist/browser/modules/word/digital-signatures.js +134 -0
- package/dist/browser/modules/word/document.d.ts +728 -0
- package/dist/browser/modules/word/document.js +1795 -0
- package/dist/browser/modules/word/docx-packager.d.ts +14 -0
- package/dist/browser/modules/word/docx-packager.js +822 -0
- package/dist/browser/modules/word/docx-reader.d.ts +11 -0
- package/dist/browser/modules/word/docx-reader.js +4929 -0
- package/dist/browser/modules/word/encryption.d.ts +102 -0
- package/dist/browser/modules/word/encryption.js +274 -0
- package/dist/browser/modules/word/errors.d.ts +49 -0
- package/dist/browser/modules/word/errors.js +68 -0
- package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/browser/modules/word/font-obfuscation.js +83 -0
- package/dist/browser/modules/word/html-renderer.d.ts +38 -0
- package/dist/browser/modules/word/html-renderer.js +782 -0
- package/dist/browser/modules/word/index.base.d.ts +19 -0
- package/dist/browser/modules/word/index.base.js +51 -0
- package/dist/browser/modules/word/index.browser.d.ts +4 -0
- package/dist/browser/modules/word/index.browser.js +4 -0
- package/dist/browser/modules/word/index.d.ts +4 -0
- package/dist/browser/modules/word/index.js +4 -0
- package/dist/browser/modules/word/internal-utils.d.ts +23 -0
- package/dist/browser/modules/word/internal-utils.js +54 -0
- package/dist/browser/modules/word/relationships.d.ts +31 -0
- package/dist/browser/modules/word/relationships.js +56 -0
- package/dist/browser/modules/word/types.d.ts +2325 -0
- package/dist/browser/modules/word/types.js +10 -0
- package/dist/browser/modules/word/units.d.ts +49 -0
- package/dist/browser/modules/word/units.js +111 -0
- package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/chart-writer.js +385 -0
- package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/comment-writer.js +70 -0
- package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/browser/modules/word/writers/document-writer.js +461 -0
- package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
- package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/image-writer.js +185 -0
- package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/math-writer.js +428 -0
- package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
- package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/browser/modules/word/writers/parts-writer.js +660 -0
- package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/run-writer.js +649 -0
- package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/section-writer.js +238 -0
- package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/styles-writer.js +242 -0
- package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/table-writer.js +503 -0
- package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
- package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/toc-writer.js +79 -0
- package/dist/browser/modules/xml/encode.d.ts +56 -7
- package/dist/browser/modules/xml/encode.js +157 -11
- package/dist/cjs/index.js +13 -2
- package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
- package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
- package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
- package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
- package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
- package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
- package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
- package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
- package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
- package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
- package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
- package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
- package/dist/cjs/modules/excel/chart/chart.js +1324 -0
- package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
- package/dist/cjs/modules/excel/chart/index.js +101 -0
- package/dist/cjs/modules/excel/chart/install.js +95 -0
- package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
- package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
- package/dist/cjs/modules/excel/chart/topojson.js +239 -0
- package/dist/cjs/modules/excel/chart/types.js +9 -0
- package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
- package/dist/cjs/modules/excel/chartsheet.js +199 -0
- package/dist/cjs/modules/excel/defined-names.js +44 -4
- package/dist/cjs/modules/excel/errors.js +11 -1
- package/dist/cjs/modules/excel/form-control.js +17 -0
- package/dist/cjs/modules/excel/image.js +12 -2
- package/dist/cjs/modules/excel/pivot-chart.js +56 -0
- package/dist/cjs/modules/excel/pivot-table.js +35 -0
- package/dist/cjs/modules/excel/range.js +5 -1
- package/dist/cjs/modules/excel/sparkline/index.js +23 -0
- package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/cjs/modules/excel/table.js +42 -6
- package/dist/cjs/modules/excel/utils/address.js +29 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/cjs/modules/excel/utils/guid.js +38 -0
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
- package/dist/cjs/modules/excel/workbook.browser.js +973 -38
- package/dist/cjs/modules/excel/workbook.js +48 -0
- package/dist/cjs/modules/excel/worksheet.js +393 -34
- package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
- package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
- package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
- package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
- package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
- package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
- package/dist/cjs/modules/pdf/index.js +5 -1
- package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
- package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
- package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
- package/dist/cjs/modules/pdf/types.js +5 -0
- package/dist/cjs/modules/pdf/word-bridge.js +307 -0
- package/dist/cjs/modules/word/constants.js +234 -0
- package/dist/cjs/modules/word/content-types.js +57 -0
- package/dist/cjs/modules/word/digital-signatures.js +140 -0
- package/dist/cjs/modules/word/document.js +1909 -0
- package/dist/cjs/modules/word/docx-packager.js +825 -0
- package/dist/cjs/modules/word/docx-reader.js +4932 -0
- package/dist/cjs/modules/word/encryption.js +282 -0
- package/dist/cjs/modules/word/errors.js +88 -0
- package/dist/cjs/modules/word/font-obfuscation.js +88 -0
- package/dist/cjs/modules/word/html-renderer.js +785 -0
- package/dist/cjs/modules/word/index.base.js +199 -0
- package/dist/cjs/modules/word/index.browser.js +20 -0
- package/dist/cjs/modules/word/index.js +20 -0
- package/dist/cjs/modules/word/internal-utils.js +59 -0
- package/dist/cjs/modules/word/relationships.js +60 -0
- package/dist/cjs/modules/word/types.js +11 -0
- package/dist/cjs/modules/word/units.js +135 -0
- package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
- package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
- package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
- package/dist/cjs/modules/word/writers/document-writer.js +465 -0
- package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
- package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
- package/dist/cjs/modules/word/writers/image-writer.js +188 -0
- package/dist/cjs/modules/word/writers/math-writer.js +431 -0
- package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
- package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
- package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
- package/dist/cjs/modules/word/writers/run-writer.js +655 -0
- package/dist/cjs/modules/word/writers/section-writer.js +241 -0
- package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
- package/dist/cjs/modules/word/writers/table-writer.js +506 -0
- package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
- package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
- package/dist/cjs/modules/xml/encode.js +158 -11
- package/dist/esm/index.browser.js +20 -2
- package/dist/esm/index.js +9 -1
- package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/esm/modules/excel/chart/chart-api.js +364 -0
- package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/esm/modules/excel/chart/chart-images.js +363 -0
- package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
- package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
- package/dist/esm/modules/excel/chart/chart.js +1320 -0
- package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/esm/modules/excel/chart/index.js +46 -0
- package/dist/esm/modules/excel/chart/install.js +91 -0
- package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/esm/modules/excel/chart/topojson.js +236 -0
- package/dist/esm/modules/excel/chart/types.js +8 -0
- package/dist/esm/modules/excel/chart-host-registry.js +90 -0
- package/dist/esm/modules/excel/chartsheet.js +196 -0
- package/dist/esm/modules/excel/defined-names.js +44 -4
- package/dist/esm/modules/excel/errors.js +9 -0
- package/dist/esm/modules/excel/form-control.js +17 -0
- package/dist/esm/modules/excel/image.js +12 -2
- package/dist/esm/modules/excel/pivot-chart.js +53 -0
- package/dist/esm/modules/excel/pivot-table.js +35 -0
- package/dist/esm/modules/excel/range.js +5 -1
- package/dist/esm/modules/excel/sparkline/index.js +7 -0
- package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/esm/modules/excel/table.js +42 -6
- package/dist/esm/modules/excel/utils/address.js +28 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/esm/modules/excel/utils/guid.js +35 -0
- package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/esm/modules/excel/workbook.browser.js +969 -34
- package/dist/esm/modules/excel/workbook.js +48 -0
- package/dist/esm/modules/excel/worksheet.js +394 -35
- package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
- package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/esm/modules/pdf/excel-bridge.js +683 -12
- package/dist/esm/modules/pdf/font/font-manager.js +39 -0
- package/dist/esm/modules/pdf/index.js +3 -1
- package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
- package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
- package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/esm/modules/pdf/types.js +4 -0
- package/dist/esm/modules/pdf/word-bridge.js +304 -0
- package/dist/esm/modules/word/constants.js +231 -0
- package/dist/esm/modules/word/content-types.js +53 -0
- package/dist/esm/modules/word/digital-signatures.js +134 -0
- package/dist/esm/modules/word/document.js +1795 -0
- package/dist/esm/modules/word/docx-packager.js +822 -0
- package/dist/esm/modules/word/docx-reader.js +4929 -0
- package/dist/esm/modules/word/encryption.js +274 -0
- package/dist/esm/modules/word/errors.js +68 -0
- package/dist/esm/modules/word/font-obfuscation.js +83 -0
- package/dist/esm/modules/word/html-renderer.js +782 -0
- package/dist/esm/modules/word/index.base.js +51 -0
- package/dist/esm/modules/word/index.browser.js +4 -0
- package/dist/esm/modules/word/index.js +4 -0
- package/dist/esm/modules/word/internal-utils.js +54 -0
- package/dist/esm/modules/word/relationships.js +56 -0
- package/dist/esm/modules/word/types.js +10 -0
- package/dist/esm/modules/word/units.js +111 -0
- package/dist/esm/modules/word/writers/chart-writer.js +385 -0
- package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/esm/modules/word/writers/comment-writer.js +70 -0
- package/dist/esm/modules/word/writers/document-writer.js +461 -0
- package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
- package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/esm/modules/word/writers/image-writer.js +185 -0
- package/dist/esm/modules/word/writers/math-writer.js +428 -0
- package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
- package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/esm/modules/word/writers/parts-writer.js +660 -0
- package/dist/esm/modules/word/writers/run-writer.js +649 -0
- package/dist/esm/modules/word/writers/section-writer.js +238 -0
- package/dist/esm/modules/word/writers/styles-writer.js +242 -0
- package/dist/esm/modules/word/writers/table-writer.js +503 -0
- package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
- package/dist/esm/modules/word/writers/toc-writer.js +79 -0
- package/dist/esm/modules/xml/encode.js +157 -11
- package/dist/iife/excelts.iife.js +11789 -687
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +52 -44
- package/dist/types/index.browser.d.ts +8 -5
- package/dist/types/index.d.ts +4 -2
- package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/types/modules/excel/chart/chart.d.ts +504 -0
- package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/types/modules/excel/chart/index.d.ts +54 -0
- package/dist/types/modules/excel/chart/install.d.ts +44 -0
- package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/types/modules/excel/chart/types.d.ts +2559 -0
- package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/types/modules/excel/chartsheet.d.ts +102 -0
- package/dist/types/modules/excel/defined-names.d.ts +35 -0
- package/dist/types/modules/excel/errors.d.ts +6 -0
- package/dist/types/modules/excel/form-control.d.ts +6 -0
- package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/types/modules/excel/pivot-table.d.ts +55 -0
- package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/types/modules/excel/types.d.ts +72 -0
- package/dist/types/modules/excel/utils/address.d.ts +18 -0
- package/dist/types/modules/excel/utils/guid.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/types/modules/excel/workbook.d.ts +43 -0
- package/dist/types/modules/excel/worksheet.d.ts +157 -3
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/types/modules/pdf/index.d.ts +5 -2
- package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/types/modules/pdf/types.d.ts +227 -23
- package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/types/modules/word/constants.d.ts +179 -0
- package/dist/types/modules/word/content-types.d.ts +27 -0
- package/dist/types/modules/word/digital-signatures.d.ts +87 -0
- package/dist/types/modules/word/document.d.ts +728 -0
- package/dist/types/modules/word/docx-packager.d.ts +14 -0
- package/dist/types/modules/word/docx-reader.d.ts +11 -0
- package/dist/types/modules/word/encryption.d.ts +102 -0
- package/dist/types/modules/word/errors.d.ts +49 -0
- package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/types/modules/word/html-renderer.d.ts +38 -0
- package/dist/types/modules/word/index.base.d.ts +19 -0
- package/dist/types/modules/word/index.browser.d.ts +4 -0
- package/dist/types/modules/word/index.d.ts +4 -0
- package/dist/types/modules/word/internal-utils.d.ts +23 -0
- package/dist/types/modules/word/relationships.d.ts +31 -0
- package/dist/types/modules/word/types.d.ts +2325 -0
- package/dist/types/modules/word/units.d.ts +49 -0
- package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/types/modules/xml/encode.d.ts +56 -7
- package/package.json +29 -11
- package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
- package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
- package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
- package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
|
@@ -0,0 +1,2559 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart type definitions for ExcelTS
|
|
3
|
+
*
|
|
4
|
+
* Covers the full OOXML DrawingML Chart specification (c: namespace).
|
|
5
|
+
* Every chart in an XLSX file is a `c:chartSpace` containing a `c:chart`
|
|
6
|
+
* which holds a `c:plotArea` with one or more chart type groups.
|
|
7
|
+
*/
|
|
8
|
+
import type { AnchorModel } from "../anchor.js";
|
|
9
|
+
/**
|
|
10
|
+
* All chart types supported by OOXML DrawingML Charts.
|
|
11
|
+
*/
|
|
12
|
+
export type ChartType = "bar" | "bar3D" | "line" | "line3D" | "pie" | "pie3D" | "doughnut" | "area" | "area3D" | "scatter" | "bubble" | "radar" | "stock" | "surface" | "surface3D" | "ofPie";
|
|
13
|
+
/**
|
|
14
|
+
* Bar/column chart grouping.
|
|
15
|
+
*/
|
|
16
|
+
export type BarGrouping = "clustered" | "stacked" | "percentStacked" | "standard";
|
|
17
|
+
/**
|
|
18
|
+
* Bar chart direction.
|
|
19
|
+
*/
|
|
20
|
+
export type BarDirection = "bar" | "col";
|
|
21
|
+
/**
|
|
22
|
+
* Line/area chart grouping.
|
|
23
|
+
*/
|
|
24
|
+
export type LineGrouping = "standard" | "stacked" | "percentStacked";
|
|
25
|
+
/**
|
|
26
|
+
* Radar chart style.
|
|
27
|
+
*/
|
|
28
|
+
export type RadarStyle = "standard" | "marker" | "filled";
|
|
29
|
+
/**
|
|
30
|
+
* Scatter chart style.
|
|
31
|
+
*/
|
|
32
|
+
export type ScatterStyle = "lineMarker" | "line" | "marker" | "smooth" | "smoothMarker";
|
|
33
|
+
/**
|
|
34
|
+
* Stock chart arrangement (HLC, OHLC, VHLC, VOHLC).
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Of-pie chart type.
|
|
38
|
+
*/
|
|
39
|
+
export type OfPieType = "pie" | "bar";
|
|
40
|
+
/**
|
|
41
|
+
* Shape for 3D bar charts.
|
|
42
|
+
*/
|
|
43
|
+
export type BarShape = "box" | "cone" | "coneToMax" | "cylinder" | "pyramid" | "pyramidToMax";
|
|
44
|
+
/**
|
|
45
|
+
* Axis cross position.
|
|
46
|
+
*/
|
|
47
|
+
export type AxisCrosses = "autoZero" | "max" | "min";
|
|
48
|
+
/**
|
|
49
|
+
* Axis position.
|
|
50
|
+
*/
|
|
51
|
+
export type AxisPosition = "b" | "l" | "r" | "t";
|
|
52
|
+
/**
|
|
53
|
+
* Axis orientation.
|
|
54
|
+
*/
|
|
55
|
+
export type AxisOrientation = "minMax" | "maxMin";
|
|
56
|
+
/**
|
|
57
|
+
* Tick mark type.
|
|
58
|
+
*/
|
|
59
|
+
export type TickMark = "none" | "inside" | "outside" | "cross";
|
|
60
|
+
/**
|
|
61
|
+
* Tick label position.
|
|
62
|
+
*/
|
|
63
|
+
export type TickLabelPosition = "high" | "low" | "nextTo" | "none";
|
|
64
|
+
/**
|
|
65
|
+
* Time unit for date axes.
|
|
66
|
+
*/
|
|
67
|
+
export type TimeUnit = "days" | "months" | "years";
|
|
68
|
+
/**
|
|
69
|
+
* Label alignment for category axes.
|
|
70
|
+
*/
|
|
71
|
+
export type LabelAlignment = "ctr" | "l" | "r";
|
|
72
|
+
/**
|
|
73
|
+
* Legend position.
|
|
74
|
+
*/
|
|
75
|
+
export type LegendPosition = "b" | "l" | "r" | "t" | "tr";
|
|
76
|
+
/**
|
|
77
|
+
* Display blanks as.
|
|
78
|
+
*/
|
|
79
|
+
export type DisplayBlanksAs = "gap" | "span" | "zero";
|
|
80
|
+
/**
|
|
81
|
+
* Label position for data labels.
|
|
82
|
+
*/
|
|
83
|
+
export type DataLabelPosition = "bestFit" | "b" | "ctr" | "inBase" | "inEnd" | "l" | "outEnd" | "r" | "t";
|
|
84
|
+
/**
|
|
85
|
+
* Trendline type.
|
|
86
|
+
*/
|
|
87
|
+
export type TrendlineType = "exp" | "linear" | "log" | "movingAvg" | "poly" | "power";
|
|
88
|
+
/**
|
|
89
|
+
* Error bar type.
|
|
90
|
+
*/
|
|
91
|
+
export type ErrorBarType = "both" | "minus" | "plus";
|
|
92
|
+
/**
|
|
93
|
+
* Error bar direction (x or y axis).
|
|
94
|
+
*/
|
|
95
|
+
export type ErrorBarDirection = "x" | "y";
|
|
96
|
+
/**
|
|
97
|
+
* Error bar value type.
|
|
98
|
+
*/
|
|
99
|
+
export type ErrorBarValueType = "cust" | "fixedVal" | "percentage" | "stdDev" | "stdErr";
|
|
100
|
+
/**
|
|
101
|
+
* Split type for of-pie charts.
|
|
102
|
+
*/
|
|
103
|
+
export type SplitType = "auto" | "cust" | "percent" | "pos" | "val";
|
|
104
|
+
/**
|
|
105
|
+
* Picture format for picture fills in markers/bars.
|
|
106
|
+
*/
|
|
107
|
+
export type PictureFormat = "stretch" | "stack" | "stackScale";
|
|
108
|
+
/**
|
|
109
|
+
* DrawingML solid color fill.
|
|
110
|
+
*/
|
|
111
|
+
export interface ChartColor {
|
|
112
|
+
/** sRGB hex color (e.g. "FF0000") */
|
|
113
|
+
srgb?: string;
|
|
114
|
+
/** Theme color index */
|
|
115
|
+
theme?: number;
|
|
116
|
+
/**
|
|
117
|
+
* DrawingML scheme colour name that could not be mapped onto a theme
|
|
118
|
+
* index (e.g. `"phClr"` — the DrawingML "placeholder colour" token —
|
|
119
|
+
* or a future / vendor addition). When set, the writer emits
|
|
120
|
+
* `<a:schemeClr val="…">` (NOT `<a:sysClr>`); this preserves the
|
|
121
|
+
* original element identity on round-trip. Prefer {@link theme} when
|
|
122
|
+
* the name is one of the 12 canonical scheme slots.
|
|
123
|
+
*/
|
|
124
|
+
schemeName?: string;
|
|
125
|
+
/** System color (e.g. "windowText", "window") */
|
|
126
|
+
sysClr?: string;
|
|
127
|
+
/** Preset color name (e.g. "black", "white") */
|
|
128
|
+
prstClr?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Tint modifier. Stored as a **fraction in 0..1** (e.g. `0.5` for
|
|
131
|
+
* 50% tint); the writer multiplies by `100000` to produce the OOXML
|
|
132
|
+
* `<a:tint val="…"/>` integer.
|
|
133
|
+
*
|
|
134
|
+
* ⚠ This convention differs from {@link ChartColorsEntry.tint} and
|
|
135
|
+
* {@link ChartColorVariation.tint}, which store the **raw OOXML
|
|
136
|
+
* integer** (0..100000) because those palette types pass the DrawingML
|
|
137
|
+
* modifier value through unchanged. Copying a value between the two
|
|
138
|
+
* shapes without conversion will land the wrong colour — use
|
|
139
|
+
*
|
|
140
|
+
* chartColorsEntry.tint = Math.round(chartColor.tint * 100000)
|
|
141
|
+
* chartColor.tint = chartColorsEntry.tint / 100000
|
|
142
|
+
*
|
|
143
|
+
* at the boundary.
|
|
144
|
+
*/
|
|
145
|
+
tint?: number;
|
|
146
|
+
/** Shade (OOXML percentage, 0-100000) */
|
|
147
|
+
shade?: number;
|
|
148
|
+
/** Saturation modification (OOXML percentage) */
|
|
149
|
+
satMod?: number;
|
|
150
|
+
/** Luminance modification (OOXML percentage, 0-100000) */
|
|
151
|
+
lumMod?: number;
|
|
152
|
+
/** Luminance offset (OOXML percentage, 0-100000) */
|
|
153
|
+
lumOff?: number;
|
|
154
|
+
/** Alpha (OOXML percentage, 0-100000; 100000 = fully opaque) */
|
|
155
|
+
alpha?: number;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Line (outline) properties.
|
|
159
|
+
*/
|
|
160
|
+
export interface ChartLine {
|
|
161
|
+
/** Width in EMU */
|
|
162
|
+
width?: number;
|
|
163
|
+
/** Solid fill color */
|
|
164
|
+
color?: ChartColor;
|
|
165
|
+
/** Dash style */
|
|
166
|
+
dash?: "solid" | "dot" | "dash" | "lgDash" | "dashDot" | "lgDashDot" | "lgDashDotDot" | "sysDash" | "sysDot" | "sysDashDot" | "sysDashDotDot";
|
|
167
|
+
/** Line cap style */
|
|
168
|
+
cap?: "flat" | "sq" | "rnd";
|
|
169
|
+
/** Line join style */
|
|
170
|
+
join?: "round" | "bevel" | "miter";
|
|
171
|
+
/** Compound line type */
|
|
172
|
+
compound?: "sng" | "dbl" | "thickThin" | "thinThick" | "tri";
|
|
173
|
+
/** No line */
|
|
174
|
+
noFill?: boolean;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Fill properties.
|
|
178
|
+
*/
|
|
179
|
+
export interface ChartFill {
|
|
180
|
+
/** Solid color fill */
|
|
181
|
+
solid?: ChartColor;
|
|
182
|
+
/** No fill */
|
|
183
|
+
noFill?: boolean;
|
|
184
|
+
/** Pattern fill */
|
|
185
|
+
pattern?: {
|
|
186
|
+
preset: string;
|
|
187
|
+
foreground?: ChartColor;
|
|
188
|
+
background?: ChartColor;
|
|
189
|
+
};
|
|
190
|
+
/** Gradient fill */
|
|
191
|
+
gradient?: {
|
|
192
|
+
/**
|
|
193
|
+
* Gradient colour stops. `position` is a **fraction** in the range
|
|
194
|
+
* `[0, 1]` (0 = start, 1 = end), regardless of OOXML's on-disk
|
|
195
|
+
* encoding which uses hundredths-of-a-percent (`0`–`100000`). The
|
|
196
|
+
* renderer converts to/from the wire format.
|
|
197
|
+
*/
|
|
198
|
+
stops: Array<{
|
|
199
|
+
position: number;
|
|
200
|
+
color: ChartColor;
|
|
201
|
+
}>;
|
|
202
|
+
/**
|
|
203
|
+
* Linear-gradient angle in **degrees** (0 = left-to-right, 90 =
|
|
204
|
+
* top-to-bottom). Ignored for `circle` / `rect` / `shape` paths.
|
|
205
|
+
* OOXML stores this as 60000ths of a degree; the renderer converts.
|
|
206
|
+
*/
|
|
207
|
+
angle?: number;
|
|
208
|
+
/**
|
|
209
|
+
* DrawingML `<a:lin/@scaled>` — when `true` (the default Excel
|
|
210
|
+
* emits), the angle scales with the shape's aspect ratio; when
|
|
211
|
+
* `false`, the angle is independent of shape geometry. The
|
|
212
|
+
* difference is visible: a 45° gradient on a 2:1 rectangle aims
|
|
213
|
+
* at a different corner depending on this flag. The writer
|
|
214
|
+
* defaults to `true` when omitted (matching Excel), so only
|
|
215
|
+
* `false` changes the on-disk bytes; but preserving the authored
|
|
216
|
+
* value is needed to avoid silently drifting the flag on
|
|
217
|
+
* round-trip.
|
|
218
|
+
*/
|
|
219
|
+
scaled?: boolean;
|
|
220
|
+
/** Linear, circle, rect, shape */
|
|
221
|
+
type?: "linear" | "circle" | "rect" | "shape";
|
|
222
|
+
/**
|
|
223
|
+
* Focal rectangle for non-linear gradients. Components are
|
|
224
|
+
* fractions in `[0, 1]` (left/top/right/bottom insets from the
|
|
225
|
+
* bounding box). Absent or all-zero means the focal centre is the
|
|
226
|
+
* shape centre — OOXML's `<a:fillToRect l="50000" t="50000"
|
|
227
|
+
* r="50000" b="50000"/>` equivalent. The renderer converts to
|
|
228
|
+
* hundredths-of-a-percent on write.
|
|
229
|
+
*/
|
|
230
|
+
fillToRect?: {
|
|
231
|
+
left?: number;
|
|
232
|
+
top?: number;
|
|
233
|
+
right?: number;
|
|
234
|
+
bottom?: number;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Picture (blip) fill — `<a:blipFill>/<a:blip r:embed="rIdN"/>`.
|
|
239
|
+
*
|
|
240
|
+
* {@link ChartBlipFill.relationshipId} is the final wire value; when
|
|
241
|
+
* the caller has not yet registered the image with the chart part,
|
|
242
|
+
* `_pendingImage` carries the raw data until the worksheet-side
|
|
243
|
+
* `_registerChart` path wires up the media entry and chart rel.
|
|
244
|
+
*/
|
|
245
|
+
blip?: ChartBlipFill;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Picture fill for chart shapes — serialises as `<a:blipFill>`.
|
|
249
|
+
*
|
|
250
|
+
* `relationshipId` is the authoritative output: once present, the
|
|
251
|
+
* writer emits `<a:blip r:embed="rIdN"/>`. `_pendingImage` is a
|
|
252
|
+
* construction-time staging slot consumed by the worksheet registration
|
|
253
|
+
* path — after `_registerChart` runs, it is removed and
|
|
254
|
+
* `relationshipId` is set.
|
|
255
|
+
*/
|
|
256
|
+
export interface ChartBlipFill {
|
|
257
|
+
/** Chart-part relationship id referring to the image. */
|
|
258
|
+
relationshipId?: string;
|
|
259
|
+
/**
|
|
260
|
+
* Stretch rectangle (`<a:srcRect l t r b>`) with fractional
|
|
261
|
+
* (per-mille, 0-100000) insets. Absent for a full-bleed fill.
|
|
262
|
+
*/
|
|
263
|
+
sourceRectangle?: {
|
|
264
|
+
left?: number;
|
|
265
|
+
top?: number;
|
|
266
|
+
right?: number;
|
|
267
|
+
bottom?: number;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Tile or stretch mode. `stretch` maps to `<a:stretch><a:fillRect/></a:stretch>`;
|
|
271
|
+
* `tile` maps to `<a:tile/>` with the given tiling parameters; `none`
|
|
272
|
+
* emits neither child (which Excel treats as stretch).
|
|
273
|
+
*/
|
|
274
|
+
fillMode?: "stretch" | "tile" | "none";
|
|
275
|
+
/** Tile options, honoured only when {@link fillMode} is `"tile"`. */
|
|
276
|
+
tile?: {
|
|
277
|
+
tx?: number;
|
|
278
|
+
ty?: number;
|
|
279
|
+
sx?: number;
|
|
280
|
+
sy?: number;
|
|
281
|
+
flip?: "none" | "x" | "y" | "xy";
|
|
282
|
+
alignment?: string;
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Shape properties (c:spPr).
|
|
287
|
+
*/
|
|
288
|
+
export interface ShapeProperties {
|
|
289
|
+
fill?: ChartFill;
|
|
290
|
+
line?: ChartLine;
|
|
291
|
+
/** Structured effect list (shadow, glow, soft edge, reflection, blur). */
|
|
292
|
+
effectList?: EffectList;
|
|
293
|
+
/** 3D scene (camera + light rig) */
|
|
294
|
+
scene3d?: Scene3D;
|
|
295
|
+
/** 3D shape properties (bevel / extrusion / material) */
|
|
296
|
+
sp3d?: ShapeProperties3D;
|
|
297
|
+
/**
|
|
298
|
+
* `a:xfrm` — position / size / rotation / flip. Structured version
|
|
299
|
+
* of the transform Excel emits on shapes that have been manually
|
|
300
|
+
* positioned on the chart. When absent the shape uses its parent's
|
|
301
|
+
* automatic layout.
|
|
302
|
+
*/
|
|
303
|
+
transform?: ShapeTransform;
|
|
304
|
+
/**
|
|
305
|
+
* `a:prstGeom` — the preset shape geometry (rectangle, roundRect,
|
|
306
|
+
* ellipse, arrow, callout, etc.) used by non-rectangular chart
|
|
307
|
+
* shapes. Present on `c:shapeGroupSprite`-style chart decorations;
|
|
308
|
+
* charts themselves default to `rect` and omit this element.
|
|
309
|
+
*/
|
|
310
|
+
presetGeometry?: PresetGeometry;
|
|
311
|
+
/**
|
|
312
|
+
* `a:custGeom` — freeform geometry for fully custom shapes. Only
|
|
313
|
+
* meaningful for shapes the user drew with the Excel freeform tool.
|
|
314
|
+
* Structured access covers path segments; the `paths` array mirrors
|
|
315
|
+
* the OOXML `<a:pathLst>` container.
|
|
316
|
+
*/
|
|
317
|
+
customGeometry?: CustomGeometry;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* `a:xfrm` — shape transform: origin, extent, rotation, flip.
|
|
321
|
+
*
|
|
322
|
+
* OOXML coordinates are in EMUs (1/914400 inch) for position/extent and
|
|
323
|
+
* in 1/60000 of a degree for `rotation`. excelts exposes the raw units
|
|
324
|
+
* so round-trip is lossless; helpers in `shape-properties.ts` convert
|
|
325
|
+
* to / from points and degrees when a caller prefers friendlier units.
|
|
326
|
+
*/
|
|
327
|
+
export interface ShapeTransform {
|
|
328
|
+
/** `<a:off x y>` — top-left origin in EMU. */
|
|
329
|
+
offsetX?: number;
|
|
330
|
+
offsetY?: number;
|
|
331
|
+
/** `<a:ext cx cy>` — width / height in EMU. */
|
|
332
|
+
width?: number;
|
|
333
|
+
height?: number;
|
|
334
|
+
/**
|
|
335
|
+
* `@rot` on `a:xfrm` — rotation in 1/60000 of a degree (positive
|
|
336
|
+
* values rotate clockwise). Absent means "not rotated".
|
|
337
|
+
*/
|
|
338
|
+
rotation?: number;
|
|
339
|
+
/** `@flipH="1"` — horizontal flip. */
|
|
340
|
+
flipHorizontal?: boolean;
|
|
341
|
+
/** `@flipV="1"` — vertical flip. */
|
|
342
|
+
flipVertical?: boolean;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* `a:prstGeom` — preset shape geometry.
|
|
346
|
+
*
|
|
347
|
+
* `preset` is one of the ~180 DrawingML preset shape names
|
|
348
|
+
* (`"rect"`, `"roundRect"`, `"ellipse"`, `"rightArrow"`, `"cloud"`…).
|
|
349
|
+
* `adjustments` are the shape-specific `gd` parameters Excel exposes
|
|
350
|
+
* as the little yellow diamond handles on interactive shapes; each
|
|
351
|
+
* entry has the symbolic name (e.g. `"adj1"`) and a per-mille
|
|
352
|
+
* integer value.
|
|
353
|
+
*/
|
|
354
|
+
export interface PresetGeometry {
|
|
355
|
+
preset: string;
|
|
356
|
+
adjustments?: Array<{
|
|
357
|
+
name: string;
|
|
358
|
+
fmla: string;
|
|
359
|
+
}>;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* `a:custGeom` — custom freeform geometry.
|
|
363
|
+
*
|
|
364
|
+
* Represented at path granularity: each path carries its own bounding
|
|
365
|
+
* box (`w` / `h`) and the ordered list of drawing commands. This
|
|
366
|
+
* matches Excel's serialisation closely — a preview renderer can walk
|
|
367
|
+
* `commands` linearly and emit SVG `<path d="…">` data.
|
|
368
|
+
*/
|
|
369
|
+
export interface CustomGeometry {
|
|
370
|
+
/**
|
|
371
|
+
* `a:pathLst/a:path` — one or more subpaths. Each subpath declares
|
|
372
|
+
* its own logical coordinate space via {@link CustomGeometryPath.w}
|
|
373
|
+
* and {@link CustomGeometryPath.h}; command coordinates are
|
|
374
|
+
* relative to that space.
|
|
375
|
+
*/
|
|
376
|
+
paths?: CustomGeometryPath[];
|
|
377
|
+
/**
|
|
378
|
+
* `a:avLst` — adjustment values, as on {@link PresetGeometry}. Very
|
|
379
|
+
* rare on custom geometry but retained for byte-preserving round
|
|
380
|
+
* trip.
|
|
381
|
+
*/
|
|
382
|
+
adjustments?: Array<{
|
|
383
|
+
name: string;
|
|
384
|
+
fmla: string;
|
|
385
|
+
}>;
|
|
386
|
+
}
|
|
387
|
+
export interface CustomGeometryPath {
|
|
388
|
+
/** Width of the path's local coordinate space in EMU. */
|
|
389
|
+
w?: number;
|
|
390
|
+
/** Height of the path's local coordinate space in EMU. */
|
|
391
|
+
h?: number;
|
|
392
|
+
/** Fill mode — maps to `a:path/@fill`. */
|
|
393
|
+
fill?: "none" | "norm" | "lighten" | "darken" | "lightenLess" | "darkenLess";
|
|
394
|
+
/** Stroke flag — `a:path/@stroke="1"`. */
|
|
395
|
+
stroke?: boolean;
|
|
396
|
+
/**
|
|
397
|
+
* Drawing commands in order: `moveTo`, `lnTo`, `arcTo`, `cubicBezTo`,
|
|
398
|
+
* `quadBezTo`, `close`. Each command's `points` array carries the
|
|
399
|
+
* 0-2 control points in local path coordinates.
|
|
400
|
+
*/
|
|
401
|
+
commands: CustomGeometryCommand[];
|
|
402
|
+
}
|
|
403
|
+
export interface CustomGeometryCommand {
|
|
404
|
+
type: "moveTo" | "lnTo" | "arcTo" | "cubicBezTo" | "quadBezTo" | "close";
|
|
405
|
+
/** Points consumed by the command (empty for `close`). */
|
|
406
|
+
points?: Array<{
|
|
407
|
+
x: number;
|
|
408
|
+
y: number;
|
|
409
|
+
}>;
|
|
410
|
+
/**
|
|
411
|
+
* For `arcTo`: `wR`, `hR`, `stAng`, `swAng`. OOXML keeps arc
|
|
412
|
+
* parameters as explicit named attributes rather than as points, so
|
|
413
|
+
* they ride here to preserve the original shape.
|
|
414
|
+
*/
|
|
415
|
+
arcParams?: {
|
|
416
|
+
wR: number;
|
|
417
|
+
hR: number;
|
|
418
|
+
stAng: number;
|
|
419
|
+
swAng: number;
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Effect list (a:effectLst) — drop shadow, outer/inner glow, soft edge,
|
|
424
|
+
* reflection, blur. Multiple effects can be combined.
|
|
425
|
+
*/
|
|
426
|
+
export interface EffectList {
|
|
427
|
+
/** Blur effect (a:blur) */
|
|
428
|
+
blur?: {
|
|
429
|
+
/** Blur radius in EMU */
|
|
430
|
+
radius?: number;
|
|
431
|
+
/** If true, blur grows shape bounds */
|
|
432
|
+
grow?: boolean;
|
|
433
|
+
};
|
|
434
|
+
/** Outer shadow (a:outerShdw) */
|
|
435
|
+
outerShadow?: Shadow;
|
|
436
|
+
/** Inner shadow (a:innerShdw) */
|
|
437
|
+
innerShadow?: Shadow;
|
|
438
|
+
/** Preset shadow (a:prstShdw val="shdw1".."shdw20") */
|
|
439
|
+
presetShadow?: {
|
|
440
|
+
preset: string;
|
|
441
|
+
distance?: number;
|
|
442
|
+
direction?: number;
|
|
443
|
+
color?: ChartColor;
|
|
444
|
+
};
|
|
445
|
+
/** Outer glow (a:glow) */
|
|
446
|
+
glow?: {
|
|
447
|
+
radius: number;
|
|
448
|
+
color: ChartColor;
|
|
449
|
+
};
|
|
450
|
+
/** Soft edge (a:softEdge) */
|
|
451
|
+
softEdge?: {
|
|
452
|
+
radius: number;
|
|
453
|
+
};
|
|
454
|
+
/** Reflection (a:reflection) */
|
|
455
|
+
reflection?: {
|
|
456
|
+
/** Blur radius in EMU */
|
|
457
|
+
blurRadius?: number;
|
|
458
|
+
/** Start opacity 0-100000 */
|
|
459
|
+
startOpacity?: number;
|
|
460
|
+
/** Start position 0-100000 */
|
|
461
|
+
startPosition?: number;
|
|
462
|
+
/** End opacity */
|
|
463
|
+
endOpacity?: number;
|
|
464
|
+
/** End position */
|
|
465
|
+
endPosition?: number;
|
|
466
|
+
/** Distance from shape */
|
|
467
|
+
distance?: number;
|
|
468
|
+
/** Direction in 60000ths of a degree */
|
|
469
|
+
direction?: number;
|
|
470
|
+
/** Fade direction */
|
|
471
|
+
fadeDirection?: number;
|
|
472
|
+
/** Horizontal scale 0-100000 */
|
|
473
|
+
scaleHorizontal?: number;
|
|
474
|
+
/** Vertical scale */
|
|
475
|
+
scaleVertical?: number;
|
|
476
|
+
/** Horizontal skew angle */
|
|
477
|
+
skewHorizontal?: number;
|
|
478
|
+
/** Vertical skew angle */
|
|
479
|
+
skewVertical?: number;
|
|
480
|
+
/** Alignment: bl/br/ctr/l/r/t/tl/tr/b */
|
|
481
|
+
alignment?: "b" | "bl" | "br" | "ctr" | "l" | "r" | "t" | "tl" | "tr";
|
|
482
|
+
/** Rotate with shape */
|
|
483
|
+
rotateWithShape?: boolean;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Shadow effect (used for both innerShdw and outerShdw).
|
|
488
|
+
*/
|
|
489
|
+
export interface Shadow {
|
|
490
|
+
/** Blur radius in EMU */
|
|
491
|
+
blurRadius?: number;
|
|
492
|
+
/** Distance from shape in EMU */
|
|
493
|
+
distance?: number;
|
|
494
|
+
/** Direction in 60000ths of a degree (outer only) */
|
|
495
|
+
direction?: number;
|
|
496
|
+
/** Alignment (outer only) */
|
|
497
|
+
alignment?: "b" | "bl" | "br" | "ctr" | "l" | "r" | "t" | "tl" | "tr";
|
|
498
|
+
/** Shadow color */
|
|
499
|
+
color: ChartColor;
|
|
500
|
+
/** Rotate with shape (outer only) */
|
|
501
|
+
rotateWithShape?: boolean;
|
|
502
|
+
/** Horizontal scale (outer only) */
|
|
503
|
+
scaleHorizontal?: number;
|
|
504
|
+
/** Vertical scale (outer only) */
|
|
505
|
+
scaleVertical?: number;
|
|
506
|
+
/** Horizontal skew (outer only) */
|
|
507
|
+
skewHorizontal?: number;
|
|
508
|
+
/** Vertical skew (outer only) */
|
|
509
|
+
skewVertical?: number;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* 3D scene (a:scene3d) — camera and light rig.
|
|
513
|
+
*/
|
|
514
|
+
export interface Scene3D {
|
|
515
|
+
camera?: {
|
|
516
|
+
preset: string;
|
|
517
|
+
fov?: number;
|
|
518
|
+
zoom?: number;
|
|
519
|
+
rotation?: {
|
|
520
|
+
lat: number;
|
|
521
|
+
lon: number;
|
|
522
|
+
rev: number;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
lightRig?: {
|
|
526
|
+
rig: string;
|
|
527
|
+
direction: string;
|
|
528
|
+
rotation?: {
|
|
529
|
+
lat: number;
|
|
530
|
+
lon: number;
|
|
531
|
+
rev: number;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
backdrop?: unknown;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* 3D shape properties (a:sp3d) — bevels, extrusion, material.
|
|
538
|
+
*/
|
|
539
|
+
export interface ShapeProperties3D {
|
|
540
|
+
/** Z-axis height (a:sp3d/@z) */
|
|
541
|
+
z?: number;
|
|
542
|
+
/** Extrusion height (a:sp3d/@extrusionH) */
|
|
543
|
+
extrusionHeight?: number;
|
|
544
|
+
/** Contour width (a:sp3d/@contourW) */
|
|
545
|
+
contourWidth?: number;
|
|
546
|
+
/** Preset material (legacy, matte, plastic, metal, etc.) */
|
|
547
|
+
material?: string;
|
|
548
|
+
/** Top bevel */
|
|
549
|
+
bevelTop?: Bevel;
|
|
550
|
+
/** Bottom bevel */
|
|
551
|
+
bevelBottom?: Bevel;
|
|
552
|
+
/** Extrusion color (a:extrusionClr) */
|
|
553
|
+
extrusionColor?: ChartColor;
|
|
554
|
+
/** Contour color (a:contourClr) */
|
|
555
|
+
contourColor?: ChartColor;
|
|
556
|
+
}
|
|
557
|
+
export interface Bevel {
|
|
558
|
+
/** Width in EMU */
|
|
559
|
+
width?: number;
|
|
560
|
+
/** Height in EMU */
|
|
561
|
+
height?: number;
|
|
562
|
+
/** Preset: angle, artDeco, circle, etc. */
|
|
563
|
+
preset?: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Underline style (OOXML a:u attribute values).
|
|
567
|
+
* See §20.1.10.82 of ECMA-376.
|
|
568
|
+
*/
|
|
569
|
+
export type UnderlineStyle = "none" | "words" | "sng" | "dbl" | "heavy" | "dotted" | "dottedHeavy" | "dash" | "dashHeavy" | "dashLong" | "dashLongHeavy" | "dotDash" | "dotDashHeavy" | "dotDotDash" | "dotDotDashHeavy" | "wavy" | "wavyHeavy" | "wavyDbl";
|
|
570
|
+
/** Strike-through style (OOXML a:strike). */
|
|
571
|
+
export type StrikeStyle = "noStrike" | "sngStrike" | "dblStrike";
|
|
572
|
+
/** Capitalization (OOXML a:cap). */
|
|
573
|
+
export type CapStyle = "none" | "small" | "all";
|
|
574
|
+
/** Paragraph alignment (OOXML a:algn). */
|
|
575
|
+
export type ParagraphAlignment = "l" | "ctr" | "r" | "just" | "justLow" | "dist" | "thaiDist";
|
|
576
|
+
/**
|
|
577
|
+
* Text properties for chart text elements.
|
|
578
|
+
*
|
|
579
|
+
* Maps to OOXML `<a:rPr>` / `<a:defRPr>` run properties. All fields are optional
|
|
580
|
+
* and only those set are serialised; raw XML fallback (`_rawXml`) is used when
|
|
581
|
+
* preserving unparseable round-trip content.
|
|
582
|
+
*/
|
|
583
|
+
export interface ChartTextProperties {
|
|
584
|
+
/** Font size in hundredths of a point (e.g. 1000 = 10pt) */
|
|
585
|
+
size?: number;
|
|
586
|
+
/** Bold */
|
|
587
|
+
bold?: boolean;
|
|
588
|
+
/** Italic */
|
|
589
|
+
italic?: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* Underline. `true` is a shorthand for `"sng"`; `false`/omitted means none.
|
|
592
|
+
* For full OOXML control use the string variant.
|
|
593
|
+
*/
|
|
594
|
+
underline?: boolean | UnderlineStyle;
|
|
595
|
+
/** Strike-through */
|
|
596
|
+
strike?: StrikeStyle;
|
|
597
|
+
/** Font color */
|
|
598
|
+
color?: ChartColor;
|
|
599
|
+
/** Font family (Latin typeface — maps to a:latin/@typeface) */
|
|
600
|
+
fontFamily?: string;
|
|
601
|
+
/** East Asian typeface (a:ea/@typeface) */
|
|
602
|
+
eastAsianFamily?: string;
|
|
603
|
+
/** Complex-script typeface (a:cs/@typeface) */
|
|
604
|
+
complexScriptFamily?: string;
|
|
605
|
+
/** Rotation in 60000ths of a degree (applied at bodyPr level when used on paragraph text) */
|
|
606
|
+
rotation?: number;
|
|
607
|
+
/** Baseline offset (percentage * 1000 — positive=superscript, negative=subscript) */
|
|
608
|
+
baseline?: number;
|
|
609
|
+
/** Character kerning cut-off, hundredths of a point (a:rPr/@kern) */
|
|
610
|
+
kern?: number;
|
|
611
|
+
/** Character spacing in hundredths of a point (a:rPr/@spc) */
|
|
612
|
+
spacing?: number;
|
|
613
|
+
/** Capitalisation */
|
|
614
|
+
cap?: CapStyle;
|
|
615
|
+
/** Language (a:rPr/@lang, e.g. "en-US") */
|
|
616
|
+
lang?: string;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Rich text for chart labels and titles.
|
|
620
|
+
*/
|
|
621
|
+
export interface ChartRichText {
|
|
622
|
+
paragraphs: ChartParagraph[];
|
|
623
|
+
/** Body properties (wrapping, anchoring, rotation) */
|
|
624
|
+
bodyProperties?: ChartBodyProperties;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Body-level text properties (OOXML a:bodyPr).
|
|
628
|
+
*/
|
|
629
|
+
export interface ChartBodyProperties {
|
|
630
|
+
/** Rotation in 60000ths of a degree */
|
|
631
|
+
rotation?: number;
|
|
632
|
+
/** Horizontal overflow: overflow/clip */
|
|
633
|
+
horizontalOverflow?: "overflow" | "clip";
|
|
634
|
+
/** Vertical anchor */
|
|
635
|
+
anchor?: "t" | "ctr" | "b" | "just" | "dist";
|
|
636
|
+
/** Text wrapping */
|
|
637
|
+
wrap?: "none" | "square";
|
|
638
|
+
/** Vertical text (stacked) */
|
|
639
|
+
vertical?: "horz" | "vert" | "vert270" | "wordArtVert" | "eaVert" | "mongolianVert" | "wordArtVertRtl";
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Paragraph-level properties (OOXML a:pPr).
|
|
643
|
+
*/
|
|
644
|
+
export interface ChartParagraphProperties {
|
|
645
|
+
/** Alignment */
|
|
646
|
+
alignment?: ParagraphAlignment;
|
|
647
|
+
/** Indent in EMU (914400 = 1 inch) */
|
|
648
|
+
indent?: number;
|
|
649
|
+
/** Left margin in EMU */
|
|
650
|
+
marginLeft?: number;
|
|
651
|
+
/** Right margin in EMU */
|
|
652
|
+
marginRight?: number;
|
|
653
|
+
/** Bullet: character / auto-number / none */
|
|
654
|
+
bullet?: ChartBullet;
|
|
655
|
+
/** Line spacing (percentage * 1000 for a:spcPct, or points * 100 for a:spcPts) */
|
|
656
|
+
lineSpacing?: ChartLineSpacing;
|
|
657
|
+
/** Space before paragraph */
|
|
658
|
+
spaceBefore?: ChartLineSpacing;
|
|
659
|
+
/** Space after paragraph */
|
|
660
|
+
spaceAfter?: ChartLineSpacing;
|
|
661
|
+
/** Level (0-8) for nested lists */
|
|
662
|
+
level?: number;
|
|
663
|
+
/** Default run properties applied to runs without their own properties */
|
|
664
|
+
defaultRunProperties?: ChartTextProperties;
|
|
665
|
+
}
|
|
666
|
+
export type ChartBullet = {
|
|
667
|
+
type: "none";
|
|
668
|
+
} | {
|
|
669
|
+
type: "char";
|
|
670
|
+
character: string;
|
|
671
|
+
} | {
|
|
672
|
+
type: "autoNum";
|
|
673
|
+
scheme: string;
|
|
674
|
+
startAt?: number;
|
|
675
|
+
};
|
|
676
|
+
export type ChartLineSpacing = {
|
|
677
|
+
type: "percentage";
|
|
678
|
+
value: number;
|
|
679
|
+
} | {
|
|
680
|
+
type: "points";
|
|
681
|
+
value: number;
|
|
682
|
+
};
|
|
683
|
+
export interface ChartParagraph {
|
|
684
|
+
/** Paragraph properties (a:pPr) */
|
|
685
|
+
properties?: ChartParagraphProperties;
|
|
686
|
+
/** Legacy alias for default run properties (kept for backward compat). */
|
|
687
|
+
runProperties?: ChartTextProperties;
|
|
688
|
+
/** Text runs */
|
|
689
|
+
runs?: ChartTextRun[];
|
|
690
|
+
/** End-paragraph run properties (a:endParaRPr) */
|
|
691
|
+
endParaRunProperties?: ChartTextProperties;
|
|
692
|
+
}
|
|
693
|
+
export interface ChartTextRun {
|
|
694
|
+
text: string;
|
|
695
|
+
/** Run properties (a:rPr) */
|
|
696
|
+
properties?: ChartTextProperties;
|
|
697
|
+
/** Hyperlink — a:hlinkClick */
|
|
698
|
+
hyperlink?: {
|
|
699
|
+
/** Rel ID pointing to the target (for external hyperlinks) */
|
|
700
|
+
relationshipId?: string;
|
|
701
|
+
/** Tooltip text */
|
|
702
|
+
tooltip?: string;
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Number reference (c:numRef).
|
|
707
|
+
*/
|
|
708
|
+
export interface NumberReference {
|
|
709
|
+
/** Formula reference (e.g. "Sheet1!$B$2:$B$5") */
|
|
710
|
+
formula: string;
|
|
711
|
+
/** Cached numeric values */
|
|
712
|
+
cache?: NumberCache;
|
|
713
|
+
}
|
|
714
|
+
export interface NumberCache {
|
|
715
|
+
formatCode?: string;
|
|
716
|
+
pointCount?: number;
|
|
717
|
+
points: Array<{
|
|
718
|
+
index: number;
|
|
719
|
+
value: number | null;
|
|
720
|
+
formatCode?: string;
|
|
721
|
+
}>;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* String reference (c:strRef).
|
|
725
|
+
*/
|
|
726
|
+
export interface StringReference {
|
|
727
|
+
/** Formula reference */
|
|
728
|
+
formula: string;
|
|
729
|
+
/** Cached string values */
|
|
730
|
+
cache?: StringCache;
|
|
731
|
+
}
|
|
732
|
+
export interface StringCache {
|
|
733
|
+
pointCount?: number;
|
|
734
|
+
points: Array<{
|
|
735
|
+
index: number;
|
|
736
|
+
value: string;
|
|
737
|
+
}>;
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Number literal (c:numLit).
|
|
741
|
+
*/
|
|
742
|
+
export interface NumberLiteral {
|
|
743
|
+
formatCode?: string;
|
|
744
|
+
pointCount?: number;
|
|
745
|
+
points: Array<{
|
|
746
|
+
index: number;
|
|
747
|
+
value: number | null;
|
|
748
|
+
}>;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* String literal (c:strLit).
|
|
752
|
+
*/
|
|
753
|
+
export interface StringLiteral {
|
|
754
|
+
pointCount?: number;
|
|
755
|
+
points: Array<{
|
|
756
|
+
index: number;
|
|
757
|
+
value: string;
|
|
758
|
+
}>;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Multi-level string reference (c:multiLvlStrRef).
|
|
762
|
+
*/
|
|
763
|
+
export interface MultiLevelStringReference {
|
|
764
|
+
formula: string;
|
|
765
|
+
cache?: MultiLevelStringCache;
|
|
766
|
+
}
|
|
767
|
+
export interface MultiLevelStringCache {
|
|
768
|
+
pointCount?: number;
|
|
769
|
+
levels: StringCache[];
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Axis data source — category axis data.
|
|
773
|
+
*/
|
|
774
|
+
export interface AxisDataSource {
|
|
775
|
+
numRef?: NumberReference;
|
|
776
|
+
numLit?: NumberLiteral;
|
|
777
|
+
strRef?: StringReference;
|
|
778
|
+
strLit?: StringLiteral;
|
|
779
|
+
multiLvlStrRef?: MultiLevelStringReference;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Number data source — value axis data.
|
|
783
|
+
*/
|
|
784
|
+
export interface NumberDataSource {
|
|
785
|
+
numRef?: NumberReference;
|
|
786
|
+
numLit?: NumberLiteral;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Series marker.
|
|
790
|
+
*/
|
|
791
|
+
export interface ChartMarker {
|
|
792
|
+
symbol?: "circle" | "dash" | "diamond" | "dot" | "none" | "picture" | "plus" | "square" | "star" | "triangle" | "x" | "auto";
|
|
793
|
+
size?: number;
|
|
794
|
+
spPr?: ShapeProperties;
|
|
795
|
+
/** Extension list (raw XML for round-trip) */
|
|
796
|
+
extLst?: string;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Data labels configuration.
|
|
800
|
+
*/
|
|
801
|
+
export interface DataLabels {
|
|
802
|
+
/**
|
|
803
|
+
* Suppress this whole `c:dLbls` block. OOXML expresses this as the
|
|
804
|
+
* `<c:delete val="1"/>` choice-left branch of `CT_DLbls`; when set,
|
|
805
|
+
* only `c:delete` (and `c:extLst`) is emitted. Typical usage: turn
|
|
806
|
+
* off the default data labels inherited from a chart style / theme
|
|
807
|
+
* while keeping per-point overrides in {@link entries} visible.
|
|
808
|
+
*/
|
|
809
|
+
delete?: boolean;
|
|
810
|
+
showLegendKey?: boolean;
|
|
811
|
+
showVal?: boolean;
|
|
812
|
+
showCatName?: boolean;
|
|
813
|
+
showSerName?: boolean;
|
|
814
|
+
showPercent?: boolean;
|
|
815
|
+
showBubbleSize?: boolean;
|
|
816
|
+
showLeaderLines?: boolean;
|
|
817
|
+
separator?: string;
|
|
818
|
+
position?: DataLabelPosition;
|
|
819
|
+
numFmt?: {
|
|
820
|
+
formatCode: string;
|
|
821
|
+
sourceLinked?: boolean;
|
|
822
|
+
};
|
|
823
|
+
spPr?: ShapeProperties;
|
|
824
|
+
txPr?: ChartTextProperties;
|
|
825
|
+
/** Individual data label overrides */
|
|
826
|
+
entries?: DataLabelEntry[];
|
|
827
|
+
/**
|
|
828
|
+
* Excel 2013+ "Value From Cells" — corresponds to the
|
|
829
|
+
* `c15:datalabelsRange` extension emitted inside
|
|
830
|
+
* `c:dLbls/c:extLst/c:ext[uri={CE6537A1-…}]`.
|
|
831
|
+
*
|
|
832
|
+
* When set, each data label displays the text from the corresponding
|
|
833
|
+
* cell in {@link DataLabelsRange.formula} instead of (or in addition
|
|
834
|
+
* to) the series/category/value drawn from the point itself. This is
|
|
835
|
+
* the feature Excel surfaces as the "Value From Cells" checkbox in
|
|
836
|
+
* the Format Data Labels pane.
|
|
837
|
+
*
|
|
838
|
+
* The matching per-point `<c:dLbl>` entries would traditionally
|
|
839
|
+
* hold `<c:tx><c:rich>…</c:rich></c:tx>` with the cached label
|
|
840
|
+
* string so viewers that don't understand the extension still
|
|
841
|
+
* render something sensible. This library currently emits the
|
|
842
|
+
* extension (`<c15:datalabelsRange>` inside `c:dLbls/c:extLst`)
|
|
843
|
+
* with its cache, but does NOT auto-generate placeholder
|
|
844
|
+
* per-point `<c:dLbl>` entries — Excel and every modern viewer
|
|
845
|
+
* reads the `c15:` extension directly, so the fallback placeholders
|
|
846
|
+
* are optional. Callers that need the fallback for a legacy
|
|
847
|
+
* consumer can populate {@link DataLabels.entries} manually with
|
|
848
|
+
* the same cached values.
|
|
849
|
+
*/
|
|
850
|
+
dataLabelsRange?: DataLabelsRange;
|
|
851
|
+
/** Extension list (raw XML for round-trip) */
|
|
852
|
+
extLst?: string;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* "Value From Cells" range for a data-label series. Points at a worksheet
|
|
856
|
+
* range whose values are used as the text of each data label, matching
|
|
857
|
+
* the `c15:datalabelsRange` extension (Office 2013+).
|
|
858
|
+
*/
|
|
859
|
+
export interface DataLabelsRange {
|
|
860
|
+
/** Excel formula referring to the cells whose values become labels. */
|
|
861
|
+
formula: string;
|
|
862
|
+
/**
|
|
863
|
+
* Optional cached values — one entry per source point, parallel to the
|
|
864
|
+
* series' data. Writers that want byte-preserving round-trip should
|
|
865
|
+
* populate this from the worksheet before serialising so readers
|
|
866
|
+
* without a formula engine still see the right labels; the
|
|
867
|
+
* cache-populator auto-fills it when left empty.
|
|
868
|
+
*/
|
|
869
|
+
cache?: StringCache;
|
|
870
|
+
}
|
|
871
|
+
export interface DataLabelEntry {
|
|
872
|
+
index: number;
|
|
873
|
+
showLegendKey?: boolean;
|
|
874
|
+
showVal?: boolean;
|
|
875
|
+
showCatName?: boolean;
|
|
876
|
+
showSerName?: boolean;
|
|
877
|
+
showPercent?: boolean;
|
|
878
|
+
showBubbleSize?: boolean;
|
|
879
|
+
separator?: string;
|
|
880
|
+
position?: DataLabelPosition;
|
|
881
|
+
layout?: ChartLayout;
|
|
882
|
+
text?: ChartRichText;
|
|
883
|
+
numFmt?: {
|
|
884
|
+
formatCode: string;
|
|
885
|
+
sourceLinked?: boolean;
|
|
886
|
+
};
|
|
887
|
+
spPr?: ShapeProperties;
|
|
888
|
+
txPr?: ChartTextProperties;
|
|
889
|
+
/** Delete this specific label */
|
|
890
|
+
delete?: boolean;
|
|
891
|
+
/** Extension list (raw XML for round-trip) */
|
|
892
|
+
extLst?: string;
|
|
893
|
+
}
|
|
894
|
+
export interface Trendline {
|
|
895
|
+
type: TrendlineType;
|
|
896
|
+
name?: string;
|
|
897
|
+
order?: number;
|
|
898
|
+
period?: number;
|
|
899
|
+
forward?: number;
|
|
900
|
+
backward?: number;
|
|
901
|
+
intercept?: number;
|
|
902
|
+
displayRSqr?: boolean;
|
|
903
|
+
displayEq?: boolean;
|
|
904
|
+
spPr?: ShapeProperties;
|
|
905
|
+
trendlineLbl?: TrendlineLabel;
|
|
906
|
+
/** Extension list (raw XML for round-trip) */
|
|
907
|
+
extLst?: string;
|
|
908
|
+
}
|
|
909
|
+
export interface TrendlineLabel {
|
|
910
|
+
layout?: ChartLayout;
|
|
911
|
+
text?: ChartRichText;
|
|
912
|
+
numFmt?: {
|
|
913
|
+
formatCode: string;
|
|
914
|
+
sourceLinked?: boolean;
|
|
915
|
+
};
|
|
916
|
+
spPr?: ShapeProperties;
|
|
917
|
+
txPr?: ChartTextProperties;
|
|
918
|
+
/** Extension list (raw XML for round-trip) */
|
|
919
|
+
extLst?: string;
|
|
920
|
+
}
|
|
921
|
+
export interface ErrorBars {
|
|
922
|
+
/**
|
|
923
|
+
* Which error-bar cap to show (x / y axis): `"x"`, `"y"` or both.
|
|
924
|
+
* Maps to OOXML `c:errDir`.
|
|
925
|
+
*/
|
|
926
|
+
errDir?: ErrorBarDirection;
|
|
927
|
+
/**
|
|
928
|
+
* Whether the bar extends above (`"plus"`), below (`"minus"`) or
|
|
929
|
+
* both (`"both"`) the data point. The field is named `barDir` for
|
|
930
|
+
* historical reasons; the matching OOXML element is `c:errBarType`
|
|
931
|
+
* (see `ST_ErrBarType`). It is NOT the same kind of value as the
|
|
932
|
+
* chart-level {@link BarChartGroup.barDir} (`"col"` / `"bar"`).
|
|
933
|
+
*/
|
|
934
|
+
barDir: ErrorBarType;
|
|
935
|
+
/**
|
|
936
|
+
* How `val` / `plus` / `minus` are interpreted — fixed value,
|
|
937
|
+
* percentage, standard deviation, standard error or custom range.
|
|
938
|
+
*/
|
|
939
|
+
errValType: ErrorBarValueType;
|
|
940
|
+
/** Suppress the end-cap (`<c:noEndCap val="1"/>`). */
|
|
941
|
+
noEndCap?: boolean;
|
|
942
|
+
/**
|
|
943
|
+
* Error magnitude for `fixedVal` / `percentage` / `stdDev`. For
|
|
944
|
+
* `"stdErr"` this is ignored (Excel computes it from the series);
|
|
945
|
+
* for `"cust"` {@link plus} and {@link minus} are required instead.
|
|
946
|
+
*/
|
|
947
|
+
val?: number;
|
|
948
|
+
/** Positive-direction reference (used with `errValType === "cust"`). */
|
|
949
|
+
plus?: NumberDataSource;
|
|
950
|
+
/** Negative-direction reference (used with `errValType === "cust"`). */
|
|
951
|
+
minus?: NumberDataSource;
|
|
952
|
+
/** Error-bar shape properties (colour, line width, end-cap style). */
|
|
953
|
+
spPr?: ShapeProperties;
|
|
954
|
+
/** Extension list (raw XML for round-trip) */
|
|
955
|
+
extLst?: string;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Base properties shared by all series types.
|
|
959
|
+
*/
|
|
960
|
+
export interface SeriesBase {
|
|
961
|
+
/** Series index (0-based order) */
|
|
962
|
+
index: number;
|
|
963
|
+
/** Series plot order */
|
|
964
|
+
order: number;
|
|
965
|
+
/** Series name */
|
|
966
|
+
tx?: {
|
|
967
|
+
strRef?: StringReference;
|
|
968
|
+
value?: string;
|
|
969
|
+
};
|
|
970
|
+
/** Shape properties */
|
|
971
|
+
spPr?: ShapeProperties;
|
|
972
|
+
/** Extension list (raw XML for round-trip) */
|
|
973
|
+
extLst?: string;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Bar/column chart series.
|
|
977
|
+
*/
|
|
978
|
+
export interface BarSeries extends SeriesBase {
|
|
979
|
+
invertIfNegative?: boolean;
|
|
980
|
+
pictureOptions?: PictureOptions;
|
|
981
|
+
dataPoints?: DataPoint[];
|
|
982
|
+
dataLabels?: DataLabels;
|
|
983
|
+
trendlines?: Trendline[];
|
|
984
|
+
errorBars?: ErrorBars;
|
|
985
|
+
cat?: AxisDataSource;
|
|
986
|
+
val?: NumberDataSource;
|
|
987
|
+
shape?: BarShape;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Line chart series.
|
|
991
|
+
*/
|
|
992
|
+
export interface LineSeries extends SeriesBase {
|
|
993
|
+
marker?: ChartMarker;
|
|
994
|
+
dataPoints?: DataPoint[];
|
|
995
|
+
dataLabels?: DataLabels;
|
|
996
|
+
trendlines?: Trendline[];
|
|
997
|
+
errorBars?: ErrorBars;
|
|
998
|
+
cat?: AxisDataSource;
|
|
999
|
+
val?: NumberDataSource;
|
|
1000
|
+
smooth?: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Pie/doughnut chart series.
|
|
1004
|
+
*/
|
|
1005
|
+
export interface PieSeries extends SeriesBase {
|
|
1006
|
+
explosion?: number;
|
|
1007
|
+
dataPoints?: DataPoint[];
|
|
1008
|
+
dataLabels?: DataLabels;
|
|
1009
|
+
cat?: AxisDataSource;
|
|
1010
|
+
val?: NumberDataSource;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Area chart series.
|
|
1014
|
+
*/
|
|
1015
|
+
export interface AreaSeries extends SeriesBase {
|
|
1016
|
+
dataPoints?: DataPoint[];
|
|
1017
|
+
dataLabels?: DataLabels;
|
|
1018
|
+
trendlines?: Trendline[];
|
|
1019
|
+
errorBars?: ErrorBars;
|
|
1020
|
+
cat?: AxisDataSource;
|
|
1021
|
+
val?: NumberDataSource;
|
|
1022
|
+
/**
|
|
1023
|
+
* Picture fill options — `CT_AreaSer/c:pictureOptions`. Controls
|
|
1024
|
+
* how a texture / blip fill applies across the area
|
|
1025
|
+
* (`pictureFormat`: `stretch` | `stack` | `stackScale`, etc.).
|
|
1026
|
+
* Parsed from source XML by `_processSeries`; round-tripped to
|
|
1027
|
+
* preserve texture-filled areas.
|
|
1028
|
+
*/
|
|
1029
|
+
pictureOptions?: PictureOptions;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Scatter chart series.
|
|
1033
|
+
*/
|
|
1034
|
+
export interface ScatterSeries extends SeriesBase {
|
|
1035
|
+
marker?: ChartMarker;
|
|
1036
|
+
dataPoints?: DataPoint[];
|
|
1037
|
+
dataLabels?: DataLabels;
|
|
1038
|
+
trendlines?: Trendline[];
|
|
1039
|
+
errorBars?: ErrorBars[];
|
|
1040
|
+
xVal?: AxisDataSource;
|
|
1041
|
+
yVal?: NumberDataSource;
|
|
1042
|
+
smooth?: boolean;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Bubble chart series.
|
|
1046
|
+
*/
|
|
1047
|
+
export interface BubbleSeries extends SeriesBase {
|
|
1048
|
+
invertIfNegative?: boolean;
|
|
1049
|
+
dataPoints?: DataPoint[];
|
|
1050
|
+
dataLabels?: DataLabels;
|
|
1051
|
+
trendlines?: Trendline[];
|
|
1052
|
+
errorBars?: ErrorBars[];
|
|
1053
|
+
xVal?: AxisDataSource;
|
|
1054
|
+
yVal?: NumberDataSource;
|
|
1055
|
+
bubbleSize?: NumberDataSource;
|
|
1056
|
+
bubble3D?: boolean;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Radar chart series.
|
|
1060
|
+
*/
|
|
1061
|
+
export interface RadarSeries extends SeriesBase {
|
|
1062
|
+
marker?: ChartMarker;
|
|
1063
|
+
dataPoints?: DataPoint[];
|
|
1064
|
+
dataLabels?: DataLabels;
|
|
1065
|
+
cat?: AxisDataSource;
|
|
1066
|
+
val?: NumberDataSource;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Surface chart series.
|
|
1070
|
+
*/
|
|
1071
|
+
export interface SurfaceSeries extends SeriesBase {
|
|
1072
|
+
cat?: AxisDataSource;
|
|
1073
|
+
val?: NumberDataSource;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Stock chart series - same as line series (HLC or OHLC).
|
|
1077
|
+
*/
|
|
1078
|
+
export type StockSeries = LineSeries;
|
|
1079
|
+
/**
|
|
1080
|
+
* Individual data point override.
|
|
1081
|
+
*/
|
|
1082
|
+
export interface DataPoint {
|
|
1083
|
+
index: number;
|
|
1084
|
+
invertIfNegative?: boolean;
|
|
1085
|
+
marker?: ChartMarker;
|
|
1086
|
+
bubble3D?: boolean;
|
|
1087
|
+
explosion?: number;
|
|
1088
|
+
spPr?: ShapeProperties;
|
|
1089
|
+
pictureOptions?: PictureOptions;
|
|
1090
|
+
/** Extension list (raw XML for round-trip) */
|
|
1091
|
+
extLst?: string;
|
|
1092
|
+
}
|
|
1093
|
+
export interface PictureOptions {
|
|
1094
|
+
applyToFront?: boolean;
|
|
1095
|
+
applyToSides?: boolean;
|
|
1096
|
+
applyToEnd?: boolean;
|
|
1097
|
+
pictureFormat?: PictureFormat;
|
|
1098
|
+
pictureStackUnit?: number;
|
|
1099
|
+
}
|
|
1100
|
+
export interface BarChartGroup {
|
|
1101
|
+
type: "bar" | "bar3D";
|
|
1102
|
+
barDir: BarDirection;
|
|
1103
|
+
grouping: BarGrouping;
|
|
1104
|
+
varyColors?: boolean;
|
|
1105
|
+
series: BarSeries[];
|
|
1106
|
+
dataLabels?: DataLabels;
|
|
1107
|
+
gapWidth?: number;
|
|
1108
|
+
/**
|
|
1109
|
+
* Depth-direction gap for 3D bar charts (`c:gapDepth`). Expressed as
|
|
1110
|
+
* a percentage (0-500) — 150 is Excel's default. Ignored for 2D
|
|
1111
|
+
* bar charts.
|
|
1112
|
+
*/
|
|
1113
|
+
gapDepth?: number;
|
|
1114
|
+
overlap?: number;
|
|
1115
|
+
serLines?: ShapeProperties;
|
|
1116
|
+
axisIds: number[];
|
|
1117
|
+
/** 3D bar shape */
|
|
1118
|
+
shape?: BarShape;
|
|
1119
|
+
/** Extension list (raw XML for round-trip) */
|
|
1120
|
+
extLst?: string;
|
|
1121
|
+
}
|
|
1122
|
+
export interface LineChartGroup {
|
|
1123
|
+
type: "line" | "line3D";
|
|
1124
|
+
grouping: LineGrouping;
|
|
1125
|
+
varyColors?: boolean;
|
|
1126
|
+
series: LineSeries[];
|
|
1127
|
+
dataLabels?: DataLabels;
|
|
1128
|
+
marker?: boolean;
|
|
1129
|
+
smooth?: boolean;
|
|
1130
|
+
hiLowLines?: ShapeProperties;
|
|
1131
|
+
upDownBars?: UpDownBars;
|
|
1132
|
+
dropLines?: ShapeProperties;
|
|
1133
|
+
axisIds: number[];
|
|
1134
|
+
/** Depth-direction gap for 3D line charts (`c:gapDepth`, 0-500). */
|
|
1135
|
+
gapDepth?: number;
|
|
1136
|
+
extLst?: string;
|
|
1137
|
+
}
|
|
1138
|
+
export interface PieChartGroup {
|
|
1139
|
+
type: "pie" | "pie3D";
|
|
1140
|
+
varyColors?: boolean;
|
|
1141
|
+
series: PieSeries[];
|
|
1142
|
+
dataLabels?: DataLabels;
|
|
1143
|
+
firstSliceAng?: number;
|
|
1144
|
+
axisIds?: number[];
|
|
1145
|
+
extLst?: string;
|
|
1146
|
+
}
|
|
1147
|
+
export interface DoughnutChartGroup {
|
|
1148
|
+
type: "doughnut";
|
|
1149
|
+
varyColors?: boolean;
|
|
1150
|
+
series: PieSeries[];
|
|
1151
|
+
dataLabels?: DataLabels;
|
|
1152
|
+
firstSliceAng?: number;
|
|
1153
|
+
holeSize?: number;
|
|
1154
|
+
axisIds?: number[];
|
|
1155
|
+
extLst?: string;
|
|
1156
|
+
}
|
|
1157
|
+
export interface AreaChartGroup {
|
|
1158
|
+
type: "area" | "area3D";
|
|
1159
|
+
grouping: LineGrouping;
|
|
1160
|
+
varyColors?: boolean;
|
|
1161
|
+
series: AreaSeries[];
|
|
1162
|
+
dataLabels?: DataLabels;
|
|
1163
|
+
dropLines?: ShapeProperties;
|
|
1164
|
+
axisIds: number[];
|
|
1165
|
+
/** Depth-direction gap for 3D area charts (`c:gapDepth`, 0-500). */
|
|
1166
|
+
gapDepth?: number;
|
|
1167
|
+
extLst?: string;
|
|
1168
|
+
}
|
|
1169
|
+
export interface ScatterChartGroup {
|
|
1170
|
+
type: "scatter";
|
|
1171
|
+
scatterStyle: ScatterStyle;
|
|
1172
|
+
varyColors?: boolean;
|
|
1173
|
+
series: ScatterSeries[];
|
|
1174
|
+
dataLabels?: DataLabels;
|
|
1175
|
+
axisIds: number[];
|
|
1176
|
+
extLst?: string;
|
|
1177
|
+
}
|
|
1178
|
+
export interface BubbleChartGroup {
|
|
1179
|
+
type: "bubble";
|
|
1180
|
+
varyColors?: boolean;
|
|
1181
|
+
series: BubbleSeries[];
|
|
1182
|
+
dataLabels?: DataLabels;
|
|
1183
|
+
bubbleScale?: number;
|
|
1184
|
+
showNegBubbles?: boolean;
|
|
1185
|
+
sizeRepresents?: "area" | "w";
|
|
1186
|
+
axisIds: number[];
|
|
1187
|
+
extLst?: string;
|
|
1188
|
+
}
|
|
1189
|
+
export interface RadarChartGroup {
|
|
1190
|
+
type: "radar";
|
|
1191
|
+
radarStyle: RadarStyle;
|
|
1192
|
+
varyColors?: boolean;
|
|
1193
|
+
series: RadarSeries[];
|
|
1194
|
+
dataLabels?: DataLabels;
|
|
1195
|
+
axisIds: number[];
|
|
1196
|
+
extLst?: string;
|
|
1197
|
+
}
|
|
1198
|
+
export interface StockChartGroup {
|
|
1199
|
+
type: "stock";
|
|
1200
|
+
series: StockSeries[];
|
|
1201
|
+
dataLabels?: DataLabels;
|
|
1202
|
+
/**
|
|
1203
|
+
* Per ECMA-376 `CT_StockChart` sequence: `dropLines` appears **before**
|
|
1204
|
+
* `hiLowLines`. The previous model had no notion of ordering
|
|
1205
|
+
* because it used object field declaration order — the writer took
|
|
1206
|
+
* advantage of that to emit the correct sequence, so only the
|
|
1207
|
+
* serialiser cares. Keep the TypeScript declaration order matching
|
|
1208
|
+
* the schema for clarity.
|
|
1209
|
+
*/
|
|
1210
|
+
dropLines?: ShapeProperties;
|
|
1211
|
+
hiLowLines?: ShapeProperties;
|
|
1212
|
+
upDownBars?: UpDownBars;
|
|
1213
|
+
axisIds: number[];
|
|
1214
|
+
extLst?: string;
|
|
1215
|
+
}
|
|
1216
|
+
export interface SurfaceChartGroup {
|
|
1217
|
+
type: "surface" | "surface3D";
|
|
1218
|
+
wireframe?: boolean;
|
|
1219
|
+
series: SurfaceSeries[];
|
|
1220
|
+
bandFormats?: BandFormat[];
|
|
1221
|
+
axisIds: number[];
|
|
1222
|
+
extLst?: string;
|
|
1223
|
+
}
|
|
1224
|
+
export interface OfPieChartGroup {
|
|
1225
|
+
type: "ofPie";
|
|
1226
|
+
ofPieType: OfPieType;
|
|
1227
|
+
varyColors?: boolean;
|
|
1228
|
+
series: PieSeries[];
|
|
1229
|
+
dataLabels?: DataLabels;
|
|
1230
|
+
gapWidth?: number;
|
|
1231
|
+
splitType?: SplitType;
|
|
1232
|
+
splitPos?: number;
|
|
1233
|
+
custSplit?: number[];
|
|
1234
|
+
secondPieSize?: number;
|
|
1235
|
+
serLines?: ShapeProperties;
|
|
1236
|
+
axisIds?: number[];
|
|
1237
|
+
extLst?: string;
|
|
1238
|
+
}
|
|
1239
|
+
export type ChartTypeGroup = BarChartGroup | LineChartGroup | PieChartGroup | DoughnutChartGroup | AreaChartGroup | ScatterChartGroup | BubbleChartGroup | RadarChartGroup | StockChartGroup | SurfaceChartGroup | OfPieChartGroup;
|
|
1240
|
+
export interface UpDownBars {
|
|
1241
|
+
gapWidth?: number;
|
|
1242
|
+
upBars?: ShapeProperties;
|
|
1243
|
+
downBars?: ShapeProperties;
|
|
1244
|
+
/** Extension list (raw XML for round-trip). */
|
|
1245
|
+
extLst?: string;
|
|
1246
|
+
}
|
|
1247
|
+
export interface BandFormat {
|
|
1248
|
+
index: number;
|
|
1249
|
+
spPr?: ShapeProperties;
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Base axis properties shared by all axis types.
|
|
1253
|
+
*/
|
|
1254
|
+
export interface AxisBase {
|
|
1255
|
+
/** Unique axis ID */
|
|
1256
|
+
axId: number;
|
|
1257
|
+
/** Scaling */
|
|
1258
|
+
scaling?: {
|
|
1259
|
+
orientation?: AxisOrientation;
|
|
1260
|
+
max?: number;
|
|
1261
|
+
min?: number;
|
|
1262
|
+
logBase?: number;
|
|
1263
|
+
};
|
|
1264
|
+
/** Delete the axis (hide it) */
|
|
1265
|
+
delete?: boolean;
|
|
1266
|
+
/** Axis position */
|
|
1267
|
+
axPos: AxisPosition;
|
|
1268
|
+
/** Major gridlines */
|
|
1269
|
+
majorGridlines?: ShapeProperties;
|
|
1270
|
+
/** Minor gridlines */
|
|
1271
|
+
minorGridlines?: ShapeProperties;
|
|
1272
|
+
/** Axis title */
|
|
1273
|
+
title?: ChartTitle;
|
|
1274
|
+
/** Number format */
|
|
1275
|
+
numFmt?: {
|
|
1276
|
+
formatCode: string;
|
|
1277
|
+
sourceLinked?: boolean;
|
|
1278
|
+
};
|
|
1279
|
+
/** Major tick mark type */
|
|
1280
|
+
majorTickMark?: TickMark;
|
|
1281
|
+
/** Minor tick mark type */
|
|
1282
|
+
minorTickMark?: TickMark;
|
|
1283
|
+
/** Tick label position */
|
|
1284
|
+
tickLblPos?: TickLabelPosition;
|
|
1285
|
+
/** Shape properties for the axis line */
|
|
1286
|
+
spPr?: ShapeProperties;
|
|
1287
|
+
/** Text properties for tick labels */
|
|
1288
|
+
txPr?: ChartTextProperties;
|
|
1289
|
+
/** Cross axis ID (the axis this one crosses) */
|
|
1290
|
+
crossAx: number;
|
|
1291
|
+
/** Where this axis crosses the other */
|
|
1292
|
+
crosses?: AxisCrosses;
|
|
1293
|
+
/** Explicit cross value */
|
|
1294
|
+
crossesAt?: number;
|
|
1295
|
+
/** Extension list (raw XML for round-trip) */
|
|
1296
|
+
extLst?: string;
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Category axis (c:catAx).
|
|
1300
|
+
*/
|
|
1301
|
+
export interface CategoryAxis extends AxisBase {
|
|
1302
|
+
axisType: "cat";
|
|
1303
|
+
/** Auto label ordering */
|
|
1304
|
+
auto?: boolean;
|
|
1305
|
+
/** Label alignment */
|
|
1306
|
+
lblAlgn?: LabelAlignment;
|
|
1307
|
+
/** Label offset (percentage, 0-1000) */
|
|
1308
|
+
lblOffset?: number;
|
|
1309
|
+
/** Tick label skip */
|
|
1310
|
+
tickLblSkip?: number;
|
|
1311
|
+
/** Tick mark skip */
|
|
1312
|
+
tickMarkSkip?: number;
|
|
1313
|
+
/** No multi-level labels */
|
|
1314
|
+
noMultiLvlLbl?: boolean;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Value axis (c:valAx).
|
|
1318
|
+
*/
|
|
1319
|
+
export interface ValueAxis extends AxisBase {
|
|
1320
|
+
axisType: "val";
|
|
1321
|
+
/** Cross between categories or midpoints */
|
|
1322
|
+
crossBetween?: "between" | "midCat";
|
|
1323
|
+
/** Major unit */
|
|
1324
|
+
majorUnit?: number;
|
|
1325
|
+
/** Minor unit */
|
|
1326
|
+
minorUnit?: number;
|
|
1327
|
+
/** Display units (hundreds, thousands, millions, etc.) */
|
|
1328
|
+
dispUnits?: DisplayUnits;
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Date axis (c:dateAx).
|
|
1332
|
+
*/
|
|
1333
|
+
export interface DateAxis extends AxisBase {
|
|
1334
|
+
axisType: "date";
|
|
1335
|
+
/** Auto date detection */
|
|
1336
|
+
auto?: boolean;
|
|
1337
|
+
/** Label offset */
|
|
1338
|
+
lblOffset?: number;
|
|
1339
|
+
/** Base time unit */
|
|
1340
|
+
baseTimeUnit?: TimeUnit;
|
|
1341
|
+
/** Major unit */
|
|
1342
|
+
majorUnit?: number;
|
|
1343
|
+
/** Major time unit */
|
|
1344
|
+
majorTimeUnit?: TimeUnit;
|
|
1345
|
+
/** Minor unit */
|
|
1346
|
+
minorUnit?: number;
|
|
1347
|
+
/** Minor time unit */
|
|
1348
|
+
minorTimeUnit?: TimeUnit;
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Series axis (c:serAx) — used in 3D charts.
|
|
1352
|
+
*/
|
|
1353
|
+
export interface SeriesAxis extends AxisBase {
|
|
1354
|
+
axisType: "ser";
|
|
1355
|
+
/** Tick label skip */
|
|
1356
|
+
tickLblSkip?: number;
|
|
1357
|
+
/** Tick mark skip */
|
|
1358
|
+
tickMarkSkip?: number;
|
|
1359
|
+
}
|
|
1360
|
+
export type ChartAxis = CategoryAxis | ValueAxis | DateAxis | SeriesAxis;
|
|
1361
|
+
export interface DisplayUnits {
|
|
1362
|
+
builtInUnit?: "hundreds" | "thousands" | "tenThousands" | "hundredThousands" | "millions" | "tenMillions" | "hundredMillions" | "billions" | "trillions";
|
|
1363
|
+
custUnit?: number;
|
|
1364
|
+
label?: ChartTitle;
|
|
1365
|
+
/** Extension list (raw XML for round-trip). */
|
|
1366
|
+
extLst?: string;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Manual layout positioning.
|
|
1370
|
+
*/
|
|
1371
|
+
export interface ChartLayout {
|
|
1372
|
+
manualLayout?: ManualLayout;
|
|
1373
|
+
}
|
|
1374
|
+
export interface ManualLayout {
|
|
1375
|
+
layoutTarget?: "inner" | "outer";
|
|
1376
|
+
xMode?: "edge" | "factor";
|
|
1377
|
+
yMode?: "edge" | "factor";
|
|
1378
|
+
wMode?: "edge" | "factor";
|
|
1379
|
+
hMode?: "edge" | "factor";
|
|
1380
|
+
x?: number;
|
|
1381
|
+
y?: number;
|
|
1382
|
+
w?: number;
|
|
1383
|
+
h?: number;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Chart title (c:title).
|
|
1387
|
+
*/
|
|
1388
|
+
export interface ChartTitle {
|
|
1389
|
+
text?: ChartRichText;
|
|
1390
|
+
/** Title from data reference */
|
|
1391
|
+
strRef?: StringReference;
|
|
1392
|
+
/** Raw c:tx XML for round-trip fidelity (used instead of text when present) */
|
|
1393
|
+
rawTx?: string;
|
|
1394
|
+
layout?: ChartLayout;
|
|
1395
|
+
overlay?: boolean;
|
|
1396
|
+
spPr?: ShapeProperties;
|
|
1397
|
+
txPr?: ChartTextProperties;
|
|
1398
|
+
/** Extension list (raw XML for round-trip) */
|
|
1399
|
+
extLst?: string;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Chart legend (c:legend).
|
|
1403
|
+
*/
|
|
1404
|
+
export interface ChartLegend {
|
|
1405
|
+
legendPos?: LegendPosition;
|
|
1406
|
+
/**
|
|
1407
|
+
* Horizontal / vertical alignment within the position slot. Chart2014
|
|
1408
|
+
* `CT_Legend/@align` admits `"ctr"` (centred — the default Excel
|
|
1409
|
+
* always emits), `"l"` / `"r"` (left / right within horizontal
|
|
1410
|
+
* positions), or `"t"` / `"b"` (top / bottom within vertical
|
|
1411
|
+
* positions). Absent means inherit the default (`"ctr"`).
|
|
1412
|
+
*/
|
|
1413
|
+
align?: "ctr" | "l" | "r" | "t" | "b";
|
|
1414
|
+
legendEntries?: LegendEntry[];
|
|
1415
|
+
layout?: ChartLayout;
|
|
1416
|
+
overlay?: boolean;
|
|
1417
|
+
spPr?: ShapeProperties;
|
|
1418
|
+
txPr?: ChartTextProperties;
|
|
1419
|
+
/** Extension list (raw XML for round-trip) */
|
|
1420
|
+
extLst?: string;
|
|
1421
|
+
}
|
|
1422
|
+
export interface LegendEntry {
|
|
1423
|
+
index: number;
|
|
1424
|
+
delete?: boolean;
|
|
1425
|
+
txPr?: ChartTextProperties;
|
|
1426
|
+
/** Extension list (raw XML for round-trip) */
|
|
1427
|
+
extLst?: string;
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* 3D view settings (c:view3D).
|
|
1431
|
+
*/
|
|
1432
|
+
export interface View3D {
|
|
1433
|
+
rotX?: number;
|
|
1434
|
+
rotY?: number;
|
|
1435
|
+
depthPercent?: number;
|
|
1436
|
+
rAngAx?: boolean;
|
|
1437
|
+
hPercent?: number;
|
|
1438
|
+
perspective?: number;
|
|
1439
|
+
/** Extension list (raw XML for round-trip). */
|
|
1440
|
+
extLst?: string;
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Plot area (c:plotArea).
|
|
1444
|
+
*/
|
|
1445
|
+
export interface PlotArea {
|
|
1446
|
+
layout?: ChartLayout;
|
|
1447
|
+
/** One or more chart type groups (combo charts have multiple) */
|
|
1448
|
+
chartTypes: ChartTypeGroup[];
|
|
1449
|
+
/** Axes */
|
|
1450
|
+
axes: ChartAxis[];
|
|
1451
|
+
/** Data table */
|
|
1452
|
+
dataTable?: DataTable;
|
|
1453
|
+
/** Shape properties for the plot area background */
|
|
1454
|
+
spPr?: ShapeProperties;
|
|
1455
|
+
/** Extension list (raw XML for round-trip) */
|
|
1456
|
+
extLst?: string;
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Data table display options (c:dTable).
|
|
1460
|
+
*/
|
|
1461
|
+
export interface DataTable {
|
|
1462
|
+
showHorzBorder?: boolean;
|
|
1463
|
+
showVertBorder?: boolean;
|
|
1464
|
+
showOutline?: boolean;
|
|
1465
|
+
showKeys?: boolean;
|
|
1466
|
+
spPr?: ShapeProperties;
|
|
1467
|
+
txPr?: ChartTextProperties;
|
|
1468
|
+
/** Extension list (raw XML for round-trip) */
|
|
1469
|
+
extLst?: string;
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* The main chart element (c:chart).
|
|
1473
|
+
*/
|
|
1474
|
+
export interface ChartData {
|
|
1475
|
+
title?: ChartTitle;
|
|
1476
|
+
autoTitleDeleted?: boolean;
|
|
1477
|
+
pivotFormats?: PivotFormat[];
|
|
1478
|
+
view3D?: View3D;
|
|
1479
|
+
floor?: ShapeProperties;
|
|
1480
|
+
sideWall?: ShapeProperties;
|
|
1481
|
+
backWall?: ShapeProperties;
|
|
1482
|
+
plotArea: PlotArea;
|
|
1483
|
+
legend?: ChartLegend;
|
|
1484
|
+
plotVisOnly?: boolean;
|
|
1485
|
+
dispBlanksAs?: DisplayBlanksAs;
|
|
1486
|
+
showDLblsOverMax?: boolean;
|
|
1487
|
+
/** Extension list at c:chart level (raw XML for round-trip) */
|
|
1488
|
+
extLst?: string;
|
|
1489
|
+
}
|
|
1490
|
+
export interface PivotFormat {
|
|
1491
|
+
index: number;
|
|
1492
|
+
spPr?: ShapeProperties;
|
|
1493
|
+
txPr?: ChartTextProperties;
|
|
1494
|
+
marker?: ChartMarker;
|
|
1495
|
+
dataLabels?: DataLabels;
|
|
1496
|
+
/**
|
|
1497
|
+
* Structured representation of the single `c:dLbl` that pivot-chart
|
|
1498
|
+
* samples from Excel emit directly inside `c:pivotFmt` (without the
|
|
1499
|
+
* enclosing `c:dLbls` wrapper). Most callers will leave this
|
|
1500
|
+
* undefined — the field exists so editors can mutate pivot-series
|
|
1501
|
+
* label styling without dropping into raw XML.
|
|
1502
|
+
*/
|
|
1503
|
+
dLbl?: DataLabelEntry;
|
|
1504
|
+
/**
|
|
1505
|
+
* @deprecated Use {@link dLbl} for structured access. Retained so
|
|
1506
|
+
* files parsed before the structured slot landed continue to
|
|
1507
|
+
* round-trip. Writers prefer `dLbl` when both are present.
|
|
1508
|
+
*/
|
|
1509
|
+
rawDLbl?: string;
|
|
1510
|
+
/** Extension list (raw XML for round-trip). */
|
|
1511
|
+
extLst?: string;
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* Structured metadata for a pivot chart, corresponding to MS Office 2010+
|
|
1515
|
+
* `c14:pivotOptions` extension (ECMA-376 MS-XLSX §2.3.11, namespace
|
|
1516
|
+
* `http://schemas.microsoft.com/office/drawing/2007/8/2/chart`).
|
|
1517
|
+
*
|
|
1518
|
+
* Written as `c:chartSpace/c:extLst/c:ext/c14:pivotOptions`, so Excel
|
|
1519
|
+
* recognises the metadata on load; prior versions of excelts wrote this
|
|
1520
|
+
* data under a private `excelts:` namespace that Excel silently discarded.
|
|
1521
|
+
*
|
|
1522
|
+
* All `dropZone*` fields are boolean flags controlling whether the
|
|
1523
|
+
* corresponding family of PivotTable fields gets drop-zone controls on
|
|
1524
|
+
* the chart when {@link dropZonesVisible} is enabled. Granularity is
|
|
1525
|
+
* per-axis-category, not per-field — this matches the OOXML schema. The
|
|
1526
|
+
* earlier `fieldButtons[]` / `filters[]` array shape never matched any
|
|
1527
|
+
* part of the OOXML grammar and has been removed in this release.
|
|
1528
|
+
*/
|
|
1529
|
+
export interface PivotChartOptions {
|
|
1530
|
+
/**
|
|
1531
|
+
* Whether any drop-zone controls can appear on the pivot chart. When
|
|
1532
|
+
* `false`, none of the other `dropZone*` flags have any visual effect.
|
|
1533
|
+
* Absent (`undefined`) means Excel uses its default (typically `true`).
|
|
1534
|
+
*/
|
|
1535
|
+
dropZonesVisible?: boolean;
|
|
1536
|
+
/**
|
|
1537
|
+
* Whether a control for each PivotTable field on the Filter (page) axis
|
|
1538
|
+
* of the source PivotTable appears on the chart when
|
|
1539
|
+
* {@link dropZonesVisible} is `true`.
|
|
1540
|
+
*/
|
|
1541
|
+
dropZoneFilter?: boolean;
|
|
1542
|
+
/**
|
|
1543
|
+
* Whether a control for each PivotTable field on the Row axis of the
|
|
1544
|
+
* source PivotTable appears on the chart when {@link dropZonesVisible}
|
|
1545
|
+
* is `true`.
|
|
1546
|
+
*/
|
|
1547
|
+
dropZoneCategories?: boolean;
|
|
1548
|
+
/**
|
|
1549
|
+
* Whether a control for each PivotTable field on the Data (values) axis
|
|
1550
|
+
* of the source PivotTable appears on the chart when
|
|
1551
|
+
* {@link dropZonesVisible} is `true`.
|
|
1552
|
+
*/
|
|
1553
|
+
dropZoneData?: boolean;
|
|
1554
|
+
/**
|
|
1555
|
+
* Whether a control for each PivotTable field on the Column axis of the
|
|
1556
|
+
* source PivotTable appears on the chart when {@link dropZonesVisible}
|
|
1557
|
+
* is `true`.
|
|
1558
|
+
*/
|
|
1559
|
+
dropZoneSeries?: boolean;
|
|
1560
|
+
/**
|
|
1561
|
+
* Whether Excel should refresh the linked pivot cache when opening the
|
|
1562
|
+
* workbook. Mapped onto `pivotCacheDefinition/@refreshOnLoad` in the
|
|
1563
|
+
* sheet parts, not into `c14:pivotOptions`.
|
|
1564
|
+
*/
|
|
1565
|
+
refreshOnOpen?: boolean;
|
|
1566
|
+
/**
|
|
1567
|
+
* Whether the pivot chart shows the expand/collapse field buttons
|
|
1568
|
+
* introduced in Office 2014+. Serialised as the
|
|
1569
|
+
* `c16:showExpandCollapseFieldButtons` child inside the
|
|
1570
|
+
* `c:chartSpace/c:extLst/c:ext[uri={E28EC0CA-…}]/c16:pivotOptions16`
|
|
1571
|
+
* extension — a separate extension from the 2010 `c14:pivotOptions`.
|
|
1572
|
+
*
|
|
1573
|
+
* Both extensions can coexist on the same chart: the c14 block
|
|
1574
|
+
* controls the drop-zone visibility, the c16 block controls the
|
|
1575
|
+
* expand/collapse affordances on field buttons.
|
|
1576
|
+
*/
|
|
1577
|
+
showExpandCollapseFieldButtons?: boolean;
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* The top-level chart container (c:chartSpace).
|
|
1581
|
+
* This is the root element of a chart XML file.
|
|
1582
|
+
*/
|
|
1583
|
+
export interface ChartModel {
|
|
1584
|
+
/** Chart data */
|
|
1585
|
+
chart: ChartData;
|
|
1586
|
+
/** Chart style (numeric style index) — legacy c:style */
|
|
1587
|
+
style?: number;
|
|
1588
|
+
/** Modern chart style via mc:AlternateContent/c14:style (raw XML for round-trip) */
|
|
1589
|
+
alternateContentStyle?: string;
|
|
1590
|
+
/** Chart-level shape properties */
|
|
1591
|
+
spPr?: ShapeProperties;
|
|
1592
|
+
/** Chart-level text properties */
|
|
1593
|
+
txPr?: ChartTextProperties;
|
|
1594
|
+
/** Print settings */
|
|
1595
|
+
printSettings?: PrintSettings;
|
|
1596
|
+
/** External data reference */
|
|
1597
|
+
externalData?: {
|
|
1598
|
+
id: string;
|
|
1599
|
+
autoUpdate?: boolean;
|
|
1600
|
+
};
|
|
1601
|
+
/** Rounding on file load (preserve round-trip) */
|
|
1602
|
+
roundedCorners?: boolean;
|
|
1603
|
+
/** Language */
|
|
1604
|
+
lang?: string;
|
|
1605
|
+
/** Whether the chart uses the 1904 date system */
|
|
1606
|
+
date1904?: boolean;
|
|
1607
|
+
/**
|
|
1608
|
+
* `c:userShapes` — user-drawn annotation shapes overlaid on the chart.
|
|
1609
|
+
*
|
|
1610
|
+
* OOXML models these as a reference to a separate drawing part
|
|
1611
|
+
* (`drawings/drawingN.xml`). Full structural support would require
|
|
1612
|
+
* reproducing the entire DrawingML shape subsystem inside the chart
|
|
1613
|
+
* pipeline; for now we keep the `r:id` so the reference survives
|
|
1614
|
+
* round-trip, and the referenced part is preserved alongside the
|
|
1615
|
+
* chart rels.
|
|
1616
|
+
*
|
|
1617
|
+
* The target drawing part itself is carried through untouched via
|
|
1618
|
+
* the standard chart rels mechanism — this field only captures the
|
|
1619
|
+
* relationship id so we know it's there.
|
|
1620
|
+
*/
|
|
1621
|
+
userShapesRelId?: string;
|
|
1622
|
+
/** Pivot source information (raw XML for round-trip) */
|
|
1623
|
+
pivotSource?: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* Structured pivot chart options corresponding to the MS Office 2010+
|
|
1626
|
+
* `c14:pivotOptions` extension. Parsed from and serialised into
|
|
1627
|
+
* `c:chartSpace/c:extLst/c:ext[uri=…chart]/c14:pivotOptions` — the only
|
|
1628
|
+
* location Excel recognises for these settings.
|
|
1629
|
+
*
|
|
1630
|
+
* Exists only on pivot charts (i.e. when {@link pivotSource} is set);
|
|
1631
|
+
* writers emit nothing when `pivotSource` is absent.
|
|
1632
|
+
*/
|
|
1633
|
+
pivotOptions?: PivotChartOptions;
|
|
1634
|
+
/** Color map override (raw XML for round-trip) */
|
|
1635
|
+
clrMapOvr?: string;
|
|
1636
|
+
/** Chart protection settings (raw XML for round-trip) */
|
|
1637
|
+
protection?: string;
|
|
1638
|
+
/** Extension list at c:chartSpace level (raw XML for round-trip) */
|
|
1639
|
+
extLst?: string;
|
|
1640
|
+
/** Extra namespace declarations for round-trip fidelity */
|
|
1641
|
+
extraNamespaces?: Record<string, string>;
|
|
1642
|
+
/**
|
|
1643
|
+
* Vendor-extension elements observed while parsing that are not part of
|
|
1644
|
+
* the `c:` / `a:` / `r:` OOXML namespaces and are not already captured
|
|
1645
|
+
* via `extLst` / raw XML targets. Mirrors
|
|
1646
|
+
* {@link ChartExModel.unknownElements} so `strictTemplateMode` can warn
|
|
1647
|
+
* when a structural rebuild would drop them. Purely informational in
|
|
1648
|
+
* the default `preserve` mode.
|
|
1649
|
+
*/
|
|
1650
|
+
unknownElements?: ChartUnknownElement[];
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* Describes one unstructured child element discovered while parsing a
|
|
1654
|
+
* classic chart part. `path` uses `/` as the separator relative to the
|
|
1655
|
+
* nearest `c:` ancestor that was already recognised, matching the format
|
|
1656
|
+
* of {@link ChartExUnknownElement}.
|
|
1657
|
+
*/
|
|
1658
|
+
export interface ChartUnknownElement {
|
|
1659
|
+
/** Fully-qualified element name (e.g. `c15:customTag`). */
|
|
1660
|
+
name: string;
|
|
1661
|
+
/** Slash-separated breadcrumb, e.g. `c:chartSpace/c15:customTag`. */
|
|
1662
|
+
path: string;
|
|
1663
|
+
}
|
|
1664
|
+
export interface PrintSettings {
|
|
1665
|
+
/** Header/footer content (raw XML string for round-trip) */
|
|
1666
|
+
headerFooter?: string;
|
|
1667
|
+
pageMargins?: {
|
|
1668
|
+
b: number;
|
|
1669
|
+
l: number;
|
|
1670
|
+
r: number;
|
|
1671
|
+
t: number;
|
|
1672
|
+
header: number;
|
|
1673
|
+
footer: number;
|
|
1674
|
+
};
|
|
1675
|
+
pageSetup?: {
|
|
1676
|
+
orientation?: "portrait" | "landscape";
|
|
1677
|
+
paperSize?: number;
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Chart style model (stored in styleN.xml alongside the chart).
|
|
1682
|
+
*/
|
|
1683
|
+
export interface ChartStyleModel {
|
|
1684
|
+
/** Raw XML preserved for round-trip */
|
|
1685
|
+
rawXml?: string;
|
|
1686
|
+
/**
|
|
1687
|
+
* Structured per-element style definitions (Office 2013+).
|
|
1688
|
+
*
|
|
1689
|
+
* Each key is one of the ~25 well-known `cs:*` children of
|
|
1690
|
+
* `cs:chartStyle` — `categoryAxis`, `chartArea`, `dataLabel`,
|
|
1691
|
+
* `dataPoint`, `dataPointLine`, `dataPointMarker`, `gridlineMajor`,
|
|
1692
|
+
* `legend`, `plotArea`, `title`, `trendline` and so on (see
|
|
1693
|
+
* ECMA-376 Part 1 §21.2). Each definition carries structured slots
|
|
1694
|
+
* for the `cs:*Ref` indices that Excel looks up from the chart's
|
|
1695
|
+
* theme, plus verbatim raw XML for `spPr` / `defRPr` / `bodyPr` /
|
|
1696
|
+
* `fontRef` so the DrawingML sub-tree survives round-trip without
|
|
1697
|
+
* this module needing to model every DrawingML child.
|
|
1698
|
+
*
|
|
1699
|
+
* When absent, the writer falls back to `rawXml` (for round-trip
|
|
1700
|
+
* fidelity of files loaded with an unrecognised style) or to the
|
|
1701
|
+
* legacy id-only form (`<cs:chartStyle id="N"/>`).
|
|
1702
|
+
*/
|
|
1703
|
+
elements?: Record<string, ChartStyleElement>;
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Per-element entry inside `<cs:chartStyle>`. The four `*RefIdx`
|
|
1707
|
+
* fields mirror Excel's theme indices for lines (`cs:lnRef`), fills
|
|
1708
|
+
* (`cs:fillRef`), effects (`cs:effectRef`), and the meta slot that
|
|
1709
|
+
* governs font (`cs:fontRef`). Everything else is kept as raw XML so
|
|
1710
|
+
* callers can round-trip unfamiliar DrawingML without losing bytes.
|
|
1711
|
+
*/
|
|
1712
|
+
export interface ChartStyleElement {
|
|
1713
|
+
/** `cs:lnRef/@idx` — theme line index. */
|
|
1714
|
+
lnRefIdx?: number;
|
|
1715
|
+
/** `cs:fillRef/@idx` — theme fill index. */
|
|
1716
|
+
fillRefIdx?: number;
|
|
1717
|
+
/** `cs:effectRef/@idx` — theme effect index. */
|
|
1718
|
+
effectRefIdx?: number;
|
|
1719
|
+
/**
|
|
1720
|
+
* `cs:fontRef/@idx` — either `minor`, `major`, or `none` for the
|
|
1721
|
+
* theme font slot.
|
|
1722
|
+
*/
|
|
1723
|
+
fontRefIdx?: "minor" | "major" | "none";
|
|
1724
|
+
/** Verbatim `cs:fontRef` inner XML (colour reference + modifiers). */
|
|
1725
|
+
fontRefBody?: string;
|
|
1726
|
+
/** Verbatim `cs:spPr` XML (lines/fill/effects on the element). */
|
|
1727
|
+
spPrXml?: string;
|
|
1728
|
+
/** Verbatim `cs:defRPr` XML (default run properties for text). */
|
|
1729
|
+
defRPrXml?: string;
|
|
1730
|
+
/** Verbatim `cs:bodyPr` XML (text-body properties). */
|
|
1731
|
+
bodyPrXml?: string;
|
|
1732
|
+
/**
|
|
1733
|
+
* Attributes on the element itself other than the structured ones
|
|
1734
|
+
* above, preserved as a key/value map (e.g. `mods` on `chartArea`).
|
|
1735
|
+
*/
|
|
1736
|
+
attributes?: Record<string, string>;
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Chart color model (stored in colorsN.xml alongside the chart).
|
|
1740
|
+
*/
|
|
1741
|
+
export interface ChartColorsModel {
|
|
1742
|
+
/** Raw XML preserved for round-trip */
|
|
1743
|
+
rawXml?: string;
|
|
1744
|
+
/** Color style method attribute (cycle/withinLinear/acrossLinear) */
|
|
1745
|
+
method?: string;
|
|
1746
|
+
/** Color palette — each entry is either a theme reference or sRGB color */
|
|
1747
|
+
colors?: ChartColorsEntry[];
|
|
1748
|
+
/**
|
|
1749
|
+
* `cs:variation` blocks — structured per-index colour modifiers that
|
|
1750
|
+
* Excel uses to generate a gradient of related colours from the main
|
|
1751
|
+
* palette. Each variation carries a list of DrawingML modifiers
|
|
1752
|
+
* (tint / shade / satMod / lumMod / alpha …) that apply on top of
|
|
1753
|
+
* the `colors` palette at the matching index.
|
|
1754
|
+
*
|
|
1755
|
+
* Variations are emitted after the palette entries inside
|
|
1756
|
+
* `<cs:colorStyle>`. When this array is absent the writer falls back
|
|
1757
|
+
* to preserving anything present in {@link rawXml} so legacy round
|
|
1758
|
+
* trips are not disturbed.
|
|
1759
|
+
*/
|
|
1760
|
+
variations?: ChartColorVariation[];
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* A single `<cs:variation>` block — a list of colour modifiers applied
|
|
1764
|
+
* at the matching palette index. The modifier names mirror the DrawingML
|
|
1765
|
+
* schemeClr / srgbClr children and are stored as raw integer values in
|
|
1766
|
+
* the OOXML per-mille scale (0-100000).
|
|
1767
|
+
*/
|
|
1768
|
+
export interface ChartColorVariation {
|
|
1769
|
+
/** `<a:lumMod val="…"/>` — luminance modulation. */
|
|
1770
|
+
lumMod?: number;
|
|
1771
|
+
/** `<a:lumOff val="…"/>` — luminance offset. */
|
|
1772
|
+
lumOff?: number;
|
|
1773
|
+
/**
|
|
1774
|
+
* `<a:tint val="…"/>` as the **raw OOXML integer** (0..100000). ⚠
|
|
1775
|
+
* {@link ChartColor.tint} uses a 0..1 fraction; do not assign between
|
|
1776
|
+
* the two types without scaling (×100000 / ÷100000).
|
|
1777
|
+
*/
|
|
1778
|
+
tint?: number;
|
|
1779
|
+
/** `<a:shade val="…"/>`. */
|
|
1780
|
+
shade?: number;
|
|
1781
|
+
/** `<a:satMod val="…"/>`. */
|
|
1782
|
+
satMod?: number;
|
|
1783
|
+
/** `<a:alpha val="…"/>`. */
|
|
1784
|
+
alpha?: number;
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* A single color in a chart's colors.xml palette.
|
|
1788
|
+
*/
|
|
1789
|
+
export interface ChartColorsEntry {
|
|
1790
|
+
/** Theme color reference (a:schemeClr@val) */
|
|
1791
|
+
theme?: string;
|
|
1792
|
+
/** Straight sRGB hex (without #) */
|
|
1793
|
+
srgb?: string;
|
|
1794
|
+
/** Luminance modulation */
|
|
1795
|
+
lumMod?: number;
|
|
1796
|
+
/** Luminance offset */
|
|
1797
|
+
lumOff?: number;
|
|
1798
|
+
/**
|
|
1799
|
+
* Tint as the **raw OOXML integer** (0..100000). ⚠ {@link ChartColor.tint}
|
|
1800
|
+
* uses a 0..1 fraction; do not assign between the two types without
|
|
1801
|
+
* scaling (×100000 / ÷100000).
|
|
1802
|
+
*/
|
|
1803
|
+
tint?: number;
|
|
1804
|
+
/** Shade */
|
|
1805
|
+
shade?: number;
|
|
1806
|
+
/** Saturation modulation */
|
|
1807
|
+
satMod?: number;
|
|
1808
|
+
/** Alpha (0-100000) */
|
|
1809
|
+
alpha?: number;
|
|
1810
|
+
}
|
|
1811
|
+
/** Pivot source information written as c:pivotSource for classic pivot charts. */
|
|
1812
|
+
export type PivotChartSource = string | {
|
|
1813
|
+
/** Pivot table name, e.g. `PivotTable1` or `[Book.xlsx]Pivot!PivotTable1`. */
|
|
1814
|
+
name: string;
|
|
1815
|
+
/** Pivot chart format id. Defaults to 0. */
|
|
1816
|
+
fmtId?: number;
|
|
1817
|
+
/** Structured pivot chart metadata emitted as a chart-space extension. */
|
|
1818
|
+
options?: PivotChartOptions;
|
|
1819
|
+
};
|
|
1820
|
+
/**
|
|
1821
|
+
* Chart range for worksheet placement.
|
|
1822
|
+
*/
|
|
1823
|
+
export interface ChartRange {
|
|
1824
|
+
tl: AnchorModel;
|
|
1825
|
+
br: AnchorModel;
|
|
1826
|
+
editAs?: "oneCell" | "twoCell" | "absolute";
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* Simplified input for creating a chart programmatically.
|
|
1830
|
+
*
|
|
1831
|
+
* Usage:
|
|
1832
|
+
* ```ts
|
|
1833
|
+
* worksheet.addChart(
|
|
1834
|
+
* { type: "bar", series: [{ values: "Sheet1!$B$1:$B$5" }], title: "Sales" },
|
|
1835
|
+
* "A1:H15"
|
|
1836
|
+
* );
|
|
1837
|
+
* ```
|
|
1838
|
+
*/
|
|
1839
|
+
export interface AddChartOptions {
|
|
1840
|
+
/** Chart type */
|
|
1841
|
+
type: ChartType;
|
|
1842
|
+
/** Series definitions */
|
|
1843
|
+
series?: AddChartSeriesOptions[];
|
|
1844
|
+
/**
|
|
1845
|
+
* Chart title. Accepts:
|
|
1846
|
+
* - `string` — literal title text
|
|
1847
|
+
* - `{ formula: string }` — formula reference resolved at read time
|
|
1848
|
+
* - {@link ChartRichText} — structured rich text for per-run formatting
|
|
1849
|
+
* - `null` — explicitly suppress the title (Excel will NOT
|
|
1850
|
+
* auto-generate one; `autoTitleDeleted="1"` is emitted)
|
|
1851
|
+
*
|
|
1852
|
+
* Omit the option entirely to let Excel auto-title the chart per its
|
|
1853
|
+
* default behaviour.
|
|
1854
|
+
*/
|
|
1855
|
+
title?: string | {
|
|
1856
|
+
formula: string;
|
|
1857
|
+
} | ChartRichText | null;
|
|
1858
|
+
/** Show legend */
|
|
1859
|
+
showLegend?: boolean;
|
|
1860
|
+
/** Legend position */
|
|
1861
|
+
legendPosition?: LegendPosition;
|
|
1862
|
+
/** Grouping for bar/line/area */
|
|
1863
|
+
grouping?: BarGrouping | LineGrouping;
|
|
1864
|
+
/** Direction for bar charts */
|
|
1865
|
+
barDir?: BarDirection;
|
|
1866
|
+
/** Scatter style */
|
|
1867
|
+
scatterStyle?: ScatterStyle;
|
|
1868
|
+
/** Radar style */
|
|
1869
|
+
radarStyle?: RadarStyle;
|
|
1870
|
+
/** Of-pie type */
|
|
1871
|
+
ofPieType?: OfPieType;
|
|
1872
|
+
/** Vary colors by point */
|
|
1873
|
+
varyColors?: boolean;
|
|
1874
|
+
/** 3D view */
|
|
1875
|
+
view3D?: View3D;
|
|
1876
|
+
/** Display blanks as */
|
|
1877
|
+
displayBlanksAs?: DisplayBlanksAs;
|
|
1878
|
+
/** Hole size for doughnut (0-90) */
|
|
1879
|
+
holeSize?: number;
|
|
1880
|
+
/** Style index */
|
|
1881
|
+
style?: number;
|
|
1882
|
+
/** Modern chart style sidecar written to xl/charts/styleN.xml */
|
|
1883
|
+
chartStyle?: ChartStyleModel;
|
|
1884
|
+
/** Modern chart colors sidecar written to xl/charts/colorsN.xml */
|
|
1885
|
+
chartColors?: ChartColorsModel;
|
|
1886
|
+
/** Pivot table source for creating a classic pivot chart. */
|
|
1887
|
+
pivotSource?: PivotChartSource;
|
|
1888
|
+
/** Pivot chart field buttons, filters, and refresh metadata. */
|
|
1889
|
+
pivotChartOptions?: PivotChartOptions;
|
|
1890
|
+
/** Wireframe mode for surface charts */
|
|
1891
|
+
wireframe?: boolean;
|
|
1892
|
+
/** Surface band formats (per level colouring) */
|
|
1893
|
+
bandFormats?: Array<{
|
|
1894
|
+
/** 0-based band index */
|
|
1895
|
+
index: number;
|
|
1896
|
+
/** Shape properties for this band */
|
|
1897
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
1898
|
+
}>;
|
|
1899
|
+
/** Bubble scale (percent) for bubble charts */
|
|
1900
|
+
bubbleScale?: number;
|
|
1901
|
+
/** Show negative bubbles for bubble charts */
|
|
1902
|
+
showNegBubbles?: boolean;
|
|
1903
|
+
/** Size represents for bubble charts */
|
|
1904
|
+
sizeRepresents?: "area" | "w";
|
|
1905
|
+
/** Split type for ofPie charts */
|
|
1906
|
+
splitType?: SplitType;
|
|
1907
|
+
/** Split position for ofPie charts */
|
|
1908
|
+
splitPos?: number;
|
|
1909
|
+
/** Second pie size for ofPie charts (percent) */
|
|
1910
|
+
secondPieSize?: number;
|
|
1911
|
+
/** 3D bar shape */
|
|
1912
|
+
shape?: "box" | "cone" | "coneToMax" | "cylinder" | "pyramid" | "pyramidToMax";
|
|
1913
|
+
/** Category (X) axis configuration */
|
|
1914
|
+
categoryAxis?: AddAxisOptions;
|
|
1915
|
+
/** Value (Y) axis configuration */
|
|
1916
|
+
valueAxis?: AddAxisOptions;
|
|
1917
|
+
/** Data labels for the entire chart type group */
|
|
1918
|
+
dataLabels?: AddDataLabelsOptions;
|
|
1919
|
+
/** Gap width percentage (bar/column charts, default 150) */
|
|
1920
|
+
gapWidth?: number;
|
|
1921
|
+
/**
|
|
1922
|
+
* Gap depth percentage for 3-D charts (`c:gapDepth`, 0-500). Only
|
|
1923
|
+
* valid on `bar3D` / `line3D` / `area3D`; rejected on every other
|
|
1924
|
+
* type (including `pie3D`, which has no `gapDepth` child in its
|
|
1925
|
+
* `CT_Pie3DChart` definition despite the name suggesting it). Sets
|
|
1926
|
+
* the depth-direction spacing between series in the z-axis
|
|
1927
|
+
* extrusion.
|
|
1928
|
+
*/
|
|
1929
|
+
gapDepth?: number;
|
|
1930
|
+
/** Overlap percentage (bar/column charts, -100 to 100) */
|
|
1931
|
+
overlap?: number;
|
|
1932
|
+
/** Show markers on line/radar (default true for line, false for radar "filled") */
|
|
1933
|
+
showMarker?: boolean;
|
|
1934
|
+
/** Smooth lines by default for all series (line/scatter) */
|
|
1935
|
+
smooth?: boolean;
|
|
1936
|
+
/** First slice angle for pie/doughnut charts (0-360, default 0) */
|
|
1937
|
+
firstSliceAng?: number;
|
|
1938
|
+
/** Show hi-low lines for line/stock charts */
|
|
1939
|
+
hiLowLines?: boolean;
|
|
1940
|
+
/** Show up-down bars for line/stock charts */
|
|
1941
|
+
upDownBars?: boolean | {
|
|
1942
|
+
gapWidth?: number;
|
|
1943
|
+
upBars?: ShapeProperties | AddShapeFillOptions;
|
|
1944
|
+
downBars?: ShapeProperties | AddShapeFillOptions;
|
|
1945
|
+
};
|
|
1946
|
+
/** Show drop lines for line/area charts */
|
|
1947
|
+
dropLines?: boolean;
|
|
1948
|
+
/** Show series lines for bar/ofPie charts */
|
|
1949
|
+
serLines?: boolean;
|
|
1950
|
+
/** Show data table below chart */
|
|
1951
|
+
dataTable?: boolean | {
|
|
1952
|
+
showHorzBorder?: boolean;
|
|
1953
|
+
showVertBorder?: boolean;
|
|
1954
|
+
showOutline?: boolean;
|
|
1955
|
+
showKeys?: boolean;
|
|
1956
|
+
};
|
|
1957
|
+
/** Show data labels over max value */
|
|
1958
|
+
showDLblsOverMax?: boolean;
|
|
1959
|
+
/** Plot visible cells only (default true) */
|
|
1960
|
+
plotVisOnly?: boolean;
|
|
1961
|
+
/** Title layout options (position, overlay, spPr/txPr) */
|
|
1962
|
+
titleOptions?: AddTitleOptions;
|
|
1963
|
+
/** Legend options (layout, entries, spPr/txPr) */
|
|
1964
|
+
legendOptions?: AddLegendOptions;
|
|
1965
|
+
/** Plot area layout and background */
|
|
1966
|
+
plotAreaOptions?: AddPlotAreaOptions;
|
|
1967
|
+
/** 3D chart: floor background */
|
|
1968
|
+
floor?: ShapeProperties | AddShapeFillOptions;
|
|
1969
|
+
/** 3D chart: side wall background */
|
|
1970
|
+
sideWall?: ShapeProperties | AddShapeFillOptions;
|
|
1971
|
+
/** 3D chart: back wall background */
|
|
1972
|
+
backWall?: ShapeProperties | AddShapeFillOptions;
|
|
1973
|
+
}
|
|
1974
|
+
type CommonAddChartOptions = Omit<AddChartOptions, "type" | "series" | "barDir" | "grouping" | "scatterStyle" | "radarStyle" | "ofPieType" | "holeSize" | "wireframe" | "bandFormats" | "bubbleScale" | "showNegBubbles" | "sizeRepresents" | "splitType" | "splitPos" | "secondPieSize" | "shape" | "firstSliceAng" | "gapWidth" | "overlap" | "dataLabels" | "showMarker" | "smooth">;
|
|
1975
|
+
export type AddBarChartSeriesOptions = Omit<AddChartSeriesOptions, "xValues" | "bubbleSize" | "bubble3D" | "explosion">;
|
|
1976
|
+
export interface AddBarChartOptions extends CommonAddChartOptions {
|
|
1977
|
+
type?: "bar" | "bar3D";
|
|
1978
|
+
series?: AddBarChartSeriesOptions[];
|
|
1979
|
+
grouping?: BarGrouping;
|
|
1980
|
+
barDir?: BarDirection;
|
|
1981
|
+
dataLabels?: AddDataLabelsOptions;
|
|
1982
|
+
gapWidth?: number;
|
|
1983
|
+
overlap?: number;
|
|
1984
|
+
shape?: BarShape;
|
|
1985
|
+
}
|
|
1986
|
+
export type AddPieChartSeriesOptions = Omit<AddChartSeriesOptions, "xValues" | "bubbleSize" | "bubble3D" | "trendline" | "errorBars" | "pictureFill">;
|
|
1987
|
+
export interface AddPieChartOptions extends CommonAddChartOptions {
|
|
1988
|
+
type?: "pie" | "pie3D" | "doughnut" | "ofPie";
|
|
1989
|
+
series?: AddPieChartSeriesOptions[];
|
|
1990
|
+
holeSize?: number;
|
|
1991
|
+
firstSliceAng?: number;
|
|
1992
|
+
dataLabels?: AddDataLabelsOptions;
|
|
1993
|
+
gapWidth?: number;
|
|
1994
|
+
ofPieType?: OfPieType;
|
|
1995
|
+
splitType?: SplitType;
|
|
1996
|
+
splitPos?: number;
|
|
1997
|
+
secondPieSize?: number;
|
|
1998
|
+
}
|
|
1999
|
+
export type AddScatterChartSeriesOptions = Omit<AddChartSeriesOptions, "categories" | "bubbleSize" | "bubble3D" | "pictureFill" | "explosion">;
|
|
2000
|
+
export interface AddScatterChartOptions extends CommonAddChartOptions {
|
|
2001
|
+
type?: "scatter";
|
|
2002
|
+
series?: AddScatterChartSeriesOptions[];
|
|
2003
|
+
scatterStyle?: ScatterStyle;
|
|
2004
|
+
dataLabels?: AddDataLabelsOptions;
|
|
2005
|
+
showMarker?: boolean;
|
|
2006
|
+
smooth?: boolean;
|
|
2007
|
+
}
|
|
2008
|
+
export type AddSurfaceChartSeriesOptions = Omit<AddChartSeriesOptions, "dataLabels" | "trendline" | "errorBars" | "marker" | "bubbleSize" | "bubble3D">;
|
|
2009
|
+
export interface AddSurfaceChartOptions extends CommonAddChartOptions {
|
|
2010
|
+
type?: "surface" | "surface3D";
|
|
2011
|
+
series?: AddSurfaceChartSeriesOptions[];
|
|
2012
|
+
wireframe?: boolean;
|
|
2013
|
+
bandFormats?: AddChartOptions["bandFormats"];
|
|
2014
|
+
}
|
|
2015
|
+
/**
|
|
2016
|
+
* Simplified fill / line options for chart shapes.
|
|
2017
|
+
*/
|
|
2018
|
+
export interface AddShapeFillOptions {
|
|
2019
|
+
/** Solid fill color (hex) */
|
|
2020
|
+
fill?: string;
|
|
2021
|
+
/** Border color (hex) */
|
|
2022
|
+
border?: string;
|
|
2023
|
+
/** Border width in points */
|
|
2024
|
+
borderWidth?: number;
|
|
2025
|
+
/** Gradient fill */
|
|
2026
|
+
gradient?: ChartFill["gradient"];
|
|
2027
|
+
/** Pattern fill */
|
|
2028
|
+
pattern?: ChartFill["pattern"];
|
|
2029
|
+
/** No fill */
|
|
2030
|
+
noFill?: boolean;
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Title layout / formatting options.
|
|
2034
|
+
*/
|
|
2035
|
+
export interface AddTitleOptions {
|
|
2036
|
+
/** Manual layout (relative or absolute positioning) */
|
|
2037
|
+
layout?: ChartLayout;
|
|
2038
|
+
/** Whether the title overlays the plot area */
|
|
2039
|
+
overlay?: boolean;
|
|
2040
|
+
/** Shape properties for the title frame */
|
|
2041
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2042
|
+
/** Text properties for the title */
|
|
2043
|
+
txPr?: ChartTextProperties;
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Legend layout / entry overrides.
|
|
2047
|
+
*/
|
|
2048
|
+
export interface AddLegendOptions {
|
|
2049
|
+
/** Manual layout */
|
|
2050
|
+
layout?: ChartLayout;
|
|
2051
|
+
/** Whether the legend overlays the plot area */
|
|
2052
|
+
overlay?: boolean;
|
|
2053
|
+
/** Per-entry customisations (delete or restyle an entry) */
|
|
2054
|
+
entries?: Array<{
|
|
2055
|
+
/** 0-based legend entry index */
|
|
2056
|
+
index: number;
|
|
2057
|
+
/** Hide this entry (leaves the series plotted) */
|
|
2058
|
+
hidden?: boolean;
|
|
2059
|
+
/** Text properties for this entry */
|
|
2060
|
+
txPr?: ChartTextProperties;
|
|
2061
|
+
}>;
|
|
2062
|
+
/** Shape properties for the legend frame */
|
|
2063
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2064
|
+
/** Text properties for the legend */
|
|
2065
|
+
txPr?: ChartTextProperties;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Plot area layout / styling.
|
|
2069
|
+
*/
|
|
2070
|
+
export interface AddPlotAreaOptions {
|
|
2071
|
+
/** Manual layout */
|
|
2072
|
+
layout?: ChartLayout;
|
|
2073
|
+
/** Shape properties for the plot area background */
|
|
2074
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Options for a single chart type group within a combo chart.
|
|
2078
|
+
* Each group can use its own chart type and optionally bind to a secondary axis.
|
|
2079
|
+
*/
|
|
2080
|
+
export interface ComboChartGroupOptions extends AddChartOptions {
|
|
2081
|
+
/**
|
|
2082
|
+
* When true, the series in this group are plotted against a secondary
|
|
2083
|
+
* value axis (right side). The builder will automatically create
|
|
2084
|
+
* a secondary catAx/valAx pair and wire them up.
|
|
2085
|
+
*/
|
|
2086
|
+
useSecondaryAxis?: boolean;
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Options for creating a combo chart with multiple overlaid chart type groups.
|
|
2090
|
+
*
|
|
2091
|
+
* Example: bar + line combo with secondary axis on the line:
|
|
2092
|
+
* ```ts
|
|
2093
|
+
* worksheet.addComboChart(
|
|
2094
|
+
* {
|
|
2095
|
+
* groups: [
|
|
2096
|
+
* { type: "bar", series: [{ values: "Sheet1!$B$1:$B$5" }] },
|
|
2097
|
+
* { type: "line", series: [{ values: "Sheet1!$C$1:$C$5" }], useSecondaryAxis: true }
|
|
2098
|
+
* ],
|
|
2099
|
+
* title: "Sales vs Growth"
|
|
2100
|
+
* },
|
|
2101
|
+
* "A1:H15"
|
|
2102
|
+
* );
|
|
2103
|
+
* ```
|
|
2104
|
+
*/
|
|
2105
|
+
export interface AddComboChartOptions extends Pick<AddChartOptions, "title" | "showLegend" | "legendPosition" | "displayBlanksAs" | "style" | "chartStyle" | "chartColors" | "pivotSource" | "pivotChartOptions" | "plotVisOnly" | "showDLblsOverMax" | "dataTable" | "titleOptions" | "legendOptions" | "plotAreaOptions" | "view3D" | "floor" | "sideWall" | "backWall"> {
|
|
2106
|
+
/** Chart type groups — at least 2 for a combo chart */
|
|
2107
|
+
groups: ComboChartGroupOptions[];
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* High-level image source for {@link AddChartSeriesOptions.pictureFill}'s
|
|
2111
|
+
* `image` field.
|
|
2112
|
+
*
|
|
2113
|
+
* The various shapes exist so callers don't have to marshal their native
|
|
2114
|
+
* data just to fill a bar:
|
|
2115
|
+
*
|
|
2116
|
+
* - `Uint8Array` — raw binary; extension is sniffed from magic bytes
|
|
2117
|
+
* (PNG / JPEG / GIF) with PNG as fallback.
|
|
2118
|
+
* - `string` — either a `data:image/<type>;base64,…` URL or a bare
|
|
2119
|
+
* base64 payload (extension inferred from the data URL prefix when
|
|
2120
|
+
* present, else PNG).
|
|
2121
|
+
* - `ChartPictureFillImageData` — structured object with explicit
|
|
2122
|
+
* `extension` + either buffer or base64.
|
|
2123
|
+
* - `{ workbookImageId: number }` — points at an image previously
|
|
2124
|
+
* registered via {@link Workbook.addImage}; no new media entry is
|
|
2125
|
+
* allocated, just a new chart rel.
|
|
2126
|
+
*/
|
|
2127
|
+
export type AddChartPictureFillImage = Uint8Array | string | ChartPictureFillImageData | {
|
|
2128
|
+
workbookImageId: number;
|
|
2129
|
+
};
|
|
2130
|
+
/**
|
|
2131
|
+
* Structured variant of {@link AddChartPictureFillImage} that mirrors
|
|
2132
|
+
* the worksheet `ImageData` shape but keeps this types module independent
|
|
2133
|
+
* of the worksheet image types. The worksheet-side registration path
|
|
2134
|
+
* accepts both shapes interchangeably.
|
|
2135
|
+
*/
|
|
2136
|
+
export interface ChartPictureFillImageData {
|
|
2137
|
+
/** Image extension — used for media filename and content type. */
|
|
2138
|
+
extension: "png" | "jpeg" | "gif";
|
|
2139
|
+
/** Raw binary payload (preferred). */
|
|
2140
|
+
buffer?: Uint8Array;
|
|
2141
|
+
/** Bare base64 (no data: URL prefix). */
|
|
2142
|
+
base64?: string;
|
|
2143
|
+
}
|
|
2144
|
+
export interface AddChartSeriesOptions {
|
|
2145
|
+
/** Series name or reference */
|
|
2146
|
+
name?: string | {
|
|
2147
|
+
formula: string;
|
|
2148
|
+
};
|
|
2149
|
+
/** Category values reference or structured category data source. */
|
|
2150
|
+
categories?: string | AxisDataSource;
|
|
2151
|
+
/** Values reference */
|
|
2152
|
+
values: string;
|
|
2153
|
+
/** X values for scatter/bubble. */
|
|
2154
|
+
xValues?: string | AxisDataSource;
|
|
2155
|
+
/**
|
|
2156
|
+
* Semantic type of {@link xValues} — controls whether a `string`
|
|
2157
|
+
* reference is wrapped as a `numRef` (default, matches OOXML scatter
|
|
2158
|
+
* regular usage) or a `strRef` (text-categorical x axis, produces a
|
|
2159
|
+
* cat axis even on a scatter chart).
|
|
2160
|
+
*
|
|
2161
|
+
* - `"number"` (default): `xValues` is a numeric range; Excel plots
|
|
2162
|
+
* `(x, y)` pairs.
|
|
2163
|
+
* - `"text"`: `xValues` points at text cells; Excel treats them as
|
|
2164
|
+
* evenly-spaced categorical labels — useful when the natural x
|
|
2165
|
+
* dimension is names/dates-as-strings rather than measurements.
|
|
2166
|
+
*
|
|
2167
|
+
* Ignored when {@link xValues} is already a structured
|
|
2168
|
+
* {@link AxisDataSource} (the caller has already picked strRef vs
|
|
2169
|
+
* numRef explicitly).
|
|
2170
|
+
*/
|
|
2171
|
+
xValueType?: "number" | "text";
|
|
2172
|
+
/** Bubble size for bubble charts */
|
|
2173
|
+
bubbleSize?: string;
|
|
2174
|
+
/** Fill color (hex, e.g. "#FF0000" or "FF0000") */
|
|
2175
|
+
fill?: string;
|
|
2176
|
+
/** Line color (hex) */
|
|
2177
|
+
line?: string;
|
|
2178
|
+
/** Line width in points */
|
|
2179
|
+
lineWidth?: number;
|
|
2180
|
+
/** Dash style for the line */
|
|
2181
|
+
lineDash?: ChartLine["dash"];
|
|
2182
|
+
/** Marker configuration */
|
|
2183
|
+
marker?: AddChartMarkerOptions;
|
|
2184
|
+
/** Smooth lines (line/scatter) */
|
|
2185
|
+
smooth?: boolean;
|
|
2186
|
+
/** Data labels for this series */
|
|
2187
|
+
dataLabels?: AddDataLabelsOptions;
|
|
2188
|
+
/** Trendline configuration (single or multiple) */
|
|
2189
|
+
trendline?: AddTrendlineOptions | AddTrendlineOptions[];
|
|
2190
|
+
/** Error bars configuration */
|
|
2191
|
+
errorBars?: AddErrorBarsOptions | AddErrorBarsOptions[];
|
|
2192
|
+
/** Data point overrides */
|
|
2193
|
+
dataPoints?: AddDataPointOptions[];
|
|
2194
|
+
/** Invert if negative (bar/bubble) */
|
|
2195
|
+
invertIfNegative?: boolean;
|
|
2196
|
+
/** Explosion percentage for pie/doughnut */
|
|
2197
|
+
explosion?: number;
|
|
2198
|
+
/** Bubble 3D effect */
|
|
2199
|
+
bubble3D?: boolean;
|
|
2200
|
+
/** Picture fill options (bar charts only) */
|
|
2201
|
+
pictureFill?: {
|
|
2202
|
+
/**
|
|
2203
|
+
* Rel ID for a pre-registered chart-part image relationship.
|
|
2204
|
+
* Callers that already manage the image rel by hand can pass the
|
|
2205
|
+
* existing `rId…` string here. Most callers should prefer
|
|
2206
|
+
* {@link image} — the builder wires up the media entry, chart rel
|
|
2207
|
+
* and correct r:id automatically.
|
|
2208
|
+
*/
|
|
2209
|
+
relationshipId?: string;
|
|
2210
|
+
/**
|
|
2211
|
+
* High-level image source: either a raw payload ({@link Buffer} /
|
|
2212
|
+
* {@link Uint8Array} / base64 string), a structured
|
|
2213
|
+
* `ImageData`-shaped object, or a `{ workbookImageId }` pointing at
|
|
2214
|
+
* a previously registered {@link Workbook.addImage} result.
|
|
2215
|
+
*
|
|
2216
|
+
* When set, the worksheet-side `_registerChart` path stores the
|
|
2217
|
+
* image in the workbook's media collection, allocates a new
|
|
2218
|
+
* relationship on the chart part (`rIdN` — non-conflicting with
|
|
2219
|
+
* style/colors rels), and populates {@link relationshipId}
|
|
2220
|
+
* automatically. Subsequent writes emit the correct `<a:blipFill>`
|
|
2221
|
+
* with the matching `r:embed` reference.
|
|
2222
|
+
*
|
|
2223
|
+
* `extension` is inferred from the buffer's magic bytes when the
|
|
2224
|
+
* caller passes a raw `Uint8Array`: PNG / JPEG / GIF are
|
|
2225
|
+
* recognised (every `<a:blipFill>`-supported format) and
|
|
2226
|
+
* anything else — WebP / AVIF / TIFF / BMP / SVG — is dropped
|
|
2227
|
+
* entirely rather than relabelled as `png`. Emitting an image
|
|
2228
|
+
* with a wrong extension would produce a broken picture in
|
|
2229
|
+
* Excel, so "drop the blip" is safer than "guess".
|
|
2230
|
+
*
|
|
2231
|
+
* For string inputs the rule differs: a `data:image/<type>;base64,…`
|
|
2232
|
+
* URL requires `<type>` to be `png` / `jpeg` / `jpg` / `gif` (other
|
|
2233
|
+
* content-types are dropped), but a **bare base64 payload** (no
|
|
2234
|
+
* `data:` prefix) has no embedded content-type and so is
|
|
2235
|
+
* assumed to be PNG — the most common encode target when
|
|
2236
|
+
* callers pass an already-stripped payload. Authors who need a
|
|
2237
|
+
* different format for bare base64 should pass a structured
|
|
2238
|
+
* {@link ChartPictureFillImageData} with an explicit
|
|
2239
|
+
* `extension`, or prefix with the matching data URL.
|
|
2240
|
+
*/
|
|
2241
|
+
image?: AddChartPictureFillImage;
|
|
2242
|
+
/** How to stretch: stretch (whole bar) or stack (per unit) */
|
|
2243
|
+
fillMode?: "stretch" | "stack" | "stackScale";
|
|
2244
|
+
/** Picture scale (for stackScale) */
|
|
2245
|
+
scale?: number;
|
|
2246
|
+
/** Apply to data points / bar sides / front */
|
|
2247
|
+
applyToFront?: boolean;
|
|
2248
|
+
applyToSides?: boolean;
|
|
2249
|
+
applyToEnd?: boolean;
|
|
2250
|
+
};
|
|
2251
|
+
/** Advanced shape properties (overrides fill/line when set) */
|
|
2252
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2253
|
+
}
|
|
2254
|
+
/**
|
|
2255
|
+
* Options for a chart marker on a series.
|
|
2256
|
+
*/
|
|
2257
|
+
export interface AddChartMarkerOptions {
|
|
2258
|
+
/** Marker symbol */
|
|
2259
|
+
symbol?: ChartMarker["symbol"];
|
|
2260
|
+
/** Marker size (2-72) */
|
|
2261
|
+
size?: number;
|
|
2262
|
+
/** Fill color (hex) */
|
|
2263
|
+
fill?: string;
|
|
2264
|
+
/** Border/outline color (hex) */
|
|
2265
|
+
border?: string;
|
|
2266
|
+
}
|
|
2267
|
+
/**
|
|
2268
|
+
* Options for data labels on a series or chart type group.
|
|
2269
|
+
*/
|
|
2270
|
+
export interface AddDataLabelsOptions {
|
|
2271
|
+
/** Show legend key */
|
|
2272
|
+
showLegendKey?: boolean;
|
|
2273
|
+
/** Show category name */
|
|
2274
|
+
showCatName?: boolean;
|
|
2275
|
+
/** Show series name */
|
|
2276
|
+
showSerName?: boolean;
|
|
2277
|
+
/** Show value */
|
|
2278
|
+
showVal?: boolean;
|
|
2279
|
+
/** Show percentage (pie/doughnut) */
|
|
2280
|
+
showPercent?: boolean;
|
|
2281
|
+
/** Show bubble size */
|
|
2282
|
+
showBubbleSize?: boolean;
|
|
2283
|
+
/** Show leader lines */
|
|
2284
|
+
showLeaderLines?: boolean;
|
|
2285
|
+
/** Label position */
|
|
2286
|
+
position?: DataLabelPosition;
|
|
2287
|
+
/** Separator between label parts */
|
|
2288
|
+
separator?: string;
|
|
2289
|
+
/** Number format */
|
|
2290
|
+
numFmt?: string;
|
|
2291
|
+
/** Whether number format is linked to source */
|
|
2292
|
+
numFmtLinked?: boolean;
|
|
2293
|
+
/** Shape properties for label frame */
|
|
2294
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2295
|
+
/** Text properties for label */
|
|
2296
|
+
txPr?: ChartTextProperties;
|
|
2297
|
+
/** Per-entry overrides (keyed by 0-based point index) */
|
|
2298
|
+
entries?: AddDataLabelEntryOptions[];
|
|
2299
|
+
/**
|
|
2300
|
+
* Excel 2013+ "Value From Cells". When set, each data label's text is
|
|
2301
|
+
* read from the given worksheet range instead of the series/value.
|
|
2302
|
+
*
|
|
2303
|
+
* Accepts either a plain formula string (most common) or a structured
|
|
2304
|
+
* {@link DataLabelsRange} for callers who want to pre-populate the
|
|
2305
|
+
* cache. The builder wires the value up as the MS `c15:datalabelsRange`
|
|
2306
|
+
* extension and generates placeholder per-point `<c:dLbl>` entries
|
|
2307
|
+
* carrying the cached strings so viewers that don't understand the
|
|
2308
|
+
* extension still show the right labels.
|
|
2309
|
+
*
|
|
2310
|
+
* Typical usage: `valueFromCells: "Sheet1!$C$2:$C$10"`.
|
|
2311
|
+
*/
|
|
2312
|
+
valueFromCells?: string | DataLabelsRange;
|
|
2313
|
+
}
|
|
2314
|
+
/**
|
|
2315
|
+
* Override for a single data label entry.
|
|
2316
|
+
*/
|
|
2317
|
+
export interface AddDataLabelEntryOptions {
|
|
2318
|
+
/** 0-based point index */
|
|
2319
|
+
index: number;
|
|
2320
|
+
/** Hide this entry entirely */
|
|
2321
|
+
delete?: boolean;
|
|
2322
|
+
/** Custom label text (plain string or rich text) */
|
|
2323
|
+
text?: string | ChartRichText;
|
|
2324
|
+
/** Position (overrides group-level) */
|
|
2325
|
+
position?: DataLabelPosition;
|
|
2326
|
+
/** Number format */
|
|
2327
|
+
numFmt?: string;
|
|
2328
|
+
numFmtLinked?: boolean;
|
|
2329
|
+
/** Shape properties */
|
|
2330
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2331
|
+
/** Text properties */
|
|
2332
|
+
txPr?: ChartTextProperties;
|
|
2333
|
+
/** Show flags (overrides group-level) */
|
|
2334
|
+
showVal?: boolean;
|
|
2335
|
+
showCatName?: boolean;
|
|
2336
|
+
showSerName?: boolean;
|
|
2337
|
+
showPercent?: boolean;
|
|
2338
|
+
showBubbleSize?: boolean;
|
|
2339
|
+
showLegendKey?: boolean;
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Options for a trendline on a series.
|
|
2343
|
+
*/
|
|
2344
|
+
export interface AddTrendlineOptions {
|
|
2345
|
+
/** Trendline type */
|
|
2346
|
+
type: TrendlineType;
|
|
2347
|
+
/** Trendline name (displayed in legend) */
|
|
2348
|
+
name?: string;
|
|
2349
|
+
/** Polynomial order (2-6, for type "poly") */
|
|
2350
|
+
order?: number;
|
|
2351
|
+
/** Moving average period (for type "movingAvg") */
|
|
2352
|
+
period?: number;
|
|
2353
|
+
/** Forward forecast periods */
|
|
2354
|
+
forward?: number;
|
|
2355
|
+
/** Backward forecast periods */
|
|
2356
|
+
backward?: number;
|
|
2357
|
+
/** Y-intercept value */
|
|
2358
|
+
intercept?: number;
|
|
2359
|
+
/** Display R-squared value on chart */
|
|
2360
|
+
displayRSqr?: boolean;
|
|
2361
|
+
/** Display equation on chart */
|
|
2362
|
+
displayEq?: boolean;
|
|
2363
|
+
/** Line color (hex) */
|
|
2364
|
+
line?: string;
|
|
2365
|
+
/** Line width in points */
|
|
2366
|
+
lineWidth?: number;
|
|
2367
|
+
/** Dash style */
|
|
2368
|
+
lineDash?: ChartLine["dash"];
|
|
2369
|
+
/** Trendline label (text, layout, style) */
|
|
2370
|
+
label?: AddTrendlineLabelOptions;
|
|
2371
|
+
}
|
|
2372
|
+
/**
|
|
2373
|
+
* Trendline label styling.
|
|
2374
|
+
*/
|
|
2375
|
+
export interface AddTrendlineLabelOptions {
|
|
2376
|
+
/** Custom label text (structured rich text) */
|
|
2377
|
+
text?: ChartRichText;
|
|
2378
|
+
/** Number format */
|
|
2379
|
+
numFmt?: string;
|
|
2380
|
+
numFmtLinked?: boolean;
|
|
2381
|
+
/** Layout */
|
|
2382
|
+
layout?: ChartLayout;
|
|
2383
|
+
/** Shape properties */
|
|
2384
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2385
|
+
/** Text properties */
|
|
2386
|
+
txPr?: ChartTextProperties;
|
|
2387
|
+
}
|
|
2388
|
+
/**
|
|
2389
|
+
* Options for error bars on a series.
|
|
2390
|
+
*/
|
|
2391
|
+
export interface AddErrorBarsOptions {
|
|
2392
|
+
/** Error bar direction */
|
|
2393
|
+
direction?: ErrorBarDirection;
|
|
2394
|
+
/** Which sides to show */
|
|
2395
|
+
barDir?: ErrorBarType;
|
|
2396
|
+
/** Value type */
|
|
2397
|
+
type: ErrorBarValueType;
|
|
2398
|
+
/** Fixed value (for type "fixedVal" or "percentage") */
|
|
2399
|
+
value?: number;
|
|
2400
|
+
/** No end cap */
|
|
2401
|
+
noEndCap?: boolean;
|
|
2402
|
+
/** Custom plus values formula (for type "cust") */
|
|
2403
|
+
plus?: string;
|
|
2404
|
+
/** Custom minus values formula (for type "cust") */
|
|
2405
|
+
minus?: string;
|
|
2406
|
+
/** Line color (hex) */
|
|
2407
|
+
line?: string;
|
|
2408
|
+
/** Line width in points */
|
|
2409
|
+
lineWidth?: number;
|
|
2410
|
+
/** Dash style */
|
|
2411
|
+
lineDash?: ChartLine["dash"];
|
|
2412
|
+
/** Shape properties (advanced — overrides line/lineWidth/lineDash) */
|
|
2413
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2414
|
+
}
|
|
2415
|
+
/**
|
|
2416
|
+
* Options for a data point override.
|
|
2417
|
+
*/
|
|
2418
|
+
export interface AddDataPointOptions {
|
|
2419
|
+
/** 0-based point index */
|
|
2420
|
+
index: number;
|
|
2421
|
+
/** Fill color (hex) */
|
|
2422
|
+
fill?: string;
|
|
2423
|
+
/** Border color (hex) */
|
|
2424
|
+
border?: string;
|
|
2425
|
+
/** Explosion (pie/doughnut) */
|
|
2426
|
+
explosion?: number;
|
|
2427
|
+
/** Bubble 3D */
|
|
2428
|
+
bubble3D?: boolean;
|
|
2429
|
+
/** Marker override for this data point */
|
|
2430
|
+
marker?: AddChartMarkerOptions;
|
|
2431
|
+
/** Invert if negative */
|
|
2432
|
+
invertIfNegative?: boolean;
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Axis configuration options for the builder.
|
|
2436
|
+
*/
|
|
2437
|
+
export interface AddAxisOptions {
|
|
2438
|
+
/** Axis title text */
|
|
2439
|
+
title?: string;
|
|
2440
|
+
/** Number format (e.g. "#,##0", "0.00%") */
|
|
2441
|
+
numFmt?: string;
|
|
2442
|
+
/** Whether number format is linked to source */
|
|
2443
|
+
numFmtLinked?: boolean;
|
|
2444
|
+
/** Minimum value */
|
|
2445
|
+
min?: number;
|
|
2446
|
+
/** Maximum value */
|
|
2447
|
+
max?: number;
|
|
2448
|
+
/** Major unit (must be > 0; when both are set, minorUnit must be \u2264 majorUnit) */
|
|
2449
|
+
majorUnit?: number;
|
|
2450
|
+
/** Minor unit (must be > 0; when both are set, must be \u2264 majorUnit) */
|
|
2451
|
+
minorUnit?: number;
|
|
2452
|
+
/** Major tick mark type */
|
|
2453
|
+
majorTickMark?: TickMark;
|
|
2454
|
+
/** Minor tick mark type */
|
|
2455
|
+
minorTickMark?: TickMark;
|
|
2456
|
+
/** Tick label position */
|
|
2457
|
+
tickLblPos?: TickLabelPosition;
|
|
2458
|
+
/** Show major gridlines */
|
|
2459
|
+
majorGridlines?: boolean;
|
|
2460
|
+
/** Show minor gridlines */
|
|
2461
|
+
minorGridlines?: boolean;
|
|
2462
|
+
/** Axis orientation */
|
|
2463
|
+
orientation?: AxisOrientation;
|
|
2464
|
+
/** Cross between categories or midpoints (for value axis) */
|
|
2465
|
+
crossBetween?: "between" | "midCat";
|
|
2466
|
+
/** Axis label rotation in degrees (-90 to 90) */
|
|
2467
|
+
textRotation?: number;
|
|
2468
|
+
/** Delete/hide the axis */
|
|
2469
|
+
hidden?: boolean;
|
|
2470
|
+
/** Logarithmic base (e.g. 10) */
|
|
2471
|
+
logBase?: number;
|
|
2472
|
+
/** Label alignment (category axis only) */
|
|
2473
|
+
lblAlgn?: "ctr" | "l" | "r";
|
|
2474
|
+
/** Label offset percentage (category/date axis, default 100) */
|
|
2475
|
+
lblOffset?: number;
|
|
2476
|
+
/** Skip every N tick labels */
|
|
2477
|
+
tickLblSkip?: number;
|
|
2478
|
+
/** Skip every N tick marks */
|
|
2479
|
+
tickMarkSkip?: number;
|
|
2480
|
+
/** Cross axis at this value ("autoZero", "min", "max") */
|
|
2481
|
+
crosses?: "autoZero" | "min" | "max";
|
|
2482
|
+
/** Cross axis at a specific numeric value */
|
|
2483
|
+
crossesAt?: number;
|
|
2484
|
+
/** Display units for value axis */
|
|
2485
|
+
displayUnits?: DisplayUnits["builtInUnit"];
|
|
2486
|
+
/** Axis line color (hex) */
|
|
2487
|
+
lineColor?: string;
|
|
2488
|
+
/** Axis line width in points */
|
|
2489
|
+
lineWidth?: number;
|
|
2490
|
+
/** Line dash style */
|
|
2491
|
+
lineDash?: ChartLine["dash"];
|
|
2492
|
+
/** Custom display unit value (for value axis). */
|
|
2493
|
+
customUnit?: number;
|
|
2494
|
+
/** Display unit label (shown near axis when displayUnits is set) */
|
|
2495
|
+
displayUnitsLabel?: string | ChartRichText;
|
|
2496
|
+
/** Base time unit (for date axis: days/months/years) */
|
|
2497
|
+
baseTimeUnit?: "days" | "months" | "years";
|
|
2498
|
+
/** Major time unit (for date axis) */
|
|
2499
|
+
majorTimeUnit?: "days" | "months" | "years";
|
|
2500
|
+
/** Minor time unit (for date axis) */
|
|
2501
|
+
minorTimeUnit?: "days" | "months" | "years";
|
|
2502
|
+
/** Shape properties for the axis line and tick marks (advanced) */
|
|
2503
|
+
spPr?: ShapeProperties | AddShapeFillOptions;
|
|
2504
|
+
/** Text properties for tick labels */
|
|
2505
|
+
txPr?: ChartTextProperties;
|
|
2506
|
+
/** Rich styling for the axis title (overrides `title` string form) */
|
|
2507
|
+
titleOptions?: AddTitleOptions;
|
|
2508
|
+
/** Major gridlines styling (pass shape properties to style gridlines) */
|
|
2509
|
+
majorGridlinesStyle?: ShapeProperties | AddShapeFillOptions;
|
|
2510
|
+
/** Minor gridlines styling */
|
|
2511
|
+
minorGridlinesStyle?: ShapeProperties | AddShapeFillOptions;
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* Anchor range input for addChart.
|
|
2515
|
+
*
|
|
2516
|
+
* Supported forms:
|
|
2517
|
+
* - **String**: `"A1:H15"` (two-cell anchor) or `"A1"` (defaults to 10×15 cells).
|
|
2518
|
+
* - **Two-cell**: `{ tl, br, editAs? }` — top-left and bottom-right cells.
|
|
2519
|
+
* - **One-cell**: `{ tl, ext }` — top-left cell plus absolute extent (EMU).
|
|
2520
|
+
* - **Absolute**: `{ pos, ext }` — absolute position and extent in EMU.
|
|
2521
|
+
*
|
|
2522
|
+
* For EMU conversions: 914400 EMU = 1 inch. Typical chart 4×3 inches =
|
|
2523
|
+
* `{ cx: 3657600, cy: 2743200 }`.
|
|
2524
|
+
*/
|
|
2525
|
+
export type AddChartRange = string | {
|
|
2526
|
+
/** Two-cell anchor: top-left and bottom-right */
|
|
2527
|
+
tl: {
|
|
2528
|
+
col: number;
|
|
2529
|
+
row: number;
|
|
2530
|
+
} | string;
|
|
2531
|
+
br: {
|
|
2532
|
+
col: number;
|
|
2533
|
+
row: number;
|
|
2534
|
+
} | string;
|
|
2535
|
+
editAs?: "oneCell" | "twoCell" | "absolute";
|
|
2536
|
+
} | {
|
|
2537
|
+
/** One-cell anchor: top-left + fixed extent */
|
|
2538
|
+
tl: {
|
|
2539
|
+
col: number;
|
|
2540
|
+
row: number;
|
|
2541
|
+
} | string;
|
|
2542
|
+
ext: {
|
|
2543
|
+
cx: number;
|
|
2544
|
+
cy: number;
|
|
2545
|
+
};
|
|
2546
|
+
editAs?: "oneCell";
|
|
2547
|
+
} | {
|
|
2548
|
+
/** Absolute anchor: position + extent, both in EMU */
|
|
2549
|
+
pos: {
|
|
2550
|
+
x: number;
|
|
2551
|
+
y: number;
|
|
2552
|
+
};
|
|
2553
|
+
ext: {
|
|
2554
|
+
cx: number;
|
|
2555
|
+
cy: number;
|
|
2556
|
+
};
|
|
2557
|
+
editAs?: "absolute";
|
|
2558
|
+
};
|
|
2559
|
+
export {};
|