startAngle() is a D3 arc-generator accessor for setting or accessing the angle where an arc begins. Angles supplied to the generator must be expressed in radians. section 4.5
Use startAngle() alongside related arc-generator accessors:
- Pair it with endAngle() to define an arc's angular span. section 4.5
- Combine it with innerRadius(), outerRadius(), padAngle(), and cornerRadius() to shape the arc. section 4.5
- Pass a data accessor such as d => d.startAngle when each annotated datum supplies its own starting angle. section 5.1.3
Generating arcs from annotated data
const arcGenerator = d3.arc() .startAngle(d => d.startAngle) .endAngle(d => d.endAngle) .innerRadius(60) .outerRadius(100) .padAngle(0.02) .cornerRadius(3); Each generated path uses this function to calculate its SVG d attribute, producing the corresponding donut slice. section 5.1.3
const centroid = arcGenerator .startAngle(0) .endAngle(angleDaysWithPrecipitation_rad) .centroid();
Inspect a concrete chain that fixes an arc's starting angle at zero before calculating its centroid. section 4.4.3
