过去,似乎bokeh有选项可以生成离线可用的html文件。以下是一篇旧的讨论,展示了如何实现:
https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/Ts2P24YR0VU
使用以下命令:
看了新的文档,感觉很合理: https://docs.bokeh.org/en/latest/docs/reference/embed.html#bokeh.embed.file_html 是否可以提供一个简短的示例,以便在不运行本地 bokeh 服务器的情况下查看html文件?
希望解决方案像以前一样简单。
杰克布
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文件?
希望解决方案像以前一样简单。
杰克布
output_file(path,mode ='inline')
运行示例可以完美地按预期工作。根据SO问题的要求,请提供一个“完整的、最小的、可重现的示例”。 - bigreddotoutput_file
的文档在这里:https://bokeh.pydata.org/en/latest/docs/reference/io.html#bokeh.io.output_file 并且显示了模式参数。你链接的是低级别的file_html
函数,这不是同一件事,也不是你需要使用的东西。 - bigreddot