stage

Available for:BI Map Panel

Convenience methods for GVC API to make it compatible with the gsp API. The GVC API is also available for the developer and it is described in the M.App Studio documentation.

Methods

Name Summary
createStage

Creates a new BI data stage

findStage

Retrieves the data stage object

addWidget

Adds new widget

findStageModel

Retrieves the stage model

findWidget

Retrieves the widget

findWidgets

Retrieves the currently instantiated widgets by ID or by search object

registerChoropleth

Registers new choropleth

registerDataTable

Registers data table

registerStageModel

Registers the stage model

reloadStageModel

Reloads the stage model

removeWidget

Removes widget

removeWidgets

Removes widgets

requireLibraries

Provides library references

requireRawGvcStage

Retrieves raw GVC object for direct API manipulation

unregisterChoropleth

Unregisters the choropleth

Methods • Details

createStage(stageId, callback, errback) → {void}(static)

Available for:BI Map Panel

Creates a new BI data stage

Parameters

Name Type Description
stageId String

Stage ID

callback function

Callback

stage

Stage object

errback function

Error callback

Returns

TypeDescription
void

findStage(stageId, callback, errback) → {void}(static)

Available for:BI Map Panel

Retrieves the data stage object

Parameters

Name Type Description
stageId String optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

stage

Stage object

errback function

Error callback

Returns

TypeDescription
void

addWidget(config, callback, callback, errback) → {void}(inner)

Available for:BI Map Panel

Adds new widget

Parameters

Name Type Description
config Object
{
 "descriptor": Object,
 "descriptor.chartM": Object,
 "descriptor.chart": Object,
 "descriptor.domElement": HTMLDiv
}

undefined

descriptor

Descriptor of the widget.

descriptor.chartM

Chart Model of the widget

descriptor.chart optional

Chart object to be used by the widget. If not passed, the chart object is created using the chart model

descriptor.domElement optional

DOM Element to be used when creating the widget

callback function

Callback

confi String optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

findStageModel(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Retrieves the stage model

Parameters

Name Type Description
config Object
{
 "stageId": String
}

undefined

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

findWidget(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Retrieves the widget

Parameters

Name Type Description
config Object
{
 "descriptor": String|Object
}

undefined

descriptor

Descriptor of the widget. Only "String" = ID is currently supported

callback function

Callback

confi String optional

Stage ID. If not passed, the default stage is addressed

errback function

Error callback

Returns

TypeDescription
void

findWidgets(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Retrieves the currently instantiated widgets by ID or by search object

Parameters

Name Type Description
config Object
{
 "descriptors": Array.<String>|Array.<Object>,
 "stageId": String
}

undefined

descriptors

Descriptor of the widget. If descriptor is a String, then the resulting object in the callback will be an object as the String descriptor stands for ID. If the descriptor is an Object, then properties of that object are compared with the widget collection and it is possible that more than one object from the widget collection will match. For that reason returning object for the object descriptors are Arrays

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

ret

if descriptors are Strings, then ret contains objects. Otherwise arrays of objects

errback function

Error callback

Returns

TypeDescription
void

registerChoropleth(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Registers new choropleth

Parameters

Name Type Description
config Object
{
 "model": Object,
 "model.layer": String,
 "mapTitleEnabled": Boolean,
 "mapLegendEnabled": Boolean,
 "mapLegendPlacement": String,
 "stageId": String
}

undefined

model

Chart Model of the choropleth. See GVC documentation

model.layer

layer ID

mapTitleEnabled

undefined

mapLegendEnabled

undefined

mapLegendPlacement

"map" or "legend"

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

registerDataTable(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Registers data table

Parameters

Name Type Description
config Object
{
 "tableSource": URI|Object,
 "stageId": String
}

undefined

tableSource

Table source. If tableSource is an URI (String), then it is retrieved from the external source. Otherwise an array of rows should be passed

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

registerStageModel(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Registers the stage model

Parameters

Name Type Description
config Object
{
 "stageModel": Object,
 "stageModel.id": String,
 "stageModel.fields": Array.<Object>,
 "stageModel.totals": Array.<Object>,
 "stageModel.features": Array.<Object>,
 "stageModel.values": Array.<Object>,
 "stageModel.colors": Object,
 "stageId": String
}

undefined

stageModel

StageModel

stageModel.id

undefined

stageModel.fields

Fields. Each field should have id, value and name properties. Please refer to the GVC documentation

stageModel.totals

Custom totals precomputed for the whole table. Each total should have id and value properties.

stageModel.features

Feature definitions. Each definition should have id, key and name properties

stageModel.values

Value/Measure definitions. Each should have id, value and name properties

stageModel.colors

Color palette definitions. Each should have domain, range and type [quantize, threshold, ordinal]. If range is not passed, the default one is used.

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

reloadStageModel(stageId, callback, errback) → {void}(inner)

Available for:BI Map Panel

Reloads the stage model

Parameters

Name Type Description
stageId String optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

removeWidget(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Removes widget

Parameters

Name Type Description
config Object
{
 "widgetId": String,
 "stageId": String
}

undefined

widgetId

ID of the widget to be removed

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

removeWidgets(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Removes widgets

Parameters

Name Type Description
config Object
{
 "widgetIds": Array.<String>,
 "stageId": String
}

undefined

widgetIds

IDs of the widgets to be removed

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void

requireLibraries() → {void}(inner)

Available for:BI Map Panel

Provides library references

Parameters

Name Type Description
f function

Function that will be called with params as follows: gvc, dc, d3, crossfilter, lodash, when

Returns

TypeDescription
void

requireRawGvcStage(fn, stageId) → {void}(inner)

Available for:BI Map Panel

Retrieves raw GVC object for direct API manipulation

Parameters

Name Type Description
fn function

Function that will be called with stage as its first parameter

stageId String optional

Stage ID. If not passed, the default stage is addressed

Returns

TypeDescription
void

unregisterChoropleth(config, callback, errback) → {void}(inner)

Available for:BI Map Panel

Unregisters the choropleth

Parameters

Name Type Description
config Object
{
 "stageId": String
}

undefined

stageId optional

Stage ID. If not passed, the default stage is addressed

callback function

Callback

errback function

Error callback

Returns

TypeDescription
void