Skip to content

Commit a42bfb3

Browse files
committed
merge master; revise this branch following narwhals changes
2 parents a8ef32e + 84f4e66 commit a42bfb3

File tree

788 files changed

+12658
-53631
lines changed

Some content is hidden

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

788 files changed

+12658
-53631
lines changed

.circleci/config.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ commands:
4646
. venv/bin/activate
4747
pip install --upgrade pip wheel
4848
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
49+
cd js
50+
npm ci
51+
npm run build
4952
- run:
5053
name: Install plotly-geo
5154
command: |
@@ -249,6 +252,14 @@ jobs:
249252
- test_optional:
250253
py: "312_no_numpy"
251254

255+
python_312_np2:
256+
docker:
257+
- image: cimg/python:3.12-browsers
258+
steps:
259+
- test_optional:
260+
py: "312_np2"
261+
262+
252263
# Percy
253264
python_39_percy:
254265
docker:
@@ -339,9 +350,9 @@ jobs:
339350
. venv/bin/activate
340351
pip install --upgrade pip wheel
341352
pip install -r ./test_requirements/requirements_38_core.txt black inflect
342-
pip install jupyterlab~=3.0
353+
pip install jupyterlab
343354
- run:
344-
name: Update jupyterlab-plotly version
355+
name: Update jupyter widget plotly.js version
345356
command: |
346357
cd packages/python/plotly
347358
. venv/bin/activate
@@ -395,7 +406,7 @@ jobs:
395406
conda config --remove channels defaults
396407
conda config --add channels conda-forge
397408
conda create -n env --yes python=3.9 conda-build=3.28.4 conda-verify
398-
conda install -n env -c conda-forge jupyterlab=3 nodejs=16
409+
conda install -n env -c conda-forge jupyterlab nodejs=16
399410
conda init bash
400411
mkdir output
401412
@@ -404,9 +415,9 @@ jobs:
404415
command: |
405416
eval "$(conda shell.bash hook)"
406417
conda activate env
407-
cd packages/javascript/jupyterlab-plotly
418+
cd packages/python/plotly/js
408419
npm ci
409-
npm run build:prod
420+
npm run build
410421
git status
411422
412423
- run:
@@ -430,13 +441,13 @@ jobs:
430441
git status
431442
432443
- run:
433-
name: NPM Pack
444+
name: Build Widget javascript bundle
434445
command: |
435446
eval "$(conda shell.bash hook)"
436447
conda activate env
437-
cd packages/javascript/jupyterlab-plotly
438-
npm pack
439-
mv jupyterlab-plotly*.tgz ../../../output
448+
cd packages/python/plotly/js
449+
npm ci
450+
npm run build
440451
441452
- run:
442453
name: Zip output
@@ -483,7 +494,12 @@ jobs:
483494
pip install -r requirements.txt
484495
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
485496
pip uninstall -y plotly
486-
pip install -e ../packages/python/plotly
497+
cd ../packages/python/plotly
498+
pip install -e .
499+
cd js
500+
npm ci
501+
npm run build
502+
cd ../../../../doc
487503
fi
488504
cd ..
489505
- run:
@@ -607,4 +623,5 @@ workflows:
607623
- python_39_pandas_2_optional
608624
- python_39_percy
609625
- python_312_no_numpy
626+
- python_312_np2
610627
- build-doc

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ doc/check-or-enforce-order.py
5959
packages/javascript/jupyterlab-plotly/lib/
6060
packages/python/plotly/jupyterlab_plotly/labextension/
6161
packages/python/plotly/jupyterlab_plotly/nbextension/index.js*
62+
packages/python/plotly/plotly/package_data/widgetbundle.js
6263

6364
test/percy/*.html
6465
test/percy/pandas2/*.html

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
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+
### Removed
6+
- Drop deprecated `pointcloud` and `heatmapgl` traces from the API
7+
- Drop `tenacity` dependency [#4831](https://github.com/plotly/plotly.js/pull/4831)
8+
59
### Updated
610

7-
- Updated plotly.py to use base64 encoding of arrays in plotly JSON to improve performance.
11+
- Updated plotly.py to use base64 encoding of arrays in plotly JSON to improve performance.
12+
- Add `subtitle` attribute to all Plotly Express traces
13+
- Make plotly-express dataframe agnostic via Narwhals [#4790](https://github.com/plotly/plotly.py/pull/4790)
814

915
## [5.24.1] - 2024-09-12
1016

1117
### Updated
1218

13-
- Updated Plotly.js from version 2.35.0 to version 2.35.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2352----2024-09-10) for more information.
19+
- Updated Plotly.js from version 2.35.0 to version 3.0.0-rc.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2352----2024-11-11) for more information.
1420

1521
## [5.24.0] - 2024-08-29
1622

@@ -25,6 +31,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2531

2632
- Fixed a bug in integer validation of arrays that threw an error when an array contained a mix of strings and integers.
2733

34+
- Fixed a bug in JupyterLab >= 4 and Jupyter Notebook >= 7 that caused latex to not render in plotly charts.
35+
36+
- Use modern [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) to load plotly.js bundle instead of requirejs which is [no longer under active development](https://github.com/requirejs/r.js/compare/2.3.6...2.3.7)
37+
2838
## [5.23.0] - 2024-07-23
2939

3040
### Updated

README.md

Lines changed: 7 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@
3737
</a>
3838
</div>
3939

40-
4140
## Quickstart
4241

4342
`pip install plotly==5.24.1`
4443

45-
Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`):
46-
4744
```python
4845
import plotly.express as px
4946
fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2])
@@ -52,7 +49,6 @@ fig.show()
5249

5350
See the [Python documentation](https://plotly.com/python/) for more examples.
5451

55-
5652
## Overview
5753

5854
[plotly.py](https://plotly.com/python/) is an interactive, open-source, and browser-based graphing library for Python :sparkles:
@@ -82,7 +78,7 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
8278

8379
## Installation
8480

85-
plotly.py may be installed using pip...
81+
plotly.py may be installed using pip
8682

8783
```
8884
pip install plotly==5.24.1
@@ -94,43 +90,19 @@ or conda.
9490
conda install -c plotly plotly=5.24.1
9591
```
9692

97-
### JupyterLab Support
93+
### Jupyter Widget Support
9894

99-
For use in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), install the `jupyterlab` and `ipywidgets`
95+
For use as a Jupyter widget, install `jupyter` and `anywidget`
10096
packages using `pip`:
10197

10298
```
103-
pip install "jupyterlab>=3" "ipywidgets>=7.6"
99+
pip install jupyter anywidget
104100
```
105101

106102
or `conda`:
107103

108104
```
109-
conda install "jupyterlab>=3" "ipywidgets>=7.6"
110-
```
111-
112-
The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**, run the following commands to install the required JupyterLab extensions (note that this will require [`node`](https://nodejs.org/) to be installed):
113-
114-
```
115-
# JupyterLab 2.x renderer support
116-
jupyter labextension install [email protected] @jupyter-widgets/jupyterlab-manager
117-
```
118-
119-
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
120-
121-
### Jupyter Notebook Support
122-
123-
For use in the Jupyter Notebook, install the `notebook` and `ipywidgets`
124-
packages using `pip`:
125-
126-
```
127-
pip install "notebook>=5.3" "ipywidgets>=7.5"
128-
```
129-
130-
or `conda`:
131-
132-
```
133-
conda install "notebook>=5.3" "ipywidgets>=7.5"
105+
conda install jupyter anywidget
134106
```
135107

136108
### Static Image Export
@@ -143,41 +115,18 @@ command line utility (legacy as of `plotly` version 4.9).
143115
#### Kaleido
144116

145117
The [`kaleido`](https://github.com/plotly/Kaleido) package has no dependencies and can be installed
146-
using pip...
118+
using pip
147119

148120
```
149121
pip install -U kaleido
150122
```
151123

152-
or conda.
124+
or conda
153125

154126
```
155127
conda install -c conda-forge python-kaleido
156128
```
157129

158-
#### Orca
159-
160-
While Kaleido is now the recommended image export approach because it is easier to install
161-
and more widely compatible, [static image export](https://plotly.com/python/static-image-export/)
162-
can also be supported
163-
by the legacy [orca](https://github.com/plotly/orca) command line utility and the
164-
[`psutil`](https://github.com/giampaolo/psutil) Python package.
165-
166-
These dependencies can both be installed using conda:
167-
168-
```
169-
conda install -c plotly plotly-orca==1.3.1 psutil
170-
```
171-
172-
Or, `psutil` can be installed using pip...
173-
174-
```
175-
pip install psutil
176-
```
177-
178-
and orca can be installed according to the instructions in the [orca README](https://github.com/plotly/orca).
179-
180-
181130
### Extended Geo Support
182131

183132
Some plotly.py features rely on fairly large geographic shape files. The county

contributing.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,14 @@ complete installation and avoid gdal-config errors.
157157
(plotly_dev) $ pip install -e packages/python/chart-studio/
158158
(plotly_dev) $ pip install -e packages/python/plotly-geo/
159159
```
160-
This will ensure that the installed packages links to your local development
160+
161+
**Note**: To test `go.FigureWidget` locally, you'll need to generate the javascript bundle as follows:
162+
```
163+
cd packages/python/plotly/js
164+
npm install && npm run build
165+
```
166+
167+
Running `pip install -e` will ensure that the installed packages links to your local development
161168
directory, meaning that all changes you make reflect directly in your
162169
environment (don't forget to restart the Jupyter kernel though!). For more
163170
information see the
@@ -211,7 +218,7 @@ make that pull request!
211218

212219

213220
## Update to a new version of Plotly.js
214-
First update the version of the `plotly.js` dependency in `packages/javascript/jupyterlab-plotly/package.json`.
221+
First update the version of the `plotly.js` dependency in `packages/python/plotly/js/package.json`.
215222

216223
Then run the `updateplotlyjs` command with:
217224

doc/apidoc/plotly.graph_objects.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ Simple Traces
4343
Bar
4444
Pie
4545
Heatmap
46-
Heatmapgl
4746
Image
4847
Contour
4948
Table

0 commit comments

Comments
 (0)