victory-stack
Advanced tools
Comparing version 31.2.0 to 32.0.0
@@ -105,4 +105,4 @@ import _orderBy from "lodash/orderBy"; | ||
function stackData(props) { | ||
var dataFromChildren = Wrapper.getDataFromChildren(props); | ||
function stackData(props, childComponents) { | ||
var dataFromChildren = Wrapper.getDataFromChildren(props, childComponents); | ||
var datasets = fillData(props, dataFromChildren); | ||
@@ -117,8 +117,6 @@ return datasets.map(function (d, i) { | ||
var role = "stack"; | ||
props = Helpers.modifyProps(props, fallbackProps, role); | ||
var style = Wrapper.getStyle(props.theme, props.style, role); | ||
var horizontal = props.horizontal || childComponents.every(function (component) { | ||
return component.props.horizontal; | ||
}); | ||
var categories = Wrapper.getCategories(props, childComponents); | ||
var datasets = stackData(props); | ||
var datasets = stackData(props, childComponents); | ||
var children = childComponents.map(function (c, i) { | ||
@@ -142,12 +140,12 @@ return React.cloneElement(c, { | ||
var baseScale = { | ||
x: Scale.getScaleFromProps(props, "x") || Scale.getDefaultScale(), | ||
y: Scale.getScaleFromProps(props, "y") || Scale.getDefaultScale() | ||
x: Scale.getScaleFromProps(props, "x") || Wrapper.getScale(props, "x"), | ||
y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y") | ||
}; | ||
var xScale = baseScale.x.domain(domain.x).range(range.x); | ||
var yScale = baseScale.y.domain(domain.y).range(range.y); | ||
var scale = { | ||
x: horizontal ? yScale : xScale, | ||
y: horizontal ? xScale : yScale | ||
x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x), | ||
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y) | ||
}; | ||
var colorScale = props.colorScale; | ||
var _props = props, | ||
colorScale = _props.colorScale, | ||
horizontal = _props.horizontal; | ||
return { | ||
@@ -154,0 +152,0 @@ datasets: datasets, |
@@ -193,3 +193,2 @@ import _isEmpty from "lodash/isEmpty"; | ||
groupComponent: React.createElement("g", null), | ||
scale: "linear", | ||
standalone: true, | ||
@@ -196,0 +195,0 @@ theme: VictoryTheme.grayscale, |
@@ -117,4 +117,4 @@ "use strict"; | ||
function stackData(props) { | ||
var dataFromChildren = _victoryCore.Wrapper.getDataFromChildren(props); | ||
function stackData(props, childComponents) { | ||
var dataFromChildren = _victoryCore.Wrapper.getDataFromChildren(props, childComponents); | ||
@@ -130,12 +130,9 @@ var datasets = fillData(props, dataFromChildren); | ||
var role = "stack"; | ||
props = _victoryCore.Helpers.modifyProps(props, fallbackProps, role); | ||
var style = _victoryCore.Wrapper.getStyle(props.theme, props.style, role); | ||
var horizontal = props.horizontal || childComponents.every(function (component) { | ||
return component.props.horizontal; | ||
}); | ||
var categories = _victoryCore.Wrapper.getCategories(props, childComponents); | ||
var datasets = stackData(props); | ||
var datasets = stackData(props, childComponents); | ||
var children = childComponents.map(function (c, i) { | ||
@@ -159,12 +156,12 @@ return _react.default.cloneElement(c, { | ||
var baseScale = { | ||
x: _victoryCore.Scale.getScaleFromProps(props, "x") || _victoryCore.Scale.getDefaultScale(), | ||
y: _victoryCore.Scale.getScaleFromProps(props, "y") || _victoryCore.Scale.getDefaultScale() | ||
x: _victoryCore.Scale.getScaleFromProps(props, "x") || _victoryCore.Wrapper.getScale(props, "x"), | ||
y: _victoryCore.Scale.getScaleFromProps(props, "y") || _victoryCore.Wrapper.getScale(props, "y") | ||
}; | ||
var xScale = baseScale.x.domain(domain.x).range(range.x); | ||
var yScale = baseScale.y.domain(domain.y).range(range.y); | ||
var scale = { | ||
x: horizontal ? yScale : xScale, | ||
y: horizontal ? xScale : yScale | ||
x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x), | ||
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y) | ||
}; | ||
var colorScale = props.colorScale; | ||
var _props = props, | ||
colorScale = _props.colorScale, | ||
horizontal = _props.horizontal; | ||
return { | ||
@@ -171,0 +168,0 @@ datasets: datasets, |
@@ -216,3 +216,2 @@ "use strict"; | ||
groupComponent: _react.default.createElement("g", null), | ||
scale: "linear", | ||
standalone: true, | ||
@@ -219,0 +218,0 @@ theme: _victoryCore.VictoryTheme.grayscale, |
{ | ||
"name": "victory-stack", | ||
"version": "31.2.0", | ||
"version": "32.0.0", | ||
"description": "Stack Layout Component for Victory", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"react-fast-compare": "^2.0.0", | ||
"victory-core": "^31.2.0" | ||
"victory-core": "^32.0.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "scripts": { |
@@ -103,4 +103,4 @@ /* eslint-disable func-style */ | ||
function stackData(props) { | ||
const dataFromChildren = Wrapper.getDataFromChildren(props); | ||
function stackData(props, childComponents) { | ||
const dataFromChildren = Wrapper.getDataFromChildren(props, childComponents); | ||
const datasets = fillData(props, dataFromChildren); | ||
@@ -113,7 +113,6 @@ return datasets.map((d, i) => addLayoutData(props, datasets, i)); | ||
const role = "stack"; | ||
props = Helpers.modifyProps(props, fallbackProps, role); | ||
const style = Wrapper.getStyle(props.theme, props.style, role); | ||
const horizontal = | ||
props.horizontal || childComponents.every((component) => component.props.horizontal); | ||
const categories = Wrapper.getCategories(props, childComponents); | ||
const datasets = stackData(props); | ||
const datasets = stackData(props, childComponents); | ||
const children = childComponents.map((c, i) => { | ||
@@ -131,12 +130,10 @@ return React.cloneElement(c, { data: datasets[i] }); | ||
const baseScale = { | ||
x: Scale.getScaleFromProps(props, "x") || Scale.getDefaultScale(), | ||
y: Scale.getScaleFromProps(props, "y") || Scale.getDefaultScale() | ||
x: Scale.getScaleFromProps(props, "x") || Wrapper.getScale(props, "x"), | ||
y: Scale.getScaleFromProps(props, "y") || Wrapper.getScale(props, "y") | ||
}; | ||
const xScale = baseScale.x.domain(domain.x).range(range.x); | ||
const yScale = baseScale.y.domain(domain.y).range(range.y); | ||
const scale = { | ||
x: horizontal ? yScale : xScale, | ||
y: horizontal ? xScale : yScale | ||
x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x), | ||
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y) | ||
}; | ||
const colorScale = props.colorScale; | ||
const { colorScale, horizontal } = props; | ||
return { datasets, categories, range, domain, horizontal, scale, style, colorScale, role }; | ||
@@ -143,0 +140,0 @@ } |
@@ -58,3 +58,2 @@ import { assign, defaults, isEmpty } from "lodash"; | ||
groupComponent: <g />, | ||
scale: "linear", | ||
standalone: true, | ||
@@ -61,0 +60,0 @@ theme: VictoryTheme.grayscale, |
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
1216384
21945
+ Addedvictory-core@32.3.7(transitive)
- Removedvictory-core@31.2.0(transitive)
Updatedvictory-core@^32.0.0