victory-area
Advanced tools
Comparing version 33.0.1 to 33.0.5
@@ -56,4 +56,5 @@ import _assign from "lodash/assign"; | ||
horizontal = props.horizontal; | ||
var interpolation = toNewName(props.interpolation); | ||
return polar ? d3Shape.lineRadial().defined(defined).curve(d3Shape["".concat(interpolation, "Closed")]).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(d3Shape[interpolation]).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale)); | ||
var interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
var interpolationName = typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
return polar ? d3Shape.lineRadial().defined(defined).curve(interpolationFunction || d3Shape["".concat(interpolationName, "Closed")]).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(interpolationFunction || d3Shape[interpolationName]).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale)); | ||
}; | ||
@@ -64,3 +65,5 @@ | ||
scale = props.scale; | ||
return horizontal ? d3Shape.area().defined(defined).curve(d3Shape[interpolation]).x0(getY0Accessor(scale)).x1(getYAccessor(scale)).y(getXAccessor(scale)) : d3Shape.area().defined(defined).curve(d3Shape[interpolation]).x(getXAccessor(scale)).y1(getYAccessor(scale)).y0(getY0Accessor(scale)); | ||
var interpolationFunction = typeof interpolation === "function" && interpolation; | ||
var interpolationName = typeof interpolation === "string" && interpolation; | ||
return horizontal ? d3Shape.area().defined(defined).curve(interpolationFunction || d3Shape[interpolationName]).x0(getY0Accessor(scale)).x1(getYAccessor(scale)).y(getXAccessor(scale)) : d3Shape.area().defined(defined).curve(interpolationFunction || d3Shape[interpolationName]).x(getXAccessor(scale)).y1(getYAccessor(scale)).y0(getY0Accessor(scale)); | ||
}; | ||
@@ -71,4 +74,6 @@ | ||
scale = props.scale; | ||
var interpolation = toNewName(props.interpolation); | ||
return polar ? d3Shape.radialArea().defined(defined).curve(d3Shape["".concat(interpolation, "Closed")]).angle(getAngleAccessor(scale)).outerRadius(getYAccessor(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props, interpolation); | ||
var interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
var interpolationName = typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
var interpolation = interpolationFunction || interpolationName; | ||
return polar ? d3Shape.radialArea().defined(defined).curve(interpolationFunction || d3Shape["".concat(interpolationName, "Closed")]).angle(getAngleAccessor(scale)).outerRadius(getYAccessor(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props, interpolation); | ||
}; | ||
@@ -126,3 +131,3 @@ | ||
groupComponent: PropTypes.element, | ||
interpolation: PropTypes.string, | ||
interpolation: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
pathComponent: PropTypes.element | ||
@@ -129,0 +134,0 @@ }); |
@@ -87,3 +87,3 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
value: _objectSpread({}, CommonProps.baseProps, CommonProps.dataProps, { | ||
interpolation: PropTypes.oneOf(["basis", "cardinal", "catmullRom", "linear", "monotoneX", "monotoneY", "natural", "step", "stepAfter", "stepBefore"]), | ||
interpolation: PropTypes.oneOfType([PropTypes.oneOf(["basis", "cardinal", "catmullRom", "linear", "monotoneX", "monotoneY", "natural", "step", "stepAfter", "stepBefore"]), PropTypes.func]), | ||
label: CustomPropTypes.deprecated(PropTypes.string, "Use `labels` instead for individual data labels") | ||
@@ -90,0 +90,0 @@ }) |
@@ -69,4 +69,5 @@ "use strict"; | ||
horizontal = props.horizontal; | ||
var interpolation = toNewName(props.interpolation); | ||
return polar ? d3Shape.lineRadial().defined(defined).curve(d3Shape["".concat(interpolation, "Closed")]).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(d3Shape[interpolation]).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale)); | ||
var interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
var interpolationName = typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
return polar ? d3Shape.lineRadial().defined(defined).curve(interpolationFunction || d3Shape["".concat(interpolationName, "Closed")]).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : d3Shape.line().defined(defined).curve(interpolationFunction || d3Shape[interpolationName]).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale)); | ||
}; | ||
@@ -77,3 +78,5 @@ | ||
scale = props.scale; | ||
return horizontal ? d3Shape.area().defined(defined).curve(d3Shape[interpolation]).x0(getY0Accessor(scale)).x1(getYAccessor(scale)).y(getXAccessor(scale)) : d3Shape.area().defined(defined).curve(d3Shape[interpolation]).x(getXAccessor(scale)).y1(getYAccessor(scale)).y0(getY0Accessor(scale)); | ||
var interpolationFunction = typeof interpolation === "function" && interpolation; | ||
var interpolationName = typeof interpolation === "string" && interpolation; | ||
return horizontal ? d3Shape.area().defined(defined).curve(interpolationFunction || d3Shape[interpolationName]).x0(getY0Accessor(scale)).x1(getYAccessor(scale)).y(getXAccessor(scale)) : d3Shape.area().defined(defined).curve(interpolationFunction || d3Shape[interpolationName]).x(getXAccessor(scale)).y1(getYAccessor(scale)).y0(getY0Accessor(scale)); | ||
}; | ||
@@ -84,4 +87,6 @@ | ||
scale = props.scale; | ||
var interpolation = toNewName(props.interpolation); | ||
return polar ? d3Shape.radialArea().defined(defined).curve(d3Shape["".concat(interpolation, "Closed")]).angle(getAngleAccessor(scale)).outerRadius(getYAccessor(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props, interpolation); | ||
var interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
var interpolationName = typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
var interpolation = interpolationFunction || interpolationName; | ||
return polar ? d3Shape.radialArea().defined(defined).curve(interpolationFunction || d3Shape["".concat(interpolationName, "Closed")]).angle(getAngleAccessor(scale)).outerRadius(getYAccessor(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props, interpolation); | ||
}; | ||
@@ -142,3 +147,3 @@ | ||
groupComponent: _propTypes.default.element, | ||
interpolation: _propTypes.default.string, | ||
interpolation: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]), | ||
pathComponent: _propTypes.default.element | ||
@@ -145,0 +150,0 @@ }); |
@@ -102,3 +102,3 @@ "use strict"; | ||
value: _objectSpread({}, _victoryCore.CommonProps.baseProps, _victoryCore.CommonProps.dataProps, { | ||
interpolation: _propTypes.default.oneOf(["basis", "cardinal", "catmullRom", "linear", "monotoneX", "monotoneY", "natural", "step", "stepAfter", "stepBefore"]), | ||
interpolation: _propTypes.default.oneOfType([_propTypes.default.oneOf(["basis", "cardinal", "catmullRom", "linear", "monotoneX", "monotoneY", "natural", "step", "stepAfter", "stepBefore"]), _propTypes.default.func]), | ||
label: _victoryCore.PropTypes.deprecated(_propTypes.default.string, "Use `labels` instead for individual data labels") | ||
@@ -105,0 +105,0 @@ }) |
{ | ||
"name": "victory-area", | ||
"version": "33.0.1", | ||
"version": "33.0.5", | ||
"description": "Area Component for Victory", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -40,3 +40,5 @@ /*eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/ | ||
const { polar, scale, horizontal } = props; | ||
const interpolation = toNewName(props.interpolation); | ||
const interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
const interpolationName = | ||
typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
return polar | ||
@@ -46,3 +48,3 @@ ? d3Shape | ||
.defined(defined) | ||
.curve(d3Shape[`${interpolation}Closed`]) | ||
.curve(interpolationFunction || d3Shape[`${interpolationName}Closed`]) | ||
.angle(getAngleAccessor(scale)) | ||
@@ -53,3 +55,3 @@ .radius(getYAccessor(scale)) | ||
.defined(defined) | ||
.curve(d3Shape[interpolation]) | ||
.curve(interpolationFunction || d3Shape[interpolationName]) | ||
.x(horizontal ? getYAccessor(scale) : getXAccessor(scale)) | ||
@@ -61,2 +63,4 @@ .y(horizontal ? getXAccessor(scale) : getYAccessor(scale)); | ||
const { horizontal, scale } = props; | ||
const interpolationFunction = typeof interpolation === "function" && interpolation; | ||
const interpolationName = typeof interpolation === "string" && interpolation; | ||
return horizontal | ||
@@ -66,3 +70,3 @@ ? d3Shape | ||
.defined(defined) | ||
.curve(d3Shape[interpolation]) | ||
.curve(interpolationFunction || d3Shape[interpolationName]) | ||
.x0(getY0Accessor(scale)) | ||
@@ -74,3 +78,3 @@ .x1(getYAccessor(scale)) | ||
.defined(defined) | ||
.curve(d3Shape[interpolation]) | ||
.curve(interpolationFunction || d3Shape[interpolationName]) | ||
.x(getXAccessor(scale)) | ||
@@ -83,3 +87,6 @@ .y1(getYAccessor(scale)) | ||
const { polar, scale } = props; | ||
const interpolation = toNewName(props.interpolation); | ||
const interpolationFunction = typeof props.interpolation === "function" && props.interpolation; | ||
const interpolationName = | ||
typeof props.interpolation === "string" && toNewName(props.interpolation); | ||
const interpolation = interpolationFunction || interpolationName; | ||
return polar | ||
@@ -89,3 +96,3 @@ ? d3Shape | ||
.defined(defined) | ||
.curve(d3Shape[`${interpolation}Closed`]) | ||
.curve(interpolationFunction || d3Shape[`${interpolationName}Closed`]) | ||
.angle(getAngleAccessor(scale)) | ||
@@ -153,3 +160,3 @@ .outerRadius(getYAccessor(scale)) | ||
groupComponent: PropTypes.element, | ||
interpolation: PropTypes.string, | ||
interpolation: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), | ||
pathComponent: PropTypes.element | ||
@@ -156,0 +163,0 @@ }; |
@@ -40,13 +40,16 @@ import PropTypes from "prop-types"; | ||
...CommonProps.dataProps, | ||
interpolation: PropTypes.oneOf([ | ||
"basis", | ||
"cardinal", | ||
"catmullRom", | ||
"linear", | ||
"monotoneX", | ||
"monotoneY", | ||
"natural", | ||
"step", | ||
"stepAfter", | ||
"stepBefore" | ||
interpolation: PropTypes.oneOfType([ | ||
PropTypes.oneOf([ | ||
"basis", | ||
"cardinal", | ||
"catmullRom", | ||
"linear", | ||
"monotoneX", | ||
"monotoneY", | ||
"natural", | ||
"step", | ||
"stepAfter", | ||
"stepBefore" | ||
]), | ||
PropTypes.func | ||
]), | ||
@@ -53,0 +56,0 @@ label: CustomPropTypes.deprecated( |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1294638
23918