temps1980 = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("g")
.attr("transform", "translate(300,20)")
.append(() =>
legend({
color: thresholdchange,
title: datatemp1980.title,
width: 450,
tickFormat: "0.1f"
})
);
svg.append("g")
.selectAll("path")
.data(countiestemp1980.features)
.join("path")
.attr("stroke", "black")
.attr("stroke-linejoin", "bevel")
.attr("stroke-width", 0.2)
.attr("fill", function(d){
if(datatemp1980.get(+d.properties.STCOFIPS) > 0){
return thresholdchange(datatemp1980.get(d.properties.STCOFIPS));
}
else{
return nancolor;
}
})
.attr("fill", d => thresholdchange(datatemp1980.get(+d.properties.STCOFIPS)))
.attr("d", path)
.append("title")
.text(d => " Temperature: " + datatemp1980.get(+d.properties.STCOFIPS));
return svg.node();
}