feat: add viewport renderer#1464
Conversation
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This helps significantly on 100k point maps with lots of burgs, rivers, and labels. Performance NotesMeasured against
Chrome trace over scripted pan/zoom sequence:
|
|
Hello and thanks for the contribution! I like the concept, but the code is really messy and unpolished. If we rethink it into a minimal system, then we can try to go with it. |
|
sure i can do some significant polish ! |
|
I mean we need to rethink the concept. E.g. for burg labels/icon we already have a system to hide them based on zoom level, so we can omit them from DOM as well. Can do the same for routes. You solution is overcomplicated, like on zoom 1 I get 812 burgs of group There is also a dependency on labels positions that we currently keep in svg (not in pack data), so #1313 should be completed first to not lose the data on dom recreation. |
|
ahhh thats makes sense! |
|
Yes, would need to start with a proper planning, PRD creation, then architecture scheme and only then to development. |
|
Drafted an AI PRD for the change: It still requires a lot of thinking as it can be done more elegantly, but the idea is clear. |
0a22038 to
9fc5ced
Compare
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Sorry this took me so long but in accordance with #1313 and the PRD as well as some additional thoughts on the matter, I've recrafted this PR in the newest commit. Quick test with 12,000 burgs and 4,000 routes reduced live heavy-layer nodes by 96.2%, initial drawing from 52.9 ms to 17.5 ms, and layout from 26.1 ms to 13.4 ms. |
Performance
Synthetic stress profile in headless Chromium at scale 5: 12,000 burgs, 4,000 routes, 24 camera moves. Values are one local run and should be treated as directional, not a cross-device guarantee.
masterOn a generated 1,028-burg / 837-route map, scale 1 retained 10 burg icons and 191 route paths. A focused scale-5 viewport retained 19 icons and 27 route paths. A full export clone restored all 1,028 icons, 205 anchors, and 837 routes.