Skip to content

Commit 02109c8

Browse files
Merge branch 'master' into wide_form2
2 parents e78cb50 + e026ef5 commit 02109c8

File tree

239 files changed

+4291
-2144
lines changed

Some content is hidden

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

239 files changed

+4291
-2144
lines changed

CHANGELOG.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,39 @@
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-
## Dev version
5+
## [4.7.1] - 2020-05-08
6+
7+
### Fixed
8+
9+
- Fix `AttributeError: module 'plotly.graph_objs' has no attribute 'FigureWidget'` exception on `from plotly.graph_objs import *` when `ipywidgets` is not installed. Error also occurred when importing `plotly.figure_factor`. It is now possible to import `plotly.graph_objs.FigureWidget` when `ipywidgets` is not installed, and an informative `ImportError` exception will be raised in the `FigureWidget` constructor ([#2443](https://github.com/plotly/plotly.py/issues/2443), [#1111](https://github.com/plotly/plotly.py/issues/1111)).
10+
- Fix `TypeError: unhashable type: 'Template'` during `Figure` construction when `plotly.io.templates.default` is set to a `Template` object rather than a string.
11+
12+
13+
## [4.7.0] - 2020-05-06
14+
15+
### Updated
16+
17+
- Updated Plotly.js to version 1.54.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.54.1/CHANGELOG.md) for more information. The main new feature of this version of Plotly.js is the possibility to draw layout shapes, using custom dragmodes and corresponding modebar buttons.
18+
- The sphinx-gallery scraper has been updated to work with different structures of galleries [#2149](https://github.com/plotly/plotly.py/pull/2419)
619

720
### Added
821

9-
- The `hover_data` parameter of `px` functions can now be a dictionary. This
10-
makes it possible to skip hover information for some arguments or to change
11-
the formatting of hover informatiom [#2377](https://github.com/plotly/plotly.py/pull/2377).
22+
- The `hover_data` parameter of `px` functions can now be a dictionary. This makes it possible to skip hover information for some arguments or to change the formatting of hover informatiom [#2377](https://github.com/plotly/plotly.py/pull/2377).
23+
- It's now possible to build a development version of Plotly.py against the build artifacts from a non-`master` branch of Plotly.js, which makes for faster QA and development cycles [#2349](https://github.com/plotly/plotly.py/pull/2349). Thanks [@zouhairm](https://github.com/zouhairm) for this Pull Request!
24+
25+
### Fixed
26+
27+
- Plotly Express trendlines now handle missing data correctly [#2357](https://github.com/plotly/plotly.py/pull/2357)
1228

1329
### Performance
30+
1431
This version includes several performance improvements ([#2368](https://github.com/plotly/plotly.py/pull/2368), [#2403](https://github.com/plotly/plotly.py/pull/2403)).
15-
32+
1633
- Child graph objects (e.g. `figure.layout.xaxis`) are no longer created eagerly during graph object construction. Instead, they are created lazily the first time the property is accessed.
1734
- Property validation is now disabled for select internal operations.
1835
- When used with Python 3.7 and above, ploty.py now takes advantage of [PEP-562](https://www.python.org/dev/peps/pep-0562/) to perform submodule imports lazily. This dramatically improves import times.
1936

20-
## [4.6] - 2020-03-31
37+
## [4.6.0] - 2020-03-31
2138

2239
### Updated
2340

README.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
## Quickstart
3535

36-
`pip install plotly==4.6.0`
36+
`pip install plotly==4.7.1`
3737

3838
Inside [Jupyter notebook](https://jupyter.org/install) (installable with `pip install "notebook>=5.3" "ipywidgets>=7.2"`):
3939

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

8484
```
85-
pip install plotly==4.6.0
85+
pip install plotly==4.7.1
8686
```
8787

8888
or conda.
8989

9090
```
91-
conda install -c plotly plotly=4.6.0
91+
conda install -c plotly plotly=4.7.1
9292
```
9393

9494
### Jupyter Notebook Support
@@ -112,44 +112,27 @@ For use in JupyterLab, install the `jupyterlab` and `ipywidgets`
112112
packages using pip...
113113

114114
```
115-
pip install jupyterlab==1.2 "ipywidgets==7.5"
115+
pip install jupyterlab "ipywidgets=7.5"
116116
```
117117

118118
or conda.
119119

120120
```
121-
conda install jupyterlab=1.2
122-
conda install "ipywidgets=7.5"
121+
conda install jupyterlab "ipywidgets=7.5"
123122
```
124123

125124
Then run the following commands to install the required JupyterLab extensions (note that this will require [`node`](https://nodejs.org/) to be installed):
126125

127126
```
128-
# Avoid "JavaScript heap out of memory" errors during extension installation
129-
# (OS X/Linux)
130-
export NODE_OPTIONS=--max-old-space-size=4096
131-
# (Windows)
132-
set NODE_OPTIONS=--max-old-space-size=4096
127+
# Basic JupyterLab renderer support
128+
jupyter labextension install [email protected]
133129
134-
# Jupyter widgets extension
135-
jupyter labextension install @jupyter-widgets/[email protected] --no-build
136-
137-
# FigureWidget support
138-
jupyter labextension install [email protected] --no-build
139-
140-
# and jupyterlab renderer support
141-
jupyter labextension install [email protected] --no-build
142-
143-
# Build extensions (must be done to activate extensions since --no-build is used above)
144-
jupyter lab build
145-
146-
# Unset NODE_OPTIONS environment variable
147-
# (OS X/Linux)
148-
unset NODE_OPTIONS
149-
# (Windows)
150-
set NODE_OPTIONS=
130+
# OPTIONAL: Jupyter widgets extension for FigureWidget support
131+
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]
151132
```
152133

134+
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
135+
153136
### Static Image Export
154137

155138
plotly.py supports static image export using the `to_image` and `write_image`

binder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==4.6.0
2+
plotly==4.7.0
33
jupyter
44
notebook
55
pandas

doc/apidoc/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ help:
1818
# For sphinx-apidoc the first positional path is the module to document
1919
# then all the other ones are paths to exclude for the doc generation
2020
%: Makefile
21+
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*.py
22+
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*/*.py
23+
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*/*/*.py
24+
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*/*/*/*.py
2125
sphinx-apidoc -o generated ../../packages/python/plotly/plotly ../../packages/python/plotly/plotly/validators ../../packages/python/plotly/plotly/tests ../../packages/python/plotly/plotly/matplotlylib/ ../../packages/python/plotly/plotly/offline ../../packages/python/plotly/plotly/api
2226
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
27+
git checkout -- ../../packages/python/plotly/plotly/graph_objs
2328
rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html
29+
mv _build/html/generated/plotly.graph_objs.html _build/html/generated/plotly.graph_objects.html
2430
sed -i 's/graph_objs/graph_objects/g' _build/html/*.html
2531
sed -i 's/graph_objs/graph_objects/g' _build/html/*.inv
2632
sed -i 's/graph_objs/graph_objects/g' _build/html/*.js

doc/apidoc/_templates/trace.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
.. autosummary::
1717

18-
plotly.graph_objects.{{ objname.lower() }}
18+
plotly.graph_objs.{{ objname.lower() }}
1919

20-
.. automodule:: plotly.graph_objects.{{ objname.lower() }}
20+
.. automodule:: plotly.graph_objs.{{ objname.lower() }}
2121
:members:
2222
:undoc-members:
2323

doc/apidoc/conf.py

Lines changed: 1 addition & 1 deletion
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 = "4.6.0"
31+
release = "4.7.0"
3232

3333

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

doc/python/animations.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,6 @@ fig_dict = {
261261
fig_dict["layout"]["xaxis"] = {"range": [30, 85], "title": "Life Expectancy"}
262262
fig_dict["layout"]["yaxis"] = {"title": "GDP per Capita", "type": "log"}
263263
fig_dict["layout"]["hovermode"] = "closest"
264-
fig_dict["layout"]["sliders"] = {
265-
"args": [
266-
"transition", {
267-
"duration": 400,
268-
"easing": "cubic-in-out"
269-
}
270-
],
271-
"initialValue": "1952",
272-
"plotlycommand": "animate",
273-
"values": years,
274-
"visible": True
275-
}
276264
fig_dict["layout"]["updatemenus"] = [
277265
{
278266
"buttons": [

doc/python/configuration-options.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ 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.2'
9+
jupytext_version: 1.3.0
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.0
23+
version: 3.7.3
2424
plotly:
2525
description: How to set the configuration options of figures using the Plotly
2626
Python graphing library.
@@ -236,6 +236,29 @@ fig.show(config={
236236
})
237237
```
238238

239+
### Add optional shape-drawing buttons to modebar
240+
241+
Some modebar buttons of Cartesian plots are optional and have to be added explictly, 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.
242+
243+
```python
244+
import plotly.graph_objects as go
245+
import plotly.express as px
246+
df = px.data.iris()
247+
fig = px.scatter(df, x='petal_width', y='sepal_length', color='species')
248+
fig.update_layout(
249+
dragmode='drawopenpath',
250+
newshape_line_color='cyan',
251+
title_text='Draw a path to separate versicolor and virginica'
252+
)
253+
fig.show(config={'modeBarButtonsToAdd':['drawline',
254+
'drawopenpath',
255+
'drawclosedpath',
256+
'drawcircle',
257+
'drawrect',
258+
'eraseshape'
259+
]})
260+
```
261+
239262
### Double-Click Delay
240263
Sets the maximum delay between two consecutive clicks to be interpreted as a double-click in milliseconds. This is the time interval between first mousedown and second mouseup. The default timing is 300 ms (less than half a second).
241264
This setting propagates to all on-subplot double clicks (except for `geo` and `mapbox`).

doc/python/datashader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ 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 mabox image layer
39+
### Passing datashader rasters as a mapbox image layer
4040

4141
We visualize here the spatial distribution of taxi rides in New York City. A higher density
4242
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.

doc/python/getting-started.md

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ Thanks to deep integration with the [orca](https://github.com/plotly/orca) image
4949
plotly.py may be installed using pip...
5050

5151
```
52-
$ pip install plotly==4.6.0
52+
$ pip install plotly==4.7.1
5353
```
5454

5555
or conda.
5656

5757
```
58-
$ conda install -c plotly plotly=4.6.0
58+
$ conda install -c plotly plotly=4.7.1
5959
```
6060

6161
This package contains everything you need to write figures to standalone HTML files.
@@ -134,29 +134,11 @@ $ conda install "ipywidgets=7.5"
134134
Then run the following commands to install the required JupyterLab extensions (note that this will require [`node`](https://nodejs.org/) to be installed):
135135

136136
```
137-
# Avoid "JavaScript heap out of memory" errors during extension installation
138-
# (OS X/Linux)
139-
export NODE_OPTIONS=--max-old-space-size=4096
140-
# (Windows)
141-
set NODE_OPTIONS=--max-old-space-size=4096
137+
# JupyterLab renderer support
138+
jupyter labextension install [email protected]
142139
143-
# Jupyter widgets extension
144-
jupyter labextension install @jupyter-widgets/[email protected] --no-build
145-
146-
# jupyterlab renderer support
147-
jupyter labextension install [email protected] --no-build
148-
149-
# FigureWidget support
150-
jupyter labextension install [email protected] --no-build
151-
152-
# Build extensions (must be done to activate extensions since --no-build is used above)
153-
jupyter lab build
154-
155-
# Unset NODE_OPTIONS environment variable
156-
# (OS X/Linux)
157-
unset NODE_OPTIONS
158-
# (Windows)
159-
set NODE_OPTIONS=
140+
# OPTIONAL: Jupyter widgets extension
141+
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]
160142
```
161143

162144
These packages contain everything you need to run JupyterLab...
@@ -175,14 +157,16 @@ fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
175157
fig.show()
176158
```
177159

178-
or using `FigureWidget` objects.
160+
or using `FigureWidget` objects (if the "OPTIONAL" step above was executed).
179161

180162
```python
181163
import plotly.graph_objects as go
182164
fig = go.FigureWidget(data=go.Bar(y=[2, 3, 1]))
183165
fig
184166
```
185167

168+
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
169+
186170
<!-- #region -->
187171

188172
See [_Displaying Figures in Python_](/python/renderers/) for more information on the renderers framework, and see [_Plotly FigureWidget Overview_](/python/figurewidget/) for more information on using `FigureWidget`.

0 commit comments

Comments
 (0)