Implement a way for a data layer to "filter" its data and show only a subset of points. Two syntaxes are supported:
Declarative, with built-in filtering operators (layout.filters = [ {field, operator, value}... ]). May be defined before initial render.
Imperative, by defining an arbitrary filter function on the layer after the initial render is complete (layer.setFilter(func)). The user-defined function is a callable with the same arguments as array.filter. It is applied on each render.
Layouts must be JSON serializable; there is not a mechanism to define imperative functions before first render.
Unify filtering syntax to be the same across labels and top level layouts. Breaking change: all now use {field, operator, value} (filters no longer declared as arrays)
Add data-filtering syntax to scatter plot, genes, forest, etc. This will require further testing, as for some datasets the behavior is not very well defined.
TODO
[x] Implement basic UI toolbar widget that allows quick filtering based on user-provided values
[x] Add unit tests
[x] Define behavior when user enters a filter, then clears value (esp for exact match)
[x] Test on all layer types that support filtering functionality
Ticket: #196
Purpose
Implement a way for a data layer to "filter" its data and show only a subset of points. Two syntaxes are supported:
layout.filters = [ {field, operator, value}... ]
). May be defined before initial render.layer.setFilter(func)
). The user-defined function is a callable with the same arguments asarray.filter
. It is applied on each render.Summary of changes
{field, operator, value}
(filters no longer declared as arrays)TODO