Get&Set on selected traces


I want to allow my users to save their selection of visible traces. How can I access this information & is it possible to initialize the chart in this way?

they press a save button somewhere --> next time they open the page, chart is shown with only trace0 selected


Yes, we store that info on your graph’s div element:

var gd = document.getElementById('graph')

var traceVisibility = => trace.visible);