-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfoo.clj
More file actions
49 lines (41 loc) · 13.9 KB
/
foo.clj
File metadata and controls
49 lines (41 loc) · 13.9 KB
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
42
43
44
45
46
47
48
49
;; gorilla-repl.fileformat = 1
;; **
;;; # Gorilla REPL
;;;
;;; Welcome to gorilla :-)
;;;
;;; Shift + enter evaluates code. Hit ctrl+g twice in quick succession or click the menu icon (upper-right corner) for more commands ...
;;;
;;; It's a good habit to run each worksheet in its own namespace: feel free to use the declaration we've provided below if you'd like.
;; **
;; @@
(ns merciful-pond
(:require [gorilla-plot.core :as plot]))
;; @@
;; =>
;;; {"type":"html","content":"<span class='clj-nil'>nil</span>","value":"nil"}
;; <=
;; @@
(histogram [1 2 3])
;; @@
;; @@
(plot/plot inc [1 2 3
])
;; @@
;; =>
;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"28def368-d656-464d-bd0c-41f4a4fbbffe","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":{"data":"28def368-d656-464d-bd0c-41f4a4fbbffe","field":"data.y"}}],"marks":[{"type":"line","from":{"data":"28def368-d656-464d-bd0c-41f4a4fbbffe"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"#FF29D2"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}}],"data":[{"name":"28def368-d656-464d-bd0c-41f4a4fbbffe","values":[{"x":1,"y":2},{"x":1.0099999997764826,"y":2.0099999997764826},{"x":1.0199999995529652,"y":2.019999999552965},{"x":1.0299999993294477,"y":2.0299999993294477},{"x":1.0399999991059303,"y":2.0399999991059303},{"x":1.049999998882413,"y":2.049999998882413},{"x":1.0599999986588955,"y":2.0599999986588955},{"x":1.069999998435378,"y":2.069999998435378},{"x":1.0799999982118607,"y":2.0799999982118607},{"x":1.0899999979883432,"y":2.0899999979883432},{"x":1.0999999977648258,"y":2.099999997764826},{"x":1.1099999975413084,"y":2.1099999975413084},{"x":1.119999997317791,"y":2.119999997317791},{"x":1.1299999970942736,"y":2.1299999970942736},{"x":1.1399999968707561,"y":2.139999996870756},{"x":1.1499999966472387,"y":2.1499999966472387},{"x":1.1599999964237213,"y":2.1599999964237213},{"x":1.169999996200204,"y":2.169999996200204},{"x":1.1799999959766865,"y":2.1799999959766865},{"x":1.189999995753169,"y":2.189999995753169},{"x":1.1999999955296516,"y":2.1999999955296516},{"x":1.2099999953061342,"y":2.2099999953061342},{"x":1.2199999950826168,"y":2.219999995082617},{"x":1.2299999948590994,"y":2.2299999948590994},{"x":1.239999994635582,"y":2.239999994635582},{"x":1.2499999944120646,"y":2.2499999944120646},{"x":1.2599999941885471,"y":2.259999994188547},{"x":1.2699999939650297,"y":2.2699999939650297},{"x":1.2799999937415123,"y":2.2799999937415123},{"x":1.2899999935179949,"y":2.289999993517995},{"x":1.2999999932944775,"y":2.2999999932944775},{"x":1.30999999307096,"y":2.30999999307096},{"x":1.3199999928474426,"y":2.3199999928474426},{"x":1.3299999926239252,"y":2.329999992623925},{"x":1.3399999924004078,"y":2.339999992400408},{"x":1.3499999921768904,"y":2.3499999921768904},{"x":1.359999991953373,"y":2.359999991953373},{"x":1.3699999917298555,"y":2.3699999917298555},{"x":1.3799999915063381,"y":2.379999991506338},{"x":1.3899999912828207,"y":2.3899999912828207},{"x":1.3999999910593033,"y":2.3999999910593033},{"x":1.4099999908357859,"y":2.409999990835786},{"x":1.4199999906122684,"y":2.4199999906122684},{"x":1.429999990388751,"y":2.429999990388751},{"x":1.4399999901652336,"y":2.4399999901652336},{"x":1.4499999899417162,"y":2.449999989941716},{"x":1.4599999897181988,"y":2.4599999897181988},{"x":1.4699999894946814,"y":2.4699999894946814},{"x":1.479999989271164,"y":2.479999989271164},{"x":1.4899999890476465,"y":2.4899999890476465},{"x":1.499999988824129,"y":2.499999988824129},{"x":1.5099999886006117,"y":2.5099999886006117},{"x":1.5199999883770943,"y":2.5199999883770943},{"x":1.5299999881535769,"y":2.529999988153577},{"x":1.5399999879300594,"y":2.5399999879300594},{"x":1.549999987706542,"y":2.549999987706542},{"x":1.5599999874830246,"y":2.5599999874830246},{"x":1.5699999872595072,"y":2.569999987259507},{"x":1.5799999870359898,"y":2.5799999870359898},{"x":1.5899999868124723,"y":2.5899999868124723},{"x":1.599999986588955,"y":2.599999986588955},{"x":1.6099999863654375,"y":2.6099999863654375},{"x":1.61999998614192,"y":2.61999998614192},{"x":1.6299999859184027,"y":2.6299999859184027},{"x":1.6399999856948853,"y":2.6399999856948853},{"x":1.6499999854713678,"y":2.649999985471368},{"x":1.6599999852478504,"y":2.6599999852478504},{"x":1.669999985024333,"y":2.669999985024333},{"x":1.6799999848008156,"y":2.6799999848008156},{"x":1.6899999845772982,"y":2.689999984577298},{"x":1.6999999843537807,"y":2.6999999843537807},{"x":1.7099999841302633,"y":2.7099999841302633},{"x":1.719999983906746,"y":2.719999983906746},{"x":1.7299999836832285,"y":2.7299999836832285},{"x":1.739999983459711,"y":2.739999983459711},{"x":1.7499999832361937,"y":2.7499999832361937},{"x":1.7599999830126762,"y":2.7599999830126762},{"x":1.7699999827891588,"y":2.769999982789159},{"x":1.7799999825656414,"y":2.7799999825656414},{"x":1.789999982342124,"y":2.789999982342124},{"x":1.7999999821186066,"y":2.7999999821186066},{"x":1.8099999818950891,"y":2.809999981895089},{"x":1.8199999816715717,"y":2.8199999816715717},{"x":1.8299999814480543,"y":2.8299999814480543},{"x":1.839999981224537,"y":2.839999981224537},{"x":1.8499999810010195,"y":2.8499999810010195},{"x":1.859999980777502,"y":2.859999980777502},{"x":1.8699999805539846,"y":2.8699999805539846},{"x":1.8799999803304672,"y":2.8799999803304672},{"x":1.8899999801069498,"y":2.88999998010695},{"x":1.8999999798834324,"y":2.8999999798834324},{"x":1.909999979659915,"y":2.909999979659915},{"x":1.9199999794363976,"y":2.9199999794363976},{"x":1.9299999792128801,"y":2.92999997921288},{"x":1.9399999789893627,"y":2.9399999789893627},{"x":1.9499999787658453,"y":2.9499999787658453},{"x":1.9599999785423279,"y":2.959999978542328},{"x":1.9699999783188105,"y":2.9699999783188105},{"x":1.979999978095293,"y":2.979999978095293},{"x":1.9899999778717756,"y":2.9899999778717756},{"x":1.9999999776482582,"y":2.999999977648258}]}],"width":400,"height":247.2187957763672,"padding":{"bottom":20,"top":10,"right":10,"left":50}},"value":"#gorilla_repl.vega.VegaView{:content {:axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain {:data \"28def368-d656-464d-bd0c-41f4a4fbbffe\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain {:data \"28def368-d656-464d-bd0c-41f4a4fbbffe\", :field \"data.y\"}}], :marks [{:type \"line\", :from {:data \"28def368-d656-464d-bd0c-41f4a4fbbffe\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"#FF29D2\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}}], :data [{:name \"28def368-d656-464d-bd0c-41f4a4fbbffe\", :values ({:x 1, :y 2} {:x 1.0099999997764826, :y 2.0099999997764826} {:x 1.0199999995529652, :y 2.019999999552965} {:x 1.0299999993294477, :y 2.0299999993294477} {:x 1.0399999991059303, :y 2.0399999991059303} {:x 1.049999998882413, :y 2.049999998882413} {:x 1.0599999986588955, :y 2.0599999986588955} {:x 1.069999998435378, :y 2.069999998435378} {:x 1.0799999982118607, :y 2.0799999982118607} {:x 1.0899999979883432, :y 2.0899999979883432} {:x 1.0999999977648258, :y 2.099999997764826} {:x 1.1099999975413084, :y 2.1099999975413084} {:x 1.119999997317791, :y 2.119999997317791} {:x 1.1299999970942736, :y 2.1299999970942736} {:x 1.1399999968707561, :y 2.139999996870756} {:x 1.1499999966472387, :y 2.1499999966472387} {:x 1.1599999964237213, :y 2.1599999964237213} {:x 1.169999996200204, :y 2.169999996200204} {:x 1.1799999959766865, :y 2.1799999959766865} {:x 1.189999995753169, :y 2.189999995753169} {:x 1.1999999955296516, :y 2.1999999955296516} {:x 1.2099999953061342, :y 2.2099999953061342} {:x 1.2199999950826168, :y 2.219999995082617} {:x 1.2299999948590994, :y 2.2299999948590994} {:x 1.239999994635582, :y 2.239999994635582} {:x 1.2499999944120646, :y 2.2499999944120646} {:x 1.2599999941885471, :y 2.259999994188547} {:x 1.2699999939650297, :y 2.2699999939650297} {:x 1.2799999937415123, :y 2.2799999937415123} {:x 1.2899999935179949, :y 2.289999993517995} {:x 1.2999999932944775, :y 2.2999999932944775} {:x 1.30999999307096, :y 2.30999999307096} {:x 1.3199999928474426, :y 2.3199999928474426} {:x 1.3299999926239252, :y 2.329999992623925} {:x 1.3399999924004078, :y 2.339999992400408} {:x 1.3499999921768904, :y 2.3499999921768904} {:x 1.359999991953373, :y 2.359999991953373} {:x 1.3699999917298555, :y 2.3699999917298555} {:x 1.3799999915063381, :y 2.379999991506338} {:x 1.3899999912828207, :y 2.3899999912828207} {:x 1.3999999910593033, :y 2.3999999910593033} {:x 1.4099999908357859, :y 2.409999990835786} {:x 1.4199999906122684, :y 2.4199999906122684} {:x 1.429999990388751, :y 2.429999990388751} {:x 1.4399999901652336, :y 2.4399999901652336} {:x 1.4499999899417162, :y 2.449999989941716} {:x 1.4599999897181988, :y 2.4599999897181988} {:x 1.4699999894946814, :y 2.4699999894946814} {:x 1.479999989271164, :y 2.479999989271164} {:x 1.4899999890476465, :y 2.4899999890476465} {:x 1.499999988824129, :y 2.499999988824129} {:x 1.5099999886006117, :y 2.5099999886006117} {:x 1.5199999883770943, :y 2.5199999883770943} {:x 1.5299999881535769, :y 2.529999988153577} {:x 1.5399999879300594, :y 2.5399999879300594} {:x 1.549999987706542, :y 2.549999987706542} {:x 1.5599999874830246, :y 2.5599999874830246} {:x 1.5699999872595072, :y 2.569999987259507} {:x 1.5799999870359898, :y 2.5799999870359898} {:x 1.5899999868124723, :y 2.5899999868124723} {:x 1.599999986588955, :y 2.599999986588955} {:x 1.6099999863654375, :y 2.6099999863654375} {:x 1.61999998614192, :y 2.61999998614192} {:x 1.6299999859184027, :y 2.6299999859184027} {:x 1.6399999856948853, :y 2.6399999856948853} {:x 1.6499999854713678, :y 2.649999985471368} {:x 1.6599999852478504, :y 2.6599999852478504} {:x 1.669999985024333, :y 2.669999985024333} {:x 1.6799999848008156, :y 2.6799999848008156} {:x 1.6899999845772982, :y 2.689999984577298} {:x 1.6999999843537807, :y 2.6999999843537807} {:x 1.7099999841302633, :y 2.7099999841302633} {:x 1.719999983906746, :y 2.719999983906746} {:x 1.7299999836832285, :y 2.7299999836832285} {:x 1.739999983459711, :y 2.739999983459711} {:x 1.7499999832361937, :y 2.7499999832361937} {:x 1.7599999830126762, :y 2.7599999830126762} {:x 1.7699999827891588, :y 2.769999982789159} {:x 1.7799999825656414, :y 2.7799999825656414} {:x 1.789999982342124, :y 2.789999982342124} {:x 1.7999999821186066, :y 2.7999999821186066} {:x 1.8099999818950891, :y 2.809999981895089} {:x 1.8199999816715717, :y 2.8199999816715717} {:x 1.8299999814480543, :y 2.8299999814480543} {:x 1.839999981224537, :y 2.839999981224537} {:x 1.8499999810010195, :y 2.8499999810010195} {:x 1.859999980777502, :y 2.859999980777502} {:x 1.8699999805539846, :y 2.8699999805539846} {:x 1.8799999803304672, :y 2.8799999803304672} {:x 1.8899999801069498, :y 2.88999998010695} {:x 1.8999999798834324, :y 2.8999999798834324} {:x 1.909999979659915, :y 2.909999979659915} {:x 1.9199999794363976, :y 2.9199999794363976} {:x 1.9299999792128801, :y 2.92999997921288} {:x 1.9399999789893627, :y 2.9399999789893627} {:x 1.9499999787658453, :y 2.9499999787658453} {:x 1.9599999785423279, :y 2.959999978542328} {:x 1.9699999783188105, :y 2.9699999783188105} {:x 1.979999978095293, :y 2.979999978095293} {:x 1.9899999778717756, :y 2.9899999778717756} {:x 1.9999999776482582, :y 2.999999977648258})}], :width 400, :height 247.2188, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
;; <=
;; @@
(plot/histogram [1 0 1 1 1 0])
;; @@
;; =>
;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"b373d5ed-2781-4a9e-b49b-4d812f084e1d","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":{"data":"b373d5ed-2781-4a9e-b49b-4d812f084e1d","field":"data.y"}}],"marks":[{"type":"line","from":{"data":"b373d5ed-2781-4a9e-b49b-4d812f084e1d"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"interpolate":{"value":"step-before"},"fill":{"value":"steelblue"},"fillOpacity":{"value":0.4},"stroke":{"value":"steelblue"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}}],"data":[{"name":"b373d5ed-2781-4a9e-b49b-4d812f084e1d","values":[{"x":0.0,"y":0},{"x":0.25000000000000006,"y":2.0},{"x":0.5000000000000001,"y":0.0},{"x":0.7500000000000002,"y":0.0},{"x":1.0000000000000002,"y":4.0},{"x":1.2500000000000002,"y":0}]}],"width":400,"height":247.2187957763672,"padding":{"bottom":20,"top":10,"right":10,"left":50}},"value":"#gorilla_repl.vega.VegaView{:content {:axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain {:data \"b373d5ed-2781-4a9e-b49b-4d812f084e1d\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain {:data \"b373d5ed-2781-4a9e-b49b-4d812f084e1d\", :field \"data.y\"}}], :marks [{:type \"line\", :from {:data \"b373d5ed-2781-4a9e-b49b-4d812f084e1d\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :interpolate {:value \"step-before\"}, :fill {:value \"steelblue\"}, :fillOpacity {:value 0.4}, :stroke {:value \"steelblue\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}}], :data [{:name \"b373d5ed-2781-4a9e-b49b-4d812f084e1d\", :values ({:x 0.0, :y 0} {:x 0.25000000000000006, :y 2.0} {:x 0.5000000000000001, :y 0.0} {:x 0.7500000000000002, :y 0.0} {:x 1.0000000000000002, :y 4.0} {:x 1.2500000000000002, :y 0})}], :width 400, :height 247.2188, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
;; <=
;; @@
(comp (plot/histogram [1 1 3 5 5 5]) (plot/histogram [2 4 4 4 4 4 6]))
;; @@
;; =>
;;; {"type":"html","content":"<span class='clj-unkown'>#<core$comp$fn__4192 clojure.core$comp$fn__4192@74f6ab8a></span>","value":"#<core$comp$fn__4192 clojure.core$comp$fn__4192@74f6ab8a>"}
;; <=
;; @@
;; @@