Skip to content

Commit 606a3b3

Browse files
committed
fix for incanter#294
1 parent 88bd28d commit 606a3b3

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

modules/incanter-charts/src/incanter/charts.clj

+12-4
Original file line numberDiff line numberDiff line change
@@ -1137,11 +1137,19 @@
11371137
_group-by (when (:group-by opts)
11381138
(data-as-list (:group-by opts) data))
11391139
x-groups (when _group-by
1140-
(map #($ :col-0 %)
1141-
(vals ($group-by :col-1 (conj-cols _x _group-by)))))
1140+
(let [x-groupped (->> (conj-cols _x _group-by)
1141+
($group-by :col-1))]
1142+
(->> (distinct _group-by)
1143+
(map #(->>
1144+
(get x-groupped {:col-1 %})
1145+
($ :col-0))))))
11421146
y-groups (when _group-by
1143-
(map #($ :col-0 %)
1144-
(vals ($group-by :col-1 (conj-cols _y _group-by)))))
1147+
(let [y-groupped (->> (conj-cols _y _group-by)
1148+
($group-by :col-1))]
1149+
(->> (distinct _group-by)
1150+
(map #(->>
1151+
(get y-groupped {:col-1 %})
1152+
($ :col-0))))))
11451153
__x (in-coll (if x-groups (first x-groups) _x))
11461154
__y (in-coll (if y-groups (first y-groups) _y))
11471155
title (or (:title opts) "")

0 commit comments

Comments
 (0)