-
Notifications
You must be signed in to change notification settings - Fork 406
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 additional selection modes #3725
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
391e5e2
to
9b995bc
Compare
def select_cells(self, cells: list[Cell]) -> TableManager[Any]: | ||
df = self.as_frame() | ||
# This does not work and I could use some help | ||
return self.with_new_data([df.at[row, col] for row, col in cells]) |
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.
Hello @mscolnick, any ideas what I need to change here?
I'm a bit confused what exactly should be returned here.
This code doesn't work because of narwhal stuff
But I'm also unclear if I need this.
Because I'm unsure how this would play out if the on_change
callback?
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.
this function currently expect a TableManager back, which takes in a dataframe, but you are giving it a list.
we could:
- give
return self.with_new_data(
a dataframe instead of a list - change
def select_cells(self, cells: list[Cell]) -> TableManager[Any]:
todef select_cells(self, cells: list[Cell]) -> list[CellWithValue]:
if you do go with 2
. Instead of CellWithValue
. maybe add an optional value
to the Cell
class.
for implementation:
- you might want to filter to just the subset of all columns and all rows used, then convert to a dictionary, then pick out the correct row/col pairs, and then back to a dataframe
- this is likely easier (same implementation you currently have), but may affect downstream change such as exporting
📝 Summary
Fixes #3624
🔍 Description of Changes
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:
initial_selection
be taking into account here? Or would that remain row specific?📋 Checklist
mo.ui.Table
#3624 satisfies this)📜 Reviewers
@mscolnick