Triggering callback from within Python

The django-plotly-dash library does something similar to what it sounds like you are looking for, essentially by sending a message to a UI component via a websocket and then having that component invoke the callback.

This may sound a bit back-to-front, but it means that the data flow follows that of the rest of Dash, and also can be used directly with other existing Dash components and applications. In particular, the existing Dash infrastructure, based on http requests, is unchanged. You do need to run a websocket-capable server, but you are going to have to do that (or something very similar) to get this sort of server push functionality anyway.

1 Like