Skip to main content
Version: Java (Groovy)

Create and use dynamic plots

Plots configured with a SelectableDataSetOneClick can be paired with Deephaven's Input Filter, Linker feature, or drop-down filters. As the input changes, the paired plot will dynamically update to reflect the filtered dataset.

oneClick

To create a dynamically updating plot - a plot that updates with "one click" in the console -, the data source must be a SelectableDataSetOneClick. This is easily accomplished with the use of the oneClick method:

oneClick(pTable)
oneClick(pTable, requireAllFiltersToDisplay)
oneClick(t, requireAllFiltersToDisplay, byColumns)
oneClick(t, byColumns...)
  • pTable is a partitioned table containing the data.
  • t is the table containing the data.
  • byColumns is a list of strings, where each string is the name of a column to be made available for input filtering.
  • requireAllFiltersToDisplay, when set to true, will display a prompt explaining that filter controls must be added to the resulting plot. By default (false), this message will not be displayed.
import static io.deephaven.csv.CsvTools.readCsv

source = readCsv("https://media.githubusercontent.com/media/deephaven/examples/main/CryptoCurrencyHistory/CSV/CryptoTrades_20210922.csv")
oc = oneClick(source, "Instrument")
plot = plot("Plot", oc, "Timestamp", "Price").show()

img

Input Filters

To pair your dynamic plot with an Input Filter, navigate to Input Filter in the Controls menu in the upper right-hand corner of the UI, or select Add Input Filters in the console.

img

note

The Input Filter feature filters every open table and dynamic plot in the console.

Linker Tool

Alternatively, you can use the Linker tool to pair the dynamic plot with a table by clicking the Open Linker Tool button in the console or choosing the Linker option from the Controls menu.

img

img

Connect the input column button in the dynamic plot to the matching column in the trigger table. Double-clicking on any row in the trigger table will filter the target (the dynamic plot) to match the input column's value in that row.