New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotting with subsets (row-wise) of ColumnDataSources (like filtered data) #4070

clairetang6 opened this Issue Mar 25, 2016 · 2 comments


None yet
3 participants

clairetang6 commented Mar 25, 2016

Currently, Bokeh only allows glyphs to take full columns of data from a ColumnDataSource. This means that you must have additional ColumnDataSources for any plots that only use a subset of the data. This causes data to be replicated and makes linked selection more complicated for users, who would have to keep track of indices themselves.

It would be nice if Bokeh allowed glyphs to take subsets of columns as data. An application using multiple plots, each showing some subset (e.g. filtered by the value of some column, like the example @dennisobrien showed at the SF meetup) of the data (or the full set), would then be able to completely share the data in the same way that Bokeh allows plots to share the full ColumnDataSource now. Linked selection would work intuitively with selected data points (rows) showing up in whichever plots contain that point. Holding shift before selecting on any plot would add to the selection.

One possibility for an API would be to include another parameter that picks the subset of data for a renderer to use by the indices (which could default to all).

data_source = ColumnDataSource(df)
fig = figure()
r = = ‘x’, y = ‘y’, source=data_source, indices=[0, 1, 2]) 
r = = ‘x’, y = ‘y’, source=data_source, indices=np.arange(n)[ == “sunny”])
r = = ‘x’, y = ‘y’, source=data_source, indices=[i for i, val in enumerate( if val == “sunny”])

Another possibility could be to make the data source “filterable” in a pandas-like way.

r = = ‘x’, y = ‘y’, source=data_source[ == “sunny” ]) 

I tried to look through the issues and google group to find some related posts.

Is this something that would be in Bokeh’s scope?

@clairetang6 clairetang6 referenced this issue Mar 28, 2016


ColumnDataSource subsets #4074

0 of 3 tasks complete

@bryevdv bryevdv added this to the short-term milestone Apr 9, 2016


This comment has been minimized.


clairetang6 commented May 13, 2016

Hi all, @bokeh/dev, I added a proposal for a filterable data source on the wiki. I'm not exactly sure how working documents work, but please feel free to provide any feedback. Thanks!

@clairetang6 clairetang6 referenced this issue Jan 31, 2017


TableDataSource: the filterable CDS #5828

0 of 3 tasks complete

@clairetang6 clairetang6 modified the milestones: 0.12.5, short-term Feb 1, 2017

@clairetang6 clairetang6 referenced this issue Mar 1, 2017


Filterable and groupable CDS #5933

0 of 3 tasks complete

@bryevdv bryevdv modified the milestones: 0.12.6, 0.12.5 Mar 15, 2017


This comment has been minimized.


bryevdv commented Jun 4, 2017

This is going to be a tremendous feature, but let's plan to get it merged nearer to the beginning of a release cycle so that it can be available in dev builds, etc for more exposure and testing

@bryevdv bryevdv modified the milestones: 0.12.7, 0.12.6 Jun 4, 2017

@bryevdv bryevdv closed this in #5982 Jul 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment