Skip to content

Commit db61823

Browse files
Merge branch 'master' into doc-prod
2 parents 4b5dee8 + 0279560 commit db61823

File tree

2,577 files changed

+16825
-9445
lines changed

Some content is hidden

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

2,577 files changed

+16825
-9445
lines changed

.circleci/config.yml

+72-5
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,73 @@ jobs:
249249
- store_artifacts:
250250
path: packages/python/plotly/dist
251251

252+
full_build:
253+
docker:
254+
- image: continuumio/miniconda3
255+
environment:
256+
LANG: en_US.UTF-8
257+
resource_class: large
258+
259+
steps:
260+
- checkout
261+
262+
- run:
263+
name: Create conda environment
264+
command: |
265+
conda create -n env --yes python=3.9 conda-build conda-verify
266+
conda install -n env -c conda-forge jupyterlab nodejs=12
267+
conda init bash
268+
269+
- run:
270+
name: initial NPM Build
271+
command: |
272+
eval "$(conda shell.bash hook)"
273+
conda activate env
274+
cd packages/javascript/jupyterlab-plotly
275+
npm install
276+
npm run build:prod
277+
git status
278+
279+
- run:
280+
name: PyPI Build
281+
command: |
282+
eval "$(conda shell.bash hook)"
283+
conda activate env
284+
cd packages/python/plotly
285+
python setup.py sdist bdist_wheel
286+
287+
- store_artifacts:
288+
path: packages/python/plotly/dist
289+
destination: dist
290+
291+
- run:
292+
name: Conda Build
293+
command: |
294+
eval "$(conda shell.bash hook)"
295+
conda activate env
296+
cd packages/python/plotly
297+
conda build recipe/
298+
mkdir conda_dist
299+
mv /opt/conda/envs/env/conda-bld/noarch/plotly*.tar.bz2 conda_dist
300+
301+
- store_artifacts:
302+
path: packages/python/plotly/conda_dist
303+
destination: conda_dist
304+
305+
- run:
306+
name: NPM Pack
307+
command: |
308+
eval "$(conda shell.bash hook)"
309+
conda activate env
310+
cd packages/javascript/jupyterlab-plotly
311+
npm pack
312+
mkdir npm_dist
313+
mv jupyterlab-plotly*.tgz npm_dist
314+
315+
- store_artifacts:
316+
path: packages/javascript/jupyterlab-plotly/npm_dist
317+
destination: npm_dist
318+
252319
build-doc:
253320
resource_class: xlarge
254321
docker:
@@ -359,10 +426,8 @@ jobs:
359426
cd ../packages/python/plotly
360427
pip install -e .
361428
cd ../../../doc
362-
fi
363-
cd apidoc
364-
make html
365-
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
429+
cd apidoc
430+
make html
366431
cd _build/html
367432
touch .nojekyll
368433
git init
@@ -375,7 +440,6 @@ jobs:
375440
rm -rf .git
376441
cd ../..
377442
fi
378-
cd ../..
379443
380444
- store_artifacts:
381445
path: doc/build
@@ -387,6 +451,9 @@ workflows:
387451
dev_build:
388452
jobs:
389453
- plotlyjs_dev_build
454+
release_build:
455+
jobs:
456+
- full_build
390457

391458
build:
392459
jobs:

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
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.8.0] - 2022-05-09
6+
7+
### Fixed
8+
9+
- Improve support for type checking and IDE auto-completion by bypassing lazy-loading when type checking. [#3425](https://github.com/plotly/plotly.py/pull/3425) with thanks to [@JP-Ellis](https://github.com/JP-Ellis)
10+
- line dash-style validators are now correctly used everywhere so that values like `10px 2px` are accepted [#3722](https://github.com/plotly/plotly.py/pull/3722)
11+
- Resolved various deprecation warning messages and compatibility issues with upstream dependencies and Python 3.11, plus removed dependency on `six`, with thanks to [@maresb](https://github.com/maresb), [@hugovk](https://github.com/hugovk), [@tirkarthi](https://github.com/tirkarthi), [@martinRenou](https://github.com/martinRenou), and [@BjoernLudwigPTB](https://github.com/BjoernLudwigPTB)
12+
- Better support for MathJax 3 [#3706](https://github.com/plotly/plotly.py/pull/3706)
13+
14+
### Added
15+
16+
- Type annotations for Plotly Express functions and chainable `go.Figure` methods, for better IDE auto-completion [#3708](https://github.com/plotly/plotly.py/pull/3708)
17+
18+
### Updated
19+
- Updated Plotly.js to from version 2.11.1 to version 2.12.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v2.12.1/CHANGELOG.md#2121----2022-05-09) for more information. Notable changes include:
20+
- Add `minor` ticks to cartesian axes
21+
- Add `griddash` option to most axes
522

623
## [5.7.0] - 2022-04-05
724

README.md

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

3434
## Quickstart
3535

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

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

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

8181
```
82-
pip install plotly==5.7.0
82+
pip install plotly==5.8.0
8383
```
8484

8585
or conda.
8686

8787
```
88-
conda install -c plotly plotly=5.7.0
88+
conda install -c plotly plotly=5.8.0
8989
```
9090

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

108108
```
109109
# JupyterLab 2.x renderer support
110-
jupyter labextension install jupyterlab-plotly@5.7.0 @jupyter-widgets/jupyterlab-manager
110+
jupyter labextension install jupyterlab-plotly@5.8.0 @jupyter-widgets/jupyterlab-manager
111111
```
112112

113113
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.

binder/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==5.7.0
2+
plotly==5.8.0
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.7.0"
31+
release = "5.8.0"
3232

3333

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

doc/python/axes.md

+39
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,30 @@ fig.update_layout(title_text="Apple Stock Price")
382382
fig.show()
383383
```
384384

385+
#### Adding minor ticks
386+
387+
_new in 5.8_
388+
389+
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`.
390+
391+
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`.
392+
393+
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.
394+
395+
```python
396+
import plotly.express as px
397+
import pandas as pd
398+
399+
df = px.data.tips()
400+
fig = px.scatter(df, x="total_bill", y="tip", color="sex")
401+
402+
403+
fig.update_xaxes(minor=dict(ticklen=6, tickcolor="black", showgrid=True))
404+
fig.update_yaxes(minor=dict(ticks="inside"))
405+
406+
fig.show()
407+
```
408+
385409
### Axis lines: grid and zerolines
386410

387411
##### Toggling Axis grid lines
@@ -466,6 +490,21 @@ fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='LightPink')
466490
fig.show()
467491
```
468492

493+
_new in 5.8_
494+
495+
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`.
496+
497+
```python
498+
import plotly.express as px
499+
df = px.data.iris()
500+
501+
fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
502+
fig.update_xaxes(showgrid=True, gridwidth=1, gridcolor='LightPink', griddash='dot')
503+
fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='LightPink')
504+
505+
fig.show()
506+
```
507+
469508
##### Styling zero lines
470509

471510
The width and color of axis zero lines are controlled by the `zerolinewidth` and `zerolinecolor` axis properties.

doc/python/colorscales.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,10 @@ fig.show()
400400
```python
401401
import plotly.graph_objects as go
402402

403-
import six.moves.urllib
403+
import urllib
404404
import json
405405

406-
response = six.moves.urllib.request.urlopen(
406+
response = urllib.request.urlopen(
407407
"https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json"
408408
)
409409

@@ -492,11 +492,11 @@ Like axes, you can customize the color bar ticks, labels, and values with `ticks
492492
```python
493493
import plotly.graph_objects as go
494494

495-
import six.moves.urllib
495+
import urllib
496496
import json
497497

498498
# Load heatmap data
499-
response = six.moves.urllib.request.urlopen(
499+
response = urllib.request.urlopen(
500500
"https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json")
501501
dataset = json.load(response)
502502

@@ -525,11 +525,11 @@ By default, color bars are displayed vertically. You can change a color bar to b
525525
```python
526526
import plotly.graph_objects as go
527527

528-
import six.moves.urllib
528+
import urllib
529529
import json
530530

531531
# Load heatmap data
532-
response = six.moves.urllib.request.urlopen(
532+
response = urllib.request.urlopen(
533533
"https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json")
534534
dataset = json.load(response)
535535

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.7.0
61+
$ pip install plotly==5.8.0
6262
```
6363

6464
or `conda`:
6565

6666
```
67-
$ conda install -c plotly plotly=5.7.0
67+
$ conda install -c plotly plotly=5.8.0
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.7.0 @jupyter-widgets/jupyterlab-manager
151+
jupyter labextension install jupyterlab-plotly@5.8.0 @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/graphing-multiple-chart-types.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ import plotly.graph_objects as go
8585

8686
# Load data
8787
import json
88-
import six.moves.urllib
88+
import urllib
8989

90-
response = six.moves.urllib.request.urlopen(
90+
response = urllib.request.urlopen(
9191
"https://raw.githubusercontent.com/plotly/datasets/master/steepest.json")
9292

9393
data = json.load(response)

doc/python/log-plot.md

+24-4
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.4.2
8+
format_version: '1.3'
9+
jupytext_version: 1.13.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.7.7
23+
version: 3.9.0
2424
plotly:
2525
description: How to make Log plots in Python with Plotly.
2626
display_as: scientific
@@ -60,6 +60,26 @@ fig = px.scatter(df, x="gdpPercap", y="lifeExp", hover_name="country",
6060
fig.show()
6161
```
6262

63+
#### Adding minor ticks
64+
65+
_new in 5.8_
66+
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`.
68+
69+
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`.
70+
71+
```python
72+
import plotly.express as px
73+
df = px.data.gapminder().query("year == 2007")
74+
75+
fig = px.scatter(df, x="gdpPercap", y="lifeExp", hover_name="country",
76+
log_x=True, range_x=[1,100000], range_y=[0,100])
77+
78+
fig.update_xaxes(minor=dict(ticks="inside", ticklen=6, showgrid=True))# {"ticks": "inside", "ticklen": 6, "showgrid": True})
79+
80+
fig.show()
81+
```
82+
6383
### Logarithmic Axes with Graph Objects
6484

6585
If Plotly Express does not provide a good starting point, it is also possible to use [the more generic `go.Figure` class from `plotly.graph_objects`](/python/graph-objects/).

0 commit comments

Comments
 (0)