Debian Codegraph @

docs/depdiagrams.md

raw
1 Dependency diagrams {#depdiagrams}
2 ===================
3
4 ## Introduction
5
6 In most case, you just want to call `kapidox` with the
7 "--dependency-diagrams" option. However, if you want finer-grained control over
8 diagram generation or want to work on its code, read on.
9
10 ## depdiagram tools
11
12 Dependency diagram generation is done using two tools: `src/depdiagram-prepare`
13 and `src/depdiagram-generate`. The way you use it is as follows.
14
15 ### 1. Prepare dot files
16
17 You need to prepare Graphviz dot files for all frameworks with
18 `src/depdiagram-prepare`. You can prepare dot files for all frameworks at once
19 using:
20
21 depdiagram-prepare --all ~/src/frameworks ~/dots
22
23 This will generate many .dot files in ~/dots.
24
25 Or you can prepare dot files for a single framework with:
26
27 depdiagram-prepare --single ~/src/frameworks/myframework ~/dots
28
29 ### 2. Generate the diagrams
30
31 You can now generate the dependency diagrams with `src/depdiagram-generate`.
32 This tool accepts a list of dot files and outputs a combined dot file to stdout.
33
34 Here is how to generate a dependency diagram for all the frameworks:
35
36 depdiagram-generate ~/dots/*.dot | dot -Tpng > kf5.png
37
38 The diagram might be very hard to read though. For complex diagrams, you may
39 want to pipe the output through the `tred` tool:
40
41 depdiagram-generate ~/dots/*.dot | tred | dot -Tpng > kf5.png
42
43 You can also generate the diagram for one particular framework using the
44 "--framework" option:
45
46 depdiagram-generate ~/dots/*.dot --framework kcrash | tred | dot -Tpng > kcrash.png
47
48 To include Qt libs, use the "--qt" option:
49
50 depdiagram-generate ~/dots/tier*/*/*.dot --framework kcrash --qt | tred | dot -Tpng > kcrash.png
51
52 And to include targets within the framework, use the "--detailed" option:
53
54 depdiagram-generate ~/dots/*.dot --framework kcrash --detailed | tred | dot -Tpng > kcrash.png
55
56
57 ## Useful 3rd-party tools
58
59 `tred`, mentioned in the previous section, reduces clutter in dot files.
60
61 `xdot` can be used instead of `dot` to display the graph:
62
63 depdiagram-generate ~/dots/*.dot --framework kcrash --qt | tred | xdot
64
65
66 ## Generating all diagrams at once
67
68 You can use the `depdiagram-generate-all` tool to generate diagrams for all
69 frameworks at once:
70
71 depdiagram-generate-all ~/dots ~/pngs
72
73 This command creates two pngs for each framework: "$framework.png" and
74 "$framework-simplified.png" (same diagram, ran through `tred`). It also creates a
75 diagram for all the frameworks, named "kf5.png".