Last active
October 3, 2018 15:42
-
-
Save zackify/9eb818a4326a7b834d9a to your computer and use it in GitHub Desktop.
ReactJS Component for http://bernii.github.io/gauge.js/
This file contains 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
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