Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

181–190 of 221 posts

Re: Create diagrams with code using Graphviz

#181

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 drownin…

There's a proof of concept here: https://github.com/mstefaniuk/graph-viz-d3-js

Re: Create diagrams with code using Graphviz

#182

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 integration with TeX, I want to put formulas inside the graph using the exact same fonts as in the rest of my paper.

I'm not a TeX user, are you asking for: 1. TeX output file format, but with current font drivers 2. Current output file formats, but with TeX fonts 3. TeX output with TeX fonts 4. Something else

Re: Create diagrams with code using Graphviz

#183
post #84

I have used Graphviz successfully to communicate with other software engineers about non-trivial state machines in the program. Specifically, C# Stateless allows exporting DOT files. Does anyone know if graphing nested nodes has already been solved?

I wouldn't quite call it nesting, but you can draw nodes on top of other nodes and to a large degree edges still work. But it requires explicit positioning of the "upper" nodes.

Re: Create diagrams with code using Graphviz

#184

Great tutorial! Is there a way to extract the bounding box of nodes, and the endpoints of lines? This would be useful to generate ML models to automatically parse graphs!

There are multiple ways. Several of the output file formats contain this info as text.

Re: Create diagrams with code using Graphviz

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

> Graphviz is for noobs. Try TikZ, aka the Gigachad of vector graphics. Maybe you are right, in today's decaying world. But any civilized person can see that tikz, latex and even graphviz are all ultimately hipster tools. Real men of course use pic and troff.

I think dpic has surpassed pic/gpic

Re: Create diagrams with code using Graphviz

#186

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…

"default styles" - are you talking about default fonts, or something else?

Re: Create diagrams with code using Graphviz

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

Any time Graphviz is not enough for whatever reason, I’ll usually reach for TikZ. This is part of the TeX ecosystem, but I often use Graphviz by itself and paste the resulting images into web pages, presentations, or design docs. TikZ lets you control the path of arrows to a fault, so you can easily get the straight arrows and 90-degree turns, rather than the “anything goes” automatic layout that you get in Graphviz.

I use it pretty often to illustrate state machines, system diagrams, or flowcharts.

Well, or I’ll reach for Inkscape.

Re: Create diagrams with code using Graphviz

#188

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 integration with TeX, I want to put formulas inside the graph using the exact same fonts as in the rest of my paper.

at some point I was able to do this via tex->dvi->postscript->pdf conversion - basically getting the font installed in ghostscript let me use it directly from graphviz when rendering to eps and installing the font into the tex/postscript machinery let me also reference the same font.

granted, this was not fun, and also now 'modern' tex (not sure about graphviz) will use fontconfig on linux which may require different machinations.

so obviously your point on 'better integration' still stands unless I'm just out of date on how to do it..

Re: Create diagrams with code using Graphviz

#189

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…

Right now my biggest gripe is I can't tell clusters to go to a specific rank. Although enabling "newrank" helped a lot, clusters I want to be the first, or last of the whole graph, still end in the middle for whatever reason, resulting in lots of edges that curve backwards, so the graph overall shape instead of looking like a diamond or a wrapped candy, instead looks like a big mess with lots of U shaped edges that go all over each other resulting in something completely impossible to read.

EDIT: also, being able to create "venn diagrams" of sorts with subgraphs would be awesome, basically allowing a node to be in several clusters, and have the clusters borders cross each other so that the item is inside all of them.

Re: Create diagrams with code using Graphviz

#190

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 integration with TeX, I want to put formulas inside the graph using the exact same fonts as in the rest of my paper.

Continuing to show my ignorance, would adding a TikZ output option be a good thing? I'm fuzzy as to Tex/LaTex/TikZ relationship. The graphics part in TikZ looks pretty simple to do. The font/equations/... stuff is an unknown story.
Post reply on HN