Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when container has 0 width/height #110

Open
thomasneirynck opened this issue Jul 30, 2019 · 2 comments
Open

Crashes when container has 0 width/height #110

thomasneirynck opened this issue Jul 30, 2019 · 2 comments

Comments

@thomasneirynck
Copy link

thomasneirynck commented Jul 30, 2019

Throws an uncaught error when the canvas 0 width/height. This can arise when the container for the canvas element has 0 width/height

This is due to https://github.com/mourner/simpleheat/blob/gh-pages/simpleheat.js#L114 in simpleheat. It's illegal to call getImageData with a 0 width/height.

From https://www.w3.org/TR/2dcontext2/#dom-context-2d-getimagedata

The getImageData(sx, sy, sw, sh) method must, if either the sw or sh arguments are zero, throw an IndexSizeError exception

This causes elastic/kibana#20423 in Kibana. Map widgets on a Kibana dashboard may have 0 width/height under certain conditions (e.g. during browser resizing).

@thomasneirynck
Copy link
Author

There is actually an open PR for this in simpleheat mourner/simpleheat#34

@Dumbaz
Copy link

Dumbaz commented Jun 18, 2020

Hi, is there an update on this one? We would appreciate this getting fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants