react-d3-core
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "react-d3-core", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "react chart core component", | ||
@@ -5,0 +5,0 @@ "main": "./index.jsx", |
@@ -15,3 +15,17 @@ "use strict"; | ||
componentDidMount () { | ||
static defaultProps = { | ||
setScale: (type, func) => {}, | ||
range: null, | ||
rangeRoundBands: null, | ||
domain: null, | ||
tickFormat: null, | ||
tickOrient: null | ||
} | ||
componentDidMount() { | ||
this._mkAxis(); | ||
} | ||
_mkAxis() { | ||
console.log('here') | ||
const {showAxis, type} = this.props; | ||
@@ -35,7 +49,5 @@ | ||
_mkTickAxis () { | ||
const { | ||
type, | ||
initAxis, | ||
orient, | ||
@@ -53,3 +65,3 @@ tickOrient, | ||
var func = initAxis; | ||
var func = d3.svg.axis(); | ||
@@ -84,2 +96,3 @@ func.scale(this._mkScale()); | ||
scale, | ||
newDomain | ||
} = this.props; | ||
@@ -112,3 +125,3 @@ | ||
if(type === 'x' || type === 'y') { | ||
if((type === 'x' || type === 'y') && !newDomain) { | ||
// if x, y set scale, not grid | ||
@@ -150,4 +163,14 @@ this.props.setScale(type, func); | ||
componentWillReceiveProps(nextProps) { | ||
const { | ||
newDomain | ||
} = nextProps; | ||
this.props = nextProps; | ||
if(newDomain) { | ||
this._mkAxis(); | ||
} | ||
} | ||
render () { | ||
@@ -171,11 +194,1 @@ const {gridAxisClassName, axisClassName, t, type} = this.props; | ||
} | ||
Axis.defaultProps = { | ||
initAxis: d3.svg.axis(), | ||
setScale: (type, func) => {}, | ||
range: null, | ||
rangeRoundBands: null, | ||
domain: null, | ||
tickFormat: null, | ||
tickOrient: null | ||
}; |
@@ -63,2 +63,3 @@ "use strict" | ||
xDomain, | ||
xDomainSet, | ||
xRange, | ||
@@ -115,2 +116,3 @@ xRangeRoundBands, | ||
domain = {xDomain} | ||
newDomain = {xDomainSet} | ||
range = {xRange} | ||
@@ -117,0 +119,0 @@ scale = {xScale} |
@@ -29,2 +29,3 @@ "use strict" | ||
yDomain, | ||
yDomainSet, | ||
yRange, | ||
@@ -82,2 +83,3 @@ yRangeRoundBands, | ||
domain = {yDomain} | ||
newDomain = {yDomainSet} | ||
range = {yRange} | ||
@@ -84,0 +86,0 @@ scale = {yScale} |
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
4084361
30858