From 980b8d65ea36c9f0696a79849905a3d7236d114c Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 24 Mar 2020 21:58:58 -0400 Subject: [PATCH] what about dash? --- doc/Makefile | 1 + doc/what_about_dash.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 doc/what_about_dash.md diff --git a/doc/Makefile b/doc/Makefile index fa8e525dd6b..5e9861159a1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -30,6 +30,7 @@ $(IPYNB_FILES): $(IPYNB_DIR)/.mapbox_token $(IPYNB_DIR)/%.ipynb: $(MD_DIR)/%.md @mkdir -p $(IPYNB_DIR) @echo "[jupytext] $<" + @cat what_about_dash.md >> $< @jupytext $< --to notebook --quiet --output $@ $(HTML_DIR)/2019-07-03-%.html: $(IPYNB_DIR)/%.ipynb diff --git a/doc/what_about_dash.md b/doc/what_about_dash.md new file mode 100644 index 00000000000..e1cc88a4e1c --- /dev/null +++ b/doc/what_about_dash.md @@ -0,0 +1,28 @@ + + +### What About Dash? + +[Dash](https://dash.plot.ly/) is an open-source framework for building analytical applications, with no Javascript required, and it is tightly integrated with the Plotly graphing library. + +Learn about how to install Dash at https://dash.plot.ly/installation. + +Everywhere in this page that you see `fig.show()`, you can display the same figure in a Dash application by passing it to the `figure` argument of the [`Graph` component](https://dash.plot.ly/dash-core-components/graph) from the built-in `dash_core_components` package like this: + +```python +import plotly.graph_objects as go # or plotly.express as px +fig = go.Figure() # or any Plotly Express function e.g. px.bar(...) +# fig.add_trace( ... ) +# fig.update_layout( ... ) + +import dash +import dash_core_components as dcc +import dash_html_components as html + +app = dash.Dash() +app.layout = html.Div([ + dcc.Graph(figure=fig) +]) + +app.run_server(debug=True, use_reloader=False) # Turn off reloader if inside Jupyter +``` +