Download raw trace data to csv

I am trying to create an interactive plot that plots a function with sliders. I followed the examples on how to create the slider, which is to create the different traces for each slider step. I want to allow users to download only the plotted trace to csv but when using the suggestion from here it downloads all the traces.

Is there something that can be hard coded with python/plotly that will allow the current plot to be downloaded to csv? Possibly a button?