add some basic metrics to worksheet

add some basic metrics to worksheet

--- gorilla/plotting.clj
+++ gorilla/plotting.clj
@@ -1,34 +1,248 @@
 ;; gorilla-repl.fileformat = 1

 ;; **
-;;; # Ceres Analysis
-;; **
-
-;; @@
-(require '[gorilla-plot.core :refer :all])
-(require '[ceres.collector :refer :all])
-(require '[ceres.curator :refer [start-date end-date]])
-(require '[monger.collection :as mc])
-(require '[clj-time.core :as t])
-(require '[clj-time.periodic :as p])
-(require '[monger.operators :refer :all])
-(require '[monger.query :refer :all])
+;;; # News Diffusion on Twitter
+;; **
+
+;; @@
+(ns unsightly-reserve
+  (:refer-clojure :exclude [find sort])
+  (:require [gorilla-plot.core :refer :all]
+            [ceres.collector :refer :all]
+            [ceres.curator :refer [start-date end-date random-tree build-tree-from-source]]
+            [monger.collection :as mc]
+            [clj-time.core :as t]
+            [clj-time.periodic :as p]
+            [monger.operators :refer :all]
+            [monger.query :refer :all])
+  (:import org.bson.types.ObjectId))
 ;; @@
 ;; =>
 ;;; {"type":"html","content":"nil","value":"nil"}
 ;; <=

 ;; **
+;;; Follwing news distributors are watched
+;; **
+
+;; @@
+news-accounts
+;; @@
+;; =>
+;;; {"type":"list-like","open":"#{","close":"}","separator":" ","items":[{"type":"html","content":""dpa"","value":"\"dpa\""},{"type":"html","content":""tazgezwitscher"","value":"\"tazgezwitscher\""},{"type":"html","content":""BILD"","value":"\"BILD\""},{"type":"html","content":""ZDFheute"","value":"\"ZDFheute\""},{"type":"html","content":""FAZ_NET"","value":"\"FAZ_NET\""},{"type":"html","content":""focusonline"","value":"\"focusonline\""},{"type":"html","content":""welt"","value":"\"welt\""},{"type":"html","content":""N24_de"","value":"\"N24_de\""},{"type":"html","content":""DerWesten"","value":"\"DerWesten\""},{"type":"html","content":""SPIEGELONLINE"","value":"\"SPIEGELONLINE\""},{"type":"html","content":""ntvde"","value":"\"ntvde\""},{"type":"html","content":""tagesschau"","value":"\"tagesschau\""},{"type":"html","content":""SZ"","value":"\"SZ\""},{"type":"html","content":""sternde"","value":"\"sternde\""}],"value":"#{\"dpa\" \"tazgezwitscher\" \"BILD\" \"ZDFheute\" \"FAZ_NET\" \"focusonline\" \"welt\" \"N24_de\" \"DerWesten\" \"SPIEGELONLINE\" \"ntvde\" \"tagesschau\" \"SZ\" \"sternde\"}"}
+;; <=
+
+;; **
 ;;; ## Average Tweets per Day
 ;; **

 ;; @@
-(let [days-running (t/in-days (t/interval start-date end-date))
-        dates (take days-running (p/periodic-seq start-date (t/days 1)))
-        tweet-count (map #(mc/count @db "tweets" {:created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+(def days-running (t/in-days (t/interval start-date end-date)))
+(def dates (take days-running (p/periodic-seq start-date (t/days 1))))
+;; @@
+;; =>
+;;; {"type":"html","content":"#'unsightly-reserve/dates","value":"#'unsightly-reserve/dates"}
+;; <=
+
+;; **
+;;; ### Combined
+;; **
+
+;; @@
+(let [tweet-count (map #(mc/count @db "tweets" {:created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
         days (range  2 (inc (inc days-running)))]
-    (list-plot tweet-count :joined true))
-;; @@
-;; =>
-;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"250752ca-3ec3-4885-9492-98382dda6430","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":{"data":"250752ca-3ec3-4885-9492-98382dda6430","field":"data.y"}}],"marks":[{"type":"line","from":{"data":"250752ca-3ec3-4885-9492-98382dda6430"},"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":"250752ca-3ec3-4885-9492-98382dda6430","values":[{"x":0,"y":626},{"x":1,"y":12959},{"x":2,"y":12098},{"x":3,"y":15569},{"x":4,"y":14210},{"x":5,"y":9976},{"x":6,"y":10310},{"x":7,"y":21440},{"x":8,"y":15433},{"x":9,"y":11617},{"x":10,"y":11313},{"x":11,"y":10274},{"x":12,"y":20489},{"x":13,"y":12970},{"x":14,"y":13832},{"x":15,"y":11037},{"x":16,"y":11973},{"x":17,"y":10438},{"x":18,"y":7933},{"x":19,"y":8798},{"x":20,"y":10314},{"x":21,"y":11652},{"x":22,"y":10922},{"x":23,"y":12110},{"x":24,"y":12524},{"x":25,"y":8184},{"x":26,"y":9900},{"x":27,"y":10283},{"x":28,"y":10477},{"x":29,"y":10285},{"x":30,"y":9479},{"x":31,"y":8774},{"x":32,"y":6783},{"x":33,"y":9144},{"x":34,"y":9718},{"x":35,"y":9909},{"x":36,"y":11237},{"x":37,"y":10819},{"x":38,"y":9143},{"x":39,"y":6782},{"x":40,"y":8274},{"x":41,"y":7935},{"x":42,"y":12168},{"x":43,"y":11173},{"x":44,"y":10445},{"x":45,"y":10248},{"x":46,"y":7808},{"x":47,"y":7729},{"x":48,"y":8024},{"x":49,"y":12345},{"x":50,"y":9617},{"x":51,"y":8439},{"x":52,"y":8807},{"x":53,"y":7077},{"x":54,"y":7140},{"x":55,"y":8550},{"x":56,"y":9374},{"x":57,"y":9372},{"x":58,"y":11006},{"x":59,"y":9324},{"x":60,"y":7472},{"x":61,"y":10782},{"x":62,"y":11107},{"x":63,"y":10597},{"x":64,"y":10699},{"x":65,"y":117},{"x":66,"y":5755},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":7386},{"x":70,"y":10509},{"x":71,"y":9096},{"x":72,"y":10668},{"x":73,"y":11045},{"x":74,"y":7897},{"x":75,"y":7284},{"x":76,"y":0},{"x":77,"y":3966},{"x":78,"y":8720},{"x":79,"y":10049},{"x":80,"y":9311},{"x":81,"y":8080},{"x":82,"y":8251},{"x":83,"y":9994},{"x":84,"y":11015},{"x":85,"y":10832},{"x":86,"y":10015},{"x":87,"y":10144},{"x":88,"y":7677},{"x":89,"y":8751},{"x":90,"y":9907},{"x":91,"y":10538}]}],"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 \"250752ca-3ec3-4885-9492-98382dda6430\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain {:data \"250752ca-3ec3-4885-9492-98382dda6430\", :field \"data.y\"}}], :marks [{:type \"line\", :from {:data \"250752ca-3ec3-4885-9492-98382dda6430\"}, :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 \"250752ca-3ec3-4885-9492-98382dda6430\", :values ({:x 0, :y 626} {:x 1, :y 12959} {:x 2, :y 12098} {:x 3, :y 15569} {:x 4, :y 14210} {:x 5, :y 9976} {:x 6, :y 10310} {:x 7, :y 21440} {:x 8, :y 15433} {:x 9, :y 11617} {:x 10, :y 11313} {:x 11, :y 10274} {:x 12, :y 20489} {:x 13, :y 12970} {:x 14, :y 13832} {:x 15, :y 11037} {:x 16, :y 11973} {:x 17, :y 10438} {:x 18, :y 7933} {:x 19, :y 8798} {:x 20, :y 10314} {:x 21, :y 11652} {:x 22, :y 10922} {:x 23, :y 12110} {:x 24, :y 12524} {:x 25, :y 8184} {:x 26, :y 9900} {:x 27, :y 10283} {:x 28, :y 10477} {:x 29, :y 10285} {:x 30, :y 9479} {:x 31, :y 8774} {:x 32, :y 6783} {:x 33, :y 9144} {:x 34, :y 9718} {:x 35, :y 9909} {:x 36, :y 11237} {:x 37, :y 10819} {:x 38, :y 9143} {:x 39, :y 6782} {:x 40, :y 8274} {:x 41, :y 7935} {:x 42, :y 12168} {:x 43, :y 11173} {:x 44, :y 10445} {:x 45, :y 10248} {:x 46, :y 7808} {:x 47, :y 7729} {:x 48, :y 8024} {:x 49, :y 12345} {:x 50, :y 9617} {:x 51, :y 8439} {:x 52, :y 8807} {:x 53, :y 7077} {:x 54, :y 7140} {:x 55, :y 8550} {:x 56, :y 9374} {:x 57, :y 9372} {:x 58, :y 11006} {:x 59, :y 9324} {:x 60, :y 7472} {:x 61, :y 10782} {:x 62, :y 11107} {:x 63, :y 10597} {:x 64, :y 10699} {:x 65, :y 117} {:x 66, :y 5755} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 7386} {:x 70, :y 10509} {:x 71, :y 9096} {:x 72, :y 10668} {:x 73, :y 11045} {:x 74, :y 7897} {:x 75, :y 7284} {:x 76, :y 0} {:x 77, :y 3966} {:x 78, :y 8720} {:x 79, :y 10049} {:x 80, :y 9311} {:x 81, :y 8080} {:x 82, :y 8251} {:x 83, :y 9994} {:x 84, :y 11015} {:x 85, :y 10832} {:x 86, :y 10015} {:x 87, :y 10144} {:x 88, :y 7677} {:x 89, :y 8751} {:x 90, :y 9907} {:x 91, :y 10538})}], :width 400, :height 247.2188, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
-;; <=
+    (list-plot tweet-count :joined true :plot-size 900))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"1e8eebd9-9fe3-4af0-937f-943d37aab322","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":{"data":"1e8eebd9-9fe3-4af0-937f-943d37aab322","field":"data.y"}}],"marks":[{"type":"line","from":{"data":"1e8eebd9-9fe3-4af0-937f-943d37aab322"},"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":"1e8eebd9-9fe3-4af0-937f-943d37aab322","values":[{"x":0,"y":626},{"x":1,"y":12959},{"x":2,"y":12098},{"x":3,"y":15569},{"x":4,"y":14210},{"x":5,"y":9976},{"x":6,"y":10310},{"x":7,"y":21440},{"x":8,"y":15433},{"x":9,"y":11617},{"x":10,"y":11313},{"x":11,"y":10274},{"x":12,"y":20489},{"x":13,"y":12970},{"x":14,"y":13832},{"x":15,"y":11037},{"x":16,"y":11973},{"x":17,"y":10438},{"x":18,"y":7933},{"x":19,"y":8798},{"x":20,"y":10314},{"x":21,"y":11652},{"x":22,"y":10922},{"x":23,"y":12110},{"x":24,"y":12524},{"x":25,"y":8184},{"x":26,"y":9900},{"x":27,"y":10283},{"x":28,"y":10477},{"x":29,"y":10285},{"x":30,"y":9479},{"x":31,"y":8774},{"x":32,"y":6783},{"x":33,"y":9144},{"x":34,"y":9718},{"x":35,"y":9909},{"x":36,"y":11237},{"x":37,"y":10819},{"x":38,"y":9143},{"x":39,"y":6782},{"x":40,"y":8274},{"x":41,"y":7935},{"x":42,"y":12168},{"x":43,"y":11173},{"x":44,"y":10445},{"x":45,"y":10248},{"x":46,"y":7808},{"x":47,"y":7729},{"x":48,"y":8024},{"x":49,"y":12345},{"x":50,"y":9617},{"x":51,"y":8439},{"x":52,"y":8807},{"x":53,"y":7077},{"x":54,"y":7140},{"x":55,"y":8550},{"x":56,"y":9374},{"x":57,"y":9372},{"x":58,"y":11006},{"x":59,"y":9324},{"x":60,"y":7472},{"x":61,"y":10782},{"x":62,"y":11107},{"x":63,"y":10597},{"x":64,"y":10699},{"x":65,"y":117},{"x":66,"y":5755},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":7386},{"x":70,"y":10509},{"x":71,"y":9096},{"x":72,"y":10668},{"x":73,"y":11045},{"x":74,"y":7897},{"x":75,"y":7284},{"x":76,"y":0},{"x":77,"y":3966},{"x":78,"y":8720},{"x":79,"y":10049},{"x":80,"y":9311},{"x":81,"y":8080},{"x":82,"y":8251},{"x":83,"y":9994},{"x":84,"y":11015},{"x":85,"y":10832},{"x":86,"y":10015},{"x":87,"y":10144},{"x":88,"y":7677},{"x":89,"y":8751},{"x":90,"y":9907},{"x":91,"y":10538}]}],"width":900,"height":556.2422485351562,"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 \"1e8eebd9-9fe3-4af0-937f-943d37aab322\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain {:data \"1e8eebd9-9fe3-4af0-937f-943d37aab322\", :field \"data.y\"}}], :marks [{:type \"line\", :from {:data \"1e8eebd9-9fe3-4af0-937f-943d37aab322\"}, :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 \"1e8eebd9-9fe3-4af0-937f-943d37aab322\", :values ({:x 0, :y 626} {:x 1, :y 12959} {:x 2, :y 12098} {:x 3, :y 15569} {:x 4, :y 14210} {:x 5, :y 9976} {:x 6, :y 10310} {:x 7, :y 21440} {:x 8, :y 15433} {:x 9, :y 11617} {:x 10, :y 11313} {:x 11, :y 10274} {:x 12, :y 20489} {:x 13, :y 12970} {:x 14, :y 13832} {:x 15, :y 11037} {:x 16, :y 11973} {:x 17, :y 10438} {:x 18, :y 7933} {:x 19, :y 8798} {:x 20, :y 10314} {:x 21, :y 11652} {:x 22, :y 10922} {:x 23, :y 12110} {:x 24, :y 12524} {:x 25, :y 8184} {:x 26, :y 9900} {:x 27, :y 10283} {:x 28, :y 10477} {:x 29, :y 10285} {:x 30, :y 9479} {:x 31, :y 8774} {:x 32, :y 6783} {:x 33, :y 9144} {:x 34, :y 9718} {:x 35, :y 9909} {:x 36, :y 11237} {:x 37, :y 10819} {:x 38, :y 9143} {:x 39, :y 6782} {:x 40, :y 8274} {:x 41, :y 7935} {:x 42, :y 12168} {:x 43, :y 11173} {:x 44, :y 10445} {:x 45, :y 10248} {:x 46, :y 7808} {:x 47, :y 7729} {:x 48, :y 8024} {:x 49, :y 12345} {:x 50, :y 9617} {:x 51, :y 8439} {:x 52, :y 8807} {:x 53, :y 7077} {:x 54, :y 7140} {:x 55, :y 8550} {:x 56, :y 9374} {:x 57, :y 9372} {:x 58, :y 11006} {:x 59, :y 9324} {:x 60, :y 7472} {:x 61, :y 10782} {:x 62, :y 11107} {:x 63, :y 10597} {:x 64, :y 10699} {:x 65, :y 117} {:x 66, :y 5755} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 7386} {:x 70, :y 10509} {:x 71, :y 9096} {:x 72, :y 10668} {:x 73, :y 11045} {:x 74, :y 7897} {:x 75, :y 7284} {:x 76, :y 0} {:x 77, :y 3966} {:x 78, :y 8720} {:x 79, :y 10049} {:x 80, :y 9311} {:x 81, :y 8080} {:x 82, :y 8251} {:x 83, :y 9994} {:x 84, :y 11015} {:x 85, :y 10832} {:x 86, :y 10015} {:x 87, :y 10144} {:x 88, :y 7677} {:x 89, :y 8751} {:x 90, :y 9907} {:x 91, :y 10538})}], :width 900, :height 556.24225, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
+;; <=
+
+;; **
+;;; ### Daily Newspapers 1
+;;; Daily tweet counts of SZ, FAZ and Bild.
+;; **
+
+;; @@
+(let [sz-counts (map #(mc/count @db "tweets" {:user.screen_name "SZ" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      faz-counts (map #(mc/count @db "tweets" {:user.screen_name "FAZ_NET" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+       bild-counts (map #(mc/count @db "tweets" {:user.screen_name "BILD" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)]
+    (compose
+      (list-plot sz-counts :joined true :color "red" :plot-size 900 :plot-range [[0 100] [0 140]])
+      (list-plot faz-counts :joined true :color "green")
+      (list-plot bild-counts :joined true :color "blue")))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"width":900,"height":556.2422485351562,"padding":{"bottom":20,"top":10,"right":10,"left":50},"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":[0,100]},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":[0,140]}],"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"data":[{"name":"c7747460-6c36-44bd-9006-b83f30198e21","values":[{"x":0,"y":2},{"x":1,"y":69},{"x":2,"y":64},{"x":3,"y":70},{"x":4,"y":52},{"x":5,"y":37},{"x":6,"y":67},{"x":7,"y":78},{"x":8,"y":65},{"x":9,"y":68},{"x":10,"y":69},{"x":11,"y":34},{"x":12,"y":55},{"x":13,"y":64},{"x":14,"y":56},{"x":15,"y":60},{"x":16,"y":72},{"x":17,"y":60},{"x":18,"y":47},{"x":19,"y":39},{"x":20,"y":62},{"x":21,"y":68},{"x":22,"y":79},{"x":23,"y":77},{"x":24,"y":58},{"x":25,"y":33},{"x":26,"y":38},{"x":27,"y":55},{"x":28,"y":61},{"x":29,"y":68},{"x":30,"y":72},{"x":31,"y":62},{"x":32,"y":40},{"x":33,"y":35},{"x":34,"y":53},{"x":35,"y":66},{"x":36,"y":76},{"x":37,"y":65},{"x":38,"y":78},{"x":39,"y":42},{"x":40,"y":40},{"x":41,"y":71},{"x":42,"y":63},{"x":43,"y":46},{"x":44,"y":55},{"x":45,"y":65},{"x":46,"y":36},{"x":47,"y":46},{"x":48,"y":34},{"x":49,"y":35},{"x":50,"y":58},{"x":51,"y":71},{"x":52,"y":58},{"x":53,"y":2},{"x":54,"y":0},{"x":55,"y":78},{"x":56,"y":73},{"x":57,"y":74},{"x":58,"y":72},{"x":59,"y":41},{"x":60,"y":46},{"x":61,"y":35},{"x":62,"y":71},{"x":63,"y":56},{"x":64,"y":75},{"x":65,"y":0},{"x":66,"y":33},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":53},{"x":70,"y":63},{"x":71,"y":61},{"x":72,"y":78},{"x":73,"y":74},{"x":74,"y":47},{"x":75,"y":37},{"x":76,"y":0},{"x":77,"y":30},{"x":78,"y":62},{"x":79,"y":78},{"x":80,"y":75},{"x":81,"y":40},{"x":82,"y":30},{"x":83,"y":65},{"x":84,"y":53},{"x":85,"y":82},{"x":86,"y":73},{"x":87,"y":65},{"x":88,"y":38},{"x":89,"y":36},{"x":90,"y":55},{"x":91,"y":75}]},{"name":"11f00c26-05b2-4020-9b69-c99d0b473c51","values":[{"x":0,"y":2},{"x":1,"y":125},{"x":2,"y":113},{"x":3,"y":126},{"x":4,"y":101},{"x":5,"y":80},{"x":6,"y":104},{"x":7,"y":110},{"x":8,"y":125},{"x":9,"y":104},{"x":10,"y":103},{"x":11,"y":79},{"x":12,"y":85},{"x":13,"y":90},{"x":14,"y":105},{"x":15,"y":105},{"x":16,"y":95},{"x":17,"y":114},{"x":18,"y":72},{"x":19,"y":73},{"x":20,"y":107},{"x":21,"y":108},{"x":22,"y":99},{"x":23,"y":112},{"x":24,"y":100},{"x":25,"y":65},{"x":26,"y":65},{"x":27,"y":106},{"x":28,"y":108},{"x":29,"y":115},{"x":30,"y":112},{"x":31,"y":118},{"x":32,"y":61},{"x":33,"y":66},{"x":34,"y":95},{"x":35,"y":96},{"x":36,"y":97},{"x":37,"y":102},{"x":38,"y":93},{"x":39,"y":68},{"x":40,"y":67},{"x":41,"y":92},{"x":42,"y":110},{"x":43,"y":108},{"x":44,"y":110},{"x":45,"y":100},{"x":46,"y":69},{"x":47,"y":73},{"x":48,"y":89},{"x":49,"y":105},{"x":50,"y":104},{"x":51,"y":112},{"x":52,"y":108},{"x":53,"y":74},{"x":54,"y":70},{"x":55,"y":101},{"x":56,"y":113},{"x":57,"y":122},{"x":58,"y":122},{"x":59,"y":117},{"x":60,"y":78},{"x":61,"y":84},{"x":62,"y":100},{"x":63,"y":105},{"x":64,"y":106},{"x":65,"y":1},{"x":66,"y":61},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":78},{"x":70,"y":101},{"x":71,"y":87},{"x":72,"y":108},{"x":73,"y":100},{"x":74,"y":81},{"x":75,"y":73},{"x":76,"y":0},{"x":77,"y":44},{"x":78,"y":102},{"x":79,"y":108},{"x":80,"y":113},{"x":81,"y":80},{"x":82,"y":81},{"x":83,"y":105},{"x":84,"y":129},{"x":85,"y":129},{"x":86,"y":123},{"x":87,"y":117},{"x":88,"y":84},{"x":89,"y":83},{"x":90,"y":94},{"x":91,"y":115}]},{"name":"5c0df402-4b2f-4171-b8e7-a7e2822cecbb","values":[{"x":0,"y":4},{"x":1,"y":61},{"x":2,"y":54},{"x":3,"y":69},{"x":4,"y":41},{"x":5,"y":30},{"x":6,"y":59},{"x":7,"y":125},{"x":8,"y":85},{"x":9,"y":59},{"x":10,"y":35},{"x":11,"y":80},{"x":12,"y":115},{"x":13,"y":64},{"x":14,"y":88},{"x":15,"y":42},{"x":16,"y":65},{"x":17,"y":41},{"x":18,"y":27},{"x":19,"y":35},{"x":20,"y":28},{"x":21,"y":34},{"x":22,"y":53},{"x":23,"y":52},{"x":24,"y":82},{"x":25,"y":22},{"x":26,"y":23},{"x":27,"y":42},{"x":28,"y":44},{"x":29,"y":46},{"x":30,"y":53},{"x":31,"y":50},{"x":32,"y":21},{"x":33,"y":30},{"x":34,"y":41},{"x":35,"y":49},{"x":36,"y":48},{"x":37,"y":45},{"x":38,"y":44},{"x":39,"y":38},{"x":40,"y":35},{"x":41,"y":42},{"x":42,"y":50},{"x":43,"y":55},{"x":44,"y":50},{"x":45,"y":35},{"x":46,"y":38},{"x":47,"y":23},{"x":48,"y":37},{"x":49,"y":50},{"x":50,"y":44},{"x":51,"y":48},{"x":52,"y":51},{"x":53,"y":44},{"x":54,"y":58},{"x":55,"y":45},{"x":56,"y":53},{"x":57,"y":51},{"x":58,"y":47},{"x":59,"y":37},{"x":60,"y":43},{"x":61,"y":27},{"x":62,"y":63},{"x":63,"y":53},{"x":64,"y":51},{"x":65,"y":0},{"x":66,"y":29},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":24},{"x":70,"y":105},{"x":71,"y":30},{"x":72,"y":46},{"x":73,"y":52},{"x":74,"y":53},{"x":75,"y":62},{"x":76,"y":0},{"x":77,"y":19},{"x":78,"y":46},{"x":79,"y":59},{"x":80,"y":49},{"x":81,"y":38},{"x":82,"y":25},{"x":83,"y":25},{"x":84,"y":26},{"x":85,"y":46},{"x":86,"y":45},{"x":87,"y":40},{"x":88,"y":56},{"x":89,"y":48},{"x":90,"y":46},{"x":91,"y":61}]}],"marks":[{"type":"line","from":{"data":"c7747460-6c36-44bd-9006-b83f30198e21"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"red"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"11f00c26-05b2-4020-9b69-c99d0b473c51"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"green"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"5c0df402-4b2f-4171-b8e7-a7e2822cecbb"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"blue"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}}]},"value":"#gorilla_repl.vega.VegaView{:content {:width 900, :height 556.24225, :padding {:bottom 20, :top 10, :right 10, :left 50}, :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain [0 100]} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain [0 140]}], :axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :data ({:name \"c7747460-6c36-44bd-9006-b83f30198e21\", :values ({:x 0, :y 2} {:x 1, :y 69} {:x 2, :y 64} {:x 3, :y 70} {:x 4, :y 52} {:x 5, :y 37} {:x 6, :y 67} {:x 7, :y 78} {:x 8, :y 65} {:x 9, :y 68} {:x 10, :y 69} {:x 11, :y 34} {:x 12, :y 55} {:x 13, :y 64} {:x 14, :y 56} {:x 15, :y 60} {:x 16, :y 72} {:x 17, :y 60} {:x 18, :y 47} {:x 19, :y 39} {:x 20, :y 62} {:x 21, :y 68} {:x 22, :y 79} {:x 23, :y 77} {:x 24, :y 58} {:x 25, :y 33} {:x 26, :y 38} {:x 27, :y 55} {:x 28, :y 61} {:x 29, :y 68} {:x 30, :y 72} {:x 31, :y 62} {:x 32, :y 40} {:x 33, :y 35} {:x 34, :y 53} {:x 35, :y 66} {:x 36, :y 76} {:x 37, :y 65} {:x 38, :y 78} {:x 39, :y 42} {:x 40, :y 40} {:x 41, :y 71} {:x 42, :y 63} {:x 43, :y 46} {:x 44, :y 55} {:x 45, :y 65} {:x 46, :y 36} {:x 47, :y 46} {:x 48, :y 34} {:x 49, :y 35} {:x 50, :y 58} {:x 51, :y 71} {:x 52, :y 58} {:x 53, :y 2} {:x 54, :y 0} {:x 55, :y 78} {:x 56, :y 73} {:x 57, :y 74} {:x 58, :y 72} {:x 59, :y 41} {:x 60, :y 46} {:x 61, :y 35} {:x 62, :y 71} {:x 63, :y 56} {:x 64, :y 75} {:x 65, :y 0} {:x 66, :y 33} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 53} {:x 70, :y 63} {:x 71, :y 61} {:x 72, :y 78} {:x 73, :y 74} {:x 74, :y 47} {:x 75, :y 37} {:x 76, :y 0} {:x 77, :y 30} {:x 78, :y 62} {:x 79, :y 78} {:x 80, :y 75} {:x 81, :y 40} {:x 82, :y 30} {:x 83, :y 65} {:x 84, :y 53} {:x 85, :y 82} {:x 86, :y 73} {:x 87, :y 65} {:x 88, :y 38} {:x 89, :y 36} {:x 90, :y 55} {:x 91, :y 75})} {:name \"11f00c26-05b2-4020-9b69-c99d0b473c51\", :values ({:x 0, :y 2} {:x 1, :y 125} {:x 2, :y 113} {:x 3, :y 126} {:x 4, :y 101} {:x 5, :y 80} {:x 6, :y 104} {:x 7, :y 110} {:x 8, :y 125} {:x 9, :y 104} {:x 10, :y 103} {:x 11, :y 79} {:x 12, :y 85} {:x 13, :y 90} {:x 14, :y 105} {:x 15, :y 105} {:x 16, :y 95} {:x 17, :y 114} {:x 18, :y 72} {:x 19, :y 73} {:x 20, :y 107} {:x 21, :y 108} {:x 22, :y 99} {:x 23, :y 112} {:x 24, :y 100} {:x 25, :y 65} {:x 26, :y 65} {:x 27, :y 106} {:x 28, :y 108} {:x 29, :y 115} {:x 30, :y 112} {:x 31, :y 118} {:x 32, :y 61} {:x 33, :y 66} {:x 34, :y 95} {:x 35, :y 96} {:x 36, :y 97} {:x 37, :y 102} {:x 38, :y 93} {:x 39, :y 68} {:x 40, :y 67} {:x 41, :y 92} {:x 42, :y 110} {:x 43, :y 108} {:x 44, :y 110} {:x 45, :y 100} {:x 46, :y 69} {:x 47, :y 73} {:x 48, :y 89} {:x 49, :y 105} {:x 50, :y 104} {:x 51, :y 112} {:x 52, :y 108} {:x 53, :y 74} {:x 54, :y 70} {:x 55, :y 101} {:x 56, :y 113} {:x 57, :y 122} {:x 58, :y 122} {:x 59, :y 117} {:x 60, :y 78} {:x 61, :y 84} {:x 62, :y 100} {:x 63, :y 105} {:x 64, :y 106} {:x 65, :y 1} {:x 66, :y 61} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 78} {:x 70, :y 101} {:x 71, :y 87} {:x 72, :y 108} {:x 73, :y 100} {:x 74, :y 81} {:x 75, :y 73} {:x 76, :y 0} {:x 77, :y 44} {:x 78, :y 102} {:x 79, :y 108} {:x 80, :y 113} {:x 81, :y 80} {:x 82, :y 81} {:x 83, :y 105} {:x 84, :y 129} {:x 85, :y 129} {:x 86, :y 123} {:x 87, :y 117} {:x 88, :y 84} {:x 89, :y 83} {:x 90, :y 94} {:x 91, :y 115})} {:name \"5c0df402-4b2f-4171-b8e7-a7e2822cecbb\", :values ({:x 0, :y 4} {:x 1, :y 61} {:x 2, :y 54} {:x 3, :y 69} {:x 4, :y 41} {:x 5, :y 30} {:x 6, :y 59} {:x 7, :y 125} {:x 8, :y 85} {:x 9, :y 59} {:x 10, :y 35} {:x 11, :y 80} {:x 12, :y 115} {:x 13, :y 64} {:x 14, :y 88} {:x 15, :y 42} {:x 16, :y 65} {:x 17, :y 41} {:x 18, :y 27} {:x 19, :y 35} {:x 20, :y 28} {:x 21, :y 34} {:x 22, :y 53} {:x 23, :y 52} {:x 24, :y 82} {:x 25, :y 22} {:x 26, :y 23} {:x 27, :y 42} {:x 28, :y 44} {:x 29, :y 46} {:x 30, :y 53} {:x 31, :y 50} {:x 32, :y 21} {:x 33, :y 30} {:x 34, :y 41} {:x 35, :y 49} {:x 36, :y 48} {:x 37, :y 45} {:x 38, :y 44} {:x 39, :y 38} {:x 40, :y 35} {:x 41, :y 42} {:x 42, :y 50} {:x 43, :y 55} {:x 44, :y 50} {:x 45, :y 35} {:x 46, :y 38} {:x 47, :y 23} {:x 48, :y 37} {:x 49, :y 50} {:x 50, :y 44} {:x 51, :y 48} {:x 52, :y 51} {:x 53, :y 44} {:x 54, :y 58} {:x 55, :y 45} {:x 56, :y 53} {:x 57, :y 51} {:x 58, :y 47} {:x 59, :y 37} {:x 60, :y 43} {:x 61, :y 27} {:x 62, :y 63} {:x 63, :y 53} {:x 64, :y 51} {:x 65, :y 0} {:x 66, :y 29} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 24} {:x 70, :y 105} {:x 71, :y 30} {:x 72, :y 46} {:x 73, :y 52} {:x 74, :y 53} {:x 75, :y 62} {:x 76, :y 0} {:x 77, :y 19} {:x 78, :y 46} {:x 79, :y 59} {:x 80, :y 49} {:x 81, :y 38} {:x 82, :y 25} {:x 83, :y 25} {:x 84, :y 26} {:x 85, :y 46} {:x 86, :y 45} {:x 87, :y 40} {:x 88, :y 56} {:x 89, :y 48} {:x 90, :y 46} {:x 91, :y 61})}), :marks ({:type \"line\", :from {:data \"c7747460-6c36-44bd-9006-b83f30198e21\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"red\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"11f00c26-05b2-4020-9b69-c99d0b473c51\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"green\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"5c0df402-4b2f-4171-b8e7-a7e2822cecbb\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"blue\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}})}}"}
+;; <=
+
+;; **
+;;; ### Daily Newspaper 2
+;;; Daily tweet counts of Welt, Westen and taz.
+;; **
+
+;; @@
+(let [welt-counts (map #(mc/count @db "tweets" {:user.screen_name "welt" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      taz-counts (map #(mc/count @db "tweets" {:user.screen_name "tazgezwitscher" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      westen-counts (map #(mc/count @db "tweets" {:user.screen_name "DerWesten" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)]
+  (compose
+      (list-plot welt-counts :joined true :color "red" :plot-size 900 :plot-range [[0 100] [0 140]])
+      (list-plot taz-counts :joined true :color "green")
+      (list-plot westen-counts :joined true :color "blue")))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"width":900,"height":556.2422485351562,"padding":{"bottom":20,"top":10,"right":10,"left":50},"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":[0,100]},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":[0,140]}],"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"data":[{"name":"d8b132ff-0e76-420f-ab4c-61fb30032bf8","values":[{"x":0,"y":2},{"x":1,"y":69},{"x":2,"y":77},{"x":3,"y":108},{"x":4,"y":64},{"x":5,"y":64},{"x":6,"y":72},{"x":7,"y":122},{"x":8,"y":79},{"x":9,"y":83},{"x":10,"y":68},{"x":11,"y":46},{"x":12,"y":119},{"x":13,"y":84},{"x":14,"y":74},{"x":15,"y":77},{"x":16,"y":90},{"x":17,"y":70},{"x":18,"y":45},{"x":19,"y":56},{"x":20,"y":53},{"x":21,"y":58},{"x":22,"y":88},{"x":23,"y":64},{"x":24,"y":59},{"x":25,"y":46},{"x":26,"y":67},{"x":27,"y":68},{"x":28,"y":77},{"x":29,"y":61},{"x":30,"y":59},{"x":31,"y":52},{"x":32,"y":42},{"x":33,"y":57},{"x":34,"y":60},{"x":35,"y":66},{"x":36,"y":61},{"x":37,"y":77},{"x":38,"y":75},{"x":39,"y":56},{"x":40,"y":60},{"x":41,"y":51},{"x":42,"y":67},{"x":43,"y":73},{"x":44,"y":82},{"x":45,"y":68},{"x":46,"y":32},{"x":47,"y":59},{"x":48,"y":69},{"x":49,"y":92},{"x":50,"y":74},{"x":51,"y":73},{"x":52,"y":51},{"x":53,"y":68},{"x":54,"y":63},{"x":55,"y":69},{"x":56,"y":69},{"x":57,"y":65},{"x":58,"y":79},{"x":59,"y":68},{"x":60,"y":55},{"x":61,"y":59},{"x":62,"y":76},{"x":63,"y":87},{"x":64,"y":58},{"x":65,"y":3},{"x":66,"y":52},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":79},{"x":70,"y":117},{"x":71,"y":69},{"x":72,"y":106},{"x":73,"y":91},{"x":74,"y":51},{"x":75,"y":73},{"x":76,"y":0},{"x":77,"y":33},{"x":78,"y":87},{"x":79,"y":93},{"x":80,"y":127},{"x":81,"y":66},{"x":82,"y":80},{"x":83,"y":84},{"x":84,"y":79},{"x":85,"y":69},{"x":86,"y":71},{"x":87,"y":73},{"x":88,"y":52},{"x":89,"y":69},{"x":90,"y":72},{"x":91,"y":61}]},{"name":"c5534c0c-840b-44b2-97a9-32b4a6e277de","values":[{"x":0,"y":1},{"x":1,"y":23},{"x":2,"y":31},{"x":3,"y":44},{"x":4,"y":21},{"x":5,"y":36},{"x":6,"y":24},{"x":7,"y":34},{"x":8,"y":32},{"x":9,"y":27},{"x":10,"y":32},{"x":11,"y":30},{"x":12,"y":20},{"x":13,"y":17},{"x":14,"y":27},{"x":15,"y":20},{"x":16,"y":18},{"x":17,"y":20},{"x":18,"y":0},{"x":19,"y":24},{"x":20,"y":24},{"x":21,"y":28},{"x":22,"y":21},{"x":23,"y":16},{"x":24,"y":27},{"x":25,"y":16},{"x":26,"y":13},{"x":27,"y":26},{"x":28,"y":21},{"x":29,"y":32},{"x":30,"y":25},{"x":31,"y":22},{"x":32,"y":15},{"x":33,"y":12},{"x":34,"y":22},{"x":35,"y":22},{"x":36,"y":23},{"x":37,"y":30},{"x":38,"y":19},{"x":39,"y":15},{"x":40,"y":16},{"x":41,"y":17},{"x":42,"y":25},{"x":43,"y":21},{"x":44,"y":25},{"x":45,"y":31},{"x":46,"y":14},{"x":47,"y":15},{"x":48,"y":20},{"x":49,"y":32},{"x":50,"y":27},{"x":51,"y":40},{"x":52,"y":29},{"x":53,"y":16},{"x":54,"y":18},{"x":55,"y":24},{"x":56,"y":31},{"x":57,"y":27},{"x":58,"y":37},{"x":59,"y":25},{"x":60,"y":3},{"x":61,"y":27},{"x":62,"y":40},{"x":63,"y":28},{"x":64,"y":27},{"x":65,"y":1},{"x":66,"y":29},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":24},{"x":70,"y":33},{"x":71,"y":33},{"x":72,"y":33},{"x":73,"y":36},{"x":74,"y":16},{"x":75,"y":22},{"x":76,"y":0},{"x":77,"y":7},{"x":78,"y":29},{"x":79,"y":39},{"x":80,"y":24},{"x":81,"y":10},{"x":82,"y":19},{"x":83,"y":20},{"x":84,"y":25},{"x":85,"y":24},{"x":86,"y":26},{"x":87,"y":33},{"x":88,"y":22},{"x":89,"y":17},{"x":90,"y":23},{"x":91,"y":20}]},{"name":"7bb9e557-a0bf-476b-9471-d19b10d25fc6","values":[{"x":0,"y":0},{"x":1,"y":28},{"x":2,"y":28},{"x":3,"y":27},{"x":4,"y":11},{"x":5,"y":27},{"x":6,"y":36},{"x":7,"y":44},{"x":8,"y":31},{"x":9,"y":29},{"x":10,"y":31},{"x":11,"y":24},{"x":12,"y":53},{"x":13,"y":33},{"x":14,"y":27},{"x":15,"y":29},{"x":16,"y":39},{"x":17,"y":42},{"x":18,"y":19},{"x":19,"y":17},{"x":20,"y":29},{"x":21,"y":31},{"x":22,"y":31},{"x":23,"y":41},{"x":24,"y":39},{"x":25,"y":20},{"x":26,"y":19},{"x":27,"y":35},{"x":28,"y":32},{"x":29,"y":34},{"x":30,"y":45},{"x":31,"y":41},{"x":32,"y":16},{"x":33,"y":21},{"x":34,"y":31},{"x":35,"y":34},{"x":36,"y":33},{"x":37,"y":31},{"x":38,"y":29},{"x":39,"y":12},{"x":40,"y":17},{"x":41,"y":32},{"x":42,"y":31},{"x":43,"y":32},{"x":44,"y":52},{"x":45,"y":37},{"x":46,"y":13},{"x":47,"y":17},{"x":48,"y":35},{"x":49,"y":31},{"x":50,"y":32},{"x":51,"y":36},{"x":52,"y":49},{"x":53,"y":26},{"x":54,"y":27},{"x":55,"y":31},{"x":56,"y":31},{"x":57,"y":29},{"x":58,"y":48},{"x":59,"y":48},{"x":60,"y":24},{"x":61,"y":21},{"x":62,"y":28},{"x":63,"y":34},{"x":64,"y":50},{"x":65,"y":1},{"x":66,"y":27},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":24},{"x":70,"y":32},{"x":71,"y":29},{"x":72,"y":35},{"x":73,"y":31},{"x":74,"y":18},{"x":75,"y":11},{"x":76,"y":0},{"x":77,"y":16},{"x":78,"y":37},{"x":79,"y":54},{"x":80,"y":35},{"x":81,"y":17},{"x":82,"y":24},{"x":83,"y":35},{"x":84,"y":38},{"x":85,"y":30},{"x":86,"y":58},{"x":87,"y":31},{"x":88,"y":6},{"x":89,"y":15},{"x":90,"y":31},{"x":91,"y":35}]}],"marks":[{"type":"line","from":{"data":"d8b132ff-0e76-420f-ab4c-61fb30032bf8"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"red"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"c5534c0c-840b-44b2-97a9-32b4a6e277de"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"green"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"7bb9e557-a0bf-476b-9471-d19b10d25fc6"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"blue"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}}]},"value":"#gorilla_repl.vega.VegaView{:content {:width 900, :height 556.24225, :padding {:bottom 20, :top 10, :right 10, :left 50}, :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain [0 100]} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain [0 140]}], :axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :data ({:name \"d8b132ff-0e76-420f-ab4c-61fb30032bf8\", :values ({:x 0, :y 2} {:x 1, :y 69} {:x 2, :y 77} {:x 3, :y 108} {:x 4, :y 64} {:x 5, :y 64} {:x 6, :y 72} {:x 7, :y 122} {:x 8, :y 79} {:x 9, :y 83} {:x 10, :y 68} {:x 11, :y 46} {:x 12, :y 119} {:x 13, :y 84} {:x 14, :y 74} {:x 15, :y 77} {:x 16, :y 90} {:x 17, :y 70} {:x 18, :y 45} {:x 19, :y 56} {:x 20, :y 53} {:x 21, :y 58} {:x 22, :y 88} {:x 23, :y 64} {:x 24, :y 59} {:x 25, :y 46} {:x 26, :y 67} {:x 27, :y 68} {:x 28, :y 77} {:x 29, :y 61} {:x 30, :y 59} {:x 31, :y 52} {:x 32, :y 42} {:x 33, :y 57} {:x 34, :y 60} {:x 35, :y 66} {:x 36, :y 61} {:x 37, :y 77} {:x 38, :y 75} {:x 39, :y 56} {:x 40, :y 60} {:x 41, :y 51} {:x 42, :y 67} {:x 43, :y 73} {:x 44, :y 82} {:x 45, :y 68} {:x 46, :y 32} {:x 47, :y 59} {:x 48, :y 69} {:x 49, :y 92} {:x 50, :y 74} {:x 51, :y 73} {:x 52, :y 51} {:x 53, :y 68} {:x 54, :y 63} {:x 55, :y 69} {:x 56, :y 69} {:x 57, :y 65} {:x 58, :y 79} {:x 59, :y 68} {:x 60, :y 55} {:x 61, :y 59} {:x 62, :y 76} {:x 63, :y 87} {:x 64, :y 58} {:x 65, :y 3} {:x 66, :y 52} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 79} {:x 70, :y 117} {:x 71, :y 69} {:x 72, :y 106} {:x 73, :y 91} {:x 74, :y 51} {:x 75, :y 73} {:x 76, :y 0} {:x 77, :y 33} {:x 78, :y 87} {:x 79, :y 93} {:x 80, :y 127} {:x 81, :y 66} {:x 82, :y 80} {:x 83, :y 84} {:x 84, :y 79} {:x 85, :y 69} {:x 86, :y 71} {:x 87, :y 73} {:x 88, :y 52} {:x 89, :y 69} {:x 90, :y 72} {:x 91, :y 61})} {:name \"c5534c0c-840b-44b2-97a9-32b4a6e277de\", :values ({:x 0, :y 1} {:x 1, :y 23} {:x 2, :y 31} {:x 3, :y 44} {:x 4, :y 21} {:x 5, :y 36} {:x 6, :y 24} {:x 7, :y 34} {:x 8, :y 32} {:x 9, :y 27} {:x 10, :y 32} {:x 11, :y 30} {:x 12, :y 20} {:x 13, :y 17} {:x 14, :y 27} {:x 15, :y 20} {:x 16, :y 18} {:x 17, :y 20} {:x 18, :y 0} {:x 19, :y 24} {:x 20, :y 24} {:x 21, :y 28} {:x 22, :y 21} {:x 23, :y 16} {:x 24, :y 27} {:x 25, :y 16} {:x 26, :y 13} {:x 27, :y 26} {:x 28, :y 21} {:x 29, :y 32} {:x 30, :y 25} {:x 31, :y 22} {:x 32, :y 15} {:x 33, :y 12} {:x 34, :y 22} {:x 35, :y 22} {:x 36, :y 23} {:x 37, :y 30} {:x 38, :y 19} {:x 39, :y 15} {:x 40, :y 16} {:x 41, :y 17} {:x 42, :y 25} {:x 43, :y 21} {:x 44, :y 25} {:x 45, :y 31} {:x 46, :y 14} {:x 47, :y 15} {:x 48, :y 20} {:x 49, :y 32} {:x 50, :y 27} {:x 51, :y 40} {:x 52, :y 29} {:x 53, :y 16} {:x 54, :y 18} {:x 55, :y 24} {:x 56, :y 31} {:x 57, :y 27} {:x 58, :y 37} {:x 59, :y 25} {:x 60, :y 3} {:x 61, :y 27} {:x 62, :y 40} {:x 63, :y 28} {:x 64, :y 27} {:x 65, :y 1} {:x 66, :y 29} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 24} {:x 70, :y 33} {:x 71, :y 33} {:x 72, :y 33} {:x 73, :y 36} {:x 74, :y 16} {:x 75, :y 22} {:x 76, :y 0} {:x 77, :y 7} {:x 78, :y 29} {:x 79, :y 39} {:x 80, :y 24} {:x 81, :y 10} {:x 82, :y 19} {:x 83, :y 20} {:x 84, :y 25} {:x 85, :y 24} {:x 86, :y 26} {:x 87, :y 33} {:x 88, :y 22} {:x 89, :y 17} {:x 90, :y 23} {:x 91, :y 20})} {:name \"7bb9e557-a0bf-476b-9471-d19b10d25fc6\", :values ({:x 0, :y 0} {:x 1, :y 28} {:x 2, :y 28} {:x 3, :y 27} {:x 4, :y 11} {:x 5, :y 27} {:x 6, :y 36} {:x 7, :y 44} {:x 8, :y 31} {:x 9, :y 29} {:x 10, :y 31} {:x 11, :y 24} {:x 12, :y 53} {:x 13, :y 33} {:x 14, :y 27} {:x 15, :y 29} {:x 16, :y 39} {:x 17, :y 42} {:x 18, :y 19} {:x 19, :y 17} {:x 20, :y 29} {:x 21, :y 31} {:x 22, :y 31} {:x 23, :y 41} {:x 24, :y 39} {:x 25, :y 20} {:x 26, :y 19} {:x 27, :y 35} {:x 28, :y 32} {:x 29, :y 34} {:x 30, :y 45} {:x 31, :y 41} {:x 32, :y 16} {:x 33, :y 21} {:x 34, :y 31} {:x 35, :y 34} {:x 36, :y 33} {:x 37, :y 31} {:x 38, :y 29} {:x 39, :y 12} {:x 40, :y 17} {:x 41, :y 32} {:x 42, :y 31} {:x 43, :y 32} {:x 44, :y 52} {:x 45, :y 37} {:x 46, :y 13} {:x 47, :y 17} {:x 48, :y 35} {:x 49, :y 31} {:x 50, :y 32} {:x 51, :y 36} {:x 52, :y 49} {:x 53, :y 26} {:x 54, :y 27} {:x 55, :y 31} {:x 56, :y 31} {:x 57, :y 29} {:x 58, :y 48} {:x 59, :y 48} {:x 60, :y 24} {:x 61, :y 21} {:x 62, :y 28} {:x 63, :y 34} {:x 64, :y 50} {:x 65, :y 1} {:x 66, :y 27} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 24} {:x 70, :y 32} {:x 71, :y 29} {:x 72, :y 35} {:x 73, :y 31} {:x 74, :y 18} {:x 75, :y 11} {:x 76, :y 0} {:x 77, :y 16} {:x 78, :y 37} {:x 79, :y 54} {:x 80, :y 35} {:x 81, :y 17} {:x 82, :y 24} {:x 83, :y 35} {:x 84, :y 38} {:x 85, :y 30} {:x 86, :y 58} {:x 87, :y 31} {:x 88, :y 6} {:x 89, :y 15} {:x 90, :y 31} {:x 91, :y 35})}), :marks ({:type \"line\", :from {:data \"d8b132ff-0e76-420f-ab4c-61fb30032bf8\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"red\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"c5534c0c-840b-44b2-97a9-32b4a6e277de\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"green\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"7bb9e557-a0bf-476b-9471-d19b10d25fc6\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"blue\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}})}}"}
+;; <=
+
+;; **
+;;; ### Weekly Newsmagazines
+;;; Daily tweet counts of Spiegel, Stern and Focus.
+;; **
+
+;; @@
+(let [spon-counts (map #(mc/count @db "tweets" {:user.screen_name "SPIEGELONLINE" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      stern-counts (map #(mc/count @db "tweets" {:user.screen_name "sternde" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      focus-counts (map #(mc/count @db "tweets" {:user.screen_name "focusonline" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)]
+  (compose
+    (list-plot spon-counts :joined true :color "red" :plot-size 900 :plot-range [[0 100] [0 130]])
+      (list-plot stern-counts :joined true :color "green")
+      (list-plot focus-counts :joined true :color "blue")))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"width":900,"height":556.2422485351562,"padding":{"bottom":20,"top":10,"right":10,"left":50},"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":[0,100]},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":[0,130]}],"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"data":[{"name":"e21a3acc-33e0-4645-be33-6b43af75aae3","values":[{"x":0,"y":2},{"x":1,"y":60},{"x":2,"y":82},{"x":3,"y":71},{"x":4,"y":62},{"x":5,"y":54},{"x":6,"y":58},{"x":7,"y":73},{"x":8,"y":62},{"x":9,"y":79},{"x":10,"y":88},{"x":11,"y":62},{"x":12,"y":67},{"x":13,"y":61},{"x":14,"y":57},{"x":15,"y":62},{"x":16,"y":68},{"x":17,"y":59},{"x":18,"y":51},{"x":19,"y":44},{"x":20,"y":45},{"x":21,"y":73},{"x":22,"y":48},{"x":23,"y":60},{"x":24,"y":50},{"x":25,"y":47},{"x":26,"y":36},{"x":27,"y":49},{"x":28,"y":70},{"x":29,"y":55},{"x":30,"y":58},{"x":31,"y":66},{"x":32,"y":43},{"x":33,"y":53},{"x":34,"y":61},{"x":35,"y":50},{"x":36,"y":69},{"x":37,"y":60},{"x":38,"y":50},{"x":39,"y":44},{"x":40,"y":37},{"x":41,"y":49},{"x":42,"y":62},{"x":43,"y":68},{"x":44,"y":58},{"x":45,"y":61},{"x":46,"y":53},{"x":47,"y":42},{"x":48,"y":54},{"x":49,"y":59},{"x":50,"y":42},{"x":51,"y":56},{"x":52,"y":55},{"x":53,"y":55},{"x":54,"y":56},{"x":55,"y":50},{"x":56,"y":62},{"x":57,"y":56},{"x":58,"y":60},{"x":59,"y":82},{"x":60,"y":70},{"x":61,"y":82},{"x":62,"y":84},{"x":63,"y":63},{"x":64,"y":96},{"x":65,"y":0},{"x":66,"y":43},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":39},{"x":70,"y":50},{"x":71,"y":84},{"x":72,"y":72},{"x":73,"y":81},{"x":74,"y":49},{"x":75,"y":82},{"x":76,"y":0},{"x":77,"y":20},{"x":78,"y":105},{"x":79,"y":108},{"x":80,"y":69},{"x":81,"y":73},{"x":82,"y":85},{"x":83,"y":50},{"x":84,"y":68},{"x":85,"y":63},{"x":86,"y":62},{"x":87,"y":63},{"x":88,"y":46},{"x":89,"y":52},{"x":90,"y":58},{"x":91,"y":77}]},{"name":"5c5ebd98-7021-4cbc-991a-9fc0df6abaed","values":[{"x":0,"y":0},{"x":1,"y":32},{"x":2,"y":35},{"x":3,"y":30},{"x":4,"y":19},{"x":5,"y":26},{"x":6,"y":42},{"x":7,"y":25},{"x":8,"y":40},{"x":9,"y":35},{"x":10,"y":25},{"x":11,"y":25},{"x":12,"y":24},{"x":13,"y":48},{"x":14,"y":52},{"x":15,"y":34},{"x":16,"y":36},{"x":17,"y":30},{"x":18,"y":18},{"x":19,"y":19},{"x":20,"y":33},{"x":21,"y":34},{"x":22,"y":42},{"x":23,"y":39},{"x":24,"y":29},{"x":25,"y":17},{"x":26,"y":16},{"x":27,"y":50},{"x":28,"y":44},{"x":29,"y":47},{"x":30,"y":33},{"x":31,"y":24},{"x":32,"y":17},{"x":33,"y":30},{"x":34,"y":46},{"x":35,"y":39},{"x":36,"y":43},{"x":37,"y":46},{"x":38,"y":36},{"x":39,"y":20},{"x":40,"y":11},{"x":41,"y":32},{"x":42,"y":34},{"x":43,"y":36},{"x":44,"y":27},{"x":45,"y":28},{"x":46,"y":26},{"x":47,"y":23},{"x":48,"y":39},{"x":49,"y":42},{"x":50,"y":31},{"x":51,"y":26},{"x":52,"y":25},{"x":53,"y":17},{"x":54,"y":15},{"x":55,"y":40},{"x":56,"y":37},{"x":57,"y":41},{"x":58,"y":40},{"x":59,"y":32},{"x":60,"y":43},{"x":61,"y":36},{"x":62,"y":49},{"x":63,"y":33},{"x":64,"y":44},{"x":65,"y":1},{"x":66,"y":21},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":33},{"x":70,"y":50},{"x":71,"y":38},{"x":72,"y":32},{"x":73,"y":24},{"x":74,"y":26},{"x":75,"y":25},{"x":76,"y":0},{"x":77,"y":16},{"x":78,"y":46},{"x":79,"y":33},{"x":80,"y":19},{"x":81,"y":23},{"x":82,"y":26},{"x":83,"y":31},{"x":84,"y":40},{"x":85,"y":35},{"x":86,"y":24},{"x":87,"y":25},{"x":88,"y":35},{"x":89,"y":33},{"x":90,"y":45},{"x":91,"y":46}]},{"name":"4808bf7a-4ed3-47d3-945f-7e64cd282365","values":[{"x":0,"y":3},{"x":1,"y":6},{"x":2,"y":4},{"x":3,"y":9},{"x":4,"y":14},{"x":5,"y":4},{"x":6,"y":9},{"x":7,"y":19},{"x":8,"y":14},{"x":9,"y":5},{"x":10,"y":8},{"x":11,"y":17},{"x":12,"y":43},{"x":13,"y":4},{"x":14,"y":7},{"x":15,"y":12},{"x":16,"y":22},{"x":17,"y":8},{"x":18,"y":7},{"x":19,"y":12},{"x":20,"y":11},{"x":21,"y":13},{"x":22,"y":14},{"x":23,"y":13},{"x":24,"y":7},{"x":25,"y":5},{"x":26,"y":11},{"x":27,"y":12},{"x":28,"y":12},{"x":29,"y":6},{"x":30,"y":6},{"x":31,"y":8},{"x":32,"y":2},{"x":33,"y":6},{"x":34,"y":6},{"x":35,"y":8},{"x":36,"y":9},{"x":37,"y":9},{"x":38,"y":12},{"x":39,"y":4},{"x":40,"y":8},{"x":41,"y":7},{"x":42,"y":13},{"x":43,"y":9},{"x":44,"y":9},{"x":45,"y":9},{"x":46,"y":4},{"x":47,"y":10},{"x":48,"y":10},{"x":49,"y":15},{"x":50,"y":12},{"x":51,"y":8},{"x":52,"y":9},{"x":53,"y":8},{"x":54,"y":7},{"x":55,"y":17},{"x":56,"y":10},{"x":57,"y":9},{"x":58,"y":7},{"x":59,"y":6},{"x":60,"y":12},{"x":61,"y":8},{"x":62,"y":10},{"x":63,"y":9},{"x":64,"y":17},{"x":65,"y":1},{"x":66,"y":11},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":6},{"x":70,"y":9},{"x":71,"y":9},{"x":72,"y":9},{"x":73,"y":12},{"x":74,"y":7},{"x":75,"y":9},{"x":76,"y":0},{"x":77,"y":6},{"x":78,"y":11},{"x":79,"y":13},{"x":80,"y":10},{"x":81,"y":10},{"x":82,"y":10},{"x":83,"y":6},{"x":84,"y":10},{"x":85,"y":4},{"x":86,"y":5},{"x":87,"y":5},{"x":88,"y":9},{"x":89,"y":4},{"x":90,"y":9},{"x":91,"y":5}]}],"marks":[{"type":"line","from":{"data":"e21a3acc-33e0-4645-be33-6b43af75aae3"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"red"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"5c5ebd98-7021-4cbc-991a-9fc0df6abaed"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"green"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"4808bf7a-4ed3-47d3-945f-7e64cd282365"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"blue"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}}]},"value":"#gorilla_repl.vega.VegaView{:content {:width 900, :height 556.24225, :padding {:bottom 20, :top 10, :right 10, :left 50}, :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain [0 100]} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain [0 130]}], :axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :data ({:name \"e21a3acc-33e0-4645-be33-6b43af75aae3\", :values ({:x 0, :y 2} {:x 1, :y 60} {:x 2, :y 82} {:x 3, :y 71} {:x 4, :y 62} {:x 5, :y 54} {:x 6, :y 58} {:x 7, :y 73} {:x 8, :y 62} {:x 9, :y 79} {:x 10, :y 88} {:x 11, :y 62} {:x 12, :y 67} {:x 13, :y 61} {:x 14, :y 57} {:x 15, :y 62} {:x 16, :y 68} {:x 17, :y 59} {:x 18, :y 51} {:x 19, :y 44} {:x 20, :y 45} {:x 21, :y 73} {:x 22, :y 48} {:x 23, :y 60} {:x 24, :y 50} {:x 25, :y 47} {:x 26, :y 36} {:x 27, :y 49} {:x 28, :y 70} {:x 29, :y 55} {:x 30, :y 58} {:x 31, :y 66} {:x 32, :y 43} {:x 33, :y 53} {:x 34, :y 61} {:x 35, :y 50} {:x 36, :y 69} {:x 37, :y 60} {:x 38, :y 50} {:x 39, :y 44} {:x 40, :y 37} {:x 41, :y 49} {:x 42, :y 62} {:x 43, :y 68} {:x 44, :y 58} {:x 45, :y 61} {:x 46, :y 53} {:x 47, :y 42} {:x 48, :y 54} {:x 49, :y 59} {:x 50, :y 42} {:x 51, :y 56} {:x 52, :y 55} {:x 53, :y 55} {:x 54, :y 56} {:x 55, :y 50} {:x 56, :y 62} {:x 57, :y 56} {:x 58, :y 60} {:x 59, :y 82} {:x 60, :y 70} {:x 61, :y 82} {:x 62, :y 84} {:x 63, :y 63} {:x 64, :y 96} {:x 65, :y 0} {:x 66, :y 43} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 39} {:x 70, :y 50} {:x 71, :y 84} {:x 72, :y 72} {:x 73, :y 81} {:x 74, :y 49} {:x 75, :y 82} {:x 76, :y 0} {:x 77, :y 20} {:x 78, :y 105} {:x 79, :y 108} {:x 80, :y 69} {:x 81, :y 73} {:x 82, :y 85} {:x 83, :y 50} {:x 84, :y 68} {:x 85, :y 63} {:x 86, :y 62} {:x 87, :y 63} {:x 88, :y 46} {:x 89, :y 52} {:x 90, :y 58} {:x 91, :y 77})} {:name \"5c5ebd98-7021-4cbc-991a-9fc0df6abaed\", :values ({:x 0, :y 0} {:x 1, :y 32} {:x 2, :y 35} {:x 3, :y 30} {:x 4, :y 19} {:x 5, :y 26} {:x 6, :y 42} {:x 7, :y 25} {:x 8, :y 40} {:x 9, :y 35} {:x 10, :y 25} {:x 11, :y 25} {:x 12, :y 24} {:x 13, :y 48} {:x 14, :y 52} {:x 15, :y 34} {:x 16, :y 36} {:x 17, :y 30} {:x 18, :y 18} {:x 19, :y 19} {:x 20, :y 33} {:x 21, :y 34} {:x 22, :y 42} {:x 23, :y 39} {:x 24, :y 29} {:x 25, :y 17} {:x 26, :y 16} {:x 27, :y 50} {:x 28, :y 44} {:x 29, :y 47} {:x 30, :y 33} {:x 31, :y 24} {:x 32, :y 17} {:x 33, :y 30} {:x 34, :y 46} {:x 35, :y 39} {:x 36, :y 43} {:x 37, :y 46} {:x 38, :y 36} {:x 39, :y 20} {:x 40, :y 11} {:x 41, :y 32} {:x 42, :y 34} {:x 43, :y 36} {:x 44, :y 27} {:x 45, :y 28} {:x 46, :y 26} {:x 47, :y 23} {:x 48, :y 39} {:x 49, :y 42} {:x 50, :y 31} {:x 51, :y 26} {:x 52, :y 25} {:x 53, :y 17} {:x 54, :y 15} {:x 55, :y 40} {:x 56, :y 37} {:x 57, :y 41} {:x 58, :y 40} {:x 59, :y 32} {:x 60, :y 43} {:x 61, :y 36} {:x 62, :y 49} {:x 63, :y 33} {:x 64, :y 44} {:x 65, :y 1} {:x 66, :y 21} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 33} {:x 70, :y 50} {:x 71, :y 38} {:x 72, :y 32} {:x 73, :y 24} {:x 74, :y 26} {:x 75, :y 25} {:x 76, :y 0} {:x 77, :y 16} {:x 78, :y 46} {:x 79, :y 33} {:x 80, :y 19} {:x 81, :y 23} {:x 82, :y 26} {:x 83, :y 31} {:x 84, :y 40} {:x 85, :y 35} {:x 86, :y 24} {:x 87, :y 25} {:x 88, :y 35} {:x 89, :y 33} {:x 90, :y 45} {:x 91, :y 46})} {:name \"4808bf7a-4ed3-47d3-945f-7e64cd282365\", :values ({:x 0, :y 3} {:x 1, :y 6} {:x 2, :y 4} {:x 3, :y 9} {:x 4, :y 14} {:x 5, :y 4} {:x 6, :y 9} {:x 7, :y 19} {:x 8, :y 14} {:x 9, :y 5} {:x 10, :y 8} {:x 11, :y 17} {:x 12, :y 43} {:x 13, :y 4} {:x 14, :y 7} {:x 15, :y 12} {:x 16, :y 22} {:x 17, :y 8} {:x 18, :y 7} {:x 19, :y 12} {:x 20, :y 11} {:x 21, :y 13} {:x 22, :y 14} {:x 23, :y 13} {:x 24, :y 7} {:x 25, :y 5} {:x 26, :y 11} {:x 27, :y 12} {:x 28, :y 12} {:x 29, :y 6} {:x 30, :y 6} {:x 31, :y 8} {:x 32, :y 2} {:x 33, :y 6} {:x 34, :y 6} {:x 35, :y 8} {:x 36, :y 9} {:x 37, :y 9} {:x 38, :y 12} {:x 39, :y 4} {:x 40, :y 8} {:x 41, :y 7} {:x 42, :y 13} {:x 43, :y 9} {:x 44, :y 9} {:x 45, :y 9} {:x 46, :y 4} {:x 47, :y 10} {:x 48, :y 10} {:x 49, :y 15} {:x 50, :y 12} {:x 51, :y 8} {:x 52, :y 9} {:x 53, :y 8} {:x 54, :y 7} {:x 55, :y 17} {:x 56, :y 10} {:x 57, :y 9} {:x 58, :y 7} {:x 59, :y 6} {:x 60, :y 12} {:x 61, :y 8} {:x 62, :y 10} {:x 63, :y 9} {:x 64, :y 17} {:x 65, :y 1} {:x 66, :y 11} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 6} {:x 70, :y 9} {:x 71, :y 9} {:x 72, :y 9} {:x 73, :y 12} {:x 74, :y 7} {:x 75, :y 9} {:x 76, :y 0} {:x 77, :y 6} {:x 78, :y 11} {:x 79, :y 13} {:x 80, :y 10} {:x 81, :y 10} {:x 82, :y 10} {:x 83, :y 6} {:x 84, :y 10} {:x 85, :y 4} {:x 86, :y 5} {:x 87, :y 5} {:x 88, :y 9} {:x 89, :y 4} {:x 90, :y 9} {:x 91, :y 5})}), :marks ({:type \"line\", :from {:data \"e21a3acc-33e0-4645-be33-6b43af75aae3\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"red\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"5c5ebd98-7021-4cbc-991a-9fc0df6abaed\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"green\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"4808bf7a-4ed3-47d3-945f-7e64cd282365\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"blue\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}})}}"}
+;; <=
+
+;; **
+;;; ### TV News
+;; **
+
+;; @@
+(let [tagesschau-counts (map #(mc/count @db "tweets" {:user.screen_name "tagesschau" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      zdf-counts (map #(mc/count @db "tweets" {:user.screen_name "ZDFheute" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      n24-counts (map #(mc/count @db "tweets" {:user.screen_name "N24_de" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)
+      ntv-counts (map #(mc/count @db "tweets" {:user.screen_name "ntvde" :created_at {$gte % $lt (t/plus % (t/days 1))}}) dates)]
+  (compose
+    (list-plot tagesschau-counts :joined true :color "red" :plot-size 1000 :plot-range [[0 100] [0 210]])
+    (list-plot zdf-counts :joined true :color "green")
+    (list-plot n24-counts :joined true :color "orange")
+    (list-plot ntv-counts :joined true :color "blue")))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"width":1000,"height":618.0469970703125,"padding":{"bottom":20,"top":10,"right":10,"left":50},"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":[0,100]},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":[0,210]}],"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"data":[{"name":"f0136972-1309-4547-8e83-46d9e0ea7b82","values":[{"x":0,"y":7},{"x":1,"y":67},{"x":2,"y":76},{"x":3,"y":125},{"x":4,"y":62},{"x":5,"y":26},{"x":6,"y":103},{"x":7,"y":210},{"x":8,"y":95},{"x":9,"y":70},{"x":10,"y":55},{"x":11,"y":37},{"x":12,"y":146},{"x":13,"y":59},{"x":14,"y":121},{"x":15,"y":68},{"x":16,"y":84},{"x":17,"y":78},{"x":18,"y":31},{"x":19,"y":48},{"x":20,"y":38},{"x":21,"y":75},{"x":22,"y":90},{"x":23,"y":64},{"x":24,"y":47},{"x":25,"y":54},{"x":26,"y":40},{"x":27,"y":72},{"x":28,"y":69},{"x":29,"y":45},{"x":30,"y":60},{"x":31,"y":84},{"x":32,"y":32},{"x":33,"y":42},{"x":34,"y":52},{"x":35,"y":73},{"x":36,"y":66},{"x":37,"y":47},{"x":38,"y":66},{"x":39,"y":41},{"x":40,"y":42},{"x":41,"y":45},{"x":42,"y":56},{"x":43,"y":47},{"x":44,"y":61},{"x":45,"y":74},{"x":46,"y":39},{"x":47,"y":21},{"x":48,"y":59},{"x":49,"y":71},{"x":50,"y":65},{"x":51,"y":68},{"x":52,"y":53},{"x":53,"y":36},{"x":54,"y":28},{"x":55,"y":54},{"x":56,"y":66},{"x":57,"y":50},{"x":58,"y":91},{"x":59,"y":52},{"x":60,"y":32},{"x":61,"y":123},{"x":62,"y":71},{"x":63,"y":47},{"x":64,"y":56},{"x":65,"y":1},{"x":66,"y":70},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":42},{"x":70,"y":70},{"x":71,"y":77},{"x":72,"y":70},{"x":73,"y":66},{"x":74,"y":53},{"x":75,"y":47},{"x":76,"y":0},{"x":77,"y":25},{"x":78,"y":55},{"x":79,"y":68},{"x":80,"y":59},{"x":81,"y":37},{"x":82,"y":41},{"x":83,"y":71},{"x":84,"y":84},{"x":85,"y":61},{"x":86,"y":61},{"x":87,"y":67},{"x":88,"y":41},{"x":89,"y":43},{"x":90,"y":81},{"x":91,"y":70}]},{"name":"4fdc1329-f7bc-4bb6-8513-eba22aafc64a","values":[{"x":0,"y":1},{"x":1,"y":23},{"x":2,"y":33},{"x":3,"y":39},{"x":4,"y":53},{"x":5,"y":33},{"x":6,"y":34},{"x":7,"y":71},{"x":8,"y":48},{"x":9,"y":47},{"x":10,"y":29},{"x":11,"y":25},{"x":12,"y":37},{"x":13,"y":39},{"x":14,"y":71},{"x":15,"y":27},{"x":16,"y":52},{"x":17,"y":40},{"x":18,"y":10},{"x":19,"y":16},{"x":20,"y":36},{"x":21,"y":42},{"x":22,"y":32},{"x":23,"y":34},{"x":24,"y":23},{"x":25,"y":21},{"x":26,"y":20},{"x":27,"y":21},{"x":28,"y":27},{"x":29,"y":17},{"x":30,"y":26},{"x":31,"y":33},{"x":32,"y":27},{"x":33,"y":24},{"x":34,"y":42},{"x":35,"y":32},{"x":36,"y":26},{"x":37,"y":28},{"x":38,"y":37},{"x":39,"y":21},{"x":40,"y":18},{"x":41,"y":30},{"x":42,"y":31},{"x":43,"y":45},{"x":44,"y":40},{"x":45,"y":28},{"x":46,"y":30},{"x":47,"y":31},{"x":48,"y":25},{"x":49,"y":45},{"x":50,"y":37},{"x":51,"y":29},{"x":52,"y":26},{"x":53,"y":17},{"x":54,"y":17},{"x":55,"y":26},{"x":56,"y":50},{"x":57,"y":28},{"x":58,"y":24},{"x":59,"y":33},{"x":60,"y":14},{"x":61,"y":56},{"x":62,"y":41},{"x":63,"y":25},{"x":64,"y":32},{"x":65,"y":0},{"x":66,"y":13},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":18},{"x":70,"y":28},{"x":71,"y":30},{"x":72,"y":25},{"x":73,"y":38},{"x":74,"y":16},{"x":75,"y":49},{"x":76,"y":0},{"x":77,"y":27},{"x":78,"y":21},{"x":79,"y":27},{"x":80,"y":34},{"x":81,"y":14},{"x":82,"y":17},{"x":83,"y":26},{"x":84,"y":27},{"x":85,"y":24},{"x":86,"y":10},{"x":87,"y":34},{"x":88,"y":19},{"x":89,"y":24},{"x":90,"y":28},{"x":91,"y":33}]},{"name":"f9108fd6-b293-4463-b82e-3ce71435c8fd","values":[{"x":0,"y":1},{"x":1,"y":76},{"x":2,"y":70},{"x":3,"y":62},{"x":4,"y":48},{"x":5,"y":66},{"x":6,"y":74},{"x":7,"y":72},{"x":8,"y":78},{"x":9,"y":60},{"x":10,"y":68},{"x":11,"y":43},{"x":12,"y":35},{"x":13,"y":66},{"x":14,"y":104},{"x":15,"y":73},{"x":16,"y":89},{"x":17,"y":99},{"x":18,"y":61},{"x":19,"y":50},{"x":20,"y":68},{"x":21,"y":68},{"x":22,"y":80},{"x":23,"y":93},{"x":24,"y":74},{"x":25,"y":53},{"x":26,"y":58},{"x":27,"y":74},{"x":28,"y":85},{"x":29,"y":88},{"x":30,"y":69},{"x":31,"y":87},{"x":32,"y":50},{"x":33,"y":56},{"x":34,"y":75},{"x":35,"y":67},{"x":36,"y":83},{"x":37,"y":72},{"x":38,"y":58},{"x":39,"y":43},{"x":40,"y":53},{"x":41,"y":58},{"x":42,"y":65},{"x":43,"y":65},{"x":44,"y":61},{"x":45,"y":75},{"x":46,"y":53},{"x":47,"y":49},{"x":48,"y":60},{"x":49,"y":76},{"x":50,"y":74},{"x":51,"y":63},{"x":52,"y":77},{"x":53,"y":47},{"x":54,"y":46},{"x":55,"y":68},{"x":56,"y":73},{"x":57,"y":69},{"x":58,"y":73},{"x":59,"y":61},{"x":60,"y":48},{"x":61,"y":57},{"x":62,"y":63},{"x":63,"y":68},{"x":64,"y":68},{"x":65,"y":1},{"x":66,"y":56},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":57},{"x":70,"y":86},{"x":71,"y":58},{"x":72,"y":65},{"x":73,"y":73},{"x":74,"y":52},{"x":75,"y":44},{"x":76,"y":0},{"x":77,"y":36},{"x":78,"y":62},{"x":79,"y":55},{"x":80,"y":67},{"x":81,"y":46},{"x":82,"y":44},{"x":83,"y":51},{"x":84,"y":65},{"x":85,"y":60},{"x":86,"y":68},{"x":87,"y":58},{"x":88,"y":48},{"x":89,"y":48},{"x":90,"y":65},{"x":91,"y":65}]},{"name":"f7fecaec-a434-4ae1-9ff3-2bb8f2dd9700","values":[{"x":0,"y":4},{"x":1,"y":33},{"x":2,"y":51},{"x":3,"y":61},{"x":4,"y":43},{"x":5,"y":41},{"x":6,"y":53},{"x":7,"y":49},{"x":8,"y":55},{"x":9,"y":54},{"x":10,"y":57},{"x":11,"y":43},{"x":12,"y":41},{"x":13,"y":47},{"x":14,"y":45},{"x":15,"y":45},{"x":16,"y":57},{"x":17,"y":39},{"x":18,"y":36},{"x":19,"y":47},{"x":20,"y":50},{"x":21,"y":50},{"x":22,"y":50},{"x":23,"y":52},{"x":24,"y":51},{"x":25,"y":43},{"x":26,"y":44},{"x":27,"y":47},{"x":28,"y":57},{"x":29,"y":46},{"x":30,"y":62},{"x":31,"y":49},{"x":32,"y":43},{"x":33,"y":43},{"x":34,"y":43},{"x":35,"y":50},{"x":36,"y":42},{"x":37,"y":44},{"x":38,"y":46},{"x":39,"y":34},{"x":40,"y":41},{"x":41,"y":47},{"x":42,"y":48},{"x":43,"y":68},{"x":44,"y":113},{"x":45,"y":114},{"x":46,"y":49},{"x":47,"y":28},{"x":48,"y":50},{"x":49,"y":62},{"x":50,"y":63},{"x":51,"y":61},{"x":52,"y":75},{"x":53,"y":70},{"x":54,"y":57},{"x":55,"y":72},{"x":56,"y":73},{"x":57,"y":67},{"x":58,"y":77},{"x":59,"y":67},{"x":60,"y":62},{"x":61,"y":59},{"x":62,"y":64},{"x":63,"y":74},{"x":64,"y":67},{"x":65,"y":0},{"x":66,"y":43},{"x":67,"y":0},{"x":68,"y":0},{"x":69,"y":56},{"x":70,"y":80},{"x":71,"y":70},{"x":72,"y":79},{"x":73,"y":75},{"x":74,"y":56},{"x":75,"y":51},{"x":76,"y":0},{"x":77,"y":33},{"x":78,"y":72},{"x":79,"y":68},{"x":80,"y":71},{"x":81,"y":65},{"x":82,"y":63},{"x":83,"y":64},{"x":84,"y":71},{"x":85,"y":75},{"x":86,"y":72},{"x":87,"y":68},{"x":88,"y":62},{"x":89,"y":56},{"x":90,"y":71},{"x":91,"y":73}]}],"marks":[{"type":"line","from":{"data":"f0136972-1309-4547-8e83-46d9e0ea7b82"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"red"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"4fdc1329-f7bc-4bb6-8513-eba22aafc64a"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"green"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"f9108fd6-b293-4463-b82e-3ce71435c8fd"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"orange"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}},{"type":"line","from":{"data":"f7fecaec-a434-4ae1-9ff3-2bb8f2dd9700"},"properties":{"enter":{"x":{"scale":"x","field":"data.x"},"y":{"scale":"y","field":"data.y"},"stroke":{"value":"blue"},"strokeWidth":{"value":2},"strokeOpacity":{"value":1}}}}]},"value":"#gorilla_repl.vega.VegaView{:content {:width 1000, :height 618.047, :padding {:bottom 20, :top 10, :right 10, :left 50}, :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain [0 100]} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain [0 210]}], :axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :data ({:name \"f0136972-1309-4547-8e83-46d9e0ea7b82\", :values ({:x 0, :y 7} {:x 1, :y 67} {:x 2, :y 76} {:x 3, :y 125} {:x 4, :y 62} {:x 5, :y 26} {:x 6, :y 103} {:x 7, :y 210} {:x 8, :y 95} {:x 9, :y 70} {:x 10, :y 55} {:x 11, :y 37} {:x 12, :y 146} {:x 13, :y 59} {:x 14, :y 121} {:x 15, :y 68} {:x 16, :y 84} {:x 17, :y 78} {:x 18, :y 31} {:x 19, :y 48} {:x 20, :y 38} {:x 21, :y 75} {:x 22, :y 90} {:x 23, :y 64} {:x 24, :y 47} {:x 25, :y 54} {:x 26, :y 40} {:x 27, :y 72} {:x 28, :y 69} {:x 29, :y 45} {:x 30, :y 60} {:x 31, :y 84} {:x 32, :y 32} {:x 33, :y 42} {:x 34, :y 52} {:x 35, :y 73} {:x 36, :y 66} {:x 37, :y 47} {:x 38, :y 66} {:x 39, :y 41} {:x 40, :y 42} {:x 41, :y 45} {:x 42, :y 56} {:x 43, :y 47} {:x 44, :y 61} {:x 45, :y 74} {:x 46, :y 39} {:x 47, :y 21} {:x 48, :y 59} {:x 49, :y 71} {:x 50, :y 65} {:x 51, :y 68} {:x 52, :y 53} {:x 53, :y 36} {:x 54, :y 28} {:x 55, :y 54} {:x 56, :y 66} {:x 57, :y 50} {:x 58, :y 91} {:x 59, :y 52} {:x 60, :y 32} {:x 61, :y 123} {:x 62, :y 71} {:x 63, :y 47} {:x 64, :y 56} {:x 65, :y 1} {:x 66, :y 70} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 42} {:x 70, :y 70} {:x 71, :y 77} {:x 72, :y 70} {:x 73, :y 66} {:x 74, :y 53} {:x 75, :y 47} {:x 76, :y 0} {:x 77, :y 25} {:x 78, :y 55} {:x 79, :y 68} {:x 80, :y 59} {:x 81, :y 37} {:x 82, :y 41} {:x 83, :y 71} {:x 84, :y 84} {:x 85, :y 61} {:x 86, :y 61} {:x 87, :y 67} {:x 88, :y 41} {:x 89, :y 43} {:x 90, :y 81} {:x 91, :y 70})} {:name \"4fdc1329-f7bc-4bb6-8513-eba22aafc64a\", :values ({:x 0, :y 1} {:x 1, :y 23} {:x 2, :y 33} {:x 3, :y 39} {:x 4, :y 53} {:x 5, :y 33} {:x 6, :y 34} {:x 7, :y 71} {:x 8, :y 48} {:x 9, :y 47} {:x 10, :y 29} {:x 11, :y 25} {:x 12, :y 37} {:x 13, :y 39} {:x 14, :y 71} {:x 15, :y 27} {:x 16, :y 52} {:x 17, :y 40} {:x 18, :y 10} {:x 19, :y 16} {:x 20, :y 36} {:x 21, :y 42} {:x 22, :y 32} {:x 23, :y 34} {:x 24, :y 23} {:x 25, :y 21} {:x 26, :y 20} {:x 27, :y 21} {:x 28, :y 27} {:x 29, :y 17} {:x 30, :y 26} {:x 31, :y 33} {:x 32, :y 27} {:x 33, :y 24} {:x 34, :y 42} {:x 35, :y 32} {:x 36, :y 26} {:x 37, :y 28} {:x 38, :y 37} {:x 39, :y 21} {:x 40, :y 18} {:x 41, :y 30} {:x 42, :y 31} {:x 43, :y 45} {:x 44, :y 40} {:x 45, :y 28} {:x 46, :y 30} {:x 47, :y 31} {:x 48, :y 25} {:x 49, :y 45} {:x 50, :y 37} {:x 51, :y 29} {:x 52, :y 26} {:x 53, :y 17} {:x 54, :y 17} {:x 55, :y 26} {:x 56, :y 50} {:x 57, :y 28} {:x 58, :y 24} {:x 59, :y 33} {:x 60, :y 14} {:x 61, :y 56} {:x 62, :y 41} {:x 63, :y 25} {:x 64, :y 32} {:x 65, :y 0} {:x 66, :y 13} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 18} {:x 70, :y 28} {:x 71, :y 30} {:x 72, :y 25} {:x 73, :y 38} {:x 74, :y 16} {:x 75, :y 49} {:x 76, :y 0} {:x 77, :y 27} {:x 78, :y 21} {:x 79, :y 27} {:x 80, :y 34} {:x 81, :y 14} {:x 82, :y 17} {:x 83, :y 26} {:x 84, :y 27} {:x 85, :y 24} {:x 86, :y 10} {:x 87, :y 34} {:x 88, :y 19} {:x 89, :y 24} {:x 90, :y 28} {:x 91, :y 33})} {:name \"f9108fd6-b293-4463-b82e-3ce71435c8fd\", :values ({:x 0, :y 1} {:x 1, :y 76} {:x 2, :y 70} {:x 3, :y 62} {:x 4, :y 48} {:x 5, :y 66} {:x 6, :y 74} {:x 7, :y 72} {:x 8, :y 78} {:x 9, :y 60} {:x 10, :y 68} {:x 11, :y 43} {:x 12, :y 35} {:x 13, :y 66} {:x 14, :y 104} {:x 15, :y 73} {:x 16, :y 89} {:x 17, :y 99} {:x 18, :y 61} {:x 19, :y 50} {:x 20, :y 68} {:x 21, :y 68} {:x 22, :y 80} {:x 23, :y 93} {:x 24, :y 74} {:x 25, :y 53} {:x 26, :y 58} {:x 27, :y 74} {:x 28, :y 85} {:x 29, :y 88} {:x 30, :y 69} {:x 31, :y 87} {:x 32, :y 50} {:x 33, :y 56} {:x 34, :y 75} {:x 35, :y 67} {:x 36, :y 83} {:x 37, :y 72} {:x 38, :y 58} {:x 39, :y 43} {:x 40, :y 53} {:x 41, :y 58} {:x 42, :y 65} {:x 43, :y 65} {:x 44, :y 61} {:x 45, :y 75} {:x 46, :y 53} {:x 47, :y 49} {:x 48, :y 60} {:x 49, :y 76} {:x 50, :y 74} {:x 51, :y 63} {:x 52, :y 77} {:x 53, :y 47} {:x 54, :y 46} {:x 55, :y 68} {:x 56, :y 73} {:x 57, :y 69} {:x 58, :y 73} {:x 59, :y 61} {:x 60, :y 48} {:x 61, :y 57} {:x 62, :y 63} {:x 63, :y 68} {:x 64, :y 68} {:x 65, :y 1} {:x 66, :y 56} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 57} {:x 70, :y 86} {:x 71, :y 58} {:x 72, :y 65} {:x 73, :y 73} {:x 74, :y 52} {:x 75, :y 44} {:x 76, :y 0} {:x 77, :y 36} {:x 78, :y 62} {:x 79, :y 55} {:x 80, :y 67} {:x 81, :y 46} {:x 82, :y 44} {:x 83, :y 51} {:x 84, :y 65} {:x 85, :y 60} {:x 86, :y 68} {:x 87, :y 58} {:x 88, :y 48} {:x 89, :y 48} {:x 90, :y 65} {:x 91, :y 65})} {:name \"f7fecaec-a434-4ae1-9ff3-2bb8f2dd9700\", :values ({:x 0, :y 4} {:x 1, :y 33} {:x 2, :y 51} {:x 3, :y 61} {:x 4, :y 43} {:x 5, :y 41} {:x 6, :y 53} {:x 7, :y 49} {:x 8, :y 55} {:x 9, :y 54} {:x 10, :y 57} {:x 11, :y 43} {:x 12, :y 41} {:x 13, :y 47} {:x 14, :y 45} {:x 15, :y 45} {:x 16, :y 57} {:x 17, :y 39} {:x 18, :y 36} {:x 19, :y 47} {:x 20, :y 50} {:x 21, :y 50} {:x 22, :y 50} {:x 23, :y 52} {:x 24, :y 51} {:x 25, :y 43} {:x 26, :y 44} {:x 27, :y 47} {:x 28, :y 57} {:x 29, :y 46} {:x 30, :y 62} {:x 31, :y 49} {:x 32, :y 43} {:x 33, :y 43} {:x 34, :y 43} {:x 35, :y 50} {:x 36, :y 42} {:x 37, :y 44} {:x 38, :y 46} {:x 39, :y 34} {:x 40, :y 41} {:x 41, :y 47} {:x 42, :y 48} {:x 43, :y 68} {:x 44, :y 113} {:x 45, :y 114} {:x 46, :y 49} {:x 47, :y 28} {:x 48, :y 50} {:x 49, :y 62} {:x 50, :y 63} {:x 51, :y 61} {:x 52, :y 75} {:x 53, :y 70} {:x 54, :y 57} {:x 55, :y 72} {:x 56, :y 73} {:x 57, :y 67} {:x 58, :y 77} {:x 59, :y 67} {:x 60, :y 62} {:x 61, :y 59} {:x 62, :y 64} {:x 63, :y 74} {:x 64, :y 67} {:x 65, :y 0} {:x 66, :y 43} {:x 67, :y 0} {:x 68, :y 0} {:x 69, :y 56} {:x 70, :y 80} {:x 71, :y 70} {:x 72, :y 79} {:x 73, :y 75} {:x 74, :y 56} {:x 75, :y 51} {:x 76, :y 0} {:x 77, :y 33} {:x 78, :y 72} {:x 79, :y 68} {:x 80, :y 71} {:x 81, :y 65} {:x 82, :y 63} {:x 83, :y 64} {:x 84, :y 71} {:x 85, :y 75} {:x 86, :y 72} {:x 87, :y 68} {:x 88, :y 62} {:x 89, :y 56} {:x 90, :y 71} {:x 91, :y 73})}), :marks ({:type \"line\", :from {:data \"f0136972-1309-4547-8e83-46d9e0ea7b82\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"red\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"4fdc1329-f7bc-4bb6-8513-eba22aafc64a\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"green\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"f9108fd6-b293-4463-b82e-3ce71435c8fd\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"orange\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}} {:type \"line\", :from {:data \"f7fecaec-a434-4ae1-9ff3-2bb8f2dd9700\"}, :properties {:enter {:x {:scale \"x\", :field \"data.x\"}, :y {:scale \"y\", :field \"data.y\"}, :stroke {:value \"blue\"}, :strokeWidth {:value 2}, :strokeOpacity {:value 1}}}})}}"}
+;; <=
+
+;; **
+;;; ## Average Tweets per Hour
+;; **
+
+;; @@
+(let [days-running (t/in-hours (t/interval start-date end-date))
+        dates (take days-running (p/periodic-seq start-date (t/hours 1)))
+        tweet-count (map #(mc/count @db "tweets" {:created_at {$gte % $lt (t/plus % (t/hours 1))}}) dates)
+        times (range days-running)
+        tweet-count-2 (loop [hours-list []
+                             tweet-dist tweet-count]
+                        (if (empty? tweet-dist)
+                          hours-list
+                          (recur (conj hours-list (vec (take 24 tweet-dist))) (drop 24 tweet-dist))))
+        avg-tweets-per-hour (map (fn [hour] (/ (reduce + (map (fn [count] (get count hour)) tweet-count-2)) (count tweet-count-2))) (range 24))]
+  (list-plot avg-tweets-per-hour :joined true :plot-size 900))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":{"data":"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d","field":"data.y"}}],"marks":[{"type":"line","from":{"data":"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d"},"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":"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d","values":[{"x":0,"y":90.57608695652173},{"x":1,"y":62.09782608695652},{"x":2,"y":62.73913043478261},{"x":3,"y":75.03260869565217},{"x":4,"y":129.6739130434783},{"x":5,"y":250.7934782608696},{"x":6,"y":435.0652173913043},{"x":7,"y":536.2065217391304},{"x":8,"y":575.6086956521739},{"x":9,"y":599.4347826086957},{"x":10,"y":609.0652173913043},{"x":11,"y":584.3913043478261},{"x":12,"y":573.6195652173913},{"x":13,"y":556.2065217391304},{"x":14,"y":533.6304347826087},{"x":15,"y":551.6304347826087},{"x":16,"y":555.5760869565217},{"x":17,"y":529.5434782608696},{"x":18,"y":491.6413043478261},{"x":19,"y":472.5217391304348},{"x":20,"y":474.5760869565217},{"x":21,"y":399.4347826086957},{"x":22,"y":296.6086956521739},{"x":23,"y":165.7717391304348}]}],"width":900,"height":556.2422485351562,"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 \"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain {:data \"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d\", :field \"data.y\"}}], :marks [{:type \"line\", :from {:data \"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d\"}, :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 \"6a54e9e1-a322-4450-a1ca-1dd9c2f6132d\", :values ({:x 0, :y 8333/92} {:x 1, :y 5713/92} {:x 2, :y 1443/23} {:x 3, :y 6903/92} {:x 4, :y 5965/46} {:x 5, :y 23073/92} {:x 6, :y 20013/46} {:x 7, :y 49331/92} {:x 8, :y 13239/23} {:x 9, :y 13787/23} {:x 10, :y 28017/46} {:x 11, :y 13441/23} {:x 12, :y 52773/92} {:x 13, :y 51171/92} {:x 14, :y 24547/46} {:x 15, :y 25375/46} {:x 16, :y 51113/92} {:x 17, :y 24359/46} {:x 18, :y 45231/92} {:x 19, :y 10868/23} {:x 20, :y 43661/92} {:x 21, :y 9187/23} {:x 22, :y 6822/23} {:x 23, :y 15251/92})}], :width 900, :height 556.24225, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
+;; <=
+
+;; **
+;;; ## Graph Analysis
+;;; In the following section the individual graphs and subgraphs are examined. First basic metrics such as degree, depth and average connectivity are computed.
+;;;
+;;; An example of an individual tree is as follows:
+;; **
+
+;; @@
+(def some-tree (build-tree-from-source
+                 (ObjectId.
+                   (rand-nth ["53ff738fe4b09b711bdfa9c7"
+                              "53fcc425e4b09b711bdec9a9"
+                              "53fe02bbe4b09b711bdf26f2"
+                              "53f33d9ee4b0c2a12eb4a339"]))))
+
+;; @@
+;; =>
+;;; {"type":"html","content":"#'unsightly-reserve/some-tree","value":"#'unsightly-reserve/some-tree"}
+;; <=
+
+;; **
+;;; Basic Analysis has following features
+;; **
+
+;; @@
+(-> some-tree :analysis keys)
+;; @@
+;; =>
+;;; {"type":"html","content":"(:size :height :users :pub-times :hashtags :delays)","value":"(:size :height :users :pub-times :hashtags :delays)"}
+;; <=
+
+;; **
+;;; ### Basic Tree Metrics
+;; **
+
+;; @@
+(-> some-tree :analysis (dissoc :pub-times :hashtags :delays :users))
+;; @@
+;; =>
+;;; {"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":size","value":":size"},{"type":"html","content":"43","value":"43"}],"value":"[:size 43]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":height","value":":height"},{"type":"html","content":"3","value":"3"}],"value":"[:height 3]"}],"value":"{:size 43, :height 3}"}
+;; <=
+
+;; @@
+(-> some-tree :analysis keys)
+;; @@
+;; =>
+;;; {"type":"html","content":"(:size :height :users :pub-times :hashtags :delays)","value":"(:size :height :users :pub-times :hashtags :delays)"}
+;; <=
+
+;; **
+;;; ### Hashtag Distribution
+;;; Top 10 hashtags.
+;; **
+
+;; @@
+(let [hashtags (-> some-tree :analysis :hashtags)]
+  (if (empty? hashtags)
+    "No hashtags"
+    (let [h-freq (->> hashtags frequencies (sort-by second >) (take 10))]
+  [(into #{} hashtags)
+   (bar-chart (keys h-freq) (vals h-freq) :plot-size 800)])))
+;; @@
+;; =>
+;;; {"type":"list-like","open":"[","close":"]","separator":" ","items":[{"type":"list-like","open":"#{","close":"}","separator":" ","items":[{"type":"html","content":""burbach"","value":"\"burbach\""},{"type":"html","content":""m05h96"","value":"\"m05h96\""},{"type":"html","content":""ts20"","value":"\"ts20\""},{"type":"html","content":""ltwbb"","value":"\"ltwbb\""},{"type":"html","content":""ltwth"","value":"\"ltwth\""},{"type":"html","content":""sltw14"","value":"\"sltw14\""},{"type":"html","content":""essen"","value":"\"essen\""},{"type":"html","content":""tagesschau"","value":"\"tagesschau\""},{"type":"html","content":""waffensspd"","value":"\"waffensspd\""}],"value":"#{\"burbach\" \"m05h96\" \"ts20\" \"ltwbb\" \"ltwth\" \"sltw14\" \"essen\" \"tagesschau\" \"waffensspd\"}"},{"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"ordinal","range":"width","domain":{"data":"1a80d830-b7d2-4bd1-960b-c4defaba9028","field":"data.x"}},{"name":"y","range":"height","nice":true,"domain":{"data":"1a80d830-b7d2-4bd1-960b-c4defaba9028","field":"data.y"}}],"marks":[{"type":"rect","from":{"data":"1a80d830-b7d2-4bd1-960b-c4defaba9028"},"properties":{"enter":{"y":{"scale":"y","field":"data.y"},"width":{"offset":-1,"scale":"x","band":true},"x":{"scale":"x","field":"data.x"},"y2":{"scale":"y","value":0}},"update":{"fill":{"value":"steelblue"},"opacity":{"value":1}},"hover":{"fill":{"value":"#FF29D2"}}}}],"data":[{"name":"1a80d830-b7d2-4bd1-960b-c4defaba9028","values":[{"x":"ltwbb","y":9},{"x":"ltwth","y":9},{"x":"burbach","y":8},{"x":"essen","y":8},{"x":"tagesschau","y":7},{"x":"m05h96","y":3},{"x":"sltw14","y":3},{"x":"ts20","y":1},{"x":"waffensspd","y":1}]}],"width":800,"height":494.4375915527344,"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 \"ordinal\", :range \"width\", :domain {:data \"1a80d830-b7d2-4bd1-960b-c4defaba9028\", :field \"data.x\"}} {:name \"y\", :range \"height\", :nice true, :domain {:data \"1a80d830-b7d2-4bd1-960b-c4defaba9028\", :field \"data.y\"}}], :marks [{:type \"rect\", :from {:data \"1a80d830-b7d2-4bd1-960b-c4defaba9028\"}, :properties {:enter {:y {:scale \"y\", :field \"data.y\"}, :width {:offset -1, :scale \"x\", :band true}, :x {:scale \"x\", :field \"data.x\"}, :y2 {:scale \"y\", :value 0}}, :update {:fill {:value \"steelblue\"}, :opacity {:value 1}}, :hover {:fill {:value \"#FF29D2\"}}}}], :data [{:name \"1a80d830-b7d2-4bd1-960b-c4defaba9028\", :values ({:x \"ltwbb\", :y 9} {:x \"ltwth\", :y 9} {:x \"burbach\", :y 8} {:x \"essen\", :y 8} {:x \"tagesschau\", :y 7} {:x \"m05h96\", :y 3} {:x \"sltw14\", :y 3} {:x \"ts20\", :y 1} {:x \"waffensspd\", :y 1})}], :width 800, :height 494.4376, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}],"value":"[#{\"burbach\" \"m05h96\" \"ts20\" \"ltwbb\" \"ltwth\" \"sltw14\" \"essen\" \"tagesschau\" \"waffensspd\"} #gorilla_repl.vega.VegaView{:content {:axes [{:scale \"x\", :type \"x\"} {:scale \"y\", :type \"y\"}], :scales [{:name \"x\", :type \"ordinal\", :range \"width\", :domain {:data \"1a80d830-b7d2-4bd1-960b-c4defaba9028\", :field \"data.x\"}} {:name \"y\", :range \"height\", :nice true, :domain {:data \"1a80d830-b7d2-4bd1-960b-c4defaba9028\", :field \"data.y\"}}], :marks [{:type \"rect\", :from {:data \"1a80d830-b7d2-4bd1-960b-c4defaba9028\"}, :properties {:enter {:y {:scale \"y\", :field \"data.y\"}, :width {:offset -1, :scale \"x\", :band true}, :x {:scale \"x\", :field \"data.x\"}, :y2 {:scale \"y\", :value 0}}, :update {:fill {:value \"steelblue\"}, :opacity {:value 1}}, :hover {:fill {:value \"#FF29D2\"}}}}], :data [{:name \"1a80d830-b7d2-4bd1-960b-c4defaba9028\", :values ({:x \"ltwbb\", :y 9} {:x \"ltwth\", :y 9} {:x \"burbach\", :y 8} {:x \"essen\", :y 8} {:x \"tagesschau\", :y 7} {:x \"m05h96\", :y 3} {:x \"sltw14\", :y 3} {:x \"ts20\", :y 1} {:x \"waffensspd\", :y 1})}], :width 800, :height 494.4376, :padding {:bottom 20, :top 10, :right 10, :left 50}}}]"}
+;; <=
+
+;; **
+;;; ### User Post Distribution
+;;; Top 10 Users related to this article.
+;; **
+
+;; @@
+(let [users (->> some-tree :analysis :users frequencies (sort-by second >) (take 10))]
+  (bar-chart (keys users) (vals users) :plot-size 800))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"ordinal","range":"width","domain":{"data":"371497d0-02d0-42e8-9d24-56d3b8d7f44d","field":"data.x"}},{"name":"y","range":"height","nice":true,"domain":{"data":"371497d0-02d0-42e8-9d24-56d3b8d7f44d","field":"data.y"}}],"marks":[{"type":"rect","from":{"data":"371497d0-02d0-42e8-9d24-56d3b8d7f44d"},"properties":{"enter":{"y":{"scale":"y","field":"data.y"},"width":{"offset":-1,"scale":"x","band":true},"x":{"scale":"x","field":"data.x"},"y2":{"scale":"y","value":0}},"update":{"fill":{"value":"steelblue"},"opacity":{"value":1}},"hover":{"fill":{"value":"#FF29D2"}}}}],"data":[{"name":"371497d0-02d0-42e8-9d24-56d3b8d7f44d","values":[{"x":"tagesschau","y":10},{"x":"stmeyer2401","y":1},{"x":"CptLeto","y":1},{"x":"g_rantelhuber","y":1},{"x":"DerAnimenator","y":1},{"x":"mistakrass","y":1},{"x":"BukosWelt","y":1},{"x":"derMylius","y":1},{"x":"DL_schreibt","y":1},{"x":"ManorMFL","y":1}]}],"width":800,"height":494.4375915527344,"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 \"ordinal\", :range \"width\", :domain {:data \"371497d0-02d0-42e8-9d24-56d3b8d7f44d\", :field \"data.x\"}} {:name \"y\", :range \"height\", :nice true, :domain {:data \"371497d0-02d0-42e8-9d24-56d3b8d7f44d\", :field \"data.y\"}}], :marks [{:type \"rect\", :from {:data \"371497d0-02d0-42e8-9d24-56d3b8d7f44d\"}, :properties {:enter {:y {:scale \"y\", :field \"data.y\"}, :width {:offset -1, :scale \"x\", :band true}, :x {:scale \"x\", :field \"data.x\"}, :y2 {:scale \"y\", :value 0}}, :update {:fill {:value \"steelblue\"}, :opacity {:value 1}}, :hover {:fill {:value \"#FF29D2\"}}}}], :data [{:name \"371497d0-02d0-42e8-9d24-56d3b8d7f44d\", :values ({:x \"tagesschau\", :y 10} {:x \"stmeyer2401\", :y 1} {:x \"CptLeto\", :y 1} {:x \"g_rantelhuber\", :y 1} {:x \"DerAnimenator\", :y 1} {:x \"mistakrass\", :y 1} {:x \"BukosWelt\", :y 1} {:x \"derMylius\", :y 1} {:x \"DL_schreibt\", :y 1} {:x \"ManorMFL\", :y 1})}], :width 800, :height 494.4376, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
+;; <=
+
+;; **
+;;; ### Delay Distribution
+;;; Reaction's delay of an article in minutes.
+;; **
+
+;; @@
+(let [delays (->> some-tree :analysis :delays (map #(float (/ % 60))))]
+  (histogram delays :plot-size 900))
+;; @@
+;; =>
+;;; {"type":"vega","content":{"axes":[{"scale":"x","type":"x"},{"scale":"y","type":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":{"data":"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d","field":"data.y"}}],"marks":[{"type":"line","from":{"data":"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d"},"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":"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d","values":[{"x":0.0,"y":0},{"x":7002.059709821429,"y":9.0},{"x":14004.119419642859,"y":7.0},{"x":21006.17912946429,"y":4.0},{"x":28008.238839285717,"y":10.0},{"x":35010.298549107145,"y":0.0},{"x":42012.35825892857,"y":0.0},{"x":49014.41796875,"y":12.0},{"x":56016.47767857143,"y":1.0},{"x":63018.537388392855,"y":0}]}],"width":900,"height":556.2422485351562,"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 \"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain {:data \"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d\", :field \"data.y\"}}], :marks [{:type \"line\", :from {:data \"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d\"}, :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 \"4ab1a30a-7e5d-4d95-b06d-ecef26ecff6d\", :values ({:x 0.0, :y 0} {:x 7002.059709821429, :y 9.0} {:x 14004.119419642859, :y 7.0} {:x 21006.17912946429, :y 4.0} {:x 28008.238839285717, :y 10.0} {:x 35010.298549107145, :y 0.0} {:x 42012.35825892857, :y 0.0} {:x 49014.41796875, :y 12.0} {:x 56016.47767857143, :y 1.0} {:x 63018.537388392855, :y 0})}], :width 900, :height 556.24225, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
+;; <=
+
+;; @@
+
+;; @@


Add docstring & explanatory comment

Add docstring & explanatory comment

--- src/braid/search/lucene.clj
+++ src/braid/search/lucene.clj
@@ -84,7 +84,9 @@
                     [thread-id (java.util.Date. (apply max (map :created-at threads)))]))))))

 (defn import-messages!
+  "Import all existing messages into Lucene"
   []
+  ;; Need to have an index created to make a reader, so just insert a dummy record
   (index-message! {:content "hello" :group-id (java.util.UUID/randomUUID)
                    :thread-id (java.util.UUID/randomUUID) :created-at (java.util.Date.)})
   (with-open [reader (store/store-reader (store))


Starting to doc async returns, #83

Starting to doc async returns, #83

--- src/org/libraryweasel/ligature/core.clj
+++ src/org/libraryweasel/ligature/core.clj
@@ -14,10 +14,14 @@
   (collection [this collection-name]
     "Returns a collection based on the name passed.
     Calling this function will not create a new collection, it just binds a Store and Collection name.")
+  (create-collection [this collection-name]
+    "Creates a new collection or does nothing if collection already exists.
+    This function returns a future with the created collection.")
   (delete-collection [this collection-name]
-    "Deletes the collection of the name given.")
+    "Deletes the collection of the name given and does nothing if the collection doesn't exist.
+    Returns a future.")
   (all-collections [this]
-    "Returns a seq of all existing collections.")
+    "Returns a channel that outputs of all existing collections.")
   (close [this]
     "Close connection with the Store.")
   (details [this]
@@ -26,10 +30,10 @@
 (defprotocol LigatureCollection
   "Manages a collection of Statements and Rules, supports ontologies, and querying."
   (collection-name [this])
-  (compute [this f]
-    "Accepts a closure that is passed a ReadTx, executes in a read-only transaction, and returns a value.")
+  (readTx [this]
+    "Returns a future with a ReadTx.")
   (write [this f]
-    "Accepts a closure that is passed a WriteTx, executes in a read/write transaction, and returns a value."))
+    "Returns a future with a ReadTx/WriteTx."))
 ;  (sparql-query [this query]
 ;    "")
 ;  (wander-query [this query]
@@ -37,17 +41,17 @@

 (defprotocol ReadTx
   (all-statements [this]
-    "Accepts nothing but returns a seq of all Statements in the Collection.")
+    "Accepts nothing but returns a channel of all Statements in the Collection.")
   (match-statements [this pattern]
-    "")
+    "Is passed a pattern and returns a channel with all matching Statements.")
   (all-rules [this]
-    "")
+    "Accepts nothing but returns a channel of all Rules in the Collection.")
   (match-rules [this pattern]
-    ""))
+    "Is passed a pattern and returns a channel with all matching rules."))

 (defprotocol WriteTx
   (new-identifier [this]
-    "Returns a unique, new identifier in the form _:NUMBER")
+    "Returns channel with a unique, new identifier in the form _:NUMBER")
   (add-statement [this statement]
     "Accepts a statement tuple")
   (remove-statement [this statement]


Add json support for core.matrix.

Add json support for core.matrix.

--- src/cavm/views/datasets.clj
+++ src/cavm/views/datasets.clj
@@ -9,8 +9,10 @@
   (:require [noir.response :as response])
   (:require [ring.util.codec :as codec])
   (:require [clojure.edn :as edn])
-  (:require [clojure.data.json :as json])
+  (:require [cheshire.custom :as json])
   (:require [cavm.h2 :as h2])
+  (:import mikera.matrixx.Matrix)
+  (:import mikera.vectorz.impl.ArraySubVector)
   (:gen-class))

 (defpage [:get "/datasets"] []
@@ -33,11 +35,12 @@
   (let [{db :db} (ring-request)]
     (response/json (d/query db (edn/read-string query)))))

+; pretty-print query
 (defpage [:get ["/query-p/:query" :query #".+"]] {:keys [query]}
   (let [{db :db} (ring-request)]
     (response/content-type "application/json; charset=utf-8"
                            (binding [clojure.pprint/*print-right-margin* 200]
-                             (with-out-str (json/pprint (d/query db (edn/read-string query)) :escape-slash false))))))
+                             (with-out-str (json/encode (d/query db (edn/read-string query)) {:pretty true}))))))

 (defn samples-for-attr [attr]
   {:select [[:experiments.name "experiment"] :exp_samples.name]
@@ -95,6 +98,19 @@
                          {:experiment exp
                           :sample samp}) (repeat ('table %)) ('samples %)))))

+; Add a json encoder for primitive float arrays, since that's what
+; we get back from the expression engine.
+(defn encode-array
+  "Encode a primitive array to the json generator."
+  [arr jg]
+  (json/to-json (seq arr) jg))
+
+(json/add-encoder (Class/forName "[F") encode-array)
+; Mike suggests extending mikera.arrayz.INDArray to hit all
+; core.matrix types. Leaving these for now.
+(json/add-encoder mikera.vectorz.impl.ArraySubVector encode-array)
+(json/add-encoder mikera.matrixx.Matrix encode-array)
+
 (def functions
   {'fetch sources/read-symbols
    'query h2/run-query


Scroll to anchors in doc-subpage lifecycle events

--- frontend/components/documentation.cljs
+++ frontend/components/documentation.cljs
@@ -6,6 +6,7 @@
             [om.core :as om :include-macros true]
             [om.dom :as dom :include-macros true]
             [frontend.components.common :as common]
+            [frontend.controllers.navigation :as navigation]
             [frontend.state :as state]
             [frontend.utils :as utils :include-macros true]
             [frontend.utils.ajax :as ajax]
@@ -133,9 +134,13 @@
 (defn docs-subpage [doc owner]
   (reify
     om/IDidMount
-    (did-mount [_] (add-link-targets (om/get-node owner)))
+    (did-mount [_]
+      (add-link-targets (om/get-node owner))
+      (navigation/scroll-to-fragment! (-> owner om/get-state :_fragment)))
     om/IDidUpdate
-    (did-update [_ _ _] (add-link-targets (om/get-node owner)))
+    (did-update [_ _ _]
+      (add-link-targets (om/get-node owner))
+      (navigation/scroll-to-fragment! (-> owner om/get-state :_fragment)))
     om/IRender
     (render [_]
       (html
@@ -149,6 +154,7 @@

 (defrender documentation [app owner opts]
   (let [subpage (get-in app [:navigation-data :subpage])
+        fragment (get-in app [:navigation-data :_fragment])
         docs (get-in app state/docs-data-path)
         categories ((juxt :gettingstarted :languages :how-to :troubleshooting
                           :reference :parallelism :privacy-security) docs)]
@@ -165,4 +171,4 @@
          [:article
           (if-not subpage
             (om/build front-page app)
-            (om/build docs-subpage (get docs subpage)))]]]]])))
+            (om/build docs-subpage (get docs subpage) {:init-state {:_fragment fragment}}))]]]]])))


Write ports so that aerobio command can fetch them

--- src/aerobio/core.clj
+++ src/aerobio/core.clj
@@ -57,6 +57,7 @@

             [aerial.fs :as fs]
             [aerial.utils.misc :refer [getenv]]
+            [aerial.utils.io :refer [with-out-writer]]
             [aerial.utils.coll :as coll]

             [aerial.bio.utils.params :as bpams]
@@ -214,6 +215,13 @@
   (svr/start! port))

+(defn write-port-file [http-port repl-port]
+  (let [port-file (fs/join (fs/pwd) ".ports")]
+    (with-out-writer port-file
+      (print (format "{'http': '%s', 'repl': '%s'}" http-port repl-port)))))
+
+
+

 (defn nrepl-handler-hack []
   (require 'cider.nrepl)
@@ -260,6 +268,7 @@
         (if (find-set-home-dir)
           (do
             (println :http-port http-port :rpl-port rpl-port)
+            (write-port-file http-port rpl-port)
             (nrs/start-server :port rpl-port :handler nrepl-handler)
             (run-server http-port))
           (do (println "aerobio server must run in home directory")


having fun with clojure yo

having fun with clojure yo

--- src/anyviz/views.clj
+++ src/anyviz/views.clj
@@ -77,8 +77,10 @@
 (defn group [el & extras]
   [:div.form-group el extras])

-(defn ctl [el cols]
-  [:div {:class (nth bs-columns (- cols 1))} el])
+(defn ctl
+  ([el] (ctl el 4))
+  ([el col]
+    [:div {:class (nth bs-columns (- col 1))} el]))

 (defn query-builder [db coll segments]
   (html
@@ -99,29 +101,29 @@

                 (group
                   (label "Over the range" "date-period")
-                  (ctl (dropdown date-periods "date-period") 4)
+                  (ctl (dropdown date-periods "date-period"))
                   (label "Group time by" "group-times")
-                  (ctl (dropdown group-times "group-times") 4))
+                  (ctl (dropdown group-times "group-times")))

                 (group
                   (label "Match where" "match-entities")
-                  (ctl (dropdown segments "none" "match-entities") 4)
+                  (ctl (dropdown segments "none" "match-entities"))
                   (ctl (dropdown match-operators "none" "match-ops") 2)
-                  (ctl (input "value") 4))
+                  (ctl (input "value")))

                 (group
                   (label "Group results by" "group-entities")
-                  (ctl (dropdown segments "none" "group-entities") 4))
+                  (ctl (dropdown segments "none" "group-entities")))

                 (group
                   (label "Aggregate" "reduce-entities")
-                  (ctl (dropdown segments "reduce-entities") 4)
+                  (ctl (dropdown segments "reduce-entities"))
                   (label "Over the statistic" "reduce-ops")
-                  (ctl (dropdown reduce-operators "reduce-ops") 4))
+                  (ctl (dropdown reduce-operators "reduce-ops")))

                 (group
                   (label "Display results as" "graph-type")
-                  (ctl (dropdown graph-types "graph-type") 4))
+                  (ctl (dropdown graph-types "graph-type")))

                 [:div.form-group
                   [:div.col-sm-10.col-sm-offset-2


use better map->query-string

use better map->query-string

--- src/cljs/clj_money/api.cljs
+++ src/cljs/clj_money/api.cljs
@@ -5,24 +5,19 @@
             [cljs-http.client :as http]
             [clojure.walk :refer [keywordize-keys]]
             [cognitect.transit :as transit]
+            [clj-money.x-platform.util :refer [map->query-string]]
             [clj-money.util :as util]))

 (defn path
   [& segments]
   (apply util/path (concat [:api] segments)))

-(defn- map->query-string
-  [m]
-  (->> m
-       (map #(update-in % [0] name))
-       (map #(string/join "=" %))
-       (string/join "&")))
-
 (defn- append-query-string
   [path criteria]
   (if (empty? criteria)
     path
-    (str path "?" (map->query-string criteria))))
+    (let [query-string (map->query-string criteria)]
+      (str path "?" query-string))))

 (defn get-resources
   ([path success-fn error-fn]


Parameterization of the AI

Parameterization of the AI

--- src/cljs/triboard/core.cljs
+++ src/cljs/triboard/core.cljs
@@ -264,11 +264,11 @@
 (defn- worst-immediate-loss
   "Return the next worse lost game move for 'looser' if 'player' plays"
   {:pre [(player? player) (player? looser)]}
-  [game player looser]
+  [cells-strength game player looser]
   (let [converted-filter #(= looser (:looser %))
         all-moves (get-in game [:moves player])]
     (transduce
-      (map #(move-strength (:cells-strength game) converted-filter %))
+      (map #(move-strength cells-strength converted-filter %))
       max all-moves)))

 (defn best-move
@@ -276,15 +276,15 @@
    * The immediate gain
    * The worse immediate lost afterwards"
   {:pre [(player? player)]}
-  [game player]
+  [cells-strength game player]
   (let [moves (get-in game [:moves player])
         others (remove #{player} players)]
     (first
       (fast-max-key
         (fn [[m converted :as move]]
           (let [new-game (play-move game m)
-                diff-score (move-strength (:cells-strength game) identity move)
-                losses (map #(worst-immediate-loss new-game % player) others)]
+                diff-score (move-strength cells-strength identity move)
+                losses (map #(worst-immediate-loss cells-strength new-game % player) others)]
             (- diff-score (apply max losses))))
         moves))
     ))
@@ -299,9 +299,11 @@
     (with-available-moves
       {:board board
        :player (rand-nth players)
-       :cells-strength (compute-cells-strength board)
        :moves {}
        :help false
+       :ai-players
+       {:red (partial best-move (compute-cells-strength board))
+        :green (partial best-move (compute-cells-strength board))}
        :scores
        {:blue 12
         :red 12
@@ -311,15 +313,11 @@
 (def board (reagent/cursor app-state [:board]))
 (def scores (reagent/cursor app-state [:scores]))
 (def current-player (reagent/cursor app-state [:player]))
+(def ai-players (reagent/cursor app-state [:ai-players]))
 (def end-of-game (reaction (nil? @current-player)))

-(def players-ai-algorithms
-  {:red best-move
-   :green best-move})
-
-(defn is-human?
-  [player]
-  (not (contains? players-ai-algorithms player)))
+(defn is-ai? [player]
+  (contains? @ai-players player))

 ;; -----------------------------------------
@@ -327,7 +325,7 @@
 ;; -----------------------------------------

 (defn- handle-ai []
-  (let [ai-algo (get players-ai-algorithms @current-player)
+  (let [ai-algo (get @ai-players @current-player)
         move (ai-algo @app-state @current-player)]
     (swap! app-state play-move move)))

@@ -335,8 +333,8 @@
   "Manage transitions between player moves, ai moves, and generic game events"
   []
   (let [game-on-xf (fn [_] (not @end-of-game))
-        is-human-xf (fn [_] (is-human? @current-player))
-        is-ai-xf (fn [_] (not (is-human? @current-player)))
+        is-human-xf (fn [_] (not (is-ai? @current-player)))
+        is-ai-xf (fn [_] (is-ai? @current-player))
         ai-events (chan 1 (comp (filter game-on-xf) (filter is-ai-xf)))
         player-events (chan 1 (comp (filter game-on-xf) (filter is-human-xf)))
         game-events (chan 1)]


replace upmap with pmap

replace upmap with pmap

--- src/atom_finder/util/30_fs_util.clj
+++ src/atom_finder/util/30_fs_util.clj
@@ -67,11 +67,13 @@

 ;; Should we use claypoole.lazy instead?
 ;; https://github.com/TheClimateCorporation/claypoole#lazy
-(require '[com.climate.claypoole :as cp])
+;; (require '[com.climate.claypoole :as cp])
+;; Since the claypoole functions require the entire datastructure fit in memory
+;; we default to pmap
 (s/defn pmap-dir-c-files
   "Apply a function to the filename of every c file in a directory"
   [f dirname]
-  (cp/upmap :builtin
+  (pmap
    (fn [file]
      (let [filename (.getPath file)]
        (log-err (format "pmap-dir-file: \"%s\"" filename) nil


move (def model) to end of file

move (def model) to end of file

--- src/babel/latin.cljc
+++ src/babel/latin.cljc
@@ -28,10 +28,6 @@

 (declare generate)

-(def model {:lexicon lexicon
-            :fo fo
-            :generate-fn generate})
-
 (def tenses
   [{:tense :present}
    {:tense :past
@@ -59,8 +55,6 @@
    {:synsem {:sem {:subj {:pred (first (shuffle subjects))}}}}
    {:synsem {:sem {:pred (first (shuffle preds))}}}))

-
-
-
-
-
+(def model {:lexicon lexicon
+            :fo fo
+            :generate-fn generate})


whitespace

whitespace

--- src/babel/parse.cljc
+++ src/babel/parse.cljc
@@ -69,28 +69,38 @@
              (reduce (fn [x y]
                        (merge-with concat x y))
                      (pmap (fn [span-pair]
+
                              ;; create a new key/value pair: [i,j] => parses,
                              ;; where each parse in parses matches the tokens from [i,j] in the input.
-                             {[(first (first span-pair))
+                             {
+
+                              ;; <key>
+                              [(first (first span-pair))
                                (second (second span-pair))]
+                              ;; </key>
+
+                              ;; <value>
                               (let [left (get minus-1 (first span-pair))
                                     right (get minus-1 (second span-pair))
-                                    left-strings (set (filter string? left))
-                                    right-strings (set (filter string? right))
+                                    left-strings (filter string? left)
+                                    right-strings (filter string? right)
                                     left-lexemes (mapcat (:lookup model)
                                                          left-strings)
                                     right-lexemes (mapcat (:lookup model)
                                                           right-strings)
-                                    left-signs (concat left-lexemes (filter map? left))
-                                    right-signs (concat right-lexemes (filter map? right))]
-                                (concat
+                                    left-signs (lazy-cat left-lexemes (filter map? left))
+                                    right-signs (lazy-cat right-lexemes (filter map? right))]
+                                (lazy-cat
                                  (if (and (not (empty? left-signs))
                                           (not (empty? right-signs)))
                                    (over (:grammar model) left-signs right-signs))

                                  ;; TODO: explain why we can use (first) here for the left- and right-strings.
                                  ;; Throw an exception if (> 1 (count left-strings)) or (> 1 (count right-strings))
-                                 [(string/join " " [(first left-strings) (first right-strings)])]))})
+                                 [(string/join " " [(first left-strings) (first right-strings)])]))
+                              ;; </value>
+                              })
+
                            (get span-map n)))))))

 (defn parse [input model]


fix call to babel.latin/read-one

fix call to babel.latin/read-one

--- src/babel/reader.clj
+++ src/babel/reader.clj
@@ -94,7 +94,9 @@
   (let [target-spec (unify target-spec
                            {:synsem {:subcat '()}})]
     (cond (= target-language "la")
-          (babel.latin/read-one :top ((-> models :la))) ;; TODO: use target-spec
+          (babel.latin/read-one :top  ;; TODO: use target-spec
+                                @((-> models :la))
+                                @((-> models :en)))
           true
           (let [;; normalize for JSON lookup: convert a spec which is simply :top to be {}.
                 json-input-spec (if (= :top target-spec)


Remove dead validation code

Remove dead validation code

--- src/clj/comic_reader/macro_util.clj
+++ src/clj/comic_reader/macro_util.clj
@@ -8,13 +8,6 @@
      (if content#
        (conj root# content#)
        root#)))
-
-(defn symbol-spec? [subscription-spec]
-  (symbol? subscription-spec))
-
-(defn vector-spec? [subscription-spec]
-  (and (vector? subscription-spec)
-       (= 2 (count subscription-spec))))

 (defmulti valid-spec?
   "Validate whether this subscription spec is valid."