[deleted]
Create diagrams with code using Graphviz
11–20 of 221 posts
Re: Create diagrams with code using Graphviz
#12I’m all-in on Markdown + Github for writing, so working with text-driven diagrams is a natural fit.
Re: Create diagrams with code using Graphviz
#13- 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.
Re: Create diagrams with code using Graphviz
#14Things I’d like is for example to draw a GCP cloud build file, or something like that.
What would be a good intermediate format for this? I’ll read an xml or yaml file into a python list of dicts and then loop through it and write ... Graphviz? Mermaid? Tikz?
What do you guys recommend?
Re: Create diagrams with code using Graphviz
#15Shameless plug: I created an online Graphviz/dot editor which is powered by a language server that provides auto completion and refactorings. It uses a WASM version of Graphviz to render the graph. You can try it out here: https://edotor.net
Re: Create diagrams with code using Graphviz
#16Re: Create diagrams with code using Graphviz
#17We left that in when developing the module because it turned out to be very useful for debugging regular expressions, not just the regex implementation itself.
Re: Create diagrams with code using Graphviz
#18I’d like to write some scripts that can take some of my code and produce a graph of it. Things I’d like is for example to draw a GCP cloud build file, or something like that. What would be a good intermediate format for this? I’ll read an xml or yaml file into a python list of dicts and then loop through it and write ... Graphviz? Mermaid? Tikz? What do you guys recommend?
print('digraph foo {')
# adj_list contains tuples of (parent node name, child node name)
for parent, child in adj_list:
print(f'{parent} -> {child}')
print('}')
Redirect that to a file and view with `xdot`, done.I've done exactly this a few days ago to visualize the Linux build graph: https://q3k.org/u/73839114a0e5ee65002029892a069dd1b645a8f9f0...
Re: Create diagrams with code using Graphviz
#19Earlier quoted context omitted.
I'm using it at work, e.g. to visualize state machines. It makes it a lot easier to discuss it with business people. In Java there is a great library which translates code into graphviz markup: guru.nidi/graphviz-java
I don't want to diminish importance of graphviz, but PlantUML is better suited for visualizing state machines, message sequence diagrams and whatnot.
Re: Create diagrams with code using Graphviz
#20As 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.
Can you explain what do you mean by that, exactly? I think the looks of graphviz graphs are exceedingly beautiful and I cannot imagine a better looking way of drawing graphs (other than some minor technical issues with font kerning).