Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offline only cufflinks with no dependency on chart_studio #210

Open
mrmathematica opened this issue Oct 27, 2019 · 2 comments
Open

offline only cufflinks with no dependency on chart_studio #210

mrmathematica opened this issue Oct 27, 2019 · 2 comments

Comments

@mrmathematica
Copy link

This is related to #196

cufflinks 0.17.0 depends on chart_studio, in particular I found two import of chart_studio in the code

https://github.com/santosjorge/cufflinks/search?q=chart_studio&unscoped_q=chart_studio

Since plotly is pure offline now, and cufflinks can go_offline, we don't want the dependency on chart_studio. Actually in our environment we can't install chart_studio. I think this is the reason why it is split out of plotly at the first place.

So this is kind of a feature request: please make the chart_studio dependency conditional. By default it goes into offline mode, and chart_studio code is needed at all.

I tried to patch 0.17.0 myself, replacing cufflinks/init.py line 23 from
from chart_studio.plotly import plot
to
from plotly.offline import plot
and replacing cufflinks/plotlytools.py line 2 from
import chart_studio.plotly as py
to
import plotly.offline as py

it doesn't really work. For example I get

In [1]: import cufflinks as cf

In [2]: cf.go_offline()

In [3]: fig=cf.datagen.histogram(3).figure(kind='histogram ')

In [4]: cf.iplot(fig,online=True)

TypeError Traceback (most recent call last)
in
----> 1 cf.iplot(fig,online=True)

cufflinks/0.17.0/lib/cufflinks/plotlytools.py in iplot(figure, validate, sharing, filename, online, asImage, asUrl, asPlot, dimensions, display_image, **kwargs)
1464 else:
1465 return py.iplot(figure,validate=validate,sharing=sharing,
-> 1466 filename=filename)
1467
1468

TypeError: iplot() got an unexpected keyword argument 'sharing'

I assume this is due to API difference between plotly.offline and chart_studio.plotly. So this request is about to make it all depends on plotly.offline API.

@nicolaskruchten
Copy link
Collaborator

In principle I support this. I think we should do this in v0.18 so that v0.17 is minimally different from v0.16.

eholic added a commit to eholic/cufflinks that referenced this issue Oct 28, 2019
eholic added a commit to eholic/cufflinks that referenced this issue Oct 28, 2019
@nicolaskruchten
Copy link
Collaborator

This is partly addressed in #211, which makes the chart_studio dependency optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants