react-sparklines
Advanced tools
Comparing version 0.5.1 to 0.5.2
{ | ||
"name": "react-sparklines", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Beautiful and expressive Sparklines React component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
export default class DataProcessor { | ||
static dataToPoints(data) { | ||
static dataToPoints(data, width, height) { | ||
let width = 300; | ||
let height = 150; | ||
let max = Math.max.apply(Math, data); | ||
@@ -9,0 +6,0 @@ let min = Math.min.apply(Math, data); |
@@ -20,3 +20,3 @@ import React from 'react'; | ||
let { data, limit } = this.props; | ||
let { width, height, data, limit } = this.props; | ||
@@ -31,3 +31,3 @@ if (!data || data.length === 0) { | ||
let points = DataProcessor.dataToPoints(data); | ||
let points = DataProcessor.dataToPoints(data, width, height); | ||
@@ -64,3 +64,3 @@ let sparklinesBars = !this.props.bars ? {} : | ||
return ( | ||
<svg preserveAspectRatio="xMinYMin meet"> | ||
<svg width={width} height={height} preserveAspectRatio="xMinYMin meet"> | ||
{sparklinesBars} | ||
@@ -74,2 +74,4 @@ {sparklinesGroup} | ||
Sparklines.propTypes = { | ||
width: React.PropTypes.number, | ||
height: React.PropTypes.number, | ||
data: React.PropTypes.array, | ||
@@ -84,2 +86,4 @@ limit: React.PropTypes.number, | ||
Sparklines.defaultProps = { | ||
width: 120, | ||
height: 40, | ||
limit: 100, | ||
@@ -86,0 +90,0 @@ color: 'black', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
253
10561
13