-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: Add ui.table press event listener support #346
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
mofojed
commented
Mar 7, 2024
- Depends on my web PR: feat: Add support to pass in mouseHandlers into IrisGrid web-client-ui#1857
- Passes through the on_*_press events to IrisGrid
- Tested with the snippet from the examples, ensured all events were being printed with the correct information:
- Depends on my web PR: deephaven/web-client-ui#1857 - Passes through the on_*_press events to IrisGrid - Tested with the snippet from the examples, ensured all events were being printed with the correct information: ```python import deephaven.ui as ui import deephaven.plot.express as dx te = ( ui.table(dx.data.stocks()) .on_row_press(lambda row, data: print(f"Row Press: {row}, {data}")) .on_row_double_press(lambda row, data: print(f"Row Double Press: {row}, {data}")) .on_cell_press( lambda cell_index, data: print(f"Cell Press: {cell_index}, {data}") ) .on_cell_double_press( lambda cell_index, data: print(f"Cell Double Press: {cell_index}, {data}") ) .on_column_press(lambda column: print(f"Column Press: {column}")) .on_column_double_press( lambda column: print(f"Column Double Press: {column}") ) ) ```
jnumainville
requested changes
Mar 7, 2024
@@ -423,6 +429,60 @@ def on_row_double_press(self, callback: RowPressCallback) -> "UITable": | |||
""" | |||
return self._with_prop("on_row_double_press", callback) | |||
|
|||
def on_cell_press(self, callback: CellPressCallback) -> "UITable": |
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.
Very cool stuff. As of the latest spec rework, all of these on_*
should be props to the table directly.
- Move functions to be keyword args on ui.table call instead
mofojed
added a commit
to deephaven/web-client-ui
that referenced
this pull request
Mar 8, 2024
- Move the doubleClick behaviour from IrisGridDataSelectMouseHandler into GridSelectionMouseHandler, so it's baked into Grid itself (double-clicking a grid in the styleguide was exhibiting erroneous behaviour) - Allow passing in mouseHandlers to IrisGrid. Will be necessary to support deephaven/deephaven-plugins#320 - Tested using my branch for `on_row_press` support on deephaven.ui: deephaven/deephaven-plugins#346 - Verified Linker still worked as expected
bmingles
approved these changes
Mar 8, 2024
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.
+1
jnumainville
approved these changes
Mar 8, 2024
+2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.