victory-zoom-container
Advanced tools
Comparing version 31.0.0 to 31.0.1
@@ -218,4 +218,18 @@ import _defaults from "lodash/defaults"; | ||
horizontal = props.horizontal; | ||
var x = horizontal ? "y" : "x"; | ||
var y = horizontal ? "x" : "y"; | ||
var xAxis = "x"; | ||
var yAxis = "y"; | ||
var zoomAxis = zoomDimension; | ||
if (horizontal) { | ||
xAxis = "y"; | ||
yAxis = "x"; | ||
if (zoomDimension) { | ||
zoomAxis = { | ||
x: xAxis, | ||
y: yAxis | ||
}[zoomDimension]; | ||
} | ||
} | ||
var childComponents = Children.toArray(children); | ||
@@ -225,5 +239,5 @@ var childrenDomain = {}; | ||
if (childComponents.length) { | ||
childrenDomain = zoomDimension ? _defineProperty({}, zoomDimension, Wrapper.getDomainFromChildren(props, zoomDimension, childComponents)) : { | ||
x: Wrapper.getDomainFromChildren(props, x, childComponents), | ||
y: Wrapper.getDomainFromChildren(props, y, childComponents) | ||
childrenDomain = zoomDimension ? _defineProperty({}, zoomDimension, Wrapper.getDomainFromChildren(props, zoomAxis, childComponents)) : { | ||
x: Wrapper.getDomainFromChildren(props, xAxis, childComponents), | ||
y: Wrapper.getDomainFromChildren(props, yAxis, childComponents) | ||
}; | ||
@@ -230,0 +244,0 @@ } |
@@ -230,5 +230,18 @@ "use strict"; | ||
horizontal = props.horizontal; | ||
var x = horizontal ? "y" : "x"; | ||
var y = horizontal ? "x" : "y"; | ||
var xAxis = "x"; | ||
var yAxis = "y"; | ||
var zoomAxis = zoomDimension; | ||
if (horizontal) { | ||
xAxis = "y"; | ||
yAxis = "x"; | ||
if (zoomDimension) { | ||
zoomAxis = { | ||
x: xAxis, | ||
y: yAxis | ||
}[zoomDimension]; | ||
} | ||
} | ||
var childComponents = _react.Children.toArray(children); | ||
@@ -239,5 +252,5 @@ | ||
if (childComponents.length) { | ||
childrenDomain = zoomDimension ? _defineProperty({}, zoomDimension, _victoryCore.Wrapper.getDomainFromChildren(props, zoomDimension, childComponents)) : { | ||
x: _victoryCore.Wrapper.getDomainFromChildren(props, x, childComponents), | ||
y: _victoryCore.Wrapper.getDomainFromChildren(props, y, childComponents) | ||
childrenDomain = zoomDimension ? _defineProperty({}, zoomDimension, _victoryCore.Wrapper.getDomainFromChildren(props, zoomAxis, childComponents)) : { | ||
x: _victoryCore.Wrapper.getDomainFromChildren(props, xAxis, childComponents), | ||
y: _victoryCore.Wrapper.getDomainFromChildren(props, yAxis, childComponents) | ||
}; | ||
@@ -244,0 +257,0 @@ } |
{ | ||
"name": "victory-zoom-container", | ||
"version": "31.0.0", | ||
"version": "31.0.1", | ||
"description": "Interactive Zoom Component for Victory", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -161,4 +161,12 @@ /*eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 1000] }]*/ | ||
const { originalDomain, domain, children, zoomDimension, horizontal } = props; | ||
const x = horizontal ? "y" : "x"; | ||
const y = horizontal ? "x" : "y"; | ||
let xAxis = "x"; | ||
let yAxis = "y"; | ||
let zoomAxis = zoomDimension; | ||
if (horizontal) { | ||
xAxis = "y"; | ||
yAxis = "x"; | ||
if (zoomDimension) { | ||
zoomAxis = { x: xAxis, y: yAxis }[zoomDimension]; | ||
} | ||
} | ||
const childComponents = Children.toArray(children); | ||
@@ -168,7 +176,7 @@ let childrenDomain = {}; | ||
childrenDomain = zoomDimension ? | ||
{ [zoomDimension]: Wrapper.getDomainFromChildren(props, zoomDimension, childComponents) } | ||
: ({ | ||
x: Wrapper.getDomainFromChildren(props, x, childComponents), | ||
y: Wrapper.getDomainFromChildren(props, y, childComponents) | ||
}); | ||
{ [zoomDimension]: Wrapper.getDomainFromChildren(props, zoomAxis, childComponents) } | ||
: ({ | ||
x: Wrapper.getDomainFromChildren(props, xAxis, childComponents), | ||
y: Wrapper.getDomainFromChildren(props, yAxis, childComponents) | ||
}); | ||
} | ||
@@ -175,0 +183,0 @@ return defaults({}, childrenDomain, originalDomain, domain); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1226715
22419