Declared Sparkline PropTypes.

This commit is contained in:
Filip Barl
2017-10-17 17:54:50 +02:00
parent c26914087f
commit ef2f32dc99
2 changed files with 9 additions and 4 deletions

View File

@@ -40,7 +40,6 @@
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"react/default-props-match-prop-types": 0,
"react/jsx-closing-tag-location": 0,
"react/jsx-max-props-per-line": 0,
"react/jsx-wrap-multilines": 0,

View File

@@ -33,7 +33,7 @@ export default class Sparkline extends React.Component {
this.x.range([MARGIN, this.props.width - circleSpace]);
this.y.range([this.props.height - circleSpace, circleSpace]);
this.line.curve(this.props.curve);
this.line.curve(curveLinear);
}
getGraphData() {
@@ -130,7 +130,14 @@ export default class Sparkline extends React.Component {
}
Sparkline.propTypes = {
data: PropTypes.arrayOf(PropTypes.object)
width: PropTypes.number,
height: PropTypes.number,
strokeColor: PropTypes.string,
strokeWidth: PropTypes.number,
hoverColor: PropTypes.string,
circleRadius: PropTypes.number,
hovered: PropTypes.bool,
data: PropTypes.arrayOf(PropTypes.object),
};
Sparkline.defaultProps = {
@@ -139,7 +146,6 @@ Sparkline.defaultProps = {
strokeColor: '#7d7da8',
strokeWidth: 0.5,
hoverColor: '#7d7da8',
curve: curveLinear,
circleRadius: 1.75,
hovered: false,
data: [],