Filter#

class lumen.filters.base.Filter(**params)#

Filter components supply the filter values used by Source components to query data. .


Parameters#

field   required

type: str
default: ''
The field being filtered.

label

type: str
default: ''
A label for the Filter.

name

type: str
default: 'Filter'
String identifier for this object.

schema

type: dict
default: None
The JSON schema provided by the Source declaring informationabout the data to be filtered.

shared

type: bool
default: False
Whether the filter is shared across all layouts.

sync_with_url

type: bool
default: True
Whether to sync the filter state with the URL parameters.

table

type: str
default: None
The table being filtered. If None applies to all tables.

value

type: Any
default: None
The current filter value.


Methods#

Filter.to_spec(context: Dict[str, Any] | None = None) Dict[str, Any]#

Exports the full specification to reconstruct this component.

Return type:

Resolved and instantiated Component object

Types#

ConstantFilter type: constant

The ConstantFilter allows requesting a constant value from the

FacetFilter type: facet

The FacetFilter allows faceting the data along some dimension to

ParamFilter type: param

ParamFilter reflects the value of a parameter declared on a View.

WidgetFilter type: widget

WidgetFilter generates a Widget from the table schema provided by a Source.

BinFilter type: bins

BinFilter is a special WidgetFilter that allows selecting from a set of bins.

DateFilter type: date

DateFilter is a WidgetFilter specialized to select calendar dates.

DatetimeFilter type: datetime

DatetimeFilter is a WidgetFilter specialized to filter by datetimes.