Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0c4424

Browse files
Merge pull request #2919 from plotly/add-dash-snippets
5 new dash snippets
2 parents 07f2cca + 5069f0c commit c0c4424

File tree

5 files changed

+88
-13
lines changed

5 files changed

+88
-13
lines changed

doc/python/animations.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,22 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: "1.1"
9-
jupytext_version: 1.1.6
8+
format_version: '1.2'
9+
jupytext_version: 1.6.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
1313
name: python3
14+
language_info:
15+
codemirror_mode:
16+
name: ipython
17+
version: 3
18+
file_extension: .py
19+
mimetype: text/x-python
20+
name: python
21+
nbconvert_exporter: python
22+
pygments_lexer: ipython3
23+
version: 3.7.6
1424
plotly:
1525
description: An introduction to creating animations with Plotly in Python.
1626
display_as: animations
@@ -37,6 +47,19 @@ px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_gro
3747
log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90])
3848
```
3949

50+
#### Animated figures in Dash
51+
52+
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
53+
54+
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with <a style="color:red;" href="https://plotly.com/dash/">Dash Enterprise</a>.**
55+
56+
57+
```python hide_code=true
58+
from IPython.display import IFrame
59+
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
60+
IFrame(snippet_url + 'animations', width='100%', height=630)
61+
```
62+
4063
#### Animated Bar Charts with Plotly Express
4164

4265
Note that you should always fix the `y_range` to ensure that your data remains visible throughout the animation.

doc/python/candlestick-charts.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
9-
jupytext_version: 1.1.1
8+
format_version: '1.2'
9+
jupytext_version: 1.6.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.7
23+
version: 3.7.6
2424
plotly:
2525
description: How to make interactive candlestick charts in Python with Plotly.
2626
Six examples of candlestick charts with Pandas, time series, and yahoo finance
@@ -74,6 +74,19 @@ fig.update_layout(xaxis_rangeslider_visible=False)
7474
fig.show()
7575
```
7676

77+
#### Candlestick in Dash
78+
79+
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
80+
81+
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with <a style="color:red;" href="https://plotly.com/dash/">Dash Enterprise</a>.**
82+
83+
84+
```python hide_code=true
85+
from IPython.display import IFrame
86+
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
87+
IFrame(snippet_url + 'candlestick-charts', width='100%', height=630)
88+
```
89+
7790
#### Adding Customized Text and Annotations
7891

7992
```python
@@ -144,4 +157,4 @@ fig.show()
144157
```
145158

146159
#### Reference
147-
For more information on candlestick attributes, see: https://plotly.com/python/reference/candlestick/
160+
For more information on candlestick attributes, see: https://plotly.com/python/reference/candlestick/

doc/python/figure-structure.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.4.2
9+
jupytext_version: 1.6.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.7
23+
version: 3.7.6
2424
plotly:
2525
description: The structure of a figure - data, traces and layout explained.
2626
display_as: file_settings
@@ -49,6 +49,19 @@ print(fig)
4949
fig.show()
5050
```
5151

52+
### Accessing figure structures in Dash
53+
54+
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
55+
56+
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with <a style="color:red;" href="https://plotly.com/dash/">Dash Enterprise</a>.**
57+
58+
59+
```python hide_code=true
60+
from IPython.display import IFrame
61+
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
62+
IFrame(snippet_url + 'figure-structure', width='100%', height=630)
63+
```
64+
5265
### Figures as Trees of Attributes
5366

5467
Plotly.js supports inputs adhering to a well-defined schema, whose overall architecture is explained in this page and which is exhaustively documented in the [Figure Reference](/python/reference/index/) (which is itself generated from a [machine-readable JSON representation of the schema](https://raw.githubusercontent.com/plotly/plotly.js/master/dist/plot-schema.json)). Figures are represented as trees with named nodes called "attributes". The root node of the tree has three top-level attributes: `data`, `layout` and `frames` (see below).

doc/python/plot-data-from-csv.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: "1.1"
9-
jupytext_version: 1.2.0
8+
format_version: '1.2'
9+
jupytext_version: 1.6.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.8
23+
version: 3.7.6
2424
plotly:
2525
description: How to create charts from csv files with Plotly and Python
2626
display_as: advanced_opt
@@ -56,6 +56,19 @@ fig = px.line(df, x = 'AAPL_x', y = 'AAPL_y', title='Apple Share Prices over tim
5656
fig.show()
5757
```
5858

59+
### Plot from CSV in Dash
60+
61+
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
62+
63+
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with <a style="color:red;" href="https://plotly.com/dash/">Dash Enterprise</a>.**
64+
65+
66+
```python hide_code=true
67+
from IPython.display import IFrame
68+
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
69+
IFrame(snippet_url + 'plot-data-from-csv', width='100%', height=630)
70+
```
71+
5972
### Plot from CSV with `graph_objects`
6073

6174
```python

doc/python/sankey-diagram.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.3.1
9+
jupytext_version: 1.6.0
1010
kernel_info:
1111
name: python2
1212
kernelspec:
@@ -22,7 +22,7 @@ jupyter:
2222
name: python
2323
nbconvert_exporter: python
2424
pygments_lexer: ipython3
25-
version: 3.6.8
25+
version: 3.7.6
2626
plotly:
2727
description: How to make Sankey Diagrams in Python with Plotly.
2828
display_as: basic
@@ -104,6 +104,19 @@ fig.update_layout(title_text="Energy forecast for 2050<br>Source: Department of
104104
fig.show()
105105
```
106106

107+
### Sankey Diagram in Dash
108+
109+
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
110+
111+
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with <a style="color:red;" href="https://plotly.com/dash/">Dash Enterprise</a>.**
112+
113+
114+
```python hide_code=true
115+
from IPython.display import IFrame
116+
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
117+
IFrame(snippet_url + 'sankey-diagram', width='100%', height=630)
118+
```
119+
107120
### Style Sankey Diagram
108121
This example also uses [hovermode](https://plotly.com/python/reference/layout/#layout-hovermode) to enable multiple tooltips.
109122

0 commit comments

Comments
 (0)