react-sparklines
react-sparklines copied to clipboard
Scrolling Sparkline needs unnecessary values
Cool component!
I noticed today that a sparkline that i'm creating requires to have data that is not actually visible on the graph. For example, my limit
was set to 20. So naturally I was .pop()
ing off of my array to save memory (hoping my sparkilne can work for weeks without refreshing browser, so I was attempting to reduce memory leaks). However, I noticed that the line stopped scrolling when this was done.
Just wondering why we need to keep the old data.
I think the issue you are having is that .pop()
does not create a new array, and thus the component is not initialized. You can create a new array with `.slice()' instead.