          (fn [_ data] (go (>! ch data))))))
 
 (defn clean-tree! [data]
-  (let [tj (tree->js (schema->tree (:schema (:__unversioned__ (:schemas data)))))
+  (let [tj (tree->js (schema->tree (:schema data)))
         cd (clj->js {:core {:data tj}})
         t (.jstree ($ :#tree) true)]
     (set! (.-data (.-core (.-settings t))) cd)

    om/IInitState
    (init-state [_]
      (let [streams (map :stream (:streams data))
            default (:stream (first (sort-by #(- (:total-events %))
                                             (:streams data))))]
        {:analyse-stream default
         :streams streams}))
    om/IRenderState
    (render-state [_ state]
      (dom/div
       nil
       (dom/h2 nil "Data Analyser")
       (om/build list-streams
                 {:owner owner
                  :analyse-stream (:analyse-stream state)
                  :streams (:streams state)})
       (om/build stream-schema
                 (first (filter #(= (:analyse-stream state) (:stream %))
                                (:streams data))))))))

(defn full-page [data owner]
  (reify


(defn clean-stream [stream]
  (-> stream
      (dissoc :schemas)
      (assoc :export :action/export-stream)))

(defn widget-streams [data owner]
