Live data from Hacker News

Flowchart.js – Simple SVG flow chart diagrams from textual representation

adrai.github.io

11–20 of 26 posts

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#11

Is there something like this for directed graphs?

GraphViz can output directed graphs in a variety of formats: http://www.graphviz.org/

I recently worked on a project where we started off looking to use something similar to what op posted. Despite being a very old library, nothing really provided the level of stability and options that Graphviz had. If you can get past the somewhat odd syntax, I would highly recommend it for complicated directed graph output.

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#12
post #7

Earlier quoted context omitted.

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 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 b…

You could use this to convert from SVG to a Canvas element and then from Canvas to an image (via canvas.toDataURL("image/png")): https://github.com/gabelerner/canvg Still needs a very newish browser however. No IE 6-8 (& 9?) support.

Yeah, it's a pickle. Raphael supports limited subset of SVG with VML failover compatibility, but export is limited because you have to support two technologies.

Then it gets weirder because RaphaelJS isn't exactly responsive-ready. Takes some work to make graphics just resizable (you can scale with the viewbox, but that's about it.) Recently, I switched to pure SVG (even when programmatically generated) because nested SVG elements provide basically a mechanism for relative/responsive scaling, positioning and such.

The guy who came up with RaphaelJS was ahead of his time, and I believe he got hired by Adobe in part thanks to the project's exposure. The development stopped awhile back, and it shows, which is really sad because I liked how the programming style for Raphael is done.

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#15
Is there something similar to this for making server infrastructure maps? Just something where one can define db, web, network device, whatever, and then make a layout diagram with maybe name and IP address thrown in there?

And apologies for another "is there something like this for X" comment!

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#16
AWESOME that it's SVG but dot/graphviz supports SVG output.

What I've been doing is I just have a dir of .dot files and then I have a gen.sh script which writes the SVG/PNG files.

Dot is a bit more low level but more powerful. Great for documenting protocols or state machines.

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#18
post #7

Earlier quoted context omitted.

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 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 b…

You could use this to convert from SVG to a Canvas element and then from Canvas to an image (via canvas.toDataURL("image/png")): https://github.com/gabelerner/canvg Still needs a very newish browser however. No IE 6-8 (& 9?) support.

I would prefer the SVG itself but this is an ideal short term solution. Thank you very much!

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#19

Is there something like this for directed graphs?

http://gojs.net/latest/index.html

Lots of directed graph options. I'd argue the model data is even simpler to create and comprehend, but there's a LOT more to GoJS than there is to this project. Also it isn't free.

(Disclaimer: I'm a GoJS developer)

Re: Flowchart.js – Simple SVG flow chart diagrams from textual representation

#20

Is there something similar to this for making server infrastructure maps? Just something where one can define db, web, network device, whatever, and then make a layout diagram with maybe name and IP address thrown in there? And apologies for another "is there something like this for X" comment!

Graphviz or maybe yEd. With some work with the shapes, it's possible to make it look ok.

But I guess everything have to be rewritten and reinvented in js nowadays... I kind of getting why all the COBOL geezers where tired of all the shit going around again, just solving the same old shit in another way instead of truly getting somewhere, or why Douglas Engelbart got depressed from spending his last 50 years looking at people reinventing his stuff...

Cool though.

Post reply on HN