Skip to content

Commit

Permalink
Merge pull request #562 from GavinHuttley/develop
Browse files Browse the repository at this point in the history
BUG: allow using environment variable PLOTLY_RENDERER="sphinx_gallery"
  • Loading branch information
GavinHuttley committed Mar 7, 2020
2 parents 576f83d + de22491 commit 66c2737
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cogent3/draw/drawable.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ def _show_(cls, renderer=None, **kwargs):
"""
from plotly.io import show

if renderer == "sphinx_gallery":
_customise_sphinx_gallery_renderer()

if renderer is None and PLOTLY_RENDERER is None:
renderer = "notebook_connected+plotly_mimetype"
elif renderer is None:
renderer = PLOTLY_RENDERER

if renderer == "sphinx_gallery":
_customise_sphinx_gallery_renderer()

kwargs["renderer"] = renderer
drawable = getattr(cls, "drawable", None) or cls
fig = getattr(drawable, "figure", None)
Expand Down

0 comments on commit 66c2737

Please sign in to comment.