1

I'm trying to migrate some realy old documentation to our internal wiki using GraphViz.

I'm not used to the Dot language, and needs some help

See following example:

Example of graph

I have experiment a lot, but the best I have come up to so far is this: Resulting GraphViz

digraph CentralPmr { fontname="Helvetica"; shape=box; node[shape=box]; graph [splines=ortho] sg [label="TTD storage group for\nthe logged values"] vc [label="Value catalogue"] tc1 [label="Time catalogoue (1)"] tc2 [label="Time catalogoue (2)"] sv_ [shape=point,width=0.01,height=0.01]; sv [label=""] ie [shape=none, label="Initiating event"] c1 [shape=none, label="The set of values, defined\nby the value catalogue, which\nare freezed out of the TTD\nstorage group of the actual log."] c2 [shape=none, label="Time catalogue defining\nat what time around the\ninitiating event values\nshould be collected."] sgf [shape=record, label="{<f0> 1|2|3|4|..}|{ | | | | }"] sg -> sv_ [penwidth=4, dir=none]; sv_ -> sv -> tc2 [penwidth=4] sv -> sgf:f0 [penwidth=4] {vc, tc1} -> sg c1 -> sv [style=dashed, arrowhead="open"]; {rank=min; ie} {rank=same; sg c1} {rank=same; vc sgf} {rank=max; rc2} } 

It don't have to be exactly the same as the source, but I want it to be understandable.

The problems is:

  1. How do I place the text between "Value catalogue" and "Time catalogue (1)"?
  2. [Edit] How do I force the arrow to "TTD storage group for PMR-freezed value" to go from the side, and not from the above? It is a virtualization of a memory area, and the arrow are pointing to a specific memory post. In other images, it can point to a other memory post in the memory area (eg. 2 , 3, 4..).
  3. Is it possible to create a zigzag line from the "Initiating event"?
  4. How do I place the legends in the bottom that explains the different types of lines?
  5. [edit] How do I add the comments above, under and to the right of the "TTD storage group for PMR-freezed values"?
  6. [Edit] How do I make the "TTD storage group for PMR-freezed value" wider?

2 Answers 2

4

This is on top of my first answer in a way that editing that one would create too much confusion. I have tried to take all your needs into consideration and it only works (I believe) if you give up the splines=ortho requirement. Pls refer to the comments below my first answer. Here we go:

digraph CentralPmr { fontname="Helvetica"; shape=box; node[shape=box]; // graph [splines=ortho] sg [label="TTD storage group for\nthe logged values", width = 2.5] sv[ label="", width = 2] ie [ shape=none, label="Initiating event", fontsize = 18 ] c1 [ shape=none, label="The set of values, defined\nby the value catalogue, which\nare freezed out of the TTD\nstorage group of the actual log." ] sgf[shape=box, margin=0, label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR> <TD BORDER="0" COLSPAN="2">TTD storage group for<BR/>PMR freezed values</TD> </TR> <TR> <TD PORT="f1">1</TD> <TD BORDER="0" ROWSPAN="6">The set of<BR/>values is<BR/>stored in<BR/>the TTD<BR/>storage<BR/>group</TD> </TR> <TR> <TD>2</TD> </TR> <TR> <TD>3</TD> </TR> <TR> <TD>4</TD> </TR> <TR> <TD>-</TD> </TR> <TR> <TD>-</TD> </TR> <TR> <TD BORDER="0" COLSPAN="2">Up to nine freezing areas<BR/>for defined central PMR</TD> </TR> </TABLE>>]; TTD [shape=none, margin=0, label=< <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="12"> <TR> <TD PORT="f1">Value catalogue</TD> </TR> <TR> <TD BORDER="0"></TD> </TR> <TR> <TD PORT="f2">Time catalogue (1)</TD> </TR> <TR> <TD BORDER="0">Time catalogue defining<BR/>at what time around the<BR/>initiating event values<BR/>should be collected</TD> </TR> <TR> <TD PORT="f3">Time catalogue (2)</TD> </TR> </TABLE>>]; connector_1[ shape = point height = 0 width = 0 margin = 0 ] ie -> connector_1[ style = dotted, arrowhead = none ]; { rank = same; connector_1 c1 } connector_1 -> c1[ style = invis, minlen = 4 ]; c1 -> sv[ style = dashed, arrowhead = open ]; connector_2[ shape = point height = 0 width = 0 margin = 0 ] connector_1 -> connector_2[ style = dotted ]; { rank = same; sg connector_2 sv } sg -> connector_2[ minlen = 3, penwidth = 4, arrowhead = none ]; connector_2 -> sv[ minlen = 3, penwidth = 4 ]; sg:sw -> TTD:f1:nw[ weight = 5 ]; sg:w -> TTD:f2:w; sv:sw -> TTD:f3:e[ penwidth = 4 ]; sv:sw -> sgf:f1:w[ penwidth = 4 ]; node[ shape = plaintext ]; leg2[ label = "Data flow" ]; leg4[ label = "Reference" ]; leg6[ label = "Comment" ]; node [ shape = point height = 0 width = 0 margin = 0 ]; leg1 leg3 leg5 TTD:sw -> leg1[ style = invis ]; { rank = same; leg1 leg2 leg3 leg4 leg5 leg6 } edge[ minlen = 2 ]; leg1 -> leg2[ penwidth = 4 ]; leg3 -> leg4[ style = dotted ]; leg5 -> leg6[ style = dashed, arrowhead = open ]; } 

yields

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

I really appreciate the job you put down. It looks Amazing, much better than I expected. Now I think I have what I need to digitize the rest of the documentation. Thank you very much.
Good luck, and always happy to help!
If you have more of the stuff, you might like some processing tool. Using m4 as a preprocessor helps me to keep my source files small and clean. Have a look here.
I have added my m4 files and commands to the github link above in case you want to see how it works.
1

Not sure whether I understand completely what you want but below my take on it. This is just a first attempt, much more fine-tunig can be done. I would probably use HTML-like nodes where text and "box" need to be closer, in particular for that "TTD Storage Group for PMR freezed values" in the original graph.

My answers to your questions would be:

How do I place the text between "Value catalogue" and "Time catalogue (1)"?

--- See below. I have put it between the two time catalogues as in the original graph but easy to move around.

How do I force the arrow to the record go from the side, and not from the above?

--- See below. You could also use rankdir = LR; to change the orientation if that is your question.

Is it possible to create a zigzag line from the "Initiating event"?

--- There are ways, but a lot of effort (like creating a custom shape). Nothing "out of the box", to the best of my knowledge.

How do I place the legends in the bottom?

I don't really understand, but in general, the answer would be HTML-like labels when we talk about nodes.

Her is what I have done:

digraph CentralPmr { fontname="Helvetica"; shape=box; node[shape=box]; graph [splines=ortho] sg [label="TTD storage group for\nthe logged values"] vc [label="Value catalogue"] tc1 [label="Time catalogoue (1)"] tc2 [label="Time catalogoue (2)"] sv_ [shape=point,width=0.01,height=0.01]; sv [label="", width = 2] ie [shape=none, label="Initiating event"] c1 [shape=none, label="The set of values, defined\nby the value catalogue, which\nare freezed out of the TTD\nstorage group of the actual log."] c2 [shape=none, label="Time catalogue defining\nat what time around the\ninitiating event values\nshould be collected."] sgf [shape=record, label="{<f0> 1|2|3|4|..}|{ | | | | }"] connector_1[ shape = point height = 0 width = 0 margin = 0 ] ie -> connector_1[ style = dotted, arrowhead = none ]; { rank = same; connector_1 c1 } connector_1 -> c1[ style = invis ]; c1 -> sv[ style = dashed, arrowhead = open ]; connector_2[ shape = point height = 0 width = 0 margin = 0 ] connector_1 -> connector_2[ style = dotted ]; { rank = same; sg connector_2 sv } sg -> connector_2[ minlen = 3, penwidth = 4, arrowhead = none ]; connector_2 -> sv[ minlen = 3, penwidth = 4 ]; vc -> tc1 -> c2 -> tc2[ style = invis, weight = 10 ]; sg -> vc; sg -> tc1; sv -> tc2[ penwidth = 4 ]; sv -> sgf; } 

yields

enter image description here

5 Comments

Oh thank you very much. Great improvement compared to my attempt. *I was somewhat unclear in the second question, I hope I have made it clearer now. * Is it possible to make "Value catalog", "Time catalog 1/2" and the comment to be closer to each other? * The text around "TTD storage group for PMR-freezed values" is missing (has added it to the original question) * With the legend, I mean an explanation at the bottom of what the different lines mean.
I'm afraid I over-promised. Either I get the text boxes right, but can't control the edges, or the other way round. No surprise, after all, if you look at what graphviz is supposed to do. I'll do some more work and post it as a github link later here but won't be a perfect solution.
Would you consider giving up the splines = ortho layout? Makes life so much easier...
I understand that a perfekt solution is not possible. But spline=ortho is not that important, so remove it if it make it easyer. You can also move the structure to the right if you want.
See my second answer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.