Skip to main content
100%

Arc Corners

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Nov 16, 2014

This example demonstrates D3’s rounded-arc capability by rendering a donut chart where each slice has rounded corners and small gaps between adjacent segments, using the Fibonacci sequence as sample data. The visualization is drawn as SVG, with the arcs generated by `d3.layout.pie` and `d3.svg.arc`’s `cornerRadius` and `padAngle` options. Overlaid on the chart are faint reference circles that mark the exact positions where the arc corners are rounded, computed manually from each slice’s angles and radii. The code also applies a category color scale and semi-transparent fills to distinguish the slices.

AI-generated description

In D3 3.5, you can generate rounded arcs with d3.svg.arc cornerRadius and separate adjacent arcs with d3.layout.pie padAngle. The schematic representation above shows the circles used to round the arcs’ corners.

gpl-3.0 Licensed

Similar vizzes