diff --git a/src/Deeptable.ts b/src/Deeptable.ts index d6f705d73..9d07536d5 100644 --- a/src/Deeptable.ts +++ b/src/Deeptable.ts @@ -290,14 +290,19 @@ export class Deeptable { } /** - * Generate an ArrowDeeptable from a single Arrow table. + * Generate a deeptable from a single Arrow table. * * @param table A single Arrow table * @param prefs The API Call to use for rendering. - * @param plot The Scatterplot to use. + * @param plot Optionally: the scatterplot to bind the deeptable to. + * If null, the deeptable can be used independently (including in node environments), + * or bound to a scatterplot later. * @returns */ - static fromArrowTable(table: Table, plot: Scatterplot): Deeptable { + static fromArrowTable( + table: Table, + plot: Scatterplot | null = null, + ): Deeptable { return wrapArrowTable(tableToIPC(table), plot); } diff --git a/src/wrap_arrow.ts b/src/wrap_arrow.ts index bbacf6e67..192b98421 100644 --- a/src/wrap_arrow.ts +++ b/src/wrap_arrow.ts @@ -15,10 +15,16 @@ import type * as DS from './types'; import { extent } from 'd3-array'; import { Rectangle } from './tile'; -// This function is used to wrap an arrow table into a -// deeptable so that record batches can be fetched asynchronously. -// The point display order is the same as in the original file. -// It is exposed primarily as Deeptable.from +/** + * This function is used to wrap an arrow table into a + * deeptable so that record batches can be fetched asynchronously. + * The point display order is the same as in the original file. + * It is exposed primarily as Deeptable.fromArrowTable + * @param tbArray a Uint8 Array that deserializes to an Arrow table. incompatibility between Arrow + * versions makes it easier to simple force this transformation. + * @param plot Optionally, a Scatterplot. + * @returns + */ export function wrapArrowTable( tbArray: Uint8Array, plot: Scatterplot | null,