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

Trigger Python event when `level_of_detail` mode finishes #3748

Closed
jdugge opened this issue Jan 26, 2016 · 4 comments
Closed

Trigger Python event when `level_of_detail` mode finishes #3748

jdugge opened this issue Jan 26, 2016 · 4 comments

Comments

@jdugge
Copy link

@jdugge jdugge commented Jan 26, 2016

It would be great if the Python script on a Bokeh server could be notified once a level_of_detail mode in the client (on zoom or pan) finishes, since this can be an appropriate point at which to generate updated data.

@bryevdv
Copy link
Member

@bryevdv bryevdv commented Jan 26, 2016

This seems reasonable, but I think we first need to build out a little capability for "events" that are not model attribute updates. E.g. we currently clumsily record button presses as an attribute state change, but buttons, and things like this should really be separate fire-and-forget type events back to the server, not model state updates. Thoughts @havocp ?

@havocp
Copy link
Contributor

@havocp havocp commented Jan 26, 2016

A simple version that might require only one new websocket message could be along these lines...

class Model:
    def emit_event(self, name, args):
         """Broadcast an event with the given name and dict of args.

         The args dict cannot contain models, only plain old data.
         """
         pass
   def on_event(self, name, callback):
        """Register a callback to receive events with the given name and their args.
        """

On the Document and wire protocol level, there could be some kind of ModelEventEvent (better name possible), which would serialize the event name and args... so there's one new websocket message that has name and args in it.

@bryevdv bryevdv added this to the short-term milestone Jan 27, 2016
@bryevdv bryevdv self-assigned this Jan 27, 2016
@bryevdv
Copy link
Member

@bryevdv bryevdv commented Jan 27, 2016

@havocp that seems pretty reasonable, I've re-marked this as a feature.

@bryevdv
Copy link
Member

@bryevdv bryevdv commented Mar 15, 2017

This was closed by #5941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.