block by gabrielflorit cacdbf409710d7df2457d3a4d007d0db

Line interpolation with Canvas

Full Screen

This is an experiment to see what’s the most performant way of animating hundreds of lines over time.

This one uses canvas to draw the lines. Every tick, the pre-projected lines are sliced by a given pct, and then drawn. This approach is quite slow, and the bottleneck is the thousands of context.lineTo / context.moveTo canvas calls, not the line interpolation.

Use the slider to manually adjust the line lengths.

Also see Line interpolation with SVG

Made with blockup

script.js

index.html

Makefile

dist.css

draw.js

getFeatures.js

interpolateLineStrings.js

package.json

setupCanvas.js

style.styl

util.js

yarn.lock