Skip to content

Commit 9fc5262

Browse files
authored
Merge branch 'master' into update-license-year
2 parents 8535e3f + 673c19c commit 9fc5262

File tree

835 files changed

+88534
-33950
lines changed

Some content is hidden

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

835 files changed

+88534
-33950
lines changed

Diff for: .circleci/config.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,21 @@ jobs:
234234
- test_optional:
235235
py: "39_pandas_2"
236236

237+
# No numpy
238+
python_312_no_numpy:
239+
docker:
240+
- image: cimg/python:3.12-browsers
241+
steps:
242+
- run:
243+
name: Check that numpy is not installed
244+
command: |
245+
if pip list | grep numpy > /dev/null 2>&1
246+
then exit 1
247+
else exit 0
248+
fi
249+
- test_optional:
250+
py: "312_no_numpy"
251+
237252
# Orca
238253
python_38_orca:
239254
docker:
@@ -385,6 +400,8 @@ jobs:
385400
- run:
386401
name: Create conda environment
387402
command: |
403+
conda config --remove channels defaults
404+
conda config --add channels conda-forge
388405
conda create -n env --yes python=3.9 conda-build=3.28.4 conda-verify
389406
conda install -n env -c conda-forge jupyterlab=3 nodejs=16
390407
conda init bash
@@ -448,7 +465,7 @@ jobs:
448465
docker:
449466
# specify the version you desire here
450467
# use `-browsers` prefix for selenium tests, for example, `3.9-browsers`
451-
- image: cimg/python:3.10-browsers
468+
- image: cimg/python:3.9-browsers
452469

453470
steps:
454471
- add_ssh_keys:
@@ -598,5 +615,5 @@ workflows:
598615
- python_39_pandas_2_optional
599616
- python_38_orca
600617
- python_39_percy
618+
- python_312_no_numpy
601619
- build-doc
602-

Diff for: CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
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.24.1] - 2024-09-12
6+
7+
### Updated
8+
9+
- 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.
10+
11+
## [5.24.0] - 2024-08-29
12+
13+
### Added
14+
- New `px` functions for maps: `scatter_map`, `line_map`, `choropleth_map`, and `density_map`.
15+
16+
### Updated
17+
18+
- Updated Plotly.js from version 2.34.0 to version 2.35.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2350----2024-08-29) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
19+
- Add new traces: scattermap, choroplethmap and densitymap and map subplots which use maplibre to render maps [[#7015](https://github.com/plotly/plotly.js/pull/7015), [#7060](https://github.com/plotly/plotly.js/pull/7060), [#7085](https://github.com/plotly/plotly.js/pull/7085), [#7088](https://github.com/plotly/plotly.js/pull/7088), [#7090](https://github.com/plotly/plotly.js/pull/7090), [#7092](https://github.com/plotly/plotly.js/pull/7092), [#7094](https://github.com/plotly/plotly.js/pull/7094), [#7134](https://github.com/plotly/plotly.js/pull/7134)]
20+
- Deprecate mapbox traces and mapbox subplot [[#7087](https://github.com/plotly/plotly.js/pull/7087)]
21+
22+
- Fixed a bug in integer validation of arrays that threw an error when an array contained a mix of strings and integers.
23+
524
## [5.23.0] - 2024-07-23
625

726
### Updated

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
## Quickstart
4242

43-
`pip install plotly==5.23.0`
43+
`pip install plotly==5.24.1`
4444

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

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

8787
```
88-
pip install plotly==5.23.0
88+
pip install plotly==5.24.1
8989
```
9090

9191
or conda.
9292

9393
```
94-
conda install -c plotly plotly=5.23.0
94+
conda install -c plotly plotly=5.24.1
9595
```
9696

9797
### JupyterLab Support
@@ -113,7 +113,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
113113

114114
```
115115
# JupyterLab 2.x renderer support
116-
jupyter labextension install jupyterlab-plotly@5.23.0 @jupyter-widgets/jupyterlab-manager
116+
jupyter labextension install jupyterlab-plotly@5.24.1 @jupyter-widgets/jupyterlab-manager
117117
```
118118

119119
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.23.0
2+
plotly==5.24.1
33
jupyter
44
notebook
55
pandas==2.2.2

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.23.0"
29+
release = "5.24.1"
3030

3131

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

Diff for: doc/apidoc/plotly.express.rst

+4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ plotly's high-level API for rapid figure generation. ::
1818
scatter_3d
1919
scatter_polar
2020
scatter_ternary
21+
scatter_map
2122
scatter_mapbox
2223
scatter_geo
2324
line
2425
line_3d
2526
line_polar
2627
line_ternary
28+
line_map
2729
line_mapbox
2830
line_geo
2931
area
@@ -45,9 +47,11 @@ plotly's high-level API for rapid figure generation. ::
4547
parallel_coordinates
4648
parallel_categories
4749
choropleth
50+
choropleth_map
4851
choropleth_mapbox
4952
density_contour
5053
density_heatmap
54+
density_map
5155
density_mapbox
5256
imshow
5357
set_mapbox_access_token

Diff for: doc/apidoc/plotly.graph_objects.rst

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ Map Traces
9999

100100
Scattergeo
101101
Choropleth
102+
Scattermap
103+
Choroplethmap
104+
Densitymap
102105
Scattermapbox
103106
Choroplethmapbox
104107
Densitymapbox

Diff for: doc/python/axes.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Other kinds of subplots and axes are described in other tutorials:
4141
- [Polar axes](/python/polar-chart/). The axis object is [`go.layout.Polar`](/python/reference/layout/polar/)
4242
- [Ternary axes](/python/ternary-plots). The axis object is [`go.layout.Ternary`](/python/reference/layout/ternary/)
4343
- [Geo axes](/python/map-configuration/). The axis object is [`go.layout.Geo`](/python/reference/layout/geo/)
44-
- [Mapbox axes](/python/mapbox-layers/). The axis object is [`go.layout.Mapbox`](/python/reference/layout/mapbox/)
44+
- [Map axes](/python/tile-map-layers/). The axis object is [`go.layout.Map`](/python/reference/layout/map/)
4545
- [Color axes](/python/colorscales/). The axis object is [`go.layout.Coloraxis`](/python/reference/layout/coloraxis/).
4646

4747
**See also** the tutorials on [facet plots](/python/facet-plots/), [subplots](/python/subplots) and [multiple axes](/python/multiple-axes/).
@@ -453,10 +453,10 @@ fig.show()
453453
*New in 5.23*
454454

455455
You can adjust tick label positions by moving them a number of pixels away from the axis using `ticklabelstandoff` or along the axis using `ticklabelshift`.
456-
456+
457457
In this example, `ticklabelshift=25` shifts the labels 25 pixels to the right along the x-axis. By providing a negative value, we could move the labels 25 pixels to the left, (`ticklabelshift=-25`).
458458

459-
Here, `ticklabelstandoff=15` moves the labels further 15 pixels away from the x-axis. A negative value here would move them close to the axis.
459+
Here, `ticklabelstandoff=15` moves the labels 15 pixels further away from the x-axis. A negative value here would move them closer to the axis.
460460

461461
```python
462462
import plotly.express as px
@@ -483,7 +483,7 @@ fig.show()
483483

484484
On date or linear axes, use `ticklabelindex` to draw a label for a minor tick instead of a major tick.
485485

486-
To draw the label for the minor tick before each major tick, set `ticklabelindex` -1, like in the following example.
486+
To draw the label for the minor tick before each major tick, set `ticklabelindex=-1`, like in the following example.
487487

488488
```python
489489
import plotly.express as px

Diff for: doc/python/bubble-maps.md

+5-5
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.1.1
8+
format_version: '1.3'
9+
jupytext_version: 1.16.3
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,14 +20,14 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.7
23+
version: 3.10.0
2424
plotly:
2525
description: How to make bubble maps in Python with Plotly.
2626
display_as: maps
2727
language: python
2828
layout: base
2929
name: Bubble Maps
30-
order: 4
30+
order: 5
3131
page_type: example_index
3232
permalink: python/bubble-maps/
3333
thumbnail: thumbnail/bubble-map.jpg

Diff for: doc/python/choropleth-maps.md

+5-5
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.3
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,20 +20,20 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.8
23+
version: 3.10.0
2424
plotly:
2525
description: How to make choropleth maps in Python with Plotly.
2626
display_as: maps
2727
language: python
2828
layout: base
2929
name: Choropleth Maps
30-
order: 7
30+
order: 8
3131
page_type: u-guide
3232
permalink: python/choropleth-maps/
3333
thumbnail: thumbnail/choropleth.jpg
3434
---
3535

36-
A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps** using our Mapbox trace types](/python/mapbox-county-choropleth).
36+
A [Choropleth Map](https://en.wikipedia.org/wiki/Choropleth_map) is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build **outline** choropleth maps, but you can also build [choropleth **tile maps**](/python/tile-county-choropleth).
3737

3838
Below we show how to create Choropleth Maps using either Plotly Express' `px.choropleth` function or the lower-level `go.Choropleth` graph object.
3939

Diff for: doc/python/county-choropleth.md

+7-7
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.2'
9-
jupytext_version: 1.3.1
8+
format_version: '1.3'
9+
jupytext_version: 1.16.3
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,15 +20,15 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.8
23+
version: 3.10.0
2424
plotly:
2525
description: How to create colormaped representations of USA counties by FIPS
2626
values in Python.
2727
display_as: maps
2828
language: python
2929
layout: base
3030
name: USA County Choropleth Maps
31-
order: 10
31+
order: 11
3232
page_type: u-guide
3333
permalink: python/county-choropleth/
3434
thumbnail: thumbnail/county-choropleth-usa-greybkgd.jpg
@@ -37,7 +37,7 @@ jupyter:
3737
### Deprecation warning
3838

3939

40-
This page describes a [legacy "figure factory" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [Mapbox tile-based choropleth maps](/python/mapbox-county-choropleth).
40+
This page describes a [legacy "figure factory" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [tile-based choropleth maps](/python/tile-county-choropleth).
4141

4242

4343
#### Required Packages
@@ -274,7 +274,7 @@ fig.layout.template = None
274274
fig.show()
275275
```
276276

277-
Also see Mapbox county choropleths made in Python: [https://plotly.com/python/mapbox-county-choropleth/](https://plotly.com/python/mapbox-county-choropleth/)
277+
Also see tile county choropleths made in Python: [https://plotly.com/python/tile-county-choropleth/](https://plotly.com/python/tile-county-choropleth/)
278278

279279
### Reference
280280

Diff for: doc/python/datashader.md

+13-21
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.2'
9-
jupytext_version: 1.3.0
8+
format_version: '1.3'
9+
jupytext_version: 1.16.3
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.10.0
2424
plotly:
2525
description: How to use datashader to rasterize large datasets, and visualize
2626
the generated raster data with plotly.
@@ -36,10 +36,10 @@ jupyter:
3636

3737
[datashader](https://datashader.org/) creates rasterized representations of large datasets for easier visualization, with a pipeline approach consisting of several steps: projecting the data on a regular grid, creating a color representation of the grid, etc.
3838

39-
### Passing datashader rasters as a mapbox image layer
39+
### Passing datashader rasters as a tile map image layer
4040

4141
We visualize here the spatial distribution of taxi rides in New York City. A higher density
42-
is observed on major avenues. For more details about mapbox charts, see [the mapbox layers tutorial](/python/mapbox-layers). No mapbox token is needed here.
42+
is observed on major avenues. For more details about tile-based maps, see [the tile map layers tutorial](/python/tile-map-layers).
4343

4444
```python
4545
import pandas as pd
@@ -51,7 +51,7 @@ cvs = ds.Canvas(plot_width=1000, plot_height=1000)
5151
agg = cvs.points(dff, x='Lon', y='Lat')
5252
# agg is an xarray object, see http://xarray.pydata.org/en/stable/ for more details
5353
coords_lat, coords_lon = agg.coords['Lat'].values, agg.coords['Lon'].values
54-
# Corners of the image, which need to be passed to mapbox
54+
# Corners of the image
5555
coordinates = [[coords_lon[0], coords_lat[0]],
5656
[coords_lon[-1], coords_lat[0]],
5757
[coords_lon[-1], coords_lat[-1]],
@@ -62,16 +62,12 @@ import datashader.transfer_functions as tf
6262
img = tf.shade(agg, cmap=fire)[::-1].to_pil()
6363

6464
import plotly.express as px
65-
# Trick to create rapidly a figure with mapbox axes
66-
fig = px.scatter_mapbox(dff[:1], lat='Lat', lon='Lon', zoom=12)
67-
# Add the datashader image as a mapbox layer image
68-
fig.update_layout(mapbox_style="carto-darkmatter",
69-
mapbox_layers = [
70-
{
71-
"sourcetype": "image",
72-
"source": img,
73-
"coordinates": coordinates
74-
}]
65+
# Trick to create rapidly a figure with map axes
66+
fig = px.scatter_map(dff[:1], lat='Lat', lon='Lon', zoom=12)
67+
# Add the datashader image as a tile map layer image
68+
fig.update_layout(
69+
map_style="carto-darkmatter",
70+
map_layers=[{"sourcetype": "image", "source": img, "coordinates": coordinates}],
7571
)
7672
fig.show()
7773
```
@@ -113,7 +109,3 @@ fig.update_traces(hoverongaps=False)
113109
fig.update_layout(coloraxis_colorbar=dict(title='Count', tickprefix='1.e'))
114110
fig.show()
115111
```
116-
117-
```python
118-
119-
```

0 commit comments

Comments
 (0)