A series of related examples:
- Canvas geometric zooming
- Canvas semantic zooming
- SVG geometric zooming
- SVG semantic zooming
Using
d3.transition().duration(0).each('end', function() {
circle.attr("transform", transform);
});
instead of directly calling
circle.attr("transform", transform);
making the animation look smoother on my mobile devices, since it will be rendered inside an animationFrame and only as often as the browser can handle it, instead of every time an event comes in.
Compare to M. Bostock's example.