Is there a possibility to create multiple gv files from one gv file or open the content with multiple graphic files. Kind regards
Using the command line, you can render into multiple graphics files, e.g.
$ dot t1.dot -Tpng -o t1.png -Tpdf -o t1.pdf
generates t1.png and t1.pdf correctly.
It does not render multiple graphs into multiple files in the same command execution, e.g.
$ dot -Txdot t1.dot -o t1.xdot t2.dot -o t2.xdot
does not generate a layout for t1.dot in t1.xdot and a layout for t2.dot in t2.xdot. For some reason it generates the same layout of t1.dot in t1.xdot and t2.xdot, and generates a layout of t2.dot on the standard output. I’m not sure if this is a bug or a feature.
(I can interpret this question several ways - too early here & not enough caffeine).
If you are wanting to produce one output file that contains multiple complete graphs, the answer is yes, but with a few caveats.
Given this input:
digraph unit_test {
label="Unit test"
edge [fillcolor="#a6cee3" color="#1f78b4"]
node[shape="ellipse" style="filled" fillcolor="#1f77b4"]
start
end
node[shape="box" style="filled" fillcolor="#ff7f0e"]
process
subgraph cluster_process {
label = "Major logic"
process
}
start -> process
process -> end
}
digraph details {
label = "Process details"
edge [fillcolor="#a6cee3" color="#1f78b4"]
node[shape="ellipse" style="filled" fillcolor="#1f77b4"]
start
end
node[shape="box" style="filled" fillcolor="#ff7f0e"]
details
subgraph cluster_details {
label = "Details"
details
}
start -> details
details -> end
}
This command will take one input containing multiple complete graph definitions and produce one output file (with the graphs presented top-to-bottom)
dot myfile.gv |gvpack -array_ib1|neato -n2 -Tpng >myfile.png
gvpack (https://graphviz.org/pdf/gvpack.1.pdf) can also take multiple input files and can present left-to-right or in an array.
(gvpack has an annoying habit of renaming nodes with duplicate names. e.g. start_gv1. I am working on a workaround)
(If I fully misunderstood the question, please steer me in the correct direction)
Is it possible to create two graphics from your example. So two PNG files?
- Simple answer: I don’t think so.
- More complex: Maybe with a modest Python, gvpr, C, … program to split the single file into N complete graphs and then run each of these N files through a layout engine. Doable, but possibly OS specific.