Resize capability added#19
Conversation
The Grafar library now supports automatic window and container resizing! This enhancement allows 3D visualizations to dynamically adjust when the browser window or container element is resized, making the library much more robust for responsive web applications.
this should be better
|
Hi @TekkadanPlays and thanks for the contribution! Long time no maintain, I'll need a few weeks to review the changes, update pipelines and ship it. Fell free to ping. |
|
Thanks! No rush at all, truthfully I don't have a clue how to build a library and I was very confident when I pushed the changes carefully. I was using Grafar for a few days with p5.asciify and I was having a lot of fun! I think perhaps I was able to solve the issue because the example pages don't rely on React (to my knowledge). I tried to implement my own solution in a React environment and got confused. I think perhaps there is a better practice for integrating this into a React environment but I probably won't be messing with this again for now. Love this library though and expect to use it again in the future. I have just discovered and began migrating myself to Inferno.js in an attempt to completely get away from React. So far it's going well but I am migrating a native port of shadcn UI to Inferno, so I have simply changed short-term trajectory from what I was working on. Nonetheless the solution for the flickering graph is to add a 1ms debounce to allow the graph to update "not too fast for WebGL to literally display the redrawing" edit: (and also to re-center and re-scale the object as needed) I assume this solution can be worked across any framework or language but you can probably do it better than I did. I used Cursor AI for all solutions. Good luck, I really look forward to using Grafar again soon! |
The Grafar library now supports automatic window and container resizing! This enhancement allows 3D visualizations to dynamically adjust when the browser window or container element is resized, making the library much more robust for responsive web applications.
Disclaimer: Please review these changes carefully as I am not proficient with git and I also don't know if this will cause breaking changes to the library. But it does work nicely.