Repository: streamlit/streamlit

Issue:
Plotly privacy page outdated
The explanation on the "sharing" argument of the plotly_chart functions link to outdated content. I haven't checked how streamlit handles the new distinction between chart_studio and offline plotly but I guess the text should be rewritten


**Link to doc page in question (if any):**
[The streamlit.plotly_chart documentation says the following on the **sharing** argument:](https://docs.streamlit.io/api.html?highlight=plotly#streamlit.plotly_chart) 


> **sharing** ({'streamlit', 'private', 'secret', 'public'}) – Use ‘streamlit’ to insert the plot and all its dependencies directly in the Streamlit app, which means it works offline too. This is the default. Use any other sharing mode to send the app to Plotly’s servers, and embed the result into the Streamlit app. See https://plot.ly/python/privacy/ for more. Note that these sharing modes require a Plotly account.

**What you think the docs should say:**

**sharing** ({'streamlit', 'private', 'secret', 'public'}) – Use ‘streamlit’ to insert the plot and all its dependencies directly in the Streamlit app, which means it uses plotly's offline mode. Use any other sharing mode to use Plotly’s chart studio. Nb: Plotly chart studio requires an account.







Discussion:
Hey @cedias, thanks for the report - I've added this to our internal board! 

I'm having a hard time understanding the substance of the change, however; what is incorrect (or confusing) about the current docs? I'm not sure what you mean by the explanation linking to outdated content.
> I'm having a hard time understanding the substance of the change, however; what is incorrect (or confusing) about the current docs? I'm not sure what you mean by the explanation linking to outdated content.

I'm sorry for being unclear: 

- Since plotly version 4.0, plots generated by the `plotly.plot.plot()` associated methods are no longer online by default. Plotly became more like bokeh, a javascript powered plotting lib. The online functions were put within a special package `chart_studio`. (see here: https://community.plot.ly/t/introducing-plotly-py-4-0-0/25639)

- The documentation refers to the [following page](https://plot.ly/python/privacy) which is outdated : It explains that by default, plotly.iplot() and plotly.plot() create public graphs. Which is not true anymore.

That is why i believe that the documentation should be clearer

Also, you maybe want to change the name of the "sharing" argument to "chart_studio"  to make things more clear. (IMO, chart studio should probably be handled separately to avoid sending a graph to the cloud at each rerun)


Resolving patch:
diff --git a/lib/streamlit/elements/plotly_chart.py b/lib/streamlit/elements/plotly_chart.py
--- a/lib/streamlit/elements/plotly_chart.py
+++ b/lib/streamlit/elements/plotly_chart.py
@@ -41,7 +41,11 @@
 
 class PlotlyMixin:
     def plotly_chart(
-        dg, figure_or_data, use_container_width=False, sharing="streamlit", **kwargs,
+        dg,
+        figure_or_data,
+        use_container_width=False,
+        sharing="streamlit",
+        **kwargs,
     ):
         """Display an interactive Plotly chart.
 
@@ -62,12 +66,9 @@ def plotly_chart(
 
         sharing : {'streamlit', 'private', 'secret', 'public'}
             Use 'streamlit' to insert the plot and all its dependencies
-            directly in the Streamlit app, which means it works offline too.
-            This is the default.
-            Use any other sharing mode to send the app to Plotly's servers,
-            and embed the result into the Streamlit app. See
-            https://plot.ly/python/privacy/ for more. Note that these sharing
-            modes require a Plotly account.
+            directly in the Streamlit app using plotly's offline mode (default).
+            Use any other sharing mode to send the chart to Plotly chart studio, which
+            requires an account. See https://plotly.com/chart-studio/ for more information.
 
         **kwargs
             Any argument accepted by Plotly's `plot()` function.


Test patch: