react-d3-core
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -45,48 +45,12 @@ "use strict"; | ||
_createClass(ChartSvg, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
var _this = this; | ||
key: 'render', | ||
value: function render() { | ||
var _props = this.props; | ||
var height = _props.height; | ||
var width = _props.width; | ||
var margins = _props.margins; | ||
var xScale = _props.xScale; | ||
var xDomain = _props.xDomain; | ||
var xRange = _props.xRange; | ||
var xScaleSet = _props.xScaleSet; | ||
var yScaleSet = _props.yScaleSet; | ||
var onZoom = _props.onZoom; | ||
var scaleExtent = _props.scaleExtent; | ||
var svgClassName = _props.svgClassName; | ||
var id = _props.id; | ||
var children = _props.children; | ||
// implement zoom if xscale and y scale is set! | ||
if (xScaleSet && yScaleSet) { | ||
if (xScale === 'ordinal') { | ||
// if ordinal tramsform to linear | ||
xScaleSet = (0, _utilsScale.scale)({ | ||
scale: 'linear', | ||
domain: [0, width - margins.left - margins.right], | ||
range: [0, width - margins.left - margins.right] | ||
}); | ||
} | ||
var zoom = _d32['default'].behavior.zoom().x(xScaleSet).y(yScaleSet).scaleExtent(scaleExtent); | ||
zoom.on("zoom", function () { | ||
onZoom.call(_this, xScaleSet, yScaleSet, zoom); | ||
}); | ||
_d32['default'].select(_reactDom2['default'].findDOMNode(this.refs.svgContainer)).call(zoom); | ||
} | ||
} | ||
}, { | ||
key: 'render', | ||
value: function render() { | ||
var _props2 = this.props; | ||
var height = _props2.height; | ||
var width = _props2.width; | ||
var margins = _props2.margins; | ||
var svgClassName = _props2.svgClassName; | ||
var id = _props2.id; | ||
var children = _props2.children; | ||
var t = 'translate(' + margins.left + ', ' + margins.top + ')'; | ||
@@ -93,0 +57,0 @@ |
{ | ||
"name": "react-d3-core", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "react-d3 chart core component", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
4124671
31210