Skip to content

Commit 27d3a6f

Browse files
committed
Updated readme, changelog, and migration guide for 3.0.0 release
1 parent 3fa38e5 commit 27d3a6f

File tree

3 files changed

+54
-84
lines changed

3 files changed

+54
-84
lines changed

CHANGELOG.md

Lines changed: 9 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,88 +2,22 @@
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.0.0rc11 [04-07-2018]
6-
### Added
7-
- Perform automatic retries when communicating with plot.ly services. This introduces a new required dependency on the [retrying](https://pypi.org/project/retrying/) library.
5+
## 3.0.0 - 2018-07-05
86

9-
### Fixed
10-
- Unable to sign in to plot.ly ([#1044](https://github.com/plotly/plotly.py/issues/1044))
7+
This is a major version with many exciting updates. See the [Introducing plotly.py 3.0.0](https://medium.com/@plotlygraphs/introducing-plotly-py-3-0-0-7bb1333f69c6) post for more information.
118

12-
## 3.0.0rc10 [27-06-2018]
139
### Added
14-
- Full Jupyter integration - run `help(go.FigureWidget)` for more information
15-
- update traces interactively
16-
- Traces can be added and updated interactively by simply assigning to properties
17-
- The full Traces and Layout API is generated from the plotly schema to provide a great experience for interactive use in the notebook
10+
- Full Jupyter ipywidgets integration with the new `graph_objs.FigureWidget` class
11+
- `FigureWidget` figures can be updated interactively using property assignment syntax
12+
- The full trace and layout API is generated from the plotly schema to provide a great experience for interactive use in the notebook
1813
- Support for setting array properties as numpy arrays. When numpy arrays are used, ipywidgets binary serialization protocol is used to avoid converting these to JSON strings.
1914
- Context manager API for animation. Run `help(go.Figure().batch_animate)` for the full doc string.
20-
- New `__repr__` for `Figure` and `graph_objs` objects
21-
22-
### Removed
23-
- Removed `.to_string`, `.strip_style`, `.get_data`, `.validate` and `.to_dataframe` methods from `plotly.graph_objs` objects. For example run `dir(plotly.graph_objs.Scatter)` to get all the (magic) methods of the Scatter class.
24-
25-
- graph objects no longer support the `_raise` parameter. They are always validated and always raise an exception on validation failures. It is still possible to pass a dict to `plot/iplot` with `validate=False` to bypass validation.
26-
27-
### Changed
15+
- Perform automatic retries when communicating with plot.ly services. This introduces a new required dependency on the [retrying](https://pypi.org/project/retrying/) library.
2816
- Improved data validation covering the full API with clear, informative error messages. This means that incorrect properties and/or values now always raise a `ValueError` with a description of the error, the invalid property, and the available properties on the level that it was placed in the graph object. Eg. `go.Scatter(foo=123)` raises a validation error. See https://plot.ly/python/reference/ for a reference to all valid properties and values in the Python API.
17+
- Error message for `plotly.figure_factory.create_choropleth` is now helpful to Anaconda users who do not have the correct modules installed for the County Choropleth figure factory.
2918

30-
- Graph objects are no longer dicts, though they still provide many dict-like magic methods. Running a cell of a graph object now prints a dict-style representation of the object:
31-
32-
Eg. `plotly.graph_objs.Scatter()` prints
33-
34-
```
35-
Scatter({
36-
'type': 'scatter'
37-
})
38-
```
39-
40-
- plotly objects now have a `.to_plotly_json` method that changes the representation of the plotly object to JSON:
41-
42-
Eg. `go.Scatter().to_plotly_json()` returns `{'type': 'scatter'}`
43-
44-
- Object arrays (`Figure.data`, `Layout.images`, `Parcoords.dimensions`, etc.) are now represented as tuples of graph objects, not lists.
45-
46-
- Data array properties may not be specified as scalars. For example `go.Scatter(x=1, y=2)` should be replaced by `go.Scatter(x=[1], y=[2])`
47-
48-
- Assignment to the `Figure.data` property must contain a permutation of a subset of the existing traces. Assignment can be used to reorder and remove traces, but cannot currently add new traces.
49-
50-
51-
### Deprecated
52-
- all graph objects must now be written using their full path. For example if one wants to customize the marker param in a scatter object, write `plotly.graph_objs.scatter.Marker` instead of `plotly.graph_objs.Marker`. If the marker object lives in a `plotly.graph_objs.Scatter()` object then a deprecated message will appear. Similarly
53-
54-
```
55-
import plotly.graph_objs as go
56-
go.Scatter(
57-
x=[0],
58-
y=[0],
59-
marker=go.Marker(
60-
color='rgb(255,45,15)'
61-
)
62-
)
63-
```
64-
65-
produces a deprecation warning but
66-
67-
```
68-
import plotly.graph_objs as go
69-
go.Scatter(
70-
x=[0],
71-
y=[0],
72-
marker=go.scatter.Marker(
73-
color='rgb(255,45,15)'
74-
)
75-
)
76-
```
77-
78-
does not.
79-
80-
- `go.Data()` is deprecated. Use a list or array `[]` instead.
81-
82-
- The `.append_trace` method is deprecated. Use `add_trace` or `.add_traces` with the `row` and `col` parameters.
83-
84-
## [2.7.1] - [UNRELEASED]
85-
### Updated
86-
- error message for `plotly.figure_factory.create_choropleth` is now helpful to Anaconda users who do not have the correct modules installed for the County Choropleth figure factory.
19+
### Changed / Deprecated
20+
Please see the [migration guid](migration-guide.md) for a full list of the changes and deprecations in version 3.0.0
8721

8822
## [2.7.0] - 2018-05-23
8923
### Updated

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
2626

2727
***
2828

29-
## Installation Plotly 3.0.0rc11
30-
To install and enable with Jupyter or Jupyter Lab, run:
29+
## Installation of plotly.py Version 3
30+
To install plotly.py and enable Jupyter or Jupyter Lab support, run:
3131
```
32-
pip install plotly==3.0.0rc11
32+
pip install "plotly>=3.0"
3333
pip install "notebook>=5.3" "ipywidgets>=7.2" # only necessary for Jupyter Notebook environments
3434
```
3535

@@ -52,7 +52,7 @@ jupyter labextension install plotlywidget
5252
If you're migrating from plotly.py version 2, please check out the [migration guid](migration-guide.md)
5353

5454
## Copyright and Licenses
55-
Code and documentation copyright 2017 Plotly, Inc.
55+
Code and documentation copyright 2018 Plotly, Inc.
5656

5757
Code released under the [MIT license](LICENSE.txt).
5858

migration-guide.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Migration to Version 3
2-
There are many new and great features in Plotly 3.0 including deeper Jupyter integration, deeper figure validation, improved performance, and more. To get started right away with Plotly, check out the tutorial below:
2+
There are many new and great features in Plotly 3.0 including deeper Jupyter integration, deeper figure validation, improved performance, and more. This guide contains the a summary of the breaking changes that you need to be aware of when migrating code from version 2 to version 3.
33

44
## Simple FigureWidget Example
55
We now have seamless integration with the Jupyter widget ecosystem. We've introduced a new graph object called `go.FigureWidget` that acts like a regular plotly `go.Figure` that can be directly displayed in the notebook.
@@ -43,7 +43,7 @@ FigureWidget({
4343
})
4444
```
4545

46-
## New add_trace method that handles subplots
46+
## New add trace methods that handle subplots
4747
The legacy `append_trace` method for adding traces to subplots has been deprecated in favor of the new `add_trace`, `add_traces`, and `add_*` methods. Each of these new methods accepts optional row/column information that may be used to add traces to subplots for figures initialized by the `plotly.tools.make_subplots` function.
4848

4949
Let's create a subplot then turn it into a FigureWidget to display in the notebook.
@@ -80,8 +80,42 @@ f2
8080

8181
## Breaking Changes
8282

83+
## Graph Objects Superclass
84+
Graph objects are no longer `dict` subclasses, though they still provide many `dict`-like magic methods.
85+
86+
## Graph Objects Hierarchy
87+
All graph objects are now placed in a package hierarchy that matches their position in the object hierarchy. For example, `go.Marker` is now accessible as `go.scatter.Marker` or `go.bar.Marker` or whatever trace it is nested within. By providing unique objects under the parent-trace namespace, we can provide better validation (the properties for a marker object within a scatter trace may be different than the properties of a marker object within a bar trace). Although deprecated, the previous objects are still supported, they just won’t provide the same level of validation as our new objects.
88+
89+
For example, the following approach to creating a `Marker` object for a `Scatter` trace is now deprecated.
90+
```
91+
import plotly.graph_objs as go
92+
go.Scatter(
93+
x=[0],
94+
y=[0],
95+
marker=go.Marker(
96+
color='rgb(255,45,15)'
97+
)
98+
)
99+
```
100+
101+
Instead, use the `Marker` object in the `go.scatter` package.
102+
103+
```
104+
import plotly.graph_objs as go
105+
go.Scatter(
106+
x=[0],
107+
y=[0],
108+
marker=go.scatter.Marker(
109+
color='rgb(255,45,15)'
110+
)
111+
)
112+
```
113+
83114
### Property Immutability
84-
In order to support the automatic synchronization a `FigureWidget` object and the front-end view in a notebook, it is necessary for the `FigureWidget` to be aware of all changes to its properties. This is accomplished by presenting the individual properties to the user as immutable objects. For example, the `layout.xaxis.range` property may be assigned using a list, but it will be returned as a tuple.
115+
In order to support the automatic synchronization a `FigureWidget` object and the front-end view in a notebook, it is necessary for the `FigureWidget` to be aware of all changes to its properties. This is accomplished by presenting the individual properties to the user as immutable objects. For example, the `layout.xaxis.range` property may be assigned using a list, but it will be returned as a tuple. Similarly, object arrays (`Figure.data`, `Layout.images`, `Parcoords.dimensions`, etc.) are now represented as tuples of graph objects, not lists.
116+
117+
### Object Array Classes Deprecated
118+
Since graph object arrays are now represented as tuple of graph objects, the following object array classes are deprecated: `go.Data`, `go.Annotations`, and `go.Frames`
85119

86120
### New Figure.data Assignment
87121
There are new restriction on the assignment of traces to the `data` property of a figure. The assigned value must be a list or a tuple of a subset of the traces already present in the figure. Assignment to `data` may be used to reorder and remove existing traces, but it may not currently be used to add new traces. New traces must be added using the `add_trace`, `add_traces`, or `add_*` methods.
@@ -112,5 +146,7 @@ import plotly.graph_objs as go
112146
go.Bar(x=[1])
113147
```
114148

115-
### Removal of undocumented methods
116-
Several undocumented `Figure` methods have been removed. These include: `.to_string`, `.strip_style`, `.get_data`, `.validate` and `.to_dataframe`.
149+
### Removal of undocumented methods and properties
150+
- Several undocumented `Figure` methods have been removed. These include: `.to_string`, `.strip_style`, `.get_data`, `.validate` and `.to_dataframe`.
151+
152+
- Graph objects no longer support the undocumented `_raise` parameter. They are always validated and always raise an exception on validation failures. It is still possible to pass a dict to `plot`/`iplot` with `validate=False` to bypass validation.

0 commit comments

Comments
 (0)