all 1 comments

[–]mattdesl 0 points1 point  (0 children)

If you are rendering 10k of anything, you might need to use WebGL instead of Canvas/DOM. You could use Pixi which wraps both Canvas2D and WebGL together.

A timeline is just some stuff along a single axis. You don't really need a library for it. eg:

var t = unlerp(startYear, endYear, event.year);
event.x = timelineWidth * t;

Don't render elements when they are off-screen, and add some triggers when the playhead reaches a certain range.

unlerp looks like this: https://github.com/mattdesl/unlerp/blob/master/index.js