001 (ns org.clojars.punit-naik.canvas)
002
003 (defn set-height
004 "Sets the height of the Vega-lite component"
005 [vl-spec value]
006 (assoc vl-spec :height value))
007
008 (defn set-width
009 "Sets the width of the Vega-lite component"
010 [vl-spec value]
011 (assoc vl-spec :width value))
012
013 (defn set-backgroud
014 "Sets the colour of the chart background"
015 [vl-spec value]
016 (assoc vl-spec :background value))
017
018 (defn set-config
019 [vl-spec value]
020 (assoc vl-spec :config value))
021
022 (defn set-padding
023 "Sets the padding of the Vega-lite component
024 `value` is a map of keys [:top :bottom :left :right]"
025 [vl-spec value]
026 (assoc vl-spec :padding value))
027
028 (defn add-title
029 "Adds a title to the Vega-lite spec"
030 [vl-spec title]
031 (assoc vl-spec :title title))
032
033 (defn add-desc
034 "Adds a description to the Vega-lite spec"
035 [vl-spec desc]
036 (assoc vl-spec :description desc))
037
038 (defn add-mark
039 "Adds a mark (plot) type to the Vega-lite spec"
040 [vl-spec mtype]
041 (assoc vl-spec :mark mtype))