2021-12-29 17:10:28 -08:00
|
|
|
|
|
|
|
import { Mindmap } from "../..";
|
2021-12-30 12:32:32 -08:00
|
|
|
import ImageIcon from "../ImageIcon";
|
2021-12-29 17:10:28 -08:00
|
|
|
import Exporter from "./Exporter";
|
|
|
|
|
|
|
|
class SVGExporter implements Exporter {
|
|
|
|
svgElement: Element;
|
|
|
|
constructor(mindmap: Mindmap, svgElement: Element) {
|
|
|
|
this.svgElement = svgElement;
|
|
|
|
}
|
|
|
|
|
|
|
|
export(): string {
|
|
|
|
// Replace all images for in-line images ...
|
2021-12-30 12:32:32 -08:00
|
|
|
const imagesElements: HTMLCollection = this.svgElement.getElementsByTagName('image');
|
2021-12-29 17:10:28 -08:00
|
|
|
console.log(imagesElements.length);
|
|
|
|
|
2021-12-30 12:32:32 -08:00
|
|
|
const image = ImageIcon.getImageUrl('face_smile');
|
|
|
|
Array.from(imagesElements).forEach((image) => {
|
|
|
|
const imgValue = image.attributes['xlink:href'].value;
|
|
|
|
console.log(image.attributes);
|
2021-12-29 17:10:28 -08:00
|
|
|
});
|
|
|
|
return "";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default SVGExporter;
|