浏览代码

templating sorted out in flask

Schultz 8 年前
父节点
当前提交
3ac4b1f97a
共有 4 个文件被更改,包括 243 次插入163 次删除
  1. 43
    2
      FlaskTest/app.py
  2. 147
    138
      FlaskTest/static/js/script.js
  3. 41
    6
      FlaskTest/templates/base.html
  4. 12
    17
      FlaskTest/templates/dashboard.html

+ 43
- 2
FlaskTest/app.py 查看文件

@@ -3,8 +3,49 @@ app = Flask (__name__)
3 3
 
4 4
 @app.route("/dashboard")
5 5
 def dashboard():
6
-    return render_template("dashboard.html")
6
+
7
+	data= {
8
+		"main_repo_name" : "Main Project Name",
9
+		"main_repo_summary" : "Summary: This project is about making Zebra really fast and efficient",
10
+		"main_repo_description" : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
11
+		"heatmap" : {
12
+			"divID" : "heatmap",
13
+			"title" : "Commits by Hour of Week - dummy data",
14
+			"data_path1" : "../static/data/data_dummy.tsv",
15
+			"data_path2" : "../static/data/data2_dummy.tsv",
16
+			"summary" : "This data shows cool stuff",
17
+			"description" : "As you van see, this data focuses on business hours",
18
+			"timestamp" : "System last updated at 11:34am"
19
+		},
20
+		"barchart" : {
21
+			"divID" : "day_of_week",
22
+			"title" : "# Commits by day - real data",
23
+			"data_path" : "../static/data/day_of_week_copy.tsv",
24
+			"summary" : "Bar Chart",
25
+			"description" : "What week is this from? Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
26
+			"timestamp" : "System last updated at 11:34am"
27
+		},
28
+		"linegraph1" : {
29
+			"divID" : "lineChart1",
30
+			"title" : "Commits per Author - real data",
31
+			"data_path" : "../static/data/commits_by_author_copy.tsv",
32
+			"summary" : "Multi Series Line Chart",
33
+			"description" : "Theres a few authors on this project but 1 stands out",
34
+			"timestamp" : "System last updated at 11:34am"
35
+		},
36
+		"linegraph2" : {
37
+			"divID" : "lineChart2",
38
+			"title" : "Commits per Author - real data",
39
+			"data_path" : "../static/data/lines_of_code_by_author_copy.tsv",
40
+			"summary" : "Multi Series Line Chart",
41
+			"description" : "Theres a few authors on this project but 1 stands out",
42
+			"timestamp" : "System last updated at 11:34am"
43
+		}
44
+	}
45
+	return render_template("dashboard.html", data=data )
46
+
47
+
7 48
 
8 49
 if __name__ == "__main__":
9
-    app.run()
50
+	app.run()
10 51
 

+ 147
- 138
FlaskTest/static/js/script.js 查看文件

@@ -4,156 +4,161 @@ $("#leftside-navigation .sub-menu > a").click(function(e) {
4 4
   e.stopPropagation()
5 5
 });
6 6
 
7
-
8
-// heatmap SVG
9
-const margin = { top: 50, right: 0, bottom: 100, left: 30 },
10
-  width =520 - margin.left - margin.right,
11
-  height = 320 - margin.top - margin.bottom,
12
-  gridSize = Math.floor(width / 24),
13
-  legendElementWidth = gridSize*2,
14
-  buckets = 9,
15
-
16
-  // blue colors
17
-  // colors = ["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"], // alternatively colorbrewer.YlGnBu[9]
18
-  
19
-  // orange colors
20
-  // colors = ['#fff5eb','#fee6ce','#fdd0a2','#fdae6b','#fd8d3c','#f16913','#d94801','#a63603','#7f2704'],
21
-
22
-  // yellow colors
23
-  colors =["#ECE622","#D5CF22","#BEB922","#A7A222","#908C22","#797522","#625F22","#625F22","#4B4822","#343222"],
24
-
25
-  days = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
26
-  times = ["1a", "2a", "3a", "4a", "5a", "6a", "7a", "8a", "9a", "10a", "11a", "12a", "1p", "2p", "3p", "4p", "5p", "6p", "7p", "8p", "9p", "10p", "11p", "12p"];
27
-  datasets = ["../static/data/data_dummy.tsv", "../static/data/data2_dummy.tsv"];
28
-
29
-const svg = d3.select("#chart").append("svg")
30
-  .attr("width", width + margin.left + margin.right)
31
-  .attr("height", height + margin.top + margin.bottom)
32
-  .append("g")
33
-  .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
34
-
35
-
36
-const dayLabels = svg.selectAll(".dayLabel")
37
-  .data(days)
38
-  .enter().append("text")
39
-    .text(function (d) { return d; })
40
-    .attr("x", 0)
41
-    .attr("y", (d, i) => i * gridSize)
42
-    .style("text-anchor", "end")
43
-    .attr("transform", "translate(-6," + gridSize / 1.5 + ")")
44
-    .attr("class", (d, i) => ((i >= 0 && i <= 4) ? "dayLabel mono axis axis-workweek" : "dayLabel mono axis"));
45
-
46
-const timeLabels = svg.selectAll(".timeLabel")
47
-  .data(times)
48
-  .enter().append("text") 
49
-    .text((d) => d)
50
-    .attr("x", (d, i) => i * gridSize)
51
-    .attr("y", 0)
52
-    .style("text-anchor", "middle")
53
-    .attr("transform", "translate(" + gridSize / 2 + ", -6)")
54
-    .attr("class", (d, i) => ((i >= 7 && i <= 16) ? "timeLabel mono axis axis-worktime" : "timeLabel mono axis"));
55
-
56
-const type = (d) => {
57
-  return {
58
-    day: +d.day,
59
-    hour: +d.hour,
60
-    value: +d.value
7
+// generateHeatMap(["../static/data/data_dummy.tsv", "../static/data/data2_dummy.tsv"], "#chart");
8
+
9
+function generateHeatMap(datasets, divID){
10
+  // heatmap SVG
11
+  const margin = { top: 50, right: 0, bottom: 100, left: 30 },
12
+    width =520 - margin.left - margin.right,
13
+    height = 320 - margin.top - margin.bottom,
14
+    gridSize = Math.floor(width / 24),
15
+    legendElementWidth = gridSize*2,
16
+    buckets = 9,
17
+
18
+    // blue colors
19
+    // colors = ["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"], // alternatively colorbrewer.YlGnBu[9]
20
+    
21
+    // orange colors
22
+    // colors = ['#fff5eb','#fee6ce','#fdd0a2','#fdae6b','#fd8d3c','#f16913','#d94801','#a63603','#7f2704'],
23
+
24
+    // yellow colors
25
+    colors =["#ECE622","#D5CF22","#BEB922","#A7A222","#908C22","#797522","#625F22","#625F22","#4B4822","#343222"],
26
+
27
+    days = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
28
+    times = ["1a", "2a", "3a", "4a", "5a", "6a", "7a", "8a", "9a", "10a", "11a", "12a", "1p", "2p", "3p", "4p", "5p", "6p", "7p", "8p", "9p", "10p", "11p", "12p"];
29
+    
30
+    // datasets = ["../static/data/data_dummy.tsv", "../static/data/data2_dummy.tsv"];
31
+
32
+  const svg = d3.select(divID).append("svg")
33
+    .attr("width", width + margin.left + margin.right)
34
+    .attr("height", height + margin.top + margin.bottom)
35
+    .append("g")
36
+    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
37
+
38
+
39
+  const dayLabels = svg.selectAll(".dayLabel")
40
+    .data(days)
41
+    .enter().append("text")
42
+      .text(function (d) { return d; })
43
+      .attr("x", 0)
44
+      .attr("y", (d, i) => i * gridSize)
45
+      .style("text-anchor", "end")
46
+      .attr("transform", "translate(-6," + gridSize / 1.5 + ")")
47
+      .attr("class", (d, i) => ((i >= 0 && i <= 4) ? "dayLabel mono axis axis-workweek" : "dayLabel mono axis"));
48
+
49
+  const timeLabels = svg.selectAll(".timeLabel")
50
+    .data(times)
51
+    .enter().append("text") 
52
+      .text((d) => d)
53
+      .attr("x", (d, i) => i * gridSize)
54
+      .attr("y", 0)
55
+      .style("text-anchor", "middle")
56
+      .attr("transform", "translate(" + gridSize / 2 + ", -6)")
57
+      .attr("class", (d, i) => ((i >= 7 && i <= 16) ? "timeLabel mono axis axis-worktime" : "timeLabel mono axis"));
58
+
59
+  const type = (d) => {
60
+    return {
61
+      day: +d.day,
62
+      hour: +d.hour,
63
+      value: +d.value
64
+    };
61 65
   };
62
-};
63
-
64
-const heatmapChart = function(tsvFile) {
65
-d3.tsv(tsvFile, type, (error, data) => {
66
-
67
-  var div = d3.select("body").append("div")
68
-    .attr("class", "tooltip")
69
-    .style("opacity", 0);
70
-
71
-  const colorScale = d3.scaleQuantile()
72
-    .domain([0, buckets - 1, d3.max(data, (d) => d.value)])
73
-    .range(colors);
74
-
75
-  const cards = svg.selectAll(".hour")
76
-    .data(data, (d) => d.day+':'+d.hour);
77
-
78
-  cards.append("title");
79
-
80
-  cards.enter().append("rect")
81
-  .attr("x", (d) => (d.hour - 1) * gridSize)
82
-  .attr("y", (d) => (d.day - 1) * gridSize)
83
-  .attr("rx", 4)
84
-  .attr("ry", 4)  
85
-  .attr("class", "hour bordered")
86
-  .attr("width", gridSize)
87
-  .attr("height", gridSize)
88
-  .style("fill", colors[0])
89
-  .on("mouseover", function(d) {
90
-    div.transition()
91
-      .duration(200)
92
-      .style("opacity", .9);
93
-    div.html("Day: " +days[d.day-1]+ "<br>Hour: " +times[d.hour-1]+ "<br>Commits: " +d.value+ "")
94
-      .style("left", (d3.event.pageX + 20) + "px")
95
-      .style("top", (d3.event.pageY - 20) + "px");
96
-    })
97
-  .on("mouseout", function(d) {
98
-    div.transition()
99
-      .duration(500)
100
-      .style("opacity", 0);
101
-    })
102
-  .merge(cards)
103
-    .transition()
104
-    .duration(1000)
105
-    .style("fill", (d) => colorScale(d.value));
106
-
107
-  // cards.select("title").text((d) => d.value);  
108 66
 
109
-  cards.exit().remove();
67
+  const heatmapChart = function(tsvFile) {
68
+  d3.tsv(tsvFile, type, (error, data) => {
110 69
 
111
-  const legend = svg.selectAll(".legend")
112
-    .data([0].concat(colorScale.quantiles()), (d) => d);
113
-
114
-  const legend_g = legend.enter().append("g")
115
-    .attr("class", "legend");
116
-
117
-  legend_g.append("rect")
118
-    .attr("x", (d, i) => legendElementWidth * i)
119
-    .attr("y", height)
120
-    .attr("width", legendElementWidth)
121
-    .attr("height", gridSize / 2)
122
-    .style("fill", (d, i) => colors[i]);
70
+    var div = d3.select("body").append("div")
71
+      .attr("class", "tooltip")
72
+      .style("opacity", 0);
123 73
 
124
-  legend_g.append("text")
125
-    .attr("class", "mono")
126
-    .text((d) => "≥ " + Math.round(d))
127
-    .attr("x", (d, i) => legendElementWidth * i)
128
-    .attr("y", height + gridSize);
74
+    const colorScale = d3.scaleQuantile()
75
+      .domain([0, buckets - 1, d3.max(data, (d) => d.value)])
76
+      .range(colors);
77
+
78
+    const cards = svg.selectAll(".hour")
79
+      .data(data, (d) => d.day+':'+d.hour);
80
+
81
+    cards.append("title");
82
+
83
+    cards.enter().append("rect")
84
+    .attr("x", (d) => (d.hour - 1) * gridSize)
85
+    .attr("y", (d) => (d.day - 1) * gridSize)
86
+    .attr("rx", 4)
87
+    .attr("ry", 4)  
88
+    .attr("class", "hour bordered")
89
+    .attr("width", gridSize)
90
+    .attr("height", gridSize)
91
+    .style("fill", colors[0])
92
+    .on("mouseover", function(d) {
93
+      div.transition()
94
+        .duration(200)
95
+        .style("opacity", .9);
96
+      div.html("Day: " +days[d.day-1]+ "<br>Hour: " +times[d.hour-1]+ "<br>Commits: " +d.value+ "")
97
+        .style("left", (d3.event.pageX + 20) + "px")
98
+        .style("top", (d3.event.pageY - 20) + "px");
99
+      })
100
+    .on("mouseout", function(d) {
101
+      div.transition()
102
+        .duration(500)
103
+        .style("opacity", 0);
104
+      })
105
+    .merge(cards)
106
+      .transition()
107
+      .duration(1000)
108
+      .style("fill", (d) => colorScale(d.value));
109
+
110
+    // cards.select("title").text((d) => d.value);  
111
+
112
+    cards.exit().remove();
113
+
114
+    const legend = svg.selectAll(".legend")
115
+      .data([0].concat(colorScale.quantiles()), (d) => d);
116
+
117
+    const legend_g = legend.enter().append("g")
118
+      .attr("class", "legend");
119
+
120
+    legend_g.append("rect")
121
+      .attr("x", (d, i) => legendElementWidth * i)
122
+      .attr("y", height)
123
+      .attr("width", legendElementWidth)
124
+      .attr("height", gridSize / 2)
125
+      .style("fill", (d, i) => colors[i]);
126
+
127
+    legend_g.append("text")
128
+      .attr("class", "mono")
129
+      .text((d) => "≥ " + Math.round(d))
130
+      .attr("x", (d, i) => legendElementWidth * i)
131
+      .attr("y", height + gridSize);
132
+
133
+    legend.exit().remove();
134
+  });
135
+  };
129 136
 
130
-  legend.exit().remove();
131
-});
132
-};
137
+  // use first dataset by default
138
+  heatmapChart(datasets[0]);
133 139
 
134
-// use first dataset by default
135
-heatmapChart(datasets[0]);
140
+  // dataset buttons
141
+  const datasetpicker = d3.select("#dataset-picker")
142
+    .selectAll(".btn btn-primary")
143
+    .data(datasets);
136 144
 
137
-// dataset buttons
138
-const datasetpicker = d3.select("#dataset-picker")
139
-  .selectAll(".btn btn-primary")
140
-  .data(datasets);
145
+  // dataset picking button
146
+  datasetpicker.enter()
147
+    .append("input")
148
+    .attr("value", (d) => "Dataset " + d)
149
+    .attr("type", "button")
150
+    .attr("class", "btn-sm btn-primary")
151
+    .on("click", (d) => heatmapChart(d));
141 152
 
142
-// dataset picking button
143
-datasetpicker.enter()
144
-  .append("input")
145
-  .attr("value", (d) => "Dataset " + d)
146
-  .attr("type", "button")
147
-  .attr("class", "btn-sm btn-primary")
148
-  .on("click", (d) => heatmapChart(d));
149 153
 
154
+}
150 155
 
151 156
 
152 157
 
153 158
 
154 159
 
155 160
 
156
-generateBarChart("../static/data/day_of_week_copy.tsv", "#day_of_week");
161
+// generateBarChart("../static/data/day_of_week_copy.tsv", "#day_of_week");
157 162
 
158 163
 function generateBarChart (pathToTSV,divID){
159 164
   // Bar chart, see function 'main' for main execution wheel
@@ -173,6 +178,7 @@ function generateBarChart (pathToTSV,divID){
173 178
       var svg = d3.select(divID).append("svg")
174 179
       var axisLayer = svg.append("g").classed("axisLayer", true)
175 180
       var chartLayer = svg.append("g").classed("chartLayer", true)
181
+      var margin = {top:50, right:0, bottom:100,  left:30}
176 182
       
177 183
       var xScale = d3.scaleBand()
178 184
       var yScale = d3.scaleLinear()
@@ -189,7 +195,6 @@ function generateBarChart (pathToTSV,divID){
189 195
       
190 196
       function setSize() {
191 197
 
192
-          var margin = {top:50, right:0, bottom:100,  left:30}
193 198
           chartWidth = width - margin.left - margin.right,
194 199
           chartHeight = height - margin.top - margin.bottom,        
195 200
           
@@ -291,8 +296,12 @@ function generateBarChart (pathToTSV,divID){
291 296
 
292 297
 } //end of generateBarChart
293 298
 
294
-generateLineChart("../static/data/commits_by_author_copy.tsv", "#lineChart");
295
-generateLineChart("../static/data/lines_of_code_by_author_copy.tsv", "#lineChart2");
299
+// generateLineChart("../static/data/commits_by_author_copy.tsv", "#lineChart");
300
+// generateLineChart("../static/data/lines_of_code_by_author_copy.tsv", "#lineChart2");
301
+
302
+
303
+
304
+
296 305
 
297 306
 function generateLineChart(pathToTSV, divID){
298 307
 

+ 41
- 6
FlaskTest/templates/base.html 查看文件

@@ -5,6 +5,16 @@
5 5
      <link rel="stylesheet" href="../static/css/style.css">
6 6
      
7 7
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
8 18
   </head>
9 19
   <body class="bg-faded">
10 20
 
@@ -13,7 +23,7 @@
13 23
 	<nav class="navbar black sticky-top">
14 24
 	  <a class="navbar-brand nav_text" href="#" style="color: white">
15 25
 	    <img src="../static/img/zebra_white.png" alt="Zebra Logo" class="zebra_img" class="d-inline-block align-top">
16
-	    EMC Engineering Tools &amp; Process News Letter
26
+	    EMC Engineering Code Statistics
17 27
 	  </a>
18 28
 	</nav>
19 29
 
@@ -26,13 +36,13 @@
26 36
 	      </li>
27 37
 
28 38
 	      <li class="sub-menu">
29
-	        <a href="javascript:void(0);"><i class="fa fa-cogs"></i><span>Projects</span><i class="arrow fa fa-angle-right pull-right"></i></a>
39
+	        <a href="javascript:void(0);"><i class="fa fa-cogs"></i><span>Sub-Repos</span><i class="arrow fa fa-angle-right pull-right"></i></a>
30 40
 	        <ul>
31
-	          <li><a href="#">Shim's cool project</a>
41
+	          <li><a href="#">Mini Repo 1</a>
32 42
 	          </li>
33
-	          <li><a href="#">Tony's cool project</a>  
43
+	          <li><a href="#">Mini Repo 2</a>  
34 44
 	          </li>
35
-	          <li><a href="#">Greg's intern project</a>
45
+	          <li><a href="#">Mini Repo 3</a>
36 46
 	          </li>
37 47
 	        </ul>
38 48
 	      </li>
@@ -53,7 +63,6 @@
53 63
 
54 64
   	{% block content %}{% endblock %}
55 65
 
56
-
57 66
     <!-- bootstrap -->
58 67
     <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
59 68
     <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
@@ -67,5 +76,31 @@
67 76
     <script src="http://d3js.org/d3.v4.js"></script>
68 77
     <script src="../static/js/script.js" type="text/javascript"></script>
69 78
 
79
+    <script type="text/javascript">
80
+
81
+ //    generateHeatMap(["../static/data/data_dummy.tsv", "../static/data/data2_dummy.tsv"], "#chart");
82
+ //    generateBarChart("../static/data/day_of_week_copy.tsv", "#day_of_week");
83
+
84
+ //    generateLineChart("../static/data/commits_by_author_copy.tsv", "#lineChart");
85
+	// generateLineChart("../static/data/lines_of_code_by_author_copy.tsv", "#lineChart2");
86
+
87
+	generateHeatMap(['{{data.heatmap.data_path1}}', '{{data.heatmap.data_path2}}'], "#{{data.heatmap.divID}}");
88
+	
89
+    generateBarChart('{{data.barchart.data_path}}', "#{{data.barchart.divID}}");
90
+
91
+    generateLineChart('{{data.linegraph1.data_path}}', "#{{data.linegraph1.divID}}");
92
+	generateLineChart('{{data.linegraph2.data_path}}', "#{{data.linegraph2.divID}}");
93
+
94
+
95
+
96
+
97
+
98
+     </script>
99
+
100
+
101
+
102
+
103
+    
104
+
70 105
   </body>
71 106
 </html>

+ 12
- 17
FlaskTest/templates/dashboard.html 查看文件

@@ -2,35 +2,30 @@
2 2
 
3 3
 {% block content %}
4 4
 
5
+
5 6
 <!-- Main Dashboard -->
6 7
 <!-- Summary -->
7 8
 <div class="main_dash">
8 9
   <div class="container-fluid">
9 10
     <div class="card drop-shadow">
10 11
       <div class="card-block">
11
-        <h1> Cool Project Name Here </h1>
12
+        <h1> {{data.main_repo_name}} </h1>
12 13
         <br>
13
-        <h6> Summary: This project is about making Zebra really fast and efficient </h6>
14
+        <h6> {{data.main_repo_summary}} </h6>
14 15
         <br>
15
-       Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
16
-       tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
17
-       quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
18
-       consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
19
-       cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
20
-       proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
21
-        </p>
16
+        <p> {{data.main_repo_description}}</p>
22 17
       </div>
23 18
     </div>
24 19
 
25 20
     <div class="row top_spacer">
26 21
 
27
-      <!-- Metric 1, half screen-->
22
+      <!-- Metric 1, half screen, heatmap-->
28 23
       <div class="col-md-6">
29 24
         <div class="card drop-shadow">
30 25
           <div class="card-block">
31 26
             <h4 class="card-title">Commits by Hour of Week-dummy data </h4>
32 27
             <div class="metric">
33
-              <div id="chart"></div>
28
+              <div id="{{data.heatmap.divID}}"></div>
34 29
               <div id="dataset-picker"></div>
35 30
             </div>
36 31
             <div class="details_spacer">
@@ -44,14 +39,14 @@
44 39
         </div>
45 40
       </div>
46 41
 
47
-      <!-- Metric 2, half screen-->
42
+      <!-- Metric 2, half screen, bar chart-->
48 43
       <div class="col-md-6">
49 44
         <div class="card drop-shadow">
50 45
           <div class="card-block">
51 46
             <h4 class="card-title"># Commits by day - real data </h4>
52 47
             <div class="metric">
53 48
 
54
-              <div id="day_of_week"></div>
49
+              <div id="{{data.barchart.divID}}"></div>
55 50
 
56 51
             </div>
57 52
             <div class="details_spacer">
@@ -72,7 +67,7 @@
72 67
 
73 68
     </div> 
74 69
 
75
-    <!-- Metric 3, full width -->
70
+    <!-- Metric 3, full width, line chart -->
76 71
     <div class="row top_spacer">
77 72
 
78 73
       <div class="col-md-12">
@@ -81,7 +76,7 @@
81 76
             <h4 class="card-title">Commits per Author - real data</h4>
82 77
             <div class="metric">
83 78
 
84
-              <div id ="lineChart"></div>
79
+              <div id ="{{data.linegraph1.divID}}"></div>
85 80
               
86 81
             </div>
87 82
             <div class="details_spacer">
@@ -97,7 +92,7 @@
97 92
 
98 93
     </div>
99 94
 
100
-    <!-- Another test metric -->
95
+    <!-- Another test metric, line chart -->
101 96
     <div class="row top_spacer">
102 97
 
103 98
       <div class="col-md-12">
@@ -106,7 +101,7 @@
106 101
             <h4 class="card-title">Cumulative Added Lines by Author - real data</h4>
107 102
             <div class="metric">
108 103
 
109
-              <div id ="lineChart2"></div>
104
+              <div id ="{{data.linegraph2.divID}}"></div>
110 105
 
111 106
             </div>
112 107
             <div class="details_spacer">