Skip to content

offline only cufflinks with no dependency on chart_studio #210

@mrmathematica

Description

@mrmathematica

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions