From 8cfa08ed1ca23ca67b1d3adf1674c29f9777d8f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ismael=20Venegas=20Castell=C3=B3?= <ismael.vc1337@gmail.com>
Date: Sun, 19 Mar 2017 21:42:21 -0600
Subject: [PATCH] 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.
---
 plotly/offline/offline.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py
index 2faba435705..d5c0f3978a7 100644
--- a/plotly/offline/offline.py
+++ b/plotly/offline/offline.py
@@ -511,7 +511,8 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
                 get_plotlyjs(),
                 '</script>',
                 plot_html,
-                '</div>'
+                resize_script,
+                '</div>',
             ])
         else:
             return plot_html