有没有一种方法可以保存bokeh数据表内容 [英] is there a way to save bokeh data table content

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

问题描述

我正在尝试 bokeh数据表以便在网页中嵌入中显示数据.它工作得很好.

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

是否可以从显示的数据表中保存表内容?其他背景虚化图具有用于各种功能(包括保存)的工具栏,但DataTable似乎并未随附该工具栏.我对bokeh数据表使用的javascript或slickgrid知之甚少.想知道是否可以做到.

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.

谢谢!

编辑-看来我的原始问题不够清楚.希望以下图片可以帮助说明:

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

散景图具有关联的工具栏:

Bokeh plot has toolbars associated:

但是数据表默认情况下没有它,它也不会使用'tools'参数:

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

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

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.

推荐答案

如果bokeh提供了用于将数据表保存/导出到csv/txt/excel文件的工具按钮,那就太好了.如果已经存在,那么我尚未在文档中找到它.

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.

与此同时,可能的答案是使用本机JavaScript将js数组(位于bokeh数据表下方)导出为CSV.已在此处进行了描述,并且此处.

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具有使用js的回调.一个简单的描述是此处.仍在阅读...

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

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

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

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

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