-
Notifications
You must be signed in to change notification settings - Fork 0
/
canvas.cljc
41 lines (33 loc) · 963 Bytes
/
canvas.cljc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(ns org.clojars.punit-naik.canvas)
(defn set-height
"Sets the height of the Vega-lite component"
[vl-spec value]
(assoc vl-spec :height value))
(defn set-width
"Sets the width of the Vega-lite component"
[vl-spec value]
(assoc vl-spec :width value))
(defn set-backgroud
"Sets the colour of the chart background"
[vl-spec value]
(assoc vl-spec :background value))
(defn set-config
[vl-spec value]
(assoc vl-spec :config value))
(defn set-padding
"Sets the padding of the Vega-lite component
`value` is a map of keys [:top :bottom :left :right]"
[vl-spec value]
(assoc vl-spec :padding value))
(defn add-title
"Adds a title to the Vega-lite spec"
[vl-spec title]
(assoc vl-spec :title title))
(defn add-desc
"Adds a description to the Vega-lite spec"
[vl-spec desc]
(assoc vl-spec :description desc))
(defn add-mark
"Adds a mark (plot) type to the Vega-lite spec"
[vl-spec mtype]
(assoc vl-spec :mark mtype))