Adds a DataFilter component which takes a prop filterField and matches it with data keys to populate the values of a dropdown. Dropdown selection invokes an emitFilter() method which then filters the data on the parent component (e.g. Map, Gallery).
Allows the DataFilter component can be enabled using an environmental var FRONT_END_FILTERING and uses an additional env var FRONT_END_FILTER_FIELD as the filterField key.
Adds DataFilter to Map and Gallery components.
I considered having two dropdowns: one to select a column (key), and the other to select values (similar to what Terrastories does). However, I felt that this required more validation with our users, so I opted for this initial approach for now which will be a great value add for Mapeo maps or other datasets where there is one primary key.
Closes #3.
This PR:
DataFilter
component which takes a propfilterField
and matches it withdata
keys to populate the values of a dropdown. Dropdown selection invokes anemitFilter()
method which then filters the data on the parent component (e.g. Map, Gallery).DataFilter
component can be enabled using an environmental varFRONT_END_FILTERING
and uses an additional env varFRONT_END_FILTER_FIELD
as thefilterField
key.DataFilter
toMap
andGallery
components.I considered having two dropdowns: one to select a column (key), and the other to select values (similar to what Terrastories does). However, I felt that this required more validation with our users, so I opted for this initial approach for now which will be a great value add for Mapeo maps or other datasets where there is one primary key.