hide some nodes in graphviz while preserving the relationships between visible nodes

skullnobrains
skullnobrains used Ask the Experts™
on
hello all

i am trying to hide some nodes in graphviz while preserving the relationships between visible nodes

a -> b
b -> c
b[style=invis]

should be somehow transformed into

a -> c

----

one simple real use case is the following
which i'm generating quite simply by hiding all the libs from debtree's output

#debtree -I -R -r --show-all --rdeps-depth=100 --max-depth=0 x11-common | sed "/\"lib/ s/style=filled/style=invis/"
digraph "x11-common" {
	node [shape=box];
	"libice6" -> "x11-common" [color=blue];
	"libice6" [style=invis,fillcolor=azure];
	"libxt6" -> "libice6" [color=blue];
	"libsm6" -> "libice6" [color=blue];
	"libxt6" [style=invis,fillcolor=azure];
	"graphviz" -> "libxt6" [color=blue];
	"libxmu6" -> "libxt6" [color=blue];
	"libxaw7" -> "libxt6" [color=blue];
	"graphviz" [style=filled,fillcolor=azure];
	"debtree" -> "graphviz";
	"debtree" [style=filled,fillcolor=azure];
	"libxmu6" [style=invis,fillcolor=azure];
	"graphviz" -> "libxmu6" [color=blue];
	"libxaw7" -> "libxmu6" [color=blue];
	"libxaw7" [style=invis,fillcolor=azure];
	"graphviz" -> "libxaw7" [color=blue];
	"libsm6" [style=invis,fillcolor=azure];
	"libxt6" -> "libsm6" [color=blue];
	"x11-common" [style="setlinewidth(2),filled",fillcolor=honeydew];
}

Open in new window


i expect to produce a simple graph with "debtree -> graphviz -> x11-common"

any way to achieve that in graphviz alone without parsing the whole thing ?

thanks for your time
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial