Auto Color

Hello,

I have some Nodes called PG****** and some PP***** any Idee how to color all nodes starting with PG red and all with PP blue?

br
Markus

Use the gvpr command. If your

Use the gvpr command. If your input file is abc.gv, you would run

   gvpr -c 'N{if(name == "PG*") color="red"; else if (name=="PP*") color="blue";}' abc.gv  | dot -Tpng ....

 

thanks for your replay, sorry

thanks for your replay, sorry I am new at dot I have only played around via GUI. What I have to place instead of .... ?

 

 

If you are using a GUI, you

If you are using a GUI, you can store the output of gvpr into a file

  gvpr -c 'N{if(name == "PG*") color="red"; else if (name=="PP*") color="blue";}' abc.gv > abc2.gv

and open the GUI on abc2.gv. If you use the command line approach, the ... can be replaced by any additional flags you want. See

  http://www.graphviz.org/content/command-line-invocation

Also, png can be replaced by any supported output format. For example,

  gvpr -c 'N{if(name == "PG*") color="red"; else if (name=="PP*") color="blue";}' abc.gv | dot -Tsvg > abc.svg

on the command line i got

on the command line i got this error : gvpr: expected keyword BEGIN/END/N/E...; found ''', line 1 ... opening the gv in the GUI everything is ok

hier the first lines of my gv

~digraph a {
PG103IOA,PG103IUI -> PG103IOA ;
PG103IOA,PG103IUI -> PG103IOB ;
PG103IOA,PG103IUI -> PG103IOC ;

 

BR Markus

I'm guessing you are running

I'm guessing you are running on WIndows. Each shell language has its own quoting conventions. You need to replace the single quotes with whatever notation causes the whole string to be passed to gvpr as a single argument. Alternatively, open a text file, say, addcolor.txct, and put 

  N{if(name == "PG*") color="red"; else if (name=="PP*") color="blue";}

into it and write it. Then run

   gvpr -c -faddcolor.txt abc.gv

Recent comments