Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

131–140 of 221 posts

Re: Create diagrams with code using Graphviz

#131
Big fan of graphviz.

Lots of interesting tools that use it being posted here, so here's a toy of mine: https://github.com/alexbrasetvik/graphspec

I've used it mostly to mix edge+node definitions in comments in asciidoc or code, and the non-nested nature makes it easy to compose different sources of edges and nodes.

(It's just a POC. If you know of something similar that's more actively developed, I'd be very interested)

Re: Create diagrams with code using Graphviz

#132

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…

Anger, what's wrong with people? For the record, I love graphviz. Thanks!

Re: Create diagrams with code using Graphviz

#133
post #126
post #85

Earlier quoted context omitted.

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

Wow, that was a long time ago, very fun project to work on. But yeah, without deep knowledge of the TeX side you'd likely still struggle a bit to understand how the two sides interact, at least it was a bit of a struggle for me, maybe / hopefully it got a bit better in the meantime. And thankfully LuaLaTex was ready enough at that time, I can't imagine how bad it would've been to do this in pure Tex ...

Are you one of the authors of tikz graphdrawing?

Re: Create diagrams with code using Graphviz

#134
post #126

Earlier quoted context omitted.

Wow, that was a long time ago, very fun project to work on. But yeah, without deep knowledge of the TeX side you'd likely still struggle a bit to understand how the two sides interact, at least it was a bit of a struggle for me, maybe / hopefully it got a bit better in the meantime. And thankfully LuaLaTex was ready enough at that time, I can't imagine how bad it would've been to do this in pure Tex ...

Are you one of the authors of tikz graphdrawing?

Just a former student who participated in the first version (let's say draft) of it, which had no really interesting algorithms in it yet, just the overall graph framework and integration with the rest of PGF/TikZ.

Really cool project though, one of the few that made it outside of uni.

Re: Create diagrams with code using Graphviz

#136
post #31
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.

Also I think graphviz is a great tool when you want to generate some diagrams quickly and don't care too much about the design. If you have a precise idea of how it should look, it is possible to force it to look that way but it becomes a lot of work (with a complex logic of clusters, ranks, groups, etc).

My main complaint.

Re: Create diagrams with code using Graphviz

#137

Big fan of graphviz. Lots of interesting tools that use it being posted here, so here's a toy of mine: https://github.com/alexbrasetvik/graphspec I've used it mostly to mix edge+node definitions in comments in asciidoc or code, and the non-nested nature makes it easy to compose different sources of edges and nodes. (It's just a POC. If you know of something similar that's more actively developed, I'd be very interest…

I'm also interested in this (or something more actively-developed), as it's the first time I've seen what looks like an answer to a question I've had recently.

If it helps to know how someone else thinks about it: I've been looking for a way to _compose_ or _import_ or _include_ a graph or subgraph defined in one file into multiple other graphs. I've started to assume I'll just need a preprocessor or template engine.

In my case, I'm interested in the feasibility of building a really big interactive chart, like a decision tree or differential diagnosis chart, to help users discover docs/examples/tools/tutorials etc. that can meet their needs or fix their problems, and I suspect a single-file approach just isn't going to scale well. (Composition/inclusion is a bit of an MVP focus, I guess. I think it would also be nice to be able to have a good way to generate versions of the graphs from multiple perspectives--like 1. a diagnosis chart that helps users identify a common formulation of their problem and its most-canonical solution, 2. a graph that helps users figure out what a command-line tool is used for by mapping each one to the problems they solve, 3. a graph that helps users who've run into trouble solving X with Y by mapping it to more known solutions and showing additional context on the pros/cons/limits of each.)

An aside: I noticed a TODO on your repo about supporting a comment syntax. Your existing syntax is very close to directives from reStructuredText (https://docutils.sourceforge.io/docs/ref/rst/restructuredtex...). Since it's already a Python project, I wonder if it makes sense to piggy-back on docutils, or at least borrow the comment syntax (https://docutils.sourceforge.io/docs/ref/rst/restructuredtex...).

Re: Create diagrams with code using Graphviz

#138

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 embedded in basically everything that has any need whatsoever to draw graphs.

So, I guess:

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

If that's what you mean by that.

It'd make it way easier to pretty up Graphviz output. I'd rather have "renderer" applications that run on top of Graphviz and have Graphviz itself lose all but its most basic build-in drawing capabilities, than have more of that built into Graphviz itself.

Post reply on HN