Skip to content

Commit 5968889

Browse files
committed
tableplot param flow - wip
1 parent 7ef209e commit 5968889

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

src/data_visualization/tableplot_parameter_flow.clj

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,35 @@
2929
;;
3030
;; This tutorial is a brief intro to this feature.
3131

32+
;; ### Background: The Layered Grammar of Graphics
33+
;;
34+
;; 💡 *(can skip on first read)*
35+
;;
36+
;; Tableplot is inspired by the [**layered grammar of graphics**](https://vita.had.co.nz/papers/layered-grammar.html),
37+
;; a framework for understanding and building statistical visualizations. Originally developed by
38+
;; Leland Wilkinson and later refined by Hadley Wickham in ggplot2, the grammar views plots as
39+
;; compositions of independent components: data, aesthetic mappings, geometric objects, scales,
40+
;; coordinates, and facets.
41+
;;
42+
;; The challenge in implementing such a grammar is achieving multiple goals simultaneously:
43+
;;
44+
;; - **Succinct**: Simple things should be simple - sensible defaults for common cases
45+
;; - **Declarative**: Describe *what* you want, not *how* to draw it
46+
;; - **Flexible**: Support customization without sacrificing simplicity
47+
;; - **Observable**: Make the details visible and understandable when needed
48+
;; - **Extensible**: Allow users to work with internals without breaking abstractions
49+
;;
50+
;; Tableplot addresses these challenges by mostly adopting [Hanami](https://github.com/jsa-aerial/hanami)'s
51+
;; solution as a starting point. Hanami introduced a template-based approach with substitution keys,
52+
;; allowing hierarchical defaults: you can rely on conventions for quick plots, or override specific
53+
;; details when needed. The templates approach makes the transformation process observable,
54+
;; as we'll see in this tutorial.
55+
;;
56+
;; **Further reading:**
57+
;; - [ggplot2: Elegant Graphics for Data Analysis](https://ggplot2-book.org/) - The definitive guide showing how to balance simplicity and flexibility
58+
;; - [Demystifying stat_ layers in ggplot2](https://yjunechoe.github.io/posts/2020-09-26-demystifying-stat-layers-ggplot2/) - June Choe's exploration of how the grammar elegantly handles data transformations, with special focus on making the internals observable and extensible
59+
;; - [Analyzing Data with Clojure (Kevin Lynagh, 2012)](https://www.youtube.com/watch?v=xyGggdg31mc) - An early Clojure attempt to handle the challenge of building a grammar of graphics
60+
3261
;; ## The Challenge: Customizing Grid Colors
3362
;;
3463
;; Let's start with a basic dataset and plot.
@@ -60,7 +89,7 @@ sample-data
6089

6190
;; ### A brief look inside
6291
;;
63-
;; *(can skip on first read)*
92+
;; 💡 *(can skip on first read)*
6493

6594
;; By default, when used in [Kindly](https://scicloj.github.io/kindly-noted/)-compatible
6695
;; tools like [Clay](https://scicloj.github.io/clay/) and in Clojure Civitas posts,
@@ -119,7 +148,7 @@ sample-data
119148

120149
;; ### A brief look inside
121150
;;
122-
;; *(can skip on first read)*
151+
;; 💡 *(can skip on first read)*
123152

124153
;; Let us see what actually has changed in the
125154
;; resulting specification:
@@ -165,7 +194,7 @@ sample-data
165194

166195
;; ### A brief look inside
167196
;;
168-
;; *(can skip on first read)*
197+
;; 💡 *(can skip on first read)*
169198

170199
;; Let us see what happens:
171200

@@ -207,7 +236,7 @@ sample-data
207236

208237
;; ### A brief look inside
209238
;;
210-
;; *(can skip on first read)*
239+
;; 💡 *(can skip on first read)*
211240

212241
;; You already know what to expect here:
213242

0 commit comments

Comments
 (0)