 
         width                 (.-width canvas)
         height                (.-height canvas)
-
         idata                 (.createImageData context width height)
         data                  (.-data idata)
 


(set! (.-onmouseup overlay-canvas) handle-mouseup)


(render-mandelbrot! @app-state)



(def initial-rendering-data
  {:scale          350 ; How many pixels a distance of 1 in the complex plane takes up
   :x0             -3 ; the x co-ordinate of the top-left pixel in the canvase
   :y0             1.2 ; the y co-ordinate of the top-left pixel in the canvase
   })

(defonce app-state (atom {:escape-radius 10000
                          :rendering-data initial-rendering-data}))
