Skip to content

Commit 16233a2

Browse files
authored
Merge pull request #156 from ClojureCivitas/tableplot-parameter-flow-2
tableplot param flow -- undraft
2 parents 66f091f + 4fd5b67 commit 16233a2

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/data_visualization/tableplot_parameter_flow.clj

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
:description "Learn how to customize Tableplot visualizations using substitution parameters."
55
:category :clojure
66
:type :post
7-
:draft true
8-
:date "2025-11-10"
7+
:date "2025-11-11"
98
:tags [:data-visualization :tableplot :tutorial]
109
:image "tableplot-parameter-flow.png"}}}
1110
(ns data-visualization.tableplot-parameter-flow
@@ -240,9 +239,11 @@
240239
;; [It's just data](https://www.youtube.com/watch?v=jlPaby7suOc&t=1000s).
241240

242241
;; We do not need to use Tableplot's API for everything.
243-
;;
244-
;; After we call `plotly/plot`, we can process the actual Plotly.js
245-
;; specification, as data.
242+
;; We can call [`plotly/plot`](https://scicloj.github.io/tableplot/tableplot_book.plotly_reference.html#plot)
243+
;; to realize the actual Plotly.js specification, as data.
244+
;; Then we can keep processing it using the Clojure standard library,
245+
;; which has lovely functions like
246+
;; [`assoc-in`](https://clojuredocs.org/clojure.core/assoc-in).
246247

247248
(-> sample-data
248249
(plotly/layer-point {:=mark-size 20})
@@ -254,7 +255,15 @@
254255
;; ::: {.callout-tip collapse="true"}
255256
;; ### A brief look inside
256257

257-
;; You already know what to expect here:
258+
;; Let us observe the transformation -- before and after the `assoc-in`:
259+
260+
(-> sample-data
261+
(plotly/layer-point {:=mark-size 20})
262+
plotly/layer-line
263+
plotly/plot
264+
(assoc-in [:layout :xaxis :gridcolor] "green")
265+
(assoc-in [:layout :yaxis :gridcolor] "red")
266+
kind/pprint)
258267

259268
(-> sample-data
260269
(plotly/layer-point {:=mark-size 20})

0 commit comments

Comments
 (0)