Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why Plotly.react() is as slow as Plotly.newPlot()? updating single trace of many #5674

Open
KestutisMa opened this issue May 21, 2021 · 0 comments

Comments

@KestutisMa
Copy link

@KestutisMa KestutisMa commented May 21, 2021

Hi, I am trying to redraw only single trace in a plot of many traces (biophysical data). I tried to follow instructions in react-plotly and plotlyjs documentation:
https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact
Plot is updated but I don't see any performance improvement if I change only single element of data or all data elements:
Here is MWE in codepen
Briefly, I generated sample data 100 traces of 10000 points and changing only first trace with:

  data[0].x =  [...Array(10).keys()].map( c=> c/10) //change only first trace
  data[0].y =  [...Array(10).keys()].map( c=> Math.random())
  Plotly.react('myDiv', data, layout);

Drawing plot containing single trace takes just a split of second, but if I had already drawn many traces and I want to redraw only single trace, it takes same time as to redraw all traces (few seconds).
Am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant