Skip to content

Commit d87a468

Browse files
committed
Add a requestAnimationFrame polyfill
1 parent f07a274 commit d87a468

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/components/rangeslider/create_slider.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,9 @@ module.exports = function createSlider(gd) {
221221
}
222222

223223
function setDataRange(dataMin, dataMax) {
224-
225-
if(window.requestAnimationFrame) {
226-
window.requestAnimationFrame(function() {
227-
Plotly.relayout(gd, 'xaxis.range', [dataMin, dataMax]);
228-
});
229-
} else {
230-
setTimeout(function() {
231-
Plotly.relayout(gd, 'xaxis.range', [dataMin, dataMax]);
232-
}, 16);
233-
}
224+
window.requestAnimationFrame(function() {
225+
Plotly.relayout(gd, 'xaxis.range', [dataMin, dataMax]);
226+
});
234227
}
235228

236229

tasks/stats.js

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function getInfoContent() {
5252
'',
5353
'```html',
5454
'<script>if(typeof window.Int16Array !== \'function\')document.write("<scri"+"pt src=\'extras/typedarray.min.js\'></scr"+"ipt>");</script>',
55+
'<script>document.write("<scri"+"pt src=\'extras/request_animation_frame.js\'></scr"+"ipt>");</script>',
5556
'```',
5657
'',
5758
'before the plotly.js script tag.',

0 commit comments

Comments
 (0)