1

I have the majority of my calculations for an interactive chloropeth graph done through callbacks on various attached widgets.

Can we run a callback on plot initiation? This could be accomplished by constructing a refresh/init button and attaching an initiating callback to it, but this still requires pushing a button.

1 Answer 1

2

Bokeh version 3.1 added a DocumentReady event that can be used for this. From JavaScript:

from bokeh.events import DocumentReady

curdoc().js_on_event(DocumentReady, CustomJS(...))

or from Python (in a Bokeh server application):

curdoc().on_event(events.DocumentReady, callback)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.