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

Config options for offline plots #399

Closed
icaromedeiros opened this issue Feb 11, 2016 · 9 comments
Closed

Config options for offline plots #399

icaromedeiros opened this issue Feb 11, 2016 · 9 comments
Assignees

Comments

@icaromedeiros
Copy link
Contributor

There is no way to set the 4th parameter in plotly.js when using offline plots as it is hardcoded in _plot_html (https://github.com/plotly/plotly.py/blob/master/plotly/offline/offline.py#L100)

config = {}
config['showLink'] = show_link
config['linkText'] = link_text
jconfig = json.dumps(config)
@ispmarin
Copy link

👍 very relevant for offline plotting.

@yankev yankev self-assigned this Feb 15, 2016
yankev pushed a commit that referenced this issue Feb 15, 2016
You can now enter in a dictionary for all the options you want using
the parameter ‘config’.
@jackparmer jackparmer mentioned this issue Feb 18, 2016
@cudmore
Copy link

cudmore commented Apr 4, 2016

I would like to hide the top plotly toolbar in my plotly offline plots (python). I see this is done with a 'config' option in other versions of the plotly library. How can I do this in plotly offline for python?

I am using this function in offline.py to make my plots:

def plot(figure_or_data,
         show_link=True, link_text='Export to plot.ly',
         validate=True, output_type='file',
         include_plotlyjs=True,
         filename='temp-plot.html',
         auto_open=True):

@mrslezak
Copy link

mrslezak commented Apr 8, 2016

Same issue here - the config options for the modebar available in plotly.js aren't implemented in plotly.py https://plot.ly/javascript/configuration-options/ but I have a workaround here that may help the developers to integrate these options: http://stackoverflow.com/questions/36554705/adding-config-modes-to-plotly-py-offline-modebar

@Rikorose
Copy link

@yankev will this be merged into master?

@gte620v
Copy link

gte620v commented Nov 3, 2016

This seems to have broken offline mode, which is still expecting the old argument signature for _plot_html. See

plot_html, plotdivid, width, height = _plot_html(
figure_or_data, show_link, link_text, validate,
'100%', 525, global_requirejs=True)

Compared to

def _plot_html(figure_or_data, config, validate, default_width,
default_height, global_requirejs):

In this PR, I think line 311 should have been changed to:

    plot_html, plotdivid, width, height = _plot_html(
        figure_or_data, {'showLink':show_link, 'linkText':link_text}, validate,
        '100%', 525, global_requirejs=True)

Without this, even the most basic usage fails.

@vctrd
Copy link

vctrd commented Sep 6, 2017

Hi, I'm trying to use plotly with django and found this help: https://stackoverflow.com/questions/35092571/how-to-create-charts-with-plotly-on-django
But the signature of _plot_html seems to have changed in plotly 2.0.11

Do you know if this has already been solved in a different version?

thanks

@jonmmease
Copy link
Contributor

all config options are now supported in plotly.offline.plot and plotly.offline.iplot. They are not yet available in FigureWidget, see #1074.

@bluprince13
Copy link

Is there a way to hide links when using cufflinks? Cufflinks iplot does not config as a parameter.

@jonmmease
Copy link
Contributor

Hi @bluprince13, I don't know offhand, that would be something to bring up with the cufflinks project (https://github.com/santosjorge/cufflinks)

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

10 participants