Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

81–90 of 221 posts

Re: Create diagrams with code using Graphviz

#81
post #5

Earlier quoted context omitted.

I'm using it at work, e.g. to visualize state machines. It makes it a lot easier to discuss it with business people. In Java there is a great library which translates code into graphviz markup: guru.nidi/graphviz-java

I don't want to diminish importance of graphviz, but PlantUML is better suited for visualizing state machines, message sequence diagrams and whatnot.

Does PlantUML do statecharts?

Re: Create diagrams with code using Graphviz

#83
post #80

Earlier quoted context omitted.

> One thing it does not do (or I don't know how) and graphviz does, though, is arranging nodes intelligently That's exactly what "graph drawing" means [0]. Can tikz choose the position of the vertices itself or you have to specify the positions yourself? If it is you who chooses the positions, then tikz does not do "graph drawing". [0] https://en.wikipedia.org/wiki/Graph_drawing

Yes, TikZ can position the vertices itself. E.g. http://www.tcs.uni-luebeck.de/downloads/papers/2011/2011-con... http://www.tcs.uni-luebeck.de/downloads/mitarbeiter/tantau/2... https://tex.stackexchange.com/questions/203692/how-to-automa...

That's great! Did these people really implement graph drawing algorithms as latex macros, or does it call an external program? I'm afraid to look it myself, lest I discover the truth.

Re: Create diagrams with code using Graphviz

#84
I have used Graphviz successfully to communicate with other software engineers about non-trivial state machines in the program. Specifically, C# Stateless allows exporting DOT files. Does anyone know if graphing nested nodes has already been solved?

Re: Create diagrams with code using Graphviz

#85
post #80

Earlier quoted context omitted.

Yes, TikZ can position the vertices itself. E.g. http://www.tcs.uni-luebeck.de/downloads/papers/2011/2011-con... http://www.tcs.uni-luebeck.de/downloads/mitarbeiter/tantau/2... https://tex.stackexchange.com/questions/203692/how-to-automa...

That's great! Did these people really implement graph drawing algorithms as latex macros, or does it call an external program? I'm afraid to look it myself, lest I discover the truth.

Some of it is LaTeX, but the more intensive algorithms are done with embedded Lua, using LuaLaTeX. There is no external program.

Re: Create diagrams with code using Graphviz

#87
post #72

Earlier quoted context omitted.

> Graphviz is for noobs. Try TikZ, aka the Gigachad of vector graphics. Maybe you are right, in today's decaying world. But any civilized person can see that tikz, latex and even graphviz are all ultimately hipster tools. Real men of course use pic and troff.

Now, 28 year old me after leaving academia and learning the superpower of TikZ, LaTeX and Beamer, I just use draw.io and google docs/slides.

the horror, the horror

Re: Create diagrams with code using Graphviz

#88
I've gotten a lot of mileage from Graphviz over the years. As an example outside of work, I wanted a way to depict parse trees for an article I was writing. So, after I wrote an EBNF parser generator (great fun!), I wrote a little utility to apply a grammar to stdin and emit to stdout a JSON representation of the resulting parse tree; another utility handles converting the JSON to dot, which I can plot at my leisure.

https://github.com/reindeereffect/tools-from-blog/tree/maste...

Re: Create diagrams with code using Graphviz

#89
post #67

I'm going to hijack this thread to ask if anyone knows of a library that creates "hand drawn"-style sequence diagrams from code? I basically want this: https://bramp.github.io/js-sequence-diagrams/ -- but sadly, this one only seems to run inside a browser.

PlantUML supports this https://plantuml.com/handwritten Add this to any diagram to get the effect you want, skinparam handwritten true skinparam monochrome true Demo: https://tinyurl.com/ycdu7owa

Also, you can use https://collabuml.com to collaboratively build diagrams.

Re: Create diagrams with code using Graphviz

#90
post #48

I found a great use for Graphviz recently. I needed to implement a model that was created by a scientist with no programming experience outside of a Fortran class in the early 1980s. Meanwhile, I didn't have much knowledge of the subject matter or terminology. The model was described in a multipage Excel file and an accompanying PDF and I implemented it in Clojure. In order to help us communicate, I wrote a script th…

I have used rather nice clojure library that also uses graphviz under the bonnet, with great success:

https://github.com/Engelberg/ubergraph

Did you use something similar or roll your own?

In any case, your project sounds great and I am glad it was a success.

Post reply on HN