Skip to content
This repository was archived by the owner on May 12, 2020. It is now read-only.

Commit c679136

Browse files
committed
docs: updates images and adds DOT file example
1 parent 5df0d9a commit c679136

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,47 @@ $ dot -Tpng > rainbow-graph.png cargo-count.dot
1818

1919
**NOTE:** It's also possible to run `cargo graph [options] | dot [options] > [file]` instead of individual commands
2020

21-
The above commands would produce the following graph:
21+
The first command produces a GraphViz DOT file which looks like this:
2222

23-
![cargo-graph dependencies](rainbow-graph.png)
23+
```
24+
digraph dependencies {
25+
N0[label="cargo-count",shape=diamond,color=green];
26+
N1[label="ansi_term",shape=box];
27+
N2[label="clap",shape=diamond,color=green];
28+
N3[label="clippy",shape=box];
29+
N4[label="glob",shape=diamond,color=green];
30+
N5[label="regex",shape=diamond,color=green];
31+
N6[label="tabwriter",shape=diamond,color=green];
32+
N7[label="aho-corasick",shape=diamond,color=green];
33+
N8[label="memchr",shape=diamond,color=green];
34+
N9[label="bitflags",shape=diamond,color=green];
35+
N10[label="strsim",shape=diamond,color=green];
36+
N11[label="unicode-normalization",shape=diamond,color=green];
37+
N12[label="libc",shape=diamond,color=green];
38+
N13[label="regex-syntax",shape=diamond,color=green];
39+
N14[label="unicode-width",shape=diamond,color=green];
40+
N0 -> N1[label="",style=dashed,color=red];
41+
N0 -> N2[label="",color=orange];
42+
N0 -> N3[label="",style=dashed,color=red];
43+
N0 -> N4[label="",color=orange];
44+
N0 -> N5[label="",color=orange];
45+
N0 -> N6[label="",color=orange];
46+
N7 -> N8[label="",color=orange];
47+
N2 -> N1[label="",style=dashed,color=red];
48+
N2 -> N9[label="",color=orange];
49+
N2 -> N10[label="",color=orange];
50+
N3 -> N11[label="",color=orange];
51+
N8 -> N12[label="",color=orange];
52+
N5 -> N7[label="",color=orange];
53+
N5 -> N8[label="",color=orange];
54+
N5 -> N13[label="",color=orange];
55+
N6 -> N14[label="",color=orange];
56+
}
57+
```
58+
59+
The second command produces a PNG image of the graph which looks like:
60+
61+
![cargo-count dependencies](rainbow-graph.png)
2462

2563
Now, *why* someone would do that to a graph is a different story...but it's possible :)
2664

cargo-graph.png

38.9 KB
Loading

rainbow-graph.png

61.9 KB
Loading

0 commit comments

Comments
 (0)