We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6665a0 commit 2cc3727Copy full SHA for 2cc3727
plotly/io/_html.py
@@ -157,8 +157,15 @@ def to_html(fig,
157
158
# Get div width/height
159
layout_dict = fig_dict.get('layout', {})
160
- div_width = layout_dict.get('width', default_width)
161
- div_height = layout_dict.get('height', default_height)
+ template_dict = (fig_dict
+ .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))
169
170
# Add 'px' suffix to numeric widths
171
try:
0 commit comments