生成离线工作的 Bokeh html 文件

Generating Bokeh html files that work offline

过去似乎 bokeh 可以选择生成 html 离线工作的文件。这是一个较早的讨论,展示了如何做到这一点: https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/Ts2P24YR0VU

使用线路:

output_file(file_path, mode='inline') 

但是,这似乎不适用于我正在使用的 bokeh 版本 0.12.10

当我尝试添加 mode = 'inline' 时,我得到:

TypeError: file_html() got an unexpected keyword argument 'mode'

看看新的文档,它是有道理的: https://docs.bokeh.org/en/latest/docs/reference/embed.html#bokeh.embed.file_html

是否可以得到一个简短的例子,说明如何在没有 运行 本地 bokeh 服务器的情况下离线查看 html 文件?

希望解决方案像以前一样简单。

雅各

file_html 函数接受一个 resources 参数,该参数必须是实际的 Resources 对象(不是字符串)。为方便起见,有一些预先配置的资源对象。特别是,可以将 bokeh.resources.INLINE 对象传递给 file_html 以使用内联资源。