UNPKG

victory-chart

Version:
1,689 lines (1,416 loc) 768 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react")); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["VictoryChart"] = factory(require("react")); else root["VictoryChart"] = factory(root["React"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_36__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VictoryStack = exports.VictoryGroup = exports.VictoryScatter = exports.VictoryBar = exports.VictoryArea = exports.VictoryAxis = exports.VictoryLine = exports.VictoryChart = undefined; var _victoryChart = __webpack_require__(1); var _victoryChart2 = _interopRequireDefault(_victoryChart); var _victoryLine = __webpack_require__(249); var _victoryLine2 = _interopRequireDefault(_victoryLine); var _victoryAxis = __webpack_require__(174); var _victoryAxis2 = _interopRequireDefault(_victoryAxis); var _victoryArea = __webpack_require__(254); var _victoryArea2 = _interopRequireDefault(_victoryArea); var _victoryBar = __webpack_require__(257); var _victoryBar2 = _interopRequireDefault(_victoryBar); var _victoryScatter = __webpack_require__(261); var _victoryScatter2 = _interopRequireDefault(_victoryScatter); var _victoryGroup = __webpack_require__(266); var _victoryGroup2 = _interopRequireDefault(_victoryGroup); var _victoryStack = __webpack_require__(267); var _victoryStack2 = _interopRequireDefault(_victoryStack); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.VictoryChart = _victoryChart2.default; exports.VictoryLine = _victoryLine2.default; exports.VictoryAxis = _victoryAxis2.default; exports.VictoryArea = _victoryArea2.default; exports.VictoryBar = _victoryBar2.default; exports.VictoryScatter = _victoryScatter2.default; exports.VictoryGroup = _victoryGroup2.default; exports.VictoryStack = _victoryStack2.default; /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || 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; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _defaults = __webpack_require__(2); var _defaults2 = _interopRequireDefault(_defaults); var _react = __webpack_require__(36); var _react2 = _interopRequireDefault(_react); var _victoryCore = __webpack_require__(37); var _victoryAxis = __webpack_require__(174); var _victoryAxis2 = _interopRequireDefault(_victoryAxis); var _helperMethods = __webpack_require__(214); var _helperMethods2 = _interopRequireDefault(_helperMethods); var _axis = __webpack_require__(208); var _axis2 = _interopRequireDefault(_axis); var _scale = __webpack_require__(198); var _scale2 = _interopRequireDefault(_scale); var _wrapper = __webpack_require__(247); var _wrapper2 = _interopRequireDefault(_wrapper); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } 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; } var defaultAxes = { independent: _react2.default.createElement(_victoryAxis2.default, null), dependent: _react2.default.createElement(_victoryAxis2.default, { dependentAxis: true }) }; var VictoryChart = function (_React$Component) { _inherits(VictoryChart, _React$Component); function VictoryChart() { _classCallCheck(this, VictoryChart); return _possibleConstructorReturn(this, Object.getPrototypeOf(VictoryChart).apply(this, arguments)); } _createClass(VictoryChart, [{ key: "componentWillReceiveProps", value: function componentWillReceiveProps(nextProps) { var setAnimationState = _wrapper2.default.setAnimationState.bind(this); setAnimationState(nextProps); } }, { key: "getStyles", value: function getStyles(props) { var styleProps = props.style && props.style.parent; return { parent: (0, _defaults2.default)({ height: "auto", width: "100%" }, styleProps) }; } }, { key: "getAxisProps", value: function getAxisProps(child, props, calculatedProps) { var domain = calculatedProps.domain; var scale = calculatedProps.scale; var axis = child.type.getAxis(child.props); var axisOffset = _helperMethods2.default.getAxisOffset(props, calculatedProps); var tickValues = _helperMethods2.default.getTicks(calculatedProps, axis, child); var tickFormat = child.props.tickFormat || _helperMethods2.default.getTickFormat(child, axis, calculatedProps); var offsetY = axis === "y" ? undefined : axisOffset.y; var offsetX = axis === "x" ? undefined : axisOffset.x; return { domain: domain[axis], scale: scale[axis], tickValues: tickValues, tickFormat: tickFormat, offsetY: offsetY, offsetX: offsetX, crossAxis: true }; } }, { key: "getChildProps", value: function getChildProps(child, props, calculatedProps) { var type = child.type && child.type.role; if (type === "axis") { return this.getAxisProps(child, props, calculatedProps); } return { domain: calculatedProps.domain, scale: calculatedProps.scale, categories: calculatedProps.categories }; } }, { key: "getCalculatedProps", value: function getCalculatedProps(props, childComponents) { var horizontal = childComponents.some(function (component) { return component.props.horizontal; }); var axisComponents = { x: _axis2.default.getAxisComponent(childComponents, "x"), y: _axis2.default.getAxisComponent(childComponents, "y") }; var domain = { x: _helperMethods2.default.getDomain(props, childComponents, "x"), y: _helperMethods2.default.getDomain(props, childComponents, "y") }; var range = { x: _victoryCore.Helpers.getRange(props, "x"), y: _victoryCore.Helpers.getRange(props, "y") }; var baseScale = { x: _scale2.default.getScaleFromProps(props, "x") || axisComponents.x && axisComponents.x.type.getScale(axisComponents.x.props) || _scale2.default.getDefaultScale(), y: _scale2.default.getScaleFromProps(props, "y") || axisComponents.y && axisComponents.y.type.getScale(axisComponents.y.props) || _scale2.default.getDefaultScale() }; var scale = { x: baseScale.x.domain(domain.x).range(range.x), y: baseScale.y.domain(domain.y).range(range.y) }; // TODO: check var categories = { x: _wrapper2.default.getCategories(childComponents, props, "x"), y: _wrapper2.default.getCategories(childComponents, props, "y") }; var stringMap = { x: _helperMethods2.default.createStringMap(childComponents, "x"), y: _helperMethods2.default.createStringMap(childComponents, "y") }; return { axisComponents: axisComponents, categories: categories, domain: domain, horizontal: horizontal, scale: scale, stringMap: stringMap }; } }, { key: "getNewChildren", value: function getNewChildren(props, childComponents, baseStyle) { var _this2 = this; var calculatedProps = this.getCalculatedProps(props, childComponents); var getAnimationProps = _wrapper2.default.getAnimationProps.bind(this); return childComponents.map(function (child, index) { var style = (0, _defaults2.default)({}, child.props.style, { parent: baseStyle.parent }); var childProps = _this2.getChildProps(child, props, calculatedProps); var newProps = (0, _defaults2.default)({ animate: getAnimationProps(props, child, index), height: props.height, width: props.width, padding: _victoryCore.Helpers.getPadding(props), ref: index, key: index, standalone: false, style: style }, childProps); return _react2.default.cloneElement(child, newProps); }); } }, { key: "render", value: function render() { var props = this.state && this.state.nodesWillExit ? this.state.oldProps : this.props; var style = this.getStyles(props); var childComponents = _helperMethods2.default.getChildComponents(props, defaultAxes); var group = _react2.default.createElement( "g", { style: style.parent }, this.getNewChildren(props, childComponents, style) ); return this.props.standalone ? _react2.default.createElement( "svg", _extends({ style: style.parent, viewBox: "0 0 " + props.width + " " + props.height }, props.events), group ) : group; } }]); return VictoryChart; }(_react2.default.Component); VictoryChart.propTypes = { /** * The animate prop specifies props for VictoryAnimation to use. If this prop is * given, all children defined in chart will pass the options specified in this prop to * VictoryTransition and VictoryAnimation. Child animation props will be added for any * values not provided via the animation prop for VictoryChart. The animate prop should * also be used to specify enter and exit transition configurations with the `onExit` * and `onEnter` namespaces respectively. VictoryChart will coodrinate transitions between all * of its child components so that animation stays in sync * @examples {duration: 500, onEnd: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})} */ animate: _react.PropTypes.object, /** * VictoryChart is a wrapper component that controls the layout and animation behaviors of its * children. VictoryChart works with VictoryArea, VictoryAxis, VictoryBar, VictoryLine, and * VictoryScatter. Wrapper components like VictoryGroup and VictoryStack may also be * wrapped with VictoryChart. If not children are provided, VictoryChart will render a * set of empty axes. */ children: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.arrayOf(_react2.default.PropTypes.node), _react2.default.PropTypes.node]), /** * The domain prop describes the range of values your chart will include. This prop can be * given as a array of the minimum and maximum expected values for your chart, * or as an object that specifies separate arrays for x and y. * If this prop is not provided, a domain will be calculated from data, or other * available information. * @examples: [-1, 1], {x: [0, 100], y: [0, 1]} */ domain: _react.PropTypes.oneOfType([_victoryCore.PropTypes.domain, _react.PropTypes.shape({ x: _victoryCore.PropTypes.domain, y: _victoryCore.PropTypes.domain })]), /** * The domainPadding prop specifies a number of pixels of padding to add to the * beginning and end of a domain. This prop is useful for explicitly spacing ticks farther * from the origin to prevent crowding. This prop should be given as an object with * numbers specified for x and y. */ domainPadding: _react.PropTypes.oneOfType([_react.PropTypes.shape({ x: _victoryCore.PropTypes.nonNegative, y: _victoryCore.PropTypes.nonNegative }), _victoryCore.PropTypes.nonNegative]), /** * The events prop attaches arbitrary event handlers to the top level chart svg. * To attach events to individual pieces of data, use the events prop in child componenets. * Event handlers on VictoryCharts are called with their corresponding events. * @examples {(evt) => alert(`x: ${evt.clientX}, y: ${evt.clientY}`)} */ events: _react.PropTypes.object, /** * The height props specifies the height the svg viewBox of the chart container. * This value should be given as a number of pixels */ height: _victoryCore.PropTypes.nonNegative, /** * The padding props specifies the amount of padding in number of pixels between * the edge of the chart and any rendered child components. This prop can be given * as a number or as an object with padding specified for top, bottom, left * and right. */ padding: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.shape({ top: _react.PropTypes.number, bottom: _react.PropTypes.number, left: _react.PropTypes.number, right: _react.PropTypes.number })]), /** * The scale prop determines which scales your chart should use. This prop can be * given as a string or a function, or as an object that specifies separate scales for x and y. * Supported string scales are "linear", "time", "log" and "sqrt" * @examples d3.time.scale(), {x: "linear", y: "log" } */ scale: _react.PropTypes.oneOfType([_victoryCore.PropTypes.scale, _react.PropTypes.shape({ x: _victoryCore.PropTypes.scale, y: _victoryCore.PropTypes.scale })]), /** * The standalone prop determines whether the component will render a standalone svg * or a <g> tag that will be included in an external svg. Set standalone to false to * compose VictoryChart with other components within an enclosing <svg> tag. Victory * Component are responsive by default. If you need to create a fixed-size chart, set * standalone to false, and wrap VictoryChart in a custom <svg> */ standalone: _react.PropTypes.bool, /** * The style prop specifies styles for your chart. Any valid inline style properties * will be applied. Height, width, and padding should be specified via the height, * width, and padding props, as they are used to calculate the alignment of * components within chart. * @examples {border: "1px solid #ccc", margin: "2%", maxWidth: "40%"} */ style: _react.PropTypes.object, /** * The width props specifies the width of the svg viewBox of the chart container * This value should be given as a number of pixels */ width: _victoryCore.PropTypes.nonNegative }; VictoryChart.defaultProps = { events: {}, height: 300, width: 450, padding: 50, standalone: true }; exports.default = VictoryChart; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { var apply = __webpack_require__(3), assignInDefaults = __webpack_require__(4), assignInWith = __webpack_require__(6), rest = __webpack_require__(18); /** * Assigns own and inherited enumerable properties of source objects to the * destination object for all destination properties that resolve to `undefined`. * Source objects are applied from left to right. Once a property is set, * additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); * // => { 'user': 'barney', 'age': 36 } */ var defaults = rest(function(args) { args.push(undefined, assignInDefaults); return apply(assignInWith, undefined, args); }); module.exports = defaults; /***/ }, /* 3 */ /***/ function(module, exports) { /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {...*} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { var length = args.length; switch (length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } module.exports = apply; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { var eq = __webpack_require__(5); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used by `_.defaults` to customize its `_.assignIn` use. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function assignInDefaults(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } module.exports = assignInDefaults; /***/ }, /* 5 */ /***/ function(module, exports) { /** * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'user': 'fred' }; * var other = { 'user': 'fred' }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { var copyObjectWith = __webpack_require__(7), createAssigner = __webpack_require__(9), keysIn = __webpack_require__(21); /** * This method is like `_.assignIn` except that it accepts `customizer` which * is invoked to produce the assigned values. If `customizer` returns `undefined` * assignment is handled by the method instead. The `customizer` is invoked * with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObjectWith(source, keysIn(source), object, customizer); }); module.exports = assignInWith; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(8); /** * This function is like `copyObject` except that it accepts a function to * customize copied values. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property names to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObjectWith(source, props, object, customizer) { object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; assignValue(object, key, newValue); } return object; } module.exports = copyObjectWith; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { var eq = __webpack_require__(5); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { object[key] = value; } } module.exports = assignValue; /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { var isIterateeCall = __webpack_require__(10), rest = __webpack_require__(18); /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return rest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } module.exports = createAssigner; /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { var eq = __webpack_require__(5), isArrayLike = __webpack_require__(11), isIndex = __webpack_require__(17), isObject = __webpack_require__(15); /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) { return eq(object[index], value); } return false; } module.exports = isIterateeCall; /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { var getLength = __webpack_require__(12), isFunction = __webpack_require__(14), isLength = __webpack_require__(16); /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(getLength(value)) && !isFunction(value); } module.exports = isArrayLike; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { var baseProperty = __webpack_require__(13); /** * Gets the "length" property value of `object`. * * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * that affects Safari on at least iOS 8.1-8.3 ARM64. * * @private * @param {Object} object The object to query. * @returns {*} Returns the "length" value. */ var getLength = baseProperty('length'); module.exports = getLength; /***/ }, /* 13 */ /***/ function(module, exports) { /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } module.exports = baseProperty; /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { var isObject = __webpack_require__(15); /** `Object#toString` result references. */ var funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8 which returns 'object' for typed array and weak map constructors, // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } module.exports = isFunction; /***/ }, /* 15 */ /***/ function(module, exports) { /** * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }, /* 16 */ /***/ function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }, /* 17 */ /***/ function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; length = length == null ? MAX_SAFE_INTEGER : length; return value > -1 && value % 1 == 0 && value < length; } module.exports = isIndex; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { var apply = __webpack_require__(3), toInteger = __webpack_require__(19); /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as an array. * * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } switch (start) { case 0: return func.call(this, array); case 1: return func.call(this, args[0], array); case 2: return func.call(this, args[0], args[1], array); } var otherArgs = Array(start + 1); index = -1; while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = array; return apply(func, this, otherArgs); }; } module.exports = rest; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { var toNumber = __webpack_require__(20); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308; /** * Converts `value` to an integer. * * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). * * @static * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3'); * // => 3 */ function toInteger(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } var remainder = value % 1; return value === value ? (remainder ? value - remainder : value) : 0; } module.exports = toInteger; /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(14), isObject = __webpack_require__(15); /** Used as references for various `Number` constants. */ var NAN = 0 / 0; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * Converts `value` to a number. * * @static * @memberOf _ * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3); * // => 3 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3'); * // => 3 */ function toNumber(value) { if (isObject(value)) { var other = isFunction(value.valueOf) ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } module.exports = toNumber; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { var baseKeysIn = __webpack_require__(22), indexKeys = __webpack_require__(28), isIndex = __webpack_require__(17), isPrototype = __webpack_require__(35); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { var index = -1, isProto = isPrototype(object), props = baseKeysIn(object), propsLength = props.length, indexes = indexKeys(object), skipIndexes = !!indexes, result = indexes || [], length = result.length; while (++index < propsLength) { var key = props[index]; if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } module.exports = keysIn; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { var Reflect = __webpack_require__(23), iteratorToArray = __webpack_require__(27); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Built-in value references. */ var enumerate = Reflect ? Reflect.enumerate : undefined, propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * The base implementation of `_.keysIn` which doesn't skip the constructor * property of prototypes or treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { object = object == null ? object : Object(object); var result = []; for (var key in object) { result.push(key); } return result; } // Fallback for IE < 9 with es6-shim. if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { baseKeysIn = function(object) { return iteratorToArray(enumerate(object)); }; } module.exports = baseKeysIn; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { var root = __webpack_require__(24); /** Built-in value references. */ var Reflect = root.Reflect; module.exports = Reflect; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module, global) {var checkGlobal = __webpack_require__(26); /** Used to determine if values are of the language type `Object`. */ var objectTypes = { 'function': true, 'object': true }; /** Detect free variable `exports`. */ var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : undefined; /** Detect free variable `module`. */ var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : undefined; /** Detect free variable `global` from Node.js. */ var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); /** Detect free variable `self`. */ var freeSelf = checkGlobal(objectTypes[typeof self] && self); /** Detect free variable `window`. */ var freeWindow = checkGlobal(objectTypes[typeof window] && window); /** Detect `this` as the global object. */ var thisGlobal = checkGlobal(objectTypes[typeof this] && this); /** * Used as a reference to the global object. * * The `this` value is used if it's the global object to avoid Greasemonkey's * restricted `window` object, otherwise the `window` object is used. */ var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); module.exports = root; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module), (function() { return this; }()))) /***/ }, /* 25 */ /***/ function(module, exports) { module.exports = function(module) { if(!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default module.children = []; module.webpackPolyfill = 1; } return module; } /***/ }, /* 26 */ /***/ function(module, exports) { /** * Checks if `value` is a global object. * * @private * @param {*} value The value to check. * @returns {null|Object} Returns `value` if it's a global object, else `null`. */ function checkGlobal(value) { return (value && value.Object === Object) ? value : null; } module.exports = checkGlobal; /***/ }, /* 27 */ /***/ function(module, exports) { /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } module.exports = iteratorToArray; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { var baseTimes = __webpack_require__(29), isArguments = __webpack_require__(30), isArray = __webpack_require__(33), isLength = __webpack_require__(16), isString = __webpack_require__(34); /** * Creates an array of index keys for `object` values of arrays, * `arguments` objects, and strings, otherwise `null` is returned. * * @private * @param {Object} object The object to query. * @returns {Array|null} Returns index keys, else `null`. */ function indexKeys(object) { var length = object ? object.length : undefined; if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { return baseTimes(length, String); } return null; } module.exports = indexKeys; /***/ }, /* 29 */ /***/ function(module, exports) { /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } module.exports = baseTimes; /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { var isArrayLikeObject = __webpack_require__(31); /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ function isArguments(value) { // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } module.exports = isArguments; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { var isArrayLike = __webpack_require__(11), isObjectLike = __webpack_require__(32); /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } module.exports = isArrayLikeObject; /***/ }, /* 32 */ /***/ function(module, exports) { /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } module.exports = isObjectLike; /***/ }, /* 33 */ /***/ function(module, exports) { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @type {Function} * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { var isArray = __webpack_require__(33), isObjectLike = __webpack_require__(32); /** `Object#toString` result references. */ var stringTag = '[object String]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); } module.exports = isString; /***/ }, /* 35 */ /***/ function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } module.exports = isPrototype; /***/ }, /* 36 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_36__; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VictoryTransition = exports.VictoryLabel = exports.VictoryAnimation = exports.Transitions = exports.PropTypes = exports.Style = exports.Log = exports.Helpers = exports.Collection = undefined; var _collection = __webpack_require__(38); Object.defineProperty(exports, "Collection", { enumerable: true, get: function get() { return _interopRequireDefault(_collection).default; } }); var _helpers = __webpack_require__(39); Object.defineProperty(exports, "Helpers", { enumerable: true, get: function get() { return _interopRequireDefault(_helpers).default; } }); var _log = __webpack_require__(151); Object.defineProperty(exports, "Log", { enumerable: true, get: function get() { return _interopRequireDefault(_log).default;