In plotly.js, how may I get call a javascript callback called when a slider is changed,

I have found an answer in

It is very tricky. The documentation should provide an example of this common task. If you have many slidders, you should
set a name property for each and check its name as in this code

function handleSliderChange(e) {
let sliderName=e.slider.name
let stepLabel = e.step.label
if (sliderName==‘a’)
{
console.log(“a=”,stepLabel)
}
else if (sliderName==‘b’)
{
console.log(“b=”,stepLabel)
}
}

1 Like