Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imjakechapman/1b79a2b3e7605219a2bc to your computer and use it in GitHub Desktop.
Save imjakechapman/1b79a2b3e7605219a2bc to your computer and use it in GitHub Desktop.
ReactJS Component for http://bernii.github.io/gauge.js/
var GaugeWrapper = React.createClass({
componentDidMount(){
var target = React.findDOMNode(this)
var gauge = new Gauge(target).setOptions(this.props.options);
gauge.maxValue = this.props.max;
gauge.set(this.props.value);
},
render(){
return <canvas width={this.props.width} height={this.props.height} />
}
})
<GaugeWrapper width="500" options={{}} max="500" value="50"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment