The answer is here: The bokeh document is only updated after the callback has finished - #4 by p-himik