Interface: SlotsAPI

SlotsAPI

API class that is used to control slots.

Example

visualization.getSlots()

Methods

clearAllSlots(options)

Clears all slots content

Parameters:
Name Type Description
options SetOptions

createDataItems(dataitems, transactionToken)

Creates data items that are not mapped to any slot.

Parameters:
Name Type Description
dataitems Array.<object>

Array of a dataItem spec. The spec contains a columnsId and an optional ID.

transactionToken Object

deleteDataItems(idList, transactionToken)

Deletes data items that correspond to the given dataItem IDs.

Parameters:
Name Type Description
idList Array.<String>

List of data items IDs to delete. This will not remove slot mappings to the deleted dataItem IDs. To delete and remove the mappings, use SlotAPI#removeDataItems instead.

transactionToken Object

getDataItem(dataItemId) → {dataItemAPI}

Returns the data item with the given ID.

Parameters:
Name Type Description
dataItemId String

Unique dataItem ID

Returns:

Associated data item (or null)

Type
dataItemAPI

getDataItemList() → {Array.<DataItem>}

Returns a list of all dataItems in this visualization including ones which are not mapped to any slot.

Returns:

dataItemList

Type
Array.<DataItem>

getMappedSlotList() → {Array.<SlotAPI>}

Returns the list of the mapped slots.

Returns:
Type
Array.<SlotAPI>

getMappingInfo(dataItemId) → {MappingInfo}

Returns the data item location in the slots for the supplied dataItemUniqueId.

Parameters:
Name Type Description
dataItemId string

dataItemUniqueId to find in the set of slots.

Returns:

dataItem slot location information (dataItemAPI, slotAPI, indexInSlot). Returns null if the data item is not mapped.

Type
MappingInfo

getMappingInfoList() → {Array.<MappingInfo>}

Returns an array of all the data item mapping information for all the slots.

Returns:

Array of data item mapping information

Type
Array.<MappingInfo>

getSlot(slotId) → {SlotAPI}

Gets the slot with the given ID

Parameters:
Name Type Description
slotId string
Returns:

Slot

Type
SlotAPI

getSlotList() → {Array.<SlotAPI>}

Returns the list of all slots.

Returns:
Type
Array.<SlotAPI>

isMappingComplete(layerId) → {boolean}

Returns true if all of the required slots for the specified layer are mapped and this visualization can be rendered. If no layer is specified, then returns true if at least one layer has all required slots mapped.

Parameters:
Name Type Description
layerId string

(optional)

Returns:

isMappingComplete

Type
boolean

setDataItems(dataItemtIds, slotId, transactionToken) → {Array.<DataItemAPI>}

Changes the data items assigned to an existing slot. Supports reordering and deletion of existing items.

Parameters:
Name Type Description
dataItemtIds Array.<string>

Ordered array of dataItem IDs to assign to this slot.

slotId string
transactionToken Object
Returns:

Array of removed data items

Type
Array.<DataItemAPI>

swapSlots(sourceSlotId, targetSlotId, transactionToken)

Swaps data items between the two slots that are identified by their IDs. The operation should be performed as one transaction.

Parameters:
Name Type Description
sourceSlotId string

ID of the source slot

targetSlotId string

ID of the target slot

transactionToken Object