 (defn series-tsplot [ series ]
   (let [ series-state (atom { }) ]
     (reagent/create-class
-     {:display-name (str "series-tsplot-" (:name series))
+     {:display-name (str "series-tsplot-" series)
       :component-did-update
       (fn [ this ]
         (tsplot-draw (reagent/dom-node this) (dom-width (:dom-node @series-state)) (:series-data @series-state)))

(defn series-pane [ series ]
  [:div.series-pane
   [:div.series-pane-header
    [:span.series-name (:name series)]]
   [series-tsplot series]])

(defn series-list [ ]
  [:div
   (for [ series (:series @dashboard-state) ]
     ^{ :key (:name series) } [series-pane series])])

(defn end-edit [ text state ]
  (let [ qws (js/parseInt text) ]

  (.addEventListener js/window "resize" on-window-resize)
  (on-window-resize nil)
  (go
    (swap! dashboard-state assoc :series (<! (<<< fetch-series-names)))))

(run)
