JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<p>
Here's a simple Plotly plot -
<a href="http://bit.ly/1Or9igj">plotly.js documentation</a>
</p>
<!-- Plots go in blank <div> elements.
You can size them in the plot layout,
or give the div a size as shown here.
-->
<div id="tester" style="width:1400px;height:850px;"></div>
JavaScript
TESTER = document.getElementById('tester');
var npoints = 100000;
var arr=[];
for (var n=0;n<3;n++)
{
var y = [];
for (var i = 0, l = npoints; i < l; i++) {
y.push(Math.random())
};
var x = [];
for (var i = 0, l = npoints; i < l; i++) {
x.push(i);
};
arr.push({type: 'scattergl',x:x, y:y, mode: 'markers'});
}
Plotly.plot( TESTER, [arr[0]], {
margin: { t: 0 } } );
var t0 = performance.now();
Plotly.react(TESTER, [arr[1]]);
var t1 = performance.now();
console.log("Call to react scattergl took " + (t1 - t0) + " milliseconds.")
var t0 = performance.now();
Plotly.react(TESTER,[arr[2]]);
var t1 = performance.now();
console.log("Call 2 to react scattergl took " + (t1 - t0) + " milliseconds.")
arr.forEach(p=>{p.type='scatter'});
var t0 = performance.now();
Plotly.react(TESTER, [arr[1]]);
var t1 = performance.now();
console.log("Call to react scatter took " + (t1 - t0) + " milliseconds.")
var t0 = performance.now();
Plotly.react(TESTER,[arr[2]]);
var t1 = performance.now();
console.log("Call 2 to react scatter took " + (t1 - t0) + " milliseconds.")