Skip to main content

Viewer<TSettings>

Represents a viewer. See also https://datagrok.ai/help/develop/how-to/manipulate-viewers

See

Use Viewer to control the viewers. To develop a custom viewer, JsViewer.

Example

let view = grok.shell.addTableView(grok.data.demo.demog());
view.scatterPlot({
x: 'height',
y: 'weight',
size: 'age',
color: 'race',
});

Extends

Extended by

Type parameters

Type parameterValue
TSettingsany

Constructors

new Viewer()

new Viewer<TSettings>(dart, root?): Viewer<TSettings>

Parameters

ParameterType
dartany
root?HTMLElement

Returns

Viewer<TSettings>

Overrides

Widget . constructor

Constructs

Viewer

Source

src/viewer.ts:45

Properties

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

Accessors

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


meta

get meta(): ViewerMetaHelper

Returns

ViewerMetaHelper

Source

src/viewer.ts:121


onContextMenu

get onContextMenu(): Observable <Menu>

Returns

Observable <Menu>

Source

src/viewer.ts:248


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


onPropertyValueChanged

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

Returns

Observable <EventData <Property>>

Source

src/viewer.ts:55


onTooltipCreated

get onTooltipCreated(): Observable <ViewerEvent>

Returns

Observable <ViewerEvent>

Source

src/viewer.ts:51


root

get root(): HTMLElement

Visual root.

Returns

HTMLElement

Source

src/viewer.ts:117


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


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

Widget . 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

Widget . apply

Source

src/widgets.ts:262


close()

close(): void

Closes and detaches the viewer.

Returns

void

Source

src/viewer.ts:111


copyViewersLook()

copyViewersLook(other): void

Parameters

ParameterType
otherViewer<any>

Returns

void

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

Widget . detach

Source

src/widgets.ts:296


getDartProperties()

getDartProperties(): any[]

Returns

any[]

Inherited from

Widget . getDartProperties

Source

src/widgets.ts:278


getInfo()

getInfo(): object

Returns

object

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

Source

src/viewer.ts:98


getProperties()

getProperties(): Property[]

Returns

Property[]

Overrides

Widget . getProperties

Source

src/viewer.ts:106


initDartObject()

initDartObject(dart): void

Parameters

ParameterType
dartany

Returns

void

Source

src/viewer.ts:57


onEvent()

onEvent(eventId): Observable<any>

Observes platform events with the specified eventId.

Parameters

ParameterTypeDefault value
eventIdnull | stringnull

Returns

Observable<any>

Source

src/viewer.ts:253


onFrameAttached()

onFrameAttached(dataFrame): void

Parameters

ParameterType
dataFrameDataFrame

Returns

void

Inherited from

Widget . 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

Widget . onPropertyChanged

Source

src/widgets.ts:276


removeFromView()

removeFromView(): any

Returns

any

Source

src/viewer.ts:292


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

Source

src/viewer.ts:86


sourceRowsChanged()

sourceRowsChanged(): void

Returns

void

Inherited from

Widget . sourceRowsChanged

Source

src/widgets.ts:282


sub()

sub(subscription): void

Registers a subscription to an external event.

Parameters

ParameterTypeDescription
subscriptionSubscription

Returns

void

Inherited from

Widget . sub

Source

src/widgets.ts:255


toCompactLook()

toCompactLook(): void

Returns

void

Source

src/viewer.ts:270


toDart()

toDart(): any

Returns

any

Inherited from

Widget . toDart

Source

src/widgets.ts:247


barChart()

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

Parameters

ParameterType
tDataFrame
options?Partial <IBarChartSettings>

Returns

Viewer <IBarChartSettings>

Source

src/viewer.ts:163


boxPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IBoxPlotSettings>

Returns

Viewer <IBoxPlotSettings>

Source

src/viewer.ts:171


calendar()

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

Parameters

ParameterType
tDataFrame
options?Partial <ICalendarSettings>

Returns

Viewer <ICalendarSettings>

Source

src/viewer.ts:191


correlationPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <ICorrelationPlotSettings>

Returns

Viewer <ICorrelationPlotSettings>

Source

src/viewer.ts:195


densityPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IDensityPlotSettings>

Returns

Viewer <IDensityPlotSettings>

Source

src/viewer.ts:199


filters()

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

Parameters

ParameterType
tDataFrame
options?Partial <IFiltersSettings>

Returns

Viewer <IFiltersSettings>

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

Widget . find

Source

src/widgets.ts:243


form()

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

Parameters

ParameterType
tDataFrame
options?Partial <IFormSettings>

Returns

Viewer <IFormSettings>

Source

src/viewer.ts:203


fromRoot()

static fromRoot(root): Widget<any>

Creates a new widget from the root element.

Parameters

ParameterType
rootHTMLElement

Returns

Widget<any>

Inherited from

Widget . 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>

Source

src/viewer.ts:73


getAll()

static getAll(): Widget<any>[]

Returns all currently active widgets.

Returns

Widget<any>[]

Inherited from

Widget . getAll

Source

src/widgets.ts:238


getViewerTypes()

static getViewerTypes(): string[]

Returns

string[]

Source

src/viewer.ts:77


grid()

static grid(t, options?): Grid

Parameters

ParameterType
tDataFrame
options?Partial <IGridSettings>

Returns

Grid

Source

src/viewer.ts:155


heatMap()

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

Parameters

ParameterType
tDataFrame
options?Partial <IGridSettings>

Returns

Viewer <IGridSettings>

Source

src/viewer.ts:167


histogram()

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

Parameters

ParameterType
tDataFrame
options?Partial <IHistogramSettings>

Returns

Viewer <IHistogramSettings>

Source

src/viewer.ts:159


lineChart()

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

Parameters

ParameterType
tDataFrame
options?Partial <ILineChartSettings>

Returns

Viewer <ILineChartSettings>

Source

src/viewer.ts:183


markup()

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

Parameters

ParameterType
tDataFrame
options?Partial <IMarkupViewerSettings>

Returns

Viewer <IMarkupViewerSettings>

Source

src/viewer.ts:207


matrixPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IMatrixPlotSettings>

Returns

Viewer <IMatrixPlotSettings>

Source

src/viewer.ts:211


network()

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

Parameters

ParameterType
tDataFrame
options?Partial <INetworkDiagramSettings>

Returns

Viewer <INetworkDiagramSettings>

Source

src/viewer.ts:187


pcPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <IPcPlotSettings>

Returns

Viewer <IPcPlotSettings>

Source

src/viewer.ts:215


pieChart()

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

Parameters

ParameterType
tDataFrame
options?Partial <IPieChartSettings>

Returns

Viewer <IPieChartSettings>

Source

src/viewer.ts:219


scatterPlot()

static scatterPlot(t, options?): ScatterPlotViewer

Parameters

ParameterType
tDataFrame
options?Partial <IScatterPlotSettings>

Returns

ScatterPlotViewer

Source

src/viewer.ts:179


scatterPlot3d()

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

Parameters

ParameterType
tDataFrame
options?Partial <IScatterPlot3dSettings>

Returns

Viewer <IScatterPlot3dSettings>

Source

src/viewer.ts:223


statistics()

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

Parameters

ParameterType
tDataFrame
options?Partial <IStatsViewerSettings>

Returns

Viewer <IStatsViewerSettings>

Source

src/viewer.ts:227


tile()

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

Parameters

ParameterType
tDataFrame
options?Partial <ITileViewerSettings>

Returns

Viewer <ITileViewerSettings>

Source

src/viewer.ts:231


treeMap()

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

Parameters

ParameterType
tDataFrame
options?Partial <ITreeMapSettings>

Returns

Viewer <ITreeMapSettings>

Source

src/viewer.ts:235


trellisPlot()

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

Parameters

ParameterType
tDataFrame
options?Partial <ITrellisPlotSettings>

Returns

Viewer <ITrellisPlotSettings>

Source

src/viewer.ts:239


wordCloud()

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

Parameters

ParameterType
tDataFrame
options?any

Returns

Viewer<any>

Deprecated

Source

src/viewer.ts:244