         (.range  #js [0 (timings-width)]))))
 
 (defn create-root-svg [number-of-containers]
-  (-> (.select js/d3 "#build-timings")
-        (.attr "width"  (+ (timings-width)
-                           left-axis-width
-                           padding-right))
+  (let [root (.select js/d3 "#build-timings")]
+    (-> root
+        (.attr "width" (+ (timings-width)
+                         left-axis-width
+                         padding-right))
         (.attr "height" (+ (timings-height number-of-containers)
-                           top-axis-height))
-      (.append "g") ;move everything over to see the axis
-        (.attr "transform" (gstring/format "translate(%d,%d)" left-axis-width top-axis-height))))
+                          top-axis-height)))
+    (-> root
+        (.select "g")
+        (.remove))
+
+    (-> root
+        (.append "g")
+        (.attr "transform" (gstring/format "translate(%d,%d)" left-axis-width top-axis-height)))))
 
 (defn create-y-axis [number-of-containers]
   (let [range-start (+ bar-height (/ container-bar-height 2))


    om/IInitState
    (init-state [_]
      {:loading? true})

    om/IDidUpdate
    (did-update [_ _ _]
      (if (project-model/show-build-timing? project plan)
        (do
          (draw-chart! build)
          (om/set-state! owner [:loading?] false))
        (analytics/track-build-timing-upsell-impression {:org-name (:org_name plan)
                                                         :reponame (:reponame project)})))
    om/IRenderState

            [frontend.models.build :as build]
            [frontend.models.project :as project-model]
            [frontend.routes :as routes]
            [frontend.components.common :as common]
            [goog.events :as gevents]
            [frontend.disposable :as disposable])
  (:require-macros [frontend.utils :refer [html]]))

(def padding-right 20)
