File tree 4 files changed +7
-6
lines changed
Clojure-Websockets/MainApp
4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 10
10
[org.clojure/tools.namespace " 0.2.7" ]
11
11
[ch.qos.logback/logback-classic " 1.1.1" ]
12
12
[com.taoensso/sente " 1.2.0" :exclusions [org.clojure/clojure com.taoensso/encore]]
13
- [org.clojure/core.match " 0.2.1 " ]
13
+ [org.clojure/core.match " 0.3.0-alpha3 " ]
14
14
[http-kit " 2.1.19" ]
15
15
[compojure " 1.2.1" ]
16
16
[ring " 1.3.1" ]
Original file line number Diff line number Diff line change 2
2
(:require [birdwatch.util :as util]
3
3
[birdwatch.stats.regression :as reg]
4
4
[birdwatch.charts.shapes :as s]
5
+ [birdwatch.state :as state]
5
6
[reagent.core :as r :refer [atom]]))
6
7
7
8
(enable-console-print! )
19
20
(defn bar [text cnt y h w idx]
20
21
(let [pos-slope (get @pos-trends text)
21
22
ratio-slope (get @ratio-trends text)]
22
- [:g
23
+ [:g { :on-click #( state/append-search-text text)}
23
24
[:text {:y (+ y 8 ) :x 138 :stroke " none" :fill " black" :dy " .35em" :textAnchor " end" } text]
24
25
[s/arrow 146 y (cond (pos? pos-slope) :UP (neg? pos-slope ) :DOWN :else :RIGHT )]
25
26
[s/arrow 160 y (cond (pos? ratio-slope) :RIGHT-UP (neg? ratio-slope ) :RIGHT-DOWN :else :RIGHT )]
Original file line number Diff line number Diff line change 18
18
; ;; Reagent components for the application are initialized here.
19
19
(ui/init-views )
20
20
21
- (defn ^:export append-search-text [s]
22
- (swap! state/app assoc :search-text (str (:search-text @state/app) " " s)))
23
-
24
21
; ;; WordCloud element (implemented externally in JavaScript)
25
22
(def cloud-elem (.getElementById js/document " wordCloud" ))
26
23
(def cloud-w (aget cloud-elem " offsetWidth" ))
27
- (def word-cloud (.WordCloud js/BirdWatch cloud-w (* cloud-w 0.7 ) 250 append-search-text " #wordCloud" ))
24
+ (def word-cloud (.WordCloud js/BirdWatch cloud-w (* cloud-w 0.7 ) 250 state/ append-search-text " #wordCloud" ))
28
25
29
26
; update the cheap charts every second
30
27
(go-loop [] (<! (timeout 1000 ))
Original file line number Diff line number Diff line change 39
39
(let [ttc (<! c/total-tweets-count-chan)]
40
40
(swap! app assoc :total-tweet-count ttc)
41
41
(recur )))
42
+
43
+ (defn append-search-text [s]
44
+ (swap! app assoc :search-text (str (:search-text @app) " " s)))
You can’t perform that action at this time.
0 commit comments