How to remove the prepended Data from traces

I am trying to Implement an option for users to offset the traces in a line plot.
So if a user types in an offset value of 10 all the data points should be offset by 10 ticks in x-axis.
Here is an example codepen

In order to achieve this, I am using the Plotly.prependTraces.

But now I am not sure how to remove this prepended data from each trace, if user types in 5 or even 0. I doubt that this is not possible without redrawing the plot with a freshly fetched data.

I would like to know if someone out there has already solved this in a different way.