我正在尝试使用webgl测试渲染圈子的效果。我正在使用最新的Bokeh版本,v0.10.1。我有两个链接的散点图,带有框选工具。当我在每个地块上放置超过120,000点(总计240,000)时,我发现了这个错误:
未捕获RangeError:超出最大调用堆栈大小。
这是可以绘制的点数的硬限制吗?
import numpy as np
from bokeh.plotting import output_file, figure, gridplot, show
from bokeh.models import ColumnDataSource, Circle
N = 120000
max = 100
x1 = np.random.random(size = N) * max
y1 = np.random.random(size = N) * max
x2 = np.random.random(size = N) * max
y2 = np.random.random(size = N) * max
output_file('scatter.html')
source = ColumnDataSource(data = dict(x1 = x1, y1 = y1, x2 = x2, y2 = y2))
left = figure(tools = 'box_select, tap', width = 400, height = 400,
x_range = (0,100), y_range = (0,100), webgl = True)
right = figure(tools = 'box_select, tap', width = 400, height = 400,
x_range = (0,100), y_range = (0,100), webgl = True)
left.circle('x1', 'y1', size=10, fill_color = "black", source = source)
right.circle('x2', 'y2', size=10, fill_color = "black", source = source)
p = gridplot([[left, right]])
show(p)
编辑:我刚刚将散景更新到v0.11.0,现在我可以在每个地块上渲染更多的点数(我已尝试过500,000)。