avo icon indicating copy to clipboard operation
avo copied to clipboard

Show distinct values on Index

Open adrianthedev opened this issue 1 year ago • 12 comments
trafficstars

A user has a field called status with multiple values. We'd love to be able to click a button on the Index view and show all the values from the DB and how many are in which category.

adrianthedev avatar Dec 18 '23 11:12 adrianthedev

@adrianthedev I'll try to tackle this one :)

bryszard avatar Jan 13 '24 14:01 bryszard

It's yours! Looking forward to see how this looks like. Thanks!

adrianthedev avatar Jan 13 '24 14:01 adrianthedev

I think we can tie this one very nicelt with the dynamic filetrs feature to further filyer the records down. But one step at a time

adrianthedev avatar Jan 13 '24 14:01 adrianthedev

@adrianthedev I have the first draft for the design. I'd add a bar chart icon next to the column label, which will be clickable and then it will show a small box with the summaries in it.

Not sure if we should be allowing columns to be both sortable and "summarizable".

Let me know what do you think:

image

bryszard avatar Jan 13 '24 23:01 bryszard

I think it's a good start. I've been thinking about how to "marry" all these actions (sorting, filtering, and distinct values).

Instead of limiting the user to just one button, or showing two of them (and maybe later getting into issues when we add a third action), we could add a dropdown like Airtable has to show all the actions one can do with that column.

What do you think about the approach?

If you're not comfortable with designing it, I can take over and make it a bit prettier after you submit the PR.

CleanShot 2024-01-15 at 14 03 22

adrianthedev avatar Jan 15 '24 12:01 adrianthedev

@adrianthedev Good idea. A similar solution, but simpler, you can find on Metabase:

image

I'll try to come up with something (probably during the weekend).

bryszard avatar Jan 15 '24 21:01 bryszard

yes, the airbnb fropdown is a bit more advanced and we don't need it like that. Metabase has a good solution too!

What does the "Distribution" button do?

adrianthedev avatar Jan 15 '24 21:01 adrianthedev

In their case it is a link a query with visualisation that shows you the distribution of the value, like this:

image

bryszard avatar Jan 16 '24 06:01 bryszard

@adrianthedev Right now it looks like this:

image

Not sure what styling we want to apply inside there. I was also thinking about adding a pie chart inside, WDYT?

bryszard avatar Jan 20 '24 13:01 bryszard

The pie chart might be a cool thing to have.

That looks cool.

adrianthedev avatar Jan 20 '24 13:01 adrianthedev

This is how it could look with the pie chart. I'll need to tweak the integration between those two parts:

image

bryszard avatar Jan 20 '24 15:01 bryszard

This looks great @bryszard. I'll move the convo to the PR and make sure we'll review it this week. Thank you!

adrianthedev avatar Jan 22 '24 12:01 adrianthedev