All examples By author By category About

1wheel

regl-ladder-2

Passing arrays of attributes:

attributes: {
  p: () => data.map(({x, y1, dy, isB, speed}) => 
    [x, y1, dy + isB, speed]
  ),
},

is way faster than passing in seperate properties - 100,000 points at 60 fps instead of 14,000.

attributes: {
  speed: () => data.map(d => d.speed),
  x:  () => data.map(d => d.x),
  y0: () => data.map(d => d.y0),
  y1: () => data.map(d => d.y1),
  dy: () => data.map(d => d.dy),
  isB: data.map(d => d.isB)
},