@difftim/excelize
Version:
Excel Workbook Manager - Read and Write xlsx and csv Files.
55 lines (54 loc) • 1.2 kB
JavaScript
const BaseXform = require('../base-xform');
const CChartXform = require('./c-chart-xform');
class AGraphicDataXform extends BaseXform {
constructor() {
super();
this.map = {
'c:chart': new CChartXform()
};
}
get tag() {
return 'a:graphicData';
}
render(xmlStream, model) {
xmlStream.openNode(this.tag);
this.map['c:chart'].render(xmlStream, model);
xmlStream.closeNode();
}
parseOpen(node) {
if (this.parser) {
this.parser.parseOpen(node);
return true;
}
switch (node.name) {
case this.tag:
this.reset();
break;
default:
this.parser = this.map[node.name];
if (this.parser) {
this.parser.parseOpen(node);
}
break;
}
return true;
}
parseText() {}
parseClose(name) {
if (this.parser) {
if (!this.parser.parseClose(name)) {
this.parser = undefined;
}
return true;
}
switch (name) {
case this.tag:
this.model = this.map['c:chart'].model;
return false;
default:
return true;
}
}
}
module.exports = AGraphicDataXform;
//# sourceMappingURL=a-graphic-data-xform.js.map