Grid
High-performance, flexible spreadsheet control
Extends
Constructors
new Grid()
new Grid(
dart
):Grid
Parameters
Parameter | Type |
---|---|
dart | any |
Returns
Overrides
Source
Properties
Property | Modifier | Type | Default value | Description | Inherited from |
---|---|---|---|---|---|
_properties | protected | Property [] | undefined | - | Viewer ._properties |
_root | protected | HTMLElement | undefined | - | Viewer ._root |
dart | public | any | undefined | - | Viewer .dart |
factory | public | null | Func | null | Constructor function. No parameters, returns [Widget]. | Viewer .factory |
isDetached | public | boolean | false | - | Viewer .isDetached |
props | public | IGridSettings & ObjectPropertyBag | undefined | - | Viewer .props |
subs | public | Subscription [] | undefined | - | Viewer .subs |
tags | public | any | undefined | - | Viewer .tags |
temp | public | any | undefined | Contains auxiliary information | Viewer .temp |
Accessors
canvas
get
canvas():HTMLCanvasElement
Returns
HTMLCanvasElement
Source
colHeaderBox
get
colHeaderBox():Rect
Column labels box
Returns
Source
colHeaderHeight
get
colHeaderHeight():number
Column labels height
Returns
number
Source
columns
get
columns():GridColumnList
Grid columns.
Returns
Source
dataFrame
get
dataFrame():DataFrame
set
dataFrame(t
):void
Parameters
Parameter | Type |
---|---|
t | DataFrame |
Returns
Source
filter
get
filter():BitSet
combined filter of the viewer
set
filter(f
):void
Parameters
Parameter | Type |
---|---|
f | BitSet |
Returns
Source
helpUrl
get
helpUrl():string
Help URL
set
helpUrl(s
):void
Parameters
Parameter | Type |
---|---|
s | string |
Returns
string
Source
horzScroll
get
horzScroll():RangeSlider
Horizontal scroll bar
Returns
Source
meta
get
meta():ViewerMetaHelper
Returns
Source
onAfterDrawContent
get
onAfterDrawContent():Observable
<EventData
<any
>>
Returns
Observable
<EventData
<any
>>
Source
onAfterDrawOverlay
get
onAfterDrawOverlay():Observable
<EventData
<any
>>
Returns
Observable
<EventData
<any
>>
Source
onBeforeDrawContent
get
onBeforeDrawContent():Observable
<EventData
<any
>>
Returns
Observable
<EventData
<any
>>
Source
onBeforeDrawOverlay
get
onBeforeDrawOverlay():Observable
<EventData
<any
>>
Returns
Observable
<EventData
<any
>>
Source
onCellClick
get
onCellClick():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onCellDoubleClick
get
onCellDoubleClick():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onCellKeyDown
get
onCellKeyDown():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onCellMouseDown
get
onCellMouseDown():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onCellMouseEnter
get
onCellMouseEnter():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onCellMouseLeave
get
onCellMouseLeave():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onCellRender
get
onCellRender():Observable
<GridCellRenderArgs
>
Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-rendering-indexes
Returns
Observable
<GridCellRenderArgs
>
Source
onCellValueEdited
get
onCellValueEdited():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onColumnResized
get
onColumnResized():Observable
<any
>
Sample: https://public.datagrok.ai/js/samples/grid/resize-events
Returns
Observable
<any
>
Source
onContextMenu
get
onContextMenu():Observable
<Menu
>
Returns
Observable
<Menu
>
Source
onCurrentCellChanged
get
onCurrentCellChanged():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onDartPropertyChanged
get
onDartPropertyChanged():Observable
<null
>
Returns
Observable
<null
>
Source
onDataEvent
get
onDataEvent():Observable
<ViewerEvent
>
Returns
Observable
<ViewerEvent
>
Source
onDataRowClicked
get
onDataRowClicked():Observable
<ViewerEvent
>
Returns
Observable
<ViewerEvent
>
Source
onDataSelected
get
onDataSelected():Observable
<ViewerEvent
>
Returns
Observable
<ViewerEvent
>
Source
onGridCellLinkClicked
get
onGridCellLinkClicked():Observable
<EventData
<GridCellArgs
>>
Returns
Observable
<EventData
<GridCellArgs
>>
Source
onPinnedRowsChanged
get
onPinnedRowsChanged():Observable
<any
>
Returns
Observable
<any
>
Source
onPropertyValueChanged
get
onPropertyValueChanged():Observable
<EventData
<Property
>>
Returns
Observable
<EventData
<Property
>>
Source
onRowEnter
get
onRowEnter():Observable
<GridCell
>
Returns
Observable
<GridCell
>
Source
onRowsResized
get
onRowsResized():Observable
<any
>
Sample: https://public.datagrok.ai/js/samples/grid/resize-events
Returns
Observable
<any
>
Source
onRowsSorted
get
onRowsSorted():Observable
<any
>
Sample: https://public.datagrok.ai/js/samples/grid/order-rows
Returns
Observable
<any
>
Source
onTooltipCreated
get
onTooltipCreated():Observable
<ViewerEvent
>
Returns
Observable
<ViewerEvent
>
Source
overlay
get
overlay():HTMLCanvasElement
Returns
HTMLCanvasElement
Source
pinnedRows
get
pinnedRows():Iterable
<number
>
Pinned rows.
Returns
Iterable
<number
>
Source
root
get
root():HTMLElement
Visual root.
Returns
HTMLElement
Source
sortByColumns
get
sortByColumns():Column
<any
>[]
List of columns the grid is sorted by.
Returns
Column
<any
>[]
Source
sortTypes
get
sortTypes():boolean
[]
Sort directions for [sortByColumns]: true = ascending order, false = descending order.
Returns
boolean
[]
Source
table
get
table():DataFrame
Returns
Source
tableView
get
tableView():null
|TableView
Returns a view this viewer is associated with, or null
Returns
null
| TableView
Source
type
get
type():string
Returns viewer type (see VIEWER constants)
Returns
string
Source
vertScroll
get
vertScroll():RangeSlider
Vertical scroll bar. Sample: https://public.datagrok.ai/js/samples/grid/scroll-bars
Returns
Source
view
get
view():null
|View
Returns a view this viewer is associated with, or null
Returns
null
| View
Source
Methods
addProperty()
private
addProperty(propertyName
,propertyType
,defaultValue
,options
):any
Registers an property with the specified type, name, and defaultValue.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
propertyName | string | undefined | |
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 | |
defaultValue | any | null | |
options | null | object & PropertyOptions | null |
Returns
any
Inherited from
See
Registered property gets added to properties. Returns default value, thus allowing to combine registering a property with the initialization
Source
apply()
apply(
properties
):Widget
<any
>
Parameters
Parameter | Type | Description |
---|---|---|
properties | object |
Returns
Widget
<any
>
Inherited from
Source
autoSize()
autoSize(
maxWidth
,maxHeight
,minWidth
?,minHeight
?,autoSizeOnDataChange
?):void
Resizes the grid to fit the content
Parameters
Parameter | Type |
---|---|
maxWidth | number |
maxHeight | number |
minWidth ? | number |
minHeight ? | number |
autoSizeOnDataChange ? | boolean |
Returns
void
Source
cell()
cell(
columnName
,gridRow
):GridCell
Returns a grid cell at the specified position.
Parameters
Parameter | Type |
---|---|
columnName | string |
gridRow | number |
Returns
Source
close()
close():
void
Closes and detaches the viewer.
Returns
void
Inherited from
Source
col()
col(
name
):null
|GridColumn
Returns a column with the specified name.
Parameters
Parameter | Type | Description |
---|---|---|
name | string |
Returns
null
| GridColumn
Source
copyViewersLook()
copyViewersLook(
other
):void
Parameters
Parameter | Type |
---|---|
other | Viewer <any > |
Returns
void
Inherited from
Source
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
Source
getDartProperties()
getDartProperties():
any
[]
Returns
any
[]
Inherited from
Source
getInfo()
getInfo():
object
Returns
object
Inherited from
Source
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
Parameter | Type | Default value |
---|---|---|
includeDefaults | boolean | false |
Returns
object
Member | Type |
---|---|
id | string |
look | object |
type | string |
Inherited from
Source
getProperties()
getProperties():
Property
[]
Returns
Property
[]
Inherited from
Source
getRowOrder()
getRowOrder():
Int32Array
Returns the order of rows in the table.
Returns
Int32Array
Source
getVisibleCells()
getVisibleCells(
column
):Iterable
<GridCell
>
Returns currently visible cells
Parameters
Parameter | Type | Default value |
---|---|---|
column | null | GridColumn | null |
Returns
Iterable
<GridCell
>
Source
gridRowToTable()
gridRowToTable(
gridRow
):number
Converts grid row index to table index. See also tableRowToGrid
Parameters
Parameter | Type |
---|---|
gridRow | number |
Returns
number
Source
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
Parameter | Type |
---|---|
x | number |
y | number |
Returns
null
| GridCell
Source
initDartObject()
initDartObject(
dart
):void
Parameters
Parameter | Type |
---|---|
dart | any |
Returns
void
Inherited from
Source
invalidate()
invalidate():
void
Causes the grid to repaint. Sample: https://public.datagrok.ai/js/samples/grid/advanced/invalidate
Returns
void
Source
onCellPrepare()
onCellPrepare(
callback
):StreamSubscription
Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-prepare
Parameters
Parameter | Type |
---|---|
callback | (cell ) => any |
Returns
Source
onCellTooltip()
onCellTooltip(
callback
):StreamSubscription
Sample: https://public.datagrok.ai/js/samples/grid/custom-cell-tooltip
Parameters
Parameter | Type |
---|---|
callback | (cell , x , y ) => any |
Returns
Source
onEvent()
onEvent(
eventId
):Observable
<any
>
Observes platform events with the specified eventId.
Parameters
Parameter | Type | Default value |
---|---|---|
eventId | null | string | null |
Returns
Observable
<any
>
Inherited from
Source
onFrameAttached()
onFrameAttached(
dataFrame
):void
Parameters
Parameter | Type |
---|---|
dataFrame | DataFrame |
Returns
void
Inherited from
Source
onPropertyChanged()
onPropertyChanged(
property
):void
Gets called when viewer's property is changed.
Parameters
Parameter | Type | Description |
---|---|---|
property | null | Property | or null, if multiple properties were changed. |
Returns
void
Inherited from
Source
removeFromView()
removeFromView():
any
Returns
any
Inherited from
Source
resetRowHeight()
resetRowHeight():
void
Resets rows height
Returns
void
Source
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
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
Parameter | Type |
---|---|
column | string | Column <any > |
row | number |
Returns
void
Source
scrollToPixels()
scrollToPixels(
x
,y
):void
Scrolls the grid to the specified position. Sample: https://public.datagrok.ai/js/samples/grid/scroll-to-pixels
Parameters
Parameter | Type |
---|---|
x | number |
y | number |
Returns
void
Source
setOptions()
setOptions(
map
):void
Sets viewer options. See also getOptions Sample: https://public.datagrok.ai/js/samples/ui/viewers/types/scatter-plot
Parameters
Parameter | Type | Description |
---|---|---|
map | object | |
map.type ? | string | - |
Returns
void
Inherited from
Source
setRowOrder()
setRowOrder(
indexes
):Grid
Sets the order or rows in the table. Sample: https://public.datagrok.ai/js/samples/grid/order-rows Also,
Parameters
Parameter | Type |
---|---|
indexes | number [] |
Returns
See
sortIndexes
Source
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
Parameter | Type | Default value |
---|---|---|
columns | string [] | Column <any >[] | undefined |
orders | null | boolean [] | null |
Returns
Source
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
Parameter | Type |
---|---|
indexComparer | (a , b ) => number |
Returns
See
setRowOrder
Source
sourceRowsChanged()
sourceRowsChanged():
void
Returns
void
Inherited from
Source
sub()
sub(
subscription
):void
Registers a subscription to an external event.
Parameters
Parameter | Type | Description |
---|---|---|
subscription | Subscription |
Returns
void
Inherited from
Source
tableRowToGrid()
tableRowToGrid(
tableRow
):number
Converts table row index to grid index. See also gridRowToTable
Parameters
Parameter | Type |
---|---|
tableRow | number |
Returns
number
Source
toCompactLook()
toCompactLook():
void
Returns
void
Inherited from
Source
toDart()
toDart():
any
Returns
any
Inherited from
Source
barChart()
static
barChart(t
,options
?):Viewer
<IBarChartSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IBarChartSettings > |
Returns
Inherited from
Source
boxPlot()
static
boxPlot(t
,options
?):Viewer
<IBoxPlotSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IBoxPlotSettings > |
Returns
Inherited from
Source
calendar()
static
calendar(t
,options
?):Viewer
<ICalendarSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <ICalendarSettings > |
Returns
Inherited from
Source
correlationPlot()
static
correlationPlot(t
,options
?):Viewer
<ICorrelationPlotSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <ICorrelationPlotSettings > |
Returns
Viewer
<ICorrelationPlotSettings
>
Inherited from
Source
create()
static
create(table
):Grid
Creates a new grid.
Parameters
Parameter | Type |
---|---|
table | object |
table.dart | any |
Returns
Source
densityPlot()
static
densityPlot(t
,options
?):Viewer
<IDensityPlotSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IDensityPlotSettings > |
Returns
Inherited from
Source
filters()
static
filters(t
,options
?):Viewer
<IFiltersSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IFiltersSettings > |
Returns
Inherited from
Source
find()
static
find(root
):null
|Widget
<any
>
Finds existing widget from its visual root.
Parameters
Parameter | Type |
---|---|
root | Element |
Returns
null
| Widget
<any
>
Inherited from
Source
form()
static
form(t
,options
?):Viewer
<IFormSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IFormSettings > |
Returns
Inherited from
Source
fromProperties()
static
fromProperties(items
,props
):Grid
Creates a new grid from a list of items (rows) and their properties (columns)
Parameters
Parameter | Type |
---|---|
items | any [] |
props | Property [] |
Returns
Source
fromRoot()
static
fromRoot(root
):Widget
<any
>
Creates a new widget from the root element.
Parameters
Parameter | Type |
---|---|
root | HTMLElement |
Returns
Widget
<any
>
Inherited from
Source
fromType()
static
fromType(viewerType
,table
,options
):Viewer
<any
>
Creates a new viewer of the specified type.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
viewerType | string | undefined | |
table | DataFrame | undefined | |
options | null | object | null |
Returns
Viewer
<any
>
Inherited from
Source
getAll()
static
getAll():Widget
<any
>[]
Returns all currently active widgets.
Returns
Widget
<any
>[]
Inherited from
Source
getViewerTypes()
static
getViewerTypes():string
[]
Returns
string
[]
Inherited from
Source
grid()
static
grid(t
,options
?):Grid
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IGridSettings > |
Returns
Inherited from
Source
heatMap()
static
heatMap(t
,options
?):Viewer
<IGridSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IGridSettings > |
Returns
Inherited from
Source
histogram()
static
histogram(t
,options
?):Viewer
<IHistogramSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IHistogramSettings > |
Returns
Inherited from
Source
lineChart()
static
lineChart(t
,options
?):Viewer
<ILineChartSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <ILineChartSettings > |
Returns
Inherited from
Source
markup()
static
markup(t
,options
?):Viewer
<IMarkupViewerSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IMarkupViewerSettings > |
Returns
Viewer
<IMarkupViewerSettings
>
Inherited from
Source
matrixPlot()
static
matrixPlot(t
,options
?):Viewer
<IMatrixPlotSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IMatrixPlotSettings > |
Returns
Inherited from
Source
network()
static
network(t
,options
?):Viewer
<INetworkDiagramSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <INetworkDiagramSettings > |
Returns
Viewer
<INetworkDiagramSettings
>
Inherited from
Source
pcPlot()
static
pcPlot(t
,options
?):Viewer
<IPcPlotSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IPcPlotSettings > |
Returns
Inherited from
Source
pieChart()
static
pieChart(t
,options
?):Viewer
<IPieChartSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IPieChartSettings > |
Returns
Inherited from
Source
scatterPlot()
static
scatterPlot(t
,options
?):ScatterPlotViewer
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IScatterPlotSettings > |
Returns
Inherited from
Source
scatterPlot3d()
static
scatterPlot3d(t
,options
?):Viewer
<IScatterPlot3dSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IScatterPlot3dSettings > |
Returns
Viewer
<IScatterPlot3dSettings
>
Inherited from
Source
statistics()
static
statistics(t
,options
?):Viewer
<IStatsViewerSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <IStatsViewerSettings > |
Returns
Inherited from
Source
tile()
static
tile(t
,options
?):Viewer
<ITileViewerSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <ITileViewerSettings > |
Returns
Inherited from
Source
treeMap()
static
treeMap(t
,options
?):Viewer
<ITreeMapSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <ITreeMapSettings > |
Returns
Inherited from
Source
trellisPlot()
static
trellisPlot(t
,options
?):Viewer
<ITrellisPlotSettings
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | Partial <ITrellisPlotSettings > |
Returns
Inherited from
Source
wordCloud()
static
wordCloud(t
,options
?):Viewer
<any
>
Parameters
Parameter | Type |
---|---|
t | DataFrame |
options ? | any |
Returns
Viewer
<any
>