Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

171–180 of 221 posts

Re: Create diagrams with code using Graphviz

#171

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…

I have used Graphviz that way. It wasn't too bad. The most annoying part was inconsistency in input and output units. Some properties expect values in pixels, some are in inches, and dpi for input and output are different with only one of them being configurable. Otherwise code was quite straight-forward: create context, create nodes, create edges, set attributes, run layout, read positions and edge path coordinates, do the cleanup.

Re: Create diagrams with code using Graphviz

#172
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.

I've been working on diagram.codes, it's not a replacement for Graphviz as my goal is to have a self contained tool that is friendly to non technical users (so flexibility is sacrificed for some diagrams), you may find it useful.

Re: Create diagrams with code using Graphviz

#175
post #41

I ended up with a different tool, but I was uncomfortable using drawing apps for diagrams, and only rarely included them in my blog until I could use text to define them. I’m all-in on Markdown + Github for writing, so working with text-driven diagrams is a natural fit.

What tool did you use? I’ve been using mermaid and its markdown plug-ins and like it quite a bit, but am always looking for new ways.

I recently wrote about using Markdown with Diagram codes https://blog.diagram.codes/posts/markdown-intro/ (I'm the creator) it's a complementary desktop tool with (web version is limited and free, desktop is paid)

I love text based tools but wanted to create something that users without technical backgrounds can use, I feel that a lot of existing tools are too complex for casual users.

Re: Create diagrams with code using Graphviz

#176
I wasted in my current project too many time trying to make GViz behave. It is a tool that has lots of potential but has some insanely obvious flaws, I literally wasted 8 work days just trying to make a small planning document, because Graphviz won't cooperate unless you start to pile up attributes one after the other in Byzantine hacks.

1. Why the "cluster" word is needed on subgraph names? I am not making my project in English.

2. Why I can't move a whole subgraph to the "end" or "start" ? GViz attempts to make all graphs compact (regardless your settings) and thus tends to shove subgraphs in "random" places.

3. Why nodes sometimes leave their subgraph and end on another one? Even when the end result makes no sense? (My graph ended with several places where "a" and "c" is on one cluster and "b" is in a another, with lots of "U" shaped edges connecting then)

The official website has a bunch of broken links.

"Weight" attribute often is ignored...

And the list goes on.

Stack overflow is full of bizarre solutions to Graphviz behavior, for example minimum edge length (that for some reason is in inches despite most of the planet using mm)

Re: Create diagrams with code using Graphviz

#178

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…

Just an appreciation post, not a question. I have reached out to graphviz as my tool of choice for diagramming for my entire career. Sometimes years go by without me using it, but I always end of finding a place to use it.

Recently I started teaching Software Development, and once again reached for graphviz for a huge variety of classroom uses.

Thanks!

Re: Create diagrams with code using Graphviz

#179

Earlier quoted context omitted.

Speak for yourself; some of us think computer aesthetics peaked by the 90s ;)

and some of us are still waiting for aesthetics to reach computers ;)

:D The joy of aesthetics and style is that there's enough room for more than one of us to be right, and certainly enough room for all of us to be wrong :-)

Re: Create diagrams with code using Graphviz

#180

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…

This is something I've not only thought out but have a design document surrounding.

What I want from graphviz is a rich library, based on D3, for building interactive web components for graphviz SVG output.

dot is an absolute dream for constructing automatic representations of graph and tree data, including great stuff like lexical scope and project maps. But simply building it into a raw SVG runs the risk of drowning in detail.

If this library were built in support of a graph generator SPA, something that lets a user tweak the huge state space of graphviz style parameters in real time, well, sky's the limit.

I work with parsers and abstract syntax trees professionally. I've been salivating over the kind of legibility we could introduce into this space with just such a library.

I know it's a huge undertaking! I think you'd find a lot of enthusiasm for actually doing it, if you organized the space to make it possible and put out a call to action.

Post reply on HN