defining tools in the gridplot

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

An add-on question: how to automatically scale a gridplot to fill out as much screen space as possible, but not exceeding it (i.e. do not result in scrollbars appearing at the browser).

···

On Tuesday, September 27, 2016 at 10:29:25 AM UTC+2, Artur Scholz wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

There is currently no way to save a “whole” gridplot, only individual plots.

Thanks,

Bryan

···

On Sep 27, 2016, at 04:29, Artur Scholz [email protected] wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a30e1ac2-61da-4219-a9d4-f6ed1f3ec530%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan,

First of all: thanks for taking the time to answer the questions on this forum.

By your estimation, how difficult would it be to e.g. introduce a ‘Save Gridplot’ Tool, which would save the whole layout to a single image? This is a feature that I’d be very pleased to see in Bokeh, to the extent that I would be happy to attempt a PR to introduce it. But my Coffee/JavaScript experience is… limited, to say the least. If you think that it would be achievable for someone with a little coding/development experience, I’d consider having a crack at it.

Thanks,

Toby

···

On Tuesday, September 27, 2016 at 3:27:00 PM UTC+2, Bryan Van de ven wrote:

There is currently no way to save a “whole” gridplot, only individual plots.

Thanks,

Bryan

On Sep 27, 2016, at 04:29, Artur Scholz [email protected] wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a30e1ac2-61da-4219-a9d4-f6ed1f3ec530%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

This is unfortunately a very large and very difficult feature, which is why it's still open after nearly three years, despite obvious interest in it from many people:

  Headless static (svg, png) image generation · Issue #538 · bokeh/bokeh · GitHub

Additionally all the possible implementation avenues have fairly serious tradeoffs or limitations:

* custom (e.g. Qt or cairo-based) backend -- *huge* amount of work, no one is available to work on this
* cavas-cairo + node -- BokehJS large and complicated, doesn't run in node yet, doesn't solve "unified gridplot" case
* MPL as a backend - depends on MPL Enhancement Proposal 25 which has seen no movement in two years
* headless chrome -- new, huge, hard to build, will have to help package and distribute, currently linux only

Currently, our best bet is to try and leverage headless chrome, and to possibly try and help build and package it for other platforms as a conda package (eventually). Sarah Bird has done some promising exploratory work in this area, but she is over-committed with work other right now. I can't speculate when she will be able to devote serious time to this. That said, it's possible that she could provide help and guidance to someone else who actually has the bandwidth to do work that moves the needle on this. If you think that might be you, I'd suggest pinging @birdsarah on the issue linked above.

Thanks,

Bryan

···

On Nov 25, 2016, at 8:18 AM, Toby Hodges <[email protected]> wrote:

Hi Bryan,

First of all: thanks for taking the time to answer the questions on this forum.

By your estimation, how difficult would it be to e.g. introduce a 'Save Gridplot' Tool, which would save the whole layout to a single image? This is a feature that I'd be very pleased to see in Bokeh, to the extent that I would be happy to attempt a PR to introduce it. But my Coffee/JavaScript experience is... limited, to say the least. If you think that it would be achievable for someone with a little coding/development experience, I'd consider having a crack at it.

Thanks,

Toby

On Tuesday, September 27, 2016 at 3:27:00 PM UTC+2, Bryan Van de ven wrote:
There is currently no way to save a "whole" gridplot, only individual plots.

Thanks,

Bryan

On Sep 27, 2016, at 04:29, Artur Scholz <[email protected]> wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the 'save' tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
           merge_tools=True, responsive=True,
           toolbar_options=dict(logo=None,
                                tools='xwheel_zoom,xpan, save'))

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a30e1ac2-61da-4219-a9d4-f6ed1f3ec530%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c4d5618d-5d67-4ea6-b257-e96a858d7ac3%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan,

Thanks for the information. I wasn’t aware that this is so closely related to the headless vector graphic generation issue, which is probably an indication of my lack of understanding of the problem and possible solutions, and therefore also disqualifies me from being an effective contributor in this case! Regardless, I’ll continue to use Bokeh and contribute where I can.

All the best,

Toby

···

On Sunday, November 27, 2016 at 9:27:39 PM UTC+1, Bryan Van de ven wrote:

This is unfortunately a very large and very difficult feature, which is why it’s still open after nearly three years, despite obvious interest in it from many people:

    [https://github.com/bokeh/bokeh/issues/538](https://github.com/bokeh/bokeh/issues/538)

Additionally all the possible implementation avenues have fairly serious tradeoffs or limitations:

  • custom (e.g. Qt or cairo-based) backend – huge amount of work, no one is available to work on this

  • cavas-cairo + node – BokehJS large and complicated, doesn’t run in node yet, doesn’t solve “unified gridplot” case

  • MPL as a backend - depends on MPL Enhancement Proposal 25 which has seen no movement in two years

  • headless chrome – new, huge, hard to build, will have to help package and distribute, currently linux only

Currently, our best bet is to try and leverage headless chrome, and to possibly try and help build and package it for other platforms as a conda package (eventually). Sarah Bird has done some promising exploratory work in this area, but she is over-committed with work other right now. I can’t speculate when she will be able to devote serious time to this. That said, it’s possible that she could provide help and guidance to someone else who actually has the bandwidth to do work that moves the needle on this. If you think that might be you, I’d suggest pinging @birdsarah on the issue linked above.

Thanks,

Bryan

On Nov 25, 2016, at 8:18 AM, Toby Hodges [email protected] wrote:

Hi Bryan,

First of all: thanks for taking the time to answer the questions on this forum.

By your estimation, how difficult would it be to e.g. introduce a ‘Save Gridplot’ Tool, which would save the whole layout to a single image? This is a feature that I’d be very pleased to see in Bokeh, to the extent that I would be happy to attempt a PR to introduce it. But my Coffee/JavaScript experience is… limited, to say the least. If you think that it would be achievable for someone with a little coding/development experience, I’d consider having a crack at it.

Thanks,

Toby

On Tuesday, September 27, 2016 at 3:27:00 PM UTC+2, Bryan Van de ven wrote:

There is currently no way to save a “whole” gridplot, only individual plots.

Thanks,

Bryan

On Sep 27, 2016, at 04:29, Artur Scholz [email protected] wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

This fails and produces error:

Viewable object got multiple values for keyword argument ‘tools’

Whats wrong?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a30e1ac2-61da-4219-a9d4-f6ed1f3ec530%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c4d5618d-5d67-4ea6-b257-e96a858d7ac3%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

···

On Mon, Nov 28, 2016 at 11:10 AM, Toby Hodges [email protected] wrote:

Hi Bryan,

Thanks for the information. I wasn’t aware that this is so closely related to the headless vector graphic generation issue, which is probably an indication of my lack of understanding of the problem and possible solutions, and therefore also disqualifies me from being an effective contributor in this case! Regardless, I’ll continue to use Bokeh and contribute where I can.

there is one option that Bryan didn’t explore, which is having in-canvas grid layout. Currently grid plot isn’t really a plot but a HTML layout of plots (canvases), so it should be really called grid layout. This is why it can’t be saved out of the box. We can do arbitrary layouts in HTML, but only one very specific type of layout within canvas, i.e. a central area with four side panels. If in-canvas layout was extended to (at least some degree) support what HTML layout supports, then we could fit a grid plot in one canvas and be able to save it as one PNG file, as we currently do with individual plots. Note that this is major piece of work, perhaps even more involved than the previously listed.

Mateusz

All the best,

Toby

On Sunday, November 27, 2016 at 9:27:39 PM UTC+1, Bryan Van de ven wrote:

This is unfortunately a very large and very difficult feature, which is why it’s still open after nearly three years, despite obvious interest in it from many people:

    [https://github.com/bokeh/bokeh/issues/538](https://github.com/bokeh/bokeh/issues/538)

Additionally all the possible implementation avenues have fairly serious tradeoffs or limitations:

  • custom (e.g. Qt or cairo-based) backend – huge amount of work, no one is available to work on this

  • cavas-cairo + node – BokehJS large and complicated, doesn’t run in node yet, doesn’t solve “unified gridplot” case

  • MPL as a backend - depends on MPL Enhancement Proposal 25 which has seen no movement in two years

  • headless chrome – new, huge, hard to build, will have to help package and distribute, currently linux only

Currently, our best bet is to try and leverage headless chrome, and to possibly try and help build and package it for other platforms as a conda package (eventually). Sarah Bird has done some promising exploratory work in this area, but she is over-committed with work other right now. I can’t speculate when she will be able to devote serious time to this. That said, it’s possible that she could provide help and guidance to someone else who actually has the bandwidth to do work that moves the needle on this. If you think that might be you, I’d suggest pinging @birdsarah on the issue linked above.

Thanks,

Bryan

On Nov 25, 2016, at 8:18 AM, Toby Hodges [email protected] wrote:

Hi Bryan,

First of all: thanks for taking the time to answer the questions on this forum.

By your estimation, how difficult would it be to e.g. introduce a ‘Save Gridplot’ Tool, which would save the whole layout to a single image? This is a feature that I’d be very pleased to see in Bokeh, to the extent that I would be happy to attempt a PR to introduce it. But my Coffee/JavaScript experience is… limited, to say the least. If you think that it would be achievable for someone with a little coding/development experience, I’d consider having a crack at it.

Thanks,

Toby

On Tuesday, September 27, 2016 at 3:27:00 PM UTC+2, Bryan Van de ven wrote:

There is currently no way to save a “whole” gridplot, only individual plots.

Thanks,

Bryan

On Sep 27, 2016, at 04:29, Artur Scholz [email protected] wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

This fails and produces error:

Viewable object got multiple values for keyword argument ‘tools’

Whats wrong?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a30e1ac2-61da-4219-a9d4-f6ed1f3ec530%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c4d5618d-5d67-4ea6-b257-e96a858d7ac3%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/827bfc45-14a6-400e-a4da-6203c67ed855%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I have the same issue. Is this a bug?

···

On Tuesday, September 27, 2016 at 12:29:25 PM UTC+4, Artur Scholz wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

Hi,

I'm not sure "bug" is the right term. It's a fundamental limitation of the fact that:

* bokeh grid plots are a collection of individual HTML canvases
* the toolbar save tool can only save individual canvases separately.

There's probably nothing that can ever be done to improve the toolbar save tool, short of providing an option for grid plots on a single canvas. That's not impossible, but it is a very large undertaking, and not a priority right now.

HOWEVER, the recent PR for headless static generation of PNG output uses a different approach, and can capture an entire grid plot as a PNG. It is currently only in "dev builds" but will be in the next release. For information on how to try it out now, see my other ML post from today about "0.12.6dev".

There will also be an SVG export option in the next release, but it will also only be able to output each canvas as a separate SVG.

Thanks,

Bryan

···

On May 16, 2017, at 03:51, Nikoloz Mamisashvili <[email protected]> wrote:

I have the same issue. Is this a bug?

On Tuesday, September 27, 2016 at 12:29:25 PM UTC+4, Artur Scholz wrote:
When using gridplots and merging of the toolbars from individual plots into one single one the 'save' tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
           merge_tools=True, responsive=True,
           toolbar_options=dict(logo=None,
                                tools='xwheel_zoom,xpan, save'))

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ca38f379-b94e-40c5-8d10-1128cba01385%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Remove tools attribute in gridplot, define them in plot tools attribute instead. Then enable merge_tools (merge_tools=True) in gridplot.
That will meet your expectation with no bokeh exception.

from bokeh.models import HoverTool, ColumnDataSource, SaveTool, ResetTool, PanTool, WheelZoomTool
plots =
for i in range(4):
hover = HoverTool(tooltips=[(‘index’, ‘$index’),(‘value’, ‘@y’)])

p = figure(title=‘TITLE’, tools=[hover, PanTool(), WheelZoomTool(), ResetTool(), SaveTool()])

plots.append(p)
gp = gridplot(plots, merge_tools=True, ncols=2, sizing_mode=‘scale_width’, toolbar_options=dict(logo=None))

``

···

On Tuesday, September 27, 2016 at 4:29:25 PM UTC+8, Artur Scholz wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?

See in this post how to save multiple plots as one image.

···

On Tuesday, March 20, 2018 at 5:39:26 AM UTC+1, Cooper Yang wrote:

Remove tools attribute in gridplot, define them in plot tools attribute instead. Then enable merge_tools (merge_tools=True) in gridplot.
That will meet your expectation with no bokeh exception.

from bokeh.models import HoverTool, ColumnDataSource, SaveTool, ResetTool, PanTool, WheelZoomTool
plots =
for i in range(4):
hover = HoverTool(tooltips=[(‘index’, ‘$index’),(‘value’, ‘@y’)])

p = figure(title=‘TITLE’, tools=[hover, PanTool(), WheelZoomTool(), ResetTool(), SaveTool()])

plots.append(p)
gp = gridplot(plots, merge_tools=True, ncols=2, sizing_mode=‘scale_width’, toolbar_options=dict(logo=None))

``

On Tuesday, September 27, 2016 at 4:29:25 PM UTC+8, Artur Scholz wrote:

When using gridplots and merging of the toolbars from individual plots into one single one the ‘save’ tool in fact only produces snapshots of each plot individually.

Hence I want to define the tools in the gridplot itself, in order to make a snapshot of the entire arrangement.

What I try is:

plot = gridplot([p1, p2], ncols=1,
merge_tools=True, responsive=True,
toolbar_options=dict(logo=None,
tools=‘xwheel_zoom,xpan, save’))

``

This fails and produces error:

Viewable object got multiple values for keyword argument 'tools'

Whats wrong?