Live data from Hacker News

Create diagrams with code using Graphviz

ncona.com

161–170 of 221 posts

Re: Create diagrams with code using Graphviz

#161

Earlier quoted context omitted.

> - better default styles that don't look like troff from 1985 Design is not something that should be tied to a particular decade. It's not fashion. Good design is timeless and only adopts to new technologies/media. Design is how well a particular solution works for the purpose of it. If it looks like 1985 and works well, there is absolutely no reason to change it. If it doesn't, then there is no need to look at "mod…

> Design is how well a particular solution works for the purpose of it That's one half. The other one is how people feel while using it. 1985 aesthetic makes people feel bad. Thus design is half bad. Or, for you maybe, half good.

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

Re: Create diagrams with code using Graphviz

#163
For Python I love using Pyan (https://github.com/davidfraser/pyan, though I'm not sure this is the main repo but it's the first result on Google and it seems to work fine). My workflow is

cd ~/projectdir pyan3 path/to/file/i/want.py --uses --no-defines --colored --grouped --annotated --dot > dotfile.dot dot -Tsvg dotfile.dot > diagram.svg

Re: Create diagrams with code using Graphviz

#164
post #158

Earlier quoted context omitted.

> - better default styles that don't look like troff from 1985 Design is not something that should be tied to a particular decade. It's not fashion. Good design is timeless and only adopts to new technologies/media. Design is how well a particular solution works for the purpose of it. If it looks like 1985 and works well, there is absolutely no reason to change it. If it doesn't, then there is no need to look at "mod…

> it’s not fashion Many would argue good fashion is timeless as well. A good chunk of haute couture from decades past would be seen as modern and appealing today. (Which is why the houses like to repackage and ship them as such...)

I disagree, accordingly Wikipedia:

> Fashion is a popular aesthetic expression at a particular time, place and in a specific context, especially in clothing, footwear, lifestyle, accessories, makeup, hairstyle, and body proportions.

Fashion is inexplicably linked to a particular time. Just like Art - Art evolves with time and it is part of the culture, current events, etc.

Design is not (unless you want to include say media as it changes through time. For e.g. print -> digital media).

Re: Create diagrams with code using Graphviz

#165

Earlier quoted context omitted.

> Design is how well a particular solution works for the purpose of it That's one half. The other one is how people feel while using it. 1985 aesthetic makes people feel bad. Thus design is half bad. Or, for you maybe, half good.

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 ;)

Re: Create diagrams with code using Graphviz

#166

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 default styles that don't look like troff from 1985 Design is not something that should be tied to a particular decade. It's not fashion. Good design is timeless and only adopts to new technologies/media. Design is how well a particular solution works for the purpose of it. If it looks like 1985 and works well, there is absolutely no reason to change it. If it doesn't, then there is no need to look at "mod…

> Design is not something that should be tied to a particular decade.

Design does not exist in a vacuum. Technological progress, for example, creates the need for design change. Microsoft's switch from a serif to a sans serif font as the default typeface for Word was a good move, because we rarely print documents anymore and a the best design for print is not the same as the best design for screens.

20th century physics books had a distinct design for illustrations. It was beautiful and functional. But it was also designed around the limitations of their eventual monochrome (not even greyscale) print. A 2020 textbook does not have the same limitations and should not be designed with the same set of constraints.

Re: Create diagrams with code using Graphviz

#167
post #153

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…

> look like troff from 1985 This is a feature, not a bug. The rest would be nice to have, though.

I was thinking something similar. The default styles don't look super shiny, I suppose, but they are clean, which I appreciate. All in all, I think it does a good job of supporting my main reason for choosing graphviz over something like Visio: It encourages me to get the illustration done and then get on with my day without getting caught up with trying to make everything perfect.

I will turn to Visio if I need to make something presentation-quality, so there's that.

I have similar feelings about the lack of ability to fine-tune the layout: I've started seeing it as a feature, because it gives me a great feedback mechanism: If the graph is too complicated for Graphviz to lay out nicely, I take that as a sign that the thing the graph represents needs to be simplified. I've even gone so far as to incorporate Graphviz into my definition of done for a refactoring project: I kept a dotfile representing the current state of the dependency graph, and stopped refactoring when the rendered graph stopped making my eyes water.

Re: Create diagrams with code using Graphviz

#168

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 love graphviz and have used it as part of my job for over 15 years.

That said, I have spent entirely too much time manually searching through the 100-odd dimensional Graphviz parameter space trying to get aesthetic results. So much time in fact that occasionally it's easier to fire up Omnigraph and draw the thing manually.

Graphviz would be ideal if it had some kind of meta-parameter settings that could reduce the tendency of its output to resemble an unreadable rats nest when the number of nodes exceeds about 20. I know that's part of the point of neato vs. dot, and that some parameters are effectively meta-parameters, but Graphviz still needs a better "porcelain" (in git-speak) with fewer dimensions.

Re: Create diagrams with code using Graphviz

#170
You might as well just use something like plantUML instead of this from a productivity standpoint.

However, I don't want to discount the value of Graphviz. Python has a little known class diagram generator built into pylint which uses Graphviz for its rendering and its pretty cool. You can find out just how bad your #BIGCORPS code architecture is just by checking a reasonably large project with Pylints class diagraming tool...

Post reply on HN