Class ChartData

java.lang.Object
io.deephaven.web.client.api.widget.plot.ChartData

@JsType(namespace="dh.plot") public class ChartData extends Object
Helper class to manage snapshots and deltas. Keeps a contiguous JS array of data per column in the underlying table, and supports a mapping function to let client code translate data in some way for display and caches the translated values.
  • Constructor Details

    • ChartData

      public ChartData(JsTable table)
  • Method Details

    • update

      public void update(SubscriptionTableData tableData)
      Updates cached column data to reflect a subscription update.

      This applies row removals, insertions, and modifications to any cached column arrays so they remain aligned with the table's current row order.

      Parameters:
      tableData - the subscription update to apply
    • getColumn

      public elemental2.core.JsArray<jsinterop.base.Any> getColumn(String columnName, JsFunction<jsinterop.base.Any,jsinterop.base.Any> mappingFunc, TableData currentUpdate)
      Returns the cached data for columnName.

      The cache key includes both columnName and mappingFunc. If no cached entry exists, the column data is computed from currentUpdate and stored for future calls.

      If you want subsequent calls to re-use cached data, use the same mappingFunc instance each time.

      Parameters:
      columnName - the column name
      mappingFunc - an optional mapping function applied to each value; null returns the raw column values
      currentUpdate - the table snapshot used to populate the cache when the column is requested for the first time
      Returns:
      a contiguous JS array of values for this column
    • removeColumn

      public void removeColumn(String columnName, JsFunction<jsinterop.base.Any,jsinterop.base.Any> mappingFunc)
      Removes a column from the cache, avoiding extra computation on incoming events, and possibly freeing some memory. If this pair of column name and map function are requested again, it will be recomputed from scratch.