From b946ffd6b4dd1de96961cc1f2592d2ce8c74aaac Mon Sep 17 00:00:00 2001 From: Martin Vuk Date: Wed, 10 Dec 2025 03:48:19 +0100 Subject: [PATCH] Fiddling with positions --- git-figure.typ | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/git-figure.typ b/git-figure.typ index 10a3e4f..f76002f 100644 --- a/git-figure.typ +++ b/git-figure.typ @@ -16,7 +16,7 @@ #diagram(debug: 1, node-stroke: 2pt, edge-stroke: 1pt, { - let store = (0.3, 6.7) + let store = (0.6, 6.7) let (co1, co2) = { let x = 0.2 let y = store.at(1) @@ -36,13 +36,13 @@ let (E1, E2, E3) = ((3, 1.5), (3, 0.5), (3, -0.5)) let (Br1, Br2) = ((F.at(0)-0.5, F.at(1)), (E2.at(0)-0.5, E2.at(1))) let (T1, T2) = ((E.at(0)-0.5, E.at(1)), (B.at(0)-0.5, B.at(1))) - let refs = (2.7, store.at(1)) + let refs = (3.5, store.at(1)) let tags = (0.5, 3) - let commit = (3.7, 2.5) + let commit = (3.8, 2.5) let branches = (0.5, 0) let stage =(3.7, 0) let mc = (2.5, D.at(1)-0.5) - //node(store, [Content addressable object store], stroke: none, width: 4cm) + node(store, [Content addressable object store], stroke: none, width: 4cm) commit-object(co1, "e264a1", [second commit]) commit-object(co2, "16f29", [first commit], width: 2.8cm) tree-object(tree1, "16f29") @@ -59,7 +59,7 @@ - //node(store, width: 5cm, stroke: thin, enclose:(co1, f3, f1)) + node(store, stroke: thin, enclose:(co1, f3, f1)) commit-node(A, "A 16f299") commit-node(B, "B 16f299") @@ -83,17 +83,19 @@ node(T1, [v-1.0], shape: chevron, stroke: tag-color) node(T2, [v-1.1], shape: chevron, stroke: tag-color) // refs - node(refs, stroke: none, snap: false, enclose: (refs, (refs.at(0)+2, refs.at(1)+2)), - table(columns: 1, stroke: thin, align: left+top, [*References* (`.git/refs`)], [*Tags* (`.git/refs/tags`)\ `tag-1`: `8dd6d4b...`], [*Branches* (`.git/refs/heads`) \ `main`: `8dd6d4b...`\ + node(refs, stroke: thin, inset:5pt, snap: false, enclose: (refs, (refs.at(0)+1, refs.at(1)+1)), + align(left, [ + *References* (`.git/refs`)\ *Tags* (`.git/refs/tags`)\ `tag-1`: `8dd6d4b...`\ *Branches* (`.git/refs/heads`) \ `main`: `8dd6d4b...`\ `feature-1`: `8dd6d4b...`\ - `hotfix`: `8dd6d4b...`]) - ) + `hotfix`: `8dd6d4b...` + ]) + ) node(branches, [#text(branch-color.darken(20%))[*BRANCH*]\ #text[reference that moves along when commiting canges]], - stroke: thin, corner-radius: 10pt, inset: 5pt, width: 3cm) /*, enclose: ( + stroke: thin, corner-radius: 10pt, inset: 5pt, width: 4cm) /*, enclose: ( (branches.at(0)-0.5, branches.at(1)), (branches.at(0)+1, branches.at(1))))*/ node(tags, [#text(tag-color)[*TAG*]\ reference that don't move], - stroke: thin, corner-radius: 10pt, inset: 0pt, width: 1cm, enclose: ((tags.at(0)-0.5, tags.at(1)), (tags.at(0)+1, tags.at(1)))) + stroke: thin, corner-radius: 10pt, inset: 5pt, width: 4cm)/*, enclose: ((tags.at(0)-0.5, tags.at(1)), (tags.at(0)+1, tags.at(1))))*/ node(stage, [*Staging area*\ #text(size: 8pt)[filesystem snapshot that will be commited in the next commit]], stroke: thindashed, corner-radius: 10pt, width: 3cm) node(commit, [ #text(commit-color)[*COMMIT*]\ snapshot of filesystem tree in object store\