Skip to content

Commit f1ed3d7

Browse files
authored
Merge branch 'master' into fix/pd_perf_issue
2 parents 97b214e + e430257 commit f1ed3d7

27 files changed

+328
-109
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
browser-tools: circleci/browser-tools@1.4.1
4+
browser-tools: circleci/browser-tools@1.4.3
55

66
commands:
77
test_core:

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
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+
6+
## UNRELEASED
7+
8+
### Updated
9+
- Updated Plotly.js from version 2.24.1 to version 2.24.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2242----2023-06-09) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module.
10+
- `px` methods now accept data-frame-like objects that support a [dataframe interchange protocol](https://data-apis.org/dataframe-protocol/latest/index.html), such as polars, vaex, modin etc. This protocol has priority on `to_pandas` call, but will only be used if pandas>=2.0.2 is installed in the environment.
11+
512
## [5.15.0] - 2023-06-08
613

714
### Updated
@@ -16,7 +23,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1623
this feature was anonymously sponsored: thank you to our sponsor!
1724
- Add `legend.xref` and `legend.yref` to enable container-referenced positioning of legends [[#6589](https://github.com/plotly/plotly.js/pull/6589)], with thanks to [Gamma Technologies](https://www.gtisoft.com/) for sponsoring the related development.
1825
- Add `colorbar.xref` and `colorbar.yref` to enable container-referenced positioning of colorbars [[#6593](https://github.com/plotly/plotly.js/pull/6593)], with thanks to [Gamma Technologies](https://www.gtisoft.com/) for sponsoring the related development.
19-
- `px` methods now accept data-frame-like objects that support a `to_pandas()` method, such as polars, cudf, vaex etc
26+
- `px` methods now accept data-frame-like objects that support a `to_pandas()` method, such as polars, cudf, vaex etc [[#4244](https://github.com/plotly/plotly.py/pull/4244)], [[#4286](https://github.com/plotly/plotly.py/pull/4286)]
2027

2128
### Fixed
2229
- Fixed another compatibility issue with Pandas 2.0, just affecting `px.*(line_close=True)` [[#4190](https://github.com/plotly/plotly.py/pull/4190)]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
7070

7171
# tight layout
7272
fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
73+
fig.show()
7374
```
7475

7576
#### 3d scatter plots in Dash

doc/python/axes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jupyter:
3333
thumbnail: thumbnail/axes.png
3434
---
3535

36-
This tutorial explain how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](python/reference/layout/xaxis/).
36+
This tutorial explain how to set the properties of [2-dimensional Cartesian axes](/python/figure-structure/#2d-cartesian-trace-types-and-subplots), namely [`go.layout.XAxis`](/python/reference/layout/xaxis/) and [`go.layout.YAxis`](/python/reference/layout/xaxis/).
3737

3838
Other kinds of subplots and axes are described in other tutorials:
3939

@@ -154,7 +154,7 @@ fig.update_yaxes(ticklabelposition="inside top", title=None)
154154
fig.show()
155155
```
156156

157-
#### Specifying Label Aliases
157+
#### Specifying Label Aliases
158158

159159
*New in 5.14*
160160

doc/python/colorscales.md

Lines changed: 4 additions & 4 deletions
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.5
9+
jupytext_version: 1.14.6
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.11
23+
version: 3.10.8
2424
plotly:
2525
description: How to set, create and control continuous color scales and color
2626
bars in scatter, bar, map and heatmap figures.
@@ -307,11 +307,11 @@ Using `labelalias` you can replace some labels on the `colorbar` with alternativ
307307
```python
308308
import plotly.graph_objects as go
309309

310-
import urllib
310+
import urllib.request as request
311311
import json
312312

313313
# Load heatmap data
314-
response = urllib.request.urlopen(
314+
response = request.urlopen(
315315
"https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json")
316316
dataset = json.load(response)
317317

doc/python/configuration-options.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import plotly.graph_objects as go
5353

5454
fig = go.Figure()
5555

56-
config = dict({'scrollZoom': True})
56+
config = {'scrollZoom': True}
5757

5858
fig.add_trace(
5959
go.Scatter(
@@ -244,6 +244,8 @@ fig.add_trace(
244244
y=[1, 3, 1]))
245245

246246
fig.update_layout(modebar_remove=['zoom', 'pan'])
247+
248+
fig.show()
247249
```
248250

249251
### Add optional shape-drawing buttons to modebar
@@ -253,16 +255,19 @@ fig.update_layout(modebar_remove=['zoom', 'pan'])
253255
Some modebar buttons of Cartesian plots are optional and have to be added explicitly, using the `modeBarButtonsToAdd` config attribute. These buttons are used for drawing or erasing shapes. See [the tutorial on shapes and shape drawing](python/shapes#drawing-shapes-on-cartesian-plots) for more details.
254256

255257
```python
256-
import plotly.graph_objects as go
257258
import plotly.express as px
259+
258260
df = px.data.iris()
261+
259262
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
263+
260264
fig.update_layout(
261265
dragmode='drawopenpath',
262266
newshape_line_color='cyan',
263267
title_text='Draw a path to separate versicolor and virginica'
264268
)
265-
fig.show(config={'modeBarButtonsToAdd':['drawline',
269+
270+
fig.show(config={'modeBarButtonsToAdd': ['drawline',
266271
'drawopenpath',
267272
'drawclosedpath',
268273
'drawcircle',
@@ -276,10 +281,12 @@ fig.show(config={'modeBarButtonsToAdd':['drawline',
276281
The `layout.modebar.add` attribute can be used instead of the approach used above:
277282

278283
```python
279-
import plotly.graph_objects as go
280284
import plotly.express as px
285+
281286
df = px.data.iris()
287+
282288
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
289+
283290
fig.update_layout(
284291
dragmode='drawopenpath',
285292
newshape_line_color='cyan',
@@ -292,6 +299,8 @@ fig.update_layout(
292299
'eraseshape'
293300
]
294301
)
302+
303+
fig.show()
295304
```
296305

297306
### Double-Click Delay
@@ -304,12 +313,12 @@ import plotly.graph_objects as go
304313
config = {'doubleClickDelay': 1000}
305314

306315
fig = go.Figure(go.Bar(
307-
y = [3, 5, 3, 2],
308-
x = ["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"],
309-
texttemplate = "%{label}",
310-
textposition = "inside"))
316+
y=[3, 5, 3, 2],
317+
x=["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"],
318+
texttemplate="%{label}",
319+
textposition="inside"))
311320

312-
fig.update_layout(xaxis = {'type': 'date'})
321+
fig.update_layout(xaxis={'type': 'date'})
313322

314323
fig.show(config=config)
315324
```
@@ -320,4 +329,4 @@ The same configuration dictionary that you pass to the `config` parameter of the
320329

321330
#### Reference
322331

323-
See config options at https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L6
332+
See config options at https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js

doc/python/figure-factory-subplots.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Y, X = np.meshgrid(x, y)
6161
u = -1 - X**2 + Y
6262
v = 1 + X - Y**2
6363

64-
fig2 = ff.create_streamline(x, y, u, v, arrow_scale=.1, name='Steamline')
64+
fig2 = ff.create_streamline(x, y, u, v, arrow_scale=.1, name='Streamline')
6565
```
6666

6767
Edit the figures' x and y axes attributes to create subplots:

doc/python/legend.md

Lines changed: 14 additions & 10 deletions
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.5
9+
jupytext_version: 1.14.6
1010
kernelspec:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -580,7 +580,7 @@ fig.show()
580580

581581
By default, all traces appear on one legend. To have multiple legends, specify an alternative legend for a trace using the `legend` property. For a second legend, set `legend="legend2"`. Specify more legends with `legend="legend3"`, `legend="legend4"` and so on.
582582

583-
In this example, the last two scatter traces display on the second legend, "legend2". On the figure's layout, we then position and style this legend to display on the right of the graph below the first legend.
583+
In this example, the last two scatter traces display on the second legend, "legend2". On the figure's layout, we then position and style each legend.
584584

585585

586586
```python
@@ -622,20 +622,25 @@ fig = go.Figure(
622622
],
623623
layout=dict(
624624
title="GDP Per Capita",
625-
legend={"title": "By country", "bgcolor": "Orange",},
625+
legend={
626+
"title": "By country",
627+
"xref": "container",
628+
"yref": "container",
629+
"y": 0.65,
630+
"bgcolor": "Orange",
631+
},
626632
legend2={
627-
"x": 1.155,
628-
"y": 0.55,
629-
"xanchor": "right",
630-
"yanchor": "middle",
633+
"title": "By continent",
634+
"xref": "container",
635+
"yref": "container",
636+
"y": 0.85,
631637
"bgcolor": "Gold",
632-
"title": {"text": "By continent"},
638+
633639
},
634640
),
635641
)
636642

637643
fig.show()
638-
639644
```
640645

641646
### Positioning Legends
@@ -666,7 +671,6 @@ fig = go.Figure(
666671
"xref": "container",
667672
"yref": "container",
668673
"bgcolor": "Gold",
669-
"title": {"text": "By continent"},
670674
},
671675
),
672676
)

doc/python/lines-on-mapbox.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jupyter:
3737

3838
To plot on Mapbox maps with Plotly you _may_ need a Mapbox account and a public [Mapbox Access Token](https://www.mapbox.com/studio). See our [Mapbox Map Layers](/python/mapbox-layers/) documentation for more information.
3939

40-
To draw a line on your map, you either can use [`px.line_mapbox()`](https://www.plotly.express/plotly_express/#plotly_express.line_mapbox) in Plotly Express, or [`Scattermapbox`](https://plotly.com/python/reference/scattermapbox/) traces. Below we show you how to draw a line on Mapbox using Plotly Express.
40+
To draw a line on your map, you either can use [`px.line_mapbox()`](https://plotly.com/python-api-reference/generated/plotly.express.line_mapbox.html) in Plotly Express, or [`Scattermapbox`](https://plotly.com/python/reference/scattermapbox/) traces. Below we show you how to draw a line on Mapbox using Plotly Express.
4141

4242
### Lines on Mapbox maps using Plotly Express
4343

@@ -132,5 +132,5 @@ fig.show()
132132

133133
#### Reference
134134

135-
See [function reference for `px.(line_mapbox)`](https://plotly.com/python-api-reference/generated/plotly.express.line_mapbox) or
135+
See [function reference for `px.(line_mapbox)`](https://plotly.com/python-api-reference/generated/plotly.express.line_mapbox) or
136136
https://plotly.com/python/reference/scattermapbox/ for more information about mapbox and their attribute options.

doc/python/map-configuration.md

Lines changed: 5 additions & 11 deletions
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.14.7
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.6.8
23+
version: 3.10.4
2424
plotly:
2525
description: How to configure and style base maps for Choropleths and Bubble Maps.
2626
display_as: maps
@@ -119,9 +119,7 @@ fig.show()
119119

120120
### Map Projections
121121

122-
Geo maps are drawn according to a given map [projection](https://en.wikipedia.org/wiki/Map_projection) that flattens the Earth's roughly-spherical surface into a 2-dimensional space.
123-
124-
The available projections are `'equirectangular'`, `'mercator'`, `'orthographic'`, `'natural earth'`, `'kavrayskiy7'`, `'miller'`, `'robinson'`, `'eckert4'`, `'azimuthal equal area'`, `'azimuthal equidistant'`, `'conic equal area'`, `'conic conformal'`, `'conic equidistant'`, `'gnomonic'`, `'stereographic'`, `'mollweide'`, `'hammer'`, `'transverse mercator'`, `'albers usa'`, `'winkel tripel'`, `'aitoff'` and `'sinusoidal'`.
122+
Geo maps are drawn according to a given map [projection](https://en.wikipedia.org/wiki/Map_projection) that flattens the Earth's roughly-spherical surface into a 2-dimensional space. In the following examples, we show the `'orthographic'` and `'natural earth'` projections, two of the many projection types available. For a full list of available projection types, see the [layout.geo reference documentation](https://plotly.com/python/reference/layout/geo/#layout-geo-projection-type).
125123

126124
```python
127125
import plotly.graph_objects as go
@@ -221,7 +219,3 @@ fig.show()
221219
### Reference
222220

223221
See https://plotly.com/python/reference/layout/geo/ for more information and chart attribute options!
224-
225-
```python
226-
227-
```

0 commit comments

Comments
 (0)