svg = {
const { marginLeft, marginTop, width, height } = sizes;
const svg = d3.create("svg").attr("viewBox", `0, 0, ${width}, ${height}`);
const lineChart = svg
.append("g")
.attr("transform", `translate(${marginLeft}, ${marginTop})`);
const xScale = appendTimeAxis(lineChart);
const yScale = appendTemperatureAxis(lineChart);
stylingLineChartAxes(lineChart);
appendAxisLabel(svg);
const aubergine = "#75485E";
const xPos = ({ date }) => xScale(date);
const yPos = ({ avg_temp_F: t }) => yScale(t);
lineChart
.selectAll("circle")
.data(data)
.join("circle")
.attr("r", 4)
.attr("cx", xPos)
.attr("cy", yPos)
.attr("fill", aubergine);
const lineGen = d3.line().x(xPos).y(yPos).curve(d3.curveCatmullRom);
lineChart
.append("path")
.attr("d", lineGen(data))
.attr("fill", "none")
.attr("stroke", aubergine);
return svg.node();
}