Last active
August 29, 2015 14:27
-
-
Save dcousineau/4548a5301f80b0899097 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Line extends React.Component { | |
static contextTypes = { | |
xScale: React.PropTypes.func, | |
yScale: React.PropTypes.func | |
}; | |
render() { | |
let path = d3.svg.line() | |
.interpolate("basis") | |
.x(d => this.context.xScale(d.x)) | |
.y(d => this.context.yScale(d.y)); | |
return ( | |
<path d={path(this.props.data)} | |
stroke={this.props.color} | |
strokeWidth={this.props.width} | |
fill="none" /> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment