New code for the heatmap based on canvas