Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

141–150 of 221 posts

Re: Create diagrams with code using Graphviz

#141

We're reluctant to be exposed to too much anger about misfeatures in 20 year old code that was basically a prototype that escaped from the lab, but go ahead, ask us anything. We've gotten a lot of help lately from Magnus Jacobsson, Matthew Fernandez and Mark Hansen on cleaning up the website and the code base, even some persistent bugs we could never find ourselves. Improvements that would benefit the community the m…

I'm excited for better default styles and colors. I love the text editing experience of Graphviz but spend a lot of time trying to style it unfortunately.

Re: Create diagrams with code using Graphviz

#142

We're reluctant to be exposed to too much anger about misfeatures in 20 year old code that was basically a prototype that escaped from the lab, but go ahead, ask us anything. We've gotten a lot of help lately from Magnus Jacobsson, Matthew Fernandez and Mark Hansen on cleaning up the website and the code base, even some persistent bugs we could never find ourselves. Improvements that would benefit the community the m…

I'd rather have graphviz expose a kind of layout engine such that it can take the size each node will occupy (determined by whatever's going to draw them) and use that to create a layout, feeding path info to something that can handle the actual drawing, than have more drawing options in Graphviz itself. I think that doing so is (so far as I could tell, last time I tried) extremely awkward at best is why it's not emb…

One problem with this is that—at least in some Graphviz layout engines—"the size each node is going to occupy" is chosen to minimize the energy/stress of the graph, sort of like how line breaks on TeX pages are chosen to optimize for whole-page metrics.

For example, in a graph with only two nodes, where each node contains a long text string, there is no "pressure" on the nodes, so the default result might be to not break the text, creating two wide, short node-boxes, and then to arrange them with one above the other. Whereas if you have many such nodes in a densely-connected web, the text in them will likely be wrapped in order to make the nodes more box-shaped, so that nodes can fit between the cuts of the pairwise-acute spirograph-like edge lines.

In order to resolve this sort of layout, Graphviz has to understand a lot of things about fonts, padding, and borders (just like TeX does.) It's already doing "rendering" at that point, even if the result gets thrown away.

Re: Create diagrams with code using Graphviz

#143

We're reluctant to be exposed to too much anger about misfeatures in 20 year old code that was basically a prototype that escaped from the lab, but go ahead, ask us anything. We've gotten a lot of help lately from Magnus Jacobsson, Matthew Fernandez and Mark Hansen on cleaning up the website and the code base, even some persistent bugs we could never find ourselves. Improvements that would benefit the community the m…

No critique from me, instead a big thanks from me to you and anyone else who worked on graphviz!

I've used it a few times for visualizing aspects of my research, usually by writing .dot files directly from Racket. It turned out to be quite useful.

Re: Create diagrams with code using Graphviz

#146
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…

There's an Emacs package which also uses Graphviz in the same way to show function dependencies during development:

https://github.com/mtekman/elisp-depmap.el

Re: Create diagrams with code using Graphviz

#147

Been super interested to write my own layout engine. Does anyone have resources, tutorials, etc. that I should look into if someone wants to write the layout engine that powers something like GraphViz?

I was looking into that a while ago, but sadly I did not find anything great. Back then I wanted to draw animated Binary Decision Diagrams, so I had to come with an incremental (and simple and fast) layout algorithm, which could determine positions for new nodes without interfering with the original graph. The result works fine, but it did require a fair amount of tweaking. (The comments document these tweaks extensively [1].)

If you want to write something more general, then that would probably be much more complicated.

[1] https://github.com/suyjuris/obst/blob/feb8e766ce226ca1afe862...

Re: Create diagrams with code using Graphviz

#148

We're reluctant to be exposed to too much anger about misfeatures in 20 year old code that was basically a prototype that escaped from the lab, but go ahead, ask us anything. We've gotten a lot of help lately from Magnus Jacobsson, Matthew Fernandez and Mark Hansen on cleaning up the website and the code base, even some persistent bugs we could never find ourselves. Improvements that would benefit the community the m…

> - better default styles that don't look like troff from 1985

Design is not something that should be tied to a particular decade. It's not fashion. Good design is timeless and only adopts to new technologies/media. Design is how well a particular solution works for the purpose of it. If it looks like 1985 and works well, there is absolutely no reason to change it. If it doesn't, then there is no need to look at "modern trends", instead we need to go back to the drawing board and find out what the problem is first.

Can you identify the problem with the design besides the superficial aesthetic (which can be easily themed)?

Re: Create diagrams with code using Graphviz

#149
post #44

Graphviz is for noobs. Try TikZ, aka the Gigachad of vector graphics. I spent more time creating TikZ diagrams than actually writing my whole MSc. thesis.

> I spent more time creating TikZ diagrams than actually writing my whole MSc. thesis.

Isn't this the primary problem with TikZ? It makes you do all the time consuming layout stuff by hand. With Graphviz you just chuck your data at it and get results instantly. Sure it won't be eye-optimized, but it also didn't require work on your part, nor will it require more work on your part when your data changes.

Re: Create diagrams with code using Graphviz

#150

We're reluctant to be exposed to too much anger about misfeatures in 20 year old code that was basically a prototype that escaped from the lab, but go ahead, ask us anything. We've gotten a lot of help lately from Magnus Jacobsson, Matthew Fernandez and Mark Hansen on cleaning up the website and the code base, even some persistent bugs we could never find ourselves. Improvements that would benefit the community the m…

> - better default styles that don't look like troff from 1985 Design is not something that should be tied to a particular decade. It's not fashion. Good design is timeless and only adopts to new technologies/media. Design is how well a particular solution works for the purpose of it. If it looks like 1985 and works well, there is absolutely no reason to change it. If it doesn't, then there is no need to look at "mod…

> Design is how well a particular solution works for the purpose of it

That's one half. The other one is how people feel while using it. 1985 aesthetic makes people feel bad. Thus design is half bad. Or, for you maybe, half good.

Post reply on HN