-
Notifications
You must be signed in to change notification settings - Fork 21
Update data grid/table row selection docs #143
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
Conversation
@@ -9,11 +9,11 @@ | |||
|
|||
@render.ui() | |||
def rows(): | |||
rows = input.penguins_df_selected_rows() # << | |||
rows = penguins_df.input_cell_selection()["rows"] # << |
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.
I think this is a good change in the sense of having the existing example run correctly with shiny 0.9.0.
We don't necessarily need to do it in this PR, but this example is less motivating now that the output object has more methods. It'd be nice if this example or a variant in this section gave more instruction about those methods and how to use them.
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.
I agree that there should be an example that shows other methods. I think it makes sense to merge now and then when @schloerke, discuss with him about other examples.
|
||
The value returned will be `None` if no rows are selected, or a tuple of integers representing the indices of the selected rows. To filter a pandas data frame down to the selected rows, use `df.iloc[list(input.<id>_selected_rows())]`. | ||
The value returned will be an empty tuple if no rows are selected, or a tuple of integers representing the indices of the selected rows. To filter a pandas data frame down to the selected rows, use `df.iloc[list(<name>.input_cell_selection()["rows"])]`. |
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.
At the very least, I think this section should give the user a hint that .input_cell_selection()
isn't the only method (maybe in a paragraph below this one) with a pointer to our docs where they might learn more.
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.
Good idea -- I've added a bit of info and link to the API docs.
@wch I just went looking for this example and realized that the docs aren't live yet, so I'm going to merge this now. |
This fixes documentation and examples on doing row selections, for Shiny 0.9.0.