Skip to content

Commit 737e466

Browse files
authored
Merge branch 'master' into update-dash-imports
2 parents ddba96e + 956ab2c commit 737e466

File tree

748 files changed

+25659
-2913
lines changed

Some content is hidden

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

748 files changed

+25659
-2913
lines changed

.circleci/config.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ jobs:
150150
- test_optional:
151151
py: "39"
152152

153+
# Pandas
154+
155+
python_39_pandas_2_optional:
156+
docker:
157+
- image: circleci/python:3.9-buster-node-browsers
158+
steps:
159+
- test_optional:
160+
py: "39_pandas_2"
161+
153162
# Orca
154163
python_38_orca:
155164
docker:
@@ -190,6 +199,7 @@ jobs:
190199
- run:
191200
name: Run percy snapshots
192201
command: |
202+
npm i @percy/cli
193203
npx percy snapshot test/percy/
194204
rm test/percy/*.html
195205
@@ -263,8 +273,9 @@ jobs:
263273
name: Create conda environment
264274
command: |
265275
conda create -n env --yes python=3.9 conda-build conda-verify
266-
conda install -n env -c conda-forge jupyterlab nodejs=12
276+
conda install -n env -c conda-forge jupyterlab nodejs=18
267277
conda init bash
278+
mkdir output
268279
269280
- run:
270281
name: initial NPM Build
@@ -283,12 +294,8 @@ jobs:
283294
conda activate env
284295
cd packages/python/plotly
285296
python setup.py sdist bdist_wheel
286-
mkdir pypi_dist
287-
tar czf pypi_dist/all.tgz dist
288-
289-
- store_artifacts:
290-
path: packages/python/plotly/pypi_dist
291-
destination: pypi_dist
297+
cp -R dist ../../../output/dist
298+
git status
292299
293300
- run:
294301
name: Conda Build
@@ -297,12 +304,8 @@ jobs:
297304
conda activate env
298305
cd packages/python/plotly
299306
conda build recipe/
300-
mkdir conda_dist
301-
mv /opt/conda/envs/env/conda-bld/noarch/plotly*.tar.bz2 conda_dist
302-
303-
- store_artifacts:
304-
path: packages/python/plotly/conda_dist
305-
destination: conda_dist
307+
mv /opt/conda/envs/env/conda-bld/noarch/plotly*.tar.bz2 ../../../output
308+
git status
306309
307310
- run:
308311
name: NPM Pack
@@ -311,12 +314,21 @@ jobs:
311314
conda activate env
312315
cd packages/javascript/jupyterlab-plotly
313316
npm pack
314-
mkdir npm_dist
315-
mv jupyterlab-plotly*.tgz npm_dist
317+
mv jupyterlab-plotly*.tgz ../../../output
318+
319+
- run:
320+
name: Zip output
321+
command: |
322+
tar czf output.tgz output
323+
324+
- run:
325+
name: Git Diff
326+
command: |
327+
git status
328+
git diff
316329
317330
- store_artifacts:
318-
path: packages/javascript/jupyterlab-plotly/npm_dist
319-
destination: npm_dist
331+
path: output.tgz
320332

321333
build-doc:
322334
resource_class: xlarge
@@ -467,7 +479,7 @@ workflows:
467479
- python_37_optional
468480
- python_38_optional
469481
- python_39_optional
482+
- python_39_pandas_2_optional
470483
- python_38_orca
471484
- python_37_percy
472-
- python_37_chart_studio
473485
- build-doc

CHANGELOG.md

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,76 @@
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
5+
## [5.14.1] - 2023-04-05
6+
7+
### Fixed
8+
- Fixed compatibility issue with Pandas 2.0 [[#4103](https://github.com/plotly/plotly.py/pull/4103)]
9+
10+
## [5.14.0] - 2023-03-29
11+
12+
### Updated
13+
- Updated Plotly.js to from version 2.18.2 to version 2.20.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2200----2023-03-15) for more information. Notable changes include:
14+
- Add `title.automargin` to enable automatic top and bottom margining for both container and paper referenced titles [[#6428](https://github.com/plotly/plotly.js/pull/6428)],
15+
with thanks to [Gamma Technologies](https://www.gtisoft.com/) for sponsoring the related development.
16+
- Add `label` attribute to shapes [[#6454](https://github.com/plotly/plotly.js/pull/6454)], with thanks to the [Volkswagen](https://www.volkswagenag.com) Center of Excellence for Battery Systems for sponsoring development!
17+
- Add `labelalias` to various axes namely cartesian, gl3d, polar, smith, ternary, carpet,
18+
indicator and colorbar [[#6481](https://github.com/plotly/plotly.js/pull/6481)],
19+
this feature was anonymously sponsored: thank you to our sponsor!
20+
- Key errors no longer precalculated when performing updates on plots [[#4101](https://github.com/plotly/plotly.py/pull/4101)]
21+
22+
### Fixed
23+
- Fixed an issue with characters displaying incorrectly, by adding `charset="utf-8"` to scripts in `to_html` [[#4114](https://github.com/plotly/plotly.py/pull/4114)]
24+
- Added `packaging` to install requirements, fixing a `No module named 'packaging` error on Python 3.6 [[#4113](https://github.com/plotly/plotly.py/pull/4113)]
25+
26+
### Added
27+
- Added option to allow passing a column name as a `str` in `hover_data` and `custom_data` in `plotly.express` [[4083](https://github.com/plotly/plotly.py/pull/4083)]
28+
29+
## [5.13.1] - 2023-02-24
30+
31+
### Updated
32+
- Updated Plotly.js to from version 2.18.0 to version 2.18.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2182----2023-02-15) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module.
33+
- Updated distutils.Version to packaging.Version [#3897](https://github.com/plotly/plotly.py/pull/3897)] and [#4055](https://github.com/plotly/plotly.py/pull/4055)]
34+
35+
## [5.13.0] - 2023-01-23
36+
37+
### Updated
38+
- Updated Plotly.js to from version 2.17.1 to version 2.18.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2180----2023-01-19) for more information. Notable changes include:
39+
- Add `sync` tickmode option [[#6356](https://github.com/plotly/plotly.js/pull/6356), [#6443](https://github.com/plotly/plotly.js/pull/6443)], with thanks to @filipesantiagoAM and @VictorBezak for the contribution!
40+
- Build process now uses Node 18.x and version 2 lockfile (should be an invisible change for users) [[#4034](https://github.com/plotly/plotly.py/pull/4034)]
41+
42+
### Fixed
43+
- `write_html()` now explicitly encodes output as UTF-8 because Plotly.js' bundle contains such characters [[#4021](https://github.com/plotly/plotly.py/pull/4021)] and [[#4022](https://github.com/plotly/plotly.py/pull/4022)]
44+
- fixed `iframe` renderer regression from 5.12 and also fixed error when this renderer was used in the very first cell in a notebook [[#4036](https://github.com/plotly/plotly.py/pull/4036)]
45+
46+
47+
## [5.12.0] - 2023-01-12
48+
49+
### Updated
50+
- Support for ipywidgets 8 [[#3930](https://github.com/plotly/plotly.py/pull/3930)]
51+
- Updated Plotly.js to from version 2.16.1 to version 2.17.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2170----2022-12-22) for more information. Notable changes include:
52+
- Add `shift` and `autoshift` to cartesian y axes to help avoid overlapping of multiple axes [[#6334](https://github.com/plotly/plotly.js/pull/6334)],
53+
with thanks to [Gamma Technologies](https://www.gtisoft.com) for sponsoring the related development!
54+
- Introduce group attributes for `scatter` trace i.e. `alignmentgroup`, `offsetgroup`, `scattermode` and `scattergap` [[#6381](https://github.com/plotly/plotly.js/pull/6381)],
55+
this feature was anonymously sponsored: thank you to our sponsor!
56+
- Add `marker.cornerradius` attribute to `treemap` trace [[#6351](https://github.com/plotly/plotly.js/pull/6351)]
57+
### Fixed
58+
- Fixed the usage of some deprecated NumPy types which were removed in NumPy 1.24 [[#3997](https://github.com/plotly/plotly.py/pull/3997)]
59+
- Fixed bug for trendlines with datetime axes [[#3683](https://github.com/plotly/plotly.py/issues/3683)]
60+
- `marker.angle` attribute now accepts iterables where appropriate [[#4013](https://github.com/plotly/plotly.py/issues/4013)]
61+
- `selector=0` now correctly returns the first trace in `.select_traces()` and related methods [[#3817](https://github.com/plotly/plotly.py/issues/3817)]
62+
63+
## [5.11.0] - 2022-10-27
64+
65+
### Updated
66+
- Updated Plotly.js to from version 2.14.0 to version 2.16.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2161----2022-10-21) for more information. Notable changes include:
67+
- Add clustering options to `scattermapbox` [[#5827](https://github.com/plotly/plotly.js/pull/5827)],
68+
with thanks to @elben10 for the contribution!
69+
- Add bounds to mapbox suplots [[6339](https://github.com/plotly/plotly.js/pull/6339)]
70+
- Add `angle`, `angleref` and `standoff` to `marker` and add `backoff` to `line`; also introduce new arrow symbols to facilitate drawing networks [[#6297](https://github.com/plotly/plotly.js/pull/6297)]
71+
- Add `minreducedwidth` and `minreducedheight` to layout for increasing control over automargin [[#6307](https://github.com/plotly/plotly.js/pull/6307)]
72+
- Add `entrywidth` and `entrywidthmode` to legend [[#6202](https://github.com/plotly/plotly.js/pull/6202), [#6324](https://github.com/plotly/plotly.js/pull/6324)]
73+
74+
## [5.10.0] - 2022-08-11
675

776
### Updated
877
- 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:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
## Quickstart
3535

36-
`pip install plotly==5.10.0`
36+
`pip install plotly==5.14.1`
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.10.0
81+
pip install plotly==5.14.1
8282
```
8383

8484
or conda.
8585

8686
```
87-
conda install -c plotly plotly=5.10.0
87+
conda install -c plotly plotly=5.14.1
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.10.0 @jupyter-widgets/jupyterlab-manager
109+
jupyter labextension install jupyterlab-plotly@5.14.1 @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.

SECURITY.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | ------------------ |
7+
| 5.x | :white_check_mark: |
8+
| < 5.0 | :x: |
9+
10+
## Reporting a Vulnerability
11+
12+
Please email security@plotly.com with any concerns about security.

binder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==5.10.0
2+
plotly==5.14.1
33
jupyter
44
notebook
55
pandas==1.0.3

contributing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ contribution.
99

1010
## Code of Conduct
1111

12-
Please check out the [Code of Conduct](CODE_OF_CONDUCT.md). Don't tl:dr; it,
12+
Please check out the [Code of Conduct](CODE_OF_CONDUCT.md). Don't skip it,
1313
but the general idea is to be nice.
1414

1515
## What are the different ways to contribute?
1616

17-
There are many ways to contribute to plotly.py. It helps to understand first
18-
the structure of the code and of the repository.
17+
There are many ways to contribute to plotly.py. To contribute effectively, it is important to first gain an understanding of the structure of the code and of the repository.
1918

2019
- [the `plotly.graph_objects` module](https://plotly.com/python/graph-objects/) (usually imported as `go`)
2120
is [generated from the Plotly.js schema](https://plotly.com/python/figure-structure/),

doc/apidoc/conf.py

Lines changed: 1 addition & 1 deletion
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.10.0"
31+
release = "5.14.1"
3232

3333

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

doc/python/3d-mesh.md

Lines changed: 7 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.2'
9-
jupytext_version: 1.6.0
8+
format_version: '1.3'
9+
jupytext_version: 1.14.1
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.6
23+
version: 3.8.8
2424
plotly:
2525
description: How to make 3D Mesh Plots
2626
display_as: 3d_charts
@@ -81,6 +81,10 @@ snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-
8181
IFrame(snippet_url + '3d-mesh', width='100%', height=1200)
8282
```
8383

84+
<div style="font-size: 0.9em;"><div style="width: calc(100% - 30px); box-shadow: none; border: thin solid rgb(229, 229, 229);"><div style="padding: 5px;"><div><p><strong>Sign up for Dash Club</strong> → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.
85+
<u><a href="https://go.plotly.com/dash-club?utm_source=Dash+Club+2022&utm_medium=graphing_libraries&utm_content=inline">Join now</a></u>.</p></div></div></div></div>
86+
87+
8488
### Mesh Tetrahedron
8589

8690
In this example we use the `i`, `j` and `k` parameters to specify manually the geometry of the triangles of the mesh.

doc/python/3d-scatter-plots.md

Lines changed: 7 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.2'
9-
jupytext_version: 1.6.0
8+
format_version: '1.3'
9+
jupytext_version: 1.14.1
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.6
23+
version: 3.8.8
2424
plotly:
2525
description: How to make 3D scatter plots in Python with Plotly.
2626
display_as: 3d_charts
@@ -85,6 +85,10 @@ snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-
8585
IFrame(snippet_url + '3d-scatter-plots', width='100%', height=1200)
8686
```
8787

88+
<div style="font-size: 0.9em;"><div style="width: calc(100% - 30px); box-shadow: none; border: thin solid rgb(229, 229, 229);"><div style="padding: 5px;"><div><p><strong>Sign up for Dash Club</strong> → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.
89+
<u><a href="https://go.plotly.com/dash-club?utm_source=Dash+Club+2022&utm_medium=graphing_libraries&utm_content=inline">Join now</a></u>.</p></div></div></div></div>
90+
91+
8892
### 3D Scatter Plot with go.Scatter3d
8993

9094
#### Basic 3D Scatter Plot

doc/python/aggregations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ import plotly.io as pio
144144

145145
import pandas as pd
146146

147-
df = pd.read_csv("https://plotly.com/~public.health/17.csv")
147+
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/US-shooting-incidents.csv")
148148

149149
data = [dict(
150150
x = df['date'],
@@ -191,7 +191,7 @@ layout = dict(
191191
method = 'restyle',
192192
), dict(
193193
args = ['xbins.size', 'M3'],
194-
label = 'Quater',
194+
label = 'Quarter',
195195
method = 'restyle',
196196
), dict(
197197
args = ['xbins.size', 'M6'],

doc/python/axes.md

Lines changed: 26 additions & 3 deletions
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.13.7
9+
jupytext_version: 1.14.1
1010
kernelspec:
11-
display_name: Python 3 (ipykernel)
11+
display_name: Python 3
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.9.7
23+
version: 3.8.8
2424
plotly:
2525
description: How to adjust axes properties in Python - axes titles, styling and
2626
coloring axes and grid lines, ticks, tick labels and more.
@@ -137,6 +137,10 @@ snippet_url = 'https://python-docs-dash-snippets.herokuapp.com/python-docs-dash-
137137
IFrame(snippet_url + 'axes', width='100%', height=1200)
138138
```
139139

140+
<div style="font-size: 0.9em;"><div style="width: calc(100% - 30px); box-shadow: none; border: thin solid rgb(229, 229, 229);"><div style="padding: 5px;"><div><p><strong>Sign up for Dash Club</strong> → Free cheat sheets plus updates from Chris Parmer and Adam Schroeder delivered to your inbox every two months. Includes tips and tricks, community apps, and deep dives into the Dash architecture.
141+
<u><a href="https://go.plotly.com/dash-club?utm_source=Dash+Club+2022&utm_medium=graphing_libraries&utm_content=inline">Join now</a></u>.</p></div></div></div></div>
142+
143+
140144
#### Moving Tick Labels Inside the Plot
141145

142146
The `ticklabelposition` attribute moves tick labels inside the plotting area, and modifies the auto-range behaviour to accommodate the labels.
@@ -150,6 +154,25 @@ fig.update_yaxes(ticklabelposition="inside top", title=None)
150154
fig.show()
151155
```
152156

157+
#### Specifying Label Aliases
158+
159+
*New in 5.14*
160+
161+
With `labelalias`, you can specify replacement text for specific tick and hover labels. In this example, the dataset has the values of "Sat" and "Sun" in the day column. By setting `labelalias=dict(Sat="Saturday", Sun="Sunday")`, we swap these out for "Saturday" and "Sunday".
162+
163+
```python
164+
import plotly.express as px
165+
import pandas as pd
166+
167+
df = px.data.tips()
168+
df = df[df.day.isin(['Sat', 'Sun'])].groupby(by='day', as_index=False).sum(numeric_only=True)
169+
170+
fig = px.bar(df, x="day", y="total_bill")
171+
fig.update_xaxes(labelalias=dict(Sat="Saturday", Sun="Sunday"))
172+
173+
fig.show()
174+
```
175+
153176
##### Set axis title text with Graph Objects
154177

155178
Axis titles are set using the nested `title.text` property of the x or y axis. Here is an example of creating a new figure and using `update_xaxes` and `update_yaxes`, with magic underscore notation, to set the axis titles.

0 commit comments

Comments
 (0)