visualizingthefuture / examples-repository

Repository for https://visualizingthefuture.github.io/examples-repository
Other
5 stars 2 forks source link

improve filter functionality on multi-select gallery #68

Closed amzoss closed 3 years ago

amzoss commented 4 years ago

It's just not quite right yet. Would be better to distinguish between checkboxes actively selected and options that are still present in the filtered items.

Original single-facet filter buttons work kind of like the Isotope library, so that might be a model to look into. The normal Isotope model filters on one field and selects one object at a time. Can filter on multiple fields using combination filter, but still only one option in each field.

Some questions about this that may have solutions:

Ideally keep an eye out for solutions that help by tracking numbers of items in each category. Not sure if I really want to add Isotope or just use the JQuery code. Possibly also look into group_by filter in Liquid?

amzoss commented 4 years ago

Maybe this? https://community.shopify.com/c/Shopify-Design/Multi-tags-filter-All-products/td-p/647349

amzoss commented 4 years ago

More on Isotope with Jekyll: https://github.com/cagrimmett/jekyll-tools#filtering-categories-with-isotope

amzoss commented 4 years ago

Thought: use breadcrumbs as way of distinguishing between active selections and passively allowed categories. Maybe something like this:

Unrelated note: just realized that using class btn-group creates buttons with no space between, so generally don't want to do that.

amzoss commented 4 years ago

Hmm, I wonder if the group_by functionality could be repurposed. Maybe each checkbox could be created by group_by to actually contain an array of items that have that option. within the same group, those arrays could be concatenated to simulated the "OR" functionality. between groups, you'd have to find the intersect, and I don't think there is an intersect filter for arrays, but maybe could create a for loop or some other way of figuring out if an item is in each facet group that has a selection. If that could be figured out, though, then maybe the set of items that meets the checkbox logic could be passed to the gallery display. We really need that collection to get passed even to the individual items displayed in the gallery for downstream navigation, so that's another problem we're trying to solve that might require an array of the actual items.

amzoss commented 3 years ago

more examples to try: