Filtering columns(not rows) of ColumnDataSource and Column Names or Vbar Stackers in Hover Tooltips

Dear Bokeh team,

Thanks for all the great work. I keep finding amazing functionalities every day and Bokeh has changed my workflow considerably.

After researching the documentation and previous threads the functionality I still cannot figure any way to select/filter ColumnDataSource’s columns either with JSCallback directly on the source object or by updating the “stackers” object (I am doing this on a vbar_stack glyph). My interpretation is that only rows can be filtered (either with JScallbacks or CDS view).

My objective is, in a standalone HTML file, to use a JScallback dropdown to filter rows of a CDS but also reduce the columns displayed based on another condition (or to find another functionality which would allow to do such things, maybe CDSview but it does not appear to be possible).

In addition, or in lieu, I would like to be able to see the column name in the HoverTooltip (as you would in Excel for instance). I have read all the discussion on the topic and besides having multiple HoverTools for each lines it does not seem possible. Ideally, i would want to find a way/hack to display the stackers (in my vbar_stack glyph) or more generally column’s names in the tooltips.

To be clear, I am not expecting to find the perfect code but an indication whether any of this is possible would go a long way.

Thanks again!

Julien

Hi Dargie,

Based only on the current Bokeh code, the filtering of columns for stacked vbars is possible but rather hard to implement.

But it’s pretty straightforward to implement a custom model that represents an underlying stack (in place of Bokeh’s models.expressions.Stack) that supports filtering.

With that model, you’ll be able to set a set of filters for it in the CustomJS callback for whatever control you use to filter the columns, as well as set “visible” fields on all required renderers.

Probably, it’s worth having such stuff in the main Bokeh code, especially given that we already have interactive legends. Feel free to create a Github issue.

Regards,

Eugene

···

On Friday, October 13, 2017 at 3:00:52 AM UTC+7, Dargie wrote:

Dear Bokeh team,

Thanks for all the great work. I keep finding amazing functionalities every day and Bokeh has changed my workflow considerably.

After researching the documentation and previous threads the functionality I still cannot figure any way to select/filter ColumnDataSource’s columns either with JSCallback directly on the source object or by updating the “stackers” object (I am doing this on a vbar_stack glyph). My interpretation is that only rows can be filtered (either with JScallbacks or CDS view).

My objective is, in a standalone HTML file, to use a JScallback dropdown to filter rows of a CDS but also reduce the columns displayed based on another condition (or to find another functionality which would allow to do such things, maybe CDSview but it does not appear to be possible).

In addition, or in lieu, I would like to be able to see the column name in the HoverTooltip (as you would in Excel for instance). I have read all the discussion on the topic and besides having multiple HoverTools for each lines it does not seem possible. Ideally, i would want to find a way/hack to display the stackers (in my vbar_stack glyph) or more generally column’s names in the tooltips.

To be clear, I am not expecting to find the perfect code but an indication whether any of this is possible would go a long way.

Thanks again!

Julien