Skip to content

Commit

Permalink
Delay import of plotly until transform method to avoid possibility of…
Browse files Browse the repository at this point in the history
… circular import (#25)
  • Loading branch information
jonmmease authored Jul 28, 2020
1 parent babe53e commit 32f70ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repos/kaleido/py/kaleido/scopes/plotly.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import absolute_import
from kaleido.scopes.base import BaseScope
from _plotly_utils.utils import PlotlyJSONEncoder
from plotly.graph_objects import Figure
import base64


Expand Down Expand Up @@ -66,6 +65,7 @@ def transform(self, figure, format=None, width=None, height=None, scale=None):
:return: image bytes
"""
# TODO: validate args
from plotly.graph_objects import Figure
if isinstance(figure, Figure):
figure = figure.to_dict()

Expand Down

0 comments on commit 32f70ec

Please sign in to comment.