Reputation: 165
I've created a linear heatmap with d3 by binding rectangles to my data (time and value):
Each heatmap can contain hundreds (in some cases thousands) of <rect>
elements. The browser draws them initially without issue, but as I move along my timeline using a d3 axis (zoom behavior and programatic redraws), I see huge performance issues in my transition (a known SVG drawback).
Is there any way I can combat this? Would using a <linearGradient>
with an equal number of <stop>
elements improve things? Do I need to go with canvas instead of SVG?
Thanks!
Upvotes: 1
Views: 630
Reputation: 124089
A linearGradient likely wouldn't help as you'd still need a DOM element for each stop. Canvas sounds like the way to go.
Upvotes: 2