Skip to content

Commit 5334bf0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into doc-histogram-categoryorder
2 parents 2a2ee8b + 234ec0d commit 5334bf0

File tree

429 files changed

+19604
-6910
lines changed

Some content is hidden

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

429 files changed

+19604
-6910
lines changed

Diff for: .circleci/config.yml

+9
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,15 @@ jobs:
440440
git push --force [email protected]:plotly/plotly.py-docs.git master:built
441441
rm -rf .git
442442
cd ../..
443+
cd build/ipynb
444+
git init
445+
git config user.name plotlydocbot
446+
git config user.email [email protected]
447+
git add *
448+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
449+
git push --force [email protected]:plotly/plotly.py-docs.git master:built_ipynb
450+
rm -rf .git
451+
cd ../..
443452
fi
444453
tar -zcf build/html.tgz build/html
445454
rm -rf build/html build/ipynb

Diff for: .gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
plotly/_version.py export-subst
1+
packages/python/plotly/plotly/_version.py export-subst

Diff for: .github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
github: plotly
12
custom: https://plot.ly/products/consulting-and-oem/

Diff for: .github/pull_request_template.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ below :-).
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).
3535
- [ ] I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
36+
- [ ] For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).
3637
3738
-->

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ node_modules/
3131

3232
# virtual envs
3333
vv
34-
venv
34+
venv*
3535

3636
# dist files
3737
build
@@ -46,4 +46,5 @@ temp-plot.html
4646
doc/python/.ipynb_checkpoints
4747
doc/python/.mapbox_token
4848
doc/.ipynb_checkpoints
49+
tags
4950
doc/check-or-enforce-order.py

Diff for: CHANGELOG.md

+107
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,108 @@
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.15.0] - UNRELEASED
6+
7+
### Added
8+
9+
### Fixed
10+
11+
### Updated
12+
13+
14+
## [4.14.2] - UNRELEASED
15+
16+
### Added
17+
18+
### Fixed
19+
20+
### Updated
21+
22+
23+
## [4.14.1] - 2020-12-09
24+
25+
### Updated
26+
27+
- Updated Plotly.js to version 1.58.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.58.0/CHANGELOG.md) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
28+
- fixes for new `ticklabelposition` attribute
29+
- fixes for a regression related to treemaps in the previous version
30+
31+
32+
## [4.14.0] - 2020-12-07
33+
34+
### Added
35+
36+
- `px.imshow` now supports `facet_col` and `animation_frame` arguments for visualizing 3-d and 4-d images [2746](https://github.com/plotly/plotly.py/pull/2746)
37+
- `px.defaults` now supports `color_discrete_map`, `symbol_map`, `line_dash_map`, `labels` and `category_orders` as well as a `.reset()` method [2957](https://github.com/plotly/plotly.py/pull/2957)
38+
39+
### Fixed
40+
41+
- axes will now auto-type numeric strings as categorical data rather than linear in the default templates [2951](https://github.com/plotly/plotly.py/pull/2951)
42+
43+
### Updated
44+
45+
- Updated Plotly.js to version 1.58.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.58.0/CHANGELOG.md) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
46+
- a new `ticklabelposition` attribute to enable positioning tick labels inside the plotting area
47+
- better support for `scaleanchor` and `matches` on cartesian axes for matched square subplots
48+
- a new `autotypenumbers` attribute which is now set to `strict` in the default templates
49+
- various fixes relating to `automargins` for small figures
50+
51+
52+
## [4.13.0] - 2020-11-23
53+
54+
### Added
55+
- `px.choropleth`, `px.scatter_geo` and `px.line_geo` now support faceting as well as `fitbounds` and `basemap_visible` [2923](https://github.com/plotly/plotly.py/pull/2923)
56+
- `px.scatter_geo` and `px.line_geo` now support `geojson`/`featureidkey` input [2923](https://github.com/plotly/plotly.py/pull/2923)
57+
- `px.scatter_geo` now supports `symbol` [2923](https://github.com/plotly/plotly.py/pull/2923)
58+
- `go.Figure` now has a `set_subplots` method to set subplots on an already
59+
existing figure. [2866](https://github.com/plotly/plotly.py/pull/2866)
60+
- Added `Turbo` colorscale and fancier swatch display functions
61+
[2882](https://github.com/plotly/plotly.py/pull/2882)
62+
- A utility function `image_array_to_data_uri` has been added in
63+
`plotly.utils`, in order to transform NumPy arrays to data b64 URIs (which
64+
can be passed to the source parameter of `go.Image`, or to layout images).
65+
[2879](https://github.com/plotly/plotly.py/pull/2879)
66+
- the `selector` argument to updater/selector functions now accepts `int`s and `str`s
67+
[2894](https://github.com/plotly/plotly.py/pull/2894)
68+
69+
70+
### Updated
71+
72+
- the JSON serialization of plotly figures has been accelerated thanks to a
73+
different handling of Infinity and NaN values. For example, a figure with a
74+
1000x1000 Heatmap should now serialize 2x faster. [2880](https://github.com/plotly/plotly.py/pull/2880)
75+
- Coding mistakes with "magic underscores" now return significantly more ergonomic error
76+
messages [2843](https://github.com/plotly/plotly.py/pull/2843)
77+
- Error messages related to impossible subplot geometries are now much more helpful
78+
[2897](https://github.com/plotly/plotly.py/pull/2897)
79+
80+
81+
### Fixed
82+
83+
- `px.scatter_geo` support for `text` is fixed [2923](https://github.com/plotly/plotly.py/pull/2923)
84+
- the `x` and `y` parameters of `px.imshow` are now used also in the case where
85+
an Image trace is used (for RGB data or with `binary_string=True`). However,
86+
only numerical values are accepted (while the Heatmap trace allows date or
87+
string values for `x` and `y`). [2761](https://github.com/plotly/plotly.py/pull/2761)
88+
89+
90+
## [4.12.0] - 2020-10-23
91+
92+
### Added
93+
94+
- For `add_trace`, `add_shape`, `add_annotation` and `add_layout_image`, the `row` and/or `col` argument now also accept the string `"all"`. `row="all"` adds the object to all the subplot rows and `col="all"` adds the object to all the subplot columns. ([#2840](https://github.com/plotly/plotly.py/pull/2840))
95+
- Shapes that reference the plot axes in one dimension and the data in another dimension can be added with the new `add_hline`, `add_vline`, `add_hrect`, `add_vrect` functions, which also support the `row="all"` and `col="all"` arguments. ([#2840](https://github.com/plotly/plotly.py/pull/2840))
96+
- The `add_trace`, `add_shape`, `add_annotation`, `add_layout_image`, `add_hline`, `add_vline`, `add_hrect`, `add_vrect` functions accept an argument `exclude_empty_subplots` which if `True`, only adds the object to subplots already containing traces or layout objects. This is useful in conjunction with the `row="all"` and `col="all"` arguments. ([#2840](https://github.com/plotly/plotly.py/pull/2840))
97+
- For all `go.Figure` functions accepting a selector argument (e.g., `select_traces`), this argument can now also be a function which is passed each relevant graph object (in the case of `select_traces`, it is passed every trace in the figure). For graph objects where this function returns true, the graph object is included in the selection. ([#2844](https://github.com/plotly/plotly.py/pull/2844))
98+
99+
### Added
100+
101+
- Better magic underscore error messages. For example, `some_fig.update_layout(geo_ltaxis_showgrid=True)` shows `Bad property path:\ngeo_ltaxis_showgrid\n ^` and lists the valid properties for `geo`.
102+
103+
### Updated
104+
105+
- Updated Plotly.js to version 1.57.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.57.1/CHANGELOG.md) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module.
106+
5107
## [4.11.0] - 2020-10-01
6108

7109
### Updated
@@ -16,6 +118,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
16118

17119
### Updated
18120

121+
- The JSON serialization of plotly figures had been accelerated by handling
122+
differently figures with and without NaN and Inf values ([#2880](https://github.com/plotly/plotly.py/pull/2880)).
123+
124+
### Updated
125+
19126
- Updated Plotly.js to version 1.55.2. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/v1.55.2/CHANGELOG.md) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module.
20127
- `px.imshow` has a new `binary_string` boolean argument, which passes the
21128
image data as a b64 binary string when True. Using binary strings allow for

Diff for: README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
</tr>
3232
</table>
3333

34+
## Data Science Workspaces
35+
36+
Our recommended IDE for Plotly’s Python graphing library is Dash Enterprise’s [Data Science Workspaces](https://plotly.com/dash/workspaces/), which has both Jupyter notebook and Python code file support.
37+
3438
## Quickstart
3539

36-
`pip install plotly==4.11.0`
40+
`pip install plotly==4.14.1`
3741

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

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

8488
```
85-
pip install plotly==4.11.0
89+
pip install plotly==4.14.1
8690
```
8791

8892
or conda.
8993

9094
```
91-
conda install -c plotly plotly=4.11.0
95+
conda install -c plotly plotly=4.14.1
9296
```
9397

9498
### Jupyter Notebook Support
@@ -125,18 +129,18 @@ Then run the following commands to install the required JupyterLab extensions (n
125129

126130
```
127131
# Basic JupyterLab renderer support
128-
jupyter labextension install jupyterlab-plotly@4.11.0
132+
jupyter labextension install jupyterlab-plotly@4.14.1
129133
130134
# OPTIONAL: Jupyter widgets extension for FigureWidget support
131-
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.11.0
135+
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.14.1
132136
```
133137

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

136140
### Static Image Export
137141

138142
plotly.py supports [static image export](https://plotly.com/python/static-image-export/),
139-
using the either the [`kaleido`](https://github.com/plotly/Kaleido)
143+
using either the [`kaleido`](https://github.com/plotly/Kaleido)
140144
package (recommended, supported as of `plotly` version 4.9) or the [orca](https://github.com/plotly/orca)
141145
command line utility (legacy as of `plotly` version 4.9).
142146

@@ -152,7 +156,7 @@ $ pip install -U kaleido
152156
or conda.
153157

154158
```
155-
$ conda install -c plotly python-kaleido
159+
$ conda install -c conda-forge python-kaleido
156160
```
157161

158162
#### Orca
@@ -200,13 +204,13 @@ The `chart-studio` package can be used to upload plotly figures to Plotly's Char
200204
Studio Cloud or On-Prem service. This package can be installed using pip...
201205

202206
```
203-
pip install chart-studio==1.0.0
207+
pip install chart-studio==1.1.0
204208
```
205209

206210
or conda
207211

208212
```
209-
conda install -c plotly chart-studio=1.0.0
213+
conda install -c plotly chart-studio=1.1.0
210214
```
211215

212216
## Migration

Diff for: binder/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==4.11.0
2+
plotly==4.14.1
33
jupyter
44
notebook
55
pandas==1.0.3
@@ -18,3 +18,4 @@ cufflinks==0.17.3
1818
kaleido
1919
scikit-learn
2020
umap-learn
21+
wget

Diff for: contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ pytest packages/python/plotly/plotly/tests/test_core/
280280
pytest plotly/tests/test_plotly/test_plot.py
281281
```
282282

283-
or for a specfic test function
283+
or for a specific test function
284284

285285
```bash
286286
pytest plotly/tests/test_plotly/test_plot.py::test_function

Diff for: doc/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ all: $(HTML_FILES) $(V3_REDIR_FILES) $(NEXT_REDIR_FILES)
2323

2424
$(IPYNB_DIR)/.mapbox_token: $(MD_DIR)/.mapbox_token
2525
@mkdir -p $(IPYNB_DIR)
26-
cd $(IPYNB_DIR) && ln -s ../../$<
26+
@echo "[symlink] .mapbox_token"
27+
@cd $(IPYNB_DIR) && ln -s ../../$<
2728

2829
$(IPYNB_FILES): $(IPYNB_DIR)/.mapbox_token
2930

3031
$(IPYNB_DIR)/%.ipynb: $(MD_DIR)/%.md
3132
@mkdir -p $(IPYNB_DIR)
3233
@echo "[jupytext] $<"
33-
@cat what_about_dash.md >> $<
34-
@jupytext $< --to notebook --quiet --output $@
34+
@cat $< what_about_dash.md | jupytext --to notebook --quiet --output $@
3535

3636
$(HTML_DIR)/2019-07-03-%.html: $(IPYNB_DIR)/%.ipynb
3737
@mkdir -p $(HTML_DIR)

Diff for: 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 = "4.11.0"
31+
release = "4.14.1"
3232

3333

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

Diff for: doc/nb.tpl

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
{%- endblock header-%}
1313

14+
{% block input_group %}
15+
{%- if not cell.metadata.get('hide_code', False) -%}
16+
{{ super() }}
17+
{%- endif -%}
18+
{% endblock input_group %}
1419

1520
{%- block footer %}
1621
{{ super() }}

Diff for: doc/python/3d-line-plots.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ fig.show()
120120

121121
#### Reference
122122

123-
See https://plotly.com/python/reference/scatter3d/#scatter3d-marker-line for more information and chart attribute options!
123+
See [function reference for `px.(line_3d)`](https://plotly.com/python-api-reference/generated/plotly.express.line_3d) or https://plotly.com/python/reference/scatter3d/#scatter3d-marker-line for more information and chart attribute options!

Diff for: doc/python/3d-mesh.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.3.0
9+
jupytext_version: 1.6.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.3
23+
version: 3.7.6
2424
plotly:
2525
description: How to make 3D Mesh Plots
2626
display_as: 3d_charts
@@ -68,6 +68,19 @@ fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z,
6868
fig.show()
6969
```
7070

71+
### 3D Mesh in Dash
72+
73+
[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.
74+
75+
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & [deploy](https://plotly.com/dash/app-manager/) apps like this with <a class="plotly-red" href="https://plotly.com/dash/">Dash Enterprise</a>.**
76+
77+
78+
```python hide_code=true
79+
from IPython.display import IFrame
80+
snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'
81+
IFrame(snippet_url + '3d-mesh', width='100%', height=630)
82+
```
83+
7184
### Mesh Tetrahedron
7285

7386
In this example we use the `ì`, `j` and `k` parameters to specify manually the geometry of the triangles of the mesh.
@@ -131,7 +144,7 @@ fig.show()
131144

132145
### Intensity values defined on vertices or cells
133146

134-
The `intensitymode` attribute of `go.Mesh3d` can be set to `vertex` (default mode, in which case intensity values are interpolated between values defined on vertices), or to `cell` (value of the whole cell, no interpolation). Note that the `intensity` parameter should have the same length as the number of vertices or cells, depending on the `intensitymode`.
147+
The `intensitymode` attribute of `go.Mesh3d` can be set to `vertex` (default mode, in which case intensity values are interpolated between values defined on vertices), or to `cell` (value of the whole cell, no interpolation). Note that the `intensity` parameter should have the same length as the number of vertices or cells, depending on the `intensitymode`.
135148

136149
Whereas the previous example used the default `intensitymode='vertex'`, we plot here the same mesh with `intensitymode='cell'`.
137150

@@ -163,4 +176,4 @@ fig.show()
163176
```
164177

165178
## Reference
166-
See https://plotly.com/python/reference/mesh3d/ for more information and chart attribute options!
179+
See https://plotly.com/python/reference/mesh3d/ for more information and chart attribute options!

0 commit comments

Comments
 (0)