       
     @inPorts.commands.on 'data', (commands, i) =>
       @commands[i] = commands
+      if @every
+        @parse @commands
+
 
     # TODO listen for detach / reindex
 
 
   parse: (commands) =>
+    return unless @context
     for command in commands
       for instr, args of command
         if @[instr]?
           @[instr].apply @, [args]
+    if @outPorts.canvas.isAttached()
+      @outPorts.fill.send @canvas
 
   clear: (rectangle) =>
     if rectangle

  description: 'Draws received drawing commands'
  icon: 'pencil-square'
  constructor: ->
    @canvas = null
    @context = null
    @commands = []
    
    @inPorts =
      tick: new noflo.Port 'bang'
      canvas: new noflo.Port 'object'
      commands: new noflo.ArrayPort 'object'

    @inPorts.tick.on 'data', (tick) =>
      if @context

        return
      @sendLog
        loglevel: 'error'
        message: 'Received commands but there is not 2d context attached.'

    @inPorts.every.on 'data', (data) =>
      @every = data

    @inPorts.canvas.on 'data', (canvas) =>
      @canvas = canvas
