Skip to content

Commit 5096796

Browse files
authored
Merge branch 'doc-prod' into jupyterlab-clarification
2 parents 4d3b236 + 3c2daf5 commit 5096796

File tree

820 files changed

+88068
-33398
lines changed

Some content is hidden

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

820 files changed

+88068
-33398
lines changed

Diff for: .circleci/config.yml

+18
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
@@ -598,5 +615,6 @@ workflows:
598615
- python_39_pandas_2_optional
599616
- python_38_orca
600617
- python_39_percy
618+
- python_312_no_numpy
601619
- build-doc
602620

Diff for: CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
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.0] - 2024-08-29
6+
7+
### Added
8+
- New `px` functions for maps: `scatter_map`, `line_map`, `choropleth_map`, and `density_map`.
9+
10+
### Updated
11+
12+
- 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:
13+
- 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)]
14+
- Deprecate mapbox traces and mapbox subplot [[#7087](https://github.com/plotly/plotly.js/pull/7087)]
15+
16+
- Fixed a bug in integer validation of arrays that threw an error when an array contained a mix of strings and integers.
17+
518
## [5.23.0] - 2024-07-23
619

720
### 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.0`
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.0
8989
```
9090

9191
or conda.
9292

9393
```
94-
conda install -c plotly plotly=5.23.0
94+
conda install -c plotly plotly=5.24.0
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.0 @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.0
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.0"
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

+1-1
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/).

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-
```

Diff for: doc/python/figure-structure.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The second of the three top-level attributes of a figure is `layout`, whose valu
9797
* Subplots of various types on which can be drawn multiple traces and which are positioned in paper coordinates:
9898
* `xaxis`, `yaxis`, `xaxis2`, `yaxis3` etc: X and Y cartesian axes, the intersections of which are cartesian subplots
9999
* `scene`, `scene2`, `scene3` etc: 3d scene subplots
100-
* `ternary`, `ternary2`, `ternary3`, `polar`, `polar2`, `polar3`, `geo`, `geo2`, `geo3`, `mapbox`, `mapbox2`, `mabox3`, `smith`, `smith2` etc: ternary, polar, geo, mapbox or smith subplots
100+
* `ternary`, `ternary2`, `ternary3`, `polar`, `polar2`, `polar3`, `geo`, `geo2`, `geo3`, `map`, `map2`, `map3`, `smith`, `smith2` etc: ternary, polar, geo, map or smith subplots
101101
* Non-data marks which can be positioned in paper coordinates, or in data coordinates linked to 2d cartesian subplots:
102102
* `annotations`: [textual annotations with or without arrows](/python/text-and-annotations/)
103103
* `shapes`: [lines, rectangles, ellipses or open or closed paths](/python/shapes/)
@@ -181,18 +181,18 @@ The following trace types are compatible with smith subplots via the `smith` att
181181

182182
### Map Trace Types and Subplots
183183

184-
Figures can include two different types of map subplots: [geo subplots for outline maps](/python/map-configuration/) and [mapbox subplots for tile maps](/python/mapbox-layers/). The following trace types support attributes named `geo` or `mapbox`, whose values must refer to corresponding objects in the layout i.e. `geo="geo2"` etc. Note that attributes such as `layout.geo2` and `layout.mapbox` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.
184+
Figures can include two different types of map subplots: [geo subplots for outline maps](/python/map-configuration/) and [tile-based maps](/python/tile-map-layers/). The following trace types support attributes named `geo` or `map`, whose values must refer to corresponding objects in the layout i.e. `geo="geo2"` etc. Note that attributes such as `layout.geo2` and `layout.map` etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot.
185185

186186
The following trace types are compatible with geo subplots via the `geo` attribute:
187187

188188
* [`scattergeo`](/python/scatter-plots-on-maps/), which can be used to draw [individual markers](/python/scatter-plots-on-maps/), [line and curves](/python/lines-on-maps/) and filled areas on outline maps
189189
* [`choropleth`](/python/choropleth-maps/): [colored polygons](/python/choropleth-maps/) on outline maps
190190

191-
The following trace types are compatible with mapbox subplots via the `mapbox` attribute:
191+
The following trace types are compatible with tile map subplots via the `map` attribute:
192192

193-
* [`scattermapbox`](/python/scattermapbox/), which can be used to draw [individual markers](/python/scattermapbox/), [lines and curves](/python/lines-on-mapbox/) and [filled areas](/python/filled-area-on-mapbox/) on tile maps
194-
* [`choroplethmapbox`](/python/mapbox-county-choropleth/): colored polygons on tile maps
195-
* [`densitymapbox`](/python/mapbox-density-heatmaps/): density heatmaps on tile maps
193+
* [`scattermap`](/python/tile-scatter-maps/), which can be used to draw [individual markers](/python/tile-scatter-maps/), [lines and curves](/python/lines-on-tile-maps/) and [filled areas](/python/filled-area-tile-maps/) on tile maps
194+
* [`choroplethmap`](/python/tile-county-choropleth/): colored polygons on tile maps
195+
* [`densitymap`](/python/tile-density-heatmaps/): density heatmaps on tile maps
196196

197197
### Traces Which Are Their Own Subplots
198198

0 commit comments

Comments
 (0)