Skip to content

Commit 200d534

Browse files
Merge pull request #2455 from grisaitis/issue/markdown-syntax-updating-figures
Fix markdown syntax, typo in docs
2 parents 7e8d8af + f6a29af commit 200d534

File tree

18 files changed

+149
-55
lines changed

18 files changed

+149
-55
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
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+
## [4.7.1] - 2020-05-08
6+
7+
### Fixed
8+
9+
- Fix `AttributeError: module 'plotly.graph_objs' has no attribute 'FigureWidget'` exception on `from plotly.graph_objs import *` when `ipywidgets` is not installed. Error also occurred when importing `plotly.figure_factor`. It is now possible to import `plotly.graph_objs.FigureWidget` when `ipywidgets` is not installed, and an informative `ImportError` exception will be raised in the `FigureWidget` constructor ([#2443](https://github.com/plotly/plotly.py/issues/2443), [#1111](https://github.com/plotly/plotly.py/issues/1111)).
10+
- Fix `TypeError: unhashable type: 'Template'` during `Figure` construction when `plotly.io.templates.default` is set to a `Template` object rather than a string.
11+
12+
513
## [4.7.0] - 2020-05-06
614

715
### Updated

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
## Quickstart
3535

36-
`pip install plotly==4.7.0`
36+
`pip install plotly==4.7.1`
3737

3838
Inside [Jupyter notebook](https://jupyter.org/install) (installable with `pip install "notebook>=5.3" "ipywidgets>=7.2"`):
3939

@@ -82,13 +82,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
8282
plotly.py may be installed using pip...
8383

8484
```
85-
pip install plotly==4.7.0
85+
pip install plotly==4.7.1
8686
```
8787

8888
or conda.
8989

9090
```
91-
conda install -c plotly plotly=4.7.0
91+
conda install -c plotly plotly=4.7.1
9292
```
9393

9494
### Jupyter Notebook Support
@@ -125,10 +125,10 @@ Then run the following commands to install the required JupyterLab extensions (n
125125

126126
```
127127
# Basic JupyterLab renderer support
128-
jupyter labextension install [email protected].0
128+
jupyter labextension install [email protected].1
129129
130130
# OPTIONAL: Jupyter widgets extension for FigureWidget support
131-
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected].0
131+
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected].1
132132
```
133133

134134
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.

doc/python/creating-and-updating-figures.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -613,20 +613,22 @@ There are also `for_each_xaxis()` and `for_each_yaxis()` methods that are analog
613613
### Other Update Methods
614614

615615
Figures created with the plotly.py graphing library also support:
616-
- the `update_layout_images()` method in order to [update background layout images](/python/images/),
617-
- `update_annotations()` in order to [update annotations](/python/text-and-annotations/#multiple-annotations),
618-
- and `update-shapes()` in order to [update shapes](/python/shapes/).
616+
617+
- the `update_layout_images()` method in order to [update background layout images](/python/images/),
618+
- `update_annotations()` in order to [update annotations](/python/text-and-annotations/#multiple-annotations),
619+
- and `update_shapes()` in order to [update shapes](/python/shapes/).
619620

620621
#### Chaining Figure Operations
621622

622623
All of the figure update operations described above are methods that return a reference to the figure being modified. This makes it possible the chain multiple figure modification operations together into a single expression.
623624

624625
Here is an example of a chained expression that creates:
625-
- a faceted scatter plot with OLS trend lines using Plotly Express,
626-
- sets the title font size using `update_layout()`,
627-
- disables vertical grid lines using `update_xaxes()`,
628-
- updates the width and dash pattern of the trend lines using `update_traces()`,
629-
- and then displays the figure using `show()`.
626+
627+
- a faceted scatter plot with OLS trend lines using Plotly Express,
628+
- sets the title font size using `update_layout()`,
629+
- disables vertical grid lines using `update_xaxes()`,
630+
- updates the width and dash pattern of the trend lines using `update_traces()`,
631+
- and then displays the figure using `show()`.
630632

631633
```python
632634
import plotly.express as px

doc/python/getting-started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ Thanks to deep integration with the [orca](https://github.com/plotly/orca) image
4949
plotly.py may be installed using pip...
5050

5151
```
52-
$ pip install plotly==4.7.0
52+
$ pip install plotly==4.7.1
5353
```
5454

5555
or conda.
5656

5757
```
58-
$ conda install -c plotly plotly=4.7.0
58+
$ conda install -c plotly plotly=4.7.1
5959
```
6060

6161
This package contains everything you need to write figures to standalone HTML files.
@@ -134,10 +134,10 @@ Then run the following commands to install the required JupyterLab extensions (n
134134

135135
```
136136
# JupyterLab renderer support
137-
jupyter labextension install [email protected].0
137+
jupyter labextension install [email protected].1
138138
139139
# OPTIONAL: Jupyter widgets extension
140-
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected].0
140+
jupyter labextension install @jupyter-widgets/jupyterlab-manager [email protected].1
141141
```
142142

143143
These packages contain everything you need to run JupyterLab...

packages/javascript/jupyterlab-plotly/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/javascript/jupyterlab-plotly/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-plotly",
3-
"version": "4.7.0",
3+
"version": "4.7.1",
44
"description": "The plotly JupyterLab extension",
55
"author": "The plotly.py team",
66
"license": "MIT",

packages/javascript/plotlywidget/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/javascript/plotlywidget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plotlywidget",
3-
"version": "4.7.0",
3+
"version": "4.7.1",
44
"description": "The plotly JupyterLab extension",
55
"author": "The plotly.py team",
66
"license": "MIT",

packages/python/plotly/codegen/__init__.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,14 @@ def perform_codegen():
269269
optional_figure_widget_import = f"""
270270
if sys.version_info < (3, 7):
271271
try:
272-
import ipywidgets
273-
from distutils.version import LooseVersion
274-
if LooseVersion(ipywidgets.__version__) >= LooseVersion('7.0.0'):
272+
import ipywidgets as _ipywidgets
273+
from distutils.version import LooseVersion as _LooseVersion
274+
if _LooseVersion(_ipywidgets.__version__) >= _LooseVersion("7.0.0"):
275275
from ..graph_objs._figurewidget import FigureWidget
276-
del LooseVersion
277-
del ipywidgets
278-
except ImportError:
279-
pass
276+
else:
277+
raise ImportError()
278+
except Exception:
279+
from ..missing_ipywidgets import FigureWidget
280280
else:
281281
__all__.append("FigureWidget")
282282
orig_getattr = __getattr__
@@ -285,12 +285,17 @@ def __getattr__(import_name):
285285
try:
286286
import ipywidgets
287287
from distutils.version import LooseVersion
288-
if LooseVersion(ipywidgets.__version__) >= LooseVersion('7.0.0'):
288+
289+
if LooseVersion(ipywidgets.__version__) >= LooseVersion("7.0.0"):
289290
from ..graph_objs._figurewidget import FigureWidget
291+
290292
return FigureWidget
291-
except ImportError:
292-
pass
293-
293+
else:
294+
raise ImportError()
295+
except Exception:
296+
from ..missing_ipywidgets import FigureWidget
297+
return FigureWidget
298+
294299
return orig_getattr(import_name)
295300
"""
296301
# ### __all__ ###

packages/python/plotly/plotly/_widget_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# for automated dev builds
33
#
44
# It is edited by hand prior to official releases
5-
__frontend_version__ = "4.7.0"
5+
__frontend_version__ = "4.7.1"

0 commit comments

Comments
 (0)