This follows up this question where I wanted a dynamic array to add and remove values. I’ve gone down the route of trying trigger and toggle with a dataset.
button_clicked
is a signal that takes on string values (the key of the button clicked) depending on a text mark being clicked. Using trigger and toggle I am expecting it to add a button key if it is not present, remove it if it is.
However it just keeps adding the keys without removing them. Is there something else needed to make this work?
...
"data": [
{
"name": "button_state",
"on": [
{
"trigger": "button_clicked",
"toggle": "button_clicked"
}
]
}
]
...
After investigating the Gantt chart visual from David Bacci I figured out one has to send an object.
"data": [
{
"name": "button_state",
"on": [
{
"trigger": "button_clicked",
"toggle": "{clicked: button_clicked}"
}
]
}
]
Also set force
to true for the signal in order to have it fire repeat clicks on the same mark.