Skip to content

Instantly share code, notes, and snippets.

@zackify
Last active October 3, 2018 15:42
Show Gist options
  • Save zackify/9eb818a4326a7b834d9a to your computer and use it in GitHub Desktop.
Save zackify/9eb818a4326a7b834d9a 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