开发者

How can I make Sphinx's inheritance_diagram readable?

S开发者_开发技巧imilar to this chap's post, I'm seeing Sphinx generate unreadable graphviz output:

How can I make Sphinx's inheritance_diagram readable?

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.


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='""')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜