Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fast scroll zoom results in out of memory error #7021

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

Open
arnog opened this issue Jun 11, 2024 · 0 comments
Open

Fast scroll zoom results in out of memory error #7021

arnog opened this issue Jun 11, 2024 · 0 comments
Labels
bug something broken P3 backlog

Comments

@arnog
Copy link

arnog commented Jun 11, 2024

See https://codepen.io/arnog/pen/YgZdEZ

  1. Create a heatmap plot with about 500 x 500 elements
  2. Configure the plot with scrollZoom = true and zsmooth = 'fast'
  3. Use the mouse wheel to zoom in rapidly into the plot

Result:

  • the plot is not zoomed in and the console displays "Uncaught RangeError: Invalid array length"

The array being created is the pixel array in which to draw the interpolated heatmap at traces/heatmap/plot.js:238

The problem seems to be that imageWidth and imageHeight are used here and later in the function, perhaps instead of canvasW and canvasH.

(refiled #3615 as per request)

I have seen this on Chrome on macOS. The error happens here:

        if(zsmooth) { // best or fast, works fastest with imageData
            var pxIndex = 0;
            var pixels;

            try {
                pixels = new Uint8Array(imageWidth * imageHeight * 4);
            } catch(e) {
                pixels = new Array(imageWidth * imageHeight * 4);
            }

when executing the new Array in the catch statement. When it happens, imageWidth was 63775964 and imageHeight was 63442058.

@gvwilson gvwilson self-assigned this Jul 12, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added bug something broken P3 backlog labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants