bokeh保存html,Bokeh服务器,简单的html页面

我有一个大的数据源,我需要在我的机器上计算并与其他用户共享,大约每5分钟更新一次。更简单的解决方案是在我的机器上安装一个bokeh服务器,他们可以连接到该服务器来查看数据。在

尝试运行bokeh服务器时,出现以下错误:RuntimeError: Failed to push document: AttributeError("'PropertyValueList' object has no attribute '_owners'",)

我想这是关于如何让它运行的问题,我从设置服务器开始:

^{pr2}$

然后我从bokeh网站编译并运行以下示例:import numpy as np

from numpy import pi

from bokeh.client import push_session

from bokeh.driving import cosine

from bokeh.plotting import figure, curdoc

x = np.linspace(0, 4*pi, 80)

y = np.sin(x)

p = figure()

r1 = p.line([0, 4*pi], [-1, 1], color="firebrick")

r2 = p.line(x, y, color="navy", line_width=4)

# open a session to keep our local document in sync with server

session = push_session(curdoc())

@cosine(w=0.03)

def update(step):

r2.data_source.data["y"] = y * step

r2.glyph.line_alpha = 1 - 0.8 * abs(step)

curdoc().add_periodic_callback(update, 50)

session.show() # open the document in a browser

session.loop_until_closed() # run forever

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值