Slackbot
04/13/2023, 8:17 PMCyrus O'Brien
04/13/2023, 9:24 PMconst path = svg
.append(“g”)
.attr(“fill”, “none”)
// .attr(“stroke”, color)
.attr(“stroke-linecap”, strokeLinecap)
.attr(“stroke-linejoin”, strokeLinejoin)
.attr(“stroke-width”, strokeWidth)
.attr(“stroke-opacity”, strokeOpacity)
.selectAll(“path”)
.data(d3.group(I, (i) => Z[i]))
.join(“path”)
.attr(“stroke”, color)
.attr(“d”, ([, I]) => line(I));
Libbey White
04/13/2023, 9:25 PMd[0]
instead of d.state
in the color function, it works.Libbey White
04/13/2023, 9:26 PM['California', Array(36)]
Libbey White
04/13/2023, 9:27 PMcolor: (d) => (d[0] == "California" ? "red" : "steelblue"),
Libbey White
04/13/2023, 9:28 PMCyrus O'Brien
04/13/2023, 9:45 PMCyrus O'Brien
04/13/2023, 9:45 PMLibbey White
04/13/2023, 9:51 PM