     # TODO - This should only be on in testing
     # @$el.find('canvas').attr('data-hash', ctx.hash());
     
+  resize: () =>
+    canvas_height = @canvas.get('height')
+    canvas_width = @canvas.get('width')
+    # Calculating this each time means that we play nicely with resize tool
+    aspect_ratio = canvas_width / canvas_height
+
+    # kiwi.js falls over if we try and resize too small. 
+    # min_size is currently set in defaults to 100, we can make this
+    # user-configurable in the future, as it may not be the right number 
+    # if people set a large border on their plots, for example.
+    min_size = @mget('min_size')
+    new_width = Math.max(@.el.clientWidth, min_size)
+    new_height = parseInt(new_width / aspect_ratio)
+
+    if new_height < min_size
+      new_height = 100
+      new_width = new_height * aspect_ratio  # Preserves the aspect ratio
+
+    @canvas._set_dims([new_width, new_height])
+    return null
 
   _render_levels: (ctx, levels, clip_region) ->
     ctx.save()

      })

    @update_dataranges()

    @unpause()


      lod_threshold: 2000
      lod_timeout: 500
      webgl: false
      responsive: false
      min_size: 100
    }

  display_defaults: ->
