So if we use
let updatemenus=[ { buttons: [ { args: ['data' , update], label:'Milliseconds', method:'restyle', execute: false } ], direction: 'left', pad: {'r': 10, 't': 10}, showactive: true, type: 'buttons', x: 0, xanchor: 'left', y: -0.1, yanchor: 'top' } ];
let update = {x: [xnew, xnew2], y:[yold, yold2]}
let layout_update = {
updatemenus: updatemenus
};
Plotly.relayout(graphElement, layout_update);
// Plotly.restyle(graphElement, update, [0,1])
When we use restyle explicity ,it works fine and the button updates the 2 traces in the plot with new ones. But the updatemenus Buttons has no option to specify the traces anywhere, the button shows up on the plot, but clicking it doesnt do anything, and gives no error in the console.
How do we specify the traces it has to work on, and can we specify multiple traces in an optional format kind of way
traces = [0, [1]]
which would select [0] in all cases, and 1 if specified