new Filter()
A filter provides a chart with an interface to the data.
The filter contains a number of Partitions and Aggregates.
It takes care of calling the relevant functions provided by a Dataset.
Basic usage for a Chart is:
- The chart renders using
Filter.dataif available - It can add or remove partitions and aggregates to the filter
- It calls
Filter.updateSelection(..)when the user makes a selection - To apply the new selection, and also filter the other charts, the chart calls
Filter.updateDataFilter() - The charts redraws on 'newData' events on the filter
The filter does the following:
- It adds or removes paritions and aggregates on request
- When it has the right number of partitions and aggregates,
Filter.isConfiguredbecomes true andFilter.initDataFilter()is called - This in turn creates a
Filter.getDatafunction - As the new filter could affect all plots
Dataset.getAllDatacalled
Filter.getData does the following:
- It arranges for the
Filter.dataarray to be filled - A
newDataevent is triggerd, and the chart's callback function is executed
- Source:
Extends
Members
(static) aggregates :Array.<Aggregate>
Type:
- Array.<Aggregate>
- Source:
(static) data :Data
Array containing the data to plot
Type:
- Source:
(static) partitions :Array.<Partitions>
Type:
- Array.<Partitions>
- Source:
(static) title :string
Title for displaying purposes
Type:
- string
- Source:
Methods
(abstract, static) getData()
Call this function to request new data. The dataset backing the facet will copy the data to Filter.data. A newData event is fired when the data is ready to be plotted.
- Source:
Fires:
- event:newData
(abstract, static) initDataFilter()
initDataFilter Initialize the data filter, and construct the getData callback function on the filter.
- Source:
(abstract, static) releaseDataFilter()
relaseDataFilter The opposite or initDataFilter, it should remove the filter and deallocate other data related to the filter.
- Source:
(abstract, static) updateDataFilter()
updateDataFilter Change the filter parameters for an initialized filter
- Source:
Events
newData
newData event Indicates new data is available at Filter.data for plotting.
- Source: