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
Widget<TSettings>
Extended by
FormViewerGridJsViewerFilterGroupLineChartViewerScatterPlotViewerHistogramViewerBarChartViewerPieChartViewerPcPlotBoxPlotCorrelationPlotConfusionMatrixRocCurveCalendarViewerPivotViewerTrellisPlotViewer
Type parameters
| Type parameter | Value |
|---|---|
TSettings | any |
Constructors
new Viewer()
new Viewer<
TSettings>(dart,root?):Viewer<TSettings>
Parameters
| Parameter | Type |
|---|---|
dart | any |
root? | HTMLElement |
Returns
Viewer<TSettings>
Overrides
Constructs
Viewer
Source
Properties
| Property | Modifier | Type | Default value | Description | Inherited from |
|---|---|---|---|---|---|
_filter | private | null | BitSet | null | - | - |
_functions | protected | Func[] | [] | - | Widget._functions |
_meta | private | undefined | ViewerMetaHelper | undefined | - | - |
_properties | protected | Property[] | [] | - | Widget._properties |
_root | protected | HTMLElement | undefined | - | Widget._root |
dart | public | any | undefined | - | Widget.dart |
factory | public | null | Func | null | Constructor function. No parameters, returns [Widget]. | Widget.factory |
isDetached | public | boolean | false | - | Widget.isDetached |
props | public | TSettings & ObjectPropertyBag | undefined | - | Widget.props |
subs | public | Subscription[] | undefined | - | Widget.subs |
tags | public | any | undefined | - | - |
temp | public | any | undefined | Contains auxiliary information | Widget.temp |
CORE_VIEWER_TYPES | static | string[] | ... | - | - |
Accessors
children
getchildren():Widget<any>[]
Parent widget up the DOM tree, or null.
Returns
Widget<any>[]
Source
dataFrame
getdataFrame():DataFrame
setdataFrame(t):void
Parameters
| Parameter | Type |
|---|---|
t | DataFrame |
Returns
Source
descriptor
getdescriptor():WidgetDescriptor
Descriptor of this widget.
Returns
Source
filter
getfilter():BitSet
combined filter of the viewer
setfilter(f):void
Parameters
| Parameter | Type |
|---|---|
f | BitSet |
Returns
Source
helpUrl
gethelpUrl():string
Help URL
sethelpUrl(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
meta
getmeta():ViewerMetaHelper
Returns
Source
onContextMenu
getonContextMenu():Observable<Menu>
Returns
Observable <Menu>
Source
onDartPropertyChanged
getonDartPropertyChanged():Observable<null>
Returns
Observable<null>
Source
onDataEvent
getonDataEvent():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onDataRowClicked
getonDataRowClicked():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onDataSelected
getonDataSelected():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
onDetached
getonDetached():Observable<any>
Occurs when viewer is detached.
Returns
Observable<any>
Source
onPropertyValueChanged
getonPropertyValueChanged():Observable<EventData<Property>>
Returns
Observable <EventData <Property>>
Source
onTooltipCreated
getonTooltipCreated():Observable<ViewerEvent>
Returns
Observable <ViewerEvent>
Source
parent
getparent():null|Widget<any>
Parent widget up the DOM tree, or null.
Returns
null | Widget<any>
Source
root
getroot():HTMLElement
Visual root.
Returns
HTMLElement
Source
table
gettable():DataFrame
Returns
Source
tableView
gettableView():null|TableView
Returns a view this viewer is associated with, or null
Returns
null | TableView
Source
type
gettype():string
Returns viewer type (see VIEWER constants)
Returns
string
Source
view
getview():null|View
Returns a view this viewer is associated with, or null
Returns
null | View
Source
Methods
addProperty()
privateaddProperty(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 & IProperty | 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
close()
close():
void
Closes and detaches the viewer.
Returns
void
Source
copyViewersLook()
copyViewersLook(
other):void
Parameters
| Parameter | Type |
|---|---|
other | Viewer<any> |
Returns
void
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
getFunctions()
getFunctions():
Func[]
Functions that are applicable to this particular widget. Used in the UI to display context actions, and for the AI integrations.
Returns
Func[]
Inherited from
Source
getInfo()
getInfo():
object
Returns
object
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 |