var Canvas = require('canvas-browserify/browser')

var graph = require('./')

if(process.title !== 'node') {
  var createTable = require('dat-table').createTable
  window.LineGraph = function (data, opts) {
    document.body.innerHTML = ''
    var canvas = Canvas()
    canvas.width = opts.width || 1000
    canvas.height = opts.height || 600

    var ctx = CTX = canvas.getContext('2d')
    graph(ctx, createTable(data))
    document.body.appendChild(canvas)
  }

//  var canvas = Canvas()
//  canvas.width = 1000
//  canvas.height = 600
//  var ctx = CTX = canvas.getContext('2d')
//  graph(ctx, createTable(require('./test/fib.json')), {title: 'fib generators'})
//  document.body.appendChild(canvas)
//

  var canvas = Canvas()
  canvas.width = 1000
  canvas.height = 600
  var ctx = canvas.getContext('2d')
  graph(ctx, createTable(require('./test/merkle.json')), {title: 'Time to build a merkle tree'})
  document.body.appendChild(canvas)
}


@@ -1,17 +1,17 @@
 var 
-C
+c
 anvas = 
 requ
@@ -10,46 +10,43 @@
 s = 
-require('canvas-browserify/browser
+document.createElement('canvas
 ')%0A%0A
+%0A
 var 
@@ -234,34 +234,8 @@
  ''%0A
-    var canvas = Canvas()%0A
     
@@ -676,32 +676,8 @@
 //%0A%0A
-  var canvas = Canvas()%0A
   ca
@@ -885,11 +885,13 @@
 canvas)%0A
-
 %7D%0A%0A
+%0A%0A

fix example