Skip to content

Commit 0a550c4

Browse files
committed
remove extra comments and console.log statements.
1 parent c7d1707 commit 0a550c4

File tree

8 files changed

+42
-108
lines changed

8 files changed

+42
-108
lines changed

index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,17 @@
156156
font: 10px sans-serif;
157157
}
158158

159-
/*TODO: .axisTitle was there a typo? how are the axes titled?*/
160159
.axisTitle {
161160
font: 14px serif;
162161
}
163-
/*TODO: .Title was there a typo? how are the axes titled?*/
164162
.Title {
165163
font: 20px serif;
166164
}
167-
/*TODO: .subTitle was there a typo? how are the axes titled?*/
168165
.subTitle {
169166
font: 12px serif;
170167
}
171168

172169
path {
173-
/* I need a way to set a default that can be overridden by D3 .attr("stroke", color)
174-
stroke: black;
175-
*/
176170
fill: none;
177171
stroke-width: 2;
178172
}

src/graph-flowduration.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Created by Marty on 3/12/2017.
33
*/
44
function flowduration(id) {
5-
console.log("flowduration");
5+
//console.log("flowduration");
66
var data = chooseData(id);
77
//If there is no data for a site, keep the previous graph alive & do nothing.
88
if(!data) return;
@@ -17,7 +17,6 @@ function flowduration(id) {
1717
data.sort(function(a, b) {
1818
return a[1] < b[1] ? 1 : a[1] > b[1] ? -1 : 0;
1919
});
20-
//console.log(data);
2120

2221
var margin = {
2322
top : 10,
@@ -37,8 +36,6 @@ function flowduration(id) {
3736
var yAxis = d3.svg.axis().scale(yScale).orient("left");
3837

3938
var rank = 0;
40-
//console.log(sorted.length)
41-
//var testarray = [];
4239

4340
var area = d3.svg.line().interpolate("step-before").x(function(d) {
4441
rank = rank + 1;
@@ -56,11 +53,10 @@ function flowduration(id) {
5653
yScale.domain([1, d3.max(data.map(function(d) {
5754
return d[1];
5855
}))]);
59-
//If y.domain has a min value of 0, then you can't plot in a log scale.'
56+
//If y.domain has a min value of 0, then you can't plot in a log scale.
6057

6158
focus.append("path").datum(data).attr("clip-path", "url(#clip)").attr("d", area).attr("stroke", "blue");
6259
//append the path to the graph, but clip it with the rectangle we defined above.
63-
//focus.append("path").datum(data).attr("d", area);//This still seems to get clipped even though it doesn't have the clipping path. ???
6460
focus.append("g").attr("class", "x axis").attr("transform", "translate(0," + height + ")").call(xAxis);
6561
focus.append("g").attr("class", "y axis").call(yAxis);
6662

src/graph-scatterChart.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function scatterChart() {
9393
var lineGroup = gEnter.append("g").attr("class", "lineGroup");
9494
var lineEnter = lineGroup.selectAll("path").data(dataArray).enter().append("path").attr("class", "line");
9595

96-
gEnter.append("g").attr("class", "x axis");//is this name okay? It has a space!
96+
gEnter.append("g").attr("class", "x axis");//g given two classes: x and axis.
9797
gEnter.append("g").attr("class", "y axis");
9898

9999
var titleGroup = gEnter.append("g").attr("class", "titleGroup");
@@ -111,10 +111,10 @@ function scatterChart() {
111111
g.selectAll(".line").attr("d", line).attr("stroke", function(d, i) {return color(i);});
112112

113113
// Update the x-axis.
114-
g.select(".x.axis").attr("transform", "translate(0," + yScale.range()[0] + ")").call(xAxis).on("click", myClickFunction);
114+
g.select(".x.axis").attr("transform", "translate(0," + yScale.range()[0] + ")").call(xAxis);
115115

116116
// Update the y-axis.
117-
g.select(".y.axis").attr("transform", "translate(0," + xScale.range()[0] + ")").call(yAxis).on("click", myRClickFunction);
117+
g.select(".y.axis").attr("transform", "translate(0," + xScale.range()[0] + ")").call(yAxis);
118118

119119
// Update the title.
120120
g.select(".titleGroup").attr("transform", "translate(10,0)");

src/index-drawMap.js

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ var fusionLayerInfoWindow;
33
var center = new google.maps.LatLng(39.395, -76.609);
44

55
function drawMap() {
6-
//document.getElementById('map_div').style.display = "none";
76
var mapOptions = {
87
zoom : 8,
98
center : new google.maps.LatLng(39.395, -76.609),
109
mapTypeId : google.maps.MapTypeId.TERRAIN
1110
};
1211

13-
//console.log(document.getElementById('map_div'));
1412
map = new google.maps.Map(document.getElementById('map_div'), mapOptions);
1513

1614
fusionLayerInfoWindow = new google.maps.InfoWindow();
@@ -20,21 +18,25 @@ function drawMap() {
2018
var fusionLayer = new google.maps.FusionTablesLayer({
2119
query : {
2220
select : 'location',
23-
//real.kmz, has more sites than Gages II, but less info.
21+
//real.kmz, has more sites than Gages II, but less info for each.
2422
//from : '1Rt_U4LqeNPi6Tk1-kq8ta-6OP748nJJJTqdwlC0Q'
2523

2624
//from Gages II merge, too large, takes too long to load
2725
//from : '1wtRBQVozXdLsn5t0PL8egL5wL7tUzFQvw6NYQizn'
2826

2927
//from Gages II merge- small
3028
from : '103gQIyU069THrk7KGZYtbC8_My1rW4JwaHhX1ehe'
29+
//Add queries like this:
3130
//where : 'DRAIN_SQKM < 20'
3231
},
3332
suppressInfoWindows: true
3433
});
3534
fusionLayer.setMap(map);
3635

3736
google.maps.event.addListener(fusionLayer, 'click', function(event) {
37+
//TODO: Google sometimes returns an error; I can't replicate this anymore. ???
38+
//console.dir(event);
39+
3840
//Parse real.kmz
3941
//var re = /[0-9]+/;
4042
//var sId = "dv" + re.exec(event.row.site_no.value)[0];
@@ -54,7 +56,6 @@ function drawMap() {
5456
//Update our viewModel with the current site information.
5557
viewModel.siteId(sId);
5658
viewModel.siteName(siteName);
57-
//viewModel.siteDict.push(siteDict);
5859

5960
//update our InfoWindow, then open it.
6061
fusionLayerInfoWindow.setOptions(
@@ -82,24 +83,6 @@ function drawMap() {
8283
map : map
8384
});
8485
85-
google.maps.event.addListener(fusionLayer, 'click', function(event) {
86-
console.log(event);
87-
var re = /^[0-9]+/;
88-
var sId = re.exec(event.featureData.name)[0];
89-
viewModel.siteId(sId);
90-
viewModel.siteName(event.featureData.name);
91-
//This siteIdArray.push won't capture the first data requested.
92-
viewModel.siteIdArray.push(+sId);
93-
console.log(viewModel.siteId());
94-
console.log(viewModel.siteIdArray());
95-
//viewModel.siteName.push(kmlEvent.featureData.name);
96-
97-
//console.log(sId);
98-
//console.log(viewModel.siteId());
99-
//console.log(viewModel.siteName());
100-
101-
getUSGS(sId);
102-
});
10386
*/
10487

10588
var tileNEX = new google.maps.ImageMapType({
@@ -122,12 +105,10 @@ function drawMap() {
122105
isPng : true
123106
});
124107

125-
map.overlayMapTypes.push(null);
126108
//create empty overlay entry
127-
//map.overlayMapTypes.setAt("0",goes);
109+
map.overlayMapTypes.push(null);
110+
//Add the GOES cloud imagery layer
111+
//map.overlayMapTypes.setAt("0", goes);
128112
map.overlayMapTypes.setAt("1", tileNEX);
129-
google.maps.event.addListener(map, 'bounds_changed', function() {
130-
//console.log(map.getBounds());
131-
});
132113
}
133114

src/initialize.js

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1-
/**
2-
* Created by Marty on 3/12/2017.
3-
*/
4-
51
function initialize() {
62

73
ko.applyBindings(viewModel);
84

95
var data = [];
106

11-
12-
13-
147
viewModel.time.start(new Date(2014,1,1));
158
viewModel.time.end(new Date(2015,1,1));
169
viewModel.time.recent("90");
1710

1811
viewModel.dataArray.subscribe(function(newValue) {
19-
//alert("dataArray was just updated. " + newValue[0]);
20-
console.log("plotGraph() called from index.html");
12+
//console.log("plotGraph() called with new value added to dataArray.");
2113
viewModel.plotGraph();
2214
});
2315

24-
//getUSGS(viewModel.siteDict()[0].id);
25-
console.log("Initial value of requestData parameters: ");
26-
console.log(viewModel.siteId());
27-
console.log(viewModel.siteName());
28-
console.log(viewModel.siteDict().toString());
29-
30-
console.log("setting viewModel values.");
16+
//console.log("Initial value of requestData parameters: ");
17+
//console.log(viewModel.siteId());
18+
//console.log(viewModel.siteName());
19+
//console.log("setting viewModel values.");
3120
viewModel.siteId("dv01580000");
3221
viewModel.siteName("Deer Creek at Rocks, MD");
3322
var initialSiteDict = {
@@ -36,16 +25,13 @@ function initialize() {
3625
area : 94.4,
3726
impervious : 1.26
3827
};
39-
//viewModel.siteDict().push(initialSiteDict); //This doesn't get done in drawMap, don't do it here.
4028

41-
console.log("Initial call of requestData with: ");
42-
console.log(viewModel.siteId());
43-
console.log(viewModel.siteName());
44-
console.log(viewModel.siteDict().toString());
29+
//console.log("Initial call of requestData with: ");
30+
//console.log(viewModel.siteId());
31+
//console.log(viewModel.siteName());
32+
//console.log(viewModel.siteDict().toString());
4533
requestData(viewModel.siteId(), viewModel.siteName(), initialSiteDict);
4634

47-
//getTuNexrad(viewModel.siteDict()[0].id);
48-
//$(window).resize();
4935
google.maps.event.addDomListener(window, 'load', drawMap);
5036
google.maps.event.addDomListener(window, 'load', redraw);
5137
$(window).resize(redraw);

src/local-storage.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function storageAvailable(storageType) {
1717
function checkStorage(site){
1818
if (storageAvailable('localStorage')) {
1919
// localStorage is available
20-
console.log("localStorage is available. site: " + site);
2120
try {
2221
var storage = window['localStorage'];
2322
var data = JSON.parse(storage.getItem(site));
@@ -26,14 +25,12 @@ function checkStorage(site){
2625
//In this case, I may want to have a refresh button near the graph to ask for more data.
2726
//
2827
if (Array.isArray(data)) {
29-
console.log("Retrieved data from site " + site + ". Length is:" + data.length);
28+
//console.log("Retrieved data from site " + site + ". Length is:" + data.length);
3029
//convert string to Date
3130
data.forEach(function(d, index, array){
3231
d[0] = new Date(d[0]);
3332
});
3433
return data;
35-
//console.log(data);
36-
//return false;
3734
} else {
3835
console.log("Problem with retrieved data for site " + site);
3936
console.log(data);
@@ -56,7 +53,7 @@ function checkStorage(site){
5653
function saveData(key, data) {
5754
if (storageAvailable('localStorage')) {
5855
// localStorage is available
59-
console.log("attempting to save");
56+
//console.log("attempting to save");
6057
try {
6158
var storage = window['localStorage'];
6259
storage.setItem(key, JSON.stringify(data));

0 commit comments

Comments
 (0)