Skip to content

Commit 5814699

Browse files
authored
Release 3.2.0 (#1157)
* Initial changelog work * More progress on Changelog * README installation updates to add conda and orca instructions * Add notebook and ipywidgets to quickstart installation command * Split quickstart code into two cells to show where figure is displayed * Reorganize README * Specialize schema descriptions for Python in docstrings * bump versions to plotly.py 3.2.0rc1 and plotlywidget 0.3.0-rc.1 Also update README with release candidate installation instructions * Conda needs single equals * Fix conda orca install command [skip ci] * Fill in remaining TODOs and references in changelog and README [skip ci] * `np.ascontiguousarray` is preserving the `WRITEABLE` flag now. Copy explicitly so we don't make input array read-only. * Add instructions to unset NODE_OPTIONS environment variable This causes an error when using orca from the commandline. * Bump plotly.py to 3.2.0 and plotlywidget to 0.3.0
1 parent 8586a2a commit 5814699

File tree

986 files changed

+17996
-17287
lines changed

Some content is hidden

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

986 files changed

+17996
-17287
lines changed

CHANGELOG.md

+68
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,74 @@
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+
## [3.2.0] - 2018-09-05
6+
This release introduces the long-anticipated ability to programmatically
7+
export figures as high quality static images in both raster and vector
8+
formats.
9+
10+
### JupyterLab Versions
11+
For use with JupyterLab, the following versions of the following packages
12+
must be installed:
13+
14+
- Python Packages
15+
- plotly==3.2.0
16+
- ipywidgets>=7.2
17+
- notebook>=5.3
18+
- jupyterlab==0.34
19+
20+
- JupyterLab Extensions
21+
22+
- @jupyter-widgets/jupyterlab-manager@0.37
23+
- @jupyterlab/plotly-extension@0.17
24+
25+
### Added
26+
- plotly.js version 1.40.1, which introduces the following features:
27+
- Allow `contour`, `contourcarpet` and `histogram2dcontour` to have corresponding legend items using `showlegend`
28+
([plotly/plotly.js#2891](https://github.com/plotly/plotly.js/pull/2891),
29+
[plotly/plotly.js#2914](https://github.com/plotly/plotly.js/pull/2914))
30+
- Add scatterpolar and scatterpolargl attributes `r0`, `dr`, `theta0` and `dtheta`
31+
([plotly/plotly.js#2895](https://github.com/plotly/plotly.js/pull/2895))
32+
- Add layout attributes `piecolorway` and `extendpiecolors` for more control over pie colors
33+
([plotly/plotly.js#2870](https://github.com/plotly/plotly.js/pull/2870))
34+
- Add `splom` attribute `dimensions[i].axis.type` to easily override axis type in splom-generated axes
35+
([plotly/plotly.js#2899](https://github.com/plotly/plotly.js/pull/2870))
36+
- Add support for on-graph text in `scatterpolargl` traces
37+
([plotly/plotly.js#2895](https://github.com/plotly/plotly.js/pull/2895))
38+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1400----2018-08-16)
39+
for bug fixes and more information.
40+
- Support for offline static image export with the `to_image` and `write_image`
41+
functions in the new `plotly.io` package ([#1120](https://github.com/plotly/plotly.py/pull/1120)).
42+
- Note: Image export requires the plotly [orca](https://github.com/plotly/orca)
43+
command line utility and the [`psutil`](https://github.com/giampaolo/psutil) Python package.
44+
- New documentation sections covering [Static Image Export](https://plot.ly/python/static-image-export/)
45+
and [Orca Management](https://plot.ly/python/orca-management/)
46+
- Support for displaying `FigureWidget` instances in static contexts
47+
(e.g. [nbviewer](http://nbviewer.jupyter.org/)) just like the built-in ipywidgets
48+
([#1117](https://github.com/plotly/plotly.py/pull/1117))
49+
- Full integration of the Cividis colorscale ([#883](https://github.com/plotly/plotly.py/pull/883))
50+
- conda packaging
51+
- From here forward, new versions of plotly.py will be published to the [plotly anaconda channel](https://anaconda.org/plotly/)
52+
on the same day they are published to PyPI.
53+
([72ad0e4](https://github.com/plotly/plotly.py/commit/72ad0e4bf54bb8a06445d2ca55488ffc11c836a7))
54+
- The [`README`](README.md) now includes conda installation instructions alongside the pip instructions.
55+
- In addition to the existing installation approaches, orca is now also available as a
56+
[conda package](https://anaconda.org/plotly/plotly-orca) from the plotly anaconda channel.
57+
58+
### Updated
59+
- Show traces at the top of the Gantt chart's colorbar ([#1110](https://github.com/plotly/plotly.py/pull/1110))
60+
- Significantly improved validation performance for numeric pandas `Series` objects ([#1149](https://github.com/plotly/plotly.py/pull/1149))
61+
- Specialize auto-generated docstrings for Python syntax
62+
- More robust and specific logic for retrying requests to the plot.ly cloud service ([#1146](https://github.com/plotly/plotly.py/pull/1146))
63+
- Support basic authentication when using the streaming API behind a proxy server ([#1133](https://github.com/plotly/plotly.py/pull/1133))
64+
65+
### Fixed
66+
- Validators for `dash` properties (e.g. `scatter.line.dash`) incorrectly rejected dash length lists ([#1136](https://github.com/plotly/plotly.py/pull/1136))
67+
- Annotated heatmap error when custom colorscale was specified ([#1151](https://github.com/plotly/plotly.py/pull/1151))
68+
- Incorrect deprecation warning for deprecated `plotly.graph_objs.Annotations` class ([#1138](https://github.com/plotly/plotly.py/pull/1138))
69+
- Harmless JavaScript console error when opening an html file produced by `plotly.offline.plot` ([#1152](https://github.com/plotly/plotly.py/pull/1152))
70+
- Incorrect validation errors when writing data to the streaming API ([#1145](https://github.com/plotly/plotly.py/pull/1145))
71+
72+
573
## [3.1.1] - 2018-08-10
674
This release is a minor bug-fix update to version 3.1.0
775

README.md

+63-14
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
## Quickstart
44

5-
`pip install plotly`
5+
`pip install plotly "notebook>=5.3" "ipywidgets>=7.2"`
66

77
Inside [Jupyter notebook](https://jupyter.org/install):
88
```python
99
import plotly.graph_objs as go
1010
fig = go.FigureWidget()
1111
# Display an empty figure
1212
fig
13-
13+
```
14+
```python
1415
# Add a scatter chart
1516
fig.add_scatter(y=[2, 1, 4, 3])
1617
# Add a bar chart
@@ -49,44 +50,92 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
4950

5051
***
5152

52-
## Installation of plotly.py Version 3
53-
To install plotly.py and enable Jupyter or Jupyter Lab support, run:
53+
## Installation
54+
55+
plotly.py may be installed using pip...
56+
```
57+
pip install plotly==3.2.0
58+
```
59+
60+
or conda.
61+
```
62+
conda install -c plotly plotly=3.2.0
63+
```
64+
65+
### Jupyter Notebook Support
66+
For use in the Jupyter Notebook, install the `notebook` and `ipywidgets`
67+
packages using pip...
68+
69+
```
70+
pip install "notebook>=5.3" "ipywidgets>=7.2"
71+
```
72+
73+
of conda.
74+
5475
```
55-
pip install plotly==3.1.1
56-
pip install "notebook>=5.3" "ipywidgets>=7.2" # only necessary for Jupyter Notebook environments
76+
conda install "notebook>=5.3" "ipywidgets>=7.2"
5777
```
5878

59-
If you're using older versions of `notebook` or `ipywidgets` you may need to manually activate the widget extensions (this should not be needed for `notebook>=5.3` and `ipywidgets>=7.2`)
79+
### JupyterLab Support
80+
For use in JupyterLab, install the `jupyterlab` and `ipywidgets`
81+
packages using pip...
6082

6183
```
62-
jupyter nbextension enable --py widgetsnbextension --sys-prefix
63-
jupyter nbextension enable --py plotlywidget --sys-prefix
84+
pip install jupyterlab==0.34 "ipywidgets>=7.2"
6485
```
6586

66-
In addition, to add JupyterLab support run the following commands
87+
of conda.
6788

6889
```
69-
pip install jupyterlab==0.33
90+
conda install jupyterlab=0.34 "ipywidgets>=7.2"
91+
```
7092

93+
Then run the following commands to install the required JupyterLab extensions:
94+
```
7195
# Avoid "JavaScript heap out of memory" errors during extension installation
7296
# (OS X/Linux)
7397
export NODE_OPTIONS=--max-old-space-size=4096
7498
# (Windows)
7599
set NODE_OPTIONS=--max-old-space-size=4096
76100
77101
# Jupyter widgets extension
78-
jupyter labextension install @jupyter-widgets/jupyterlab-manager@0.36 --no-build
102+
jupyter labextension install @jupyter-widgets/jupyterlab-manager@0.37 --no-build
79103
80104
# FigureWidget support
81-
jupyter labextension install plotlywidget@0.2.1 --no-build
105+
jupyter labextension install plotlywidget@0.3.0 --no-build
82106
83107
# offline iplot support
84-
jupyter labextension install @jupyterlab/plotly-extension@0.16 --no-build
108+
jupyter labextension install @jupyterlab/plotly-extension@0.17 --no-build
85109
86110
# Build extensions (must be done to activate extensions since --no-build is used above)
87111
jupyter lab build
112+
113+
# Unset NODE_OPTIONS environment variable
114+
# (OS X/Linux)
115+
unset NODE_OPTIONS
116+
# (Windows)
117+
set NODE_OPTIONS=
118+
```
119+
120+
### Static Image Export
121+
plotly.py supports static image export using the `to_image` and `write_image`
122+
functions in the `plotly.io` package. This functionality requires the
123+
installation of the plotly [orca](https://github.com/plotly/orca) command line utility and the
124+
[`psutil`](https://github.com/giampaolo/psutil) Python package.
125+
126+
These dependencies can both be installed using conda:
88127
```
128+
conda install -c plotly plotly-orca psutil
129+
```
130+
131+
Or, `psutil` can be installed using pip...
132+
```
133+
pip install psutil
134+
```
135+
136+
and orca can be installed according to the instructions in the [orca README](https://github.com/plotly/orca).
89137

138+
## Migration
90139
If you're migrating from plotly.py version 2, please check out the [migration guide](migration-guide.md)
91140

92141
## Copyright and Licenses

_plotly_utils/basevalidators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def copy_to_readonly_numpy_array(v, dtype=None, force_numeric=False):
9696
if dtype:
9797
new_v = np.ascontiguousarray(v.astype(dtype))
9898
else:
99-
new_v = np.ascontiguousarray(v)
99+
new_v = np.ascontiguousarray(v.copy())
100100
else:
101101
new_v = v.copy()
102102

codegen/utils.py

+41-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from importlib import import_module
66
from io import StringIO
77
from typing import List
8+
import re
89

910
from yapf.yapflib.yapf_api import FormatCode
1011

@@ -132,6 +133,42 @@ def write_init_py(pkg_root, path_parts, import_pairs):
132133
format_and_write_source_py(init_source, filepath)
133134

134135

136+
def format_description(desc):
137+
138+
# Remove surrounding *s from numbers
139+
desc = re.sub('(^|[\s(,.:])\*([\d.]+)\*([\s),.:]|$)', r'\1\2\3', desc)
140+
141+
# replace *true* with True
142+
desc = desc.replace("*true*", "True")
143+
desc = desc.replace("*false*", "False")
144+
145+
# Replace *word* with "word"
146+
desc = re.sub('(^|[\s(,.:])\*(\S+)\*([\s),.:]|$)', r'\1"\2"\3', desc)
147+
148+
# Special case strings that don't satisfy regex above
149+
other_strings = ['Courier New', 'Droid Sans', 'Droid Serif',
150+
'Droid Sans Mono', 'Gravitas One', 'Old Standard TT',
151+
'Open Sans', 'PT Sans Narrow', 'Times New Roman']
152+
153+
for s in other_strings:
154+
desc = desc.replace("*%s*" % s, '"%s"' % s)
155+
156+
# Replace {array} with list
157+
desc = desc.replace("an {array}", "a list")
158+
desc = desc.replace("{array}", "list")
159+
160+
# Replace {arrays} with lists
161+
desc = desc.replace("{arrays}", "lists")
162+
163+
# replace {2D array} with 2D list
164+
desc = desc.replace("{2D array}", "2D list")
165+
166+
# replace {2D arrays} with 2D lists
167+
desc = desc.replace("{2D arrays}", "2D lists")
168+
169+
return desc
170+
171+
135172
# Constants
136173
# =========
137174
# Mapping from full property paths to custom validator classes
@@ -412,7 +449,7 @@ def get_validator_params(self):
412449
params['data_docs'] = (
413450
'\"\"\"' +
414451
self.get_constructor_params_docstring() +
415-
'\"\"\"')
452+
'\n\"\"\"')
416453
else:
417454
assert self.is_simple
418455

@@ -936,7 +973,7 @@ def description(self) -> str:
936973
if isinstance(desc, list):
937974
desc = ''.join(desc)
938975

939-
return desc
976+
return format_description(desc)
940977

941978

942979
class LayoutNode(PlotlyNode):
@@ -986,7 +1023,7 @@ def description(self) -> str:
9861023
desc = self.node_data.get('description', '')
9871024
if isinstance(desc, list):
9881025
desc = ''.join(desc)
989-
return desc
1026+
return format_description(desc)
9901027

9911028
# Raw data
9921029
# --------
@@ -1036,7 +1073,7 @@ def description(self) -> str:
10361073
desc = self.node_data.get('description', '')
10371074
if isinstance(desc, list):
10381075
desc = ''.join(desc)
1039-
return desc
1076+
return format_description(desc)
10401077

10411078
# Raw data
10421079
# --------

js/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plotlywidget",
3-
"version": "0.3.0-alpha.1",
3+
"version": "0.3.0",
44
"description": "The plotly.py ipywidgets library",
55
"author": "The plotly.py team",
66
"license": "MIT",

0 commit comments

Comments
 (0)