|
|
|
|
|
by _hfke
3936 days ago
|
|
The RaphaelJS library, which this is built on, doesn't have a built-in SVG exporter (though there is a limited functionality for that, along with SVG export plugins), but in FireFox and Chrome, these two lines will get you the <SVG/> export: var svg = document.getElementsByTagName("svg");
var code = svg[0].outerHTML;
Of course, that assumes you're just getting the first SVG, etc and so on. Anyhow, this does NOT work on IE because IE hates innerHTML / outerHTML for SVG elements.One tiny thing that stands out is that RaphaelJS is built to support even IE6, and yet this flowchart program seems to bork under IE. Edit #2: forgot to mention, Raphael was specifically designed to fallback to VML if SVG is unavailable, so the export functionality would need to support both or pick and choose, or just reconstruct programmatically. A dilemma indeed. |
|
https://github.com/gabelerner/canvg
Still needs a very newish browser however. No IE 6-8 (& 9?) support.