Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Sphinx's inheritance_diagram readable?

Similar to this chap's post, I'm seeing Sphinx generate unreadable graphviz output:

How can I generate readable output?

  • Nothing happens if I add -Gfontsize=140
  • If I tell it to use neato instead of dot it produces readable output, but the graphs aren't tree-like.
like image 445
Ross Rogers Avatar asked Jan 28 '10 01:01

Ross Rogers


1 Answers

I figured out the answer from this thread. In the graphviz.py code, they have a default value for the size of the graph at 8.0x12.0. If you want to allow Graphviz to determine the size you need to put this in conf.py so the Sphinx graphviz extension uses your empty string instead of its default:

inheritance_graph_attrs = dict(size='""')

Also, if you're hitting this issue then the graph may be too wide once you allow the size to be determined by Graphviz. You'll additionally want attribute rankdir="TB" so the tree goes from top to bottom instead of left to right:

inheritance_graph_attrs = dict(rankdir="TB", size='""')
like image 171
Ross Rogers Avatar answered Sep 22 '22 00:09

Ross Rogers