Hacker News new | ask | show | jobs
by karlicoss 1945 days ago
Not the first time, but possibly the biggest thing I've drawn in it...

There definitely are some weird things when you try to plot complicated things, fighting with weird placement, clusters etc. But not sure if it's me or Graphviz to blame for this. But I don't really know a better tool. If I knew how the diagram would look in hindsight I might have drawn in manually in inkscape or something, but when I started I didn't know what I would end up with, so needed to be an automatic tool :)

To minimize the manual work, I ended up with a mix of DSL in python and raw graphviz commands: https://github.com/karlicoss/myinfra/blob/fc6345c31c4e49b534...

Depending on the things you want to represent a better fit might be force layout, for example something like https://observablehq.com/@morvasaaty/d3-force-notes

1 comments

Working with graphs, I realized its hard to generate dynamic ones and you inevitably end up with domain specific layouts. I guess thats the nature of graph drawing algorithms, its usually specific to the problem.

Thanks for the code, taking at look at that.

Probably too messy to understand what's exactly happening -- but my main takeaway is that if you implement your own DSL (for Graphviz at least), implement in such a way that you can freely mix DSL and raw bits. That way it's very easy to experiment or tweak minor bits without rewriting half of the code.