Visualizing Git Concepts with D3
onlywei.github.io
onlywei.github.io
For anyone wishing to learn why git is the way it is, I always recommend reading Git From the Bottom Up [0]. I don't consider myself a git guru, but I found this to be a really great read to understand the underlying concepts.
Since the git commandline isn't ever going to be anything but insane and confusing, it really helps to be able to visualize what's going on. I think a sizeable portion of developers reason about their work graphically, even though their work appears textual. Being able to do this successfully demands an iron-clad understanding the tools, and/or tools which map neatly and consistently to concepts.
The concepts behind git operations aren't hard. It's the incoherent commands that make people miserable, confused and mistake-prone. Git operations become crystal clear when represented graphically.
It would be awesome if somebody wanted to update this with the newer, more ergonomic git commands. (Like `git switch`).
https://onlywei.github.io/explain-git-with-d3/#zen
This the the best tool I’ve found to demonstrate to people, how commits that no longer appear in your history due to rebase or amend etc, are still there in your repository.
For those interested, I'm working on a D3 book on how to create unique visualisations with D3 https://datacrayon.com/shop/product/visualisation-with-d3/
Ultimately i think i just want to find a decent way to use CSS to replicate this style - but i've not seen any CSS gurus manage to produce that.
Though, WebGL might be the best way regardless.
Old me would have been able to do this in LaTeX.
The algorithm used by dot (Sugiyama layout) works well for trees or any other graph where the structure is well-approximated by a tree. Control-flow graphs are the prototypical example of the latter (being the use case dot was explicitly designed for), but the VCS commit graph is also going to fit in well in this model. If you have a graph which has many more cycles in it, or has a crisscrossing connectivity pattern like a hypercube, the resulting layout from dot is going to be a giant ball of twine.
Most demos i've seen on JS libraries have been laggy with just a handful of nodes - but they're also trying to do fancy animations/etc by default. Hopefully i can hook up D3 with some minimal effort - or perhaps render it in a game library. /shrug
Edit: I just tested a bit more and last time the non-working period was a good minute. I'll stop DoSing now.
one suggestion, let user hit up arrow to auto-type suggested command