         (.append "text")
         (.attr #js {"x" (+ square-size
                            spacing)})
-        (.text #(.-text %)))))
+        (.text #(aget % "text")))))
 
 (defn visualize-insights-bar! [elem builds]
   (let [y-max (apply max (mapcat #((juxt :queued_time_minutes :build_time_minutes) %)

    ;; positive bar
    (-> enter
        (.insert "rect")
        (.attr #js {"class" #(str "bar " (.-outcome %))
                    "y" #(y-pos-scale (.-build_time_minutes %))
                    "x" #(x-scale (.-build_num %))
                    "width" (.rangeBand x-scale)
                    "height" #(- y-middle (y-pos-scale (.-build_time_minutes %)))}))

    ;; negative (queue time) bar
    (-> enter
        (.insert "rect")
        (.attr #js {"class" "bar queue"
                    "y" y-middle
                    "x" #(x-scale (.-build_num %))
                    "width" (.rangeBand x-scale)
                    "height" #(- (y-neg-scale (.-queued_time_minutes %)) y-middle)}))))

(defn chartable-builds [builds]
  (->> builds

        (.append "rect")
        (.attr #js {"width" square-size
                    "height" square-size
                    "class" #(aget % "classname")
                    "transform"
                    (fn [item i]
                      (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
    (-> left-legend-item
        (.append "text")
        (.attr #js {"x" (+ square-size spacing)})
        (.text #(aget % "text")))

    ;; right legend
    (-> right-legend-item
        (.append "rect")
        (.attr #js {"width" square-size
                    "height" square-size
                    "class" #(aget % "classname")
                    "transform"
                    (fn [item i]
                      (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
