Skip to content

Hidden scatterplot instance throws an error when shown interactively #20

@plankter

Description

@plankter

I could reproduce the issue #17. The problem occurs when plot is created, but hidden (in my case i created multiple plots in different Vuetify tabs). Probably this is due to canvas.getBoundingClientRect() returning (0, 0) somewhere in regl-scatterplot code in such cases.

I created a small demo to show this behavior. Second canvas is hidden, and then should be displayed when one makes a selection on the first canvas. But instead it'll throw errors like the following when mouse is over second canvas:

Uncaught TypeError: Cannot read property '0' of null
    at Module.transformMat4 (vec4.js:529)
    at getScatterGlPos (index.js:201)
    at raycast (index.js:206)
    at mouseMoveHandler (index.js:372)

Sorry if the demo is a bit awkward.

https://github.com/plankter/regl-scatterplot-two-instances

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions