D3 browser memory usage test
xxxxxxxxxx
<meta http-equiv="X-UA-Compatible" content="IE=9">
<html>
<body>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript">
var svg = d3.select("body").append("svg").attr( {width: 800, height: 800 });
var data = new Array(1000);
function randomizeData() {
for (var i = data.length - 1; i >= 0; i--) {
data[i] = { id: Math.random(), x: Math.random()*800, y: Math.random()*800 }
};
}
function update() {
randomizeData();
var circles = svg.selectAll("circle")
.data(data, function(d) { return d.id; } );
circles.exit().remove();
circles.enter().append("circle")
.attr("id", function(d) { return d.id; })
.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; })
.attr( { r: 5, fill: 'blue' })
.on("mouseenter", function(d) { console.log('mouse enter') });
}
setInterval(update, 1000);
</script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js