chart2 = {
var svg = d3.create("svg")
.attr("width", 1000)
.attr("height", 700);
var dateLabel = svg.append("text")
.attr("id", "date-label")
.text("FEBRUARY 16")
.attr("x", 50)
.attr("y", 50)
var ridershipLabel = svg.append("text")
.attr("id", "ridership-label")
.text("106492540 total riders")
.attr("x", 50)
.attr("y", 90)
var g = svg.append("g")
g.selectAll("path")
.data(nyc2.features)
.enter().append("path")
.attr("d", path)
.attr("fill", "lightgrey")
.attr("stroke", "white")
g.attr("transform", "translate(200, 0)");
var h = svg.append("g")
var circs = h.selectAll("circle")
.data(data.series)
.enter().append("circle")
.attr("cx",function(d,i) {
var coords = proj([d.longitude,d.latitude]);
return coords[0];
})
.attr("cy",function(d,i) {
var coords = proj([d.longitude,d.latitude]);
return coords[1];
})
.attr("r",function(d,i) {
var proportion = d.values[0]/50000;
return 20*proportion;
})
.attr("fill",function(d, i) {
var proportion = d.values[0]*20/50000;
return d3.interpolateRdBu(d.values[0]/maximum);
})
.style("opacity", 0.5);
h.attr("transform", "translate(200, 0)");
var x = d3.scaleLinear()
.domain([0, 48])
.range([0, 500]);
var y = d3.scaleLinear()
.domain([0, 4000000])
.range([0, 500]);
svg.append("path")
.datum(allTotals)
.attr("stroke", "steelblue")
.attr("fill", "none")
.attr("stroke-width", 1.5)
.attr("d", d3.line()
.x(function(d, i) { return x(i) })
.y(function(d, i) { return y(d) })
.curve(d3.curveBasis)
)
return svg.node()
}