Flexible node size?

I am new to dot and Graphviz. I am using GVEdit (1.02) and Graphviz (2.36) to create directed graphs. I have three questions that I haven't found the answer to anywhere on the web or in this forum, I am hoping someone here can answer:

1)Is it possible to set the size of the nodes to be determined by the number of edges connected to them? I.e the more edges (arrows), the larger the node.

2)I always seem to get the message: "Warning: : syntax error in line 1 near ';'" when I first press the layout button. If I press it again, the graph is generated. Why is this? Line 1 looks like this:
digraph FlowTest {

3)Does anyone have experience from generating .dot-files and directed graphs based on Excel tables? Eg. generate dot file with VBA coding. If so, would it be possible to share a file with some nice coding examples?


1) The layout programs draw

1) The layout programs draw the graph with the given specifications. In particular, the input graph can specify node sizes, but these need to be set before running the layout program. If you have written a program to generate your graph, you can set the size there. If you already have the graph, you can use the gvpr program to add this information. For example, suppose your graph is in the file g.gv. Then you can run

  gvpr -c 'N{$.width=0.5*$.degree}' g.gv | dot -Tpng > g.png

which will set the width of a node to be 0.5 times the number of edges, in inches. You can change the expression to whatever you want; you can set the height separately. The above will work in a Unix command shell like bash or ksh. For different shells, you will need a different quoting mechanism, or you can put the gvpr program in a file and use the -f flag to specify that.

2) I'm not seeing this when I run gvedit from 2.36. Can you provide more details as to what you are doing?


Recent comments