is there a way to save bokeh data table content

xyliu00 picture xyliu00 · Aug 5, 2015 · Viewed 8.8k times · Source

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:

enter image description here

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

enter image description here

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.

Answer

xyliu00 picture xyliu00 · Aug 5, 2015

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.