Render dimensions of gauge from props

pull/2397/head
Alex P 2017-11-16 10:53:47 -08:00
parent b8408f6540
commit 67f28eda6c
1 changed files with 6 additions and 4 deletions

View File

@ -265,21 +265,23 @@ class Gauge extends Component {
}
render() {
const {width, height} = this.props
return (
<canvas
className="gauge"
style={{border: '1px solid #f00'}}
width={400}
height={300}
width={width}
height={height}
ref={r => (this.canvasRef = r)}
/>
)
}
}
const {number} = PropTypes
const {number, string} = PropTypes
Gauge.propTypes = {
width: string.isRequired,
height: string.isRequired,
minValue: number.isRequired,
maxValue: number.isRequired,
lowerThreshold: number.isRequired,