deephaven / deephaven-plugins

Deephaven Plugins
5 stars 12 forks source link

Implement UI Table always_fetch_columns #513

Open mattrunyon opened 1 month ago

mattrunyon commented 1 month ago

Description

Our spec and docstring says that on_row_press and on_row_double_press receive "the row data provided in a dictionary where the column names are the keys". This is misleading for larger tables as you only get the visible row data (+/- a window off screen) due to how we viewport data.

We should probably just adjust the docstring and design docs to make it clear you will not receive the full row data. Unless we want to add a separate table viewport that subscribes to all the columns for just the selected rows. Could be problematic if there are thousands of columns.

Steps to reproduce

  1. Run this Python code which creates a 100 column table
    
    from deephaven import empty_table
    from deephaven import ui

@ui.component def my_table(): t = empty_table(50).update([ f"A{i} = ii" for i in range(100) ])

return ui.table(t, on_row_press=print)

t = my_table()



2. Click on a row

**Expected results**

3. Printed all rows with their data

**Actual results**

3. Printed all rows and the data is an empty string for many that are not fetched by the client.

**Versions**

UI 0.14.0
vbabich commented 1 month ago

This will be implemented by https://github.com/deephaven/deephaven-plugins/blob/7d410723d4489da4ee087ff5213687636683879e/plugins/ui/DESIGN.md#L1728

mattrunyon commented 1 month ago

I think these should be separate tickets. The on_row_press and on_row_double_press docstrings should be updated at least to be clear you won't get data for all the columns, but will get info about the columns. You currently get the names of all columns, but only data for those we've fetched.

mattrunyon commented 1 month ago

516 clears up the default behavior