Provides access to data in a table. Note that several methods present their response through Promises. This allows the client to both avoid actually connecting to the server until necessary, and also will permit some changes not to inform the UI right away that they have taken place.

Hierarchy

  • Table

Implements

Constructors

Properties

description?: string
layoutHints?: LayoutHints
pluginName?: string
EVENT_CUSTOMCOLUMNSCHANGED: string
EVENT_DISCONNECT: string
EVENT_FILTERCHANGED: string
EVENT_RECONNECT: string
EVENT_RECONNECTFAILED: string
EVENT_REQUEST_FAILED: string
EVENT_REQUEST_SUCCEEDED: string
EVENT_ROWADDED: string
EVENT_ROWREMOVED: string
EVENT_ROWUPDATED: string
EVENT_SIZECHANGED: string
EVENT_SORTCHANGED: string
EVENT_UPDATED: string
SIZE_UNCOALESCED: number

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. Number size The total count of rows in the table. The size can and will change; see the sizechanged event for details. Size will be negative in exceptional cases (eg. the table is uncoalesced, see the isUncoalesced 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[]

    CustomColumn array

  • get filter(): FilterCondition[]
  • An ordered list of Filters 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 filterchanged event to know when to update the UI.

    Returns FilterCondition[]

    FilterCondition array

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

    Returns boolean

    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. Set a viewport or filter on the partition columns to coalesce the table. Check the isPartitionColumn property on the table columns to retrieve the partition columns. Size will be unavailable until table is coalesced.

    Returns boolean

    boolean

  • get size(): number
  • The total count of rows in the table. The size can and will change; see the sizechanged event for details. Size will be negative in exceptional cases (e.g., the table is uncoalesced; see the isUncoalesced property). for details).

    Returns number

    double

  • 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 sortchanged event to know when to update the UI.

    Returns Sort[]

    Sort array

  • 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. 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 sortchanged event to know when to update the UI.

    Returns number

    double

  • get totalsTableConfig(): TotalsTableConfig
  • The default configuration to be used when building a TotalsTable for this table.

    Returns TotalsTableConfig

    dh.TotalsTableConfig

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

          • e: CustomEvent<T>

          Returns void

    Returns (() => void)

    Returns a cleanup function.

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

        Returns void

        Returns a cleanup function.

  • 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 filterchanged event fires. Reusing existing, applied filters may enable this to perform better on the server. The updated event will also fire, but rowadded and rowremoved will not.

    Parameters

    Returns FilterCondition[]

    FilterCondition array

  • 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 sortchanged event fires. Reusing existing, applied sorts may enable this to perform better on the server. The updated event will also fire, but rowadded and rowremoved will not.

    Parameters

    Returns Sort[]

    Sort array

  • 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>

  • 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

  • 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 property exists, a string if it is an easily serializable property, or a Promise &lt;Table&gt; that will either resolve with a table or error out if the object can't be passed to JS.

    Parameters

    • attributeName: string

    Returns unknown

    Object

  • Returns string[]

  • a promise that will resolve to ColumnStatistics for the column of this table.

    Parameters

    Returns Promise<ColumnStatistics>

    Promise of dh.ColumnStatistics

  • a promise that will resolve to a Totals Table of this table, ignoring any filters. See getTotalsTable() above for more specifics.

    Parameters

    Returns Promise<TotalsTable>

    promise of dh.TotalsTable

  • 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 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<TableData>

    Promise of TableData

  • 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>

    Promise of dh.InputTable

  • Returns boolean

  • 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

  • Type Parameters

    • T

    Parameters

    • eventName: string
    • Optional timeoutInMillis: number

    Returns Promise<CustomEvent<T>>

  • Creates a new PartitionedTable from the contents of the current table, partitioning data based on the specified keys.

    Parameters

    • keys: object
    • Optional dropKeys: boolean

    Returns Promise<PartitionedTable>

    Promise dh.PartitionedTable

  • Removes an event listener added to this table.

    Type Parameters

    • T

    Parameters

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

          • e: CustomEvent<T>

          Returns void

    Returns boolean

  • a promise that will resolve to a new roll-up TreeTable of this table. Multiple calls to this method will each produce a new TreeTable which must have close() called on it when not in use.

    Parameters

    Returns Promise<TreeTable>

    Promise of dh.TreeTable

  • 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

    Returns TableViewportSubscription

    TableViewportSubscription

  • Parameters

    • baseTable: Table
    • Optional doInitialSnapshot: boolean
    • Optional stampColumns: string[]

    Returns Promise<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 close() called on it to stop it, and all events are fired from the TableSubscription instance.

    Parameters

    • columns: Column[]
    • Optional updateIntervalMs: number

    Returns TableSubscription

    TableSubscription

  • Returns string

  • a promise that will resolve to a new TreeTable of this table. Multiple calls to this method will each produce a new TreeTable which must have close() called on it when not in use.

    Parameters

    Returns Promise<TreeTable>

    Promise dh.TreeTable

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

    Returns Sort

    Sort