Bokeh resize plot dynamically

ⅰ亾dé卋堺 提交于 2019-12-11 15:50:02

问题


i have Bokeh 0.12.6, what i do

p2 = figure(x_axis_type="datetime", plot_width=1500,plot_height=700,
            x_range=p1.x_range, title="")
select = Select(title="SELECT", options=["val1", "val2", "val3"])
select.callback = CustomJS(args={'plot1': p1, 'plot2': p2}, code="""
        if(cb_obj.value === "val1"){
            plot2.width = 1500;
        }else{ 
            plot2.width = 700;
        }
        plot2.document.resize();

    """)

I need to resize plot by clicking dropdown but i recieve js error that document.resize is not a function. Also i tried plot2.change.emit(); but plot changed only if i change display width in Chrome. How to dinamically change plot properties such as width, height, lines properies etc.. ? Thanks.


回答1:


Bokeh used to have resize but it died recently and won't get revived from what I read.



来源:https://stackoverflow.com/questions/48855922/bokeh-resize-plot-dynamically

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