Skip to content

Commit 2cc3727

Browse files
authored
Check for figure height in the figure template in html export (#1579)
1 parent d6665a0 commit 2cc3727

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: plotly/io/_html.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,15 @@ def to_html(fig,
157157

158158
# Get div width/height
159159
layout_dict = fig_dict.get('layout', {})
160-
div_width = layout_dict.get('width', default_width)
161-
div_height = layout_dict.get('height', default_height)
160+
template_dict = (fig_dict
161+
.get('layout', {})
162+
.get('template', {})
163+
.get('layout', {}))
164+
165+
div_width = layout_dict.get(
166+
'width', template_dict.get('width', default_width))
167+
div_height = layout_dict.get(
168+
'height', template_dict.get('height', default_height))
162169

163170
# Add 'px' suffix to numeric widths
164171
try:

0 commit comments

Comments
 (0)