I'm using D3.js's built-in arc function to generate SVG <path>
s for my data.
.attr("d", function(element, index) {
var arc = d3.arc()
.innerRadius(iR)
.outerRadius(iR + 10)
.startAngle(element[1])
.endAngle(element[2])
.cornerRadius(isRounded ? cR : 0);
return arc();
});
This works perfectly, but I'd like to round one side (both corners) of certain arcs. When a corner radius is supplied with .cornerRadius()
, however, it rounds all four corners.
I know there are various ways to selectively round the corners of rectangles, but I'm hoping there's some generic way to do this for arcs.
I also saw this question about rounding only some corners of an arc, but it has no answer (and D3 v4 has come out since it was posted).