You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/v4-migration.md
+24-13Lines changed: 24 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -20,27 +20,34 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.3
23
+
version: 3.6.7
24
24
plotly:
25
-
description: Version 4 migration guide
26
-
v4upgrade: true
25
+
description: Migration guide for upgrading from version 3 to version 4
27
26
display_as: file_settings
28
27
has_thumbnail: true
29
28
language: python
29
+
layout: user-guide
30
30
name: Version 4 Migration Guide
31
+
order: 1
31
32
page_type: example_index
32
-
layout: user-guide
33
33
permalink: python/v4-migration/
34
34
thumbnail: thumbnail/v4-migration.png
35
35
title: Version 4 migration guide | plotly
36
-
order: 1
36
+
v4upgrade: true
37
37
---
38
38
39
+
### Upgrading to Version 4
40
+
41
+
Upgrading to version 4 of `plotly` is a matter of following the instructions in the [Getting Started](/python/getting-started/) guide and reinstalling the packages, subject to the notices below.
42
+
43
+
### Getting Help
44
+
45
+
If you encounter issues in upgrading from version 3 to version 4, please reach out in our [Community Forum](https://community.plot.ly/c/api/python) or if you've found an issue or regression in version 4, please report a [Github Issue](https://github.com/plotly/plotly.py/issues/new)
46
+
39
47
<!-- #region -->
40
-
This section contains guidance for migrating from plotly.py version 3 to version 4.
48
+
### Online features (`plotly.plotly`) moved to `chart-studio` package
41
49
42
-
### Online features moved to chart-studio package.
43
-
Prior versions of plotly.py contained functionality for creating figures in both "online" and "offline" modes. In "online" mode figures were uploaded to the Chart Studio cloud (or on-premise) service, whereas in "offline" mode figures were rendered locally. In version 4, all "online" functionality has been removed from the main `plotly` distribution package and moved to the new `chart-studio` distribution package.
50
+
Prior versions of plotly.py contained functionality for creating figures in both "online" and "offline" modes. In "online" mode figures were uploaded to the Chart Studio cloud (or on-premise) service, whereas in "offline" mode figures were rendered locally. **Version 4 of `plotly` is "offline"-only: all "online" functionality has been removed from the main `plotly` distribution package and moved to the new `chart-studio` distribution package.**
44
51
45
52
To migrate version 3 "online" functionality, first install the `chart-studio` package using pip...
46
53
@@ -74,6 +81,15 @@ Similarly,
74
81
- Replace **`plotly.widgets`** with **`chart_studio.widgets`**
75
82
<!-- #endregion -->
76
83
84
+
<!-- #region -->
85
+
### Offline features (`plotly.offline`) replaced by Renderers framework & HTML export
86
+
87
+
Version 4 introduces a new renderers framework that is a generalization of version 3's `plotly.offline.init_notebook_mode` and `plotly.offline.iplot` functions for displaying figures. *This is a non-breaking change*: the `plotly.offline.iplot` function is still available and has been reimplemented on top of the renderers framework, so no changes are required when porting to version 4. Going forward, we recommend using the renderers framework directly. See [Displaying plotly figures](../renderers) for more information.
88
+
89
+
90
+
In version 3, the `plotly.offline.plot` function was used to export figures to HTML files. In version 4, this function has been reimplemented on top of the new `to_html` and `write_html` functions from the `plotly.io` module. These functions have a slightly more consistent API (see docstrings for details), and going forward we recommend using them directly when performing HTML export. When working with a graph object figure, these functions are also available as the `.to_html` and `.write_html` figure methods.
91
+
<!-- #endregion -->
92
+
77
93
### New default theme
78
94
An updated `"plotly"` theme has been enabled by default in version 4.
79
95
@@ -277,11 +293,6 @@ The legacy online-only `GraphWidget` class has been removed. Please use the `pl
277
293
278
294
### Recommended style updates
279
295
280
-
#### Renderers framework
281
-
Version 4 introduces a new renderers framework that is a generalization of the `plotly.offline.init_notebook_mode` and `plotly.offline.iplot` functions for displaying figures. The `plotly.offline.iplot` function is still available and has been reimplemented on top of the renderers framework, so no changes are required when porting to version 4. Going forward, we recommend using the renderers framework directly. See [Displaying plotly figures](../renderers) for more information.
282
-
283
296
#### Import from `graph_objects` instead of `graph_objs`
284
297
The legacy `plotly.graph_objs` package has been aliased as `plotly.graph_objects` because the latter is much easier to communicate verbally. The `plotly.graph_objs` package is still available for backward compatibility.
285
298
286
-
#### HTML export
287
-
In version 3, the `plotly.offline.plot` function was used to export figures to HTML files. In version 4, this function has been reimplemented on top of the new `to_html` and `write_html` functions from the `plotly.io` module. These functions have a slightly more consistent API (see docstrings for details), and going forward we recommend using them directly when performing HTML export. When working with a graph object figure, these functions are also available as the `.to_html` and `.write_html` figure methods.
0 commit comments