Home Reference Source Repository
public class | source

OlapicWidgetEntity

Extends:

OlapicEntity → OlapicWidgetEntity

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

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

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

get(path: string): *

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#constructor

Params:

NameTypeAttributeDescription
data Object

All the information for the widget.

Public Members

public alias: String source

An alias/name for the entity.

Override:

OlapicEntity#alias

public get handler: OlapicWidgetsHandler: * source

A shortcut method to get access to the widgets handler object.

Override:

OlapicEntity#handler

Return:

OlapicWidgetsHandler

the handler object for this specific type of entity.

Public Methods

public getCategory(): Promise<OlapicCategoryEntity, Error> source

Gets the widget selected category.

Return:

Promise<OlapicCategoryEntity, Error>

It will return an category entity or an Error object if something goes wrong or there's no category associated to this wiget.

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 Error object in case something goes wrong.

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 Error object if something goes wrong or there's no stream associated to this widget.

Example:

.getStream().then((stream) => {
    console.log(stream.get('name'));
});