Skip to content

Commit 68cafe5

Browse files
committed
aog wip
1 parent b4c0954 commit 68cafe5

1 file changed

Lines changed: 34 additions & 23 deletions

File tree

src/data_visualization/aog_in_clojure_part1.clj

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,31 @@
138138
;; This convention helps you navigate the document and quickly find what you're looking for:
139139
;; conceptual explanations (📖), working code (⚙️), or usage examples (🧪).
140140

141+
;; ### 📖 Notebook Structure
142+
;;
143+
;; The rest of this notebook:
144+
;; 1. **Setup** - dependencies and example datasets
145+
;; 2. **Inspiration** - AlgebraOfGraphics.jl background
146+
;; 3. **Design exploration** - problem/solution for compositional API
147+
;; 4. **Design overview** - key decisions and API preview
148+
;; 5. **How plots display** - auto-display behavior
149+
;; 6. **Implementation status** - what works, what's missing
150+
;; 7. **Rendering targets & delegation** - backend strategy
151+
;; 8. **Malli schemas** - reference material (can skim)
152+
;; 9. **Validation helpers** - error checking utilities
153+
;; 10. **API implementation** - operators, layer/plot-level properties
154+
;; 11. **Core implementation** - helper functions and rendering infrastructure
155+
;; 12. **Examples** - scatter, linear regression, histograms, grouping, faceting
156+
;; 13. **Multi-target rendering** - same spec across all backends
157+
;; 14. **Validation examples** - error messages in action
158+
;; 15. **Design discussions** - reflections on choices made
159+
;;
160+
;; **Note on IR:** The internal representation uses maps with `:=layers` keys,
161+
;; separating plot-level properties from layer specs. This enables clean composition
162+
;; and clear semantics for plot configuration.
163+
;;
164+
;; If you want to skip ahead to see it working, jump to "Basic Scatter Plots".
165+
141166
;; # Setup
142167

143168
;; ### ⚙️ Dependencies
@@ -411,42 +436,28 @@
411436
;;
412437
;; The API will consist of:
413438
;;
414-
;; **Constructors** - build partial layer specs:
439+
;; **Layer-level properties** - build partial layer specs:
415440
;; - `(data dataset)` - attach data
416441
;; - `(mapping :x :y {:color :species})` - define aesthetic mappings
417442
;; - `(scatter)`, `(linear)`, `(histogram)` - specify plot types/transforms
418443
;;
444+
;; **Plot-level properties** - configure rendering and scales:
445+
;; - `(target :geom)` - specify rendering target (:geom, :vl, :plotly)
446+
;; - `(size 800 600)` - set plot dimensions
447+
;; - `(scale :x {:domain [0 100]})` - customize axis scales
448+
;; - `(facet {:col :species})` - add faceting
449+
;
419450
;; **Composition operators** - combine specs:
420451
;; - `(=* data mapping geom)` - merge properties (cross-product for layers, merge for plot-level)
421452
;; - `(=+ scatter linear)` - overlay layers with inheritance (concatenate `:=layers`, merge plot-level)
422-
;;
423-
;; **Utilities**:
453+
;
454+
;; **Rendering**:
424455
;; - `(plot spec)` - explicitly render (usually auto-displays)
425-
;; - `(facet {:col :species})` - add faceting (compositional)
426-
;; - `(scale :x {:domain [0 100]})` - customize scales (compositional)
427-
;; - `(target :geom)`, `(size 800 600)` - set plot-level properties (compositional)
428456
;;
429457
;; **Auto-display:** Plot specs returned by `=*`, `=+`, and constructors automatically
430458
;; display as plots in Kindly-compatible notebooks. Use `kind/pprint` to inspect
431459
;; the raw plot spec map (with `:=layers` key) instead.
432460

433-
;; ### 📖 What's Coming
434-
;;
435-
;; The rest of this notebook:
436-
;; 1. How plots display (auto-display behavior, when to use `plot` explicitly)
437-
;; 2. Implementation status (what works, what's missing)
438-
;; 3. Rendering targets & delegation strategy (design principles)
439-
;; 4. Schemas and validation (reference material, can skim)
440-
;; 5. API implementation (operators, constructors, rendering function)
441-
;; 6. Examples showing the API in action (scatter, linear, histogram, faceting)
442-
;; 7. Multi-target rendering (same spec works across geom, Vega-Lite, Plotly)
443-
;;
444-
;; **Note on IR:** The internal representation uses maps with `:=layers` keys,
445-
;; separating plot-level properties from layer specs. This enables clean composition
446-
;; and clear semantics for plot configuration.
447-
;;
448-
;; If you want to skip ahead to see it working, jump to "Basic Scatter Plots".
449-
450461
;; ### 📖 How Plots are Displayed
451462
;;
452463
;; Layer specifications returned by `*` and `+` are **automatically displayed as plots**

0 commit comments

Comments
 (0)