touch or hover callback, animation

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
2. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don't hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a "ToolEvents" object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

···

On Dec 26, 2014, at 7:21 AM, Jonathan Shore <[email protected]> wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
2. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

--
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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks, that offers some hints (re: getting a click event). I can see in the tap_tool.coffee code that:

for r in @mget(‘renderers’)
ds = r.get(‘data_source’)
sm = ds.get(‘selection_manager’)
sm.select(@, @plot_view.renderers[r.id], geometry, true, append)

So the data source selection is adjusted on click or region drag. I am not clear on how can capture changes in the selection on the server side (python). Supposing I have an instance of the main plot in my app as:

class Test(HBox):

mainplot = Instance(Plot)

def setup_events(self):

self.plot..on_change (…)

How do I capture the event posted to ToolEvents & get a callback?

Thanks

Jonathan

···

On Dec 26, 2014, at 11:48 AM, Bryan Van de Ven [email protected] wrote:

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don’t hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a “ToolEvents” object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

On Dec 26, 2014, at 7:21 AM, Jonathan Shore [email protected] wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

  1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
  2. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan


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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.
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/8205ECB4-B7AB-48FE-8B22-902DF1340D6F%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Jonathan,

You want to trigger on a change to the "selected" attribute of a ColumnDataSource(s). So something like:

  for source in my_sources:
            source.on_change('selected', handler_object, 'callback_name')

would set up

  handler_object.callback_name(self, obj, attrname, old, new)

as the callback to call whenever the "selected" attribute changes on any of the data sources in "my_sources".

BTW "app creation" is still an area where we are looking to improve and make things more streamlined, so any feedback you have about what could be made better or simpler would be very valuable.

Thanks,

Bryan

···

On Dec 26, 2014, at 12:03 PM, Jonathan Shore <[email protected]> wrote:

Thanks, that offers some hints (re: getting a click event). I can see in the tap_tool.coffee code that:

for r in @mget('renderers’)
ds = r.get(‘data_source'
)

sm = ds.get(‘selection_manager’
)

sm.select(@, @plot_view.renderers[r.id], geometry, true, append)

So the data source selection is adjusted on click or region drag. I am not clear on how can capture changes in the selection on the server side (python). Supposing I have an instance of the main plot in my app as:

class Test(HBox):
    …
    mainplot = Instance(Plot)
    …
    def setup_events(self):
        …
        self.plot.<something>.on_change (…)

How do I capture the event posted to ToolEvents & get a callback?

Thanks
Jonathan

On Dec 26, 2014, at 11:48 AM, Bryan Van de Ven <[email protected]> wrote:

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don't hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a "ToolEvents" object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

On Dec 26, 2014, at 7:21 AM, Jonathan Shore <[email protected]> wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
2. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

--
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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.
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/8205ECB4-B7AB-48FE-8B22-902DF1340D6F%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/578E637A-A07B-48F3-8366-034CC50FEE3D%40gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I’m wondering if there’s been further discussion or an issue on this (apologies if I’ve missed it).

I’m keen for more custom interactions on hover, and am wondering if there’s anything I can do to help.

I think that support was being added for custom html in the hover tooltip…also can’t find that right now.

···

On Fri, Dec 26, 2014 at 2:24 PM, Bryan Van de Ven [email protected] wrote:

Hi Jonathan,

You want to trigger on a change to the “selected” attribute of a ColumnDataSource(s). So something like:

    for source in my_sources:

        source.on_change('selected', handler_object, 'callback_name')

would set up

    handler_object.callback_name(self, obj, attrname, old, new)

as the callback to call whenever the “selected” attribute changes on any of the data sources in “my_sources”.

BTW “app creation” is still an area where we are looking to improve and make things more streamlined, so any feedback you have about what could be made better or simpler would be very valuable.

Thanks,

Bryan

On Dec 26, 2014, at 12:03 PM, Jonathan Shore [email protected] wrote:

Thanks, that offers some hints (re: getting a click event). I can see in the tap_tool.coffee code that:

for r in @mget('renderers’)

ds = r.get(‘data_source’

)

sm = ds.get(‘selection_manager’

)

sm.select(@, @plot_view.renderers[r.id], geometry, true, append)

So the data source selection is adjusted on click or region drag. I am not clear on how can capture changes in the selection on the server side (python). Supposing I have an instance of the main plot in my app as:

class Test(HBox):

mainplot = Instance(Plot)
def setup_events(self):
    self.plot.<something>.on_change (…)

How do I capture the event posted to ToolEvents & get a callback?

Thanks

Jonathan

On Dec 26, 2014, at 11:48 AM, Bryan Van de Ven [email protected] wrote:

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don’t hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a “ToolEvents” object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

On Dec 26, 2014, at 7:21 AM, Jonathan Shore [email protected] wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

  1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
  1. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.

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/8205ECB4-B7AB-48FE-8B22-902DF1340D6F%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/578E637A-A07B-48F3-8366-034CC50FEE3D%40gmail.com.

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/2448FA0C-D1A5-4242-A72A-39088400213E%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

···

On Mon, Feb 9, 2015 at 6:59 PM, Sarah Bird [email protected] wrote:

I’m wondering if there’s been further discussion or an issue on this (apologies if I’ve missed it).

I’m keen for more custom interactions on hover, and am wondering if there’s anything I can do to help.

I think that support was being added for custom html in the hover tooltip…also can’t find that right now.

Not yet, I’m currently working on this (for 0.8).

Mateusz

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/CA%2BEr%2BdS7DhrrPS1r68X_HkiEv26popKsUGFjzt-kyncT%2BkeyqQ%40mail.gmail.com.

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

On Fri, Dec 26, 2014 at 2:24 PM, Bryan Van de Ven [email protected] wrote:

Hi Jonathan,

You want to trigger on a change to the “selected” attribute of a ColumnDataSource(s). So something like:

    for source in my_sources:

        source.on_change('selected', handler_object, 'callback_name')

would set up

    handler_object.callback_name(self, obj, attrname, old, new)

as the callback to call whenever the “selected” attribute changes on any of the data sources in “my_sources”.

BTW “app creation” is still an area where we are looking to improve and make things more streamlined, so any feedback you have about what could be made better or simpler would be very valuable.

Thanks,

Bryan

On Dec 26, 2014, at 12:03 PM, Jonathan Shore [email protected] wrote:

Thanks, that offers some hints (re: getting a click event). I can see in the tap_tool.coffee code that:

for r in @mget('renderers’)

ds = r.get(‘data_source’

)

sm = ds.get(‘selection_manager’

)

sm.select(@, @plot_view.renderers[r.id], geometry, true, append)

So the data source selection is adjusted on click or region drag. I am not clear on how can capture changes in the selection on the server side (python). Supposing I have an instance of the main plot in my app as:

class Test(HBox):

mainplot = Instance(Plot)
def setup_events(self):
    self.plot.<something>.on_change (…)

How do I capture the event posted to ToolEvents & get a callback?

Thanks

Jonathan

On Dec 26, 2014, at 11:48 AM, Bryan Van de Ven [email protected] wrote:

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don’t hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a “ToolEvents” object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

On Dec 26, 2014, at 7:21 AM, Jonathan Shore [email protected] wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

  1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
  1. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.

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/8205ECB4-B7AB-48FE-8B22-902DF1340D6F%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/578E637A-A07B-48F3-8366-034CC50FEE3D%40gmail.com.

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/2448FA0C-D1A5-4242-A72A-39088400213E%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi,

I’m wondering if there’s been further discussion or an issue on this (apologies if I’ve missed it).

I’m keen for more custom interactions on hover, and am wondering if there’s anything I can do to help.

I think that support was being added for custom html in the hover tooltip…also can’t find that right now.

Not yet, I’m currently working on this (for 0.8).

Awesome - looking forward to it!

···

On Monday, February 9, 2015 at 10:24:22 AM UTC-8, mateusz.paprocki wrote:

On Mon, Feb 9, 2015 at 6:59 PM, Sarah Bird [email protected] wrote:

Mateusz

On Fri, Dec 26, 2014 at 2:24 PM, Bryan Van de Ven [email protected] wrote:

On Dec 26, 2014, at 12:03 PM, Jonathan Shore [email protected] wrote:

Thanks, that offers some hints (re: getting a click event). I can see in the tap_tool.coffee code that:

for r in @mget('renderers’)

ds = r.get(‘data_source’

)

sm = ds.get(‘selection_manager’

)

sm.select(@, @plot_view.renderers[r.id], geometry, true, append)

So the data source selection is adjusted on click or region drag. I am not clear on how can capture changes in the selection on the server side (python). Supposing I have an instance of the main plot in my app as:

class Test(HBox):

mainplot = Instance(Plot)
def setup_events(self):
    self.plot.<something>.on_change (…)

How do I capture the event posted to ToolEvents & get a callback?

Thanks

Jonathan

On Dec 26, 2014, at 11:48 AM, Bryan Van de Ven [email protected]m.io wrote:

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don’t hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a “ToolEvents” object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

On Dec 26, 2014, at 7:21 AM, Jonathan Shore [email protected] wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

  1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
  1. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.

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/8205ECB4-B7AB-48FE-8B22-902DF1340D6F%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/578E637A-A07B-48F3-8366-034CC50FEE3D%40gmail.com.

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].

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

Hi Jonathan,

You want to trigger on a change to the “selected” attribute of a ColumnDataSource(s). So something like:

    for source in my_sources:

        source.on_change('selected', handler_object, 'callback_name')

would set up

    handler_object.callback_name(self, obj, attrname, old, new)

as the callback to call whenever the “selected” attribute changes on any of the data sources in “my_sources”.

BTW “app creation” is still an area where we are looking to improve and make things more streamlined, so any feedback you have about what could be made better or simpler would be very valuable.

Thanks,

Bryan
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2448FA0C-D1A5-4242-A72A-39088400213E%40continuum.io.

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/CA%2BEr%2BdS7DhrrPS1r68X_HkiEv26popKsUGFjzt-kyncT%2BkeyqQ%40mail.gmail.com.

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

Hi all,

I am looking for a similar functionality, but with the taptool and with multiple plots per document (using embedded div’s). An example document would have multiple line glyphs per plot and multiple plots per outfile. When the user clicks on a point on one of the glyphs (ie a circle on a line), the callback needs to know which glyph was hit, and therefore the correct dataset is used for indexing.

The examples are great and hint toward this ability but I have not found the correct incantation to reference the glyph in the ‘selected’ indices, and therefore support multiple plots.

Thanks for your work!

Rusty

···

On Monday, February 9, 2015 at 6:44:47 PM UTC, Sarah Bird wrote:

On Monday, February 9, 2015 at 10:24:22 AM UTC-8, mateusz.paprocki wrote:

Hi,

On Mon, Feb 9, 2015 at 6:59 PM, Sarah Bird [email protected] wrote:

I’m wondering if there’s been further discussion or an issue on this (apologies if I’ve missed it).

I’m keen for more custom interactions on hover, and am wondering if there’s anything I can do to help.

I think that support was being added for custom html in the hover tooltip…also can’t find that right now.

Not yet, I’m currently working on this (for 0.8).

Awesome - looking forward to it!

Mateusz

On Fri, Dec 26, 2014 at 2:24 PM, Bryan Van de Ven [email protected] wrote:

On Dec 26, 2014, at 12:03 PM, Jonathan Shore [email protected] wrote:

Thanks, that offers some hints (re: getting a click event). I can see in the tap_tool.coffee code that:

for r in @mget('renderers’)

ds = r.get(‘data_source’

)

sm = ds.get(‘selection_manager’

)

sm.select(@, @plot_view.renderers[r.id], geometry, true, append)

So the data source selection is adjusted on click or region drag. I am not clear on how can capture changes in the selection on the server side (python). Supposing I have an instance of the main plot in my app as:

class Test(HBox):

mainplot = Instance(Plot)
def setup_events(self):
    self.plot.<something>.on_change (…)

How do I capture the event posted to ToolEvents & get a callback?

Thanks

Jonathan

On Dec 26, 2014, at 11:48 AM, Bryan Van de Ven [email protected] wrote:

Hi Jonathan,

Right now selection events get stored on the server, so if an immediate solution is to rely on callbacks when a glyph is clicked, then this is probably doable today. It should also be possible to get arbitrary tap/clicks, even if they don’t hit any glyph. Selection indices get stored on the data sources, and geometries get stored on a “ToolEvents” object that Plots have. Click events should not interfere with panning you can check out this example to see them together: https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/tap.py

Regarding a callback that is (conceptually) on every mouse move, I think at one point on master, we did have all mouse and hit events resulting from hovers getting stored. As you mention, it needs some kind of throttling to be practical. In the short term, we simply stopped hover type tools from storing this information on the server. If you are interested in working up a PR that would enable some kind of hover callback in a practical way, it would certainly be seriously considered. Maybe open a GH issue to start a discussion of a proposed implementation?

Thanks!

Bryan

On Dec 26, 2014, at 7:21 AM, Jonathan Shore [email protected] wrote:

I am putting together an application where have a timeseries in 1 pane and 2 auxilliary views in other panes (a distribution and a table). I would like to be able to get a callback when i mouse-over a point on the timeseries so that I can adjust the corresponding linked data panes. It occurs to me that there are 2 ways this could be handled (though not aware of a facility to do either right now):

  1. on mouse-over, callback to server-side, which refreshes aux data panes (flexibility, but latency)
  1. predetermined animation of the aux data panes pre-loaded. frame shown is keyed off of an internally linked mouse-over event on the timeseries

I assume #2 is not feasible short of writing my own coffeescript (I want to stay within the features as provided on the server side)? I’m guessing that #1 is the easier of the 2 to do, though not aware of any server-side callback facility for mouse-over? Assuming no server-side callback exists for mouse-over (preempting the hover facility), how hard would it be to add this and would the community be interested in this contribution?

To make this perform well and not overwhelm the HTTP server (and rendering) would want to flush intermediate mouse-over events between callbacks. Could possibly be done by enqueuing all events and having the service of that queue on a small delay (where in servicing would drop all events except the last one). Alternatively could require a click event or something lower-frequency, though click would interfere with panning perhaps.

Also any thoughts on client-side animation / change of data sets?

Jonathan

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/E252A75D-D247-4157-B262-54493FC8D073%40gmail.com.

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/8205ECB4-B7AB-48FE-8B22-902DF1340D6F%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/578E637A-A07B-48F3-8366-034CC50FEE3D%40gmail.com.

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].

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

Hi Jonathan,

You want to trigger on a change to the “selected” attribute of a ColumnDataSource(s). So something like:

    for source in my_sources:

        source.on_change('selected', handler_object, 'callback_name')

would set up

    handler_object.callback_name(self, obj, attrname, old, new)

as the callback to call whenever the “selected” attribute changes on any of the data sources in “my_sources”.

BTW “app creation” is still an area where we are looking to improve and make things more streamlined, so any feedback you have about what could be made better or simpler would be very valuable.

Thanks,

Bryan
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/2448FA0C-D1A5-4242-A72A-39088400213E%40continuum.io.

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/CA%2BEr%2BdS7DhrrPS1r68X_HkiEv26popKsUGFjzt-kyncT%2BkeyqQ%40mail.gmail.com.

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