Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I only show some nodes (edges) on graphviz and not others

I have a very complex graph, and there is no way that I can show it all and understand it. I need to make simplified versions of it showing only some nodes and not others. I don't just want the other nodes to be invisible, but to really be absent (so that the graph is simplified).

The solution would be to make a graph with only some layers. But is that possible? What other options are there?

Thanks, Pietro

like image 990
Pietro Speroni Avatar asked Apr 20 '10 10:04

Pietro Speroni


1 Answers

I found a possible solution. It uses gvpr which is already installed if you have graphviz (at least it was in my machine).

You can set up gvpr to read a .dot file, follow some instructions and produce another .dot file.

So I added a property "tag="TAGfoo TAGgoo TAGsoo". There are probably better ways but since I need to use regular expression, this works well enough.

Then the command:

gvpr  -i 'N[tag=="(*TAGfoo*|*TAGgoo*)"]'  filesource.dot >fileproduced.dot

will take all and only the nodes that have TAGfoo or TAGgoo.

It could be made cleaner.

like image 59
Pietro Speroni Avatar answered Sep 21 '22 17:09

Pietro Speroni