|
138 | 138 | ;; This convention helps you navigate the document and quickly find what you're looking for: |
139 | 139 | ;; conceptual explanations (📖), working code (⚙️), or usage examples (🧪). |
140 | 140 |
|
| 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 | + |
141 | 166 | ;; # Setup |
142 | 167 |
|
143 | 168 | ;; ### ⚙️ Dependencies |
|
411 | 436 | ;; |
412 | 437 | ;; The API will consist of: |
413 | 438 | ;; |
414 | | -;; **Constructors** - build partial layer specs: |
| 439 | +;; **Layer-level properties** - build partial layer specs: |
415 | 440 | ;; - `(data dataset)` - attach data |
416 | 441 | ;; - `(mapping :x :y {:color :species})` - define aesthetic mappings |
417 | 442 | ;; - `(scatter)`, `(linear)`, `(histogram)` - specify plot types/transforms |
418 | 443 | ;; |
| 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 | + ; |
419 | 450 | ;; **Composition operators** - combine specs: |
420 | 451 | ;; - `(=* data mapping geom)` - merge properties (cross-product for layers, merge for plot-level) |
421 | 452 | ;; - `(=+ scatter linear)` - overlay layers with inheritance (concatenate `:=layers`, merge plot-level) |
422 | | -;; |
423 | | -;; **Utilities**: |
| 453 | + ; |
| 454 | +;; **Rendering**: |
424 | 455 | ;; - `(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) |
428 | 456 | ;; |
429 | 457 | ;; **Auto-display:** Plot specs returned by `=*`, `=+`, and constructors automatically |
430 | 458 | ;; display as plots in Kindly-compatible notebooks. Use `kind/pprint` to inspect |
431 | 459 | ;; the raw plot spec map (with `:=layers` key) instead. |
432 | 460 |
|
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 | | - |
450 | 461 | ;; ### 📖 How Plots are Displayed |
451 | 462 | ;; |
452 | 463 | ;; Layer specifications returned by `*` and `+` are **automatically displayed as plots** |
|
0 commit comments