Pretty clever. I was trying to figure out if there was some DOM API to paint HTML to canvas that I did not know about.... I had to stare at it a few times to realize what was going on :-)
The code runs a DOM query to find the elements configured through the keys of the `styles` object on the parameters/configuration, then for each of those selectors, calculates a rect relative to the size of the canvas, and paints a colored rectangle for each of those elems (using the color coming form the values on styles). [1]
The code runs a DOM query to find the elements configured through the keys of the `styles` object on the parameters/configuration, then for each of those selectors, calculates a rect relative to the size of the canvas, and paints a colored rectangle for each of those elems (using the color coming form the values on styles). [1]
1: https://github.com/lrsjng/pagemap/blob/master/src/pagemap.js...