From e1924585c9c5b3bb3e8568139a4133c5396bc732 Mon Sep 17 00:00:00 2001 From: mikebender Date: Thu, 12 Dec 2024 09:42:15 -0500 Subject: [PATCH] Clean up from review - Specify list or dict for the row_data vs row_list methods - Add link to toast - Add warning in the use_table_listener hook intro paragraph --- plugins/ui/docs/hooks/use_render_queue.md | 4 ++-- plugins/ui/docs/hooks/use_row_data.md | 2 +- plugins/ui/docs/hooks/use_table_listener.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/ui/docs/hooks/use_render_queue.md b/plugins/ui/docs/hooks/use_render_queue.md index 524354146..bd0777545 100644 --- a/plugins/ui/docs/hooks/use_render_queue.md +++ b/plugins/ui/docs/hooks/use_render_queue.md @@ -26,7 +26,7 @@ def toast_table(t): my_toast_table = toast_table(_source) ``` -The above example listens to table updates and displays a toast message when the table updates. The `toast` function must be triggered on the render thread, whereas the listener is not fired on the render thread. Therefore, you must use the render queue to trigger the toast. +The above example listens to table updates and displays a toast message when the table updates. The [`toast` function](../components/toast.md) must be triggered on the render thread, whereas the listener is not fired on the render thread. Therefore, you must use the render queue to trigger the toast. ## UI recommendations @@ -101,7 +101,7 @@ def ui_batch_example(): batch_example = ui_batch_example() ``` -When running the above example, _two_ toasts appear with each button press: a red one where `a != b` (as `a` gets updated first), then a neutral one where `a == b` (as `b` gets updated second). Use the `use_render_queue` hook to ensure the updates are always batched together when working with a background thread: +When running the above example, _two_ toasts appear with each button press: a red one where `a != b` (as `a` gets updated first), then a neutral one where `a == b` (as `b` gets updated second). Use the `use_render_queue` hook to ensure the updates are always batched together when working with a background thread: ```python from deephaven import ui diff --git a/plugins/ui/docs/hooks/use_row_data.md b/plugins/ui/docs/hooks/use_row_data.md index e5ddf3084..ef447262f 100644 --- a/plugins/ui/docs/hooks/use_row_data.md +++ b/plugins/ui/docs/hooks/use_row_data.md @@ -1,6 +1,6 @@ # use_row_data -`use_row_data` lets you use the data of the first row of a table. This is useful when you want to listen to an updating table and use the data in your component. +`use_row_data` lets you use the data of the first row of a table as a dictionary. This is useful when you want to listen to an updating table and use the data in your component. ## Example diff --git a/plugins/ui/docs/hooks/use_table_listener.md b/plugins/ui/docs/hooks/use_table_listener.md index 55875cc9d..1e16f92ea 100644 --- a/plugins/ui/docs/hooks/use_table_listener.md +++ b/plugins/ui/docs/hooks/use_table_listener.md @@ -1,6 +1,6 @@ # use_table_listener -`use_table_listener` lets you listen to a table for updates. This is useful when you want to listen to a table and perform an action when the table updates. +`use_table_listener` lets you listen to a table for raw updates. This is an advanced feature requiring an understanding of how [table listeners](https://deephaven.io/core/docs/how-to-guides/table-listeners-python/) work and limitations of running code while the Update Graph is running. Most usages of this are more appropriate to implement with [the table data hooks](./overview.md#data-hooks). This is useful when you want to listen to the raw updates from a table and perform a custom action when the table updates. ## Example