#pragma section-numbers 2 = Drawing Graphs = How to add graphs to this wiki. <> == Drawing revision graphs == The Mercurial wiki allows easily adding graph diagrams to pages. To draw a graph like this: {{{#!dot digraph G { rankdir=LR node [shape=rect] a -> b -> c -> d -> e d->f } }}} add a section like this: {{{ { { {#!dot digraph G { rankdir=LR node [shape=box] a -> b -> c -> d -> e d->f } } } } }}} For consistency, use {{{[shape=box]}}} for Mercurial revisions, {{{[shape=ellipse]}}} for the working directory, and {{{rankdir=LR}}} (left-to-right) or {{{rankdir=BT}}} (bottom-to-top) for revision graphs. == Drawing flowcharts == To draw a flowchart like this: {{{#!dot digraph G { {node[shape=box] push pull merge} {node[shape=diamond] succeed} push [label="try to push"] succeed [label="did push succeed?"] pull [label="pull unsynced changes"] merge [label="merge"] start -> push -> succeed pull -> merge -> push:n succeed:e -> pull [label=n] succeed:s -> done [label=y] } }}} Use: {{{ { { {#!dot digraph G { {node[shape=box] push pull merge} {node[shape=diamond] succeed} push [label="try to push"] succeed [label="did push succeed?"] pull [label="pull unsynced changes"] merge [label="merge"] start -> push -> succeed pull -> merge -> push:n succeed:e -> pull [label=n] succeed:s -> done [label=y] } } } } }}} Note the use of compass points to control edge start and end points. == See also == * [[http://www.graphviz.org/doc/info/attrs.html|Graphviz documentation]] for additional attributes * UnderstandingMercurial and ConcatenatingChangesets for examples on this wiki * [[http://www.graphviz.org/Gallery.php|Graphviz Gallery]] for more examples ---- CategoryWiki