multiline = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width+margin.right, height])
.style("overflow", "visible");
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
const path = svg.append("g")
.attr('id', 'allpaths')
.attr("fill", "none")
.attr("stroke", colour)
.attr("stroke-width", 1.5)
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.selectAll("path")
.data(data.series)
.join("path")
.style("mix-blend-mode", "multiply")
.attr("id", d => replacePunct(d.name))
.attr("d", d => line(d.values));
svg.append('text')
.attr('x', x(data.dates.slice(-1)[0]))
.attr('y', 40)
.attr('dx', 40)
.attr('dy', '.05em')
.style('text-anchor', 'end')
.text('Confirmed and Probable Cases')
svg.call(hover, path);
svg.append('rect').lower()
.attr('x', x(new Date(2020,2,24)))
.attr('y', 55)
.attr('width', x(new Date(2020,5,2)) - x(new Date(2020,2,24)))
.attr('height', y(1) - 55)
.attr('fill', '#f1f3ff')
svg.append('text')
.attr('x', x(new Date(2020,2,26)))
.attr('y', 70)
.text('Stay Home, Stay Safe')
svg.append('rect').lower()
.attr('x', x(new Date(2020,10,18)))
.attr('y', 55)
.attr('width', x(new Date(2021,1,1)) - x(new Date(2020,10,18)))
.attr('height', y(1) - 55)
.attr('fill', '#f1f3ff')
svg.append('text')
.attr('x', x(new Date(2020,10,20)))
.attr('y', 70)
.text('Pause to Save Lives')
function update(dropdown) {
d3.selectAll('path').attr('stroke-width', null)
d3.select(`#${replacePunct(dropdown)}`).raise()
.attr('stroke-width', highlightWidth)
.attr('stroke', highlightColor)
}
return Object.assign(svg.node(), {update} );
}