擅长:python、mysql、java
<p><strong>更新:</strong>已为此功能提交PR。释放Bokeh<code>0.12.16</code>后,以下操作将起作用:</p>
<pre><code>from bokeh.io import show
from bokeh.layouts import column
from bokeh.models import Button, CustomJS
from bokeh.plotting import figure
p = figure(tools="reset,pan,wheel_zoom,lasso_select")
p.circle(list(range(10)), list(range(10)))
b = Button()
b.js_on_click(CustomJS(args=dict(p=p), code="""
p.reset.emit()
"""))
show(column(p, b))
</code></pre>
<hr/>
<p>从Bokeh<code>0.12.1</code>开始,没有内置函数来执行此操作。这可能是一个<a href="http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html" rel="nofollow noreferrer">custom extension</a>这样做。然而,这需要一些工作、实验和对话。如果你想追求这个选择,我鼓励你来到<a href="https://groups.google.com/a/continuum.io/forum/?pli=1#!forum/bokeh" rel="nofollow noreferrer">public mailing list</a>,它更适合于迭代协作和讨论。或者,请随时在<a href="https://github.com/bokeh/bokeh/issues" rel="nofollow noreferrer">project issue tracker</a>上打开功能请求</p>