How to fit bokeh plot size dynamically

大城市里の小女人 提交于 2019-12-04 21:03:32

Here is the modification to your code:

add an id argument to figure():

blue = figure(sizing_mode='stretch_both', tools='pan', id="blue_fig")

add onUpdate event and call Bokeh.index["blue_fig"].resize():

TweenMax.to($("#div2"), 0.5, {height:800, onUpdate:function(){Bokeh.index["blue_fig"].resize();}});
TweenMax.to($("#div2"), 0.5, {height:400, onUpdate:function(){Bokeh.index["blue_fig"].resize();}});

if the figure is complex and resize() is slow, change onUpdate to onComplete.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!