Filter

Filter styles allow to filter data collections and store the filter state in the session. This allows to filter multiple styles using the same data collection simultaneously with only one filter. As with graphs also filters can act on two types of data:

  • dynamic: The data is collected through the selfhelp style formUserInput or mermaidForm. A data collection corresponds to all data points collected through one specific form. A data set corresponds to all data points collected through a specific input field of a form.
  • static: The data was collected through other means than SelfHelp and was uploaded to the SelfHelp platform as a CSV file. A data collection corresponds to all data points within a CSV file. A data set corresponds to one column of a CSV file.

To filter a data collection a filter must specify a data set and a value. When the filter is enabled, data of all data sets where the filter value matches the value in the data set is returned from the data collection. If multiple filter styles are active at the same time the filters are combined with a logic and, i.e. all filter values must match for data to be returned.

The following filter styles are available:

  • filterToggle Create a toggle button which will enable or disable a filter on a data collection data.
  • filterToggleGroup Create a group of toggle buttons which will enable or disable a filter on a data collection. Multiple active buttons are combinde with the logic or function.

A word of caution: A filter acts globally on all styles referring to the same data collection as the filter. This means that activating a filter on any page will impact a style using the filtered data collection on any page.