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:843

Properties

PropertyModifierTypeDefault valueDescriptionInherited from
_propertiesprotectedProperty[]undefined-Viewer._properties
_rootprotectedHTMLElementundefined-Viewer._root
dartpublicanyundefined-Viewer.dart
factorypublicnull | FuncnullConstructor function. No parameters, returns [Widget].Viewer.factory
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:888


colHeaderBox

get colHeaderBox(): Rect

Column labels box

Returns

Rect

Source

src/grid.ts:1010


colHeaderHeight

get colHeaderHeight(): number

Column labels height

Returns

number

Source

src/grid.ts:1002


columns

get columns(): GridColumnList

Grid columns.

Returns

GridColumnList

Source

src/grid.ts:864


dataFrame

get dataFrame(): DataFrame

set dataFrame(t): void

Parameters

ParameterType
tDataFrame

Returns

DataFrame

Source

src/viewer.ts:155


filter

get filter(): BitSet

combined filter of the viewer

set filter(f): void

Parameters

ParameterType
fBitSet

Returns

BitSet

Source

src/viewer.ts:51


helpUrl

get helpUrl(): string

Help URL

set helpUrl(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/viewer.ts:159


horzScroll

get horzScroll(): RangeSlider

Horizontal scroll bar

Returns

RangeSlider

Source

src/grid.ts:997


meta

get meta(): ViewerMetaHelper

Returns

ViewerMetaHelper

Source

src/viewer.ts:128


onAfterDrawContent

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

Returns

Observable <EventData<any>>

Source

src/grid.ts:1048


onAfterDrawOverlay

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

Returns

Observable <EventData<any>>

Source

src/grid.ts:1046


onBeforeDrawContent

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

Returns

Observable <EventData<any>>

Source

src/grid.ts:1047


onBeforeDrawOverlay

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

Returns

Observable <EventData<any>>

Source

src/grid.ts:1045


onCellClick

get onCellClick(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1039


onCellDoubleClick

get onCellDoubleClick(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1040


onCellKeyDown

get onCellKeyDown(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1042


onCellMouseDown

get onCellMouseDown(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1041


onCellMouseEnter

get onCellMouseEnter(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1036


onCellMouseLeave

get onCellMouseLeave(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1037


onCellRender

get onCellRender(): Observable <GridCellRenderArgs>

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

Returns

Observable <GridCellRenderArgs>

Source

src/grid.ts:883


onCellValueEdited

get onCellValueEdited(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1034


onColumnResized

get onColumnResized(): Observable<any>

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

Returns

Observable<any>

Source

src/grid.ts:1023


onContextMenu

get onContextMenu(): Observable <Menu>

Returns

Observable <Menu>

Source

src/viewer.ts:255


onCurrentCellChanged

get onCurrentCellChanged(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1035


onDartPropertyChanged

get onDartPropertyChanged(): Observable<null>

Returns

Observable<null>

Source

src/viewer.ts:281


onDataEvent

get onDataEvent(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:57


onDataRowClicked

get onDataRowClicked(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:61


onDataSelected

get onDataSelected(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:59


onGridCellLinkClicked

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

Returns

Observable <EventData <GridCellArgs>>

Source

src/grid.ts:1050


onPinnedRowsChanged

get onPinnedRowsChanged(): Observable<any>

Returns

Observable<any>

Source

src/grid.ts:1032


onPropertyValueChanged

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

Returns

Observable <EventData <Property>>

Source

src/viewer.ts:62


onRowEnter

get onRowEnter(): Observable <GridCell>

Returns

Observable <GridCell>

Source

src/grid.ts:1043


onRowsResized

get onRowsResized(): Observable<any>

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

Returns

Observable<any>

Source

src/grid.ts:1028


onRowsSorted

get onRowsSorted(): Observable<any>

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

Returns

Observable<any>

Source

src/grid.ts:1031


onTooltipCreated

get onTooltipCreated(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:58


overlay

get overlay(): HTMLCanvasElement

Returns

HTMLCanvasElement

Source

src/grid.ts:893


pinnedRows

get pinnedRows(): Iterable<number>

Pinned rows.

Returns

Iterable<number>

Source

src/grid.ts:960


root

get root(): HTMLElement

Visual root.

Returns

HTMLElement

Source

src/viewer.ts:124


sortByColumns

get sortByColumns(): Column<any>[]

List of columns the grid is sorted by.

Returns

Column<any>[]

Source

src/grid.ts:898


sortTypes

get sortTypes(): boolean[]

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

Returns

boolean[]

Source

src/grid.ts:901


table

get table(): DataFrame

Returns

DataFrame

Source

src/viewer.ts:140


tableView

get tableView(): null | TableView

Returns a view this viewer is associated with, or null

Returns

null | TableView

Source

src/viewer.ts:150


type

get type(): string

Returns viewer type (see VIEWER constants)

Returns

string

Source

src/viewer.ts:136


vertScroll

get vertScroll(): RangeSlider

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

Returns

RangeSlider

Source

src/grid.ts:986


view

get view(): null | View

Returns a view this viewer is associated with, or null

Returns

null | View

Source

src/viewer.ts:145

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" | "blob" | "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:1058


cell()

cell(columnName, gridRow): GridCell

Returns a grid cell at the specified position.

Parameters

ParameterType
columnNamestring
gridRownumber

Returns

GridCell

Source

src/grid.ts:876


close()

close(): void

Closes and detaches the viewer.

Returns

void

Inherited from

Viewer . close

Source

src/viewer.ts:118


col()

col(name): null | GridColumn

Returns a column with the specified name.

Parameters

ParameterTypeDescription
namestring

Returns

null | GridColumn

Source

src/grid.ts:871


copyViewersLook()

copyViewersLook(other): void

Parameters

ParameterType
otherViewer<any>

Returns

void

Inherited from

Viewer . copyViewersLook

Source

src/viewer.ts:295


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:109


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:105


getProperties()

getProperties(): Property[]

Returns

Property[]

Inherited from

Viewer . getProperties

Source

src/viewer.ts:113


getRowOrder()

getRowOrder(): Int32Array

Returns the order of rows in the table.

Returns

Int32Array

Source

src/grid.ts:946


getVisibleCells()

getVisibleCells(column): Iterable <GridCell>

Returns currently visible cells

Parameters

ParameterTypeDefault value
columnnull | GridColumnnull

Returns

Iterable <GridCell>

Source

src/grid.ts:1053


gridRowToTable()

gridRowToTable(gridRow): number

Converts grid row index to table index. See also tableRowToGrid

Parameters

ParameterType
gridRownumber

Returns

number

Source

src/grid.ts:994


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:923


initDartObject()

initDartObject(dart): void

Parameters

ParameterType
dartany

Returns

void

Inherited from

Viewer . initDartObject

Source

src/viewer.ts:64


invalidate()

invalidate(): void

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

Returns

void

Source

src/grid.ts:981


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:906


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:915


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:260


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:299


resetRowHeight()

resetRowHeight(): void

Resets rows height

Returns

void

Source

src/grid.ts:1007


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:1016


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:967


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:974


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:93


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:953


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:930


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:938


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:991


toCompactLook()

toCompactLook(): void

Returns

void

Inherited from

Viewer . toCompactLook

Source

src/viewer.ts:277


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:170


boxPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IBoxPlotSettings>

Returns

Viewer <IBoxPlotSettings>

Inherited from

Viewer . boxPlot

Source

src/viewer.ts:178


calendar()

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

Parameters

ParameterType
tDataFrame
options?Partial <ICalendarSettings>

Returns

Viewer <ICalendarSettings>

Inherited from

Viewer . calendar

Source

src/viewer.ts:198


correlationPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <ICorrelationPlotSettings>

Returns

Viewer <ICorrelationPlotSettings>

Inherited from

Viewer . correlationPlot

Source

src/viewer.ts:202


create()

static create(table): Grid

Creates a new grid.

Parameters

ParameterType
tableobject
table.dartany

Returns

Grid

Source

src/grid.ts:848


densityPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IDensityPlotSettings>

Returns

Viewer <IDensityPlotSettings>

Inherited from

Viewer . densityPlot

Source

src/viewer.ts:206


filters()

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

Parameters

ParameterType
tDataFrame
options?Partial <IFiltersSettings>

Returns

Viewer <IFiltersSettings>

Inherited from

Viewer . filters

Source

src/viewer.ts:182


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:210


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:853


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:80


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:84


grid()

static grid(t, options?): Grid

Parameters

ParameterType
tDataFrame
options?Partial <IGridSettings>

Returns

Grid

Inherited from

Viewer . grid

Source

src/viewer.ts:162


heatMap()

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

Parameters

ParameterType
tDataFrame
options?Partial <IGridSettings>

Returns

Viewer <IGridSettings>

Inherited from

Viewer . heatMap

Source

src/viewer.ts:174


histogram()

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

Parameters

ParameterType
tDataFrame
options?Partial <IHistogramSettings>

Returns

Viewer <IHistogramSettings>

Inherited from

Viewer . histogram

Source

src/viewer.ts:166


lineChart()

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

Parameters

ParameterType
tDataFrame
options?Partial <ILineChartSettings>

Returns

Viewer <ILineChartSettings>

Inherited from

Viewer . lineChart

Source

src/viewer.ts:190


markup()

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

Parameters

ParameterType
tDataFrame
options?Partial <IMarkupViewerSettings>

Returns

Viewer <IMarkupViewerSettings>

Inherited from

Viewer . markup

Source

src/viewer.ts:214


matrixPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IMatrixPlotSettings>

Returns

Viewer <IMatrixPlotSettings>

Inherited from

Viewer . matrixPlot

Source

src/viewer.ts:218


network()

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

Parameters

ParameterType
tDataFrame
options?Partial <INetworkDiagramSettings>

Returns

Viewer <INetworkDiagramSettings>

Inherited from

Viewer . network

Source

src/viewer.ts:194


pcPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IPcPlotSettings>

Returns

Viewer <IPcPlotSettings>

Inherited from

Viewer . pcPlot

Source

src/viewer.ts:222


pieChart()

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

Parameters

ParameterType
tDataFrame
options?Partial <IPieChartSettings>

Returns

Viewer <IPieChartSettings>

Inherited from

Viewer . pieChart

Source

src/viewer.ts:226


scatterPlot()

static scatterPlot(t, options?): ScatterPlotViewer

Parameters

ParameterType
tDataFrame
options?Partial <IScatterPlotSettings>

Returns

ScatterPlotViewer

Inherited from

Viewer . scatterPlot

Source

src/viewer.ts:186


scatterPlot3d()

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

Parameters

ParameterType
tDataFrame
options?Partial <IScatterPlot3dSettings>

Returns

Viewer <IScatterPlot3dSettings>

Inherited from

Viewer . scatterPlot3d

Source

src/viewer.ts:230


statistics()

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

Parameters

ParameterType
tDataFrame
options?Partial <IStatsViewerSettings>

Returns

Viewer <IStatsViewerSettings>

Inherited from

Viewer . statistics

Source

src/viewer.ts:234


tile()

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

Parameters

ParameterType
tDataFrame
options?Partial <ITileViewerSettings>

Returns

Viewer <ITileViewerSettings>

Inherited from

Viewer . tile

Source

src/viewer.ts:238


treeMap()

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

Parameters

ParameterType
tDataFrame
options?Partial <ITreeMapSettings>

Returns

Viewer <ITreeMapSettings>

Inherited from

Viewer . treeMap

Source

src/viewer.ts:242


trellisPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <ITrellisPlotSettings>

Returns

Viewer <ITrellisPlotSettings>

Inherited from

Viewer . trellisPlot

Source

src/viewer.ts:246


wordCloud()

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

Parameters

ParameterType
tDataFrame
options?any

Returns

Viewer<any>

Inherited from

Viewer . wordCloud

Deprecated

Source

src/viewer.ts:251