Skip to content

Commit 8cfa08e

Browse files
authored
Make offline embedded <div> plots responsive.
This PR enables responsiveness in offline plots, where `output_type = 'div'` and not just if `output_type = 'file'`. I've been making use of [Django-JET](https://github.com/geex-arts/django-jet) dashboard widget plugins in order to embed a Plotly graph. Before this change I would have to reload the page every time I resized the browser window in order to make the plot resize to the new sizes.
1 parent 4b45341 commit 8cfa08e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: plotly/offline/offline.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
511511
get_plotlyjs(),
512512
'</script>',
513513
plot_html,
514-
'</div>'
514+
resize_script,
515+
'</div>',
515516
])
516517
else:
517518
return plot_html

0 commit comments

Comments
 (0)