                                                                (* spacing (dec numPages)))
                                                start-x (/ (- (nth size 0) totalDotSize)
                                                           2)]
-                                           (println size)
                                            (doseq [n (range (count dot-nodes))
                                                    :let [dot-node (nth dot-nodes n)]]
                                              (.. dot-node (setPosition (+ start-x

        (setMountPoint .5, 1, 0))
    root-dot))

(defn Carousel [selector data]
  (let [context (.. FamousEngine (createScene selector))
        root-node (.. context addChild)
        back-node (.. root-node addChild)
        next-node (.. root-node addChild)
        dots-node (create-dots root-node)

        back (decorate-arrow-node back-node "<")
        next (decorate-arrow-node next-node ">")


(defn decorate-arrow-node [arrow-node text]
  (.. (DOMElement. arrow-node)
      (setProperty "color" "white")
      (setContent text)
      (setProperty "fontSize" "40px")
      (setProperty "lineHeight" "40px")
      (setProperty "cursor" "pointer")
      (setProperty "textHighlight" "none")
      (setProperty "zIndex" "2"))
  (.. (GestureHandler. arrow-node) (on "tap" (fn []
                                               (println text))))
  
  )

(defn decorate-dots [dots-node]
  (let [dot-nodes (.. dots-node getChildren)
        resize (clj->js {:onSizeChange (fn [^Float32Array size]
                                         "NOTE: this call back is called only once because root-dot setSizeMode is ABSOLUTE (value of 1)"
                                         (let [size (IndexedSeq. size 0)
                                               dotWidth 10
                                               numPages 5
                                               spacing 5
