Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8e9f5ec

Browse files
authored
Merge pull request #22273 from QuLogic/better-inheritance
Improve inheritance diagrams
2 parents deb03d8 + aa1ae8d commit 8e9f5ec

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

doc/_static/mpl.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,13 @@ table.property-table td {
9999
display: inline-block;
100100
margin: 0 0.5em;
101101
}
102+
103+
/* Make inheritance images have a scroll bar if necessary. */
104+
div.graphviz {
105+
border: 1px solid lightgrey;
106+
max-height: 50em;
107+
overflow: auto;
108+
}
109+
img.graphviz.inheritance {
110+
max-width: none;
111+
}

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,12 @@ def js_tag_with_cache_busting(js):
619619

620620
numpydoc_show_class_members = False
621621

622-
inheritance_node_attrs = dict(fontsize=16)
622+
# We want to prevent any size limit, as we'll add scroll bars with CSS.
623+
inheritance_graph_attrs = dict(dpi=100, size='1000.0', splines='polyline')
624+
# Also remove minimum node dimensions, and increase line size a bit.
625+
inheritance_node_attrs = dict(height=0.02, margin=0.055, penwidth=1,
626+
width=0.01)
627+
inheritance_edge_attrs = dict(penwidth=1)
623628

624629
graphviz_dot = shutil.which('dot')
625630
# Still use PNG until SVG linking is fixed

0 commit comments

Comments
 (0)