I’m trying to integrate bokeh into a larger interactive dashboard. Currently, I have an page served up by the bokeh server, which has some filter buttons and a graph. The buttons trigger the backend to perform the filtering of data shown in the graph. What I’d like to do is populate a table external to bokeh with the data presented to the graph and update the table when the filters are applied. Ideally, I’d like to be able to register a JS callback to bokeh.js and tell me when data has changed (I’m looking at ColumnDataChanged in particular) and a way to access the data. If need be I have a very hacky method of getting at the data.
I’m not sure if I’ve understood your question. Based on my understanding, here’s my suggestion.
You could create a new data table and add it to a separate tab panes. So one tab pane would have your widgets and graphs and other pane would have your data table. You could also have them in the same pane. I’m not sure if you could have the data table populated outside the bokeh server, maybe @Bryan can correct me If I’m wrong.
You create probably have a basic Div Text and update the text using "
div.text =""" Data Updated """ " when the ColumnDataSource gets updated (when the button or other widget is used). The CDS data can be updated on the Data Table as well.
That data table might suffice, the data will be coming from the bokeh server. But for the sake of completeness. I did discover that the document object has an on_change function to register a call back which receives the change event including the CDS event. The problem I have in this approach is I can not find (even scanning the websocket) when the server sends data to the client for the initial graph. I get all the change events but the event which initially populates the graph, I don’t see.
More specifics on the visualization:
The layout has a graph with selectors to select the dimensions for the x and y axis, so initially the space for the graph is empty. When the both axis are selected the graph populates but I don’t see anything over the websocket which shows data being supplied. When an axis is changed there is a CDS event which has the updated data. So if you have any suggestions for where to look for the first event, that would be greatly appreciated.