-
Notifications
You must be signed in to change notification settings - Fork 4k
Add single- and multi-cell selection options to st.dataframe
#8952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add single- and multi-cell selection options to st.dataframe
#8952
Conversation
|
Dear maintainers, |
2e645ca to
eb1753e
Compare
|
Please suggest how to add tests for this functionality. |
eb1753e to
7a44838
Compare
frontend/lib/src/components/widgets/DataFrame/hooks/useSelectionHandler.ts
Fixed
Show fixed
Hide fixed
|
@Dev-iL Thanks a lot for the contribution! Implementation-wise, this already looks promising. However, adding this feature will require some internal discussions and decisions. I will share this with our product team. One potentially disappointing outcome might be that we will close the PR for now. We actively decided against adding cell selection in the initial version of dataframe selections since the cell selection event is already overloaded with other functionality (e.g., opening cell details, copy/pasting, editing, etc.). We are closely monitoring #6781 to see how interest in this feature evolves. |
lib/setup.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change? Did you run into a problem if this is not specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, couldn't pip install on Windows otherwise. I think I added some info in the commit where this change was added.
@lukasmasuch Thank you for your reply. Interestingly, my rather simple use case requires none of that other functionality, whereas cell selection is critical. I even created a workaround using very ugly tornado hacks that achieves roughly the same thing (linked in the issue). Might I suggest adding a setting somewhere (perhaps to the df component) that allows a user to choose between cell selection and the other interactions you mentioned? |
15128d6 to
0b2a581
Compare
effb6e9 to
6bd8be6
Compare
|
Hey @Dev-iL, sorry for the long delay, we had a few vacations on the team. Lukas is still out of the office, but I'll talk with him about your PR when he's back this week. Unfortunately, as Lukas pointed out, there are a few UX inconsistencies we'd first want to clean up before adding cell selections (also added a longer comment to the issue here), so I think it's quite likely we'll close this PR for now. I know it's a bit frustrating for your current use case but having an amazing user experience is one of our primary goals for Streamlit. I also don't think we'd want to add a (temporary) parameter to switch between the behaviors, since that seems a bit hacky and unfinished. |
|
Hi @jrieke, thank you for your clarifications. I respectfully disagree that knowing where one clicked in a table goes against "an amazing user experience". I'd say that adding advanced functionality (such as putting interactive charts in cells, or viewing cell details) while skipping the basics is what leads to a suboptimal experience. Having said that, I'm sure your company has considerably more experience designing UX than a lone developer, and one would assume that you guys could come up with a better solution than a parameter, if you wanted. Maybe one of those BTW, why the urgency to close the PR? Can't you simply ignore it until you're ready to include the feature? |
011e9ec to
40f0ccf
Compare
40f0ccf to
94be5ac
Compare
|
Hey @Dev-iL, sorry for the long delay, I was out on vacation.
Totally agree with you that it doesn't have to go against a good UX, and as I pointed out, we'd totally love to have this feature! But as Lukas and I mentioned, it conflicts with some of the current behavior, which is essential for basic functionality like copy-pasting or viewing cell details. (Please also note that these are behaviors that come with the underlying library we're using, not things we added ourselves). We'll absolutely get to the point where we can figure out all of these things and add cell selections but as you can see on our issues page, we got over 600 feature requests, so we need to prioritize very aggressively. Right now, cell selections are unfortunately not at the top of that priority list. I can totally leave this PR open, and please be assured that we'll come back to it at some point! |
94be5ac to
73c4551
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
73c4551 to
a620e8f
Compare
f248529 to
db247ce
Compare
bd53439 to
9046773
Compare
9bcc0fe to
511d1b0
Compare
3f0300b to
ca671f0
Compare
|
@lukasmasuch @jrieke Codewise, is there anything that needs to be changed in or added to the PR? Otherwise, let's merge and be done with it! |
@Dev-iL sorry for the delay, we had lots of other things going on. We added cell selections to our plan for Q3 (which runs from Augst to October), will have a look into which behavior we want and if we can use your PR then! |
ca671f0 to
8328008
Compare
8328008 to
d2aeff0
Compare
st.dataframe
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 The selection feature was already merged in #11393. Merging this PR as an (almost) empty commit to give some attribution.
Describe your changes
The purpose of these changes is that a user selection of one or more cells but not an entire row/col would trigger the DataFrame's
on_selectmethod, returning the selection "rectangle".Screencast.from.26-06-24.12.57.27.webm
Demo app (python)
GitHub Issue Link (if applicable)
#6781
Testing Plan
st_dataframe_selections.pywith the new selection mode + the associated unit tests.useSelectionHandler.Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.