       "int"  #(format int-fmt-s (float %))
       "date" #(date->str (d->millis %)))))
 
-(defn range->str [[mn mx] typ]
+(defn range->str
   "Converts a range of typ (int|date) to a string."
+  [[mn mx] typ]
   (let [[mn mx] [(ceil mn) (floor mx)]
         fmt (int->str typ :digits 0)]
     (if (<= mx mn) (fmt mn)

  [st]
  (let [ans (js/parseInt st)] (when-not (js/isNaN ans) ans)))

(defn str->int [typ]
  "Converts string to integer, for typ (int|date)."
  (case typ
    "int" parse-int
    "date" (fn [date-string]

       (response-count-message non-nil-count)])))

(defn table-chart-h
  "Create category bar chart out of some data + count data. Data of form:
  {'Label1' 1 'Label2' 2}, etc. where the numbers are counts."
  [data nil-count non-nil-count field_type]
  (let [max-count (apply max (vals data))
        percent-s (fn [n total]
                    (let [s (scale/linear :domain [0 total] :range [0 100])]
