embedding-api-v3-guide
embedding-api-v3-guide copied to clipboard
selectMarksByValueAsync function doesn't select the data correctly in a Viz
Hello, We recently found out that the selectMarksByValueAsync function is not working properly with a RangeValue as SelectionCriteria.
We used a sample workbook that you can find in the attached file to open a viz on Tableau Cloud with the latest version of the embedding API. The worksheet represents a SUM(Sales) graph; we want to select every mark between 0 and 20,000.
Steps to reproduce:
-
Open the viz.
-
Create a SelectionCriteria as follows:
{
fieldName: "SUM(Sales)",
value: {
min: 0,
max: 20000
}
}
Note: we did not add a nullOption here as it's not mandatory but we also tested with all the possible nullOptions.
- call the selectMarksByValueAsync function with the select-add selectionUpdateType.
Observed behaviour:
=> Many marks are selected even the ones outside the 0 < value < 20 000 range.
-OR-
=> No values are selected
Expected behaviour:
=> Only the marks in the 0 < value < 20 000 range are selected.
Note: We created a glitch.io with minimalist code to reproduce this issue easily:
- Click on the load button (you potentially need to manually log to Tableau if the token is not present on your browser)
- Click on the "Select marks" button
If the link to the viz to open does not work, you can easily edit here on l.12 of script.js
Worksheet | Embedding API