                FROM fips_codes
                INNER JOIN unemployment ON (1000*fips_codes.state_fips + fips_codes.county_fips) = unemployment.fips_county
                WHERE fips_codes.entity_desc='County'
-               ORDER BY y DESC LIMIT 20"]))
+               ORDER BY y DESC LIMIT 25"]))
 
 ;; counties with highest unemployment rate
 (plot (-> highest-unemployment-counties
-          vt/stacked-bar
+          stacked-bar
           vertical-x-labels))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(plot (-> (sql/query db ["SELECT fips_county as x, unemploy_rate as y
                          FROM unemployment
                          ORDER BY unemploy_rate DESC LIMIT 10"])
          vt/dodged-bar))

(def highest-unemployment-counties
  (sql/query db

(ns usage
  (:require [gyptis.core :refer :all]
            [gyptis.vega-templates :refer [dodged-bar stacked-bar
                                           point choropleth line]]
            [clojure.data.json :as json]))

(def bar-data [{:x "a", :y  1 :fill 1}
               {:x "a", :y  1 :fill 2}
               {:x "b", :y  2 :fill 1}
               {:x "b", :y  3 :fill 2}
               {:x "c", :y  5 :fill 1}
               {:x "c", :y  8 :fill 2}
               {:x "d", :y 13 :fill 1}
               {:x "d", :y 21 :fill 2}])

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Let's make a bar chart

(plot (dodged-bar bar-data))

;; plot every hashmap in `data' as a rectangle. Stacks bars with the same `x' value
(plot (stacked-bar bar-data))

;; add labels
(plot (-> bar-data stacked-bar
          (assoc-in [:axes 0 :title] "letter")
          (assoc-in [:axes 1 :title] "rate")))

;; add mouse-over interactions
(plot (-> bar-data stacked-bar
          (assoc-in [:marks 0 :properties :hover]
                    {:fill {:value "red"}})))

