I'm working on a python library for Vizdom to be released later this year, but in the mean time, you can use this python library which uses Graphviz under the hood.
So far it has automatic layout that will position (and create a rendering) for hierarchical graphs - even if your data isn't hierarchical in nature. This is how the algorithm works internally as it is a reflection of Dagrejs.
I plan to support more layout types in the future.
As for placement of 'root' nodes (aka source and sink nodes) - in reference to the parent comment - my hope is to expose graph theory methods that you can run before layout/render which would help facilitate this automatically, but it's non-trivial to codify as it requires a substantial refactor to the layout algorithm(s).
Thank you for pointing this out - it was an error. I actually even forgot to credit the dependencies the binary was built from!
However, that is now resolved. The latest distribution has license mentions for:
- Dagrejs
- NotoSans Font
- *Others (an html file generated via `cargo about` that list all deps used in the final dist)
That being said, I did want to point out that I did take significant influence from Dagrejs which is why you see that the layouts produced look very similar - it is a rough translation into rust. There are changes to some DFS traversals, other optimizations that are rust-specific, and countless bug fixes. I actually spent a lot of time attempting to reproduce the layouts that Dagre generates, but there are some examples that do not produce the same results. At this point, I think it is close enough and would rather spend time writing a new set of algos for better edge crossing minimization and cluster support.
If you're already happy with Graphviz wrappers, then the only real benefit is that you can sync the graph to a Vizdom account so you don't have to build anything to view the diagram somewhere outside of local development - it saves you from needing to save the positioned graph to a file to view it (then delete it) or coming up with a way to serve the SVG.
Not to mention the act of performing layout (obtaining positioning data) is relatively expensive for non-trivial graphs. When syncing to a Vizdom account, your application doesn't need to spend cycles to position/render anything. Instead, your graph is positioned and rendered in the dashboard in your browser upon loading (technically, it is also rendered on the server due to my global SSR config).
Also a few of the JS wrappers don't come with a build of Graphviz that allows memory growth, so for somewhat medium/large graphs, the WebAssembly panics. For all other wrappers, it works just fine I'd assume - mainly an issue with not passing the correct build args to Emscripten.
Thank you! Custom icons - not yet. I’ve been mulling over how to do it on server and client that isn’t hacky and that plays nice with edge intersections (how edges will point to the bounding box of the icon/logos)
It's pretty good - uses Graphviz under the hood, but supports many cloud icons/logos. Not completely sure if it allows you to provide any icon, but it wouldn't surprise me.
Tradeoffs are real. My example displays a few more knobs and yes, it’s more verbose.
I’d say my premise isn’t that “DSLs are bad”, but more along the lines of if a DSL isn’t what you’re looking for, I may have something for you. Particularly if you need your application to generate a view of a graph _during runtime_ so that it is your real-time source of truth.
I find that DSLs and “as code” solutions for several products have their own niche. Take for example Terraform vs Pulumi.
Ah yeah while I do have a live editor for playing with DOT, it’s not a graphviz replacement nor is it primarily what Vizdom is all about. I actually launched a tech preview earlier this year and those two pages were all I really had.
I’d say for the majority use-case (as I see it), they’re excellent for manual diagram curation. Especially, D2 for software arch diagrams. Mermaid is great at many things.
It’s kind of hard to write up a fair comparison - it’s apples to oranges.
I can say that vizdom performs very fast hierarchical layouts (currently the only supported type). Example 14 in the live editor runs in about 1 second on my M1 Mac - but if you refresh the page it CloudFront will complain since the graph state is all in the URL and it’s too long.
I wrote some functionality to parse DOT to feed it into the layout engine before I got everything working. It was a great way to validate more complex graphs with a DSL that is already prevalent. So for now it’s only present in the webapp.
DOT parsing isn’t part of the npm package, but I’m not totally opposed to include it! It may add 1-2Mb more to the wasm bundle.
Just so you know, I find this terribly confusing. You see the homepage with your code, then you think "oh, I'll try this editor here..." and then it turns out it's Dot? All examples are written in Dot? Why? Didn't it say "no DSLs"? Didn't it show some TypeScript in the homepage?
It can very easily make people get the wrong idea about what your project is.
Yeah I’ll admit, that isn’t clear. I used DOT to test it a while back and opened that up for folks who also wanted to mess with DOT, but that isn’t the value prop today.
You can create and render as many graphs as you like with the package offline - only the real-time sync is limited.
- https://diagrams.mingrammer.com/