block by zanarmstrong 1297217aaeef4470518a

weather data

Full Screen

index.html

<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="weather.css">
<body>
<div id = "description">This document reads in weather data, so you can visualize it.</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src="weather.js"></script>

weather.css

body {
  background: #FFFCF8;
  font-size: 14pt;
}

weather.js

"use strict";

// set up basic variables and SVG
var width = 500, height = 800

var svg = d3.select("body").append("svg")
  .attr("width", width)
  .attr("height", height)

// read in data (switch to 'minneapolis.csv' if you want that city instead)
d3.csv("sanfrancisco.csv", function(error, sfWeather) {
  if(error)
    console.log(error)
    console.log('san francisco weather data', sfWeather)
  // uncomment below lines if you want to have both cities
  //d3.csv("minneapolis.csv", function(error, minneapolisWeather) {
  //  if(error)
  //    console.log(error)
 	//	console.log('minneapolis weather data', minneapolisWeather) 
  //})
})