Sha256: 522250faf1d03e7f2719fee350c87d9fb4648971e7ccb690e2f972422e4eda65
Contents?: true
Size: 1.18 KB
Versions: 4
Compression:
Stored size: 1.18 KB
Contents
<!DOCTYPE html> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1"/> <style> html, body { height: 100%; } body { margin: 0; } svg { display: block; overflow: hidden; width: 100%; height: 100%; } </style> <body> <script src="../../d3.js"></script> <script> var color = d3.scale.category10(); var svg = d3.select("body").append("svg"); d3.select("body") .on("touchstart", touch) .on("touchmove", touch) .on("touchend", touch); function touch() { d3.event.preventDefault(); var circle = svg.selectAll("circle.touch") .data(d3.touches(svg.node()), function(d) { return d.identifier; }) .attr("cx", function(d) { return d[0]; }) .attr("cy", function(d) { return d[1]; }); circle.enter().append("circle") .attr("class", "touch") .attr("cx", function(d) { return d[0]; }) .attr("cy", function(d) { return d[1]; }) .style("fill", function(d) { return color(d.identifier); }) .attr("r", 1e-6) .transition() .duration(500) .ease("elastic") .attr("r", 48); circle.exit() .attr("class", null) .transition() .attr("r", 1e-6) .remove(); } </script>
Version data entries
4 entries across 4 versions & 2 rubygems