Skip to main content
100%

A Fair Number of Transitions

✓ Published0🌍 Public
Aandrew-reid
Last edited Sep 17, 2018
Created on Sep 14, 2018

One hundred thousand points travel along their own three-segment paths, converging and diverging through six rough vertical zones as they loop back and forth. The animation runs ten cycles, building a glowing field of motion trails on a 960 by 500 canvas. Each point’s path is computed from random start and end points with clustered control points, and the renderer uses Canvas `getImageData` and `putImageData` to accumulate bright pixels directly, with `requestAnimationFrame` driving the frame loop. The code is a hand-optimized, D3-free implementation focused on raw performance.

AI-generated description

An effort to see how many points I can animate along their own paths (each path has three segments, each path goes through 2 of six rough areas).

100 000 nodes are animated in this (10 loops).

Some browsers may not work with this many transitions. Based on quick work for this SO question.

No D3, awkward code to try and improve performance, not as readable as I'd like, but the results are pretty good (for me it is best on Chrome, Firefox is slower, haven't tried others yet).

There are 500 000 node and 1 000 000 node versions of this (same code, more nodes, just to see not intended for actual use).

Updated to swap parseInt for Math.floor, as noted by RioV8 in linked SO question as an improvement

Similar vizzes