innerRadius() sets or retrieves the inner radius of a D3 arc generator. Chained to d3.arc(), it defines the arc’s inner boundary in pixels; combining it with outerRadius() controls the ring’s thickness. section 4.4.2
Create a ring-shaped arc
Set innerRadius(80) and outerRadius(120) to create an annular arc. Setting the inner radius to 0 produces a pie-chart shape instead. In a precipitation chart, pass startAngle and endAngle when generating each SVG path. section 4.4.2
const arcGenerator = d3.arc() .innerRadius(80) .outerRadius(120);
Use the chained generator declaration to set the inner and outer radii before supplying each arc’s angles. section 4.4.2
Related arc-generator choices:
- Add spacing with padAngle(), or soften corners with cornerRadius(). section 4.4.2
- Express arc angles in radians and provide them through startAngle and endAngle when generating paths. section 4.5
