Skip to content

Commit be0e083

Browse files
authored
Merge branch 'master' into patch-1
2 parents 9f94cfa + 0589e43 commit be0e083

35 files changed

+777
-65
lines changed

Diff for: .circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
browser-tools: circleci/[email protected].6
4+
browser-tools: circleci/[email protected].8
55

66
commands:
77
test_core:

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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.20.0] - 2024-03-13
6+
7+
### Updated
8+
- Updated Plotly.js from version 2.29.1 to version 2.30.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2300----2024-03-06) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
9+
- Add fill gradients for scatter traces [[#6905](https://github.com/plotly/plotly.js/pull/6905)], with thanks to @lumip for the contribution!
10+
- Add `indentation` to legend [[#6874](https://github.com/plotly/plotly.js/pull/6874)], with thanks to @my-tien for the contribution!
11+
512
## [5.19.0] - 2024-02-15
613

714
### Updated

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.19.0`
36+
`pip install plotly==5.20.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.19.0
81+
pip install plotly==5.20.0
8282
```
8383

8484
or conda.
8585

8686
```
87-
conda install -c plotly plotly=5.19.0
87+
conda install -c plotly plotly=5.20.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.19.0 @jupyter-widgets/jupyterlab-manager
109+
jupyter labextension install jupyterlab-plotly@5.20.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.19.0
2+
plotly==5.20.0
33
jupyter
44
notebook
55
pandas==1.2.0

Diff for: contributing.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,30 @@ the `plotly/plotly.js` GitHub repository (and place them in
224224
`plotly/package_data`). It will then regenerate all of the `graph_objs`
225225
classes based on the new schema.
226226

227-
For dev branches, it is also possible to use `updateplotlyjsdev --devrepo reponame --devbranch branchname` to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.
227+
For dev branches, it is also possible to use `updateplotlyjsdev` in two configurations:
228+
229+
### CircleCI Release
230+
231+
If your devbranch is part of the official plotly.js repository, you can use
232+
```bash
233+
python setup.py updateplotlyjsdev --devrepo reponame --devbranch branchname
234+
```
235+
to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.
236+
237+
### Local Repository
238+
239+
If you have a local repository of `plotly.js` you'd like to try, you can run:
240+
241+
```bash
242+
# In your plotly.js/ directory, prepare the package:
243+
244+
$ npm run build
245+
$ npm pack
246+
$ mv plotly.js-*.tgz plotly.js.tgz
247+
248+
# In your plotly.py/packages/python/plotly/ directory:
249+
$ python setup.py updateplotlyjsdev --local /path/to/your/plotly.js/
250+
```
228251

229252
## Testing
230253

Diff for: doc/apidoc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ""
2828
# The full version, including alpha/beta/rc tags
29-
release = "5.19.0"
29+
release = "5.20.0"
3030

3131

3232
# -- General configuration ---------------------------------------------------

Diff for: doc/python/filled-area-plots.md

+42-6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.1
9+
jupytext_version: 1.16.1
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.8.8
23+
version: 3.10.11
2424
plotly:
2525
description: How to make filled area plots in Python with Plotly.
2626
display_as: basic
@@ -80,13 +80,11 @@ fig = px.area(df, x="medal", y="count", color="nation",
8080
fig.show()
8181
```
8282

83-
<!-- #region tags=[] -->
8483
### Filled area chart with plotly.graph_objects
8584

8685
#### Basic Overlaid Area Chart
87-
<!-- #endregion -->
8886

89-
```python tags=[]
87+
```python
9088
import plotly.graph_objects as go
9189

9290
fig = go.Figure()
@@ -131,6 +129,44 @@ fig.add_trace(go.Scatter(
131129
fig.show()
132130
```
133131

132+
#### Gradient Fill
133+
134+
*New in 5.20*
135+
136+
Scatter traces with a fill support a `fillgradient`, which is a `dict` of options that defines the gradient. Use `fillgradient.colorscale` to define the [colorscale](https://plotly.com/python/colorscales) for the gradient and choose a `type` to define the orientation of the gradient (`'horizontal'`, `'vertical'` or `'radial'`).
137+
138+
In the following example, we've defined a `horizontal` `fillgradient` with a colorscale of three colors.
139+
140+
```python
141+
import plotly.graph_objects as go
142+
143+
fig = go.Figure(
144+
[
145+
go.Scatter(
146+
x=[1, 2, 3, 4],
147+
y=[3, 4, 8, 3],
148+
fill=None,
149+
mode="lines",
150+
line_color="darkblue",
151+
),
152+
go.Scatter(
153+
x=[1, 2, 3, 4],
154+
y=[1, 6, 2, 6],
155+
fill="tonexty",
156+
mode="lines",
157+
line_color="darkblue",
158+
fillgradient=dict(
159+
type="horizontal",
160+
colorscale=[(0.0, "darkblue"), (0.5, "royalblue"), (1.0, "cyan")],
161+
),
162+
),
163+
]
164+
)
165+
166+
fig.show()
167+
168+
```
169+
134170
#### Stacked Area Chart
135171

136172
The `stackgroup` parameter is used to add the `y` values of the different traces in the same group. Traces in the same group fill up to the next trace of the group.

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.19.0
61+
$ pip install plotly==5.20.0
6262
```
6363

6464
or `conda`:
6565

6666
```
67-
$ conda install -c plotly plotly=5.19.0
67+
$ conda install -c plotly plotly=5.20.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.19.0 @jupyter-widgets/jupyterlab-manager
155+
jupyter labextension install jupyterlab-plotly@5.20.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/legend.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.7
9+
jupytext_version: 1.16.1
1010
kernelspec:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.10.4
23+
version: 3.10.11
2424
plotly:
2525
description: How to configure and style the legend in Plotly with Python.
2626
display_as: file_settings
@@ -546,6 +546,40 @@ fig.update_layout(title="Try Clicking on the Legend Items!")
546546
fig.show()
547547
```
548548

549+
#### Indent Legend Entries
550+
551+
*New in 5.20*
552+
553+
To indent legend entries, set `indenation` on `layout.legend` to a number of pixels. In the following example, we indent legend entries by 10 pixels.
554+
555+
```python
556+
import plotly.graph_objects as go
557+
from plotly import data
558+
559+
df = data.iris()
560+
561+
fig = go.Figure(
562+
[
563+
go.Scatter(
564+
x=df[df["species"] == species]["sepal_width"],
565+
y=df[df["species"] == species]["sepal_length"],
566+
mode="markers",
567+
name=species,
568+
)
569+
for species in df["species"].unique()
570+
],
571+
layout=dict(
572+
legend=dict(
573+
title="Species",
574+
indentation=10
575+
)
576+
),
577+
)
578+
579+
580+
fig.show()
581+
```
582+
549583
#### Group click toggle behavior
550584

551585
*New in v5.3*

Diff for: doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plotly==5.19.0
1+
plotly==5.20.0
22
jupytext==1.1.1
33
ipywidgets==7.7.2
44
jupyter-client<7

0 commit comments

Comments
 (0)