Scatter plot state being overwritten on page load