bramp / js-sequence-diagrams

Draws simple SVG sequence diagrams from textual representation of the diagram
https://bramp.github.io/js-sequence-diagrams/
BSD 2-Clause "Simplified" License
7.81k stars 1.08k forks source link

Get SVG as text so I can use it on the server, without a DOM #162

Open akinnee-gl opened 8 years ago

akinnee-gl commented 8 years ago

This is an awesome tool, but I'd like to be able to use it on the server without a DOM. I don't see anything stopping this from working outside the browser, and SVGs are just text. It would be nice to just be able to do:

var svg = Diagram.parse("A->B: Does something").getSVG( { theme: "hand" } );

CaptainQuirk commented 7 years ago

I don't think Raphaeljs that serves as the rendering engine can work outside a browser. You should check diagrams

schrepfler commented 7 years ago

Let's see if the move to snapsvg will help (if/when.)

bramp commented 7 years ago

Ok, I've rolled out v2.0 based on Snap.svg. I haven't looked to see if that would work purely outside a browser, but I suspect it will (with perhaps some minor changes).