Skip to content

Instantly share code, notes, and snippets.

@mattly
Created April 30, 2016 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattly/b9a0cdcd3df4e05b6e46af5371b37e25 to your computer and use it in GitHub Desktop.
Save mattly/b9a0cdcd3df4e05b6e46af5371b37e25 to your computer and use it in GitHub Desktop.
(defn- state-line [[state results]]
(let [d (->> results
(sort-by :year)
(reduce (fn [line {:keys [year from-center]}]
(conj line (str (x-for-margin from-center)
","
(+ 10 (year-base year)))))
[])
(interpose "L")
(concat ["M"])
(str/join " "))]
[:path {:key state :d d :stroke "#ccc" :fill "none"}]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment