Module

base

Contains all methods related with the widget HTML container element and not the graphic itself. Some of then can be redefined in each widget and used in a instance of the widget.

View Source mixins/base.js, line 4

Methods

# debugError(optsopt, rejectopt)

Personalize an captured error ocurred in the widget and show in the widget and the Web console.

Parameters:
Name Type Attributes Default Description
opts Object <optional>
{}
msg string

Message to show in the widget.

console Object
console.method string

A valid method of console Web API.

console.msg string

Message to show int the console.

reject boolean <optional>
false

Boolean to break the chain actions.

View Source mixins/base.js, line 35

# displayWashemoWidget(Widget, cfg, data)

Draw the widget with the given configuration and data.

Parameters:
Name Type Description
Widget any

Widget object to draw

cfg Object

Configuration set according to the widget.

data Object | Array

Data struture according to the widget.

View Source mixins/base.js, line 57

# drawError(msg)

Show an error in the widget container.

Parameters:
Name Type Description
msg string

Error message.

View Source mixins/base.js, line 71

# forceShow()

This method calls the showEl method.

View Source mixins/base.js, line 85

# getElementContainer() → {Object}

Get the widget container. The element container include the header and the graphic.

View Source mixins/base.js, line 96

  • HTML DOM element widget container.
Object

# getGraphicContainer() → {Object}

Get the chart container.

View Source mixins/base.js, line 105

  • Chart container HTML DOM element.
Object

# getWidget() → {Object}

Get the widget object

View Source mixins/base.js, line 114

  • Widget object.
Object

# hide()

Hide the widget container element.

View Source mixins/base.js, line 122

# hideGraphic()

Hide the chart container element.

View Source mixins/base.js, line 133

# init()

Allow to initialize any widget. This method is overridden in each widget.

View Source mixins/base.js, line 143

# isHidden() → {boolean}

Check hidden state.

View Source mixins/base.js, line 150

  • Indicates if the widget is hidden.
boolean

# isVisible() → {boolean}

Check visibility state.

View Source mixins/base.js, line 159

  • Indicates if the widget is visible.
boolean

# redraw()

By default,it does nothing. This method should be overwritten in each widget. It's executed when redraw the widget.

View Source mixins/base.js, line 243

# resize()

By default, it does nothing. This method should be overwritten in each widget. Resize method that trigger when de window change the size.

View Source mixins/base.js, line 251

# setElementContainer(el)

Set the widget element container

Parameters:
Name Type Description
el Object

HTML DOM container.

View Source mixins/base.js, line 168

# setGraphicContainer(el)

Set the chart element container.

Parameters:
Name Type Description
el Object

HTML DOM container.

View Source mixins/base.js, line 177

# setTitle(title)

Set widget title to header.

Parameters:
Name Type Description
title string

Text to set.

View Source mixins/base.js, line 186

# show(forceRefreshopt)

Show the chart widget.

Parameters:
Name Type Attributes Default Description
forceRefresh boolean <optional>
false

force refresh widget.

View Source mixins/base.js, line 200

# showEl(forceRefreshopt)

Show the container widget.

Parameters:
Name Type Attributes Default Description
forceRefresh boolean <optional>
false

force refresh widget.

View Source mixins/base.js, line 221