import OlapicWidgetEntity from 'olapic-devkit/src/core/entities/widget/widget.entity.js'
OlapicWidgetEntity
Extends:
This represents the Olapic widgets in DevKit. This is the entity that can be used to build custom visualization of the Olapic data.
Constructor Summary
Public Constructor | ||
public |
constructor(data: Object) The class constructor that receives the widget information. |
Member Summary
Public Members | ||
public |
An alias/name for the entity. |
|
public get |
A shortcut method to get access to the widgets handler object. |
Method Summary
Public Methods | ||
public |
Gets the widget selected category. |
|
public |
getSettings(): Promise<Object, Error> Gets the widgets settings from the API. |
|
public |
Gets the widget selected stream. |
Inherited Summary
From class OlapicEntity | ||
public get |
A quick shortcut for the entities so they can access their own entities handler. |
|
public |
An alias/name for the entity, for debug purposes. |
|
public |
The entity information. |
|
public |
Access the entity data using a path-like format. |
|
public |
A utility method that returns the entity name/alias. |
Public Constructors
public constructor(data: Object) source
The class constructor that receives the widget information.
Override:
OlapicEntity#constructorParams:
Name | Type | Attribute | Description |
data | Object | All the information for the widget. |
Public Members
public get handler: OlapicWidgetsHandler: * source
A shortcut method to get access to the widgets handler object.
Override:
OlapicEntity#handlerPublic Methods
public getCategory(): Promise<OlapicCategoryEntity, Error> source
Gets the widget selected category.
Return:
Promise<OlapicCategoryEntity, Error> | It will return an category entity or
an |
Example:
.getCategory().then((category) => {
console.log(category.get('name'));
});
public getSettings(): Promise<Object, Error> source
Gets the widgets settings from the API.
Return:
Promise<Object, Error> | It will return an object with all the widget settings, or an
|
Example:
.getSettings().then((settings) => {
console.log(settings);
});
public getStream(): Promise<OlapicStreamEntity, Error> source
Gets the widget selected stream.
Return:
Promise<OlapicStreamEntity, Error> | It will return an stream entity or an |
Example:
.getStream().then((stream) => {
console.log(stream.get('name'));
});