In order to provide hooks between the figures and the animation widgets each layer.draw method can optionally return a closure which can then be called to connect the animation.
This is super clunky and unintuitive.
I think a better way would be to attach any needed animation attributes/methods as tags on the bokeh figure, then iterate over the figures looking for any that have the relevant tags if an animation is set.
In order to provide hooks between the figures and the animation widgets each
layer.draw
method can optionally return a closure which can then be called to connect the animation.This is super clunky and unintuitive.
I think a better way would be to attach any needed animation attributes/methods as
tags
on the bokeh figure, then iterate over the figures looking for any that have the relevant tags if an animation is set.