Skip to content

Commit 05fb01d

Browse files
authored
Merge branch 'doc-prod' into add-dashclub
2 parents 9f09c39 + 0d151fe commit 05fb01d

File tree

103 files changed

+4669
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4669
-373
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [5.10.0] - 2022-08-11
6+
7+
### Updated
8+
- Updated Plotly.js to from version 2.12.1 to version 2.14.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2140----2022-08-10) for more information. Notable changes include:
9+
- Add support for `sankey` links with arrows
10+
- Add `selections`, `newselection` and `activeselection` layout attributes to have persistent and editable selections over cartesian subplots
11+
- Add `unselected.line.color` and `unselected.line.opacity` options to `parcoords` trace
12+
- Display Plotly's new logo in the modebar
513

614
## [5.9.0] - 2022-06-23
715

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
## Quickstart
3535

36-
`pip install plotly==5.9.0`
36+
`pip install plotly==5.10.0`
3737

3838
Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`):
3939

@@ -78,13 +78,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
7878
plotly.py may be installed using pip...
7979

8080
```
81-
pip install plotly==5.9.0
81+
pip install plotly==5.10.0
8282
```
8383

8484
or conda.
8585

8686
```
87-
conda install -c plotly plotly=5.9.0
87+
conda install -c plotly plotly=5.10.0
8888
```
8989

9090
### JupyterLab Support
@@ -106,7 +106,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
106106

107107
```
108108
# JupyterLab 2.x renderer support
109-
jupyter labextension install jupyterlab-plotly@5.9.0 @jupyter-widgets/jupyterlab-manager
109+
jupyter labextension install jupyterlab-plotly@5.10.0 @jupyter-widgets/jupyterlab-manager
110110
```
111111

112112
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.

Diff for: binder/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==5.9.0
2+
plotly==5.10.0
33
jupyter
44
notebook
55
pandas==1.0.3

Diff for: contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the structure of the code and of the repository.
2424
in `packages/python/plotly/codegen`. Most of the codegen code concerns the generation of docstrings from
2525
the schema JSON in Plotly.js. Traces and
2626
Layout classes have a direct correspondence with their Javascript
27-
counterpart. Higher-level methods that work on on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `packages/python/plotly/plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
27+
counterpart. Higher-level methods that work on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `packages/python/plotly/plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
2828
`update_layout`, `add_trace`, etc.
2929

3030
- [the `plotly.express` module](https://plotly.com/python/plotly-express/) (usually imported as `px`) is a high-level

Diff for: doc/apidoc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# The short X.Y version
2929
version = ""
3030
# The full version, including alpha/beta/rc tags
31-
release = "5.9.0"
31+
release = "5.10.0"
3232

3333

3434
# -- General configuration ---------------------------------------------------

Diff for: doc/python/axes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The different groups of Cartesian axes properties are
8686
- range of the axis
8787
- domain of the axis
8888

89-
The examples on this page apply to axes of any type, but extra attributes are available for [axes of type `category`](/pythone/categorical-axes/) and [axes of type `date`](/python/time-series/).
89+
The examples on this page apply to axes of any type, but extra attributes are available for [axes of type `category`](/python/categorical-axes/) and [axes of type `date`](/python/time-series/).
9090

9191

9292
#### Set and Style Axes Title Labels

Diff for: doc/python/box-plots.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jupyter:
88
format_version: '1.3'
99
jupytext_version: 1.14.1
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -94,7 +94,7 @@ fig.show()
9494

9595
### Choosing The Algorithm For Computing Quartiles
9696

97-
By default, quartiles for box plots are computed using the `linear` method (for more about linear interpolation, see #10 listed on [http://www.amstat.org/publications/jse/v14n3/langford.html](http://www.amstat.org/publications/jse/v14n3/langford.html) and [https://en.wikipedia.org/wiki/Quartile](https://en.wikipedia.org/wiki/Quartile) for more details).
97+
By default, quartiles for box plots are computed using the `linear` method (for more about linear interpolation, see #10 listed on [http://jse.amstat.org/v14n3/langford.html](http://jse.amstat.org/v14n3/langford.html) and [https://en.wikipedia.org/wiki/Quartile](https://en.wikipedia.org/wiki/Quartile) for more details).
9898

9999
However, you can also choose to use an `exclusive` or an `inclusive` algorithm to compute quartiles.
100100

Diff for: doc/python/getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ We also encourage you to join the [Plotly Community Forum](http://community.plot
5858
`plotly` may be installed using `pip`:
5959

6060
```
61-
$ pip install plotly==5.9.0
61+
$ pip install plotly==5.10.0
6262
```
6363

6464
or `conda`:
6565

6666
```
67-
$ conda install -c plotly plotly=5.9.0
67+
$ conda install -c plotly plotly=5.10.0
6868
```
6969
This package contains everything you need to write figures to standalone HTML files.
7070

@@ -152,7 +152,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
152152

153153
```
154154
# JupyterLab 2.x renderer support
155-
jupyter labextension install jupyterlab-plotly@5.9.0 @jupyter-widgets/jupyterlab-manager
155+
jupyter labextension install jupyterlab-plotly@5.10.0 @jupyter-widgets/jupyterlab-manager
156156
```
157157

158158
Please check out our [Troubleshooting guide](/python/troubleshooting/) if you run into any problems with JupyterLab, particularly if you are using multiple python environments inside Jupyter.

Diff for: doc/python/hover-text-and-formatting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fig.show()
187187

188188
### Customizing hover text with a hovertemplate
189189

190-
To customize the tooltip on your graph you can use the [hovertemplate](https://plotly.com/python/reference/pie/#pie-hovertemplate) attribute of `graph_objects` tracces, which is a template string used for rendering the information that appear on hoverbox.
190+
To customize the tooltip on your graph you can use the [hovertemplate](https://plotly.com/python/reference/pie/#pie-hovertemplate) attribute of `graph_objects` traces, which is a template string used for rendering the information that appear on hoverbox.
191191
This template string can include `variables` in %{variable} format, `numbers` in [d3-format's syntax](https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format), and `date` in [d3-time-format's syntax](https://github.com/d3/d3-time-format). In the example below, the empty `<extra></extra>` tag removes the part of the hover where the trace name is usually displayed in a contrasting color. The `<extra>` tag can be used to display other parts of the hovertemplate, it is not reserved for the trace name.
192192

193193
Note that a hovertemplate customizes the tooltip text, while a [texttemplate](https://plotly.com/python/reference/pie/#pie-texttemplate) customizes the text that appears on your chart. <br>

Diff for: doc/python/indicator.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
9-
jupytext_version: 1.2.1
8+
format_version: '1.3'
9+
jupytext_version: 1.13.7
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.3
23+
version: 3.9.0
2424
plotly:
2525
description: How to make gauge charts in Python with Plotly.
2626
display_as: financial
@@ -61,6 +61,8 @@ In this tutorial we introduce a new trace named "Indicator". The purpose of "ind
6161
<li> (increasing|decreasing).symbol: symbol displayed on the left of the delta</li>
6262
<li> font.(family|size): to control the font</li>
6363
<li> position: position relative to `number` (either top, left, bottom, right)</li>
64+
<li> prefix: a string to appear before the delta
65+
<li> suffix: a string to appear after the delta
6466
</ol>
6567
Finally, we can have a simple title for the indicator via `title` with 'text' attribute which is a string, and 'align' which can be set to left, center, and right.
6668
There are two gauge types: [angular](https://plotly.com/python/gauge-charts/) and [bullet](https://plotly.com/python/bullet-charts/). Here is a combination of both shapes (angular, bullet), and different modes (gauge, delta, and value):
@@ -201,6 +203,31 @@ fig.add_trace(go.Indicator(
201203
fig.show()
202204
```
203205

206+
#### Adding a Prefix and Suffix
207+
208+
209+
On both a `number` and a `delta`, you can add a string to appear before the value using `prefix`. You can add a string to appear after the value using `suffix`. In the following example, we add '$' as a `prefix` and 'm' as `suffix` for both the `number` and `delta`.
210+
211+
Note: `suffix` and `prefix` on `delta` are new in 5.10
212+
213+
```python
214+
import plotly.graph_objects as go
215+
216+
fig = go.Figure(go.Indicator(
217+
mode = "number+delta",
218+
value = 492,
219+
number = {"prefix": "$", "suffix": "m"},
220+
delta = {"reference": 512, "valueformat": ".0f", "prefix": "$", "suffix": "m"},
221+
title = {"text": "Profit"},
222+
domain = {'y': [0, 1], 'x': [0.25, 0.75]}))
223+
224+
fig.add_trace(go.Scatter(
225+
y = [325, 324, 405, 400, 424, 404, 417, 432, 419, 394, 410, 426, 413, 419, 404, 408, 401, 377, 368, 361, 356, 359, 375, 397, 394, 418, 437, 450, 430, 442, 424, 443, 420, 418, 423, 423, 426, 440, 437, 436, 447, 460, 478, 472, 450, 456, 436, 418, 429, 412, 429, 442, 464, 447, 434, 457, 474, 480, 499, 497, 480, 502, 512, 492]))
226+
227+
fig.update_layout(xaxis = {'range': [0, 62]})
228+
fig.show()
229+
```
230+
204231
#### Reference
205232
See https://plotly.com/python/reference/indicator/ for more information and chart attribute options!
206233

Diff for: doc/python/parallel-coordinates-plot.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ 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.3'
9+
jupytext_version: 1.13.7
1010
kernel_info:
1111
name: python2
1212
kernelspec:
13-
display_name: Python 3
13+
display_name: Python 3 (ipykernel)
1414
language: python
1515
name: python3
1616
language_info:
@@ -22,7 +22,7 @@ jupyter:
2222
name: python
2323
nbconvert_exporter: python
2424
pygments_lexer: ipython3
25-
version: 3.7.3
25+
version: 3.9.0
2626
plotly:
2727
description: How to make parallel coordinates plots in Python with Plotly.
2828
display_as: scientific
@@ -171,6 +171,39 @@ fig = go.Figure(data=
171171
fig.show()
172172
```
173173

174+
### Unselected Line Color and Opacity
175+
176+
177+
*New in 5.10*
178+
179+
The color and opacity of unselected lines can be set with `unselected`. By setting `opacity=0`, you can hide the unselected lines. Here, we set the color to `lightgray` and the opacity to `0.5`.
180+
181+
```python
182+
import plotly.graph_objects as go
183+
184+
fig = go.Figure(data=
185+
go.Parcoords(
186+
line_color='blue',
187+
dimensions = list([
188+
dict(range = [1,5],
189+
constraintrange = [1,2], # change this range by dragging the pink line
190+
label = 'A', values = [1,4]),
191+
dict(range = [1.5,5],
192+
tickvals = [1.5,3,4.5],
193+
label = 'B', values = [3,1.5]),
194+
dict(range = [1,5],
195+
tickvals = [1,2,4,5],
196+
label = 'C', values = [2,4],
197+
ticktext = ['text 1', 'text 2', 'text 3', 'text 4']),
198+
dict(range = [1,5],
199+
label = 'D', values = [4,2])
200+
]),
201+
unselected = dict(line = dict(color = 'green', opacity = 0.5))
202+
)
203+
)
204+
fig.show()
205+
```
206+
174207
#### Reference
175208

176209
See [function reference for `px.(parallel_coordinates)`](https://plotly.com/python-api-reference/generated/plotly.express.parallel_coordinates) or https://plotly.com/python/reference/parcoords/ for more information and chart attribute options!

0 commit comments

Comments
 (0)