Skip to content

Instantly share code, notes, and snippets.

@petebrowne
Created June 11, 2016 17:59
Show Gist options
  • Save petebrowne/ee00a54372e093ffc4ef9c7d1f80d804 to your computer and use it in GitHub Desktop.
Save petebrowne/ee00a54372e093ffc4ef9c7d1f80d804 to your computer and use it in GitHub Desktop.
class Slice extends React.Component {
render() {
let {value, fill, innerRadius = 0, outerRadius} = this.props;
// https://github.com/d3/d3/wiki/SVG-Shapes#arc
let arc = d3.svg.arc()
.innerRadius(innerRadius)
.outerRadius(outerRadius);
return (
<path d={arc(value)} fill={fill} />
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment