 
 (defmethod trace-tree-collect :default [x _] x)
 
-(defn tree-assoc-detail [x row keys]
+(defn tree-assoc-detail [row x keys]
   (update-in x [:response ::details] (fnil conj [])
-    (select-keys row (into [::event ::relative-timestamp ::duration] keys))))
-
-(defn tree-assoc-key-detail [x {:keys [key] :as row} keys]
+    (select-keys row (into [::event ::relative-timestamp ::duration ::style] keys))))
+
+(defn trace-style [row style]
+  (assoc row ::style style))
+
+(defn tree-assoc-key-detail [{:keys [key] :as row} x keys]
   (update-in x [:response ::children key ::details] (fnil conj [])
-    (select-keys row (into [::event ::relative-timestamp ::duration] keys))))
+    (select-keys row (into [::event ::relative-timestamp ::duration ::style] keys))))
 
 (defn trace->tree* [paths path]
   (-> (reduce

            [clojure.walk :as walk]))

(defn now []
  (inst-ms
    #?(:clj  (java.util.Date.)
       :cljs (js/Date.))))

(defn trace [env event]
  (if-let [event-trace (get env ::trace*)]

            parser-trace (trace-enter env' {::event ::trace-plugin})]
        (let-chan [res (parser env' tx)]
          (trace-leave env' parser-trace {::event ::trace-plugin})
          (trace env' {::event ::trace-done})
          (assoc res :com.wsscode.pathom/trace (trace->viz @trace*))))
      (parser env tx))))

