Dimension grid component?

Hej
I would like to build something like evidence.dev’s Dimension Grid in Streamlit:

CleanShot 2024-03-08 at 16.46.15

Has somebody done something similar in Streamlit yet and can share the approach?
Many thanks

3 Likes

This is a rough example suing radio buttons and JSON files. I’m sure there is a better approach, but I think its possible to achieve similar functionality.

Example

Filtering

3 Likes

Thank you!

Yes I was thinking about an implementation with existing components, but I wanted sth different. Also really not a dimension explore, but a selectbox with size>1, so several options can be seen at the same time, and selection is easier (without dropdown)

So I created my first custom component :partying_face:
very rudimentary, v0.1 type of stuff, but it allows me to do “cascading selects” like this

output3

Code here:

IMHO it would be best if a “size” parameter could be added to the existing st.selectbox… but I don’t know how to do that

2 Likes

I opened an enhancement issue for this here add "size" parameter to st.selectbox · Issue #8272 · streamlit/streamlit · GitHub

2 Likes

It’s snappy fast! Nice work. :+1:

Nothing wrong with rudimentary when it comes to experimentation. I use the drill-through functionality in Power BI when multiple filters are displayed within a report and its not always obvious that user selections applied to one slicer filter others throughout the page. Having the ability to visualize the interaction between the two elements is a good approach! Again, nice job!

Universally, either a sizing or positioning feature for built-in elements would be awesome! Each release has included new elements & styling features since I’ve joined the community that have been extremely useful and I recall seeing custom styling/theming options as a bullet point on Streamlit’s future roadmap, so it maybe coming in the future.

I’ll give the new GitHub enhancement a thumbs up right away! Thank you for submitting that request!

Cheers!

1 Like