File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2474,6 +2474,8 @@ iris
24742474
24752475; ; ### 🧪 Example 1: Simple Scatter Plot (Delegated Domain)
24762476
2477+ ; ; **Algebraic style using `=*`:**
2478+
24772479(=* (data penguins)
24782480 (mapping :bill-length-mm :bill-depth-mm )
24792481 (scatter ))
@@ -2491,6 +2493,21 @@ iris
24912493 (and (map? (meta rendered))
24922494 (= (:kindly/kind (meta rendered)) :kind/html ))))])
24932495
2496+ ; ; **Threading macro style (equivalent):**
2497+
2498+ (-> penguins
2499+ (mapping :bill-length-mm :bill-depth-mm )
2500+ (scatter ))
2501+
2502+ (kind/test-last [#(and (map? %)
2503+ (contains? % :=layers )
2504+ (= (:=x (first (:=layers %))) :bill-length-mm )
2505+ (= (:=y (first (:=layers %))) :bill-depth-mm )
2506+ (= (:=plottype (first (:=layers %))) :scatter ))])
2507+
2508+ ; ; Both forms produce identical results. The threading style is often more
2509+ ; ; natural in Clojure, while the `=*` style makes the composition operator explicit.
2510+
24942511; ; **What happens here**:
24952512
24962513; ; 1. We create a plot spec with data, mapping, and plottype
You can’t perform that action at this time.
0 commit comments