Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

victory-bar

Package Overview
Dependencies
Maintainers
26
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

victory-bar - npm Package Compare versions

Comparing version 36.3.2 to 36.4.0

10

es/bar.js
import _assign from "lodash/assign";
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -59,3 +61,3 @@

var defaultTransform = polar && origin ? "translate(".concat(origin.x, ", ").concat(origin.y, ")") : undefined;
return React.cloneElement(props.pathComponent, _objectSpread({}, props.events, {
return /*#__PURE__*/React.cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
"aria-label": props.ariaLabel,

@@ -75,3 +77,3 @@ style: style,

Bar.propTypes = _objectSpread({}, CommonProps.primitiveProps, {
Bar.propTypes = _objectSpread(_objectSpread({}, CommonProps.primitiveProps), {}, {
alignment: PropTypes.oneOf(["start", "middle", "end"]),

@@ -99,3 +101,3 @@ barRatio: PropTypes.number,

defaultBarWidth: 8,
pathComponent: React.createElement(Path, null),
pathComponent: /*#__PURE__*/React.createElement(Path, null),
role: "presentation",

@@ -102,0 +104,0 @@ shapeRendering: "auto"

32

es/path-helper-methods.js

@@ -1,14 +0,20 @@

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
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 _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
import * as d3Shape from "d3-shape";
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; }
import * as d3Shape from "victory-vendor/d3-shape";
import { circle, point } from "./geometry-helper-methods";

@@ -65,3 +71,3 @@

var propsWithCalculatedValues = _objectSpread({}, props, getPosition(props, width));
var propsWithCalculatedValues = _objectSpread(_objectSpread({}, props), getPosition(props, width));

@@ -403,4 +409,4 @@ return getPath(propsWithCalculatedValues);

moves = _toConsumableArray(rightMoves.slice(0, rightOffset)).concat(_toConsumableArray(leftMoves.slice(leftOffset)));
coords = _toConsumableArray(rightCoords.slice(0, rightOffset)).concat(_toConsumableArray(leftCoords.slice(leftOffset)));
moves = [].concat(_toConsumableArray(rightMoves.slice(0, rightOffset)), _toConsumableArray(leftMoves.slice(leftOffset)));
coords = [].concat(_toConsumableArray(rightCoords.slice(0, rightOffset)), _toConsumableArray(leftCoords.slice(leftOffset)));
}

@@ -448,4 +454,4 @@

var rightOffset = shortPath ? -1 : -3;
moves = _toConsumableArray(leftMoves.slice(0, leftMiddle + 2)).concat(_toConsumableArray(rightMoves.slice(rightOffset)));
coords = _toConsumableArray(leftCoords.slice(0, leftMiddle + 2)).concat(_toConsumableArray(rightCoords.slice(rightOffset)));
moves = [].concat(_toConsumableArray(leftMoves.slice(0, leftMiddle + 2)), _toConsumableArray(rightMoves.slice(rightOffset)));
coords = [].concat(_toConsumableArray(leftCoords.slice(0, leftMiddle + 2)), _toConsumableArray(rightCoords.slice(rightOffset)));
}

@@ -466,5 +472,3 @@

var bottomPath = getBottomPath();
var moves = _toConsumableArray(topPath).concat(_toConsumableArray(bottomPath));
var moves = [].concat(_toConsumableArray(topPath), _toConsumableArray(bottomPath));
var path = moves.reduce(function (memo, move) {

@@ -471,0 +475,0 @@ memo += "".concat(move.command, " ").concat(move.coords.join());

@@ -1,4 +0,4 @@

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -9,10 +9,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
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 _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
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 || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
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 _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, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import PropTypes from "prop-types";

@@ -42,11 +52,11 @@ import React from "react";

var VictoryBar =
/*#__PURE__*/
function (_React$Component) {
var VictoryBar = /*#__PURE__*/function (_React$Component) {
_inherits(VictoryBar, _React$Component);
var _super = _createSuper(VictoryBar);
function VictoryBar() {
_classCallCheck(this, VictoryBar);
return _possibleConstructorReturn(this, (VictoryBar.__proto__ || Object.getPrototypeOf(VictoryBar)).apply(this, arguments));
return _super.apply(this, arguments);
}

@@ -56,4 +66,4 @@

key: "shouldAnimate",
// Overridden in native versions
value: function shouldAnimate() {
value: // Overridden in native versions
function shouldAnimate() {
return !!this.props.animate;

@@ -73,3 +83,3 @@ }

var children = this.renderData(props);
var container = React.cloneElement(props.containerComponent, UserProps.getSafeUserProps(props));
var container = /*#__PURE__*/React.cloneElement(props.containerComponent, UserProps.getSafeUserProps(props));
return props.standalone ? this.renderContainer(container, children) : children;

@@ -82,134 +92,94 @@ }

Object.defineProperty(VictoryBar, "animationWhitelist", {
configurable: true,
enumerable: true,
writable: true,
value: ["data", "domain", "height", "padding", "style", "width"]
});
Object.defineProperty(VictoryBar, "displayName", {
configurable: true,
enumerable: true,
writable: true,
value: "VictoryBar"
});
Object.defineProperty(VictoryBar, "role", {
configurable: true,
enumerable: true,
writable: true,
value: "bar"
});
Object.defineProperty(VictoryBar, "defaultTransitions", {
configurable: true,
enumerable: true,
writable: true,
value: {
onLoad: {
duration: 2000,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
_defineProperty(VictoryBar, "animationWhitelist", ["data", "domain", "height", "padding", "style", "width"]);
_defineProperty(VictoryBar, "displayName", "VictoryBar");
_defineProperty(VictoryBar, "role", "bar");
_defineProperty(VictoryBar, "defaultTransitions", {
onLoad: {
duration: 2000,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
onExit: {
duration: 500,
before: function () {
return {
_y: 0,
yOffset: 0
};
}
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
},
onExit: {
duration: 500,
before: function () {
return {
_y: 0,
yOffset: 0
};
}
},
onEnter: {
duration: 500,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
onEnter: {
duration: 500,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
}
});
Object.defineProperty(VictoryBar, "propTypes", {
configurable: true,
enumerable: true,
writable: true,
value: _objectSpread({}, CommonProps.baseProps, CommonProps.dataProps, {
alignment: PropTypes.oneOf(["start", "middle", "end"]),
barRatio: PropTypes.number,
barWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
cornerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.func, PropTypes.shape({
top: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
topLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
topRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottomLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottomRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func])
})]),
getPath: PropTypes.func,
horizontal: PropTypes.bool
})
_defineProperty(VictoryBar, "propTypes", _objectSpread(_objectSpread(_objectSpread({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
alignment: PropTypes.oneOf(["start", "middle", "end"]),
barRatio: PropTypes.number,
barWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
cornerRadius: PropTypes.oneOfType([PropTypes.number, PropTypes.func, PropTypes.shape({
top: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
topLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
topRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottom: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottomLeft: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
bottomRight: PropTypes.oneOfType([PropTypes.number, PropTypes.func])
})]),
getPath: PropTypes.func,
horizontal: PropTypes.bool
}));
_defineProperty(VictoryBar, "defaultProps", {
containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, null),
data: defaultData,
dataComponent: /*#__PURE__*/React.createElement(Bar, null),
groupComponent: /*#__PURE__*/React.createElement("g", {
role: "presentation"
}),
labelComponent: /*#__PURE__*/React.createElement(VictoryLabel, null),
samples: 50,
sortOrder: "ascending",
standalone: true,
theme: VictoryTheme.grayscale
});
Object.defineProperty(VictoryBar, "defaultProps", {
configurable: true,
enumerable: true,
writable: true,
value: {
containerComponent: React.createElement(VictoryContainer, null),
data: defaultData,
dataComponent: React.createElement(Bar, null),
groupComponent: React.createElement("g", {
role: "presentation"
}),
labelComponent: React.createElement(VictoryLabel, null),
samples: 50,
sortOrder: "ascending",
standalone: true,
theme: VictoryTheme.grayscale
}
_defineProperty(VictoryBar, "getDomain", Domain.getDomainWithZero);
_defineProperty(VictoryBar, "getData", Data.getData);
_defineProperty(VictoryBar, "getBaseProps", function (props) {
return getBaseProps(props, fallbackProps);
});
Object.defineProperty(VictoryBar, "getDomain", {
configurable: true,
enumerable: true,
writable: true,
value: Domain.getDomainWithZero
});
Object.defineProperty(VictoryBar, "getData", {
configurable: true,
enumerable: true,
writable: true,
value: Data.getData
});
Object.defineProperty(VictoryBar, "getBaseProps", {
configurable: true,
enumerable: true,
writable: true,
value: function (props) {
return getBaseProps(props, fallbackProps);
}
});
Object.defineProperty(VictoryBar, "expectedComponents", {
configurable: true,
enumerable: true,
writable: true,
value: ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]
});
_defineProperty(VictoryBar, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
export default addEvents(VictoryBar);

@@ -22,4 +22,6 @@ "use strict";

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -78,3 +80,3 @@

var defaultTransform = polar && origin ? "translate(".concat(origin.x, ", ").concat(origin.y, ")") : undefined;
return _react.default.cloneElement(props.pathComponent, _objectSpread({}, props.events, {
return /*#__PURE__*/_react.default.cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
"aria-label": props.ariaLabel,

@@ -94,3 +96,3 @@ style: style,

Bar.propTypes = _objectSpread({}, _victoryCore.CommonProps.primitiveProps, {
Bar.propTypes = _objectSpread(_objectSpread({}, _victoryCore.CommonProps.primitiveProps), {}, {
alignment: _propTypes.default.oneOf(["start", "middle", "end"]),

@@ -118,3 +120,3 @@ barRatio: _propTypes.default.number,

defaultBarWidth: 8,
pathComponent: _react.default.createElement(_victoryCore.Path, null),
pathComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.Path, null),
role: "presentation",

@@ -121,0 +123,0 @@ shapeRendering: "auto"

@@ -6,2 +6,8 @@ "use strict";

});
Object.defineProperty(exports, "Bar", {
enumerable: true,
get: function () {
return _bar.default;
}
});
Object.defineProperty(exports, "VictoryBar", {

@@ -13,6 +19,6 @@ enumerable: true,

});
Object.defineProperty(exports, "Bar", {
Object.defineProperty(exports, "getBarPath", {
enumerable: true,
get: function () {
return _bar.default;
return _pathHelperMethods.getBarPath;
}

@@ -26,24 +32,24 @@ });

});
Object.defineProperty(exports, "getVerticalBarPath", {
Object.defineProperty(exports, "getBarWidth", {
enumerable: true,
get: function () {
return _pathHelperMethods.getVerticalBarPath;
return _barHelperMethods.getBarWidth;
}
});
Object.defineProperty(exports, "getHorizontalBarPath", {
Object.defineProperty(exports, "getCornerRadius", {
enumerable: true,
get: function () {
return _pathHelperMethods.getHorizontalBarPath;
return _barHelperMethods.getCornerRadius;
}
});
Object.defineProperty(exports, "getVerticalPolarBarPath", {
Object.defineProperty(exports, "getCustomBarPath", {
enumerable: true,
get: function () {
return _pathHelperMethods.getVerticalPolarBarPath;
return _pathHelperMethods.getCustomBarPath;
}
});
Object.defineProperty(exports, "getCustomBarPath", {
Object.defineProperty(exports, "getHorizontalBarPath", {
enumerable: true,
get: function () {
return _pathHelperMethods.getCustomBarPath;
return _pathHelperMethods.getHorizontalBarPath;
}

@@ -57,26 +63,20 @@ });

});
Object.defineProperty(exports, "getBarPath", {
Object.defineProperty(exports, "getStyle", {
enumerable: true,
get: function () {
return _pathHelperMethods.getBarPath;
return _barHelperMethods.getStyle;
}
});
Object.defineProperty(exports, "getBarWidth", {
Object.defineProperty(exports, "getVerticalBarPath", {
enumerable: true,
get: function () {
return _barHelperMethods.getBarWidth;
return _pathHelperMethods.getVerticalBarPath;
}
});
Object.defineProperty(exports, "getStyle", {
Object.defineProperty(exports, "getVerticalPolarBarPath", {
enumerable: true,
get: function () {
return _barHelperMethods.getStyle;
return _pathHelperMethods.getVerticalPolarBarPath;
}
});
Object.defineProperty(exports, "getCornerRadius", {
enumerable: true,
get: function () {
return _barHelperMethods.getCornerRadius;
}
});

@@ -83,0 +83,0 @@ var _victoryBar = _interopRequireDefault(require("./victory-bar"));

@@ -6,22 +6,30 @@ "use strict";

});
exports.getPolarBarPath = exports.getBarPath = exports.getVerticalPolarBarPath = exports.getHorizontalBarPath = exports.getVerticalBarPath = exports.getCustomBarPath = void 0;
exports.getVerticalPolarBarPath = exports.getVerticalBarPath = exports.getPolarBarPath = exports.getHorizontalBarPath = exports.getCustomBarPath = exports.getBarPath = void 0;
var d3Shape = _interopRequireWildcard(require("d3-shape"));
var d3Shape = _interopRequireWildcard(require("victory-vendor/d3-shape"));
var _geometryHelperMethods = require("./geometry-helper-methods");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
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 _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
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 _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
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; }
var getPosition = function (props, width) {

@@ -76,3 +84,3 @@ var x = props.x,

var propsWithCalculatedValues = _objectSpread({}, props, getPosition(props, width));
var propsWithCalculatedValues = _objectSpread(_objectSpread({}, props), getPosition(props, width));

@@ -422,4 +430,4 @@ return getPath(propsWithCalculatedValues);

moves = _toConsumableArray(rightMoves.slice(0, rightOffset)).concat(_toConsumableArray(leftMoves.slice(leftOffset)));
coords = _toConsumableArray(rightCoords.slice(0, rightOffset)).concat(_toConsumableArray(leftCoords.slice(leftOffset)));
moves = [].concat(_toConsumableArray(rightMoves.slice(0, rightOffset)), _toConsumableArray(leftMoves.slice(leftOffset)));
coords = [].concat(_toConsumableArray(rightCoords.slice(0, rightOffset)), _toConsumableArray(leftCoords.slice(leftOffset)));
}

@@ -467,4 +475,4 @@

var rightOffset = shortPath ? -1 : -3;
moves = _toConsumableArray(leftMoves.slice(0, leftMiddle + 2)).concat(_toConsumableArray(rightMoves.slice(rightOffset)));
coords = _toConsumableArray(leftCoords.slice(0, leftMiddle + 2)).concat(_toConsumableArray(rightCoords.slice(rightOffset)));
moves = [].concat(_toConsumableArray(leftMoves.slice(0, leftMiddle + 2)), _toConsumableArray(rightMoves.slice(rightOffset)));
coords = [].concat(_toConsumableArray(leftCoords.slice(0, leftMiddle + 2)), _toConsumableArray(rightCoords.slice(rightOffset)));
}

@@ -485,5 +493,3 @@

var bottomPath = getBottomPath();
var moves = _toConsumableArray(topPath).concat(_toConsumableArray(bottomPath));
var moves = [].concat(_toConsumableArray(topPath), _toConsumableArray(bottomPath));
var path = moves.reduce(function (memo, move) {

@@ -490,0 +496,0 @@ memo += "".concat(move.command, " ").concat(move.coords.join());

@@ -20,5 +20,5 @@ "use strict";

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

@@ -29,10 +29,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
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 _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
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 || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
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 _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, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var fallbackProps = {

@@ -57,11 +67,11 @@ width: 450,

var VictoryBar =
/*#__PURE__*/
function (_React$Component) {
var VictoryBar = /*#__PURE__*/function (_React$Component) {
_inherits(VictoryBar, _React$Component);
var _super = _createSuper(VictoryBar);
function VictoryBar() {
_classCallCheck(this, VictoryBar);
return _possibleConstructorReturn(this, (VictoryBar.__proto__ || Object.getPrototypeOf(VictoryBar)).apply(this, arguments));
return _super.apply(this, arguments);
}

@@ -71,4 +81,4 @@

key: "shouldAnimate",
// Overridden in native versions
value: function shouldAnimate() {
value: // Overridden in native versions
function shouldAnimate() {
return !!this.props.animate;

@@ -90,3 +100,3 @@ }

var container = _react.default.cloneElement(props.containerComponent, _victoryCore.UserProps.getSafeUserProps(props));
var container = /*#__PURE__*/_react.default.cloneElement(props.containerComponent, _victoryCore.UserProps.getSafeUserProps(props));

@@ -100,137 +110,96 @@ return props.standalone ? this.renderContainer(container, children) : children;

Object.defineProperty(VictoryBar, "animationWhitelist", {
configurable: true,
enumerable: true,
writable: true,
value: ["data", "domain", "height", "padding", "style", "width"]
});
Object.defineProperty(VictoryBar, "displayName", {
configurable: true,
enumerable: true,
writable: true,
value: "VictoryBar"
});
Object.defineProperty(VictoryBar, "role", {
configurable: true,
enumerable: true,
writable: true,
value: "bar"
});
Object.defineProperty(VictoryBar, "defaultTransitions", {
configurable: true,
enumerable: true,
writable: true,
value: {
onLoad: {
duration: 2000,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
_defineProperty(VictoryBar, "animationWhitelist", ["data", "domain", "height", "padding", "style", "width"]);
_defineProperty(VictoryBar, "displayName", "VictoryBar");
_defineProperty(VictoryBar, "role", "bar");
_defineProperty(VictoryBar, "defaultTransitions", {
onLoad: {
duration: 2000,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
onExit: {
duration: 500,
before: function () {
return {
_y: 0,
yOffset: 0
};
}
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
},
onExit: {
duration: 500,
before: function () {
return {
_y: 0,
yOffset: 0
};
}
},
onEnter: {
duration: 500,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
onEnter: {
duration: 500,
before: function () {
return {
_y: 0,
_y1: 0,
_y0: 0
};
},
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
after: function (datum) {
return {
_y: datum._y,
_y1: datum._y1,
_y0: datum._y0
};
}
}
});
Object.defineProperty(VictoryBar, "propTypes", {
configurable: true,
enumerable: true,
writable: true,
value: _objectSpread({}, _victoryCore.CommonProps.baseProps, _victoryCore.CommonProps.dataProps, {
alignment: _propTypes.default.oneOf(["start", "middle", "end"]),
barRatio: _propTypes.default.number,
barWidth: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
cornerRadius: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func, _propTypes.default.shape({
top: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
topLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
topRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
bottom: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
bottomLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
bottomRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func])
})]),
getPath: _propTypes.default.func,
horizontal: _propTypes.default.bool
})
_defineProperty(VictoryBar, "propTypes", _objectSpread(_objectSpread(_objectSpread({}, _victoryCore.CommonProps.baseProps), _victoryCore.CommonProps.dataProps), {}, {
alignment: _propTypes.default.oneOf(["start", "middle", "end"]),
barRatio: _propTypes.default.number,
barWidth: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
cornerRadius: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func, _propTypes.default.shape({
top: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
topLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
topRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
bottom: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
bottomLeft: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func]),
bottomRight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.func])
})]),
getPath: _propTypes.default.func,
horizontal: _propTypes.default.bool
}));
_defineProperty(VictoryBar, "defaultProps", {
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
data: defaultData,
dataComponent: /*#__PURE__*/_react.default.createElement(_bar.default, null),
groupComponent: /*#__PURE__*/_react.default.createElement("g", {
role: "presentation"
}),
labelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
samples: 50,
sortOrder: "ascending",
standalone: true,
theme: _victoryCore.VictoryTheme.grayscale
});
Object.defineProperty(VictoryBar, "defaultProps", {
configurable: true,
enumerable: true,
writable: true,
value: {
containerComponent: _react.default.createElement(_victoryCore.VictoryContainer, null),
data: defaultData,
dataComponent: _react.default.createElement(_bar.default, null),
groupComponent: _react.default.createElement("g", {
role: "presentation"
}),
labelComponent: _react.default.createElement(_victoryCore.VictoryLabel, null),
samples: 50,
sortOrder: "ascending",
standalone: true,
theme: _victoryCore.VictoryTheme.grayscale
}
_defineProperty(VictoryBar, "getDomain", _victoryCore.Domain.getDomainWithZero);
_defineProperty(VictoryBar, "getData", _victoryCore.Data.getData);
_defineProperty(VictoryBar, "getBaseProps", function (props) {
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
});
Object.defineProperty(VictoryBar, "getDomain", {
configurable: true,
enumerable: true,
writable: true,
value: _victoryCore.Domain.getDomainWithZero
});
Object.defineProperty(VictoryBar, "getData", {
configurable: true,
enumerable: true,
writable: true,
value: _victoryCore.Data.getData
});
Object.defineProperty(VictoryBar, "getBaseProps", {
configurable: true,
enumerable: true,
writable: true,
value: function (props) {
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
}
});
Object.defineProperty(VictoryBar, "expectedComponents", {
configurable: true,
enumerable: true,
writable: true,
value: ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]
});
_defineProperty(VictoryBar, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
var _default = (0, _victoryCore.addEvents)(VictoryBar);
exports.default = _default;
{
"name": "victory-bar",
"version": "36.3.2",
"version": "36.4.0",
"description": "Bar Component for Victory",

@@ -22,6 +22,6 @@ "keywords": [

"dependencies": {
"d3-shape": "^1.2.0",
"lodash": "^4.17.19",
"prop-types": "^15.5.8",
"victory-core": "^36.3.2"
"victory-core": "^36.4.0",
"victory-vendor": "^36.4.0"
},

@@ -35,3 +35,3 @@ "peerDependencies": {

"sideEffects": false,
"gitHead": "18895d1290245732d14332bbbda10336032c9aab"
"gitHead": "2e05481eeb34f9801a90023a131a21aa7deff082"
}

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

import * as d3Shape from "d3-shape";
import * as d3Shape from "victory-vendor/d3-shape";

@@ -3,0 +3,0 @@ import { circle, point } from "./geometry-helper-methods";

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

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

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