victory-axis
Advanced tools
Comparing version 33.1.0 to 33.1.2
@@ -153,23 +153,2 @@ import _defaults from "lodash/defaults"; | ||
var getRole = function (props) { | ||
if (props.dependentAxis) { | ||
return props.theme && props.theme.dependentAxis ? "dependentAxis" : "axis"; | ||
} | ||
return props.theme && props.theme.independentAxis ? "independentAxis" : "axis"; | ||
}; | ||
var getShallowMergedThemeProps = function (props, role) { | ||
var axisTheme = props.theme.axis || {}; | ||
return _defaults({}, props.theme[role], axisTheme); | ||
}; | ||
var modifyProps = function (props, fallbackProps, role) { | ||
if (role !== "axis") { | ||
props.theme[role] = getShallowMergedThemeProps(props, role); | ||
} | ||
return Helpers.modifyProps(props, fallbackProps, role); | ||
}; | ||
var getAxisLabelProps = function (props, calculatedValues, globalTransform) { | ||
@@ -399,4 +378,3 @@ var style = calculatedValues.style, | ||
var getBaseProps = function (props, fallbackProps) { | ||
var role = getRole(props); | ||
props = modifyProps(props, fallbackProps, role); | ||
props = Axis.modifyProps(props, fallbackProps); | ||
var calculatedValues = getCalculatedValues(props); | ||
@@ -403,0 +381,0 @@ var axis = calculatedValues.axis, |
@@ -30,3 +30,3 @@ import _isEmpty from "lodash/isEmpty"; | ||
import React from "react"; | ||
import { PropTypes as CustomPropTypes, Helpers, VictoryLabel, CommonProps, VictoryContainer, VictoryTheme, LineSegment, TextSize, addEvents, Axis } from "victory-core"; | ||
import { PropTypes as CustomPropTypes, VictoryLabel, CommonProps, VictoryContainer, VictoryTheme, LineSegment, TextSize, addEvents, Axis } from "victory-core"; | ||
import { getBaseProps, getStyles } from "./helper-methods"; | ||
@@ -196,5 +196,4 @@ var fallbackProps = { | ||
value: function render() { | ||
var animationWhitelist = VictoryAxis.animationWhitelist, | ||
role = VictoryAxis.role; | ||
var props = Helpers.modifyProps(this.props, fallbackProps, role); | ||
var animationWhitelist = VictoryAxis.animationWhitelist; | ||
var props = Axis.modifyProps(this.props, fallbackProps); | ||
@@ -201,0 +200,0 @@ if (this.shouldAnimate()) { |
@@ -169,23 +169,2 @@ "use strict"; | ||
var getRole = function (props) { | ||
if (props.dependentAxis) { | ||
return props.theme && props.theme.dependentAxis ? "dependentAxis" : "axis"; | ||
} | ||
return props.theme && props.theme.independentAxis ? "independentAxis" : "axis"; | ||
}; | ||
var getShallowMergedThemeProps = function (props, role) { | ||
var axisTheme = props.theme.axis || {}; | ||
return (0, _defaults2.default)({}, props.theme[role], axisTheme); | ||
}; | ||
var modifyProps = function (props, fallbackProps, role) { | ||
if (role !== "axis") { | ||
props.theme[role] = getShallowMergedThemeProps(props, role); | ||
} | ||
return _victoryCore.Helpers.modifyProps(props, fallbackProps, role); | ||
}; | ||
var getAxisLabelProps = function (props, calculatedValues, globalTransform) { | ||
@@ -429,4 +408,3 @@ var style = calculatedValues.style, | ||
var getBaseProps = function (props, fallbackProps) { | ||
var role = getRole(props); | ||
props = modifyProps(props, fallbackProps, role); | ||
props = _victoryCore.Axis.modifyProps(props, fallbackProps); | ||
var calculatedValues = getCalculatedValues(props); | ||
@@ -433,0 +411,0 @@ var axis = calculatedValues.axis, |
@@ -215,6 +215,5 @@ "use strict"; | ||
value: function render() { | ||
var animationWhitelist = VictoryAxis.animationWhitelist, | ||
role = VictoryAxis.role; | ||
var animationWhitelist = VictoryAxis.animationWhitelist; | ||
var props = _victoryCore.Helpers.modifyProps(this.props, fallbackProps, role); | ||
var props = _victoryCore.Axis.modifyProps(this.props, fallbackProps); | ||
@@ -221,0 +220,0 @@ if (this.shouldAnimate()) { |
{ | ||
"name": "victory-axis", | ||
"version": "33.1.0", | ||
"version": "33.1.2", | ||
"description": "Axis Component for Victory", | ||
@@ -24,3 +24,3 @@ "keywords": [ | ||
"prop-types": "^15.5.8", | ||
"victory-core": "^33.1.0" | ||
"victory-core": "^33.1.2" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
@@ -126,22 +126,2 @@ import { assign, defaults } from "lodash"; | ||
const getRole = (props) => { | ||
if (props.dependentAxis) { | ||
return props.theme && props.theme.dependentAxis ? "dependentAxis" : "axis"; | ||
} | ||
return props.theme && props.theme.independentAxis ? "independentAxis" : "axis"; | ||
}; | ||
const getShallowMergedThemeProps = (props, role) => { | ||
const axisTheme = props.theme.axis || {}; | ||
return defaults({}, props.theme[role], axisTheme); | ||
}; | ||
const modifyProps = (props, fallbackProps, role) => { | ||
if (role !== "axis") { | ||
props.theme[role] = getShallowMergedThemeProps(props, role); | ||
} | ||
return Helpers.modifyProps(props, fallbackProps, role); | ||
}; | ||
const getAxisLabelProps = (props, calculatedValues, globalTransform) => { | ||
@@ -345,4 +325,3 @@ const { style, orientation, padding, labelPadding, isVertical } = calculatedValues; | ||
const getBaseProps = (props, fallbackProps) => { | ||
const role = getRole(props); | ||
props = modifyProps(props, fallbackProps, role); | ||
props = Axis.modifyProps(props, fallbackProps); | ||
const calculatedValues = getCalculatedValues(props); | ||
@@ -349,0 +328,0 @@ const { |
@@ -6,3 +6,2 @@ import PropTypes from "prop-types"; | ||
PropTypes as CustomPropTypes, | ||
Helpers, | ||
VictoryLabel, | ||
@@ -234,4 +233,4 @@ CommonProps, | ||
render() { | ||
const { animationWhitelist, role } = VictoryAxis; | ||
const props = Helpers.modifyProps(this.props, fallbackProps, role); | ||
const { animationWhitelist } = VictoryAxis; | ||
const props = Axis.modifyProps(this.props, fallbackProps); | ||
@@ -238,0 +237,0 @@ if (this.shouldAnimate()) { |
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
18
1194460
22369
Updatedvictory-core@^33.1.2