Hey guys, first time posting here so be easy with me . So i have this plotly graph
After digging through the source code, I found the answer to this question - the ‘plotly_sliderend’ event:
// The div container holding your Plotly chart
let container = document.getElementById('graphDiv');
container.on(‘plotly_sliderend', function(data) {
// If you have multiple sliders, this event is triggered by all of them: can give the sliders a ‘name’ property
// to distinguish them
if (data.slider.name === 'Threshold') {
alert(data.step.value);
}
});
If you call newPlot() again on the same <div>
the event is lost, so has to be redeclared. See plotly.js/draw.js at 6c5d30ffa7c2574f9a079844e32cb3dd87af9000 · plotly/plotly.js · GitHub for the event object’s structure.