Let's say I have 20,164 binary digits in a standard JavaScript string, for example:
var data = '101010101010101010101010100110001011010101101' ...
What I want to do is see a visual representation of these digits by converting it to a bitmap or perhaps HTML5 canvas image. So if I loop through all the bits and it comes across a 1 it will draw a black pixel, and a 0 the pixel will be white.
So I'm guessing I'll need a 142 x 142 pixel grid something which looks like this:

What's an algorithm or way to do this in JavaScript? All I need to do is display it on the web page so maybe creating a basic bitmap or canvas or SVG image will be fine.
Many thanks