-
Notifications
You must be signed in to change notification settings - Fork 37
Canvas & Svelte 5 infinite effect loops #250
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
Comments
Although the library itself is built with Svelte 5, it hasn't yet been updated to use runes. See here for more info: #156. The short version is this library is a collection of stores and will likely need a full rewrite using runes. The reason why that hasn't been done is a) if I migrate to runes, Svelte 4 loses support b) I haven't had the bandwidth. I was aiming for migrating it closer to when Svelte 6 came out and I'm guessing support for Svelte 3 and 4 features is dropped. In terms of solving your immediate problem, there's a note in the docs about a related issue with infinite loops which may be relevant. See also #50 @techniq has done some cool stuff overhauling canvas support here techniq/layerchart#295 but I haven't yet had the chance to see how that approach would be relevant to layercake. |
The solution for LayerChart was to implement a component registration system where each primitive component registers a LayerChart just released 0.90 which took this further and implemented an integrated offscreen hit canvas to enable mouse/pointer events (see related Bluesky post) |
Thanks both will have a look |
I've been experimenting with some canvas components here. This is just a quick first attempt to get things working: https://github.com/mhkeller/tks_map-layercake/blob/abd4269d09599fec81ccc8bb82a7331d7becb223/src/lib/layercake-components/canvas/MapPolygon.canvas.svelte |
All the examples in the docs use $:, if you want to use effect and also do something like
$ctx.strokeStyle
you get an infinite effect loopIf there is a way to do this properly it would be good to add it to the docs
The text was updated successfully, but these errors were encountered: