fixture/index.js
function drawToCanvas({data, width, height}) {
  if (typeof document === 'undefined') return null

    var canvas = document.createElement('canvas')
    canvas.width = width
    canvas.height = height
    var context = canvas.getContext('2d')
    var idata = context.createImageData(canvas.width, canvas.height)
    for (var i = 0; i < data.length; i++) {
      idata.data[i] = data[i]
    }
    context.putImageData(idata, 0, 0)
    return canvas
}
function drawToCanvas({data, width, height}) {
  if (typeof document === 'undefined') return null

    var canvas = document.createElement('canvas')
    canvas.width = width
    canvas.height = height
    var context = canvas.getContext('2d')
    var idata = context.createImageData(canvas.width, canvas.height)
    for (var i = 0; i < data.length; i++) {
      idata.data[i] = data[i]
    }
    context.putImageData(idata, 0, 0)
    return canvas
}
function drawToCanvas ( { data , width , height } ) { if ( typeof document === 'undefined' ) return null var canvas = document . createElement ( 'canvas' ) canvas . width = width canvas . height = height var context = canvas . getContext ( '2d' ) var idata = context . createImageData ( canvas . width , canvas . height ) for ( var i = 0 ; i < data . length ; i ++ ) { idata . data [ i ] = data [ i ] } context . putImageData ( idata , 0 , 0 ) return canvas }
draw buffer on the canvas
draw buffer on the canvas