All examples By author By category About

tpreusse

Fast Hoverable Dots beyond 20'000

Rendering more than 20'000 SVG circles will slow down every browser. Render time, scroll and hover performance degrade to an in-actable level. This examples illustrates how to render an almost infinite amount of hoverable circles with canvas, d3.timer (requestAnimationFrame) and d3.geom.quadtree.

Be aware of iOS image size limitation which also apply to canvas. Potential solution is to disable retina (window.devicePixelRatio) on older iPads and iPhones.

Open the example in a new window to see the rendering adapt to scrolling and window width changes.

This is an extracted example of the rendering code behind 2014.nzz.ch.