<aside> 🗣

git graph generation is surprisingly unsimple…

</aside>

background

https://github.com/mhutchie/vscode-git-graph/blob/develop/web/graph.ts#L337

image.png

high-level mechanism

sequenceDiagram
autonumber
participant Load
participant A as window
Load ->> A : load event
create participant B as GitGraphView
A ->> B : new GitGraphView()
create participant C as Graph
B ->> C : new Graph()
B ->> B : loadCommits()
B ->> C : loadCommits()
loop vertex available
C ->> C : determinePath()
end
B ->> C : render()

GitGraphView class

Graph class

image.png

state

constructor