jubobs / gitdags

A package for drawing educational Git history graphs
218 stars 29 forks source link

Labels on edges #11

Closed white-gecko closed 7 years ago

white-gecko commented 7 years ago

Is there any way that I can add a label to an edge between two commits? I want to add some note, on what kind of transformation happened on the repository from commit A to B.

\begin{tikzpicture}
  % Commit DAG
  \gitDAG[grow right sep = 2em]{
    A --["foo"] B
  };
\end{tikzpicture}

doesn't work.

white-gecko commented 7 years ago

Ok I found the solution in using the tikzlibrary quotes as described here: https://tex.stackexchange.com/a/310233/11820

\usetikzlibrary{quotes}
\begin{tikzpicture}
  % Commit DAG
  \gitDAG[grow right sep = 2em]{
    A -- B [> "foo"]
  };
\end{tikzpicture}