Skip to content

Commit 42be310

Browse files
Merge branch 'doc-prod' into update-sphinx-css
2 parents 0f02f26 + bbbe065 commit 42be310

File tree

10,358 files changed

+849554
-610343
lines changed

Some content is hidden

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

10,358 files changed

+849554
-610343
lines changed

.circleci/create_conda_optional_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
1616
# Create environment
1717
# PYTHON_VERSION=2.7 or 3.5
1818
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
19-
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets
19+
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels
2020

2121
# Install orca into environment
2222
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca==1.3.1

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ below :-).
3232
modified existing tests.
3333
- [ ] For a new feature, I have added documentation examples in an existing or
3434
new tutorial notebook (please see the doc checklist as well).
35+
- [ ] I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
3536
3637
-->

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ temp-plot.html
4646
doc/python/.ipynb_checkpoints
4747
doc/python/.mapbox_token
4848
doc/.ipynb_checkpoints
49+
doc/check-or-enforce-order.py

CHANGELOG.md

Lines changed: 112 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,118 @@
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-
## [4.6] - 2020-03-31
5+
## [4.10.0] - unreleased
6+
7+
8+
## [4.9.1] - unreleased
9+
10+
11+
## [4.9.0] - 2020-07-16
12+
13+
### Added
14+
15+
- Added image export support using [Kaleido](https://github.com/plotly/Kaleido). The image export backend can be configured using the new `engine` argument to `plotly.io.to_image` and `plotly.io.write_image`. The `engine` argument may be set to `"kaleido"`, `"orca"`, or `"auto"`. The default is `engine="auto"`, in which case the Kaleido backend is enabled if the `kaleido` package from PyPI is installed, otherwise Orca is used. ([#2613](https://github.com/plotly/plotly.py/pull/2613)).
16+
- `plotly.express.timeline()` added as an official alternative to `plotly.figure_factories.create_gantt()` ([#2626](https://github.com/plotly/plotly.py/pull/2626))
17+
- `create_hexbin_mapbox()` added to Figure Factories, with thanks to [@RenaudLN](https://github.com/RenaudLN) for the impressive contribution!
18+
- `facet_row_spacing` and `facet_col_spacing` added to Plotly Express cartesian 2d functions ([#2614](https://github.com/plotly/plotly.py/pull/2614))
19+
- `base` added to Plotly Express `bar` and `bar_polar` functions ([#2626](https://github.com/plotly/plotly.py/pull/2626))
20+
- `px.NO_COLOR` constant to override wide-form color assignment in Plotly Express ([#2614](https://github.com/plotly/plotly.py/pull/2614))
21+
22+
### Fixed
23+
24+
- trendline traces are now of type `scattergl` when `render_mode="webgl"` in Plotly Express ([#2614](https://github.com/plotly/plotly.py/pull/2614))
25+
- regression from 4.8.1 whereby `"parent"` was not accepted as part of `path` for `px.sunburst()` and `px.treemap()` ([#2640](https://github.com/plotly/plotly.py/pull/2640))
26+
- `create_dendrogram()` figure factory now works correctly with `scipy` 1.5.1 ([#2627](https://github.com/plotly/plotly.py/pull/2627))
27+
28+
### Updated
29+
30+
- Updated Plotly.js to version 1.54.6. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.54.6/CHANGELOG.md) for more information.
31+
- Added all cartesian-2d Plotly Express functions, plus `imshow`, to Pandas backend with `kind` option ([#2541](https://github.com/plotly/plotly.py/pull/2541))
32+
- `plotly.express.imshow` now uses data frame index and columns names and values to populate axis parameters by default ([#2539](https://github.com/plotly/plotly.py/pull/2539))
33+
- Javascript extensions are now build using Node 12, and have an updated `package-lock.json` with many fewer security warnings ([#2636](https://github.com/plotly/plotly.py/pull/2636))
34+
35+
36+
## [4.8.2] - 2020-06-26
37+
38+
### Updated
39+
40+
- Updated Plotly.js to version 1.54.5. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.54.5/CHANGELOG.md) for more information.
41+
- `add_traces()` now accepts bare `int`-like values for `rows`/`cols` as well as lists thereof ([#2546](https://github.com/plotly/plotly.py/pull/2546)), with thanks to [@MCBoarder289](https://github.com/MCBoarder289) for the contribution!
42+
43+
### Fixed
44+
45+
- `row`/`col` now accept `int`-like values, not strictly `int` values ([#2451](https://github.com/plotly/plotly.py/pull/2451)), with thanks to [@MCBoarder289](https://github.com/MCBoarder289) for the contribution!
46+
- Fixed special cases with `px.sunburst` and `px.treemap` with `path` input ([#2524](https://github.com/plotly/plotly.py/pull/2524))
47+
- Fixed bug in `hover_data` argument of `px` functions, when the column name is changed with labels and `hover_data` is a dictionary setting up a specific format for the hover data ([#2544](https://github.com/plotly/plotly.py/pull/2544)).
48+
- Made the Plotly Express `trendline` argument more robust and made it work with datetime `x` values ([#2554](https://github.com/plotly/plotly.py/pull/2554))
49+
- Fixed bug in `px.sunburst` and `px.treemap`: when the `color` and `values` arguments correspond to the same column, a different aggregation function has to be used for the two arguments ([#2591](https://github.com/plotly/plotly.py/pull/2591))
50+
- Plotly Express wide mode now accepts mixed integer and float columns ([#2598](https://github.com/plotly/plotly.py/pull/2598))
51+
- Plotly Express `range_(x|y)` should not impact the unlinked range of marginal subplots ([#2600](https://github.com/plotly/plotly.py/pull/2600))
52+
- `px.line` now sets `line_group=<variable>` in wide mode by default ([#2599](https://github.com/plotly/plotly.py/pull/2599))
53+
- Corrected some regex warnings ([#2577](https://github.com/plotly/plotly.py/pull/2577)), with thanks to [@georgevdd](https://github.com/georgevdd) for the contribution!
54+
55+
56+
## [4.8.1] - 2020-05-28
57+
58+
### Fixed
59+
60+
- Fixed the accidental removal of some functions and submodules from `plotly.colors` and `plotly.express.colors`
61+
62+
## [4.8.0] - 2020-05-26
63+
64+
### Added
65+
66+
- `plotly` now provides a Plotly Express-backed Pandas-compatible plotting backend, which can be activated via `pandas.options.plotting.backend = "plotly"`. Note that it is not intended to implement every Pandas plotting function, nor is it intended to replicate the behaviour of every argument, although per the changes below, `x` and `y` should behave similarly. ([#2336](https://github.com/plotly/plotly.py/pull/2336))
67+
- New datasets have been added to `plotly.express.data`: `stocks`, `experiment`, `medals_wide` and `medals_long`. ([#2336](https://github.com/plotly/plotly.py/pull/2336))
68+
- plotly `go.Figure` and `go.FigureWidget` now have a `_repr_html_` and a `_repr_mimebundle_` method, which are [standard hooks for integration in systems based on IPython](https://ipython.readthedocs.io/en/stable/config/integrating.html). In particular, with `_repr_html_` plotly figures can now be used within [sphinx-gallery](https://sphinx-gallery.github.io/stable/index.html) without any scraper. These additions should not change anything to the way plotly figures are displayed in notebook environments, since the `_ipython_display_` method (already present in earlier versions) takes precedence over the new methods.
69+
70+
### Updated
71+
72+
- The behaviour of the `x`, `y`, `orientation`, `histfunc`, `violinmode`, `boxmode` and `stripmode` arguments for 2d-cartesian functions in Plotly Express (i.e. `scatter`, `line`, `area`, `bar`, `histogram`, `violin`, `box`, `strip`, `funnel`, `density_heatmap` and `density_contour`) has been refined ([#2336](https://github.com/plotly/plotly.py/pull/2336)):
73+
- if `x` or `y` is missing, it is inferred to be the index of `data_frame` if `data_frame` provided, otherwise a stable index of integers starting at 0. In the case of `px.bar`, if the provided value is not continuous, the missing value is treated as a column of 1s named "count", so as to behave more like `px.histogram` and to avoid sizing the resulting bars differently based on their position in the column. Previously, missing values defaulted to integers starting at 0 *per trace* which made it potentially inconsistent or misleading.
74+
- if `x` (`y`) is missing, `orientation` now defaults to `v` (`h`). Previously it always defaulted to `v` but this is not considered a breaking change, as the cases in which it now defaults to `h` caused unreadable output if set to `v`.
75+
- if both `x` and `y` are provided and one of them does not contain continuous values, `orientation` defaults to the value perpendicular to that axis. Previously it always defaulted to `v` but this is not considered a breaking change, as the cases in which it now defaults to `h` caused unreadable output if set to `v`.
76+
- if either `x` or `y` (but not both) may now be provided as a list of column references into `data_frame` or columns of data, in which case the imputed data frame will be treated as "wide" data and `melt()`ed internally before applying the usual mapping rules, with function-specific defaults.
77+
- if neither `x` nor `y` is provided but `data_frame` is, the data frame will be treated as "wide" with defaults depending on the value of `orientation` (and `orientation` has accordingly been added to `scatter`, `line`, `density_heatmap`, and `density_contour` for this purpose). Previously this would have resulted in an empty figure.
78+
- if both `x` and `y` are provided to `histogram`, and if `x`, `y` and `z` are provided to `density_heatmap` or `density_contour`, then `histfunc` now defaults to `sum` so as to avoid ignoring the provided data, and to cause `histogram` and `bar` to behave more similarly.
79+
- `violinmode`, `boxmode` and `stripmode` now default to `overlay` if `x` (`y`) in in `v` (`h`) orientation is also mapped to `color`, to avoid strange spacing issues with the previous default of `group` in all cases.
80+
- The Plotly Express arguments `color_discrete_map`, `symbol_map` and `line_dash_map` now accept the string `"identity"` which causes the corresponding input data to be used as-is rather than mapped into `color_discrete_sequence`, `symbol_sequence` or `line_dash_sequence`, respectively. ([#2336](https://github.com/plotly/plotly.py/pull/2336))
81+
- Plotly Express now accepts `px.Constant` or `px.Range` objects in the place of column references so as to express constant or increasing integer values. ([#2336](https://github.com/plotly/plotly.py/pull/2336))
82+
83+
84+
## [4.7.1] - 2020-05-08
85+
86+
### Fixed
87+
88+
- 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)).
89+
- Fix `TypeError: unhashable type: 'Template'` during `Figure` construction when `plotly.io.templates.default` is set to a `Template` object rather than a string.
90+
91+
92+
## [4.7.0] - 2020-05-06
93+
94+
### Updated
95+
96+
- 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.
97+
- The sphinx-gallery scraper has been updated to work with different structures of galleries [#2149](https://github.com/plotly/plotly.py/pull/2419)
98+
99+
### Added
100+
101+
- 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).
102+
- 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!
103+
104+
### Fixed
105+
106+
- Plotly Express trendlines now handle missing data correctly [#2357](https://github.com/plotly/plotly.py/pull/2357)
107+
108+
### Performance
109+
110+
This version includes several performance improvements ([#2368](https://github.com/plotly/plotly.py/pull/2368), [#2403](https://github.com/plotly/plotly.py/pull/2403)).
111+
112+
- 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.
113+
- Property validation is now disabled for select internal operations.
114+
- 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.
115+
116+
## [4.6.0] - 2020-03-31
6117

7118
### Updated
8119

README.md

Lines changed: 35 additions & 36 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.9.0`
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.9.0
8686
```
8787

8888
or conda.
8989

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

9494
### Jupyter Notebook Support
@@ -112,50 +112,56 @@ 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
130+
# OPTIONAL: Jupyter widgets extension for FigureWidget support
131+
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected]
132+
```
133+
134+
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
135+
136+
### Static Image Export
136137

137-
# FigureWidget support
138-
jupyter labextension install [email protected] --no-build
138+
plotly.py supports [static image export](https://plotly.com/python/static-image-export/),
139+
using the either the [`kaleido`](https://github.com/plotly/Kaleido)
140+
package (recommended, supported as of `plotly` version 4.9) or the [orca](https://github.com/plotly/orca)
141+
command line utility (legacy as of `plotly` version 4.9).
139142

140-
# and jupyterlab renderer support
141-
jupyter labextension install [email protected] --no-build
143+
#### Kaleido
142144

143-
# Build extensions (must be done to activate extensions since --no-build is used above)
144-
jupyter lab build
145+
The [`kaleido`](https://github.com/plotly/Kaleido) package has no dependencies and can be installed
146+
using pip...
145147

146-
# Unset NODE_OPTIONS environment variable
147-
# (OS X/Linux)
148-
unset NODE_OPTIONS
149-
# (Windows)
150-
set NODE_OPTIONS=
148+
```
149+
$ pip install -U kaleido
151150
```
152151

153-
### Static Image Export
152+
or conda.
154153

155-
plotly.py supports static image export using the `to_image` and `write_image`
156-
functions in the `plotly.io` package. This functionality requires the
157-
installation of the plotly [orca](https://github.com/plotly/orca) command line utility and the
158-
[`psutil`](https://github.com/giampaolo/psutil) Python package.
154+
```
155+
$ conda install -c plotly python-kaleido
156+
```
157+
158+
#### Orca
159+
160+
While Kaleido is now the recommended image export approach because it is easier to install
161+
and more widely compatible, [static image export](https://plotly.com/python/static-image-export/)
162+
can also be supported
163+
by the legacy [orca](https://github.com/plotly/orca) command line utility and the
164+
[`psutil`](https://github.com/giampaolo/psutil) Python package.
159165

160166
These dependencies can both be installed using conda:
161167

@@ -171,13 +177,6 @@ pip install psutil
171177

172178
and orca can be installed according to the instructions in the [orca README](https://github.com/plotly/orca).
173179

174-
#### Troubleshooting
175-
176-
##### Wrong Executable found
177-
178-
If you get an error message stating that the `orca` executable that was found is not valid, this may be because another executable with the same name was found on your system. Please specify the complete path to the Plotly-Orca binary that you downloaded (for instance in the Miniconda folder) with the following command:
179-
180-
`plotly.io.orca.config.executable = '/home/your_name/miniconda3/bin/orca'`
181180

182181
### Extended Geo Support
183182

binder/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
jupytext
2-
plotly==4.6.0
2+
plotly==4.9.0
33
jupyter
44
notebook
5-
pandas
6-
statsmodels==0.10.1
5+
pandas==1.0.3
6+
statsmodels==0.11.1
77
scipy
88
patsy==0.5.1
99
numpy
@@ -15,3 +15,4 @@ scikit-image
1515
datashader
1616
pyarrow
1717
cufflinks==0.17.3
18+
kaleido

0 commit comments

Comments
 (0)