source: node_modules/recharts/es6/util/BarUtils.js@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 1.5 KB
Line 
1function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2import * as React from 'react';
3import invariant from 'tiny-invariant';
4import { Shape } from './ActiveShapeUtils';
5import { isNullish, isNumber } from './DataUtils';
6export function BarRectangle(props) {
7 return /*#__PURE__*/React.createElement(Shape, _extends({
8 shapeType: "rectangle",
9 activeClassName: "recharts-active-bar"
10 }, props));
11}
12/**
13 * Safely gets minPointSize from the minPointSize prop if it is a function
14 * @param minPointSize minPointSize as passed to the Bar component
15 * @param defaultValue default minPointSize
16 * @returns minPointSize
17 */
18export var minPointSizeCallback = function minPointSizeCallback(minPointSize) {
19 var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
20 return (value, index) => {
21 if (isNumber(minPointSize)) return minPointSize;
22 var isValueNumberOrNil = isNumber(value) || isNullish(value);
23 if (isValueNumberOrNil) {
24 return minPointSize(value, index);
25 }
26 !isValueNumberOrNil ? true ? invariant(false, "minPointSize callback function received a value with type of ".concat(typeof value, ". Currently only numbers or null/undefined are supported.")) : invariant(false) : void 0;
27 return defaultValue;
28 };
29};
Note: See TracBrowser for help on using the repository browser.