Skip to content

Commit

Permalink
Merge pull request #211 from eholic/offline_support
Browse files Browse the repository at this point in the history
Fix offline dependency with chart_studio
  • Loading branch information
nicolaskruchten authored Oct 29, 2019
2 parents f4a8fba + a19537f commit fec61cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion cufflinks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from .helper import _printer as help
from .plotlytools import *
from plotly.graph_objs import *
from chart_studio.plotly import plot
from .colors import cnames, get_colorscale
from .utils import pp
from .tools import subplots,scatter_matrix,figures,getLayout,getThemes,getTheme
Expand Down
9 changes: 8 additions & 1 deletion cufflinks/plotlytools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pandas as pd
import chart_studio.plotly as py
import time
import copy
# from plotly.graph_objs import *
Expand Down Expand Up @@ -1427,6 +1426,14 @@ def iplot(figure,validate=True,sharing=None,filename='',
auto_open=False

## Exports
if not offline.is_offline() or online:
try:
import chart_studio.plotly as py
except:
raise Exception("chart_studio is required outside of offline mode: " \
"please run " \
"pip install chart_studio" )

if asImage:
if offline.is_offline() and not online:
return offline.py_offline.iplot(figure,validate=validate, filename=filename, show_link=show_link,link_text=link_text,
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
numpy>=1.9.2
pandas>=0.19.2
plotly>=4.1.1
chart-studio>=1.0.0
six>=1.9.0
colorlover>=0.2.1
setuptools>=34.4.1
Expand Down

0 comments on commit fec61cd

Please sign in to comment.