Provides access to data in a table. Note that several methods present their response through Promises. This allows the client to:

  1. Avoid actually connecting to the server until necessary.
  2. Permit some changes not to inform the UI right away that they have taken place.

Hierarchy

  • Table

Implements

Constructors

Properties

description?: string

The table description attribute.

Returns

The description, or null.

layoutHints?: LayoutHints

Layout hints for displaying this table.

pluginName?: string

The plugin name attribute for this table.

Returns

The plugin name, or null.

EVENT_CUSTOMCOLUMNSCHANGED: string

Indicates that columns for this table have changed, and column headers should be updated.

EVENT_DISCONNECT: string

This table has lost its connection to the server. Events will not fire and data will not update until the connection is reestablished, at which point EVENT_RECONNECT will fire. A reconnect will be attempted automatically.

EVENT_FILTERCHANGED: string

Indicates that a filter has occurred, and that the UI should be replaced with the current viewport.

EVENT_RECONNECT: string

This table has reconnected to the server, and data will update again. Any viewport or subscription that was active before the disconnect is restored.

EVENT_RECONNECTFAILED: string

This table failed to reconnect to the server. The event.detail value describes the failure.

EVENT_REQUEST_FAILED: string

Indicates that an error occurred on this table on the server or while communicating with it. The message will provide more insight, but recent operations were likely unsuccessful and may need to be reapplied.

EVENT_REQUEST_SUCCEEDED: string

Indicates that a pending change to this table, such as a new sort or filter, was applied on the server. Any EVENT_SORTCHANGED, EVENT_FILTERCHANGED, or EVENT_CUSTOMCOLUMNSCHANGED resulting from that change fires after this event.

EVENT_ROWADDED: string

Finer grained visibility into data being added, rather than just seeing the currently visible viewport. Provides the row being added, and the offset it will exist at.

EVENT_ROWREMOVED: string

Finer grained visibility into data being removed, rather than just seeing the currently visible viewport. Provides the row being removed, and the offset it used to exist at.

EVENT_ROWUPDATED: string

Finer grained visibility into data being updated, rather than just seeing the currently visible viewport. Provides the row being updated and the offset it exists at.

EVENT_SIZECHANGED: string

The table size has updated, so live scrollbars and the like can be updated accordingly.

EVENT_SORTCHANGED: string

Indicates that a sort has occurred, and that the UI should be replaced with the current viewport.

EVENT_UPDATED: string

event.detail is the currently visible window, the same as if getViewportData was called and resolved. Listening to this event removes the need to listen to the finer grained events below for data changes. In contrast, using the finer grained events may enable only updating the specific rows which saw a change.

SIZE_UNCOALESCED: number

The size the table will have if it is uncoalesced.

Accessors

  • get columns(): Column[]
  • The columns that are present on this table. This is always all possible columns. If you specify fewer columns in setViewport, you will get only those columns in your ViewportData. size is the total count of rows in the table. The size can and will change; see the EVENT_SIZECHANGED event for details. Size will be negative in exceptional cases (eg. the table is uncoalesced, see the Table.uncoalesced property for details).

    Returns Column[]

    Column array

  • get customColumns(): CustomColumn[]
  • An ordered list of custom column formulas to add to the table, either adding new columns or replacing existing ones. To update, call applyCustomColumns.

    Returns CustomColumn[]

  • get filter(): FilterCondition[]
  • An ordered list of filter conditions to apply to the table. To update, call applyFilter. Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for the EVENT_FILTERCHANGED event to know when to update the UI.

    Returns FilterCondition[]

  • get hasInputTable(): boolean
  • true if this table represents a user Input Table (see dh.InputTable). When true, you may call inputTable to add or remove data from the underlying table.

    Returns boolean

  • get isClosed(): boolean
  • true if this table has been closed.

    Returns boolean

    boolean

  • get isRefreshing(): boolean
  • true if this table may receive updates from the server, including size changed events, updated events after initial snapshot.

    Returns boolean

    boolean

  • get isUncoalesced(): boolean
  • Read-only. true if this table is uncoalesced, indicating that work must be done before the table can be used.

    Uncoalesced tables are expensive to operate on - filter to a single partition or range of partitions before subscribing to access only the desired data efficiently. A subscription can be specified without a filter, but this can be very expensive. To see which partitions are available, check each column on the table to see which have isPartitionColumn as `true`, and filter those columns. To read the possible values for those columns, use selectDistinct.

    Returns boolean

    true if the table is uncoaleced and should be filtered before operating on it, otherwise false.

  • get size(): number
  • The total count of rows in the table. If there is a viewport subscription active, this size will be updated when the subscription updates. If not, and Table.uncoalesced is true, the size will be SIZE_UNCOALESCED. Otherwise, the size will be updated when the server's update graph processes changes.

    When the size changes, the EVENT_SIZECHANGED event will be fired.

    Returns number

  • get sort(): Sort[]
  • An ordered list of Sorts to apply to the table. To update, call applySort. Note that this getter will return the new value immediately, even though it may take a little time to update on the server. You may listen for the EVENT_SORTCHANGED event to know when to update the UI.

    Returns Sort[]

  • get totalSize(): number
  • The total count of the rows in the table, excluding any filters. Unlike size, changes to this value will not result in any event. If the table is unfiltered, this will return the same size as size. If this table was uncoalesced before it was filtered, this will return SIZE_UNCOALESCED.

    Returns number

Methods

  • Listen for events on this object.

    Type Parameters

    • T

      The type of the data that the event will provide.

    Parameters

    • name: string

      The name of the event to listen for.

    • callback: ((e) => void)

      A function to call when the event occurs.

        • (e): void
        • Parameters

          Returns void

    Returns (() => void)

    Returns a cleanup function.

      • (): void
      • Listen for events on this object.

        Returns void

        Returns a cleanup function.

  • Used when adding new filter and sort operations to the table, as long as they are present.

    Parameters

    Returns CustomColumn[]

  • Replace the currently set filters on the table. Returns the previously set value. Note that the filter property will immediately return the new value, but you may receive update events using the old filter before the new one is applied, and the EVENT_FILTERCHANGED event fires. Reusing existing, applied filters may enable this to perform better on the server. The EVENT_UPDATED event will also fire, but EVENT_ROWADDED and EVENT_ROWREMOVED will not.

    Parameters

    Returns FilterCondition[]

  • Replace the currently set sort on this table. Returns the previously set value. Note that the sort property will immediately return the new value, but you may receive update events using the old sort before the new sort is applied, and the EVENT_SORTCHANGED event fires. Reusing existing, applied sorts may enable this to perform better on the server. The EVENT_UPDATED event will also fire, but EVENT_ROWADDED and EVENT_ROWREMOVED will not.

    Parameters

    Returns Sort[]

  • Performs an inexact timeseries join, where rows in this table will have columns added from the closest matching row from the right table.

    The `asOfMatchRule` value can be one of:

    • LESS_THAN_EQUAL
    • LESS_THAN
    • GREATER_THAN_EQUAL
    • GREATER_THAN

    Parameters

    • rightTable: JoinableTable

      The table to match to values in this table.

    • columnsToMatch: string[]

      The columns that should match, according to the asOfMatchRole.

    • Optional columnsToAdd: string[]

      Columns from the right table to add to the resulting table, empty/null/absent to add all columns.

    • Optional asOfMatchRule: string

      The match rule to use, see above.

    Returns Promise<Table>

    A promise that will resolve to the joined table.

  • Parameters

    • userCode: ((arg0) => void)
        • (arg0): void
        • Parameters

          • arg0: unknown

          Returns void

    Returns Promise<Table>

  • Alias for partitionBy.

    Parameters

    • keys: object

      The partition key column name or names.

    • Optional dropKeys: boolean

      Whether to drop the key columns from the partitioned constituent tables.

    Returns Promise<PartitionedTable>

    Promise of PartitionedTable.

  • Indicates that this Table instance will no longer be used, and its connection to the server can be cleaned up.

    Returns void

  • Creates a new copy of this table, so it can be sorted and filtered separately, and maintain a different viewport.

    Returns Promise<Table>

    Promise of dh.Table

  • Returns a promise that will resolve to a TableData instance containing a snapshot of the current state of the table, within the bounds of the specified rows and columns.

    Parameters

    Returns Promise<TableData>

  • Creates a subscription to the specified columns, across all rows in the table. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call to createSubscription creates a new subscription, which must have io.deephaven.web.client.api.subscription.AbstractTableSubscription.close called on it to stop it and release its resources, and all events are fired from the TableSubscription instance.

    Parameters

    Returns TableSubscription

    a new TableSubscription

  • A promise that will be resolved with the newly created table holding the results of the specified cross join operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the right table being added to the output. The reserveBits optional parameter lets the client control how the key space is distributed between the rows in the two tables, see the Java Table class for details.

    Parameters

    • rightTable: JoinableTable

      The table to match to values in this table.

    • columnsToMatch: string[]

      The columns that should match exactly.

    • Optional columnsToAdd: string[]

      Columns from the right table to add to the resulting table, empty/null/absent to add all columns.

    • Optional reserveBits: number

      The number of bits of key-space to initially reserve per group, null/absent will let the server select a value.

    Returns Promise<Table>

    A promise that will resolve to the joined table.

  • A promise that will be resolved with the newly created table holding the results of the specified exact join operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the right table being added to the output.

    Parameters

    • rightTable: JoinableTable

      The table to match to values in this table.

    • columnsToMatch: string[]

      The columns that should match exactly.

    • Optional columnsToAdd: string[]

      Columns from the right table to add to the resulting table, empty/null/absent to add all columns.

    Returns Promise<Table>

    A promise that will resolve to the joined table.

  • Retrieve a column by the given name. You should prefer to always retrieve a new Column instance instead of caching a returned value.

    Parameters

    • key: string

    Returns Column

    Column

  • Retrieve multiple columns specified by the given names.

    Parameters

    • keys: string[]

    Returns Column[]

    Column array

  • A "frozen" version of this table (a server-side snapshot of the entire source table). Viewports on the frozen table will not update. This does not change the original table, and the new table will not have any of the client side sorts/filters/columns. New client side sorts/filters/columns can be added to the frozen copy.

    Returns Promise<Table>

    Promise of dh.Table

  • null if no attribute exists, a string if it is an easily serializable attribute value, or a Promise that resolves to a Table if the attribute value is a table.

    Parameters

    • attributeName: string

    Returns unknown

    Object

  • Gets the names of attributes present on this table.

    Returns string[]

    String[] of attribute names.

  • A promise that will resolve to a Totals Table of this table. This table will obey the configurations provided as a parameter, or will use the table's default if no parameter is provided, and be updated once per second as necessary. Note that multiple calls to this method will each produce a new dh.TotalsTable which must have close() called on it when not in use.

    Parameters

    Returns Promise<TotalsTable>

    Promise of dh.TotalsTable

  • Gets the currently visible viewport. If the current set of operations has not yet resulted in data, it will not resolve until that data is ready. If this table is closed before the promise resolves, it will be rejected - to separate the lifespan of this promise from the table itself, call getViewportData on the result from setViewport.

    Returns Promise<ViewportData>

    Promise of TableData

    Deprecated

    use () on the result from #createViewportSubscription(Object) instead.

  • Checks whether any event listeners are registered for the given event name.

    Parameters

    • name: string

      The event name.

    Returns boolean

    true if there is at least one listener registered for name; false otherwise.

  • If hasInputTable is true, you may call this method to gain access to an InputTable object which can be used to mutate the data within the table. If the table is not an Input Table, the promise will be immediately rejected.

    Returns Promise<InputTable>

  • Checks whether this table is a blink table.

    Returns boolean

    true if this table is a blink table; false otherwise.

  • Joins this table to the provided table, using one of the specified join types:

    • `AJ`, `ReverseAJ` (or `RAJ`) - Inexact timeseries joins, based on the provided matching rule.
    • `CROSS_JOIN` (or `Join`) - Cross join of all rows that have matching values in both tables.
    • `EXACT_JOIN` (or `ExactJoin`) - Matches values in exactly one row in the right table, with errors if there is not exactly one.
    • `NATURAL_JOIN` (or `Natural`) - Matches values in at most one row in the right table, with nulls if there is no match or errors if there are multiple matches.

    Note that Left join is not supported here, unlike DHE.

    See the Choose a join method document for more guidance on picking a join operation.

    Parameters

    • joinType: string

      The type of join to perform, see the list above.

    • rightTable: JoinableTable

      The table to match to values in this table.

    • columnsToMatch: string[]

      Columns that should match.

    • Optional columnsToAdd: string[]

      Columns from the right table to add to the result - empty/null/absent to add all columns.

    • Optional asOfMatchRule: string

      If joinType is AJ/RAJ/ReverseAJ, the match rule to use.

    Returns Promise<Table>

    A promise that will resolve to the joined table.

    Deprecated

    Instead, call the specific method for the join type.

  • A promise that will be resolved with the newly created table holding the results of the specified natural join operation. The columnsToAdd parameter is optional, not specifying it will result in all columns from the right table being added to the output.

    Parameters

    • rightTable: JoinableTable

      The table to match to values in this table.

    • columnsToMatch: string[]

      The columns that should match exactly.

    • Optional columnsToAdd: string[]

      Columns from the right table to add to the resulting table. Empty/null/absent to add all columns.

    Returns Promise<Table>

    A promise that will resolve to the joined table.

  • Returns a promise that resolves the next time the named event occurs, with the value of the event's detail. If a timeout is specified and occurs before the event takes place, the promise will reject, otherwise waits indefinitely.

    Type Parameters

    • T

      The type of the event detail.

    Parameters

    • eventName: string

      The event name.

    • Optional timeoutInMillis: number

      Optional timeout in milliseconds.

    Returns Promise<Event<T>>

    A promise that resolves with the next matching event.

  • Removes an event listener added to this table.

    Type Parameters

    • T

    Parameters

    • name: string
    • callback: ((e) => void)
        • (e): void
        • Parameters

          Returns void

    Returns boolean

  • Seek the row matching the data provided

    Parameters

    • startingRow: number

      Row to start the seek from

    • column: Column

      Column to seek for value on

    • valueType: string

      Type of value provided

    • seekValue: any

      Value to seek

    • Optional insensitive: boolean

      Optional value to flag a search as case-insensitive. Defaults to false.

    • Optional contains: boolean

      Optional value to have the seek value do a contains search instead of exact equality. Defaults to false.

    • Optional isBackwards: boolean

      Optional value to seek backwards through the table instead of forwards. Defaults to false.

    Returns Promise<number>

    A promise that resolves to the row value found.

  • A new table containing the distinct tuples of values from the given columns that are present in the original table. This table can be manipulated as any other table. Sorting is often desired as the default sort is the order of appearance of values from the original table.

    Parameters

    Returns Promise<Table>

    Promise of dh.Table

  • If the columns parameter is not provided, all columns will be used. If the updateIntervalMs parameter is not provided, a default of one second will be used. Until this is called, no data will be available. Invoking this will result in events to be fired once data becomes available, starting with an updated event and a rowadded event per row in that range. The returned object allows the viewport to be closed when no longer needed.

    Parameters

    • firstRow: number
    • lastRow: number
    • Optional columns: Column[]
    • Optional updateIntervalMs: number
    • Optional isReverseViewport: boolean

    Returns TableViewportSubscription

    Deprecated

    Use #createViewportSubscription(Object) instead.

  • Creates a server-side snapshot of baseTable when this table updates.

    Parameters

    • baseTable: Table

      The table to snapshot.

    • Optional doInitialSnapshot: boolean

      Whether to create an initial snapshot immediately.

    • Optional stampColumns: string[]

      Optional list of column names to include in the result.

    Returns Promise<Table>

    A promise that resolves to the snapshot table.

  • Creates a subscription to the specified columns, across all rows in the table. The optional parameter updateIntervalMs may be specified to indicate how often the server should send updates, defaulting to one second if omitted. Useful for charts or taking a snapshot of the table atomically. The initial snapshot will arrive in a single event, but later changes will be sent as updates. However, this may still be very expensive to run from a browser for very large tables. Each call to subscribe creates a new subscription, which must have io.deephaven.web.client.api.subscription.AbstractTableSubscription.close called on it to stop it, and all events are fired from the TableSubscription instance.

    Parameters

    • columns: Column[]
    • Optional updateIntervalMs: number

    Returns TableSubscription

    Deprecated

    Use #createSubscription(Object) with a DataOptions.SubscriptionOptions instead.

  • Gets a string representation of this table instance.

    Returns string

    A string representation of this table.

  • A Sort that can be used to reverse a table. This can be passed into an array in applySort. Note that Tree Tables do not support reverse.

    Returns Sort

    Sort