Best way to update graph without creating and passing an object with new vars

Here’s my file:
Plotly file

I’m trying to update ‘data’ to newData’. I’m avoiding using newPlot due to memory constraints and the data content is returned from the server with a number of varying options.


var data = [ {
x: [‘VALUE 1’], // in reality I have more values…
y: [20],
type: ‘bar’

This method is unavailable to me as it could have x,y,y2… etc and I can’t account for all the possibilities.
I just need it to update the traces, I don’t need a new plot.

Please assist.