@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,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChartEx (Office 2016+ extended charts) type definitions.
|
|
3
|
+
*
|
|
4
|
+
* These types mirror the ECMA-376 Part 1, §21.3 `cx:` namespace for the eight
|
|
5
|
+
* modern chart types: sunburst, treemap, waterfall, funnel, histogram
|
|
6
|
+
* (and Pareto), box-whisker, and region map.
|
|
7
|
+
*
|
|
8
|
+
* Classic charts live in `c:` (ChartML); chartEx uses its own `cx:` schema
|
|
9
|
+
* with shared formatting primitives (spPr/txPr) but very different data model.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picture-fill (`<a:blipFill>`) registration for chart parts.
|
|
3
|
+
*
|
|
4
|
+
* Callers supply an image payload via `AddChartSeriesOptions.pictureFill.image`;
|
|
5
|
+
* the builder stores it on the chart model's `spPr.fill.blip._pendingImage`
|
|
6
|
+
* field. This module consumes those staged payloads at chart-registration
|
|
7
|
+
* time, pushes the image into the workbook media collection, allocates a
|
|
8
|
+
* fresh chart-part relationship, and rewrites the blip with the resolved
|
|
9
|
+
* `r:embed` id.
|
|
10
|
+
*
|
|
11
|
+
* The worksheet path calls {@link resolvePendingChartImages} right after
|
|
12
|
+
* `fillChartCaches` and before the chart entry is stored — at that point
|
|
13
|
+
* we have both the built model and the owning workbook, so we can do the
|
|
14
|
+
* binding without requiring callers to juggle rel ids manually.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Rel information that {@link resolvePendingChartImages} appends to the
|
|
18
|
+
* chart entry so the writer can emit the `chart{N}.xml.rels` file and
|
|
19
|
+
* the correct `r:embed` value inside the chart XML.
|
|
20
|
+
*
|
|
21
|
+
* The concrete shape matches the rel entry format used elsewhere
|
|
22
|
+
* (xlsx-writer relationships XForm) — Id + Type + Target triple. We
|
|
23
|
+
* hardcode the Type URI in the literal emitted at the call site so
|
|
24
|
+
* callers don't need to import the workbook-level `RelType` enum.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Walk a chart model, resolve every `_pendingImage` blip into a real
|
|
28
|
+
* workbook media entry + chart relationship, and mutate the model so
|
|
29
|
+
* the blip references the allocated `rIdN`.
|
|
30
|
+
*
|
|
31
|
+
* Safe to call multiple times on the same entry: once a blip has a
|
|
32
|
+
* `relationshipId` and no `_pendingImage`, it is skipped.
|
|
33
|
+
*
|
|
34
|
+
* @param entry The chart entry being registered. Its `rels` array is
|
|
35
|
+
* populated (created if absent) with any freshly
|
|
36
|
+
* allocated image relationships.
|
|
37
|
+
* @param workbook Host workbook exposing `addImage`. Also consulted for
|
|
38
|
+
* its internal `_chartRels[n]` bag — those rels are
|
|
39
|
+
* loaded from disk during round-trip and carry canonical
|
|
40
|
+
* rIds that must NOT collide with freshly allocated
|
|
41
|
+
* image rels (the xlsx writer merges both lists and
|
|
42
|
+
* silently drops any duplicate Id, which would otherwise
|
|
43
|
+
* orphan the image relationship).
|
|
44
|
+
* @param chartNumber 1-based chart index. Used to look up
|
|
45
|
+
* `workbook._chartRels[chartNumber]` so pre-existing
|
|
46
|
+
* rels seed the collision set.
|
|
47
|
+
*/
|
|
48
|
+
export function resolvePendingChartImages(entry, workbook, chartNumber) {
|
|
49
|
+
const blips = collectBlipFills(entry.model);
|
|
50
|
+
if (blips.length === 0) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const rels = (entry.rels ?? (entry.rels = []));
|
|
54
|
+
// Scan pre-existing rels so freshly allocated ids don't collide with
|
|
55
|
+
// rels the user may already have set (e.g. from a partial migration).
|
|
56
|
+
const usedIds = new Set();
|
|
57
|
+
for (const rel of rels) {
|
|
58
|
+
if (rel?.Id) {
|
|
59
|
+
usedIds.add(rel.Id);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Also seed from the workbook-level `_chartRels` bag. Those entries
|
|
63
|
+
// come from the xlsx reader (round-tripped rels: style / colors /
|
|
64
|
+
// userShapes / existing images) and are merged BEFORE `entry.rels`
|
|
65
|
+
// by the writer — the writer drops any `entry.rels` entry whose Id
|
|
66
|
+
// collides. Without seeding here, a fresh image rel allocated as
|
|
67
|
+
// `rId1` would be silently dropped by the writer on a round-tripped
|
|
68
|
+
// chart whose original style sidecar already took `rId1`, leaving
|
|
69
|
+
// the chart's `r:embed="rId1"` pointing at the wrong target.
|
|
70
|
+
const chartRelsBag = workbook._chartRels;
|
|
71
|
+
const existingChartRels = chartRelsBag?.[chartNumber];
|
|
72
|
+
if (Array.isArray(existingChartRels)) {
|
|
73
|
+
for (const rel of existingChartRels) {
|
|
74
|
+
if (rel?.Id) {
|
|
75
|
+
usedIds.add(rel.Id);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
let counter = 1;
|
|
80
|
+
const allocRelId = () => {
|
|
81
|
+
let id = `rId${counter++}`;
|
|
82
|
+
while (usedIds.has(id)) {
|
|
83
|
+
id = `rId${counter++}`;
|
|
84
|
+
}
|
|
85
|
+
usedIds.add(id);
|
|
86
|
+
return id;
|
|
87
|
+
};
|
|
88
|
+
for (const blip of blips) {
|
|
89
|
+
if (blip.relationshipId || blip._pendingImage === undefined) {
|
|
90
|
+
delete blip._pendingImage;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const normalised = normaliseImage(blip._pendingImage, workbook);
|
|
94
|
+
if (!normalised) {
|
|
95
|
+
// Bad payload — drop the blip so we don't emit a broken rel. The
|
|
96
|
+
// series keeps its `pictureOptions` so the chart still opens.
|
|
97
|
+
delete blip._pendingImage;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const { mediaId, extension } = normalised;
|
|
101
|
+
const relId = allocRelId();
|
|
102
|
+
blip.relationshipId = relId;
|
|
103
|
+
delete blip._pendingImage;
|
|
104
|
+
rels.push({
|
|
105
|
+
Id: relId,
|
|
106
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
|
|
107
|
+
// Chart parts live at `xl/charts/chart{N}.xml`; images live at
|
|
108
|
+
// `xl/media/image{M}.{ext}`. The relative Target is therefore
|
|
109
|
+
// `../media/image{M}.{ext}`. Media ids are 0-based in the workbook
|
|
110
|
+
// collection but the on-disk naming is 1-based, hence `mediaId + 1`.
|
|
111
|
+
Target: `../media/image${mediaId + 1}.${extension}`
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Traverse every `spPr` slot in a chart model and return the list of
|
|
117
|
+
* {@link ChartBlipFill} objects that carry picture fills.
|
|
118
|
+
*
|
|
119
|
+
* The traversal is intentionally narrow: we only visit the locations
|
|
120
|
+
* where `a:blipFill` is actually legal (series, data points, chart
|
|
121
|
+
* frame, plot area, walls, axis, legend, gridlines, drop/hi-low lines,
|
|
122
|
+
* trendline labels…). It walks both the primary (`chart.plotArea`) and
|
|
123
|
+
* pivot-format (`chart.pivotFormats`) branches.
|
|
124
|
+
*/
|
|
125
|
+
function collectBlipFills(model) {
|
|
126
|
+
const out = [];
|
|
127
|
+
const visitSpPr = (spPr) => {
|
|
128
|
+
const blip = spPr?.fill?.blip;
|
|
129
|
+
if (blip && (blip.relationshipId || blip._pendingImage)) {
|
|
130
|
+
out.push(blip);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
visitSpPr(model.spPr);
|
|
134
|
+
visitSpPr(model.chart?.title?.spPr);
|
|
135
|
+
visitSpPr(model.chart?.floor);
|
|
136
|
+
visitSpPr(model.chart?.sideWall);
|
|
137
|
+
visitSpPr(model.chart?.backWall);
|
|
138
|
+
visitSpPr(model.chart?.plotArea?.spPr);
|
|
139
|
+
for (const group of model.chart?.plotArea?.chartTypes ?? []) {
|
|
140
|
+
visitGroup(group, visitSpPr);
|
|
141
|
+
}
|
|
142
|
+
for (const axis of model.chart?.plotArea?.axes ?? []) {
|
|
143
|
+
visitSpPr(axis.spPr);
|
|
144
|
+
visitSpPr(axis.title?.spPr);
|
|
145
|
+
// `majorGridlines` and `minorGridlines` are themselves `ShapeProperties`
|
|
146
|
+
// (the grid-line style uses the same DrawingML fill/line/effect
|
|
147
|
+
// vocabulary as any other shape); pass them through directly rather
|
|
148
|
+
// than treating them as containers.
|
|
149
|
+
visitSpPr(axis.majorGridlines);
|
|
150
|
+
visitSpPr(axis.minorGridlines);
|
|
151
|
+
}
|
|
152
|
+
visitSpPr(model.chart?.legend?.spPr);
|
|
153
|
+
for (const pf of model.chart?.pivotFormats ?? []) {
|
|
154
|
+
visitSpPr(pf.spPr);
|
|
155
|
+
}
|
|
156
|
+
return out;
|
|
157
|
+
}
|
|
158
|
+
function visitGroup(group, visit) {
|
|
159
|
+
const groupWithSeries = group;
|
|
160
|
+
if (groupWithSeries.series) {
|
|
161
|
+
for (const s of groupWithSeries.series) {
|
|
162
|
+
visit(s.spPr);
|
|
163
|
+
// Series-level data labels and trendlines are DrawingML shapes too;
|
|
164
|
+
// both can carry picture fills (e.g. a branded label background).
|
|
165
|
+
const dataLabels = s.dataLabels;
|
|
166
|
+
visit(dataLabels?.spPr);
|
|
167
|
+
const trendlines = s.trendlines;
|
|
168
|
+
if (trendlines) {
|
|
169
|
+
for (const tl of trendlines) {
|
|
170
|
+
visit(tl.spPr);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Per-point overrides live on specific series subtypes (BarSeries,
|
|
174
|
+
// LineSeries, …) as `dataPoints?: DataPoint[]`. They all share the
|
|
175
|
+
// same shape — walk them generically without narrowing to each
|
|
176
|
+
// discriminated union variant.
|
|
177
|
+
const dps = s.dataPoints;
|
|
178
|
+
if (dps) {
|
|
179
|
+
for (const dp of dps) {
|
|
180
|
+
visit(dp.spPr);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
visit(groupWithSeries.dropLines);
|
|
186
|
+
visit(groupWithSeries.hiLowLines);
|
|
187
|
+
visit(groupWithSeries.serLines);
|
|
188
|
+
visit(groupWithSeries.upDownBars?.upBars);
|
|
189
|
+
visit(groupWithSeries.upDownBars?.downBars);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Coerce a user-facing {@link AddChartPictureFillImage} into a workbook
|
|
193
|
+
* media entry. Returns `{mediaId, extension}` or `undefined` when the
|
|
194
|
+
* payload is unusable (empty / unknown format).
|
|
195
|
+
*
|
|
196
|
+
* Side-effect: when the caller passes raw data (not `workbookImageId`),
|
|
197
|
+
* a new media entry is created on the workbook.
|
|
198
|
+
*/
|
|
199
|
+
function normaliseImage(image, workbook) {
|
|
200
|
+
// Re-use an already-registered workbook image.
|
|
201
|
+
if (typeof image === "object" && !Array.isArray(image) && "workbookImageId" in image) {
|
|
202
|
+
const existing = workbook.getImage(image.workbookImageId);
|
|
203
|
+
if (!existing) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
// DrawingML's `<a:blipFill>` technically accepts more formats (BMP,
|
|
207
|
+
// TIFF, EMF/WMF) but the workbook media pipeline and our
|
|
208
|
+
// magic-byte sniffer only cover PNG / JPEG / GIF. Silently
|
|
209
|
+
// dropping the blip is preferable to emitting a rel entry whose
|
|
210
|
+
// media bytes would be mislabelled and fail to decode in Excel.
|
|
211
|
+
// Callers needing the exotic formats should add them to the
|
|
212
|
+
// workbook media collection separately and use `workbookImageId`.
|
|
213
|
+
const raw = existing.extension;
|
|
214
|
+
if (raw !== "png" && raw !== "jpeg" && raw !== "gif") {
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
return { mediaId: image.workbookImageId, extension: raw };
|
|
218
|
+
}
|
|
219
|
+
// Raw binary payload. `instanceof Uint8Array` is realm-sensitive:
|
|
220
|
+
// a buffer produced inside a Web Worker or another iframe has a
|
|
221
|
+
// different `Uint8Array` prototype, so the operator returns false
|
|
222
|
+
// even though the object is a genuine byte array. Duck-typing via
|
|
223
|
+
// `ArrayBuffer.isView` + `BYTES_PER_ELEMENT === 1` covers both the
|
|
224
|
+
// same-realm path and cross-realm buffers (workers, SharedWorkers,
|
|
225
|
+
// MessagePort transfers, `structuredClone` round-trips), and still
|
|
226
|
+
// excludes `Uint16Array` / `DataView` etc. — `DataView` has
|
|
227
|
+
// no `BYTES_PER_ELEMENT` on instances (the property is on the
|
|
228
|
+
// constructor), so the check rejects it naturally. `Int8Array` /
|
|
229
|
+
// `Uint8ClampedArray` DO pass the check; that's intentional —
|
|
230
|
+
// both carry byte-granular binary data and the sniffer below
|
|
231
|
+
// operates on the first few bytes regardless of typed-array
|
|
232
|
+
// signedness. The workbook image store only needs a
|
|
233
|
+
// `Uint8Array`, so we coerce through a shared underlying buffer.
|
|
234
|
+
if (ArrayBuffer.isView(image) &&
|
|
235
|
+
image.BYTES_PER_ELEMENT === 1) {
|
|
236
|
+
const view = image;
|
|
237
|
+
const bytes = view instanceof Uint8Array
|
|
238
|
+
? view
|
|
239
|
+
: new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
|
|
240
|
+
const ext = sniffImageExtension(bytes);
|
|
241
|
+
if (!ext) {
|
|
242
|
+
// Unknown format (WebP / AVIF / TIFF / …) — drop the blip rather
|
|
243
|
+
// than mislabel it as `png`. The caller keeps `pictureOptions`
|
|
244
|
+
// so the rest of the chart still renders.
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
const id = workbook.addImage({ extension: ext, buffer: bytes });
|
|
248
|
+
return { mediaId: id, extension: ext };
|
|
249
|
+
}
|
|
250
|
+
// String — either a data URL or a bare base64 string.
|
|
251
|
+
if (typeof image === "string") {
|
|
252
|
+
const parsed = parseDataUrlOrBase64(image);
|
|
253
|
+
if (!parsed) {
|
|
254
|
+
return undefined;
|
|
255
|
+
}
|
|
256
|
+
const id = workbook.addImage({ extension: parsed.extension, base64: parsed.base64 });
|
|
257
|
+
return { mediaId: id, extension: parsed.extension };
|
|
258
|
+
}
|
|
259
|
+
// Structured ChartPictureFillImageData.
|
|
260
|
+
const data = image;
|
|
261
|
+
if (data.buffer != null) {
|
|
262
|
+
// Use ArrayBuffer.isView to handle cross-realm Uint8Array instances
|
|
263
|
+
// that fail `instanceof` checks but are structurally identical.
|
|
264
|
+
const raw = data.buffer;
|
|
265
|
+
if (ArrayBuffer.isView(raw)) {
|
|
266
|
+
const view = raw;
|
|
267
|
+
const bytes = view instanceof Uint8Array
|
|
268
|
+
? view
|
|
269
|
+
: new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
|
|
270
|
+
const id = workbook.addImage({ extension: data.extension, buffer: bytes });
|
|
271
|
+
return { mediaId: id, extension: data.extension };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (typeof data.base64 === "string" && data.base64.length > 0) {
|
|
275
|
+
const id = workbook.addImage({ extension: data.extension, base64: data.base64 });
|
|
276
|
+
return { mediaId: id, extension: data.extension };
|
|
277
|
+
}
|
|
278
|
+
return undefined;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Parse a `data:image/<type>;base64,…` URL or a bare base64 string into
|
|
282
|
+
* `{ extension, base64 }`. Returns `undefined` for empty or
|
|
283
|
+
* unrecognised input (including data URLs whose content-type is not one
|
|
284
|
+
* of the three `<a:blipFill>`-supported formats — e.g. `image/svg+xml`
|
|
285
|
+
* or `image/bmp`). Callers interpret `undefined` as "drop the blip"
|
|
286
|
+
* rather than emitting a corrupted `.png` file.
|
|
287
|
+
*/
|
|
288
|
+
function parseDataUrlOrBase64(input) {
|
|
289
|
+
if (!input) {
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
292
|
+
// `data:image/<subtype>[;param=value]*;base64,<payload>`. Support
|
|
293
|
+
// multiple parameter segments (e.g. `;charset=utf-8;base64,...`).
|
|
294
|
+
// The previous `(?:;[^,]*)?` admitted only a single parameter AND
|
|
295
|
+
// used a greedy class that could swallow the required `;base64`
|
|
296
|
+
// token, forcing backtracking that silently failed for common
|
|
297
|
+
// multi-param forms. Allow any number of `;token[=value]` groups
|
|
298
|
+
// before the required trailing `;base64,`.
|
|
299
|
+
const dataUrl = /^data:image\/([a-z+]+)(?:;[^,;=]+(?:=[^,;]*)?)*;base64,(.+)$/i.exec(input.trim());
|
|
300
|
+
if (dataUrl) {
|
|
301
|
+
const rawType = dataUrl[1].toLowerCase();
|
|
302
|
+
const ext = rawType === "jpg"
|
|
303
|
+
? "jpeg"
|
|
304
|
+
: rawType === "png" || rawType === "jpeg" || rawType === "gif"
|
|
305
|
+
? rawType
|
|
306
|
+
: undefined;
|
|
307
|
+
if (ext === undefined) {
|
|
308
|
+
// Content-type outside the `<a:blipFill>` white-list (e.g.
|
|
309
|
+
// `svg+xml`, `bmp`, `webp`, `tiff`). Dropping is better than
|
|
310
|
+
// silently relabelling an SVG payload as `image/png` — Excel
|
|
311
|
+
// would try to decode SVG bytes with the PNG parser and either
|
|
312
|
+
// error out or leave an invisible shape.
|
|
313
|
+
return undefined;
|
|
314
|
+
}
|
|
315
|
+
return { extension: ext, base64: dataUrl[2] };
|
|
316
|
+
}
|
|
317
|
+
// Bare base64 — extension unknown, default to PNG (the most common
|
|
318
|
+
// Excel bar-fill choice). Callers who need precision should pass a
|
|
319
|
+
// structured ChartPictureFillImageData.
|
|
320
|
+
return { extension: "png", base64: input };
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Identify the image format from the first few magic bytes.
|
|
324
|
+
*
|
|
325
|
+
* Supports the three extensions Excel accepts in `<a:blipFill>` — PNG,
|
|
326
|
+
* JPEG, GIF. Anything else falls back to PNG (which is the safest
|
|
327
|
+
* default: Excel will try to decode and most viewers treat unrecognised
|
|
328
|
+
* binary as PNG).
|
|
329
|
+
*/
|
|
330
|
+
/**
|
|
331
|
+
* Inspect the first few bytes of `data` and return the matching
|
|
332
|
+
* `<a:blipFill>`-supported image extension, or `undefined` when the
|
|
333
|
+
* payload doesn't look like one of the three supported formats
|
|
334
|
+
* (PNG / JPEG / GIF). Callers treat `undefined` as "drop the blip" —
|
|
335
|
+
* preferable to emitting a `.png` file whose decoded bytes are
|
|
336
|
+
* actually WebP / AVIF / TIFF, which Excel would fail to render.
|
|
337
|
+
*/
|
|
338
|
+
function sniffImageExtension(data) {
|
|
339
|
+
if (data.length >= 8 &&
|
|
340
|
+
data[0] === 0x89 &&
|
|
341
|
+
data[1] === 0x50 &&
|
|
342
|
+
data[2] === 0x4e &&
|
|
343
|
+
data[3] === 0x47 &&
|
|
344
|
+
data[4] === 0x0d &&
|
|
345
|
+
data[5] === 0x0a &&
|
|
346
|
+
data[6] === 0x1a &&
|
|
347
|
+
data[7] === 0x0a) {
|
|
348
|
+
return "png";
|
|
349
|
+
}
|
|
350
|
+
if (data.length >= 3 && data[0] === 0xff && data[1] === 0xd8 && data[2] === 0xff) {
|
|
351
|
+
return "jpeg";
|
|
352
|
+
}
|
|
353
|
+
if (data.length >= 6 &&
|
|
354
|
+
data[0] === 0x47 &&
|
|
355
|
+
data[1] === 0x49 &&
|
|
356
|
+
data[2] === 0x46 &&
|
|
357
|
+
data[3] === 0x38 &&
|
|
358
|
+
(data[4] === 0x37 || data[4] === 0x39) &&
|
|
359
|
+
data[5] === 0x61) {
|
|
360
|
+
return "gif";
|
|
361
|
+
}
|
|
362
|
+
return undefined;
|
|
363
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ChartOptionsError } from "../errors.js";
|
|
2
|
+
// Shared factory for bar/column preset variants. Accepts a base type ("bar"
|
|
3
|
+
// or "bar3D"), direction, grouping and an optional 3-D shape. When `shape`
|
|
4
|
+
// is passed the type is always forced to "bar3D" (cone/cylinder/pyramid
|
|
5
|
+
// require 3D). The previous code had two nearly-identical factories
|
|
6
|
+
// (`barPreset` / `bar3DPreset`) that differed only in the default type.
|
|
7
|
+
const barPreset = (barDir, grouping, shape, type = "bar") => ({
|
|
8
|
+
options: shape ? { type: "bar3D", barDir, grouping, shape } : { type, barDir, grouping }
|
|
9
|
+
});
|
|
10
|
+
const bar3DPreset = (barDir, grouping, shape) => barPreset(barDir, grouping, shape, "bar3D");
|
|
11
|
+
export const CHART_PRESETS = {
|
|
12
|
+
columnClustered: barPreset("col", "clustered"),
|
|
13
|
+
columnStacked: barPreset("col", "stacked"),
|
|
14
|
+
columnStacked100: barPreset("col", "percentStacked"),
|
|
15
|
+
columnPercentStacked: barPreset("col", "percentStacked"),
|
|
16
|
+
colClustered: barPreset("col", "clustered"),
|
|
17
|
+
colStacked: barPreset("col", "stacked"),
|
|
18
|
+
colPercentStacked: barPreset("col", "percentStacked"),
|
|
19
|
+
colStacked100: barPreset("col", "percentStacked"),
|
|
20
|
+
barClustered: barPreset("bar", "clustered"),
|
|
21
|
+
barStacked: barPreset("bar", "stacked"),
|
|
22
|
+
barPercentStacked: barPreset("bar", "percentStacked"),
|
|
23
|
+
barStacked100: barPreset("bar", "percentStacked"),
|
|
24
|
+
pieOfPie: { options: { type: "ofPie", ofPieType: "pie" } },
|
|
25
|
+
barOfPie: { options: { type: "ofPie", ofPieType: "bar" } },
|
|
26
|
+
column3DClustered: bar3DPreset("col", "clustered"),
|
|
27
|
+
column3DStacked: bar3DPreset("col", "stacked"),
|
|
28
|
+
column3DStacked100: bar3DPreset("col", "percentStacked"),
|
|
29
|
+
col3DClustered: bar3DPreset("col", "clustered"),
|
|
30
|
+
col3DStacked: bar3DPreset("col", "stacked"),
|
|
31
|
+
col3DStacked100: bar3DPreset("col", "percentStacked"),
|
|
32
|
+
bar3DClustered: bar3DPreset("bar", "clustered"),
|
|
33
|
+
bar3DStacked: bar3DPreset("bar", "stacked"),
|
|
34
|
+
bar3DStacked100: bar3DPreset("bar", "percentStacked"),
|
|
35
|
+
col3DConeClustered: bar3DPreset("col", "clustered", "cone"),
|
|
36
|
+
col3DConeStacked: bar3DPreset("col", "stacked", "cone"),
|
|
37
|
+
col3DConeStacked100: bar3DPreset("col", "percentStacked", "cone"),
|
|
38
|
+
coneColClustered: bar3DPreset("col", "clustered", "cone"),
|
|
39
|
+
coneColStacked: bar3DPreset("col", "stacked", "cone"),
|
|
40
|
+
coneColStacked100: bar3DPreset("col", "percentStacked", "cone"),
|
|
41
|
+
bar3DConeClustered: bar3DPreset("bar", "clustered", "cone"),
|
|
42
|
+
bar3DConeStacked: bar3DPreset("bar", "stacked", "cone"),
|
|
43
|
+
bar3DConeStacked100: bar3DPreset("bar", "percentStacked", "cone"),
|
|
44
|
+
coneBarClustered: bar3DPreset("bar", "clustered", "cone"),
|
|
45
|
+
coneBarStacked: bar3DPreset("bar", "stacked", "cone"),
|
|
46
|
+
coneBarStacked100: bar3DPreset("bar", "percentStacked", "cone"),
|
|
47
|
+
col3DCylinderClustered: bar3DPreset("col", "clustered", "cylinder"),
|
|
48
|
+
col3DCylinderStacked: bar3DPreset("col", "stacked", "cylinder"),
|
|
49
|
+
col3DCylinderStacked100: bar3DPreset("col", "percentStacked", "cylinder"),
|
|
50
|
+
cylinderColClustered: bar3DPreset("col", "clustered", "cylinder"),
|
|
51
|
+
cylinderColStacked: bar3DPreset("col", "stacked", "cylinder"),
|
|
52
|
+
cylinderColStacked100: bar3DPreset("col", "percentStacked", "cylinder"),
|
|
53
|
+
bar3DCylinderClustered: bar3DPreset("bar", "clustered", "cylinder"),
|
|
54
|
+
bar3DCylinderStacked: bar3DPreset("bar", "stacked", "cylinder"),
|
|
55
|
+
bar3DCylinderStacked100: bar3DPreset("bar", "percentStacked", "cylinder"),
|
|
56
|
+
cylinderBarClustered: bar3DPreset("bar", "clustered", "cylinder"),
|
|
57
|
+
cylinderBarStacked: bar3DPreset("bar", "stacked", "cylinder"),
|
|
58
|
+
cylinderBarStacked100: bar3DPreset("bar", "percentStacked", "cylinder"),
|
|
59
|
+
col3DPyramidClustered: bar3DPreset("col", "clustered", "pyramid"),
|
|
60
|
+
col3DPyramidStacked: bar3DPreset("col", "stacked", "pyramid"),
|
|
61
|
+
col3DPyramidStacked100: bar3DPreset("col", "percentStacked", "pyramid"),
|
|
62
|
+
pyramidColClustered: bar3DPreset("col", "clustered", "pyramid"),
|
|
63
|
+
pyramidColStacked: bar3DPreset("col", "stacked", "pyramid"),
|
|
64
|
+
pyramidColStacked100: bar3DPreset("col", "percentStacked", "pyramid"),
|
|
65
|
+
bar3DPyramidClustered: bar3DPreset("bar", "clustered", "pyramid"),
|
|
66
|
+
bar3DPyramidStacked: bar3DPreset("bar", "stacked", "pyramid"),
|
|
67
|
+
bar3DPyramidStacked100: bar3DPreset("bar", "percentStacked", "pyramid"),
|
|
68
|
+
pyramidBarClustered: bar3DPreset("bar", "clustered", "pyramid"),
|
|
69
|
+
pyramidBarStacked: bar3DPreset("bar", "stacked", "pyramid"),
|
|
70
|
+
pyramidBarStacked100: bar3DPreset("bar", "percentStacked", "pyramid"),
|
|
71
|
+
line: { options: { type: "line" } },
|
|
72
|
+
lineMarkers: { options: { type: "line", showMarker: true } },
|
|
73
|
+
lineStacked: { options: { type: "line", grouping: "stacked" } },
|
|
74
|
+
lineStacked100: { options: { type: "line", grouping: "percentStacked" } },
|
|
75
|
+
pie: { options: { type: "pie" } },
|
|
76
|
+
pieExploded: { options: { type: "pie" }, seriesDefaults: { explosion: 25 } },
|
|
77
|
+
pie3D: { options: { type: "pie3D" } },
|
|
78
|
+
pieExploded3D: { options: { type: "pie3D" }, seriesDefaults: { explosion: 25 } },
|
|
79
|
+
doughnut: { options: { type: "doughnut" } },
|
|
80
|
+
doughnutExploded: {
|
|
81
|
+
options: { type: "doughnut", holeSize: 50 },
|
|
82
|
+
seriesDefaults: { explosion: 25 }
|
|
83
|
+
},
|
|
84
|
+
area: { options: { type: "area" } },
|
|
85
|
+
areaStacked: { options: { type: "area", grouping: "stacked" } },
|
|
86
|
+
areaStacked100: { options: { type: "area", grouping: "percentStacked" } },
|
|
87
|
+
area3D: { options: { type: "area3D" } },
|
|
88
|
+
area3DStacked: { options: { type: "area3D", grouping: "stacked" } },
|
|
89
|
+
area3DStacked100: { options: { type: "area3D", grouping: "percentStacked" } },
|
|
90
|
+
scatter: { options: { type: "scatter", scatterStyle: "marker" } },
|
|
91
|
+
scatterMarker: { options: { type: "scatter", scatterStyle: "marker" } },
|
|
92
|
+
scatterStraight: { options: { type: "scatter", scatterStyle: "lineMarker" } },
|
|
93
|
+
scatterLines: { options: { type: "scatter", scatterStyle: "lineMarker" } },
|
|
94
|
+
scatterLinesNoMarkers: { options: { type: "scatter", scatterStyle: "line" } },
|
|
95
|
+
scatterSmooth: { options: { type: "scatter", scatterStyle: "smoothMarker" } },
|
|
96
|
+
scatterSmoothMarker: { options: { type: "scatter", scatterStyle: "smoothMarker" } },
|
|
97
|
+
scatterSmoothNoMarkers: { options: { type: "scatter", scatterStyle: "smooth" } },
|
|
98
|
+
bubble: { options: { type: "bubble" } },
|
|
99
|
+
bubble3D: { options: { type: "bubble" }, seriesDefaults: { bubble3D: true } },
|
|
100
|
+
radar: { options: { type: "radar", radarStyle: "standard" } },
|
|
101
|
+
radarMarkers: { options: { type: "radar", radarStyle: "marker" } },
|
|
102
|
+
radarFilled: { options: { type: "radar", radarStyle: "filled" } },
|
|
103
|
+
stockHLC: { options: { type: "stock", hiLowLines: true } },
|
|
104
|
+
stockOHLC: { options: { type: "stock", upDownBars: true, hiLowLines: true } },
|
|
105
|
+
// `stockVHLC` / `stockVOHLC` (Volume-HLC / Volume-OHLC) used to be
|
|
106
|
+
// accepted here, but they require a combo chart (a column chart for
|
|
107
|
+
// volume layered on top of an HLC / OHLC stock chart) that a
|
|
108
|
+
// single `AddChartOptions` cannot express. Quietly aliasing them to
|
|
109
|
+
// the non-volume variants produced a chart that looked wrong
|
|
110
|
+
// without telling the caller. Build the combo manually via
|
|
111
|
+
// `buildComboChartModel({ groups: [{ type: "bar", barDir: "col", ... },
|
|
112
|
+
// { type: "stock", hiLowLines: true, useSecondaryAxis: true, ... }] })`
|
|
113
|
+
// when you need the volume overlay.
|
|
114
|
+
surface: { options: { type: "surface" } },
|
|
115
|
+
surface3D: { options: { type: "surface3D" } },
|
|
116
|
+
// "Top View" in Excel's surface submenu is just a `surface3D` chart
|
|
117
|
+
// rotated to look straight down — same chart type, same series
|
|
118
|
+
// layout, different `view3D` angles. Setting `rotX: 90` spins the
|
|
119
|
+
// camera down onto the XY plane; `rotY: 0` removes the side tilt
|
|
120
|
+
// so the grid reads as a flat mosaic instead of an oblique slab.
|
|
121
|
+
// The resulting chart opens in Excel with the correct camera, and
|
|
122
|
+
// our own renderer projects it via `resolveBar3DProjection` /
|
|
123
|
+
// surface cells without any preset-specific branching.
|
|
124
|
+
surfaceTopView: { options: { type: "surface3D", view3D: { rotX: 90, rotY: 0 } } },
|
|
125
|
+
// A flat 2-D surface (no `view3D`) IS Excel's "Contour" chart.
|
|
126
|
+
// Keeping the preset as `surface` matches Excel's own internal
|
|
127
|
+
// representation — `c:surfaceChart` without `c:view3D` is how
|
|
128
|
+
// Excel serialises a contour chart authored from the UI.
|
|
129
|
+
contour: { options: { type: "surface" } },
|
|
130
|
+
wireframeSurface: { options: { type: "surface3D", wireframe: true } },
|
|
131
|
+
surface3DWireframe: { options: { type: "surface3D", wireframe: true } },
|
|
132
|
+
surfaceWireframe: { options: { type: "surface3D", wireframe: true } },
|
|
133
|
+
wireframeContour: { options: { type: "surface", wireframe: true } },
|
|
134
|
+
topViewWireframe: {
|
|
135
|
+
options: { type: "surface3D", wireframe: true, view3D: { rotX: 90, rotY: 0 } }
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export const EXCEL_CHART_PRESETS = Object.keys(CHART_PRESETS);
|
|
139
|
+
export const CHART_EX_PRESETS = {
|
|
140
|
+
histogram: { options: { type: "histogram" } },
|
|
141
|
+
pareto: { options: { type: "pareto" } },
|
|
142
|
+
waterfall: { options: { type: "waterfall" } },
|
|
143
|
+
funnel: { options: { type: "funnel" } },
|
|
144
|
+
treemap: { options: { type: "treemap" } },
|
|
145
|
+
sunburst: { options: { type: "sunburst" } },
|
|
146
|
+
boxWhisker: { options: { type: "boxWhisker" } },
|
|
147
|
+
boxAndWhisker: { options: { type: "boxWhisker" } },
|
|
148
|
+
regionMap: { options: { type: "regionMap" } },
|
|
149
|
+
map: { options: { type: "regionMap" } }
|
|
150
|
+
};
|
|
151
|
+
export const EXCEL_CHART_EX_PRESETS = Object.keys(CHART_EX_PRESETS);
|
|
152
|
+
export function applyChartPreset(preset, options) {
|
|
153
|
+
const config = CHART_PRESETS[preset];
|
|
154
|
+
if (!config) {
|
|
155
|
+
throw new ChartOptionsError(`Unknown chart preset: ${preset}.`);
|
|
156
|
+
}
|
|
157
|
+
// `type` is required on `PresetConfig.options`, so this assignment is
|
|
158
|
+
// type-safe without a non-null assertion.
|
|
159
|
+
const merged = {
|
|
160
|
+
...config.options,
|
|
161
|
+
...options,
|
|
162
|
+
type: options.type ?? config.options.type
|
|
163
|
+
};
|
|
164
|
+
if (config.seriesDefaults && merged.series) {
|
|
165
|
+
merged.series = merged.series.map(series => ({ ...config.seriesDefaults, ...series }));
|
|
166
|
+
}
|
|
167
|
+
return merged;
|
|
168
|
+
}
|
|
169
|
+
export function applyChartExPreset(preset, options) {
|
|
170
|
+
const config = CHART_EX_PRESETS[preset];
|
|
171
|
+
if (!config) {
|
|
172
|
+
throw new ChartOptionsError(`Unknown chartEx preset: ${preset}.`);
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
...config.options,
|
|
176
|
+
...options,
|
|
177
|
+
type: options.type ?? config.options.type
|
|
178
|
+
};
|
|
179
|
+
}
|