Skip to content

Commit f8ec53a

Browse files
Merge branch 'master' into non-string-flaglist-extras
2 parents ef3a3eb + 59f0039 commit f8ec53a

22 files changed

+144
-220
lines changed

.circleci/config.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ jobs:
272272
eval "$(conda shell.bash hook)"
273273
conda activate env
274274
cd packages/javascript/jupyterlab-plotly
275-
npm install
275+
npm ci
276276
npm run build:prod
277277
git status
278278
@@ -283,10 +283,12 @@ jobs:
283283
conda activate env
284284
cd packages/python/plotly
285285
python setup.py sdist bdist_wheel
286+
mkdir pypi_dist
287+
tar czf pypi_dist/all.tgz dist
286288
287289
- store_artifacts:
288-
path: packages/python/plotly/dist
289-
destination: dist
290+
path: packages/python/plotly/pypi_dist
291+
destination: pypi_dist
290292

291293
- run:
292294
name: Conda Build

CHANGELOG.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,27 @@
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-
## [UNRELEASED]
5+
6+
## UNRELEASED
7+
8+
### Added
9+
10+
- `pattern_shape` options now available in `px.timeline()`
611

712
### Updated
813

914
- Allow non-string extras in `flaglist` attributes, to support upcoming changes to `ax.automargin` in plotly.js [plotly.js#6193](https://github.com/plotly/plotly.js/pull/6193), [#3749](https://github.com/plotly/plotly.py/pull/3749)
1015

16+
## [5.8.2] - 2022-06-10
17+
18+
### Fixed
19+
20+
- Fixed a syntax error that caused rendering issues in Databricks notebooks and likely elsewhere. [#3763](https://github.com/plotly/plotly.py/pull/3763) with thanks to [@fwetdb](https://github.com/fwetdb)
21+
22+
## [5.8.1] - 2022-06-08
23+
24+
(no changes, due to a mixup with the build process!)
25+
1126
## [5.8.0] - 2022-05-09
1227

1328
### Fixed

README.md

+5-21
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
## Quickstart
3535

36-
`pip install plotly==5.8.0`
36+
`pip install plotly==5.8.2`
3737

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

@@ -45,15 +45,14 @@ fig.show()
4545

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

48-
Read about what's new in [plotly.py v4](https://medium.com/plotly/plotly-py-4-0-is-here-offline-only-express-first-displayable-anywhere-fc444e5659ee)
4948

5049
## Overview
5150

5251
[plotly.py](https://plotly.com/python/) is an interactive, open-source, and browser-based graphing library for Python :sparkles:
5352

5453
Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is a high-level, declarative charting library. plotly.js ships with over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more.
5554

56-
`plotly.py` is [MIT Licensed](https://github.com/plotly/plotly.py/blob/master/LICENSE.txt). Plotly graphs can be viewed in Jupyter notebooks, standalone HTML files, or hosted online using [Chart Studio Cloud](https://chart-studio.plotly.com/feed/).
55+
`plotly.py` is [MIT Licensed](https://github.com/plotly/plotly.py/blob/master/LICENSE.txt). Plotly graphs can be viewed in Jupyter notebooks, standalone HTML files, or integrated into [Dash applications](https://dash.plotly.com/).
5756

5857
[Contact us](https://plotly.com/consulting-and-oem/) for consulting, dashboard development, application integration, and feature additions.
5958

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

8180
```
82-
pip install plotly==5.8.0
81+
pip install plotly==5.8.2
8382
```
8483

8584
or conda.
8685

8786
```
88-
conda install -c plotly plotly=5.8.0
87+
conda install -c plotly plotly=5.8.2
8988
```
9089

9190
### JupyterLab Support
@@ -107,7 +106,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
107106

108107
```
109108
# JupyterLab 2.x renderer support
110-
jupyter labextension install jupyterlab-plotly@5.8.0 @jupyter-widgets/jupyterlab-manager
109+
jupyter labextension install jupyterlab-plotly@5.8.2 @jupyter-widgets/jupyterlab-manager
111110
```
112111

113112
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
@@ -188,21 +187,6 @@ or conda
188187
conda install -c plotly plotly-geo=1.0.0
189188
```
190189

191-
### Chart Studio support
192-
193-
The `chart-studio` package can be used to upload plotly figures to Plotly's Chart
194-
Studio Cloud or On-Prem service. This package can be installed using pip...
195-
196-
```
197-
pip install chart-studio==1.1.0
198-
```
199-
200-
or conda
201-
202-
```
203-
conda install -c plotly chart-studio=1.1.0
204-
```
205-
206190
## Migration
207191

208192
If you're migrating from plotly.py v3 to v4, please check out the [Version 4 migration guide](https://plotly.com/python/v4-migration/)

binder/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==5.8.0
2+
plotly==5.8.2
33
jupyter
44
notebook
55
pandas==1.0.3

doc/apidoc/conf.py

+1-1
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.8.0"
31+
release = "5.8.2"
3232

3333

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

doc/python/annotated-heatmap.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ As of version 5.5.0 of `plotly`, the **recommended way to [display annotated hea
4343

4444
#### Basic Annotated Heatmap for z-annotations
4545

46+
*New in v5.5*
47+
4648
After creating a figure with `px.imshow`, you can add z-annotations with `.update_traces(texttemplate="%{z}")`.
4749

4850
```python
@@ -246,7 +248,7 @@ fig = px.imshow(color, color_continuous_scale=colorscale, aspect="auto",
246248
title='Periodic Table')
247249
fig.update_traces(
248250
text=symbol, texttemplate="%{text}", textfont_size=12,
249-
customdata=np.moveaxis([element, atomic_mass], 0,-1),
251+
customdata=np.moveaxis([element, atomic_mass], 0,-1),
250252
hovertemplate="%{customdata[0]}<br>Atomic Mass: %{customdata[1]:.2f}<extra></extra>"
251253
)
252254
fig.update_xaxes(visible=False)

doc/python/axes.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.9.0
23+
version: 3.9.7
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.
@@ -293,6 +293,8 @@ fig.show()
293293

294294
##### Step for tick labels
295295

296+
*New in v5.6*
297+
296298
You can set a step for tick labels with `ticklabelstep`. In this example, we hide labels between every `2` ticks on the y axes. Similarly, this can be used with `fig.update_xaxes` for x axes: `fig.update_xaxes(ticklabelstep=2)`.
297299

298300
```python
@@ -384,12 +386,10 @@ fig.show()
384386

385387
_new in 5.8_
386388

387-
You can position and style minor ticks on a Cartesian axis using `minor`. This takes a `dict` of properties to apply to minor ticks. Available properties include: `tickmode`, `tickvals`, `tickcolor`, `ticklen`, `tickwidth`, `dtick`, `tick0`, `nticks`, `ticks`, `showgrid`, `gridcolor`, `griddash`, and `gridwidth`.
389+
You can position and style minor ticks on a Cartesian axis using the `minor` attribute. This takes a `dict` of properties to apply to minor ticks. See the [figure reference](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-minor) for full details on the accepted keys in this dict.
388390

389391
In the following example, we add minor ticks to the x-axis and then to the y-axis. For the y-axis we add ticks on the inside: `ticks="inside"`. On the x-axis we've specified some additional properties to style the minor ticks, setting the length of the ticks with `ticklen` and the color with `tickcolor`. We've also turned on grid lines for the x-axis minor ticks using `showgrid`.
390392

391-
Note: Minor ticks and grid lines are not currently supported on color bars, ternary plots, polar charts, geo plots, or on multi-categorical, or 3D axes.
392-
393393
```python
394394
import plotly.express as px
395395
import pandas as pd
@@ -399,7 +399,7 @@ fig = px.scatter(df, x="total_bill", y="tip", color="sex")
399399

400400

401401
fig.update_xaxes(minor=dict(ticklen=6, tickcolor="black", showgrid=True))
402-
fig.update_yaxes(minor=dict(ticks="inside"))
402+
fig.update_yaxes(minor_ticks="inside")
403403

404404
fig.show()
405405
```
@@ -490,15 +490,14 @@ fig.show()
490490

491491
_new in 5.8_
492492

493-
By default grid lines are `solid`. Set the `griddash` property to change this style. In this example we display the x-axis grid lines as `dot`. It can also be set to `dash`, `longdash`, `dashdot`, or `longdashdot`.
493+
By default grid lines are `solid`. Set the `griddash` property to change this style. In this example we display the x-axis grid lines as `dash` and the minor grid lines as `dot`. Other allowable values are `longdash`, `dashdot`, or `longdashdot`.
494494

495495
```python
496496
import plotly.express as px
497497
df = px.data.iris()
498498

499499
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
500-
fig.update_xaxes(showgrid=True, gridwidth=1, gridcolor='LightPink', griddash='dot')
501-
fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='LightPink')
500+
fig.update_xaxes(gridcolor='black', griddash='dash', minor_griddash="dot")
502501

503502
fig.show()
504503
```

doc/python/filled-area-plots.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ IFrame(snippet_url + 'filled-area-plots', width='100%', height=1200)
6363

6464
### Pattern Fills
6565

66-
*New in v5.0*
66+
*New in v5.7*
6767

6868
Area charts afford the use of [patterns (also known as hatching or texture)](/python/pattern-hatching-texture/) in addition to color:
6969

doc/python/getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ We also encourage you to join the [Plotly Community Forum](http://community.plot
5858
`plotly` may be installed using `pip`:
5959

6060
```
61-
$ pip install plotly==5.8.0
61+
$ pip install plotly==5.8.2
6262
```
6363

6464
or `conda`:
6565

6666
```
67-
$ conda install -c plotly plotly=5.8.0
67+
$ conda install -c plotly plotly=5.8.2
6868
```
6969
This package contains everything you need to write figures to standalone HTML files.
7070

@@ -148,7 +148,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
148148

149149
```
150150
# JupyterLab 2.x renderer support
151-
jupyter labextension install jupyterlab-plotly@5.8.0 @jupyter-widgets/jupyterlab-manager
151+
jupyter labextension install jupyterlab-plotly@5.8.2 @jupyter-widgets/jupyterlab-manager
152152
```
153153

154154
Please check out our [Troubleshooting guide](/python/troubleshooting/) if you run into any problems with JupyterLab, particularly if you are using multiple python environments inside Jupyter.

doc/python/hover-text-and-formatting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ for continent_name, continent in continent_data.items():
313313
x=continent['gdpPercap'],
314314
y=continent['lifeExp'],
315315
name=continent_name,
316-
text=df_2007['continent'],
316+
text=continent['continent'],
317317
hovertemplate=
318318
"<b>%{text}</b><br><br>" +
319319
"GDP per Capita: %{x:$,.0f}<br>" +

doc/python/legend.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fig.show()
9999

100100
*New in v5.0*
101101

102-
The `legendrank` attribute of a trace can be used to control its placement within the legend, without regard for its placement in the `data` list.
102+
The `legendrank` attribute of a trace can be used to control its placement within the legend, without regard for its placement in the `data` list.
103103

104104
The default `legendrank` for traces is 1000 and ties are broken as described above, meaning that any trace can be pulled up to the top if it is the only one with a legend rank less than 1000 and pushed to the bottom if it is the only one with a rank greater than 1000.
105105

@@ -447,6 +447,8 @@ fig.show()
447447

448448
#### Group click toggle behavior
449449

450+
*New in v5.3*
451+
450452
You can also define the toggle behavior for when a user clicks an item in a group. Here we set the `groupclick` for the `legend` to `toggleitem`. This toggles the visibility of just the item clicked on by the user. Set to `togglegroup` and it toggles the visibility of all items in the same group as the item clicked on.
451453

452454
```python

doc/python/line-and-scatter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ IFrame(snippet_url + 'line-and-scatter', width='100%', height=1200)
100100

101101
### Scatter plots and Categorical Axes
102102

103-
Scatters plots can be made on using any type of cartesian axis, including [linear](https://plotly.com/python/axes/), [logarithmic](https://plotly.com/python/log-plot/), [categorical](https://plotly.com/python/categorical-axes/) or [date](https://plotly.com/python/time-series/) axes.
103+
Scatter plots can be made using any type of cartesian axis, including [linear](https://plotly.com/python/axes/), [logarithmic](https://plotly.com/python/log-plot/), [categorical](https://plotly.com/python/categorical-axes/) or [date](https://plotly.com/python/time-series/) axes.
104104

105105
Scatter plots where one axis is categorical are often known as [dot plots](https://plotly.com/python/dot-plots/).
106106

doc/python/log-plot.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.9.0
23+
version: 3.9.7
2424
plotly:
2525
description: How to make Log plots in Python with Plotly.
2626
display_as: scientific
@@ -64,7 +64,7 @@ fig.show()
6464

6565
_new in 5.8_
6666

67-
You can position and style minor ticks using `minor`. This takes a `dict` of properties to apply to minor ticks. Available properties include: `tickmode`, `tickvals`, `tickcolor`, `ticklen`, `tickwidth`, `dtick`, `tick0`, `nticks`, `ticks`, `showgrid`, `gridcolor`, `griddash`, and `gridwidth`.
67+
You can position and style minor ticks using `minor`. This takes a `dict` of properties to apply to minor ticks. See the [figure reference](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-minor) for full details on the accepted keys in this dict.
6868

6969
In this example we set the tick length with `ticklen`, add the ticks on the inside with `ticks="inside"`, and turn grid lines on with `howgrid=True`.
7070

@@ -75,7 +75,7 @@ df = px.data.gapminder().query("year == 2007")
7575
fig = px.scatter(df, x="gdpPercap", y="lifeExp", hover_name="country",
7676
log_x=True, range_x=[1,100000], range_y=[0,100])
7777

78-
fig.update_xaxes(minor=dict(ticks="inside", ticklen=6, showgrid=True))# {"ticks": "inside", "ticklen": 6, "showgrid": True})
78+
fig.update_xaxes(minor=dict(ticks="inside", ticklen=6, showgrid=True))
7979

8080
fig.show()
8181
```

doc/python/smith-charts.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jupyter:
3333
thumbnail: thumbnail/contourcarpet.jpg
3434
---
3535

36+
*New in v5.4*
37+
3638
A [Smith Chart](https://en.wikipedia.org/wiki/Smith_chart) is a specialized chart for visualizing [complex numbers](https://en.wikipedia.org/wiki/Complex_number): numbers with both a real and imaginary part.
3739

3840

@@ -53,7 +55,7 @@ import plotly.graph_objects as go
5355
fig = go.Figure()
5456

5557
fig.add_trace(go.Scattersmith(
56-
imag=[1],
58+
imag=[1],
5759
real=[1],
5860
marker_symbol='x',
5961
marker_size=30,
@@ -62,7 +64,7 @@ fig.add_trace(go.Scattersmith(
6264
))
6365

6466
fig.add_trace(go.Scattersmith(
65-
imag=[1],
67+
imag=[1],
6668
real=[1],
6769
marker_symbol='x',
6870
marker_size=30,

doc/python/time-series.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.9.0
23+
version: 3.9.7
2424
plotly:
2525
description: How to plot date and time in python.
2626
display_as: financial
@@ -139,9 +139,9 @@ fig.show()
139139

140140
_new in 5.8_
141141

142-
You can add minor ticks to an axis with `minor`. This takes a `dict` of properties to apply to minor ticks. Available properties include: `tickmode`, `tickvals`, `tickcolor`, `ticklen`, `tickwidth`, `dtick`, `tick0`, `nticks`, `ticks`, `showgrid`, `gridcolor`, `griddash`, and `gridwidth`.
142+
You can add minor ticks to an axis with `minor`. This takes a `dict` of properties to apply to minor ticks. See the [figure reference](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-minor) for full details on the accepted keys in this dict.
143143

144-
In this example, we've added minor ticks to the inside of the x-axis and turned on grid lines.
144+
In this example, we've added minor ticks to the inside of the x-axis and turned on minor grid lines.
145145

146146
```python
147147
import pandas as pd
@@ -159,7 +159,7 @@ fig.show()
159159

160160
_new in 5.8_
161161

162-
You can set `dtick` on `minor` to control the spacing for minor ticks and grid lines. In the following example, by setting `dtick=7*24*3.6e6` (the number of milliseconds in a week) and setting `tick0="2016-07-04"` (the first Monday in our data), a minor tick and grid line is displayed for the start of each week. When zoomed out, we can see where each month and week begins and ends.
162+
You can set `dtick` on `minor` to control the spacing for minor ticks and grid lines. In the following example, by setting `dtick=7*24*60*60*1000` (the number of milliseconds in a week) and setting `tick0="2016-07-03"` (the first Sunday in our data), a minor tick and grid line is displayed for the start of each week. When zoomed out, we can see where each month and week begins and ends.
163163

164164
```python
165165
import pandas as pd
@@ -169,7 +169,17 @@ df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finan
169169
df = df.loc[(df["Date"] >= "2016-07-01") & (df["Date"] <= "2016-12-01")]
170170

171171
fig = px.line(df, x='Date', y='AAPL.High')
172-
fig.update_xaxes(ticks= "outside", ticklabelmode= "period", tickcolor= "black", tickwidth=2, ticklen=10, minor=dict(ticks="outside", dtick=7*24*3.6e6, tick0="2016-07-04", griddash='dot', gridcolor='pink'))
172+
fig.update_xaxes(ticks= "outside",
173+
ticklabelmode= "period",
174+
tickcolor= "black",
175+
ticklen=10,
176+
minor=dict(
177+
ticklen=4,
178+
dtick=7*24*60*60*1000,
179+
tick0="2016-07-03",
180+
griddash='dot',
181+
gridcolor='white')
182+
)
173183

174184
fig.show()
175185
```

doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plotly==5.8.0
1+
plotly==5.8.2
22
jupytext==1.1.1
33
jupyter-client<7
44
jupyter

0 commit comments

Comments
 (0)