Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

211–220 of 221 posts

Re: Create diagrams with code using Graphviz

#211

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've been looking into supporting UTF-8 characters to create graphs with non-English text using Graphviz in an application that's used on a number of different machines. Is there a straightforward way of doing this right now? It would be nice if we could add a fonts folder in our application folder and set a relative path to it for Graphviz to perform its lookup in without having to rebuild Graphviz without fontconfig.

Re: Create diagrams with code using Graphviz

#212
GraphViz is great. I used it in a Cypress DSP processor development mini-IDE (C#) [1]. A diagram is generated for each step of the assembler code showing the data and addressing. Being able to visual the pipelining of instructions and data flow was the main motivation. Scrubbing through the program step by step to see how the state changes made the VLIW assembler programming much easier.

MIT-license code is here with screenshots:

[1] https://github.com/paphillips/DFB

Re: Create diagrams with code using Graphviz

#213

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…

> - more expressive graph language with classes or templates

There are some who view the dot language as an "assembler" language, good as the output for graph generators. It would be desirable to have more expressive costructs, but barring that, a lot can be achieved by using gvpr, m4 or various scripting languages.

Re: Create diagrams with code using Graphviz

#215
post #211

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've been looking into supporting UTF-8 characters to create graphs with non-English text using Graphviz in an application that's used on a number of different machines. Is there a straightforward way of doing this right now? It would be nice if we could add a fonts folder in our application folder and set a relative path to it for Graphviz to perform its lookup in without having to rebuild Graphviz without fontconfi…

Hmmm, Graphviz can do this now. Search the FAQ for "how do I use non-ASCII character sets"

Re: Create diagrams with code using Graphviz

#216
post #211

Earlier quoted context omitted.

I've been looking into supporting UTF-8 characters to create graphs with non-English text using Graphviz in an application that's used on a number of different machines. Is there a straightforward way of doing this right now? It would be nice if we could add a fonts folder in our application folder and set a relative path to it for Graphviz to perform its lookup in without having to rebuild Graphviz without fontconfi…

Hmmm, Graphviz can do this now. Search the FAQ for "how do I use non-ASCII character sets"

I completely missed that, thank you!

Re: Create diagrams with code using Graphviz

#217
post #211

Earlier quoted context omitted.

I've been looking into supporting UTF-8 characters to create graphs with non-English text using Graphviz in an application that's used on a number of different machines. Is there a straightforward way of doing this right now? It would be nice if we could add a fonts folder in our application folder and set a relative path to it for Graphviz to perform its lookup in without having to rebuild Graphviz without fontconfi…

Hmmm, Graphviz can do this now. Search the FAQ for "how do I use non-ASCII character sets"

I took a closer look at the FAQ and it doesn't sound like Graphviz can do exactly what I'd like it to do.

"It is essential that a font which has the glyphs for your specified characters is available at final rendering time."

It sounds to me like UTF-8 encoded characters won't show if the font isn't available on the machine, in which case we'd have to either somehow force a font install or ideally just package the font with the application. The latter would require rebuilding Graphviz without fontconfig enabled, I think?

Re: Create diagrams with code using Graphviz

#218
post #209

I really like graphviz for visualizing the call graphs generated by the Python profiler.

Is there code publicly available to do this?

What you need is gprof2dot. It will chew up your pstats file and spit out a dot file. Enjoy!

Re: Create diagrams with code using Graphviz

#219
post #97

Earlier quoted context omitted.

I have used rather nice clojure library that also uses graphviz under the bonnet, with great success: https://github.com/Engelberg/ubergraph Did you use something similar or roll your own? In any case, your project sounds great and I am glad it was a success.

I used Rhizome[1]. (It looks like it is no longer being maintained, but I didn't run into any issues.) 1. https://github.com/ztellman/rhizome

Very nice! (and pleasingly similar)

Thanks

Re: Create diagrams with code using Graphviz

#220

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…

"20 year old code"?!? I have been using graphviz since early '90s, when ek provided a first prototype.

You mention a possible improvement of classes of nodes/edges. If I understood correctly, this is typically used for styling, and is most commonly achieved via a pre-processing step. We all use our own tools for that (I've personally used m4, cpp, sed, Tcl, and I'm sure others that I forget).

Graphviz is one of the tools that I use in a wide variety of circumstances. I'd say the most satisfying cases from all these years were (a) producing a genealogical graph of around 1000 people drawn with neato (very organic-looking!); and (b) producing orgcharts for an organization (that had to look acceptable to what people were used to seeing).

Many thanks for your work all this time!

Post reply on HN