-
Notifications
You must be signed in to change notification settings - Fork 449
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
Propogate column information when cell selected in mo.ui.Table
#3624
Comments
Makes sense, I think we can support this. I would see the options as:
In call cases, the response will likely be the same shape passed in. So if a dataframe is pass in, the |
Thanks for the quick reply! I agree in terms of the data returned. Our main use case is actually dataframes, so the user would necessarily get the row index in the dataframe case. However in the list/dict case how would you propose giving the user enough metadata to make it useful? For our dataframe use case we have data like:
If I had set this up as a list/dict instead of a dataframe and the user clicked the
|
## 📝 Summary <!-- Provide a concise summary of what this pull request is addressing. If this PR fixes any issues, list them here by number (e.g., Fixes #123). --> Fixes #3624 ## 🔍 Description of Changes <!-- Detail the specific changes made in this pull request. Explain the problem addressed and how it was resolved. If applicable, provide before and after comparisons, screenshots, or any relevant details to help reviewers understand the changes easily. --> This is a WIP, but I started with adding the new selection modes to both the JavaScript and Python side. I still need to to the actual implementation, but since I'm new to this project I could benefit from some early feedback. Open questions: - [ ] Where should the checkbox in the cell be positioned? What do you folks have in mind here UI-wise? - [ ] Should `initial_selection` be taking into account here? Or would that remain row specific? ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). (I believe the conversation in #3624 satisfies this) - [ ] I have added tests for the changes made. - [ ] I have run the code and verified that it works as expected. ## 📜 Reviewers <!-- Tag potential reviewers from the community or maintainers who might be interested in reviewing this pull request. Your PR will be reviewed more quickly if you can figure out the right person to tag with @ --> @mscolnick --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Myles Scolnick <[email protected]>
Hello @jp-gr Just wanted to let you know that this is available in the 0.11.17 release. Please let me know if there is anything I can do to further improve this! //cc @dave-gantenbein |
Description
In the
mo.ui.Table
component (https://docs.marimo.io/api/inputs/table/) it's possible to select one or more rows when clicking on the table. I propose adding more selection modes to make it possible to select a cell and get both the row and column information associated with that cell.In our use case we have some fairly wide dataframes and would like our users to be able to trigger some charts on more than one dimension by just clicking one cell.
Suggested solution
In the
mo.ui.Table
component we have the argument:At the moment this allows two modes:
single
: only one row can be selectedmulti
: many rows can be selectedI propose adding a new option to this:
cell
: when a cell is clicked then both the row and column information is sent to the definedon_change
callback.At the moment, the
on_change
callback is called with a list of dicts of all the information in the selected rows. I'm not sure what is a clean way to do this, but two suggestions come to mind:Would become:
Alternative
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: