Plotly.py: Add plot config options to display bundle so they are available to JupyterLab and nteract

Created on 4 Jun 2018  路  6Comments  路  Source: plotly/plotly.py

Hello,

I'm currently working on data that cannot go online. I noticed the other day a button "edit in Chart Studio".
I tried to remove it using this tutorial in your documentation: https://plot.ly/python/configuration-options/
but even with the following code:

config={'showLink': False}
iplot(data, config=config)

the button stays.

Is there a step that I forgot ? I'd really appreciate some help to remove it.

Thank you,

Michael

enhancement

Most helpful comment

i guess this works to avoid online features completely.

config = {'showLink': False, 'displaylogo':False, 'modeBarButtonsToRemove':['sendDataToCloud']}

All 6 comments

Hi there,
Can you confirm that you're using an updated version of the python api and also that you're in offline mode (as mentioned in the doc these are offline configuration options only so with online you can edit the options via the iframe query string)

screen shot 2018-06-04 at 11 54 58 am

I was on 2.5.x, I updated it, and I am now on the same version as you.

It still doesn't work. I tried on JLab and Notebook, they both still have the floppy disk that says "edit in Chart Studio". (By the way, on your screenshot you have it too, I don't know if that's normal).
The floppy disk is clickable.

i guess this works to avoid online features completely.

config = {'showLink': False, 'displaylogo':False, 'modeBarButtonsToRemove':['sendDataToCloud']}

you're right. It works well on Jupyter Notebook, but the same code doesn't work on JLab

Thanks @rysktky , that worked perfectly.

Thanks for digging into this @MichaelHalfon and @rysktky. @rysktky 's solution above is the right way to handle this in offline.iplot in the classic notebook, and in offline.plot from anywhere.

For offline.iplot in JupyterLab things work a bit differently, in this case plotly.py doesn't construct the raw HTML to render the figure, but instead passes the data/layout/frames data structure to the front end in a display bundle, and this is then rendered by the @jupyterlab/plotly-extension extension. At the moment, the config options aren't included in the display bundle and so they aren't available to @jupyterlab/plotly-extension.

To support this, plotly.py will need to add the config options to the display bundle data structure and @jupyterlab/plotly-extension will need to check for the presence of config options before creating the plot. Similarly, to support config options in nteract, the nteract renderer would need to check for these options as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

astrojuanlu picture astrojuanlu  路  4Comments

entron picture entron  路  4Comments

jisaacso picture jisaacso  路  4Comments

vlizanae picture vlizanae  路  4Comments

suciokhan picture suciokhan  路  3Comments