Rich-Harris / pancake

Experimental charting library for Svelte

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quadtree: find does not work because of width / height = 0

olivierchatry opened this issue · comments

Hello,

It seems like there is a bit of an issue whit Quadtree class trying to read width and height that it get from the Chart context. These values seems to be bound to clientWidth and clientHeight of the chart component, but for some reason are evaluating to 0.

Seems like this sample also have the same issue :
https://svelte.dev/repl/3eaa39931e8045cf87da8b482e502c29?version=3.26.0

So when the mouse move, the cursor do not update.

It works on the main page, but not on the REPL

So been debugging a bit, and it seems like the resize event only get trigger at the beggining, and the clientWidth at this moment is 0. I'm guessing it is because my points are empty when I start.

Yep banco, if I add a if so that the component is only created when I actually have data, then the clientWidth and clientHeight is set correctly and quadtree is able to find data.
Not sure if it can be considered as a bug.