You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47263 lines
3.8 MiB
47263 lines
3.8 MiB
(function webpackUniversalModuleDefinition(root, factory) { |
|
if(typeof exports === 'object' && typeof module === 'object') |
|
module.exports = factory(); |
|
else if(typeof define === 'function' && define.amd) |
|
define([], factory); |
|
else { |
|
var a = factory(); |
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; |
|
} |
|
})(window, function() { |
|
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] = { |
|
/******/ i: moduleId, |
|
/******/ l: false, |
|
/******/ exports: {} |
|
/******/ }; |
|
/******/ |
|
/******/ // Execute the module function |
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
|
/******/ |
|
/******/ // Flag the module as loaded |
|
/******/ module.l = 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; |
|
/******/ |
|
/******/ // define getter function for harmony exports |
|
/******/ __webpack_require__.d = function(exports, name, getter) { |
|
/******/ if(!__webpack_require__.o(exports, name)) { |
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|
/******/ } |
|
/******/ }; |
|
/******/ |
|
/******/ // define __esModule on exports |
|
/******/ __webpack_require__.r = function(exports) { |
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
/******/ } |
|
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
/******/ }; |
|
/******/ |
|
/******/ // create a fake namespace object |
|
/******/ // mode & 1: value is a module id, require it |
|
/******/ // mode & 2: merge all properties of value into the ns |
|
/******/ // mode & 4: return value when already ns object |
|
/******/ // mode & 8|1: behave like require |
|
/******/ __webpack_require__.t = function(value, mode) { |
|
/******/ if(mode & 1) value = __webpack_require__(value); |
|
/******/ if(mode & 8) return value; |
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|
/******/ var ns = Object.create(null); |
|
/******/ __webpack_require__.r(ns); |
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|
/******/ return ns; |
|
/******/ }; |
|
/******/ |
|
/******/ // getDefaultExport function for compatibility with non-harmony modules |
|
/******/ __webpack_require__.n = function(module) { |
|
/******/ var getter = module && module.__esModule ? |
|
/******/ function getDefault() { return module['default']; } : |
|
/******/ function getModuleExports() { return module; }; |
|
/******/ __webpack_require__.d(getter, 'a', getter); |
|
/******/ return getter; |
|
/******/ }; |
|
/******/ |
|
/******/ // Object.prototype.hasOwnProperty.call |
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|
/******/ |
|
/******/ // __webpack_public_path__ |
|
/******/ __webpack_require__.p = ""; |
|
/******/ |
|
/******/ |
|
/******/ // Load entry module and return exports |
|
/******/ return __webpack_require__(__webpack_require__.s = "./index.ts"); |
|
/******/ }) |
|
/************************************************************************/ |
|
/******/ ({ |
|
|
|
/***/ "../node_modules/@chartwerk/core/dist/index.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/@chartwerk/core/dist/index.js ***! |
|
\*****************************************************/ |
|
/*! no static exports found */ |
|
/***/ (function(module, exports, __webpack_require__) { |
|
|
|
!function(t,e){if(true)module.exports=e();else { var r, n; }}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=214)}([function(t,e,n){var r=n(93),i=n(54);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(56),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(29),i=n(78),o=n(14);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(7),i=n(4);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(12),i=n(95),o=n(96),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},function(t,e,n){var r=n(103),i=n(106);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(34),i=n(38);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(122);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(29),i=n(73),o=n(14);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(3).Symbol;t.exports=r},function(t,e,n){var r=n(62),i=n(133),o=n(9);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(60),i=n(39);t.exports=function(t,e,n,o){var s=!n;n||(n={});for(var a=-1,c=e.length;++a<c;){var u=e[a],f=o?o(n[u],t[u],u,n,t):void 0;void 0===f&&(f=t[u]),s?i(n,u,f):r(n,u,f)}return n}},function(t,e,n){var r=n(62),i=n(136),o=n(9);t.exports=function(t){return o(t)?r(t,!0):i(t)}},function(t,e,n){var r=n(80),i=n(50),o=n(192),s=n(51),a=i((function(t){return t.push(void 0,o),r(s,void 0,t)}));t.exports=a},function(t,e,n){var r=n(8)(Object,"create");t.exports=r},function(t,e,n){var r=n(111),i=n(112),o=n(113),s=n(114),a=n(115);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e,n){var r=n(15);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(117);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(121),i=n(4),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return i(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=c},function(t,e,n){var r=n(6);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){var r=n(20),i=n(123),o=n(124),s=n(125),a=n(126),c=n(127);function u(t){var e=this.__data__=new r(t);this.size=e.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=a,u.prototype.set=c,t.exports=u},function(t,e,n){(function(t){var r=n(3),i=n(131),o=e&&!e.nodeType&&e,s=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===o?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||i;t.exports=c}).call(this,n(40)(t))},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){var r=n(142),i=n(35),o=n(143),s=n(144),a=n(145),c=n(7),u=n(57),f=u(r),l=u(i),h=u(o),p=u(s),v=u(a),d=c;(r&&"[object DataView]"!=d(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=d(new i)||o&&"[object Promise]"!=d(o.resolve())||s&&"[object Set]"!=d(new s)||a&&"[object WeakMap]"!=d(new a))&&(d=function(t){var e=c(t),n="[object Object]"==e?t.constructor:void 0,r=n?u(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case h:return"[object Promise]";case p:return"[object Set]";case v:return"[object WeakMap]"}return e}),t.exports=d},function(t,e,n){var r=n(6);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=e(s);if(null!=a&&(void 0===c?a==a&&!r(a):n(a,c)))var c=a,u=s}return u}},function(t,e,n){var r=n(29),i=n(48),o=n(73);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},function(t,e,n){var r=n(29),i=n(78),o=n(48);t.exports=function(t,e){return t&&t.length?r(t,o(e,2),i):void 0}},function(t,e,n){var r=n(1),i=n(6),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(s.test(t)||!o.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(100),i=n(116),o=n(118),s=n(119),a=n(120);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e,n){var r=n(7),i=n(2);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(8)(n(3),"Map");t.exports=r},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(61);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(132),i=n(27),o=n(42),s=o&&o.isTypedArray,a=s?i(s):r;t.exports=a},function(t,e,n){(function(t){var r=n(56),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===i&&r.process,a=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=a}).call(this,n(40)(t))},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(139),i=n(66),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(t){return null==t?[]:(t=Object(t),r(s(t),(function(e){return o.call(t,e)})))}:i;t.exports=a},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},function(t,e,n){var r=n(63)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(70);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e,n){var r=n(156),i=n(169),o=n(14),s=n(1),a=n(173);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?s(t)?i(t[0],t[1]):r(t):a(t)}},function(t,e,n){var r=n(55),i=n(24);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},function(t,e,n){var r=n(14),i=n(187),o=n(188);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e,n){var r=n(82),i=n(197)((function(t,e,n,i){r(t,e,n,i)}));t.exports=i},function(t,e,n){var r=n(176),i=n(178),o=n(50),s=n(81),a=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&s(t,e[0],e[1])?e=[]:n>2&&s(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=a},function(t,e){var n=Array.prototype.reverse;t.exports=function(t){return null==t?t:n.call(t)}},function(t,e,n){var r=n(55),i=n(23),o=n(1),s=n(37),a=n(38),c=n(24);t.exports=function(t,e,n){for(var u=-1,f=(e=r(e,t)).length,l=!1;++u<f;){var h=c(e[u]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++u!=f?l:!!(f=null==t?0:t.length)&&a(f)&&s(h,f)&&(o(t)||i(t))}},function(t,e,n){var r=n(1),i=n(32),o=n(97),s=n(58);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(s(t))}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(94))},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(59);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(12),i=n(36),o=n(1),s=n(6),a=r?r.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(s(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e,n){var r=n(39),i=n(15),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var s=t[e];o.call(t,e)&&i(s,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(8),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(130),i=n(23),o=n(1),s=n(26),a=n(37),c=n(41),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&s(t),h=!n&&!f&&!l&&c(t),p=n||f||l||h,v=p?r(t.length,String):[],d=v.length;for(var y in t)!e&&!u.call(t,y)||p&&("length"==y||l&&("offset"==y||"parent"==y)||h&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,d))||v.push(y);return v}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){var r=n(3),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===i?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(40)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(45),i=n(46),o=n(44),s=n(66),a=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:s;t.exports=a},function(t,e,n){var r=n(69),i=n(44),o=n(13);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(45),i=n(1);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},function(t,e,n){var r=n(3).Uint8Array;t.exports=r},function(t,e,n){var r=n(47);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(151),i=n(46),o=n(43);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},function(t,e){t.exports=function(t,e){return t<e}},function(t,e,n){var r=n(158),i=n(4);t.exports=function t(e,n,o,s,a){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,s,t,a))}},function(t,e,n){var r=n(159),i=n(162),o=n(163);t.exports=function(t,e,n,s,a,c){var u=1&n,f=t.length,l=e.length;if(f!=l&&!(u&&l>f))return!1;var h=c.get(t),p=c.get(e);if(h&&p)return h==e&&p==t;var v=-1,d=!0,y=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++v<f;){var b=t[v],x=e[v];if(s)var g=u?s(x,b,v,e,t,c):s(b,x,v,t,e,c);if(void 0!==g){if(g)continue;d=!1;break}if(y){if(!i(e,(function(t,e){if(!o(y,e)&&(b===t||a(b,t,n,s,c)))return y.push(e)}))){d=!1;break}}else if(b!==x&&!a(b,x,n,s,c)){d=!1;break}}return c.delete(t),c.delete(e),d}},function(t,e,n){var r=n(2);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(182)();t.exports=r},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(15),i=n(9),o=n(37),s=n(2);t.exports=function(t,e,n){if(!s(n))return!1;var a=typeof e;return!!("number"==a?i(n)&&o(e,n.length):"string"==a&&e in n)&&r(n[e],t)}},function(t,e,n){var r=n(25),i=n(83),o=n(79),s=n(193),a=n(2),c=n(17),u=n(84);t.exports=function t(e,n,f,l,h){e!==n&&o(n,(function(o,c){if(h||(h=new r),a(o))s(e,n,c,f,t,l,h);else{var p=l?l(u(e,c),o,c+"",e,n,h):void 0;void 0===p&&(p=o),i(e,c,p)}}),c)}},function(t,e,n){var r=n(39),i=n(15);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,n){var r=n(2),i=n(6),o=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=a.test(t);return n||c.test(t)?u(t.slice(2),n?2:8):s.test(t)?NaN:+t}},function(t,e,n){var r=n(198),i=n(199);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.i,i,""]]);var o,s=0,a={injectType:"lazyStyleTag",insert:"head",singleton:!1},c={};c.locals=i.locals||{},c.use=function(){return s++||(o=r(i,a)),c},c.unuse=function(){s>0&&!--s&&(o(),o=null)},t.exports=c},function(t,e,n){var r=n(201),i=n(9),o=n(205),s=n(206),a=n(208),c=Math.max;t.exports=function(t,e,n,u){t=i(t)?t:a(t),n=n&&!u?s(n):0;var f=t.length;return n<0&&(n=c(f+n,0)),o(t)?n<=f&&t.indexOf(e,n)>-1:!!f&&r(t,e,n)>-1}},function(t,e,n){t.exports=n(210)},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(211)((function(t,e){return t+e}),0);t.exports=r},function(t,e,n){var r=n(58);t.exports=function(){var t=arguments,e=r(t[0]);return t.length<3?e:e.replace(t[1],t[2])}},function(t,e,n){var r=n(2),i=n(213),o=n(85),s=Math.max,a=Math.min;t.exports=function(t,e,n){var c,u,f,l,h,p,v=0,d=!1,y=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function x(e){var n=c,r=u;return c=u=void 0,v=e,l=t.apply(r,n)}function g(t){return v=t,h=setTimeout(O,e),d?x(t):l}function m(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-v>=f}function O(){var t=i();if(m(t))return A(t);h=setTimeout(O,function(t){var n=e-(t-p);return y?a(n,f-(t-v)):n}(t))}function A(t){return h=void 0,b&&c?x(t):(c=u=void 0,l)}function j(){var t=i(),n=m(t);if(c=arguments,u=this,p=t,n){if(void 0===h)return g(p);if(y)return clearTimeout(h),h=setTimeout(O,e),x(p)}return void 0===h&&(h=setTimeout(O,e)),l}return e=o(e)||0,r(n)&&(d=!!n.leading,f=(y="maxWait"in n)?s(o(n.maxWait)||0,e):f,b="trailing"in n?!!n.trailing:b),j.cancel=function(){void 0!==h&&clearTimeout(h),v=0,c=p=u=h=void 0},j.flush=function(){return void 0===h?l:A(i())},j}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(12),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[a]=n:delete t[a]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(98),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=s},function(t,e,n){var r=n(99);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(33);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(101),i=n(20),o=n(35);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(102),i=n(107),o=n(108),s=n(109),a=n(110);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,t.exports=c},function(t,e,n){var r=n(19);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e,n){var r=n(34),i=n(104),o=n(2),s=n(57),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,f=c.toString,l=u.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:a).test(s(t))}},function(t,e,n){var r,i=n(105),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(3)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(19),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(19),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},function(t,e,n){var r=n(19);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(21),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(21);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(21);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(21);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(22);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(22);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(22);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(22);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(7),i=n(4);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e,n){var r=n(25),i=n(128),o=n(60),s=n(129),a=n(135),c=n(64),u=n(65),f=n(138),l=n(140),h=n(68),p=n(141),v=n(28),d=n(146),y=n(147),b=n(72),x=n(1),g=n(26),m=n(152),O=n(2),A=n(154),j=n(13),S=n(17),_={};_["[object Arguments]"]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_["[object Object]"]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_["[object Function]"]=_["[object WeakMap]"]=!1,t.exports=function t(e,n,C,E,k,w){var T,R=1&n,M=2&n,F=4&n;if(C&&(T=k?C(e,E,k,w):C(e)),void 0!==T)return T;if(!O(e))return e;var I=x(e);if(I){if(T=d(e),!R)return u(e,T)}else{var P=v(e),z="[object Function]"==P||"[object GeneratorFunction]"==P;if(g(e))return c(e,R);if("[object Object]"==P||"[object Arguments]"==P||z&&!k){if(T=M||z?{}:b(e),!R)return M?l(e,a(T,e)):f(e,s(T,e))}else{if(!_[P])return k?e:{};T=y(e,P,R)}}w||(w=new r);var L=w.get(e);if(L)return L;w.set(e,T),A(e)?e.forEach((function(r){T.add(t(r,n,C,r,e,w))})):m(e)&&e.forEach((function(r,i){T.set(i,t(r,n,C,i,e,w))}));var B=I?void 0:(F?M?p:h:M?S:j)(e);return i(B||e,(function(r,i){B&&(r=e[i=r]),o(T,i,t(r,n,C,i,e,w))})),T}},function(t,e,n){var r=n(20);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(20),i=n(35),o=n(33);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(t,e),this.size=n.size,this}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e,n){var r=n(16),i=n(13);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(7),i=n(38),o=n(4),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!s[r(t)]}},function(t,e,n){var r=n(43),i=n(134),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(63)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(16),i=n(17);t.exports=function(t,e){return t&&r(e,i(e),t)}},function(t,e,n){var r=n(2),i=n(43),o=n(137),s=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var a in t)("constructor"!=a||!e&&s.call(t,a))&&n.push(a);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(16),i=n(44);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}},function(t,e,n){var r=n(16),i=n(67);t.exports=function(t,e){return r(t,i(t),e)}},function(t,e,n){var r=n(69),i=n(67),o=n(17);t.exports=function(t){return r(t,o,i)}},function(t,e,n){var r=n(8)(n(3),"DataView");t.exports=r},function(t,e,n){var r=n(8)(n(3),"Promise");t.exports=r},function(t,e,n){var r=n(8)(n(3),"Set");t.exports=r},function(t,e,n){var r=n(8)(n(3),"WeakMap");t.exports=r},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(47),i=n(148),o=n(149),s=n(150),a=n(71);t.exports=function(t,e,n){var c=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new c(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(t,n);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(t);case"[object RegExp]":return o(t);case"[object Set]":return new c;case"[object Symbol]":return s(t)}}},function(t,e,n){var r=n(47);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(12),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},function(t,e,n){var r=n(2),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},function(t,e,n){var r=n(153),i=n(27),o=n(42),s=o&&o.isMap,a=s?i(s):r;t.exports=a},function(t,e,n){var r=n(28),i=n(4);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(155),i=n(27),o=n(42),s=o&&o.isSet,a=s?i(s):r;t.exports=a},function(t,e,n){var r=n(28),i=n(4);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},function(t,e,n){var r=n(157),i=n(168),o=n(77);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(25),i=n(74);t.exports=function(t,e,n,o){var s=n.length,a=s,c=!o;if(null==t)return!a;for(t=Object(t);s--;){var u=n[s];if(c&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++s<a;){var f=(u=n[s])[0],l=t[f],h=u[1];if(c&&u[2]){if(void 0===l&&!(f in t))return!1}else{var p=new r;if(o)var v=o(l,h,f,t,e,p);if(!(void 0===v?i(h,l,3,o,p):v))return!1}}return!0}},function(t,e,n){var r=n(25),i=n(75),o=n(164),s=n(167),a=n(28),c=n(1),u=n(26),f=n(41),l="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,p,v,d){var y=c(t),b=c(e),x=y?"[object Array]":a(t),g=b?"[object Array]":a(e),m=(x="[object Arguments]"==x?l:x)==l,O=(g="[object Arguments]"==g?l:g)==l,A=x==g;if(A&&u(t)){if(!u(e))return!1;y=!0,m=!1}if(A&&!m)return d||(d=new r),y||f(t)?i(t,e,n,p,v,d):o(t,e,x,n,p,v,d);if(!(1&n)){var j=m&&h.call(t,"__wrapped__"),S=O&&h.call(e,"__wrapped__");if(j||S){var _=j?t.value():t,C=S?e.value():e;return d||(d=new r),v(_,C,n,p,d)}}return!!A&&(d||(d=new r),s(t,e,n,p,v,d))}},function(t,e,n){var r=n(33),i=n(160),o=n(161);function s(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,t.exports=s},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(12),i=n(70),o=n(15),s=n(75),a=n(165),c=n(166),u=r?r.prototype:void 0,f=u?u.valueOf:void 0;t.exports=function(t,e,n,r,u,l,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var p=a;case"[object Set]":var v=1&r;if(p||(p=c),t.size!=e.size&&!v)return!1;var d=h.get(t);if(d)return d==e;r|=2,h.set(t,e);var y=s(p(t),p(e),r,u,l,h);return h.delete(t),y;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e,n){var r=n(68),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,s,a){var c=1&n,u=r(t),f=u.length;if(f!=r(e).length&&!c)return!1;for(var l=f;l--;){var h=u[l];if(!(c?h in e:i.call(e,h)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var d=!0;a.set(t,e),a.set(e,t);for(var y=c;++l<f;){var b=t[h=u[l]],x=e[h];if(o)var g=c?o(x,b,h,e,t,a):o(b,x,h,t,e,a);if(!(void 0===g?b===x||s(b,x,n,o,a):g)){d=!1;break}y||(y="constructor"==h)}if(d&&!y){var m=t.constructor,O=e.constructor;m==O||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof O&&O instanceof O||(d=!1)}return a.delete(t),a.delete(e),d}},function(t,e,n){var r=n(76),i=n(13);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],s=t[o];e[n]=[o,s,r(s)]}return e}},function(t,e,n){var r=n(74),i=n(170),o=n(171),s=n(32),a=n(76),c=n(77),u=n(24);t.exports=function(t,e){return s(t)&&a(e)?c(u(t),e):function(n){var s=i(n,t);return void 0===s&&s===e?o(n,t):r(e,s,3)}}},function(t,e,n){var r=n(49);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){var r=n(172),i=n(54);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(174),i=n(175),o=n(32),s=n(24);t.exports=function(t){return o(t)?r(s(t)):i(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(49);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(45),i=n(177);t.exports=function t(e,n,o,s,a){var c=-1,u=e.length;for(o||(o=i),a||(a=[]);++c<u;){var f=e[c];n>0&&o(f)?n>1?t(f,n-1,o,s,a):r(a,f):s||(a[a.length]=f)}return a}},function(t,e,n){var r=n(12),i=n(23),o=n(1),s=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(s&&t&&t[s])}},function(t,e,n){var r=n(36),i=n(49),o=n(48),s=n(179),a=n(184),c=n(27),u=n(185),f=n(14),l=n(1);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,c(o));var p=s(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return a(p,(function(t,e){return u(t,e,n)}))}},function(t,e,n){var r=n(180),i=n(9);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},function(t,e,n){var r=n(181),i=n(183)(r);t.exports=i},function(t,e,n){var r=n(79),i=n(13);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var c=s[t?a:++i];if(!1===n(o[c],c,o))break}return e}}},function(t,e,n){var r=n(9);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,s=e?o:-1,a=Object(n);(e?s--:++s<o)&&!1!==i(a[s],s,a););return n}}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(186);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,s=e.criteria,a=o.length,c=n.length;++i<a;){var u=r(o[i],s[i]);if(u)return i>=c?u:u*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(6);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,s=r(t),a=void 0!==e,c=null===e,u=e==e,f=r(e);if(!c&&!f&&!s&&t>e||s&&a&&u&&!c&&!f||i&&a&&u||!n&&u||!o)return 1;if(!i&&!s&&!f&&t<e||f&&n&&o&&!i&&!s||c&&n&&o||!a&&o||!u)return-1}return 0}},function(t,e,n){var r=n(80),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,a=i(o.length-e,0),c=Array(a);++s<a;)c[s]=o[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=o[s];return u[e]=n(c),r(t,this,u)}}},function(t,e,n){var r=n(189),i=n(191)(r);t.exports=i},function(t,e,n){var r=n(190),i=n(61),o=n(14),s=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=s},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(82),i=n(2);t.exports=function t(e,n,o,s,a,c){return i(e)&&i(n)&&(c.set(n,e),r(e,n,void 0,t,c),c.delete(n)),e}},function(t,e,n){var r=n(83),i=n(64),o=n(71),s=n(65),a=n(72),c=n(23),u=n(1),f=n(194),l=n(26),h=n(34),p=n(2),v=n(195),d=n(41),y=n(84),b=n(196);t.exports=function(t,e,n,x,g,m,O){var A=y(t,n),j=y(e,n),S=O.get(j);if(S)r(t,n,S);else{var _=m?m(A,j,n+"",t,e,O):void 0,C=void 0===_;if(C){var E=u(j),k=!E&&l(j),w=!E&&!k&&d(j);_=j,E||k||w?u(A)?_=A:f(A)?_=s(A):k?(C=!1,_=i(j,!0)):w?(C=!1,_=o(j,!0)):_=[]:v(j)||c(j)?(_=A,c(A)?_=b(A):p(A)&&!h(A)||(_=a(j))):C=!1}C&&(O.set(j,_),g(_,j,x,m,O),O.delete(j)),r(t,n,_)}}},function(t,e,n){var r=n(9),i=n(4);t.exports=function(t){return i(t)&&r(t)}},function(t,e,n){var r=n(7),i=n(46),o=n(4),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,f=c.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=u.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}},function(t,e,n){var r=n(16),i=n(17);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(50),i=n(81);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++r<o;){var c=n[r];c&&t(e,c,r,s)}return e}))}},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),s=[];function a(t){for(var e=-1,n=0;n<s.length;n++)if(s[n].identifier===t){e=n;break}return e}function c(t,e){for(var n={},r=[],i=0;i<t.length;i++){var o=t[i],c=e.base?o[0]+e.base:o[0],u=n[c]||0,f="".concat(c," ").concat(u);n[c]=u+1;var l=a(f),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==l?(s[l].references++,s[l].updater(h)):s.push({identifier:f,updater:y(h,e),references:1}),r.push(f)}return r}function u(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var s=o(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var f,l=(f=[],function(t,e){return f[t]=e,f.filter(Boolean).join("\n")});function h(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=l(e,i);else{var o=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function p(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var v=null,d=0;function y(t,e){var n,r,i;if(e.singleton){var o=d++;n=v||(v=u(e)),r=h.bind(null,n,o,!1),i=h.bind(null,n,o,!0)}else n=u(e),r=p.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=a(n[r]);s[i].references--}for(var o=c(t,e),u=0;u<n.length;u++){var f=a(n[u]);0===s[f].references&&(s[f].updater(),s.splice(f,1))}n=o}}}},function(t,e,n){(e=n(200)(!1)).push([t.i,".grid path {\n stroke-width: 0;\n}\n\n.grid line {\n stroke: lightgrey;\n stroke-opacity: 0.7;\n shape-rendering: crispEdges;\n}\n",""]),t.exports=e},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(s=r,a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(c," */")),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([i]).join("\n")}var s,a,c;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var s=this[o][0];null!=s&&(i[s]=!0)}for(var a=0;a<t.length;a++){var c=[].concat(t[a]);r&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},function(t,e,n){var r=n(202),i=n(203),o=n(204);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},function(t,e,n){var r=n(7),i=n(1),o=n(4);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},function(t,e,n){var r=n(207);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(85);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(209),i=n(13);t.exports=function(t){return null==t?[]:r(t,i(t))}},function(t,e,n){var r=n(36);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},function(t,e){t.exports=function(t){return t&&t.length?t[0]:void 0}},function(t,e,n){var r=n(212),i=n(59);t.exports=function(t,e){return function(n,o){var s;if(void 0===n&&void 0===o)return e;if(void 0!==n&&(s=n),void 0!==o){if(void 0===s)return o;"string"==typeof n||"string"==typeof o?(n=i(n),o=i(o)):(n=r(n),o=r(o)),s=t(n,o)}return s}}},function(t,e,n){var r=n(6);t.exports=function(t){return"number"==typeof t?t:r(t)?NaN:+t}},function(t,e,n){var r=n(3);t.exports=function(){return r.Date.now()}},function(t,e,n){"use strict";n.r(e),n.d(e,"ChartwerkPod",(function(){return rt})),n.d(e,"VueChartwerkPodMixin",(function(){return y})),n.d(e,"TickOrientation",(function(){return r})),n.d(e,"TimeFormat",(function(){return i})),n.d(e,"BrushOrientation",(function(){return o})),n.d(e,"PanOrientation",(function(){return s})),n.d(e,"AxisFormat",(function(){return u})),n.d(e,"yAxisOrientation",(function(){return p})),n.d(e,"CrosshairOrientation",(function(){return f})),n.d(e,"ScrollPanOrientation",(function(){return a})),n.d(e,"ScrollPanDirection",(function(){return c})),n.d(e,"KeyEvent",(function(){return l})),n.d(e,"palette",(function(){return N}));var r,i,o,s,a,c,u,f,l,h,p,v=n(0),d=n.n(v),y={props:{id:{type:String,required:!0},series:{type:Array,required:!1,default:function(){return[]}},options:{type:Object,required:!1,default:function(){return{}}}},watch:{id:function(){this.renderChart()},series:function(){this.renderChart()},options:function(){this.renderChart()}},mounted:function(){this.renderChart()},destroyed:function(){this.pod.removeEventListeners(),this.pod=void 0},methods:{render:function(){},renderSharedCrosshair:function(t){},hideSharedCrosshair:function(){},onPanningRescale:function(t){this.pod.rescaleMetricAndAxis(t)},renderChart:function(){this.appendEvents(),this.render()},appendEvents:function(){void 0===this.options.eventsCallbacks&&(this.options.eventsCallbacks={}),d()(this.$listeners,"zoomIn")&&(this.options.eventsCallbacks.zoomIn=this.zoomIn.bind(this)),d()(this.$listeners,"zoomOut")&&(this.options.eventsCallbacks.zoomOut=this.zoomOut.bind(this)),d()(this.$listeners,"mouseMove")&&(this.options.eventsCallbacks.mouseMove=this.mouseMove.bind(this)),d()(this.$listeners,"mouseOut")&&(this.options.eventsCallbacks.mouseOut=this.mouseOut.bind(this)),d()(this.$listeners,"onLegendClick")&&(this.options.eventsCallbacks.onLegendClick=this.onLegendClick.bind(this)),d()(this.$listeners,"panningEnd")&&(this.options.eventsCallbacks.panningEnd=this.panningEnd.bind(this)),d()(this.$listeners,"panning")&&(this.options.eventsCallbacks.panning=this.panning.bind(this)),d()(this.$listeners,"contextMenu")&&(this.options.eventsCallbacks.contextMenu=this.contextMenu.bind(this)),d()(this.$listeners,"sharedCrosshairMove")&&(this.options.eventsCallbacks.sharedCrosshairMove=this.sharedCrosshairMove.bind(this)),d()(this.$listeners,"renderStart")&&(this.options.eventsCallbacks.renderStart=this.renderStart.bind(this)),d()(this.$listeners,"renderEnd")&&(this.options.eventsCallbacks.renderEnd=this.renderEnd.bind(this))},zoomIn:function(t){this.$emit("zoomIn",t)},zoomOut:function(t){this.$emit("zoomOut",t)},mouseMove:function(t){this.$emit("mouseMove",t)},mouseOut:function(){this.$emit("mouseOut")},onLegendClick:function(t){this.$emit("onLegendClick",t)},panningEnd:function(t){this.$emit("panningEnd",t)},panning:function(t){this.$emit("panning",t)},contextMenu:function(t){this.$emit("contextMenu",t)},sharedCrosshairMove:function(t){this.$emit("sharedCrosshairMove",t)},renderStart:function(){this.$emit("renderStart")},renderEnd:function(){this.$emit("renderEnd")}}};!function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t.DIAGONAL="diagonal"}(r||(r={})),function(t){t.SECOND="second",t.MINUTE="minute",t.HOUR="hour",t.DAY="day",t.MONTH="month",t.YEAR="year"}(i||(i={})),function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t.RECTANGLE="rectangle",t.SQUARE="square"}(o||(o={})),function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t.BOTH="both"}(s||(s={})),function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal"}(a||(a={})),function(t){t.FORWARD="forward",t.BACKWARD="backward",t.BOTH="both"}(c||(c={})),function(t){t.TIME="time",t.NUMERIC="numeric",t.STRING="string",t.CUSTOM="custom"}(u||(u={})),function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t.BOTH="both"}(f||(f={})),function(t){t.MAIN="main",t.SHIFT="shift"}(l||(l={})),function(t){t.TOP="top",t.BOTTOM="bottom",t.BOTH="both"}(h||(h={})),function(t){t.LEFT="left",t.RIGHT="right",t.BOTH="both"}(p||(p={}));var b=n(10),x=n.n(b),g=n(11),m=n.n(g),O=n(30),A=n.n(O),j=n(5),S=n.n(j),_=n(31),C=n.n(_),E=n(52),k=n.n(E),w=n(53),T=n.n(w),R=[0,1],M={x:0,y:0,k:1},F=function(){function t(t,e,n,r){this._d3=t,this.boxParams=e,this.series=n,this.options=r,this._transform=x()(M),this.setInitialRanges(),this.initScales()}return t.prototype.setInitialRanges=function(){this._xValueRange=[this.getMinValueX(),this.getMaxValueX()],this._yValueRange=[this.getMinValueY(),this.getMaxValueY()],this._y1ValueRange=[this.getMinValueY1(),this.getMaxValueY1()]},t.prototype.initScales=function(){this.setXScale(),this.setYScale(),this.setY1Scale()},t.prototype.setYScale=function(){var t=this._yValueRange;t=k()(t),!0===this.options.axis.y.invert&&(t=T()(t)),this._yScale=this._d3.scaleLinear().domain(t).range([this.boxParams.height,0])},t.prototype.setXScale=function(){var t=this._xValueRange;this._xScale=this._d3.scaleLinear().domain(t).range([0,this.boxParams.width])},t.prototype.setY1Scale=function(){var t=this._y1ValueRange;t=k()(t),!0===this.options.axis.y1.invert&&(t=T()(t)),this._y1Scale=this._d3.scaleLinear().domain(t).range([this.boxParams.height,0])},t.prototype.clearState=function(){this.setInitialRanges(),this.initScales(),this._transform={x:0,y:0,k:1}},Object.defineProperty(t.prototype,"yScale",{get:function(){return this._yScale},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xScale",{get:function(){return this._xScale},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1Scale",{get:function(){return this._y1Scale},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xValueRange",{get:function(){return this._xValueRange},set:function(t){this._xValueRange=t,this.setXScale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yValueRange",{get:function(){return this._yValueRange},set:function(t){this._yValueRange=t,this.setYScale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1ValueRange",{get:function(){return this._y1ValueRange},set:function(t){this._y1ValueRange=t,this.setY1Scale()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this._transform},set:function(t){this._transform.x=void 0!==t.x?t.x:this._transform.x,this._transform.y=void 0!==t.y?t.y:this._transform.y,this._transform.k=void 0!==t.k?t.k:this._transform.k},enumerable:!1,configurable:!0}),t.prototype.getMinValueY=function(){var t=this;return this.isSeriesUnavailable?R[0]:void 0!==this.options.axis.y&&void 0!==this.options.axis.y.range?m()(this.options.axis.y.range):m()(this.series.filter((function(e){return!1!==e.visible&&t.filterSerieByYAxisOrientation(e,p.LEFT)})).map((function(t){return A()(t.datapoints,(function(t){return t[1]}))[1]})))},t.prototype.getMaxValueY=function(){var t=this;return this.isSeriesUnavailable?R[1]:void 0!==this.options.axis.y&&void 0!==this.options.axis.y.range?S()(this.options.axis.y.range):S()(this.series.filter((function(e){return!1!==e.visible&&t.filterSerieByYAxisOrientation(e,p.LEFT)})).map((function(t){return C()(t.datapoints,(function(t){return t[1]}))[1]})))},t.prototype.getMinValueX=function(){return this.isSeriesUnavailable?R[0]:void 0!==this.options.axis.x&&void 0!==this.options.axis.x.range?m()(this.options.axis.x.range):m()(this.series.filter((function(t){return!1!==t.visible})).map((function(t){return A()(t.datapoints,(function(t){return t[0]}))[0]})))},t.prototype.getMaxValueX=function(){return this.isSeriesUnavailable?R[1]:void 0!==this.options.axis.x&&void 0!==this.options.axis.x.range?S()(this.options.axis.x.range):S()(this.series.filter((function(t){return!1!==t.visible})).map((function(t){return C()(t.datapoints,(function(t){return t[0]}))[0]})))},t.prototype.getMinValueY1=function(){var t=this;return this.isSeriesUnavailable||void 0===this.options.axis.y1||!1===this.options.axis.y1.isActive?R[0]:void 0!==this.options.axis.y1.range?m()(this.options.axis.y1.range):m()(this.series.filter((function(e){return!1!==e.visible&&t.filterSerieByYAxisOrientation(e,p.RIGHT)})).map((function(t){return A()(t.datapoints,(function(t){return t[1]}))[1]})))},t.prototype.getMaxValueY1=function(){var t=this;return this.isSeriesUnavailable||void 0===this.options.axis.y1||!1===this.options.axis.y1.isActive?R[1]:void 0!==this.options.axis.y1&&void 0!==this.options.axis.y1.range?S()(this.options.axis.y1.range):S()(this.series.filter((function(e){return!1!==e.visible&&t.filterSerieByYAxisOrientation(e,p.RIGHT)})).map((function(t){return C()(t.datapoints,(function(t){return t[1]}))[1]})))},Object.defineProperty(t.prototype,"isSeriesUnavailable",{get:function(){return void 0===this.series||0===this.series.length||0===S()(this.series.map((function(t){return t.datapoints.length})))},enumerable:!1,configurable:!0}),t.prototype.filterSerieByYAxisOrientation=function(t,e){return void 0===t.yOrientation||t.yOrientation===p.BOTH||t.yOrientation===e},t}(),I=n(18),P=n.n(I),z={x:{enabled:!0,ticksCount:5},y:{enabled:!0,ticksCount:5}},L=function(){function t(t,e,n,r){this._d3=t,this._svgEl=e,this._svgElParams=n,this.gridOptions=this.setOptionDefaults(r)}return t.prototype.setOptionDefaults=function(t){return P()(t,z)},t.prototype.render=function(){this._svgEl.selectAll(".grid").remove(),this.renderGridLinesX(),this.renderGridLinesY(),this.updateStylesOfTicks()},t.prototype.renderGridLinesX=function(){this.gridOptions.x.enabled&&this._svgEl.append("g").attr("transform","translate(0,"+this._svgElParams.height+")").attr("class","grid x-grid").style("pointer-events","none").call(this._d3.axisBottom(this._svgElParams.xScale).ticks(this.gridOptions.x.ticksCount).tickSize(-this._svgElParams.height).tickFormat((function(){return""})))},t.prototype.renderGridLinesY=function(){this.gridOptions.y.enabled&&this._svgEl.append("g").attr("class","grid y-grid").style("pointer-events","none").call(this._d3.axisLeft(this._svgElParams.yScale).ticks(this.gridOptions.y.ticksCount).tickSize(-this._svgElParams.width).tickFormat((function(){return""})))},t.prototype.updateStylesOfTicks=function(){this._svgEl.selectAll(".grid").selectAll(".tick").attr("opacity","0.5"),this._svgEl.selectAll(".grid").select(".domain").style("pointer-events","none")},t}(),B=n(86),V=n.n(B);var N=["#FF6633","#FFB399","#FF33FF","#FFFF99","#00B3E6","#E6B333","#3366E6","#999966","#99FF99","#B34D4D","#80B300","#809900","#E6B3B3","#6680B3","#66991A","#FF99E6","#CCFF1A","#FF1A66","#E6331A","#33FFCC","#66994D","#B366CC","#4D8000","#B33300","#CC80CC","#66664D","#991AFF","#E666FF","#4DB3FF","#1AB399","#E666B3","#33991A","#CC9999","#B3B31A","#00E680","#4D8066","#809980","#E6FF80","#1AFF33","#999933","#FF3380","#CCCC00","#66E64D","#4D80CC","#9900B3","#E64D66","#4DB380","#FF4D4D","#99E6E6","#6666FF"],Y=n(87),D=n.n(Y),U=n(88),H=n.n(U),$=n(89),X=n.n($),G=n(51),Z=n.n(G),W=n(90),K=n.n(W),q=n(91),Q=n.n(q),J=n(92),tt=n.n(J),et={top:30,right:20,bottom:20,left:30},nt={confidence:0,timeInterval:{timeFormat:i.MINUTE},tickFormat:{xAxis:"%H:%M",xTickOrientation:r.HORIZONTAL},zoomEvents:{mouse:{zoom:{isActive:!0,keyEvent:l.MAIN,orientation:o.HORIZONTAL},pan:{isActive:!0,keyEvent:l.SHIFT,orientation:s.HORIZONTAL},doubleClick:{isActive:!0,keyEvent:l.MAIN}},scroll:{zoom:{isActive:!0,keyEvent:l.MAIN,orientation:s.BOTH},pan:{isActive:!1,keyEvent:l.SHIFT,panStep:50,orientation:a.HORIZONTAL,direction:c.BOTH}}},axis:{x:{isActive:!0,ticksCount:4,format:u.TIME},y:{isActive:!0,ticksCount:4,format:u.NUMERIC},y1:{isActive:!1,ticksCount:4,format:u.NUMERIC}},crosshair:{orientation:f.VERTICAL,color:"red"},renderTicksfromTimestamps:!1,renderLegend:!0},rt=function(){function t(t,e,n,r){void 0===n&&(n=[]),this.el=e,this.isPanning=!1,this.isBrushing=!1,this.brushStartSelection=null,this.yAxisTicksColors=[],this._clipPathUID="",this.deltaYTransform=0,this.debouncedRender=tt()(this.forceRerender.bind(this),100),V.a.use();var i=x()(r);P()(i,nt),this.options=i,this.series=x()(n),this.d3=t,this.d3Node=this.d3.select(this.el),this.addEventListeners(),this.createSvg(),this.initPodState(),this.initComponents()}return t.prototype.addEventListeners=function(){window.addEventListener("resize",this.debouncedRender)},t.prototype.removeEventListeners=function(){window.removeEventListener("resize",this.debouncedRender)},t.prototype.render=function(){d()(this.options.eventsCallbacks,"renderStart")&&this.options.eventsCallbacks.renderStart(),this.renderClipPath(),this.addEvents(),this.renderAxes(),this.renderGrid(),this.renderCrosshair(),this.renderMetricsContainer(),this.renderMetrics(),this.renderLegend(),this.renderYLabel(),this.renderXLabel(),d()(this.options.eventsCallbacks,"renderEnd")&&this.options.eventsCallbacks.renderEnd()},t.prototype.updateData=function(t,e,n){void 0===n&&(n=!0),this.updateSeries(t),this.updateOptions(e),n&&this.forceRerender()},t.prototype.forceRerender=function(){this.createSvg(),this.initPodState(),this.initComponents(),this.render()},t.prototype.updateOptions=function(t){if(void 0!==t){var e=x()(t);P()(e,nt),this.options=e}},t.prototype.updateSeries=function(t){if(void 0!==t){var e=x()(t);this.series=e}},t.prototype.initPodState=function(){var t={height:this.height,width:this.width};this.state=new F(this.d3,t,this.series,this.options)},t.prototype.initComponents=function(){var t={height:this.height,width:this.width,xScale:this.state.xScale,yScale:this.state.yScale};this.grid=new L(this.d3,this.chartContainer,t,this.options.grid)},t.prototype.renderMetricsContainer=function(){this.chartContainer.select(".metrics-container").remove();var t=this.chartContainer.append("g").attr("clip-path","url(#"+this.rectClipId+")").attr("class","metrics-container");this.metricContainer=t.append("g").attr("class","metrics-rect")},t.prototype.createSvg=function(){this.d3Node.select("svg").remove(),this.svg=this.d3Node.append("svg").style("width","100%").style("height","100%").style("backface-visibility","hidden"),this.chartContainer=this.svg.append("g").attr("transform","translate("+this.margin.left+","+this.margin.top+")")},t.prototype.renderGrid=function(){this.grid.render()},t.prototype.renderAxes=function(){this.renderXAxis(),this.renderYAxis(),this.renderY1Axis()},t.prototype.renderXAxis=function(){!1!==this.options.axis.x.isActive&&(this.chartContainer.select("#x-axis-container").remove(),this.xAxisElement=this.chartContainer.append("g").attr("transform","translate(0,"+this.height+")").attr("id","x-axis-container").style("pointer-events","none").call(this.d3.axisBottom(this.xScale).ticks(this.options.axis.x.ticksCount).tickSize(2).tickFormat(this.getAxisTicksFormatter(this.options.axis.x))),this.chartContainer.select("#x-axis-container").selectAll(".tick").selectAll("text").style("transform",this.xTickTransform))},t.prototype.renderYAxis=function(){var t=this;if(!1!==this.options.axis.y.isActive){this.chartContainer.select("#y-axis-container").remove(),this.yAxisTicksColors=[],this.yAxisElement=this.chartContainer.append("g").attr("id","y-axis-container").style("pointer-events","none").call(this.d3.axisLeft(this.yScale).ticks(this.options.axis.y.ticksCount).tickSize(2).tickFormat(this.getAxisTicksFormatter(this.options.axis.y)));var e=this.yAxisElement.selectAll(".tick").select("text").nodes();this.yAxisTicksColors.map((function(n,r){void 0!==e&&void 0!==e[r]&&t.d3.select(e[r]).attr("color",n)}))}},t.prototype.renderY1Axis=function(){!1!==this.options.axis.y1.isActive&&(this.chartContainer.select("#y1-axis-container").remove(),this.y1AxisElement=this.chartContainer.append("g").attr("id","y1-axis-container").attr("transform","translate("+this.width+",0)").style("pointer-events","none").call(this.d3.axisRight(this.y1Scale).ticks(4).tickSize(2).tickFormat(this.getAxisTicksFormatter(this.options.axis.y1))))},t.prototype.renderCrosshair=function(){this.chartContainer.select("#crosshair-container").remove(),this.crosshair=this.chartContainer.append("g").attr("id","crosshair-container").style("display","none"),this.options.crosshair.orientation!==f.VERTICAL&&this.options.crosshair.orientation!==f.BOTH||this.crosshair.append("line").attr("class","crosshair-line").attr("id","crosshair-line-x").attr("fill",this.options.crosshair.color).attr("stroke",this.options.crosshair.color).attr("stroke-width","1px").attr("y1",0).attr("y2",this.height).style("pointer-events","none"),this.options.crosshair.orientation!==f.HORIZONTAL&&this.options.crosshair.orientation!==f.BOTH||this.crosshair.append("line").attr("class","crosshair-line").attr("id","crosshair-line-y").attr("fill",this.options.crosshair.color).attr("stroke",this.options.crosshair.color).attr("stroke-width","1px").attr("x1",0).attr("x2",this.width).style("pointer-events","none")},t.prototype.addEvents=function(){var t=this.options.zoomEvents.mouse.pan.keyEvent;!0===this.options.zoomEvents.mouse.pan.isActive&&t===l.MAIN?(this.initPan(),this.initBrush()):(this.initBrush(),this.initPan()),this.chartContainer.on("mouseover",this.onMouseOver.bind(this)).on("mouseout",this.onMouseOut.bind(this)).on("mousemove",this.onMouseMove.bind(this)).on("dblclick.zoom",this.zoomOut.bind(this))},t.prototype.initBrush=function(){if(!1!==this.options.zoomEvents.mouse.zoom.isActive){switch(this.options.zoomEvents.mouse.zoom.orientation){case o.VERTICAL:this.brush=this.d3.brushY();break;case o.HORIZONTAL:this.brush=this.d3.brushX();break;case o.SQUARE:case o.RECTANGLE:this.brush=this.d3.brush();break;default:this.brush=this.d3.brushX()}var t=this.options.zoomEvents.mouse.zoom.keyEvent;this.brush.extent([[0,0],[this.width,this.height]]).handleSize(20).filter(this.filterByKeyEvent(t)).on("start",this.onBrushStart.bind(this)).on("brush",this.onBrush.bind(this)).on("end",this.onBrushEnd.bind(this)),this.chartContainer.call(this.brush)}},t.prototype.filterByKeyEvent=function(t){var e=this;switch(t){case l.MAIN:return function(){return!e.d3.event.shiftKey};case l.SHIFT:return function(){return e.d3.event.shiftKey};default:throw new Error("Unknown type of KeyEvent: "+t)}},t.prototype.isD3EventKeyEqualOption=function(t,e){return!(!t||!t.sourceEvent)&&t.sourceEvent.shiftKey===(e===l.SHIFT)},t.prototype.initPan=function(){!1===this.options.zoomEvents.mouse.pan.isActive&&!1===this.options.zoomEvents.scroll.pan.isActive&&!1===this.options.zoomEvents.scroll.zoom.isActive||(!1===this.options.zoomEvents.mouse.zoom.isActive&&(this.customOverlay=this.chartContainer.append("rect").attr("class","custom-overlay").attr("width",this.width).attr("height",this.height).attr("x",0).attr("y",0).attr("pointer-events","all").attr("cursor","crosshair").attr("fill","none")),this.initScaleX=this.xScale.copy(),this.initScaleY=this.yScale.copy(),!0===this.options.axis.y1.isActive&&(this.initScaleY1=this.y1Scale.copy()),this.pan=this.d3.zoom().on("zoom",this.onPanning.bind(this)).on("end",this.onPanningEnd.bind(this)),this.chartContainer.call(this.pan))},t.prototype.renderClipPath=function(){this.clipPath=this.chartContainer.append("defs").append("SVG:clipPath").attr("id",this.rectClipId).append("SVG:rect").attr("width",this.width).attr("height",this.height).attr("x",0).attr("y",0)},t.prototype.renderLegend=function(){var t=this;if(!1!==this.options.renderLegend&&this.series.length>0)for(var e=this.chartContainer.append("g").attr("class","legend-row"),n=function(n){if(D()(r.seriesTargetsWithBounds,r.series[n].target))return"continue";var i=0;null!==e.selectAll("text").node()&&(i=e.node().getBBox().width+25);var o=!1!==r.series[n].visible;e.append("foreignObject").attr("x",i).attr("y",r.legendRowPositionY-12).attr("width",13).attr("height",15).html("<form><input type=checkbox "+(o?"checked":"")+" /></form>").on("click",(function(){void 0!==t.options.eventsCallbacks&&void 0!==t.options.eventsCallbacks.onLegendClick&&t.options.eventsCallbacks.onLegendClick(n)})),e.append("text").attr("x",i+20).attr("y",r.legendRowPositionY).attr("class","metric-legend-"+n).style("font-size","12px").style("fill",r.getSerieColor(n)).text(r.series[n].target).on("click",(function(){void 0!==t.options.eventsCallbacks&&void 0!==t.options.eventsCallbacks.onLegendLabelClick&&t.options.eventsCallbacks.onLegendLabelClick(n)}))},r=this,i=0;i<this.series.length;i++)n(i)},t.prototype.renderYLabel=function(){void 0!==this.options.labelFormat&&void 0!==this.options.labelFormat.yAxis&&this.chartContainer.append("text").attr("y",0-this.margin.left).attr("x",0-this.height/2).attr("dy","1em").attr("class","y-axis-label").attr("transform","rotate(-90)").style("text-anchor","middle").style("font-size","14px").style("fill","currentColor").text(this.options.labelFormat.yAxis)},t.prototype.renderXLabel=function(){if(void 0!==this.options.labelFormat&&void 0!==this.options.labelFormat.xAxis){var t=this.height+this.margin.top+this.margin.bottom-35;0===this.series.length&&(t+=20),this.chartContainer.append("text").attr("class","x-axis-label").attr("x",this.width/2).attr("y",t).style("text-anchor","middle").style("font-size","14px").style("fill","currentColor").text(this.options.labelFormat.xAxis)}},t.prototype.renderNoDataPointsMessage=function(){this.chartContainer.append("text").attr("class","alert-text").attr("x",this.width/2).attr("y",this.height/2).style("text-anchor","middle").style("font-size","14px").style("fill","currentColor").text("No data points")},t.prototype.disableScrollForward=function(t){return t.sourceEvent.wheelDelta>0&&this.options.zoomEvents.scroll.pan.direction===c.FORWARD},t.prototype.disableScrollBackward=function(t){return t.sourceEvent.wheelDelta<0&&this.options.zoomEvents.scroll.pan.direction===c.BACKWARD},t.prototype.onPanning=function(){var t=this.d3.event;null!==t.sourceEvent&&void 0!==t.sourceEvent&&("wheel"===t.sourceEvent.type&&(this.disableScrollBackward(t)||this.disableScrollForward(t))||(this.rescaleMetricAndAxis(t),void 0!==this.options.eventsCallbacks&&void 0!==this.options.eventsCallbacks.panning?this.options.eventsCallbacks.panning({ranges:[this.state.xValueRange,this.state.yValueRange,this.state.y1ValueRange],d3Event:t}):console.log("on panning, but there is no callback")))},t.prototype.rescaleMetricAndAxis=function(t){this.isPanning=!0,this.onMouseOut(),this.onPanningRescale(t),this.renderYAxis(),this.renderXAxis(),this.chartContainer.select(".metrics-rect").attr("transform","translate("+this.state.transform.x+","+this.state.transform.y+"), scale("+this.state.transform.k+")")},t.prototype.onPanningRescale=function(t){var e=t.sourceEvent.type,n=this.options.zoomEvents.scroll.pan,r=this.options.zoomEvents.scroll.zoom;if("wheel"!==e){var i=this.options.zoomEvents.mouse.pan.orientation;i!==s.HORIZONTAL&&i!==s.BOTH||this.rescaleAxisX(t.transform.x),i!==s.VERTICAL&&i!==s.BOTH||this.rescaleAxisY(t.transform.y)}else{if(!0===n.isActive&&this.isD3EventKeyEqualOption(t,n.keyEvent))return void this.onScrollPanningRescale(t);if(!0===r.isActive&&this.isD3EventKeyEqualOption(t,r.keyEvent)){var o=r.orientation,a=void 0;switch(o){case s.HORIZONTAL:a=t.transform.k+",1",this.rescaleAxisX(t.transform.x);break;case s.VERTICAL:a="1,"+t.transform.k,this.rescaleAxisY(t.transform.y);break;case s.BOTH:a=t.transform.k,this.rescaleAxisX(t.transform.x),this.rescaleAxisY(t.transform.y);break;default:throw new Error("Unknown type of PanOrientation: "+o)}return void(this.state.transform.k=a)}}},t.prototype.rescaleAxisX=function(t){this.state.transform={x:t};var e=this.d3.event.transform.rescaleX(this.initScaleX);this.xAxisElement.call(this.d3.axisBottom(this.xScale).scale(e)),this.state.xValueRange=[e.invert(0),e.invert(this.width)]},t.prototype.rescaleAxisY=function(t){this.state.transform={y:t};var e=this.d3.event.transform.rescaleY(this.initScaleY);if(this.yAxisElement.call(this.d3.axisLeft(this.yScale).scale(e)),this.state.yValueRange=[e.invert(0),e.invert(this.height)],this.y1AxisElement){var n=this.d3.event.transform.rescaleY(this.initScaleY1);this.y1AxisElement.call(this.d3.axisLeft(this.y1Scale).scale(n)),this.state.y1ValueRange=[n.invert(0),n.invert(this.height)],this.y1AxisElement.selectAll("line").attr("x2",2),this.y1AxisElement.selectAll("text").attr("x",5)}},t.prototype.onScrollPanningRescale=function(t){var e=this.options.zoomEvents.scroll.pan,n=e.panStep,r=e.orientation;switch(r){case a.HORIZONTAL:var i=Math.sign(t.transform.x),o=this.absXScale.invert(Math.abs(n)),s=this.state.xValueRange;this.state.xValueRange=[s[0]+i*o,s[1]+i*o];var c=this.state.transform.x+i*n;this.state.transform={x:c};break;case a.VERTICAL:var u=Math.sign(t.transform.y);!0===this.options.axis.y.invert&&(u=-u);var f=this.state.yValueRange,l=this.absYScale.invert(n);if(this.deltaYTransform=this.deltaYTransform+n,this.deltaYTransform>.9*this.height)return;this.state.yValueRange=[f[0]-u*l,f[1]-u*l];var h=this.state.transform.y+u*n;this.state.transform={y:h};break;default:throw new Error("Unknown type of scroll pan orientation: "+r)}},t.prototype.onPanningEnd=function(){this.isPanning=!1,this.deltaYTransform=0,this.onMouseOut(),void 0!==this.options.eventsCallbacks&&void 0!==this.options.eventsCallbacks.panningEnd?this.options.eventsCallbacks.panningEnd([this.state.xValueRange,this.state.yValueRange,this.state.y1ValueRange]):console.log("on panning end, but there is no callback")},t.prototype.onBrush=function(){var t=this.d3.event.selection;if(this.options.zoomEvents.mouse.zoom.orientation===o.SQUARE&&null!==t){var e=this.getSelectionAttrs(t);void 0!==e&&this.chartContainer.select(".selection").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height)}},t.prototype.getSelectionAttrs=function(t){if(null!==this.brushStartSelection&&null!=t){var e=this.brushStartSelection[0],n=this.brushStartSelection[1],r=t[0][0],i=t[1][0],o=t[0][1],s=i-r,a=t[1][1]-o,c=Math.min(s,a);return{x:r===e?e:e-c,y:o===n?n:n-c,width:c,height:c}}},t.prototype.onBrushStart=function(){this.isBrushing;var t=this.d3.event.selection;null!==t&&t.length>0&&(this.brushStartSelection=this.d3.event.selection[0]),this.onMouseOut()},t.prototype.onBrushEnd=function(){var t=this.d3.event.selection;if(this.isBrushing,!(null==t||t.length<2)){var e,n;switch(this.chartContainer.call(this.brush.move,null),this.options.zoomEvents.mouse.zoom.orientation){case o.HORIZONTAL:var r=this.xScale.invert(t[0]),i=this.xScale.invert(t[1]);if(Math.abs(i-r)<this.timeInterval)return;e=[r,i],this.state.xValueRange=e;break;case o.VERTICAL:n=[this.yScale.invert(t[0]),this.yScale.invert(t[1])],this.state.yValueRange=n;break;case o.RECTANGLE:e=[this.xScale.invert(t[0][0]),this.xScale.invert(t[1][0])],n=[this.yScale.invert(t[0][1]),this.yScale.invert(t[1][1])],this.state.xValueRange=e,this.state.yValueRange=n;break;case o.SQUARE:var s=this.getSelectionAttrs(t);if(void 0===s)break;e=[this.xScale.invert(s.x),this.xScale.invert(s.x+s.width)],n=[this.yScale.invert(s.y),this.yScale.invert(s.y+s.height)],this.state.xValueRange=e,this.state.yValueRange=n,this.brushStartSelection=null}void 0!==this.options.eventsCallbacks&&void 0!==this.options.eventsCallbacks.zoomIn?this.options.eventsCallbacks.zoomIn([e,n]):console.log("zoom in, but there is no callback")}},t.prototype.zoomOut=function(){if(!0!==this.isOutOfChart()){var t={x:this.xScale.invert(this.width/2),y:this.yScale.invert(this.height/2)};void 0!==this.options.eventsCallbacks&&void 0!==this.options.eventsCallbacks.zoomOut?this.options.eventsCallbacks.zoomOut(t):console.log("zoom out, but there is no callback")}},Object.defineProperty(t.prototype,"absXScale",{get:function(){var t=[0,Math.abs(this.state.getMaxValueX()-this.state.getMinValueX())];return this.d3.scaleLinear().domain(t).range([0,this.width])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"absYScale",{get:function(){var t=[0,Math.abs(this.state.getMaxValueY()-this.state.getMinValueY())];return this.d3.scaleLinear().domain(t).range([0,this.height])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xScale",{get:function(){return this.state.xScale},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yScale",{get:function(){return this.state.yScale},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y1Scale",{get:function(){return this.state.y1Scale},enumerable:!1,configurable:!0}),t.prototype.getd3TimeRangeEvery=function(t){if(void 0===this.options.timeInterval||void 0===this.options.timeInterval.timeFormat)return this.d3.timeMinute.every(t);switch(this.options.timeInterval.timeFormat){case i.SECOND:return this.d3.utcSecond.every(t);case i.MINUTE:return this.d3.utcMinute.every(t);case i.HOUR:return this.d3.utcHour.every(t);case i.DAY:return this.d3.utcDay.every(t);case i.MONTH:return this.d3.utcMonth.every(t);case i.YEAR:return this.d3.utcYear.every(t);default:return this.d3.utcMinute.every(t)}},Object.defineProperty(t.prototype,"serieTimestampRange",{get:function(){if(0!==this.series.length){var t=H()(this.series[0].datapoints)[0];return(X()(this.series[0].datapoints)[0]-t)/1e3}},enumerable:!1,configurable:!0}),t.prototype.getAxisTicksFormatter=function(t){var e=this;if(0===t.ticksCount)return function(t){return""};switch(t.format){case u.TIME:return this.d3.timeFormat("%m/%d %H:%M");case u.NUMERIC:return function(t){return t};case u.STRING:throw new Error("Not supported AxisFormat type "+t.format+" yet");case u.CUSTOM:return void 0===t.valueFormatter?(console.warn("Value formatter for axis is not defined. Path options.axis.{?}.valueFormatter"),function(t){return t}):function(n,r){return void 0!==t.colorFormatter&&e.yAxisTicksColors.push(t.colorFormatter(n,r)),t.valueFormatter(n,r)};default:throw new Error("Unknown time format for axis: "+t.format)}},Object.defineProperty(t.prototype,"timeInterval",{get:function(){return void 0!==this.series&&this.series.length>0&&this.series[0].datapoints.length>1?this.series[0].datapoints[1][0]-this.series[0].datapoints[0][0]:void 0!==this.options.timeInterval&&void 0!==this.options.timeInterval.count?6e4*this.options.timeInterval.count:6e4},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xTickTransform",{get:function(){if(void 0===this.options.tickFormat||void 0===this.options.tickFormat.xTickOrientation)return"";switch(this.options.tickFormat.xTickOrientation){case r.VERTICAL:return"translate(-10px, 50px) rotate(-90deg)";case r.HORIZONTAL:return"";case r.DIAGONAL:return"translate(-30px, 30px) rotate(-45deg)";default:return""}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extraMargin",{get:function(){var t={top:0,right:0,bottom:0,left:0};if(void 0!==this.options.tickFormat&&void 0!==this.options.tickFormat.xTickOrientation)switch(this.options.tickFormat.xTickOrientation){case r.VERTICAL:t.bottom+=80;break;case r.HORIZONTAL:break;case r.DIAGONAL:t.left+=15,t.bottom+=50,t.right+=10}return void 0!==this.options.labelFormat&&(void 0!==this.options.labelFormat.xAxis&&this.options.labelFormat.xAxis.length>0&&(t.bottom+=20),void 0!==this.options.labelFormat.yAxis&&this.options.labelFormat.yAxis.length>0&&(t.left+=20)),this.series.length>0&&(t.bottom+=25),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.d3Node.node().clientWidth-this.margin.left-this.margin.right},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.d3Node.node().clientHeight-this.margin.top-this.margin.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"legendRowPositionY",{get:function(){return this.height+this.margin.bottom-5},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return void 0!==this.options.margin?this.options.margin:Z()({},et,this.extraMargin,K.a)},enumerable:!1,configurable:!0}),t.prototype.formattedBound=function(t,e){return Q()(t,"$__metric_name",e)},t.prototype.clearState=function(){this.state.clearState()},t.prototype.getSerieColor=function(t){if(void 0===this.series[t])throw new Error("Can't get color for unexisting serie: "+t+", there are only "+this.series.length+" series");var e=this.series[t].color;return void 0===e&&(e=N[t%N.length]),e},Object.defineProperty(t.prototype,"seriesTargetsWithBounds",{get:function(){var t=this;if(void 0===this.options.bounds||void 0===this.options.bounds.upper||void 0===this.options.bounds.lower)return[];var e=[];return this.series.forEach((function(n){e.push(t.formattedBound(t.options.bounds.upper,n.target)),e.push(t.formattedBound(t.options.bounds.lower,n.target))})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleSeries",{get:function(){return this.series.filter((function(t){return!1!==t.visible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rectClipId",{get:function(){return 0===this._clipPathUID.length&&(this._clipPathUID=Math.random().toString(36).substr(2,12)),this._clipPathUID},enumerable:!1,configurable:!0}),t.prototype.isOutOfChart=function(){var t=this.d3.mouse(this.chartContainer.node()),e=t[0],n=t[1];return n>this.height+1||n<-1||e>this.width||e<0},t}()}])})); |
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/array.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/array.js ***! |
|
\*********************************************/ |
|
/*! exports provided: slice, map */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; }); |
|
var array = Array.prototype; |
|
|
|
var slice = array.slice; |
|
var map = array.map; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/ascending.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-array/src/ascending.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/bisect.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-array/src/bisect.js ***! |
|
\**********************************************/ |
|
/*! exports provided: bisectRight, bisectLeft, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bisectRight", function() { return bisectRight; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bisectLeft", function() { return bisectLeft; }); |
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ascending */ "../node_modules/d3-array/src/ascending.js"); |
|
/* harmony import */ var _bisector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bisector */ "../node_modules/d3-array/src/bisector.js"); |
|
|
|
|
|
|
|
var ascendingBisect = Object(_bisector__WEBPACK_IMPORTED_MODULE_1__["default"])(_ascending__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
var bisectRight = ascendingBisect.right; |
|
var bisectLeft = ascendingBisect.left; |
|
/* harmony default export */ __webpack_exports__["default"] = (bisectRight); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/bisector.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-array/src/bisector.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ascending */ "../node_modules/d3-array/src/ascending.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(compare) { |
|
if (compare.length === 1) compare = ascendingComparator(compare); |
|
return { |
|
left: function(a, x, lo, hi) { |
|
if (lo == null) lo = 0; |
|
if (hi == null) hi = a.length; |
|
while (lo < hi) { |
|
var mid = lo + hi >>> 1; |
|
if (compare(a[mid], x) < 0) lo = mid + 1; |
|
else hi = mid; |
|
} |
|
return lo; |
|
}, |
|
right: function(a, x, lo, hi) { |
|
if (lo == null) lo = 0; |
|
if (hi == null) hi = a.length; |
|
while (lo < hi) { |
|
var mid = lo + hi >>> 1; |
|
if (compare(a[mid], x) > 0) hi = mid; |
|
else lo = mid + 1; |
|
} |
|
return lo; |
|
} |
|
}; |
|
}); |
|
|
|
function ascendingComparator(f) { |
|
return function(d, x) { |
|
return Object(_ascending__WEBPACK_IMPORTED_MODULE_0__["default"])(f(d), x); |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/constant.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-array/src/constant.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/cross.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/cross.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _pairs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pairs */ "../node_modules/d3-array/src/pairs.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values0, values1, reduce) { |
|
var n0 = values0.length, |
|
n1 = values1.length, |
|
values = new Array(n0 * n1), |
|
i0, |
|
i1, |
|
i, |
|
value0; |
|
|
|
if (reduce == null) reduce = _pairs__WEBPACK_IMPORTED_MODULE_0__["pair"]; |
|
|
|
for (i0 = i = 0; i0 < n0; ++i0) { |
|
for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) { |
|
values[i] = reduce(value0, values1[i1]); |
|
} |
|
} |
|
|
|
return values; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/descending.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-array/src/descending.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/deviation.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-array/src/deviation.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _variance__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variance */ "../node_modules/d3-array/src/variance.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(array, f) { |
|
var v = Object(_variance__WEBPACK_IMPORTED_MODULE_0__["default"])(array, f); |
|
return v ? Math.sqrt(v) : v; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/extent.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-array/src/extent.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
i = -1, |
|
value, |
|
min, |
|
max; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { // Find the first comparable value. |
|
if ((value = values[i]) != null && value >= value) { |
|
min = max = value; |
|
while (++i < n) { // Compare the remaining values. |
|
if ((value = values[i]) != null) { |
|
if (min > value) min = value; |
|
if (max < value) max = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { // Find the first comparable value. |
|
if ((value = valueof(values[i], i, values)) != null && value >= value) { |
|
min = max = value; |
|
while (++i < n) { // Compare the remaining values. |
|
if ((value = valueof(values[i], i, values)) != null) { |
|
if (min > value) min = value; |
|
if (max < value) max = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
return [min, max]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/histogram.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-array/src/histogram.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "../node_modules/d3-array/src/array.js"); |
|
/* harmony import */ var _bisect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bisect */ "../node_modules/d3-array/src/bisect.js"); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-array/src/constant.js"); |
|
/* harmony import */ var _extent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extent */ "../node_modules/d3-array/src/extent.js"); |
|
/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./identity */ "../node_modules/d3-array/src/identity.js"); |
|
/* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "../node_modules/d3-array/src/range.js"); |
|
/* harmony import */ var _ticks__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ticks */ "../node_modules/d3-array/src/ticks.js"); |
|
/* harmony import */ var _threshold_sturges__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./threshold/sturges */ "../node_modules/d3-array/src/threshold/sturges.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var value = _identity__WEBPACK_IMPORTED_MODULE_4__["default"], |
|
domain = _extent__WEBPACK_IMPORTED_MODULE_3__["default"], |
|
threshold = _threshold_sturges__WEBPACK_IMPORTED_MODULE_7__["default"]; |
|
|
|
function histogram(data) { |
|
var i, |
|
n = data.length, |
|
x, |
|
values = new Array(n); |
|
|
|
for (i = 0; i < n; ++i) { |
|
values[i] = value(data[i], i, data); |
|
} |
|
|
|
var xz = domain(values), |
|
x0 = xz[0], |
|
x1 = xz[1], |
|
tz = threshold(values, x0, x1); |
|
|
|
// Convert number of thresholds into uniform thresholds. |
|
if (!Array.isArray(tz)) { |
|
tz = Object(_ticks__WEBPACK_IMPORTED_MODULE_6__["tickStep"])(x0, x1, tz); |
|
tz = Object(_range__WEBPACK_IMPORTED_MODULE_5__["default"])(Math.ceil(x0 / tz) * tz, x1, tz); // exclusive |
|
} |
|
|
|
// Remove any thresholds outside the domain. |
|
var m = tz.length; |
|
while (tz[0] <= x0) tz.shift(), --m; |
|
while (tz[m - 1] > x1) tz.pop(), --m; |
|
|
|
var bins = new Array(m + 1), |
|
bin; |
|
|
|
// Initialize bins. |
|
for (i = 0; i <= m; ++i) { |
|
bin = bins[i] = []; |
|
bin.x0 = i > 0 ? tz[i - 1] : x0; |
|
bin.x1 = i < m ? tz[i] : x1; |
|
} |
|
|
|
// Assign data to bins by value, ignoring any outside the domain. |
|
for (i = 0; i < n; ++i) { |
|
x = values[i]; |
|
if (x0 <= x && x <= x1) { |
|
bins[Object(_bisect__WEBPACK_IMPORTED_MODULE_1__["default"])(tz, x, 0, m)].push(data[i]); |
|
} |
|
} |
|
|
|
return bins; |
|
} |
|
|
|
histogram.value = function(_) { |
|
return arguments.length ? (value = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_2__["default"])(_), histogram) : value; |
|
}; |
|
|
|
histogram.domain = function(_) { |
|
return arguments.length ? (domain = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_2__["default"])([_[0], _[1]]), histogram) : domain; |
|
}; |
|
|
|
histogram.thresholds = function(_) { |
|
return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? Object(_constant__WEBPACK_IMPORTED_MODULE_2__["default"])(_array__WEBPACK_IMPORTED_MODULE_0__["slice"].call(_)) : Object(_constant__WEBPACK_IMPORTED_MODULE_2__["default"])(_), histogram) : threshold; |
|
}; |
|
|
|
return histogram; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/identity.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-array/src/identity.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: bisect, bisectRight, bisectLeft, ascending, bisector, cross, descending, deviation, extent, histogram, thresholdFreedmanDiaconis, thresholdScott, thresholdSturges, max, mean, median, merge, min, pairs, permute, quantile, range, scan, shuffle, sum, ticks, tickIncrement, tickStep, transpose, variance, zip */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _bisect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bisect */ "../node_modules/d3-array/src/bisect.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisect", function() { return _bisect__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisectRight", function() { return _bisect__WEBPACK_IMPORTED_MODULE_0__["bisectRight"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisectLeft", function() { return _bisect__WEBPACK_IMPORTED_MODULE_0__["bisectLeft"]; }); |
|
|
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ascending */ "../node_modules/d3-array/src/ascending.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ascending", function() { return _ascending__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _bisector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bisector */ "../node_modules/d3-array/src/bisector.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisector", function() { return _bisector__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _cross__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cross */ "../node_modules/d3-array/src/cross.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return _cross__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _descending__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descending */ "../node_modules/d3-array/src/descending.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "descending", function() { return _descending__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _deviation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./deviation */ "../node_modules/d3-array/src/deviation.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deviation", function() { return _deviation__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _extent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./extent */ "../node_modules/d3-array/src/extent.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extent", function() { return _extent__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _histogram__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./histogram */ "../node_modules/d3-array/src/histogram.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "histogram", function() { return _histogram__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _threshold_freedmanDiaconis__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./threshold/freedmanDiaconis */ "../node_modules/d3-array/src/threshold/freedmanDiaconis.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thresholdFreedmanDiaconis", function() { return _threshold_freedmanDiaconis__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _threshold_scott__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./threshold/scott */ "../node_modules/d3-array/src/threshold/scott.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thresholdScott", function() { return _threshold_scott__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _threshold_sturges__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./threshold/sturges */ "../node_modules/d3-array/src/threshold/sturges.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thresholdSturges", function() { return _threshold_sturges__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./max */ "../node_modules/d3-array/src/max.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _mean__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./mean */ "../node_modules/d3-array/src/mean.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony import */ var _median__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./median */ "../node_modules/d3-array/src/median.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "median", function() { return _median__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony import */ var _merge__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./merge */ "../node_modules/d3-array/src/merge.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./min */ "../node_modules/d3-array/src/min.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
/* harmony import */ var _pairs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./pairs */ "../node_modules/d3-array/src/pairs.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return _pairs__WEBPACK_IMPORTED_MODULE_16__["default"]; }); |
|
|
|
/* harmony import */ var _permute__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./permute */ "../node_modules/d3-array/src/permute.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "permute", function() { return _permute__WEBPACK_IMPORTED_MODULE_17__["default"]; }); |
|
|
|
/* harmony import */ var _quantile__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./quantile */ "../node_modules/d3-array/src/quantile.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quantile", function() { return _quantile__WEBPACK_IMPORTED_MODULE_18__["default"]; }); |
|
|
|
/* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./range */ "../node_modules/d3-array/src/range.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range__WEBPACK_IMPORTED_MODULE_19__["default"]; }); |
|
|
|
/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./scan */ "../node_modules/d3-array/src/scan.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _scan__WEBPACK_IMPORTED_MODULE_20__["default"]; }); |
|
|
|
/* harmony import */ var _shuffle__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./shuffle */ "../node_modules/d3-array/src/shuffle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle__WEBPACK_IMPORTED_MODULE_21__["default"]; }); |
|
|
|
/* harmony import */ var _sum__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sum */ "../node_modules/d3-array/src/sum.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum__WEBPACK_IMPORTED_MODULE_22__["default"]; }); |
|
|
|
/* harmony import */ var _ticks__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./ticks */ "../node_modules/d3-array/src/ticks.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ticks", function() { return _ticks__WEBPACK_IMPORTED_MODULE_23__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tickIncrement", function() { return _ticks__WEBPACK_IMPORTED_MODULE_23__["tickIncrement"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tickStep", function() { return _ticks__WEBPACK_IMPORTED_MODULE_23__["tickStep"]; }); |
|
|
|
/* harmony import */ var _transpose__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./transpose */ "../node_modules/d3-array/src/transpose.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return _transpose__WEBPACK_IMPORTED_MODULE_24__["default"]; }); |
|
|
|
/* harmony import */ var _variance__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./variance */ "../node_modules/d3-array/src/variance.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "variance", function() { return _variance__WEBPACK_IMPORTED_MODULE_25__["default"]; }); |
|
|
|
/* harmony import */ var _zip__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./zip */ "../node_modules/d3-array/src/zip.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip__WEBPACK_IMPORTED_MODULE_26__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/max.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-array/src/max.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
i = -1, |
|
value, |
|
max; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { // Find the first comparable value. |
|
if ((value = values[i]) != null && value >= value) { |
|
max = value; |
|
while (++i < n) { // Compare the remaining values. |
|
if ((value = values[i]) != null && value > max) { |
|
max = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { // Find the first comparable value. |
|
if ((value = valueof(values[i], i, values)) != null && value >= value) { |
|
max = value; |
|
while (++i < n) { // Compare the remaining values. |
|
if ((value = valueof(values[i], i, values)) != null && value > max) { |
|
max = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
return max; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/mean.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-array/src/mean.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number */ "../node_modules/d3-array/src/number.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
m = n, |
|
i = -1, |
|
value, |
|
sum = 0; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { |
|
if (!isNaN(value = Object(_number__WEBPACK_IMPORTED_MODULE_0__["default"])(values[i]))) sum += value; |
|
else --m; |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { |
|
if (!isNaN(value = Object(_number__WEBPACK_IMPORTED_MODULE_0__["default"])(valueof(values[i], i, values)))) sum += value; |
|
else --m; |
|
} |
|
} |
|
|
|
if (m) return sum / m; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/median.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-array/src/median.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ascending */ "../node_modules/d3-array/src/ascending.js"); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./number */ "../node_modules/d3-array/src/number.js"); |
|
/* harmony import */ var _quantile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./quantile */ "../node_modules/d3-array/src/quantile.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
i = -1, |
|
value, |
|
numbers = []; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { |
|
if (!isNaN(value = Object(_number__WEBPACK_IMPORTED_MODULE_1__["default"])(values[i]))) { |
|
numbers.push(value); |
|
} |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { |
|
if (!isNaN(value = Object(_number__WEBPACK_IMPORTED_MODULE_1__["default"])(valueof(values[i], i, values)))) { |
|
numbers.push(value); |
|
} |
|
} |
|
} |
|
|
|
return Object(_quantile__WEBPACK_IMPORTED_MODULE_2__["default"])(numbers.sort(_ascending__WEBPACK_IMPORTED_MODULE_0__["default"]), 0.5); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/merge.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/merge.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(arrays) { |
|
var n = arrays.length, |
|
m, |
|
i = -1, |
|
j = 0, |
|
merged, |
|
array; |
|
|
|
while (++i < n) j += arrays[i].length; |
|
merged = new Array(j); |
|
|
|
while (--n >= 0) { |
|
array = arrays[n]; |
|
m = array.length; |
|
while (--m >= 0) { |
|
merged[--j] = array[m]; |
|
} |
|
} |
|
|
|
return merged; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/min.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-array/src/min.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
i = -1, |
|
value, |
|
min; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { // Find the first comparable value. |
|
if ((value = values[i]) != null && value >= value) { |
|
min = value; |
|
while (++i < n) { // Compare the remaining values. |
|
if ((value = values[i]) != null && min > value) { |
|
min = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { // Find the first comparable value. |
|
if ((value = valueof(values[i], i, values)) != null && value >= value) { |
|
min = value; |
|
while (++i < n) { // Compare the remaining values. |
|
if ((value = valueof(values[i], i, values)) != null && min > value) { |
|
min = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
return min; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/number.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-array/src/number.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return x === null ? NaN : +x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/pairs.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/pairs.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default, pair */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pair", function() { return pair; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(array, f) { |
|
if (f == null) f = pair; |
|
var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n); |
|
while (i < n) pairs[i] = f(p, p = array[++i]); |
|
return pairs; |
|
}); |
|
|
|
function pair(a, b) { |
|
return [a, b]; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/permute.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-array/src/permute.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(array, indexes) { |
|
var i = indexes.length, permutes = new Array(i); |
|
while (i--) permutes[i] = array[indexes[i]]; |
|
return permutes; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/quantile.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-array/src/quantile.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number */ "../node_modules/d3-array/src/number.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, p, valueof) { |
|
if (valueof == null) valueof = _number__WEBPACK_IMPORTED_MODULE_0__["default"]; |
|
if (!(n = values.length)) return; |
|
if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values); |
|
if (p >= 1) return +valueof(values[n - 1], n - 1, values); |
|
var n, |
|
i = (n - 1) * p, |
|
i0 = Math.floor(i), |
|
value0 = +valueof(values[i0], i0, values), |
|
value1 = +valueof(values[i0 + 1], i0 + 1, values); |
|
return value0 + (value1 - value0) * (i - i0); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/range.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/range.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(start, stop, step) { |
|
start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; |
|
|
|
var i = -1, |
|
n = Math.max(0, Math.ceil((stop - start) / step)) | 0, |
|
range = new Array(n); |
|
|
|
while (++i < n) { |
|
range[i] = start + i * step; |
|
} |
|
|
|
return range; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/scan.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-array/src/scan.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ascending */ "../node_modules/d3-array/src/ascending.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, compare) { |
|
if (!(n = values.length)) return; |
|
var n, |
|
i = 0, |
|
j = 0, |
|
xi, |
|
xj = values[j]; |
|
|
|
if (compare == null) compare = _ascending__WEBPACK_IMPORTED_MODULE_0__["default"]; |
|
|
|
while (++i < n) { |
|
if (compare(xi = values[i], xj) < 0 || compare(xj, xj) !== 0) { |
|
xj = xi, j = i; |
|
} |
|
} |
|
|
|
if (compare(xj, xj) === 0) return j; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/shuffle.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-array/src/shuffle.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(array, i0, i1) { |
|
var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0), |
|
t, |
|
i; |
|
|
|
while (m) { |
|
i = Math.random() * m-- | 0; |
|
t = array[m + i0]; |
|
array[m + i0] = array[i + i0]; |
|
array[i + i0] = t; |
|
} |
|
|
|
return array; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/sum.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-array/src/sum.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
i = -1, |
|
value, |
|
sum = 0; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { |
|
if (value = +values[i]) sum += value; // Note: zero and null are equivalent. |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { |
|
if (value = +valueof(values[i], i, values)) sum += value; |
|
} |
|
} |
|
|
|
return sum; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/threshold/freedmanDiaconis.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-array/src/threshold/freedmanDiaconis.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../array */ "../node_modules/d3-array/src/array.js"); |
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ascending */ "../node_modules/d3-array/src/ascending.js"); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../number */ "../node_modules/d3-array/src/number.js"); |
|
/* harmony import */ var _quantile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../quantile */ "../node_modules/d3-array/src/quantile.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, min, max) { |
|
values = _array__WEBPACK_IMPORTED_MODULE_0__["map"].call(values, _number__WEBPACK_IMPORTED_MODULE_2__["default"]).sort(_ascending__WEBPACK_IMPORTED_MODULE_1__["default"]); |
|
return Math.ceil((max - min) / (2 * (Object(_quantile__WEBPACK_IMPORTED_MODULE_3__["default"])(values, 0.75) - Object(_quantile__WEBPACK_IMPORTED_MODULE_3__["default"])(values, 0.25)) * Math.pow(values.length, -1 / 3))); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/threshold/scott.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-array/src/threshold/scott.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _deviation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../deviation */ "../node_modules/d3-array/src/deviation.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, min, max) { |
|
return Math.ceil((max - min) / (3.5 * Object(_deviation__WEBPACK_IMPORTED_MODULE_0__["default"])(values) * Math.pow(values.length, -1 / 3))); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/threshold/sturges.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-array/src/threshold/sturges.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(values) { |
|
return Math.ceil(Math.log(values.length) / Math.LN2) + 1; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/ticks.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-array/src/ticks.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default, tickIncrement, tickStep */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tickIncrement", function() { return tickIncrement; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tickStep", function() { return tickStep; }); |
|
var e10 = Math.sqrt(50), |
|
e5 = Math.sqrt(10), |
|
e2 = Math.sqrt(2); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(start, stop, count) { |
|
var reverse, |
|
i = -1, |
|
n, |
|
ticks, |
|
step; |
|
|
|
stop = +stop, start = +start, count = +count; |
|
if (start === stop && count > 0) return [start]; |
|
if (reverse = stop < start) n = start, start = stop, stop = n; |
|
if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return []; |
|
|
|
if (step > 0) { |
|
start = Math.ceil(start / step); |
|
stop = Math.floor(stop / step); |
|
ticks = new Array(n = Math.ceil(stop - start + 1)); |
|
while (++i < n) ticks[i] = (start + i) * step; |
|
} else { |
|
start = Math.floor(start * step); |
|
stop = Math.ceil(stop * step); |
|
ticks = new Array(n = Math.ceil(start - stop + 1)); |
|
while (++i < n) ticks[i] = (start - i) / step; |
|
} |
|
|
|
if (reverse) ticks.reverse(); |
|
|
|
return ticks; |
|
}); |
|
|
|
function tickIncrement(start, stop, count) { |
|
var step = (stop - start) / Math.max(0, count), |
|
power = Math.floor(Math.log(step) / Math.LN10), |
|
error = step / Math.pow(10, power); |
|
return power >= 0 |
|
? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) |
|
: -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); |
|
} |
|
|
|
function tickStep(start, stop, count) { |
|
var step0 = Math.abs(stop - start) / Math.max(0, count), |
|
step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), |
|
error = step0 / step1; |
|
if (error >= e10) step1 *= 10; |
|
else if (error >= e5) step1 *= 5; |
|
else if (error >= e2) step1 *= 2; |
|
return stop < start ? -step1 : step1; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/transpose.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-array/src/transpose.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./min */ "../node_modules/d3-array/src/min.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(matrix) { |
|
if (!(n = matrix.length)) return []; |
|
for (var i = -1, m = Object(_min__WEBPACK_IMPORTED_MODULE_0__["default"])(matrix, length), transpose = new Array(m); ++i < m;) { |
|
for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) { |
|
row[j] = matrix[j][i]; |
|
} |
|
} |
|
return transpose; |
|
}); |
|
|
|
function length(d) { |
|
return d.length; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/variance.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-array/src/variance.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number */ "../node_modules/d3-array/src/number.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values, valueof) { |
|
var n = values.length, |
|
m = 0, |
|
i = -1, |
|
mean = 0, |
|
value, |
|
delta, |
|
sum = 0; |
|
|
|
if (valueof == null) { |
|
while (++i < n) { |
|
if (!isNaN(value = Object(_number__WEBPACK_IMPORTED_MODULE_0__["default"])(values[i]))) { |
|
delta = value - mean; |
|
mean += delta / ++m; |
|
sum += delta * (value - mean); |
|
} |
|
} |
|
} |
|
|
|
else { |
|
while (++i < n) { |
|
if (!isNaN(value = Object(_number__WEBPACK_IMPORTED_MODULE_0__["default"])(valueof(values[i], i, values)))) { |
|
delta = value - mean; |
|
mean += delta / ++m; |
|
sum += delta * (value - mean); |
|
} |
|
} |
|
} |
|
|
|
if (m > 1) return sum / (m - 1); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-array/src/zip.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-array/src/zip.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _transpose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transpose */ "../node_modules/d3-array/src/transpose.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_transpose__WEBPACK_IMPORTED_MODULE_0__["default"])(arguments); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-axis/src/array.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-axis/src/array.js ***! |
|
\********************************************/ |
|
/*! exports provided: slice */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
var slice = Array.prototype.slice; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-axis/src/axis.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-axis/src/axis.js ***! |
|
\*******************************************/ |
|
/*! exports provided: axisTop, axisRight, axisBottom, axisLeft */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "axisTop", function() { return axisTop; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "axisRight", function() { return axisRight; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "axisBottom", function() { return axisBottom; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "axisLeft", function() { return axisLeft; }); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "../node_modules/d3-axis/src/array.js"); |
|
/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity */ "../node_modules/d3-axis/src/identity.js"); |
|
|
|
|
|
|
|
var top = 1, |
|
right = 2, |
|
bottom = 3, |
|
left = 4, |
|
epsilon = 1e-6; |
|
|
|
function translateX(x) { |
|
return "translate(" + (x + 0.5) + ",0)"; |
|
} |
|
|
|
function translateY(y) { |
|
return "translate(0," + (y + 0.5) + ")"; |
|
} |
|
|
|
function number(scale) { |
|
return function(d) { |
|
return +scale(d); |
|
}; |
|
} |
|
|
|
function center(scale) { |
|
var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset. |
|
if (scale.round()) offset = Math.round(offset); |
|
return function(d) { |
|
return +scale(d) + offset; |
|
}; |
|
} |
|
|
|
function entering() { |
|
return !this.__axis; |
|
} |
|
|
|
function axis(orient, scale) { |
|
var tickArguments = [], |
|
tickValues = null, |
|
tickFormat = null, |
|
tickSizeInner = 6, |
|
tickSizeOuter = 6, |
|
tickPadding = 3, |
|
k = orient === top || orient === left ? -1 : 1, |
|
x = orient === left || orient === right ? "x" : "y", |
|
transform = orient === top || orient === bottom ? translateX : translateY; |
|
|
|
function axis(context) { |
|
var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues, |
|
format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : _identity__WEBPACK_IMPORTED_MODULE_1__["default"]) : tickFormat, |
|
spacing = Math.max(tickSizeInner, 0) + tickPadding, |
|
range = scale.range(), |
|
range0 = +range[0] + 0.5, |
|
range1 = +range[range.length - 1] + 0.5, |
|
position = (scale.bandwidth ? center : number)(scale.copy()), |
|
selection = context.selection ? context.selection() : context, |
|
path = selection.selectAll(".domain").data([null]), |
|
tick = selection.selectAll(".tick").data(values, scale).order(), |
|
tickExit = tick.exit(), |
|
tickEnter = tick.enter().append("g").attr("class", "tick"), |
|
line = tick.select("line"), |
|
text = tick.select("text"); |
|
|
|
path = path.merge(path.enter().insert("path", ".tick") |
|
.attr("class", "domain") |
|
.attr("stroke", "currentColor")); |
|
|
|
tick = tick.merge(tickEnter); |
|
|
|
line = line.merge(tickEnter.append("line") |
|
.attr("stroke", "currentColor") |
|
.attr(x + "2", k * tickSizeInner)); |
|
|
|
text = text.merge(tickEnter.append("text") |
|
.attr("fill", "currentColor") |
|
.attr(x, k * spacing) |
|
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em")); |
|
|
|
if (context !== selection) { |
|
path = path.transition(context); |
|
tick = tick.transition(context); |
|
line = line.transition(context); |
|
text = text.transition(context); |
|
|
|
tickExit = tickExit.transition(context) |
|
.attr("opacity", epsilon) |
|
.attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute("transform"); }); |
|
|
|
tickEnter |
|
.attr("opacity", epsilon) |
|
.attr("transform", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); }); |
|
} |
|
|
|
tickExit.remove(); |
|
|
|
path |
|
.attr("d", orient === left || orient == right |
|
? (tickSizeOuter ? "M" + k * tickSizeOuter + "," + range0 + "H0.5V" + range1 + "H" + k * tickSizeOuter : "M0.5," + range0 + "V" + range1) |
|
: (tickSizeOuter ? "M" + range0 + "," + k * tickSizeOuter + "V0.5H" + range1 + "V" + k * tickSizeOuter : "M" + range0 + ",0.5H" + range1)); |
|
|
|
tick |
|
.attr("opacity", 1) |
|
.attr("transform", function(d) { return transform(position(d)); }); |
|
|
|
line |
|
.attr(x + "2", k * tickSizeInner); |
|
|
|
text |
|
.attr(x, k * spacing) |
|
.text(format); |
|
|
|
selection.filter(entering) |
|
.attr("fill", "none") |
|
.attr("font-size", 10) |
|
.attr("font-family", "sans-serif") |
|
.attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle"); |
|
|
|
selection |
|
.each(function() { this.__axis = position; }); |
|
} |
|
|
|
axis.scale = function(_) { |
|
return arguments.length ? (scale = _, axis) : scale; |
|
}; |
|
|
|
axis.ticks = function() { |
|
return tickArguments = _array__WEBPACK_IMPORTED_MODULE_0__["slice"].call(arguments), axis; |
|
}; |
|
|
|
axis.tickArguments = function(_) { |
|
return arguments.length ? (tickArguments = _ == null ? [] : _array__WEBPACK_IMPORTED_MODULE_0__["slice"].call(_), axis) : tickArguments.slice(); |
|
}; |
|
|
|
axis.tickValues = function(_) { |
|
return arguments.length ? (tickValues = _ == null ? null : _array__WEBPACK_IMPORTED_MODULE_0__["slice"].call(_), axis) : tickValues && tickValues.slice(); |
|
}; |
|
|
|
axis.tickFormat = function(_) { |
|
return arguments.length ? (tickFormat = _, axis) : tickFormat; |
|
}; |
|
|
|
axis.tickSize = function(_) { |
|
return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner; |
|
}; |
|
|
|
axis.tickSizeInner = function(_) { |
|
return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner; |
|
}; |
|
|
|
axis.tickSizeOuter = function(_) { |
|
return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter; |
|
}; |
|
|
|
axis.tickPadding = function(_) { |
|
return arguments.length ? (tickPadding = +_, axis) : tickPadding; |
|
}; |
|
|
|
return axis; |
|
} |
|
|
|
function axisTop(scale) { |
|
return axis(top, scale); |
|
} |
|
|
|
function axisRight(scale) { |
|
return axis(right, scale); |
|
} |
|
|
|
function axisBottom(scale) { |
|
return axis(bottom, scale); |
|
} |
|
|
|
function axisLeft(scale) { |
|
return axis(left, scale); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-axis/src/identity.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-axis/src/identity.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-axis/src/index.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-axis/src/index.js ***! |
|
\********************************************/ |
|
/*! exports provided: axisTop, axisRight, axisBottom, axisLeft */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./axis */ "../node_modules/d3-axis/src/axis.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisTop", function() { return _axis__WEBPACK_IMPORTED_MODULE_0__["axisTop"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisRight", function() { return _axis__WEBPACK_IMPORTED_MODULE_0__["axisRight"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisBottom", function() { return _axis__WEBPACK_IMPORTED_MODULE_0__["axisBottom"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisLeft", function() { return _axis__WEBPACK_IMPORTED_MODULE_0__["axisLeft"]; }); |
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-brush/src/brush.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-brush/src/brush.js ***! |
|
\*********************************************/ |
|
/*! exports provided: brushSelection, brushX, brushY, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brushSelection", function() { return brushSelection; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brushX", function() { return brushX; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brushY", function() { return brushY; }); |
|
/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ "../node_modules/d3-dispatch/src/index.js"); |
|
/* harmony import */ var d3_drag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-drag */ "../node_modules/d3-drag/src/index.js"); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var d3_transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! d3-transition */ "../node_modules/d3-transition/src/index.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-brush/src/constant.js"); |
|
/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./event.js */ "../node_modules/d3-brush/src/event.js"); |
|
/* harmony import */ var _noevent_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./noevent.js */ "../node_modules/d3-brush/src/noevent.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MODE_DRAG = {name: "drag"}, |
|
MODE_SPACE = {name: "space"}, |
|
MODE_HANDLE = {name: "handle"}, |
|
MODE_CENTER = {name: "center"}; |
|
|
|
function number1(e) { |
|
return [+e[0], +e[1]]; |
|
} |
|
|
|
function number2(e) { |
|
return [number1(e[0]), number1(e[1])]; |
|
} |
|
|
|
function toucher(identifier) { |
|
return function(target) { |
|
return Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["touch"])(target, d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches, identifier); |
|
}; |
|
} |
|
|
|
var X = { |
|
name: "x", |
|
handles: ["w", "e"].map(type), |
|
input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; }, |
|
output: function(xy) { return xy && [xy[0][0], xy[1][0]]; } |
|
}; |
|
|
|
var Y = { |
|
name: "y", |
|
handles: ["n", "s"].map(type), |
|
input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; }, |
|
output: function(xy) { return xy && [xy[0][1], xy[1][1]]; } |
|
}; |
|
|
|
var XY = { |
|
name: "xy", |
|
handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type), |
|
input: function(xy) { return xy == null ? null : number2(xy); }, |
|
output: function(xy) { return xy; } |
|
}; |
|
|
|
var cursors = { |
|
overlay: "crosshair", |
|
selection: "move", |
|
n: "ns-resize", |
|
e: "ew-resize", |
|
s: "ns-resize", |
|
w: "ew-resize", |
|
nw: "nwse-resize", |
|
ne: "nesw-resize", |
|
se: "nwse-resize", |
|
sw: "nesw-resize" |
|
}; |
|
|
|
var flipX = { |
|
e: "w", |
|
w: "e", |
|
nw: "ne", |
|
ne: "nw", |
|
se: "sw", |
|
sw: "se" |
|
}; |
|
|
|
var flipY = { |
|
n: "s", |
|
s: "n", |
|
nw: "sw", |
|
ne: "se", |
|
se: "ne", |
|
sw: "nw" |
|
}; |
|
|
|
var signsX = { |
|
overlay: +1, |
|
selection: +1, |
|
n: null, |
|
e: +1, |
|
s: null, |
|
w: -1, |
|
nw: -1, |
|
ne: +1, |
|
se: +1, |
|
sw: -1 |
|
}; |
|
|
|
var signsY = { |
|
overlay: +1, |
|
selection: +1, |
|
n: -1, |
|
e: null, |
|
s: +1, |
|
w: null, |
|
nw: -1, |
|
ne: -1, |
|
se: +1, |
|
sw: +1 |
|
}; |
|
|
|
function type(t) { |
|
return {type: t}; |
|
} |
|
|
|
// Ignore right-click, since that should open the context menu. |
|
function defaultFilter() { |
|
return !d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].ctrlKey && !d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].button; |
|
} |
|
|
|
function defaultExtent() { |
|
var svg = this.ownerSVGElement || this; |
|
if (svg.hasAttribute("viewBox")) { |
|
svg = svg.viewBox.baseVal; |
|
return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]]; |
|
} |
|
return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]]; |
|
} |
|
|
|
function defaultTouchable() { |
|
return navigator.maxTouchPoints || ("ontouchstart" in this); |
|
} |
|
|
|
// Like d3.local, but with the name “__brush” rather than auto-generated. |
|
function local(node) { |
|
while (!node.__brush) if (!(node = node.parentNode)) return; |
|
return node.__brush; |
|
} |
|
|
|
function empty(extent) { |
|
return extent[0][0] === extent[1][0] |
|
|| extent[0][1] === extent[1][1]; |
|
} |
|
|
|
function brushSelection(node) { |
|
var state = node.__brush; |
|
return state ? state.dim.output(state.selection) : null; |
|
} |
|
|
|
function brushX() { |
|
return brush(X); |
|
} |
|
|
|
function brushY() { |
|
return brush(Y); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return brush(XY); |
|
}); |
|
|
|
function brush(dim) { |
|
var extent = defaultExtent, |
|
filter = defaultFilter, |
|
touchable = defaultTouchable, |
|
keys = true, |
|
listeners = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__["dispatch"])("start", "brush", "end"), |
|
handleSize = 6, |
|
touchending; |
|
|
|
function brush(group) { |
|
var overlay = group |
|
.property("__brush", initialize) |
|
.selectAll(".overlay") |
|
.data([type("overlay")]); |
|
|
|
overlay.enter().append("rect") |
|
.attr("class", "overlay") |
|
.attr("pointer-events", "all") |
|
.attr("cursor", cursors.overlay) |
|
.merge(overlay) |
|
.each(function() { |
|
var extent = local(this).extent; |
|
Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(this) |
|
.attr("x", extent[0][0]) |
|
.attr("y", extent[0][1]) |
|
.attr("width", extent[1][0] - extent[0][0]) |
|
.attr("height", extent[1][1] - extent[0][1]); |
|
}); |
|
|
|
group.selectAll(".selection") |
|
.data([type("selection")]) |
|
.enter().append("rect") |
|
.attr("class", "selection") |
|
.attr("cursor", cursors.selection) |
|
.attr("fill", "#777") |
|
.attr("fill-opacity", 0.3) |
|
.attr("stroke", "#fff") |
|
.attr("shape-rendering", "crispEdges"); |
|
|
|
var handle = group.selectAll(".handle") |
|
.data(dim.handles, function(d) { return d.type; }); |
|
|
|
handle.exit().remove(); |
|
|
|
handle.enter().append("rect") |
|
.attr("class", function(d) { return "handle handle--" + d.type; }) |
|
.attr("cursor", function(d) { return cursors[d.type]; }); |
|
|
|
group |
|
.each(redraw) |
|
.attr("fill", "none") |
|
.attr("pointer-events", "all") |
|
.on("mousedown.brush", started) |
|
.filter(touchable) |
|
.on("touchstart.brush", started) |
|
.on("touchmove.brush", touchmoved) |
|
.on("touchend.brush touchcancel.brush", touchended) |
|
.style("touch-action", "none") |
|
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); |
|
} |
|
|
|
brush.move = function(group, selection) { |
|
if (group.selection) { |
|
group |
|
.on("start.brush", function() { emitter(this, arguments).beforestart().start(); }) |
|
.on("interrupt.brush end.brush", function() { emitter(this, arguments).end(); }) |
|
.tween("brush", function() { |
|
var that = this, |
|
state = that.__brush, |
|
emit = emitter(that, arguments), |
|
selection0 = state.selection, |
|
selection1 = dim.input(typeof selection === "function" ? selection.apply(this, arguments) : selection, state.extent), |
|
i = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__["interpolate"])(selection0, selection1); |
|
|
|
function tween(t) { |
|
state.selection = t === 1 && selection1 === null ? null : i(t); |
|
redraw.call(that); |
|
emit.brush(); |
|
} |
|
|
|
return selection0 !== null && selection1 !== null ? tween : tween(1); |
|
}); |
|
} else { |
|
group |
|
.each(function() { |
|
var that = this, |
|
args = arguments, |
|
state = that.__brush, |
|
selection1 = dim.input(typeof selection === "function" ? selection.apply(that, args) : selection, state.extent), |
|
emit = emitter(that, args).beforestart(); |
|
|
|
Object(d3_transition__WEBPACK_IMPORTED_MODULE_4__["interrupt"])(that); |
|
state.selection = selection1 === null ? null : selection1; |
|
redraw.call(that); |
|
emit.start().brush().end(); |
|
}); |
|
} |
|
}; |
|
|
|
brush.clear = function(group) { |
|
brush.move(group, null); |
|
}; |
|
|
|
function redraw() { |
|
var group = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(this), |
|
selection = local(this).selection; |
|
|
|
if (selection) { |
|
group.selectAll(".selection") |
|
.style("display", null) |
|
.attr("x", selection[0][0]) |
|
.attr("y", selection[0][1]) |
|
.attr("width", selection[1][0] - selection[0][0]) |
|
.attr("height", selection[1][1] - selection[0][1]); |
|
|
|
group.selectAll(".handle") |
|
.style("display", null) |
|
.attr("x", function(d) { return d.type[d.type.length - 1] === "e" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; }) |
|
.attr("y", function(d) { return d.type[0] === "s" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; }) |
|
.attr("width", function(d) { return d.type === "n" || d.type === "s" ? selection[1][0] - selection[0][0] + handleSize : handleSize; }) |
|
.attr("height", function(d) { return d.type === "e" || d.type === "w" ? selection[1][1] - selection[0][1] + handleSize : handleSize; }); |
|
} |
|
|
|
else { |
|
group.selectAll(".selection,.handle") |
|
.style("display", "none") |
|
.attr("x", null) |
|
.attr("y", null) |
|
.attr("width", null) |
|
.attr("height", null); |
|
} |
|
} |
|
|
|
function emitter(that, args, clean) { |
|
var emit = that.__brush.emitter; |
|
return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean); |
|
} |
|
|
|
function Emitter(that, args, clean) { |
|
this.that = that; |
|
this.args = args; |
|
this.state = that.__brush; |
|
this.active = 0; |
|
this.clean = clean; |
|
} |
|
|
|
Emitter.prototype = { |
|
beforestart: function() { |
|
if (++this.active === 1) this.state.emitter = this, this.starting = true; |
|
return this; |
|
}, |
|
start: function() { |
|
if (this.starting) this.starting = false, this.emit("start"); |
|
else this.emit("brush"); |
|
return this; |
|
}, |
|
brush: function() { |
|
this.emit("brush"); |
|
return this; |
|
}, |
|
end: function() { |
|
if (--this.active === 0) delete this.state.emitter, this.emit("end"); |
|
return this; |
|
}, |
|
emit: function(type) { |
|
Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["customEvent"])(new _event_js__WEBPACK_IMPORTED_MODULE_6__["default"](brush, type, dim.output(this.state.selection)), listeners.apply, listeners, [type, this.that, this.args]); |
|
} |
|
}; |
|
|
|
function started() { |
|
if (touchending && !d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches) return; |
|
if (!filter.apply(this, arguments)) return; |
|
|
|
var that = this, |
|
type = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].target.__data__.type, |
|
mode = (keys && d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : (keys && d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].altKey ? MODE_CENTER : MODE_HANDLE), |
|
signX = dim === Y ? null : signsX[type], |
|
signY = dim === X ? null : signsY[type], |
|
state = local(that), |
|
extent = state.extent, |
|
selection = state.selection, |
|
W = extent[0][0], w0, w1, |
|
N = extent[0][1], n0, n1, |
|
E = extent[1][0], e0, e1, |
|
S = extent[1][1], s0, s1, |
|
dx = 0, |
|
dy = 0, |
|
moving, |
|
shifting = signX && signY && keys && d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].shiftKey, |
|
lockX, |
|
lockY, |
|
pointer = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches ? toucher(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].changedTouches[0].identifier) : d3_selection__WEBPACK_IMPORTED_MODULE_3__["mouse"], |
|
point0 = pointer(that), |
|
point = point0, |
|
emit = emitter(that, arguments, true).beforestart(); |
|
|
|
if (type === "overlay") { |
|
if (selection) moving = true; |
|
state.selection = selection = [ |
|
[w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]], |
|
[e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0] |
|
]; |
|
} else { |
|
w0 = selection[0][0]; |
|
n0 = selection[0][1]; |
|
e0 = selection[1][0]; |
|
s0 = selection[1][1]; |
|
} |
|
|
|
w1 = w0; |
|
n1 = n0; |
|
e1 = e0; |
|
s1 = s0; |
|
|
|
var group = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(that) |
|
.attr("pointer-events", "none"); |
|
|
|
var overlay = group.selectAll(".overlay") |
|
.attr("cursor", cursors[type]); |
|
|
|
if (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches) { |
|
emit.moved = moved; |
|
emit.ended = ended; |
|
} else { |
|
var view = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].view) |
|
.on("mousemove.brush", moved, true) |
|
.on("mouseup.brush", ended, true); |
|
if (keys) view |
|
.on("keydown.brush", keydowned, true) |
|
.on("keyup.brush", keyupped, true) |
|
|
|
Object(d3_drag__WEBPACK_IMPORTED_MODULE_1__["dragDisable"])(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].view); |
|
} |
|
|
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_7__["nopropagation"])(); |
|
Object(d3_transition__WEBPACK_IMPORTED_MODULE_4__["interrupt"])(that); |
|
redraw.call(that); |
|
emit.start(); |
|
|
|
function moved() { |
|
var point1 = pointer(that); |
|
if (shifting && !lockX && !lockY) { |
|
if (Math.abs(point1[0] - point[0]) > Math.abs(point1[1] - point[1])) lockY = true; |
|
else lockX = true; |
|
} |
|
point = point1; |
|
moving = true; |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_7__["default"])(); |
|
move(); |
|
} |
|
|
|
function move() { |
|
var t; |
|
|
|
dx = point[0] - point0[0]; |
|
dy = point[1] - point0[1]; |
|
|
|
switch (mode) { |
|
case MODE_SPACE: |
|
case MODE_DRAG: { |
|
if (signX) dx = Math.max(W - w0, Math.min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx; |
|
if (signY) dy = Math.max(N - n0, Math.min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy; |
|
break; |
|
} |
|
case MODE_HANDLE: { |
|
if (signX < 0) dx = Math.max(W - w0, Math.min(E - w0, dx)), w1 = w0 + dx, e1 = e0; |
|
else if (signX > 0) dx = Math.max(W - e0, Math.min(E - e0, dx)), w1 = w0, e1 = e0 + dx; |
|
if (signY < 0) dy = Math.max(N - n0, Math.min(S - n0, dy)), n1 = n0 + dy, s1 = s0; |
|
else if (signY > 0) dy = Math.max(N - s0, Math.min(S - s0, dy)), n1 = n0, s1 = s0 + dy; |
|
break; |
|
} |
|
case MODE_CENTER: { |
|
if (signX) w1 = Math.max(W, Math.min(E, w0 - dx * signX)), e1 = Math.max(W, Math.min(E, e0 + dx * signX)); |
|
if (signY) n1 = Math.max(N, Math.min(S, n0 - dy * signY)), s1 = Math.max(N, Math.min(S, s0 + dy * signY)); |
|
break; |
|
} |
|
} |
|
|
|
if (e1 < w1) { |
|
signX *= -1; |
|
t = w0, w0 = e0, e0 = t; |
|
t = w1, w1 = e1, e1 = t; |
|
if (type in flipX) overlay.attr("cursor", cursors[type = flipX[type]]); |
|
} |
|
|
|
if (s1 < n1) { |
|
signY *= -1; |
|
t = n0, n0 = s0, s0 = t; |
|
t = n1, n1 = s1, s1 = t; |
|
if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]); |
|
} |
|
|
|
if (state.selection) selection = state.selection; // May be set by brush.move! |
|
if (lockX) w1 = selection[0][0], e1 = selection[1][0]; |
|
if (lockY) n1 = selection[0][1], s1 = selection[1][1]; |
|
|
|
if (selection[0][0] !== w1 |
|
|| selection[0][1] !== n1 |
|
|| selection[1][0] !== e1 |
|
|| selection[1][1] !== s1) { |
|
state.selection = [[w1, n1], [e1, s1]]; |
|
redraw.call(that); |
|
emit.brush(); |
|
} |
|
} |
|
|
|
function ended() { |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_7__["nopropagation"])(); |
|
if (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches) { |
|
if (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches.length) return; |
|
if (touchending) clearTimeout(touchending); |
|
touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed! |
|
} else { |
|
Object(d3_drag__WEBPACK_IMPORTED_MODULE_1__["dragEnable"])(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].view, moving); |
|
view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null); |
|
} |
|
group.attr("pointer-events", "all"); |
|
overlay.attr("cursor", cursors.overlay); |
|
if (state.selection) selection = state.selection; // May be set by brush.move (on start)! |
|
if (empty(selection)) state.selection = null, redraw.call(that); |
|
emit.end(); |
|
} |
|
|
|
function keydowned() { |
|
switch (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].keyCode) { |
|
case 16: { // SHIFT |
|
shifting = signX && signY; |
|
break; |
|
} |
|
case 18: { // ALT |
|
if (mode === MODE_HANDLE) { |
|
if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX; |
|
if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY; |
|
mode = MODE_CENTER; |
|
move(); |
|
} |
|
break; |
|
} |
|
case 32: { // SPACE; takes priority over ALT |
|
if (mode === MODE_HANDLE || mode === MODE_CENTER) { |
|
if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx; |
|
if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy; |
|
mode = MODE_SPACE; |
|
overlay.attr("cursor", cursors.selection); |
|
move(); |
|
} |
|
break; |
|
} |
|
default: return; |
|
} |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_7__["default"])(); |
|
} |
|
|
|
function keyupped() { |
|
switch (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].keyCode) { |
|
case 16: { // SHIFT |
|
if (shifting) { |
|
lockX = lockY = shifting = false; |
|
move(); |
|
} |
|
break; |
|
} |
|
case 18: { // ALT |
|
if (mode === MODE_CENTER) { |
|
if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1; |
|
if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1; |
|
mode = MODE_HANDLE; |
|
move(); |
|
} |
|
break; |
|
} |
|
case 32: { // SPACE |
|
if (mode === MODE_SPACE) { |
|
if (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].altKey) { |
|
if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX; |
|
if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY; |
|
mode = MODE_CENTER; |
|
} else { |
|
if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1; |
|
if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1; |
|
mode = MODE_HANDLE; |
|
} |
|
overlay.attr("cursor", cursors[type]); |
|
move(); |
|
} |
|
break; |
|
} |
|
default: return; |
|
} |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_7__["default"])(); |
|
} |
|
} |
|
|
|
function touchmoved() { |
|
emitter(this, arguments).moved(); |
|
} |
|
|
|
function touchended() { |
|
emitter(this, arguments).ended(); |
|
} |
|
|
|
function initialize() { |
|
var state = this.__brush || {selection: null}; |
|
state.extent = number2(extent.apply(this, arguments)); |
|
state.dim = dim; |
|
return state; |
|
} |
|
|
|
brush.extent = function(_) { |
|
return arguments.length ? (extent = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])(number2(_)), brush) : extent; |
|
}; |
|
|
|
brush.filter = function(_) { |
|
return arguments.length ? (filter = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])(!!_), brush) : filter; |
|
}; |
|
|
|
brush.touchable = function(_) { |
|
return arguments.length ? (touchable = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])(!!_), brush) : touchable; |
|
}; |
|
|
|
brush.handleSize = function(_) { |
|
return arguments.length ? (handleSize = +_, brush) : handleSize; |
|
}; |
|
|
|
brush.keyModifiers = function(_) { |
|
return arguments.length ? (keys = !!_, brush) : keys; |
|
}; |
|
|
|
brush.on = function() { |
|
var value = listeners.on.apply(listeners, arguments); |
|
return value === listeners ? brush : value; |
|
}; |
|
|
|
return brush; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-brush/src/constant.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-brush/src/constant.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-brush/src/event.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-brush/src/event.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(target, type, selection) { |
|
this.target = target; |
|
this.type = type; |
|
this.selection = selection; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-brush/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-brush/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: brush, brushX, brushY, brushSelection */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _brush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./brush.js */ "../node_modules/d3-brush/src/brush.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brush", function() { return _brush_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brushX", function() { return _brush_js__WEBPACK_IMPORTED_MODULE_0__["brushX"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brushY", function() { return _brush_js__WEBPACK_IMPORTED_MODULE_0__["brushY"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brushSelection", function() { return _brush_js__WEBPACK_IMPORTED_MODULE_0__["brushSelection"]; }); |
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-brush/src/noevent.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-brush/src/noevent.js ***! |
|
\***********************************************/ |
|
/*! exports provided: nopropagation, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nopropagation", function() { return nopropagation; }); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
|
|
|
|
function nopropagation() { |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].stopImmediatePropagation(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].preventDefault(); |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].stopImmediatePropagation(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-chord/src/array.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-chord/src/array.js ***! |
|
\*********************************************/ |
|
/*! exports provided: slice */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
var slice = Array.prototype.slice; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-chord/src/chord.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-chord/src/chord.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math */ "../node_modules/d3-chord/src/math.js"); |
|
|
|
|
|
|
|
function compareValue(compare) { |
|
return function(a, b) { |
|
return compare( |
|
a.source.value + a.target.value, |
|
b.source.value + b.target.value |
|
); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var padAngle = 0, |
|
sortGroups = null, |
|
sortSubgroups = null, |
|
sortChords = null; |
|
|
|
function chord(matrix) { |
|
var n = matrix.length, |
|
groupSums = [], |
|
groupIndex = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(n), |
|
subgroupIndex = [], |
|
chords = [], |
|
groups = chords.groups = new Array(n), |
|
subgroups = new Array(n * n), |
|
k, |
|
x, |
|
x0, |
|
dx, |
|
i, |
|
j; |
|
|
|
// Compute the sum. |
|
k = 0, i = -1; while (++i < n) { |
|
x = 0, j = -1; while (++j < n) { |
|
x += matrix[i][j]; |
|
} |
|
groupSums.push(x); |
|
subgroupIndex.push(Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(n)); |
|
k += x; |
|
} |
|
|
|
// Sort groups… |
|
if (sortGroups) groupIndex.sort(function(a, b) { |
|
return sortGroups(groupSums[a], groupSums[b]); |
|
}); |
|
|
|
// Sort subgroups… |
|
if (sortSubgroups) subgroupIndex.forEach(function(d, i) { |
|
d.sort(function(a, b) { |
|
return sortSubgroups(matrix[i][a], matrix[i][b]); |
|
}); |
|
}); |
|
|
|
// Convert the sum to scaling factor for [0, 2pi]. |
|
// TODO Allow start and end angle to be specified? |
|
// TODO Allow padding to be specified as percentage? |
|
k = Object(_math__WEBPACK_IMPORTED_MODULE_1__["max"])(0, _math__WEBPACK_IMPORTED_MODULE_1__["tau"] - padAngle * n) / k; |
|
dx = k ? padAngle : _math__WEBPACK_IMPORTED_MODULE_1__["tau"] / n; |
|
|
|
// Compute the start and end angle for each group and subgroup. |
|
// Note: Opera has a bug reordering object literal properties! |
|
x = 0, i = -1; while (++i < n) { |
|
x0 = x, j = -1; while (++j < n) { |
|
var di = groupIndex[i], |
|
dj = subgroupIndex[di][j], |
|
v = matrix[di][dj], |
|
a0 = x, |
|
a1 = x += v * k; |
|
subgroups[dj * n + di] = { |
|
index: di, |
|
subindex: dj, |
|
startAngle: a0, |
|
endAngle: a1, |
|
value: v |
|
}; |
|
} |
|
groups[di] = { |
|
index: di, |
|
startAngle: x0, |
|
endAngle: x, |
|
value: groupSums[di] |
|
}; |
|
x += dx; |
|
} |
|
|
|
// Generate chords for each (non-empty) subgroup-subgroup link. |
|
i = -1; while (++i < n) { |
|
j = i - 1; while (++j < n) { |
|
var source = subgroups[j * n + i], |
|
target = subgroups[i * n + j]; |
|
if (source.value || target.value) { |
|
chords.push(source.value < target.value |
|
? {source: target, target: source} |
|
: {source: source, target: target}); |
|
} |
|
} |
|
} |
|
|
|
return sortChords ? chords.sort(sortChords) : chords; |
|
} |
|
|
|
chord.padAngle = function(_) { |
|
return arguments.length ? (padAngle = Object(_math__WEBPACK_IMPORTED_MODULE_1__["max"])(0, _), chord) : padAngle; |
|
}; |
|
|
|
chord.sortGroups = function(_) { |
|
return arguments.length ? (sortGroups = _, chord) : sortGroups; |
|
}; |
|
|
|
chord.sortSubgroups = function(_) { |
|
return arguments.length ? (sortSubgroups = _, chord) : sortSubgroups; |
|
}; |
|
|
|
chord.sortChords = function(_) { |
|
return arguments.length ? (_ == null ? sortChords = null : (sortChords = compareValue(_))._ = _, chord) : sortChords && sortChords._; |
|
}; |
|
|
|
return chord; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-chord/src/constant.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-chord/src/constant.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-chord/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-chord/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: chord, ribbon */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _chord__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chord */ "../node_modules/d3-chord/src/chord.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chord", function() { return _chord__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _ribbon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ribbon */ "../node_modules/d3-chord/src/ribbon.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ribbon", function() { return _ribbon__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-chord/src/math.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-chord/src/math.js ***! |
|
\********************************************/ |
|
/*! exports provided: cos, sin, pi, halfPi, tau, max */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return cos; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return sin; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pi", function() { return pi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "halfPi", function() { return halfPi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tau", function() { return tau; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; }); |
|
var cos = Math.cos; |
|
var sin = Math.sin; |
|
var pi = Math.PI; |
|
var halfPi = pi / 2; |
|
var tau = pi * 2; |
|
var max = Math.max; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-chord/src/ribbon.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-chord/src/ribbon.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "../node_modules/d3-chord/src/array.js"); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-chord/src/constant.js"); |
|
/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math */ "../node_modules/d3-chord/src/math.js"); |
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
function defaultSource(d) { |
|
return d.source; |
|
} |
|
|
|
function defaultTarget(d) { |
|
return d.target; |
|
} |
|
|
|
function defaultRadius(d) { |
|
return d.radius; |
|
} |
|
|
|
function defaultStartAngle(d) { |
|
return d.startAngle; |
|
} |
|
|
|
function defaultEndAngle(d) { |
|
return d.endAngle; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var source = defaultSource, |
|
target = defaultTarget, |
|
radius = defaultRadius, |
|
startAngle = defaultStartAngle, |
|
endAngle = defaultEndAngle, |
|
context = null; |
|
|
|
function ribbon() { |
|
var buffer, |
|
argv = _array__WEBPACK_IMPORTED_MODULE_0__["slice"].call(arguments), |
|
s = source.apply(this, argv), |
|
t = target.apply(this, argv), |
|
sr = +radius.apply(this, (argv[0] = s, argv)), |
|
sa0 = startAngle.apply(this, argv) - _math__WEBPACK_IMPORTED_MODULE_2__["halfPi"], |
|
sa1 = endAngle.apply(this, argv) - _math__WEBPACK_IMPORTED_MODULE_2__["halfPi"], |
|
sx0 = sr * Object(_math__WEBPACK_IMPORTED_MODULE_2__["cos"])(sa0), |
|
sy0 = sr * Object(_math__WEBPACK_IMPORTED_MODULE_2__["sin"])(sa0), |
|
tr = +radius.apply(this, (argv[0] = t, argv)), |
|
ta0 = startAngle.apply(this, argv) - _math__WEBPACK_IMPORTED_MODULE_2__["halfPi"], |
|
ta1 = endAngle.apply(this, argv) - _math__WEBPACK_IMPORTED_MODULE_2__["halfPi"]; |
|
|
|
if (!context) context = buffer = Object(d3_path__WEBPACK_IMPORTED_MODULE_3__["path"])(); |
|
|
|
context.moveTo(sx0, sy0); |
|
context.arc(0, 0, sr, sa0, sa1); |
|
if (sa0 !== ta0 || sa1 !== ta1) { // TODO sr !== tr? |
|
context.quadraticCurveTo(0, 0, tr * Object(_math__WEBPACK_IMPORTED_MODULE_2__["cos"])(ta0), tr * Object(_math__WEBPACK_IMPORTED_MODULE_2__["sin"])(ta0)); |
|
context.arc(0, 0, tr, ta0, ta1); |
|
} |
|
context.quadraticCurveTo(0, 0, sx0, sy0); |
|
context.closePath(); |
|
|
|
if (buffer) return context = null, buffer + "" || null; |
|
} |
|
|
|
ribbon.radius = function(_) { |
|
return arguments.length ? (radius = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), ribbon) : radius; |
|
}; |
|
|
|
ribbon.startAngle = function(_) { |
|
return arguments.length ? (startAngle = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), ribbon) : startAngle; |
|
}; |
|
|
|
ribbon.endAngle = function(_) { |
|
return arguments.length ? (endAngle = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), ribbon) : endAngle; |
|
}; |
|
|
|
ribbon.source = function(_) { |
|
return arguments.length ? (source = _, ribbon) : source; |
|
}; |
|
|
|
ribbon.target = function(_) { |
|
return arguments.length ? (target = _, ribbon) : target; |
|
}; |
|
|
|
ribbon.context = function(_) { |
|
return arguments.length ? ((context = _ == null ? null : _), ribbon) : context; |
|
}; |
|
|
|
return ribbon; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/entries.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/entries.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(map) { |
|
var entries = []; |
|
for (var key in map) entries.push({key: key, value: map[key]}); |
|
return entries; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/index.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/index.js ***! |
|
\**************************************************/ |
|
/*! exports provided: nest, set, map, keys, values, entries */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _nest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nest */ "../node_modules/d3-collection/src/nest.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nest", function() { return _nest__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./set */ "../node_modules/d3-collection/src/set.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./map */ "../node_modules/d3-collection/src/map.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./keys */ "../node_modules/d3-collection/src/keys.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./values */ "../node_modules/d3-collection/src/values.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _entries__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./entries */ "../node_modules/d3-collection/src/entries.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/keys.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/keys.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(map) { |
|
var keys = []; |
|
for (var key in map) keys.push(key); |
|
return keys; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/map.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/map.js ***! |
|
\************************************************/ |
|
/*! exports provided: prefix, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prefix", function() { return prefix; }); |
|
var prefix = "$"; |
|
|
|
function Map() {} |
|
|
|
Map.prototype = map.prototype = { |
|
constructor: Map, |
|
has: function(key) { |
|
return (prefix + key) in this; |
|
}, |
|
get: function(key) { |
|
return this[prefix + key]; |
|
}, |
|
set: function(key, value) { |
|
this[prefix + key] = value; |
|
return this; |
|
}, |
|
remove: function(key) { |
|
var property = prefix + key; |
|
return property in this && delete this[property]; |
|
}, |
|
clear: function() { |
|
for (var property in this) if (property[0] === prefix) delete this[property]; |
|
}, |
|
keys: function() { |
|
var keys = []; |
|
for (var property in this) if (property[0] === prefix) keys.push(property.slice(1)); |
|
return keys; |
|
}, |
|
values: function() { |
|
var values = []; |
|
for (var property in this) if (property[0] === prefix) values.push(this[property]); |
|
return values; |
|
}, |
|
entries: function() { |
|
var entries = []; |
|
for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]}); |
|
return entries; |
|
}, |
|
size: function() { |
|
var size = 0; |
|
for (var property in this) if (property[0] === prefix) ++size; |
|
return size; |
|
}, |
|
empty: function() { |
|
for (var property in this) if (property[0] === prefix) return false; |
|
return true; |
|
}, |
|
each: function(f) { |
|
for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this); |
|
} |
|
}; |
|
|
|
function map(object, f) { |
|
var map = new Map; |
|
|
|
// Copy constructor. |
|
if (object instanceof Map) object.each(function(value, key) { map.set(key, value); }); |
|
|
|
// Index array by numeric index or specified key function. |
|
else if (Array.isArray(object)) { |
|
var i = -1, |
|
n = object.length, |
|
o; |
|
|
|
if (f == null) while (++i < n) map.set(i, object[i]); |
|
else while (++i < n) map.set(f(o = object[i], i, object), o); |
|
} |
|
|
|
// Convert object to map. |
|
else if (object) for (var key in object) map.set(key, object[key]); |
|
|
|
return map; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (map); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/nest.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/nest.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "../node_modules/d3-collection/src/map.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var keys = [], |
|
sortKeys = [], |
|
sortValues, |
|
rollup, |
|
nest; |
|
|
|
function apply(array, depth, createResult, setResult) { |
|
if (depth >= keys.length) { |
|
if (sortValues != null) array.sort(sortValues); |
|
return rollup != null ? rollup(array) : array; |
|
} |
|
|
|
var i = -1, |
|
n = array.length, |
|
key = keys[depth++], |
|
keyValue, |
|
value, |
|
valuesByKey = Object(_map__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
values, |
|
result = createResult(); |
|
|
|
while (++i < n) { |
|
if (values = valuesByKey.get(keyValue = key(value = array[i]) + "")) { |
|
values.push(value); |
|
} else { |
|
valuesByKey.set(keyValue, [value]); |
|
} |
|
} |
|
|
|
valuesByKey.each(function(values, key) { |
|
setResult(result, key, apply(values, depth, createResult, setResult)); |
|
}); |
|
|
|
return result; |
|
} |
|
|
|
function entries(map, depth) { |
|
if (++depth > keys.length) return map; |
|
var array, sortKey = sortKeys[depth - 1]; |
|
if (rollup != null && depth >= keys.length) array = map.entries(); |
|
else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); }); |
|
return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array; |
|
} |
|
|
|
return nest = { |
|
object: function(array) { return apply(array, 0, createObject, setObject); }, |
|
map: function(array) { return apply(array, 0, createMap, setMap); }, |
|
entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); }, |
|
key: function(d) { keys.push(d); return nest; }, |
|
sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; }, |
|
sortValues: function(order) { sortValues = order; return nest; }, |
|
rollup: function(f) { rollup = f; return nest; } |
|
}; |
|
}); |
|
|
|
function createObject() { |
|
return {}; |
|
} |
|
|
|
function setObject(object, key, value) { |
|
object[key] = value; |
|
} |
|
|
|
function createMap() { |
|
return Object(_map__WEBPACK_IMPORTED_MODULE_0__["default"])(); |
|
} |
|
|
|
function setMap(map, key, value) { |
|
map.set(key, value); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/set.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/set.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ "../node_modules/d3-collection/src/map.js"); |
|
|
|
|
|
function Set() {} |
|
|
|
var proto = _map__WEBPACK_IMPORTED_MODULE_0__["default"].prototype; |
|
|
|
Set.prototype = set.prototype = { |
|
constructor: Set, |
|
has: proto.has, |
|
add: function(value) { |
|
value += ""; |
|
this[_map__WEBPACK_IMPORTED_MODULE_0__["prefix"] + value] = value; |
|
return this; |
|
}, |
|
remove: proto.remove, |
|
clear: proto.clear, |
|
values: proto.keys, |
|
size: proto.size, |
|
empty: proto.empty, |
|
each: proto.each |
|
}; |
|
|
|
function set(object, f) { |
|
var set = new Set; |
|
|
|
// Copy constructor. |
|
if (object instanceof Set) object.each(function(value) { set.add(value); }); |
|
|
|
// Otherwise, assume it’s an array. |
|
else if (object) { |
|
var i = -1, n = object.length; |
|
if (f == null) while (++i < n) set.add(object[i]); |
|
else while (++i < n) set.add(f(object[i], i, object)); |
|
} |
|
|
|
return set; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (set); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-collection/src/values.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-collection/src/values.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(map) { |
|
var values = []; |
|
for (var key in map) values.push(map[key]); |
|
return values; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-color/src/color.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-color/src/color.js ***! |
|
\*********************************************/ |
|
/*! exports provided: Color, darker, brighter, default, rgbConvert, rgb, Rgb, hslConvert, hsl */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darker", function() { return darker; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "brighter", function() { return brighter; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return color; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbConvert", function() { return rgbConvert; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return rgb; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rgb", function() { return Rgb; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslConvert", function() { return hslConvert; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return hsl; }); |
|
/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "../node_modules/d3-color/src/define.js"); |
|
|
|
|
|
function Color() {} |
|
|
|
var darker = 0.7; |
|
var brighter = 1 / darker; |
|
|
|
var reI = "\\s*([+-]?\\d+)\\s*", |
|
reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", |
|
reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", |
|
reHex = /^#([0-9a-f]{3,8})$/, |
|
reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), |
|
reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), |
|
reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), |
|
reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), |
|
reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), |
|
reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); |
|
|
|
var named = { |
|
aliceblue: 0xf0f8ff, |
|
antiquewhite: 0xfaebd7, |
|
aqua: 0x00ffff, |
|
aquamarine: 0x7fffd4, |
|
azure: 0xf0ffff, |
|
beige: 0xf5f5dc, |
|
bisque: 0xffe4c4, |
|
black: 0x000000, |
|
blanchedalmond: 0xffebcd, |
|
blue: 0x0000ff, |
|
blueviolet: 0x8a2be2, |
|
brown: 0xa52a2a, |
|
burlywood: 0xdeb887, |
|
cadetblue: 0x5f9ea0, |
|
chartreuse: 0x7fff00, |
|
chocolate: 0xd2691e, |
|
coral: 0xff7f50, |
|
cornflowerblue: 0x6495ed, |
|
cornsilk: 0xfff8dc, |
|
crimson: 0xdc143c, |
|
cyan: 0x00ffff, |
|
darkblue: 0x00008b, |
|
darkcyan: 0x008b8b, |
|
darkgoldenrod: 0xb8860b, |
|
darkgray: 0xa9a9a9, |
|
darkgreen: 0x006400, |
|
darkgrey: 0xa9a9a9, |
|
darkkhaki: 0xbdb76b, |
|
darkmagenta: 0x8b008b, |
|
darkolivegreen: 0x556b2f, |
|
darkorange: 0xff8c00, |
|
darkorchid: 0x9932cc, |
|
darkred: 0x8b0000, |
|
darksalmon: 0xe9967a, |
|
darkseagreen: 0x8fbc8f, |
|
darkslateblue: 0x483d8b, |
|
darkslategray: 0x2f4f4f, |
|
darkslategrey: 0x2f4f4f, |
|
darkturquoise: 0x00ced1, |
|
darkviolet: 0x9400d3, |
|
deeppink: 0xff1493, |
|
deepskyblue: 0x00bfff, |
|
dimgray: 0x696969, |
|
dimgrey: 0x696969, |
|
dodgerblue: 0x1e90ff, |
|
firebrick: 0xb22222, |
|
floralwhite: 0xfffaf0, |
|
forestgreen: 0x228b22, |
|
fuchsia: 0xff00ff, |
|
gainsboro: 0xdcdcdc, |
|
ghostwhite: 0xf8f8ff, |
|
gold: 0xffd700, |
|
goldenrod: 0xdaa520, |
|
gray: 0x808080, |
|
green: 0x008000, |
|
greenyellow: 0xadff2f, |
|
grey: 0x808080, |
|
honeydew: 0xf0fff0, |
|
hotpink: 0xff69b4, |
|
indianred: 0xcd5c5c, |
|
indigo: 0x4b0082, |
|
ivory: 0xfffff0, |
|
khaki: 0xf0e68c, |
|
lavender: 0xe6e6fa, |
|
lavenderblush: 0xfff0f5, |
|
lawngreen: 0x7cfc00, |
|
lemonchiffon: 0xfffacd, |
|
lightblue: 0xadd8e6, |
|
lightcoral: 0xf08080, |
|
lightcyan: 0xe0ffff, |
|
lightgoldenrodyellow: 0xfafad2, |
|
lightgray: 0xd3d3d3, |
|
lightgreen: 0x90ee90, |
|
lightgrey: 0xd3d3d3, |
|
lightpink: 0xffb6c1, |
|
lightsalmon: 0xffa07a, |
|
lightseagreen: 0x20b2aa, |
|
lightskyblue: 0x87cefa, |
|
lightslategray: 0x778899, |
|
lightslategrey: 0x778899, |
|
lightsteelblue: 0xb0c4de, |
|
lightyellow: 0xffffe0, |
|
lime: 0x00ff00, |
|
limegreen: 0x32cd32, |
|
linen: 0xfaf0e6, |
|
magenta: 0xff00ff, |
|
maroon: 0x800000, |
|
mediumaquamarine: 0x66cdaa, |
|
mediumblue: 0x0000cd, |
|
mediumorchid: 0xba55d3, |
|
mediumpurple: 0x9370db, |
|
mediumseagreen: 0x3cb371, |
|
mediumslateblue: 0x7b68ee, |
|
mediumspringgreen: 0x00fa9a, |
|
mediumturquoise: 0x48d1cc, |
|
mediumvioletred: 0xc71585, |
|
midnightblue: 0x191970, |
|
mintcream: 0xf5fffa, |
|
mistyrose: 0xffe4e1, |
|
moccasin: 0xffe4b5, |
|
navajowhite: 0xffdead, |
|
navy: 0x000080, |
|
oldlace: 0xfdf5e6, |
|
olive: 0x808000, |
|
olivedrab: 0x6b8e23, |
|
orange: 0xffa500, |
|
orangered: 0xff4500, |
|
orchid: 0xda70d6, |
|
palegoldenrod: 0xeee8aa, |
|
palegreen: 0x98fb98, |
|
paleturquoise: 0xafeeee, |
|
palevioletred: 0xdb7093, |
|
papayawhip: 0xffefd5, |
|
peachpuff: 0xffdab9, |
|
peru: 0xcd853f, |
|
pink: 0xffc0cb, |
|
plum: 0xdda0dd, |
|
powderblue: 0xb0e0e6, |
|
purple: 0x800080, |
|
rebeccapurple: 0x663399, |
|
red: 0xff0000, |
|
rosybrown: 0xbc8f8f, |
|
royalblue: 0x4169e1, |
|
saddlebrown: 0x8b4513, |
|
salmon: 0xfa8072, |
|
sandybrown: 0xf4a460, |
|
seagreen: 0x2e8b57, |
|
seashell: 0xfff5ee, |
|
sienna: 0xa0522d, |
|
silver: 0xc0c0c0, |
|
skyblue: 0x87ceeb, |
|
slateblue: 0x6a5acd, |
|
slategray: 0x708090, |
|
slategrey: 0x708090, |
|
snow: 0xfffafa, |
|
springgreen: 0x00ff7f, |
|
steelblue: 0x4682b4, |
|
tan: 0xd2b48c, |
|
teal: 0x008080, |
|
thistle: 0xd8bfd8, |
|
tomato: 0xff6347, |
|
turquoise: 0x40e0d0, |
|
violet: 0xee82ee, |
|
wheat: 0xf5deb3, |
|
white: 0xffffff, |
|
whitesmoke: 0xf5f5f5, |
|
yellow: 0xffff00, |
|
yellowgreen: 0x9acd32 |
|
}; |
|
|
|
Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Color, color, { |
|
copy: function(channels) { |
|
return Object.assign(new this.constructor, this, channels); |
|
}, |
|
displayable: function() { |
|
return this.rgb().displayable(); |
|
}, |
|
hex: color_formatHex, // Deprecated! Use color.formatHex. |
|
formatHex: color_formatHex, |
|
formatHsl: color_formatHsl, |
|
formatRgb: color_formatRgb, |
|
toString: color_formatRgb |
|
}); |
|
|
|
function color_formatHex() { |
|
return this.rgb().formatHex(); |
|
} |
|
|
|
function color_formatHsl() { |
|
return hslConvert(this).formatHsl(); |
|
} |
|
|
|
function color_formatRgb() { |
|
return this.rgb().formatRgb(); |
|
} |
|
|
|
function color(format) { |
|
var m, l; |
|
format = (format + "").trim().toLowerCase(); |
|
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 |
|
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 |
|
: l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 |
|
: l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 |
|
: null) // invalid hex |
|
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) |
|
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) |
|
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) |
|
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) |
|
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) |
|
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) |
|
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins |
|
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) |
|
: null; |
|
} |
|
|
|
function rgbn(n) { |
|
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); |
|
} |
|
|
|
function rgba(r, g, b, a) { |
|
if (a <= 0) r = g = b = NaN; |
|
return new Rgb(r, g, b, a); |
|
} |
|
|
|
function rgbConvert(o) { |
|
if (!(o instanceof Color)) o = color(o); |
|
if (!o) return new Rgb; |
|
o = o.rgb(); |
|
return new Rgb(o.r, o.g, o.b, o.opacity); |
|
} |
|
|
|
function rgb(r, g, b, opacity) { |
|
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function Rgb(r, g, b, opacity) { |
|
this.r = +r; |
|
this.g = +g; |
|
this.b = +b; |
|
this.opacity = +opacity; |
|
} |
|
|
|
Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Rgb, rgb, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(Color, { |
|
brighter: function(k) { |
|
k = k == null ? brighter : Math.pow(brighter, k); |
|
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); |
|
}, |
|
darker: function(k) { |
|
k = k == null ? darker : Math.pow(darker, k); |
|
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); |
|
}, |
|
rgb: function() { |
|
return this; |
|
}, |
|
displayable: function() { |
|
return (-0.5 <= this.r && this.r < 255.5) |
|
&& (-0.5 <= this.g && this.g < 255.5) |
|
&& (-0.5 <= this.b && this.b < 255.5) |
|
&& (0 <= this.opacity && this.opacity <= 1); |
|
}, |
|
hex: rgb_formatHex, // Deprecated! Use color.formatHex. |
|
formatHex: rgb_formatHex, |
|
formatRgb: rgb_formatRgb, |
|
toString: rgb_formatRgb |
|
})); |
|
|
|
function rgb_formatHex() { |
|
return "#" + hex(this.r) + hex(this.g) + hex(this.b); |
|
} |
|
|
|
function rgb_formatRgb() { |
|
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); |
|
return (a === 1 ? "rgb(" : "rgba(") |
|
+ Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " |
|
+ Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " |
|
+ Math.max(0, Math.min(255, Math.round(this.b) || 0)) |
|
+ (a === 1 ? ")" : ", " + a + ")"); |
|
} |
|
|
|
function hex(value) { |
|
value = Math.max(0, Math.min(255, Math.round(value) || 0)); |
|
return (value < 16 ? "0" : "") + value.toString(16); |
|
} |
|
|
|
function hsla(h, s, l, a) { |
|
if (a <= 0) h = s = l = NaN; |
|
else if (l <= 0 || l >= 1) h = s = NaN; |
|
else if (s <= 0) h = NaN; |
|
return new Hsl(h, s, l, a); |
|
} |
|
|
|
function hslConvert(o) { |
|
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); |
|
if (!(o instanceof Color)) o = color(o); |
|
if (!o) return new Hsl; |
|
if (o instanceof Hsl) return o; |
|
o = o.rgb(); |
|
var r = o.r / 255, |
|
g = o.g / 255, |
|
b = o.b / 255, |
|
min = Math.min(r, g, b), |
|
max = Math.max(r, g, b), |
|
h = NaN, |
|
s = max - min, |
|
l = (max + min) / 2; |
|
if (s) { |
|
if (r === max) h = (g - b) / s + (g < b) * 6; |
|
else if (g === max) h = (b - r) / s + 2; |
|
else h = (r - g) / s + 4; |
|
s /= l < 0.5 ? max + min : 2 - max - min; |
|
h *= 60; |
|
} else { |
|
s = l > 0 && l < 1 ? 0 : h; |
|
} |
|
return new Hsl(h, s, l, o.opacity); |
|
} |
|
|
|
function hsl(h, s, l, opacity) { |
|
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function Hsl(h, s, l, opacity) { |
|
this.h = +h; |
|
this.s = +s; |
|
this.l = +l; |
|
this.opacity = +opacity; |
|
} |
|
|
|
Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Hsl, hsl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(Color, { |
|
brighter: function(k) { |
|
k = k == null ? brighter : Math.pow(brighter, k); |
|
return new Hsl(this.h, this.s, this.l * k, this.opacity); |
|
}, |
|
darker: function(k) { |
|
k = k == null ? darker : Math.pow(darker, k); |
|
return new Hsl(this.h, this.s, this.l * k, this.opacity); |
|
}, |
|
rgb: function() { |
|
var h = this.h % 360 + (this.h < 0) * 360, |
|
s = isNaN(h) || isNaN(this.s) ? 0 : this.s, |
|
l = this.l, |
|
m2 = l + (l < 0.5 ? l : 1 - l) * s, |
|
m1 = 2 * l - m2; |
|
return new Rgb( |
|
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), |
|
hsl2rgb(h, m1, m2), |
|
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), |
|
this.opacity |
|
); |
|
}, |
|
displayable: function() { |
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) |
|
&& (0 <= this.l && this.l <= 1) |
|
&& (0 <= this.opacity && this.opacity <= 1); |
|
}, |
|
formatHsl: function() { |
|
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); |
|
return (a === 1 ? "hsl(" : "hsla(") |
|
+ (this.h || 0) + ", " |
|
+ (this.s || 0) * 100 + "%, " |
|
+ (this.l || 0) * 100 + "%" |
|
+ (a === 1 ? ")" : ", " + a + ")"); |
|
} |
|
})); |
|
|
|
/* From FvD 13.37, CSS Color Module Level 3 */ |
|
function hsl2rgb(h, m1, m2) { |
|
return (h < 60 ? m1 + (m2 - m1) * h / 60 |
|
: h < 180 ? m2 |
|
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 |
|
: m1) * 255; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-color/src/cubehelix.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-color/src/cubehelix.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default, Cubehelix */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return cubehelix; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cubehelix", function() { return Cubehelix; }); |
|
/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "../node_modules/d3-color/src/define.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-color/src/color.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-color/src/math.js"); |
|
|
|
|
|
|
|
|
|
var A = -0.14861, |
|
B = +1.78277, |
|
C = -0.29227, |
|
D = -0.90649, |
|
E = +1.97294, |
|
ED = E * D, |
|
EB = E * B, |
|
BC_DA = B * C - D * A; |
|
|
|
function cubehelixConvert(o) { |
|
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); |
|
if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["rgbConvert"])(o); |
|
var r = o.r / 255, |
|
g = o.g / 255, |
|
b = o.b / 255, |
|
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), |
|
bl = b - l, |
|
k = (E * (g - l) - C * bl) / D, |
|
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 |
|
h = s ? Math.atan2(k, bl) * _math_js__WEBPACK_IMPORTED_MODULE_2__["rad2deg"] - 120 : NaN; |
|
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); |
|
} |
|
|
|
function cubehelix(h, s, l, opacity) { |
|
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function Cubehelix(h, s, l, opacity) { |
|
this.h = +h; |
|
this.s = +s; |
|
this.l = +l; |
|
this.opacity = +opacity; |
|
} |
|
|
|
Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Cubehelix, cubehelix, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], { |
|
brighter: function(k) { |
|
k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__["brighter"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__["brighter"], k); |
|
return new Cubehelix(this.h, this.s, this.l * k, this.opacity); |
|
}, |
|
darker: function(k) { |
|
k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__["darker"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__["darker"], k); |
|
return new Cubehelix(this.h, this.s, this.l * k, this.opacity); |
|
}, |
|
rgb: function() { |
|
var h = isNaN(this.h) ? 0 : (this.h + 120) * _math_js__WEBPACK_IMPORTED_MODULE_2__["deg2rad"], |
|
l = +this.l, |
|
a = isNaN(this.s) ? 0 : this.s * l * (1 - l), |
|
cosh = Math.cos(h), |
|
sinh = Math.sin(h); |
|
return new _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"]( |
|
255 * (l + a * (A * cosh + B * sinh)), |
|
255 * (l + a * (C * cosh + D * sinh)), |
|
255 * (l + a * (E * cosh)), |
|
this.opacity |
|
); |
|
} |
|
})); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-color/src/define.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-color/src/define.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default, extend */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return extend; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(constructor, factory, prototype) { |
|
constructor.prototype = factory.prototype = prototype; |
|
prototype.constructor = constructor; |
|
}); |
|
|
|
function extend(parent, definition) { |
|
var prototype = Object.create(parent.prototype); |
|
for (var key in definition) prototype[key] = definition[key]; |
|
return prototype; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-color/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-color/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: color, rgb, hsl, lab, hcl, lch, gray, cubehelix */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-color/src/color.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "color", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["rgb"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__["hsl"]; }); |
|
|
|
/* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lab.js */ "../node_modules/d3-color/src/lab.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lab", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["hcl"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["lch"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__["gray"]; }); |
|
|
|
/* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubehelix.js */ "../node_modules/d3-color/src/cubehelix.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cubehelix", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-color/src/lab.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-color/src/lab.js ***! |
|
\*******************************************/ |
|
/*! exports provided: gray, default, Lab, lch, hcl, Hcl */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return gray; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lab; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lab", function() { return Lab; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return lch; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return hcl; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hcl", function() { return Hcl; }); |
|
/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ "../node_modules/d3-color/src/define.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-color/src/color.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-color/src/math.js"); |
|
|
|
|
|
|
|
|
|
// https://observablehq.com/@mbostock/lab-and-rgb |
|
var K = 18, |
|
Xn = 0.96422, |
|
Yn = 1, |
|
Zn = 0.82521, |
|
t0 = 4 / 29, |
|
t1 = 6 / 29, |
|
t2 = 3 * t1 * t1, |
|
t3 = t1 * t1 * t1; |
|
|
|
function labConvert(o) { |
|
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); |
|
if (o instanceof Hcl) return hcl2lab(o); |
|
if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["rgbConvert"])(o); |
|
var r = rgb2lrgb(o.r), |
|
g = rgb2lrgb(o.g), |
|
b = rgb2lrgb(o.b), |
|
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; |
|
if (r === g && g === b) x = z = y; else { |
|
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); |
|
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); |
|
} |
|
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); |
|
} |
|
|
|
function gray(l, opacity) { |
|
return new Lab(l, 0, 0, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function lab(l, a, b, opacity) { |
|
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function Lab(l, a, b, opacity) { |
|
this.l = +l; |
|
this.a = +a; |
|
this.b = +b; |
|
this.opacity = +opacity; |
|
} |
|
|
|
Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Lab, lab, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], { |
|
brighter: function(k) { |
|
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); |
|
}, |
|
darker: function(k) { |
|
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); |
|
}, |
|
rgb: function() { |
|
var y = (this.l + 16) / 116, |
|
x = isNaN(this.a) ? y : y + this.a / 500, |
|
z = isNaN(this.b) ? y : y - this.b / 200; |
|
x = Xn * lab2xyz(x); |
|
y = Yn * lab2xyz(y); |
|
z = Zn * lab2xyz(z); |
|
return new _color_js__WEBPACK_IMPORTED_MODULE_1__["Rgb"]( |
|
lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), |
|
lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), |
|
lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), |
|
this.opacity |
|
); |
|
} |
|
})); |
|
|
|
function xyz2lab(t) { |
|
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; |
|
} |
|
|
|
function lab2xyz(t) { |
|
return t > t1 ? t * t * t : t2 * (t - t0); |
|
} |
|
|
|
function lrgb2rgb(x) { |
|
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); |
|
} |
|
|
|
function rgb2lrgb(x) { |
|
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); |
|
} |
|
|
|
function hclConvert(o) { |
|
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); |
|
if (!(o instanceof Lab)) o = labConvert(o); |
|
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); |
|
var h = Math.atan2(o.b, o.a) * _math_js__WEBPACK_IMPORTED_MODULE_2__["rad2deg"]; |
|
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); |
|
} |
|
|
|
function lch(l, c, h, opacity) { |
|
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function hcl(h, c, l, opacity) { |
|
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); |
|
} |
|
|
|
function Hcl(h, c, l, opacity) { |
|
this.h = +h; |
|
this.c = +c; |
|
this.l = +l; |
|
this.opacity = +opacity; |
|
} |
|
|
|
function hcl2lab(o) { |
|
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); |
|
var h = o.h * _math_js__WEBPACK_IMPORTED_MODULE_2__["deg2rad"]; |
|
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); |
|
} |
|
|
|
Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Hcl, hcl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__["extend"])(_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"], { |
|
brighter: function(k) { |
|
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); |
|
}, |
|
darker: function(k) { |
|
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); |
|
}, |
|
rgb: function() { |
|
return hcl2lab(this).rgb(); |
|
} |
|
})); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-color/src/math.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-color/src/math.js ***! |
|
\********************************************/ |
|
/*! exports provided: deg2rad, rad2deg */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deg2rad", function() { return deg2rad; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rad2deg", function() { return rad2deg; }); |
|
var deg2rad = Math.PI / 180; |
|
var rad2deg = 180 / Math.PI; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/area.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-contour/src/area.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(ring) { |
|
var i = 0, n = ring.length, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1]; |
|
while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1]; |
|
return area; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/array.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-contour/src/array.js ***! |
|
\***********************************************/ |
|
/*! exports provided: slice */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
var array = Array.prototype; |
|
|
|
var slice = array.slice; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/ascending.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-contour/src/ascending.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return a - b; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/blur.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-contour/src/blur.js ***! |
|
\**********************************************/ |
|
/*! exports provided: blurX, blurY */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blurX", function() { return blurX; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blurY", function() { return blurY; }); |
|
// TODO Optimize edge cases. |
|
// TODO Optimize index calculation. |
|
// TODO Optimize arguments. |
|
function blurX(source, target, r) { |
|
var n = source.width, |
|
m = source.height, |
|
w = (r << 1) + 1; |
|
for (var j = 0; j < m; ++j) { |
|
for (var i = 0, sr = 0; i < n + r; ++i) { |
|
if (i < n) { |
|
sr += source.data[i + j * n]; |
|
} |
|
if (i >= r) { |
|
if (i >= w) { |
|
sr -= source.data[i - w + j * n]; |
|
} |
|
target.data[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w); |
|
} |
|
} |
|
} |
|
} |
|
|
|
// TODO Optimize edge cases. |
|
// TODO Optimize index calculation. |
|
// TODO Optimize arguments. |
|
function blurY(source, target, r) { |
|
var n = source.width, |
|
m = source.height, |
|
w = (r << 1) + 1; |
|
for (var i = 0; i < n; ++i) { |
|
for (var j = 0, sr = 0; j < m + r; ++j) { |
|
if (j < m) { |
|
sr += source.data[i + j * n]; |
|
} |
|
if (j >= r) { |
|
if (j >= w) { |
|
sr -= source.data[i + (j - w) * n]; |
|
} |
|
target.data[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w); |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/constant.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-contour/src/constant.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/contains.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-contour/src/contains.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(ring, hole) { |
|
var i = -1, n = hole.length, c; |
|
while (++i < n) if (c = ringContains(ring, hole[i])) return c; |
|
return 0; |
|
}); |
|
|
|
function ringContains(ring, point) { |
|
var x = point[0], y = point[1], contains = -1; |
|
for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) { |
|
var pi = ring[i], xi = pi[0], yi = pi[1], pj = ring[j], xj = pj[0], yj = pj[1]; |
|
if (segmentContains(pi, pj, point)) return 0; |
|
if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) contains = -contains; |
|
} |
|
return contains; |
|
} |
|
|
|
function segmentContains(a, b, c) { |
|
var i; return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]); |
|
} |
|
|
|
function collinear(a, b, c) { |
|
return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]); |
|
} |
|
|
|
function within(p, q, r) { |
|
return p <= q && q <= r || r <= q && q <= p; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/contours.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-contour/src/contours.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array */ "../node_modules/d3-contour/src/array.js"); |
|
/* harmony import */ var _ascending__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ascending */ "../node_modules/d3-contour/src/ascending.js"); |
|
/* harmony import */ var _area__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./area */ "../node_modules/d3-contour/src/area.js"); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-contour/src/constant.js"); |
|
/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contains */ "../node_modules/d3-contour/src/contains.js"); |
|
/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./noop */ "../node_modules/d3-contour/src/noop.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cases = [ |
|
[], |
|
[[[1.0, 1.5], [0.5, 1.0]]], |
|
[[[1.5, 1.0], [1.0, 1.5]]], |
|
[[[1.5, 1.0], [0.5, 1.0]]], |
|
[[[1.0, 0.5], [1.5, 1.0]]], |
|
[[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]], |
|
[[[1.0, 0.5], [1.0, 1.5]]], |
|
[[[1.0, 0.5], [0.5, 1.0]]], |
|
[[[0.5, 1.0], [1.0, 0.5]]], |
|
[[[1.0, 1.5], [1.0, 0.5]]], |
|
[[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]], |
|
[[[1.5, 1.0], [1.0, 0.5]]], |
|
[[[0.5, 1.0], [1.5, 1.0]]], |
|
[[[1.0, 1.5], [1.5, 1.0]]], |
|
[[[0.5, 1.0], [1.0, 1.5]]], |
|
[] |
|
]; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var dx = 1, |
|
dy = 1, |
|
threshold = d3_array__WEBPACK_IMPORTED_MODULE_0__["thresholdSturges"], |
|
smooth = smoothLinear; |
|
|
|
function contours(values) { |
|
var tz = threshold(values); |
|
|
|
// Convert number of thresholds into uniform thresholds. |
|
if (!Array.isArray(tz)) { |
|
var domain = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["extent"])(values), start = domain[0], stop = domain[1]; |
|
tz = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickStep"])(start, stop, tz); |
|
tz = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(Math.floor(start / tz) * tz, Math.floor(stop / tz) * tz, tz); |
|
} else { |
|
tz = tz.slice().sort(_ascending__WEBPACK_IMPORTED_MODULE_2__["default"]); |
|
} |
|
|
|
return tz.map(function(value) { |
|
return contour(values, value); |
|
}); |
|
} |
|
|
|
// Accumulate, smooth contour rings, assign holes to exterior rings. |
|
// Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js |
|
function contour(values, value) { |
|
var polygons = [], |
|
holes = []; |
|
|
|
isorings(values, value, function(ring) { |
|
smooth(ring, values, value); |
|
if (Object(_area__WEBPACK_IMPORTED_MODULE_3__["default"])(ring) > 0) polygons.push([ring]); |
|
else holes.push(ring); |
|
}); |
|
|
|
holes.forEach(function(hole) { |
|
for (var i = 0, n = polygons.length, polygon; i < n; ++i) { |
|
if (Object(_contains__WEBPACK_IMPORTED_MODULE_5__["default"])((polygon = polygons[i])[0], hole) !== -1) { |
|
polygon.push(hole); |
|
return; |
|
} |
|
} |
|
}); |
|
|
|
return { |
|
type: "MultiPolygon", |
|
value: value, |
|
coordinates: polygons |
|
}; |
|
} |
|
|
|
// Marching squares with isolines stitched into rings. |
|
// Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js |
|
function isorings(values, value, callback) { |
|
var fragmentByStart = new Array, |
|
fragmentByEnd = new Array, |
|
x, y, t0, t1, t2, t3; |
|
|
|
// Special case for the first row (y = -1, t2 = t3 = 0). |
|
x = y = -1; |
|
t1 = values[0] >= value; |
|
cases[t1 << 1].forEach(stitch); |
|
while (++x < dx - 1) { |
|
t0 = t1, t1 = values[x + 1] >= value; |
|
cases[t0 | t1 << 1].forEach(stitch); |
|
} |
|
cases[t1 << 0].forEach(stitch); |
|
|
|
// General case for the intermediate rows. |
|
while (++y < dy - 1) { |
|
x = -1; |
|
t1 = values[y * dx + dx] >= value; |
|
t2 = values[y * dx] >= value; |
|
cases[t1 << 1 | t2 << 2].forEach(stitch); |
|
while (++x < dx - 1) { |
|
t0 = t1, t1 = values[y * dx + dx + x + 1] >= value; |
|
t3 = t2, t2 = values[y * dx + x + 1] >= value; |
|
cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch); |
|
} |
|
cases[t1 | t2 << 3].forEach(stitch); |
|
} |
|
|
|
// Special case for the last row (y = dy - 1, t0 = t1 = 0). |
|
x = -1; |
|
t2 = values[y * dx] >= value; |
|
cases[t2 << 2].forEach(stitch); |
|
while (++x < dx - 1) { |
|
t3 = t2, t2 = values[y * dx + x + 1] >= value; |
|
cases[t2 << 2 | t3 << 3].forEach(stitch); |
|
} |
|
cases[t2 << 3].forEach(stitch); |
|
|
|
function stitch(line) { |
|
var start = [line[0][0] + x, line[0][1] + y], |
|
end = [line[1][0] + x, line[1][1] + y], |
|
startIndex = index(start), |
|
endIndex = index(end), |
|
f, g; |
|
if (f = fragmentByEnd[startIndex]) { |
|
if (g = fragmentByStart[endIndex]) { |
|
delete fragmentByEnd[f.end]; |
|
delete fragmentByStart[g.start]; |
|
if (f === g) { |
|
f.ring.push(end); |
|
callback(f.ring); |
|
} else { |
|
fragmentByStart[f.start] = fragmentByEnd[g.end] = {start: f.start, end: g.end, ring: f.ring.concat(g.ring)}; |
|
} |
|
} else { |
|
delete fragmentByEnd[f.end]; |
|
f.ring.push(end); |
|
fragmentByEnd[f.end = endIndex] = f; |
|
} |
|
} else if (f = fragmentByStart[endIndex]) { |
|
if (g = fragmentByEnd[startIndex]) { |
|
delete fragmentByStart[f.start]; |
|
delete fragmentByEnd[g.end]; |
|
if (f === g) { |
|
f.ring.push(end); |
|
callback(f.ring); |
|
} else { |
|
fragmentByStart[g.start] = fragmentByEnd[f.end] = {start: g.start, end: f.end, ring: g.ring.concat(f.ring)}; |
|
} |
|
} else { |
|
delete fragmentByStart[f.start]; |
|
f.ring.unshift(start); |
|
fragmentByStart[f.start = startIndex] = f; |
|
} |
|
} else { |
|
fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {start: startIndex, end: endIndex, ring: [start, end]}; |
|
} |
|
} |
|
} |
|
|
|
function index(point) { |
|
return point[0] * 2 + point[1] * (dx + 1) * 4; |
|
} |
|
|
|
function smoothLinear(ring, values, value) { |
|
ring.forEach(function(point) { |
|
var x = point[0], |
|
y = point[1], |
|
xt = x | 0, |
|
yt = y | 0, |
|
v0, |
|
v1 = values[yt * dx + xt]; |
|
if (x > 0 && x < dx && xt === x) { |
|
v0 = values[yt * dx + xt - 1]; |
|
point[0] = x + (value - v0) / (v1 - v0) - 0.5; |
|
} |
|
if (y > 0 && y < dy && yt === y) { |
|
v0 = values[(yt - 1) * dx + xt]; |
|
point[1] = y + (value - v0) / (v1 - v0) - 0.5; |
|
} |
|
}); |
|
} |
|
|
|
contours.contour = contour; |
|
|
|
contours.size = function(_) { |
|
if (!arguments.length) return [dx, dy]; |
|
var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]); |
|
if (!(_0 > 0) || !(_1 > 0)) throw new Error("invalid size"); |
|
return dx = _0, dy = _1, contours; |
|
}; |
|
|
|
contours.thresholds = function(_) { |
|
return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? Object(_constant__WEBPACK_IMPORTED_MODULE_4__["default"])(_array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_)) : Object(_constant__WEBPACK_IMPORTED_MODULE_4__["default"])(_), contours) : threshold; |
|
}; |
|
|
|
contours.smooth = function(_) { |
|
return arguments.length ? (smooth = _ ? smoothLinear : _noop__WEBPACK_IMPORTED_MODULE_6__["default"], contours) : smooth === smoothLinear; |
|
}; |
|
|
|
return contours; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/density.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-contour/src/density.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array */ "../node_modules/d3-contour/src/array.js"); |
|
/* harmony import */ var _blur__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blur */ "../node_modules/d3-contour/src/blur.js"); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-contour/src/constant.js"); |
|
/* harmony import */ var _contours__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contours */ "../node_modules/d3-contour/src/contours.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
function defaultX(d) { |
|
return d[0]; |
|
} |
|
|
|
function defaultY(d) { |
|
return d[1]; |
|
} |
|
|
|
function defaultWeight() { |
|
return 1; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var x = defaultX, |
|
y = defaultY, |
|
weight = defaultWeight, |
|
dx = 960, |
|
dy = 500, |
|
r = 20, // blur radius |
|
k = 2, // log2(grid cell size) |
|
o = r * 3, // grid offset, to pad for blur |
|
n = (dx + o * 2) >> k, // grid width |
|
m = (dy + o * 2) >> k, // grid height |
|
threshold = Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(20); |
|
|
|
function density(data) { |
|
var values0 = new Float32Array(n * m), |
|
values1 = new Float32Array(n * m); |
|
|
|
data.forEach(function(d, i, data) { |
|
var xi = (+x(d, i, data) + o) >> k, |
|
yi = (+y(d, i, data) + o) >> k, |
|
wi = +weight(d, i, data); |
|
if (xi >= 0 && xi < n && yi >= 0 && yi < m) { |
|
values0[xi + yi * n] += wi; |
|
} |
|
}); |
|
|
|
// TODO Optimize. |
|
Object(_blur__WEBPACK_IMPORTED_MODULE_2__["blurX"])({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k); |
|
Object(_blur__WEBPACK_IMPORTED_MODULE_2__["blurY"])({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k); |
|
Object(_blur__WEBPACK_IMPORTED_MODULE_2__["blurX"])({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k); |
|
Object(_blur__WEBPACK_IMPORTED_MODULE_2__["blurY"])({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k); |
|
Object(_blur__WEBPACK_IMPORTED_MODULE_2__["blurX"])({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k); |
|
Object(_blur__WEBPACK_IMPORTED_MODULE_2__["blurY"])({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k); |
|
|
|
var tz = threshold(values0); |
|
|
|
// Convert number of thresholds into uniform thresholds. |
|
if (!Array.isArray(tz)) { |
|
var stop = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["max"])(values0); |
|
tz = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickStep"])(0, stop, tz); |
|
tz = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(0, Math.floor(stop / tz) * tz, tz); |
|
tz.shift(); |
|
} |
|
|
|
return Object(_contours__WEBPACK_IMPORTED_MODULE_4__["default"])() |
|
.thresholds(tz) |
|
.size([n, m]) |
|
(values0) |
|
.map(transform); |
|
} |
|
|
|
function transform(geometry) { |
|
geometry.value *= Math.pow(2, -2 * k); // Density in points per square pixel. |
|
geometry.coordinates.forEach(transformPolygon); |
|
return geometry; |
|
} |
|
|
|
function transformPolygon(coordinates) { |
|
coordinates.forEach(transformRing); |
|
} |
|
|
|
function transformRing(coordinates) { |
|
coordinates.forEach(transformPoint); |
|
} |
|
|
|
// TODO Optimize. |
|
function transformPoint(coordinates) { |
|
coordinates[0] = coordinates[0] * Math.pow(2, k) - o; |
|
coordinates[1] = coordinates[1] * Math.pow(2, k) - o; |
|
} |
|
|
|
function resize() { |
|
o = r * 3; |
|
n = (dx + o * 2) >> k; |
|
m = (dy + o * 2) >> k; |
|
return density; |
|
} |
|
|
|
density.x = function(_) { |
|
return arguments.length ? (x = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(+_), density) : x; |
|
}; |
|
|
|
density.y = function(_) { |
|
return arguments.length ? (y = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(+_), density) : y; |
|
}; |
|
|
|
density.weight = function(_) { |
|
return arguments.length ? (weight = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(+_), density) : weight; |
|
}; |
|
|
|
density.size = function(_) { |
|
if (!arguments.length) return [dx, dy]; |
|
var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]); |
|
if (!(_0 >= 0) && !(_0 >= 0)) throw new Error("invalid size"); |
|
return dx = _0, dy = _1, resize(); |
|
}; |
|
|
|
density.cellSize = function(_) { |
|
if (!arguments.length) return 1 << k; |
|
if (!((_ = +_) >= 1)) throw new Error("invalid cell size"); |
|
return k = Math.floor(Math.log(_) / Math.LN2), resize(); |
|
}; |
|
|
|
density.thresholds = function(_) { |
|
return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(_array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_)) : Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(_), density) : threshold; |
|
}; |
|
|
|
density.bandwidth = function(_) { |
|
if (!arguments.length) return Math.sqrt(r * (r + 1)); |
|
if (!((_ = +_) >= 0)) throw new Error("invalid bandwidth"); |
|
return r = Math.round((Math.sqrt(4 * _ * _ + 1) - 1) / 2), resize(); |
|
}; |
|
|
|
return density; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/index.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-contour/src/index.js ***! |
|
\***********************************************/ |
|
/*! exports provided: contours, contourDensity */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _contours__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contours */ "../node_modules/d3-contour/src/contours.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contours", function() { return _contours__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _density__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./density */ "../node_modules/d3-contour/src/density.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contourDensity", function() { return _density__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-contour/src/noop.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-contour/src/noop.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() {}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dispatch/src/dispatch.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-dispatch/src/dispatch.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var noop = {value: function() {}}; |
|
|
|
function dispatch() { |
|
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { |
|
if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); |
|
_[t] = []; |
|
} |
|
return new Dispatch(_); |
|
} |
|
|
|
function Dispatch(_) { |
|
this._ = _; |
|
} |
|
|
|
function parseTypenames(typenames, types) { |
|
return typenames.trim().split(/^|\s+/).map(function(t) { |
|
var name = "", i = t.indexOf("."); |
|
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); |
|
if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); |
|
return {type: t, name: name}; |
|
}); |
|
} |
|
|
|
Dispatch.prototype = dispatch.prototype = { |
|
constructor: Dispatch, |
|
on: function(typename, callback) { |
|
var _ = this._, |
|
T = parseTypenames(typename + "", _), |
|
t, |
|
i = -1, |
|
n = T.length; |
|
|
|
// If no callback was specified, return the callback of the given type and name. |
|
if (arguments.length < 2) { |
|
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; |
|
return; |
|
} |
|
|
|
// If a type was specified, set the callback for the given type and name. |
|
// Otherwise, if a null callback was specified, remove callbacks of the given name. |
|
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); |
|
while (++i < n) { |
|
if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); |
|
else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); |
|
} |
|
|
|
return this; |
|
}, |
|
copy: function() { |
|
var copy = {}, _ = this._; |
|
for (var t in _) copy[t] = _[t].slice(); |
|
return new Dispatch(copy); |
|
}, |
|
call: function(type, that) { |
|
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; |
|
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); |
|
for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); |
|
}, |
|
apply: function(type, that, args) { |
|
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); |
|
for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); |
|
} |
|
}; |
|
|
|
function get(type, name) { |
|
for (var i = 0, n = type.length, c; i < n; ++i) { |
|
if ((c = type[i]).name === name) { |
|
return c.value; |
|
} |
|
} |
|
} |
|
|
|
function set(type, name, callback) { |
|
for (var i = 0, n = type.length; i < n; ++i) { |
|
if (type[i].name === name) { |
|
type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); |
|
break; |
|
} |
|
} |
|
if (callback != null) type.push({name: name, value: callback}); |
|
return type; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (dispatch); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dispatch/src/index.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-dispatch/src/index.js ***! |
|
\************************************************/ |
|
/*! exports provided: dispatch */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _dispatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dispatch.js */ "../node_modules/d3-dispatch/src/dispatch.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return _dispatch_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-drag/src/constant.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-drag/src/constant.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-drag/src/drag.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-drag/src/drag.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ "../node_modules/d3-dispatch/src/index.js"); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _nodrag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nodrag.js */ "../node_modules/d3-drag/src/nodrag.js"); |
|
/* harmony import */ var _noevent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./noevent.js */ "../node_modules/d3-drag/src/noevent.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-drag/src/constant.js"); |
|
/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./event.js */ "../node_modules/d3-drag/src/event.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ignore right-click, since that should open the context menu. |
|
function defaultFilter() { |
|
return !d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].ctrlKey && !d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].button; |
|
} |
|
|
|
function defaultContainer() { |
|
return this.parentNode; |
|
} |
|
|
|
function defaultSubject(d) { |
|
return d == null ? {x: d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].x, y: d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].y} : d; |
|
} |
|
|
|
function defaultTouchable() { |
|
return navigator.maxTouchPoints || ("ontouchstart" in this); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var filter = defaultFilter, |
|
container = defaultContainer, |
|
subject = defaultSubject, |
|
touchable = defaultTouchable, |
|
gestures = {}, |
|
listeners = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__["dispatch"])("start", "drag", "end"), |
|
active = 0, |
|
mousedownx, |
|
mousedowny, |
|
mousemoving, |
|
touchending, |
|
clickDistance2 = 0; |
|
|
|
function drag(selection) { |
|
selection |
|
.on("mousedown.drag", mousedowned) |
|
.filter(touchable) |
|
.on("touchstart.drag", touchstarted) |
|
.on("touchmove.drag", touchmoved) |
|
.on("touchend.drag touchcancel.drag", touchended) |
|
.style("touch-action", "none") |
|
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); |
|
} |
|
|
|
function mousedowned() { |
|
if (touchending || !filter.apply(this, arguments)) return; |
|
var gesture = beforestart("mouse", container.apply(this, arguments), d3_selection__WEBPACK_IMPORTED_MODULE_1__["mouse"], this, arguments); |
|
if (!gesture) return; |
|
Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["select"])(d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].view).on("mousemove.drag", mousemoved, true).on("mouseup.drag", mouseupped, true); |
|
Object(_nodrag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].view); |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_3__["nopropagation"])(); |
|
mousemoving = false; |
|
mousedownx = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].clientX; |
|
mousedowny = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].clientY; |
|
gesture("start"); |
|
} |
|
|
|
function mousemoved() { |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(); |
|
if (!mousemoving) { |
|
var dx = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].clientX - mousedownx, dy = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].clientY - mousedowny; |
|
mousemoving = dx * dx + dy * dy > clickDistance2; |
|
} |
|
gestures.mouse("drag"); |
|
} |
|
|
|
function mouseupped() { |
|
Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["select"])(d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].view).on("mousemove.drag mouseup.drag", null); |
|
Object(_nodrag_js__WEBPACK_IMPORTED_MODULE_2__["yesdrag"])(d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].view, mousemoving); |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(); |
|
gestures.mouse("end"); |
|
} |
|
|
|
function touchstarted() { |
|
if (!filter.apply(this, arguments)) return; |
|
var touches = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].changedTouches, |
|
c = container.apply(this, arguments), |
|
n = touches.length, i, gesture; |
|
|
|
for (i = 0; i < n; ++i) { |
|
if (gesture = beforestart(touches[i].identifier, c, d3_selection__WEBPACK_IMPORTED_MODULE_1__["touch"], this, arguments)) { |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_3__["nopropagation"])(); |
|
gesture("start"); |
|
} |
|
} |
|
} |
|
|
|
function touchmoved() { |
|
var touches = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].changedTouches, |
|
n = touches.length, i, gesture; |
|
|
|
for (i = 0; i < n; ++i) { |
|
if (gesture = gestures[touches[i].identifier]) { |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(); |
|
gesture("drag"); |
|
} |
|
} |
|
} |
|
|
|
function touchended() { |
|
var touches = d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].changedTouches, |
|
n = touches.length, i, gesture; |
|
|
|
if (touchending) clearTimeout(touchending); |
|
touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed! |
|
for (i = 0; i < n; ++i) { |
|
if (gesture = gestures[touches[i].identifier]) { |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_3__["nopropagation"])(); |
|
gesture("end"); |
|
} |
|
} |
|
} |
|
|
|
function beforestart(id, container, point, that, args) { |
|
var p = point(container, id), s, dx, dy, |
|
sublisteners = listeners.copy(); |
|
|
|
if (!Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["customEvent"])(new _event_js__WEBPACK_IMPORTED_MODULE_5__["default"](drag, "beforestart", s, id, active, p[0], p[1], 0, 0, sublisteners), function() { |
|
if ((d3_selection__WEBPACK_IMPORTED_MODULE_1__["event"].subject = s = subject.apply(that, args)) == null) return false; |
|
dx = s.x - p[0] || 0; |
|
dy = s.y - p[1] || 0; |
|
return true; |
|
})) return; |
|
|
|
return function gesture(type) { |
|
var p0 = p, n; |
|
switch (type) { |
|
case "start": gestures[id] = gesture, n = active++; break; |
|
case "end": delete gestures[id], --active; // nobreak |
|
case "drag": p = point(container, id), n = active; break; |
|
} |
|
Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["customEvent"])(new _event_js__WEBPACK_IMPORTED_MODULE_5__["default"](drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]); |
|
}; |
|
} |
|
|
|
drag.filter = function(_) { |
|
return arguments.length ? (filter = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_4__["default"])(!!_), drag) : filter; |
|
}; |
|
|
|
drag.container = function(_) { |
|
return arguments.length ? (container = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_), drag) : container; |
|
}; |
|
|
|
drag.subject = function(_) { |
|
return arguments.length ? (subject = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_), drag) : subject; |
|
}; |
|
|
|
drag.touchable = function(_) { |
|
return arguments.length ? (touchable = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_4__["default"])(!!_), drag) : touchable; |
|
}; |
|
|
|
drag.on = function() { |
|
var value = listeners.on.apply(listeners, arguments); |
|
return value === listeners ? drag : value; |
|
}; |
|
|
|
drag.clickDistance = function(_) { |
|
return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2); |
|
}; |
|
|
|
return drag; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-drag/src/event.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-drag/src/event.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DragEvent; }); |
|
function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) { |
|
this.target = target; |
|
this.type = type; |
|
this.subject = subject; |
|
this.identifier = id; |
|
this.active = active; |
|
this.x = x; |
|
this.y = y; |
|
this.dx = dx; |
|
this.dy = dy; |
|
this._ = dispatch; |
|
} |
|
|
|
DragEvent.prototype.on = function() { |
|
var value = this._.on.apply(this._, arguments); |
|
return value === this._ ? this : value; |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-drag/src/index.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-drag/src/index.js ***! |
|
\********************************************/ |
|
/*! exports provided: drag, dragDisable, dragEnable */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _drag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drag.js */ "../node_modules/d3-drag/src/drag.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drag", function() { return _drag_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _nodrag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodrag.js */ "../node_modules/d3-drag/src/nodrag.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragDisable", function() { return _nodrag_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragEnable", function() { return _nodrag_js__WEBPACK_IMPORTED_MODULE_1__["yesdrag"]; }); |
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-drag/src/nodrag.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-drag/src/nodrag.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default, yesdrag */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yesdrag", function() { return yesdrag; }); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _noevent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noevent.js */ "../node_modules/d3-drag/src/noevent.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(view) { |
|
var root = view.document.documentElement, |
|
selection = Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["select"])(view).on("dragstart.drag", _noevent_js__WEBPACK_IMPORTED_MODULE_1__["default"], true); |
|
if ("onselectstart" in root) { |
|
selection.on("selectstart.drag", _noevent_js__WEBPACK_IMPORTED_MODULE_1__["default"], true); |
|
} else { |
|
root.__noselect = root.style.MozUserSelect; |
|
root.style.MozUserSelect = "none"; |
|
} |
|
}); |
|
|
|
function yesdrag(view, noclick) { |
|
var root = view.document.documentElement, |
|
selection = Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["select"])(view).on("dragstart.drag", null); |
|
if (noclick) { |
|
selection.on("click.drag", _noevent_js__WEBPACK_IMPORTED_MODULE_1__["default"], true); |
|
setTimeout(function() { selection.on("click.drag", null); }, 0); |
|
} |
|
if ("onselectstart" in root) { |
|
selection.on("selectstart.drag", null); |
|
} else { |
|
root.style.MozUserSelect = root.__noselect; |
|
delete root.__noselect; |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-drag/src/noevent.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-drag/src/noevent.js ***! |
|
\**********************************************/ |
|
/*! exports provided: nopropagation, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nopropagation", function() { return nopropagation; }); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
|
|
|
|
function nopropagation() { |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].stopImmediatePropagation(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].preventDefault(); |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].stopImmediatePropagation(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dsv/src/autoType.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-dsv/src/autoType.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return autoType; }); |
|
function autoType(object) { |
|
for (var key in object) { |
|
var value = object[key].trim(), number, m; |
|
if (!value) value = null; |
|
else if (value === "true") value = true; |
|
else if (value === "false") value = false; |
|
else if (value === "NaN") value = NaN; |
|
else if (!isNaN(number = +value)) value = number; |
|
else if (m = value.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)) { |
|
if (fixtz && !!m[4] && !m[7]) value = value.replace(/-/g, "/").replace(/T/, " "); |
|
value = new Date(value); |
|
} |
|
else continue; |
|
object[key] = value; |
|
} |
|
return object; |
|
} |
|
|
|
// https://github.com/d3/d3-dsv/issues/45 |
|
var fixtz = new Date("2019-01-01T00:00").getHours() || new Date("2019-07-01T00:00").getHours(); |
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dsv/src/csv.js": |
|
/*!*****************************************!*\ |
|
!*** ../node_modules/d3-dsv/src/csv.js ***! |
|
\*****************************************/ |
|
/*! exports provided: csvParse, csvParseRows, csvFormat, csvFormatBody, csvFormatRows, csvFormatRow, csvFormatValue */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvParse", function() { return csvParse; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvParseRows", function() { return csvParseRows; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvFormat", function() { return csvFormat; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvFormatBody", function() { return csvFormatBody; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvFormatRows", function() { return csvFormatRows; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvFormatRow", function() { return csvFormatRow; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csvFormatValue", function() { return csvFormatValue; }); |
|
/* harmony import */ var _dsv_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsv.js */ "../node_modules/d3-dsv/src/dsv.js"); |
|
|
|
|
|
var csv = Object(_dsv_js__WEBPACK_IMPORTED_MODULE_0__["default"])(","); |
|
|
|
var csvParse = csv.parse; |
|
var csvParseRows = csv.parseRows; |
|
var csvFormat = csv.format; |
|
var csvFormatBody = csv.formatBody; |
|
var csvFormatRows = csv.formatRows; |
|
var csvFormatRow = csv.formatRow; |
|
var csvFormatValue = csv.formatValue; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dsv/src/dsv.js": |
|
/*!*****************************************!*\ |
|
!*** ../node_modules/d3-dsv/src/dsv.js ***! |
|
\*****************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var EOL = {}, |
|
EOF = {}, |
|
QUOTE = 34, |
|
NEWLINE = 10, |
|
RETURN = 13; |
|
|
|
function objectConverter(columns) { |
|
return new Function("d", "return {" + columns.map(function(name, i) { |
|
return JSON.stringify(name) + ": d[" + i + "] || \"\""; |
|
}).join(",") + "}"); |
|
} |
|
|
|
function customConverter(columns, f) { |
|
var object = objectConverter(columns); |
|
return function(row, i) { |
|
return f(object(row), i, columns); |
|
}; |
|
} |
|
|
|
// Compute unique columns in order of discovery. |
|
function inferColumns(rows) { |
|
var columnSet = Object.create(null), |
|
columns = []; |
|
|
|
rows.forEach(function(row) { |
|
for (var column in row) { |
|
if (!(column in columnSet)) { |
|
columns.push(columnSet[column] = column); |
|
} |
|
} |
|
}); |
|
|
|
return columns; |
|
} |
|
|
|
function pad(value, width) { |
|
var s = value + "", length = s.length; |
|
return length < width ? new Array(width - length + 1).join(0) + s : s; |
|
} |
|
|
|
function formatYear(year) { |
|
return year < 0 ? "-" + pad(-year, 6) |
|
: year > 9999 ? "+" + pad(year, 6) |
|
: pad(year, 4); |
|
} |
|
|
|
function formatDate(date) { |
|
var hours = date.getUTCHours(), |
|
minutes = date.getUTCMinutes(), |
|
seconds = date.getUTCSeconds(), |
|
milliseconds = date.getUTCMilliseconds(); |
|
return isNaN(date) ? "Invalid Date" |
|
: formatYear(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) |
|
+ (milliseconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "." + pad(milliseconds, 3) + "Z" |
|
: seconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "Z" |
|
: minutes || hours ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + "Z" |
|
: ""); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(delimiter) { |
|
var reFormat = new RegExp("[\"" + delimiter + "\n\r]"), |
|
DELIMITER = delimiter.charCodeAt(0); |
|
|
|
function parse(text, f) { |
|
var convert, columns, rows = parseRows(text, function(row, i) { |
|
if (convert) return convert(row, i - 1); |
|
columns = row, convert = f ? customConverter(row, f) : objectConverter(row); |
|
}); |
|
rows.columns = columns || []; |
|
return rows; |
|
} |
|
|
|
function parseRows(text, f) { |
|
var rows = [], // output rows |
|
N = text.length, |
|
I = 0, // current character index |
|
n = 0, // current line number |
|
t, // current token |
|
eof = N <= 0, // current token followed by EOF? |
|
eol = false; // current token followed by EOL? |
|
|
|
// Strip the trailing newline. |
|
if (text.charCodeAt(N - 1) === NEWLINE) --N; |
|
if (text.charCodeAt(N - 1) === RETURN) --N; |
|
|
|
function token() { |
|
if (eof) return EOF; |
|
if (eol) return eol = false, EOL; |
|
|
|
// Unescape quotes. |
|
var i, j = I, c; |
|
if (text.charCodeAt(j) === QUOTE) { |
|
while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE); |
|
if ((i = I) >= N) eof = true; |
|
else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true; |
|
else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; } |
|
return text.slice(j + 1, i - 1).replace(/""/g, "\""); |
|
} |
|
|
|
// Find next delimiter or newline. |
|
while (I < N) { |
|
if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true; |
|
else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; } |
|
else if (c !== DELIMITER) continue; |
|
return text.slice(j, i); |
|
} |
|
|
|
// Return last token before EOF. |
|
return eof = true, text.slice(j, N); |
|
} |
|
|
|
while ((t = token()) !== EOF) { |
|
var row = []; |
|
while (t !== EOL && t !== EOF) row.push(t), t = token(); |
|
if (f && (row = f(row, n++)) == null) continue; |
|
rows.push(row); |
|
} |
|
|
|
return rows; |
|
} |
|
|
|
function preformatBody(rows, columns) { |
|
return rows.map(function(row) { |
|
return columns.map(function(column) { |
|
return formatValue(row[column]); |
|
}).join(delimiter); |
|
}); |
|
} |
|
|
|
function format(rows, columns) { |
|
if (columns == null) columns = inferColumns(rows); |
|
return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n"); |
|
} |
|
|
|
function formatBody(rows, columns) { |
|
if (columns == null) columns = inferColumns(rows); |
|
return preformatBody(rows, columns).join("\n"); |
|
} |
|
|
|
function formatRows(rows) { |
|
return rows.map(formatRow).join("\n"); |
|
} |
|
|
|
function formatRow(row) { |
|
return row.map(formatValue).join(delimiter); |
|
} |
|
|
|
function formatValue(value) { |
|
return value == null ? "" |
|
: value instanceof Date ? formatDate(value) |
|
: reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" |
|
: value; |
|
} |
|
|
|
return { |
|
parse: parse, |
|
parseRows: parseRows, |
|
format: format, |
|
formatBody: formatBody, |
|
formatRows: formatRows, |
|
formatRow: formatRow, |
|
formatValue: formatValue |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dsv/src/index.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-dsv/src/index.js ***! |
|
\*******************************************/ |
|
/*! exports provided: dsvFormat, csvParse, csvParseRows, csvFormat, csvFormatBody, csvFormatRows, csvFormatRow, csvFormatValue, tsvParse, tsvParseRows, tsvFormat, tsvFormatBody, tsvFormatRows, tsvFormatRow, tsvFormatValue, autoType */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _dsv_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsv.js */ "../node_modules/d3-dsv/src/dsv.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsvFormat", function() { return _dsv_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _csv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./csv.js */ "../node_modules/d3-dsv/src/csv.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvParse", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvParseRows", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvParseRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormat", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatBody", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvFormatBody"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatRows", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvFormatRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatRow", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvFormatRow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatValue", function() { return _csv_js__WEBPACK_IMPORTED_MODULE_1__["csvFormatValue"]; }); |
|
|
|
/* harmony import */ var _tsv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tsv.js */ "../node_modules/d3-dsv/src/tsv.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvParse", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvParseRows", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvParseRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormat", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatBody", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvFormatBody"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatRows", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvFormatRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatRow", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvFormatRow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatValue", function() { return _tsv_js__WEBPACK_IMPORTED_MODULE_2__["tsvFormatValue"]; }); |
|
|
|
/* harmony import */ var _autoType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autoType.js */ "../node_modules/d3-dsv/src/autoType.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoType", function() { return _autoType_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-dsv/src/tsv.js": |
|
/*!*****************************************!*\ |
|
!*** ../node_modules/d3-dsv/src/tsv.js ***! |
|
\*****************************************/ |
|
/*! exports provided: tsvParse, tsvParseRows, tsvFormat, tsvFormatBody, tsvFormatRows, tsvFormatRow, tsvFormatValue */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvParse", function() { return tsvParse; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvParseRows", function() { return tsvParseRows; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvFormat", function() { return tsvFormat; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvFormatBody", function() { return tsvFormatBody; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvFormatRows", function() { return tsvFormatRows; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvFormatRow", function() { return tsvFormatRow; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsvFormatValue", function() { return tsvFormatValue; }); |
|
/* harmony import */ var _dsv_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dsv.js */ "../node_modules/d3-dsv/src/dsv.js"); |
|
|
|
|
|
var tsv = Object(_dsv_js__WEBPACK_IMPORTED_MODULE_0__["default"])("\t"); |
|
|
|
var tsvParse = tsv.parse; |
|
var tsvParseRows = tsv.parseRows; |
|
var tsvFormat = tsv.format; |
|
var tsvFormatBody = tsv.formatBody; |
|
var tsvFormatRows = tsv.formatRows; |
|
var tsvFormatRow = tsv.formatRow; |
|
var tsvFormatValue = tsv.formatValue; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/back.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-ease/src/back.js ***! |
|
\*******************************************/ |
|
/*! exports provided: backIn, backOut, backInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backIn", function() { return backIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backOut", function() { return backOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backInOut", function() { return backInOut; }); |
|
var overshoot = 1.70158; |
|
|
|
var backIn = (function custom(s) { |
|
s = +s; |
|
|
|
function backIn(t) { |
|
return (t = +t) * t * (s * (t - 1) + t); |
|
} |
|
|
|
backIn.overshoot = custom; |
|
|
|
return backIn; |
|
})(overshoot); |
|
|
|
var backOut = (function custom(s) { |
|
s = +s; |
|
|
|
function backOut(t) { |
|
return --t * t * ((t + 1) * s + t) + 1; |
|
} |
|
|
|
backOut.overshoot = custom; |
|
|
|
return backOut; |
|
})(overshoot); |
|
|
|
var backInOut = (function custom(s) { |
|
s = +s; |
|
|
|
function backInOut(t) { |
|
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2; |
|
} |
|
|
|
backInOut.overshoot = custom; |
|
|
|
return backInOut; |
|
})(overshoot); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/bounce.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-ease/src/bounce.js ***! |
|
\*********************************************/ |
|
/*! exports provided: bounceIn, bounceOut, bounceInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceIn", function() { return bounceIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceOut", function() { return bounceOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounceInOut", function() { return bounceInOut; }); |
|
var b1 = 4 / 11, |
|
b2 = 6 / 11, |
|
b3 = 8 / 11, |
|
b4 = 3 / 4, |
|
b5 = 9 / 11, |
|
b6 = 10 / 11, |
|
b7 = 15 / 16, |
|
b8 = 21 / 22, |
|
b9 = 63 / 64, |
|
b0 = 1 / b1 / b1; |
|
|
|
function bounceIn(t) { |
|
return 1 - bounceOut(1 - t); |
|
} |
|
|
|
function bounceOut(t) { |
|
return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9; |
|
} |
|
|
|
function bounceInOut(t) { |
|
return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/circle.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-ease/src/circle.js ***! |
|
\*********************************************/ |
|
/*! exports provided: circleIn, circleOut, circleInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleIn", function() { return circleIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleOut", function() { return circleOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleInOut", function() { return circleInOut; }); |
|
function circleIn(t) { |
|
return 1 - Math.sqrt(1 - t * t); |
|
} |
|
|
|
function circleOut(t) { |
|
return Math.sqrt(1 - --t * t); |
|
} |
|
|
|
function circleInOut(t) { |
|
return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/cubic.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-ease/src/cubic.js ***! |
|
\********************************************/ |
|
/*! exports provided: cubicIn, cubicOut, cubicInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicIn", function() { return cubicIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicOut", function() { return cubicOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubicInOut", function() { return cubicInOut; }); |
|
function cubicIn(t) { |
|
return t * t * t; |
|
} |
|
|
|
function cubicOut(t) { |
|
return --t * t * t + 1; |
|
} |
|
|
|
function cubicInOut(t) { |
|
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/elastic.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-ease/src/elastic.js ***! |
|
\**********************************************/ |
|
/*! exports provided: elasticIn, elasticOut, elasticInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticIn", function() { return elasticIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticOut", function() { return elasticOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elasticInOut", function() { return elasticInOut; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-ease/src/math.js"); |
|
|
|
|
|
var tau = 2 * Math.PI, |
|
amplitude = 1, |
|
period = 0.3; |
|
|
|
var elasticIn = (function custom(a, p) { |
|
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); |
|
|
|
function elasticIn(t) { |
|
return a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(-(--t)) * Math.sin((s - t) / p); |
|
} |
|
|
|
elasticIn.amplitude = function(a) { return custom(a, p * tau); }; |
|
elasticIn.period = function(p) { return custom(a, p); }; |
|
|
|
return elasticIn; |
|
})(amplitude, period); |
|
|
|
var elasticOut = (function custom(a, p) { |
|
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); |
|
|
|
function elasticOut(t) { |
|
return 1 - a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(t = +t) * Math.sin((t + s) / p); |
|
} |
|
|
|
elasticOut.amplitude = function(a) { return custom(a, p * tau); }; |
|
elasticOut.period = function(p) { return custom(a, p); }; |
|
|
|
return elasticOut; |
|
})(amplitude, period); |
|
|
|
var elasticInOut = (function custom(a, p) { |
|
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau); |
|
|
|
function elasticInOut(t) { |
|
return ((t = t * 2 - 1) < 0 |
|
? a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(-t) * Math.sin((s - t) / p) |
|
: 2 - a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(t) * Math.sin((s + t) / p)) / 2; |
|
} |
|
|
|
elasticInOut.amplitude = function(a) { return custom(a, p * tau); }; |
|
elasticInOut.period = function(p) { return custom(a, p); }; |
|
|
|
return elasticInOut; |
|
})(amplitude, period); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/exp.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3-ease/src/exp.js ***! |
|
\******************************************/ |
|
/*! exports provided: expIn, expOut, expInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expIn", function() { return expIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expOut", function() { return expOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expInOut", function() { return expInOut; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-ease/src/math.js"); |
|
|
|
|
|
function expIn(t) { |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(1 - +t); |
|
} |
|
|
|
function expOut(t) { |
|
return 1 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(t); |
|
} |
|
|
|
function expInOut(t) { |
|
return ((t *= 2) <= 1 ? Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(1 - t) : 2 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tpmt"])(t - 1)) / 2; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/index.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-ease/src/index.js ***! |
|
\********************************************/ |
|
/*! exports provided: easeLinear, easeQuad, easeQuadIn, easeQuadOut, easeQuadInOut, easeCubic, easeCubicIn, easeCubicOut, easeCubicInOut, easePoly, easePolyIn, easePolyOut, easePolyInOut, easeSin, easeSinIn, easeSinOut, easeSinInOut, easeExp, easeExpIn, easeExpOut, easeExpInOut, easeCircle, easeCircleIn, easeCircleOut, easeCircleInOut, easeBounce, easeBounceIn, easeBounceOut, easeBounceInOut, easeBack, easeBackIn, easeBackOut, easeBackInOut, easeElastic, easeElasticIn, easeElasticOut, easeElasticInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _linear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear.js */ "../node_modules/d3-ease/src/linear.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeLinear", function() { return _linear_js__WEBPACK_IMPORTED_MODULE_0__["linear"]; }); |
|
|
|
/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad.js */ "../node_modules/d3-ease/src/quad.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuad", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadIn", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadOut", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadInOut", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__["quadInOut"]; }); |
|
|
|
/* harmony import */ var _cubic_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubic.js */ "../node_modules/d3-ease/src/cubic.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubic", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicIn", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicOut", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicInOut", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__["cubicInOut"]; }); |
|
|
|
/* harmony import */ var _poly_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./poly.js */ "../node_modules/d3-ease/src/poly.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePoly", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyIn", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyOut", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyInOut", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__["polyInOut"]; }); |
|
|
|
/* harmony import */ var _sin_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sin.js */ "../node_modules/d3-ease/src/sin.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSin", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinIn", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinOut", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinInOut", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__["sinInOut"]; }); |
|
|
|
/* harmony import */ var _exp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exp.js */ "../node_modules/d3-ease/src/exp.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExp", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpIn", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpOut", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpInOut", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__["expInOut"]; }); |
|
|
|
/* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./circle.js */ "../node_modules/d3-ease/src/circle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircle", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleIn", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleOut", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleInOut", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__["circleInOut"]; }); |
|
|
|
/* harmony import */ var _bounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bounce.js */ "../node_modules/d3-ease/src/bounce.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounce", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceIn", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceOut", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceInOut", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__["bounceInOut"]; }); |
|
|
|
/* harmony import */ var _back_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./back.js */ "../node_modules/d3-ease/src/back.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBack", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackIn", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackOut", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackInOut", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__["backInOut"]; }); |
|
|
|
/* harmony import */ var _elastic_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elastic.js */ "../node_modules/d3-ease/src/elastic.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElastic", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticIn", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticOut", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticInOut", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__["elasticInOut"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/linear.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-ease/src/linear.js ***! |
|
\*********************************************/ |
|
/*! exports provided: linear */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linear", function() { return linear; }); |
|
function linear(t) { |
|
return +t; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/math.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-ease/src/math.js ***! |
|
\*******************************************/ |
|
/*! exports provided: tpmt */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tpmt", function() { return tpmt; }); |
|
// tpmt is two power minus ten times t scaled to [0,1] |
|
function tpmt(x) { |
|
return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/poly.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-ease/src/poly.js ***! |
|
\*******************************************/ |
|
/*! exports provided: polyIn, polyOut, polyInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyIn", function() { return polyIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyOut", function() { return polyOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyInOut", function() { return polyInOut; }); |
|
var exponent = 3; |
|
|
|
var polyIn = (function custom(e) { |
|
e = +e; |
|
|
|
function polyIn(t) { |
|
return Math.pow(t, e); |
|
} |
|
|
|
polyIn.exponent = custom; |
|
|
|
return polyIn; |
|
})(exponent); |
|
|
|
var polyOut = (function custom(e) { |
|
e = +e; |
|
|
|
function polyOut(t) { |
|
return 1 - Math.pow(1 - t, e); |
|
} |
|
|
|
polyOut.exponent = custom; |
|
|
|
return polyOut; |
|
})(exponent); |
|
|
|
var polyInOut = (function custom(e) { |
|
e = +e; |
|
|
|
function polyInOut(t) { |
|
return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2; |
|
} |
|
|
|
polyInOut.exponent = custom; |
|
|
|
return polyInOut; |
|
})(exponent); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/quad.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-ease/src/quad.js ***! |
|
\*******************************************/ |
|
/*! exports provided: quadIn, quadOut, quadInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadIn", function() { return quadIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadOut", function() { return quadOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quadInOut", function() { return quadInOut; }); |
|
function quadIn(t) { |
|
return t * t; |
|
} |
|
|
|
function quadOut(t) { |
|
return t * (2 - t); |
|
} |
|
|
|
function quadInOut(t) { |
|
return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-ease/src/sin.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3-ease/src/sin.js ***! |
|
\******************************************/ |
|
/*! exports provided: sinIn, sinOut, sinInOut */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinIn", function() { return sinIn; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinOut", function() { return sinOut; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinInOut", function() { return sinInOut; }); |
|
var pi = Math.PI, |
|
halfPi = pi / 2; |
|
|
|
function sinIn(t) { |
|
return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi); |
|
} |
|
|
|
function sinOut(t) { |
|
return Math.sin(t * halfPi); |
|
} |
|
|
|
function sinInOut(t) { |
|
return (1 - Math.cos(pi * t)) / 2; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/blob.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/blob.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function responseBlob(response) { |
|
if (!response.ok) throw new Error(response.status + " " + response.statusText); |
|
return response.blob(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(input, init) { |
|
return fetch(input, init).then(responseBlob); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/buffer.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/buffer.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function responseArrayBuffer(response) { |
|
if (!response.ok) throw new Error(response.status + " " + response.statusText); |
|
return response.arrayBuffer(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(input, init) { |
|
return fetch(input, init).then(responseArrayBuffer); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/dsv.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/dsv.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default, csv, tsv */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return dsv; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "csv", function() { return csv; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tsv", function() { return tsv; }); |
|
/* harmony import */ var d3_dsv__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dsv */ "../node_modules/d3-dsv/src/index.js"); |
|
/* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text.js */ "../node_modules/d3-fetch/src/text.js"); |
|
|
|
|
|
|
|
function dsvParse(parse) { |
|
return function(input, init, row) { |
|
if (arguments.length === 2 && typeof init === "function") row = init, init = undefined; |
|
return Object(_text_js__WEBPACK_IMPORTED_MODULE_1__["default"])(input, init).then(function(response) { |
|
return parse(response, row); |
|
}); |
|
}; |
|
} |
|
|
|
function dsv(delimiter, input, init, row) { |
|
if (arguments.length === 3 && typeof init === "function") row = init, init = undefined; |
|
var format = Object(d3_dsv__WEBPACK_IMPORTED_MODULE_0__["dsvFormat"])(delimiter); |
|
return Object(_text_js__WEBPACK_IMPORTED_MODULE_1__["default"])(input, init).then(function(response) { |
|
return format.parse(response, row); |
|
}); |
|
} |
|
|
|
var csv = dsvParse(d3_dsv__WEBPACK_IMPORTED_MODULE_0__["csvParse"]); |
|
var tsv = dsvParse(d3_dsv__WEBPACK_IMPORTED_MODULE_0__["tsvParse"]); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/image.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/image.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(input, init) { |
|
return new Promise(function(resolve, reject) { |
|
var image = new Image; |
|
for (var key in init) image[key] = init[key]; |
|
image.onerror = reject; |
|
image.onload = function() { resolve(image); }; |
|
image.src = input; |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: blob, buffer, dsv, csv, tsv, image, json, text, xml, html, svg */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _blob_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blob.js */ "../node_modules/d3-fetch/src/blob.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blob", function() { return _blob_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buffer.js */ "../node_modules/d3-fetch/src/buffer.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _buffer_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _dsv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dsv.js */ "../node_modules/d3-fetch/src/dsv.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsv", function() { return _dsv_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csv", function() { return _dsv_js__WEBPACK_IMPORTED_MODULE_2__["csv"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsv", function() { return _dsv_js__WEBPACK_IMPORTED_MODULE_2__["tsv"]; }); |
|
|
|
/* harmony import */ var _image_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./image.js */ "../node_modules/d3-fetch/src/image.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "image", function() { return _image_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _json_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./json.js */ "../node_modules/d3-fetch/src/json.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "json", function() { return _json_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./text.js */ "../node_modules/d3-fetch/src/text.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "text", function() { return _text_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _xml_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./xml.js */ "../node_modules/d3-fetch/src/xml.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xml", function() { return _xml_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "html", function() { return _xml_js__WEBPACK_IMPORTED_MODULE_6__["html"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "svg", function() { return _xml_js__WEBPACK_IMPORTED_MODULE_6__["svg"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/json.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/json.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function responseJson(response) { |
|
if (!response.ok) throw new Error(response.status + " " + response.statusText); |
|
if (response.status === 204 || response.status === 205) return; |
|
return response.json(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(input, init) { |
|
return fetch(input, init).then(responseJson); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/text.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/text.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function responseText(response) { |
|
if (!response.ok) throw new Error(response.status + " " + response.statusText); |
|
return response.text(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(input, init) { |
|
return fetch(input, init).then(responseText); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-fetch/src/xml.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-fetch/src/xml.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default, html, svg */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "html", function() { return html; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "svg", function() { return svg; }); |
|
/* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text.js */ "../node_modules/d3-fetch/src/text.js"); |
|
|
|
|
|
function parser(type) { |
|
return function(input, init) { |
|
return Object(_text_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input, init).then(function(text) { |
|
return (new DOMParser).parseFromString(text, type); |
|
}); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (parser("application/xml")); |
|
|
|
var html = parser("text/html"); |
|
|
|
var svg = parser("image/svg+xml"); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/center.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-force/src/center.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x, y) { |
|
var nodes; |
|
|
|
if (x == null) x = 0; |
|
if (y == null) y = 0; |
|
|
|
function force() { |
|
var i, |
|
n = nodes.length, |
|
node, |
|
sx = 0, |
|
sy = 0; |
|
|
|
for (i = 0; i < n; ++i) { |
|
node = nodes[i], sx += node.x, sy += node.y; |
|
} |
|
|
|
for (sx = sx / n - x, sy = sy / n - y, i = 0; i < n; ++i) { |
|
node = nodes[i], node.x -= sx, node.y -= sy; |
|
} |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _; |
|
}; |
|
|
|
force.x = function(_) { |
|
return arguments.length ? (x = +_, force) : x; |
|
}; |
|
|
|
force.y = function(_) { |
|
return arguments.length ? (y = +_, force) : y; |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/collide.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-force/src/collide.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-force/src/constant.js"); |
|
/* harmony import */ var _jiggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jiggle */ "../node_modules/d3-force/src/jiggle.js"); |
|
/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-quadtree */ "../node_modules/d3-quadtree/src/index.js"); |
|
|
|
|
|
|
|
|
|
function x(d) { |
|
return d.x + d.vx; |
|
} |
|
|
|
function y(d) { |
|
return d.y + d.vy; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(radius) { |
|
var nodes, |
|
radii, |
|
strength = 1, |
|
iterations = 1; |
|
|
|
if (typeof radius !== "function") radius = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(radius == null ? 1 : +radius); |
|
|
|
function force() { |
|
var i, n = nodes.length, |
|
tree, |
|
node, |
|
xi, |
|
yi, |
|
ri, |
|
ri2; |
|
|
|
for (var k = 0; k < iterations; ++k) { |
|
tree = Object(d3_quadtree__WEBPACK_IMPORTED_MODULE_2__["quadtree"])(nodes, x, y).visitAfter(prepare); |
|
for (i = 0; i < n; ++i) { |
|
node = nodes[i]; |
|
ri = radii[node.index], ri2 = ri * ri; |
|
xi = node.x + node.vx; |
|
yi = node.y + node.vy; |
|
tree.visit(apply); |
|
} |
|
} |
|
|
|
function apply(quad, x0, y0, x1, y1) { |
|
var data = quad.data, rj = quad.r, r = ri + rj; |
|
if (data) { |
|
if (data.index > node.index) { |
|
var x = xi - data.x - data.vx, |
|
y = yi - data.y - data.vy, |
|
l = x * x + y * y; |
|
if (l < r * r) { |
|
if (x === 0) x = Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(), l += x * x; |
|
if (y === 0) y = Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(), l += y * y; |
|
l = (r - (l = Math.sqrt(l))) / l * strength; |
|
node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj)); |
|
node.vy += (y *= l) * r; |
|
data.vx -= x * (r = 1 - r); |
|
data.vy -= y * r; |
|
} |
|
} |
|
return; |
|
} |
|
return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r; |
|
} |
|
} |
|
|
|
function prepare(quad) { |
|
if (quad.data) return quad.r = radii[quad.data.index]; |
|
for (var i = quad.r = 0; i < 4; ++i) { |
|
if (quad[i] && quad[i].r > quad.r) { |
|
quad.r = quad[i].r; |
|
} |
|
} |
|
} |
|
|
|
function initialize() { |
|
if (!nodes) return; |
|
var i, n = nodes.length, node; |
|
radii = new Array(n); |
|
for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes); |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _; |
|
initialize(); |
|
}; |
|
|
|
force.iterations = function(_) { |
|
return arguments.length ? (iterations = +_, force) : iterations; |
|
}; |
|
|
|
force.strength = function(_) { |
|
return arguments.length ? (strength = +_, force) : strength; |
|
}; |
|
|
|
force.radius = function(_) { |
|
return arguments.length ? (radius = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : radius; |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/constant.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-force/src/constant.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-force/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: forceCenter, forceCollide, forceLink, forceManyBody, forceRadial, forceSimulation, forceX, forceY */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _center__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./center */ "../node_modules/d3-force/src/center.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceCenter", function() { return _center__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _collide__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collide */ "../node_modules/d3-force/src/collide.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceCollide", function() { return _collide__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./link */ "../node_modules/d3-force/src/link.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLink", function() { return _link__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _manyBody__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./manyBody */ "../node_modules/d3-force/src/manyBody.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceManyBody", function() { return _manyBody__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _radial__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./radial */ "../node_modules/d3-force/src/radial.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceRadial", function() { return _radial__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _simulation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./simulation */ "../node_modules/d3-force/src/simulation.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceSimulation", function() { return _simulation__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _x__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./x */ "../node_modules/d3-force/src/x.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceX", function() { return _x__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _y__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./y */ "../node_modules/d3-force/src/y.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceY", function() { return _y__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/jiggle.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-force/src/jiggle.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return (Math.random() - 0.5) * 1e-6; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/link.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-force/src/link.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-force/src/constant.js"); |
|
/* harmony import */ var _jiggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jiggle */ "../node_modules/d3-force/src/jiggle.js"); |
|
/* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-collection */ "../node_modules/d3-collection/src/index.js"); |
|
|
|
|
|
|
|
|
|
function index(d) { |
|
return d.index; |
|
} |
|
|
|
function find(nodeById, nodeId) { |
|
var node = nodeById.get(nodeId); |
|
if (!node) throw new Error("missing: " + nodeId); |
|
return node; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(links) { |
|
var id = index, |
|
strength = defaultStrength, |
|
strengths, |
|
distance = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(30), |
|
distances, |
|
nodes, |
|
count, |
|
bias, |
|
iterations = 1; |
|
|
|
if (links == null) links = []; |
|
|
|
function defaultStrength(link) { |
|
return 1 / Math.min(count[link.source.index], count[link.target.index]); |
|
} |
|
|
|
function force(alpha) { |
|
for (var k = 0, n = links.length; k < iterations; ++k) { |
|
for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) { |
|
link = links[i], source = link.source, target = link.target; |
|
x = target.x + target.vx - source.x - source.vx || Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(); |
|
y = target.y + target.vy - source.y - source.vy || Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(); |
|
l = Math.sqrt(x * x + y * y); |
|
l = (l - distances[i]) / l * alpha * strengths[i]; |
|
x *= l, y *= l; |
|
target.vx -= x * (b = bias[i]); |
|
target.vy -= y * b; |
|
source.vx += x * (b = 1 - b); |
|
source.vy += y * b; |
|
} |
|
} |
|
} |
|
|
|
function initialize() { |
|
if (!nodes) return; |
|
|
|
var i, |
|
n = nodes.length, |
|
m = links.length, |
|
nodeById = Object(d3_collection__WEBPACK_IMPORTED_MODULE_2__["map"])(nodes, id), |
|
link; |
|
|
|
for (i = 0, count = new Array(n); i < m; ++i) { |
|
link = links[i], link.index = i; |
|
if (typeof link.source !== "object") link.source = find(nodeById, link.source); |
|
if (typeof link.target !== "object") link.target = find(nodeById, link.target); |
|
count[link.source.index] = (count[link.source.index] || 0) + 1; |
|
count[link.target.index] = (count[link.target.index] || 0) + 1; |
|
} |
|
|
|
for (i = 0, bias = new Array(m); i < m; ++i) { |
|
link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]); |
|
} |
|
|
|
strengths = new Array(m), initializeStrength(); |
|
distances = new Array(m), initializeDistance(); |
|
} |
|
|
|
function initializeStrength() { |
|
if (!nodes) return; |
|
|
|
for (var i = 0, n = links.length; i < n; ++i) { |
|
strengths[i] = +strength(links[i], i, links); |
|
} |
|
} |
|
|
|
function initializeDistance() { |
|
if (!nodes) return; |
|
|
|
for (var i = 0, n = links.length; i < n; ++i) { |
|
distances[i] = +distance(links[i], i, links); |
|
} |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _; |
|
initialize(); |
|
}; |
|
|
|
force.links = function(_) { |
|
return arguments.length ? (links = _, initialize(), force) : links; |
|
}; |
|
|
|
force.id = function(_) { |
|
return arguments.length ? (id = _, force) : id; |
|
}; |
|
|
|
force.iterations = function(_) { |
|
return arguments.length ? (iterations = +_, force) : iterations; |
|
}; |
|
|
|
force.strength = function(_) { |
|
return arguments.length ? (strength = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initializeStrength(), force) : strength; |
|
}; |
|
|
|
force.distance = function(_) { |
|
return arguments.length ? (distance = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initializeDistance(), force) : distance; |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/manyBody.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-force/src/manyBody.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-force/src/constant.js"); |
|
/* harmony import */ var _jiggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jiggle */ "../node_modules/d3-force/src/jiggle.js"); |
|
/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-quadtree */ "../node_modules/d3-quadtree/src/index.js"); |
|
/* harmony import */ var _simulation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simulation */ "../node_modules/d3-force/src/simulation.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var nodes, |
|
node, |
|
alpha, |
|
strength = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(-30), |
|
strengths, |
|
distanceMin2 = 1, |
|
distanceMax2 = Infinity, |
|
theta2 = 0.81; |
|
|
|
function force(_) { |
|
var i, n = nodes.length, tree = Object(d3_quadtree__WEBPACK_IMPORTED_MODULE_2__["quadtree"])(nodes, _simulation__WEBPACK_IMPORTED_MODULE_3__["x"], _simulation__WEBPACK_IMPORTED_MODULE_3__["y"]).visitAfter(accumulate); |
|
for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply); |
|
} |
|
|
|
function initialize() { |
|
if (!nodes) return; |
|
var i, n = nodes.length, node; |
|
strengths = new Array(n); |
|
for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes); |
|
} |
|
|
|
function accumulate(quad) { |
|
var strength = 0, q, c, weight = 0, x, y, i; |
|
|
|
// For internal nodes, accumulate forces from child quadrants. |
|
if (quad.length) { |
|
for (x = y = i = 0; i < 4; ++i) { |
|
if ((q = quad[i]) && (c = Math.abs(q.value))) { |
|
strength += q.value, weight += c, x += c * q.x, y += c * q.y; |
|
} |
|
} |
|
quad.x = x / weight; |
|
quad.y = y / weight; |
|
} |
|
|
|
// For leaf nodes, accumulate forces from coincident quadrants. |
|
else { |
|
q = quad; |
|
q.x = q.data.x; |
|
q.y = q.data.y; |
|
do strength += strengths[q.data.index]; |
|
while (q = q.next); |
|
} |
|
|
|
quad.value = strength; |
|
} |
|
|
|
function apply(quad, x1, _, x2) { |
|
if (!quad.value) return true; |
|
|
|
var x = quad.x - node.x, |
|
y = quad.y - node.y, |
|
w = x2 - x1, |
|
l = x * x + y * y; |
|
|
|
// Apply the Barnes-Hut approximation if possible. |
|
// Limit forces for very close nodes; randomize direction if coincident. |
|
if (w * w / theta2 < l) { |
|
if (l < distanceMax2) { |
|
if (x === 0) x = Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(), l += x * x; |
|
if (y === 0) y = Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(), l += y * y; |
|
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l); |
|
node.vx += x * quad.value * alpha / l; |
|
node.vy += y * quad.value * alpha / l; |
|
} |
|
return true; |
|
} |
|
|
|
// Otherwise, process points directly. |
|
else if (quad.length || l >= distanceMax2) return; |
|
|
|
// Limit forces for very close nodes; randomize direction if coincident. |
|
if (quad.data !== node || quad.next) { |
|
if (x === 0) x = Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(), l += x * x; |
|
if (y === 0) y = Object(_jiggle__WEBPACK_IMPORTED_MODULE_1__["default"])(), l += y * y; |
|
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l); |
|
} |
|
|
|
do if (quad.data !== node) { |
|
w = strengths[quad.data.index] * alpha / l; |
|
node.vx += x * w; |
|
node.vy += y * w; |
|
} while (quad = quad.next); |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _; |
|
initialize(); |
|
}; |
|
|
|
force.strength = function(_) { |
|
return arguments.length ? (strength = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : strength; |
|
}; |
|
|
|
force.distanceMin = function(_) { |
|
return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2); |
|
}; |
|
|
|
force.distanceMax = function(_) { |
|
return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2); |
|
}; |
|
|
|
force.theta = function(_) { |
|
return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2); |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/radial.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-force/src/radial.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-force/src/constant.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(radius, x, y) { |
|
var nodes, |
|
strength = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(0.1), |
|
strengths, |
|
radiuses; |
|
|
|
if (typeof radius !== "function") radius = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+radius); |
|
if (x == null) x = 0; |
|
if (y == null) y = 0; |
|
|
|
function force(alpha) { |
|
for (var i = 0, n = nodes.length; i < n; ++i) { |
|
var node = nodes[i], |
|
dx = node.x - x || 1e-6, |
|
dy = node.y - y || 1e-6, |
|
r = Math.sqrt(dx * dx + dy * dy), |
|
k = (radiuses[i] - r) * strengths[i] * alpha / r; |
|
node.vx += dx * k; |
|
node.vy += dy * k; |
|
} |
|
} |
|
|
|
function initialize() { |
|
if (!nodes) return; |
|
var i, n = nodes.length; |
|
strengths = new Array(n); |
|
radiuses = new Array(n); |
|
for (i = 0; i < n; ++i) { |
|
radiuses[i] = +radius(nodes[i], i, nodes); |
|
strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes); |
|
} |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _, initialize(); |
|
}; |
|
|
|
force.strength = function(_) { |
|
return arguments.length ? (strength = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : strength; |
|
}; |
|
|
|
force.radius = function(_) { |
|
return arguments.length ? (radius = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : radius; |
|
}; |
|
|
|
force.x = function(_) { |
|
return arguments.length ? (x = +_, force) : x; |
|
}; |
|
|
|
force.y = function(_) { |
|
return arguments.length ? (y = +_, force) : y; |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/simulation.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-force/src/simulation.js ***! |
|
\**************************************************/ |
|
/*! exports provided: x, y, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return x; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return y; }); |
|
/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ "../node_modules/d3-dispatch/src/index.js"); |
|
/* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-collection */ "../node_modules/d3-collection/src/index.js"); |
|
/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-timer */ "../node_modules/d3-timer/src/index.js"); |
|
|
|
|
|
|
|
|
|
function x(d) { |
|
return d.x; |
|
} |
|
|
|
function y(d) { |
|
return d.y; |
|
} |
|
|
|
var initialRadius = 10, |
|
initialAngle = Math.PI * (3 - Math.sqrt(5)); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(nodes) { |
|
var simulation, |
|
alpha = 1, |
|
alphaMin = 0.001, |
|
alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), |
|
alphaTarget = 0, |
|
velocityDecay = 0.6, |
|
forces = Object(d3_collection__WEBPACK_IMPORTED_MODULE_1__["map"])(), |
|
stepper = Object(d3_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(step), |
|
event = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__["dispatch"])("tick", "end"); |
|
|
|
if (nodes == null) nodes = []; |
|
|
|
function step() { |
|
tick(); |
|
event.call("tick", simulation); |
|
if (alpha < alphaMin) { |
|
stepper.stop(); |
|
event.call("end", simulation); |
|
} |
|
} |
|
|
|
function tick(iterations) { |
|
var i, n = nodes.length, node; |
|
|
|
if (iterations === undefined) iterations = 1; |
|
|
|
for (var k = 0; k < iterations; ++k) { |
|
alpha += (alphaTarget - alpha) * alphaDecay; |
|
|
|
forces.each(function (force) { |
|
force(alpha); |
|
}); |
|
|
|
for (i = 0; i < n; ++i) { |
|
node = nodes[i]; |
|
if (node.fx == null) node.x += node.vx *= velocityDecay; |
|
else node.x = node.fx, node.vx = 0; |
|
if (node.fy == null) node.y += node.vy *= velocityDecay; |
|
else node.y = node.fy, node.vy = 0; |
|
} |
|
} |
|
|
|
return simulation; |
|
} |
|
|
|
function initializeNodes() { |
|
for (var i = 0, n = nodes.length, node; i < n; ++i) { |
|
node = nodes[i], node.index = i; |
|
if (node.fx != null) node.x = node.fx; |
|
if (node.fy != null) node.y = node.fy; |
|
if (isNaN(node.x) || isNaN(node.y)) { |
|
var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle; |
|
node.x = radius * Math.cos(angle); |
|
node.y = radius * Math.sin(angle); |
|
} |
|
if (isNaN(node.vx) || isNaN(node.vy)) { |
|
node.vx = node.vy = 0; |
|
} |
|
} |
|
} |
|
|
|
function initializeForce(force) { |
|
if (force.initialize) force.initialize(nodes); |
|
return force; |
|
} |
|
|
|
initializeNodes(); |
|
|
|
return simulation = { |
|
tick: tick, |
|
|
|
restart: function() { |
|
return stepper.restart(step), simulation; |
|
}, |
|
|
|
stop: function() { |
|
return stepper.stop(), simulation; |
|
}, |
|
|
|
nodes: function(_) { |
|
return arguments.length ? (nodes = _, initializeNodes(), forces.each(initializeForce), simulation) : nodes; |
|
}, |
|
|
|
alpha: function(_) { |
|
return arguments.length ? (alpha = +_, simulation) : alpha; |
|
}, |
|
|
|
alphaMin: function(_) { |
|
return arguments.length ? (alphaMin = +_, simulation) : alphaMin; |
|
}, |
|
|
|
alphaDecay: function(_) { |
|
return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay; |
|
}, |
|
|
|
alphaTarget: function(_) { |
|
return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget; |
|
}, |
|
|
|
velocityDecay: function(_) { |
|
return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay; |
|
}, |
|
|
|
force: function(name, _) { |
|
return arguments.length > 1 ? ((_ == null ? forces.remove(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name); |
|
}, |
|
|
|
find: function(x, y, radius) { |
|
var i = 0, |
|
n = nodes.length, |
|
dx, |
|
dy, |
|
d2, |
|
node, |
|
closest; |
|
|
|
if (radius == null) radius = Infinity; |
|
else radius *= radius; |
|
|
|
for (i = 0; i < n; ++i) { |
|
node = nodes[i]; |
|
dx = x - node.x; |
|
dy = y - node.y; |
|
d2 = dx * dx + dy * dy; |
|
if (d2 < radius) closest = node, radius = d2; |
|
} |
|
|
|
return closest; |
|
}, |
|
|
|
on: function(name, _) { |
|
return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name); |
|
} |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/x.js": |
|
/*!*****************************************!*\ |
|
!*** ../node_modules/d3-force/src/x.js ***! |
|
\*****************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-force/src/constant.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
var strength = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(0.1), |
|
nodes, |
|
strengths, |
|
xz; |
|
|
|
if (typeof x !== "function") x = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(x == null ? 0 : +x); |
|
|
|
function force(alpha) { |
|
for (var i = 0, n = nodes.length, node; i < n; ++i) { |
|
node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha; |
|
} |
|
} |
|
|
|
function initialize() { |
|
if (!nodes) return; |
|
var i, n = nodes.length; |
|
strengths = new Array(n); |
|
xz = new Array(n); |
|
for (i = 0; i < n; ++i) { |
|
strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes); |
|
} |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _; |
|
initialize(); |
|
}; |
|
|
|
force.strength = function(_) { |
|
return arguments.length ? (strength = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : strength; |
|
}; |
|
|
|
force.x = function(_) { |
|
return arguments.length ? (x = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : x; |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-force/src/y.js": |
|
/*!*****************************************!*\ |
|
!*** ../node_modules/d3-force/src/y.js ***! |
|
\*****************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-force/src/constant.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(y) { |
|
var strength = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(0.1), |
|
nodes, |
|
strengths, |
|
yz; |
|
|
|
if (typeof y !== "function") y = Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(y == null ? 0 : +y); |
|
|
|
function force(alpha) { |
|
for (var i = 0, n = nodes.length, node; i < n; ++i) { |
|
node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha; |
|
} |
|
} |
|
|
|
function initialize() { |
|
if (!nodes) return; |
|
var i, n = nodes.length; |
|
strengths = new Array(n); |
|
yz = new Array(n); |
|
for (i = 0; i < n; ++i) { |
|
strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes); |
|
} |
|
} |
|
|
|
force.initialize = function(_) { |
|
nodes = _; |
|
initialize(); |
|
}; |
|
|
|
force.strength = function(_) { |
|
return arguments.length ? (strength = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : strength; |
|
}; |
|
|
|
force.y = function(_) { |
|
return arguments.length ? (y = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), initialize(), force) : y; |
|
}; |
|
|
|
return force; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/defaultLocale.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-format/src/defaultLocale.js ***! |
|
\******************************************************/ |
|
/*! exports provided: format, formatPrefix, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatPrefix", function() { return formatPrefix; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return defaultLocale; }); |
|
/* harmony import */ var _locale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./locale.js */ "../node_modules/d3-format/src/locale.js"); |
|
|
|
|
|
var locale; |
|
var format; |
|
var formatPrefix; |
|
|
|
defaultLocale({ |
|
decimal: ".", |
|
thousands: ",", |
|
grouping: [3], |
|
currency: ["$", ""], |
|
minus: "-" |
|
}); |
|
|
|
function defaultLocale(definition) { |
|
locale = Object(_locale_js__WEBPACK_IMPORTED_MODULE_0__["default"])(definition); |
|
format = locale.format; |
|
formatPrefix = locale.formatPrefix; |
|
return locale; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/exponent.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-format/src/exponent.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formatDecimal.js */ "../node_modules/d3-format/src/formatDecimal.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return x = Object(_formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__["formatDecimalParts"])(Math.abs(x)), x ? x[1] : NaN; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatDecimal.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatDecimal.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default, formatDecimalParts */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDecimalParts", function() { return formatDecimalParts; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return Math.abs(x = Math.round(x)) >= 1e21 |
|
? x.toLocaleString("en").replace(/,/g, "") |
|
: x.toString(10); |
|
}); |
|
|
|
// Computes the decimal coefficient and exponent of the specified number x with |
|
// significant digits p, where x is positive and p is in [1, 21] or undefined. |
|
// For example, formatDecimalParts(1.23) returns ["123", 0]. |
|
function formatDecimalParts(x, p) { |
|
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity |
|
var i, coefficient = x.slice(0, i); |
|
|
|
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+ |
|
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). |
|
return [ |
|
coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, |
|
+x.slice(i + 1) |
|
]; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatGroup.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatGroup.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(grouping, thousands) { |
|
return function(value, width) { |
|
var i = value.length, |
|
t = [], |
|
j = 0, |
|
g = grouping[0], |
|
length = 0; |
|
|
|
while (i > 0 && g > 0) { |
|
if (length + g + 1 > width) g = Math.max(1, width - length); |
|
t.push(value.substring(i -= g, i + g)); |
|
if ((length += g + 1) > width) break; |
|
g = grouping[j = (j + 1) % grouping.length]; |
|
} |
|
|
|
return t.reverse().join(thousands); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatNumerals.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatNumerals.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(numerals) { |
|
return function(value) { |
|
return value.replace(/[0-9]/g, function(i) { |
|
return numerals[+i]; |
|
}); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatPrefixAuto.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatPrefixAuto.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: prefixExponent, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prefixExponent", function() { return prefixExponent; }); |
|
/* harmony import */ var _formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formatDecimal.js */ "../node_modules/d3-format/src/formatDecimal.js"); |
|
|
|
|
|
var prefixExponent; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(x, p) { |
|
var d = Object(_formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__["formatDecimalParts"])(x, p); |
|
if (!d) return x + ""; |
|
var coefficient = d[0], |
|
exponent = d[1], |
|
i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, |
|
n = coefficient.length; |
|
return i === n ? coefficient |
|
: i > n ? coefficient + new Array(i - n + 1).join("0") |
|
: i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) |
|
: "0." + new Array(1 - i).join("0") + Object(_formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__["formatDecimalParts"])(x, Math.max(0, p + i - 1))[0]; // less than 1y! |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatRounded.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatRounded.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formatDecimal.js */ "../node_modules/d3-format/src/formatDecimal.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(x, p) { |
|
var d = Object(_formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__["formatDecimalParts"])(x, p); |
|
if (!d) return x + ""; |
|
var coefficient = d[0], |
|
exponent = d[1]; |
|
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient |
|
: coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) |
|
: coefficient + new Array(exponent - coefficient.length + 2).join("0"); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatSpecifier.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatSpecifier.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default, FormatSpecifier */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatSpecifier; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormatSpecifier", function() { return FormatSpecifier; }); |
|
// [[fill]align][sign][symbol][0][width][,][.precision][~][type] |
|
var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; |
|
|
|
function formatSpecifier(specifier) { |
|
if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); |
|
var match; |
|
return new FormatSpecifier({ |
|
fill: match[1], |
|
align: match[2], |
|
sign: match[3], |
|
symbol: match[4], |
|
zero: match[5], |
|
width: match[6], |
|
comma: match[7], |
|
precision: match[8] && match[8].slice(1), |
|
trim: match[9], |
|
type: match[10] |
|
}); |
|
} |
|
|
|
formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof |
|
|
|
function FormatSpecifier(specifier) { |
|
this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; |
|
this.align = specifier.align === undefined ? ">" : specifier.align + ""; |
|
this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; |
|
this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; |
|
this.zero = !!specifier.zero; |
|
this.width = specifier.width === undefined ? undefined : +specifier.width; |
|
this.comma = !!specifier.comma; |
|
this.precision = specifier.precision === undefined ? undefined : +specifier.precision; |
|
this.trim = !!specifier.trim; |
|
this.type = specifier.type === undefined ? "" : specifier.type + ""; |
|
} |
|
|
|
FormatSpecifier.prototype.toString = function() { |
|
return this.fill |
|
+ this.align |
|
+ this.sign |
|
+ this.symbol |
|
+ (this.zero ? "0" : "") |
|
+ (this.width === undefined ? "" : Math.max(1, this.width | 0)) |
|
+ (this.comma ? "," : "") |
|
+ (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) |
|
+ (this.trim ? "~" : "") |
|
+ this.type; |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatTrim.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatTrim.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. |
|
/* harmony default export */ __webpack_exports__["default"] = (function(s) { |
|
out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { |
|
switch (s[i]) { |
|
case ".": i0 = i1 = i; break; |
|
case "0": if (i0 === 0) i0 = i; i1 = i; break; |
|
default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; |
|
} |
|
} |
|
return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/formatTypes.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-format/src/formatTypes.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formatDecimal.js */ "../node_modules/d3-format/src/formatDecimal.js"); |
|
/* harmony import */ var _formatPrefixAuto_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./formatPrefixAuto.js */ "../node_modules/d3-format/src/formatPrefixAuto.js"); |
|
/* harmony import */ var _formatRounded_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./formatRounded.js */ "../node_modules/d3-format/src/formatRounded.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
"%": function(x, p) { return (x * 100).toFixed(p); }, |
|
"b": function(x) { return Math.round(x).toString(2); }, |
|
"c": function(x) { return x + ""; }, |
|
"d": _formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
"e": function(x, p) { return x.toExponential(p); }, |
|
"f": function(x, p) { return x.toFixed(p); }, |
|
"g": function(x, p) { return x.toPrecision(p); }, |
|
"o": function(x) { return Math.round(x).toString(8); }, |
|
"p": function(x, p) { return Object(_formatRounded_js__WEBPACK_IMPORTED_MODULE_2__["default"])(x * 100, p); }, |
|
"r": _formatRounded_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
"s": _formatPrefixAuto_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
"X": function(x) { return Math.round(x).toString(16).toUpperCase(); }, |
|
"x": function(x) { return Math.round(x).toString(16); } |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/identity.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-format/src/identity.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/index.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-format/src/index.js ***! |
|
\**********************************************/ |
|
/*! exports provided: formatDefaultLocale, format, formatPrefix, formatLocale, formatSpecifier, FormatSpecifier, precisionFixed, precisionPrefix, precisionRound */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultLocale.js */ "../node_modules/d3-format/src/defaultLocale.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatDefaultLocale", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "format", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["format"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatPrefix", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["formatPrefix"]; }); |
|
|
|
/* harmony import */ var _locale_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./locale.js */ "../node_modules/d3-format/src/locale.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatLocale", function() { return _locale_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _formatSpecifier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./formatSpecifier.js */ "../node_modules/d3-format/src/formatSpecifier.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatSpecifier", function() { return _formatSpecifier_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormatSpecifier", function() { return _formatSpecifier_js__WEBPACK_IMPORTED_MODULE_2__["FormatSpecifier"]; }); |
|
|
|
/* harmony import */ var _precisionFixed_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./precisionFixed.js */ "../node_modules/d3-format/src/precisionFixed.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "precisionFixed", function() { return _precisionFixed_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _precisionPrefix_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./precisionPrefix.js */ "../node_modules/d3-format/src/precisionPrefix.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "precisionPrefix", function() { return _precisionPrefix_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _precisionRound_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./precisionRound.js */ "../node_modules/d3-format/src/precisionRound.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "precisionRound", function() { return _precisionRound_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/locale.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-format/src/locale.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _exponent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./exponent.js */ "../node_modules/d3-format/src/exponent.js"); |
|
/* harmony import */ var _formatGroup_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./formatGroup.js */ "../node_modules/d3-format/src/formatGroup.js"); |
|
/* harmony import */ var _formatNumerals_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./formatNumerals.js */ "../node_modules/d3-format/src/formatNumerals.js"); |
|
/* harmony import */ var _formatSpecifier_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./formatSpecifier.js */ "../node_modules/d3-format/src/formatSpecifier.js"); |
|
/* harmony import */ var _formatTrim_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./formatTrim.js */ "../node_modules/d3-format/src/formatTrim.js"); |
|
/* harmony import */ var _formatTypes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./formatTypes.js */ "../node_modules/d3-format/src/formatTypes.js"); |
|
/* harmony import */ var _formatPrefixAuto_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./formatPrefixAuto.js */ "../node_modules/d3-format/src/formatPrefixAuto.js"); |
|
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./identity.js */ "../node_modules/d3-format/src/identity.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var map = Array.prototype.map, |
|
prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(locale) { |
|
var group = locale.grouping === undefined || locale.thousands === undefined ? _identity_js__WEBPACK_IMPORTED_MODULE_7__["default"] : Object(_formatGroup_js__WEBPACK_IMPORTED_MODULE_1__["default"])(map.call(locale.grouping, Number), locale.thousands + ""), |
|
currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", |
|
currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", |
|
decimal = locale.decimal === undefined ? "." : locale.decimal + "", |
|
numerals = locale.numerals === undefined ? _identity_js__WEBPACK_IMPORTED_MODULE_7__["default"] : Object(_formatNumerals_js__WEBPACK_IMPORTED_MODULE_2__["default"])(map.call(locale.numerals, String)), |
|
percent = locale.percent === undefined ? "%" : locale.percent + "", |
|
minus = locale.minus === undefined ? "-" : locale.minus + "", |
|
nan = locale.nan === undefined ? "NaN" : locale.nan + ""; |
|
|
|
function newFormat(specifier) { |
|
specifier = Object(_formatSpecifier_js__WEBPACK_IMPORTED_MODULE_3__["default"])(specifier); |
|
|
|
var fill = specifier.fill, |
|
align = specifier.align, |
|
sign = specifier.sign, |
|
symbol = specifier.symbol, |
|
zero = specifier.zero, |
|
width = specifier.width, |
|
comma = specifier.comma, |
|
precision = specifier.precision, |
|
trim = specifier.trim, |
|
type = specifier.type; |
|
|
|
// The "n" type is an alias for ",g". |
|
if (type === "n") comma = true, type = "g"; |
|
|
|
// The "" type, and any invalid type, is an alias for ".12~g". |
|
else if (!_formatTypes_js__WEBPACK_IMPORTED_MODULE_5__["default"][type]) precision === undefined && (precision = 12), trim = true, type = "g"; |
|
|
|
// If zero fill is specified, padding goes after sign and before digits. |
|
if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; |
|
|
|
// Compute the prefix and suffix. |
|
// For SI-prefix, the suffix is lazily computed. |
|
var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", |
|
suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; |
|
|
|
// What format function should we use? |
|
// Is this an integer type? |
|
// Can this type generate exponential notation? |
|
var formatType = _formatTypes_js__WEBPACK_IMPORTED_MODULE_5__["default"][type], |
|
maybeSuffix = /[defgprs%]/.test(type); |
|
|
|
// Set the default precision if not specified, |
|
// or clamp the specified precision to the supported range. |
|
// For significant precision, it must be in [1, 21]. |
|
// For fixed precision, it must be in [0, 20]. |
|
precision = precision === undefined ? 6 |
|
: /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) |
|
: Math.max(0, Math.min(20, precision)); |
|
|
|
function format(value) { |
|
var valuePrefix = prefix, |
|
valueSuffix = suffix, |
|
i, n, c; |
|
|
|
if (type === "c") { |
|
valueSuffix = formatType(value) + valueSuffix; |
|
value = ""; |
|
} else { |
|
value = +value; |
|
|
|
// Determine the sign. -0 is not less than 0, but 1 / -0 is! |
|
var valueNegative = value < 0 || 1 / value < 0; |
|
|
|
// Perform the initial formatting. |
|
value = isNaN(value) ? nan : formatType(Math.abs(value), precision); |
|
|
|
// Trim insignificant zeros. |
|
if (trim) value = Object(_formatTrim_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value); |
|
|
|
// If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. |
|
if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; |
|
|
|
// Compute the prefix and suffix. |
|
valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; |
|
valueSuffix = (type === "s" ? prefixes[8 + _formatPrefixAuto_js__WEBPACK_IMPORTED_MODULE_6__["prefixExponent"] / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); |
|
|
|
// Break the formatted value into the integer “value” part that can be |
|
// grouped, and fractional or exponential “suffix” part that is not. |
|
if (maybeSuffix) { |
|
i = -1, n = value.length; |
|
while (++i < n) { |
|
if (c = value.charCodeAt(i), 48 > c || c > 57) { |
|
valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; |
|
value = value.slice(0, i); |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
|
|
// If the fill character is not "0", grouping is applied before padding. |
|
if (comma && !zero) value = group(value, Infinity); |
|
|
|
// Compute the padding. |
|
var length = valuePrefix.length + value.length + valueSuffix.length, |
|
padding = length < width ? new Array(width - length + 1).join(fill) : ""; |
|
|
|
// If the fill character is "0", grouping is applied after padding. |
|
if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; |
|
|
|
// Reconstruct the final output based on the desired alignment. |
|
switch (align) { |
|
case "<": value = valuePrefix + value + valueSuffix + padding; break; |
|
case "=": value = valuePrefix + padding + value + valueSuffix; break; |
|
case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; |
|
default: value = padding + valuePrefix + value + valueSuffix; break; |
|
} |
|
|
|
return numerals(value); |
|
} |
|
|
|
format.toString = function() { |
|
return specifier + ""; |
|
}; |
|
|
|
return format; |
|
} |
|
|
|
function formatPrefix(specifier, value) { |
|
var f = newFormat((specifier = Object(_formatSpecifier_js__WEBPACK_IMPORTED_MODULE_3__["default"])(specifier), specifier.type = "f", specifier)), |
|
e = Math.max(-8, Math.min(8, Math.floor(Object(_exponent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) / 3))) * 3, |
|
k = Math.pow(10, -e), |
|
prefix = prefixes[8 + e / 3]; |
|
return function(value) { |
|
return f(k * value) + prefix; |
|
}; |
|
} |
|
|
|
return { |
|
format: newFormat, |
|
formatPrefix: formatPrefix |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/precisionFixed.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-format/src/precisionFixed.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _exponent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./exponent.js */ "../node_modules/d3-format/src/exponent.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(step) { |
|
return Math.max(0, -Object(_exponent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Math.abs(step))); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/precisionPrefix.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-format/src/precisionPrefix.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _exponent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./exponent.js */ "../node_modules/d3-format/src/exponent.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(step, value) { |
|
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(Object(_exponent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) / 3))) * 3 - Object(_exponent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Math.abs(step))); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-format/src/precisionRound.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-format/src/precisionRound.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _exponent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./exponent.js */ "../node_modules/d3-format/src/exponent.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(step, max) { |
|
step = Math.abs(step), max = Math.abs(max) - step; |
|
return Math.max(0, Object(_exponent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(max) - Object(_exponent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(step)) + 1; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/adder.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-geo/src/adder.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
// Adds floating point numbers with twice the normal precision. |
|
// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and |
|
// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3) |
|
// 305–363 (1997). |
|
// Code adapted from GeographicLib by Charles F. F. Karney, |
|
// http://geographiclib.sourceforge.net/ |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return new Adder; |
|
}); |
|
|
|
function Adder() { |
|
this.reset(); |
|
} |
|
|
|
Adder.prototype = { |
|
constructor: Adder, |
|
reset: function() { |
|
this.s = // rounded value |
|
this.t = 0; // exact error |
|
}, |
|
add: function(y) { |
|
add(temp, y, this.t); |
|
add(this, temp.s, this.s); |
|
if (this.s) this.t += temp.t; |
|
else this.s = temp.t; |
|
}, |
|
valueOf: function() { |
|
return this.s; |
|
} |
|
}; |
|
|
|
var temp = new Adder; |
|
|
|
function add(adder, a, b) { |
|
var x = adder.s = a + b, |
|
bv = x - a, |
|
av = x - bv; |
|
adder.t = (a - av) + (b - bv); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/area.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3-geo/src/area.js ***! |
|
\******************************************/ |
|
/*! exports provided: areaRingSum, areaStream, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areaRingSum", function() { return areaRingSum; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areaStream", function() { return areaStream; }); |
|
/* harmony import */ var _adder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adder.js */ "../node_modules/d3-geo/src/adder.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
|
|
|
|
|
|
|
|
|
|
var areaRingSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(); |
|
|
|
var areaSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
lambda00, |
|
phi00, |
|
lambda0, |
|
cosPhi0, |
|
sinPhi0; |
|
|
|
var areaStream = { |
|
point: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
lineStart: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
lineEnd: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
polygonStart: function() { |
|
areaRingSum.reset(); |
|
areaStream.lineStart = areaRingStart; |
|
areaStream.lineEnd = areaRingEnd; |
|
}, |
|
polygonEnd: function() { |
|
var areaRing = +areaRingSum; |
|
areaSum.add(areaRing < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_1__["tau"] + areaRing : areaRing); |
|
this.lineStart = this.lineEnd = this.point = _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
|
}, |
|
sphere: function() { |
|
areaSum.add(_math_js__WEBPACK_IMPORTED_MODULE_1__["tau"]); |
|
} |
|
}; |
|
|
|
function areaRingStart() { |
|
areaStream.point = areaPointFirst; |
|
} |
|
|
|
function areaRingEnd() { |
|
areaPoint(lambda00, phi00); |
|
} |
|
|
|
function areaPointFirst(lambda, phi) { |
|
areaStream.point = areaPoint; |
|
lambda00 = lambda, phi00 = phi; |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]; |
|
lambda0 = lambda, cosPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi = phi / 2 + _math_js__WEBPACK_IMPORTED_MODULE_1__["quarterPi"]), sinPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi); |
|
} |
|
|
|
function areaPoint(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]; |
|
phi = phi / 2 + _math_js__WEBPACK_IMPORTED_MODULE_1__["quarterPi"]; // half the angular distance from south pole |
|
|
|
// Spherical excess E for a spherical triangle with vertices: south pole, |
|
// previous point, current point. Uses a formula derived from Cagnoli’s |
|
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2). |
|
var dLambda = lambda - lambda0, |
|
sdLambda = dLambda >= 0 ? 1 : -1, |
|
adLambda = sdLambda * dLambda, |
|
cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi), |
|
sinPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi), |
|
k = sinPhi0 * sinPhi, |
|
u = cosPhi0 * cosPhi + k * Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(adLambda), |
|
v = k * sdLambda * Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(adLambda); |
|
areaRingSum.add(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["atan2"])(v, u)); |
|
|
|
// Advance the previous points. |
|
lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(object) { |
|
areaSum.reset(); |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, areaStream); |
|
return areaSum * 2; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/bounds.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/bounds.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _adder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adder.js */ "../node_modules/d3-geo/src/adder.js"); |
|
/* harmony import */ var _area_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./area.js */ "../node_modules/d3-geo/src/area.js"); |
|
/* harmony import */ var _cartesian_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cartesian.js */ "../node_modules/d3-geo/src/cartesian.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
var lambda0, phi0, lambda1, phi1, // bounds |
|
lambda2, // previous lambda-coordinate |
|
lambda00, phi00, // first point |
|
p0, // previous 3D point |
|
deltaSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
ranges, |
|
range; |
|
|
|
var boundsStream = { |
|
point: boundsPoint, |
|
lineStart: boundsLineStart, |
|
lineEnd: boundsLineEnd, |
|
polygonStart: function() { |
|
boundsStream.point = boundsRingPoint; |
|
boundsStream.lineStart = boundsRingStart; |
|
boundsStream.lineEnd = boundsRingEnd; |
|
deltaSum.reset(); |
|
_area_js__WEBPACK_IMPORTED_MODULE_1__["areaStream"].polygonStart(); |
|
}, |
|
polygonEnd: function() { |
|
_area_js__WEBPACK_IMPORTED_MODULE_1__["areaStream"].polygonEnd(); |
|
boundsStream.point = boundsPoint; |
|
boundsStream.lineStart = boundsLineStart; |
|
boundsStream.lineEnd = boundsLineEnd; |
|
if (_area_js__WEBPACK_IMPORTED_MODULE_1__["areaRingSum"] < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90); |
|
else if (deltaSum > _math_js__WEBPACK_IMPORTED_MODULE_3__["epsilon"]) phi1 = 90; |
|
else if (deltaSum < -_math_js__WEBPACK_IMPORTED_MODULE_3__["epsilon"]) phi0 = -90; |
|
range[0] = lambda0, range[1] = lambda1; |
|
}, |
|
sphere: function() { |
|
lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90); |
|
} |
|
}; |
|
|
|
function boundsPoint(lambda, phi) { |
|
ranges.push(range = [lambda0 = lambda, lambda1 = lambda]); |
|
if (phi < phi0) phi0 = phi; |
|
if (phi > phi1) phi1 = phi; |
|
} |
|
|
|
function linePoint(lambda, phi) { |
|
var p = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_2__["cartesian"])([lambda * _math_js__WEBPACK_IMPORTED_MODULE_3__["radians"], phi * _math_js__WEBPACK_IMPORTED_MODULE_3__["radians"]]); |
|
if (p0) { |
|
var normal = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_2__["cartesianCross"])(p0, p), |
|
equatorial = [normal[1], -normal[0], 0], |
|
inflection = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_2__["cartesianCross"])(equatorial, normal); |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_2__["cartesianNormalizeInPlace"])(inflection); |
|
inflection = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_2__["spherical"])(inflection); |
|
var delta = lambda - lambda2, |
|
sign = delta > 0 ? 1 : -1, |
|
lambdai = inflection[0] * _math_js__WEBPACK_IMPORTED_MODULE_3__["degrees"] * sign, |
|
phii, |
|
antimeridian = Object(_math_js__WEBPACK_IMPORTED_MODULE_3__["abs"])(delta) > 180; |
|
if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) { |
|
phii = inflection[1] * _math_js__WEBPACK_IMPORTED_MODULE_3__["degrees"]; |
|
if (phii > phi1) phi1 = phii; |
|
} else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) { |
|
phii = -inflection[1] * _math_js__WEBPACK_IMPORTED_MODULE_3__["degrees"]; |
|
if (phii < phi0) phi0 = phii; |
|
} else { |
|
if (phi < phi0) phi0 = phi; |
|
if (phi > phi1) phi1 = phi; |
|
} |
|
if (antimeridian) { |
|
if (lambda < lambda2) { |
|
if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda; |
|
} else { |
|
if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda; |
|
} |
|
} else { |
|
if (lambda1 >= lambda0) { |
|
if (lambda < lambda0) lambda0 = lambda; |
|
if (lambda > lambda1) lambda1 = lambda; |
|
} else { |
|
if (lambda > lambda2) { |
|
if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda; |
|
} else { |
|
if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda; |
|
} |
|
} |
|
} |
|
} else { |
|
ranges.push(range = [lambda0 = lambda, lambda1 = lambda]); |
|
} |
|
if (phi < phi0) phi0 = phi; |
|
if (phi > phi1) phi1 = phi; |
|
p0 = p, lambda2 = lambda; |
|
} |
|
|
|
function boundsLineStart() { |
|
boundsStream.point = linePoint; |
|
} |
|
|
|
function boundsLineEnd() { |
|
range[0] = lambda0, range[1] = lambda1; |
|
boundsStream.point = boundsPoint; |
|
p0 = null; |
|
} |
|
|
|
function boundsRingPoint(lambda, phi) { |
|
if (p0) { |
|
var delta = lambda - lambda2; |
|
deltaSum.add(Object(_math_js__WEBPACK_IMPORTED_MODULE_3__["abs"])(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta); |
|
} else { |
|
lambda00 = lambda, phi00 = phi; |
|
} |
|
_area_js__WEBPACK_IMPORTED_MODULE_1__["areaStream"].point(lambda, phi); |
|
linePoint(lambda, phi); |
|
} |
|
|
|
function boundsRingStart() { |
|
_area_js__WEBPACK_IMPORTED_MODULE_1__["areaStream"].lineStart(); |
|
} |
|
|
|
function boundsRingEnd() { |
|
boundsRingPoint(lambda00, phi00); |
|
_area_js__WEBPACK_IMPORTED_MODULE_1__["areaStream"].lineEnd(); |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_3__["abs"])(deltaSum) > _math_js__WEBPACK_IMPORTED_MODULE_3__["epsilon"]) lambda0 = -(lambda1 = 180); |
|
range[0] = lambda0, range[1] = lambda1; |
|
p0 = null; |
|
} |
|
|
|
// Finds the left-right distance between two longitudes. |
|
// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want |
|
// the distance between ±180° to be 360°. |
|
function angle(lambda0, lambda1) { |
|
return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1; |
|
} |
|
|
|
function rangeCompare(a, b) { |
|
return a[0] - b[0]; |
|
} |
|
|
|
function rangeContains(range, x) { |
|
return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(feature) { |
|
var i, n, a, b, merged, deltaMax, delta; |
|
|
|
phi1 = lambda1 = -(lambda0 = phi0 = Infinity); |
|
ranges = []; |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_4__["default"])(feature, boundsStream); |
|
|
|
// First, sort ranges by their minimum longitudes. |
|
if (n = ranges.length) { |
|
ranges.sort(rangeCompare); |
|
|
|
// Then, merge any ranges that overlap. |
|
for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) { |
|
b = ranges[i]; |
|
if (rangeContains(a, b[0]) || rangeContains(a, b[1])) { |
|
if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; |
|
if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; |
|
} else { |
|
merged.push(a = b); |
|
} |
|
} |
|
|
|
// Finally, find the largest gap between the merged ranges. |
|
// The final bounding box will be the inverse of this gap. |
|
for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) { |
|
b = merged[i]; |
|
if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1]; |
|
} |
|
} |
|
|
|
ranges = range = null; |
|
|
|
return lambda0 === Infinity || phi0 === Infinity |
|
? [[NaN, NaN], [NaN, NaN]] |
|
: [[lambda0, phi0], [lambda1, phi1]]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/cartesian.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/cartesian.js ***! |
|
\***********************************************/ |
|
/*! exports provided: spherical, cartesian, cartesianDot, cartesianCross, cartesianAddInPlace, cartesianScale, cartesianNormalizeInPlace */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spherical", function() { return spherical; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cartesian", function() { return cartesian; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cartesianDot", function() { return cartesianDot; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cartesianCross", function() { return cartesianCross; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cartesianAddInPlace", function() { return cartesianAddInPlace; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cartesianScale", function() { return cartesianScale; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cartesianNormalizeInPlace", function() { return cartesianNormalizeInPlace; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
function spherical(cartesian) { |
|
return [Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(cartesian[1], cartesian[0]), Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(cartesian[2])]; |
|
} |
|
|
|
function cartesian(spherical) { |
|
var lambda = spherical[0], phi = spherical[1], cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi); |
|
return [cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(lambda), cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(lambda), Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi)]; |
|
} |
|
|
|
function cartesianDot(a, b) { |
|
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; |
|
} |
|
|
|
function cartesianCross(a, b) { |
|
return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; |
|
} |
|
|
|
// TODO return a |
|
function cartesianAddInPlace(a, b) { |
|
a[0] += b[0], a[1] += b[1], a[2] += b[2]; |
|
} |
|
|
|
function cartesianScale(vector, k) { |
|
return [vector[0] * k, vector[1] * k, vector[2] * k]; |
|
} |
|
|
|
// TODO return d |
|
function cartesianNormalizeInPlace(d) { |
|
var l = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); |
|
d[0] /= l, d[1] /= l, d[2] /= l; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/centroid.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/centroid.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
|
|
|
|
|
|
|
|
var W0, W1, |
|
X0, Y0, Z0, |
|
X1, Y1, Z1, |
|
X2, Y2, Z2, |
|
lambda00, phi00, // first point |
|
x0, y0, z0; // previous point |
|
|
|
var centroidStream = { |
|
sphere: _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
point: centroidPoint, |
|
lineStart: centroidLineStart, |
|
lineEnd: centroidLineEnd, |
|
polygonStart: function() { |
|
centroidStream.lineStart = centroidRingStart; |
|
centroidStream.lineEnd = centroidRingEnd; |
|
}, |
|
polygonEnd: function() { |
|
centroidStream.lineStart = centroidLineStart; |
|
centroidStream.lineEnd = centroidLineEnd; |
|
} |
|
}; |
|
|
|
// Arithmetic mean of Cartesian vectors. |
|
function centroidPoint(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"]; |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi); |
|
centroidPointCartesian(cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(lambda), cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(lambda), Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi)); |
|
} |
|
|
|
function centroidPointCartesian(x, y, z) { |
|
++W0; |
|
X0 += (x - X0) / W0; |
|
Y0 += (y - Y0) / W0; |
|
Z0 += (z - Z0) / W0; |
|
} |
|
|
|
function centroidLineStart() { |
|
centroidStream.point = centroidLinePointFirst; |
|
} |
|
|
|
function centroidLinePointFirst(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"]; |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi); |
|
x0 = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(lambda); |
|
y0 = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(lambda); |
|
z0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi); |
|
centroidStream.point = centroidLinePoint; |
|
centroidPointCartesian(x0, y0, z0); |
|
} |
|
|
|
function centroidLinePoint(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"]; |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi), |
|
x = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(lambda), |
|
y = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(lambda), |
|
z = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi), |
|
w = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); |
|
W1 += w; |
|
X1 += w * (x0 + (x0 = x)); |
|
Y1 += w * (y0 + (y0 = y)); |
|
Z1 += w * (z0 + (z0 = z)); |
|
centroidPointCartesian(x0, y0, z0); |
|
} |
|
|
|
function centroidLineEnd() { |
|
centroidStream.point = centroidPoint; |
|
} |
|
|
|
// See J. E. Brock, The Inertia Tensor for a Spherical Triangle, |
|
// J. Applied Mechanics 42, 239 (1975). |
|
function centroidRingStart() { |
|
centroidStream.point = centroidRingPointFirst; |
|
} |
|
|
|
function centroidRingEnd() { |
|
centroidRingPoint(lambda00, phi00); |
|
centroidStream.point = centroidPoint; |
|
} |
|
|
|
function centroidRingPointFirst(lambda, phi) { |
|
lambda00 = lambda, phi00 = phi; |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"]; |
|
centroidStream.point = centroidRingPoint; |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi); |
|
x0 = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(lambda); |
|
y0 = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(lambda); |
|
z0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi); |
|
centroidPointCartesian(x0, y0, z0); |
|
} |
|
|
|
function centroidRingPoint(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"]; |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi), |
|
x = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(lambda), |
|
y = cosPhi * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(lambda), |
|
z = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi), |
|
cx = y0 * z - z0 * y, |
|
cy = z0 * x - x0 * z, |
|
cz = x0 * y - y0 * x, |
|
m = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(cx * cx + cy * cy + cz * cz), |
|
w = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(m), // line weight = angle |
|
v = m && -w / m; // area weight multiplier |
|
X2 += v * cx; |
|
Y2 += v * cy; |
|
Z2 += v * cz; |
|
W1 += w; |
|
X1 += w * (x0 + (x0 = x)); |
|
Y1 += w * (y0 + (y0 = y)); |
|
Z1 += w * (z0 + (z0 = z)); |
|
centroidPointCartesian(x0, y0, z0); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(object) { |
|
W0 = W1 = |
|
X0 = Y0 = Z0 = |
|
X1 = Y1 = Z1 = |
|
X2 = Y2 = Z2 = 0; |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, centroidStream); |
|
|
|
var x = X2, |
|
y = Y2, |
|
z = Z2, |
|
m = x * x + y * y + z * z; |
|
|
|
// If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid. |
|
if (m < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon2"]) { |
|
x = X1, y = Y1, z = Z1; |
|
// If the feature has zero length, fall back to arithmetic mean of point vectors. |
|
if (W1 < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) x = X0, y = Y0, z = Z0; |
|
m = x * x + y * y + z * z; |
|
// If the feature still has an undefined ccentroid, then return. |
|
if (m < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon2"]) return [NaN, NaN]; |
|
} |
|
|
|
return [Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(y, x) * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"], Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(z / Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(m)) * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"]]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/circle.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/circle.js ***! |
|
\********************************************/ |
|
/*! exports provided: circleStream, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circleStream", function() { return circleStream; }); |
|
/* harmony import */ var _cartesian_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cartesian.js */ "../node_modules/d3-geo/src/cartesian.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-geo/src/constant.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _rotation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rotation.js */ "../node_modules/d3-geo/src/rotation.js"); |
|
|
|
|
|
|
|
|
|
|
|
// Generates a circle centered at [0°, 0°], with a given radius and precision. |
|
function circleStream(stream, radius, delta, direction, t0, t1) { |
|
if (!delta) return; |
|
var cosRadius = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(radius), |
|
sinRadius = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(radius), |
|
step = direction * delta; |
|
if (t0 == null) { |
|
t0 = radius + direction * _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"]; |
|
t1 = radius - step / 2; |
|
} else { |
|
t0 = circleRadius(cosRadius, t0); |
|
t1 = circleRadius(cosRadius, t1); |
|
if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"]; |
|
} |
|
for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) { |
|
point = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["spherical"])([cosRadius, -sinRadius * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(t), -sinRadius * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(t)]); |
|
stream.point(point[0], point[1]); |
|
} |
|
} |
|
|
|
// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0]. |
|
function circleRadius(cosRadius, point) { |
|
point = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesian"])(point), point[0] -= cosRadius; |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianNormalizeInPlace"])(point); |
|
var radius = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["acos"])(-point[1]); |
|
return ((-point[2] < 0 ? -radius : radius) + _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"] - _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) % _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"]; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var center = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])([0, 0]), |
|
radius = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(90), |
|
precision = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(6), |
|
ring, |
|
rotate, |
|
stream = {point: point}; |
|
|
|
function point(x, y) { |
|
ring.push(x = rotate(x, y)); |
|
x[0] *= _math_js__WEBPACK_IMPORTED_MODULE_2__["degrees"], x[1] *= _math_js__WEBPACK_IMPORTED_MODULE_2__["degrees"]; |
|
} |
|
|
|
function circle() { |
|
var c = center.apply(this, arguments), |
|
r = radius.apply(this, arguments) * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"], |
|
p = precision.apply(this, arguments) * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"]; |
|
ring = []; |
|
rotate = Object(_rotation_js__WEBPACK_IMPORTED_MODULE_3__["rotateRadians"])(-c[0] * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"], -c[1] * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"], 0).invert; |
|
circleStream(stream, r, p, 1); |
|
c = {type: "Polygon", coordinates: [ring]}; |
|
ring = rotate = null; |
|
return c; |
|
} |
|
|
|
circle.center = function(_) { |
|
return arguments.length ? (center = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])([+_[0], +_[1]]), circle) : center; |
|
}; |
|
|
|
circle.radius = function(_) { |
|
return arguments.length ? (radius = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), circle) : radius; |
|
}; |
|
|
|
circle.precision = function(_) { |
|
return arguments.length ? (precision = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), circle) : precision; |
|
}; |
|
|
|
return circle; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/antimeridian.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/antimeridian.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/clip/index.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])( |
|
function() { return true; }, |
|
clipAntimeridianLine, |
|
clipAntimeridianInterpolate, |
|
[-_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], -_math_js__WEBPACK_IMPORTED_MODULE_1__["halfPi"]] |
|
)); |
|
|
|
// Takes a line and cuts into visible segments. Return values: 0 - there were |
|
// intersections or the line was empty; 1 - no intersections; 2 - there were |
|
// intersections, and the first and last segments should be rejoined. |
|
function clipAntimeridianLine(stream) { |
|
var lambda0 = NaN, |
|
phi0 = NaN, |
|
sign0 = NaN, |
|
clean; // no intersections |
|
|
|
return { |
|
lineStart: function() { |
|
stream.lineStart(); |
|
clean = 1; |
|
}, |
|
point: function(lambda1, phi1) { |
|
var sign1 = lambda1 > 0 ? _math_js__WEBPACK_IMPORTED_MODULE_1__["pi"] : -_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], |
|
delta = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(lambda1 - lambda0); |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_1__["pi"]) < _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]) { // line crosses a pole |
|
stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? _math_js__WEBPACK_IMPORTED_MODULE_1__["halfPi"] : -_math_js__WEBPACK_IMPORTED_MODULE_1__["halfPi"]); |
|
stream.point(sign0, phi0); |
|
stream.lineEnd(); |
|
stream.lineStart(); |
|
stream.point(sign1, phi0); |
|
stream.point(lambda1, phi0); |
|
clean = 0; |
|
} else if (sign0 !== sign1 && delta >= _math_js__WEBPACK_IMPORTED_MODULE_1__["pi"]) { // line crosses antimeridian |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(lambda0 - sign0) < _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]) lambda0 -= sign0 * _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]; // handle degeneracies |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(lambda1 - sign1) < _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]) lambda1 -= sign1 * _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]; |
|
phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1); |
|
stream.point(sign0, phi0); |
|
stream.lineEnd(); |
|
stream.lineStart(); |
|
stream.point(sign1, phi0); |
|
clean = 0; |
|
} |
|
stream.point(lambda0 = lambda1, phi0 = phi1); |
|
sign0 = sign1; |
|
}, |
|
lineEnd: function() { |
|
stream.lineEnd(); |
|
lambda0 = phi0 = NaN; |
|
}, |
|
clean: function() { |
|
return 2 - clean; // if intersections, rejoin first and last segments |
|
} |
|
}; |
|
} |
|
|
|
function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) { |
|
var cosPhi0, |
|
cosPhi1, |
|
sinLambda0Lambda1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(lambda0 - lambda1); |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(sinLambda0Lambda1) > _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"] |
|
? Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["atan"])((Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi0) * (cosPhi1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi1)) * Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(lambda1) |
|
- Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi1) * (cosPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi0)) * Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(lambda0)) |
|
/ (cosPhi0 * cosPhi1 * sinLambda0Lambda1)) |
|
: (phi0 + phi1) / 2; |
|
} |
|
|
|
function clipAntimeridianInterpolate(from, to, direction, stream) { |
|
var phi; |
|
if (from == null) { |
|
phi = direction * _math_js__WEBPACK_IMPORTED_MODULE_1__["halfPi"]; |
|
stream.point(-_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], phi); |
|
stream.point(0, phi); |
|
stream.point(_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], phi); |
|
stream.point(_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], 0); |
|
stream.point(_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], -phi); |
|
stream.point(0, -phi); |
|
stream.point(-_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], -phi); |
|
stream.point(-_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], 0); |
|
stream.point(-_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"], phi); |
|
} else if (Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(from[0] - to[0]) > _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]) { |
|
var lambda = from[0] < to[0] ? _math_js__WEBPACK_IMPORTED_MODULE_1__["pi"] : -_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"]; |
|
phi = direction * lambda / 2; |
|
stream.point(-lambda, phi); |
|
stream.point(0, phi); |
|
stream.point(lambda, phi); |
|
} else { |
|
stream.point(to[0], to[1]); |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/buffer.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/buffer.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var lines = [], |
|
line; |
|
return { |
|
point: function(x, y, m) { |
|
line.push([x, y, m]); |
|
}, |
|
lineStart: function() { |
|
lines.push(line = []); |
|
}, |
|
lineEnd: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
rejoin: function() { |
|
if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); |
|
}, |
|
result: function() { |
|
var result = lines; |
|
lines = []; |
|
line = null; |
|
return result; |
|
} |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/circle.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/circle.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _cartesian_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cartesian.js */ "../node_modules/d3-geo/src/cartesian.js"); |
|
/* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../circle.js */ "../node_modules/d3-geo/src/circle.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _pointEqual_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../pointEqual.js */ "../node_modules/d3-geo/src/pointEqual.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/clip/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(radius) { |
|
var cr = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(radius), |
|
delta = 6 * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"], |
|
smallRadius = cr > 0, |
|
notHemisphere = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(cr) > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]; // TODO optimise for this common case |
|
|
|
function interpolate(from, to, direction, stream) { |
|
Object(_circle_js__WEBPACK_IMPORTED_MODULE_1__["circleStream"])(stream, radius, delta, direction, from, to); |
|
} |
|
|
|
function visible(lambda, phi) { |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(lambda) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(phi) > cr; |
|
} |
|
|
|
// Takes a line and cuts into visible segments. Return values used for polygon |
|
// clipping: 0 - there were intersections or the line was empty; 1 - no |
|
// intersections 2 - there were intersections, and the first and last segments |
|
// should be rejoined. |
|
function clipLine(stream) { |
|
var point0, // previous point |
|
c0, // code for previous point |
|
v0, // visibility of previous point |
|
v00, // visibility of first point |
|
clean; // no intersections |
|
return { |
|
lineStart: function() { |
|
v00 = v0 = false; |
|
clean = 1; |
|
}, |
|
point: function(lambda, phi) { |
|
var point1 = [lambda, phi], |
|
point2, |
|
v = visible(lambda, phi), |
|
c = smallRadius |
|
? v ? 0 : code(lambda, phi) |
|
: v ? code(lambda + (lambda < 0 ? _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"] : -_math_js__WEBPACK_IMPORTED_MODULE_2__["pi"]), phi) : 0; |
|
if (!point0 && (v00 = v0 = v)) stream.lineStart(); |
|
if (v !== v0) { |
|
point2 = intersect(point0, point1); |
|
if (!point2 || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__["default"])(point0, point2) || Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__["default"])(point1, point2)) |
|
point1[2] = 1; |
|
} |
|
if (v !== v0) { |
|
clean = 0; |
|
if (v) { |
|
// outside going in |
|
stream.lineStart(); |
|
point2 = intersect(point1, point0); |
|
stream.point(point2[0], point2[1]); |
|
} else { |
|
// inside going out |
|
point2 = intersect(point0, point1); |
|
stream.point(point2[0], point2[1], 2); |
|
stream.lineEnd(); |
|
} |
|
point0 = point2; |
|
} else if (notHemisphere && point0 && smallRadius ^ v) { |
|
var t; |
|
// If the codes for two points are different, or are both zero, |
|
// and there this segment intersects with the small circle. |
|
if (!(c & c0) && (t = intersect(point1, point0, true))) { |
|
clean = 0; |
|
if (smallRadius) { |
|
stream.lineStart(); |
|
stream.point(t[0][0], t[0][1]); |
|
stream.point(t[1][0], t[1][1]); |
|
stream.lineEnd(); |
|
} else { |
|
stream.point(t[1][0], t[1][1]); |
|
stream.lineEnd(); |
|
stream.lineStart(); |
|
stream.point(t[0][0], t[0][1], 3); |
|
} |
|
} |
|
} |
|
if (v && (!point0 || !Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_3__["default"])(point0, point1))) { |
|
stream.point(point1[0], point1[1]); |
|
} |
|
point0 = point1, v0 = v, c0 = c; |
|
}, |
|
lineEnd: function() { |
|
if (v0) stream.lineEnd(); |
|
point0 = null; |
|
}, |
|
// Rejoin first and last segments if there were intersections and the first |
|
// and last points were visible. |
|
clean: function() { |
|
return clean | ((v00 && v0) << 1); |
|
} |
|
}; |
|
} |
|
|
|
// Intersects the great circle between a and b with the clip circle. |
|
function intersect(a, b, two) { |
|
var pa = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesian"])(a), |
|
pb = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesian"])(b); |
|
|
|
// We have two planes, n1.p = d1 and n2.p = d2. |
|
// Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2). |
|
var n1 = [1, 0, 0], // normal |
|
n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianCross"])(pa, pb), |
|
n2n2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianDot"])(n2, n2), |
|
n1n2 = n2[0], // cartesianDot(n1, n2), |
|
determinant = n2n2 - n1n2 * n1n2; |
|
|
|
// Two polar points. |
|
if (!determinant) return !two && a; |
|
|
|
var c1 = cr * n2n2 / determinant, |
|
c2 = -cr * n1n2 / determinant, |
|
n1xn2 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianCross"])(n1, n2), |
|
A = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianScale"])(n1, c1), |
|
B = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianScale"])(n2, c2); |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianAddInPlace"])(A, B); |
|
|
|
// Solve |p(t)|^2 = 1. |
|
var u = n1xn2, |
|
w = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianDot"])(A, u), |
|
uu = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianDot"])(u, u), |
|
t2 = w * w - uu * (Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianDot"])(A, A) - 1); |
|
|
|
if (t2 < 0) return; |
|
|
|
var t = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(t2), |
|
q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianScale"])(u, (-w - t) / uu); |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianAddInPlace"])(q, A); |
|
q = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["spherical"])(q); |
|
|
|
if (!two) return q; |
|
|
|
// Two intersection points. |
|
var lambda0 = a[0], |
|
lambda1 = b[0], |
|
phi0 = a[1], |
|
phi1 = b[1], |
|
z; |
|
|
|
if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z; |
|
|
|
var delta = lambda1 - lambda0, |
|
polar = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(delta - _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"]) < _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"], |
|
meridian = polar || delta < _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]; |
|
|
|
if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z; |
|
|
|
// Check that the first point is between a and b. |
|
if (meridian |
|
? polar |
|
? phi0 + phi1 > 0 ^ q[1] < (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(q[0] - lambda0) < _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"] ? phi0 : phi1) |
|
: phi0 <= q[1] && q[1] <= phi1 |
|
: delta > _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"] ^ (lambda0 <= q[0] && q[0] <= lambda1)) { |
|
var q1 = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianScale"])(u, (-w + t) / uu); |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesianAddInPlace"])(q1, A); |
|
return [q, Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["spherical"])(q1)]; |
|
} |
|
} |
|
|
|
// Generates a 4-bit vector representing the location of a point relative to |
|
// the small circle's bounding box. |
|
function code(lambda, phi) { |
|
var r = smallRadius ? radius : _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"] - radius, |
|
code = 0; |
|
if (lambda < -r) code |= 1; // left |
|
else if (lambda > r) code |= 2; // right |
|
if (phi < -r) code |= 4; // below |
|
else if (phi > r) code |= 8; // above |
|
return code; |
|
} |
|
|
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-_math_js__WEBPACK_IMPORTED_MODULE_2__["pi"], radius - _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"]]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/extent.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/extent.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _rectangle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rectangle.js */ "../node_modules/d3-geo/src/clip/rectangle.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var x0 = 0, |
|
y0 = 0, |
|
x1 = 960, |
|
y1 = 500, |
|
cache, |
|
cacheStream, |
|
clip; |
|
|
|
return clip = { |
|
stream: function(stream) { |
|
return cache && cacheStream === stream ? cache : cache = Object(_rectangle_js__WEBPACK_IMPORTED_MODULE_0__["default"])(x0, y0, x1, y1)(cacheStream = stream); |
|
}, |
|
extent: function(_) { |
|
return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]]; |
|
} |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/index.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/index.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buffer.js */ "../node_modules/d3-geo/src/clip/buffer.js"); |
|
/* harmony import */ var _rejoin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rejoin.js */ "../node_modules/d3-geo/src/clip/rejoin.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _polygonContains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../polygonContains.js */ "../node_modules/d3-geo/src/polygonContains.js"); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(pointVisible, clipLine, interpolate, start) { |
|
return function(sink) { |
|
var line = clipLine(sink), |
|
ringBuffer = Object(_buffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
ringSink = clipLine(ringBuffer), |
|
polygonStarted = false, |
|
polygon, |
|
segments, |
|
ring; |
|
|
|
var clip = { |
|
point: point, |
|
lineStart: lineStart, |
|
lineEnd: lineEnd, |
|
polygonStart: function() { |
|
clip.point = pointRing; |
|
clip.lineStart = ringStart; |
|
clip.lineEnd = ringEnd; |
|
segments = []; |
|
polygon = []; |
|
}, |
|
polygonEnd: function() { |
|
clip.point = point; |
|
clip.lineStart = lineStart; |
|
clip.lineEnd = lineEnd; |
|
segments = Object(d3_array__WEBPACK_IMPORTED_MODULE_4__["merge"])(segments); |
|
var startInside = Object(_polygonContains_js__WEBPACK_IMPORTED_MODULE_3__["default"])(polygon, start); |
|
if (segments.length) { |
|
if (!polygonStarted) sink.polygonStart(), polygonStarted = true; |
|
Object(_rejoin_js__WEBPACK_IMPORTED_MODULE_1__["default"])(segments, compareIntersection, startInside, interpolate, sink); |
|
} else if (startInside) { |
|
if (!polygonStarted) sink.polygonStart(), polygonStarted = true; |
|
sink.lineStart(); |
|
interpolate(null, null, 1, sink); |
|
sink.lineEnd(); |
|
} |
|
if (polygonStarted) sink.polygonEnd(), polygonStarted = false; |
|
segments = polygon = null; |
|
}, |
|
sphere: function() { |
|
sink.polygonStart(); |
|
sink.lineStart(); |
|
interpolate(null, null, 1, sink); |
|
sink.lineEnd(); |
|
sink.polygonEnd(); |
|
} |
|
}; |
|
|
|
function point(lambda, phi) { |
|
if (pointVisible(lambda, phi)) sink.point(lambda, phi); |
|
} |
|
|
|
function pointLine(lambda, phi) { |
|
line.point(lambda, phi); |
|
} |
|
|
|
function lineStart() { |
|
clip.point = pointLine; |
|
line.lineStart(); |
|
} |
|
|
|
function lineEnd() { |
|
clip.point = point; |
|
line.lineEnd(); |
|
} |
|
|
|
function pointRing(lambda, phi) { |
|
ring.push([lambda, phi]); |
|
ringSink.point(lambda, phi); |
|
} |
|
|
|
function ringStart() { |
|
ringSink.lineStart(); |
|
ring = []; |
|
} |
|
|
|
function ringEnd() { |
|
pointRing(ring[0][0], ring[0][1]); |
|
ringSink.lineEnd(); |
|
|
|
var clean = ringSink.clean(), |
|
ringSegments = ringBuffer.result(), |
|
i, n = ringSegments.length, m, |
|
segment, |
|
point; |
|
|
|
ring.pop(); |
|
polygon.push(ring); |
|
ring = null; |
|
|
|
if (!n) return; |
|
|
|
// No intersections. |
|
if (clean & 1) { |
|
segment = ringSegments[0]; |
|
if ((m = segment.length - 1) > 0) { |
|
if (!polygonStarted) sink.polygonStart(), polygonStarted = true; |
|
sink.lineStart(); |
|
for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]); |
|
sink.lineEnd(); |
|
} |
|
return; |
|
} |
|
|
|
// Rejoin connected segments. |
|
// TODO reuse ringBuffer.rejoin()? |
|
if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); |
|
|
|
segments.push(ringSegments.filter(validSegment)); |
|
} |
|
|
|
return clip; |
|
}; |
|
}); |
|
|
|
function validSegment(segment) { |
|
return segment.length > 1; |
|
} |
|
|
|
// Intersections are sorted along the clip edge. For both antimeridian cutting |
|
// and circle clipping, the same comparison is used. |
|
function compareIntersection(a, b) { |
|
return ((a = a.x)[0] < 0 ? a[1] - _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"] - _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"] : _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"] - a[1]) |
|
- ((b = b.x)[0] < 0 ? b[1] - _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"] - _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"] : _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"] - b[1]); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/line.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/line.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b, x0, y0, x1, y1) { |
|
var ax = a[0], |
|
ay = a[1], |
|
bx = b[0], |
|
by = b[1], |
|
t0 = 0, |
|
t1 = 1, |
|
dx = bx - ax, |
|
dy = by - ay, |
|
r; |
|
|
|
r = x0 - ax; |
|
if (!dx && r > 0) return; |
|
r /= dx; |
|
if (dx < 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} else if (dx > 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} |
|
|
|
r = x1 - ax; |
|
if (!dx && r < 0) return; |
|
r /= dx; |
|
if (dx < 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} else if (dx > 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} |
|
|
|
r = y0 - ay; |
|
if (!dy && r > 0) return; |
|
r /= dy; |
|
if (dy < 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} else if (dy > 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} |
|
|
|
r = y1 - ay; |
|
if (!dy && r < 0) return; |
|
r /= dy; |
|
if (dy < 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} else if (dy > 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} |
|
|
|
if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy; |
|
if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy; |
|
return true; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/rectangle.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/rectangle.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return clipRectangle; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buffer.js */ "../node_modules/d3-geo/src/clip/buffer.js"); |
|
/* harmony import */ var _line_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./line.js */ "../node_modules/d3-geo/src/clip/line.js"); |
|
/* harmony import */ var _rejoin_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rejoin.js */ "../node_modules/d3-geo/src/clip/rejoin.js"); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
var clipMax = 1e9, clipMin = -clipMax; |
|
|
|
// TODO Use d3-polygon’s polygonContains here for the ring check? |
|
// TODO Eliminate duplicate buffering in clipBuffer and polygon.push? |
|
|
|
function clipRectangle(x0, y0, x1, y1) { |
|
|
|
function visible(x, y) { |
|
return x0 <= x && x <= x1 && y0 <= y && y <= y1; |
|
} |
|
|
|
function interpolate(from, to, direction, stream) { |
|
var a = 0, a1 = 0; |
|
if (from == null |
|
|| (a = corner(from, direction)) !== (a1 = corner(to, direction)) |
|
|| comparePoint(from, to) < 0 ^ direction > 0) { |
|
do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); |
|
while ((a = (a + direction + 4) % 4) !== a1); |
|
} else { |
|
stream.point(to[0], to[1]); |
|
} |
|
} |
|
|
|
function corner(p, direction) { |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(p[0] - x0) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"] ? direction > 0 ? 0 : 3 |
|
: Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(p[0] - x1) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"] ? direction > 0 ? 2 : 1 |
|
: Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(p[1] - y0) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"] ? direction > 0 ? 1 : 0 |
|
: direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon |
|
} |
|
|
|
function compareIntersection(a, b) { |
|
return comparePoint(a.x, b.x); |
|
} |
|
|
|
function comparePoint(a, b) { |
|
var ca = corner(a, 1), |
|
cb = corner(b, 1); |
|
return ca !== cb ? ca - cb |
|
: ca === 0 ? b[1] - a[1] |
|
: ca === 1 ? a[0] - b[0] |
|
: ca === 2 ? a[1] - b[1] |
|
: b[0] - a[0]; |
|
} |
|
|
|
return function(stream) { |
|
var activeStream = stream, |
|
bufferStream = Object(_buffer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(), |
|
segments, |
|
polygon, |
|
ring, |
|
x__, y__, v__, // first point |
|
x_, y_, v_, // previous point |
|
first, |
|
clean; |
|
|
|
var clipStream = { |
|
point: point, |
|
lineStart: lineStart, |
|
lineEnd: lineEnd, |
|
polygonStart: polygonStart, |
|
polygonEnd: polygonEnd |
|
}; |
|
|
|
function point(x, y) { |
|
if (visible(x, y)) activeStream.point(x, y); |
|
} |
|
|
|
function polygonInside() { |
|
var winding = 0; |
|
|
|
for (var i = 0, n = polygon.length; i < n; ++i) { |
|
for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) { |
|
a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1]; |
|
if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; } |
|
else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; } |
|
} |
|
} |
|
|
|
return winding; |
|
} |
|
|
|
// Buffer geometry within a polygon and then clip it en masse. |
|
function polygonStart() { |
|
activeStream = bufferStream, segments = [], polygon = [], clean = true; |
|
} |
|
|
|
function polygonEnd() { |
|
var startInside = polygonInside(), |
|
cleanInside = clean && startInside, |
|
visible = (segments = Object(d3_array__WEBPACK_IMPORTED_MODULE_4__["merge"])(segments)).length; |
|
if (cleanInside || visible) { |
|
stream.polygonStart(); |
|
if (cleanInside) { |
|
stream.lineStart(); |
|
interpolate(null, null, 1, stream); |
|
stream.lineEnd(); |
|
} |
|
if (visible) { |
|
Object(_rejoin_js__WEBPACK_IMPORTED_MODULE_3__["default"])(segments, compareIntersection, startInside, interpolate, stream); |
|
} |
|
stream.polygonEnd(); |
|
} |
|
activeStream = stream, segments = polygon = ring = null; |
|
} |
|
|
|
function lineStart() { |
|
clipStream.point = linePoint; |
|
if (polygon) polygon.push(ring = []); |
|
first = true; |
|
v_ = false; |
|
x_ = y_ = NaN; |
|
} |
|
|
|
// TODO rather than special-case polygons, simply handle them separately. |
|
// Ideally, coincident intersection points should be jittered to avoid |
|
// clipping issues. |
|
function lineEnd() { |
|
if (segments) { |
|
linePoint(x__, y__); |
|
if (v__ && v_) bufferStream.rejoin(); |
|
segments.push(bufferStream.result()); |
|
} |
|
clipStream.point = point; |
|
if (v_) activeStream.lineEnd(); |
|
} |
|
|
|
function linePoint(x, y) { |
|
var v = visible(x, y); |
|
if (polygon) ring.push([x, y]); |
|
if (first) { |
|
x__ = x, y__ = y, v__ = v; |
|
first = false; |
|
if (v) { |
|
activeStream.lineStart(); |
|
activeStream.point(x, y); |
|
} |
|
} else { |
|
if (v && v_) activeStream.point(x, y); |
|
else { |
|
var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], |
|
b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))]; |
|
if (Object(_line_js__WEBPACK_IMPORTED_MODULE_2__["default"])(a, b, x0, y0, x1, y1)) { |
|
if (!v_) { |
|
activeStream.lineStart(); |
|
activeStream.point(a[0], a[1]); |
|
} |
|
activeStream.point(b[0], b[1]); |
|
if (!v) activeStream.lineEnd(); |
|
clean = false; |
|
} else if (v) { |
|
activeStream.lineStart(); |
|
activeStream.point(x, y); |
|
clean = false; |
|
} |
|
} |
|
} |
|
x_ = x, y_ = y, v_ = v; |
|
} |
|
|
|
return clipStream; |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/clip/rejoin.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/clip/rejoin.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _pointEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../pointEqual.js */ "../node_modules/d3-geo/src/pointEqual.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
function Intersection(point, points, other, entry) { |
|
this.x = point; |
|
this.z = points; |
|
this.o = other; // another intersection |
|
this.e = entry; // is an entry? |
|
this.v = false; // visited |
|
this.n = this.p = null; // next & previous |
|
} |
|
|
|
// A generalized polygon clipping algorithm: given a polygon that has been cut |
|
// into its visible line segments, and rejoins the segments by interpolating |
|
// along the clip edge. |
|
/* harmony default export */ __webpack_exports__["default"] = (function(segments, compareIntersection, startInside, interpolate, stream) { |
|
var subject = [], |
|
clip = [], |
|
i, |
|
n; |
|
|
|
segments.forEach(function(segment) { |
|
if ((n = segment.length - 1) <= 0) return; |
|
var n, p0 = segment[0], p1 = segment[n], x; |
|
|
|
if (Object(_pointEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(p0, p1)) { |
|
if (!p0[2] && !p1[2]) { |
|
stream.lineStart(); |
|
for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]); |
|
stream.lineEnd(); |
|
return; |
|
} |
|
// handle degenerate cases by moving the point |
|
p1[0] += 2 * _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]; |
|
} |
|
|
|
subject.push(x = new Intersection(p0, segment, null, true)); |
|
clip.push(x.o = new Intersection(p0, null, x, false)); |
|
subject.push(x = new Intersection(p1, segment, null, false)); |
|
clip.push(x.o = new Intersection(p1, null, x, true)); |
|
}); |
|
|
|
if (!subject.length) return; |
|
|
|
clip.sort(compareIntersection); |
|
link(subject); |
|
link(clip); |
|
|
|
for (i = 0, n = clip.length; i < n; ++i) { |
|
clip[i].e = startInside = !startInside; |
|
} |
|
|
|
var start = subject[0], |
|
points, |
|
point; |
|
|
|
while (1) { |
|
// Find first unvisited intersection. |
|
var current = start, |
|
isSubject = true; |
|
while (current.v) if ((current = current.n) === start) return; |
|
points = current.z; |
|
stream.lineStart(); |
|
do { |
|
current.v = current.o.v = true; |
|
if (current.e) { |
|
if (isSubject) { |
|
for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]); |
|
} else { |
|
interpolate(current.x, current.n.x, 1, stream); |
|
} |
|
current = current.n; |
|
} else { |
|
if (isSubject) { |
|
points = current.p.z; |
|
for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]); |
|
} else { |
|
interpolate(current.x, current.p.x, -1, stream); |
|
} |
|
current = current.p; |
|
} |
|
current = current.o; |
|
points = current.z; |
|
isSubject = !isSubject; |
|
} while (!current.v); |
|
stream.lineEnd(); |
|
} |
|
}); |
|
|
|
function link(array) { |
|
if (!(n = array.length)) return; |
|
var n, |
|
i = 0, |
|
a = array[0], |
|
b; |
|
while (++i < n) { |
|
a.n = b = array[i]; |
|
b.p = a; |
|
a = b; |
|
} |
|
a.n = b = array[0]; |
|
b.p = a; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/compose.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/compose.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
|
|
function compose(x, y) { |
|
return x = a(x, y), b(x[0], x[1]); |
|
} |
|
|
|
if (a.invert && b.invert) compose.invert = function(x, y) { |
|
return x = b.invert(x, y), x && a.invert(x[0], x[1]); |
|
}; |
|
|
|
return compose; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/constant.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/constant.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/contains.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/contains.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _polygonContains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polygonContains.js */ "../node_modules/d3-geo/src/polygonContains.js"); |
|
/* harmony import */ var _distance_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./distance.js */ "../node_modules/d3-geo/src/distance.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
|
|
var containsObjectType = { |
|
Feature: function(object, point) { |
|
return containsGeometry(object.geometry, point); |
|
}, |
|
FeatureCollection: function(object, point) { |
|
var features = object.features, i = -1, n = features.length; |
|
while (++i < n) if (containsGeometry(features[i].geometry, point)) return true; |
|
return false; |
|
} |
|
}; |
|
|
|
var containsGeometryType = { |
|
Sphere: function() { |
|
return true; |
|
}, |
|
Point: function(object, point) { |
|
return containsPoint(object.coordinates, point); |
|
}, |
|
MultiPoint: function(object, point) { |
|
var coordinates = object.coordinates, i = -1, n = coordinates.length; |
|
while (++i < n) if (containsPoint(coordinates[i], point)) return true; |
|
return false; |
|
}, |
|
LineString: function(object, point) { |
|
return containsLine(object.coordinates, point); |
|
}, |
|
MultiLineString: function(object, point) { |
|
var coordinates = object.coordinates, i = -1, n = coordinates.length; |
|
while (++i < n) if (containsLine(coordinates[i], point)) return true; |
|
return false; |
|
}, |
|
Polygon: function(object, point) { |
|
return containsPolygon(object.coordinates, point); |
|
}, |
|
MultiPolygon: function(object, point) { |
|
var coordinates = object.coordinates, i = -1, n = coordinates.length; |
|
while (++i < n) if (containsPolygon(coordinates[i], point)) return true; |
|
return false; |
|
}, |
|
GeometryCollection: function(object, point) { |
|
var geometries = object.geometries, i = -1, n = geometries.length; |
|
while (++i < n) if (containsGeometry(geometries[i], point)) return true; |
|
return false; |
|
} |
|
}; |
|
|
|
function containsGeometry(geometry, point) { |
|
return geometry && containsGeometryType.hasOwnProperty(geometry.type) |
|
? containsGeometryType[geometry.type](geometry, point) |
|
: false; |
|
} |
|
|
|
function containsPoint(coordinates, point) { |
|
return Object(_distance_js__WEBPACK_IMPORTED_MODULE_1__["default"])(coordinates, point) === 0; |
|
} |
|
|
|
function containsLine(coordinates, point) { |
|
var ao, bo, ab; |
|
for (var i = 0, n = coordinates.length; i < n; i++) { |
|
bo = Object(_distance_js__WEBPACK_IMPORTED_MODULE_1__["default"])(coordinates[i], point); |
|
if (bo === 0) return true; |
|
if (i > 0) { |
|
ab = Object(_distance_js__WEBPACK_IMPORTED_MODULE_1__["default"])(coordinates[i], coordinates[i - 1]); |
|
if ( |
|
ab > 0 && |
|
ao <= ab && |
|
bo <= ab && |
|
(ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon2"] * ab |
|
) |
|
return true; |
|
} |
|
ao = bo; |
|
} |
|
return false; |
|
} |
|
|
|
function containsPolygon(coordinates, point) { |
|
return !!Object(_polygonContains_js__WEBPACK_IMPORTED_MODULE_0__["default"])(coordinates.map(ringRadians), pointRadians(point)); |
|
} |
|
|
|
function ringRadians(ring) { |
|
return ring = ring.map(pointRadians), ring.pop(), ring; |
|
} |
|
|
|
function pointRadians(point) { |
|
return [point[0] * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"], point[1] * _math_js__WEBPACK_IMPORTED_MODULE_2__["radians"]]; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(object, point) { |
|
return (object && containsObjectType.hasOwnProperty(object.type) |
|
? containsObjectType[object.type] |
|
: containsGeometry)(object, point); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/distance.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/distance.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _length_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./length.js */ "../node_modules/d3-geo/src/length.js"); |
|
|
|
|
|
var coordinates = [null, null], |
|
object = {type: "LineString", coordinates: coordinates}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
coordinates[0] = a; |
|
coordinates[1] = b; |
|
return Object(_length_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/graticule.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/graticule.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default, graticule10 */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return graticule; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "graticule10", function() { return graticule10; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
function graticuleX(y0, y1, dy) { |
|
var y = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(y0, y1 - _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"], dy).concat(y1); |
|
return function(x) { return y.map(function(y) { return [x, y]; }); }; |
|
} |
|
|
|
function graticuleY(x0, x1, dx) { |
|
var x = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(x0, x1 - _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"], dx).concat(x1); |
|
return function(y) { return x.map(function(x) { return [x, y]; }); }; |
|
} |
|
|
|
function graticule() { |
|
var x1, x0, X1, X0, |
|
y1, y0, Y1, Y0, |
|
dx = 10, dy = dx, DX = 90, DY = 360, |
|
x, y, X, Y, |
|
precision = 2.5; |
|
|
|
function graticule() { |
|
return {type: "MultiLineString", coordinates: lines()}; |
|
} |
|
|
|
function lines() { |
|
return Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["ceil"])(X0 / DX) * DX, X1, DX).map(X) |
|
.concat(Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["ceil"])(Y0 / DY) * DY, Y1, DY).map(Y)) |
|
.concat(Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["ceil"])(x0 / dx) * dx, x1, dx).filter(function(x) { return Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(x % DX) > _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]; }).map(x)) |
|
.concat(Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["ceil"])(y0 / dy) * dy, y1, dy).filter(function(y) { return Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(y % DY) > _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]; }).map(y)); |
|
} |
|
|
|
graticule.lines = function() { |
|
return lines().map(function(coordinates) { return {type: "LineString", coordinates: coordinates}; }); |
|
}; |
|
|
|
graticule.outline = function() { |
|
return { |
|
type: "Polygon", |
|
coordinates: [ |
|
X(X0).concat( |
|
Y(Y1).slice(1), |
|
X(X1).reverse().slice(1), |
|
Y(Y0).reverse().slice(1)) |
|
] |
|
}; |
|
}; |
|
|
|
graticule.extent = function(_) { |
|
if (!arguments.length) return graticule.extentMinor(); |
|
return graticule.extentMajor(_).extentMinor(_); |
|
}; |
|
|
|
graticule.extentMajor = function(_) { |
|
if (!arguments.length) return [[X0, Y0], [X1, Y1]]; |
|
X0 = +_[0][0], X1 = +_[1][0]; |
|
Y0 = +_[0][1], Y1 = +_[1][1]; |
|
if (X0 > X1) _ = X0, X0 = X1, X1 = _; |
|
if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; |
|
return graticule.precision(precision); |
|
}; |
|
|
|
graticule.extentMinor = function(_) { |
|
if (!arguments.length) return [[x0, y0], [x1, y1]]; |
|
x0 = +_[0][0], x1 = +_[1][0]; |
|
y0 = +_[0][1], y1 = +_[1][1]; |
|
if (x0 > x1) _ = x0, x0 = x1, x1 = _; |
|
if (y0 > y1) _ = y0, y0 = y1, y1 = _; |
|
return graticule.precision(precision); |
|
}; |
|
|
|
graticule.step = function(_) { |
|
if (!arguments.length) return graticule.stepMinor(); |
|
return graticule.stepMajor(_).stepMinor(_); |
|
}; |
|
|
|
graticule.stepMajor = function(_) { |
|
if (!arguments.length) return [DX, DY]; |
|
DX = +_[0], DY = +_[1]; |
|
return graticule; |
|
}; |
|
|
|
graticule.stepMinor = function(_) { |
|
if (!arguments.length) return [dx, dy]; |
|
dx = +_[0], dy = +_[1]; |
|
return graticule; |
|
}; |
|
|
|
graticule.precision = function(_) { |
|
if (!arguments.length) return precision; |
|
precision = +_; |
|
x = graticuleX(y0, y1, 90); |
|
y = graticuleY(x0, x1, precision); |
|
X = graticuleX(Y0, Y1, 90); |
|
Y = graticuleY(X0, X1, precision); |
|
return graticule; |
|
}; |
|
|
|
return graticule |
|
.extentMajor([[-180, -90 + _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]], [180, 90 - _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]]]) |
|
.extentMinor([[-180, -80 - _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]], [180, 80 + _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"]]]); |
|
} |
|
|
|
function graticule10() { |
|
return graticule()(); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/identity.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/identity.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/index.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-geo/src/index.js ***! |
|
\*******************************************/ |
|
/*! exports provided: geoArea, geoBounds, geoCentroid, geoCircle, geoClipAntimeridian, geoClipCircle, geoClipExtent, geoClipRectangle, geoContains, geoDistance, geoGraticule, geoGraticule10, geoInterpolate, geoLength, geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEqualAreaRaw, geoAzimuthalEquidistant, geoAzimuthalEquidistantRaw, geoConicConformal, geoConicConformalRaw, geoConicEqualArea, geoConicEqualAreaRaw, geoConicEquidistant, geoConicEquidistantRaw, geoEqualEarth, geoEqualEarthRaw, geoEquirectangular, geoEquirectangularRaw, geoGnomonic, geoGnomonicRaw, geoIdentity, geoProjection, geoProjectionMutator, geoMercator, geoMercatorRaw, geoNaturalEarth1, geoNaturalEarth1Raw, geoOrthographic, geoOrthographicRaw, geoStereographic, geoStereographicRaw, geoTransverseMercator, geoTransverseMercatorRaw, geoRotation, geoStream, geoTransform */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _area_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./area.js */ "../node_modules/d3-geo/src/area.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoArea", function() { return _area_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _bounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bounds.js */ "../node_modules/d3-geo/src/bounds.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoBounds", function() { return _bounds_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _centroid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./centroid.js */ "../node_modules/d3-geo/src/centroid.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoCentroid", function() { return _centroid_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./circle.js */ "../node_modules/d3-geo/src/circle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoCircle", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _clip_antimeridian_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./clip/antimeridian.js */ "../node_modules/d3-geo/src/clip/antimeridian.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipAntimeridian", function() { return _clip_antimeridian_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _clip_circle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./clip/circle.js */ "../node_modules/d3-geo/src/clip/circle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipCircle", function() { return _clip_circle_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _clip_extent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./clip/extent.js */ "../node_modules/d3-geo/src/clip/extent.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipExtent", function() { return _clip_extent_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _clip_rectangle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clip/rectangle.js */ "../node_modules/d3-geo/src/clip/rectangle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipRectangle", function() { return _clip_rectangle_js__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./contains.js */ "../node_modules/d3-geo/src/contains.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoContains", function() { return _contains_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _distance_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./distance.js */ "../node_modules/d3-geo/src/distance.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoDistance", function() { return _distance_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _graticule_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./graticule.js */ "../node_modules/d3-geo/src/graticule.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGraticule", function() { return _graticule_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGraticule10", function() { return _graticule_js__WEBPACK_IMPORTED_MODULE_10__["graticule10"]; }); |
|
|
|
/* harmony import */ var _interpolate_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./interpolate.js */ "../node_modules/d3-geo/src/interpolate.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoInterpolate", function() { return _interpolate_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _length_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./length.js */ "../node_modules/d3-geo/src/length.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoLength", function() { return _length_js__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony import */ var _path_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./path/index.js */ "../node_modules/d3-geo/src/path/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoPath", function() { return _path_index_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony import */ var _projection_albers_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./projection/albers.js */ "../node_modules/d3-geo/src/projection/albers.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAlbers", function() { return _projection_albers_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony import */ var _projection_albersUsa_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./projection/albersUsa.js */ "../node_modules/d3-geo/src/projection/albersUsa.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAlbersUsa", function() { return _projection_albersUsa_js__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
/* harmony import */ var _projection_azimuthalEqualArea_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./projection/azimuthalEqualArea.js */ "../node_modules/d3-geo/src/projection/azimuthalEqualArea.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEqualArea", function() { return _projection_azimuthalEqualArea_js__WEBPACK_IMPORTED_MODULE_16__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEqualAreaRaw", function() { return _projection_azimuthalEqualArea_js__WEBPACK_IMPORTED_MODULE_16__["azimuthalEqualAreaRaw"]; }); |
|
|
|
/* harmony import */ var _projection_azimuthalEquidistant_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./projection/azimuthalEquidistant.js */ "../node_modules/d3-geo/src/projection/azimuthalEquidistant.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEquidistant", function() { return _projection_azimuthalEquidistant_js__WEBPACK_IMPORTED_MODULE_17__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEquidistantRaw", function() { return _projection_azimuthalEquidistant_js__WEBPACK_IMPORTED_MODULE_17__["azimuthalEquidistantRaw"]; }); |
|
|
|
/* harmony import */ var _projection_conicConformal_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./projection/conicConformal.js */ "../node_modules/d3-geo/src/projection/conicConformal.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicConformal", function() { return _projection_conicConformal_js__WEBPACK_IMPORTED_MODULE_18__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicConformalRaw", function() { return _projection_conicConformal_js__WEBPACK_IMPORTED_MODULE_18__["conicConformalRaw"]; }); |
|
|
|
/* harmony import */ var _projection_conicEqualArea_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./projection/conicEqualArea.js */ "../node_modules/d3-geo/src/projection/conicEqualArea.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEqualArea", function() { return _projection_conicEqualArea_js__WEBPACK_IMPORTED_MODULE_19__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEqualAreaRaw", function() { return _projection_conicEqualArea_js__WEBPACK_IMPORTED_MODULE_19__["conicEqualAreaRaw"]; }); |
|
|
|
/* harmony import */ var _projection_conicEquidistant_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./projection/conicEquidistant.js */ "../node_modules/d3-geo/src/projection/conicEquidistant.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEquidistant", function() { return _projection_conicEquidistant_js__WEBPACK_IMPORTED_MODULE_20__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEquidistantRaw", function() { return _projection_conicEquidistant_js__WEBPACK_IMPORTED_MODULE_20__["conicEquidistantRaw"]; }); |
|
|
|
/* harmony import */ var _projection_equalEarth_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./projection/equalEarth.js */ "../node_modules/d3-geo/src/projection/equalEarth.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEqualEarth", function() { return _projection_equalEarth_js__WEBPACK_IMPORTED_MODULE_21__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEqualEarthRaw", function() { return _projection_equalEarth_js__WEBPACK_IMPORTED_MODULE_21__["equalEarthRaw"]; }); |
|
|
|
/* harmony import */ var _projection_equirectangular_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./projection/equirectangular.js */ "../node_modules/d3-geo/src/projection/equirectangular.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEquirectangular", function() { return _projection_equirectangular_js__WEBPACK_IMPORTED_MODULE_22__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEquirectangularRaw", function() { return _projection_equirectangular_js__WEBPACK_IMPORTED_MODULE_22__["equirectangularRaw"]; }); |
|
|
|
/* harmony import */ var _projection_gnomonic_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./projection/gnomonic.js */ "../node_modules/d3-geo/src/projection/gnomonic.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGnomonic", function() { return _projection_gnomonic_js__WEBPACK_IMPORTED_MODULE_23__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGnomonicRaw", function() { return _projection_gnomonic_js__WEBPACK_IMPORTED_MODULE_23__["gnomonicRaw"]; }); |
|
|
|
/* harmony import */ var _projection_identity_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./projection/identity.js */ "../node_modules/d3-geo/src/projection/identity.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoIdentity", function() { return _projection_identity_js__WEBPACK_IMPORTED_MODULE_24__["default"]; }); |
|
|
|
/* harmony import */ var _projection_index_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./projection/index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoProjection", function() { return _projection_index_js__WEBPACK_IMPORTED_MODULE_25__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoProjectionMutator", function() { return _projection_index_js__WEBPACK_IMPORTED_MODULE_25__["projectionMutator"]; }); |
|
|
|
/* harmony import */ var _projection_mercator_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./projection/mercator.js */ "../node_modules/d3-geo/src/projection/mercator.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoMercator", function() { return _projection_mercator_js__WEBPACK_IMPORTED_MODULE_26__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoMercatorRaw", function() { return _projection_mercator_js__WEBPACK_IMPORTED_MODULE_26__["mercatorRaw"]; }); |
|
|
|
/* harmony import */ var _projection_naturalEarth1_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./projection/naturalEarth1.js */ "../node_modules/d3-geo/src/projection/naturalEarth1.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoNaturalEarth1", function() { return _projection_naturalEarth1_js__WEBPACK_IMPORTED_MODULE_27__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoNaturalEarth1Raw", function() { return _projection_naturalEarth1_js__WEBPACK_IMPORTED_MODULE_27__["naturalEarth1Raw"]; }); |
|
|
|
/* harmony import */ var _projection_orthographic_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./projection/orthographic.js */ "../node_modules/d3-geo/src/projection/orthographic.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoOrthographic", function() { return _projection_orthographic_js__WEBPACK_IMPORTED_MODULE_28__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoOrthographicRaw", function() { return _projection_orthographic_js__WEBPACK_IMPORTED_MODULE_28__["orthographicRaw"]; }); |
|
|
|
/* harmony import */ var _projection_stereographic_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./projection/stereographic.js */ "../node_modules/d3-geo/src/projection/stereographic.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoStereographic", function() { return _projection_stereographic_js__WEBPACK_IMPORTED_MODULE_29__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoStereographicRaw", function() { return _projection_stereographic_js__WEBPACK_IMPORTED_MODULE_29__["stereographicRaw"]; }); |
|
|
|
/* harmony import */ var _projection_transverseMercator_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./projection/transverseMercator.js */ "../node_modules/d3-geo/src/projection/transverseMercator.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoTransverseMercator", function() { return _projection_transverseMercator_js__WEBPACK_IMPORTED_MODULE_30__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoTransverseMercatorRaw", function() { return _projection_transverseMercator_js__WEBPACK_IMPORTED_MODULE_30__["transverseMercatorRaw"]; }); |
|
|
|
/* harmony import */ var _rotation_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./rotation.js */ "../node_modules/d3-geo/src/rotation.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoRotation", function() { return _rotation_js__WEBPACK_IMPORTED_MODULE_31__["default"]; }); |
|
|
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoStream", function() { return _stream_js__WEBPACK_IMPORTED_MODULE_32__["default"]; }); |
|
|
|
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./transform.js */ "../node_modules/d3-geo/src/transform.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoTransform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_33__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DEPRECATED! Use d3.geoIdentity().clipExtent(…). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/interpolate.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/interpolate.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var x0 = a[0] * _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], |
|
y0 = a[1] * _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], |
|
x1 = b[0] * _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], |
|
y1 = b[1] * _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], |
|
cy0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y0), |
|
sy0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y0), |
|
cy1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y1), |
|
sy1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y1), |
|
kx0 = cy0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(x0), |
|
ky0 = cy0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x0), |
|
kx1 = cy1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(x1), |
|
ky1 = cy1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x1), |
|
d = 2 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["haversin"])(y1 - y0) + cy0 * cy1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["haversin"])(x1 - x0))), |
|
k = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(d); |
|
|
|
var interpolate = d ? function(t) { |
|
var B = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(t *= d) / k, |
|
A = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(d - t) / k, |
|
x = A * kx0 + B * kx1, |
|
y = A * ky0 + B * ky1, |
|
z = A * sy0 + B * sy1; |
|
return [ |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(y, x) * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"], |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(z, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(x * x + y * y)) * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"] |
|
]; |
|
} : function() { |
|
return [x0 * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"], y0 * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"]]; |
|
}; |
|
|
|
interpolate.distance = d; |
|
|
|
return interpolate; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/length.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/length.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _adder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adder.js */ "../node_modules/d3-geo/src/adder.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
|
|
|
|
|
|
|
|
|
|
var lengthSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
lambda0, |
|
sinPhi0, |
|
cosPhi0; |
|
|
|
var lengthStream = { |
|
sphere: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
point: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
lineStart: lengthLineStart, |
|
lineEnd: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
polygonStart: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
polygonEnd: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"] |
|
}; |
|
|
|
function lengthLineStart() { |
|
lengthStream.point = lengthPointFirst; |
|
lengthStream.lineEnd = lengthLineEnd; |
|
} |
|
|
|
function lengthLineEnd() { |
|
lengthStream.point = lengthStream.lineEnd = _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
|
} |
|
|
|
function lengthPointFirst(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]; |
|
lambda0 = lambda, sinPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi), cosPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi); |
|
lengthStream.point = lengthPoint; |
|
} |
|
|
|
function lengthPoint(lambda, phi) { |
|
lambda *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], phi *= _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]; |
|
var sinPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi), |
|
cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi), |
|
delta = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(lambda - lambda0), |
|
cosDelta = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(delta), |
|
sinDelta = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(delta), |
|
x = cosPhi * sinDelta, |
|
y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta, |
|
z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta; |
|
lengthSum.add(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["atan2"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sqrt"])(x * x + y * y), z)); |
|
lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(object) { |
|
lengthSum.reset(); |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, lengthStream); |
|
return +lengthSum; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/math.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3-geo/src/math.js ***! |
|
\******************************************/ |
|
/*! exports provided: epsilon, epsilon2, pi, halfPi, quarterPi, tau, degrees, radians, abs, atan, atan2, cos, ceil, exp, floor, log, pow, sin, sign, sqrt, tan, acos, asin, haversin */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epsilon", function() { return epsilon; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epsilon2", function() { return epsilon2; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pi", function() { return pi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "halfPi", function() { return halfPi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quarterPi", function() { return quarterPi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tau", function() { return tau; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "degrees", function() { return degrees; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "radians", function() { return radians; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "abs", function() { return abs; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan", function() { return atan; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan2", function() { return atan2; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return cos; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return ceil; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exp", function() { return exp; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return floor; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pow", function() { return pow; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return sin; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sign", function() { return sign; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrt", function() { return sqrt; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tan", function() { return tan; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return acos; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return asin; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "haversin", function() { return haversin; }); |
|
var epsilon = 1e-6; |
|
var epsilon2 = 1e-12; |
|
var pi = Math.PI; |
|
var halfPi = pi / 2; |
|
var quarterPi = pi / 4; |
|
var tau = pi * 2; |
|
|
|
var degrees = 180 / pi; |
|
var radians = pi / 180; |
|
|
|
var abs = Math.abs; |
|
var atan = Math.atan; |
|
var atan2 = Math.atan2; |
|
var cos = Math.cos; |
|
var ceil = Math.ceil; |
|
var exp = Math.exp; |
|
var floor = Math.floor; |
|
var log = Math.log; |
|
var pow = Math.pow; |
|
var sin = Math.sin; |
|
var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; }; |
|
var sqrt = Math.sqrt; |
|
var tan = Math.tan; |
|
|
|
function acos(x) { |
|
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); |
|
} |
|
|
|
function asin(x) { |
|
return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x); |
|
} |
|
|
|
function haversin(x) { |
|
return (x = sin(x / 2)) * x; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/noop.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3-geo/src/noop.js ***! |
|
\******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return noop; }); |
|
function noop() {} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/area.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/area.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _adder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../adder.js */ "../node_modules/d3-geo/src/adder.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
|
|
|
|
|
|
|
|
var areaSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
areaRingSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
x00, |
|
y00, |
|
x0, |
|
y0; |
|
|
|
var areaStream = { |
|
point: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
lineStart: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
lineEnd: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
polygonStart: function() { |
|
areaStream.lineStart = areaRingStart; |
|
areaStream.lineEnd = areaRingEnd; |
|
}, |
|
polygonEnd: function() { |
|
areaStream.lineStart = areaStream.lineEnd = areaStream.point = _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
|
areaSum.add(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(areaRingSum)); |
|
areaRingSum.reset(); |
|
}, |
|
result: function() { |
|
var area = areaSum / 2; |
|
areaSum.reset(); |
|
return area; |
|
} |
|
}; |
|
|
|
function areaRingStart() { |
|
areaStream.point = areaPointFirst; |
|
} |
|
|
|
function areaPointFirst(x, y) { |
|
areaStream.point = areaPoint; |
|
x00 = x0 = x, y00 = y0 = y; |
|
} |
|
|
|
function areaPoint(x, y) { |
|
areaRingSum.add(y0 * x - x0 * y); |
|
x0 = x, y0 = y; |
|
} |
|
|
|
function areaRingEnd() { |
|
areaPoint(x00, y00); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (areaStream); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/bounds.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/bounds.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
|
|
|
|
var x0 = Infinity, |
|
y0 = x0, |
|
x1 = -x0, |
|
y1 = x1; |
|
|
|
var boundsStream = { |
|
point: boundsPoint, |
|
lineStart: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
lineEnd: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
polygonStart: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
polygonEnd: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
result: function() { |
|
var bounds = [[x0, y0], [x1, y1]]; |
|
x1 = y1 = -(y0 = x0 = Infinity); |
|
return bounds; |
|
} |
|
}; |
|
|
|
function boundsPoint(x, y) { |
|
if (x < x0) x0 = x; |
|
if (x > x1) x1 = x; |
|
if (y < y0) y0 = y; |
|
if (y > y1) y1 = y; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (boundsStream); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/centroid.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/centroid.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
// TODO Enforce positive area for exterior, negative area for interior? |
|
|
|
var X0 = 0, |
|
Y0 = 0, |
|
Z0 = 0, |
|
X1 = 0, |
|
Y1 = 0, |
|
Z1 = 0, |
|
X2 = 0, |
|
Y2 = 0, |
|
Z2 = 0, |
|
x00, |
|
y00, |
|
x0, |
|
y0; |
|
|
|
var centroidStream = { |
|
point: centroidPoint, |
|
lineStart: centroidLineStart, |
|
lineEnd: centroidLineEnd, |
|
polygonStart: function() { |
|
centroidStream.lineStart = centroidRingStart; |
|
centroidStream.lineEnd = centroidRingEnd; |
|
}, |
|
polygonEnd: function() { |
|
centroidStream.point = centroidPoint; |
|
centroidStream.lineStart = centroidLineStart; |
|
centroidStream.lineEnd = centroidLineEnd; |
|
}, |
|
result: function() { |
|
var centroid = Z2 ? [X2 / Z2, Y2 / Z2] |
|
: Z1 ? [X1 / Z1, Y1 / Z1] |
|
: Z0 ? [X0 / Z0, Y0 / Z0] |
|
: [NaN, NaN]; |
|
X0 = Y0 = Z0 = |
|
X1 = Y1 = Z1 = |
|
X2 = Y2 = Z2 = 0; |
|
return centroid; |
|
} |
|
}; |
|
|
|
function centroidPoint(x, y) { |
|
X0 += x; |
|
Y0 += y; |
|
++Z0; |
|
} |
|
|
|
function centroidLineStart() { |
|
centroidStream.point = centroidPointFirstLine; |
|
} |
|
|
|
function centroidPointFirstLine(x, y) { |
|
centroidStream.point = centroidPointLine; |
|
centroidPoint(x0 = x, y0 = y); |
|
} |
|
|
|
function centroidPointLine(x, y) { |
|
var dx = x - x0, dy = y - y0, z = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(dx * dx + dy * dy); |
|
X1 += z * (x0 + x) / 2; |
|
Y1 += z * (y0 + y) / 2; |
|
Z1 += z; |
|
centroidPoint(x0 = x, y0 = y); |
|
} |
|
|
|
function centroidLineEnd() { |
|
centroidStream.point = centroidPoint; |
|
} |
|
|
|
function centroidRingStart() { |
|
centroidStream.point = centroidPointFirstRing; |
|
} |
|
|
|
function centroidRingEnd() { |
|
centroidPointRing(x00, y00); |
|
} |
|
|
|
function centroidPointFirstRing(x, y) { |
|
centroidStream.point = centroidPointRing; |
|
centroidPoint(x00 = x0 = x, y00 = y0 = y); |
|
} |
|
|
|
function centroidPointRing(x, y) { |
|
var dx = x - x0, |
|
dy = y - y0, |
|
z = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(dx * dx + dy * dy); |
|
|
|
X1 += z * (x0 + x) / 2; |
|
Y1 += z * (y0 + y) / 2; |
|
Z1 += z; |
|
|
|
z = y0 * x - x0 * y; |
|
X2 += z * (x0 + x); |
|
Y2 += z * (y0 + y); |
|
Z2 += z * 3; |
|
centroidPoint(x0 = x, y0 = y); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (centroidStream); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/context.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/context.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PathContext; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
|
|
|
|
|
|
function PathContext(context) { |
|
this._context = context; |
|
} |
|
|
|
PathContext.prototype = { |
|
_radius: 4.5, |
|
pointRadius: function(_) { |
|
return this._radius = _, this; |
|
}, |
|
polygonStart: function() { |
|
this._line = 0; |
|
}, |
|
polygonEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._line === 0) this._context.closePath(); |
|
this._point = NaN; |
|
}, |
|
point: function(x, y) { |
|
switch (this._point) { |
|
case 0: { |
|
this._context.moveTo(x, y); |
|
this._point = 1; |
|
break; |
|
} |
|
case 1: { |
|
this._context.lineTo(x, y); |
|
break; |
|
} |
|
default: { |
|
this._context.moveTo(x + this._radius, y); |
|
this._context.arc(x, y, this._radius, 0, _math_js__WEBPACK_IMPORTED_MODULE_0__["tau"]); |
|
break; |
|
} |
|
} |
|
}, |
|
result: _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/index.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/index.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../identity.js */ "../node_modules/d3-geo/src/identity.js"); |
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
/* harmony import */ var _area_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./area.js */ "../node_modules/d3-geo/src/path/area.js"); |
|
/* harmony import */ var _bounds_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bounds.js */ "../node_modules/d3-geo/src/path/bounds.js"); |
|
/* harmony import */ var _centroid_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./centroid.js */ "../node_modules/d3-geo/src/path/centroid.js"); |
|
/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./context.js */ "../node_modules/d3-geo/src/path/context.js"); |
|
/* harmony import */ var _measure_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./measure.js */ "../node_modules/d3-geo/src/path/measure.js"); |
|
/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./string.js */ "../node_modules/d3-geo/src/path/string.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(projection, context) { |
|
var pointRadius = 4.5, |
|
projectionStream, |
|
contextStream; |
|
|
|
function path(object) { |
|
if (object) { |
|
if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, projectionStream(contextStream)); |
|
} |
|
return contextStream.result(); |
|
} |
|
|
|
path.area = function(object) { |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, projectionStream(_area_js__WEBPACK_IMPORTED_MODULE_2__["default"])); |
|
return _area_js__WEBPACK_IMPORTED_MODULE_2__["default"].result(); |
|
}; |
|
|
|
path.measure = function(object) { |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, projectionStream(_measure_js__WEBPACK_IMPORTED_MODULE_6__["default"])); |
|
return _measure_js__WEBPACK_IMPORTED_MODULE_6__["default"].result(); |
|
}; |
|
|
|
path.bounds = function(object) { |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, projectionStream(_bounds_js__WEBPACK_IMPORTED_MODULE_3__["default"])); |
|
return _bounds_js__WEBPACK_IMPORTED_MODULE_3__["default"].result(); |
|
}; |
|
|
|
path.centroid = function(object) { |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, projectionStream(_centroid_js__WEBPACK_IMPORTED_MODULE_4__["default"])); |
|
return _centroid_js__WEBPACK_IMPORTED_MODULE_4__["default"].result(); |
|
}; |
|
|
|
path.projection = function(_) { |
|
return arguments.length ? (projectionStream = _ == null ? (projection = null, _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"]) : (projection = _).stream, path) : projection; |
|
}; |
|
|
|
path.context = function(_) { |
|
if (!arguments.length) return context; |
|
contextStream = _ == null ? (context = null, new _string_js__WEBPACK_IMPORTED_MODULE_7__["default"]) : new _context_js__WEBPACK_IMPORTED_MODULE_5__["default"](context = _); |
|
if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); |
|
return path; |
|
}; |
|
|
|
path.pointRadius = function(_) { |
|
if (!arguments.length) return pointRadius; |
|
pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); |
|
return path; |
|
}; |
|
|
|
return path.projection(projection).context(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/measure.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/measure.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _adder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../adder.js */ "../node_modules/d3-geo/src/adder.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-geo/src/noop.js"); |
|
|
|
|
|
|
|
|
|
var lengthSum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), |
|
lengthRing, |
|
x00, |
|
y00, |
|
x0, |
|
y0; |
|
|
|
var lengthStream = { |
|
point: _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
lineStart: function() { |
|
lengthStream.point = lengthPointFirst; |
|
}, |
|
lineEnd: function() { |
|
if (lengthRing) lengthPoint(x00, y00); |
|
lengthStream.point = _noop_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
|
}, |
|
polygonStart: function() { |
|
lengthRing = true; |
|
}, |
|
polygonEnd: function() { |
|
lengthRing = null; |
|
}, |
|
result: function() { |
|
var length = +lengthSum; |
|
lengthSum.reset(); |
|
return length; |
|
} |
|
}; |
|
|
|
function lengthPointFirst(x, y) { |
|
lengthStream.point = lengthPoint; |
|
x00 = x0 = x, y00 = y0 = y; |
|
} |
|
|
|
function lengthPoint(x, y) { |
|
x0 -= x, y0 -= y; |
|
lengthSum.add(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sqrt"])(x0 * x0 + y0 * y0)); |
|
x0 = x, y0 = y; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (lengthStream); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/path/string.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/path/string.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PathString; }); |
|
function PathString() { |
|
this._string = []; |
|
} |
|
|
|
PathString.prototype = { |
|
_radius: 4.5, |
|
_circle: circle(4.5), |
|
pointRadius: function(_) { |
|
if ((_ = +_) !== this._radius) this._radius = _, this._circle = null; |
|
return this; |
|
}, |
|
polygonStart: function() { |
|
this._line = 0; |
|
}, |
|
polygonEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._line === 0) this._string.push("Z"); |
|
this._point = NaN; |
|
}, |
|
point: function(x, y) { |
|
switch (this._point) { |
|
case 0: { |
|
this._string.push("M", x, ",", y); |
|
this._point = 1; |
|
break; |
|
} |
|
case 1: { |
|
this._string.push("L", x, ",", y); |
|
break; |
|
} |
|
default: { |
|
if (this._circle == null) this._circle = circle(this._radius); |
|
this._string.push("M", x, ",", y, this._circle); |
|
break; |
|
} |
|
} |
|
}, |
|
result: function() { |
|
if (this._string.length) { |
|
var result = this._string.join(""); |
|
this._string = []; |
|
return result; |
|
} else { |
|
return null; |
|
} |
|
} |
|
}; |
|
|
|
function circle(radius) { |
|
return "m0," + radius |
|
+ "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius |
|
+ "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius |
|
+ "z"; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/pointEqual.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/pointEqual.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(a[0] - b[0]) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"] && Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(a[1] - b[1]) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/polygonContains.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/polygonContains.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _adder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adder.js */ "../node_modules/d3-geo/src/adder.js"); |
|
/* harmony import */ var _cartesian_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cartesian.js */ "../node_modules/d3-geo/src/cartesian.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
|
|
var sum = Object(_adder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(); |
|
|
|
function longitude(point) { |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(point[0]) <= _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"]) |
|
return point[0]; |
|
else |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sign"])(point[0]) * ((Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(point[0]) + _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"]) % _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"] - _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"]); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(polygon, point) { |
|
var lambda = longitude(point), |
|
phi = point[1], |
|
sinPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(phi), |
|
normal = [Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(lambda), -Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(lambda), 0], |
|
angle = 0, |
|
winding = 0; |
|
|
|
sum.reset(); |
|
|
|
if (sinPhi === 1) phi = _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"] + _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]; |
|
else if (sinPhi === -1) phi = -_math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"] - _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]; |
|
|
|
for (var i = 0, n = polygon.length; i < n; ++i) { |
|
if (!(m = (ring = polygon[i]).length)) continue; |
|
var ring, |
|
m, |
|
point0 = ring[m - 1], |
|
lambda0 = longitude(point0), |
|
phi0 = point0[1] / 2 + _math_js__WEBPACK_IMPORTED_MODULE_2__["quarterPi"], |
|
sinPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(phi0), |
|
cosPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(phi0); |
|
|
|
for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) { |
|
var point1 = ring[j], |
|
lambda1 = longitude(point1), |
|
phi1 = point1[1] / 2 + _math_js__WEBPACK_IMPORTED_MODULE_2__["quarterPi"], |
|
sinPhi1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(phi1), |
|
cosPhi1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(phi1), |
|
delta = lambda1 - lambda0, |
|
sign = delta >= 0 ? 1 : -1, |
|
absDelta = sign * delta, |
|
antimeridian = absDelta > _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"], |
|
k = sinPhi0 * sinPhi1; |
|
|
|
sum.add(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(k * sign * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(absDelta), cosPhi0 * cosPhi1 + k * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(absDelta))); |
|
angle += antimeridian ? delta + sign * _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"] : delta; |
|
|
|
// Are the longitudes either side of the point’s meridian (lambda), |
|
// and are the latitudes smaller than the parallel (phi)? |
|
if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) { |
|
var arc = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_1__["cartesianCross"])(Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_1__["cartesian"])(point0), Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_1__["cartesian"])(point1)); |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_1__["cartesianNormalizeInPlace"])(arc); |
|
var intersection = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_1__["cartesianCross"])(normal, arc); |
|
Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_1__["cartesianNormalizeInPlace"])(intersection); |
|
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["asin"])(intersection[2]); |
|
if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) { |
|
winding += antimeridian ^ delta >= 0 ? 1 : -1; |
|
} |
|
} |
|
} |
|
} |
|
|
|
// First, determine whether the South pole is inside or outside: |
|
// |
|
// It is inside if: |
|
// * the polygon winds around it in a clockwise direction. |
|
// * the polygon does not (cumulatively) wind around it, but has a negative |
|
// (counter-clockwise) area. |
|
// |
|
// Second, count the (signed) number of times a segment crosses a lambda |
|
// from the point to the South pole. If it is zero, then the point is the |
|
// same side as the South pole. |
|
|
|
return (angle < -_math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"] || angle < _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"] && sum < -_math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) ^ (winding & 1); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/albers.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/albers.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _conicEqualArea_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./conicEqualArea.js */ "../node_modules/d3-geo/src/projection/conicEqualArea.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_conicEqualArea_js__WEBPACK_IMPORTED_MODULE_0__["default"])() |
|
.parallels([29.5, 45.5]) |
|
.scale(1070) |
|
.translate([480, 250]) |
|
.rotate([96, 0]) |
|
.center([-0.6, 38.7]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/albersUsa.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/albersUsa.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _albers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./albers.js */ "../node_modules/d3-geo/src/projection/albers.js"); |
|
/* harmony import */ var _conicEqualArea_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conicEqualArea.js */ "../node_modules/d3-geo/src/projection/conicEqualArea.js"); |
|
/* harmony import */ var _fit_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fit.js */ "../node_modules/d3-geo/src/projection/fit.js"); |
|
|
|
|
|
|
|
|
|
|
|
// The projections must have mutually exclusive clip regions on the sphere, |
|
// as this will avoid emitting interleaving lines and polygons. |
|
function multiplex(streams) { |
|
var n = streams.length; |
|
return { |
|
point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); }, |
|
sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); }, |
|
lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); }, |
|
lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); }, |
|
polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); }, |
|
polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); } |
|
}; |
|
} |
|
|
|
// A composite projection for the United States, configured by default for |
|
// 960×500. The projection also works quite well at 960×600 if you change the |
|
// scale to 1285 and adjust the translate accordingly. The set of standard |
|
// parallels for each region comes from USGS, which is published here: |
|
// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var cache, |
|
cacheStream, |
|
lower48 = Object(_albers_js__WEBPACK_IMPORTED_MODULE_1__["default"])(), lower48Point, |
|
alaska = Object(_conicEqualArea_js__WEBPACK_IMPORTED_MODULE_2__["default"])().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338 |
|
hawaii = Object(_conicEqualArea_js__WEBPACK_IMPORTED_MODULE_2__["default"])().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007 |
|
point, pointStream = {point: function(x, y) { point = [x, y]; }}; |
|
|
|
function albersUsa(coordinates) { |
|
var x = coordinates[0], y = coordinates[1]; |
|
return point = null, |
|
(lower48Point.point(x, y), point) |
|
|| (alaskaPoint.point(x, y), point) |
|
|| (hawaiiPoint.point(x, y), point); |
|
} |
|
|
|
albersUsa.invert = function(coordinates) { |
|
var k = lower48.scale(), |
|
t = lower48.translate(), |
|
x = (coordinates[0] - t[0]) / k, |
|
y = (coordinates[1] - t[1]) / k; |
|
return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska |
|
: y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii |
|
: lower48).invert(coordinates); |
|
}; |
|
|
|
albersUsa.stream = function(stream) { |
|
return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]); |
|
}; |
|
|
|
albersUsa.precision = function(_) { |
|
if (!arguments.length) return lower48.precision(); |
|
lower48.precision(_), alaska.precision(_), hawaii.precision(_); |
|
return reset(); |
|
}; |
|
|
|
albersUsa.scale = function(_) { |
|
if (!arguments.length) return lower48.scale(); |
|
lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_); |
|
return albersUsa.translate(lower48.translate()); |
|
}; |
|
|
|
albersUsa.translate = function(_) { |
|
if (!arguments.length) return lower48.translate(); |
|
var k = lower48.scale(), x = +_[0], y = +_[1]; |
|
|
|
lower48Point = lower48 |
|
.translate(_) |
|
.clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]]) |
|
.stream(pointStream); |
|
|
|
alaskaPoint = alaska |
|
.translate([x - 0.307 * k, y + 0.201 * k]) |
|
.clipExtent([[x - 0.425 * k + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"], y + 0.120 * k + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]], [x - 0.214 * k - _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"], y + 0.234 * k - _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]]]) |
|
.stream(pointStream); |
|
|
|
hawaiiPoint = hawaii |
|
.translate([x - 0.205 * k, y + 0.212 * k]) |
|
.clipExtent([[x - 0.214 * k + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"], y + 0.166 * k + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]], [x - 0.115 * k - _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"], y + 0.234 * k - _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]]]) |
|
.stream(pointStream); |
|
|
|
return reset(); |
|
}; |
|
|
|
albersUsa.fitExtent = function(extent, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitExtent"])(albersUsa, extent, object); |
|
}; |
|
|
|
albersUsa.fitSize = function(size, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitSize"])(albersUsa, size, object); |
|
}; |
|
|
|
albersUsa.fitWidth = function(width, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitWidth"])(albersUsa, width, object); |
|
}; |
|
|
|
albersUsa.fitHeight = function(height, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitHeight"])(albersUsa, height, object); |
|
}; |
|
|
|
function reset() { |
|
cache = cacheStream = null; |
|
return albersUsa; |
|
} |
|
|
|
return albersUsa.scale(1070); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/azimuthal.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/azimuthal.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: azimuthalRaw, azimuthalInvert */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "azimuthalRaw", function() { return azimuthalRaw; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "azimuthalInvert", function() { return azimuthalInvert; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
function azimuthalRaw(scale) { |
|
return function(x, y) { |
|
var cx = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(x), |
|
cy = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y), |
|
k = scale(cx * cy); |
|
return [ |
|
k * cy * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x), |
|
k * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y) |
|
]; |
|
} |
|
} |
|
|
|
function azimuthalInvert(angle) { |
|
return function(x, y) { |
|
var z = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(x * x + y * y), |
|
c = angle(z), |
|
sc = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(c), |
|
cc = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(c); |
|
return [ |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(x * sc, z * cc), |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(z && y * sc / z) |
|
]; |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/azimuthalEqualArea.js": |
|
/*!*******************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/azimuthalEqualArea.js ***! |
|
\*******************************************************************/ |
|
/*! exports provided: azimuthalEqualAreaRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "azimuthalEqualAreaRaw", function() { return azimuthalEqualAreaRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _azimuthal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./azimuthal.js */ "../node_modules/d3-geo/src/projection/azimuthal.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
|
|
var azimuthalEqualAreaRaw = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalRaw"])(function(cxcy) { |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(2 / (1 + cxcy)); |
|
}); |
|
|
|
azimuthalEqualAreaRaw.invert = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalInvert"])(function(z) { |
|
return 2 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(z / 2); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(azimuthalEqualAreaRaw) |
|
.scale(124.75) |
|
.clipAngle(180 - 1e-3); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/azimuthalEquidistant.js": |
|
/*!*********************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/azimuthalEquidistant.js ***! |
|
\*********************************************************************/ |
|
/*! exports provided: azimuthalEquidistantRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "azimuthalEquidistantRaw", function() { return azimuthalEquidistantRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _azimuthal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./azimuthal.js */ "../node_modules/d3-geo/src/projection/azimuthal.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
|
|
var azimuthalEquidistantRaw = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalRaw"])(function(c) { |
|
return (c = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["acos"])(c)) && c / Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(c); |
|
}); |
|
|
|
azimuthalEquidistantRaw.invert = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalInvert"])(function(z) { |
|
return z; |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(azimuthalEquidistantRaw) |
|
.scale(79.4188) |
|
.clipAngle(180 - 1e-3); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/conic.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/conic.js ***! |
|
\******************************************************/ |
|
/*! exports provided: conicProjection */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conicProjection", function() { return conicProjection; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
function conicProjection(projectAt) { |
|
var phi0 = 0, |
|
phi1 = _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] / 3, |
|
m = Object(_index_js__WEBPACK_IMPORTED_MODULE_1__["projectionMutator"])(projectAt), |
|
p = m(phi0, phi1); |
|
|
|
p.parallels = function(_) { |
|
return arguments.length ? m(phi0 = _[0] * _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"], phi1 = _[1] * _math_js__WEBPACK_IMPORTED_MODULE_0__["radians"]) : [phi0 * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"], phi1 * _math_js__WEBPACK_IMPORTED_MODULE_0__["degrees"]]; |
|
}; |
|
|
|
return p; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/conicConformal.js": |
|
/*!***************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/conicConformal.js ***! |
|
\***************************************************************/ |
|
/*! exports provided: conicConformalRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conicConformalRaw", function() { return conicConformalRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _conic_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conic.js */ "../node_modules/d3-geo/src/projection/conic.js"); |
|
/* harmony import */ var _mercator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mercator.js */ "../node_modules/d3-geo/src/projection/mercator.js"); |
|
|
|
|
|
|
|
|
|
function tany(y) { |
|
return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tan"])((_math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] + y) / 2); |
|
} |
|
|
|
function conicConformalRaw(y0, y1) { |
|
var cy0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y0), |
|
n = y0 === y1 ? Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y0) : Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["log"])(cy0 / Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y1)) / Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["log"])(tany(y1) / tany(y0)), |
|
f = cy0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["pow"])(tany(y0), n) / n; |
|
|
|
if (!n) return _mercator_js__WEBPACK_IMPORTED_MODULE_2__["mercatorRaw"]; |
|
|
|
function project(x, y) { |
|
if (f > 0) { if (y < -_math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) y = -_math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]; } |
|
else { if (y > _math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] - _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) y = _math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] - _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]; } |
|
var r = f / Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["pow"])(tany(y), n); |
|
return [r * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(n * x), f - r * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(n * x)]; |
|
} |
|
|
|
project.invert = function(x, y) { |
|
var fy = f - y, r = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(n) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(x * x + fy * fy), |
|
l = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(x, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(fy)) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(fy); |
|
if (fy * n < 0) |
|
l -= _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(x) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(fy); |
|
return [l / n, 2 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["pow"])(f / r, 1 / n)) - _math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"]]; |
|
}; |
|
|
|
return project; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_conic_js__WEBPACK_IMPORTED_MODULE_1__["conicProjection"])(conicConformalRaw) |
|
.scale(109.5) |
|
.parallels([30, 30]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/conicEqualArea.js": |
|
/*!***************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/conicEqualArea.js ***! |
|
\***************************************************************/ |
|
/*! exports provided: conicEqualAreaRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conicEqualAreaRaw", function() { return conicEqualAreaRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _conic_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conic.js */ "../node_modules/d3-geo/src/projection/conic.js"); |
|
/* harmony import */ var _cylindricalEqualArea_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cylindricalEqualArea.js */ "../node_modules/d3-geo/src/projection/cylindricalEqualArea.js"); |
|
|
|
|
|
|
|
|
|
function conicEqualAreaRaw(y0, y1) { |
|
var sy0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y0), n = (sy0 + Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y1)) / 2; |
|
|
|
// Are the parallels symmetrical around the Equator? |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(n) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) return Object(_cylindricalEqualArea_js__WEBPACK_IMPORTED_MODULE_2__["cylindricalEqualAreaRaw"])(y0); |
|
|
|
var c = 1 + sy0 * (2 * n - sy0), r0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(c) / n; |
|
|
|
function project(x, y) { |
|
var r = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(c - 2 * n * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y)) / n; |
|
return [r * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x *= n), r0 - r * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(x)]; |
|
} |
|
|
|
project.invert = function(x, y) { |
|
var r0y = r0 - y, |
|
l = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(x, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(r0y)) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(r0y); |
|
if (r0y * n < 0) |
|
l -= _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(x) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(r0y); |
|
return [l / n, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])((c - (x * x + r0y * r0y) * n * n) / (2 * n))]; |
|
}; |
|
|
|
return project; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_conic_js__WEBPACK_IMPORTED_MODULE_1__["conicProjection"])(conicEqualAreaRaw) |
|
.scale(155.424) |
|
.center([0, 33.6442]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/conicEquidistant.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/conicEquidistant.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: conicEquidistantRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conicEquidistantRaw", function() { return conicEquidistantRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _conic_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conic.js */ "../node_modules/d3-geo/src/projection/conic.js"); |
|
/* harmony import */ var _equirectangular_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./equirectangular.js */ "../node_modules/d3-geo/src/projection/equirectangular.js"); |
|
|
|
|
|
|
|
|
|
function conicEquidistantRaw(y0, y1) { |
|
var cy0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y0), |
|
n = y0 === y1 ? Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y0) : (cy0 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y1)) / (y1 - y0), |
|
g = cy0 / n + y0; |
|
|
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(n) < _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) return _equirectangular_js__WEBPACK_IMPORTED_MODULE_2__["equirectangularRaw"]; |
|
|
|
function project(x, y) { |
|
var gy = g - y, nx = n * x; |
|
return [gy * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(nx), g - gy * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(nx)]; |
|
} |
|
|
|
project.invert = function(x, y) { |
|
var gy = g - y, |
|
l = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan2"])(x, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["abs"])(gy)) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(gy); |
|
if (gy * n < 0) |
|
l -= _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(x) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(gy); |
|
return [l / n, g - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sign"])(n) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sqrt"])(x * x + gy * gy)]; |
|
}; |
|
|
|
return project; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_conic_js__WEBPACK_IMPORTED_MODULE_1__["conicProjection"])(conicEquidistantRaw) |
|
.scale(131.154) |
|
.center([0, 13.9389]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/cylindricalEqualArea.js": |
|
/*!*********************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/cylindricalEqualArea.js ***! |
|
\*********************************************************************/ |
|
/*! exports provided: cylindricalEqualAreaRaw */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cylindricalEqualAreaRaw", function() { return cylindricalEqualAreaRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
function cylindricalEqualAreaRaw(phi0) { |
|
var cosPhi0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(phi0); |
|
|
|
function forward(lambda, phi) { |
|
return [lambda * cosPhi0, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(phi) / cosPhi0]; |
|
} |
|
|
|
forward.invert = function(x, y) { |
|
return [x / cosPhi0, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"])(y * cosPhi0)]; |
|
}; |
|
|
|
return forward; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/equalEarth.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/equalEarth.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: equalEarthRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalEarthRaw", function() { return equalEarthRaw; }); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
var A1 = 1.340264, |
|
A2 = -0.081106, |
|
A3 = 0.000893, |
|
A4 = 0.003796, |
|
M = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sqrt"])(3) / 2, |
|
iterations = 12; |
|
|
|
function equalEarthRaw(lambda, phi) { |
|
var l = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["asin"])(M * Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi)), l2 = l * l, l6 = l2 * l2 * l2; |
|
return [ |
|
lambda * Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))), |
|
l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) |
|
]; |
|
} |
|
|
|
equalEarthRaw.invert = function(x, y) { |
|
var l = y, l2 = l * l, l6 = l2 * l2 * l2; |
|
for (var i = 0, delta, fy, fpy; i < iterations; ++i) { |
|
fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y; |
|
fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2); |
|
l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2; |
|
if (Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(delta) < _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon2"]) break; |
|
} |
|
return [ |
|
M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(l), |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["asin"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(l) / M) |
|
]; |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(equalEarthRaw) |
|
.scale(177.158); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/equirectangular.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/equirectangular.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: equirectangularRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equirectangularRaw", function() { return equirectangularRaw; }); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
function equirectangularRaw(lambda, phi) { |
|
return [lambda, phi]; |
|
} |
|
|
|
equirectangularRaw.invert = equirectangularRaw; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(equirectangularRaw) |
|
.scale(152.63); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/fit.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/fit.js ***! |
|
\****************************************************/ |
|
/*! exports provided: fitExtent, fitSize, fitWidth, fitHeight */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fitExtent", function() { return fitExtent; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fitSize", function() { return fitSize; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fitWidth", function() { return fitWidth; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fitHeight", function() { return fitHeight; }); |
|
/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../stream.js */ "../node_modules/d3-geo/src/stream.js"); |
|
/* harmony import */ var _path_bounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../path/bounds.js */ "../node_modules/d3-geo/src/path/bounds.js"); |
|
|
|
|
|
|
|
function fit(projection, fitBounds, object) { |
|
var clip = projection.clipExtent && projection.clipExtent(); |
|
projection.scale(150).translate([0, 0]); |
|
if (clip != null) projection.clipExtent(null); |
|
Object(_stream_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, projection.stream(_path_bounds_js__WEBPACK_IMPORTED_MODULE_1__["default"])); |
|
fitBounds(_path_bounds_js__WEBPACK_IMPORTED_MODULE_1__["default"].result()); |
|
if (clip != null) projection.clipExtent(clip); |
|
return projection; |
|
} |
|
|
|
function fitExtent(projection, extent, object) { |
|
return fit(projection, function(b) { |
|
var w = extent[1][0] - extent[0][0], |
|
h = extent[1][1] - extent[0][1], |
|
k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])), |
|
x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2, |
|
y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2; |
|
projection.scale(150 * k).translate([x, y]); |
|
}, object); |
|
} |
|
|
|
function fitSize(projection, size, object) { |
|
return fitExtent(projection, [[0, 0], size], object); |
|
} |
|
|
|
function fitWidth(projection, width, object) { |
|
return fit(projection, function(b) { |
|
var w = +width, |
|
k = w / (b[1][0] - b[0][0]), |
|
x = (w - k * (b[1][0] + b[0][0])) / 2, |
|
y = -k * b[0][1]; |
|
projection.scale(150 * k).translate([x, y]); |
|
}, object); |
|
} |
|
|
|
function fitHeight(projection, height, object) { |
|
return fit(projection, function(b) { |
|
var h = +height, |
|
k = h / (b[1][1] - b[0][1]), |
|
x = -k * b[0][0], |
|
y = (h - k * (b[1][1] + b[0][1])) / 2; |
|
projection.scale(150 * k).translate([x, y]); |
|
}, object); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/gnomonic.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/gnomonic.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: gnomonicRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gnomonicRaw", function() { return gnomonicRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _azimuthal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./azimuthal.js */ "../node_modules/d3-geo/src/projection/azimuthal.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
|
|
function gnomonicRaw(x, y) { |
|
var cy = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y), k = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(x) * cy; |
|
return [cy * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x) / k, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y) / k]; |
|
} |
|
|
|
gnomonicRaw.invert = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalInvert"])(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(gnomonicRaw) |
|
.scale(144.049) |
|
.clipAngle(60); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/identity.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/identity.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _clip_rectangle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../clip/rectangle.js */ "../node_modules/d3-geo/src/clip/rectangle.js"); |
|
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../identity.js */ "../node_modules/d3-geo/src/identity.js"); |
|
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../transform.js */ "../node_modules/d3-geo/src/transform.js"); |
|
/* harmony import */ var _fit_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fit.js */ "../node_modules/d3-geo/src/projection/fit.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect |
|
alpha = 0, ca, sa, // angle |
|
x0 = null, y0, x1, y1, // clip extent |
|
kx = 1, ky = 1, |
|
transform = Object(_transform_js__WEBPACK_IMPORTED_MODULE_2__["transformer"])({ |
|
point: function(x, y) { |
|
var p = projection([x, y]) |
|
this.stream.point(p[0], p[1]); |
|
} |
|
}), |
|
postclip = _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
cache, |
|
cacheStream; |
|
|
|
function reset() { |
|
kx = k * sx; |
|
ky = k * sy; |
|
cache = cacheStream = null; |
|
return projection; |
|
} |
|
|
|
function projection (p) { |
|
var x = p[0] * kx, y = p[1] * ky; |
|
if (alpha) { |
|
var t = y * ca - x * sa; |
|
x = x * ca + y * sa; |
|
y = t; |
|
} |
|
return [x + tx, y + ty]; |
|
} |
|
projection.invert = function(p) { |
|
var x = p[0] - tx, y = p[1] - ty; |
|
if (alpha) { |
|
var t = y * ca + x * sa; |
|
x = x * ca - y * sa; |
|
y = t; |
|
} |
|
return [x / kx, y / ky]; |
|
}; |
|
projection.stream = function(stream) { |
|
return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream)); |
|
}; |
|
projection.postclip = function(_) { |
|
return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip; |
|
}; |
|
projection.clipExtent = function(_) { |
|
return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"]) : Object(_clip_rectangle_js__WEBPACK_IMPORTED_MODULE_0__["default"])(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]]; |
|
}; |
|
projection.scale = function(_) { |
|
return arguments.length ? (k = +_, reset()) : k; |
|
}; |
|
projection.translate = function(_) { |
|
return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty]; |
|
} |
|
projection.angle = function(_) { |
|
return arguments.length ? (alpha = _ % 360 * _math_js__WEBPACK_IMPORTED_MODULE_4__["radians"], sa = Object(_math_js__WEBPACK_IMPORTED_MODULE_4__["sin"])(alpha), ca = Object(_math_js__WEBPACK_IMPORTED_MODULE_4__["cos"])(alpha), reset()) : alpha * _math_js__WEBPACK_IMPORTED_MODULE_4__["degrees"]; |
|
}; |
|
projection.reflectX = function(_) { |
|
return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0; |
|
}; |
|
projection.reflectY = function(_) { |
|
return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0; |
|
}; |
|
projection.fitExtent = function(extent, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitExtent"])(projection, extent, object); |
|
}; |
|
projection.fitSize = function(size, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitSize"])(projection, size, object); |
|
}; |
|
projection.fitWidth = function(width, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitWidth"])(projection, width, object); |
|
}; |
|
projection.fitHeight = function(height, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_3__["fitHeight"])(projection, height, object); |
|
}; |
|
|
|
return projection; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/index.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/index.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default, projectionMutator */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return projection; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "projectionMutator", function() { return projectionMutator; }); |
|
/* harmony import */ var _clip_antimeridian_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../clip/antimeridian.js */ "../node_modules/d3-geo/src/clip/antimeridian.js"); |
|
/* harmony import */ var _clip_circle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../clip/circle.js */ "../node_modules/d3-geo/src/clip/circle.js"); |
|
/* harmony import */ var _clip_rectangle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../clip/rectangle.js */ "../node_modules/d3-geo/src/clip/rectangle.js"); |
|
/* harmony import */ var _compose_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../compose.js */ "../node_modules/d3-geo/src/compose.js"); |
|
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../identity.js */ "../node_modules/d3-geo/src/identity.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _rotation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../rotation.js */ "../node_modules/d3-geo/src/rotation.js"); |
|
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../transform.js */ "../node_modules/d3-geo/src/transform.js"); |
|
/* harmony import */ var _fit_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./fit.js */ "../node_modules/d3-geo/src/projection/fit.js"); |
|
/* harmony import */ var _resample_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./resample.js */ "../node_modules/d3-geo/src/projection/resample.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var transformRadians = Object(_transform_js__WEBPACK_IMPORTED_MODULE_7__["transformer"])({ |
|
point: function(x, y) { |
|
this.stream.point(x * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], y * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"]); |
|
} |
|
}); |
|
|
|
function transformRotate(rotate) { |
|
return Object(_transform_js__WEBPACK_IMPORTED_MODULE_7__["transformer"])({ |
|
point: function(x, y) { |
|
var r = rotate(x, y); |
|
return this.stream.point(r[0], r[1]); |
|
} |
|
}); |
|
} |
|
|
|
function scaleTranslate(k, dx, dy, sx, sy) { |
|
function transform(x, y) { |
|
x *= sx; y *= sy; |
|
return [dx + k * x, dy - k * y]; |
|
} |
|
transform.invert = function(x, y) { |
|
return [(x - dx) / k * sx, (dy - y) / k * sy]; |
|
}; |
|
return transform; |
|
} |
|
|
|
function scaleTranslateRotate(k, dx, dy, sx, sy, alpha) { |
|
var cosAlpha = Object(_math_js__WEBPACK_IMPORTED_MODULE_5__["cos"])(alpha), |
|
sinAlpha = Object(_math_js__WEBPACK_IMPORTED_MODULE_5__["sin"])(alpha), |
|
a = cosAlpha * k, |
|
b = sinAlpha * k, |
|
ai = cosAlpha / k, |
|
bi = sinAlpha / k, |
|
ci = (sinAlpha * dy - cosAlpha * dx) / k, |
|
fi = (sinAlpha * dx + cosAlpha * dy) / k; |
|
function transform(x, y) { |
|
x *= sx; y *= sy; |
|
return [a * x - b * y + dx, dy - b * x - a * y]; |
|
} |
|
transform.invert = function(x, y) { |
|
return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)]; |
|
}; |
|
return transform; |
|
} |
|
|
|
function projection(project) { |
|
return projectionMutator(function() { return project; })(); |
|
} |
|
|
|
function projectionMutator(projectAt) { |
|
var project, |
|
k = 150, // scale |
|
x = 480, y = 250, // translate |
|
lambda = 0, phi = 0, // center |
|
deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate |
|
alpha = 0, // post-rotate angle |
|
sx = 1, // reflectX |
|
sy = 1, // reflectX |
|
theta = null, preclip = _clip_antimeridian_js__WEBPACK_IMPORTED_MODULE_0__["default"], // pre-clip angle |
|
x0 = null, y0, x1, y1, postclip = _identity_js__WEBPACK_IMPORTED_MODULE_4__["default"], // post-clip extent |
|
delta2 = 0.5, // precision |
|
projectResample, |
|
projectTransform, |
|
projectRotateTransform, |
|
cache, |
|
cacheStream; |
|
|
|
function projection(point) { |
|
return projectRotateTransform(point[0] * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], point[1] * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"]); |
|
} |
|
|
|
function invert(point) { |
|
point = projectRotateTransform.invert(point[0], point[1]); |
|
return point && [point[0] * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"], point[1] * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"]]; |
|
} |
|
|
|
projection.stream = function(stream) { |
|
return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream))))); |
|
}; |
|
|
|
projection.preclip = function(_) { |
|
return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip; |
|
}; |
|
|
|
projection.postclip = function(_) { |
|
return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip; |
|
}; |
|
|
|
projection.clipAngle = function(_) { |
|
return arguments.length ? (preclip = +_ ? Object(_clip_circle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(theta = _ * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"]) : (theta = null, _clip_antimeridian_js__WEBPACK_IMPORTED_MODULE_0__["default"]), reset()) : theta * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"]; |
|
}; |
|
|
|
projection.clipExtent = function(_) { |
|
return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, _identity_js__WEBPACK_IMPORTED_MODULE_4__["default"]) : Object(_clip_rectangle_js__WEBPACK_IMPORTED_MODULE_2__["default"])(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]]; |
|
}; |
|
|
|
projection.scale = function(_) { |
|
return arguments.length ? (k = +_, recenter()) : k; |
|
}; |
|
|
|
projection.translate = function(_) { |
|
return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y]; |
|
}; |
|
|
|
projection.center = function(_) { |
|
return arguments.length ? (lambda = _[0] % 360 * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], phi = _[1] % 360 * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], recenter()) : [lambda * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"], phi * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"]]; |
|
}; |
|
|
|
projection.rotate = function(_) { |
|
return arguments.length ? (deltaLambda = _[0] % 360 * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], deltaPhi = _[1] % 360 * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], deltaGamma = _.length > 2 ? _[2] % 360 * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"] : 0, recenter()) : [deltaLambda * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"], deltaPhi * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"], deltaGamma * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"]]; |
|
}; |
|
|
|
projection.angle = function(_) { |
|
return arguments.length ? (alpha = _ % 360 * _math_js__WEBPACK_IMPORTED_MODULE_5__["radians"], recenter()) : alpha * _math_js__WEBPACK_IMPORTED_MODULE_5__["degrees"]; |
|
}; |
|
|
|
projection.reflectX = function(_) { |
|
return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0; |
|
}; |
|
|
|
projection.reflectY = function(_) { |
|
return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0; |
|
}; |
|
|
|
projection.precision = function(_) { |
|
return arguments.length ? (projectResample = Object(_resample_js__WEBPACK_IMPORTED_MODULE_9__["default"])(projectTransform, delta2 = _ * _), reset()) : Object(_math_js__WEBPACK_IMPORTED_MODULE_5__["sqrt"])(delta2); |
|
}; |
|
|
|
projection.fitExtent = function(extent, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_8__["fitExtent"])(projection, extent, object); |
|
}; |
|
|
|
projection.fitSize = function(size, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_8__["fitSize"])(projection, size, object); |
|
}; |
|
|
|
projection.fitWidth = function(width, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_8__["fitWidth"])(projection, width, object); |
|
}; |
|
|
|
projection.fitHeight = function(height, object) { |
|
return Object(_fit_js__WEBPACK_IMPORTED_MODULE_8__["fitHeight"])(projection, height, object); |
|
}; |
|
|
|
function recenter() { |
|
var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), |
|
transform = (alpha ? scaleTranslateRotate : scaleTranslate)(k, x - center[0], y - center[1], sx, sy, alpha); |
|
rotate = Object(_rotation_js__WEBPACK_IMPORTED_MODULE_6__["rotateRadians"])(deltaLambda, deltaPhi, deltaGamma); |
|
projectTransform = Object(_compose_js__WEBPACK_IMPORTED_MODULE_3__["default"])(project, transform); |
|
projectRotateTransform = Object(_compose_js__WEBPACK_IMPORTED_MODULE_3__["default"])(rotate, projectTransform); |
|
projectResample = Object(_resample_js__WEBPACK_IMPORTED_MODULE_9__["default"])(projectTransform, delta2); |
|
return reset(); |
|
} |
|
|
|
function reset() { |
|
cache = cacheStream = null; |
|
return projection; |
|
} |
|
|
|
return function() { |
|
project = projectAt.apply(this, arguments); |
|
projection.invert = project.invert && invert; |
|
return recenter(); |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/mercator.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/mercator.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: mercatorRaw, default, mercatorProjection */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mercatorRaw", function() { return mercatorRaw; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mercatorProjection", function() { return mercatorProjection; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _rotation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rotation.js */ "../node_modules/d3-geo/src/rotation.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
|
|
function mercatorRaw(lambda, phi) { |
|
return [lambda, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["log"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tan"])((_math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] + phi) / 2))]; |
|
} |
|
|
|
mercatorRaw.invert = function(x, y) { |
|
return [x, 2 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["exp"])(y)) - _math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"]]; |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return mercatorProjection(mercatorRaw) |
|
.scale(961 / _math_js__WEBPACK_IMPORTED_MODULE_0__["tau"]); |
|
}); |
|
|
|
function mercatorProjection(project) { |
|
var m = Object(_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(project), |
|
center = m.center, |
|
scale = m.scale, |
|
translate = m.translate, |
|
clipExtent = m.clipExtent, |
|
x0 = null, y0, x1, y1; // clip extent |
|
|
|
m.scale = function(_) { |
|
return arguments.length ? (scale(_), reclip()) : scale(); |
|
}; |
|
|
|
m.translate = function(_) { |
|
return arguments.length ? (translate(_), reclip()) : translate(); |
|
}; |
|
|
|
m.center = function(_) { |
|
return arguments.length ? (center(_), reclip()) : center(); |
|
}; |
|
|
|
m.clipExtent = function(_) { |
|
return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]]; |
|
}; |
|
|
|
function reclip() { |
|
var k = _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] * scale(), |
|
t = m(Object(_rotation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(m.rotate()).invert([0, 0])); |
|
return clipExtent(x0 == null |
|
? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw |
|
? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]] |
|
: [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]); |
|
} |
|
|
|
return reclip(); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/naturalEarth1.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/naturalEarth1.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: naturalEarth1Raw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "naturalEarth1Raw", function() { return naturalEarth1Raw; }); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
function naturalEarth1Raw(lambda, phi) { |
|
var phi2 = phi * phi, phi4 = phi2 * phi2; |
|
return [ |
|
lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))), |
|
phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) |
|
]; |
|
} |
|
|
|
naturalEarth1Raw.invert = function(x, y) { |
|
var phi = y, i = 25, delta; |
|
do { |
|
var phi2 = phi * phi, phi4 = phi2 * phi2; |
|
phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) / |
|
(1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4))); |
|
} while (Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(delta) > _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"] && --i > 0); |
|
return [ |
|
x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))), |
|
phi |
|
]; |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(naturalEarth1Raw) |
|
.scale(175.295); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/orthographic.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/orthographic.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: orthographicRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "orthographicRaw", function() { return orthographicRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _azimuthal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./azimuthal.js */ "../node_modules/d3-geo/src/projection/azimuthal.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
|
|
function orthographicRaw(x, y) { |
|
return [Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y) * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x), Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y)]; |
|
} |
|
|
|
orthographicRaw.invert = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalInvert"])(_math_js__WEBPACK_IMPORTED_MODULE_0__["asin"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(orthographicRaw) |
|
.scale(249.5) |
|
.clipAngle(90 + _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/resample.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/resample.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _cartesian_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cartesian.js */ "../node_modules/d3-geo/src/cartesian.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../transform.js */ "../node_modules/d3-geo/src/transform.js"); |
|
|
|
|
|
|
|
|
|
var maxDepth = 16, // maximum depth of subdivision |
|
cosMinDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(30 * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]); // cos(minimum angular distance) |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(project, delta2) { |
|
return +delta2 ? resample(project, delta2) : resampleNone(project); |
|
}); |
|
|
|
function resampleNone(project) { |
|
return Object(_transform_js__WEBPACK_IMPORTED_MODULE_2__["transformer"])({ |
|
point: function(x, y) { |
|
x = project(x, y); |
|
this.stream.point(x[0], x[1]); |
|
} |
|
}); |
|
} |
|
|
|
function resample(project, delta2) { |
|
|
|
function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) { |
|
var dx = x1 - x0, |
|
dy = y1 - y0, |
|
d2 = dx * dx + dy * dy; |
|
if (d2 > 4 * delta2 && depth--) { |
|
var a = a0 + a1, |
|
b = b0 + b1, |
|
c = c0 + c1, |
|
m = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sqrt"])(a * a + b * b + c * c), |
|
phi2 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["asin"])(c /= m), |
|
lambda2 = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(c) - 1) < _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"] || Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(lambda0 - lambda1) < _math_js__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? (lambda0 + lambda1) / 2 : Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["atan2"])(b, a), |
|
p = project(lambda2, phi2), |
|
x2 = p[0], |
|
y2 = p[1], |
|
dx2 = x2 - x0, |
|
dy2 = y2 - y0, |
|
dz = dy * dx2 - dx * dy2; |
|
if (dz * dz / d2 > delta2 // perpendicular projected distance |
|
|| Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end |
|
|| a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance |
|
resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream); |
|
stream.point(x2, y2); |
|
resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream); |
|
} |
|
} |
|
} |
|
return function(stream) { |
|
var lambda00, x00, y00, a00, b00, c00, // first point |
|
lambda0, x0, y0, a0, b0, c0; // previous point |
|
|
|
var resampleStream = { |
|
point: point, |
|
lineStart: lineStart, |
|
lineEnd: lineEnd, |
|
polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; }, |
|
polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; } |
|
}; |
|
|
|
function point(x, y) { |
|
x = project(x, y); |
|
stream.point(x[0], x[1]); |
|
} |
|
|
|
function lineStart() { |
|
x0 = NaN; |
|
resampleStream.point = linePoint; |
|
stream.lineStart(); |
|
} |
|
|
|
function linePoint(lambda, phi) { |
|
var c = Object(_cartesian_js__WEBPACK_IMPORTED_MODULE_0__["cartesian"])([lambda, phi]), p = project(lambda, phi); |
|
resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); |
|
stream.point(x0, y0); |
|
} |
|
|
|
function lineEnd() { |
|
resampleStream.point = point; |
|
stream.lineEnd(); |
|
} |
|
|
|
function ringStart() { |
|
lineStart(); |
|
resampleStream.point = ringPoint; |
|
resampleStream.lineEnd = ringEnd; |
|
} |
|
|
|
function ringPoint(lambda, phi) { |
|
linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; |
|
resampleStream.point = linePoint; |
|
} |
|
|
|
function ringEnd() { |
|
resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream); |
|
resampleStream.lineEnd = lineEnd; |
|
lineEnd(); |
|
} |
|
|
|
return resampleStream; |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/stereographic.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/stereographic.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: stereographicRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stereographicRaw", function() { return stereographicRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _azimuthal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./azimuthal.js */ "../node_modules/d3-geo/src/projection/azimuthal.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-geo/src/projection/index.js"); |
|
|
|
|
|
|
|
|
|
function stereographicRaw(x, y) { |
|
var cy = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(y), k = 1 + Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["cos"])(x) * cy; |
|
return [cy * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(x) / k, Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["sin"])(y) / k]; |
|
} |
|
|
|
stereographicRaw.invert = Object(_azimuthal_js__WEBPACK_IMPORTED_MODULE_1__["azimuthalInvert"])(function(z) { |
|
return 2 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan"])(z); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Object(_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(stereographicRaw) |
|
.scale(250) |
|
.clipAngle(142); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/projection/transverseMercator.js": |
|
/*!*******************************************************************!*\ |
|
!*** ../node_modules/d3-geo/src/projection/transverseMercator.js ***! |
|
\*******************************************************************/ |
|
/*! exports provided: transverseMercatorRaw, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transverseMercatorRaw", function() { return transverseMercatorRaw; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-geo/src/math.js"); |
|
/* harmony import */ var _mercator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mercator.js */ "../node_modules/d3-geo/src/projection/mercator.js"); |
|
|
|
|
|
|
|
function transverseMercatorRaw(lambda, phi) { |
|
return [Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["log"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["tan"])((_math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"] + phi) / 2)), -lambda]; |
|
} |
|
|
|
transverseMercatorRaw.invert = function(x, y) { |
|
return [-y, 2 * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["atan"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__["exp"])(x)) - _math_js__WEBPACK_IMPORTED_MODULE_0__["halfPi"]]; |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var m = Object(_mercator_js__WEBPACK_IMPORTED_MODULE_1__["mercatorProjection"])(transverseMercatorRaw), |
|
center = m.center, |
|
rotate = m.rotate; |
|
|
|
m.center = function(_) { |
|
return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]); |
|
}; |
|
|
|
m.rotate = function(_) { |
|
return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]); |
|
}; |
|
|
|
return rotate([0, 0, 90]) |
|
.scale(159.155); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/rotation.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/rotation.js ***! |
|
\**********************************************/ |
|
/*! exports provided: rotateRadians, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rotateRadians", function() { return rotateRadians; }); |
|
/* harmony import */ var _compose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compose.js */ "../node_modules/d3-geo/src/compose.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-geo/src/math.js"); |
|
|
|
|
|
|
|
function rotationIdentity(lambda, phi) { |
|
return [Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["abs"])(lambda) > _math_js__WEBPACK_IMPORTED_MODULE_1__["pi"] ? lambda + Math.round(-lambda / _math_js__WEBPACK_IMPORTED_MODULE_1__["tau"]) * _math_js__WEBPACK_IMPORTED_MODULE_1__["tau"] : lambda, phi]; |
|
} |
|
|
|
rotationIdentity.invert = rotationIdentity; |
|
|
|
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) { |
|
return (deltaLambda %= _math_js__WEBPACK_IMPORTED_MODULE_1__["tau"]) ? (deltaPhi || deltaGamma ? Object(_compose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) |
|
: rotationLambda(deltaLambda)) |
|
: (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) |
|
: rotationIdentity); |
|
} |
|
|
|
function forwardRotationLambda(deltaLambda) { |
|
return function(lambda, phi) { |
|
return lambda += deltaLambda, [lambda > _math_js__WEBPACK_IMPORTED_MODULE_1__["pi"] ? lambda - _math_js__WEBPACK_IMPORTED_MODULE_1__["tau"] : lambda < -_math_js__WEBPACK_IMPORTED_MODULE_1__["pi"] ? lambda + _math_js__WEBPACK_IMPORTED_MODULE_1__["tau"] : lambda, phi]; |
|
}; |
|
} |
|
|
|
function rotationLambda(deltaLambda) { |
|
var rotation = forwardRotationLambda(deltaLambda); |
|
rotation.invert = forwardRotationLambda(-deltaLambda); |
|
return rotation; |
|
} |
|
|
|
function rotationPhiGamma(deltaPhi, deltaGamma) { |
|
var cosDeltaPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(deltaPhi), |
|
sinDeltaPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(deltaPhi), |
|
cosDeltaGamma = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(deltaGamma), |
|
sinDeltaGamma = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(deltaGamma); |
|
|
|
function rotation(lambda, phi) { |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi), |
|
x = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(lambda) * cosPhi, |
|
y = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(lambda) * cosPhi, |
|
z = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi), |
|
k = z * cosDeltaPhi + x * sinDeltaPhi; |
|
return [ |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["atan2"])(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi), |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["asin"])(k * cosDeltaGamma + y * sinDeltaGamma) |
|
]; |
|
} |
|
|
|
rotation.invert = function(lambda, phi) { |
|
var cosPhi = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(phi), |
|
x = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["cos"])(lambda) * cosPhi, |
|
y = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(lambda) * cosPhi, |
|
z = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["sin"])(phi), |
|
k = z * cosDeltaGamma - y * sinDeltaGamma; |
|
return [ |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["atan2"])(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi), |
|
Object(_math_js__WEBPACK_IMPORTED_MODULE_1__["asin"])(k * cosDeltaPhi - x * sinDeltaPhi) |
|
]; |
|
}; |
|
|
|
return rotation; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(rotate) { |
|
rotate = rotateRadians(rotate[0] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], rotate[1] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], rotate.length > 2 ? rotate[2] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"] : 0); |
|
|
|
function forward(coordinates) { |
|
coordinates = rotate(coordinates[0] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], coordinates[1] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]); |
|
return coordinates[0] *= _math_js__WEBPACK_IMPORTED_MODULE_1__["degrees"], coordinates[1] *= _math_js__WEBPACK_IMPORTED_MODULE_1__["degrees"], coordinates; |
|
} |
|
|
|
forward.invert = function(coordinates) { |
|
coordinates = rotate.invert(coordinates[0] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"], coordinates[1] * _math_js__WEBPACK_IMPORTED_MODULE_1__["radians"]); |
|
return coordinates[0] *= _math_js__WEBPACK_IMPORTED_MODULE_1__["degrees"], coordinates[1] *= _math_js__WEBPACK_IMPORTED_MODULE_1__["degrees"], coordinates; |
|
}; |
|
|
|
return forward; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/stream.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/stream.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function streamGeometry(geometry, stream) { |
|
if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) { |
|
streamGeometryType[geometry.type](geometry, stream); |
|
} |
|
} |
|
|
|
var streamObjectType = { |
|
Feature: function(object, stream) { |
|
streamGeometry(object.geometry, stream); |
|
}, |
|
FeatureCollection: function(object, stream) { |
|
var features = object.features, i = -1, n = features.length; |
|
while (++i < n) streamGeometry(features[i].geometry, stream); |
|
} |
|
}; |
|
|
|
var streamGeometryType = { |
|
Sphere: function(object, stream) { |
|
stream.sphere(); |
|
}, |
|
Point: function(object, stream) { |
|
object = object.coordinates; |
|
stream.point(object[0], object[1], object[2]); |
|
}, |
|
MultiPoint: function(object, stream) { |
|
var coordinates = object.coordinates, i = -1, n = coordinates.length; |
|
while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]); |
|
}, |
|
LineString: function(object, stream) { |
|
streamLine(object.coordinates, stream, 0); |
|
}, |
|
MultiLineString: function(object, stream) { |
|
var coordinates = object.coordinates, i = -1, n = coordinates.length; |
|
while (++i < n) streamLine(coordinates[i], stream, 0); |
|
}, |
|
Polygon: function(object, stream) { |
|
streamPolygon(object.coordinates, stream); |
|
}, |
|
MultiPolygon: function(object, stream) { |
|
var coordinates = object.coordinates, i = -1, n = coordinates.length; |
|
while (++i < n) streamPolygon(coordinates[i], stream); |
|
}, |
|
GeometryCollection: function(object, stream) { |
|
var geometries = object.geometries, i = -1, n = geometries.length; |
|
while (++i < n) streamGeometry(geometries[i], stream); |
|
} |
|
}; |
|
|
|
function streamLine(coordinates, stream, closed) { |
|
var i = -1, n = coordinates.length - closed, coordinate; |
|
stream.lineStart(); |
|
while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]); |
|
stream.lineEnd(); |
|
} |
|
|
|
function streamPolygon(coordinates, stream) { |
|
var i = -1, n = coordinates.length; |
|
stream.polygonStart(); |
|
while (++i < n) streamLine(coordinates[i], stream, 1); |
|
stream.polygonEnd(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(object, stream) { |
|
if (object && streamObjectType.hasOwnProperty(object.type)) { |
|
streamObjectType[object.type](object, stream); |
|
} else { |
|
streamGeometry(object, stream); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-geo/src/transform.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-geo/src/transform.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default, transformer */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformer", function() { return transformer; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(methods) { |
|
return { |
|
stream: transformer(methods) |
|
}; |
|
}); |
|
|
|
function transformer(methods) { |
|
return function(stream) { |
|
var s = new TransformStream; |
|
for (var key in methods) s[key] = methods[key]; |
|
s.stream = stream; |
|
return s; |
|
}; |
|
} |
|
|
|
function TransformStream() {} |
|
|
|
TransformStream.prototype = { |
|
constructor: TransformStream, |
|
point: function(x, y) { this.stream.point(x, y); }, |
|
sphere: function() { this.stream.sphere(); }, |
|
lineStart: function() { this.stream.lineStart(); }, |
|
lineEnd: function() { this.stream.lineEnd(); }, |
|
polygonStart: function() { this.stream.polygonStart(); }, |
|
polygonEnd: function() { this.stream.polygonEnd(); } |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/accessors.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/accessors.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: optional, required */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "optional", function() { return optional; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "required", function() { return required; }); |
|
function optional(f) { |
|
return f == null ? null : required(f); |
|
} |
|
|
|
function required(f) { |
|
if (typeof f !== "function") throw new Error; |
|
return f; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/array.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/array.js ***! |
|
\*************************************************/ |
|
/*! exports provided: slice, shuffle */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return shuffle; }); |
|
var slice = Array.prototype.slice; |
|
|
|
function shuffle(array) { |
|
var m = array.length, |
|
t, |
|
i; |
|
|
|
while (m) { |
|
i = Math.random() * m-- | 0; |
|
t = array[m]; |
|
array[m] = array[i]; |
|
array[i] = t; |
|
} |
|
|
|
return array; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/cluster.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/cluster.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function defaultSeparation(a, b) { |
|
return a.parent === b.parent ? 1 : 2; |
|
} |
|
|
|
function meanX(children) { |
|
return children.reduce(meanXReduce, 0) / children.length; |
|
} |
|
|
|
function meanXReduce(x, c) { |
|
return x + c.x; |
|
} |
|
|
|
function maxY(children) { |
|
return 1 + children.reduce(maxYReduce, 0); |
|
} |
|
|
|
function maxYReduce(y, c) { |
|
return Math.max(y, c.y); |
|
} |
|
|
|
function leafLeft(node) { |
|
var children; |
|
while (children = node.children) node = children[0]; |
|
return node; |
|
} |
|
|
|
function leafRight(node) { |
|
var children; |
|
while (children = node.children) node = children[children.length - 1]; |
|
return node; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var separation = defaultSeparation, |
|
dx = 1, |
|
dy = 1, |
|
nodeSize = false; |
|
|
|
function cluster(root) { |
|
var previousNode, |
|
x = 0; |
|
|
|
// First walk, computing the initial x & y values. |
|
root.eachAfter(function(node) { |
|
var children = node.children; |
|
if (children) { |
|
node.x = meanX(children); |
|
node.y = maxY(children); |
|
} else { |
|
node.x = previousNode ? x += separation(node, previousNode) : 0; |
|
node.y = 0; |
|
previousNode = node; |
|
} |
|
}); |
|
|
|
var left = leafLeft(root), |
|
right = leafRight(root), |
|
x0 = left.x - separation(left, right) / 2, |
|
x1 = right.x + separation(right, left) / 2; |
|
|
|
// Second walk, normalizing x & y to the desired size. |
|
return root.eachAfter(nodeSize ? function(node) { |
|
node.x = (node.x - root.x) * dx; |
|
node.y = (root.y - node.y) * dy; |
|
} : function(node) { |
|
node.x = (node.x - x0) / (x1 - x0) * dx; |
|
node.y = (1 - (root.y ? node.y / root.y : 1)) * dy; |
|
}); |
|
} |
|
|
|
cluster.separation = function(x) { |
|
return arguments.length ? (separation = x, cluster) : separation; |
|
}; |
|
|
|
cluster.size = function(x) { |
|
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]); |
|
}; |
|
|
|
cluster.nodeSize = function(x) { |
|
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null); |
|
}; |
|
|
|
return cluster; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/constant.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/constant.js ***! |
|
\****************************************************/ |
|
/*! exports provided: constantZero, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "constantZero", function() { return constantZero; }); |
|
function constantZero() { |
|
return 0; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/ancestors.js": |
|
/*!***************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/ancestors.js ***! |
|
\***************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var node = this, nodes = [node]; |
|
while (node = node.parent) { |
|
nodes.push(node); |
|
} |
|
return nodes; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/count.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/count.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function count(node) { |
|
var sum = 0, |
|
children = node.children, |
|
i = children && children.length; |
|
if (!i) sum = 1; |
|
else while (--i >= 0) sum += children[i].value; |
|
node.value = sum; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return this.eachAfter(count); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/descendants.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/descendants.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var nodes = []; |
|
this.each(function(node) { |
|
nodes.push(node); |
|
}); |
|
return nodes; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/each.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/each.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback) { |
|
var node = this, current, next = [node], children, i, n; |
|
do { |
|
current = next.reverse(), next = []; |
|
while (node = current.pop()) { |
|
callback(node), children = node.children; |
|
if (children) for (i = 0, n = children.length; i < n; ++i) { |
|
next.push(children[i]); |
|
} |
|
} |
|
} while (next.length); |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js": |
|
/*!***************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js ***! |
|
\***************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback) { |
|
var node = this, nodes = [node], next = [], children, i, n; |
|
while (node = nodes.pop()) { |
|
next.push(node), children = node.children; |
|
if (children) for (i = 0, n = children.length; i < n; ++i) { |
|
nodes.push(children[i]); |
|
} |
|
} |
|
while (node = next.pop()) { |
|
callback(node); |
|
} |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback) { |
|
var node = this, nodes = [node], children, i; |
|
while (node = nodes.pop()) { |
|
callback(node), children = node.children; |
|
if (children) for (i = children.length - 1; i >= 0; --i) { |
|
nodes.push(children[i]); |
|
} |
|
} |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/index.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/index.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default, computeHeight, Node */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return hierarchy; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHeight", function() { return computeHeight; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Node", function() { return Node; }); |
|
/* harmony import */ var _count_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./count.js */ "../node_modules/d3-hierarchy/src/hierarchy/count.js"); |
|
/* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "../node_modules/d3-hierarchy/src/hierarchy/each.js"); |
|
/* harmony import */ var _eachBefore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachBefore.js */ "../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js"); |
|
/* harmony import */ var _eachAfter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eachAfter.js */ "../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js"); |
|
/* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sum.js */ "../node_modules/d3-hierarchy/src/hierarchy/sum.js"); |
|
/* harmony import */ var _sort_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./sort.js */ "../node_modules/d3-hierarchy/src/hierarchy/sort.js"); |
|
/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./path.js */ "../node_modules/d3-hierarchy/src/hierarchy/path.js"); |
|
/* harmony import */ var _ancestors_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ancestors.js */ "../node_modules/d3-hierarchy/src/hierarchy/ancestors.js"); |
|
/* harmony import */ var _descendants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./descendants.js */ "../node_modules/d3-hierarchy/src/hierarchy/descendants.js"); |
|
/* harmony import */ var _leaves_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./leaves.js */ "../node_modules/d3-hierarchy/src/hierarchy/leaves.js"); |
|
/* harmony import */ var _links_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./links.js */ "../node_modules/d3-hierarchy/src/hierarchy/links.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hierarchy(data, children) { |
|
var root = new Node(data), |
|
valued = +data.value && (root.value = data.value), |
|
node, |
|
nodes = [root], |
|
child, |
|
childs, |
|
i, |
|
n; |
|
|
|
if (children == null) children = defaultChildren; |
|
|
|
while (node = nodes.pop()) { |
|
if (valued) node.value = +node.data.value; |
|
if ((childs = children(node.data)) && (n = childs.length)) { |
|
node.children = new Array(n); |
|
for (i = n - 1; i >= 0; --i) { |
|
nodes.push(child = node.children[i] = new Node(childs[i])); |
|
child.parent = node; |
|
child.depth = node.depth + 1; |
|
} |
|
} |
|
} |
|
|
|
return root.eachBefore(computeHeight); |
|
} |
|
|
|
function node_copy() { |
|
return hierarchy(this).eachBefore(copyData); |
|
} |
|
|
|
function defaultChildren(d) { |
|
return d.children; |
|
} |
|
|
|
function copyData(node) { |
|
node.data = node.data.data; |
|
} |
|
|
|
function computeHeight(node) { |
|
var height = 0; |
|
do node.height = height; |
|
while ((node = node.parent) && (node.height < ++height)); |
|
} |
|
|
|
function Node(data) { |
|
this.data = data; |
|
this.depth = |
|
this.height = 0; |
|
this.parent = null; |
|
} |
|
|
|
Node.prototype = hierarchy.prototype = { |
|
constructor: Node, |
|
count: _count_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
each: _each_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
eachAfter: _eachAfter_js__WEBPACK_IMPORTED_MODULE_3__["default"], |
|
eachBefore: _eachBefore_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
sum: _sum_js__WEBPACK_IMPORTED_MODULE_4__["default"], |
|
sort: _sort_js__WEBPACK_IMPORTED_MODULE_5__["default"], |
|
path: _path_js__WEBPACK_IMPORTED_MODULE_6__["default"], |
|
ancestors: _ancestors_js__WEBPACK_IMPORTED_MODULE_7__["default"], |
|
descendants: _descendants_js__WEBPACK_IMPORTED_MODULE_8__["default"], |
|
leaves: _leaves_js__WEBPACK_IMPORTED_MODULE_9__["default"], |
|
links: _links_js__WEBPACK_IMPORTED_MODULE_10__["default"], |
|
copy: node_copy |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/leaves.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/leaves.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var leaves = []; |
|
this.eachBefore(function(node) { |
|
if (!node.children) { |
|
leaves.push(node); |
|
} |
|
}); |
|
return leaves; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/links.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/links.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var root = this, links = []; |
|
root.each(function(node) { |
|
if (node !== root) { // Don’t include the root’s parent, if any. |
|
links.push({source: node.parent, target: node}); |
|
} |
|
}); |
|
return links; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/path.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/path.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(end) { |
|
var start = this, |
|
ancestor = leastCommonAncestor(start, end), |
|
nodes = [start]; |
|
while (start !== ancestor) { |
|
start = start.parent; |
|
nodes.push(start); |
|
} |
|
var k = nodes.length; |
|
while (end !== ancestor) { |
|
nodes.splice(k, 0, end); |
|
end = end.parent; |
|
} |
|
return nodes; |
|
}); |
|
|
|
function leastCommonAncestor(a, b) { |
|
if (a === b) return a; |
|
var aNodes = a.ancestors(), |
|
bNodes = b.ancestors(), |
|
c = null; |
|
a = aNodes.pop(); |
|
b = bNodes.pop(); |
|
while (a === b) { |
|
c = a; |
|
a = aNodes.pop(); |
|
b = bNodes.pop(); |
|
} |
|
return c; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/sort.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/sort.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(compare) { |
|
return this.eachBefore(function(node) { |
|
if (node.children) { |
|
node.children.sort(compare); |
|
} |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/hierarchy/sum.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/hierarchy/sum.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
return this.eachAfter(function(node) { |
|
var sum = +value(node.data) || 0, |
|
children = node.children, |
|
i = children && children.length; |
|
while (--i >= 0) sum += children[i].value; |
|
node.value = sum; |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/index.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/index.js ***! |
|
\*************************************************/ |
|
/*! exports provided: cluster, hierarchy, pack, packSiblings, packEnclose, partition, stratify, tree, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _cluster_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cluster.js */ "../node_modules/d3-hierarchy/src/cluster.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cluster", function() { return _cluster_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _hierarchy_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hierarchy/index.js */ "../node_modules/d3-hierarchy/src/hierarchy/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hierarchy", function() { return _hierarchy_index_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _pack_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pack/index.js */ "../node_modules/d3-hierarchy/src/pack/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pack", function() { return _pack_index_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _pack_siblings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pack/siblings.js */ "../node_modules/d3-hierarchy/src/pack/siblings.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "packSiblings", function() { return _pack_siblings_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _pack_enclose_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pack/enclose.js */ "../node_modules/d3-hierarchy/src/pack/enclose.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "packEnclose", function() { return _pack_enclose_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./partition.js */ "../node_modules/d3-hierarchy/src/partition.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _stratify_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stratify.js */ "../node_modules/d3-hierarchy/src/stratify.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stratify", function() { return _stratify_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _tree_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tree.js */ "../node_modules/d3-hierarchy/src/tree.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tree", function() { return _tree_js__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./treemap/index.js */ "../node_modules/d3-hierarchy/src/treemap/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemap", function() { return _treemap_index_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_binary_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./treemap/binary.js */ "../node_modules/d3-hierarchy/src/treemap/binary.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapBinary", function() { return _treemap_binary_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_dice_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./treemap/dice.js */ "../node_modules/d3-hierarchy/src/treemap/dice.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapDice", function() { return _treemap_dice_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_slice_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./treemap/slice.js */ "../node_modules/d3-hierarchy/src/treemap/slice.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapSlice", function() { return _treemap_slice_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_sliceDice_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./treemap/sliceDice.js */ "../node_modules/d3-hierarchy/src/treemap/sliceDice.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapSliceDice", function() { return _treemap_sliceDice_js__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_squarify_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./treemap/squarify.js */ "../node_modules/d3-hierarchy/src/treemap/squarify.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapSquarify", function() { return _treemap_squarify_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony import */ var _treemap_resquarify_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./treemap/resquarify.js */ "../node_modules/d3-hierarchy/src/treemap/resquarify.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapResquarify", function() { return _treemap_resquarify_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/pack/enclose.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/pack/enclose.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../array.js */ "../node_modules/d3-hierarchy/src/array.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(circles) { |
|
var i = 0, n = (circles = Object(_array_js__WEBPACK_IMPORTED_MODULE_0__["shuffle"])(_array_js__WEBPACK_IMPORTED_MODULE_0__["slice"].call(circles))).length, B = [], p, e; |
|
|
|
while (i < n) { |
|
p = circles[i]; |
|
if (e && enclosesWeak(e, p)) ++i; |
|
else e = encloseBasis(B = extendBasis(B, p)), i = 0; |
|
} |
|
|
|
return e; |
|
}); |
|
|
|
function extendBasis(B, p) { |
|
var i, j; |
|
|
|
if (enclosesWeakAll(p, B)) return [p]; |
|
|
|
// If we get here then B must have at least one element. |
|
for (i = 0; i < B.length; ++i) { |
|
if (enclosesNot(p, B[i]) |
|
&& enclosesWeakAll(encloseBasis2(B[i], p), B)) { |
|
return [B[i], p]; |
|
} |
|
} |
|
|
|
// If we get here then B must have at least two elements. |
|
for (i = 0; i < B.length - 1; ++i) { |
|
for (j = i + 1; j < B.length; ++j) { |
|
if (enclosesNot(encloseBasis2(B[i], B[j]), p) |
|
&& enclosesNot(encloseBasis2(B[i], p), B[j]) |
|
&& enclosesNot(encloseBasis2(B[j], p), B[i]) |
|
&& enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) { |
|
return [B[i], B[j], p]; |
|
} |
|
} |
|
} |
|
|
|
// If we get here then something is very wrong. |
|
throw new Error; |
|
} |
|
|
|
function enclosesNot(a, b) { |
|
var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y; |
|
return dr < 0 || dr * dr < dx * dx + dy * dy; |
|
} |
|
|
|
function enclosesWeak(a, b) { |
|
var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y; |
|
return dr > 0 && dr * dr > dx * dx + dy * dy; |
|
} |
|
|
|
function enclosesWeakAll(a, B) { |
|
for (var i = 0; i < B.length; ++i) { |
|
if (!enclosesWeak(a, B[i])) { |
|
return false; |
|
} |
|
} |
|
return true; |
|
} |
|
|
|
function encloseBasis(B) { |
|
switch (B.length) { |
|
case 1: return encloseBasis1(B[0]); |
|
case 2: return encloseBasis2(B[0], B[1]); |
|
case 3: return encloseBasis3(B[0], B[1], B[2]); |
|
} |
|
} |
|
|
|
function encloseBasis1(a) { |
|
return { |
|
x: a.x, |
|
y: a.y, |
|
r: a.r |
|
}; |
|
} |
|
|
|
function encloseBasis2(a, b) { |
|
var x1 = a.x, y1 = a.y, r1 = a.r, |
|
x2 = b.x, y2 = b.y, r2 = b.r, |
|
x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1, |
|
l = Math.sqrt(x21 * x21 + y21 * y21); |
|
return { |
|
x: (x1 + x2 + x21 / l * r21) / 2, |
|
y: (y1 + y2 + y21 / l * r21) / 2, |
|
r: (l + r1 + r2) / 2 |
|
}; |
|
} |
|
|
|
function encloseBasis3(a, b, c) { |
|
var x1 = a.x, y1 = a.y, r1 = a.r, |
|
x2 = b.x, y2 = b.y, r2 = b.r, |
|
x3 = c.x, y3 = c.y, r3 = c.r, |
|
a2 = x1 - x2, |
|
a3 = x1 - x3, |
|
b2 = y1 - y2, |
|
b3 = y1 - y3, |
|
c2 = r2 - r1, |
|
c3 = r3 - r1, |
|
d1 = x1 * x1 + y1 * y1 - r1 * r1, |
|
d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2, |
|
d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3, |
|
ab = a3 * b2 - a2 * b3, |
|
xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1, |
|
xb = (b3 * c2 - b2 * c3) / ab, |
|
ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1, |
|
yb = (a2 * c3 - a3 * c2) / ab, |
|
A = xb * xb + yb * yb - 1, |
|
B = 2 * (r1 + xa * xb + ya * yb), |
|
C = xa * xa + ya * ya - r1 * r1, |
|
r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B); |
|
return { |
|
x: x1 + xa + xb * r, |
|
y: y1 + ya + yb * r, |
|
r: r |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/pack/index.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/pack/index.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _siblings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./siblings.js */ "../node_modules/d3-hierarchy/src/pack/siblings.js"); |
|
/* harmony import */ var _accessors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../accessors.js */ "../node_modules/d3-hierarchy/src/accessors.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constant.js */ "../node_modules/d3-hierarchy/src/constant.js"); |
|
|
|
|
|
|
|
|
|
function defaultRadius(d) { |
|
return Math.sqrt(d.value); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var radius = null, |
|
dx = 1, |
|
dy = 1, |
|
padding = _constant_js__WEBPACK_IMPORTED_MODULE_2__["constantZero"]; |
|
|
|
function pack(root) { |
|
root.x = dx / 2, root.y = dy / 2; |
|
if (radius) { |
|
root.eachBefore(radiusLeaf(radius)) |
|
.eachAfter(packChildren(padding, 0.5)) |
|
.eachBefore(translateChild(1)); |
|
} else { |
|
root.eachBefore(radiusLeaf(defaultRadius)) |
|
.eachAfter(packChildren(_constant_js__WEBPACK_IMPORTED_MODULE_2__["constantZero"], 1)) |
|
.eachAfter(packChildren(padding, root.r / Math.min(dx, dy))) |
|
.eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r))); |
|
} |
|
return root; |
|
} |
|
|
|
pack.radius = function(x) { |
|
return arguments.length ? (radius = Object(_accessors_js__WEBPACK_IMPORTED_MODULE_1__["optional"])(x), pack) : radius; |
|
}; |
|
|
|
pack.size = function(x) { |
|
return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy]; |
|
}; |
|
|
|
pack.padding = function(x) { |
|
return arguments.length ? (padding = typeof x === "function" ? x : Object(_constant_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+x), pack) : padding; |
|
}; |
|
|
|
return pack; |
|
}); |
|
|
|
function radiusLeaf(radius) { |
|
return function(node) { |
|
if (!node.children) { |
|
node.r = Math.max(0, +radius(node) || 0); |
|
} |
|
}; |
|
} |
|
|
|
function packChildren(padding, k) { |
|
return function(node) { |
|
if (children = node.children) { |
|
var children, |
|
i, |
|
n = children.length, |
|
r = padding(node) * k || 0, |
|
e; |
|
|
|
if (r) for (i = 0; i < n; ++i) children[i].r += r; |
|
e = Object(_siblings_js__WEBPACK_IMPORTED_MODULE_0__["packEnclose"])(children); |
|
if (r) for (i = 0; i < n; ++i) children[i].r -= r; |
|
node.r = e + r; |
|
} |
|
}; |
|
} |
|
|
|
function translateChild(k) { |
|
return function(node) { |
|
var parent = node.parent; |
|
node.r *= k; |
|
if (parent) { |
|
node.x = parent.x + k * node.x; |
|
node.y = parent.y + k * node.y; |
|
} |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/pack/siblings.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/pack/siblings.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: packEnclose, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "packEnclose", function() { return packEnclose; }); |
|
/* harmony import */ var _enclose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./enclose.js */ "../node_modules/d3-hierarchy/src/pack/enclose.js"); |
|
|
|
|
|
function place(b, a, c) { |
|
var dx = b.x - a.x, x, a2, |
|
dy = b.y - a.y, y, b2, |
|
d2 = dx * dx + dy * dy; |
|
if (d2) { |
|
a2 = a.r + c.r, a2 *= a2; |
|
b2 = b.r + c.r, b2 *= b2; |
|
if (a2 > b2) { |
|
x = (d2 + b2 - a2) / (2 * d2); |
|
y = Math.sqrt(Math.max(0, b2 / d2 - x * x)); |
|
c.x = b.x - x * dx - y * dy; |
|
c.y = b.y - x * dy + y * dx; |
|
} else { |
|
x = (d2 + a2 - b2) / (2 * d2); |
|
y = Math.sqrt(Math.max(0, a2 / d2 - x * x)); |
|
c.x = a.x + x * dx - y * dy; |
|
c.y = a.y + x * dy + y * dx; |
|
} |
|
} else { |
|
c.x = a.x + c.r; |
|
c.y = a.y; |
|
} |
|
} |
|
|
|
function intersects(a, b) { |
|
var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y; |
|
return dr > 0 && dr * dr > dx * dx + dy * dy; |
|
} |
|
|
|
function score(node) { |
|
var a = node._, |
|
b = node.next._, |
|
ab = a.r + b.r, |
|
dx = (a.x * b.r + b.x * a.r) / ab, |
|
dy = (a.y * b.r + b.y * a.r) / ab; |
|
return dx * dx + dy * dy; |
|
} |
|
|
|
function Node(circle) { |
|
this._ = circle; |
|
this.next = null; |
|
this.previous = null; |
|
} |
|
|
|
function packEnclose(circles) { |
|
if (!(n = circles.length)) return 0; |
|
|
|
var a, b, c, n, aa, ca, i, j, k, sj, sk; |
|
|
|
// Place the first circle. |
|
a = circles[0], a.x = 0, a.y = 0; |
|
if (!(n > 1)) return a.r; |
|
|
|
// Place the second circle. |
|
b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0; |
|
if (!(n > 2)) return a.r + b.r; |
|
|
|
// Place the third circle. |
|
place(b, a, c = circles[2]); |
|
|
|
// Initialize the front-chain using the first three circles a, b and c. |
|
a = new Node(a), b = new Node(b), c = new Node(c); |
|
a.next = c.previous = b; |
|
b.next = a.previous = c; |
|
c.next = b.previous = a; |
|
|
|
// Attempt to place each remaining circle… |
|
pack: for (i = 3; i < n; ++i) { |
|
place(a._, b._, c = circles[i]), c = new Node(c); |
|
|
|
// Find the closest intersecting circle on the front-chain, if any. |
|
// “Closeness” is determined by linear distance along the front-chain. |
|
// “Ahead” or “behind” is likewise determined by linear distance. |
|
j = b.next, k = a.previous, sj = b._.r, sk = a._.r; |
|
do { |
|
if (sj <= sk) { |
|
if (intersects(j._, c._)) { |
|
b = j, a.next = b, b.previous = a, --i; |
|
continue pack; |
|
} |
|
sj += j._.r, j = j.next; |
|
} else { |
|
if (intersects(k._, c._)) { |
|
a = k, a.next = b, b.previous = a, --i; |
|
continue pack; |
|
} |
|
sk += k._.r, k = k.previous; |
|
} |
|
} while (j !== k.next); |
|
|
|
// Success! Insert the new circle c between a and b. |
|
c.previous = a, c.next = b, a.next = b.previous = b = c; |
|
|
|
// Compute the new closest circle pair to the centroid. |
|
aa = score(a); |
|
while ((c = c.next) !== b) { |
|
if ((ca = score(c)) < aa) { |
|
a = c, aa = ca; |
|
} |
|
} |
|
b = a.next; |
|
} |
|
|
|
// Compute the enclosing circle of the front chain. |
|
a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = Object(_enclose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a); |
|
|
|
// Translate the circles to put the enclosing circle around the origin. |
|
for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y; |
|
|
|
return c.r; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(circles) { |
|
packEnclose(circles); |
|
return circles; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/partition.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/partition.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _treemap_round_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treemap/round.js */ "../node_modules/d3-hierarchy/src/treemap/round.js"); |
|
/* harmony import */ var _treemap_dice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treemap/dice.js */ "../node_modules/d3-hierarchy/src/treemap/dice.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var dx = 1, |
|
dy = 1, |
|
padding = 0, |
|
round = false; |
|
|
|
function partition(root) { |
|
var n = root.height + 1; |
|
root.x0 = |
|
root.y0 = padding; |
|
root.x1 = dx; |
|
root.y1 = dy / n; |
|
root.eachBefore(positionNode(dy, n)); |
|
if (round) root.eachBefore(_treemap_round_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
return root; |
|
} |
|
|
|
function positionNode(dy, n) { |
|
return function(node) { |
|
if (node.children) { |
|
Object(_treemap_dice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n); |
|
} |
|
var x0 = node.x0, |
|
y0 = node.y0, |
|
x1 = node.x1 - padding, |
|
y1 = node.y1 - padding; |
|
if (x1 < x0) x0 = x1 = (x0 + x1) / 2; |
|
if (y1 < y0) y0 = y1 = (y0 + y1) / 2; |
|
node.x0 = x0; |
|
node.y0 = y0; |
|
node.x1 = x1; |
|
node.y1 = y1; |
|
}; |
|
} |
|
|
|
partition.round = function(x) { |
|
return arguments.length ? (round = !!x, partition) : round; |
|
}; |
|
|
|
partition.size = function(x) { |
|
return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy]; |
|
}; |
|
|
|
partition.padding = function(x) { |
|
return arguments.length ? (padding = +x, partition) : padding; |
|
}; |
|
|
|
return partition; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/stratify.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/stratify.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _accessors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accessors.js */ "../node_modules/d3-hierarchy/src/accessors.js"); |
|
/* harmony import */ var _hierarchy_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hierarchy/index.js */ "../node_modules/d3-hierarchy/src/hierarchy/index.js"); |
|
|
|
|
|
|
|
var keyPrefix = "$", // Protect against keys like “__proto__”. |
|
preroot = {depth: -1}, |
|
ambiguous = {}; |
|
|
|
function defaultId(d) { |
|
return d.id; |
|
} |
|
|
|
function defaultParentId(d) { |
|
return d.parentId; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var id = defaultId, |
|
parentId = defaultParentId; |
|
|
|
function stratify(data) { |
|
var d, |
|
i, |
|
n = data.length, |
|
root, |
|
parent, |
|
node, |
|
nodes = new Array(n), |
|
nodeId, |
|
nodeKey, |
|
nodeByKey = {}; |
|
|
|
for (i = 0; i < n; ++i) { |
|
d = data[i], node = nodes[i] = new _hierarchy_index_js__WEBPACK_IMPORTED_MODULE_1__["Node"](d); |
|
if ((nodeId = id(d, i, data)) != null && (nodeId += "")) { |
|
nodeKey = keyPrefix + (node.id = nodeId); |
|
nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node; |
|
} |
|
} |
|
|
|
for (i = 0; i < n; ++i) { |
|
node = nodes[i], nodeId = parentId(data[i], i, data); |
|
if (nodeId == null || !(nodeId += "")) { |
|
if (root) throw new Error("multiple roots"); |
|
root = node; |
|
} else { |
|
parent = nodeByKey[keyPrefix + nodeId]; |
|
if (!parent) throw new Error("missing: " + nodeId); |
|
if (parent === ambiguous) throw new Error("ambiguous: " + nodeId); |
|
if (parent.children) parent.children.push(node); |
|
else parent.children = [node]; |
|
node.parent = parent; |
|
} |
|
} |
|
|
|
if (!root) throw new Error("no root"); |
|
root.parent = preroot; |
|
root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(_hierarchy_index_js__WEBPACK_IMPORTED_MODULE_1__["computeHeight"]); |
|
root.parent = null; |
|
if (n > 0) throw new Error("cycle"); |
|
|
|
return root; |
|
} |
|
|
|
stratify.id = function(x) { |
|
return arguments.length ? (id = Object(_accessors_js__WEBPACK_IMPORTED_MODULE_0__["required"])(x), stratify) : id; |
|
}; |
|
|
|
stratify.parentId = function(x) { |
|
return arguments.length ? (parentId = Object(_accessors_js__WEBPACK_IMPORTED_MODULE_0__["required"])(x), stratify) : parentId; |
|
}; |
|
|
|
return stratify; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/tree.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/tree.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _hierarchy_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hierarchy/index.js */ "../node_modules/d3-hierarchy/src/hierarchy/index.js"); |
|
|
|
|
|
function defaultSeparation(a, b) { |
|
return a.parent === b.parent ? 1 : 2; |
|
} |
|
|
|
// function radialSeparation(a, b) { |
|
// return (a.parent === b.parent ? 1 : 2) / a.depth; |
|
// } |
|
|
|
// This function is used to traverse the left contour of a subtree (or |
|
// subforest). It returns the successor of v on this contour. This successor is |
|
// either given by the leftmost child of v or by the thread of v. The function |
|
// returns null if and only if v is on the highest level of its subtree. |
|
function nextLeft(v) { |
|
var children = v.children; |
|
return children ? children[0] : v.t; |
|
} |
|
|
|
// This function works analogously to nextLeft. |
|
function nextRight(v) { |
|
var children = v.children; |
|
return children ? children[children.length - 1] : v.t; |
|
} |
|
|
|
// Shifts the current subtree rooted at w+. This is done by increasing |
|
// prelim(w+) and mod(w+) by shift. |
|
function moveSubtree(wm, wp, shift) { |
|
var change = shift / (wp.i - wm.i); |
|
wp.c -= change; |
|
wp.s += shift; |
|
wm.c += change; |
|
wp.z += shift; |
|
wp.m += shift; |
|
} |
|
|
|
// All other shifts, applied to the smaller subtrees between w- and w+, are |
|
// performed by this function. To prepare the shifts, we have to adjust |
|
// change(w+), shift(w+), and change(w-). |
|
function executeShifts(v) { |
|
var shift = 0, |
|
change = 0, |
|
children = v.children, |
|
i = children.length, |
|
w; |
|
while (--i >= 0) { |
|
w = children[i]; |
|
w.z += shift; |
|
w.m += shift; |
|
shift += w.s + (change += w.c); |
|
} |
|
} |
|
|
|
// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise, |
|
// returns the specified (default) ancestor. |
|
function nextAncestor(vim, v, ancestor) { |
|
return vim.a.parent === v.parent ? vim.a : ancestor; |
|
} |
|
|
|
function TreeNode(node, i) { |
|
this._ = node; |
|
this.parent = null; |
|
this.children = null; |
|
this.A = null; // default ancestor |
|
this.a = this; // ancestor |
|
this.z = 0; // prelim |
|
this.m = 0; // mod |
|
this.c = 0; // change |
|
this.s = 0; // shift |
|
this.t = null; // thread |
|
this.i = i; // number |
|
} |
|
|
|
TreeNode.prototype = Object.create(_hierarchy_index_js__WEBPACK_IMPORTED_MODULE_0__["Node"].prototype); |
|
|
|
function treeRoot(root) { |
|
var tree = new TreeNode(root, 0), |
|
node, |
|
nodes = [tree], |
|
child, |
|
children, |
|
i, |
|
n; |
|
|
|
while (node = nodes.pop()) { |
|
if (children = node._.children) { |
|
node.children = new Array(n = children.length); |
|
for (i = n - 1; i >= 0; --i) { |
|
nodes.push(child = node.children[i] = new TreeNode(children[i], i)); |
|
child.parent = node; |
|
} |
|
} |
|
} |
|
|
|
(tree.parent = new TreeNode(null, 0)).children = [tree]; |
|
return tree; |
|
} |
|
|
|
// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var separation = defaultSeparation, |
|
dx = 1, |
|
dy = 1, |
|
nodeSize = null; |
|
|
|
function tree(root) { |
|
var t = treeRoot(root); |
|
|
|
// Compute the layout using Buchheim et al.’s algorithm. |
|
t.eachAfter(firstWalk), t.parent.m = -t.z; |
|
t.eachBefore(secondWalk); |
|
|
|
// If a fixed node size is specified, scale x and y. |
|
if (nodeSize) root.eachBefore(sizeNode); |
|
|
|
// If a fixed tree size is specified, scale x and y based on the extent. |
|
// Compute the left-most, right-most, and depth-most nodes for extents. |
|
else { |
|
var left = root, |
|
right = root, |
|
bottom = root; |
|
root.eachBefore(function(node) { |
|
if (node.x < left.x) left = node; |
|
if (node.x > right.x) right = node; |
|
if (node.depth > bottom.depth) bottom = node; |
|
}); |
|
var s = left === right ? 1 : separation(left, right) / 2, |
|
tx = s - left.x, |
|
kx = dx / (right.x + s + tx), |
|
ky = dy / (bottom.depth || 1); |
|
root.eachBefore(function(node) { |
|
node.x = (node.x + tx) * kx; |
|
node.y = node.depth * ky; |
|
}); |
|
} |
|
|
|
return root; |
|
} |
|
|
|
// Computes a preliminary x-coordinate for v. Before that, FIRST WALK is |
|
// applied recursively to the children of v, as well as the function |
|
// APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the |
|
// node v is placed to the midpoint of its outermost children. |
|
function firstWalk(v) { |
|
var children = v.children, |
|
siblings = v.parent.children, |
|
w = v.i ? siblings[v.i - 1] : null; |
|
if (children) { |
|
executeShifts(v); |
|
var midpoint = (children[0].z + children[children.length - 1].z) / 2; |
|
if (w) { |
|
v.z = w.z + separation(v._, w._); |
|
v.m = v.z - midpoint; |
|
} else { |
|
v.z = midpoint; |
|
} |
|
} else if (w) { |
|
v.z = w.z + separation(v._, w._); |
|
} |
|
v.parent.A = apportion(v, w, v.parent.A || siblings[0]); |
|
} |
|
|
|
// Computes all real x-coordinates by summing up the modifiers recursively. |
|
function secondWalk(v) { |
|
v._.x = v.z + v.parent.m; |
|
v.m += v.parent.m; |
|
} |
|
|
|
// The core of the algorithm. Here, a new subtree is combined with the |
|
// previous subtrees. Threads are used to traverse the inside and outside |
|
// contours of the left and right subtree up to the highest common level. The |
|
// vertices used for the traversals are vi+, vi-, vo-, and vo+, where the |
|
// superscript o means outside and i means inside, the subscript - means left |
|
// subtree and + means right subtree. For summing up the modifiers along the |
|
// contour, we use respective variables si+, si-, so-, and so+. Whenever two |
|
// nodes of the inside contours conflict, we compute the left one of the |
|
// greatest uncommon ancestors using the function ANCESTOR and call MOVE |
|
// SUBTREE to shift the subtree and prepare the shifts of smaller subtrees. |
|
// Finally, we add a new thread (if necessary). |
|
function apportion(v, w, ancestor) { |
|
if (w) { |
|
var vip = v, |
|
vop = v, |
|
vim = w, |
|
vom = vip.parent.children[0], |
|
sip = vip.m, |
|
sop = vop.m, |
|
sim = vim.m, |
|
som = vom.m, |
|
shift; |
|
while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) { |
|
vom = nextLeft(vom); |
|
vop = nextRight(vop); |
|
vop.a = v; |
|
shift = vim.z + sim - vip.z - sip + separation(vim._, vip._); |
|
if (shift > 0) { |
|
moveSubtree(nextAncestor(vim, v, ancestor), v, shift); |
|
sip += shift; |
|
sop += shift; |
|
} |
|
sim += vim.m; |
|
sip += vip.m; |
|
som += vom.m; |
|
sop += vop.m; |
|
} |
|
if (vim && !nextRight(vop)) { |
|
vop.t = vim; |
|
vop.m += sim - sop; |
|
} |
|
if (vip && !nextLeft(vom)) { |
|
vom.t = vip; |
|
vom.m += sip - som; |
|
ancestor = v; |
|
} |
|
} |
|
return ancestor; |
|
} |
|
|
|
function sizeNode(node) { |
|
node.x *= dx; |
|
node.y = node.depth * dy; |
|
} |
|
|
|
tree.separation = function(x) { |
|
return arguments.length ? (separation = x, tree) : separation; |
|
}; |
|
|
|
tree.size = function(x) { |
|
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]); |
|
}; |
|
|
|
tree.nodeSize = function(x) { |
|
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null); |
|
}; |
|
|
|
return tree; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/binary.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/binary.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(parent, x0, y0, x1, y1) { |
|
var nodes = parent.children, |
|
i, n = nodes.length, |
|
sum, sums = new Array(n + 1); |
|
|
|
for (sums[0] = sum = i = 0; i < n; ++i) { |
|
sums[i + 1] = sum += nodes[i].value; |
|
} |
|
|
|
partition(0, n, parent.value, x0, y0, x1, y1); |
|
|
|
function partition(i, j, value, x0, y0, x1, y1) { |
|
if (i >= j - 1) { |
|
var node = nodes[i]; |
|
node.x0 = x0, node.y0 = y0; |
|
node.x1 = x1, node.y1 = y1; |
|
return; |
|
} |
|
|
|
var valueOffset = sums[i], |
|
valueTarget = (value / 2) + valueOffset, |
|
k = i + 1, |
|
hi = j - 1; |
|
|
|
while (k < hi) { |
|
var mid = k + hi >>> 1; |
|
if (sums[mid] < valueTarget) k = mid + 1; |
|
else hi = mid; |
|
} |
|
|
|
if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k; |
|
|
|
var valueLeft = sums[k] - valueOffset, |
|
valueRight = value - valueLeft; |
|
|
|
if ((x1 - x0) > (y1 - y0)) { |
|
var xk = (x0 * valueRight + x1 * valueLeft) / value; |
|
partition(i, k, valueLeft, x0, y0, xk, y1); |
|
partition(k, j, valueRight, xk, y0, x1, y1); |
|
} else { |
|
var yk = (y0 * valueRight + y1 * valueLeft) / value; |
|
partition(i, k, valueLeft, x0, y0, x1, yk); |
|
partition(k, j, valueRight, x0, yk, x1, y1); |
|
} |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/dice.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/dice.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(parent, x0, y0, x1, y1) { |
|
var nodes = parent.children, |
|
node, |
|
i = -1, |
|
n = nodes.length, |
|
k = parent.value && (x1 - x0) / parent.value; |
|
|
|
while (++i < n) { |
|
node = nodes[i], node.y0 = y0, node.y1 = y1; |
|
node.x0 = x0, node.x1 = x0 += node.value * k; |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/index.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/index.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./round.js */ "../node_modules/d3-hierarchy/src/treemap/round.js"); |
|
/* harmony import */ var _squarify_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./squarify.js */ "../node_modules/d3-hierarchy/src/treemap/squarify.js"); |
|
/* harmony import */ var _accessors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../accessors.js */ "../node_modules/d3-hierarchy/src/accessors.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constant.js */ "../node_modules/d3-hierarchy/src/constant.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var tile = _squarify_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
round = false, |
|
dx = 1, |
|
dy = 1, |
|
paddingStack = [0], |
|
paddingInner = _constant_js__WEBPACK_IMPORTED_MODULE_3__["constantZero"], |
|
paddingTop = _constant_js__WEBPACK_IMPORTED_MODULE_3__["constantZero"], |
|
paddingRight = _constant_js__WEBPACK_IMPORTED_MODULE_3__["constantZero"], |
|
paddingBottom = _constant_js__WEBPACK_IMPORTED_MODULE_3__["constantZero"], |
|
paddingLeft = _constant_js__WEBPACK_IMPORTED_MODULE_3__["constantZero"]; |
|
|
|
function treemap(root) { |
|
root.x0 = |
|
root.y0 = 0; |
|
root.x1 = dx; |
|
root.y1 = dy; |
|
root.eachBefore(positionNode); |
|
paddingStack = [0]; |
|
if (round) root.eachBefore(_round_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
return root; |
|
} |
|
|
|
function positionNode(node) { |
|
var p = paddingStack[node.depth], |
|
x0 = node.x0 + p, |
|
y0 = node.y0 + p, |
|
x1 = node.x1 - p, |
|
y1 = node.y1 - p; |
|
if (x1 < x0) x0 = x1 = (x0 + x1) / 2; |
|
if (y1 < y0) y0 = y1 = (y0 + y1) / 2; |
|
node.x0 = x0; |
|
node.y0 = y0; |
|
node.x1 = x1; |
|
node.y1 = y1; |
|
if (node.children) { |
|
p = paddingStack[node.depth + 1] = paddingInner(node) / 2; |
|
x0 += paddingLeft(node) - p; |
|
y0 += paddingTop(node) - p; |
|
x1 -= paddingRight(node) - p; |
|
y1 -= paddingBottom(node) - p; |
|
if (x1 < x0) x0 = x1 = (x0 + x1) / 2; |
|
if (y1 < y0) y0 = y1 = (y0 + y1) / 2; |
|
tile(node, x0, y0, x1, y1); |
|
} |
|
} |
|
|
|
treemap.round = function(x) { |
|
return arguments.length ? (round = !!x, treemap) : round; |
|
}; |
|
|
|
treemap.size = function(x) { |
|
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy]; |
|
}; |
|
|
|
treemap.tile = function(x) { |
|
return arguments.length ? (tile = Object(_accessors_js__WEBPACK_IMPORTED_MODULE_2__["required"])(x), treemap) : tile; |
|
}; |
|
|
|
treemap.padding = function(x) { |
|
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner(); |
|
}; |
|
|
|
treemap.paddingInner = function(x) { |
|
return arguments.length ? (paddingInner = typeof x === "function" ? x : Object(_constant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(+x), treemap) : paddingInner; |
|
}; |
|
|
|
treemap.paddingOuter = function(x) { |
|
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop(); |
|
}; |
|
|
|
treemap.paddingTop = function(x) { |
|
return arguments.length ? (paddingTop = typeof x === "function" ? x : Object(_constant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(+x), treemap) : paddingTop; |
|
}; |
|
|
|
treemap.paddingRight = function(x) { |
|
return arguments.length ? (paddingRight = typeof x === "function" ? x : Object(_constant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(+x), treemap) : paddingRight; |
|
}; |
|
|
|
treemap.paddingBottom = function(x) { |
|
return arguments.length ? (paddingBottom = typeof x === "function" ? x : Object(_constant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(+x), treemap) : paddingBottom; |
|
}; |
|
|
|
treemap.paddingLeft = function(x) { |
|
return arguments.length ? (paddingLeft = typeof x === "function" ? x : Object(_constant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(+x), treemap) : paddingLeft; |
|
}; |
|
|
|
return treemap; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/resquarify.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/resquarify.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _dice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dice.js */ "../node_modules/d3-hierarchy/src/treemap/dice.js"); |
|
/* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./slice.js */ "../node_modules/d3-hierarchy/src/treemap/slice.js"); |
|
/* harmony import */ var _squarify_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./squarify.js */ "../node_modules/d3-hierarchy/src/treemap/squarify.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(ratio) { |
|
|
|
function resquarify(parent, x0, y0, x1, y1) { |
|
if ((rows = parent._squarify) && (rows.ratio === ratio)) { |
|
var rows, |
|
row, |
|
nodes, |
|
i, |
|
j = -1, |
|
n, |
|
m = rows.length, |
|
value = parent.value; |
|
|
|
while (++j < m) { |
|
row = rows[j], nodes = row.children; |
|
for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value; |
|
if (row.dice) Object(_dice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value); |
|
else Object(_slice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1); |
|
value -= row.value; |
|
} |
|
} else { |
|
parent._squarify = rows = Object(_squarify_js__WEBPACK_IMPORTED_MODULE_2__["squarifyRatio"])(ratio, parent, x0, y0, x1, y1); |
|
rows.ratio = ratio; |
|
} |
|
} |
|
|
|
resquarify.ratio = function(x) { |
|
return custom((x = +x) > 1 ? x : 1); |
|
}; |
|
|
|
return resquarify; |
|
})(_squarify_js__WEBPACK_IMPORTED_MODULE_2__["phi"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/round.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/round.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(node) { |
|
node.x0 = Math.round(node.x0); |
|
node.y0 = Math.round(node.y0); |
|
node.x1 = Math.round(node.x1); |
|
node.y1 = Math.round(node.y1); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/slice.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/slice.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(parent, x0, y0, x1, y1) { |
|
var nodes = parent.children, |
|
node, |
|
i = -1, |
|
n = nodes.length, |
|
k = parent.value && (y1 - y0) / parent.value; |
|
|
|
while (++i < n) { |
|
node = nodes[i], node.x0 = x0, node.x1 = x1; |
|
node.y0 = y0, node.y1 = y0 += node.value * k; |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/sliceDice.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/sliceDice.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _dice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dice.js */ "../node_modules/d3-hierarchy/src/treemap/dice.js"); |
|
/* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./slice.js */ "../node_modules/d3-hierarchy/src/treemap/slice.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(parent, x0, y0, x1, y1) { |
|
(parent.depth & 1 ? _slice_js__WEBPACK_IMPORTED_MODULE_1__["default"] : _dice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(parent, x0, y0, x1, y1); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-hierarchy/src/treemap/squarify.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-hierarchy/src/treemap/squarify.js ***! |
|
\************************************************************/ |
|
/*! exports provided: phi, squarifyRatio, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "phi", function() { return phi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squarifyRatio", function() { return squarifyRatio; }); |
|
/* harmony import */ var _dice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dice.js */ "../node_modules/d3-hierarchy/src/treemap/dice.js"); |
|
/* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./slice.js */ "../node_modules/d3-hierarchy/src/treemap/slice.js"); |
|
|
|
|
|
|
|
var phi = (1 + Math.sqrt(5)) / 2; |
|
|
|
function squarifyRatio(ratio, parent, x0, y0, x1, y1) { |
|
var rows = [], |
|
nodes = parent.children, |
|
row, |
|
nodeValue, |
|
i0 = 0, |
|
i1 = 0, |
|
n = nodes.length, |
|
dx, dy, |
|
value = parent.value, |
|
sumValue, |
|
minValue, |
|
maxValue, |
|
newRatio, |
|
minRatio, |
|
alpha, |
|
beta; |
|
|
|
while (i0 < n) { |
|
dx = x1 - x0, dy = y1 - y0; |
|
|
|
// Find the next non-empty node. |
|
do sumValue = nodes[i1++].value; while (!sumValue && i1 < n); |
|
minValue = maxValue = sumValue; |
|
alpha = Math.max(dy / dx, dx / dy) / (value * ratio); |
|
beta = sumValue * sumValue * alpha; |
|
minRatio = Math.max(maxValue / beta, beta / minValue); |
|
|
|
// Keep adding nodes while the aspect ratio maintains or improves. |
|
for (; i1 < n; ++i1) { |
|
sumValue += nodeValue = nodes[i1].value; |
|
if (nodeValue < minValue) minValue = nodeValue; |
|
if (nodeValue > maxValue) maxValue = nodeValue; |
|
beta = sumValue * sumValue * alpha; |
|
newRatio = Math.max(maxValue / beta, beta / minValue); |
|
if (newRatio > minRatio) { sumValue -= nodeValue; break; } |
|
minRatio = newRatio; |
|
} |
|
|
|
// Position and record the row orientation. |
|
rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)}); |
|
if (row.dice) Object(_dice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1); |
|
else Object(_slice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1); |
|
value -= sumValue, i0 = i1; |
|
} |
|
|
|
return rows; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(ratio) { |
|
|
|
function squarify(parent, x0, y0, x1, y1) { |
|
squarifyRatio(ratio, parent, x0, y0, x1, y1); |
|
} |
|
|
|
squarify.ratio = function(x) { |
|
return custom((x = +x) > 1 ? x : 1); |
|
}; |
|
|
|
return squarify; |
|
})(phi)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/array.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/array.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default, genericArray */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericArray", function() { return genericArray; }); |
|
/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "../node_modules/d3-interpolate/src/value.js"); |
|
/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./numberArray.js */ "../node_modules/d3-interpolate/src/numberArray.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return (Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_1__["isNumberArray"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : genericArray)(a, b); |
|
}); |
|
|
|
function genericArray(a, b) { |
|
var nb = b ? b.length : 0, |
|
na = a ? Math.min(nb, a.length) : 0, |
|
x = new Array(na), |
|
c = new Array(nb), |
|
i; |
|
|
|
for (i = 0; i < na; ++i) x[i] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a[i], b[i]); |
|
for (; i < nb; ++i) c[i] = b[i]; |
|
|
|
return function(t) { |
|
for (i = 0; i < na; ++i) c[i] = x[i](t); |
|
return c; |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/basis.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/basis.js ***! |
|
\***************************************************/ |
|
/*! exports provided: basis, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basis", function() { return basis; }); |
|
function basis(t1, v0, v1, v2, v3) { |
|
var t2 = t1 * t1, t3 = t2 * t1; |
|
return ((1 - 3 * t1 + 3 * t2 - t3) * v0 |
|
+ (4 - 6 * t2 + 3 * t3) * v1 |
|
+ (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 |
|
+ t3 * v3) / 6; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values) { |
|
var n = values.length - 1; |
|
return function(t) { |
|
var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), |
|
v1 = values[i], |
|
v2 = values[i + 1], |
|
v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, |
|
v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1; |
|
return basis((t - i / n) * n, v0, v1, v2, v3); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/basisClosed.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/basisClosed.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ "../node_modules/d3-interpolate/src/basis.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(values) { |
|
var n = values.length; |
|
return function(t) { |
|
var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), |
|
v0 = values[(i + n - 1) % n], |
|
v1 = values[i % n], |
|
v2 = values[(i + 1) % n], |
|
v3 = values[(i + 2) % n]; |
|
return Object(_basis_js__WEBPACK_IMPORTED_MODULE_0__["basis"])((t - i / n) * n, v0, v1, v2, v3); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/color.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/color.js ***! |
|
\***************************************************/ |
|
/*! exports provided: hue, gamma, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hue", function() { return hue; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gamma", function() { return gamma; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return nogamma; }); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-interpolate/src/constant.js"); |
|
|
|
|
|
function linear(a, d) { |
|
return function(t) { |
|
return a + t * d; |
|
}; |
|
} |
|
|
|
function exponential(a, b, y) { |
|
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { |
|
return Math.pow(a + t * b, y); |
|
}; |
|
} |
|
|
|
function hue(a, b) { |
|
var d = b - a; |
|
return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a); |
|
} |
|
|
|
function gamma(y) { |
|
return (y = +y) === 1 ? nogamma : function(a, b) { |
|
return b - a ? exponential(a, b, y) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a); |
|
}; |
|
} |
|
|
|
function nogamma(a, b) { |
|
var d = b - a; |
|
return d ? linear(a, d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(isNaN(a) ? b : a); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/constant.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/constant.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/cubehelix.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/cubehelix.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default, cubehelixLong */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cubehelixLong", function() { return cubehelixLong; }); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-interpolate/src/color.js"); |
|
|
|
|
|
|
|
function cubehelix(hue) { |
|
return (function cubehelixGamma(y) { |
|
y = +y; |
|
|
|
function cubehelix(start, end) { |
|
var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(end)).h), |
|
s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.s, end.s), |
|
l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l), |
|
opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity); |
|
return function(t) { |
|
start.h = h(t); |
|
start.s = s(t); |
|
start.l = l(Math.pow(t, y)); |
|
start.opacity = opacity(t); |
|
return start + ""; |
|
}; |
|
} |
|
|
|
cubehelix.gamma = cubehelixGamma; |
|
|
|
return cubehelix; |
|
})(1); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"])); |
|
var cubehelixLong = cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/date.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/date.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var d = new Date; |
|
return a = +a, b = +b, function(t) { |
|
return d.setTime(a * (1 - t) + b * t), d; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/discrete.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/discrete.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(range) { |
|
var n = range.length; |
|
return function(t) { |
|
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/hcl.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/hcl.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default, hclLong */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hclLong", function() { return hclLong; }); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-interpolate/src/color.js"); |
|
|
|
|
|
|
|
function hcl(hue) { |
|
return function(start, end) { |
|
var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hcl"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hcl"])(end)).h), |
|
c = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.c, end.c), |
|
l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l), |
|
opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity); |
|
return function(t) { |
|
start.h = h(t); |
|
start.c = c(t); |
|
start.l = l(t); |
|
start.opacity = opacity(t); |
|
return start + ""; |
|
}; |
|
} |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"])); |
|
var hclLong = hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/hsl.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/hsl.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default, hslLong */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslLong", function() { return hslLong; }); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-interpolate/src/color.js"); |
|
|
|
|
|
|
|
function hsl(hue) { |
|
return function(start, end) { |
|
var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hsl"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["hsl"])(end)).h), |
|
s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.s, end.s), |
|
l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.l, end.l), |
|
opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity); |
|
return function(t) { |
|
start.h = h(t); |
|
start.s = s(t); |
|
start.l = l(t); |
|
start.opacity = opacity(t); |
|
return start + ""; |
|
}; |
|
} |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__["hue"])); |
|
var hslLong = hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"]); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/hue.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/hue.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-interpolate/src/color.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var i = Object(_color_js__WEBPACK_IMPORTED_MODULE_0__["hue"])(+a, +b); |
|
return function(t) { |
|
var x = i(t); |
|
return x - 360 * Math.floor(x / 360); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/index.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/index.js ***! |
|
\***************************************************/ |
|
/*! exports provided: interpolate, interpolateArray, interpolateBasis, interpolateBasisClosed, interpolateDate, interpolateDiscrete, interpolateHue, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateRound, interpolateString, interpolateTransformCss, interpolateTransformSvg, interpolateZoom, interpolateRgb, interpolateRgbBasis, interpolateRgbBasisClosed, interpolateHsl, interpolateHslLong, interpolateLab, interpolateHcl, interpolateHclLong, interpolateCubehelix, interpolateCubehelixLong, piecewise, quantize */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "../node_modules/d3-interpolate/src/value.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolate", function() { return _value_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array.js */ "../node_modules/d3-interpolate/src/array.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateArray", function() { return _array_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basis.js */ "../node_modules/d3-interpolate/src/basis.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasis", function() { return _basis_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./basisClosed.js */ "../node_modules/d3-interpolate/src/basisClosed.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasisClosed", function() { return _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./date.js */ "../node_modules/d3-interpolate/src/date.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDate", function() { return _date_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _discrete_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./discrete.js */ "../node_modules/d3-interpolate/src/discrete.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDiscrete", function() { return _discrete_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _hue_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hue.js */ "../node_modules/d3-interpolate/src/hue.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHue", function() { return _hue_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number.js */ "../node_modules/d3-interpolate/src/number.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumber", function() { return _number_js__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ "../node_modules/d3-interpolate/src/numberArray.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumberArray", function() { return _numberArray_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./object.js */ "../node_modules/d3-interpolate/src/object.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateObject", function() { return _object_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./round.js */ "../node_modules/d3-interpolate/src/round.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRound", function() { return _round_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./string.js */ "../node_modules/d3-interpolate/src/string.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateString", function() { return _string_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _transform_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transform/index.js */ "../node_modules/d3-interpolate/src/transform/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__["interpolateTransformCss"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__["interpolateTransformSvg"]; }); |
|
|
|
/* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./zoom.js */ "../node_modules/d3-interpolate/src/zoom.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateZoom", function() { return _zoom_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rgb.js */ "../node_modules/d3-interpolate/src/rgb.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgb", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasis", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["rgbBasis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasisClosed", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__["rgbBasisClosed"]; }); |
|
|
|
/* harmony import */ var _hsl_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hsl.js */ "../node_modules/d3-interpolate/src/hsl.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHsl", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHslLong", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__["hslLong"]; }); |
|
|
|
/* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lab.js */ "../node_modules/d3-interpolate/src/lab.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateLab", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_16__["default"]; }); |
|
|
|
/* harmony import */ var _hcl_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./hcl.js */ "../node_modules/d3-interpolate/src/hcl.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHcl", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHclLong", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__["hclLong"]; }); |
|
|
|
/* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./cubehelix.js */ "../node_modules/d3-interpolate/src/cubehelix.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelix", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelixLong", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__["cubehelixLong"]; }); |
|
|
|
/* harmony import */ var _piecewise_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./piecewise.js */ "../node_modules/d3-interpolate/src/piecewise.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "piecewise", function() { return _piecewise_js__WEBPACK_IMPORTED_MODULE_19__["default"]; }); |
|
|
|
/* harmony import */ var _quantize_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./quantize.js */ "../node_modules/d3-interpolate/src/quantize.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quantize", function() { return _quantize_js__WEBPACK_IMPORTED_MODULE_20__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/lab.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/lab.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return lab; }); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-interpolate/src/color.js"); |
|
|
|
|
|
|
|
function lab(start, end) { |
|
var l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["lab"])(start)).l, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["lab"])(end)).l), |
|
a = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.a, end.a), |
|
b = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.b, end.b), |
|
opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start.opacity, end.opacity); |
|
return function(t) { |
|
start.l = l(t); |
|
start.a = a(t); |
|
start.b = b(t); |
|
start.opacity = opacity(t); |
|
return start + ""; |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/number.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/number.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return a = +a, b = +b, function(t) { |
|
return a * (1 - t) + b * t; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/numberArray.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/numberArray.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default, isNumberArray */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumberArray", function() { return isNumberArray; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
if (!b) b = []; |
|
var n = a ? Math.min(b.length, a.length) : 0, |
|
c = b.slice(), |
|
i; |
|
return function(t) { |
|
for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; |
|
return c; |
|
}; |
|
}); |
|
|
|
function isNumberArray(x) { |
|
return ArrayBuffer.isView(x) && !(x instanceof DataView); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/object.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/object.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ "../node_modules/d3-interpolate/src/value.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var i = {}, |
|
c = {}, |
|
k; |
|
|
|
if (a === null || typeof a !== "object") a = {}; |
|
if (b === null || typeof b !== "object") b = {}; |
|
|
|
for (k in b) { |
|
if (k in a) { |
|
i[k] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a[k], b[k]); |
|
} else { |
|
c[k] = b[k]; |
|
} |
|
} |
|
|
|
return function(t) { |
|
for (k in i) c[k] = i[k](t); |
|
return c; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/piecewise.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/piecewise.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return piecewise; }); |
|
function piecewise(interpolate, values) { |
|
var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n); |
|
while (i < n) I[i] = interpolate(v, v = values[++i]); |
|
return function(t) { |
|
var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n))); |
|
return I[i](t - i); |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/quantize.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/quantize.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(interpolator, n) { |
|
var samples = new Array(n); |
|
for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1)); |
|
return samples; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/rgb.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/rgb.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default, rgbBasis, rgbBasisClosed */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbBasis", function() { return rgbBasis; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rgbBasisClosed", function() { return rgbBasisClosed; }); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./basis.js */ "../node_modules/d3-interpolate/src/basis.js"); |
|
/* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basisClosed.js */ "../node_modules/d3-interpolate/src/basisClosed.js"); |
|
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./color.js */ "../node_modules/d3-interpolate/src/color.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function rgbGamma(y) { |
|
var color = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__["gamma"])(y); |
|
|
|
function rgb(start, end) { |
|
var r = color((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(start)).r, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(end)).r), |
|
g = color(start.g, end.g), |
|
b = color(start.b, end.b), |
|
opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__["default"])(start.opacity, end.opacity); |
|
return function(t) { |
|
start.r = r(t); |
|
start.g = g(t); |
|
start.b = b(t); |
|
start.opacity = opacity(t); |
|
return start + ""; |
|
}; |
|
} |
|
|
|
rgb.gamma = rgbGamma; |
|
|
|
return rgb; |
|
})(1)); |
|
|
|
function rgbSpline(spline) { |
|
return function(colors) { |
|
var n = colors.length, |
|
r = new Array(n), |
|
g = new Array(n), |
|
b = new Array(n), |
|
i, color; |
|
for (i = 0; i < n; ++i) { |
|
color = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(colors[i]); |
|
r[i] = color.r || 0; |
|
g[i] = color.g || 0; |
|
b[i] = color.b || 0; |
|
} |
|
r = spline(r); |
|
g = spline(g); |
|
b = spline(b); |
|
color.opacity = 1; |
|
return function(t) { |
|
color.r = r(t); |
|
color.g = g(t); |
|
color.b = b(t); |
|
return color + ""; |
|
}; |
|
}; |
|
} |
|
|
|
var rgbBasis = rgbSpline(_basis_js__WEBPACK_IMPORTED_MODULE_1__["default"]); |
|
var rgbBasisClosed = rgbSpline(_basisClosed_js__WEBPACK_IMPORTED_MODULE_2__["default"]); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/round.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/round.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return a = +a, b = +b, function(t) { |
|
return Math.round(a * (1 - t) + b * t); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/string.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/string.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ "../node_modules/d3-interpolate/src/number.js"); |
|
|
|
|
|
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, |
|
reB = new RegExp(reA.source, "g"); |
|
|
|
function zero(b) { |
|
return function() { |
|
return b; |
|
}; |
|
} |
|
|
|
function one(b) { |
|
return function(t) { |
|
return b(t) + ""; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b |
|
am, // current match in a |
|
bm, // current match in b |
|
bs, // string preceding current number in b, if any |
|
i = -1, // index in s |
|
s = [], // string constants and placeholders |
|
q = []; // number interpolators |
|
|
|
// Coerce inputs to strings. |
|
a = a + "", b = b + ""; |
|
|
|
// Interpolate pairs of numbers in a & b. |
|
while ((am = reA.exec(a)) |
|
&& (bm = reB.exec(b))) { |
|
if ((bs = bm.index) > bi) { // a string precedes the next number in b |
|
bs = b.slice(bi, bs); |
|
if (s[i]) s[i] += bs; // coalesce with previous string |
|
else s[++i] = bs; |
|
} |
|
if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match |
|
if (s[i]) s[i] += bm; // coalesce with previous string |
|
else s[++i] = bm; |
|
} else { // interpolate non-matching numbers |
|
s[++i] = null; |
|
q.push({i: i, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(am, bm)}); |
|
} |
|
bi = reB.lastIndex; |
|
} |
|
|
|
// Add remains of b. |
|
if (bi < b.length) { |
|
bs = b.slice(bi); |
|
if (s[i]) s[i] += bs; // coalesce with previous string |
|
else s[++i] = bs; |
|
} |
|
|
|
// Special optimization for only a single match. |
|
// Otherwise, interpolate each of the numbers and rejoin the string. |
|
return s.length < 2 ? (q[0] |
|
? one(q[0].x) |
|
: zero(b)) |
|
: (b = q.length, function(t) { |
|
for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); |
|
return s.join(""); |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/transform/decompose.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/transform/decompose.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: identity, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; }); |
|
var degrees = 180 / Math.PI; |
|
|
|
var identity = { |
|
translateX: 0, |
|
translateY: 0, |
|
rotate: 0, |
|
skewX: 0, |
|
scaleX: 1, |
|
scaleY: 1 |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b, c, d, e, f) { |
|
var scaleX, scaleY, skewX; |
|
if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; |
|
if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; |
|
if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; |
|
if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; |
|
return { |
|
translateX: e, |
|
translateY: f, |
|
rotate: Math.atan2(b, a) * degrees, |
|
skewX: Math.atan(skewX) * degrees, |
|
scaleX: scaleX, |
|
scaleY: scaleY |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/transform/index.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/transform/index.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: interpolateTransformCss, interpolateTransformSvg */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return interpolateTransformCss; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return interpolateTransformSvg; }); |
|
/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../number.js */ "../node_modules/d3-interpolate/src/number.js"); |
|
/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ "../node_modules/d3-interpolate/src/transform/parse.js"); |
|
|
|
|
|
|
|
function interpolateTransform(parse, pxComma, pxParen, degParen) { |
|
|
|
function pop(s) { |
|
return s.length ? s.pop() + " " : ""; |
|
} |
|
|
|
function translate(xa, ya, xb, yb, s, q) { |
|
if (xa !== xb || ya !== yb) { |
|
var i = s.push("translate(", null, pxComma, null, pxParen); |
|
q.push({i: i - 4, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)}, {i: i - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)}); |
|
} else if (xb || yb) { |
|
s.push("translate(" + xb + pxComma + yb + pxParen); |
|
} |
|
} |
|
|
|
function rotate(a, b, s, q) { |
|
if (a !== b) { |
|
if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path |
|
q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)}); |
|
} else if (b) { |
|
s.push(pop(s) + "rotate(" + b + degParen); |
|
} |
|
} |
|
|
|
function skewX(a, b, s, q) { |
|
if (a !== b) { |
|
q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)}); |
|
} else if (b) { |
|
s.push(pop(s) + "skewX(" + b + degParen); |
|
} |
|
} |
|
|
|
function scale(xa, ya, xb, yb, s, q) { |
|
if (xa !== xb || ya !== yb) { |
|
var i = s.push(pop(s) + "scale(", null, ",", null, ")"); |
|
q.push({i: i - 4, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)}, {i: i - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)}); |
|
} else if (xb !== 1 || yb !== 1) { |
|
s.push(pop(s) + "scale(" + xb + "," + yb + ")"); |
|
} |
|
} |
|
|
|
return function(a, b) { |
|
var s = [], // string constants and placeholders |
|
q = []; // number interpolators |
|
a = parse(a), b = parse(b); |
|
translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); |
|
rotate(a.rotate, b.rotate, s, q); |
|
skewX(a.skewX, b.skewX, s, q); |
|
scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); |
|
a = b = null; // gc |
|
return function(t) { |
|
var i = -1, n = q.length, o; |
|
while (++i < n) s[(o = q[i]).i] = o.x(t); |
|
return s.join(""); |
|
}; |
|
}; |
|
} |
|
|
|
var interpolateTransformCss = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__["parseCss"], "px, ", "px)", "deg)"); |
|
var interpolateTransformSvg = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__["parseSvg"], ", ", ")", ")"); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/transform/parse.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/transform/parse.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: parseCss, parseSvg */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCss", function() { return parseCss; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSvg", function() { return parseSvg; }); |
|
/* harmony import */ var _decompose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decompose.js */ "../node_modules/d3-interpolate/src/transform/decompose.js"); |
|
|
|
|
|
var cssNode, |
|
cssRoot, |
|
cssView, |
|
svgNode; |
|
|
|
function parseCss(value) { |
|
if (value === "none") return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"]; |
|
if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; |
|
cssNode.style.transform = value; |
|
value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); |
|
cssRoot.removeChild(cssNode); |
|
value = value.slice(7, -1).split(","); |
|
return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); |
|
} |
|
|
|
function parseSvg(value) { |
|
if (value == null) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"]; |
|
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); |
|
svgNode.setAttribute("transform", value); |
|
if (!(value = svgNode.transform.baseVal.consolidate())) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__["identity"]; |
|
value = value.matrix; |
|
return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.a, value.b, value.c, value.d, value.e, value.f); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/value.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/value.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rgb.js */ "../node_modules/d3-interpolate/src/rgb.js"); |
|
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ "../node_modules/d3-interpolate/src/array.js"); |
|
/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date.js */ "../node_modules/d3-interpolate/src/date.js"); |
|
/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number.js */ "../node_modules/d3-interpolate/src/number.js"); |
|
/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./object.js */ "../node_modules/d3-interpolate/src/object.js"); |
|
/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./string.js */ "../node_modules/d3-interpolate/src/string.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-interpolate/src/constant.js"); |
|
/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ "../node_modules/d3-interpolate/src/numberArray.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var t = typeof b, c; |
|
return b == null || t === "boolean" ? Object(_constant_js__WEBPACK_IMPORTED_MODULE_7__["default"])(b) |
|
: (t === "number" ? _number_js__WEBPACK_IMPORTED_MODULE_4__["default"] |
|
: t === "string" ? ((c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["color"])(b)) ? (b = c, _rgb_js__WEBPACK_IMPORTED_MODULE_1__["default"]) : _string_js__WEBPACK_IMPORTED_MODULE_6__["default"]) |
|
: b instanceof d3_color__WEBPACK_IMPORTED_MODULE_0__["color"] ? _rgb_js__WEBPACK_IMPORTED_MODULE_1__["default"] |
|
: b instanceof Date ? _date_js__WEBPACK_IMPORTED_MODULE_3__["default"] |
|
: Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_8__["isNumberArray"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_8__["default"] |
|
: Array.isArray(b) ? _array_js__WEBPACK_IMPORTED_MODULE_2__["genericArray"] |
|
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? _object_js__WEBPACK_IMPORTED_MODULE_5__["default"] |
|
: _number_js__WEBPACK_IMPORTED_MODULE_4__["default"])(a, b); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-interpolate/src/zoom.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-interpolate/src/zoom.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var rho = Math.SQRT2, |
|
rho2 = 2, |
|
rho4 = 4, |
|
epsilon2 = 1e-12; |
|
|
|
function cosh(x) { |
|
return ((x = Math.exp(x)) + 1 / x) / 2; |
|
} |
|
|
|
function sinh(x) { |
|
return ((x = Math.exp(x)) - 1 / x) / 2; |
|
} |
|
|
|
function tanh(x) { |
|
return ((x = Math.exp(2 * x)) - 1) / (x + 1); |
|
} |
|
|
|
// p0 = [ux0, uy0, w0] |
|
// p1 = [ux1, uy1, w1] |
|
/* harmony default export */ __webpack_exports__["default"] = (function(p0, p1) { |
|
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], |
|
ux1 = p1[0], uy1 = p1[1], w1 = p1[2], |
|
dx = ux1 - ux0, |
|
dy = uy1 - uy0, |
|
d2 = dx * dx + dy * dy, |
|
i, |
|
S; |
|
|
|
// Special case for u0 ≅ u1. |
|
if (d2 < epsilon2) { |
|
S = Math.log(w1 / w0) / rho; |
|
i = function(t) { |
|
return [ |
|
ux0 + t * dx, |
|
uy0 + t * dy, |
|
w0 * Math.exp(rho * t * S) |
|
]; |
|
} |
|
} |
|
|
|
// General case. |
|
else { |
|
var d1 = Math.sqrt(d2), |
|
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), |
|
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), |
|
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), |
|
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1); |
|
S = (r1 - r0) / rho; |
|
i = function(t) { |
|
var s = t * S, |
|
coshr0 = cosh(r0), |
|
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0)); |
|
return [ |
|
ux0 + u * dx, |
|
uy0 + u * dy, |
|
w0 * coshr0 / cosh(rho * s + r0) |
|
]; |
|
} |
|
} |
|
|
|
i.duration = S * 1000; |
|
|
|
return i; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-path/src/index.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-path/src/index.js ***! |
|
\********************************************/ |
|
/*! exports provided: path */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path.js */ "../node_modules/d3-path/src/path.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "path", function() { return _path_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-path/src/path.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-path/src/path.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var pi = Math.PI, |
|
tau = 2 * pi, |
|
epsilon = 1e-6, |
|
tauEpsilon = tau - epsilon; |
|
|
|
function Path() { |
|
this._x0 = this._y0 = // start of current subpath |
|
this._x1 = this._y1 = null; // end of current subpath |
|
this._ = ""; |
|
} |
|
|
|
function path() { |
|
return new Path; |
|
} |
|
|
|
Path.prototype = path.prototype = { |
|
constructor: Path, |
|
moveTo: function(x, y) { |
|
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y); |
|
}, |
|
closePath: function() { |
|
if (this._x1 !== null) { |
|
this._x1 = this._x0, this._y1 = this._y0; |
|
this._ += "Z"; |
|
} |
|
}, |
|
lineTo: function(x, y) { |
|
this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y); |
|
}, |
|
quadraticCurveTo: function(x1, y1, x, y) { |
|
this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y); |
|
}, |
|
bezierCurveTo: function(x1, y1, x2, y2, x, y) { |
|
this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y); |
|
}, |
|
arcTo: function(x1, y1, x2, y2, r) { |
|
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; |
|
var x0 = this._x1, |
|
y0 = this._y1, |
|
x21 = x2 - x1, |
|
y21 = y2 - y1, |
|
x01 = x0 - x1, |
|
y01 = y0 - y1, |
|
l01_2 = x01 * x01 + y01 * y01; |
|
|
|
// Is the radius negative? Error. |
|
if (r < 0) throw new Error("negative radius: " + r); |
|
|
|
// Is this path empty? Move to (x1,y1). |
|
if (this._x1 === null) { |
|
this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); |
|
} |
|
|
|
// Or, is (x1,y1) coincident with (x0,y0)? Do nothing. |
|
else if (!(l01_2 > epsilon)); |
|
|
|
// Or, are (x0,y0), (x1,y1) and (x2,y2) collinear? |
|
// Equivalently, is (x1,y1) coincident with (x2,y2)? |
|
// Or, is the radius zero? Line to (x1,y1). |
|
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { |
|
this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); |
|
} |
|
|
|
// Otherwise, draw an arc! |
|
else { |
|
var x20 = x2 - x0, |
|
y20 = y2 - y0, |
|
l21_2 = x21 * x21 + y21 * y21, |
|
l20_2 = x20 * x20 + y20 * y20, |
|
l21 = Math.sqrt(l21_2), |
|
l01 = Math.sqrt(l01_2), |
|
l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), |
|
t01 = l / l01, |
|
t21 = l / l21; |
|
|
|
// If the start tangent is not coincident with (x0,y0), line to. |
|
if (Math.abs(t01 - 1) > epsilon) { |
|
this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); |
|
} |
|
|
|
this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); |
|
} |
|
}, |
|
arc: function(x, y, r, a0, a1, ccw) { |
|
x = +x, y = +y, r = +r, ccw = !!ccw; |
|
var dx = r * Math.cos(a0), |
|
dy = r * Math.sin(a0), |
|
x0 = x + dx, |
|
y0 = y + dy, |
|
cw = 1 ^ ccw, |
|
da = ccw ? a0 - a1 : a1 - a0; |
|
|
|
// Is the radius negative? Error. |
|
if (r < 0) throw new Error("negative radius: " + r); |
|
|
|
// Is this path empty? Move to (x0,y0). |
|
if (this._x1 === null) { |
|
this._ += "M" + x0 + "," + y0; |
|
} |
|
|
|
// Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0). |
|
else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { |
|
this._ += "L" + x0 + "," + y0; |
|
} |
|
|
|
// Is this arc empty? We’re done. |
|
if (!r) return; |
|
|
|
// Does the angle go the wrong way? Flip the direction. |
|
if (da < 0) da = da % tau + tau; |
|
|
|
// Is this a complete circle? Draw two arcs to complete the circle. |
|
if (da > tauEpsilon) { |
|
this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); |
|
} |
|
|
|
// Is this arc non-empty? Draw an arc! |
|
else if (da > epsilon) { |
|
this._ += "A" + r + "," + r + ",0," + (+(da >= pi)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)); |
|
} |
|
}, |
|
rect: function(x, y, w, h) { |
|
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z"; |
|
}, |
|
toString: function() { |
|
return this._; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (path); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/area.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/area.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(polygon) { |
|
var i = -1, |
|
n = polygon.length, |
|
a, |
|
b = polygon[n - 1], |
|
area = 0; |
|
|
|
while (++i < n) { |
|
a = b; |
|
b = polygon[i]; |
|
area += a[1] * b[0] - a[0] * b[1]; |
|
} |
|
|
|
return area / 2; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/centroid.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/centroid.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(polygon) { |
|
var i = -1, |
|
n = polygon.length, |
|
x = 0, |
|
y = 0, |
|
a, |
|
b = polygon[n - 1], |
|
c, |
|
k = 0; |
|
|
|
while (++i < n) { |
|
a = b; |
|
b = polygon[i]; |
|
k += c = a[0] * b[1] - b[0] * a[1]; |
|
x += (a[0] + b[0]) * c; |
|
y += (a[1] + b[1]) * c; |
|
} |
|
|
|
return k *= 3, [x / k, y / k]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/contains.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/contains.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(polygon, point) { |
|
var n = polygon.length, |
|
p = polygon[n - 1], |
|
x = point[0], y = point[1], |
|
x0 = p[0], y0 = p[1], |
|
x1, y1, |
|
inside = false; |
|
|
|
for (var i = 0; i < n; ++i) { |
|
p = polygon[i], x1 = p[0], y1 = p[1]; |
|
if (((y1 > y) !== (y0 > y)) && (x < (x0 - x1) * (y - y1) / (y0 - y1) + x1)) inside = !inside; |
|
x0 = x1, y0 = y1; |
|
} |
|
|
|
return inside; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/cross.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/cross.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
// Returns the 2D cross product of AB and AC vectors, i.e., the z-component of |
|
// the 3D cross product in a quadrant I Cartesian coordinate system (+x is |
|
// right, +y is up). Returns a positive value if ABC is counter-clockwise, |
|
// negative if clockwise, and zero if the points are collinear. |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b, c) { |
|
return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/hull.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/hull.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _cross_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cross.js */ "../node_modules/d3-polygon/src/cross.js"); |
|
|
|
|
|
function lexicographicOrder(a, b) { |
|
return a[0] - b[0] || a[1] - b[1]; |
|
} |
|
|
|
// Computes the upper convex hull per the monotone chain algorithm. |
|
// Assumes points.length >= 3, is sorted by x, unique in y. |
|
// Returns an array of indices into points in left-to-right order. |
|
function computeUpperHullIndexes(points) { |
|
var n = points.length, |
|
indexes = [0, 1], |
|
size = 2; |
|
|
|
for (var i = 2; i < n; ++i) { |
|
while (size > 1 && Object(_cross_js__WEBPACK_IMPORTED_MODULE_0__["default"])(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size; |
|
indexes[size++] = i; |
|
} |
|
|
|
return indexes.slice(0, size); // remove popped points |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(points) { |
|
if ((n = points.length) < 3) return null; |
|
|
|
var i, |
|
n, |
|
sortedPoints = new Array(n), |
|
flippedPoints = new Array(n); |
|
|
|
for (i = 0; i < n; ++i) sortedPoints[i] = [+points[i][0], +points[i][1], i]; |
|
sortedPoints.sort(lexicographicOrder); |
|
for (i = 0; i < n; ++i) flippedPoints[i] = [sortedPoints[i][0], -sortedPoints[i][1]]; |
|
|
|
var upperIndexes = computeUpperHullIndexes(sortedPoints), |
|
lowerIndexes = computeUpperHullIndexes(flippedPoints); |
|
|
|
// Construct the hull polygon, removing possible duplicate endpoints. |
|
var skipLeft = lowerIndexes[0] === upperIndexes[0], |
|
skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1], |
|
hull = []; |
|
|
|
// Add upper hull in right-to-l order. |
|
// Then add lower hull in left-to-right order. |
|
for (i = upperIndexes.length - 1; i >= 0; --i) hull.push(points[sortedPoints[upperIndexes[i]][2]]); |
|
for (i = +skipLeft; i < lowerIndexes.length - skipRight; ++i) hull.push(points[sortedPoints[lowerIndexes[i]][2]]); |
|
|
|
return hull; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/index.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/index.js ***! |
|
\***********************************************/ |
|
/*! exports provided: polygonArea, polygonCentroid, polygonHull, polygonContains, polygonLength */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _area_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./area.js */ "../node_modules/d3-polygon/src/area.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonArea", function() { return _area_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _centroid_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./centroid.js */ "../node_modules/d3-polygon/src/centroid.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonCentroid", function() { return _centroid_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _hull_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hull.js */ "../node_modules/d3-polygon/src/hull.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonHull", function() { return _hull_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contains.js */ "../node_modules/d3-polygon/src/contains.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonContains", function() { return _contains_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _length_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./length.js */ "../node_modules/d3-polygon/src/length.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonLength", function() { return _length_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-polygon/src/length.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-polygon/src/length.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(polygon) { |
|
var i = -1, |
|
n = polygon.length, |
|
b = polygon[n - 1], |
|
xa, |
|
ya, |
|
xb = b[0], |
|
yb = b[1], |
|
perimeter = 0; |
|
|
|
while (++i < n) { |
|
xa = xb; |
|
ya = yb; |
|
b = polygon[i]; |
|
xb = b[0]; |
|
yb = b[1]; |
|
xa -= xb; |
|
ya -= yb; |
|
perimeter += Math.sqrt(xa * xa + ya * ya); |
|
} |
|
|
|
return perimeter; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/add.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/add.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default, addAll */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAll", function() { return addAll; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(d) { |
|
var x = +this._x.call(null, d), |
|
y = +this._y.call(null, d); |
|
return add(this.cover(x, y), x, y, d); |
|
}); |
|
|
|
function add(tree, x, y, d) { |
|
if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points |
|
|
|
var parent, |
|
node = tree._root, |
|
leaf = {data: d}, |
|
x0 = tree._x0, |
|
y0 = tree._y0, |
|
x1 = tree._x1, |
|
y1 = tree._y1, |
|
xm, |
|
ym, |
|
xp, |
|
yp, |
|
right, |
|
bottom, |
|
i, |
|
j; |
|
|
|
// If the tree is empty, initialize the root as a leaf. |
|
if (!node) return tree._root = leaf, tree; |
|
|
|
// Find the existing leaf for the new point, or add it. |
|
while (node.length) { |
|
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; |
|
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; |
|
if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree; |
|
} |
|
|
|
// Is the new point is exactly coincident with the existing point? |
|
xp = +tree._x.call(null, node.data); |
|
yp = +tree._y.call(null, node.data); |
|
if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree; |
|
|
|
// Otherwise, split the leaf node until the old and new point are separated. |
|
do { |
|
parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4); |
|
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; |
|
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; |
|
} while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm))); |
|
return parent[j] = node, parent[i] = leaf, tree; |
|
} |
|
|
|
function addAll(data) { |
|
var d, i, n = data.length, |
|
x, |
|
y, |
|
xz = new Array(n), |
|
yz = new Array(n), |
|
x0 = Infinity, |
|
y0 = Infinity, |
|
x1 = -Infinity, |
|
y1 = -Infinity; |
|
|
|
// Compute the points and their extent. |
|
for (i = 0; i < n; ++i) { |
|
if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue; |
|
xz[i] = x; |
|
yz[i] = y; |
|
if (x < x0) x0 = x; |
|
if (x > x1) x1 = x; |
|
if (y < y0) y0 = y; |
|
if (y > y1) y1 = y; |
|
} |
|
|
|
// If there were no (valid) points, abort. |
|
if (x0 > x1 || y0 > y1) return this; |
|
|
|
// Expand the tree to cover the new points. |
|
this.cover(x0, y0).cover(x1, y1); |
|
|
|
// Add the new points. |
|
for (i = 0; i < n; ++i) { |
|
add(this, xz[i], yz[i], data[i]); |
|
} |
|
|
|
return this; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/cover.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/cover.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x, y) { |
|
if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points |
|
|
|
var x0 = this._x0, |
|
y0 = this._y0, |
|
x1 = this._x1, |
|
y1 = this._y1; |
|
|
|
// If the quadtree has no extent, initialize them. |
|
// Integer extent are necessary so that if we later double the extent, |
|
// the existing quadrant boundaries don’t change due to floating point error! |
|
if (isNaN(x0)) { |
|
x1 = (x0 = Math.floor(x)) + 1; |
|
y1 = (y0 = Math.floor(y)) + 1; |
|
} |
|
|
|
// Otherwise, double repeatedly to cover. |
|
else { |
|
var z = x1 - x0, |
|
node = this._root, |
|
parent, |
|
i; |
|
|
|
while (x0 > x || x >= x1 || y0 > y || y >= y1) { |
|
i = (y < y0) << 1 | (x < x0); |
|
parent = new Array(4), parent[i] = node, node = parent, z *= 2; |
|
switch (i) { |
|
case 0: x1 = x0 + z, y1 = y0 + z; break; |
|
case 1: x0 = x1 - z, y1 = y0 + z; break; |
|
case 2: x1 = x0 + z, y0 = y1 - z; break; |
|
case 3: x0 = x1 - z, y0 = y1 - z; break; |
|
} |
|
} |
|
|
|
if (this._root && this._root.length) this._root = node; |
|
} |
|
|
|
this._x0 = x0; |
|
this._y0 = y0; |
|
this._x1 = x1; |
|
this._y1 = y1; |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/data.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/data.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var data = []; |
|
this.visit(function(node) { |
|
if (!node.length) do data.push(node.data); while (node = node.next) |
|
}); |
|
return data; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/extent.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/extent.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(_) { |
|
return arguments.length |
|
? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1]) |
|
: isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/find.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/find.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ "../node_modules/d3-quadtree/src/quad.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(x, y, radius) { |
|
var data, |
|
x0 = this._x0, |
|
y0 = this._y0, |
|
x1, |
|
y1, |
|
x2, |
|
y2, |
|
x3 = this._x1, |
|
y3 = this._y1, |
|
quads = [], |
|
node = this._root, |
|
q, |
|
i; |
|
|
|
if (node) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](node, x0, y0, x3, y3)); |
|
if (radius == null) radius = Infinity; |
|
else { |
|
x0 = x - radius, y0 = y - radius; |
|
x3 = x + radius, y3 = y + radius; |
|
radius *= radius; |
|
} |
|
|
|
while (q = quads.pop()) { |
|
|
|
// Stop searching if this quadrant can’t contain a closer node. |
|
if (!(node = q.node) |
|
|| (x1 = q.x0) > x3 |
|
|| (y1 = q.y0) > y3 |
|
|| (x2 = q.x1) < x0 |
|
|| (y2 = q.y1) < y0) continue; |
|
|
|
// Bisect the current quadrant. |
|
if (node.length) { |
|
var xm = (x1 + x2) / 2, |
|
ym = (y1 + y2) / 2; |
|
|
|
quads.push( |
|
new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](node[3], xm, ym, x2, y2), |
|
new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](node[2], x1, ym, xm, y2), |
|
new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](node[1], xm, y1, x2, ym), |
|
new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](node[0], x1, y1, xm, ym) |
|
); |
|
|
|
// Visit the closest quadrant first. |
|
if (i = (y >= ym) << 1 | (x >= xm)) { |
|
q = quads[quads.length - 1]; |
|
quads[quads.length - 1] = quads[quads.length - 1 - i]; |
|
quads[quads.length - 1 - i] = q; |
|
} |
|
} |
|
|
|
// Visit this point. (Visiting coincident points isn’t necessary!) |
|
else { |
|
var dx = x - +this._x.call(null, node.data), |
|
dy = y - +this._y.call(null, node.data), |
|
d2 = dx * dx + dy * dy; |
|
if (d2 < radius) { |
|
var d = Math.sqrt(radius = d2); |
|
x0 = x - d, y0 = y - d; |
|
x3 = x + d, y3 = y + d; |
|
data = node.data; |
|
} |
|
} |
|
} |
|
|
|
return data; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/index.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/index.js ***! |
|
\************************************************/ |
|
/*! exports provided: quadtree */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _quadtree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quadtree.js */ "../node_modules/d3-quadtree/src/quadtree.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quadtree", function() { return _quadtree_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/quad.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/quad.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, x0, y0, x1, y1) { |
|
this.node = node; |
|
this.x0 = x0; |
|
this.y0 = y0; |
|
this.x1 = x1; |
|
this.y1 = y1; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/quadtree.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/quadtree.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return quadtree; }); |
|
/* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "../node_modules/d3-quadtree/src/add.js"); |
|
/* harmony import */ var _cover_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cover.js */ "../node_modules/d3-quadtree/src/cover.js"); |
|
/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.js */ "../node_modules/d3-quadtree/src/data.js"); |
|
/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extent.js */ "../node_modules/d3-quadtree/src/extent.js"); |
|
/* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./find.js */ "../node_modules/d3-quadtree/src/find.js"); |
|
/* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./remove.js */ "../node_modules/d3-quadtree/src/remove.js"); |
|
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./root.js */ "../node_modules/d3-quadtree/src/root.js"); |
|
/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./size.js */ "../node_modules/d3-quadtree/src/size.js"); |
|
/* harmony import */ var _visit_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visit.js */ "../node_modules/d3-quadtree/src/visit.js"); |
|
/* harmony import */ var _visitAfter_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./visitAfter.js */ "../node_modules/d3-quadtree/src/visitAfter.js"); |
|
/* harmony import */ var _x_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./x.js */ "../node_modules/d3-quadtree/src/x.js"); |
|
/* harmony import */ var _y_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./y.js */ "../node_modules/d3-quadtree/src/y.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function quadtree(nodes, x, y) { |
|
var tree = new Quadtree(x == null ? _x_js__WEBPACK_IMPORTED_MODULE_10__["defaultX"] : x, y == null ? _y_js__WEBPACK_IMPORTED_MODULE_11__["defaultY"] : y, NaN, NaN, NaN, NaN); |
|
return nodes == null ? tree : tree.addAll(nodes); |
|
} |
|
|
|
function Quadtree(x, y, x0, y0, x1, y1) { |
|
this._x = x; |
|
this._y = y; |
|
this._x0 = x0; |
|
this._y0 = y0; |
|
this._x1 = x1; |
|
this._y1 = y1; |
|
this._root = undefined; |
|
} |
|
|
|
function leaf_copy(leaf) { |
|
var copy = {data: leaf.data}, next = copy; |
|
while (leaf = leaf.next) next = next.next = {data: leaf.data}; |
|
return copy; |
|
} |
|
|
|
var treeProto = quadtree.prototype = Quadtree.prototype; |
|
|
|
treeProto.copy = function() { |
|
var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), |
|
node = this._root, |
|
nodes, |
|
child; |
|
|
|
if (!node) return copy; |
|
|
|
if (!node.length) return copy._root = leaf_copy(node), copy; |
|
|
|
nodes = [{source: node, target: copy._root = new Array(4)}]; |
|
while (node = nodes.pop()) { |
|
for (var i = 0; i < 4; ++i) { |
|
if (child = node.source[i]) { |
|
if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)}); |
|
else node.target[i] = leaf_copy(child); |
|
} |
|
} |
|
} |
|
|
|
return copy; |
|
}; |
|
|
|
treeProto.add = _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; |
|
treeProto.addAll = _add_js__WEBPACK_IMPORTED_MODULE_0__["addAll"]; |
|
treeProto.cover = _cover_js__WEBPACK_IMPORTED_MODULE_1__["default"]; |
|
treeProto.data = _data_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
|
treeProto.extent = _extent_js__WEBPACK_IMPORTED_MODULE_3__["default"]; |
|
treeProto.find = _find_js__WEBPACK_IMPORTED_MODULE_4__["default"]; |
|
treeProto.remove = _remove_js__WEBPACK_IMPORTED_MODULE_5__["default"]; |
|
treeProto.removeAll = _remove_js__WEBPACK_IMPORTED_MODULE_5__["removeAll"]; |
|
treeProto.root = _root_js__WEBPACK_IMPORTED_MODULE_6__["default"]; |
|
treeProto.size = _size_js__WEBPACK_IMPORTED_MODULE_7__["default"]; |
|
treeProto.visit = _visit_js__WEBPACK_IMPORTED_MODULE_8__["default"]; |
|
treeProto.visitAfter = _visitAfter_js__WEBPACK_IMPORTED_MODULE_9__["default"]; |
|
treeProto.x = _x_js__WEBPACK_IMPORTED_MODULE_10__["default"]; |
|
treeProto.y = _y_js__WEBPACK_IMPORTED_MODULE_11__["default"]; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/remove.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/remove.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default, removeAll */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAll", function() { return removeAll; }); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(d) { |
|
if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points |
|
|
|
var parent, |
|
node = this._root, |
|
retainer, |
|
previous, |
|
next, |
|
x0 = this._x0, |
|
y0 = this._y0, |
|
x1 = this._x1, |
|
y1 = this._y1, |
|
x, |
|
y, |
|
xm, |
|
ym, |
|
right, |
|
bottom, |
|
i, |
|
j; |
|
|
|
// If the tree is empty, initialize the root as a leaf. |
|
if (!node) return this; |
|
|
|
// Find the leaf node for the point. |
|
// While descending, also retain the deepest parent with a non-removed sibling. |
|
if (node.length) while (true) { |
|
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm; |
|
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym; |
|
if (!(parent = node, node = node[i = bottom << 1 | right])) return this; |
|
if (!node.length) break; |
|
if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i; |
|
} |
|
|
|
// Find the point to remove. |
|
while (node.data !== d) if (!(previous = node, node = node.next)) return this; |
|
if (next = node.next) delete node.next; |
|
|
|
// If there are multiple coincident points, remove just the point. |
|
if (previous) return (next ? previous.next = next : delete previous.next), this; |
|
|
|
// If this is the root point, remove it. |
|
if (!parent) return this._root = next, this; |
|
|
|
// Remove this leaf. |
|
next ? parent[i] = next : delete parent[i]; |
|
|
|
// If the parent now contains exactly one leaf, collapse superfluous parents. |
|
if ((node = parent[0] || parent[1] || parent[2] || parent[3]) |
|
&& node === (parent[3] || parent[2] || parent[1] || parent[0]) |
|
&& !node.length) { |
|
if (retainer) retainer[j] = node; |
|
else this._root = node; |
|
} |
|
|
|
return this; |
|
}); |
|
|
|
function removeAll(data) { |
|
for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]); |
|
return this; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/root.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/root.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return this._root; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/size.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/size.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var size = 0; |
|
this.visit(function(node) { |
|
if (!node.length) do ++size; while (node = node.next) |
|
}); |
|
return size; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/visit.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/visit.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ "../node_modules/d3-quadtree/src/quad.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback) { |
|
var quads = [], q, node = this._root, child, x0, y0, x1, y1; |
|
if (node) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](node, this._x0, this._y0, this._x1, this._y1)); |
|
while (q = quads.pop()) { |
|
if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) { |
|
var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; |
|
if (child = node[3]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, xm, ym, x1, y1)); |
|
if (child = node[2]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, x0, ym, xm, y1)); |
|
if (child = node[1]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, xm, y0, x1, ym)); |
|
if (child = node[0]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, x0, y0, xm, ym)); |
|
} |
|
} |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/visitAfter.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/visitAfter.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ "../node_modules/d3-quadtree/src/quad.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback) { |
|
var quads = [], next = [], q; |
|
if (this._root) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](this._root, this._x0, this._y0, this._x1, this._y1)); |
|
while (q = quads.pop()) { |
|
var node = q.node; |
|
if (node.length) { |
|
var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2; |
|
if (child = node[0]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, x0, y0, xm, ym)); |
|
if (child = node[1]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, xm, y0, x1, ym)); |
|
if (child = node[2]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, x0, ym, xm, y1)); |
|
if (child = node[3]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__["default"](child, xm, ym, x1, y1)); |
|
} |
|
next.push(q); |
|
} |
|
while (q = next.pop()) { |
|
callback(q.node, q.x0, q.y0, q.x1, q.y1); |
|
} |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/x.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/x.js ***! |
|
\********************************************/ |
|
/*! exports provided: defaultX, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultX", function() { return defaultX; }); |
|
function defaultX(d) { |
|
return d[0]; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(_) { |
|
return arguments.length ? (this._x = _, this) : this._x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-quadtree/src/y.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-quadtree/src/y.js ***! |
|
\********************************************/ |
|
/*! exports provided: defaultY, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultY", function() { return defaultY; }); |
|
function defaultY(d) { |
|
return d[1]; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(_) { |
|
return arguments.length ? (this._y = _, this) : this._y; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/bates.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-random/src/bates.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultSource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultSource */ "../node_modules/d3-random/src/defaultSource.js"); |
|
/* harmony import */ var _irwinHall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./irwinHall */ "../node_modules/d3-random/src/irwinHall.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function sourceRandomBates(source) { |
|
function randomBates(n) { |
|
var randomIrwinHall = _irwinHall__WEBPACK_IMPORTED_MODULE_1__["default"].source(source)(n); |
|
return function() { |
|
return randomIrwinHall() / n; |
|
}; |
|
} |
|
|
|
randomBates.source = sourceRandomBates; |
|
|
|
return randomBates; |
|
})(_defaultSource__WEBPACK_IMPORTED_MODULE_0__["default"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/defaultSource.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-random/src/defaultSource.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return Math.random(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/exponential.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-random/src/exponential.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultSource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultSource */ "../node_modules/d3-random/src/defaultSource.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function sourceRandomExponential(source) { |
|
function randomExponential(lambda) { |
|
return function() { |
|
return -Math.log(1 - source()) / lambda; |
|
}; |
|
} |
|
|
|
randomExponential.source = sourceRandomExponential; |
|
|
|
return randomExponential; |
|
})(_defaultSource__WEBPACK_IMPORTED_MODULE_0__["default"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/index.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-random/src/index.js ***! |
|
\**********************************************/ |
|
/*! exports provided: randomUniform, randomNormal, randomLogNormal, randomBates, randomIrwinHall, randomExponential */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _uniform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uniform */ "../node_modules/d3-random/src/uniform.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomUniform", function() { return _uniform__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _normal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normal */ "../node_modules/d3-random/src/normal.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomNormal", function() { return _normal__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _logNormal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logNormal */ "../node_modules/d3-random/src/logNormal.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomLogNormal", function() { return _logNormal__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _bates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bates */ "../node_modules/d3-random/src/bates.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomBates", function() { return _bates__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _irwinHall__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./irwinHall */ "../node_modules/d3-random/src/irwinHall.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomIrwinHall", function() { return _irwinHall__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _exponential__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exponential */ "../node_modules/d3-random/src/exponential.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomExponential", function() { return _exponential__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/irwinHall.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-random/src/irwinHall.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultSource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultSource */ "../node_modules/d3-random/src/defaultSource.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function sourceRandomIrwinHall(source) { |
|
function randomIrwinHall(n) { |
|
return function() { |
|
for (var sum = 0, i = 0; i < n; ++i) sum += source(); |
|
return sum; |
|
}; |
|
} |
|
|
|
randomIrwinHall.source = sourceRandomIrwinHall; |
|
|
|
return randomIrwinHall; |
|
})(_defaultSource__WEBPACK_IMPORTED_MODULE_0__["default"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/logNormal.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-random/src/logNormal.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultSource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultSource */ "../node_modules/d3-random/src/defaultSource.js"); |
|
/* harmony import */ var _normal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normal */ "../node_modules/d3-random/src/normal.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function sourceRandomLogNormal(source) { |
|
function randomLogNormal() { |
|
var randomNormal = _normal__WEBPACK_IMPORTED_MODULE_1__["default"].source(source).apply(this, arguments); |
|
return function() { |
|
return Math.exp(randomNormal()); |
|
}; |
|
} |
|
|
|
randomLogNormal.source = sourceRandomLogNormal; |
|
|
|
return randomLogNormal; |
|
})(_defaultSource__WEBPACK_IMPORTED_MODULE_0__["default"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/normal.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-random/src/normal.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultSource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultSource */ "../node_modules/d3-random/src/defaultSource.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function sourceRandomNormal(source) { |
|
function randomNormal(mu, sigma) { |
|
var x, r; |
|
mu = mu == null ? 0 : +mu; |
|
sigma = sigma == null ? 1 : +sigma; |
|
return function() { |
|
var y; |
|
|
|
// If available, use the second previously-generated uniform random. |
|
if (x != null) y = x, x = null; |
|
|
|
// Otherwise, generate a new x and y. |
|
else do { |
|
x = source() * 2 - 1; |
|
y = source() * 2 - 1; |
|
r = x * x + y * y; |
|
} while (!r || r > 1); |
|
|
|
return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r); |
|
}; |
|
} |
|
|
|
randomNormal.source = sourceRandomNormal; |
|
|
|
return randomNormal; |
|
})(_defaultSource__WEBPACK_IMPORTED_MODULE_0__["default"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-random/src/uniform.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-random/src/uniform.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultSource__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultSource */ "../node_modules/d3-random/src/defaultSource.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function sourceRandomUniform(source) { |
|
function randomUniform(min, max) { |
|
min = min == null ? 0 : +min; |
|
max = max == null ? 1 : +max; |
|
if (arguments.length === 1) max = min, min = 0; |
|
else max -= min; |
|
return function() { |
|
return source() * max + min; |
|
}; |
|
} |
|
|
|
randomUniform.source = sourceRandomUniform; |
|
|
|
return randomUniform; |
|
})(_defaultSource__WEBPACK_IMPORTED_MODULE_0__["default"])); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Accent.js": |
|
/*!********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Accent.js ***! |
|
\********************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Dark2.js": |
|
/*!*******************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Dark2.js ***! |
|
\*******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Paired.js": |
|
/*!********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Paired.js ***! |
|
\********************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Pastel1.js": |
|
/*!*********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Pastel1.js ***! |
|
\*********************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Pastel2.js": |
|
/*!*********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Pastel2.js ***! |
|
\*********************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Set1.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Set1.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Set2.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Set2.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Set3.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Set3.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/Tableau10.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/Tableau10.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/categorical/category10.js": |
|
/*!************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/categorical/category10.js ***! |
|
\************************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/colors.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/colors.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(specifier) { |
|
var n = specifier.length / 6 | 0, colors = new Array(n), i = 0; |
|
while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6); |
|
return colors; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/BrBG.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/BrBG.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"d8b365f5f5f55ab4ac", |
|
"a6611adfc27d80cdc1018571", |
|
"a6611adfc27df5f5f580cdc1018571", |
|
"8c510ad8b365f6e8c3c7eae55ab4ac01665e", |
|
"8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e", |
|
"8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e", |
|
"8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e", |
|
"5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30", |
|
"5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/PRGn.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/PRGn.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"af8dc3f7f7f77fbf7b", |
|
"7b3294c2a5cfa6dba0008837", |
|
"7b3294c2a5cff7f7f7a6dba0008837", |
|
"762a83af8dc3e7d4e8d9f0d37fbf7b1b7837", |
|
"762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837", |
|
"762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837", |
|
"762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837", |
|
"40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b", |
|
"40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/PiYG.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/PiYG.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"e9a3c9f7f7f7a1d76a", |
|
"d01c8bf1b6dab8e1864dac26", |
|
"d01c8bf1b6daf7f7f7b8e1864dac26", |
|
"c51b7de9a3c9fde0efe6f5d0a1d76a4d9221", |
|
"c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221", |
|
"c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221", |
|
"c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221", |
|
"8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419", |
|
"8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/PuOr.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/PuOr.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"998ec3f7f7f7f1a340", |
|
"5e3c99b2abd2fdb863e66101", |
|
"5e3c99b2abd2f7f7f7fdb863e66101", |
|
"542788998ec3d8daebfee0b6f1a340b35806", |
|
"542788998ec3d8daebf7f7f7fee0b6f1a340b35806", |
|
"5427888073acb2abd2d8daebfee0b6fdb863e08214b35806", |
|
"5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806", |
|
"2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08", |
|
"2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/RdBu.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/RdBu.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"ef8a62f7f7f767a9cf", |
|
"ca0020f4a58292c5de0571b0", |
|
"ca0020f4a582f7f7f792c5de0571b0", |
|
"b2182bef8a62fddbc7d1e5f067a9cf2166ac", |
|
"b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac", |
|
"b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac", |
|
"b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac", |
|
"67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061", |
|
"67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/RdGy.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/RdGy.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"ef8a62ffffff999999", |
|
"ca0020f4a582bababa404040", |
|
"ca0020f4a582ffffffbababa404040", |
|
"b2182bef8a62fddbc7e0e0e09999994d4d4d", |
|
"b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d", |
|
"b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d", |
|
"b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d", |
|
"67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a", |
|
"67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fc8d59ffffbf91bfdb", |
|
"d7191cfdae61abd9e92c7bb6", |
|
"d7191cfdae61ffffbfabd9e92c7bb6", |
|
"d73027fc8d59fee090e0f3f891bfdb4575b4", |
|
"d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4", |
|
"d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4", |
|
"d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4", |
|
"a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695", |
|
"a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fc8d59ffffbf91cf60", |
|
"d7191cfdae61a6d96a1a9641", |
|
"d7191cfdae61ffffbfa6d96a1a9641", |
|
"d73027fc8d59fee08bd9ef8b91cf601a9850", |
|
"d73027fc8d59fee08bffffbfd9ef8b91cf601a9850", |
|
"d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850", |
|
"d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850", |
|
"a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837", |
|
"a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/diverging/Spectral.js": |
|
/*!********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/diverging/Spectral.js ***! |
|
\********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fc8d59ffffbf99d594", |
|
"d7191cfdae61abdda42b83ba", |
|
"d7191cfdae61ffffbfabdda42b83ba", |
|
"d53e4ffc8d59fee08be6f59899d5943288bd", |
|
"d53e4ffc8d59fee08bffffbfe6f59899d5943288bd", |
|
"d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd", |
|
"d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd", |
|
"9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2", |
|
"9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/index.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/index.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: schemeCategory10, schemeAccent, schemeDark2, schemePaired, schemePastel1, schemePastel2, schemeSet1, schemeSet2, schemeSet3, schemeTableau10, interpolateBrBG, schemeBrBG, interpolatePRGn, schemePRGn, interpolatePiYG, schemePiYG, interpolatePuOr, schemePuOr, interpolateRdBu, schemeRdBu, interpolateRdGy, schemeRdGy, interpolateRdYlBu, schemeRdYlBu, interpolateRdYlGn, schemeRdYlGn, interpolateSpectral, schemeSpectral, interpolateBuGn, schemeBuGn, interpolateBuPu, schemeBuPu, interpolateGnBu, schemeGnBu, interpolateOrRd, schemeOrRd, interpolatePuBuGn, schemePuBuGn, interpolatePuBu, schemePuBu, interpolatePuRd, schemePuRd, interpolateRdPu, schemeRdPu, interpolateYlGnBu, schemeYlGnBu, interpolateYlGn, schemeYlGn, interpolateYlOrBr, schemeYlOrBr, interpolateYlOrRd, schemeYlOrRd, interpolateBlues, schemeBlues, interpolateGreens, schemeGreens, interpolateGreys, schemeGreys, interpolatePurples, schemePurples, interpolateReds, schemeReds, interpolateOranges, schemeOranges, interpolateCividis, interpolateCubehelixDefault, interpolateRainbow, interpolateWarm, interpolateCool, interpolateSinebow, interpolateTurbo, interpolateViridis, interpolateMagma, interpolateInferno, interpolatePlasma */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _categorical_category10_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./categorical/category10.js */ "../node_modules/d3-scale-chromatic/src/categorical/category10.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeCategory10", function() { return _categorical_category10_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Accent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./categorical/Accent.js */ "../node_modules/d3-scale-chromatic/src/categorical/Accent.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeAccent", function() { return _categorical_Accent_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Dark2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./categorical/Dark2.js */ "../node_modules/d3-scale-chromatic/src/categorical/Dark2.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeDark2", function() { return _categorical_Dark2_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Paired_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./categorical/Paired.js */ "../node_modules/d3-scale-chromatic/src/categorical/Paired.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePaired", function() { return _categorical_Paired_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Pastel1_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./categorical/Pastel1.js */ "../node_modules/d3-scale-chromatic/src/categorical/Pastel1.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePastel1", function() { return _categorical_Pastel1_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Pastel2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./categorical/Pastel2.js */ "../node_modules/d3-scale-chromatic/src/categorical/Pastel2.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePastel2", function() { return _categorical_Pastel2_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Set1_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./categorical/Set1.js */ "../node_modules/d3-scale-chromatic/src/categorical/Set1.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSet1", function() { return _categorical_Set1_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Set2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./categorical/Set2.js */ "../node_modules/d3-scale-chromatic/src/categorical/Set2.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSet2", function() { return _categorical_Set2_js__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Set3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./categorical/Set3.js */ "../node_modules/d3-scale-chromatic/src/categorical/Set3.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSet3", function() { return _categorical_Set3_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _categorical_Tableau10_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./categorical/Tableau10.js */ "../node_modules/d3-scale-chromatic/src/categorical/Tableau10.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeTableau10", function() { return _categorical_Tableau10_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _diverging_BrBG_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diverging/BrBG.js */ "../node_modules/d3-scale-chromatic/src/diverging/BrBG.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBrBG", function() { return _diverging_BrBG_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBrBG", function() { return _diverging_BrBG_js__WEBPACK_IMPORTED_MODULE_10__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_PRGn_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diverging/PRGn.js */ "../node_modules/d3-scale-chromatic/src/diverging/PRGn.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePRGn", function() { return _diverging_PRGn_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePRGn", function() { return _diverging_PRGn_js__WEBPACK_IMPORTED_MODULE_11__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_PiYG_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diverging/PiYG.js */ "../node_modules/d3-scale-chromatic/src/diverging/PiYG.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePiYG", function() { return _diverging_PiYG_js__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePiYG", function() { return _diverging_PiYG_js__WEBPACK_IMPORTED_MODULE_12__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_PuOr_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diverging/PuOr.js */ "../node_modules/d3-scale-chromatic/src/diverging/PuOr.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuOr", function() { return _diverging_PuOr_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuOr", function() { return _diverging_PuOr_js__WEBPACK_IMPORTED_MODULE_13__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_RdBu_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diverging/RdBu.js */ "../node_modules/d3-scale-chromatic/src/diverging/RdBu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdBu", function() { return _diverging_RdBu_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdBu", function() { return _diverging_RdBu_js__WEBPACK_IMPORTED_MODULE_14__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_RdGy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diverging/RdGy.js */ "../node_modules/d3-scale-chromatic/src/diverging/RdGy.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdGy", function() { return _diverging_RdGy_js__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdGy", function() { return _diverging_RdGy_js__WEBPACK_IMPORTED_MODULE_15__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_RdYlBu_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diverging/RdYlBu.js */ "../node_modules/d3-scale-chromatic/src/diverging/RdYlBu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdYlBu", function() { return _diverging_RdYlBu_js__WEBPACK_IMPORTED_MODULE_16__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdYlBu", function() { return _diverging_RdYlBu_js__WEBPACK_IMPORTED_MODULE_16__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_RdYlGn_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diverging/RdYlGn.js */ "../node_modules/d3-scale-chromatic/src/diverging/RdYlGn.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdYlGn", function() { return _diverging_RdYlGn_js__WEBPACK_IMPORTED_MODULE_17__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdYlGn", function() { return _diverging_RdYlGn_js__WEBPACK_IMPORTED_MODULE_17__["scheme"]; }); |
|
|
|
/* harmony import */ var _diverging_Spectral_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diverging/Spectral.js */ "../node_modules/d3-scale-chromatic/src/diverging/Spectral.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateSpectral", function() { return _diverging_Spectral_js__WEBPACK_IMPORTED_MODULE_18__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSpectral", function() { return _diverging_Spectral_js__WEBPACK_IMPORTED_MODULE_18__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_BuGn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./sequential-multi/BuGn.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBuGn", function() { return _sequential_multi_BuGn_js__WEBPACK_IMPORTED_MODULE_19__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBuGn", function() { return _sequential_multi_BuGn_js__WEBPACK_IMPORTED_MODULE_19__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_BuPu_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./sequential-multi/BuPu.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBuPu", function() { return _sequential_multi_BuPu_js__WEBPACK_IMPORTED_MODULE_20__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBuPu", function() { return _sequential_multi_BuPu_js__WEBPACK_IMPORTED_MODULE_20__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_GnBu_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./sequential-multi/GnBu.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateGnBu", function() { return _sequential_multi_GnBu_js__WEBPACK_IMPORTED_MODULE_21__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeGnBu", function() { return _sequential_multi_GnBu_js__WEBPACK_IMPORTED_MODULE_21__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_OrRd_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sequential-multi/OrRd.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateOrRd", function() { return _sequential_multi_OrRd_js__WEBPACK_IMPORTED_MODULE_22__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeOrRd", function() { return _sequential_multi_OrRd_js__WEBPACK_IMPORTED_MODULE_22__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_PuBuGn_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sequential-multi/PuBuGn.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuBuGn", function() { return _sequential_multi_PuBuGn_js__WEBPACK_IMPORTED_MODULE_23__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuBuGn", function() { return _sequential_multi_PuBuGn_js__WEBPACK_IMPORTED_MODULE_23__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_PuBu_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./sequential-multi/PuBu.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuBu", function() { return _sequential_multi_PuBu_js__WEBPACK_IMPORTED_MODULE_24__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuBu", function() { return _sequential_multi_PuBu_js__WEBPACK_IMPORTED_MODULE_24__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_PuRd_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./sequential-multi/PuRd.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuRd", function() { return _sequential_multi_PuRd_js__WEBPACK_IMPORTED_MODULE_25__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuRd", function() { return _sequential_multi_PuRd_js__WEBPACK_IMPORTED_MODULE_25__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_RdPu_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./sequential-multi/RdPu.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdPu", function() { return _sequential_multi_RdPu_js__WEBPACK_IMPORTED_MODULE_26__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdPu", function() { return _sequential_multi_RdPu_js__WEBPACK_IMPORTED_MODULE_26__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_YlGnBu_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sequential-multi/YlGnBu.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlGnBu", function() { return _sequential_multi_YlGnBu_js__WEBPACK_IMPORTED_MODULE_27__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlGnBu", function() { return _sequential_multi_YlGnBu_js__WEBPACK_IMPORTED_MODULE_27__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_YlGn_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./sequential-multi/YlGn.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlGn", function() { return _sequential_multi_YlGn_js__WEBPACK_IMPORTED_MODULE_28__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlGn", function() { return _sequential_multi_YlGn_js__WEBPACK_IMPORTED_MODULE_28__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_YlOrBr_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./sequential-multi/YlOrBr.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlOrBr", function() { return _sequential_multi_YlOrBr_js__WEBPACK_IMPORTED_MODULE_29__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlOrBr", function() { return _sequential_multi_YlOrBr_js__WEBPACK_IMPORTED_MODULE_29__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_YlOrRd_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./sequential-multi/YlOrRd.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlOrRd", function() { return _sequential_multi_YlOrRd_js__WEBPACK_IMPORTED_MODULE_30__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlOrRd", function() { return _sequential_multi_YlOrRd_js__WEBPACK_IMPORTED_MODULE_30__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_single_Blues_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./sequential-single/Blues.js */ "../node_modules/d3-scale-chromatic/src/sequential-single/Blues.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBlues", function() { return _sequential_single_Blues_js__WEBPACK_IMPORTED_MODULE_31__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBlues", function() { return _sequential_single_Blues_js__WEBPACK_IMPORTED_MODULE_31__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_single_Greens_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./sequential-single/Greens.js */ "../node_modules/d3-scale-chromatic/src/sequential-single/Greens.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateGreens", function() { return _sequential_single_Greens_js__WEBPACK_IMPORTED_MODULE_32__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeGreens", function() { return _sequential_single_Greens_js__WEBPACK_IMPORTED_MODULE_32__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_single_Greys_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./sequential-single/Greys.js */ "../node_modules/d3-scale-chromatic/src/sequential-single/Greys.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateGreys", function() { return _sequential_single_Greys_js__WEBPACK_IMPORTED_MODULE_33__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeGreys", function() { return _sequential_single_Greys_js__WEBPACK_IMPORTED_MODULE_33__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_single_Purples_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./sequential-single/Purples.js */ "../node_modules/d3-scale-chromatic/src/sequential-single/Purples.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePurples", function() { return _sequential_single_Purples_js__WEBPACK_IMPORTED_MODULE_34__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePurples", function() { return _sequential_single_Purples_js__WEBPACK_IMPORTED_MODULE_34__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_single_Reds_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./sequential-single/Reds.js */ "../node_modules/d3-scale-chromatic/src/sequential-single/Reds.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateReds", function() { return _sequential_single_Reds_js__WEBPACK_IMPORTED_MODULE_35__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeReds", function() { return _sequential_single_Reds_js__WEBPACK_IMPORTED_MODULE_35__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_single_Oranges_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sequential-single/Oranges.js */ "../node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateOranges", function() { return _sequential_single_Oranges_js__WEBPACK_IMPORTED_MODULE_36__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeOranges", function() { return _sequential_single_Oranges_js__WEBPACK_IMPORTED_MODULE_36__["scheme"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_cividis_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sequential-multi/cividis.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/cividis.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCividis", function() { return _sequential_multi_cividis_js__WEBPACK_IMPORTED_MODULE_37__["default"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_cubehelix_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sequential-multi/cubehelix.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelixDefault", function() { return _sequential_multi_cubehelix_js__WEBPACK_IMPORTED_MODULE_38__["default"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_rainbow_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sequential-multi/rainbow.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRainbow", function() { return _sequential_multi_rainbow_js__WEBPACK_IMPORTED_MODULE_39__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateWarm", function() { return _sequential_multi_rainbow_js__WEBPACK_IMPORTED_MODULE_39__["warm"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCool", function() { return _sequential_multi_rainbow_js__WEBPACK_IMPORTED_MODULE_39__["cool"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_sinebow_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sequential-multi/sinebow.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateSinebow", function() { return _sequential_multi_sinebow_js__WEBPACK_IMPORTED_MODULE_40__["default"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_turbo_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sequential-multi/turbo.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/turbo.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTurbo", function() { return _sequential_multi_turbo_js__WEBPACK_IMPORTED_MODULE_41__["default"]; }); |
|
|
|
/* harmony import */ var _sequential_multi_viridis_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sequential-multi/viridis.js */ "../node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateViridis", function() { return _sequential_multi_viridis_js__WEBPACK_IMPORTED_MODULE_42__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateMagma", function() { return _sequential_multi_viridis_js__WEBPACK_IMPORTED_MODULE_42__["magma"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateInferno", function() { return _sequential_multi_viridis_js__WEBPACK_IMPORTED_MODULE_42__["inferno"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePlasma", function() { return _sequential_multi_viridis_js__WEBPACK_IMPORTED_MODULE_42__["plasma"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/ramp.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/ramp.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(scheme) { |
|
return Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateRgbBasis"])(scheme[scheme.length - 1]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/BuGn.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"e5f5f999d8c92ca25f", |
|
"edf8fbb2e2e266c2a4238b45", |
|
"edf8fbb2e2e266c2a42ca25f006d2c", |
|
"edf8fbccece699d8c966c2a42ca25f006d2c", |
|
"edf8fbccece699d8c966c2a441ae76238b45005824", |
|
"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824", |
|
"f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/BuPu.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"e0ecf49ebcda8856a7", |
|
"edf8fbb3cde38c96c688419d", |
|
"edf8fbb3cde38c96c68856a7810f7c", |
|
"edf8fbbfd3e69ebcda8c96c68856a7810f7c", |
|
"edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b", |
|
"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b", |
|
"f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/GnBu.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"e0f3dba8ddb543a2ca", |
|
"f0f9e8bae4bc7bccc42b8cbe", |
|
"f0f9e8bae4bc7bccc443a2ca0868ac", |
|
"f0f9e8ccebc5a8ddb57bccc443a2ca0868ac", |
|
"f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e", |
|
"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e", |
|
"f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/OrRd.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fee8c8fdbb84e34a33", |
|
"fef0d9fdcc8afc8d59d7301f", |
|
"fef0d9fdcc8afc8d59e34a33b30000", |
|
"fef0d9fdd49efdbb84fc8d59e34a33b30000", |
|
"fef0d9fdd49efdbb84fc8d59ef6548d7301f990000", |
|
"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000", |
|
"fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/PuBu.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"ece7f2a6bddb2b8cbe", |
|
"f1eef6bdc9e174a9cf0570b0", |
|
"f1eef6bdc9e174a9cf2b8cbe045a8d", |
|
"f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d", |
|
"f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b", |
|
"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b", |
|
"fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js": |
|
/*!*************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/PuBuGn.js ***! |
|
\*************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"ece2f0a6bddb1c9099", |
|
"f6eff7bdc9e167a9cf02818a", |
|
"f6eff7bdc9e167a9cf1c9099016c59", |
|
"f6eff7d0d1e6a6bddb67a9cf1c9099016c59", |
|
"f6eff7d0d1e6a6bddb67a9cf3690c002818a016450", |
|
"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450", |
|
"fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/PuRd.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"e7e1efc994c7dd1c77", |
|
"f1eef6d7b5d8df65b0ce1256", |
|
"f1eef6d7b5d8df65b0dd1c77980043", |
|
"f1eef6d4b9dac994c7df65b0dd1c77980043", |
|
"f1eef6d4b9dac994c7df65b0e7298ace125691003f", |
|
"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f", |
|
"f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/RdPu.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fde0ddfa9fb5c51b8a", |
|
"feebe2fbb4b9f768a1ae017e", |
|
"feebe2fbb4b9f768a1c51b8a7a0177", |
|
"feebe2fcc5c0fa9fb5f768a1c51b8a7a0177", |
|
"feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177", |
|
"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177", |
|
"fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js": |
|
/*!***********************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/YlGn.js ***! |
|
\***********************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"f7fcb9addd8e31a354", |
|
"ffffccc2e69978c679238443", |
|
"ffffccc2e69978c67931a354006837", |
|
"ffffccd9f0a3addd8e78c67931a354006837", |
|
"ffffccd9f0a3addd8e78c67941ab5d238443005a32", |
|
"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32", |
|
"ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js": |
|
/*!*************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/YlGnBu.js ***! |
|
\*************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"edf8b17fcdbb2c7fb8", |
|
"ffffcca1dab441b6c4225ea8", |
|
"ffffcca1dab441b6c42c7fb8253494", |
|
"ffffccc7e9b47fcdbb41b6c42c7fb8253494", |
|
"ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84", |
|
"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84", |
|
"ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js": |
|
/*!*************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrBr.js ***! |
|
\*************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fff7bcfec44fd95f0e", |
|
"ffffd4fed98efe9929cc4c02", |
|
"ffffd4fed98efe9929d95f0e993404", |
|
"ffffd4fee391fec44ffe9929d95f0e993404", |
|
"ffffd4fee391fec44ffe9929ec7014cc4c028c2d04", |
|
"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04", |
|
"ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js": |
|
/*!*************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/YlOrRd.js ***! |
|
\*************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"ffeda0feb24cf03b20", |
|
"ffffb2fecc5cfd8d3ce31a1c", |
|
"ffffb2fecc5cfd8d3cf03b20bd0026", |
|
"ffffb2fed976feb24cfd8d3cf03b20bd0026", |
|
"ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026", |
|
"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026", |
|
"ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/cividis.js": |
|
/*!**************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/cividis.js ***! |
|
\**************************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(t) { |
|
t = Math.max(0, Math.min(1, t)); |
|
return "rgb(" |
|
+ Math.max(0, Math.min(255, Math.round(-4.54 - t * (35.34 - t * (2381.73 - t * (6402.7 - t * (7024.72 - t * 2710.57))))))) + ", " |
|
+ Math.max(0, Math.min(255, Math.round(32.49 + t * (170.73 + t * (52.82 - t * (131.46 - t * (176.58 - t * 67.37))))))) + ", " |
|
+ Math.max(0, Math.min(255, Math.round(81.24 + t * (442.36 - t * (2482.43 - t * (6167.24 - t * (6614.94 - t * 2475.67))))))) |
|
+ ")"; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js": |
|
/*!****************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/cubehelix.js ***! |
|
\****************************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateCubehelixLong"])(Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(300, 0.5, 0.0), Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(-240, 0.5, 1.0))); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js": |
|
/*!**************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js ***! |
|
\**************************************************************************/ |
|
/*! exports provided: warm, cool, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "warm", function() { return warm; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cool", function() { return cool; }); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
|
|
|
|
|
|
var warm = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateCubehelixLong"])(Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(-100, 0.75, 0.35), Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(80, 1.50, 0.8)); |
|
|
|
var cool = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateCubehelixLong"])(Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(260, 0.75, 0.35), Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(80, 1.50, 0.8)); |
|
|
|
var c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["cubehelix"])(); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(t) { |
|
if (t < 0 || t > 1) t -= Math.floor(t); |
|
var ts = Math.abs(t - 0.5); |
|
c.h = 360 * t - 100; |
|
c.s = 1.5 - 1.5 * ts; |
|
c.l = 0.8 - 0.9 * ts; |
|
return c + ""; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js": |
|
/*!**************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js ***! |
|
\**************************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
|
|
|
|
var c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["rgb"])(), |
|
pi_1_3 = Math.PI / 3, |
|
pi_2_3 = Math.PI * 2 / 3; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(t) { |
|
var x; |
|
t = (0.5 - t) * Math.PI; |
|
c.r = 255 * (x = Math.sin(t)) * x; |
|
c.g = 255 * (x = Math.sin(t + pi_1_3)) * x; |
|
c.b = 255 * (x = Math.sin(t + pi_2_3)) * x; |
|
return c + ""; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/turbo.js": |
|
/*!************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/turbo.js ***! |
|
\************************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(t) { |
|
t = Math.max(0, Math.min(1, t)); |
|
return "rgb(" |
|
+ Math.max(0, Math.min(255, Math.round(34.61 + t * (1172.33 - t * (10793.56 - t * (33300.12 - t * (38394.49 - t * 14825.05))))))) + ", " |
|
+ Math.max(0, Math.min(255, Math.round(23.31 + t * (557.33 + t * (1225.33 - t * (3574.96 - t * (1073.77 + t * 707.56))))))) + ", " |
|
+ Math.max(0, Math.min(255, Math.round(27.2 + t * (3211.1 - t * (15327.97 - t * (27814 - t * (22569.18 - t * 6838.66))))))) |
|
+ ")"; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js": |
|
/*!**************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-multi/viridis.js ***! |
|
\**************************************************************************/ |
|
/*! exports provided: default, magma, inferno, plasma */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "magma", function() { return magma; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inferno", function() { return inferno; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "plasma", function() { return plasma; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
|
|
|
|
function ramp(range) { |
|
var n = range.length; |
|
return function(t) { |
|
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))]; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (ramp(Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"))); |
|
|
|
var magma = ramp(Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")); |
|
|
|
var inferno = ramp(Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")); |
|
|
|
var plasma = ramp(Object(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"])("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-single/Blues.js": |
|
/*!*************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-single/Blues.js ***! |
|
\*************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"deebf79ecae13182bd", |
|
"eff3ffbdd7e76baed62171b5", |
|
"eff3ffbdd7e76baed63182bd08519c", |
|
"eff3ffc6dbef9ecae16baed63182bd08519c", |
|
"eff3ffc6dbef9ecae16baed64292c62171b5084594", |
|
"f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594", |
|
"f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-single/Greens.js": |
|
/*!**************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-single/Greens.js ***! |
|
\**************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"e5f5e0a1d99b31a354", |
|
"edf8e9bae4b374c476238b45", |
|
"edf8e9bae4b374c47631a354006d2c", |
|
"edf8e9c7e9c0a1d99b74c47631a354006d2c", |
|
"edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32", |
|
"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32", |
|
"f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-single/Greys.js": |
|
/*!*************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-single/Greys.js ***! |
|
\*************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"f0f0f0bdbdbd636363", |
|
"f7f7f7cccccc969696525252", |
|
"f7f7f7cccccc969696636363252525", |
|
"f7f7f7d9d9d9bdbdbd969696636363252525", |
|
"f7f7f7d9d9d9bdbdbd969696737373525252252525", |
|
"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525", |
|
"fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js": |
|
/*!***************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-single/Oranges.js ***! |
|
\***************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fee6cefdae6be6550d", |
|
"feeddefdbe85fd8d3cd94701", |
|
"feeddefdbe85fd8d3ce6550da63603", |
|
"feeddefdd0a2fdae6bfd8d3ce6550da63603", |
|
"feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04", |
|
"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04", |
|
"fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-single/Purples.js": |
|
/*!***************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-single/Purples.js ***! |
|
\***************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"efedf5bcbddc756bb1", |
|
"f2f0f7cbc9e29e9ac86a51a3", |
|
"f2f0f7cbc9e29e9ac8756bb154278f", |
|
"f2f0f7dadaebbcbddc9e9ac8756bb154278f", |
|
"f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486", |
|
"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486", |
|
"fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale-chromatic/src/sequential-single/Reds.js": |
|
/*!************************************************************************!*\ |
|
!*** ../node_modules/d3-scale-chromatic/src/sequential-single/Reds.js ***! |
|
\************************************************************************/ |
|
/*! exports provided: scheme, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheme", function() { return scheme; }); |
|
/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors.js */ "../node_modules/d3-scale-chromatic/src/colors.js"); |
|
/* harmony import */ var _ramp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ramp.js */ "../node_modules/d3-scale-chromatic/src/ramp.js"); |
|
|
|
|
|
|
|
var scheme = new Array(3).concat( |
|
"fee0d2fc9272de2d26", |
|
"fee5d9fcae91fb6a4acb181d", |
|
"fee5d9fcae91fb6a4ade2d26a50f15", |
|
"fee5d9fcbba1fc9272fb6a4ade2d26a50f15", |
|
"fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d", |
|
"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d", |
|
"fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d" |
|
).map(_colors_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (Object(_ramp_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scheme)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/array.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/array.js ***! |
|
\*********************************************/ |
|
/*! exports provided: map, slice */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
var array = Array.prototype; |
|
|
|
var map = array.map; |
|
var slice = array.slice; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/band.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/band.js ***! |
|
\********************************************/ |
|
/*! exports provided: default, point */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return band; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "point", function() { return point; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
/* harmony import */ var _ordinal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ordinal */ "../node_modules/d3-scale/src/ordinal.js"); |
|
|
|
|
|
|
|
|
|
function band() { |
|
var scale = Object(_ordinal__WEBPACK_IMPORTED_MODULE_2__["default"])().unknown(undefined), |
|
domain = scale.domain, |
|
ordinalRange = scale.range, |
|
range = [0, 1], |
|
step, |
|
bandwidth, |
|
round = false, |
|
paddingInner = 0, |
|
paddingOuter = 0, |
|
align = 0.5; |
|
|
|
delete scale.unknown; |
|
|
|
function rescale() { |
|
var n = domain().length, |
|
reverse = range[1] < range[0], |
|
start = range[reverse - 0], |
|
stop = range[1 - reverse]; |
|
step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); |
|
if (round) step = Math.floor(step); |
|
start += (stop - start - step * (n - paddingInner)) * align; |
|
bandwidth = step * (1 - paddingInner); |
|
if (round) start = Math.round(start), bandwidth = Math.round(bandwidth); |
|
var values = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["range"])(n).map(function(i) { return start + step * i; }); |
|
return ordinalRange(reverse ? values.reverse() : values); |
|
} |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (domain(_), rescale()) : domain(); |
|
}; |
|
|
|
scale.range = function(_) { |
|
return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice(); |
|
}; |
|
|
|
scale.rangeRound = function(_) { |
|
return range = [+_[0], +_[1]], round = true, rescale(); |
|
}; |
|
|
|
scale.bandwidth = function() { |
|
return bandwidth; |
|
}; |
|
|
|
scale.step = function() { |
|
return step; |
|
}; |
|
|
|
scale.round = function(_) { |
|
return arguments.length ? (round = !!_, rescale()) : round; |
|
}; |
|
|
|
scale.padding = function(_) { |
|
return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner; |
|
}; |
|
|
|
scale.paddingInner = function(_) { |
|
return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner; |
|
}; |
|
|
|
scale.paddingOuter = function(_) { |
|
return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter; |
|
}; |
|
|
|
scale.align = function(_) { |
|
return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align; |
|
}; |
|
|
|
scale.copy = function() { |
|
return band(domain(), range) |
|
.round(round) |
|
.paddingInner(paddingInner) |
|
.paddingOuter(paddingOuter) |
|
.align(align); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initRange"].apply(rescale(), arguments); |
|
} |
|
|
|
function pointish(scale) { |
|
var copy = scale.copy; |
|
|
|
scale.padding = scale.paddingOuter; |
|
delete scale.paddingInner; |
|
delete scale.paddingOuter; |
|
|
|
scale.copy = function() { |
|
return pointish(copy()); |
|
}; |
|
|
|
return scale; |
|
} |
|
|
|
function point() { |
|
return pointish(band.apply(null, arguments).paddingInner(1)); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/constant.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/constant.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/continuous.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/continuous.js ***! |
|
\**************************************************/ |
|
/*! exports provided: identity, copy, transformer, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformer", function() { return transformer; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return continuous; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-scale/src/constant.js"); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number */ "../node_modules/d3-scale/src/number.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
var unit = [0, 1]; |
|
|
|
function identity(x) { |
|
return x; |
|
} |
|
|
|
function normalize(a, b) { |
|
return (b -= (a = +a)) |
|
? function(x) { return (x - a) / b; } |
|
: Object(_constant__WEBPACK_IMPORTED_MODULE_3__["default"])(isNaN(b) ? NaN : 0.5); |
|
} |
|
|
|
function clamper(domain) { |
|
var a = domain[0], b = domain[domain.length - 1], t; |
|
if (a > b) t = a, a = b, b = t; |
|
return function(x) { return Math.max(a, Math.min(b, x)); }; |
|
} |
|
|
|
// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. |
|
// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b]. |
|
function bimap(domain, range, interpolate) { |
|
var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1]; |
|
if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0); |
|
else d0 = normalize(d0, d1), r0 = interpolate(r0, r1); |
|
return function(x) { return r0(d0(x)); }; |
|
} |
|
|
|
function polymap(domain, range, interpolate) { |
|
var j = Math.min(domain.length, range.length) - 1, |
|
d = new Array(j), |
|
r = new Array(j), |
|
i = -1; |
|
|
|
// Reverse descending domains. |
|
if (domain[j] < domain[0]) { |
|
domain = domain.slice().reverse(); |
|
range = range.slice().reverse(); |
|
} |
|
|
|
while (++i < j) { |
|
d[i] = normalize(domain[i], domain[i + 1]); |
|
r[i] = interpolate(range[i], range[i + 1]); |
|
} |
|
|
|
return function(x) { |
|
var i = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["bisect"])(domain, x, 1, j) - 1; |
|
return r[i](d[i](x)); |
|
}; |
|
} |
|
|
|
function copy(source, target) { |
|
return target |
|
.domain(source.domain()) |
|
.range(source.range()) |
|
.interpolate(source.interpolate()) |
|
.clamp(source.clamp()) |
|
.unknown(source.unknown()); |
|
} |
|
|
|
function transformer() { |
|
var domain = unit, |
|
range = unit, |
|
interpolate = d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolate"], |
|
transform, |
|
untransform, |
|
unknown, |
|
clamp = identity, |
|
piecewise, |
|
output, |
|
input; |
|
|
|
function rescale() { |
|
piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap; |
|
output = input = null; |
|
return scale; |
|
} |
|
|
|
function scale(x) { |
|
return isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x))); |
|
} |
|
|
|
scale.invert = function(y) { |
|
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateNumber"])))(y))); |
|
}; |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (domain = _array__WEBPACK_IMPORTED_MODULE_2__["map"].call(_, _number__WEBPACK_IMPORTED_MODULE_4__["default"]), clamp === identity || (clamp = clamper(domain)), rescale()) : domain.slice(); |
|
}; |
|
|
|
scale.range = function(_) { |
|
return arguments.length ? (range = _array__WEBPACK_IMPORTED_MODULE_2__["slice"].call(_), rescale()) : range.slice(); |
|
}; |
|
|
|
scale.rangeRound = function(_) { |
|
return range = _array__WEBPACK_IMPORTED_MODULE_2__["slice"].call(_), interpolate = d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateRound"], rescale(); |
|
}; |
|
|
|
scale.clamp = function(_) { |
|
return arguments.length ? (clamp = _ ? clamper(domain) : identity, scale) : clamp !== identity; |
|
}; |
|
|
|
scale.interpolate = function(_) { |
|
return arguments.length ? (interpolate = _, rescale()) : interpolate; |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
return function(t, u) { |
|
transform = t, untransform = u; |
|
return rescale(); |
|
}; |
|
} |
|
|
|
function continuous(transform, untransform) { |
|
return transformer()(transform, untransform); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/diverging.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/diverging.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default, divergingLog, divergingSymlog, divergingPow, divergingSqrt */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diverging; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divergingLog", function() { return divergingLog; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divergingSymlog", function() { return divergingSymlog; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divergingPow", function() { return divergingPow; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divergingSqrt", function() { return divergingSqrt; }); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./log */ "../node_modules/d3-scale/src/log.js"); |
|
/* harmony import */ var _sequential__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sequential */ "../node_modules/d3-scale/src/sequential.js"); |
|
/* harmony import */ var _symlog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./symlog */ "../node_modules/d3-scale/src/symlog.js"); |
|
/* harmony import */ var _pow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pow */ "../node_modules/d3-scale/src/pow.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function transformer() { |
|
var x0 = 0, |
|
x1 = 0.5, |
|
x2 = 1, |
|
t0, |
|
t1, |
|
t2, |
|
k10, |
|
k21, |
|
interpolator = _continuous__WEBPACK_IMPORTED_MODULE_0__["identity"], |
|
transform, |
|
clamp = false, |
|
unknown; |
|
|
|
function scale(x) { |
|
return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (x < t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x)); |
|
} |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), t2 = transform(x2 = +_[2]), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2]; |
|
}; |
|
|
|
scale.clamp = function(_) { |
|
return arguments.length ? (clamp = !!_, scale) : clamp; |
|
}; |
|
|
|
scale.interpolator = function(_) { |
|
return arguments.length ? (interpolator = _, scale) : interpolator; |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
return function(t) { |
|
transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1); |
|
return scale; |
|
}; |
|
} |
|
|
|
function diverging() { |
|
var scale = Object(_linear__WEBPACK_IMPORTED_MODULE_2__["linearish"])(transformer()(_continuous__WEBPACK_IMPORTED_MODULE_0__["identity"])); |
|
|
|
scale.copy = function() { |
|
return Object(_sequential__WEBPACK_IMPORTED_MODULE_4__["copy"])(scale, diverging()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function divergingLog() { |
|
var scale = Object(_log__WEBPACK_IMPORTED_MODULE_3__["loggish"])(transformer()).domain([0.1, 1, 10]); |
|
|
|
scale.copy = function() { |
|
return Object(_sequential__WEBPACK_IMPORTED_MODULE_4__["copy"])(scale, divergingLog()).base(scale.base()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function divergingSymlog() { |
|
var scale = Object(_symlog__WEBPACK_IMPORTED_MODULE_5__["symlogish"])(transformer()); |
|
|
|
scale.copy = function() { |
|
return Object(_sequential__WEBPACK_IMPORTED_MODULE_4__["copy"])(scale, divergingSymlog()).constant(scale.constant()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function divergingPow() { |
|
var scale = Object(_pow__WEBPACK_IMPORTED_MODULE_6__["powish"])(transformer()); |
|
|
|
scale.copy = function() { |
|
return Object(_sequential__WEBPACK_IMPORTED_MODULE_4__["copy"])(scale, divergingPow()).exponent(scale.exponent()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function divergingSqrt() { |
|
return divergingPow.apply(null, arguments).exponent(0.5); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/identity.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/identity.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return identity; }); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./number */ "../node_modules/d3-scale/src/number.js"); |
|
|
|
|
|
|
|
|
|
function identity(domain) { |
|
var unknown; |
|
|
|
function scale(x) { |
|
return isNaN(x = +x) ? unknown : x; |
|
} |
|
|
|
scale.invert = scale; |
|
|
|
scale.domain = scale.range = function(_) { |
|
return arguments.length ? (domain = _array__WEBPACK_IMPORTED_MODULE_0__["map"].call(_, _number__WEBPACK_IMPORTED_MODULE_2__["default"]), scale) : domain.slice(); |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
scale.copy = function() { |
|
return identity(domain).unknown(unknown); |
|
}; |
|
|
|
domain = arguments.length ? _array__WEBPACK_IMPORTED_MODULE_0__["map"].call(domain, _number__WEBPACK_IMPORTED_MODULE_2__["default"]) : [0, 1]; |
|
|
|
return Object(_linear__WEBPACK_IMPORTED_MODULE_1__["linearish"])(scale); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: scaleBand, scalePoint, scaleIdentity, scaleLinear, scaleLog, scaleSymlog, scaleOrdinal, scaleImplicit, scalePow, scaleSqrt, scaleQuantile, scaleQuantize, scaleThreshold, scaleTime, scaleUtc, scaleSequential, scaleSequentialLog, scaleSequentialPow, scaleSequentialSqrt, scaleSequentialSymlog, scaleSequentialQuantile, scaleDiverging, scaleDivergingLog, scaleDivergingPow, scaleDivergingSqrt, scaleDivergingSymlog, tickFormat */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _band__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./band */ "../node_modules/d3-scale/src/band.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleBand", function() { return _band__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scalePoint", function() { return _band__WEBPACK_IMPORTED_MODULE_0__["point"]; }); |
|
|
|
/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity */ "../node_modules/d3-scale/src/identity.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleIdentity", function() { return _identity__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleLinear", function() { return _linear__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./log */ "../node_modules/d3-scale/src/log.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleLog", function() { return _log__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _symlog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./symlog */ "../node_modules/d3-scale/src/symlog.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSymlog", function() { return _symlog__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _ordinal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ordinal */ "../node_modules/d3-scale/src/ordinal.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleOrdinal", function() { return _ordinal__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleImplicit", function() { return _ordinal__WEBPACK_IMPORTED_MODULE_5__["implicit"]; }); |
|
|
|
/* harmony import */ var _pow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pow */ "../node_modules/d3-scale/src/pow.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scalePow", function() { return _pow__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSqrt", function() { return _pow__WEBPACK_IMPORTED_MODULE_6__["sqrt"]; }); |
|
|
|
/* harmony import */ var _quantile__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./quantile */ "../node_modules/d3-scale/src/quantile.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleQuantile", function() { return _quantile__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _quantize__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./quantize */ "../node_modules/d3-scale/src/quantize.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleQuantize", function() { return _quantize__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _threshold__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./threshold */ "../node_modules/d3-scale/src/threshold.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleThreshold", function() { return _threshold__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./time */ "../node_modules/d3-scale/src/time.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleTime", function() { return _time__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony import */ var _utcTime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utcTime */ "../node_modules/d3-scale/src/utcTime.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleUtc", function() { return _utcTime__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _sequential__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./sequential */ "../node_modules/d3-scale/src/sequential.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequential", function() { return _sequential__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialLog", function() { return _sequential__WEBPACK_IMPORTED_MODULE_12__["sequentialLog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialPow", function() { return _sequential__WEBPACK_IMPORTED_MODULE_12__["sequentialPow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialSqrt", function() { return _sequential__WEBPACK_IMPORTED_MODULE_12__["sequentialSqrt"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialSymlog", function() { return _sequential__WEBPACK_IMPORTED_MODULE_12__["sequentialSymlog"]; }); |
|
|
|
/* harmony import */ var _sequentialQuantile__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sequentialQuantile */ "../node_modules/d3-scale/src/sequentialQuantile.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialQuantile", function() { return _sequentialQuantile__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony import */ var _diverging__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diverging */ "../node_modules/d3-scale/src/diverging.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDiverging", function() { return _diverging__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingLog", function() { return _diverging__WEBPACK_IMPORTED_MODULE_14__["divergingLog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingPow", function() { return _diverging__WEBPACK_IMPORTED_MODULE_14__["divergingPow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingSqrt", function() { return _diverging__WEBPACK_IMPORTED_MODULE_14__["divergingSqrt"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingSymlog", function() { return _diverging__WEBPACK_IMPORTED_MODULE_14__["divergingSymlog"]; }); |
|
|
|
/* harmony import */ var _tickFormat__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./tickFormat */ "../node_modules/d3-scale/src/tickFormat.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tickFormat", function() { return _tickFormat__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/init.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/init.js ***! |
|
\********************************************/ |
|
/*! exports provided: initRange, initInterpolator */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initRange", function() { return initRange; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initInterpolator", function() { return initInterpolator; }); |
|
function initRange(domain, range) { |
|
switch (arguments.length) { |
|
case 0: break; |
|
case 1: this.range(domain); break; |
|
default: this.range(range).domain(domain); break; |
|
} |
|
return this; |
|
} |
|
|
|
function initInterpolator(domain, interpolator) { |
|
switch (arguments.length) { |
|
case 0: break; |
|
case 1: this.interpolator(domain); break; |
|
default: this.interpolator(interpolator).domain(domain); break; |
|
} |
|
return this; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/linear.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/linear.js ***! |
|
\**********************************************/ |
|
/*! exports provided: linearish, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linearish", function() { return linearish; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return linear; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
/* harmony import */ var _tickFormat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tickFormat */ "../node_modules/d3-scale/src/tickFormat.js"); |
|
|
|
|
|
|
|
|
|
|
|
function linearish(scale) { |
|
var domain = scale.domain; |
|
|
|
scale.ticks = function(count) { |
|
var d = domain(); |
|
return Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["ticks"])(d[0], d[d.length - 1], count == null ? 10 : count); |
|
}; |
|
|
|
scale.tickFormat = function(count, specifier) { |
|
var d = domain(); |
|
return Object(_tickFormat__WEBPACK_IMPORTED_MODULE_3__["default"])(d[0], d[d.length - 1], count == null ? 10 : count, specifier); |
|
}; |
|
|
|
scale.nice = function(count) { |
|
if (count == null) count = 10; |
|
|
|
var d = domain(), |
|
i0 = 0, |
|
i1 = d.length - 1, |
|
start = d[i0], |
|
stop = d[i1], |
|
step; |
|
|
|
if (stop < start) { |
|
step = start, start = stop, stop = step; |
|
step = i0, i0 = i1, i1 = step; |
|
} |
|
|
|
step = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickIncrement"])(start, stop, count); |
|
|
|
if (step > 0) { |
|
start = Math.floor(start / step) * step; |
|
stop = Math.ceil(stop / step) * step; |
|
step = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickIncrement"])(start, stop, count); |
|
} else if (step < 0) { |
|
start = Math.ceil(start * step) / step; |
|
stop = Math.floor(stop * step) / step; |
|
step = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickIncrement"])(start, stop, count); |
|
} |
|
|
|
if (step > 0) { |
|
d[i0] = Math.floor(start / step) * step; |
|
d[i1] = Math.ceil(stop / step) * step; |
|
domain(d); |
|
} else if (step < 0) { |
|
d[i0] = Math.ceil(start * step) / step; |
|
d[i1] = Math.floor(stop * step) / step; |
|
domain(d); |
|
} |
|
|
|
return scale; |
|
}; |
|
|
|
return scale; |
|
} |
|
|
|
function linear() { |
|
var scale = Object(_continuous__WEBPACK_IMPORTED_MODULE_1__["default"])(_continuous__WEBPACK_IMPORTED_MODULE_1__["identity"], _continuous__WEBPACK_IMPORTED_MODULE_1__["identity"]); |
|
|
|
scale.copy = function() { |
|
return Object(_continuous__WEBPACK_IMPORTED_MODULE_1__["copy"])(scale, linear()); |
|
}; |
|
|
|
_init__WEBPACK_IMPORTED_MODULE_2__["initRange"].apply(scale, arguments); |
|
|
|
return linearish(scale); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/log.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-scale/src/log.js ***! |
|
\*******************************************/ |
|
/*! exports provided: loggish, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loggish", function() { return loggish; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return log; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var d3_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-format */ "../node_modules/d3-format/src/index.js"); |
|
/* harmony import */ var _nice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nice */ "../node_modules/d3-scale/src/nice.js"); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
function transformLog(x) { |
|
return Math.log(x); |
|
} |
|
|
|
function transformExp(x) { |
|
return Math.exp(x); |
|
} |
|
|
|
function transformLogn(x) { |
|
return -Math.log(-x); |
|
} |
|
|
|
function transformExpn(x) { |
|
return -Math.exp(-x); |
|
} |
|
|
|
function pow10(x) { |
|
return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x; |
|
} |
|
|
|
function powp(base) { |
|
return base === 10 ? pow10 |
|
: base === Math.E ? Math.exp |
|
: function(x) { return Math.pow(base, x); }; |
|
} |
|
|
|
function logp(base) { |
|
return base === Math.E ? Math.log |
|
: base === 10 && Math.log10 |
|
|| base === 2 && Math.log2 |
|
|| (base = Math.log(base), function(x) { return Math.log(x) / base; }); |
|
} |
|
|
|
function reflect(f) { |
|
return function(x) { |
|
return -f(-x); |
|
}; |
|
} |
|
|
|
function loggish(transform) { |
|
var scale = transform(transformLog, transformExp), |
|
domain = scale.domain, |
|
base = 10, |
|
logs, |
|
pows; |
|
|
|
function rescale() { |
|
logs = logp(base), pows = powp(base); |
|
if (domain()[0] < 0) { |
|
logs = reflect(logs), pows = reflect(pows); |
|
transform(transformLogn, transformExpn); |
|
} else { |
|
transform(transformLog, transformExp); |
|
} |
|
return scale; |
|
} |
|
|
|
scale.base = function(_) { |
|
return arguments.length ? (base = +_, rescale()) : base; |
|
}; |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (domain(_), rescale()) : domain(); |
|
}; |
|
|
|
scale.ticks = function(count) { |
|
var d = domain(), |
|
u = d[0], |
|
v = d[d.length - 1], |
|
r; |
|
|
|
if (r = v < u) i = u, u = v, v = i; |
|
|
|
var i = logs(u), |
|
j = logs(v), |
|
p, |
|
k, |
|
t, |
|
n = count == null ? 10 : +count, |
|
z = []; |
|
|
|
if (!(base % 1) && j - i < n) { |
|
i = Math.round(i) - 1, j = Math.round(j) + 1; |
|
if (u > 0) for (; i < j; ++i) { |
|
for (k = 1, p = pows(i); k < base; ++k) { |
|
t = p * k; |
|
if (t < u) continue; |
|
if (t > v) break; |
|
z.push(t); |
|
} |
|
} else for (; i < j; ++i) { |
|
for (k = base - 1, p = pows(i); k >= 1; --k) { |
|
t = p * k; |
|
if (t < u) continue; |
|
if (t > v) break; |
|
z.push(t); |
|
} |
|
} |
|
} else { |
|
z = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["ticks"])(i, j, Math.min(j - i, n)).map(pows); |
|
} |
|
|
|
return r ? z.reverse() : z; |
|
}; |
|
|
|
scale.tickFormat = function(count, specifier) { |
|
if (specifier == null) specifier = base === 10 ? ".0e" : ","; |
|
if (typeof specifier !== "function") specifier = Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["format"])(specifier); |
|
if (count === Infinity) return specifier; |
|
if (count == null) count = 10; |
|
var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate? |
|
return function(d) { |
|
var i = d / pows(Math.round(logs(d))); |
|
if (i * base < base - 0.5) i *= base; |
|
return i <= k ? specifier(d) : ""; |
|
}; |
|
}; |
|
|
|
scale.nice = function() { |
|
return domain(Object(_nice__WEBPACK_IMPORTED_MODULE_2__["default"])(domain(), { |
|
floor: function(x) { return pows(Math.floor(logs(x))); }, |
|
ceil: function(x) { return pows(Math.ceil(logs(x))); } |
|
})); |
|
}; |
|
|
|
return scale; |
|
} |
|
|
|
function log() { |
|
var scale = loggish(Object(_continuous__WEBPACK_IMPORTED_MODULE_3__["transformer"])()).domain([1, 10]); |
|
|
|
scale.copy = function() { |
|
return Object(_continuous__WEBPACK_IMPORTED_MODULE_3__["copy"])(scale, log()).base(scale.base()); |
|
}; |
|
|
|
_init__WEBPACK_IMPORTED_MODULE_4__["initRange"].apply(scale, arguments); |
|
|
|
return scale; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/nice.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/nice.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(domain, interval) { |
|
domain = domain.slice(); |
|
|
|
var i0 = 0, |
|
i1 = domain.length - 1, |
|
x0 = domain[i0], |
|
x1 = domain[i1], |
|
t; |
|
|
|
if (x1 < x0) { |
|
t = i0, i0 = i1, i1 = t; |
|
t = x0, x0 = x1, x1 = t; |
|
} |
|
|
|
domain[i0] = interval.floor(x0); |
|
domain[i1] = interval.ceil(x1); |
|
return domain; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/number.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/number.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return +x; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/ordinal.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/ordinal.js ***! |
|
\***********************************************/ |
|
/*! exports provided: implicit, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "implicit", function() { return implicit; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ordinal; }); |
|
/* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-collection */ "../node_modules/d3-collection/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
var implicit = {name: "implicit"}; |
|
|
|
function ordinal() { |
|
var index = Object(d3_collection__WEBPACK_IMPORTED_MODULE_0__["map"])(), |
|
domain = [], |
|
range = [], |
|
unknown = implicit; |
|
|
|
function scale(d) { |
|
var key = d + "", i = index.get(key); |
|
if (!i) { |
|
if (unknown !== implicit) return unknown; |
|
index.set(key, i = domain.push(d)); |
|
} |
|
return range[(i - 1) % range.length]; |
|
} |
|
|
|
scale.domain = function(_) { |
|
if (!arguments.length) return domain.slice(); |
|
domain = [], index = Object(d3_collection__WEBPACK_IMPORTED_MODULE_0__["map"])(); |
|
var i = -1, n = _.length, d, key; |
|
while (++i < n) if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d)); |
|
return scale; |
|
}; |
|
|
|
scale.range = function(_) { |
|
return arguments.length ? (range = _array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_), scale) : range.slice(); |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
scale.copy = function() { |
|
return ordinal(domain, range).unknown(unknown); |
|
}; |
|
|
|
_init__WEBPACK_IMPORTED_MODULE_2__["initRange"].apply(scale, arguments); |
|
|
|
return scale; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/pow.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-scale/src/pow.js ***! |
|
\*******************************************/ |
|
/*! exports provided: powish, default, sqrt */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "powish", function() { return powish; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return pow; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrt", function() { return sqrt; }); |
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
function transformPow(exponent) { |
|
return function(x) { |
|
return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent); |
|
}; |
|
} |
|
|
|
function transformSqrt(x) { |
|
return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x); |
|
} |
|
|
|
function transformSquare(x) { |
|
return x < 0 ? -x * x : x * x; |
|
} |
|
|
|
function powish(transform) { |
|
var scale = transform(_continuous__WEBPACK_IMPORTED_MODULE_1__["identity"], _continuous__WEBPACK_IMPORTED_MODULE_1__["identity"]), |
|
exponent = 1; |
|
|
|
function rescale() { |
|
return exponent === 1 ? transform(_continuous__WEBPACK_IMPORTED_MODULE_1__["identity"], _continuous__WEBPACK_IMPORTED_MODULE_1__["identity"]) |
|
: exponent === 0.5 ? transform(transformSqrt, transformSquare) |
|
: transform(transformPow(exponent), transformPow(1 / exponent)); |
|
} |
|
|
|
scale.exponent = function(_) { |
|
return arguments.length ? (exponent = +_, rescale()) : exponent; |
|
}; |
|
|
|
return Object(_linear__WEBPACK_IMPORTED_MODULE_0__["linearish"])(scale); |
|
} |
|
|
|
function pow() { |
|
var scale = powish(Object(_continuous__WEBPACK_IMPORTED_MODULE_1__["transformer"])()); |
|
|
|
scale.copy = function() { |
|
return Object(_continuous__WEBPACK_IMPORTED_MODULE_1__["copy"])(scale, pow()).exponent(scale.exponent()); |
|
}; |
|
|
|
_init__WEBPACK_IMPORTED_MODULE_2__["initRange"].apply(scale, arguments); |
|
|
|
return scale; |
|
} |
|
|
|
function sqrt() { |
|
return pow.apply(null, arguments).exponent(0.5); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/quantile.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/quantile.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return quantile; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
function quantile() { |
|
var domain = [], |
|
range = [], |
|
thresholds = [], |
|
unknown; |
|
|
|
function rescale() { |
|
var i = 0, n = Math.max(1, range.length); |
|
thresholds = new Array(n - 1); |
|
while (++i < n) thresholds[i - 1] = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["quantile"])(domain, i / n); |
|
return scale; |
|
} |
|
|
|
function scale(x) { |
|
return isNaN(x = +x) ? unknown : range[Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["bisect"])(thresholds, x)]; |
|
} |
|
|
|
scale.invertExtent = function(y) { |
|
var i = range.indexOf(y); |
|
return i < 0 ? [NaN, NaN] : [ |
|
i > 0 ? thresholds[i - 1] : domain[0], |
|
i < thresholds.length ? thresholds[i] : domain[domain.length - 1] |
|
]; |
|
}; |
|
|
|
scale.domain = function(_) { |
|
if (!arguments.length) return domain.slice(); |
|
domain = []; |
|
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); |
|
domain.sort(d3_array__WEBPACK_IMPORTED_MODULE_0__["ascending"]); |
|
return rescale(); |
|
}; |
|
|
|
scale.range = function(_) { |
|
return arguments.length ? (range = _array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_), rescale()) : range.slice(); |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
scale.quantiles = function() { |
|
return thresholds.slice(); |
|
}; |
|
|
|
scale.copy = function() { |
|
return quantile() |
|
.domain(domain) |
|
.range(range) |
|
.unknown(unknown); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_2__["initRange"].apply(scale, arguments); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/quantize.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/quantize.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return quantize; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
|
|
function quantize() { |
|
var x0 = 0, |
|
x1 = 1, |
|
n = 1, |
|
domain = [0.5], |
|
range = [0, 1], |
|
unknown; |
|
|
|
function scale(x) { |
|
return x <= x ? range[Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["bisect"])(domain, x, 0, n)] : unknown; |
|
} |
|
|
|
function rescale() { |
|
var i = -1; |
|
domain = new Array(n); |
|
while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1); |
|
return scale; |
|
} |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1]; |
|
}; |
|
|
|
scale.range = function(_) { |
|
return arguments.length ? (n = (range = _array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_)).length - 1, rescale()) : range.slice(); |
|
}; |
|
|
|
scale.invertExtent = function(y) { |
|
var i = range.indexOf(y); |
|
return i < 0 ? [NaN, NaN] |
|
: i < 1 ? [x0, domain[0]] |
|
: i >= n ? [domain[n - 1], x1] |
|
: [domain[i - 1], domain[i]]; |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : scale; |
|
}; |
|
|
|
scale.thresholds = function() { |
|
return domain.slice(); |
|
}; |
|
|
|
scale.copy = function() { |
|
return quantize() |
|
.domain([x0, x1]) |
|
.range(range) |
|
.unknown(unknown); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_3__["initRange"].apply(Object(_linear__WEBPACK_IMPORTED_MODULE_2__["linearish"])(scale), arguments); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/sequential.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/sequential.js ***! |
|
\**************************************************/ |
|
/*! exports provided: copy, default, sequentialLog, sequentialSymlog, sequentialPow, sequentialSqrt */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copy", function() { return copy; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return sequential; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequentialLog", function() { return sequentialLog; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequentialSymlog", function() { return sequentialSymlog; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequentialPow", function() { return sequentialPow; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequentialSqrt", function() { return sequentialSqrt; }); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./log */ "../node_modules/d3-scale/src/log.js"); |
|
/* harmony import */ var _symlog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./symlog */ "../node_modules/d3-scale/src/symlog.js"); |
|
/* harmony import */ var _pow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pow */ "../node_modules/d3-scale/src/pow.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function transformer() { |
|
var x0 = 0, |
|
x1 = 1, |
|
t0, |
|
t1, |
|
k10, |
|
transform, |
|
interpolator = _continuous__WEBPACK_IMPORTED_MODULE_0__["identity"], |
|
clamp = false, |
|
unknown; |
|
|
|
function scale(x) { |
|
return isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x)); |
|
} |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1]; |
|
}; |
|
|
|
scale.clamp = function(_) { |
|
return arguments.length ? (clamp = !!_, scale) : clamp; |
|
}; |
|
|
|
scale.interpolator = function(_) { |
|
return arguments.length ? (interpolator = _, scale) : interpolator; |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
return function(t) { |
|
transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0); |
|
return scale; |
|
}; |
|
} |
|
|
|
function copy(source, target) { |
|
return target |
|
.domain(source.domain()) |
|
.interpolator(source.interpolator()) |
|
.clamp(source.clamp()) |
|
.unknown(source.unknown()); |
|
} |
|
|
|
function sequential() { |
|
var scale = Object(_linear__WEBPACK_IMPORTED_MODULE_2__["linearish"])(transformer()(_continuous__WEBPACK_IMPORTED_MODULE_0__["identity"])); |
|
|
|
scale.copy = function() { |
|
return copy(scale, sequential()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function sequentialLog() { |
|
var scale = Object(_log__WEBPACK_IMPORTED_MODULE_3__["loggish"])(transformer()).domain([1, 10]); |
|
|
|
scale.copy = function() { |
|
return copy(scale, sequentialLog()).base(scale.base()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function sequentialSymlog() { |
|
var scale = Object(_symlog__WEBPACK_IMPORTED_MODULE_4__["symlogish"])(transformer()); |
|
|
|
scale.copy = function() { |
|
return copy(scale, sequentialSymlog()).constant(scale.constant()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function sequentialPow() { |
|
var scale = Object(_pow__WEBPACK_IMPORTED_MODULE_5__["powish"])(transformer()); |
|
|
|
scale.copy = function() { |
|
return copy(scale, sequentialPow()).exponent(scale.exponent()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_1__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
function sequentialSqrt() { |
|
return sequentialPow.apply(null, arguments).exponent(0.5); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/sequentialQuantile.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/sequentialQuantile.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return sequentialQuantile; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
function sequentialQuantile() { |
|
var domain = [], |
|
interpolator = _continuous__WEBPACK_IMPORTED_MODULE_1__["identity"]; |
|
|
|
function scale(x) { |
|
if (!isNaN(x = +x)) return interpolator((Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["bisect"])(domain, x) - 1) / (domain.length - 1)); |
|
} |
|
|
|
scale.domain = function(_) { |
|
if (!arguments.length) return domain.slice(); |
|
domain = []; |
|
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d); |
|
domain.sort(d3_array__WEBPACK_IMPORTED_MODULE_0__["ascending"]); |
|
return scale; |
|
}; |
|
|
|
scale.interpolator = function(_) { |
|
return arguments.length ? (interpolator = _, scale) : interpolator; |
|
}; |
|
|
|
scale.copy = function() { |
|
return sequentialQuantile(interpolator).domain(domain); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_2__["initInterpolator"].apply(scale, arguments); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/symlog.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/symlog.js ***! |
|
\**********************************************/ |
|
/*! exports provided: symlogish, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "symlogish", function() { return symlogish; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return symlog; }); |
|
/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear */ "../node_modules/d3-scale/src/linear.js"); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
function transformSymlog(c) { |
|
return function(x) { |
|
return Math.sign(x) * Math.log1p(Math.abs(x / c)); |
|
}; |
|
} |
|
|
|
function transformSymexp(c) { |
|
return function(x) { |
|
return Math.sign(x) * Math.expm1(Math.abs(x)) * c; |
|
}; |
|
} |
|
|
|
function symlogish(transform) { |
|
var c = 1, scale = transform(transformSymlog(c), transformSymexp(c)); |
|
|
|
scale.constant = function(_) { |
|
return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c; |
|
}; |
|
|
|
return Object(_linear__WEBPACK_IMPORTED_MODULE_0__["linearish"])(scale); |
|
} |
|
|
|
function symlog() { |
|
var scale = symlogish(Object(_continuous__WEBPACK_IMPORTED_MODULE_1__["transformer"])()); |
|
|
|
scale.copy = function() { |
|
return Object(_continuous__WEBPACK_IMPORTED_MODULE_1__["copy"])(scale, symlog()).constant(scale.constant()); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_2__["initRange"].apply(scale, arguments); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/threshold.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/threshold.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return threshold; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
function threshold() { |
|
var domain = [0.5], |
|
range = [0, 1], |
|
unknown, |
|
n = 1; |
|
|
|
function scale(x) { |
|
return x <= x ? range[Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["bisect"])(domain, x, 0, n)] : unknown; |
|
} |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? (domain = _array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice(); |
|
}; |
|
|
|
scale.range = function(_) { |
|
return arguments.length ? (range = _array__WEBPACK_IMPORTED_MODULE_1__["slice"].call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice(); |
|
}; |
|
|
|
scale.invertExtent = function(y) { |
|
var i = range.indexOf(y); |
|
return [domain[i - 1], domain[i]]; |
|
}; |
|
|
|
scale.unknown = function(_) { |
|
return arguments.length ? (unknown = _, scale) : unknown; |
|
}; |
|
|
|
scale.copy = function() { |
|
return threshold() |
|
.domain(domain) |
|
.range(range) |
|
.unknown(unknown); |
|
}; |
|
|
|
return _init__WEBPACK_IMPORTED_MODULE_2__["initRange"].apply(scale, arguments); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/tickFormat.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-scale/src/tickFormat.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var d3_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-format */ "../node_modules/d3-format/src/index.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(start, stop, count, specifier) { |
|
var step = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickStep"])(start, stop, count), |
|
precision; |
|
specifier = Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["formatSpecifier"])(specifier == null ? ",f" : specifier); |
|
switch (specifier.type) { |
|
case "s": { |
|
var value = Math.max(Math.abs(start), Math.abs(stop)); |
|
if (specifier.precision == null && !isNaN(precision = Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["precisionPrefix"])(step, value))) specifier.precision = precision; |
|
return Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["formatPrefix"])(specifier, value); |
|
} |
|
case "": |
|
case "e": |
|
case "g": |
|
case "p": |
|
case "r": { |
|
if (specifier.precision == null && !isNaN(precision = Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["precisionRound"])(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); |
|
break; |
|
} |
|
case "f": |
|
case "%": { |
|
if (specifier.precision == null && !isNaN(precision = Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["precisionFixed"])(step))) specifier.precision = precision - (specifier.type === "%") * 2; |
|
break; |
|
} |
|
} |
|
return Object(d3_format__WEBPACK_IMPORTED_MODULE_1__["format"])(specifier); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/time.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/time.js ***! |
|
\********************************************/ |
|
/*! exports provided: calendar, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calendar", function() { return calendar; }); |
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony import */ var d3_time__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-time */ "../node_modules/d3-time/src/index.js"); |
|
/* harmony import */ var d3_time_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-time-format */ "../node_modules/d3-time-format/src/index.js"); |
|
/* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./array */ "../node_modules/d3-scale/src/array.js"); |
|
/* harmony import */ var _continuous__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./continuous */ "../node_modules/d3-scale/src/continuous.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
/* harmony import */ var _nice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./nice */ "../node_modules/d3-scale/src/nice.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var durationSecond = 1000, |
|
durationMinute = durationSecond * 60, |
|
durationHour = durationMinute * 60, |
|
durationDay = durationHour * 24, |
|
durationWeek = durationDay * 7, |
|
durationMonth = durationDay * 30, |
|
durationYear = durationDay * 365; |
|
|
|
function date(t) { |
|
return new Date(t); |
|
} |
|
|
|
function number(t) { |
|
return t instanceof Date ? +t : +new Date(+t); |
|
} |
|
|
|
function calendar(year, month, week, day, hour, minute, second, millisecond, format) { |
|
var scale = Object(_continuous__WEBPACK_IMPORTED_MODULE_4__["default"])(_continuous__WEBPACK_IMPORTED_MODULE_4__["identity"], _continuous__WEBPACK_IMPORTED_MODULE_4__["identity"]), |
|
invert = scale.invert, |
|
domain = scale.domain; |
|
|
|
var formatMillisecond = format(".%L"), |
|
formatSecond = format(":%S"), |
|
formatMinute = format("%I:%M"), |
|
formatHour = format("%I %p"), |
|
formatDay = format("%a %d"), |
|
formatWeek = format("%b %d"), |
|
formatMonth = format("%B"), |
|
formatYear = format("%Y"); |
|
|
|
var tickIntervals = [ |
|
[second, 1, durationSecond], |
|
[second, 5, 5 * durationSecond], |
|
[second, 15, 15 * durationSecond], |
|
[second, 30, 30 * durationSecond], |
|
[minute, 1, durationMinute], |
|
[minute, 5, 5 * durationMinute], |
|
[minute, 15, 15 * durationMinute], |
|
[minute, 30, 30 * durationMinute], |
|
[ hour, 1, durationHour ], |
|
[ hour, 3, 3 * durationHour ], |
|
[ hour, 6, 6 * durationHour ], |
|
[ hour, 12, 12 * durationHour ], |
|
[ day, 1, durationDay ], |
|
[ day, 2, 2 * durationDay ], |
|
[ week, 1, durationWeek ], |
|
[ month, 1, durationMonth ], |
|
[ month, 3, 3 * durationMonth ], |
|
[ year, 1, durationYear ] |
|
]; |
|
|
|
function tickFormat(date) { |
|
return (second(date) < date ? formatMillisecond |
|
: minute(date) < date ? formatSecond |
|
: hour(date) < date ? formatMinute |
|
: day(date) < date ? formatHour |
|
: month(date) < date ? (week(date) < date ? formatDay : formatWeek) |
|
: year(date) < date ? formatMonth |
|
: formatYear)(date); |
|
} |
|
|
|
function tickInterval(interval, start, stop, step) { |
|
if (interval == null) interval = 10; |
|
|
|
// If a desired tick count is specified, pick a reasonable tick interval |
|
// based on the extent of the domain and a rough estimate of tick size. |
|
// Otherwise, assume interval is already a time interval and use it. |
|
if (typeof interval === "number") { |
|
var target = Math.abs(stop - start) / interval, |
|
i = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["bisector"])(function(i) { return i[2]; }).right(tickIntervals, target); |
|
if (i === tickIntervals.length) { |
|
step = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickStep"])(start / durationYear, stop / durationYear, interval); |
|
interval = year; |
|
} else if (i) { |
|
i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i]; |
|
step = i[1]; |
|
interval = i[0]; |
|
} else { |
|
step = Math.max(Object(d3_array__WEBPACK_IMPORTED_MODULE_0__["tickStep"])(start, stop, interval), 1); |
|
interval = millisecond; |
|
} |
|
} |
|
|
|
return step == null ? interval : interval.every(step); |
|
} |
|
|
|
scale.invert = function(y) { |
|
return new Date(invert(y)); |
|
}; |
|
|
|
scale.domain = function(_) { |
|
return arguments.length ? domain(_array__WEBPACK_IMPORTED_MODULE_3__["map"].call(_, number)) : domain().map(date); |
|
}; |
|
|
|
scale.ticks = function(interval, step) { |
|
var d = domain(), |
|
t0 = d[0], |
|
t1 = d[d.length - 1], |
|
r = t1 < t0, |
|
t; |
|
if (r) t = t0, t0 = t1, t1 = t; |
|
t = tickInterval(interval, t0, t1, step); |
|
t = t ? t.range(t0, t1 + 1) : []; // inclusive stop |
|
return r ? t.reverse() : t; |
|
}; |
|
|
|
scale.tickFormat = function(count, specifier) { |
|
return specifier == null ? tickFormat : format(specifier); |
|
}; |
|
|
|
scale.nice = function(interval, step) { |
|
var d = domain(); |
|
return (interval = tickInterval(interval, d[0], d[d.length - 1], step)) |
|
? domain(Object(_nice__WEBPACK_IMPORTED_MODULE_6__["default"])(d, interval)) |
|
: scale; |
|
}; |
|
|
|
scale.copy = function() { |
|
return Object(_continuous__WEBPACK_IMPORTED_MODULE_4__["copy"])(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format)); |
|
}; |
|
|
|
return scale; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return _init__WEBPACK_IMPORTED_MODULE_5__["initRange"].apply(calendar(d3_time__WEBPACK_IMPORTED_MODULE_1__["timeYear"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeMonth"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeWeek"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeDay"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeHour"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeMinute"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeSecond"], d3_time__WEBPACK_IMPORTED_MODULE_1__["timeMillisecond"], d3_time_format__WEBPACK_IMPORTED_MODULE_2__["timeFormat"]).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-scale/src/utcTime.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-scale/src/utcTime.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./time */ "../node_modules/d3-scale/src/time.js"); |
|
/* harmony import */ var d3_time_format__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-time-format */ "../node_modules/d3-time-format/src/index.js"); |
|
/* harmony import */ var d3_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-time */ "../node_modules/d3-time/src/index.js"); |
|
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./init */ "../node_modules/d3-scale/src/init.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return _init__WEBPACK_IMPORTED_MODULE_3__["initRange"].apply(Object(_time__WEBPACK_IMPORTED_MODULE_0__["calendar"])(d3_time__WEBPACK_IMPORTED_MODULE_2__["utcYear"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcMonth"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcWeek"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcDay"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcHour"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcMinute"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcSecond"], d3_time__WEBPACK_IMPORTED_MODULE_2__["utcMillisecond"], d3_time_format__WEBPACK_IMPORTED_MODULE_1__["utcFormat"]).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/constant.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/constant.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/create.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/create.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _creator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./creator */ "../node_modules/d3-selection/src/creator.js"); |
|
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./select */ "../node_modules/d3-selection/src/select.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name) { |
|
return Object(_select__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_creator__WEBPACK_IMPORTED_MODULE_0__["default"])(name).call(document.documentElement)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/creator.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/creator.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./namespace */ "../node_modules/d3-selection/src/namespace.js"); |
|
/* harmony import */ var _namespaces__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./namespaces */ "../node_modules/d3-selection/src/namespaces.js"); |
|
|
|
|
|
|
|
function creatorInherit(name) { |
|
return function() { |
|
var document = this.ownerDocument, |
|
uri = this.namespaceURI; |
|
return uri === _namespaces__WEBPACK_IMPORTED_MODULE_1__["xhtml"] && document.documentElement.namespaceURI === _namespaces__WEBPACK_IMPORTED_MODULE_1__["xhtml"] |
|
? document.createElement(name) |
|
: document.createElementNS(uri, name); |
|
}; |
|
} |
|
|
|
function creatorFixed(fullname) { |
|
return function() { |
|
return this.ownerDocument.createElementNS(fullname.space, fullname.local); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name) { |
|
var fullname = Object(_namespace__WEBPACK_IMPORTED_MODULE_0__["default"])(name); |
|
return (fullname.local |
|
? creatorFixed |
|
: creatorInherit)(fullname); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/index.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/index.js ***! |
|
\*************************************************/ |
|
/*! exports provided: create, creator, local, matcher, mouse, namespace, namespaces, clientPoint, select, selectAll, selection, selector, selectorAll, style, touch, touches, window, event, customEvent */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _create__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create */ "../node_modules/d3-selection/src/create.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _creator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./creator */ "../node_modules/d3-selection/src/creator.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "creator", function() { return _creator__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _local__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./local */ "../node_modules/d3-selection/src/local.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "local", function() { return _local__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./matcher */ "../node_modules/d3-selection/src/matcher.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return _matcher__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _mouse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mouse */ "../node_modules/d3-selection/src/mouse.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mouse", function() { return _mouse__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./namespace */ "../node_modules/d3-selection/src/namespace.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "namespace", function() { return _namespace__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _namespaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./namespaces */ "../node_modules/d3-selection/src/namespaces.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "namespaces", function() { return _namespaces__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./point */ "../node_modules/d3-selection/src/point.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clientPoint", function() { return _point__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./select */ "../node_modules/d3-selection/src/select.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "select", function() { return _select__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony import */ var _selectAll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./selectAll */ "../node_modules/d3-selection/src/selectAll.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAll", function() { return _selectAll__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _selection_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./selection/index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selection", function() { return _selection_index__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./selector */ "../node_modules/d3-selection/src/selector.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selector", function() { return _selector__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _selectorAll__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./selectorAll */ "../node_modules/d3-selection/src/selectorAll.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectorAll", function() { return _selectorAll__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony import */ var _selection_style__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./selection/style */ "../node_modules/d3-selection/src/selection/style.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "style", function() { return _selection_style__WEBPACK_IMPORTED_MODULE_13__["styleValue"]; }); |
|
|
|
/* harmony import */ var _touch__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./touch */ "../node_modules/d3-selection/src/touch.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "touch", function() { return _touch__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony import */ var _touches__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./touches */ "../node_modules/d3-selection/src/touches.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "touches", function() { return _touches__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
/* harmony import */ var _window__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./window */ "../node_modules/d3-selection/src/window.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _window__WEBPACK_IMPORTED_MODULE_16__["default"]; }); |
|
|
|
/* harmony import */ var _selection_on__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./selection/on */ "../node_modules/d3-selection/src/selection/on.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "event", function() { return _selection_on__WEBPACK_IMPORTED_MODULE_17__["event"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "customEvent", function() { return _selection_on__WEBPACK_IMPORTED_MODULE_17__["customEvent"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/local.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/local.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return local; }); |
|
var nextId = 0; |
|
|
|
function local() { |
|
return new Local; |
|
} |
|
|
|
function Local() { |
|
this._ = "@" + (++nextId).toString(36); |
|
} |
|
|
|
Local.prototype = local.prototype = { |
|
constructor: Local, |
|
get: function(node) { |
|
var id = this._; |
|
while (!(id in node)) if (!(node = node.parentNode)) return; |
|
return node[id]; |
|
}, |
|
set: function(node, value) { |
|
return node[this._] = value; |
|
}, |
|
remove: function(node) { |
|
return this._ in node && delete node[this._]; |
|
}, |
|
toString: function() { |
|
return this._; |
|
} |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/matcher.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/matcher.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(selector) { |
|
return function() { |
|
return this.matches(selector); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/mouse.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/mouse.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _sourceEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sourceEvent */ "../node_modules/d3-selection/src/sourceEvent.js"); |
|
/* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./point */ "../node_modules/d3-selection/src/point.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(node) { |
|
var event = Object(_sourceEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(); |
|
if (event.changedTouches) event = event.changedTouches[0]; |
|
return Object(_point__WEBPACK_IMPORTED_MODULE_1__["default"])(node, event); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/namespace.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/namespace.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _namespaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./namespaces */ "../node_modules/d3-selection/src/namespaces.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name) { |
|
var prefix = name += "", i = prefix.indexOf(":"); |
|
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); |
|
return _namespaces__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProperty(prefix) ? {space: _namespaces__WEBPACK_IMPORTED_MODULE_0__["default"][prefix], local: name} : name; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/namespaces.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/namespaces.js ***! |
|
\******************************************************/ |
|
/*! exports provided: xhtml, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "xhtml", function() { return xhtml; }); |
|
var xhtml = "http://www.w3.org/1999/xhtml"; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
svg: "http://www.w3.org/2000/svg", |
|
xhtml: xhtml, |
|
xlink: "http://www.w3.org/1999/xlink", |
|
xml: "http://www.w3.org/XML/1998/namespace", |
|
xmlns: "http://www.w3.org/2000/xmlns/" |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/point.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/point.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, event) { |
|
var svg = node.ownerSVGElement || node; |
|
|
|
if (svg.createSVGPoint) { |
|
var point = svg.createSVGPoint(); |
|
point.x = event.clientX, point.y = event.clientY; |
|
point = point.matrixTransform(node.getScreenCTM().inverse()); |
|
return [point.x, point.y]; |
|
} |
|
|
|
var rect = node.getBoundingClientRect(); |
|
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/select.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/select.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _selection_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection/index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(selector) { |
|
return typeof selector === "string" |
|
? new _selection_index__WEBPACK_IMPORTED_MODULE_0__["Selection"]([[document.querySelector(selector)]], [document.documentElement]) |
|
: new _selection_index__WEBPACK_IMPORTED_MODULE_0__["Selection"]([[selector]], _selection_index__WEBPACK_IMPORTED_MODULE_0__["root"]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selectAll.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selectAll.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _selection_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection/index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(selector) { |
|
return typeof selector === "string" |
|
? new _selection_index__WEBPACK_IMPORTED_MODULE_0__["Selection"]([document.querySelectorAll(selector)], [document.documentElement]) |
|
: new _selection_index__WEBPACK_IMPORTED_MODULE_0__["Selection"]([selector == null ? [] : selector], _selection_index__WEBPACK_IMPORTED_MODULE_0__["root"]); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/append.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/append.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _creator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../creator */ "../node_modules/d3-selection/src/creator.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name) { |
|
var create = typeof name === "function" ? name : Object(_creator__WEBPACK_IMPORTED_MODULE_0__["default"])(name); |
|
return this.select(function() { |
|
return this.appendChild(create.apply(this, arguments)); |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/attr.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/attr.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../namespace */ "../node_modules/d3-selection/src/namespace.js"); |
|
|
|
|
|
function attrRemove(name) { |
|
return function() { |
|
this.removeAttribute(name); |
|
}; |
|
} |
|
|
|
function attrRemoveNS(fullname) { |
|
return function() { |
|
this.removeAttributeNS(fullname.space, fullname.local); |
|
}; |
|
} |
|
|
|
function attrConstant(name, value) { |
|
return function() { |
|
this.setAttribute(name, value); |
|
}; |
|
} |
|
|
|
function attrConstantNS(fullname, value) { |
|
return function() { |
|
this.setAttributeNS(fullname.space, fullname.local, value); |
|
}; |
|
} |
|
|
|
function attrFunction(name, value) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
if (v == null) this.removeAttribute(name); |
|
else this.setAttribute(name, v); |
|
}; |
|
} |
|
|
|
function attrFunctionNS(fullname, value) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
if (v == null) this.removeAttributeNS(fullname.space, fullname.local); |
|
else this.setAttributeNS(fullname.space, fullname.local, v); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value) { |
|
var fullname = Object(_namespace__WEBPACK_IMPORTED_MODULE_0__["default"])(name); |
|
|
|
if (arguments.length < 2) { |
|
var node = this.node(); |
|
return fullname.local |
|
? node.getAttributeNS(fullname.space, fullname.local) |
|
: node.getAttribute(fullname); |
|
} |
|
|
|
return this.each((value == null |
|
? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" |
|
? (fullname.local ? attrFunctionNS : attrFunction) |
|
: (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/call.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/call.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var callback = arguments[0]; |
|
arguments[0] = this; |
|
callback.apply(null, arguments); |
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/classed.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/classed.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function classArray(string) { |
|
return string.trim().split(/^|\s+/); |
|
} |
|
|
|
function classList(node) { |
|
return node.classList || new ClassList(node); |
|
} |
|
|
|
function ClassList(node) { |
|
this._node = node; |
|
this._names = classArray(node.getAttribute("class") || ""); |
|
} |
|
|
|
ClassList.prototype = { |
|
add: function(name) { |
|
var i = this._names.indexOf(name); |
|
if (i < 0) { |
|
this._names.push(name); |
|
this._node.setAttribute("class", this._names.join(" ")); |
|
} |
|
}, |
|
remove: function(name) { |
|
var i = this._names.indexOf(name); |
|
if (i >= 0) { |
|
this._names.splice(i, 1); |
|
this._node.setAttribute("class", this._names.join(" ")); |
|
} |
|
}, |
|
contains: function(name) { |
|
return this._names.indexOf(name) >= 0; |
|
} |
|
}; |
|
|
|
function classedAdd(node, names) { |
|
var list = classList(node), i = -1, n = names.length; |
|
while (++i < n) list.add(names[i]); |
|
} |
|
|
|
function classedRemove(node, names) { |
|
var list = classList(node), i = -1, n = names.length; |
|
while (++i < n) list.remove(names[i]); |
|
} |
|
|
|
function classedTrue(names) { |
|
return function() { |
|
classedAdd(this, names); |
|
}; |
|
} |
|
|
|
function classedFalse(names) { |
|
return function() { |
|
classedRemove(this, names); |
|
}; |
|
} |
|
|
|
function classedFunction(names, value) { |
|
return function() { |
|
(value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value) { |
|
var names = classArray(name + ""); |
|
|
|
if (arguments.length < 2) { |
|
var list = classList(this.node()), i = -1, n = names.length; |
|
while (++i < n) if (!list.contains(names[i])) return false; |
|
return true; |
|
} |
|
|
|
return this.each((typeof value === "function" |
|
? classedFunction : value |
|
? classedTrue |
|
: classedFalse)(names, value)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/clone.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/clone.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function selection_cloneShallow() { |
|
var clone = this.cloneNode(false), parent = this.parentNode; |
|
return parent ? parent.insertBefore(clone, this.nextSibling) : clone; |
|
} |
|
|
|
function selection_cloneDeep() { |
|
var clone = this.cloneNode(true), parent = this.parentNode; |
|
return parent ? parent.insertBefore(clone, this.nextSibling) : clone; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(deep) { |
|
return this.select(deep ? selection_cloneDeep : selection_cloneShallow); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/data.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/data.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
/* harmony import */ var _enter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enter */ "../node_modules/d3-selection/src/selection/enter.js"); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constant */ "../node_modules/d3-selection/src/constant.js"); |
|
|
|
|
|
|
|
|
|
var keyPrefix = "$"; // Protect against keys like “__proto__”. |
|
|
|
function bindIndex(parent, group, enter, update, exit, data) { |
|
var i = 0, |
|
node, |
|
groupLength = group.length, |
|
dataLength = data.length; |
|
|
|
// Put any non-null nodes that fit into update. |
|
// Put any null nodes into enter. |
|
// Put any remaining data into enter. |
|
for (; i < dataLength; ++i) { |
|
if (node = group[i]) { |
|
node.__data__ = data[i]; |
|
update[i] = node; |
|
} else { |
|
enter[i] = new _enter__WEBPACK_IMPORTED_MODULE_1__["EnterNode"](parent, data[i]); |
|
} |
|
} |
|
|
|
// Put any non-null nodes that don’t fit into exit. |
|
for (; i < groupLength; ++i) { |
|
if (node = group[i]) { |
|
exit[i] = node; |
|
} |
|
} |
|
} |
|
|
|
function bindKey(parent, group, enter, update, exit, data, key) { |
|
var i, |
|
node, |
|
nodeByKeyValue = {}, |
|
groupLength = group.length, |
|
dataLength = data.length, |
|
keyValues = new Array(groupLength), |
|
keyValue; |
|
|
|
// Compute the key for each node. |
|
// If multiple nodes have the same key, the duplicates are added to exit. |
|
for (i = 0; i < groupLength; ++i) { |
|
if (node = group[i]) { |
|
keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group); |
|
if (keyValue in nodeByKeyValue) { |
|
exit[i] = node; |
|
} else { |
|
nodeByKeyValue[keyValue] = node; |
|
} |
|
} |
|
} |
|
|
|
// Compute the key for each datum. |
|
// If there a node associated with this key, join and add it to update. |
|
// If there is not (or the key is a duplicate), add it to enter. |
|
for (i = 0; i < dataLength; ++i) { |
|
keyValue = keyPrefix + key.call(parent, data[i], i, data); |
|
if (node = nodeByKeyValue[keyValue]) { |
|
update[i] = node; |
|
node.__data__ = data[i]; |
|
nodeByKeyValue[keyValue] = null; |
|
} else { |
|
enter[i] = new _enter__WEBPACK_IMPORTED_MODULE_1__["EnterNode"](parent, data[i]); |
|
} |
|
} |
|
|
|
// Add any remaining nodes that were not bound to data to exit. |
|
for (i = 0; i < groupLength; ++i) { |
|
if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) { |
|
exit[i] = node; |
|
} |
|
} |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value, key) { |
|
if (!value) { |
|
data = new Array(this.size()), j = -1; |
|
this.each(function(d) { data[++j] = d; }); |
|
return data; |
|
} |
|
|
|
var bind = key ? bindKey : bindIndex, |
|
parents = this._parents, |
|
groups = this._groups; |
|
|
|
if (typeof value !== "function") value = Object(_constant__WEBPACK_IMPORTED_MODULE_2__["default"])(value); |
|
|
|
for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { |
|
var parent = parents[j], |
|
group = groups[j], |
|
groupLength = group.length, |
|
data = value.call(parent, parent && parent.__data__, j, parents), |
|
dataLength = data.length, |
|
enterGroup = enter[j] = new Array(dataLength), |
|
updateGroup = update[j] = new Array(dataLength), |
|
exitGroup = exit[j] = new Array(groupLength); |
|
|
|
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); |
|
|
|
// Now connect the enter nodes to their following update node, such that |
|
// appendChild can insert the materialized enter node before this node, |
|
// rather than at the end of the parent node. |
|
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { |
|
if (previous = enterGroup[i0]) { |
|
if (i0 >= i1) i1 = i0 + 1; |
|
while (!(next = updateGroup[i1]) && ++i1 < dataLength); |
|
previous._next = next || null; |
|
} |
|
} |
|
} |
|
|
|
update = new _index__WEBPACK_IMPORTED_MODULE_0__["Selection"](update, parents); |
|
update._enter = enter; |
|
update._exit = exit; |
|
return update; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/datum.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/datum.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
return arguments.length |
|
? this.property("__data__", value) |
|
: this.node().__data__; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/dispatch.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/dispatch.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../window */ "../node_modules/d3-selection/src/window.js"); |
|
|
|
|
|
function dispatchEvent(node, type, params) { |
|
var window = Object(_window__WEBPACK_IMPORTED_MODULE_0__["default"])(node), |
|
event = window.CustomEvent; |
|
|
|
if (typeof event === "function") { |
|
event = new event(type, params); |
|
} else { |
|
event = window.document.createEvent("Event"); |
|
if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; |
|
else event.initEvent(type, false, false); |
|
} |
|
|
|
node.dispatchEvent(event); |
|
} |
|
|
|
function dispatchConstant(type, params) { |
|
return function() { |
|
return dispatchEvent(this, type, params); |
|
}; |
|
} |
|
|
|
function dispatchFunction(type, params) { |
|
return function() { |
|
return dispatchEvent(this, type, params.apply(this, arguments)); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(type, params) { |
|
return this.each((typeof params === "function" |
|
? dispatchFunction |
|
: dispatchConstant)(type, params)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/each.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/each.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback) { |
|
|
|
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { |
|
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { |
|
if (node = group[i]) callback.call(node, node.__data__, i, group); |
|
} |
|
} |
|
|
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/empty.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/empty.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return !this.node(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/enter.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/enter.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default, EnterNode */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EnterNode", function() { return EnterNode; }); |
|
/* harmony import */ var _sparse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sparse */ "../node_modules/d3-selection/src/selection/sparse.js"); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return new _index__WEBPACK_IMPORTED_MODULE_1__["Selection"](this._enter || this._groups.map(_sparse__WEBPACK_IMPORTED_MODULE_0__["default"]), this._parents); |
|
}); |
|
|
|
function EnterNode(parent, datum) { |
|
this.ownerDocument = parent.ownerDocument; |
|
this.namespaceURI = parent.namespaceURI; |
|
this._next = null; |
|
this._parent = parent; |
|
this.__data__ = datum; |
|
} |
|
|
|
EnterNode.prototype = { |
|
constructor: EnterNode, |
|
appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, |
|
insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, |
|
querySelector: function(selector) { return this._parent.querySelector(selector); }, |
|
querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/exit.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/exit.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _sparse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sparse */ "../node_modules/d3-selection/src/selection/sparse.js"); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return new _index__WEBPACK_IMPORTED_MODULE_1__["Selection"](this._exit || this._groups.map(_sparse__WEBPACK_IMPORTED_MODULE_0__["default"]), this._parents); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/filter.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/filter.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
/* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../matcher */ "../node_modules/d3-selection/src/matcher.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(match) { |
|
if (typeof match !== "function") match = Object(_matcher__WEBPACK_IMPORTED_MODULE_1__["default"])(match); |
|
|
|
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { |
|
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { |
|
subgroup.push(node); |
|
} |
|
} |
|
} |
|
|
|
return new _index__WEBPACK_IMPORTED_MODULE_0__["Selection"](subgroups, this._parents); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/html.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/html.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function htmlRemove() { |
|
this.innerHTML = ""; |
|
} |
|
|
|
function htmlConstant(value) { |
|
return function() { |
|
this.innerHTML = value; |
|
}; |
|
} |
|
|
|
function htmlFunction(value) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
this.innerHTML = v == null ? "" : v; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
return arguments.length |
|
? this.each(value == null |
|
? htmlRemove : (typeof value === "function" |
|
? htmlFunction |
|
: htmlConstant)(value)) |
|
: this.node().innerHTML; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/index.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/index.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: root, Selection, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "root", function() { return root; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); |
|
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./select */ "../node_modules/d3-selection/src/selection/select.js"); |
|
/* harmony import */ var _selectAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectAll */ "../node_modules/d3-selection/src/selection/selectAll.js"); |
|
/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filter */ "../node_modules/d3-selection/src/selection/filter.js"); |
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./data */ "../node_modules/d3-selection/src/selection/data.js"); |
|
/* harmony import */ var _enter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./enter */ "../node_modules/d3-selection/src/selection/enter.js"); |
|
/* harmony import */ var _exit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exit */ "../node_modules/d3-selection/src/selection/exit.js"); |
|
/* harmony import */ var _join__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./join */ "../node_modules/d3-selection/src/selection/join.js"); |
|
/* harmony import */ var _merge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./merge */ "../node_modules/d3-selection/src/selection/merge.js"); |
|
/* harmony import */ var _order__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./order */ "../node_modules/d3-selection/src/selection/order.js"); |
|
/* harmony import */ var _sort__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sort */ "../node_modules/d3-selection/src/selection/sort.js"); |
|
/* harmony import */ var _call__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./call */ "../node_modules/d3-selection/src/selection/call.js"); |
|
/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./nodes */ "../node_modules/d3-selection/src/selection/nodes.js"); |
|
/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./node */ "../node_modules/d3-selection/src/selection/node.js"); |
|
/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./size */ "../node_modules/d3-selection/src/selection/size.js"); |
|
/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./empty */ "../node_modules/d3-selection/src/selection/empty.js"); |
|
/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./each */ "../node_modules/d3-selection/src/selection/each.js"); |
|
/* harmony import */ var _attr__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./attr */ "../node_modules/d3-selection/src/selection/attr.js"); |
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./style */ "../node_modules/d3-selection/src/selection/style.js"); |
|
/* harmony import */ var _property__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./property */ "../node_modules/d3-selection/src/selection/property.js"); |
|
/* harmony import */ var _classed__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./classed */ "../node_modules/d3-selection/src/selection/classed.js"); |
|
/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./text */ "../node_modules/d3-selection/src/selection/text.js"); |
|
/* harmony import */ var _html__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./html */ "../node_modules/d3-selection/src/selection/html.js"); |
|
/* harmony import */ var _raise__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./raise */ "../node_modules/d3-selection/src/selection/raise.js"); |
|
/* harmony import */ var _lower__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./lower */ "../node_modules/d3-selection/src/selection/lower.js"); |
|
/* harmony import */ var _append__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./append */ "../node_modules/d3-selection/src/selection/append.js"); |
|
/* harmony import */ var _insert__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./insert */ "../node_modules/d3-selection/src/selection/insert.js"); |
|
/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./remove */ "../node_modules/d3-selection/src/selection/remove.js"); |
|
/* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./clone */ "../node_modules/d3-selection/src/selection/clone.js"); |
|
/* harmony import */ var _datum__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./datum */ "../node_modules/d3-selection/src/selection/datum.js"); |
|
/* harmony import */ var _on__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./on */ "../node_modules/d3-selection/src/selection/on.js"); |
|
/* harmony import */ var _dispatch__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./dispatch */ "../node_modules/d3-selection/src/selection/dispatch.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var root = [null]; |
|
|
|
function Selection(groups, parents) { |
|
this._groups = groups; |
|
this._parents = parents; |
|
} |
|
|
|
function selection() { |
|
return new Selection([[document.documentElement]], root); |
|
} |
|
|
|
Selection.prototype = selection.prototype = { |
|
constructor: Selection, |
|
select: _select__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
selectAll: _selectAll__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
filter: _filter__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
data: _data__WEBPACK_IMPORTED_MODULE_3__["default"], |
|
enter: _enter__WEBPACK_IMPORTED_MODULE_4__["default"], |
|
exit: _exit__WEBPACK_IMPORTED_MODULE_5__["default"], |
|
join: _join__WEBPACK_IMPORTED_MODULE_6__["default"], |
|
merge: _merge__WEBPACK_IMPORTED_MODULE_7__["default"], |
|
order: _order__WEBPACK_IMPORTED_MODULE_8__["default"], |
|
sort: _sort__WEBPACK_IMPORTED_MODULE_9__["default"], |
|
call: _call__WEBPACK_IMPORTED_MODULE_10__["default"], |
|
nodes: _nodes__WEBPACK_IMPORTED_MODULE_11__["default"], |
|
node: _node__WEBPACK_IMPORTED_MODULE_12__["default"], |
|
size: _size__WEBPACK_IMPORTED_MODULE_13__["default"], |
|
empty: _empty__WEBPACK_IMPORTED_MODULE_14__["default"], |
|
each: _each__WEBPACK_IMPORTED_MODULE_15__["default"], |
|
attr: _attr__WEBPACK_IMPORTED_MODULE_16__["default"], |
|
style: _style__WEBPACK_IMPORTED_MODULE_17__["default"], |
|
property: _property__WEBPACK_IMPORTED_MODULE_18__["default"], |
|
classed: _classed__WEBPACK_IMPORTED_MODULE_19__["default"], |
|
text: _text__WEBPACK_IMPORTED_MODULE_20__["default"], |
|
html: _html__WEBPACK_IMPORTED_MODULE_21__["default"], |
|
raise: _raise__WEBPACK_IMPORTED_MODULE_22__["default"], |
|
lower: _lower__WEBPACK_IMPORTED_MODULE_23__["default"], |
|
append: _append__WEBPACK_IMPORTED_MODULE_24__["default"], |
|
insert: _insert__WEBPACK_IMPORTED_MODULE_25__["default"], |
|
remove: _remove__WEBPACK_IMPORTED_MODULE_26__["default"], |
|
clone: _clone__WEBPACK_IMPORTED_MODULE_27__["default"], |
|
datum: _datum__WEBPACK_IMPORTED_MODULE_28__["default"], |
|
on: _on__WEBPACK_IMPORTED_MODULE_29__["default"], |
|
dispatch: _dispatch__WEBPACK_IMPORTED_MODULE_30__["default"] |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (selection); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/insert.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/insert.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _creator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../creator */ "../node_modules/d3-selection/src/creator.js"); |
|
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selector */ "../node_modules/d3-selection/src/selector.js"); |
|
|
|
|
|
|
|
function constantNull() { |
|
return null; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, before) { |
|
var create = typeof name === "function" ? name : Object(_creator__WEBPACK_IMPORTED_MODULE_0__["default"])(name), |
|
select = before == null ? constantNull : typeof before === "function" ? before : Object(_selector__WEBPACK_IMPORTED_MODULE_1__["default"])(before); |
|
return this.select(function() { |
|
return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/join.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/join.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(onenter, onupdate, onexit) { |
|
var enter = this.enter(), update = this, exit = this.exit(); |
|
enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""); |
|
if (onupdate != null) update = onupdate(update); |
|
if (onexit == null) exit.remove(); else onexit(exit); |
|
return enter && update ? enter.merge(update).order() : update; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/lower.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/lower.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function lower() { |
|
if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return this.each(lower); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/merge.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/merge.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(selection) { |
|
|
|
for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { |
|
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { |
|
if (node = group0[i] || group1[i]) { |
|
merge[i] = node; |
|
} |
|
} |
|
} |
|
|
|
for (; j < m0; ++j) { |
|
merges[j] = groups0[j]; |
|
} |
|
|
|
return new _index__WEBPACK_IMPORTED_MODULE_0__["Selection"](merges, this._parents); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/node.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/node.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
|
|
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { |
|
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { |
|
var node = group[i]; |
|
if (node) return node; |
|
} |
|
} |
|
|
|
return null; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/nodes.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/nodes.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var nodes = new Array(this.size()), i = -1; |
|
this.each(function() { nodes[++i] = this; }); |
|
return nodes; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/on.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/on.js ***! |
|
\********************************************************/ |
|
/*! exports provided: event, default, customEvent */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "event", function() { return event; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "customEvent", function() { return customEvent; }); |
|
var filterEvents = {}; |
|
|
|
var event = null; |
|
|
|
if (typeof document !== "undefined") { |
|
var element = document.documentElement; |
|
if (!("onmouseenter" in element)) { |
|
filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"}; |
|
} |
|
} |
|
|
|
function filterContextListener(listener, index, group) { |
|
listener = contextListener(listener, index, group); |
|
return function(event) { |
|
var related = event.relatedTarget; |
|
if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) { |
|
listener.call(this, event); |
|
} |
|
}; |
|
} |
|
|
|
function contextListener(listener, index, group) { |
|
return function(event1) { |
|
var event0 = event; // Events can be reentrant (e.g., focus). |
|
event = event1; |
|
try { |
|
listener.call(this, this.__data__, index, group); |
|
} finally { |
|
event = event0; |
|
} |
|
}; |
|
} |
|
|
|
function parseTypenames(typenames) { |
|
return typenames.trim().split(/^|\s+/).map(function(t) { |
|
var name = "", i = t.indexOf("."); |
|
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); |
|
return {type: t, name: name}; |
|
}); |
|
} |
|
|
|
function onRemove(typename) { |
|
return function() { |
|
var on = this.__on; |
|
if (!on) return; |
|
for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { |
|
if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { |
|
this.removeEventListener(o.type, o.listener, o.capture); |
|
} else { |
|
on[++i] = o; |
|
} |
|
} |
|
if (++i) on.length = i; |
|
else delete this.__on; |
|
}; |
|
} |
|
|
|
function onAdd(typename, value, capture) { |
|
var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener; |
|
return function(d, i, group) { |
|
var on = this.__on, o, listener = wrap(value, i, group); |
|
if (on) for (var j = 0, m = on.length; j < m; ++j) { |
|
if ((o = on[j]).type === typename.type && o.name === typename.name) { |
|
this.removeEventListener(o.type, o.listener, o.capture); |
|
this.addEventListener(o.type, o.listener = listener, o.capture = capture); |
|
o.value = value; |
|
return; |
|
} |
|
} |
|
this.addEventListener(typename.type, listener, capture); |
|
o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture}; |
|
if (!on) this.__on = [o]; |
|
else on.push(o); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(typename, value, capture) { |
|
var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; |
|
|
|
if (arguments.length < 2) { |
|
var on = this.node().__on; |
|
if (on) for (var j = 0, m = on.length, o; j < m; ++j) { |
|
for (i = 0, o = on[j]; i < n; ++i) { |
|
if ((t = typenames[i]).type === o.type && t.name === o.name) { |
|
return o.value; |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
on = value ? onAdd : onRemove; |
|
if (capture == null) capture = false; |
|
for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture)); |
|
return this; |
|
}); |
|
|
|
function customEvent(event1, listener, that, args) { |
|
var event0 = event; |
|
event1.sourceEvent = event; |
|
event = event1; |
|
try { |
|
return listener.apply(that, args); |
|
} finally { |
|
event = event0; |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/order.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/order.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
|
|
for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { |
|
for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { |
|
if (node = group[i]) { |
|
if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); |
|
next = node; |
|
} |
|
} |
|
} |
|
|
|
return this; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/property.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/property.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function propertyRemove(name) { |
|
return function() { |
|
delete this[name]; |
|
}; |
|
} |
|
|
|
function propertyConstant(name, value) { |
|
return function() { |
|
this[name] = value; |
|
}; |
|
} |
|
|
|
function propertyFunction(name, value) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
if (v == null) delete this[name]; |
|
else this[name] = v; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value) { |
|
return arguments.length > 1 |
|
? this.each((value == null |
|
? propertyRemove : typeof value === "function" |
|
? propertyFunction |
|
: propertyConstant)(name, value)) |
|
: this.node()[name]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/raise.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/raise.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function raise() { |
|
if (this.nextSibling) this.parentNode.appendChild(this); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return this.each(raise); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/remove.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/remove.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function remove() { |
|
var parent = this.parentNode; |
|
if (parent) parent.removeChild(this); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return this.each(remove); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/select.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/select.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selector */ "../node_modules/d3-selection/src/selector.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(select) { |
|
if (typeof select !== "function") select = Object(_selector__WEBPACK_IMPORTED_MODULE_1__["default"])(select); |
|
|
|
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { |
|
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { |
|
if ("__data__" in node) subnode.__data__ = node.__data__; |
|
subgroup[i] = subnode; |
|
} |
|
} |
|
} |
|
|
|
return new _index__WEBPACK_IMPORTED_MODULE_0__["Selection"](subgroups, this._parents); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/selectAll.js": |
|
/*!***************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/selectAll.js ***! |
|
\***************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
/* harmony import */ var _selectorAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selectorAll */ "../node_modules/d3-selection/src/selectorAll.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(select) { |
|
if (typeof select !== "function") select = Object(_selectorAll__WEBPACK_IMPORTED_MODULE_1__["default"])(select); |
|
|
|
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { |
|
if (node = group[i]) { |
|
subgroups.push(select.call(node, node.__data__, i, group)); |
|
parents.push(node); |
|
} |
|
} |
|
} |
|
|
|
return new _index__WEBPACK_IMPORTED_MODULE_0__["Selection"](subgroups, parents); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/size.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/size.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var size = 0; |
|
this.each(function() { ++size; }); |
|
return size; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/sort.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/sort.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "../node_modules/d3-selection/src/selection/index.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(compare) { |
|
if (!compare) compare = ascending; |
|
|
|
function compareNode(a, b) { |
|
return a && b ? compare(a.__data__, b.__data__) : !a - !b; |
|
} |
|
|
|
for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { |
|
if (node = group[i]) { |
|
sortgroup[i] = node; |
|
} |
|
} |
|
sortgroup.sort(compareNode); |
|
} |
|
|
|
return new _index__WEBPACK_IMPORTED_MODULE_0__["Selection"](sortgroups, this._parents).order(); |
|
}); |
|
|
|
function ascending(a, b) { |
|
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/sparse.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/sparse.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(update) { |
|
return new Array(update.length); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/style.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/style.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default, styleValue */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "styleValue", function() { return styleValue; }); |
|
/* harmony import */ var _window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../window */ "../node_modules/d3-selection/src/window.js"); |
|
|
|
|
|
function styleRemove(name) { |
|
return function() { |
|
this.style.removeProperty(name); |
|
}; |
|
} |
|
|
|
function styleConstant(name, value, priority) { |
|
return function() { |
|
this.style.setProperty(name, value, priority); |
|
}; |
|
} |
|
|
|
function styleFunction(name, value, priority) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
if (v == null) this.style.removeProperty(name); |
|
else this.style.setProperty(name, v, priority); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value, priority) { |
|
return arguments.length > 1 |
|
? this.each((value == null |
|
? styleRemove : typeof value === "function" |
|
? styleFunction |
|
: styleConstant)(name, value, priority == null ? "" : priority)) |
|
: styleValue(this.node(), name); |
|
}); |
|
|
|
function styleValue(node, name) { |
|
return node.style.getPropertyValue(name) |
|
|| Object(_window__WEBPACK_IMPORTED_MODULE_0__["default"])(node).getComputedStyle(node, null).getPropertyValue(name); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selection/text.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selection/text.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function textRemove() { |
|
this.textContent = ""; |
|
} |
|
|
|
function textConstant(value) { |
|
return function() { |
|
this.textContent = value; |
|
}; |
|
} |
|
|
|
function textFunction(value) { |
|
return function() { |
|
var v = value.apply(this, arguments); |
|
this.textContent = v == null ? "" : v; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
return arguments.length |
|
? this.each(value == null |
|
? textRemove : (typeof value === "function" |
|
? textFunction |
|
: textConstant)(value)) |
|
: this.node().textContent; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selector.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selector.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function none() {} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(selector) { |
|
return selector == null ? none : function() { |
|
return this.querySelector(selector); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/selectorAll.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/selectorAll.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function empty() { |
|
return []; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(selector) { |
|
return selector == null ? empty : function() { |
|
return this.querySelectorAll(selector); |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/sourceEvent.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/sourceEvent.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _selection_on__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection/on */ "../node_modules/d3-selection/src/selection/on.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var current = _selection_on__WEBPACK_IMPORTED_MODULE_0__["event"], source; |
|
while (source = current.sourceEvent) current = source; |
|
return current; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/touch.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/touch.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _sourceEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sourceEvent */ "../node_modules/d3-selection/src/sourceEvent.js"); |
|
/* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./point */ "../node_modules/d3-selection/src/point.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, touches, identifier) { |
|
if (arguments.length < 3) identifier = touches, touches = Object(_sourceEvent__WEBPACK_IMPORTED_MODULE_0__["default"])().changedTouches; |
|
|
|
for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) { |
|
if ((touch = touches[i]).identifier === identifier) { |
|
return Object(_point__WEBPACK_IMPORTED_MODULE_1__["default"])(node, touch); |
|
} |
|
} |
|
|
|
return null; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/touches.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/touches.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _sourceEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sourceEvent */ "../node_modules/d3-selection/src/sourceEvent.js"); |
|
/* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./point */ "../node_modules/d3-selection/src/point.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, touches) { |
|
if (touches == null) touches = Object(_sourceEvent__WEBPACK_IMPORTED_MODULE_0__["default"])().touches; |
|
|
|
for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) { |
|
points[i] = Object(_point__WEBPACK_IMPORTED_MODULE_1__["default"])(node, touches[i]); |
|
} |
|
|
|
return points; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-selection/src/window.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-selection/src/window.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(node) { |
|
return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node |
|
|| (node.document && node) // node is a Window |
|
|| node.defaultView; // node is a Document |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/arc.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-shape/src/arc.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-shape/src/math.js"); |
|
|
|
|
|
|
|
|
|
function arcInnerRadius(d) { |
|
return d.innerRadius; |
|
} |
|
|
|
function arcOuterRadius(d) { |
|
return d.outerRadius; |
|
} |
|
|
|
function arcStartAngle(d) { |
|
return d.startAngle; |
|
} |
|
|
|
function arcEndAngle(d) { |
|
return d.endAngle; |
|
} |
|
|
|
function arcPadAngle(d) { |
|
return d && d.padAngle; // Note: optional! |
|
} |
|
|
|
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { |
|
var x10 = x1 - x0, y10 = y1 - y0, |
|
x32 = x3 - x2, y32 = y3 - y2, |
|
t = y32 * x10 - x32 * y10; |
|
if (t * t < _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) return; |
|
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; |
|
return [x0 + t * x10, y0 + t * y10]; |
|
} |
|
|
|
// Compute perpendicular offset line of length rc. |
|
// http://mathworld.wolfram.com/Circle-LineIntersection.html |
|
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { |
|
var x01 = x0 - x1, |
|
y01 = y0 - y1, |
|
lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(x01 * x01 + y01 * y01), |
|
ox = lo * y01, |
|
oy = -lo * x01, |
|
x11 = x0 + ox, |
|
y11 = y0 + oy, |
|
x10 = x1 + ox, |
|
y10 = y1 + oy, |
|
x00 = (x11 + x10) / 2, |
|
y00 = (y11 + y10) / 2, |
|
dx = x10 - x11, |
|
dy = y10 - y11, |
|
d2 = dx * dx + dy * dy, |
|
r = r1 - rc, |
|
D = x11 * y10 - x10 * y11, |
|
d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["max"])(0, r * r * d2 - D * D)), |
|
cx0 = (D * dy - dx * d) / d2, |
|
cy0 = (-D * dx - dy * d) / d2, |
|
cx1 = (D * dy + dx * d) / d2, |
|
cy1 = (-D * dx + dy * d) / d2, |
|
dx0 = cx0 - x00, |
|
dy0 = cy0 - y00, |
|
dx1 = cx1 - x00, |
|
dy1 = cy1 - y00; |
|
|
|
// Pick the closer of the two intersection points. |
|
// TODO Is there a faster way to determine which intersection to use? |
|
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; |
|
|
|
return { |
|
cx: cx0, |
|
cy: cy0, |
|
x01: -ox, |
|
y01: -oy, |
|
x11: cx0 * (r1 / r - 1), |
|
y11: cy0 * (r1 / r - 1) |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var innerRadius = arcInnerRadius, |
|
outerRadius = arcOuterRadius, |
|
cornerRadius = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(0), |
|
padRadius = null, |
|
startAngle = arcStartAngle, |
|
endAngle = arcEndAngle, |
|
padAngle = arcPadAngle, |
|
context = null; |
|
|
|
function arc() { |
|
var buffer, |
|
r, |
|
r0 = +innerRadius.apply(this, arguments), |
|
r1 = +outerRadius.apply(this, arguments), |
|
a0 = startAngle.apply(this, arguments) - _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"], |
|
a1 = endAngle.apply(this, arguments) - _math_js__WEBPACK_IMPORTED_MODULE_2__["halfPi"], |
|
da = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(a1 - a0), |
|
cw = a1 > a0; |
|
|
|
if (!context) context = buffer = Object(d3_path__WEBPACK_IMPORTED_MODULE_0__["path"])(); |
|
|
|
// Ensure that the outer radius is always larger than the inner radius. |
|
if (r1 < r0) r = r1, r1 = r0, r0 = r; |
|
|
|
// Is it a point? |
|
if (!(r1 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"])) context.moveTo(0, 0); |
|
|
|
// Or is it a circle or annulus? |
|
else if (da > _math_js__WEBPACK_IMPORTED_MODULE_2__["tau"] - _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) { |
|
context.moveTo(r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a0), r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a0)); |
|
context.arc(0, 0, r1, a0, a1, !cw); |
|
if (r0 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) { |
|
context.moveTo(r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a1), r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a1)); |
|
context.arc(0, 0, r0, a1, a0, cw); |
|
} |
|
} |
|
|
|
// Or is it a circular or annular sector? |
|
else { |
|
var a01 = a0, |
|
a11 = a1, |
|
a00 = a0, |
|
a10 = a1, |
|
da0 = da, |
|
da1 = da, |
|
ap = padAngle.apply(this, arguments) / 2, |
|
rp = (ap > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) && (padRadius ? +padRadius.apply(this, arguments) : Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(r0 * r0 + r1 * r1)), |
|
rc = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["min"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["abs"])(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), |
|
rc0 = rc, |
|
rc1 = rc, |
|
t0, |
|
t1; |
|
|
|
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0. |
|
if (rp > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) { |
|
var p0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["asin"])(rp / r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(ap)), |
|
p1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["asin"])(rp / r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(ap)); |
|
if ((da0 -= p0 * 2) > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0; |
|
else da0 = 0, a00 = a10 = (a0 + a1) / 2; |
|
if ((da1 -= p1 * 2) > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1; |
|
else da1 = 0, a01 = a11 = (a0 + a1) / 2; |
|
} |
|
|
|
var x01 = r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a01), |
|
y01 = r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a01), |
|
x10 = r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a10), |
|
y10 = r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a10); |
|
|
|
// Apply rounded corners? |
|
if (rc > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) { |
|
var x11 = r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a11), |
|
y11 = r1 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a11), |
|
x00 = r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a00), |
|
y00 = r0 * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a00), |
|
oc; |
|
|
|
// Restrict the corner radius according to the sector angle. |
|
if (da < _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"] && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { |
|
var ax = x01 - oc[0], |
|
ay = y01 - oc[1], |
|
bx = x11 - oc[0], |
|
by = y11 - oc[1], |
|
kc = 1 / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["acos"])((ax * bx + ay * by) / (Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(ax * ax + ay * ay) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(bx * bx + by * by))) / 2), |
|
lc = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sqrt"])(oc[0] * oc[0] + oc[1] * oc[1]); |
|
rc0 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["min"])(rc, (r0 - lc) / (kc - 1)); |
|
rc1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["min"])(rc, (r1 - lc) / (kc + 1)); |
|
} |
|
} |
|
|
|
// Is the sector collapsed to a line? |
|
if (!(da1 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"])) context.moveTo(x01, y01); |
|
|
|
// Does the sector’s outer ring have rounded corners? |
|
else if (rc1 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) { |
|
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); |
|
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); |
|
|
|
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01); |
|
|
|
// Have the corners merged? |
|
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.y01, t0.x01), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.y01, t1.x01), !cw); |
|
|
|
// Otherwise, draw the two corners and the ring. |
|
else { |
|
context.arc(t0.cx, t0.cy, rc1, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.y01, t0.x01), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.y11, t0.x11), !cw); |
|
context.arc(0, 0, r1, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.cy + t0.y11, t0.cx + t0.x11), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.cy + t1.y11, t1.cx + t1.x11), !cw); |
|
context.arc(t1.cx, t1.cy, rc1, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.y11, t1.x11), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.y01, t1.x01), !cw); |
|
} |
|
} |
|
|
|
// Or is the outer ring just a circular arc? |
|
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); |
|
|
|
// Is there no inner ring, and it’s a circular sector? |
|
// Or perhaps it’s an annular sector collapsed due to padding? |
|
if (!(r0 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) || !(da0 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"])) context.lineTo(x10, y10); |
|
|
|
// Does the sector’s inner ring (or point) have rounded corners? |
|
else if (rc0 > _math_js__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) { |
|
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); |
|
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); |
|
|
|
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01); |
|
|
|
// Have the corners merged? |
|
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.y01, t0.x01), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.y01, t1.x01), !cw); |
|
|
|
// Otherwise, draw the two corners and the ring. |
|
else { |
|
context.arc(t0.cx, t0.cy, rc0, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.y01, t0.x01), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.y11, t0.x11), !cw); |
|
context.arc(0, 0, r0, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t0.cy + t0.y11, t0.cx + t0.x11), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.cy + t1.y11, t1.cx + t1.x11), cw); |
|
context.arc(t1.cx, t1.cy, rc0, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.y11, t1.x11), Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["atan2"])(t1.y01, t1.x01), !cw); |
|
} |
|
} |
|
|
|
// Or is the inner ring just a circular arc? |
|
else context.arc(0, 0, r0, a10, a00, cw); |
|
} |
|
|
|
context.closePath(); |
|
|
|
if (buffer) return context = null, buffer + "" || null; |
|
} |
|
|
|
arc.centroid = function() { |
|
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, |
|
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - _math_js__WEBPACK_IMPORTED_MODULE_2__["pi"] / 2; |
|
return [Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["cos"])(a) * r, Object(_math_js__WEBPACK_IMPORTED_MODULE_2__["sin"])(a) * r]; |
|
}; |
|
|
|
arc.innerRadius = function(_) { |
|
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : innerRadius; |
|
}; |
|
|
|
arc.outerRadius = function(_) { |
|
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : outerRadius; |
|
}; |
|
|
|
arc.cornerRadius = function(_) { |
|
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : cornerRadius; |
|
}; |
|
|
|
arc.padRadius = function(_) { |
|
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : padRadius; |
|
}; |
|
|
|
arc.startAngle = function(_) { |
|
return arguments.length ? (startAngle = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : startAngle; |
|
}; |
|
|
|
arc.endAngle = function(_) { |
|
return arguments.length ? (endAngle = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : endAngle; |
|
}; |
|
|
|
arc.padAngle = function(_) { |
|
return arguments.length ? (padAngle = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), arc) : padAngle; |
|
}; |
|
|
|
arc.context = function(_) { |
|
return arguments.length ? ((context = _ == null ? null : _), arc) : context; |
|
}; |
|
|
|
return arc; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/area.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/area.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
/* harmony import */ var _curve_linear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./curve/linear.js */ "../node_modules/d3-shape/src/curve/linear.js"); |
|
/* harmony import */ var _line_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./line.js */ "../node_modules/d3-shape/src/line.js"); |
|
/* harmony import */ var _point_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./point.js */ "../node_modules/d3-shape/src/point.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var x0 = _point_js__WEBPACK_IMPORTED_MODULE_4__["x"], |
|
x1 = null, |
|
y0 = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(0), |
|
y1 = _point_js__WEBPACK_IMPORTED_MODULE_4__["y"], |
|
defined = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(true), |
|
context = null, |
|
curve = _curve_linear_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
output = null; |
|
|
|
function area(data) { |
|
var i, |
|
j, |
|
k, |
|
n = data.length, |
|
d, |
|
defined0 = false, |
|
buffer, |
|
x0z = new Array(n), |
|
y0z = new Array(n); |
|
|
|
if (context == null) output = curve(buffer = Object(d3_path__WEBPACK_IMPORTED_MODULE_0__["path"])()); |
|
|
|
for (i = 0; i <= n; ++i) { |
|
if (!(i < n && defined(d = data[i], i, data)) === defined0) { |
|
if (defined0 = !defined0) { |
|
j = i; |
|
output.areaStart(); |
|
output.lineStart(); |
|
} else { |
|
output.lineEnd(); |
|
output.lineStart(); |
|
for (k = i - 1; k >= j; --k) { |
|
output.point(x0z[k], y0z[k]); |
|
} |
|
output.lineEnd(); |
|
output.areaEnd(); |
|
} |
|
} |
|
if (defined0) { |
|
x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); |
|
output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); |
|
} |
|
} |
|
|
|
if (buffer) return output = null, buffer + "" || null; |
|
} |
|
|
|
function arealine() { |
|
return Object(_line_js__WEBPACK_IMPORTED_MODULE_3__["default"])().defined(defined).curve(curve).context(context); |
|
} |
|
|
|
area.x = function(_) { |
|
return arguments.length ? (x0 = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), x1 = null, area) : x0; |
|
}; |
|
|
|
area.x0 = function(_) { |
|
return arguments.length ? (x0 = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), area) : x0; |
|
}; |
|
|
|
area.x1 = function(_) { |
|
return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), area) : x1; |
|
}; |
|
|
|
area.y = function(_) { |
|
return arguments.length ? (y0 = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), y1 = null, area) : y0; |
|
}; |
|
|
|
area.y0 = function(_) { |
|
return arguments.length ? (y0 = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), area) : y0; |
|
}; |
|
|
|
area.y1 = function(_) { |
|
return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), area) : y1; |
|
}; |
|
|
|
area.lineX0 = |
|
area.lineY0 = function() { |
|
return arealine().x(x0).y(y0); |
|
}; |
|
|
|
area.lineY1 = function() { |
|
return arealine().x(x0).y(y1); |
|
}; |
|
|
|
area.lineX1 = function() { |
|
return arealine().x(x1).y(y0); |
|
}; |
|
|
|
area.defined = function(_) { |
|
return arguments.length ? (defined = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(!!_), area) : defined; |
|
}; |
|
|
|
area.curve = function(_) { |
|
return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; |
|
}; |
|
|
|
area.context = function(_) { |
|
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; |
|
}; |
|
|
|
return area; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/areaRadial.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/areaRadial.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _curve_radial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./curve/radial.js */ "../node_modules/d3-shape/src/curve/radial.js"); |
|
/* harmony import */ var _area_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./area.js */ "../node_modules/d3-shape/src/area.js"); |
|
/* harmony import */ var _lineRadial_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lineRadial.js */ "../node_modules/d3-shape/src/lineRadial.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var a = Object(_area_js__WEBPACK_IMPORTED_MODULE_1__["default"])().curve(_curve_radial_js__WEBPACK_IMPORTED_MODULE_0__["curveRadialLinear"]), |
|
c = a.curve, |
|
x0 = a.lineX0, |
|
x1 = a.lineX1, |
|
y0 = a.lineY0, |
|
y1 = a.lineY1; |
|
|
|
a.angle = a.x, delete a.x; |
|
a.startAngle = a.x0, delete a.x0; |
|
a.endAngle = a.x1, delete a.x1; |
|
a.radius = a.y, delete a.y; |
|
a.innerRadius = a.y0, delete a.y0; |
|
a.outerRadius = a.y1, delete a.y1; |
|
a.lineStartAngle = function() { return Object(_lineRadial_js__WEBPACK_IMPORTED_MODULE_2__["lineRadial"])(x0()); }, delete a.lineX0; |
|
a.lineEndAngle = function() { return Object(_lineRadial_js__WEBPACK_IMPORTED_MODULE_2__["lineRadial"])(x1()); }, delete a.lineX1; |
|
a.lineInnerRadius = function() { return Object(_lineRadial_js__WEBPACK_IMPORTED_MODULE_2__["lineRadial"])(y0()); }, delete a.lineY0; |
|
a.lineOuterRadius = function() { return Object(_lineRadial_js__WEBPACK_IMPORTED_MODULE_2__["lineRadial"])(y1()); }, delete a.lineY1; |
|
|
|
a.curve = function(_) { |
|
return arguments.length ? c(Object(_curve_radial_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_)) : c()._curve; |
|
}; |
|
|
|
return a; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/array.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/array.js ***! |
|
\*********************************************/ |
|
/*! exports provided: slice */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return slice; }); |
|
var slice = Array.prototype.slice; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/constant.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/constant.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function constant() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/basis.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/basis.js ***! |
|
\***************************************************/ |
|
/*! exports provided: point, Basis, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "point", function() { return point; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Basis", function() { return Basis; }); |
|
function point(that, x, y) { |
|
that._context.bezierCurveTo( |
|
(2 * that._x0 + that._x1) / 3, |
|
(2 * that._y0 + that._y1) / 3, |
|
(that._x0 + 2 * that._x1) / 3, |
|
(that._y0 + 2 * that._y1) / 3, |
|
(that._x0 + 4 * that._x1 + x) / 6, |
|
(that._y0 + 4 * that._y1 + y) / 6 |
|
); |
|
} |
|
|
|
function Basis(context) { |
|
this._context = context; |
|
} |
|
|
|
Basis.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = |
|
this._y0 = this._y1 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 3: point(this, this._x1, this._y1); // proceed |
|
case 2: this._context.lineTo(this._x1, this._y1); break; |
|
} |
|
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; |
|
case 1: this._point = 2; break; |
|
case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed |
|
default: point(this, x, y); break; |
|
} |
|
this._x0 = this._x1, this._x1 = x; |
|
this._y0 = this._y1, this._y1 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new Basis(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/basisClosed.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/basisClosed.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-shape/src/noop.js"); |
|
/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./basis.js */ "../node_modules/d3-shape/src/curve/basis.js"); |
|
|
|
|
|
|
|
function BasisClosed(context) { |
|
this._context = context; |
|
} |
|
|
|
BasisClosed.prototype = { |
|
areaStart: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
areaEnd: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = |
|
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 1: { |
|
this._context.moveTo(this._x2, this._y2); |
|
this._context.closePath(); |
|
break; |
|
} |
|
case 2: { |
|
this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); |
|
this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); |
|
this._context.closePath(); |
|
break; |
|
} |
|
case 3: { |
|
this.point(this._x2, this._y2); |
|
this.point(this._x3, this._y3); |
|
this.point(this._x4, this._y4); |
|
break; |
|
} |
|
} |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; this._x2 = x, this._y2 = y; break; |
|
case 1: this._point = 2; this._x3 = x, this._y3 = y; break; |
|
case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break; |
|
default: Object(_basis_js__WEBPACK_IMPORTED_MODULE_1__["point"])(this, x, y); break; |
|
} |
|
this._x0 = this._x1, this._x1 = x; |
|
this._y0 = this._y1, this._y1 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new BasisClosed(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/basisOpen.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/basisOpen.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ "../node_modules/d3-shape/src/curve/basis.js"); |
|
|
|
|
|
function BasisOpen(context) { |
|
this._context = context; |
|
} |
|
|
|
BasisOpen.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = |
|
this._y0 = this._y1 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; break; |
|
case 1: this._point = 2; break; |
|
case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break; |
|
case 3: this._point = 4; // proceed |
|
default: Object(_basis_js__WEBPACK_IMPORTED_MODULE_0__["point"])(this, x, y); break; |
|
} |
|
this._x0 = this._x1, this._x1 = x; |
|
this._y0 = this._y1, this._y1 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new BasisOpen(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/bundle.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/bundle.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ "../node_modules/d3-shape/src/curve/basis.js"); |
|
|
|
|
|
function Bundle(context, beta) { |
|
this._basis = new _basis_js__WEBPACK_IMPORTED_MODULE_0__["Basis"](context); |
|
this._beta = beta; |
|
} |
|
|
|
Bundle.prototype = { |
|
lineStart: function() { |
|
this._x = []; |
|
this._y = []; |
|
this._basis.lineStart(); |
|
}, |
|
lineEnd: function() { |
|
var x = this._x, |
|
y = this._y, |
|
j = x.length - 1; |
|
|
|
if (j > 0) { |
|
var x0 = x[0], |
|
y0 = y[0], |
|
dx = x[j] - x0, |
|
dy = y[j] - y0, |
|
i = -1, |
|
t; |
|
|
|
while (++i <= j) { |
|
t = i / j; |
|
this._basis.point( |
|
this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), |
|
this._beta * y[i] + (1 - this._beta) * (y0 + t * dy) |
|
); |
|
} |
|
} |
|
|
|
this._x = this._y = null; |
|
this._basis.lineEnd(); |
|
}, |
|
point: function(x, y) { |
|
this._x.push(+x); |
|
this._y.push(+y); |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(beta) { |
|
|
|
function bundle(context) { |
|
return beta === 1 ? new _basis_js__WEBPACK_IMPORTED_MODULE_0__["Basis"](context) : new Bundle(context, beta); |
|
} |
|
|
|
bundle.beta = function(beta) { |
|
return custom(+beta); |
|
}; |
|
|
|
return bundle; |
|
})(0.85)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/cardinal.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/cardinal.js ***! |
|
\******************************************************/ |
|
/*! exports provided: point, Cardinal, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "point", function() { return point; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cardinal", function() { return Cardinal; }); |
|
function point(that, x, y) { |
|
that._context.bezierCurveTo( |
|
that._x1 + that._k * (that._x2 - that._x0), |
|
that._y1 + that._k * (that._y2 - that._y0), |
|
that._x2 + that._k * (that._x1 - x), |
|
that._y2 + that._k * (that._y1 - y), |
|
that._x2, |
|
that._y2 |
|
); |
|
} |
|
|
|
function Cardinal(context, tension) { |
|
this._context = context; |
|
this._k = (1 - tension) / 6; |
|
} |
|
|
|
Cardinal.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = |
|
this._y0 = this._y1 = this._y2 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 2: this._context.lineTo(this._x2, this._y2); break; |
|
case 3: point(this, this._x1, this._y1); break; |
|
} |
|
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; |
|
case 1: this._point = 2; this._x1 = x, this._y1 = y; break; |
|
case 2: this._point = 3; // proceed |
|
default: point(this, x, y); break; |
|
} |
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; |
|
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(tension) { |
|
|
|
function cardinal(context) { |
|
return new Cardinal(context, tension); |
|
} |
|
|
|
cardinal.tension = function(tension) { |
|
return custom(+tension); |
|
}; |
|
|
|
return cardinal; |
|
})(0)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/cardinalClosed.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/cardinalClosed.js ***! |
|
\************************************************************/ |
|
/*! exports provided: CardinalClosed, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardinalClosed", function() { return CardinalClosed; }); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-shape/src/noop.js"); |
|
/* harmony import */ var _cardinal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cardinal.js */ "../node_modules/d3-shape/src/curve/cardinal.js"); |
|
|
|
|
|
|
|
function CardinalClosed(context, tension) { |
|
this._context = context; |
|
this._k = (1 - tension) / 6; |
|
} |
|
|
|
CardinalClosed.prototype = { |
|
areaStart: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
areaEnd: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = |
|
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 1: { |
|
this._context.moveTo(this._x3, this._y3); |
|
this._context.closePath(); |
|
break; |
|
} |
|
case 2: { |
|
this._context.lineTo(this._x3, this._y3); |
|
this._context.closePath(); |
|
break; |
|
} |
|
case 3: { |
|
this.point(this._x3, this._y3); |
|
this.point(this._x4, this._y4); |
|
this.point(this._x5, this._y5); |
|
break; |
|
} |
|
} |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; this._x3 = x, this._y3 = y; break; |
|
case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break; |
|
case 2: this._point = 3; this._x5 = x, this._y5 = y; break; |
|
default: Object(_cardinal_js__WEBPACK_IMPORTED_MODULE_1__["point"])(this, x, y); break; |
|
} |
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; |
|
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(tension) { |
|
|
|
function cardinal(context) { |
|
return new CardinalClosed(context, tension); |
|
} |
|
|
|
cardinal.tension = function(tension) { |
|
return custom(+tension); |
|
}; |
|
|
|
return cardinal; |
|
})(0)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/cardinalOpen.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/cardinalOpen.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: CardinalOpen, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardinalOpen", function() { return CardinalOpen; }); |
|
/* harmony import */ var _cardinal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cardinal.js */ "../node_modules/d3-shape/src/curve/cardinal.js"); |
|
|
|
|
|
function CardinalOpen(context, tension) { |
|
this._context = context; |
|
this._k = (1 - tension) / 6; |
|
} |
|
|
|
CardinalOpen.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = |
|
this._y0 = this._y1 = this._y2 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; break; |
|
case 1: this._point = 2; break; |
|
case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; |
|
case 3: this._point = 4; // proceed |
|
default: Object(_cardinal_js__WEBPACK_IMPORTED_MODULE_0__["point"])(this, x, y); break; |
|
} |
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; |
|
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(tension) { |
|
|
|
function cardinal(context) { |
|
return new CardinalOpen(context, tension); |
|
} |
|
|
|
cardinal.tension = function(tension) { |
|
return custom(+tension); |
|
}; |
|
|
|
return cardinal; |
|
})(0)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/catmullRom.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/catmullRom.js ***! |
|
\********************************************************/ |
|
/*! exports provided: point, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "point", function() { return point; }); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-shape/src/math.js"); |
|
/* harmony import */ var _cardinal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cardinal.js */ "../node_modules/d3-shape/src/curve/cardinal.js"); |
|
|
|
|
|
|
|
function point(that, x, y) { |
|
var x1 = that._x1, |
|
y1 = that._y1, |
|
x2 = that._x2, |
|
y2 = that._y2; |
|
|
|
if (that._l01_a > _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) { |
|
var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, |
|
n = 3 * that._l01_a * (that._l01_a + that._l12_a); |
|
x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; |
|
y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; |
|
} |
|
|
|
if (that._l23_a > _math_js__WEBPACK_IMPORTED_MODULE_0__["epsilon"]) { |
|
var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, |
|
m = 3 * that._l23_a * (that._l23_a + that._l12_a); |
|
x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m; |
|
y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m; |
|
} |
|
|
|
that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2); |
|
} |
|
|
|
function CatmullRom(context, alpha) { |
|
this._context = context; |
|
this._alpha = alpha; |
|
} |
|
|
|
CatmullRom.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = |
|
this._y0 = this._y1 = this._y2 = NaN; |
|
this._l01_a = this._l12_a = this._l23_a = |
|
this._l01_2a = this._l12_2a = this._l23_2a = |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 2: this._context.lineTo(this._x2, this._y2); break; |
|
case 3: this.point(this._x2, this._y2); break; |
|
} |
|
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
|
|
if (this._point) { |
|
var x23 = this._x2 - x, |
|
y23 = this._y2 - y; |
|
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); |
|
} |
|
|
|
switch (this._point) { |
|
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; |
|
case 1: this._point = 2; break; |
|
case 2: this._point = 3; // proceed |
|
default: point(this, x, y); break; |
|
} |
|
|
|
this._l01_a = this._l12_a, this._l12_a = this._l23_a; |
|
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; |
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; |
|
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(alpha) { |
|
|
|
function catmullRom(context) { |
|
return alpha ? new CatmullRom(context, alpha) : new _cardinal_js__WEBPACK_IMPORTED_MODULE_1__["Cardinal"](context, 0); |
|
} |
|
|
|
catmullRom.alpha = function(alpha) { |
|
return custom(+alpha); |
|
}; |
|
|
|
return catmullRom; |
|
})(0.5)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/catmullRomClosed.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/catmullRomClosed.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _cardinalClosed_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cardinalClosed.js */ "../node_modules/d3-shape/src/curve/cardinalClosed.js"); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-shape/src/noop.js"); |
|
/* harmony import */ var _catmullRom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./catmullRom.js */ "../node_modules/d3-shape/src/curve/catmullRom.js"); |
|
|
|
|
|
|
|
|
|
function CatmullRomClosed(context, alpha) { |
|
this._context = context; |
|
this._alpha = alpha; |
|
} |
|
|
|
CatmullRomClosed.prototype = { |
|
areaStart: _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
areaEnd: _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = |
|
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; |
|
this._l01_a = this._l12_a = this._l23_a = |
|
this._l01_2a = this._l12_2a = this._l23_2a = |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 1: { |
|
this._context.moveTo(this._x3, this._y3); |
|
this._context.closePath(); |
|
break; |
|
} |
|
case 2: { |
|
this._context.lineTo(this._x3, this._y3); |
|
this._context.closePath(); |
|
break; |
|
} |
|
case 3: { |
|
this.point(this._x3, this._y3); |
|
this.point(this._x4, this._y4); |
|
this.point(this._x5, this._y5); |
|
break; |
|
} |
|
} |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
|
|
if (this._point) { |
|
var x23 = this._x2 - x, |
|
y23 = this._y2 - y; |
|
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); |
|
} |
|
|
|
switch (this._point) { |
|
case 0: this._point = 1; this._x3 = x, this._y3 = y; break; |
|
case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break; |
|
case 2: this._point = 3; this._x5 = x, this._y5 = y; break; |
|
default: Object(_catmullRom_js__WEBPACK_IMPORTED_MODULE_2__["point"])(this, x, y); break; |
|
} |
|
|
|
this._l01_a = this._l12_a, this._l12_a = this._l23_a; |
|
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; |
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; |
|
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(alpha) { |
|
|
|
function catmullRom(context) { |
|
return alpha ? new CatmullRomClosed(context, alpha) : new _cardinalClosed_js__WEBPACK_IMPORTED_MODULE_0__["CardinalClosed"](context, 0); |
|
} |
|
|
|
catmullRom.alpha = function(alpha) { |
|
return custom(+alpha); |
|
}; |
|
|
|
return catmullRom; |
|
})(0.5)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/catmullRomOpen.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/catmullRomOpen.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _cardinalOpen_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cardinalOpen.js */ "../node_modules/d3-shape/src/curve/cardinalOpen.js"); |
|
/* harmony import */ var _catmullRom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./catmullRom.js */ "../node_modules/d3-shape/src/curve/catmullRom.js"); |
|
|
|
|
|
|
|
function CatmullRomOpen(context, alpha) { |
|
this._context = context; |
|
this._alpha = alpha; |
|
} |
|
|
|
CatmullRomOpen.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = this._x2 = |
|
this._y0 = this._y1 = this._y2 = NaN; |
|
this._l01_a = this._l12_a = this._l23_a = |
|
this._l01_2a = this._l12_2a = this._l23_2a = |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
|
|
if (this._point) { |
|
var x23 = this._x2 - x, |
|
y23 = this._y2 - y; |
|
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); |
|
} |
|
|
|
switch (this._point) { |
|
case 0: this._point = 1; break; |
|
case 1: this._point = 2; break; |
|
case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; |
|
case 3: this._point = 4; // proceed |
|
default: Object(_catmullRom_js__WEBPACK_IMPORTED_MODULE_1__["point"])(this, x, y); break; |
|
} |
|
|
|
this._l01_a = this._l12_a, this._l12_a = this._l23_a; |
|
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; |
|
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x; |
|
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ((function custom(alpha) { |
|
|
|
function catmullRom(context) { |
|
return alpha ? new CatmullRomOpen(context, alpha) : new _cardinalOpen_js__WEBPACK_IMPORTED_MODULE_0__["CardinalOpen"](context, 0); |
|
} |
|
|
|
catmullRom.alpha = function(alpha) { |
|
return custom(+alpha); |
|
}; |
|
|
|
return catmullRom; |
|
})(0.5)); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/linear.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/linear.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function Linear(context) { |
|
this._context = context; |
|
} |
|
|
|
Linear.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; |
|
case 1: this._point = 2; // proceed |
|
default: this._context.lineTo(x, y); break; |
|
} |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new Linear(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/linearClosed.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/linearClosed.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../noop.js */ "../node_modules/d3-shape/src/noop.js"); |
|
|
|
|
|
function LinearClosed(context) { |
|
this._context = context; |
|
} |
|
|
|
LinearClosed.prototype = { |
|
areaStart: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
areaEnd: _noop_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
|
lineStart: function() { |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (this._point) this._context.closePath(); |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
if (this._point) this._context.lineTo(x, y); |
|
else this._point = 1, this._context.moveTo(x, y); |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new LinearClosed(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/monotone.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/monotone.js ***! |
|
\******************************************************/ |
|
/*! exports provided: monotoneX, monotoneY */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "monotoneX", function() { return monotoneX; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "monotoneY", function() { return monotoneY; }); |
|
function sign(x) { |
|
return x < 0 ? -1 : 1; |
|
} |
|
|
|
// Calculate the slopes of the tangents (Hermite-type interpolation) based on |
|
// the following paper: Steffen, M. 1990. A Simple Method for Monotonic |
|
// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO. |
|
// NOV(II), P. 443, 1990. |
|
function slope3(that, x2, y2) { |
|
var h0 = that._x1 - that._x0, |
|
h1 = x2 - that._x1, |
|
s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), |
|
s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), |
|
p = (s0 * h1 + s1 * h0) / (h0 + h1); |
|
return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; |
|
} |
|
|
|
// Calculate a one-sided slope. |
|
function slope2(that, t) { |
|
var h = that._x1 - that._x0; |
|
return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; |
|
} |
|
|
|
// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations |
|
// "you can express cubic Hermite interpolation in terms of cubic Bézier curves |
|
// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1". |
|
function point(that, t0, t1) { |
|
var x0 = that._x0, |
|
y0 = that._y0, |
|
x1 = that._x1, |
|
y1 = that._y1, |
|
dx = (x1 - x0) / 3; |
|
that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1); |
|
} |
|
|
|
function MonotoneX(context) { |
|
this._context = context; |
|
} |
|
|
|
MonotoneX.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x0 = this._x1 = |
|
this._y0 = this._y1 = |
|
this._t0 = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
switch (this._point) { |
|
case 2: this._context.lineTo(this._x1, this._y1); break; |
|
case 3: point(this, this._t0, slope2(this, this._t0)); break; |
|
} |
|
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
var t1 = NaN; |
|
|
|
x = +x, y = +y; |
|
if (x === this._x1 && y === this._y1) return; // Ignore coincident points. |
|
switch (this._point) { |
|
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; |
|
case 1: this._point = 2; break; |
|
case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break; |
|
default: point(this, this._t0, t1 = slope3(this, x, y)); break; |
|
} |
|
|
|
this._x0 = this._x1, this._x1 = x; |
|
this._y0 = this._y1, this._y1 = y; |
|
this._t0 = t1; |
|
} |
|
} |
|
|
|
function MonotoneY(context) { |
|
this._context = new ReflectContext(context); |
|
} |
|
|
|
(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) { |
|
MonotoneX.prototype.point.call(this, y, x); |
|
}; |
|
|
|
function ReflectContext(context) { |
|
this._context = context; |
|
} |
|
|
|
ReflectContext.prototype = { |
|
moveTo: function(x, y) { this._context.moveTo(y, x); }, |
|
closePath: function() { this._context.closePath(); }, |
|
lineTo: function(x, y) { this._context.lineTo(y, x); }, |
|
bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); } |
|
}; |
|
|
|
function monotoneX(context) { |
|
return new MonotoneX(context); |
|
} |
|
|
|
function monotoneY(context) { |
|
return new MonotoneY(context); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/natural.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/natural.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function Natural(context) { |
|
this._context = context; |
|
} |
|
|
|
Natural.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x = []; |
|
this._y = []; |
|
}, |
|
lineEnd: function() { |
|
var x = this._x, |
|
y = this._y, |
|
n = x.length; |
|
|
|
if (n) { |
|
this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]); |
|
if (n === 2) { |
|
this._context.lineTo(x[1], y[1]); |
|
} else { |
|
var px = controlPoints(x), |
|
py = controlPoints(y); |
|
for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { |
|
this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]); |
|
} |
|
} |
|
} |
|
|
|
if (this._line || (this._line !== 0 && n === 1)) this._context.closePath(); |
|
this._line = 1 - this._line; |
|
this._x = this._y = null; |
|
}, |
|
point: function(x, y) { |
|
this._x.push(+x); |
|
this._y.push(+y); |
|
} |
|
}; |
|
|
|
// See https://www.particleincell.com/2012/bezier-splines/ for derivation. |
|
function controlPoints(x) { |
|
var i, |
|
n = x.length - 1, |
|
m, |
|
a = new Array(n), |
|
b = new Array(n), |
|
r = new Array(n); |
|
a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1]; |
|
for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1]; |
|
a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n]; |
|
for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1]; |
|
a[n - 1] = r[n - 1] / b[n - 1]; |
|
for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i]; |
|
b[n - 1] = (x[n] + a[n - 1]) / 2; |
|
for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1]; |
|
return [a, b]; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new Natural(context); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/radial.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/radial.js ***! |
|
\****************************************************/ |
|
/*! exports provided: curveRadialLinear, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "curveRadialLinear", function() { return curveRadialLinear; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return curveRadial; }); |
|
/* harmony import */ var _linear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear.js */ "../node_modules/d3-shape/src/curve/linear.js"); |
|
|
|
|
|
var curveRadialLinear = curveRadial(_linear_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
|
|
|
function Radial(curve) { |
|
this._curve = curve; |
|
} |
|
|
|
Radial.prototype = { |
|
areaStart: function() { |
|
this._curve.areaStart(); |
|
}, |
|
areaEnd: function() { |
|
this._curve.areaEnd(); |
|
}, |
|
lineStart: function() { |
|
this._curve.lineStart(); |
|
}, |
|
lineEnd: function() { |
|
this._curve.lineEnd(); |
|
}, |
|
point: function(a, r) { |
|
this._curve.point(r * Math.sin(a), r * -Math.cos(a)); |
|
} |
|
}; |
|
|
|
function curveRadial(curve) { |
|
|
|
function radial(context) { |
|
return new Radial(curve(context)); |
|
} |
|
|
|
radial._curve = curve; |
|
|
|
return radial; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/curve/step.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/curve/step.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default, stepBefore, stepAfter */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stepBefore", function() { return stepBefore; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stepAfter", function() { return stepAfter; }); |
|
function Step(context, t) { |
|
this._context = context; |
|
this._t = t; |
|
} |
|
|
|
Step.prototype = { |
|
areaStart: function() { |
|
this._line = 0; |
|
}, |
|
areaEnd: function() { |
|
this._line = NaN; |
|
}, |
|
lineStart: function() { |
|
this._x = this._y = NaN; |
|
this._point = 0; |
|
}, |
|
lineEnd: function() { |
|
if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); |
|
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath(); |
|
if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; |
|
}, |
|
point: function(x, y) { |
|
x = +x, y = +y; |
|
switch (this._point) { |
|
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break; |
|
case 1: this._point = 2; // proceed |
|
default: { |
|
if (this._t <= 0) { |
|
this._context.lineTo(this._x, y); |
|
this._context.lineTo(x, y); |
|
} else { |
|
var x1 = this._x * (1 - this._t) + x * this._t; |
|
this._context.lineTo(x1, this._y); |
|
this._context.lineTo(x1, y); |
|
} |
|
break; |
|
} |
|
} |
|
this._x = x, this._y = y; |
|
} |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(context) { |
|
return new Step(context, 0.5); |
|
}); |
|
|
|
function stepBefore(context) { |
|
return new Step(context, 0); |
|
} |
|
|
|
function stepAfter(context) { |
|
return new Step(context, 1); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/descending.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/descending.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/identity.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/identity.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(d) { |
|
return d; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: arc, area, line, pie, areaRadial, radialArea, lineRadial, radialLine, pointRadial, linkHorizontal, linkVertical, linkRadial, symbol, symbols, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye, curveBasisClosed, curveBasisOpen, curveBasis, curveBundle, curveCardinalClosed, curveCardinalOpen, curveCardinal, curveCatmullRomClosed, curveCatmullRomOpen, curveCatmullRom, curveLinearClosed, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, stack, stackOffsetExpand, stackOffsetDiverging, stackOffsetNone, stackOffsetSilhouette, stackOffsetWiggle, stackOrderAppearance, stackOrderAscending, stackOrderDescending, stackOrderInsideOut, stackOrderNone, stackOrderReverse */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _arc_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arc.js */ "../node_modules/d3-shape/src/arc.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "arc", function() { return _arc_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _area_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./area.js */ "../node_modules/d3-shape/src/area.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "area", function() { return _area_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _line_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./line.js */ "../node_modules/d3-shape/src/line.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "line", function() { return _line_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _pie_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pie.js */ "../node_modules/d3-shape/src/pie.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pie", function() { return _pie_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony import */ var _areaRadial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./areaRadial.js */ "../node_modules/d3-shape/src/areaRadial.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "areaRadial", function() { return _areaRadial_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "radialArea", function() { return _areaRadial_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony import */ var _lineRadial_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lineRadial.js */ "../node_modules/d3-shape/src/lineRadial.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lineRadial", function() { return _lineRadial_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "radialLine", function() { return _lineRadial_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony import */ var _pointRadial_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pointRadial.js */ "../node_modules/d3-shape/src/pointRadial.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pointRadial", function() { return _pointRadial_js__WEBPACK_IMPORTED_MODULE_6__["default"]; }); |
|
|
|
/* harmony import */ var _link_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./link/index.js */ "../node_modules/d3-shape/src/link/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "linkHorizontal", function() { return _link_index_js__WEBPACK_IMPORTED_MODULE_7__["linkHorizontal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "linkVertical", function() { return _link_index_js__WEBPACK_IMPORTED_MODULE_7__["linkVertical"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "linkRadial", function() { return _link_index_js__WEBPACK_IMPORTED_MODULE_7__["linkRadial"]; }); |
|
|
|
/* harmony import */ var _symbol_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./symbol.js */ "../node_modules/d3-shape/src/symbol.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbol", function() { return _symbol_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbols", function() { return _symbol_js__WEBPACK_IMPORTED_MODULE_8__["symbols"]; }); |
|
|
|
/* harmony import */ var _symbol_circle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./symbol/circle.js */ "../node_modules/d3-shape/src/symbol/circle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolCircle", function() { return _symbol_circle_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony import */ var _symbol_cross_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./symbol/cross.js */ "../node_modules/d3-shape/src/symbol/cross.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolCross", function() { return _symbol_cross_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony import */ var _symbol_diamond_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./symbol/diamond.js */ "../node_modules/d3-shape/src/symbol/diamond.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolDiamond", function() { return _symbol_diamond_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony import */ var _symbol_square_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./symbol/square.js */ "../node_modules/d3-shape/src/symbol/square.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolSquare", function() { return _symbol_square_js__WEBPACK_IMPORTED_MODULE_12__["default"]; }); |
|
|
|
/* harmony import */ var _symbol_star_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./symbol/star.js */ "../node_modules/d3-shape/src/symbol/star.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolStar", function() { return _symbol_star_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony import */ var _symbol_triangle_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./symbol/triangle.js */ "../node_modules/d3-shape/src/symbol/triangle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolTriangle", function() { return _symbol_triangle_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony import */ var _symbol_wye_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./symbol/wye.js */ "../node_modules/d3-shape/src/symbol/wye.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolWye", function() { return _symbol_wye_js__WEBPACK_IMPORTED_MODULE_15__["default"]; }); |
|
|
|
/* harmony import */ var _curve_basisClosed_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./curve/basisClosed.js */ "../node_modules/d3-shape/src/curve/basisClosed.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBasisClosed", function() { return _curve_basisClosed_js__WEBPACK_IMPORTED_MODULE_16__["default"]; }); |
|
|
|
/* harmony import */ var _curve_basisOpen_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./curve/basisOpen.js */ "../node_modules/d3-shape/src/curve/basisOpen.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBasisOpen", function() { return _curve_basisOpen_js__WEBPACK_IMPORTED_MODULE_17__["default"]; }); |
|
|
|
/* harmony import */ var _curve_basis_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./curve/basis.js */ "../node_modules/d3-shape/src/curve/basis.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBasis", function() { return _curve_basis_js__WEBPACK_IMPORTED_MODULE_18__["default"]; }); |
|
|
|
/* harmony import */ var _curve_bundle_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./curve/bundle.js */ "../node_modules/d3-shape/src/curve/bundle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBundle", function() { return _curve_bundle_js__WEBPACK_IMPORTED_MODULE_19__["default"]; }); |
|
|
|
/* harmony import */ var _curve_cardinalClosed_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./curve/cardinalClosed.js */ "../node_modules/d3-shape/src/curve/cardinalClosed.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCardinalClosed", function() { return _curve_cardinalClosed_js__WEBPACK_IMPORTED_MODULE_20__["default"]; }); |
|
|
|
/* harmony import */ var _curve_cardinalOpen_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./curve/cardinalOpen.js */ "../node_modules/d3-shape/src/curve/cardinalOpen.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCardinalOpen", function() { return _curve_cardinalOpen_js__WEBPACK_IMPORTED_MODULE_21__["default"]; }); |
|
|
|
/* harmony import */ var _curve_cardinal_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./curve/cardinal.js */ "../node_modules/d3-shape/src/curve/cardinal.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCardinal", function() { return _curve_cardinal_js__WEBPACK_IMPORTED_MODULE_22__["default"]; }); |
|
|
|
/* harmony import */ var _curve_catmullRomClosed_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./curve/catmullRomClosed.js */ "../node_modules/d3-shape/src/curve/catmullRomClosed.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCatmullRomClosed", function() { return _curve_catmullRomClosed_js__WEBPACK_IMPORTED_MODULE_23__["default"]; }); |
|
|
|
/* harmony import */ var _curve_catmullRomOpen_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./curve/catmullRomOpen.js */ "../node_modules/d3-shape/src/curve/catmullRomOpen.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCatmullRomOpen", function() { return _curve_catmullRomOpen_js__WEBPACK_IMPORTED_MODULE_24__["default"]; }); |
|
|
|
/* harmony import */ var _curve_catmullRom_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./curve/catmullRom.js */ "../node_modules/d3-shape/src/curve/catmullRom.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCatmullRom", function() { return _curve_catmullRom_js__WEBPACK_IMPORTED_MODULE_25__["default"]; }); |
|
|
|
/* harmony import */ var _curve_linearClosed_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./curve/linearClosed.js */ "../node_modules/d3-shape/src/curve/linearClosed.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveLinearClosed", function() { return _curve_linearClosed_js__WEBPACK_IMPORTED_MODULE_26__["default"]; }); |
|
|
|
/* harmony import */ var _curve_linear_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./curve/linear.js */ "../node_modules/d3-shape/src/curve/linear.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveLinear", function() { return _curve_linear_js__WEBPACK_IMPORTED_MODULE_27__["default"]; }); |
|
|
|
/* harmony import */ var _curve_monotone_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./curve/monotone.js */ "../node_modules/d3-shape/src/curve/monotone.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveMonotoneX", function() { return _curve_monotone_js__WEBPACK_IMPORTED_MODULE_28__["monotoneX"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveMonotoneY", function() { return _curve_monotone_js__WEBPACK_IMPORTED_MODULE_28__["monotoneY"]; }); |
|
|
|
/* harmony import */ var _curve_natural_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./curve/natural.js */ "../node_modules/d3-shape/src/curve/natural.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveNatural", function() { return _curve_natural_js__WEBPACK_IMPORTED_MODULE_29__["default"]; }); |
|
|
|
/* harmony import */ var _curve_step_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./curve/step.js */ "../node_modules/d3-shape/src/curve/step.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveStep", function() { return _curve_step_js__WEBPACK_IMPORTED_MODULE_30__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveStepAfter", function() { return _curve_step_js__WEBPACK_IMPORTED_MODULE_30__["stepAfter"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveStepBefore", function() { return _curve_step_js__WEBPACK_IMPORTED_MODULE_30__["stepBefore"]; }); |
|
|
|
/* harmony import */ var _stack_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./stack.js */ "../node_modules/d3-shape/src/stack.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stack", function() { return _stack_js__WEBPACK_IMPORTED_MODULE_31__["default"]; }); |
|
|
|
/* harmony import */ var _offset_expand_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./offset/expand.js */ "../node_modules/d3-shape/src/offset/expand.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetExpand", function() { return _offset_expand_js__WEBPACK_IMPORTED_MODULE_32__["default"]; }); |
|
|
|
/* harmony import */ var _offset_diverging_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./offset/diverging.js */ "../node_modules/d3-shape/src/offset/diverging.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetDiverging", function() { return _offset_diverging_js__WEBPACK_IMPORTED_MODULE_33__["default"]; }); |
|
|
|
/* harmony import */ var _offset_none_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./offset/none.js */ "../node_modules/d3-shape/src/offset/none.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetNone", function() { return _offset_none_js__WEBPACK_IMPORTED_MODULE_34__["default"]; }); |
|
|
|
/* harmony import */ var _offset_silhouette_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./offset/silhouette.js */ "../node_modules/d3-shape/src/offset/silhouette.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetSilhouette", function() { return _offset_silhouette_js__WEBPACK_IMPORTED_MODULE_35__["default"]; }); |
|
|
|
/* harmony import */ var _offset_wiggle_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./offset/wiggle.js */ "../node_modules/d3-shape/src/offset/wiggle.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetWiggle", function() { return _offset_wiggle_js__WEBPACK_IMPORTED_MODULE_36__["default"]; }); |
|
|
|
/* harmony import */ var _order_appearance_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./order/appearance.js */ "../node_modules/d3-shape/src/order/appearance.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderAppearance", function() { return _order_appearance_js__WEBPACK_IMPORTED_MODULE_37__["default"]; }); |
|
|
|
/* harmony import */ var _order_ascending_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./order/ascending.js */ "../node_modules/d3-shape/src/order/ascending.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderAscending", function() { return _order_ascending_js__WEBPACK_IMPORTED_MODULE_38__["default"]; }); |
|
|
|
/* harmony import */ var _order_descending_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./order/descending.js */ "../node_modules/d3-shape/src/order/descending.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderDescending", function() { return _order_descending_js__WEBPACK_IMPORTED_MODULE_39__["default"]; }); |
|
|
|
/* harmony import */ var _order_insideOut_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./order/insideOut.js */ "../node_modules/d3-shape/src/order/insideOut.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderInsideOut", function() { return _order_insideOut_js__WEBPACK_IMPORTED_MODULE_40__["default"]; }); |
|
|
|
/* harmony import */ var _order_none_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./order/none.js */ "../node_modules/d3-shape/src/order/none.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderNone", function() { return _order_none_js__WEBPACK_IMPORTED_MODULE_41__["default"]; }); |
|
|
|
/* harmony import */ var _order_reverse_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./order/reverse.js */ "../node_modules/d3-shape/src/order/reverse.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderReverse", function() { return _order_reverse_js__WEBPACK_IMPORTED_MODULE_42__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
// Note: radialArea is deprecated! |
|
// Note: radialLine is deprecated! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/line.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/line.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
/* harmony import */ var _curve_linear_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./curve/linear.js */ "../node_modules/d3-shape/src/curve/linear.js"); |
|
/* harmony import */ var _point_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./point.js */ "../node_modules/d3-shape/src/point.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var x = _point_js__WEBPACK_IMPORTED_MODULE_3__["x"], |
|
y = _point_js__WEBPACK_IMPORTED_MODULE_3__["y"], |
|
defined = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(true), |
|
context = null, |
|
curve = _curve_linear_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
output = null; |
|
|
|
function line(data) { |
|
var i, |
|
n = data.length, |
|
d, |
|
defined0 = false, |
|
buffer; |
|
|
|
if (context == null) output = curve(buffer = Object(d3_path__WEBPACK_IMPORTED_MODULE_0__["path"])()); |
|
|
|
for (i = 0; i <= n; ++i) { |
|
if (!(i < n && defined(d = data[i], i, data)) === defined0) { |
|
if (defined0 = !defined0) output.lineStart(); |
|
else output.lineEnd(); |
|
} |
|
if (defined0) output.point(+x(d, i, data), +y(d, i, data)); |
|
} |
|
|
|
if (buffer) return output = null, buffer + "" || null; |
|
} |
|
|
|
line.x = function(_) { |
|
return arguments.length ? (x = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), line) : x; |
|
}; |
|
|
|
line.y = function(_) { |
|
return arguments.length ? (y = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), line) : y; |
|
}; |
|
|
|
line.defined = function(_) { |
|
return arguments.length ? (defined = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(!!_), line) : defined; |
|
}; |
|
|
|
line.curve = function(_) { |
|
return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; |
|
}; |
|
|
|
line.context = function(_) { |
|
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; |
|
}; |
|
|
|
return line; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/lineRadial.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/lineRadial.js ***! |
|
\**************************************************/ |
|
/*! exports provided: lineRadial, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineRadial", function() { return lineRadial; }); |
|
/* harmony import */ var _curve_radial_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./curve/radial.js */ "../node_modules/d3-shape/src/curve/radial.js"); |
|
/* harmony import */ var _line_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./line.js */ "../node_modules/d3-shape/src/line.js"); |
|
|
|
|
|
|
|
function lineRadial(l) { |
|
var c = l.curve; |
|
|
|
l.angle = l.x, delete l.x; |
|
l.radius = l.y, delete l.y; |
|
|
|
l.curve = function(_) { |
|
return arguments.length ? c(Object(_curve_radial_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_)) : c()._curve; |
|
}; |
|
|
|
return l; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return lineRadial(Object(_line_js__WEBPACK_IMPORTED_MODULE_1__["default"])().curve(_curve_radial_js__WEBPACK_IMPORTED_MODULE_0__["curveRadialLinear"])); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/link/index.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/link/index.js ***! |
|
\**************************************************/ |
|
/*! exports provided: linkHorizontal, linkVertical, linkRadial */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkHorizontal", function() { return linkHorizontal; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkVertical", function() { return linkVertical; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkRadial", function() { return linkRadial; }); |
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../array.js */ "../node_modules/d3-shape/src/array.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
/* harmony import */ var _point_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../point.js */ "../node_modules/d3-shape/src/point.js"); |
|
/* harmony import */ var _pointRadial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../pointRadial.js */ "../node_modules/d3-shape/src/pointRadial.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
function linkSource(d) { |
|
return d.source; |
|
} |
|
|
|
function linkTarget(d) { |
|
return d.target; |
|
} |
|
|
|
function link(curve) { |
|
var source = linkSource, |
|
target = linkTarget, |
|
x = _point_js__WEBPACK_IMPORTED_MODULE_3__["x"], |
|
y = _point_js__WEBPACK_IMPORTED_MODULE_3__["y"], |
|
context = null; |
|
|
|
function link() { |
|
var buffer, argv = _array_js__WEBPACK_IMPORTED_MODULE_1__["slice"].call(arguments), s = source.apply(this, argv), t = target.apply(this, argv); |
|
if (!context) context = buffer = Object(d3_path__WEBPACK_IMPORTED_MODULE_0__["path"])(); |
|
curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv)); |
|
if (buffer) return context = null, buffer + "" || null; |
|
} |
|
|
|
link.source = function(_) { |
|
return arguments.length ? (source = _, link) : source; |
|
}; |
|
|
|
link.target = function(_) { |
|
return arguments.length ? (target = _, link) : target; |
|
}; |
|
|
|
link.x = function(_) { |
|
return arguments.length ? (x = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+_), link) : x; |
|
}; |
|
|
|
link.y = function(_) { |
|
return arguments.length ? (y = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+_), link) : y; |
|
}; |
|
|
|
link.context = function(_) { |
|
return arguments.length ? ((context = _ == null ? null : _), link) : context; |
|
}; |
|
|
|
return link; |
|
} |
|
|
|
function curveHorizontal(context, x0, y0, x1, y1) { |
|
context.moveTo(x0, y0); |
|
context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1); |
|
} |
|
|
|
function curveVertical(context, x0, y0, x1, y1) { |
|
context.moveTo(x0, y0); |
|
context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1); |
|
} |
|
|
|
function curveRadial(context, x0, y0, x1, y1) { |
|
var p0 = Object(_pointRadial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(x0, y0), |
|
p1 = Object(_pointRadial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(x0, y0 = (y0 + y1) / 2), |
|
p2 = Object(_pointRadial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(x1, y0), |
|
p3 = Object(_pointRadial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(x1, y1); |
|
context.moveTo(p0[0], p0[1]); |
|
context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]); |
|
} |
|
|
|
function linkHorizontal() { |
|
return link(curveHorizontal); |
|
} |
|
|
|
function linkVertical() { |
|
return link(curveVertical); |
|
} |
|
|
|
function linkRadial() { |
|
var l = link(curveRadial); |
|
l.angle = l.x, delete l.x; |
|
l.radius = l.y, delete l.y; |
|
return l; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/math.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/math.js ***! |
|
\********************************************/ |
|
/*! exports provided: abs, atan2, cos, max, min, sin, sqrt, epsilon, pi, halfPi, tau, acos, asin */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "abs", function() { return abs; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan2", function() { return atan2; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return cos; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return sin; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrt", function() { return sqrt; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epsilon", function() { return epsilon; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pi", function() { return pi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "halfPi", function() { return halfPi; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tau", function() { return tau; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return acos; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return asin; }); |
|
var abs = Math.abs; |
|
var atan2 = Math.atan2; |
|
var cos = Math.cos; |
|
var max = Math.max; |
|
var min = Math.min; |
|
var sin = Math.sin; |
|
var sqrt = Math.sqrt; |
|
|
|
var epsilon = 1e-12; |
|
var pi = Math.PI; |
|
var halfPi = pi / 2; |
|
var tau = 2 * pi; |
|
|
|
function acos(x) { |
|
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x); |
|
} |
|
|
|
function asin(x) { |
|
return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/noop.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/noop.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function() {}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/offset/diverging.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/offset/diverging.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(series, order) { |
|
if (!((n = series.length) > 0)) return; |
|
for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) { |
|
for (yp = yn = 0, i = 0; i < n; ++i) { |
|
if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) { |
|
d[0] = yp, d[1] = yp += dy; |
|
} else if (dy < 0) { |
|
d[1] = yn, d[0] = yn += dy; |
|
} else { |
|
d[0] = 0, d[1] = dy; |
|
} |
|
} |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/offset/expand.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/offset/expand.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _none_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./none.js */ "../node_modules/d3-shape/src/offset/none.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series, order) { |
|
if (!((n = series.length) > 0)) return; |
|
for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) { |
|
for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0; |
|
if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y; |
|
} |
|
Object(_none_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series, order); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/offset/none.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/offset/none.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(series, order) { |
|
if (!((n = series.length) > 1)) return; |
|
for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) { |
|
s0 = s1, s1 = series[order[i]]; |
|
for (j = 0; j < m; ++j) { |
|
s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1]; |
|
} |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/offset/silhouette.js": |
|
/*!*********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/offset/silhouette.js ***! |
|
\*********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _none_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./none.js */ "../node_modules/d3-shape/src/offset/none.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series, order) { |
|
if (!((n = series.length) > 0)) return; |
|
for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) { |
|
for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0; |
|
s0[j][1] += s0[j][0] = -y / 2; |
|
} |
|
Object(_none_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series, order); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/offset/wiggle.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/offset/wiggle.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _none_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./none.js */ "../node_modules/d3-shape/src/offset/none.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series, order) { |
|
if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return; |
|
for (var y = 0, j = 1, s0, m, n; j < m; ++j) { |
|
for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) { |
|
var si = series[order[i]], |
|
sij0 = si[j][1] || 0, |
|
sij1 = si[j - 1][1] || 0, |
|
s3 = (sij0 - sij1) / 2; |
|
for (var k = 0; k < i; ++k) { |
|
var sk = series[order[k]], |
|
skj0 = sk[j][1] || 0, |
|
skj1 = sk[j - 1][1] || 0; |
|
s3 += skj0 - skj1; |
|
} |
|
s1 += sij0, s2 += s3 * sij0; |
|
} |
|
s0[j - 1][1] += s0[j - 1][0] = y; |
|
if (s1) y -= s2 / s1; |
|
} |
|
s0[j - 1][1] += s0[j - 1][0] = y; |
|
Object(_none_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series, order); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/order/appearance.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/order/appearance.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _none_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./none.js */ "../node_modules/d3-shape/src/order/none.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series) { |
|
var peaks = series.map(peak); |
|
return Object(_none_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series).sort(function(a, b) { return peaks[a] - peaks[b]; }); |
|
}); |
|
|
|
function peak(series) { |
|
var i = -1, j = 0, n = series.length, vi, vj = -Infinity; |
|
while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i; |
|
return j; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/order/ascending.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/order/ascending.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default, sum */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return sum; }); |
|
/* harmony import */ var _none_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./none.js */ "../node_modules/d3-shape/src/order/none.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series) { |
|
var sums = series.map(sum); |
|
return Object(_none_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series).sort(function(a, b) { return sums[a] - sums[b]; }); |
|
}); |
|
|
|
function sum(series) { |
|
var s = 0, i = -1, n = series.length, v; |
|
while (++i < n) if (v = +series[i][1]) s += v; |
|
return s; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/order/descending.js": |
|
/*!********************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/order/descending.js ***! |
|
\********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _ascending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ascending.js */ "../node_modules/d3-shape/src/order/ascending.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series) { |
|
return Object(_ascending_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series).reverse(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/order/insideOut.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/order/insideOut.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _appearance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./appearance.js */ "../node_modules/d3-shape/src/order/appearance.js"); |
|
/* harmony import */ var _ascending_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ascending.js */ "../node_modules/d3-shape/src/order/ascending.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series) { |
|
var n = series.length, |
|
i, |
|
j, |
|
sums = series.map(_ascending_js__WEBPACK_IMPORTED_MODULE_1__["sum"]), |
|
order = Object(_appearance_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series), |
|
top = 0, |
|
bottom = 0, |
|
tops = [], |
|
bottoms = []; |
|
|
|
for (i = 0; i < n; ++i) { |
|
j = order[i]; |
|
if (top < bottom) { |
|
top += sums[j]; |
|
tops.push(j); |
|
} else { |
|
bottom += sums[j]; |
|
bottoms.push(j); |
|
} |
|
} |
|
|
|
return bottoms.reverse().concat(tops); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/order/none.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/order/none.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(series) { |
|
var n = series.length, o = new Array(n); |
|
while (--n >= 0) o[n] = n; |
|
return o; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/order/reverse.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/order/reverse.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _none_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./none.js */ "../node_modules/d3-shape/src/order/none.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(series) { |
|
return Object(_none_js__WEBPACK_IMPORTED_MODULE_0__["default"])(series).reverse(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/pie.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-shape/src/pie.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
/* harmony import */ var _descending_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./descending.js */ "../node_modules/d3-shape/src/descending.js"); |
|
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "../node_modules/d3-shape/src/identity.js"); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./math.js */ "../node_modules/d3-shape/src/math.js"); |
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var value = _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
sortValues = _descending_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
sort = null, |
|
startAngle = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(0), |
|
endAngle = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_math_js__WEBPACK_IMPORTED_MODULE_3__["tau"]), |
|
padAngle = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(0); |
|
|
|
function pie(data) { |
|
var i, |
|
n = data.length, |
|
j, |
|
k, |
|
sum = 0, |
|
index = new Array(n), |
|
arcs = new Array(n), |
|
a0 = +startAngle.apply(this, arguments), |
|
da = Math.min(_math_js__WEBPACK_IMPORTED_MODULE_3__["tau"], Math.max(-_math_js__WEBPACK_IMPORTED_MODULE_3__["tau"], endAngle.apply(this, arguments) - a0)), |
|
a1, |
|
p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), |
|
pa = p * (da < 0 ? -1 : 1), |
|
v; |
|
|
|
for (i = 0; i < n; ++i) { |
|
if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) { |
|
sum += v; |
|
} |
|
} |
|
|
|
// Optionally sort the arcs by previously-computed values or by data. |
|
if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); }); |
|
else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); }); |
|
|
|
// Compute the arcs! They are stored in the original data's order. |
|
for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) { |
|
j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = { |
|
data: data[j], |
|
index: i, |
|
value: v, |
|
startAngle: a0, |
|
endAngle: a1, |
|
padAngle: p |
|
}; |
|
} |
|
|
|
return arcs; |
|
} |
|
|
|
pie.value = function(_) { |
|
return arguments.length ? (value = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), pie) : value; |
|
}; |
|
|
|
pie.sortValues = function(_) { |
|
return arguments.length ? (sortValues = _, sort = null, pie) : sortValues; |
|
}; |
|
|
|
pie.sort = function(_) { |
|
return arguments.length ? (sort = _, sortValues = null, pie) : sort; |
|
}; |
|
|
|
pie.startAngle = function(_) { |
|
return arguments.length ? (startAngle = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), pie) : startAngle; |
|
}; |
|
|
|
pie.endAngle = function(_) { |
|
return arguments.length ? (endAngle = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), pie) : endAngle; |
|
}; |
|
|
|
pie.padAngle = function(_) { |
|
return arguments.length ? (padAngle = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), pie) : padAngle; |
|
}; |
|
|
|
return pie; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/point.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/point.js ***! |
|
\*********************************************/ |
|
/*! exports provided: x, y */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return x; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return y; }); |
|
function x(p) { |
|
return p[0]; |
|
} |
|
|
|
function y(p) { |
|
return p[1]; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/pointRadial.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/pointRadial.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x, y) { |
|
return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)]; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/stack.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/stack.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ "../node_modules/d3-shape/src/array.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
/* harmony import */ var _offset_none_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./offset/none.js */ "../node_modules/d3-shape/src/offset/none.js"); |
|
/* harmony import */ var _order_none_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./order/none.js */ "../node_modules/d3-shape/src/order/none.js"); |
|
|
|
|
|
|
|
|
|
|
|
function stackValue(d, key) { |
|
return d[key]; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var keys = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])([]), |
|
order = _order_none_js__WEBPACK_IMPORTED_MODULE_3__["default"], |
|
offset = _offset_none_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
value = stackValue; |
|
|
|
function stack(data) { |
|
var kz = keys.apply(this, arguments), |
|
i, |
|
m = data.length, |
|
n = kz.length, |
|
sz = new Array(n), |
|
oz; |
|
|
|
for (i = 0; i < n; ++i) { |
|
for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) { |
|
si[j] = sij = [0, +value(data[j], ki, j, data)]; |
|
sij.data = data[j]; |
|
} |
|
si.key = ki; |
|
} |
|
|
|
for (i = 0, oz = order(sz); i < n; ++i) { |
|
sz[oz[i]].index = i; |
|
} |
|
|
|
offset(sz, oz); |
|
return sz; |
|
} |
|
|
|
stack.keys = function(_) { |
|
return arguments.length ? (keys = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_array_js__WEBPACK_IMPORTED_MODULE_0__["slice"].call(_)), stack) : keys; |
|
}; |
|
|
|
stack.value = function(_) { |
|
return arguments.length ? (value = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(+_), stack) : value; |
|
}; |
|
|
|
stack.order = function(_) { |
|
return arguments.length ? (order = _ == null ? _order_none_js__WEBPACK_IMPORTED_MODULE_3__["default"] : typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_array_js__WEBPACK_IMPORTED_MODULE_0__["slice"].call(_)), stack) : order; |
|
}; |
|
|
|
stack.offset = function(_) { |
|
return arguments.length ? (offset = _ == null ? _offset_none_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _, stack) : offset; |
|
}; |
|
|
|
return stack; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol.js ***! |
|
\**********************************************/ |
|
/*! exports provided: symbols, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "symbols", function() { return symbols; }); |
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
/* harmony import */ var _symbol_circle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./symbol/circle.js */ "../node_modules/d3-shape/src/symbol/circle.js"); |
|
/* harmony import */ var _symbol_cross_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./symbol/cross.js */ "../node_modules/d3-shape/src/symbol/cross.js"); |
|
/* harmony import */ var _symbol_diamond_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./symbol/diamond.js */ "../node_modules/d3-shape/src/symbol/diamond.js"); |
|
/* harmony import */ var _symbol_star_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./symbol/star.js */ "../node_modules/d3-shape/src/symbol/star.js"); |
|
/* harmony import */ var _symbol_square_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./symbol/square.js */ "../node_modules/d3-shape/src/symbol/square.js"); |
|
/* harmony import */ var _symbol_triangle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./symbol/triangle.js */ "../node_modules/d3-shape/src/symbol/triangle.js"); |
|
/* harmony import */ var _symbol_wye_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./symbol/wye.js */ "../node_modules/d3-shape/src/symbol/wye.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-shape/src/constant.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var symbols = [ |
|
_symbol_circle_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
_symbol_cross_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
_symbol_diamond_js__WEBPACK_IMPORTED_MODULE_3__["default"], |
|
_symbol_square_js__WEBPACK_IMPORTED_MODULE_5__["default"], |
|
_symbol_star_js__WEBPACK_IMPORTED_MODULE_4__["default"], |
|
_symbol_triangle_js__WEBPACK_IMPORTED_MODULE_6__["default"], |
|
_symbol_wye_js__WEBPACK_IMPORTED_MODULE_7__["default"] |
|
]; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var type = Object(_constant_js__WEBPACK_IMPORTED_MODULE_8__["default"])(_symbol_circle_js__WEBPACK_IMPORTED_MODULE_1__["default"]), |
|
size = Object(_constant_js__WEBPACK_IMPORTED_MODULE_8__["default"])(64), |
|
context = null; |
|
|
|
function symbol() { |
|
var buffer; |
|
if (!context) context = buffer = Object(d3_path__WEBPACK_IMPORTED_MODULE_0__["path"])(); |
|
type.apply(this, arguments).draw(context, +size.apply(this, arguments)); |
|
if (buffer) return context = null, buffer + "" || null; |
|
} |
|
|
|
symbol.type = function(_) { |
|
return arguments.length ? (type = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_8__["default"])(_), symbol) : type; |
|
}; |
|
|
|
symbol.size = function(_) { |
|
return arguments.length ? (size = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_8__["default"])(+_), symbol) : size; |
|
}; |
|
|
|
symbol.context = function(_) { |
|
return arguments.length ? (context = _ == null ? null : _, symbol) : context; |
|
}; |
|
|
|
return symbol; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/circle.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/circle.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-shape/src/math.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var r = Math.sqrt(size / _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"]); |
|
context.moveTo(r, 0); |
|
context.arc(0, 0, r, 0, _math_js__WEBPACK_IMPORTED_MODULE_0__["tau"]); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/cross.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/cross.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var r = Math.sqrt(size / 5) / 2; |
|
context.moveTo(-3 * r, -r); |
|
context.lineTo(-r, -r); |
|
context.lineTo(-r, -3 * r); |
|
context.lineTo(r, -3 * r); |
|
context.lineTo(r, -r); |
|
context.lineTo(3 * r, -r); |
|
context.lineTo(3 * r, r); |
|
context.lineTo(r, r); |
|
context.lineTo(r, 3 * r); |
|
context.lineTo(-r, 3 * r); |
|
context.lineTo(-r, r); |
|
context.lineTo(-3 * r, r); |
|
context.closePath(); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/diamond.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/diamond.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var tan30 = Math.sqrt(1 / 3), |
|
tan30_2 = tan30 * 2; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var y = Math.sqrt(size / tan30_2), |
|
x = y * tan30; |
|
context.moveTo(0, -y); |
|
context.lineTo(x, 0); |
|
context.lineTo(0, y); |
|
context.lineTo(-x, 0); |
|
context.closePath(); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/square.js": |
|
/*!*****************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/square.js ***! |
|
\*****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var w = Math.sqrt(size), |
|
x = -w / 2; |
|
context.rect(x, x, w, w); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/star.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/star.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math.js */ "../node_modules/d3-shape/src/math.js"); |
|
|
|
|
|
var ka = 0.89081309152928522810, |
|
kr = Math.sin(_math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] / 10) / Math.sin(7 * _math_js__WEBPACK_IMPORTED_MODULE_0__["pi"] / 10), |
|
kx = Math.sin(_math_js__WEBPACK_IMPORTED_MODULE_0__["tau"] / 10) * kr, |
|
ky = -Math.cos(_math_js__WEBPACK_IMPORTED_MODULE_0__["tau"] / 10) * kr; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var r = Math.sqrt(size * ka), |
|
x = kx * r, |
|
y = ky * r; |
|
context.moveTo(0, -r); |
|
context.lineTo(x, y); |
|
for (var i = 1; i < 5; ++i) { |
|
var a = _math_js__WEBPACK_IMPORTED_MODULE_0__["tau"] * i / 5, |
|
c = Math.cos(a), |
|
s = Math.sin(a); |
|
context.lineTo(s * r, -c * r); |
|
context.lineTo(c * x - s * y, s * x + c * y); |
|
} |
|
context.closePath(); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/triangle.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/triangle.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var sqrt3 = Math.sqrt(3); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var y = -Math.sqrt(size / (sqrt3 * 3)); |
|
context.moveTo(0, y * 2); |
|
context.lineTo(-sqrt3 * y, -y); |
|
context.lineTo(sqrt3 * y, -y); |
|
context.closePath(); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-shape/src/symbol/wye.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-shape/src/symbol/wye.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
var c = -0.5, |
|
s = Math.sqrt(3) / 2, |
|
k = 1 / Math.sqrt(12), |
|
a = (k / 2 + 1) * 3; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = ({ |
|
draw: function(context, size) { |
|
var r = Math.sqrt(size / a), |
|
x0 = r / 2, |
|
y0 = r * k, |
|
x1 = x0, |
|
y1 = r * k + r, |
|
x2 = -x1, |
|
y2 = y1; |
|
context.moveTo(x0, y0); |
|
context.lineTo(x1, y1); |
|
context.lineTo(x2, y2); |
|
context.lineTo(c * x0 - s * y0, s * x0 + c * y0); |
|
context.lineTo(c * x1 - s * y1, s * x1 + c * y1); |
|
context.lineTo(c * x2 - s * y2, s * x2 + c * y2); |
|
context.lineTo(c * x0 + s * y0, c * y0 - s * x0); |
|
context.lineTo(c * x1 + s * y1, c * y1 - s * x1); |
|
context.lineTo(c * x2 + s * y2, c * y2 - s * x2); |
|
context.closePath(); |
|
} |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time-format/src/defaultLocale.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-time-format/src/defaultLocale.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: timeFormat, timeParse, utcFormat, utcParse, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeFormat", function() { return timeFormat; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeParse", function() { return timeParse; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcFormat", function() { return utcFormat; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcParse", function() { return utcParse; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return defaultLocale; }); |
|
/* harmony import */ var _locale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./locale.js */ "../node_modules/d3-time-format/src/locale.js"); |
|
|
|
|
|
var locale; |
|
var timeFormat; |
|
var timeParse; |
|
var utcFormat; |
|
var utcParse; |
|
|
|
defaultLocale({ |
|
dateTime: "%x, %X", |
|
date: "%-m/%-d/%Y", |
|
time: "%-I:%M:%S %p", |
|
periods: ["AM", "PM"], |
|
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], |
|
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], |
|
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], |
|
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] |
|
}); |
|
|
|
function defaultLocale(definition) { |
|
locale = Object(_locale_js__WEBPACK_IMPORTED_MODULE_0__["default"])(definition); |
|
timeFormat = locale.format; |
|
timeParse = locale.parse; |
|
utcFormat = locale.utcFormat; |
|
utcParse = locale.utcParse; |
|
return locale; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time-format/src/index.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-time-format/src/index.js ***! |
|
\***************************************************/ |
|
/*! exports provided: timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse, timeFormatLocale, isoFormat, isoParse */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultLocale.js */ "../node_modules/d3-time-format/src/defaultLocale.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFormatDefaultLocale", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFormat", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["timeFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeParse", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["timeParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcFormat", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["utcFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcParse", function() { return _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["utcParse"]; }); |
|
|
|
/* harmony import */ var _locale_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./locale.js */ "../node_modules/d3-time-format/src/locale.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFormatLocale", function() { return _locale_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _isoFormat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isoFormat.js */ "../node_modules/d3-time-format/src/isoFormat.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isoFormat", function() { return _isoFormat_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _isoParse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isoParse.js */ "../node_modules/d3-time-format/src/isoParse.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isoParse", function() { return _isoParse_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time-format/src/isoFormat.js": |
|
/*!*******************************************************!*\ |
|
!*** ../node_modules/d3-time-format/src/isoFormat.js ***! |
|
\*******************************************************/ |
|
/*! exports provided: isoSpecifier, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isoSpecifier", function() { return isoSpecifier; }); |
|
/* harmony import */ var _defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultLocale.js */ "../node_modules/d3-time-format/src/defaultLocale.js"); |
|
|
|
|
|
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ"; |
|
|
|
function formatIsoNative(date) { |
|
return date.toISOString(); |
|
} |
|
|
|
var formatIso = Date.prototype.toISOString |
|
? formatIsoNative |
|
: Object(_defaultLocale_js__WEBPACK_IMPORTED_MODULE_0__["utcFormat"])(isoSpecifier); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (formatIso); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time-format/src/isoParse.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-time-format/src/isoParse.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _isoFormat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isoFormat.js */ "../node_modules/d3-time-format/src/isoFormat.js"); |
|
/* harmony import */ var _defaultLocale_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./defaultLocale.js */ "../node_modules/d3-time-format/src/defaultLocale.js"); |
|
|
|
|
|
|
|
function parseIsoNative(string) { |
|
var date = new Date(string); |
|
return isNaN(date) ? null : date; |
|
} |
|
|
|
var parseIso = +new Date("2000-01-01T00:00:00.000Z") |
|
? parseIsoNative |
|
: Object(_defaultLocale_js__WEBPACK_IMPORTED_MODULE_1__["utcParse"])(_isoFormat_js__WEBPACK_IMPORTED_MODULE_0__["isoSpecifier"]); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (parseIso); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time-format/src/locale.js": |
|
/*!****************************************************!*\ |
|
!*** ../node_modules/d3-time-format/src/locale.js ***! |
|
\****************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return formatLocale; }); |
|
/* harmony import */ var d3_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-time */ "../node_modules/d3-time/src/index.js"); |
|
|
|
|
|
function localDate(d) { |
|
if (0 <= d.y && d.y < 100) { |
|
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); |
|
date.setFullYear(d.y); |
|
return date; |
|
} |
|
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); |
|
} |
|
|
|
function utcDate(d) { |
|
if (0 <= d.y && d.y < 100) { |
|
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); |
|
date.setUTCFullYear(d.y); |
|
return date; |
|
} |
|
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); |
|
} |
|
|
|
function newDate(y, m, d) { |
|
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0}; |
|
} |
|
|
|
function formatLocale(locale) { |
|
var locale_dateTime = locale.dateTime, |
|
locale_date = locale.date, |
|
locale_time = locale.time, |
|
locale_periods = locale.periods, |
|
locale_weekdays = locale.days, |
|
locale_shortWeekdays = locale.shortDays, |
|
locale_months = locale.months, |
|
locale_shortMonths = locale.shortMonths; |
|
|
|
var periodRe = formatRe(locale_periods), |
|
periodLookup = formatLookup(locale_periods), |
|
weekdayRe = formatRe(locale_weekdays), |
|
weekdayLookup = formatLookup(locale_weekdays), |
|
shortWeekdayRe = formatRe(locale_shortWeekdays), |
|
shortWeekdayLookup = formatLookup(locale_shortWeekdays), |
|
monthRe = formatRe(locale_months), |
|
monthLookup = formatLookup(locale_months), |
|
shortMonthRe = formatRe(locale_shortMonths), |
|
shortMonthLookup = formatLookup(locale_shortMonths); |
|
|
|
var formats = { |
|
"a": formatShortWeekday, |
|
"A": formatWeekday, |
|
"b": formatShortMonth, |
|
"B": formatMonth, |
|
"c": null, |
|
"d": formatDayOfMonth, |
|
"e": formatDayOfMonth, |
|
"f": formatMicroseconds, |
|
"g": formatYearISO, |
|
"G": formatFullYearISO, |
|
"H": formatHour24, |
|
"I": formatHour12, |
|
"j": formatDayOfYear, |
|
"L": formatMilliseconds, |
|
"m": formatMonthNumber, |
|
"M": formatMinutes, |
|
"p": formatPeriod, |
|
"q": formatQuarter, |
|
"Q": formatUnixTimestamp, |
|
"s": formatUnixTimestampSeconds, |
|
"S": formatSeconds, |
|
"u": formatWeekdayNumberMonday, |
|
"U": formatWeekNumberSunday, |
|
"V": formatWeekNumberISO, |
|
"w": formatWeekdayNumberSunday, |
|
"W": formatWeekNumberMonday, |
|
"x": null, |
|
"X": null, |
|
"y": formatYear, |
|
"Y": formatFullYear, |
|
"Z": formatZone, |
|
"%": formatLiteralPercent |
|
}; |
|
|
|
var utcFormats = { |
|
"a": formatUTCShortWeekday, |
|
"A": formatUTCWeekday, |
|
"b": formatUTCShortMonth, |
|
"B": formatUTCMonth, |
|
"c": null, |
|
"d": formatUTCDayOfMonth, |
|
"e": formatUTCDayOfMonth, |
|
"f": formatUTCMicroseconds, |
|
"g": formatUTCYearISO, |
|
"G": formatUTCFullYearISO, |
|
"H": formatUTCHour24, |
|
"I": formatUTCHour12, |
|
"j": formatUTCDayOfYear, |
|
"L": formatUTCMilliseconds, |
|
"m": formatUTCMonthNumber, |
|
"M": formatUTCMinutes, |
|
"p": formatUTCPeriod, |
|
"q": formatUTCQuarter, |
|
"Q": formatUnixTimestamp, |
|
"s": formatUnixTimestampSeconds, |
|
"S": formatUTCSeconds, |
|
"u": formatUTCWeekdayNumberMonday, |
|
"U": formatUTCWeekNumberSunday, |
|
"V": formatUTCWeekNumberISO, |
|
"w": formatUTCWeekdayNumberSunday, |
|
"W": formatUTCWeekNumberMonday, |
|
"x": null, |
|
"X": null, |
|
"y": formatUTCYear, |
|
"Y": formatUTCFullYear, |
|
"Z": formatUTCZone, |
|
"%": formatLiteralPercent |
|
}; |
|
|
|
var parses = { |
|
"a": parseShortWeekday, |
|
"A": parseWeekday, |
|
"b": parseShortMonth, |
|
"B": parseMonth, |
|
"c": parseLocaleDateTime, |
|
"d": parseDayOfMonth, |
|
"e": parseDayOfMonth, |
|
"f": parseMicroseconds, |
|
"g": parseYear, |
|
"G": parseFullYear, |
|
"H": parseHour24, |
|
"I": parseHour24, |
|
"j": parseDayOfYear, |
|
"L": parseMilliseconds, |
|
"m": parseMonthNumber, |
|
"M": parseMinutes, |
|
"p": parsePeriod, |
|
"q": parseQuarter, |
|
"Q": parseUnixTimestamp, |
|
"s": parseUnixTimestampSeconds, |
|
"S": parseSeconds, |
|
"u": parseWeekdayNumberMonday, |
|
"U": parseWeekNumberSunday, |
|
"V": parseWeekNumberISO, |
|
"w": parseWeekdayNumberSunday, |
|
"W": parseWeekNumberMonday, |
|
"x": parseLocaleDate, |
|
"X": parseLocaleTime, |
|
"y": parseYear, |
|
"Y": parseFullYear, |
|
"Z": parseZone, |
|
"%": parseLiteralPercent |
|
}; |
|
|
|
// These recursive directive definitions must be deferred. |
|
formats.x = newFormat(locale_date, formats); |
|
formats.X = newFormat(locale_time, formats); |
|
formats.c = newFormat(locale_dateTime, formats); |
|
utcFormats.x = newFormat(locale_date, utcFormats); |
|
utcFormats.X = newFormat(locale_time, utcFormats); |
|
utcFormats.c = newFormat(locale_dateTime, utcFormats); |
|
|
|
function newFormat(specifier, formats) { |
|
return function(date) { |
|
var string = [], |
|
i = -1, |
|
j = 0, |
|
n = specifier.length, |
|
c, |
|
pad, |
|
format; |
|
|
|
if (!(date instanceof Date)) date = new Date(+date); |
|
|
|
while (++i < n) { |
|
if (specifier.charCodeAt(i) === 37) { |
|
string.push(specifier.slice(j, i)); |
|
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i); |
|
else pad = c === "e" ? " " : "0"; |
|
if (format = formats[c]) c = format(date, pad); |
|
string.push(c); |
|
j = i + 1; |
|
} |
|
} |
|
|
|
string.push(specifier.slice(j, i)); |
|
return string.join(""); |
|
}; |
|
} |
|
|
|
function newParse(specifier, Z) { |
|
return function(string) { |
|
var d = newDate(1900, undefined, 1), |
|
i = parseSpecifier(d, specifier, string += "", 0), |
|
week, day; |
|
if (i != string.length) return null; |
|
|
|
// If a UNIX timestamp is specified, return it. |
|
if ("Q" in d) return new Date(d.Q); |
|
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0)); |
|
|
|
// If this is utcParse, never use the local timezone. |
|
if (Z && !("Z" in d)) d.Z = 0; |
|
|
|
// The am-pm flag is 0 for AM, and 1 for PM. |
|
if ("p" in d) d.H = d.H % 12 + d.p * 12; |
|
|
|
// If the month was not specified, inherit from the quarter. |
|
if (d.m === undefined) d.m = "q" in d ? d.q : 0; |
|
|
|
// Convert day-of-week and week-of-year to day-of-year. |
|
if ("V" in d) { |
|
if (d.V < 1 || d.V > 53) return null; |
|
if (!("w" in d)) d.w = 1; |
|
if ("Z" in d) { |
|
week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); |
|
week = day > 4 || day === 0 ? d3_time__WEBPACK_IMPORTED_MODULE_0__["utcMonday"].ceil(week) : Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcMonday"])(week); |
|
week = d3_time__WEBPACK_IMPORTED_MODULE_0__["utcDay"].offset(week, (d.V - 1) * 7); |
|
d.y = week.getUTCFullYear(); |
|
d.m = week.getUTCMonth(); |
|
d.d = week.getUTCDate() + (d.w + 6) % 7; |
|
} else { |
|
week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); |
|
week = day > 4 || day === 0 ? d3_time__WEBPACK_IMPORTED_MODULE_0__["timeMonday"].ceil(week) : Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeMonday"])(week); |
|
week = d3_time__WEBPACK_IMPORTED_MODULE_0__["timeDay"].offset(week, (d.V - 1) * 7); |
|
d.y = week.getFullYear(); |
|
d.m = week.getMonth(); |
|
d.d = week.getDate() + (d.w + 6) % 7; |
|
} |
|
} else if ("W" in d || "U" in d) { |
|
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; |
|
day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); |
|
d.m = 0; |
|
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; |
|
} |
|
|
|
// If a time zone is specified, all fields are interpreted as UTC and then |
|
// offset according to the specified time zone. |
|
if ("Z" in d) { |
|
d.H += d.Z / 100 | 0; |
|
d.M += d.Z % 100; |
|
return utcDate(d); |
|
} |
|
|
|
// Otherwise, all fields are in local time. |
|
return localDate(d); |
|
}; |
|
} |
|
|
|
function parseSpecifier(d, specifier, string, j) { |
|
var i = 0, |
|
n = specifier.length, |
|
m = string.length, |
|
c, |
|
parse; |
|
|
|
while (i < n) { |
|
if (j >= m) return -1; |
|
c = specifier.charCodeAt(i++); |
|
if (c === 37) { |
|
c = specifier.charAt(i++); |
|
parse = parses[c in pads ? specifier.charAt(i++) : c]; |
|
if (!parse || ((j = parse(d, string, j)) < 0)) return -1; |
|
} else if (c != string.charCodeAt(j++)) { |
|
return -1; |
|
} |
|
} |
|
|
|
return j; |
|
} |
|
|
|
function parsePeriod(d, string, i) { |
|
var n = periodRe.exec(string.slice(i)); |
|
return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1; |
|
} |
|
|
|
function parseShortWeekday(d, string, i) { |
|
var n = shortWeekdayRe.exec(string.slice(i)); |
|
return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; |
|
} |
|
|
|
function parseWeekday(d, string, i) { |
|
var n = weekdayRe.exec(string.slice(i)); |
|
return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1; |
|
} |
|
|
|
function parseShortMonth(d, string, i) { |
|
var n = shortMonthRe.exec(string.slice(i)); |
|
return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1; |
|
} |
|
|
|
function parseMonth(d, string, i) { |
|
var n = monthRe.exec(string.slice(i)); |
|
return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1; |
|
} |
|
|
|
function parseLocaleDateTime(d, string, i) { |
|
return parseSpecifier(d, locale_dateTime, string, i); |
|
} |
|
|
|
function parseLocaleDate(d, string, i) { |
|
return parseSpecifier(d, locale_date, string, i); |
|
} |
|
|
|
function parseLocaleTime(d, string, i) { |
|
return parseSpecifier(d, locale_time, string, i); |
|
} |
|
|
|
function formatShortWeekday(d) { |
|
return locale_shortWeekdays[d.getDay()]; |
|
} |
|
|
|
function formatWeekday(d) { |
|
return locale_weekdays[d.getDay()]; |
|
} |
|
|
|
function formatShortMonth(d) { |
|
return locale_shortMonths[d.getMonth()]; |
|
} |
|
|
|
function formatMonth(d) { |
|
return locale_months[d.getMonth()]; |
|
} |
|
|
|
function formatPeriod(d) { |
|
return locale_periods[+(d.getHours() >= 12)]; |
|
} |
|
|
|
function formatQuarter(d) { |
|
return 1 + ~~(d.getMonth() / 3); |
|
} |
|
|
|
function formatUTCShortWeekday(d) { |
|
return locale_shortWeekdays[d.getUTCDay()]; |
|
} |
|
|
|
function formatUTCWeekday(d) { |
|
return locale_weekdays[d.getUTCDay()]; |
|
} |
|
|
|
function formatUTCShortMonth(d) { |
|
return locale_shortMonths[d.getUTCMonth()]; |
|
} |
|
|
|
function formatUTCMonth(d) { |
|
return locale_months[d.getUTCMonth()]; |
|
} |
|
|
|
function formatUTCPeriod(d) { |
|
return locale_periods[+(d.getUTCHours() >= 12)]; |
|
} |
|
|
|
function formatUTCQuarter(d) { |
|
return 1 + ~~(d.getUTCMonth() / 3); |
|
} |
|
|
|
return { |
|
format: function(specifier) { |
|
var f = newFormat(specifier += "", formats); |
|
f.toString = function() { return specifier; }; |
|
return f; |
|
}, |
|
parse: function(specifier) { |
|
var p = newParse(specifier += "", false); |
|
p.toString = function() { return specifier; }; |
|
return p; |
|
}, |
|
utcFormat: function(specifier) { |
|
var f = newFormat(specifier += "", utcFormats); |
|
f.toString = function() { return specifier; }; |
|
return f; |
|
}, |
|
utcParse: function(specifier) { |
|
var p = newParse(specifier += "", true); |
|
p.toString = function() { return specifier; }; |
|
return p; |
|
} |
|
}; |
|
} |
|
|
|
var pads = {"-": "", "_": " ", "0": "0"}, |
|
numberRe = /^\s*\d+/, // note: ignores next directive |
|
percentRe = /^%/, |
|
requoteRe = /[\\^$*+?|[\]().{}]/g; |
|
|
|
function pad(value, fill, width) { |
|
var sign = value < 0 ? "-" : "", |
|
string = (sign ? -value : value) + "", |
|
length = string.length; |
|
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); |
|
} |
|
|
|
function requote(s) { |
|
return s.replace(requoteRe, "\\$&"); |
|
} |
|
|
|
function formatRe(names) { |
|
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); |
|
} |
|
|
|
function formatLookup(names) { |
|
var map = {}, i = -1, n = names.length; |
|
while (++i < n) map[names[i].toLowerCase()] = i; |
|
return map; |
|
} |
|
|
|
function parseWeekdayNumberSunday(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 1)); |
|
return n ? (d.w = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseWeekdayNumberMonday(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 1)); |
|
return n ? (d.u = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseWeekNumberSunday(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.U = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseWeekNumberISO(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.V = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseWeekNumberMonday(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.W = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseFullYear(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 4)); |
|
return n ? (d.y = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseYear(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1; |
|
} |
|
|
|
function parseZone(d, string, i) { |
|
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6)); |
|
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; |
|
} |
|
|
|
function parseQuarter(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 1)); |
|
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; |
|
} |
|
|
|
function parseMonthNumber(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.m = n[0] - 1, i + n[0].length) : -1; |
|
} |
|
|
|
function parseDayOfMonth(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.d = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseDayOfYear(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 3)); |
|
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseHour24(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.H = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseMinutes(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.M = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseSeconds(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 2)); |
|
return n ? (d.S = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseMilliseconds(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 3)); |
|
return n ? (d.L = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseMicroseconds(d, string, i) { |
|
var n = numberRe.exec(string.slice(i, i + 6)); |
|
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1; |
|
} |
|
|
|
function parseLiteralPercent(d, string, i) { |
|
var n = percentRe.exec(string.slice(i, i + 1)); |
|
return n ? i + n[0].length : -1; |
|
} |
|
|
|
function parseUnixTimestamp(d, string, i) { |
|
var n = numberRe.exec(string.slice(i)); |
|
return n ? (d.Q = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function parseUnixTimestampSeconds(d, string, i) { |
|
var n = numberRe.exec(string.slice(i)); |
|
return n ? (d.s = +n[0], i + n[0].length) : -1; |
|
} |
|
|
|
function formatDayOfMonth(d, p) { |
|
return pad(d.getDate(), p, 2); |
|
} |
|
|
|
function formatHour24(d, p) { |
|
return pad(d.getHours(), p, 2); |
|
} |
|
|
|
function formatHour12(d, p) { |
|
return pad(d.getHours() % 12 || 12, p, 2); |
|
} |
|
|
|
function formatDayOfYear(d, p) { |
|
return pad(1 + d3_time__WEBPACK_IMPORTED_MODULE_0__["timeDay"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeYear"])(d), d), p, 3); |
|
} |
|
|
|
function formatMilliseconds(d, p) { |
|
return pad(d.getMilliseconds(), p, 3); |
|
} |
|
|
|
function formatMicroseconds(d, p) { |
|
return formatMilliseconds(d, p) + "000"; |
|
} |
|
|
|
function formatMonthNumber(d, p) { |
|
return pad(d.getMonth() + 1, p, 2); |
|
} |
|
|
|
function formatMinutes(d, p) { |
|
return pad(d.getMinutes(), p, 2); |
|
} |
|
|
|
function formatSeconds(d, p) { |
|
return pad(d.getSeconds(), p, 2); |
|
} |
|
|
|
function formatWeekdayNumberMonday(d) { |
|
var day = d.getDay(); |
|
return day === 0 ? 7 : day; |
|
} |
|
|
|
function formatWeekNumberSunday(d, p) { |
|
return pad(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeSunday"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeYear"])(d) - 1, d), p, 2); |
|
} |
|
|
|
function dISO(d) { |
|
var day = d.getDay(); |
|
return (day >= 4 || day === 0) ? Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeThursday"])(d) : d3_time__WEBPACK_IMPORTED_MODULE_0__["timeThursday"].ceil(d); |
|
} |
|
|
|
function formatWeekNumberISO(d, p) { |
|
d = dISO(d); |
|
return pad(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeThursday"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeYear"])(d), d) + (Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeYear"])(d).getDay() === 4), p, 2); |
|
} |
|
|
|
function formatWeekdayNumberSunday(d) { |
|
return d.getDay(); |
|
} |
|
|
|
function formatWeekNumberMonday(d, p) { |
|
return pad(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeMonday"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeYear"])(d) - 1, d), p, 2); |
|
} |
|
|
|
function formatYear(d, p) { |
|
return pad(d.getFullYear() % 100, p, 2); |
|
} |
|
|
|
function formatYearISO(d, p) { |
|
d = dISO(d); |
|
return pad(d.getFullYear() % 100, p, 2); |
|
} |
|
|
|
function formatFullYear(d, p) { |
|
return pad(d.getFullYear() % 10000, p, 4); |
|
} |
|
|
|
function formatFullYearISO(d, p) { |
|
var day = d.getDay(); |
|
d = (day >= 4 || day === 0) ? Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["timeThursday"])(d) : d3_time__WEBPACK_IMPORTED_MODULE_0__["timeThursday"].ceil(d); |
|
return pad(d.getFullYear() % 10000, p, 4); |
|
} |
|
|
|
function formatZone(d) { |
|
var z = d.getTimezoneOffset(); |
|
return (z > 0 ? "-" : (z *= -1, "+")) |
|
+ pad(z / 60 | 0, "0", 2) |
|
+ pad(z % 60, "0", 2); |
|
} |
|
|
|
function formatUTCDayOfMonth(d, p) { |
|
return pad(d.getUTCDate(), p, 2); |
|
} |
|
|
|
function formatUTCHour24(d, p) { |
|
return pad(d.getUTCHours(), p, 2); |
|
} |
|
|
|
function formatUTCHour12(d, p) { |
|
return pad(d.getUTCHours() % 12 || 12, p, 2); |
|
} |
|
|
|
function formatUTCDayOfYear(d, p) { |
|
return pad(1 + d3_time__WEBPACK_IMPORTED_MODULE_0__["utcDay"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcYear"])(d), d), p, 3); |
|
} |
|
|
|
function formatUTCMilliseconds(d, p) { |
|
return pad(d.getUTCMilliseconds(), p, 3); |
|
} |
|
|
|
function formatUTCMicroseconds(d, p) { |
|
return formatUTCMilliseconds(d, p) + "000"; |
|
} |
|
|
|
function formatUTCMonthNumber(d, p) { |
|
return pad(d.getUTCMonth() + 1, p, 2); |
|
} |
|
|
|
function formatUTCMinutes(d, p) { |
|
return pad(d.getUTCMinutes(), p, 2); |
|
} |
|
|
|
function formatUTCSeconds(d, p) { |
|
return pad(d.getUTCSeconds(), p, 2); |
|
} |
|
|
|
function formatUTCWeekdayNumberMonday(d) { |
|
var dow = d.getUTCDay(); |
|
return dow === 0 ? 7 : dow; |
|
} |
|
|
|
function formatUTCWeekNumberSunday(d, p) { |
|
return pad(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcSunday"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcYear"])(d) - 1, d), p, 2); |
|
} |
|
|
|
function UTCdISO(d) { |
|
var day = d.getUTCDay(); |
|
return (day >= 4 || day === 0) ? Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcThursday"])(d) : d3_time__WEBPACK_IMPORTED_MODULE_0__["utcThursday"].ceil(d); |
|
} |
|
|
|
function formatUTCWeekNumberISO(d, p) { |
|
d = UTCdISO(d); |
|
return pad(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcThursday"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcYear"])(d), d) + (Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcYear"])(d).getUTCDay() === 4), p, 2); |
|
} |
|
|
|
function formatUTCWeekdayNumberSunday(d) { |
|
return d.getUTCDay(); |
|
} |
|
|
|
function formatUTCWeekNumberMonday(d, p) { |
|
return pad(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcMonday"].count(Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcYear"])(d) - 1, d), p, 2); |
|
} |
|
|
|
function formatUTCYear(d, p) { |
|
return pad(d.getUTCFullYear() % 100, p, 2); |
|
} |
|
|
|
function formatUTCYearISO(d, p) { |
|
d = UTCdISO(d); |
|
return pad(d.getUTCFullYear() % 100, p, 2); |
|
} |
|
|
|
function formatUTCFullYear(d, p) { |
|
return pad(d.getUTCFullYear() % 10000, p, 4); |
|
} |
|
|
|
function formatUTCFullYearISO(d, p) { |
|
var day = d.getUTCDay(); |
|
d = (day >= 4 || day === 0) ? Object(d3_time__WEBPACK_IMPORTED_MODULE_0__["utcThursday"])(d) : d3_time__WEBPACK_IMPORTED_MODULE_0__["utcThursday"].ceil(d); |
|
return pad(d.getUTCFullYear() % 10000, p, 4); |
|
} |
|
|
|
function formatUTCZone() { |
|
return "+0000"; |
|
} |
|
|
|
function formatLiteralPercent() { |
|
return "%"; |
|
} |
|
|
|
function formatUnixTimestamp(d) { |
|
return +d; |
|
} |
|
|
|
function formatUnixTimestampSeconds(d) { |
|
return Math.floor(+d / 1000); |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/day.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3-time/src/day.js ***! |
|
\******************************************/ |
|
/*! exports provided: default, days */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "days", function() { return days; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var day = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setDate(date.getDate() + step); |
|
}, function(start, end) { |
|
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationDay"]; |
|
}, function(date) { |
|
return date.getDate() - 1; |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (day); |
|
var days = day.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/duration.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-time/src/duration.js ***! |
|
\***********************************************/ |
|
/*! exports provided: durationSecond, durationMinute, durationHour, durationDay, durationWeek */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "durationSecond", function() { return durationSecond; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "durationMinute", function() { return durationMinute; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "durationHour", function() { return durationHour; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "durationDay", function() { return durationDay; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "durationWeek", function() { return durationWeek; }); |
|
var durationSecond = 1e3; |
|
var durationMinute = 6e4; |
|
var durationHour = 36e5; |
|
var durationDay = 864e5; |
|
var durationWeek = 6048e5; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/hour.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-time/src/hour.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default, hours */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hours", function() { return hours; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var hour = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setTime(date - date.getMilliseconds() - date.getSeconds() * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationSecond"] - date.getMinutes() * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]); |
|
}, function(date, step) { |
|
date.setTime(+date + step * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationHour"]); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationHour"]; |
|
}, function(date) { |
|
return date.getHours(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (hour); |
|
var hours = hour.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/index.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-time/src/index.js ***! |
|
\********************************************/ |
|
/*! exports provided: timeInterval, timeMillisecond, timeMilliseconds, utcMillisecond, utcMilliseconds, timeSecond, timeSeconds, utcSecond, utcSeconds, timeMinute, timeMinutes, timeHour, timeHours, timeDay, timeDays, timeWeek, timeWeeks, timeSunday, timeSundays, timeMonday, timeMondays, timeTuesday, timeTuesdays, timeWednesday, timeWednesdays, timeThursday, timeThursdays, timeFriday, timeFridays, timeSaturday, timeSaturdays, timeMonth, timeMonths, timeYear, timeYears, utcMinute, utcMinutes, utcHour, utcHours, utcDay, utcDays, utcWeek, utcWeeks, utcSunday, utcSundays, utcMonday, utcMondays, utcTuesday, utcTuesdays, utcWednesday, utcWednesdays, utcThursday, utcThursdays, utcFriday, utcFridays, utcSaturday, utcSaturdays, utcMonth, utcMonths, utcYear, utcYears */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _interval_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _millisecond_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./millisecond.js */ "../node_modules/d3-time/src/millisecond.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMillisecond", function() { return _millisecond_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMilliseconds", function() { return _millisecond_js__WEBPACK_IMPORTED_MODULE_1__["milliseconds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMillisecond", function() { return _millisecond_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMilliseconds", function() { return _millisecond_js__WEBPACK_IMPORTED_MODULE_1__["milliseconds"]; }); |
|
|
|
/* harmony import */ var _second_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./second.js */ "../node_modules/d3-time/src/second.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSecond", function() { return _second_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSeconds", function() { return _second_js__WEBPACK_IMPORTED_MODULE_2__["seconds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSecond", function() { return _second_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSeconds", function() { return _second_js__WEBPACK_IMPORTED_MODULE_2__["seconds"]; }); |
|
|
|
/* harmony import */ var _minute_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./minute.js */ "../node_modules/d3-time/src/minute.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMinute", function() { return _minute_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMinutes", function() { return _minute_js__WEBPACK_IMPORTED_MODULE_3__["minutes"]; }); |
|
|
|
/* harmony import */ var _hour_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hour.js */ "../node_modules/d3-time/src/hour.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeHour", function() { return _hour_js__WEBPACK_IMPORTED_MODULE_4__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeHours", function() { return _hour_js__WEBPACK_IMPORTED_MODULE_4__["hours"]; }); |
|
|
|
/* harmony import */ var _day_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./day.js */ "../node_modules/d3-time/src/day.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeDay", function() { return _day_js__WEBPACK_IMPORTED_MODULE_5__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeDays", function() { return _day_js__WEBPACK_IMPORTED_MODULE_5__["days"]; }); |
|
|
|
/* harmony import */ var _week_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./week.js */ "../node_modules/d3-time/src/week.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWeek", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["sunday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWeeks", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["sundays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSunday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["sunday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSundays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["sundays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMonday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["monday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMondays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["mondays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeTuesday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["tuesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeTuesdays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["tuesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWednesday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["wednesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWednesdays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["wednesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeThursday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["thursday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeThursdays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["thursdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFriday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["friday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFridays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["fridays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSaturday", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["saturday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSaturdays", function() { return _week_js__WEBPACK_IMPORTED_MODULE_6__["saturdays"]; }); |
|
|
|
/* harmony import */ var _month_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./month.js */ "../node_modules/d3-time/src/month.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMonth", function() { return _month_js__WEBPACK_IMPORTED_MODULE_7__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMonths", function() { return _month_js__WEBPACK_IMPORTED_MODULE_7__["months"]; }); |
|
|
|
/* harmony import */ var _year_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./year.js */ "../node_modules/d3-time/src/year.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeYear", function() { return _year_js__WEBPACK_IMPORTED_MODULE_8__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeYears", function() { return _year_js__WEBPACK_IMPORTED_MODULE_8__["years"]; }); |
|
|
|
/* harmony import */ var _utcMinute_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utcMinute.js */ "../node_modules/d3-time/src/utcMinute.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMinute", function() { return _utcMinute_js__WEBPACK_IMPORTED_MODULE_9__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMinutes", function() { return _utcMinute_js__WEBPACK_IMPORTED_MODULE_9__["utcMinutes"]; }); |
|
|
|
/* harmony import */ var _utcHour_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utcHour.js */ "../node_modules/d3-time/src/utcHour.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcHour", function() { return _utcHour_js__WEBPACK_IMPORTED_MODULE_10__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcHours", function() { return _utcHour_js__WEBPACK_IMPORTED_MODULE_10__["utcHours"]; }); |
|
|
|
/* harmony import */ var _utcDay_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utcDay.js */ "../node_modules/d3-time/src/utcDay.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcDay", function() { return _utcDay_js__WEBPACK_IMPORTED_MODULE_11__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcDays", function() { return _utcDay_js__WEBPACK_IMPORTED_MODULE_11__["utcDays"]; }); |
|
|
|
/* harmony import */ var _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utcWeek.js */ "../node_modules/d3-time/src/utcWeek.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWeek", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcSunday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWeeks", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcSundays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSunday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcSunday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSundays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcSundays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMonday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcMonday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMondays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcMondays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcTuesday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcTuesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcTuesdays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcTuesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWednesday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcWednesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWednesdays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcWednesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcThursday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcThursday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcThursdays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcThursdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcFriday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcFriday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcFridays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcFridays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSaturday", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcSaturday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSaturdays", function() { return _utcWeek_js__WEBPACK_IMPORTED_MODULE_12__["utcSaturdays"]; }); |
|
|
|
/* harmony import */ var _utcMonth_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utcMonth.js */ "../node_modules/d3-time/src/utcMonth.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMonth", function() { return _utcMonth_js__WEBPACK_IMPORTED_MODULE_13__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMonths", function() { return _utcMonth_js__WEBPACK_IMPORTED_MODULE_13__["utcMonths"]; }); |
|
|
|
/* harmony import */ var _utcYear_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utcYear.js */ "../node_modules/d3-time/src/utcYear.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcYear", function() { return _utcYear_js__WEBPACK_IMPORTED_MODULE_14__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcYears", function() { return _utcYear_js__WEBPACK_IMPORTED_MODULE_14__["utcYears"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/interval.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-time/src/interval.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return newInterval; }); |
|
var t0 = new Date, |
|
t1 = new Date; |
|
|
|
function newInterval(floori, offseti, count, field) { |
|
|
|
function interval(date) { |
|
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date; |
|
} |
|
|
|
interval.floor = function(date) { |
|
return floori(date = new Date(+date)), date; |
|
}; |
|
|
|
interval.ceil = function(date) { |
|
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date; |
|
}; |
|
|
|
interval.round = function(date) { |
|
var d0 = interval(date), |
|
d1 = interval.ceil(date); |
|
return date - d0 < d1 - date ? d0 : d1; |
|
}; |
|
|
|
interval.offset = function(date, step) { |
|
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date; |
|
}; |
|
|
|
interval.range = function(start, stop, step) { |
|
var range = [], previous; |
|
start = interval.ceil(start); |
|
step = step == null ? 1 : Math.floor(step); |
|
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date |
|
do range.push(previous = new Date(+start)), offseti(start, step), floori(start); |
|
while (previous < start && start < stop); |
|
return range; |
|
}; |
|
|
|
interval.filter = function(test) { |
|
return newInterval(function(date) { |
|
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1); |
|
}, function(date, step) { |
|
if (date >= date) { |
|
if (step < 0) while (++step <= 0) { |
|
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty |
|
} else while (--step >= 0) { |
|
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty |
|
} |
|
} |
|
}); |
|
}; |
|
|
|
if (count) { |
|
interval.count = function(start, end) { |
|
t0.setTime(+start), t1.setTime(+end); |
|
floori(t0), floori(t1); |
|
return Math.floor(count(t0, t1)); |
|
}; |
|
|
|
interval.every = function(step) { |
|
step = Math.floor(step); |
|
return !isFinite(step) || !(step > 0) ? null |
|
: !(step > 1) ? interval |
|
: interval.filter(field |
|
? function(d) { return field(d) % step === 0; } |
|
: function(d) { return interval.count(0, d) % step === 0; }); |
|
}; |
|
} |
|
|
|
return interval; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/millisecond.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-time/src/millisecond.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default, milliseconds */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "milliseconds", function() { return milliseconds; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
|
|
|
|
var millisecond = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function() { |
|
// noop |
|
}, function(date, step) { |
|
date.setTime(+date + step); |
|
}, function(start, end) { |
|
return end - start; |
|
}); |
|
|
|
// An optimized implementation for this simple case. |
|
millisecond.every = function(k) { |
|
k = Math.floor(k); |
|
if (!isFinite(k) || !(k > 0)) return null; |
|
if (!(k > 1)) return millisecond; |
|
return Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setTime(Math.floor(date / k) * k); |
|
}, function(date, step) { |
|
date.setTime(+date + step * k); |
|
}, function(start, end) { |
|
return (end - start) / k; |
|
}); |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (millisecond); |
|
var milliseconds = millisecond.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/minute.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-time/src/minute.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default, minutes */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minutes", function() { return minutes; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var minute = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setTime(date - date.getMilliseconds() - date.getSeconds() * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationSecond"]); |
|
}, function(date, step) { |
|
date.setTime(+date + step * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]; |
|
}, function(date) { |
|
return date.getMinutes(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (minute); |
|
var minutes = minute.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/month.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-time/src/month.js ***! |
|
\********************************************/ |
|
/*! exports provided: default, months */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "months", function() { return months; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
|
|
|
|
var month = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setDate(1); |
|
date.setHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setMonth(date.getMonth() + step); |
|
}, function(start, end) { |
|
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; |
|
}, function(date) { |
|
return date.getMonth(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (month); |
|
var months = month.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/second.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-time/src/second.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default, seconds */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "seconds", function() { return seconds; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var second = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setTime(date - date.getMilliseconds()); |
|
}, function(date, step) { |
|
date.setTime(+date + step * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationSecond"]); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationSecond"]; |
|
}, function(date) { |
|
return date.getUTCSeconds(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (second); |
|
var seconds = second.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/utcDay.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-time/src/utcDay.js ***! |
|
\*********************************************/ |
|
/*! exports provided: default, utcDays */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcDays", function() { return utcDays; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var utcDay = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setUTCDate(date.getUTCDate() + step); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationDay"]; |
|
}, function(date) { |
|
return date.getUTCDate() - 1; |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (utcDay); |
|
var utcDays = utcDay.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/utcHour.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-time/src/utcHour.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default, utcHours */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcHours", function() { return utcHours; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var utcHour = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCMinutes(0, 0, 0); |
|
}, function(date, step) { |
|
date.setTime(+date + step * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationHour"]); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationHour"]; |
|
}, function(date) { |
|
return date.getUTCHours(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (utcHour); |
|
var utcHours = utcHour.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/utcMinute.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-time/src/utcMinute.js ***! |
|
\************************************************/ |
|
/*! exports provided: default, utcMinutes */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcMinutes", function() { return utcMinutes; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
var utcMinute = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCSeconds(0, 0); |
|
}, function(date, step) { |
|
date.setTime(+date + step * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]; |
|
}, function(date) { |
|
return date.getUTCMinutes(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (utcMinute); |
|
var utcMinutes = utcMinute.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/utcMonth.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-time/src/utcMonth.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default, utcMonths */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcMonths", function() { return utcMonths; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
|
|
|
|
var utcMonth = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCDate(1); |
|
date.setUTCHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setUTCMonth(date.getUTCMonth() + step); |
|
}, function(start, end) { |
|
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; |
|
}, function(date) { |
|
return date.getUTCMonth(); |
|
}); |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (utcMonth); |
|
var utcMonths = utcMonth.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/utcWeek.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-time/src/utcWeek.js ***! |
|
\**********************************************/ |
|
/*! exports provided: utcSunday, utcMonday, utcTuesday, utcWednesday, utcThursday, utcFriday, utcSaturday, utcSundays, utcMondays, utcTuesdays, utcWednesdays, utcThursdays, utcFridays, utcSaturdays */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcSunday", function() { return utcSunday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcMonday", function() { return utcMonday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcTuesday", function() { return utcTuesday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcWednesday", function() { return utcWednesday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcThursday", function() { return utcThursday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcFriday", function() { return utcFriday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcSaturday", function() { return utcSaturday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcSundays", function() { return utcSundays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcMondays", function() { return utcMondays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcTuesdays", function() { return utcTuesdays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcWednesdays", function() { return utcWednesdays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcThursdays", function() { return utcThursdays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcFridays", function() { return utcFridays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcSaturdays", function() { return utcSaturdays; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
function utcWeekday(i) { |
|
return Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7); |
|
date.setUTCHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setUTCDate(date.getUTCDate() + step * 7); |
|
}, function(start, end) { |
|
return (end - start) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationWeek"]; |
|
}); |
|
} |
|
|
|
var utcSunday = utcWeekday(0); |
|
var utcMonday = utcWeekday(1); |
|
var utcTuesday = utcWeekday(2); |
|
var utcWednesday = utcWeekday(3); |
|
var utcThursday = utcWeekday(4); |
|
var utcFriday = utcWeekday(5); |
|
var utcSaturday = utcWeekday(6); |
|
|
|
var utcSundays = utcSunday.range; |
|
var utcMondays = utcMonday.range; |
|
var utcTuesdays = utcTuesday.range; |
|
var utcWednesdays = utcWednesday.range; |
|
var utcThursdays = utcThursday.range; |
|
var utcFridays = utcFriday.range; |
|
var utcSaturdays = utcSaturday.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/utcYear.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-time/src/utcYear.js ***! |
|
\**********************************************/ |
|
/*! exports provided: default, utcYears */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utcYears", function() { return utcYears; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
|
|
|
|
var utcYear = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCMonth(0, 1); |
|
date.setUTCHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setUTCFullYear(date.getUTCFullYear() + step); |
|
}, function(start, end) { |
|
return end.getUTCFullYear() - start.getUTCFullYear(); |
|
}, function(date) { |
|
return date.getUTCFullYear(); |
|
}); |
|
|
|
// An optimized implementation for this simple case. |
|
utcYear.every = function(k) { |
|
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k); |
|
date.setUTCMonth(0, 1); |
|
date.setUTCHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setUTCFullYear(date.getUTCFullYear() + step * k); |
|
}); |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (utcYear); |
|
var utcYears = utcYear.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/week.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-time/src/week.js ***! |
|
\*******************************************/ |
|
/*! exports provided: sunday, monday, tuesday, wednesday, thursday, friday, saturday, sundays, mondays, tuesdays, wednesdays, thursdays, fridays, saturdays */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sunday", function() { return sunday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "monday", function() { return monday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tuesday", function() { return tuesday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wednesday", function() { return wednesday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "thursday", function() { return thursday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "friday", function() { return friday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saturday", function() { return saturday; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sundays", function() { return sundays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mondays", function() { return mondays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tuesdays", function() { return tuesdays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wednesdays", function() { return wednesdays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "thursdays", function() { return thursdays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fridays", function() { return fridays; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saturdays", function() { return saturdays; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-time/src/duration.js"); |
|
|
|
|
|
|
|
function weekday(i) { |
|
return Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7); |
|
date.setHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setDate(date.getDate() + step * 7); |
|
}, function(start, end) { |
|
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationMinute"]) / _duration_js__WEBPACK_IMPORTED_MODULE_1__["durationWeek"]; |
|
}); |
|
} |
|
|
|
var sunday = weekday(0); |
|
var monday = weekday(1); |
|
var tuesday = weekday(2); |
|
var wednesday = weekday(3); |
|
var thursday = weekday(4); |
|
var friday = weekday(5); |
|
var saturday = weekday(6); |
|
|
|
var sundays = sunday.range; |
|
var mondays = monday.range; |
|
var tuesdays = tuesday.range; |
|
var wednesdays = wednesday.range; |
|
var thursdays = thursday.range; |
|
var fridays = friday.range; |
|
var saturdays = saturday.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-time/src/year.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-time/src/year.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default, years */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "years", function() { return years; }); |
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-time/src/interval.js"); |
|
|
|
|
|
var year = Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setMonth(0, 1); |
|
date.setHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setFullYear(date.getFullYear() + step); |
|
}, function(start, end) { |
|
return end.getFullYear() - start.getFullYear(); |
|
}, function(date) { |
|
return date.getFullYear(); |
|
}); |
|
|
|
// An optimized implementation for this simple case. |
|
year.every = function(k) { |
|
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : Object(_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) { |
|
date.setFullYear(Math.floor(date.getFullYear() / k) * k); |
|
date.setMonth(0, 1); |
|
date.setHours(0, 0, 0, 0); |
|
}, function(date, step) { |
|
date.setFullYear(date.getFullYear() + step * k); |
|
}); |
|
}; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (year); |
|
var years = year.range; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-timer/src/index.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-timer/src/index.js ***! |
|
\*********************************************/ |
|
/*! exports provided: now, timer, timerFlush, timeout, interval */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "../node_modules/d3-timer/src/timer.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["now"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["timer"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__["timerFlush"]; }); |
|
|
|
/* harmony import */ var _timeout_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeout.js */ "../node_modules/d3-timer/src/timeout.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _timeout_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval.js */ "../node_modules/d3-timer/src/interval.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _interval_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-timer/src/interval.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-timer/src/interval.js ***! |
|
\************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "../node_modules/d3-timer/src/timer.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback, delay, time) { |
|
var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__["Timer"], total = delay; |
|
if (delay == null) return t.restart(callback, delay, time), t; |
|
delay = +delay, time = time == null ? Object(_timer_js__WEBPACK_IMPORTED_MODULE_0__["now"])() : +time; |
|
t.restart(function tick(elapsed) { |
|
elapsed += total; |
|
t.restart(tick, total += delay, time); |
|
callback(elapsed); |
|
}, delay, time); |
|
return t; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-timer/src/timeout.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-timer/src/timeout.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ "../node_modules/d3-timer/src/timer.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(callback, delay, time) { |
|
var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__["Timer"]; |
|
delay = delay == null ? 0 : +delay; |
|
t.restart(function(elapsed) { |
|
t.stop(); |
|
callback(elapsed + delay); |
|
}, delay, time); |
|
return t; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-timer/src/timer.js": |
|
/*!*********************************************!*\ |
|
!*** ../node_modules/d3-timer/src/timer.js ***! |
|
\*********************************************/ |
|
/*! exports provided: now, Timer, timer, timerFlush */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return now; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return timerFlush; }); |
|
var frame = 0, // is an animation frame pending? |
|
timeout = 0, // is a timeout pending? |
|
interval = 0, // are any timers active? |
|
pokeDelay = 1000, // how frequently we check for clock skew |
|
taskHead, |
|
taskTail, |
|
clockLast = 0, |
|
clockNow = 0, |
|
clockSkew = 0, |
|
clock = typeof performance === "object" && performance.now ? performance : Date, |
|
setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; |
|
|
|
function now() { |
|
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); |
|
} |
|
|
|
function clearNow() { |
|
clockNow = 0; |
|
} |
|
|
|
function Timer() { |
|
this._call = |
|
this._time = |
|
this._next = null; |
|
} |
|
|
|
Timer.prototype = timer.prototype = { |
|
constructor: Timer, |
|
restart: function(callback, delay, time) { |
|
if (typeof callback !== "function") throw new TypeError("callback is not a function"); |
|
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); |
|
if (!this._next && taskTail !== this) { |
|
if (taskTail) taskTail._next = this; |
|
else taskHead = this; |
|
taskTail = this; |
|
} |
|
this._call = callback; |
|
this._time = time; |
|
sleep(); |
|
}, |
|
stop: function() { |
|
if (this._call) { |
|
this._call = null; |
|
this._time = Infinity; |
|
sleep(); |
|
} |
|
} |
|
}; |
|
|
|
function timer(callback, delay, time) { |
|
var t = new Timer; |
|
t.restart(callback, delay, time); |
|
return t; |
|
} |
|
|
|
function timerFlush() { |
|
now(); // Get the current time, if not already set. |
|
++frame; // Pretend we’ve set an alarm, if we haven’t already. |
|
var t = taskHead, e; |
|
while (t) { |
|
if ((e = clockNow - t._time) >= 0) t._call.call(null, e); |
|
t = t._next; |
|
} |
|
--frame; |
|
} |
|
|
|
function wake() { |
|
clockNow = (clockLast = clock.now()) + clockSkew; |
|
frame = timeout = 0; |
|
try { |
|
timerFlush(); |
|
} finally { |
|
frame = 0; |
|
nap(); |
|
clockNow = 0; |
|
} |
|
} |
|
|
|
function poke() { |
|
var now = clock.now(), delay = now - clockLast; |
|
if (delay > pokeDelay) clockSkew -= delay, clockLast = now; |
|
} |
|
|
|
function nap() { |
|
var t0, t1 = taskHead, t2, time = Infinity; |
|
while (t1) { |
|
if (t1._call) { |
|
if (time > t1._time) time = t1._time; |
|
t0 = t1, t1 = t1._next; |
|
} else { |
|
t2 = t1._next, t1._next = null; |
|
t1 = t0 ? t0._next = t2 : taskHead = t2; |
|
} |
|
} |
|
taskTail = t0; |
|
sleep(time); |
|
} |
|
|
|
function sleep(time) { |
|
if (frame) return; // Soonest alarm already set, or will be. |
|
if (timeout) timeout = clearTimeout(timeout); |
|
var delay = time - clockNow; // Strictly less than if we recomputed clockNow. |
|
if (delay > 24) { |
|
if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); |
|
if (interval) interval = clearInterval(interval); |
|
} else { |
|
if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); |
|
frame = 1, setFrame(wake); |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/active.js": |
|
/*!***************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/active.js ***! |
|
\***************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _transition_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transition/index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
/* harmony import */ var _transition_schedule_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition/schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
|
|
var root = [null]; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, name) { |
|
var schedules = node.__transition, |
|
schedule, |
|
i; |
|
|
|
if (schedules) { |
|
name = name == null ? null : name + ""; |
|
for (i in schedules) { |
|
if ((schedule = schedules[i]).state > _transition_schedule_js__WEBPACK_IMPORTED_MODULE_1__["SCHEDULED"] && schedule.name === name) { |
|
return new _transition_index_js__WEBPACK_IMPORTED_MODULE_0__["Transition"]([[node]], root, name, +i); |
|
} |
|
} |
|
} |
|
|
|
return null; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/index.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/index.js ***! |
|
\**************************************************/ |
|
/*! exports provided: transition, active, interrupt */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _selection_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection/index.js */ "../node_modules/d3-transition/src/selection/index.js"); |
|
/* harmony import */ var _transition_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition/index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transition", function() { return _transition_index_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony import */ var _active_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./active.js */ "../node_modules/d3-transition/src/active.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "active", function() { return _active_js__WEBPACK_IMPORTED_MODULE_2__["default"]; }); |
|
|
|
/* harmony import */ var _interrupt_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./interrupt.js */ "../node_modules/d3-transition/src/interrupt.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interrupt", function() { return _interrupt_js__WEBPACK_IMPORTED_MODULE_3__["default"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/interrupt.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/interrupt.js ***! |
|
\******************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _transition_schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transition/schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, name) { |
|
var schedules = node.__transition, |
|
schedule, |
|
active, |
|
empty = true, |
|
i; |
|
|
|
if (!schedules) return; |
|
|
|
name = name == null ? null : name + ""; |
|
|
|
for (i in schedules) { |
|
if ((schedule = schedules[i]).name !== name) { empty = false; continue; } |
|
active = schedule.state > _transition_schedule_js__WEBPACK_IMPORTED_MODULE_0__["STARTING"] && schedule.state < _transition_schedule_js__WEBPACK_IMPORTED_MODULE_0__["ENDING"]; |
|
schedule.state = _transition_schedule_js__WEBPACK_IMPORTED_MODULE_0__["ENDED"]; |
|
schedule.timer.stop(); |
|
schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); |
|
delete schedules[i]; |
|
} |
|
|
|
if (empty) delete node.__transition; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/selection/index.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/selection/index.js ***! |
|
\************************************************************/ |
|
/*! no exports provided */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _interrupt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./interrupt.js */ "../node_modules/d3-transition/src/selection/interrupt.js"); |
|
/* harmony import */ var _transition_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transition.js */ "../node_modules/d3-transition/src/selection/transition.js"); |
|
|
|
|
|
|
|
|
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["selection"].prototype.interrupt = _interrupt_js__WEBPACK_IMPORTED_MODULE_1__["default"]; |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["selection"].prototype.transition = _transition_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/selection/interrupt.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/selection/interrupt.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _interrupt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../interrupt.js */ "../node_modules/d3-transition/src/interrupt.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name) { |
|
return this.each(function() { |
|
Object(_interrupt_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, name); |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/selection/transition.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/selection/transition.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _transition_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transition/index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
/* harmony import */ var _transition_schedule_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transition/schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
/* harmony import */ var d3_ease__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-ease */ "../node_modules/d3-ease/src/index.js"); |
|
/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-timer */ "../node_modules/d3-timer/src/index.js"); |
|
|
|
|
|
|
|
|
|
|
|
var defaultTiming = { |
|
time: null, // Set on use. |
|
delay: 0, |
|
duration: 250, |
|
ease: d3_ease__WEBPACK_IMPORTED_MODULE_2__["easeCubicInOut"] |
|
}; |
|
|
|
function inherit(node, id) { |
|
var timing; |
|
while (!(timing = node.__transition) || !(timing = timing[id])) { |
|
if (!(node = node.parentNode)) { |
|
return defaultTiming.time = Object(d3_timer__WEBPACK_IMPORTED_MODULE_3__["now"])(), defaultTiming; |
|
} |
|
} |
|
return timing; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name) { |
|
var id, |
|
timing; |
|
|
|
if (name instanceof _transition_index_js__WEBPACK_IMPORTED_MODULE_0__["Transition"]) { |
|
id = name._id, name = name._name; |
|
} else { |
|
id = Object(_transition_index_js__WEBPACK_IMPORTED_MODULE_0__["newId"])(), (timing = defaultTiming).time = Object(d3_timer__WEBPACK_IMPORTED_MODULE_3__["now"])(), name = name == null ? null : name + ""; |
|
} |
|
|
|
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { |
|
if (node = group[i]) { |
|
Object(_transition_schedule_js__WEBPACK_IMPORTED_MODULE_1__["default"])(node, name, id, i, group, timing || inherit(node, id)); |
|
} |
|
} |
|
} |
|
|
|
return new _transition_index_js__WEBPACK_IMPORTED_MODULE_0__["Transition"](groups, this._parents, name, id); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/attr.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/attr.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _tween_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tween.js */ "../node_modules/d3-transition/src/transition/tween.js"); |
|
/* harmony import */ var _interpolate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./interpolate.js */ "../node_modules/d3-transition/src/transition/interpolate.js"); |
|
|
|
|
|
|
|
|
|
|
|
function attrRemove(name) { |
|
return function() { |
|
this.removeAttribute(name); |
|
}; |
|
} |
|
|
|
function attrRemoveNS(fullname) { |
|
return function() { |
|
this.removeAttributeNS(fullname.space, fullname.local); |
|
}; |
|
} |
|
|
|
function attrConstant(name, interpolate, value1) { |
|
var string00, |
|
string1 = value1 + "", |
|
interpolate0; |
|
return function() { |
|
var string0 = this.getAttribute(name); |
|
return string0 === string1 ? null |
|
: string0 === string00 ? interpolate0 |
|
: interpolate0 = interpolate(string00 = string0, value1); |
|
}; |
|
} |
|
|
|
function attrConstantNS(fullname, interpolate, value1) { |
|
var string00, |
|
string1 = value1 + "", |
|
interpolate0; |
|
return function() { |
|
var string0 = this.getAttributeNS(fullname.space, fullname.local); |
|
return string0 === string1 ? null |
|
: string0 === string00 ? interpolate0 |
|
: interpolate0 = interpolate(string00 = string0, value1); |
|
}; |
|
} |
|
|
|
function attrFunction(name, interpolate, value) { |
|
var string00, |
|
string10, |
|
interpolate0; |
|
return function() { |
|
var string0, value1 = value(this), string1; |
|
if (value1 == null) return void this.removeAttribute(name); |
|
string0 = this.getAttribute(name); |
|
string1 = value1 + ""; |
|
return string0 === string1 ? null |
|
: string0 === string00 && string1 === string10 ? interpolate0 |
|
: (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); |
|
}; |
|
} |
|
|
|
function attrFunctionNS(fullname, interpolate, value) { |
|
var string00, |
|
string10, |
|
interpolate0; |
|
return function() { |
|
var string0, value1 = value(this), string1; |
|
if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); |
|
string0 = this.getAttributeNS(fullname.space, fullname.local); |
|
string1 = value1 + ""; |
|
return string0 === string1 ? null |
|
: string0 === string00 && string1 === string10 ? interpolate0 |
|
: (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value) { |
|
var fullname = Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["namespace"])(name), i = fullname === "transform" ? d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateTransformSvg"] : _interpolate_js__WEBPACK_IMPORTED_MODULE_3__["default"]; |
|
return this.attrTween(name, typeof value === "function" |
|
? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, Object(_tween_js__WEBPACK_IMPORTED_MODULE_2__["tweenValue"])(this, "attr." + name, value)) |
|
: value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname) |
|
: (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/attrTween.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/attrTween.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
|
|
|
|
function attrInterpolate(name, i) { |
|
return function(t) { |
|
this.setAttribute(name, i.call(this, t)); |
|
}; |
|
} |
|
|
|
function attrInterpolateNS(fullname, i) { |
|
return function(t) { |
|
this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); |
|
}; |
|
} |
|
|
|
function attrTweenNS(fullname, value) { |
|
var t0, i0; |
|
function tween() { |
|
var i = value.apply(this, arguments); |
|
if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); |
|
return t0; |
|
} |
|
tween._value = value; |
|
return tween; |
|
} |
|
|
|
function attrTween(name, value) { |
|
var t0, i0; |
|
function tween() { |
|
var i = value.apply(this, arguments); |
|
if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); |
|
return t0; |
|
} |
|
tween._value = value; |
|
return tween; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value) { |
|
var key = "attr." + name; |
|
if (arguments.length < 2) return (key = this.tween(key)) && key._value; |
|
if (value == null) return this.tween(key, null); |
|
if (typeof value !== "function") throw new Error; |
|
var fullname = Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["namespace"])(name); |
|
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/delay.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/delay.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
function delayFunction(id, value) { |
|
return function() { |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["init"])(this, id).delay = +value.apply(this, arguments); |
|
}; |
|
} |
|
|
|
function delayConstant(id, value) { |
|
return value = +value, function() { |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["init"])(this, id).delay = value; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
var id = this._id; |
|
|
|
return arguments.length |
|
? this.each((typeof value === "function" |
|
? delayFunction |
|
: delayConstant)(id, value)) |
|
: Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["get"])(this.node(), id).delay; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/duration.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/duration.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
function durationFunction(id, value) { |
|
return function() { |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id).duration = +value.apply(this, arguments); |
|
}; |
|
} |
|
|
|
function durationConstant(id, value) { |
|
return value = +value, function() { |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id).duration = value; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
var id = this._id; |
|
|
|
return arguments.length |
|
? this.each((typeof value === "function" |
|
? durationFunction |
|
: durationConstant)(id, value)) |
|
: Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["get"])(this.node(), id).duration; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/ease.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/ease.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
function easeConstant(id, value) { |
|
if (typeof value !== "function") throw new Error; |
|
return function() { |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id).ease = value; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
var id = this._id; |
|
|
|
return arguments.length |
|
? this.each(easeConstant(id, value)) |
|
: Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["get"])(this.node(), id).ease; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/end.js": |
|
/*!***********************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/end.js ***! |
|
\***********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var on0, on1, that = this, id = that._id, size = that.size(); |
|
return new Promise(function(resolve, reject) { |
|
var cancel = {value: reject}, |
|
end = {value: function() { if (--size === 0) resolve(); }}; |
|
|
|
that.each(function() { |
|
var schedule = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id), |
|
on = schedule.on; |
|
|
|
// If this node shared a dispatch with the previous node, |
|
// just assign the updated shared dispatch and we’re done! |
|
// Otherwise, copy-on-write. |
|
if (on !== on0) { |
|
on1 = (on0 = on).copy(); |
|
on1._.cancel.push(cancel); |
|
on1._.interrupt.push(cancel); |
|
on1._.end.push(end); |
|
} |
|
|
|
schedule.on = on1; |
|
}); |
|
}); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/filter.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/filter.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(match) { |
|
if (typeof match !== "function") match = Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["matcher"])(match); |
|
|
|
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { |
|
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { |
|
subgroup.push(node); |
|
} |
|
} |
|
} |
|
|
|
return new _index_js__WEBPACK_IMPORTED_MODULE_1__["Transition"](subgroups, this._parents, this._name, this._id); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/index.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/index.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: Transition, default, newId */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transition", function() { return Transition; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return transition; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "newId", function() { return newId; }); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _attr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attr.js */ "../node_modules/d3-transition/src/transition/attr.js"); |
|
/* harmony import */ var _attrTween_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attrTween.js */ "../node_modules/d3-transition/src/transition/attrTween.js"); |
|
/* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./delay.js */ "../node_modules/d3-transition/src/transition/delay.js"); |
|
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./duration.js */ "../node_modules/d3-transition/src/transition/duration.js"); |
|
/* harmony import */ var _ease_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ease.js */ "../node_modules/d3-transition/src/transition/ease.js"); |
|
/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./filter.js */ "../node_modules/d3-transition/src/transition/filter.js"); |
|
/* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./merge.js */ "../node_modules/d3-transition/src/transition/merge.js"); |
|
/* harmony import */ var _on_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./on.js */ "../node_modules/d3-transition/src/transition/on.js"); |
|
/* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./remove.js */ "../node_modules/d3-transition/src/transition/remove.js"); |
|
/* harmony import */ var _select_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./select.js */ "../node_modules/d3-transition/src/transition/select.js"); |
|
/* harmony import */ var _selectAll_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./selectAll.js */ "../node_modules/d3-transition/src/transition/selectAll.js"); |
|
/* harmony import */ var _selection_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./selection.js */ "../node_modules/d3-transition/src/transition/selection.js"); |
|
/* harmony import */ var _style_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./style.js */ "../node_modules/d3-transition/src/transition/style.js"); |
|
/* harmony import */ var _styleTween_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./styleTween.js */ "../node_modules/d3-transition/src/transition/styleTween.js"); |
|
/* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./text.js */ "../node_modules/d3-transition/src/transition/text.js"); |
|
/* harmony import */ var _textTween_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./textTween.js */ "../node_modules/d3-transition/src/transition/textTween.js"); |
|
/* harmony import */ var _transition_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./transition.js */ "../node_modules/d3-transition/src/transition/transition.js"); |
|
/* harmony import */ var _tween_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./tween.js */ "../node_modules/d3-transition/src/transition/tween.js"); |
|
/* harmony import */ var _end_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./end.js */ "../node_modules/d3-transition/src/transition/end.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id = 0; |
|
|
|
function Transition(groups, parents, name, id) { |
|
this._groups = groups; |
|
this._parents = parents; |
|
this._name = name; |
|
this._id = id; |
|
} |
|
|
|
function transition(name) { |
|
return Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["selection"])().transition(name); |
|
} |
|
|
|
function newId() { |
|
return ++id; |
|
} |
|
|
|
var selection_prototype = d3_selection__WEBPACK_IMPORTED_MODULE_0__["selection"].prototype; |
|
|
|
Transition.prototype = transition.prototype = { |
|
constructor: Transition, |
|
select: _select_js__WEBPACK_IMPORTED_MODULE_10__["default"], |
|
selectAll: _selectAll_js__WEBPACK_IMPORTED_MODULE_11__["default"], |
|
filter: _filter_js__WEBPACK_IMPORTED_MODULE_6__["default"], |
|
merge: _merge_js__WEBPACK_IMPORTED_MODULE_7__["default"], |
|
selection: _selection_js__WEBPACK_IMPORTED_MODULE_12__["default"], |
|
transition: _transition_js__WEBPACK_IMPORTED_MODULE_17__["default"], |
|
call: selection_prototype.call, |
|
nodes: selection_prototype.nodes, |
|
node: selection_prototype.node, |
|
size: selection_prototype.size, |
|
empty: selection_prototype.empty, |
|
each: selection_prototype.each, |
|
on: _on_js__WEBPACK_IMPORTED_MODULE_8__["default"], |
|
attr: _attr_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
|
attrTween: _attrTween_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
|
style: _style_js__WEBPACK_IMPORTED_MODULE_13__["default"], |
|
styleTween: _styleTween_js__WEBPACK_IMPORTED_MODULE_14__["default"], |
|
text: _text_js__WEBPACK_IMPORTED_MODULE_15__["default"], |
|
textTween: _textTween_js__WEBPACK_IMPORTED_MODULE_16__["default"], |
|
remove: _remove_js__WEBPACK_IMPORTED_MODULE_9__["default"], |
|
tween: _tween_js__WEBPACK_IMPORTED_MODULE_18__["default"], |
|
delay: _delay_js__WEBPACK_IMPORTED_MODULE_3__["default"], |
|
duration: _duration_js__WEBPACK_IMPORTED_MODULE_4__["default"], |
|
ease: _ease_js__WEBPACK_IMPORTED_MODULE_5__["default"], |
|
end: _end_js__WEBPACK_IMPORTED_MODULE_19__["default"] |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/interpolate.js": |
|
/*!*******************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/interpolate.js ***! |
|
\*******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(a, b) { |
|
var c; |
|
return (typeof b === "number" ? d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateNumber"] |
|
: b instanceof d3_color__WEBPACK_IMPORTED_MODULE_0__["color"] ? d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateRgb"] |
|
: (c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__["color"])(b)) ? (b = c, d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateRgb"]) |
|
: d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["interpolateString"])(a, b); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/merge.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/merge.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(transition) { |
|
if (transition._id !== this._id) throw new Error; |
|
|
|
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { |
|
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { |
|
if (node = group0[i] || group1[i]) { |
|
merge[i] = node; |
|
} |
|
} |
|
} |
|
|
|
for (; j < m0; ++j) { |
|
merges[j] = groups0[j]; |
|
} |
|
|
|
return new _index_js__WEBPACK_IMPORTED_MODULE_0__["Transition"](merges, this._parents, this._name, this._id); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/on.js": |
|
/*!**********************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/on.js ***! |
|
\**********************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
function start(name) { |
|
return (name + "").trim().split(/^|\s+/).every(function(t) { |
|
var i = t.indexOf("."); |
|
if (i >= 0) t = t.slice(0, i); |
|
return !t || t === "start"; |
|
}); |
|
} |
|
|
|
function onFunction(id, name, listener) { |
|
var on0, on1, sit = start(name) ? _schedule_js__WEBPACK_IMPORTED_MODULE_0__["init"] : _schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"]; |
|
return function() { |
|
var schedule = sit(this, id), |
|
on = schedule.on; |
|
|
|
// If this node shared a dispatch with the previous node, |
|
// just assign the updated shared dispatch and we’re done! |
|
// Otherwise, copy-on-write. |
|
if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); |
|
|
|
schedule.on = on1; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, listener) { |
|
var id = this._id; |
|
|
|
return arguments.length < 2 |
|
? Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["get"])(this.node(), id).on.on(name) |
|
: this.each(onFunction(id, name, listener)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/remove.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/remove.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function removeFunction(id) { |
|
return function() { |
|
var parent = this.parentNode; |
|
for (var i in this.__transition) if (+i !== id) return; |
|
if (parent) parent.removeChild(this); |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return this.on("end.remove", removeFunction(this._id)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/schedule.js": |
|
/*!****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/schedule.js ***! |
|
\****************************************************************/ |
|
/*! exports provided: CREATED, SCHEDULED, STARTING, STARTED, RUNNING, ENDING, ENDED, default, init, set, get */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CREATED", function() { return CREATED; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCHEDULED", function() { return SCHEDULED; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STARTING", function() { return STARTING; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STARTED", function() { return STARTED; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RUNNING", function() { return RUNNING; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENDING", function() { return ENDING; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENDED", function() { return ENDED; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "init", function() { return init; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; }); |
|
/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ "../node_modules/d3-dispatch/src/index.js"); |
|
/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ "../node_modules/d3-timer/src/index.js"); |
|
|
|
|
|
|
|
var emptyOn = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__["dispatch"])("start", "end", "cancel", "interrupt"); |
|
var emptyTween = []; |
|
|
|
var CREATED = 0; |
|
var SCHEDULED = 1; |
|
var STARTING = 2; |
|
var STARTED = 3; |
|
var RUNNING = 4; |
|
var ENDING = 5; |
|
var ENDED = 6; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(node, name, id, index, group, timing) { |
|
var schedules = node.__transition; |
|
if (!schedules) node.__transition = {}; |
|
else if (id in schedules) return; |
|
create(node, id, { |
|
name: name, |
|
index: index, // For context during callback. |
|
group: group, // For context during callback. |
|
on: emptyOn, |
|
tween: emptyTween, |
|
time: timing.time, |
|
delay: timing.delay, |
|
duration: timing.duration, |
|
ease: timing.ease, |
|
timer: null, |
|
state: CREATED |
|
}); |
|
}); |
|
|
|
function init(node, id) { |
|
var schedule = get(node, id); |
|
if (schedule.state > CREATED) throw new Error("too late; already scheduled"); |
|
return schedule; |
|
} |
|
|
|
function set(node, id) { |
|
var schedule = get(node, id); |
|
if (schedule.state > STARTED) throw new Error("too late; already running"); |
|
return schedule; |
|
} |
|
|
|
function get(node, id) { |
|
var schedule = node.__transition; |
|
if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); |
|
return schedule; |
|
} |
|
|
|
function create(node, id, self) { |
|
var schedules = node.__transition, |
|
tween; |
|
|
|
// Initialize the self timer when the transition is created. |
|
// Note the actual delay is not known until the first callback! |
|
schedules[id] = self; |
|
self.timer = Object(d3_timer__WEBPACK_IMPORTED_MODULE_1__["timer"])(schedule, 0, self.time); |
|
|
|
function schedule(elapsed) { |
|
self.state = SCHEDULED; |
|
self.timer.restart(start, self.delay, self.time); |
|
|
|
// If the elapsed delay is less than our first sleep, start immediately. |
|
if (self.delay <= elapsed) start(elapsed - self.delay); |
|
} |
|
|
|
function start(elapsed) { |
|
var i, j, n, o; |
|
|
|
// If the state is not SCHEDULED, then we previously errored on start. |
|
if (self.state !== SCHEDULED) return stop(); |
|
|
|
for (i in schedules) { |
|
o = schedules[i]; |
|
if (o.name !== self.name) continue; |
|
|
|
// While this element already has a starting transition during this frame, |
|
// defer starting an interrupting transition until that transition has a |
|
// chance to tick (and possibly end); see d3/d3-transition#54! |
|
if (o.state === STARTED) return Object(d3_timer__WEBPACK_IMPORTED_MODULE_1__["timeout"])(start); |
|
|
|
// Interrupt the active transition, if any. |
|
if (o.state === RUNNING) { |
|
o.state = ENDED; |
|
o.timer.stop(); |
|
o.on.call("interrupt", node, node.__data__, o.index, o.group); |
|
delete schedules[i]; |
|
} |
|
|
|
// Cancel any pre-empted transitions. |
|
else if (+i < id) { |
|
o.state = ENDED; |
|
o.timer.stop(); |
|
o.on.call("cancel", node, node.__data__, o.index, o.group); |
|
delete schedules[i]; |
|
} |
|
} |
|
|
|
// Defer the first tick to end of the current frame; see d3/d3#1576. |
|
// Note the transition may be canceled after start and before the first tick! |
|
// Note this must be scheduled before the start event; see d3/d3-transition#16! |
|
// Assuming this is successful, subsequent callbacks go straight to tick. |
|
Object(d3_timer__WEBPACK_IMPORTED_MODULE_1__["timeout"])(function() { |
|
if (self.state === STARTED) { |
|
self.state = RUNNING; |
|
self.timer.restart(tick, self.delay, self.time); |
|
tick(elapsed); |
|
} |
|
}); |
|
|
|
// Dispatch the start event. |
|
// Note this must be done before the tween are initialized. |
|
self.state = STARTING; |
|
self.on.call("start", node, node.__data__, self.index, self.group); |
|
if (self.state !== STARTING) return; // interrupted |
|
self.state = STARTED; |
|
|
|
// Initialize the tween, deleting null tween. |
|
tween = new Array(n = self.tween.length); |
|
for (i = 0, j = -1; i < n; ++i) { |
|
if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { |
|
tween[++j] = o; |
|
} |
|
} |
|
tween.length = j + 1; |
|
} |
|
|
|
function tick(elapsed) { |
|
var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), |
|
i = -1, |
|
n = tween.length; |
|
|
|
while (++i < n) { |
|
tween[i].call(node, t); |
|
} |
|
|
|
// Dispatch the end event. |
|
if (self.state === ENDING) { |
|
self.on.call("end", node, node.__data__, self.index, self.group); |
|
stop(); |
|
} |
|
} |
|
|
|
function stop() { |
|
self.state = ENDED; |
|
self.timer.stop(); |
|
delete schedules[id]; |
|
for (var i in schedules) return; // eslint-disable-line no-unused-vars |
|
delete node.__transition; |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/select.js": |
|
/*!**************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/select.js ***! |
|
\**************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(select) { |
|
var name = this._name, |
|
id = this._id; |
|
|
|
if (typeof select !== "function") select = Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["selector"])(select); |
|
|
|
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { |
|
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { |
|
if ("__data__" in node) subnode.__data__ = node.__data__; |
|
subgroup[i] = subnode; |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_2__["default"])(subgroup[i], name, id, i, subgroup, Object(_schedule_js__WEBPACK_IMPORTED_MODULE_2__["get"])(node, id)); |
|
} |
|
} |
|
} |
|
|
|
return new _index_js__WEBPACK_IMPORTED_MODULE_1__["Transition"](subgroups, this._parents, name, id); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/selectAll.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/selectAll.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(select) { |
|
var name = this._name, |
|
id = this._id; |
|
|
|
if (typeof select !== "function") select = Object(d3_selection__WEBPACK_IMPORTED_MODULE_0__["selectorAll"])(select); |
|
|
|
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { |
|
if (node = group[i]) { |
|
for (var children = select.call(node, node.__data__, i, group), child, inherit = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_2__["get"])(node, id), k = 0, l = children.length; k < l; ++k) { |
|
if (child = children[k]) { |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_2__["default"])(child, name, id, k, children, inherit); |
|
} |
|
} |
|
subgroups.push(children); |
|
parents.push(node); |
|
} |
|
} |
|
} |
|
|
|
return new _index_js__WEBPACK_IMPORTED_MODULE_1__["Transition"](subgroups, parents, name, id); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/selection.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/selection.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
|
|
|
|
var Selection = d3_selection__WEBPACK_IMPORTED_MODULE_0__["selection"].prototype.constructor; |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
return new Selection(this._groups, this._parents); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/style.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/style.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
/* harmony import */ var _tween_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tween.js */ "../node_modules/d3-transition/src/transition/tween.js"); |
|
/* harmony import */ var _interpolate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./interpolate.js */ "../node_modules/d3-transition/src/transition/interpolate.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
function styleNull(name, interpolate) { |
|
var string00, |
|
string10, |
|
interpolate0; |
|
return function() { |
|
var string0 = Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["style"])(this, name), |
|
string1 = (this.style.removeProperty(name), Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["style"])(this, name)); |
|
return string0 === string1 ? null |
|
: string0 === string00 && string1 === string10 ? interpolate0 |
|
: interpolate0 = interpolate(string00 = string0, string10 = string1); |
|
}; |
|
} |
|
|
|
function styleRemove(name) { |
|
return function() { |
|
this.style.removeProperty(name); |
|
}; |
|
} |
|
|
|
function styleConstant(name, interpolate, value1) { |
|
var string00, |
|
string1 = value1 + "", |
|
interpolate0; |
|
return function() { |
|
var string0 = Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["style"])(this, name); |
|
return string0 === string1 ? null |
|
: string0 === string00 ? interpolate0 |
|
: interpolate0 = interpolate(string00 = string0, value1); |
|
}; |
|
} |
|
|
|
function styleFunction(name, interpolate, value) { |
|
var string00, |
|
string10, |
|
interpolate0; |
|
return function() { |
|
var string0 = Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["style"])(this, name), |
|
value1 = value(this), |
|
string1 = value1 + ""; |
|
if (value1 == null) string1 = value1 = (this.style.removeProperty(name), Object(d3_selection__WEBPACK_IMPORTED_MODULE_1__["style"])(this, name)); |
|
return string0 === string1 ? null |
|
: string0 === string00 && string1 === string10 ? interpolate0 |
|
: (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); |
|
}; |
|
} |
|
|
|
function styleMaybeRemove(id, name) { |
|
var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; |
|
return function() { |
|
var schedule = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_2__["set"])(this, id), |
|
on = schedule.on, |
|
listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined; |
|
|
|
// If this node shared a dispatch with the previous node, |
|
// just assign the updated shared dispatch and we’re done! |
|
// Otherwise, copy-on-write. |
|
if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); |
|
|
|
schedule.on = on1; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value, priority) { |
|
var i = (name += "") === "transform" ? d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["interpolateTransformCss"] : _interpolate_js__WEBPACK_IMPORTED_MODULE_4__["default"]; |
|
return value == null ? this |
|
.styleTween(name, styleNull(name, i)) |
|
.on("end.style." + name, styleRemove(name)) |
|
: typeof value === "function" ? this |
|
.styleTween(name, styleFunction(name, i, Object(_tween_js__WEBPACK_IMPORTED_MODULE_3__["tweenValue"])(this, "style." + name, value))) |
|
.each(styleMaybeRemove(this._id, name)) |
|
: this |
|
.styleTween(name, styleConstant(name, i, value), priority) |
|
.on("end.style." + name, null); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/styleTween.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/styleTween.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function styleInterpolate(name, i, priority) { |
|
return function(t) { |
|
this.style.setProperty(name, i.call(this, t), priority); |
|
}; |
|
} |
|
|
|
function styleTween(name, value, priority) { |
|
var t, i0; |
|
function tween() { |
|
var i = value.apply(this, arguments); |
|
if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); |
|
return t; |
|
} |
|
tween._value = value; |
|
return tween; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value, priority) { |
|
var key = "style." + (name += ""); |
|
if (arguments.length < 2) return (key = this.tween(key)) && key._value; |
|
if (value == null) return this.tween(key, null); |
|
if (typeof value !== "function") throw new Error; |
|
return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/text.js": |
|
/*!************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/text.js ***! |
|
\************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _tween_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tween.js */ "../node_modules/d3-transition/src/transition/tween.js"); |
|
|
|
|
|
function textConstant(value) { |
|
return function() { |
|
this.textContent = value; |
|
}; |
|
} |
|
|
|
function textFunction(value) { |
|
return function() { |
|
var value1 = value(this); |
|
this.textContent = value1 == null ? "" : value1; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
return this.tween("text", typeof value === "function" |
|
? textFunction(Object(_tween_js__WEBPACK_IMPORTED_MODULE_0__["tweenValue"])(this, "text", value)) |
|
: textConstant(value == null ? "" : value + "")); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/textTween.js": |
|
/*!*****************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/textTween.js ***! |
|
\*****************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
function textInterpolate(i) { |
|
return function(t) { |
|
this.textContent = i.call(this, t); |
|
}; |
|
} |
|
|
|
function textTween(value) { |
|
var t0, i0; |
|
function tween() { |
|
var i = value.apply(this, arguments); |
|
if (i !== i0) t0 = (i0 = i) && textInterpolate(i); |
|
return t0; |
|
} |
|
tween._value = value; |
|
return tween; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(value) { |
|
var key = "text"; |
|
if (arguments.length < 1) return (key = this.tween(key)) && key._value; |
|
if (value == null) return this.tween(key, null); |
|
if (typeof value !== "function") throw new Error; |
|
return this.tween(key, textTween(value)); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/transition.js": |
|
/*!******************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/transition.js ***! |
|
\******************************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/d3-transition/src/transition/index.js"); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var name = this._name, |
|
id0 = this._id, |
|
id1 = Object(_index_js__WEBPACK_IMPORTED_MODULE_0__["newId"])(); |
|
|
|
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { |
|
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { |
|
if (node = group[i]) { |
|
var inherit = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_1__["get"])(node, id0); |
|
Object(_schedule_js__WEBPACK_IMPORTED_MODULE_1__["default"])(node, name, id1, i, group, { |
|
time: inherit.time + inherit.delay + inherit.duration, |
|
delay: 0, |
|
duration: inherit.duration, |
|
ease: inherit.ease |
|
}); |
|
} |
|
} |
|
} |
|
|
|
return new _index_js__WEBPACK_IMPORTED_MODULE_0__["Transition"](groups, this._parents, name, id1); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-transition/src/transition/tween.js": |
|
/*!*************************************************************!*\ |
|
!*** ../node_modules/d3-transition/src/transition/tween.js ***! |
|
\*************************************************************/ |
|
/*! exports provided: default, tweenValue */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tweenValue", function() { return tweenValue; }); |
|
/* harmony import */ var _schedule_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schedule.js */ "../node_modules/d3-transition/src/transition/schedule.js"); |
|
|
|
|
|
function tweenRemove(id, name) { |
|
var tween0, tween1; |
|
return function() { |
|
var schedule = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id), |
|
tween = schedule.tween; |
|
|
|
// If this node shared tween with the previous node, |
|
// just assign the updated shared tween and we’re done! |
|
// Otherwise, copy-on-write. |
|
if (tween !== tween0) { |
|
tween1 = tween0 = tween; |
|
for (var i = 0, n = tween1.length; i < n; ++i) { |
|
if (tween1[i].name === name) { |
|
tween1 = tween1.slice(); |
|
tween1.splice(i, 1); |
|
break; |
|
} |
|
} |
|
} |
|
|
|
schedule.tween = tween1; |
|
}; |
|
} |
|
|
|
function tweenFunction(id, name, value) { |
|
var tween0, tween1; |
|
if (typeof value !== "function") throw new Error; |
|
return function() { |
|
var schedule = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id), |
|
tween = schedule.tween; |
|
|
|
// If this node shared tween with the previous node, |
|
// just assign the updated shared tween and we’re done! |
|
// Otherwise, copy-on-write. |
|
if (tween !== tween0) { |
|
tween1 = (tween0 = tween).slice(); |
|
for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { |
|
if (tween1[i].name === name) { |
|
tween1[i] = t; |
|
break; |
|
} |
|
} |
|
if (i === n) tween1.push(t); |
|
} |
|
|
|
schedule.tween = tween1; |
|
}; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function(name, value) { |
|
var id = this._id; |
|
|
|
name += ""; |
|
|
|
if (arguments.length < 2) { |
|
var tween = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["get"])(this.node(), id).tween; |
|
for (var i = 0, n = tween.length, t; i < n; ++i) { |
|
if ((t = tween[i]).name === name) { |
|
return t.value; |
|
} |
|
} |
|
return null; |
|
} |
|
|
|
return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); |
|
}); |
|
|
|
function tweenValue(transition, name, value) { |
|
var id = transition._id; |
|
|
|
transition.each(function() { |
|
var schedule = Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["set"])(this, id); |
|
(schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); |
|
}); |
|
|
|
return function(node) { |
|
return Object(_schedule_js__WEBPACK_IMPORTED_MODULE_0__["get"])(node, id).value[name]; |
|
}; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/Beach.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/Beach.js ***! |
|
\***********************************************/ |
|
/*! exports provided: removeBeach, addBeach */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeBeach", function() { return removeBeach; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBeach", function() { return addBeach; }); |
|
/* harmony import */ var _RedBlackTree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RedBlackTree */ "../node_modules/d3-voronoi/src/RedBlackTree.js"); |
|
/* harmony import */ var _Cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Cell */ "../node_modules/d3-voronoi/src/Cell.js"); |
|
/* harmony import */ var _Circle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Circle */ "../node_modules/d3-voronoi/src/Circle.js"); |
|
/* harmony import */ var _Edge__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Edge */ "../node_modules/d3-voronoi/src/Edge.js"); |
|
/* harmony import */ var _Diagram__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Diagram */ "../node_modules/d3-voronoi/src/Diagram.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
var beachPool = []; |
|
|
|
function Beach() { |
|
Object(_RedBlackTree__WEBPACK_IMPORTED_MODULE_0__["RedBlackNode"])(this); |
|
this.edge = |
|
this.site = |
|
this.circle = null; |
|
} |
|
|
|
function createBeach(site) { |
|
var beach = beachPool.pop() || new Beach; |
|
beach.site = site; |
|
return beach; |
|
} |
|
|
|
function detachBeach(beach) { |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["detachCircle"])(beach); |
|
_Diagram__WEBPACK_IMPORTED_MODULE_4__["beaches"].remove(beach); |
|
beachPool.push(beach); |
|
Object(_RedBlackTree__WEBPACK_IMPORTED_MODULE_0__["RedBlackNode"])(beach); |
|
} |
|
|
|
function removeBeach(beach) { |
|
var circle = beach.circle, |
|
x = circle.x, |
|
y = circle.cy, |
|
vertex = [x, y], |
|
previous = beach.P, |
|
next = beach.N, |
|
disappearing = [beach]; |
|
|
|
detachBeach(beach); |
|
|
|
var lArc = previous; |
|
while (lArc.circle |
|
&& Math.abs(x - lArc.circle.x) < _Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"] |
|
&& Math.abs(y - lArc.circle.cy) < _Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"]) { |
|
previous = lArc.P; |
|
disappearing.unshift(lArc); |
|
detachBeach(lArc); |
|
lArc = previous; |
|
} |
|
|
|
disappearing.unshift(lArc); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["detachCircle"])(lArc); |
|
|
|
var rArc = next; |
|
while (rArc.circle |
|
&& Math.abs(x - rArc.circle.x) < _Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"] |
|
&& Math.abs(y - rArc.circle.cy) < _Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"]) { |
|
next = rArc.N; |
|
disappearing.push(rArc); |
|
detachBeach(rArc); |
|
rArc = next; |
|
} |
|
|
|
disappearing.push(rArc); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["detachCircle"])(rArc); |
|
|
|
var nArcs = disappearing.length, |
|
iArc; |
|
for (iArc = 1; iArc < nArcs; ++iArc) { |
|
rArc = disappearing[iArc]; |
|
lArc = disappearing[iArc - 1]; |
|
Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["setEdgeEnd"])(rArc.edge, lArc.site, rArc.site, vertex); |
|
} |
|
|
|
lArc = disappearing[0]; |
|
rArc = disappearing[nArcs - 1]; |
|
rArc.edge = Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["createEdge"])(lArc.site, rArc.site, null, vertex); |
|
|
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["attachCircle"])(lArc); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["attachCircle"])(rArc); |
|
} |
|
|
|
function addBeach(site) { |
|
var x = site[0], |
|
directrix = site[1], |
|
lArc, |
|
rArc, |
|
dxl, |
|
dxr, |
|
node = _Diagram__WEBPACK_IMPORTED_MODULE_4__["beaches"]._; |
|
|
|
while (node) { |
|
dxl = leftBreakPoint(node, directrix) - x; |
|
if (dxl > _Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"]) node = node.L; else { |
|
dxr = x - rightBreakPoint(node, directrix); |
|
if (dxr > _Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"]) { |
|
if (!node.R) { |
|
lArc = node; |
|
break; |
|
} |
|
node = node.R; |
|
} else { |
|
if (dxl > -_Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"]) { |
|
lArc = node.P; |
|
rArc = node; |
|
} else if (dxr > -_Diagram__WEBPACK_IMPORTED_MODULE_4__["epsilon"]) { |
|
lArc = node; |
|
rArc = node.N; |
|
} else { |
|
lArc = rArc = node; |
|
} |
|
break; |
|
} |
|
} |
|
} |
|
|
|
Object(_Cell__WEBPACK_IMPORTED_MODULE_1__["createCell"])(site); |
|
var newArc = createBeach(site); |
|
_Diagram__WEBPACK_IMPORTED_MODULE_4__["beaches"].insert(lArc, newArc); |
|
|
|
if (!lArc && !rArc) return; |
|
|
|
if (lArc === rArc) { |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["detachCircle"])(lArc); |
|
rArc = createBeach(lArc.site); |
|
_Diagram__WEBPACK_IMPORTED_MODULE_4__["beaches"].insert(newArc, rArc); |
|
newArc.edge = rArc.edge = Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["createEdge"])(lArc.site, newArc.site); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["attachCircle"])(lArc); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["attachCircle"])(rArc); |
|
return; |
|
} |
|
|
|
if (!rArc) { // && lArc |
|
newArc.edge = Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["createEdge"])(lArc.site, newArc.site); |
|
return; |
|
} |
|
|
|
// else lArc !== rArc |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["detachCircle"])(lArc); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["detachCircle"])(rArc); |
|
|
|
var lSite = lArc.site, |
|
ax = lSite[0], |
|
ay = lSite[1], |
|
bx = site[0] - ax, |
|
by = site[1] - ay, |
|
rSite = rArc.site, |
|
cx = rSite[0] - ax, |
|
cy = rSite[1] - ay, |
|
d = 2 * (bx * cy - by * cx), |
|
hb = bx * bx + by * by, |
|
hc = cx * cx + cy * cy, |
|
vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay]; |
|
|
|
Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["setEdgeEnd"])(rArc.edge, lSite, rSite, vertex); |
|
newArc.edge = Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["createEdge"])(lSite, site, null, vertex); |
|
rArc.edge = Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["createEdge"])(site, rSite, null, vertex); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["attachCircle"])(lArc); |
|
Object(_Circle__WEBPACK_IMPORTED_MODULE_2__["attachCircle"])(rArc); |
|
} |
|
|
|
function leftBreakPoint(arc, directrix) { |
|
var site = arc.site, |
|
rfocx = site[0], |
|
rfocy = site[1], |
|
pby2 = rfocy - directrix; |
|
|
|
if (!pby2) return rfocx; |
|
|
|
var lArc = arc.P; |
|
if (!lArc) return -Infinity; |
|
|
|
site = lArc.site; |
|
var lfocx = site[0], |
|
lfocy = site[1], |
|
plby2 = lfocy - directrix; |
|
|
|
if (!plby2) return lfocx; |
|
|
|
var hl = lfocx - rfocx, |
|
aby2 = 1 / pby2 - 1 / plby2, |
|
b = hl / plby2; |
|
|
|
if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; |
|
|
|
return (rfocx + lfocx) / 2; |
|
} |
|
|
|
function rightBreakPoint(arc, directrix) { |
|
var rArc = arc.N; |
|
if (rArc) return leftBreakPoint(rArc, directrix); |
|
var site = arc.site; |
|
return site[1] === directrix ? site[0] : Infinity; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/Cell.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/Cell.js ***! |
|
\**********************************************/ |
|
/*! exports provided: createCell, cellHalfedgeStart, cellHalfedgeEnd, sortCellHalfedges, clipCells */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCell", function() { return createCell; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellHalfedgeStart", function() { return cellHalfedgeStart; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cellHalfedgeEnd", function() { return cellHalfedgeEnd; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortCellHalfedges", function() { return sortCellHalfedges; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clipCells", function() { return clipCells; }); |
|
/* harmony import */ var _Edge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Edge */ "../node_modules/d3-voronoi/src/Edge.js"); |
|
/* harmony import */ var _Diagram__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Diagram */ "../node_modules/d3-voronoi/src/Diagram.js"); |
|
|
|
|
|
|
|
function createCell(site) { |
|
return _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"][site.index] = { |
|
site: site, |
|
halfedges: [] |
|
}; |
|
} |
|
|
|
function cellHalfedgeAngle(cell, edge) { |
|
var site = cell.site, |
|
va = edge.left, |
|
vb = edge.right; |
|
if (site === vb) vb = va, va = site; |
|
if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]); |
|
if (site === va) va = edge[1], vb = edge[0]; |
|
else va = edge[0], vb = edge[1]; |
|
return Math.atan2(va[0] - vb[0], vb[1] - va[1]); |
|
} |
|
|
|
function cellHalfedgeStart(cell, edge) { |
|
return edge[+(edge.left !== cell.site)]; |
|
} |
|
|
|
function cellHalfedgeEnd(cell, edge) { |
|
return edge[+(edge.left === cell.site)]; |
|
} |
|
|
|
function sortCellHalfedges() { |
|
for (var i = 0, n = _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"].length, cell, halfedges, j, m; i < n; ++i) { |
|
if ((cell = _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"][i]) && (m = (halfedges = cell.halfedges).length)) { |
|
var index = new Array(m), |
|
array = new Array(m); |
|
for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, _Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"][halfedges[j]]); |
|
index.sort(function(i, j) { return array[j] - array[i]; }); |
|
for (j = 0; j < m; ++j) array[j] = halfedges[index[j]]; |
|
for (j = 0; j < m; ++j) halfedges[j] = array[j]; |
|
} |
|
} |
|
} |
|
|
|
function clipCells(x0, y0, x1, y1) { |
|
var nCells = _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"].length, |
|
iCell, |
|
cell, |
|
site, |
|
iHalfedge, |
|
halfedges, |
|
nHalfedges, |
|
start, |
|
startX, |
|
startY, |
|
end, |
|
endX, |
|
endY, |
|
cover = true; |
|
|
|
for (iCell = 0; iCell < nCells; ++iCell) { |
|
if (cell = _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"][iCell]) { |
|
site = cell.site; |
|
halfedges = cell.halfedges; |
|
iHalfedge = halfedges.length; |
|
|
|
// Remove any dangling clipped edges. |
|
while (iHalfedge--) { |
|
if (!_Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"][halfedges[iHalfedge]]) { |
|
halfedges.splice(iHalfedge, 1); |
|
} |
|
} |
|
|
|
// Insert any border edges as necessary. |
|
iHalfedge = 0, nHalfedges = halfedges.length; |
|
while (iHalfedge < nHalfedges) { |
|
end = cellHalfedgeEnd(cell, _Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"][halfedges[iHalfedge]]), endX = end[0], endY = end[1]; |
|
start = cellHalfedgeStart(cell, _Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"][halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1]; |
|
if (Math.abs(endX - startX) > _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] || Math.abs(endY - startY) > _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"]) { |
|
halfedges.splice(iHalfedge, 0, _Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"].push(Object(_Edge__WEBPACK_IMPORTED_MODULE_0__["createBorderEdge"])(site, end, |
|
Math.abs(endX - x0) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] && y1 - endY > _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? [x0, Math.abs(startX - x0) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? startY : y1] |
|
: Math.abs(endY - y1) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] && x1 - endX > _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? [Math.abs(startY - y1) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? startX : x1, y1] |
|
: Math.abs(endX - x1) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] && endY - y0 > _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? [x1, Math.abs(startX - x1) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? startY : y0] |
|
: Math.abs(endY - y0) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] && endX - x0 > _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? [Math.abs(startY - y0) < _Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon"] ? startX : x0, y0] |
|
: null)) - 1); |
|
++nHalfedges; |
|
} |
|
} |
|
|
|
if (nHalfedges) cover = false; |
|
} |
|
} |
|
|
|
// If there weren’t any edges, have the closest site cover the extent. |
|
// It doesn’t matter which corner of the extent we measure! |
|
if (cover) { |
|
var dx, dy, d2, dc = Infinity; |
|
|
|
for (iCell = 0, cover = null; iCell < nCells; ++iCell) { |
|
if (cell = _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"][iCell]) { |
|
site = cell.site; |
|
dx = site[0] - x0; |
|
dy = site[1] - y0; |
|
d2 = dx * dx + dy * dy; |
|
if (d2 < dc) dc = d2, cover = cell; |
|
} |
|
} |
|
|
|
if (cover) { |
|
var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0]; |
|
cover.halfedges.push( |
|
_Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"].push(Object(_Edge__WEBPACK_IMPORTED_MODULE_0__["createBorderEdge"])(site = cover.site, v00, v01)) - 1, |
|
_Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"].push(Object(_Edge__WEBPACK_IMPORTED_MODULE_0__["createBorderEdge"])(site, v01, v11)) - 1, |
|
_Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"].push(Object(_Edge__WEBPACK_IMPORTED_MODULE_0__["createBorderEdge"])(site, v11, v10)) - 1, |
|
_Diagram__WEBPACK_IMPORTED_MODULE_1__["edges"].push(Object(_Edge__WEBPACK_IMPORTED_MODULE_0__["createBorderEdge"])(site, v10, v00)) - 1 |
|
); |
|
} |
|
} |
|
|
|
// Lastly delete any cells with no edges; these were entirely clipped. |
|
for (iCell = 0; iCell < nCells; ++iCell) { |
|
if (cell = _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"][iCell]) { |
|
if (!cell.halfedges.length) { |
|
delete _Diagram__WEBPACK_IMPORTED_MODULE_1__["cells"][iCell]; |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/Circle.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/Circle.js ***! |
|
\************************************************/ |
|
/*! exports provided: firstCircle, attachCircle, detachCircle */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstCircle", function() { return firstCircle; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attachCircle", function() { return attachCircle; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detachCircle", function() { return detachCircle; }); |
|
/* harmony import */ var _RedBlackTree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RedBlackTree */ "../node_modules/d3-voronoi/src/RedBlackTree.js"); |
|
/* harmony import */ var _Diagram__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Diagram */ "../node_modules/d3-voronoi/src/Diagram.js"); |
|
|
|
|
|
|
|
var circlePool = []; |
|
|
|
var firstCircle; |
|
|
|
function Circle() { |
|
Object(_RedBlackTree__WEBPACK_IMPORTED_MODULE_0__["RedBlackNode"])(this); |
|
this.x = |
|
this.y = |
|
this.arc = |
|
this.site = |
|
this.cy = null; |
|
} |
|
|
|
function attachCircle(arc) { |
|
var lArc = arc.P, |
|
rArc = arc.N; |
|
|
|
if (!lArc || !rArc) return; |
|
|
|
var lSite = lArc.site, |
|
cSite = arc.site, |
|
rSite = rArc.site; |
|
|
|
if (lSite === rSite) return; |
|
|
|
var bx = cSite[0], |
|
by = cSite[1], |
|
ax = lSite[0] - bx, |
|
ay = lSite[1] - by, |
|
cx = rSite[0] - bx, |
|
cy = rSite[1] - by; |
|
|
|
var d = 2 * (ax * cy - ay * cx); |
|
if (d >= -_Diagram__WEBPACK_IMPORTED_MODULE_1__["epsilon2"]) return; |
|
|
|
var ha = ax * ax + ay * ay, |
|
hc = cx * cx + cy * cy, |
|
x = (cy * ha - ay * hc) / d, |
|
y = (ax * hc - cx * ha) / d; |
|
|
|
var circle = circlePool.pop() || new Circle; |
|
circle.arc = arc; |
|
circle.site = cSite; |
|
circle.x = x + bx; |
|
circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom |
|
|
|
arc.circle = circle; |
|
|
|
var before = null, |
|
node = _Diagram__WEBPACK_IMPORTED_MODULE_1__["circles"]._; |
|
|
|
while (node) { |
|
if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) { |
|
if (node.L) node = node.L; |
|
else { before = node.P; break; } |
|
} else { |
|
if (node.R) node = node.R; |
|
else { before = node; break; } |
|
} |
|
} |
|
|
|
_Diagram__WEBPACK_IMPORTED_MODULE_1__["circles"].insert(before, circle); |
|
if (!before) firstCircle = circle; |
|
} |
|
|
|
function detachCircle(arc) { |
|
var circle = arc.circle; |
|
if (circle) { |
|
if (!circle.P) firstCircle = circle.N; |
|
_Diagram__WEBPACK_IMPORTED_MODULE_1__["circles"].remove(circle); |
|
circlePool.push(circle); |
|
Object(_RedBlackTree__WEBPACK_IMPORTED_MODULE_0__["RedBlackNode"])(circle); |
|
arc.circle = null; |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/Diagram.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/Diagram.js ***! |
|
\*************************************************/ |
|
/*! exports provided: epsilon, epsilon2, beaches, cells, circles, edges, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epsilon", function() { return epsilon; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "epsilon2", function() { return epsilon2; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "beaches", function() { return beaches; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cells", function() { return cells; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "circles", function() { return circles; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "edges", function() { return edges; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Diagram; }); |
|
/* harmony import */ var _Beach__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Beach */ "../node_modules/d3-voronoi/src/Beach.js"); |
|
/* harmony import */ var _Cell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Cell */ "../node_modules/d3-voronoi/src/Cell.js"); |
|
/* harmony import */ var _Circle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Circle */ "../node_modules/d3-voronoi/src/Circle.js"); |
|
/* harmony import */ var _Edge__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Edge */ "../node_modules/d3-voronoi/src/Edge.js"); |
|
/* harmony import */ var _RedBlackTree__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RedBlackTree */ "../node_modules/d3-voronoi/src/RedBlackTree.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
var epsilon = 1e-6; |
|
var epsilon2 = 1e-12; |
|
var beaches; |
|
var cells; |
|
var circles; |
|
var edges; |
|
|
|
function triangleArea(a, b, c) { |
|
return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]); |
|
} |
|
|
|
function lexicographic(a, b) { |
|
return b[1] - a[1] |
|
|| b[0] - a[0]; |
|
} |
|
|
|
function Diagram(sites, extent) { |
|
var site = sites.sort(lexicographic).pop(), |
|
x, |
|
y, |
|
circle; |
|
|
|
edges = []; |
|
cells = new Array(sites.length); |
|
beaches = new _RedBlackTree__WEBPACK_IMPORTED_MODULE_4__["default"]; |
|
circles = new _RedBlackTree__WEBPACK_IMPORTED_MODULE_4__["default"]; |
|
|
|
while (true) { |
|
circle = _Circle__WEBPACK_IMPORTED_MODULE_2__["firstCircle"]; |
|
if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) { |
|
if (site[0] !== x || site[1] !== y) { |
|
Object(_Beach__WEBPACK_IMPORTED_MODULE_0__["addBeach"])(site); |
|
x = site[0], y = site[1]; |
|
} |
|
site = sites.pop(); |
|
} else if (circle) { |
|
Object(_Beach__WEBPACK_IMPORTED_MODULE_0__["removeBeach"])(circle.arc); |
|
} else { |
|
break; |
|
} |
|
} |
|
|
|
Object(_Cell__WEBPACK_IMPORTED_MODULE_1__["sortCellHalfedges"])(); |
|
|
|
if (extent) { |
|
var x0 = +extent[0][0], |
|
y0 = +extent[0][1], |
|
x1 = +extent[1][0], |
|
y1 = +extent[1][1]; |
|
Object(_Edge__WEBPACK_IMPORTED_MODULE_3__["clipEdges"])(x0, y0, x1, y1); |
|
Object(_Cell__WEBPACK_IMPORTED_MODULE_1__["clipCells"])(x0, y0, x1, y1); |
|
} |
|
|
|
this.edges = edges; |
|
this.cells = cells; |
|
|
|
beaches = |
|
circles = |
|
edges = |
|
cells = null; |
|
} |
|
|
|
Diagram.prototype = { |
|
constructor: Diagram, |
|
|
|
polygons: function() { |
|
var edges = this.edges; |
|
|
|
return this.cells.map(function(cell) { |
|
var polygon = cell.halfedges.map(function(i) { return Object(_Cell__WEBPACK_IMPORTED_MODULE_1__["cellHalfedgeStart"])(cell, edges[i]); }); |
|
polygon.data = cell.site.data; |
|
return polygon; |
|
}); |
|
}, |
|
|
|
triangles: function() { |
|
var triangles = [], |
|
edges = this.edges; |
|
|
|
this.cells.forEach(function(cell, i) { |
|
if (!(m = (halfedges = cell.halfedges).length)) return; |
|
var site = cell.site, |
|
halfedges, |
|
j = -1, |
|
m, |
|
s0, |
|
e1 = edges[halfedges[m - 1]], |
|
s1 = e1.left === site ? e1.right : e1.left; |
|
|
|
while (++j < m) { |
|
s0 = s1; |
|
e1 = edges[halfedges[j]]; |
|
s1 = e1.left === site ? e1.right : e1.left; |
|
if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) { |
|
triangles.push([site.data, s0.data, s1.data]); |
|
} |
|
} |
|
}); |
|
|
|
return triangles; |
|
}, |
|
|
|
links: function() { |
|
return this.edges.filter(function(edge) { |
|
return edge.right; |
|
}).map(function(edge) { |
|
return { |
|
source: edge.left.data, |
|
target: edge.right.data |
|
}; |
|
}); |
|
}, |
|
|
|
find: function(x, y, radius) { |
|
var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell; |
|
|
|
// Use the previously-found cell, or start with an arbitrary one. |
|
while (!(cell = that.cells[i1])) if (++i1 >= n) return null; |
|
var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy; |
|
|
|
// Traverse the half-edges to find a closer cell, if any. |
|
do { |
|
cell = that.cells[i0 = i1], i1 = null; |
|
cell.halfedges.forEach(function(e) { |
|
var edge = that.edges[e], v = edge.left; |
|
if ((v === cell.site || !v) && !(v = edge.right)) return; |
|
var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy; |
|
if (v2 < d2) d2 = v2, i1 = v.index; |
|
}); |
|
} while (i1 !== null); |
|
|
|
that._found = i0; |
|
|
|
return radius == null || d2 <= radius * radius ? cell.site : null; |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/Edge.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/Edge.js ***! |
|
\**********************************************/ |
|
/*! exports provided: createEdge, createBorderEdge, setEdgeEnd, clipEdges */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEdge", function() { return createEdge; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBorderEdge", function() { return createBorderEdge; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setEdgeEnd", function() { return setEdgeEnd; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clipEdges", function() { return clipEdges; }); |
|
/* harmony import */ var _Diagram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Diagram */ "../node_modules/d3-voronoi/src/Diagram.js"); |
|
|
|
|
|
function createEdge(left, right, v0, v1) { |
|
var edge = [null, null], |
|
index = _Diagram__WEBPACK_IMPORTED_MODULE_0__["edges"].push(edge) - 1; |
|
edge.left = left; |
|
edge.right = right; |
|
if (v0) setEdgeEnd(edge, left, right, v0); |
|
if (v1) setEdgeEnd(edge, right, left, v1); |
|
_Diagram__WEBPACK_IMPORTED_MODULE_0__["cells"][left.index].halfedges.push(index); |
|
_Diagram__WEBPACK_IMPORTED_MODULE_0__["cells"][right.index].halfedges.push(index); |
|
return edge; |
|
} |
|
|
|
function createBorderEdge(left, v0, v1) { |
|
var edge = [v0, v1]; |
|
edge.left = left; |
|
return edge; |
|
} |
|
|
|
function setEdgeEnd(edge, left, right, vertex) { |
|
if (!edge[0] && !edge[1]) { |
|
edge[0] = vertex; |
|
edge.left = left; |
|
edge.right = right; |
|
} else if (edge.left === right) { |
|
edge[1] = vertex; |
|
} else { |
|
edge[0] = vertex; |
|
} |
|
} |
|
|
|
// Liang–Barsky line clipping. |
|
function clipEdge(edge, x0, y0, x1, y1) { |
|
var a = edge[0], |
|
b = edge[1], |
|
ax = a[0], |
|
ay = a[1], |
|
bx = b[0], |
|
by = b[1], |
|
t0 = 0, |
|
t1 = 1, |
|
dx = bx - ax, |
|
dy = by - ay, |
|
r; |
|
|
|
r = x0 - ax; |
|
if (!dx && r > 0) return; |
|
r /= dx; |
|
if (dx < 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} else if (dx > 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} |
|
|
|
r = x1 - ax; |
|
if (!dx && r < 0) return; |
|
r /= dx; |
|
if (dx < 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} else if (dx > 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} |
|
|
|
r = y0 - ay; |
|
if (!dy && r > 0) return; |
|
r /= dy; |
|
if (dy < 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} else if (dy > 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} |
|
|
|
r = y1 - ay; |
|
if (!dy && r < 0) return; |
|
r /= dy; |
|
if (dy < 0) { |
|
if (r > t1) return; |
|
if (r > t0) t0 = r; |
|
} else if (dy > 0) { |
|
if (r < t0) return; |
|
if (r < t1) t1 = r; |
|
} |
|
|
|
if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check? |
|
|
|
if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy]; |
|
if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy]; |
|
return true; |
|
} |
|
|
|
function connectEdge(edge, x0, y0, x1, y1) { |
|
var v1 = edge[1]; |
|
if (v1) return true; |
|
|
|
var v0 = edge[0], |
|
left = edge.left, |
|
right = edge.right, |
|
lx = left[0], |
|
ly = left[1], |
|
rx = right[0], |
|
ry = right[1], |
|
fx = (lx + rx) / 2, |
|
fy = (ly + ry) / 2, |
|
fm, |
|
fb; |
|
|
|
if (ry === ly) { |
|
if (fx < x0 || fx >= x1) return; |
|
if (lx > rx) { |
|
if (!v0) v0 = [fx, y0]; |
|
else if (v0[1] >= y1) return; |
|
v1 = [fx, y1]; |
|
} else { |
|
if (!v0) v0 = [fx, y1]; |
|
else if (v0[1] < y0) return; |
|
v1 = [fx, y0]; |
|
} |
|
} else { |
|
fm = (lx - rx) / (ry - ly); |
|
fb = fy - fm * fx; |
|
if (fm < -1 || fm > 1) { |
|
if (lx > rx) { |
|
if (!v0) v0 = [(y0 - fb) / fm, y0]; |
|
else if (v0[1] >= y1) return; |
|
v1 = [(y1 - fb) / fm, y1]; |
|
} else { |
|
if (!v0) v0 = [(y1 - fb) / fm, y1]; |
|
else if (v0[1] < y0) return; |
|
v1 = [(y0 - fb) / fm, y0]; |
|
} |
|
} else { |
|
if (ly < ry) { |
|
if (!v0) v0 = [x0, fm * x0 + fb]; |
|
else if (v0[0] >= x1) return; |
|
v1 = [x1, fm * x1 + fb]; |
|
} else { |
|
if (!v0) v0 = [x1, fm * x1 + fb]; |
|
else if (v0[0] < x0) return; |
|
v1 = [x0, fm * x0 + fb]; |
|
} |
|
} |
|
} |
|
|
|
edge[0] = v0; |
|
edge[1] = v1; |
|
return true; |
|
} |
|
|
|
function clipEdges(x0, y0, x1, y1) { |
|
var i = _Diagram__WEBPACK_IMPORTED_MODULE_0__["edges"].length, |
|
edge; |
|
|
|
while (i--) { |
|
if (!connectEdge(edge = _Diagram__WEBPACK_IMPORTED_MODULE_0__["edges"][i], x0, y0, x1, y1) |
|
|| !clipEdge(edge, x0, y0, x1, y1) |
|
|| !(Math.abs(edge[0][0] - edge[1][0]) > _Diagram__WEBPACK_IMPORTED_MODULE_0__["epsilon"] |
|
|| Math.abs(edge[0][1] - edge[1][1]) > _Diagram__WEBPACK_IMPORTED_MODULE_0__["epsilon"])) { |
|
delete _Diagram__WEBPACK_IMPORTED_MODULE_0__["edges"][i]; |
|
} |
|
} |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/RedBlackTree.js": |
|
/*!******************************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/RedBlackTree.js ***! |
|
\******************************************************/ |
|
/*! exports provided: RedBlackNode, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RedBlackNode", function() { return RedBlackNode; }); |
|
function RedBlackTree() { |
|
this._ = null; // root node |
|
} |
|
|
|
function RedBlackNode(node) { |
|
node.U = // parent node |
|
node.C = // color - true for red, false for black |
|
node.L = // left node |
|
node.R = // right node |
|
node.P = // previous node |
|
node.N = null; // next node |
|
} |
|
|
|
RedBlackTree.prototype = { |
|
constructor: RedBlackTree, |
|
|
|
insert: function(after, node) { |
|
var parent, grandpa, uncle; |
|
|
|
if (after) { |
|
node.P = after; |
|
node.N = after.N; |
|
if (after.N) after.N.P = node; |
|
after.N = node; |
|
if (after.R) { |
|
after = after.R; |
|
while (after.L) after = after.L; |
|
after.L = node; |
|
} else { |
|
after.R = node; |
|
} |
|
parent = after; |
|
} else if (this._) { |
|
after = RedBlackFirst(this._); |
|
node.P = null; |
|
node.N = after; |
|
after.P = after.L = node; |
|
parent = after; |
|
} else { |
|
node.P = node.N = null; |
|
this._ = node; |
|
parent = null; |
|
} |
|
node.L = node.R = null; |
|
node.U = parent; |
|
node.C = true; |
|
|
|
after = node; |
|
while (parent && parent.C) { |
|
grandpa = parent.U; |
|
if (parent === grandpa.L) { |
|
uncle = grandpa.R; |
|
if (uncle && uncle.C) { |
|
parent.C = uncle.C = false; |
|
grandpa.C = true; |
|
after = grandpa; |
|
} else { |
|
if (after === parent.R) { |
|
RedBlackRotateLeft(this, parent); |
|
after = parent; |
|
parent = after.U; |
|
} |
|
parent.C = false; |
|
grandpa.C = true; |
|
RedBlackRotateRight(this, grandpa); |
|
} |
|
} else { |
|
uncle = grandpa.L; |
|
if (uncle && uncle.C) { |
|
parent.C = uncle.C = false; |
|
grandpa.C = true; |
|
after = grandpa; |
|
} else { |
|
if (after === parent.L) { |
|
RedBlackRotateRight(this, parent); |
|
after = parent; |
|
parent = after.U; |
|
} |
|
parent.C = false; |
|
grandpa.C = true; |
|
RedBlackRotateLeft(this, grandpa); |
|
} |
|
} |
|
parent = after.U; |
|
} |
|
this._.C = false; |
|
}, |
|
|
|
remove: function(node) { |
|
if (node.N) node.N.P = node.P; |
|
if (node.P) node.P.N = node.N; |
|
node.N = node.P = null; |
|
|
|
var parent = node.U, |
|
sibling, |
|
left = node.L, |
|
right = node.R, |
|
next, |
|
red; |
|
|
|
if (!left) next = right; |
|
else if (!right) next = left; |
|
else next = RedBlackFirst(right); |
|
|
|
if (parent) { |
|
if (parent.L === node) parent.L = next; |
|
else parent.R = next; |
|
} else { |
|
this._ = next; |
|
} |
|
|
|
if (left && right) { |
|
red = next.C; |
|
next.C = node.C; |
|
next.L = left; |
|
left.U = next; |
|
if (next !== right) { |
|
parent = next.U; |
|
next.U = node.U; |
|
node = next.R; |
|
parent.L = node; |
|
next.R = right; |
|
right.U = next; |
|
} else { |
|
next.U = parent; |
|
parent = next; |
|
node = next.R; |
|
} |
|
} else { |
|
red = node.C; |
|
node = next; |
|
} |
|
|
|
if (node) node.U = parent; |
|
if (red) return; |
|
if (node && node.C) { node.C = false; return; } |
|
|
|
do { |
|
if (node === this._) break; |
|
if (node === parent.L) { |
|
sibling = parent.R; |
|
if (sibling.C) { |
|
sibling.C = false; |
|
parent.C = true; |
|
RedBlackRotateLeft(this, parent); |
|
sibling = parent.R; |
|
} |
|
if ((sibling.L && sibling.L.C) |
|
|| (sibling.R && sibling.R.C)) { |
|
if (!sibling.R || !sibling.R.C) { |
|
sibling.L.C = false; |
|
sibling.C = true; |
|
RedBlackRotateRight(this, sibling); |
|
sibling = parent.R; |
|
} |
|
sibling.C = parent.C; |
|
parent.C = sibling.R.C = false; |
|
RedBlackRotateLeft(this, parent); |
|
node = this._; |
|
break; |
|
} |
|
} else { |
|
sibling = parent.L; |
|
if (sibling.C) { |
|
sibling.C = false; |
|
parent.C = true; |
|
RedBlackRotateRight(this, parent); |
|
sibling = parent.L; |
|
} |
|
if ((sibling.L && sibling.L.C) |
|
|| (sibling.R && sibling.R.C)) { |
|
if (!sibling.L || !sibling.L.C) { |
|
sibling.R.C = false; |
|
sibling.C = true; |
|
RedBlackRotateLeft(this, sibling); |
|
sibling = parent.L; |
|
} |
|
sibling.C = parent.C; |
|
parent.C = sibling.L.C = false; |
|
RedBlackRotateRight(this, parent); |
|
node = this._; |
|
break; |
|
} |
|
} |
|
sibling.C = true; |
|
node = parent; |
|
parent = parent.U; |
|
} while (!node.C); |
|
|
|
if (node) node.C = false; |
|
} |
|
}; |
|
|
|
function RedBlackRotateLeft(tree, node) { |
|
var p = node, |
|
q = node.R, |
|
parent = p.U; |
|
|
|
if (parent) { |
|
if (parent.L === p) parent.L = q; |
|
else parent.R = q; |
|
} else { |
|
tree._ = q; |
|
} |
|
|
|
q.U = parent; |
|
p.U = q; |
|
p.R = q.L; |
|
if (p.R) p.R.U = p; |
|
q.L = p; |
|
} |
|
|
|
function RedBlackRotateRight(tree, node) { |
|
var p = node, |
|
q = node.L, |
|
parent = p.U; |
|
|
|
if (parent) { |
|
if (parent.L === p) parent.L = q; |
|
else parent.R = q; |
|
} else { |
|
tree._ = q; |
|
} |
|
|
|
q.U = parent; |
|
p.U = q; |
|
p.L = q.R; |
|
if (p.L) p.L.U = p; |
|
q.R = p; |
|
} |
|
|
|
function RedBlackFirst(node) { |
|
while (node.L) node = node.L; |
|
return node; |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (RedBlackTree); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/constant.js": |
|
/*!**************************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/constant.js ***! |
|
\**************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/index.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/index.js ***! |
|
\***********************************************/ |
|
/*! exports provided: voronoi */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _voronoi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./voronoi */ "../node_modules/d3-voronoi/src/voronoi.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "voronoi", function() { return _voronoi__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/point.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/point.js ***! |
|
\***********************************************/ |
|
/*! exports provided: x, y */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return x; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return y; }); |
|
function x(d) { |
|
return d[0]; |
|
} |
|
|
|
function y(d) { |
|
return d[1]; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-voronoi/src/voronoi.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/d3-voronoi/src/voronoi.js ***! |
|
\*************************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant */ "../node_modules/d3-voronoi/src/constant.js"); |
|
/* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./point */ "../node_modules/d3-voronoi/src/point.js"); |
|
/* harmony import */ var _Diagram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Diagram */ "../node_modules/d3-voronoi/src/Diagram.js"); |
|
|
|
|
|
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var x = _point__WEBPACK_IMPORTED_MODULE_1__["x"], |
|
y = _point__WEBPACK_IMPORTED_MODULE_1__["y"], |
|
extent = null; |
|
|
|
function voronoi(data) { |
|
return new _Diagram__WEBPACK_IMPORTED_MODULE_2__["default"](data.map(function(d, i) { |
|
var s = [Math.round(x(d, i, data) / _Diagram__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) * _Diagram__WEBPACK_IMPORTED_MODULE_2__["epsilon"], Math.round(y(d, i, data) / _Diagram__WEBPACK_IMPORTED_MODULE_2__["epsilon"]) * _Diagram__WEBPACK_IMPORTED_MODULE_2__["epsilon"]]; |
|
s.index = i; |
|
s.data = d; |
|
return s; |
|
}), extent); |
|
} |
|
|
|
voronoi.polygons = function(data) { |
|
return voronoi(data).polygons(); |
|
}; |
|
|
|
voronoi.links = function(data) { |
|
return voronoi(data).links(); |
|
}; |
|
|
|
voronoi.triangles = function(data) { |
|
return voronoi(data).triangles(); |
|
}; |
|
|
|
voronoi.x = function(_) { |
|
return arguments.length ? (x = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), voronoi) : x; |
|
}; |
|
|
|
voronoi.y = function(_) { |
|
return arguments.length ? (y = typeof _ === "function" ? _ : Object(_constant__WEBPACK_IMPORTED_MODULE_0__["default"])(+_), voronoi) : y; |
|
}; |
|
|
|
voronoi.extent = function(_) { |
|
return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]]; |
|
}; |
|
|
|
voronoi.size = function(_) { |
|
return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]]; |
|
}; |
|
|
|
return voronoi; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-zoom/src/constant.js": |
|
/*!***********************************************!*\ |
|
!*** ../node_modules/d3-zoom/src/constant.js ***! |
|
\***********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony default export */ __webpack_exports__["default"] = (function(x) { |
|
return function() { |
|
return x; |
|
}; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-zoom/src/event.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-zoom/src/event.js ***! |
|
\********************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ZoomEvent; }); |
|
function ZoomEvent(target, type, transform) { |
|
this.target = target; |
|
this.type = type; |
|
this.transform = transform; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-zoom/src/index.js": |
|
/*!********************************************!*\ |
|
!*** ../node_modules/d3-zoom/src/index.js ***! |
|
\********************************************/ |
|
/*! exports provided: zoom, zoomTransform, zoomIdentity */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./zoom.js */ "../node_modules/d3-zoom/src/zoom.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zoom", function() { return _zoom_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
|
|
|
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transform.js */ "../node_modules/d3-zoom/src/transform.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zoomTransform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_1__["default"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zoomIdentity", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_1__["identity"]; }); |
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-zoom/src/noevent.js": |
|
/*!**********************************************!*\ |
|
!*** ../node_modules/d3-zoom/src/noevent.js ***! |
|
\**********************************************/ |
|
/*! exports provided: nopropagation, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nopropagation", function() { return nopropagation; }); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
|
|
|
|
function nopropagation() { |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].stopImmediatePropagation(); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].preventDefault(); |
|
d3_selection__WEBPACK_IMPORTED_MODULE_0__["event"].stopImmediatePropagation(); |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-zoom/src/transform.js": |
|
/*!************************************************!*\ |
|
!*** ../node_modules/d3-zoom/src/transform.js ***! |
|
\************************************************/ |
|
/*! exports provided: Transform, identity, default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transform", function() { return Transform; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return transform; }); |
|
function Transform(k, x, y) { |
|
this.k = k; |
|
this.x = x; |
|
this.y = y; |
|
} |
|
|
|
Transform.prototype = { |
|
constructor: Transform, |
|
scale: function(k) { |
|
return k === 1 ? this : new Transform(this.k * k, this.x, this.y); |
|
}, |
|
translate: function(x, y) { |
|
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y); |
|
}, |
|
apply: function(point) { |
|
return [point[0] * this.k + this.x, point[1] * this.k + this.y]; |
|
}, |
|
applyX: function(x) { |
|
return x * this.k + this.x; |
|
}, |
|
applyY: function(y) { |
|
return y * this.k + this.y; |
|
}, |
|
invert: function(location) { |
|
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k]; |
|
}, |
|
invertX: function(x) { |
|
return (x - this.x) / this.k; |
|
}, |
|
invertY: function(y) { |
|
return (y - this.y) / this.k; |
|
}, |
|
rescaleX: function(x) { |
|
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x)); |
|
}, |
|
rescaleY: function(y) { |
|
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y)); |
|
}, |
|
toString: function() { |
|
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; |
|
} |
|
}; |
|
|
|
var identity = new Transform(1, 0, 0); |
|
|
|
transform.prototype = Transform.prototype; |
|
|
|
function transform(node) { |
|
while (!node.__zoom) if (!(node = node.parentNode)) return identity; |
|
return node.__zoom; |
|
} |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3-zoom/src/zoom.js": |
|
/*!*******************************************!*\ |
|
!*** ../node_modules/d3-zoom/src/zoom.js ***! |
|
\*******************************************/ |
|
/*! exports provided: default */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ "../node_modules/d3-dispatch/src/index.js"); |
|
/* harmony import */ var d3_drag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-drag */ "../node_modules/d3-drag/src/index.js"); |
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony import */ var d3_transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! d3-transition */ "../node_modules/d3-transition/src/index.js"); |
|
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constant.js */ "../node_modules/d3-zoom/src/constant.js"); |
|
/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./event.js */ "../node_modules/d3-zoom/src/event.js"); |
|
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./transform.js */ "../node_modules/d3-zoom/src/transform.js"); |
|
/* harmony import */ var _noevent_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./noevent.js */ "../node_modules/d3-zoom/src/noevent.js"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Ignore right-click, since that should open the context menu. |
|
function defaultFilter() { |
|
return !d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].ctrlKey && !d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].button; |
|
} |
|
|
|
function defaultExtent() { |
|
var e = this; |
|
if (e instanceof SVGElement) { |
|
e = e.ownerSVGElement || e; |
|
if (e.hasAttribute("viewBox")) { |
|
e = e.viewBox.baseVal; |
|
return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; |
|
} |
|
return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; |
|
} |
|
return [[0, 0], [e.clientWidth, e.clientHeight]]; |
|
} |
|
|
|
function defaultTransform() { |
|
return this.__zoom || _transform_js__WEBPACK_IMPORTED_MODULE_7__["identity"]; |
|
} |
|
|
|
function defaultWheelDelta() { |
|
return -d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].deltaY * (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].deltaMode === 1 ? 0.05 : d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].deltaMode ? 1 : 0.002); |
|
} |
|
|
|
function defaultTouchable() { |
|
return navigator.maxTouchPoints || ("ontouchstart" in this); |
|
} |
|
|
|
function defaultConstrain(transform, extent, translateExtent) { |
|
var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0], |
|
dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0], |
|
dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1], |
|
dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1]; |
|
return transform.translate( |
|
dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), |
|
dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) |
|
); |
|
} |
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (function() { |
|
var filter = defaultFilter, |
|
extent = defaultExtent, |
|
constrain = defaultConstrain, |
|
wheelDelta = defaultWheelDelta, |
|
touchable = defaultTouchable, |
|
scaleExtent = [0, Infinity], |
|
translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], |
|
duration = 250, |
|
interpolate = d3_interpolate__WEBPACK_IMPORTED_MODULE_2__["interpolateZoom"], |
|
listeners = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__["dispatch"])("start", "zoom", "end"), |
|
touchstarting, |
|
touchending, |
|
touchDelay = 500, |
|
wheelDelay = 150, |
|
clickDistance2 = 0; |
|
|
|
function zoom(selection) { |
|
selection |
|
.property("__zoom", defaultTransform) |
|
.on("wheel.zoom", wheeled) |
|
.on("mousedown.zoom", mousedowned) |
|
.on("dblclick.zoom", dblclicked) |
|
.filter(touchable) |
|
.on("touchstart.zoom", touchstarted) |
|
.on("touchmove.zoom", touchmoved) |
|
.on("touchend.zoom touchcancel.zoom", touchended) |
|
.style("touch-action", "none") |
|
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); |
|
} |
|
|
|
zoom.transform = function(collection, transform, point) { |
|
var selection = collection.selection ? collection.selection() : collection; |
|
selection.property("__zoom", defaultTransform); |
|
if (collection !== selection) { |
|
schedule(collection, transform, point); |
|
} else { |
|
selection.interrupt().each(function() { |
|
gesture(this, arguments) |
|
.start() |
|
.zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform) |
|
.end(); |
|
}); |
|
} |
|
}; |
|
|
|
zoom.scaleBy = function(selection, k, p) { |
|
zoom.scaleTo(selection, function() { |
|
var k0 = this.__zoom.k, |
|
k1 = typeof k === "function" ? k.apply(this, arguments) : k; |
|
return k0 * k1; |
|
}, p); |
|
}; |
|
|
|
zoom.scaleTo = function(selection, k, p) { |
|
zoom.transform(selection, function() { |
|
var e = extent.apply(this, arguments), |
|
t0 = this.__zoom, |
|
p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, |
|
p1 = t0.invert(p0), |
|
k1 = typeof k === "function" ? k.apply(this, arguments) : k; |
|
return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); |
|
}, p); |
|
}; |
|
|
|
zoom.translateBy = function(selection, x, y) { |
|
zoom.transform(selection, function() { |
|
return constrain(this.__zoom.translate( |
|
typeof x === "function" ? x.apply(this, arguments) : x, |
|
typeof y === "function" ? y.apply(this, arguments) : y |
|
), extent.apply(this, arguments), translateExtent); |
|
}); |
|
}; |
|
|
|
zoom.translateTo = function(selection, x, y, p) { |
|
zoom.transform(selection, function() { |
|
var e = extent.apply(this, arguments), |
|
t = this.__zoom, |
|
p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; |
|
return constrain(_transform_js__WEBPACK_IMPORTED_MODULE_7__["identity"].translate(p0[0], p0[1]).scale(t.k).translate( |
|
typeof x === "function" ? -x.apply(this, arguments) : -x, |
|
typeof y === "function" ? -y.apply(this, arguments) : -y |
|
), e, translateExtent); |
|
}, p); |
|
}; |
|
|
|
function scale(transform, k) { |
|
k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)); |
|
return k === transform.k ? transform : new _transform_js__WEBPACK_IMPORTED_MODULE_7__["Transform"](k, transform.x, transform.y); |
|
} |
|
|
|
function translate(transform, p0, p1) { |
|
var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k; |
|
return x === transform.x && y === transform.y ? transform : new _transform_js__WEBPACK_IMPORTED_MODULE_7__["Transform"](transform.k, x, y); |
|
} |
|
|
|
function centroid(extent) { |
|
return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; |
|
} |
|
|
|
function schedule(transition, transform, point) { |
|
transition |
|
.on("start.zoom", function() { gesture(this, arguments).start(); }) |
|
.on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); }) |
|
.tween("zoom", function() { |
|
var that = this, |
|
args = arguments, |
|
g = gesture(that, args), |
|
e = extent.apply(that, args), |
|
p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, |
|
w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), |
|
a = that.__zoom, |
|
b = typeof transform === "function" ? transform.apply(that, args) : transform, |
|
i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k)); |
|
return function(t) { |
|
if (t === 1) t = b; // Avoid rounding error on end. |
|
else { var l = i(t), k = w / l[2]; t = new _transform_js__WEBPACK_IMPORTED_MODULE_7__["Transform"](k, p[0] - l[0] * k, p[1] - l[1] * k); } |
|
g.zoom(null, t); |
|
}; |
|
}); |
|
} |
|
|
|
function gesture(that, args, clean) { |
|
return (!clean && that.__zooming) || new Gesture(that, args); |
|
} |
|
|
|
function Gesture(that, args) { |
|
this.that = that; |
|
this.args = args; |
|
this.active = 0; |
|
this.extent = extent.apply(that, args); |
|
this.taps = 0; |
|
} |
|
|
|
Gesture.prototype = { |
|
start: function() { |
|
if (++this.active === 1) { |
|
this.that.__zooming = this; |
|
this.emit("start"); |
|
} |
|
return this; |
|
}, |
|
zoom: function(key, transform) { |
|
if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]); |
|
if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]); |
|
if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]); |
|
this.that.__zoom = transform; |
|
this.emit("zoom"); |
|
return this; |
|
}, |
|
end: function() { |
|
if (--this.active === 0) { |
|
delete this.that.__zooming; |
|
this.emit("end"); |
|
} |
|
return this; |
|
}, |
|
emit: function(type) { |
|
Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["customEvent"])(new _event_js__WEBPACK_IMPORTED_MODULE_6__["default"](zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]); |
|
} |
|
}; |
|
|
|
function wheeled() { |
|
if (!filter.apply(this, arguments)) return; |
|
var g = gesture(this, arguments), |
|
t = this.__zoom, |
|
k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), |
|
p = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["mouse"])(this); |
|
|
|
// If the mouse is in the same location as before, reuse it. |
|
// If there were recent wheel events, reset the wheel idle timeout. |
|
if (g.wheel) { |
|
if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) { |
|
g.mouse[1] = t.invert(g.mouse[0] = p); |
|
} |
|
clearTimeout(g.wheel); |
|
} |
|
|
|
// If this wheel event won’t trigger a transform change, ignore it. |
|
else if (t.k === k) return; |
|
|
|
// Otherwise, capture the mouse point and location at the start. |
|
else { |
|
g.mouse = [p, t.invert(p)]; |
|
Object(d3_transition__WEBPACK_IMPORTED_MODULE_4__["interrupt"])(this); |
|
g.start(); |
|
} |
|
|
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["default"])(); |
|
g.wheel = setTimeout(wheelidled, wheelDelay); |
|
g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent)); |
|
|
|
function wheelidled() { |
|
g.wheel = null; |
|
g.end(); |
|
} |
|
} |
|
|
|
function mousedowned() { |
|
if (touchending || !filter.apply(this, arguments)) return; |
|
var g = gesture(this, arguments, true), |
|
v = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), |
|
p = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["mouse"])(this), |
|
x0 = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].clientX, |
|
y0 = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].clientY; |
|
|
|
Object(d3_drag__WEBPACK_IMPORTED_MODULE_1__["dragDisable"])(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].view); |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["nopropagation"])(); |
|
g.mouse = [p, this.__zoom.invert(p)]; |
|
Object(d3_transition__WEBPACK_IMPORTED_MODULE_4__["interrupt"])(this); |
|
g.start(); |
|
|
|
function mousemoved() { |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["default"])(); |
|
if (!g.moved) { |
|
var dx = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].clientX - x0, dy = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].clientY - y0; |
|
g.moved = dx * dx + dy * dy > clickDistance2; |
|
} |
|
g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["mouse"])(g.that), g.mouse[1]), g.extent, translateExtent)); |
|
} |
|
|
|
function mouseupped() { |
|
v.on("mousemove.zoom mouseup.zoom", null); |
|
Object(d3_drag__WEBPACK_IMPORTED_MODULE_1__["dragEnable"])(d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].view, g.moved); |
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["default"])(); |
|
g.end(); |
|
} |
|
} |
|
|
|
function dblclicked() { |
|
if (!filter.apply(this, arguments)) return; |
|
var t0 = this.__zoom, |
|
p0 = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["mouse"])(this), |
|
p1 = t0.invert(p0), |
|
k1 = t0.k * (d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].shiftKey ? 0.5 : 2), |
|
t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments), translateExtent); |
|
|
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["default"])(); |
|
if (duration > 0) Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(this).transition().duration(duration).call(schedule, t1, p0); |
|
else Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(this).call(zoom.transform, t1); |
|
} |
|
|
|
function touchstarted() { |
|
if (!filter.apply(this, arguments)) return; |
|
var touches = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].touches, |
|
n = touches.length, |
|
g = gesture(this, arguments, d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].changedTouches.length === n), |
|
started, i, t, p; |
|
|
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["nopropagation"])(); |
|
for (i = 0; i < n; ++i) { |
|
t = touches[i], p = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["touch"])(this, touches, t.identifier); |
|
p = [p, this.__zoom.invert(p), t.identifier]; |
|
if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting; |
|
else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; |
|
} |
|
|
|
if (touchstarting) touchstarting = clearTimeout(touchstarting); |
|
|
|
if (started) { |
|
if (g.taps < 2) touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); |
|
Object(d3_transition__WEBPACK_IMPORTED_MODULE_4__["interrupt"])(this); |
|
g.start(); |
|
} |
|
} |
|
|
|
function touchmoved() { |
|
if (!this.__zooming) return; |
|
var g = gesture(this, arguments), |
|
touches = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].changedTouches, |
|
n = touches.length, i, t, p, l; |
|
|
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["default"])(); |
|
if (touchstarting) touchstarting = clearTimeout(touchstarting); |
|
g.taps = 0; |
|
for (i = 0; i < n; ++i) { |
|
t = touches[i], p = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["touch"])(this, touches, t.identifier); |
|
if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p; |
|
else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p; |
|
} |
|
t = g.that.__zoom; |
|
if (g.touch1) { |
|
var p0 = g.touch0[0], l0 = g.touch0[1], |
|
p1 = g.touch1[0], l1 = g.touch1[1], |
|
dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, |
|
dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl; |
|
t = scale(t, Math.sqrt(dp / dl)); |
|
p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2]; |
|
l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2]; |
|
} |
|
else if (g.touch0) p = g.touch0[0], l = g.touch0[1]; |
|
else return; |
|
g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent)); |
|
} |
|
|
|
function touchended() { |
|
if (!this.__zooming) return; |
|
var g = gesture(this, arguments), |
|
touches = d3_selection__WEBPACK_IMPORTED_MODULE_3__["event"].changedTouches, |
|
n = touches.length, i, t; |
|
|
|
Object(_noevent_js__WEBPACK_IMPORTED_MODULE_8__["nopropagation"])(); |
|
if (touchending) clearTimeout(touchending); |
|
touchending = setTimeout(function() { touchending = null; }, touchDelay); |
|
for (i = 0; i < n; ++i) { |
|
t = touches[i]; |
|
if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0; |
|
else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1; |
|
} |
|
if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; |
|
if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]); |
|
else { |
|
g.end(); |
|
// If this was a dbltap, reroute to the (optional) dblclick.zoom handler. |
|
if (g.taps === 2) { |
|
var p = Object(d3_selection__WEBPACK_IMPORTED_MODULE_3__["select"])(this).on("dblclick.zoom"); |
|
if (p) p.apply(this, arguments); |
|
} |
|
} |
|
} |
|
|
|
zoom.wheelDelta = function(_) { |
|
return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])(+_), zoom) : wheelDelta; |
|
}; |
|
|
|
zoom.filter = function(_) { |
|
return arguments.length ? (filter = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])(!!_), zoom) : filter; |
|
}; |
|
|
|
zoom.touchable = function(_) { |
|
return arguments.length ? (touchable = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])(!!_), zoom) : touchable; |
|
}; |
|
|
|
zoom.extent = function(_) { |
|
return arguments.length ? (extent = typeof _ === "function" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_5__["default"])([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent; |
|
}; |
|
|
|
zoom.scaleExtent = function(_) { |
|
return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]]; |
|
}; |
|
|
|
zoom.translateExtent = function(_) { |
|
return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]]; |
|
}; |
|
|
|
zoom.constrain = function(_) { |
|
return arguments.length ? (constrain = _, zoom) : constrain; |
|
}; |
|
|
|
zoom.duration = function(_) { |
|
return arguments.length ? (duration = +_, zoom) : duration; |
|
}; |
|
|
|
zoom.interpolate = function(_) { |
|
return arguments.length ? (interpolate = _, zoom) : interpolate; |
|
}; |
|
|
|
zoom.on = function() { |
|
var value = listeners.on.apply(listeners, arguments); |
|
return value === listeners ? zoom : value; |
|
}; |
|
|
|
zoom.clickDistance = function(_) { |
|
return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2); |
|
}; |
|
|
|
return zoom; |
|
}); |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3/dist/package.js": |
|
/*!******************************************!*\ |
|
!*** ../node_modules/d3/dist/package.js ***! |
|
\******************************************/ |
|
/*! exports provided: name, version, description, keywords, homepage, license, author, main, unpkg, jsdelivr, module, repository, files, scripts, devDependencies, dependencies */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "name", function() { return name; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "description", function() { return description; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keywords", function() { return keywords; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "homepage", function() { return homepage; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "license", function() { return license; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "author", function() { return author; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "main", function() { return main; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unpkg", function() { return unpkg; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsdelivr", function() { return jsdelivr; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "module", function() { return module; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repository", function() { return repository; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "files", function() { return files; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scripts", function() { return scripts; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "devDependencies", function() { return devDependencies; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dependencies", function() { return dependencies; }); |
|
var name = "d3"; |
|
var version = "5.16.0"; |
|
var description = "Data-Driven Documents"; |
|
var keywords = ["dom","visualization","svg","animation","canvas"]; |
|
var homepage = "https://d3js.org"; |
|
var license = "BSD-3-Clause"; |
|
var author = {"name":"Mike Bostock","url":"https://bost.ocks.org/mike"}; |
|
var main = "dist/d3.node.js"; |
|
var unpkg = "dist/d3.min.js"; |
|
var jsdelivr = "dist/d3.min.js"; |
|
var module = "index.js"; |
|
var repository = {"type":"git","url":"https://github.com/d3/d3.git"}; |
|
var files = ["dist/**/*.js","index.js"]; |
|
var scripts = {"pretest":"rimraf dist && mkdir dist && json2module package.json > dist/package.js && rollup -c","test":"tape 'test/**/*-test.js'","prepublishOnly":"yarn test","postpublish":"git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3/dist/d3.js d3.v5.js && cp ../d3/dist/d3.min.js d3.v5.min.js && git add d3.v5.js d3.v5.min.js && git commit -m \"d3 ${npm_package_version}\" && git push && cd - && cd ../d3-bower && git pull && cp ../d3/LICENSE ../d3/README.md ../d3/dist/d3.js ../d3/dist/d3.min.js . && git add -- LICENSE README.md d3.js d3.min.js && git commit -m \"${npm_package_version}\" && git tag -am \"${npm_package_version}\" v${npm_package_version} && git push && git push --tags && cd - && zip -j dist/d3.zip -- LICENSE README.md API.md CHANGES.md dist/d3.js dist/d3.min.js"}; |
|
var devDependencies = {"json2module":"0.0","rimraf":"2","rollup":"1","rollup-plugin-ascii":"0.0","rollup-plugin-node-resolve":"3","rollup-plugin-terser":"5","tape":"4"}; |
|
var dependencies = {"d3-array":"1","d3-axis":"1","d3-brush":"1","d3-chord":"1","d3-collection":"1","d3-color":"1","d3-contour":"1","d3-dispatch":"1","d3-drag":"1","d3-dsv":"1","d3-ease":"1","d3-fetch":"1","d3-force":"1","d3-format":"1","d3-geo":"1","d3-hierarchy":"1","d3-interpolate":"1","d3-path":"1","d3-polygon":"1","d3-quadtree":"1","d3-random":"1","d3-scale":"2","d3-scale-chromatic":"1","d3-selection":"1","d3-shape":"1","d3-time":"1","d3-time-format":"2","d3-timer":"1","d3-transition":"1","d3-voronoi":"1","d3-zoom":"1"}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/d3/index.js": |
|
/*!***********************************!*\ |
|
!*** ../node_modules/d3/index.js ***! |
|
\***********************************/ |
|
/*! exports provided: version, bisect, bisectRight, bisectLeft, ascending, bisector, cross, descending, deviation, extent, histogram, thresholdFreedmanDiaconis, thresholdScott, thresholdSturges, max, mean, median, merge, min, pairs, permute, quantile, range, scan, shuffle, sum, ticks, tickIncrement, tickStep, transpose, variance, zip, axisTop, axisRight, axisBottom, axisLeft, brush, brushX, brushY, brushSelection, chord, ribbon, nest, set, map, keys, values, entries, color, rgb, hsl, lab, hcl, lch, gray, cubehelix, contours, contourDensity, dispatch, drag, dragDisable, dragEnable, dsvFormat, csvParse, csvParseRows, csvFormat, csvFormatBody, csvFormatRows, csvFormatRow, csvFormatValue, tsvParse, tsvParseRows, tsvFormat, tsvFormatBody, tsvFormatRows, tsvFormatRow, tsvFormatValue, autoType, easeLinear, easeQuad, easeQuadIn, easeQuadOut, easeQuadInOut, easeCubic, easeCubicIn, easeCubicOut, easeCubicInOut, easePoly, easePolyIn, easePolyOut, easePolyInOut, easeSin, easeSinIn, easeSinOut, easeSinInOut, easeExp, easeExpIn, easeExpOut, easeExpInOut, easeCircle, easeCircleIn, easeCircleOut, easeCircleInOut, easeBounce, easeBounceIn, easeBounceOut, easeBounceInOut, easeBack, easeBackIn, easeBackOut, easeBackInOut, easeElastic, easeElasticIn, easeElasticOut, easeElasticInOut, blob, buffer, dsv, csv, tsv, image, json, text, xml, html, svg, forceCenter, forceCollide, forceLink, forceManyBody, forceRadial, forceSimulation, forceX, forceY, formatDefaultLocale, format, formatPrefix, formatLocale, formatSpecifier, FormatSpecifier, precisionFixed, precisionPrefix, precisionRound, geoArea, geoBounds, geoCentroid, geoCircle, geoClipAntimeridian, geoClipCircle, geoClipExtent, geoClipRectangle, geoContains, geoDistance, geoGraticule, geoGraticule10, geoInterpolate, geoLength, geoPath, geoAlbers, geoAlbersUsa, geoAzimuthalEqualArea, geoAzimuthalEqualAreaRaw, geoAzimuthalEquidistant, geoAzimuthalEquidistantRaw, geoConicConformal, geoConicConformalRaw, geoConicEqualArea, geoConicEqualAreaRaw, geoConicEquidistant, geoConicEquidistantRaw, geoEqualEarth, geoEqualEarthRaw, geoEquirectangular, geoEquirectangularRaw, geoGnomonic, geoGnomonicRaw, geoIdentity, geoProjection, geoProjectionMutator, geoMercator, geoMercatorRaw, geoNaturalEarth1, geoNaturalEarth1Raw, geoOrthographic, geoOrthographicRaw, geoStereographic, geoStereographicRaw, geoTransverseMercator, geoTransverseMercatorRaw, geoRotation, geoStream, geoTransform, cluster, hierarchy, pack, packSiblings, packEnclose, partition, stratify, tree, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify, interpolate, interpolateArray, interpolateBasis, interpolateBasisClosed, interpolateDate, interpolateDiscrete, interpolateHue, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateRound, interpolateString, interpolateTransformCss, interpolateTransformSvg, interpolateZoom, interpolateRgb, interpolateRgbBasis, interpolateRgbBasisClosed, interpolateHsl, interpolateHslLong, interpolateLab, interpolateHcl, interpolateHclLong, interpolateCubehelix, interpolateCubehelixLong, piecewise, quantize, path, polygonArea, polygonCentroid, polygonHull, polygonContains, polygonLength, quadtree, randomUniform, randomNormal, randomLogNormal, randomBates, randomIrwinHall, randomExponential, scaleBand, scalePoint, scaleIdentity, scaleLinear, scaleLog, scaleSymlog, scaleOrdinal, scaleImplicit, scalePow, scaleSqrt, scaleQuantile, scaleQuantize, scaleThreshold, scaleTime, scaleUtc, scaleSequential, scaleSequentialLog, scaleSequentialPow, scaleSequentialSqrt, scaleSequentialSymlog, scaleSequentialQuantile, scaleDiverging, scaleDivergingLog, scaleDivergingPow, scaleDivergingSqrt, scaleDivergingSymlog, tickFormat, schemeCategory10, schemeAccent, schemeDark2, schemePaired, schemePastel1, schemePastel2, schemeSet1, schemeSet2, schemeSet3, schemeTableau10, interpolateBrBG, schemeBrBG, interpolatePRGn, schemePRGn, interpolatePiYG, schemePiYG, interpolatePuOr, schemePuOr, interpolateRdBu, schemeRdBu, interpolateRdGy, schemeRdGy, interpolateRdYlBu, schemeRdYlBu, interpolateRdYlGn, schemeRdYlGn, interpolateSpectral, schemeSpectral, interpolateBuGn, schemeBuGn, interpolateBuPu, schemeBuPu, interpolateGnBu, schemeGnBu, interpolateOrRd, schemeOrRd, interpolatePuBuGn, schemePuBuGn, interpolatePuBu, schemePuBu, interpolatePuRd, schemePuRd, interpolateRdPu, schemeRdPu, interpolateYlGnBu, schemeYlGnBu, interpolateYlGn, schemeYlGn, interpolateYlOrBr, schemeYlOrBr, interpolateYlOrRd, schemeYlOrRd, interpolateBlues, schemeBlues, interpolateGreens, schemeGreens, interpolateGreys, schemeGreys, interpolatePurples, schemePurples, interpolateReds, schemeReds, interpolateOranges, schemeOranges, interpolateCividis, interpolateCubehelixDefault, interpolateRainbow, interpolateWarm, interpolateCool, interpolateSinebow, interpolateTurbo, interpolateViridis, interpolateMagma, interpolateInferno, interpolatePlasma, create, creator, local, matcher, mouse, namespace, namespaces, clientPoint, select, selectAll, selection, selector, selectorAll, style, touch, touches, window, event, customEvent, arc, area, line, pie, areaRadial, radialArea, lineRadial, radialLine, pointRadial, linkHorizontal, linkVertical, linkRadial, symbol, symbols, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye, curveBasisClosed, curveBasisOpen, curveBasis, curveBundle, curveCardinalClosed, curveCardinalOpen, curveCardinal, curveCatmullRomClosed, curveCatmullRomOpen, curveCatmullRom, curveLinearClosed, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, stack, stackOffsetExpand, stackOffsetDiverging, stackOffsetNone, stackOffsetSilhouette, stackOffsetWiggle, stackOrderAppearance, stackOrderAscending, stackOrderDescending, stackOrderInsideOut, stackOrderNone, stackOrderReverse, timeInterval, timeMillisecond, timeMilliseconds, utcMillisecond, utcMilliseconds, timeSecond, timeSeconds, utcSecond, utcSeconds, timeMinute, timeMinutes, timeHour, timeHours, timeDay, timeDays, timeWeek, timeWeeks, timeSunday, timeSundays, timeMonday, timeMondays, timeTuesday, timeTuesdays, timeWednesday, timeWednesdays, timeThursday, timeThursdays, timeFriday, timeFridays, timeSaturday, timeSaturdays, timeMonth, timeMonths, timeYear, timeYears, utcMinute, utcMinutes, utcHour, utcHours, utcDay, utcDays, utcWeek, utcWeeks, utcSunday, utcSundays, utcMonday, utcMondays, utcTuesday, utcTuesdays, utcWednesday, utcWednesdays, utcThursday, utcThursdays, utcFriday, utcFridays, utcSaturday, utcSaturdays, utcMonth, utcMonths, utcYear, utcYears, timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse, timeFormatLocale, isoFormat, isoParse, now, timer, timerFlush, timeout, interval, transition, active, interrupt, voronoi, zoom, zoomTransform, zoomIdentity */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony import */ var _dist_package_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dist/package.js */ "../node_modules/d3/dist/package.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "version", function() { return _dist_package_js__WEBPACK_IMPORTED_MODULE_0__["version"]; }); |
|
|
|
/* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-array */ "../node_modules/d3-array/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisect", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["bisect"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisectRight", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["bisectRight"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisectLeft", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["bisectLeft"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ascending", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["ascending"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bisector", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["bisector"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cross", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["cross"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "descending", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["descending"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deviation", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["deviation"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extent", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["extent"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "histogram", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["histogram"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thresholdFreedmanDiaconis", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["thresholdFreedmanDiaconis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thresholdScott", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["thresholdScott"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thresholdSturges", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["thresholdSturges"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["max"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["mean"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "median", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["median"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["merge"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["min"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["pairs"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "permute", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["permute"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quantile", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["quantile"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["range"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["scan"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["shuffle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["sum"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ticks", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["ticks"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tickIncrement", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["tickIncrement"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tickStep", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["tickStep"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["transpose"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "variance", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["variance"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return d3_array__WEBPACK_IMPORTED_MODULE_1__["zip"]; }); |
|
|
|
/* harmony import */ var d3_axis__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-axis */ "../node_modules/d3-axis/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisTop", function() { return d3_axis__WEBPACK_IMPORTED_MODULE_2__["axisTop"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisRight", function() { return d3_axis__WEBPACK_IMPORTED_MODULE_2__["axisRight"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisBottom", function() { return d3_axis__WEBPACK_IMPORTED_MODULE_2__["axisBottom"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "axisLeft", function() { return d3_axis__WEBPACK_IMPORTED_MODULE_2__["axisLeft"]; }); |
|
|
|
/* harmony import */ var d3_brush__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3-brush */ "../node_modules/d3-brush/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brush", function() { return d3_brush__WEBPACK_IMPORTED_MODULE_3__["brush"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brushX", function() { return d3_brush__WEBPACK_IMPORTED_MODULE_3__["brushX"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brushY", function() { return d3_brush__WEBPACK_IMPORTED_MODULE_3__["brushY"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "brushSelection", function() { return d3_brush__WEBPACK_IMPORTED_MODULE_3__["brushSelection"]; }); |
|
|
|
/* harmony import */ var d3_chord__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! d3-chord */ "../node_modules/d3-chord/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chord", function() { return d3_chord__WEBPACK_IMPORTED_MODULE_4__["chord"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ribbon", function() { return d3_chord__WEBPACK_IMPORTED_MODULE_4__["ribbon"]; }); |
|
|
|
/* harmony import */ var d3_collection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! d3-collection */ "../node_modules/d3-collection/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nest", function() { return d3_collection__WEBPACK_IMPORTED_MODULE_5__["nest"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return d3_collection__WEBPACK_IMPORTED_MODULE_5__["set"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return d3_collection__WEBPACK_IMPORTED_MODULE_5__["map"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return d3_collection__WEBPACK_IMPORTED_MODULE_5__["keys"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return d3_collection__WEBPACK_IMPORTED_MODULE_5__["values"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return d3_collection__WEBPACK_IMPORTED_MODULE_5__["entries"]; }); |
|
|
|
/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! d3-color */ "../node_modules/d3-color/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "color", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["color"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rgb", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["rgb"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hsl", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["hsl"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lab", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["lab"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hcl", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["hcl"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lch", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["lch"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gray", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["gray"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cubehelix", function() { return d3_color__WEBPACK_IMPORTED_MODULE_6__["cubehelix"]; }); |
|
|
|
/* harmony import */ var d3_contour__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! d3-contour */ "../node_modules/d3-contour/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contours", function() { return d3_contour__WEBPACK_IMPORTED_MODULE_7__["contours"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "contourDensity", function() { return d3_contour__WEBPACK_IMPORTED_MODULE_7__["contourDensity"]; }); |
|
|
|
/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! d3-dispatch */ "../node_modules/d3-dispatch/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return d3_dispatch__WEBPACK_IMPORTED_MODULE_8__["dispatch"]; }); |
|
|
|
/* harmony import */ var d3_drag__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! d3-drag */ "../node_modules/d3-drag/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drag", function() { return d3_drag__WEBPACK_IMPORTED_MODULE_9__["drag"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragDisable", function() { return d3_drag__WEBPACK_IMPORTED_MODULE_9__["dragDisable"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dragEnable", function() { return d3_drag__WEBPACK_IMPORTED_MODULE_9__["dragEnable"]; }); |
|
|
|
/* harmony import */ var d3_dsv__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! d3-dsv */ "../node_modules/d3-dsv/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsvFormat", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["dsvFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvParse", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvParseRows", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvParseRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormat", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatBody", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvFormatBody"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatRows", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvFormatRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatRow", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvFormatRow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csvFormatValue", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["csvFormatValue"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvParse", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvParseRows", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvParseRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormat", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatBody", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvFormatBody"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatRows", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvFormatRows"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatRow", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvFormatRow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsvFormatValue", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["tsvFormatValue"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoType", function() { return d3_dsv__WEBPACK_IMPORTED_MODULE_10__["autoType"]; }); |
|
|
|
/* harmony import */ var d3_ease__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! d3-ease */ "../node_modules/d3-ease/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeLinear", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeLinear"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuad", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeQuad"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeQuadIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeQuadOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeQuadInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeQuadInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubic", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCubic"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCubicIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCubicOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCubicInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCubicInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePoly", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easePoly"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easePolyIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easePolyOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easePolyInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easePolyInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSin", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeSin"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeSinIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeSinOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeSinInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeSinInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExp", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeExp"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeExpIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeExpOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeExpInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeExpInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircle", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCircle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCircleIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCircleOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeCircleInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeCircleInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounce", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBounce"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBounceIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBounceOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBounceInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBounceInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBack", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBack"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBackIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBackOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeBackInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeBackInOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElastic", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeElastic"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticIn", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeElasticIn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeElasticOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "easeElasticInOut", function() { return d3_ease__WEBPACK_IMPORTED_MODULE_11__["easeElasticInOut"]; }); |
|
|
|
/* harmony import */ var d3_fetch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! d3-fetch */ "../node_modules/d3-fetch/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blob", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["blob"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["buffer"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dsv", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["dsv"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "csv", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["csv"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tsv", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["tsv"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "image", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["image"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "json", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["json"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "text", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["text"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xml", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["xml"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "html", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["html"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "svg", function() { return d3_fetch__WEBPACK_IMPORTED_MODULE_12__["svg"]; }); |
|
|
|
/* harmony import */ var d3_force__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! d3-force */ "../node_modules/d3-force/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceCenter", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceCenter"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceCollide", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceCollide"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceLink", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceLink"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceManyBody", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceManyBody"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceRadial", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceRadial"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceSimulation", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceSimulation"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceX", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceX"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forceY", function() { return d3_force__WEBPACK_IMPORTED_MODULE_13__["forceY"]; }); |
|
|
|
/* harmony import */ var d3_format__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! d3-format */ "../node_modules/d3-format/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatDefaultLocale", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["formatDefaultLocale"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "format", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["format"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatPrefix", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["formatPrefix"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatLocale", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["formatLocale"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "formatSpecifier", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["formatSpecifier"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormatSpecifier", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["FormatSpecifier"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "precisionFixed", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["precisionFixed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "precisionPrefix", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["precisionPrefix"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "precisionRound", function() { return d3_format__WEBPACK_IMPORTED_MODULE_14__["precisionRound"]; }); |
|
|
|
/* harmony import */ var d3_geo__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! d3-geo */ "../node_modules/d3-geo/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoArea", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoArea"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoBounds", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoBounds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoCentroid", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoCentroid"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoCircle", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoCircle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipAntimeridian", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoClipAntimeridian"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipCircle", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoClipCircle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipExtent", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoClipExtent"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoClipRectangle", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoClipRectangle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoContains", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoContains"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoDistance", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoDistance"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGraticule", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoGraticule"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGraticule10", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoGraticule10"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoInterpolate", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoInterpolate"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoLength", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoLength"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoPath", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoPath"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAlbers", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoAlbers"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAlbersUsa", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoAlbersUsa"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEqualArea", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoAzimuthalEqualArea"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEqualAreaRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoAzimuthalEqualAreaRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEquidistant", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoAzimuthalEquidistant"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoAzimuthalEquidistantRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoAzimuthalEquidistantRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicConformal", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoConicConformal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicConformalRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoConicConformalRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEqualArea", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoConicEqualArea"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEqualAreaRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoConicEqualAreaRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEquidistant", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoConicEquidistant"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoConicEquidistantRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoConicEquidistantRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEqualEarth", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoEqualEarth"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEqualEarthRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoEqualEarthRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEquirectangular", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoEquirectangular"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoEquirectangularRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoEquirectangularRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGnomonic", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoGnomonic"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoGnomonicRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoGnomonicRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoIdentity", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoIdentity"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoProjection", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoProjection"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoProjectionMutator", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoProjectionMutator"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoMercator", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoMercator"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoMercatorRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoMercatorRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoNaturalEarth1", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoNaturalEarth1"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoNaturalEarth1Raw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoNaturalEarth1Raw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoOrthographic", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoOrthographic"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoOrthographicRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoOrthographicRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoStereographic", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoStereographic"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoStereographicRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoStereographicRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoTransverseMercator", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoTransverseMercator"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoTransverseMercatorRaw", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoTransverseMercatorRaw"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoRotation", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoRotation"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoStream", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoStream"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geoTransform", function() { return d3_geo__WEBPACK_IMPORTED_MODULE_15__["geoTransform"]; }); |
|
|
|
/* harmony import */ var d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! d3-hierarchy */ "../node_modules/d3-hierarchy/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cluster", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["cluster"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hierarchy", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["hierarchy"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pack", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["pack"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "packSiblings", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["packSiblings"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "packEnclose", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["packEnclose"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["partition"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stratify", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["stratify"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tree", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["tree"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemap", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemap"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapBinary", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemapBinary"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapDice", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemapDice"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapSlice", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemapSlice"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapSliceDice", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemapSliceDice"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapSquarify", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemapSquarify"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "treemapResquarify", function() { return d3_hierarchy__WEBPACK_IMPORTED_MODULE_16__["treemapResquarify"]; }); |
|
|
|
/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! d3-interpolate */ "../node_modules/d3-interpolate/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolate", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolate"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateArray", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateArray"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasis", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateBasis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBasisClosed", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateBasisClosed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDate", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateDate"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateDiscrete", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateDiscrete"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHue", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateHue"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumber", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateNumber"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateNumberArray", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateNumberArray"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateObject", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateObject"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRound", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateRound"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateString", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateString"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformCss", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateTransformCss"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTransformSvg", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateTransformSvg"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateZoom", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateZoom"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgb", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateRgb"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasis", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateRgbBasis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRgbBasisClosed", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateRgbBasisClosed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHsl", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateHsl"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHslLong", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateHslLong"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateLab", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateLab"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHcl", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateHcl"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateHclLong", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateHclLong"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelix", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateCubehelix"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelixLong", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["interpolateCubehelixLong"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "piecewise", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["piecewise"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quantize", function() { return d3_interpolate__WEBPACK_IMPORTED_MODULE_17__["quantize"]; }); |
|
|
|
/* harmony import */ var d3_path__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! d3-path */ "../node_modules/d3-path/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "path", function() { return d3_path__WEBPACK_IMPORTED_MODULE_18__["path"]; }); |
|
|
|
/* harmony import */ var d3_polygon__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! d3-polygon */ "../node_modules/d3-polygon/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonArea", function() { return d3_polygon__WEBPACK_IMPORTED_MODULE_19__["polygonArea"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonCentroid", function() { return d3_polygon__WEBPACK_IMPORTED_MODULE_19__["polygonCentroid"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonHull", function() { return d3_polygon__WEBPACK_IMPORTED_MODULE_19__["polygonHull"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonContains", function() { return d3_polygon__WEBPACK_IMPORTED_MODULE_19__["polygonContains"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "polygonLength", function() { return d3_polygon__WEBPACK_IMPORTED_MODULE_19__["polygonLength"]; }); |
|
|
|
/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! d3-quadtree */ "../node_modules/d3-quadtree/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "quadtree", function() { return d3_quadtree__WEBPACK_IMPORTED_MODULE_20__["quadtree"]; }); |
|
|
|
/* harmony import */ var d3_random__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! d3-random */ "../node_modules/d3-random/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomUniform", function() { return d3_random__WEBPACK_IMPORTED_MODULE_21__["randomUniform"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomNormal", function() { return d3_random__WEBPACK_IMPORTED_MODULE_21__["randomNormal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomLogNormal", function() { return d3_random__WEBPACK_IMPORTED_MODULE_21__["randomLogNormal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomBates", function() { return d3_random__WEBPACK_IMPORTED_MODULE_21__["randomBates"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomIrwinHall", function() { return d3_random__WEBPACK_IMPORTED_MODULE_21__["randomIrwinHall"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "randomExponential", function() { return d3_random__WEBPACK_IMPORTED_MODULE_21__["randomExponential"]; }); |
|
|
|
/* harmony import */ var d3_scale__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! d3-scale */ "../node_modules/d3-scale/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleBand", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleBand"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scalePoint", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scalePoint"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleIdentity", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleIdentity"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleLinear", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleLinear"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleLog", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleLog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSymlog", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSymlog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleOrdinal", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleOrdinal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleImplicit", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleImplicit"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scalePow", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scalePow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSqrt", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSqrt"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleQuantile", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleQuantile"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleQuantize", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleQuantize"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleThreshold", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleThreshold"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleTime", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleTime"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleUtc", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleUtc"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequential", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSequential"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialLog", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSequentialLog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialPow", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSequentialPow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialSqrt", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSequentialSqrt"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialSymlog", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSequentialSymlog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleSequentialQuantile", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleSequentialQuantile"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDiverging", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleDiverging"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingLog", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleDivergingLog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingPow", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleDivergingPow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingSqrt", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleDivergingSqrt"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scaleDivergingSymlog", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["scaleDivergingSymlog"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tickFormat", function() { return d3_scale__WEBPACK_IMPORTED_MODULE_22__["tickFormat"]; }); |
|
|
|
/* harmony import */ var d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! d3-scale-chromatic */ "../node_modules/d3-scale-chromatic/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeCategory10", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeCategory10"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeAccent", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeAccent"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeDark2", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeDark2"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePaired", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePaired"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePastel1", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePastel1"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePastel2", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePastel2"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSet1", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeSet1"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSet2", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeSet2"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSet3", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeSet3"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeTableau10", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeTableau10"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBrBG", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateBrBG"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBrBG", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeBrBG"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePRGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePRGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePRGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePRGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePiYG", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePiYG"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePiYG", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePiYG"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuOr", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePuOr"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuOr", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePuOr"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateRdBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeRdBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdGy", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateRdGy"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdGy", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeRdGy"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdYlBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateRdYlBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdYlBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeRdYlBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdYlGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateRdYlGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdYlGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeRdYlGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateSpectral", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateSpectral"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeSpectral", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeSpectral"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBuGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateBuGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBuGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeBuGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBuPu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateBuPu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBuPu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeBuPu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateGnBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateGnBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeGnBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeGnBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateOrRd", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateOrRd"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeOrRd", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeOrRd"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuBuGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePuBuGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuBuGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePuBuGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePuBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePuBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePuRd", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePuRd"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePuRd", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePuRd"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRdPu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateRdPu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeRdPu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeRdPu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlGnBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateYlGnBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlGnBu", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeYlGnBu"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateYlGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlGn", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeYlGn"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlOrBr", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateYlOrBr"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlOrBr", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeYlOrBr"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateYlOrRd", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateYlOrRd"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeYlOrRd", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeYlOrRd"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateBlues", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateBlues"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeBlues", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeBlues"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateGreens", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateGreens"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeGreens", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeGreens"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateGreys", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateGreys"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeGreys", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeGreys"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePurples", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePurples"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemePurples", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemePurples"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateReds", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateReds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeReds", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeReds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateOranges", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateOranges"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "schemeOranges", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["schemeOranges"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCividis", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateCividis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCubehelixDefault", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateCubehelixDefault"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateRainbow", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateRainbow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateWarm", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateWarm"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateCool", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateCool"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateSinebow", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateSinebow"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateTurbo", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateTurbo"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateViridis", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateViridis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateMagma", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateMagma"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolateInferno", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolateInferno"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interpolatePlasma", function() { return d3_scale_chromatic__WEBPACK_IMPORTED_MODULE_23__["interpolatePlasma"]; }); |
|
|
|
/* harmony import */ var d3_selection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! d3-selection */ "../node_modules/d3-selection/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["create"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "creator", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["creator"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "local", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["local"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["matcher"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mouse", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["mouse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "namespace", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["namespace"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "namespaces", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["namespaces"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clientPoint", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["clientPoint"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "select", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["select"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAll", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["selectAll"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selection", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["selection"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selector", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["selector"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectorAll", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["selectorAll"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "style", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["style"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "touch", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["touch"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "touches", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["touches"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["window"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "event", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["event"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "customEvent", function() { return d3_selection__WEBPACK_IMPORTED_MODULE_24__["customEvent"]; }); |
|
|
|
/* harmony import */ var d3_shape__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! d3-shape */ "../node_modules/d3-shape/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "arc", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["arc"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "area", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["area"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "line", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["line"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pie", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["pie"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "areaRadial", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["areaRadial"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "radialArea", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["radialArea"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lineRadial", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["lineRadial"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "radialLine", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["radialLine"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pointRadial", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["pointRadial"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "linkHorizontal", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["linkHorizontal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "linkVertical", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["linkVertical"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "linkRadial", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["linkRadial"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbol", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbol"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbols", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbols"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolCircle", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolCircle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolCross", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolCross"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolDiamond", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolDiamond"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolSquare", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolSquare"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolStar", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolStar"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolTriangle", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolTriangle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "symbolWye", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["symbolWye"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBasisClosed", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveBasisClosed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBasisOpen", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveBasisOpen"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBasis", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveBasis"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveBundle", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveBundle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCardinalClosed", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveCardinalClosed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCardinalOpen", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveCardinalOpen"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCardinal", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveCardinal"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCatmullRomClosed", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveCatmullRomClosed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCatmullRomOpen", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveCatmullRomOpen"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveCatmullRom", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveCatmullRom"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveLinearClosed", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveLinearClosed"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveLinear", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveLinear"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveMonotoneX", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveMonotoneX"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveMonotoneY", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveMonotoneY"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveNatural", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveNatural"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveStep", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveStep"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveStepAfter", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveStepAfter"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curveStepBefore", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["curveStepBefore"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stack", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stack"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetExpand", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOffsetExpand"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetDiverging", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOffsetDiverging"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetNone", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOffsetNone"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetSilhouette", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOffsetSilhouette"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOffsetWiggle", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOffsetWiggle"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderAppearance", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOrderAppearance"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderAscending", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOrderAscending"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderDescending", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOrderDescending"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderInsideOut", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOrderInsideOut"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderNone", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOrderNone"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stackOrderReverse", function() { return d3_shape__WEBPACK_IMPORTED_MODULE_25__["stackOrderReverse"]; }); |
|
|
|
/* harmony import */ var d3_time__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! d3-time */ "../node_modules/d3-time/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeInterval"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMillisecond", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMillisecond"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMilliseconds", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMilliseconds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMillisecond", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMillisecond"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMilliseconds", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMilliseconds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSecond", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeSecond"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSeconds", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeSeconds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSecond", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcSecond"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSeconds", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcSeconds"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMinute", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMinute"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMinutes", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMinutes"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeHour", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeHour"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeHours", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeHours"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeDay", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeDay"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeDays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeDays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWeek", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeWeek"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWeeks", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeWeeks"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSunday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeSunday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSundays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeSundays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMonday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMonday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMondays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMondays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeTuesday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeTuesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeTuesdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeTuesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWednesday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeWednesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeWednesdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeWednesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeThursday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeThursday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeThursdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeThursdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFriday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeFriday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFridays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeFridays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSaturday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeSaturday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeSaturdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeSaturdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMonth", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMonth"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeMonths", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeMonths"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeYear", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeYear"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeYears", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["timeYears"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMinute", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMinute"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMinutes", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMinutes"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcHour", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcHour"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcHours", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcHours"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcDay", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcDay"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcDays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcDays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWeek", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcWeek"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWeeks", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcWeeks"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSunday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcSunday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSundays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcSundays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMonday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMonday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMondays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMondays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcTuesday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcTuesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcTuesdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcTuesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWednesday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcWednesday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcWednesdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcWednesdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcThursday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcThursday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcThursdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcThursdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcFriday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcFriday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcFridays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcFridays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSaturday", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcSaturday"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcSaturdays", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcSaturdays"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMonth", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMonth"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcMonths", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcMonths"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcYear", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcYear"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcYears", function() { return d3_time__WEBPACK_IMPORTED_MODULE_26__["utcYears"]; }); |
|
|
|
/* harmony import */ var d3_time_format__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! d3-time-format */ "../node_modules/d3-time-format/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFormatDefaultLocale", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["timeFormatDefaultLocale"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFormat", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["timeFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeParse", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["timeParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcFormat", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["utcFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "utcParse", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["utcParse"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeFormatLocale", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["timeFormatLocale"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isoFormat", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["isoFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isoParse", function() { return d3_time_format__WEBPACK_IMPORTED_MODULE_27__["isoParse"]; }); |
|
|
|
/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! d3-timer */ "../node_modules/d3-timer/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return d3_timer__WEBPACK_IMPORTED_MODULE_28__["now"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return d3_timer__WEBPACK_IMPORTED_MODULE_28__["timer"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timerFlush", function() { return d3_timer__WEBPACK_IMPORTED_MODULE_28__["timerFlush"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return d3_timer__WEBPACK_IMPORTED_MODULE_28__["timeout"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return d3_timer__WEBPACK_IMPORTED_MODULE_28__["interval"]; }); |
|
|
|
/* harmony import */ var d3_transition__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! d3-transition */ "../node_modules/d3-transition/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transition", function() { return d3_transition__WEBPACK_IMPORTED_MODULE_29__["transition"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "active", function() { return d3_transition__WEBPACK_IMPORTED_MODULE_29__["active"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interrupt", function() { return d3_transition__WEBPACK_IMPORTED_MODULE_29__["interrupt"]; }); |
|
|
|
/* harmony import */ var d3_voronoi__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! d3-voronoi */ "../node_modules/d3-voronoi/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "voronoi", function() { return d3_voronoi__WEBPACK_IMPORTED_MODULE_30__["voronoi"]; }); |
|
|
|
/* harmony import */ var d3_zoom__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! d3-zoom */ "../node_modules/d3-zoom/src/index.js"); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zoom", function() { return d3_zoom__WEBPACK_IMPORTED_MODULE_31__["zoom"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zoomTransform", function() { return d3_zoom__WEBPACK_IMPORTED_MODULE_31__["zoomTransform"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zoomIdentity", function() { return d3_zoom__WEBPACK_IMPORTED_MODULE_31__["zoomIdentity"]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/lodash/lodash.js": |
|
/*!****************************************!*\ |
|
!*** ../node_modules/lodash/lodash.js ***! |
|
\****************************************/ |
|
/*! no static exports found */ |
|
/***/ (function(module, exports, __webpack_require__) { |
|
|
|
/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** |
|
* @license |
|
* Lodash <https://lodash.com/> |
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/> |
|
* Released under MIT license <https://lodash.com/license> |
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> |
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors |
|
*/ |
|
;(function() { |
|
|
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */ |
|
var undefined; |
|
|
|
/** Used as the semantic version number. */ |
|
var VERSION = '4.17.21'; |
|
|
|
/** Used as the size to enable large array optimizations. */ |
|
var LARGE_ARRAY_SIZE = 200; |
|
|
|
/** Error message constants. */ |
|
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', |
|
FUNC_ERROR_TEXT = 'Expected a function', |
|
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; |
|
|
|
/** Used to stand-in for `undefined` hash values. */ |
|
var HASH_UNDEFINED = '__lodash_hash_undefined__'; |
|
|
|
/** Used as the maximum memoize cache size. */ |
|
var MAX_MEMOIZE_SIZE = 500; |
|
|
|
/** Used as the internal argument placeholder. */ |
|
var PLACEHOLDER = '__lodash_placeholder__'; |
|
|
|
/** Used to compose bitmasks for cloning. */ |
|
var CLONE_DEEP_FLAG = 1, |
|
CLONE_FLAT_FLAG = 2, |
|
CLONE_SYMBOLS_FLAG = 4; |
|
|
|
/** Used to compose bitmasks for value comparisons. */ |
|
var COMPARE_PARTIAL_FLAG = 1, |
|
COMPARE_UNORDERED_FLAG = 2; |
|
|
|
/** Used to compose bitmasks for function metadata. */ |
|
var WRAP_BIND_FLAG = 1, |
|
WRAP_BIND_KEY_FLAG = 2, |
|
WRAP_CURRY_BOUND_FLAG = 4, |
|
WRAP_CURRY_FLAG = 8, |
|
WRAP_CURRY_RIGHT_FLAG = 16, |
|
WRAP_PARTIAL_FLAG = 32, |
|
WRAP_PARTIAL_RIGHT_FLAG = 64, |
|
WRAP_ARY_FLAG = 128, |
|
WRAP_REARG_FLAG = 256, |
|
WRAP_FLIP_FLAG = 512; |
|
|
|
/** Used as default options for `_.truncate`. */ |
|
var DEFAULT_TRUNC_LENGTH = 30, |
|
DEFAULT_TRUNC_OMISSION = '...'; |
|
|
|
/** Used to detect hot functions by number of calls within a span of milliseconds. */ |
|
var HOT_COUNT = 800, |
|
HOT_SPAN = 16; |
|
|
|
/** Used to indicate the type of lazy iteratees. */ |
|
var LAZY_FILTER_FLAG = 1, |
|
LAZY_MAP_FLAG = 2, |
|
LAZY_WHILE_FLAG = 3; |
|
|
|
/** Used as references for various `Number` constants. */ |
|
var INFINITY = 1 / 0, |
|
MAX_SAFE_INTEGER = 9007199254740991, |
|
MAX_INTEGER = 1.7976931348623157e+308, |
|
NAN = 0 / 0; |
|
|
|
/** Used as references for the maximum length and index of an array. */ |
|
var MAX_ARRAY_LENGTH = 4294967295, |
|
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, |
|
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; |
|
|
|
/** Used to associate wrap methods with their bit flags. */ |
|
var wrapFlags = [ |
|
['ary', WRAP_ARY_FLAG], |
|
['bind', WRAP_BIND_FLAG], |
|
['bindKey', WRAP_BIND_KEY_FLAG], |
|
['curry', WRAP_CURRY_FLAG], |
|
['curryRight', WRAP_CURRY_RIGHT_FLAG], |
|
['flip', WRAP_FLIP_FLAG], |
|
['partial', WRAP_PARTIAL_FLAG], |
|
['partialRight', WRAP_PARTIAL_RIGHT_FLAG], |
|
['rearg', WRAP_REARG_FLAG] |
|
]; |
|
|
|
/** `Object#toString` result references. */ |
|
var argsTag = '[object Arguments]', |
|
arrayTag = '[object Array]', |
|
asyncTag = '[object AsyncFunction]', |
|
boolTag = '[object Boolean]', |
|
dateTag = '[object Date]', |
|
domExcTag = '[object DOMException]', |
|
errorTag = '[object Error]', |
|
funcTag = '[object Function]', |
|
genTag = '[object GeneratorFunction]', |
|
mapTag = '[object Map]', |
|
numberTag = '[object Number]', |
|
nullTag = '[object Null]', |
|
objectTag = '[object Object]', |
|
promiseTag = '[object Promise]', |
|
proxyTag = '[object Proxy]', |
|
regexpTag = '[object RegExp]', |
|
setTag = '[object Set]', |
|
stringTag = '[object String]', |
|
symbolTag = '[object Symbol]', |
|
undefinedTag = '[object Undefined]', |
|
weakMapTag = '[object WeakMap]', |
|
weakSetTag = '[object WeakSet]'; |
|
|
|
var arrayBufferTag = '[object ArrayBuffer]', |
|
dataViewTag = '[object DataView]', |
|
float32Tag = '[object Float32Array]', |
|
float64Tag = '[object Float64Array]', |
|
int8Tag = '[object Int8Array]', |
|
int16Tag = '[object Int16Array]', |
|
int32Tag = '[object Int32Array]', |
|
uint8Tag = '[object Uint8Array]', |
|
uint8ClampedTag = '[object Uint8ClampedArray]', |
|
uint16Tag = '[object Uint16Array]', |
|
uint32Tag = '[object Uint32Array]'; |
|
|
|
/** Used to match empty string literals in compiled template source. */ |
|
var reEmptyStringLeading = /\b__p \+= '';/g, |
|
reEmptyStringMiddle = /\b(__p \+=) '' \+/g, |
|
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; |
|
|
|
/** Used to match HTML entities and HTML characters. */ |
|
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, |
|
reUnescapedHtml = /[&<>"']/g, |
|
reHasEscapedHtml = RegExp(reEscapedHtml.source), |
|
reHasUnescapedHtml = RegExp(reUnescapedHtml.source); |
|
|
|
/** Used to match template delimiters. */ |
|
var reEscape = /<%-([\s\S]+?)%>/g, |
|
reEvaluate = /<%([\s\S]+?)%>/g, |
|
reInterpolate = /<%=([\s\S]+?)%>/g; |
|
|
|
/** Used to match property names within property paths. */ |
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, |
|
reIsPlainProp = /^\w*$/, |
|
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; |
|
|
|
/** |
|
* Used to match `RegExp` |
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). |
|
*/ |
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, |
|
reHasRegExpChar = RegExp(reRegExpChar.source); |
|
|
|
/** Used to match leading whitespace. */ |
|
var reTrimStart = /^\s+/; |
|
|
|
/** Used to match a single whitespace character. */ |
|
var reWhitespace = /\s/; |
|
|
|
/** Used to match wrap detail comments. */ |
|
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, |
|
reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, |
|
reSplitDetails = /,? & /; |
|
|
|
/** Used to match words composed of alphanumeric characters. */ |
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; |
|
|
|
/** |
|
* Used to validate the `validate` option in `_.template` variable. |
|
* |
|
* Forbids characters which could potentially change the meaning of the function argument definition: |
|
* - "()," (modification of function parameters) |
|
* - "=" (default value) |
|
* - "[]{}" (destructuring of function parameters) |
|
* - "/" (beginning of a comment) |
|
* - whitespace |
|
*/ |
|
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; |
|
|
|
/** Used to match backslashes in property paths. */ |
|
var reEscapeChar = /\\(\\)?/g; |
|
|
|
/** |
|
* Used to match |
|
* [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). |
|
*/ |
|
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; |
|
|
|
/** Used to match `RegExp` flags from their coerced string values. */ |
|
var reFlags = /\w*$/; |
|
|
|
/** 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 host constructors (Safari). */ |
|
var reIsHostCtor = /^\[object .+?Constructor\]$/; |
|
|
|
/** Used to detect octal string values. */ |
|
var reIsOctal = /^0o[0-7]+$/i; |
|
|
|
/** Used to detect unsigned integer values. */ |
|
var reIsUint = /^(?:0|[1-9]\d*)$/; |
|
|
|
/** Used to match Latin Unicode letters (excluding mathematical operators). */ |
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; |
|
|
|
/** Used to ensure capturing order of template delimiters. */ |
|
var reNoMatch = /($^)/; |
|
|
|
/** Used to match unescaped characters in compiled string literals. */ |
|
var reUnescapedString = /['\n\r\u2028\u2029\\]/g; |
|
|
|
/** Used to compose unicode character classes. */ |
|
var rsAstralRange = '\\ud800-\\udfff', |
|
rsComboMarksRange = '\\u0300-\\u036f', |
|
reComboHalfMarksRange = '\\ufe20-\\ufe2f', |
|
rsComboSymbolsRange = '\\u20d0-\\u20ff', |
|
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, |
|
rsDingbatRange = '\\u2700-\\u27bf', |
|
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', |
|
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', |
|
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', |
|
rsPunctuationRange = '\\u2000-\\u206f', |
|
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', |
|
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', |
|
rsVarRange = '\\ufe0e\\ufe0f', |
|
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; |
|
|
|
/** Used to compose unicode capture groups. */ |
|
var rsApos = "['\u2019]", |
|
rsAstral = '[' + rsAstralRange + ']', |
|
rsBreak = '[' + rsBreakRange + ']', |
|
rsCombo = '[' + rsComboRange + ']', |
|
rsDigits = '\\d+', |
|
rsDingbat = '[' + rsDingbatRange + ']', |
|
rsLower = '[' + rsLowerRange + ']', |
|
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', |
|
rsFitz = '\\ud83c[\\udffb-\\udfff]', |
|
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', |
|
rsNonAstral = '[^' + rsAstralRange + ']', |
|
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', |
|
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', |
|
rsUpper = '[' + rsUpperRange + ']', |
|
rsZWJ = '\\u200d'; |
|
|
|
/** Used to compose unicode regexes. */ |
|
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', |
|
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', |
|
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', |
|
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', |
|
reOptMod = rsModifier + '?', |
|
rsOptVar = '[' + rsVarRange + ']?', |
|
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', |
|
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', |
|
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', |
|
rsSeq = rsOptVar + reOptMod + rsOptJoin, |
|
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, |
|
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; |
|
|
|
/** Used to match apostrophes. */ |
|
var reApos = RegExp(rsApos, 'g'); |
|
|
|
/** |
|
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and |
|
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). |
|
*/ |
|
var reComboMark = RegExp(rsCombo, 'g'); |
|
|
|
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ |
|
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); |
|
|
|
/** Used to match complex or compound words. */ |
|
var reUnicodeWord = RegExp([ |
|
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', |
|
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', |
|
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, |
|
rsUpper + '+' + rsOptContrUpper, |
|
rsOrdUpper, |
|
rsOrdLower, |
|
rsDigits, |
|
rsEmoji |
|
].join('|'), 'g'); |
|
|
|
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ |
|
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); |
|
|
|
/** Used to detect strings that need a more robust regexp to match words. */ |
|
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; |
|
|
|
/** Used to assign default `context` object properties. */ |
|
var contextProps = [ |
|
'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', |
|
'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', |
|
'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', |
|
'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', |
|
'_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' |
|
]; |
|
|
|
/** Used to make template sourceURLs easier to identify. */ |
|
var templateCounter = -1; |
|
|
|
/** Used to identify `toStringTag` values of typed arrays. */ |
|
var typedArrayTags = {}; |
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = |
|
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = |
|
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = |
|
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = |
|
typedArrayTags[uint32Tag] = true; |
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = |
|
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = |
|
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = |
|
typedArrayTags[errorTag] = typedArrayTags[funcTag] = |
|
typedArrayTags[mapTag] = typedArrayTags[numberTag] = |
|
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = |
|
typedArrayTags[setTag] = typedArrayTags[stringTag] = |
|
typedArrayTags[weakMapTag] = false; |
|
|
|
/** Used to identify `toStringTag` values supported by `_.clone`. */ |
|
var cloneableTags = {}; |
|
cloneableTags[argsTag] = cloneableTags[arrayTag] = |
|
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = |
|
cloneableTags[boolTag] = cloneableTags[dateTag] = |
|
cloneableTags[float32Tag] = cloneableTags[float64Tag] = |
|
cloneableTags[int8Tag] = cloneableTags[int16Tag] = |
|
cloneableTags[int32Tag] = cloneableTags[mapTag] = |
|
cloneableTags[numberTag] = cloneableTags[objectTag] = |
|
cloneableTags[regexpTag] = cloneableTags[setTag] = |
|
cloneableTags[stringTag] = cloneableTags[symbolTag] = |
|
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = |
|
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; |
|
cloneableTags[errorTag] = cloneableTags[funcTag] = |
|
cloneableTags[weakMapTag] = false; |
|
|
|
/** Used to map Latin Unicode letters to basic Latin letters. */ |
|
var deburredLetters = { |
|
// Latin-1 Supplement block. |
|
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', |
|
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', |
|
'\xc7': 'C', '\xe7': 'c', |
|
'\xd0': 'D', '\xf0': 'd', |
|
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', |
|
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', |
|
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', |
|
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', |
|
'\xd1': 'N', '\xf1': 'n', |
|
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', |
|
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', |
|
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', |
|
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', |
|
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y', |
|
'\xc6': 'Ae', '\xe6': 'ae', |
|
'\xde': 'Th', '\xfe': 'th', |
|
'\xdf': 'ss', |
|
// Latin Extended-A block. |
|
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A', |
|
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a', |
|
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', |
|
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', |
|
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', |
|
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', |
|
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', |
|
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', |
|
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', |
|
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', |
|
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', |
|
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', |
|
'\u0134': 'J', '\u0135': 'j', |
|
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k', |
|
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', |
|
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', |
|
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', |
|
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', |
|
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O', |
|
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o', |
|
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R', |
|
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r', |
|
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', |
|
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', |
|
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T', |
|
'\u0163': 't', '\u0165': 't', '\u0167': 't', |
|
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', |
|
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', |
|
'\u0174': 'W', '\u0175': 'w', |
|
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', |
|
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', |
|
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z', |
|
'\u0132': 'IJ', '\u0133': 'ij', |
|
'\u0152': 'Oe', '\u0153': 'oe', |
|
'\u0149': "'n", '\u017f': 's' |
|
}; |
|
|
|
/** Used to map characters to HTML entities. */ |
|
var htmlEscapes = { |
|
'&': '&', |
|
'<': '<', |
|
'>': '>', |
|
'"': '"', |
|
"'": ''' |
|
}; |
|
|
|
/** Used to map HTML entities to characters. */ |
|
var htmlUnescapes = { |
|
'&': '&', |
|
'<': '<', |
|
'>': '>', |
|
'"': '"', |
|
''': "'" |
|
}; |
|
|
|
/** Used to escape characters for inclusion in compiled string literals. */ |
|
var stringEscapes = { |
|
'\\': '\\', |
|
"'": "'", |
|
'\n': 'n', |
|
'\r': 'r', |
|
'\u2028': 'u2028', |
|
'\u2029': 'u2029' |
|
}; |
|
|
|
/** Built-in method references without a dependency on `root`. */ |
|
var freeParseFloat = parseFloat, |
|
freeParseInt = parseInt; |
|
|
|
/** Detect free variable `global` from Node.js. */ |
|
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; |
|
|
|
/** Detect free variable `self`. */ |
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; |
|
|
|
/** Used as a reference to the global object. */ |
|
var root = freeGlobal || freeSelf || Function('return this')(); |
|
|
|
/** Detect free variable `exports`. */ |
|
var freeExports = true && exports && !exports.nodeType && exports; |
|
|
|
/** Detect free variable `module`. */ |
|
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; |
|
|
|
/** Detect the popular CommonJS extension `module.exports`. */ |
|
var moduleExports = freeModule && freeModule.exports === freeExports; |
|
|
|
/** Detect free variable `process` from Node.js. */ |
|
var freeProcess = moduleExports && freeGlobal.process; |
|
|
|
/** Used to access faster Node.js helpers. */ |
|
var nodeUtil = (function() { |
|
try { |
|
// Use `util.types` for Node.js 10+. |
|
var types = freeModule && freeModule.require && freeModule.require('util').types; |
|
|
|
if (types) { |
|
return types; |
|
} |
|
|
|
// Legacy `process.binding('util')` for Node.js < 10. |
|
return freeProcess && freeProcess.binding && freeProcess.binding('util'); |
|
} catch (e) {} |
|
}()); |
|
|
|
/* Node.js helper references. */ |
|
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, |
|
nodeIsDate = nodeUtil && nodeUtil.isDate, |
|
nodeIsMap = nodeUtil && nodeUtil.isMap, |
|
nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, |
|
nodeIsSet = nodeUtil && nodeUtil.isSet, |
|
nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; |
|
|
|
/*--------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* 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 {Array} args The arguments to invoke `func` with. |
|
* @returns {*} Returns the result of `func`. |
|
*/ |
|
function apply(func, thisArg, args) { |
|
switch (args.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); |
|
} |
|
|
|
/** |
|
* A specialized version of `baseAggregator` for arrays. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} setter The function to set `accumulator` values. |
|
* @param {Function} iteratee The iteratee to transform keys. |
|
* @param {Object} accumulator The initial aggregated object. |
|
* @returns {Function} Returns `accumulator`. |
|
*/ |
|
function arrayAggregator(array, setter, iteratee, accumulator) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length; |
|
|
|
while (++index < length) { |
|
var value = array[index]; |
|
setter(accumulator, value, iteratee(value), array); |
|
} |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.forEach` for arrays without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function arrayEach(array, iteratee) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length; |
|
|
|
while (++index < length) { |
|
if (iteratee(array[index], index, array) === false) { |
|
break; |
|
} |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.forEachRight` for arrays without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function arrayEachRight(array, iteratee) { |
|
var length = array == null ? 0 : array.length; |
|
|
|
while (length--) { |
|
if (iteratee(array[length], length, array) === false) { |
|
break; |
|
} |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.every` for arrays without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @returns {boolean} Returns `true` if all elements pass the predicate check, |
|
* else `false`. |
|
*/ |
|
function arrayEvery(array, predicate) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length; |
|
|
|
while (++index < length) { |
|
if (!predicate(array[index], index, array)) { |
|
return false; |
|
} |
|
} |
|
return true; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.filter` for arrays without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @returns {Array} Returns the new filtered array. |
|
*/ |
|
function arrayFilter(array, predicate) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length, |
|
resIndex = 0, |
|
result = []; |
|
|
|
while (++index < length) { |
|
var value = array[index]; |
|
if (predicate(value, index, array)) { |
|
result[resIndex++] = value; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.includes` for arrays without support for |
|
* specifying an index to search from. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to inspect. |
|
* @param {*} target The value to search for. |
|
* @returns {boolean} Returns `true` if `target` is found, else `false`. |
|
*/ |
|
function arrayIncludes(array, value) { |
|
var length = array == null ? 0 : array.length; |
|
return !!length && baseIndexOf(array, value, 0) > -1; |
|
} |
|
|
|
/** |
|
* This function is like `arrayIncludes` except that it accepts a comparator. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to inspect. |
|
* @param {*} target The value to search for. |
|
* @param {Function} comparator The comparator invoked per element. |
|
* @returns {boolean} Returns `true` if `target` is found, else `false`. |
|
*/ |
|
function arrayIncludesWith(array, value, comparator) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length; |
|
|
|
while (++index < length) { |
|
if (comparator(value, array[index])) { |
|
return true; |
|
} |
|
} |
|
return false; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.map` for arrays without support for iteratee |
|
* shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Array} Returns the new mapped array. |
|
*/ |
|
function arrayMap(array, iteratee) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length, |
|
result = Array(length); |
|
|
|
while (++index < length) { |
|
result[index] = iteratee(array[index], index, array); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Appends the elements of `values` to `array`. |
|
* |
|
* @private |
|
* @param {Array} array The array to modify. |
|
* @param {Array} values The values to append. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function arrayPush(array, values) { |
|
var index = -1, |
|
length = values.length, |
|
offset = array.length; |
|
|
|
while (++index < length) { |
|
array[offset + index] = values[index]; |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.reduce` for arrays without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @param {*} [accumulator] The initial value. |
|
* @param {boolean} [initAccum] Specify using the first element of `array` as |
|
* the initial value. |
|
* @returns {*} Returns the accumulated value. |
|
*/ |
|
function arrayReduce(array, iteratee, accumulator, initAccum) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length; |
|
|
|
if (initAccum && length) { |
|
accumulator = array[++index]; |
|
} |
|
while (++index < length) { |
|
accumulator = iteratee(accumulator, array[index], index, array); |
|
} |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.reduceRight` for arrays without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @param {*} [accumulator] The initial value. |
|
* @param {boolean} [initAccum] Specify using the last element of `array` as |
|
* the initial value. |
|
* @returns {*} Returns the accumulated value. |
|
*/ |
|
function arrayReduceRight(array, iteratee, accumulator, initAccum) { |
|
var length = array == null ? 0 : array.length; |
|
if (initAccum && length) { |
|
accumulator = array[--length]; |
|
} |
|
while (length--) { |
|
accumulator = iteratee(accumulator, array[length], length, array); |
|
} |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.some` for arrays without support for iteratee |
|
* shorthands. |
|
* |
|
* @private |
|
* @param {Array} [array] The array to iterate over. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @returns {boolean} Returns `true` if any element passes the predicate check, |
|
* else `false`. |
|
*/ |
|
function arraySome(array, predicate) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length; |
|
|
|
while (++index < length) { |
|
if (predicate(array[index], index, array)) { |
|
return true; |
|
} |
|
} |
|
return false; |
|
} |
|
|
|
/** |
|
* Gets the size of an ASCII `string`. |
|
* |
|
* @private |
|
* @param {string} string The string inspect. |
|
* @returns {number} Returns the string size. |
|
*/ |
|
var asciiSize = baseProperty('length'); |
|
|
|
/** |
|
* Converts an ASCII `string` to an array. |
|
* |
|
* @private |
|
* @param {string} string The string to convert. |
|
* @returns {Array} Returns the converted array. |
|
*/ |
|
function asciiToArray(string) { |
|
return string.split(''); |
|
} |
|
|
|
/** |
|
* Splits an ASCII `string` into an array of its words. |
|
* |
|
* @private |
|
* @param {string} The string to inspect. |
|
* @returns {Array} Returns the words of `string`. |
|
*/ |
|
function asciiWords(string) { |
|
return string.match(reAsciiWord) || []; |
|
} |
|
|
|
/** |
|
* The base implementation of methods like `_.findKey` and `_.findLastKey`, |
|
* without support for iteratee shorthands, which iterates over `collection` |
|
* using `eachFunc`. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to inspect. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @param {Function} eachFunc The function to iterate over `collection`. |
|
* @returns {*} Returns the found element or its key, else `undefined`. |
|
*/ |
|
function baseFindKey(collection, predicate, eachFunc) { |
|
var result; |
|
eachFunc(collection, function(value, key, collection) { |
|
if (predicate(value, key, collection)) { |
|
result = key; |
|
return false; |
|
} |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.findIndex` and `_.findLastIndex` without |
|
* support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @param {number} fromIndex The index to search from. |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
*/ |
|
function baseFindIndex(array, predicate, fromIndex, fromRight) { |
|
var length = array.length, |
|
index = fromIndex + (fromRight ? 1 : -1); |
|
|
|
while ((fromRight ? index-- : ++index < length)) { |
|
if (predicate(array[index], index, array)) { |
|
return index; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.indexOf` without `fromIndex` bounds checks. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} fromIndex The index to search from. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
*/ |
|
function baseIndexOf(array, value, fromIndex) { |
|
return value === value |
|
? strictIndexOf(array, value, fromIndex) |
|
: baseFindIndex(array, baseIsNaN, fromIndex); |
|
} |
|
|
|
/** |
|
* This function is like `baseIndexOf` except that it accepts a comparator. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} fromIndex The index to search from. |
|
* @param {Function} comparator The comparator invoked per element. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
*/ |
|
function baseIndexOfWith(array, value, fromIndex, comparator) { |
|
var index = fromIndex - 1, |
|
length = array.length; |
|
|
|
while (++index < length) { |
|
if (comparator(array[index], value)) { |
|
return index; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isNaN` without support for number objects. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. |
|
*/ |
|
function baseIsNaN(value) { |
|
return value !== value; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.mean` and `_.meanBy` without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {number} Returns the mean. |
|
*/ |
|
function baseMean(array, iteratee) { |
|
var length = array == null ? 0 : array.length; |
|
return length ? (baseSum(array, iteratee) / length) : NAN; |
|
} |
|
|
|
/** |
|
* 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 accessor function. |
|
*/ |
|
function baseProperty(key) { |
|
return function(object) { |
|
return object == null ? undefined : object[key]; |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.propertyOf` without support for deep paths. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Function} Returns the new accessor function. |
|
*/ |
|
function basePropertyOf(object) { |
|
return function(key) { |
|
return object == null ? undefined : object[key]; |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.reduce` and `_.reduceRight`, without support |
|
* for iteratee shorthands, which iterates over `collection` using `eachFunc`. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @param {*} accumulator The initial value. |
|
* @param {boolean} initAccum Specify using the first or last element of |
|
* `collection` as the initial value. |
|
* @param {Function} eachFunc The function to iterate over `collection`. |
|
* @returns {*} Returns the accumulated value. |
|
*/ |
|
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { |
|
eachFunc(collection, function(value, index, collection) { |
|
accumulator = initAccum |
|
? (initAccum = false, value) |
|
: iteratee(accumulator, value, index, collection); |
|
}); |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sortBy` which uses `comparer` to define the |
|
* sort order of `array` and replaces criteria objects with their corresponding |
|
* values. |
|
* |
|
* @private |
|
* @param {Array} array The array to sort. |
|
* @param {Function} comparer The function to define sort order. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function baseSortBy(array, comparer) { |
|
var length = array.length; |
|
|
|
array.sort(comparer); |
|
while (length--) { |
|
array[length] = array[length].value; |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sum` and `_.sumBy` without support for |
|
* iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {number} Returns the sum. |
|
*/ |
|
function baseSum(array, iteratee) { |
|
var result, |
|
index = -1, |
|
length = array.length; |
|
|
|
while (++index < length) { |
|
var current = iteratee(array[index]); |
|
if (current !== undefined) { |
|
result = result === undefined ? current : (result + current); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* 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; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array |
|
* of key-value pairs for `object` corresponding to the property names of `props`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Array} props The property names to get values for. |
|
* @returns {Object} Returns the key-value pairs. |
|
*/ |
|
function baseToPairs(object, props) { |
|
return arrayMap(props, function(key) { |
|
return [key, object[key]]; |
|
}); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.trim`. |
|
* |
|
* @private |
|
* @param {string} string The string to trim. |
|
* @returns {string} Returns the trimmed string. |
|
*/ |
|
function baseTrim(string) { |
|
return string |
|
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') |
|
: string; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.unary` without support for storing metadata. |
|
* |
|
* @private |
|
* @param {Function} func The function to cap arguments for. |
|
* @returns {Function} Returns the new capped function. |
|
*/ |
|
function baseUnary(func) { |
|
return function(value) { |
|
return func(value); |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.values` and `_.valuesIn` which creates an |
|
* array of `object` property values corresponding to the property names |
|
* of `props`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Array} props The property names to get values for. |
|
* @returns {Object} Returns the array of property values. |
|
*/ |
|
function baseValues(object, props) { |
|
return arrayMap(props, function(key) { |
|
return object[key]; |
|
}); |
|
} |
|
|
|
/** |
|
* Checks if a `cache` value for `key` exists. |
|
* |
|
* @private |
|
* @param {Object} cache The cache to query. |
|
* @param {string} key The key of the entry to check. |
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
|
*/ |
|
function cacheHas(cache, key) { |
|
return cache.has(key); |
|
} |
|
|
|
/** |
|
* Used by `_.trim` and `_.trimStart` to get the index of the first string symbol |
|
* that is not found in the character symbols. |
|
* |
|
* @private |
|
* @param {Array} strSymbols The string symbols to inspect. |
|
* @param {Array} chrSymbols The character symbols to find. |
|
* @returns {number} Returns the index of the first unmatched string symbol. |
|
*/ |
|
function charsStartIndex(strSymbols, chrSymbols) { |
|
var index = -1, |
|
length = strSymbols.length; |
|
|
|
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} |
|
return index; |
|
} |
|
|
|
/** |
|
* Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol |
|
* that is not found in the character symbols. |
|
* |
|
* @private |
|
* @param {Array} strSymbols The string symbols to inspect. |
|
* @param {Array} chrSymbols The character symbols to find. |
|
* @returns {number} Returns the index of the last unmatched string symbol. |
|
*/ |
|
function charsEndIndex(strSymbols, chrSymbols) { |
|
var index = strSymbols.length; |
|
|
|
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} |
|
return index; |
|
} |
|
|
|
/** |
|
* Gets the number of `placeholder` occurrences in `array`. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {*} placeholder The placeholder to search for. |
|
* @returns {number} Returns the placeholder count. |
|
*/ |
|
function countHolders(array, placeholder) { |
|
var length = array.length, |
|
result = 0; |
|
|
|
while (length--) { |
|
if (array[length] === placeholder) { |
|
++result; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A |
|
* letters to basic Latin letters. |
|
* |
|
* @private |
|
* @param {string} letter The matched letter to deburr. |
|
* @returns {string} Returns the deburred letter. |
|
*/ |
|
var deburrLetter = basePropertyOf(deburredLetters); |
|
|
|
/** |
|
* Used by `_.escape` to convert characters to HTML entities. |
|
* |
|
* @private |
|
* @param {string} chr The matched character to escape. |
|
* @returns {string} Returns the escaped character. |
|
*/ |
|
var escapeHtmlChar = basePropertyOf(htmlEscapes); |
|
|
|
/** |
|
* Used by `_.template` to escape characters for inclusion in compiled string literals. |
|
* |
|
* @private |
|
* @param {string} chr The matched character to escape. |
|
* @returns {string} Returns the escaped character. |
|
*/ |
|
function escapeStringChar(chr) { |
|
return '\\' + stringEscapes[chr]; |
|
} |
|
|
|
/** |
|
* Gets the value at `key` of `object`. |
|
* |
|
* @private |
|
* @param {Object} [object] The object to query. |
|
* @param {string} key The key of the property to get. |
|
* @returns {*} Returns the property value. |
|
*/ |
|
function getValue(object, key) { |
|
return object == null ? undefined : object[key]; |
|
} |
|
|
|
/** |
|
* Checks if `string` contains Unicode symbols. |
|
* |
|
* @private |
|
* @param {string} string The string to inspect. |
|
* @returns {boolean} Returns `true` if a symbol is found, else `false`. |
|
*/ |
|
function hasUnicode(string) { |
|
return reHasUnicode.test(string); |
|
} |
|
|
|
/** |
|
* Checks if `string` contains a word composed of Unicode symbols. |
|
* |
|
* @private |
|
* @param {string} string The string to inspect. |
|
* @returns {boolean} Returns `true` if a word is found, else `false`. |
|
*/ |
|
function hasUnicodeWord(string) { |
|
return reHasUnicodeWord.test(string); |
|
} |
|
|
|
/** |
|
* 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; |
|
} |
|
|
|
/** |
|
* Converts `map` to its key-value pairs. |
|
* |
|
* @private |
|
* @param {Object} map The map to convert. |
|
* @returns {Array} Returns the key-value pairs. |
|
*/ |
|
function mapToArray(map) { |
|
var index = -1, |
|
result = Array(map.size); |
|
|
|
map.forEach(function(value, key) { |
|
result[++index] = [key, value]; |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates a unary function that invokes `func` with its argument transformed. |
|
* |
|
* @private |
|
* @param {Function} func The function to wrap. |
|
* @param {Function} transform The argument transform. |
|
* @returns {Function} Returns the new function. |
|
*/ |
|
function overArg(func, transform) { |
|
return function(arg) { |
|
return func(transform(arg)); |
|
}; |
|
} |
|
|
|
/** |
|
* Replaces all `placeholder` elements in `array` with an internal placeholder |
|
* and returns an array of their indexes. |
|
* |
|
* @private |
|
* @param {Array} array The array to modify. |
|
* @param {*} placeholder The placeholder to replace. |
|
* @returns {Array} Returns the new array of placeholder indexes. |
|
*/ |
|
function replaceHolders(array, placeholder) { |
|
var index = -1, |
|
length = array.length, |
|
resIndex = 0, |
|
result = []; |
|
|
|
while (++index < length) { |
|
var value = array[index]; |
|
if (value === placeholder || value === PLACEHOLDER) { |
|
array[index] = PLACEHOLDER; |
|
result[resIndex++] = index; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Converts `set` to an array of its values. |
|
* |
|
* @private |
|
* @param {Object} set The set to convert. |
|
* @returns {Array} Returns the values. |
|
*/ |
|
function setToArray(set) { |
|
var index = -1, |
|
result = Array(set.size); |
|
|
|
set.forEach(function(value) { |
|
result[++index] = value; |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* Converts `set` to its value-value pairs. |
|
* |
|
* @private |
|
* @param {Object} set The set to convert. |
|
* @returns {Array} Returns the value-value pairs. |
|
*/ |
|
function setToPairs(set) { |
|
var index = -1, |
|
result = Array(set.size); |
|
|
|
set.forEach(function(value) { |
|
result[++index] = [value, value]; |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.indexOf` which performs strict equality |
|
* comparisons of values, i.e. `===`. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} fromIndex The index to search from. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
*/ |
|
function strictIndexOf(array, value, fromIndex) { |
|
var index = fromIndex - 1, |
|
length = array.length; |
|
|
|
while (++index < length) { |
|
if (array[index] === value) { |
|
return index; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.lastIndexOf` which performs strict equality |
|
* comparisons of values, i.e. `===`. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} fromIndex The index to search from. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
*/ |
|
function strictLastIndexOf(array, value, fromIndex) { |
|
var index = fromIndex + 1; |
|
while (index--) { |
|
if (array[index] === value) { |
|
return index; |
|
} |
|
} |
|
return index; |
|
} |
|
|
|
/** |
|
* Gets the number of symbols in `string`. |
|
* |
|
* @private |
|
* @param {string} string The string to inspect. |
|
* @returns {number} Returns the string size. |
|
*/ |
|
function stringSize(string) { |
|
return hasUnicode(string) |
|
? unicodeSize(string) |
|
: asciiSize(string); |
|
} |
|
|
|
/** |
|
* Converts `string` to an array. |
|
* |
|
* @private |
|
* @param {string} string The string to convert. |
|
* @returns {Array} Returns the converted array. |
|
*/ |
|
function stringToArray(string) { |
|
return hasUnicode(string) |
|
? unicodeToArray(string) |
|
: asciiToArray(string); |
|
} |
|
|
|
/** |
|
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace |
|
* character of `string`. |
|
* |
|
* @private |
|
* @param {string} string The string to inspect. |
|
* @returns {number} Returns the index of the last non-whitespace character. |
|
*/ |
|
function trimmedEndIndex(string) { |
|
var index = string.length; |
|
|
|
while (index-- && reWhitespace.test(string.charAt(index))) {} |
|
return index; |
|
} |
|
|
|
/** |
|
* Used by `_.unescape` to convert HTML entities to characters. |
|
* |
|
* @private |
|
* @param {string} chr The matched character to unescape. |
|
* @returns {string} Returns the unescaped character. |
|
*/ |
|
var unescapeHtmlChar = basePropertyOf(htmlUnescapes); |
|
|
|
/** |
|
* Gets the size of a Unicode `string`. |
|
* |
|
* @private |
|
* @param {string} string The string inspect. |
|
* @returns {number} Returns the string size. |
|
*/ |
|
function unicodeSize(string) { |
|
var result = reUnicode.lastIndex = 0; |
|
while (reUnicode.test(string)) { |
|
++result; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Converts a Unicode `string` to an array. |
|
* |
|
* @private |
|
* @param {string} string The string to convert. |
|
* @returns {Array} Returns the converted array. |
|
*/ |
|
function unicodeToArray(string) { |
|
return string.match(reUnicode) || []; |
|
} |
|
|
|
/** |
|
* Splits a Unicode `string` into an array of its words. |
|
* |
|
* @private |
|
* @param {string} The string to inspect. |
|
* @returns {Array} Returns the words of `string`. |
|
*/ |
|
function unicodeWords(string) { |
|
return string.match(reUnicodeWord) || []; |
|
} |
|
|
|
/*--------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Create a new pristine `lodash` function using the `context` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.1.0 |
|
* @category Util |
|
* @param {Object} [context=root] The context object. |
|
* @returns {Function} Returns a new `lodash` function. |
|
* @example |
|
* |
|
* _.mixin({ 'foo': _.constant('foo') }); |
|
* |
|
* var lodash = _.runInContext(); |
|
* lodash.mixin({ 'bar': lodash.constant('bar') }); |
|
* |
|
* _.isFunction(_.foo); |
|
* // => true |
|
* _.isFunction(_.bar); |
|
* // => false |
|
* |
|
* lodash.isFunction(lodash.foo); |
|
* // => false |
|
* lodash.isFunction(lodash.bar); |
|
* // => true |
|
* |
|
* // Create a suped-up `defer` in Node.js. |
|
* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; |
|
*/ |
|
var runInContext = (function runInContext(context) { |
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); |
|
|
|
/** Built-in constructor references. */ |
|
var Array = context.Array, |
|
Date = context.Date, |
|
Error = context.Error, |
|
Function = context.Function, |
|
Math = context.Math, |
|
Object = context.Object, |
|
RegExp = context.RegExp, |
|
String = context.String, |
|
TypeError = context.TypeError; |
|
|
|
/** Used for built-in method references. */ |
|
var arrayProto = Array.prototype, |
|
funcProto = Function.prototype, |
|
objectProto = Object.prototype; |
|
|
|
/** Used to detect overreaching core-js shims. */ |
|
var coreJsData = context['__core-js_shared__']; |
|
|
|
/** Used to resolve the decompiled source of functions. */ |
|
var funcToString = funcProto.toString; |
|
|
|
/** Used to check objects for own properties. */ |
|
var hasOwnProperty = objectProto.hasOwnProperty; |
|
|
|
/** Used to generate unique IDs. */ |
|
var idCounter = 0; |
|
|
|
/** Used to detect methods masquerading as native. */ |
|
var maskSrcKey = (function() { |
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); |
|
return uid ? ('Symbol(src)_1.' + uid) : ''; |
|
}()); |
|
|
|
/** |
|
* Used to resolve the |
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) |
|
* of values. |
|
*/ |
|
var nativeObjectToString = objectProto.toString; |
|
|
|
/** Used to infer the `Object` constructor. */ |
|
var objectCtorString = funcToString.call(Object); |
|
|
|
/** Used to restore the original `_` reference in `_.noConflict`. */ |
|
var oldDash = root._; |
|
|
|
/** Used to detect if a method is native. */ |
|
var reIsNative = RegExp('^' + |
|
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') |
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' |
|
); |
|
|
|
/** Built-in value references. */ |
|
var Buffer = moduleExports ? context.Buffer : undefined, |
|
Symbol = context.Symbol, |
|
Uint8Array = context.Uint8Array, |
|
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, |
|
getPrototype = overArg(Object.getPrototypeOf, Object), |
|
objectCreate = Object.create, |
|
propertyIsEnumerable = objectProto.propertyIsEnumerable, |
|
splice = arrayProto.splice, |
|
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, |
|
symIterator = Symbol ? Symbol.iterator : undefined, |
|
symToStringTag = Symbol ? Symbol.toStringTag : undefined; |
|
|
|
var defineProperty = (function() { |
|
try { |
|
var func = getNative(Object, 'defineProperty'); |
|
func({}, '', {}); |
|
return func; |
|
} catch (e) {} |
|
}()); |
|
|
|
/** Mocked built-ins. */ |
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, |
|
ctxNow = Date && Date.now !== root.Date.now && Date.now, |
|
ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; |
|
|
|
/* Built-in method references for those with the same name as other `lodash` methods. */ |
|
var nativeCeil = Math.ceil, |
|
nativeFloor = Math.floor, |
|
nativeGetSymbols = Object.getOwnPropertySymbols, |
|
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, |
|
nativeIsFinite = context.isFinite, |
|
nativeJoin = arrayProto.join, |
|
nativeKeys = overArg(Object.keys, Object), |
|
nativeMax = Math.max, |
|
nativeMin = Math.min, |
|
nativeNow = Date.now, |
|
nativeParseInt = context.parseInt, |
|
nativeRandom = Math.random, |
|
nativeReverse = arrayProto.reverse; |
|
|
|
/* Built-in method references that are verified to be native. */ |
|
var DataView = getNative(context, 'DataView'), |
|
Map = getNative(context, 'Map'), |
|
Promise = getNative(context, 'Promise'), |
|
Set = getNative(context, 'Set'), |
|
WeakMap = getNative(context, 'WeakMap'), |
|
nativeCreate = getNative(Object, 'create'); |
|
|
|
/** Used to store function metadata. */ |
|
var metaMap = WeakMap && new WeakMap; |
|
|
|
/** Used to lookup unminified function names. */ |
|
var realNames = {}; |
|
|
|
/** Used to detect maps, sets, and weakmaps. */ |
|
var dataViewCtorString = toSource(DataView), |
|
mapCtorString = toSource(Map), |
|
promiseCtorString = toSource(Promise), |
|
setCtorString = toSource(Set), |
|
weakMapCtorString = toSource(WeakMap); |
|
|
|
/** Used to convert symbols to primitives and strings. */ |
|
var symbolProto = Symbol ? Symbol.prototype : undefined, |
|
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, |
|
symbolToString = symbolProto ? symbolProto.toString : undefined; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates a `lodash` object which wraps `value` to enable implicit method |
|
* chain sequences. Methods that operate on and return arrays, collections, |
|
* and functions can be chained together. Methods that retrieve a single value |
|
* or may return a primitive value will automatically end the chain sequence |
|
* and return the unwrapped value. Otherwise, the value must be unwrapped |
|
* with `_#value`. |
|
* |
|
* Explicit chain sequences, which must be unwrapped with `_#value`, may be |
|
* enabled using `_.chain`. |
|
* |
|
* The execution of chained methods is lazy, that is, it's deferred until |
|
* `_#value` is implicitly or explicitly called. |
|
* |
|
* Lazy evaluation allows several methods to support shortcut fusion. |
|
* Shortcut fusion is an optimization to merge iteratee calls; this avoids |
|
* the creation of intermediate arrays and can greatly reduce the number of |
|
* iteratee executions. Sections of a chain sequence qualify for shortcut |
|
* fusion if the section is applied to an array and iteratees accept only |
|
* one argument. The heuristic for whether a section qualifies for shortcut |
|
* fusion is subject to change. |
|
* |
|
* Chaining is supported in custom builds as long as the `_#value` method is |
|
* directly or indirectly included in the build. |
|
* |
|
* In addition to lodash methods, wrappers have `Array` and `String` methods. |
|
* |
|
* The wrapper `Array` methods are: |
|
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` |
|
* |
|
* The wrapper `String` methods are: |
|
* `replace` and `split` |
|
* |
|
* The wrapper methods that support shortcut fusion are: |
|
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, |
|
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, |
|
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` |
|
* |
|
* The chainable wrapper methods are: |
|
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, |
|
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, |
|
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, |
|
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, |
|
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, |
|
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, |
|
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, |
|
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, |
|
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, |
|
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, |
|
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, |
|
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, |
|
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, |
|
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, |
|
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, |
|
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, |
|
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, |
|
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, |
|
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, |
|
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, |
|
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, |
|
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, |
|
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, |
|
* `zipObject`, `zipObjectDeep`, and `zipWith` |
|
* |
|
* The wrapper methods that are **not** chainable by default are: |
|
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, |
|
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, |
|
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, |
|
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, |
|
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, |
|
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, |
|
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, |
|
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, |
|
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, |
|
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, |
|
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, |
|
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, |
|
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, |
|
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, |
|
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, |
|
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, |
|
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, |
|
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, |
|
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, |
|
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, |
|
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, |
|
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, |
|
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, |
|
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, |
|
* `upperFirst`, `value`, and `words` |
|
* |
|
* @name _ |
|
* @constructor |
|
* @category Seq |
|
* @param {*} value The value to wrap in a `lodash` instance. |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* function square(n) { |
|
* return n * n; |
|
* } |
|
* |
|
* var wrapped = _([1, 2, 3]); |
|
* |
|
* // Returns an unwrapped value. |
|
* wrapped.reduce(_.add); |
|
* // => 6 |
|
* |
|
* // Returns a wrapped value. |
|
* var squares = wrapped.map(square); |
|
* |
|
* _.isArray(squares); |
|
* // => false |
|
* |
|
* _.isArray(squares.value()); |
|
* // => true |
|
*/ |
|
function lodash(value) { |
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { |
|
if (value instanceof LodashWrapper) { |
|
return value; |
|
} |
|
if (hasOwnProperty.call(value, '__wrapped__')) { |
|
return wrapperClone(value); |
|
} |
|
} |
|
return new LodashWrapper(value); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.create` without support for assigning |
|
* properties to the created object. |
|
* |
|
* @private |
|
* @param {Object} proto The object to inherit from. |
|
* @returns {Object} Returns the new object. |
|
*/ |
|
var baseCreate = (function() { |
|
function object() {} |
|
return function(proto) { |
|
if (!isObject(proto)) { |
|
return {}; |
|
} |
|
if (objectCreate) { |
|
return objectCreate(proto); |
|
} |
|
object.prototype = proto; |
|
var result = new object; |
|
object.prototype = undefined; |
|
return result; |
|
}; |
|
}()); |
|
|
|
/** |
|
* The function whose prototype chain sequence wrappers inherit from. |
|
* |
|
* @private |
|
*/ |
|
function baseLodash() { |
|
// No operation performed. |
|
} |
|
|
|
/** |
|
* The base constructor for creating `lodash` wrapper objects. |
|
* |
|
* @private |
|
* @param {*} value The value to wrap. |
|
* @param {boolean} [chainAll] Enable explicit method chain sequences. |
|
*/ |
|
function LodashWrapper(value, chainAll) { |
|
this.__wrapped__ = value; |
|
this.__actions__ = []; |
|
this.__chain__ = !!chainAll; |
|
this.__index__ = 0; |
|
this.__values__ = undefined; |
|
} |
|
|
|
/** |
|
* By default, the template delimiters used by lodash are like those in |
|
* embedded Ruby (ERB) as well as ES2015 template strings. Change the |
|
* following template settings to use alternative delimiters. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @type {Object} |
|
*/ |
|
lodash.templateSettings = { |
|
|
|
/** |
|
* Used to detect `data` property values to be HTML-escaped. |
|
* |
|
* @memberOf _.templateSettings |
|
* @type {RegExp} |
|
*/ |
|
'escape': reEscape, |
|
|
|
/** |
|
* Used to detect code to be evaluated. |
|
* |
|
* @memberOf _.templateSettings |
|
* @type {RegExp} |
|
*/ |
|
'evaluate': reEvaluate, |
|
|
|
/** |
|
* Used to detect `data` property values to inject. |
|
* |
|
* @memberOf _.templateSettings |
|
* @type {RegExp} |
|
*/ |
|
'interpolate': reInterpolate, |
|
|
|
/** |
|
* Used to reference the data object in the template text. |
|
* |
|
* @memberOf _.templateSettings |
|
* @type {string} |
|
*/ |
|
'variable': '', |
|
|
|
/** |
|
* Used to import variables into the compiled template. |
|
* |
|
* @memberOf _.templateSettings |
|
* @type {Object} |
|
*/ |
|
'imports': { |
|
|
|
/** |
|
* A reference to the `lodash` function. |
|
* |
|
* @memberOf _.templateSettings.imports |
|
* @type {Function} |
|
*/ |
|
'_': lodash |
|
} |
|
}; |
|
|
|
// Ensure wrappers are instances of `baseLodash`. |
|
lodash.prototype = baseLodash.prototype; |
|
lodash.prototype.constructor = lodash; |
|
|
|
LodashWrapper.prototype = baseCreate(baseLodash.prototype); |
|
LodashWrapper.prototype.constructor = LodashWrapper; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. |
|
* |
|
* @private |
|
* @constructor |
|
* @param {*} value The value to wrap. |
|
*/ |
|
function LazyWrapper(value) { |
|
this.__wrapped__ = value; |
|
this.__actions__ = []; |
|
this.__dir__ = 1; |
|
this.__filtered__ = false; |
|
this.__iteratees__ = []; |
|
this.__takeCount__ = MAX_ARRAY_LENGTH; |
|
this.__views__ = []; |
|
} |
|
|
|
/** |
|
* Creates a clone of the lazy wrapper object. |
|
* |
|
* @private |
|
* @name clone |
|
* @memberOf LazyWrapper |
|
* @returns {Object} Returns the cloned `LazyWrapper` object. |
|
*/ |
|
function lazyClone() { |
|
var result = new LazyWrapper(this.__wrapped__); |
|
result.__actions__ = copyArray(this.__actions__); |
|
result.__dir__ = this.__dir__; |
|
result.__filtered__ = this.__filtered__; |
|
result.__iteratees__ = copyArray(this.__iteratees__); |
|
result.__takeCount__ = this.__takeCount__; |
|
result.__views__ = copyArray(this.__views__); |
|
return result; |
|
} |
|
|
|
/** |
|
* Reverses the direction of lazy iteration. |
|
* |
|
* @private |
|
* @name reverse |
|
* @memberOf LazyWrapper |
|
* @returns {Object} Returns the new reversed `LazyWrapper` object. |
|
*/ |
|
function lazyReverse() { |
|
if (this.__filtered__) { |
|
var result = new LazyWrapper(this); |
|
result.__dir__ = -1; |
|
result.__filtered__ = true; |
|
} else { |
|
result = this.clone(); |
|
result.__dir__ *= -1; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Extracts the unwrapped value from its lazy wrapper. |
|
* |
|
* @private |
|
* @name value |
|
* @memberOf LazyWrapper |
|
* @returns {*} Returns the unwrapped value. |
|
*/ |
|
function lazyValue() { |
|
var array = this.__wrapped__.value(), |
|
dir = this.__dir__, |
|
isArr = isArray(array), |
|
isRight = dir < 0, |
|
arrLength = isArr ? array.length : 0, |
|
view = getView(0, arrLength, this.__views__), |
|
start = view.start, |
|
end = view.end, |
|
length = end - start, |
|
index = isRight ? end : (start - 1), |
|
iteratees = this.__iteratees__, |
|
iterLength = iteratees.length, |
|
resIndex = 0, |
|
takeCount = nativeMin(length, this.__takeCount__); |
|
|
|
if (!isArr || (!isRight && arrLength == length && takeCount == length)) { |
|
return baseWrapperValue(array, this.__actions__); |
|
} |
|
var result = []; |
|
|
|
outer: |
|
while (length-- && resIndex < takeCount) { |
|
index += dir; |
|
|
|
var iterIndex = -1, |
|
value = array[index]; |
|
|
|
while (++iterIndex < iterLength) { |
|
var data = iteratees[iterIndex], |
|
iteratee = data.iteratee, |
|
type = data.type, |
|
computed = iteratee(value); |
|
|
|
if (type == LAZY_MAP_FLAG) { |
|
value = computed; |
|
} else if (!computed) { |
|
if (type == LAZY_FILTER_FLAG) { |
|
continue outer; |
|
} else { |
|
break outer; |
|
} |
|
} |
|
} |
|
result[resIndex++] = value; |
|
} |
|
return result; |
|
} |
|
|
|
// Ensure `LazyWrapper` is an instance of `baseLodash`. |
|
LazyWrapper.prototype = baseCreate(baseLodash.prototype); |
|
LazyWrapper.prototype.constructor = LazyWrapper; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates a hash object. |
|
* |
|
* @private |
|
* @constructor |
|
* @param {Array} [entries] The key-value pairs to cache. |
|
*/ |
|
function Hash(entries) { |
|
var index = -1, |
|
length = entries == null ? 0 : entries.length; |
|
|
|
this.clear(); |
|
while (++index < length) { |
|
var entry = entries[index]; |
|
this.set(entry[0], entry[1]); |
|
} |
|
} |
|
|
|
/** |
|
* Removes all key-value entries from the hash. |
|
* |
|
* @private |
|
* @name clear |
|
* @memberOf Hash |
|
*/ |
|
function hashClear() { |
|
this.__data__ = nativeCreate ? nativeCreate(null) : {}; |
|
this.size = 0; |
|
} |
|
|
|
/** |
|
* Removes `key` and its value from the hash. |
|
* |
|
* @private |
|
* @name delete |
|
* @memberOf Hash |
|
* @param {Object} hash The hash to modify. |
|
* @param {string} key The key of the value to remove. |
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
|
*/ |
|
function hashDelete(key) { |
|
var result = this.has(key) && delete this.__data__[key]; |
|
this.size -= result ? 1 : 0; |
|
return result; |
|
} |
|
|
|
/** |
|
* Gets the hash value for `key`. |
|
* |
|
* @private |
|
* @name get |
|
* @memberOf Hash |
|
* @param {string} key The key of the value to get. |
|
* @returns {*} Returns the entry value. |
|
*/ |
|
function hashGet(key) { |
|
var data = this.__data__; |
|
if (nativeCreate) { |
|
var result = data[key]; |
|
return result === HASH_UNDEFINED ? undefined : result; |
|
} |
|
return hasOwnProperty.call(data, key) ? data[key] : undefined; |
|
} |
|
|
|
/** |
|
* Checks if a hash value for `key` exists. |
|
* |
|
* @private |
|
* @name has |
|
* @memberOf Hash |
|
* @param {string} key The key of the entry to check. |
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
|
*/ |
|
function hashHas(key) { |
|
var data = this.__data__; |
|
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); |
|
} |
|
|
|
/** |
|
* Sets the hash `key` to `value`. |
|
* |
|
* @private |
|
* @name set |
|
* @memberOf Hash |
|
* @param {string} key The key of the value to set. |
|
* @param {*} value The value to set. |
|
* @returns {Object} Returns the hash instance. |
|
*/ |
|
function hashSet(key, value) { |
|
var data = this.__data__; |
|
this.size += this.has(key) ? 0 : 1; |
|
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; |
|
return this; |
|
} |
|
|
|
// Add methods to `Hash`. |
|
Hash.prototype.clear = hashClear; |
|
Hash.prototype['delete'] = hashDelete; |
|
Hash.prototype.get = hashGet; |
|
Hash.prototype.has = hashHas; |
|
Hash.prototype.set = hashSet; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates an list cache object. |
|
* |
|
* @private |
|
* @constructor |
|
* @param {Array} [entries] The key-value pairs to cache. |
|
*/ |
|
function ListCache(entries) { |
|
var index = -1, |
|
length = entries == null ? 0 : entries.length; |
|
|
|
this.clear(); |
|
while (++index < length) { |
|
var entry = entries[index]; |
|
this.set(entry[0], entry[1]); |
|
} |
|
} |
|
|
|
/** |
|
* Removes all key-value entries from the list cache. |
|
* |
|
* @private |
|
* @name clear |
|
* @memberOf ListCache |
|
*/ |
|
function listCacheClear() { |
|
this.__data__ = []; |
|
this.size = 0; |
|
} |
|
|
|
/** |
|
* Removes `key` and its value from the list cache. |
|
* |
|
* @private |
|
* @name delete |
|
* @memberOf ListCache |
|
* @param {string} key The key of the value to remove. |
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
|
*/ |
|
function listCacheDelete(key) { |
|
var data = this.__data__, |
|
index = assocIndexOf(data, key); |
|
|
|
if (index < 0) { |
|
return false; |
|
} |
|
var lastIndex = data.length - 1; |
|
if (index == lastIndex) { |
|
data.pop(); |
|
} else { |
|
splice.call(data, index, 1); |
|
} |
|
--this.size; |
|
return true; |
|
} |
|
|
|
/** |
|
* Gets the list cache value for `key`. |
|
* |
|
* @private |
|
* @name get |
|
* @memberOf ListCache |
|
* @param {string} key The key of the value to get. |
|
* @returns {*} Returns the entry value. |
|
*/ |
|
function listCacheGet(key) { |
|
var data = this.__data__, |
|
index = assocIndexOf(data, key); |
|
|
|
return index < 0 ? undefined : data[index][1]; |
|
} |
|
|
|
/** |
|
* Checks if a list cache value for `key` exists. |
|
* |
|
* @private |
|
* @name has |
|
* @memberOf ListCache |
|
* @param {string} key The key of the entry to check. |
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
|
*/ |
|
function listCacheHas(key) { |
|
return assocIndexOf(this.__data__, key) > -1; |
|
} |
|
|
|
/** |
|
* Sets the list cache `key` to `value`. |
|
* |
|
* @private |
|
* @name set |
|
* @memberOf ListCache |
|
* @param {string} key The key of the value to set. |
|
* @param {*} value The value to set. |
|
* @returns {Object} Returns the list cache instance. |
|
*/ |
|
function listCacheSet(key, value) { |
|
var data = this.__data__, |
|
index = assocIndexOf(data, key); |
|
|
|
if (index < 0) { |
|
++this.size; |
|
data.push([key, value]); |
|
} else { |
|
data[index][1] = value; |
|
} |
|
return this; |
|
} |
|
|
|
// Add methods to `ListCache`. |
|
ListCache.prototype.clear = listCacheClear; |
|
ListCache.prototype['delete'] = listCacheDelete; |
|
ListCache.prototype.get = listCacheGet; |
|
ListCache.prototype.has = listCacheHas; |
|
ListCache.prototype.set = listCacheSet; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates a map cache object to store key-value pairs. |
|
* |
|
* @private |
|
* @constructor |
|
* @param {Array} [entries] The key-value pairs to cache. |
|
*/ |
|
function MapCache(entries) { |
|
var index = -1, |
|
length = entries == null ? 0 : entries.length; |
|
|
|
this.clear(); |
|
while (++index < length) { |
|
var entry = entries[index]; |
|
this.set(entry[0], entry[1]); |
|
} |
|
} |
|
|
|
/** |
|
* Removes all key-value entries from the map. |
|
* |
|
* @private |
|
* @name clear |
|
* @memberOf MapCache |
|
*/ |
|
function mapCacheClear() { |
|
this.size = 0; |
|
this.__data__ = { |
|
'hash': new Hash, |
|
'map': new (Map || ListCache), |
|
'string': new Hash |
|
}; |
|
} |
|
|
|
/** |
|
* Removes `key` and its value from the map. |
|
* |
|
* @private |
|
* @name delete |
|
* @memberOf MapCache |
|
* @param {string} key The key of the value to remove. |
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
|
*/ |
|
function mapCacheDelete(key) { |
|
var result = getMapData(this, key)['delete'](key); |
|
this.size -= result ? 1 : 0; |
|
return result; |
|
} |
|
|
|
/** |
|
* Gets the map value for `key`. |
|
* |
|
* @private |
|
* @name get |
|
* @memberOf MapCache |
|
* @param {string} key The key of the value to get. |
|
* @returns {*} Returns the entry value. |
|
*/ |
|
function mapCacheGet(key) { |
|
return getMapData(this, key).get(key); |
|
} |
|
|
|
/** |
|
* Checks if a map value for `key` exists. |
|
* |
|
* @private |
|
* @name has |
|
* @memberOf MapCache |
|
* @param {string} key The key of the entry to check. |
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
|
*/ |
|
function mapCacheHas(key) { |
|
return getMapData(this, key).has(key); |
|
} |
|
|
|
/** |
|
* Sets the map `key` to `value`. |
|
* |
|
* @private |
|
* @name set |
|
* @memberOf MapCache |
|
* @param {string} key The key of the value to set. |
|
* @param {*} value The value to set. |
|
* @returns {Object} Returns the map cache instance. |
|
*/ |
|
function mapCacheSet(key, value) { |
|
var data = getMapData(this, key), |
|
size = data.size; |
|
|
|
data.set(key, value); |
|
this.size += data.size == size ? 0 : 1; |
|
return this; |
|
} |
|
|
|
// Add methods to `MapCache`. |
|
MapCache.prototype.clear = mapCacheClear; |
|
MapCache.prototype['delete'] = mapCacheDelete; |
|
MapCache.prototype.get = mapCacheGet; |
|
MapCache.prototype.has = mapCacheHas; |
|
MapCache.prototype.set = mapCacheSet; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* |
|
* Creates an array cache object to store unique values. |
|
* |
|
* @private |
|
* @constructor |
|
* @param {Array} [values] The values to cache. |
|
*/ |
|
function SetCache(values) { |
|
var index = -1, |
|
length = values == null ? 0 : values.length; |
|
|
|
this.__data__ = new MapCache; |
|
while (++index < length) { |
|
this.add(values[index]); |
|
} |
|
} |
|
|
|
/** |
|
* Adds `value` to the array cache. |
|
* |
|
* @private |
|
* @name add |
|
* @memberOf SetCache |
|
* @alias push |
|
* @param {*} value The value to cache. |
|
* @returns {Object} Returns the cache instance. |
|
*/ |
|
function setCacheAdd(value) { |
|
this.__data__.set(value, HASH_UNDEFINED); |
|
return this; |
|
} |
|
|
|
/** |
|
* Checks if `value` is in the array cache. |
|
* |
|
* @private |
|
* @name has |
|
* @memberOf SetCache |
|
* @param {*} value The value to search for. |
|
* @returns {number} Returns `true` if `value` is found, else `false`. |
|
*/ |
|
function setCacheHas(value) { |
|
return this.__data__.has(value); |
|
} |
|
|
|
// Add methods to `SetCache`. |
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; |
|
SetCache.prototype.has = setCacheHas; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates a stack cache object to store key-value pairs. |
|
* |
|
* @private |
|
* @constructor |
|
* @param {Array} [entries] The key-value pairs to cache. |
|
*/ |
|
function Stack(entries) { |
|
var data = this.__data__ = new ListCache(entries); |
|
this.size = data.size; |
|
} |
|
|
|
/** |
|
* Removes all key-value entries from the stack. |
|
* |
|
* @private |
|
* @name clear |
|
* @memberOf Stack |
|
*/ |
|
function stackClear() { |
|
this.__data__ = new ListCache; |
|
this.size = 0; |
|
} |
|
|
|
/** |
|
* Removes `key` and its value from the stack. |
|
* |
|
* @private |
|
* @name delete |
|
* @memberOf Stack |
|
* @param {string} key The key of the value to remove. |
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`. |
|
*/ |
|
function stackDelete(key) { |
|
var data = this.__data__, |
|
result = data['delete'](key); |
|
|
|
this.size = data.size; |
|
return result; |
|
} |
|
|
|
/** |
|
* Gets the stack value for `key`. |
|
* |
|
* @private |
|
* @name get |
|
* @memberOf Stack |
|
* @param {string} key The key of the value to get. |
|
* @returns {*} Returns the entry value. |
|
*/ |
|
function stackGet(key) { |
|
return this.__data__.get(key); |
|
} |
|
|
|
/** |
|
* Checks if a stack value for `key` exists. |
|
* |
|
* @private |
|
* @name has |
|
* @memberOf Stack |
|
* @param {string} key The key of the entry to check. |
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. |
|
*/ |
|
function stackHas(key) { |
|
return this.__data__.has(key); |
|
} |
|
|
|
/** |
|
* Sets the stack `key` to `value`. |
|
* |
|
* @private |
|
* @name set |
|
* @memberOf Stack |
|
* @param {string} key The key of the value to set. |
|
* @param {*} value The value to set. |
|
* @returns {Object} Returns the stack cache instance. |
|
*/ |
|
function stackSet(key, value) { |
|
var data = this.__data__; |
|
if (data instanceof ListCache) { |
|
var pairs = data.__data__; |
|
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { |
|
pairs.push([key, value]); |
|
this.size = ++data.size; |
|
return this; |
|
} |
|
data = this.__data__ = new MapCache(pairs); |
|
} |
|
data.set(key, value); |
|
this.size = data.size; |
|
return this; |
|
} |
|
|
|
// Add methods to `Stack`. |
|
Stack.prototype.clear = stackClear; |
|
Stack.prototype['delete'] = stackDelete; |
|
Stack.prototype.get = stackGet; |
|
Stack.prototype.has = stackHas; |
|
Stack.prototype.set = stackSet; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates an array of the enumerable property names of the array-like `value`. |
|
* |
|
* @private |
|
* @param {*} value The value to query. |
|
* @param {boolean} inherited Specify returning inherited property names. |
|
* @returns {Array} Returns the array of property names. |
|
*/ |
|
function arrayLikeKeys(value, inherited) { |
|
var isArr = isArray(value), |
|
isArg = !isArr && isArguments(value), |
|
isBuff = !isArr && !isArg && isBuffer(value), |
|
isType = !isArr && !isArg && !isBuff && isTypedArray(value), |
|
skipIndexes = isArr || isArg || isBuff || isType, |
|
result = skipIndexes ? baseTimes(value.length, String) : [], |
|
length = result.length; |
|
|
|
for (var key in value) { |
|
if ((inherited || hasOwnProperty.call(value, key)) && |
|
!(skipIndexes && ( |
|
// Safari 9 has enumerable `arguments.length` in strict mode. |
|
key == 'length' || |
|
// Node.js 0.10 has enumerable non-index properties on buffers. |
|
(isBuff && (key == 'offset' || key == 'parent')) || |
|
// PhantomJS 2 has enumerable non-index properties on typed arrays. |
|
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || |
|
// Skip index properties. |
|
isIndex(key, length) |
|
))) { |
|
result.push(key); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.sample` for arrays. |
|
* |
|
* @private |
|
* @param {Array} array The array to sample. |
|
* @returns {*} Returns the random element. |
|
*/ |
|
function arraySample(array) { |
|
var length = array.length; |
|
return length ? array[baseRandom(0, length - 1)] : undefined; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.sampleSize` for arrays. |
|
* |
|
* @private |
|
* @param {Array} array The array to sample. |
|
* @param {number} n The number of elements to sample. |
|
* @returns {Array} Returns the random elements. |
|
*/ |
|
function arraySampleSize(array, n) { |
|
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); |
|
} |
|
|
|
/** |
|
* A specialized version of `_.shuffle` for arrays. |
|
* |
|
* @private |
|
* @param {Array} array The array to shuffle. |
|
* @returns {Array} Returns the new shuffled array. |
|
*/ |
|
function arrayShuffle(array) { |
|
return shuffleSelf(copyArray(array)); |
|
} |
|
|
|
/** |
|
* This function is like `assignValue` except that it doesn't assign |
|
* `undefined` values. |
|
* |
|
* @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 assignMergeValue(object, key, value) { |
|
if ((value !== undefined && !eq(object[key], value)) || |
|
(value === undefined && !(key in object))) { |
|
baseAssignValue(object, key, value); |
|
} |
|
} |
|
|
|
/** |
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent |
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.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))) { |
|
baseAssignValue(object, key, value); |
|
} |
|
} |
|
|
|
/** |
|
* Gets the index at which the `key` is found in `array` of key-value pairs. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {*} key The key to search for. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
*/ |
|
function assocIndexOf(array, key) { |
|
var length = array.length; |
|
while (length--) { |
|
if (eq(array[length][0], key)) { |
|
return length; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
/** |
|
* Aggregates elements of `collection` on `accumulator` with keys transformed |
|
* by `iteratee` and values set by `setter`. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} setter The function to set `accumulator` values. |
|
* @param {Function} iteratee The iteratee to transform keys. |
|
* @param {Object} accumulator The initial aggregated object. |
|
* @returns {Function} Returns `accumulator`. |
|
*/ |
|
function baseAggregator(collection, setter, iteratee, accumulator) { |
|
baseEach(collection, function(value, key, collection) { |
|
setter(accumulator, value, iteratee(value), collection); |
|
}); |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.assign` without support for multiple sources |
|
* or `customizer` functions. |
|
* |
|
* @private |
|
* @param {Object} object The destination object. |
|
* @param {Object} source The source object. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function baseAssign(object, source) { |
|
return object && copyObject(source, keys(source), object); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.assignIn` without support for multiple sources |
|
* or `customizer` functions. |
|
* |
|
* @private |
|
* @param {Object} object The destination object. |
|
* @param {Object} source The source object. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function baseAssignIn(object, source) { |
|
return object && copyObject(source, keysIn(source), object); |
|
} |
|
|
|
/** |
|
* The base implementation of `assignValue` and `assignMergeValue` without |
|
* value checks. |
|
* |
|
* @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 baseAssignValue(object, key, value) { |
|
if (key == '__proto__' && defineProperty) { |
|
defineProperty(object, key, { |
|
'configurable': true, |
|
'enumerable': true, |
|
'value': value, |
|
'writable': true |
|
}); |
|
} else { |
|
object[key] = value; |
|
} |
|
} |
|
|
|
/** |
|
* The base implementation of `_.at` without support for individual paths. |
|
* |
|
* @private |
|
* @param {Object} object The object to iterate over. |
|
* @param {string[]} paths The property paths to pick. |
|
* @returns {Array} Returns the picked elements. |
|
*/ |
|
function baseAt(object, paths) { |
|
var index = -1, |
|
length = paths.length, |
|
result = Array(length), |
|
skip = object == null; |
|
|
|
while (++index < length) { |
|
result[index] = skip ? undefined : get(object, paths[index]); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.clamp` which doesn't coerce arguments. |
|
* |
|
* @private |
|
* @param {number} number The number to clamp. |
|
* @param {number} [lower] The lower bound. |
|
* @param {number} upper The upper bound. |
|
* @returns {number} Returns the clamped number. |
|
*/ |
|
function baseClamp(number, lower, upper) { |
|
if (number === number) { |
|
if (upper !== undefined) { |
|
number = number <= upper ? number : upper; |
|
} |
|
if (lower !== undefined) { |
|
number = number >= lower ? number : lower; |
|
} |
|
} |
|
return number; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.clone` and `_.cloneDeep` which tracks |
|
* traversed objects. |
|
* |
|
* @private |
|
* @param {*} value The value to clone. |
|
* @param {boolean} bitmask The bitmask flags. |
|
* 1 - Deep clone |
|
* 2 - Flatten inherited properties |
|
* 4 - Clone symbols |
|
* @param {Function} [customizer] The function to customize cloning. |
|
* @param {string} [key] The key of `value`. |
|
* @param {Object} [object] The parent object of `value`. |
|
* @param {Object} [stack] Tracks traversed objects and their clone counterparts. |
|
* @returns {*} Returns the cloned value. |
|
*/ |
|
function baseClone(value, bitmask, customizer, key, object, stack) { |
|
var result, |
|
isDeep = bitmask & CLONE_DEEP_FLAG, |
|
isFlat = bitmask & CLONE_FLAT_FLAG, |
|
isFull = bitmask & CLONE_SYMBOLS_FLAG; |
|
|
|
if (customizer) { |
|
result = object ? customizer(value, key, object, stack) : customizer(value); |
|
} |
|
if (result !== undefined) { |
|
return result; |
|
} |
|
if (!isObject(value)) { |
|
return value; |
|
} |
|
var isArr = isArray(value); |
|
if (isArr) { |
|
result = initCloneArray(value); |
|
if (!isDeep) { |
|
return copyArray(value, result); |
|
} |
|
} else { |
|
var tag = getTag(value), |
|
isFunc = tag == funcTag || tag == genTag; |
|
|
|
if (isBuffer(value)) { |
|
return cloneBuffer(value, isDeep); |
|
} |
|
if (tag == objectTag || tag == argsTag || (isFunc && !object)) { |
|
result = (isFlat || isFunc) ? {} : initCloneObject(value); |
|
if (!isDeep) { |
|
return isFlat |
|
? copySymbolsIn(value, baseAssignIn(result, value)) |
|
: copySymbols(value, baseAssign(result, value)); |
|
} |
|
} else { |
|
if (!cloneableTags[tag]) { |
|
return object ? value : {}; |
|
} |
|
result = initCloneByTag(value, tag, isDeep); |
|
} |
|
} |
|
// Check for circular references and return its corresponding clone. |
|
stack || (stack = new Stack); |
|
var stacked = stack.get(value); |
|
if (stacked) { |
|
return stacked; |
|
} |
|
stack.set(value, result); |
|
|
|
if (isSet(value)) { |
|
value.forEach(function(subValue) { |
|
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); |
|
}); |
|
} else if (isMap(value)) { |
|
value.forEach(function(subValue, key) { |
|
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); |
|
}); |
|
} |
|
|
|
var keysFunc = isFull |
|
? (isFlat ? getAllKeysIn : getAllKeys) |
|
: (isFlat ? keysIn : keys); |
|
|
|
var props = isArr ? undefined : keysFunc(value); |
|
arrayEach(props || value, function(subValue, key) { |
|
if (props) { |
|
key = subValue; |
|
subValue = value[key]; |
|
} |
|
// Recursively populate clone (susceptible to call stack limits). |
|
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.conforms` which doesn't clone `source`. |
|
* |
|
* @private |
|
* @param {Object} source The object of property predicates to conform to. |
|
* @returns {Function} Returns the new spec function. |
|
*/ |
|
function baseConforms(source) { |
|
var props = keys(source); |
|
return function(object) { |
|
return baseConformsTo(object, source, props); |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.conformsTo` which accepts `props` to check. |
|
* |
|
* @private |
|
* @param {Object} object The object to inspect. |
|
* @param {Object} source The object of property predicates to conform to. |
|
* @returns {boolean} Returns `true` if `object` conforms, else `false`. |
|
*/ |
|
function baseConformsTo(object, source, props) { |
|
var length = props.length; |
|
if (object == null) { |
|
return !length; |
|
} |
|
object = Object(object); |
|
while (length--) { |
|
var key = props[length], |
|
predicate = source[key], |
|
value = object[key]; |
|
|
|
if ((value === undefined && !(key in object)) || !predicate(value)) { |
|
return false; |
|
} |
|
} |
|
return true; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.delay` and `_.defer` which accepts `args` |
|
* to provide to `func`. |
|
* |
|
* @private |
|
* @param {Function} func The function to delay. |
|
* @param {number} wait The number of milliseconds to delay invocation. |
|
* @param {Array} args The arguments to provide to `func`. |
|
* @returns {number|Object} Returns the timer id or timeout object. |
|
*/ |
|
function baseDelay(func, wait, args) { |
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
return setTimeout(function() { func.apply(undefined, args); }, wait); |
|
} |
|
|
|
/** |
|
* The base implementation of methods like `_.difference` without support |
|
* for excluding multiple arrays or iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {Array} values The values to exclude. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of filtered values. |
|
*/ |
|
function baseDifference(array, values, iteratee, comparator) { |
|
var index = -1, |
|
includes = arrayIncludes, |
|
isCommon = true, |
|
length = array.length, |
|
result = [], |
|
valuesLength = values.length; |
|
|
|
if (!length) { |
|
return result; |
|
} |
|
if (iteratee) { |
|
values = arrayMap(values, baseUnary(iteratee)); |
|
} |
|
if (comparator) { |
|
includes = arrayIncludesWith; |
|
isCommon = false; |
|
} |
|
else if (values.length >= LARGE_ARRAY_SIZE) { |
|
includes = cacheHas; |
|
isCommon = false; |
|
values = new SetCache(values); |
|
} |
|
outer: |
|
while (++index < length) { |
|
var value = array[index], |
|
computed = iteratee == null ? value : iteratee(value); |
|
|
|
value = (comparator || value !== 0) ? value : 0; |
|
if (isCommon && computed === computed) { |
|
var valuesIndex = valuesLength; |
|
while (valuesIndex--) { |
|
if (values[valuesIndex] === computed) { |
|
continue outer; |
|
} |
|
} |
|
result.push(value); |
|
} |
|
else if (!includes(values, computed, comparator)) { |
|
result.push(value); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.forEach` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Array|Object} Returns `collection`. |
|
*/ |
|
var baseEach = createBaseEach(baseForOwn); |
|
|
|
/** |
|
* The base implementation of `_.forEachRight` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Array|Object} Returns `collection`. |
|
*/ |
|
var baseEachRight = createBaseEach(baseForOwnRight, true); |
|
|
|
/** |
|
* The base implementation of `_.every` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @returns {boolean} Returns `true` if all elements pass the predicate check, |
|
* else `false` |
|
*/ |
|
function baseEvery(collection, predicate) { |
|
var result = true; |
|
baseEach(collection, function(value, index, collection) { |
|
result = !!predicate(value, index, collection); |
|
return result; |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of methods like `_.max` and `_.min` which accepts a |
|
* `comparator` to determine the extremum value. |
|
* |
|
* @private |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} iteratee The iteratee invoked per iteration. |
|
* @param {Function} comparator The comparator used to compare values. |
|
* @returns {*} Returns the extremum value. |
|
*/ |
|
function baseExtremum(array, iteratee, comparator) { |
|
var index = -1, |
|
length = array.length; |
|
|
|
while (++index < length) { |
|
var value = array[index], |
|
current = iteratee(value); |
|
|
|
if (current != null && (computed === undefined |
|
? (current === current && !isSymbol(current)) |
|
: comparator(current, computed) |
|
)) { |
|
var computed = current, |
|
result = value; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.fill` without an iteratee call guard. |
|
* |
|
* @private |
|
* @param {Array} array The array to fill. |
|
* @param {*} value The value to fill `array` with. |
|
* @param {number} [start=0] The start position. |
|
* @param {number} [end=array.length] The end position. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function baseFill(array, value, start, end) { |
|
var length = array.length; |
|
|
|
start = toInteger(start); |
|
if (start < 0) { |
|
start = -start > length ? 0 : (length + start); |
|
} |
|
end = (end === undefined || end > length) ? length : toInteger(end); |
|
if (end < 0) { |
|
end += length; |
|
} |
|
end = start > end ? 0 : toLength(end); |
|
while (start < end) { |
|
array[start++] = value; |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.filter` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @returns {Array} Returns the new filtered array. |
|
*/ |
|
function baseFilter(collection, predicate) { |
|
var result = []; |
|
baseEach(collection, function(value, index, collection) { |
|
if (predicate(value, index, collection)) { |
|
result.push(value); |
|
} |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.flatten` with support for restricting flattening. |
|
* |
|
* @private |
|
* @param {Array} array The array to flatten. |
|
* @param {number} depth The maximum recursion depth. |
|
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration. |
|
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. |
|
* @param {Array} [result=[]] The initial result value. |
|
* @returns {Array} Returns the new flattened array. |
|
*/ |
|
function baseFlatten(array, depth, predicate, isStrict, result) { |
|
var index = -1, |
|
length = array.length; |
|
|
|
predicate || (predicate = isFlattenable); |
|
result || (result = []); |
|
|
|
while (++index < length) { |
|
var value = array[index]; |
|
if (depth > 0 && predicate(value)) { |
|
if (depth > 1) { |
|
// Recursively flatten arrays (susceptible to call stack limits). |
|
baseFlatten(value, depth - 1, predicate, isStrict, result); |
|
} else { |
|
arrayPush(result, value); |
|
} |
|
} else if (!isStrict) { |
|
result[result.length] = value; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `baseForOwn` which iterates over `object` |
|
* properties returned by `keysFunc` and invokes `iteratee` for each property. |
|
* Iteratee functions may exit iteration early by explicitly returning `false`. |
|
* |
|
* @private |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @param {Function} keysFunc The function to get the keys of `object`. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
var baseFor = createBaseFor(); |
|
|
|
/** |
|
* This function is like `baseFor` except that it iterates over properties |
|
* in the opposite order. |
|
* |
|
* @private |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @param {Function} keysFunc The function to get the keys of `object`. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
var baseForRight = createBaseFor(true); |
|
|
|
/** |
|
* The base implementation of `_.forOwn` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function baseForOwn(object, iteratee) { |
|
return object && baseFor(object, iteratee, keys); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.forOwnRight` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function baseForOwnRight(object, iteratee) { |
|
return object && baseForRight(object, iteratee, keys); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.functions` which creates an array of |
|
* `object` function property names filtered from `props`. |
|
* |
|
* @private |
|
* @param {Object} object The object to inspect. |
|
* @param {Array} props The property names to filter. |
|
* @returns {Array} Returns the function names. |
|
*/ |
|
function baseFunctions(object, props) { |
|
return arrayFilter(props, function(key) { |
|
return isFunction(object[key]); |
|
}); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.get` without support for default values. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path of the property to get. |
|
* @returns {*} Returns the resolved value. |
|
*/ |
|
function baseGet(object, path) { |
|
path = castPath(path, object); |
|
|
|
var index = 0, |
|
length = path.length; |
|
|
|
while (object != null && index < length) { |
|
object = object[toKey(path[index++])]; |
|
} |
|
return (index && index == length) ? object : undefined; |
|
} |
|
|
|
/** |
|
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses |
|
* `keysFunc` and `symbolsFunc` to get the enumerable property names and |
|
* symbols of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Function} keysFunc The function to get the keys of `object`. |
|
* @param {Function} symbolsFunc The function to get the symbols of `object`. |
|
* @returns {Array} Returns the array of property names and symbols. |
|
*/ |
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) { |
|
var result = keysFunc(object); |
|
return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); |
|
} |
|
|
|
/** |
|
* The base implementation of `getTag` without fallbacks for buggy environments. |
|
* |
|
* @private |
|
* @param {*} value The value to query. |
|
* @returns {string} Returns the `toStringTag`. |
|
*/ |
|
function baseGetTag(value) { |
|
if (value == null) { |
|
return value === undefined ? undefinedTag : nullTag; |
|
} |
|
return (symToStringTag && symToStringTag in Object(value)) |
|
? getRawTag(value) |
|
: objectToString(value); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.gt` which doesn't coerce arguments. |
|
* |
|
* @private |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {boolean} Returns `true` if `value` is greater than `other`, |
|
* else `false`. |
|
*/ |
|
function baseGt(value, other) { |
|
return value > other; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.has` without support for deep paths. |
|
* |
|
* @private |
|
* @param {Object} [object] The object to query. |
|
* @param {Array|string} key The key to check. |
|
* @returns {boolean} Returns `true` if `key` exists, else `false`. |
|
*/ |
|
function baseHas(object, key) { |
|
return object != null && hasOwnProperty.call(object, key); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.hasIn` without support for deep paths. |
|
* |
|
* @private |
|
* @param {Object} [object] The object to query. |
|
* @param {Array|string} key The key to check. |
|
* @returns {boolean} Returns `true` if `key` exists, else `false`. |
|
*/ |
|
function baseHasIn(object, key) { |
|
return object != null && key in Object(object); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.inRange` which doesn't coerce arguments. |
|
* |
|
* @private |
|
* @param {number} number The number to check. |
|
* @param {number} start The start of the range. |
|
* @param {number} end The end of the range. |
|
* @returns {boolean} Returns `true` if `number` is in the range, else `false`. |
|
*/ |
|
function baseInRange(number, start, end) { |
|
return number >= nativeMin(start, end) && number < nativeMax(start, end); |
|
} |
|
|
|
/** |
|
* The base implementation of methods like `_.intersection`, without support |
|
* for iteratee shorthands, that accepts an array of arrays to inspect. |
|
* |
|
* @private |
|
* @param {Array} arrays The arrays to inspect. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of shared values. |
|
*/ |
|
function baseIntersection(arrays, iteratee, comparator) { |
|
var includes = comparator ? arrayIncludesWith : arrayIncludes, |
|
length = arrays[0].length, |
|
othLength = arrays.length, |
|
othIndex = othLength, |
|
caches = Array(othLength), |
|
maxLength = Infinity, |
|
result = []; |
|
|
|
while (othIndex--) { |
|
var array = arrays[othIndex]; |
|
if (othIndex && iteratee) { |
|
array = arrayMap(array, baseUnary(iteratee)); |
|
} |
|
maxLength = nativeMin(array.length, maxLength); |
|
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) |
|
? new SetCache(othIndex && array) |
|
: undefined; |
|
} |
|
array = arrays[0]; |
|
|
|
var index = -1, |
|
seen = caches[0]; |
|
|
|
outer: |
|
while (++index < length && result.length < maxLength) { |
|
var value = array[index], |
|
computed = iteratee ? iteratee(value) : value; |
|
|
|
value = (comparator || value !== 0) ? value : 0; |
|
if (!(seen |
|
? cacheHas(seen, computed) |
|
: includes(result, computed, comparator) |
|
)) { |
|
othIndex = othLength; |
|
while (--othIndex) { |
|
var cache = caches[othIndex]; |
|
if (!(cache |
|
? cacheHas(cache, computed) |
|
: includes(arrays[othIndex], computed, comparator)) |
|
) { |
|
continue outer; |
|
} |
|
} |
|
if (seen) { |
|
seen.push(computed); |
|
} |
|
result.push(value); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.invert` and `_.invertBy` which inverts |
|
* `object` with values transformed by `iteratee` and set by `setter`. |
|
* |
|
* @private |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} setter The function to set `accumulator` values. |
|
* @param {Function} iteratee The iteratee to transform values. |
|
* @param {Object} accumulator The initial inverted object. |
|
* @returns {Function} Returns `accumulator`. |
|
*/ |
|
function baseInverter(object, setter, iteratee, accumulator) { |
|
baseForOwn(object, function(value, key, object) { |
|
setter(accumulator, iteratee(value), key, object); |
|
}); |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.invoke` without support for individual |
|
* method arguments. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path of the method to invoke. |
|
* @param {Array} args The arguments to invoke the method with. |
|
* @returns {*} Returns the result of the invoked method. |
|
*/ |
|
function baseInvoke(object, path, args) { |
|
path = castPath(path, object); |
|
object = parent(object, path); |
|
var func = object == null ? object : object[toKey(last(path))]; |
|
return func == null ? undefined : apply(func, object, args); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isArguments`. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object, |
|
*/ |
|
function baseIsArguments(value) { |
|
return isObjectLike(value) && baseGetTag(value) == argsTag; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isArrayBuffer` without Node.js optimizations. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. |
|
*/ |
|
function baseIsArrayBuffer(value) { |
|
return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isDate` without Node.js optimizations. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a date object, else `false`. |
|
*/ |
|
function baseIsDate(value) { |
|
return isObjectLike(value) && baseGetTag(value) == dateTag; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isEqual` which supports partial comparisons |
|
* and tracks traversed objects. |
|
* |
|
* @private |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @param {boolean} bitmask The bitmask flags. |
|
* 1 - Unordered comparison |
|
* 2 - Partial comparison |
|
* @param {Function} [customizer] The function to customize comparisons. |
|
* @param {Object} [stack] Tracks traversed `value` and `other` objects. |
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
|
*/ |
|
function baseIsEqual(value, other, bitmask, customizer, stack) { |
|
if (value === other) { |
|
return true; |
|
} |
|
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { |
|
return value !== value && other !== other; |
|
} |
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); |
|
} |
|
|
|
/** |
|
* A specialized version of `baseIsEqual` for arrays and objects which performs |
|
* deep comparisons and tracks traversed objects enabling objects with circular |
|
* references to be compared. |
|
* |
|
* @private |
|
* @param {Object} object The object to compare. |
|
* @param {Object} other The other object to compare. |
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
|
* @param {Function} customizer The function to customize comparisons. |
|
* @param {Function} equalFunc The function to determine equivalents of values. |
|
* @param {Object} [stack] Tracks traversed `object` and `other` objects. |
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
|
*/ |
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { |
|
var objIsArr = isArray(object), |
|
othIsArr = isArray(other), |
|
objTag = objIsArr ? arrayTag : getTag(object), |
|
othTag = othIsArr ? arrayTag : getTag(other); |
|
|
|
objTag = objTag == argsTag ? objectTag : objTag; |
|
othTag = othTag == argsTag ? objectTag : othTag; |
|
|
|
var objIsObj = objTag == objectTag, |
|
othIsObj = othTag == objectTag, |
|
isSameTag = objTag == othTag; |
|
|
|
if (isSameTag && isBuffer(object)) { |
|
if (!isBuffer(other)) { |
|
return false; |
|
} |
|
objIsArr = true; |
|
objIsObj = false; |
|
} |
|
if (isSameTag && !objIsObj) { |
|
stack || (stack = new Stack); |
|
return (objIsArr || isTypedArray(object)) |
|
? equalArrays(object, other, bitmask, customizer, equalFunc, stack) |
|
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); |
|
} |
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) { |
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), |
|
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); |
|
|
|
if (objIsWrapped || othIsWrapped) { |
|
var objUnwrapped = objIsWrapped ? object.value() : object, |
|
othUnwrapped = othIsWrapped ? other.value() : other; |
|
|
|
stack || (stack = new Stack); |
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); |
|
} |
|
} |
|
if (!isSameTag) { |
|
return false; |
|
} |
|
stack || (stack = new Stack); |
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isMap` without Node.js optimizations. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a map, else `false`. |
|
*/ |
|
function baseIsMap(value) { |
|
return isObjectLike(value) && getTag(value) == mapTag; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isMatch` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Object} object The object to inspect. |
|
* @param {Object} source The object of property values to match. |
|
* @param {Array} matchData The property names, values, and compare flags to match. |
|
* @param {Function} [customizer] The function to customize comparisons. |
|
* @returns {boolean} Returns `true` if `object` is a match, else `false`. |
|
*/ |
|
function baseIsMatch(object, source, matchData, customizer) { |
|
var index = matchData.length, |
|
length = index, |
|
noCustomizer = !customizer; |
|
|
|
if (object == null) { |
|
return !length; |
|
} |
|
object = Object(object); |
|
while (index--) { |
|
var data = matchData[index]; |
|
if ((noCustomizer && data[2]) |
|
? data[1] !== object[data[0]] |
|
: !(data[0] in object) |
|
) { |
|
return false; |
|
} |
|
} |
|
while (++index < length) { |
|
data = matchData[index]; |
|
var key = data[0], |
|
objValue = object[key], |
|
srcValue = data[1]; |
|
|
|
if (noCustomizer && data[2]) { |
|
if (objValue === undefined && !(key in object)) { |
|
return false; |
|
} |
|
} else { |
|
var stack = new Stack; |
|
if (customizer) { |
|
var result = customizer(objValue, srcValue, key, object, source, stack); |
|
} |
|
if (!(result === undefined |
|
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) |
|
: result |
|
)) { |
|
return false; |
|
} |
|
} |
|
} |
|
return true; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isNative` without bad shim checks. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a native function, |
|
* else `false`. |
|
*/ |
|
function baseIsNative(value) { |
|
if (!isObject(value) || isMasked(value)) { |
|
return false; |
|
} |
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor; |
|
return pattern.test(toSource(value)); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isRegExp` without Node.js optimizations. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`. |
|
*/ |
|
function baseIsRegExp(value) { |
|
return isObjectLike(value) && baseGetTag(value) == regexpTag; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isSet` without Node.js optimizations. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a set, else `false`. |
|
*/ |
|
function baseIsSet(value) { |
|
return isObjectLike(value) && getTag(value) == setTag; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.isTypedArray` without Node.js optimizations. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. |
|
*/ |
|
function baseIsTypedArray(value) { |
|
return isObjectLike(value) && |
|
isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.iteratee`. |
|
* |
|
* @private |
|
* @param {*} [value=_.identity] The value to convert to an iteratee. |
|
* @returns {Function} Returns the iteratee. |
|
*/ |
|
function baseIteratee(value) { |
|
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. |
|
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. |
|
if (typeof value == 'function') { |
|
return value; |
|
} |
|
if (value == null) { |
|
return identity; |
|
} |
|
if (typeof value == 'object') { |
|
return isArray(value) |
|
? baseMatchesProperty(value[0], value[1]) |
|
: baseMatches(value); |
|
} |
|
return property(value); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property names. |
|
*/ |
|
function baseKeys(object) { |
|
if (!isPrototype(object)) { |
|
return nativeKeys(object); |
|
} |
|
var result = []; |
|
for (var key in Object(object)) { |
|
if (hasOwnProperty.call(object, key) && key != 'constructor') { |
|
result.push(key); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property names. |
|
*/ |
|
function baseKeysIn(object) { |
|
if (!isObject(object)) { |
|
return nativeKeysIn(object); |
|
} |
|
var isProto = isPrototype(object), |
|
result = []; |
|
|
|
for (var key in object) { |
|
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { |
|
result.push(key); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.lt` which doesn't coerce arguments. |
|
* |
|
* @private |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {boolean} Returns `true` if `value` is less than `other`, |
|
* else `false`. |
|
*/ |
|
function baseLt(value, other) { |
|
return value < other; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.map` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} iteratee The function invoked per iteration. |
|
* @returns {Array} Returns the new mapped array. |
|
*/ |
|
function baseMap(collection, iteratee) { |
|
var index = -1, |
|
result = isArrayLike(collection) ? Array(collection.length) : []; |
|
|
|
baseEach(collection, function(value, key, collection) { |
|
result[++index] = iteratee(value, key, collection); |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.matches` which doesn't clone `source`. |
|
* |
|
* @private |
|
* @param {Object} source The object of property values to match. |
|
* @returns {Function} Returns the new spec function. |
|
*/ |
|
function baseMatches(source) { |
|
var matchData = getMatchData(source); |
|
if (matchData.length == 1 && matchData[0][2]) { |
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]); |
|
} |
|
return function(object) { |
|
return object === source || baseIsMatch(object, source, matchData); |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. |
|
* |
|
* @private |
|
* @param {string} path The path of the property to get. |
|
* @param {*} srcValue The value to match. |
|
* @returns {Function} Returns the new spec function. |
|
*/ |
|
function baseMatchesProperty(path, srcValue) { |
|
if (isKey(path) && isStrictComparable(srcValue)) { |
|
return matchesStrictComparable(toKey(path), srcValue); |
|
} |
|
return function(object) { |
|
var objValue = get(object, path); |
|
return (objValue === undefined && objValue === srcValue) |
|
? hasIn(object, path) |
|
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.merge` without support for multiple sources. |
|
* |
|
* @private |
|
* @param {Object} object The destination object. |
|
* @param {Object} source The source object. |
|
* @param {number} srcIndex The index of `source`. |
|
* @param {Function} [customizer] The function to customize merged values. |
|
* @param {Object} [stack] Tracks traversed source values and their merged |
|
* counterparts. |
|
*/ |
|
function baseMerge(object, source, srcIndex, customizer, stack) { |
|
if (object === source) { |
|
return; |
|
} |
|
baseFor(source, function(srcValue, key) { |
|
stack || (stack = new Stack); |
|
if (isObject(srcValue)) { |
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); |
|
} |
|
else { |
|
var newValue = customizer |
|
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) |
|
: undefined; |
|
|
|
if (newValue === undefined) { |
|
newValue = srcValue; |
|
} |
|
assignMergeValue(object, key, newValue); |
|
} |
|
}, keysIn); |
|
} |
|
|
|
/** |
|
* A specialized version of `baseMerge` for arrays and objects which performs |
|
* deep merges and tracks traversed objects enabling objects with circular |
|
* references to be merged. |
|
* |
|
* @private |
|
* @param {Object} object The destination object. |
|
* @param {Object} source The source object. |
|
* @param {string} key The key of the value to merge. |
|
* @param {number} srcIndex The index of `source`. |
|
* @param {Function} mergeFunc The function to merge values. |
|
* @param {Function} [customizer] The function to customize assigned values. |
|
* @param {Object} [stack] Tracks traversed source values and their merged |
|
* counterparts. |
|
*/ |
|
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { |
|
var objValue = safeGet(object, key), |
|
srcValue = safeGet(source, key), |
|
stacked = stack.get(srcValue); |
|
|
|
if (stacked) { |
|
assignMergeValue(object, key, stacked); |
|
return; |
|
} |
|
var newValue = customizer |
|
? customizer(objValue, srcValue, (key + ''), object, source, stack) |
|
: undefined; |
|
|
|
var isCommon = newValue === undefined; |
|
|
|
if (isCommon) { |
|
var isArr = isArray(srcValue), |
|
isBuff = !isArr && isBuffer(srcValue), |
|
isTyped = !isArr && !isBuff && isTypedArray(srcValue); |
|
|
|
newValue = srcValue; |
|
if (isArr || isBuff || isTyped) { |
|
if (isArray(objValue)) { |
|
newValue = objValue; |
|
} |
|
else if (isArrayLikeObject(objValue)) { |
|
newValue = copyArray(objValue); |
|
} |
|
else if (isBuff) { |
|
isCommon = false; |
|
newValue = cloneBuffer(srcValue, true); |
|
} |
|
else if (isTyped) { |
|
isCommon = false; |
|
newValue = cloneTypedArray(srcValue, true); |
|
} |
|
else { |
|
newValue = []; |
|
} |
|
} |
|
else if (isPlainObject(srcValue) || isArguments(srcValue)) { |
|
newValue = objValue; |
|
if (isArguments(objValue)) { |
|
newValue = toPlainObject(objValue); |
|
} |
|
else if (!isObject(objValue) || isFunction(objValue)) { |
|
newValue = initCloneObject(srcValue); |
|
} |
|
} |
|
else { |
|
isCommon = false; |
|
} |
|
} |
|
if (isCommon) { |
|
// Recursively merge objects and arrays (susceptible to call stack limits). |
|
stack.set(srcValue, newValue); |
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack); |
|
stack['delete'](srcValue); |
|
} |
|
assignMergeValue(object, key, newValue); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.nth` which doesn't coerce arguments. |
|
* |
|
* @private |
|
* @param {Array} array The array to query. |
|
* @param {number} n The index of the element to return. |
|
* @returns {*} Returns the nth element of `array`. |
|
*/ |
|
function baseNth(array, n) { |
|
var length = array.length; |
|
if (!length) { |
|
return; |
|
} |
|
n += n < 0 ? length : 0; |
|
return isIndex(n, length) ? array[n] : undefined; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.orderBy` without param guards. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. |
|
* @param {string[]} orders The sort orders of `iteratees`. |
|
* @returns {Array} Returns the new sorted array. |
|
*/ |
|
function baseOrderBy(collection, iteratees, orders) { |
|
if (iteratees.length) { |
|
iteratees = arrayMap(iteratees, function(iteratee) { |
|
if (isArray(iteratee)) { |
|
return function(value) { |
|
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); |
|
} |
|
} |
|
return iteratee; |
|
}); |
|
} else { |
|
iteratees = [identity]; |
|
} |
|
|
|
var index = -1; |
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee())); |
|
|
|
var result = baseMap(collection, function(value, key, collection) { |
|
var criteria = arrayMap(iteratees, function(iteratee) { |
|
return iteratee(value); |
|
}); |
|
return { 'criteria': criteria, 'index': ++index, 'value': value }; |
|
}); |
|
|
|
return baseSortBy(result, function(object, other) { |
|
return compareMultiple(object, other, orders); |
|
}); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.pick` without support for individual |
|
* property identifiers. |
|
* |
|
* @private |
|
* @param {Object} object The source object. |
|
* @param {string[]} paths The property paths to pick. |
|
* @returns {Object} Returns the new object. |
|
*/ |
|
function basePick(object, paths) { |
|
return basePickBy(object, paths, function(value, path) { |
|
return hasIn(object, path); |
|
}); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.pickBy` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Object} object The source object. |
|
* @param {string[]} paths The property paths to pick. |
|
* @param {Function} predicate The function invoked per property. |
|
* @returns {Object} Returns the new object. |
|
*/ |
|
function basePickBy(object, paths, predicate) { |
|
var index = -1, |
|
length = paths.length, |
|
result = {}; |
|
|
|
while (++index < length) { |
|
var path = paths[index], |
|
value = baseGet(object, path); |
|
|
|
if (predicate(value, path)) { |
|
baseSet(result, castPath(path, object), value); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* A specialized version of `baseProperty` which supports deep paths. |
|
* |
|
* @private |
|
* @param {Array|string} path The path of the property to get. |
|
* @returns {Function} Returns the new accessor function. |
|
*/ |
|
function basePropertyDeep(path) { |
|
return function(object) { |
|
return baseGet(object, path); |
|
}; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.pullAllBy` without support for iteratee |
|
* shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to modify. |
|
* @param {Array} values The values to remove. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function basePullAll(array, values, iteratee, comparator) { |
|
var indexOf = comparator ? baseIndexOfWith : baseIndexOf, |
|
index = -1, |
|
length = values.length, |
|
seen = array; |
|
|
|
if (array === values) { |
|
values = copyArray(values); |
|
} |
|
if (iteratee) { |
|
seen = arrayMap(array, baseUnary(iteratee)); |
|
} |
|
while (++index < length) { |
|
var fromIndex = 0, |
|
value = values[index], |
|
computed = iteratee ? iteratee(value) : value; |
|
|
|
while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { |
|
if (seen !== array) { |
|
splice.call(seen, fromIndex, 1); |
|
} |
|
splice.call(array, fromIndex, 1); |
|
} |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.pullAt` without support for individual |
|
* indexes or capturing the removed elements. |
|
* |
|
* @private |
|
* @param {Array} array The array to modify. |
|
* @param {number[]} indexes The indexes of elements to remove. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function basePullAt(array, indexes) { |
|
var length = array ? indexes.length : 0, |
|
lastIndex = length - 1; |
|
|
|
while (length--) { |
|
var index = indexes[length]; |
|
if (length == lastIndex || index !== previous) { |
|
var previous = index; |
|
if (isIndex(index)) { |
|
splice.call(array, index, 1); |
|
} else { |
|
baseUnset(array, index); |
|
} |
|
} |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.random` without support for returning |
|
* floating-point numbers. |
|
* |
|
* @private |
|
* @param {number} lower The lower bound. |
|
* @param {number} upper The upper bound. |
|
* @returns {number} Returns the random number. |
|
*/ |
|
function baseRandom(lower, upper) { |
|
return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.range` and `_.rangeRight` which doesn't |
|
* coerce arguments. |
|
* |
|
* @private |
|
* @param {number} start The start of the range. |
|
* @param {number} end The end of the range. |
|
* @param {number} step The value to increment or decrement by. |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {Array} Returns the range of numbers. |
|
*/ |
|
function baseRange(start, end, step, fromRight) { |
|
var index = -1, |
|
length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), |
|
result = Array(length); |
|
|
|
while (length--) { |
|
result[fromRight ? length : ++index] = start; |
|
start += step; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.repeat` which doesn't coerce arguments. |
|
* |
|
* @private |
|
* @param {string} string The string to repeat. |
|
* @param {number} n The number of times to repeat the string. |
|
* @returns {string} Returns the repeated string. |
|
*/ |
|
function baseRepeat(string, n) { |
|
var result = ''; |
|
if (!string || n < 1 || n > MAX_SAFE_INTEGER) { |
|
return result; |
|
} |
|
// Leverage the exponentiation by squaring algorithm for a faster repeat. |
|
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. |
|
do { |
|
if (n % 2) { |
|
result += string; |
|
} |
|
n = nativeFloor(n / 2); |
|
if (n) { |
|
string += string; |
|
} |
|
} while (n); |
|
|
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.rest` which doesn't validate or coerce arguments. |
|
* |
|
* @private |
|
* @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. |
|
*/ |
|
function baseRest(func, start) { |
|
return setToString(overRest(func, start, identity), func + ''); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sample`. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to sample. |
|
* @returns {*} Returns the random element. |
|
*/ |
|
function baseSample(collection) { |
|
return arraySample(values(collection)); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sampleSize` without param guards. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to sample. |
|
* @param {number} n The number of elements to sample. |
|
* @returns {Array} Returns the random elements. |
|
*/ |
|
function baseSampleSize(collection, n) { |
|
var array = values(collection); |
|
return shuffleSelf(array, baseClamp(n, 0, array.length)); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.set`. |
|
* |
|
* @private |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to set. |
|
* @param {*} value The value to set. |
|
* @param {Function} [customizer] The function to customize path creation. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function baseSet(object, path, value, customizer) { |
|
if (!isObject(object)) { |
|
return object; |
|
} |
|
path = castPath(path, object); |
|
|
|
var index = -1, |
|
length = path.length, |
|
lastIndex = length - 1, |
|
nested = object; |
|
|
|
while (nested != null && ++index < length) { |
|
var key = toKey(path[index]), |
|
newValue = value; |
|
|
|
if (key === '__proto__' || key === 'constructor' || key === 'prototype') { |
|
return object; |
|
} |
|
|
|
if (index != lastIndex) { |
|
var objValue = nested[key]; |
|
newValue = customizer ? customizer(objValue, key, nested) : undefined; |
|
if (newValue === undefined) { |
|
newValue = isObject(objValue) |
|
? objValue |
|
: (isIndex(path[index + 1]) ? [] : {}); |
|
} |
|
} |
|
assignValue(nested, key, newValue); |
|
nested = nested[key]; |
|
} |
|
return object; |
|
} |
|
|
|
/** |
|
* The base implementation of `setData` without support for hot loop shorting. |
|
* |
|
* @private |
|
* @param {Function} func The function to associate metadata with. |
|
* @param {*} data The metadata. |
|
* @returns {Function} Returns `func`. |
|
*/ |
|
var baseSetData = !metaMap ? identity : function(func, data) { |
|
metaMap.set(func, data); |
|
return func; |
|
}; |
|
|
|
/** |
|
* The base implementation of `setToString` without support for hot loop shorting. |
|
* |
|
* @private |
|
* @param {Function} func The function to modify. |
|
* @param {Function} string The `toString` result. |
|
* @returns {Function} Returns `func`. |
|
*/ |
|
var baseSetToString = !defineProperty ? identity : function(func, string) { |
|
return defineProperty(func, 'toString', { |
|
'configurable': true, |
|
'enumerable': false, |
|
'value': constant(string), |
|
'writable': true |
|
}); |
|
}; |
|
|
|
/** |
|
* The base implementation of `_.shuffle`. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to shuffle. |
|
* @returns {Array} Returns the new shuffled array. |
|
*/ |
|
function baseShuffle(collection) { |
|
return shuffleSelf(values(collection)); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.slice` without an iteratee call guard. |
|
* |
|
* @private |
|
* @param {Array} array The array to slice. |
|
* @param {number} [start=0] The start position. |
|
* @param {number} [end=array.length] The end position. |
|
* @returns {Array} Returns the slice of `array`. |
|
*/ |
|
function baseSlice(array, start, end) { |
|
var index = -1, |
|
length = array.length; |
|
|
|
if (start < 0) { |
|
start = -start > length ? 0 : (length + start); |
|
} |
|
end = end > length ? length : end; |
|
if (end < 0) { |
|
end += length; |
|
} |
|
length = start > end ? 0 : ((end - start) >>> 0); |
|
start >>>= 0; |
|
|
|
var result = Array(length); |
|
while (++index < length) { |
|
result[index] = array[index + start]; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.some` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @returns {boolean} Returns `true` if any element passes the predicate check, |
|
* else `false`. |
|
*/ |
|
function baseSome(collection, predicate) { |
|
var result; |
|
|
|
baseEach(collection, function(value, index, collection) { |
|
result = predicate(value, index, collection); |
|
return !result; |
|
}); |
|
return !!result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which |
|
* performs a binary search of `array` to determine the index at which `value` |
|
* should be inserted into `array` in order to maintain its sort order. |
|
* |
|
* @private |
|
* @param {Array} array The sorted array to inspect. |
|
* @param {*} value The value to evaluate. |
|
* @param {boolean} [retHighest] Specify returning the highest qualified index. |
|
* @returns {number} Returns the index at which `value` should be inserted |
|
* into `array`. |
|
*/ |
|
function baseSortedIndex(array, value, retHighest) { |
|
var low = 0, |
|
high = array == null ? low : array.length; |
|
|
|
if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { |
|
while (low < high) { |
|
var mid = (low + high) >>> 1, |
|
computed = array[mid]; |
|
|
|
if (computed !== null && !isSymbol(computed) && |
|
(retHighest ? (computed <= value) : (computed < value))) { |
|
low = mid + 1; |
|
} else { |
|
high = mid; |
|
} |
|
} |
|
return high; |
|
} |
|
return baseSortedIndexBy(array, value, identity, retHighest); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` |
|
* which invokes `iteratee` for `value` and each element of `array` to compute |
|
* their sort ranking. The iteratee is invoked with one argument; (value). |
|
* |
|
* @private |
|
* @param {Array} array The sorted array to inspect. |
|
* @param {*} value The value to evaluate. |
|
* @param {Function} iteratee The iteratee invoked per element. |
|
* @param {boolean} [retHighest] Specify returning the highest qualified index. |
|
* @returns {number} Returns the index at which `value` should be inserted |
|
* into `array`. |
|
*/ |
|
function baseSortedIndexBy(array, value, iteratee, retHighest) { |
|
var low = 0, |
|
high = array == null ? 0 : array.length; |
|
if (high === 0) { |
|
return 0; |
|
} |
|
|
|
value = iteratee(value); |
|
var valIsNaN = value !== value, |
|
valIsNull = value === null, |
|
valIsSymbol = isSymbol(value), |
|
valIsUndefined = value === undefined; |
|
|
|
while (low < high) { |
|
var mid = nativeFloor((low + high) / 2), |
|
computed = iteratee(array[mid]), |
|
othIsDefined = computed !== undefined, |
|
othIsNull = computed === null, |
|
othIsReflexive = computed === computed, |
|
othIsSymbol = isSymbol(computed); |
|
|
|
if (valIsNaN) { |
|
var setLow = retHighest || othIsReflexive; |
|
} else if (valIsUndefined) { |
|
setLow = othIsReflexive && (retHighest || othIsDefined); |
|
} else if (valIsNull) { |
|
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); |
|
} else if (valIsSymbol) { |
|
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); |
|
} else if (othIsNull || othIsSymbol) { |
|
setLow = false; |
|
} else { |
|
setLow = retHighest ? (computed <= value) : (computed < value); |
|
} |
|
if (setLow) { |
|
low = mid + 1; |
|
} else { |
|
high = mid; |
|
} |
|
} |
|
return nativeMin(high, MAX_ARRAY_INDEX); |
|
} |
|
|
|
/** |
|
* The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without |
|
* support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @returns {Array} Returns the new duplicate free array. |
|
*/ |
|
function baseSortedUniq(array, iteratee) { |
|
var index = -1, |
|
length = array.length, |
|
resIndex = 0, |
|
result = []; |
|
|
|
while (++index < length) { |
|
var value = array[index], |
|
computed = iteratee ? iteratee(value) : value; |
|
|
|
if (!index || !eq(computed, seen)) { |
|
var seen = computed; |
|
result[resIndex++] = value === 0 ? 0 : value; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.toNumber` which doesn't ensure correct |
|
* conversions of binary, hexadecimal, or octal string values. |
|
* |
|
* @private |
|
* @param {*} value The value to process. |
|
* @returns {number} Returns the number. |
|
*/ |
|
function baseToNumber(value) { |
|
if (typeof value == 'number') { |
|
return value; |
|
} |
|
if (isSymbol(value)) { |
|
return NAN; |
|
} |
|
return +value; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.toString` which doesn't convert nullish |
|
* values to empty strings. |
|
* |
|
* @private |
|
* @param {*} value The value to process. |
|
* @returns {string} Returns the string. |
|
*/ |
|
function baseToString(value) { |
|
// Exit early for strings to avoid a performance hit in some environments. |
|
if (typeof value == 'string') { |
|
return value; |
|
} |
|
if (isArray(value)) { |
|
// Recursively convert values (susceptible to call stack limits). |
|
return arrayMap(value, baseToString) + ''; |
|
} |
|
if (isSymbol(value)) { |
|
return symbolToString ? symbolToString.call(value) : ''; |
|
} |
|
var result = (value + ''); |
|
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.uniqBy` without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new duplicate free array. |
|
*/ |
|
function baseUniq(array, iteratee, comparator) { |
|
var index = -1, |
|
includes = arrayIncludes, |
|
length = array.length, |
|
isCommon = true, |
|
result = [], |
|
seen = result; |
|
|
|
if (comparator) { |
|
isCommon = false; |
|
includes = arrayIncludesWith; |
|
} |
|
else if (length >= LARGE_ARRAY_SIZE) { |
|
var set = iteratee ? null : createSet(array); |
|
if (set) { |
|
return setToArray(set); |
|
} |
|
isCommon = false; |
|
includes = cacheHas; |
|
seen = new SetCache; |
|
} |
|
else { |
|
seen = iteratee ? [] : result; |
|
} |
|
outer: |
|
while (++index < length) { |
|
var value = array[index], |
|
computed = iteratee ? iteratee(value) : value; |
|
|
|
value = (comparator || value !== 0) ? value : 0; |
|
if (isCommon && computed === computed) { |
|
var seenIndex = seen.length; |
|
while (seenIndex--) { |
|
if (seen[seenIndex] === computed) { |
|
continue outer; |
|
} |
|
} |
|
if (iteratee) { |
|
seen.push(computed); |
|
} |
|
result.push(value); |
|
} |
|
else if (!includes(seen, computed, comparator)) { |
|
if (seen !== result) { |
|
seen.push(computed); |
|
} |
|
result.push(value); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.unset`. |
|
* |
|
* @private |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The property path to unset. |
|
* @returns {boolean} Returns `true` if the property is deleted, else `false`. |
|
*/ |
|
function baseUnset(object, path) { |
|
path = castPath(path, object); |
|
object = parent(object, path); |
|
return object == null || delete object[toKey(last(path))]; |
|
} |
|
|
|
/** |
|
* The base implementation of `_.update`. |
|
* |
|
* @private |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to update. |
|
* @param {Function} updater The function to produce the updated value. |
|
* @param {Function} [customizer] The function to customize path creation. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function baseUpdate(object, path, updater, customizer) { |
|
return baseSet(object, path, updater(baseGet(object, path)), customizer); |
|
} |
|
|
|
/** |
|
* The base implementation of methods like `_.dropWhile` and `_.takeWhile` |
|
* without support for iteratee shorthands. |
|
* |
|
* @private |
|
* @param {Array} array The array to query. |
|
* @param {Function} predicate The function invoked per iteration. |
|
* @param {boolean} [isDrop] Specify dropping elements instead of taking them. |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {Array} Returns the slice of `array`. |
|
*/ |
|
function baseWhile(array, predicate, isDrop, fromRight) { |
|
var length = array.length, |
|
index = fromRight ? length : -1; |
|
|
|
while ((fromRight ? index-- : ++index < length) && |
|
predicate(array[index], index, array)) {} |
|
|
|
return isDrop |
|
? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) |
|
: baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); |
|
} |
|
|
|
/** |
|
* The base implementation of `wrapperValue` which returns the result of |
|
* performing a sequence of actions on the unwrapped `value`, where each |
|
* successive action is supplied the return value of the previous. |
|
* |
|
* @private |
|
* @param {*} value The unwrapped value. |
|
* @param {Array} actions Actions to perform to resolve the unwrapped value. |
|
* @returns {*} Returns the resolved value. |
|
*/ |
|
function baseWrapperValue(value, actions) { |
|
var result = value; |
|
if (result instanceof LazyWrapper) { |
|
result = result.value(); |
|
} |
|
return arrayReduce(actions, function(result, action) { |
|
return action.func.apply(action.thisArg, arrayPush([result], action.args)); |
|
}, result); |
|
} |
|
|
|
/** |
|
* The base implementation of methods like `_.xor`, without support for |
|
* iteratee shorthands, that accepts an array of arrays to inspect. |
|
* |
|
* @private |
|
* @param {Array} arrays The arrays to inspect. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of values. |
|
*/ |
|
function baseXor(arrays, iteratee, comparator) { |
|
var length = arrays.length; |
|
if (length < 2) { |
|
return length ? baseUniq(arrays[0]) : []; |
|
} |
|
var index = -1, |
|
result = Array(length); |
|
|
|
while (++index < length) { |
|
var array = arrays[index], |
|
othIndex = -1; |
|
|
|
while (++othIndex < length) { |
|
if (othIndex != index) { |
|
result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); |
|
} |
|
} |
|
} |
|
return baseUniq(baseFlatten(result, 1), iteratee, comparator); |
|
} |
|
|
|
/** |
|
* This base implementation of `_.zipObject` which assigns values using `assignFunc`. |
|
* |
|
* @private |
|
* @param {Array} props The property identifiers. |
|
* @param {Array} values The property values. |
|
* @param {Function} assignFunc The function to assign values. |
|
* @returns {Object} Returns the new object. |
|
*/ |
|
function baseZipObject(props, values, assignFunc) { |
|
var index = -1, |
|
length = props.length, |
|
valsLength = values.length, |
|
result = {}; |
|
|
|
while (++index < length) { |
|
var value = index < valsLength ? values[index] : undefined; |
|
assignFunc(result, props[index], value); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Casts `value` to an empty array if it's not an array like object. |
|
* |
|
* @private |
|
* @param {*} value The value to inspect. |
|
* @returns {Array|Object} Returns the cast array-like object. |
|
*/ |
|
function castArrayLikeObject(value) { |
|
return isArrayLikeObject(value) ? value : []; |
|
} |
|
|
|
/** |
|
* Casts `value` to `identity` if it's not a function. |
|
* |
|
* @private |
|
* @param {*} value The value to inspect. |
|
* @returns {Function} Returns cast function. |
|
*/ |
|
function castFunction(value) { |
|
return typeof value == 'function' ? value : identity; |
|
} |
|
|
|
/** |
|
* Casts `value` to a path array if it's not one. |
|
* |
|
* @private |
|
* @param {*} value The value to inspect. |
|
* @param {Object} [object] The object to query keys on. |
|
* @returns {Array} Returns the cast property path array. |
|
*/ |
|
function castPath(value, object) { |
|
if (isArray(value)) { |
|
return value; |
|
} |
|
return isKey(value, object) ? [value] : stringToPath(toString(value)); |
|
} |
|
|
|
/** |
|
* A `baseRest` alias which can be replaced with `identity` by module |
|
* replacement plugins. |
|
* |
|
* @private |
|
* @type {Function} |
|
* @param {Function} func The function to apply a rest parameter to. |
|
* @returns {Function} Returns the new function. |
|
*/ |
|
var castRest = baseRest; |
|
|
|
/** |
|
* Casts `array` to a slice if it's needed. |
|
* |
|
* @private |
|
* @param {Array} array The array to inspect. |
|
* @param {number} start The start position. |
|
* @param {number} [end=array.length] The end position. |
|
* @returns {Array} Returns the cast slice. |
|
*/ |
|
function castSlice(array, start, end) { |
|
var length = array.length; |
|
end = end === undefined ? length : end; |
|
return (!start && end >= length) ? array : baseSlice(array, start, end); |
|
} |
|
|
|
/** |
|
* A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). |
|
* |
|
* @private |
|
* @param {number|Object} id The timer id or timeout object of the timer to clear. |
|
*/ |
|
var clearTimeout = ctxClearTimeout || function(id) { |
|
return root.clearTimeout(id); |
|
}; |
|
|
|
/** |
|
* Creates a clone of `buffer`. |
|
* |
|
* @private |
|
* @param {Buffer} buffer The buffer to clone. |
|
* @param {boolean} [isDeep] Specify a deep clone. |
|
* @returns {Buffer} Returns the cloned buffer. |
|
*/ |
|
function cloneBuffer(buffer, isDeep) { |
|
if (isDeep) { |
|
return buffer.slice(); |
|
} |
|
var length = buffer.length, |
|
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); |
|
|
|
buffer.copy(result); |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates a clone of `arrayBuffer`. |
|
* |
|
* @private |
|
* @param {ArrayBuffer} arrayBuffer The array buffer to clone. |
|
* @returns {ArrayBuffer} Returns the cloned array buffer. |
|
*/ |
|
function cloneArrayBuffer(arrayBuffer) { |
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength); |
|
new Uint8Array(result).set(new Uint8Array(arrayBuffer)); |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates a clone of `dataView`. |
|
* |
|
* @private |
|
* @param {Object} dataView The data view to clone. |
|
* @param {boolean} [isDeep] Specify a deep clone. |
|
* @returns {Object} Returns the cloned data view. |
|
*/ |
|
function cloneDataView(dataView, isDeep) { |
|
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; |
|
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); |
|
} |
|
|
|
/** |
|
* Creates a clone of `regexp`. |
|
* |
|
* @private |
|
* @param {Object} regexp The regexp to clone. |
|
* @returns {Object} Returns the cloned regexp. |
|
*/ |
|
function cloneRegExp(regexp) { |
|
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); |
|
result.lastIndex = regexp.lastIndex; |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates a clone of the `symbol` object. |
|
* |
|
* @private |
|
* @param {Object} symbol The symbol object to clone. |
|
* @returns {Object} Returns the cloned symbol object. |
|
*/ |
|
function cloneSymbol(symbol) { |
|
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; |
|
} |
|
|
|
/** |
|
* Creates a clone of `typedArray`. |
|
* |
|
* @private |
|
* @param {Object} typedArray The typed array to clone. |
|
* @param {boolean} [isDeep] Specify a deep clone. |
|
* @returns {Object} Returns the cloned typed array. |
|
*/ |
|
function cloneTypedArray(typedArray, isDeep) { |
|
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; |
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); |
|
} |
|
|
|
/** |
|
* Compares values to sort them in ascending order. |
|
* |
|
* @private |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {number} Returns the sort order indicator for `value`. |
|
*/ |
|
function compareAscending(value, other) { |
|
if (value !== other) { |
|
var valIsDefined = value !== undefined, |
|
valIsNull = value === null, |
|
valIsReflexive = value === value, |
|
valIsSymbol = isSymbol(value); |
|
|
|
var othIsDefined = other !== undefined, |
|
othIsNull = other === null, |
|
othIsReflexive = other === other, |
|
othIsSymbol = isSymbol(other); |
|
|
|
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || |
|
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || |
|
(valIsNull && othIsDefined && othIsReflexive) || |
|
(!valIsDefined && othIsReflexive) || |
|
!valIsReflexive) { |
|
return 1; |
|
} |
|
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || |
|
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || |
|
(othIsNull && valIsDefined && valIsReflexive) || |
|
(!othIsDefined && valIsReflexive) || |
|
!othIsReflexive) { |
|
return -1; |
|
} |
|
} |
|
return 0; |
|
} |
|
|
|
/** |
|
* Used by `_.orderBy` to compare multiple properties of a value to another |
|
* and stable sort them. |
|
* |
|
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise, |
|
* specify an order of "desc" for descending or "asc" for ascending sort order |
|
* of corresponding values. |
|
* |
|
* @private |
|
* @param {Object} object The object to compare. |
|
* @param {Object} other The other object to compare. |
|
* @param {boolean[]|string[]} orders The order to sort by for each property. |
|
* @returns {number} Returns the sort order indicator for `object`. |
|
*/ |
|
function compareMultiple(object, other, orders) { |
|
var index = -1, |
|
objCriteria = object.criteria, |
|
othCriteria = other.criteria, |
|
length = objCriteria.length, |
|
ordersLength = orders.length; |
|
|
|
while (++index < length) { |
|
var result = compareAscending(objCriteria[index], othCriteria[index]); |
|
if (result) { |
|
if (index >= ordersLength) { |
|
return result; |
|
} |
|
var order = orders[index]; |
|
return result * (order == 'desc' ? -1 : 1); |
|
} |
|
} |
|
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications |
|
// that causes it, under certain circumstances, to provide the same value for |
|
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 |
|
// for more details. |
|
// |
|
// This also ensures a stable sort in V8 and other engines. |
|
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. |
|
return object.index - other.index; |
|
} |
|
|
|
/** |
|
* Creates an array that is the composition of partially applied arguments, |
|
* placeholders, and provided arguments into a single array of arguments. |
|
* |
|
* @private |
|
* @param {Array} args The provided arguments. |
|
* @param {Array} partials The arguments to prepend to those provided. |
|
* @param {Array} holders The `partials` placeholder indexes. |
|
* @params {boolean} [isCurried] Specify composing for a curried function. |
|
* @returns {Array} Returns the new array of composed arguments. |
|
*/ |
|
function composeArgs(args, partials, holders, isCurried) { |
|
var argsIndex = -1, |
|
argsLength = args.length, |
|
holdersLength = holders.length, |
|
leftIndex = -1, |
|
leftLength = partials.length, |
|
rangeLength = nativeMax(argsLength - holdersLength, 0), |
|
result = Array(leftLength + rangeLength), |
|
isUncurried = !isCurried; |
|
|
|
while (++leftIndex < leftLength) { |
|
result[leftIndex] = partials[leftIndex]; |
|
} |
|
while (++argsIndex < holdersLength) { |
|
if (isUncurried || argsIndex < argsLength) { |
|
result[holders[argsIndex]] = args[argsIndex]; |
|
} |
|
} |
|
while (rangeLength--) { |
|
result[leftIndex++] = args[argsIndex++]; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* This function is like `composeArgs` except that the arguments composition |
|
* is tailored for `_.partialRight`. |
|
* |
|
* @private |
|
* @param {Array} args The provided arguments. |
|
* @param {Array} partials The arguments to append to those provided. |
|
* @param {Array} holders The `partials` placeholder indexes. |
|
* @params {boolean} [isCurried] Specify composing for a curried function. |
|
* @returns {Array} Returns the new array of composed arguments. |
|
*/ |
|
function composeArgsRight(args, partials, holders, isCurried) { |
|
var argsIndex = -1, |
|
argsLength = args.length, |
|
holdersIndex = -1, |
|
holdersLength = holders.length, |
|
rightIndex = -1, |
|
rightLength = partials.length, |
|
rangeLength = nativeMax(argsLength - holdersLength, 0), |
|
result = Array(rangeLength + rightLength), |
|
isUncurried = !isCurried; |
|
|
|
while (++argsIndex < rangeLength) { |
|
result[argsIndex] = args[argsIndex]; |
|
} |
|
var offset = argsIndex; |
|
while (++rightIndex < rightLength) { |
|
result[offset + rightIndex] = partials[rightIndex]; |
|
} |
|
while (++holdersIndex < holdersLength) { |
|
if (isUncurried || argsIndex < argsLength) { |
|
result[offset + holders[holdersIndex]] = args[argsIndex++]; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Copies the values of `source` to `array`. |
|
* |
|
* @private |
|
* @param {Array} source The array to copy values from. |
|
* @param {Array} [array=[]] The array to copy values to. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function copyArray(source, array) { |
|
var index = -1, |
|
length = source.length; |
|
|
|
array || (array = Array(length)); |
|
while (++index < length) { |
|
array[index] = source[index]; |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* Copies properties of `source` to `object`. |
|
* |
|
* @private |
|
* @param {Object} source The object to copy properties from. |
|
* @param {Array} props The property identifiers 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 copyObject(source, props, object, customizer) { |
|
var isNew = !object; |
|
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) |
|
: undefined; |
|
|
|
if (newValue === undefined) { |
|
newValue = source[key]; |
|
} |
|
if (isNew) { |
|
baseAssignValue(object, key, newValue); |
|
} else { |
|
assignValue(object, key, newValue); |
|
} |
|
} |
|
return object; |
|
} |
|
|
|
/** |
|
* Copies own symbols of `source` to `object`. |
|
* |
|
* @private |
|
* @param {Object} source The object to copy symbols from. |
|
* @param {Object} [object={}] The object to copy symbols to. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function copySymbols(source, object) { |
|
return copyObject(source, getSymbols(source), object); |
|
} |
|
|
|
/** |
|
* Copies own and inherited symbols of `source` to `object`. |
|
* |
|
* @private |
|
* @param {Object} source The object to copy symbols from. |
|
* @param {Object} [object={}] The object to copy symbols to. |
|
* @returns {Object} Returns `object`. |
|
*/ |
|
function copySymbolsIn(source, object) { |
|
return copyObject(source, getSymbolsIn(source), object); |
|
} |
|
|
|
/** |
|
* Creates a function like `_.groupBy`. |
|
* |
|
* @private |
|
* @param {Function} setter The function to set accumulator values. |
|
* @param {Function} [initializer] The accumulator object initializer. |
|
* @returns {Function} Returns the new aggregator function. |
|
*/ |
|
function createAggregator(setter, initializer) { |
|
return function(collection, iteratee) { |
|
var func = isArray(collection) ? arrayAggregator : baseAggregator, |
|
accumulator = initializer ? initializer() : {}; |
|
|
|
return func(collection, setter, getIteratee(iteratee, 2), accumulator); |
|
}; |
|
} |
|
|
|
/** |
|
* 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 baseRest(function(object, sources) { |
|
var index = -1, |
|
length = sources.length, |
|
customizer = length > 1 ? sources[length - 1] : undefined, |
|
guard = length > 2 ? sources[2] : undefined; |
|
|
|
customizer = (assigner.length > 3 && 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; |
|
}); |
|
} |
|
|
|
/** |
|
* Creates a `baseEach` or `baseEachRight` function. |
|
* |
|
* @private |
|
* @param {Function} eachFunc The function to iterate over a collection. |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {Function} Returns the new base function. |
|
*/ |
|
function createBaseEach(eachFunc, fromRight) { |
|
return function(collection, iteratee) { |
|
if (collection == null) { |
|
return collection; |
|
} |
|
if (!isArrayLike(collection)) { |
|
return eachFunc(collection, iteratee); |
|
} |
|
var length = collection.length, |
|
index = fromRight ? length : -1, |
|
iterable = Object(collection); |
|
|
|
while ((fromRight ? index-- : ++index < length)) { |
|
if (iteratee(iterable[index], index, iterable) === false) { |
|
break; |
|
} |
|
} |
|
return collection; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a base function for methods like `_.forIn` and `_.forOwn`. |
|
* |
|
* @private |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {Function} Returns the new base function. |
|
*/ |
|
function createBaseFor(fromRight) { |
|
return function(object, iteratee, keysFunc) { |
|
var index = -1, |
|
iterable = Object(object), |
|
props = keysFunc(object), |
|
length = props.length; |
|
|
|
while (length--) { |
|
var key = props[fromRight ? length : ++index]; |
|
if (iteratee(iterable[key], key, iterable) === false) { |
|
break; |
|
} |
|
} |
|
return object; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that wraps `func` to invoke it with the optional `this` |
|
* binding of `thisArg`. |
|
* |
|
* @private |
|
* @param {Function} func The function to wrap. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @param {*} [thisArg] The `this` binding of `func`. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createBind(func, bitmask, thisArg) { |
|
var isBind = bitmask & WRAP_BIND_FLAG, |
|
Ctor = createCtor(func); |
|
|
|
function wrapper() { |
|
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; |
|
return fn.apply(isBind ? thisArg : this, arguments); |
|
} |
|
return wrapper; |
|
} |
|
|
|
/** |
|
* Creates a function like `_.lowerFirst`. |
|
* |
|
* @private |
|
* @param {string} methodName The name of the `String` case method to use. |
|
* @returns {Function} Returns the new case function. |
|
*/ |
|
function createCaseFirst(methodName) { |
|
return function(string) { |
|
string = toString(string); |
|
|
|
var strSymbols = hasUnicode(string) |
|
? stringToArray(string) |
|
: undefined; |
|
|
|
var chr = strSymbols |
|
? strSymbols[0] |
|
: string.charAt(0); |
|
|
|
var trailing = strSymbols |
|
? castSlice(strSymbols, 1).join('') |
|
: string.slice(1); |
|
|
|
return chr[methodName]() + trailing; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function like `_.camelCase`. |
|
* |
|
* @private |
|
* @param {Function} callback The function to combine each word. |
|
* @returns {Function} Returns the new compounder function. |
|
*/ |
|
function createCompounder(callback) { |
|
return function(string) { |
|
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that produces an instance of `Ctor` regardless of |
|
* whether it was invoked as part of a `new` expression or by `call` or `apply`. |
|
* |
|
* @private |
|
* @param {Function} Ctor The constructor to wrap. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createCtor(Ctor) { |
|
return function() { |
|
// Use a `switch` statement to work with class constructors. See |
|
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist |
|
// for more details. |
|
var args = arguments; |
|
switch (args.length) { |
|
case 0: return new Ctor; |
|
case 1: return new Ctor(args[0]); |
|
case 2: return new Ctor(args[0], args[1]); |
|
case 3: return new Ctor(args[0], args[1], args[2]); |
|
case 4: return new Ctor(args[0], args[1], args[2], args[3]); |
|
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); |
|
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); |
|
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); |
|
} |
|
var thisBinding = baseCreate(Ctor.prototype), |
|
result = Ctor.apply(thisBinding, args); |
|
|
|
// Mimic the constructor's `return` behavior. |
|
// See https://es5.github.io/#x13.2.2 for more details. |
|
return isObject(result) ? result : thisBinding; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that wraps `func` to enable currying. |
|
* |
|
* @private |
|
* @param {Function} func The function to wrap. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @param {number} arity The arity of `func`. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createCurry(func, bitmask, arity) { |
|
var Ctor = createCtor(func); |
|
|
|
function wrapper() { |
|
var length = arguments.length, |
|
args = Array(length), |
|
index = length, |
|
placeholder = getHolder(wrapper); |
|
|
|
while (index--) { |
|
args[index] = arguments[index]; |
|
} |
|
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) |
|
? [] |
|
: replaceHolders(args, placeholder); |
|
|
|
length -= holders.length; |
|
if (length < arity) { |
|
return createRecurry( |
|
func, bitmask, createHybrid, wrapper.placeholder, undefined, |
|
args, holders, undefined, undefined, arity - length); |
|
} |
|
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; |
|
return apply(fn, this, args); |
|
} |
|
return wrapper; |
|
} |
|
|
|
/** |
|
* Creates a `_.find` or `_.findLast` function. |
|
* |
|
* @private |
|
* @param {Function} findIndexFunc The function to find the collection index. |
|
* @returns {Function} Returns the new find function. |
|
*/ |
|
function createFind(findIndexFunc) { |
|
return function(collection, predicate, fromIndex) { |
|
var iterable = Object(collection); |
|
if (!isArrayLike(collection)) { |
|
var iteratee = getIteratee(predicate, 3); |
|
collection = keys(collection); |
|
predicate = function(key) { return iteratee(iterable[key], key, iterable); }; |
|
} |
|
var index = findIndexFunc(collection, predicate, fromIndex); |
|
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a `_.flow` or `_.flowRight` function. |
|
* |
|
* @private |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {Function} Returns the new flow function. |
|
*/ |
|
function createFlow(fromRight) { |
|
return flatRest(function(funcs) { |
|
var length = funcs.length, |
|
index = length, |
|
prereq = LodashWrapper.prototype.thru; |
|
|
|
if (fromRight) { |
|
funcs.reverse(); |
|
} |
|
while (index--) { |
|
var func = funcs[index]; |
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
if (prereq && !wrapper && getFuncName(func) == 'wrapper') { |
|
var wrapper = new LodashWrapper([], true); |
|
} |
|
} |
|
index = wrapper ? index : length; |
|
while (++index < length) { |
|
func = funcs[index]; |
|
|
|
var funcName = getFuncName(func), |
|
data = funcName == 'wrapper' ? getData(func) : undefined; |
|
|
|
if (data && isLaziable(data[0]) && |
|
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && |
|
!data[4].length && data[9] == 1 |
|
) { |
|
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); |
|
} else { |
|
wrapper = (func.length == 1 && isLaziable(func)) |
|
? wrapper[funcName]() |
|
: wrapper.thru(func); |
|
} |
|
} |
|
return function() { |
|
var args = arguments, |
|
value = args[0]; |
|
|
|
if (wrapper && args.length == 1 && isArray(value)) { |
|
return wrapper.plant(value).value(); |
|
} |
|
var index = 0, |
|
result = length ? funcs[index].apply(this, args) : value; |
|
|
|
while (++index < length) { |
|
result = funcs[index].call(this, result); |
|
} |
|
return result; |
|
}; |
|
}); |
|
} |
|
|
|
/** |
|
* Creates a function that wraps `func` to invoke it with optional `this` |
|
* binding of `thisArg`, partial application, and currying. |
|
* |
|
* @private |
|
* @param {Function|string} func The function or method name to wrap. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @param {*} [thisArg] The `this` binding of `func`. |
|
* @param {Array} [partials] The arguments to prepend to those provided to |
|
* the new function. |
|
* @param {Array} [holders] The `partials` placeholder indexes. |
|
* @param {Array} [partialsRight] The arguments to append to those provided |
|
* to the new function. |
|
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes. |
|
* @param {Array} [argPos] The argument positions of the new function. |
|
* @param {number} [ary] The arity cap of `func`. |
|
* @param {number} [arity] The arity of `func`. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { |
|
var isAry = bitmask & WRAP_ARY_FLAG, |
|
isBind = bitmask & WRAP_BIND_FLAG, |
|
isBindKey = bitmask & WRAP_BIND_KEY_FLAG, |
|
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), |
|
isFlip = bitmask & WRAP_FLIP_FLAG, |
|
Ctor = isBindKey ? undefined : createCtor(func); |
|
|
|
function wrapper() { |
|
var length = arguments.length, |
|
args = Array(length), |
|
index = length; |
|
|
|
while (index--) { |
|
args[index] = arguments[index]; |
|
} |
|
if (isCurried) { |
|
var placeholder = getHolder(wrapper), |
|
holdersCount = countHolders(args, placeholder); |
|
} |
|
if (partials) { |
|
args = composeArgs(args, partials, holders, isCurried); |
|
} |
|
if (partialsRight) { |
|
args = composeArgsRight(args, partialsRight, holdersRight, isCurried); |
|
} |
|
length -= holdersCount; |
|
if (isCurried && length < arity) { |
|
var newHolders = replaceHolders(args, placeholder); |
|
return createRecurry( |
|
func, bitmask, createHybrid, wrapper.placeholder, thisArg, |
|
args, newHolders, argPos, ary, arity - length |
|
); |
|
} |
|
var thisBinding = isBind ? thisArg : this, |
|
fn = isBindKey ? thisBinding[func] : func; |
|
|
|
length = args.length; |
|
if (argPos) { |
|
args = reorder(args, argPos); |
|
} else if (isFlip && length > 1) { |
|
args.reverse(); |
|
} |
|
if (isAry && ary < length) { |
|
args.length = ary; |
|
} |
|
if (this && this !== root && this instanceof wrapper) { |
|
fn = Ctor || createCtor(fn); |
|
} |
|
return fn.apply(thisBinding, args); |
|
} |
|
return wrapper; |
|
} |
|
|
|
/** |
|
* Creates a function like `_.invertBy`. |
|
* |
|
* @private |
|
* @param {Function} setter The function to set accumulator values. |
|
* @param {Function} toIteratee The function to resolve iteratees. |
|
* @returns {Function} Returns the new inverter function. |
|
*/ |
|
function createInverter(setter, toIteratee) { |
|
return function(object, iteratee) { |
|
return baseInverter(object, setter, toIteratee(iteratee), {}); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that performs a mathematical operation on two values. |
|
* |
|
* @private |
|
* @param {Function} operator The function to perform the operation. |
|
* @param {number} [defaultValue] The value used for `undefined` arguments. |
|
* @returns {Function} Returns the new mathematical operation function. |
|
*/ |
|
function createMathOperation(operator, defaultValue) { |
|
return function(value, other) { |
|
var result; |
|
if (value === undefined && other === undefined) { |
|
return defaultValue; |
|
} |
|
if (value !== undefined) { |
|
result = value; |
|
} |
|
if (other !== undefined) { |
|
if (result === undefined) { |
|
return other; |
|
} |
|
if (typeof value == 'string' || typeof other == 'string') { |
|
value = baseToString(value); |
|
other = baseToString(other); |
|
} else { |
|
value = baseToNumber(value); |
|
other = baseToNumber(other); |
|
} |
|
result = operator(value, other); |
|
} |
|
return result; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function like `_.over`. |
|
* |
|
* @private |
|
* @param {Function} arrayFunc The function to iterate over iteratees. |
|
* @returns {Function} Returns the new over function. |
|
*/ |
|
function createOver(arrayFunc) { |
|
return flatRest(function(iteratees) { |
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee())); |
|
return baseRest(function(args) { |
|
var thisArg = this; |
|
return arrayFunc(iteratees, function(iteratee) { |
|
return apply(iteratee, thisArg, args); |
|
}); |
|
}); |
|
}); |
|
} |
|
|
|
/** |
|
* Creates the padding for `string` based on `length`. The `chars` string |
|
* is truncated if the number of characters exceeds `length`. |
|
* |
|
* @private |
|
* @param {number} length The padding length. |
|
* @param {string} [chars=' '] The string used as padding. |
|
* @returns {string} Returns the padding for `string`. |
|
*/ |
|
function createPadding(length, chars) { |
|
chars = chars === undefined ? ' ' : baseToString(chars); |
|
|
|
var charsLength = chars.length; |
|
if (charsLength < 2) { |
|
return charsLength ? baseRepeat(chars, length) : chars; |
|
} |
|
var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); |
|
return hasUnicode(chars) |
|
? castSlice(stringToArray(result), 0, length).join('') |
|
: result.slice(0, length); |
|
} |
|
|
|
/** |
|
* Creates a function that wraps `func` to invoke it with the `this` binding |
|
* of `thisArg` and `partials` prepended to the arguments it receives. |
|
* |
|
* @private |
|
* @param {Function} func The function to wrap. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @param {*} thisArg The `this` binding of `func`. |
|
* @param {Array} partials The arguments to prepend to those provided to |
|
* the new function. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createPartial(func, bitmask, thisArg, partials) { |
|
var isBind = bitmask & WRAP_BIND_FLAG, |
|
Ctor = createCtor(func); |
|
|
|
function wrapper() { |
|
var argsIndex = -1, |
|
argsLength = arguments.length, |
|
leftIndex = -1, |
|
leftLength = partials.length, |
|
args = Array(leftLength + argsLength), |
|
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; |
|
|
|
while (++leftIndex < leftLength) { |
|
args[leftIndex] = partials[leftIndex]; |
|
} |
|
while (argsLength--) { |
|
args[leftIndex++] = arguments[++argsIndex]; |
|
} |
|
return apply(fn, isBind ? thisArg : this, args); |
|
} |
|
return wrapper; |
|
} |
|
|
|
/** |
|
* Creates a `_.range` or `_.rangeRight` function. |
|
* |
|
* @private |
|
* @param {boolean} [fromRight] Specify iterating from right to left. |
|
* @returns {Function} Returns the new range function. |
|
*/ |
|
function createRange(fromRight) { |
|
return function(start, end, step) { |
|
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { |
|
end = step = undefined; |
|
} |
|
// Ensure the sign of `-0` is preserved. |
|
start = toFinite(start); |
|
if (end === undefined) { |
|
end = start; |
|
start = 0; |
|
} else { |
|
end = toFinite(end); |
|
} |
|
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); |
|
return baseRange(start, end, step, fromRight); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that performs a relational operation on two values. |
|
* |
|
* @private |
|
* @param {Function} operator The function to perform the operation. |
|
* @returns {Function} Returns the new relational operation function. |
|
*/ |
|
function createRelationalOperation(operator) { |
|
return function(value, other) { |
|
if (!(typeof value == 'string' && typeof other == 'string')) { |
|
value = toNumber(value); |
|
other = toNumber(other); |
|
} |
|
return operator(value, other); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that wraps `func` to continue currying. |
|
* |
|
* @private |
|
* @param {Function} func The function to wrap. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @param {Function} wrapFunc The function to create the `func` wrapper. |
|
* @param {*} placeholder The placeholder value. |
|
* @param {*} [thisArg] The `this` binding of `func`. |
|
* @param {Array} [partials] The arguments to prepend to those provided to |
|
* the new function. |
|
* @param {Array} [holders] The `partials` placeholder indexes. |
|
* @param {Array} [argPos] The argument positions of the new function. |
|
* @param {number} [ary] The arity cap of `func`. |
|
* @param {number} [arity] The arity of `func`. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { |
|
var isCurry = bitmask & WRAP_CURRY_FLAG, |
|
newHolders = isCurry ? holders : undefined, |
|
newHoldersRight = isCurry ? undefined : holders, |
|
newPartials = isCurry ? partials : undefined, |
|
newPartialsRight = isCurry ? undefined : partials; |
|
|
|
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); |
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); |
|
|
|
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { |
|
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); |
|
} |
|
var newData = [ |
|
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, |
|
newHoldersRight, argPos, ary, arity |
|
]; |
|
|
|
var result = wrapFunc.apply(undefined, newData); |
|
if (isLaziable(func)) { |
|
setData(result, newData); |
|
} |
|
result.placeholder = placeholder; |
|
return setWrapToString(result, func, bitmask); |
|
} |
|
|
|
/** |
|
* Creates a function like `_.round`. |
|
* |
|
* @private |
|
* @param {string} methodName The name of the `Math` method to use when rounding. |
|
* @returns {Function} Returns the new round function. |
|
*/ |
|
function createRound(methodName) { |
|
var func = Math[methodName]; |
|
return function(number, precision) { |
|
number = toNumber(number); |
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); |
|
if (precision && nativeIsFinite(number)) { |
|
// Shift with exponential notation to avoid floating-point issues. |
|
// See [MDN](https://mdn.io/round#Examples) for more details. |
|
var pair = (toString(number) + 'e').split('e'), |
|
value = func(pair[0] + 'e' + (+pair[1] + precision)); |
|
|
|
pair = (toString(value) + 'e').split('e'); |
|
return +(pair[0] + 'e' + (+pair[1] - precision)); |
|
} |
|
return func(number); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a set object of `values`. |
|
* |
|
* @private |
|
* @param {Array} values The values to add to the set. |
|
* @returns {Object} Returns the new set. |
|
*/ |
|
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { |
|
return new Set(values); |
|
}; |
|
|
|
/** |
|
* Creates a `_.toPairs` or `_.toPairsIn` function. |
|
* |
|
* @private |
|
* @param {Function} keysFunc The function to get the keys of a given object. |
|
* @returns {Function} Returns the new pairs function. |
|
*/ |
|
function createToPairs(keysFunc) { |
|
return function(object) { |
|
var tag = getTag(object); |
|
if (tag == mapTag) { |
|
return mapToArray(object); |
|
} |
|
if (tag == setTag) { |
|
return setToPairs(object); |
|
} |
|
return baseToPairs(object, keysFunc(object)); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that either curries or invokes `func` with optional |
|
* `this` binding and partially applied arguments. |
|
* |
|
* @private |
|
* @param {Function|string} func The function or method name to wrap. |
|
* @param {number} bitmask The bitmask flags. |
|
* 1 - `_.bind` |
|
* 2 - `_.bindKey` |
|
* 4 - `_.curry` or `_.curryRight` of a bound function |
|
* 8 - `_.curry` |
|
* 16 - `_.curryRight` |
|
* 32 - `_.partial` |
|
* 64 - `_.partialRight` |
|
* 128 - `_.rearg` |
|
* 256 - `_.ary` |
|
* 512 - `_.flip` |
|
* @param {*} [thisArg] The `this` binding of `func`. |
|
* @param {Array} [partials] The arguments to be partially applied. |
|
* @param {Array} [holders] The `partials` placeholder indexes. |
|
* @param {Array} [argPos] The argument positions of the new function. |
|
* @param {number} [ary] The arity cap of `func`. |
|
* @param {number} [arity] The arity of `func`. |
|
* @returns {Function} Returns the new wrapped function. |
|
*/ |
|
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { |
|
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; |
|
if (!isBindKey && typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
var length = partials ? partials.length : 0; |
|
if (!length) { |
|
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); |
|
partials = holders = undefined; |
|
} |
|
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); |
|
arity = arity === undefined ? arity : toInteger(arity); |
|
length -= holders ? holders.length : 0; |
|
|
|
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { |
|
var partialsRight = partials, |
|
holdersRight = holders; |
|
|
|
partials = holders = undefined; |
|
} |
|
var data = isBindKey ? undefined : getData(func); |
|
|
|
var newData = [ |
|
func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, |
|
argPos, ary, arity |
|
]; |
|
|
|
if (data) { |
|
mergeData(newData, data); |
|
} |
|
func = newData[0]; |
|
bitmask = newData[1]; |
|
thisArg = newData[2]; |
|
partials = newData[3]; |
|
holders = newData[4]; |
|
arity = newData[9] = newData[9] === undefined |
|
? (isBindKey ? 0 : func.length) |
|
: nativeMax(newData[9] - length, 0); |
|
|
|
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { |
|
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); |
|
} |
|
if (!bitmask || bitmask == WRAP_BIND_FLAG) { |
|
var result = createBind(func, bitmask, thisArg); |
|
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { |
|
result = createCurry(func, bitmask, arity); |
|
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { |
|
result = createPartial(func, bitmask, thisArg, partials); |
|
} else { |
|
result = createHybrid.apply(undefined, newData); |
|
} |
|
var setter = data ? baseSetData : setData; |
|
return setWrapToString(setter(result, newData), func, bitmask); |
|
} |
|
|
|
/** |
|
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties |
|
* of source objects to the destination object for all destination properties |
|
* that resolve to `undefined`. |
|
* |
|
* @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 customDefaultsAssignIn(objValue, srcValue, key, object) { |
|
if (objValue === undefined || |
|
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { |
|
return srcValue; |
|
} |
|
return objValue; |
|
} |
|
|
|
/** |
|
* Used by `_.defaultsDeep` to customize its `_.merge` use to merge source |
|
* objects into destination objects that are passed thru. |
|
* |
|
* @private |
|
* @param {*} objValue The destination value. |
|
* @param {*} srcValue The source value. |
|
* @param {string} key The key of the property to merge. |
|
* @param {Object} object The parent object of `objValue`. |
|
* @param {Object} source The parent object of `srcValue`. |
|
* @param {Object} [stack] Tracks traversed source values and their merged |
|
* counterparts. |
|
* @returns {*} Returns the value to assign. |
|
*/ |
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { |
|
if (isObject(objValue) && isObject(srcValue)) { |
|
// Recursively merge objects and arrays (susceptible to call stack limits). |
|
stack.set(srcValue, objValue); |
|
baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); |
|
stack['delete'](srcValue); |
|
} |
|
return objValue; |
|
} |
|
|
|
/** |
|
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain |
|
* objects. |
|
* |
|
* @private |
|
* @param {*} value The value to inspect. |
|
* @param {string} key The key of the property to inspect. |
|
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. |
|
*/ |
|
function customOmitClone(value) { |
|
return isPlainObject(value) ? undefined : value; |
|
} |
|
|
|
/** |
|
* A specialized version of `baseIsEqualDeep` for arrays with support for |
|
* partial deep comparisons. |
|
* |
|
* @private |
|
* @param {Array} array The array to compare. |
|
* @param {Array} other The other array to compare. |
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
|
* @param {Function} customizer The function to customize comparisons. |
|
* @param {Function} equalFunc The function to determine equivalents of values. |
|
* @param {Object} stack Tracks traversed `array` and `other` objects. |
|
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. |
|
*/ |
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { |
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, |
|
arrLength = array.length, |
|
othLength = other.length; |
|
|
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) { |
|
return false; |
|
} |
|
// Check that cyclic values are equal. |
|
var arrStacked = stack.get(array); |
|
var othStacked = stack.get(other); |
|
if (arrStacked && othStacked) { |
|
return arrStacked == other && othStacked == array; |
|
} |
|
var index = -1, |
|
result = true, |
|
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; |
|
|
|
stack.set(array, other); |
|
stack.set(other, array); |
|
|
|
// Ignore non-index properties. |
|
while (++index < arrLength) { |
|
var arrValue = array[index], |
|
othValue = other[index]; |
|
|
|
if (customizer) { |
|
var compared = isPartial |
|
? customizer(othValue, arrValue, index, other, array, stack) |
|
: customizer(arrValue, othValue, index, array, other, stack); |
|
} |
|
if (compared !== undefined) { |
|
if (compared) { |
|
continue; |
|
} |
|
result = false; |
|
break; |
|
} |
|
// Recursively compare arrays (susceptible to call stack limits). |
|
if (seen) { |
|
if (!arraySome(other, function(othValue, othIndex) { |
|
if (!cacheHas(seen, othIndex) && |
|
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { |
|
return seen.push(othIndex); |
|
} |
|
})) { |
|
result = false; |
|
break; |
|
} |
|
} else if (!( |
|
arrValue === othValue || |
|
equalFunc(arrValue, othValue, bitmask, customizer, stack) |
|
)) { |
|
result = false; |
|
break; |
|
} |
|
} |
|
stack['delete'](array); |
|
stack['delete'](other); |
|
return result; |
|
} |
|
|
|
/** |
|
* A specialized version of `baseIsEqualDeep` for comparing objects of |
|
* the same `toStringTag`. |
|
* |
|
* **Note:** This function only supports comparing values with tags of |
|
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. |
|
* |
|
* @private |
|
* @param {Object} object The object to compare. |
|
* @param {Object} other The other object to compare. |
|
* @param {string} tag The `toStringTag` of the objects to compare. |
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
|
* @param {Function} customizer The function to customize comparisons. |
|
* @param {Function} equalFunc The function to determine equivalents of values. |
|
* @param {Object} stack Tracks traversed `object` and `other` objects. |
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
|
*/ |
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { |
|
switch (tag) { |
|
case dataViewTag: |
|
if ((object.byteLength != other.byteLength) || |
|
(object.byteOffset != other.byteOffset)) { |
|
return false; |
|
} |
|
object = object.buffer; |
|
other = other.buffer; |
|
|
|
case arrayBufferTag: |
|
if ((object.byteLength != other.byteLength) || |
|
!equalFunc(new Uint8Array(object), new Uint8Array(other))) { |
|
return false; |
|
} |
|
return true; |
|
|
|
case boolTag: |
|
case dateTag: |
|
case numberTag: |
|
// Coerce booleans to `1` or `0` and dates to milliseconds. |
|
// Invalid dates are coerced to `NaN`. |
|
return eq(+object, +other); |
|
|
|
case errorTag: |
|
return object.name == other.name && object.message == other.message; |
|
|
|
case regexpTag: |
|
case stringTag: |
|
// Coerce regexes to strings and treat strings, primitives and objects, |
|
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring |
|
// for more details. |
|
return object == (other + ''); |
|
|
|
case mapTag: |
|
var convert = mapToArray; |
|
|
|
case setTag: |
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG; |
|
convert || (convert = setToArray); |
|
|
|
if (object.size != other.size && !isPartial) { |
|
return false; |
|
} |
|
// Assume cyclic values are equal. |
|
var stacked = stack.get(object); |
|
if (stacked) { |
|
return stacked == other; |
|
} |
|
bitmask |= COMPARE_UNORDERED_FLAG; |
|
|
|
// Recursively compare objects (susceptible to call stack limits). |
|
stack.set(object, other); |
|
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); |
|
stack['delete'](object); |
|
return result; |
|
|
|
case symbolTag: |
|
if (symbolValueOf) { |
|
return symbolValueOf.call(object) == symbolValueOf.call(other); |
|
} |
|
} |
|
return false; |
|
} |
|
|
|
/** |
|
* A specialized version of `baseIsEqualDeep` for objects with support for |
|
* partial deep comparisons. |
|
* |
|
* @private |
|
* @param {Object} object The object to compare. |
|
* @param {Object} other The other object to compare. |
|
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. |
|
* @param {Function} customizer The function to customize comparisons. |
|
* @param {Function} equalFunc The function to determine equivalents of values. |
|
* @param {Object} stack Tracks traversed `object` and `other` objects. |
|
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`. |
|
*/ |
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { |
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, |
|
objProps = getAllKeys(object), |
|
objLength = objProps.length, |
|
othProps = getAllKeys(other), |
|
othLength = othProps.length; |
|
|
|
if (objLength != othLength && !isPartial) { |
|
return false; |
|
} |
|
var index = objLength; |
|
while (index--) { |
|
var key = objProps[index]; |
|
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { |
|
return false; |
|
} |
|
} |
|
// Check that cyclic values are equal. |
|
var objStacked = stack.get(object); |
|
var othStacked = stack.get(other); |
|
if (objStacked && othStacked) { |
|
return objStacked == other && othStacked == object; |
|
} |
|
var result = true; |
|
stack.set(object, other); |
|
stack.set(other, object); |
|
|
|
var skipCtor = isPartial; |
|
while (++index < objLength) { |
|
key = objProps[index]; |
|
var objValue = object[key], |
|
othValue = other[key]; |
|
|
|
if (customizer) { |
|
var compared = isPartial |
|
? customizer(othValue, objValue, key, other, object, stack) |
|
: customizer(objValue, othValue, key, object, other, stack); |
|
} |
|
// Recursively compare objects (susceptible to call stack limits). |
|
if (!(compared === undefined |
|
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) |
|
: compared |
|
)) { |
|
result = false; |
|
break; |
|
} |
|
skipCtor || (skipCtor = key == 'constructor'); |
|
} |
|
if (result && !skipCtor) { |
|
var objCtor = object.constructor, |
|
othCtor = other.constructor; |
|
|
|
// Non `Object` object instances with different constructors are not equal. |
|
if (objCtor != othCtor && |
|
('constructor' in object && 'constructor' in other) && |
|
!(typeof objCtor == 'function' && objCtor instanceof objCtor && |
|
typeof othCtor == 'function' && othCtor instanceof othCtor)) { |
|
result = false; |
|
} |
|
} |
|
stack['delete'](object); |
|
stack['delete'](other); |
|
return result; |
|
} |
|
|
|
/** |
|
* A specialized version of `baseRest` which flattens the rest array. |
|
* |
|
* @private |
|
* @param {Function} func The function to apply a rest parameter to. |
|
* @returns {Function} Returns the new function. |
|
*/ |
|
function flatRest(func) { |
|
return setToString(overRest(func, undefined, flatten), func + ''); |
|
} |
|
|
|
/** |
|
* Creates an array of own enumerable property names and symbols of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property names and symbols. |
|
*/ |
|
function getAllKeys(object) { |
|
return baseGetAllKeys(object, keys, getSymbols); |
|
} |
|
|
|
/** |
|
* Creates an array of own and inherited enumerable property names and |
|
* symbols of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property names and symbols. |
|
*/ |
|
function getAllKeysIn(object) { |
|
return baseGetAllKeys(object, keysIn, getSymbolsIn); |
|
} |
|
|
|
/** |
|
* Gets metadata for `func`. |
|
* |
|
* @private |
|
* @param {Function} func The function to query. |
|
* @returns {*} Returns the metadata for `func`. |
|
*/ |
|
var getData = !metaMap ? noop : function(func) { |
|
return metaMap.get(func); |
|
}; |
|
|
|
/** |
|
* Gets the name of `func`. |
|
* |
|
* @private |
|
* @param {Function} func The function to query. |
|
* @returns {string} Returns the function name. |
|
*/ |
|
function getFuncName(func) { |
|
var result = (func.name + ''), |
|
array = realNames[result], |
|
length = hasOwnProperty.call(realNames, result) ? array.length : 0; |
|
|
|
while (length--) { |
|
var data = array[length], |
|
otherFunc = data.func; |
|
if (otherFunc == null || otherFunc == func) { |
|
return data.name; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Gets the argument placeholder value for `func`. |
|
* |
|
* @private |
|
* @param {Function} func The function to inspect. |
|
* @returns {*} Returns the placeholder value. |
|
*/ |
|
function getHolder(func) { |
|
var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; |
|
return object.placeholder; |
|
} |
|
|
|
/** |
|
* Gets the appropriate "iteratee" function. If `_.iteratee` is customized, |
|
* this function returns the custom method, otherwise it returns `baseIteratee`. |
|
* If arguments are provided, the chosen function is invoked with them and |
|
* its result is returned. |
|
* |
|
* @private |
|
* @param {*} [value] The value to convert to an iteratee. |
|
* @param {number} [arity] The arity of the created iteratee. |
|
* @returns {Function} Returns the chosen function or its result. |
|
*/ |
|
function getIteratee() { |
|
var result = lodash.iteratee || iteratee; |
|
result = result === iteratee ? baseIteratee : result; |
|
return arguments.length ? result(arguments[0], arguments[1]) : result; |
|
} |
|
|
|
/** |
|
* Gets the data for `map`. |
|
* |
|
* @private |
|
* @param {Object} map The map to query. |
|
* @param {string} key The reference key. |
|
* @returns {*} Returns the map data. |
|
*/ |
|
function getMapData(map, key) { |
|
var data = map.__data__; |
|
return isKeyable(key) |
|
? data[typeof key == 'string' ? 'string' : 'hash'] |
|
: data.map; |
|
} |
|
|
|
/** |
|
* Gets the property names, values, and compare flags of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the match data of `object`. |
|
*/ |
|
function getMatchData(object) { |
|
var result = keys(object), |
|
length = result.length; |
|
|
|
while (length--) { |
|
var key = result[length], |
|
value = object[key]; |
|
|
|
result[length] = [key, value, isStrictComparable(value)]; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Gets the native function at `key` of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {string} key The key of the method to get. |
|
* @returns {*} Returns the function if it's native, else `undefined`. |
|
*/ |
|
function getNative(object, key) { |
|
var value = getValue(object, key); |
|
return baseIsNative(value) ? value : undefined; |
|
} |
|
|
|
/** |
|
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. |
|
* |
|
* @private |
|
* @param {*} value The value to query. |
|
* @returns {string} Returns the raw `toStringTag`. |
|
*/ |
|
function getRawTag(value) { |
|
var isOwn = hasOwnProperty.call(value, symToStringTag), |
|
tag = value[symToStringTag]; |
|
|
|
try { |
|
value[symToStringTag] = undefined; |
|
var unmasked = true; |
|
} catch (e) {} |
|
|
|
var result = nativeObjectToString.call(value); |
|
if (unmasked) { |
|
if (isOwn) { |
|
value[symToStringTag] = tag; |
|
} else { |
|
delete value[symToStringTag]; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates an array of the own enumerable symbols of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of symbols. |
|
*/ |
|
var getSymbols = !nativeGetSymbols ? stubArray : function(object) { |
|
if (object == null) { |
|
return []; |
|
} |
|
object = Object(object); |
|
return arrayFilter(nativeGetSymbols(object), function(symbol) { |
|
return propertyIsEnumerable.call(object, symbol); |
|
}); |
|
}; |
|
|
|
/** |
|
* Creates an array of the own and inherited enumerable symbols of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of symbols. |
|
*/ |
|
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { |
|
var result = []; |
|
while (object) { |
|
arrayPush(result, getSymbols(object)); |
|
object = getPrototype(object); |
|
} |
|
return result; |
|
}; |
|
|
|
/** |
|
* Gets the `toStringTag` of `value`. |
|
* |
|
* @private |
|
* @param {*} value The value to query. |
|
* @returns {string} Returns the `toStringTag`. |
|
*/ |
|
var getTag = baseGetTag; |
|
|
|
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. |
|
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || |
|
(Map && getTag(new Map) != mapTag) || |
|
(Promise && getTag(Promise.resolve()) != promiseTag) || |
|
(Set && getTag(new Set) != setTag) || |
|
(WeakMap && getTag(new WeakMap) != weakMapTag)) { |
|
getTag = function(value) { |
|
var result = baseGetTag(value), |
|
Ctor = result == objectTag ? value.constructor : undefined, |
|
ctorString = Ctor ? toSource(Ctor) : ''; |
|
|
|
if (ctorString) { |
|
switch (ctorString) { |
|
case dataViewCtorString: return dataViewTag; |
|
case mapCtorString: return mapTag; |
|
case promiseCtorString: return promiseTag; |
|
case setCtorString: return setTag; |
|
case weakMapCtorString: return weakMapTag; |
|
} |
|
} |
|
return result; |
|
}; |
|
} |
|
|
|
/** |
|
* Gets the view, applying any `transforms` to the `start` and `end` positions. |
|
* |
|
* @private |
|
* @param {number} start The start of the view. |
|
* @param {number} end The end of the view. |
|
* @param {Array} transforms The transformations to apply to the view. |
|
* @returns {Object} Returns an object containing the `start` and `end` |
|
* positions of the view. |
|
*/ |
|
function getView(start, end, transforms) { |
|
var index = -1, |
|
length = transforms.length; |
|
|
|
while (++index < length) { |
|
var data = transforms[index], |
|
size = data.size; |
|
|
|
switch (data.type) { |
|
case 'drop': start += size; break; |
|
case 'dropRight': end -= size; break; |
|
case 'take': end = nativeMin(end, start + size); break; |
|
case 'takeRight': start = nativeMax(start, end - size); break; |
|
} |
|
} |
|
return { 'start': start, 'end': end }; |
|
} |
|
|
|
/** |
|
* Extracts wrapper details from the `source` body comment. |
|
* |
|
* @private |
|
* @param {string} source The source to inspect. |
|
* @returns {Array} Returns the wrapper details. |
|
*/ |
|
function getWrapDetails(source) { |
|
var match = source.match(reWrapDetails); |
|
return match ? match[1].split(reSplitDetails) : []; |
|
} |
|
|
|
/** |
|
* Checks if `path` exists on `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path to check. |
|
* @param {Function} hasFunc The function to check properties. |
|
* @returns {boolean} Returns `true` if `path` exists, else `false`. |
|
*/ |
|
function hasPath(object, path, hasFunc) { |
|
path = castPath(path, object); |
|
|
|
var index = -1, |
|
length = path.length, |
|
result = false; |
|
|
|
while (++index < length) { |
|
var key = toKey(path[index]); |
|
if (!(result = object != null && hasFunc(object, key))) { |
|
break; |
|
} |
|
object = object[key]; |
|
} |
|
if (result || ++index != length) { |
|
return result; |
|
} |
|
length = object == null ? 0 : object.length; |
|
return !!length && isLength(length) && isIndex(key, length) && |
|
(isArray(object) || isArguments(object)); |
|
} |
|
|
|
/** |
|
* Initializes an array clone. |
|
* |
|
* @private |
|
* @param {Array} array The array to clone. |
|
* @returns {Array} Returns the initialized clone. |
|
*/ |
|
function initCloneArray(array) { |
|
var length = array.length, |
|
result = new array.constructor(length); |
|
|
|
// Add properties assigned by `RegExp#exec`. |
|
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { |
|
result.index = array.index; |
|
result.input = array.input; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Initializes an object clone. |
|
* |
|
* @private |
|
* @param {Object} object The object to clone. |
|
* @returns {Object} Returns the initialized clone. |
|
*/ |
|
function initCloneObject(object) { |
|
return (typeof object.constructor == 'function' && !isPrototype(object)) |
|
? baseCreate(getPrototype(object)) |
|
: {}; |
|
} |
|
|
|
/** |
|
* Initializes an object clone based on its `toStringTag`. |
|
* |
|
* **Note:** This function only supports cloning values with tags of |
|
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. |
|
* |
|
* @private |
|
* @param {Object} object The object to clone. |
|
* @param {string} tag The `toStringTag` of the object to clone. |
|
* @param {boolean} [isDeep] Specify a deep clone. |
|
* @returns {Object} Returns the initialized clone. |
|
*/ |
|
function initCloneByTag(object, tag, isDeep) { |
|
var Ctor = object.constructor; |
|
switch (tag) { |
|
case arrayBufferTag: |
|
return cloneArrayBuffer(object); |
|
|
|
case boolTag: |
|
case dateTag: |
|
return new Ctor(+object); |
|
|
|
case dataViewTag: |
|
return cloneDataView(object, isDeep); |
|
|
|
case float32Tag: case float64Tag: |
|
case int8Tag: case int16Tag: case int32Tag: |
|
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: |
|
return cloneTypedArray(object, isDeep); |
|
|
|
case mapTag: |
|
return new Ctor; |
|
|
|
case numberTag: |
|
case stringTag: |
|
return new Ctor(object); |
|
|
|
case regexpTag: |
|
return cloneRegExp(object); |
|
|
|
case setTag: |
|
return new Ctor; |
|
|
|
case symbolTag: |
|
return cloneSymbol(object); |
|
} |
|
} |
|
|
|
/** |
|
* Inserts wrapper `details` in a comment at the top of the `source` body. |
|
* |
|
* @private |
|
* @param {string} source The source to modify. |
|
* @returns {Array} details The details to insert. |
|
* @returns {string} Returns the modified source. |
|
*/ |
|
function insertWrapDetails(source, details) { |
|
var length = details.length; |
|
if (!length) { |
|
return source; |
|
} |
|
var lastIndex = length - 1; |
|
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; |
|
details = details.join(length > 2 ? ', ' : ' '); |
|
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); |
|
} |
|
|
|
/** |
|
* Checks if `value` is a flattenable `arguments` object or array. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`. |
|
*/ |
|
function isFlattenable(value) { |
|
return isArray(value) || isArguments(value) || |
|
!!(spreadableSymbol && value && value[spreadableSymbol]); |
|
} |
|
|
|
/** |
|
* 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) { |
|
var type = typeof value; |
|
length = length == null ? MAX_SAFE_INTEGER : length; |
|
|
|
return !!length && |
|
(type == 'number' || |
|
(type != 'symbol' && reIsUint.test(value))) && |
|
(value > -1 && value % 1 == 0 && value < length); |
|
} |
|
|
|
/** |
|
* 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; |
|
} |
|
|
|
/** |
|
* Checks if `value` is a property name and not a property path. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @param {Object} [object] The object to query keys on. |
|
* @returns {boolean} Returns `true` if `value` is a property name, else `false`. |
|
*/ |
|
function isKey(value, object) { |
|
if (isArray(value)) { |
|
return false; |
|
} |
|
var type = typeof value; |
|
if (type == 'number' || type == 'symbol' || type == 'boolean' || |
|
value == null || isSymbol(value)) { |
|
return true; |
|
} |
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || |
|
(object != null && value in Object(object)); |
|
} |
|
|
|
/** |
|
* Checks if `value` is suitable for use as unique object key. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is suitable, else `false`. |
|
*/ |
|
function isKeyable(value) { |
|
var type = typeof value; |
|
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') |
|
? (value !== '__proto__') |
|
: (value === null); |
|
} |
|
|
|
/** |
|
* Checks if `func` has a lazy counterpart. |
|
* |
|
* @private |
|
* @param {Function} func The function to check. |
|
* @returns {boolean} Returns `true` if `func` has a lazy counterpart, |
|
* else `false`. |
|
*/ |
|
function isLaziable(func) { |
|
var funcName = getFuncName(func), |
|
other = lodash[funcName]; |
|
|
|
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { |
|
return false; |
|
} |
|
if (func === other) { |
|
return true; |
|
} |
|
var data = getData(other); |
|
return !!data && func === data[0]; |
|
} |
|
|
|
/** |
|
* Checks if `func` has its source masked. |
|
* |
|
* @private |
|
* @param {Function} func The function to check. |
|
* @returns {boolean} Returns `true` if `func` is masked, else `false`. |
|
*/ |
|
function isMasked(func) { |
|
return !!maskSrcKey && (maskSrcKey in func); |
|
} |
|
|
|
/** |
|
* Checks if `func` is capable of being masked. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `func` is maskable, else `false`. |
|
*/ |
|
var isMaskable = coreJsData ? isFunction : stubFalse; |
|
|
|
/** |
|
* 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; |
|
} |
|
|
|
/** |
|
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`. |
|
* |
|
* @private |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` if suitable for strict |
|
* equality comparisons, else `false`. |
|
*/ |
|
function isStrictComparable(value) { |
|
return value === value && !isObject(value); |
|
} |
|
|
|
/** |
|
* A specialized version of `matchesProperty` for source values suitable |
|
* for strict equality comparisons, i.e. `===`. |
|
* |
|
* @private |
|
* @param {string} key The key of the property to get. |
|
* @param {*} srcValue The value to match. |
|
* @returns {Function} Returns the new spec function. |
|
*/ |
|
function matchesStrictComparable(key, srcValue) { |
|
return function(object) { |
|
if (object == null) { |
|
return false; |
|
} |
|
return object[key] === srcValue && |
|
(srcValue !== undefined || (key in Object(object))); |
|
}; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.memoize` which clears the memoized function's |
|
* cache when it exceeds `MAX_MEMOIZE_SIZE`. |
|
* |
|
* @private |
|
* @param {Function} func The function to have its output memoized. |
|
* @returns {Function} Returns the new memoized function. |
|
*/ |
|
function memoizeCapped(func) { |
|
var result = memoize(func, function(key) { |
|
if (cache.size === MAX_MEMOIZE_SIZE) { |
|
cache.clear(); |
|
} |
|
return key; |
|
}); |
|
|
|
var cache = result.cache; |
|
return result; |
|
} |
|
|
|
/** |
|
* Merges the function metadata of `source` into `data`. |
|
* |
|
* Merging metadata reduces the number of wrappers used to invoke a function. |
|
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial` |
|
* may be applied regardless of execution order. Methods like `_.ary` and |
|
* `_.rearg` modify function arguments, making the order in which they are |
|
* executed important, preventing the merging of metadata. However, we make |
|
* an exception for a safe combined case where curried functions have `_.ary` |
|
* and or `_.rearg` applied. |
|
* |
|
* @private |
|
* @param {Array} data The destination metadata. |
|
* @param {Array} source The source metadata. |
|
* @returns {Array} Returns `data`. |
|
*/ |
|
function mergeData(data, source) { |
|
var bitmask = data[1], |
|
srcBitmask = source[1], |
|
newBitmask = bitmask | srcBitmask, |
|
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); |
|
|
|
var isCombo = |
|
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || |
|
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || |
|
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); |
|
|
|
// Exit early if metadata can't be merged. |
|
if (!(isCommon || isCombo)) { |
|
return data; |
|
} |
|
// Use source `thisArg` if available. |
|
if (srcBitmask & WRAP_BIND_FLAG) { |
|
data[2] = source[2]; |
|
// Set when currying a bound function. |
|
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; |
|
} |
|
// Compose partial arguments. |
|
var value = source[3]; |
|
if (value) { |
|
var partials = data[3]; |
|
data[3] = partials ? composeArgs(partials, value, source[4]) : value; |
|
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; |
|
} |
|
// Compose partial right arguments. |
|
value = source[5]; |
|
if (value) { |
|
partials = data[5]; |
|
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; |
|
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; |
|
} |
|
// Use source `argPos` if available. |
|
value = source[7]; |
|
if (value) { |
|
data[7] = value; |
|
} |
|
// Use source `ary` if it's smaller. |
|
if (srcBitmask & WRAP_ARY_FLAG) { |
|
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); |
|
} |
|
// Use source `arity` if one is not provided. |
|
if (data[9] == null) { |
|
data[9] = source[9]; |
|
} |
|
// Use source `func` and merge bitmasks. |
|
data[0] = source[0]; |
|
data[1] = newBitmask; |
|
|
|
return data; |
|
} |
|
|
|
/** |
|
* This function is like |
|
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) |
|
* except that it includes inherited enumerable properties. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property names. |
|
*/ |
|
function nativeKeysIn(object) { |
|
var result = []; |
|
if (object != null) { |
|
for (var key in Object(object)) { |
|
result.push(key); |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Converts `value` to a string using `Object.prototype.toString`. |
|
* |
|
* @private |
|
* @param {*} value The value to convert. |
|
* @returns {string} Returns the converted string. |
|
*/ |
|
function objectToString(value) { |
|
return nativeObjectToString.call(value); |
|
} |
|
|
|
/** |
|
* A specialized version of `baseRest` which transforms the rest array. |
|
* |
|
* @private |
|
* @param {Function} func The function to apply a rest parameter to. |
|
* @param {number} [start=func.length-1] The start position of the rest parameter. |
|
* @param {Function} transform The rest array transform. |
|
* @returns {Function} Returns the new function. |
|
*/ |
|
function overRest(func, start, transform) { |
|
start = nativeMax(start === undefined ? (func.length - 1) : 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]; |
|
} |
|
index = -1; |
|
var otherArgs = Array(start + 1); |
|
while (++index < start) { |
|
otherArgs[index] = args[index]; |
|
} |
|
otherArgs[start] = transform(array); |
|
return apply(func, this, otherArgs); |
|
}; |
|
} |
|
|
|
/** |
|
* Gets the parent value at `path` of `object`. |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {Array} path The path to get the parent value of. |
|
* @returns {*} Returns the parent value. |
|
*/ |
|
function parent(object, path) { |
|
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); |
|
} |
|
|
|
/** |
|
* Reorder `array` according to the specified indexes where the element at |
|
* the first index is assigned as the first element, the element at |
|
* the second index is assigned as the second element, and so on. |
|
* |
|
* @private |
|
* @param {Array} array The array to reorder. |
|
* @param {Array} indexes The arranged array indexes. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function reorder(array, indexes) { |
|
var arrLength = array.length, |
|
length = nativeMin(indexes.length, arrLength), |
|
oldArray = copyArray(array); |
|
|
|
while (length--) { |
|
var index = indexes[length]; |
|
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; |
|
} |
|
return array; |
|
} |
|
|
|
/** |
|
* Gets the value at `key`, unless `key` is "__proto__" or "constructor". |
|
* |
|
* @private |
|
* @param {Object} object The object to query. |
|
* @param {string} key The key of the property to get. |
|
* @returns {*} Returns the property value. |
|
*/ |
|
function safeGet(object, key) { |
|
if (key === 'constructor' && typeof object[key] === 'function') { |
|
return; |
|
} |
|
|
|
if (key == '__proto__') { |
|
return; |
|
} |
|
|
|
return object[key]; |
|
} |
|
|
|
/** |
|
* Sets metadata for `func`. |
|
* |
|
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short |
|
* period of time, it will trip its breaker and transition to an identity |
|
* function to avoid garbage collection pauses in V8. See |
|
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) |
|
* for more details. |
|
* |
|
* @private |
|
* @param {Function} func The function to associate metadata with. |
|
* @param {*} data The metadata. |
|
* @returns {Function} Returns `func`. |
|
*/ |
|
var setData = shortOut(baseSetData); |
|
|
|
/** |
|
* A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). |
|
* |
|
* @private |
|
* @param {Function} func The function to delay. |
|
* @param {number} wait The number of milliseconds to delay invocation. |
|
* @returns {number|Object} Returns the timer id or timeout object. |
|
*/ |
|
var setTimeout = ctxSetTimeout || function(func, wait) { |
|
return root.setTimeout(func, wait); |
|
}; |
|
|
|
/** |
|
* Sets the `toString` method of `func` to return `string`. |
|
* |
|
* @private |
|
* @param {Function} func The function to modify. |
|
* @param {Function} string The `toString` result. |
|
* @returns {Function} Returns `func`. |
|
*/ |
|
var setToString = shortOut(baseSetToString); |
|
|
|
/** |
|
* Sets the `toString` method of `wrapper` to mimic the source of `reference` |
|
* with wrapper details in a comment at the top of the source body. |
|
* |
|
* @private |
|
* @param {Function} wrapper The function to modify. |
|
* @param {Function} reference The reference function. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @returns {Function} Returns `wrapper`. |
|
*/ |
|
function setWrapToString(wrapper, reference, bitmask) { |
|
var source = (reference + ''); |
|
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); |
|
} |
|
|
|
/** |
|
* Creates a function that'll short out and invoke `identity` instead |
|
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` |
|
* milliseconds. |
|
* |
|
* @private |
|
* @param {Function} func The function to restrict. |
|
* @returns {Function} Returns the new shortable function. |
|
*/ |
|
function shortOut(func) { |
|
var count = 0, |
|
lastCalled = 0; |
|
|
|
return function() { |
|
var stamp = nativeNow(), |
|
remaining = HOT_SPAN - (stamp - lastCalled); |
|
|
|
lastCalled = stamp; |
|
if (remaining > 0) { |
|
if (++count >= HOT_COUNT) { |
|
return arguments[0]; |
|
} |
|
} else { |
|
count = 0; |
|
} |
|
return func.apply(undefined, arguments); |
|
}; |
|
} |
|
|
|
/** |
|
* A specialized version of `_.shuffle` which mutates and sets the size of `array`. |
|
* |
|
* @private |
|
* @param {Array} array The array to shuffle. |
|
* @param {number} [size=array.length] The size of `array`. |
|
* @returns {Array} Returns `array`. |
|
*/ |
|
function shuffleSelf(array, size) { |
|
var index = -1, |
|
length = array.length, |
|
lastIndex = length - 1; |
|
|
|
size = size === undefined ? length : size; |
|
while (++index < size) { |
|
var rand = baseRandom(index, lastIndex), |
|
value = array[rand]; |
|
|
|
array[rand] = array[index]; |
|
array[index] = value; |
|
} |
|
array.length = size; |
|
return array; |
|
} |
|
|
|
/** |
|
* Converts `string` to a property path array. |
|
* |
|
* @private |
|
* @param {string} string The string to convert. |
|
* @returns {Array} Returns the property path array. |
|
*/ |
|
var stringToPath = memoizeCapped(function(string) { |
|
var result = []; |
|
if (string.charCodeAt(0) === 46 /* . */) { |
|
result.push(''); |
|
} |
|
string.replace(rePropName, function(match, number, quote, subString) { |
|
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); |
|
}); |
|
return result; |
|
}); |
|
|
|
/** |
|
* Converts `value` to a string key if it's not a string or symbol. |
|
* |
|
* @private |
|
* @param {*} value The value to inspect. |
|
* @returns {string|symbol} Returns the key. |
|
*/ |
|
function toKey(value) { |
|
if (typeof value == 'string' || isSymbol(value)) { |
|
return value; |
|
} |
|
var result = (value + ''); |
|
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; |
|
} |
|
|
|
/** |
|
* Converts `func` to its source code. |
|
* |
|
* @private |
|
* @param {Function} func The function to convert. |
|
* @returns {string} Returns the source code. |
|
*/ |
|
function toSource(func) { |
|
if (func != null) { |
|
try { |
|
return funcToString.call(func); |
|
} catch (e) {} |
|
try { |
|
return (func + ''); |
|
} catch (e) {} |
|
} |
|
return ''; |
|
} |
|
|
|
/** |
|
* Updates wrapper `details` based on `bitmask` flags. |
|
* |
|
* @private |
|
* @returns {Array} details The details to modify. |
|
* @param {number} bitmask The bitmask flags. See `createWrap` for more details. |
|
* @returns {Array} Returns `details`. |
|
*/ |
|
function updateWrapDetails(details, bitmask) { |
|
arrayEach(wrapFlags, function(pair) { |
|
var value = '_.' + pair[0]; |
|
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { |
|
details.push(value); |
|
} |
|
}); |
|
return details.sort(); |
|
} |
|
|
|
/** |
|
* Creates a clone of `wrapper`. |
|
* |
|
* @private |
|
* @param {Object} wrapper The wrapper to clone. |
|
* @returns {Object} Returns the cloned wrapper. |
|
*/ |
|
function wrapperClone(wrapper) { |
|
if (wrapper instanceof LazyWrapper) { |
|
return wrapper.clone(); |
|
} |
|
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); |
|
result.__actions__ = copyArray(wrapper.__actions__); |
|
result.__index__ = wrapper.__index__; |
|
result.__values__ = wrapper.__values__; |
|
return result; |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates an array of elements split into groups the length of `size`. |
|
* If `array` can't be split evenly, the final chunk will be the remaining |
|
* elements. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to process. |
|
* @param {number} [size=1] The length of each chunk |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the new array of chunks. |
|
* @example |
|
* |
|
* _.chunk(['a', 'b', 'c', 'd'], 2); |
|
* // => [['a', 'b'], ['c', 'd']] |
|
* |
|
* _.chunk(['a', 'b', 'c', 'd'], 3); |
|
* // => [['a', 'b', 'c'], ['d']] |
|
*/ |
|
function chunk(array, size, guard) { |
|
if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { |
|
size = 1; |
|
} else { |
|
size = nativeMax(toInteger(size), 0); |
|
} |
|
var length = array == null ? 0 : array.length; |
|
if (!length || size < 1) { |
|
return []; |
|
} |
|
var index = 0, |
|
resIndex = 0, |
|
result = Array(nativeCeil(length / size)); |
|
|
|
while (index < length) { |
|
result[resIndex++] = baseSlice(array, index, (index += size)); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates an array with all falsey values removed. The values `false`, `null`, |
|
* `0`, `""`, `undefined`, and `NaN` are falsey. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to compact. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @example |
|
* |
|
* _.compact([0, 1, false, 2, '', 3]); |
|
* // => [1, 2, 3] |
|
*/ |
|
function compact(array) { |
|
var index = -1, |
|
length = array == null ? 0 : array.length, |
|
resIndex = 0, |
|
result = []; |
|
|
|
while (++index < length) { |
|
var value = array[index]; |
|
if (value) { |
|
result[resIndex++] = value; |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates a new array concatenating `array` with any additional arrays |
|
* and/or values. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to concatenate. |
|
* @param {...*} [values] The values to concatenate. |
|
* @returns {Array} Returns the new concatenated array. |
|
* @example |
|
* |
|
* var array = [1]; |
|
* var other = _.concat(array, 2, [3], [[4]]); |
|
* |
|
* console.log(other); |
|
* // => [1, 2, 3, [4]] |
|
* |
|
* console.log(array); |
|
* // => [1] |
|
*/ |
|
function concat() { |
|
var length = arguments.length; |
|
if (!length) { |
|
return []; |
|
} |
|
var args = Array(length - 1), |
|
array = arguments[0], |
|
index = length; |
|
|
|
while (index--) { |
|
args[index - 1] = arguments[index]; |
|
} |
|
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); |
|
} |
|
|
|
/** |
|
* Creates an array of `array` values not included in the other given arrays |
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons. The order and references of result values are |
|
* determined by the first array. |
|
* |
|
* **Note:** Unlike `_.pullAll`, this method returns a new array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {...Array} [values] The values to exclude. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @see _.without, _.xor |
|
* @example |
|
* |
|
* _.difference([2, 1], [2, 3]); |
|
* // => [1] |
|
*/ |
|
var difference = baseRest(function(array, values) { |
|
return isArrayLikeObject(array) |
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) |
|
: []; |
|
}); |
|
|
|
/** |
|
* This method is like `_.difference` except that it accepts `iteratee` which |
|
* is invoked for each element of `array` and `values` to generate the criterion |
|
* by which they're compared. The order and references of result values are |
|
* determined by the first array. The iteratee is invoked with one argument: |
|
* (value). |
|
* |
|
* **Note:** Unlike `_.pullAllBy`, this method returns a new array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {...Array} [values] The values to exclude. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @example |
|
* |
|
* _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); |
|
* // => [1.2] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); |
|
* // => [{ 'x': 2 }] |
|
*/ |
|
var differenceBy = baseRest(function(array, values) { |
|
var iteratee = last(values); |
|
if (isArrayLikeObject(iteratee)) { |
|
iteratee = undefined; |
|
} |
|
return isArrayLikeObject(array) |
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) |
|
: []; |
|
}); |
|
|
|
/** |
|
* This method is like `_.difference` except that it accepts `comparator` |
|
* which is invoked to compare elements of `array` to `values`. The order and |
|
* references of result values are determined by the first array. The comparator |
|
* is invoked with two arguments: (arrVal, othVal). |
|
* |
|
* **Note:** Unlike `_.pullAllWith`, this method returns a new array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {...Array} [values] The values to exclude. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; |
|
* |
|
* _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); |
|
* // => [{ 'x': 2, 'y': 1 }] |
|
*/ |
|
var differenceWith = baseRest(function(array, values) { |
|
var comparator = last(values); |
|
if (isArrayLikeObject(comparator)) { |
|
comparator = undefined; |
|
} |
|
return isArrayLikeObject(array) |
|
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) |
|
: []; |
|
}); |
|
|
|
/** |
|
* Creates a slice of `array` with `n` elements dropped from the beginning. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.5.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {number} [n=1] The number of elements to drop. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* _.drop([1, 2, 3]); |
|
* // => [2, 3] |
|
* |
|
* _.drop([1, 2, 3], 2); |
|
* // => [3] |
|
* |
|
* _.drop([1, 2, 3], 5); |
|
* // => [] |
|
* |
|
* _.drop([1, 2, 3], 0); |
|
* // => [1, 2, 3] |
|
*/ |
|
function drop(array, n, guard) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return []; |
|
} |
|
n = (guard || n === undefined) ? 1 : toInteger(n); |
|
return baseSlice(array, n < 0 ? 0 : n, length); |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` with `n` elements dropped from the end. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {number} [n=1] The number of elements to drop. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* _.dropRight([1, 2, 3]); |
|
* // => [1, 2] |
|
* |
|
* _.dropRight([1, 2, 3], 2); |
|
* // => [1] |
|
* |
|
* _.dropRight([1, 2, 3], 5); |
|
* // => [] |
|
* |
|
* _.dropRight([1, 2, 3], 0); |
|
* // => [1, 2, 3] |
|
*/ |
|
function dropRight(array, n, guard) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return []; |
|
} |
|
n = (guard || n === undefined) ? 1 : toInteger(n); |
|
n = length - n; |
|
return baseSlice(array, 0, n < 0 ? 0 : n); |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` excluding elements dropped from the end. |
|
* Elements are dropped until `predicate` returns falsey. The predicate is |
|
* invoked with three arguments: (value, index, array). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': true }, |
|
* { 'user': 'fred', 'active': false }, |
|
* { 'user': 'pebbles', 'active': false } |
|
* ]; |
|
* |
|
* _.dropRightWhile(users, function(o) { return !o.active; }); |
|
* // => objects for ['barney'] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); |
|
* // => objects for ['barney', 'fred'] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.dropRightWhile(users, ['active', false]); |
|
* // => objects for ['barney'] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.dropRightWhile(users, 'active'); |
|
* // => objects for ['barney', 'fred', 'pebbles'] |
|
*/ |
|
function dropRightWhile(array, predicate) { |
|
return (array && array.length) |
|
? baseWhile(array, getIteratee(predicate, 3), true, true) |
|
: []; |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` excluding elements dropped from the beginning. |
|
* Elements are dropped until `predicate` returns falsey. The predicate is |
|
* invoked with three arguments: (value, index, array). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': false }, |
|
* { 'user': 'fred', 'active': false }, |
|
* { 'user': 'pebbles', 'active': true } |
|
* ]; |
|
* |
|
* _.dropWhile(users, function(o) { return !o.active; }); |
|
* // => objects for ['pebbles'] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.dropWhile(users, { 'user': 'barney', 'active': false }); |
|
* // => objects for ['fred', 'pebbles'] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.dropWhile(users, ['active', false]); |
|
* // => objects for ['pebbles'] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.dropWhile(users, 'active'); |
|
* // => objects for ['barney', 'fred', 'pebbles'] |
|
*/ |
|
function dropWhile(array, predicate) { |
|
return (array && array.length) |
|
? baseWhile(array, getIteratee(predicate, 3), true) |
|
: []; |
|
} |
|
|
|
/** |
|
* Fills elements of `array` with `value` from `start` up to, but not |
|
* including, `end`. |
|
* |
|
* **Note:** This method mutates `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.2.0 |
|
* @category Array |
|
* @param {Array} array The array to fill. |
|
* @param {*} value The value to fill `array` with. |
|
* @param {number} [start=0] The start position. |
|
* @param {number} [end=array.length] The end position. |
|
* @returns {Array} Returns `array`. |
|
* @example |
|
* |
|
* var array = [1, 2, 3]; |
|
* |
|
* _.fill(array, 'a'); |
|
* console.log(array); |
|
* // => ['a', 'a', 'a'] |
|
* |
|
* _.fill(Array(3), 2); |
|
* // => [2, 2, 2] |
|
* |
|
* _.fill([4, 6, 8, 10], '*', 1, 3); |
|
* // => [4, '*', '*', 10] |
|
*/ |
|
function fill(array, value, start, end) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return []; |
|
} |
|
if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { |
|
start = 0; |
|
end = length; |
|
} |
|
return baseFill(array, value, start, end); |
|
} |
|
|
|
/** |
|
* This method is like `_.find` except that it returns the index of the first |
|
* element `predicate` returns truthy for instead of the element itself. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.1.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @param {number} [fromIndex=0] The index to search from. |
|
* @returns {number} Returns the index of the found element, else `-1`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': false }, |
|
* { 'user': 'fred', 'active': false }, |
|
* { 'user': 'pebbles', 'active': true } |
|
* ]; |
|
* |
|
* _.findIndex(users, function(o) { return o.user == 'barney'; }); |
|
* // => 0 |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.findIndex(users, { 'user': 'fred', 'active': false }); |
|
* // => 1 |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.findIndex(users, ['active', false]); |
|
* // => 0 |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.findIndex(users, 'active'); |
|
* // => 2 |
|
*/ |
|
function findIndex(array, predicate, fromIndex) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return -1; |
|
} |
|
var index = fromIndex == null ? 0 : toInteger(fromIndex); |
|
if (index < 0) { |
|
index = nativeMax(length + index, 0); |
|
} |
|
return baseFindIndex(array, getIteratee(predicate, 3), index); |
|
} |
|
|
|
/** |
|
* This method is like `_.findIndex` except that it iterates over elements |
|
* of `collection` from right to left. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @param {number} [fromIndex=array.length-1] The index to search from. |
|
* @returns {number} Returns the index of the found element, else `-1`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': true }, |
|
* { 'user': 'fred', 'active': false }, |
|
* { 'user': 'pebbles', 'active': false } |
|
* ]; |
|
* |
|
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); |
|
* // => 2 |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.findLastIndex(users, { 'user': 'barney', 'active': true }); |
|
* // => 0 |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.findLastIndex(users, ['active', false]); |
|
* // => 2 |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.findLastIndex(users, 'active'); |
|
* // => 0 |
|
*/ |
|
function findLastIndex(array, predicate, fromIndex) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return -1; |
|
} |
|
var index = length - 1; |
|
if (fromIndex !== undefined) { |
|
index = toInteger(fromIndex); |
|
index = fromIndex < 0 |
|
? nativeMax(length + index, 0) |
|
: nativeMin(index, length - 1); |
|
} |
|
return baseFindIndex(array, getIteratee(predicate, 3), index, true); |
|
} |
|
|
|
/** |
|
* Flattens `array` a single level deep. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to flatten. |
|
* @returns {Array} Returns the new flattened array. |
|
* @example |
|
* |
|
* _.flatten([1, [2, [3, [4]], 5]]); |
|
* // => [1, 2, [3, [4]], 5] |
|
*/ |
|
function flatten(array) { |
|
var length = array == null ? 0 : array.length; |
|
return length ? baseFlatten(array, 1) : []; |
|
} |
|
|
|
/** |
|
* Recursively flattens `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to flatten. |
|
* @returns {Array} Returns the new flattened array. |
|
* @example |
|
* |
|
* _.flattenDeep([1, [2, [3, [4]], 5]]); |
|
* // => [1, 2, 3, 4, 5] |
|
*/ |
|
function flattenDeep(array) { |
|
var length = array == null ? 0 : array.length; |
|
return length ? baseFlatten(array, INFINITY) : []; |
|
} |
|
|
|
/** |
|
* Recursively flatten `array` up to `depth` times. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.4.0 |
|
* @category Array |
|
* @param {Array} array The array to flatten. |
|
* @param {number} [depth=1] The maximum recursion depth. |
|
* @returns {Array} Returns the new flattened array. |
|
* @example |
|
* |
|
* var array = [1, [2, [3, [4]], 5]]; |
|
* |
|
* _.flattenDepth(array, 1); |
|
* // => [1, 2, [3, [4]], 5] |
|
* |
|
* _.flattenDepth(array, 2); |
|
* // => [1, 2, 3, [4], 5] |
|
*/ |
|
function flattenDepth(array, depth) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return []; |
|
} |
|
depth = depth === undefined ? 1 : toInteger(depth); |
|
return baseFlatten(array, depth); |
|
} |
|
|
|
/** |
|
* The inverse of `_.toPairs`; this method returns an object composed |
|
* from key-value `pairs`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} pairs The key-value pairs. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* _.fromPairs([['a', 1], ['b', 2]]); |
|
* // => { 'a': 1, 'b': 2 } |
|
*/ |
|
function fromPairs(pairs) { |
|
var index = -1, |
|
length = pairs == null ? 0 : pairs.length, |
|
result = {}; |
|
|
|
while (++index < length) { |
|
var pair = pairs[index]; |
|
result[pair[0]] = pair[1]; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Gets the first element of `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @alias first |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @returns {*} Returns the first element of `array`. |
|
* @example |
|
* |
|
* _.head([1, 2, 3]); |
|
* // => 1 |
|
* |
|
* _.head([]); |
|
* // => undefined |
|
*/ |
|
function head(array) { |
|
return (array && array.length) ? array[0] : undefined; |
|
} |
|
|
|
/** |
|
* Gets the index at which the first occurrence of `value` is found in `array` |
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons. If `fromIndex` is negative, it's used as the |
|
* offset from the end of `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} [fromIndex=0] The index to search from. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
* @example |
|
* |
|
* _.indexOf([1, 2, 1, 2], 2); |
|
* // => 1 |
|
* |
|
* // Search from the `fromIndex`. |
|
* _.indexOf([1, 2, 1, 2], 2, 2); |
|
* // => 3 |
|
*/ |
|
function indexOf(array, value, fromIndex) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return -1; |
|
} |
|
var index = fromIndex == null ? 0 : toInteger(fromIndex); |
|
if (index < 0) { |
|
index = nativeMax(length + index, 0); |
|
} |
|
return baseIndexOf(array, value, index); |
|
} |
|
|
|
/** |
|
* Gets all but the last element of `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* _.initial([1, 2, 3]); |
|
* // => [1, 2] |
|
*/ |
|
function initial(array) { |
|
var length = array == null ? 0 : array.length; |
|
return length ? baseSlice(array, 0, -1) : []; |
|
} |
|
|
|
/** |
|
* Creates an array of unique values that are included in all given arrays |
|
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons. The order and references of result values are |
|
* determined by the first array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @returns {Array} Returns the new array of intersecting values. |
|
* @example |
|
* |
|
* _.intersection([2, 1], [2, 3]); |
|
* // => [2] |
|
*/ |
|
var intersection = baseRest(function(arrays) { |
|
var mapped = arrayMap(arrays, castArrayLikeObject); |
|
return (mapped.length && mapped[0] === arrays[0]) |
|
? baseIntersection(mapped) |
|
: []; |
|
}); |
|
|
|
/** |
|
* This method is like `_.intersection` except that it accepts `iteratee` |
|
* which is invoked for each element of each `arrays` to generate the criterion |
|
* by which they're compared. The order and references of result values are |
|
* determined by the first array. The iteratee is invoked with one argument: |
|
* (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Array} Returns the new array of intersecting values. |
|
* @example |
|
* |
|
* _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); |
|
* // => [2.1] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); |
|
* // => [{ 'x': 1 }] |
|
*/ |
|
var intersectionBy = baseRest(function(arrays) { |
|
var iteratee = last(arrays), |
|
mapped = arrayMap(arrays, castArrayLikeObject); |
|
|
|
if (iteratee === last(mapped)) { |
|
iteratee = undefined; |
|
} else { |
|
mapped.pop(); |
|
} |
|
return (mapped.length && mapped[0] === arrays[0]) |
|
? baseIntersection(mapped, getIteratee(iteratee, 2)) |
|
: []; |
|
}); |
|
|
|
/** |
|
* This method is like `_.intersection` except that it accepts `comparator` |
|
* which is invoked to compare elements of `arrays`. The order and references |
|
* of result values are determined by the first array. The comparator is |
|
* invoked with two arguments: (arrVal, othVal). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of intersecting values. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; |
|
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; |
|
* |
|
* _.intersectionWith(objects, others, _.isEqual); |
|
* // => [{ 'x': 1, 'y': 2 }] |
|
*/ |
|
var intersectionWith = baseRest(function(arrays) { |
|
var comparator = last(arrays), |
|
mapped = arrayMap(arrays, castArrayLikeObject); |
|
|
|
comparator = typeof comparator == 'function' ? comparator : undefined; |
|
if (comparator) { |
|
mapped.pop(); |
|
} |
|
return (mapped.length && mapped[0] === arrays[0]) |
|
? baseIntersection(mapped, undefined, comparator) |
|
: []; |
|
}); |
|
|
|
/** |
|
* Converts all elements in `array` into a string separated by `separator`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to convert. |
|
* @param {string} [separator=','] The element separator. |
|
* @returns {string} Returns the joined string. |
|
* @example |
|
* |
|
* _.join(['a', 'b', 'c'], '~'); |
|
* // => 'a~b~c' |
|
*/ |
|
function join(array, separator) { |
|
return array == null ? '' : nativeJoin.call(array, separator); |
|
} |
|
|
|
/** |
|
* Gets the last element of `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @returns {*} Returns the last element of `array`. |
|
* @example |
|
* |
|
* _.last([1, 2, 3]); |
|
* // => 3 |
|
*/ |
|
function last(array) { |
|
var length = array == null ? 0 : array.length; |
|
return length ? array[length - 1] : undefined; |
|
} |
|
|
|
/** |
|
* This method is like `_.indexOf` except that it iterates over elements of |
|
* `array` from right to left. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} [fromIndex=array.length-1] The index to search from. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
* @example |
|
* |
|
* _.lastIndexOf([1, 2, 1, 2], 2); |
|
* // => 3 |
|
* |
|
* // Search from the `fromIndex`. |
|
* _.lastIndexOf([1, 2, 1, 2], 2, 2); |
|
* // => 1 |
|
*/ |
|
function lastIndexOf(array, value, fromIndex) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return -1; |
|
} |
|
var index = length; |
|
if (fromIndex !== undefined) { |
|
index = toInteger(fromIndex); |
|
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); |
|
} |
|
return value === value |
|
? strictLastIndexOf(array, value, index) |
|
: baseFindIndex(array, baseIsNaN, index, true); |
|
} |
|
|
|
/** |
|
* Gets the element at index `n` of `array`. If `n` is negative, the nth |
|
* element from the end is returned. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.11.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {number} [n=0] The index of the element to return. |
|
* @returns {*} Returns the nth element of `array`. |
|
* @example |
|
* |
|
* var array = ['a', 'b', 'c', 'd']; |
|
* |
|
* _.nth(array, 1); |
|
* // => 'b' |
|
* |
|
* _.nth(array, -2); |
|
* // => 'c'; |
|
*/ |
|
function nth(array, n) { |
|
return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; |
|
} |
|
|
|
/** |
|
* Removes all given values from `array` using |
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons. |
|
* |
|
* **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` |
|
* to remove elements from an array by predicate. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @param {...*} [values] The values to remove. |
|
* @returns {Array} Returns `array`. |
|
* @example |
|
* |
|
* var array = ['a', 'b', 'c', 'a', 'b', 'c']; |
|
* |
|
* _.pull(array, 'a', 'c'); |
|
* console.log(array); |
|
* // => ['b', 'b'] |
|
*/ |
|
var pull = baseRest(pullAll); |
|
|
|
/** |
|
* This method is like `_.pull` except that it accepts an array of values to remove. |
|
* |
|
* **Note:** Unlike `_.difference`, this method mutates `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @param {Array} values The values to remove. |
|
* @returns {Array} Returns `array`. |
|
* @example |
|
* |
|
* var array = ['a', 'b', 'c', 'a', 'b', 'c']; |
|
* |
|
* _.pullAll(array, ['a', 'c']); |
|
* console.log(array); |
|
* // => ['b', 'b'] |
|
*/ |
|
function pullAll(array, values) { |
|
return (array && array.length && values && values.length) |
|
? basePullAll(array, values) |
|
: array; |
|
} |
|
|
|
/** |
|
* This method is like `_.pullAll` except that it accepts `iteratee` which is |
|
* invoked for each element of `array` and `values` to generate the criterion |
|
* by which they're compared. The iteratee is invoked with one argument: (value). |
|
* |
|
* **Note:** Unlike `_.differenceBy`, this method mutates `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @param {Array} values The values to remove. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Array} Returns `array`. |
|
* @example |
|
* |
|
* var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; |
|
* |
|
* _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); |
|
* console.log(array); |
|
* // => [{ 'x': 2 }] |
|
*/ |
|
function pullAllBy(array, values, iteratee) { |
|
return (array && array.length && values && values.length) |
|
? basePullAll(array, values, getIteratee(iteratee, 2)) |
|
: array; |
|
} |
|
|
|
/** |
|
* This method is like `_.pullAll` except that it accepts `comparator` which |
|
* is invoked to compare elements of `array` to `values`. The comparator is |
|
* invoked with two arguments: (arrVal, othVal). |
|
* |
|
* **Note:** Unlike `_.differenceWith`, this method mutates `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.6.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @param {Array} values The values to remove. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns `array`. |
|
* @example |
|
* |
|
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; |
|
* |
|
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); |
|
* console.log(array); |
|
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] |
|
*/ |
|
function pullAllWith(array, values, comparator) { |
|
return (array && array.length && values && values.length) |
|
? basePullAll(array, values, undefined, comparator) |
|
: array; |
|
} |
|
|
|
/** |
|
* Removes elements from `array` corresponding to `indexes` and returns an |
|
* array of removed elements. |
|
* |
|
* **Note:** Unlike `_.at`, this method mutates `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @param {...(number|number[])} [indexes] The indexes of elements to remove. |
|
* @returns {Array} Returns the new array of removed elements. |
|
* @example |
|
* |
|
* var array = ['a', 'b', 'c', 'd']; |
|
* var pulled = _.pullAt(array, [1, 3]); |
|
* |
|
* console.log(array); |
|
* // => ['a', 'c'] |
|
* |
|
* console.log(pulled); |
|
* // => ['b', 'd'] |
|
*/ |
|
var pullAt = flatRest(function(array, indexes) { |
|
var length = array == null ? 0 : array.length, |
|
result = baseAt(array, indexes); |
|
|
|
basePullAt(array, arrayMap(indexes, function(index) { |
|
return isIndex(index, length) ? +index : index; |
|
}).sort(compareAscending)); |
|
|
|
return result; |
|
}); |
|
|
|
/** |
|
* Removes all elements from `array` that `predicate` returns truthy for |
|
* and returns an array of the removed elements. The predicate is invoked |
|
* with three arguments: (value, index, array). |
|
* |
|
* **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` |
|
* to pull elements from an array by value. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the new array of removed elements. |
|
* @example |
|
* |
|
* var array = [1, 2, 3, 4]; |
|
* var evens = _.remove(array, function(n) { |
|
* return n % 2 == 0; |
|
* }); |
|
* |
|
* console.log(array); |
|
* // => [1, 3] |
|
* |
|
* console.log(evens); |
|
* // => [2, 4] |
|
*/ |
|
function remove(array, predicate) { |
|
var result = []; |
|
if (!(array && array.length)) { |
|
return result; |
|
} |
|
var index = -1, |
|
indexes = [], |
|
length = array.length; |
|
|
|
predicate = getIteratee(predicate, 3); |
|
while (++index < length) { |
|
var value = array[index]; |
|
if (predicate(value, index, array)) { |
|
result.push(value); |
|
indexes.push(index); |
|
} |
|
} |
|
basePullAt(array, indexes); |
|
return result; |
|
} |
|
|
|
/** |
|
* Reverses `array` so that the first element becomes the last, the second |
|
* element becomes the second to last, and so on. |
|
* |
|
* **Note:** This method mutates `array` and is based on |
|
* [`Array#reverse`](https://mdn.io/Array/reverse). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to modify. |
|
* @returns {Array} Returns `array`. |
|
* @example |
|
* |
|
* var array = [1, 2, 3]; |
|
* |
|
* _.reverse(array); |
|
* // => [3, 2, 1] |
|
* |
|
* console.log(array); |
|
* // => [3, 2, 1] |
|
*/ |
|
function reverse(array) { |
|
return array == null ? array : nativeReverse.call(array); |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` from `start` up to, but not including, `end`. |
|
* |
|
* **Note:** This method is used instead of |
|
* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are |
|
* returned. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to slice. |
|
* @param {number} [start=0] The start position. |
|
* @param {number} [end=array.length] The end position. |
|
* @returns {Array} Returns the slice of `array`. |
|
*/ |
|
function slice(array, start, end) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return []; |
|
} |
|
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { |
|
start = 0; |
|
end = length; |
|
} |
|
else { |
|
start = start == null ? 0 : toInteger(start); |
|
end = end === undefined ? length : toInteger(end); |
|
} |
|
return baseSlice(array, start, end); |
|
} |
|
|
|
/** |
|
* Uses a binary search to determine the lowest index at which `value` |
|
* should be inserted into `array` in order to maintain its sort order. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The sorted array to inspect. |
|
* @param {*} value The value to evaluate. |
|
* @returns {number} Returns the index at which `value` should be inserted |
|
* into `array`. |
|
* @example |
|
* |
|
* _.sortedIndex([30, 50], 40); |
|
* // => 1 |
|
*/ |
|
function sortedIndex(array, value) { |
|
return baseSortedIndex(array, value); |
|
} |
|
|
|
/** |
|
* This method is like `_.sortedIndex` except that it accepts `iteratee` |
|
* which is invoked for `value` and each element of `array` to compute their |
|
* sort ranking. The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The sorted array to inspect. |
|
* @param {*} value The value to evaluate. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {number} Returns the index at which `value` should be inserted |
|
* into `array`. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 4 }, { 'x': 5 }]; |
|
* |
|
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); |
|
* // => 0 |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.sortedIndexBy(objects, { 'x': 4 }, 'x'); |
|
* // => 0 |
|
*/ |
|
function sortedIndexBy(array, value, iteratee) { |
|
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); |
|
} |
|
|
|
/** |
|
* This method is like `_.indexOf` except that it performs a binary |
|
* search on a sorted `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
* @example |
|
* |
|
* _.sortedIndexOf([4, 5, 5, 5, 6], 5); |
|
* // => 1 |
|
*/ |
|
function sortedIndexOf(array, value) { |
|
var length = array == null ? 0 : array.length; |
|
if (length) { |
|
var index = baseSortedIndex(array, value); |
|
if (index < length && eq(array[index], value)) { |
|
return index; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
/** |
|
* This method is like `_.sortedIndex` except that it returns the highest |
|
* index at which `value` should be inserted into `array` in order to |
|
* maintain its sort order. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The sorted array to inspect. |
|
* @param {*} value The value to evaluate. |
|
* @returns {number} Returns the index at which `value` should be inserted |
|
* into `array`. |
|
* @example |
|
* |
|
* _.sortedLastIndex([4, 5, 5, 5, 6], 5); |
|
* // => 4 |
|
*/ |
|
function sortedLastIndex(array, value) { |
|
return baseSortedIndex(array, value, true); |
|
} |
|
|
|
/** |
|
* This method is like `_.sortedLastIndex` except that it accepts `iteratee` |
|
* which is invoked for `value` and each element of `array` to compute their |
|
* sort ranking. The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The sorted array to inspect. |
|
* @param {*} value The value to evaluate. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {number} Returns the index at which `value` should be inserted |
|
* into `array`. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 4 }, { 'x': 5 }]; |
|
* |
|
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); |
|
* // => 1 |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); |
|
* // => 1 |
|
*/ |
|
function sortedLastIndexBy(array, value, iteratee) { |
|
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); |
|
} |
|
|
|
/** |
|
* This method is like `_.lastIndexOf` except that it performs a binary |
|
* search on a sorted `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {*} value The value to search for. |
|
* @returns {number} Returns the index of the matched value, else `-1`. |
|
* @example |
|
* |
|
* _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); |
|
* // => 3 |
|
*/ |
|
function sortedLastIndexOf(array, value) { |
|
var length = array == null ? 0 : array.length; |
|
if (length) { |
|
var index = baseSortedIndex(array, value, true) - 1; |
|
if (eq(array[index], value)) { |
|
return index; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
/** |
|
* This method is like `_.uniq` except that it's designed and optimized |
|
* for sorted arrays. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @returns {Array} Returns the new duplicate free array. |
|
* @example |
|
* |
|
* _.sortedUniq([1, 1, 2]); |
|
* // => [1, 2] |
|
*/ |
|
function sortedUniq(array) { |
|
return (array && array.length) |
|
? baseSortedUniq(array) |
|
: []; |
|
} |
|
|
|
/** |
|
* This method is like `_.uniqBy` except that it's designed and optimized |
|
* for sorted arrays. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [iteratee] The iteratee invoked per element. |
|
* @returns {Array} Returns the new duplicate free array. |
|
* @example |
|
* |
|
* _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); |
|
* // => [1.1, 2.3] |
|
*/ |
|
function sortedUniqBy(array, iteratee) { |
|
return (array && array.length) |
|
? baseSortedUniq(array, getIteratee(iteratee, 2)) |
|
: []; |
|
} |
|
|
|
/** |
|
* Gets all but the first element of `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* _.tail([1, 2, 3]); |
|
* // => [2, 3] |
|
*/ |
|
function tail(array) { |
|
var length = array == null ? 0 : array.length; |
|
return length ? baseSlice(array, 1, length) : []; |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` with `n` elements taken from the beginning. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {number} [n=1] The number of elements to take. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* _.take([1, 2, 3]); |
|
* // => [1] |
|
* |
|
* _.take([1, 2, 3], 2); |
|
* // => [1, 2] |
|
* |
|
* _.take([1, 2, 3], 5); |
|
* // => [1, 2, 3] |
|
* |
|
* _.take([1, 2, 3], 0); |
|
* // => [] |
|
*/ |
|
function take(array, n, guard) { |
|
if (!(array && array.length)) { |
|
return []; |
|
} |
|
n = (guard || n === undefined) ? 1 : toInteger(n); |
|
return baseSlice(array, 0, n < 0 ? 0 : n); |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` with `n` elements taken from the end. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {number} [n=1] The number of elements to take. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* _.takeRight([1, 2, 3]); |
|
* // => [3] |
|
* |
|
* _.takeRight([1, 2, 3], 2); |
|
* // => [2, 3] |
|
* |
|
* _.takeRight([1, 2, 3], 5); |
|
* // => [1, 2, 3] |
|
* |
|
* _.takeRight([1, 2, 3], 0); |
|
* // => [] |
|
*/ |
|
function takeRight(array, n, guard) { |
|
var length = array == null ? 0 : array.length; |
|
if (!length) { |
|
return []; |
|
} |
|
n = (guard || n === undefined) ? 1 : toInteger(n); |
|
n = length - n; |
|
return baseSlice(array, n < 0 ? 0 : n, length); |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` with elements taken from the end. Elements are |
|
* taken until `predicate` returns falsey. The predicate is invoked with |
|
* three arguments: (value, index, array). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': true }, |
|
* { 'user': 'fred', 'active': false }, |
|
* { 'user': 'pebbles', 'active': false } |
|
* ]; |
|
* |
|
* _.takeRightWhile(users, function(o) { return !o.active; }); |
|
* // => objects for ['fred', 'pebbles'] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); |
|
* // => objects for ['pebbles'] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.takeRightWhile(users, ['active', false]); |
|
* // => objects for ['fred', 'pebbles'] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.takeRightWhile(users, 'active'); |
|
* // => [] |
|
*/ |
|
function takeRightWhile(array, predicate) { |
|
return (array && array.length) |
|
? baseWhile(array, getIteratee(predicate, 3), false, true) |
|
: []; |
|
} |
|
|
|
/** |
|
* Creates a slice of `array` with elements taken from the beginning. Elements |
|
* are taken until `predicate` returns falsey. The predicate is invoked with |
|
* three arguments: (value, index, array). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Array |
|
* @param {Array} array The array to query. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the slice of `array`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': false }, |
|
* { 'user': 'fred', 'active': false }, |
|
* { 'user': 'pebbles', 'active': true } |
|
* ]; |
|
* |
|
* _.takeWhile(users, function(o) { return !o.active; }); |
|
* // => objects for ['barney', 'fred'] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.takeWhile(users, { 'user': 'barney', 'active': false }); |
|
* // => objects for ['barney'] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.takeWhile(users, ['active', false]); |
|
* // => objects for ['barney', 'fred'] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.takeWhile(users, 'active'); |
|
* // => [] |
|
*/ |
|
function takeWhile(array, predicate) { |
|
return (array && array.length) |
|
? baseWhile(array, getIteratee(predicate, 3)) |
|
: []; |
|
} |
|
|
|
/** |
|
* Creates an array of unique values, in order, from all given arrays using |
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @returns {Array} Returns the new array of combined values. |
|
* @example |
|
* |
|
* _.union([2], [1, 2]); |
|
* // => [2, 1] |
|
*/ |
|
var union = baseRest(function(arrays) { |
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); |
|
}); |
|
|
|
/** |
|
* This method is like `_.union` except that it accepts `iteratee` which is |
|
* invoked for each element of each `arrays` to generate the criterion by |
|
* which uniqueness is computed. Result values are chosen from the first |
|
* array in which the value occurs. The iteratee is invoked with one argument: |
|
* (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Array} Returns the new array of combined values. |
|
* @example |
|
* |
|
* _.unionBy([2.1], [1.2, 2.3], Math.floor); |
|
* // => [2.1, 1.2] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); |
|
* // => [{ 'x': 1 }, { 'x': 2 }] |
|
*/ |
|
var unionBy = baseRest(function(arrays) { |
|
var iteratee = last(arrays); |
|
if (isArrayLikeObject(iteratee)) { |
|
iteratee = undefined; |
|
} |
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); |
|
}); |
|
|
|
/** |
|
* This method is like `_.union` except that it accepts `comparator` which |
|
* is invoked to compare elements of `arrays`. Result values are chosen from |
|
* the first array in which the value occurs. The comparator is invoked |
|
* with two arguments: (arrVal, othVal). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of combined values. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; |
|
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; |
|
* |
|
* _.unionWith(objects, others, _.isEqual); |
|
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] |
|
*/ |
|
var unionWith = baseRest(function(arrays) { |
|
var comparator = last(arrays); |
|
comparator = typeof comparator == 'function' ? comparator : undefined; |
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); |
|
}); |
|
|
|
/** |
|
* Creates a duplicate-free version of an array, using |
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons, in which only the first occurrence of each element |
|
* is kept. The order of result values is determined by the order they occur |
|
* in the array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @returns {Array} Returns the new duplicate free array. |
|
* @example |
|
* |
|
* _.uniq([2, 1, 2]); |
|
* // => [2, 1] |
|
*/ |
|
function uniq(array) { |
|
return (array && array.length) ? baseUniq(array) : []; |
|
} |
|
|
|
/** |
|
* This method is like `_.uniq` except that it accepts `iteratee` which is |
|
* invoked for each element in `array` to generate the criterion by which |
|
* uniqueness is computed. The order of result values is determined by the |
|
* order they occur in the array. The iteratee is invoked with one argument: |
|
* (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Array} Returns the new duplicate free array. |
|
* @example |
|
* |
|
* _.uniqBy([2.1, 1.2, 2.3], Math.floor); |
|
* // => [2.1, 1.2] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); |
|
* // => [{ 'x': 1 }, { 'x': 2 }] |
|
*/ |
|
function uniqBy(array, iteratee) { |
|
return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; |
|
} |
|
|
|
/** |
|
* This method is like `_.uniq` except that it accepts `comparator` which |
|
* is invoked to compare elements of `array`. The order of result values is |
|
* determined by the order they occur in the array.The comparator is invoked |
|
* with two arguments: (arrVal, othVal). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new duplicate free array. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; |
|
* |
|
* _.uniqWith(objects, _.isEqual); |
|
* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] |
|
*/ |
|
function uniqWith(array, comparator) { |
|
comparator = typeof comparator == 'function' ? comparator : undefined; |
|
return (array && array.length) ? baseUniq(array, undefined, comparator) : []; |
|
} |
|
|
|
/** |
|
* This method is like `_.zip` except that it accepts an array of grouped |
|
* elements and creates an array regrouping the elements to their pre-zip |
|
* configuration. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.2.0 |
|
* @category Array |
|
* @param {Array} array The array of grouped elements to process. |
|
* @returns {Array} Returns the new array of regrouped elements. |
|
* @example |
|
* |
|
* var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); |
|
* // => [['a', 1, true], ['b', 2, false]] |
|
* |
|
* _.unzip(zipped); |
|
* // => [['a', 'b'], [1, 2], [true, false]] |
|
*/ |
|
function unzip(array) { |
|
if (!(array && array.length)) { |
|
return []; |
|
} |
|
var length = 0; |
|
array = arrayFilter(array, function(group) { |
|
if (isArrayLikeObject(group)) { |
|
length = nativeMax(group.length, length); |
|
return true; |
|
} |
|
}); |
|
return baseTimes(length, function(index) { |
|
return arrayMap(array, baseProperty(index)); |
|
}); |
|
} |
|
|
|
/** |
|
* This method is like `_.unzip` except that it accepts `iteratee` to specify |
|
* how regrouped values should be combined. The iteratee is invoked with the |
|
* elements of each group: (...group). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.8.0 |
|
* @category Array |
|
* @param {Array} array The array of grouped elements to process. |
|
* @param {Function} [iteratee=_.identity] The function to combine |
|
* regrouped values. |
|
* @returns {Array} Returns the new array of regrouped elements. |
|
* @example |
|
* |
|
* var zipped = _.zip([1, 2], [10, 20], [100, 200]); |
|
* // => [[1, 10, 100], [2, 20, 200]] |
|
* |
|
* _.unzipWith(zipped, _.add); |
|
* // => [3, 30, 300] |
|
*/ |
|
function unzipWith(array, iteratee) { |
|
if (!(array && array.length)) { |
|
return []; |
|
} |
|
var result = unzip(array); |
|
if (iteratee == null) { |
|
return result; |
|
} |
|
return arrayMap(result, function(group) { |
|
return apply(iteratee, undefined, group); |
|
}); |
|
} |
|
|
|
/** |
|
* Creates an array excluding all given values using |
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* for equality comparisons. |
|
* |
|
* **Note:** Unlike `_.pull`, this method returns a new array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {Array} array The array to inspect. |
|
* @param {...*} [values] The values to exclude. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @see _.difference, _.xor |
|
* @example |
|
* |
|
* _.without([2, 1, 2, 3], 1, 2); |
|
* // => [3] |
|
*/ |
|
var without = baseRest(function(array, values) { |
|
return isArrayLikeObject(array) |
|
? baseDifference(array, values) |
|
: []; |
|
}); |
|
|
|
/** |
|
* Creates an array of unique values that is the |
|
* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) |
|
* of the given arrays. The order of result values is determined by the order |
|
* they occur in the arrays. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.4.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @see _.difference, _.without |
|
* @example |
|
* |
|
* _.xor([2, 1], [2, 3]); |
|
* // => [1, 3] |
|
*/ |
|
var xor = baseRest(function(arrays) { |
|
return baseXor(arrayFilter(arrays, isArrayLikeObject)); |
|
}); |
|
|
|
/** |
|
* This method is like `_.xor` except that it accepts `iteratee` which is |
|
* invoked for each element of each `arrays` to generate the criterion by |
|
* which by which they're compared. The order of result values is determined |
|
* by the order they occur in the arrays. The iteratee is invoked with one |
|
* argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @example |
|
* |
|
* _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); |
|
* // => [1.2, 3.4] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); |
|
* // => [{ 'x': 2 }] |
|
*/ |
|
var xorBy = baseRest(function(arrays) { |
|
var iteratee = last(arrays); |
|
if (isArrayLikeObject(iteratee)) { |
|
iteratee = undefined; |
|
} |
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); |
|
}); |
|
|
|
/** |
|
* This method is like `_.xor` except that it accepts `comparator` which is |
|
* invoked to compare elements of `arrays`. The order of result values is |
|
* determined by the order they occur in the arrays. The comparator is invoked |
|
* with two arguments: (arrVal, othVal). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to inspect. |
|
* @param {Function} [comparator] The comparator invoked per element. |
|
* @returns {Array} Returns the new array of filtered values. |
|
* @example |
|
* |
|
* var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; |
|
* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; |
|
* |
|
* _.xorWith(objects, others, _.isEqual); |
|
* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] |
|
*/ |
|
var xorWith = baseRest(function(arrays) { |
|
var comparator = last(arrays); |
|
comparator = typeof comparator == 'function' ? comparator : undefined; |
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); |
|
}); |
|
|
|
/** |
|
* Creates an array of grouped elements, the first of which contains the |
|
* first elements of the given arrays, the second of which contains the |
|
* second elements of the given arrays, and so on. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to process. |
|
* @returns {Array} Returns the new array of grouped elements. |
|
* @example |
|
* |
|
* _.zip(['a', 'b'], [1, 2], [true, false]); |
|
* // => [['a', 1, true], ['b', 2, false]] |
|
*/ |
|
var zip = baseRest(unzip); |
|
|
|
/** |
|
* This method is like `_.fromPairs` except that it accepts two arrays, |
|
* one of property identifiers and one of corresponding values. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.4.0 |
|
* @category Array |
|
* @param {Array} [props=[]] The property identifiers. |
|
* @param {Array} [values=[]] The property values. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* _.zipObject(['a', 'b'], [1, 2]); |
|
* // => { 'a': 1, 'b': 2 } |
|
*/ |
|
function zipObject(props, values) { |
|
return baseZipObject(props || [], values || [], assignValue); |
|
} |
|
|
|
/** |
|
* This method is like `_.zipObject` except that it supports property paths. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.1.0 |
|
* @category Array |
|
* @param {Array} [props=[]] The property identifiers. |
|
* @param {Array} [values=[]] The property values. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); |
|
* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } |
|
*/ |
|
function zipObjectDeep(props, values) { |
|
return baseZipObject(props || [], values || [], baseSet); |
|
} |
|
|
|
/** |
|
* This method is like `_.zip` except that it accepts `iteratee` to specify |
|
* how grouped values should be combined. The iteratee is invoked with the |
|
* elements of each group: (...group). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.8.0 |
|
* @category Array |
|
* @param {...Array} [arrays] The arrays to process. |
|
* @param {Function} [iteratee=_.identity] The function to combine |
|
* grouped values. |
|
* @returns {Array} Returns the new array of grouped elements. |
|
* @example |
|
* |
|
* _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { |
|
* return a + b + c; |
|
* }); |
|
* // => [111, 222] |
|
*/ |
|
var zipWith = baseRest(function(arrays) { |
|
var length = arrays.length, |
|
iteratee = length > 1 ? arrays[length - 1] : undefined; |
|
|
|
iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; |
|
return unzipWith(arrays, iteratee); |
|
}); |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates a `lodash` wrapper instance that wraps `value` with explicit method |
|
* chain sequences enabled. The result of such sequences must be unwrapped |
|
* with `_#value`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.3.0 |
|
* @category Seq |
|
* @param {*} value The value to wrap. |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36 }, |
|
* { 'user': 'fred', 'age': 40 }, |
|
* { 'user': 'pebbles', 'age': 1 } |
|
* ]; |
|
* |
|
* var youngest = _ |
|
* .chain(users) |
|
* .sortBy('age') |
|
* .map(function(o) { |
|
* return o.user + ' is ' + o.age; |
|
* }) |
|
* .head() |
|
* .value(); |
|
* // => 'pebbles is 1' |
|
*/ |
|
function chain(value) { |
|
var result = lodash(value); |
|
result.__chain__ = true; |
|
return result; |
|
} |
|
|
|
/** |
|
* This method invokes `interceptor` and returns `value`. The interceptor |
|
* is invoked with one argument; (value). The purpose of this method is to |
|
* "tap into" a method chain sequence in order to modify intermediate results. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Seq |
|
* @param {*} value The value to provide to `interceptor`. |
|
* @param {Function} interceptor The function to invoke. |
|
* @returns {*} Returns `value`. |
|
* @example |
|
* |
|
* _([1, 2, 3]) |
|
* .tap(function(array) { |
|
* // Mutate input array. |
|
* array.pop(); |
|
* }) |
|
* .reverse() |
|
* .value(); |
|
* // => [2, 1] |
|
*/ |
|
function tap(value, interceptor) { |
|
interceptor(value); |
|
return value; |
|
} |
|
|
|
/** |
|
* This method is like `_.tap` except that it returns the result of `interceptor`. |
|
* The purpose of this method is to "pass thru" values replacing intermediate |
|
* results in a method chain sequence. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Seq |
|
* @param {*} value The value to provide to `interceptor`. |
|
* @param {Function} interceptor The function to invoke. |
|
* @returns {*} Returns the result of `interceptor`. |
|
* @example |
|
* |
|
* _(' abc ') |
|
* .chain() |
|
* .trim() |
|
* .thru(function(value) { |
|
* return [value]; |
|
* }) |
|
* .value(); |
|
* // => ['abc'] |
|
*/ |
|
function thru(value, interceptor) { |
|
return interceptor(value); |
|
} |
|
|
|
/** |
|
* This method is the wrapper version of `_.at`. |
|
* |
|
* @name at |
|
* @memberOf _ |
|
* @since 1.0.0 |
|
* @category Seq |
|
* @param {...(string|string[])} [paths] The property paths to pick. |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; |
|
* |
|
* _(object).at(['a[0].b.c', 'a[1]']).value(); |
|
* // => [3, 4] |
|
*/ |
|
var wrapperAt = flatRest(function(paths) { |
|
var length = paths.length, |
|
start = length ? paths[0] : 0, |
|
value = this.__wrapped__, |
|
interceptor = function(object) { return baseAt(object, paths); }; |
|
|
|
if (length > 1 || this.__actions__.length || |
|
!(value instanceof LazyWrapper) || !isIndex(start)) { |
|
return this.thru(interceptor); |
|
} |
|
value = value.slice(start, +start + (length ? 1 : 0)); |
|
value.__actions__.push({ |
|
'func': thru, |
|
'args': [interceptor], |
|
'thisArg': undefined |
|
}); |
|
return new LodashWrapper(value, this.__chain__).thru(function(array) { |
|
if (length && !array.length) { |
|
array.push(undefined); |
|
} |
|
return array; |
|
}); |
|
}); |
|
|
|
/** |
|
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled. |
|
* |
|
* @name chain |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Seq |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36 }, |
|
* { 'user': 'fred', 'age': 40 } |
|
* ]; |
|
* |
|
* // A sequence without explicit chaining. |
|
* _(users).head(); |
|
* // => { 'user': 'barney', 'age': 36 } |
|
* |
|
* // A sequence with explicit chaining. |
|
* _(users) |
|
* .chain() |
|
* .head() |
|
* .pick('user') |
|
* .value(); |
|
* // => { 'user': 'barney' } |
|
*/ |
|
function wrapperChain() { |
|
return chain(this); |
|
} |
|
|
|
/** |
|
* Executes the chain sequence and returns the wrapped result. |
|
* |
|
* @name commit |
|
* @memberOf _ |
|
* @since 3.2.0 |
|
* @category Seq |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* var array = [1, 2]; |
|
* var wrapped = _(array).push(3); |
|
* |
|
* console.log(array); |
|
* // => [1, 2] |
|
* |
|
* wrapped = wrapped.commit(); |
|
* console.log(array); |
|
* // => [1, 2, 3] |
|
* |
|
* wrapped.last(); |
|
* // => 3 |
|
* |
|
* console.log(array); |
|
* // => [1, 2, 3] |
|
*/ |
|
function wrapperCommit() { |
|
return new LodashWrapper(this.value(), this.__chain__); |
|
} |
|
|
|
/** |
|
* Gets the next value on a wrapped object following the |
|
* [iterator protocol](https://mdn.io/iteration_protocols#iterator). |
|
* |
|
* @name next |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Seq |
|
* @returns {Object} Returns the next iterator value. |
|
* @example |
|
* |
|
* var wrapped = _([1, 2]); |
|
* |
|
* wrapped.next(); |
|
* // => { 'done': false, 'value': 1 } |
|
* |
|
* wrapped.next(); |
|
* // => { 'done': false, 'value': 2 } |
|
* |
|
* wrapped.next(); |
|
* // => { 'done': true, 'value': undefined } |
|
*/ |
|
function wrapperNext() { |
|
if (this.__values__ === undefined) { |
|
this.__values__ = toArray(this.value()); |
|
} |
|
var done = this.__index__ >= this.__values__.length, |
|
value = done ? undefined : this.__values__[this.__index__++]; |
|
|
|
return { 'done': done, 'value': value }; |
|
} |
|
|
|
/** |
|
* Enables the wrapper to be iterable. |
|
* |
|
* @name Symbol.iterator |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Seq |
|
* @returns {Object} Returns the wrapper object. |
|
* @example |
|
* |
|
* var wrapped = _([1, 2]); |
|
* |
|
* wrapped[Symbol.iterator]() === wrapped; |
|
* // => true |
|
* |
|
* Array.from(wrapped); |
|
* // => [1, 2] |
|
*/ |
|
function wrapperToIterator() { |
|
return this; |
|
} |
|
|
|
/** |
|
* Creates a clone of the chain sequence planting `value` as the wrapped value. |
|
* |
|
* @name plant |
|
* @memberOf _ |
|
* @since 3.2.0 |
|
* @category Seq |
|
* @param {*} value The value to plant. |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* function square(n) { |
|
* return n * n; |
|
* } |
|
* |
|
* var wrapped = _([1, 2]).map(square); |
|
* var other = wrapped.plant([3, 4]); |
|
* |
|
* other.value(); |
|
* // => [9, 16] |
|
* |
|
* wrapped.value(); |
|
* // => [1, 4] |
|
*/ |
|
function wrapperPlant(value) { |
|
var result, |
|
parent = this; |
|
|
|
while (parent instanceof baseLodash) { |
|
var clone = wrapperClone(parent); |
|
clone.__index__ = 0; |
|
clone.__values__ = undefined; |
|
if (result) { |
|
previous.__wrapped__ = clone; |
|
} else { |
|
result = clone; |
|
} |
|
var previous = clone; |
|
parent = parent.__wrapped__; |
|
} |
|
previous.__wrapped__ = value; |
|
return result; |
|
} |
|
|
|
/** |
|
* This method is the wrapper version of `_.reverse`. |
|
* |
|
* **Note:** This method mutates the wrapped array. |
|
* |
|
* @name reverse |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Seq |
|
* @returns {Object} Returns the new `lodash` wrapper instance. |
|
* @example |
|
* |
|
* var array = [1, 2, 3]; |
|
* |
|
* _(array).reverse().value() |
|
* // => [3, 2, 1] |
|
* |
|
* console.log(array); |
|
* // => [3, 2, 1] |
|
*/ |
|
function wrapperReverse() { |
|
var value = this.__wrapped__; |
|
if (value instanceof LazyWrapper) { |
|
var wrapped = value; |
|
if (this.__actions__.length) { |
|
wrapped = new LazyWrapper(this); |
|
} |
|
wrapped = wrapped.reverse(); |
|
wrapped.__actions__.push({ |
|
'func': thru, |
|
'args': [reverse], |
|
'thisArg': undefined |
|
}); |
|
return new LodashWrapper(wrapped, this.__chain__); |
|
} |
|
return this.thru(reverse); |
|
} |
|
|
|
/** |
|
* Executes the chain sequence to resolve the unwrapped value. |
|
* |
|
* @name value |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @alias toJSON, valueOf |
|
* @category Seq |
|
* @returns {*} Returns the resolved unwrapped value. |
|
* @example |
|
* |
|
* _([1, 2, 3]).value(); |
|
* // => [1, 2, 3] |
|
*/ |
|
function wrapperValue() { |
|
return baseWrapperValue(this.__wrapped__, this.__actions__); |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Creates an object composed of keys generated from the results of running |
|
* each element of `collection` thru `iteratee`. The corresponding value of |
|
* each key is the number of times the key was returned by `iteratee`. The |
|
* iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.5.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee to transform keys. |
|
* @returns {Object} Returns the composed aggregate object. |
|
* @example |
|
* |
|
* _.countBy([6.1, 4.2, 6.3], Math.floor); |
|
* // => { '4': 1, '6': 2 } |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.countBy(['one', 'two', 'three'], 'length'); |
|
* // => { '3': 2, '5': 1 } |
|
*/ |
|
var countBy = createAggregator(function(result, value, key) { |
|
if (hasOwnProperty.call(result, key)) { |
|
++result[key]; |
|
} else { |
|
baseAssignValue(result, key, 1); |
|
} |
|
}); |
|
|
|
/** |
|
* Checks if `predicate` returns truthy for **all** elements of `collection`. |
|
* Iteration is stopped once `predicate` returns falsey. The predicate is |
|
* invoked with three arguments: (value, index|key, collection). |
|
* |
|
* **Note:** This method returns `true` for |
|
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because |
|
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of |
|
* elements of empty collections. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {boolean} Returns `true` if all elements pass the predicate check, |
|
* else `false`. |
|
* @example |
|
* |
|
* _.every([true, 1, null, 'yes'], Boolean); |
|
* // => false |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36, 'active': false }, |
|
* { 'user': 'fred', 'age': 40, 'active': false } |
|
* ]; |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.every(users, { 'user': 'barney', 'active': false }); |
|
* // => false |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.every(users, ['active', false]); |
|
* // => true |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.every(users, 'active'); |
|
* // => false |
|
*/ |
|
function every(collection, predicate, guard) { |
|
var func = isArray(collection) ? arrayEvery : baseEvery; |
|
if (guard && isIterateeCall(collection, predicate, guard)) { |
|
predicate = undefined; |
|
} |
|
return func(collection, getIteratee(predicate, 3)); |
|
} |
|
|
|
/** |
|
* Iterates over elements of `collection`, returning an array of all elements |
|
* `predicate` returns truthy for. The predicate is invoked with three |
|
* arguments: (value, index|key, collection). |
|
* |
|
* **Note:** Unlike `_.remove`, this method returns a new array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the new filtered array. |
|
* @see _.reject |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36, 'active': true }, |
|
* { 'user': 'fred', 'age': 40, 'active': false } |
|
* ]; |
|
* |
|
* _.filter(users, function(o) { return !o.active; }); |
|
* // => objects for ['fred'] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.filter(users, { 'age': 36, 'active': true }); |
|
* // => objects for ['barney'] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.filter(users, ['active', false]); |
|
* // => objects for ['fred'] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.filter(users, 'active'); |
|
* // => objects for ['barney'] |
|
* |
|
* // Combining several predicates using `_.overEvery` or `_.overSome`. |
|
* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); |
|
* // => objects for ['fred', 'barney'] |
|
*/ |
|
function filter(collection, predicate) { |
|
var func = isArray(collection) ? arrayFilter : baseFilter; |
|
return func(collection, getIteratee(predicate, 3)); |
|
} |
|
|
|
/** |
|
* Iterates over elements of `collection`, returning the first element |
|
* `predicate` returns truthy for. The predicate is invoked with three |
|
* arguments: (value, index|key, collection). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to inspect. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @param {number} [fromIndex=0] The index to search from. |
|
* @returns {*} Returns the matched element, else `undefined`. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36, 'active': true }, |
|
* { 'user': 'fred', 'age': 40, 'active': false }, |
|
* { 'user': 'pebbles', 'age': 1, 'active': true } |
|
* ]; |
|
* |
|
* _.find(users, function(o) { return o.age < 40; }); |
|
* // => object for 'barney' |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.find(users, { 'age': 1, 'active': true }); |
|
* // => object for 'pebbles' |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.find(users, ['active', false]); |
|
* // => object for 'fred' |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.find(users, 'active'); |
|
* // => object for 'barney' |
|
*/ |
|
var find = createFind(findIndex); |
|
|
|
/** |
|
* This method is like `_.find` except that it iterates over elements of |
|
* `collection` from right to left. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to inspect. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @param {number} [fromIndex=collection.length-1] The index to search from. |
|
* @returns {*} Returns the matched element, else `undefined`. |
|
* @example |
|
* |
|
* _.findLast([1, 2, 3, 4], function(n) { |
|
* return n % 2 == 1; |
|
* }); |
|
* // => 3 |
|
*/ |
|
var findLast = createFind(findLastIndex); |
|
|
|
/** |
|
* Creates a flattened array of values by running each element in `collection` |
|
* thru `iteratee` and flattening the mapped results. The iteratee is invoked |
|
* with three arguments: (value, index|key, collection). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the new flattened array. |
|
* @example |
|
* |
|
* function duplicate(n) { |
|
* return [n, n]; |
|
* } |
|
* |
|
* _.flatMap([1, 2], duplicate); |
|
* // => [1, 1, 2, 2] |
|
*/ |
|
function flatMap(collection, iteratee) { |
|
return baseFlatten(map(collection, iteratee), 1); |
|
} |
|
|
|
/** |
|
* This method is like `_.flatMap` except that it recursively flattens the |
|
* mapped results. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.7.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the new flattened array. |
|
* @example |
|
* |
|
* function duplicate(n) { |
|
* return [[[n, n]]]; |
|
* } |
|
* |
|
* _.flatMapDeep([1, 2], duplicate); |
|
* // => [1, 1, 2, 2] |
|
*/ |
|
function flatMapDeep(collection, iteratee) { |
|
return baseFlatten(map(collection, iteratee), INFINITY); |
|
} |
|
|
|
/** |
|
* This method is like `_.flatMap` except that it recursively flattens the |
|
* mapped results up to `depth` times. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.7.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @param {number} [depth=1] The maximum recursion depth. |
|
* @returns {Array} Returns the new flattened array. |
|
* @example |
|
* |
|
* function duplicate(n) { |
|
* return [[[n, n]]]; |
|
* } |
|
* |
|
* _.flatMapDepth([1, 2], duplicate, 2); |
|
* // => [[1, 1], [2, 2]] |
|
*/ |
|
function flatMapDepth(collection, iteratee, depth) { |
|
depth = depth === undefined ? 1 : toInteger(depth); |
|
return baseFlatten(map(collection, iteratee), depth); |
|
} |
|
|
|
/** |
|
* Iterates over elements of `collection` and invokes `iteratee` for each element. |
|
* The iteratee is invoked with three arguments: (value, index|key, collection). |
|
* Iteratee functions may exit iteration early by explicitly returning `false`. |
|
* |
|
* **Note:** As with other "Collections" methods, objects with a "length" |
|
* property are iterated like arrays. To avoid this behavior use `_.forIn` |
|
* or `_.forOwn` for object iteration. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @alias each |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Array|Object} Returns `collection`. |
|
* @see _.forEachRight |
|
* @example |
|
* |
|
* _.forEach([1, 2], function(value) { |
|
* console.log(value); |
|
* }); |
|
* // => Logs `1` then `2`. |
|
* |
|
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { |
|
* console.log(key); |
|
* }); |
|
* // => Logs 'a' then 'b' (iteration order is not guaranteed). |
|
*/ |
|
function forEach(collection, iteratee) { |
|
var func = isArray(collection) ? arrayEach : baseEach; |
|
return func(collection, getIteratee(iteratee, 3)); |
|
} |
|
|
|
/** |
|
* This method is like `_.forEach` except that it iterates over elements of |
|
* `collection` from right to left. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @alias eachRight |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Array|Object} Returns `collection`. |
|
* @see _.forEach |
|
* @example |
|
* |
|
* _.forEachRight([1, 2], function(value) { |
|
* console.log(value); |
|
* }); |
|
* // => Logs `2` then `1`. |
|
*/ |
|
function forEachRight(collection, iteratee) { |
|
var func = isArray(collection) ? arrayEachRight : baseEachRight; |
|
return func(collection, getIteratee(iteratee, 3)); |
|
} |
|
|
|
/** |
|
* Creates an object composed of keys generated from the results of running |
|
* each element of `collection` thru `iteratee`. The order of grouped values |
|
* is determined by the order they occur in `collection`. The corresponding |
|
* value of each key is an array of elements responsible for generating the |
|
* key. The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee to transform keys. |
|
* @returns {Object} Returns the composed aggregate object. |
|
* @example |
|
* |
|
* _.groupBy([6.1, 4.2, 6.3], Math.floor); |
|
* // => { '4': [4.2], '6': [6.1, 6.3] } |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.groupBy(['one', 'two', 'three'], 'length'); |
|
* // => { '3': ['one', 'two'], '5': ['three'] } |
|
*/ |
|
var groupBy = createAggregator(function(result, value, key) { |
|
if (hasOwnProperty.call(result, key)) { |
|
result[key].push(value); |
|
} else { |
|
baseAssignValue(result, key, [value]); |
|
} |
|
}); |
|
|
|
/** |
|
* Checks if `value` is in `collection`. If `collection` is a string, it's |
|
* checked for a substring of `value`, otherwise |
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* is used for equality comparisons. If `fromIndex` is negative, it's used as |
|
* the offset from the end of `collection`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object|string} collection The collection to inspect. |
|
* @param {*} value The value to search for. |
|
* @param {number} [fromIndex=0] The index to search from. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. |
|
* @returns {boolean} Returns `true` if `value` is found, else `false`. |
|
* @example |
|
* |
|
* _.includes([1, 2, 3], 1); |
|
* // => true |
|
* |
|
* _.includes([1, 2, 3], 1, 2); |
|
* // => false |
|
* |
|
* _.includes({ 'a': 1, 'b': 2 }, 1); |
|
* // => true |
|
* |
|
* _.includes('abcd', 'bc'); |
|
* // => true |
|
*/ |
|
function includes(collection, value, fromIndex, guard) { |
|
collection = isArrayLike(collection) ? collection : values(collection); |
|
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; |
|
|
|
var length = collection.length; |
|
if (fromIndex < 0) { |
|
fromIndex = nativeMax(length + fromIndex, 0); |
|
} |
|
return isString(collection) |
|
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) |
|
: (!!length && baseIndexOf(collection, value, fromIndex) > -1); |
|
} |
|
|
|
/** |
|
* Invokes the method at `path` of each element in `collection`, returning |
|
* an array of the results of each invoked method. Any additional arguments |
|
* are provided to each invoked method. If `path` is a function, it's invoked |
|
* for, and `this` bound to, each element in `collection`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Array|Function|string} path The path of the method to invoke or |
|
* the function invoked per iteration. |
|
* @param {...*} [args] The arguments to invoke each method with. |
|
* @returns {Array} Returns the array of results. |
|
* @example |
|
* |
|
* _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); |
|
* // => [[1, 5, 7], [1, 2, 3]] |
|
* |
|
* _.invokeMap([123, 456], String.prototype.split, ''); |
|
* // => [['1', '2', '3'], ['4', '5', '6']] |
|
*/ |
|
var invokeMap = baseRest(function(collection, path, args) { |
|
var index = -1, |
|
isFunc = typeof path == 'function', |
|
result = isArrayLike(collection) ? Array(collection.length) : []; |
|
|
|
baseEach(collection, function(value) { |
|
result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); |
|
}); |
|
return result; |
|
}); |
|
|
|
/** |
|
* Creates an object composed of keys generated from the results of running |
|
* each element of `collection` thru `iteratee`. The corresponding value of |
|
* each key is the last element responsible for generating the key. The |
|
* iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee to transform keys. |
|
* @returns {Object} Returns the composed aggregate object. |
|
* @example |
|
* |
|
* var array = [ |
|
* { 'dir': 'left', 'code': 97 }, |
|
* { 'dir': 'right', 'code': 100 } |
|
* ]; |
|
* |
|
* _.keyBy(array, function(o) { |
|
* return String.fromCharCode(o.code); |
|
* }); |
|
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } |
|
* |
|
* _.keyBy(array, 'dir'); |
|
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } |
|
*/ |
|
var keyBy = createAggregator(function(result, value, key) { |
|
baseAssignValue(result, key, value); |
|
}); |
|
|
|
/** |
|
* Creates an array of values by running each element in `collection` thru |
|
* `iteratee`. The iteratee is invoked with three arguments: |
|
* (value, index|key, collection). |
|
* |
|
* Many lodash methods are guarded to work as iteratees for methods like |
|
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. |
|
* |
|
* The guarded methods are: |
|
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, |
|
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, |
|
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, |
|
* `template`, `trim`, `trimEnd`, `trimStart`, and `words` |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the new mapped array. |
|
* @example |
|
* |
|
* function square(n) { |
|
* return n * n; |
|
* } |
|
* |
|
* _.map([4, 8], square); |
|
* // => [16, 64] |
|
* |
|
* _.map({ 'a': 4, 'b': 8 }, square); |
|
* // => [16, 64] (iteration order is not guaranteed) |
|
* |
|
* var users = [ |
|
* { 'user': 'barney' }, |
|
* { 'user': 'fred' } |
|
* ]; |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.map(users, 'user'); |
|
* // => ['barney', 'fred'] |
|
*/ |
|
function map(collection, iteratee) { |
|
var func = isArray(collection) ? arrayMap : baseMap; |
|
return func(collection, getIteratee(iteratee, 3)); |
|
} |
|
|
|
/** |
|
* This method is like `_.sortBy` except that it allows specifying the sort |
|
* orders of the iteratees to sort by. If `orders` is unspecified, all values |
|
* are sorted in ascending order. Otherwise, specify an order of "desc" for |
|
* descending or "asc" for ascending sort order of corresponding values. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] |
|
* The iteratees to sort by. |
|
* @param {string[]} [orders] The sort orders of `iteratees`. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. |
|
* @returns {Array} Returns the new sorted array. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'fred', 'age': 48 }, |
|
* { 'user': 'barney', 'age': 34 }, |
|
* { 'user': 'fred', 'age': 40 }, |
|
* { 'user': 'barney', 'age': 36 } |
|
* ]; |
|
* |
|
* // Sort by `user` in ascending order and by `age` in descending order. |
|
* _.orderBy(users, ['user', 'age'], ['asc', 'desc']); |
|
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] |
|
*/ |
|
function orderBy(collection, iteratees, orders, guard) { |
|
if (collection == null) { |
|
return []; |
|
} |
|
if (!isArray(iteratees)) { |
|
iteratees = iteratees == null ? [] : [iteratees]; |
|
} |
|
orders = guard ? undefined : orders; |
|
if (!isArray(orders)) { |
|
orders = orders == null ? [] : [orders]; |
|
} |
|
return baseOrderBy(collection, iteratees, orders); |
|
} |
|
|
|
/** |
|
* Creates an array of elements split into two groups, the first of which |
|
* contains elements `predicate` returns truthy for, the second of which |
|
* contains elements `predicate` returns falsey for. The predicate is |
|
* invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the array of grouped elements. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36, 'active': false }, |
|
* { 'user': 'fred', 'age': 40, 'active': true }, |
|
* { 'user': 'pebbles', 'age': 1, 'active': false } |
|
* ]; |
|
* |
|
* _.partition(users, function(o) { return o.active; }); |
|
* // => objects for [['fred'], ['barney', 'pebbles']] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.partition(users, { 'age': 1, 'active': false }); |
|
* // => objects for [['pebbles'], ['barney', 'fred']] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.partition(users, ['active', false]); |
|
* // => objects for [['barney', 'pebbles'], ['fred']] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.partition(users, 'active'); |
|
* // => objects for [['fred'], ['barney', 'pebbles']] |
|
*/ |
|
var partition = createAggregator(function(result, value, key) { |
|
result[key ? 0 : 1].push(value); |
|
}, function() { return [[], []]; }); |
|
|
|
/** |
|
* Reduces `collection` to a value which is the accumulated result of running |
|
* each element in `collection` thru `iteratee`, where each successive |
|
* invocation is supplied the return value of the previous. If `accumulator` |
|
* is not given, the first element of `collection` is used as the initial |
|
* value. The iteratee is invoked with four arguments: |
|
* (accumulator, value, index|key, collection). |
|
* |
|
* Many lodash methods are guarded to work as iteratees for methods like |
|
* `_.reduce`, `_.reduceRight`, and `_.transform`. |
|
* |
|
* The guarded methods are: |
|
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, |
|
* and `sortBy` |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @param {*} [accumulator] The initial value. |
|
* @returns {*} Returns the accumulated value. |
|
* @see _.reduceRight |
|
* @example |
|
* |
|
* _.reduce([1, 2], function(sum, n) { |
|
* return sum + n; |
|
* }, 0); |
|
* // => 3 |
|
* |
|
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { |
|
* (result[value] || (result[value] = [])).push(key); |
|
* return result; |
|
* }, {}); |
|
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) |
|
*/ |
|
function reduce(collection, iteratee, accumulator) { |
|
var func = isArray(collection) ? arrayReduce : baseReduce, |
|
initAccum = arguments.length < 3; |
|
|
|
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); |
|
} |
|
|
|
/** |
|
* This method is like `_.reduce` except that it iterates over elements of |
|
* `collection` from right to left. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @param {*} [accumulator] The initial value. |
|
* @returns {*} Returns the accumulated value. |
|
* @see _.reduce |
|
* @example |
|
* |
|
* var array = [[0, 1], [2, 3], [4, 5]]; |
|
* |
|
* _.reduceRight(array, function(flattened, other) { |
|
* return flattened.concat(other); |
|
* }, []); |
|
* // => [4, 5, 2, 3, 0, 1] |
|
*/ |
|
function reduceRight(collection, iteratee, accumulator) { |
|
var func = isArray(collection) ? arrayReduceRight : baseReduce, |
|
initAccum = arguments.length < 3; |
|
|
|
return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); |
|
} |
|
|
|
/** |
|
* The opposite of `_.filter`; this method returns the elements of `collection` |
|
* that `predicate` does **not** return truthy for. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the new filtered array. |
|
* @see _.filter |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36, 'active': false }, |
|
* { 'user': 'fred', 'age': 40, 'active': true } |
|
* ]; |
|
* |
|
* _.reject(users, function(o) { return !o.active; }); |
|
* // => objects for ['fred'] |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.reject(users, { 'age': 40, 'active': true }); |
|
* // => objects for ['barney'] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.reject(users, ['active', false]); |
|
* // => objects for ['fred'] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.reject(users, 'active'); |
|
* // => objects for ['barney'] |
|
*/ |
|
function reject(collection, predicate) { |
|
var func = isArray(collection) ? arrayFilter : baseFilter; |
|
return func(collection, negate(getIteratee(predicate, 3))); |
|
} |
|
|
|
/** |
|
* Gets a random element from `collection`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to sample. |
|
* @returns {*} Returns the random element. |
|
* @example |
|
* |
|
* _.sample([1, 2, 3, 4]); |
|
* // => 2 |
|
*/ |
|
function sample(collection) { |
|
var func = isArray(collection) ? arraySample : baseSample; |
|
return func(collection); |
|
} |
|
|
|
/** |
|
* Gets `n` random elements at unique keys from `collection` up to the |
|
* size of `collection`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to sample. |
|
* @param {number} [n=1] The number of elements to sample. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the random elements. |
|
* @example |
|
* |
|
* _.sampleSize([1, 2, 3], 2); |
|
* // => [3, 1] |
|
* |
|
* _.sampleSize([1, 2, 3], 4); |
|
* // => [2, 3, 1] |
|
*/ |
|
function sampleSize(collection, n, guard) { |
|
if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { |
|
n = 1; |
|
} else { |
|
n = toInteger(n); |
|
} |
|
var func = isArray(collection) ? arraySampleSize : baseSampleSize; |
|
return func(collection, n); |
|
} |
|
|
|
/** |
|
* Creates an array of shuffled values, using a version of the |
|
* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to shuffle. |
|
* @returns {Array} Returns the new shuffled array. |
|
* @example |
|
* |
|
* _.shuffle([1, 2, 3, 4]); |
|
* // => [4, 1, 3, 2] |
|
*/ |
|
function shuffle(collection) { |
|
var func = isArray(collection) ? arrayShuffle : baseShuffle; |
|
return func(collection); |
|
} |
|
|
|
/** |
|
* Gets the size of `collection` by returning its length for array-like |
|
* values or the number of own enumerable string keyed properties for objects. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object|string} collection The collection to inspect. |
|
* @returns {number} Returns the collection size. |
|
* @example |
|
* |
|
* _.size([1, 2, 3]); |
|
* // => 3 |
|
* |
|
* _.size({ 'a': 1, 'b': 2 }); |
|
* // => 2 |
|
* |
|
* _.size('pebbles'); |
|
* // => 7 |
|
*/ |
|
function size(collection) { |
|
if (collection == null) { |
|
return 0; |
|
} |
|
if (isArrayLike(collection)) { |
|
return isString(collection) ? stringSize(collection) : collection.length; |
|
} |
|
var tag = getTag(collection); |
|
if (tag == mapTag || tag == setTag) { |
|
return collection.size; |
|
} |
|
return baseKeys(collection).length; |
|
} |
|
|
|
/** |
|
* Checks if `predicate` returns truthy for **any** element of `collection`. |
|
* Iteration is stopped once `predicate` returns truthy. The predicate is |
|
* invoked with three arguments: (value, index|key, collection). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {boolean} Returns `true` if any element passes the predicate check, |
|
* else `false`. |
|
* @example |
|
* |
|
* _.some([null, 0, 'yes', false], Boolean); |
|
* // => true |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'active': true }, |
|
* { 'user': 'fred', 'active': false } |
|
* ]; |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.some(users, { 'user': 'barney', 'active': false }); |
|
* // => false |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.some(users, ['active', false]); |
|
* // => true |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.some(users, 'active'); |
|
* // => true |
|
*/ |
|
function some(collection, predicate, guard) { |
|
var func = isArray(collection) ? arraySome : baseSome; |
|
if (guard && isIterateeCall(collection, predicate, guard)) { |
|
predicate = undefined; |
|
} |
|
return func(collection, getIteratee(predicate, 3)); |
|
} |
|
|
|
/** |
|
* Creates an array of elements, sorted in ascending order by the results of |
|
* running each element in a collection thru each iteratee. This method |
|
* performs a stable sort, that is, it preserves the original sort order of |
|
* equal elements. The iteratees are invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Collection |
|
* @param {Array|Object} collection The collection to iterate over. |
|
* @param {...(Function|Function[])} [iteratees=[_.identity]] |
|
* The iteratees to sort by. |
|
* @returns {Array} Returns the new sorted array. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'fred', 'age': 48 }, |
|
* { 'user': 'barney', 'age': 36 }, |
|
* { 'user': 'fred', 'age': 30 }, |
|
* { 'user': 'barney', 'age': 34 } |
|
* ]; |
|
* |
|
* _.sortBy(users, [function(o) { return o.user; }]); |
|
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] |
|
* |
|
* _.sortBy(users, ['user', 'age']); |
|
* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] |
|
*/ |
|
var sortBy = baseRest(function(collection, iteratees) { |
|
if (collection == null) { |
|
return []; |
|
} |
|
var length = iteratees.length; |
|
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { |
|
iteratees = []; |
|
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { |
|
iteratees = [iteratees[0]]; |
|
} |
|
return baseOrderBy(collection, baseFlatten(iteratees, 1), []); |
|
}); |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Gets the timestamp of the number of milliseconds that have elapsed since |
|
* the Unix epoch (1 January 1970 00:00:00 UTC). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.4.0 |
|
* @category Date |
|
* @returns {number} Returns the timestamp. |
|
* @example |
|
* |
|
* _.defer(function(stamp) { |
|
* console.log(_.now() - stamp); |
|
* }, _.now()); |
|
* // => Logs the number of milliseconds it took for the deferred invocation. |
|
*/ |
|
var now = ctxNow || function() { |
|
return root.Date.now(); |
|
}; |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* The opposite of `_.before`; this method creates a function that invokes |
|
* `func` once it's called `n` or more times. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {number} n The number of calls before `func` is invoked. |
|
* @param {Function} func The function to restrict. |
|
* @returns {Function} Returns the new restricted function. |
|
* @example |
|
* |
|
* var saves = ['profile', 'settings']; |
|
* |
|
* var done = _.after(saves.length, function() { |
|
* console.log('done saving!'); |
|
* }); |
|
* |
|
* _.forEach(saves, function(type) { |
|
* asyncSave({ 'type': type, 'complete': done }); |
|
* }); |
|
* // => Logs 'done saving!' after the two async saves have completed. |
|
*/ |
|
function after(n, func) { |
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
n = toInteger(n); |
|
return function() { |
|
if (--n < 1) { |
|
return func.apply(this, arguments); |
|
} |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `func`, with up to `n` arguments, |
|
* ignoring any additional arguments. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Function |
|
* @param {Function} func The function to cap arguments for. |
|
* @param {number} [n=func.length] The arity cap. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Function} Returns the new capped function. |
|
* @example |
|
* |
|
* _.map(['6', '8', '10'], _.ary(parseInt, 1)); |
|
* // => [6, 8, 10] |
|
*/ |
|
function ary(func, n, guard) { |
|
n = guard ? undefined : n; |
|
n = (func && n == null) ? func.length : n; |
|
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `func`, with the `this` binding and arguments |
|
* of the created function, while it's called less than `n` times. Subsequent |
|
* calls to the created function return the result of the last `func` invocation. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Function |
|
* @param {number} n The number of calls at which `func` is no longer invoked. |
|
* @param {Function} func The function to restrict. |
|
* @returns {Function} Returns the new restricted function. |
|
* @example |
|
* |
|
* jQuery(element).on('click', _.before(5, addContactToList)); |
|
* // => Allows adding up to 4 contacts to the list. |
|
*/ |
|
function before(n, func) { |
|
var result; |
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
n = toInteger(n); |
|
return function() { |
|
if (--n > 0) { |
|
result = func.apply(this, arguments); |
|
} |
|
if (n <= 1) { |
|
func = undefined; |
|
} |
|
return result; |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `func` with the `this` binding of `thisArg` |
|
* and `partials` prepended to the arguments it receives. |
|
* |
|
* The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, |
|
* may be used as a placeholder for partially applied arguments. |
|
* |
|
* **Note:** Unlike native `Function#bind`, this method doesn't set the "length" |
|
* property of bound functions. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to bind. |
|
* @param {*} thisArg The `this` binding of `func`. |
|
* @param {...*} [partials] The arguments to be partially applied. |
|
* @returns {Function} Returns the new bound function. |
|
* @example |
|
* |
|
* function greet(greeting, punctuation) { |
|
* return greeting + ' ' + this.user + punctuation; |
|
* } |
|
* |
|
* var object = { 'user': 'fred' }; |
|
* |
|
* var bound = _.bind(greet, object, 'hi'); |
|
* bound('!'); |
|
* // => 'hi fred!' |
|
* |
|
* // Bound with placeholders. |
|
* var bound = _.bind(greet, object, _, '!'); |
|
* bound('hi'); |
|
* // => 'hi fred!' |
|
*/ |
|
var bind = baseRest(function(func, thisArg, partials) { |
|
var bitmask = WRAP_BIND_FLAG; |
|
if (partials.length) { |
|
var holders = replaceHolders(partials, getHolder(bind)); |
|
bitmask |= WRAP_PARTIAL_FLAG; |
|
} |
|
return createWrap(func, bitmask, thisArg, partials, holders); |
|
}); |
|
|
|
/** |
|
* Creates a function that invokes the method at `object[key]` with `partials` |
|
* prepended to the arguments it receives. |
|
* |
|
* This method differs from `_.bind` by allowing bound functions to reference |
|
* methods that may be redefined or don't yet exist. See |
|
* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) |
|
* for more details. |
|
* |
|
* The `_.bindKey.placeholder` value, which defaults to `_` in monolithic |
|
* builds, may be used as a placeholder for partially applied arguments. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.10.0 |
|
* @category Function |
|
* @param {Object} object The object to invoke the method on. |
|
* @param {string} key The key of the method. |
|
* @param {...*} [partials] The arguments to be partially applied. |
|
* @returns {Function} Returns the new bound function. |
|
* @example |
|
* |
|
* var object = { |
|
* 'user': 'fred', |
|
* 'greet': function(greeting, punctuation) { |
|
* return greeting + ' ' + this.user + punctuation; |
|
* } |
|
* }; |
|
* |
|
* var bound = _.bindKey(object, 'greet', 'hi'); |
|
* bound('!'); |
|
* // => 'hi fred!' |
|
* |
|
* object.greet = function(greeting, punctuation) { |
|
* return greeting + 'ya ' + this.user + punctuation; |
|
* }; |
|
* |
|
* bound('!'); |
|
* // => 'hiya fred!' |
|
* |
|
* // Bound with placeholders. |
|
* var bound = _.bindKey(object, 'greet', _, '!'); |
|
* bound('hi'); |
|
* // => 'hiya fred!' |
|
*/ |
|
var bindKey = baseRest(function(object, key, partials) { |
|
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; |
|
if (partials.length) { |
|
var holders = replaceHolders(partials, getHolder(bindKey)); |
|
bitmask |= WRAP_PARTIAL_FLAG; |
|
} |
|
return createWrap(key, bitmask, object, partials, holders); |
|
}); |
|
|
|
/** |
|
* Creates a function that accepts arguments of `func` and either invokes |
|
* `func` returning its result, if at least `arity` number of arguments have |
|
* been provided, or returns a function that accepts the remaining `func` |
|
* arguments, and so on. The arity of `func` may be specified if `func.length` |
|
* is not sufficient. |
|
* |
|
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, |
|
* may be used as a placeholder for provided arguments. |
|
* |
|
* **Note:** This method doesn't set the "length" property of curried functions. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Function |
|
* @param {Function} func The function to curry. |
|
* @param {number} [arity=func.length] The arity of `func`. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Function} Returns the new curried function. |
|
* @example |
|
* |
|
* var abc = function(a, b, c) { |
|
* return [a, b, c]; |
|
* }; |
|
* |
|
* var curried = _.curry(abc); |
|
* |
|
* curried(1)(2)(3); |
|
* // => [1, 2, 3] |
|
* |
|
* curried(1, 2)(3); |
|
* // => [1, 2, 3] |
|
* |
|
* curried(1, 2, 3); |
|
* // => [1, 2, 3] |
|
* |
|
* // Curried with placeholders. |
|
* curried(1)(_, 3)(2); |
|
* // => [1, 2, 3] |
|
*/ |
|
function curry(func, arity, guard) { |
|
arity = guard ? undefined : arity; |
|
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); |
|
result.placeholder = curry.placeholder; |
|
return result; |
|
} |
|
|
|
/** |
|
* This method is like `_.curry` except that arguments are applied to `func` |
|
* in the manner of `_.partialRight` instead of `_.partial`. |
|
* |
|
* The `_.curryRight.placeholder` value, which defaults to `_` in monolithic |
|
* builds, may be used as a placeholder for provided arguments. |
|
* |
|
* **Note:** This method doesn't set the "length" property of curried functions. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Function |
|
* @param {Function} func The function to curry. |
|
* @param {number} [arity=func.length] The arity of `func`. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Function} Returns the new curried function. |
|
* @example |
|
* |
|
* var abc = function(a, b, c) { |
|
* return [a, b, c]; |
|
* }; |
|
* |
|
* var curried = _.curryRight(abc); |
|
* |
|
* curried(3)(2)(1); |
|
* // => [1, 2, 3] |
|
* |
|
* curried(2, 3)(1); |
|
* // => [1, 2, 3] |
|
* |
|
* curried(1, 2, 3); |
|
* // => [1, 2, 3] |
|
* |
|
* // Curried with placeholders. |
|
* curried(3)(1, _)(2); |
|
* // => [1, 2, 3] |
|
*/ |
|
function curryRight(func, arity, guard) { |
|
arity = guard ? undefined : arity; |
|
var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); |
|
result.placeholder = curryRight.placeholder; |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates a debounced function that delays invoking `func` until after `wait` |
|
* milliseconds have elapsed since the last time the debounced function was |
|
* invoked. The debounced function comes with a `cancel` method to cancel |
|
* delayed `func` invocations and a `flush` method to immediately invoke them. |
|
* Provide `options` to indicate whether `func` should be invoked on the |
|
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked |
|
* with the last arguments provided to the debounced function. Subsequent |
|
* calls to the debounced function return the result of the last `func` |
|
* invocation. |
|
* |
|
* **Note:** If `leading` and `trailing` options are `true`, `func` is |
|
* invoked on the trailing edge of the timeout only if the debounced function |
|
* is invoked more than once during the `wait` timeout. |
|
* |
|
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred |
|
* until to the next tick, similar to `setTimeout` with a timeout of `0`. |
|
* |
|
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) |
|
* for details over the differences between `_.debounce` and `_.throttle`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to debounce. |
|
* @param {number} [wait=0] The number of milliseconds to delay. |
|
* @param {Object} [options={}] The options object. |
|
* @param {boolean} [options.leading=false] |
|
* Specify invoking on the leading edge of the timeout. |
|
* @param {number} [options.maxWait] |
|
* The maximum time `func` is allowed to be delayed before it's invoked. |
|
* @param {boolean} [options.trailing=true] |
|
* Specify invoking on the trailing edge of the timeout. |
|
* @returns {Function} Returns the new debounced function. |
|
* @example |
|
* |
|
* // Avoid costly calculations while the window size is in flux. |
|
* jQuery(window).on('resize', _.debounce(calculateLayout, 150)); |
|
* |
|
* // Invoke `sendMail` when clicked, debouncing subsequent calls. |
|
* jQuery(element).on('click', _.debounce(sendMail, 300, { |
|
* 'leading': true, |
|
* 'trailing': false |
|
* })); |
|
* |
|
* // Ensure `batchLog` is invoked once after 1 second of debounced calls. |
|
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); |
|
* var source = new EventSource('/stream'); |
|
* jQuery(source).on('message', debounced); |
|
* |
|
* // Cancel the trailing debounced invocation. |
|
* jQuery(window).on('popstate', debounced.cancel); |
|
*/ |
|
function debounce(func, wait, options) { |
|
var lastArgs, |
|
lastThis, |
|
maxWait, |
|
result, |
|
timerId, |
|
lastCallTime, |
|
lastInvokeTime = 0, |
|
leading = false, |
|
maxing = false, |
|
trailing = true; |
|
|
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
wait = toNumber(wait) || 0; |
|
if (isObject(options)) { |
|
leading = !!options.leading; |
|
maxing = 'maxWait' in options; |
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; |
|
trailing = 'trailing' in options ? !!options.trailing : trailing; |
|
} |
|
|
|
function invokeFunc(time) { |
|
var args = lastArgs, |
|
thisArg = lastThis; |
|
|
|
lastArgs = lastThis = undefined; |
|
lastInvokeTime = time; |
|
result = func.apply(thisArg, args); |
|
return result; |
|
} |
|
|
|
function leadingEdge(time) { |
|
// Reset any `maxWait` timer. |
|
lastInvokeTime = time; |
|
// Start the timer for the trailing edge. |
|
timerId = setTimeout(timerExpired, wait); |
|
// Invoke the leading edge. |
|
return leading ? invokeFunc(time) : result; |
|
} |
|
|
|
function remainingWait(time) { |
|
var timeSinceLastCall = time - lastCallTime, |
|
timeSinceLastInvoke = time - lastInvokeTime, |
|
timeWaiting = wait - timeSinceLastCall; |
|
|
|
return maxing |
|
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) |
|
: timeWaiting; |
|
} |
|
|
|
function shouldInvoke(time) { |
|
var timeSinceLastCall = time - lastCallTime, |
|
timeSinceLastInvoke = time - lastInvokeTime; |
|
|
|
// Either this is the first call, activity has stopped and we're at the |
|
// trailing edge, the system time has gone backwards and we're treating |
|
// it as the trailing edge, or we've hit the `maxWait` limit. |
|
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || |
|
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); |
|
} |
|
|
|
function timerExpired() { |
|
var time = now(); |
|
if (shouldInvoke(time)) { |
|
return trailingEdge(time); |
|
} |
|
// Restart the timer. |
|
timerId = setTimeout(timerExpired, remainingWait(time)); |
|
} |
|
|
|
function trailingEdge(time) { |
|
timerId = undefined; |
|
|
|
// Only invoke if we have `lastArgs` which means `func` has been |
|
// debounced at least once. |
|
if (trailing && lastArgs) { |
|
return invokeFunc(time); |
|
} |
|
lastArgs = lastThis = undefined; |
|
return result; |
|
} |
|
|
|
function cancel() { |
|
if (timerId !== undefined) { |
|
clearTimeout(timerId); |
|
} |
|
lastInvokeTime = 0; |
|
lastArgs = lastCallTime = lastThis = timerId = undefined; |
|
} |
|
|
|
function flush() { |
|
return timerId === undefined ? result : trailingEdge(now()); |
|
} |
|
|
|
function debounced() { |
|
var time = now(), |
|
isInvoking = shouldInvoke(time); |
|
|
|
lastArgs = arguments; |
|
lastThis = this; |
|
lastCallTime = time; |
|
|
|
if (isInvoking) { |
|
if (timerId === undefined) { |
|
return leadingEdge(lastCallTime); |
|
} |
|
if (maxing) { |
|
// Handle invocations in a tight loop. |
|
clearTimeout(timerId); |
|
timerId = setTimeout(timerExpired, wait); |
|
return invokeFunc(lastCallTime); |
|
} |
|
} |
|
if (timerId === undefined) { |
|
timerId = setTimeout(timerExpired, wait); |
|
} |
|
return result; |
|
} |
|
debounced.cancel = cancel; |
|
debounced.flush = flush; |
|
return debounced; |
|
} |
|
|
|
/** |
|
* Defers invoking the `func` until the current call stack has cleared. Any |
|
* additional arguments are provided to `func` when it's invoked. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to defer. |
|
* @param {...*} [args] The arguments to invoke `func` with. |
|
* @returns {number} Returns the timer id. |
|
* @example |
|
* |
|
* _.defer(function(text) { |
|
* console.log(text); |
|
* }, 'deferred'); |
|
* // => Logs 'deferred' after one millisecond. |
|
*/ |
|
var defer = baseRest(function(func, args) { |
|
return baseDelay(func, 1, args); |
|
}); |
|
|
|
/** |
|
* Invokes `func` after `wait` milliseconds. Any additional arguments are |
|
* provided to `func` when it's invoked. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to delay. |
|
* @param {number} wait The number of milliseconds to delay invocation. |
|
* @param {...*} [args] The arguments to invoke `func` with. |
|
* @returns {number} Returns the timer id. |
|
* @example |
|
* |
|
* _.delay(function(text) { |
|
* console.log(text); |
|
* }, 1000, 'later'); |
|
* // => Logs 'later' after one second. |
|
*/ |
|
var delay = baseRest(function(func, wait, args) { |
|
return baseDelay(func, toNumber(wait) || 0, args); |
|
}); |
|
|
|
/** |
|
* Creates a function that invokes `func` with arguments reversed. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Function |
|
* @param {Function} func The function to flip arguments for. |
|
* @returns {Function} Returns the new flipped function. |
|
* @example |
|
* |
|
* var flipped = _.flip(function() { |
|
* return _.toArray(arguments); |
|
* }); |
|
* |
|
* flipped('a', 'b', 'c', 'd'); |
|
* // => ['d', 'c', 'b', 'a'] |
|
*/ |
|
function flip(func) { |
|
return createWrap(func, WRAP_FLIP_FLAG); |
|
} |
|
|
|
/** |
|
* Creates a function that memoizes the result of `func`. If `resolver` is |
|
* provided, it determines the cache key for storing the result based on the |
|
* arguments provided to the memoized function. By default, the first argument |
|
* provided to the memoized function is used as the map cache key. The `func` |
|
* is invoked with the `this` binding of the memoized function. |
|
* |
|
* **Note:** The cache is exposed as the `cache` property on the memoized |
|
* function. Its creation may be customized by replacing the `_.memoize.Cache` |
|
* constructor with one whose instances implement the |
|
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) |
|
* method interface of `clear`, `delete`, `get`, `has`, and `set`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to have its output memoized. |
|
* @param {Function} [resolver] The function to resolve the cache key. |
|
* @returns {Function} Returns the new memoized function. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': 2 }; |
|
* var other = { 'c': 3, 'd': 4 }; |
|
* |
|
* var values = _.memoize(_.values); |
|
* values(object); |
|
* // => [1, 2] |
|
* |
|
* values(other); |
|
* // => [3, 4] |
|
* |
|
* object.a = 2; |
|
* values(object); |
|
* // => [1, 2] |
|
* |
|
* // Modify the result cache. |
|
* values.cache.set(object, ['a', 'b']); |
|
* values(object); |
|
* // => ['a', 'b'] |
|
* |
|
* // Replace `_.memoize.Cache`. |
|
* _.memoize.Cache = WeakMap; |
|
*/ |
|
function memoize(func, resolver) { |
|
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
var memoized = function() { |
|
var args = arguments, |
|
key = resolver ? resolver.apply(this, args) : args[0], |
|
cache = memoized.cache; |
|
|
|
if (cache.has(key)) { |
|
return cache.get(key); |
|
} |
|
var result = func.apply(this, args); |
|
memoized.cache = cache.set(key, result) || cache; |
|
return result; |
|
}; |
|
memoized.cache = new (memoize.Cache || MapCache); |
|
return memoized; |
|
} |
|
|
|
// Expose `MapCache`. |
|
memoize.Cache = MapCache; |
|
|
|
/** |
|
* Creates a function that negates the result of the predicate `func`. The |
|
* `func` predicate is invoked with the `this` binding and arguments of the |
|
* created function. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Function |
|
* @param {Function} predicate The predicate to negate. |
|
* @returns {Function} Returns the new negated function. |
|
* @example |
|
* |
|
* function isEven(n) { |
|
* return n % 2 == 0; |
|
* } |
|
* |
|
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); |
|
* // => [1, 3, 5] |
|
*/ |
|
function negate(predicate) { |
|
if (typeof predicate != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
return function() { |
|
var args = arguments; |
|
switch (args.length) { |
|
case 0: return !predicate.call(this); |
|
case 1: return !predicate.call(this, args[0]); |
|
case 2: return !predicate.call(this, args[0], args[1]); |
|
case 3: return !predicate.call(this, args[0], args[1], args[2]); |
|
} |
|
return !predicate.apply(this, args); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates a function that is restricted to invoking `func` once. Repeat calls |
|
* to the function return the value of the first invocation. The `func` is |
|
* invoked with the `this` binding and arguments of the created function. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to restrict. |
|
* @returns {Function} Returns the new restricted function. |
|
* @example |
|
* |
|
* var initialize = _.once(createApplication); |
|
* initialize(); |
|
* initialize(); |
|
* // => `createApplication` is invoked once |
|
*/ |
|
function once(func) { |
|
return before(2, func); |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `func` with its arguments transformed. |
|
* |
|
* @static |
|
* @since 4.0.0 |
|
* @memberOf _ |
|
* @category Function |
|
* @param {Function} func The function to wrap. |
|
* @param {...(Function|Function[])} [transforms=[_.identity]] |
|
* The argument transforms. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* function doubled(n) { |
|
* return n * 2; |
|
* } |
|
* |
|
* function square(n) { |
|
* return n * n; |
|
* } |
|
* |
|
* var func = _.overArgs(function(x, y) { |
|
* return [x, y]; |
|
* }, [square, doubled]); |
|
* |
|
* func(9, 3); |
|
* // => [81, 6] |
|
* |
|
* func(10, 5); |
|
* // => [100, 10] |
|
*/ |
|
var overArgs = castRest(function(func, transforms) { |
|
transforms = (transforms.length == 1 && isArray(transforms[0])) |
|
? arrayMap(transforms[0], baseUnary(getIteratee())) |
|
: arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); |
|
|
|
var funcsLength = transforms.length; |
|
return baseRest(function(args) { |
|
var index = -1, |
|
length = nativeMin(args.length, funcsLength); |
|
|
|
while (++index < length) { |
|
args[index] = transforms[index].call(this, args[index]); |
|
} |
|
return apply(func, this, args); |
|
}); |
|
}); |
|
|
|
/** |
|
* Creates a function that invokes `func` with `partials` prepended to the |
|
* arguments it receives. This method is like `_.bind` except it does **not** |
|
* alter the `this` binding. |
|
* |
|
* The `_.partial.placeholder` value, which defaults to `_` in monolithic |
|
* builds, may be used as a placeholder for partially applied arguments. |
|
* |
|
* **Note:** This method doesn't set the "length" property of partially |
|
* applied functions. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.2.0 |
|
* @category Function |
|
* @param {Function} func The function to partially apply arguments to. |
|
* @param {...*} [partials] The arguments to be partially applied. |
|
* @returns {Function} Returns the new partially applied function. |
|
* @example |
|
* |
|
* function greet(greeting, name) { |
|
* return greeting + ' ' + name; |
|
* } |
|
* |
|
* var sayHelloTo = _.partial(greet, 'hello'); |
|
* sayHelloTo('fred'); |
|
* // => 'hello fred' |
|
* |
|
* // Partially applied with placeholders. |
|
* var greetFred = _.partial(greet, _, 'fred'); |
|
* greetFred('hi'); |
|
* // => 'hi fred' |
|
*/ |
|
var partial = baseRest(function(func, partials) { |
|
var holders = replaceHolders(partials, getHolder(partial)); |
|
return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); |
|
}); |
|
|
|
/** |
|
* This method is like `_.partial` except that partially applied arguments |
|
* are appended to the arguments it receives. |
|
* |
|
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic |
|
* builds, may be used as a placeholder for partially applied arguments. |
|
* |
|
* **Note:** This method doesn't set the "length" property of partially |
|
* applied functions. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.0.0 |
|
* @category Function |
|
* @param {Function} func The function to partially apply arguments to. |
|
* @param {...*} [partials] The arguments to be partially applied. |
|
* @returns {Function} Returns the new partially applied function. |
|
* @example |
|
* |
|
* function greet(greeting, name) { |
|
* return greeting + ' ' + name; |
|
* } |
|
* |
|
* var greetFred = _.partialRight(greet, 'fred'); |
|
* greetFred('hi'); |
|
* // => 'hi fred' |
|
* |
|
* // Partially applied with placeholders. |
|
* var sayHelloTo = _.partialRight(greet, 'hello', _); |
|
* sayHelloTo('fred'); |
|
* // => 'hello fred' |
|
*/ |
|
var partialRight = baseRest(function(func, partials) { |
|
var holders = replaceHolders(partials, getHolder(partialRight)); |
|
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); |
|
}); |
|
|
|
/** |
|
* Creates a function that invokes `func` with arguments arranged according |
|
* to the specified `indexes` where the argument value at the first index is |
|
* provided as the first argument, the argument value at the second index is |
|
* provided as the second argument, and so on. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Function |
|
* @param {Function} func The function to rearrange arguments for. |
|
* @param {...(number|number[])} indexes The arranged argument indexes. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* var rearged = _.rearg(function(a, b, c) { |
|
* return [a, b, c]; |
|
* }, [2, 0, 1]); |
|
* |
|
* rearged('b', 'c', 'a') |
|
* // => ['a', 'b', 'c'] |
|
*/ |
|
var rearg = flatRest(function(func, indexes) { |
|
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); |
|
}); |
|
|
|
/** |
|
* 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 _ |
|
* @since 4.0.0 |
|
* @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 = start === undefined ? start : toInteger(start); |
|
return baseRest(func, start); |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `func` with the `this` binding of the |
|
* create function and an array of arguments much like |
|
* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). |
|
* |
|
* **Note:** This method is based on the |
|
* [spread operator](https://mdn.io/spread_operator). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.2.0 |
|
* @category Function |
|
* @param {Function} func The function to spread arguments over. |
|
* @param {number} [start=0] The start position of the spread. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* var say = _.spread(function(who, what) { |
|
* return who + ' says ' + what; |
|
* }); |
|
* |
|
* say(['fred', 'hello']); |
|
* // => 'fred says hello' |
|
* |
|
* var numbers = Promise.all([ |
|
* Promise.resolve(40), |
|
* Promise.resolve(36) |
|
* ]); |
|
* |
|
* numbers.then(_.spread(function(x, y) { |
|
* return x + y; |
|
* })); |
|
* // => a Promise of 76 |
|
*/ |
|
function spread(func, start) { |
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
start = start == null ? 0 : nativeMax(toInteger(start), 0); |
|
return baseRest(function(args) { |
|
var array = args[start], |
|
otherArgs = castSlice(args, 0, start); |
|
|
|
if (array) { |
|
arrayPush(otherArgs, array); |
|
} |
|
return apply(func, this, otherArgs); |
|
}); |
|
} |
|
|
|
/** |
|
* Creates a throttled function that only invokes `func` at most once per |
|
* every `wait` milliseconds. The throttled function comes with a `cancel` |
|
* method to cancel delayed `func` invocations and a `flush` method to |
|
* immediately invoke them. Provide `options` to indicate whether `func` |
|
* should be invoked on the leading and/or trailing edge of the `wait` |
|
* timeout. The `func` is invoked with the last arguments provided to the |
|
* throttled function. Subsequent calls to the throttled function return the |
|
* result of the last `func` invocation. |
|
* |
|
* **Note:** If `leading` and `trailing` options are `true`, `func` is |
|
* invoked on the trailing edge of the timeout only if the throttled function |
|
* is invoked more than once during the `wait` timeout. |
|
* |
|
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred |
|
* until to the next tick, similar to `setTimeout` with a timeout of `0`. |
|
* |
|
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) |
|
* for details over the differences between `_.throttle` and `_.debounce`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {Function} func The function to throttle. |
|
* @param {number} [wait=0] The number of milliseconds to throttle invocations to. |
|
* @param {Object} [options={}] The options object. |
|
* @param {boolean} [options.leading=true] |
|
* Specify invoking on the leading edge of the timeout. |
|
* @param {boolean} [options.trailing=true] |
|
* Specify invoking on the trailing edge of the timeout. |
|
* @returns {Function} Returns the new throttled function. |
|
* @example |
|
* |
|
* // Avoid excessively updating the position while scrolling. |
|
* jQuery(window).on('scroll', _.throttle(updatePosition, 100)); |
|
* |
|
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. |
|
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); |
|
* jQuery(element).on('click', throttled); |
|
* |
|
* // Cancel the trailing throttled invocation. |
|
* jQuery(window).on('popstate', throttled.cancel); |
|
*/ |
|
function throttle(func, wait, options) { |
|
var leading = true, |
|
trailing = true; |
|
|
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
if (isObject(options)) { |
|
leading = 'leading' in options ? !!options.leading : leading; |
|
trailing = 'trailing' in options ? !!options.trailing : trailing; |
|
} |
|
return debounce(func, wait, { |
|
'leading': leading, |
|
'maxWait': wait, |
|
'trailing': trailing |
|
}); |
|
} |
|
|
|
/** |
|
* Creates a function that accepts up to one argument, ignoring any |
|
* additional arguments. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Function |
|
* @param {Function} func The function to cap arguments for. |
|
* @returns {Function} Returns the new capped function. |
|
* @example |
|
* |
|
* _.map(['6', '8', '10'], _.unary(parseInt)); |
|
* // => [6, 8, 10] |
|
*/ |
|
function unary(func) { |
|
return ary(func, 1); |
|
} |
|
|
|
/** |
|
* Creates a function that provides `value` to `wrapper` as its first |
|
* argument. Any additional arguments provided to the function are appended |
|
* to those provided to the `wrapper`. The wrapper is invoked with the `this` |
|
* binding of the created function. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Function |
|
* @param {*} value The value to wrap. |
|
* @param {Function} [wrapper=identity] The wrapper function. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* var p = _.wrap(_.escape, function(func, text) { |
|
* return '<p>' + func(text) + '</p>'; |
|
* }); |
|
* |
|
* p('fred, barney, & pebbles'); |
|
* // => '<p>fred, barney, & pebbles</p>' |
|
*/ |
|
function wrap(value, wrapper) { |
|
return partial(castFunction(wrapper), value); |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Casts `value` as an array if it's not one. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.4.0 |
|
* @category Lang |
|
* @param {*} value The value to inspect. |
|
* @returns {Array} Returns the cast array. |
|
* @example |
|
* |
|
* _.castArray(1); |
|
* // => [1] |
|
* |
|
* _.castArray({ 'a': 1 }); |
|
* // => [{ 'a': 1 }] |
|
* |
|
* _.castArray('abc'); |
|
* // => ['abc'] |
|
* |
|
* _.castArray(null); |
|
* // => [null] |
|
* |
|
* _.castArray(undefined); |
|
* // => [undefined] |
|
* |
|
* _.castArray(); |
|
* // => [] |
|
* |
|
* var array = [1, 2, 3]; |
|
* console.log(_.castArray(array) === array); |
|
* // => true |
|
*/ |
|
function castArray() { |
|
if (!arguments.length) { |
|
return []; |
|
} |
|
var value = arguments[0]; |
|
return isArray(value) ? value : [value]; |
|
} |
|
|
|
/** |
|
* Creates a shallow clone of `value`. |
|
* |
|
* **Note:** This method is loosely based on the |
|
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) |
|
* and supports cloning arrays, array buffers, booleans, date objects, maps, |
|
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed |
|
* arrays. The own enumerable properties of `arguments` objects are cloned |
|
* as plain objects. An empty object is returned for uncloneable values such |
|
* as error objects, functions, DOM nodes, and WeakMaps. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to clone. |
|
* @returns {*} Returns the cloned value. |
|
* @see _.cloneDeep |
|
* @example |
|
* |
|
* var objects = [{ 'a': 1 }, { 'b': 2 }]; |
|
* |
|
* var shallow = _.clone(objects); |
|
* console.log(shallow[0] === objects[0]); |
|
* // => true |
|
*/ |
|
function clone(value) { |
|
return baseClone(value, CLONE_SYMBOLS_FLAG); |
|
} |
|
|
|
/** |
|
* This method is like `_.clone` except that it accepts `customizer` which |
|
* is invoked to produce the cloned value. If `customizer` returns `undefined`, |
|
* cloning is handled by the method instead. The `customizer` is invoked with |
|
* up to four arguments; (value [, index|key, object, stack]). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to clone. |
|
* @param {Function} [customizer] The function to customize cloning. |
|
* @returns {*} Returns the cloned value. |
|
* @see _.cloneDeepWith |
|
* @example |
|
* |
|
* function customizer(value) { |
|
* if (_.isElement(value)) { |
|
* return value.cloneNode(false); |
|
* } |
|
* } |
|
* |
|
* var el = _.cloneWith(document.body, customizer); |
|
* |
|
* console.log(el === document.body); |
|
* // => false |
|
* console.log(el.nodeName); |
|
* // => 'BODY' |
|
* console.log(el.childNodes.length); |
|
* // => 0 |
|
*/ |
|
function cloneWith(value, customizer) { |
|
customizer = typeof customizer == 'function' ? customizer : undefined; |
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); |
|
} |
|
|
|
/** |
|
* This method is like `_.clone` except that it recursively clones `value`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.0.0 |
|
* @category Lang |
|
* @param {*} value The value to recursively clone. |
|
* @returns {*} Returns the deep cloned value. |
|
* @see _.clone |
|
* @example |
|
* |
|
* var objects = [{ 'a': 1 }, { 'b': 2 }]; |
|
* |
|
* var deep = _.cloneDeep(objects); |
|
* console.log(deep[0] === objects[0]); |
|
* // => false |
|
*/ |
|
function cloneDeep(value) { |
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); |
|
} |
|
|
|
/** |
|
* This method is like `_.cloneWith` except that it recursively clones `value`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to recursively clone. |
|
* @param {Function} [customizer] The function to customize cloning. |
|
* @returns {*} Returns the deep cloned value. |
|
* @see _.cloneWith |
|
* @example |
|
* |
|
* function customizer(value) { |
|
* if (_.isElement(value)) { |
|
* return value.cloneNode(true); |
|
* } |
|
* } |
|
* |
|
* var el = _.cloneDeepWith(document.body, customizer); |
|
* |
|
* console.log(el === document.body); |
|
* // => false |
|
* console.log(el.nodeName); |
|
* // => 'BODY' |
|
* console.log(el.childNodes.length); |
|
* // => 20 |
|
*/ |
|
function cloneDeepWith(value, customizer) { |
|
customizer = typeof customizer == 'function' ? customizer : undefined; |
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); |
|
} |
|
|
|
/** |
|
* Checks if `object` conforms to `source` by invoking the predicate |
|
* properties of `source` with the corresponding property values of `object`. |
|
* |
|
* **Note:** This method is equivalent to `_.conforms` when `source` is |
|
* partially applied. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.14.0 |
|
* @category Lang |
|
* @param {Object} object The object to inspect. |
|
* @param {Object} source The object of property predicates to conform to. |
|
* @returns {boolean} Returns `true` if `object` conforms, else `false`. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': 2 }; |
|
* |
|
* _.conformsTo(object, { 'b': function(n) { return n > 1; } }); |
|
* // => true |
|
* |
|
* _.conformsTo(object, { 'b': function(n) { return n > 2; } }); |
|
* // => false |
|
*/ |
|
function conformsTo(object, source) { |
|
return source == null || baseConformsTo(object, source, keys(source)); |
|
} |
|
|
|
/** |
|
* Performs a |
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) |
|
* comparison between two values to determine if they are equivalent. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @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 = { 'a': 1 }; |
|
* var other = { 'a': 1 }; |
|
* |
|
* _.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); |
|
} |
|
|
|
/** |
|
* Checks if `value` is greater than `other`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.9.0 |
|
* @category Lang |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {boolean} Returns `true` if `value` is greater than `other`, |
|
* else `false`. |
|
* @see _.lt |
|
* @example |
|
* |
|
* _.gt(3, 1); |
|
* // => true |
|
* |
|
* _.gt(3, 3); |
|
* // => false |
|
* |
|
* _.gt(1, 3); |
|
* // => false |
|
*/ |
|
var gt = createRelationalOperation(baseGt); |
|
|
|
/** |
|
* Checks if `value` is greater than or equal to `other`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.9.0 |
|
* @category Lang |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {boolean} Returns `true` if `value` is greater than or equal to |
|
* `other`, else `false`. |
|
* @see _.lte |
|
* @example |
|
* |
|
* _.gte(3, 1); |
|
* // => true |
|
* |
|
* _.gte(3, 3); |
|
* // => true |
|
* |
|
* _.gte(1, 3); |
|
* // => false |
|
*/ |
|
var gte = createRelationalOperation(function(value, other) { |
|
return value >= other; |
|
}); |
|
|
|
/** |
|
* Checks if `value` is likely an `arguments` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object, |
|
* else `false`. |
|
* @example |
|
* |
|
* _.isArguments(function() { return arguments; }()); |
|
* // => true |
|
* |
|
* _.isArguments([1, 2, 3]); |
|
* // => false |
|
*/ |
|
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { |
|
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && |
|
!propertyIsEnumerable.call(value, 'callee'); |
|
}; |
|
|
|
/** |
|
* Checks if `value` is classified as an `Array` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an array, else `false`. |
|
* @example |
|
* |
|
* _.isArray([1, 2, 3]); |
|
* // => true |
|
* |
|
* _.isArray(document.body.children); |
|
* // => false |
|
* |
|
* _.isArray('abc'); |
|
* // => false |
|
* |
|
* _.isArray(_.noop); |
|
* // => false |
|
*/ |
|
var isArray = Array.isArray; |
|
|
|
/** |
|
* Checks if `value` is classified as an `ArrayBuffer` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.3.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. |
|
* @example |
|
* |
|
* _.isArrayBuffer(new ArrayBuffer(2)); |
|
* // => true |
|
* |
|
* _.isArrayBuffer(new Array(2)); |
|
* // => false |
|
*/ |
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; |
|
|
|
/** |
|
* 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 _ |
|
* @since 4.0.0 |
|
* @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(value.length) && !isFunction(value); |
|
} |
|
|
|
/** |
|
* This method is like `_.isArrayLike` except that it also checks if `value` |
|
* is an object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @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); |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a boolean primitive or object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a boolean, else `false`. |
|
* @example |
|
* |
|
* _.isBoolean(false); |
|
* // => true |
|
* |
|
* _.isBoolean(null); |
|
* // => false |
|
*/ |
|
function isBoolean(value) { |
|
return value === true || value === false || |
|
(isObjectLike(value) && baseGetTag(value) == boolTag); |
|
} |
|
|
|
/** |
|
* Checks if `value` is a buffer. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.3.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`. |
|
* @example |
|
* |
|
* _.isBuffer(new Buffer(2)); |
|
* // => true |
|
* |
|
* _.isBuffer(new Uint8Array(2)); |
|
* // => false |
|
*/ |
|
var isBuffer = nativeIsBuffer || stubFalse; |
|
|
|
/** |
|
* Checks if `value` is classified as a `Date` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a date object, else `false`. |
|
* @example |
|
* |
|
* _.isDate(new Date); |
|
* // => true |
|
* |
|
* _.isDate('Mon April 23 2012'); |
|
* // => false |
|
*/ |
|
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; |
|
|
|
/** |
|
* Checks if `value` is likely a DOM element. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. |
|
* @example |
|
* |
|
* _.isElement(document.body); |
|
* // => true |
|
* |
|
* _.isElement('<body>'); |
|
* // => false |
|
*/ |
|
function isElement(value) { |
|
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); |
|
} |
|
|
|
/** |
|
* Checks if `value` is an empty object, collection, map, or set. |
|
* |
|
* Objects are considered empty if they have no own enumerable string keyed |
|
* properties. |
|
* |
|
* Array-like values such as `arguments` objects, arrays, buffers, strings, or |
|
* jQuery-like collections are considered empty if they have a `length` of `0`. |
|
* Similarly, maps and sets are considered empty if they have a `size` of `0`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is empty, else `false`. |
|
* @example |
|
* |
|
* _.isEmpty(null); |
|
* // => true |
|
* |
|
* _.isEmpty(true); |
|
* // => true |
|
* |
|
* _.isEmpty(1); |
|
* // => true |
|
* |
|
* _.isEmpty([1, 2, 3]); |
|
* // => false |
|
* |
|
* _.isEmpty({ 'a': 1 }); |
|
* // => false |
|
*/ |
|
function isEmpty(value) { |
|
if (value == null) { |
|
return true; |
|
} |
|
if (isArrayLike(value) && |
|
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || |
|
isBuffer(value) || isTypedArray(value) || isArguments(value))) { |
|
return !value.length; |
|
} |
|
var tag = getTag(value); |
|
if (tag == mapTag || tag == setTag) { |
|
return !value.size; |
|
} |
|
if (isPrototype(value)) { |
|
return !baseKeys(value).length; |
|
} |
|
for (var key in value) { |
|
if (hasOwnProperty.call(value, key)) { |
|
return false; |
|
} |
|
} |
|
return true; |
|
} |
|
|
|
/** |
|
* Performs a deep comparison between two values to determine if they are |
|
* equivalent. |
|
* |
|
* **Note:** This method supports comparing arrays, array buffers, booleans, |
|
* date objects, error objects, maps, numbers, `Object` objects, regexes, |
|
* sets, strings, symbols, and typed arrays. `Object` objects are compared |
|
* by their own, not inherited, enumerable properties. Functions and DOM |
|
* nodes are compared by strict equality, i.e. `===`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @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 = { 'a': 1 }; |
|
* var other = { 'a': 1 }; |
|
* |
|
* _.isEqual(object, other); |
|
* // => true |
|
* |
|
* object === other; |
|
* // => false |
|
*/ |
|
function isEqual(value, other) { |
|
return baseIsEqual(value, other); |
|
} |
|
|
|
/** |
|
* This method is like `_.isEqual` except that it accepts `customizer` which |
|
* is invoked to compare values. If `customizer` returns `undefined`, comparisons |
|
* are handled by the method instead. The `customizer` is invoked with up to |
|
* six arguments: (objValue, othValue [, index|key, object, other, stack]). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @param {Function} [customizer] The function to customize comparisons. |
|
* @returns {boolean} Returns `true` if the values are equivalent, else `false`. |
|
* @example |
|
* |
|
* function isGreeting(value) { |
|
* return /^h(?:i|ello)$/.test(value); |
|
* } |
|
* |
|
* function customizer(objValue, othValue) { |
|
* if (isGreeting(objValue) && isGreeting(othValue)) { |
|
* return true; |
|
* } |
|
* } |
|
* |
|
* var array = ['hello', 'goodbye']; |
|
* var other = ['hi', 'goodbye']; |
|
* |
|
* _.isEqualWith(array, other, customizer); |
|
* // => true |
|
*/ |
|
function isEqualWith(value, other, customizer) { |
|
customizer = typeof customizer == 'function' ? customizer : undefined; |
|
var result = customizer ? customizer(value, other) : undefined; |
|
return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; |
|
} |
|
|
|
/** |
|
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, |
|
* `SyntaxError`, `TypeError`, or `URIError` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an error object, else `false`. |
|
* @example |
|
* |
|
* _.isError(new Error); |
|
* // => true |
|
* |
|
* _.isError(Error); |
|
* // => false |
|
*/ |
|
function isError(value) { |
|
if (!isObjectLike(value)) { |
|
return false; |
|
} |
|
var tag = baseGetTag(value); |
|
return tag == errorTag || tag == domExcTag || |
|
(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); |
|
} |
|
|
|
/** |
|
* Checks if `value` is a finite primitive number. |
|
* |
|
* **Note:** This method is based on |
|
* [`Number.isFinite`](https://mdn.io/Number/isFinite). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`. |
|
* @example |
|
* |
|
* _.isFinite(3); |
|
* // => true |
|
* |
|
* _.isFinite(Number.MIN_VALUE); |
|
* // => true |
|
* |
|
* _.isFinite(Infinity); |
|
* // => false |
|
* |
|
* _.isFinite('3'); |
|
* // => false |
|
*/ |
|
function isFinite(value) { |
|
return typeof value == 'number' && nativeIsFinite(value); |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `Function` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a function, else `false`. |
|
* @example |
|
* |
|
* _.isFunction(_); |
|
* // => true |
|
* |
|
* _.isFunction(/abc/); |
|
* // => false |
|
*/ |
|
function isFunction(value) { |
|
if (!isObject(value)) { |
|
return false; |
|
} |
|
// The use of `Object#toString` avoids issues with the `typeof` operator |
|
// in Safari 9 which returns 'object' for typed arrays and other constructors. |
|
var tag = baseGetTag(value); |
|
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; |
|
} |
|
|
|
/** |
|
* Checks if `value` is an integer. |
|
* |
|
* **Note:** This method is based on |
|
* [`Number.isInteger`](https://mdn.io/Number/isInteger). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is an integer, else `false`. |
|
* @example |
|
* |
|
* _.isInteger(3); |
|
* // => true |
|
* |
|
* _.isInteger(Number.MIN_VALUE); |
|
* // => false |
|
* |
|
* _.isInteger(Infinity); |
|
* // => false |
|
* |
|
* _.isInteger('3'); |
|
* // => false |
|
*/ |
|
function isInteger(value) { |
|
return typeof value == 'number' && value == toInteger(value); |
|
} |
|
|
|
/** |
|
* Checks if `value` is a valid array-like length. |
|
* |
|
* **Note:** This method is loosely based on |
|
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @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; |
|
} |
|
|
|
/** |
|
* Checks if `value` is the |
|
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) |
|
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @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 != null && (type == 'object' || type == 'function'); |
|
} |
|
|
|
/** |
|
* 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 _ |
|
* @since 4.0.0 |
|
* @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 != null && typeof value == 'object'; |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `Map` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.3.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a map, else `false`. |
|
* @example |
|
* |
|
* _.isMap(new Map); |
|
* // => true |
|
* |
|
* _.isMap(new WeakMap); |
|
* // => false |
|
*/ |
|
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; |
|
|
|
/** |
|
* Performs a partial deep comparison between `object` and `source` to |
|
* determine if `object` contains equivalent property values. |
|
* |
|
* **Note:** This method is equivalent to `_.matches` when `source` is |
|
* partially applied. |
|
* |
|
* Partial comparisons will match empty array and empty object `source` |
|
* values against any array or object value, respectively. See `_.isEqual` |
|
* for a list of supported value comparisons. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Lang |
|
* @param {Object} object The object to inspect. |
|
* @param {Object} source The object of property values to match. |
|
* @returns {boolean} Returns `true` if `object` is a match, else `false`. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': 2 }; |
|
* |
|
* _.isMatch(object, { 'b': 2 }); |
|
* // => true |
|
* |
|
* _.isMatch(object, { 'b': 1 }); |
|
* // => false |
|
*/ |
|
function isMatch(object, source) { |
|
return object === source || baseIsMatch(object, source, getMatchData(source)); |
|
} |
|
|
|
/** |
|
* This method is like `_.isMatch` except that it accepts `customizer` which |
|
* is invoked to compare values. If `customizer` returns `undefined`, comparisons |
|
* are handled by the method instead. The `customizer` is invoked with five |
|
* arguments: (objValue, srcValue, index|key, object, source). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {Object} object The object to inspect. |
|
* @param {Object} source The object of property values to match. |
|
* @param {Function} [customizer] The function to customize comparisons. |
|
* @returns {boolean} Returns `true` if `object` is a match, else `false`. |
|
* @example |
|
* |
|
* function isGreeting(value) { |
|
* return /^h(?:i|ello)$/.test(value); |
|
* } |
|
* |
|
* function customizer(objValue, srcValue) { |
|
* if (isGreeting(objValue) && isGreeting(srcValue)) { |
|
* return true; |
|
* } |
|
* } |
|
* |
|
* var object = { 'greeting': 'hello' }; |
|
* var source = { 'greeting': 'hi' }; |
|
* |
|
* _.isMatchWith(object, source, customizer); |
|
* // => true |
|
*/ |
|
function isMatchWith(object, source, customizer) { |
|
customizer = typeof customizer == 'function' ? customizer : undefined; |
|
return baseIsMatch(object, source, getMatchData(source), customizer); |
|
} |
|
|
|
/** |
|
* Checks if `value` is `NaN`. |
|
* |
|
* **Note:** This method is based on |
|
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as |
|
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for |
|
* `undefined` and other non-number values. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. |
|
* @example |
|
* |
|
* _.isNaN(NaN); |
|
* // => true |
|
* |
|
* _.isNaN(new Number(NaN)); |
|
* // => true |
|
* |
|
* isNaN(undefined); |
|
* // => true |
|
* |
|
* _.isNaN(undefined); |
|
* // => false |
|
*/ |
|
function isNaN(value) { |
|
// An `NaN` primitive is the only value that is not equal to itself. |
|
// Perform the `toStringTag` check first to avoid errors with some |
|
// ActiveX objects in IE. |
|
return isNumber(value) && value != +value; |
|
} |
|
|
|
/** |
|
* Checks if `value` is a pristine native function. |
|
* |
|
* **Note:** This method can't reliably detect native functions in the presence |
|
* of the core-js package because core-js circumvents this kind of detection. |
|
* Despite multiple requests, the core-js maintainer has made it clear: any |
|
* attempt to fix the detection will be obstructed. As a result, we're left |
|
* with little choice but to throw an error. Unfortunately, this also affects |
|
* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), |
|
* which rely on core-js. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a native function, |
|
* else `false`. |
|
* @example |
|
* |
|
* _.isNative(Array.prototype.push); |
|
* // => true |
|
* |
|
* _.isNative(_); |
|
* // => false |
|
*/ |
|
function isNative(value) { |
|
if (isMaskable(value)) { |
|
throw new Error(CORE_ERROR_TEXT); |
|
} |
|
return baseIsNative(value); |
|
} |
|
|
|
/** |
|
* Checks if `value` is `null`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is `null`, else `false`. |
|
* @example |
|
* |
|
* _.isNull(null); |
|
* // => true |
|
* |
|
* _.isNull(void 0); |
|
* // => false |
|
*/ |
|
function isNull(value) { |
|
return value === null; |
|
} |
|
|
|
/** |
|
* Checks if `value` is `null` or `undefined`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is nullish, else `false`. |
|
* @example |
|
* |
|
* _.isNil(null); |
|
* // => true |
|
* |
|
* _.isNil(void 0); |
|
* // => true |
|
* |
|
* _.isNil(NaN); |
|
* // => false |
|
*/ |
|
function isNil(value) { |
|
return value == null; |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `Number` primitive or object. |
|
* |
|
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are |
|
* classified as numbers, use the `_.isFinite` method. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a number, else `false`. |
|
* @example |
|
* |
|
* _.isNumber(3); |
|
* // => true |
|
* |
|
* _.isNumber(Number.MIN_VALUE); |
|
* // => true |
|
* |
|
* _.isNumber(Infinity); |
|
* // => true |
|
* |
|
* _.isNumber('3'); |
|
* // => false |
|
*/ |
|
function isNumber(value) { |
|
return typeof value == 'number' || |
|
(isObjectLike(value) && baseGetTag(value) == numberTag); |
|
} |
|
|
|
/** |
|
* Checks if `value` is a plain object, that is, an object created by the |
|
* `Object` constructor or one with a `[[Prototype]]` of `null`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.8.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`. |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* } |
|
* |
|
* _.isPlainObject(new Foo); |
|
* // => false |
|
* |
|
* _.isPlainObject([1, 2, 3]); |
|
* // => false |
|
* |
|
* _.isPlainObject({ 'x': 0, 'y': 0 }); |
|
* // => true |
|
* |
|
* _.isPlainObject(Object.create(null)); |
|
* // => true |
|
*/ |
|
function isPlainObject(value) { |
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) { |
|
return false; |
|
} |
|
var proto = getPrototype(value); |
|
if (proto === null) { |
|
return true; |
|
} |
|
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; |
|
return typeof Ctor == 'function' && Ctor instanceof Ctor && |
|
funcToString.call(Ctor) == objectCtorString; |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `RegExp` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.1.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a regexp, else `false`. |
|
* @example |
|
* |
|
* _.isRegExp(/abc/); |
|
* // => true |
|
* |
|
* _.isRegExp('/abc/'); |
|
* // => false |
|
*/ |
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; |
|
|
|
/** |
|
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 |
|
* double precision number which isn't the result of a rounded unsafe integer. |
|
* |
|
* **Note:** This method is based on |
|
* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. |
|
* @example |
|
* |
|
* _.isSafeInteger(3); |
|
* // => true |
|
* |
|
* _.isSafeInteger(Number.MIN_VALUE); |
|
* // => false |
|
* |
|
* _.isSafeInteger(Infinity); |
|
* // => false |
|
* |
|
* _.isSafeInteger('3'); |
|
* // => false |
|
*/ |
|
function isSafeInteger(value) { |
|
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `Set` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.3.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a set, else `false`. |
|
* @example |
|
* |
|
* _.isSet(new Set); |
|
* // => true |
|
* |
|
* _.isSet(new WeakSet); |
|
* // => false |
|
*/ |
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; |
|
|
|
/** |
|
* Checks if `value` is classified as a `String` primitive or object. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a string, else `false`. |
|
* @example |
|
* |
|
* _.isString('abc'); |
|
* // => true |
|
* |
|
* _.isString(1); |
|
* // => false |
|
*/ |
|
function isString(value) { |
|
return typeof value == 'string' || |
|
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `Symbol` primitive or object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`. |
|
* @example |
|
* |
|
* _.isSymbol(Symbol.iterator); |
|
* // => true |
|
* |
|
* _.isSymbol('abc'); |
|
* // => false |
|
*/ |
|
function isSymbol(value) { |
|
return typeof value == 'symbol' || |
|
(isObjectLike(value) && baseGetTag(value) == symbolTag); |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a typed array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`. |
|
* @example |
|
* |
|
* _.isTypedArray(new Uint8Array); |
|
* // => true |
|
* |
|
* _.isTypedArray([]); |
|
* // => false |
|
*/ |
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; |
|
|
|
/** |
|
* Checks if `value` is `undefined`. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. |
|
* @example |
|
* |
|
* _.isUndefined(void 0); |
|
* // => true |
|
* |
|
* _.isUndefined(null); |
|
* // => false |
|
*/ |
|
function isUndefined(value) { |
|
return value === undefined; |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `WeakMap` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.3.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a weak map, else `false`. |
|
* @example |
|
* |
|
* _.isWeakMap(new WeakMap); |
|
* // => true |
|
* |
|
* _.isWeakMap(new Map); |
|
* // => false |
|
*/ |
|
function isWeakMap(value) { |
|
return isObjectLike(value) && getTag(value) == weakMapTag; |
|
} |
|
|
|
/** |
|
* Checks if `value` is classified as a `WeakSet` object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.3.0 |
|
* @category Lang |
|
* @param {*} value The value to check. |
|
* @returns {boolean} Returns `true` if `value` is a weak set, else `false`. |
|
* @example |
|
* |
|
* _.isWeakSet(new WeakSet); |
|
* // => true |
|
* |
|
* _.isWeakSet(new Set); |
|
* // => false |
|
*/ |
|
function isWeakSet(value) { |
|
return isObjectLike(value) && baseGetTag(value) == weakSetTag; |
|
} |
|
|
|
/** |
|
* Checks if `value` is less than `other`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.9.0 |
|
* @category Lang |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {boolean} Returns `true` if `value` is less than `other`, |
|
* else `false`. |
|
* @see _.gt |
|
* @example |
|
* |
|
* _.lt(1, 3); |
|
* // => true |
|
* |
|
* _.lt(3, 3); |
|
* // => false |
|
* |
|
* _.lt(3, 1); |
|
* // => false |
|
*/ |
|
var lt = createRelationalOperation(baseLt); |
|
|
|
/** |
|
* Checks if `value` is less than or equal to `other`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.9.0 |
|
* @category Lang |
|
* @param {*} value The value to compare. |
|
* @param {*} other The other value to compare. |
|
* @returns {boolean} Returns `true` if `value` is less than or equal to |
|
* `other`, else `false`. |
|
* @see _.gte |
|
* @example |
|
* |
|
* _.lte(1, 3); |
|
* // => true |
|
* |
|
* _.lte(3, 3); |
|
* // => true |
|
* |
|
* _.lte(3, 1); |
|
* // => false |
|
*/ |
|
var lte = createRelationalOperation(function(value, other) { |
|
return value <= other; |
|
}); |
|
|
|
/** |
|
* Converts `value` to an array. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {Array} Returns the converted array. |
|
* @example |
|
* |
|
* _.toArray({ 'a': 1, 'b': 2 }); |
|
* // => [1, 2] |
|
* |
|
* _.toArray('abc'); |
|
* // => ['a', 'b', 'c'] |
|
* |
|
* _.toArray(1); |
|
* // => [] |
|
* |
|
* _.toArray(null); |
|
* // => [] |
|
*/ |
|
function toArray(value) { |
|
if (!value) { |
|
return []; |
|
} |
|
if (isArrayLike(value)) { |
|
return isString(value) ? stringToArray(value) : copyArray(value); |
|
} |
|
if (symIterator && value[symIterator]) { |
|
return iteratorToArray(value[symIterator]()); |
|
} |
|
var tag = getTag(value), |
|
func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); |
|
|
|
return func(value); |
|
} |
|
|
|
/** |
|
* Converts `value` to a finite number. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.12.0 |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {number} Returns the converted number. |
|
* @example |
|
* |
|
* _.toFinite(3.2); |
|
* // => 3.2 |
|
* |
|
* _.toFinite(Number.MIN_VALUE); |
|
* // => 5e-324 |
|
* |
|
* _.toFinite(Infinity); |
|
* // => 1.7976931348623157e+308 |
|
* |
|
* _.toFinite('3.2'); |
|
* // => 3.2 |
|
*/ |
|
function toFinite(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; |
|
} |
|
return value === value ? value : 0; |
|
} |
|
|
|
/** |
|
* Converts `value` to an integer. |
|
* |
|
* **Note:** This method is loosely based on |
|
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {number} Returns the converted integer. |
|
* @example |
|
* |
|
* _.toInteger(3.2); |
|
* // => 3 |
|
* |
|
* _.toInteger(Number.MIN_VALUE); |
|
* // => 0 |
|
* |
|
* _.toInteger(Infinity); |
|
* // => 1.7976931348623157e+308 |
|
* |
|
* _.toInteger('3.2'); |
|
* // => 3 |
|
*/ |
|
function toInteger(value) { |
|
var result = toFinite(value), |
|
remainder = result % 1; |
|
|
|
return result === result ? (remainder ? result - remainder : result) : 0; |
|
} |
|
|
|
/** |
|
* Converts `value` to an integer suitable for use as the length of an |
|
* array-like object. |
|
* |
|
* **Note:** This method is based on |
|
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {number} Returns the converted integer. |
|
* @example |
|
* |
|
* _.toLength(3.2); |
|
* // => 3 |
|
* |
|
* _.toLength(Number.MIN_VALUE); |
|
* // => 0 |
|
* |
|
* _.toLength(Infinity); |
|
* // => 4294967295 |
|
* |
|
* _.toLength('3.2'); |
|
* // => 3 |
|
*/ |
|
function toLength(value) { |
|
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; |
|
} |
|
|
|
/** |
|
* Converts `value` to a number. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to process. |
|
* @returns {number} Returns the number. |
|
* @example |
|
* |
|
* _.toNumber(3.2); |
|
* // => 3.2 |
|
* |
|
* _.toNumber(Number.MIN_VALUE); |
|
* // => 5e-324 |
|
* |
|
* _.toNumber(Infinity); |
|
* // => Infinity |
|
* |
|
* _.toNumber('3.2'); |
|
* // => 3.2 |
|
*/ |
|
function toNumber(value) { |
|
if (typeof value == 'number') { |
|
return value; |
|
} |
|
if (isSymbol(value)) { |
|
return NAN; |
|
} |
|
if (isObject(value)) { |
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value; |
|
value = isObject(other) ? (other + '') : other; |
|
} |
|
if (typeof value != 'string') { |
|
return value === 0 ? value : +value; |
|
} |
|
value = baseTrim(value); |
|
var isBinary = reIsBinary.test(value); |
|
return (isBinary || reIsOctal.test(value)) |
|
? freeParseInt(value.slice(2), isBinary ? 2 : 8) |
|
: (reIsBadHex.test(value) ? NAN : +value); |
|
} |
|
|
|
/** |
|
* Converts `value` to a plain object flattening inherited enumerable string |
|
* keyed properties of `value` to own properties of the plain object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {Object} Returns the converted plain object. |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.assign({ 'a': 1 }, new Foo); |
|
* // => { 'a': 1, 'b': 2 } |
|
* |
|
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); |
|
* // => { 'a': 1, 'b': 2, 'c': 3 } |
|
*/ |
|
function toPlainObject(value) { |
|
return copyObject(value, keysIn(value)); |
|
} |
|
|
|
/** |
|
* Converts `value` to a safe integer. A safe integer can be compared and |
|
* represented correctly. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {number} Returns the converted integer. |
|
* @example |
|
* |
|
* _.toSafeInteger(3.2); |
|
* // => 3 |
|
* |
|
* _.toSafeInteger(Number.MIN_VALUE); |
|
* // => 0 |
|
* |
|
* _.toSafeInteger(Infinity); |
|
* // => 9007199254740991 |
|
* |
|
* _.toSafeInteger('3.2'); |
|
* // => 3 |
|
*/ |
|
function toSafeInteger(value) { |
|
return value |
|
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) |
|
: (value === 0 ? value : 0); |
|
} |
|
|
|
/** |
|
* Converts `value` to a string. An empty string is returned for `null` |
|
* and `undefined` values. The sign of `-0` is preserved. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Lang |
|
* @param {*} value The value to convert. |
|
* @returns {string} Returns the converted string. |
|
* @example |
|
* |
|
* _.toString(null); |
|
* // => '' |
|
* |
|
* _.toString(-0); |
|
* // => '-0' |
|
* |
|
* _.toString([1, 2, 3]); |
|
* // => '1,2,3' |
|
*/ |
|
function toString(value) { |
|
return value == null ? '' : baseToString(value); |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Assigns own enumerable string keyed properties of source objects to the |
|
* destination object. Source objects are applied from left to right. |
|
* Subsequent sources overwrite property assignments of previous sources. |
|
* |
|
* **Note:** This method mutates `object` and is loosely based on |
|
* [`Object.assign`](https://mdn.io/Object/assign). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.10.0 |
|
* @category Object |
|
* @param {Object} object The destination object. |
|
* @param {...Object} [sources] The source objects. |
|
* @returns {Object} Returns `object`. |
|
* @see _.assignIn |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* } |
|
* |
|
* function Bar() { |
|
* this.c = 3; |
|
* } |
|
* |
|
* Foo.prototype.b = 2; |
|
* Bar.prototype.d = 4; |
|
* |
|
* _.assign({ 'a': 0 }, new Foo, new Bar); |
|
* // => { 'a': 1, 'c': 3 } |
|
*/ |
|
var assign = createAssigner(function(object, source) { |
|
if (isPrototype(source) || isArrayLike(source)) { |
|
copyObject(source, keys(source), object); |
|
return; |
|
} |
|
for (var key in source) { |
|
if (hasOwnProperty.call(source, key)) { |
|
assignValue(object, key, source[key]); |
|
} |
|
} |
|
}); |
|
|
|
/** |
|
* This method is like `_.assign` except that it iterates over own and |
|
* inherited source properties. |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @alias extend |
|
* @category Object |
|
* @param {Object} object The destination object. |
|
* @param {...Object} [sources] The source objects. |
|
* @returns {Object} Returns `object`. |
|
* @see _.assign |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* } |
|
* |
|
* function Bar() { |
|
* this.c = 3; |
|
* } |
|
* |
|
* Foo.prototype.b = 2; |
|
* Bar.prototype.d = 4; |
|
* |
|
* _.assignIn({ 'a': 0 }, new Foo, new Bar); |
|
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } |
|
*/ |
|
var assignIn = createAssigner(function(object, source) { |
|
copyObject(source, keysIn(source), object); |
|
}); |
|
|
|
/** |
|
* 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 _ |
|
* @since 4.0.0 |
|
* @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`. |
|
* @see _.assignWith |
|
* @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) { |
|
copyObject(source, keysIn(source), object, customizer); |
|
}); |
|
|
|
/** |
|
* This method is like `_.assign` 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 _ |
|
* @since 4.0.0 |
|
* @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`. |
|
* @see _.assignInWith |
|
* @example |
|
* |
|
* function customizer(objValue, srcValue) { |
|
* return _.isUndefined(objValue) ? srcValue : objValue; |
|
* } |
|
* |
|
* var defaults = _.partialRight(_.assignWith, customizer); |
|
* |
|
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); |
|
* // => { 'a': 1, 'b': 2 } |
|
*/ |
|
var assignWith = createAssigner(function(object, source, srcIndex, customizer) { |
|
copyObject(source, keys(source), object, customizer); |
|
}); |
|
|
|
/** |
|
* Creates an array of values corresponding to `paths` of `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.0.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {...(string|string[])} [paths] The property paths to pick. |
|
* @returns {Array} Returns the picked values. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; |
|
* |
|
* _.at(object, ['a[0].b.c', 'a[1]']); |
|
* // => [3, 4] |
|
*/ |
|
var at = flatRest(baseAt); |
|
|
|
/** |
|
* Creates an object that inherits from the `prototype` object. If a |
|
* `properties` object is given, its own enumerable string keyed properties |
|
* are assigned to the created object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.3.0 |
|
* @category Object |
|
* @param {Object} prototype The object to inherit from. |
|
* @param {Object} [properties] The properties to assign to the object. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* function Shape() { |
|
* this.x = 0; |
|
* this.y = 0; |
|
* } |
|
* |
|
* function Circle() { |
|
* Shape.call(this); |
|
* } |
|
* |
|
* Circle.prototype = _.create(Shape.prototype, { |
|
* 'constructor': Circle |
|
* }); |
|
* |
|
* var circle = new Circle; |
|
* circle instanceof Circle; |
|
* // => true |
|
* |
|
* circle instanceof Shape; |
|
* // => true |
|
*/ |
|
function create(prototype, properties) { |
|
var result = baseCreate(prototype); |
|
return properties == null ? result : baseAssign(result, properties); |
|
} |
|
|
|
/** |
|
* Assigns own and inherited enumerable string keyed 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 |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The destination object. |
|
* @param {...Object} [sources] The source objects. |
|
* @returns {Object} Returns `object`. |
|
* @see _.defaultsDeep |
|
* @example |
|
* |
|
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); |
|
* // => { 'a': 1, 'b': 2 } |
|
*/ |
|
var defaults = baseRest(function(object, sources) { |
|
object = Object(object); |
|
|
|
var index = -1; |
|
var length = sources.length; |
|
var guard = length > 2 ? sources[2] : undefined; |
|
|
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) { |
|
length = 1; |
|
} |
|
|
|
while (++index < length) { |
|
var source = sources[index]; |
|
var props = keysIn(source); |
|
var propsIndex = -1; |
|
var propsLength = props.length; |
|
|
|
while (++propsIndex < propsLength) { |
|
var key = props[propsIndex]; |
|
var value = object[key]; |
|
|
|
if (value === undefined || |
|
(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { |
|
object[key] = source[key]; |
|
} |
|
} |
|
} |
|
|
|
return object; |
|
}); |
|
|
|
/** |
|
* This method is like `_.defaults` except that it recursively assigns |
|
* default properties. |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.10.0 |
|
* @category Object |
|
* @param {Object} object The destination object. |
|
* @param {...Object} [sources] The source objects. |
|
* @returns {Object} Returns `object`. |
|
* @see _.defaults |
|
* @example |
|
* |
|
* _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); |
|
* // => { 'a': { 'b': 2, 'c': 3 } } |
|
*/ |
|
var defaultsDeep = baseRest(function(args) { |
|
args.push(undefined, customDefaultsMerge); |
|
return apply(mergeWith, undefined, args); |
|
}); |
|
|
|
/** |
|
* This method is like `_.find` except that it returns the key of the first |
|
* element `predicate` returns truthy for instead of the element itself. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.1.0 |
|
* @category Object |
|
* @param {Object} object The object to inspect. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {string|undefined} Returns the key of the matched element, |
|
* else `undefined`. |
|
* @example |
|
* |
|
* var users = { |
|
* 'barney': { 'age': 36, 'active': true }, |
|
* 'fred': { 'age': 40, 'active': false }, |
|
* 'pebbles': { 'age': 1, 'active': true } |
|
* }; |
|
* |
|
* _.findKey(users, function(o) { return o.age < 40; }); |
|
* // => 'barney' (iteration order is not guaranteed) |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.findKey(users, { 'age': 1, 'active': true }); |
|
* // => 'pebbles' |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.findKey(users, ['active', false]); |
|
* // => 'fred' |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.findKey(users, 'active'); |
|
* // => 'barney' |
|
*/ |
|
function findKey(object, predicate) { |
|
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); |
|
} |
|
|
|
/** |
|
* This method is like `_.findKey` except that it iterates over elements of |
|
* a collection in the opposite order. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Object |
|
* @param {Object} object The object to inspect. |
|
* @param {Function} [predicate=_.identity] The function invoked per iteration. |
|
* @returns {string|undefined} Returns the key of the matched element, |
|
* else `undefined`. |
|
* @example |
|
* |
|
* var users = { |
|
* 'barney': { 'age': 36, 'active': true }, |
|
* 'fred': { 'age': 40, 'active': false }, |
|
* 'pebbles': { 'age': 1, 'active': true } |
|
* }; |
|
* |
|
* _.findLastKey(users, function(o) { return o.age < 40; }); |
|
* // => returns 'pebbles' assuming `_.findKey` returns 'barney' |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.findLastKey(users, { 'age': 36, 'active': true }); |
|
* // => 'barney' |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.findLastKey(users, ['active', false]); |
|
* // => 'fred' |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.findLastKey(users, 'active'); |
|
* // => 'pebbles' |
|
*/ |
|
function findLastKey(object, predicate) { |
|
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); |
|
} |
|
|
|
/** |
|
* Iterates over own and inherited enumerable string keyed properties of an |
|
* object and invokes `iteratee` for each property. The iteratee is invoked |
|
* with three arguments: (value, key, object). Iteratee functions may exit |
|
* iteration early by explicitly returning `false`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.3.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Object} Returns `object`. |
|
* @see _.forInRight |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.forIn(new Foo, function(value, key) { |
|
* console.log(key); |
|
* }); |
|
* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). |
|
*/ |
|
function forIn(object, iteratee) { |
|
return object == null |
|
? object |
|
: baseFor(object, getIteratee(iteratee, 3), keysIn); |
|
} |
|
|
|
/** |
|
* This method is like `_.forIn` except that it iterates over properties of |
|
* `object` in the opposite order. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Object} Returns `object`. |
|
* @see _.forIn |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.forInRight(new Foo, function(value, key) { |
|
* console.log(key); |
|
* }); |
|
* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. |
|
*/ |
|
function forInRight(object, iteratee) { |
|
return object == null |
|
? object |
|
: baseForRight(object, getIteratee(iteratee, 3), keysIn); |
|
} |
|
|
|
/** |
|
* Iterates over own enumerable string keyed properties of an object and |
|
* invokes `iteratee` for each property. The iteratee is invoked with three |
|
* arguments: (value, key, object). Iteratee functions may exit iteration |
|
* early by explicitly returning `false`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.3.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Object} Returns `object`. |
|
* @see _.forOwnRight |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.forOwn(new Foo, function(value, key) { |
|
* console.log(key); |
|
* }); |
|
* // => Logs 'a' then 'b' (iteration order is not guaranteed). |
|
*/ |
|
function forOwn(object, iteratee) { |
|
return object && baseForOwn(object, getIteratee(iteratee, 3)); |
|
} |
|
|
|
/** |
|
* This method is like `_.forOwn` except that it iterates over properties of |
|
* `object` in the opposite order. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.0.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Object} Returns `object`. |
|
* @see _.forOwn |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.forOwnRight(new Foo, function(value, key) { |
|
* console.log(key); |
|
* }); |
|
* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. |
|
*/ |
|
function forOwnRight(object, iteratee) { |
|
return object && baseForOwnRight(object, getIteratee(iteratee, 3)); |
|
} |
|
|
|
/** |
|
* Creates an array of function property names from own enumerable properties |
|
* of `object`. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The object to inspect. |
|
* @returns {Array} Returns the function names. |
|
* @see _.functionsIn |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = _.constant('a'); |
|
* this.b = _.constant('b'); |
|
* } |
|
* |
|
* Foo.prototype.c = _.constant('c'); |
|
* |
|
* _.functions(new Foo); |
|
* // => ['a', 'b'] |
|
*/ |
|
function functions(object) { |
|
return object == null ? [] : baseFunctions(object, keys(object)); |
|
} |
|
|
|
/** |
|
* Creates an array of function property names from own and inherited |
|
* enumerable properties of `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The object to inspect. |
|
* @returns {Array} Returns the function names. |
|
* @see _.functions |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = _.constant('a'); |
|
* this.b = _.constant('b'); |
|
* } |
|
* |
|
* Foo.prototype.c = _.constant('c'); |
|
* |
|
* _.functionsIn(new Foo); |
|
* // => ['a', 'b', 'c'] |
|
*/ |
|
function functionsIn(object) { |
|
return object == null ? [] : baseFunctions(object, keysIn(object)); |
|
} |
|
|
|
/** |
|
* Gets the value at `path` of `object`. If the resolved value is |
|
* `undefined`, the `defaultValue` is returned in its place. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.7.0 |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path of the property to get. |
|
* @param {*} [defaultValue] The value returned for `undefined` resolved values. |
|
* @returns {*} Returns the resolved value. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': 3 } }] }; |
|
* |
|
* _.get(object, 'a[0].b.c'); |
|
* // => 3 |
|
* |
|
* _.get(object, ['a', '0', 'b', 'c']); |
|
* // => 3 |
|
* |
|
* _.get(object, 'a.b.c', 'default'); |
|
* // => 'default' |
|
*/ |
|
function get(object, path, defaultValue) { |
|
var result = object == null ? undefined : baseGet(object, path); |
|
return result === undefined ? defaultValue : result; |
|
} |
|
|
|
/** |
|
* Checks if `path` is a direct property of `object`. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path to check. |
|
* @returns {boolean} Returns `true` if `path` exists, else `false`. |
|
* @example |
|
* |
|
* var object = { 'a': { 'b': 2 } }; |
|
* var other = _.create({ 'a': _.create({ 'b': 2 }) }); |
|
* |
|
* _.has(object, 'a'); |
|
* // => true |
|
* |
|
* _.has(object, 'a.b'); |
|
* // => true |
|
* |
|
* _.has(object, ['a', 'b']); |
|
* // => true |
|
* |
|
* _.has(other, 'a'); |
|
* // => false |
|
*/ |
|
function has(object, path) { |
|
return object != null && hasPath(object, path, baseHas); |
|
} |
|
|
|
/** |
|
* Checks if `path` is a direct or inherited property of `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path to check. |
|
* @returns {boolean} Returns `true` if `path` exists, else `false`. |
|
* @example |
|
* |
|
* var object = _.create({ 'a': _.create({ 'b': 2 }) }); |
|
* |
|
* _.hasIn(object, 'a'); |
|
* // => true |
|
* |
|
* _.hasIn(object, 'a.b'); |
|
* // => true |
|
* |
|
* _.hasIn(object, ['a', 'b']); |
|
* // => true |
|
* |
|
* _.hasIn(object, 'b'); |
|
* // => false |
|
*/ |
|
function hasIn(object, path) { |
|
return object != null && hasPath(object, path, baseHasIn); |
|
} |
|
|
|
/** |
|
* Creates an object composed of the inverted keys and values of `object`. |
|
* If `object` contains duplicate values, subsequent values overwrite |
|
* property assignments of previous values. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.7.0 |
|
* @category Object |
|
* @param {Object} object The object to invert. |
|
* @returns {Object} Returns the new inverted object. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': 2, 'c': 1 }; |
|
* |
|
* _.invert(object); |
|
* // => { '1': 'c', '2': 'b' } |
|
*/ |
|
var invert = createInverter(function(result, value, key) { |
|
if (value != null && |
|
typeof value.toString != 'function') { |
|
value = nativeObjectToString.call(value); |
|
} |
|
|
|
result[value] = key; |
|
}, constant(identity)); |
|
|
|
/** |
|
* This method is like `_.invert` except that the inverted object is generated |
|
* from the results of running each element of `object` thru `iteratee`. The |
|
* corresponding inverted value of each inverted key is an array of keys |
|
* responsible for generating the inverted value. The iteratee is invoked |
|
* with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.1.0 |
|
* @category Object |
|
* @param {Object} object The object to invert. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {Object} Returns the new inverted object. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': 2, 'c': 1 }; |
|
* |
|
* _.invertBy(object); |
|
* // => { '1': ['a', 'c'], '2': ['b'] } |
|
* |
|
* _.invertBy(object, function(value) { |
|
* return 'group' + value; |
|
* }); |
|
* // => { 'group1': ['a', 'c'], 'group2': ['b'] } |
|
*/ |
|
var invertBy = createInverter(function(result, value, key) { |
|
if (value != null && |
|
typeof value.toString != 'function') { |
|
value = nativeObjectToString.call(value); |
|
} |
|
|
|
if (hasOwnProperty.call(result, value)) { |
|
result[value].push(key); |
|
} else { |
|
result[value] = [key]; |
|
} |
|
}, getIteratee); |
|
|
|
/** |
|
* Invokes the method at `path` of `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path of the method to invoke. |
|
* @param {...*} [args] The arguments to invoke the method with. |
|
* @returns {*} Returns the result of the invoked method. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; |
|
* |
|
* _.invoke(object, 'a[0].b.c.slice', 1, 3); |
|
* // => [2, 3] |
|
*/ |
|
var invoke = baseRest(baseInvoke); |
|
|
|
/** |
|
* Creates an array of the own enumerable property names of `object`. |
|
* |
|
* **Note:** Non-object values are coerced to objects. See the |
|
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) |
|
* for more details. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @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; |
|
* |
|
* _.keys(new Foo); |
|
* // => ['a', 'b'] (iteration order is not guaranteed) |
|
* |
|
* _.keys('hi'); |
|
* // => ['0', '1'] |
|
*/ |
|
function keys(object) { |
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); |
|
} |
|
|
|
/** |
|
* Creates an array of the own and inherited enumerable property names of `object`. |
|
* |
|
* **Note:** Non-object values are coerced to objects. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @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) { |
|
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); |
|
} |
|
|
|
/** |
|
* The opposite of `_.mapValues`; this method creates an object with the |
|
* same values as `object` and keys generated by running each own enumerable |
|
* string keyed property of `object` thru `iteratee`. The iteratee is invoked |
|
* with three arguments: (value, key, object). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.8.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Object} Returns the new mapped object. |
|
* @see _.mapValues |
|
* @example |
|
* |
|
* _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { |
|
* return key + value; |
|
* }); |
|
* // => { 'a1': 1, 'b2': 2 } |
|
*/ |
|
function mapKeys(object, iteratee) { |
|
var result = {}; |
|
iteratee = getIteratee(iteratee, 3); |
|
|
|
baseForOwn(object, function(value, key, object) { |
|
baseAssignValue(result, iteratee(value, key, object), value); |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* Creates an object with the same keys as `object` and values generated |
|
* by running each own enumerable string keyed property of `object` thru |
|
* `iteratee`. The iteratee is invoked with three arguments: |
|
* (value, key, object). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.4.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Object} Returns the new mapped object. |
|
* @see _.mapKeys |
|
* @example |
|
* |
|
* var users = { |
|
* 'fred': { 'user': 'fred', 'age': 40 }, |
|
* 'pebbles': { 'user': 'pebbles', 'age': 1 } |
|
* }; |
|
* |
|
* _.mapValues(users, function(o) { return o.age; }); |
|
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.mapValues(users, 'age'); |
|
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) |
|
*/ |
|
function mapValues(object, iteratee) { |
|
var result = {}; |
|
iteratee = getIteratee(iteratee, 3); |
|
|
|
baseForOwn(object, function(value, key, object) { |
|
baseAssignValue(result, key, iteratee(value, key, object)); |
|
}); |
|
return result; |
|
} |
|
|
|
/** |
|
* This method is like `_.assign` except that it recursively merges own and |
|
* inherited enumerable string keyed properties of source objects into the |
|
* destination object. Source properties that resolve to `undefined` are |
|
* skipped if a destination value exists. Array and plain object properties |
|
* are merged recursively. Other objects and value types are overridden by |
|
* assignment. Source objects are applied from left to right. Subsequent |
|
* sources overwrite property assignments of previous sources. |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.5.0 |
|
* @category Object |
|
* @param {Object} object The destination object. |
|
* @param {...Object} [sources] The source objects. |
|
* @returns {Object} Returns `object`. |
|
* @example |
|
* |
|
* var object = { |
|
* 'a': [{ 'b': 2 }, { 'd': 4 }] |
|
* }; |
|
* |
|
* var other = { |
|
* 'a': [{ 'c': 3 }, { 'e': 5 }] |
|
* }; |
|
* |
|
* _.merge(object, other); |
|
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } |
|
*/ |
|
var merge = createAssigner(function(object, source, srcIndex) { |
|
baseMerge(object, source, srcIndex); |
|
}); |
|
|
|
/** |
|
* This method is like `_.merge` except that it accepts `customizer` which |
|
* is invoked to produce the merged values of the destination and source |
|
* properties. If `customizer` returns `undefined`, merging is handled by the |
|
* method instead. The `customizer` is invoked with six arguments: |
|
* (objValue, srcValue, key, object, source, stack). |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @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) { |
|
* if (_.isArray(objValue)) { |
|
* return objValue.concat(srcValue); |
|
* } |
|
* } |
|
* |
|
* var object = { 'a': [1], 'b': [2] }; |
|
* var other = { 'a': [3], 'b': [4] }; |
|
* |
|
* _.mergeWith(object, other, customizer); |
|
* // => { 'a': [1, 3], 'b': [2, 4] } |
|
*/ |
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { |
|
baseMerge(object, source, srcIndex, customizer); |
|
}); |
|
|
|
/** |
|
* The opposite of `_.pick`; this method creates an object composed of the |
|
* own and inherited enumerable property paths of `object` that are not omitted. |
|
* |
|
* **Note:** This method is considerably slower than `_.pick`. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The source object. |
|
* @param {...(string|string[])} [paths] The property paths to omit. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': '2', 'c': 3 }; |
|
* |
|
* _.omit(object, ['a', 'c']); |
|
* // => { 'b': '2' } |
|
*/ |
|
var omit = flatRest(function(object, paths) { |
|
var result = {}; |
|
if (object == null) { |
|
return result; |
|
} |
|
var isDeep = false; |
|
paths = arrayMap(paths, function(path) { |
|
path = castPath(path, object); |
|
isDeep || (isDeep = path.length > 1); |
|
return path; |
|
}); |
|
copyObject(object, getAllKeysIn(object), result); |
|
if (isDeep) { |
|
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); |
|
} |
|
var length = paths.length; |
|
while (length--) { |
|
baseUnset(result, paths[length]); |
|
} |
|
return result; |
|
}); |
|
|
|
/** |
|
* The opposite of `_.pickBy`; this method creates an object composed of |
|
* the own and inherited enumerable string keyed properties of `object` that |
|
* `predicate` doesn't return truthy for. The predicate is invoked with two |
|
* arguments: (value, key). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The source object. |
|
* @param {Function} [predicate=_.identity] The function invoked per property. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': '2', 'c': 3 }; |
|
* |
|
* _.omitBy(object, _.isNumber); |
|
* // => { 'b': '2' } |
|
*/ |
|
function omitBy(object, predicate) { |
|
return pickBy(object, negate(getIteratee(predicate))); |
|
} |
|
|
|
/** |
|
* Creates an object composed of the picked `object` properties. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The source object. |
|
* @param {...(string|string[])} [paths] The property paths to pick. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': '2', 'c': 3 }; |
|
* |
|
* _.pick(object, ['a', 'c']); |
|
* // => { 'a': 1, 'c': 3 } |
|
*/ |
|
var pick = flatRest(function(object, paths) { |
|
return object == null ? {} : basePick(object, paths); |
|
}); |
|
|
|
/** |
|
* Creates an object composed of the `object` properties `predicate` returns |
|
* truthy for. The predicate is invoked with two arguments: (value, key). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The source object. |
|
* @param {Function} [predicate=_.identity] The function invoked per property. |
|
* @returns {Object} Returns the new object. |
|
* @example |
|
* |
|
* var object = { 'a': 1, 'b': '2', 'c': 3 }; |
|
* |
|
* _.pickBy(object, _.isNumber); |
|
* // => { 'a': 1, 'c': 3 } |
|
*/ |
|
function pickBy(object, predicate) { |
|
if (object == null) { |
|
return {}; |
|
} |
|
var props = arrayMap(getAllKeysIn(object), function(prop) { |
|
return [prop]; |
|
}); |
|
predicate = getIteratee(predicate); |
|
return basePickBy(object, props, function(value, path) { |
|
return predicate(value, path[0]); |
|
}); |
|
} |
|
|
|
/** |
|
* This method is like `_.get` except that if the resolved value is a |
|
* function it's invoked with the `this` binding of its parent object and |
|
* its result is returned. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @param {Array|string} path The path of the property to resolve. |
|
* @param {*} [defaultValue] The value returned for `undefined` resolved values. |
|
* @returns {*} Returns the resolved value. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; |
|
* |
|
* _.result(object, 'a[0].b.c1'); |
|
* // => 3 |
|
* |
|
* _.result(object, 'a[0].b.c2'); |
|
* // => 4 |
|
* |
|
* _.result(object, 'a[0].b.c3', 'default'); |
|
* // => 'default' |
|
* |
|
* _.result(object, 'a[0].b.c3', _.constant('default')); |
|
* // => 'default' |
|
*/ |
|
function result(object, path, defaultValue) { |
|
path = castPath(path, object); |
|
|
|
var index = -1, |
|
length = path.length; |
|
|
|
// Ensure the loop is entered when path is empty. |
|
if (!length) { |
|
length = 1; |
|
object = undefined; |
|
} |
|
while (++index < length) { |
|
var value = object == null ? undefined : object[toKey(path[index])]; |
|
if (value === undefined) { |
|
index = length; |
|
value = defaultValue; |
|
} |
|
object = isFunction(value) ? value.call(object) : value; |
|
} |
|
return object; |
|
} |
|
|
|
/** |
|
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist, |
|
* it's created. Arrays are created for missing index properties while objects |
|
* are created for all other missing properties. Use `_.setWith` to customize |
|
* `path` creation. |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.7.0 |
|
* @category Object |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to set. |
|
* @param {*} value The value to set. |
|
* @returns {Object} Returns `object`. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': 3 } }] }; |
|
* |
|
* _.set(object, 'a[0].b.c', 4); |
|
* console.log(object.a[0].b.c); |
|
* // => 4 |
|
* |
|
* _.set(object, ['x', '0', 'y', 'z'], 5); |
|
* console.log(object.x[0].y.z); |
|
* // => 5 |
|
*/ |
|
function set(object, path, value) { |
|
return object == null ? object : baseSet(object, path, value); |
|
} |
|
|
|
/** |
|
* This method is like `_.set` except that it accepts `customizer` which is |
|
* invoked to produce the objects of `path`. If `customizer` returns `undefined` |
|
* path creation is handled by the method instead. The `customizer` is invoked |
|
* with three arguments: (nsValue, key, nsObject). |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to set. |
|
* @param {*} value The value to set. |
|
* @param {Function} [customizer] The function to customize assigned values. |
|
* @returns {Object} Returns `object`. |
|
* @example |
|
* |
|
* var object = {}; |
|
* |
|
* _.setWith(object, '[0][1]', 'a', Object); |
|
* // => { '0': { '1': 'a' } } |
|
*/ |
|
function setWith(object, path, value, customizer) { |
|
customizer = typeof customizer == 'function' ? customizer : undefined; |
|
return object == null ? object : baseSet(object, path, value, customizer); |
|
} |
|
|
|
/** |
|
* Creates an array of own enumerable string keyed-value pairs for `object` |
|
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its |
|
* entries are returned. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @alias entries |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the key-value pairs. |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.toPairs(new Foo); |
|
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) |
|
*/ |
|
var toPairs = createToPairs(keys); |
|
|
|
/** |
|
* Creates an array of own and inherited enumerable string keyed-value pairs |
|
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map |
|
* or set, its entries are returned. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @alias entriesIn |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the key-value pairs. |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.toPairsIn(new Foo); |
|
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) |
|
*/ |
|
var toPairsIn = createToPairs(keysIn); |
|
|
|
/** |
|
* An alternative to `_.reduce`; this method transforms `object` to a new |
|
* `accumulator` object which is the result of running each of its own |
|
* enumerable string keyed properties thru `iteratee`, with each invocation |
|
* potentially mutating the `accumulator` object. If `accumulator` is not |
|
* provided, a new object with the same `[[Prototype]]` will be used. The |
|
* iteratee is invoked with four arguments: (accumulator, value, key, object). |
|
* Iteratee functions may exit iteration early by explicitly returning `false`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.3.0 |
|
* @category Object |
|
* @param {Object} object The object to iterate over. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @param {*} [accumulator] The custom accumulator value. |
|
* @returns {*} Returns the accumulated value. |
|
* @example |
|
* |
|
* _.transform([2, 3, 4], function(result, n) { |
|
* result.push(n *= n); |
|
* return n % 2 == 0; |
|
* }, []); |
|
* // => [4, 9] |
|
* |
|
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { |
|
* (result[value] || (result[value] = [])).push(key); |
|
* }, {}); |
|
* // => { '1': ['a', 'c'], '2': ['b'] } |
|
*/ |
|
function transform(object, iteratee, accumulator) { |
|
var isArr = isArray(object), |
|
isArrLike = isArr || isBuffer(object) || isTypedArray(object); |
|
|
|
iteratee = getIteratee(iteratee, 4); |
|
if (accumulator == null) { |
|
var Ctor = object && object.constructor; |
|
if (isArrLike) { |
|
accumulator = isArr ? new Ctor : []; |
|
} |
|
else if (isObject(object)) { |
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; |
|
} |
|
else { |
|
accumulator = {}; |
|
} |
|
} |
|
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { |
|
return iteratee(accumulator, value, index, object); |
|
}); |
|
return accumulator; |
|
} |
|
|
|
/** |
|
* Removes the property at `path` of `object`. |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Object |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to unset. |
|
* @returns {boolean} Returns `true` if the property is deleted, else `false`. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': 7 } }] }; |
|
* _.unset(object, 'a[0].b.c'); |
|
* // => true |
|
* |
|
* console.log(object); |
|
* // => { 'a': [{ 'b': {} }] }; |
|
* |
|
* _.unset(object, ['a', '0', 'b', 'c']); |
|
* // => true |
|
* |
|
* console.log(object); |
|
* // => { 'a': [{ 'b': {} }] }; |
|
*/ |
|
function unset(object, path) { |
|
return object == null ? true : baseUnset(object, path); |
|
} |
|
|
|
/** |
|
* This method is like `_.set` except that accepts `updater` to produce the |
|
* value to set. Use `_.updateWith` to customize `path` creation. The `updater` |
|
* is invoked with one argument: (value). |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.6.0 |
|
* @category Object |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to set. |
|
* @param {Function} updater The function to produce the updated value. |
|
* @returns {Object} Returns `object`. |
|
* @example |
|
* |
|
* var object = { 'a': [{ 'b': { 'c': 3 } }] }; |
|
* |
|
* _.update(object, 'a[0].b.c', function(n) { return n * n; }); |
|
* console.log(object.a[0].b.c); |
|
* // => 9 |
|
* |
|
* _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); |
|
* console.log(object.x[0].y.z); |
|
* // => 0 |
|
*/ |
|
function update(object, path, updater) { |
|
return object == null ? object : baseUpdate(object, path, castFunction(updater)); |
|
} |
|
|
|
/** |
|
* This method is like `_.update` except that it accepts `customizer` which is |
|
* invoked to produce the objects of `path`. If `customizer` returns `undefined` |
|
* path creation is handled by the method instead. The `customizer` is invoked |
|
* with three arguments: (nsValue, key, nsObject). |
|
* |
|
* **Note:** This method mutates `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.6.0 |
|
* @category Object |
|
* @param {Object} object The object to modify. |
|
* @param {Array|string} path The path of the property to set. |
|
* @param {Function} updater The function to produce the updated value. |
|
* @param {Function} [customizer] The function to customize assigned values. |
|
* @returns {Object} Returns `object`. |
|
* @example |
|
* |
|
* var object = {}; |
|
* |
|
* _.updateWith(object, '[0][1]', _.constant('a'), Object); |
|
* // => { '0': { '1': 'a' } } |
|
*/ |
|
function updateWith(object, path, updater, customizer) { |
|
customizer = typeof customizer == 'function' ? customizer : undefined; |
|
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); |
|
} |
|
|
|
/** |
|
* Creates an array of the own enumerable string keyed property values of `object`. |
|
* |
|
* **Note:** Non-object values are coerced to objects. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property values. |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.values(new Foo); |
|
* // => [1, 2] (iteration order is not guaranteed) |
|
* |
|
* _.values('hi'); |
|
* // => ['h', 'i'] |
|
*/ |
|
function values(object) { |
|
return object == null ? [] : baseValues(object, keys(object)); |
|
} |
|
|
|
/** |
|
* Creates an array of the own and inherited enumerable string keyed property |
|
* values of `object`. |
|
* |
|
* **Note:** Non-object values are coerced to objects. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Object |
|
* @param {Object} object The object to query. |
|
* @returns {Array} Returns the array of property values. |
|
* @example |
|
* |
|
* function Foo() { |
|
* this.a = 1; |
|
* this.b = 2; |
|
* } |
|
* |
|
* Foo.prototype.c = 3; |
|
* |
|
* _.valuesIn(new Foo); |
|
* // => [1, 2, 3] (iteration order is not guaranteed) |
|
*/ |
|
function valuesIn(object) { |
|
return object == null ? [] : baseValues(object, keysIn(object)); |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Clamps `number` within the inclusive `lower` and `upper` bounds. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Number |
|
* @param {number} number The number to clamp. |
|
* @param {number} [lower] The lower bound. |
|
* @param {number} upper The upper bound. |
|
* @returns {number} Returns the clamped number. |
|
* @example |
|
* |
|
* _.clamp(-10, -5, 5); |
|
* // => -5 |
|
* |
|
* _.clamp(10, -5, 5); |
|
* // => 5 |
|
*/ |
|
function clamp(number, lower, upper) { |
|
if (upper === undefined) { |
|
upper = lower; |
|
lower = undefined; |
|
} |
|
if (upper !== undefined) { |
|
upper = toNumber(upper); |
|
upper = upper === upper ? upper : 0; |
|
} |
|
if (lower !== undefined) { |
|
lower = toNumber(lower); |
|
lower = lower === lower ? lower : 0; |
|
} |
|
return baseClamp(toNumber(number), lower, upper); |
|
} |
|
|
|
/** |
|
* Checks if `n` is between `start` and up to, but not including, `end`. If |
|
* `end` is not specified, it's set to `start` with `start` then set to `0`. |
|
* If `start` is greater than `end` the params are swapped to support |
|
* negative ranges. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.3.0 |
|
* @category Number |
|
* @param {number} number The number to check. |
|
* @param {number} [start=0] The start of the range. |
|
* @param {number} end The end of the range. |
|
* @returns {boolean} Returns `true` if `number` is in the range, else `false`. |
|
* @see _.range, _.rangeRight |
|
* @example |
|
* |
|
* _.inRange(3, 2, 4); |
|
* // => true |
|
* |
|
* _.inRange(4, 8); |
|
* // => true |
|
* |
|
* _.inRange(4, 2); |
|
* // => false |
|
* |
|
* _.inRange(2, 2); |
|
* // => false |
|
* |
|
* _.inRange(1.2, 2); |
|
* // => true |
|
* |
|
* _.inRange(5.2, 4); |
|
* // => false |
|
* |
|
* _.inRange(-3, -2, -6); |
|
* // => true |
|
*/ |
|
function inRange(number, start, end) { |
|
start = toFinite(start); |
|
if (end === undefined) { |
|
end = start; |
|
start = 0; |
|
} else { |
|
end = toFinite(end); |
|
} |
|
number = toNumber(number); |
|
return baseInRange(number, start, end); |
|
} |
|
|
|
/** |
|
* Produces a random number between the inclusive `lower` and `upper` bounds. |
|
* If only one argument is provided a number between `0` and the given number |
|
* is returned. If `floating` is `true`, or either `lower` or `upper` are |
|
* floats, a floating-point number is returned instead of an integer. |
|
* |
|
* **Note:** JavaScript follows the IEEE-754 standard for resolving |
|
* floating-point values which can produce unexpected results. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.7.0 |
|
* @category Number |
|
* @param {number} [lower=0] The lower bound. |
|
* @param {number} [upper=1] The upper bound. |
|
* @param {boolean} [floating] Specify returning a floating-point number. |
|
* @returns {number} Returns the random number. |
|
* @example |
|
* |
|
* _.random(0, 5); |
|
* // => an integer between 0 and 5 |
|
* |
|
* _.random(5); |
|
* // => also an integer between 0 and 5 |
|
* |
|
* _.random(5, true); |
|
* // => a floating-point number between 0 and 5 |
|
* |
|
* _.random(1.2, 5.2); |
|
* // => a floating-point number between 1.2 and 5.2 |
|
*/ |
|
function random(lower, upper, floating) { |
|
if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { |
|
upper = floating = undefined; |
|
} |
|
if (floating === undefined) { |
|
if (typeof upper == 'boolean') { |
|
floating = upper; |
|
upper = undefined; |
|
} |
|
else if (typeof lower == 'boolean') { |
|
floating = lower; |
|
lower = undefined; |
|
} |
|
} |
|
if (lower === undefined && upper === undefined) { |
|
lower = 0; |
|
upper = 1; |
|
} |
|
else { |
|
lower = toFinite(lower); |
|
if (upper === undefined) { |
|
upper = lower; |
|
lower = 0; |
|
} else { |
|
upper = toFinite(upper); |
|
} |
|
} |
|
if (lower > upper) { |
|
var temp = lower; |
|
lower = upper; |
|
upper = temp; |
|
} |
|
if (floating || lower % 1 || upper % 1) { |
|
var rand = nativeRandom(); |
|
return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); |
|
} |
|
return baseRandom(lower, upper); |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the camel cased string. |
|
* @example |
|
* |
|
* _.camelCase('Foo Bar'); |
|
* // => 'fooBar' |
|
* |
|
* _.camelCase('--foo-bar--'); |
|
* // => 'fooBar' |
|
* |
|
* _.camelCase('__FOO_BAR__'); |
|
* // => 'fooBar' |
|
*/ |
|
var camelCase = createCompounder(function(result, word, index) { |
|
word = word.toLowerCase(); |
|
return result + (index ? capitalize(word) : word); |
|
}); |
|
|
|
/** |
|
* Converts the first character of `string` to upper case and the remaining |
|
* to lower case. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to capitalize. |
|
* @returns {string} Returns the capitalized string. |
|
* @example |
|
* |
|
* _.capitalize('FRED'); |
|
* // => 'Fred' |
|
*/ |
|
function capitalize(string) { |
|
return upperFirst(toString(string).toLowerCase()); |
|
} |
|
|
|
/** |
|
* Deburrs `string` by converting |
|
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) |
|
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) |
|
* letters to basic Latin letters and removing |
|
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to deburr. |
|
* @returns {string} Returns the deburred string. |
|
* @example |
|
* |
|
* _.deburr('déjà vu'); |
|
* // => 'deja vu' |
|
*/ |
|
function deburr(string) { |
|
string = toString(string); |
|
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); |
|
} |
|
|
|
/** |
|
* Checks if `string` ends with the given target string. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to inspect. |
|
* @param {string} [target] The string to search for. |
|
* @param {number} [position=string.length] The position to search up to. |
|
* @returns {boolean} Returns `true` if `string` ends with `target`, |
|
* else `false`. |
|
* @example |
|
* |
|
* _.endsWith('abc', 'c'); |
|
* // => true |
|
* |
|
* _.endsWith('abc', 'b'); |
|
* // => false |
|
* |
|
* _.endsWith('abc', 'b', 2); |
|
* // => true |
|
*/ |
|
function endsWith(string, target, position) { |
|
string = toString(string); |
|
target = baseToString(target); |
|
|
|
var length = string.length; |
|
position = position === undefined |
|
? length |
|
: baseClamp(toInteger(position), 0, length); |
|
|
|
var end = position; |
|
position -= target.length; |
|
return position >= 0 && string.slice(position, end) == target; |
|
} |
|
|
|
/** |
|
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their |
|
* corresponding HTML entities. |
|
* |
|
* **Note:** No other characters are escaped. To escape additional |
|
* characters use a third-party library like [_he_](https://mths.be/he). |
|
* |
|
* Though the ">" character is escaped for symmetry, characters like |
|
* ">" and "/" don't need escaping in HTML and have no special meaning |
|
* unless they're part of a tag or unquoted attribute value. See |
|
* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) |
|
* (under "semi-related fun fact") for more details. |
|
* |
|
* When working with HTML you should always |
|
* [quote attribute values](http://wonko.com/post/html-escaping) to reduce |
|
* XSS vectors. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category String |
|
* @param {string} [string=''] The string to escape. |
|
* @returns {string} Returns the escaped string. |
|
* @example |
|
* |
|
* _.escape('fred, barney, & pebbles'); |
|
* // => 'fred, barney, & pebbles' |
|
*/ |
|
function escape(string) { |
|
string = toString(string); |
|
return (string && reHasUnescapedHtml.test(string)) |
|
? string.replace(reUnescapedHtml, escapeHtmlChar) |
|
: string; |
|
} |
|
|
|
/** |
|
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", |
|
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to escape. |
|
* @returns {string} Returns the escaped string. |
|
* @example |
|
* |
|
* _.escapeRegExp('[lodash](https://lodash.com/)'); |
|
* // => '\[lodash\]\(https://lodash\.com/\)' |
|
*/ |
|
function escapeRegExp(string) { |
|
string = toString(string); |
|
return (string && reHasRegExpChar.test(string)) |
|
? string.replace(reRegExpChar, '\\$&') |
|
: string; |
|
} |
|
|
|
/** |
|
* Converts `string` to |
|
* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the kebab cased string. |
|
* @example |
|
* |
|
* _.kebabCase('Foo Bar'); |
|
* // => 'foo-bar' |
|
* |
|
* _.kebabCase('fooBar'); |
|
* // => 'foo-bar' |
|
* |
|
* _.kebabCase('__FOO_BAR__'); |
|
* // => 'foo-bar' |
|
*/ |
|
var kebabCase = createCompounder(function(result, word, index) { |
|
return result + (index ? '-' : '') + word.toLowerCase(); |
|
}); |
|
|
|
/** |
|
* Converts `string`, as space separated words, to lower case. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the lower cased string. |
|
* @example |
|
* |
|
* _.lowerCase('--Foo-Bar--'); |
|
* // => 'foo bar' |
|
* |
|
* _.lowerCase('fooBar'); |
|
* // => 'foo bar' |
|
* |
|
* _.lowerCase('__FOO_BAR__'); |
|
* // => 'foo bar' |
|
*/ |
|
var lowerCase = createCompounder(function(result, word, index) { |
|
return result + (index ? ' ' : '') + word.toLowerCase(); |
|
}); |
|
|
|
/** |
|
* Converts the first character of `string` to lower case. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the converted string. |
|
* @example |
|
* |
|
* _.lowerFirst('Fred'); |
|
* // => 'fred' |
|
* |
|
* _.lowerFirst('FRED'); |
|
* // => 'fRED' |
|
*/ |
|
var lowerFirst = createCaseFirst('toLowerCase'); |
|
|
|
/** |
|
* Pads `string` on the left and right sides if it's shorter than `length`. |
|
* Padding characters are truncated if they can't be evenly divided by `length`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to pad. |
|
* @param {number} [length=0] The padding length. |
|
* @param {string} [chars=' '] The string used as padding. |
|
* @returns {string} Returns the padded string. |
|
* @example |
|
* |
|
* _.pad('abc', 8); |
|
* // => ' abc ' |
|
* |
|
* _.pad('abc', 8, '_-'); |
|
* // => '_-abc_-_' |
|
* |
|
* _.pad('abc', 3); |
|
* // => 'abc' |
|
*/ |
|
function pad(string, length, chars) { |
|
string = toString(string); |
|
length = toInteger(length); |
|
|
|
var strLength = length ? stringSize(string) : 0; |
|
if (!length || strLength >= length) { |
|
return string; |
|
} |
|
var mid = (length - strLength) / 2; |
|
return ( |
|
createPadding(nativeFloor(mid), chars) + |
|
string + |
|
createPadding(nativeCeil(mid), chars) |
|
); |
|
} |
|
|
|
/** |
|
* Pads `string` on the right side if it's shorter than `length`. Padding |
|
* characters are truncated if they exceed `length`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to pad. |
|
* @param {number} [length=0] The padding length. |
|
* @param {string} [chars=' '] The string used as padding. |
|
* @returns {string} Returns the padded string. |
|
* @example |
|
* |
|
* _.padEnd('abc', 6); |
|
* // => 'abc ' |
|
* |
|
* _.padEnd('abc', 6, '_-'); |
|
* // => 'abc_-_' |
|
* |
|
* _.padEnd('abc', 3); |
|
* // => 'abc' |
|
*/ |
|
function padEnd(string, length, chars) { |
|
string = toString(string); |
|
length = toInteger(length); |
|
|
|
var strLength = length ? stringSize(string) : 0; |
|
return (length && strLength < length) |
|
? (string + createPadding(length - strLength, chars)) |
|
: string; |
|
} |
|
|
|
/** |
|
* Pads `string` on the left side if it's shorter than `length`. Padding |
|
* characters are truncated if they exceed `length`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to pad. |
|
* @param {number} [length=0] The padding length. |
|
* @param {string} [chars=' '] The string used as padding. |
|
* @returns {string} Returns the padded string. |
|
* @example |
|
* |
|
* _.padStart('abc', 6); |
|
* // => ' abc' |
|
* |
|
* _.padStart('abc', 6, '_-'); |
|
* // => '_-_abc' |
|
* |
|
* _.padStart('abc', 3); |
|
* // => 'abc' |
|
*/ |
|
function padStart(string, length, chars) { |
|
string = toString(string); |
|
length = toInteger(length); |
|
|
|
var strLength = length ? stringSize(string) : 0; |
|
return (length && strLength < length) |
|
? (createPadding(length - strLength, chars) + string) |
|
: string; |
|
} |
|
|
|
/** |
|
* Converts `string` to an integer of the specified radix. If `radix` is |
|
* `undefined` or `0`, a `radix` of `10` is used unless `value` is a |
|
* hexadecimal, in which case a `radix` of `16` is used. |
|
* |
|
* **Note:** This method aligns with the |
|
* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 1.1.0 |
|
* @category String |
|
* @param {string} string The string to convert. |
|
* @param {number} [radix=10] The radix to interpret `value` by. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {number} Returns the converted integer. |
|
* @example |
|
* |
|
* _.parseInt('08'); |
|
* // => 8 |
|
* |
|
* _.map(['6', '08', '10'], _.parseInt); |
|
* // => [6, 8, 10] |
|
*/ |
|
function parseInt(string, radix, guard) { |
|
if (guard || radix == null) { |
|
radix = 0; |
|
} else if (radix) { |
|
radix = +radix; |
|
} |
|
return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); |
|
} |
|
|
|
/** |
|
* Repeats the given string `n` times. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to repeat. |
|
* @param {number} [n=1] The number of times to repeat the string. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {string} Returns the repeated string. |
|
* @example |
|
* |
|
* _.repeat('*', 3); |
|
* // => '***' |
|
* |
|
* _.repeat('abc', 2); |
|
* // => 'abcabc' |
|
* |
|
* _.repeat('abc', 0); |
|
* // => '' |
|
*/ |
|
function repeat(string, n, guard) { |
|
if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { |
|
n = 1; |
|
} else { |
|
n = toInteger(n); |
|
} |
|
return baseRepeat(toString(string), n); |
|
} |
|
|
|
/** |
|
* Replaces matches for `pattern` in `string` with `replacement`. |
|
* |
|
* **Note:** This method is based on |
|
* [`String#replace`](https://mdn.io/String/replace). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to modify. |
|
* @param {RegExp|string} pattern The pattern to replace. |
|
* @param {Function|string} replacement The match replacement. |
|
* @returns {string} Returns the modified string. |
|
* @example |
|
* |
|
* _.replace('Hi Fred', 'Fred', 'Barney'); |
|
* // => 'Hi Barney' |
|
*/ |
|
function replace() { |
|
var args = arguments, |
|
string = toString(args[0]); |
|
|
|
return args.length < 3 ? string : string.replace(args[1], args[2]); |
|
} |
|
|
|
/** |
|
* Converts `string` to |
|
* [snake case](https://en.wikipedia.org/wiki/Snake_case). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the snake cased string. |
|
* @example |
|
* |
|
* _.snakeCase('Foo Bar'); |
|
* // => 'foo_bar' |
|
* |
|
* _.snakeCase('fooBar'); |
|
* // => 'foo_bar' |
|
* |
|
* _.snakeCase('--FOO-BAR--'); |
|
* // => 'foo_bar' |
|
*/ |
|
var snakeCase = createCompounder(function(result, word, index) { |
|
return result + (index ? '_' : '') + word.toLowerCase(); |
|
}); |
|
|
|
/** |
|
* Splits `string` by `separator`. |
|
* |
|
* **Note:** This method is based on |
|
* [`String#split`](https://mdn.io/String/split). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to split. |
|
* @param {RegExp|string} separator The separator pattern to split by. |
|
* @param {number} [limit] The length to truncate results to. |
|
* @returns {Array} Returns the string segments. |
|
* @example |
|
* |
|
* _.split('a-b-c', '-', 2); |
|
* // => ['a', 'b'] |
|
*/ |
|
function split(string, separator, limit) { |
|
if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { |
|
separator = limit = undefined; |
|
} |
|
limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; |
|
if (!limit) { |
|
return []; |
|
} |
|
string = toString(string); |
|
if (string && ( |
|
typeof separator == 'string' || |
|
(separator != null && !isRegExp(separator)) |
|
)) { |
|
separator = baseToString(separator); |
|
if (!separator && hasUnicode(string)) { |
|
return castSlice(stringToArray(string), 0, limit); |
|
} |
|
} |
|
return string.split(separator, limit); |
|
} |
|
|
|
/** |
|
* Converts `string` to |
|
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.1.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the start cased string. |
|
* @example |
|
* |
|
* _.startCase('--foo-bar--'); |
|
* // => 'Foo Bar' |
|
* |
|
* _.startCase('fooBar'); |
|
* // => 'Foo Bar' |
|
* |
|
* _.startCase('__FOO_BAR__'); |
|
* // => 'FOO BAR' |
|
*/ |
|
var startCase = createCompounder(function(result, word, index) { |
|
return result + (index ? ' ' : '') + upperFirst(word); |
|
}); |
|
|
|
/** |
|
* Checks if `string` starts with the given target string. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to inspect. |
|
* @param {string} [target] The string to search for. |
|
* @param {number} [position=0] The position to search from. |
|
* @returns {boolean} Returns `true` if `string` starts with `target`, |
|
* else `false`. |
|
* @example |
|
* |
|
* _.startsWith('abc', 'a'); |
|
* // => true |
|
* |
|
* _.startsWith('abc', 'b'); |
|
* // => false |
|
* |
|
* _.startsWith('abc', 'b', 1); |
|
* // => true |
|
*/ |
|
function startsWith(string, target, position) { |
|
string = toString(string); |
|
position = position == null |
|
? 0 |
|
: baseClamp(toInteger(position), 0, string.length); |
|
|
|
target = baseToString(target); |
|
return string.slice(position, position + target.length) == target; |
|
} |
|
|
|
/** |
|
* Creates a compiled template function that can interpolate data properties |
|
* in "interpolate" delimiters, HTML-escape interpolated data properties in |
|
* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data |
|
* properties may be accessed as free variables in the template. If a setting |
|
* object is given, it takes precedence over `_.templateSettings` values. |
|
* |
|
* **Note:** In the development build `_.template` utilizes |
|
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) |
|
* for easier debugging. |
|
* |
|
* For more information on precompiling templates see |
|
* [lodash's custom builds documentation](https://lodash.com/custom-builds). |
|
* |
|
* For more information on Chrome extension sandboxes see |
|
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category String |
|
* @param {string} [string=''] The template string. |
|
* @param {Object} [options={}] The options object. |
|
* @param {RegExp} [options.escape=_.templateSettings.escape] |
|
* The HTML "escape" delimiter. |
|
* @param {RegExp} [options.evaluate=_.templateSettings.evaluate] |
|
* The "evaluate" delimiter. |
|
* @param {Object} [options.imports=_.templateSettings.imports] |
|
* An object to import into the template as free variables. |
|
* @param {RegExp} [options.interpolate=_.templateSettings.interpolate] |
|
* The "interpolate" delimiter. |
|
* @param {string} [options.sourceURL='lodash.templateSources[n]'] |
|
* The sourceURL of the compiled template. |
|
* @param {string} [options.variable='obj'] |
|
* The data object variable name. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Function} Returns the compiled template function. |
|
* @example |
|
* |
|
* // Use the "interpolate" delimiter to create a compiled template. |
|
* var compiled = _.template('hello <%= user %>!'); |
|
* compiled({ 'user': 'fred' }); |
|
* // => 'hello fred!' |
|
* |
|
* // Use the HTML "escape" delimiter to escape data property values. |
|
* var compiled = _.template('<b><%- value %></b>'); |
|
* compiled({ 'value': '<script>' }); |
|
* // => '<b><script></b>' |
|
* |
|
* // Use the "evaluate" delimiter to execute JavaScript and generate HTML. |
|
* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); |
|
* compiled({ 'users': ['fred', 'barney'] }); |
|
* // => '<li>fred</li><li>barney</li>' |
|
* |
|
* // Use the internal `print` function in "evaluate" delimiters. |
|
* var compiled = _.template('<% print("hello " + user); %>!'); |
|
* compiled({ 'user': 'barney' }); |
|
* // => 'hello barney!' |
|
* |
|
* // Use the ES template literal delimiter as an "interpolate" delimiter. |
|
* // Disable support by replacing the "interpolate" delimiter. |
|
* var compiled = _.template('hello ${ user }!'); |
|
* compiled({ 'user': 'pebbles' }); |
|
* // => 'hello pebbles!' |
|
* |
|
* // Use backslashes to treat delimiters as plain text. |
|
* var compiled = _.template('<%= "\\<%- value %\\>" %>'); |
|
* compiled({ 'value': 'ignored' }); |
|
* // => '<%- value %>' |
|
* |
|
* // Use the `imports` option to import `jQuery` as `jq`. |
|
* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; |
|
* var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); |
|
* compiled({ 'users': ['fred', 'barney'] }); |
|
* // => '<li>fred</li><li>barney</li>' |
|
* |
|
* // Use the `sourceURL` option to specify a custom sourceURL for the template. |
|
* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); |
|
* compiled(data); |
|
* // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. |
|
* |
|
* // Use the `variable` option to ensure a with-statement isn't used in the compiled template. |
|
* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); |
|
* compiled.source; |
|
* // => function(data) { |
|
* // var __t, __p = ''; |
|
* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; |
|
* // return __p; |
|
* // } |
|
* |
|
* // Use custom template delimiters. |
|
* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; |
|
* var compiled = _.template('hello {{ user }}!'); |
|
* compiled({ 'user': 'mustache' }); |
|
* // => 'hello mustache!' |
|
* |
|
* // Use the `source` property to inline compiled templates for meaningful |
|
* // line numbers in error messages and stack traces. |
|
* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ |
|
* var JST = {\ |
|
* "main": ' + _.template(mainText).source + '\ |
|
* };\ |
|
* '); |
|
*/ |
|
function template(string, options, guard) { |
|
// Based on John Resig's `tmpl` implementation |
|
// (http://ejohn.org/blog/javascript-micro-templating/) |
|
// and Laura Doktorova's doT.js (https://github.com/olado/doT). |
|
var settings = lodash.templateSettings; |
|
|
|
if (guard && isIterateeCall(string, options, guard)) { |
|
options = undefined; |
|
} |
|
string = toString(string); |
|
options = assignInWith({}, options, settings, customDefaultsAssignIn); |
|
|
|
var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), |
|
importsKeys = keys(imports), |
|
importsValues = baseValues(imports, importsKeys); |
|
|
|
var isEscaping, |
|
isEvaluating, |
|
index = 0, |
|
interpolate = options.interpolate || reNoMatch, |
|
source = "__p += '"; |
|
|
|
// Compile the regexp to match each delimiter. |
|
var reDelimiters = RegExp( |
|
(options.escape || reNoMatch).source + '|' + |
|
interpolate.source + '|' + |
|
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + |
|
(options.evaluate || reNoMatch).source + '|$' |
|
, 'g'); |
|
|
|
// Use a sourceURL for easier debugging. |
|
// The sourceURL gets injected into the source that's eval-ed, so be careful |
|
// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in |
|
// and escape the comment, thus injecting code that gets evaled. |
|
var sourceURL = '//# sourceURL=' + |
|
(hasOwnProperty.call(options, 'sourceURL') |
|
? (options.sourceURL + '').replace(/\s/g, ' ') |
|
: ('lodash.templateSources[' + (++templateCounter) + ']') |
|
) + '\n'; |
|
|
|
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { |
|
interpolateValue || (interpolateValue = esTemplateValue); |
|
|
|
// Escape characters that can't be included in string literals. |
|
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); |
|
|
|
// Replace delimiters with snippets. |
|
if (escapeValue) { |
|
isEscaping = true; |
|
source += "' +\n__e(" + escapeValue + ") +\n'"; |
|
} |
|
if (evaluateValue) { |
|
isEvaluating = true; |
|
source += "';\n" + evaluateValue + ";\n__p += '"; |
|
} |
|
if (interpolateValue) { |
|
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; |
|
} |
|
index = offset + match.length; |
|
|
|
// The JS engine embedded in Adobe products needs `match` returned in |
|
// order to produce the correct `offset` value. |
|
return match; |
|
}); |
|
|
|
source += "';\n"; |
|
|
|
// If `variable` is not specified wrap a with-statement around the generated |
|
// code to add the data object to the top of the scope chain. |
|
var variable = hasOwnProperty.call(options, 'variable') && options.variable; |
|
if (!variable) { |
|
source = 'with (obj) {\n' + source + '\n}\n'; |
|
} |
|
// Throw an error if a forbidden character was found in `variable`, to prevent |
|
// potential command injection attacks. |
|
else if (reForbiddenIdentifierChars.test(variable)) { |
|
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); |
|
} |
|
|
|
// Cleanup code by stripping empty strings. |
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) |
|
.replace(reEmptyStringMiddle, '$1') |
|
.replace(reEmptyStringTrailing, '$1;'); |
|
|
|
// Frame code as the function body. |
|
source = 'function(' + (variable || 'obj') + ') {\n' + |
|
(variable |
|
? '' |
|
: 'obj || (obj = {});\n' |
|
) + |
|
"var __t, __p = ''" + |
|
(isEscaping |
|
? ', __e = _.escape' |
|
: '' |
|
) + |
|
(isEvaluating |
|
? ', __j = Array.prototype.join;\n' + |
|
"function print() { __p += __j.call(arguments, '') }\n" |
|
: ';\n' |
|
) + |
|
source + |
|
'return __p\n}'; |
|
|
|
var result = attempt(function() { |
|
return Function(importsKeys, sourceURL + 'return ' + source) |
|
.apply(undefined, importsValues); |
|
}); |
|
|
|
// Provide the compiled function's source by its `toString` method or |
|
// the `source` property as a convenience for inlining compiled templates. |
|
result.source = source; |
|
if (isError(result)) { |
|
throw result; |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Converts `string`, as a whole, to lower case just like |
|
* [String#toLowerCase](https://mdn.io/toLowerCase). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the lower cased string. |
|
* @example |
|
* |
|
* _.toLower('--Foo-Bar--'); |
|
* // => '--foo-bar--' |
|
* |
|
* _.toLower('fooBar'); |
|
* // => 'foobar' |
|
* |
|
* _.toLower('__FOO_BAR__'); |
|
* // => '__foo_bar__' |
|
*/ |
|
function toLower(value) { |
|
return toString(value).toLowerCase(); |
|
} |
|
|
|
/** |
|
* Converts `string`, as a whole, to upper case just like |
|
* [String#toUpperCase](https://mdn.io/toUpperCase). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the upper cased string. |
|
* @example |
|
* |
|
* _.toUpper('--foo-bar--'); |
|
* // => '--FOO-BAR--' |
|
* |
|
* _.toUpper('fooBar'); |
|
* // => 'FOOBAR' |
|
* |
|
* _.toUpper('__foo_bar__'); |
|
* // => '__FOO_BAR__' |
|
*/ |
|
function toUpper(value) { |
|
return toString(value).toUpperCase(); |
|
} |
|
|
|
/** |
|
* Removes leading and trailing whitespace or specified characters from `string`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to trim. |
|
* @param {string} [chars=whitespace] The characters to trim. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {string} Returns the trimmed string. |
|
* @example |
|
* |
|
* _.trim(' abc '); |
|
* // => 'abc' |
|
* |
|
* _.trim('-_-abc-_-', '_-'); |
|
* // => 'abc' |
|
* |
|
* _.map([' foo ', ' bar '], _.trim); |
|
* // => ['foo', 'bar'] |
|
*/ |
|
function trim(string, chars, guard) { |
|
string = toString(string); |
|
if (string && (guard || chars === undefined)) { |
|
return baseTrim(string); |
|
} |
|
if (!string || !(chars = baseToString(chars))) { |
|
return string; |
|
} |
|
var strSymbols = stringToArray(string), |
|
chrSymbols = stringToArray(chars), |
|
start = charsStartIndex(strSymbols, chrSymbols), |
|
end = charsEndIndex(strSymbols, chrSymbols) + 1; |
|
|
|
return castSlice(strSymbols, start, end).join(''); |
|
} |
|
|
|
/** |
|
* Removes trailing whitespace or specified characters from `string`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to trim. |
|
* @param {string} [chars=whitespace] The characters to trim. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {string} Returns the trimmed string. |
|
* @example |
|
* |
|
* _.trimEnd(' abc '); |
|
* // => ' abc' |
|
* |
|
* _.trimEnd('-_-abc-_-', '_-'); |
|
* // => '-_-abc' |
|
*/ |
|
function trimEnd(string, chars, guard) { |
|
string = toString(string); |
|
if (string && (guard || chars === undefined)) { |
|
return string.slice(0, trimmedEndIndex(string) + 1); |
|
} |
|
if (!string || !(chars = baseToString(chars))) { |
|
return string; |
|
} |
|
var strSymbols = stringToArray(string), |
|
end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; |
|
|
|
return castSlice(strSymbols, 0, end).join(''); |
|
} |
|
|
|
/** |
|
* Removes leading whitespace or specified characters from `string`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to trim. |
|
* @param {string} [chars=whitespace] The characters to trim. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {string} Returns the trimmed string. |
|
* @example |
|
* |
|
* _.trimStart(' abc '); |
|
* // => 'abc ' |
|
* |
|
* _.trimStart('-_-abc-_-', '_-'); |
|
* // => 'abc-_-' |
|
*/ |
|
function trimStart(string, chars, guard) { |
|
string = toString(string); |
|
if (string && (guard || chars === undefined)) { |
|
return string.replace(reTrimStart, ''); |
|
} |
|
if (!string || !(chars = baseToString(chars))) { |
|
return string; |
|
} |
|
var strSymbols = stringToArray(string), |
|
start = charsStartIndex(strSymbols, stringToArray(chars)); |
|
|
|
return castSlice(strSymbols, start).join(''); |
|
} |
|
|
|
/** |
|
* Truncates `string` if it's longer than the given maximum string length. |
|
* The last characters of the truncated string are replaced with the omission |
|
* string which defaults to "...". |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to truncate. |
|
* @param {Object} [options={}] The options object. |
|
* @param {number} [options.length=30] The maximum string length. |
|
* @param {string} [options.omission='...'] The string to indicate text is omitted. |
|
* @param {RegExp|string} [options.separator] The separator pattern to truncate to. |
|
* @returns {string} Returns the truncated string. |
|
* @example |
|
* |
|
* _.truncate('hi-diddly-ho there, neighborino'); |
|
* // => 'hi-diddly-ho there, neighbo...' |
|
* |
|
* _.truncate('hi-diddly-ho there, neighborino', { |
|
* 'length': 24, |
|
* 'separator': ' ' |
|
* }); |
|
* // => 'hi-diddly-ho there,...' |
|
* |
|
* _.truncate('hi-diddly-ho there, neighborino', { |
|
* 'length': 24, |
|
* 'separator': /,? +/ |
|
* }); |
|
* // => 'hi-diddly-ho there...' |
|
* |
|
* _.truncate('hi-diddly-ho there, neighborino', { |
|
* 'omission': ' [...]' |
|
* }); |
|
* // => 'hi-diddly-ho there, neig [...]' |
|
*/ |
|
function truncate(string, options) { |
|
var length = DEFAULT_TRUNC_LENGTH, |
|
omission = DEFAULT_TRUNC_OMISSION; |
|
|
|
if (isObject(options)) { |
|
var separator = 'separator' in options ? options.separator : separator; |
|
length = 'length' in options ? toInteger(options.length) : length; |
|
omission = 'omission' in options ? baseToString(options.omission) : omission; |
|
} |
|
string = toString(string); |
|
|
|
var strLength = string.length; |
|
if (hasUnicode(string)) { |
|
var strSymbols = stringToArray(string); |
|
strLength = strSymbols.length; |
|
} |
|
if (length >= strLength) { |
|
return string; |
|
} |
|
var end = length - stringSize(omission); |
|
if (end < 1) { |
|
return omission; |
|
} |
|
var result = strSymbols |
|
? castSlice(strSymbols, 0, end).join('') |
|
: string.slice(0, end); |
|
|
|
if (separator === undefined) { |
|
return result + omission; |
|
} |
|
if (strSymbols) { |
|
end += (result.length - end); |
|
} |
|
if (isRegExp(separator)) { |
|
if (string.slice(end).search(separator)) { |
|
var match, |
|
substring = result; |
|
|
|
if (!separator.global) { |
|
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); |
|
} |
|
separator.lastIndex = 0; |
|
while ((match = separator.exec(substring))) { |
|
var newEnd = match.index; |
|
} |
|
result = result.slice(0, newEnd === undefined ? end : newEnd); |
|
} |
|
} else if (string.indexOf(baseToString(separator), end) != end) { |
|
var index = result.lastIndexOf(separator); |
|
if (index > -1) { |
|
result = result.slice(0, index); |
|
} |
|
} |
|
return result + omission; |
|
} |
|
|
|
/** |
|
* The inverse of `_.escape`; this method converts the HTML entities |
|
* `&`, `<`, `>`, `"`, and `'` in `string` to |
|
* their corresponding characters. |
|
* |
|
* **Note:** No other HTML entities are unescaped. To unescape additional |
|
* HTML entities use a third-party library like [_he_](https://mths.be/he). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 0.6.0 |
|
* @category String |
|
* @param {string} [string=''] The string to unescape. |
|
* @returns {string} Returns the unescaped string. |
|
* @example |
|
* |
|
* _.unescape('fred, barney, & pebbles'); |
|
* // => 'fred, barney, & pebbles' |
|
*/ |
|
function unescape(string) { |
|
string = toString(string); |
|
return (string && reHasEscapedHtml.test(string)) |
|
? string.replace(reEscapedHtml, unescapeHtmlChar) |
|
: string; |
|
} |
|
|
|
/** |
|
* Converts `string`, as space separated words, to upper case. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the upper cased string. |
|
* @example |
|
* |
|
* _.upperCase('--foo-bar'); |
|
* // => 'FOO BAR' |
|
* |
|
* _.upperCase('fooBar'); |
|
* // => 'FOO BAR' |
|
* |
|
* _.upperCase('__foo_bar__'); |
|
* // => 'FOO BAR' |
|
*/ |
|
var upperCase = createCompounder(function(result, word, index) { |
|
return result + (index ? ' ' : '') + word.toUpperCase(); |
|
}); |
|
|
|
/** |
|
* Converts the first character of `string` to upper case. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to convert. |
|
* @returns {string} Returns the converted string. |
|
* @example |
|
* |
|
* _.upperFirst('fred'); |
|
* // => 'Fred' |
|
* |
|
* _.upperFirst('FRED'); |
|
* // => 'FRED' |
|
*/ |
|
var upperFirst = createCaseFirst('toUpperCase'); |
|
|
|
/** |
|
* Splits `string` into an array of its words. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category String |
|
* @param {string} [string=''] The string to inspect. |
|
* @param {RegExp|string} [pattern] The pattern to match words. |
|
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. |
|
* @returns {Array} Returns the words of `string`. |
|
* @example |
|
* |
|
* _.words('fred, barney, & pebbles'); |
|
* // => ['fred', 'barney', 'pebbles'] |
|
* |
|
* _.words('fred, barney, & pebbles', /[^, ]+/g); |
|
* // => ['fred', 'barney', '&', 'pebbles'] |
|
*/ |
|
function words(string, pattern, guard) { |
|
string = toString(string); |
|
pattern = guard ? undefined : pattern; |
|
|
|
if (pattern === undefined) { |
|
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); |
|
} |
|
return string.match(pattern) || []; |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Attempts to invoke `func`, returning either the result or the caught error |
|
* object. Any additional arguments are provided to `func` when it's invoked. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Util |
|
* @param {Function} func The function to attempt. |
|
* @param {...*} [args] The arguments to invoke `func` with. |
|
* @returns {*} Returns the `func` result or error object. |
|
* @example |
|
* |
|
* // Avoid throwing errors for invalid selectors. |
|
* var elements = _.attempt(function(selector) { |
|
* return document.querySelectorAll(selector); |
|
* }, '>_>'); |
|
* |
|
* if (_.isError(elements)) { |
|
* elements = []; |
|
* } |
|
*/ |
|
var attempt = baseRest(function(func, args) { |
|
try { |
|
return apply(func, undefined, args); |
|
} catch (e) { |
|
return isError(e) ? e : new Error(e); |
|
} |
|
}); |
|
|
|
/** |
|
* Binds methods of an object to the object itself, overwriting the existing |
|
* method. |
|
* |
|
* **Note:** This method doesn't set the "length" property of bound functions. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {Object} object The object to bind and assign the bound methods to. |
|
* @param {...(string|string[])} methodNames The object method names to bind. |
|
* @returns {Object} Returns `object`. |
|
* @example |
|
* |
|
* var view = { |
|
* 'label': 'docs', |
|
* 'click': function() { |
|
* console.log('clicked ' + this.label); |
|
* } |
|
* }; |
|
* |
|
* _.bindAll(view, ['click']); |
|
* jQuery(element).on('click', view.click); |
|
* // => Logs 'clicked docs' when clicked. |
|
*/ |
|
var bindAll = flatRest(function(object, methodNames) { |
|
arrayEach(methodNames, function(key) { |
|
key = toKey(key); |
|
baseAssignValue(object, key, bind(object[key], object)); |
|
}); |
|
return object; |
|
}); |
|
|
|
/** |
|
* Creates a function that iterates over `pairs` and invokes the corresponding |
|
* function of the first predicate to return truthy. The predicate-function |
|
* pairs are invoked with the `this` binding and arguments of the created |
|
* function. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {Array} pairs The predicate-function pairs. |
|
* @returns {Function} Returns the new composite function. |
|
* @example |
|
* |
|
* var func = _.cond([ |
|
* [_.matches({ 'a': 1 }), _.constant('matches A')], |
|
* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], |
|
* [_.stubTrue, _.constant('no match')] |
|
* ]); |
|
* |
|
* func({ 'a': 1, 'b': 2 }); |
|
* // => 'matches A' |
|
* |
|
* func({ 'a': 0, 'b': 1 }); |
|
* // => 'matches B' |
|
* |
|
* func({ 'a': '1', 'b': '2' }); |
|
* // => 'no match' |
|
*/ |
|
function cond(pairs) { |
|
var length = pairs == null ? 0 : pairs.length, |
|
toIteratee = getIteratee(); |
|
|
|
pairs = !length ? [] : arrayMap(pairs, function(pair) { |
|
if (typeof pair[1] != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
return [toIteratee(pair[0]), pair[1]]; |
|
}); |
|
|
|
return baseRest(function(args) { |
|
var index = -1; |
|
while (++index < length) { |
|
var pair = pairs[index]; |
|
if (apply(pair[0], this, args)) { |
|
return apply(pair[1], this, args); |
|
} |
|
} |
|
}); |
|
} |
|
|
|
/** |
|
* Creates a function that invokes the predicate properties of `source` with |
|
* the corresponding property values of a given object, returning `true` if |
|
* all predicates return truthy, else `false`. |
|
* |
|
* **Note:** The created function is equivalent to `_.conformsTo` with |
|
* `source` partially applied. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {Object} source The object of property predicates to conform to. |
|
* @returns {Function} Returns the new spec function. |
|
* @example |
|
* |
|
* var objects = [ |
|
* { 'a': 2, 'b': 1 }, |
|
* { 'a': 1, 'b': 2 } |
|
* ]; |
|
* |
|
* _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); |
|
* // => [{ 'a': 1, 'b': 2 }] |
|
*/ |
|
function conforms(source) { |
|
return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); |
|
} |
|
|
|
/** |
|
* Creates a function that returns `value`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.4.0 |
|
* @category Util |
|
* @param {*} value The value to return from the new function. |
|
* @returns {Function} Returns the new constant function. |
|
* @example |
|
* |
|
* var objects = _.times(2, _.constant({ 'a': 1 })); |
|
* |
|
* console.log(objects); |
|
* // => [{ 'a': 1 }, { 'a': 1 }] |
|
* |
|
* console.log(objects[0] === objects[1]); |
|
* // => true |
|
*/ |
|
function constant(value) { |
|
return function() { |
|
return value; |
|
}; |
|
} |
|
|
|
/** |
|
* Checks `value` to determine whether a default value should be returned in |
|
* its place. The `defaultValue` is returned if `value` is `NaN`, `null`, |
|
* or `undefined`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.14.0 |
|
* @category Util |
|
* @param {*} value The value to check. |
|
* @param {*} defaultValue The default value. |
|
* @returns {*} Returns the resolved value. |
|
* @example |
|
* |
|
* _.defaultTo(1, 10); |
|
* // => 1 |
|
* |
|
* _.defaultTo(undefined, 10); |
|
* // => 10 |
|
*/ |
|
function defaultTo(value, defaultValue) { |
|
return (value == null || value !== value) ? defaultValue : value; |
|
} |
|
|
|
/** |
|
* Creates a function that returns the result of invoking the given functions |
|
* with the `this` binding of the created function, where each successive |
|
* invocation is supplied the return value of the previous. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Util |
|
* @param {...(Function|Function[])} [funcs] The functions to invoke. |
|
* @returns {Function} Returns the new composite function. |
|
* @see _.flowRight |
|
* @example |
|
* |
|
* function square(n) { |
|
* return n * n; |
|
* } |
|
* |
|
* var addSquare = _.flow([_.add, square]); |
|
* addSquare(1, 2); |
|
* // => 9 |
|
*/ |
|
var flow = createFlow(); |
|
|
|
/** |
|
* This method is like `_.flow` except that it creates a function that |
|
* invokes the given functions from right to left. |
|
* |
|
* @static |
|
* @since 3.0.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {...(Function|Function[])} [funcs] The functions to invoke. |
|
* @returns {Function} Returns the new composite function. |
|
* @see _.flow |
|
* @example |
|
* |
|
* function square(n) { |
|
* return n * n; |
|
* } |
|
* |
|
* var addSquare = _.flowRight([square, _.add]); |
|
* addSquare(1, 2); |
|
* // => 9 |
|
*/ |
|
var flowRight = createFlow(true); |
|
|
|
/** |
|
* This method returns the first argument it receives. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {*} value Any value. |
|
* @returns {*} Returns `value`. |
|
* @example |
|
* |
|
* var object = { 'a': 1 }; |
|
* |
|
* console.log(_.identity(object) === object); |
|
* // => true |
|
*/ |
|
function identity(value) { |
|
return value; |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `func` with the arguments of the created |
|
* function. If `func` is a property name, the created function returns the |
|
* property value for a given element. If `func` is an array or object, the |
|
* created function returns `true` for elements that contain the equivalent |
|
* source properties, otherwise it returns `false`. |
|
* |
|
* @static |
|
* @since 4.0.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {*} [func=_.identity] The value to convert to a callback. |
|
* @returns {Function} Returns the callback. |
|
* @example |
|
* |
|
* var users = [ |
|
* { 'user': 'barney', 'age': 36, 'active': true }, |
|
* { 'user': 'fred', 'age': 40, 'active': false } |
|
* ]; |
|
* |
|
* // The `_.matches` iteratee shorthand. |
|
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); |
|
* // => [{ 'user': 'barney', 'age': 36, 'active': true }] |
|
* |
|
* // The `_.matchesProperty` iteratee shorthand. |
|
* _.filter(users, _.iteratee(['user', 'fred'])); |
|
* // => [{ 'user': 'fred', 'age': 40 }] |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.map(users, _.iteratee('user')); |
|
* // => ['barney', 'fred'] |
|
* |
|
* // Create custom iteratee shorthands. |
|
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { |
|
* return !_.isRegExp(func) ? iteratee(func) : function(string) { |
|
* return func.test(string); |
|
* }; |
|
* }); |
|
* |
|
* _.filter(['abc', 'def'], /ef/); |
|
* // => ['def'] |
|
*/ |
|
function iteratee(func) { |
|
return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); |
|
} |
|
|
|
/** |
|
* Creates a function that performs a partial deep comparison between a given |
|
* object and `source`, returning `true` if the given object has equivalent |
|
* property values, else `false`. |
|
* |
|
* **Note:** The created function is equivalent to `_.isMatch` with `source` |
|
* partially applied. |
|
* |
|
* Partial comparisons will match empty array and empty object `source` |
|
* values against any array or object value, respectively. See `_.isEqual` |
|
* for a list of supported value comparisons. |
|
* |
|
* **Note:** Multiple values can be checked by combining several matchers |
|
* using `_.overSome` |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Util |
|
* @param {Object} source The object of property values to match. |
|
* @returns {Function} Returns the new spec function. |
|
* @example |
|
* |
|
* var objects = [ |
|
* { 'a': 1, 'b': 2, 'c': 3 }, |
|
* { 'a': 4, 'b': 5, 'c': 6 } |
|
* ]; |
|
* |
|
* _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); |
|
* // => [{ 'a': 4, 'b': 5, 'c': 6 }] |
|
* |
|
* // Checking for several possible values |
|
* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); |
|
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] |
|
*/ |
|
function matches(source) { |
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); |
|
} |
|
|
|
/** |
|
* Creates a function that performs a partial deep comparison between the |
|
* value at `path` of a given object to `srcValue`, returning `true` if the |
|
* object value is equivalent, else `false`. |
|
* |
|
* **Note:** Partial comparisons will match empty array and empty object |
|
* `srcValue` values against any array or object value, respectively. See |
|
* `_.isEqual` for a list of supported value comparisons. |
|
* |
|
* **Note:** Multiple values can be checked by combining several matchers |
|
* using `_.overSome` |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.2.0 |
|
* @category Util |
|
* @param {Array|string} path The path of the property to get. |
|
* @param {*} srcValue The value to match. |
|
* @returns {Function} Returns the new spec function. |
|
* @example |
|
* |
|
* var objects = [ |
|
* { 'a': 1, 'b': 2, 'c': 3 }, |
|
* { 'a': 4, 'b': 5, 'c': 6 } |
|
* ]; |
|
* |
|
* _.find(objects, _.matchesProperty('a', 4)); |
|
* // => { 'a': 4, 'b': 5, 'c': 6 } |
|
* |
|
* // Checking for several possible values |
|
* _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); |
|
* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] |
|
*/ |
|
function matchesProperty(path, srcValue) { |
|
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); |
|
} |
|
|
|
/** |
|
* Creates a function that invokes the method at `path` of a given object. |
|
* Any additional arguments are provided to the invoked method. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.7.0 |
|
* @category Util |
|
* @param {Array|string} path The path of the method to invoke. |
|
* @param {...*} [args] The arguments to invoke the method with. |
|
* @returns {Function} Returns the new invoker function. |
|
* @example |
|
* |
|
* var objects = [ |
|
* { 'a': { 'b': _.constant(2) } }, |
|
* { 'a': { 'b': _.constant(1) } } |
|
* ]; |
|
* |
|
* _.map(objects, _.method('a.b')); |
|
* // => [2, 1] |
|
* |
|
* _.map(objects, _.method(['a', 'b'])); |
|
* // => [2, 1] |
|
*/ |
|
var method = baseRest(function(path, args) { |
|
return function(object) { |
|
return baseInvoke(object, path, args); |
|
}; |
|
}); |
|
|
|
/** |
|
* The opposite of `_.method`; this method creates a function that invokes |
|
* the method at a given path of `object`. Any additional arguments are |
|
* provided to the invoked method. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.7.0 |
|
* @category Util |
|
* @param {Object} object The object to query. |
|
* @param {...*} [args] The arguments to invoke the method with. |
|
* @returns {Function} Returns the new invoker function. |
|
* @example |
|
* |
|
* var array = _.times(3, _.constant), |
|
* object = { 'a': array, 'b': array, 'c': array }; |
|
* |
|
* _.map(['a[2]', 'c[0]'], _.methodOf(object)); |
|
* // => [2, 0] |
|
* |
|
* _.map([['a', '2'], ['c', '0']], _.methodOf(object)); |
|
* // => [2, 0] |
|
*/ |
|
var methodOf = baseRest(function(object, args) { |
|
return function(path) { |
|
return baseInvoke(object, path, args); |
|
}; |
|
}); |
|
|
|
/** |
|
* Adds all own enumerable string keyed function properties of a source |
|
* object to the destination object. If `object` is a function, then methods |
|
* are added to its prototype as well. |
|
* |
|
* **Note:** Use `_.runInContext` to create a pristine `lodash` function to |
|
* avoid conflicts caused by modifying the original. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {Function|Object} [object=lodash] The destination object. |
|
* @param {Object} source The object of functions to add. |
|
* @param {Object} [options={}] The options object. |
|
* @param {boolean} [options.chain=true] Specify whether mixins are chainable. |
|
* @returns {Function|Object} Returns `object`. |
|
* @example |
|
* |
|
* function vowels(string) { |
|
* return _.filter(string, function(v) { |
|
* return /[aeiou]/i.test(v); |
|
* }); |
|
* } |
|
* |
|
* _.mixin({ 'vowels': vowels }); |
|
* _.vowels('fred'); |
|
* // => ['e'] |
|
* |
|
* _('fred').vowels().value(); |
|
* // => ['e'] |
|
* |
|
* _.mixin({ 'vowels': vowels }, { 'chain': false }); |
|
* _('fred').vowels(); |
|
* // => ['e'] |
|
*/ |
|
function mixin(object, source, options) { |
|
var props = keys(source), |
|
methodNames = baseFunctions(source, props); |
|
|
|
if (options == null && |
|
!(isObject(source) && (methodNames.length || !props.length))) { |
|
options = source; |
|
source = object; |
|
object = this; |
|
methodNames = baseFunctions(source, keys(source)); |
|
} |
|
var chain = !(isObject(options) && 'chain' in options) || !!options.chain, |
|
isFunc = isFunction(object); |
|
|
|
arrayEach(methodNames, function(methodName) { |
|
var func = source[methodName]; |
|
object[methodName] = func; |
|
if (isFunc) { |
|
object.prototype[methodName] = function() { |
|
var chainAll = this.__chain__; |
|
if (chain || chainAll) { |
|
var result = object(this.__wrapped__), |
|
actions = result.__actions__ = copyArray(this.__actions__); |
|
|
|
actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); |
|
result.__chain__ = chainAll; |
|
return result; |
|
} |
|
return func.apply(object, arrayPush([this.value()], arguments)); |
|
}; |
|
} |
|
}); |
|
|
|
return object; |
|
} |
|
|
|
/** |
|
* Reverts the `_` variable to its previous value and returns a reference to |
|
* the `lodash` function. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @returns {Function} Returns the `lodash` function. |
|
* @example |
|
* |
|
* var lodash = _.noConflict(); |
|
*/ |
|
function noConflict() { |
|
if (root._ === this) { |
|
root._ = oldDash; |
|
} |
|
return this; |
|
} |
|
|
|
/** |
|
* This method returns `undefined`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.3.0 |
|
* @category Util |
|
* @example |
|
* |
|
* _.times(2, _.noop); |
|
* // => [undefined, undefined] |
|
*/ |
|
function noop() { |
|
// No operation performed. |
|
} |
|
|
|
/** |
|
* Creates a function that gets the argument at index `n`. If `n` is negative, |
|
* the nth argument from the end is returned. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {number} [n=0] The index of the argument to return. |
|
* @returns {Function} Returns the new pass-thru function. |
|
* @example |
|
* |
|
* var func = _.nthArg(1); |
|
* func('a', 'b', 'c', 'd'); |
|
* // => 'b' |
|
* |
|
* var func = _.nthArg(-2); |
|
* func('a', 'b', 'c', 'd'); |
|
* // => 'c' |
|
*/ |
|
function nthArg(n) { |
|
n = toInteger(n); |
|
return baseRest(function(args) { |
|
return baseNth(args, n); |
|
}); |
|
} |
|
|
|
/** |
|
* Creates a function that invokes `iteratees` with the arguments it receives |
|
* and returns their results. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {...(Function|Function[])} [iteratees=[_.identity]] |
|
* The iteratees to invoke. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* var func = _.over([Math.max, Math.min]); |
|
* |
|
* func(1, 2, 3, 4); |
|
* // => [4, 1] |
|
*/ |
|
var over = createOver(arrayMap); |
|
|
|
/** |
|
* Creates a function that checks if **all** of the `predicates` return |
|
* truthy when invoked with the arguments it receives. |
|
* |
|
* Following shorthands are possible for providing predicates. |
|
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. |
|
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {...(Function|Function[])} [predicates=[_.identity]] |
|
* The predicates to check. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* var func = _.overEvery([Boolean, isFinite]); |
|
* |
|
* func('1'); |
|
* // => true |
|
* |
|
* func(null); |
|
* // => false |
|
* |
|
* func(NaN); |
|
* // => false |
|
*/ |
|
var overEvery = createOver(arrayEvery); |
|
|
|
/** |
|
* Creates a function that checks if **any** of the `predicates` return |
|
* truthy when invoked with the arguments it receives. |
|
* |
|
* Following shorthands are possible for providing predicates. |
|
* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. |
|
* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {...(Function|Function[])} [predicates=[_.identity]] |
|
* The predicates to check. |
|
* @returns {Function} Returns the new function. |
|
* @example |
|
* |
|
* var func = _.overSome([Boolean, isFinite]); |
|
* |
|
* func('1'); |
|
* // => true |
|
* |
|
* func(null); |
|
* // => true |
|
* |
|
* func(NaN); |
|
* // => false |
|
* |
|
* var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) |
|
* var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) |
|
*/ |
|
var overSome = createOver(arraySome); |
|
|
|
/** |
|
* Creates a function that returns the value at `path` of a given object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 2.4.0 |
|
* @category Util |
|
* @param {Array|string} path The path of the property to get. |
|
* @returns {Function} Returns the new accessor function. |
|
* @example |
|
* |
|
* var objects = [ |
|
* { 'a': { 'b': 2 } }, |
|
* { 'a': { 'b': 1 } } |
|
* ]; |
|
* |
|
* _.map(objects, _.property('a.b')); |
|
* // => [2, 1] |
|
* |
|
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); |
|
* // => [1, 2] |
|
*/ |
|
function property(path) { |
|
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); |
|
} |
|
|
|
/** |
|
* The opposite of `_.property`; this method creates a function that returns |
|
* the value at a given path of `object`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.0.0 |
|
* @category Util |
|
* @param {Object} object The object to query. |
|
* @returns {Function} Returns the new accessor function. |
|
* @example |
|
* |
|
* var array = [0, 1, 2], |
|
* object = { 'a': array, 'b': array, 'c': array }; |
|
* |
|
* _.map(['a[2]', 'c[0]'], _.propertyOf(object)); |
|
* // => [2, 0] |
|
* |
|
* _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); |
|
* // => [2, 0] |
|
*/ |
|
function propertyOf(object) { |
|
return function(path) { |
|
return object == null ? undefined : baseGet(object, path); |
|
}; |
|
} |
|
|
|
/** |
|
* Creates an array of numbers (positive and/or negative) progressing from |
|
* `start` up to, but not including, `end`. A step of `-1` is used if a negative |
|
* `start` is specified without an `end` or `step`. If `end` is not specified, |
|
* it's set to `start` with `start` then set to `0`. |
|
* |
|
* **Note:** JavaScript follows the IEEE-754 standard for resolving |
|
* floating-point values which can produce unexpected results. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {number} [start=0] The start of the range. |
|
* @param {number} end The end of the range. |
|
* @param {number} [step=1] The value to increment or decrement by. |
|
* @returns {Array} Returns the range of numbers. |
|
* @see _.inRange, _.rangeRight |
|
* @example |
|
* |
|
* _.range(4); |
|
* // => [0, 1, 2, 3] |
|
* |
|
* _.range(-4); |
|
* // => [0, -1, -2, -3] |
|
* |
|
* _.range(1, 5); |
|
* // => [1, 2, 3, 4] |
|
* |
|
* _.range(0, 20, 5); |
|
* // => [0, 5, 10, 15] |
|
* |
|
* _.range(0, -4, -1); |
|
* // => [0, -1, -2, -3] |
|
* |
|
* _.range(1, 4, 0); |
|
* // => [1, 1, 1] |
|
* |
|
* _.range(0); |
|
* // => [] |
|
*/ |
|
var range = createRange(); |
|
|
|
/** |
|
* This method is like `_.range` except that it populates values in |
|
* descending order. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {number} [start=0] The start of the range. |
|
* @param {number} end The end of the range. |
|
* @param {number} [step=1] The value to increment or decrement by. |
|
* @returns {Array} Returns the range of numbers. |
|
* @see _.inRange, _.range |
|
* @example |
|
* |
|
* _.rangeRight(4); |
|
* // => [3, 2, 1, 0] |
|
* |
|
* _.rangeRight(-4); |
|
* // => [-3, -2, -1, 0] |
|
* |
|
* _.rangeRight(1, 5); |
|
* // => [4, 3, 2, 1] |
|
* |
|
* _.rangeRight(0, 20, 5); |
|
* // => [15, 10, 5, 0] |
|
* |
|
* _.rangeRight(0, -4, -1); |
|
* // => [-3, -2, -1, 0] |
|
* |
|
* _.rangeRight(1, 4, 0); |
|
* // => [1, 1, 1] |
|
* |
|
* _.rangeRight(0); |
|
* // => [] |
|
*/ |
|
var rangeRight = createRange(true); |
|
|
|
/** |
|
* This method returns a new empty array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.13.0 |
|
* @category Util |
|
* @returns {Array} Returns the new empty array. |
|
* @example |
|
* |
|
* var arrays = _.times(2, _.stubArray); |
|
* |
|
* console.log(arrays); |
|
* // => [[], []] |
|
* |
|
* console.log(arrays[0] === arrays[1]); |
|
* // => false |
|
*/ |
|
function stubArray() { |
|
return []; |
|
} |
|
|
|
/** |
|
* This method returns `false`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.13.0 |
|
* @category Util |
|
* @returns {boolean} Returns `false`. |
|
* @example |
|
* |
|
* _.times(2, _.stubFalse); |
|
* // => [false, false] |
|
*/ |
|
function stubFalse() { |
|
return false; |
|
} |
|
|
|
/** |
|
* This method returns a new empty object. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.13.0 |
|
* @category Util |
|
* @returns {Object} Returns the new empty object. |
|
* @example |
|
* |
|
* var objects = _.times(2, _.stubObject); |
|
* |
|
* console.log(objects); |
|
* // => [{}, {}] |
|
* |
|
* console.log(objects[0] === objects[1]); |
|
* // => false |
|
*/ |
|
function stubObject() { |
|
return {}; |
|
} |
|
|
|
/** |
|
* This method returns an empty string. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.13.0 |
|
* @category Util |
|
* @returns {string} Returns the empty string. |
|
* @example |
|
* |
|
* _.times(2, _.stubString); |
|
* // => ['', ''] |
|
*/ |
|
function stubString() { |
|
return ''; |
|
} |
|
|
|
/** |
|
* This method returns `true`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.13.0 |
|
* @category Util |
|
* @returns {boolean} Returns `true`. |
|
* @example |
|
* |
|
* _.times(2, _.stubTrue); |
|
* // => [true, true] |
|
*/ |
|
function stubTrue() { |
|
return true; |
|
} |
|
|
|
/** |
|
* Invokes the iteratee `n` times, returning an array of the results of |
|
* each invocation. The iteratee is invoked with one argument; (index). |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {number} n The number of times to invoke `iteratee`. |
|
* @param {Function} [iteratee=_.identity] The function invoked per iteration. |
|
* @returns {Array} Returns the array of results. |
|
* @example |
|
* |
|
* _.times(3, String); |
|
* // => ['0', '1', '2'] |
|
* |
|
* _.times(4, _.constant(0)); |
|
* // => [0, 0, 0, 0] |
|
*/ |
|
function times(n, iteratee) { |
|
n = toInteger(n); |
|
if (n < 1 || n > MAX_SAFE_INTEGER) { |
|
return []; |
|
} |
|
var index = MAX_ARRAY_LENGTH, |
|
length = nativeMin(n, MAX_ARRAY_LENGTH); |
|
|
|
iteratee = getIteratee(iteratee); |
|
n -= MAX_ARRAY_LENGTH; |
|
|
|
var result = baseTimes(length, iteratee); |
|
while (++index < n) { |
|
iteratee(index); |
|
} |
|
return result; |
|
} |
|
|
|
/** |
|
* Converts `value` to a property path array. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Util |
|
* @param {*} value The value to convert. |
|
* @returns {Array} Returns the new property path array. |
|
* @example |
|
* |
|
* _.toPath('a.b.c'); |
|
* // => ['a', 'b', 'c'] |
|
* |
|
* _.toPath('a[0].b.c'); |
|
* // => ['a', '0', 'b', 'c'] |
|
*/ |
|
function toPath(value) { |
|
if (isArray(value)) { |
|
return arrayMap(value, toKey); |
|
} |
|
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); |
|
} |
|
|
|
/** |
|
* Generates a unique ID. If `prefix` is given, the ID is appended to it. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Util |
|
* @param {string} [prefix=''] The value to prefix the ID with. |
|
* @returns {string} Returns the unique ID. |
|
* @example |
|
* |
|
* _.uniqueId('contact_'); |
|
* // => 'contact_104' |
|
* |
|
* _.uniqueId(); |
|
* // => '105' |
|
*/ |
|
function uniqueId(prefix) { |
|
var id = ++idCounter; |
|
return toString(prefix) + id; |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* Adds two numbers. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.4.0 |
|
* @category Math |
|
* @param {number} augend The first number in an addition. |
|
* @param {number} addend The second number in an addition. |
|
* @returns {number} Returns the total. |
|
* @example |
|
* |
|
* _.add(6, 4); |
|
* // => 10 |
|
*/ |
|
var add = createMathOperation(function(augend, addend) { |
|
return augend + addend; |
|
}, 0); |
|
|
|
/** |
|
* Computes `number` rounded up to `precision`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.10.0 |
|
* @category Math |
|
* @param {number} number The number to round up. |
|
* @param {number} [precision=0] The precision to round up to. |
|
* @returns {number} Returns the rounded up number. |
|
* @example |
|
* |
|
* _.ceil(4.006); |
|
* // => 5 |
|
* |
|
* _.ceil(6.004, 2); |
|
* // => 6.01 |
|
* |
|
* _.ceil(6040, -2); |
|
* // => 6100 |
|
*/ |
|
var ceil = createRound('ceil'); |
|
|
|
/** |
|
* Divide two numbers. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.7.0 |
|
* @category Math |
|
* @param {number} dividend The first number in a division. |
|
* @param {number} divisor The second number in a division. |
|
* @returns {number} Returns the quotient. |
|
* @example |
|
* |
|
* _.divide(6, 4); |
|
* // => 1.5 |
|
*/ |
|
var divide = createMathOperation(function(dividend, divisor) { |
|
return dividend / divisor; |
|
}, 1); |
|
|
|
/** |
|
* Computes `number` rounded down to `precision`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.10.0 |
|
* @category Math |
|
* @param {number} number The number to round down. |
|
* @param {number} [precision=0] The precision to round down to. |
|
* @returns {number} Returns the rounded down number. |
|
* @example |
|
* |
|
* _.floor(4.006); |
|
* // => 4 |
|
* |
|
* _.floor(0.046, 2); |
|
* // => 0.04 |
|
* |
|
* _.floor(4060, -2); |
|
* // => 4000 |
|
*/ |
|
var floor = createRound('floor'); |
|
|
|
/** |
|
* Computes the maximum value of `array`. If `array` is empty or falsey, |
|
* `undefined` is returned. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @returns {*} Returns the maximum value. |
|
* @example |
|
* |
|
* _.max([4, 2, 8, 6]); |
|
* // => 8 |
|
* |
|
* _.max([]); |
|
* // => undefined |
|
*/ |
|
function max(array) { |
|
return (array && array.length) |
|
? baseExtremum(array, identity, baseGt) |
|
: undefined; |
|
} |
|
|
|
/** |
|
* This method is like `_.max` except that it accepts `iteratee` which is |
|
* invoked for each element in `array` to generate the criterion by which |
|
* the value is ranked. The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {*} Returns the maximum value. |
|
* @example |
|
* |
|
* var objects = [{ 'n': 1 }, { 'n': 2 }]; |
|
* |
|
* _.maxBy(objects, function(o) { return o.n; }); |
|
* // => { 'n': 2 } |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.maxBy(objects, 'n'); |
|
* // => { 'n': 2 } |
|
*/ |
|
function maxBy(array, iteratee) { |
|
return (array && array.length) |
|
? baseExtremum(array, getIteratee(iteratee, 2), baseGt) |
|
: undefined; |
|
} |
|
|
|
/** |
|
* Computes the mean of the values in `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @returns {number} Returns the mean. |
|
* @example |
|
* |
|
* _.mean([4, 2, 8, 6]); |
|
* // => 5 |
|
*/ |
|
function mean(array) { |
|
return baseMean(array, identity); |
|
} |
|
|
|
/** |
|
* This method is like `_.mean` except that it accepts `iteratee` which is |
|
* invoked for each element in `array` to generate the value to be averaged. |
|
* The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.7.0 |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {number} Returns the mean. |
|
* @example |
|
* |
|
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; |
|
* |
|
* _.meanBy(objects, function(o) { return o.n; }); |
|
* // => 5 |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.meanBy(objects, 'n'); |
|
* // => 5 |
|
*/ |
|
function meanBy(array, iteratee) { |
|
return baseMean(array, getIteratee(iteratee, 2)); |
|
} |
|
|
|
/** |
|
* Computes the minimum value of `array`. If `array` is empty or falsey, |
|
* `undefined` is returned. |
|
* |
|
* @static |
|
* @since 0.1.0 |
|
* @memberOf _ |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @returns {*} Returns the minimum value. |
|
* @example |
|
* |
|
* _.min([4, 2, 8, 6]); |
|
* // => 2 |
|
* |
|
* _.min([]); |
|
* // => undefined |
|
*/ |
|
function min(array) { |
|
return (array && array.length) |
|
? baseExtremum(array, identity, baseLt) |
|
: undefined; |
|
} |
|
|
|
/** |
|
* This method is like `_.min` except that it accepts `iteratee` which is |
|
* invoked for each element in `array` to generate the criterion by which |
|
* the value is ranked. The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {*} Returns the minimum value. |
|
* @example |
|
* |
|
* var objects = [{ 'n': 1 }, { 'n': 2 }]; |
|
* |
|
* _.minBy(objects, function(o) { return o.n; }); |
|
* // => { 'n': 1 } |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.minBy(objects, 'n'); |
|
* // => { 'n': 1 } |
|
*/ |
|
function minBy(array, iteratee) { |
|
return (array && array.length) |
|
? baseExtremum(array, getIteratee(iteratee, 2), baseLt) |
|
: undefined; |
|
} |
|
|
|
/** |
|
* Multiply two numbers. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.7.0 |
|
* @category Math |
|
* @param {number} multiplier The first number in a multiplication. |
|
* @param {number} multiplicand The second number in a multiplication. |
|
* @returns {number} Returns the product. |
|
* @example |
|
* |
|
* _.multiply(6, 4); |
|
* // => 24 |
|
*/ |
|
var multiply = createMathOperation(function(multiplier, multiplicand) { |
|
return multiplier * multiplicand; |
|
}, 1); |
|
|
|
/** |
|
* Computes `number` rounded to `precision`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.10.0 |
|
* @category Math |
|
* @param {number} number The number to round. |
|
* @param {number} [precision=0] The precision to round to. |
|
* @returns {number} Returns the rounded number. |
|
* @example |
|
* |
|
* _.round(4.006); |
|
* // => 4 |
|
* |
|
* _.round(4.006, 2); |
|
* // => 4.01 |
|
* |
|
* _.round(4060, -2); |
|
* // => 4100 |
|
*/ |
|
var round = createRound('round'); |
|
|
|
/** |
|
* Subtract two numbers. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Math |
|
* @param {number} minuend The first number in a subtraction. |
|
* @param {number} subtrahend The second number in a subtraction. |
|
* @returns {number} Returns the difference. |
|
* @example |
|
* |
|
* _.subtract(6, 4); |
|
* // => 2 |
|
*/ |
|
var subtract = createMathOperation(function(minuend, subtrahend) { |
|
return minuend - subtrahend; |
|
}, 0); |
|
|
|
/** |
|
* Computes the sum of the values in `array`. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 3.4.0 |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @returns {number} Returns the sum. |
|
* @example |
|
* |
|
* _.sum([4, 2, 8, 6]); |
|
* // => 20 |
|
*/ |
|
function sum(array) { |
|
return (array && array.length) |
|
? baseSum(array, identity) |
|
: 0; |
|
} |
|
|
|
/** |
|
* This method is like `_.sum` except that it accepts `iteratee` which is |
|
* invoked for each element in `array` to generate the value to be summed. |
|
* The iteratee is invoked with one argument: (value). |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @since 4.0.0 |
|
* @category Math |
|
* @param {Array} array The array to iterate over. |
|
* @param {Function} [iteratee=_.identity] The iteratee invoked per element. |
|
* @returns {number} Returns the sum. |
|
* @example |
|
* |
|
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; |
|
* |
|
* _.sumBy(objects, function(o) { return o.n; }); |
|
* // => 20 |
|
* |
|
* // The `_.property` iteratee shorthand. |
|
* _.sumBy(objects, 'n'); |
|
* // => 20 |
|
*/ |
|
function sumBy(array, iteratee) { |
|
return (array && array.length) |
|
? baseSum(array, getIteratee(iteratee, 2)) |
|
: 0; |
|
} |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
// Add methods that return wrapped values in chain sequences. |
|
lodash.after = after; |
|
lodash.ary = ary; |
|
lodash.assign = assign; |
|
lodash.assignIn = assignIn; |
|
lodash.assignInWith = assignInWith; |
|
lodash.assignWith = assignWith; |
|
lodash.at = at; |
|
lodash.before = before; |
|
lodash.bind = bind; |
|
lodash.bindAll = bindAll; |
|
lodash.bindKey = bindKey; |
|
lodash.castArray = castArray; |
|
lodash.chain = chain; |
|
lodash.chunk = chunk; |
|
lodash.compact = compact; |
|
lodash.concat = concat; |
|
lodash.cond = cond; |
|
lodash.conforms = conforms; |
|
lodash.constant = constant; |
|
lodash.countBy = countBy; |
|
lodash.create = create; |
|
lodash.curry = curry; |
|
lodash.curryRight = curryRight; |
|
lodash.debounce = debounce; |
|
lodash.defaults = defaults; |
|
lodash.defaultsDeep = defaultsDeep; |
|
lodash.defer = defer; |
|
lodash.delay = delay; |
|
lodash.difference = difference; |
|
lodash.differenceBy = differenceBy; |
|
lodash.differenceWith = differenceWith; |
|
lodash.drop = drop; |
|
lodash.dropRight = dropRight; |
|
lodash.dropRightWhile = dropRightWhile; |
|
lodash.dropWhile = dropWhile; |
|
lodash.fill = fill; |
|
lodash.filter = filter; |
|
lodash.flatMap = flatMap; |
|
lodash.flatMapDeep = flatMapDeep; |
|
lodash.flatMapDepth = flatMapDepth; |
|
lodash.flatten = flatten; |
|
lodash.flattenDeep = flattenDeep; |
|
lodash.flattenDepth = flattenDepth; |
|
lodash.flip = flip; |
|
lodash.flow = flow; |
|
lodash.flowRight = flowRight; |
|
lodash.fromPairs = fromPairs; |
|
lodash.functions = functions; |
|
lodash.functionsIn = functionsIn; |
|
lodash.groupBy = groupBy; |
|
lodash.initial = initial; |
|
lodash.intersection = intersection; |
|
lodash.intersectionBy = intersectionBy; |
|
lodash.intersectionWith = intersectionWith; |
|
lodash.invert = invert; |
|
lodash.invertBy = invertBy; |
|
lodash.invokeMap = invokeMap; |
|
lodash.iteratee = iteratee; |
|
lodash.keyBy = keyBy; |
|
lodash.keys = keys; |
|
lodash.keysIn = keysIn; |
|
lodash.map = map; |
|
lodash.mapKeys = mapKeys; |
|
lodash.mapValues = mapValues; |
|
lodash.matches = matches; |
|
lodash.matchesProperty = matchesProperty; |
|
lodash.memoize = memoize; |
|
lodash.merge = merge; |
|
lodash.mergeWith = mergeWith; |
|
lodash.method = method; |
|
lodash.methodOf = methodOf; |
|
lodash.mixin = mixin; |
|
lodash.negate = negate; |
|
lodash.nthArg = nthArg; |
|
lodash.omit = omit; |
|
lodash.omitBy = omitBy; |
|
lodash.once = once; |
|
lodash.orderBy = orderBy; |
|
lodash.over = over; |
|
lodash.overArgs = overArgs; |
|
lodash.overEvery = overEvery; |
|
lodash.overSome = overSome; |
|
lodash.partial = partial; |
|
lodash.partialRight = partialRight; |
|
lodash.partition = partition; |
|
lodash.pick = pick; |
|
lodash.pickBy = pickBy; |
|
lodash.property = property; |
|
lodash.propertyOf = propertyOf; |
|
lodash.pull = pull; |
|
lodash.pullAll = pullAll; |
|
lodash.pullAllBy = pullAllBy; |
|
lodash.pullAllWith = pullAllWith; |
|
lodash.pullAt = pullAt; |
|
lodash.range = range; |
|
lodash.rangeRight = rangeRight; |
|
lodash.rearg = rearg; |
|
lodash.reject = reject; |
|
lodash.remove = remove; |
|
lodash.rest = rest; |
|
lodash.reverse = reverse; |
|
lodash.sampleSize = sampleSize; |
|
lodash.set = set; |
|
lodash.setWith = setWith; |
|
lodash.shuffle = shuffle; |
|
lodash.slice = slice; |
|
lodash.sortBy = sortBy; |
|
lodash.sortedUniq = sortedUniq; |
|
lodash.sortedUniqBy = sortedUniqBy; |
|
lodash.split = split; |
|
lodash.spread = spread; |
|
lodash.tail = tail; |
|
lodash.take = take; |
|
lodash.takeRight = takeRight; |
|
lodash.takeRightWhile = takeRightWhile; |
|
lodash.takeWhile = takeWhile; |
|
lodash.tap = tap; |
|
lodash.throttle = throttle; |
|
lodash.thru = thru; |
|
lodash.toArray = toArray; |
|
lodash.toPairs = toPairs; |
|
lodash.toPairsIn = toPairsIn; |
|
lodash.toPath = toPath; |
|
lodash.toPlainObject = toPlainObject; |
|
lodash.transform = transform; |
|
lodash.unary = unary; |
|
lodash.union = union; |
|
lodash.unionBy = unionBy; |
|
lodash.unionWith = unionWith; |
|
lodash.uniq = uniq; |
|
lodash.uniqBy = uniqBy; |
|
lodash.uniqWith = uniqWith; |
|
lodash.unset = unset; |
|
lodash.unzip = unzip; |
|
lodash.unzipWith = unzipWith; |
|
lodash.update = update; |
|
lodash.updateWith = updateWith; |
|
lodash.values = values; |
|
lodash.valuesIn = valuesIn; |
|
lodash.without = without; |
|
lodash.words = words; |
|
lodash.wrap = wrap; |
|
lodash.xor = xor; |
|
lodash.xorBy = xorBy; |
|
lodash.xorWith = xorWith; |
|
lodash.zip = zip; |
|
lodash.zipObject = zipObject; |
|
lodash.zipObjectDeep = zipObjectDeep; |
|
lodash.zipWith = zipWith; |
|
|
|
// Add aliases. |
|
lodash.entries = toPairs; |
|
lodash.entriesIn = toPairsIn; |
|
lodash.extend = assignIn; |
|
lodash.extendWith = assignInWith; |
|
|
|
// Add methods to `lodash.prototype`. |
|
mixin(lodash, lodash); |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
// Add methods that return unwrapped values in chain sequences. |
|
lodash.add = add; |
|
lodash.attempt = attempt; |
|
lodash.camelCase = camelCase; |
|
lodash.capitalize = capitalize; |
|
lodash.ceil = ceil; |
|
lodash.clamp = clamp; |
|
lodash.clone = clone; |
|
lodash.cloneDeep = cloneDeep; |
|
lodash.cloneDeepWith = cloneDeepWith; |
|
lodash.cloneWith = cloneWith; |
|
lodash.conformsTo = conformsTo; |
|
lodash.deburr = deburr; |
|
lodash.defaultTo = defaultTo; |
|
lodash.divide = divide; |
|
lodash.endsWith = endsWith; |
|
lodash.eq = eq; |
|
lodash.escape = escape; |
|
lodash.escapeRegExp = escapeRegExp; |
|
lodash.every = every; |
|
lodash.find = find; |
|
lodash.findIndex = findIndex; |
|
lodash.findKey = findKey; |
|
lodash.findLast = findLast; |
|
lodash.findLastIndex = findLastIndex; |
|
lodash.findLastKey = findLastKey; |
|
lodash.floor = floor; |
|
lodash.forEach = forEach; |
|
lodash.forEachRight = forEachRight; |
|
lodash.forIn = forIn; |
|
lodash.forInRight = forInRight; |
|
lodash.forOwn = forOwn; |
|
lodash.forOwnRight = forOwnRight; |
|
lodash.get = get; |
|
lodash.gt = gt; |
|
lodash.gte = gte; |
|
lodash.has = has; |
|
lodash.hasIn = hasIn; |
|
lodash.head = head; |
|
lodash.identity = identity; |
|
lodash.includes = includes; |
|
lodash.indexOf = indexOf; |
|
lodash.inRange = inRange; |
|
lodash.invoke = invoke; |
|
lodash.isArguments = isArguments; |
|
lodash.isArray = isArray; |
|
lodash.isArrayBuffer = isArrayBuffer; |
|
lodash.isArrayLike = isArrayLike; |
|
lodash.isArrayLikeObject = isArrayLikeObject; |
|
lodash.isBoolean = isBoolean; |
|
lodash.isBuffer = isBuffer; |
|
lodash.isDate = isDate; |
|
lodash.isElement = isElement; |
|
lodash.isEmpty = isEmpty; |
|
lodash.isEqual = isEqual; |
|
lodash.isEqualWith = isEqualWith; |
|
lodash.isError = isError; |
|
lodash.isFinite = isFinite; |
|
lodash.isFunction = isFunction; |
|
lodash.isInteger = isInteger; |
|
lodash.isLength = isLength; |
|
lodash.isMap = isMap; |
|
lodash.isMatch = isMatch; |
|
lodash.isMatchWith = isMatchWith; |
|
lodash.isNaN = isNaN; |
|
lodash.isNative = isNative; |
|
lodash.isNil = isNil; |
|
lodash.isNull = isNull; |
|
lodash.isNumber = isNumber; |
|
lodash.isObject = isObject; |
|
lodash.isObjectLike = isObjectLike; |
|
lodash.isPlainObject = isPlainObject; |
|
lodash.isRegExp = isRegExp; |
|
lodash.isSafeInteger = isSafeInteger; |
|
lodash.isSet = isSet; |
|
lodash.isString = isString; |
|
lodash.isSymbol = isSymbol; |
|
lodash.isTypedArray = isTypedArray; |
|
lodash.isUndefined = isUndefined; |
|
lodash.isWeakMap = isWeakMap; |
|
lodash.isWeakSet = isWeakSet; |
|
lodash.join = join; |
|
lodash.kebabCase = kebabCase; |
|
lodash.last = last; |
|
lodash.lastIndexOf = lastIndexOf; |
|
lodash.lowerCase = lowerCase; |
|
lodash.lowerFirst = lowerFirst; |
|
lodash.lt = lt; |
|
lodash.lte = lte; |
|
lodash.max = max; |
|
lodash.maxBy = maxBy; |
|
lodash.mean = mean; |
|
lodash.meanBy = meanBy; |
|
lodash.min = min; |
|
lodash.minBy = minBy; |
|
lodash.stubArray = stubArray; |
|
lodash.stubFalse = stubFalse; |
|
lodash.stubObject = stubObject; |
|
lodash.stubString = stubString; |
|
lodash.stubTrue = stubTrue; |
|
lodash.multiply = multiply; |
|
lodash.nth = nth; |
|
lodash.noConflict = noConflict; |
|
lodash.noop = noop; |
|
lodash.now = now; |
|
lodash.pad = pad; |
|
lodash.padEnd = padEnd; |
|
lodash.padStart = padStart; |
|
lodash.parseInt = parseInt; |
|
lodash.random = random; |
|
lodash.reduce = reduce; |
|
lodash.reduceRight = reduceRight; |
|
lodash.repeat = repeat; |
|
lodash.replace = replace; |
|
lodash.result = result; |
|
lodash.round = round; |
|
lodash.runInContext = runInContext; |
|
lodash.sample = sample; |
|
lodash.size = size; |
|
lodash.snakeCase = snakeCase; |
|
lodash.some = some; |
|
lodash.sortedIndex = sortedIndex; |
|
lodash.sortedIndexBy = sortedIndexBy; |
|
lodash.sortedIndexOf = sortedIndexOf; |
|
lodash.sortedLastIndex = sortedLastIndex; |
|
lodash.sortedLastIndexBy = sortedLastIndexBy; |
|
lodash.sortedLastIndexOf = sortedLastIndexOf; |
|
lodash.startCase = startCase; |
|
lodash.startsWith = startsWith; |
|
lodash.subtract = subtract; |
|
lodash.sum = sum; |
|
lodash.sumBy = sumBy; |
|
lodash.template = template; |
|
lodash.times = times; |
|
lodash.toFinite = toFinite; |
|
lodash.toInteger = toInteger; |
|
lodash.toLength = toLength; |
|
lodash.toLower = toLower; |
|
lodash.toNumber = toNumber; |
|
lodash.toSafeInteger = toSafeInteger; |
|
lodash.toString = toString; |
|
lodash.toUpper = toUpper; |
|
lodash.trim = trim; |
|
lodash.trimEnd = trimEnd; |
|
lodash.trimStart = trimStart; |
|
lodash.truncate = truncate; |
|
lodash.unescape = unescape; |
|
lodash.uniqueId = uniqueId; |
|
lodash.upperCase = upperCase; |
|
lodash.upperFirst = upperFirst; |
|
|
|
// Add aliases. |
|
lodash.each = forEach; |
|
lodash.eachRight = forEachRight; |
|
lodash.first = head; |
|
|
|
mixin(lodash, (function() { |
|
var source = {}; |
|
baseForOwn(lodash, function(func, methodName) { |
|
if (!hasOwnProperty.call(lodash.prototype, methodName)) { |
|
source[methodName] = func; |
|
} |
|
}); |
|
return source; |
|
}()), { 'chain': false }); |
|
|
|
/*------------------------------------------------------------------------*/ |
|
|
|
/** |
|
* The semantic version number. |
|
* |
|
* @static |
|
* @memberOf _ |
|
* @type {string} |
|
*/ |
|
lodash.VERSION = VERSION; |
|
|
|
// Assign default placeholders. |
|
arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { |
|
lodash[methodName].placeholder = lodash; |
|
}); |
|
|
|
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants. |
|
arrayEach(['drop', 'take'], function(methodName, index) { |
|
LazyWrapper.prototype[methodName] = function(n) { |
|
n = n === undefined ? 1 : nativeMax(toInteger(n), 0); |
|
|
|
var result = (this.__filtered__ && !index) |
|
? new LazyWrapper(this) |
|
: this.clone(); |
|
|
|
if (result.__filtered__) { |
|
result.__takeCount__ = nativeMin(n, result.__takeCount__); |
|
} else { |
|
result.__views__.push({ |
|
'size': nativeMin(n, MAX_ARRAY_LENGTH), |
|
'type': methodName + (result.__dir__ < 0 ? 'Right' : '') |
|
}); |
|
} |
|
return result; |
|
}; |
|
|
|
LazyWrapper.prototype[methodName + 'Right'] = function(n) { |
|
return this.reverse()[methodName](n).reverse(); |
|
}; |
|
}); |
|
|
|
// Add `LazyWrapper` methods that accept an `iteratee` value. |
|
arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { |
|
var type = index + 1, |
|
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; |
|
|
|
LazyWrapper.prototype[methodName] = function(iteratee) { |
|
var result = this.clone(); |
|
result.__iteratees__.push({ |
|
'iteratee': getIteratee(iteratee, 3), |
|
'type': type |
|
}); |
|
result.__filtered__ = result.__filtered__ || isFilter; |
|
return result; |
|
}; |
|
}); |
|
|
|
// Add `LazyWrapper` methods for `_.head` and `_.last`. |
|
arrayEach(['head', 'last'], function(methodName, index) { |
|
var takeName = 'take' + (index ? 'Right' : ''); |
|
|
|
LazyWrapper.prototype[methodName] = function() { |
|
return this[takeName](1).value()[0]; |
|
}; |
|
}); |
|
|
|
// Add `LazyWrapper` methods for `_.initial` and `_.tail`. |
|
arrayEach(['initial', 'tail'], function(methodName, index) { |
|
var dropName = 'drop' + (index ? '' : 'Right'); |
|
|
|
LazyWrapper.prototype[methodName] = function() { |
|
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); |
|
}; |
|
}); |
|
|
|
LazyWrapper.prototype.compact = function() { |
|
return this.filter(identity); |
|
}; |
|
|
|
LazyWrapper.prototype.find = function(predicate) { |
|
return this.filter(predicate).head(); |
|
}; |
|
|
|
LazyWrapper.prototype.findLast = function(predicate) { |
|
return this.reverse().find(predicate); |
|
}; |
|
|
|
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { |
|
if (typeof path == 'function') { |
|
return new LazyWrapper(this); |
|
} |
|
return this.map(function(value) { |
|
return baseInvoke(value, path, args); |
|
}); |
|
}); |
|
|
|
LazyWrapper.prototype.reject = function(predicate) { |
|
return this.filter(negate(getIteratee(predicate))); |
|
}; |
|
|
|
LazyWrapper.prototype.slice = function(start, end) { |
|
start = toInteger(start); |
|
|
|
var result = this; |
|
if (result.__filtered__ && (start > 0 || end < 0)) { |
|
return new LazyWrapper(result); |
|
} |
|
if (start < 0) { |
|
result = result.takeRight(-start); |
|
} else if (start) { |
|
result = result.drop(start); |
|
} |
|
if (end !== undefined) { |
|
end = toInteger(end); |
|
result = end < 0 ? result.dropRight(-end) : result.take(end - start); |
|
} |
|
return result; |
|
}; |
|
|
|
LazyWrapper.prototype.takeRightWhile = function(predicate) { |
|
return this.reverse().takeWhile(predicate).reverse(); |
|
}; |
|
|
|
LazyWrapper.prototype.toArray = function() { |
|
return this.take(MAX_ARRAY_LENGTH); |
|
}; |
|
|
|
// Add `LazyWrapper` methods to `lodash.prototype`. |
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) { |
|
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), |
|
isTaker = /^(?:head|last)$/.test(methodName), |
|
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], |
|
retUnwrapped = isTaker || /^find/.test(methodName); |
|
|
|
if (!lodashFunc) { |
|
return; |
|
} |
|
lodash.prototype[methodName] = function() { |
|
var value = this.__wrapped__, |
|
args = isTaker ? [1] : arguments, |
|
isLazy = value instanceof LazyWrapper, |
|
iteratee = args[0], |
|
useLazy = isLazy || isArray(value); |
|
|
|
var interceptor = function(value) { |
|
var result = lodashFunc.apply(lodash, arrayPush([value], args)); |
|
return (isTaker && chainAll) ? result[0] : result; |
|
}; |
|
|
|
if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { |
|
// Avoid lazy use if the iteratee has a "length" value other than `1`. |
|
isLazy = useLazy = false; |
|
} |
|
var chainAll = this.__chain__, |
|
isHybrid = !!this.__actions__.length, |
|
isUnwrapped = retUnwrapped && !chainAll, |
|
onlyLazy = isLazy && !isHybrid; |
|
|
|
if (!retUnwrapped && useLazy) { |
|
value = onlyLazy ? value : new LazyWrapper(this); |
|
var result = func.apply(value, args); |
|
result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); |
|
return new LodashWrapper(result, chainAll); |
|
} |
|
if (isUnwrapped && onlyLazy) { |
|
return func.apply(this, args); |
|
} |
|
result = this.thru(interceptor); |
|
return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; |
|
}; |
|
}); |
|
|
|
// Add `Array` methods to `lodash.prototype`. |
|
arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { |
|
var func = arrayProto[methodName], |
|
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', |
|
retUnwrapped = /^(?:pop|shift)$/.test(methodName); |
|
|
|
lodash.prototype[methodName] = function() { |
|
var args = arguments; |
|
if (retUnwrapped && !this.__chain__) { |
|
var value = this.value(); |
|
return func.apply(isArray(value) ? value : [], args); |
|
} |
|
return this[chainName](function(value) { |
|
return func.apply(isArray(value) ? value : [], args); |
|
}); |
|
}; |
|
}); |
|
|
|
// Map minified method names to their real names. |
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) { |
|
var lodashFunc = lodash[methodName]; |
|
if (lodashFunc) { |
|
var key = lodashFunc.name + ''; |
|
if (!hasOwnProperty.call(realNames, key)) { |
|
realNames[key] = []; |
|
} |
|
realNames[key].push({ 'name': methodName, 'func': lodashFunc }); |
|
} |
|
}); |
|
|
|
realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ |
|
'name': 'wrapper', |
|
'func': undefined |
|
}]; |
|
|
|
// Add methods to `LazyWrapper`. |
|
LazyWrapper.prototype.clone = lazyClone; |
|
LazyWrapper.prototype.reverse = lazyReverse; |
|
LazyWrapper.prototype.value = lazyValue; |
|
|
|
// Add chain sequence methods to the `lodash` wrapper. |
|
lodash.prototype.at = wrapperAt; |
|
lodash.prototype.chain = wrapperChain; |
|
lodash.prototype.commit = wrapperCommit; |
|
lodash.prototype.next = wrapperNext; |
|
lodash.prototype.plant = wrapperPlant; |
|
lodash.prototype.reverse = wrapperReverse; |
|
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; |
|
|
|
// Add lazy aliases. |
|
lodash.prototype.first = lodash.prototype.head; |
|
|
|
if (symIterator) { |
|
lodash.prototype[symIterator] = wrapperToIterator; |
|
} |
|
return lodash; |
|
}); |
|
|
|
/*--------------------------------------------------------------------------*/ |
|
|
|
// Export lodash. |
|
var _ = runInContext(); |
|
|
|
// Some AMD build optimizers, like r.js, check for condition patterns like: |
|
if (true) { |
|
// Expose Lodash on the global object to prevent errors when Lodash is |
|
// loaded by a script tag in the presence of an AMD loader. |
|
// See http://requirejs.org/docs/errors.html#mismatch for more details. |
|
// Use `_.noConflict` to remove Lodash from the global object. |
|
root._ = _; |
|
|
|
// Define as an anonymous module so, through path mapping, it can be |
|
// referenced as the "underscore" module. |
|
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { |
|
return _; |
|
}).call(exports, __webpack_require__, exports, module), |
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
|
} |
|
// Check for `exports` after `define` in case a build optimizer adds it. |
|
else {} |
|
}.call(this)); |
|
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "../node_modules/webpack/buildin/module.js")(module))) |
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/webpack/buildin/global.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/webpack/buildin/global.js ***! |
|
\*************************************************/ |
|
/*! no static exports found */ |
|
/***/ (function(module, exports) { |
|
|
|
var g; |
|
|
|
// This works in non-strict mode |
|
g = (function() { |
|
return this; |
|
})(); |
|
|
|
try { |
|
// This works if eval is allowed (see CSP) |
|
g = g || new Function("return this")(); |
|
} catch (e) { |
|
// This works if the window reference is available |
|
if (typeof window === "object") g = window; |
|
} |
|
|
|
// g can still be undefined, but nothing to do about it... |
|
// We return undefined, instead of nothing here, so it's |
|
// easier to handle this case. if(!global) { ...} |
|
|
|
module.exports = g; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "../node_modules/webpack/buildin/module.js": |
|
/*!*************************************************!*\ |
|
!*** ../node_modules/webpack/buildin/module.js ***! |
|
\*************************************************/ |
|
/*! no static exports found */ |
|
/***/ (function(module, exports) { |
|
|
|
module.exports = function(module) { |
|
if (!module.webpackPolyfill) { |
|
module.deprecate = function() {}; |
|
module.paths = []; |
|
// module.parent = undefined by default |
|
if (!module.children) module.children = []; |
|
Object.defineProperty(module, "loaded", { |
|
enumerable: true, |
|
get: function() { |
|
return module.l; |
|
} |
|
}); |
|
Object.defineProperty(module, "id", { |
|
enumerable: true, |
|
get: function() { |
|
return module.i; |
|
} |
|
}); |
|
module.webpackPolyfill = 1; |
|
} |
|
return module; |
|
}; |
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "./index.ts": |
|
/*!******************!*\ |
|
!*** ./index.ts ***! |
|
\******************/ |
|
/*! exports provided: ChartwerkBarPod, VueChartwerkBarChartObject, TickOrientation, TimeFormat, AxisFormat */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChartwerkBarPod", function() { return ChartwerkBarPod; }); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VueChartwerkBarChartObject", function() { return VueChartwerkBarChartObject; }); |
|
/* harmony import */ var _chartwerk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @chartwerk/core */ "../node_modules/@chartwerk/core/dist/index.js"); |
|
/* harmony import */ var _chartwerk_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_chartwerk_core__WEBPACK_IMPORTED_MODULE_0__); |
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TickOrientation", function() { return _chartwerk_core__WEBPACK_IMPORTED_MODULE_0__["TickOrientation"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeFormat", function() { return _chartwerk_core__WEBPACK_IMPORTED_MODULE_0__["TimeFormat"]; }); |
|
|
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AxisFormat", function() { return _chartwerk_core__WEBPACK_IMPORTED_MODULE_0__["AxisFormat"]; }); |
|
|
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./utils.ts"); |
|
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3 */ "../node_modules/d3/index.js"); |
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js"); |
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__); |
|
var __extends = (undefined && undefined.__extends) || (function () { |
|
var extendStatics = function (d, b) { |
|
extendStatics = Object.setPrototypeOf || |
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
|
return extendStatics(d, b); |
|
}; |
|
return function (d, b) { |
|
extendStatics(d, b); |
|
function __() { this.constructor = d; } |
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
|
}; |
|
})(); |
|
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { |
|
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; |
|
for (var r = Array(s), k = 0, i = 0; i < il; i++) |
|
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) |
|
r[k] = a[j]; |
|
return r; |
|
}; |
|
|
|
|
|
|
|
|
|
var DEFAULT_BAR_OPTIONS = { |
|
renderBarLabels: false, |
|
stacked: false, |
|
matching: false |
|
}; |
|
var ChartwerkBarPod = /** @class */ (function (_super) { |
|
__extends(ChartwerkBarPod, _super); |
|
function ChartwerkBarPod(el, _series, _options) { |
|
if (_series === void 0) { _series = []; } |
|
if (_options === void 0) { _options = {}; } |
|
var _this = _super.call(this, d3__WEBPACK_IMPORTED_MODULE_2__, el, _series, _options) || this; |
|
_this.barYScale = null; |
|
_this._seriesDataForRendring = []; |
|
lodash__WEBPACK_IMPORTED_MODULE_3__["defaults"](_this.options, DEFAULT_BAR_OPTIONS); |
|
return _this; |
|
} |
|
ChartwerkBarPod.prototype.renderMetrics = function () { |
|
if (this.series.length === 0 || this.series[0].datapoints.length === 0) { |
|
this.renderNoDataPointsMessage(); |
|
return; |
|
} |
|
this.setBarPodScales(); |
|
this.setSeriesDataForRendering(); |
|
this.renderSerie(this._seriesDataForRendring); |
|
}; |
|
Object.defineProperty(ChartwerkBarPod.prototype, "isMatchingDisabled", { |
|
get: function () { |
|
return this.options.matching === false || this.seriesUniqKeys.length === 0; |
|
}, |
|
enumerable: false, |
|
configurable: true |
|
}); |
|
ChartwerkBarPod.prototype.setSeriesDataForRendering = function () { |
|
var _this = this; |
|
if (this.isMatchingDisabled) { |
|
this._seriesDataForRendring = this.getZippedDataForRender(this.visibleSeries); |
|
} |
|
else { |
|
var matchedSeries = this.seriesForMatching.map(function (series, idx) { return _this.getZippedDataForRender(series); }); |
|
this._seriesDataForRendring = this.mergeMacthedSeriesAndSort(matchedSeries); |
|
} |
|
}; |
|
ChartwerkBarPod.prototype.setBarPodScales = function () { |
|
// TODO: its a hack to avoid infinite scale function recalling |
|
// It should be fixed by implenting BarState |
|
this.barYScale = this.getYScale(); |
|
}; |
|
ChartwerkBarPod.prototype.renderSerie = function (data) { |
|
var _this = this; |
|
this.metricContainer.selectAll(".rects-container") |
|
.data(data) |
|
.enter().append('g') |
|
.attr('class', 'rects-container') |
|
.each(function (d, i, nodes) { |
|
var _a; |
|
var container = d3__WEBPACK_IMPORTED_MODULE_2__["select"](nodes[i]); |
|
container.selectAll('rect') |
|
.data(d.values) |
|
.enter().append('rect') |
|
.style('fill', function (val, i) { return d.colors[i]; }) |
|
.attr('opacity', function () { return _this.getBarOpacity(d); }) |
|
.attr('x', function (val, idx) { |
|
return _this.getBarPositionX(d.key, idx); |
|
}) |
|
.attr('y', function (val, idx) { |
|
return _this.getBarPositionY(val, idx, d.values); |
|
}) |
|
.attr('width', _this.barWidth) |
|
.attr('height', function (val) { return _this.getBarHeight(val); }) |
|
.on('contextmenu', _this.contextMenu.bind(_this)); |
|
// render bar annotations, its all hardcoded |
|
if (lodash__WEBPACK_IMPORTED_MODULE_3__["isEmpty"](_this.options.annotations)) { |
|
return; |
|
} |
|
// find all series for single matchedKey |
|
var series = lodash__WEBPACK_IMPORTED_MODULE_3__["filter"](_this.series, function (serie) { return lodash__WEBPACK_IMPORTED_MODULE_3__["includes"](d.serieTarget, serie.target); }); |
|
var matchedKeys = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series, function (serie) { return serie.matchedKey; }); // here matchedKeys should be equal |
|
var key = matchedKeys[0]; |
|
var lastRect = lodash__WEBPACK_IMPORTED_MODULE_3__["last"]((_a = container.selectAll('rect')) === null || _a === void 0 ? void 0 : _a.nodes()); |
|
var annotation = lodash__WEBPACK_IMPORTED_MODULE_3__["find"](_this.options.annotations, function (a) { return a.key === key; }); |
|
if (!lastRect || !key || !annotation) { |
|
return; |
|
} |
|
var rectSelection = d3__WEBPACK_IMPORTED_MODULE_2__["select"](lastRect); |
|
// render triangle |
|
container.append('path') |
|
.attr('d', function () { |
|
var x = Math.ceil(lodash__WEBPACK_IMPORTED_MODULE_3__["toNumber"](rectSelection.attr('x'))); |
|
var y = Math.ceil(lodash__WEBPACK_IMPORTED_MODULE_3__["toNumber"](rectSelection.attr('y'))); |
|
var options = { max: _this.options.maxAnnotationSize, min: _this.options.minAnnotationSize }; |
|
return _this.getTrianglePath(x, y, _this.barWidth, options); |
|
}) |
|
.attr('fill', annotation.color); |
|
}); |
|
}; |
|
ChartwerkBarPod.prototype.getTrianglePath = function (x, y, length, options) { |
|
// (x, y) - top left corner of bar |
|
var minTriangleSize = (options === null || options === void 0 ? void 0 : options.min) || 6; |
|
var maxTriagleSize = (options === null || options === void 0 ? void 0 : options.max) || 10; |
|
var yOffset = 4; // offset between triangle and bar |
|
var centerX = x + length / 2; |
|
var correctedLength = lodash__WEBPACK_IMPORTED_MODULE_3__["clamp"](length, minTriangleSize, maxTriagleSize); |
|
var topY = Math.max(y - correctedLength - yOffset, 4); |
|
var topLeftCorner = { |
|
x: centerX - correctedLength / 2, |
|
y: topY, |
|
}; |
|
var topRightCorner = { |
|
x: centerX + correctedLength / 2, |
|
y: topY, |
|
}; |
|
var bottomMiddleCorner = { |
|
x: centerX, |
|
y: topY + correctedLength, |
|
}; |
|
return "M " + topLeftCorner.x + " " + topLeftCorner.y + "\n L " + topRightCorner.x + " " + topRightCorner.y + "\n L " + bottomMiddleCorner.x + " " + bottomMiddleCorner.y + " z"; |
|
}; |
|
ChartwerkBarPod.prototype.getBarOpacity = function (rowValues) { |
|
if (this.options.opacityFormatter === undefined) { |
|
return 1; |
|
} |
|
return this.options.opacityFormatter(rowValues); |
|
}; |
|
ChartwerkBarPod.prototype.mergeMacthedSeriesAndSort = function (matchedSeries) { |
|
// TODO: refactor |
|
if (matchedSeries.length === 0) { |
|
throw new Error('Cant mergeMacthedSeriesAndSort'); |
|
} |
|
if (matchedSeries.length === 1) { |
|
return matchedSeries[0]; |
|
} |
|
var unionSeries = lodash__WEBPACK_IMPORTED_MODULE_3__["clone"](matchedSeries[0]); |
|
for (var i = 1; i < matchedSeries.length; i++) { |
|
unionSeries = __spreadArrays(unionSeries, matchedSeries[i]); |
|
} |
|
var sortedSeries = lodash__WEBPACK_IMPORTED_MODULE_3__["sortBy"](unionSeries, ['key']); |
|
return sortedSeries; |
|
}; |
|
Object.defineProperty(ChartwerkBarPod.prototype, "seriesUniqKeys", { |
|
get: function () { |
|
if (this.visibleSeries.length === 0) { |
|
return []; |
|
} |
|
var keys = this.visibleSeries.map(function (serie) { return serie.matchedKey; }); |
|
var uniqKeys = lodash__WEBPACK_IMPORTED_MODULE_3__["uniq"](keys); |
|
var filteredKeys = lodash__WEBPACK_IMPORTED_MODULE_3__["filter"](uniqKeys, function (key) { return key !== undefined; }); |
|
return filteredKeys; |
|
}, |
|
enumerable: false, |
|
configurable: true |
|
}); |
|
Object.defineProperty(ChartwerkBarPod.prototype, "seriesForMatching", { |
|
get: function () { |
|
var _this = this; |
|
if (this.seriesUniqKeys.length === 0) { |
|
return [this.visibleSeries]; |
|
} |
|
var seriesList = this.seriesUniqKeys.map(function (key) { |
|
var seriesWithKey = lodash__WEBPACK_IMPORTED_MODULE_3__["filter"](_this.visibleSeries, function (serie) { return serie.matchedKey === key; }); |
|
return seriesWithKey; |
|
}); |
|
return seriesList; |
|
}, |
|
enumerable: false, |
|
configurable: true |
|
}); |
|
ChartwerkBarPod.prototype.getZippedDataForRender = function (series) { |
|
var _this = this; |
|
if (series.length === 0) { |
|
throw new Error('There is no visible series'); |
|
} |
|
var keysColumn = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series[0].datapoints, function (row) { return row[0]; }); |
|
var valuesColumns = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series, function (serie) { return lodash__WEBPACK_IMPORTED_MODULE_3__["map"](serie.datapoints, function (row) { return row[1]; }); }); |
|
// @ts-ignore |
|
var additionalValuesColumns = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series, function (serie) { return lodash__WEBPACK_IMPORTED_MODULE_3__["map"](serie.datapoints, function (row) { return row[2] !== undefined ? row[2] : null; }); }); |
|
var zippedAdditionalValuesColumn = lodash__WEBPACK_IMPORTED_MODULE_3__["zip"].apply(lodash__WEBPACK_IMPORTED_MODULE_3__, additionalValuesColumns); |
|
var zippedValuesColumn = lodash__WEBPACK_IMPORTED_MODULE_3__["zip"].apply(lodash__WEBPACK_IMPORTED_MODULE_3__, valuesColumns); |
|
var colors = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series, function (serie) { return _this.getBarColor(serie); }); |
|
var tagrets = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series, function (serie) { return serie.target; }); |
|
var zippedData = lodash__WEBPACK_IMPORTED_MODULE_3__["zip"](keysColumn, zippedValuesColumn, zippedAdditionalValuesColumn, tagrets); |
|
var data = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](zippedData, function (row) { return { key: row[0], values: row[1], additionalValues: row[2], colors: colors, serieTarget: tagrets }; }); |
|
return data.filter(function (v) { return v.key !== undefined; }); |
|
}; |
|
ChartwerkBarPod.prototype.renderSharedCrosshair = function (values) { |
|
this.crosshair.style('display', null); |
|
var x = this.xScale(values.x); |
|
this.crosshair.select('#crosshair-line-x') |
|
.attr('x1', x) |
|
.attr('x2', x); |
|
}; |
|
ChartwerkBarPod.prototype.hideSharedCrosshair = function () { |
|
this.crosshair.style('display', 'none'); |
|
}; |
|
ChartwerkBarPod.prototype.onMouseMove = function () { |
|
// TODO: mouse move work bad with matching |
|
var event = this.d3.mouse(this.chartContainer.node()); |
|
var eventX = event[0]; |
|
if (this.isOutOfChart() === true) { |
|
this.crosshair.style('display', 'none'); |
|
return; |
|
} |
|
this.crosshair.select('#crosshair-line-x') |
|
.attr('x1', eventX) |
|
.attr('x2', eventX); |
|
var series = this.getSeriesPointFromMousePosition(eventX); |
|
if (this.options.eventsCallbacks !== undefined && this.options.eventsCallbacks.mouseMove !== undefined) { |
|
this.options.eventsCallbacks.mouseMove({ |
|
x: this.d3.event.pageX, |
|
y: this.d3.event.pageY, |
|
time: this.xScale.invert(eventX), |
|
series: series, |
|
chartX: eventX, |
|
chartWidth: this.width |
|
}); |
|
} |
|
else { |
|
console.log('mouse move, but there is no callback'); |
|
} |
|
}; |
|
ChartwerkBarPod.prototype.getSeriesPointFromMousePosition = function (eventX) { |
|
if (this.series === undefined || this.series.length === 0) { |
|
return undefined; |
|
} |
|
var mousePoisitionKey = Math.ceil(this.xScale.invert(eventX)); |
|
var keys = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](this._seriesDataForRendring, function (el) { return el.key; }); |
|
var idx = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["findClosest"])(keys, mousePoisitionKey); |
|
return this._seriesDataForRendring[idx]; |
|
}; |
|
ChartwerkBarPod.prototype.getBarColor = function (serie) { |
|
if (serie.color === undefined) { |
|
return this.getSerieColor(0); |
|
} |
|
return serie.color; |
|
}; |
|
ChartwerkBarPod.prototype.onMouseOver = function () { |
|
this.crosshair.style('display', null); |
|
this.crosshair.raise(); |
|
}; |
|
ChartwerkBarPod.prototype.onMouseOut = function () { |
|
if (this.options.eventsCallbacks !== undefined && this.options.eventsCallbacks.mouseOut !== undefined) { |
|
this.options.eventsCallbacks.mouseOut(); |
|
} |
|
else { |
|
console.log('mouse out, but there is no callback'); |
|
} |
|
this.crosshair.style('display', 'none'); |
|
}; |
|
ChartwerkBarPod.prototype.contextMenu = function () { |
|
// maybe it is not the best name, but i took it from d3. |
|
this.d3.event.preventDefault(); // do not open browser's context menu. |
|
var event = this.d3.mouse(this.chartContainer.node()); |
|
var eventX = event[0]; |
|
var series = this.getSeriesPointFromMousePosition(eventX); |
|
if (this.options.eventsCallbacks !== undefined && this.options.eventsCallbacks.contextMenu !== undefined) { |
|
this.options.eventsCallbacks.contextMenu({ |
|
x: this.d3.event.pageX, |
|
y: this.d3.event.pageY, |
|
time: this.xScale.invert(eventX), |
|
series: series, |
|
chartX: eventX |
|
}); |
|
} |
|
else { |
|
console.log('contextmenu, but there is no callback'); |
|
} |
|
}; |
|
Object.defineProperty(ChartwerkBarPod.prototype, "barWidth", { |
|
get: function () { |
|
// TODO: here we use first value + timeInterval as bar width. It is not a good idea |
|
var xAxisStartValue = lodash__WEBPACK_IMPORTED_MODULE_3__["first"](this.series[0].datapoints)[0]; |
|
var width = this.xScale(xAxisStartValue + this.timeInterval) / 2; |
|
if (this.options.barWidth !== undefined) { |
|
// barWidth now has axis-x dimension |
|
width = this.xScale(this.state.getMinValueX() + this.options.barWidth); |
|
} |
|
var rectColumns = this.visibleSeries.length; |
|
if (this.options.stacked === true) { |
|
rectColumns = 1; |
|
} |
|
return this.updateBarWidthWithBorders(width / rectColumns); |
|
}, |
|
enumerable: false, |
|
configurable: true |
|
}); |
|
ChartwerkBarPod.prototype.updateBarWidthWithBorders = function (width) { |
|
var barWidth = width; |
|
if (this.options.minBarWidth !== undefined) { |
|
barWidth = Math.max(barWidth, this.options.minBarWidth); |
|
} |
|
if (this.options.maxBarWidth !== undefined) { |
|
barWidth = Math.min(barWidth, this.options.maxBarWidth); |
|
} |
|
return barWidth; |
|
}; |
|
ChartwerkBarPod.prototype.getBarHeight = function (value) { |
|
// TODO: Property 'sign' does not exist on type 'Math' |
|
// @ts-ignore |
|
var height = Math.sign(value) * (this.barYScale(0) - this.barYScale(value)); |
|
return height; |
|
}; |
|
ChartwerkBarPod.prototype.getBarPositionX = function (key, idx) { |
|
var xPosition = this.xScale(key); |
|
if (this.options.stacked === false) { |
|
xPosition += idx * this.barWidth; |
|
} |
|
return xPosition; |
|
}; |
|
ChartwerkBarPod.prototype.getBarPositionY = function (val, idx, values) { |
|
var _this = this; |
|
var yPosition = this.barYScale(Math.max(val, 0)); |
|
if (this.options.stacked === true) { |
|
var previousBarsHeight = lodash__WEBPACK_IMPORTED_MODULE_3__["sum"](lodash__WEBPACK_IMPORTED_MODULE_3__["map"](lodash__WEBPACK_IMPORTED_MODULE_3__["range"](idx), function (i) { return _this.getBarHeight(values[i]); })); |
|
yPosition -= previousBarsHeight; |
|
} |
|
return yPosition; |
|
}; |
|
ChartwerkBarPod.prototype.getYScale = function () { |
|
if (this.state.getMinValueY() === undefined || |
|
this.state.getMaxValueY() === undefined) { |
|
return this.d3.scaleLinear() |
|
.domain([1, 0]) |
|
.range([0, this.height]); |
|
} |
|
var yMaxValue = this.getYMaxValue(); |
|
return this.d3.scaleLinear() |
|
.domain([yMaxValue, Math.min(this.state.getMinValueY(), 0)]) |
|
.range([0, this.height]); |
|
}; |
|
ChartwerkBarPod.prototype.getYMaxValue = function () { |
|
if (this.series === undefined || this.series.length === 0 || this.series[0].datapoints.length === 0) { |
|
return undefined; |
|
} |
|
if (this.options.axis.y !== undefined && this.options.axis.y.range !== undefined) { |
|
return lodash__WEBPACK_IMPORTED_MODULE_3__["max"](this.options.axis.y.range); |
|
} |
|
var maxValue; |
|
if (this.options.stacked === true) { |
|
if (this.options.matching === true && this.seriesUniqKeys.length > 0) { |
|
var maxValues = this.seriesForMatching.map(function (series) { |
|
var valuesColumns = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](series, function (serie) { return lodash__WEBPACK_IMPORTED_MODULE_3__["map"](serie.datapoints, function (row) { return row[1]; }); }); |
|
var zippedValuesColumn = lodash__WEBPACK_IMPORTED_MODULE_3__["zip"].apply(lodash__WEBPACK_IMPORTED_MODULE_3__, valuesColumns); |
|
return maxValue = lodash__WEBPACK_IMPORTED_MODULE_3__["max"](lodash__WEBPACK_IMPORTED_MODULE_3__["map"](zippedValuesColumn, function (row) { return lodash__WEBPACK_IMPORTED_MODULE_3__["sum"](row); })); |
|
}); |
|
return lodash__WEBPACK_IMPORTED_MODULE_3__["max"](maxValues); |
|
} |
|
else { |
|
var valuesColumns = lodash__WEBPACK_IMPORTED_MODULE_3__["map"](this.visibleSeries, function (serie) { return lodash__WEBPACK_IMPORTED_MODULE_3__["map"](serie.datapoints, function (row) { return row[1]; }); }); |
|
var zippedValuesColumn = lodash__WEBPACK_IMPORTED_MODULE_3__["zip"].apply(lodash__WEBPACK_IMPORTED_MODULE_3__, valuesColumns); |
|
maxValue = lodash__WEBPACK_IMPORTED_MODULE_3__["max"](lodash__WEBPACK_IMPORTED_MODULE_3__["map"](zippedValuesColumn, function (row) { return lodash__WEBPACK_IMPORTED_MODULE_3__["sum"](row); })); |
|
} |
|
} |
|
else { |
|
console.log('else'); |
|
maxValue = lodash__WEBPACK_IMPORTED_MODULE_3__["max"](this.visibleSeries.map(function (serie) { return lodash__WEBPACK_IMPORTED_MODULE_3__["maxBy"](serie.datapoints, function (dp) { return dp[1]; })[0]; })); |
|
} |
|
return Math.max(maxValue, 0); |
|
}; |
|
return ChartwerkBarPod; |
|
}(_chartwerk_core__WEBPACK_IMPORTED_MODULE_0__["ChartwerkPod"])); |
|
|
|
// it is used with Vue.component, e.g.: Vue.component('chartwerk-bar-chart', VueChartwerkBarChartObject) |
|
var VueChartwerkBarChartObject = { |
|
// alternative to `template: '<div class="chartwerk-bar-chart" :id="id" />'` |
|
render: function (createElement) { |
|
return createElement('div', { |
|
class: { 'chartwerk-bar-chart': true }, |
|
attrs: { id: this.id } |
|
}); |
|
}, |
|
mixins: [_chartwerk_core__WEBPACK_IMPORTED_MODULE_0__["VueChartwerkPodMixin"]], |
|
methods: { |
|
render: function () { |
|
console.time('bar-render'); |
|
var pod = new ChartwerkBarPod(document.getElementById(this.id), this.series, this.options); |
|
pod.render(); |
|
console.timeEnd('bar-render'); |
|
} |
|
} |
|
}; |
|
|
|
|
|
|
|
/***/ }), |
|
|
|
/***/ "./utils.ts": |
|
/*!******************!*\ |
|
!*** ./utils.ts ***! |
|
\******************/ |
|
/*! exports provided: findClosest */ |
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
"use strict"; |
|
__webpack_require__.r(__webpack_exports__); |
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findClosest", function() { return findClosest; }); |
|
/** |
|
* Finds the closest item to a given number in an array using binary search |
|
* @argument arr: ascending sorted array |
|
* @argument num: number to find |
|
* @returns index of the closest item to `num` |
|
* @returns -1 if given array is empty |
|
*/ |
|
function findClosest(arr, num) { |
|
if (arr.length === 0) { |
|
return -1; |
|
} |
|
var lowIdx = 0; |
|
var highIdx = arr.length - 1; |
|
while (highIdx - lowIdx > 1) { |
|
var midIdx = Math.floor((lowIdx + highIdx) / 2); |
|
if (arr[midIdx] < num) { |
|
lowIdx = midIdx; |
|
} |
|
else { |
|
highIdx = midIdx; |
|
} |
|
} |
|
if (num - arr[lowIdx] <= arr[highIdx] - num) { |
|
return lowIdx; |
|
} |
|
return highIdx; |
|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G4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGNhc2UgMzI6IHsgLy8gU1BBQ0U7IHRha2VzIHByaW9yaXR5IG92ZXIgQUxUXG4gICAgICAgICAgaWYgKG1vZGUgPT09IE1PREVfSEFORExFIHx8IG1vZGUgPT09IE1PREVfQ0VOVEVSKSB7XG4gICAgICAgICAgICBpZiAoc2lnblggPCAwKSBlMCA9IGUxIC0gZHg7IGVsc2UgaWYgKHNpZ25YID4gMCkgdzAgPSB3MSAtIGR4O1xuICAgICAgICAgICAgaWYgKHNpZ25ZIDwgMCkgczAgPSBzMSAtIGR5OyBlbHNlIGlmIChzaWduWSA+IDApIG4wID0gbjEgLSBkeTtcbiAgICAgICAgICAgIG1vZGUgPSBNT0RFX1NQQUNFO1xuICAgICAgICAgICAgb3ZlcmxheS5hdHRyKFwiY3Vyc29yXCIsIGN1cnNvcnMuc2VsZWN0aW9uKTtcbiAgICAgICAgICAgIG1vdmUoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgZGVmYXVsdDogcmV0dXJuO1xuICAgICAgfVxuICAgICAgbm9ldmVudCgpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGtleXVwcGVkKCkge1xuICAgICAgc3dpdGNoIChldmVudC5rZXlDb2RlKSB7XG4gICAgICAgIGNhc2UgMTY6IHsgLy8gU0hJRlRcbiAgICAgICAgICBpZiAoc2hpZnRpbmcpIHtcbiAgICAgICAgICAgIGxvY2tYID0gbG9ja1kgPSBzaGlmdGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgbW92ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjYXNlIDE4OiB7IC8vIEFMVFxuICAgICAgICAgIGlmIChtb2RlID09PSBNT0RFX0NFTlRFUikge1xuICAgICAgICAgICAgaWYgKHNpZ25YIDwgMCkgZTAgPSBlMTsgZWxzZSBpZiAoc2lnblggPiAwKSB3MCA9IHcxO1xuICAgICAgICAgICAgaWYgKHNpZ25ZIDwgMCkgczAgPSBzMTsgZWxzZSBpZiAoc2lnblkgPiAwKSBuMCA9IG4xO1xuICAgICAgICAgICAgbW9kZSA9IE1PREVfSEFORExFO1xuICAgICAgICAgICAgbW92ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBjYXNlIDMyOiB7IC8vIFNQQUNFXG4gICAgICAgICAgaWYgKG1vZGUgPT09IE1PREVfU1BBQ0UpIHtcbiAgICAgICAgICAgIGlmIChldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgICAgaWYgKHNpZ25YKSBlMCA9IGUxIC0gZHggKiBzaWduWCwgdzAgPSB3MSArIGR4ICogc2lnblg7XG4gICAgICAgICAgICAgIGlmIChzaWduWSkgczAgPSBzMSAtIGR5ICogc2lnblksIG4wID0gbjEgKyBkeSAqIHNpZ25ZO1xuICAgICAgICAgICAgICBtb2RlID0gTU9ERV9DRU5URVI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoc2lnblggPCAwKSBlMCA9IGUxOyBlbHNlIGlmIChzaWduWCA+IDApIHcwID0gdzE7XG4gICAgICAgICAgICAgIGlmIChzaWduWSA8IDApIHMwID0gczE7IGVsc2UgaWYgKHNpZ25ZID4gMCkgbjAgPSBuMTtcbiAgICAgICAgICAgICAgbW9kZSA9IE1PREVfSEFORExFO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb3ZlcmxheS5hdHRyKFwiY3Vyc29yXCIsIGN1cnNvcnNbdHlwZV0pO1xuICAgICAgICAgICAgbW92ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OiByZXR1cm47XG4gICAgICB9XG4gICAgICBub2V2ZW50KCk7XG4gICAgfVxuICB9XG5cbiAgZn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IT09IFwiZnVuY3Rpb25cIikgcmFkaXVzID0gY29uc3RhbnQocmFkaXVzID09IG51bGwgPyAxIDogK3JhZGl1cyk7XG5cbiAgZnVuY3Rpb24gZm9yY2UoKSB7XG4gICAgdmFyIGksIG4gPSBub2Rlcy5sZW5ndGgsXG4gICAgICAgIHRyZWUsXG4gICAgICAgIG5vZGUsXG4gICAgICAgIHhpLFxuICAgICAgICB5aSxcbiAgICAgICAgcmksXG4gICAgICAgIHJpMjtcblxuICAgIGZvciAodmFyIGsgPSAwOyBrIDwgaXRlcmF0aW9uczsgKytrKSB7XG4gICAgICB0cmVlID0gcXVhZHRyZWUobm9kZXMsIHgsIHkpLnZpc2l0QWZ0ZXIocHJlcGFyZSk7XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIG5vZGUgPSBub2Rlc1tpXTtcbiAgICAgICAgcmkgPSByYWRpaVtub2RlLmluZGV4XSwgcmkyID0gcmkgKiByaTtcbiAgICAgICAgeGkgPSBub2RlLnggKyBub2RlLnZ4O1xuICAgICAgICB5aSA9IG5vZGUueSArIG5vZGUudnk7XG4gICAgICAgIHRyZWUudmlzaXQoYXBwbHkpO1xuICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFwcGx5KHF1YWQsIHgwLCB5MCwgeDEsIHkxKSB7XG4gICAgICB2YXIgZGF0YSA9IHF1YWQuZGF0YSwgcmogPSBxdWFkLnIsIHIgPSByaSArIHJqO1xuICAgICAgaWYgKGRhdGEpIHtcbiAgICAgICAgaWYgKGRhdGEuaW5kZXggPiBub2RlLmluZGV4KSB7XG4gICAgICAgICAgdmFyIHggPSB4aSAtIGRhdGEueCAtIGRhdGEudngsXG4gICAgICAgICAgICAgIHkgPSB5aSAtIGRhdGEueSAtIGRhdGEudnksXG4gICAgICAgICAgICAgIGwgPSB4ICogeCArIHkgKiB5O1xuICAgICAgICAgIGlmIChsIDwgciAqIHIpIHtcbiAgICAgICAgICAgIGlmICh4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ICBmdW5jdGlvbiBpbml0aWFsaXplKCkge1xuICAgIGlmICghbm9kZXMpIHJldHVybjtcblxuICAgIHZhciBpLFxuICAgICAgICBuID0gbm9kZXMubGVuZ3RoLFxuICAgICAgICBtID0gbGlua3MubGVuZ3RoLFxuICAgICAgICBub2RlQnlJZCA9IG1hcChub2RlcywgaWQpLFxuICAgICAgICBsaW5rO1xuXG4gICAgZm9yIChpID0gMCwgY291bnQgPSBuZXcgQXJyYXkobik7IGkgPCBtOyArK2kpIHtcbiAgICAgIGxpbmsgPSBsaW5rc1tpXSwgbGluay5pbmRleCA9IGk7XG4gICAgICBpZiAodHlwZW9mIGxpbmsuc291cmNlICE9PSBcIm9iamVjdFwiKSBsaW5rLnNvdXJjZSA9IGZpbmQobm9kZUJ5SWQsIGxpbmsuc291cmNlKTtcbiAgICAgIGlmICh0eXBlb2YgbGluay50YXJnZXQgIT09IFwib2JqZWN0XCIpIGxpbmsudGFyZ2V0ID0gZmluZChub2RlQnlJZCwgbGluay50YXJnZXQpO1xuICAgICAgY291bnRbbGluay5zb3VyY2UuaW5kZXhdID0gKGNvdW50W2xpbmsuc291cmNlLmluZGV4XSB8fCAwKSArIDE7XG4gICAgICBjb3VudFtsaW5rLnRhcmdldC5pbmRleF0gPSAoY291bnRbbGluay50YXJnZXQuaW5kZXhdIHx8IDApICsgMTtcbiAgICB9XG5cbiAgICBmb3IgKGkgPSAwLCBiaWFzID0gbmV3IEFycmF5KG0pOyBpIDwgbTsgKytpKSB7XG4gICAgICBsaW5rID0gbGlua3NbaV0sIGJpYXNbaV0gPSBjb3VudFtsaW5rLnNvdXJjZS5pbmRleF0gLyAoY291bnRbbGluay5zb3VyY2UuaW5kZXhdICsgY291bnRbbGluay50YXJnZXQuaW5kZXhdKTtcbiAgICB9XG5cbiAgICBzdHJlbmd0aHMgPSBuZXcgQXJyYXkobSksIGluaXRpYWxpemVTdHJlbmd0aCgpO1xuICAgIGRpc3RhbmNlcyA9IG5ldyBBcnJheShtKSwgaW5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QobGFtYmRhLCBwaGkpIHtcbiAgbGFtYmRhICo9IHJhZGlhbnMsIHBoaSAqPSByYWRpYW5zO1xuICB2YXIgY29zUGhpID0gY29zKHBoaSksXG4gICAgICB4ID0gY29zUGhpICogY29zKGxhbWJkYSksXG4gICAgICB5ID0gY29zUGhpICogc2luKGxhbWJkYSksXG4gICAgICB6ID0gc2luKHBoaSksXG4gICAgICBjeCA9IHkwICogeiAtIHowICogeSxcbiAgICAgIGN5ID0gejAgKiB4IC0geDAgKiB6LFxuICAgICAgY3ogPSB4MCAqIHkgLSB5MCAqIHgsXG4gICAgICBtID0gc3FydChjeCAqIGN4ICsgY3kgKiBjeSArIGN6ICogY3opLFxuICAgICAgdyA9IGFzaW4obSksIC8vIGxpbmUgd2VpZ2h0ID0gYW5nbGVcbiAgICAgIHYgPSBtICYmIC13IC8gbTsgLy8gYXJlYSB3ZWlnaHQgbXVsdGlwbGllclxuICBYMiArPSB2ICogY3g7XG4gIFkyICs9IHYgKiBjeTtcbiAgWjIgKz0gdiAqIGN6O1xuICBXMSArPSB3O1xuICBYMSArPSB3ICogKHgwICsgKHgwID0geCkpO1xuICBZMSArPSB3ICogKHkwICsgKHkwID0geSkpO1xuICBaMSArPSB3ICogKHowICsgKHowID0geikpO1xuICBjZW50cm9pZFBvaW50Q2FydGVzaWFuKHgwLCB5MCwgejApO1xufVxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbihvYmplY3QpIHtcbiAgVzAgPSBXMSA9XG4gIFgwID0gWTAgPSBaMCA9XG4gIFgxID0gWTEgPSBaMSA9XG4gIFgyID0gWTIgPSBaMiA9IDA7XG4gIHN0cmVhbShvYmplY3QsIGNlbnRyb2lkU3RyZWFtKTtcblxuICB2YXIgeCA9IFgyLFxuICAgICAgeSA9IFkyLFxuICAgICAgeiA9IFoyLFxuICAgICAgbSA9IHggKiB4ICsgeSAqIHkgKyB6ICogejtcblxuICAvLyBJZiB0aGUgYXJlYS13ZWlnaHRlZCBjY2VudHJvaW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2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgIGlmICghcG9pbnQyIHx8IHBvaW50RXF1YWwocG9pbnQwLCBwb2ludDIpIHx8IHBvaW50RXF1YWwocG9pbnQxLCBwb2ludDIpKVxuICAgICAgICAgICAgcG9pbnQxWzJdID0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgIC8vIG91dHNpZGUgZ29pbmcgaW5cbiAgICAgICAgICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICBzdHJlYW0ucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBpbnNpZGUgZ29pbmcgb3V0XG4gICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgc3RyZWFtLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdLCAyKTtcbiAgICAgICAgICAgIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBvaW50MCA9IHBvaW50MjtcbiAgICAgICAgfSBlbHNlIGlmIChub3RIZW1pc3BoZXJlICYmIHBvaW50MCAmJiBzbWFsbFJhZGl1cyBeIHYpIHtcbiAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAvLyBJZiB0aGUgY29kZXMgZm9yIHR3byBwb2ludHMgYXJlIGRpZmZlcmVudCwgb3IgYXJlIGJvdGggemVybyxcbiAgICAgICAgICAvLyBhbmQgdGhlcmUgdGhpcyBzZWdtZW50IGludGVyc2VjdHMgd2l0aCB0aGUgc21hbGwgY2lyY2xlLlxuICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHNtYWxsUmFkaXVzKSB7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBzdHJlYW0ucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIHN0cmVhbS5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgc3RyZWFtLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0sIDMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodiAmJiAoIXBvaW50MCB8fCAhcG9pbnRFcXVhbChwb2ludDAsIHBvaW50MSkpKSB7XG4gICAgICAgICAgc3RyZWFtLnBvaW50KHBvaW50MVswXSwgcG9pbnQxWzFdKTtcbiAgICAgICAgfVxuICAgICAgICBwb2ludDAgPSBwb2ludDEsIHYwID0gdiwgYzAgPSBjO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodjApIHN0cmVhbS5saW5lRW5kKCk7XG4gICAgICAgIHBvaW50MCA9IG51bGw7XG4gICAgICB9LFxuICAgICAgLy8gUmVqb2luIGZpcnN0IGFuZCBsYXN0IHNlZ21lbnRzIGlmIHRoZXJlIHdlcmUgaW50ZXJzZWN0aW9ucyBhbmQgdGhlIGZp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cbiAgICAgICAgY2xpcC5saW5lRW5kID0gbGluZUVuZDtcbiAgICAgICAgc2VnbWVudHMgPSBtZXJnZShzZWdtZW50cyk7XG4gICAgICAgIHZhciBzdGFydEluc2lkZSA9IHBvbHlnb25Db250YWlucyhwb2x5Z29uLCBzdGFydCk7XG4gICAgICAgIGlmIChzZWdtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICBpZiAoIXBvbHlnb25TdGFydGVkKSBzaW5rLnBvbHlnb25TdGFydCgpLCBwb2x5Z29uU3RhcnRlZCA9IHRydWU7XG4gICAgICAgICAgY2xpcFJlam9pbihzZWdtZW50cywgY29tcGFyZUludGVyc2VjdGlvbiwgc3RhcnRJbnNpZGUsIGludGVycG9sYXRlLCBzaW5rKTtcbiAgICAgICAgfSBlbHNlIGlmIChzdGFydEluc2lkZSkge1xuICAgICAgICAgIGlmICghcG9seWdvblN0YXJ0ZWQpIHNpbmsucG9seWdvblN0YXJ0KCksIHBvbHlnb25TdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgICBzaW5rLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIHNpbmspO1xuICAgICAgICAgIHNpbmsubGluZUVuZCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwb2x5Z29uU3RhcnRlZCkgc2luay5wb2x5Z29uRW5kKCksIHBvbHlnb25TdGFydGVkID0gZmFsc2U7XG4gICAgICAgIHNlZ21lbnRzID0gcG9seWdvbiA9IG51bGw7XG4gICAgICB9LFxuICAgICAgc3BoZXJlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgc2luay5wb2x5Z29uU3RhcnQoKTtcbiAgICAgICAgc2luay5saW5lU3RhcnQoKTtcbiAgICAgICAgaW50ZXJwb2xhdGUobnVsbCwgbnVsbCwgMSwgc2luayk7XG4gICAgICAgIHNpbmsubGluZUVuZCgpO1xuICAgICAgICBzaW5rLnBvbHlnb25FbmQoKTtcbiAgICAgIH1cbiAgICB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XG4gICAgICAgICAgdCA9IHAgKiBrO1xuICAgICAgICAgIGlmICh0IDwgdSkgY29udGludWU7XG4gICAgICAgICAgaWYgKHQgPiB2KSBicmVhaztcbiAgICAgICAgICB6LnB1c2godCk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBmb3IgKDsgaSA8IGo7ICsraSkge1xuICAgICAgICBmb3IgKGsgPSBiYXNlIC0gMSwgcCA9IHBvd3MoaSk7IGsgPj0gMTsgLS1rKSB7XG4gICAgICAgICAgdCA9IHAgKiBrO1xuICAgICAgICAgIGlmICh0IDwgdSkgY29udGludWU7XG4gICAgICAgICAgaWYgKHQgPiB2KSBicmVhaztcbiAgICAgICAgICB6LnB1c2godCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgeiA9IHRpY2tzKGksIGosIE1hdGgubWluKGogLSBpLCBuKSkubWFwKHBvd3MpO1xuICAgIH1cblxuICAgIHJldHVybiByID8gei5yZXZlcnNlKCkgOiB6O1xuICB9O1xuXG4gIHNjYWxlLnRpY2tGb3JtYXQgPSBmdW5jdGlvbihjb3VudCwgc3BlY2lmaWVyKSB7XG4gICAgaWYgKHNwZWNpZmllciA9PSBudWxsKSBzcGVjaWZpZXIgPSBiYXNlID09PSAxMCA/IFwiLjBlXCIgOiBcIixcIjtcbiAgICBpZiAodHlwZW9mIHNwZWNpZmllciAhPT0gXCJmdW5jdGlvblwiKSBzcGVjaWZpZXIgPSBmb3JtYXQoc3BlY2lmaWVyKTtcbiAgICBpZiAoY291bnQgPT09IEluZmluaXR5KSByZXR1cm4gc3BlY2lmaWVyO1xuICAgIGlmIChjb3VudCA9PSBudWxsKSBjb3VudCA9IDEwO1xuICAgIHZhciBrID0gTWF0aC5tYXgoMSwgYmFzZSAqIGNvdW50IC8gc2NhbGUudGlja3MoKS5sZW5ndGgpOyAvLyBUT0RPIGZhc3QgZXN0aW1hdGU/XG4gICAgcmV0dXJuIGZ1bmN0aW9uKGQpIHtcbiA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omlIGRhMC5cbiAgICAgIGlmIChycCA+IGVwc2lsb24pIHtcbiAgICAgICAgdmFyIHAwID0gYXNpbihycCAvIHIwICogc2luKGFwKSksXG4gICAgICAgICAgICBwMSA9IGFzaW4ocnAgLyByMSAqIHNpbihhcCkpO1xuICAgICAgICBpZiAoKGRhMCAtPSBwMCAqIDIpID4gZXBzaWxvbikgcDAgKj0gKGN3ID8gMSA6IC0xKSwgYTAwICs9IHAwLCBhMTAgLT0gcDA7XG4gICAgICAgIGVsc2UgZGEwID0gMCwgYTAwID0gYTEwID0gKGEwICsgYTEpIC8gMjtcbiAgICAgICAgaWYgKChkYTEgLT0gcDEgKiAyKSA+IGVwc2lsb24pIHAxICo9IChjdyA/IDEgOiAtMSksIGEwMSArPSBwMSwgYTExIC09IHAxO1xuICAgICAgICBlbHNlIGRhMSA9IDAsIGEwMSA9IGExMSA9IChhMCArIGExKSAvIDI7XG4gICAgICB9XG5cbiAgICAgIHZhciB4MDEgPSByMSAqIGNvcyhhMDEpLFxuICAgICAgICAgIHkwMSA9IHIxICogc2luKGEwMSksXG4gICAgICAgICAgeDEwID0gcjAgKiBjb3MoYTEwKSxcbiAgICAgICAgICB5MTAgPSByMCAqIHNpbihhMTApO1xuXG4gICAgICAvLyBBcHBseSByb3VuZGVkIGNvcm5lcnM/XG4gICAgICBpZiAocmMgPiBlcHNpbG9uKSB7XG4gICAgICAgIHZhciB4MTEgPSByMSAqIGNvcyhhMTEpLFxuICAgICAgICAgICAgeTExID0gcjEgKiBzaW4oYTExKSxcbiAgICAgICAgICAgIHgwMCA9IHIwICogY29zKGEwMCksXG4gICAgICAgICAgICB5MDAgPSByMCAqIHNpbihhMDApLFxuICAgICAgICAgICAgb2M7XG5cbiAgICAgICAgLy8gUmVzdHJpY3QgdGhlIGNvcm5lciByYWRpdXMgYWNjb3JkaW5nIHRvIHRoZSBzZWN0b3IgYW5nbGUuXG4gICAgICAgIGlmIChkYSA8IHBpICYmIChvYyA9IGludGVyc2VjdCh4MDE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JpZ2h0ID0gbm9kZS5SLFxuICAgICAgICBuZXh0LFxuICAgICAgICByZWQ7XG5cbiAgICBpZiAoIWxlZnQpIG5leHQgPSByaWdodDtcbiAgICBlbHNlIGlmICghcmlnaHQpIG5leHQgPSBsZWZ0O1xuICAgIGVsc2UgbmV4dCA9IFJlZEJsYWNrRmlyc3QocmlnaHQpO1xuXG4gICAgaWYgKHBhcmVudCkge1xuICAgICAgaWYgKHBhcmVudC5MID09PSBub2RlKSBwYXJlbnQuTCA9IG5leHQ7XG4gICAgICBlbHNlIHBhcmVudC5SID0gbmV4dDtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhpcy5fID0gbmV4dDtcbiAgICB9XG5cbiAgICBpZiAobGVmdCAmJiByaWdodCkge1xuICAgICAgcmVkID0gbmV4dC5DO1xuICAgICAgbmV4dC5DID0gbm9kZS5DO1xuICAgICAgbmV4dC5MID0gbGVmdDtcbiAgICAgIGxlZnQuVSA9IG5leHQ7XG4gICAgICBpZiAobmV4dCAhPT0gcmlnaHQpIHtcbiAgICAgICAgcGFyZW50ID0gbmV4dC5VO1xuICAgICAgICBuZXh0LlUgPSBub2RlLlU7XG4gICAgICAgIG5vZGUgPSBuZXh0LlI7XG4gICAgICAgIHBhcmVudC5MID0gbm9kZTtcbiAgICAgICAgbmV4dC5SID0gcmlnaHQ7XG4gICAgICAgIHJpZ2h0LlUgPSBuZXh0O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbmV4dC5VID0gcGFyZW50O1xuICAgICAgICBwYXJlbnQgPSBuZXh0O1xuICAgICAgICBub2RlID0gbmV4dC5SO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICByZWQgPSBub2RlLkM7XG4gICAgICBub2RlID0gbmV4dDtcbiAgICB9XG5cbiAgICBpZiAobm9kZSkgbm9kZS5VID0gcGFyZW50O1xuICAgIGlmIChyZWQpIHJldHVybjtcbiAgICBpZiAobm9kZSAmJiBub2RlLkMpIHsgbm9kZS5DID0gZmFsc2U7IHJldHVybjsgfVxuXG4gICAgZG8ge1xuICAgICAgaWYgKG5vZGUgPT09IHRoaXMuXykgYnJlYWs7XG4gICAgICBpZiAobm9kZSA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgIFJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQylcbiAgICAgICAgICAgIHx8IChzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpKSB7XG4gICAgICAgICAgaWYgKCFzaWJsaW5nLlIgfHwgIXNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgIFJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICBSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICBub2RlID0gdGhpcy5fO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQylcbiAgICAgICAgICB8fCAoc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSkge1xuICAgICAgICAgIGlmICghc2libGluZy5MIHx8ICFzaWJsaW5nLkwuQykge1xuICAgICAgICAgICAgc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICBSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICBSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgIG5vZGUgPSBwYXJlbnQ7XG4gICAgICBwYXJlbnQgPSBwYXJlbnQuVTtcbiAgICB9IHdoaWxlICghbm9kZS5DKTtcblxuICAgIGlmIChub2RlKSBub2RlLkMgPSBmYWxzZTtcbiAgfVxufTtcblxuZnVuY3Rpb24gUmVkQmxhY2tSb3RhdGVMZWZ0KHRyZWUsIG5vZGUpIHtcbiAgdmFyIHAgPSBub2RlLFxuICAgICAgcSA9IG5vZGUuUixcbiAgICAgIHBhcmVudCA9IHAuVTtcblxuICBpZiAocGFyZW50KSB7XG4gICAgaWYgK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BAdHlwZSB7UmVnRXhwfVxuICAgICAgICovXG4gICAgICAnZXNjYXBlJzogcmVFc2NhcGUsXG5cbiAgICAgIC8qKlxuICAgICAgICogVXNlZCB0byBkZXRlY3QgY29kZSB0byBiZSBldmFsdWF0ZWQuXG4gICAgICAgKlxuICAgICAgICogQG1lbWJlck9mIF8udGVtcGxhdGVTZXR0aW5nc1xuICAgICAgICogQHR5cGUge1JlZ0V4cH1cbiAgICAgICAqL1xuICAgICAgJ2V2YWx1YXRlJzogcmVFdmFsdWF0ZSxcblxuICAgICAgLyoqXG4gICAgICAgKiBVc2VkIHRvIGRldGVjdCBgZGF0YWAgcHJvcGVydHkgdmFsdWVzIHRvIGluamVjdC5cbiAgICAgICAqXG4gICAgICAgKiBAbWVtYmVyT2YgXy50ZW1wbGF0ZVNldHRpbmdzXG4gICAgICAgKiBAdHlwZSB7UmVnRXhwfVxuICAgICAgICovXG4gICAgICAnaW50ZXJwb2xhdGUnOiByZUludGVycG9sYXRlLFxuXG4gICAgICAvKipcbiAgICAgICAqIFVzZWQgdG8gcmVmZXJlbmNlIHRoZSBkYXRhIG9iamVjdCBpbiB0aGUgdGVtcGxhdGUgdGV4dC5cbiAgICAgICAqXG4gICAgICAgKiBAbWVtYmVyT2YgXy50ZW1wbGF0ZVNldHRpbmdzXG4gICAgICAgKiBAdHlwZSB7c3RyaW5nfVxuICAgICAgICovXG4gICAgICAndmFyaWFibGUnOiAnJyxcblxuICAgICAgLyoqXG4gICAgICAgKiBVc2VkIHRvIGltcG9ydCB2YXJpYWJsZXMgaW50byB0aGUgY29tcGlsZWQgdGVtcGxhdGUuXG4gICAgICAgKlxuICAgICAgICogQG1lbWJlck9mIF8udGVtcGxhdGVTZXR0aW5nc1xuICAgICAgICogQHR5cGUge09iamVjdH1cbiAgICAgICAqL1xuICAgICAgJ2ltcG9ydHMnOiB7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgcmVmZXJlbmNlIHRvIHRoZSBgbG9kYXNoYCBmd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FycmF5Lmxlbmd0aCA+PSAxMjApKVxuICAgICAgICAgID8gbmV3IFNldENhY2hlKG90aEluZGV4ICYmIGFycmF5KVxuICAgICAgICAgIDogdW5kZWZpbmVkO1xuICAgICAgfVxuICAgICAgYXJyYXkgPSBhcnJheXNbMF07XG5cbiAgICAgIHZhciBpbmRleCA9IC0xLFxuICAgICAgICAgIHNlZW4gPSBjYWNoZXNbMF07XG5cbiAgICAgIG91dGVyOlxuICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGggJiYgcmVzdWx0Lmxlbmd0aCA8IG1heExlbmd0aCkge1xuICAgICAgICB2YXIgdmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBjb21wdXRlZCA9IGl0ZXJhdGVlID8gaXRlcmF0ZWUodmFsdWUpIDogdmFsdWU7XG5cbiAgICAgICAgdmFsdWUgPSAoY29tcGFyYXRvciB8fCB2YWx1ZSAhPT0gMCkgPyB2YWx1ZSA6IDA7XG4gICAgICAgIGlmICghKHNlZW5cbiAgICAgICAgICAgICAgPyBjYWNoZUhhcyhzZWVuLCBjb21wdXRlZClcbiAgICAgICAgICAgICAgOiBpbmNsdWRlcyhyZXN1bHQsIGNvbXB1dGVkLCBjb21wYXJhdG9yKVxuICAgICAgICAgICAgKSkge1xuICAgICAgICAgIG90aEluZGV4ID0gb3RoTGVuZ3RoO1xuICAgICAgICAgIHdoaWxlICgtLW90aEluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY2FjaGUgPSBjYWNoZXNbb3RoSW5kZXhdO1xuICAgICAgICAgICAgaWYgKCEoY2FjaGVcbiAgICAgICAgICAgICAgICAgID8gY2FjaGVIYXMoY2FjaGUsIGNvbXB1dGVkKVxuICAgICAgICAgICAgICAgICAgOiBpbmNsdWRlcyhhcnJheXNbb3RoSW5kZXhdLCBjb21wdXRlZCwgY29tcGFyYXRvcikpXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlIG91dGVyO1x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xuICAgICAgICAgICAgICA/IGRhdGFbMV0gIT09IG9iamVjdFtkYXRhWzBdXVxuICAgICAgICAgICAgICA6ICEoZGF0YVswXSBpbiBvYmplY3QpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIGRhdGEgPSBtYXRjaERhdGFbaW5kZXhdO1xuICAgICAgICB2YXIga2V5ID0gZGF0YVswXSxcbiAgICAgICAgICAgIG9ialZhbHVlID0gb2JqZWN0W2tleV0sXG4gICAgICAgICAgICBzcmNWYWx1ZSA9IGRhdGFbMV07XG5cbiAgICAgICAgaWYgKG5vQ3VzdG9taXplciAmJiBkYXRhWzJdKSB7XG4gICAgICAgICAgaWYgKG9ialZhbHVlID09PSB1bmRlZmluZWQgJiYgIShrZXkgaW4gb2JqZWN0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgc3RhY2sgPSBuZXcgU3RhY2s7XG4gICAgICAgICAgaWYgKGN1c3RvbWl6ZXIpIHtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBjdXN0b21pemVyKG9ialZhbHVlLCBzcmNWYWx1ZSwga2V5LCBvYmplY3QsIHNvdXJjZSwgc3RhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoIShyZXN1bHQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICAgID8gYmFzZUlzRXF1YWwoc3JjVmFsdWUsIG9ialZhbHVlLCBDT01QQVJFX1BBUlRJQUxfRkxBRyB8IENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcsIGN1c3RvbWl6ZXIsIHN0YWNrKVxuICAgICAgICAgICAgICAgIDogcmVzdWx0XG4gICAgICAgICAgICAgICkpIHtcbiAgICAgICAgICAgIHJldHV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mRleC0tKSB7XG4gICAgICAgICAgICBpZiAoc2VlbltzZWVuSW5kZXhdID09PSBjb21wdXRlZCkge1xuICAgICAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGl0ZXJhdGVlKSB7XG4gICAgICAgICAgICBzZWVuLnB1c2goY29tcHV0ZWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoIWluY2x1ZGVzKHNlZW4sIGNvbXB1dGVkLCBjb21wYXJhdG9yKSkge1xuICAgICAgICAgIGlmIChzZWVuICE9PSByZXN1bHQpIHtcbiAgICAgICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy51bnNldGAuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBtb2RpZnkuXG4gICAgICogQHBhcmFtIHtBcnJheXxzdHJpbmd9IHBhdGggVGhlIHByb3BlcnR5IHBhdGggdG8gdW5zZXQuXG4gICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIHRoZSBwcm9wZXJ0eSBpcyBkZWxldGVkLCBlbHNlIGBmYWxzZWAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZVVuc2V0KG9iamVjdCwgcGF0aCkge1xuICAgICAgcGF0aCA9IGNhc3RQYXRoKHBhdGgsIG9iamVjdCk7XG4gICAgICBvYmplY3QgPSBwYXJlbnQob2JqZ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sID0gaXNTeW1ib2wob3RoZXIpO1xuXG4gICAgICAgIGlmICgoIW90aElzTnVsbCAmJiAhb3RoSXNTeW1ib2wgJiYgIXZhbElzU3ltYm9sICYmIHZhbHVlID4gb3RoZXIpIHx8XG4gICAgICAgICAgICAodmFsSXNTeW1ib2wgJiYgb3RoSXNEZWZpbmVkICYmIG90aElzUmVmbGV4aXZlICYmICFvdGhJc051bGwgJiYgIW90aElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKHZhbElzTnVsbCAmJiBvdGhJc0RlZmluZWQgJiYgb3RoSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICAgICAoIXZhbElzRGVmaW5lZCAmJiBvdGhJc1JlZmxleGl2ZSkgfHxcbiAgICAgICAgICAgICF2YWxJc1JlZmxleGl2ZSkge1xuICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICgoIXZhbElzTnVsbCAmJiAhdmFsSXNTeW1ib2wgJiYgIW90aElzU3ltYm9sICYmIHZhbHVlIDwgb3RoZXIpIHx8XG4gICAgICAgICAgICAob3RoSXNTeW1ib2wgJiYgdmFsSXNEZWZpbmVkICYmIHZhbElzUmVmbGV4aXZlICYmICF2YWxJc051bGwgJiYgIXZhbElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKG90aElzTnVsbCAmJiB2YWxJc0RlZmluZWQgJiYgdmFsSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICAgICAoIW90aElzRGVmaW5lZCAmJiB2YWxJc1JlZmxleGl2ZSkgfHxcbiAgICAgICAgICAgICFvdGhJc1JlZmxleGl2ZSkge1xuICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIDA7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVXNlZCBieSBgXy5vcmRlckJ5YCB0byBjb21wYXJlIG11bHRpcGxlIHByb3BlcnRpZXMgb2YgYSB2YWx1ZSB0byBhbm90aGVyXG4gICA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vYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3QgdG8gY29weSBwcm9wZXJ0aWVzIGZyb20uXG4gICAgICogQHBhcmFtIHtBcnJheX0gcHJvcHMgVGhlIHByb3BlcnR5IGlkZW50aWZpZXJzIHRvIGNvcHkuXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBwcm9wZXJ0aWVzIHRvLlxuICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IFtjdXN0b21pemVyXSBUaGUgZnVuY3Rpb24gdG8gY3VzdG9taXplIGNvcGllZCB2YWx1ZXMuXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyBgb2JqZWN0YC5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBjb3B5T2JqZWN0KHNvdXJjZSwgcHJvcHMsIG9iamVjdCwgY3VzdG9taXplcikge1xuICAgICAgdmFyIGlzTmV3ID0gIW9iamVjdDtcbiAgICAgIG9iamVjdCB8fCAob2JqZWN0ID0ge30pO1xuXG4gICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICBsZW5ndGggPSBwcm9wcy5sZW5ndGg7XG5cbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIHZhciBrZXkgPSBwcm9wc1tpbmRleF07XG5cbiAgICAgICAgdmFyIG5ld1ZhbHVlID0gY3VzdG9taXplclxuICAgICAgICAgID8gY3VzdG9taXplcihvYmplY3Rba2V5XSwgc291cmNlW2tleV0sIGtleSwgb2JqZWN0LCBzb3VyY2UpXG4gICAgICAgICAgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgaWYgKG5ld1ZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBuZXdWYWx1ZSA9IHNvdXJjZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05ldykge1xuICAgICAgICAgIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBuZXdWYWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29waWVzIG93biBzeW1ib2xzIG9mIGBzb3VyY2VgIHRvIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIGZyb20uXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIHRvLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29weVN5bWJvbHMoc291cmNlLCBvYmplY3QpIHtcbiAgICAgIHJldHVybiBjb3B5T2JqZWN0KHNvdXJjZSwgZ2V0U3ltYm9scyhzb3VyY2UpLCBvYmplY3QpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENvcGllcyBvd24gYW5kIGluaGVyaXRlZCBzeW1ib2xzIG9mIGBzb3VyY2VgIHRvIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIGZyb20uXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIHRvLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gICAgICovXG4gICAgZnVuY3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md0aCkge1xuICAgICAgICAgIGZ1bmMgPSBmdW5jc1tpbmRleF07XG5cbiAgICAgICAgICB2YXIgZnVuY05hbWUgPSBnZXRGdW5jTmFtZShmdW5jKSxcbiAgICAgICAgICAgICAgZGF0YSA9IGZ1bmNOYW1lID09ICd3cmFwcGVyJyA/IGdldERhdGEoZnVuYykgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICBpZiAoZGF0YSAmJiBpc0xhemlhYmxlKGRhdGFbMF0pICYmXG4gICAgICAgICAgICAgICAgZGF0YVsxXSA9PSAoV1JBUF9BUllfRkxBRyB8IFdSQVBfQ1VSUllfRkxBRyB8IFdSQVBfUEFSVElBTF9GTEFHIHwgV1JBUF9SRUFSR19GTEFHKSAmJlxuICAgICAgICAgICAgICAgICFkYXRhWzRdLmxlbmd0aCAmJiBkYXRhWzldID09IDFcbiAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICB3cmFwcGVyID0gd3JhcHBlcltnZXRGdW5jTmFtZShkYXRhWzBdKV0uYXBwbHkod3JhcHBlciwgZGF0YVszXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHdyYXBwZXIgPSAoZnVuYy5sZW5ndGggPT0gMSAmJiBpc0xhemlhYmxlKGZ1bmMpKVxuICAgICAgICAgICAgICA/IHdyYXBwZXJbZnVuY05hbWVdKClcbiAgICAgICAgICAgICAgOiB3cmFwcGVyLnRocnUoZnVuYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2YXIgYXJncyA9IGFyZ3VtZW50cyxcbiAgICAgICAgICAgICAgdmFsdWUgPSBhcmdzWzBdO1xuXG4gICAgICAgICAgaWYgKHdyYXBwZXIgJiYgYXJncy5sZW5ndGggPT0gMSAmJiBpc0FycmF5KHZhbHVlKSkge1xuICAgICAgICAgICAgcmV0dXJuIHdyYXBwZXIucGxhbnQodmFsdWUpLnZhbHVlKCk7XG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uKG9wZXJhdG9yLCBkZWZhdWx0VmFsdWUpIHtcbiAgICAgIHJldHVybiBmdW5jdGlvbih2YWx1ZSwgb3RoZXIpIHtcbiAgICAgICAgdmFyIHJlc3VsdDtcbiAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgb3RoZXIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHJldHVybiBkZWZhdWx0VmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZhbHVlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICByZXN1bHQgPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3RoZXIgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChyZXN1bHQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuIG90aGVyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlID09ICdzdHJpbmcnIHx8IHR5cGVvZiBvdGhlciA9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdmFsdWUgPSBiYXNlVG9TdHJpbmcodmFsdWUpO1xuICAgICAgICAgICAgb3RoZXIgPSBiYXNlVG9TdHJpbmcob3RoZXIpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YWx1ZSA9IGJhc2VUb051bWJlcih2YWx1ZSk7XG4gICAgICAgICAgICBvdGhlciA9IGJhc2VUb051bWJlcihvdGhlcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdCA9IG9wZXJhdG9yKHZhbHVlLCBvdGhlcik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH07XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhIGZ1bmN0aW9uIGxpa2UgYF8ub3ZlcmAuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbSB7RnVuY3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4gPSAoYml0bWFzayAmIENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcpID8gbmV3IFNldENhY2hlIDogdW5kZWZpbmVkO1xuXG4gICAgICBzdGFjay5zZXQoYXJyYXksIG90aGVyKTtcbiAgICAgIHN0YWNrLnNldChvdGhlciwgYXJyYXkpO1xuXG4gICAgICAvLyBJZ25vcmUgbm9uLWluZGV4IHByb3BlcnRpZXMuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGFyckxlbmd0aCkge1xuICAgICAgICB2YXIgYXJyVmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2luZGV4XTtcblxuICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgIHZhciBjb21wYXJlZCA9IGlzUGFydGlhbFxuICAgICAgICAgICAgPyBjdXN0b21pemVyKG90aFZhbHVlLCBhcnJWYWx1ZSwgaW5kZXgsIG90aGVyLCBhcnJheSwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIoYXJyVmFsdWUsIG90aFZhbHVlLCBpbmRleCwgYXJyYXksIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbXBhcmVkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAoY29tcGFyZWQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIGFycmF5cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgICAgICBpZiAoc2Vlbikge1xuICAgICAgICAgIGlmICghYXJyYXlTb21lKG90aGVyLCBmdW5jdGlvbihvdGhWYWx1ZSwgb3RoSW5kZXgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWNhY2h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iAgICAgICAgICBpZiAoKG9iamVjdC5ieXRlTGVuZ3RoICE9IG90aGVyLmJ5dGVMZW5ndGgpIHx8XG4gICAgICAgICAgICAgIChvYmplY3QuYnl0ZU9mZnNldCAhPSBvdGhlci5ieXRlT2Zmc2V0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBvYmplY3QgPSBvYmplY3QuYnVmZmVyO1xuICAgICAgICAgIG90aGVyID0gb3RoZXIuYnVmZmVyO1xuXG4gICAgICAgIGNhc2UgYXJyYXlCdWZmZXJUYWc6XG4gICAgICAgICAgaWYgKChvYmplY3QuYnl0ZUxlbmd0aCAhPSBvdGhlci5ieXRlTGVuZ3RoKSB8fFxuICAgICAgICAgICAgICAhZXF1YWxGdW5jKG5ldyBVaW50OEFycmF5KG9iamVjdCksIG5ldyBVaW50OEFycmF5KG90aGVyKSkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICAgICAgY2FzZSBib29sVGFnOlxuICAgICAgICBjYXNlIGRhdGVUYWc6XG4gICAgICAgIGNhc2UgbnVtYmVyVGFnOlxuICAgICAgICAgIC8vIENvZXJjZSBib29sZWFucyB0byBgMWAgb3IgYDBgIGFuZCBkYXRlcyB0byBtaWxsaXNlY29uZHMuXG4gICAgICAgICAgLy8gSW52YWxpZCBkYXRlcyBhcmUgY29lcmNlZCB0byBgTmFOYC5cbiAgICAgICAgICByZXR1cm4gZXEoK29iamVjdCwgK290aGVyKTtcblxuICAgICAgICBjYXNlIGVycm9yVGFnOlxuICAgICAgICAgIHJldHVybiBvYmplY3QubmFtZSA9PSBvdGhlci5uYW1lICYmIG9iamVjdC5tZXNzYWdlID09IG90aGVyLm1lc3NhZ2U7XG5cbiAgICAgICAgY2FzZSByZWdleHBUYWc6XG4gICAgICAgIGNhc2Ugc3RyaW5nVGFnOlxuICAgICAgICAgI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2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIC8vIENoZWNrIHRoYXQgY3ljbGljIHZhbHVlcyBhcmUgZXF1YWwuXG4gICAgICB2YXIgb2JqU3RhY2tlZCA9IHN0YWNrLmdldChvYmplY3QpO1xuICAgICAgdmFyIG90aFN0YWNrZWQgPSBzdGFjay5nZXQob3RoZXIpO1xuICAgICAgaWYgKG9ialN0YWNrZWQgJiYgb3RoU3RhY2tlZCkge1xuICAgICAgICByZXR1cm4gb2JqU3RhY2tlZCA9PSBvdGhlciAmJiBvdGhTdGFja2VkID09IG9iamVjdDtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSB0cnVlO1xuICAgICAgc3RhY2suc2V0KG9iamVjdCwgb3RoZXIpO1xuICAgICAgc3RhY2suc2V0KG90aGVyLCBvYmplY3QpO1xuXG4gICAgICB2YXIgc2tpcEN0b3IgPSBpc1BhcnRpYWw7XG4gICAgICB3aGlsZSAoKytpbmRleCA8IG9iakxlbmd0aCkge1xuICAgICAgICBrZXkgPSBvYmpQcm9wc1tpbmRleF07XG4gICAgICAgIHZhciBvYmpWYWx1ZSA9IG9iamVjdFtrZXldLFxuICAgICAgICAgICAgb3RoVmFsdWUgPSBvdGhlcltrZXldO1xuXG4gICAgICAgIGlmIChjdXN0b21pemVyKSB7XG4gICAgICAgICAgdmFyIGNvbXBhcmVkID0gaXNQYXJ0aWFsXG4gICAgICAgICAgICA/IGN1c3RvbWl6ZXIob3RoVmFsdWUsIG9ialZhbHVlLCBrZXksIG90aGVyLCBvYmplY3QsIHN0YWNrKVxuICAgICAgICAgICAgOiBjdXN0b21pemVyKG9ialZhbHVlLCBvdGhWYWx1ZSwga2V5LCBvYmplY3QsIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gUmVjdXJzaXZlbHkgY29tcGFyZSBvYmplY3RzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgIGlmICghK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NoIChlKSB7fVxuICAgICAgICB0cnkge1xuICAgICAgICAgIHJldHVybiAoZnVuYyArICcnKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgIH1cbiAgICAgIHJldHVybiAnJztcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBVcGRhdGVzIHdyYXBwZXIgYGRldGFpbHNgIGJhc2VkIG9uIGBiaXRtYXNrYCBmbGFncy5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHJldHVybnMge0FycmF5fSBkZXRhaWxzIFRoZSBkZXRhaWxzIHRvIG1vZGlmeS5cbiAgICAgKiBAcGFyYW0ge251bWJlcn0gYml0bWFzayBUaGUgYml0bWFzayBmbGFncy4gU2VlIGBjcmVhdGVXcmFwYCBmb3IgbW9yZSBkZXRhaWxzLlxuICAgICAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyBgZGV0YWlsc2AuXG4gICAgICovXG4gICAgZnVuY3Rpb24gdXBkYXRlV3JhcERldGFpbHMoZGV0YWlscywgYml0bWFzaykge1xuICAgICAgYXJyYXlFYWNoKHdyYXBGbGFncywgZnVuY3Rpb24ocGFpcikge1xuICAgICAgICB2YXIgdmFsdWUgPSAnXy4nICsgcGFpclswXTtcbiAgICAgICAgaWYgKChiaXRtYXNrICYgcGFpclsxXSkgJiYgIWFycmF5SW5jbHVkZXMoZGV0YWlscywgdmFsdWUpKSB7XG4gICAgICAgICAgZGV0YWlscy5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gZGV0YWlscy5zb3J0KCk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhIGNsb25lIG9mIGB3cmFwcGVyYC5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBhcmFtIHtPYmplY3R9IHdyYXBwZXIgVGhlIHdyYXBwZXIgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge09iamVjdH0gU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B2YXIgdmFsdWUgPSBhcnJheVtpbmRleF07XG4gICAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICAgIHJlc3VsdFtyZXNJbmRleCsrXSA9IHZhbHVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYSBuZXcgYXJyYXkgY29uY2F0ZW5hdGluZyBgYXJyYXlgIHdpdGggYW55IGFkZGl0aW9uYWwgYXJyYXlzXG4gICAgICogYW5kL29yIHZhbHVlcy5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjAuMFxuICAgICAqIEBjYXRlZ29yeSBBcnJheVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBjb25jYXRlbmF0ZS5cbiAgICAgKiBAcGFyYW0gey4uLip9IFt2YWx1ZXNdIFRoZSB2YWx1ZXMgdG8gY29uY2F0ZW5hdGUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBuZXcgY29uY2F0ZW5hdGVkIGFycmF5LlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiB2YXIgYXJyYXkgPSBbMV07XG4gICAgICogdmFyIG90aGVyID0gXy5jb25jYXQoYXJyYXksIDIsIFszXSwgW1s0XV0pO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob3RoZXIpO1xuICAgICAqIC8vID0+IFsxLCAyLCAzLCBbNF1dXG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzFdXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29uY2F0KCkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFyZ3VtZW50cy5sZW5ndGg7XG4gICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICByZXR1cm4gW107XG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ICAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyB0aGUgbmV3IGFycmF5IG9mIHJlbW92ZWQgZWxlbWVudHMuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsxLCAyLCAzLCA0XTtcbiAgICAgKiB2YXIgZXZlbnMgPSBfLnJlbW92ZShhcnJheSwgZnVuY3Rpb24obikge1xuICAgICAqICAgcmV0dXJuIG4gJSAyID09IDA7XG4gICAgICogfSk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzEsIDNdXG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhldmVucyk7XG4gICAgICogLy8gPT4gWzIsIDRdXG4gICAgICovXG4gICAgZnVuY3Rpb24gcmVtb3ZlKGFycmF5LCBwcmVkaWNhdGUpIHtcbiAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgIGlmICghKGFycmF5ICYmIGFycmF5Lmxlbmd0aCkpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICAgIHZhciBpbmRleCA9IC0xLFxuICAgICAgICAgIGluZGV4ZXMgPSBbXSxcbiAgICAgICAgICBsZW5ndGggPSBhcnJheS5sZW5ndGg7XG5cbiAgICAgIHByZWRpY2F0ZSA9IGdldEl0ZXJhdGVlKHByZWRpY2F0ZSwgMyk7XG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgdmFsdWUgPSBhcnJheVtpbmRleF07XG4gICAgICAgIGlmIChwcmVkaWNhdGUodmFsdWUsIGluZGV4LCBhcnJheSkpIHtcbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgaW5kZXhlcy5wdXNoKGluZGV4KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgYmFzZVB1bGxBdChhcnJheSwgaW5kZXhlcyk7XG4gICAgICByZXR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ICAgICBpZiAocmVzdWx0KSB7XG4gICAgICAgICAgcHJldmlvdXMuX193cmFwcGVkX18gPSBjbG9uZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXN1bHQgPSBjbG9uZTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgcHJldmlvdXMgPSBjbG9uZTtcbiAgICAgICAgcGFyZW50ID0gcGFyZW50Ll9fd3JhcHBlZF9fO1xuICAgICAgfVxuICAgICAgcHJldmlvdXMuX193cmFwcGVkX18gPSB2YWx1ZTtcbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgdGhlIHdyYXBwZXIgdmVyc2lvbiBvZiBgXy5yZXZlcnNlYC5cbiAgICAgKlxuICAgICAqICoqTm90ZToqKiBUaGlzIG1ldGhvZCBtdXRhdGVzIHRoZSB3cmFwcGVkIGFycmF5LlxuICAgICAqXG4gICAgICogQG5hbWUgcmV2ZXJzZVxuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDAuMS4wXG4gICAgICogQGNhdGVnb3J5IFNlcVxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIG5ldyBgbG9kYXNoYCB3cmFwcGVyIGluc3RhbmNlLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiB2YXIgYXJyYXkgPSBbMSwgMiwgM107XG4gICAgICpcbiAgICAgKiBfKGFycmF5KS5yZXZlcnNlKCkudmFsdWUoKVxuICAgICAqIC8vID0+IFszLCAyLCAxXVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXkpO1xuICAgICAqIC8vID0+IFszLCAyLCAxXVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIHdyYXBwZXJSZXZlcnNlKCkge1xuICAgICAgdmFyIHZhbHVlID0gdGhpcy5fX3dyYXBwZWRfXztcbiAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9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N0QXJncykge1xuICAgICAgICAgIHJldHVybiBpbnZva2VGdW5jKHRpbWUpO1xuICAgICAgICB9XG4gICAgICAgIGxhc3RBcmdzID0gbGFzdFRoaXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGNhbmNlbCgpIHtcbiAgICAgICAgaWYgKHRpbWVySWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGNsZWFyVGltZW91dCh0aW1lcklkKTtcbiAgICAgICAgfVxuICAgICAgICBsYXN0SW52b2tlVGltZSA9IDA7XG4gICAgICAgIGxhc3RBcmdzID0gbGFzdENhbGxUaW1lID0gbGFzdFRoaXMgPSB0aW1lcklkID0gdW5kZWZpbmVkO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBmbHVzaCgpIHtcbiAgICAgICAgcmV0dXJuIHRpbWVySWQgPT09IHVuZGVmaW5lZCA/IHJlc3VsdCA6IHRyYWlsaW5nRWRnZShub3coKSk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGRlYm91bmNlZCgpIHtcbiAgICAgICAgdmFyIHRpbWUgPSBub3coKSxcbiAgICAgICAgICAgIGlzSW52b2tpbmcgPSBzaG91bGRJbnZva2UodGltZSk7XG5cbiAgICAgICAgbGFzdEFyZ3MgPSBhcmd1bWVudHM7XG4gICAgICAgIGxhc3RUaGlzID0gdGhpcztcbiAgICAgICAgbGFzdENhbGxUaW1lID0gdGltZTtcblxuICAgICAgICBpZiAoaXNJbnZva2luZykge1xuICAgICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBsZWFkaW5nRWRnZShsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobWF4aW5nKSB7XG4gICAgICAgICAgICAvLyBIYW5kbGUgaW52b2NhdGlvbnMgaW4gYSB0aWdodCBsb29wLlxuICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVySWQpO1xuICAgICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnZva2VGdW5jKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aW1lcklkID0gc2V0VGltZW91dCh0aW1lckV4cGlyZWQsIHdhaXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG4gICAgICBkZWJvdW5jZWQuY2FuY2VsID0gY2FuY2VsO1xuICAgICAgZGVib3VuY2VkLmZsdXNoID0gZmx1c2g7XG4gICAgICByZXR1cm4gZGVib3VuY2VkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIERlZmVycyBpbnZva2luZyB0aGUgYGZ1bmNgIHVudGlsIHRoZSBjdXJyZW50IGNhbGwgc3RhY2sgaGFzIGNsZWFyZWQuIEFueVxuICAgICAqIGFkZGl0aW9uYWwgYXJndW1lbnRzIGFyZSBwcm92aWRlZCB0byBgZnVuY2Agd2hlbiBpdCdzIGludm9rZWQuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgMC4xLjBcbiAgICAgKiBAY2F0ZWdvcnkgRnVuY3Rpb25cbiAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBmdW5jIFRoZSBmdW5jdGlvbiB0byBkZWZlci5cbiAgICAgKiBAcGFyYW0gey4uLip9IFthcmdzXSBUaGUgYXJndW1lbnRzIHRvIGludm9rZSBgZnVuY2Agd2l0aC5cbiAgICAgKiBAcmV0dXJucyB7bnVtYmVyfSBSZXR1cm5zIHRoZSB0aW1lciBpZC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgIC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5hc3NpZ25JblxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBmdW5jdGlvbiBGb28oKSB7XG4gICAgICogICB0aGlzLmEgPSAxO1xuICAgICAqIH1cbiAgICAgKlxuICAgICAqIGZ1bmN0aW9uIEJhcigpIHtcbiAgICAgKiAgIHRoaXMuYyA9IDM7XG4gICAgICogfVxuICAgICAqXG4gICAgICogRm9vLnByb3RvdHlwZS5iID0gMjtcbiAgICAgKiBCYXIucHJvdG90eXBlLmQgPSA0O1xuICAgICAqXG4gICAgICogXy5hc3NpZ24oeyAnYSc6IDAgfSwgbmV3IEZvbywgbmV3IEJhcik7XG4gICAgICogLy8gPT4geyAnYSc6IDEsICdjJzogMyB9XG4gICAgICovXG4gICAgdmFyIGFzc2lnbiA9IGNyZWF0ZUFzc2lnbmVyKGZ1bmN0aW9uKG9iamVjdCwgc291cmNlKSB7XG4gICAgICBpZiAoaXNQcm90b3R5cGUoc291cmNlKSB8fCBpc0FycmF5TGlrZShzb3VyY2UpKSB7XG4gICAgICAgIGNvcHlPYmplY3Qoc291cmNlLCBrZXlzKHNvdXJjZSksIG9iamVjdCk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIGtleSBpbiBzb3VyY2UpIHtcbiAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwoc291cmNlLCBrZXkpKSB7XG4gICAgICAgICAgYXNzaWduVmFsdWUob2JqZWN0LCBrZXksIHNvdXJjZVtrZXldKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgbGlrZSBgXy5hc3NpZ25gIGV4Y2VwdCB0aGF0IGl0IGl0ZXJhdGVzIG92ZXIgb3duIGFuZFxuICAgICAqIGluaGVyaXRlZCBzb3VyY2UgcHJvcGVydGllcy5cbiAgICAgKlxuICAgICAqICoqTm90ZToqKiBUaGlzIG1ldGhvZCBtdXRhdGVzIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGFsaWFzIGV4dGVuZFxuICAgICAqIEBjYXRlZ29yeSBPYmplY3RcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBkZXN0aW5hdGlvbiBvYmplY3QuXG4gICAgICogQHBhcmFtIHsuLi5PYmplY3R9IFtzb3VyY2VzXSBUaGUgc291cmNlIG9iamVjdHMuXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyBgb2JqZWN0YC5cbiAgICAgKiBAc2VlIF8uYXNzaWduXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIGZ1bmN0aW9uIEZvbygpIHtcbiAgICAgKiAgIHRoaXMuYSA9IDE7XG4gICAgICogfVxuICAgICAqXG4gICAgICogZnVuY3Rpb24gQmFyKCkge1xuICAgICAqICAgdGhpcy5jID0gMztcbiAgICAgKiB9XG4gICAgICpcbiAgICAgKiBGb28ucHJvdG90eXBlLmIgPSAyO1xuICAgICAqIEJhci5wcm90b3R5cGUuZCA9IDQ7XG4gICAgICpcbiAgICAgKiBfLmFzc2lnbkluKHsgJ2EnOiAwIH0sIG5ldyBGb28sIG5ldyBCYXIpO1xuICAgICAqIC8vID0+IHsgJ2EnOiAxLCAnYic6IDIsICdjJzogMywgJ2QnOiA0IH1cbiAgICAgKi9cbiAgICB2YXIgYXNzaWduSW4gPSBjcmVhdGVBc3NpZ25lcihmdW5jdGlvbihvYmplY3QsIHNvdXJjZSkge1xuICAgICAgY29weU9iamVjdChzb3VyY2UsIGtleXNJbihzb3VyY2UpLCBvYmplY3QpO1xuICAgIH0pO1xuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgbGlrZSBgXy5hc3NpZ25JbmAgZXhjZXB0IHRoYXQgaXQgYWNjZXB0cyBgY3VzdG9taXplcmBcbiAgICAgKi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IgbGVuZ3RoID0gc291cmNlcy5sZW5ndGg7XG4gICAgICB2YXIgZ3VhcmQgPSBsZW5ndGggPiAyID8gc291cmNlc1syXSA6IHVuZGVmaW5lZDtcblxuICAgICAgaWYgKGd1YXJkICYmIGlzSXRlcmF0ZWVDYWxsKHNvdXJjZXNbMF0sIHNvdXJjZXNbMV0sIGd1YXJkKSkge1xuICAgICAgICBsZW5ndGggPSAxO1xuICAgICAgfVxuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgc291cmNlID0gc291cmNlc1tpbmRleF07XG4gICAgICAgIHZhciBwcm9wcyA9IGtleXNJbihzb3VyY2UpO1xuICAgICAgICB2YXIgcHJvcHNJbmRleCA9IC0xO1xuICAgICAgICB2YXIgcHJvcHNMZW5ndGggPSBwcm9wcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKCsrcHJvcHNJbmRleCA8IHByb3BzTGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGtleSA9IHByb3BzW3Byb3BzSW5kZXhdO1xuICAgICAgICAgIHZhciB2YWx1ZSA9IG9iamVjdFtrZXldO1xuXG4gICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgKGVxKHZhbHVlLCBvYmplY3RQcm90b1trZXldKSAmJiAhaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpKSB7XG4gICAgICAgICAgICBvYmplY3Rba2V5XSA9IHNvdXJjZVtrZXldO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH0pO1xuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgbGlrZSBgXy5kZWZhdWx0c2AgZXhjZXB0IHRoYXQgaXQgcmVjdXJzaXZlbHkgYXNzaWduc1xuICAgICAqIGRlZmF1bHQgcHJvcGVydGllcy5cbiAgICAgKlxuICAgIC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AgaWYgKCF2YXJpYWJsZSkge1xuICAgICAgICBzb3VyY2UgPSAnd2l0aCAob2JqKSB7XFxuJyArIHNvdXJjZSArICdcXG59XFxuJztcbiAgICAgIH1cbiAgICAgIC8vIFRocm93IGFuIGVycm9yIGlmIGEgZm9yYmlkZGVuIGNoYXJhY3RlciB3YXMgZm91bmQgaW4gYHZhcmlhYmxlYCwgdG8gcHJldmVudFxuICAgICAgLy8gcG90ZW50aWFsIGNvbW1hbmQgaW5qZWN0aW9uIGF0dGFja3MuXG4gICAgICBlbHNlIGlmIChyZUZvcmJpZGRlbklkZW50aWZpZXJDaGFycy50ZXN0KHZhcmlhYmxlKSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoSU5WQUxJRF9URU1QTF9WQVJfRVJST1JfVEVYVCk7XG4gICAgICB9XG5cbiAgICAgIC8vIENsZWFudXAgY29kZSBieSBzdHJpcHBpbmcgZW1wdHkgc3RyaW5ncy5cbiAgICAgIHNvdXJjZSA9IChpc0V2YWx1YXRpbmcgPyBzb3VyY2UucmVwbGFjZShyZUVtcHR5U3RyaW5nTGVhZGluZywgJycpIDogc291cmNlKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nTWlkZGxlLCAnJDEnKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nVHJhaWxpbmcsICckMTsnKTtcblxuICAgICAgLy8gRnJhbWUgY29kZSBhcyB0aGUgZnVuY3Rpb24gYm9keS5cbiAgICAgIHNvdXJjZSA9ICdmdW5jdGlvbignICsgKHZhcmlhYmxlIHx8ICdvYmonKSArICcpIHtcXG4nICtcbiAgICAgICAgKHZhcmlhYmxlXG4gICAgICAgICAgPyAnJ1xuICAgICAgICAgIDogJ29iaiB8fCAob2JqID0ge30pO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIFwidmFyIF9fdCwgX19wID0gJydcIiArXG4gICAgICAgIChpc0VzY2FwaW5nXG4gICAgICAgICAgID8gJywgX19lID0gXy5lc2N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AgICogdmFyIGFycmF5cyA9IF8udGltZXMoMiwgXy5zdHViQXJyYXkpO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzKTtcbiAgICAgKiAvLyA9PiBbW10sIFtdXVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzWzBdID09PSBhcnJheXNbMV0pO1xuICAgICAqIC8vID0+IGZhbHNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkFycmF5KCkge1xuICAgICAgcmV0dXJuIFtdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYGZhbHNlYC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGBmYWxzZWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udGltZXMoMiwgXy5zdHViRmFsc2UpO1xuICAgICAqIC8vID0+IFtmYWxzZSwgZmFsc2VdXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkZhbHNlKCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgb2JqZWN0LlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGVtcHR5IG9iamVjdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBfLnRpbWVzKDIsIF8uc3R1Yk9iamVjdCk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhvYmplY3RzKTtcbiAgICAgKiAvLyA9PiBbe30sIHt9XVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob2JqZWN0c1swXSA9PT0gb2JqZWN0c1sxXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViT2JqZWN0KCkge1xuICAgICAgcmV0dXJuIHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgZW1wdHkgc3RyaW5nLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRpbWVzKDIsIF8uc3R1YlN0cmluZyk7XG4gICAgICogLy8gPT4gWycnLCAnJ11cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViU3RyaW5nKCkge1xuICAgICAgcmV0dXJuICcnO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYHRydWVgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRpbWVzKDIsIF8uc3R1YlRydWUpO1xuICAgICAqIC8vID0+IFt0cnVlLCB0cnVlXVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIHN0dWJUcnVlKCkge1xuICAgICAgcmV0dXJuIHRyd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