This updates the component so that the size is more dynamic.
It now bases the size of the canvas off either the given size, or the window width if no size is provided.
It also generates random IDs for the canvas and wheel element so that if you wanted you could have more than one on a page and not have conflicts.
There is some code clean up that would make it a bit more type safe if ever converted to TypeScript, which is how I was using it.
This updates the component so that the size is more dynamic. It now bases the size of the canvas off either the given size, or the window width if no size is provided.
It also generates random IDs for the canvas and wheel element so that if you wanted you could have more than one on a page and not have conflicts.
There is some code clean up that would make it a bit more type safe if ever converted to TypeScript, which is how I was using it.