Skip to content

Commit 03aae5a

Browse files
author
xuwenyihust
committed
Some updates.
1 parent 969286c commit 03aae5a

File tree

4 files changed

+106
-3
lines changed

4 files changed

+106
-3
lines changed

web/static/count.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Counts Chart
44
//
55
var count_margin = {top: 20, right: 100, bottom: 70, left: 60},
6-
count_width = 1000 - count_margin.left - count_margin.right,
6+
count_width = 800 - count_margin.left - count_margin.right,
77
count_height = 300 - count_margin.top - count_margin.bottom;
88

99
// set the ranges

web/static/total.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//////////////////////////////////////////////////////////////////
2+
//
3+
//
4+
//
5+
var total = d3.select("#total").append("svg")
6+
.attr("height", 120)
7+
.append("g")
8+
.attr("transform",
9+
"translate(" + 40 + "," + 70 + ")");
10+
11+
var t = 0
12+
// load the data
13+
d3.json("/data/counts", function(error, data) {
14+
data.forEach(function(d) {
15+
t += d.Count;
16+
});
17+
18+
total.append("text")
19+
.text(t)
20+
.style("font-size","50px");
21+
22+
});
23+
24+
25+
26+
27+
28+
29+

web/static/track.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//////////////////////////////////////////////////////////////////
2+
//
3+
//
4+
//
5+
var track = d3.select("#track").append("svg")
6+
.attr("height", 120)
7+
.append("g")
8+
.attr("transform",
9+
"translate(" + 40 + "," + 70 + ")");
10+
11+
track.append("text")
12+
.text("#overwatch")
13+
.style("font-size","50px");
14+
15+
// load the data
16+
//d3.json("../../conf/parameters.json", function(error, data) {
17+
// data.forEach(function(d) {
18+
// d.hashtag = d.hashtag;
19+
// });
20+
21+
//track.text(d.hashtag)
22+
// track.text("#overwatch");
23+
24+
//});
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+

web/templates/dashboard.html

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
padding: 5px 10px;
5656
position: relative;
5757
}
58+
.chart_wrapper .text_stage {
59+
font: 20px;
60+
padding: 5px 10px;
61+
position: relative;
62+
}
63+
5864
</style>
5965
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
6066
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
@@ -74,16 +80,41 @@
7480

7581

7682
<div class="row">
77-
<div class="col-sm-12">
83+
84+
<div class="col-sm-8">
7885
<div class="chart_wrapper">
7986
<div class="chart_title">
80-
Tweet Counts Timeline
87+
Tweet Counts Timeline
8188
</div>
8289
<div class="chart_stage" id="count">
8390
<script src="static/count.js"></script>
8491
</div>
8592
</div>
8693
</div>
94+
95+
<div class="col-sm-4">
96+
<div class="chart_wrapper">
97+
<div class="chart_title">
98+
Total Number of Tracked Tweets
99+
</div>
100+
<div class="chart_stage" id="total">
101+
<script src="static/total.js"></script>
102+
</div>
103+
</div>
104+
</div>
105+
106+
<div class="col-sm-4">
107+
<div class="chart_wrapper">
108+
<div class="chart_title">
109+
Tracked Hashtag
110+
</div>
111+
<div class="text_stage" id="track">
112+
<script src="static/track.js"></script>
113+
</div>
114+
</div>
115+
</div>
116+
117+
87118
</div>
88119

89120
<div class="row">

0 commit comments

Comments
 (0)