Skip to content

Commit d676801

Browse files
committed
composable_plotting wip
1 parent bef6e44 commit d676801

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/data_visualization/aog/composable_plotting.clj

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,26 @@ tips
294294

295295
;; ### 🧪 What a View Looks Like
296296
;;
297-
;; Two keywords — one scatter view:
297+
;; `view` coerces its first argument to a
298+
;; [Tablecloth](https://scicloj.github.io/tablecloth/) dataset --
299+
;; a columnar table built on [tech.ml.dataset](https://github.com/techascent/tech.ml.dataset).
300+
;; You can pass a Clojure map of columns, a sequence of row maps,
301+
;; a CSV path, a URL, or an existing dataset.
302+
;; The `:data` value in each view prints as a table rather than
303+
;; a plain map -- that's normal.
304+
;;
305+
;; Two keywords — one scatter view.
306+
;; Here, data is a map of columns (key → vector of values):
298307

299308
(-> (view {:a [1 2 3] :b [4 5 6]} :a :b)
300309
kind/pprint)
301310

311+
;; A sequence of row maps works too -- Tablecloth pivots the rows
312+
;; into columns automatically:
313+
314+
(-> (view [{:a 1 :b 4} {:a 2 :b 5} {:a 3 :b 6}] :a :b)
315+
kind/pprint)
316+
302317
;; A pair as a vector — same result:
303318

304319
(-> (view {:a [1 2 3] :b [4 5 6]} [:a :b])

0 commit comments

Comments
 (0)