 ;;; {:gorilla-repl.types/vega {"axes" [{"scale" "x", "type" "x"} {"scale" "y", "type" "y"}], "scales" [{"name" "x", "type" "linear", "range" "width", "domain" {"data" "9b441e60-42fb-47c9-a2bd-9a63281513eb", "field" "data.x"}} {"name" "y", "type" "linear", "range" "height", "nice" true, "domain" {"data" "9b441e60-42fb-47c9-a2bd-9a63281513eb", "field" "data.y"}}], "marks" [{"type" "symbol", "from" {"data" "9b441e60-42fb-47c9-a2bd-9a63281513eb"}, "properties" {"enter" {"x" {"scale" "x", "field" "data.x"}, "y" {"scale" "y", "field" "data.y"}, "fill" {"value" "red"}, "fillOpacity" {"value" 1}}, "update" {"shape" "circle", "size" {"value" 70}, "stroke" {"value" "transparent"}}, "hover" {"size" {"value" 210}, "stroke" {"value" "white"}}}}], "data" [{"name" "9b441e60-42fb-47c9-a2bd-9a63281513eb", "values" ({"x" 0, "y" 1} {"x" 1, "y" 3} {"x" 2, "y" 5} {"x" 3, "y" 7} {"x" 4, "y" 9} {"x" 5, "y" 5} {"x" 6, "y" 4} {"x" 7, "y" 6} {"x" 8, "y" 9} {"x" 9, "y" 8} {"x" 10, "y" 3} {"x" 11, "y" 5} {"x" 12, "y" 6})}], "width" 400, "height" 247.2188, "padding" {"left" 30, "bottom" 20, "top" 10, "right" 10}}}
 ;; <=
 
+;; **
+;;; Another key feature of gorilla-plot, is that because plots are values, it's straighforward to compose them. Here's another plot
+;; **
+
 ;; @@
 (def p2 (list-plot d :joined true :plot-range [:all [1 5]]))
 ;; @@

;;; nil
;; <=

;; @@
(def d
  [1 3 5 7 9 5 4 6 9 8 3 5 6])

;;; {:gorilla-repl.types/vega {"width" 400, "height" 247.2188, "padding" {"left" 30, "bottom" 20, "top" 10, "right" 10}, "scales" [{"name" "x", "type" "linear", "range" "width", "domain" {"data" "9b441e60-42fb-47c9-a2bd-9a63281513eb", "field" "data.x"}} {"name" "y", "type" "linear", "range" "height", "nice" true, "domain" {"data" "9b441e60-42fb-47c9-a2bd-9a63281513eb", "field" "data.y"}}], "axes" [{"scale" "x", "type" "x"} {"scale" "y", "type" "y"}], "data" ({"name" "9b441e60-42fb-47c9-a2bd-9a63281513eb", "values" ({"x" 0, "y" 1} {"x" 1, "y" 3} {"x" 2, "y" 5} {"x" 3, "y" 7} {"x" 4, "y" 9} {"x" 5, "y" 5} {"x" 6, "y" 4} {"x" 7, "y" 6} {"x" 8, "y" 9} {"x" 9, "y" 8} {"x" 10, "y" 3} {"x" 11, "y" 5} {"x" 12, "y" 6})} {"name" "af4968e7-53fa-4f69-8b47-0de018c33141", "values" ({"x" 0, "y" 1} {"x" 1, "y" 3} {"x" 2, "y" 5} {"x" 3, "y" 7} {"x" 4, "y" 9} {"x" 5, "y" 5} {"x" 6, "y" 4} {"x" 7, "y" 6} {"x" 8, "y" 9} {"x" 9, "y" 8} {"x" 10, "y" 3} {"x" 11, "y" 5} {"x" 12, "y" 6})}), "marks" ({"type" "symbol", "from" {"data" "9b441e60-42fb-47c9-a2bd-9a63281513eb"}, "properties" {"enter" {"x" {"scale" "x", "field" "data.x"}, "y" {"scale" "y", "field" "data.y"}, "fill" {"value" "steelblue"}, "fillOpacity" {"value" 1}}, "update" {"shape" "circle", "size" {"value" 70}, "stroke" {"value" "transparent"}}, "hover" {"size" {"value" 210}, "stroke" {"value" "white"}}}} {"type" "line", "from" {"data" "af4968e7-53fa-4f69-8b47-0de018c33141"}, "properties" {"enter" {"x" {"scale" "x", "field" "data.x"}, "y" {"scale" "y", "field" "data.y"}, "stroke" {"value" "#FF29D2"}, "strokeWidth" {"value" 2}, "strokeOpacity" {"value" 1}}}})}}
;; <=

;; **
;;; You can also plot functions.
;; **

;; @@
(plot (fn [x] (Math/sin x)) [0 10] :color "orange" :plot-points 50)
;; @@
;; =>
;;; {:gorilla-repl.types/vega {"axes" [{"scale" "x", "type" "x"} {"scale" "y", "type" "y"}], "scales" [{"name" "x", "type" "linear", "range" "width", "domain" {"data" "847e42c4-26c5-479b-a55a-913246373136", "field" "data.x"}} {"name" "y", "type" "linear", "range" "height", "nice" true, "domain" {"data" "847e42c4-26c5-479b-a55a-913246373136", "field" "data.y"}}], "marks" [{"type" "line", "from" {"data" "847e42c4-26c5-479b-a55a-913246373136"}, "properties" {"enter" {"x" {"scale" "x", "field" "data.x"}, "y" {"scale" "y", "field" "data.y"}, "stroke" {"value" "orange"}, "strokeWidth" {"value" 2}, "strokeOpacity" {"value" 1}}}}], "data" [{"name" "847e42c4-26c5-479b-a55a-913246373136", "values" ({"x" 0, "y" 0.0} {"x" 0.20000000298023224, "y" 0.19866933371588721} {"x" 0.4000000059604645, "y" 0.3894183477986018} {"x" 0.6000000089406967, "y" 0.5646424807741107} {"x" 0.800000011920929, "y" 0.7173560992049138} {"x" 1.0000000149011612, "y" 0.8414709928590282} {"x" 1.2000000178813934, "y" 0.9320390924466878} {"x" 1.4000000208616257, "y" 0.9854497335342509} {"x" 1.600000023841858, "y" 0.999573602345334} {"x" 1.8000000268220901, "y" 0.9738476247841598} {"x" 2.0000000298023224, "y" 0.9092974144235391} {"x" 2.2000000327825546, "y" 0.8084963845270198} {"x" 2.400000035762787, "y" 0.6754631541798962} {"x" 2.600000038743019, "y" 0.5155013386230065} {"x" 2.8000000417232513, "y" 0.3349881108433251} {"x" 3.0000000447034836, "y" 0.14111996380375377} {"x" 3.200000047683716, "y" -0.058374191029984236} {"x" 3.400000050663948, "y" -0.2555411510086444} {"x" 3.6000000536441803, "y" -0.4425204914007219} {"x" 3.8000000566244125, "y" -0.6118579357308002} {"x" 4.000000059604645, "y" -0.7568025342681227} {"x" 4.200000062584877, "y" -0.8715758030964995} {"x" 4.400000065565109, "y" -0.9516020940398271} {"x" 4.6000000685453415, "y" -0.9936910113209954} {"x" 4.800000071525574, "y" -0.9961646025774231} {"x" 5.000000074505806, "y" -0.9589242535286561} {"x" 5.200000077486038, "y" -0.8834546194166499} {"x" 5.4000000804662704, "y" -0.7727644364846162} {"x" 5.600000083446503, "y" -0.631266573154059} {"x" 5.800000086426735, "y" -0.4646021028811949} {"x" 6.000000089406967, "y" -0.2794154123530115} {"x" 6.200000092387199, "y" -0.0830893107497628} {"x" 6.400000095367432, "y" 0.11654929956798761} {"x" 6.600000098347664, "y" 0.31154145696653224} {"x" 6.800000101327896, "y" 0.49411343923282436} {"x" 7.000000104308128, "y" 0.6569866773569186} {"x" 7.200000107288361, "y" 0.7936679291181636} {"x" 7.400000110268593, "y" 0.898708144169618} {"x" 7.600000113248825, "y" 0.9679197004863622} {"x" 7.800000116229057, "y" 0.9985433516457859} {"x" 8.00000011920929, "y" 0.9893582292784191} {"x" 8.200000122189522, "y" 0.9407305152385956} {"x" 8.400000125169754, "y" 0.8545988430890409} {"x" 8.600000128149986, "y" 0.7343970108961424} {"x" 8.800000131130219, "y" 0.584917086532953} {"x" 9.00000013411045, "y" 0.41211836304966276} {"x" 9.200000137090683, "y" 0.222889780458267} {"x" 9.400000140070915, "y" 0.02477528542543854} {"x" 9.600000143051147, "y" -0.17432692208370587} {"x" 9.80000014603138, "y" -0.36647926512335605})}], "width" 400, "height" 247.2188, "padding" {"left" 30, "bottom" 20, "top" 10, "right" 10}}}
;; <=

;; **
;;; And, of course, these plots compose too.
;; **

;; @@
(compose
