Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ghing
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghing/29b266507457bc9e262e to your computer and use it in GitHub Desktop.
Save ghing/29b266507457bc9e262e to your computer and use it in GitHub Desktop.
Playing with rainfall data
<!doctype html>
<html>
<head></head>
<body>
<div id="chart"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var ENDPOINT_ROOT = 'http://chicagorains.com/api/hourlyPrecip/';
function getURL(date, location) {
var dateStr = ('0' + (date.getMonth() + 1)).slice(-2) + '-'
+ ('0' + date.getDate()).slice(-2) + '-'
+ date.getFullYear();
return ENDPOINT_ROOT + '?startDate=' + dateStr + '&endDate=' + dateStr + '&location=' + location;
}
function getRainfall(date) {
}
function lineChart() {
}
var today = new Date();
console.debug(getURL(today));
//d3.json(url, function(error, data) {
//});
d3.select('#chart')
.data(data)
.call(lineChart);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment