-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
doxo/heatmap.js
#1Description
When using heatmap.js on certain browsers, this error Cannot assign to read only property 'data' of object shows up.

I'm able to reproduce on chromium that is packaged with electron version 1.3.3.
This seems to happen because the data property of ImageData object is being replaced directly in this part of the code. https://github.com/pa7/heatmap.js/blob/master/src/renderer/canvas2d.js#L280
data property seems to be read only on certain browser versions. To fix it, we need to delete this line because imgData and img.data points to the same reference. Any modifications you do to imgData is already reflected to img.data. I'll put up a PR soon.
njifares, Markus-Ende, beyerleinf, JZYoshi, Jackyyans and 5 more