Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bd87fc

Browse files
committed
jon's comments
1 parent e4bdb5f commit 2bd87fc

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

migration-guide.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ f
2828
```
2929

3030
## New Plotly Object Representation
31-
Plotly figures and objects now display a clean representation of the dict-like hierarchy of their structure. They also includes the dict-like `__repr__` method that represents the object as a string
31+
Plotly figures and graph objects have an updated `__repr__` method that displays objects in a pretty printed form that can be copied, pasted, and evaluated to recreate the object.
3232

33-
Eg. `plotly.graph_objs.Scatter()` prints
33+
Eg. `print(f)` returns
3434

3535
```
36-
Scatter({
37-
'type': 'scatter'
36+
FigureWidget({
37+
'data': [{'type': 'scatter', 'uid': '07968b11-7b0a-11e8-ba67-c869cda04ed6', 'x': [1, 2, 3], 'y': [4, 3, 2]}],
38+
'layout': {}
3839
})
3940
```
4041

@@ -56,7 +57,7 @@ It's not valid because it's introducing a new trace during assignment. This trac
5657

5758

5859
## FigureWidget Subplot Example
59-
Let's create a subplot then turn it into a FigureWidget to display in the notebook. Note that `append_trace` is no deprecated. Use `add_trace` or `add_traces` instead.
60+
Let's create a subplot then turn it into a FigureWidget to display in the notebook. Note that `append_trace` is now deprecated. Use `add_trace` or `add_traces` instead.
6061

6162
```
6263
import plotly
@@ -77,7 +78,7 @@ f2.layout.title = 'Age against variables relating to diabetes'
7778
f2
7879
```
7980

80-
## What doesn't work anymore
81+
## Breaking Changes
8182
Run the following examples to see what is now deprecated or not valid:
8283

8384
- Data array properties may not be specified as scalars:
@@ -86,7 +87,7 @@ import plotly.graph_objs as go
8687
go.Bar(x=1)
8788
```
8889

89-
- Undocumented properties are no longer available. These include: `.to_string`, `.strip_style`, `.get_data`, `.validate` and `.to_dataframe`.
90+
- Several undocumented `Figure` methods have been removed. These include: `.to_string`, `.strip_style`, `.get_data`, `.validate` and `.to_dataframe`.
9091

9192
- Object arrays such as `Figure.data` and `Layout.images` are now represented as tuples of graph objects, not lists. Run the following as a sanity check:
9293

0 commit comments

Comments
 (0)