v1.0 with SW PWA enabled
This commit is contained in:
51
frontend/node_modules/recharts/es6/shape/Cross.js
generated
vendored
Normal file
51
frontend/node_modules/recharts/es6/shape/Cross.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
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); }
|
||||
var _excluded = ["x", "y", "top", "left", "width", "height", "className"];
|
||||
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 _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 : 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
||||
/**
|
||||
* @fileOverview Cross
|
||||
*/
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { isNumber } from '../util/DataUtils';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
var getPath = function getPath(x, y, width, height, top, left) {
|
||||
return "M".concat(x, ",").concat(top, "v").concat(height, "M").concat(left, ",").concat(y, "h").concat(width);
|
||||
};
|
||||
export var Cross = function Cross(_ref) {
|
||||
var _ref$x = _ref.x,
|
||||
x = _ref$x === void 0 ? 0 : _ref$x,
|
||||
_ref$y = _ref.y,
|
||||
y = _ref$y === void 0 ? 0 : _ref$y,
|
||||
_ref$top = _ref.top,
|
||||
top = _ref$top === void 0 ? 0 : _ref$top,
|
||||
_ref$left = _ref.left,
|
||||
left = _ref$left === void 0 ? 0 : _ref$left,
|
||||
_ref$width = _ref.width,
|
||||
width = _ref$width === void 0 ? 0 : _ref$width,
|
||||
_ref$height = _ref.height,
|
||||
height = _ref$height === void 0 ? 0 : _ref$height,
|
||||
className = _ref.className,
|
||||
rest = _objectWithoutProperties(_ref, _excluded);
|
||||
var props = _objectSpread({
|
||||
x: x,
|
||||
y: y,
|
||||
top: top,
|
||||
left: left,
|
||||
width: width,
|
||||
height: height
|
||||
}, rest);
|
||||
if (!isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("path", _extends({}, filterProps(props, true), {
|
||||
className: clsx('recharts-cross', className),
|
||||
d: getPath(x, y, width, height, top, left)
|
||||
}));
|
||||
};
|
||||
116
frontend/node_modules/recharts/es6/shape/Curve.js
generated
vendored
Normal file
116
frontend/node_modules/recharts/es6/shape/Curve.js
generated
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
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 _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 : 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 Curve
|
||||
*/
|
||||
import * as React from 'react';
|
||||
import { line as shapeLine, area as shapeArea, curveBasisClosed, curveBasisOpen, curveBasis, curveBumpX, curveBumpY, curveLinearClosed, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from 'victory-vendor/d3-shape';
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import isFunction from 'lodash/isFunction';
|
||||
import clsx from 'clsx';
|
||||
import { adaptEventHandlers } from '../util/types';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
import { isNumber } from '../util/DataUtils';
|
||||
var CURVE_FACTORIES = {
|
||||
curveBasisClosed: curveBasisClosed,
|
||||
curveBasisOpen: curveBasisOpen,
|
||||
curveBasis: curveBasis,
|
||||
curveBumpX: curveBumpX,
|
||||
curveBumpY: curveBumpY,
|
||||
curveLinearClosed: curveLinearClosed,
|
||||
curveLinear: curveLinear,
|
||||
curveMonotoneX: curveMonotoneX,
|
||||
curveMonotoneY: curveMonotoneY,
|
||||
curveNatural: curveNatural,
|
||||
curveStep: curveStep,
|
||||
curveStepAfter: curveStepAfter,
|
||||
curveStepBefore: curveStepBefore
|
||||
};
|
||||
var defined = function defined(p) {
|
||||
return p.x === +p.x && p.y === +p.y;
|
||||
};
|
||||
var getX = function getX(p) {
|
||||
return p.x;
|
||||
};
|
||||
var getY = function getY(p) {
|
||||
return p.y;
|
||||
};
|
||||
var getCurveFactory = function getCurveFactory(type, layout) {
|
||||
if (isFunction(type)) {
|
||||
return type;
|
||||
}
|
||||
var name = "curve".concat(upperFirst(type));
|
||||
if ((name === 'curveMonotone' || name === 'curveBump') && layout) {
|
||||
return CURVE_FACTORIES["".concat(name).concat(layout === 'vertical' ? 'Y' : 'X')];
|
||||
}
|
||||
return CURVE_FACTORIES[name] || curveLinear;
|
||||
};
|
||||
/**
|
||||
* Calculate the path of curve. Returns null if points is an empty array.
|
||||
* @return path or null
|
||||
*/
|
||||
export var getPath = function getPath(_ref) {
|
||||
var _ref$type = _ref.type,
|
||||
type = _ref$type === void 0 ? 'linear' : _ref$type,
|
||||
_ref$points = _ref.points,
|
||||
points = _ref$points === void 0 ? [] : _ref$points,
|
||||
baseLine = _ref.baseLine,
|
||||
layout = _ref.layout,
|
||||
_ref$connectNulls = _ref.connectNulls,
|
||||
connectNulls = _ref$connectNulls === void 0 ? false : _ref$connectNulls;
|
||||
var curveFactory = getCurveFactory(type, layout);
|
||||
var formatPoints = connectNulls ? points.filter(function (entry) {
|
||||
return defined(entry);
|
||||
}) : points;
|
||||
var lineFunction;
|
||||
if (Array.isArray(baseLine)) {
|
||||
var formatBaseLine = connectNulls ? baseLine.filter(function (base) {
|
||||
return defined(base);
|
||||
}) : baseLine;
|
||||
var areaPoints = formatPoints.map(function (entry, index) {
|
||||
return _objectSpread(_objectSpread({}, entry), {}, {
|
||||
base: formatBaseLine[index]
|
||||
});
|
||||
});
|
||||
if (layout === 'vertical') {
|
||||
lineFunction = shapeArea().y(getY).x1(getX).x0(function (d) {
|
||||
return d.base.x;
|
||||
});
|
||||
} else {
|
||||
lineFunction = shapeArea().x(getX).y1(getY).y0(function (d) {
|
||||
return d.base.y;
|
||||
});
|
||||
}
|
||||
lineFunction.defined(defined).curve(curveFactory);
|
||||
return lineFunction(areaPoints);
|
||||
}
|
||||
if (layout === 'vertical' && isNumber(baseLine)) {
|
||||
lineFunction = shapeArea().y(getY).x1(getX).x0(baseLine);
|
||||
} else if (isNumber(baseLine)) {
|
||||
lineFunction = shapeArea().x(getX).y1(getY).y0(baseLine);
|
||||
} else {
|
||||
lineFunction = shapeLine().x(getX).y(getY);
|
||||
}
|
||||
lineFunction.defined(defined).curve(curveFactory);
|
||||
return lineFunction(formatPoints);
|
||||
};
|
||||
export var Curve = function Curve(props) {
|
||||
var className = props.className,
|
||||
points = props.points,
|
||||
path = props.path,
|
||||
pathRef = props.pathRef;
|
||||
if ((!points || !points.length) && !path) {
|
||||
return null;
|
||||
}
|
||||
var realPath = points && points.length ? getPath(props) : path;
|
||||
return /*#__PURE__*/React.createElement("path", _extends({}, filterProps(props, false), adaptEventHandlers(props), {
|
||||
className: clsx('recharts-curve', className),
|
||||
d: realPath,
|
||||
ref: pathRef
|
||||
}));
|
||||
};
|
||||
24
frontend/node_modules/recharts/es6/shape/Dot.js
generated
vendored
Normal file
24
frontend/node_modules/recharts/es6/shape/Dot.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
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 Dot
|
||||
*/
|
||||
import * as React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { adaptEventHandlers } from '../util/types';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
export var Dot = function Dot(props) {
|
||||
var cx = props.cx,
|
||||
cy = props.cy,
|
||||
r = props.r,
|
||||
className = props.className;
|
||||
var layerClass = clsx('recharts-dot', className);
|
||||
if (cx === +cx && cy === +cy && r === +r) {
|
||||
return /*#__PURE__*/React.createElement("circle", _extends({}, filterProps(props, false), adaptEventHandlers(props), {
|
||||
className: layerClass,
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
r: r
|
||||
}));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
90
frontend/node_modules/recharts/es6/shape/Polygon.js
generated
vendored
Normal file
90
frontend/node_modules/recharts/es6/shape/Polygon.js
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
var _excluded = ["points", "className", "baseLinePoints", "connectNulls"];
|
||||
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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
/**
|
||||
* @fileOverview Polygon
|
||||
*/
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
var isValidatePoint = function isValidatePoint(point) {
|
||||
return point && point.x === +point.x && point.y === +point.y;
|
||||
};
|
||||
var getParsedPoints = function getParsedPoints() {
|
||||
var points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
var segmentPoints = [[]];
|
||||
points.forEach(function (entry) {
|
||||
if (isValidatePoint(entry)) {
|
||||
segmentPoints[segmentPoints.length - 1].push(entry);
|
||||
} else if (segmentPoints[segmentPoints.length - 1].length > 0) {
|
||||
// add another path
|
||||
segmentPoints.push([]);
|
||||
}
|
||||
});
|
||||
if (isValidatePoint(points[0])) {
|
||||
segmentPoints[segmentPoints.length - 1].push(points[0]);
|
||||
}
|
||||
if (segmentPoints[segmentPoints.length - 1].length <= 0) {
|
||||
segmentPoints = segmentPoints.slice(0, -1);
|
||||
}
|
||||
return segmentPoints;
|
||||
};
|
||||
var getSinglePolygonPath = function getSinglePolygonPath(points, connectNulls) {
|
||||
var segmentPoints = getParsedPoints(points);
|
||||
if (connectNulls) {
|
||||
segmentPoints = [segmentPoints.reduce(function (res, segPoints) {
|
||||
return [].concat(_toConsumableArray(res), _toConsumableArray(segPoints));
|
||||
}, [])];
|
||||
}
|
||||
var polygonPath = segmentPoints.map(function (segPoints) {
|
||||
return segPoints.reduce(function (path, point, index) {
|
||||
return "".concat(path).concat(index === 0 ? 'M' : 'L').concat(point.x, ",").concat(point.y);
|
||||
}, '');
|
||||
}).join('');
|
||||
return segmentPoints.length === 1 ? "".concat(polygonPath, "Z") : polygonPath;
|
||||
};
|
||||
var getRanglePath = function getRanglePath(points, baseLinePoints, connectNulls) {
|
||||
var outerPath = getSinglePolygonPath(points, connectNulls);
|
||||
return "".concat(outerPath.slice(-1) === 'Z' ? outerPath.slice(0, -1) : outerPath, "L").concat(getSinglePolygonPath(baseLinePoints.reverse(), connectNulls).slice(1));
|
||||
};
|
||||
export var Polygon = function Polygon(props) {
|
||||
var points = props.points,
|
||||
className = props.className,
|
||||
baseLinePoints = props.baseLinePoints,
|
||||
connectNulls = props.connectNulls,
|
||||
others = _objectWithoutProperties(props, _excluded);
|
||||
if (!points || !points.length) {
|
||||
return null;
|
||||
}
|
||||
var layerClass = clsx('recharts-polygon', className);
|
||||
if (baseLinePoints && baseLinePoints.length) {
|
||||
var hasStroke = others.stroke && others.stroke !== 'none';
|
||||
var rangePath = getRanglePath(points, baseLinePoints, connectNulls);
|
||||
return /*#__PURE__*/React.createElement("g", {
|
||||
className: layerClass
|
||||
}, /*#__PURE__*/React.createElement("path", _extends({}, filterProps(others, true), {
|
||||
fill: rangePath.slice(-1) === 'Z' ? others.fill : 'none',
|
||||
stroke: "none",
|
||||
d: rangePath
|
||||
})), hasStroke ? /*#__PURE__*/React.createElement("path", _extends({}, filterProps(others, true), {
|
||||
fill: "none",
|
||||
d: getSinglePolygonPath(points, connectNulls)
|
||||
})) : null, hasStroke ? /*#__PURE__*/React.createElement("path", _extends({}, filterProps(others, true), {
|
||||
fill: "none",
|
||||
d: getSinglePolygonPath(baseLinePoints, connectNulls)
|
||||
})) : null);
|
||||
}
|
||||
var singlePath = getSinglePolygonPath(points, connectNulls);
|
||||
return /*#__PURE__*/React.createElement("path", _extends({}, filterProps(others, true), {
|
||||
fill: singlePath.slice(-1) === 'Z' ? others.fill : 'none',
|
||||
className: layerClass,
|
||||
d: singlePath
|
||||
}));
|
||||
};
|
||||
168
frontend/node_modules/recharts/es6/shape/Rectangle.js
generated
vendored
Normal file
168
frontend/node_modules/recharts/es6/shape/Rectangle.js
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
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 _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 : 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 Rectangle
|
||||
*/
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import Animate from 'react-smooth';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
var getRectanglePath = function getRectanglePath(x, y, width, height, radius) {
|
||||
var maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);
|
||||
var ySign = height >= 0 ? 1 : -1;
|
||||
var xSign = width >= 0 ? 1 : -1;
|
||||
var clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;
|
||||
var path;
|
||||
if (maxRadius > 0 && radius instanceof Array) {
|
||||
var newRadius = [0, 0, 0, 0];
|
||||
for (var i = 0, len = 4; i < len; i++) {
|
||||
newRadius[i] = radius[i] > maxRadius ? maxRadius : radius[i];
|
||||
}
|
||||
path = "M".concat(x, ",").concat(y + ySign * newRadius[0]);
|
||||
if (newRadius[0] > 0) {
|
||||
path += "A ".concat(newRadius[0], ",").concat(newRadius[0], ",0,0,").concat(clockWise, ",").concat(x + xSign * newRadius[0], ",").concat(y);
|
||||
}
|
||||
path += "L ".concat(x + width - xSign * newRadius[1], ",").concat(y);
|
||||
if (newRadius[1] > 0) {
|
||||
path += "A ".concat(newRadius[1], ",").concat(newRadius[1], ",0,0,").concat(clockWise, ",\n ").concat(x + width, ",").concat(y + ySign * newRadius[1]);
|
||||
}
|
||||
path += "L ".concat(x + width, ",").concat(y + height - ySign * newRadius[2]);
|
||||
if (newRadius[2] > 0) {
|
||||
path += "A ".concat(newRadius[2], ",").concat(newRadius[2], ",0,0,").concat(clockWise, ",\n ").concat(x + width - xSign * newRadius[2], ",").concat(y + height);
|
||||
}
|
||||
path += "L ".concat(x + xSign * newRadius[3], ",").concat(y + height);
|
||||
if (newRadius[3] > 0) {
|
||||
path += "A ".concat(newRadius[3], ",").concat(newRadius[3], ",0,0,").concat(clockWise, ",\n ").concat(x, ",").concat(y + height - ySign * newRadius[3]);
|
||||
}
|
||||
path += 'Z';
|
||||
} else if (maxRadius > 0 && radius === +radius && radius > 0) {
|
||||
var _newRadius = Math.min(maxRadius, radius);
|
||||
path = "M ".concat(x, ",").concat(y + ySign * _newRadius, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x + xSign * _newRadius, ",").concat(y, "\n L ").concat(x + width - xSign * _newRadius, ",").concat(y, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x + width, ",").concat(y + ySign * _newRadius, "\n L ").concat(x + width, ",").concat(y + height - ySign * _newRadius, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x + width - xSign * _newRadius, ",").concat(y + height, "\n L ").concat(x + xSign * _newRadius, ",").concat(y + height, "\n A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x, ",").concat(y + height - ySign * _newRadius, " Z");
|
||||
} else {
|
||||
path = "M ".concat(x, ",").concat(y, " h ").concat(width, " v ").concat(height, " h ").concat(-width, " Z");
|
||||
}
|
||||
return path;
|
||||
};
|
||||
export var isInRectangle = function isInRectangle(point, rect) {
|
||||
if (!point || !rect) {
|
||||
return false;
|
||||
}
|
||||
var px = point.x,
|
||||
py = point.y;
|
||||
var x = rect.x,
|
||||
y = rect.y,
|
||||
width = rect.width,
|
||||
height = rect.height;
|
||||
if (Math.abs(width) > 0 && Math.abs(height) > 0) {
|
||||
var minX = Math.min(x, x + width);
|
||||
var maxX = Math.max(x, x + width);
|
||||
var minY = Math.min(y, y + height);
|
||||
var maxY = Math.max(y, y + height);
|
||||
return px >= minX && px <= maxX && py >= minY && py <= maxY;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var defaultProps = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
// The radius of border
|
||||
// The radius of four corners when radius is a number
|
||||
// The radius of left-top, right-top, right-bottom, left-bottom when radius is an array
|
||||
radius: 0,
|
||||
isAnimationActive: false,
|
||||
isUpdateAnimationActive: false,
|
||||
animationBegin: 0,
|
||||
animationDuration: 1500,
|
||||
animationEasing: 'ease'
|
||||
};
|
||||
export var Rectangle = function Rectangle(rectangleProps) {
|
||||
var props = _objectSpread(_objectSpread({}, defaultProps), rectangleProps);
|
||||
var pathRef = useRef();
|
||||
var _useState = useState(-1),
|
||||
_useState2 = _slicedToArray(_useState, 2),
|
||||
totalLength = _useState2[0],
|
||||
setTotalLength = _useState2[1];
|
||||
useEffect(function () {
|
||||
if (pathRef.current && pathRef.current.getTotalLength) {
|
||||
try {
|
||||
var pathTotalLength = pathRef.current.getTotalLength();
|
||||
if (pathTotalLength) {
|
||||
setTotalLength(pathTotalLength);
|
||||
}
|
||||
} catch (err) {
|
||||
// calculate total length error
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
var x = props.x,
|
||||
y = props.y,
|
||||
width = props.width,
|
||||
height = props.height,
|
||||
radius = props.radius,
|
||||
className = props.className;
|
||||
var animationEasing = props.animationEasing,
|
||||
animationDuration = props.animationDuration,
|
||||
animationBegin = props.animationBegin,
|
||||
isAnimationActive = props.isAnimationActive,
|
||||
isUpdateAnimationActive = props.isUpdateAnimationActive;
|
||||
if (x !== +x || y !== +y || width !== +width || height !== +height || width === 0 || height === 0) {
|
||||
return null;
|
||||
}
|
||||
var layerClass = clsx('recharts-rectangle', className);
|
||||
if (!isUpdateAnimationActive) {
|
||||
return /*#__PURE__*/React.createElement("path", _extends({}, filterProps(props, true), {
|
||||
className: layerClass,
|
||||
d: getRectanglePath(x, y, width, height, radius)
|
||||
}));
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(Animate, {
|
||||
canBegin: totalLength > 0,
|
||||
from: {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
},
|
||||
to: {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
},
|
||||
duration: animationDuration,
|
||||
animationEasing: animationEasing,
|
||||
isActive: isUpdateAnimationActive
|
||||
}, function (_ref) {
|
||||
var currWidth = _ref.width,
|
||||
currHeight = _ref.height,
|
||||
currX = _ref.x,
|
||||
currY = _ref.y;
|
||||
return /*#__PURE__*/React.createElement(Animate, {
|
||||
canBegin: totalLength > 0,
|
||||
from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
|
||||
to: "".concat(totalLength, "px 0px"),
|
||||
attributeName: "strokeDasharray",
|
||||
begin: animationBegin,
|
||||
duration: animationDuration,
|
||||
isActive: isAnimationActive,
|
||||
easing: animationEasing
|
||||
}, /*#__PURE__*/React.createElement("path", _extends({}, filterProps(props, true), {
|
||||
className: layerClass,
|
||||
d: getRectanglePath(currX, currY, currWidth, currHeight, radius),
|
||||
ref: pathRef
|
||||
})));
|
||||
});
|
||||
};
|
||||
213
frontend/node_modules/recharts/es6/shape/Sector.js
generated
vendored
Normal file
213
frontend/node_modules/recharts/es6/shape/Sector.js
generated
vendored
Normal file
@ -0,0 +1,213 @@
|
||||
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 _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 : 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 Sector
|
||||
*/
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
import { polarToCartesian, RADIAN } from '../util/PolarUtils';
|
||||
import { getPercentValue, mathSign } from '../util/DataUtils';
|
||||
var getDeltaAngle = function getDeltaAngle(startAngle, endAngle) {
|
||||
var sign = mathSign(endAngle - startAngle);
|
||||
var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999);
|
||||
return sign * deltaAngle;
|
||||
};
|
||||
var getTangentCircle = function getTangentCircle(_ref) {
|
||||
var cx = _ref.cx,
|
||||
cy = _ref.cy,
|
||||
radius = _ref.radius,
|
||||
angle = _ref.angle,
|
||||
sign = _ref.sign,
|
||||
isExternal = _ref.isExternal,
|
||||
cornerRadius = _ref.cornerRadius,
|
||||
cornerIsExternal = _ref.cornerIsExternal;
|
||||
var centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;
|
||||
var theta = Math.asin(cornerRadius / centerRadius) / RADIAN;
|
||||
var centerAngle = cornerIsExternal ? angle : angle + sign * theta;
|
||||
var center = polarToCartesian(cx, cy, centerRadius, centerAngle);
|
||||
// The coordinate of point which is tangent to the circle
|
||||
var circleTangency = polarToCartesian(cx, cy, radius, centerAngle);
|
||||
// The coordinate of point which is tangent to the radius line
|
||||
var lineTangencyAngle = cornerIsExternal ? angle - sign * theta : angle;
|
||||
var lineTangency = polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN), lineTangencyAngle);
|
||||
return {
|
||||
center: center,
|
||||
circleTangency: circleTangency,
|
||||
lineTangency: lineTangency,
|
||||
theta: theta
|
||||
};
|
||||
};
|
||||
var getSectorPath = function getSectorPath(_ref2) {
|
||||
var cx = _ref2.cx,
|
||||
cy = _ref2.cy,
|
||||
innerRadius = _ref2.innerRadius,
|
||||
outerRadius = _ref2.outerRadius,
|
||||
startAngle = _ref2.startAngle,
|
||||
endAngle = _ref2.endAngle;
|
||||
var angle = getDeltaAngle(startAngle, endAngle);
|
||||
|
||||
// When the angle of sector equals to 360, star point and end point coincide
|
||||
var tempEndAngle = startAngle + angle;
|
||||
var outerStartPoint = polarToCartesian(cx, cy, outerRadius, startAngle);
|
||||
var outerEndPoint = polarToCartesian(cx, cy, outerRadius, tempEndAngle);
|
||||
var path = "M ".concat(outerStartPoint.x, ",").concat(outerStartPoint.y, "\n A ").concat(outerRadius, ",").concat(outerRadius, ",0,\n ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle > tempEndAngle), ",\n ").concat(outerEndPoint.x, ",").concat(outerEndPoint.y, "\n ");
|
||||
if (innerRadius > 0) {
|
||||
var innerStartPoint = polarToCartesian(cx, cy, innerRadius, startAngle);
|
||||
var innerEndPoint = polarToCartesian(cx, cy, innerRadius, tempEndAngle);
|
||||
path += "L ".concat(innerEndPoint.x, ",").concat(innerEndPoint.y, "\n A ").concat(innerRadius, ",").concat(innerRadius, ",0,\n ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle <= tempEndAngle), ",\n ").concat(innerStartPoint.x, ",").concat(innerStartPoint.y, " Z");
|
||||
} else {
|
||||
path += "L ".concat(cx, ",").concat(cy, " Z");
|
||||
}
|
||||
return path;
|
||||
};
|
||||
var getSectorWithCorner = function getSectorWithCorner(_ref3) {
|
||||
var cx = _ref3.cx,
|
||||
cy = _ref3.cy,
|
||||
innerRadius = _ref3.innerRadius,
|
||||
outerRadius = _ref3.outerRadius,
|
||||
cornerRadius = _ref3.cornerRadius,
|
||||
forceCornerRadius = _ref3.forceCornerRadius,
|
||||
cornerIsExternal = _ref3.cornerIsExternal,
|
||||
startAngle = _ref3.startAngle,
|
||||
endAngle = _ref3.endAngle;
|
||||
var sign = mathSign(endAngle - startAngle);
|
||||
var _getTangentCircle = getTangentCircle({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
radius: outerRadius,
|
||||
angle: startAngle,
|
||||
sign: sign,
|
||||
cornerRadius: cornerRadius,
|
||||
cornerIsExternal: cornerIsExternal
|
||||
}),
|
||||
soct = _getTangentCircle.circleTangency,
|
||||
solt = _getTangentCircle.lineTangency,
|
||||
sot = _getTangentCircle.theta;
|
||||
var _getTangentCircle2 = getTangentCircle({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
radius: outerRadius,
|
||||
angle: endAngle,
|
||||
sign: -sign,
|
||||
cornerRadius: cornerRadius,
|
||||
cornerIsExternal: cornerIsExternal
|
||||
}),
|
||||
eoct = _getTangentCircle2.circleTangency,
|
||||
eolt = _getTangentCircle2.lineTangency,
|
||||
eot = _getTangentCircle2.theta;
|
||||
var outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;
|
||||
if (outerArcAngle < 0) {
|
||||
if (forceCornerRadius) {
|
||||
return "M ".concat(solt.x, ",").concat(solt.y, "\n a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(cornerRadius * 2, ",0\n a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(-cornerRadius * 2, ",0\n ");
|
||||
}
|
||||
return getSectorPath({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
innerRadius: innerRadius,
|
||||
outerRadius: outerRadius,
|
||||
startAngle: startAngle,
|
||||
endAngle: endAngle
|
||||
});
|
||||
}
|
||||
var path = "M ".concat(solt.x, ",").concat(solt.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(soct.x, ",").concat(soct.y, "\n A").concat(outerRadius, ",").concat(outerRadius, ",0,").concat(+(outerArcAngle > 180), ",").concat(+(sign < 0), ",").concat(eoct.x, ",").concat(eoct.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(eolt.x, ",").concat(eolt.y, "\n ");
|
||||
if (innerRadius > 0) {
|
||||
var _getTangentCircle3 = getTangentCircle({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
radius: innerRadius,
|
||||
angle: startAngle,
|
||||
sign: sign,
|
||||
isExternal: true,
|
||||
cornerRadius: cornerRadius,
|
||||
cornerIsExternal: cornerIsExternal
|
||||
}),
|
||||
sict = _getTangentCircle3.circleTangency,
|
||||
silt = _getTangentCircle3.lineTangency,
|
||||
sit = _getTangentCircle3.theta;
|
||||
var _getTangentCircle4 = getTangentCircle({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
radius: innerRadius,
|
||||
angle: endAngle,
|
||||
sign: -sign,
|
||||
isExternal: true,
|
||||
cornerRadius: cornerRadius,
|
||||
cornerIsExternal: cornerIsExternal
|
||||
}),
|
||||
eict = _getTangentCircle4.circleTangency,
|
||||
eilt = _getTangentCircle4.lineTangency,
|
||||
eit = _getTangentCircle4.theta;
|
||||
var innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;
|
||||
if (innerArcAngle < 0 && cornerRadius === 0) {
|
||||
return "".concat(path, "L").concat(cx, ",").concat(cy, "Z");
|
||||
}
|
||||
path += "L".concat(eilt.x, ",").concat(eilt.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(eict.x, ",").concat(eict.y, "\n A").concat(innerRadius, ",").concat(innerRadius, ",0,").concat(+(innerArcAngle > 180), ",").concat(+(sign > 0), ",").concat(sict.x, ",").concat(sict.y, "\n A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(silt.x, ",").concat(silt.y, "Z");
|
||||
} else {
|
||||
path += "L".concat(cx, ",").concat(cy, "Z");
|
||||
}
|
||||
return path;
|
||||
};
|
||||
var defaultProps = {
|
||||
cx: 0,
|
||||
cy: 0,
|
||||
innerRadius: 0,
|
||||
outerRadius: 0,
|
||||
startAngle: 0,
|
||||
endAngle: 0,
|
||||
cornerRadius: 0,
|
||||
forceCornerRadius: false,
|
||||
cornerIsExternal: false
|
||||
};
|
||||
export var Sector = function Sector(sectorProps) {
|
||||
var props = _objectSpread(_objectSpread({}, defaultProps), sectorProps);
|
||||
var cx = props.cx,
|
||||
cy = props.cy,
|
||||
innerRadius = props.innerRadius,
|
||||
outerRadius = props.outerRadius,
|
||||
cornerRadius = props.cornerRadius,
|
||||
forceCornerRadius = props.forceCornerRadius,
|
||||
cornerIsExternal = props.cornerIsExternal,
|
||||
startAngle = props.startAngle,
|
||||
endAngle = props.endAngle,
|
||||
className = props.className;
|
||||
if (outerRadius < innerRadius || startAngle === endAngle) {
|
||||
return null;
|
||||
}
|
||||
var layerClass = clsx('recharts-sector', className);
|
||||
var deltaRadius = outerRadius - innerRadius;
|
||||
var cr = getPercentValue(cornerRadius, deltaRadius, 0, true);
|
||||
var path;
|
||||
if (cr > 0 && Math.abs(startAngle - endAngle) < 360) {
|
||||
path = getSectorWithCorner({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
innerRadius: innerRadius,
|
||||
outerRadius: outerRadius,
|
||||
cornerRadius: Math.min(cr, deltaRadius / 2),
|
||||
forceCornerRadius: forceCornerRadius,
|
||||
cornerIsExternal: cornerIsExternal,
|
||||
startAngle: startAngle,
|
||||
endAngle: endAngle
|
||||
});
|
||||
} else {
|
||||
path = getSectorPath({
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
innerRadius: innerRadius,
|
||||
outerRadius: outerRadius,
|
||||
startAngle: startAngle,
|
||||
endAngle: endAngle
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/React.createElement("path", _extends({}, filterProps(props, true), {
|
||||
className: layerClass,
|
||||
d: path,
|
||||
role: "img"
|
||||
}));
|
||||
};
|
||||
96
frontend/node_modules/recharts/es6/shape/Symbols.js
generated
vendored
Normal file
96
frontend/node_modules/recharts/es6/shape/Symbols.js
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
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); }
|
||||
var _excluded = ["type", "size", "sizeType"];
|
||||
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 _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 : 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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
||||
/**
|
||||
* @fileOverview Curve
|
||||
*/
|
||||
import React from 'react';
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import { symbol as shapeSymbol, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from 'victory-vendor/d3-shape';
|
||||
import clsx from 'clsx';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
var symbolFactories = {
|
||||
symbolCircle: symbolCircle,
|
||||
symbolCross: symbolCross,
|
||||
symbolDiamond: symbolDiamond,
|
||||
symbolSquare: symbolSquare,
|
||||
symbolStar: symbolStar,
|
||||
symbolTriangle: symbolTriangle,
|
||||
symbolWye: symbolWye
|
||||
};
|
||||
var RADIAN = Math.PI / 180;
|
||||
var getSymbolFactory = function getSymbolFactory(type) {
|
||||
var name = "symbol".concat(upperFirst(type));
|
||||
return symbolFactories[name] || symbolCircle;
|
||||
};
|
||||
var calculateAreaSize = function calculateAreaSize(size, sizeType, type) {
|
||||
if (sizeType === 'area') {
|
||||
return size;
|
||||
}
|
||||
switch (type) {
|
||||
case 'cross':
|
||||
return 5 * size * size / 9;
|
||||
case 'diamond':
|
||||
return 0.5 * size * size / Math.sqrt(3);
|
||||
case 'square':
|
||||
return size * size;
|
||||
case 'star':
|
||||
{
|
||||
var angle = 18 * RADIAN;
|
||||
return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.pow(Math.tan(angle), 2));
|
||||
}
|
||||
case 'triangle':
|
||||
return Math.sqrt(3) * size * size / 4;
|
||||
case 'wye':
|
||||
return (21 - 10 * Math.sqrt(3)) * size * size / 8;
|
||||
default:
|
||||
return Math.PI * size * size / 4;
|
||||
}
|
||||
};
|
||||
var registerSymbol = function registerSymbol(key, factory) {
|
||||
symbolFactories["symbol".concat(upperFirst(key))] = factory;
|
||||
};
|
||||
export var Symbols = function Symbols(_ref) {
|
||||
var _ref$type = _ref.type,
|
||||
type = _ref$type === void 0 ? 'circle' : _ref$type,
|
||||
_ref$size = _ref.size,
|
||||
size = _ref$size === void 0 ? 64 : _ref$size,
|
||||
_ref$sizeType = _ref.sizeType,
|
||||
sizeType = _ref$sizeType === void 0 ? 'area' : _ref$sizeType,
|
||||
rest = _objectWithoutProperties(_ref, _excluded);
|
||||
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
||||
type: type,
|
||||
size: size,
|
||||
sizeType: sizeType
|
||||
});
|
||||
|
||||
/**
|
||||
* Calculate the path of curve
|
||||
* @return {String} path
|
||||
*/
|
||||
var getPath = function getPath() {
|
||||
var symbolFactory = getSymbolFactory(type);
|
||||
var symbol = shapeSymbol().type(symbolFactory).size(calculateAreaSize(size, sizeType, type));
|
||||
return symbol();
|
||||
};
|
||||
var className = props.className,
|
||||
cx = props.cx,
|
||||
cy = props.cy;
|
||||
var filteredProps = filterProps(props, true);
|
||||
if (cx === +cx && cy === +cy && size === +size) {
|
||||
return /*#__PURE__*/React.createElement("path", _extends({}, filteredProps, {
|
||||
className: clsx('recharts-symbols', className),
|
||||
transform: "translate(".concat(cx, ", ").concat(cy, ")"),
|
||||
d: getPath()
|
||||
}));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
Symbols.registerSymbol = registerSymbol;
|
||||
120
frontend/node_modules/recharts/es6/shape/Trapezoid.js
generated
vendored
Normal file
120
frontend/node_modules/recharts/es6/shape/Trapezoid.js
generated
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
||||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
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 _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 : 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 Rectangle
|
||||
*/
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import Animate from 'react-smooth';
|
||||
import { filterProps } from '../util/ReactUtils';
|
||||
var getTrapezoidPath = function getTrapezoidPath(x, y, upperWidth, lowerWidth, height) {
|
||||
var widthGap = upperWidth - lowerWidth;
|
||||
var path;
|
||||
path = "M ".concat(x, ",").concat(y);
|
||||
path += "L ".concat(x + upperWidth, ",").concat(y);
|
||||
path += "L ".concat(x + upperWidth - widthGap / 2, ",").concat(y + height);
|
||||
path += "L ".concat(x + upperWidth - widthGap / 2 - lowerWidth, ",").concat(y + height);
|
||||
path += "L ".concat(x, ",").concat(y, " Z");
|
||||
return path;
|
||||
};
|
||||
var defaultProps = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
upperWidth: 0,
|
||||
lowerWidth: 0,
|
||||
height: 0,
|
||||
isUpdateAnimationActive: false,
|
||||
animationBegin: 0,
|
||||
animationDuration: 1500,
|
||||
animationEasing: 'ease'
|
||||
};
|
||||
export var Trapezoid = function Trapezoid(props) {
|
||||
var trapezoidProps = _objectSpread(_objectSpread({}, defaultProps), props);
|
||||
var pathRef = useRef();
|
||||
var _useState = useState(-1),
|
||||
_useState2 = _slicedToArray(_useState, 2),
|
||||
totalLength = _useState2[0],
|
||||
setTotalLength = _useState2[1];
|
||||
useEffect(function () {
|
||||
if (pathRef.current && pathRef.current.getTotalLength) {
|
||||
try {
|
||||
var pathTotalLength = pathRef.current.getTotalLength();
|
||||
if (pathTotalLength) {
|
||||
setTotalLength(pathTotalLength);
|
||||
}
|
||||
} catch (err) {
|
||||
// calculate total length error
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
var x = trapezoidProps.x,
|
||||
y = trapezoidProps.y,
|
||||
upperWidth = trapezoidProps.upperWidth,
|
||||
lowerWidth = trapezoidProps.lowerWidth,
|
||||
height = trapezoidProps.height,
|
||||
className = trapezoidProps.className;
|
||||
var animationEasing = trapezoidProps.animationEasing,
|
||||
animationDuration = trapezoidProps.animationDuration,
|
||||
animationBegin = trapezoidProps.animationBegin,
|
||||
isUpdateAnimationActive = trapezoidProps.isUpdateAnimationActive;
|
||||
if (x !== +x || y !== +y || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || upperWidth === 0 && lowerWidth === 0 || height === 0) {
|
||||
return null;
|
||||
}
|
||||
var layerClass = clsx('recharts-trapezoid', className);
|
||||
if (!isUpdateAnimationActive) {
|
||||
return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", _extends({}, filterProps(trapezoidProps, true), {
|
||||
className: layerClass,
|
||||
d: getTrapezoidPath(x, y, upperWidth, lowerWidth, height)
|
||||
})));
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(Animate, {
|
||||
canBegin: totalLength > 0,
|
||||
from: {
|
||||
upperWidth: 0,
|
||||
lowerWidth: 0,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
},
|
||||
to: {
|
||||
upperWidth: upperWidth,
|
||||
lowerWidth: lowerWidth,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
},
|
||||
duration: animationDuration,
|
||||
animationEasing: animationEasing,
|
||||
isActive: isUpdateAnimationActive
|
||||
}, function (_ref) {
|
||||
var currUpperWidth = _ref.upperWidth,
|
||||
currLowerWidth = _ref.lowerWidth,
|
||||
currHeight = _ref.height,
|
||||
currX = _ref.x,
|
||||
currY = _ref.y;
|
||||
return /*#__PURE__*/React.createElement(Animate, {
|
||||
canBegin: totalLength > 0,
|
||||
from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
|
||||
to: "".concat(totalLength, "px 0px"),
|
||||
attributeName: "strokeDasharray",
|
||||
begin: animationBegin,
|
||||
duration: animationDuration,
|
||||
easing: animationEasing
|
||||
}, /*#__PURE__*/React.createElement("path", _extends({}, filterProps(trapezoidProps, true), {
|
||||
className: layerClass,
|
||||
d: getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight),
|
||||
ref: pathRef
|
||||
})));
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user