我有一个很大的数据集(多达250万个点),我想为我的Bokeh图进行下采样,然后在用户放大和缩小时重新采样。我使用的是带有redis后端的bokeh_server。
服务器日志现在显示200个令人振奋的HTTP响应,但在浏览器页面中没有显示任何内容。我得到了JavaScript错误:Error: Domains other than x not supported yet。我是否正确访问了我的HDF5文件?bokeh如何知道数据集的名称(在我的例子中称为test )。
我的Django视图的相关部分是:
def bokeh_test2(request):
import numpy as np
import bokeh.plotting as bplot
from bokeh.transforms import line_downsample
import bokeh.embed as embed
bplot.output_server(docname="downsampling_test")
source = line_downsample.source(data_url='data/test.hdf5',
owner_username='defaultuser')
p = bplot.line('x', 'y', source=source, legend='test')
bplot.push()
tag = embed.autoload_server(p, bplot.cursession())
c = {'bokeh_div': tag}
return render_to_response('bokeh_test.html', c,
context_instance=RequestContext(request))有没有人能提供一点线索?
发布于 2015-01-27 04:52:48
我不确定为什么这样做不起作用,但我知道这不是做事情的理想方式。你不应该每次都创建一个新的图。您应该提供一次autoload_server标记,保存对数据源的引用。然后,只更新数据源并将其推送到Bokeh服务器,客户端中的现有绘图将自动更新。
https://stackoverflow.com/questions/28099530
复制相似问题