Class: module:Canvas

module:Canvas()

new module:Canvas()

Creates reactive property accessors. - data - height - width - config This configs are retrieved from options.
Source:

Methods

(static) withSettings(initialSettings, regEntry, globalDependencies) → {Object}

Creates an instance initiated with given settings.
Parameters:
Name Type Description
initialSettings Object Initial settings to be populated in the model
regEntry Object newly created instance with the initial settings
globalDependencies Object dependencies which will be created only once in the page
Source:
Returns:
newly created instance with the initial settings
Type
Object

alias(alias) → {Canvas|string}

Sets or gets the alias of the canvas. Alias is a name by which the canvas can be referred. When setter
Parameters:
Name Type Description
alias string Name of the alias.
Source:
Returns:
  • Instance of the canvas. When getter
    Type
    Canvas
  • Alias of canvas.
    Type
    string

composition() → {object}

Retrieves the composition for a canvas
Source:
Returns:
Instances of the components which canvas requires to draw the full visualization. ``` { layout: // Instance of GridLayout legend: // Instance of Legend subtitle: // Instance of TextCell using which the title is rendered title: // Instance of TextCell using which the title is rendered visualGroup: // Instance of visualGroup } ```
Type
object

firebolt() → {GroupFireBolt}

Returns the instance of firebolt associated with this canvas. The firebolt instance can be used to dispatch a behaviour dynamically on the canvas. This firebolt does not handle any physical actions. It is just used to propagate the action to all the visual units in it's composition.
Source:
Returns:
Instance of firebolt associated with canvas.
Type
GroupFireBolt

getRetinalAxes() → {Object}

Returns all the retinal axis of the canvas. Color, shape and size axis are combinedly called retinal axis.
Source:
Returns:
Instances of retinal axis. ``` { color: [ColorAxis], // Array of color axis. shape: [ShapeAxis], // Array of shape axis. size: [SizeAxis] // Array of size axis. } ```
Type
Object

layout() → {GridLayout}

Retrieves an instance of layout which is responsible for layouting. Layout is responsible for creating faceted presentation using table layout.
Source:
Returns:
Instance of layout attached to canvas.
Type
GridLayout

once(eventName) → {Promise}

Returns a promise for various LifecycleEvents of the various components of canvas. The promise gets resolved once the particular event gets completed. To use this, ``` canvas.once('layer.drawn').then(() => { // Do any post drawing work here. }); ```
Parameters:
Name Type Description
eventName string Name of the lifecycle event.
Source:
Returns:
A pending promise waiting for resolve to be called.
Type
Promise

registry(reg)

Registry peoperty accessor
Parameters:
Name Type Description
reg Object plain old javascript object keyvalue pairs. Key containing module name and value contains module definition class. The reg object has to be flat object of level 1.
Source:

render()

Internal function to trigger render, this method is cognizant of all the properties of the core modules and establish a passive reactivity. Passive reactivity is not always a bad thing :)
Source:

xAxes() → {Array.<Array>}

Returns the instances of x axis of the canvas. It returns the instances in a two dimensional array form. ``` // The first element in the sub array represents the top axis and the second element represents the bottom // axis. [ [X1, X2], [X3, X4] ] ```
Source:
Returns:
Instances of x axis.
Type
Array.<Array>

yAxes() → {Array.<Array>}

Returns the instances of y axis of the canvas. It returns the instances in a two dimensional array form. ``` // The first element in the sub array represents the left axis and the second element represents the right // axis. [ [Y1, Y2], [Y3, Y4] ] ```
Source:
Returns:
Instances of y axis.
Type
Array.<Array>