 
 (def mouse-click (from-event canvas "click"))
 
-(def cycle-color
-  (tconcat (.takeUntil red mouse-click)
-          (defer #(tconcat (.takeUntil blue mouse-click)
-                          cycle-color))))
-
-(-> (.zip sine-wave cycle-color #(vector % %2))
-    (.take 600)
-    (.subscribe (fn [[{:keys [x y]} color]]
-                  (fill-rect x y color))))
+(def mouse-over (from-event canvas "over"))
 
 (defn write-text []
   (set! (.-font ctx) "20px Arial")
   (set! (.-fillStyle ctx) "white")
-  (.fillText ctx "Drugs" 530 780))
+  (.fillText ctx "Drugs" 780 780))
 
 (write-text)
 

(defn write-coordinate-labels []
  ())


(write-rotated-text)

(.log js/console "test new line ")
(.log js/console (str "Math.PI value:" Math/PI))

    (.subscribe (fn [xysin]
                  (.log js/console (str xysin)))))


;;ctx.beginPath();
;;ctx.arc(100,75,50,0,2*Math.PI);
;;ctx.stroke(); ;; draws the border line
;; arc (x, y, radius, start angle[rad], ending angle[rad])
(defn fill-circle [x y color size]
  (set! (.-fillStyle ctx) color)
  (set! (.-lineWidth ctx) 0)
  (.beginPath ctx)
  (.arc ctx x y size 0 (* 2 Math/PI))
  (.fill ctx)
  )

(fill-circle 300 300 "red" 20)
(fill-circle 300 300 "yellow" 10)
(fill-circle 300 300 "blue" 5)

(defn fill-rect [x y color pixel]
  (set! (.-fillStyle ctx) color)
  (.fillRect ctx x y 2 2))

;; fill rect for 1 pixel size
(defn fill-rect1 [x y color]
  (fill-rect x y color 1))

(defn fill-rect2 [x y color]
  (fill-rect x y color 2))


(def color (.map sine-wave
