one_click
The one_click method creates a SelectableDataSet with the specified columns from a source table. This is useful for dynamic plotting, where Deephaven requires a SelectableDataSet instead of a standard table to execute certain operations.
Syntax
one_click(t: Table, by: list[str] = None, require_all_filters: bool = False) -> SelectableDataSet
Parameters
| Parameter | Type | Description |
|---|---|---|
| t | Table | The source table. |
| by optional | list[str] | The selected columns. |
| require_all_filters optional | bool | Whether to display data when some, but not all, input filters are applied.
|
Returns
Examples
In this example, we create a source table, then use one_click to create a SelectableDataSet copy of the table. Then, we use plot_xy to turn our SelectableDataSet into a plot, which can then be filtered via Controls > Input Filter in the user interface.
from deephaven import read_csv
from deephaven.plot.selectable_dataset import one_click
from deephaven.plot.figure import Figure
source = read_csv(
"https://media.githubusercontent.com/media/deephaven/examples/main/CryptoCurrencyHistory/CSV/CryptoTrades_20210922.csv"
)
oc = one_click(t=source, by=["Instrument"])
plot = Figure().plot_xy(series_name="Plot", t=oc, x="Timestamp", y="Price").show()
