Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

101–110 of 221 posts

Re: Create diagrams with code using Graphviz

#101
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 most?

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

- better default layout parameters in neato than statistical multidimensional scaling based on shortest path

- more expressive graph language with classes or templates

- more robust handling of error conditions like out of memory

- better documentation to help people find useful tools or just know what they should be looking for

- find someone to donate a generic orthogonal routing algorithm based on a modern algorithm since people want this

- it would be a big effort, but move the core algorithms to a framework that supports interaction with layout generation

Hope this makes sense.

Re: Create diagrams with code using Graphviz

#103
At ObservbleHQ they use this to automatically visualise dependencies: https://observablehq.com/@observablehq/notebook-visualizer

More generally, Observable gives you a 'playground' where you can interactively see graphviz results: https://observablehq.com/@observablehq/graphviz

Another option - which for some applications is visually more appealing - is Elk: https://observablehq.com/@observablehq/notebook-visualizer-e...

There's a simple start notebook here: https://observablehq.com/@tmcw/elk

Re: Create diagrams with code using Graphviz

#104
post #13

As much as I like Graphviz (and I've been using it for ages) I keep looking for an equivalent with two features: - Nicer, more modern looks (the original is too... LaTeX-y for my tastes) - A different layout engine that uses straight arrows and 90 degree turns So far I haven't been able to find any good replacements, although a few JS libraries come reasonably close.

Possibly Elk? - there's a simple start notebook here: https://observablehq.com/@tmcw/elk and example of more complex output here: https://observablehq.com/@observablehq/notebook-visualizer-e...

Re: Create diagrams with code using Graphviz

#105

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…

Sincerely, I think graphviz is great the way it is. I wouldn't change the graph language and most of the suggested changes would be "nice to have".

Thanks for your hard work on it!

Re: Create diagrams with code using Graphviz

#106
post #17

Fun hidden use of graphviz: if you use GCC's in your code, try defining _GLIBCXX_DEBUG and call the member function _M_dot() on your regex objects. We left that in when developing the module because it turned out to be very useful for debugging regular expressions, not just the regex implementation itself.

That's cool! Every time I end up implementing some kind of graph structure, writing a simple dot output method is one of the first things I do. It's incredibly useful for debugging stuff, and only takes a couple minutes to put together.

Re: Create diagrams with code using Graphviz

#107
post #5

Earlier quoted context omitted.

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?

Yes. https://plantuml.com/state-diagram

Re: Create diagrams with code using Graphviz

#109

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…

> - find someone to donate a generic orthogonal routing algorithm based on a modern algorithm since people want this

> - it would be a big effort, but move the core algorithms to a framework that supports interaction with layout generation

Yup, I think these are the ones that mean I never actually end up using Graphviz for anything :)

If I'm generating graphs, I want them laid out in a hierarchical style.

To do that, I need a library which can do that layout.

Those libraries are often written in a higher level language like C#, Java, etc, which come with their own simple drawing layer.

And then I don't need Graphviz anymore! (not that I'm suggesting graphviz should change)

Re: Create diagrams with code using Graphviz

#110

I used graphviz as the main visualisation for bear-note-graph [1], and it's super-easy to use programmmatically, and gives decent-looking results even for large graphs. It is also pretty customizable. I have a WIP version now using D3, and that one has been harder to manage (when the graph is too large you don't want to have it animate the layout on the fly). If you are curious, I used the same D3 code I have in the…

Curious what you think about something, since it seems like you've been iterating on the challenge of a big interactive graph lately.

I've been pondering building a big interactive chart, like a decision tree or differential diagnosis chart, that maps goals/needs/problems to docs/examples/tools (for the Nix/NixOS/Nixpkgs ecosystem, but the basic concept applies to any sprawling ecosystem where discovery is hard).

I recently stumbled on https://github.com/mermaid-js/mermaid, which seems like it has an interaction model that could support what I have in mind (minus the question of whether there are performance cliffs that'd make it unsuitable).

If you considered mermaid while working on bear-note-graph, could you share the conclusions you came to?

Post reply on HN