Skip to content

Commit 88d5afe

Browse files
committed
composable plotting wip
1 parent b059a16 commit 88d5afe

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/data_visualization/aog/composable_plotting.clj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ mpg
345345
(concat (apply concat (map #(merge-layer base-views %) data-specs))
346346
ann-specs)))
347347

348+
;; Defined here (rather than in the Scales and Coordinates section) because
349+
;; examples use it before that section.
350+
(defn coord
351+
"Set coordinate system: :cartesian (default), :flip, or :polar."
352+
[views c]
353+
(mapv #(assoc % :coord c) views))
354+
348355
;; ### 🧪 Adding a Mark
349356
;;
350357
;; A layer is just a map -- you can write it directly:
@@ -2329,11 +2336,6 @@ mpg
23292336
(defmethod make-scale :log [domain pixel-range _]
23302337
(ws/scale :log {:domain domain :range pixel-range}))
23312338

2332-
(defn coord
2333-
"Set coordinate system: :cartesian (default), :flip, or :polar."
2334-
[views c]
2335-
(mapv #(assoc % :coord c) views))
2336-
23372339
;; ### 🧪 How Setters Modify Views
23382340
;;
23392341
;; `scale` and `coord` add keys to each view map:

0 commit comments

Comments
 (0)