Interface: SlotAPI

SlotAPI

API class that is used to control a slot.

Examples

slots.getSlot(<slotId>)
slots.getSlotList()[<index>]
slots.getMappingInfoList()[<index>].slot

Methods

addDataItems(dataItemIds, position, transactionTokenopt)

Adds new metadata columns to the slot. This creates the dataItem and maps it to the slot.

Parameters:
Name Type Attributes Description
dataItemIds Array.<String>

Ordered array of dataItem IDs to add to the slot

position Number

Position to place the new metadata columns. By default (position = -1); metadata columns are appended at the end.

transactionToken Object <optional>

addDataItemsMapping(dataItemIds, position, transactionTokenopt)

Adds new metadata columns to the slot.

Parameters:
Name Type Attributes Description
dataItemIds Array.<String>

Ordered array of dataItem IDs to add to the slot

position Number

Position to place the new metadata columns. By default (position = -1); metadata columns are appended at the end.

transactionToken Object <optional>

getDataItem(dataItemId) → {dataItemAPI}

Returns the dataItem with the given ID.

Parameters:
Name Type Description
dataItemId String

Unique dataItem ID

Returns:

Associated data item (or null)

Type
dataItemAPI

getDataItemList(ignoreDefaultDataItemMapping) → {Array.<DataItemAPI>}

Returns a list of data items that are assigned to the slot.

Parameters:
Name Type Description
ignoreDefaultDataItemMapping boolean

Defaults to false to ignore default mappings of the visualization.

Returns:

Array of data items

Type
Array.<DataItemAPI>

getDefinition() → {SlotDefinitionAPI}

Returns the slot definition.

Returns:
Type
SlotDefinitionAPI

getId() → {String}

Returns the slot ID.

Returns:

Slot ID

Type
String

hasUnavailableMetadataColumns() → {Boolean}

Returns true if the slot is mapped to at least one unavailable column.

Returns:

hasUnavailableMetadataColumns

Type
Boolean

removeDataItems(dataItemIds, transactionTokenopt)

Removes the existing data items. This deletes the dataItem and removes the mapping.

Parameters:
Name Type Attributes Description
dataItemIds Array.<String>

Ordered array of dataItem IDs to remove from the slot.

transactionToken Object <optional>

removeDataItemsMapping(dataItemIds, transactionTokenopt)

Removes the existing data items.

Parameters:
Name Type Attributes Description
dataItemIds Array.<String>

Ordered array of dataItem IDs to remove from the slot

transactionToken Object <optional>