Skip to content

Commit fb271a6

Browse files
Merge pull request #99 from plotly/migration
migration
2 parents 3c98828 + 57f1989 commit fb271a6

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

python/v4-migration.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,34 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.3
23+
version: 3.6.7
2424
plotly:
25-
description: Version 4 migration guide
26-
v4upgrade: true
25+
description: Migration guide for upgrading from version 3 to version 4
2726
display_as: file_settings
2827
has_thumbnail: true
2928
language: python
29+
layout: user-guide
3030
name: Version 4 Migration Guide
31+
order: 1
3132
page_type: example_index
32-
layout: user-guide
3333
permalink: python/v4-migration/
3434
thumbnail: thumbnail/v4-migration.png
3535
title: Version 4 migration guide | plotly
36-
order: 1
36+
v4upgrade: true
3737
---
3838

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+
3947
<!-- #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
4149

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.**
4451

4552
To migrate version 3 "online" functionality, first install the `chart-studio` package using pip...
4653

@@ -74,6 +81,15 @@ Similarly,
7481
- Replace **`plotly.widgets`** with **`chart_studio.widgets`**
7582
<!-- #endregion -->
7683

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+
7793
### New default theme
7894
An updated `"plotly"` theme has been enabled by default in version 4.
7995

@@ -277,11 +293,6 @@ The legacy online-only `GraphWidget` class has been removed. Please use the `pl
277293

278294
### Recommended style updates
279295

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-
283296
#### Import from `graph_objects` instead of `graph_objs`
284297
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.
285298

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

Comments
 (0)