Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More extensive documentation #3

Closed
Pictor13 opened this issue Feb 3, 2015 · 3 comments
Closed

More extensive documentation #3

Pictor13 opened this issue Feb 3, 2015 · 3 comments
Labels

Comments

@Pictor13
Copy link

Pictor13 commented Feb 3, 2015

I like this extension and it is really useful for creating simple DAGs!

Would be really nice if there could be more examples to show what can be achieved with this syntax.
I imagine that could be done more than showed in the Wiki example, but I cannot guess how.

Specifically I couldn't manage to:

  • have pointing arrows longer than default (I want to represent a git merge but cannot get the merge-commit to point to the master previous commit
    A -- B -- -- -- E
           \       /
            C -- D

in this case I cannot make E point to B.
I can just manage to add a middle commit; let's say B2

    A -- B -- B2 -- E
           \       /
            C -- D
  • draw more than two branches (if I try to add a third line I get a compile error)
    
    A -- B -- -- -- E
     \     \       /
      \     C -- D
       \ 
        F
@jubobs
Copy link
Owner

jubobs commented Feb 3, 2015

Thanks for your interest and feedback. Writing proper documentation for gitdags (including more examples of the types of commit graphs that can be produced with the package) is on my laundry list... Bear with me. For now, you can refer to section 19 of the TikZ/PGF documentation.

Some fiddling with manual placement (see 19.9.1 in the TikZ/PGF documentation) is required for the graphs you want to produce; note my use of the xshift key in the optional argument of the E node:

graphs

\documentclass{article}

\usepackage{gitdags}

\begin{document}
  \begin{tikzpicture}
    % Commit DAG
    \gitDAG[grow right sep = 2em]{
       A -- B -- {E[xshift=9em], C -- D},
       D -- E
    };
  \end{tikzpicture}

  \vspace{1cm}

  \begin{tikzpicture}
    % Commit DAG
    \gitDAG[grow right sep = 2em]{
      A -- {
        B -- {
          E[xshift=9em],
          C -- D,
        },
        F,
      },
      D -- E
    };
  \end{tikzpicture}
\end{document}

@Pictor13
Copy link
Author

Hey thanks for your update!
Yeah, your additions are enough for doing what I needed!
xshift was exactly what I was missing! I'll check that TikZ/PGF documentation as well, even if I guess the addition in the Wiki of the examples for the most common cases/combinations would be useful for everyone :)
Good job!

@jubobs jubobs closed this as completed Feb 18, 2015
@jubobs
Copy link
Owner

jubobs commented Feb 18, 2015

Cool. I still have to write the documentation for gitdags, but, for now, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants