Skip to content

Instantly share code, notes, and snippets.

@purcell
Created December 17, 2009 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purcell/259024 to your computer and use it in GitHub Desktop.
Save purcell/259024 to your computer and use it in GitHub Desktop.
user> (pprint (macroexpand-1 '(bar-chart (map (comp str first) d) (map (comp #(/ % 1000.0) second) d) :title "Distance by week" :x-label "Week" :y-label "km")))
(clojure.core/let
[opts__1904__auto__
(clojure.core/when
'(:title "Distance by week" :x-label "Week" :y-label "km")
(clojure.core/assoc
{}
:title
"Distance by week"
:x-label
"Week"
:y-label
"km"))
values__1905__auto__
(if
(incanter.core/matrix?
(map (comp (fn* [p1__2908] (/ p1__2908 1000.0)) second) d))
(incanter.core/to-list
(map (comp (fn* [p1__2908] (/ p1__2908 1000.0)) second) d))
(map (comp (fn* [p1__2908] (/ p1__2908 1000.0)) second) d))
main-title__1906__auto__
(clojure.core/or (:title opts__1904__auto__) "Bar Chart")
group-by__1907__auto__
(:group-by opts__1904__auto__)
x-label__1908__auto__
(clojure.core/or (:x-label opts__1904__auto__) "Categories")
y-label__1909__auto__
(clojure.core/or (:y-label opts__1904__auto__) "Value")
vertical?__1910__auto__
(if (clojure.core/false? (:vertical opts__1904__auto__)) false true)
legend?__1911__auto__
(clojure.core/true? (:legend opts__1904__auto__))
dataset__1912__auto__
(org.jfree.data.category.DefaultCategoryDataset.)
chart__1913__auto__
(org.jfree.chart.ChartFactory/createBarChart
main-title__1906__auto__
x-label__1908__auto__
y-label__1909__auto__
dataset__1912__auto__
(if
vertical?__1910__auto__
org.jfree.chart.plot.PlotOrientation/VERTICAL
org.jfree.chart.plot.PlotOrientation/HORIZONTAL)
legend?__1911__auto__
true
false)]
(do
(clojure.core/doseq
[i__1914__auto__
(clojure.core/range 0 (clojure.core/count values__1905__auto__))]
(.addValue
dataset__1912__auto__
(clojure.core/nth values__1905__auto__ i__1914__auto__)
(if
group-by__1907__auto__
(clojure.core/nth group-by__1907__auto__ i__1914__auto__)
(clojure.core/str
'(map (comp (fn* [p1__2908] (/ p1__2908 1000.0)) second) d)))
(clojure.core/nth (map (comp str first) d) i__1914__auto__)))
chart__1913__auto__))
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment