Hello!
(Please excuse my poor English.)
I would like to ask two questions.
I have three traces.
var xAverageLine = {
...
}
var yAverageLine = {
...
}
var traces = {
x: x,
y: y,
text: ['A', 'B', 'C', 'D', 'E'],
type: 'scatter',
mode: 'markers',
transforms: [
{
type: 'filter',
enabled: false
},
{
type: 'groupby',
groups: category
}
]
}
So I use
var data = [xAverageLine, yAverageLine, traces]
to save my all traces.
My want to use dropdown menu to filter ‘text’ with array.
–
My first question is :
updatemenus: [{
buttons: [
{
label: 'no filters',
method: 'restyle',
args: ['transforms[0]', {
type: 'filter',
enabled: false
}]
},
{
label: 'filter AB',
method: 'restyle',
args: ['transforms[0]', {
type: 'filter',
...
}]
}
]
}]
Because my data is an array ( [xAverageLine, yAverageLine, traces] ) , if I use
'transforms[0]'
it wouldn’t get ‘traces.transforms[0]’ in [xAverageLine, yAverageLine, traces].
How can I do?
My second question is, can I use an array to filter value of ‘text’?
Like this:
{
label: 'filter AB',
method: 'restyle',
args: ['transforms[0]', {
type: 'filter',
target: 'text',
operation: '=',
value: ['A', 'B']
}]
}
And My graph would draw the points with text ‘A’ and ‘B’.
Any suggestions would be appreciated. Thank you.