Function: toTable()
ts
function toTable(data): Table;Normalize any DataInput into a Table.
- Rows (
[{ a: 1, b: 'x' }, …]): columns are the keys of all rows, in first-seen order; a row without a key hasundefinedthere. - Columns (
{ a: [...], b: [...] }): typed arrays are copied into plain arrays; all columns must be equally long. - Arrow tables (anything with
numRows,schema.fieldsandgetChild(name)): one column per schema field; bigints become numbers. - A Table is returned as is;
null/undefinedgive an empty table (then every column must be given as an array in the options, as px allows).
Parameters
| Parameter | Type |
|---|---|
data | DataInput | null | undefined |
Returns
Throws
For other inputs and for columns of different lengths.