cldellow / datasette-ui-extras

Add editing UI and other power-user features to Datasette.
Apache License 2.0
12 stars 1 forks source link

facets: make them behave like e-commerce facets? #27

Closed cldellow closed 1 year ago

cldellow commented 1 year ago

Split from #21. I'm not convinced this is a good idea yet.

Imagine two facets, gender and country. They start like:

Gender
 - Male (90)
 - Female (70)

Country
  - Canada (100)
  - USA (50)
  - Mexico (10)

If you pick USA, the facets change to:

Gender
 - Male (25)
 - Female (25)

Country
  X USA (50)

Could they instead change to:

Gender
 - Male (25)
 - Female (25)

Country
  - Canada (100)
  X USA (50)
  - Mexico (10)

i.e. show what you have selected, but also show the other options within the same facet.

This would let you create ORs, by picking multiple countries, eg USA and Mexico.

This might get pretty weird if you have multiple facets active.

cldellow commented 1 year ago

This wouldn't be compatible with the year or year-month facet I'm thinking of adding -- I don't think filters can express an OR of complex conditions. Gonna close for now.