BooleanFilter
Bases: bokeh.models.filters.Filter
bokeh.models.filters.Filter
A BooleanFilter filters data by returning the subset of data corresponding to indices where the values of the booleans array is True.
booleans
property type: Seq ( Bool )
Seq
Bool
A list of booleans indicating which rows of data to select.
{ "booleans": null, "filter": null, "id": "9795", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [] }
CustomJSFilter
Filter data sources with a custom defined JavaScript function.
Warning
The explicit purpose of this Bokeh Model is to embed raw JavaScript code for a browser to execute. If any part of the code is derived from untrusted user inputs, then you must take appropriate care to sanitize the user input prior to passing to Bokeh.
args
property type: Dict ( String , AnyRef )
Dict
String
AnyRef
A mapping of names to Python objects. In particular those can be bokeh’s models. These objects are made available to the callback’s code snippet as the values of named parameters to the callback.
code
property type: String
A snippet of JavaScript code to filter data contained in a columnar data source. The code is made into the body of a function, and all of of the named objects in args are available as parameters that the code can use. The variable source will contain the data source that is associated with the CDSView this filter is added to.
source
CDSView
The code should either return the indices of the subset or an array of booleans to use to subset data source rows.
Example:
code = ''' var indices = []; for (var i = 0; i <= source.data['some_column'].length; i++){ if (source.data['some_column'][i] == 'some_value') { indices.push(i) } } return indices; '''
Note
Use CustomJS.from_coffeescript() for CoffeeScript source code.
CustomJS.from_coffeescript()
use_strict
property type: Bool
Enables or disables automatic insertion of "use strict"; into code.
"use strict";
from_coffeescript
Create a CustomJSFilter instance from CoffeeScript snippets. The function bodies are translated to JavaScript functions using node and therefore require return statements.
The code function namespace will contain the variable source at render time. This will be the data source associated with the CDSView that this filter is added to.
from_py_func
Create a CustomJSFilter instance from a Python function. The function is translated to JavaScript using PScript.
The func function namespace will contain the variable source at render time. This will be the data source associated with the CDSView that this filter is added to.
func
{ "args": {}, "code": "", "filter": null, "id": "9797", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [], "use_strict": false }
Filter
Bases: bokeh.model.Model
bokeh.model.Model
A Filter model represents a filtering operation that returns a row-wise subset of data when applied to a ColumnDataSource.
ColumnDataSource
filter
property type: Either ( Seq ( Int ), Seq ( Bool ) )
Either
Int
A list that can be either integer indices or booleans representing a row-wise subset of data.
{ "filter": null, "id": "9801", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [] }
GroupFilter
A GroupFilter represents the rows of a ColumnDataSource where the values of the categorical column column_name match the group variable.
column_name
The name of the column to perform the group filtering operation on.
group
The value of the column indicating the rows of data to keep.
{ "column_name": null, "filter": null, "group": null, "id": "9803", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [] }
IndexFilter
An IndexFilter filters data by returning the subset of data at a given set of indices.
indices
property type: Seq ( Int )
A list of integer indices representing the subset of data to select.
{ "filter": null, "id": "9806", "indices": null, "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "tags": [] }