evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.09k stars 190 forks source link

[Feature]: Support selecting multiple dimensions in dimension grid #2193

Open mcrascal opened 1 month ago

mcrascal commented 1 month ago

Description

Support selecting multiple of the same dimension in dimension grid

What problem would this solve?

I want to select three provinces as a group and include them in a filter selection

How should it work?

UI: Either shift click enables selecting multiple dimensions or just clicking a second one is supported.

API: boolean multiple prop defaulted to false, same as drop down

input store: multiple province dimensions selected: (province = 'ontario' or province = 'quebec') and language = 'en'

archiewood commented 1 month ago

Either shift click enables selecting multiple dimensions or just clicking a second one is supported.

Just clicking a second one will work on mobile, shift click wont.

if you also have some kind of "Clear Selection" button per dimension this feels like it would work great

kwongz commented 1 month ago

Hi @mcrascal just wanted to clarify a few things,

could we allow user to pass a multiple prop, which allows multiple rows within a column to be selected on single click, user can removed row selections in a column by single click again, as well as add a clear all button.

i think one clear all button should clear all columns, resetting the filter query to true

Alternatively, if we want the clear all for each column, maybe we can make it appear on hover so they are only there when the user is interacting with an individual column. We can call it just clear

Image

mcrascal commented 1 month ago

@kwongz

could we allow user to pass a multiple prop, which allows multiple rows within a column to be selected on single click, user can removed row selections in a column by single click again, as well as add a clear all button.

That sounds perfect!

i think one clear all button should clear all columns, resetting the filter query to true Alternatively, if we want the clear all for each column, maybe we can make it appear on hover so they are only there when the user is interacting with an individual column. We can call it just clear

I suspect we don't need a clear button, but I'd have to play with it. I don't think we'll need clear buttons for every column.