 (defn render-table-row
   [index row bar-column max-value]
   [:tr {:style (if (odd? index) "color: rgb(189,193,191);" "color: rgb(124,131,129);")}
-    [:td {:style bar-td-style} (format-cell (first row))]
-    [:td {:style (str bar-td-style "font-weight: 700;")} (format-cell (second row))]
+    [:td {:style bar-td-style} (-> row first format-cell h)]
+    [:td {:style (str bar-td-style "font-weight: 700;")} (-> row second format-cell h)]
     (if bar-column [:td {:style (str bar-td-style "width: 99%;")}
       [:div {:style (str "background-color: rgb(135, 93, 175); height: 20px; width: " (float (* 100 (/ (bar-column row) max-value))) "%")} "&#160;"]])])
 

      [:thead
        [:tr
          [:th {:style (str bar-td-style bar-th-style "min-width: 60px;")}
            (-> cols first :display_name upper-case)]
          [:th {:style (str bar-td-style bar-th-style "min-width: 60px;")}
            (-> cols second :display_name upper-case)]
          (if bar-column [:th {:style (str bar-td-style bar-th-style "width: 99%;")}])]]
      [:tbody
        (map-indexed #(render-table-row %1 %2 bar-column max-value) rows)]]))

(defn render-bar-chart
  [data]
  [:div {:style ""}
    (render-table data second)])

(defn render-scalar
  [data]
  [:div {:style scalar-style}
    (-> data :rows first first format-cell)])

(def ^:private sparkline-dot-radius 6)
(def ^:private sparkline-thickness 4)

(ns metabase.pulse
  (:require [hiccup.core :refer [html h]]
            [clj-time.core :as t]
            [clj-time.coerce :as c]
            [clj-time.format :as f]
