Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 773f4de

Browse files
committed
Add call to requestAnimationFrame for rangeslider calls
1 parent 826ed94 commit 773f4de

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/rangeslider/create_slider.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,15 @@ module.exports = function createSlider(gd, minStart, maxStart) {
224224
dataMin = min / width * range + rangeMin,
225225
dataMax = max / width * range + rangeMin;
226226

227-
Plotly.relayout(gd, 'xaxis.range', [dataMin, dataMax]);
227+
if(window.requestAnimationFrame) {
228+
window.requestAnimationFrame(function() {
229+
Plotly.relayout(gd, 'xaxis.range', [dataMin, dataMax]);
230+
});
231+
} else {
232+
setTimeout(function() {
233+
Plotly.relayout(gd, 'xaxis.range', [dataMin, dataMax]);
234+
}, 16);
235+
}
228236
}
229237

230238

0 commit comments

Comments
 (0)