@gpn based on your initial question I do not know what kind of data you would like to update, maybe it is possible through JS, I can only speculate (in the docs there is a section about JS callbacks).
Anyway, I would assume you can use on_event
for a python callback. I am at the moment not able to provide an example since I am traveling.
Just saw that there is an example here in another discourse question