Example
content.getFeature('DataPointSelections')
Methods
clearAll(transactionToken) → {Promise}
Clears all data point selections from the visualization
Parameters:
Name | Type | Description |
---|---|---|
transactionToken |
TransactionToken | Transaction token |
Fires:
- DataPointSelectionsAPI#event:CanvasAPI change:content:selections:clearAll
- DataPointSelectionsAPI#event:ContentAPI change:selections:clearAll
Returns:
resolved when datapoint selection has been cleared
- Type
- Promise
deselect(dataPointSelection, transactionToken) → {Promise}
Deselects data points of the visualization with the given selection spec.
Parameters:
Name | Type | Description |
---|---|---|
dataPointSelection |
Array.<DataPointSelection> | Array of data point selection spec |
transactionToken |
TransactionToken | Transaction token |
Fires:
- DataPointSelectionsAPI#event:CanvasAPI change:content:selections:deselect
- DataPointSelectionsAPI#event:ContentAPI change:selections:deselect
Returns:
resolved when datapoint has been deselected
- Type
- Promise
getSelections(selectedDataItemList) → {Array.<DataPointSelection>}
Returns the list of data point selections.
Parameters:
Name | Type | Description |
---|---|---|
selectedDataItemList |
Array | Optional array containing the selected data items |
Returns:
Array of data point selections
- Type
- Array.<DataPointSelection>
isSelected(dataPointSelection) → {boolean}
Checks whether the given resolved items are selected.
Parameters:
Name | Type | Description |
---|---|---|
dataPointSelection |
Array.<DataPointSelection> | Array of data point selection spec |
Returns:
True if the resolved items are included in the current selections.
- Type
- boolean
select(dataPointSelection, transactionToken) → {Promise}
Selects data points of the visualization with the given selection spec.
Parameters:
Name | Type | Description |
---|---|---|
dataPointSelection |
Array.<DataPointSelection> | Array of data point selection spec |
transactionToken |
TransactionToken | Transaction token |
Fires:
- DataPointSelectionsAPI#event:CanvasAPI change:content:selections:select
- DataPointSelectionsAPI#event:ContentAPI change:selections:select
Returns:
resolved when datapoint has been selected
- Type
- Promise
Type Definitions
Category
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
dataItemId |
String | dataItem id of the category data |
columnId |
String | column id of the category data |
label |
String | display label of the category data |
value |
String | value of the category data |
DataPointSelection
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
categories |
Array.<Category> | Array of categeory specs |
|
facts |
Array.<Fact> |
<optional> |
Array of categeory specs |
Fact
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
dataItemId |
String | dataItem id of the fact data |
columnId |
String | column id of the fact data |
value |
String | value of the fact data |