pptx-templates 0.0.0-stage → 0.1.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/AI-INSTRUCTOR.md +2253 -0
- package/CHANGELOG.md +49 -0
- package/LICENSE +23 -0
- package/README.md +86 -2
- package/dist/automizer.d.ts +224 -0
- package/dist/automizer.js +704 -0
- package/dist/automizer.js.map +1 -0
- package/dist/classes/content-type-registry.d.ts +46 -0
- package/dist/classes/content-type-registry.js +170 -0
- package/dist/classes/content-type-registry.js.map +1 -0
- package/dist/classes/element-importer.d.ts +49 -0
- package/dist/classes/element-importer.js +254 -0
- package/dist/classes/element-importer.js.map +1 -0
- package/dist/classes/has-shapes.d.ts +286 -0
- package/dist/classes/has-shapes.js +385 -0
- package/dist/classes/has-shapes.js.map +1 -0
- package/dist/classes/layout.d.ts +42 -0
- package/dist/classes/layout.js +113 -0
- package/dist/classes/layout.js.map +1 -0
- package/dist/classes/master.d.ts +45 -0
- package/dist/classes/master.js +146 -0
- package/dist/classes/master.js.map +1 -0
- package/dist/classes/placeholder-normalizer.d.ts +42 -0
- package/dist/classes/placeholder-normalizer.js +136 -0
- package/dist/classes/placeholder-normalizer.js.map +1 -0
- package/dist/classes/related-content-copier.d.ts +18 -0
- package/dist/classes/related-content-copier.js +114 -0
- package/dist/classes/related-content-copier.js.map +1 -0
- package/dist/classes/shape.d.ts +62 -0
- package/dist/classes/shape.js +194 -0
- package/dist/classes/shape.js.map +1 -0
- package/dist/classes/slide-master-remover.d.ts +44 -0
- package/dist/classes/slide-master-remover.js +201 -0
- package/dist/classes/slide-master-remover.js.map +1 -0
- package/dist/classes/slide-notes-copier.d.ts +26 -0
- package/dist/classes/slide-notes-copier.js +76 -0
- package/dist/classes/slide-notes-copier.js.map +1 -0
- package/dist/classes/slide.d.ts +91 -0
- package/dist/classes/slide.js +286 -0
- package/dist/classes/slide.js.map +1 -0
- package/dist/classes/template.d.ts +137 -0
- package/dist/classes/template.js +311 -0
- package/dist/classes/template.js.map +1 -0
- package/dist/constants/constants.d.ts +11 -0
- package/dist/constants/constants.js +182 -0
- package/dist/constants/constants.js.map +1 -0
- package/dist/enums/chart-type.d.ts +11 -0
- package/dist/enums/chart-type.js +16 -0
- package/dist/enums/chart-type.js.map +1 -0
- package/dist/enums/content-type-map.d.ts +16 -0
- package/dist/enums/content-type-map.js +23 -0
- package/dist/enums/content-type-map.js.map +1 -0
- package/dist/enums/element-type.d.ts +14 -0
- package/dist/enums/element-type.js +20 -0
- package/dist/enums/element-type.js.map +1 -0
- package/dist/errors.d.ts +81 -0
- package/dist/errors.js +100 -0
- package/dist/errors.js.map +1 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/index.js +31 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/pptxgenjs-compat/img-broken-png.d.ts +5 -0
- package/dist/extensions/pptxgenjs-compat/img-broken-png.js +9 -0
- package/dist/extensions/pptxgenjs-compat/img-broken-png.js.map +1 -0
- package/dist/extensions/pptxgenjs-compat/index.d.ts +5 -0
- package/dist/extensions/pptxgenjs-compat/index.js +10 -0
- package/dist/extensions/pptxgenjs-compat/index.js.map +1 -0
- package/dist/extensions/pptxgenjs-compat/svg-fallback.d.ts +14 -0
- package/dist/extensions/pptxgenjs-compat/svg-fallback.js +139 -0
- package/dist/extensions/pptxgenjs-compat/svg-fallback.js.map +1 -0
- package/dist/extensions/template-logic/commands.d.ts +22 -0
- package/dist/extensions/template-logic/commands.js +83 -0
- package/dist/extensions/template-logic/commands.js.map +1 -0
- package/dist/extensions/template-logic/expression.d.ts +61 -0
- package/dist/extensions/template-logic/expression.js +499 -0
- package/dist/extensions/template-logic/expression.js.map +1 -0
- package/dist/extensions/template-logic/images.d.ts +26 -0
- package/dist/extensions/template-logic/images.js +183 -0
- package/dist/extensions/template-logic/images.js.map +1 -0
- package/dist/extensions/template-logic/index.d.ts +14 -0
- package/dist/extensions/template-logic/index.js +64 -0
- package/dist/extensions/template-logic/index.js.map +1 -0
- package/dist/extensions/template-logic/list-commands.d.ts +9 -0
- package/dist/extensions/template-logic/list-commands.js +72 -0
- package/dist/extensions/template-logic/list-commands.js.map +1 -0
- package/dist/extensions/template-logic/renderer.d.ts +85 -0
- package/dist/extensions/template-logic/renderer.js +867 -0
- package/dist/extensions/template-logic/renderer.js.map +1 -0
- package/dist/extensions/template-logic/types.d.ts +62 -0
- package/dist/extensions/template-logic/types.js +3 -0
- package/dist/extensions/template-logic/types.js.map +1 -0
- package/dist/helper/archive/archive-fs.d.ts +45 -0
- package/dist/helper/archive/archive-fs.js +206 -0
- package/dist/helper/archive/archive-fs.js.map +1 -0
- package/dist/helper/archive/archive-jszip.d.ts +31 -0
- package/dist/helper/archive/archive-jszip.js +173 -0
- package/dist/helper/archive/archive-jszip.js.map +1 -0
- package/dist/helper/archive/archive.d.ts +27 -0
- package/dist/helper/archive/archive.js +78 -0
- package/dist/helper/archive/archive.js.map +1 -0
- package/dist/helper/cell-id-helper.d.ts +25 -0
- package/dist/helper/cell-id-helper.js +95 -0
- package/dist/helper/cell-id-helper.js.map +1 -0
- package/dist/helper/compute-src-rect.d.ts +9 -0
- package/dist/helper/compute-src-rect.js +52 -0
- package/dist/helper/compute-src-rect.js.map +1 -0
- package/dist/helper/content-tracker.d.ts +31 -0
- package/dist/helper/content-tracker.js +227 -0
- package/dist/helper/content-tracker.js.map +1 -0
- package/dist/helper/count-helper.d.ts +33 -0
- package/dist/helper/count-helper.js +140 -0
- package/dist/helper/count-helper.js.map +1 -0
- package/dist/helper/css-style-parser.d.ts +52 -0
- package/dist/helper/css-style-parser.js +246 -0
- package/dist/helper/css-style-parser.js.map +1 -0
- package/dist/helper/file-helper.d.ts +36 -0
- package/dist/helper/file-helper.js +150 -0
- package/dist/helper/file-helper.js.map +1 -0
- package/dist/helper/general-helper.d.ts +6 -0
- package/dist/helper/general-helper.js +34 -0
- package/dist/helper/general-helper.js.map +1 -0
- package/dist/helper/generate/generate-pptxgenjs.d.ts +37 -0
- package/dist/helper/generate/generate-pptxgenjs.js +134 -0
- package/dist/helper/generate/generate-pptxgenjs.js.map +1 -0
- package/dist/helper/html-to-multitext-helper.d.ts +84 -0
- package/dist/helper/html-to-multitext-helper.js +490 -0
- package/dist/helper/html-to-multitext-helper.js.map +1 -0
- package/dist/helper/hyperlink-processor.d.ts +54 -0
- package/dist/helper/hyperlink-processor.js +289 -0
- package/dist/helper/hyperlink-processor.js.map +1 -0
- package/dist/helper/image-dimensions.d.ts +21 -0
- package/dist/helper/image-dimensions.js +202 -0
- package/dist/helper/image-dimensions.js.map +1 -0
- package/dist/helper/jszip-helper.d.ts +21 -0
- package/dist/helper/jszip-helper.js +162 -0
- package/dist/helper/jszip-helper.js.map +1 -0
- package/dist/helper/layout-index.d.ts +55 -0
- package/dist/helper/layout-index.js +155 -0
- package/dist/helper/layout-index.js.map +1 -0
- package/dist/helper/logger.d.ts +53 -0
- package/dist/helper/logger.js +73 -0
- package/dist/helper/logger.js.map +1 -0
- package/dist/helper/media-deduplicator.d.ts +42 -0
- package/dist/helper/media-deduplicator.js +88 -0
- package/dist/helper/media-deduplicator.js.map +1 -0
- package/dist/helper/modify-background-helper.d.ts +19 -0
- package/dist/helper/modify-background-helper.js +59 -0
- package/dist/helper/modify-background-helper.js.map +1 -0
- package/dist/helper/modify-chart-helper.d.ts +159 -0
- package/dist/helper/modify-chart-helper.js +642 -0
- package/dist/helper/modify-chart-helper.js.map +1 -0
- package/dist/helper/modify-cleanup-helper.d.ts +69 -0
- package/dist/helper/modify-cleanup-helper.js +343 -0
- package/dist/helper/modify-cleanup-helper.js.map +1 -0
- package/dist/helper/modify-color-helper.d.ts +35 -0
- package/dist/helper/modify-color-helper.js +211 -0
- package/dist/helper/modify-color-helper.js.map +1 -0
- package/dist/helper/modify-helper.d.ts +23 -0
- package/dist/helper/modify-helper.js +61 -0
- package/dist/helper/modify-helper.js.map +1 -0
- package/dist/helper/modify-hyperlink-element.d.ts +9 -0
- package/dist/helper/modify-hyperlink-element.js +34 -0
- package/dist/helper/modify-hyperlink-element.js.map +1 -0
- package/dist/helper/modify-hyperlink-helper.d.ts +42 -0
- package/dist/helper/modify-hyperlink-helper.js +258 -0
- package/dist/helper/modify-hyperlink-helper.js.map +1 -0
- package/dist/helper/modify-image-helper.d.ts +23 -0
- package/dist/helper/modify-image-helper.js +157 -0
- package/dist/helper/modify-image-helper.js.map +1 -0
- package/dist/helper/modify-presentation-helper.d.ts +55 -0
- package/dist/helper/modify-presentation-helper.js +177 -0
- package/dist/helper/modify-presentation-helper.js.map +1 -0
- package/dist/helper/modify-shape-helper.d.ts +111 -0
- package/dist/helper/modify-shape-helper.js +340 -0
- package/dist/helper/modify-shape-helper.js.map +1 -0
- package/dist/helper/modify-table-helper.d.ts +11 -0
- package/dist/helper/modify-table-helper.js +100 -0
- package/dist/helper/modify-table-helper.js.map +1 -0
- package/dist/helper/modify-text-helper.d.ts +62 -0
- package/dist/helper/modify-text-helper.js +244 -0
- package/dist/helper/modify-text-helper.js.map +1 -0
- package/dist/helper/modify-xml-helper.d.ts +52 -0
- package/dist/helper/modify-xml-helper.js +305 -0
- package/dist/helper/modify-xml-helper.js.map +1 -0
- package/dist/helper/multitext-helper.d.ts +116 -0
- package/dist/helper/multitext-helper.js +462 -0
- package/dist/helper/multitext-helper.js.map +1 -0
- package/dist/helper/ppt-paths.d.ts +76 -0
- package/dist/helper/ppt-paths.js +116 -0
- package/dist/helper/ppt-paths.js.map +1 -0
- package/dist/helper/shape-type-detector.d.ts +34 -0
- package/dist/helper/shape-type-detector.js +99 -0
- package/dist/helper/shape-type-detector.js.map +1 -0
- package/dist/helper/text-replace-helper.d.ts +30 -0
- package/dist/helper/text-replace-helper.js +147 -0
- package/dist/helper/text-replace-helper.js.map +1 -0
- package/dist/helper/xml/lnLRTB.d.ts +1 -0
- package/dist/helper/xml/lnLRTB.js +62 -0
- package/dist/helper/xml/lnLRTB.js.map +1 -0
- package/dist/helper/xml/prstGeom.d.ts +1 -0
- package/dist/helper/xml/prstGeom.js +11 -0
- package/dist/helper/xml/prstGeom.js.map +1 -0
- package/dist/helper/xml-elements.d.ts +134 -0
- package/dist/helper/xml-elements.js +538 -0
- package/dist/helper/xml-elements.js.map +1 -0
- package/dist/helper/xml-helper.d.ts +120 -0
- package/dist/helper/xml-helper.js +495 -0
- package/dist/helper/xml-helper.js.map +1 -0
- package/dist/helper/xml-placeholder-helper.d.ts +92 -0
- package/dist/helper/xml-placeholder-helper.js +454 -0
- package/dist/helper/xml-placeholder-helper.js.map +1 -0
- package/dist/helper/xml-pretty-print.d.ts +17 -0
- package/dist/helper/xml-pretty-print.js +88 -0
- package/dist/helper/xml-pretty-print.js.map +1 -0
- package/dist/helper/xml-relationship-helper.d.ts +103 -0
- package/dist/helper/xml-relationship-helper.js +397 -0
- package/dist/helper/xml-relationship-helper.js.map +1 -0
- package/dist/helper/xml-slide-helper.d.ts +107 -0
- package/dist/helper/xml-slide-helper.js +676 -0
- package/dist/helper/xml-slide-helper.js.map +1 -0
- package/dist/helper/xml-template-helper.d.ts +42 -0
- package/dist/helper/xml-template-helper.js +252 -0
- package/dist/helper/xml-template-helper.js.map +1 -0
- package/dist/helper/xmldom-sax-patch.d.ts +18 -0
- package/dist/helper/xmldom-sax-patch.js +58 -0
- package/dist/helper/xmldom-sax-patch.js.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +177 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/iarchive.d.ts +43 -0
- package/dist/interfaces/iarchive.js +3 -0
- package/dist/interfaces/iarchive.js.map +1 -0
- package/dist/interfaces/ichart.d.ts +7 -0
- package/dist/interfaces/ichart.js +3 -0
- package/dist/interfaces/ichart.js.map +1 -0
- package/dist/interfaces/icounter.d.ts +7 -0
- package/dist/interfaces/icounter.js +3 -0
- package/dist/interfaces/icounter.js.map +1 -0
- package/dist/interfaces/igenerator.d.ts +4 -0
- package/dist/interfaces/igenerator.js +3 -0
- package/dist/interfaces/igenerator.js.map +1 -0
- package/dist/interfaces/iimage.d.ts +7 -0
- package/dist/interfaces/iimage.js +3 -0
- package/dist/interfaces/iimage.js.map +1 -0
- package/dist/interfaces/ilayout.d.ts +14 -0
- package/dist/interfaces/ilayout.js +3 -0
- package/dist/interfaces/ilayout.js.map +1 -0
- package/dist/interfaces/imaster.d.ts +15 -0
- package/dist/interfaces/imaster.js +3 -0
- package/dist/interfaces/imaster.js.map +1 -0
- package/dist/interfaces/imulti-text.d.ts +50 -0
- package/dist/interfaces/imulti-text.js +3 -0
- package/dist/interfaces/imulti-text.js.map +1 -0
- package/dist/interfaces/ipptxgenjs-slide.d.ts +40 -0
- package/dist/interfaces/ipptxgenjs-slide.js +3 -0
- package/dist/interfaces/ipptxgenjs-slide.js.map +1 -0
- package/dist/interfaces/ipresentation-props.d.ts +16 -0
- package/dist/interfaces/ipresentation-props.js +3 -0
- package/dist/interfaces/ipresentation-props.js.map +1 -0
- package/dist/interfaces/ishape-action.d.ts +18 -0
- package/dist/interfaces/ishape-action.js +3 -0
- package/dist/interfaces/ishape-action.js.map +1 -0
- package/dist/interfaces/ishape.d.ts +5 -0
- package/dist/interfaces/ishape.js +3 -0
- package/dist/interfaces/ishape.js.map +1 -0
- package/dist/interfaces/islide.d.ts +71 -0
- package/dist/interfaces/islide.js +3 -0
- package/dist/interfaces/islide.js.map +1 -0
- package/dist/interfaces/itemplate.d.ts +9 -0
- package/dist/interfaces/itemplate.js +3 -0
- package/dist/interfaces/itemplate.js.map +1 -0
- package/dist/interfaces/pres-template.d.ts +9 -0
- package/dist/interfaces/pres-template.js +3 -0
- package/dist/interfaces/pres-template.js.map +1 -0
- package/dist/interfaces/root-pres-template.d.ts +38 -0
- package/dist/interfaces/root-pres-template.js +3 -0
- package/dist/interfaces/root-pres-template.js.map +1 -0
- package/dist/modify/modify-chart.d.ts +74 -0
- package/dist/modify/modify-chart.js +753 -0
- package/dist/modify/modify-chart.js.map +1 -0
- package/dist/modify/modify-table.d.ts +64 -0
- package/dist/modify/modify-table.js +435 -0
- package/dist/modify/modify-table.js.map +1 -0
- package/dist/shapes/chart.d.ts +91 -0
- package/dist/shapes/chart.js +437 -0
- package/dist/shapes/chart.js.map +1 -0
- package/dist/shapes/diagram.d.ts +33 -0
- package/dist/shapes/diagram.js +167 -0
- package/dist/shapes/diagram.js.map +1 -0
- package/dist/shapes/generic.d.ts +27 -0
- package/dist/shapes/generic.js +118 -0
- package/dist/shapes/generic.js.map +1 -0
- package/dist/shapes/hyperlink.d.ts +27 -0
- package/dist/shapes/hyperlink.js +193 -0
- package/dist/shapes/hyperlink.js.map +1 -0
- package/dist/shapes/image.d.ts +47 -0
- package/dist/shapes/image.js +244 -0
- package/dist/shapes/image.js.map +1 -0
- package/dist/shapes/ole.d.ts +30 -0
- package/dist/shapes/ole.js +237 -0
- package/dist/shapes/ole.js.map +1 -0
- package/dist/types/chart-types.d.ts +115 -0
- package/dist/types/chart-types.js +3 -0
- package/dist/types/chart-types.js.map +1 -0
- package/dist/types/modify-types.d.ts +128 -0
- package/dist/types/modify-types.js +3 -0
- package/dist/types/modify-types.js.map +1 -0
- package/dist/types/shape-types.d.ts +40 -0
- package/dist/types/shape-types.js +3 -0
- package/dist/types/shape-types.js.map +1 -0
- package/dist/types/table-types.d.ts +38 -0
- package/dist/types/table-types.js +3 -0
- package/dist/types/table-types.js.map +1 -0
- package/dist/types/types.d.ts +317 -0
- package/dist/types/types.js +16 -0
- package/dist/types/types.js.map +1 -0
- package/dist/types/xml-types.d.ts +168 -0
- package/dist/types/xml-types.js +3 -0
- package/dist/types/xml-types.js.map +1 -0
- package/package.json +92 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { XmlDocument } from '../types/xml-types';
|
|
2
|
+
import { Color } from '../types/modify-types';
|
|
3
|
+
import { IMaster } from '../index';
|
|
4
|
+
export default class ModifyBackgroundHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Set solid fill of master background
|
|
7
|
+
*/
|
|
8
|
+
static setSolidFill: (color: Color) => (slideMasterXml: XmlDocument) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Modify a slideMaster background image's relation target
|
|
11
|
+
* @param master
|
|
12
|
+
* @param imageName
|
|
13
|
+
*/
|
|
14
|
+
static setRelationTarget: (master: IMaster, imageName: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Extract background properties from slideMaster xml
|
|
17
|
+
*/
|
|
18
|
+
static getBackgroundProperties: (slideMasterXml: XmlDocument) => string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const errors_1 = require("../errors");
|
|
7
|
+
const modify_color_helper_1 = __importDefault(require("./modify-color-helper"));
|
|
8
|
+
const xml_helper_1 = require("./xml-helper");
|
|
9
|
+
const index_1 = require("../index");
|
|
10
|
+
class ModifyBackgroundHelper {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Set solid fill of master background
|
|
14
|
+
*/
|
|
15
|
+
ModifyBackgroundHelper.setSolidFill = (color) => (slideMasterXml) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const bgPr = (_a = slideMasterXml.getElementsByTagName('p:bgPr')) === null || _a === void 0 ? void 0 : _a.item(0);
|
|
18
|
+
if (bgPr) {
|
|
19
|
+
modify_color_helper_1.default.solidFill(color)(bgPr);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
throw new errors_1.ElementNotFoundError('No background properties (p:bgPr) found on slideMaster', { selector: 'p:bgPr' });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Modify a slideMaster background image's relation target
|
|
27
|
+
* @param master
|
|
28
|
+
* @param imageName
|
|
29
|
+
*/
|
|
30
|
+
ModifyBackgroundHelper.setRelationTarget = (master, imageName) => {
|
|
31
|
+
let targetRelation = '';
|
|
32
|
+
master.modify((masterXml) => {
|
|
33
|
+
targetRelation =
|
|
34
|
+
ModifyBackgroundHelper.getBackgroundProperties(masterXml);
|
|
35
|
+
});
|
|
36
|
+
master.modifyRelations((relXml) => {
|
|
37
|
+
const relations = xml_helper_1.XmlHelper.findByAttributeValue(relXml.getElementsByTagName('Relationship'), 'Id', targetRelation);
|
|
38
|
+
if (relations[0]) {
|
|
39
|
+
index_1.ModifyImageHelper.setRelationTarget(imageName)(undefined, relations[0]);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Extract background properties from slideMaster xml
|
|
45
|
+
*/
|
|
46
|
+
ModifyBackgroundHelper.getBackgroundProperties = (slideMasterXml) => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const bgPr = (_a = slideMasterXml.getElementsByTagName('p:bgPr')) === null || _a === void 0 ? void 0 : _a.item(0);
|
|
49
|
+
if (bgPr) {
|
|
50
|
+
const blip = (_b = bgPr
|
|
51
|
+
.getElementsByTagName('a:blip')) === null || _b === void 0 ? void 0 : _b.item(0).getAttribute('r:embed');
|
|
52
|
+
return blip;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
throw new errors_1.ElementNotFoundError('No background properties (p:bgPr) found on slideMaster', { selector: 'p:bgPr' });
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.default = ModifyBackgroundHelper;
|
|
59
|
+
//# sourceMappingURL=modify-background-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modify-background-helper.js","sourceRoot":"","sources":["../../src/helper/modify-background-helper.ts"],"names":[],"mappings":";;;;;AAAA,sCAAiD;AAEjD,gFAAsD;AAEtD,6CAAyC;AACzC,oCAAsD;AAEtD,MAAqB,sBAAsB;;AACzC;;GAEG;AACI,mCAAY,GACjB,CAAC,KAAY,EAAE,EAAE,CACjB,CAAC,cAA2B,EAAQ,EAAE;;IACpC,MAAM,IAAI,GAAG,MAAA,cAAc,CAAC,oBAAoB,CAAC,QAAQ,CAAC,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACpE,IAAI,IAAI,EAAE,CAAC;QACT,6BAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,6BAAoB,CAC5B,wDAAwD,EACxD,EAAE,QAAQ,EAAE,QAAQ,EAAE,CACvB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEJ;;;;GAIG;AACI,wCAAiB,GAAG,CAAC,MAAe,EAAE,SAAiB,EAAE,EAAE;IAChE,IAAI,cAAc,GAAG,EAAE,CAAC;IACxB,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE;QAC1B,cAAc;YACZ,sBAAsB,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,EAAE;QAChC,MAAM,SAAS,GAAG,sBAAS,CAAC,oBAAoB,CAC9C,MAAM,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAC3C,IAAI,EACJ,cAAc,CACf,CAAC;QACF,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACjB,yBAAiB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACI,8CAAuB,GAAG,CAAC,cAA2B,EAAU,EAAE;;IACvE,MAAM,IAAI,GAAG,MAAA,cAAc,CAAC,oBAAoB,CAAC,QAAQ,CAAC,0CAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACpE,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,IAAI,GAAG,MAAA,IAAI;aACd,oBAAoB,CAAC,QAAQ,CAAC,0CAC7B,IAAI,CAAC,CAAC,EACP,YAAY,CAAC,SAAS,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,6BAAoB,CAC1B,wDAAwD,EACxD,EAAE,QAAQ,EAAE,QAAQ,EAAE,CACvB,CAAC;IACN,CAAC;AACH,CAAC,CAAC;kBA1DiB,sBAAsB"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { ChartModificationCallback } from '../types/types';
|
|
2
|
+
import { ChartAxisRange, ChartData, ChartElementCoordinateShares, ChartInfo, ChartPointValue, ChartSeriesDataLabelAttributes, ChartValueStyle, WorkbookData } from '../types/chart-types';
|
|
3
|
+
import { XmlElement } from '../types/xml-types';
|
|
4
|
+
export default class ModifyChartHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Set chart data to modify default chart types.
|
|
7
|
+
* See `__tests__/modify-existing-chart.test.js`
|
|
8
|
+
*/
|
|
9
|
+
static setChartData: (data: ChartData) => ChartModificationCallback;
|
|
10
|
+
/**
|
|
11
|
+
* Set chart data to modify vertical line charts.
|
|
12
|
+
* See `__tests__/modify-chart-vertical-lines.test.js`
|
|
13
|
+
*/
|
|
14
|
+
static setChartVerticalLines: (data: ChartData) => ChartModificationCallback;
|
|
15
|
+
/**
|
|
16
|
+
* Set chart data to modify scatter charts.
|
|
17
|
+
* See `__tests__/modify-chart-scatter.test.js`
|
|
18
|
+
*/
|
|
19
|
+
static setChartScatter: (data: ChartData) => ChartModificationCallback;
|
|
20
|
+
/**
|
|
21
|
+
* Set chart data to modify combo charts.
|
|
22
|
+
* This type is prepared for
|
|
23
|
+
* first series: bar chart (e.g. total)
|
|
24
|
+
* other series: vertical lines
|
|
25
|
+
* See `__tests__/modify-chart-scatter.test.js`
|
|
26
|
+
*/
|
|
27
|
+
static setChartCombo: (data: ChartData) => ChartModificationCallback;
|
|
28
|
+
/**
|
|
29
|
+
* Set chart data to modify bubble charts.
|
|
30
|
+
* See `__tests__/modify-chart-bubbles.test.js`
|
|
31
|
+
*/
|
|
32
|
+
static setChartBubbles: (data: ChartData) => ChartModificationCallback;
|
|
33
|
+
/**
|
|
34
|
+
* Set chart data to modify extended chart types.
|
|
35
|
+
* See `__tests__/modify-existing-extended-chart.test.js`
|
|
36
|
+
*/
|
|
37
|
+
static setExtendedChartData: (data: ChartData) => ChartModificationCallback;
|
|
38
|
+
/**
|
|
39
|
+
* Read chart workbook data
|
|
40
|
+
* See `__tests__/read-chart-data.test.js`
|
|
41
|
+
*/
|
|
42
|
+
static readWorkbookData: (data: WorkbookData) => ChartModificationCallback;
|
|
43
|
+
/**
|
|
44
|
+
* Read chart info
|
|
45
|
+
* See `__tests__/read-chart-data.test.js`
|
|
46
|
+
*/
|
|
47
|
+
static readChartInfo: (info: ChartInfo) => ChartModificationCallback;
|
|
48
|
+
/**
|
|
49
|
+
* Set range and format for chart axis.
|
|
50
|
+
* Please notice: It will only work if the value to update is not set to
|
|
51
|
+
* "Auto" in powerpoint. Only manually scaled min/max can be altered by this.
|
|
52
|
+
* See `__tests__/modify-chart-axis.test.js`
|
|
53
|
+
*/
|
|
54
|
+
static setAxisRange: (range: ChartAxisRange) => ChartModificationCallback;
|
|
55
|
+
static setAxisAttribute: (element: XmlElement, tag: string, value: string | number | boolean, attribute?: string) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Set legend coordinates to zero. Could be advantageous for pptx users to
|
|
58
|
+
* be able to maximize a legend easily. Legend will still be selectible for
|
|
59
|
+
* a user.
|
|
60
|
+
*/
|
|
61
|
+
static minimizeChartLegend: () => ChartModificationCallback;
|
|
62
|
+
/**
|
|
63
|
+
* Completely remove a chart legend. Please notice: This will trigger
|
|
64
|
+
* PowerPoint to automatically maximize chart space.
|
|
65
|
+
*/
|
|
66
|
+
static removeChartLegend: () => ChartModificationCallback;
|
|
67
|
+
/**
|
|
68
|
+
* Update the coordinates of a chart legend.
|
|
69
|
+
* legendArea coordinates are shares of chart coordinates, e.g.
|
|
70
|
+
* "w: 0.5" means "half of chart width"
|
|
71
|
+
* @param legendArea
|
|
72
|
+
*/
|
|
73
|
+
static setLegendPosition: (legendArea: ChartElementCoordinateShares) => ChartModificationCallback;
|
|
74
|
+
/**
|
|
75
|
+
* Set the plot area coordinates of a chart.
|
|
76
|
+
*
|
|
77
|
+
* This modifier requires a 'c:manualLayout' element. It will only appear if
|
|
78
|
+
* plot area coordinates are edited manually in ppt before. Recently fresh
|
|
79
|
+
* created charts will not have a manualLayout by default.
|
|
80
|
+
*
|
|
81
|
+
* This is especially useful if you have problems with edgy elements on a
|
|
82
|
+
* chart area that do not fit into the given space, e.g. when having a lot
|
|
83
|
+
* of data labels. You can increase the chart and decrease the plot area
|
|
84
|
+
* to create a margin.
|
|
85
|
+
*
|
|
86
|
+
* plotArea coordinates are shares of chart coordinates, e.g.
|
|
87
|
+
* "w: 0.5" means "half of chart width"
|
|
88
|
+
*
|
|
89
|
+
* @param plotArea
|
|
90
|
+
*/
|
|
91
|
+
static setPlotArea: (plotArea: ChartElementCoordinateShares) => ChartModificationCallback;
|
|
92
|
+
/**
|
|
93
|
+
* Set a waterfall Total column to last
|
|
94
|
+
* you may also optionally specify a different index.
|
|
95
|
+
@param TotalColumnIDX
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
static setWaterFallColumnTotalToLast: (TotalColumnIDX?: number) => ChartModificationCallback;
|
|
99
|
+
/**
|
|
100
|
+
* Set the title of a chart. This requires an already existing, manually edited chart title.
|
|
101
|
+
@param newTitle
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
static setChartTitle: (newTitle: string) => ChartModificationCallback;
|
|
105
|
+
/**
|
|
106
|
+
* Remove datalabels of a chart.
|
|
107
|
+
*/
|
|
108
|
+
static removeDataLabels: () => ChartModificationCallback;
|
|
109
|
+
static setPointLabelSuffix: (element: XmlElement, idx: number, labelStyle: ChartValueStyle["label"]) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Specify a format for DataLabels
|
|
112
|
+
@param dataLabel
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
static setDataLabelAttributes: (dataLabel: ChartSeriesDataLabelAttributes) => ChartModificationCallback;
|
|
116
|
+
static setDataPointLabelAttributes: (dataLabel: ChartSeriesDataLabelAttributes) => {
|
|
117
|
+
'c:spPr': {
|
|
118
|
+
isRequired: boolean;
|
|
119
|
+
modify: ((element: XmlElement) => void)[];
|
|
120
|
+
};
|
|
121
|
+
'c:numFmt': {
|
|
122
|
+
isRequired: boolean;
|
|
123
|
+
modify: ((element: XmlElement) => void)[];
|
|
124
|
+
};
|
|
125
|
+
'c:dLblPos': {
|
|
126
|
+
isRequired: boolean;
|
|
127
|
+
modify: ((element: XmlElement) => void)[];
|
|
128
|
+
};
|
|
129
|
+
'c:showLegendKey': {
|
|
130
|
+
isRequired: boolean;
|
|
131
|
+
modify: ((element: XmlElement) => void)[];
|
|
132
|
+
};
|
|
133
|
+
'c:showVal': {
|
|
134
|
+
isRequired: boolean;
|
|
135
|
+
modify: ((element: XmlElement) => void)[];
|
|
136
|
+
};
|
|
137
|
+
'c:showCatName': {
|
|
138
|
+
isRequired: boolean;
|
|
139
|
+
modify: ((element: XmlElement) => void)[];
|
|
140
|
+
};
|
|
141
|
+
'c:showSerName': {
|
|
142
|
+
isRequired: boolean;
|
|
143
|
+
modify: ((element: XmlElement) => void)[];
|
|
144
|
+
};
|
|
145
|
+
'c:showPercent': {
|
|
146
|
+
isRequired: boolean;
|
|
147
|
+
modify: ((element: XmlElement) => void)[];
|
|
148
|
+
};
|
|
149
|
+
'c:showBubbleSize': {
|
|
150
|
+
isRequired: boolean;
|
|
151
|
+
modify: ((element: XmlElement) => void)[];
|
|
152
|
+
};
|
|
153
|
+
'c:showLeaderLines': {
|
|
154
|
+
isRequired: boolean;
|
|
155
|
+
modify: ((element: XmlElement) => void)[];
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
static parseCellValue(value: string | ChartPointValue): string;
|
|
159
|
+
}
|