Skip to main content

Grid

High-performance, flexible spreadsheet control

Extends

Constructors

new Grid()

new Grid(dart): Grid

Parameters

ParameterType
dartany

Returns

Grid

Overrides

Viewer . constructor

Source

src/grid.ts:835

Properties

PropertyModifierTypeDefault valueDescriptionInherited from
_propertiesprotectedProperty[]undefined-Viewer._properties
_rootprotectedHTMLElementundefined-Viewer._root
dartpublicanyundefined-Viewer.dart
factorypublicnull | FuncnullConstructor function. No parameters, returns [Widget].Viewer.factory
filterpublicBitSet...-Viewer.filter
isDetachedpublicbooleanfalse-Viewer.isDetached
propspublicIGridSettings & ObjectPropertyBagundefined-Viewer.props
subspublicSubscription[]undefined-Viewer.subs
tagspublicanyundefined-Viewer.tags
temppublicanyundefinedContains auxiliary informationViewer.temp

Accessors

canvas

get canvas(): HTMLCanvasElement

Returns

HTMLCanvasElement

Source

src/grid.ts:880


colHeaderBox

get colHeaderBox(): Rect

Column labels box

Returns

Rect

Source

src/grid.ts:1002


colHeaderHeight

get colHeaderHeight(): number

Column labels height

Returns

number

Source

src/grid.ts:994


columns

get columns(): GridColumnList

Grid columns.

Returns

GridColumnList

Source

src/grid.ts:856


dataFrame

get dataFrame(): DataFrame

set dataFrame(t): void

Parameters

ParameterType
tDataFrame

Returns

DataFrame

Source

src/viewer.ts:148


helpUrl

get helpUrl(): string

Help URL

set helpUrl(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/viewer.ts:152


horzScroll

get horzScroll(): RangeSlider

Horizontal scroll bar

Returns

RangeSlider

Source

src/grid.ts:989


meta

get meta(): ViewerMetaHelper

Returns

ViewerMetaHelper

Source

src/viewer.ts:121


onAfterDrawContent

get onAfterDrawContent(): Observable <EventData<any>>

Returns

Observable <EventData<any>>

Source

src/grid.ts:1040


onAfterDrawOverlay

get onAfterDrawOverlay(): Observable <EventData<any>>

Returns

Observable <EventData<any>>

Source

src/grid.ts:1038


onBeforeDrawContent

get onBeforeDrawContent(): Observable <EventData<any>>

Returns

Observable <EventData<any>>

Source

src/grid.ts:1039


onBeforeDrawOverlay

get onBeforeDrawOverlay(): Observable <EventData<any>>

Returns

Observable <EventData<any>>

Source

src/grid.ts:1037


onCellClick

get onCellClick(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1031


onCellDoubleClick

get onCellDoubleClick(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1032


onCellKeyDown

get onCellKeyDown(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1034


onCellMouseDown

get onCellMouseDown(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1033


onCellMouseEnter

get onCellMouseEnter(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1028


onCellMouseLeave

get onCellMouseLeave(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1029


onCellRender

get onCellRender(): Observable <GridCellRenderArgs>

Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-rendering-indexes

Returns

Observable <GridCellRenderArgs>

Source

src/grid.ts:875


onCellValueEdited

get onCellValueEdited(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1026


onColumnResized

get onColumnResized(): Observable<any>

Sample: https://public.datagrok.ai/js/samples/grid/resize-events

Returns

Observable<any>

Source

src/grid.ts:1015


onContextMenu

get onContextMenu(): Observable <Menu>

Returns

Observable <Menu>

Source

src/viewer.ts:248


onCurrentCellChanged

get onCurrentCellChanged(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1027


onDartPropertyChanged

get onDartPropertyChanged(): Observable<null>

Returns

Observable<null>

Source

src/viewer.ts:274


onDataEvent

get onDataEvent(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:50


onDataRowClicked

get onDataRowClicked(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:54


onDataSelected

get onDataSelected(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:52


onGridCellLinkClicked

get onGridCellLinkClicked(): Observable <EventData <GridCellArgs>>

Returns

Observable <EventData <GridCellArgs>>

Source

src/grid.ts:1042


onPinnedRowsChanged

get onPinnedRowsChanged(): Observable<any>

Returns

Observable<any>

Source

src/grid.ts:1024


onPropertyValueChanged

get onPropertyValueChanged(): Observable <EventData <Property>>

Returns

Observable <EventData <Property>>

Source

src/viewer.ts:55


onRowEnter

get onRowEnter(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1035


onRowsResized

get onRowsResized(): Observable<any>

Sample: https://public.datagrok.ai/js/samples/grid/resize-events

Returns

Observable<any>

Source

src/grid.ts:1020


onRowsSorted

get onRowsSorted(): Observable<any>

Sample: https://public.datagrok.ai/js/samples/grid/order-rows

Returns

Observable<any>

Source

src/grid.ts:1023


onTooltipCreated

get onTooltipCreated(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:51


overlay

get overlay(): HTMLCanvasElement

Returns

HTMLCanvasElement

Source

src/grid.ts:885


pinnedRows

get pinnedRows(): Iterable<number>

Pinned rows.

Returns

Iterable<number>

Source

src/grid.ts:952


root

get root(): HTMLElement

Visual root.

Returns

HTMLElement

Source

src/viewer.ts:117


sortByColumns

get sortByColumns(): Column<any>[]

List of columns the grid is sorted by.

Returns

Column<any>[]

Source

src/grid.ts:890


sortTypes

get sortTypes(): boolean[]

Sort directions for [sortByColumns]: true = ascending order, false = descending order.

Returns

boolean[]

Source

src/grid.ts:893


table

get table(): DataFrame

Returns

DataFrame

Source

src/viewer.ts:133


tableView

get tableView(): null | TableView

Returns a view this viewer is associated with, or null

Returns

null | TableView

Source

src/viewer.ts:143


type

get type(): string

Returns viewer type (see VIEWER constants)

Returns

string

Source

src/viewer.ts:129


vertScroll

get vertScroll(): RangeSlider

Vertical scroll bar. Sample: https://public.datagrok.ai/js/samples/grid/scroll-bars

Returns

RangeSlider

Source

src/grid.ts:978


view

get view(): null | View

Returns a view this viewer is associated with, or null

Returns

null | View

Source

src/viewer.ts:138

Methods

addProperty()

private addProperty(propertyName, propertyType, defaultValue, options): any

Registers an property with the specified type, name, and defaultValue.

Parameters

ParameterTypeDefault valueDescription
propertyNamestringundefined
propertyType"string" | "bigint" | "object" | "map" | "file" | "view" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | "num" | "string_list" | "dataframe_list" | "cell" | "column" | "column_list" | "graphics" | "tablerowfiltercall" | "colfiltercall" | "bitset" | "dynamic" | "viewer" | "list" | "semantic_value" | "func" | "funccall" | "property" | "categorical" | "numerical" | "GridCellRenderArgs" | "element" | "TableView" | "User" | "Menu" | "Project" | "event_data" | "progressindicator" | "Credentials" | "ScriptEnvironment" | "Notebook"undefined
defaultValueanynull
optionsnull | object & PropertyOptionsnull

Returns

any

Inherited from

Viewer . addProperty

See

Registered property gets added to properties. Returns default value, thus allowing to combine registering a property with the initialization

Source

src/widgets.ts:312


apply()

apply(properties): Widget<any>

Parameters

ParameterTypeDescription
propertiesobject

Returns

Widget<any>

Inherited from

Viewer . apply

Source

src/widgets.ts:262


autoSize()

autoSize(maxWidth, maxHeight, minWidth?, minHeight?, autoSizeOnDataChange?): void

Resizes the grid to fit the content

Parameters

ParameterType
maxWidthnumber
maxHeightnumber
minWidth?number
minHeight?number
autoSizeOnDataChange?boolean

Returns

void

Source

src/grid.ts:1050


cell()

cell(columnName, gridRow): GridCell

Returns a grid cell at the specified position.

Parameters

ParameterType
columnNamestring
gridRownumber

Returns

GridCell

Source

src/grid.ts:868


close()

close(): void

Closes and detaches the viewer.

Returns

void

Inherited from

Viewer . close

Source

src/viewer.ts:111


col()

col(name): null | GridColumn

Returns a column with the specified name.

Parameters

ParameterTypeDescription
namestring

Returns

null | GridColumn

Source

src/grid.ts:863


copyViewersLook()

copyViewersLook(other): void

Parameters

ParameterType
otherViewer<any>

Returns

void

Inherited from

Viewer . copyViewersLook

Source

src/viewer.ts:288


detach()

detach(): void

Gets called when a widget is detached and will no longer be used. Typically used for unsubscribing from events. Be sure to call super.detach() if this method is overridden.

Returns

void

Inherited from

Viewer . detach

Source

src/widgets.ts:296


getDartProperties()

getDartProperties(): any[]

Returns

any[]

Inherited from

Viewer . getDartProperties

Source

src/widgets.ts:278


getInfo()

getInfo(): object

Returns

object

Inherited from

Viewer . getInfo

Source

src/viewer.ts:102


getOptions()

getOptions(includeDefaults): object

Gets the serialized viewer options. [includeDefaults] flag specifies whether the properties with the default values should be returned. Not including default properties makes it more clean and efficient for serialization purposes.

See also setOptions Sample: https://public.datagrok.ai/js/samples/ui/viewers/types/scatter-plot

Parameters

ParameterTypeDefault value
includeDefaultsbooleanfalse

Returns

object

MemberType
idstring
lookobject
typestring

Inherited from

Viewer . getOptions

Source

src/viewer.ts:98


getProperties()

getProperties(): Property[]

Returns

Property[]

Inherited from

Viewer . getProperties

Source

src/viewer.ts:106


getRowOrder()

getRowOrder(): Int32Array

Returns the order of rows in the table.

Returns

Int32Array

Source

src/grid.ts:938


getVisibleCells()

getVisibleCells(column): Iterable <GridCell>

Returns currently visible cells

Parameters

ParameterTypeDefault value
columnnull | GridColumnnull

Returns

Iterable <GridCell>

Source

src/grid.ts:1045


gridRowToTable()

gridRowToTable(gridRow): number

Converts grid row index to table index. See also tableRowToGrid

Parameters

ParameterType
gridRownumber

Returns

number

Source

src/grid.ts:986


hitTest()

hitTest(x, y): null | GridCell

Returns a grid cell at the specified position, or null if there is none. Sample: https://public.datagrok.ai/js/samples/grid/hit-test

Parameters

ParameterType
xnumber
ynumber

Returns

null | GridCell

Source

src/grid.ts:915


initDartObject()

initDartObject(dart): void

Parameters

ParameterType
dartany

Returns

void

Inherited from

Viewer . initDartObject

Source

src/viewer.ts:57


invalidate()

invalidate(): void

Causes the grid to repaint. Sample: https://public.datagrok.ai/js/samples/grid/advanced/invalidate

Returns

void

Source

src/grid.ts:973


onCellPrepare()

onCellPrepare(callback): StreamSubscription

Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-prepare

Parameters

ParameterType
callback(cell) => any

Returns

StreamSubscription

Source

src/grid.ts:898


onCellTooltip()

onCellTooltip(callback): StreamSubscription

Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-tooltip

Parameters

ParameterType
callback(cell, x, y) => any

Returns

StreamSubscription

Source

src/grid.ts:907


onEvent()

onEvent(eventId): Observable<any>

Observes platform events with the specified eventId.

Parameters

ParameterTypeDefault value
eventIdnull | stringnull

Returns

Observable<any>

Inherited from

Viewer . onEvent

Source

src/viewer.ts:253


onFrameAttached()

onFrameAttached(dataFrame): void

Parameters

ParameterType
dataFrameDataFrame

Returns

void

Inherited from

Viewer . onFrameAttached

Source

src/widgets.ts:284


onPropertyChanged()

onPropertyChanged(property): void

Gets called when viewer's property is changed.

Parameters

ParameterTypeDescription
propertynull | Propertyor null, if multiple properties were changed.

Returns

void

Inherited from

Viewer . onPropertyChanged

Source

src/widgets.ts:276


removeFromView()

removeFromView(): any

Returns

any

Inherited from

Viewer . removeFromView

Source

src/viewer.ts:292


resetRowHeight()

resetRowHeight(): void

Resets rows height

Returns

void

Source

src/grid.ts:999


runPostponedComputations()

runPostponedComputations(): void

Forces the grid to execute calculations that were postponed before the next rendering (such as recalculating layout). Call it in case the client code changes column widths and needs to access the new recalculated layout.

Returns

void

Source

src/grid.ts:1008


scrollToCell()

scrollToCell(column, row): void

Returns a grid cell at the specified position. Sample: https://public.datagrok.ai/js/samples/grid/scroll-to-cell

Parameters

ParameterType
columnstring | Column<any>
rownumber

Returns

void

Source

src/grid.ts:959


scrollToPixels()

scrollToPixels(x, y): void

Scrolls the grid to the specified position. Sample: https://public.datagrok.ai/js/samples/grid/scroll-to-pixels

Parameters

ParameterType
xnumber
ynumber

Returns

void

Source

src/grid.ts:966


setOptions()

setOptions(map): void

Sets viewer options. See also getOptions Sample: https://public.datagrok.ai/js/samples/ui/viewers/types/scatter-plot

Parameters

ParameterTypeDescription
mapobject
map.type?string-

Returns

void

Inherited from

Viewer . setOptions

Source

src/viewer.ts:86


setRowOrder()

setRowOrder(indexes): Grid

Sets the order or rows in the table. Sample: https://public.datagrok.ai/js/samples/grid/order-rows Also,

Parameters

ParameterType
indexesnumber[]

Returns

Grid

See

sortIndexes

Source

src/grid.ts:945


sort()

sort(columns, orders): Grid

Sorts rows by the specified [columnIds]. Specify sort directions via [asc] array (true = ascending, false = descending) If [asc] is not specified, sorts in ascending order.

Parameters

ParameterTypeDefault value
columnsstring[] | Column<any>[]undefined
ordersnull | boolean[]null

Returns

Grid

Source

src/grid.ts:922


sortIndexes()

sortIndexes(indexComparer): Grid

Sorts the rows, using the specified comparer that accepts indexes. Sample: https://public.datagrok.ai/js/samples/grid/order-rows-by-comparer Also,

Parameters

ParameterType
indexComparer(a, b) => number

Returns

Grid

See

setRowOrder

Source

src/grid.ts:930


sourceRowsChanged()

sourceRowsChanged(): void

Returns

void

Inherited from

Viewer . sourceRowsChanged

Source

src/widgets.ts:282


sub()

sub(subscription): void

Registers a subscription to an external event.

Parameters

ParameterTypeDescription
subscriptionSubscription

Returns

void

Inherited from

Viewer . sub

Source

src/widgets.ts:255


tableRowToGrid()

tableRowToGrid(tableRow): number

Converts table row index to grid index. See also gridRowToTable

Parameters

ParameterType
tableRownumber

Returns

number

Source

src/grid.ts:983


toCompactLook()

toCompactLook(): void

Returns

void

Inherited from

Viewer . toCompactLook

Source

src/viewer.ts:270


toDart()

toDart(): any

Returns

any

Inherited from

Viewer . toDart

Source

src/widgets.ts:247


barChart()

static barChart(t, options?): Viewer <IBarChartSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IBarChartSettings>

Returns

Viewer <IBarChartSettings>

Inherited from

Viewer . barChart

Source

src/viewer.ts:163


boxPlot()

static boxPlot(t, options?): Viewer <IBoxPlotSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IBoxPlotSettings>

Returns

Viewer <IBoxPlotSettings>

Inherited from

Viewer . boxPlot

Source

src/viewer.ts:171


calendar()

static calendar(t, options?): Viewer <ICalendarSettings>

Parameters

ParameterType
tDataFrame
options?Partial <ICalendarSettings>

Returns

Viewer <ICalendarSettings>

Inherited from

Viewer . calendar

Source

src/viewer.ts:191


correlationPlot()

static correlationPlot(t, options?): Viewer <ICorrelationPlotSettings>

Parameters

ParameterType
tDataFrame
options?Partial <ICorrelationPlotSettings>

Returns

Viewer <ICorrelationPlotSettings>

Inherited from

Viewer . correlationPlot

Source

src/viewer.ts:195


create()

static create(table): Grid

Creates a new grid.

Parameters

ParameterType
tableobject
table.dartany

Returns

Grid

Source

src/grid.ts:840


densityPlot()

static densityPlot(t, options?): Viewer <IDensityPlotSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IDensityPlotSettings>

Returns

Viewer <IDensityPlotSettings>

Inherited from

Viewer . densityPlot

Source

src/viewer.ts:199


filters()

static filters(t, options?): Viewer <IFiltersSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IFiltersSettings>

Returns

Viewer <IFiltersSettings>

Inherited from

Viewer . filters

Source

src/viewer.ts:175


find()

static find(root): null | Widget<any>

Finds existing widget from its visual root.

Parameters

ParameterType
rootElement

Returns

null | Widget<any>

Inherited from

Viewer . find

Source

src/widgets.ts:243


form()

static form(t, options?): Viewer <IFormSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IFormSettings>

Returns

Viewer <IFormSettings>

Inherited from

Viewer . form

Source

src/viewer.ts:203


fromProperties()

static fromProperties(items, props): Grid

Creates a new grid from a list of items (rows) and their properties (columns)

Parameters

ParameterType
itemsany[]
propsProperty[]

Returns

Grid

Source

src/grid.ts:845


fromRoot()

static fromRoot(root): Widget<any>

Creates a new widget from the root element.

Parameters

ParameterType
rootHTMLElement

Returns

Widget<any>

Inherited from

Viewer . fromRoot

Source

src/widgets.ts:335


fromType()

static fromType(viewerType, table, options): Viewer<any>

Creates a new viewer of the specified type.

Parameters

ParameterTypeDefault valueDescription
viewerTypestringundefined
tableDataFrameundefined
optionsnull | objectnull

Returns

Viewer<any>

Inherited from

Viewer . fromType

Source

src/viewer.ts:73


getAll()

static getAll(): Widget<any>[]

Returns all currently active widgets.

Returns

Widget<any>[]

Inherited from

Viewer . getAll

Source

src/widgets.ts:238


getViewerTypes()

static getViewerTypes(): string[]

Returns

string[]

Inherited from

Viewer . getViewerTypes

Source

src/viewer.ts:77


grid()

static grid(t, options?): Grid

Parameters

ParameterType
tDataFrame
options?Partial <IGridSettings>

Returns

Grid

Inherited from

Viewer . grid

Source

src/viewer.ts:155


heatMap()

static heatMap(t, options?): Viewer <IGridSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IGridSettings>

Returns

Viewer <IGridSettings>

Inherited from

Viewer . heatMap

Source

src/viewer.ts:167


histogram()

static histogram(t, options?): Viewer <IHistogramSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IHistogramSettings>

Returns

Viewer <IHistogramSettings>

Inherited from

Viewer . histogram

Source

src/viewer.ts:159


lineChart()

static lineChart(t, options?): Viewer <ILineChartSettings>

Parameters

ParameterType
tDataFrame
options?Partial <ILineChartSettings>

Returns

Viewer <ILineChartSettings>

Inherited from

Viewer . lineChart

Source

src/viewer.ts:183


markup()

static markup(t, options?): Viewer <IMarkupViewerSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IMarkupViewerSettings>

Returns

Viewer <IMarkupViewerSettings>

Inherited from

Viewer . markup

Source

src/viewer.ts:207


matrixPlot()

static matrixPlot(t, options?): Viewer <IMatrixPlotSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IMatrixPlotSettings>

Returns

Viewer <IMatrixPlotSettings>

Inherited from

Viewer . matrixPlot

Source

src/viewer.ts:211


network()

static network(t, options?): Viewer <INetworkDiagramSettings>

Parameters

ParameterType
tDataFrame
options?Partial <INetworkDiagramSettings>

Returns

Viewer <INetworkDiagramSettings>

Inherited from

Viewer . network

Source

src/viewer.ts:187


pcPlot()

static pcPlot(t, options?): Viewer <IPcPlotSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IPcPlotSettings>

Returns

Viewer <IPcPlotSettings>

Inherited from

Viewer . pcPlot

Source

src/viewer.ts:215


pieChart()

static pieChart(t, options?): Viewer <IPieChartSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IPieChartSettings>

Returns

Viewer <IPieChartSettings>

Inherited from

Viewer . pieChart

Source

src/viewer.ts:219


scatterPlot()

static scatterPlot(t, options?): ScatterPlotViewer

Parameters

ParameterType
tDataFrame
options?Partial <IScatterPlotSettings>

Returns

ScatterPlotViewer

Inherited from

Viewer . scatterPlot

Source

src/viewer.ts:179


scatterPlot3d()

static scatterPlot3d(t, options?): Viewer <IScatterPlot3dSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IScatterPlot3dSettings>

Returns

Viewer <IScatterPlot3dSettings>

Inherited from

Viewer . scatterPlot3d

Source

src/viewer.ts:223


statistics()

static statistics(t, options?): Viewer <IStatsViewerSettings>

Parameters

ParameterType
tDataFrame
options?Partial <IStatsViewerSettings>

Returns

Viewer <IStatsViewerSettings>

Inherited from

Viewer . statistics

Source

src/viewer.ts:227


tile()

static tile(t, options?): Viewer <ITileViewerSettings>

Parameters

ParameterType
tDataFrame
options?Partial <ITileViewerSettings>

Returns

Viewer <ITileViewerSettings>

Inherited from

Viewer . tile

Source

src/viewer.ts:231


treeMap()

static treeMap(t, options?): Viewer <ITreeMapSettings>

Parameters

ParameterType
tDataFrame
options?Partial <ITreeMapSettings>

Returns

Viewer <ITreeMapSettings>

Inherited from

Viewer . treeMap

Source

src/viewer.ts:235


trellisPlot()

static trellisPlot(t, options?): Viewer <ITrellisPlotSettings>

Parameters

ParameterType
tDataFrame
options?Partial <ITrellisPlotSettings>

Returns

Viewer <ITrellisPlotSettings>

Inherited from

Viewer . trellisPlot

Source

src/viewer.ts:239


wordCloud()

static wordCloud(t, options?): Viewer<any>

Parameters

ParameterType
tDataFrame
options?any

Returns

Viewer<any>

Inherited from

Viewer . wordCloud

Deprecated

Source

src/viewer.ts:244