Socket
Socket
Sign inDemoInstall

recharts

Package Overview
Dependencies
Maintainers
3
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recharts - npm Package Compare versions

Comparing version 2.12.7 to 2.13.0-alpha.0

237

es6/cartesian/ErrorBar.js
var _excluded = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

@@ -11,2 +12,15 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
/**

@@ -19,109 +33,122 @@ * @fileOverview Render a group of error bar

import { filterProps } from '../util/ReactUtils';
export function ErrorBar(props) {
var offset = props.offset,
layout = props.layout,
width = props.width,
dataKey = props.dataKey,
data = props.data,
dataPointFormatter = props.dataPointFormatter,
xAxis = props.xAxis,
yAxis = props.yAxis,
others = _objectWithoutProperties(props, _excluded);
var svgProps = filterProps(others, false);
!!(props.direction === 'x' && xAxis.type !== 'number') ? process.env.NODE_ENV !== "production" ? invariant(false, 'ErrorBar requires Axis type property to be "number".') : invariant(false) : void 0;
var errorBars = data.map(function (entry) {
var _dataPointFormatter = dataPointFormatter(entry, dataKey),
x = _dataPointFormatter.x,
y = _dataPointFormatter.y,
value = _dataPointFormatter.value,
errorVal = _dataPointFormatter.errorVal;
if (!errorVal) {
return null;
}
var lineCoordinates = [];
var lowBound, highBound;
if (Array.isArray(errorVal)) {
var _errorVal = _slicedToArray(errorVal, 2);
lowBound = _errorVal[0];
highBound = _errorVal[1];
} else {
lowBound = highBound = errorVal;
}
if (layout === 'vertical') {
// error bar for horizontal charts, the y is fixed, x is a range value
var scale = xAxis.scale;
var yMid = y + offset;
var yMin = yMid + width;
var yMax = yMid - width;
var xMin = scale(value - lowBound);
var xMax = scale(value + highBound);
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var ErrorBar = /*#__PURE__*/function (_React$Component) {
_inherits(ErrorBar, _React$Component);
function ErrorBar() {
_classCallCheck(this, ErrorBar);
return _callSuper(this, ErrorBar, arguments);
}
_createClass(ErrorBar, [{
key: "render",
value: function render() {
var _this$props = this.props,
offset = _this$props.offset,
layout = _this$props.layout,
width = _this$props.width,
dataKey = _this$props.dataKey,
data = _this$props.data,
dataPointFormatter = _this$props.dataPointFormatter,
xAxis = _this$props.xAxis,
yAxis = _this$props.yAxis,
others = _objectWithoutProperties(_this$props, _excluded);
var svgProps = filterProps(others, false);
!!(this.props.direction === 'x' && xAxis.type !== 'number') ? process.env.NODE_ENV !== "production" ? invariant(false, 'ErrorBar requires Axis type property to be "number".') : invariant(false) : void 0;
var errorBars = data.map(function (entry) {
var _dataPointFormatter = dataPointFormatter(entry, dataKey),
x = _dataPointFormatter.x,
y = _dataPointFormatter.y,
value = _dataPointFormatter.value,
errorVal = _dataPointFormatter.errorVal;
if (!errorVal) {
return null;
}
var lineCoordinates = [];
var lowBound, highBound;
if (Array.isArray(errorVal)) {
var _errorVal = _slicedToArray(errorVal, 2);
lowBound = _errorVal[0];
highBound = _errorVal[1];
} else {
lowBound = highBound = errorVal;
}
if (layout === 'vertical') {
// error bar for horizontal charts, the y is fixed, x is a range value
var scale = xAxis.scale;
var yMid = y + offset;
var yMin = yMid + width;
var yMax = yMid - width;
var xMin = scale(value - lowBound);
var xMax = scale(value + highBound);
// the right line of |--|
lineCoordinates.push({
x1: xMax,
y1: yMin,
x2: xMax,
y2: yMax
});
// the middle line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMid,
x2: xMax,
y2: yMid
});
// the left line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMin,
x2: xMin,
y2: yMax
});
} else if (layout === 'horizontal') {
// error bar for horizontal charts, the x is fixed, y is a range value
var _scale = yAxis.scale;
var xMid = x + offset;
var _xMin = xMid - width;
var _xMax = xMid + width;
var _yMin = _scale(value - lowBound);
var _yMax = _scale(value + highBound);
// the right line of |--|
lineCoordinates.push({
x1: xMax,
y1: yMin,
x2: xMax,
y2: yMax
});
// the middle line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMid,
x2: xMax,
y2: yMid
});
// the left line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMin,
x2: xMin,
y2: yMax
});
} else if (layout === 'horizontal') {
// error bar for horizontal charts, the x is fixed, y is a range value
var _scale = yAxis.scale;
var xMid = x + offset;
var _xMin = xMid - width;
var _xMax = xMid + width;
var _yMin = _scale(value - lowBound);
var _yMax = _scale(value + highBound);
// the top line
lineCoordinates.push({
x1: _xMin,
y1: _yMax,
x2: _xMax,
y2: _yMax
// the top line
lineCoordinates.push({
x1: _xMin,
y1: _yMax,
x2: _xMax,
y2: _yMax
});
// the middle line
lineCoordinates.push({
x1: xMid,
y1: _yMin,
x2: xMid,
y2: _yMax
});
// the bottom line
lineCoordinates.push({
x1: _xMin,
y1: _yMin,
x2: _xMax,
y2: _yMin
});
}
return /*#__PURE__*/React.createElement(Layer, _extends({
className: "recharts-errorBar",
key: "bar-".concat(lineCoordinates.map(function (c) {
return "".concat(c.x1, "-").concat(c.x2, "-").concat(c.y1, "-").concat(c.y2);
}))
}, svgProps), lineCoordinates.map(function (coordinates) {
return /*#__PURE__*/React.createElement("line", _extends({}, coordinates, {
key: "line-".concat(coordinates.x1, "-").concat(coordinates.x2, "-").concat(coordinates.y1, "-").concat(coordinates.y2)
}));
}));
});
// the middle line
lineCoordinates.push({
x1: xMid,
y1: _yMin,
x2: xMid,
y2: _yMax
});
// the bottom line
lineCoordinates.push({
x1: _xMin,
y1: _yMin,
x2: _xMax,
y2: _yMin
});
return /*#__PURE__*/React.createElement(Layer, {
className: "recharts-errorBars"
}, errorBars);
}
return /*#__PURE__*/React.createElement(Layer, _extends({
className: "recharts-errorBar",
key: "bar-".concat(lineCoordinates.map(function (c) {
return "".concat(c.x1, "-").concat(c.x2, "-").concat(c.y1, "-").concat(c.y2);
}))
}, svgProps), lineCoordinates.map(function (coordinates) {
return /*#__PURE__*/React.createElement("line", _extends({}, coordinates, {
key: "line-".concat(coordinates.x1, "-").concat(coordinates.x2, "-").concat(coordinates.y1, "-").concat(coordinates.y2)
}));
}));
});
return /*#__PURE__*/React.createElement(Layer, {
className: "recharts-errorBars"
}, errorBars);
}
ErrorBar.defaultProps = {
}]);
return ErrorBar;
}(React.Component);
_defineProperty(ErrorBar, "defaultProps", {
stroke: 'black',

@@ -132,3 +159,3 @@ strokeWidth: 1.5,

layout: 'horizontal'
};
ErrorBar.displayName = 'ErrorBar';
});
_defineProperty(ErrorBar, "displayName", 'ErrorBar');

@@ -0,5 +1,15 @@

function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -55,32 +65,46 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }

};
export function ReferenceArea(props) {
var x1 = props.x1,
x2 = props.x2,
y1 = props.y1,
y2 = props.y2,
className = props.className,
alwaysShow = props.alwaysShow,
clipPathId = props.clipPathId;
warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
var hasX1 = isNumOrStr(x1);
var hasX2 = isNumOrStr(x2);
var hasY1 = isNumOrStr(y1);
var hasY2 = isNumOrStr(y2);
var shape = props.shape;
if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
return null;
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var ReferenceArea = /*#__PURE__*/function (_React$Component) {
_inherits(ReferenceArea, _React$Component);
function ReferenceArea() {
_classCallCheck(this, ReferenceArea);
return _callSuper(this, ReferenceArea, arguments);
}
var rect = getRect(hasX1, hasX2, hasY1, hasY2, props);
if (!rect && !shape) {
return null;
}
var clipPath = ifOverflowMatches(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
return /*#__PURE__*/React.createElement(Layer, {
className: clsx('recharts-reference-area', className)
}, ReferenceArea.renderRect(shape, _objectSpread(_objectSpread({
clipPath: clipPath
}, filterProps(props, true)), rect)), Label.renderCallByParent(props, rect));
}
ReferenceArea.displayName = 'ReferenceArea';
ReferenceArea.defaultProps = {
_createClass(ReferenceArea, [{
key: "render",
value: function render() {
var _this$props = this.props,
x1 = _this$props.x1,
x2 = _this$props.x2,
y1 = _this$props.y1,
y2 = _this$props.y2,
className = _this$props.className,
alwaysShow = _this$props.alwaysShow,
clipPathId = _this$props.clipPathId;
warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
var hasX1 = isNumOrStr(x1);
var hasX2 = isNumOrStr(x2);
var hasY1 = isNumOrStr(y1);
var hasY2 = isNumOrStr(y2);
var shape = this.props.shape;
if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
return null;
}
var rect = getRect(hasX1, hasX2, hasY1, hasY2, this.props);
if (!rect && !shape) {
return null;
}
var clipPath = ifOverflowMatches(this.props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
return /*#__PURE__*/React.createElement(Layer, {
className: clsx('recharts-reference-area', className)
}, ReferenceArea.renderRect(shape, _objectSpread(_objectSpread({
clipPath: clipPath
}, filterProps(this.props, true)), rect)), Label.renderCallByParent(this.props, rect));
}
}]);
return ReferenceArea;
}(React.Component);
_defineProperty(ReferenceArea, "displayName", 'ReferenceArea');
_defineProperty(ReferenceArea, "defaultProps", {
isFront: false,

@@ -95,4 +119,4 @@ ifOverflow: 'discard',

strokeWidth: 1
};
ReferenceArea.renderRect = function (option, props) {
});
_defineProperty(ReferenceArea, "renderRect", function (option, props) {
var rect;

@@ -109,2 +133,2 @@ if ( /*#__PURE__*/React.isValidElement(option)) {

return rect;
};
});

@@ -0,5 +1,15 @@

function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -42,40 +52,55 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }

};
export function ReferenceDot(props) {
var x = props.x,
y = props.y,
r = props.r,
alwaysShow = props.alwaysShow,
clipPathId = props.clipPathId;
var isX = isNumOrStr(x);
var isY = isNumOrStr(y);
warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
if (!isX || !isY) {
return null;
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var ReferenceDot = /*#__PURE__*/function (_React$Component) {
_inherits(ReferenceDot, _React$Component);
function ReferenceDot() {
_classCallCheck(this, ReferenceDot);
return _callSuper(this, ReferenceDot, arguments);
}
var coordinate = getCoordinate(props);
if (!coordinate) {
return null;
}
var cx = coordinate.x,
cy = coordinate.y;
var shape = props.shape,
className = props.className;
var clipPath = ifOverflowMatches(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
var dotProps = _objectSpread(_objectSpread({
clipPath: clipPath
}, filterProps(props, true)), {}, {
cx: cx,
cy: cy
});
return /*#__PURE__*/React.createElement(Layer, {
className: clsx('recharts-reference-dot', className)
}, ReferenceDot.renderDot(shape, dotProps), Label.renderCallByParent(props, {
x: cx - r,
y: cy - r,
width: 2 * r,
height: 2 * r
}));
}
ReferenceDot.displayName = 'ReferenceDot';
ReferenceDot.defaultProps = {
_createClass(ReferenceDot, [{
key: "render",
value: function render() {
var _this$props = this.props,
x = _this$props.x,
y = _this$props.y,
r = _this$props.r,
alwaysShow = _this$props.alwaysShow,
clipPathId = _this$props.clipPathId;
var isX = isNumOrStr(x);
var isY = isNumOrStr(y);
warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
if (!isX || !isY) {
return null;
}
var coordinate = getCoordinate(this.props);
if (!coordinate) {
return null;
}
var cx = coordinate.x,
cy = coordinate.y;
var _this$props2 = this.props,
shape = _this$props2.shape,
className = _this$props2.className;
var clipPath = ifOverflowMatches(this.props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
var dotProps = _objectSpread(_objectSpread({
clipPath: clipPath
}, filterProps(this.props, true)), {}, {
cx: cx,
cy: cy
});
return /*#__PURE__*/React.createElement(Layer, {
className: clsx('recharts-reference-dot', className)
}, ReferenceDot.renderDot(shape, dotProps), Label.renderCallByParent(this.props, {
x: cx - r,
y: cy - r,
width: 2 * r,
height: 2 * r
}));
}
}]);
return ReferenceDot;
}(React.Component);
_defineProperty(ReferenceDot, "displayName", 'ReferenceDot');
_defineProperty(ReferenceDot, "defaultProps", {
isFront: false,

@@ -90,4 +115,4 @@ ifOverflow: 'discard',

strokeWidth: 1
};
ReferenceDot.renderDot = function (option, props) {
});
_defineProperty(ReferenceDot, "renderDot", function (option, props) {
var dot;

@@ -106,2 +131,2 @@ if ( /*#__PURE__*/React.isValidElement(option)) {

return dot;
};
});
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }

@@ -106,3 +116,3 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

};
export function ReferenceLine(props) {
function ReferenceLineImpl(props) {
var fixedX = props.x,

@@ -160,4 +170,20 @@ fixedY = props.y,

}
ReferenceLine.displayName = 'ReferenceLine';
ReferenceLine.defaultProps = {
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var ReferenceLine = /*#__PURE__*/function (_React$Component) {
_inherits(ReferenceLine, _React$Component);
function ReferenceLine() {
_classCallCheck(this, ReferenceLine);
return _callSuper(this, ReferenceLine, arguments);
}
_createClass(ReferenceLine, [{
key: "render",
value: function render() {
return /*#__PURE__*/React.createElement(ReferenceLineImpl, this.props);
}
}]);
return ReferenceLine;
}(React.Component);
_defineProperty(ReferenceLine, "displayName", 'ReferenceLine');
_defineProperty(ReferenceLine, "defaultProps", {
isFront: false,

@@ -172,2 +198,2 @@ ifOverflow: 'discard',

position: 'middle'
};
});

@@ -0,1 +1,15 @@

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

@@ -14,3 +28,3 @@ /**

export var XAxis = function XAxis(_ref) {
function XAxisImpl(_ref) {
var xAxisId = _ref.xAxisId;

@@ -39,5 +53,21 @@ var width = useChartWidth();

);
};
XAxis.displayName = 'XAxis';
XAxis.defaultProps = {
}
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var XAxis = /*#__PURE__*/function (_React$Component) {
_inherits(XAxis, _React$Component);
function XAxis() {
_classCallCheck(this, XAxis);
return _callSuper(this, XAxis, arguments);
}
_createClass(XAxis, [{
key: "render",
value: function render() {
return /*#__PURE__*/React.createElement(XAxisImpl, this.props);
}
}]);
return XAxis;
}(React.Component);
_defineProperty(XAxis, "displayName", 'XAxis');
_defineProperty(XAxis, "defaultProps", {
allowDecimals: true,

@@ -60,2 +90,2 @@ hide: false,

allowDuplicatedCategory: true
};
});

@@ -0,1 +1,15 @@

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

@@ -10,3 +24,3 @@ /**

import { getTicksOfAxis } from '../util/ChartUtils';
export var YAxis = function YAxis(_ref) {
var YAxisImpl = function YAxisImpl(_ref) {
var yAxisId = _ref.yAxisId;

@@ -36,4 +50,20 @@ var width = useChartWidth();

};
YAxis.displayName = 'YAxis';
YAxis.defaultProps = {
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var YAxis = /*#__PURE__*/function (_React$Component) {
_inherits(YAxis, _React$Component);
function YAxis() {
_classCallCheck(this, YAxis);
return _callSuper(this, YAxis, arguments);
}
_createClass(YAxis, [{
key: "render",
value: function render() {
return /*#__PURE__*/React.createElement(YAxisImpl, this.props);
}
}]);
return YAxis;
}(React.Component);
_defineProperty(YAxis, "displayName", 'YAxis');
_defineProperty(YAxis, "defaultProps", {
allowDuplicatedCategory: true,

@@ -56,2 +86,2 @@ allowDecimals: true,

reversed: false
};
});

@@ -0,10 +1,36 @@

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
/**
* @fileOverview Z Axis
*/
export var ZAxis = function ZAxis() {
return null;
};
ZAxis.displayName = 'ZAxis';
ZAxis.defaultProps = {
import React from 'react';
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
export var ZAxis = /*#__PURE__*/function (_React$Component) {
_inherits(ZAxis, _React$Component);
function ZAxis() {
_classCallCheck(this, ZAxis);
return _callSuper(this, ZAxis, arguments);
}
_createClass(ZAxis, [{
key: "render",
value: function render() {
return null;
}
}]);
return ZAxis;
}(React.Component);
_defineProperty(ZAxis, "displayName", 'ZAxis');
_defineProperty(ZAxis, "defaultProps", {
zAxisId: 0,

@@ -14,2 +40,2 @@ range: [64, 64],

type: 'number'
};
});

@@ -433,7 +433,6 @@ var _Pie;

});
_defineProperty(Pie, "getRealPieData", function (item) {
var _item$props = item.props,
data = _item$props.data,
children = _item$props.children;
var presentationProps = filterProps(item.props, false);
_defineProperty(Pie, "getRealPieData", function (itemProps) {
var data = itemProps.data,
children = itemProps.children;
var presentationProps = filterProps(itemProps, false);
var cells = findAllByType(children, Cell);

@@ -454,3 +453,3 @@ if (data && data.length) {

});
_defineProperty(Pie, "parseCoordinateOfPie", function (item, offset) {
_defineProperty(Pie, "parseCoordinateOfPie", function (itemProps, offset) {
var top = offset.top,

@@ -461,7 +460,7 @@ left = offset.left,

var maxPieRadius = getMaxRadius(width, height);
var cx = left + getPercentValue(item.props.cx, width, width / 2);
var cy = top + getPercentValue(item.props.cy, height, height / 2);
var innerRadius = getPercentValue(item.props.innerRadius, maxPieRadius, 0);
var outerRadius = getPercentValue(item.props.outerRadius, maxPieRadius, maxPieRadius * 0.8);
var maxRadius = item.props.maxRadius || Math.sqrt(width * width + height * height) / 2;
var cx = left + getPercentValue(itemProps.cx, width, width / 2);
var cy = top + getPercentValue(itemProps.cy, height, height / 2);
var innerRadius = getPercentValue(itemProps.innerRadius, maxPieRadius, 0);
var outerRadius = getPercentValue(itemProps.outerRadius, maxPieRadius, maxPieRadius * 0.8);
var maxRadius = itemProps.maxRadius || Math.sqrt(width * width + height * height) / 2;
return {

@@ -478,17 +477,17 @@ cx: cx,

offset = _ref4.offset;
var pieData = _Pie.getRealPieData(item);
var itemProps = item.type.defaultProps !== undefined ? _objectSpread(_objectSpread({}, item.type.defaultProps), item.props) : item.props;
var pieData = _Pie.getRealPieData(itemProps);
if (!pieData || !pieData.length) {
return null;
}
var _item$props2 = item.props,
cornerRadius = _item$props2.cornerRadius,
startAngle = _item$props2.startAngle,
endAngle = _item$props2.endAngle,
paddingAngle = _item$props2.paddingAngle,
dataKey = _item$props2.dataKey,
nameKey = _item$props2.nameKey,
valueKey = _item$props2.valueKey,
tooltipType = _item$props2.tooltipType;
var minAngle = Math.abs(item.props.minAngle);
var coordinate = _Pie.parseCoordinateOfPie(item, offset);
var cornerRadius = itemProps.cornerRadius,
startAngle = itemProps.startAngle,
endAngle = itemProps.endAngle,
paddingAngle = itemProps.paddingAngle,
dataKey = itemProps.dataKey,
nameKey = itemProps.nameKey,
valueKey = itemProps.valueKey,
tooltipType = itemProps.tooltipType;
var minAngle = Math.abs(itemProps.minAngle);
var coordinate = _Pie.parseCoordinateOfPie(itemProps, offset);
var deltaAngle = _Pie.parseDeltaAngle(startAngle, endAngle);

@@ -495,0 +494,0 @@ var absDeltaAngle = Math.abs(deltaAngle);

@@ -6,3 +6,3 @@ "use strict";

});
exports.ErrorBar = ErrorBar;
exports.ErrorBar = void 0;
var _react = _interopRequireDefault(require("react"));

@@ -13,6 +13,4 @@ var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));

var _excluded = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
/**
* @fileOverview Render a group of error bar
*/
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

@@ -27,109 +25,137 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function ErrorBar(props) {
var offset = props.offset,
layout = props.layout,
width = props.width,
dataKey = props.dataKey,
data = props.data,
dataPointFormatter = props.dataPointFormatter,
xAxis = props.xAxis,
yAxis = props.yAxis,
others = _objectWithoutProperties(props, _excluded);
var svgProps = (0, _ReactUtils.filterProps)(others, false);
!!(props.direction === 'x' && xAxis.type !== 'number') ? process.env.NODE_ENV !== "production" ? (0, _tinyInvariant["default"])(false, 'ErrorBar requires Axis type property to be "number".') : (0, _tinyInvariant["default"])(false) : void 0;
var errorBars = data.map(function (entry) {
var _dataPointFormatter = dataPointFormatter(entry, dataKey),
x = _dataPointFormatter.x,
y = _dataPointFormatter.y,
value = _dataPointFormatter.value,
errorVal = _dataPointFormatter.errorVal;
if (!errorVal) {
return null;
}
var lineCoordinates = [];
var lowBound, highBound;
if (Array.isArray(errorVal)) {
var _errorVal = _slicedToArray(errorVal, 2);
lowBound = _errorVal[0];
highBound = _errorVal[1];
} else {
lowBound = highBound = errorVal;
}
if (layout === 'vertical') {
// error bar for horizontal charts, the y is fixed, x is a range value
var scale = xAxis.scale;
var yMid = y + offset;
var yMin = yMid + width;
var yMax = yMid - width;
var xMin = scale(value - lowBound);
var xMax = scale(value + highBound);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* @fileOverview Render a group of error bar
*/
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var ErrorBar = exports.ErrorBar = /*#__PURE__*/function (_React$Component) {
_inherits(ErrorBar, _React$Component);
function ErrorBar() {
_classCallCheck(this, ErrorBar);
return _callSuper(this, ErrorBar, arguments);
}
_createClass(ErrorBar, [{
key: "render",
value: function render() {
var _this$props = this.props,
offset = _this$props.offset,
layout = _this$props.layout,
width = _this$props.width,
dataKey = _this$props.dataKey,
data = _this$props.data,
dataPointFormatter = _this$props.dataPointFormatter,
xAxis = _this$props.xAxis,
yAxis = _this$props.yAxis,
others = _objectWithoutProperties(_this$props, _excluded);
var svgProps = (0, _ReactUtils.filterProps)(others, false);
!!(this.props.direction === 'x' && xAxis.type !== 'number') ? process.env.NODE_ENV !== "production" ? (0, _tinyInvariant["default"])(false, 'ErrorBar requires Axis type property to be "number".') : (0, _tinyInvariant["default"])(false) : void 0;
var errorBars = data.map(function (entry) {
var _dataPointFormatter = dataPointFormatter(entry, dataKey),
x = _dataPointFormatter.x,
y = _dataPointFormatter.y,
value = _dataPointFormatter.value,
errorVal = _dataPointFormatter.errorVal;
if (!errorVal) {
return null;
}
var lineCoordinates = [];
var lowBound, highBound;
if (Array.isArray(errorVal)) {
var _errorVal = _slicedToArray(errorVal, 2);
lowBound = _errorVal[0];
highBound = _errorVal[1];
} else {
lowBound = highBound = errorVal;
}
if (layout === 'vertical') {
// error bar for horizontal charts, the y is fixed, x is a range value
var scale = xAxis.scale;
var yMid = y + offset;
var yMin = yMid + width;
var yMax = yMid - width;
var xMin = scale(value - lowBound);
var xMax = scale(value + highBound);
// the right line of |--|
lineCoordinates.push({
x1: xMax,
y1: yMin,
x2: xMax,
y2: yMax
});
// the middle line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMid,
x2: xMax,
y2: yMid
});
// the left line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMin,
x2: xMin,
y2: yMax
});
} else if (layout === 'horizontal') {
// error bar for horizontal charts, the x is fixed, y is a range value
var _scale = yAxis.scale;
var xMid = x + offset;
var _xMin = xMid - width;
var _xMax = xMid + width;
var _yMin = _scale(value - lowBound);
var _yMax = _scale(value + highBound);
// the right line of |--|
lineCoordinates.push({
x1: xMax,
y1: yMin,
x2: xMax,
y2: yMax
});
// the middle line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMid,
x2: xMax,
y2: yMid
});
// the left line of |--|
lineCoordinates.push({
x1: xMin,
y1: yMin,
x2: xMin,
y2: yMax
});
} else if (layout === 'horizontal') {
// error bar for horizontal charts, the x is fixed, y is a range value
var _scale = yAxis.scale;
var xMid = x + offset;
var _xMin = xMid - width;
var _xMax = xMid + width;
var _yMin = _scale(value - lowBound);
var _yMax = _scale(value + highBound);
// the top line
lineCoordinates.push({
x1: _xMin,
y1: _yMax,
x2: _xMax,
y2: _yMax
// the top line
lineCoordinates.push({
x1: _xMin,
y1: _yMax,
x2: _xMax,
y2: _yMax
});
// the middle line
lineCoordinates.push({
x1: xMid,
y1: _yMin,
x2: xMid,
y2: _yMax
});
// the bottom line
lineCoordinates.push({
x1: _xMin,
y1: _yMin,
x2: _xMax,
y2: _yMin
});
}
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, _extends({
className: "recharts-errorBar",
key: "bar-".concat(lineCoordinates.map(function (c) {
return "".concat(c.x1, "-").concat(c.x2, "-").concat(c.y1, "-").concat(c.y2);
}))
}, svgProps), lineCoordinates.map(function (coordinates) {
return /*#__PURE__*/_react["default"].createElement("line", _extends({}, coordinates, {
key: "line-".concat(coordinates.x1, "-").concat(coordinates.x2, "-").concat(coordinates.y1, "-").concat(coordinates.y2)
}));
}));
});
// the middle line
lineCoordinates.push({
x1: xMid,
y1: _yMin,
x2: xMid,
y2: _yMax
});
// the bottom line
lineCoordinates.push({
x1: _xMin,
y1: _yMin,
x2: _xMax,
y2: _yMin
});
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, {
className: "recharts-errorBars"
}, errorBars);
}
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, _extends({
className: "recharts-errorBar",
key: "bar-".concat(lineCoordinates.map(function (c) {
return "".concat(c.x1, "-").concat(c.x2, "-").concat(c.y1, "-").concat(c.y2);
}))
}, svgProps), lineCoordinates.map(function (coordinates) {
return /*#__PURE__*/_react["default"].createElement("line", _extends({}, coordinates, {
key: "line-".concat(coordinates.x1, "-").concat(coordinates.x2, "-").concat(coordinates.y1, "-").concat(coordinates.y2)
}));
}));
});
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, {
className: "recharts-errorBars"
}, errorBars);
}
ErrorBar.defaultProps = {
}]);
return ErrorBar;
}(_react["default"].Component);
_defineProperty(ErrorBar, "defaultProps", {
stroke: 'black',

@@ -140,3 +166,3 @@ strokeWidth: 1.5,

layout: 'horizontal'
};
ErrorBar.displayName = 'ErrorBar';
});
_defineProperty(ErrorBar, "displayName", 'ErrorBar');

@@ -6,3 +6,3 @@ "use strict";

});
exports.ReferenceArea = ReferenceArea;
exports.ReferenceArea = void 0;
var _react = _interopRequireDefault(require("react"));

@@ -20,6 +20,16 @@ var _isFunction = _interopRequireDefault(require("lodash/isFunction"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -63,32 +73,46 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }

};
function ReferenceArea(props) {
var x1 = props.x1,
x2 = props.x2,
y1 = props.y1,
y2 = props.y2,
className = props.className,
alwaysShow = props.alwaysShow,
clipPathId = props.clipPathId;
(0, _LogUtils.warn)(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
var hasX1 = (0, _DataUtils.isNumOrStr)(x1);
var hasX2 = (0, _DataUtils.isNumOrStr)(x2);
var hasY1 = (0, _DataUtils.isNumOrStr)(y1);
var hasY2 = (0, _DataUtils.isNumOrStr)(y2);
var shape = props.shape;
if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
return null;
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var ReferenceArea = exports.ReferenceArea = /*#__PURE__*/function (_React$Component) {
_inherits(ReferenceArea, _React$Component);
function ReferenceArea() {
_classCallCheck(this, ReferenceArea);
return _callSuper(this, ReferenceArea, arguments);
}
var rect = getRect(hasX1, hasX2, hasY1, hasY2, props);
if (!rect && !shape) {
return null;
}
var clipPath = (0, _IfOverflowMatches.ifOverflowMatches)(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, {
className: (0, _clsx["default"])('recharts-reference-area', className)
}, ReferenceArea.renderRect(shape, _objectSpread(_objectSpread({
clipPath: clipPath
}, (0, _ReactUtils.filterProps)(props, true)), rect)), _Label.Label.renderCallByParent(props, rect));
}
ReferenceArea.displayName = 'ReferenceArea';
ReferenceArea.defaultProps = {
_createClass(ReferenceArea, [{
key: "render",
value: function render() {
var _this$props = this.props,
x1 = _this$props.x1,
x2 = _this$props.x2,
y1 = _this$props.y1,
y2 = _this$props.y2,
className = _this$props.className,
alwaysShow = _this$props.alwaysShow,
clipPathId = _this$props.clipPathId;
(0, _LogUtils.warn)(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
var hasX1 = (0, _DataUtils.isNumOrStr)(x1);
var hasX2 = (0, _DataUtils.isNumOrStr)(x2);
var hasY1 = (0, _DataUtils.isNumOrStr)(y1);
var hasY2 = (0, _DataUtils.isNumOrStr)(y2);
var shape = this.props.shape;
if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
return null;
}
var rect = getRect(hasX1, hasX2, hasY1, hasY2, this.props);
if (!rect && !shape) {
return null;
}
var clipPath = (0, _IfOverflowMatches.ifOverflowMatches)(this.props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, {
className: (0, _clsx["default"])('recharts-reference-area', className)
}, ReferenceArea.renderRect(shape, _objectSpread(_objectSpread({
clipPath: clipPath
}, (0, _ReactUtils.filterProps)(this.props, true)), rect)), _Label.Label.renderCallByParent(this.props, rect));
}
}]);
return ReferenceArea;
}(_react["default"].Component);
_defineProperty(ReferenceArea, "displayName", 'ReferenceArea');
_defineProperty(ReferenceArea, "defaultProps", {
isFront: false,

@@ -103,4 +127,4 @@ ifOverflow: 'discard',

strokeWidth: 1
};
ReferenceArea.renderRect = function (option, props) {
});
_defineProperty(ReferenceArea, "renderRect", function (option, props) {
var rect;

@@ -117,2 +141,2 @@ if ( /*#__PURE__*/_react["default"].isValidElement(option)) {

return rect;
};
});

@@ -6,3 +6,3 @@ "use strict";

});
exports.ReferenceDot = ReferenceDot;
exports.ReferenceDot = void 0;
var _react = _interopRequireDefault(require("react"));

@@ -20,6 +20,16 @@ var _isFunction = _interopRequireDefault(require("lodash/isFunction"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -50,40 +60,55 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }

};
function ReferenceDot(props) {
var x = props.x,
y = props.y,
r = props.r,
alwaysShow = props.alwaysShow,
clipPathId = props.clipPathId;
var isX = (0, _DataUtils.isNumOrStr)(x);
var isY = (0, _DataUtils.isNumOrStr)(y);
(0, _LogUtils.warn)(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
if (!isX || !isY) {
return null;
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var ReferenceDot = exports.ReferenceDot = /*#__PURE__*/function (_React$Component) {
_inherits(ReferenceDot, _React$Component);
function ReferenceDot() {
_classCallCheck(this, ReferenceDot);
return _callSuper(this, ReferenceDot, arguments);
}
var coordinate = getCoordinate(props);
if (!coordinate) {
return null;
}
var cx = coordinate.x,
cy = coordinate.y;
var shape = props.shape,
className = props.className;
var clipPath = (0, _IfOverflowMatches.ifOverflowMatches)(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
var dotProps = _objectSpread(_objectSpread({
clipPath: clipPath
}, (0, _ReactUtils.filterProps)(props, true)), {}, {
cx: cx,
cy: cy
});
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, {
className: (0, _clsx["default"])('recharts-reference-dot', className)
}, ReferenceDot.renderDot(shape, dotProps), _Label.Label.renderCallByParent(props, {
x: cx - r,
y: cy - r,
width: 2 * r,
height: 2 * r
}));
}
ReferenceDot.displayName = 'ReferenceDot';
ReferenceDot.defaultProps = {
_createClass(ReferenceDot, [{
key: "render",
value: function render() {
var _this$props = this.props,
x = _this$props.x,
y = _this$props.y,
r = _this$props.r,
alwaysShow = _this$props.alwaysShow,
clipPathId = _this$props.clipPathId;
var isX = (0, _DataUtils.isNumOrStr)(x);
var isY = (0, _DataUtils.isNumOrStr)(y);
(0, _LogUtils.warn)(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
if (!isX || !isY) {
return null;
}
var coordinate = getCoordinate(this.props);
if (!coordinate) {
return null;
}
var cx = coordinate.x,
cy = coordinate.y;
var _this$props2 = this.props,
shape = _this$props2.shape,
className = _this$props2.className;
var clipPath = (0, _IfOverflowMatches.ifOverflowMatches)(this.props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
var dotProps = _objectSpread(_objectSpread({
clipPath: clipPath
}, (0, _ReactUtils.filterProps)(this.props, true)), {}, {
cx: cx,
cy: cy
});
return /*#__PURE__*/_react["default"].createElement(_Layer.Layer, {
className: (0, _clsx["default"])('recharts-reference-dot', className)
}, ReferenceDot.renderDot(shape, dotProps), _Label.Label.renderCallByParent(this.props, {
x: cx - r,
y: cy - r,
width: 2 * r,
height: 2 * r
}));
}
}]);
return ReferenceDot;
}(_react["default"].Component);
_defineProperty(ReferenceDot, "displayName", 'ReferenceDot');
_defineProperty(ReferenceDot, "defaultProps", {
isFront: false,

@@ -98,4 +123,4 @@ ifOverflow: 'discard',

strokeWidth: 1
};
ReferenceDot.renderDot = function (option, props) {
});
_defineProperty(ReferenceDot, "renderDot", function (option, props) {
var dot;

@@ -114,2 +139,2 @@ if ( /*#__PURE__*/_react["default"].isValidElement(option)) {

return dot;
};
});

@@ -7,4 +7,3 @@ "use strict";

});
exports.ReferenceLine = ReferenceLine;
exports.getEndPoints = void 0;
exports.getEndPoints = exports.ReferenceLine = void 0;
var _react = _interopRequireDefault(require("react"));

@@ -23,2 +22,12 @@ var _isFunction = _interopRequireDefault(require("lodash/isFunction"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }

@@ -114,3 +123,3 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

};
function ReferenceLine(props) {
function ReferenceLineImpl(props) {
var fixedX = props.x,

@@ -168,4 +177,20 @@ fixedY = props.y,

}
ReferenceLine.displayName = 'ReferenceLine';
ReferenceLine.defaultProps = {
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var ReferenceLine = exports.ReferenceLine = /*#__PURE__*/function (_React$Component) {
_inherits(ReferenceLine, _React$Component);
function ReferenceLine() {
_classCallCheck(this, ReferenceLine);
return _callSuper(this, ReferenceLine, arguments);
}
_createClass(ReferenceLine, [{
key: "render",
value: function render() {
return /*#__PURE__*/_react["default"].createElement(ReferenceLineImpl, this.props);
}
}]);
return ReferenceLine;
}(_react["default"].Component);
_defineProperty(ReferenceLine, "displayName", 'ReferenceLine');
_defineProperty(ReferenceLine, "defaultProps", {
isFront: false,

@@ -180,2 +205,2 @@ ifOverflow: 'discard',

position: 'middle'
};
});
"use strict";
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {

@@ -13,2 +14,15 @@ value: true

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /**

@@ -19,3 +33,3 @@ * @fileOverview X Axis

var XAxis = exports.XAxis = function XAxis(_ref) {
function XAxisImpl(_ref) {
var xAxisId = _ref.xAxisId;

@@ -44,5 +58,21 @@ var width = (0, _chartLayoutContext.useChartWidth)();

);
};
XAxis.displayName = 'XAxis';
XAxis.defaultProps = {
}
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var XAxis = exports.XAxis = /*#__PURE__*/function (_React$Component) {
_inherits(XAxis, _React$Component);
function XAxis() {
_classCallCheck(this, XAxis);
return _callSuper(this, XAxis, arguments);
}
_createClass(XAxis, [{
key: "render",
value: function render() {
return /*#__PURE__*/_react["default"].createElement(XAxisImpl, this.props);
}
}]);
return XAxis;
}(_react["default"].Component);
_defineProperty(XAxis, "displayName", 'XAxis');
_defineProperty(XAxis, "defaultProps", {
allowDecimals: true,

@@ -65,2 +95,2 @@ hide: false,

allowDuplicatedCategory: true
};
});
"use strict";
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {

@@ -13,6 +14,19 @@ value: true

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /**
* @fileOverview Y Axis
*/
var YAxis = exports.YAxis = function YAxis(_ref) {
var YAxisImpl = function YAxisImpl(_ref) {
var yAxisId = _ref.yAxisId;

@@ -42,4 +56,20 @@ var width = (0, _chartLayoutContext.useChartWidth)();

};
YAxis.displayName = 'YAxis';
YAxis.defaultProps = {
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var YAxis = exports.YAxis = /*#__PURE__*/function (_React$Component) {
_inherits(YAxis, _React$Component);
function YAxis() {
_classCallCheck(this, YAxis);
return _callSuper(this, YAxis, arguments);
}
_createClass(YAxis, [{
key: "render",
value: function render() {
return /*#__PURE__*/_react["default"].createElement(YAxisImpl, this.props);
}
}]);
return YAxis;
}(_react["default"].Component);
_defineProperty(YAxis, "displayName", 'YAxis');
_defineProperty(YAxis, "defaultProps", {
allowDuplicatedCategory: true,

@@ -62,2 +92,2 @@ allowDecimals: true,

reversed: false
};
});

@@ -7,11 +7,37 @@ "use strict";

exports.ZAxis = void 0;
/**
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* @fileOverview Z Axis
*/
var ZAxis = exports.ZAxis = function ZAxis() {
return null;
};
ZAxis.displayName = 'ZAxis';
ZAxis.defaultProps = {
// eslint-disable-next-line react/prefer-stateless-function -- requires static defaultProps
var ZAxis = exports.ZAxis = /*#__PURE__*/function (_React$Component) {
_inherits(ZAxis, _React$Component);
function ZAxis() {
_classCallCheck(this, ZAxis);
return _callSuper(this, ZAxis, arguments);
}
_createClass(ZAxis, [{
key: "render",
value: function render() {
return null;
}
}]);
return ZAxis;
}(_react["default"].Component);
_defineProperty(ZAxis, "displayName", 'ZAxis');
_defineProperty(ZAxis, "defaultProps", {
zAxisId: 0,

@@ -21,2 +47,2 @@ range: [64, 64],

type: 'number'
};
});

@@ -441,7 +441,6 @@ "use strict";

});
_defineProperty(Pie, "getRealPieData", function (item) {
var _item$props = item.props,
data = _item$props.data,
children = _item$props.children;
var presentationProps = (0, _ReactUtils.filterProps)(item.props, false);
_defineProperty(Pie, "getRealPieData", function (itemProps) {
var data = itemProps.data,
children = itemProps.children;
var presentationProps = (0, _ReactUtils.filterProps)(itemProps, false);
var cells = (0, _ReactUtils.findAllByType)(children, _Cell.Cell);

@@ -462,3 +461,3 @@ if (data && data.length) {

});
_defineProperty(Pie, "parseCoordinateOfPie", function (item, offset) {
_defineProperty(Pie, "parseCoordinateOfPie", function (itemProps, offset) {
var top = offset.top,

@@ -469,7 +468,7 @@ left = offset.left,

var maxPieRadius = (0, _PolarUtils.getMaxRadius)(width, height);
var cx = left + (0, _DataUtils.getPercentValue)(item.props.cx, width, width / 2);
var cy = top + (0, _DataUtils.getPercentValue)(item.props.cy, height, height / 2);
var innerRadius = (0, _DataUtils.getPercentValue)(item.props.innerRadius, maxPieRadius, 0);
var outerRadius = (0, _DataUtils.getPercentValue)(item.props.outerRadius, maxPieRadius, maxPieRadius * 0.8);
var maxRadius = item.props.maxRadius || Math.sqrt(width * width + height * height) / 2;
var cx = left + (0, _DataUtils.getPercentValue)(itemProps.cx, width, width / 2);
var cy = top + (0, _DataUtils.getPercentValue)(itemProps.cy, height, height / 2);
var innerRadius = (0, _DataUtils.getPercentValue)(itemProps.innerRadius, maxPieRadius, 0);
var outerRadius = (0, _DataUtils.getPercentValue)(itemProps.outerRadius, maxPieRadius, maxPieRadius * 0.8);
var maxRadius = itemProps.maxRadius || Math.sqrt(width * width + height * height) / 2;
return {

@@ -486,17 +485,17 @@ cx: cx,

offset = _ref4.offset;
var pieData = _Pie.getRealPieData(item);
var itemProps = item.type.defaultProps !== undefined ? _objectSpread(_objectSpread({}, item.type.defaultProps), item.props) : item.props;
var pieData = _Pie.getRealPieData(itemProps);
if (!pieData || !pieData.length) {
return null;
}
var _item$props2 = item.props,
cornerRadius = _item$props2.cornerRadius,
startAngle = _item$props2.startAngle,
endAngle = _item$props2.endAngle,
paddingAngle = _item$props2.paddingAngle,
dataKey = _item$props2.dataKey,
nameKey = _item$props2.nameKey,
valueKey = _item$props2.valueKey,
tooltipType = _item$props2.tooltipType;
var minAngle = Math.abs(item.props.minAngle);
var coordinate = _Pie.parseCoordinateOfPie(item, offset);
var cornerRadius = itemProps.cornerRadius,
startAngle = itemProps.startAngle,
endAngle = itemProps.endAngle,
paddingAngle = itemProps.paddingAngle,
dataKey = itemProps.dataKey,
nameKey = itemProps.nameKey,
valueKey = itemProps.valueKey,
tooltipType = itemProps.tooltipType;
var minAngle = Math.abs(itemProps.minAngle);
var coordinate = _Pie.parseCoordinateOfPie(itemProps, offset);
var deltaAngle = _Pie.parseDeltaAngle(startAngle, endAngle);

@@ -503,0 +502,0 @@ var absDeltaAngle = Math.abs(deltaAngle);

{
"name": "recharts",
"version": "2.12.7",
"version": "2.13.0-alpha.0",
"description": "React charts",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -33,5 +33,4 @@ import React, { SVGProps } from 'react';

export type Props = SVGProps<SVGLineElement> & ErrorBarProps;
export declare function ErrorBar(props: Props): React.JSX.Element;
export declare namespace ErrorBar {
var defaultProps: {
export declare class ErrorBar extends React.Component<Props> {
static defaultProps: {
stroke: string;

@@ -43,4 +42,5 @@ strokeWidth: number;

};
var displayName: string;
static displayName: string;
render(): React.JSX.Element;
}
export {};

@@ -33,6 +33,5 @@ import React, { ReactElement } from 'react';

export type Props = RectangleProps & ReferenceAreaProps;
export declare function ReferenceArea(props: Props): React.JSX.Element;
export declare namespace ReferenceArea {
var displayName: string;
var defaultProps: {
export declare class ReferenceArea extends React.Component<Props> {
static displayName: string;
static defaultProps: {
isFront: boolean;

@@ -48,4 +47,5 @@ ifOverflow: string;

};
var renderRect: (option: React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>> | ((props: any) => React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>>), props: any) => React.JSX.Element;
static renderRect: (option: ReferenceAreaProps['shape'], props: any) => React.JSX.Element;
render(): React.JSX.Element;
}
export {};

@@ -31,6 +31,5 @@ import React, { ReactElement } from 'react';

export type Props = DotProps & ReferenceDotProps;
export declare function ReferenceDot(props: Props): React.JSX.Element;
export declare namespace ReferenceDot {
var displayName: string;
var defaultProps: {
export declare class ReferenceDot extends React.Component<Props> {
static displayName: string;
static defaultProps: {
isFront: boolean;

@@ -46,4 +45,5 @@ ifOverflow: string;

};
var renderDot: (option: React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>> | ((props: any) => React.ReactElement<SVGElement, string | React.JSXElementConstructor<any>>), props: any) => React.JSX.Element;
static renderDot: (option: Props['shape'], props: any) => React.JSX.Element;
render(): React.JSX.Element;
}
export {};

@@ -45,6 +45,5 @@ import React, { ReactElement, SVGProps } from 'react';

export declare const getEndPoints: (scales: any, isFixedX: boolean, isFixedY: boolean, isSegment: boolean, viewBox: CartesianViewBox, position: Props['position'], xAxisOrientation: XAxisProps['orientation'], yAxisOrientation: YAxisProps['orientation'], props: EndPointsPropsSubset) => any[];
export declare function ReferenceLine(props: Props): React.JSX.Element;
export declare namespace ReferenceLine {
var displayName: string;
var defaultProps: {
export declare class ReferenceLine extends React.Component {
static displayName: string;
static defaultProps: {
isFront: boolean;

@@ -60,3 +59,4 @@ ifOverflow: string;

};
render(): React.JSX.Element;
}
export {};

@@ -1,2 +0,3 @@

import type { FunctionComponent, SVGProps } from 'react';
import type { SVGProps } from 'react';
import React from 'react';
import { BaseAxisProps, AxisInterval } from '../util/types';

@@ -21,3 +22,25 @@ interface XAxisProps extends BaseAxisProps {

export type Props = Omit<SVGProps<SVGElement>, 'scale'> & XAxisProps;
export declare const XAxis: FunctionComponent<Props>;
export declare class XAxis extends React.Component<Props> {
static displayName: string;
static defaultProps: {
allowDecimals: boolean;
hide: boolean;
orientation: string;
width: number;
height: number;
mirror: boolean;
xAxisId: number;
tickCount: number;
type: string;
padding: {
left: number;
right: number;
};
allowDataOverflow: boolean;
scale: string;
reversed: boolean;
allowDuplicatedCategory: boolean;
};
render(): React.JSX.Element;
}
export {};

@@ -1,2 +0,3 @@

import type { FunctionComponent, SVGProps } from 'react';
import React from 'react';
import type { SVGProps } from 'react';
import { BaseAxisProps, AxisInterval } from '../util/types';

@@ -20,3 +21,25 @@ interface YAxisProps extends BaseAxisProps {

export type Props = Omit<SVGProps<SVGElement>, 'scale'> & YAxisProps;
export declare const YAxis: FunctionComponent<Props>;
export declare class YAxis extends React.Component<Props> {
static displayName: string;
static defaultProps: {
allowDuplicatedCategory: boolean;
allowDecimals: boolean;
hide: boolean;
orientation: string;
width: number;
height: number;
mirror: boolean;
yAxisId: number;
tickCount: number;
type: string;
padding: {
top: number;
bottom: number;
};
allowDataOverflow: boolean;
scale: string;
reversed: boolean;
};
render(): React.JSX.Element;
}
export {};

@@ -1,2 +0,2 @@

import type { FunctionComponent } from 'react';
import React from 'react';
import { ScaleType, DataKey, AxisDomain } from '../util/types';

@@ -13,2 +13,11 @@ export interface Props {

}
export declare const ZAxis: FunctionComponent<Props>;
export declare class ZAxis extends React.Component<Props> {
static displayName: string;
static defaultProps: {
zAxisId: number;
range: number[];
scale: string;
type: string;
};
render(): React.ReactNode;
}

@@ -106,4 +106,4 @@ import React, { PureComponent, ReactElement, ReactNode, SVGProps } from 'react';

static parseDeltaAngle: (startAngle: number, endAngle: number) => number;
static getRealPieData: (item: Pie) => any[];
static parseCoordinateOfPie: (item: Pie, offset: ChartOffset) => {
static getRealPieData: (itemProps: Props) => any[];
static parseCoordinateOfPie: (itemProps: Props, offset: ChartOffset) => {
cx: number;

@@ -115,4 +115,4 @@ cy: number;

};
static getComposedData: ({ item, offset }: {
item: Pie;
static getComposedData: ({ item, offset, }: {
item: React.ReactElement<Props>;
offset: ChartOffset;

@@ -119,0 +119,0 @@ }) => Omit<Props, 'dataKey'>;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc