有没有办法保存散景数据表内容 [英] is there a way to save bokeh data table content

查看:36
本文介绍了有没有办法保存散景数据表内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试验

但是数据表默认没有,也不会带'tools'参数:

是否可以在数据表中添加保存"按钮,以便查看该表的人可以将其下载为制表符分隔或 csv 文件?不一定要看起来一样,但保存功能一样.

解决方案

如果 bokeh 提供一个工具按钮来保存/导出数据表到 csv/txt/excel 文件就好了.如果它已经存在,我还没有在文档中找到它.

与此同时,一个可能的答案是使用本机 javascript 将 js 数组(即散景数据表下方)导出到 CSV.它已在此处此处.

添加:bokeh 具有使用 js 的回调.一个简单的描述是这里.仍在阅读它...

它可能已经存在一段时间了,但我刚刚注意到 Bokeh 网站上的一个示例 从数据表中保存csv.

I am experimenting with bokeh data table to display data embedded in web page. It works quite nicely.

Is there a way to save the table content from the displayed data table? Other bokeh plots have tool bar for various functions including saving, but the DataTable does not seem to come with it. I know very little about javascript or slickgrid, which bokeh data table uses. And wondering if it can be done.

Thanks!

EDIT - It appears the my original question was not clear enough. Hope following pictures can help to illustrate:

Bokeh plot has toolbars associated:

But data table does not have it by default, and it won't take 'tools' parameter either:

Is it possible to add 'save' button to data table so the person view the table can download as tab delimited or csv files? Not necessarily need to be look the same, but with the same function for saving.

解决方案

It would be nice if bokeh provides a tool button for saving/exporting the data table to csv / txt / excel files. If it already does, I have not found it in the document yet.

In the mean time, a possible answer is to export the js array (that is underneath the bokeh data table) to CSV using native javascript. It has been described here and here.

ADD: bokeh has callbacks for using js. A simple description is here. still reading about it ...

EDIT: It is probably there for a while now, but I have just noticed an example on Bokeh website for saving csv from data table.

这篇关于有没有办法保存散景数据表内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆