diff --git a/README.md b/README.md index c583846..6d0b3f0 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,6 @@ Some ideas for further developing the simulator. * Saving and loading circuits, including layout and state. * Generic handling of negation for unary/binary gates (negation on inputs/outputs) for better clarity. * Zooming in/out on schematics. - * SVG export. * Verilog export. * Smartphone and tablet compatible UI. diff --git a/src/index.mjs b/src/index.mjs index 3d0f92f..55feee0 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -84,6 +84,12 @@ export class Circuit extends HeadlessCircuit { this.trigger('changeRunning'); }); } + getSvgExport(jointjsPaper) { + let svgString = (new XMLSerializer()).serializeToString(jointjsPaper.svg); + svgString = '\r\n' + svgString; + + return svgString; + } _defaultWindowCallback(type, div, closingCallback) { const maxWidth = () => $(window).width() * 0.9; const maxHeight = () => $(window).height() * 0.9;