You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/data_visualization/tableplot_parameter_flow.clj
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@
54
54
;; as we'll see in this tutorial.
55
55
;;
56
56
;; **Further reading:**
57
+
57
58
;; - [ggplot2: Elegant Graphics for Data Analysis](https://ggplot2-book.org/) - The definitive guide showing how to balance simplicity and flexibility
58
59
;; - [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
60
;; - [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
@@ -74,12 +75,16 @@ sample-data
74
75
;; which generates interactive Plotly.js visualizations. Tableplot also supports other backends
75
76
;; like Vega-Lite and an experimental transpilation API.
76
77
77
-
;; We can make a basic line plot. This is really easy, because the
78
+
;; We can make a basic plot with two layers.
79
+
;; This is really easy with our data, because the
78
80
;; `:x` and `:y` columns are used by default for the plot's axes.
79
81
80
82
(-> sample-data
83
+
(plotly/layer-point {:=mark-size20})
81
84
plotly/layer-line)
82
85
86
+
;; ### Goal
87
+
83
88
;; Assume that we now wish to colour the grid lines: vertical by green,
84
89
;; horizontal by red. After all, what would be a
85
90
;; better way to teach Tufte's [data-ink ratio](https://infovis-wiki.net/wiki/Data-Ink_Ratio) principle than doing exactly
@@ -99,6 +104,7 @@ sample-data
99
104
;; Clojure data structures.
100
105
101
106
(-> sample-data
107
+
(plotly/layer-point {:=mark-size20})
102
108
plotly/layer-line
103
109
kind/pprint)
104
110
@@ -125,6 +131,7 @@ sample-data
125
131
;; Plotly.js specification? This is what `plotly/plot` is for.
0 commit comments