Recommend better way to show data graphically

I want to show data from a database graphically.
I need directed graph (I mean graph with arrows).
I want to trace each relationsip from one node to another.
I also want to make it compact (it tends to be huge, this sample it not full).
I don’t care about nested levels or indentation of each level.

Here is a simple result of what I’ve done (see attachments).
I don’t like how it is shown now because I can’t trace each arrow (they are stick together).
What can I do to make it better?
A small code sample would be also desirable.

I create it this way:
“C:\Program Files\Graphviz\bin\dot.exe” -Tsvg -O -Kdot “C:\graph\input.graphviz”

Here is a code sample:

Here is a result.
I failed to load it to your forum so uploaded its content here (just rename extension to svg or generate the code itself):
https://pastebin.com/skWAX8vT

First note that there 16 nodes with more that 10 edges, one has 45 edges. Perfectly legal, of course, but it starts to get messy.

Better is in the eye of the beholder, but here are

  • changes to your input
  • a longer set of commands
  • and an output that compares results from four of the layout engines (dot, neato, fdp, and twopi)

The changes, all go at the beginning of your input file

strict // no multi-edges
digraph G {
rankdir=LR;         // try both ways,  only used by dot
ranksep=2.4         // spread out ranks,  only used by dot & twopi
overlap=false       // only used by neato and fdp
node [shape=rect]   // somewhat smaller footprint than ellipse

Note that strict only seems to be described in this document: https://www.graphviz.org/pdf/dotguide.pdf (see p28)

The command set:

unflatten -f -l4  myfile.gv | dot | edgepaint | neato  -n2 -Tsvg >myfile.svg

unflatten will try to break-up long rows/columns and is described here: https://www.graphviz.org/pdf/unflatten.1.pdf
edgepaint changes the colors of edges to make them easier to follow and is described here: https://www.graphviz.org/pdf/edgepaint.1.pdf
neato -n2 take the result of the earlier programs & generate the final image file and is described here: FAQ | Graphviz

Output of the four layout engines smooshed into one file (sorry, save it to disk & the display/zoom/magnify):

1 Like

Yes, if the network is very dense, maybe use a heat map (matrix) or other representation, instead of a graph layout.

It’s covered in the online documentation, DOT Language | Graphviz

Note that the neato and fdp graphs were not “tuned”. I expect that both could be made “better” (eye of the beholder).
Neato in particular has lots of potential attributes to adjust.

It’s one of those frou frou language features that we made because it seemed cool, and it does get rid of multi edges but it’s a little strange. I think that when attributes are set on repeated instances of the same edge in a strict graph, the last setting wins, but maybe it would make more sense to sum or concatenate values somehow (we don’t have have types so that’s a further complication).