You might find this video useful or interesting: https://youtu.be/by9lQvpvMIc
I've been tempted to do something similar for browser canvas, perhaps with some slightly different choices than he made. His approach uses a very elegant way of looking at things though.