Gvstats - info about your Graphviz files

Here is a link to gvstats.gvpr, a program to report on your Graphviz files.
Sort of gc (https://www.graphviz.org/pdf/gc.1.pdf) on steroids.

From the help:

  a GVPR program that provides information about Graphviz input files
  - the file name
  - the layout engine  (if set)
  - node count
  - edge count
  - cluster count
  - HTML label count
  - record/Mrecord count
  - total Graph area   (if already processed by a layout engine)
  - total Node area    (if already processed by a layout engine)
  - node counts by degree (total edges connecting to a node)

  if the input file was previously processed by DOT
  - list of nodes per rank

  finally, the file itself, if the -c argument was provided to gvpr

And sample output:

/*****************************************************
  file:    	broken.gv
  nodes: 	  549
  edges: 	  353
  clusters: 	   98
  HTML labels: 	  635
    Clusters: 	   98
    Nodes: 	  537
  record nodes:	    0
  total Graph area: 17097.7 sq. in. -  372.8in x 45.9in
  total Node area:   1883.5 sq. in.

  (degree is the count of edges connecting to a node)
  degree:   0    node count:    95
  degree:   1    node count:   391
  degree:   2    node count:    11
  degree:   3    node count:     8
  degree:   4    node count:    13
  degree:   5    node count:    10
  degree:   6    node count:     8
  degree:   7    node count:     1
  degree:   8    node count:     4
  degree:   9    node count:     3
  degree:  10    node count:     3
  degree:  11    node count:     1
  degree:  12    node count:     1

  ranks: 	    9
    rank: 	    0  node count: 	   29
    rank: 	    1  node count: 	   89
    rank: 	    2  node count: 	  141
    rank: 	    3  node count: 	  117
    rank: 	    4  node count: 	   97
    rank: 	    5  node count: 	   46
    rank: 	    6  node count: 	   15
    rank: 	    7  node count: 	    9
    rank: 	    8  node count: 	    6

*****************************************************/
2 Likes

Same offer as always to add this to the Graphviz repo to then ship to users…

Fair enough. I’ll let this sit for about a week to see if any bugs are found quickly then get w/ the team to determine what is worth adding.

My next toy will probably be my “pretty close to finished” lint program. It is driven off the “graphviz.gitlab.io/content/en/docs/attrs/*.md” and will require make files of some sort & an “include” process.

Fun idea!